-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapp.js
85 lines (84 loc) · 2.22 KB
/
app.js
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/**
* DDNS GO App
* Defined an App to manage ddns-go
*/
var DdnsGoApp = DdnsGoApp || {} //Define ddns-go App namespace.
/**
* Constructor UNAS App
*/
DdnsGoApp.App = function () {
this.id = 'DDNS GO'
this.name = 'DDNS GO'
this.version = '6.0.2'
this.active = false
this.menuIcon = '/apps/ddns-go/images/logo.png?v=6.0.2&'
this.shortcutIcon = '/apps/ddns-go/images/logo.png?v=6.0.2&'
this.entryUrl = '/apps/ddns-go/index.html?v=6.0.2&'
var self = this
this.DdnsGoAppWindow = function () {
if (UNAS.CheckAppState('DDNS GO')) {
return false
}
self.window = new MUI.Window({
id: 'DdnsGoAppWindow',
title: UNAS._('DDNS GO'),
icon: '/apps/ddns-go/images/logo_small.png?v=6.0.2&',
loadMethod: 'xhr',
width: 750,
height: 480,
maximizable: false,
resizable: true,
scrollbars: false,
resizeLimit: { x: [200, 2000], y: [150, 1500] },
contentURL: '/apps/ddns-go/index.html?v=6.0.2&',
require: { css: ['/apps/ddns-go/css/index.css'] },
onBeforeBuild: function () {
UNAS.SetAppOpenedWindow('DDNS GO', 'DdnsGoAppWindow')
},
})
}
this.DdnsGoUninstall = function () {
UNAS.RemoveDesktopShortcut('DDNS GO')
UNAS.RemoveMenu('DDNS GO')
UNAS.RemoveAppFromGroups('DDNS GO', 'ControlPanel')
UNAS.RemoveAppFromApps('DDNS GO')
}
new UNAS.Menu(
'UNAS_App_Internet_Menu',
this.name,
this.menuIcon,
'DDNS GO',
'',
this.DdnsGoAppWindow
)
new UNAS.RegisterToAppGroup(
this.name,
'ControlPanel',
{
Type: 'Internet',
Location: 1,
Icon: this.shortcutIcon,
Url: this.entryUrl,
},
{}
)
var OnChangeLanguage = function (e) {
UNAS.SetMenuTitle('DDNS GO', UNAS._('DDNS GO')) //translate menu
//UNAS.SetShortcutTitle('DDNS GO', UNAS._('DDNS GO'));
if (typeof self.window !== 'undefined') {
UNAS.SetWindowTitle('DdnsGoAppWindow', UNAS._('DDNS GO'))
}
}
UNAS.LoadTranslation(
'/apps/ddns-go/languages/Translation?v=' + this.version,
OnChangeLanguage
)
UNAS.Event.addEvent('ChangeLanguage', OnChangeLanguage)
UNAS.CreateApp(
this.name,
this.shortcutIcon,
this.DdnsGoAppWindow,
this.DdnsGoUninstall
)
}
new DdnsGoApp.App()