[Sciviews-commits] r184 - in komodo/SciViews-K/content: . js js/tools
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Thu Sep 10 11:37:37 CEST 2009
Author: prezez
Date: 2009-09-10 11:37:32 +0200 (Thu, 10 Sep 2009)
New Revision: 184
Removed:
komodo/SciViews-K/content/overlay.xul
Modified:
komodo/SciViews-K/content/js/misc.js
komodo/SciViews-K/content/js/sciviews.js
komodo/SciViews-K/content/js/tools/io.js
komodo/SciViews-K/content/overlayMain.xul
Log:
modified "sv.io.makePath" to be more flexible (eg. "~" expansion).
"sv.prefs.setSession" changed accordingly.
deleted "overlay.xul" - not used anymore.
Modified: komodo/SciViews-K/content/js/misc.js
===================================================================
--- komodo/SciViews-K/content/js/misc.js 2009-09-06 23:51:23 UTC (rev 183)
+++ komodo/SciViews-K/content/js/misc.js 2009-09-10 09:37:32 UTC (rev 184)
@@ -19,7 +19,7 @@
// Define the 'sv.misc' namespace
if (typeof(sv.misc) == 'undefined')
sv.misc = {};
-
+
// Close all buffers except current one (an start page)
sv.misc.closeAllOthers = function () {
try {
@@ -146,7 +146,7 @@
// Check if we are not at the last line
if( currentLine < (ke.lineCount - 1)) {
ke.lineDown();
- ke.lineTranspose();
+ ke.lineTranspose();
}
}
}
@@ -157,7 +157,7 @@
if (currentView) {
currentView.scintilla.focus();
var ke = currentView.scimoz;
- var currentLine = ke.lineFromPosition(ke.currentPos);
+ var currentLine = ke.lineFromPosition(ke.currentPos);
// Check if we are not at the first line
if (currentLine > 0) {
ke.lineTranspose();
@@ -177,7 +177,7 @@
// use last pattern used
searchText = ko.mru.get("find-patternMru");
}
-
+
// Search with last user find preferences
var findSvc = Components.classes["@activestate.com/koFindService;1"]
.getService(Components.interfaces.koIFindService);
@@ -205,11 +205,11 @@
currentView.scintilla.focus();
var scimoz = currentView.scimoz;
scimoz.beginUndoAction();
-
+
// Retain these so we can reset the selection after the replacement
var curAnchor = scimoz.anchor;
var curPos = scimoz.currentPos;
-
+
// Replace the currently selected text
scimoz.replaceSel(
// Find all single and double quote characters
@@ -218,7 +218,7 @@
return value == '"'?"'":'"';
})
);
-
+
// Reset the selection
scimoz.setSel(curAnchor, curPos);
}
@@ -267,15 +267,7 @@
}
// Delete current line
+// not really necessary. to be removed??
sv.misc.delLine = function () {
- try {
- ko.views.manager.currentView.setFocus();
- var scimoz = ko.views.manager.currentView.scimoz;
- scimoz.home();
- scimoz.delLineRight();
- scimoz.deleteBack();
- scimoz.charRight();
- } catch(e) {
- sv.log.exception(e, "sv.misc.delLine() error");
- }
-}
\ No newline at end of file
+ ko.commands.doCommand('cmd_lineDelete');
+}
Modified: komodo/SciViews-K/content/js/sciviews.js
===================================================================
--- komodo/SciViews-K/content/js/sciviews.js 2009-09-06 23:51:23 UTC (rev 183)
+++ komodo/SciViews-K/content/js/sciviews.js 2009-09-10 09:37:32 UTC (rev 184)
@@ -444,6 +444,8 @@
return(false);
}
+
+//is this still necessarry?
// Get contextual help for a word in the buffer, or for snippets
sv.helpContext = function () {
try {
@@ -599,16 +601,16 @@
// Set defaults for saveOld and loadNew
if (typeof(saveOld) == "undefined") saveOld = true;
if (typeof(loadNew) == "undefined") loadNew = true;
-
+
// cmd is the command executed in R to switch session (done asynchronously)
var cmd = "";
-
+
// If dir is the same as current session dir, do nothing
if (typeof(dir) != "undefined" &
dir == sv.prefs.getString("sciviews.session.dir", "")) {
return(false);
}
-
+
// Before switching to the new session directory, close current one
// if R is running
if (saveOld) {
@@ -617,13 +619,13 @@
cmd = 'assignTemp(".required", .required)\nTempEnv()$.Last.sys()\n' +
'save.image()\nsavehistory()\nrm(list = ls())\n' +
'.required <- getTemp(".required")\n.SciViewsReady <- TRUE\n';
-
+
} else {
// Clear workspace (hint, we don't clear hidden objects!)
cmd = 'rm(list = ls())\n'
}
// TODO: possibly close the associated Komodo project
-
+
// Initialize the various arguments
if (typeof(dir) == "undefined")
dir = sv.prefs.getString("sciviews.session.dir", "~");
@@ -634,42 +636,11 @@
if (typeof(reportdir) == "undefined")
reportdir = sv.prefs.getString("sciviews.session.reports", "");
- var os = Components.classes['@activestate.com/koOs;1'].
- getService(Components.interfaces.koIOs);
- var ossep = os.sep;
-
- var localdir = dir;
- // If dir starts with ~, get what's considered as '~' by R:
- // '~' in Linux/Mac, but '~\My Documents' in Windows
- if (dir.substring(0, 1) == "~") {
- if (ossep == "/") {
- // This is Linux or Mac OS X
- // Instead of using '~', we get the actual home directory
- var home = Components.
- classes["@mozilla.org/file/directory_service;1"].
- getService(Components.interfaces.nsIProperties).
- get("Home", Components.interfaces.nsIFile).path;
- } else {
- // This is probably Windows
- ossep = "\\";
- // This is the way we got "My Documents" under Windows
- var wrk = Components.classes["@mozilla.org/windows-registry-key;1"]
- .createInstance(Components.interfaces.nsIWindowsRegKey);
- wrk.open(wrk.ROOT_KEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft",
- wrk.ACCESS_READ);
- var subkey = wrk.
- openChild("Windows\\CurrentVersion\\Explorer\\Shell Folders",
- wrk.ACCESS_READ);
- var key = subkey.readStringValue("Personal");
- subkey.close();
- wrk.close();
- // Possibly eliminate trailing backslash
- var home = key.replace(/\\$/, "");
- }
- // Construct localdir using home found here
- localdir = home + dir.substring(1);
- }
+ var localdir = sv.io.makePath(dir);
+ // do we need all the "sciviews.*.localdir" preferences then??
+ var sep = "/";
+
// Refresh preferences
sv.prefs.setString("sciviews.session.dir", dir, true);
sv.prefs.setString("sciviews.session.localdir", localdir, true);
@@ -682,58 +653,48 @@
sv.prefs.setString("sciviews.data.dir", dir, true);
sv.prefs.setString("sciviews.data.localdir", localdir, true);
} else {
- sv.prefs.setString("sciviews.data.dir", dir + "/" + datadir, true);
+ sv.prefs.setString("sciviews.data.dir", dir + sep + datadir, true);
sv.prefs.setString("sciviews.data.localdir",
- localdir + ossep + datadir, true);
+ sv.io.makePath(localdir, datadir), true);
}
if (scriptdir == "") {
sv.prefs.setString("sciviews.scripts.dir", dir, true);
sv.prefs.setString("sciviews.scripts.localdir", localdir, true);
} else {
- sv.prefs.setString("sciviews.scripts.dir", dir + "/" + scriptdir, true);
+ sv.prefs.setString("sciviews.scripts.dir", dir + sep + scriptdir, true);
sv.prefs.setString("sciviews.scripts.localdir",
- localdir + ossep + scriptdir, true);
+ sv.io.makePath(localdir, scriptdir), true);
}
if (reportdir == "") {
sv.prefs.setString("sciviews.reports.dir", dir, true);
sv.prefs.setString("sciviews.reports.localdir", localdir, true);
} else {
- sv.prefs.setString("sciviews.reports.dir", dir + "/" + reportdir, true);
+ sv.prefs.setString("sciviews.reports.dir", dir + sep + reportdir, true);
sv.prefs.setString("sciviews.reports.localdir",
- localdir + ossep + reportdir, true);
+ sv.io.makePath(localdir, reportdir), true);
}
+ var DIRECTORY_TYPE = Components.interfaces.nsIFile.DIRECTORY_TYPE;
+
// Look if the session directory exists, or create it
- var file = Components.classes["@mozilla.org/file/local;1"]
- .createInstance(Components.interfaces.nsILocalFile);
- file.initWithPath(localdir);
- if (file.exists() == false) {
+ var file = sv.io.file(localdir);
+ // file = sv.io.file(sv.io.makePath(dir);
+
+ if (!file.exists() || !file.isDirectory()) {
sv.log.debug( "Creating session directory... " );
- file.create(Components.interfaces.nsIFile.DIRECTORY_TYPE, 511);
+ file.create(DIRECTORY_TYPE, 511);
}
// ... also make sure that /Data, /Script and /Report subdirs exist
- if (datadir != "") {
- file.initWithPath(localdir + ossep + datadir);
- if (file.exists() == false) {
- file.create(Components.interfaces.nsIFile.DIRECTORY_TYPE, 511);
- }
+ for (var i in [datadir, scriptdir, reportdir]) {
+ var file = sv.io.file(dir, datadir);
+ if (!file.exists() || !file.isDirectory())
+ file.create(DIRECTORY_TYPE, 511);
+ delete file;
}
- if (scriptdir != "") {
- file.initWithPath(localdir + ossep + scriptdir);
- if (file.exists() == false) {
- file.create(Components.interfaces.nsIFile.DIRECTORY_TYPE, 511);
- }
- }
- if (reportdir != "") {
- file.initWithPath(localdir + ossep + reportdir);
- if (file.exists() == false) {
- file.create(Components.interfaces.nsIFile.DIRECTORY_TYPE, 511);
- }
- }
// Switch to the new session directory in R
cmd = cmd + 'setwd("' + dir + '")\noptions(R.initdir = "' + dir + '")\n';
-
+
// Do we load .RData and .Rhistory?
if (loadNew) {
cmd = cmd + 'if (file.exists(".RData")) load(".RData")\n' +
@@ -843,7 +804,7 @@
}
sv.log.exception = function (e, msg, showMsg) {
- if (typeof(showMsg) != 'undefined' & showMsg == true) {
+ if (typeof(showMsg) != 'undefined' && showMsg == true) {
sv.alert("Error", msg);
}
this.logger.exception(e, msg);
@@ -874,11 +835,7 @@
}
sv.log.all = function (debug) {
- if (typeof(debug) == "undefined" || debug == false) {
- this.logger.setLevel(false);
- } else {
- this.logger.setLevel(true);
- }
+ this.logger.setLevel(debug);
}
sv.log.isAll = function () {
@@ -886,11 +843,8 @@
}
sv.log.show = function () {
- var os = Components.classes['@activestate.com/koOs;1'].
- getService(Components.interfaces.koIOs);
try {
- var appdir = ko.interpolate.interpolateStrings('%(path:hostUserDataDir)');
- var logFile = os.path.join(appdir, 'pystderr.log');
+ var logFile = sv.io.makePath("ProfD", ["..", "pystderr.log"]);
var winOpts = "centerscreen,chrome,resizable,scrollbars,dialog=no,close";
window.openDialog('chrome://komodo/content/tail/tail.xul',"_blank",
winOpts,logFile);
Modified: komodo/SciViews-K/content/js/tools/io.js
===================================================================
--- komodo/SciViews-K/content/js/tools/io.js 2009-09-06 23:51:23 UTC (rev 183)
+++ komodo/SciViews-K/content/js/tools/io.js 2009-09-10 09:37:32 UTC (rev 184)
@@ -13,169 +13,200 @@
//sv.io.tempFile(prefix); // creates unique temporary file,
// accessible by all users, and returns
// its name
-//sv.io.makePath([specialDir], [pathComponents]); // create path from array,
+//sv.io.makePath(baseDir, ...); // create path from array,
// and/or special directory name
+//sv.io.file(baseDir, [pathComponents]); // create nsILocalFile object from array,
+ // and/or special directory name
// sv.io.readURI(uri); // Read data from an URI
////////////////////////////////////////////////////////////////////////////////
+// TODO: this are not only i/o functions anymore, rename to something like
+// sv.fileUtils ...
+
+
// Define the 'sv.io' namespace
-if (typeof(sv.io) == 'undefined') sv.io = new Object();
+if (typeof(sv.io) == 'undefined')
+ sv.io = {};
-sv.io.defaultEncoding = "latin1";
+(function() {
+ this.defaultEncoding = "latin1";
-sv.io.readfile = function (filename, encoding) {
- if (!encoding)
- encoding = sv.io.defaultEncoding;
+ this.readfile = function (filename, encoding) {
+ if (!encoding)
+ encoding = this.defaultEncoding;
- var file = Components.classes["@mozilla.org/file/local;1"]
- .createInstance(Components.interfaces.nsILocalFile);
- var fis = Components.classes["@mozilla.org/network/file-input-stream;1"]
- .createInstance(Components.interfaces.nsIFileInputStream);
- var is = Components.classes["@mozilla.org/intl/converter-input-stream;1"]
- .createInstance(Components.interfaces.nsIConverterInputStream);
+ var file = Components.classes["@mozilla.org/file/local;1"]
+ .createInstance(Components.interfaces.nsILocalFile);
+ var fis = Components.classes["@mozilla.org/network/file-input-stream;1"]
+ .createInstance(Components.interfaces.nsIFileInputStream);
+ var is = Components.classes["@mozilla.org/intl/converter-input-stream;1"]
+ .createInstance(Components.interfaces.nsIConverterInputStream);
- try {
- file.initWithPath(filename);
- fis.init(file, -1, -1, 0);
- is.init(fis, encoding, 1024, 0xFFFD);
+ try {
+ file.initWithPath(filename);
+ fis.init(file, -1, -1, 0);
+ is.init(fis, encoding, 1024, 0xFFFD);
- ret = "";
- if (is instanceof Components.interfaces.nsIUnicharLineInputStream) {
- var str = {};
- var cont;
- do {
- cont = is.readString(4096, str);
- ret += str.value;
- } while (cont);
+ ret = "";
+ if (is instanceof Components.interfaces.nsIUnicharLineInputStream) {
+ var str = {};
+ var cont;
+ do {
+ cont = is.readString(4096, str);
+ ret += str.value;
+ } while (cont);
+ }
+ } catch (e) {
+ sv.log.exception(e, "Error while trying to read in " + filename +
+ " (sv.io.readfile)", true);
}
- } catch (e) {
- sv.log.exception(e, "Error while trying to read in " + filename +
- " (sv.io.readfile)", true);
+ finally {
+ is.close();
+ fis.close();
+ }
+ return ret;
}
- finally {
- is.close();
- fis.close();
- }
- return ret;
-}
-sv.io.writefile = function (filename, content, encoding, append) {
- if (!encoding)
- encoding = sv.io.defaultEncoding;
+ this.writefile = function (filename, content, encoding, append) {
+ if (!encoding)
+ encoding = this.defaultEncoding;
- append = append? 0x10 : 0x20;
+ append = append? 0x10 : 0x20;
- var file = Components.classes["@mozilla.org/file/local;1"]
- .createInstance(Components.interfaces.nsILocalFile);
- var fos = Components.classes["@mozilla.org/network/file-output-stream;1"]
- .createInstance(Components.interfaces.nsIFileOutputStream);
- var os = Components.classes["@mozilla.org/intl/converter-output-stream;1"]
- .createInstance(Components.interfaces.nsIConverterOutputStream);
+ var file = Components.classes["@mozilla.org/file/local;1"]
+ .createInstance(Components.interfaces.nsILocalFile);
+ var fos = Components.classes["@mozilla.org/network/file-output-stream;1"]
+ .createInstance(Components.interfaces.nsIFileOutputStream);
+ var os = Components.classes["@mozilla.org/intl/converter-output-stream;1"]
+ .createInstance(Components.interfaces.nsIConverterOutputStream);
- //PR_CREATE_FILE = 0x08
- //PR_WRONLY = 0x02
- //PR_APPEND = 0x10
- //PR_TRUNCATE = 0x20
+ //PR_CREATE_FILE = 0x08
+ //PR_WRONLY = 0x02
+ //PR_APPEND = 0x10
+ //PR_TRUNCATE = 0x20
- try {
- file.initWithPath(filename);
- fos.init(file, 0x08 | 0x02 | append, -1, 0);
- os.init(fos, encoding, 0, 0x0000);
- os.writeString(content);
- } catch (e) {
- sv.log.exception(e, "Error while trying to write in " + filename +
- " (sv.io.writefile)", true)
+ try {
+ file.initWithPath(filename);
+ fos.init(file, 0x08 | 0x02 | append, -1, 0);
+ os.init(fos, encoding, 0, 0x0000);
+ os.writeString(content);
+ } catch (e) {
+ sv.log.exception(e, "Error while trying to write in " + filename +
+ " (sv.io.writefile)", true)
+ }
+ finally {
+ os.close();
+ }
}
- finally {
- os.close();
- }
-}
-sv.io.fileExists = function (path) {
- var file = Components.classes["@mozilla.org/file/local;1"].
- createInstance(Components.interfaces.nsILocalFile);
+ this.fileExists = function (path) {
+ var file = Components.classes["@mozilla.org/file/local;1"].
+ createInstance(Components.interfaces.nsILocalFile);
- try {
- file.initWithPath(path);
- } catch(e) {
+ try {
+ file.initWithPath(path);
+ } catch(e) {
+ return 0;
+ }
+
+ if (file.exists()) {
+ if (file.isDirectory())
+ return 2;
+ else if (file.isFile())
+ return 1;
+ }
return 0;
}
- if (file.exists()) {
- if (file.isDirectory())
- return 2;
- else if (file.isFile())
- return 1;
- }
- return 0;
-}
+ this.tempFile = function (prefix) {
+ var nsIFile = Components.interfaces.nsIFile;
+ var dirSvc = Components.classes["@mozilla.org/file/directory_service;1"].
+ getService(Components.interfaces.nsIProperties);
+ var tempDir = dirSvc.get("TmpD", nsIFile).path;
+ var tmpfile = Components.classes["@mozilla.org/file/local;1"].
+ createInstance(Components.interfaces.nsILocalFile);
-sv.io.tempFile = function (prefix) {
- var nsIFile = Components.interfaces.nsIFile;
- var dirSvc = Components.classes["@mozilla.org/file/directory_service;1"].
- getService(Components.interfaces.nsIProperties);
- var tempDir = dirSvc.get("TmpD", nsIFile).path;
- var tmpfile = Components.classes["@mozilla.org/file/local;1"].
- createInstance(Components.interfaces.nsILocalFile);
+ if (!prefix)
+ prefix = "svtmp";
- if (!prefix)
- prefix = "svtmp";
+ tmpfile.initWithPath(tempDir);
+ tmpfile.append(prefix)
+ tmpfile.createUnique(nsIFile.NORMAL_FILE_TYPE, 0777);
- tmpfile.initWithPath(tempDir);
- tmpfile.append(prefix)
- tmpfile.createUnique(nsIFile.NORMAL_FILE_TYPE, 0777);
+ return tmpfile.path;
+ }
- return tmpfile.path;
-}
-
-//specialDir - [optional] name for special directory, see special directory
-// reference at https://developer.mozilla.org/En/Code_snippets:File_I/O
-// eg. ProfD, TmpD, Home, Desk, Progs
-// pathComponents - [optional] array of directiory/file names to append
-sv.io.makePath = function (specialDir, pathComponents) {
- var file;
- if (specialDir) {
- file = Components.classes["@mozilla.org/file/directory_service;1"].
- getService(Components.interfaces.nsIProperties).
- get(specialDir, Components.interfaces.nsIFile);
- } else {
- file = Components.classes["@mozilla.org/file/local;1"].
- createInstance(Components.interfaces.nsILocalFile);
- try {
- if (pathComponents) {
- file.initWithPath(pathComponents[0]);
- pathComponents.shift();
+ this.file = function (baseDir, pathComponents) {
+ var file, baseFile;
+ if (baseDir) {
+ try {
+ file = Components.classes["@mozilla.org/file/directory_service;1"].
+ getService(Components.interfaces.nsIProperties).
+ get(baseDir, Components.interfaces.nsILocalFile);
+ } catch(e) {
+ file = Components.classes["@mozilla.org/file/local;1"].
+ createInstance(Components.interfaces.nsILocalFile);
+ try {
+ file.initWithPath(baseDir);
+ } catch (e) {
+ return null;
+ }
}
- } catch (e) {}
+ }
+ if (pathComponents && pathComponents.length) {
+ for (i in pathComponents) {
+ if (pathComponents[i] == "..")
+ file.initWithFile(file.parent);
+ else if (pathComponents[i] != ".")
+ file.appendRelativePath(pathComponents[i]);
+ }
+ }
+ return file;
}
- if (pathComponents && pathComponents.length) {
- for (i in pathComponents)
- file.append(pathComponents[i]);
- }
- return file.path;
-}
-sv.io.readURI = function (uri) {
- var fileSvc = Components.classes["@activestate.com/koFileService;1"]
- .getService(Components.interfaces.koIFileService);
- var file = fileSvc.getFileFromURI(uri);
- file.open(0);
- var res = file.readfile();
- file.close();
- return res;
-}
+ // concatenates ist arguments into a file path.
+ // baseDir - can be a name for special directory, see special directory
+ // reference at https://developer.mozilla.org/En/Code_snippets:File_I/O
+ // eg. "ProfD", "TmpD", "Home", "Pers", "Desk", "Progs"
+ // or
+ // leading "~" is expanded to a real path
+ // following arguments can be specified as single array or string
+ // example: sv.io.makePath("~/workspace/dir1", "dir2", "file1.tmp")
+ // would produce something like that:
+ // "c:\users\bob\MyDocuments\workspace\dir1\dir2\file1.tmp"
+ // "/home/bob/workspace/dir1/dir2/file1.tmp"
+ this.makePath = function (baseDir, pathComponents) {
+ if (!baseDir)
+ return null;
+ if (!pathComponents)
+ pathComponents = [];
+ else if (typeof pathComponents == "string") {
+ var pc = [];
+ for (var i = 1; i < arguments.length; i++)
+ if (typeof arguments[i] != "undefined")
+ pc.push(arguments[i]);
+ pathComponents = pc;
+ }
-/*
-Stuff:
+ var pathSep = Components.classes['@activestate.com/koOs;1'].
+ getService(Components.interfaces.koIOs).sep;
-var nsIFile = Components.interfaces.nsIFile;
-var dirSvc = Components.classes["@mozilla.org/file/directory_service;1"].
- getService(Components.interfaces.nsIProperties);
+ baseDir = baseDir.replace(/[\\/]+/g, pathSep);
+ if (baseDir[0] == "~") {
+ pathComponents.unshift(baseDir.replace(/^~[\\/]*/, ""));
+ baseDir = (navigator.platform.indexOf("Win") == 0)? "Pers" : "Home";
+ }
+ return this.file(baseDir, pathComponents).path;
+ }
-var file = Components.classes["@mozilla.org/file/local;1"].
- createInstance(Components.interfaces.nsILocalFile);
+ this.readURI = function (uri) {
+ var fileSvc = Components.classes["@activestate.com/koFileService;1"]
+ .getService(Components.interfaces.koIFileService);
+ var file = fileSvc.getFileFromURI(uri);
+ file.open(0);
+ var res = file.readfile();
+ file.close();
+ return res;
+ }
-// profile directory:
-var profileDir = dirSvc.get("ProfD", nsIFile );
-//C:\Documents and Settings\kamil\Dane aplikacji\ActiveState\KomodoEdit\5.0\host-DeepThought\XRE
-*/
+}).apply(sv.io);
Deleted: komodo/SciViews-K/content/overlay.xul
===================================================================
--- komodo/SciViews-K/content/overlay.xul 2009-09-06 23:51:23 UTC (rev 183)
+++ komodo/SciViews-K/content/overlay.xul 2009-09-10 09:37:32 UTC (rev 184)
@@ -1,376 +0,0 @@
-<?xml version="1.0"?>
-<!-- ***** BEGIN LICENSE BLOCK *****
- Version: MPL 1.1/GPL 2.0/LGPL 2.1
-
- The contents of this file are subject to the Mozilla Public License
- Version 1.1 (the "License"); you may not use this file except in
- compliance with the License. You may obtain a copy of the License at
- http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
- License for the specific language governing rights and limitations
- under the License.
-
- The Original Code is SciViews-K by Philippe Grosjean & Romain Francois.
-
- Portions created by ActiveState Software Inc are Copyright (C) 2000-2008
- ActiveState Software Inc. All Rights Reserved.
-
- Contributor(s):
- Philippe Grosjean
- Romain Francois
- Kamil Barton
- ActiveState Software Inc
-
- Alternatively, the contents of this file may be used under the terms of
- either the GNU General Public License Version 2 or later (the "GPL"), or
- the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- in which case the provisions of the GPL or the LGPL are applicable instead
- of those above. If you wish to allow use of your version of this file only
- under the terms of either the GPL or the LGPL, and not to allow others to
- use your version of this file under the terms of the MPL, indicate your
- decision by deleting the provisions above and replace them with the notice
- and other provisions required by the GPL or the LGPL. If you do not delete
- the provisions above, a recipient may use your version of this file under
- the terms of any one of the MPL, the GPL or the LGPL.
-
- ***** END LICENSE BLOCK ***** -->
-<!DOCTYPE overlay PUBLIC "-//MOZILLA//DTD XUL V1.0//EN" "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" [
- <!ENTITY % sciviewskDTD SYSTEM "chrome://sciviewsk/locale/sciviewsk.dtd">
- %sciviewskDTD;
-]>
-
-<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
-<?xml-stylesheet href="chrome://komodo/skin/global/global.p.css" type="text/css"?>
-<?xml-stylesheet href="chrome://komodo/skin/bindings/buttons.css" type="text/css"?>
-<?xml-stylesheet href="chrome://sciviewsk/skin/sciviewsk.css" type="text/css"?>
-
-<overlay id="sciviewskOverlay"
- xmlns:html="http://www.w3.org/1999/xhtml"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/x-javascript" src="chrome://sciviewsk/content/js/sciviews.js"/>
- <script type="application/x-javascript" src="chrome://sciviewsk/content/js/prefs.js"/>
- <script type="application/x-javascript" src="chrome://sciviewsk/content/js/tools/strings.js"/>
- <!--No longer needed for robjects.js <script type="application/x-javascript" src="chrome://sciviewsk/content/js/tools/e4x2dom.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/io.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"/>
- <script type="application/x-javascript" src="chrome://sciviewsk/content/js/robjects.js"/>
-
-
-<popupset id="extensionPopupSet">
- <menupopup id="rObjectsContext"
- onpopupshowing="rObjectsTree.contextOnShow();">
- <menuitem class="primary_menu_item"
- id="menu_robjects_cmd_insertname"
- command="robjects_cmd_insertname"
- acceltext="Ins" />
- <menuitem
- id="menu_robjects_cmd_insertfullname"
- command="robjects_cmd_insertfullname"
- acceltext="Ctrl+Ins" />
- <menuitem id="menu_robjects_cmd_removeobj"
- command="robjects_cmd_removeobj"
- key="key_cmd_delete"
- class="menuitem-iconic list-item-remove-icon"
- acceltext="Del" />
- <menuitem id="menu_robjects_cmd_attach" command="robjects_cmd_attach" />
- <menuitem id="menu_robjects_cmd_detach" command="robjects_cmd_detach" />
- <menuseparator keep="false" intoplevel="true" />
- <menuitem id="menu_robjects_cmd_print" command="robjects_cmd_print" />
- <menuitem id="menu_robjects_cmd_plot" command="robjects_cmd_plot" />
- <menuitem id="menu_robjects_cmd_summary" command="robjects_cmd_summary" />
- <menuitem id="menu_robjects_cmd_str" command="robjects_cmd_str" />
- <menuitem id="menu_robjects_cmd_args" command="robjects_cmd_args" />
- <menuitem id="menu_robjects_cmd_names" command="robjects_cmd_names" />
- <menuseparator keep="false" intoplevel="true" />
- <menuitem id="menu_robjects_cmd_help" command="robjects_cmd_help" />
- </menupopup>
-</popupset>
-
-
- <commandset id="allcommands">
- <broadcasterset id="broadcasterset_global">
- <broadcaster
- id="cmd_robjects_viewSearchPath"
- desc="&sciviews.robjects.tab;: &sciviews.robjects.showHide;"
- label="&sciviews.robjects.showHide;"
- splitter="bottom_splitter"
- box="robjects_searchpath_panel"
- oncommand="rObjectsTree.toggleViewSearchPath(event);"
- checked="true"
- state="open"
- />
- </broadcasterset>
- <command id="Tasks:svAbout" oncommand="alert('SciViews-K (Komodo R Editor) version ' + sv.version + '\na Komodo extension to interact with R\n(see http://www.sciviews.org/SciViews-K)');"/>
-
- <broadcasterset id="broadcasterset_global">
- <broadcaster id="cmd_sv_RRunAll" key="keycmd_sv_RRunAll" keycode="VK_F5" modifiers="" oncommand="sv.r.send("all");" desc="R: Send file content" />
- <broadcaster id="cmd_sv_RSourceAll" key="keycmd_sv_RSourceAll" modifiers="shift" keycode="VK_F5" oncommand="sv.r.source("all");" desc="R: Source file" />
- <broadcaster id="cmd_sv_RRunBlock" key="keycmd_sv_RRunBlock" oncommand="sv.r.send("block");" desc="R: Send marked block" />
- <broadcaster id="cmd_sv_RRunFunction" key="keycmd_sv_RRunFunction" oncommand="sv.r.send("function");" desc="R: Send function under cursor" />
- <broadcaster id="cmd_sv_RRunLine" key="keycmd_sv_RRunLine" oncommand="sv.r.send("line");" desc="R: Send active line" />
- <broadcaster id="cmd_sv_RRunPara" key="keycmd_sv_RRunPara" oncommand="sv.r.send("para");" desc="R: Send current paragraph" />
- <broadcaster id="cmd_sv_RRunSelection" key="keycmd_sv_RRunSelection" oncommand="sv.r.send("sel");" desc="R: Send selection" />
- <broadcaster id="cmd_sv_RSourceBlock" key="keycmd_sv_RSourceBlock" oncommand="sv.r.source("block");" desc="R: Source marked block" />
- <broadcaster id="cmd_sv_RSourceFunction" key="keycmd_sv_RSourceFunction" oncommand="sv.r.source("function");" desc="R: Source function under cursor" />
- <broadcaster id="cmd_sv_RSourcePara" key="keycmd_sv_RSourcePara" oncommand="sv.r.source("para");" desc="R: Source current paragraph" />
- <broadcaster id="cmd_sv_RSourceSelection" key="keycmd_sv_RSourceSelection" oncommand="sv.r.source("sel");" desc="R: Source selection" />
- </broadcasterset>
-
- <commandset id="r-objects-commands">
- <command id="robjects_cmd_insertname"
- label="&sciviews.robjects.insName;"
- accesskey="I"
- oncommand="rObjectsTree.insertName(false);" />
- <command id="robjects_cmd_insertfullname"
- label="&sciviews.robjects.insFullName;"
- accesskey="F"
- oncommand="rObjectsTree.insertName(true);" />
- <command id="robjects_cmd_removeobj"
- label="&sciviews.robjects.rmObj;"
- accesskey="R"
- oncommand="rObjectsTree.removeSelected(event.shiftKey);" />
- <command id="robjects_cmd_attach"
- label="&sciviews.robjects.loadPkg;"
- accesskey="L"
- disabled="true"
- oncommand="rObjectsTree.do('library');" />
- <command id="robjects_cmd_summary"
- label="&sciviews.robjects.summary;"
- accesskey="S"
- oncommand="rObjectsTree.do('summary');" />
- <command id="robjects_cmd_print"
- label="&sciviews.robjects.print;"
- accesskey="P"
- oncommand="rObjectsTree.do('print');" />
- <command id="robjects_cmd_plot"
- label="&sciviews.robjects.plot;"
- accesskey="O"
- oncommand="rObjectsTree.do('plot');" />
- <command id="robjects_cmd_str"
- label="&sciviews.robjects.str;"
- accesskey="T"
- oncommand="rObjectsTree.do('str');" />
- <command id="robjects_cmd_names"
- label="&sciviews.robjects.names;"
- accesskey="N"
- oncommand="rObjectsTree.do('names');" />
- <command id="robjects_cmd_help"
- label="&sciviews.robjects.help;"
- accesskey="H"
- oncommand="rObjectsTree.do('help');" />
- </commandset>
- </commandset>
-
- <menupopup id="popup_tools">
- <menuitem id="menu_sciviewsk"
- label="SciViews-K"
- observes="Tasks:svAbout"
- class="menu-iconic-wide"/>
- </menupopup>
-
-
- <menupopup id="tabPicker_popup">
- <menuitem id="show_robjects_tab"
- insertafter="show_runoutput_tab,show_codebrowser_tab"
- oncommand="uilayout_ensureTabShown('sciviews_robjects_tab', true)"
- label="&sciviews.robjects.tab;"
- />
- </menupopup>
-
- <menupopup id="menu_view_tabs_popup">
- <menuitem id="show_robjects_tab2"
- insertafter="show_codebrowser_tab2"
- class="menuitem-iconic-wide"
- oncommand="uilayout_ensureTabShown('sciviews_robjects_tab', true)"
- label="&sciviews.robjects.tab;"
- />
- </menupopup>
-
- <tabbox id="leftTabBox">
- <tabs id="project_toolbox_tabs">
- <tab id="sciviews_robjects_tab"
- label="&sciviews.robjects.tab;"
- insertafter="project_tab,codebrowser_tab"
- tooltiptext="&sciviews.robjects.tip;"
- onclick="rObjectsTree.getPackageList(false)"
- />
- </tabs>
- <tabpanels id="project_toolbox_tabpanels">
- <tabpanel flex="1"
- id="sciviews_robjects_tabpanel"
- insertafter="projectviewbox,codebrowserviewbox">
- <vbox flex="1" id="sciviews_robjects_vbox">
- <hbox align="center"
- id="sciviews_robjects_hbox"
- >
- <toolbarbutton
- id="sciviews_robjects_refresh_button"
- tooltiptext="&sciviews.robjects.refresh.tip;"
- buttonstyle="pictures"
- label="&sciviews.robjects.refresh;"
- class="refresh-icon"
- oncommand="rObjectsTree.getPackageList(true);"
- />
- <toolbarbutton
- id="sciviews_robjects_searchpath_button"
- observes="cmd_robjects_viewSearchPath"
- buttonstyle="pictures"
- class="searchPath-icon"
- />
- <toolbarbutton
- id="sciviews_robjects_loadPkg_button"
- buttonstyle="pictures"
- class="robjects-loadPkg-icon"
- oncommand="sv.r.pkg.load();"
- />
-
-
- <toolbarseparator style="min-width:10px;" flex="1"/>
- <toolbarbutton id="sciviews_robjects_filter"
- tooltiptext="&sciviews.robjects.filter.tip;"
- buttonstyle="pictures"
- type="menu"
- orient="horizontal"
- class="rightarrow-button-a r-objects-filter">
- <menupopup id="sciviews_robjects_filterPopup">
- <menuitem id="sciviews_robjects_context_filterByName"
- label="&sciviews.robjects.filterByName;"
- checked="true"
- accesskey="n"
- type="checkbox"
[TRUNCATED]
To get the complete diff run:
svnlook diff /svnroot/sciviews -r 184
More information about the Sciviews-commits
mailing list