summaryrefslogtreecommitdiffstats
path: root/core
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
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')
-rw-r--r--core/css/styles.css3
-rw-r--r--core/js/js.js53
-rw-r--r--core/templates/layout.user.php5
3 files changed, 50 insertions, 11 deletions
diff --git a/core/css/styles.css b/core/css/styles.css
index 3c172d11df8..022acab4d8a 100644
--- a/core/css/styles.css
+++ b/core/css/styles.css
@@ -191,7 +191,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: fixed; 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 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:[],
diff --git a/core/templates/layout.user.php b/core/templates/layout.user.php
index c6e928ca33c..18291e0f84e 100644
--- a/core/templates/layout.user.php
+++ b/core/templates/layout.user.php
@@ -24,7 +24,10 @@
</head>
<body id="<?php echo $_['bodyid'];?>">
- <header><div id="header">
+ <div id="notification-container">
+ <div id="notification"></div>
+ </div>
+ <header><div id="header">
<a href="<?php echo link_to('', 'index.php'); ?>" title="" id="owncloud"><img class="svg" src="<?php echo image_path('', 'logo-wide.svg'); ?>" alt="ownCloud" /></a>
<a class="header-right header-action" id="logout" href="<?php echo link_to('', 'index.php'); ?>?logout=true"><img class="svg" alt="<?php echo $l->t('Log out');?>" title="<?php echo $l->t('Log out'); echo OC_User::getUser()?' ('.OC_User::getUser().') ':'' ?>" src="<?php echo image_path('', 'actions/logout.svg'); ?>" /></a>
<form class="searchbox header-right" action="#" method="post">