UI changes. If user has started typing in a new command, double-clicking a filename copies the filename to the cursor position, rather than opening/executing the file.
This commit is contained in:
svn%xmlterm.org 2000-03-21 14:26:59 +00:00
Родитель bcb60a3be7
Коммит 566f5e00b8
7 изменённых файлов: 114 добавлений и 212 удалений

Просмотреть файл

@ -3098,7 +3098,7 @@ NS_IMETHODIMP mozXMLTermSession::NewEntry(const nsString& aPrompt)
imgElement->SetAttribute(attName, attValue);
attName = "src";
attValue = "chrome://editor/skin/images/preview.gif";
attValue = "chrome://xmlterm/skin/images/wheel.gif";
imgElement->SetAttribute(attName, attValue);
attName = "align";

Просмотреть файл

@ -1,81 +0,0 @@
XMLterm installation instructions for Linux binaries
----------------------------------------------------
*NOTE* This work in progress. User beware!
*NOTE* This plain text INSTALL file may be out date. Please check
<http://xmlterm.org/install.html> for the most recent information.
15 Mar 2000
1. First obtain the Mozilla Linux binary tar file
ftp://ftp.mozilla.org/pub/mozilla/releases/m14/mozilla-i686-pc-linux-gnu-M14.tar.gz"
and untar it in any convenient location. This will create a
directory named "package" containing the binaries.
2. Untar the XMLterm binary tar file "xmlterm-i686-pc-linux-gnu-M14.tar.gz"
in the "package" directory created above.
3. Type the following command in the "package" directory:
./mozilla -chrome chrome://xmlterm/content/xmlterm.xul
This should create an XMLTerm in the browser window. Then click on
that window with the mouse to shift focus and start typing UNIX
commands.
**NOTE**
The command prompt is assumed to be terminated by one of the characters
"#$%>?", followed by a space. If this is not the case, many features will
not work. This restriction will be relaxed in the future.
4. To use the stand-alone XMLterm executable called "xmlterm",
type the following command in the "package" directory:
./xmlterm
"xmlterm" is shorthand for the following command, which you may also execute
directly
./mozilla -chrome chrome://xmlterm/content/xmlterm.xul
The above command(s) should create an XMLterm window. Click on that window
with the mouse to give it focus and start typing UNIX commands.
**NOTE**
The command prompt is assumed to be terminated by one of the characters
"#$%>?", followed by a space. If this is not the case, many features will
not work. This restriction will be relaxed in the future.
5. The command line can be edited using EMACS-style key bindings.
Command completion should also work with TCSH and BASH, as should history
recall.
6. By default, blue coloring is used to indicate clickable display elements.
Note that the prompt and the input command line are clickable.
(Of course, the appearance of XMLterm is completely configurable
using the CSS stylesheet chrome://xmlterm/skin/default/xmlterm.css)
After typing one or two commands, click on the prompt string of any
previous command to see what happens! Then click again on the same
prompt string. Also click on "Hide all output" button at the top of the
document.
Double-clicking is used to activate all XMLterm features, *except* for
command prompts and underlined hyperlinks, which are activated by a single
click as in a browser.
Double-clicking on a previous command line (to the right of the prompt)
re-executes the command. Be warned that double-clicking a command line can
profoundly affect your computing environment, depending upon what the
command is.
7. The sample Perl script "xls", the iconic/hypertext version of the Unix "ls"
command, is in the "package" directory. Also in the "package" directory
is "xcat", an XMLterm-aware version of the "cat" command.
8. To use XMLterm most efficiently, add the mozilla "package" directory
to your execution PATH variable by modifying your shell initialization file
(.profile/.cshrc). This will enable you to use commands such as
"xmlterm", "xls", and "xcat" easily.
--

Просмотреть файл

@ -92,6 +92,11 @@ foreach my $url (@ARGV) { # for each argument
print "<IMG SRC='$scheme://${host}$pathname'>";
print "\000"; # Terminate HTML stream
} elsif (($scheme eq "file") && ($extension eq ".ps")) {
## print STDERR "PostScript local file\n";
system("ghostview $pathname&");
} elsif (($scheme eq "file") && ($extension eq ".url")) {
# URL
open INFILE, $pathname or next;
@ -183,5 +188,3 @@ foreach my $url (@ARGV) { # for each argument
next;
}
}

Просмотреть файл

@ -1,16 +1,16 @@
#!/usr/bin/perl
# xls: an XMLterm wrapper for the UNIX "ls" command
# Usage: xls [-c|--cols] [-h|help] [-t||--text] [-w|--window] <files>
# Usage: xls [-c|--cols] [-h|help] [-t||--text] <files>
use Cwd;
use Getopt::Long;
Getopt::Long::config('bundling');
&GetOptions("cols|c=i", "help|h!", "text|t!", "window|w!");
&GetOptions("cols|c=i", "help|h!", "text|t!");
if ($opt_help) {
print "Usage: xls [-c|--cols] [-t||--text] [-w|--window] [<files>]\n";
print "Usage: xls [-c|--cols] [-t||--text] [<files>]\n";
exit;
}
@ -53,40 +53,36 @@ foreach $file (@filelist) { # for each file in the list
my ($filename, $extension) = ($1, $2);
my $sendcmd;
if ($opt_window) {
$sendcmd = "exec";
} else {
$sendcmd = "execwin";
}
my ($filetype, $fileimg, $sendcmd, $sendtxt1, $sendtxt2);
my ($filetype, $fileimg, $sendtxt1, $sendtxt2);
$sendtxt1 = $file;
if ($dir eq "/") {
$sendtxt2 = "/";
} else {
$sendtxt2 = "$dir/";
}
if (-d $file) { # directory
$filetype = "directory";
$fileimg = "$imgdir/$img{$filetype}";
$sendtxt1 = "cd $dir/$file; xls";
$sendtxt2 = "cd $file; xls";
$sendcmd = "cdxls";
} elsif (-x $file) { # executable
$filetype = "executable";
$fileimg = "$imgdir/$img{$filetype}";
$sendtxt1 = "$dir/$file";
$sendtxt2 = "./$file";
$sendcmd = "exec";
} elsif (($extension eq ".gif") ||
($extension eq ".png") ||
($extension eq ".jpg")) { # image
$filetype = "imagefile";
$fileimg = "file://$dir/$file";
$sendtxt1 = "xcat $dir/$file";
$sendtxt2 = "xcat $file";
$sendcmd = "xcat";
} elsif ($extension eq ".ps") { # postscript
$filetype = "plainfile";
$fileimg = "$imgdir/$img{$filetype}";
$sendtxt1 = "ghostview $dir/$file &";
$sendtxt2 = "ghostview $file &";
$sendcmd = "xcat";
} elsif ($extension eq ".url") { # URL
open INFILE, $file or next;
@ -119,6 +115,8 @@ foreach $file (@filelist) { # for each file in the list
$urldesc = $urlstr if !$urldesc;
$sendcmd = "textlink"; # override send command
$sendtxt1 = "$urlstr";
$sendtxt2 = "$urlstr";
$filetype = "urlfile";
if ($nurl >= 2) {
@ -126,20 +124,16 @@ foreach $file (@filelist) { # for each file in the list
} else {
$fileimg = "$imgdir/$img{$filetype}"; #default URL icon
}
$sendtxt1 = "$urlstr";
$sendtxt2 = "$urlstr";
} else {
$filetype = "plainfile";
$fileimg = "$imgdir/$img{$filetype}";
$sendtxt1 = "xcat $dir/$file";
$sendtxt2 = "xcat $file";
$sendcmd = "xcat";
}
} else { # plain file
$filetype = "plainfile";
$fileimg = "$imgdir/$img{$filetype}";
$sendtxt1 = "xcat $dir/$file";
$sendtxt2 = "xcat $file";
$sendcmd = "xcat";
}
my @comps = split(m./.,$file);

Просмотреть файл

@ -145,16 +145,24 @@ function F9Key(isShift, isControl) {
function ScrollHomeKey(isShift, isControl) {
dump("ScrollHomeKey("+isShift+","+isControl+")\n");
ScrollWin(isShift,isControl).scroll(0,0);
return false;
if (isControl) {
return F1Key(isShift, 0);
} else {
ScrollWin(isShift,isControl).scroll(0,0);
return false;
}
}
// Scroll End key
function ScrollEndKey(isShift, isControl) {
dump("ScrollEndKey("+isShift+","+isControl+")\n");
ScrollWin(isShift,isControl).scroll(0,99999);
return false;
if (isControl) {
return F2Key(isShift, 0);
} else {
ScrollWin(isShift,isControl).scroll(0,99999);
return false;
}
}
// Scroll PageUp key
@ -358,9 +366,12 @@ function DisplayAllOutput(flag) {
// textlink - hyperlink
// prompt - command prompt
// command - command line
// execwin - execute command with sendln/createln (doubleclick)
// (depending upon window.windowsMode)
// exec - execute command with sendln only (doubleclick)
//
// (Following are inline or in new window depending upon window.windowsMode)
// cdxls - change directory and list contents (doubleclick)
// xcat - display file (doubleclick)
// exec - execute file (doubleclick)
//
// send - transmit arg to LineTerm
// sendln - transmit arg+newline to LineTerm
// createln - transmit arg+newline as first command to new XMLTerm
@ -368,9 +379,9 @@ function DisplayAllOutput(flag) {
// entryNumber: >=0 means process only if current entry
// <0 means process anytime
//
// arg1: command/pathname string (without newline)
// arg2: alternate command line (for use in current entry only;
// uses relative pathnames assuming current working directory)
// arg1: relative pathname of file/directory
// arg2: absolute pathname prefix (for use outside current entry;
// use relative pathname in current working directory)
//
function HandleEvent(eventObj, eventType, targetType, entryNumber,
arg1, arg2) {
@ -413,12 +424,32 @@ function HandleEvent(eventObj, eventType, targetType, entryNumber,
// Use single click for "selection" and prompt expansion only
// Windows-style
var currentEntryNumber = window.xmlterm.currentEntryNumber;
var currentCmdElement = document.getElementById("command"+currentEntryNumber);
var currentCommandEmpty = true;
if (currentCmdElement && currentCmdElement.hasChildNodes()) {
if (currentCmdElement.firstChild.nodeType == Node.TEXT_NODE) {
//dump("textLength = "+currentCmdElement.firstChild.data.length+"\n");
currentCommandEmpty = (currentCmdElement.firstChild.data.length == 0);
} else {
currentCommandEmpty = false;
}
}
//dump("empty = "+currentCommandEmpty+"\n");
if (targetType === "command") {
if (!dblClick)
return false;
var commandElement = document.getElementById(targetType+entryNumber);
var command = commandElement.firstChild.data;
window.xmlterm.SendText("\025"+command+"\n", document.cookie);
if (currentCommandEmpty) {
window.xmlterm.SendText("\025"+command+"\n", document.cookie);
} else {
window.xmlterm.SendText(command, document.cookie);
}
} else {
// Targets which may be qualified only for current entry
@ -429,52 +460,74 @@ function HandleEvent(eventObj, eventType, targetType, entryNumber,
return (false);
}
var action;
var action, sendStr;
if ( (targetType === "cdxls") ||
(targetType === "xcat") ||
(targetType === "exec") ) {
// Complex commands
if (targetType === "execwin") {
// Execute command; inline or in a new window
if (!dblClick)
return false;
if (window.windowsMode === "on") {
action = "createln";
var filename;
var isCurrentCommand = (Math.abs(entryNumber)+1 ==
window.xmlterm.currentEntryNumber);
if (!isCurrentCommand && (arg2 != null)) {
filename = arg2+arg1;
} else {
action = "sendln";
filename = arg1;
if (targetType === "exec")
filename = "./"+filename;
}
} else if (targetType === "exec") {
// Execute command inline
if (!dblClick)
return false;
var prefix, suffix;
if (targetType === "cdxls") {
// Change directory and list contents
prefix = "cd ";
suffix = "; xls";
} else if (targetType === "xcat") {
// Display file
prefix = "xcat ";
suffix = "";
} else if (targetType === "exec") {
// Execute file
prefix = "";
suffix = "";
}
action = "sendln";
if (window.windowsMode === "on") {
action = "createln";
sendStr = prefix + filename + suffix;
} else if (currentCommandEmpty) {
action = "sendln";
sendStr = prefix + filename + suffix;
} else {
action = "send";
sendStr = filename + " ";
}
} else {
// Primitive action
action = targetType;
sendStr = arg1;
}
// Primitive actions
if (action === "send") {
dump("send = "+arg1+"\n");
window.xmlterm.SendText(arg1, document.cookie);
dump("send = "+sendStr+"\n");
window.xmlterm.SendText(sendStr, document.cookie);
} else if (action === "sendln") {
if ((Math.abs(entryNumber)+1 == window.xmlterm.currentEntryNumber) &&
(arg2 != null)) {
// Current command
dump("sendln = "+arg2+"\n\n");
window.xmlterm.SendText("\025"+arg2+"\n", document.cookie);
} else {
// Not current command
dump("sendln = "+arg1+"\n\n");
window.xmlterm.SendText("\025"+arg1+"\n", document.cookie);
}
dump("sendln = "+sendStr+"\n\n");
window.xmlterm.SendText("\025"+sendStr+"\n", document.cookie);
} else if (action === "createln") {
dump("createln = "+arg1+"\n\n");
newwin = NewXMLTerm(arg1+"\n");
dump("createln = "+sendStr+"\n\n");
newwin = NewXMLTerm(sendStr+"\n");
}
}
}

Просмотреть файл

@ -1,67 +0,0 @@
#!gmake
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "MPL"); you may not use this file
# except in compliance with the MPL. You may obtain a copy of
# the MPL at http://www.mozilla.org/MPL/
#
# Software distributed under the MPL is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the MPL for the specific language governing
# rights and limitations under the MPL.
#
# The Original Code is lineterm.
#
# The Initial Developer of the Original Code is Ramalingam Saravanan.
# Portions created by Ramalingam Saravanan <svn@xmlterm.org> are
# Copyright (C) 1999 Ramalingam Saravanan. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the
# terms of the GNU General Public License (the "GPL"), in which case
# the provisions of the GPL are applicable instead of
# those above. If you wish to allow use of your version of this
# file only under the terms of the GPL and not to allow
# others to use your version of this file under the MPL, indicate
# your decision by deleting the provisions above and replace them
# with the notice and other provisions required by the GPL.
# If you do not delete the provisions above, a recipient
# may use your version of this file under either the MPL or the
# GPL.
#
# makefile for xmlterm/ui/skin directory
ifdef STAND_ALONE
DEPTH = ../..
topsrcdir = ../..
VPATH = .
srcdir = .
include $(topsrcdir)/config/autoconf.mk
else
DEPTH = ../../../..
topsrcdir = @top_srcdir@
VPATH = @srcdir@
srcdir = @srcdir@
include $(DEPTH)/config/autoconf.mk
endif
include $(topsrcdir)/config/config.mk
include $(srcdir)/../../config/xmlterm_config.mk
include $(topsrcdir)/config/rules.mk
EXPORT_RESOURCE_SKIN = \
$(srcdir)/xmlterm.css \
$(srcdir)/xmltpage.css \
$(NULL)
EXPORT_RESOURCE_TOOLBAR = \
$(srcdir)/images/ficon.gif \
$(NULL)
install::
$(INSTALL) $(EXPORT_RESOURCE_SKIN) $(DIST)/bin/chrome/xmlterm/skin/default
$(INSTALL) $(EXPORT_RESOURCE_TOOLBAR) $(DIST)/bin/chrome/xmlterm/skin/default/images

Просмотреть файл