Re: [tw] How to $tw.wiki.renderTiddler caption field?

2018-01-06 Thread sini-Kit
yes. There are some reasons I cant use this technique. For example, all 
items in shop have two fields weight and size. When script get order, 
it counts sum of weights and sizes from this fields picking them by title. 
So I can get delivery price of current order by formula. it is not possible 
to create additional tiddlers  for all items in shop. I thought that there 
is no difference what field value to extract text or weight.
But if it will be a problem to modify renderTiddler  function i'll try to 
modify my script not to use it.

суббота, 6 января 2018 г., 12:47:42 UTC+3 пользователь Jeremy Ruston 
написал:

> Hi Siniy-Kit
>
> Making those core modifications isn't ideal; it's rather brittle because 
> of the possibility of future core enhancements. Is there any reason you 
> can't use the other technique I suggested, of transcluding an intermediate 
> tiddler?
>
> Best wishes
>
> Jeremy
>
> --
> Jeremy Ruston
> jer...@jermolene.com 
> https://jermolene.com
>
> On 5 Jan 2018, at 19:39, Siniy-Kit > 
> wrote:
>
> Hi, Jeremy. I think a lot, but I don't know how to make my own variant 
> with all fields reading. As far as I understand this function here $:/
> core/modules/wiki.js
>
>
> exports.renderTiddler = function(outputType,title,options) {
> options = options || {};
> var parser = this.parseTiddler(title,options),
> widgetNode = this.makeWidget(parser,options);
> var container = $tw.fakeDocument.createElement("div");
> widgetNode.render(container,null);
> return outputType === "text/html" ? container.innerHTML : (outputType 
> === "text/plain-formatted" ? container.formattedTextContent : 
> container.textContent);
> };
>
>
> but I don't understand what to change to make it parse all fields. Help 
> please.
>
>
>
> вторник, 2 января 2018 г., 22:49:19 UTC+3 пользователь Jeremy Ruston 
> написал:
>
>> Hi Siniy-Kit
>>
>> Hi! When I use $tw.wiki.renderTiddler("text/plain","$:/SiteTitle") I get 
>> value of text field of tiddler $:/SiteTitle. But how can i get value of 
>> caption field?
>>
>> I try  var sitetit=" 
>> "+$tw.wiki.renderTiddler("text/plain","$:/SiteTitle",{field: "caption"}) 
>> but it dont work
>>
>>
>> The wiki.renderTiddler() method doesn’t provide direct support for 
>> rendering a field other than the text field. You could roll your own 
>> variant that provided that feature, but it may be simpler to instead create 
>> a template tiddler containing <$transclude tiddler="$:/SiteTitle" 
>> field="caption”/> and then to render that tiddler.
>>
>> 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+...@googlegroups.com.
>> To post to this group, send email to tiddl...@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/298d9849-c34b-46f4-b52c-f83f3e613435%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit 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+...@googlegroups.com .
> To post to this group, send email to tiddl...@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/0adda1d6-c764-4c88-b874-1d62a9fad347%40googlegroups.com
>  
> 
> .
> For more options, visit 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/8d1d67fb-4b54-42d4-ba81-55f58f98ef4f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [tw] How to $tw.wiki.renderTiddler caption field?

2018-01-06 Thread Jeremy Ruston
Hi Siniy-Kit

Making those core modifications isn't ideal; it's rather brittle because of the 
possibility of future core enhancements. Is there any reason you can't use the 
other technique I suggested, of transcluding an intermediate tiddler?

Best wishes

Jeremy

--
Jeremy Ruston
jer...@jermolene.com
https://jermolene.com

> On 5 Jan 2018, at 19:39, Siniy-Kit  wrote:
> 
> Hi, Jeremy. I think a lot, but I don't know how to make my own variant with 
> all fields reading. As far as I understand this function here 
> $:/core/modules/wiki.js
> 
> 
> exports.renderTiddler = function(outputType,title,options) {
> options = options || {};
> var parser = this.parseTiddler(title,options),
> widgetNode = this.makeWidget(parser,options);
> var container = $tw.fakeDocument.createElement("div");
> widgetNode.render(container,null);
> return outputType === "text/html" ? container.innerHTML : (outputType 
> === "text/plain-formatted" ? container.formattedTextContent : 
> container.textContent);
> };
> 
> 
> but I don't understand what to change to make it parse all fields. Help 
> please.
> 
> 
> 
> вторник, 2 января 2018 г., 22:49:19 UTC+3 пользователь Jeremy Ruston написал:
>> Hi Siniy-Kit
>> 
>>> Hi! When I use $tw.wiki.renderTiddler("text/plain","$:/SiteTitle") I get 
>>> value of text field of tiddler $:/SiteTitle. But how can i get value of 
>>> caption field?
>>> 
>>> I try  var sitetit=" 
>>> "+$tw.wiki.renderTiddler("text/plain","$:/SiteTitle",{field: "caption"}) 
>>> but it dont work
>> 
>> The wiki.renderTiddler() method doesn’t provide direct support for rendering 
>> a field other than the text field. You could roll your own variant that 
>> provided that feature, but it may be simpler to instead create a template 
>> tiddler containing <$transclude tiddler="$:/SiteTitle" field="caption”/> and 
>> then to render that tiddler.
>> 
>> 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+...@googlegroups.com.
>>> To post to this group, send email to tiddl...@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/298d9849-c34b-46f4-b52c-f83f3e613435%40googlegroups.com.
>>> For more options, visit 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/0adda1d6-c764-4c88-b874-1d62a9fad347%40googlegroups.com.
> For more options, visit 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/7D413E0F-0702-4A19-91CF-BCD90E7B1559%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [tw] How to $tw.wiki.renderTiddler caption field?

2018-01-05 Thread Siniy-Kit
Hi, Jeremy. I think a lot, but I don't know how to make my own variant with 
all fields reading. As far as I understand this function here $:/
core/modules/wiki.js


exports.renderTiddler = function(outputType,title,options) {
options = options || {};
var parser = this.parseTiddler(title,options),
widgetNode = this.makeWidget(parser,options);
var container = $tw.fakeDocument.createElement("div");
widgetNode.render(container,null);
return outputType === "text/html" ? container.innerHTML : (outputType 
=== "text/plain-formatted" ? container.formattedTextContent : 
container.textContent);
};


but I don't understand what to change to make it parse all fields. Help 
please.



вторник, 2 января 2018 г., 22:49:19 UTC+3 пользователь Jeremy Ruston 
написал:

> Hi Siniy-Kit
>
> Hi! When I use $tw.wiki.renderTiddler("text/plain","$:/SiteTitle") I get 
> value of text field of tiddler $:/SiteTitle. But how can i get value of 
> caption field?
>
> I try  var sitetit=" 
> "+$tw.wiki.renderTiddler("text/plain","$:/SiteTitle",{field: "caption"}) 
> but it dont work
>
>
> The wiki.renderTiddler() method doesn’t provide direct support for 
> rendering a field other than the text field. You could roll your own 
> variant that provided that feature, but it may be simpler to instead create 
> a template tiddler containing <$transclude tiddler="$:/SiteTitle" 
> field="caption”/> and then to render that tiddler.
>
> 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+...@googlegroups.com .
> To post to this group, send email to tiddl...@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/298d9849-c34b-46f4-b52c-f83f3e613435%40googlegroups.com
>  
> 
> .
> For more options, visit 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/0adda1d6-c764-4c88-b874-1d62a9fad347%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [tw] How to $tw.wiki.renderTiddler caption field?

2018-01-02 Thread Siniy-Kit
Hi Jeremy and Mark. Thank you for answers. In my old projects I use 

var  tovDostav= document.querySelector('[title="dost"]').getAttribute(
'price') ;

 so I get fields value from DOM tree.  But in my new project (on start of 
loading) I have absolutely empty Tiddlywiki and all data is loaded  from 
google spreadsheet id from URL parameter.
So there is no my "dost" tiddler (and all other loaded tiddlers) in DOM and 
my old script get error if I try to use loaded data. 

for example thisTW5
http://novye-podarki.ru/heeg33_.html?id=1GzZFzmgF-vBrRYOyz5VqjJC8QAQcOHnFBa1PEW9NhcU&#index

on start load data from 
https://docs.google.com/spreadsheets/d/1GzZFzmgF-vBrRYOyz5VqjJC8QAQcOHnFBa1PEW9NhcU/
so everyone can make copy of this table to his google drive, share it, 
public then modify and run my empty TW5 with his id parameter.
My idea was to make "free internet shop" for everybody without any hosting.

Now I am making ban an security module to prevent overwriting  some 
tiddlers and not to show table if it's email in ban-list. 





вторник, 2 января 2018 г., 22:49:19 UTC+3 пользователь Jeremy Ruston 
написал:

> Hi Siniy-Kit
>
> Hi! When I use $tw.wiki.renderTiddler("text/plain","$:/SiteTitle") I get 
> value of text field of tiddler $:/SiteTitle. But how can i get value of 
> caption field?
>
> I try  var sitetit=" 
> "+$tw.wiki.renderTiddler("text/plain","$:/SiteTitle",{field: "caption"}) 
> but it dont work
>
>
> The wiki.renderTiddler() method doesn’t provide direct support for 
> rendering a field other than the text field. You could roll your own 
> variant that provided that feature, but it may be simpler to instead create 
> a template tiddler containing <$transclude tiddler="$:/SiteTitle" 
> field="caption”/> and then to render that tiddler.
>
> 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+...@googlegroups.com .
> To post to this group, send email to tiddl...@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/298d9849-c34b-46f4-b52c-f83f3e613435%40googlegroups.com
>  
> 
> .
> For more options, visit 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/95c16e51-4a00-4872-b08a-f720aa5c767c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [tw] How to $tw.wiki.renderTiddler caption field?

2018-01-02 Thread Jeremy Ruston
Hi Siniy-Kit

> Hi! When I use $tw.wiki.renderTiddler("text/plain","$:/SiteTitle") I get 
> value of text field of tiddler $:/SiteTitle. But how can i get value of 
> caption field?
> 
> I try  var sitetit=" 
> "+$tw.wiki.renderTiddler("text/plain","$:/SiteTitle",{field: "caption"}) but 
> it dont work

The wiki.renderTiddler() method doesn’t provide direct support for rendering a 
field other than the text field. You could roll your own variant that provided 
that feature, but it may be simpler to instead create a template tiddler 
containing <$transclude tiddler="$:/SiteTitle" field="caption”/> and then to 
render that tiddler.

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 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/298d9849-c34b-46f4-b52c-f83f3e613435%40googlegroups.com
>  
> .
> For more options, visit 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/9F472C71-37DB-4FBA-9403-2897155E5E18%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


[tw] How to $tw.wiki.renderTiddler caption field?

2018-01-01 Thread Siniy-Kit
Hi! When I use $tw.wiki.renderTiddler("text/plain","$:/SiteTitle") I get 
value of text field of tiddler $:/SiteTitle. But how can i get value of 
caption field?

I try  var sitetit=" 
"+$tw.wiki.renderTiddler("text/plain","$:/SiteTitle",{field: "caption"}) 
but it dont 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 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/298d9849-c34b-46f4-b52c-f83f3e613435%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.