This certainly helped, I missed > , < after &qoute; when I copied a
line.
The value is stored in a cookie ???, so when I change computer or
erase cookies the value is gone.
Is it possible to save the config.options.var as a real var in the tw
file, so it can be used next start up?
If not, how could I keep the value, maybe just replacing it in the
code on the line were undefined is tested ?
I am working on my autoNumber plugin and planned to remove dependency
from the Datatiddler plugin.
Code:
//{{{
config.macros.autoNumber={};
config.macros.autoNumber.handler= function
(place,macroName,params,wikifier,paramString,tiddler)
{
var label = params[0]||"New Numbered Tiddler";
var tooltip = params[1]||"You are going to create a new
numbered tiddler";
createTiddlyButton(place,label,tooltip,this.onclick);
}
config.macros.autoNumber.onclick= function()
{ if (config.options.txtautoNumber==undefined)
{ config.options.txtautoNumber = 0; }
var opt="txtautoNumber";
var lead_title = 'Lead '; // Text leading x
digits number
var trail_title = ' Trail'; // Text
trailing x digits number
var lead_zero = true; // switch leading zero's
on or off, true is on and false = off
var newTags = ' autonumber tag'; // put your tags here
seperated with a space
var digits = 3 ; // is the
number of digits
var newBody = 'Default text in tiddler body created by
autoNumber.'; // default text that is placed in the tiddler
var leading_zero = '00000000'.substr(0, digits - 1);
var newNummer = config.options[opt];
var newTitle = ( leading_zero + newNummer ).substr(( leading_zero +
newNummer ).length - digits, digits );
if ( lead_zero != true ) {newTitle = newNummer.toString
();} // no leading zero's
newTitle = lead_title + newTitle + trail_title; //
creating the new title
config.options[opt] = parseFloat(newNummer) + 1 ;
config.macros.option.propagateOption
( "txtautoNumber","value",config.options[opt],"input" );
store.saveTiddler( newTitle, newTitle, newBody,
config.options.txtUserName, new Date(), newTags );
displayMessage( 'New Numbered tiddler created' );
story.displayTiddler( 'top',newTitle );
saveChanges();
}
//}}}
Have a nice day, Okido
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TiddlyWikiDev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/tiddlywikidev?hl=en
-~----------~----~----~----~------~----~------~--~---