If you have created a really great template and want to share it with others you can package it as a template and post it on your site (or send it to us to upload). A link in the template to your site giving you credit for creating the template couldn't hurt ;-)
The default template looks like this:
$.forum.formatComment = function(comment){
var Text = "<p>";
Text += comment.replace(/[\n]{2}?/g, "</p><p>");
Text = Text.replace(/[\n]{1}?/g, "<br />");
Text += "</p>";
return Text;
};
$.forum.localDate = function(dte){
var local = new Date(dte);
return local;
}
$.forum.insertTemplate(
{
'stylesheet' : 'http://jsrepeater.devprog.com/forumtemplates/basic/basic.css',
'template' :
'<!-- CONTROLS --><button class=\'tmf_threadView tmf_listThreads\'>List Posts</button> ...'
});
The first two functions are custom functions used specifically in this template. The plugin declares a namespace $.forum, any custom function can be attached to that object.
The third function $.forum.insertTemplate is the function that puts the template on the page. The object passed to that function declares the following:
stylesheet - The fully qualified URL of the stylesheet to be used for this template
template - The HTML of the template as a javascript string, to create this simply take your HTML, escape apostrophes and remove linebreaks.