Commit 66144ce3 authored by serapath's avatar serapath

CompileTab: remove jQuery

parent fb6e90c4
/* 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 { ...@@ -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) { ...@@ -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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment