summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2014-02-19 10:20:52 +0100
committerJoas Schilling <nickvergessen@gmx.de>2014-02-19 10:20:52 +0100
commitfdb0d2067ff66017a3cae76f1da7b18e94dc5364 (patch)
treeb1b9e4585f0ffd7755c2431aaa543972b2132d5a /core
parent8387cd8ae35a0ad94a49a27ad8622bb7b8ed2b06 (diff)
downloadnextcloud-server-fdb0d2067ff66017a3cae76f1da7b18e94dc5364.tar.gz
nextcloud-server-fdb0d2067ff66017a3cae76f1da7b18e94dc5364.zip
Remove duplicated definition and move OC.msg to js/js.js
Fix issue #7166
Diffstat (limited to 'core')
-rw-r--r--core/js/js.js28
1 files changed, 28 insertions, 0 deletions
diff --git a/core/js/js.js b/core/js/js.js
index cb177712a3a..ac79f13a6d1 100644
--- a/core/js/js.js
+++ b/core/js/js.js
@@ -467,6 +467,34 @@ OC.search.lastResults={};
OC.addStyle.loaded=[];
OC.addScript.loaded=[];
+OC.msg={
+ startSaving:function(selector, message){
+ OC.msg.startAction(selector, t('settings', 'Saving...'));
+ },
+ finishedSaving:function(selector, data){
+ OC.msg.finishedAction(selector, data);
+ },
+ startAction:function(selector, message){
+ $(selector)
+ .html( message )
+ .removeClass('success')
+ .removeClass('error')
+ .stop(true, true)
+ .show();
+ },
+ finishedAction:function(selector, data){
+ if( data.status === "success" ){
+ $(selector).html( data.data.message )
+ .addClass('success')
+ .stop(true, true)
+ .delay(3000)
+ .fadeOut(900);
+ }else{
+ $(selector).html( data.data.message ).addClass('error');
+ }
+ }
+};
+
OC.Notification={
queuedNotifications: [],
getDefaultNotificationFunction: null,