mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-09 01:08:39 +09:00
Import XULRunner and make it produce the generic stub
This commit is contained in:
parent
1f12910aa2
commit
d3be0506a0
73 changed files with 2418 additions and 10 deletions
17
application/xulrunner/examples/simple/content/simple.js
Normal file
17
application/xulrunner/examples/simple/content/simple.js
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
/* vim:set ts=2 sw=2 sts=2 et cin: */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
function onButtonClick() {
|
||||
var textbox = document.getElementById("textbox");
|
||||
|
||||
var contractid = (textbox.value % 2 == 0) ?
|
||||
"@test.mozilla.org/simple-test;1?impl=js" :
|
||||
"@test.mozilla.org/simple-test;1?impl=c++";
|
||||
|
||||
var test = Components.classes[contractid].
|
||||
createInstance(Components.interfaces.nsISimpleTest);
|
||||
|
||||
textbox.value = test.add(textbox.value, 1);
|
||||
}
|
||||
20
application/xulrunner/examples/simple/content/simple.xul
Normal file
20
application/xulrunner/examples/simple/content/simple.xul
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
<?xml version="1.0"?>
|
||||
# vim:set ts=8 sw=8 sts=8 noet:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
|
||||
|
||||
<!DOCTYPE window SYSTEM "chrome://simple/locale/simple.dtd">
|
||||
|
||||
<window
|
||||
id = "simple"
|
||||
title = "&simple.title;"
|
||||
xmlns = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
<script src="chrome://simple/content/simple.js"/>
|
||||
<vbox>
|
||||
<textbox id="textbox" value="&simple.textValue;" flex="1"/>
|
||||
<button id="button" label="&simple.buttonLabel;" oncommand="onButtonClick();"/>
|
||||
</vbox>
|
||||
</window>
|
||||
Loading…
Add table
Add a link
Reference in a new issue