Commit 088b11b4 authored by Iuri Matias's avatar Iuri Matias

move loading message display to the caller of the compiler

parent 1cb05f7d
...@@ -201,14 +201,18 @@ function run () { ...@@ -201,14 +201,18 @@ function run () {
if (provider && provider.exists(url)) { if (provider && provider.exists(url)) {
return provider.get(url, cb) return provider.get(url, cb)
} }
handleImports.import(url, (error, content, cleanUrl, type, url) => { handleImports.import(url,
if (!error) { (loadingMsg) => {
filesProviders[type].addReadOnly(cleanUrl, content, url) $('#output').append($('<div/>').append($('<pre/>').text(loadingMsg)))
cb(null, content)
} else {
cb(error)
} }
}) (error, content, cleanUrl, type, url) => {
if (!error) {
filesProviders[type].addReadOnly(cleanUrl, content, url)
cb(null, content)
} else {
cb(error)
}
})
}) })
var offsetToLineColumnConverter = new OffsetToLineColumnConverter(compiler.event) var offsetToLineColumnConverter = new OffsetToLineColumnConverter(compiler.event)
......
...@@ -48,7 +48,7 @@ module.exports = { ...@@ -48,7 +48,7 @@ module.exports = {
] ]
}, },
import: function (url, cb) { import: function (url, loadingCb, cb) {
var handlers = this.handlers() var handlers = this.handlers()
var found = false var found = false
...@@ -61,8 +61,7 @@ module.exports = { ...@@ -61,8 +61,7 @@ module.exports = {
if (match) { if (match) {
found = true found = true
// TODO: this needs to be moved to the caller loadingCb('Loading ' + url + ' ...')
$('#output').append($('<div/>').append($('<pre/>').text('Loading ' + url + ' ...')))
handler.handler(match, function (err, content, cleanUrl) { handler.handler(match, function (err, content, cleanUrl) {
if (err) { if (err) {
cb('Unable to import "' + cleanUrl + '": ' + err) cb('Unable to import "' + cleanUrl + '": ' + err)
......
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