get contrib examples working with html attribute changes
parent
f586f5913a
commit
53d903cd23
|
@ -41,7 +41,7 @@ USE: sequences
|
||||||
#! The page has a link to the 'next' continuation.
|
#! The page has a link to the 'next' continuation.
|
||||||
[
|
[
|
||||||
swap [
|
swap [
|
||||||
<a href= a> "Next" write </a>
|
<a =href a> "Next" write </a>
|
||||||
] html-document
|
] html-document
|
||||||
] show drop drop ;
|
] show drop drop ;
|
||||||
|
|
||||||
|
@ -49,10 +49,10 @@ USE: sequences
|
||||||
#! Display a page prompting for input of a name and return that name.
|
#! Display a page prompting for input of a name and return that name.
|
||||||
[
|
[
|
||||||
"Enter your name" [
|
"Enter your name" [
|
||||||
<form method= "post" action= form>
|
<form "post" =method =action form>
|
||||||
"Name: " write
|
"Name: " write
|
||||||
<input type= "text" name= "name" size= "20" input/>
|
<input "text" =type "name" =name "20" =size input/>
|
||||||
<input type= "submit" value= "Ok" input/>
|
<input "submit" =type "Ok" =value input/>
|
||||||
</form>
|
</form>
|
||||||
] html-document
|
] html-document
|
||||||
] show [
|
] show [
|
||||||
|
|
|
@ -50,7 +50,7 @@ USE: namespaces
|
||||||
<head> <title> write </title> </head>
|
<head> <title> write </title> </head>
|
||||||
<body>
|
<body>
|
||||||
<p> write </p>
|
<p> write </p>
|
||||||
<p> <a href= a> "Press to continue" write </a> </p>
|
<p> <a =href a> "Press to continue" write </a> </p>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
] show 2drop ;
|
] show 2drop ;
|
||||||
|
@ -60,11 +60,11 @@ USE: namespaces
|
||||||
<html>
|
<html>
|
||||||
<head> <title> "Enter a number" write </title> </head>
|
<head> <title> "Enter a number" write </title> </head>
|
||||||
<body>
|
<body>
|
||||||
<form action= method= "post" form>
|
<form =action "post" =method form>
|
||||||
<p>
|
<p>
|
||||||
"Enter a number:" write
|
"Enter a number:" write
|
||||||
<input type= "text" name= "num" size= "20" input/>
|
<input "text" =type "num" =name "20" =size input/>
|
||||||
<input type= "submit" value= "Press to continue" input/>
|
<input "submit" =type "Press to continue" =value input/>
|
||||||
</p>
|
</p>
|
||||||
</form>
|
</form>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
@ -55,15 +55,15 @@ USE: sequences
|
||||||
: display-eval-form ( url -- )
|
: display-eval-form ( url -- )
|
||||||
#! Display the components for allowing entry of
|
#! Display the components for allowing entry of
|
||||||
#! factor words to be evaluated.
|
#! factor words to be evaluated.
|
||||||
<form name= "main" method= "post" action= form>
|
<form "main" =name "post" =method =action form>
|
||||||
[
|
[
|
||||||
[
|
[
|
||||||
<textarea name= "eval" rows= "10" cols= "40" textarea>
|
<textarea "eval" =name "10" =rows "40" =cols textarea>
|
||||||
"" write
|
"" write
|
||||||
</textarea>
|
</textarea>
|
||||||
]
|
]
|
||||||
[
|
[
|
||||||
<input type= "submit" value= "Evaluate" accesskey= "e" input/>
|
<input "submit" =type "Evaluate" =value "e" =accesskey input/>
|
||||||
]
|
]
|
||||||
] vertical-layout
|
] vertical-layout
|
||||||
</form>
|
</form>
|
||||||
|
@ -83,11 +83,11 @@ USE: sequences
|
||||||
: write-eval-link ( string -- )
|
: write-eval-link ( string -- )
|
||||||
#! Given text to evaluate, create an A HREF link which when
|
#! Given text to evaluate, create an A HREF link which when
|
||||||
#! clicked sets the eval textarea to that value.
|
#! clicked sets the eval textarea to that value.
|
||||||
<a href= "#" onclick= dup make-eval-javascript a> write </a> ;
|
<a "#" =href dup make-eval-javascript =onclick a> write </a> ;
|
||||||
|
|
||||||
: display-stack ( list -- )
|
: display-stack ( list -- )
|
||||||
#! Write out html to display the stack.
|
#! Write out html to display the stack.
|
||||||
<table border= "1" table>
|
<table "1" =border table>
|
||||||
<tr> <th> "Callstack" write </th> </tr>
|
<tr> <th> "Callstack" write </th> </tr>
|
||||||
[ <tr> <td> [ unparse write ] string-out write-eval-link </td> </tr> ] each
|
[ <tr> <td> [ unparse write ] string-out write-eval-link </td> </tr> ] each
|
||||||
</table> ;
|
</table> ;
|
||||||
|
@ -101,7 +101,7 @@ USE: sequences
|
||||||
|
|
||||||
: display-history ( list -- )
|
: display-history ( list -- )
|
||||||
#! Write out html to display the history.
|
#! Write out html to display the history.
|
||||||
<table border= "1" table>
|
<table "1" =border table>
|
||||||
<tr> <th> "History" write display-clear-history-link </th> </tr>
|
<tr> <th> "History" write display-clear-history-link </th> </tr>
|
||||||
[ <tr> <td> write-eval-link </td> </tr> ] each
|
[ <tr> <td> write-eval-link </td> </tr> ] each
|
||||||
</table> ;
|
</table> ;
|
||||||
|
@ -117,12 +117,12 @@ USE: sequences
|
||||||
dup dup
|
dup dup
|
||||||
{{ }} clone [
|
{{ }} clone [
|
||||||
"browser" "responder" set
|
"browser" "responder" set
|
||||||
<table border= "1" table>
|
<table "1" =border table>
|
||||||
<tr> <th colspan= "2" th> "Source" write </th> </tr>
|
<tr> <th "2" =colspan th> "Source" write </th> </tr>
|
||||||
<tr> <td colspan= "2" td> [ [ parse ] catch [ "No such word" write ] [ car see ] if ] with-simple-html-output </td> </tr>
|
<tr> <td "2" =colspan td> [ [ parse ] catch [ "No such word" write ] [ car see ] if ] with-simple-html-output </td> </tr>
|
||||||
<tr> <th> "Apropos" write </th> <th> "Usages" write </th> </tr>
|
<tr> <th> "Apropos" write </th> <th> "Usages" write </th> </tr>
|
||||||
<tr> <td valign= "top" td> [ apropos ] with-simple-html-output </td>
|
<tr> <td "top" =valign td> [ apropos ] with-simple-html-output </td>
|
||||||
<td valign= "top" td> [ [ parse ] catch [ "No such word" write ] [ car usages. ] if ] with-simple-html-output </td>
|
<td "top" =valign td> [ [ parse ] catch [ "No such word" write ] [ car usages. ] if ] with-simple-html-output </td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
] bind ;
|
] bind ;
|
||||||
|
@ -137,13 +137,13 @@ USE: sequences
|
||||||
"see" [ html-for-word-source ] live-search
|
"see" [ html-for-word-source ] live-search
|
||||||
]
|
]
|
||||||
[
|
[
|
||||||
<div id= "see" div> "" write </div>
|
<div "see" =id div> "" write </div>
|
||||||
]
|
]
|
||||||
] vertical-layout ;
|
] vertical-layout ;
|
||||||
|
|
||||||
: display-last-output ( string -- )
|
: display-last-output ( string -- )
|
||||||
#! Write out html to display the last output.
|
#! Write out html to display the last output.
|
||||||
<table border= "1" table>
|
<table "1" =border table>
|
||||||
<tr> <th> "Last Output" write </th> </tr>
|
<tr> <th> "Last Output" write </th> </tr>
|
||||||
<tr> <td> <pre> write </pre> </td> </tr>
|
<tr> <td> <pre> write </pre> </td> </tr>
|
||||||
</table> ;
|
</table> ;
|
||||||
|
|
|
@ -58,7 +58,7 @@ USE: prettyprint
|
||||||
[
|
[
|
||||||
[
|
[
|
||||||
"millis" [ millis pprint ] "Display Server millis" live-anchor
|
"millis" [ millis pprint ] "Display Server millis" live-anchor
|
||||||
<div id= "millis" div>
|
<div "millis" =id div>
|
||||||
"The millisecond time from the server will appear here" write
|
"The millisecond time from the server will appear here" write
|
||||||
</div>
|
</div>
|
||||||
]
|
]
|
||||||
|
@ -67,7 +67,7 @@ USE: prettyprint
|
||||||
"apropos" [ live-search-apropos-word ] live-search
|
"apropos" [ live-search-apropos-word ] live-search
|
||||||
]
|
]
|
||||||
[
|
[
|
||||||
<div id= "apropos" div>
|
<div "apropos" =id div>
|
||||||
"" write
|
"" write
|
||||||
</div>
|
</div>
|
||||||
]
|
]
|
||||||
|
|
|
@ -51,7 +51,7 @@ USE: lists
|
||||||
: include-live-updater-js ( -- )
|
: include-live-updater-js ( -- )
|
||||||
#! Write out the HTML script to include the live updater
|
#! Write out the HTML script to include the live updater
|
||||||
#! javascript code.
|
#! javascript code.
|
||||||
<script language= "JavaScript" src= live-updater-url script>
|
<script "JavaScript" =language live-updater-url =src script>
|
||||||
"" write
|
"" write
|
||||||
</script> ;
|
</script> ;
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ USE: lists
|
||||||
#! an onclick is set via DHTML later to make it run a
|
#! an onclick is set via DHTML later to make it run a
|
||||||
#! quotation on the server. The randomly generated id
|
#! quotation on the server. The randomly generated id
|
||||||
#! for the anchor is returned.
|
#! for the anchor is returned.
|
||||||
<a id= get-random-id dup href= "#" a>
|
<a get-random-id dup =id "#" =href a>
|
||||||
swap write
|
swap write
|
||||||
</a> ;
|
</a> ;
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@ USE: lists
|
||||||
[
|
[
|
||||||
t "disable-initial-redirect?" set
|
t "disable-initial-redirect?" set
|
||||||
[
|
[
|
||||||
<div id= "div-id" get div> "div-quot" get call </div>
|
<div "div-id" get =id div> "div-quot" get call </div>
|
||||||
] show
|
] show
|
||||||
] bind
|
] bind
|
||||||
] cons t swap register-continuation ;
|
] cons t swap register-continuation ;
|
||||||
|
@ -91,7 +91,7 @@ USE: lists
|
||||||
#! in a 'div' tag with the 'div-id'. That 'div' tag will
|
#! in a 'div' tag with the 'div-id'. That 'div' tag will
|
||||||
#! replace whatever HTML DOM object currently has that same
|
#! replace whatever HTML DOM object currently has that same
|
||||||
#! id.
|
#! id.
|
||||||
<script language= "JavaScript" script>
|
<script "JavaScript" =language script>
|
||||||
"document.getElementById('" write
|
"document.getElementById('" write
|
||||||
write
|
write
|
||||||
"').onclick=liveUpdaterUri('" write
|
"').onclick=liveUpdaterUri('" write
|
||||||
|
@ -113,7 +113,7 @@ USE: lists
|
||||||
#! a keydown is set via DHTML later to make it run a
|
#! a keydown is set via DHTML later to make it run a
|
||||||
#! quotation on the server. The randomly generated id
|
#! quotation on the server. The randomly generated id
|
||||||
#! for the input box is returned.
|
#! for the input box is returned.
|
||||||
<input id= get-random-id dup type= "text" input/> ;
|
<input get-random-id dup =id "text" =type input/> ;
|
||||||
|
|
||||||
: register-live-search-quot ( div-id div-quot -- kid )
|
: register-live-search-quot ( div-id div-quot -- kid )
|
||||||
#! Register the 'quot' with the cont-responder so
|
#! Register the 'quot' with the cont-responder so
|
||||||
|
@ -134,7 +134,7 @@ USE: lists
|
||||||
[
|
[
|
||||||
#! Don't need the URL as the 'show' won't be resumed.
|
#! Don't need the URL as the 'show' won't be resumed.
|
||||||
drop
|
drop
|
||||||
<div id= "div-id" get div> "div-quot" get call </div>
|
<div "div-id" get =id div> "div-quot" get call </div>
|
||||||
] show
|
] show
|
||||||
] bind
|
] bind
|
||||||
] cons t swap register-continuation ;
|
] cons t swap register-continuation ;
|
||||||
|
@ -148,7 +148,7 @@ USE: lists
|
||||||
#! a 'div' with the id 'div-id' and will
|
#! a 'div' with the id 'div-id' and will
|
||||||
#! replace whatever HTML DOM object currently has that same
|
#! replace whatever HTML DOM object currently has that same
|
||||||
#! id.
|
#! id.
|
||||||
<script language= "JavaScript" script>
|
<script "JavaScript" =language script>
|
||||||
"liveSearch('" write
|
"liveSearch('" write
|
||||||
write
|
write
|
||||||
"', '" write
|
"', '" write
|
||||||
|
|
|
@ -110,7 +110,7 @@ USE: sequences
|
||||||
|
|
||||||
: include-todo-stylesheet ( -- )
|
: include-todo-stylesheet ( -- )
|
||||||
#! Generate HTML to include the todo stylesheet
|
#! Generate HTML to include the todo stylesheet
|
||||||
<link rel= "stylesheet" href= todo-stylesheet-url link/> ;
|
<link "stylesheet" =rel todo-stylesheet-url =href link/> ;
|
||||||
|
|
||||||
: show-stack-page ( -- )
|
: show-stack-page ( -- )
|
||||||
#! Debug function to show a page containing the current call stack.
|
#! Debug function to show a page containing the current call stack.
|
||||||
|
@ -126,39 +126,39 @@ USE: sequences
|
||||||
: styled-row ( class list -- )
|
: styled-row ( class list -- )
|
||||||
#! Output an html TR row with each element of the list
|
#! Output an html TR row with each element of the list
|
||||||
#! being called to produce the output for each TD.
|
#! being called to produce the output for each TD.
|
||||||
<tr class= swap tr>
|
<tr swap =class tr>
|
||||||
[ <td> call </td> ] each
|
[ <td> call </td> ] each
|
||||||
</tr> ;
|
</tr> ;
|
||||||
|
|
||||||
: simple-input ( name -- )
|
: simple-input ( name -- )
|
||||||
#! Output a simple HTML input field which will have the
|
#! Output a simple HTML input field which will have the
|
||||||
#! specified name.
|
#! specified name.
|
||||||
<input type= "text" size= "20" name= input/> ;
|
<input "text" =type "20" =size =name input/> ;
|
||||||
|
|
||||||
: simple-input-with-value ( name value -- )
|
: simple-input-with-value ( name value -- )
|
||||||
#! Output a simple HTML input field which will have the
|
#! Output a simple HTML input field which will have the
|
||||||
#! specified name and value.
|
#! specified name and value.
|
||||||
<input type= "text" size= "20" value= name= input/> ;
|
<input "text" =type "20" =size =value =name input/> ;
|
||||||
|
|
||||||
: textarea-input ( name -- )
|
: textarea-input ( name -- )
|
||||||
#! Output a simple HTML textarea field which will have the
|
#! Output a simple HTML textarea field which will have the
|
||||||
#! specified name.
|
#! specified name.
|
||||||
<textarea name= rows= "10" cols= "40" textarea> "Enter description here." write </textarea> ;
|
<textarea =name "10" =rows "40" =cols textarea> "Enter description here." write </textarea> ;
|
||||||
|
|
||||||
: textarea-input-with-value ( name value -- )
|
: textarea-input-with-value ( name value -- )
|
||||||
#! Output a simple HTML textarea field which will have the
|
#! Output a simple HTML textarea field which will have the
|
||||||
#! specified name and value.
|
#! specified name and value.
|
||||||
<textarea name= swap rows= "10" cols= "40" textarea> write </textarea> ;
|
<textarea swap =name "10" =rows "40" =cols textarea> write </textarea> ;
|
||||||
|
|
||||||
: password-input ( name -- )
|
: password-input ( name -- )
|
||||||
#! Output an HTML password input field which will have the
|
#! Output an HTML password input field which will have the
|
||||||
#! specified name.
|
#! specified name.
|
||||||
<input type= "password" size= "20" name= input/> ;
|
<input "password" =type "20" =size =name input/> ;
|
||||||
|
|
||||||
: form ( action quot -- )
|
: form ( action quot -- )
|
||||||
#! Call quot with any output appearing inside an HTML form.
|
#! Call quot with any output appearing inside an HTML form.
|
||||||
#! The form is a POST form where the action is as specified.
|
#! The form is a POST form where the action is as specified.
|
||||||
<form method= "post" action= swap form> call </form> ;
|
<form "post" =method swap =action form> call </form> ;
|
||||||
|
|
||||||
: input-value ( name -- value )
|
: input-value ( name -- value )
|
||||||
#! Get the value of the variable "name". If it is f
|
#! Get the value of the variable "name". If it is f
|
||||||
|
@ -300,12 +300,12 @@ USE: sequences
|
||||||
#! todo item details.
|
#! todo item details.
|
||||||
[
|
[
|
||||||
<table>
|
<table>
|
||||||
<tr class= "required" tr>
|
<tr "required" =class tr>
|
||||||
<td class= "lbl" td> "Priority" write </td>
|
<td "lbl" =class td> "Priority" write </td>
|
||||||
<td> "priority" simple-input </td>
|
<td> "priority" simple-input </td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class= "required" tr>
|
<tr "required" =class tr>
|
||||||
<td class= "lbl" td> "Description" write </td>
|
<td "lbl" =class td> "Description" write </td>
|
||||||
<td> "description" textarea-input </td>
|
<td> "description" textarea-input </td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
@ -318,12 +318,12 @@ USE: sequences
|
||||||
swap [
|
swap [
|
||||||
[
|
[
|
||||||
<table>
|
<table>
|
||||||
<tr class= "required" tr>
|
<tr "required" =class tr>
|
||||||
<td class= "lbl" td> "Priority" write </td>
|
<td "lbl" =class td> "Priority" write </td>
|
||||||
<td> "priority" dup get simple-input-with-value </td>
|
<td> "priority" dup get simple-input-with-value </td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class= "required" tr>
|
<tr "required" =class tr>
|
||||||
<td class= "lbl" td> "Description" write </td>
|
<td "lbl" =class td> "Description" write </td>
|
||||||
<td> "description" dup get textarea-input-with-value </td>
|
<td> "description" dup get textarea-input-with-value </td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
@ -359,16 +359,16 @@ USE: sequences
|
||||||
#! new password.
|
#! new password.
|
||||||
[
|
[
|
||||||
<table>
|
<table>
|
||||||
<tr class= "required" tr>
|
<tr "required" =class tr>
|
||||||
<td class= "lbl" td> "Old Password" write </td>
|
<td "lbl" =class td> "Old Password" write </td>
|
||||||
<td> "old-password" password-input </td>
|
<td> "old-password" password-input </td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class= "required" tr>
|
<tr "required" =class tr>
|
||||||
<td class= "lbl" td> "New Password" write </td>
|
<td "lbl" =class td> "New Password" write </td>
|
||||||
<td> "new-password" password-input </td>
|
<td> "new-password" password-input </td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class= "required" tr>
|
<tr "required" =class tr>
|
||||||
<td class= "lbl" td> "Verify Password" write </td>
|
<td "lbl" =class td> "Verify Password" write </td>
|
||||||
<td> "verify-password" password-input </td>
|
<td> "verify-password" password-input </td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
Loading…
Reference in New Issue