comply with linter

pull/3094/head
Iuri Matias 7 years ago
parent f5395f8863
commit 1e3811340d
  1. 4
      src/app.js
  2. 56
      src/app/compiler/compiler-imports.js

@ -201,10 +201,10 @@ function run () {
if (provider && provider.exists(url)) {
return provider.get(url, cb)
}
handleImports.import(url,
handleImports.import(url,
(loadingMsg) => {
$('#output').append($('<div/>').append($('<pre/>').text(loadingMsg)))
}
},
(error, content, cleanUrl, type, url) => {
if (!error) {
filesProviders[type].addReadOnly(cleanUrl, content, url)

@ -6,22 +6,23 @@ var request = require('request')
module.exports = {
handleGithubCall: function (root, path, cb) {
return request.get(
{
url: 'https://api.github.com/repos/' + root + '/contents/' + path,
json: true,
headers: {
'User-Agent': 'Remix'
}
}, (err, r, data) => {
if (err) {
return cb(err || 'Unknown transport error')
}
if ('content' in data) {
cb(null, base64.decode(data.content), root + '/' + path)
} else {
cb('Content not received')
}
});
{
url: 'https://api.github.com/repos/' + root + '/contents/' + path,
json: true,
headers: {
'User-Agent': 'Remix'
}
},
(err, r, data) => {
if (err) {
return cb(err || 'Unknown transport error')
}
if ('content' in data) {
cb(null, base64.decode(data.content), root + '/' + path)
} else {
cb('Content not received')
}
})
},
handleSwarmImport: function (url, cb) {
@ -35,17 +36,18 @@ module.exports = {
url = url.replace(/^ipfs:\/\/?/, 'ipfs/')
return request.get(
{
url: 'https://gateway.ipfs.io/' + url,
headers: {
'User-Agent': 'Remix'
}
}, (err, r, data) => {
if (err) {
return cb(err || 'Unknown transport error')
}
cb(null, data, url)
})
{
url: 'https://gateway.ipfs.io/' + url,
headers: {
'User-Agent': 'Remix'
}
},
(err, r, data) => {
if (err) {
return cb(err || 'Unknown transport error')
}
cb(null, data, url)
})
},
handlers: function () {

Loading…
Cancel
Save