mirror of
https://github.com/Kerrick/Mostly-Harmless.git
synced 2026-04-26 03:00:56 -04:00
63 lines
1.6 KiB
JavaScript
Executable File
63 lines
1.6 KiB
JavaScript
Executable File
window.addEvent("domready", function () {
|
|
// Option 1: Use the manifest:
|
|
new FancySettings.initWithManifest(function (settings) {
|
|
pop = document.createElement('audio');
|
|
pop.src = '/pix/pop.ogg';
|
|
settings.manifest.mailSoundPreview.addEvent("action", function () {
|
|
pop.play();
|
|
});
|
|
});
|
|
|
|
// Option 2: Do everything manually:
|
|
/*
|
|
var settings = new FancySettings("My Extension", "icon.png");
|
|
|
|
var username = settings.create({
|
|
"tab": i18n.get("information"),
|
|
"group": i18n.get("login"),
|
|
"name": "username",
|
|
"type": "text",
|
|
"label": i18n.get("username"),
|
|
"text": i18n.get("x-characters")
|
|
});
|
|
|
|
var password = settings.create({
|
|
"tab": i18n.get("information"),
|
|
"group": i18n.get("login"),
|
|
"name": "password",
|
|
"type": "text",
|
|
"label": i18n.get("password"),
|
|
"text": i18n.get("x-characters-pw"),
|
|
"masked": true
|
|
});
|
|
|
|
var myDescription = settings.create({
|
|
"tab": i18n.get("information"),
|
|
"group": i18n.get("login"),
|
|
"name": "myDescription",
|
|
"type": "description",
|
|
"text": i18n.get("description")
|
|
});
|
|
|
|
var myButton = settings.create({
|
|
"tab": "Information",
|
|
"group": "Logout",
|
|
"name": "myButton",
|
|
"type": "button",
|
|
"label": "Disconnect:",
|
|
"text": "Logout"
|
|
});
|
|
|
|
// ...
|
|
|
|
myButton.addEvent("action", function () {
|
|
alert("You clicked me!");
|
|
});
|
|
|
|
settings.align([
|
|
username,
|
|
password
|
|
]);
|
|
*/
|
|
});
|