And while I think I could actually figure this plugin out, I would bet
that at least one of you has three-quarters of the code written in
your head by the time you got to this point in the message, and most
likely prettier then what I would come up with.
Ken Girard
0. create a Google Analytics account
1. modify the MarkuPostHead to include google analytics external code
<!-- Fonction Google analytics {{{ -->
<script src="http://www.google-analytics.com/urchin.js" type="text/
javascript"></script>
<script type="text/javascript">
_uacct = "YOUR ANALYTICS CODE";
function comptageGoogle(titre) {
urchinTracker(titre);
}
</script>
2. create a tiddler tagged with systemConfig to hack refreshTiddlers
Story.prototype.refreshTiddler = function(title,template,force)
{
var theTiddler = document.getElementById(this.idPrefix + title);
if(theTiddler) {
if(theTiddler.getAttribute("dirty") == "true" && !force)
return theTiddler;
template = this.chooseTemplateForTiddler(title,template);
var currTemplate = theTiddler.getAttribute("template");
if((template != currTemplate) || force)
{
var tiddler = store.getTiddler(title);
if(!tiddler)
{
tiddler = new Tiddler();
if(store.isShadowTiddler(title))
tiddler.set(title,store.getTiddlerText(title),config.views.wikified.shadowModifier,version.date,
[],version.date);
else
{
var text = template=="EditTemplate"
? config.views.editor.defaultText.format([title])
: config.views.wikified.defaultText.format([title]);
tiddler.set(title,text,config.views.wikified.defaultModifier,version.date,
[],version.date);
}
}
theTiddler.setAttribute("tags",tiddler.tags.join(" "));
theTiddler.setAttribute("tiddler",title);
/*****************************************************************/
// modif AirCarnet
// titles modifications (as they are sent to urchin)
document.title=title;
var lurlsac="#";
if(title.split(" ")[1]) lurlsac+="[["+title+"]] ";
else lurlsac+=title;
if(window.location.hash!=lurlsac) window.location.hash=lurlsac;
// google count
comptageGoogle(title);
/*******************************************************************/
theTiddler.setAttribute("template",template);
var me = this;
theTiddler.onmouseover = this.onTiddlerMouseOver;
theTiddler.onmouseout = this.onTiddlerMouseOut;
theTiddler.ondblclick = this.onTiddlerDblClick;
theTiddler[window.event?"onkeydown":"onkeypress"] =
this.onTiddlerKeyPress;
var html = this.getTemplateForTiddler(title,template,tiddler);
theTiddler.innerHTML = html;
applyHtmlMacros(theTiddler,tiddler);
if(store.getTaggedTiddlers(title).length > 0)
addClass(theTiddler,"isTag");
else
removeClass(theTiddler,"isTag");
if(!store.tiddlerExists(title))
{
if(store.isShadowTiddler(title))
addClass(theTiddler,"shadow");
else
addClass(theTiddler,"missing");
}
else
{
removeClass(theTiddler,"shadow");
removeClass(theTiddler,"missing");
}
}
}
return theTiddler;
}
4. That's all. Hope this will work. It works for me. If not, visit
this for original coding (comments are in french sorry). Not through
dial up connection! the file is very big now, since load-on-demand is
not implemented ;-)
- http://sylvain.comte.online.fr/AirCarnet/[[MarkupPostHead]]
- http://sylvain.comte.online.fr/AirCarnet/[[ccTiddlySacPersonalisation]]
Sylvain
Ken Girard
Ken Girard
On Apr 25, 9:54 am, SylvainComte <sylvain.co...@gmail.com> wrote: