From 52f8d75d1af69acfb8bce3a618e89f99cdcde930 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 17 Jan 2018 14:55:48 +0100 Subject: Rename legacy notification so it's less confusing Signed-off-by: Joas Schilling --- apps/updatenotification/js/legacy-notification.js | 21 +++++++++++++++++++++ apps/updatenotification/js/notification.js | 21 --------------------- apps/updatenotification/lib/AppInfo/Application.php | 2 +- 3 files changed, 22 insertions(+), 22 deletions(-) create mode 100644 apps/updatenotification/js/legacy-notification.js delete mode 100644 apps/updatenotification/js/notification.js diff --git a/apps/updatenotification/js/legacy-notification.js b/apps/updatenotification/js/legacy-notification.js new file mode 100644 index 00000000000..d45ba8793c4 --- /dev/null +++ b/apps/updatenotification/js/legacy-notification.js @@ -0,0 +1,21 @@ +/** + * Copyright (c) 2015 ownCloud Inc + * + * @author Morris Jobke + * + * This file is licensed under the Affero General Public License version 3 + * or later. + * + * See the COPYING-README file. + * + */ + +/** + * This only gets loaded if an update is available and the notifications app is not enabled for the user. + */ +$(document).ready(function(){ + var text = t('core', '{version} is available. Get more information on how to update.', {version: oc_updateState.updateVersion}), + element = $('').attr('href', oc_updateState.updateLink).attr('target','_blank').text(text); + + OC.Notification.showHtml(element, { type: 'error' }); +}); diff --git a/apps/updatenotification/js/notification.js b/apps/updatenotification/js/notification.js deleted file mode 100644 index a588ede5ffd..00000000000 --- a/apps/updatenotification/js/notification.js +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Copyright (c) 2015 ownCloud Inc - * - * @author Morris Jobke - * - * 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 text = t('core', '{version} is available. Get more information on how to update.', {version: oc_updateState.updateVersion}), - element = $('').attr('href', oc_updateState.updateLink).attr('target','_blank').text(text); - - OC.Notification.showHtml(element, { type: 'error' }); -}); diff --git a/apps/updatenotification/lib/AppInfo/Application.php b/apps/updatenotification/lib/AppInfo/Application.php index d79f14764de..369b6e3f07d 100644 --- a/apps/updatenotification/lib/AppInfo/Application.php +++ b/apps/updatenotification/lib/AppInfo/Application.php @@ -63,7 +63,7 @@ class Application extends App { } if ($updateChecker->getUpdateState() !== []) { - Util::addScript('updatenotification', 'notification'); + Util::addScript('updatenotification', 'legacy-notification'); \OC_Hook::connect('\OCP\Config', 'js', $updateChecker, 'populateJavaScriptVariables'); } } -- cgit v1.2.3