diff options
author | Lukas Reschke <lukas@owncloud.com> | 2016-02-09 13:06:48 +0100 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2016-02-09 18:05:51 +0100 |
commit | abc675d87e6ffc49fad608d5b2e8d280e385cc61 (patch) | |
tree | 558a752af5c3d9936cbd597ea76607f57e22c32c /apps/updatenotification/js | |
parent | 29820176825c41acef30fa6942922aeb36cfcec3 (diff) | |
download | nextcloud-server-abc675d87e6ffc49fad608d5b2e8d280e385cc61.tar.gz nextcloud-server-abc675d87e6ffc49fad608d5b2e8d280e385cc61.zip |
Move update notification code into app
Moves the update notification code in a single app. This is required since we want to use SSO for the new updater and for this have some code running in ownCloud as well (and we don't want that in core neccessarily). This app can provide that in the future, right now it's only the update notification itself. Will continue working on the SSO right away but wanted to keep the PR small.
Furthermore also makes some more code unit-testable...
Diffstat (limited to 'apps/updatenotification/js')
-rw-r--r-- | apps/updatenotification/js/notification.js | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/apps/updatenotification/js/notification.js b/apps/updatenotification/js/notification.js new file mode 100644 index 00000000000..9d22bcb2309 --- /dev/null +++ b/apps/updatenotification/js/notification.js @@ -0,0 +1,30 @@ +/** + * Copyright (c) 2015 ownCloud Inc + * + * @author Morris Jobke <hey@morrisjobke.de> + * + * This file is licensed under the Affero General Public License version 3 + * or later. + * + * See the COPYING-README file. + * + */ + +/** + * this gets only loaded if an update is available and then shows a temporary notification + */ +$(document).ready(function(){ + var head = $('html > head'), + version = oc_updateState.updateVersion, + docLink = oc_updateState.updateLink, + text = t('core', '{version} is available. Get more information on how to update.', {version: version}), + element = $('<a>').attr('href', docLink).text(text); + + OC.Notification.showTemporary( + element, + { + isHTML: true + } + ); +}); + |