Skip to content

Instantly share code, notes, and snippets.

<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<window id="yourwindow" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<label value="Horizontal layout"/>
<hbox>
<button label="horizontal1" flex="1"/>
<button label="horizontal2" flex="2"/>
<button label="horizontal3" flex="3"/>
</hbox>
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<window id="yourwindow" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<label value="Enter Your Name:" control="name" accesskey="N" />
<textbox id="name" value="" />
<button label="OK" oncommand="alert('Hello, ' + document.getElementById('name').value + '!');" />
</window>
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<window id="yourwindow" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<groupbox>
<caption label="Login"/>
<grid>
<columns>
<column flex="1"/>
<column flex="2"/>
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
<dialog id="mydialog" title="Dialog Example"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
buttons="accept,cancel"
buttonlabelcancel="Cancel"
buttonlabelaccept="Send"
ondialogaccept="alert('Thank you, ' + document.getElementById('name').value + '!');"
ondialogcancel="alert('canceled!');">
Index: script.js
===================================================================
--- script.js (revision 13)
+++ script.js (working copy)
@@ -59,7 +59,7 @@
var writeIntoFile = function(filepath, content, charset) {
var file = Components.classes["@mozilla.org/file/local;1"]
.createInstance(Components.interfaces.nsILocalFile);
file.initWithPath(filepath);
var fostream = Components.classes["@mozilla.org/network/file-output-stream;1"]
.createInstance(Components.interfaces.nsIFileOutputStream);
fostream.init(file, 0x02 | 0x08 | 0x20, 0666, 0);
/* Get a charset converter-enabled stream */
jetpack.future.import('slideBar');
var html = <>
<html lang="ja">
<head>
<style type="text/css">
<![CDATA[
body {
background: white;
font-size: 12px;
sudo gem install mongrel
// Start
mongrel_rails start -d -p 3838 -P ~/git/mongrel.pid
// Stop
mongrel_rails stop ~/git/mongrel.pid
def doggy
@doggy = Doggy.find_by_id(1)
end
const panels = require("panel");
const widgets = require("widget");
exports.main = function () {
let panel = panels.add(panels.Panel({
content: "about:blank",
width: 240,
height: 320,
allow: { script: true },
}));
widgets.add(widgets.Widget({