mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
Added message when loading an animation from Service
This commit is contained in:
parent
110bc050b2
commit
509ffcea2a
@ -152,7 +152,8 @@ ul, li {
|
||||
border: #F0C36D 1px solid;
|
||||
border-bottom: 0;
|
||||
font-weight: bold;
|
||||
font-size: 14px;
|
||||
font-size: 14px;
|
||||
z-index: 10000;
|
||||
}
|
||||
|
||||
/* Force apparition of scrollbars on leopard */
|
||||
|
28
js/piskel.js
28
js/piskel.js
@ -55,6 +55,7 @@
|
||||
|
||||
var frameId = this.getFrameIdFromUrl();
|
||||
if (frameId) {
|
||||
this.displayMessage("Loading animation with id : [" + frameId + "]");
|
||||
this.loadFramesheetFromService(frameId);
|
||||
} else {
|
||||
this.finishInit();
|
||||
@ -86,10 +87,12 @@
|
||||
|
||||
xhr.onload = function(e) {
|
||||
frameSheet.deserialize(this.responseText);
|
||||
piskel.removeMessage();
|
||||
piskel.finishInit();
|
||||
};
|
||||
|
||||
xhr.onerror = function () {
|
||||
piskel.removeMessage();
|
||||
piskel.finishInit();
|
||||
};
|
||||
|
||||
@ -98,16 +101,25 @@
|
||||
|
||||
initLocalStorageBackup: function() {
|
||||
if(window.localStorage && window.localStorage['snapShot']) {
|
||||
var message = document.createElement('div');
|
||||
message.id = "user-message";
|
||||
message.className = "user-message";
|
||||
var reloadLink = "<a href='#' onclick='piskel.restoreFromLocalStorage()'>reload</a>";
|
||||
var discardLink = "<a href='#' onclick='piskel.cleanLocalStorage()'>discard</a>";
|
||||
message.innerHTML = "Non saved version found. " + reloadLink + " or " + discardLink;
|
||||
message.onclick = function() {
|
||||
message.parentNode.removeChild(message);
|
||||
};
|
||||
document.body.appendChild(message);
|
||||
this.displayMessage("Non saved version found. " + reloadLink + " or " + discardLink);
|
||||
}
|
||||
},
|
||||
|
||||
displayMessage : function (content) {
|
||||
var message = document.createElement('div');
|
||||
message.id = "user-message";
|
||||
message.className = "user-message";
|
||||
message.innerHTML = content;
|
||||
message.onclick = this.removeMessage;
|
||||
document.body.appendChild(message);
|
||||
},
|
||||
|
||||
removeMessage : function () {
|
||||
var message = $("user-message");
|
||||
if (message) {
|
||||
message.parentNode.removeChild(message);
|
||||
}
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user