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 bfc55fef89089fc43c6a352de860374ca3fcfd53 Mon Sep 17 00:00:00 2001 From: Thomas Mueller Date: Tue, 8 Jan 2013 00:24:35 +0100 Subject: bring back L250 as spotted by @tanghus - THX --- core/js/js.js | 1 + 1 file changed, 1 insertion(+) (limited to 'core/js/js.js') diff --git a/core/js/js.js b/core/js/js.js index 710ef416b69..e2775fa7220 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -247,6 +247,7 @@ 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')) { -- cgit v1.2.3 From 508b6a9fc79326bcf6d060f1daf42f5b67bfaeec Mon Sep 17 00:00:00 2001 From: Thomas Mueller Date: Fri, 11 Jan 2013 11:52:07 +0100 Subject: displaying notification now centered The notification div has been moved to the user templates. Correct display of the notification will only work with the use of OC.Notification.show() as on fadeIn() the css needs to be changed as this style required display: inline. --- apps/files/templates/index.php | 1 - core/css/styles.css | 3 ++- core/js/js.js | 4 ++-- core/templates/layout.user.php | 5 ++++- settings/templates/users.php | 2 -- 5 files changed, 8 insertions(+), 7 deletions(-) (limited to 'core/js/js.js') diff --git a/apps/files/templates/index.php b/apps/files/templates/index.php index 77c06007da4..b66b523ae38 100644 --- a/apps/files/templates/index.php +++ b/apps/files/templates/index.php @@ -50,7 +50,6 @@ -
t('Nothing in here. Upload something!')?>
diff --git a/core/css/styles.css b/core/css/styles.css index 496320561f8..e7ad777f719 100644 --- a/core/css/styles.css +++ b/core/css/styles.css @@ -190,7 +190,8 @@ fieldset.warning legend { color:#b94a48 !important; } .bold { font-weight:bold; } .center { text-align:center; } -#notification { z-index:101; background-color:#fc4; border:0; padding:0 .7em .3em; display:none; position:fixed; left:50%; top:0; -moz-border-radius-bottomleft:1em; -webkit-border-bottom-left-radius:1em; border-bottom-left-radius:1em; -moz-border-radius-bottomright:1em; -webkit-border-bottom-right-radius:1em; border-bottom-right-radius:1em; } +#notification-container { position: absolute; top: 0px; width: 100%; text-align: center; z-index: 101; line-height: 1.2;} +#notification { z-index:101; background-color:#fc4; border:0; padding:0 .7em .3em; display:none; position: relative; top:0; -moz-border-radius-bottomleft:1em; -webkit-border-bottom-left-radius:1em; border-bottom-left-radius:1em; -moz-border-radius-bottomright:1em; -webkit-border-bottom-right-radius:1em; border-bottom-right-radius:1em; } #notification span { cursor:pointer; font-weight:bold; margin-left:1em; } tr .action, .selectedActions a { -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; filter:alpha(opacity=0); opacity:0; } diff --git a/core/js/js.js b/core/js/js.js index 10758a90722..e724be9c2d5 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -311,13 +311,13 @@ OC.Notification={ var notification = $('#notification'); notification.hide(); notification.html(html); - notification.fadeIn(); + notification.fadeIn().css("display","inline"); }, show: function(text) { var notification = $('#notification'); notification.hide(); notification.text(text); - notification.fadeIn(); + notification.fadeIn().css("display","inline"); } }; diff --git a/core/templates/layout.user.php b/core/templates/layout.user.php index ba5053edecf..be9eff80553 100644 --- a/core/templates/layout.user.php +++ b/core/templates/layout.user.php @@ -40,7 +40,10 @@ -