summaryrefslogtreecommitdiffstats
path: root/core/js/js.js
diff options
context:
space:
mode:
authorThomas Mueller <thomas.mueller@tmit.eu>2013-01-04 23:34:09 +0100
committerThomas Mueller <thomas.mueller@tmit.eu>2013-01-04 23:34:09 +0100
commitba475d486258c0b7ea86cd766814053df6c69170 (patch)
tree131ed440130701db53aee9137c07af49efe8310e /core/js/js.js
parent48f6dccdb768126ae71a1e4de4eca184891a6115 (diff)
downloadnextcloud-server-ba475d486258c0b7ea86cd766814053df6c69170.tar.gz
nextcloud-server-ba475d486258c0b7ea86cd766814053df6c69170.zip
javascript notification functions have been moved to js.js for common use
Diffstat (limited to 'core/js/js.js')
-rw-r--r--core/js/js.js30
1 files changed, 30 insertions, 0 deletions
diff --git a/core/js/js.js b/core/js/js.js
index 7d967321d93..b57603b7b2f 100644
--- a/core/js/js.js
+++ b/core/js/js.js
@@ -289,6 +289,36 @@ OC.search.lastResults={};
OC.addStyle.loaded=[];
OC.addScript.loaded=[];
+OC.Notification={
+ getDefaultNotificationFunction: null,
+ setDefault: function(callback) {
+ OC.Notification.getDefaultNotificationFunction = callback;
+ },
+ hide: function(callback) {
+ $("#notification").text('');
+ $('#notification').fadeOut('400', function(){
+ if ($("#notification").text() === '') {
+ if (OC.Notification.getDefaultNotificationFunction) {
+ OC.Notification.getDefaultNotificationFunction.call();
+ }
+ }
+ if (callback) {
+ callback.call();
+ }
+ });
+ },
+ showHtml: function(html) {
+ $('#notification').hide();
+ $('#notification').html(html);
+ $('#notification').fadeIn();
+ },
+ show: function(text) {
+ $('#notification').hide();
+ $('#notification').text(text);
+ $('#notification').fadeIn();
+ }
+};
+
OC.Breadcrumb={
container:null,
crumbs:[],