Commit f46b82d9 authored by yann300's avatar yann300

load gist to gist explorer

parent e1f0843f
...@@ -409,14 +409,16 @@ function run () { ...@@ -409,14 +409,16 @@ function run () {
}) })
// Add files received from remote instance (i.e. another browser-solidity) // Add files received from remote instance (i.e. another browser-solidity)
function loadFiles (filesSet) { function loadFiles (filesSet, fileProvider) {
if (!fileProvider) fileProvider = 'browser'
for (var f in filesSet) { for (var f in filesSet) {
var name = helper.createNonClashingName(f, filesProviders['browser']) var name = helper.createNonClashingName(f, filesProviders[fileProvider])
if (helper.checkSpecialChars(name)) { if (helper.checkSpecialChars(name)) {
modalDialogCustom.alert('Special characters are not allowed') modalDialogCustom.alert('Special characters are not allowed')
return return
} }
filesProviders['browser'].set(name, filesSet[f].content) filesProviders[fileProvider].set(name, filesSet[f].content)
} }
fileManager.switchFile() fileManager.switchFile()
} }
...@@ -444,7 +446,7 @@ function run () { ...@@ -444,7 +446,7 @@ function run () {
modalDialogCustom.alert('Gist load error: ' + response.data.message) modalDialogCustom.alert('Gist load error: ' + response.data.message)
return return
} }
loadFiles(response.data.files) loadFiles(response.data.files, 'gist')
} }
} }
}) })
......
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