Hi cj.v,

> Man, I wish you had started a separate discussion thread (with a link 
back to this one and a link from this one) related to that for a full 
discussion "over there" instead of intertwingling that with the intent of 
the original post.

Sorry about that. It was unintentional, I hope you consider that. 

> What benefit would we get replacing that simple code with javascript?

It was a tangential thought. I assume you are showcasing a single-response 
API.  If we parse the search parameters into a widget and respond to the 
query in a `switch-case` tree, the code block could be more manageable, 
less fragmented. Calling entirely different branches from a single point in 
a much less verbose way, DRY too. 

Again, in contrast to your take on JavaScript - mine goes the other way 
around. Prefer JS over TW WikiText. More chances of finding a solution in 
internet if I run into an issue, and the knowledge I acquire during the 
process will come handy outside the context of TW. 

Sincerely,
Riz

On Wednesday, 16 March 2022 at 22:31:50 UTC+5:30 [email protected] wrote:

> *Aside:*
>
> Man, I wish you had started a separate discussion thread (with a link back 
> to this one and a link from this one) related to that for a full discussion 
> "over there" instead of intertwingling that with the intent of the original 
> post.
>
> Because what you bring up is worthy of its own thread.
>
> Mostly: I have a couple of cognitive disabilities, and I get confused and 
> overwhelmed when various threads of discussion are all mixed together 
> branching off in really different ways all on the same web page.)
>
> Not your problem, but if I stop participating in this thread (i.e. not 
> answering questions related to the original post), I hope folk understand 
> why I'm out.
>
> *Now, back to Riz' post:*
>
> You are referring to this thing which decides whether or not to enter a 
> process of reporting info about all tiddlers to Session Storage:
>
> `<$list filter="[[$:/info/url/search]get[text]regexp[action=do_rpt]]">`
>
> Although I cannot stand doing things in javascript, there are two 
> scenarios in which I will use javascript:
>
>    - there is no choice but to do it in javascript
>    - it is more painful doing it without javascript than to do it with 
>    javascript
>
> What you're suggesting is an immediate "oh hell no" fight or flight 
> reaction by this kid.
>
> Why on earth would I use javascript when I could just have multiple of 
> those lines for various processing?
>
> For example:
>
> `
> <$list filter="[[$:/info/url/search]get[text]regexp[action=do_process_A]]">
> ...
> </$list>
> <$list filter="[[$:/info/url/search]get[text]regexp[action=do_process_B]]">
> ...
> </$list>
> <$list filter="[[$:/info/url/search]get[text]regexp[action=do_process_C]]">
> ...
> </$list>
> <$list filter="[[$:/info/url/search]get[text]regexp[action=do_process_D]]">
> ...
> </$list>
> `
>
> That seems pretty clear and concise with just TiddlyWiki syntax.
>
> What benefit would we get replacing that simple code with javascript?
>
>
>
>
>
> On Wednesday, March 16, 2022 at 1:06:05 PM UTC-3 Riz wrote:
>
>> This is a cool trick. With a little JavaScript you can remove the regex 
>> based processing of URL and expand it beyond a single action.
>>
>> Ref: https://www.sitepoint.com/get-url-parameters-with-javascript/
>> On Wednesday, 16 March 2022 at 07:50:47 UTC+5:30 [email protected] wrote:
>>
>>> Step 1: Getting a TiddlyWiki to report tiddler info (created and 
>>> modified dates) to Session Storage.  Process triggered by "?action=do_rpt" 
>>> appended to a TiddlyWiki's URL.
>>>
>>> https://cjveniot.neocities.org/TW_A.html?action=do_rpt
>>>
>>> Relevant/necessary tiddlers:
>>>
>>>    - SetSessionStorageItem.js
>>>    - Post Render Startup Actions
>>>    
>>> Copy the two tiddlers above into a TiddlyWiki, save, refresh, and add 
>>> "?action-do_rpt" to the url.
>>>
>>> *[image: Screenshot 2022-03-15 11.17.20 PM.png]*
>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/60c52eed-94dc-4b48-916d-737dfda89577n%40googlegroups.com.

Reply via email to