Hi Secret-HQ I can't help you with the coding - however I can't wait to see it in action - do you have a working example to show? I'm very interested in the functionality - and have made my own attampts involving all kinds of custom templates, tables, http://www.tiddlytools.com/#ColumnCalculatorPlugin and a script to approximate results i.e. [[character]] <script> var g=store.getValue("$1","points"); return g<1?'-3' : g<25?'00' : g<37?'2' : g<48?'4' : g<59?'7' : g<66?'10' : g<71?'12' : 'ingen points'; </script> In some tiddler I would write: <<tiddler character with: {{tiddler.title}}>>
TiddlyCodeWizards - Please help this guy out!! Cheers Måns Mårtensson On 28 Sep., 13:20, Secret-HQ <[email protected]> wrote: > Hi, all -- > > I've got a tiddler that I use to count characters. Nothing fancy -- > it's just an HTML form wrapped with some script that counts and > displays the chacters pasted into the textarea. > > In getting ready to share it with someone else, I decided to move the > scripts to a plugin and make the form available with a macro call to > <<characterCounter>>. (The idea is that anyone can install the plugin > and then paste in <<characterCounter>> wherever they want to see it, > rather than having to look at my clunky code when they click "edit" in > a tiddler.) > > I think I'm on the right path, but this is the first time I've ever > used createTiddlyElement (or done anything DOM-related in > TiddlyWiki). The plugin works fine (if I paste my form into a tiddler > and call the functions defined in it), but I keep getting macro errors > when I place <<characterCounter>> into a tiddler. > > Can anyone show me what I'm doing wrong? > > Here's the macro portion of the plugin, which appears below all the JS > function defintions: > > /*** > !Macro > ***/ > //{{{ > config.macros.characterCounter = {} > config.macros.characterCounter.handler = > function(place,macroName,params,wikifier,paramString,tiddler) { > var rowsHeight = "6"; > var colsWidth = "50"; > var characterCounterFormOutput = "<html>\n <form method=\"POST\" > action=\"#\">\n <table border=\"0\" cellspacing=\"0\" cellpadding= > \"0\">\n <tr>\n <td colspan=\"2\" align=\"right\"><input > type=\"reset\" onClick=\"simpleCount(\'fieldToCount\', > \'characterCountDisplay\',\'{CHARACTERCOUNT}\');\"></td>\n </tr> > \n <tr>\n <td colspan=\"2\"><textarea id=\"fieldToCount\" > name=\"characterCounterInputField\" rows=\"" + rowsHeight + "\" cols= > \"" + colsWidth + "\" wrap=\"virtual\" onKeyUp= > \"simpleCount(\'fieldToCount\',\'characterCountDisplay\', > \'{CHARACTERCOUNT}\');\"></textarea></td>\n </tr>\n <tr> > \n <td align=\"right\"><span id=\"characterCountDisplay\">0</ > span></td><td> characters total.</td>\n </tr>\n </table>\n </ > form>\n</html>"; > > createTiddlyElement(place,div,null,CharacterCounter,characterCounterFormOut > put);} > > //}}} -- You received this message because you are subscribed to the Google Groups "TiddlyWiki" 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/tiddlywiki?hl=en.

