Yakov
2014-10-10 17:56:54 UTC
Hi Vincent,
how are you? Any progress with twve?
Best regards,
Yakov.
how are you? Any progress with twve?
Best regards,
Yakov.
Hi Vincent,
inline elements get their widths from the content width, so to get through
this, we have to understand the inline elements styling well.. this article
is helpful: [1]. From there, I get the idea that it is padding that should
be set. A simple solution: add to CSS
span[refresh="content"] { padding: 0 1em; }
or may be 0 1px. Try it, it allows to edit empty section transclusion.
Now, this has a number of drawbacks that you can see if you add this to
StyleSheet and use some transclusion, especially in
MainMenu/SideBarCommands, all of them originate from the fact that all
tiddler macros get padding, not only empty ones. So, something like [2]
can be done (after wikifying/refreshing) either with changing the display
property or with just changing padding.
test
<<tiddler [[test##section]]>>
<<tiddler [[test::slice]]>>
|slice||
!section
Section is edited.. well, there comes the bug I've mentioned previously,
but the content of the section becomes what it was expected to become
(although, couple of times I got the content appended to !section without
a linebreak, but I can't reproduce that). But when I edit the slice through
the transclusion, I always get the content put to the wrong place: I write
"text" to the second transclusion, and get text|slice|| line saved
instead of |slice|text|.
Best regards,
Yakov.
[1] http://www.maxdesign.com.au/articles/inline/
[2]
http://stackoverflow.com/questions/11572905/min-width-on-inline-not-inline-block-behaving-element
ÑеÑвеÑг, 14 авгÑÑÑа 2014 г., 18:09:38 UTC+4 пПлÑзПваÑÐµÐ»Ñ Vincent Yeh
Yakov,
Thanks for the reply that showed me different results from what I had and
got me to look further into the details for a cause. Fortunately I found
it. It was the ExternalTiddlerPlugin that kept me from getting the empty
slices. In the handler function of ExternalTiddlerPlugin (that overrides
that of the original config.macros.tiddler.handler), an empty content is
considered non-existing and gets skipped, without even creating the SPAN
element. That's why I couldn't find it with an empty slice value.
Removing the ExternalTiddlerPlugin I got the same results as you did: the
original config.macros.tiddler.handler got executed and an empty SPAN got
created. However, even though there is an empty SPAN created for an empty
slice, the *twve* still cannot find it with the mouse pointer, *because
the empty SPAN has zero width*. I'll need to think of some way
particularly for that. Shall take a short while.
Have Fun!
Vincent
Hi Vincent,
basically, when you work with the mode changing/refreshing of the story,
you shouldn't rely on displayMessage: in some cases, it fails to display
messages (or, probably, the message is shown and closed so quickly that
even the display doesn't actually show it). Instead, use console.log or
alert (don't use the last one if you expect many messages, though; on the
other hand, there are some cases when messages in the console are shown in
an unexpected order).
//{{{
config.macros.tiddler.handler =
function(place,macroName,params,wikifier,paramString,tiddler)
{
console.log("msg");
displayMessage("msg");
var allowEval = true;
var stack = config.macros.tiddler.tiddlerStack;
if(stack.length > 0 && config.evaluateMacroParameters == "system") {
// included tiddler and "system" evaluation required, so check
tiddler tagged appropriately
var title = stack[stack.length-1];
var pos = title.indexOf(config.textPrimitives.sectionSeparator);
if(pos != -1)
title = title.substr(0,pos); // get the base tiddler title
var t = store.getTiddler(title);
if(!t || t.tags.indexOf("systemAllowEval") == -1)
allowEval = false;
}
params = paramString.parseParams("name",nul
...
inline elements get their widths from the content width, so to get through
this, we have to understand the inline elements styling well.. this article
is helpful: [1]. From there, I get the idea that it is padding that should
be set. A simple solution: add to CSS
span[refresh="content"] { padding: 0 1em; }
or may be 0 1px. Try it, it allows to edit empty section transclusion.
Now, this has a number of drawbacks that you can see if you add this to
StyleSheet and use some transclusion, especially in
MainMenu/SideBarCommands, all of them originate from the fact that all
tiddler macros get padding, not only empty ones. So, something like [2]
can be done (after wikifying/refreshing) either with changing the display
property or with just changing padding.
test
<<tiddler [[test##section]]>>
<<tiddler [[test::slice]]>>
|slice||
!section
Section is edited.. well, there comes the bug I've mentioned previously,
but the content of the section becomes what it was expected to become
(although, couple of times I got the content appended to !section without
a linebreak, but I can't reproduce that). But when I edit the slice through
the transclusion, I always get the content put to the wrong place: I write
"text" to the second transclusion, and get text|slice|| line saved
instead of |slice|text|.
Best regards,
Yakov.
[1] http://www.maxdesign.com.au/articles/inline/
[2]
http://stackoverflow.com/questions/11572905/min-width-on-inline-not-inline-block-behaving-element
ÑеÑвеÑг, 14 авгÑÑÑа 2014 г., 18:09:38 UTC+4 пПлÑзПваÑÐµÐ»Ñ Vincent Yeh
Yakov,
Thanks for the reply that showed me different results from what I had and
got me to look further into the details for a cause. Fortunately I found
it. It was the ExternalTiddlerPlugin that kept me from getting the empty
slices. In the handler function of ExternalTiddlerPlugin (that overrides
that of the original config.macros.tiddler.handler), an empty content is
considered non-existing and gets skipped, without even creating the SPAN
element. That's why I couldn't find it with an empty slice value.
Removing the ExternalTiddlerPlugin I got the same results as you did: the
original config.macros.tiddler.handler got executed and an empty SPAN got
created. However, even though there is an empty SPAN created for an empty
slice, the *twve* still cannot find it with the mouse pointer, *because
the empty SPAN has zero width*. I'll need to think of some way
particularly for that. Shall take a short while.
Have Fun!
Vincent
Hi Vincent,
basically, when you work with the mode changing/refreshing of the story,
you shouldn't rely on displayMessage: in some cases, it fails to display
messages (or, probably, the message is shown and closed so quickly that
even the display doesn't actually show it). Instead, use console.log or
alert (don't use the last one if you expect many messages, though; on the
other hand, there are some cases when messages in the console are shown in
an unexpected order).
//{{{
config.macros.tiddler.handler =
function(place,macroName,params,wikifier,paramString,tiddler)
{
console.log("msg");
displayMessage("msg");
var allowEval = true;
var stack = config.macros.tiddler.tiddlerStack;
if(stack.length > 0 && config.evaluateMacroParameters == "system") {
// included tiddler and "system" evaluation required, so check
tiddler tagged appropriately
var title = stack[stack.length-1];
var pos = title.indexOf(config.textPrimitives.sectionSeparator);
if(pos != -1)
title = title.substr(0,pos); // get the base tiddler title
var t = store.getTiddler(title);
if(!t || t.tags.indexOf("systemAllowEval") == -1)
allowEval = false;
}
params = paramString.parseParams("name",nul
...
--
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 ***@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
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 ***@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.