diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/js/js.js | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/core/js/js.js b/core/js/js.js index ec890be4541..21ccee0f1d5 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){ + OC.msg.startAction(selector, t('core', '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, |