Posted to tcl by mookie at Sat Nov 01 01:57:37 GMT 2025view raw

  1. namespace eval crystal::netdisc::fountain { crystal::debug 1 "" "-> [file tail [info script]]"}
  2. variable namespace "crystal::netdisc::[file rootname [file tail [info script]]]"
  3. # Method # URI # Procedure to execute # CraftSheet / HTML Method
  4. crystal::register "GET" "/::crystal/fountain" "${namespace}" "fountain" "get"
  5. crystal::register "POST" "/::crystal/fountain" "${namespace}" "fountain" "post"
  6. ##
  7. # crystal::ghui ghui/system.ix
  8. # crystal::prompt::load prompt/system.ix
  9. # crystal::render crystal/render.ix
  10. # crystal::construct crystal/construct.ix
  11. ##
  12. proc crystal::netdisc::fountain {{args}} {
  13. namespace eval crystal::netdisc::execute {}
  14. variable base32_input [crystal::lidx $args 0]
  15. variable base32_phase [crystal::lidx $args 1]
  16. crystal::debug 0 "$base32_input" "base32_input"
  17. crystal::debug 0 "$base32_phase" "base32_phase"
  18.  
  19. proc crystal::netdisc::execute {base32_input base32_phase} {
  20. variable crystal [crystal::client::construct $base32_input]
  21. interp eval $crystal [list variable base32_phase $base32_phase]
  22. interp eval $crystal {
  23. # Switch method
  24. # Dependent on if it's GET or POST
  25. # Set or Get a idx
  26. # Case
  27. # post - Get the client_key via formvalue
  28. # get - Get the identity via URL query
  29. switch $base32_phase {
  30. post {
  31. variable base16_crystal [crystal::client::set "base16_indentity" [crystal::client::get formvalue "formkey"]]
  32. variable base16_client_key [crystal::client::get identity $base16_crystal]
  33. }
  34. get {
  35. variable base16_crystal [crystal::client::set "base16_indentity" [crystal::client::query]]
  36. variable base16_client_key [crystal::client::get identity $base16_crystal]
  37. }
  38. } ;# end switch
  39. # Store the craftsheet in to the client keys store
  40. crystal::hextdict "insert_to" "$base16_client_key" "ghui" "craftsheet" \
  41. "[crystal::render::craftsheet $base32_input]"
  42. crystal::prompt load $base16_client_key $base32_input
  43. # crystal::prompt::load $base16_client_key $base32_input
  44. # Render our data retrieved from our clients dictonary
  45. # Construct the query string passed from client and render
  46. crystal::render [crystal::construct $base16_client_key "$base32_input"]
  47. } ;# end interp
  48. } ;# end proc
  49. crystal::netdisc::execute $base32_input $base32_phase
  50. } ;#end proc
  51.  

Add a comment

Please note that this site uses the meta tags nofollow,noindex for all pages that contain comments.
Items are closed for new comments after 1 week