|
|
@ -3,6 +3,7 @@ |
|
|
|
var $ = require('jquery') |
|
|
|
var $ = require('jquery') |
|
|
|
var csjs = require('csjs-inject') |
|
|
|
var csjs = require('csjs-inject') |
|
|
|
var yo = require('yo-yo') |
|
|
|
var yo = require('yo-yo') |
|
|
|
|
|
|
|
var async = require('async') |
|
|
|
var remixLib = require('remix-lib') |
|
|
|
var remixLib = require('remix-lib') |
|
|
|
var EventManager = remixLib.EventManager |
|
|
|
var EventManager = remixLib.EventManager |
|
|
|
|
|
|
|
|
|
|
@ -463,15 +464,21 @@ Please make a backup of your contracts and start using http://remix.ethereum.org |
|
|
|
function loadFiles (filesSet, fileProvider) { |
|
|
|
function loadFiles (filesSet, fileProvider) { |
|
|
|
if (!fileProvider) fileProvider = 'browser' |
|
|
|
if (!fileProvider) fileProvider = 'browser' |
|
|
|
|
|
|
|
|
|
|
|
for (var f in filesSet) { |
|
|
|
async.each(Object.keys(filesSet), (file, callback) => { |
|
|
|
var name = helper.createNonClashingName(f, filesProviders[fileProvider]) |
|
|
|
helper.createNonClashingName(file, filesProviders[fileProvider], |
|
|
|
if (helper.checkSpecialChars(name)) { |
|
|
|
(error, name) => { |
|
|
|
modalDialogCustom.alert('Special characters are not allowed') |
|
|
|
if (error) { |
|
|
|
return |
|
|
|
modalDialogCustom.alert('Unexpected error loading the file ' + error) |
|
|
|
} |
|
|
|
} else if (helper.checkSpecialChars(name)) { |
|
|
|
filesProviders[fileProvider].set(name, filesSet[f].content) |
|
|
|
modalDialogCustom.alert('Special characters are not allowed') |
|
|
|
} |
|
|
|
} else { |
|
|
|
fileManager.switchFile() |
|
|
|
filesProviders[fileProvider].set(name, filesSet[file].content) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
callback() |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, (error) => { |
|
|
|
|
|
|
|
if (!error) fileManager.switchFile() |
|
|
|
|
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Replace early callback with instant response
|
|
|
|
// Replace early callback with instant response
|
|
|
|