feature(edit) add showMessage

This commit is contained in:
coderaiser 2013-09-23 07:44:20 +00:00
parent 055d4ca2d1
commit 8896434fc9

View file

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