summaryrefslogtreecommitdiffstats
path: root/core/js
diff options
context:
space:
mode:
authorMichael Gapczynski <mtgap@owncloud.com>2012-08-14 10:20:00 -0400
committerMichael Gapczynski <mtgap@owncloud.com>2012-08-14 10:22:13 -0400
commit4c7fd8cd0191871e48704f693f48554d4ee7a726 (patch)
treea66a930783de938deaa3d2362dcf779e5c2b45af /core/js
parent64ef1e21819979d7fdc406d2628bc175b16fe554 (diff)
parent62e4f55f721971dacd06649cecefe0487626aa75 (diff)
downloadnextcloud-server-4c7fd8cd0191871e48704f693f48554d4ee7a726.tar.gz
nextcloud-server-4c7fd8cd0191871e48704f693f48554d4ee7a726.zip
Merge branch 'master' into share_api
Conflicts: lib/group.php lib/group/backend.php lib/group/database.php lib/group/interface.php lib/public/user.php lib/user.php lib/user/backend.php lib/user/database.php lib/user/interface.php
Diffstat (limited to 'core/js')
-rw-r--r--core/js/backgroundjobs.js25
-rw-r--r--core/js/js.js64
2 files changed, 58 insertions, 31 deletions
diff --git a/core/js/backgroundjobs.js b/core/js/backgroundjobs.js
new file mode 100644
index 00000000000..4a558a66b4b
--- /dev/null
+++ b/core/js/backgroundjobs.js
@@ -0,0 +1,25 @@
+/**
+* ownCloud
+*
+* @author Jakob Sack
+* @copyright 2012 Jakob Sack owncloud@jakobsack.de
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
+* License as published by the Free Software Foundation; either
+* version 3 of the License, or any later version.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
+*
+* You should have received a copy of the GNU Affero General Public
+* License along with this library. If not, see <http://www.gnu.org/licenses/>.
+*
+*/
+
+// start worker once page has loaded
+$(document).ready(function(){
+ $.get( OC.webroot+'/cron.php' );
+});
diff --git a/core/js/js.js b/core/js/js.js
index 7bded8e1414..92a2660fd9c 100644
--- a/core/js/js.js
+++ b/core/js/js.js
@@ -175,39 +175,41 @@ OC={
if(settings.length == 0) {
throw { name: 'MissingDOMElement', message: 'There has be be an element with id "appsettings" for the popup to show.' };
}
- if(settings.is(':visible')) {
- settings.hide().find('.arrow').hide();
+ var popup = $('#appsettings_popup');
+ if(popup.length == 0) {
+ $('body').prepend('<div class="popup hidden" id="appsettings_popup"></div>');
+ popup = $('#appsettings_popup');
+ popup.addClass(settings.hasClass('topright') ? 'topright' : 'bottomleft');
+ }
+ if(popup.is(':visible')) {
+ popup.hide().remove();
} else {
- if($('#journal.settings').length == 0) {
- var arrowclass = settings.hasClass('topright') ? 'up' : 'left';
- var jqxhr = $.get(OC.filePath(props.appid, '', props.scriptName), function(data) {
- $('#appsettings').html(data).ready(function() {
- settings.prepend('<span class="arrow '+arrowclass+'"></span><h2>'+t('core', 'Settings')+'</h2><a class="close svg"></a>').show();
- settings.find('.close').bind('click', function() {
- settings.hide();
- })
- if(typeof props.loadJS !== 'undefined') {
- var scriptname;
- if(props.loadJS === true) {
- scriptname = 'settings.js';
- } else if(typeof props.loadJS === 'string') {
- scriptname = props.loadJS;
- } else {
- throw { name: 'InvalidParameter', message: 'The "loadJS" parameter must be either boolean or a string.' };
- }
- if(props.cache) {
- $.ajaxSetup({cache: true});
- }
- $.getScript(OC.filePath(props.appid, 'js', scriptname))
- .fail(function(jqxhr, settings, e) {
- throw e;
- });
+ var arrowclass = settings.hasClass('topright') ? 'up' : 'left';
+ var jqxhr = $.get(OC.filePath(props.appid, '', props.scriptName), function(data) {
+ popup.html(data).ready(function() {
+ popup.prepend('<span class="arrow '+arrowclass+'"></span><h2>'+t('core', 'Settings')+'</h2><a class="close svg"></a>').show();
+ popup.find('.close').bind('click', function() {
+ popup.remove();
+ })
+ if(typeof props.loadJS !== 'undefined') {
+ var scriptname;
+ if(props.loadJS === true) {
+ scriptname = 'settings.js';
+ } else if(typeof props.loadJS === 'string') {
+ scriptname = props.loadJS;
+ } else {
+ throw { name: 'InvalidParameter', message: 'The "loadJS" parameter must be either boolean or a string.' };
}
- });
- }, 'html');
- } else {
- settings.show().find('.arrow').show();
- }
+ if(props.cache) {
+ $.ajaxSetup({cache: true});
+ }
+ $.getScript(OC.filePath(props.appid, 'js', scriptname))
+ .fail(function(jqxhr, settings, e) {
+ throw e;
+ });
+ }
+ }).show();
+ }, 'html');
}
}
};