home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Freelog 117
/
FreelogNo117-OctobreNovembre2013.iso
/
Theme
/
8GadgetPack
/
8GadgetPackSetup.msi
/
Gadgets.7z
/
Gadgets
/
Clipboarder.gadget
/
Settings.220.js
< prev
next >
Wrap
Text File
|
2013-08-13
|
8KB
|
183 lines
var CurrentTip = 0;
var SoundFile = "";
function LoadSettings()
{
document.body.style.width = "300px";
document.body.style.height = "400px";
HotKeyModifer1.options[0] = new Option(Localized['Modifer8'], 8);
HotKeyModifer1.options[1] = new Option(Localized['Modifer2'], 2);
HotKeyModifer1.options[2] = new Option(Localized['Modifer4'], 4);
HotKeyModifer1.options[3] = new Option(Localized['Modifer12'], 12);
HotKeyModifer1.options[4] = new Option(Localized['Modifer9'], 9);
HotKeyModifer1.options[5] = new Option(Localized['Modifer3'], 3);
HotKeyModifer1.options[6] = new Option(Localized['Modifer10'], 10);
HotKeyModifer1.options[7] = new Option(Localized['Modifer0'], 0);
HotKeyModifer2.options[0] = new Option(Localized['Modifer8'], 8);
HotKeyModifer2.options[1] = new Option(Localized['Modifer2'], 2);
HotKeyModifer2.options[2] = new Option(Localized['Modifer4'], 4);
HotKeyModifer2.options[3] = new Option(Localized['Modifer12'], 12);
HotKeyModifer2.options[4] = new Option(Localized['Modifer9'], 9);
HotKeyModifer2.options[5] = new Option(Localized['Modifer3'], 3);
HotKeyModifer2.options[6] = new Option(Localized['Modifer10'], 10);
HotKeyModifer2.options[7] = new Option(Localized['Modifer0'], 0);
FixedVisibleContents.options[0] = new Option(Localized['Many'], 0);
FixedVisibleContents.options[1] = new Option(Localized['Less'], 1);
FixedVisibleContents.options[2] = new Option(Localized['Max1'], 2);
FixedVisibleContents.options[3] = new Option(Localized['Max2'], 3);
TipText.innerHTML = Localized['Tip_'+(CurrentTip+1)];
currentIndex.innerHTML = "" + (CurrentTip+1) + Localized['TipOf'] + (parseInt(Localized['NumTips']));
if(System.Gadget.Settings.read("HotKeyTheft") == "1")
UseHotKeysText.innerHTML = Localized['UseHotKeysTextTheft'];
else
UseHotKeysText.innerHTML = Localized['UseHotKeysText'];
HotKeyText1.innerHTML = Localized['HotKeyText1'];
HotKeyText2.innerHTML = Localized['HotKeyText2'];
MaxContentsText.innerHTML = Localized['MaxContentsText'];
FixedVisibleContentsText.innerHTML = Localized['FixedVisibleContentsText'];
//UseGlassText.innerHTML = Localized['UseGlassText'];
//UseAnimationText.innerHTML = Localized['UseAnimationText'];
UseNumpadHotkeyText.innerHTML = Localized['UseNumpadHotkeyText'];
UseForegroundText.innerHTML = Localized['UseForegroundText'];
UseSaveText.innerHTML = Localized['UseSaveText'];
UseSoundText.innerHTML = Localized['UseSoundText'];
MonitorClipboardText.innerHTML = Localized['MonitorClipboardText'];
UseHotkeyUnformattedText.innerHTML = Localized['UseHotkeyUnformattedText'];
//IsDragFieldText.innerHTML = Localized['IsDragFieldText'];
Website.innerHTML = Localized['Website'];
Website.href = Localized['WebsiteUrl'];
Feedback.innerHTML = Localized['Feedback'];
Feedback.href = Localized['FeedbackUrl'];
S7.innerHTML = Localized['Donate'];
S7.href = Localized['DonateUrl'];
// Load settings
UseHotKeys.checked = System.Gadget.Settings.read("UseHotkeys") == "1";
HotKeyModifer1.disabled = !(System.Gadget.Settings.read("UseHotkeys") == "1");
HotKeyModifer2.disabled = !(System.Gadget.Settings.read("UseHotkeys") == "1");
HotKey1.disabled = !(System.Gadget.Settings.read("UseHotkeys") == "1");
HotKey2.disabled = !(System.Gadget.Settings.read("UseHotkeys") == "1");
HotKeyText1.disabled = !(System.Gadget.Settings.read("UseHotkeys") == "1");
HotKeyText2.disabled = !(System.Gadget.Settings.read("UseHotkeys") == "1");
HotKeyModifer1.value = System.Gadget.Settings.read("HotKeyModifer1");
HotKeyModifer2.value = System.Gadget.Settings.read("HotKeyModifer2");
HotKey1.value = System.Gadget.Settings.read("HotKey1");
if(HotKey1.value == "@")
HotKey1.value = "";
HotKey2.value = System.Gadget.Settings.read("HotKey2");
if(HotKey2.value == "@")
HotKey2.value = "";
MaxContents.value = System.Gadget.Settings.read("MaxContents");
FixedVisibleContents.value = System.Gadget.Settings.read("FixedVisibleContents");
//UseGlass.checked = System.Gadget.Settings.read("UseGlass") == "1";
//UseAnimation.checked = System.Gadget.Settings.read("UseAnimation") == "1";
UseNumpadHotkey.checked = System.Gadget.Settings.read("UseNumpadHotkey") == "1";
UseSave.checked = System.Gadget.Settings.read("UseSave") != "";
UseForeground.checked = System.Gadget.Settings.read("UseForeground") == "1";
SoundSelect.disabled = !(UseSound.checked = System.Gadget.Settings.read("UseSound") == "1");
SoundFile = System.Gadget.Settings.read("SoundFile");
MonitorClipboard.checked = System.Gadget.Settings.read("MonitorClipboard") == "1";
UseHotkeyUnformatted.checked = System.Gadget.Settings.read("UseHotkeyUnformatted") == "1";
System.Gadget.onSettingsClosing = SettingsClosing;
}
function SettingsClosing(event)
{
// Save the settings if the user clicked OK
if(event.closeAction == event.Action.commit)
{
if(HotKey1.value == "")
HotKey1.value = "@";
if(HotKey2.value == "")
HotKey2.value = "@";
System.Gadget.Settings.write("UseHotKeys", UseHotKeys.checked ? "1" : "0");
System.Gadget.Settings.write("HotKeyModifer1", HotKeyModifer1.value);
System.Gadget.Settings.write("HotKeyModifer2", HotKeyModifer2.value);
System.Gadget.Settings.write("HotKey1", HotKey1.value.toUpperCase());
System.Gadget.Settings.write("HotKey2", HotKey2.value.toUpperCase());
System.Gadget.Settings.write("MaxContents", MaxContents.value);
System.Gadget.Settings.write("FixedVisibleContents", FixedVisibleContents.value);
//System.Gadget.Settings.write("UseGlass", UseGlass.checked ? "1" : "0");
//System.Gadget.Settings.write("UseAnimation", UseAnimation.checked ? "1" : "0");
System.Gadget.Settings.write("UseNumpadHotkey", UseNumpadHotkey.checked ? "1" : "0");
if(UseSave.checked)
{
if(System.Gadget.Settings.read("UseSave") == "")
System.Gadget.Settings.write("UseSave", "@");
}
else
System.Gadget.Settings.write("UseSave", "");
System.Gadget.Settings.write("UseForeground", UseForeground.checked ? "1" : "0");
System.Gadget.Settings.write("UseSound", UseSound.checked ? "1" : "0");
System.Gadget.Settings.write("SoundFile", SoundFile);
System.Gadget.Settings.write("MonitorClipboard", MonitorClipboard.checked ? "1" : "0");
System.Gadget.Settings.write("UseHotkeyUnformatted", UseHotkeyUnformatted.checked ? "1" : "0");
System.Gadget.Settings.write("SettingsWritten", "1");
}
event.cancel = false;
}
function OnUseSoundChanged()
{
SoundSelect.disabled = !UseSound.checked;
}
function OnUseHotKeysChanged()
{
HotKeyModifer1.disabled = !UseHotKeys.checked;
HotKeyModifer2.disabled = !UseHotKeys.checked;
HotKey1.disabled = !UseHotKeys.checked;
HotKey2.disabled = !UseHotKeys.checked;
HotKeyText1.disabled = !UseHotKeys.checked;
HotKeyText2.disabled = !UseHotKeys.checked;
}
function OnSoundFile()
{
SoundFile = System.Gadget.document.parentWindow.Net.GetSoundFile(SoundFile, Localized["SoundSelectionTitle"]);
}
function TipsBack()
{
if ((event.keyCode && event.keyCode != 32) || (event.button == 2))
{
return false;
}
if(CurrentTip == 0)
CurrentTip = parseInt(Localized['NumTips']) - 1;
else
CurrentTip--;
TipText.innerHTML = Localized['Tip_'+(CurrentTip+1)];
currentIndex.innerHTML = "" + (CurrentTip+1) + Localized['TipOf'] + (parseInt(Localized['NumTips']));
return true;
}
function TipsForward()
{
if ((event.keyCode && event.keyCode != 32) || (event.button == 2))
{
return false;
}
if(CurrentTip == parseInt(Localized['NumTips'])-1)
CurrentTip = 0;
else
CurrentTip++;
TipText.innerHTML = Localized['Tip_'+(CurrentTip+1)];
currentIndex.innerHTML = "" + (CurrentTip+1) + Localized['TipOf'] + (parseInt(Localized['NumTips']));
return true;
}
function swapImage(img, state)
{
img.src = "images/settings_" + img.src.split("_")[1] + "_" + state + ".png";
}