mirror of
https://github.com/wassname/Mostly-Harmless.git
synced 2026-06-27 16:10:28 +08:00
Added notification sound preview.
This commit is contained in:
@@ -81,6 +81,13 @@ this.manifest = {
|
||||
"type": "checkbox",
|
||||
"label": "Play a sound when you have an orangered"
|
||||
},
|
||||
{
|
||||
"tab": "Preferences",
|
||||
"group": "Orangered Notifications",
|
||||
"name": "mailSoundPreview",
|
||||
"type": "button",
|
||||
"text": "Preview the notification sound"
|
||||
},
|
||||
{
|
||||
"tab": "Preferences",
|
||||
"group": "Orangered Notifications",
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
window.addEvent("domready", function () {
|
||||
// Option 1: Use the manifest:
|
||||
new FancySettings.initWithManifest(function (settings) {
|
||||
settings.manifest.myButton.addEvent("action", function () {
|
||||
alert("You clicked me!");
|
||||
pop = document.createElement('audio');
|
||||
pop.src = '/pix/pop.ogg';
|
||||
settings.manifest.mailSoundPreview.addEvent("action", function () {
|
||||
pop.play();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user