-
-
Save jeffgca/1045300 to your computer and use it in GitHub Desktop.
some panel code example from Bamberg.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const widgets = require("widget"); | |
const data = require("self").data; | |
const panel = require("panel"); | |
var panelScript = "on('message', function(message) {" + | |
" console.log('receiving ' + message);" + | |
" }); " | |
var wid = widgets.Widget({ | |
id: "some_menu", | |
label: "My Widget Label", | |
contentURL: data.url("icon.png"), | |
contentScriptWhen: "ready", | |
panel: panel.Panel({ | |
// onMessage: function(message) { | |
// console.log(message); | |
// }, | |
contentScript: panelScript, | |
allow: true, | |
width: 170, | |
height: 250, | |
contentScriptWhen: "ready" | |
}), | |
onClick : function() { | |
console.log("sending the message"); | |
wid.panel.postMessage("the message"); | |
wid.panel.show(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment