From 149d079fd4648f761820b13525bbb9064f9d5710 Mon Sep 17 00:00:00 2001 From: Bart Visscher Date: Thu, 7 Feb 2013 08:09:53 +0100 Subject: [PATCH 1/4] Move loading of js_config to templatelayout Also check for installed flag because this isn't available before setup --- core/templates/layout.base.php | 1 - core/templates/layout.guest.php | 1 - core/templates/layout.user.php | 1 - lib/templatelayout.php | 3 +++ 4 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/templates/layout.base.php b/core/templates/layout.base.php index 47fb75612c..2049bcb36d 100644 --- a/core/templates/layout.base.php +++ b/core/templates/layout.base.php @@ -7,7 +7,6 @@ - diff --git a/core/templates/layout.guest.php b/core/templates/layout.guest.php index 9aabc08ace..69330aa9fc 100644 --- a/core/templates/layout.guest.php +++ b/core/templates/layout.guest.php @@ -8,7 +8,6 @@ - diff --git a/core/templates/layout.user.php b/core/templates/layout.user.php index 2547278547..de38239572 100644 --- a/core/templates/layout.user.php +++ b/core/templates/layout.user.php @@ -8,7 +8,6 @@ - diff --git a/lib/templatelayout.php b/lib/templatelayout.php index 37ece91047..a14c36c93d 100644 --- a/lib/templatelayout.php +++ b/lib/templatelayout.php @@ -36,6 +36,9 @@ class OC_TemplateLayout extends OC_Template { // Add the js files $jsfiles = self::findJavascriptFiles(OC_Util::$scripts); $this->assign('jsfiles', array(), false); + if (OC_Config::getValue('installed', false)) { + $this->append( 'jsfiles', OC_Helper::linkToRoute('js_config')); + } if (!empty(OC_Util::$core_scripts)) { $this->append( 'jsfiles', OC_Helper::linkToRemoteBase('core.js', false)); } From c0b370f6cf8bf2ec3f4af921fc9f6935238ca41d Mon Sep 17 00:00:00 2001 From: Bart Visscher Date: Thu, 7 Feb 2013 08:11:18 +0100 Subject: [PATCH 2/4] Define the variables that are expected to exist but won't be set in setup --- core/js/js.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/js/js.js b/core/js/js.js index 6b0c289850..80914e954e 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -5,6 +5,9 @@ * To the end of config/config.php to enable debug mode. * The undefined checks fix the broken ie8 console */ +var oc_debug; +var oc_webroot; +var oc_requesttoken; if (oc_debug !== true || typeof console === "undefined" || typeof console.log === "undefined") { if (!window.console) { window.console = {}; From 458ba4b55c38999a1eecb0163b167ba97365a403 Mon Sep 17 00:00:00 2001 From: Bart Visscher Date: Thu, 7 Feb 2013 08:12:09 +0100 Subject: [PATCH 3/4] Fix disabling setup form on submit --- core/js/setup.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/core/js/setup.js b/core/js/setup.js index 9aded6591c..2656cac2f4 100644 --- a/core/js/setup.js +++ b/core/js/setup.js @@ -52,12 +52,10 @@ $(document).ready(function() { // Save form parameters var post = $(this).serializeArray(); - // FIXME: This lines are breaking the installation // Disable inputs - // $(':submit', this).attr('disabled','disabled').val('Finishing …'); - // $('input', this).addClass('ui-state-disabled').attr('disabled','disabled'); - // $('#selectDbType').button('disable'); - // $('label.ui-button', this).addClass('ui-state-disabled').attr('aria-disabled', 'true').button('disable'); + $(':submit', this).attr('disabled','disabled').val('Finishing …'); + $('input', this).addClass('ui-state-disabled').attr('disabled','disabled'); + $('#selectDbType').buttonset('disable'); // Create the form var form = $('
'); From a82d18d2f8e13edab296daaf2bda917381e78810 Mon Sep 17 00:00:00 2001 From: Bart Visscher Date: Thu, 7 Feb 2013 21:13:57 +0100 Subject: [PATCH 4/4] Fill oc_webroot with the expected value --- core/js/js.js | 1 + 1 file changed, 1 insertion(+) diff --git a/core/js/js.js b/core/js/js.js index 80914e954e..c137f734d9 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -8,6 +8,7 @@ var oc_debug; var oc_webroot; var oc_requesttoken; +oc_webroot = oc_webroot || location.pathname.substr(0, location.pathname.lastIndexOf('/')); if (oc_debug !== true || typeof console === "undefined" || typeof console.log === "undefined") { if (!window.console) { window.console = {};