-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettings.js
35 lines (28 loc) · 853 Bytes
/
settings.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
/*
Gadget settings script
@copyright: Marc-Antoine Gouillart, 2009
@licence: GPLv3
*/
function init()
{
var temp = System.Gadget.Settings.read("txtCmd");
txtCmd.innerText = temp;
var temp = System.Gadget.Settings.read("txtArgs");
txtArgs.innerText = temp;
var temp = System.Gadget.Settings.read("intPrd");
intPrd.innerText = temp;
}
// Delegate for the settings closing event.
System.Gadget.onSettingsClosing = SettingsClosing;
function SettingsClosing(event)
{
// Save the settings if the user clicked OK.
if (event.closeAction == event.Action.commit)
{
System.Gadget.Settings.write("txtCmd", txtCmd.value);
System.Gadget.Settings.write("txtArgs", txtArgs.value);
System.Gadget.Settings.write("intPrd", intPrd.value);
}
// Allow the Settings dialog to close.
event.cancel = false;
}