зеркало из https://github.com/mozilla/pluotsorbet.git
Merge pull request #775 from mykmelez/notify-import-complete
alert developer that import completed
This commit is contained in:
Коммит
4462116496
9
index.js
9
index.js
|
@ -85,11 +85,6 @@ var DumbPipe = {
|
|||
},
|
||||
|
||||
sendMessage: function(pipeID, message) {
|
||||
// Sadly, we have no way to send a message to the other side directly.
|
||||
// Instead, we change the hash part of the other side's URL, which triggers
|
||||
// a hashchange event on the other side. A listener on the other side
|
||||
// then sends us a "get" prompt, and we set its return value to the message.
|
||||
// Oh my shod, that's some funky git!
|
||||
var envelope = { pipeID: pipeID, message: message };
|
||||
//console.log("outer send: " + JSON.stringify(envelope));
|
||||
|
||||
|
@ -124,6 +119,10 @@ document.getElementById("mozbrowser").addEventListener("mozbrowsershowmodalpromp
|
|||
DumbPipe.handleEvent.bind(DumbPipe),
|
||||
true);
|
||||
|
||||
DumbPipe.registerOpener("alert", function(message, sender) {
|
||||
alert(message);
|
||||
});
|
||||
|
||||
DumbPipe.registerOpener("mobileInfo", function(message, sender) {
|
||||
// Initialize the object with the URL params and fallback placeholders
|
||||
// for testing/debugging on a desktop.
|
||||
|
|
|
@ -301,7 +301,6 @@ var fs = (function() {
|
|||
}
|
||||
|
||||
Store.prototype.import = function(file, cb) {
|
||||
console.log("file: " + file);
|
||||
var reader = new FileReader();
|
||||
reader.onload = (function() {
|
||||
var input = JSON.parse(reader.result);
|
||||
|
|
4
main.js
4
main.js
|
@ -183,7 +183,9 @@ window.onload = function() {
|
|||
});
|
||||
};
|
||||
document.getElementById("importstorage").addEventListener("change", function(event) {
|
||||
fs.importStore(event.target.files[0]);
|
||||
fs.importStore(event.target.files[0], function() {
|
||||
DumbPipe.close(DumbPipe.open("alert", "Import completed."));
|
||||
});
|
||||
}, false);
|
||||
document.getElementById("trace").onclick = function() {
|
||||
VM.DEBUG = !VM.DEBUG;
|
||||
|
|
Загрузка…
Ссылка в новой задаче