From ba475d486258c0b7ea86cd766814053df6c69170 Mon Sep 17 00:00:00 2001 From: Thomas Mueller Date: Fri, 4 Jan 2013 23:34:09 +0100 Subject: javascript notification functions have been moved to js.js for common use --- core/js/js.js | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'core/js/js.js') 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:[], -- cgit v1.2.3 From a867b36e7f99c648252ba2a1c04888ba21c1405f Mon Sep 17 00:00:00 2001 From: Thomas Mueller Date: Sun, 6 Jan 2013 10:41:07 +0100 Subject: js optimisations and style fixes --- core/js/js.js | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) (limited to 'core/js/js.js') diff --git a/core/js/js.js b/core/js/js.js index 4e35547c058..710ef416b69 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); @@ -247,7 +247,6 @@ var OC={ var popup = $('#appsettings_popup'); if(popup.length == 0) { $('body').prepend(''); - popup = $('#appsettings_popup'); popup.addClass(settings.hasClass('topright') ? 'topright' : 'bottomleft'); } if(popup.is(':visible')) { @@ -308,14 +307,16 @@ OC.Notification={ }); }, showHtml: function(html) { - $('#notification').hide(); - $('#notification').html(html); - $('#notification').fadeIn(); + var notification = $('#notification'); + notification.hide(); + notification.html(html); + notification.fadeIn(); }, show: function(text) { - $('#notification').hide(); - $('#notification').text(text); - $('#notification').fadeIn(); + var notification = $('#notification'); + notification.hide(); + notification.text(text); + notification.fadeIn(); } }; -- cgit v1.2.3 From d39655e1269494dd1c8cad06c972e8884cace8ea Mon Sep 17 00:00:00 2001 From: Michael Gapczynski Date: Mon, 7 Jan 2013 14:15:51 -0500 Subject: Move template parameters around so database error page is properly rendered --- core/js/js.js | 2 +- core/templates/layout.base.php | 1 - core/templates/layout.guest.php | 1 - lib/db.php | 8 ++++++-- lib/setup.php | 4 +++- lib/templatelayout.php | 17 +++++------------ 6 files changed, 15 insertions(+), 18 deletions(-) (limited to 'core/js/js.js') diff --git a/core/js/js.js b/core/js/js.js index 610950995db..b7442f303ac 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -88,7 +88,7 @@ var OC={ PERMISSION_DELETE:8, PERMISSION_SHARE:16, webroot:oc_webroot, - appswebroots:oc_appswebroots, + appswebroots:(typeof oc_appswebroots !== 'undefined') ? oc_appswebroots:false, currentUser:(typeof oc_current_user!=='undefined')?oc_current_user:false, coreApps:['', 'admin','log','search','settings','core','3rdparty'], /** diff --git a/core/templates/layout.base.php b/core/templates/layout.base.php index 47f4b423b3e..cb2f9773839 100644 --- a/core/templates/layout.base.php +++ b/core/templates/layout.base.php @@ -10,7 +10,6 @@ diff --git a/core/templates/layout.guest.php b/core/templates/layout.guest.php index 8395426e4e4..5b39503474d 100644 --- a/core/templates/layout.guest.php +++ b/core/templates/layout.guest.php @@ -10,7 +10,6 @@