Welcome to mirror list, hosted at ThFree Co, Russian Federation.

app.js « js-src « updatenotification « apps - github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 0b28cabd6ac93f61b2df79769d9d1693e2a00dfc (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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/**
 * @copyright (c) 2018 Joas Schilling <coding@schilljs.com>
 *
 * @author Joas Schilling <coding@schilljs.com>
 *
 * This file is licensed under the Affero General Public License version 3 or
 * later. See the COPYING file.
 */

/* global $, define */

define(function (require) {
	"use strict";

	return {

		/** @type {Vue|null} */
		vm: null,

		/**
		 * Initialise the app
		 */
		initialise: function() {
			var data = JSON.parse($('#updatenotification').attr('data-json'));
			var Vue = require('vue');
			var vSelect = require('vue-select');
			Vue.component('v-select', vSelect.VueSelect);
			Vue.mixin({
				methods: {
					t: function(app, text, vars, count, options) {
						return OC.L10N.translate(app, text, vars, count, options);
					},
					n: function(app, textSingular, textPlural, count, vars, options) {
						return OC.L10N.translatePlural(app, textSingular, textPlural, count, vars, options);
					}
				}
			});
			this.vm = new Vue(require('./components/root.vue'));

			this.vm.newVersionString = data.newVersionString;
			this.vm.lastCheckedDate = data.lastChecked;
			this.vm.isUpdateChecked = data.isUpdateChecked;
			this.vm.updaterEnabled = data.updaterEnabled;
			this.vm.downloadLink = data.downloadLink;
			this.vm.isNewVersionAvailable = data.isNewVersionAvailable;
			this.vm.updateServerURL = data.updateServerURL;
			this.vm.currentChannel = data.currentChannel;
			this.vm.channels = data.channels;
			this.vm.notifyGroups = data.notifyGroups;
			this.vm.isDefaultUpdateServerURL = data.isDefaultUpdateServerURL;
			this.vm.versionIsEol = data.versionIsEol;
		}
	};
});