diff options
author | Morris Jobke <hey@morrisjobke.de> | 2015-05-03 12:28:29 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2015-05-03 17:26:03 +0200 |
commit | cd516eedcd4cca1abb92d8781749a6f152d34319 (patch) | |
tree | 855647c569e930df5f404a3fd56983db57343361 /core/js | |
parent | 9f76b8b3563e7f001b2adf46dcedf0e2f37c0ffc (diff) | |
download | nextcloud-server-cd516eedcd4cca1abb92d8781749a6f152d34319.tar.gz nextcloud-server-cd516eedcd4cca1abb92d8781749a6f152d34319.zip |
Use OC.Notification for update notifications
* instead of a static rendering inside PHP use the
JS OC.Notification.showTemporary to hide the
notification after 7 seconds automatically
* fixes #14811
Diffstat (limited to 'core/js')
-rw-r--r-- | core/js/update-notification.js | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/core/js/update-notification.js b/core/js/update-notification.js new file mode 100644 index 00000000000..42baa7f4c28 --- /dev/null +++ b/core/js/update-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 = head.data('update-version'), + docLink = head.data('update-link'), + 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 + } + ); +}); + |