diff options
author | Lukas Reschke <lukas@statuscode.ch> | 2013-01-25 19:18:16 +0100 |
---|---|---|
committer | Lukas Reschke <lukas@statuscode.ch> | 2013-01-25 19:18:16 +0100 |
commit | dbc13cf6ee775745c86f92d97d636f9ed3cf5432 (patch) | |
tree | c0c37f634cc84f3c8d71d4d50cb9dafe54d2a122 | |
parent | 7f49d359306cbcd3303fcdd7feb0e6931ecffd8d (diff) | |
download | nextcloud-server-dbc13cf6ee775745c86f92d97d636f9ed3cf5432.tar.gz nextcloud-server-dbc13cf6ee775745c86f92d97d636f9ed3cf5432.zip |
Move update inline JS
-rw-r--r-- | core/js/update.js | 24 | ||||
-rw-r--r-- | core/templates/update.php | 28 | ||||
-rw-r--r-- | lib/base.php | 1 |
3 files changed, 26 insertions, 27 deletions
diff --git a/core/js/update.js b/core/js/update.js new file mode 100644 index 00000000000..c10aa013e6a --- /dev/null +++ b/core/js/update.js @@ -0,0 +1,24 @@ +$(document).ready(function () { + OC.EventSource.requesttoken = oc_requesttoken; + var updateEventSource = new OC.EventSource(OC.webroot+'/core/ajax/update.php'); + updateEventSource.listen('success', function(message) { + $('<span>').append(message).append('<br />').appendTo($('.update')); + }); + updateEventSource.listen('error', function(message) { + $('<span>').addClass('error').append(message).append('<br />').appendTo($('.update')); + }); + updateEventSource.listen('failure', function(message) { + $('<span>').addClass('error').append(message).append('<br />').appendTo($('.update')); + $('<span>') + .addClass('error bold') + .append('<br />') + .append(t('core', 'The update was unsuccessful. Please report this issue to the <a href="https://github.com/owncloud/core/issues" target="_blank">ownCloud community</a>.')) + .appendTo($('.update')); + }); + updateEventSource.listen('done', function(message) { + $('<span>').addClass('bold').append('<br />').append(t('core', 'The update was successful. Redirecting you to ownCloud now.')).appendTo($('.update')); + setTimeout(function () { + window.location.href = OC.webroot; + }, 3000); + }); +});
\ No newline at end of file diff --git a/core/templates/update.php b/core/templates/update.php index c9f3144f257..d4034109762 100644 --- a/core/templates/update.php +++ b/core/templates/update.php @@ -2,30 +2,4 @@ <li class='update'> <?php echo $l->t('Updating ownCloud to version %s, this may take a while.', array($_['version'])); ?><br /><br /> </li> -</ul> -<script> - $(document).ready(function () { - OC.EventSource.requesttoken = oc_requesttoken; - var updateEventSource = new OC.EventSource(OC.webroot+'/core/ajax/update.php'); - updateEventSource.listen('success', function(message) { - $('<span>').append(message).append('<br />').appendTo($('.update')); - }); - updateEventSource.listen('error', function(message) { - $('<span>').addClass('error').append(message).append('<br />').appendTo($('.update')); - }); - updateEventSource.listen('failure', function(message) { - $('<span>').addClass('error').append(message).append('<br />').appendTo($('.update')); - $('<span>') - .addClass('error bold') - .append('<br />') - .append(t('core', 'The update was unsuccessful. Please report this issue to the <a href="https://github.com/owncloud/core/issues" target="_blank">ownCloud community</a>.')) - .appendTo($('.update')); - }); - updateEventSource.listen('done', function(message) { - $('<span>').addClass('bold').append('<br />').append(t('core', 'The update was successful. Redirecting you to ownCloud now.')).appendTo($('.update')); - setTimeout(function () { - window.location.href = OC.webroot; - }, 3000); - }); - }); -</script>
\ No newline at end of file +</ul>
\ No newline at end of file diff --git a/lib/base.php b/lib/base.php index 81a5a615de4..402a8af4211 100644 --- a/lib/base.php +++ b/lib/base.php @@ -252,6 +252,7 @@ class OC if ($showTemplate && !OC_Config::getValue('maintenance', false)) { OC_Config::setValue('maintenance', true); OC_Log::write('core', 'starting upgrade from ' . $installedVersion . ' to ' . $currentVersion, OC_Log::DEBUG); + OC_Util::addscript('update'); $tmpl = new OC_Template('', 'update', 'guest'); $tmpl->assign('version', OC_Util::getVersionString()); $tmpl->printPage(); |