[tw5] Re: Scrollable Sidebar Tabs?

2021-08-16 Thread TW Tones
Thanks for Sharing I will test it out!

Tones

On Tuesday, 17 August 2021 at 02:08:37 UTC+10 amreus wrote:

> The attached is a sample of a scrollable More/All tab. Import it to 
> tiddlywiki.com.  I just think it it's a better experience than having the 
> entire sidebar scroll.
>
> I think an issue might be what height do you set the scrollble part to? 
> Could it be calculated from the existing sidebar-segments?
>
> <$scrollable class="tc-scrollable-demo">
> <$list filter={{$:/core/Filters/AllTiddlers!!filter}} 
> template="$:/core/ui/ListItemTemplate"/>
> 
>
> On Monday, August 16, 2021 at 10:43:19 AM UTC-4 amreus wrote:
>
>>
>> Another style question - is there one place where I can make all the 
>> sidebar tabs scrollable, or does each tiddler tagged $:/tags/SideBar 
>> and  $:/tags/MoreSideBar need to wrapped in a scrollable widget?
>>
>> Thanks. 
>>
>> I think all of the sidebar tabs should be scrollable by default so the 
>> entire sidebar does not scroll out of view. Or maybe all of the 
>> SidebarSegments above the tabs should be fixed position.
>>
>>
>>
>>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/1614c7d4-5abb-4564-a00d-11e667f891d5n%40googlegroups.com.


[tw5] Re: Just a goofy thought: a way to get javascript into a Tiddler

2021-08-16 Thread TW Tones
Charlie,

Whatever you wish but I feel I needed to clarify the innerwiki plugin can 
run on single file wikis and generate new single file wiki, like in an 
iframe., from where you can save it as a new single file wiki, if you 
wanted. Perhaps a good place to test.

Its purpose was for documentation snapshots which requires node, other 
applications of it do not need node.

Regards
Tones


On Monday, 16 August 2021 at 23:18:55 UTC+10 cj.v...@gmail.com wrote:

> Well, I'm more assuming than presuming that it is secure.
>
> Yup, template in my quick follow-up after initial post looks much nicer.
>
> Nah, I have not played with the Innerwiki plugin.  I largely prefer 
> single-file TiddlyWiki's, and Innerwiki seems to be for TiddlyWiki on 
> nodejs.  I'll try it sometime for giggles, but my goal here is the ability 
> to quickly add simple javascript needs with simple copy/paste  and without 
> javascript macros.
>
> I'm loving the speculation.  
>
>- In particular:  TiddlyWiki as an editor for creating web pages 
>(HTML, CSS, javascript)
>
>
> Be aware that the TiddlyWiki cannot see what is in the iFrame, and the 
> iFrame cannot see what is in the TiddlyWiki.
>
> *However and hypothetically*: the HTML fed to the iFrame can be dynamic 
> (i.e. the HTML created by TiddlyWiki, thus allowing TiddlyWiki to include 
> TiddlyWiki info in the HTML.  Interesting possibilities ...
>
>
>
>
>
> On Monday, August 16, 2021 at 1:21:58 AM UTC-3 TW Tones wrote:
>
>> Charlie,
>>
>> Thanks for this. 
>>
>>- I presume it is secure because the iframe acts like a sandbox
>>- The result will be what is displayed because there is no permitted 
>>way to impact the wiki
>>
>> I wonder if 
>>
>>- A template can be used rather than the variable? yes the following 
>>worked
>>
>>- Use a TiddlyWiki template for the content of the iframe may need to 
>>wikify first.
>>
>> Have you played with the* innerwiki plugin* it's similar but different? 
>> It can pass a lot more data to the iframe (I think), in fact can build a 
>> whole wiki inside the iframe.
>>
>> Speculation;
>>
>>- Could this be used by students of javascript?
>>- what kind of Javascript code can be implemented this way?
>>- Could it access functions defined in the parent wiki eg raw tags?
>>   - I suppose it could if added to the template.
>>- Could we use iframes in which to publish complete html pages 
>>including javascript as a website development or learning tool.
>>
>> Regards
>> Tones
>>
>> On Monday, 16 August 2021 at 12:39:05 UTC+10 cj.v...@gmail.com wrote:
>>
>>> Better to keep the HTML readable, drag the attached json with two 
>>> tiddlers into some TiddlyWiki:
>>>
>>> On Sunday, August 15, 2021 at 11:27:41 PM UTC-3 Charlie Veniot wrote:
>>>
 I don't know what made me think of this.

 In case this has not been brought up in a while (I doubt this is new to 
 seasoned folk) ...

 I was thinking: could I use an iFrame to include simple javascript in a 
 tiddler without getting into macros or plugins that enable javascript.

 And, if I could, then could I set things up so that the iFrame is 
 showing javascript dynamically created by the tiddler ?

 So here is a way to show a digital clock in TiddlyWiki, for 
 non-programmers who just want to copy and paste javascript code from the 
 web without figuring out how the javascript code works :

 Put this in a brand new tiddler:

 *<$vars* *vSrcDoc*={{{ [[  
   let clockEl = document.getElementById("clockDiv");function 
 getClockTime() {  let date = new Date();  let hr = 
 date.getHours();  let min = date.getMinutes();  let sec = 
 date.getSeconds();  hr = ("0" + hr).slice(-2);  min = ("0" + 
 min).slice(-2);  sec = ("0" + sec).slice(-2);  clockEl.innerHTML = 
 `${hr}:${min}:${sec}`;}setInterval(getClockTime, 1000);  
 ]] }}}*>*
 *>* style="border:none;width:100%;"
 *>*
 **

 Sneaky sneaky, has me wondering what kind of other fun things could be 
 done...

>>>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/bb8a5d48-341e-4637-9ed4-10b49c71f146n%40googlegroups.com.


Re: [tw5] Stupid Question: Add button to ViewBar(?) with JS Only.

2021-08-16 Thread Finn Lancaster
Thanks @TW Tones! I do often find myself getting into that "Js-only" 
mentality. As powerful and hackable as the JavaScript language is, there 
are certain things it cannot do (possibly or effectively), and some of 
those reasons are why I need to read-up on wikitext. I will look into that 
great list you made, and hopefully find something on it that allows the 
getting of the tiddler text (I have already done the stylesheet). 

I may have to really work hard to stop my bad habits, because I developed 
quite a long bit of code to get the text of the tiddler where the button 
click event fired from!

Thanks Again!

On Monday, August 16, 2021 at 8:21:43 PM UTC-4 TW Tones wrote:

> Flank,
>
> I can already see you contributing a lot to the community, thanks a lot. 
> As Jeremy says you may need to unlearn and relearn a little to get right 
> into tiddlywiki. I am myself intentionally a superuser, I do everything in 
> the world of wiki text etc... There is very little we can't do without 
> javascript except as Jeremy outlined. The key pieces are to me filters, 
> wiki text and the widgets (especially the list widget).
>
> You may learn to ask the question "can I do it natively in tiddlywiki?" It 
> is mostly when you are brining in functions and API's you may need 
> Javascript otherwise not so often.
>
> About learning tiddlywiki, 
>
>- Ask here in the forum (as you are doing)
>- search tiddlywiki.com
>   - Especialy https://tiddlywiki.com/#Community
>   - Eg Grok Wiki 
>   - Search https://links.tiddlywiki.com/
>   - Search 
>   
> https://tiddlywiki.com/#%22TiddlyWiki%20Toolmap%22%20by%20David%20Gifford
>   - My Own resource especially 
>https://anthonymuscio.github.io/#Standard%20Nomenclature
>- There is a lot more out there so feel free to ask
>
> Tones
>
> On Tuesday, 17 August 2021 at 06:26:09 UTC+10 flanc...@gmail.com wrote:
>
>> Thanks! I've already had a look around the Developer TW page, but, sadly, 
>> it does seem lacking on so-much info. Instead, I've had to refer to various 
>> posts/pages written by other community-members, but even those are 
>> few-and-far between for some of what I want to know.
>>
>> On the note of calling the JS function, I would like to call a 
>> pre-defined script in the startup folder, with the tiddler text as an 
>> argument. The call would look like
>> text_to_speech(TIDDLER TEXT HERE)
>>
>> Is this possible to do, or does it need a line in a .info file, or 
>> something so that one can access the functions of the other?
>>
>> On Monday, August 16, 2021 at 4:17:04 PM UTC-4 jeremy...@gmail.com wrote:
>>
>>> Hi Finn
>>>
>>> Thanks Jeremy! I was able to get the button to show-up! I have a few 
 more stupid questions, if you have the time, mainly related to styling 
 these buttons and to wikitext.

 Firstly, I would like the colour of the button to change onhover. While 
 this is simple to do with CSS, I imagine it needs some sort of special 
 stylesheet (styles.tid, perhaps), to do this. It would be great if you 
 could share the syntax needed for this.

>>>
>>> As you inferred, there are two parts: (a) assign a class to the button 
>>> and (b) create a stylesheet with a :hover rule. Stylesheets are ordinary 
>>> tiddlers with the tag "$:/tags/Stylesheet", and (usually) the type 
>>> "text/css".
>>>
>>> For dynamic effects, one can also use the wikitext type 
>>> "text/vnd.tiddlywiki" and use wikitext primitives like <$list> to generate 
>>> stylesheet rules dynamically.
>>>  
>>>
 Next and lastly, I am a bit confused as to how to implement this with 
 JS. I would like to be able to get the tiddler text, and then call a JS 
 function with this JS text as an argument. How could I go about getting 
 the 
 tiddler text when the button is clicked, and then have this transfer over 
 to JS for the function call?

>>>
>>> It sounds like you want to make a view toolbar button that calls a JS 
>>> function to do something with the text of a tiddler. There are quite a few 
>>> ways to do that, and the precise details will depend on what you're trying 
>>> to achieve. What does the JS function do with the text? Does it need to 
>>> update the tiddler value in the store?
>>>
>>> The key types of JS modules in TW5 are as follows:
>>>
>>> * JS macros for simple deterministic text transformations that don't 
>>> have any side effects (eg they cannot modify the tiddler store)
>>> * Widgets for dynamic components that reflect values in the tiddler 
>>> store, and automatically refresh if the values in the store change
>>> * Filter operators for operations on lists of items. Again, they mustn't 
>>> have side effects
>>> * Savers for saving entire TiddlyWiki HTML files
>>> * SyncAdaptors for saving/loading individual tiddlers to remote servers
>>>
>>> There are some docs at https://tiddlywiki.com/dev, and it's worth 
>>> browsing the code over at GitHub:
>>>
>>> 

[tw5] As Promised: GG2TW Revamped!

2021-08-16 Thread Finn Lancaster


Notes: v1.0.0 was the same as v1.0.0-beta. Because of various high-level 
changes, I have decided to forgo that release, and instead skip to v1.0.1!

*What's New?*

   - Everything!
   - New UI
   - New method using comma-separated URLs
   - Faster Optimised code (minutes to seconds!)
   - Better formatting using HTML
   - Smart Title and Tag grabbing for import
   - And lots more!

Check out the demo at gg2tw.finnsoftware.net, following the instructions 
there, and drop a star if you support this idea!

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/4e3f587b-994b-433e-99cb-a4ad8d6bc554n%40googlegroups.com.


Re: [tw5] Stupid Question: Add button to ViewBar(?) with JS Only.

2021-08-16 Thread TW Tones
Flank,

I can already see you contributing a lot to the community, thanks a lot. As 
Jeremy says you may need to unlearn and relearn a little to get right into 
tiddlywiki. I am myself intentionally a superuser, I do everything in the 
world of wiki text etc... There is very little we can't do without 
javascript except as Jeremy outlined. The key pieces are to me filters, 
wiki text and the widgets (especially the list widget).

You may learn to ask the question "can I do it natively in tiddlywiki?" It 
is mostly when you are brining in functions and API's you may need 
Javascript otherwise not so often.

About learning tiddlywiki, 

   - Ask here in the forum (as you are doing)
   - search tiddlywiki.com
  - Especialy https://tiddlywiki.com/#Community
  - Eg Grok Wiki 
  - Search https://links.tiddlywiki.com/
  - Search 
  https://tiddlywiki.com/#%22TiddlyWiki%20Toolmap%22%20by%20David%20Gifford
  - My Own resource especially 
   https://anthonymuscio.github.io/#Standard%20Nomenclature
   - There is a lot more out there so feel free to ask

Tones

On Tuesday, 17 August 2021 at 06:26:09 UTC+10 flanc...@gmail.com wrote:

> Thanks! I've already had a look around the Developer TW page, but, sadly, 
> it does seem lacking on so-much info. Instead, I've had to refer to various 
> posts/pages written by other community-members, but even those are 
> few-and-far between for some of what I want to know.
>
> On the note of calling the JS function, I would like to call a pre-defined 
> script in the startup folder, with the tiddler text as an argument. The 
> call would look like
> text_to_speech(TIDDLER TEXT HERE)
>
> Is this possible to do, or does it need a line in a .info file, or 
> something so that one can access the functions of the other?
>
> On Monday, August 16, 2021 at 4:17:04 PM UTC-4 jeremy...@gmail.com wrote:
>
>> Hi Finn
>>
>> Thanks Jeremy! I was able to get the button to show-up! I have a few more 
>>> stupid questions, if you have the time, mainly related to styling these 
>>> buttons and to wikitext.
>>>
>>> Firstly, I would like the colour of the button to change onhover. While 
>>> this is simple to do with CSS, I imagine it needs some sort of special 
>>> stylesheet (styles.tid, perhaps), to do this. It would be great if you 
>>> could share the syntax needed for this.
>>>
>>
>> As you inferred, there are two parts: (a) assign a class to the button 
>> and (b) create a stylesheet with a :hover rule. Stylesheets are ordinary 
>> tiddlers with the tag "$:/tags/Stylesheet", and (usually) the type 
>> "text/css".
>>
>> For dynamic effects, one can also use the wikitext type 
>> "text/vnd.tiddlywiki" and use wikitext primitives like <$list> to generate 
>> stylesheet rules dynamically.
>>  
>>
>>> Next and lastly, I am a bit confused as to how to implement this with 
>>> JS. I would like to be able to get the tiddler text, and then call a JS 
>>> function with this JS text as an argument. How could I go about getting the 
>>> tiddler text when the button is clicked, and then have this transfer over 
>>> to JS for the function call?
>>>
>>
>> It sounds like you want to make a view toolbar button that calls a JS 
>> function to do something with the text of a tiddler. There are quite a few 
>> ways to do that, and the precise details will depend on what you're trying 
>> to achieve. What does the JS function do with the text? Does it need to 
>> update the tiddler value in the store?
>>
>> The key types of JS modules in TW5 are as follows:
>>
>> * JS macros for simple deterministic text transformations that don't have 
>> any side effects (eg they cannot modify the tiddler store)
>> * Widgets for dynamic components that reflect values in the tiddler 
>> store, and automatically refresh if the values in the store change
>> * Filter operators for operations on lists of items. Again, they mustn't 
>> have side effects
>> * Savers for saving entire TiddlyWiki HTML files
>> * SyncAdaptors for saving/loading individual tiddlers to remote servers
>>
>> There are some docs at https://tiddlywiki.com/dev, and it's worth 
>> browsing the code over at GitHub:
>>
>> https://github.com/Jermolene/TiddlyWiki5/tree/master/core/modules
>>
>> Sorry if these questions are a bit basic, but I have yet to find a good 
>>> resource for learning WikiText/TW Syntax, so I have to rely on the 
>>> community and you. 
>>>
>>
>> Not at all. It sounds like you've plenty of experience of HTML, CSS and 
>> JS which puts you in a great position. Some of it will be a matter of 
>> unlearning some of the usual ways of doing things. TiddlyWiki is a 
>> different beast: it tries to make it easy to write complex apps 
>> declaratively by composing a small number of higher level primitives. But 
>> it also tries to have it's cake and eat it, in the way that it tries to 
>> expose the underlying flexibility of HTML, CSS and JS.
>>
>> Best wishes
>>
>> Jeremy
>>
>>

-- 
You received this message because you are 

[tw5] Re: !!! ''foo'' does not appear as bold

2021-08-16 Thread Álvaro
It is a problem with font-weight that it fixed in the prerelease, the fix 

the heading elements have a font-weight of 300 and the ** element 
has font-weight bolder.
The bolder of 300 is 400 (=normal)
You can see the specification about this property here 


El lunes, 16 de agosto de 2021 a las 14:47:50 UTC+2, TW Tones escribió:

> Can you give an example?
>
> This works;
>
>  This is a heading with ''bold'' in it
>
> Tones
>
> On Saturday, 14 August 2021 at 20:03:47 UTC+10 Sapphireslinger wrote:
>
>> The heading wikitext cancels out the bold wikitext.
>>
>> I went to the control panel and looked through the palette editor but 
>> couldn't find anything to edit to keep the H1 and H2  and H3 (etc) buttons 
>> from interfering with the bold formatting. 
>>
>> I am using Vanilla theme.
>>
>> Thank you for any tips.
>>
>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/6640865d-9be6-42d1-b3a9-cfa200f0b107n%40googlegroups.com.


[tw5] Re: convert date in a text field to date format

2021-08-16 Thread 'Mark S.' via TiddlyWiki
[image: screenshot-converted-date.png]

On Monday, August 16, 2021 at 3:57:54 PM UTC-7 Mark S. wrote:

>
> So, did you add Eric's macro to your TW and verify it works? That would be 
> the first step in trouble-shooting. Remember, after loading the convertdate 
> macro, you have to save and reload your TW file.
>
> It worked for me without problem:
>
>
>
>
> On Monday, August 16, 2021 at 12:30:13 PM UTC-7 S² wrote:
>
>> Mark, thanks for feedback.
>>
>> The added 'published-tw' field is empty - no values:
>> [image: published-tw.png]
>>
>> Mark S. schrieb am Montag, 16. August 2021 um 20:31:28 UTC+2:
>>
>>> So what you really need is a filter operator that can do the conversion 
>>> and be used inside a sortsub operator. @Eric ?
>>>
>>> If you're willing to use an "update" button, one solution would be a 
>>> button that creates "published-tw" (date in TW format) fields for any 
>>> tiddler that has a "published" field. Then you could have the TOC sort on 
>>> the published-tw field. You would have to remember to periodically perform 
>>> the "update" whenever you had data changes. This two-step approach makes 
>>> certain activities in TW much easier to handle.
>>>
>>> So the code to update the field might look like:
>>>
>>> <$button>Update Publication Dates
>>> <$list filter="[has[published]]">
>>> <$wikify text="""<$macrocall $name=convertdate from={{!!published}} 
>>> to="[UTC]0MM0DD0hh0mm0ss0XXX" />""" name=result >
>>> <$action-setfield $field=published-tw $value=<> />
>>> 
>>> 
>>> 
>>>
>>> Be sure to make a backup before trying this of course. Also, this 
>>> assumes that you have the latest version of Eric's converdate macro 
>>> installed.
>>>
>>>
>>> On Monday, August 16, 2021 at 3:37:26 AM UTC-7 S² wrote:
>>>
 Hello,

 thanks for all input and effort.
 It looks like it is not so easy...

 As I wrote, I use the text field ‘publish’ to add a date. (date 
 modified or created will not help me)

 This date can also be in the future.
 Format is *T.  * - (eg. *7. April 2021* or *13. August 2021*) 
 – this is the long date in German (like "DDth MMM ")

 'published' is also shown in TOC:

   [image: TOC.png]

 Now asked for a way to sort TOC on ‘published’ instead of Tiddler title.

 The output should still be "DDth MMM "

 Thanks
 Stefan
 Eric Shulman schrieb am Montag, 16. August 2021 um 03:12:35 UTC+2:

> On Sunday, August 15, 2021 at 4:47:47 PM UTC-7 Mark S. wrote:
>
>> Just tried 
>> <>
>> and got a hard RSOE ("from" not defined). I think the arguments need 
>> to be tweaked in the macro.
>>
>
> OOPS!  I had originally used "date" and "format" as the parameter 
> names, but then I decided to change to using "from" and "to".  
> Unfortunately, the arguments in the macro function declaration were still 
> using "date" and "format", but internally, the macro code referenced 
> "from" 
> and "to" as intended.  I've corrected the arguments in the macro function 
> declaration and posted an update here:
>
> https://tiddlytools.com/timer.html#TiddlyTools%2FTime%2FConvertDate
>
> Thanks,
> -e
>


-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/79344627-e3b3-4b8a-a9d7-8d6bf84f3843n%40googlegroups.com.


[tw5] Re: convert date in a text field to date format

2021-08-16 Thread 'Mark S.' via TiddlyWiki

So, did you add Eric's macro to your TW and verify it works? That would be 
the first step in trouble-shooting. Remember, after loading the convertdate 
macro, you have to save and reload your TW file.

It worked for me without problem:




On Monday, August 16, 2021 at 12:30:13 PM UTC-7 S² wrote:

> Mark, thanks for feedback.
>
> The added 'published-tw' field is empty - no values:
> [image: published-tw.png]
>
> Mark S. schrieb am Montag, 16. August 2021 um 20:31:28 UTC+2:
>
>> So what you really need is a filter operator that can do the conversion 
>> and be used inside a sortsub operator. @Eric ?
>>
>> If you're willing to use an "update" button, one solution would be a 
>> button that creates "published-tw" (date in TW format) fields for any 
>> tiddler that has a "published" field. Then you could have the TOC sort on 
>> the published-tw field. You would have to remember to periodically perform 
>> the "update" whenever you had data changes. This two-step approach makes 
>> certain activities in TW much easier to handle.
>>
>> So the code to update the field might look like:
>>
>> <$button>Update Publication Dates
>> <$list filter="[has[published]]">
>> <$wikify text="""<$macrocall $name=convertdate from={{!!published}} 
>> to="[UTC]0MM0DD0hh0mm0ss0XXX" />""" name=result >
>> <$action-setfield $field=published-tw $value=<> />
>> 
>> 
>> 
>>
>> Be sure to make a backup before trying this of course. Also, this assumes 
>> that you have the latest version of Eric's converdate macro installed.
>>
>>
>> On Monday, August 16, 2021 at 3:37:26 AM UTC-7 S² wrote:
>>
>>> Hello,
>>>
>>> thanks for all input and effort.
>>> It looks like it is not so easy...
>>>
>>> As I wrote, I use the text field ‘publish’ to add a date. (date modified 
>>> or created will not help me)
>>>
>>> This date can also be in the future.
>>> Format is *T.  * - (eg. *7. April 2021* or *13. August 2021*) – 
>>> this is the long date in German (like "DDth MMM ")
>>>
>>> 'published' is also shown in TOC:
>>>
>>>   [image: TOC.png]
>>>
>>> Now asked for a way to sort TOC on ‘published’ instead of Tiddler title.
>>>
>>> The output should still be "DDth MMM "
>>>
>>> Thanks
>>> Stefan
>>> Eric Shulman schrieb am Montag, 16. August 2021 um 03:12:35 UTC+2:
>>>
 On Sunday, August 15, 2021 at 4:47:47 PM UTC-7 Mark S. wrote:

> Just tried 
> <>
> and got a hard RSOE ("from" not defined). I think the arguments need 
> to be tweaked in the macro.
>

 OOPS!  I had originally used "date" and "format" as the parameter 
 names, but then I decided to change to using "from" and "to".  
 Unfortunately, the arguments in the macro function declaration were still 
 using "date" and "format", but internally, the macro code referenced 
 "from" 
 and "to" as intended.  I've corrected the arguments in the macro function 
 declaration and posted an update here:

 https://tiddlytools.com/timer.html#TiddlyTools%2FTime%2FConvertDate

 Thanks,
 -e

>>>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/e782d244-31e7-4c23-ba00-94b2d16031dan%40googlegroups.com.


[tw5] Re: Presenting Text-to-Speech v1.0.0: the flip-side of Speech-to-Text!

2021-08-16 Thread Finn Lancaster
Thanks for the info! Rather than implement my plugin into others, I figure 
I'll just add a scroll JS function. Taking a look at the autoscroll plugin, 
it just seems to mathematically difficult to translate the scroll 
time/distance into coordinates. Instead, I can just write a function with 
JS to scroll to certain coords, which is much more mathematically feasible 
since I can send the line num to the function.

On Monday, August 16, 2021 at 3:25:17 PM UTC-4 Eric Shulman wrote:

> On Monday, August 16, 2021 at 11:19:54 AM UTC-7 flanc...@gmail.com wrote:
>
>> I'll have to look at implementation, but the idea is definitely good!
>>
>
> https://tiddlytools.com/autoscroll.html uses CSS transforms and 
> transitions to implement a timed autoscrolling display.
> In particular, look in 
> https://tiddlytools.com/autoscroll.html#TiddlyTools%2FAutoScroll%2FViewer 
> at the start() and stop() macros that actually apply the CSS syntax
>
> -e
>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/518d61e8-69bd-43c1-ab00-3d7bf2837a65n%40googlegroups.com.


Re: [tw5] Stupid Question: Add button to ViewBar(?) with JS Only.

2021-08-16 Thread Finn Lancaster
Thanks! I've already had a look around the Developer TW page, but, sadly, 
it does seem lacking on so-much info. Instead, I've had to refer to various 
posts/pages written by other community-members, but even those are 
few-and-far between for some of what I want to know.

On the note of calling the JS function, I would like to call a pre-defined 
script in the startup folder, with the tiddler text as an argument. The 
call would look like
text_to_speech(TIDDLER TEXT HERE)

Is this possible to do, or does it need a line in a .info file, or 
something so that one can access the functions of the other?

On Monday, August 16, 2021 at 4:17:04 PM UTC-4 jeremy...@gmail.com wrote:

> Hi Finn
>
> Thanks Jeremy! I was able to get the button to show-up! I have a few more 
>> stupid questions, if you have the time, mainly related to styling these 
>> buttons and to wikitext.
>>
>> Firstly, I would like the colour of the button to change onhover. While 
>> this is simple to do with CSS, I imagine it needs some sort of special 
>> stylesheet (styles.tid, perhaps), to do this. It would be great if you 
>> could share the syntax needed for this.
>>
>
> As you inferred, there are two parts: (a) assign a class to the button and 
> (b) create a stylesheet with a :hover rule. Stylesheets are ordinary 
> tiddlers with the tag "$:/tags/Stylesheet", and (usually) the type 
> "text/css".
>
> For dynamic effects, one can also use the wikitext type 
> "text/vnd.tiddlywiki" and use wikitext primitives like <$list> to generate 
> stylesheet rules dynamically.
>  
>
>> Next and lastly, I am a bit confused as to how to implement this with JS. 
>> I would like to be able to get the tiddler text, and then call a JS 
>> function with this JS text as an argument. How could I go about getting the 
>> tiddler text when the button is clicked, and then have this transfer over 
>> to JS for the function call?
>>
>
> It sounds like you want to make a view toolbar button that calls a JS 
> function to do something with the text of a tiddler. There are quite a few 
> ways to do that, and the precise details will depend on what you're trying 
> to achieve. What does the JS function do with the text? Does it need to 
> update the tiddler value in the store?
>
> The key types of JS modules in TW5 are as follows:
>
> * JS macros for simple deterministic text transformations that don't have 
> any side effects (eg they cannot modify the tiddler store)
> * Widgets for dynamic components that reflect values in the tiddler store, 
> and automatically refresh if the values in the store change
> * Filter operators for operations on lists of items. Again, they mustn't 
> have side effects
> * Savers for saving entire TiddlyWiki HTML files
> * SyncAdaptors for saving/loading individual tiddlers to remote servers
>
> There are some docs at https://tiddlywiki.com/dev, and it's worth 
> browsing the code over at GitHub:
>
> https://github.com/Jermolene/TiddlyWiki5/tree/master/core/modules
>
> Sorry if these questions are a bit basic, but I have yet to find a good 
>> resource for learning WikiText/TW Syntax, so I have to rely on the 
>> community and you. 
>>
>
> Not at all. It sounds like you've plenty of experience of HTML, CSS and JS 
> which puts you in a great position. Some of it will be a matter of 
> unlearning some of the usual ways of doing things. TiddlyWiki is a 
> different beast: it tries to make it easy to write complex apps 
> declaratively by composing a small number of higher level primitives. But 
> it also tries to have it's cake and eat it, in the way that it tries to 
> expose the underlying flexibility of HTML, CSS and JS.
>
> Best wishes
>
> Jeremy
>
>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/fcd9d157-9f94-45b6-b23d-1bde87fc2a3en%40googlegroups.com.


Re: [tw5] Stupid Question: Add button to ViewBar(?) with JS Only.

2021-08-16 Thread Jeremy Ruston
Hi Finn

Thanks Jeremy! I was able to get the button to show-up! I have a few more 
> stupid questions, if you have the time, mainly related to styling these 
> buttons and to wikitext.
>
> Firstly, I would like the colour of the button to change onhover. While 
> this is simple to do with CSS, I imagine it needs some sort of special 
> stylesheet (styles.tid, perhaps), to do this. It would be great if you 
> could share the syntax needed for this.
>

As you inferred, there are two parts: (a) assign a class to the button and 
(b) create a stylesheet with a :hover rule. Stylesheets are ordinary 
tiddlers with the tag "$:/tags/Stylesheet", and (usually) the type 
"text/css".

For dynamic effects, one can also use the wikitext type 
"text/vnd.tiddlywiki" and use wikitext primitives like <$list> to generate 
stylesheet rules dynamically.
 

> Next and lastly, I am a bit confused as to how to implement this with JS. 
> I would like to be able to get the tiddler text, and then call a JS 
> function with this JS text as an argument. How could I go about getting the 
> tiddler text when the button is clicked, and then have this transfer over 
> to JS for the function call?
>

It sounds like you want to make a view toolbar button that calls a JS 
function to do something with the text of a tiddler. There are quite a few 
ways to do that, and the precise details will depend on what you're trying 
to achieve. What does the JS function do with the text? Does it need to 
update the tiddler value in the store?

The key types of JS modules in TW5 are as follows:

* JS macros for simple deterministic text transformations that don't have 
any side effects (eg they cannot modify the tiddler store)
* Widgets for dynamic components that reflect values in the tiddler store, 
and automatically refresh if the values in the store change
* Filter operators for operations on lists of items. Again, they mustn't 
have side effects
* Savers for saving entire TiddlyWiki HTML files
* SyncAdaptors for saving/loading individual tiddlers to remote servers

There are some docs at https://tiddlywiki.com/dev, and it's worth browsing 
the code over at GitHub:

https://github.com/Jermolene/TiddlyWiki5/tree/master/core/modules

Sorry if these questions are a bit basic, but I have yet to find a good 
> resource for learning WikiText/TW Syntax, so I have to rely on the 
> community and you. 
>

Not at all. It sounds like you've plenty of experience of HTML, CSS and JS 
which puts you in a great position. Some of it will be a matter of 
unlearning some of the usual ways of doing things. TiddlyWiki is a 
different beast: it tries to make it easy to write complex apps 
declaratively by composing a small number of higher level primitives. But 
it also tries to have it's cake and eat it, in the way that it tries to 
expose the underlying flexibility of HTML, CSS and JS.

Best wishes

Jeremy

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/9c0c867b-1876-42b6-b987-bf4af5e671a1n%40googlegroups.com.


[tw5] Re: convert date in a text field to date format

2021-08-16 Thread
Mark, thanks for feedback.

The added 'published-tw' field is empty - no values:
[image: published-tw.png]

Mark S. schrieb am Montag, 16. August 2021 um 20:31:28 UTC+2:

> So what you really need is a filter operator that can do the conversion 
> and be used inside a sortsub operator. @Eric ?
>
> If you're willing to use an "update" button, one solution would be a 
> button that creates "published-tw" (date in TW format) fields for any 
> tiddler that has a "published" field. Then you could have the TOC sort on 
> the published-tw field. You would have to remember to periodically perform 
> the "update" whenever you had data changes. This two-step approach makes 
> certain activities in TW much easier to handle.
>
> So the code to update the field might look like:
>
> <$button>Update Publication Dates
> <$list filter="[has[published]]">
> <$wikify text="""<$macrocall $name=convertdate from={{!!published}} 
> to="[UTC]0MM0DD0hh0mm0ss0XXX" />""" name=result >
> <$action-setfield $field=published-tw $value=<> />
> 
> 
> 
>
> Be sure to make a backup before trying this of course. Also, this assumes 
> that you have the latest version of Eric's converdate macro installed.
>
>
> On Monday, August 16, 2021 at 3:37:26 AM UTC-7 S² wrote:
>
>> Hello,
>>
>> thanks for all input and effort.
>> It looks like it is not so easy...
>>
>> As I wrote, I use the text field ‘publish’ to add a date. (date modified 
>> or created will not help me)
>>
>> This date can also be in the future.
>> Format is *T.  * - (eg. *7. April 2021* or *13. August 2021*) – 
>> this is the long date in German (like "DDth MMM ")
>>
>> 'published' is also shown in TOC:
>>
>>   [image: TOC.png]
>>
>> Now asked for a way to sort TOC on ‘published’ instead of Tiddler title.
>>
>> The output should still be "DDth MMM "
>>
>> Thanks
>> Stefan
>> Eric Shulman schrieb am Montag, 16. August 2021 um 03:12:35 UTC+2:
>>
>>> On Sunday, August 15, 2021 at 4:47:47 PM UTC-7 Mark S. wrote:
>>>
 Just tried 
 <>
 and got a hard RSOE ("from" not defined). I think the arguments need to 
 be tweaked in the macro.

>>>
>>> OOPS!  I had originally used "date" and "format" as the parameter names, 
>>> but then I decided to change to using "from" and "to".  Unfortunately, the 
>>> arguments in the macro function declaration were still using "date" and 
>>> "format", but internally, the macro code referenced "from" and "to" as 
>>> intended.  I've corrected the arguments in the macro function declaration 
>>> and posted an update here:
>>>
>>> https://tiddlytools.com/timer.html#TiddlyTools%2FTime%2FConvertDate
>>>
>>> Thanks,
>>> -e
>>>
>>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/d90afcff-2aad-4979-9fb3-73e39660e4e3n%40googlegroups.com.


[tw5] Re: Presenting Text-to-Speech v1.0.0: the flip-side of Speech-to-Text!

2021-08-16 Thread Eric Shulman
On Monday, August 16, 2021 at 11:19:54 AM UTC-7 flanc...@gmail.com wrote:

> I'll have to look at implementation, but the idea is definitely good!
>

https://tiddlytools.com/autoscroll.html uses CSS transforms and transitions 
to implement a timed autoscrolling display.
In particular, look 
in https://tiddlytools.com/autoscroll.html#TiddlyTools%2FAutoScroll%2FViewer 
at the start() and stop() macros that actually apply the CSS syntax

-e

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/d25d07bc-bc99-4868-a98b-c7428cf7e3a2n%40googlegroups.com.


Re: [tw5] Stupid Question: Add button to ViewBar(?) with JS Only.

2021-08-16 Thread Finn Lancaster
Thanks Jeremy! I was able to get the button to show-up! I have a few more 
stupid questions, if you have the time, mainly related to styling these 
buttons and to wikitext.

Firstly, I would like the colour of the button to change onhover. While 
this is simple to do with CSS, I imagine it needs some sort of special 
stylesheet (styles.tid, perhaps), to do this. It would be great if you 
could share the syntax needed for this.

Next and lastly, I am a bit confused as to how to implement this with JS. I 
would like to be able to get the tiddler text, and then call a JS function 
with this JS text as an argument. How could I go about getting the tiddler 
text when the button is clicked, and then have this transfer over to JS for 
the function call?

Sorry if these questions are a bit basic, but I have yet to find a good 
resource for learning WikiText/TW Syntax, so I have to rely on the 
community and you. 

Thanks Again!
On Monday, August 16, 2021 at 1:05:02 PM UTC-4 jeremy...@gmail.com wrote:

> I've been working on my plugin (
> www.github.com/flancast90/text-to-speech-in-tw5), and would like to add a 
> button to the tiddler viewBar (I think that's what it's called, the place 
> containing the More Actions, Lose, etc. buttons).
>
> Is there a way I can do this in JS only? I am quite lost, so I'll need to 
> know the file structure, code, etc.
>
>
> Adding a new view toolbar button requires a tiddler with the tag 
> $:/tags/ViewToolbar, a “caption” field, an optional “description” field, 
> and the “text” field containing the button itself (and any associated 
> dropdowns). See the core buttons for examples:
>
> https://github.com/Jermolene/TiddlyWiki5/tree/master/core/ui/ViewToolbar
>
> So, the usual approach is to bundle JS modules along with any necessary 
> wikitext tiddlers into a plugin so that they can be distributed/updated as 
> a single unit.
>
> Best wishes
>
> Jeremy.
>
>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/09a8b651-6813-4511-b4ca-68de76e756aen%40googlegroups.com.


[tw5] Re: Presenting Text-to-Speech v1.0.0: the flip-side of Speech-to-Text!

2021-08-16 Thread TiddlyTweeter
I don't know IF it needs to slavish follow it. Hopefully not. Merely that 
reading rate might be roughly matched to scroll rate in some way.

I'm GLAD you grasped my basic idea. Maybe there is some mileage in it?

Best wishes
TT

On Monday, 16 August 2021 at 20:19:54 UTC+2 flanc...@gmail.com wrote:

>
> Interesting Idea. It took me a while, but now I think I get what you're 
> saying: you would like the plugin to read, moving line by line to show WHAT 
> it is currently reading.
>
> I'll have to look at implementation, but the idea is definitely good!
> On Monday, August 16, 2021 at 12:49:37 PM UTC-4 TiddlyTweeter wrote:
>
>> Ciao Flanc
>>
>> I encourage you to look at and think a bit about 
>> https://tiddlytools.com/autoscroll.html
>>
>> Eric Shulman did a *mass* of work on AUTO-SCROLLING that went into the 
>> usual desert of neglect.
>>
>> NOW I'm wondering IF, somehow YOUR reading might be somehow combined with 
>> HIS auto scrolling text of Tiddlers?
>>
>> *Mein Ziel ist süß, obwohl es vielleicht nicht dem Zeitgeist entspricht.*
>>  
>> Best wishes
>> TT
>>
>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/0ff93ea4-4117-4b0e-b0c4-6ffdca58fbd5n%40googlegroups.com.


[tw5] Re: convert date in a text field to date format

2021-08-16 Thread 'Mark S.' via TiddlyWiki
So what you really need is a filter operator that can do the conversion and 
be used inside a sortsub operator. @Eric ?

If you're willing to use an "update" button, one solution would be a button 
that creates "published-tw" (date in TW format) fields for any tiddler that 
has a "published" field. Then you could have the TOC sort on the 
published-tw field. You would have to remember to periodically perform the 
"update" whenever you had data changes. This two-step approach makes 
certain activities in TW much easier to handle.

So the code to update the field might look like:

<$button>Update Publication Dates
<$list filter="[has[published]]">
<$wikify text="""<$macrocall $name=convertdate from={{!!published}} 
to="[UTC]0MM0DD0hh0mm0ss0XXX" />""" name=result >
<$action-setfield $field=published-tw $value=<> />




Be sure to make a backup before trying this of course. Also, this assumes 
that you have the latest version of Eric's converdate macro installed.


On Monday, August 16, 2021 at 3:37:26 AM UTC-7 S² wrote:

> Hello,
>
> thanks for all input and effort.
> It looks like it is not so easy...
>
> As I wrote, I use the text field ‘publish’ to add a date. (date modified 
> or created will not help me)
>
> This date can also be in the future.
> Format is *T.  * - (eg. *7. April 2021* or *13. August 2021*) – 
> this is the long date in German (like "DDth MMM ")
>
> 'published' is also shown in TOC:
>
>   [image: TOC.png]
>
> Now asked for a way to sort TOC on ‘published’ instead of Tiddler title.
>
> The output should still be "DDth MMM "
>
> Thanks
> Stefan
> Eric Shulman schrieb am Montag, 16. August 2021 um 03:12:35 UTC+2:
>
>> On Sunday, August 15, 2021 at 4:47:47 PM UTC-7 Mark S. wrote:
>>
>>> Just tried 
>>> <>
>>> and got a hard RSOE ("from" not defined). I think the arguments need to 
>>> be tweaked in the macro.
>>>
>>
>> OOPS!  I had originally used "date" and "format" as the parameter names, 
>> but then I decided to change to using "from" and "to".  Unfortunately, the 
>> arguments in the macro function declaration were still using "date" and 
>> "format", but internally, the macro code referenced "from" and "to" as 
>> intended.  I've corrected the arguments in the macro function declaration 
>> and posted an update here:
>>
>> https://tiddlytools.com/timer.html#TiddlyTools%2FTime%2FConvertDate
>>
>> Thanks,
>> -e
>>
>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/17785b0a-29bd-4997-a703-0f0e7cab09f4n%40googlegroups.com.


[tw5] Re: Presenting Text-to-Speech v1.0.0: the flip-side of Speech-to-Text!

2021-08-16 Thread Finn Lancaster

Interesting Idea. It took me a while, but now I think I get what you're 
saying: you would like the plugin to read, moving line by line to show WHAT 
it is currently reading.

I'll have to look at implementation, but the idea is definitely good!
On Monday, August 16, 2021 at 12:49:37 PM UTC-4 TiddlyTweeter wrote:

> Ciao Flanc
>
> I encourage you to look at and think a bit about 
> https://tiddlytools.com/autoscroll.html
>
> Eric Shulman did a *mass* of work on AUTO-SCROLLING that went into the 
> usual desert of neglect.
>
> NOW I'm wondering IF, somehow YOUR reading might be somehow combined with 
> HIS auto scrolling text of Tiddlers?
>
> *Mein Ziel ist süß, obwohl es vielleicht nicht dem Zeitgeist entspricht.*
>  
> Best wishes
> TT
>

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/1ee22f7c-fe70-4449-b493-1a87aa4275fan%40googlegroups.com.


Re: [tw5] Stupid Question: Add button to ViewBar(?) with JS Only.

2021-08-16 Thread Jeremy Ruston
> I've been working on my plugin 
> (www.github.com/flancast90/text-to-speech-in-tw5), and would like to add a 
> button to the tiddler viewBar (I think that's what it's called, the place 
> containing the More Actions, Lose, etc. buttons).
> 
> Is there a way I can do this in JS only? I am quite lost, so I'll need to 
> know the file structure, code, etc.

Adding a new view toolbar button requires a tiddler with the tag 
$:/tags/ViewToolbar, a “caption” field, an optional “description” field, and 
the “text” field containing the button itself (and any associated dropdowns). 
See the core buttons for examples:

https://github.com/Jermolene/TiddlyWiki5/tree/master/core/ui/ViewToolbar 


So, the usual approach is to bundle JS modules along with any necessary 
wikitext tiddlers into a plugin so that they can be distributed/updated as a 
single unit.

Best wishes

Jeremy.

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/B007F351-61B4-42A1-92C5-B8B5A15BE1F5%40gmail.com.


[tw5] Re: Presenting Text-to-Speech v1.0.0: the flip-side of Speech-to-Text!

2021-08-16 Thread TiddlyTweeter
Ciao Flanc

I encourage you to look at and think a bit about 
https://tiddlytools.com/autoscroll.html

Eric Shulman did a *mass* of work on AUTO-SCROLLING that went into the 
usual desert of neglect.

NOW I'm wondering IF, somehow YOUR reading might be somehow combined with 
HIS auto scrolling text of Tiddlers?

*Mein Ziel ist süß, obwohl es vielleicht nicht dem Zeitgeist entspricht.*
 
Best wishes
TT

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/f796909d-d715-4bb1-b662-82de6975ab2dn%40googlegroups.com.


Re: [tw5] Just a goofy thought: a way to get javascript into a Tiddler

2021-08-16 Thread Jeremy Ruston
Hi Finn

> On 16 Aug 2021, at 17:22, Finn Lancaster  wrote:
> 
> I don't have much experience with JS macros in TW, but I can imagine it would 
> be the same, especially if there is no sanitisation whatsoever. As to 
> eliminating iframes, normally there is no way to break-out of it. However, in 
> the case of my Proof-of-Concept with TW, the localStorage is global, and can 
> be accessed by ANY SITE. This is just one more reason I believe TW should use 
> browser cookies: they are not accessible from inside iframe, and have more 
> options for security and access.

A big part of the problem is that browsers treat all file:// URIs as a single 
origin, and don’t apply the usual same origin checks. That means that it is 
pretty much impossible to securely use local storage from a file:// URI.  For 
the same reason, browser cookies are no better than local storage.

Best wishes

Jeremy.

-- 
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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/BB56CA48-E0B5-4499-AF5B-7C357788DB01%40gmail.com.


[tw5] Re: Just a goofy thought: a way to get javascript into a Tiddler

2021-08-16 Thread Charlie Veniot
Scratch that.

Seems like an easy TW security fix is in the works so that this stream of 
"potential goodies" on my mind will be sooner-than-later worry-free.

Woohoo!

After a few times of this happening (me finding something cool that 
software allows, which has security-minded folk having an "oh poop" 
moment.)  Hmm, maybe I should be thinking of a career as a white hat, kind 
of an Inspector Clouseau version ...





On Monday, August 16, 2021 at 12:51:35 PM UTC-3 Charlie Veniot wrote:

> It kind of sounds like the iFrame element should then be outright 
> eliminated from the web entirely.
>
> That might be problematic.
>
> Re security, couldn't any tiddler that is a javascript macro be altered 
> for nefarious purposes just as easily as injecting malicious javascript 
> into an iFrame?  
>
> On Monday, August 16, 2021 at 12:39:41 PM UTC-3 flanc...@gmail.com wrote:
>
>> This seems EXTREMELY INSECURE. What is to stop an attacker from injecting 
>> malicious JS into a tiddler, regardless of whether it is "sandboxed".
>> Paste this Proof-of-Concept into a blank tiddler. What it does it steals 
>> your GitHub PAT if you have it configured, and alerts it to you. While I 
>> have not done it here, I could easily make it both invisible and have it 
>> email me the PAT's it gathers.
>>
>> CODE:
>> <$vars vSrcDoc={{{ [[ > id="clockDiv">document.getElementById('clockDiv').innerHTML = 
>> ``; 
>> document.getElementById('xss').click();]] }}}>
>> > style="border:none;width:100%;">
>> 
>>
>> Long-story-short, an attacker can easily bypass any sanitation TW 
>> employs, and harvest credentials from various sites. It is my belief that 
>> this issue needs to be fixed immediately, and brought to the attention of 
>> Jeremy and other devs.
>>
>> I would be happy to help on the repair process. I have some experience 
>> with PenTesting and fixing XSS vulnerabilities (mainly in my own 
>> applications). I would recommend adding a listener to TW changes, and 
>> checking for an iframe code. If it does contain this, TW should add a 
>> sandbox constraint on it (
>> https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#attr-sandbox
>> )
>>
>> On Monday, August 16, 2021 at 10:55:46 AM UTC-4 cj.v...@gmail.com wrote:
>>
>>> Updated one of the tiddlers in the JSON package.  New version attached.
>>>
>>> The addition highlighted below:
>>>
>>> 
>>>   
>>>   
>>> *document.oncontextmenu = function() { *
>>> *return false; *
>>> *};*
>>> let clockEl = document.getElementById("clockDiv");
>>> ...
>>>
>>> The reason for the added code:  block access to the back button in the 
>>> iFrame (by blocking access to the entire menu), which winds up performing 
>>> the back button operation on the entire browser page.
>>> On Sunday, August 15, 2021 at 11:27:41 PM UTC-3 Charlie Veniot wrote:
>>>
 I don't know what made me think of this.

 In case this has not been brought up in a while (I doubt this is new to 
 seasoned folk) ...

 I was thinking: could I use an iFrame to include simple javascript in a 
 tiddler without getting into macros or plugins that enable javascript.

 And, if I could, then could I set things up so that the iFrame is 
 showing javascript dynamically created by the tiddler ?

 So here is a way to show a digital clock in TiddlyWiki, for 
 non-programmers who just want to copy and paste javascript code from the 
 web without figuring out how the javascript code works :

 Put this in a brand new tiddler:

 *<$vars* *vSrcDoc*={{{ [[