I really don't know JS so I took some bits from other plugins and came
up with this very rough sketch of a plugin. Would anyone like to
improve and complete it or at least make some comments on this idea?
Some refinements on slide navigation would be nice too.
window.onClickToolbarPresentationMode = function(e) {
if (!e) var e = window.event;
clearMessage();
if(this.parentNode.id)
var current_style = getStyleById("mainMenu",
"display");
if((current_style != "none")) {
setStyleById("mainMenu", "display", "none");
setStyleById("sidebar", "display", "none");
// ...
// close other tiddlers
// adjust the first presentation tiddler to full width
// change to SinglePageMode if not enabled
// ...
} else {
setStyleById("mainMenu", "display", "block");
setStyleById("sidebar", "display", "block");
// ...
// adjust the current tiddler to normal width
// switch off SinglePageMode if not enabled at start
// ...
}
e.cancelBubble = true;
if (e.stopPropagation) e.stopPropagation();
return(false);
}
function setStyleById(i, p, v) {
var n = document.getElementById(i);
n.style[p] = v;
}
function getStyleById(i, p) {
var n = document.getElementById(i);
var s = eval("n.style." + p);
// try inline
if((s != "") && (s != null)) {
return s;
}
// try currentStyle
if(n.currentStyle) {
var s = eval("n.currentStyle." + p);
if((s != "") && (s != null)) {
return s;
}
}
return null;
}
config.views.wikified.toolbarPresentationMode = {text: "start",
tooltip: "Start presentation"};
window.createTiddlerToolbar_presentationmode =
window.createTiddlerToolbar;
window.createTiddlerToolbar = function(title,isEditor) {
createTiddlerToolbar_presentationmode(title,isEditor);
if(true || !isEditor) {
var theToolbar = document.getElementById("toolbar" + title);
var lingo = config.views.wikified;
createTiddlyButton(theToolbar, lingo.toolbarPresentationMode.text,
lingo.toolbarPresentationMode.tooltip, onClickToolbarPresentationMode);
insertSpacer(theToolbar);
}
}
If I could put a button somewhere to turn the mainMenu and the sidebar off/on and display the tiddler using the full contentWrapper(?) width, the show would be ready to begin in
Firefox fullscreen mode and large font sizes!
I don't have the time to make further experiments now but in a few days
I may be able to give it a go.
Thanks again, your solution looks promising and is certainly better
than my amateur attempt.
Cheers,
Paulo Soares
PS: in your plugin the macro is called singleSlideMode and not
slideShowPlugin.
The code looks very bad and many things can be done in better ways for
sure but I think it already shows what I would like to get with this.
As it seems that my idea didn't caught up among developers can you give
me some feedback?
A question: how can I push the navigation bar to the bottom of the
page? I tried position: absolute and bottom but without success.
Cheers,
Paulo Soares
PS: TW is driving me crazy. So many things can be done with it that it
seems the limit is ones imagination. Jeremy and all the developers rule!
Thank you, Clint and Daniel, for your kind suggestions. After an
afternoon crash course on Javascript and the DOM I was able to make
this prototype: http://www.math.ist.utl.pt/~psoares/slideshow.html
The code looks very bad and many things can be done in better ways for
sure but I think it already shows what I would like to get with this.
As it seems that my idea didn't caught up among developers can you give
me some feedback?
A question: how can I push the navigation bar to the bottom of the
page? I tried position: absolute and bottom but without success.
Thanks. The easiest way to restore the tiddler state when leaving slide
mode would be to reopen it from the store. I managed to close it (using
closeAll which I think is not the best way) but don't know how to open
it again. Any suggestion?
Regarding edition I see two ways to use this plugin that could be
chosen with the help of a switch:
1. as a way to read/edit a tiddler in fullscreen - in this mode the
toolbar and footer should not be hidden and the navigation bar would
contain only the slide mode button;
2. to fit my original purpose - turn a tiddler into a presentation - in
this case the edition should be disabled and the navigation improved
(maybe include a TOC?).
A better alternative could be to fork this in two similar plugins, one
for slides presentation and a much simpler version just to use
fullscreen.
> I see what you mean with the nav bar. Clint will probably have a CSS
> solution, but If you can't get it to the bottom you might wanna move it to
> the top.. something subtle and right-aligned wouldn't interfere too much
> with the slide itself.
Yes, Clint suggestion worked (I am using Firefox only so don't know
about IE and others).
> If I put some text before the first !heading it breaks. Not sure what you
> should do with such text, probably just hide it when in slide mode (the user
> could use that text to explain to the reader how to get the slide show
> underway, perhaps).
Done! Everything before the first H1 is hidden. You can check it at the
previous address I sent.
> And welcome to the TiddlyWiki developer community!
Thanks. What a poor addition to this nice community, really!
Paulo Soares
Thanks. The easiest way to restore the tiddler state when leaving slide
mode would be to reopen it from the store. I managed to close it (using
closeAll which I think is not the best way) but don't know how to open
it again. Any suggestion?
Regarding edition I see two ways to use this plugin that could be
chosen with the help of a switch:
1. as a way to read/edit a tiddler in fullscreen - in this mode the
toolbar and footer should not be hidden and the navigation bar would
contain only the slide mode button;
2. to fit my original purpose - turn a tiddler into a presentation - in
this case the edition should be disabled and the navigation improved
(maybe include a TOC?).
A better alternative could be to fork this in two similar plugins, one
for slides presentation and a much simpler version just to use
fullscreen.
ChrisJohnson
NewMediaArtisan
SPEKTRUMCreations