[twdev] Re: "document not defined" error while rendering

2020-06-02 Thread Riz
Nevermind. Solved it by using $tw.fakeDocument

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywikidev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/643866de-0d4d-4bdc-ad46-03013b45a9d6%40googlegroups.com.


[twdev] "document not defined" error while rendering

2020-06-02 Thread Riz
I wrote a simple js macro. It create a few DOM elements and returns the 
outerHTML as a string. This works perfectly in TW5. However when I try to 
render a tiddler containing a call to said macro, tw5 gives me the error 
"document is not defined". I did some googling and found out that document 
variable is defined after window finishes loading. So my hypothesis is 
since render command is essentially headless, document remains undefined.

So questions:
1. Is my hypothesis correct?
2. Is there a way to circumvent it?

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywikidev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/74d7308f-3b32-412d-820c-eebe458fb06d%40googlegroups.com.


[twdev] Re: Tiddloid - A new android editor is to be released

2019-10-11 Thread Riz
Hey donmor3000,

Great fan of your work. It has become my go to solution for using tw5 in 
android. The app has matured really well.

This is clearly the best solution in android. May I encourage you to create 
a PR towards the main documentation site of TW5, so that more people may 
get to use it?

As to the readers, go use it and star the repo, people!! If such a great 
product is left unnoticed, it will be a shame.


On Friday, 11 October 2019 15:54:19 UTC+5:30, donmor3000 wrote:
>
> A new release  (1.3.2) came out. Please check the GitHub page to get it.
>
> Update detail:
>
>- UI tweaks
>- Large favicon support
>- Bug fixes and code refactoring
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywikidev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/1cfe361f-d159-4ca5-814c-d1a2dd03eb08%40googlegroups.com.


Re: [twdev] Re: How to navigate to ids within a tiddler? Or How to add refresh between two steps of a widget

2019-09-19 Thread Riz
Hi Tony,

Thanks for the reply. You are right, that would not have scaled well. Plus, 
we have a solution. Possibly something we can expand upon too! See above

Sincerely,
Riz

On Thursday, 19 September 2019 13:33:38 UTC+5:30, TonyM wrote:
>
> Riz,
>
> I understand. This limitation is really because we have a dynamic HTML 
> page here, and the HTML standards did not seem to predict how we can use it 
> in tiddlywiki.
>
> One passing thought, what if select tiddlers not already in the "visible" 
> story, could be display: none (as opposed to display: hidden) below the 
> story and somehow displayed when an anchor to something in them is 
> activated. This of course may not scale too well, but may work for a large 
> number of cases. Come to think of it tiddlers are in memory anyway, perhaps 
> its is not so silly.
>
> Tiddlers to be treated this way could be tagged as such, and those not in 
> the current story are "display: None" and once opened and displayed are 
> not. In some ways this would be an open tiddler cache and since present on 
> the page should be fully addressable with anchors. This could also be used 
> to activate on demand stylesheets.
>
> Regards
> Tony
>
> On Thursday, September 19, 2019 at 3:40:20 PM UTC+10, Riz wrote:
>>
>> I am aware of that. However if I recall correctly, 
>> 1. it only aids navigation if the link and id exists within same tiddler 
>> or 
>> will scroll to id if it is already present in storylist. 
>> 2. Need to modify ids to fit its unconventional pattern. 
>>
>> You see, the code given in my original post already solved the issue of 
>> scrolling to an id if it exists in the storylist, without having to 
>> modify 
>> ids in any manner. My issue was if the id is not present in the story 
>> list, 
>> it takes 2 clicks to achieve the navigation: first to bring tiddler to 
>> storylist, second to scroll. 
>>
>> On 19 September 2019 11:02:41 AM TonyM  wrote: 
>>
>> > If it helps there is prior work on using anchors in tiddlywiki. It 
>> relies 
>> > on an unconventional use of ## 
>> > 
>> > Regards 
>> > Tont 
>> > 
>> > -- 
>> > You received this message because you are subscribed to a topic in the 
>> > Google Groups "TiddlyWikiDev" group. 
>> > To unsubscribe from this topic, visit 
>> > https://groups.google.com/d/topic/tiddlywikidev/NcCXnZu-OJE/unsubscribe. 
>>
>> > To unsubscribe from this group and all its topics, send an email to 
>> > tiddly...@googlegroups.com. 
>> > To view this discussion on the web visit 
>> > 
>> https://groups.google.com/d/msgid/tiddlywikidev/7dd87c37-15ad-447d-8316-6db99459c52c%40googlegroups.com.
>>  
>>
>>
>>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywikidev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/16d33e2a-99df-452e-89b1-62fba39d8c15%40googlegroups.com.


[twdev] Re: How to navigate to ids within a tiddler? Or How to add refresh between two steps of a widget

2019-09-19 Thread Riz
Thank you Mario!!!
Just saved me hours of further headbashing.

So status report. I don't have enough knowledge about the codebase to add a 
post navigation hook. 
Instead, I tried adding the event in handleNavigate function after the 
actual navigation code. This did not work either.

But settimeout worked!! Through trial and error, I reached the conclusion 
that 4ms is the minimum time delay required to let the browser find the 
newly added id.
My assumption is, this 5ms mark is either dependent on the specifications 
of the system running it, or dependent on some setting in TW5 code. 
However for my purposes, this is far more than enough. Now I have a widget 
that can navigate to an id defined midway in a tiddler, if the tiddler name 
and id name is given as parameters.


May I suggest something interesting that come up during this endeavor. As 
coda mentioned above, TW5 cannot use ids for subtiddler navigation. However 
we can use practically anything else.
Imagine an action widget that says

document.querySelector("div > p.myclass").scrollIntoView();



May be TW5 can even specify some data-Attribute value set aside for this? 
Like


val element = document.querySelector("h1[data-anchor=firstlink]");
element.scrollIntoView();


Sincerely
Riz


On Thursday, 19 September 2019 12:51:19 UTC+5:30, PMario wrote:
>
> Hi Riz, 
>
> You are right. The IDs are not available at the time the widget is called 
> the first time. 
>
> You could try an "ugly hack" with setTimeout(). You could wrap your if (
> document.getElementById(this.uniqueid) != null) {
> code into a function eg: delayScrollIntoView()... or something similar. 
> And call it from setTimeout() eg: $:/config/AnimationDuration + 50 ms
>
> Or hardcoded 450ms. .. 
>
> just an idea. 
>
> There is a th-navigating 
> <https://tiddlywiki.com/dev/#Hook%3A%20th-navigating> hook, but it is 
> called to early. ... So if you want a clean fix, it would be needed to 
> create a th-post-navigating hook. 
>
> have fun!
> mario
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywikidev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/2403e6df-9a2c-4a3c-b145-c2d2d48c7eaf%40googlegroups.com.


[twdev] How to navigate to ids within a tiddler? Or How to add refresh between two steps of a widget

2019-09-18 Thread Riz
I was collecting a lot of articles in my TW. Now these HTML obviously have 
tags with ids associated especially headings (eg: Subheading). 
I was trying to build a build a widget to navigate to these ids (I guess 
the term is subtiddler navigation)

The idea is to have a widget that takes two parameters: a title and an id. 
It should then add the tiddler to the storylist followed by scrolling to 
the id. 

Now I was partially successful in getting what I want by tweaking 
action-navigate widget. Below is the relevant part of widget.

this.dispatchEvent({
type: "tm-navigate",
navigateTo: this.actionTo === undefined ? this.getVariable(
"currentTiddler") : this.actionTo,
navigateFromTitle: this.getVariable("storyTiddler"),
navigateFromNode: triggeringWidget,
navigateFromClientRect: bounds && { top: bounds.top, left: bounds.
left, width: bounds.width, right: bounds.right, bottom: bounds.bottom, 
height: bounds.height
},
navigateSuppressNavigation: true
});


if (document.getElementById(this.uniqueid) != null) {
document.getElementById(this.uniqueid).scrollIntoView();
}




As you can see, it only works if you double click the button. At first 
click the tiddler is added to storylist, and second click scrolls the id 
into view (Note that the navigateSuppressNavigation must be set to true for 
this to work). 

I assume it cannot find the *id* right after the navigation is beacuse 
there is a need for a *refresh* between the two steps? 

My question is: Is there a way to achieve this?

PS: I tried a few other things namely
1. Have two calls of action-widget under the same button like:
<$button>
<$action-anchor $to="MyTiddler" $id="uniqueid"/>
<$action-anchor $to="MyTiddler" $id="uniqueid"/>



2. Programmatically simulate double click on the button with 
document.getElementsByClassName('my-unique-class')[0].dispatchEvent(new 
MouseEvent('dblclick', {'bubbles': true})) 



I mean, it is e, but it shows how desperate I am to get this to work.


Sincerely
Riz

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywikidev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/c7baf1d4-7c39-4477-afab-b29e4e62dc2c%40googlegroups.com.


[twdev] Re: My Blog is now a TW

2018-12-27 Thread Riz
Hi Joe,

I see you are enjoying your TW5 quite well. Here is a thought for your 
consideration. The basic TW5 you download from GitHub or tiddlywiki.com is a 
good fit for several things. Unfortunately the idea of using Tiddlywiki itself 
as a blog has a major downside. The unique structure and data storage of TW5 
doesn't fly well with the search engine optimisation guidelines of most search 
engines. Here's an experiment. The most popular website using Tiddlywiki is 
obviously tiddlywiki.com itself. Now search Google for "Tiddlywiki HelloThere". 
You will see that large part of links point to tiddlywiki.com/static/, which 
are not Tiddlywiki files, but static HTML generated by Tiddlywiki.

Ergo, if you are serious about using TW5 for blogging, use it not as blog 
itself, but as a static site generator, a role for which Tiddlywiki is one of 
the best fits. 

There was a "blog edition Tiddlywiki" as a part of core. However I cannot find 
it in github right now.

Sincerely,
Riz

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/f0d667a5-4b50-42cb-bed6-777e2d963065%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[twdev] Re: Proposal: Changing PageTemplate list filter to be a macro

2018-03-21 Thread Riz
I agree with the CSS line of thought wrt fonts and others, as there is 
nothing much to gain in introducing a redundant mechanism to tie them to 
view-port size. 

However, things like page-template and editor toolbar buttons are 
different. Problem with CSS here is, `display:none` is inefficient. Yes it 
won't be displayed, but it will be loaded nevertheless. This is acceptable 
when you have a couple of page-templates to remove, but imagine third party 
themes with radically different page-templates having to load all the 
default page-templates in addition to the new ones. It is an unnecessary 
burden.



@Mat

Yes!. You can define the filter in a macro tiddler ($:/tags/Macro) using 
the correct variable name. 

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/50bba8b1-e65c-4a78-85ce-ff4c72f2e5b9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [twdev] Proposal: Changing PageTemplate list filter to be a macro

2018-03-21 Thread Riz
That would be nice to see in action. Although I am eager to see how we are 
going to bring the environmental variables into play. Is it going to be 
like: If platform is android => Visibiliy tiddlers are created at startup?




-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/c40c0da1-1a95-406e-8cdc-ab2cac24dbcc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[twdev] Proposal: Changing PageTemplate list filter to be a macro

2018-03-20 Thread Riz


Something like

<$list filter=<> variable="listItem">

in the $:/core/ui/PageTemplate?


It will allow complex and fine grained manipulations of display like

exports.run = function() {
var filter;
if (window.matchMedia("(min-width: 960px)").matches) {
 filter = 
"[all[shadows+tiddlers]tag[$:/tags/PageTemplate]!has[draft.of]]";
} else {
 filter = "[all[shadows+tiddlers]tag[$:/tags/PageTemplate]!has[draft.of]] 
-$:/core/ui/PageTemplate/sidebar";
}

return filter;

and so on. 

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/96302185-29b6-43a1-88da-b4f8c857bbfa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[twdev] Re: Serving external resources from TW5 node server

2018-03-04 Thread Riz
https://github.com/Jermolene/TiddlyWiki5/tree/http-server

This branch seems to  solve your issue. It is not merged to the main yet. 
But you can fork out the TW and merge it in your local repo and use it. 


On Saturday, 3 March 2018 20:36:23 UTC+5:30, joearms wrote:
>
> I'm using TW5 node server.
>
>
> In order to add a local image from an external (ie not the node server) 
> server I did this :
>
>
> 1) create a tiddler image.jpg
>
>
> 2) set the mime type to image/jpg
>
>
> 3) set _canonical_uri to the correct address in this case 
> http://localhost:9000/image.jpgwhich is where I put my external server.
>
>
> So Now I have two servers running
>
>
> One on 127.0.0.1:8080 which is the node.js server
>
>
> One on localhost:9000 which is my little local server
>
>
> This works fine - but ...
>
>
> Can I serve the image from the node server?
>
> I'd like one rather than two servers running
>
>
> Cheers
>
>
> /Joe
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/3dddf0b9-95c0-4eb5-8b33-dcc4f96ec61a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[twdev] Re: add viewport macro to core?

2018-02-21 Thread Riz


I do not mind that either - as long as I do not have to install a plugin 
just to get access to this piece of info. As in, I recommend this to core - 
instead of a plugin. 

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/2abd5642-f389-44b7-8bc2-66cc27e7d496%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[twdev] Re: add viewport macro to core?

2018-02-20 Thread Riz
IMHO, shouldn't we add them as a part of existing $:/Info tiddlers? That is 
where it is expected, right? If we do that, third party themes which 
radically changes outlook by differing Pagetemplates can make use of it. 
Please consider if not too late already.

sincerely,
Riz

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/13608af9-9aa2-472e-bf1d-efea0009b776%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[twdev] Re: add viewport macro to core?

2018-02-18 Thread Riz


>
> Could you name some?
>
>
>
Loading separate page-templates for mobile platform would be a start. 

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/20b0bde1-c3f1-43b4-ad9f-04301422aa95%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[twdev] Re: Any chance for a single-tiddler story "river"?

2018-02-08 Thread Riz
Is there a problem with using zoomin storyview? Control Panel > Appearance 
> Story View > Zoomin

On Thursday, 8 February 2018 22:36:18 UTC+5:30, TheDiveO wrote:
>
> Is there any chance for a single-tiddler story river, where only one 
> tiddler is shown in the river?
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/c3cf122d-f290-4a75-b8f8-69bc82012d58%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[twdev] Re: Small RSS feed of possible interest

2017-02-10 Thread Riz
+1 for the find !!!

On Saturday, 11 February 2017 01:30:36 UTC+5:30, Mat wrote:
>
> https://github.com/55sketch/simple-rss/blob/master/simple-rss.js
>
>
> <:-)
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/fc515d61-2171-4de9-8898-6e2152c8f3cf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[twdev] Re: [TW5] How to Customize the "New Tiddler" content?

2017-02-08 Thread Riz
If you want a particular content in all your tiddlers, you are better off 
with viewtemplate.

Create a tiddler, put your footer in text field.
Add "$:/tags/ViewTemplate" as tag
Create a field called list-after, add the value as "
$:/core/ui/ViewTemplate/body 
"

Now your footer will be added to every tiddler and you can see it when you 
save the tiddler.

PS: the third step is unnecessary. 

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/6473044d-2c67-46d5-958b-78ab4341944b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [twdev] Re: [TW5/TWC] Interesting new "Beaker Browser" with peer-to-peer hosting

2016-12-21 Thread Riz

Error while saving:
Dat Saver Error: ProtectedFileNotWritableError


Linux Mint 18 Sarah


-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywikidev+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywikidev@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/5ab5f159-4799-455a-b7f4-13c261fc2aee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.