Merge pull request #775 from mykmelez/notify-import-complete

alert developer that import completed
This commit is contained in:
Marco 2014-12-23 13:21:29 +01:00
Родитель f8fd6b064a ee075a3d64
Коммит 4462116496
3 изменённых файлов: 7 добавлений и 7 удалений

Просмотреть файл

@ -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);

Просмотреть файл

@ -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;