diff options
author | Thomas Mueller <thomas.mueller@tmit.eu> | 2013-01-28 09:57:24 +0100 |
---|---|---|
committer | Thomas Mueller <thomas.mueller@tmit.eu> | 2013-01-28 09:57:24 +0100 |
commit | 1d44a99ebb5f00b3b9550f4c281db7519cec3c75 (patch) | |
tree | 43a6ab3a67421bbf6589f757a97088eb16dff08b /core/js/js.js | |
parent | dbc13cf6ee775745c86f92d97d636f9ed3cf5432 (diff) | |
parent | 31d83fddc482959d7fb4f7377cc7020c59c30951 (diff) | |
download | nextcloud-server-1d44a99ebb5f00b3b9550f4c281db7519cec3c75.tar.gz nextcloud-server-1d44a99ebb5f00b3b9550f4c281db7519cec3c75.zip |
Merge branch 'master' into updater-CSP
Conflicts:
core/templates/update.php
Diffstat (limited to 'core/js/js.js')
-rw-r--r-- | core/js/js.js | 53 |
1 files changed, 44 insertions, 9 deletions
diff --git a/core/js/js.js b/core/js/js.js index 6e0a405114b..01e47edf268 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -37,14 +37,14 @@ function t(app,text, vars){ t.cache[app] = []; } } - var _build = function(text, vars) { - return text.replace(/{([^{}]*)}/g, - function (a, b) { - var r = vars[b]; - return typeof r === 'string' || typeof r === 'number' ? r : a; - } - ); - } + var _build = function (text, vars) { + return text.replace(/{([^{}]*)}/g, + function (a, b) { + var r = vars[b]; + return typeof r === 'string' || typeof r === 'number' ? r : a; + } + ); + }; if( typeof( t.cache[app][text] ) !== 'undefined' ){ if(typeof vars === 'object') { return _build(t.cache[app][text], vars); @@ -268,7 +268,7 @@ var OC={ var popup = $('#appsettings_popup'); if(popup.length == 0) { $('body').prepend('<div class="popup hidden" id="appsettings_popup"></div>'); - popup = $('#appsettings_popup'); + popup = $('#appsettings_popup'); popup.addClass(settings.hasClass('topright') ? 'topright' : 'bottomleft'); } if(popup.is(':visible')) { @@ -310,6 +310,41 @@ 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 (OC.Notification.isHidden()) { + if (OC.Notification.getDefaultNotificationFunction) { + OC.Notification.getDefaultNotificationFunction.call(); + } + } + if (callback) { + callback.call(); + } + }); + }, + showHtml: function(html) { + var notification = $('#notification'); + notification.hide(); + notification.html(html); + notification.fadeIn().css("display","inline"); + }, + show: function(text) { + var notification = $('#notification'); + notification.hide(); + notification.text(text); + notification.fadeIn().css("display","inline"); + }, + isHidden: function() { + return ($("#notification").text() === ''); + } +}; + OC.Breadcrumb={ container:null, crumbs:[], |