diff --git a/mozilla/extensions/xmlterm/INSTALL b/mozilla/extensions/xmlterm/INSTALL index 3698a7212df..2430178d0e3 100644 --- a/mozilla/extensions/xmlterm/INSTALL +++ b/mozilla/extensions/xmlterm/INSTALL @@ -5,23 +5,29 @@ INSTALL: Installation instructions for XMLterm source code *NOTE* Check the XMLterm web site for updates. -28 Feb 2000 +7 Mar 2000 -QUICK INSTALLATION INSTRUCTIONS (Linux/Solaris) ------------------------------------------------ +QUICK BUILD INSTRUCTIONS (Linux/Solaris) +---------------------------------------- +If you have already built mozilla from the source, then type the following +commands in the "mozilla" directory to build XMLterm: -a) (Build mozilla from the source tarball) -b) cd mozilla/extensions/xmlterm -c) ./makemake -r -d) make all -e) cd ../../dist/bin -f) ./xmlterm +a) configure --with-extensions=xmlterm +b) cd extensions/xmlterm +c) make + +[Skip step (b) for a fresh build of mozilla from the source tarball] + +To execute XMLterm, type one of the following commands in +the mozilla/dist/bin directory: + + ./xmlterm OR ./mozilla -chrome chrome://xmlterm/content/xmlterm.xul -DETAILED INSTALLATION INSTRUCTIONS ----------------------------------- +DETAILED BUILD INSTRUCTIONS +--------------------------- In the following discussion, file and directory names are relative to the main ("mozilla/extensions/xmlterm") directory. See the end of the @@ -119,14 +125,15 @@ 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/xmltpage.css) -Double-clicking is used to activate all XMLterm features, except for -underlined hyperlinks, which are activated by a single click as in a browser. - -After typing one or two commands, double-click on the prompt string of any -previous command to see what happens! Then double-click again on the same +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 diff --git a/mozilla/extensions/xmlterm/Makefile.in b/mozilla/extensions/xmlterm/Makefile.in index 0d000e1dd23..506675c17a3 100644 --- a/mozilla/extensions/xmlterm/Makefile.in +++ b/mozilla/extensions/xmlterm/Makefile.in @@ -56,7 +56,7 @@ DIRS = base tests linetest else # not STAND_ALONE -DIRS = base ui scripts tests geckoterm +DIRS = base ui scripts doc tests geckoterm LIBRARY_NAME = diff --git a/mozilla/extensions/xmlterm/README b/mozilla/extensions/xmlterm/README index e69e12624ad..243b6dcb6cf 100644 --- a/mozilla/extensions/xmlterm/README +++ b/mozilla/extensions/xmlterm/README @@ -18,18 +18,25 @@ XMLterm is an open source project in its early stages. Comments and contributions are welcome! R. Saravanan -26 Feb 2000 -=========== +7 Mar 2000 +========== QUICK SET-UP INSTRUCTIONS (Linux/Solaris) ----------------------------------------- -a) (Build mozilla from the source tarball) -b) cd mozilla/extensions/xmlterm -c) ./makemake -r -d) make all -e) cd ../../dist/bin -f) ./xmlterm +If you have already built mozilla from the source, then type the following +commands in the "mozilla" directory to build XMLterm: + +a) configure --with-extensions=xmlterm +b) cd extensions/xmlterm +c) make + +[Skip step (b) for a fresh build of mozilla from the source tarball] + +To execute XMLterm, type one of the following commands in +the mozilla/dist/bin directory: + + ./xmlterm OR ./mozilla -chrome chrome://xmlterm/content/xmlterm.xul diff --git a/mozilla/extensions/xmlterm/base/ltermEscape.c b/mozilla/extensions/xmlterm/base/ltermEscape.c index 47905b00c93..35c831635cf 100644 --- a/mozilla/extensions/xmlterm/base/ltermEscape.c +++ b/mozilla/extensions/xmlterm/base/ltermEscape.c @@ -153,7 +153,7 @@ int ltermProcessEscape(struct lterms *lts, const UNICHAR *buf, LTERM_LOG(ltermProcessEscape,52,("Application Keypad\n")); if (lto->outputMode == LTERM2_LINE_MODE) { ltermSwitchToScreenMode(lts); - *opcodes = LTERM_SCREENDATA_CODE | LTERM_CLEAR_CODE; + *opcodes = LTERM_LINEDATA_CODE | LTERM_OUTPUT_CODE; } return 0; @@ -161,7 +161,7 @@ int ltermProcessEscape(struct lterms *lts, const UNICHAR *buf, LTERM_LOG(ltermProcessEscape,52,("Normal Keypad\n")); if (lto->outputMode == LTERM1_SCREEN_MODE) { ltermSwitchToLineMode(lts); - *opcodes = LTERM_LINEDATA_CODE; + *opcodes = LTERM_SCREENDATA_CODE | LTERM_CLEAR_CODE; } return 0; @@ -701,7 +701,7 @@ static int ltermProcessCSISequence(struct lterms *lts, const UNICHAR *buf, /* Switch to alternate buffer */ if (lto->outputMode == LTERM2_LINE_MODE) { ltermSwitchToScreenMode(lts); - *opcodes = LTERM_SCREENDATA_CODE | LTERM_CLEAR_CODE; + *opcodes = LTERM_LINEDATA_CODE | LTERM_OUTPUT_CODE; } } return 0; @@ -720,7 +720,7 @@ static int ltermProcessCSISequence(struct lterms *lts, const UNICHAR *buf, /* Switch to regular buffer */ if (lto->outputMode == LTERM1_SCREEN_MODE) { ltermSwitchToLineMode(lts); - *opcodes = LTERM_LINEDATA_CODE; + *opcodes = LTERM_SCREENDATA_CODE | LTERM_CLEAR_CODE; } } return 0; @@ -892,7 +892,7 @@ static int ltermProcessDECPrivateMode(struct lterms *lts, /* Switch to screen mode */ if (lto->outputMode == LTERM2_LINE_MODE) { ltermSwitchToScreenMode(lts); - *opcodes = LTERM_SCREENDATA_CODE | LTERM_CLEAR_CODE; + *opcodes = LTERM_LINEDATA_CODE | LTERM_OUTPUT_CODE; } } return 0; @@ -903,7 +903,7 @@ static int ltermProcessDECPrivateMode(struct lterms *lts, /* Switch to line mode */ if (lto->outputMode == LTERM1_SCREEN_MODE) { ltermSwitchToLineMode(lts); - *opcodes = LTERM_LINEDATA_CODE; + *opcodes = LTERM_SCREENDATA_CODE | LTERM_CLEAR_CODE; } } return 0; @@ -1162,6 +1162,27 @@ static int ltermProcessXMLTermSequence(struct lterms *lts, const UNICHAR *buf, } return 0; + case U_F_CHAR: /* Enable/disable full screen mode */ + if (param1) { + /* Enable full screen mode */ + if (lto->outputMode == LTERM2_LINE_MODE) { + ltermSwitchToScreenMode(lts); + *opcodes = LTERM_LINEDATA_CODE | LTERM_OUTPUT_CODE; + } + + LTERM_LOG(ltermProcessXMLTermSequence,52,("Enabled full screen mode\n")); + + } else { + /* Disable full screen mode */ + if (lto->outputMode == LTERM1_SCREEN_MODE) { + ltermSwitchToLineMode(lts); + *opcodes = LTERM_SCREENDATA_CODE | LTERM_CLEAR_CODE; + } + + LTERM_LOG(ltermProcessXMLTermSequence,52,("Disabled full screen mode\n")); + } + return 0; + case U_R_CHAR: /* Enable/disable raw input mode */ if (param1) { /* Switch to raw input mode */ diff --git a/mozilla/extensions/xmlterm/base/ltermIO.c b/mozilla/extensions/xmlterm/base/ltermIO.c index 155643a1e93..eacb1da2c28 100644 --- a/mozilla/extensions/xmlterm/base/ltermIO.c +++ b/mozilla/extensions/xmlterm/base/ltermIO.c @@ -313,14 +313,26 @@ int ltermWrite(struct lterms *lts, int *opcodes) /* Process plain text input record */ int doNotCancelCompletion = 0; - if ( (lti->inputMode >= LTERM3_COMPLETION_MODE) && - (availableChars == 1) ) { + if (lti->inputMode >= LTERM3_COMPLETION_MODE) { - doNotCancelCompletion = - ((lts->completionRequest == LTERM_TAB_COMPLETION) && - (lti->inputBuf[2] == U_TAB)) || - ((lts->completionRequest == LTERM_HISTORY_COMPLETION) && - ((lti->inputBuf[2] == U_CTL_P) || (lti->inputBuf[2] == U_CTL_N)) ); + if (availableChars == 1) { + /* Single control character completion requests */ + + doNotCancelCompletion = + ( (lts->completionRequest == LTERM_TAB_COMPLETION) && + (lti->inputBuf[2] == U_TAB) ) || + ( (lts->completionRequest == LTERM_HISTORY_COMPLETION) && + ((lti->inputBuf[2] == U_CTL_P) || (lti->inputBuf[2] == U_CTL_N)) ); + + } else if (availableChars == 3) { + /* Three character escape sequences for up/down arrow keys */ + /* NOTE: Input CSI escape sequence; may not be portable */ + + doNotCancelCompletion = + ( (lts->completionRequest == LTERM_HISTORY_COMPLETION) && + (lti->inputBuf[2] == U_ESCAPE) && (lti->inputBuf[3] == U_LBRACKET) && + ((lti->inputBuf[4] == U_A_CHAR) || (lti->inputBuf[4] == U_B_CHAR)) ); + } } if (!doNotCancelCompletion && diff --git a/mozilla/extensions/xmlterm/base/ltermInput.c b/mozilla/extensions/xmlterm/base/ltermInput.c index d91092b2c4c..5a26878ac9c 100644 --- a/mozilla/extensions/xmlterm/base/ltermInput.c +++ b/mozilla/extensions/xmlterm/base/ltermInput.c @@ -377,6 +377,8 @@ static int ltermLineInput(struct lterms *lts, } else if (lti->escapeCSIFlag) { /* Character part of escape code sequence */ + LTERM_LOG(ltermLineInput,38,("Escape code sequence - %c\n", (char) uch)); + if ((uch >= (UNICHAR)U_ZERO && uch <= (UNICHAR)U_NINE)) { /* Process numerical argument to escape code sequence */ lti->escapeCSIArg = lti->escapeCSIArg*10 + (uch - U_ZERO); @@ -386,6 +388,8 @@ static int ltermLineInput(struct lterms *lts, /* End of escape code sequence */ lti->escapeCSIFlag = 0; + /* NOTE: Input CSI escape sequence; may not be portable */ + /* SUN arrow key bindings */ switch (uch) { case U_A_CHAR: @@ -500,38 +504,60 @@ static int ltermLineInput(struct lterms *lts, } else { /* other control characters */ - if (lti->inputMode >= LTERM2_EDIT_MODE) { + + LTERM_LOG(ltermLineInput,32,("^%c\n", uch+U_ATSIGN)); + + if (lti->inputMode < LTERM2_EDIT_MODE) { + /* Non-edit mode; simply transmit control character */ + if (ltermSendData(lts, &uch, 1) != 0) + return -1; + + } else { + /* Edit input mode */ + + if (uch == U_CTL_D) { + /* Special handling for ^D */ + + if (lti->inputChars == 0) { + /* Lone ^D in input line, simply transmit it */ + if (ltermSendData(lts, &uch, 1) != 0) + return -1; + uch = U_NUL; + + } else if (lti->inputCursorGlyph < lti->inputGlyphs) { + /* Cursor not at end of line; delete to right */ + if (ltermDeleteGlyphs(lti, -1) != 0) + return -1; + uch = U_NUL; + } + } + switch (uch) { case U_NUL: /* Null character; ignore */ break; case U_CTL_B: /* move cursor backward */ - LTERM_LOG(ltermLineInput,32,("^B\n")); if (lti->inputCursorGlyph > 0) { lti->inputCursorGlyph--; } break; case U_CTL_F: /* move cursor forward */ - LTERM_LOG(ltermLineInput,32,("^F\n")); if (lti->inputCursorGlyph < lti->inputGlyphs) { lti->inputCursorGlyph++; } break; case U_CTL_A: /* position cursor at beginning of line */ - LTERM_LOG(ltermLineInput,32,("^A\n")); lti->inputCursorGlyph = 0; break; case U_CTL_E: /* position cursor at end of line */ - LTERM_LOG(ltermLineInput,32,("^E\n")); lti->inputCursorGlyph = lti->inputGlyphs; break; case U_CTL_K: /* delete to end of line */ - LTERM_LOG(ltermLineInput,32,("^K\n")); if (ltermDeleteGlyphs(lti,-(lti->inputGlyphs-lti->inputCursorGlyph)) != 0) return -1; @@ -539,22 +565,14 @@ static int ltermLineInput(struct lterms *lts, case U_CTL_L: /* form feed */ case U_CTL_R: /* redisplay */ - LTERM_LOG(ltermLineInput,32,("^%c\n", uch+U_ATSIGN)); break; - case U_CTL_D: /* ^D */ + case U_CTL_D: /* ^D at end of non-null input line */ case U_CTL_N: /* dowN history */ case U_CTL_P: /* uP history */ case U_CTL_Y: /* yank */ case U_TAB: /* command completion */ - if ((lti->inputChars == 0) && (uch == U_CTL_D)) { - /* If lone ^D input, simply transmit it */ - if (ltermSendData(lts, &uch, 1) != 0) - return -1; - return 0; - } - /* Assert that completion character occurs at end of buffer; * enforced by lterm_write. */ @@ -582,6 +600,10 @@ static int ltermLineInput(struct lterms *lts, } break; + + default: /* Transmit any other control character */ + if (ltermSendData(lts, &uch, 1) != 0) + return -1; } } } diff --git a/mozilla/extensions/xmlterm/base/mozIXMLTerminal.h b/mozilla/extensions/xmlterm/base/mozIXMLTerminal.h index 57111ad8a44..9ae05acfa29 100644 --- a/mozilla/extensions/xmlterm/base/mozIXMLTerminal.h +++ b/mozilla/extensions/xmlterm/base/mozIXMLTerminal.h @@ -131,6 +131,11 @@ public: */ NS_IMETHOD GetPresShell(nsIPresShell** aPresShell) = 0; + /** Gets flag denoting whether terminal is in full screen mode + * @param aFlag (output) screen mode flag + */ + NS_IMETHOD GetScreenMode(PRBool* aFlag) = 0; + /** Checks if supplied cookie is valid for XMLTerm * @param aCookie supplied cookie string * @param _retval true if supplied cookie matches XMLTerm cookie @@ -140,6 +145,10 @@ public: /** Resizes XMLterm to match a resized window. */ NS_IMETHOD Resize(void) = 0; + + /** Shows the caret and make it editable. + */ + NS_IMETHOD ShowCaret(void) = 0; }; #define MOZXMLTERMINAL_CID \ diff --git a/mozilla/extensions/xmlterm/base/mozXMLTermListeners.cpp b/mozilla/extensions/xmlterm/base/mozXMLTermListeners.cpp index acd786ee860..34d67be511f 100644 --- a/mozilla/extensions/xmlterm/base/mozXMLTermListeners.cpp +++ b/mozilla/extensions/xmlterm/base/mozXMLTermListeners.cpp @@ -277,13 +277,17 @@ mozXMLTermKeyListener::KeyPress(nsIDOMEvent* aKeyEvent) NS_SUCCEEDED(keyEvent->GetAltKey(&altKey)) ) { PRUint32 keyChar = 0; + PRUint32 escPrefix = 0; nsAutoString JSCommand = ""; + PRBool screenMode = 0; + result = mXMLTerminal->GetScreenMode(&screenMode); + result = keyEvent->GetCharCode(&keyChar); XMLT_LOG(mozXMLTermKeyListener::KeyPress,52, - ("code=0x%x, char=0x%x, shift=%d, ctrl=%d, alt=%d\n", - keyCode, keyChar, shiftKey, ctrlKey, altKey)); + ("code=0x%x, char=0x%x, shift=%d, ctrl=%d, alt=%d, screenMode=%d\n", + keyCode, keyChar, shiftKey, ctrlKey, altKey, screenMode)); if (keyChar == 0) { // Key that hasn't been mapped to a character code @@ -305,38 +309,63 @@ mozXMLTermKeyListener::KeyPress(nsIDOMEvent* aKeyEvent) case nsIDOMKeyEvent::DOM_VK_RETURN: keyChar = U_CRETURN; break; - case nsIDOMKeyEvent::DOM_VK_LEFT: - keyChar = U_CTL_B; - break; - case nsIDOMKeyEvent::DOM_VK_RIGHT: - keyChar = U_CTL_F; - break; case nsIDOMKeyEvent::DOM_VK_UP: - keyChar = U_CTL_P; + escPrefix = 1; + keyChar = U_A_CHAR; break; case nsIDOMKeyEvent::DOM_VK_DOWN: - keyChar = U_CTL_N; + escPrefix = 1; + keyChar = U_B_CHAR; + break; + case nsIDOMKeyEvent::DOM_VK_RIGHT: + escPrefix = 1; + keyChar = U_C_CHAR; + break; + case nsIDOMKeyEvent::DOM_VK_LEFT: + escPrefix = 1; + keyChar = U_D_CHAR; break; case nsIDOMKeyEvent::DOM_VK_ESCAPE: keyChar = U_ESCAPE; break; case nsIDOMKeyEvent::DOM_VK_HOME: - JSCommand = "ScrollHome"; + JSCommand = "ScrollHomeKey"; break; case nsIDOMKeyEvent::DOM_VK_END: - JSCommand = "ScrollEnd"; + JSCommand = "ScrollEndKey"; break; case nsIDOMKeyEvent::DOM_VK_PAGE_UP: - JSCommand = "ScrollPageUp"; + JSCommand = "ScrollPageUpKey"; break; case nsIDOMKeyEvent::DOM_VK_PAGE_DOWN: - JSCommand = "ScrollPageDown"; + JSCommand = "ScrollPageDownKey"; break; case nsIDOMKeyEvent::DOM_VK_F1: - JSCommand = "HideAll"; + JSCommand = "F1Key"; break; case nsIDOMKeyEvent::DOM_VK_F2: - JSCommand = "ShowAll"; + JSCommand = "F2Key"; + break; + case nsIDOMKeyEvent::DOM_VK_F3: + JSCommand = "F3Key"; + break; + case nsIDOMKeyEvent::DOM_VK_F4: + JSCommand = "F4Key"; + break; + case nsIDOMKeyEvent::DOM_VK_F5: + JSCommand = "F5Key"; + break; + case nsIDOMKeyEvent::DOM_VK_F6: + JSCommand = "F6Key"; + break; + case nsIDOMKeyEvent::DOM_VK_F7: + JSCommand = "F7Key"; + break; + case nsIDOMKeyEvent::DOM_VK_F8: + JSCommand = "F8Key"; + break; + case nsIDOMKeyEvent::DOM_VK_F9: + JSCommand = "F9Key"; break; default: // ignore event without consuming return NS_OK; @@ -349,6 +378,9 @@ mozXMLTermKeyListener::KeyPress(nsIDOMEvent* aKeyEvent) keyChar = (keyChar >= 0x60U) ? keyChar-0x60U : keyChar-0x40U; } + XMLT_LOG(mozXMLTermKeyListener::KeyPress,53, + ("escPrefix=%d, keyChar=0x%x, \n", escPrefix, keyChar)); + if (JSCommand.Length() > 0) { // Execute JS command nsCOMPtr domDocument; @@ -370,8 +402,14 @@ mozXMLTermKeyListener::KeyPress(nsIDOMEvent* aKeyEvent) if (!mSuspend && (keyChar > 0) && (keyChar <= 0xFFFDU)) { // Transmit valid non-null Unicode character - const PRUnichar temUString[] = {keyChar,0}; - nsAutoString keyString(temUString); + nsAutoString keyString = ""; + if (escPrefix) { + keyString.Append((PRUnichar) U_ESCAPE); + keyString.Append((PRUnichar) U_LBRACKET); + } + + keyString.Append((PRUnichar) keyChar); + result = mXMLTerminal->SendTextAux(keyString); } } diff --git a/mozilla/extensions/xmlterm/base/mozXMLTermSession.cpp b/mozilla/extensions/xmlterm/base/mozXMLTermSession.cpp index 46deae76297..c84fa84cb21 100644 --- a/mozilla/extensions/xmlterm/base/mozXMLTermSession.cpp +++ b/mozilla/extensions/xmlterm/base/mozXMLTermSession.cpp @@ -30,7 +30,6 @@ #include "nsIDocumentViewer.h" -#include "nsICaret.h" #include "nsITextContent.h" #include "nsIDOMElement.h" @@ -81,8 +80,7 @@ const char* const mozXMLTermSession::sessionElementNames[] = { // Should HTML event names should always be in lower case for DOM to work? const char* const mozXMLTermSession::sessionEventNames[] = { - "click", - "dblclick" + "click" }; const char* const mozXMLTermSession::metaCommandNames[] = { @@ -197,15 +195,6 @@ NS_IMETHODIMP mozXMLTermSession::Init(mozIXMLTerminal* aXMLTerminal, nsresult result = NS_OK; - // Show the caret - nsCOMPtr caret; - if (NS_SUCCEEDED(mPresShell->GetCaret(getter_AddRefs(caret)))) { - caret->SetCaretVisible(PR_TRUE); - caret->SetCaretReadOnly(PR_FALSE); - } - - mPresShell->SetCaretEnabled(PR_TRUE); - nsCOMPtr vDOMHTMLDocument (do_QueryInterface(mDOMDocument)); if (!vDOMHTMLDocument) @@ -552,13 +541,7 @@ NS_IMETHODIMP mozXMLTermSession::ReadAll(mozILineTermAux* lineTermAux, // WORKAROUND for some unknown bug in the full screen implementation. // Without this, if you delete a line using "vi" and save the file, // the cursor suddenly disappears - nsCOMPtr caret; - if (NS_SUCCEEDED(mPresShell->GetCaret(getter_AddRefs(caret)))) { - caret->SetCaretVisible(PR_TRUE); - caret->SetCaretReadOnly(PR_FALSE); - } - - mPresShell->SetCaretEnabled(PR_TRUE); + mXMLTerminal->ShowCaret(); } if (streamData) { @@ -1121,6 +1104,9 @@ NS_IMETHODIMP mozXMLTermSession::ReadAll(mozILineTermAux* lineTermAux, SELECTION_FOCUS_REGION); } + // Show caret + mXMLTerminal->ShowCaret(); + // Scroll frame (ignore result) ScrollToBottomLeft(); @@ -1171,19 +1157,20 @@ NS_IMETHODIMP mozXMLTermSession::DisplayInput(const nsString& aString, result = selection->Collapse(mInputTextNode, cursorCol); } else { + // Get the last bit of text in the prompt nsCOMPtr promptTextNode; - result = mPromptSpanNode->GetFirstChild(getter_AddRefs(promptTextNode)); + result = mPromptSpanNode->GetLastChild(getter_AddRefs(promptTextNode)); if (NS_SUCCEEDED(result)) { nsCOMPtr domText (do_QueryInterface(promptTextNode)); if (domText) { - PRUint32 promptLength; - result = domText->GetLength(&promptLength); + PRUint32 textLength; + result = domText->GetLength(&textLength); if (NS_SUCCEEDED(result)) { XMLT_LOG(mozXMLTermSession::DisplayInput,72, - ("promptLength=%d\n", promptLength)); - result = selection->Collapse(promptTextNode, promptLength); + ("textLength=%d\n", textLength)); + result = selection->Collapse(promptTextNode, textLength); } } } @@ -1623,6 +1610,7 @@ NS_IMETHODIMP mozXMLTermSession::LimitOutputLines(PRBool deleteAllOld) if (NS_FAILED(result) || !firstChild) return NS_ERROR_FAILURE; + attValue = ""; result = mozXMLTermUtils::GetNodeAttribute(firstChild, "class", attValue); if (NS_FAILED(result)) return result; @@ -1666,6 +1654,7 @@ NS_IMETHODIMP mozXMLTermSession::LimitOutputLines(PRBool deleteAllOld) deleteNode = 1; } else { + attValue = ""; result = mozXMLTermUtils::GetNodeAttribute(nextChild, "class", attValue); if (NS_FAILED(result)|| (attValue.Length() == 0)) { @@ -2191,7 +2180,7 @@ NS_IMETHODIMP mozXMLTermSession::AppendLineLS(const nsString& aString, * @param parentNode parent node for HTML fragment * @param entryNumber entry number (default value = -1) * (if entryNumber >= 0, all '#' characters in - * id/onclick/ondblclick attribute values are substituted + * id/onclick attribute values are substituted * with entryNumber) * @param beforeNode child node before which to insert fragment; * if null, insert after last child node @@ -2377,7 +2366,7 @@ void mozXMLTermSession::SubstituteCommandNumber(nsString& aString, /** Sanitize event handler attribute values by imposing syntax checks. * @param aAttrValue attribute value to be sanitized - * @param aEventName name of event being handled ("click", "dblclick", ...) + * @param aEventName name of event being handled ("click", ...) */ void mozXMLTermSession::SanitizeAttribute(nsString& aAttrValue, const char* aEventName) @@ -2466,6 +2455,7 @@ NS_IMETHODIMP mozXMLTermSession::DeepSanitizeFragment( attName = "on"; attName.Append(sessionEventNames[j]); + attValue = ""; result = domElement->GetAttribute(attName, attValue); if (NS_SUCCEEDED(result) && (attValue.Length() > 0)) { // Save allowed event attribute value for re-insertion @@ -2527,6 +2517,7 @@ NS_IMETHODIMP mozXMLTermSession::DeepSanitizeFragment( // Process ID attribute attName = "id"; + attValue = ""; result = domElement->GetAttribute(attName, attValue); if (NS_SUCCEEDED(result) && (attValue.Length() > 0)) { @@ -2542,7 +2533,6 @@ NS_IMETHODIMP mozXMLTermSession::DeepSanitizeFragment( attName.Append(sessionEventNames[j]); attValue = eventAttrVals[j]; - if (attValue.Length() > 0) { SubstituteCommandNumber(attValue, entryNumber); @@ -2601,6 +2591,7 @@ NS_IMETHODIMP mozXMLTermSession::DeepRefreshEventHandlers( XMLT_LOG(mozXMLTermSession::DeepRefreshEventHandlers,89, ("Refreshing on%s attribute\n",sessionEventNames[j] )); + attValue = ""; result = domElement->GetAttribute(attName, attValue); if (NS_SUCCEEDED(result) && (attValue.Length() > 0)) { @@ -2840,7 +2831,7 @@ NS_IMETHODIMP mozXMLTermSession::ScrollToBottomLeft(void) return NS_ERROR_FAILURE; // Scroll to bottom left of screen - domWindow->ScrollBy(-9999,9999); + domWindow->ScrollBy(-99999,99999); return NS_OK; } @@ -2922,6 +2913,20 @@ NS_IMETHODIMP mozXMLTermSession::SetPrompt(const PRUnichar* aPrompt) } +/** Gets flag denoting whether terminal is in full screen mode + * @param aFlag (output) screen mode flag + */ +NS_IMETHODIMP mozXMLTermSession::GetScreenMode(PRBool* aFlag) +{ + if (!aFlag) + return NS_ERROR_NULL_POINTER; + + *aFlag = (mScreenNode != nsnull); + + return NS_OK; +} + + /** Create a DIV element with attributes NAME="preface", CLASS="preface", * and ID="preface0", containing an empty text node, and append it as a * child of the main BODY element. Also make it the current display element. @@ -3061,6 +3066,68 @@ NS_IMETHODIMP mozXMLTermSession::NewEntry(const nsString& aPrompt) mPromptSpanNode); if (mPromptHTML.Length() == 0) { + +#define DEFAULT_ICON_PROMPT +#ifdef DEFAULT_ICON_PROMPT // Experimental code; has scrolling problems + // Create text node + image node as child of prompt element + nsCOMPtr spanNode, textNode; + + tagName = "span"; + name ="noicons"; + result = NewElementWithText(tagName, name, -1, + mPromptSpanNode, spanNode, textNode); + if (NS_FAILED(result) || !spanNode || !textNode) { + return NS_ERROR_FAILURE; + } + + // Set prompt text + result = SetDOMText(textNode, aPrompt); + if (NS_FAILED(result)) + return NS_ERROR_FAILURE; + + // Create IMG element + tagName = "img"; + nsCOMPtr imgElement; + result = mDOMDocument->CreateElement(tagName, getter_AddRefs(imgElement)); + if (NS_FAILED(result) || !imgElement) + return NS_ERROR_FAILURE; + + // Set attributes + nsAutoString attName("class"); + nsAutoString attValue("icons"); + imgElement->SetAttribute(attName, attValue); + + attName = "src"; + attValue = "chrome://editor/skin/images/preview.gif"; + imgElement->SetAttribute(attName, attValue); + + attName = "align"; + attValue = "middle"; + imgElement->SetAttribute(attName, attValue); + + nsCOMPtr resultNode; + + // Append IMG element + nsCOMPtr imgNode = do_QueryInterface(imgElement); + result = mPromptSpanNode->AppendChild(imgNode, + getter_AddRefs(resultNode)); + if (NS_FAILED(result)) + return NS_ERROR_FAILURE; + + // Append text node containing single space + nsCOMPtr stubText; + nsAutoString spaceStr (" "); + result = mDOMDocument->CreateTextNode(spaceStr, getter_AddRefs(stubText)); + if (NS_FAILED(result) || !stubText) + return NS_ERROR_FAILURE; + + nsCOMPtr stubNode = do_QueryInterface(stubText); + result = mPromptSpanNode->AppendChild(stubNode, + getter_AddRefs(resultNode)); + if (NS_FAILED(result)) + return NS_ERROR_FAILURE; + +#else // !DEFAULT_ICON_PROMPT // Create text node as child of prompt element nsCOMPtr textNode; result = NewTextNode(mPromptSpanNode, textNode); @@ -3072,6 +3139,7 @@ NS_IMETHODIMP mozXMLTermSession::NewEntry(const nsString& aPrompt) result = SetDOMText(textNode, aPrompt); if (NS_FAILED(result)) return NS_ERROR_FAILURE; +#endif // !DEFAULT_ICON_PROMPT } else { // User-specified HTML prompt @@ -3802,7 +3870,7 @@ NS_IMETHODIMP mozXMLTermSession::NewIFrame(nsIDOMNode* parentNode, } -/** Add event attributes (onclick, ondblclick, ...) to DOM node +/** Add event attributes (onclick, ...) to DOM node * @param name name of DOM node (supplied as argument to the event handler) * @param number entry number (supplied as argument to the event handler) * @param domNode DOM node to be modified @@ -4197,7 +4265,7 @@ void mozXMLTermSession::TraverseDOMTree(FILE* fileStream, int j; for (j=0; jGetAttribute(attName, attValue); if (NS_SUCCEEDED(result) && (attValue.Length() > 0)) { diff --git a/mozilla/extensions/xmlterm/base/mozXMLTermSession.h b/mozilla/extensions/xmlterm/base/mozXMLTermSession.h index 2c459fc758f..a28275ace2a 100644 --- a/mozilla/extensions/xmlterm/base/mozXMLTermSession.h +++ b/mozilla/extensions/xmlterm/base/mozXMLTermSession.h @@ -103,6 +103,11 @@ class mozXMLTermSession */ NS_IMETHOD SetPrompt(const PRUnichar* aPrompt); + /** Gets flag denoting whether terminal is in full screen mode + * @param aFlag (output) screen mode flag + */ + NS_IMETHOD GetScreenMode(PRBool* aFlag); + protected: /** ShellML element type (see ShellML documentation), @@ -126,7 +131,6 @@ protected: /** allowed user-generated input event type */ enum SessionEventType { CLICK_EVENT = 0, - DBLCLICK_EVENT, SESSION_EVENT_TYPES }; diff --git a/mozilla/extensions/xmlterm/base/mozXMLTermShell.cpp b/mozilla/extensions/xmlterm/base/mozXMLTermShell.cpp index 2650810b4c8..4f75b9f46c5 100644 --- a/mozilla/extensions/xmlterm/base/mozXMLTermShell.cpp +++ b/mozilla/extensions/xmlterm/base/mozXMLTermShell.cpp @@ -385,10 +385,6 @@ mozXMLTermShell::NewXMLTermWindow(const PRUnichar* args, XMLT_LOG(mozXMLTermShell::NewXMLTermWindow,0,("check0, topWin=0x%x\n", (int) topWin.get())); - // Determine preferences - nsCOMPtr prefs = nsnull; - result = mContentAreaDocShell->GetPrefs(getter_AddRefs(prefs)); - #ifdef NEW_XMLTERM_IMP // Test C++ NewXMLTerm implementation PRInt32 width = 760; PRInt32 height = 400; diff --git a/mozilla/extensions/xmlterm/base/mozXMLTerminal.cpp b/mozilla/extensions/xmlterm/base/mozXMLTerminal.cpp index 1aec270ac6a..3ed8e1c7cba 100644 --- a/mozilla/extensions/xmlterm/base/mozXMLTerminal.cpp +++ b/mozilla/extensions/xmlterm/base/mozXMLTerminal.cpp @@ -38,6 +38,7 @@ #include "nsIObserver.h" #include "nsIPresContext.h" +#include "nsICaret.h" #include "nsIDOMEventReceiver.h" #include "nsIDOMEventListener.h" @@ -456,6 +457,8 @@ NS_IMETHODIMP mozXMLTerminal::Activate(void) return NS_ERROR_FAILURE; } + // Show caret + ShowCaret(); // Instantiate LineTerm XMLT_LOG(mozXMLTerminal::Activate,22,("instantiating lineterm\n")); @@ -603,6 +606,30 @@ NS_IMETHODIMP mozXMLTerminal::SendText(const nsString& aString, return NS_OK; } +/** Shows the caret and make it editable. + */ +NS_IMETHODIMP mozXMLTerminal::ShowCaret(void) +{ + // In principle, this method needs to be called only once; + // in practice, certain operations seem to hide the caret + // especially when one starts mucking around with the display: + // style property. + // Under those circumstances, call this method to re-display the caret. + + if (!mPresShell) + return NS_ERROR_FAILURE; + + mPresShell->SetCaretEnabled(PR_TRUE); + + nsCOMPtr caret; + if (NS_SUCCEEDED(mPresShell->GetCaret(getter_AddRefs(caret)))) { + caret->SetCaretVisible(PR_TRUE); + caret->SetCaretReadOnly(PR_FALSE); + } + + return NS_OK; +} + // Paste data from clipboard to terminal NS_IMETHODIMP mozXMLTerminal::Paste() @@ -747,6 +774,15 @@ NS_IMETHODIMP mozXMLTerminal::GetPresShell(nsIPresShell** aPresShell) } +/** Gets flag denoting whether terminal is in full screen mode + * @param aFlag (output) screen mode flag + */ +NS_IMETHODIMP mozXMLTerminal::GetScreenMode(PRBool* aFlag) +{ + return mXMLTermSession->GetScreenMode(aFlag); +} + + /** Checks if supplied cookie is valid for XMLTerm * @param aCookie supplied cookie string * @param _retval true if supplied cookie matches XMLTerm cookie diff --git a/mozilla/extensions/xmlterm/base/mozXMLTerminal.h b/mozilla/extensions/xmlterm/base/mozXMLTerminal.h index f7ec42ec3f9..7529d3dd7ba 100644 --- a/mozilla/extensions/xmlterm/base/mozXMLTerminal.h +++ b/mozilla/extensions/xmlterm/base/mozXMLTerminal.h @@ -79,10 +79,14 @@ class mozXMLTerminal : public mozIXMLTerminal, NS_IMETHOD GetPresShell(nsIPresShell** aPresShell); + NS_IMETHOD GetScreenMode(PRBool* aFlag); + NS_IMETHOD MatchesCookie(const PRUnichar* aCookie, PRBool *_retval); NS_IMETHOD Resize(void); + NS_IMETHOD ShowCaret(void); + // nsIDocumentLoaderObserver interface NS_DECL_NSIDOCUMENTLOADEROBSERVER diff --git a/mozilla/extensions/xmlterm/doc/BUGS b/mozilla/extensions/xmlterm/doc/BUGS index b310475b66f..8af04838376 100644 --- a/mozilla/extensions/xmlterm/doc/BUGS +++ b/mozilla/extensions/xmlterm/doc/BUGS @@ -1,7 +1,7 @@ Known bugs ---------- -29 Feb 2000 +12 Mar 2000 1. Mozilla bug (Solaris only): The cursor has disappeared! (also in Composer) @@ -18,10 +18,16 @@ Known bugs on the window moves it up (very annoying). Mitigated by a WORKAROUND in mozXMLTermMouseListener::MouseClick. -5. XMLterm bug: Arrow keys are bound to EMACS-style control characters; - do not work with VI +5. XMLterm/DOM bug: As new commands are typed in, scrolling is jerky. For + example, type a few non-trivial commands interspersed with several + trivial commands (i.e., just pressing ENTER key). The output from the + earlier non-trivial commands sometimes jumps downwards instead of moving + monotonically upwards. (Does it have anything to do with deletion of + earlier DOM entries?) -6. LTERM/NCURSES bug: Executing "emacs -nw" in the NCURSES version of LTERM +6. XMLterm bug: Arrow keys are hard-wired to particular escape sequences. + +7. LTERM/NCURSES bug: Executing "emacs -nw" in the NCURSES version of LTERM results in LTERM exiting abnormally when user exits emacs. An interrupt error seems to occur while polling for output in ltermRead. diff --git a/mozilla/extensions/xmlterm/doc/INSTALL.xmlterm b/mozilla/extensions/xmlterm/doc/INSTALL.xmlterm index 8be8acf3db6..04065be6207 100644 --- a/mozilla/extensions/xmlterm/doc/INSTALL.xmlterm +++ b/mozilla/extensions/xmlterm/doc/INSTALL.xmlterm @@ -6,7 +6,7 @@ XMLterm installation instructions for Linux binaries *NOTE* This plain text INSTALL file may be out date. Please check for the most recent information. -28 Feb 2000 +7 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" @@ -56,15 +56,15 @@ XMLterm installation instructions for Linux binaries (Of course, the appearance of XMLterm is completely configurable using the CSS stylesheet chrome://xmlterm/skin/default/xmlterm.css) - Double-clicking is used to activate all XMLterm features, except for - underlined hyperlinks, which are activated by a single click as in a - browser. - - After typing one or two commands, double-click on the prompt string of any - previous command to see what happens! Then double-click again on the same + 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 diff --git a/mozilla/extensions/xmlterm/doc/Makefile.in b/mozilla/extensions/xmlterm/doc/Makefile.in new file mode 100644 index 00000000000..4bee478ce6a --- /dev/null +++ b/mozilla/extensions/xmlterm/doc/Makefile.in @@ -0,0 +1,61 @@ +#!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 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/doc 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 ../config/xmlterm_config.mk + +include $(topsrcdir)/config/rules.mk + +XMLTERM_DOCS = \ + $(srcdir)/INSTALL.xmlterm \ + $(NULL) + +install:: + $(INSTALL) -m 555 $(XMLTERM_DOCS) $(DIST)/bin diff --git a/mozilla/extensions/xmlterm/geckoterm/mozSimpleContainer.cpp b/mozilla/extensions/xmlterm/geckoterm/mozSimpleContainer.cpp index e71453cc2bc..90ea5ee26db 100644 --- a/mozilla/extensions/xmlterm/geckoterm/mozSimpleContainer.cpp +++ b/mozilla/extensions/xmlterm/geckoterm/mozSimpleContainer.cpp @@ -173,7 +173,7 @@ NS_IMETHODIMP mozSimpleContainer::Init(nsNativeWidget aNativeWidget, webShell->Init(aNativeWidget, 0, 0, width, height); if (aPref) { - mDocShell->SetPrefs(aPref); + //mDocShell->SetPrefs(aPref); } nsCOMPtr docShellWin(do_QueryInterface(mDocShell)); diff --git a/mozilla/extensions/xmlterm/scripts/Makefile.in b/mozilla/extensions/xmlterm/scripts/Makefile.in index 7e48c3de9a0..6ae45f4d587 100644 --- a/mozilla/extensions/xmlterm/scripts/Makefile.in +++ b/mozilla/extensions/xmlterm/scripts/Makefile.in @@ -54,6 +54,7 @@ include ../config/xmlterm_config.mk include $(topsrcdir)/config/rules.mk XMLTERM_SCRIPTS = \ + $(srcdir)/menuhack \ $(srcdir)/xmlterm \ $(srcdir)/xls \ $(srcdir)/xcat \ diff --git a/mozilla/extensions/xmlterm/scripts/xls b/mozilla/extensions/xmlterm/scripts/xls index f649b7318b8..bc635f52888 100755 --- a/mozilla/extensions/xmlterm/scripts/xls +++ b/mozilla/extensions/xmlterm/scripts/xls @@ -1,6 +1,6 @@ #!/usr/bin/perl # xls: an XMLterm wrapper for the UNIX "ls" command -# Usage: xls [-c|--cols] [-h|help] [-i||--iconic] [-w|--window] +# Usage: xls [-c|--cols] [-h|help] [-n||--noicons] [-w|--window] use Cwd; use Getopt::Long; @@ -9,10 +9,10 @@ Getopt::Long::config('bundling'); my $options = "@ARGV"; -&GetOptions("cols|c=i", "help|h!", "iconic|i!", "window|w!"); +&GetOptions("cols|c=i", "help|h!", "noicons|n!", "window|w!"); if ($opt_help) { - print "Usage: xls [-c|--cols] [-i|--iconic] [-w|--window]\n"; + print "Usage: xls [-c|--cols] [-n||--noicons] [-w|--window]\n"; exit; } @@ -36,6 +36,7 @@ my $dir = cwd(); my $rowimg = ""; my $rowtxt = ""; my $nfile = 0; + foreach $file (glob("*")) { # for each file in current directory $file =~ m%\A(.*?) (\.[^/.]*)?\Z%x # Deconstruct file name or die "xls: Internal error; unable to deconstruct file name\n"; @@ -141,7 +142,7 @@ foreach $file (glob("*")) { # for each file in current directory $nfile++; if (($nfile % $ncols) == 0) { # print complete table row - print "$rowimg" if ($opt_iconic) ; + print "$rowimg" unless $opt_noicons; print "$rowtxt"; $rowimg = ""; $rowtxt = ""; @@ -150,7 +151,7 @@ foreach $file (glob("*")) { # for each file in current directory } if ($rowtxt) { - print "$rowimg" if ($opt_iconic) ; + print "$rowimg" unless $opt_noicons; print "$rowtxt"; } diff --git a/mozilla/extensions/xmlterm/scripts/xmlterm b/mozilla/extensions/xmlterm/scripts/xmlterm index 8132e398699..2faca039567 100755 --- a/mozilla/extensions/xmlterm/scripts/xmlterm +++ b/mozilla/extensions/xmlterm/scripts/xmlterm @@ -1,25 +1,34 @@ #!/bin/sh -# Script to invoke XMLterm from mozilla/dist/bin -# (or from anywhere in the mozilla source tree) +# Script to invoke XMLterm +# 1) as ./xmlterm from mozilla/dist/bin or the package directory, or +# 2) as xmlterm (invoking /usr/bin/xmlterm), if installed with RPM, or +# 3) as xmlterm, if dist/bin or package directory has been included in PATH XMLTERM_CHROME="xmlterm.xul" MOZILLA_BIN="./mozilla-bin" -MOZILLA_DIR="" +# Determine command prefix +PREFIX=$(dirname $0) -if [ -d components -a -d res ] +if [ "$PREFIX" = "." ] then - # Running from dist/bin - MOZILLA_DIR="./" + # Assume running in dist/bin or package directory (useful for testing) + MOZILLA_DIR=$(pwd) + else - # Running from source dir - if [ -f Makefile.in ] - then - MOZILLA_DIR=`grep -w DEPTH Makefile.in | grep -e "\.\." | tail -1 | awk -F"=" '{ print $2; }'`/dist/bin - else - # Running from elsewhere - MOZILLA_DIR="${MOZILLA_FIVE_HOME:?}" - fi + MOZILLA_DIR="" + + if [ -f /bin/rpm -a -f /usr/bin/xmlterm ] + then + # Try to find installation directory using RPM + MOZILLA_DIR=$(rpm -q --queryformat "%{INSTALLPREFIX}" xmlterm) + fi + + if [ ${#MOZILLA_DIR} -eq 0 ] + then + # Assume command prefix points to mozilla directory + MOZILLA_DIR=$PREFIX + fi fi echo cd $MOZILLA_DIR diff --git a/mozilla/extensions/xmlterm/scripts/xmlterm.spec b/mozilla/extensions/xmlterm/scripts/xmlterm.spec new file mode 100644 index 00000000000..55ff3b1a525 --- /dev/null +++ b/mozilla/extensions/xmlterm/scripts/xmlterm.spec @@ -0,0 +1,78 @@ +Name: xmlterm +Version: M14 +Release: 1 +Summary: A graphical command line interface using Mozilla +Copyright: Mozilla Public License 1.1 +Group: User Interface/X +Source: http://xmlterm.org/xmlterm-source-Mar7-M14.tar.gz +URL: http://xmlterm.org/ +Vendor: xmlterm.org +Packager: R. Saravanan +Prefix: /usr/src/redhat/BUILD/package + +AutoReqProv: no + +%description + + XMLterm: A graphical command line interface using Mozilla + +%prep + +%build + +%install +rm -fr xmlterm.tgz package +tar czvhf xmlterm.tgz \ + -C /home/svn/mozilla/dist/bin \ + INSTALL.xmlterm xmlterm xcat xls geckoterm menuhack \ + components/libxmlterm.so \ + components/xmlterm.xpt \ + chrome/xmlterm +mkdir package +cd package +tar zxvf ../xmlterm.tgz + +chown -R root.root . +chmod -R a+rX,g-w,o-w . + +%clean +rm -fr xmlterm.tgz package + +%pre +cd $RPM_INSTALL_PREFIX +if [ ! -f run-mozilla.sh ] +then + echo "*ERROR* Specify the mozilla package directory using the RPM prefix option" + echo " rpm --prefix /path/package ..." + exit 1 +fi + +%post +for FILE in xmlterm xcat xls geckoterm +do + ln -s $RPM_INSTALL_PREFIX/$FILE /usr/bin/$FILE +done + +cd $RPM_INSTALL_PREFIX +rm -f component.reg +##./menuhack + +%postun +for FILE in xmlterm xcat xls geckoterm +do + rm /usr/bin/$FILE +done + +%files + +/usr/src/redhat/BUILD/package/INSTALL.xmlterm +/usr/src/redhat/BUILD/package/xmlterm +/usr/src/redhat/BUILD/package/xcat +/usr/src/redhat/BUILD/package/xls +/usr/src/redhat/BUILD/package/geckoterm +/usr/src/redhat/BUILD/package/menuhack +/usr/src/redhat/BUILD/package/components/libxmlterm.so +/usr/src/redhat/BUILD/package/components/xmlterm.xpt +/usr/src/redhat/BUILD/package/chrome/xmlterm + +%changelog diff --git a/mozilla/extensions/xmlterm/ui/content/Makefile.in b/mozilla/extensions/xmlterm/ui/content/Makefile.in index 5dcad8d39ef..d2291d20708 100644 --- a/mozilla/extensions/xmlterm/ui/content/Makefile.in +++ b/mozilla/extensions/xmlterm/ui/content/Makefile.in @@ -57,7 +57,10 @@ EXPORT_RESOURCE_CONTENT = \ $(srcdir)/xmlterm.html \ $(srcdir)/xmlterm.xul \ $(srcdir)/xmlterm2.xul \ + $(srcdir)/XMLTermChrome.js \ $(srcdir)/XMLTermCommands.js \ + $(srcdir)/xmltermTips.html \ + $(srcdir)/xmltermAbout.html \ $(srcdir)/xmltblank.html \ $(NULL) diff --git a/mozilla/extensions/xmlterm/ui/content/XMLTermChrome.js b/mozilla/extensions/xmlterm/ui/content/XMLTermChrome.js new file mode 100644 index 00000000000..9557728890f --- /dev/null +++ b/mozilla/extensions/xmlterm/ui/content/XMLTermChrome.js @@ -0,0 +1,38 @@ +// XMLTerm Chrome Commands + +function StartupXMLTerm() { + dump("StartupXMLTerm:\n"); + dump("StartupXMLTerm:"+window.frames.length+"\n"); + dump("StartupXMLTerm:"+window.frames[0].name+"\n"); + + if (window.frames.length == 2) { + xmltwin = window.frames[1]; + xmltwin.xmltbrowser = window.frames[0]; + } else { + xmltwin = window.frames[0]; + } + + dump("StartupXMLterm: WINDOW.ARGUMENTS="+window.arguments+"\n"); + + dump("Trying to make an XMLTerm Shell through the component manager...\n"); + + var xmltshell = Components.classes["component://mozilla/xmlterm/xmltermshell"].createInstance(); + + dump("Interface xmltshell1 = " + xmltshell + "\n"); + + xmltshell = xmltshell.QueryInterface(Components.interfaces.mozIXMLTermShell); + dump("Interface xmltshell2 = " + xmltshell + "\n"); + + if (!xmltshell) { + dump("Failed to create XMLTerm shell\n"); + window.close(); + return; + } + + // Store the XMLTerm shell in current window and in the XMLTerm frame + window.xmlterm = xmltshell; + xmltwin.xmlterm = xmltshell; + + // Initialize XMLTerm shell in content window with argvals + window.xmlterm.Init(xmltwin, "", window.arguments); +} diff --git a/mozilla/extensions/xmlterm/ui/content/XMLTermCommands.js b/mozilla/extensions/xmlterm/ui/content/XMLTermCommands.js index eb75775a75e..0631b8e307e 100644 --- a/mozilla/extensions/xmlterm/ui/content/XMLTermCommands.js +++ b/mozilla/extensions/xmlterm/ui/content/XMLTermCommands.js @@ -1,36 +1,634 @@ -function StartupXMLTerm() { - dump("StartupXMLTerm:\n"); - dump("StartupXMLTerm:"+window.frames.length+"\n"); - dump("StartupXMLTerm:"+window.frames[0].name+"\n"); +// XMLTerm Page Commands - if (window.frames.length == 2) { - xmltwin = window.frames[1]; - xmltwin.xmltbrowser = window.frames[0]; - } else { - xmltwin = window.frames[0]; - } +// CONVENTION: All pre-defined XMLTerm Javascript functions +// begin with an upper letter. This allows +// an easy distinction with user defined functions, +// which should begin with a lower case letter. - dump("StartupXMLterm: WINDOW.ARGUMENTS="+window.arguments+"\n"); +// Global variables +var altwin; // Alternate (browser) window - dump("Trying to make an XMLTerm Shell through the component manager...\n"); +var tips = new Array(); // Usage tip strings +var tipnames = new Array(); // Usage tip names +var tipCount = 0; // No. of tips +var selectedTip = 0; // Selected random tip - var xmltshell = Components.classes["component://mozilla/xmlterm/xmltermshell"].createInstance(); - - dump("Interface xmltshell1 = " + xmltshell + "\n"); - - xmltshell = xmltshell.QueryInterface(Components.interfaces.mozIXMLTermShell); - dump("Interface xmltshell2 = " + xmltshell + "\n"); - - if (!xmltshell) { - dump("Failed to create XMLTerm shell\n"); - window.close(); - return; - } - - // Store the XMLTerm shell in current window and in the XMLTerm frame - window.xmlterm = xmltshell; - xmltwin.xmlterm = xmltshell; - - // Initialize XMLTerm shell in content window with argvals - window.xmlterm.Init(xmltwin, "", window.arguments); +// Set prompt using form entry +function DefineTip(tip, name) { + tips[tipCount] = tip; + tipnames[tipCount] = name; + tipCount++; + return; } + +DefineTip('Click the new tip link to the left to get a new tip!', + 'new-tip'); + +DefineTip('User level setting (at the top) controls amount of help information', + 'level-setting'); + +DefineTip('Mode setting controls if double clicking a directory/executable opens a new window', + 'mode-setting'); + +DefineTip('Icons setting controls whether directory listings use icons', + 'icons-setting'); + +DefineTip('Single click an explicit (underlined) hyperlink; double click implicit (usually blue) hyperlinks', + 'double-click'); + +DefineTip('Click the SetPrompt button to use a cool Mozilla prompt from dmoz.org!', + 'set-prompt-moz'); + +DefineTip('"js:SetPrompt(HTMLstring);" sets prompt to HTML string.', + 'set-prompt'); + +DefineTip('Type "js:func(arg);" to execute inline Javascript function func.', + 'inline-js'); + +DefineTip('Inline Javascript ("js:...") can be used to produce HTML output.', + 'js-html'); + +DefineTip('XMLterm supports full screen commands like "vi", "emacs -nw", and "less".', + 'full-screen'); + +DefineTip('Use "xls -i" for iconic display of directory contents.', + 'xls-i'); + +DefineTip('Use "xcat file" to display file.', + 'xcat'); + +// Display random usage tip +// (should cease to operate after a few cycles; +// need to use Prefs to keep track of that) +function NewTip() { + var ranval = Math.random(); + selectedTip = Math.floor(ranval * tipCount); + if (selectedTip >= tipCount) selectedTip = 0; + + dump("xmlterm: NewTip "+selectedTip+","+ranval+"\n"); + + var tipdata = document.getElementById('tipdata'); + tipdata.firstChild.data = tips[selectedTip]; + + ShowHelp("",0); + + return false; +} + +// Explain tip +function ExplainTip(tipName) { + dump("xmlterm: ExplainTip("+tipName+")\n"); + + if (tipName) { + var tipdata = document.getElementById('tipdata'); + tipdata.firstChild.data = ""; + } else { + tipName = tipnames[selectedTip]; + } + + ShowHelp('xmltermTips.html#'+tipName,0,120); + + return false; +} + +// F1 key - Hide all output +function F1Key(isShift, isControl) { + return DisplayAllOutput(false); +} + +// F2 key - Show all output +function F2Key(isShift, isControl) { + return DisplayAllOutput(true); +} + +// F7 - Explain tip +function F7Key(isShift, isControl) { + return ExplainTip(); +} + +// F8 - New tip +function F8Key(isShift, isControl) { + return NewTip(); +} + +// F9 key +function F9Key(isShift, isControl) { + return NewXMLTerm(''); +} + +// Scroll Home key +function ScrollHomeKey(isShift, isControl) { + dump("ScrollHomeKey("+isShift+","+isControl+")\n"); + if (isShift && window.xmltbrowser) { + window.xmltbrowser.scroll(0,0); + } else { + window.scroll(0,0); + } + return false; +} + +// Scroll End key +function ScrollEndKey(isShift, isControl) { + dump("ScrollEndKey("+isShift+","+isControl+")\n"); + if (isShift && window.xmltbrowser) { + window.xmltbrowser.scroll(0,9999); + } else { + window.scroll(0,9999); + } + return false; +} + +// Scroll PageUp key +function ScrollPageUpKey(isShift, isControl) { + dump("ScrollPageUpKey("+isShift+","+isControl+")\n"); + + if (isShift && window.xmltbrowser) { + window.xmltbrowser.scrollBy(0,-300); + } else { + window.scrollBy(0,-300); + } + return false; +} + +// Scroll PageDown key +function ScrollPageDownKey(isShift, isControl) { + dump("ScrollPageDownKey("+isShift+","+isControl+")\n"); + if (isShift && window.xmltbrowser) { + window.xmltbrowser.scrollBy(0,300); + } else { + window.scrollBy(0,300); + } + return false; +} + +// Set history buffer size +function SetHistory(value) { + dump("SetHistory("+value+")\n"); + window.xmlterm.SetHistory(value, document.cookie); + return (false); +} + +// Set prompt +function SetPrompt(value) { + dump("SetPrompt("+value+")\n"); + window.xmlterm.SetPrompt(value, document.cookie); + return (false); +} + +// Create new XMLTerm window +function NewXMLTerm(firstcommand) { + newwin = window.openDialog( "chrome://xmlterm/content/xmlterm.xul", + "xmlterm", "chrome,dialog=no,resizable", + firstcommand); + //newwin = window.xmlterm.NewXMLTermWindow(firstcommand); + dump("NewXMLTerm: "+newwin+"\n") + return (false); +} + +// Handle resize events +function Resize(event) { + dump("Resize()\n"); + window.xmlterm.Resize(); + return (false); +} + +// Form Focus (workaround for form input being transmitted to xmlterm) +function FormFocus() { + dump("FormFocus()\n"); + window.xmlterm.IgnoreKeyPress(true, document.cookie); + return false; +} + +// Form Blur (workaround for form input being transmitted to xmlterm) +function FormBlur() { + dump("FormBlur()\n"); + window.xmlterm.IgnoreKeyPress(false, document.cookie); + return false; +} + +// Set user level +function UpdateSettings() { + + var oldUserLevel = window.userLevel; + window.userLevel = document.xmltform1.level.options[document.xmltform1.level.selectedIndex].value; + + var oldShowIcons = window.showIcons; + window.showIcons = document.xmltform1.icons.options[document.xmltform1.icons.selectedIndex].value; + + window.commandMode = document.xmltform1.mode.options[document.xmltform1.mode.selectedIndex].value; + + dump("UpdateSettings: userLevel="+window.userLevel+"\n"); + dump("UpdateSettings: commandMode="+window.commandMode+"\n"); + dump("UpdateSettings: showIcons="+window.showIcons+"\n"); + + if (window.userLevel != oldUserLevel) { + // Change icon display style in the style sheet + + if (window.userLevel == "advanced") { + AlterStyle("DIV.beginner", "display", "none"); + AlterStyle("DIV.intermediate", "display", "none"); + + } else if (window.userLevel == "intermediate") { + AlterStyle("DIV.intermediate", "display", "block"); + AlterStyle("DIV.beginner", "display", "none"); + + } else { + AlterStyle("DIV.beginner", "display", "block"); + AlterStyle("DIV.intermediate", "display", "block"); + } + } + + if (window.showIcons != oldShowIcons) { + // Change icon display style in the style sheet + if (window.showIcons == "on") { + AlterStyle("SPAN.noicons", "display", "none"); + AlterStyle("TR.icons", "display", "table-row"); + AlterStyle("IMG.icons", "display", "inline"); + } else { + AlterStyle("SPAN.noicons", "display", "inline"); + AlterStyle("TR.icons", "display", "none"); + AlterStyle("IMG.icons", "display", "none"); + } + } + + return false; +} + +// Alter style in stylesheet of specified document doc, or current document +// if doc is omitted. +function AlterStyle(ruleName, propertyName, propertyValue, doc) { + + dump("AlterStyle("+ruleName+"{"+propertyName+":"+propertyValue+"})\n"); + + if (!doc) doc = window.document; + + var sheet = doc.styleSheets[0]; + var r; + for (r = 0; r < sheet.cssRules.length; r++) { + //dump(sheet.cssRules[r].selectorText+"\n"); + + if (sheet.cssRules[r].selectorText == ruleName) { + var style = sheet.cssRules[r].style; + //dump("style="+style.getPropertyValue(propertyName)+"\n"); + + style.setProperty(propertyName,propertyValue,""); + } + } + return false; +} + +// Handle default meta command +function MetaDefault(arg1) { + return Load("http://"+arg1); +} + +// Load URL in XMLTermBrowser window +function Load(url) { + var succeeded = false; + if (window.xmltbrowser) { + dump("Load:xmltbrowser.location.href="+window.xmltbrowser.location.href+"\n"); + if (window.xmltbrowser.location.href.length) { + window.xmltbrowser.location = url; + succeeded = true; + } + } + if (!succeeded) { + window.xmltbrowser = window.open(url, "xmltbrowser"); + } + + // Save browser window object in global variable + altwin = window.xmltbrowser; + + return (false); +} + +// Control display of all output elements +function DisplayAllOutput(flag) { + var outputElements = document.getElementsByName("output"); + for (i=0; i=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) +// +function HandleEvent(eventObj, eventType, targetType, entryNumber, + arg1, arg2) { + dump("HandleEvent("+eventObj+","+eventType+","+targetType+","+ + entryNumber+","+arg1+","+arg2+")\n"); + + // Entry independent targets + if (action === "textlink") { + // Single click opens hyperlink + // Browser-style + dump("textlink = "+arg1+"\n"); + Load(arg1); + + } else if (targetType === "prompt") { + // Single click on prompt expands/collapses command output + var outputElement = document.getElementById("output"+entryNumber); + var helpElement = document.getElementById("help"+entryNumber); + var promptElement = document.getElementById("prompt"+entryNumber); + //dump(promptElement.style.getPropertyValue("text-decoration")); + + if (outputElement.style.display == "none") { + outputElement.style.display = "block"; + promptElement.style.setProperty("text-decoration","none",""); + + } else { + outputElement.style.display = "none"; + promptElement.style.setProperty("text-decoration","underline",""); + if (helpElement) { + ShowHelp("",entryNumber); + } + } + + } else if (eventType === "click") { + + dump("clickCount="+eventObj.clickCount+"\n"); + + var dblClick = (eventObj.clickCount > 1); + + // Execute shell commands only on double-click for safety + // Use single click for "selection" and prompt expansion only + // Windows-style + if (!dblClick) + return false; + + if (targetType === "command") { + var commandElement = document.getElementById(targetType+entryNumber); + var command = commandElement.firstChild.data; + window.xmlterm.SendText("\025"+command+"\n", document.cookie); + + } else { + // Targets which may be qualified only for current entry + + if ((entryNumber >= 0) && + (window.xmlterm.currentEntryNumber != entryNumber)) { + dump("NOT CURRENT COMMAND\n"); + return (false); + } + + var action = targetType; + + if (action === "exec") { + if (window.commandMode === "window") { + action = "createln"; + } else { + action = "sendln"; + } + } + + if (action === "send") { + dump("send = "+arg1+"\n"); + window.xmlterm.SendText(arg1, 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); + } + + } else if (action === "createln") { + dump("createln = "+arg1+"\n\n"); + newwin = NewXMLTerm(arg1+"\n"); + } + } + } + + return (false); +} + +// Set history buffer count using form entry +function SetHistoryValue() { + var field = document.getElementById('InputValue'); + return SetHistory(field.value); +} + +// Set prompt using form entry +function SetPromptValue() { + var field = document.getElementById('InputValue'); + return SetPrompt(field.value); +} + +// Insert help element displaying URL in an IFRAME before output element +// of entryNumber, or before the SESSION element if entryNumber is zero. +// Height is the height of the IFRAME in pixels. +// If URL is the null string, simply delete the help element + +function ShowHelp(url, entryNumber, height) { + + if (!height) height = 120; + + dump("xmlterm: ShowHelp("+url+","+entryNumber+","+height+")\n"); + + if (entryNumber) { + beforeID = "output"+entryNumber; + helpID = "help"+entryNumber; + } else { + beforeID = "session"; + helpID = "help"; + } + + var beforeElement = document.getElementById(beforeID); + + if (!beforeElement) { + dump("InsertIFrame: beforeElement ID="+beforeID+"not found\n"); + return false; + } + + var parentNode = beforeElement.parentNode; + + var helpElement = document.getElementById(helpID); + if (helpElement) { + // Delete help element + parentNode.removeChild(helpElement); + helpElement = null; + // *NOTE* Need to flush display here to avoid black flash? + } + + if (url.length > 0) { + // Create new help element + helpElement = document.createElement("div"); + helpElement.setAttribute('id', helpID); + helpElement.setAttribute('class', 'help'); + + var closeElement = document.createElement("span"); + closeElement.setAttribute('class', 'helplink'); + closeElement.appendChild(document.createTextNode("Close help frame")); + //closeElement.appendChild(document.createElement("p")); + + var iframe = document.createElement("iframe"); + iframe.setAttribute('id', helpID+'frame'); + iframe.setAttribute('class', 'helpframe'); + iframe.setAttribute('width', '100%'); + iframe.setAttribute('height', height); + iframe.setAttribute('frameborder', '0'); + iframe.setAttribute('src', url); + + helpElement.appendChild(iframe); + helpElement.appendChild(closeElement); + + dump(helpElement); + + // Insert help element + parentNode.insertBefore(helpElement, beforeElement); + + // NOTE: Need to do this *after* node is inserted into document + closeElement.setAttribute('onClick', 'return ShowHelp("",'+entryNumber + +');'); + } + + return false; +} + +// About XMLTerm +function AboutXMLTerm() { + dump("xmlterm: AboutXMLTerm\n"); + + var tipdata = document.getElementById('tipdata'); + tipdata.firstChild.data = ""; + + ShowHelp('xmltermAbout.html',0,120); + + return false; +} + +// onLoad event handler +function LoadHandler() { + dump("xmlterm: LoadHandler ... "+window.xmlterm+"\n"); + + // Update settings + UpdateSettings(); + + NewTip(); + + if (window.xmlterm) { + // XMLTerm already initialized + return (false); + } + + dump("LoadHandler: WINDOW.ARGUMENTS="+window.arguments+"\n"); + + dump("Trying to make an XMLTerm Shell through the component manager...\n"); + + var xmltshell = Components.classes["component://mozilla/xmlterm/xmltermshell"].createInstance(); + + dump("Interface xmltshell1 = " + xmltshell + "\n"); + + xmltshell = xmltshell.QueryInterface(Components.interfaces.mozIXMLTermShell); + dump("Interface xmltshell2 = " + xmltshell + "\n"); + + if (!xmltshell) { + dump("Failed to create XMLTerm shell\n"); + window.close(); + return; + } + + // Store the XMLTerm shell in the window + window.xmlterm = xmltshell; + + // Content window same as current window + var contentWindow = window; + + // Initialize XMLTerm shell in content window with argvals + window.xmlterm.Init(contentWindow, "", ""); + + //dump("LoadHandler:"+document.cookie+"\n"); + + dump("contentWindow="+contentWindow+"\n"); + dump("document="+document+"\n"); + dump("documentElement="+document.documentElement+"\n"); + + // Handle resize events + //contentWindow.addEventListener("onresize", Resize); + contentWindow.onresize = Resize; + + // Set focus to appropriate frame + contentWindow.focus(); + + //contentWindow.xmlterm = xmlterm; + + //dump(contentWindow.xmlterm); + + // The following code is for testing IFRAMEs only + dump("[Main] "+window+"\n"); + dump(window.screenX+", "+window.screenY+"\n"); + dump(window.scrollX+", "+window.scrollY+"\n"); + dump(window.pageXOffset+", "+window.pageYOffset+"\n"); + + dump("IFRAME checks\n"); + var iframe = document.getElementById('iframe1'); + + dump("iframe="+iframe+"\n"); + + frames=document.frames; + dump("frames="+frames+"\n"); + dump("frames.length="+frames.length+"\n"); + + framewin = frames[0]; + + dump("framewin="+framewin+"\n"); + dump("framewin.document="+framewin.document+"\n"); + + dump(framewin.screenX+", "+framewin.screenY+"\n"); + dump(framewin.scrollX+", "+framewin.scrollY+"\n"); + dump(framewin.pageXOffset+", "+framewin.pageYOffset+"\n"); + + var body = framewin.document.getElementsByTagName("BODY")[0]; + dump("body="+body+"\n"); + + var height= body.scrollHeight; + dump("height="+height+"\n"); + +// iframe.height = 800; +// iframe.width = 700; + +// framewin.sizeToContent(); + + framewin.xmltshell = xmltshell; + dump(framewin.xmltshell+"\n"); + + dump("xmlterm: LoadHandler completed\n"); + return (false); +} + diff --git a/mozilla/extensions/xmlterm/ui/content/xmlterm.html b/mozilla/extensions/xmlterm/ui/content/xmlterm.html index 03f619b1903..d3fd83e2300 100644 --- a/mozilla/extensions/xmlterm/ui/content/xmlterm.html +++ b/mozilla/extensions/xmlterm/ui/content/xmlterm.html @@ -1,472 +1,123 @@ - - - - XMLterm Page + + + + xmlterm page - + - + - + - + - - -
-
- - - - - -
- Input Value: - -
-
+
-   -   + + +   + + Level: + + +   + + Icons: + + +   + + Mode: + - -More tips/news - -

-

-
+   + + About XMLTerm + +
+
- - +
+ +
+
+
Keyboard shortcuts
+ + + +
F1 + F2 + F7 + F8 + F9 +
+ + + + +
+
+ + + Value: + +
+
+
+ + +
+ + New Tip: + + + +   + + + + Explain Tip + +
+ +
+ +
+ + +
+
+ + + diff --git a/mozilla/extensions/xmlterm/ui/content/xmlterm.xul b/mozilla/extensions/xmlterm/ui/content/xmlterm.xul index f90dc22cc31..7fb9070137d 100644 --- a/mozilla/extensions/xmlterm/ui/content/xmlterm.xul +++ b/mozilla/extensions/xmlterm/ui/content/xmlterm.xul @@ -30,7 +30,7 @@ onload="StartupXMLTerm();" title="xmlterm" align="vertical" width="740" height="484"> - + diff --git a/mozilla/extensions/xmlterm/ui/content/xmltermAbout.html b/mozilla/extensions/xmlterm/ui/content/xmltermAbout.html new file mode 100644 index 00000000000..ac2b2b99070 --- /dev/null +++ b/mozilla/extensions/xmlterm/ui/content/xmltermAbout.html @@ -0,0 +1,28 @@ + + + about xmlterm page + + + + + + + + + +
+
+ XMLterm is an Xterm-like terminal program implemented using the + Mozilla layout engine. XMLterm adds powerful graphical and hypertext + capabilities to the Xterm command line interface, while maintaining + backwards compatibility. See + http://xmlterm.org + for more information. +
+ +
+ + + diff --git a/mozilla/extensions/xmlterm/ui/content/xmltermTips.html b/mozilla/extensions/xmlterm/ui/content/xmltermTips.html new file mode 100644 index 00000000000..1192169a6f3 --- /dev/null +++ b/mozilla/extensions/xmlterm/ui/content/xmltermTips.html @@ -0,0 +1,33 @@ + + + xmlterm page + + + + + + + + + +
+
+ The tip feature provides a random usage tip every time you start-up xmlterm. +
+ Click on the New Tip link to the left, + if you would like a new tip.
+ Click on the Explain Tip link to the + right, for more information on the tip.
+ Set user Level to advanced to turn + off + tips. +
+
+ +

+ + + + diff --git a/mozilla/extensions/xmlterm/ui/skin/xmltpage.css b/mozilla/extensions/xmlterm/ui/skin/xmltpage.css index 3e92b23eb89..ce5402724b0 100644 --- a/mozilla/extensions/xmlterm/ui/skin/xmltpage.css +++ b/mozilla/extensions/xmlterm/ui/skin/xmltpage.css @@ -13,26 +13,52 @@ PRE { font-family: monaco; SPAN.prompt { color: blue } SPAN.command { color: blue } -/* Screen display */ -PRE.row { margin: 0; padding-top: 0; padding-bottom: 0 } -SPAN.row { margin: 0; padding-top: 0; padding-bottom: 0 } -SPAN.boldstyle { font-weight: bold; margin: 0; padding-top: 0; padding-bottom: 0 } -SPAN.underlinestyle { text-decoration: underline; margin: 0; padding-top: 0; padding-bottom: 0 } -SPAN.blinkstyle { font-weight: bold; margin: 0; padding-top: 0; padding-bottom: 0 } -SPAN.inversestyle { font-weight: bold; margin: 0; padding-top: 0; padding-bottom: 0 } - -/* Tips */ -SPAN.tiphead { font-family: sans-serif; font-weight: bold } -SPAN.tipdata { font-family: sans-serif } -SPAN.moretips { font-family: sans-serif; color: blue; cursor: hand; - font-weight: bold; text-decoration: underline }; - -/* Highlighting */ -DIV.textlink { font-family: monaco; color: blue; cursor: hand } -SPAN.textlink { font-family: monaco; color: blue; cursor: hand } +/* Explicit hyperlinks (underlined) */ +DIV.textlink { font-family: monaco; color: blue; cursor: hand; + text-decoration: underline } +SPAN.textlink { font-family: monaco; color: blue; cursor: hand; + text-decoration: underline } +/* Imlicit hyperlinks (highlighted) */ +SPAN.highlight { font-family: monaco; color: blue; cursor: hand } SPAN.directory { font-family: monaco; color: blue; cursor: hand } SPAN.executable { font-family: monaco; color: blue; cursor: hand } -SPAN.plainfile { font-family: monaco; color: blue; cursor: hand} -SPAN.imagefile { font-family: monaco; color: blue; cursor: hand} -SPAN.urlfile { font-family: monaco; color: blue; cursor: hand} +SPAN.plainfile { font-family: monaco; color: blue; cursor: hand } +SPAN.imagefile { font-family: monaco; color: blue; cursor: hand } +SPAN.urlfile { font-family: monaco; color: blue; cursor: hand } + +/* Screen display */ +PRE.row { margin: 0; padding-top: 0; padding-bottom: 0 } +SPAN.row { margin: 0; padding-top: 0; padding-bottom: 0 } +SPAN.boldstyle { font-weight: bold; margin: 0; + padding-top: 0; padding-bottom: 0 } +SPAN.underlinestyle { text-decoration: underline; margin: 0; + padding-top: 0; padding-bottom: 0 } +SPAN.blinkstyle { font-weight: bold; margin: 0; + padding-top: 0; padding-bottom: 0 } +SPAN.inversestyle { font-weight: bold; margin: 0; + padding-top: 0; padding-bottom: 0 } + +/* Forms */ +FORM { margin: 0; padding-top: 0; padding-bottom: 0 } +SPAN.formhead { font-family: sans-serif; font-weight: bold } + +/* Tips */ +SPAN.tipdata { font-family: sans-serif } +TABLE.tiptable { background-color: #DDDDDD } +DIV.tipelement { font-family: sans-serif } + +/* Help links */ +SPAN.helphighlight { font-family: sans-serif; color: green; cursor: hand } +SPAN.helplink { font-family: sans-serif; color: blue; cursor: hand; + text-decoration: underline} + +/* Level style */ +DIV.intermediate {display: block} +DIV.beginner {display: none} + +/* Icons style */ +TR.icons {display: none} +IMG.icons {display: none} +SPAN.icons {display: none} +SPAN.noicons {display: inline}