Re: [tw5] Re: Is there a solution for triggering scrolling to to Top ( when you are not using the storyriver. )

2020-04-28 Thread Jan

Hello,
for this behaviour, you can use the normal action-navigate widget and 
action-setfield setting the storyview to zooming in one button.


cheers Jan

Am 28.04.2020 um 10:15 schrieb Hubert:

Hello,

For anyone who wants to use it, you can find it here:
https://szenio.de/Grid/#Scrolltotop




It works great, thanks for sharing Jan!

It would be nice to have this action implemented on opening a tiddler 
in the zoomin story view and as part of any other single tiddler 
mode(s) that could be introduced in the future. But that's a 
discussion for a different thread.


Thanks again!
Hubert

On Monday, 27 April 2020 11:09:55 UTC+1, Jan wrote:

Hallo Saq,
heureka, it works.
For anyone who wants to use it, you can find it here:
https://szenio.de/Grid/#Scrolltotop


Thanks a lot Saq!

PS.:
Encouraged by this success it would be great generalize the function
enabeling the widget to scroll to an id that is given as a param.
Perhaps we manage that also.



Am 27.04.2020 um 00:19 schrieb Saq Imtiaz:
> Open the browser developer tools and the console. Do you see any
error messages when loading your wiki? I would expect you to.
>
> Your refresh method is not valid JavaScript. You can actually
just remove it entirely. Remove the refresh method. It will
inherit from the widget base class and that will be enough in this
case. Make sure the tiddler has the correct type for JavaScript
and module-type widget.
>
> If it still doesn't work post your new code and the code for the
button being used to trigger this. I'm currently not at a computer
so that's the best I can do for now, hope that helps.
>

--
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/8a099897-c647-4868-9cb4-faad6a3574e9%40googlegroups.com 
.


--
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/5EA85EB4.30609%40googlemail.com.


Re: [tw5] Re: Is there a solution for triggering scrolling to to Top ( when you are not using the storyriver. )

2020-04-28 Thread Jan

Hi,
you need the $:/Plugins/JJ/Grid/scrolltotop.js,  a restart and a button 
invoking the widget like

<$button>scroll to top
<$action-scrolltotop/>


Yours Jan


Am 28.04.2020 um 11:47 schrieb 'Peter Buyze' via TiddlyWiki:

Jan,

forgive my ignorance, but I dragged your plug-in to my wiki expecting 
to see that button somewhere, but I don't. What do I need to do?


--
Securely sent with Tutanota. Get your own encrypted, ad-free mailbox:
https://tutanota.com


28 Apr 2020, 11:15 by hubert...@gmail.com:

Hello,

For anyone who wants to use it, you can find it here:
https://szenio.de/Grid/#Scrolltotop




It works great, thanks for sharing Jan!

It would be nice to have this action implemented on opening a
tiddler in the zoomin story view and as part of any other single
tiddler mode(s) that could be introduced in the future. But that's
a discussion for a different thread.

Thanks again!
Hubert

On Monday, 27 April 2020 11:09:55 UTC+1, Jan wrote:

Hallo Saq,
heureka, it works.
For anyone who wants to use it, you can find it here:
https://szenio.de/Grid/#Scrolltotop


Thanks a lot Saq!

PS.:
Encouraged by this success it would be great generalize the
function
enabeling the widget to scroll to an id that is given as a param.
Perhaps we manage that also.



Am 27.04.2020 um 00:19 schrieb Saq Imtiaz:
> Open the browser developer tools and the console. Do you see
any error messages when loading your wiki? I would expect you to.
>
> Your refresh method is not valid JavaScript. You can
actually just remove it entirely. Remove the refresh method.
It will inherit from the widget base class and that will be
enough in this case. Make sure the tiddler has the correct
type for JavaScript and module-type widget.
>
> If it still doesn't work post your new code and the code for
the button being used to trigger this. I'm currently not at a
computer so that's the best I can do for now, hope that helps.
>


--
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/8a099897-c647-4868-9cb4-faad6a3574e9%40googlegroups.com

.


--
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/M6-AoNj--3-2%40tutamail.com 
.


--
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/5EA85DE0.2050304%40googlemail.com.


Re: [tw5] Re: Is there a solution for triggering scrolling to to Top ( when you are not using the storyriver. )

2020-04-28 Thread 'Peter Buyze' via TiddlyWiki
Jan,

forgive my ignorance, but I dragged your plug-in to my wiki expecting to see 
that button somewhere, but I don't. What do I need to do?
-- 
 Securely sent with Tutanota. Get your own encrypted, ad-free mailbox: 
 https://tutanota.com


28 Apr 2020, 11:15 by hubert...@gmail.com:

> Hello,
>
>
>> For anyone who wants to use it, you can find it here: 
>> https://szenio.de/Grid/#>> Scrolltotop 
>> 
>>
>
> It works great, thanks for sharing Jan!
>
> It would be nice to have this action implemented on opening a tiddler in the 
> zoomin story view and as part of any other single tiddler mode(s) that could 
> be introduced in the future. But that's a discussion for a different thread.
>
> Thanks again!
> Hubert
>
> On Monday, 27 April 2020 11:09:55 UTC+1, Jan  wrote:
>
>> Hallo Saq, 
>> heureka, it works. 
>> For anyone who wants to use it, you can find it here: 
>> https://szenio.de/Grid/#>> Scrolltotop>>  
>>  
>> Thanks a lot Saq! 
>>  
>> PS.: 
>> Encouraged by this success it would be great generalize the function 
>> enabeling the widget to scroll to an id that is given as a param. 
>> Perhaps we manage that also. 
>>  
>>  
>>  
>> Am 27.04.2020 um 00:19 schrieb Saq Imtiaz: 
>> > Open the browser developer tools and the console. Do you see any error 
>> > messages when loading your wiki? I would expect you to. 
>> > 
>> > Your refresh method is not valid JavaScript. You can actually just remove 
>> > it entirely. Remove the refresh method. It will inherit from the widget 
>> > base class and that will be enough in this case. Make sure the tiddler has 
>> > the correct type for JavaScript and module-type widget. 
>> > 
>> > If it still doesn't work post your new code and the code for the button 
>> > being used to trigger this. I'm currently not at a computer so that's the 
>> > best I can do for now, hope that helps. 
>> > 
>>  
>>
>
>
>
> --
>  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/8a099897-c647-4868-9cb4-faad6a3574e9%40googlegroups.com
>  
> >
>  .
>

-- 
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/M6-AoNj--3-2%40tutamail.com.


Re: [tw5] Re: Is there a solution for triggering scrolling to to Top ( when you are not using the storyriver. )

2020-04-28 Thread Hubert
Hello,

For anyone who wants to use it, you can find it here: 
> https://szenio.de/Grid/#Scrolltotop 
> 
>

It works great, thanks for sharing Jan!

It would be nice to have this action implemented on opening a tiddler in 
the zoomin story view and as part of any other single tiddler mode(s) that 
could be introduced in the future. But that's a discussion for a different 
thread.

Thanks again!
Hubert

On Monday, 27 April 2020 11:09:55 UTC+1, Jan wrote:

> Hallo Saq, 
> heureka, it works. 
> For anyone who wants to use it, you can find it here: 
> https://szenio.de/Grid/#Scrolltotop 
>
> Thanks a lot Saq! 
>
> PS.: 
> Encouraged by this success it would be great generalize the function 
> enabeling the widget to scroll to an id that is given as a param. 
> Perhaps we manage that also. 
>
>
>
> Am 27.04.2020 um 00:19 schrieb Saq Imtiaz: 
> > Open the browser developer tools and the console. Do you see any error 
> messages when loading your wiki? I would expect you to. 
> > 
> > Your refresh method is not valid JavaScript. You can actually just 
> remove it entirely. Remove the refresh method. It will inherit from the 
> widget base class and that will be enough in this case. Make sure the 
> tiddler has the correct type for JavaScript and module-type widget. 
> > 
> > If it still doesn't work post your new code and the code for the button 
> being used to trigger this. I'm currently not at a computer so that's the 
> best I can do for now, hope that helps. 
> > 
>
>

-- 
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/8a099897-c647-4868-9cb4-faad6a3574e9%40googlegroups.com.


Re: [tw5] Re: Is there a solution for triggering scrolling to to Top ( when you are not using the storyriver. )

2020-04-27 Thread Jan

Hallo Saq,
heureka, it works.
For anyone who wants to use it, you can find it here:
https://szenio.de/Grid/#Scrolltotop

Thanks a lot Saq!

PS.:
Encouraged by this success it would be great generalize the function 
enabeling the widget to scroll to an id that is given as a param.

Perhaps we manage that also.



Am 27.04.2020 um 00:19 schrieb Saq Imtiaz:

Open the browser developer tools and the console. Do you see any error messages 
when loading your wiki? I would expect you to.

Your refresh method is not valid JavaScript. You can actually just remove it 
entirely. Remove the refresh method. It will inherit from the widget base class 
and that will be enough in this case. Make sure the tiddler has the correct 
type for JavaScript and module-type widget.

If it still doesn't work post your new code and the code for the button being 
used to trigger this. I'm currently not at a computer so that's the best I can 
do for now, hope that helps.



--
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/5EA6AEC9.8000904%40googlemail.com.


Re: [tw5] Re: Is there a solution for triggering scrolling to to Top ( when you are not using the storyriver. )

2020-04-26 Thread Saq Imtiaz
Open the browser developer tools and the console. Do you see any error messages 
when loading your wiki? I would expect you to.

Your refresh method is not valid JavaScript. You can actually just remove it 
entirely. Remove the refresh method. It will inherit from the widget base class 
and that will be enough in this case. Make sure the tiddler has the correct 
type for JavaScript and module-type widget.

If it still doesn't work post your new code and the code for the button being 
used to trigger this. I'm currently not at a computer so that's the best I can 
do for now, hope that helps.

-- 
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/736e95b9-b2d3-40e5-8cf3-92a2dda0acd4%40googlegroups.com.


Re: [tw5] Re: Is there a solution for triggering scrolling to to Top ( when you are not using the storyriver. )

2020-04-26 Thread Jan

Hi Saq,
many thanks for your gentle explanation.
Following your recipe I made what you can find below:
It does not crash the Wiki or show the red sign, which is already great 
for a first approach;-) , but so far the button says that the widget is 
not defined:

Can you give me another hint?

Best wishes
Jan

--
Button:
<$button>scroll to top
<$action-scrolltotop/>

--

|/*\
type: application/javascript
module-type: widget


\*/
(function(){

/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";

var Widget = require("$:/core/modules/widgets/widget.js").widget;

var ScrollToTopWidget = function(parseTreeNode,options) {
this.initialise(parseTreeNode,options);
};

/*
Inherit from the base widget class
*/
ScrollToTopWidget.prototype = new Widget();

/*
Render this widget into the DOM
*/
ScrollToTopWidget.prototype.render = function(parent,nextSibling) {
this.computeAttributes();
this.execute();
};

/*
Compute the internal state of the widget
*/

/*
Refresh the widget by ensuring our attributes are up to date
*/
ScrollToTopWidget.prototype.refresh = refreshSelf() {
return true;
}
return this.refreshChildren(changedTiddlers);
};

/*
Invoke the action associated with this widget
*/
ScrollToTopWidget.prototype.invokeAction = function(triggeringWidget,event) {
window.scrollTo({ top: 0, behavior: 'smooth' });
return true; // Action was invoked
};

exports["action-scrolltotop"] = ScrollToTopWidget;

})();|




Am 26.04.2020 um 10:32 schrieb Saq Imtiaz:

In simple terms:

macros -> text substitution or defining a variable
widgets -> everything else

So you need a widget. And widgets that cause an action, rather than 
display something, need to be triggered, typically by a button, 
checkbox, select etc. These are called action widgets and the method 
that contains the logic for what happens when a widget is triggered is 
invokeAction.


Use this widget as a starting point:

|
|/*\
type: application/javascript
module-type: widget


\*/
(function(){

/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";

var  Widget  =  require("$:/core/modules/widgets/widget.js").widget;

var  AddToHistoryWidget  =  function(parseTreeNode,options)  {
 this.initialise(parseTreeNode,options);
};

/*
Inherit from the base widget class
*/
AddToHistoryWidget.prototype=  new  Widget();

/*
Render this widget into the DOM
*/
AddToHistoryWidget.prototype.render=  function(parent,nextSibling)  {
 this.computeAttributes();
 this.execute();
};

/*
Compute the internal state of the widget
*/
AddToHistoryWidget.prototype.execute=  function()  {
 this.historyTitle=  
this.getAttribute("$history",this.getVariable("tv-history-title"));
 this.newTitle=  this.getAttribute("$title");
};

/*
Refresh the widget by ensuring our attributes are up to date
*/
AddToHistoryWidget.prototype.refresh=  function(changedTiddlers)  {
 var  changedAttributes=  this.computeAttributes();
 if(changedAttributes["$historyTitle"]  ||  changedAttributes["$title"])  {
 this.refreshSelf();
 return  true;
 }
 return  this.refreshChildren(changedTiddlers);
};

/*
Invoke the action associated with this widget
*/
AddToHistoryWidget.prototype.invokeAction=  function(triggeringWidget,event)  {
 this.wiki.addToHistory(this.newTitle,{},this.historyTitle);  
 return  true;  // Action was invoked

};

exports["action-addtohistory"]  =  AddToHistoryWidget;

})();|
|

- execute() sets up the attributes via the parameters given to the 
widget, I suspect you don't need any.
- refresh() handles refreshing when the parameters have changed, 
probably also not needed. Jus call refreshSelf() and return true

- tweak invokeAction to perform the scroll.

Hope this helps.
Saq

On Sunday, April 26, 2020 at 10:05:13 AM UTC+2, Jan wrote:

Hi Saq,
I think you got me...I do not really know what the difference is.
I think all the js I did so far was macros.
I finally should learn some of the basic concepts of programming
js in TW ;-) Thanks for giving me a hint to start.

Do I need a widget or can I perform that action with a macro.

Jan


Am 26.04.2020 um 01:31 schrieb Saq Imtiaz:

You have written a macro, not a widget.

Look at one of the action widgets and write an action-totop
widget, e.g:

https://github.com/Jermolene/TiddlyWiki5/blob/master/core/modules/widgets/action-deletetiddler.js



The invokeAction method is where the logic goes for what happens
when the widget is triggered.



On Saturday, April 25, 2020 at 8:40:56 PM UTC+2, Jan wrote:


Hi,
I made a Landing-Page which uses its own Pagetemplate and

Re: [tw5] Re: Is there a solution for triggering scrolling to to Top ( when you are not using the storyriver. )

2020-04-26 Thread Jan

Hi Mat,
gridlist uses some functions of TW like the list- , reveal- and 
buttonwidget but inserts the content into its own pagetemplate.

That is why all the storyriver-related functions do not work.
It would be great to be able to navigate to ids or classes.

Jan





Am 26.04.2020 um 10:22 schrieb Mat:


But isn't it all in a tiddler, $:/Plugins/JJ/Grid/Gridlist  - ?
I think that this would work, which doesn't rely on a storylist:

|
<$action-navigate $to="$:/Plugins/JJ/Grid/Gridlist"/>
|


OK, I just tried adding it in a button to one of your tiddlers and 
you're right it does NOT work.



<:-)
--
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/d8affd86-4198-48b0-82ec-ee69f6570097%40googlegroups.com 
.


--
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/5EA5619C.3040402%40googlemail.com.


Re: [tw5] Re: Is there a solution for triggering scrolling to to Top ( when you are not using the storyriver. )

2020-04-26 Thread Saq Imtiaz
In simple terms:

macros -> text substitution or defining a variable
widgets -> everything else

So you need a widget. And widgets that cause an action, rather than display 
something, need to be triggered, typically by a button, checkbox, select 
etc. These are called action widgets and the method that contains the logic 
for what happens when a widget is triggered is invokeAction.

Use this widget as a starting point:

/*\
type: application/javascript
module-type: widget


\*/
(function(){

/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";

var Widget = require("$:/core/modules/widgets/widget.js").widget;

var AddToHistoryWidget = function(parseTreeNode,options) {
this.initialise(parseTreeNode,options);
};

/*
Inherit from the base widget class
*/
AddToHistoryWidget.prototype = new Widget();

/*
Render this widget into the DOM
*/
AddToHistoryWidget.prototype.render = function(parent,nextSibling) {
this.computeAttributes();
this.execute();
};

/*
Compute the internal state of the widget
*/
AddToHistoryWidget.prototype.execute = function() {
this.historyTitle = 
this.getAttribute("$history",this.getVariable("tv-history-title"));
this.newTitle = this.getAttribute("$title");
};

/*
Refresh the widget by ensuring our attributes are up to date
*/
AddToHistoryWidget.prototype.refresh = function(changedTiddlers) {
var changedAttributes = this.computeAttributes();
if(changedAttributes["$historyTitle"] || changedAttributes["$title"]) {
this.refreshSelf();
return true;
}
return this.refreshChildren(changedTiddlers);
};

/*
Invoke the action associated with this widget
*/
AddToHistoryWidget.prototype.invokeAction = function(triggeringWidget,event) {
this.wiki.addToHistory(this.newTitle,{},this.historyTitle); 
return true; // Action was invoked
};

exports["action-addtohistory"] = AddToHistoryWidget;

})();


- execute() sets up the attributes via the parameters given to the widget, 
I suspect you don't need any.
- refresh() handles refreshing when the parameters have changed, probably 
also not needed. Jus call refreshSelf() and return true
- tweak invokeAction to perform the scroll.

Hope this helps.
Saq

On Sunday, April 26, 2020 at 10:05:13 AM UTC+2, Jan wrote:
>
> Hi Saq,
> I think you got me...I do not really know what the difference is. 
> I think all the js I did so far was macros. 
> I finally should learn some of the basic concepts of programming js in TW 
> ;-) Thanks for giving me a hint to start. 
>
> Do I need a widget or can I perform that action with a macro.
>
> Jan
>
>
> Am 26.04.2020 um 01:31 schrieb Saq Imtiaz:
>
> You have written a macro, not a widget. 
>
> Look at one of the action widgets and write an action-totop widget, e.g:
>
> https://github.com/Jermolene/TiddlyWiki5/blob/master/core/modules/widgets/action-deletetiddler.js
>
> The invokeAction method is where the logic goes for what happens when the 
> widget is triggered.
>
>
>
> On Saturday, April 25, 2020 at 8:40:56 PM UTC+2, Jan wrote: 
>>
>> Hi, 
>> I made a Landing-Page which uses its own Pagetemplate and hides the 
>> storyriver: https://szen.io/Grid/ 
>> The grid can be restructured by setting a tag to filter content. 
>> When a user triggers this action, it would be great to scroll to the top 
>> of the Webpage automatically. 
>> How can I do this? 
>>
>> Best wishes Jan 
>>
>> Hi, 
>>
>> I tried to build a widget, but so far it wont work. 
>>
>>
>>
>> /*\
>> title: $:/core/modules/macros/totop.js
>> type: application/javascript
>> module-type: macro
>> Macro that scrolls to the top
>> \*/
>>
>> (function(){
>>/*jslint node: true, browser: true */
>>/*global $tw: false */
>>"use strict";
>>
>> /*
>> Information about this macro
>> */
>>exports.name = "totop";
>>exports.params = [
>>];
>> /*
>> Run the macro
>> */
>>exports.run = function() {
>>var totopp = window.scrollTo({ top: 0, behavior: 'smooth' });
>>totopp;
>> }
>> })();
>>
>>
>> -- 
> 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 tiddl...@googlegroups.com .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/tiddlywiki/3e58e2ff-7a57-4efd-8f04-0ba6ed5431de%40googlegroups.com
>  
> 
> .
>
>
>

-- 
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/e8e9ec93-295d-48a1-931b-d92ec0e096ca%40googlegroups.com.


Re: [tw5] Re: Is there a solution for triggering scrolling to to Top ( when you are not using the storyriver. )

2020-04-26 Thread Mat

>
> But isn't it all in a tiddler, $:/Plugins/JJ/Grid/Gridlist  - ?
> I think that this would work, which doesn't rely on a storylist:
>
> <$action-navigate $to="$:/Plugins/JJ/Grid/Gridlist"/>
>

OK, I just tried adding it in a button to one of your tiddlers and you're 
right it does NOT work.


<:-)

-- 
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/d8affd86-4198-48b0-82ec-ee69f6570097%40googlegroups.com.


Re: [tw5] Re: Is there a solution for triggering scrolling to to Top ( when you are not using the storyriver. )

2020-04-26 Thread Mat

>
> my problem is, that the grid does not use storylist or storyriver, they 
> are not even displayed. I could try the navigator widget...I am  not 
> optimistic with that.
>

But isn't it all in a tiddler, $:/Plugins/JJ/Grid/Gridlist  - ?
I think that this would work, which doesn't rely on a storylist:

<$action-navigate $to="$:/Plugins/JJ/Grid/Gridlist"/>


But, sure, since you know js then do that. I was just pointing to what I 
believe is a wikitext solution.

<:-)

-- 
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/0e741d8a-0e96-42fb-8aa5-49c91bcab799%40googlegroups.com.


Re: [tw5] Re: Is there a solution for triggering scrolling to to Top ( when you are not using the storyriver. )

2020-04-26 Thread Jan

Hi Saq,
I think you got me...I do not really know what the difference is.
I think all the js I did so far was macros.
I finally should learn some of the basic concepts of programming js in 
TW ;-) Thanks for giving me a hint to start.


Do I need a widget or can I perform that action with a macro.

Jan


Am 26.04.2020 um 01:31 schrieb Saq Imtiaz:

You have written a macro, not a widget.

Look at one of the action widgets and write an action-totop widget, e.g:
https://github.com/Jermolene/TiddlyWiki5/blob/master/core/modules/widgets/action-deletetiddler.js

The invokeAction method is where the logic goes for what happens when 
the widget is triggered.




On Saturday, April 25, 2020 at 8:40:56 PM UTC+2, Jan wrote:


Hi,
I made a Landing-Page which uses its own Pagetemplate and hides
the storyriver: https://szen.io/Grid/
The grid can be restructured by setting a tag to filter content.
When a user triggers this action, it would be great to scroll to
the top of the Webpage automatically.
How can I do this?

Best wishes Jan


Hi,

I tried to build a widget, but so far it wont work.

|

/*\
title: $:/core/modules/macros/totop.js
type: application/javascript
module-type: macro
Macro that scrolls to the top
\*/

(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";

/*
Information about this macro
*/
exports.name    = "totop";
exports.params = [
];
/*
Run the macro
*/
exports.run = function() {
var totopp = window.scrollTo({ top: 0, behavior: 'smooth' });
totopp;
}
})();|


--
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/3e58e2ff-7a57-4efd-8f04-0ba6ed5431de%40googlegroups.com 
.


--
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/5EA54011.8090003%40googlemail.com.


Re: [tw5] Re: Is there a solution for triggering scrolling to to Top ( when you are not using the storyriver. )

2020-04-26 Thread Jan

Hi Birthe, hi  Mat,
my problem is, that the grid does not use storylist or storyriver, they 
are not even displayed. I could try the navigator widget...I am  not 
optimistic with that.

FIrst I will use Saq`s apporach.

Jan



Am 25.04.2020 um 20:57 schrieb Mat:

Maybe

|
trigger
...
<$set name=top filter="""[list[$:/StoryList]first[]]""">
<$action-navigate $to=<>/>

|

<:-)
--
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/d9fff9ba-caca-4cc5-8819-b504a30a09c1%40googlegroups.com 
.


--
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/5EA53E5D.1040106%40googlemail.com.


[tw5] Re: Is there a solution for triggering scrolling to to Top ( when you are not using the storyriver. )

2020-04-25 Thread Saq Imtiaz
You have written a macro, not a widget.

Look at one of the action widgets and write an action-totop widget, e.g:
https://github.com/Jermolene/TiddlyWiki5/blob/master/core/modules/widgets/action-deletetiddler.js

The invokeAction method is where the logic goes for what happens when the 
widget is triggered.



On Saturday, April 25, 2020 at 8:40:56 PM UTC+2, Jan wrote:
>
> Hi, 
> I made a Landing-Page which uses its own Pagetemplate and hides the 
> storyriver: https://szen.io/Grid/ 
> The grid can be restructured by setting a tag to filter content. 
> When a user triggers this action, it would be great to scroll to the top 
> of the Webpage automatically. 
> How can I do this? 
>
> Best wishes Jan 
>
> Hi, 
>
> I tried to build a widget, but so far it wont work. 
>
>
>
> /*\
> title: $:/core/modules/macros/totop.js
> type: application/javascript
> module-type: macro
> Macro that scrolls to the top
> \*/
>
> (function(){
>/*jslint node: true, browser: true */
>/*global $tw: false */
>"use strict";
>
> /*
> Information about this macro
> */
>exports.name = "totop";
>exports.params = [
>];
> /*
> Run the macro
> */
>exports.run = function() {
>var totopp = window.scrollTo({ top: 0, behavior: 'smooth' });
>totopp;
> }
> })();
>
>
>

-- 
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/3e58e2ff-7a57-4efd-8f04-0ba6ed5431de%40googlegroups.com.


[tw5] Re: Is there a solution for triggering scrolling to to Top ( when you are not using the storyriver. )

2020-04-25 Thread Mat
Maybe

trigger
...
<$set name=top filter="""[list[$:/StoryList]first[]]""" >
<$action-navigate $to=<>/>


<:-)

-- 
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/d9fff9ba-caca-4cc5-8819-b504a30a09c1%40googlegroups.com.


[tw5] Re: Is there a solution for triggering scrolling to to Top ( when you are not using the storyriver. )

2020-04-25 Thread Birthe C
Thomas Elmigers Linktotop 


-- 
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/a751f6f2-28ef-43ed-9036-253b8cafb79d%40googlegroups.com.


[tw5] Re: Is there a solution for triggering scrolling to to Top ( when you are not using the storyriver. )

2020-04-25 Thread Jan

Hi,
I made a Landing-Page which uses its own Pagetemplate and hides the 
storyriver: https://szen.io/Grid/

The grid can be restructured by setting a tag to filter content.
When a user triggers this action, it would be great to scroll to the 
top of the Webpage automatically.

How can I do this?

Best wishes Jan


Hi,

I tried to build a widget, but so far it wont work.

|

/*\
title: $:/core/modules/macros/totop.js
type: application/javascript
module-type: macro
Macro that scrolls to the top
\*/

(function(){
   /*jslint node: true, browser: true */
   /*global $tw: false */
   "use strict";

/*
Information about this macro
*/
   exports.name = "totop";
   exports.params = [
   ];
/*
Run the macro
*/
   exports.run = function() {
   var totopp = window.scrollTo({ top: 0, behavior: 'smooth' });
   totopp;
}
})();|


--
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/5EA48391.3090700%40googlemail.com.