Just thought I'd offer a tweak to the TagglyTaggingMacro.
As some of you are aware, I mostly use TWC especially for
TagglyTagging. http://mptw.tiddlyspot.com/#TagglyTaggingPlugin
However there are times when the tagged content makes the columns uneven.
The entries are computed simply by the number of top-level tags. If some of
those tags have more an extreme number of tiddlers, then the resulting
values can be slewed in totals. I've adapted the "makeColumns" function to
count the number of tiddlers in each column and even out the computed
values.
Find the makeColumns function in the TT macro and replace thus:
makeColumns: function(orig,numCols) {
var maxLength = orig.join('\n').split('*[[').length-1;
var maxColLength = Math.floor((maxLength+numCols-1)/(numCols));
var output = [];
var c = 0;
var tot=0;
for (var j=0;j<numCols;j++){
var singleCol = [];
var colTotal = 0;
for(;colTotal<maxColLength;){
singleCol.push(orig[c]);
colTotal += orig[c++].split('*[[').length - 1;
}
tot+=colTotal;
maxColLength = (j == numCols-1) ? maxLength-tot : Math.floor((
maxLength-tot)/(numCols-j-1));
output.push(singleCol);
}
return output;
},
Not tried it extensively but it seems to work on my TWs. Any comments or
improvements gratefully accepted.
-- Dragon.
--
You received this message because you are subscribed to the Google Groups
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywikidev/7770d4ae-5686-4ccf-82b1-2ceea46d3bd2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.