summaryrefslogtreecommitdiffstats
path: root/xulrunner/examples/simple/content
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2019-12-16 20:09:38 -0500
committerMatt A. Tobin <email@mattatobin.com>2019-12-16 20:09:38 -0500
commite2de507e0261c9b138cd3cf5356c21eca3e7a28d (patch)
treef32816881d4f8512d42ece948a41ae21c977c633 /xulrunner/examples/simple/content
parent06494f307850c576868831bd28a61464eab1f359 (diff)
downloadUXP-e2de507e0261c9b138cd3cf5356c21eca3e7a28d.tar
UXP-e2de507e0261c9b138cd3cf5356c21eca3e7a28d.tar.gz
UXP-e2de507e0261c9b138cd3cf5356c21eca3e7a28d.tar.lz
UXP-e2de507e0261c9b138cd3cf5356c21eca3e7a28d.tar.xz
UXP-e2de507e0261c9b138cd3cf5356c21eca3e7a28d.zip
Issue #1323 - Move XULRunner back to topsrcdir
Diffstat (limited to 'xulrunner/examples/simple/content')
-rw-r--r--xulrunner/examples/simple/content/contents.rdf0
-rw-r--r--xulrunner/examples/simple/content/simple.js17
-rw-r--r--xulrunner/examples/simple/content/simple.xul20
3 files changed, 37 insertions, 0 deletions
diff --git a/xulrunner/examples/simple/content/contents.rdf b/xulrunner/examples/simple/content/contents.rdf
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/xulrunner/examples/simple/content/contents.rdf
diff --git a/xulrunner/examples/simple/content/simple.js b/xulrunner/examples/simple/content/simple.js
new file mode 100644
index 000000000..acf6f1029
--- /dev/null
+++ b/xulrunner/examples/simple/content/simple.js
@@ -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);
+}
diff --git a/xulrunner/examples/simple/content/simple.xul b/xulrunner/examples/simple/content/simple.xul
new file mode 100644
index 000000000..6ff915d0c
--- /dev/null
+++ b/xulrunner/examples/simple/content/simple.xul
@@ -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>