[Sciviews-commits] r204 - komodo/SciViews-K komodo/SciViews-K/content komodo/SciViews-K/content/js komodo/SciViews-K/content/js/tools komodo/SciViews-K Unit komodo/SciViews-K Unit/content/js komodo/SciViews-K Unit/skin komodo/SciViews-K Unit/skin/images pkg/svDialogs pkg/svDialogs/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Oct 6 00:56:47 CEST 2009


Author: phgrosjean
Date: 2009-10-06 00:56:47 +0200 (Tue, 06 Oct 2009)
New Revision: 204

Added:
   komodo/SciViews-K Unit/sciviewskunit-0.7.1-ko.xpi
   komodo/SciViews-K Unit/skin/images/
   komodo/SciViews-K Unit/skin/images/appicon.png
   komodo/SciViews-K/content/js/tools/e4x2dom.js
   komodo/SciViews-K/sciviewsk-0.9.3-ko.xpi
Modified:
   komodo/SciViews-K Unit/content/js/sciviewskunit.js
   komodo/SciViews-K Unit/install.rdf
   komodo/SciViews-K/content/js/sciviews.js
   komodo/SciViews-K/content/js/socket.js
   komodo/SciViews-K/content/js/tools/file.js
   komodo/SciViews-K/content/overlayMain.xul
   komodo/SciViews-K/install.rdf
   pkg/svDialogs/DESCRIPTION
   pkg/svDialogs/NEWS
   pkg/svDialogs/R/fixedDlg.R
Log:
Slight reworking of SciViews-K Unit, and needed to add e4x2dom.js back again. Please, do not delete!
Bug correction in svDialogs

Modified: komodo/SciViews-K/content/js/sciviews.js
===================================================================
--- komodo/SciViews-K/content/js/sciviews.js	2009-10-02 14:07:23 UTC (rev 203)
+++ komodo/SciViews-K/content/js/sciviews.js	2009-10-05 22:56:47 UTC (rev 204)
@@ -60,7 +60,7 @@
 	var sv = {
 		// TODO: set this automatically according to the plugin version
 		version: 0.9,
-		release: 0,
+		release: 3,
 		showVersion: true,
 		checkVersion: function (version) {
 			if (this.version < version) {

Modified: komodo/SciViews-K/content/js/socket.js
===================================================================
--- komodo/SciViews-K/content/js/socket.js	2009-10-02 14:07:23 UTC (rev 203)
+++ komodo/SciViews-K/content/js/socket.js	2009-10-05 22:56:47 UTC (rev 204)
@@ -137,8 +137,7 @@
 			pump.init(stream, -1, -1, 0, 0, false);
 			pump.asyncRead(dataListener, null);
 		} catch (e) {
-			sv.log.error("sv.socket.rClient() raises an unknown error\n");
-			//sv.log.exception(e, "sv.socket.rClient() raises an unknown error");
+			sv.log.exception(e, "sv.socket.rClient() raises an unknown error");
 			return(e);
 		}
 		return(null);
@@ -314,11 +313,11 @@
 				classes["@mozilla.org/network/server-socket;1"]
 				.createInstance(Components.interfaces.nsIServerSocket);
 			var port = sv.prefs.getString("sciviews.server.socket", "7052");
-			_serverSocket.init(port, sv.socket.serverIsLocal, -1);
+			_serverSocket.init(port, this.serverIsLocal, -1);
 			_serverSocket.asyncListen(listener);
 			_serverStarted = true;
 		} catch(e) {
-			sv.log.exception(e, "SciViews-K cannot open a server socket on port" +
+			sv.log.exception(e, "SciViews-K cannot open a server socket on port " +
 				port + ".\nMake sure the port is not already used by another" +
 					" Komodo instance" + "\nor choose another port in the" +
 					" preferences and restart Komodo", false);

Added: komodo/SciViews-K/content/js/tools/e4x2dom.js
===================================================================
--- komodo/SciViews-K/content/js/tools/e4x2dom.js	                        (rev 0)
+++ komodo/SciViews-K/content/js/tools/e4x2dom.js	2009-10-05 22:56:47 UTC (rev 204)
@@ -0,0 +1,75 @@
+// SciViews-K E4X functions, 'sv.tools.e4xdom' namespace
+// From this post and modified by R. Francois so that it works with XUL:
+// http://ecmanaut.blogspot.com/2006/03/e4x-and-dom.html
+// License: MPL 1.1/GPL 2.0/LGPL 2.1
+////////////////////////////////////////////////////////////////////////////////
+// sv.tools.e4x2dom.importNode(e4x, doc);     // Translate e4x node to DOM node
+// sv.tools.e4x2dom.appendTo(e4x, node, doc); // Append e4x node to a DOM node
+// sv.tools.e4x2dom.setContent(e4x, node);    // Idem, but clear DOM node first
+// sv.tools.e4x2dom.append(e4x, node, i);     // Append at 'i'th position
+// sv.tools.e4x2dom.clear(node);              // Clear a DOM node
+// sv.tools.e4x2dom.d4e(domNode);             // Translate DOM node to e4x node
+////////////////////////////////////////////////////////////////////////////////
+
+// Define the 'sv.tools.e4x2dom' namespace
+if (typeof(sv.tools.e4x2dom) == 'undefined') sv.tools.e4x2dom = new Object();
+
+// Translate e4x (JavaScript) node into a DOM node
+sv.tools.e4x2dom.importNode = function (e4x, doc) {
+	var me = this.importNode, xhtml, domTree, importMe;
+	me.Const = me.Const || { mimeType: 'text/xml' };
+	me.Static = me.Static || {};
+	me.Static.parser = me.Static.parser || new DOMParser;
+	xhtml = <testing
+		xmlns:html="http://www.w3.org/1999/xhtml"
+		xmlns:svg="http://www.w3.org/2000/svg"
+		xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+		xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"/>;
+	xhtml.test = e4x;
+	domTree = me.Static.parser.parseFromString( xhtml.toXMLString().
+		replace( />\n *</g, "><" ), me.Const.mimeType);
+	importMe = domTree.documentElement.firstChild;
+	while(importMe && importMe.nodeType != 1)
+		importMe = importMe.nextSibling;
+	if(!doc) doc = document;
+	return importMe ? doc.importNode(importMe, true) : null;
+}
+
+// Append an e4x node to a DOM node
+sv.tools.e4x2dom.appendTo = function (e4x, node, doc) {
+	return(node.appendChild(this.importNode(e4x, doc || node.ownerDocument)));
+}
+
+// Append an e4x node to a DOM node, clearing it first
+sv.tools.e4x2dom.setContent = function (e4x, node) {
+	this.clear(node);
+	this.appendTo(e4x, node);
+}
+
+// Append an e4x node to a DOM node, clear first or not depending on 'i'
+sv.tools.e4x2dom.append = function (e4x, node, i) {
+	if (i == 0) {
+		this.setContent(e4x, node);
+	} else {
+		this.appendTo(e4x, node);
+	}
+}
+
+// Clear a DOM node
+sv.tools.e4x2dom.clear = function (node) {
+	while(node.firstChild)
+		node.removeChild(node.firstChild);
+}
+
+// Translate a DOM node into an e4x (JavaScript) node
+sv.tools.e4x2dom.d4e = function (domNode) {
+	var xmls = new XMLSerializer();
+	return(new XML(xmls.serializeToString(domNode)));
+}
+
+var HTML = "http://www.w3.org/1999/xhtml";
+var XUL  = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
+var SVG  = "http://www.w3.org/2000/svg";
+var RDF  = "http://www.w3.org/1999/02/22-rdf-syntax-ns#";
+
+default xml namespace = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";

Modified: komodo/SciViews-K/content/js/tools/file.js
===================================================================
--- komodo/SciViews-K/content/js/tools/file.js	2009-10-02 14:07:23 UTC (rev 203)
+++ komodo/SciViews-K/content/js/tools/file.js	2009-10-05 22:56:47 UTC (rev 204)
@@ -153,7 +153,9 @@
 					getService(Components.interfaces.nsIProperties).
 					get(baseDir, Components.interfaces.nsILocalFile);
 			} catch(e) {
-				sv.log.exception(e, "sv.tools.file.getfile: get " + baseDir);
+				// I don't want to log an exception here, since I try another
+				// method just below!
+				//sv.log.exception(e, "sv.tools.file.getfile: get " + baseDir);
 				file = Components.classes["@mozilla.org/file/local;1"].
 					createInstance(Components.interfaces.nsILocalFile);
 				try {

Modified: komodo/SciViews-K/content/overlayMain.xul
===================================================================
--- komodo/SciViews-K/content/overlayMain.xul	2009-10-02 14:07:23 UTC (rev 203)
+++ komodo/SciViews-K/content/overlayMain.xul	2009-10-05 22:56:47 UTC (rev 204)
@@ -56,6 +56,7 @@
 	<script type="application/x-javascript" src="chrome://sciviewsk/content/js/tools/file.js"/>
 	<script type="application/x-javascript" src="chrome://sciviewsk/content/js/tools/strings.js"/>
 	<script type="application/x-javascript" src="chrome://sciviewsk/content/js/tools/array.js"/>
+	<script type="application/x-javascript" src="chrome://sciviewsk/content/js/tools/e4x2dom.js"/>
 	<script type="application/x-javascript" src="chrome://sciviewsk/content/js/prefs.js"/>
 	<script type="application/x-javascript" src="chrome://sciviewsk/content/js/socket.js"/>
 	<script type="application/x-javascript" src="chrome://sciviewsk/content/js/r.js"/>

Modified: komodo/SciViews-K/install.rdf
===================================================================
--- komodo/SciViews-K/install.rdf	2009-10-02 14:07:23 UTC (rev 203)
+++ komodo/SciViews-K/install.rdf	2009-10-05 22:56:47 UTC (rev 204)
@@ -4,7 +4,7 @@
     <Description about="urn:mozilla:install-manifest">
         <em:id>sciviewsk at sciviews.org</em:id>
         <em:name>SciViews-K</em:name>
-        <em:version>0.9.2</em:version>
+        <em:version>0.9.3</em:version>
         <em:description>Edit R (http://www.r-project.org) code with Komodo</em:description>
         <em:creator>Philippe Grosjean</em:creator>
         <em:homepageURL>http://sciviews.org/SciViews-K</em:homepageURL>

Added: komodo/SciViews-K/sciviewsk-0.9.3-ko.xpi
===================================================================
(Binary files differ)


Property changes on: komodo/SciViews-K/sciviewsk-0.9.3-ko.xpi
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Modified: komodo/SciViews-K Unit/content/js/sciviewskunit.js
===================================================================
--- komodo/SciViews-K Unit/content/js/sciviewskunit.js	2009-10-02 14:07:23 UTC (rev 203)
+++ komodo/SciViews-K Unit/content/js/sciviewskunit.js	2009-10-05 22:56:47 UTC (rev 204)
@@ -41,7 +41,7 @@
 // Define the 'sv.r.unit' namespace
 if (typeof(sv.r.unit) == 'undefined') sv.r.unit = {
 	version: 0.7,
-	release: 0,
+	release: 1,
 	debug: true
 };
 

Modified: komodo/SciViews-K Unit/install.rdf
===================================================================
--- komodo/SciViews-K Unit/install.rdf	2009-10-02 14:07:23 UTC (rev 203)
+++ komodo/SciViews-K Unit/install.rdf	2009-10-05 22:56:47 UTC (rev 204)
@@ -4,10 +4,11 @@
     <Description about="urn:mozilla:install-manifest">
         <em:id>sciviewskunit at sciviews.org</em:id>
         <em:name>SciViews-K Unit</em:name>
-        <em:version>0.7.0</em:version>
+        <em:version>0.7.1</em:version>
         <em:description>SciViews-K Unit - Interface to the svUnit R package</em:description>
         <em:creator>Philippe Grosjean</em:creator>
         <em:homepageURL>http://sciviews.org/SciViews-K</em:homepageURL>
+        <em:iconURL>chrome://sciviewsk/skin/images/appicon.png</em:iconURL>
         <em:type>2</em:type> <!-- type=extension -->
 
         <em:targetApplication>

Added: komodo/SciViews-K Unit/sciviewskunit-0.7.1-ko.xpi
===================================================================
(Binary files differ)


Property changes on: komodo/SciViews-K Unit/sciviewskunit-0.7.1-ko.xpi
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: komodo/SciViews-K Unit/skin/images/appicon.png
===================================================================
(Binary files differ)


Property changes on: komodo/SciViews-K Unit/skin/images/appicon.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Modified: pkg/svDialogs/DESCRIPTION
===================================================================
--- pkg/svDialogs/DESCRIPTION	2009-10-02 14:07:23 UTC (rev 203)
+++ pkg/svDialogs/DESCRIPTION	2009-10-05 22:56:47 UTC (rev 204)
@@ -5,8 +5,8 @@
 Imports: tcltk, svMisc
 Description: Rapidly construct dialog boxes for your GUI, including an automatic
   function assistant
-Version: 0.9-40
-Date: 2009-03-28
+Version: 0.9-41
+Date: 2009-09-28
 Author: Philippe Grosjean
 Maintainer: Philippe Grosjean <phgrosjean at sciviews.org>
 License: GPL (>= 2)

Modified: pkg/svDialogs/NEWS
===================================================================
--- pkg/svDialogs/NEWS	2009-10-02 14:07:23 UTC (rev 203)
+++ pkg/svDialogs/NEWS	2009-10-05 22:56:47 UTC (rev 204)
@@ -1,5 +1,11 @@
 = svDialogs News
 
+== Changes in svDialogs 0.9-41
+
+* When the path contained spaces, guiDlgOpen() and guiDlgSave() returned them in
+  pieces.
+
+
 == Changes in svDialogs 0.9-40
 
 This is the first version distributed on R-forge. It is completely refactored

Modified: pkg/svDialogs/R/fixedDlg.R
===================================================================
--- pkg/svDialogs/R/fixedDlg.R	2009-10-02 14:07:23 UTC (rev 203)
+++ pkg/svDialogs/R/fixedDlg.R	2009-10-05 22:56:47 UTC (rev 204)
@@ -399,7 +399,7 @@
     ### should look how to implement it!
     res <- tkmessageBox(message = message, title = title, type = type,
         default = tkdefault, icon = icon)
-    return(as.character(res))
+    return(tclvalue(res))
 }
 
 "guiDlgOpen" <-
@@ -466,7 +466,7 @@
     # Use tkOpenFile()
     ### TODO: parent argument is defined, but not used yet here...
     ### should look how to implement it!
-    res <- as.character(tkgetOpenFile(title = title, initialfile = defaultFile,
+    res <- tclvalue(tkgetOpenFile(title = title, initialfile = defaultFile,
         initialdir = defaultDir, multiple = multi, filetypes = filters))
 	if (length(res) == 1 && res == "") res <- character(0)
     return(res)
@@ -562,7 +562,7 @@
     # Use tkSaveFile()
     ### TODO: parent argument is defined, but not used yet here...
     ### should look how to implement it!
-    res <- as.character(tkgetSaveFile(title = title, initialfile = defaultFile,
+    res <- tclvalue(tkgetSaveFile(title = title, initialfile = defaultFile,
         initialdir = defaultDir, defaultextension = defaultExt,
         filetypes = filters))
     return(res)



More information about the Sciviews-commits mailing list