[Sciviews-commits] r533 - komodo/SciViews-K komodo/SciViews-K/content komodo/SciViews-K/content/js pkg/svDoc/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Oct 29 12:20:40 CET 2013


Author: phgrosjean
Date: 2013-10-29 12:20:40 +0100 (Tue, 29 Oct 2013)
New Revision: 533

Modified:
   komodo/SciViews-K/content/js/commands.js
   komodo/SciViews-K/content/js/r.js
   komodo/SciViews-K/content/js/sciviews.js
   komodo/SciViews-K/content/overlayMain-ko6.xul
   komodo/SciViews-K/content/overlayMain.xul
   komodo/SciViews-K/install.rdf
   pkg/svDoc/R/asciidoc.R
Log:
A couple of bug fixes for Komodo 8 in SciViews-K + update of asciidoc support in svDoc

Modified: komodo/SciViews-K/content/js/commands.js
===================================================================
--- komodo/SciViews-K/content/js/commands.js	2013-10-10 14:45:37 UTC (rev 532)
+++ komodo/SciViews-K/content/js/commands.js	2013-10-29 11:20:40 UTC (rev 533)
@@ -495,8 +495,8 @@
 
         function _isRCurLanguage () {
             var view = ko.views.manager.currentView;
-            if (!view || !view.document) return(false);
-            return(view.document.language == "R");
+            if (!view || !view.koDoc) return(false); // Was view.document in pre-Ko7
+            return(view.koDoc.language == "R"); // Was view.document in pre-Ko7
         }
 
         function _hasSelection () {

Modified: komodo/SciViews-K/content/js/r.js
===================================================================
--- komodo/SciViews-K/content/js/r.js	2013-10-10 14:45:37 UTC (rev 532)
+++ komodo/SciViews-K/content/js/r.js	2013-10-29 11:20:40 UTC (rev 533)
@@ -470,7 +470,7 @@
 		if (!view) return(false); // No current view, do nothing!
 		view.setFocus();
 		var scimoz = view.scimoz;
-		var doc = view.document;
+		var doc = view.koDoc; // Was document in pre-Ko7
 
 		var file;
 // FIXME: (sometimes?) doc is not defined in ko7!

Modified: komodo/SciViews-K/content/js/sciviews.js
===================================================================
--- komodo/SciViews-K/content/js/sciviews.js	2013-10-10 14:45:37 UTC (rev 532)
+++ komodo/SciViews-K/content/js/sciviews.js	2013-10-29 11:20:40 UTC (rev 533)
@@ -848,13 +848,13 @@
 
 sv.reworkUI = function (level /*= sciviews.uilevel pref*/) {
 	// Don't use with Komodo < 6 (ko.toolbox2 is not defined there)
-	if ((ko.toolbox2 === undefined)) {
+	if (!(ko.toolbox2 === undefined)) {
 		try {
 			sv.toggleById("r_uilevel", true);
 			// The toolbar is wrong because it is a toolbar in Komodo 5,
 			// but a toolbaritem in Komodo 6... Fix this now!
-			var Rtoolbaritem = document.getElementById("RToolbar");
-			var Rtoolbar = document.createElement("toolbar");
+			var Rtoolbaritem = document.getElementById("RToolbar");			
+			var Rtoolbar = document.createElement("toolbar")
 			Rtoolbar.setAttribute("class", "chromeclass-toolbar");
 			Rtoolbaritem.setAttribute("id", "OldRToolbar");
 			Rtoolbar.setAttribute("id", "RToolbar");
@@ -866,14 +866,25 @@
 			Rtoolbar.setAttribute("tooltiptext", "R Toolbar");
 			Rtoolbar.setAttribute("mode", "icons");
 			Rtoolbar.setAttribute("insertbefore", "toolsToolbar");
+			
+			// In Ko8, there is now a toolbaritem level
+			RtoolbarWrapper = document.createElement("toolbaritem");
+			Rtoolbar.appendChild(RtoolbarWrapper);
+			
 			var tb = Rtoolbaritem.firstChild;
+			tb.setAttribute("class", tb.getAttribute("class") + " first-child");
+			RtoolbarWrapper.appendChild(tb);
+			tb = Rtoolbaritem.firstChild;
 			while (tb) {
-				Rtoolbar.appendChild(tb);
+				RtoolbarWrapper.appendChild(tb);
 				tb = Rtoolbaritem.firstChild;
 			}
+			RtoolbarWrapper.lastChild.setAttribute("class",
+				RtoolbarWrapper.lastChild.getAttribute("class") + " last-child");
+			RtoolbarWrapper.setAttribute("class", "has-children");
 			Rtoolbaritem.parentNode.replaceChild(Rtoolbar, Rtoolbaritem);
-		} catch (e) { }
-		return;
+		} catch (e) {  }
+		//return;
 	}
 	
 	// Retrieve or ask the desired uilevel

Modified: komodo/SciViews-K/content/overlayMain-ko6.xul
===================================================================
--- komodo/SciViews-K/content/overlayMain-ko6.xul	2013-10-10 14:45:37 UTC (rev 532)
+++ komodo/SciViews-K/content/overlayMain-ko6.xul	2013-10-29 11:20:40 UTC (rev 533)
@@ -470,7 +470,7 @@
 				class="stop-icon"
 				observes="cmd_svREscape"
 				label="&rEscape;" />
-			 <toolbarseparator/>
+			<!-- <toolbarseparator/> -->
 			 <toolbarbutton buttonstyle="pictures"
 				id="r_load_df_tool"
 				tooltiptext="&rLoadDF;"
@@ -492,7 +492,7 @@
 				class="r-active-lm-icon"
 				observes="cmd_svRActiveLM"
 				label="&rActiveLM;" />
-			 <toolbarseparator/>
+			<!-- <toolbarseparator/> -->
 			 <toolbarbutton buttonstyle="pictures"
 				id="r_help_context_tool"
 				tooltiptext="&rHelpContext;"

Modified: komodo/SciViews-K/content/overlayMain.xul
===================================================================
--- komodo/SciViews-K/content/overlayMain.xul	2013-10-10 14:45:37 UTC (rev 532)
+++ komodo/SciViews-K/content/overlayMain.xul	2013-10-29 11:20:40 UTC (rev 533)
@@ -475,7 +475,7 @@
 				class="stop-icon"
 				observes="cmd_svREscape"
 				label="&rEscape;" />
-			 <toolbarseparator/>
+			<!-- <toolbarseparator/> -->
 			 <toolbarbutton buttonstyle="pictures"
 				id="r_load_df_tool"
 				tooltiptext="&rLoadDF;"
@@ -497,7 +497,7 @@
 				class="r-active-lm-icon"
 				observes="cmd_svRActiveLM"
 				label="&rActiveLM;" />
-			 <toolbarseparator/>
+			<!-- <toolbarseparator/> -->
 			 <toolbarbutton buttonstyle="pictures"
 				id="r_help_context_tool"
 				tooltiptext="&rHelpContext;"

Modified: komodo/SciViews-K/install.rdf
===================================================================
--- komodo/SciViews-K/install.rdf	2013-10-10 14:45:37 UTC (rev 532)
+++ komodo/SciViews-K/install.rdf	2013-10-29 11:20:40 UTC (rev 533)
@@ -5,7 +5,7 @@
         <em:unpack>true</em:unpack>
         <em:id>sciviewsk at sciviews.org</em:id>
         <em:name>SciViews-K</em:name>
-        <em:version>0.9.32</em:version>
+        <em:version>0.9.33</em:version>
         <em:description>Edit R code with Komodo</em:description>
         <em:creator>Philippe Grosjean</em:creator>
         <em:contributor>Romain Francois</em:contributor>

Modified: pkg/svDoc/R/asciidoc.R
===================================================================
--- pkg/svDoc/R/asciidoc.R	2013-10-10 14:45:37 UTC (rev 532)
+++ pkg/svDoc/R/asciidoc.R	2013-10-29 11:20:40 UTC (rev 533)
@@ -25,7 +25,7 @@
 	Rscript <- readLines(svDocFile, encoding = encoding)
 	l <- length(Rscript)
 	
-	## Detect doc chunks (start with !!", and end with !<<...>>=")
+	## Detect doc chunks (start with !!", and end with <<...>>=")
 	start <- grepl('^!!"[ \t]*$', Rscript)
 	end <- grepl('^<<.*>>="[ \t]*$', Rscript)
 	## Must have at least one doc chunk and same number of starts and ends



More information about the Sciviews-commits mailing list