summaryrefslogtreecommitdiffstats
path: root/apps/updatenotification/js/notification.js
blob: 913a59e042cb5ee097b405595318821e9ba16cb6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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 href="'+escapeHTML(docLink)+'" target="_blank">'+escapeHTML(text)+'</a>');

	OC.Notification.showTemporary(
		element,
		{
			isHTML: true
		}
	);
});