Skip to content

Commit 3d8f280

Browse files
author
zhourenjian
committed
Check in template of Java2Script Firefox add-on
1 parent 488c4af commit 3d8f280

File tree

11 files changed

+301
-0
lines changed

11 files changed

+301
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>net.sf.j2s.firefox.addon</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
</buildSpec>
9+
<natures>
10+
</natures>
11+
</projectDescription>
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<project name="firefox.extension.xpi.build" basedir="." default="build.xpi">
2+
3+
<property name="temp.folder" value="dist"/>
4+
5+
<!-- =================================
6+
target: build.xpi
7+
================================= -->
8+
<target name="build.xpi" description="zip all the resources into *.xpi">
9+
<ant target="init"/>
10+
<copy file="install.rdf" todir="${temp.folder}"/>
11+
<copy file="chrome.manifest" todir="${temp.folder}"/>
12+
<ant target="build.jar"/>
13+
<zip destfile="java2script.xpi">
14+
<fileset dir="${temp.folder}"/>
15+
</zip>
16+
<ant target="clear"/>
17+
</target>
18+
19+
20+
<!-- =================================
21+
target: build.jar
22+
================================= -->
23+
<target name="build.jar" description="zip files into a jar under the folder chrome">
24+
<copy todir="${temp.folder}/chrome">
25+
<fileset dir="chrome"/>
26+
</copy>
27+
</target>
28+
29+
30+
<!-- - - - - - - - - - - - - - - - - -
31+
target: init
32+
- - - - - - - - - - - - - - - - - -->
33+
<target name="init">
34+
<mkdir dir="${temp.folder}"/>
35+
<mkdir dir="${temp.folder}/chrome"/>
36+
</target>
37+
38+
39+
<!-- - - - - - - - - - - - - - - - - -
40+
target: clear
41+
- - - - - - - - - - - - - - - - - -->
42+
<target name="clear">
43+
<delete dir="${temp.folder}"/>
44+
</target>
45+
46+
</project>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
content java2script chrome/content/java2script/
2+
skin java2script classic/1.0 chrome/skin/classic/java2script/
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
3+
<window class="dialog"
4+
title="About Java2Script Library"
5+
orient="vertical"
6+
autostretch="always"
7+
onload="sizeToContent()"
8+
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
9+
10+
<groupbox align="center" orient="horizontal">
11+
<vbox>
12+
<text value="Java2Script Library" style="font-weight: bold; font-size: x-large;"/>
13+
<text value="V20070206"/>
14+
<separator class="thin"/>
15+
<text value="Created By:" style="font-weight: bold;"/>
16+
<text value="Java2Script Team" class="url"
17+
onclick="window.open('http://j2s.sourceforge.net/'); window.close();"/>
18+
<separator class="thin"/>
19+
<text value="Home Page:" style="font-weight: bold;"/>
20+
<text value="http://j2s.sourceforge.net/"
21+
class="url"
22+
onclick="window.open('http://j2s.sourceforge.net/'); window.close();"/>
23+
<separator class="thin"/>
24+
</vbox>
25+
<spring flex="1"/>
26+
<image src="chrome://java2script/skin/j2s-logo-big.gif"/>
27+
</groupbox>
28+
29+
<hbox>
30+
<spacer flex="1"/>
31+
<button label="Close" oncommand="window.close();"/>
32+
</hbox>
33+
34+
</window>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0"?>
2+
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
3+
xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
4+
5+
<RDF:Seq RDF:about="urn:mozilla:package:root">
6+
<RDF:li RDF:resource="urn:mozilla:package:java2script"/>
7+
</RDF:Seq>
8+
9+
<RDF:Description RDF:about="urn:mozilla:package:java2script"
10+
chrome:displayName="Java2Script"
11+
chrome:author="Java2Script Team"
12+
chrome:authorURL="http://j2s.sourceforge.net/"
13+
chrome:name="java2script"
14+
chrome:extension="true"
15+
chrome:description="This is packed *.js/*.css resources for Java2Script Library">
16+
</RDF:Description>
17+
18+
</RDF:RDF>
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
window["j2s.addon.loaded"] = true;
2+
window["j2s.lib.list"] = [
3+
/*{ version : "20061113", alias : "1.0.0-m4" },
4+
{ version : "20061215" },*/
5+
{ version : "20070206" }/*,
6+
{ version : "20070207" },
7+
{ version : "20070228", alias : "1.0.0-m5" },
8+
{ version : "20070307" },*/
9+
];
10+
11+
// following will try to read from window["j2s.lib"] configuration!
12+
var j2slibList = window["j2s.lib.list"];
13+
var j2sver = null;
14+
var o = window["j2s.lib"];
15+
for (var i = 0; i < j2slibList.length; i++) {
16+
var item = j2slibList[i];
17+
if (o.version != null && item.version == o.version) {
18+
j2sver = (item.alias != null ? item.alias : item.version);
19+
break;
20+
} else if (o.alias != null && item.alias == o.alias) {
21+
j2sver = item.alias;
22+
break;
23+
}
24+
}
25+
if (j2sver == null && o.version != null
26+
&& (o.forward || o.forward == null)) {
27+
var availables = [];
28+
for (var i = 0; i < j2slibList.length; i++) {
29+
var item = j2slibList[i];
30+
if (item.version != null && item.version >= o.version) {
31+
if (o.mode == null || o.mode == "dailybuild"
32+
|| (o.mode == "milestone" && item.alias != null)
33+
|| (o.mode == "release" && item.alias != null && item.alias.indexOf ("-m") == -1)) {
34+
availables[availables.length] = item;
35+
}
36+
}
37+
}
38+
if (availables.length > 0) {
39+
var first = availables.sort()[availables.length - 1];
40+
j2sver = (first.alias != null ? first.alias : first.version);
41+
}
42+
}
43+
var sxr = document.createElement ("SCRIPT");
44+
if (j2sver != null) {
45+
sxr.src = "chrome://java2script/content/" + j2sver + "/j2slib.z.js";
46+
} else {
47+
if (o.base == null) {
48+
o.base = "http://archive.java2script.org/";
49+
}
50+
sxr.src = o.base + (o.alias ? o.alias : o.version) + "/j2slib.z.js";
51+
}
52+
var t = "onreadystatechange";
53+
var xhrCallback = function(){
54+
var s = this.readyState;
55+
if (s == null || s == "loaded" || s == "complete") {
56+
window["j2s.lib"].onload ();
57+
}
58+
};
59+
if (typeof sxr[t] == "undefined") {
60+
sxr.onload = xhrCallback;
61+
} else {
62+
sxr[t] = xhrCallback;
63+
}
64+
document.getElementsByTagName ("HEAD")[0].appendChild (sxr);
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0"?>
2+
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
3+
xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
4+
5+
<RDF:Seq about="urn:mozilla:skin:root">
6+
<RDF:li resource="urn:mozilla:skin:classic/1.0" />
7+
</RDF:Seq>
8+
9+
<RDF:Description about="urn:mozilla:skin:classic/1.0">
10+
<chrome:packages>
11+
<RDF:Seq about="urn:mozilla:skin:classic/1.0:packages">
12+
<RDF:li resource="urn:mozilla:skin:classic/1.0:java2script" />
13+
</RDF:Seq>
14+
</chrome:packages>
15+
</RDF:Description>
16+
17+
</RDF:RDF>
1.92 KB
Loading
168 Bytes
Loading
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?xml version="1.0"?>
2+
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
3+
xmlns:em="http://www.mozilla.org/2004/em-rdf#">
4+
5+
<Description about="urn:mozilla:install-manifest">
6+
7+
<em:id>{d60b46a9-bfe3-4b22-8844-07089202e0e6}</em:id>
8+
<em:name>Java2Script Library</em:name>
9+
<em:version>1.0.0_20070206</em:version>
10+
<em:description>Java2Script Library Packages</em:description>
11+
<em:creator>Zhou Renjian</em:creator>
12+
<em:homepageURL>http://j2s.sourceforge.net/</em:homepageURL>
13+
<em:iconURL>chrome://java2script/skin/j2s-logo.gif</em:iconURL>
14+
<em:aboutURL>chrome://java2script/content/about.xul</em:aboutURL>
15+
<em:updateURL>http://java2script.org/update.rdf</em:updateURL>
16+
<em:file>
17+
<Description about="urn:mozilla:extension:file:java2script">
18+
<em:package>content/java2script</em:package>
19+
<em:skin>skin/classic/java2script</em:skin>
20+
</Description>
21+
</em:file>
22+
23+
<em:targetApplication>
24+
<Description>
25+
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
26+
<em:minVersion>1.0</em:minVersion>
27+
<em:maxVersion>3.0</em:maxVersion>
28+
</Description>
29+
</em:targetApplication>
30+
31+
</Description>
32+
33+
</RDF>

0 commit comments

Comments
 (0)