summaryrefslogtreecommitdiffstats
path: root/core/js
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2013-01-26 04:15:40 -0800
committerThomas Müller <thomas.mueller@tmit.eu>2013-01-26 04:15:40 -0800
commit276d98b9ddd18c216956b2c9916583e8098186d0 (patch)
treeeafc40da091c41e8e40d5ce9948c85b0dbe976dc /core/js
parent3b547895ec0c8b076bf31abdb53079ba8fa983db (diff)
parent5d6c1d52bdb5aa3addc26d1e105749a8eda35301 (diff)
downloadnextcloud-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.js53
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:[],