Hi Sini-kit

Perhaps a simpler way would be to have your bootprefix code update a tiddler 
$:/_FlagSpecialCss to have the value “yes” when the time is between 1 and 5, 
and “no” otherwise. Then in your stylesheet tiddler, use a reveal widget 
something like the example below.

Best wishes

Jeremy

\define if-special-time(then,else)
<$reveal state="$:/_FlagSpecialCss" type="match" text="yes" default="no">
$then$
</$reveal>
<$reveal state="$:/_FlagSpecialCss" type="match" text="no" default="no">
$else$
</$reveal>
\end

\rules only filteredtranscludeinline transcludeinline macrodef macrocallinline 
macrocallblock

<<if-special-time then:"""

.rule-for-special-times {
        color: red;
}

"""
else: """

.rule-for-not-special-times {
        color: green;
}

""">>


> On 18 Dec 2016, at 20:22, Siniy-Kit <neras...@gmail.com> wrote:
> 
> Hi! I am writing a little script to $:/boot/bootprefix.js. This script 
> connects to other site time API, get time from it and if hours in this time 
> between 1 and 5 it must change css styles of tw5
> so I want this script to add tag $:/tags/Stylesheet to mycssstyle tiddler. I 
> write the first part with time, but don't know TW5 function to add tag to 
> tiddler
> 
>  found
> FieldManglerWidget.prototype.handleRemoveTagEvent = function(event) 
> 
> FieldManglerWidget.prototype.handleAddTagEvent = function(event)
> 
> but I don't understand how to use this functions.
> 
> -- 
> 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 
> <mailto:tiddlywiki+unsubscr...@googlegroups.com>.
> To post to this group, send email to tiddlywiki@googlegroups.com 
> <mailto:tiddlywiki@googlegroups.com>.
> Visit this group at https://groups.google.com/group/tiddlywiki 
> <https://groups.google.com/group/tiddlywiki>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/tiddlywiki/77dfdaa8-224f-444d-9613-94cc7bdceb19%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/tiddlywiki/77dfdaa8-224f-444d-9613-94cc7bdceb19%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

-- 
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 post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/C9B0A935-A89A-4B10-97D5-B9EA5E30CC84%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to