SOLVED: 3 line modification to SlideShowPlugin
If the problem is not solved, at least it works well enough for my
purposes. It actually was relatively easy
once I figured out how the setStylesheet/RemoceStyleSheet mechanism
works. The mechanism creates a
<style id="something">...</style> block in the document. All I did was
to modify
config.macros.slideShow.toggleSlideStyles in SlideShowPlugin to:
create a new empty stylesheet with the id SlideShowDynamicStyle
after the other stylesheets (so it takes precedence)
when switching to slide mode
remove the SlideShowDynamicStyle stylesheet when it was switching
back to normal mode
add a class to the contentWrapper that indicates which stylesheet is
in use (the normal SlideShowStlyeSheet or a custom
theme).
Then in my first tiddler I included <<tiddler SlideSubstyles##levelOne
with: goal.jpg>>. This loads/runs the following script:
if ( jQuery("body .slideShowMode").length == 0) return;
// if the body has a slideShowMode class inside it
if ( jQuery("body .InstructorSlideShowStyleSheet").length == 0)
return;
// we are running an instructor slide show so do all the bells and
whistles
if ( '$1' == "$" + "1" ) {background="none" } else {background =
'$1';};
if ( typeof lastBackground == "undefined") {
lastBackground=jQuery("body").css("background-image");
lastBackgroundRepeat=jQuery("body").css("background-repeat");
}
// set the style elements in the SlideShowDynamicStyle id'es style
element reserved for our use
jQuery("#SlideShowDynamicStyle").append(".slideShowMode .title
{display: none !important}\n"); // ditch the title
jQuery("#SlideShowDynamicStyle").append("body {background-image: " +
background + " }\n" ); // set a background image from the argument
jQuery("#SlideShowDynamicStyle").append("body {background-repeat: no-
repeat }\n"); // no repeat
jQuery("#SlideShowDynamicStyle").append("body {-moz-background-size:
100%,auto }\n"); // use firefox for display scale image 100% horiz.
this sets the background from the "with:" argument if provided. Then
it sets up some other style attributes using the stylesheet
with the id of SlideShowDynamicStyle.
In the second slide, I revert to the normal style defined in the
InstructorSlideShowStyleSheet theme by adding:
<<tiddler SlideSubstyles##levelTwo>> to the top of the slide. This
invokes:
if ( jQuery("body .slideShowMode").length == 0) return; // only run
this if in slide show mode
// just empty the style that is reserved for our use.
jQuery("#SlideShowDynamicStyle").text("");
And when I exit the slide show the SlideShowDynamicStyle style element
is removed and things return to normal.
So I guess I did kind of implement a stack by using the id'ed style
elements and push/pop them appropriately.
Paulo, you can see my three line modification to SlideShowPlugin at:
http://coursebook.tiddlyspot.com/
I updated it a few minutes ago. Would you consider incorporating these
changes in your released version
and I will update once that's done so my fork isn't running around.
Thanks.
-- rouilj
--
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.