From dbc13cf6ee775745c86f92d97d636f9ed3cf5432 Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Fri, 25 Jan 2013 19:18:16 +0100 Subject: Move update inline JS --- core/js/update.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 core/js/update.js (limited to 'core/js/update.js') 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) { + $('').append(message).append('
').appendTo($('.update')); + }); + updateEventSource.listen('error', function(message) { + $('').addClass('error').append(message).append('
').appendTo($('.update')); + }); + updateEventSource.listen('failure', function(message) { + $('').addClass('error').append(message).append('
').appendTo($('.update')); + $('') + .addClass('error bold') + .append('
') + .append(t('core', 'The update was unsuccessful. Please report this issue to the ownCloud community.')) + .appendTo($('.update')); + }); + updateEventSource.listen('done', function(message) { + $('').addClass('bold').append('
').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 -- cgit v1.2.3