CompileTab: remove jQuery

pull/1/head
serapath 7 years ago
parent fb6e90c4f0
commit 66144ce35f
  1. 10
      src/app/tabs/compile-tab.js
  2. 2
      src/app/ui/renderer.js

@ -1,5 +1,3 @@
/* global */
var $ = require('jquery')
var yo = require('yo-yo') var yo = require('yo-yo')
var csjs = require('csjs-inject') var csjs = require('csjs-inject')
@ -93,25 +91,25 @@ class CompileTab {
var error = false var error = false
if (data['error']) { if (data['error']) {
error = true error = true
self._opts.renderer.error(data['error'].formattedMessage, $(errorContainer), {type: data['error'].severity}) self._opts.renderer.error(data['error'].formattedMessage, errorContainer, {type: data['error'].severity})
} }
if (data['errors']) { if (data['errors']) {
if (data['errors'].length) error = true if (data['errors'].length) error = true
data['errors'].forEach(function (err) { data['errors'].forEach(function (err) {
self._opts.renderer.error(err.formattedMessage, $(errorContainer), {type: err.severity}) self._opts.renderer.error(err.formattedMessage, errorContainer, {type: err.severity})
}) })
} }
if (!error) { if (!error) {
if (data.contracts) { if (data.contracts) {
self._opts.compiler.visitContracts((contract) => { self._opts.compiler.visitContracts((contract) => {
self._opts.renderer.error(contract.name, $(errorContainer), {type: 'success'}) self._opts.renderer.error(contract.name, errorContainer, {type: 'success'})
}) })
} }
} }
}) })
self._events.staticAnalysis.register('staticAnaysisWarning', (count) => { self._events.staticAnalysis.register('staticAnaysisWarning', (count) => {
if (count) { if (count) {
self._opts.renderer.error(`Static Analysis raised ${count} warning(s) that requires your attention.`, $(errorContainer), { self._opts.renderer.error(`Static Analysis raised ${count} warning(s) that requires your attention.`, errorContainer, {
type: 'warning', type: 'warning',
click: () => self._api.switchTab('staticanalysisView') click: () => self._api.switchTab('staticanalysisView')
}) })

@ -56,7 +56,7 @@ Renderer.prototype.error = function (message, container, opt) {
var $pre = $(opt.useSpan ? yo`<span />` : yo`<pre />`).html(message) var $pre = $(opt.useSpan ? yo`<span />` : yo`<pre />`).html(message)
var $error = $(yo`<div class="sol ${opt.type}"><div class="close"><i class="fa fa-close"></i></div></div>`).prepend($pre) var $error = $(yo`<div class="sol ${opt.type}"><div class="close"><i class="fa fa-close"></i></div></div>`).prepend($pre)
container.append($error) $(container).append($error)
$error.click((ev) => { $error.click((ev) => {
if (opt.errFile && opt.errLine) { if (opt.errFile && opt.errLine) {

Loading…
Cancel
Save