aboutsummaryrefslogtreecommitdiffstats
path: root/core/js/update.js
diff options
context:
space:
mode:
authorBjörn Schießle <schiessle@owncloud.com>2013-01-31 10:55:59 +0100
committerBjörn Schießle <schiessle@owncloud.com>2013-01-31 10:55:59 +0100
commit54eeb8b8fcff13d29ae363e7ca5e6da707fdd6b7 (patch)
tree48c2eb0ad04a4bd921f223258e41beba2e2c6539 /core/js/update.js
parent9c83b307f6d49f30c4cc6db7258d7e3851bac0b7 (diff)
parent00a30e665128352e9b20268ea65400a968903c74 (diff)
downloadnextcloud-server-54eeb8b8fcff13d29ae363e7ca5e6da707fdd6b7.tar.gz
nextcloud-server-54eeb8b8fcff13d29ae363e7ca5e6da707fdd6b7.zip
fix merge conflict
Diffstat (limited to 'core/js/update.js')
-rw-r--r--core/js/update.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/core/js/update.js b/core/js/update.js
new file mode 100644
index 00000000000..8ab02bbf935
--- /dev/null
+++ b/core/js/update.js
@@ -0,0 +1,23 @@
+$(document).ready(function () {
+ 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