diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2013-01-26 04:15:40 -0800 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2013-01-26 04:15:40 -0800 |
commit | 276d98b9ddd18c216956b2c9916583e8098186d0 (patch) | |
tree | eafc40da091c41e8e40d5ce9948c85b0dbe976dc /core/js | |
parent | 3b547895ec0c8b076bf31abdb53079ba8fa983db (diff) | |
parent | 5d6c1d52bdb5aa3addc26d1e105749a8eda35301 (diff) | |
download | nextcloud-server-276d98b9ddd18c216956b2c9916583e8098186d0.tar.gz nextcloud-server-276d98b9ddd18c216956b2c9916583e8098186d0.zip |
Merge pull request #1059 from owncloud/fixing-998-master
Fixing 998 master
Diffstat (limited to 'core/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:[], |