qsos-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qsos-commits] qsos/apps/tpl-xuleditor chrome/content/about.xu...


From: Raphaël Semeteys
Subject: [Qsos-commits] qsos/apps/tpl-xuleditor chrome/content/about.xu...
Date: Tue, 28 Nov 2006 17:43:37 +0000

CVSROOT:        /sources/qsos
Module name:    qsos
Changes by:     Raphaël Semeteys <rsemeteys>   06/11/28 17:43:37

Modified files:
        apps/tpl-xuleditor/chrome/content: about.xul confirm.xul 
                                           editor.js editor.xul 
                                           newdesc.xul newscore.xul 
                                           newsection.xul 
                                           qsos-tpl-overlay.xul 
                                           Template.js 
        apps/tpl-xuleditor: application.ini Changes chrome.manifest 
                            install.rdf README 

Log message:
        Localisation
        Firefox extention packaging
        Version 0.2 packaging

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/tpl-xuleditor/chrome/content/about.xul?cvsroot=qsos&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/tpl-xuleditor/chrome/content/confirm.xul?cvsroot=qsos&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/tpl-xuleditor/chrome/content/editor.js?cvsroot=qsos&r1=1.9&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/tpl-xuleditor/chrome/content/editor.xul?cvsroot=qsos&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/tpl-xuleditor/chrome/content/newdesc.xul?cvsroot=qsos&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/tpl-xuleditor/chrome/content/newscore.xul?cvsroot=qsos&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/tpl-xuleditor/chrome/content/newsection.xul?cvsroot=qsos&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/tpl-xuleditor/chrome/content/qsos-tpl-overlay.xul?cvsroot=qsos&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/tpl-xuleditor/chrome/content/Template.js?cvsroot=qsos&r1=1.9&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/tpl-xuleditor/application.ini?cvsroot=qsos&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/tpl-xuleditor/Changes?cvsroot=qsos&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/tpl-xuleditor/chrome.manifest?cvsroot=qsos&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/tpl-xuleditor/install.rdf?cvsroot=qsos&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/qsos/apps/tpl-xuleditor/README?cvsroot=qsos&r1=1.1&r2=1.2

Patches:
Index: chrome/content/about.xul
===================================================================
RCS file: /sources/qsos/qsos/apps/tpl-xuleditor/chrome/content/about.xul,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- chrome/content/about.xul    17 Apr 2006 21:12:49 -0000      1.1
+++ chrome/content/about.xul    28 Nov 2006 17:43:37 -0000      1.2
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<!DOCTYPE window>
+<!DOCTYPE window SYSTEM "chrome://qsos-tpl-xuled/locale/about.dtd">
 
-<dialog id="about" title="About"
+<dialog id="about" title="&about.label;"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
         buttons="accept">
 
@@ -12,14 +12,14 @@
        </hbox>
        <vbox>
                <label value=""/>
-               <label value="QSOS Template XUL Editor v0.1"/>
-               <label value="Software under the terms of the GNU Public 
License"/>
+               <label value="&label1.value;"/>
+               <label value="&label2.value;"/>
                <label value=""/>
-               <label value="Authors:"/>
-               <label value="   . address@hidden"/>
+               <label value="&label3.value;"/>
+               <label value="&label4.value;"/>
                <label value=""/>
-               <label value="Source code available on 
http://savannah.nongnu.org/projects/qsos"/>
-               <label value="Information on QSOS method available on 
http://www.qsos.org"/>
+               <label value="&label5.value;"/>
+               <label value="&label6.value;"/>
        </vbox>
 </vbox>
 

Index: chrome/content/confirm.xul
===================================================================
RCS file: /sources/qsos/qsos/apps/tpl-xuleditor/chrome/content/confirm.xul,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- chrome/content/confirm.xul  17 Apr 2006 21:12:49 -0000      1.1
+++ chrome/content/confirm.xul  28 Nov 2006 17:43:37 -0000      1.2
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<!DOCTYPE window>
+<!DOCTYPE window SYSTEM "chrome://qsos-tpl-xuled/locale/confirm.dtd">
 
-<dialog id="confirm" title="Confirm"
+<dialog id="confirm" title="&confirm.title;"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
        buttons="accept,cancel"
        ondialogaccept="return doOK();"

Index: chrome/content/editor.js
===================================================================
RCS file: /sources/qsos/qsos/apps/tpl-xuleditor/chrome/content/editor.js,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- chrome/content/editor.js    3 Nov 2006 14:16:56 -0000       1.9
+++ chrome/content/editor.js    28 Nov 2006 17:43:37 -0000      1.10
@@ -18,7 +18,7 @@
 ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  
USA
 **
 **
-** QSOS XUL Editor
+** QSOS XUL Template Editor
 ** editor.js: functions associated with the editor.xul file
 **
 ** TODO:
@@ -31,9 +31,12 @@
 var docChanged;
 //id (actually "name" in the QSOS XML file) of the currently selected criteria 
in the tree
 var id;
+//Localized strings bundle
+var strbundle;
 
 //Window initialization after loading
 function init() {
+       strbundle = document.getElementById("properties");
        docChanged = "false";
        freezeGeneric("true");
        freezeType("true");
@@ -62,15 +65,15 @@
        var nsIFilePicker = Components.interfaces.nsIFilePicker;
        var fp = Components.classes["@mozilla.org/filepicker;1"]
        .createInstance(nsIFilePicker);
-       fp.init(window, "Save the file as", nsIFilePicker.modeSave);
-       fp.appendFilter("QSOS Template file","*.qtpl");
+       fp.init(window,  strbundle.getString("saveFile"), 
nsIFilePicker.modeSave);
+       fp.appendFilter(strbundle.getString("QSOSTemplateFile"),"*.qtpl");
        var res = fp.show();
        if (res == nsIFilePicker.returnOK) {
                myDoc = new Template();
                myDoc.create(fp.file.path);
        
                //Window's title
-               document.getElementById("QSOS").setAttribute("title", "New QSOS 
template");
+               document.getElementById("QSOS").setAttribute("title", 
strbundle.getString("newFile"));
                
                //Tree population
                var tree = document.getElementById("mytree");
@@ -111,8 +114,8 @@
     var nsIFilePicker = Components.interfaces.nsIFilePicker;
     var fp = Components.classes["@mozilla.org/filepicker;1"]
             .createInstance(nsIFilePicker);
-    fp.init(window, "Select a file", nsIFilePicker.modeOpen);
-    fp.appendFilter("QSOS Template file","*.qtpl");
+    fp.init(window, strbundle.getString("selectFile"), nsIFilePicker.modeOpen);
+    fp.appendFilter(strbundle.getString("QSOSTemplateFile"),"*.qtpl");
     var res = fp.show();
     
     if (res == nsIFilePicker.returnOK) {
@@ -120,7 +123,7 @@
         myDoc.load(fp.file.path);
         
         //Window's title
-        document.getElementById("QSOS").setAttribute("title", "QSOS template: 
"+myDoc.getqsosappfamily());
+        document.getElementById("QSOS").setAttribute("title", 
strbundle.getString("QSOSTemplate")+": "+myDoc.getqsosappfamily());
         
         //Tree population
         var tree = document.getElementById("mytree");
@@ -142,7 +145,7 @@
 function checkopenFile() {
        if (myDoc) {
                if (docChanged == "true") {
-                       confirmDialog("Document has been modified but not 
saved, close it anyway?", closeFile);
+                       confirmDialog(strbundle.getString("closeAnyway"), 
closeFile);
                }
                else {
                        closeFile();
@@ -215,8 +218,8 @@
        var nsIFilePicker = Components.interfaces.nsIFilePicker;
        var fp = Components.classes["@mozilla.org/filepicker;1"]
                .createInstance(nsIFilePicker);
-       fp.init(window, "Save the file as", nsIFilePicker.modeSave);
-       fp.appendFilter("QSOS file","*.qtpl");
+       fp.init(window, strbundle.getString("saveFileAs"), 
nsIFilePicker.modeSave);
+       fp.appendFilter(strbundle.getString("QSOSTemplateFile"),"*.qtpl");
        var res = fp.show();
        if (res == nsIFilePicker.returnOK) {
                myDoc.setfilename(fp.file.path);
@@ -230,7 +233,7 @@
 //////////////////////////
 //Closes the QSOS XML file and resets window
 function closeFile() {
-       document.getElementById("QSOS").setAttribute("title", "QSOS XUL 
Editor");
+       document.getElementById("QSOS").setAttribute("title", 
strbundle.getString("QSOSTemplateEditor"));
        document.getElementById("f-softwarefamily").value = "";
        document.getElementById("f-version").value = "";
 
@@ -253,7 +256,7 @@
 //Checks Document's state before closing it
 function checkcloseFile() {
        if (docChanged == "true") {
-               confirmDialog("Document has been modified, save it before?", 
saveFile);
+               confirmDialog(strbundle.getString("saveBefore"), saveFile);
        }
        closeFile();
 }
@@ -269,7 +272,7 @@
 //Checks Document's state before exiting
 function checkexit() {
        if (docChanged == "true") {
-               confirmDialog("Document has been modified but not saved, exit 
anyway?", exit);
+               confirmDialog(strbundle.getString("exitAnyway"), exit);
                return;
        }
        else {
@@ -719,7 +722,7 @@
 
 //Context menu "Delete"
 function deleteCriterion() {
-       var result = confirm("Do you confirm deletion of UID "+id+" 
criterion?");
+       var result = confirm(strbundle.getString("confirmDelete1")+" "+id+" 
"+strbundle.getString("confirmDelete2"));
        if (result) {
                myDoc.deleteNode(id);
                var node = document.getElementById(id).parentNode.parentNode;

Index: chrome/content/editor.xul
===================================================================
RCS file: /sources/qsos/qsos/apps/tpl-xuleditor/chrome/content/editor.xul,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- chrome/content/editor.xul   20 Apr 2006 11:51:19 -0000      1.4
+++ chrome/content/editor.xul   28 Nov 2006 17:43:37 -0000      1.5
@@ -1,46 +1,49 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
 <?xml-stylesheet href="chrome://qsos-tpl-xuled/skin/classic.css" 
type="text/css"?>
-<!DOCTYPE window>
+<!DOCTYPE window SYSTEM "chrome://qsos-tpl-xuled/locale/editor.dtd">
 
-<window id="QSOS" title="QSOS Template XUL Editor" width="800px" height="600px"
+<window id="QSOS" title="&QSOS.label;" width="800px" height="600px"
     xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
     onload="init();">
-       <script type="application/x-javascript" src="Template.js"></script>
-       <script type="application/x-javascript" src="editor.js"></script>
        
-       <popup id="element-popup" onpopupshowing="displayPopup();">
-               <menuitem id="element-new-section" label="New section" 
oncommand="openSectionDialog();"/>
-               <menuitem id="element-new-desc" label="New information 
criterion" oncommand="openDescDialog();"/>
-               <menuitem id="element-new-score" label="New scored criterion" 
oncommand="openScoreDialog();"/>
-               <menuitem id="element-moveup" label="Move Up" 
oncommand="moveUp();"/>
-               <menuitem id="element-movedown" label="Move Down" 
oncommand="moveDown();"/>
-               <menuitem id="element-delete" label="Delete" 
oncommand="deleteCriterion();"/>
-       </popup>
+<script type="application/x-javascript" src="Template.js"></script>
+<script type="application/x-javascript" src="editor.js"></script>
        
-       <vbox flex = "1">
+<popup id="element-popup" onpopupshowing="displayPopup();">
+       <menuitem id="element-new-section" label="&popup-new-section.label;" 
oncommand="openSectionDialog();"/>
+       <menuitem id="element-new-desc" label="&popup-new-desc.label;" 
oncommand="openDescDialog();"/>
+       <menuitem id="element-new-score" label="&popup-new-score.label;" 
oncommand="openScoreDialog();"/>
+       <menuitem id="element-moveup" label="&popup-moveup.label;" 
oncommand="moveUp();"/>
+       <menuitem id="element-movedown" label="&popup-movedown.label;" 
oncommand="moveDown();"/>
+       <menuitem id="element-delete" label="&popup-delete.label;" 
oncommand="deleteCriterion();"/>
+</popup>
+
+<stringbundle id="properties" 
src="chrome://qsos-tpl-xuled/locale/editor.properties"/>
+
+<vbox flex = "1">
                <toolbox>
                        <menubar id="mymenubar">
-                               <menu id="file-menu" label="File" 
onclick="document.getElementById('file-menu').focus();">
+                       <menu id="file-menu" label="&file-menu.label;" 
onclick="document.getElementById('file-menu').focus();">
                                        <menupopup id="file-popup">
-                                               <menuitem id="file-new" 
label="New" oncommand="checknewFile();"/>
-                                               <menuitem id="file-open" 
label="Open" oncommand="checkopenFile();"/>
-                                               <menuitem id="file-save" 
label="Save" oncommand="saveFile();"/>
-                                               <menuitem id="file-saveas" 
label="Save As" oncommand="saveFileAs();"/>
-                                               <menuitem id="file-close" 
label="Close"  oncommand="checkcloseFile();"/>
+                                       <menuitem id="file-new" 
label="&file-new.label;" oncommand="checknewFile();"/>
+                                       <menuitem id="file-open" 
label="&file-open.label;" oncommand="checkopenFile();"/>
+                                       <menuitem id="file-save" 
label="&file-save.label;" oncommand="saveFile();"/>
+                                       <menuitem id="file-saveas" 
label="&file-saveas.label;" oncommand="saveFileAs();"/>
+                                       <menuitem id="file-close" 
label="&file-close.label;"  oncommand="checkcloseFile();"/>
                                                <menuseparator/>
-                                               <menuitem id="file-exit" 
label="Exit" oncommand="checkexit();"/>
+                                       <menuitem id="file-exit" 
label="&file-exit.label;" oncommand="checkexit();"/>
                                        </menupopup>
                                </menu>
-                               <menu id="tree-menu" label="Tree" 
onclick="document.getElementById('tree-menu').focus();">
+                       <menu id="tree-menu" label="&tree-menu.label;" 
onclick="document.getElementById('tree-menu').focus();">
                                        <menupopup id="tree-popup">
-                                               <menuitem id="tree-expand" 
label="Expand all" oncommand="expandTree('true');"/>
-                                               <menuitem id="tree-collapse" 
label="Collapse all" oncommand="expandTree('false');"/>
+                                       <menuitem id="tree-expand" 
label="&tree-expand.label;" oncommand="expandTree('true');"/>
+                                       <menuitem id="tree-collapse" 
label="&tree-collapse.label;" oncommand="expandTree('false');"/>
                                        </menupopup>
                                </menu>
-                               <menu id="help-menu" label="Help" 
onclick="document.getElementById('help-menu').focus();">
+                       <menu id="help-menu" label="&help-menu.label;" 
onclick="document.getElementById('help-menu').focus();">
                                        <menupopup id="help-popup">
-                                               <menuitem id="help-about" 
label="About" oncommand="aboutDialog();"/>
+                                       <menuitem id="help-about" 
label="&help-about.label;" oncommand="aboutDialog();"/>
                                        </menupopup>
                                </menu>
                        </menubar>
@@ -49,46 +52,46 @@
                        <vbox>
                                <tree id="mytree" context="element-popup" 
width="300px" onselect="treeselect(this);" flex="1">
                                <treecols>
-                                       <treecol id="name" label="Criteria" 
primary="true" flex="1"/>
+                               <treecol id="name" label="&name.label;" 
primary="true" flex="1"/>
                                </treecols>
                                </tree>
                        </vbox>
                        <vbox flex = "1">
                                <groupbox id="g-template">
-                                       <caption><label 
value="Template"/></caption>
+                               <caption><label 
value="&g-template.label;"/></caption>
                                        <vbox>
-                                               <label 
control="f-softwarefamily" value="Software family: "/>
+                                       <label control="f-softwarefamily" 
value="&f-softwarefamily.label;"/>
                                                <textbox id="f-softwarefamily" 
onchange="changeSoftwareFamily(this);"/>
-                                               <label control="f-version" 
value="Version: "/>
+                                       <label control="f-version" 
value="&f-version.label;"/>
                                                <textbox id="f-version" 
onchange="changeVersion(this);"/>
                                        </vbox>
                                </groupbox>
                                <groupbox id="g-c-id">
-                                       <caption><label id="f-c-name" 
value="UID"/></caption>
-                                       <label control="f-c-title" 
value="Title"/>
+                               <caption><label id="f-c-name" 
value="&f-c-name.label;"/></caption>
+                               <label control="f-c-title" 
value="&f-c-title.label;"/>
                                        <textbox id="f-c-title" 
onchange="changeTitle(this);"/>
                                        <groupbox id="g-c-type">
-                                               <caption><label 
value="Type"/></caption>
+                                       <caption><label 
value="&g-c-type.label;"/></caption>
                                                <radiogroup id="f-c-type" 
orient="horizontal">
-                                                       <radio id="f-c-info" 
label="Information" flex="1" oncommand="changeType('desc');"/>
-                                                       <radio id="f-c-score" 
label="Score" flex="1" oncommand="changeType('score');"/>
+                                               <radio id="f-c-info" 
label="&f-c-info.label;" flex="1" oncommand="changeType('desc');"/>
+                                               <radio id="f-c-score" 
label="&f-c-score.label;" flex="1" oncommand="changeType('score');"/>
                                                </radiogroup>
                                        </groupbox>
                                        <groupbox id="g-c-desc">
-                                               <caption><label 
value="Description"/></caption>
+                                       <caption><label 
value="&g-c-desc.label;"/></caption>
                                                <textbox id="f-c-desc" 
multiline="true" onchange="changeDesc(this);"/>
                                        </groupbox>
                                        <groupbox id="g-c-scores">
-                                               <caption><label 
value="Scores"/></caption>
-                                               <label control="f-c-score0" 
value="Score 0: "/>
+                                       <caption><label 
value="&g-c-scores.label;"/></caption>
+                                       <label control="f-c-score0" 
value="&f-c-score0.label;"/>
                                                <textbox id="f-c-score0" 
multiline="true" onchange="changeScore0(this.value);"/>
-                                               <label control="f-c-score1" 
value="Score 1: "/>
+                                       <label control="f-c-score1" 
value="&f-c-score1.label;"/>
                                                <textbox id="f-c-score1" 
multiline="true" onchange="changeScore1(this.value);"/>
-                                               <label control="f-c-score2" 
value="Score 2: "/>
+                                       <label control="f-c-score2" 
value="&f-c-score2.label;"/>
                                                <textbox id="f-c-score2" 
multiline="true" onchange="changeScore2(this.value);"/>
                                        </groupbox>
                                </groupbox>
                        </vbox>
                </hbox>
-       </vbox>
+</vbox>
 </window>
\ No newline at end of file

Index: chrome/content/newdesc.xul
===================================================================
RCS file: /sources/qsos/qsos/apps/tpl-xuleditor/chrome/content/newdesc.xul,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- chrome/content/newdesc.xul  18 Apr 2006 16:43:34 -0000      1.2
+++ chrome/content/newdesc.xul  28 Nov 2006 17:43:37 -0000      1.3
@@ -1,48 +1,48 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<!DOCTYPE window>
+<!DOCTYPE window SYSTEM "chrome://qsos-tpl-xuled/locale/newdesc.dtd">
 
-<dialog id="newdesc" title="New information criterion"
+<dialog id="newdesc" title="&newdesc.label;"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
        buttons="accept,cancel"
        ondialogaccept="return doOK();"
         ondialogcancel="return doCancel();">
        
+<script src="commons.js" type="application/x-javascript"/>
 <script type="application/x-javascript">
+<![CDATA[
        
 function doOK() {
+       var strbundle = document.getElementById("properties");
        var myDoc = window.arguments[0];
-       if (document.getElementById("d-c-name").value == "") {
-               alert("UID is mandatory");
-               return false;
-       }
-       if (myDoc.fetchNode(document.getElementById("d-c-name").value) != 
"false") {
-       alert("A criterion with id 
"+document.getElementById("d-c-name").value+" already exists.");
+       var fields = new Object();
+
+       if (document.getElementById("d-c-title").value == "") {
+               alert(strbundle.getString("alert"));
                return false;
        }
-       else {
-               var fields = new Object();
-               fields.name = document.getElementById("d-c-name").value;
+       
                fields.title = document.getElementById("d-c-title").value;
+       fields.name = getUID(myDoc);
                fields.desc = document.getElementById("d-c-desc").value;
                window.arguments[1](fields);
                return true;
-       }
 }
 
 function doCancel() {
        return true;
 }
+
+]]>
 </script>
 
-<vbox>
-       <label control="d-c-name" value="Unique name (UID): "/>
-       <textbox id="d-c-name"/>
+<stringbundle id="properties" 
src="chrome://qsos-tpl-xuled/locale/new.properties"/>
        
-       <label control="d-c-title" value="Title "/>
+<vbox>
+       <label control="d-c-title" value="&label1.value;"/>
        <textbox id="d-c-title"/>
        
-       <label control="d-c-desc" value="Description: "/>
+       <label control="d-c-desc" value="&label2.value; "/>
        <textbox id="d-c-desc" multiline="true"/>
 </vbox>
 

Index: chrome/content/newscore.xul
===================================================================
RCS file: /sources/qsos/qsos/apps/tpl-xuleditor/chrome/content/newscore.xul,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- chrome/content/newscore.xul 8 May 2006 21:08:56 -0000       1.3
+++ chrome/content/newscore.xul 28 Nov 2006 17:43:37 -0000      1.4
@@ -1,60 +1,60 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<!DOCTYPE window>
+<!DOCTYPE window SYSTEM "chrome://qsos-tpl-xuled/locale/newscore.dtd">
 
-<dialog id="newscore" title="New score criterion"
+<dialog id="newscore" title="&newscore.label;"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
        buttons="accept,cancel"
        ondialogaccept="return doOK();"
         ondialogcancel="return doCancel();">
        
+<script src="commons.js" type="application/x-javascript"/>
 <script type="application/x-javascript">
+<![CDATA[
        
 function doOK() {
+       var strbundle = document.getElementById("properties");
        var myDoc = window.arguments[0];
-       if (document.getElementById("d-c-name").value == "") {
-               alert("UID is mandatory");
-               return false;
-       }
-       if (myDoc.fetchNode(document.getElementById("d-c-name").value) != 
"false") {
-               alert("A criterion with id 
"+document.getElementById("d-c-name").value+" already exists.");
+       var fields = new Object();
+       
+       if (document.getElementById("d-c-title").value == "") {
+               alert(strbundle.getString("alert"));
                return false;
        }
-       else {
-               var fields = new Object();
-               fields.name = document.getElementById("d-c-name").value;
+
                fields.title = document.getElementById("d-c-title").value;
+       fields.name = getUID(myDoc);
                fields.desc = document.getElementById("d-c-desc").value;
                fields.desc0 = document.getElementById("d-c-desc0").value;
                fields.desc1 = document.getElementById("d-c-desc1").value;
                fields.desc2 = document.getElementById("d-c-desc2").value;
                window.arguments[1](fields);
                return true;
-       }
 }
 
 function doCancel() {
        return true;
 }
+
+]]>
 </script>
 
-<vbox>
-       <label control="d-c-name" value="Unique name (UID): "/>
-       <textbox id="d-c-name"/>
+<stringbundle id="properties" 
src="chrome://qsos-tpl-xuled/locale/new.properties"/>
        
-       <label control="d-c-title" value="Title "/>
+<vbox>
+       <label control="d-c-title" value="&label1.value;"/>
        <textbox id="d-c-title"/>
 
-       <label control="d-c-desc" value="General description: "/>
+       <label control="d-c-desc" value="&label2.value;"/>
        <textbox id="d-c-desc" multiline="true"/>
        
-       <label control="d-c-desc0" value="Score 0 description: "/>
+       <label control="d-c-desc0" value="&label3.value;"/>
        <textbox id="d-c-desc0" multiline="true"/>
 
-       <label control="d-c-desc1" value="Score 1 description: "/>
+       <label control="d-c-desc1" value="&label4.value;"/>
        <textbox id="d-c-desc1" multiline="true"/>
 
-       <label control="d-c-desc2" value="Score 2 description: "/>
+       <label control="d-c-desc2" value="&label5.value;"/>
        <textbox id="d-c-desc2" multiline="true"/>
 </vbox>
 

Index: chrome/content/newsection.xul
===================================================================
RCS file: /sources/qsos/qsos/apps/tpl-xuleditor/chrome/content/newsection.xul,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- chrome/content/newsection.xul       19 Apr 2006 14:37:23 -0000      1.1
+++ chrome/content/newsection.xul       28 Nov 2006 17:43:37 -0000      1.2
@@ -1,48 +1,48 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<!DOCTYPE window>
+<!DOCTYPE window SYSTEM "chrome://qsos-tpl-xuled/locale/newsection.dtd">
 
-<dialog id="newsection" title="New section"
+<dialog id="newsection" title="&newsection.label;"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
        buttons="accept,cancel"
        ondialogaccept="return doOK();"
         ondialogcancel="return doCancel();">
        
+<script src="commons.js" type="application/x-javascript"/>
 <script type="application/x-javascript">
+<![CDATA[
        
 function doOK() {
+       var strbundle = document.getElementById("properties");
        var myDoc = window.arguments[0];
-       if (document.getElementById("d-c-name").value == "") {
-               alert("UID is mandatory");
-               return false;
-       }
-       if (myDoc.fetchNode(document.getElementById("d-c-name").value) != 
"false") {
-               alert("A element with id 
"+document.getElementById("d-c-name").value+" already exists.");
+       var fields = new Object();
+       
+       if (document.getElementById("d-c-title").value == "") {
+               alert(strbundle.getString("alert"));
                return false;
        }
-       else {
-               var fields = new Object();
-               fields.name = document.getElementById("d-c-name").value;
+       
                fields.title = document.getElementById("d-c-title").value;
+       fields.name = getUID(myDoc);
                fields.desc = document.getElementById("d-c-desc").value;
                window.arguments[1](fields);
                return true;
-       }
 }
 
 function doCancel() {
        return true;
 }
+
+]]>
 </script>
 
-<vbox>
-       <label control="d-c-name" value="Unique name (UID): "/>
-       <textbox id="d-c-name"/>
+<stringbundle id="properties" 
src="chrome://qsos-tpl-xuled/locale/new.properties"/>
        
-       <label control="d-c-title" value="Title "/>
+<vbox>
+       <label control="d-c-title" value="&label1.value;"/>
        <textbox id="d-c-title"/>
        
-       <label control="d-c-desc" value="Description: "/>
+       <label control="d-c-desc" value="&label2.value;"/>
        <textbox id="d-c-desc" multiline="true"/>
 </vbox>
 

Index: chrome/content/qsos-tpl-overlay.xul
===================================================================
RCS file: 
/sources/qsos/qsos/apps/tpl-xuleditor/chrome/content/qsos-tpl-overlay.xul,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- chrome/content/qsos-tpl-overlay.xul 21 Jun 2006 23:42:17 -0000      1.1
+++ chrome/content/qsos-tpl-overlay.xul 28 Nov 2006 17:43:37 -0000      1.2
@@ -1,8 +1,9 @@
 <?xml version="1.0"?>
+<!DOCTYPE overlay SYSTEM "chrome://qsos-tpl-xuled/locale/qsos-tpl-overlay.dtd">
 
 <overlay id="qsos-tpl-overlay" 
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";>
        <menupopup id="menu_ToolsPopup">
                <menuitem id="qsos-tpl-xuled" 
-                         label="QSOS Template Editor" 
oncommand="window.openDialog('chrome://qsos-tpl-xuled/content/editor.xul','QSOS 
Template Editor', '_blank', 'chrome,dialog=no');"/>
+                         label="&qsos-tpl-xuled.label;" 
oncommand="window.openDialog('chrome://qsos-tpl-xuled/content/editor.xul','&qsos-tpl-xuled.label;',
 '_blank', 'chrome,dialog=no');"/>
        </menupopup>
 </overlay>
\ No newline at end of file

Index: chrome/content/Template.js
===================================================================
RCS file: /sources/qsos/qsos/apps/tpl-xuleditor/chrome/content/Template.js,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- chrome/content/Template.js  17 May 2006 16:33:04 -0000      1.9
+++ chrome/content/Template.js  28 Nov 2006 17:43:37 -0000      1.10
@@ -19,7 +19,7 @@
 **
 **
 ** QSOS Template XUL Editor
-** Template.js: template object abstracting the QSOS XML format
+** Template.js: template object abstracting the QSOS Template XML format
 **
 ** TODO:
 **     - Load remote QSOS XML file
@@ -98,20 +98,28 @@
         } catch (e) {
             alert("Permission to read file was denied.");
         }
+
         var file = Components.classes["@mozilla.org/file/local;1"]
             .createInstance(Components.interfaces.nsILocalFile);
         file.initWithPath(filename);
         if (file.exists() == false) {
             alert("File does not exist");
         }
+
         var is = Components.classes["@mozilla.org/network/file-input-stream;1"]
             .createInstance(Components.interfaces.nsIFileInputStream);
         is.init(file, 0x01, 00004, null);
+
         var sis = Components.classes["@mozilla.org/scriptableinputstream;1"]
             .createInstance(Components.interfaces.nsIScriptableInputStream);
         sis.init(is);
         var output = sis.read(sis.available());
         
+       var converter = 
Components.classes["@mozilla.org/intl/scriptableunicodeconverter"]
+               
.createInstance(Components.interfaces.nsIScriptableUnicodeConverter);
+       converter.charset = "UTF-8";
+       output = converter.ConvertToUnicode(output);
+ 
         var domParser = new DOMParser();
        sheet = domParser.parseFromString(output, "text/xml");
     }
@@ -138,6 +146,12 @@
        //serializer.serializeToStream(sheet, outputStream, "UTF-8"); 
 
        var xml = serialize(sheet.documentElement, 0);
+
+       var converter = 
Components.classes["@mozilla.org/intl/scriptableunicodeconverter"]
+               
.createInstance(Components.interfaces.nsIScriptableUnicodeConverter);
+       converter.charset = "UTF-8";
+       xml = converter.ConvertFromUnicode(xml);
+
        outputStream.write(xml, xml.length);
 
         outputStream.close();

Index: application.ini
===================================================================
RCS file: /sources/qsos/qsos/apps/tpl-xuleditor/application.ini,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- application.ini     21 Jun 2006 23:40:17 -0000      1.2
+++ application.ini     28 Nov 2006 17:43:37 -0000      1.3
@@ -1,9 +1,9 @@
 [App]
  address@hidden
  Name=QSOS Template XUL Editor
- Version=0.1
- BuildID=20060413
- Copyright=Copyright (c) 2006 Raphaël Semeteys
+ Version=0.2
+ BuildID=20061128
+ Copyright=Copyright (c) 2006 Raphael Semeteys
  address@hidden
 
  [Gecko]

Index: Changes
===================================================================
RCS file: /sources/qsos/qsos/apps/tpl-xuleditor/Changes,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- Changes     17 Apr 2006 21:09:27 -0000      1.1
+++ Changes     28 Nov 2006 17:43:37 -0000      1.2
@@ -1,4 +1,8 @@
-Revision history for QSOS XUL Editor
+Revision history for QSOS XUL Template Editor
 
-0.01  2006
+0.1  2006
       - Initial release
\ No newline at end of file
+
+0.2  2006/11/28
+       - Firefox extention packaging
+       - UID are now generated
\ No newline at end of file

Index: chrome.manifest
===================================================================
RCS file: /sources/qsos/qsos/apps/tpl-xuleditor/chrome.manifest,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- chrome.manifest     21 Jun 2006 23:40:17 -0000      1.2
+++ chrome.manifest     28 Nov 2006 17:43:37 -0000      1.3
@@ -1,3 +1,6 @@
 content qsos-tpl-xuled  chrome/content/
 skin qsos-tpl-xuled  classic chrome/skin/
 overlay chrome://browser/content/browser.xul 
chrome://qsos-tpl-xuled/content/qsos-tpl-overlay.xul
\ No newline at end of file
+
+locale qsos-tpl-xuled en-US chrome/locale/en-US/
+locale qsos-tpl-xuled fr-FR chrome/locale/fr-FR/
\ No newline at end of file

Index: install.rdf
===================================================================
RCS file: /sources/qsos/qsos/apps/tpl-xuleditor/install.rdf,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- install.rdf 21 Jun 2006 23:40:17 -0000      1.1
+++ install.rdf 28 Nov 2006 17:43:37 -0000      1.2
@@ -1,21 +1,22 @@
 <?xml version="1.0"?>
-
 <RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
      xmlns:em="http://www.mozilla.org/2004/em-rdf#";>
        <Description about="urn:mozilla:install-manifest">
                <em:id>address@hidden</em:id>
-               <em:version>0.1</em:version>
+               <em:version>0.2</em:version>
                <em:type>2</em:type>
                <em:targetApplication>
                        <Description>
                                
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
-                               <em:minVersion>1.0</em:minVersion>
-                               <em:maxVersion>1.5.0.*</em:maxVersion>
+                               <em:minVersion>1.5</em:minVersion>
+                               <em:maxVersion>2.*</em:maxVersion>
                        </Description>
                </em:targetApplication>
                <em:name>QSOS Template XUL Editor</em:name>
-               <em:creator>Raphaël Semeteys</em:creator>
+               <em:creator>Raphael Semeteys</em:creator>
+               
<em:iconURL>chrome://qsos-tpl-xuled/content/logo32.png</em:iconURL>
                <em:homepageURL>http://www.qsos.org/</em:homepageURL>
                
<em:aboutURL>chrome://qsos-tpl-xuled/content/about.xul</em:aboutURL>
+               
<em:updateURL>http://www.qsos.org/tools/tpl-xuleditor-update.rdf</em:updateURL>
        </Description>
 </RDF>
\ No newline at end of file

Index: README
===================================================================
RCS file: /sources/qsos/qsos/apps/tpl-xuleditor/README,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- README      17 Apr 2006 21:09:27 -0000      1.1
+++ README      28 Nov 2006 17:43:37 -0000      1.2
@@ -4,34 +4,41 @@
 
 PREREQUISITES
 
-QSOS XML mozilla-javascript library: Document.js (included in chrome/content/ 
folder)
 Mozilla Javascript
-xulrunner 1.8+
+xulrunner 1.8+ OR Mozilla Firefox 1.5+
 
-INSTALLING
+INSTALLING ON XULRUNNER
 
 If not done yet, install xulrunner and register it (xulrunner 
--register-global).
-Copy xuleditor folder where it fits you.
+Unzip tpl-xuleditor-application-<version>.zip file where it fits you.
 
 LAUNCHING ON LINUX
 
-./xuleditor [debug]
+./tpl-xuleditor [debug]
 or
 xulrunner application.ini
 
 LAUNCHING ON WINDOWS
 
-xuleditor.bat [debug]
+tpl-xuleditor.bat [debug]
 or
 xulrunner.exe application.ini
 
+INSTALLING IN FIREFOX
+
+Open the XPI file with Firefox and choose "Install".
+
+LAUNCHING IN FIREFOX
+
+Menu "Tools/QSOS Template Editor".
+
 STATUS
 
-QSOS XUL Editor is still under development.
+QSOS XUL Template Editor is still under development.
 
 COPYRIGHT
 
 Copyright 2006 Atos Origin <address@hidden>
 
-This library is free software; you can redistribute it
+This is free software; you can redistribute it
 and/or modify it under the terms of the GNU General Public License.
\ No newline at end of file




reply via email to

[Prev in Thread] Current Thread [Next in Thread]