Welcome to TiddlyWiki created by Jeremy Ruston, Copyright © 2007 UnaMesa Association
I tell ya, keeping up writing every day is a difficult habit to develop, especially when you already spend most of your waking hours behind a keyboard for a living. Extra-curricular typing just doesn't sound as enticing.
Well, this is my attempt to get back on schedule. Work is a grind and in tough times they expect you to work for free out of fear of losing your job. It's not been quite that bad for me, but I've spent the last 7 months working on a single project that is now 2 weeks overdue. Needless to say, I've been at it too long.
So in honor of my return, I'll just say this. I am going to continue writing - hopefully I'll get some serious vacation time this holiday and be able to overhaul this wiki and upgrade to mediawiki. I like this format, but its gonne grow awfully fast once I really develop the habit of writing, and this "all-in-one" Tiddlywiki will quickly become a burden. I don't want to fight another migration, so now that I have my feet wet with wikis, I'll get a serious wiki engine backed with DB capabilities to do the job for me.
So, I'll post my progress and other thoughts here as I ramp up for some vacation time and keep you abreast of how things are proceeding. So until next time.....
- Ramicus
__There's something magical in the air__
I'd wax a bit on the time it took me to craft some new rules after 8 years of magic system playtesting, but I'd rather you just read the new rules rather than me tell you about them.
So, check out my newest post under Magic: [[Magic v3.6]]
There you'll find an extensive OGL writeup that details how Ratajan will treat its mages. For those in other campaigns, it's just some lite reading for fun. FOr others more local to Peoria, My 2009 fantasy campaigns will use these new rules and setting flavor. I hope you all enjoy them, and please feel free to use the discussion forum to post your comments!
- Ramicus
__ A time for something new__
Well, I promised a blog a day, and so far so good! Today, I've added some new documents to the site. They're nothing special, just some older material, but good stuff none-the-less.
First I've added the [[Social Dynamics|Social Dynamics v3.6]] rules I use. These stem from original works created by myself and Tom Ratz. I've since heavily modified it to work with 3.5. The rules harken back to the days of 1st edition Social classes, and I use it to add economic realism to the game. No longer are prices coming straight out of the players handbook! Every item you own is assumed to be appropriate to your station when you start play, but after that everyting increases in price according to your lifestyle as dictated by your social class. If you're a nobel, you demand the best. If you're a beggar and someone drops a finely crafted jeweled dagger (not necessarily masterwork) with a MUC rating, that beggar just found a rather expensive dagger to sell!
The point of this isn't just money, but social interaction as well. Nobles carrying shoddy goods will get sneered at by their peers and others for not meeting social expectations, thus giving them a penalty in those situations. The reverse holds true, but you better have Bluff to pull off posing as a noble in a courtier's outfit! Just because you wear the clothes doesn't mean you carry yourself well in them!
Next I've included [[Disposition|Disposition v3.6]] Rules that supplement the Social Dynamics Rules. These are details about how to handle NPC interactions during play. I've become accustomed to keeping extensive lists of NPCs and how they feel about other PCs. I also use time to adjust these (lose touch with someone and their disposition may slip a bit). Check these out to better understand how Social Dynamics rules affect your NPC -PC relationships.
Lastly, I posted an introduction to the [[Magi Classes|Magi Classes: An Introduction]]. In my new rule set, Magi on Ratajan are sorcerous in nature. for more details, read the one-page summary for a taste of what's to come. This is a major change from those rules of the past, where Magi used the wizard rules, but in the grand scheme of things, this move makes a large amount of sense to giving Druids and Magi a different feel from each other as the history behind them indicates.
Well that's all for now. Until tomorrow!
- Ramicus
A little homage to my first D&D Open Championship.....
<html><div align="center"><iframe src="http://www.kinazar.com/Storage/News/2004OpenResults.pdf" frameborder="0" width="100%" height="600"></iframe></div></html>
<html><div align="center"><iframe src="http://www.kinazar.com/Storage/News/2005OpenResults.pdf" frameborder="0" width="100%" height="600"></iframe></div></html>
<html><div align="center"><iframe src="http://www.kinazar.com/Storage/News/2006OpenResults.htm" frameborder="0" width="100%" height="600"></iframe></div></html>
<html><div align="center"><iframe src="http://www.wizards.com/default.asp?x=welcome/conventions/gencon07" frameborder="0" width="100%" height="600"></iframe></div></html>
__More new goodies__
Well, it's back to blogging after a weekend of time off to celebrate my birthday. It was time needed, as work's been kicking my butt lately, but I won't discuss that here. This is about fun stuff! So today I decided to repost some of my favorite Links for the old site as well as some older docs needed for the Savage Tide Campaign. Please note - because some of these items are not OGL, and in order to abide by the OGL and DMA, please be careful about publicly posting these elsewhere. Enjoy!
__Posted:__
Barbarian
Binder (PDF only)
Knight (PDF only)
Scout (PDF only)
Wow. So much for a daily blog! Lately work has been dragging me around like a fallen rider who got tangling in the stirrup. It's been a terribly rocky month, with 65 hr work weeks for the past 7 weeks. All in all it sucked, but it's finally over. two days of NORMAL working hours and a triumphant return to blogging!
So now onto some gaming matters.
__There's something fishy going on around here__
I'd like to officially welcome back two pals to our gaming circle: Al Kasperzak, whose absence tallied about a year while he changed jobs a few times and got married in between, and Tom Ratz, whom after a 3 year hiatus from the game of our childhood has finally got the itch once more. Al is looking to reprise his role as Cadmus Toregson in the Savage Tide AP PbP campaign. Tom, my cohort in crafting Ratajan, it's continent Paern and the might Empire of Auryeb, is looking forward to participating in the Savage Tide AP PbP campaign as Aerik Fenn. Watch soon for their respective appearances in the story to come.
__Rules, Rules, and more Rules__
I'll be looking to post more 3.5 rule changes to the menus above over the course of the week. Watch for text reprints of older articles on the rules penned by Skip Williams, as well as additional classes and some other House Rules. I also want to reiterate that just because it is posted, doesn't necessarily mean its in active use in the Savage Tide AP campaign. If you're wondering which rules are in play, I'll be posting a tiddler on that under the Campaigns menu soon.
__Calling all authors__
Finally, I want to shout out to all of you whom may lurk or may actively post elsewhere. I'm looking to make this site more than just my little playing field and I welcome you to add your own creative urges to the contents of this site. Since I haven't quite figured out Media wiki just yet, please contact me if you're interested in posting stories, character journals, optional rule variants, art or other creative works here on the site. I'll be glad to accommodate you! Rest assured, you'll retain all the rights to your work, and you'll receive credit too! :-)
Well, enough for now, I am going to actually work on some of those rules I just talked about! Until next time.....
- Ramicus
[[View or Download this PDF document|http://www.kinazar.com/Storage/Classes/Barbarian.doc]]
<html><div align="center"><iframe src="http://kinazar.com/Storage/Classes/Barbarian.htm" frameborder="0" width="100%" height="600"></iframe></div></html>
[[View or Download this PDF document|http://www.kinazar.com/Storage/Classes/Binder.pdf]]
/***
|Name|BreadcrumbsPlugin|
|Author|Eric Shulman|
|Source|http://www.TiddlyTools.com/#BreadcrumbsPlugin|
|Documentation|http://www.TiddlyTools.com/#BreadcrumbsPluginInfo|
|Version|2.0.0|
|License|[[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides|Story.prototype.displayTiddler,TiddlyWiki.prototype.deleteTiddler|
|Options|##Configuration|
|Description|list/jump to tiddlers viewed during this session plus "back" button/macro|
This plugin provides a list of links to all tiddlers opened during the session, creating a "trail of breadcrumbs" from one tiddler to the next, allowing you to quickly navigate to any previously viewed tiddler, or select 'home' to reset the display to the initial set of tiddlers that were open at the start of the session (i.e., when the document was loaded into the browser).
!!!!!Documentation
<<<
see [[BreadcrumbsPluginInfo]]
<<<
!!!!!Configuration
<<<
<<option chkCreateDefaultBreadcrumbs>> automatically create breadcrumbs display (if needed)
<<option chkShowBreadcrumbs>> show/hide breadcrumbs display
<<option chkReorderBreadcrumbs>> re-order breadcrumbs when visiting a previously viewed tiddler
<<option chkBreadcrumbsHideHomeLink>> omit 'Home' link from breadcrumbs display
<<option chkShowStartupBreadcrumbs>> show breadcrumbs for 'startup' tiddlers
<<option chkBreadcrumbsReverse>> show breadcrumbs in reverse order (most recent first)
<<option chkBreadcrumbsLimit>> limit breadcrumbs display to {{twochar{<<option txtBreadcrumbsLimit>>}}} items
<<option chkBreadcrumbsLimitOpenTiddlers>> limit open tiddlers to {{twochar{<<option txtBreadcrumbsLimitOpenTiddlers>>}}} items
<<<
!!!!!Revisions
<<<
2008.05.01 [2.0.0] added 'limit open tiddlers' feature (with safety check for tiddler in edit mode)
| Please see [[BreadcrumbsPluginInfo]] for previous revision details |
2006.02.01 [1.0.0] initial release
<<<
!!!!!Code
***/
//{{{
version.extensions.breadCrumbs = {major: 2, minor: 0, revision: 0, date: new Date("May 1, 2008")};
var co=config.options; // abbreviation
// show/hide display option (default is to SHOW breadcrumbs)
if (co.chkShowBreadcrumbs===undefined) co.chkShowBreadcrumbs=true;
// REORDER breadcrumbs when visiting previously viewed tiddler (default)
if (co.chkReorderBreadcrumbs===undefined) co.chkReorderBreadcrumbs=true;
// create default breadcrumbs display as needed (default is to CREATE)
if (co.chkCreateDefaultBreadcrumbs===undefined) co.chkCreateDefaultBreadcrumbs=true;
// show breadcrumbs for 'startup' tiddlers (default is FALSE = only show crumbs for tiddlers opened after startup)
if (co.chkShowStartupBreadcrumbs===undefined) co.chkShowStartupBreadcrumbs=false;
// show crumbs in reverse order (most recent first)
if (co.chkBreadcrumbsReverse===undefined) co.chkBreadcrumbsReverse=false;
// limit number of crumbs displayed
if (co.chkBreadcrumbsLimit===undefined) co.chkBreadcrumbsLimit=false;
if (co.txtBreadcrumbsLimit===undefined) co.txtBreadcrumbsLimit=5;
// limit number of open tiddlers
if (co.chkBreadcrumbsLimitOpenTiddlers===undefined) co.chkBreadcrumbsLimitOpenTiddlers=false;
if (co.txtBreadcrumbsLimitOpenTiddlers===undefined) co.txtBreadcrumbsLimitOpenTiddlers=3;
// omit home link from breadcrumbs display
if (co.chkBreadcrumbsHideHomeLink===undefined) co.chkBreadcrumbsHideHomeLink=false;
config.macros.breadcrumbs = {
crumbs: [], // the list of current breadcrumbs
handler: function(place,macroName,params,wikifier,paramString,tiddler) {
var area=createTiddlyElement(place,"span",null,"breadCrumbs",null);
area.setAttribute("homeSep",params[0]?params[0]:this.homeSeparator); // custom home separator
area.setAttribute("crumbSep",params[1]?params[1]:this.crumbSeparator); // custom crumb separator
this.render(area);
},
add: function (title) {
var thisCrumb = title;
var ind = this.crumbs.indexOf(thisCrumb);
if(ind === -1)
this.crumbs.push(thisCrumb);
else if (config.options.chkReorderBreadcrumbs)
this.crumbs.push(this.crumbs.splice(ind,1)[0]); // reorder crumbs
else
this.crumbs=this.crumbs.slice(0,ind+1); // trim crumbs
if (config.options.chkBreadcrumbsLimitOpenTiddlers)
this.limitOpenTiddlers();
this.refresh();
return false;
},
getAreas: function() {
var crumbAreas=[];
// find all DIVs with classname=="breadCrumbs"
// Note: use try/catch to avoid "Bad NPObject as private data" fatal error caused when
// some versions of embedded QuickTime player element is accessed by hasClass() function.
var all=document.getElementsByTagName("*");
for (var i=0; i<all.length; i++)
try{ if (hasClass(all[i],"breadCrumbs")) crumbAreas.push(all[i]); } catch(e) {;}
// find single DIV w/fixed ID (backward compatibility)
var byID=document.getElementById("breadCrumbs")
if (byID && !hasClass(byID,"breadCrumbs")) crumbAreas.push(byID);
if (!crumbAreas.length && config.options.chkCreateDefaultBreadcrumbs) {
// no existing crumbs display areas... create one...
var defaultArea = createTiddlyElement(null,"span",null,"breadCrumbs",null);
defaultArea.style.display= "none";
var targetArea= document.getElementById("tiddlerDisplay");
targetArea.parentNode.insertBefore(defaultArea,targetArea);
crumbAreas.push(defaultArea);
}
return crumbAreas;
},
refresh: function() {
var crumbAreas=this.getAreas();
for (var i=0; i<crumbAreas.length; i++) {
crumbAreas[i].style.display = config.options.chkShowBreadcrumbs?"block":"none";
removeChildren(crumbAreas[i]);
this.render(crumbAreas[i]);
}
},
render: function(here) {
var out=""
var homeSep=here.getAttribute("homeSep"); if (!homeSep) homeSep=this.homeSeparator;
var crumbSep=here.getAttribute("crumbSep"); if (!crumbSep) crumbSep=this.crumbSeparator;
if (!config.options.chkBreadcrumbsHideHomeLink) {
createTiddlyButton(here,"Home",null,this.home,"tiddlyLink tiddlyLinkExisting");
out+=homeSep;
}
for (c=0; c<this.crumbs.length; c++) // remove non-existing tiddlers from crumbs
if (!store.tiddlerExists(this.crumbs[c]) && !store.isShadowTiddler(this.crumbs[c]))
this.crumbs.splice(c,1);
var count=this.crumbs.length;
if (config.options.chkBreadcrumbsLimit && config.options.txtBreadcrumbsLimit<count)
count=config.options.txtBreadcrumbsLimit;
var list=[];
for (c=this.crumbs.length-count; c<this.crumbs.length; c++) list.push('[['+this.crumbs[c]+']]');
if (config.options.chkBreadcrumbsReverse) list.reverse();
out+=list.join(crumbSep);
wikify(out,here);
},
home: function() {
story.closeAllTiddlers();
restart();
config.macros.breadcrumbs.crumbs = [];
var crumbAreas=config.macros.breadcrumbs.getAreas();
for (var i=0; i<crumbAreas.length; i++) crumbAreas[i].style.display = "none";
return false;
},
limitOpenTiddlers: function() {
var limit=config.options.txtBreadcrumbsLimitOpenTiddlers; if (limit<1) limit=1;
for (c=this.crumbs.length-1; c>=0; c--) {
var tid=this.crumbs[c];
var elem=document.getElementById(story.idPrefix+tid);
if (elem) { // tiddler is displayed
if (limit <=0) { // display limit has been reached
if (elem.getAttribute("dirty")=="true") { // tiddler is being edited
var msg="'"+tid+"' is currently being edited.\n\n";
msg+="Press OK to save and close this tiddler\nor press Cancel to leave it opened";
if (confirm(msg)) { story.saveTiddler(tid); story.closeTiddler(tid); }
}
else
story.closeTiddler(this.crumbs[c]);
}
limit--;
}
}
}
};
if (config.macros.breadcrumbs.homeSeparator==undefined) // note: not a cookie
config.macros.breadcrumbs.homeSeparator=" | ";
if (config.macros.breadcrumbs.crumbSeparator==undefined) // note: not a cookie
config.macros.breadcrumbs.crumbSeparator=" > ";
config.commands.previousTiddler = {
text: 'back',
tooltip: 'view the previous tiddler',
hideReadOnly: false,
dateFormat: 'DDD, MMM DDth YYYY hh:0mm:0ss',
handler: function(event,src,title) {
var here=story.findContainingTiddler(src); if (!here) return;
var crumbs=config.macros.breadcrumbs.crumbs;
if (crumbs.length>1) {
var crumb=crumbs[crumbs.length-2];
story.displayTiddler(here,crumb);
}
else
config.macros.breadcrumbs.home();
return false;
}
};
config.macros.previousTiddler= {
label: 'back',
prompt: 'view the previous tiddler',
handler: function(place,macroName,params,wikifier,paramString,tiddler) {
var label=params.shift(); if (!label) label=this.label;
var prompt=params.shift(); if (!prompt) prompt=this.prompt;
createTiddlyButton(place,label,prompt,function() {
var crumbs=config.macros.breadcrumbs.crumbs;
if (crumbs.length>1) {
var crumb=crumbs[crumbs.length-2];
story.displayTiddler(place,crumb);
}
else
config.macros.breadcrumbs.home();
});
}
}
// hijack story.displayTiddler() so crumbs can be refreshed when a tiddler is displayed
if (Story.prototype.breadCrumbs_coreDisplayTiddler==undefined)
Story.prototype.breadCrumbs_coreDisplayTiddler=Story.prototype.displayTiddler;
Story.prototype.displayTiddler = function(srcElement,tiddler,template,animate,slowly)
{
var title=(tiddler instanceof Tiddler)?tiddler.title:tiddler;
this.breadCrumbs_coreDisplayTiddler.apply(this,arguments);
// if not displaying tiddler during document startup, then add it to the breadcrumbs
// note: 'startingUp' flag is a global, set/reset by the core init() function
if (!startingUp || config.options.chkShowStartupBreadcrumbs) config.macros.breadcrumbs.add(title);
}
// hijack store.removeTiddler() so crumbs can be refreshed when a tiddler is deleted
if (TiddlyWiki.prototype.breadCrumbs_coreRemoveTiddler==undefined)
TiddlyWiki.prototype.breadCrumbs_coreRemoveTiddler=TiddlyWiki.prototype.removeTiddler;
TiddlyWiki.prototype.removeTiddler= function(title)
{
this.breadCrumbs_coreRemoveTiddler.apply(this,arguments);
config.macros.breadcrumbs.refresh();
}
//}}}
/***
|Name|BreadcrumbsPluginInfo|
|Author|Eric Shulman|
|Source|http://www.TiddlyTools.com/#BreadcrumbsPlugin|
|Documentation|http://www.TiddlyTools.com/#BreadcrumbsPluginInfo|
|Version|2.0.0|
|License|[[Creative Commons Attribution-ShareAlike 2.5 License|http://creativecommons.org/licenses/by-sa/2.5/]]|
|~CoreVersion|2.1|
|Type|plugin|
|Requires||
|Overrides|Story.prototype.displayTiddler,TiddlyWiki.prototype.removeTiddler|
|Description|Documentation for BreadcrumbsPlugin|
This plugin provides a list of links to all tiddlers opened during the session, creating a "trail of breadcrumbs" from one tiddler to the next, allowing you to quickly navigate to any previously viewed tiddler, or select 'home' to reset the display to the initial set of tiddlers that were open at the start of the session (i.e., when the document was loaded into the browser).
!!!!!Usage
<<<
syntax:
{{{
<<breadcrumbs homeSeparator crumbSeparator>>
}}}
By default, the breadcrumbs are displayed as a continuous, //horizontal// word-wrapped line of text, using default character sequences for ''homeSeparator'' (" | ") and ''crumbSeparator'' (" > "). The //optional// ''homeSeparator'' and ''crumbSeparator'' macro parameters allow you to specify alternative separators. For example, to display the breadcrumbs //vertically// (in a stack, rather than a row), set the separator values to use {{{[[<br>]]}}}... and, to display a horizontal line as the home separator, use {{{[[<html><hr></html>]]}}}.
<<<
!!!!!Examples:
<<<
{{{
<<breadcrumbs>>
}}}
<<breadcrumbs>>
{{{
<<breadcrumbs [[<html><hr></html>]] [[<br>]]>>
}}}
<<breadcrumbs [[<html><hr></html>]] [[<br>]]>>
<<<
!!!!!Customization
<<<
Using CSS and a few of the plugin configuration options (see below), you can make the breadcrumbs display resemble browser tabs by adding the following to your [[StyleSheet]]:
{{{
.breadCrumbs { border-bottom:1px solid; }
.breadCrumbs a {
border: 1px solid; padding: 0px 1em;
-moz-border-radius-topleft:.5em; -moz-border-radius-topright:.5em;
}
}}}
and this in [[ConfigTweaks]] (tagged with systemConfig, of course):
{{{
config.options.chkShowStartupBreadcrumbs=true;
config.options.chkBreadcrumbsLimitOpenTiddlers=true;
config.options.txtBreadcrumbsLimitOpenTiddlers=1;
config.macros.breadcrumbs.homeSeparator=" ";
config.macros.breadcrumbs.crumbSeparator=" ";
}}}
<<<
!!!!!Configuration
<<<
__''display placement:''__
<<option chkCreateDefaultBreadcrumbs>> automatically create breadcrumbs display (if needed)
{{{<<option chkCreateDefaultBreadcrumbs>>}}}
>By default, the plugin automatically creates the "breadCrumbs" display element at the top of the story column, just above the tiddlerDisplay area. To manually control the display and placement of the breadcrumbs display, you can define a DIV with class="breadCrumbs" in a custom [[PageTemplate]] or embed the {{{<<breadcrumbs>>}}} macro in specific tiddler content.
>
>For example, to add the breadcrumbs below the mainMenu, change this:
{{{
<div id='mainMenu' refresh='content' tiddler='MainMenu'></div>
}}}
>to:
{{{
<div id='mainMenu'>
<div refresh='content' tiddler='MainMenu'></div>
<div id='breadCrumbs' class='breadCrumbs'></div>
</div>
}}}
>You can also block automatic creation of the breadcrumbs display by setting
{{{
config.options.chkCreateDefaultBreadcrumbs=false;
}}}
>in a [[CookieJar]]/[[ConfigTweaks]] plugin tiddler.
__''other settings:''__
<<option chkShowBreadcrumbs>> show/hide breadcrumbs display
{{{<<option chkShowBreadcrumbs>>}}}
>This checkbox toggles the visibility of the breadcrumbs display. However, the display is not updated until the next crumb is added (or a previous crumb is clicked on). For immediate effect, the [[ToggleBreadcrumbs]] script uses [[InlineJavascriptPlugin]] to synchronize the checkbox setting and the breadcrumbs display.
<<option chkReorderBreadcrumbs>> re-order breadcrumbs when visiting a previously viewed tiddler
{{{<<option chkReorderBreadcrumbs>>}}}
>When visiting a previously viewed tiddler, the title of the most-recently displayed tiddler is simply moved to the end of the list and individual breadcrumbs are not removed from the list unless the underlying tiddler is deleted. When ''re-ordering'' is disabled, the breadcrumbs list is ''trimmed'' so that all crumbs following that tiddler are removed from the list.
<<option chkBreadcrumbsHideHomeLink>> omit 'Home' link from breadcrumbs display
{{{<<option chkBreadcrumbsHideHomeLink>>}}}
>Enabling this option suppresses the automatic display of the "Home" link (and home separator). To manually add the home link elsewhere in your document, use the following HTML:
{{{
<html><a href="javascript:;" onclick="config.macros.breadcrumbs.home()">home</a></html>
}}}
<<option chkShowStartupBreadcrumbs>> show breadcrumbs for 'startup' tiddlers
{{{<<option chkShowStartupBreadcrumbs>>}}}
>Breadcrumbs are usually only added for tiddlers that are opened after the document has been loaded, and not for tiddlers displayed during initial startup (e.g., [[DefaultTiddlers]]). Enabling this option displays breadcrumbs for all viewed tiddlers, regardless of when they are opened.
<<option chkBreadcrumbsReverse>> show breadcrumbs in reverse order
{{{<<option chkBreadcrumbsReverse>>}}}
>As tiddlers are displayed, breadcrumbs are usually added to the //end// of the list. Enabling this option displays breadcrumbs in reverse order, so that the most recently visited tiddlers are listed first.
<<option chkBreadcrumbsLimit>> limit breadcrumbs display to {{twochar{<<option txtBreadcrumbsLimit>>}}} items
{{{<<option chkBreadcrumbsLimit>>}}} and {{{<<option txtBreadcrumbsLimit>>}}}
>By default, breadcrumbs are displayed for all tiddlers that have been visited (unless the list is being 'trimmed' by disabling the chkReorderBreadcrumbs option above). Enabling this option limits the display of the list to a maximum specified number of breadcrumbs.
<<option chkBreadcrumbsLimitOpenTiddlers>> limit open tiddlers to {{twochar{<<option txtBreadcrumbsLimitOpenTiddlers>>}}} items
{{{<<option chkBreadcrumbsLimitOpenTiddlers>>}}} and {{{<<option txtBreadcrumbsLimitOpenTiddlers>>}}}
>By default, tiddlers remain open (e.g., displayed in the story column) until you explicitly close them. When this option is enabled, only the most recently opened tiddlers will remain open: ''any tiddlers in excess of the specified limit are automatically closed.'' //Note: for 'data safety', if a tiddler is being edited, you will be asked for permission to "save-and-close" that tiddler or leave it open (even if that would exceed the specified limit).//
<<<
!!!!!Revisions
<<<
2008.05.01 [2.0.0] added 'limit open tiddlers' feature (with safety check for tiddler in edit mode)
2008.04.06 [1.9.1] corrected 'limit' logic so that //last// N crumbs are shown instead of //first// N crumbs. Also, added chkBreadcrumbsHideHomeLink
2008.04.04 [1.9.0] added chkBreadcrumbsReverse and chk/txtBreadcrumbsLimit
2008.03.29 [1.8.4] in displayTiddler(), get title from tiddler object (if needed). Fixes errors caused when calling function passes a tiddler *object* instead of a tiddler *title*
2008.03.24 [1.8.3] include shadow tiddlers in breadcrumbs list. Also changed settings so that "reordering" breadcrumbs is the default, instead of "trimming" the list
2007.12.04 [*.*.*] update for TW2.3.0: replaced deprecated core functions, regexps, and macros
2007.10.26 [1.8.2] documentation cleanup
2007.10.18 [1.8.1] in GetAreas(), use try/catch to avoid "Bad NPObject as private data" fatal error caused when embedded QuickTime player element is accessed by hasClass() function.
2007.10.02 [1.8.0] major documentation and code cleanup. Moved config.breadCrumbs.* to config.macros.breadcrumbs.* to consolidate objects. Also, fixed homeSeparator and crumbSeparator default handling.
2007.10.02 [1.7.0] added config.options.chkShowStartupBreadcrumbs option
2007.09.16 [1.6.1] in getAreas(), removed errant use of 'place' (was causing fatal error when creating default breadcrumbs display element). Also, added chkCreateDefaultBreadcrumbs configuration setting to enable/disable automatic creation of a default breadcrumbs display.
2007.09.16 [1.6.0] re-wrote refresh() to enable multiple display instances, by finding elements with "breadCrumbs" classname. Fallback to fixed ID (="breadCrumbs") is still used for backward-compatibility. move rendering code from refresh() to separate render() function, and added definition for {{{<<breadCrumbs>>}}} macro to support embedding breadcrumbs displays in tiddler content.
2007.09.15 [1.5.9.1] updated documentation
2007.09.15 [1.5.9] defined homeSeparator (" | ") and crumbSeparator (" > ") as object properties so that they can be redefined as desired for different layouts (e.g., using 'newline' for the crumbSeparator will arrange crumbs in a column rather than a row.
2007.06.21 [1.5.8.1] in home(), return false to prevent IE from attempting to navigate away...
2007.05.26 [1.5.8] added support for {{{<<option chkReorderBreadcrumbs>>}}} to toggle trim vs. re-order behavior when visiting previously viewed tiddlers
2007.05.25 [1.5.7] added support for {{{<<option chkShowBreadcrumbs>>}}} to toggle //display// of breadcrumbs
2007.05.24 [1.5.6] in refresh(), remove non-existing tiddler titles from crumb list. Also, hijack removeTiddler() so crumbs can be updated after tiddler is deleted.
2007.04.11 [1.5.5] added optional params to previousTiddler macro handler() to allow alternative label and tooltip text (instead of default "back")
2007.03.02 [1.5.4] in refresh(), for TW2.2, look for "storyDisplay" instead of "tiddlerDisplay" but keep fallback to "tiddlerDisplay" for TW2.1 or earlier
2007.02.24 [1.5.3] changed from hijack of onClickTiddlerLink to hijack of displayTiddler() so that ALL displayed tiddlers are recorded in the crumbs, including programmatically displayed tiddlers opened by macros, scripts, etc., (such as [[GotoPlugin]], among many others) in addition to those opened by clicks on links.
2007.02.24 [1.5.2.0] eliminated global space clutter by moving function and data declarations so they are contained inside config.breadCrumbs object.
2007.02.06 [1.5.1] added "previousTiddler" macro (for use in sidebar)
2007.02.05 [1.5.0] added "previousTiddler" toolbar command (aka, "back")
2006.08.04 [1.4.0.1] change spaces to tabs
2006.08.04 [1.4.0] modified from 1.4.0 distro: in refresh(), set {{{display:none/block}}} instead of {{{visibility:hidden/visible}}}. In home(), check for valid crumbArea before setting style.
2006.08.02 [1.4.0] Fixed bug, the redefined onClickTiddlerLink_orig_breadCrumbs works incorrectly on IE
2006.07.20 [1.3.0] Runs compatibly with TW 2.1.0 (rev #403+)
2006.02.07 [1.2.0] change global array breadCrumbs to config.breadCrumbs by Eric's suggestion
2006.02.04 [1.1.0] JSLint checked
2006.02.01 [1.0.0] initial release
<<<
/%
|Name|CloseSlider|
|Source|http://www.TiddlyTools.com/#CloseSlider|
|Version|1.1.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|InlineJavascriptPlugin, NestedSlidersPlugin|
|Overrides||
|Description|embed a 'close' link floating in upper right corner of slider. closes current slider panel.|
%/<script label="<nowiki>[x]</nowiki>" title="hide this panel">
// if removeOptionCookie() function is not defined by TW core, define it here.
if (window.removeOptionCookie===undefined) {
window.removeOptionCookie=function(cookie) {
var ex=new Date(); ex.setTime(ex.getTime()-1000); // immediately expire cookie
document.cookie = cookie+"=novalue; path=/; expires="+ex.toGMTString();
}
}
var panel=place;
while (panel && !hasClass(panel,'sliderPanel') && !hasClass(panel,'floatingPanel'))
{ panel=panel.parentNode; }
if (!panel) { alert('not in a slider'); return false; }
panel.style.display='none';
var cookie=panel.button.sliderCookie;
if (cookie && cookie.length) {
config.options[cookie]=false;
if (config.options[cookie]!=panel.button.defOpen)
saveOptionCookie(cookie);
else removeOptionCookie(cookie);
}
return false;
</script><script>place.lastChild.style.fontWeight="normal"</script>
Background: #ddcc99 /*eeddaa*/
Foreground: #000
PrimaryPale: #ddcc99
PrimaryLight: #bb8833
PrimaryMid: #bb8833 /*553322*/
PrimaryDark: #ffffcc /*ddcc99*/
SecondaryPale: #ddcc99
SecondaryLight: #ddcc99
SecondaryMid: #777777
SecondaryDark: #553322
TertiaryPale: #ddcc99 /*000 */
TertiaryLight: #ddcc99 /*ffffcc */
TertiaryMid: #553322
TertiaryDark: #8B7355
/***
|Name|CommentPlugin|
|Source|http://www.TiddlyTools.com/#CommentPlugin|
|Documentation|http://www.TiddlyTools.com/#CommentPluginInfo|
|Version|2.9.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|plugin|
|Requires||
|Overrides||
|Description|automatically insert formatted comments into tiddler content|
!!!!!Documentation
>see [[CommentPluginInfo]]
!!!!!Configuration
>see [[CommentPluginInfo]]
!!!!!Revisions
<<<
2008.05.17 [2.9.0] optional 'overwrite' param replaces existing comment when stored as separate tiddler
| please see [[CommentPluginInfo]] for previous revision details |
2006.04.20 [1.0.0] initial release
<<<
!!!!!Code
***/
//{{{
version.extensions.CommentPlugin= {major: 2, minor: 9, revision: 0, date: new Date(2008,5,17)};
config.macros.comment= {
marker: "/%"+"comment"+"%/",
fmt: "__''%subject%''__\n^^posted by %who% on %when%^^\n<<<\n%message%\n<<<\n",
datefmt: "DDD, MMM DDth, YYYY at hh12:0mm:0ss am",
tags: "",
reverse: false,
handler: function(place,macroName,params,wikifier,paramstring,tiddler) {
var span=createTiddlyElement(place,"span");
var here=story.findContainingTiddler(place);
if (here) var tid=here.getAttribute("tiddler"); // containing tiddler title
span.setAttribute("here",tid);
var target=(params[0]&¶ms[0].length&¶ms[0]!="here")?params[0]:tid; // target title
span.setAttribute("target",target);
var overwrite=(params[1]&¶ms[1].toLowerCase()=="overwrite"); if (overwrite) params.shift();
span.setAttribute("overwrite",overwrite?"true":"false");
var reverse=(params[1]&¶ms[1].toLowerCase()=="reverse"); if (reverse) params.shift();
span.setAttribute("reverse",(reverse||this.reverse)?"true":"false");
var tags=(params[1]&¶ms[1].length)?params[1]:this.tags; // target tags
span.setAttribute("tags",tags);
var fmt=(params[2]&¶ms[2].length)?params[2]:this.fmt; // output format
span.setAttribute("fmt",fmt.unescapeLineBreaks());
var datefmt=(params[3]&¶ms[3].length)?params[3]:this.datefmt; // date format
span.setAttribute("datefmt",datefmt.unescapeLineBreaks());
var html=this.html;
html=html.replace(/%nosubject%/g,(this.fmt.indexOf("%subject%")==-1)?"none":"block");
html=html.replace(/%nomessage%/g,(this.fmt.indexOf("%message%")==-1)?"none":"block");
var subjtxt=""; var msgtxt="";
/*********** TBD: set previous subj/msg into form (for DiscussionPlugin "edit")
if (overwrite) {
var txt=store.getTiddlerText(target,"");
// TBD: get subject text
// TBD: get msg txt
}
************/
html=html.replace(/%subjtxt%/g,subjtxt);
html=html.replace(/%msgtxt%/g,msgtxt);
span.innerHTML=html; // append comment form to content
},
html: "<form style='display:inline;margin:0;padding:0;'>\
<div style='display:%nosubject%'>\
subject:<br>\
<input type='text' name='subject' title='enter subject text' style='width:100%' value='%subjtxt%'>\
</div>\
<div style='display:%nomessage%'>\
message:<br>\
<textarea name='message' rows='7' title='enter message text' \
style='width:100%'>%msgtxt%</textarea>\
</div>\
<center>\
<i>Please enter your information and then press</i>\
<input type='button' value='post' onclick='\
var s=this.form.subject; var m=this.form.message;\
if (\"%nosubject%\"!=\"none\" && !s.value.length)\
{ alert(\"Please enter a subject\"); s.focus(); return false; }\
if (\"%nomessage%\"!=\"none\" && !m.value.length)\
{ alert(\"Please enter a message\"); m.focus(); return false; }\
var here=this.form.parentNode.getAttribute(\"here\");\
var reverse=this.form.parentNode.getAttribute(\"reverse\")==\"true\";\
var target=this.form.parentNode.getAttribute(\"target\");\
var tags=this.form.parentNode.getAttribute(\"tags\").readBracketedList();\
var fmt=this.form.parentNode.getAttribute(\"fmt\");\
var datefmt=this.form.parentNode.getAttribute(\"datefmt\");\
var overwrite=this.form.parentNode.getAttribute(\"overwrite\")==\"true\";\
config.macros.comment.addComment(here,reverse,target,tags,fmt,datefmt,s.value,m.value,overwrite);'>\
</center>\
</form>",
addComment: function(here,reverse,target,newtags,fmt,datefmt,subject,message,overwrite) {
var UTC=new Date().convertToYYYYMMDDHHMMSSMMM();
var rand=Math.random().toString();
var who=config.options.txtUserName;
var when=new Date().formatString(datefmt);
target=target.replace(/%tiddler%/g,here);
target=target.replace(/%UTC%/g,UTC);
target=target.replace(/%random%/g,rand);
target=target.replace(/%who%/g,who);
target=target.replace(/%when%/g,when);
target=target.replace(/%subject%/g,subject);
var t=store.getTiddler(target);
var text=t?t.text:"";
var modifier=t?t.modifier:config.options.txtUserName;
var modified=t?t.modified:new Date();
var tags=t?t.tags:[];
for(var i=0; i<newtags.length; i++) tags.pushUnique(newtags[i]);
var fields=t?t.fields:{};
var out=fmt;
out=out.replace(/%tiddler%/g,here);
out=out.replace(/%UTC%/g,UTC);
out=out.replace(/%when%/g,when);
out=out.replace(/%who%/g,who);
out=out.replace(/%subject%/g,subject);
out=out.replace(/%message%/g,message);
var pos=text.indexOf(this.marker);
if (pos==-1) pos=text.length; // no marker - insert at end
else if (reverse) pos+=this.marker.length; // reverse order by inserting AFTER marker
var newtxt=overwrite?out:(text.substr(0,pos)+out+text.substr(pos));
store.saveTiddler(target,target,newtxt,modifier,modified,tags,fields);
if (document.getElementById(story.idPrefix+target))
story.refreshTiddler(target,DEFAULT_VIEW_TEMPLATE,true);
if (here!=target && document.getElementById(story.idPrefix+here))
story.refreshTiddler(here,DEFAULT_VIEW_TEMPLATE,true);
}
};
//}}}
/***
|Name|CommentPluginInfo|
|Source|http://www.TiddlyTools.com/#CommentPlugin|
|Documentation|http://www.TiddlyTools.com/#CommentPluginInfo|
|Version|2.9.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|Documentation|
|Requires||
|Overrides||
|Description|Documentation for CommentPlugin|
!!!!!Usage
<<<
syntax:
{{{
<<comment TiddlerName overwrite reverse tags format dateformat>>
}}}
where:
*''~TiddlerName'' //(optional)//<br>specifies the 'target' tiddler into which the comments should be written. If omitted, the tiddler in which the {{{<<comment>>}}} macro is contained is used by default. //Note: when specifying additional macro parameters, you can use a blank ~TiddlerName (e.g., {{{""}}}) or the keyword //{{{"here"}}}// as a 'placeholder' to allow the current 'containing tiddler' to be used by default.// The specified target can also include special //named substitution markers// to automatically generate a unique title for each target tiddler by dynamically inserting values to construct the target ~TiddlerName, where:
**%tiddler%=containing tiddler title,
**%UTC%=UTC timestamp (YYYYMMMDD.HHMMSSMMM),
**%random%=random decimal number (.123456789),
**%who%=current TiddlyWiki username,
**%subject%=comment subject text.
*''overwrite'' //(optional)//<br>By default, comments are added to the current content of a tiddler (if it already exists). When the ''overwrite'' keyword parameter is present, the comment text completely replaces the previous contents of an existing tiddler. ''Warning: extreme caution should always be applied when using the overwrite option, as all existing content of a tiddler will be discarded whenever a comment is written to that tiddler''.
*''reverse'' //(optional)//<br>specifies the order in which new comments are added to the target tiddler. By default, new comments are added //following// existing comments (if any). When this parameter is present, new comments will be inserted //before// existing comments, resulting in a reverse-chronological display (i.e, newest comment shown first).
*''tags'' //(optional)//<br>specifies one or more space-separated tags to add to the target tiddler whenever a comment is written. Note that the list of tags should be enclosed in "..." so that it is processed as a single parameter. Also, to specify tags when writing comments to the current tiddler, use a blank placeholder for the TiddlerName (e.g., "")
*''format'' //(optional)//<br>specifies a custom output format that overrides the default output format defined via {{{config.macros.comment.fmt}}} and is used when inserting comments into the target tiddler. The format uses //named substitution markers//, where:
**%tiddler%=containing tiddler title,
**%UTC%=UTC timestamp (YYYYMMMDD.HHMMSSMMM),
**%when%=formatted date/time,
**%who%=username,
**%subject%=subject,
**%message%=comment body text.
*''dateformat'' //(optional)//<br>specifies a custom date/timestamp output used within the comment format above. When present, this parameter overrides the default date/timestamp format defined via {{{config.macros.comment.datefmt}}}. See the ''Configuration'' section below for additional details.
To indicate the location within the target tiddler where new comments are to be saved, embed a marker: {{{/%comment%/}}}, in the tiddler source. Each new comment is inserted immediately preceding the marker, resulting in a time-ordered sequence of comments. If no comment marker is present in the target tiddler, new comments are automatically appended to the end of that tiddler's content.
<<<
!!!!!Configuration
<<<
To configure the behavior and formats used by [[CommentPlugin]], place one or more of the following javascript statements in a tiddler tagged with <<tag systemConfig>>: //(note: the default values for each setting are shown)//
{{{
config.macros.comment.reverse=false;
}}}
>when set to {{{true}}}, all new comments to be inserted //following// the comment marker instead of preceding it, resulting in a reverse chronological display order. If no comment marker is present in the target tiddler source, the 'reverse' option is ignored and new comments are always appended to the end of the target tiddler.
{{{
config.macros.comment.fmt="__''%subject%''__\n^^posted by %who% on %when%^^\n<<<\n%message%\n<<<\n";
}}}
>defines the comment output format to be inserted into the tiddler, where: %when%=date/time, %who%=username, %subject%=subject, and %message% is the body of the comment. //Note: if you omit %subject% from the output format, the subject input field on the comment form will be automatically suppressed. Similarly, omitting %message% from the output format suppresses the message input field. This can be useful when using the {{{<<comment>>}}} macro to create simple activity logs that only require a short, one-line subject rather than entering extended message content.//
{{{
config.macros.comment.datefmt="DDD, MMM DDth, YYYY at hh12:0mm:0ss am";
}}}
>defines the date/timestamp output used within the comment format above.
{{{
config.macros.comment.tags="";
}}}
>defines an optional space-separated, list of tags to be added to the target tiddler whenever a comment is written. This is most useful when the target tiddler is different from the tiddler containing the {{{<<comment>>}}} macro, to make it easy to locate that tiddler later on.
Note: as of revision 2.0.0, dependencies on [[NestedSlidersPlugin]], [[MoveablePanelPlugin]], [[InlineJavascriptPlugin]] and [[ExpandSlidersScript]] have been eliminated. As a result, the comment form and generated comment output are no longer automatically contained within sliders and the "view all/close all" command is not automatically included. To recreate the previous output format and comment interface, use the following syntax in the tiddler in which you want to place your comments:
{{{
+++^40em^[add a note]...
<<moveablePanel>>add a note
----
<<comment here "" "+++!!!!![%when% (%who%): %subject%]>...\n%message%\n===\n">>===
| <<tiddler ExpandSlidersScript with: here "view all" "close all">>
}}}
<<<
!!!!!Revisions
<<<
2008.05.17 [2.9.0] added support for optional 'overwrite' macro param to replace existing comment (for use when comment is stored as separate tiddler)
2008.04.21 [2.8.0] replaced use of %n markers with special 'named' markers: %tiddler%, %UTC%, %random%, %who%, %when%, %subject% and %message% to avoid conflict with TW core processing of tiddler content. Also, added support for 'reverse' macro param.
2008.04.17 [2.7.0] added support for constructing target by inserting UTC timestamp, random number, username and/or subject text into target tiddler title
2008.04.15 [2.6.0] added support for custom format and dateformat parameters to override global default formats
2008.04.15 [2.5.1] make sure tiddlers are displayed before attempting to refresh them
2008.04.15 [2.5.0] refresh tiddler containing comment macro after adding new comment to target tiddler (if different)
2008.04.14 [2.4.0] added optional tag list parameter for tagging the target tiddler when comments are written
2008.04.14 [2.3.0] if %2 (subject) or %3 (message) are omitted from format string, suppress display and validation of corresponding form elements.
2008.04.13 [2.2.0] added optional ~TiddlerName param to specify target tiddler for writing comments
2008.04.10 [2.1.0] converted from inline script to plugin
2008.04.05 [2.0.0] removed dependencies on NestedSlidersPlugin, MoveablePanelPlugin, ExpandSlidersScript
2007.10.24 [1.2.0] added config.options.txtCommentDateFormat
2007.07.05 [1.1.0] added 'view all/close all' toolbar item plus code cleanup
2007.06.28 [1.0.2] added tiddler.fields to saveTiddler() call (preserves custom fields)
2007.05.26 [1.0.1] added support for optional 'reverse' keyword.
2006.04.20 [1.0.0] initial release
<<<
/***
Just some bits and pieces
***/
//{{{
config.messages.messageClose.text = "X"; // default is "close"
config.views.wikified.defaultText = ""; // default is "The tiddler '%0' doesn't yet exist. Double-click to create it"
config.options.chkShowStartupBreadcrumbs=true;
config.options.chkBreadcrumbsLimitOpenTiddlers=true;
config.options.txtBreadcrumbsLimitOpenTiddlers=1;
config.macros.breadcrumbs.homeSeparator=" ";
config.macros.breadcrumbs.crumbSeparator=" ";
//}}}
/***
|Name|CoreTweaks|
|Source|http://www.TiddlyTools.com/#CoreTweaks|
|Version|n/a|
|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.2.0|
|Type|plugin|
|Requires||
|Overrides|various|
|Description|a small collection of overrides to TW core functions|
This tiddler contains some quick tweaks and modifications to TW core functions to provide minor changes in standard features or behavior. It is hoped that some of these tweaks may be incorporated into later versions of the TW core, so that these adjustments will be available without needing these add-on definitions.
>''Note: the changes contained in this tiddler are generally applicable for the current version of TiddlyWiki (<<version>>). Please view [[CoreTweaksArchive]] for tweaks and modifications that may be used with earlier versions of TiddlyWiki.''
----
***/
// // {{block{
/***
!!!757 add removeOptionCookie() function
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/757 - OPEN
When a TW option is reset to it's hard-coded default value, the corresponding browser cookie is usually just set to that default value, which results in an accumulation of unnecessary cookies. Unfortunately, there is a browser-imposed limit on the number of cookies that are stored for any given domain and, when that limit is reached, the browser starts removing cookies on it's own, thereby unexpectedly discarding some TW settings. In order to allow core and/or plugin code to 'clean up after themselves' and remove unneeded cookies, this tweak provides a new 'core' function, removeOptionCookie() that is the inverse of the existing saveOptionCookie(), and results in the actual deletion of the browser cookie associated with the specified TW option.
***/
//{{{
if (window.removeOptionCookie===undefined) {
window.removeOptionCookie=function(cookie) {
var ex=new Date();
ex.setTime(ex.getTime()-1000); // immediately expire cookie
document.cookie = cookie+"=novalue; path=/; expires="+ex.toGMTString();
}
}
//}}}
// // }}}}}}// // {{block{
/***
!!!749 ieCreatePath fixup for handling / in UNC paths
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/749 - OPEN
***/
//{{{
// tweak ieCreatePath to add fallback check for / (in addition to current check for \)
var fn=window.ieCreatePath;
fn=fn.toString().replace(/function ieCreatePath\(path\)/,'window.ieCreatePath=function(path)');
fn=fn.toString().replace(/var pos = path.lastIndexOf\("\\\\"\);/,
'var pos=path.lastIndexOf("\\\\"); if(pos==-1) pos=path.lastIndexOf("/");');
eval(fn);
//}}}
// // }}}}}}// // {{block{
/***
!!!742 #animate:... paramifier
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/742 - OPEN
Occasionally, when using some low-end browser/hardware combinations, TiddlyWiki documents can "bog down" and become almost unusable due to poor responsiveness. Fortunately, disabling animation effects (via <<option chkAnimate>>) often makes a big difference in performance. Unfortunately, clearing this checkbox can be nearly impossible if the document in question is already bogged down due to animations. The "#animate:true/false" paramifier avoids this problem by allowing the user to set/clear the 'chkAnimate' flag on-the-fly while the URL is being initially loaded into the browser.
***/
//{{{
config.paramifiers.animate= {
onstart: function(v) {
config.options.chkAnimate=eval(v);
}
};
//}}}
// // }}}}}}// // {{block{
/***
!!!741 allow """<hr>""" directly in wiki-formatted content
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/741 - OPEN
This tweak extends the 'horizontal rule' formatter to recognize {{{<hr>}}} (or {{{<hr />}}}) directly in tiddler content without being enclosed within an HTML block (i.e., {{{<html><hr></html>}}}). This allows HR elements to be used within table cell content, bullet items and other ''line-mode'' syntax, where the required use of newlines surrounding the """----""" syntax would interfere with the enclosing line-mode formatting.
***/
//{{{
config.formatters[config.formatters.findByField("name","rule")].match+="|<hr ?/?>\\n?";
//}}}
// // }}}}}}// // {{block{
/***
!!!683 FireFox3 Import bug: "browse" button replacement
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/683 - OPEN
see also http://trac.tiddlywiki.org/ticket/604 - cross-platform askForFilename()
The web standard "type=file" input control that has been used as a local path/file picker for TiddlyWiki no longer works as expected in FireFox3, which has, for "security" reasons, limited javascript access to this control so that *no* local filesystem path information can be revealed, even when it is intentional and necessary, as it is with TiddlyWiki. This tweak provides alternative HTML source that patches the backstage import panel. It replaces the "type=file" input control with a text+button combination of controls that invokes a system-native secure 'file-chooser' dialog box to provide TiddlyWiki with access to a complete path+filename so that TW functions properly locate user-selected local files.
***/
//{{{
if (window.Components) {
var fixhtml='<input name="txtBrowse" style="width:30em"><input type="button" value="..."'
+' onClick="window.browseForFilename(this.previousSibling,true)">';
var cmi=config.macros.importTiddlers;
cmi.step1Html=cmi.step1Html.replace(/<input type='file' size=50 name='txtBrowse'>/,fixhtml);
}
merge(config.messages,{selectFile:"Please enter or select a file"}); // ready for I18N translation
window.browseForFilename=function(target,mustExist) { // note: both params are optional
var msg=config.messages.selectFile;
if (target && target.title) msg=target.title; // use target field tooltip (if any) as dialog prompt text
// get local path for current document
var path=getLocalPath(document.location.href);
var p=path.lastIndexOf("/"); if (p==-1) p=path.lastIndexOf("\\"); // Unix or Windows
if (p!=-1) path=path.substr(0,p+1); // remove filename, leave trailing slash
var file=""
var result=window.askForFilename(msg,path,file,mustExist); // requires #604
if (target && result.length) // set target field and trigger handling
{ target.value=result; target.onchange(); }
return result;
}
//}}}
// // }}}}}}// // {{block{
/***
!!!604 cross-platform askForFilename()
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/604 - OPEN
invokes a system-native secure 'file-chooser' dialog box to provide TiddlyWiki with access to a complete path+filename so that TW functions properly locate user-selected local files.
***/
//{{{
window.askForFilename=function(msg,path,file,mustExist) {
var r = window.mozAskForFilename(msg,path,file,mustExist);
if(r===null || r===false)
r = window.ieAskForFilename(msg,path,file,mustExist);
if(r===null || r===false)
r = window.javaAskForFilename(msg,path,file,mustExist);
if(r===null || r===false)
r = prompt(msg,path+file);
return r||"";
}
window.mozAskForFilename=function(msg,path,file,mustExist) {
if(!window.Components) return false;
try {
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
var nsIFilePicker = window.Components.interfaces.nsIFilePicker;
var picker = Components.classes['@mozilla.org/filepicker;1'].createInstance(nsIFilePicker);
picker.init(window, msg, mustExist?nsIFilePicker.modeOpen:nsIFilePicker.modeSave);
var thispath = Components.classes['@mozilla.org/file/local;1'].createInstance(Components.interfaces.nsILocalFile);
thispath.initWithPath(path);
picker.displayDirectory=thispath;
picker.defaultExtension='html';
picker.defaultString=file;
picker.appendFilters(nsIFilePicker.filterAll|nsIFilePicker.filterText|nsIFilePicker.filterHTML);
if (picker.show()!=nsIFilePicker.returnCancel)
var result=picker.file.persistentDescriptor;
}
catch(ex) { displayMessage(ex.toString()); }
return result;
}
window.ieAskForFilename=function(msg,path,file,mustExist) {
if(!config.browser.isIE) return false;
try {
var s = new ActiveXObject('UserAccounts.CommonDialog');
s.Filter='All files|*.*|Text files|*.txt|HTML files|*.htm;*.html|';
s.FilterIndex=3; // default to HTML files;
s.InitialDir=path;
s.FileName=file;
return s.showOpen()?s.FileName:"";
}
catch(ex) { displayMessage(ex.toString()); }
return result;
}
window.javaAskForFilename=function(msg,path,file,mustExist) {
if(!document.applets["TiddlySaver"]) return false;
// TBD: implement java-based askFile(...) function
try { return document.applets["TiddlySaver"].askFile(msg,path,file,mustExist); }
catch(ex) { displayMessage(ex.toString()); }
}
//}}}
// // }}}}}}// // {{block{
/***
!!!676 #story:... paramifier
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/676 - OPEN
scan the specified 'story' tiddler content for embedded links, rather than simply parsing the content as a space-separated bracketed list. This allows links from ''any'' tiddler to be used as a story, regardless of other wiki-syntax contained in that tiddler. If specified tiddler is a shadow, fallback to using parseParams() to extract the list of links.
***/
//{{{
config.paramifiers.story = {
onstart: function(v) {
var t=store.getTiddler(v); if (t) t.changed();
var list=t?t.links:store.getTiddlerText(v,"").parseParams("open",null,false);
story.displayTiddlers(null,list);
}
};
//}}}
// // }}}}}}// // {{block{
/***
!!!664 Loose links (case-folded/space-folded wiki words)
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/664 - OPEN
This tweak matches non-WikiWord variations of mixed-case and/or added/omitted spaces within double-bracketed text with titles of //existing// tiddlers, using a "loose" (case-folded/space-folded) comparison. This allows text that occurs in normal prose to be more easily linked to tiddler titles by using double-brackets without the full "pretty link" syntax. For example:
{{{
[[CoreTweaks]], [[coreTweaks]], [[core tweaks]],
[[CORE TWEAKS]], [[CoRe TwEaKs]], [[coreTWEAKS]]
}}}
>[[CoreTweaks]], [[coreTweaks]], [[core tweaks]],
>[[CORE TWEAKS]], [[CoRe TwEaKs]], [[coreTWEAKS]]
Configuration:
><<option chkLooseLinks>> Allow case-folded and/or space-folded text to link to existing tiddler titles
>"""<<option chkLooseLinks>>"""
***/
//{{{
if (!config.options.chkLooseLinks)
config.options.chkLooseLinks=false; // default to standard behavior
window.caseFold_createTiddlyLink = window.createTiddlyLink;
window.createTiddlyLink = function(place,title,includeText,className) {
var btn=window.caseFold_createTiddlyLink.apply(this,arguments); // create core link
if (!config.options.chkLooseLinks) return btn;
if (store.getTiddlerText(title)) return btn; // matching tiddler (or shadow) exists
var target=title.toLowerCase().replace(/\s/g,"");
var tids=store.getTiddlers("title");
for (var t=0; t<tids.length; t++) {
if (tids[t].title.toLowerCase().replace(/\s/g,"")==target) {
var i=getTiddlyLinkInfo(tids[t].title,className);
btn.setAttribute("tiddlyLink",tids[t].title);
btn.title=i.subTitle;
btn.className=i.classes;
break;
}
}
return btn;
}
//}}}
// // }}}}}}// // {{block{
/***
!!!657 wrap tabs onto multiple lines
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/657 - OPEN
This tweak inserts an extra space element following each tab, allowing them to wrap onto multiple lines if needed.
***/
//{{{
config.macros.tabs.handler = function(place,macroName,params)
{
var cookie = params[0];
var numTabs = (params.length-1)/3;
var wrapper = createTiddlyElement(null,"div",null,"tabsetWrapper " + cookie);
var tabset = createTiddlyElement(wrapper,"div",null,"tabset");
tabset.setAttribute("cookie",cookie);
var validTab = false;
for(var t=0; t<numTabs; t++) {
var label = params[t*3+1];
var prompt = params[t*3+2];
var content = params[t*3+3];
var tab = createTiddlyButton(tabset,label,prompt,this.onClickTab,"tab tabUnselected");
createTiddlyElement(tab,"span",null,null," ",{style:"font-size:0pt;line-height:0px"}); // ELS
tab.setAttribute("tab",label);
tab.setAttribute("content",content);
tab.title = prompt;
if(config.options[cookie] == label)
validTab = true;
}
if(!validTab)
config.options[cookie] = params[1];
place.appendChild(wrapper);
this.switchTab(tabset,config.options[cookie]);
};
//}}}
// // }}}}}}// // {{block{
/***
!!!637 TiddlyLink tooltip - custom formatting
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/637 - OPEN
This tweak modifies the tooltip format that appears when you mouseover a link to a tiddler. It adds an option to control the date format, as well as displaying the size of the tiddler (in bytes)
Tiddler link tooltip format:
{{stretch{<<option txtTiddlerLinkTootip>>}}}
^^where: %0=title, %1=username, %2=modification date, %3=size in bytes, %4=description slice^^
Tiddler link tooltip date format:
{{stretch{<<option txtTiddlerLinkTooltipDate>>}}}
***/
//{{{
config.messages.tiddlerLinkTooltip="%0 - %1, %2 (%3 bytes) - %4";
config.messages.tiddlerLinkTooltipDate="DDD, MMM DDth YYYY 0hh12:0mm AM";
config.options.txtTiddlerLinkTootip=
config.options.txtTiddlerLinkTootip||config.messages.tiddlerLinkTooltip;
config.options.txtTiddlerLinkTooltipDate=
config.options.txtTiddlerLinkTooltipDate||config.messages.tiddlerLinkTooltipDate;
Tiddler.prototype.getSubtitle = function() {
var modifier = this.modifier;
if(!modifier) modifier = config.messages.subtitleUnknown;
var modified = this.modified;
if(modified) modified = modified.formatString(config.options.txtTiddlerLinkTooltipDate);
else modified = config.messages.subtitleUnknown;
var descr=store.getTiddlerSlice(this.title,"Description")||"";
return config.options.txtTiddlerLinkTootip.format([this.title,modifier,modified,this.text.length,descr]);
};
//}}}
// // }}}}}}// // {{block{
/***
!!!628 hide "no such macro" errors
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/628 - OPEN
When invoking a macro that is not defined, this tweak prevents the display of the "error in macro... no such macro" message. This is useful when rendering tiddler content or templates that reference macros that are defined by //optional// plugins that have not been installed in the current document.
<<option chkHideMissingMacros>> hide "no such macro" error messages
***/
//{{{
if (config.options.chkHideMissingMacros===undefined)
config.options.chkHideMissingMacros=false;
window.coreTweaks_missingMacro_invokeMacro = window.invokeMacro;
window.invokeMacro = function(place,macro,params,wikifier,tiddler) {
if (!config.macros[macro] || !config.macros[macro].handler)
if (config.options.chkHideMissingMacros) return;
window.coreTweaks_missingMacro_invokeMacro.apply(this,arguments);
}
//}}}
// // }}}}}}// // {{block{
/***
!!!609/610 toolbars - separators and transclusion
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/609 - OPEN (separators)
http://trac.tiddlywiki.org/ticket/610 - OPEN (wikify tiddler/slice/section content)
These tweaks extend the """<<toolbar>>""" macro to permit use of "|" as separators, as well as recognizing references to tiddlernames, slices, or sections and rendering their content inline within the toolbar
''see [[ToolbarCommands]] for examples of how these features can be used''
***/
//{{{
merge(config.macros.toolbar,{
separator: "|"
});
config.macros.toolbar.handler = function(place,macroName,params,wikifier,paramString,tiddler)
{
for(var t=0; t<params.length; t++) {
var c = params[t];
switch(c) {
case '|': // ELS - SEPARATOR
case '!': // ELS - SEPARATOR (alternative for use in tiddler slices)
createTiddlyText(place,this.separator); // ELS
break; // ELS
case '>':
var btn = createTiddlyButton(place,this.moreLabel,this.morePrompt,config.macros.toolbar.onClickMore);
addClass(btn,"moreCommand");
var e = createTiddlyElement(place,"span",null,"moreCommand");
e.style.display = "none";
place = e;
break;
default:
var theClass = "";
switch(c.substr(0,1)) {
case "+":
theClass = "defaultCommand";
c = c.substr(1);
break;
case "-":
theClass = "cancelCommand";
c = c.substr(1);
break;
}
if(c in config.commands)
this.createCommand(place,c,tiddler,theClass);
else { // ELS - WIKIFY TIDDLER/SLICE/SECTION
if (c.substr(0,1)=="~") c=c.substr(1); // ignore leading ~
var txt=store.getTiddlerText(c);
if (txt) {
txt=txt.replace(/^\n*/,"").replace(/\n*$/,""); // trim any leading/trailing newlines
txt=txt.replace(/^\{\{\{\n/,"").replace(/\n\}\}\}$/,""); // trim PRE format wrapper if any
wikify(txt,createTiddlyElement(place,"span"),null,tiddler);
}
} // ELS - end WIKIFY CONTENT
break;
}
}
};
//}}}
// // }}}}}}// // {{block{
/***
!!!608 toolbar - more/less toggle
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/608 - OPEN
This tweak extends the """<<toolbar>>""" macro to make the ">" (more) a //toggle// between more/less with the additional toolbar commands displayed on a separate line.
***/
//{{{
merge(config.macros.toolbar,{
moreLabel: 'more',
morePrompt: "Show additional commands",
lessLabel: 'less',
lessPrompt: "Hide additional commands"
});
config.macros.toolbar.onClickMore = function(ev)
{
var e = this.nextSibling;
var showing=e.style.display=="block";
e.style.display = showing?"none":"block";
this.innerHTML=showing?config.macros.toolbar.moreLabel:config.macros.toolbar.lessLabel;
this.title=showing?config.macros.toolbar.morePrompt:config.macros.toolbar.lessPrompt;
return false;
};
//}}}
// // }}}}}}// // {{block{
/***
!!!607 add HREF link on permaview command
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/607 - OPEN
This tweak automatically sets the HREF for the 'permaview' sidebar command link so you can use the 'right click' context menu for faster, easier bookmarking. Note that this does ''not'' automatically set the permaview in the browser's current location URL... it just sets the HREF on the command link. You still have to click the link to apply the permaview.
***/
//{{{
config.macros.permaview.handler = function(place)
{
var btn=createTiddlyButton(place,this.label,this.prompt,this.onClick);
addEvent(btn,"mouseover",this.setHREF);
addEvent(btn,"focus",this.setHREF);
};
config.macros.permaview.setHREF = function(event){
var links = [];
story.forEachTiddler(function(title,element) {
links.push(String.encodeTiddlyLink(title));
});
var newURL=document.location.href;
var hashPos=newURL.indexOf("#");
if (hashPos!=-1) newURL=newURL.substr(0,hashPos);
this.href=newURL+"#"+encodeURIComponent(links.join(" "));
}
//}}}
// // }}}}}}// // {{block{
/***
!!!529 IE fixup - case-sensitive element lookup of tiddler elements
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/529 - OPEN
This tweak hijacks the standard browser function, document.getElementById(), to work-around the case-INsensitivity error in Internet Explorer (all versions up to and including IE7) //''Note: This tweak is only applied when using IE, and only for lookups of rendered tiddler elements within the containing "tiddlerDisplay" element.''//
***/
//{{{
if (config.browser.isIE) {
document.coreTweaks_coreGetElementById=document.getElementById;
document.getElementById=function(id) {
var e=document.coreTweaks_coreGetElementById(id);
if (!e || !e.parentNode || e.parentNode.id!="tiddlerDisplay") return e;
for (var i=0; i<e.parentNode.childNodes.length; i++)
if (id==e.parentNode.childNodes[i].id) return e.parentNode.childNodes[i];
return null;
};
}
//}}}
// // }}}}}}// // {{block{
/***
!!!471 'creator' field for new tiddlers
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/471 - OPEN
This tweak HIJACKS the core's saveTiddler() function to automatically add a "creator" field to a tiddler when it is FIRST created. You can use """<<view creator>>""" (or """<<view creator wikified>>""" if you prefer) to show this value embedded directly within the tiddler content, or {{{<span macro="view creator"></span>}}} in the ViewTemplate and/or EditTemplate to display the creator value in each tiddler.
***/
//{{{
// hijack saveTiddler()
TiddlyWiki.prototype.CoreTweaks_creatorSaveTiddler=TiddlyWiki.prototype.saveTiddler;
TiddlyWiki.prototype.saveTiddler=function(title,newTitle,newBody,modifier,modified,tags,fields)
{
var existing=store.tiddlerExists(title);
var tiddler=this.CoreTweaks_creatorSaveTiddler.apply(this,arguments);
if (!existing) store.setValue(title,"creator",config.options.txtUserName);
return tiddler;
}
//}}}
// // }}}}}}// // {{block{
/***
!!!458 add permalink-like HREFs on internal TiddlyLinks
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/458 - CLOSED: WON'T FIX
This tweak assigns a "permalink"-like HREF to internal Tiddler links (which normally do not have any HREF defined). This permits the link's context menu (right-click) to include 'open link in another window/tab' command. Based on a request from Dustin Spicuzza.
***/
//{{{
window.coreTweaks_createTiddlyLink=window.createTiddlyLink;
window.createTiddlyLink=function(place,title,includeText,theClass,isStatic,linkedFromTiddler,noToggle)
{
// create the core button, then add the HREF (to internal links only)
var link=window.coreTweaks_createTiddlyLink.apply(this,arguments);
if (!isStatic)
link.href=document.location.href.split("#")[0]+"#"+encodeURIComponent(String.encodeTiddlyLink(title));
return link;
}
//}}}
// // }}}}}}// // {{block{
/***
!!!444 'tiddler' and 'place' - global variables for use in computed macro parameters
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/444 - OPEN
When invoking a macro, this tweak makes the current containing tiddler object and DOM rendering location available as global variables (window.tiddler and window.place, respectively). These globals can then be used within "computed macro parameters" to retrieve tiddler-relative and/or DOM-relative values or perform tiddler-specific side-effect functionality.
***/
//{{{
window.coreTweaks_invokeMacro = window.invokeMacro;
window.invokeMacro = function(place,macro,params,wikifier,tiddler) {
var here=story.findContainingTiddler(place);
window.tiddler=here?store.getTiddler(here.getAttribute("tiddler")):null;
window.place=place;
window.coreTweaks_invokeMacro.apply(this,arguments);
}
//}}}
// // }}}}}}// // {{block{
/***
!!!401 PageTitle - alternative to combined ~SiteTitle/~SiteSubtitle in window titlebar
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/401 - CLOSED: WON'T FIX
This tweak allows definition of an optional [[PageTitle]] tiddler that, when present, provides alternative text for display in the browser window's titlebar, instead of using the combined text content from [[SiteTitle]] and [[SiteSubtitle]] (which will still be displayed as usual in the TiddlyWiki document header area)
***/
//{{{
window.coreTweaks_getPageTitle=window.getPageTitle;
window.getPageTitle=function() {
var txt=wikifyPlain("PageTitle"); if (txt.length) return txt;
return window.coreTweaks_getPageTitle.apply(this,arguments);
}
store.addNotification("PageTitle",refreshPageTitle); // so title stays in sync with tiddler changes
//}}}
// // }}}}}}// // {{block{
/***
!!!67 Missing links - ignore non-wiki syntax source content
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/67 - OPEN
The "missing links" list includes items contained within "quoted" text (i.e., content that will not render as wiki-syntax, and so CANNOT create any tiddler links, even if the quoted text matches valid link syntax). This tweak removes content contained between certain delimiters before scanning tiddler source for possible links.
Delimiters include:
{{{
/%...%/
{{{...}}}
"""..."""
<nowiki>...</nowiki>
<html>...</html>
<script>...</script>
}}}
***/
//{{{
Tiddler.prototype.coreTweaks_changed = Tiddler.prototype.changed;
Tiddler.prototype.changed = function()
{
var savedtext=this.text;
// remove 'quoted' text before scanning tiddler source
this.text=this.text.replace(/\/%((?:.|\n)*?)%\//g,""); // /%...%/
this.text=this.text.replace(/\{{3}((?:.|\n)*?)\}{3}/g,""); // {{{...}}}
this.text=this.text.replace(/"{3}((?:.|\n)*?)"{3}/g,""); // """..."""
this.text=this.text.replace(/\<nowiki\>((?:.|\n)*?)\<\/nowiki\>/g,""); // <nowiki>...</nowiki>
this.text=this.text.replace(/\<html\>((?:.|\n)*?)\<\/html\>/g,""); // <html>...</html>
this.text=this.text.replace(/\<script((?:.|\n)*?)\<\/script\>/g,""); // <script>...</script>
this.coreTweaks_changed.apply(this,arguments);
// restore quoted text to tiddler source
this.text=savedtext;
};
//}}}
// // }}}}}}// // {{block{
/***
!!!(no ticket) """<<tag>>""" macro - sortby parameter
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/TBD - TBD
This tweak adds an optional 'sortby' parameter to the """<<tag tagname label tip sortby>>""" macro, as well as the """<<allTags excludeTag sortby>>""" macro used to generate the sidebar contents 'tags' list. Specify the field on which the contents of each tag popup is to be sorted, with a "+" or "-" prefix to indicate ascending/descending order, respectively.
Example: """<<tag systemConfig "plugins" "list plugins by date, most recent first" "-modified">>"""
Try it: <<tag systemConfig "plugins" "list plugins by date, most recent first" "-modified">>
Similarly, to change the sort order used by the popups from all tags shown in the sidebar contents, edit the [[TagTags]] shadow tiddler and enter: """<<allTags excludeLists -modified>>"""
***/
//{{{
// hijack tag handler() to add 'sortby' attribute to tag button
config.macros.tag.CoreTweaksSortTags_handler=config.macros.tag.handler;
config.macros.tag.handler = function(place,macroName,params)
{
this.CoreTweaksSortTags_handler.apply(this,arguments);
var btn=place.lastChild;
if (params[3]) btn.setAttribute("sortby",params[3]);
}
// tweak <<allTags>> macro to add 'sortby' attribute to each tag button
var fn=config.macros.allTags.handler;
var lines=fn.toString().split("\n");
lines.splice(lines.length-2,0,['if(params[1]) btn.setAttribute("sortby",params[1]);']);
fn=lines.join("\n");
eval("config.macros.allTags.handler="+fn);
// tweak event handler for clicking on a tiddler tag to use 'sortby' attribute
var fn=onClickTag;
fn=fn.toString().replace(
/store.getTaggedTiddlers\(tag\);/g,
'store.getTaggedTiddlers(tag);'
+'var sortby=this.getAttribute("sortby");'
+'if(sortby&&sortby.length) store.sortTiddlers(tagged,sortby);'
);
eval(fn);
//}}}
// // }}}}}}// // {{block{
/***
!!!(no ticket) backslash-quoting for embedding newlines in 'line-mode' formats
***/
// // {{groupbox small{
/***
http://trac.tiddlywiki.org/ticket/TBD - TBD
This HIJACK tweak pre-processes source content to convert "double-backslash-newline" into {{{<br>}}} before wikify(), so that literal newlines can be embedded in line-mode wiki syntax (e.g., tables, bullets, etc.). Based on a suggestion from Sitaram Chamarty.
***/
//{{{
window.coreWikify = wikify;
window.wikify = function(source,output,highlightRegExp,tiddler)
{
if (source) arguments[0]=source.replace(/\\\\\n/mg,"<br>");
coreWikify.apply(this,arguments);
}
//}}}
// // }}}}}}
// // <<foldHeadings>>
{{firstletter{@@color:#777;H@@}}}ave you noticed in the first few times you've viewed the new site from the web that you're having some trouble keeping multiple tiddlers open at the same time? I am . I've not been seeing things as I was in the local version. I fear some of you may also notice it, but may not be aware that you can tweak things to make them a little more user-friendly. And don't worry - it won't change anything on the site permanently, but it may store some cookies on your computer to remember the settings you choose for viewing.
Ok so here is lesson #1 on Custom Viewing Tweaks:
I use a "Plugin" called BreadcrumbPlugin. This is the set of code that creates the little folder tabs at the top as you navigate the site. Let's talk about tweaking this plugin right off.
One of the very cool things I like about this this wiki format is the power to have multiple tiddlers open at one time. Now, for whatever reason, when the site loads itself the first time, you may notice you can only view one tiddler at a time. Have no fear, for we can fix this straight away. Just click [[here|BreadcrumbsPluginInfo]] and it will open up the tiddler that controls the Breadcrumbs settings.
I recommend the following check boxes be selected:
* automatically create breadcrumbs display (if needed)
* show/hide breadcrumbs display
* re-order breadcrumbs when visiting a previously viewed tiddler
* omit 'Home' link from breadcrumbs display
* limit breadcrumbs display to 6 items
Having these items checkboxes selected creates a viewing experience that I feel best utilizes the powers of the features I hav chosen for the site. If you want to limit the number of tiddlers you have open at one time, feel free to select that checkbox and set your own limit.
This is an easy and fast way to tailor your viewing experience. Once I figure out how to set certain default values for these, I'll let you know! In the mean time, feel free to try these settings out - I am positive you'll appreciate the flexibility to suit your own needs!
- Ramicus
/***
|Name|DiscussionPlugin|
|Source|http://www.TiddlyTools.com/#DiscussionPlugin|
|Documentation|http://www.TiddlyTools.com/#DiscussionPluginInfo|
|Version|1.5.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|plugin|
|Requires|CommentPlugin|
|Overrides||
|Description|display tabbed discussion summary with comment input form|
!!!!!Documentation
>see [[DiscussionPluginInfo]]
!!!!!Configuration
<<<
When installed, [[DiscussionPlugin]] can automatically modify the default shadow [[ViewTemplate]] so that all tiddlers will be rendered with two tabs: "Page", and "Discussion". The "Page" tab displays the regular tiddler content, while the "Discussion" tab displays the summary list of comments as well as an input form to enter new comments. You can enable/disable this action by setting/clearing the following checkbox:
><<option chkDiscussionTemplate>> Automatically modify default shadow [[ViewTemplate]]
Note: //''You must reload your document for changes to this option to take effect.''// In addition, this option is only applied to the shadow [[ViewTemplate]]. If you are using a custom [[ViewTemplate]], you will need to manually alter that template to add the Page and Discussion tab display.
''Please see [[DiscussionPluginInfo]] for additional configuration options and instructions.''
<<<
!!!!!Revisions
<<<
2008.05.15 [1.5.0] added automatic creation of shadows for DiscussionViewTemplate and NoDiscussionViewTemplate
2008.04.21 [1.4.0] replaced use of %n markers with special 'named' markers: %tiddler%, %UTC%, %random%, %who%, %when%, %subject% and %message% to avoid conflict with TW core processing of tiddler content.
2008.04.17 [1.3.0] added ability to customize generated 'comment tiddler' titles by using substitution parameters.
2008.04.15 [1.1.1] in currentTiddler.handler(), prevent infinite recursion by removing {{{<<currentTiddler>>}}} from content being wikified.
2008.04.15 [1.1.0] added parameters for reverse, listformat, tags, commentformat, dateformat
| please see [[DiscussionPluginInfo]] for previous revision details |
2008.04.15 [1.0.0] initial prototype
<<<
!!!!!Code
***/
//{{{
version.extensions.DiscussionPlugin= {major: 1, minor: 5, revision: 0, date: new Date(2008,5,15)};
if (config.options.chkDiscussionTemplate===undefined)
config.options.chkDiscussionTemplate=false;
config.macros.discussion= {
reverse: // display order for summary list
false,
listfmt: // format for summary list items
"#<<slider [[]] [[%tiddler%]] [[%subject%]] [[posted by %who% on %when%]]>>\n",
tags: // tags for comment tiddlers
"excludeLists",
slices: // slice format included in comment tiddlers - used to create summary list display
"/%\n|subject|%subject%|\n|byline|%who%|\n|date|%when%|\n%/",
titlefmt: // format for dynamically generating comment tiddler title
"_%UTC%%random%", // default: append UTC timestamp and random number
commentfmt: // format for individual comment content
"^^posted by %who% on %when%^^\n<<<\n%message%\n<<<\n",
datefmt: // date format for comments
"DDD, MMM DDth, YYYY at hh12:0mm:0ss am",
handler: function(place,macroName,params,wikifier,paramstring,tiddler) {
var here=story.findContainingTiddler(place);
if (here) var tid=here.getAttribute("tiddler"); // containing tiddler title
var listfmt=(params[0]&¶ms[0].length)?params[0]:this.listfmt; // item format
var reverse=(params[1]&¶ms[1].toLowerCase()=="reverse"); if (reverse) params.shift();
var tags=params[1]?params[1]:this.tags; // target tags
if (!tags.readBracketedList().contains("comment")) tags+=" comment"; // must be tagged with "comment"
var commentfmt=(params[2]&¶ms[2].length)?params[2]:this.commentfmt; // output format
var datefmt=(params[3]&¶ms[3].length)?params[3]:this.datefmt; // date format
var tids=store.getTaggedTiddlers("comment","created");
if (reverse||this.reverse) tids=tids.reverse();
var out=""; var count=0;
for (var t=0; t<tids.length; t++) if (tids[t].title!=tid && tids[t].title.substr(0,tid.length)==tid) {
count++;
var title=tids[t].title;
var subject=store.getTiddlerSlice(title,"subject");
var byline=store.getTiddlerSlice(title,"byline");
var when=store.getTiddlerSlice(title,"date");
out+=listfmt;
out=out.replace(/%tiddler%/g,title);
out=out.replace(/%subject%/g,subject);
out=out.replace(/%who%/g,byline);
out=out.replace(/%when%/g,when);
}
out="!!!There "+(count==1?"is ":"are ")+count+" comment"+(count==1?"":"s")+":\n"+out;
var next="%tiddler%"+this.titlefmt;
out+="!!!Add a comment:\n";
out+="<<comment "+next+" [["+tags+"]] [["+this.slices+commentfmt+"]] [["+datefmt+"]]>>";
wikify(out,place);
}
};
//}}}
// // automatically add shadow tiddlers and templates for displaying page/discussion tabs
//{{{
// macro for rendering current tiddler content
config.macros.currentTiddler= {
handler: function(place,macroName,params,wikifier,paramstring,tiddler) {
var here=story.findContainingTiddler(place); if (!here) return;
var txt=store.getTiddlerText(here.getAttribute("tiddler"),"");
txt=txt.replace(/\<\<currentTiddler\>\>/g,""); // prevents infinite recursion!
removeChildren(place); wikify(txt,createTiddlyElement(place,"div",null,"viewer"));
}
};
// [[CurrentTiddler]] allows tab to show tiddler content
config.shadowTiddlers.CurrentTiddler="<<currentTiddler>>";
// [[DiscussionTiddler]] allows tab to show discussion panel
config.shadowTiddlers.DiscussionTiddler="<<discussion>>";
// [[NoDiscussionViewTemplate]] is an unmodified copy of the shadow [[ViewTemplate]]
config.shadowTiddlers.NoDiscussionViewTemplate=store.getTiddlerText("ViewTemplate");
// [[DiscussionViewTemplate]] is a copy of the current [[ViewTemplate]] where the
// default viewer content ("view text wikified") is replaced with tabs for Page/Discussion
config.shadowTiddlers.DiscussionViewTemplate=store.getTiddlerText("ViewTemplate").replace(/view text wikified/,
'tabs txtDiscussionTab Page Page CurrentTiddler Discussion Discussion DiscussionTiddler');
// optionally, automatically apply DiscussionViewTemplate to all tiddlers
if (config.options.chkDiscussionTemplate) config.shadowTiddlers.ViewTemplate="[[DiscussionViewTemplate]]";
//}}}
/***
|Name|DiscussionPluginInfo|
|Source|http://www.TiddlyTools.com/#DiscussionPlugin|
|Documentation|http://www.TiddlyTools.com/#DiscussionPluginInfo|
|Version|1.5.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|Documentation|
|Requires||
|Overrides||
|Description|Documentation for DiscussionPlugin|
!!!!!Usage
<<<
syntax:
{{{
<<discussion listformat reverse tags commentformat dateformat>>
}}}
where:
*''listformat'' //(optional)//<br>specifies the display format for each item in the summary list. //Note: when specifying additional macro parameters, you can use a blank value (e.g., {{{""}}}) as a 'placeholder' to allow the default item format to be used.//
*''reverse'' //(optional)//<br>by default, the comments in the discussion summary list are shown in date/time order, with the oldest item listed first. The ''reverse'' keyword, when present, indicates the display order should be inverted so that the most recent item is listed first.
*''tags'' //(optional)//<br>specifies one or more space-separated tags to add to the target tiddler whenever a comment is written. Note that the list of tags should be enclosed in "..." so that it is processed as a single parameter. If you do not want tags added to the individual comment tiddlers, use a blank value (e.g., {{{""}}}) as a 'placeholder'. Regardless of the tags that are specified, a tag of "comment" is always added to each target tiddler. This is required in order to locate the tiddler when generating the dicussion summary list.
*''commentformat'' //(optional)//<br>specifies a custom output format to be used when inserting comments into the target tiddler, where: %when%=formatted date/timestamp, %who%=username, %subject%=comment subject text, and %message% is the body of the comment. When present, this parameter overrides the default output format defined via {{{config.macros.comment.fmt}}}. See the ''Configuration'' section below and in [[CommentPluginInfo]] for additional details.
*''dateformat'' //(optional)//<br>specifies a custom date/timestamp output used within the comment format above. When present, this parameter overrides the default date/timestamp format defined via {{{config.macros.comment.datefmt}}}. See the ''Configuration'' section below and in [[CommentPluginInfo]] for additional details.
<<<
!!!!!Configuration
<<<
[[DiscussionPlugin]] can automatically modify the default shadow [[ViewTemplate]] so that all tiddlers will be rendered with two tabs: "Page", and "Discussion". The "Page" tab displays the regular tiddler content, while the "Discussion" tab displays the summary list of comments as well as an input form to enter new comments. You can enable/disable this action by setting/clearing the following checkbox:
><<option chkDiscussionTemplate>> Automatically modify default shadow [[ViewTemplate]]
>usage: {{{<<option chkDiscussionTemplate>>}}}
>^^(or place {{{config.options.chkDiscussionTemplate=true;}}} in a tiddler tagged with "systemConfig")^^
Note: //''You must reload your document for changes to this option to take effect.''// In addition, this option is only applied to the shadow [[ViewTemplate]]. If you are using a custom [[ViewTemplate]], you will need to manually alter that template to add the Page and Discussion tab display (see below)
<<<
!!!!!Using tags to add discussion tabs to individual tiddlers
<<<
When your document is loaded, DiscussionPlugin automatically creates a shadow DiscussionViewTemplate that is copy of the current ViewTemplate, with the discussion tab syntax automatically installed. If TiddlyTools' TaggedTemplateTweak is also installed in your document then, rather than using the checkbox option to add discussion tabs to //every// tiddler in your document, you can selectively tag individual tiddlers with "discussion" to add the discussion tabs to only those specific tiddlers.
Conversely, if you enable the checkbox option to modify the default ViewTemplate, you can selectively tag individual tiddlers with "noDiscussion" to apply a shadow NoDiscussionViewTemplate that will use an unmodified version of the current ViewTemplate, thereby preventing the discussion tabs from appearing on those specific tiddlers.
<<<
!!!!!Using a customized [[ViewTemplate]]
<<<
To enable the discussion tab display when using a custom [[ViewTemplate]], you should edit that template and change this line:
{{{
<div class='viewer' macro='view text wikified'></div>
}}}
to:
{{{
<div class='viewer' macro='tabs txtDiscussionTab
Page Page CurrentTiddler Discussion Discussion DiscussionTiddler'></div>
}}}
>[[CurrentTiddler]] and [[DiscussionTiddler]] are special shadow tiddlers defined by the plugin. [[CurrentTiddler]] enables the {{{<<tabs>>}}} macro used in the [[ViewTemplate]] to display the content for the current tiddler within a tab, while [[DiscussionTiddler]] simply invokes the default {{{<<discussion>>}}} macro without any extra parameters in order to render the corresponding discussion summary list and comment input form. You can modify the these shadow definitions to add macro parameters or other custom content that will automatically appear in the discussion tab when each tiddler is rendered.
Note: if you are using a custom [[ViewTemplate]], you should also manually create custom versions of DiscussionViewTemplate and NoDiscussionViewTemplate as well, so that you can use the tagging method described above to selectively display discussion tabs for tiddlers that also apply your custom-defined templates.
<<<
!!!!!Plugin customization settings
<<<
To configure the global defaults used by [[DiscussionPlugin]], you can place one or more of the following javascript statements in a tiddler tagged with <<tag systemConfig>>: //(note: the default values for each setting are shown)//
{{{
config.macros.discussion.listfmt="#<<slider [[]] [[%tiddler%]] [[%subject%]] [[posted by %who% on %when%]]>>\n";
}}}
>defines the output format for each item in the discussion summary list, where: %tiddler%=tiddler title of the individual comment tiddler, %subject%=subject text, %who%=username, and %when% is the formatted date/time of the comment. These values are automatically stored in each comment tiddler by using a //hidden slice table//, so that this information can be easily retrieved when generating the summary list output.
{{{
config.macros.discussion.reverse=false;
}}}
>when set to {{{true}}}, the discussion summary list is displayed in a reverse chronological order.
{{{
config.macros.discussion.titlefmt="_%UTC%%random%";
}}}
>When comments are entered, they are written into separate target tiddlers whose titles are constructed by appending a generated suffix to the title of the tiddler containing the {{{<<discussion>>}}} macro. By default, this suffix contains the current UTC timestamp (e.g., YYYYMMDD.HHMMSSMMM) plus a randomly generated number (e.g., .123456789) to ensure that all target tiddlers have unique titles while also associating each comment with the specific discussion summary. The suffix is specified by using //substitution markers//, where: %UTC%=the UTC timestamp, %random%=a random decimal number, %who%=username, and %subject% is the subject text entered into the comment form.
{{{
config.macros.discussion.tags="comment excludeLists";
}}}
>Target tiddlers are automatically tagged with "comment" so that the {{{<<discussion>>}}} macro can locate them when generating the summary list. To reduce 'information clutter', target tiddlers are also tagged with "excludeLists" so that they don't automatically appear in the list of tiddlers shown in the sidebar tabs. You can use this setting to specify an optional space-separated list of tags to be added to the target tiddler whenever a comment is written. You can use a blank value (e.g., {{{""}}} if you do not want to add any extra tags to the target tiddler. However, as noted above, regardless of the specified tags, target tiddlers will still be tagged with "comment" in order to ensure that the {{{<<discussion>>}}} macro includes them in the summary list.
{{{
config.macros.discussion.commentfmt="^^posted by %who% on %when%^^\n<<<\n%message%\n<<<\n";
}}}
>defines the comment output format to be inserted into the target tiddler, where: %when%=date/timestamp, %who%=username, %subject%=subject, and %message% is the body of the comment. //Note: if you omit %subject% from the output format, the subject input field on the comment form will be automatically suppressed. Similarly, omitting %message% from the output format suppresses the message input field. This can be useful when using the {{{<<comment>>}}} macro to create simple activity logs that only require a short, one-line subject rather than entering extended message content.//
{{{
config.macros.comment.datefmt="DDD, MMM DDth, YYYY at hh12:0mm:0ss am";
}}}
>defines the date/timestamp output used within the comment format above.
<<<
!!!!!Revisions
<<<
2008.05.15 [1.5.0] added automatic creation of shadows for DiscussionViewTemplate and NoDiscussionViewTemplate
2008.04.21 [1.4.0] replaced use of %n markers with special 'named' markers: %tiddler%, %UTC%, %random%, %who%, %when%, %subject% and %message% to avoid conflict with TW core processing of tiddler content.
2008.04.17 [1.3.0] added ability to customize generated 'comment tiddler' titles by using substitution parameters.
2008.04.17 [1.2.0] added ability to customize generated 'comment tiddler' titles by using substitution parameters.
2008.04.15 [1.1.1] in currentTiddler.handler(), prevent infinite recursion by removing {{{<<currentTiddler>>}}} from content being wikified.
2008.04.15 [1.1.0] added parameters for reverse, listformat, tags, commentformat, dateformat
2008.04.14 [1.0.0] initial prototype
<<<
[[Download this document|http://kinazar.com/Storage/House%20Rules/v3.6/Disposition%20v3.6.doc]]
<html><div align="center"><iframe src="http://kinazar.com/Storage/House%20Rules/v3.6/Disposition%20v3.6.htm" frameborder="0" width="100%" height="600"></iframe></div></html>
/***
|!''Name:''|!''E''asily ''A''daptable ''S''ource ''E''ditor|
|''Description:''|this framework allows you to easily create commands that work on the current tiddler text selection in edit mode|
|''Version:''|0.1.0|
|''Date:''|13/01/2007|
|''Source:''|http://yann.perrin.googlepages.com/twkd.html#E.A.S.E|
|''Author:''|[[Yann Perrin|YannPerrin]]|
|''License:''|[[BSD open source license]]|
|''~CoreVersion:''|2.x|
|''Browser:''|Firefox 1.0.4+; Firefox 1.5; InternetExplorer 6.0|
***/
////Messages Definition
//{{{
config.messages.Ease = {
noselection:"nothing selected",
asktitle:"enter the new tiddler title",
exists:" already exists, please enter another title",
askForTagsLabel:"enter the new tiddler tags",
tiddlercreated:" tiddler created"
}
//}}}
////
//{{{
if (!window.TWkd) window.TWkd={context:{}};
if (!TWkd.Ease)
TWkd.Ease = function (text,tooltip){
this.text = text;
this.tooltip = tooltip;
this.modes = [];
this.addMode = function(modeDefinition) {this.modes.push(modeDefinition);};
this.handler = function(event,src,title) {
TWkd.context.command = this;
TWkd.context.selection=this.getSelection(title);
if (this.modes.length==1) {
this.modes[0].operation();
}
else {
var popup = Popup.create(src);
if(popup) {
for (var i=0; i<this.modes.length; i++) {
createTiddlyButton(createTiddlyElement(popup,"li"), this.modes[i].name, this.modes[i].tooltip, this.OperateFromButton, null, 'id'+i, null);
}
Popup.show(popup,false);
event.cancelBubble = true;
if (event.stopPropagation) event.stopPropagation();
return false;
}
}
};
};
TWkd.Ease.prototype.OperateFromButton = function(e){
var commandMode=this.getAttribute('Id').replace('id','');
TWkd.context.command.modes[commandMode].operation();
};
TWkd.Ease.prototype.getTiddlerEditField = function(title,field){
var tiddler = document.getElementById(story.idPrefix + title);
if(tiddler != null){
var children = tiddler.getElementsByTagName("*")
var e = null;
for (var t=0; t<children.length; t++){
var c = children[t];
if(c.tagName.toLowerCase() == "input" || c.tagName.toLowerCase() == "textarea"){
if(!e) {e = c;}
if(c.getAttribute("edit") == field){e = c;}
}
}
if(e){return e;}
}
} // closes getTiddlerEditField function definition
TWkd.Ease.prototype.getSelection = function(title,quiet) {
var tiddlerTextArea = this.getTiddlerEditField(title,"text");
var result = {};
if (document.selection != null && tiddlerTextArea.selectionStart == null) {
tiddlerTextArea.focus();
var range = document.selection.createRange();
var bookmark = range.getBookmark();
var contents = tiddlerTextArea.value;
var originalContents = contents;
var marker = "##SELECTION_MARKER_" + Math.random() + "##";
while(contents.indexOf(marker) != -1) {
marker = "##SELECTION_MARKER_" + Math.random() + "##";
}
var selection = range.text;
range.text = marker + range.text + marker;
contents = tiddlerTextArea.value;
result.start = contents.indexOf(marker);
contents = contents.replace(marker, "");
result.end = contents.indexOf(marker);
tiddlerTextArea.value = originalContents;
range.moveToBookmark(bookmark);
range.select();
}
else {
result.start=tiddlerTextArea.selectionStart;
result.end=tiddlerTextArea.selectionEnd;
}
result.content=tiddlerTextArea.value.substring(result.start,result.end);
result.source=title;
if (!result.content&&!quiet) displayMessage(config.messages.Ease.noselection);
return(result);
}//closes getSelection function definition
// replace selection or insert new content
TWkd.Ease.prototype.putInPlace=function(content,workplace) {
var tiddlerText = this.getTiddlerEditField(workplace.source,"text");
tiddlerText.value = tiddlerText.value.substring(0,workplace.start)+content+tiddlerText.value.substring(workplace.end);
}
// asking for title
TWkd.Ease.prototype.askForTitle = function(suggestion) {
if (!suggestion)
suggestion = "";
var newtitle;
while (!newtitle||