|
|
@ -27,11 +27,12 @@ function Editor (loadingFromGist, storage) { |
|
|
|
|
|
|
|
|
|
|
|
this.uploadFile = function (file, callback) { |
|
|
|
this.uploadFile = function (file, callback) { |
|
|
|
var fileReader = new FileReader(); |
|
|
|
var fileReader = new FileReader(); |
|
|
|
|
|
|
|
var cacheName = utils.fileKey(file.name); |
|
|
|
|
|
|
|
|
|
|
|
SOL_CACHE_FILE = utils.fileKey(file.name); |
|
|
|
|
|
|
|
fileReader.onload = function (e) { |
|
|
|
fileReader.onload = function (e) { |
|
|
|
storage.set(SOL_CACHE_FILE, e.target.result); |
|
|
|
storage.set(cacheName, e.target.result); |
|
|
|
sessions[SOL_CACHE_FILE] = null; |
|
|
|
sessions[cacheName] = null; |
|
|
|
|
|
|
|
SOL_CACHE_FILE = cacheName; |
|
|
|
callback(); |
|
|
|
callback(); |
|
|
|
}; |
|
|
|
}; |
|
|
|
fileReader.readAsText(file); |
|
|
|
fileReader.readAsText(file); |
|
|
|