diff --git a/lib/client/edit.js b/lib/client/edit.js index 0e4d3277..85b8c964 100644 --- a/lib/client/edit.js +++ b/lib/client/edit.js @@ -11,6 +11,7 @@ var CloudCmd, Util, DOM, JsDiff, ace; Value, Edit = this, Ace, + Msg, Key = CloudCmd.Key, Images = DOM.Images, @@ -121,7 +122,12 @@ var CloudCmd, Util, DOM, JsDiff, ace; var lPath = DOM.getCurrentPath(), lValue = Ace.getValue(); - DOM.RESTfull.save(lPath, lValue); + DOM.RESTfull.save(lPath, lValue, function() { + var name = DOM.getCurrentName(), + msg = 'save: ok("' + name + '")'; + + Edit.showMessage(msg); + }); } }); } @@ -152,6 +158,38 @@ var CloudCmd, Util, DOM, JsDiff, ace; Edit.show(); } } + + this.showMessage = function(text) { + var parent, + TWO_SECONDS = 2000; + + if (!Msg) { + DOM.cssSet({ + id : 'msg-css', + inner : '.msg {' + + 'z-index' + ': 1;' + + 'background-color' + ': white;' + + 'color' + ': rgb(49, 123, 249);' + + 'position' + ': fixed;' + + 'left' + ': 40%;' + + 'padding' + ': 5px;' + + 'opacity' + ': 0.9;' + + 'transition' + ': ease 0.5s;' + + '}' + }); + parent = Element;//.parentElement; + + Msg = DOM.anyload({ + name : 'div', + className : 'msg', + parent : parent + }); + } + + Msg.innerHTML = text; + DOM.show(Msg); + setTimeout(Util.retExec(DOM.hide, Msg), 2000); + }; } })(CloudCmd, Util, DOM);