Set Tiddler Column

22 views
Skip to first unread message

Digital Doctor

unread,
Mar 22, 2008, 1:56:11 PM3/22/08
to TiddlyWiki
I have placed the ALL of the script, for SetTiddlerColumns (see
below),
in a tiddler of the same name, and tagged it with systemConfig.

I get this error message: SyntaxError: unterminated regular expression
literal

(I did type the number 2 into the field, that the script provides, as
well)

------------

/%
|Name|SetTiddlerColumns|
|Source|http://www.TiddlyTools.com/#SetTiddlerColumns|
|Version|1.0.0|
|Author|Eric Shulman - ELS Design Studios|
|License|http://www.TiddlyTools.com/#LegalStatements <br>and
[[Creative Commons Attribution-ShareAlike 2.5 License|http://
creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|script|
|Requires||
|Overrides||
|Description|use CSS3 "-moz-column-count" to set single or multi-
column tiddler layout|

usage: <<tiddler SetTiddlerColumns>>

credits: Much thanks to "maki" (www.makiaea.org) for pointing out the -
moz-column-* attributes.
Important note: these CSS3 features are not supported in
InternetExplorer.

%/<script>
// init option value (as needed) and set CSS3 column attribute on
tiddlerDisplay/storyDisplay
if (config.options.txtTiddlerColumns==undefined)
config.options.txtTiddlerColumns="1";
var td=document.getElementById("tiddlerDisplay"); // for TW2.1.x and
earlier
if (!td) td=document.getElementById("storyDisplay"); // for TW2.2+
td.style.MozColumnCount=config.options.txtTiddlerColumns;
</script>tiddler columns: {{smallform{<<option
txtTiddlerColumns>><script>
var t=place.lastChild
t.style.width="4em";
t.style.textAlign="center";
t.value=config.options.txtTiddlerColumns;
if (config.browser.isIE) {
t.disabled=true;
t.value=1;
t.title="Sorry, multiple column tiddler display is not supported in
Internet Explorer";
return;
}
// hijack onchange for this field so CSS can be updated on the fly
t.coreOnChange=t.onchange;
t.onchange=function() {
// call original core onchange handler
if (this.coreOnChange) this.coreOnChange();
// set CSS3 column attribute
var td=document.getElementById("tiddlerDisplay"); // for TW2.1.x
and earlier
if (!td) td=document.getElementById("storyDisplay"); // for TW2.2+
td.style.MozColumnCount=this.value;
// sync any option field that is showing txtTiddlerColumns value
var nodes = document.getElementsByTagName("input");
for(var t=0; t<nodes.length; t++)
if(nodes[t].getAttribute("option")=="txtTiddlerColumns")
nodes[t].value=this.value;
};
</script>}}}

-----------------

So how exactly does this Set Tiddler Column script work. As I type
does it automatically divide the text into columns on the page? Or is
there something else that I need to do?

RC

Eric Shulman

unread,
Mar 22, 2008, 2:04:28 PM3/22/08
to TiddlyWiki


On Mar 22, 10:56 am, Digital Doctor <rafiki...@gmail.com> wrote:
> I have placed the ALL of the script, for SetTiddlerColumns (see
> below),
> in a tiddler of the same name, and tagged it with systemConfig.
>
> I get this error message: SyntaxError: unterminated regular expression
> literal

http://www.TiddlyTools.com/#SetTiddlersColumns

is a *script*... not a *plugin*... and should not be tagged with
"systemConfig"

> So how exactly does this Set Tiddler Column script work. As I type
> does it automatically divide the text into columns on the page? Or is
> there something else that I need to do?

It simply sets the FireFox-only CSS attributes that automatically
"flow" the story into several columns. This flow handling is provided
by the browser itself, and is designed to always 'balance' the height
of the columns.

Note that this does not flow the text content *within* each tiddler...
rather, it flows the tiddlers themselves which can result in a tiddler
being automatically split across columns (which, in effect *does* flow
the text content, but only as a side-effect of splitting the tiddler
display itself).

-e

Rafiki Cai

unread,
Mar 22, 2008, 2:21:44 PM3/22/08
to TiddlyWiki
OK, I better understand 'how it works'; but not 'how to work it'.

I've put the script inside a tiddler (with no systemConfig), and the
tiddler was not followed into columns (2).

RC

--
"The ONENESS of The Allness is the key that we seek. When will we all catch on?"

Eric Shulman

unread,
Mar 22, 2008, 2:30:24 PM3/22/08
to TiddlyWiki
> I've put the script inside a tiddler (with no systemConfig), and the
> tiddler was not followed into columns (2).

The script is applied to the entire 'story' display, not individual
tiddlers. While you can embed the script in any tiddler (using
<<tiddler SetTiddlerColumns>>), it's best to put the script in your
sidebar or main menu.

Also note that, as per my previous post, the script simply sets some
CSS attributes that are **supported only by FireFox**, so if you are
using any other browser the setting will not have any effect.

-e




Reply all
Reply to author
Forward
0 new messages