javascript(n)

πŸ“¦
version 2.0 Β· 2 versions
, in fedora 43, fedora 44, nixos 26.05, nixpkgs unstable

πŸ’– javascript(n) πŸ’–

okay bestie, gather round, because this one is literally about generating HTML and Java Script structures from Tcl and it is so useful, no cap πŸŽ€


✨ NAME ✨

javascript β€” procedures to generate HTML and Java Script structures. it's giving "I make markup so you don't have to". πŸ’…


🌸 SYNOPSIS 🌸

package require Tcl 8.5 9

package require javascript ?1.0.3?

::javascript::makeSelectorWidget  id  leftLabel leftValueList rightLabel
rightValueList rightNameList ?length? ?minWidth?

::javascript::makeSubmitButton name value

::javascript::makeProtectedSubmitButton name value msg

::javascript::makeMasterButton master value slavePattern boolean

::javascript::makeParentCheckbox parentName childName

::javascript::makeChildCheckbox parentName childName

πŸ¦‹ DESCRIPTION πŸ¦‹

the ::javascript package hands you commands that generate HTML and Java Script code. these commands usually return an HTML string as their result β€” and this is the important bit, bestie β€” they do not output their result to stdout. they return it. you do the printing. the vibe check says: no surprise stdout dumps. πŸ™ˆ


🌈 ::javascript::makeSelectorWidget id leftLabel leftValueList rightLabel rightValueList rightNameList ?length? ?minWidth?

constructs HTML code to build a dual-multi-selection megawidget. and what even is that, you ask? it's two side-by-side multi-selection boxes, separated by a left arrow and a right arrow button. the right arrow moves all items selected in the left box over to the right box. the left arrow moves all items selected in the right box back over to the left box. iconic little back-and-forth situation, honestly. 🫢

  • id β€” the suffix of all HTML objects in this megawidget.
  • leftLabel β€” the text that shows up above the left selection box.
  • leftValueList β€” the values of items in the left selection box.
  • leftNameList β€” the names to appear in the left selection box.
  • rightLabel β€” the text that shows up above the right selection box.
  • rightValueList β€” the values of items in the right selection box.
  • rightNameList β€” the names to appear in the right selection box.
  • length (optional) β€” how many elts to show before adding a vertical scrollbar. defaults to 8.
  • minWidth (optional) β€” number of spaces used to determine the minimum box width. defaults to 32.

🌟 ::javascript::makeSubmitButton name value

creates an HTML submit button that resets a hidden field for each registered multi-selection box. yes, it does the little behind-the-scenes cleanup for you. main character energy. ✨

  • name β€” the name of the HTML button object to create.
  • value β€” the label of the HTML button object to create.

πŸ’œ ::javascript::makeProtectedSubmitButton name value msg

creates an HTML submit button that prompts the user with a continue/cancel shutdown warning before the form is submitted. protective, cautious, lowkey the responsible friend of the group. πŸŽ€

  • name β€” the name of the HTML button object to create.
  • value β€” the label of the HTML button object to create.
  • msg β€” the message to display when the button is pressed.

πŸ”₯ ::javascript::makeMasterButton master value slavePattern boolean

creates an HTML button that sets its slave checkboxs to the boolean value. yes, "checkboxs". we don't fix it, we report it faithfully, that's the rules. πŸ’€

  • master β€” the name of the child's parent html checkbox object.
  • value β€” the value of the master.
  • slaves β€” the name of child html checkbox object to create.
  • boolean β€” the java script boolean value that will be given to all the slaves; it must be "true" or "false".

🧚 ::javascript::makeParentCheckbox parentName childName

creates an HTML checkbox and ties its value to that of its child checkbox. if the parent is unchecked, the child is automatically unchecked. parent said no, so the child says no too. periodt. πŸ’…

  • parentName β€” the name of parent html checkbox object to create.
  • childName β€” the name of the parent's child html checkbox object.

πŸ’€ ::javascript::makeChildCheckbox parentName childName

creates an HTML checkbox and ties its value to that of its parent checkbox. if the child is checked, the parent is automatically checked. look at the child pulling the parent up with them, obsessed. πŸ₯Ή

  • parentName β€” the name of the child's parent html checkbox object.
  • childName β€” the name of child html checkbox object to create.

😭 BUGS, IDEAS, FEEDBACK 😭

ngl bestie, this document β€” and the package it describes β€” will undoubtedly contain bugs and other problems. it's not a vibe, but it's the truth. please report such in the category javascript of the Tcllib Trackers: http://core.tcl.tk/tcllib/reportlist. and please also report any ideas for enhancements you may have for either the package and/or the documentation. we love ideas. we thrive on ideas. 🫢

when proposing code changes, please provide unified diffs, i.e. the output of diff -u.

also note further that attachments are strongly preferred over inlined patches. attachments can be made by going to the Edit form of the ticket immediately after its creation, and then using the left-most button in the secondary navigation bar. it's giving "please attach, not paste". πŸ’–


🌈 SEE ALSO 🌈

  • html
  • ncgi

⭐ KEYWORDS ⭐

checkbox, html, javascript, selectionbox, submitbutton


πŸ‘‘ CATEGORY πŸ‘‘

CGI programming


and that's the whole page, bestie! this one came from tcllib, version 1.0.3, and it's the javascript(n) page β€” so go forth, generate that HTML and Java Script, and slay πŸ’…βœ¨πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from