I noticed in ticket #15 you're planning to allow a smaller core by
extracting out non-essentials such as animation.
There are four places where "anim" is assumed to be non-null:
1) in config.macros.slider.onClickSlider
if(config.options.chkAnimate)
should be
if(anim && config.options.chkAnimate)
2) in Story.prototype.displayTiddler
if(config.options.chkAnimate && (animate == undefined || animate ==
true))
should be
if(anim && config.options.chkAnimate && (animate == undefined ||
animate == true))
3) in Story.prototype.closeTiddler
if(config.options.chkAnimate && animate)
should be
if(anim && config.options.chkAnimate && animate)
4) in Popup.show
if(config.options.chkAnimate)
should be
if(anim && config.options.chkAnimate)
Making these changes will mean that any plug-ins that set
config.options.chkAnimate will not be broken by the removal of
animation (assuming var anim = new Animator(); is replaced by var anim
= null; at startup).
Martin
Story.prototype.displayTiddler = function(srcElement,title,template,animate,slowly)
{
...
if(srcElement)
{
if(config.options.chkAnimate && (animate == undefined || animate == true))
anim.startAnimating(new Cascade(title,srcElement,theTiddler,slowly),new Scroller(theTiddler,slowly));
else
window.scrollTo(0,ensureVisible(theTiddler));
}
}
function StandardVisEffect() {
this.open = function(text,startElement,targetElement,slowly, animate) {
if(config.options.chkAnimate && (animate === undefined || animate == true))
anim.startAnimating(new Cascade(text,srcElement,targetElement,slowly),new Scroller(targetElement,slowly));
else
window.scrollTo(0,ensureVisible(targetElement));
}
};
...
}
...
var visEffect = new StandardVisEffect();
...
Story.prototype.displayTiddler = function(srcElement,title,template,animate,slowly)
{
...
if(srcElement)
visEffect.open(title, srcElement, theTiddler, slowly, animate);
}
function NoVisEffect() {(BTW: the "anim" variable will not exist in that configuration)
this.open = function(text,startElement,targetElement,slowly, animate) {
window.scrollTo(0,ensureVisible(targetElement));
};
...
}
merge(config,{
animFast: 0.12, // Speed for animations (lower == slower)
animSlow: 0.01, // Speed for EasterEgg animations
cascadeFast: 20, // Speed for cascade animations (higher == slower)
cascadeSlow: 60, // Speed for EasterEgg cascade animations
cascadeDepth: 5 // Depth of cascade animation
});
merge(config.options ,{
chkAnimate: true,
});
Cheers
Jeremy.
--
Jeremy Ruston
mailto:jer...@osmosoft.com
http://www.tiddlywiki.com
Martin