Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fix incremental slides on presenter view #170

Merged
merged 2 commits into from

2 participants

@durin42

Incremental slides were behaving oddly on the presenter view. I traced it down to these global variables not updating properly in the presenter view window. This isn't really a proper fix, but it works so I'm probably not going to come back to it for a while.

This depends on my other pull request since it modifies some code that introduced.

durin42 added some commits
@durin42 durin42 presenter view: give the spawned slides window the ability to move ou…
…r location

This means that you can open the presenter view and have it spawn a
slides window, but then make the slides window fullscreen instead of
the presenter view (which can be a background window on another
display). I didn't test it very much, but it seems to work well enough.

This uses the horrible hack of setting an attribute on the slide
window because otherwise the reference back to the parent window was
sometimes (but not always) getting clobbered when showoff.js loaded in
the child window.
d8c7afd
@durin42 durin42 presenter view: fix advancing of incremental bullet slides
There are some global state variables that aren't correctly getting
initialized in the presenter view. Since I'm on a tight time budget at
the moment, just hackily forward the state from the presentation view
to the presenter view, which fixes the defect.
af715db
@goncalossilva goncalossilva merged commit b56b5ac into schacon:master
@goncalossilva
Collaborator

I've merged your changes but tweaked your comments a bit. The code you wrote makes perfect sense, since both windows are communicating through the window "object".

Thanks!

@norbu09 norbu09 referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 2, 2012
  1. @durin42

    presenter view: give the spawned slides window the ability to move ou…

    durin42 authored
    …r location
    
    This means that you can open the presenter view and have it spawn a
    slides window, but then make the slides window fullscreen instead of
    the presenter view (which can be a background window on another
    display). I didn't test it very much, but it seems to work well enough.
    
    This uses the horrible hack of setting an attribute on the slide
    window because otherwise the reference back to the parent window was
    sometimes (but not always) getting clobbered when showoff.js loaded in
    the child window.
  2. @durin42

    presenter view: fix advancing of incremental bullet slides

    durin42 authored
    There are some global state variables that aren't correctly getting
    initialized in the presenter view. Since I'm on a tight time budget at
    the moment, just hackily forward the state from the presentation view
    to the presenter view, which fixes the defect.
This page is out of date. Refresh to see the latest.
Showing with 28 additions and 1 deletion.
  1. +9 −0 public/js/presenter.js
  2. +19 −1 public/js/showoff.js
View
9 public/js/presenter.js
@@ -3,6 +3,10 @@ var w = null;
$(function(){
w = window.open('/' + window.location.search);
+ // Give the slide window a handle to the presenter view window.
+ // This will let either window be made fullscreen and
+ // still process slide advance/rewinds correctly.
+ w.presenterView = window;
// side menu accordian crap
$("#preso").bind("showoff:loaded", function (event) {
$(".menu > ul ul").hide()
@@ -31,6 +35,11 @@ function presPrevStep()
function presNextStep()
{
+ // TODO: figure out why these two lines are
+ // necessary. Something in the presenter view isn't correctly
+ // setting these variabls related to incremental slide display.
+ incrCurr = w.incrCurr
+ incrSteps = w.incrSteps
nextStep()
w.nextStep()
postSlide()
View
20 public/js/showoff.js
@@ -215,7 +215,25 @@ function showSlide(back_step) {
var currentContent = $(currentSlide).find(".content")
currentContent.trigger("showoff:show");
- return getCurrentNotes()
+ var ret = getCurrentNotes()
+ // If we have a presenterView attribute, that means this window was
+ // opened by a presenter view, and we should poke it to make
+ // it be on the same slide as us and show the correct notes.
+ //
+ // TODO: we do this in such a hacky way to avoid ever
+ // assigning to the presenterView variable here. If we do
+ // that, we can clobber the value sent in by the parent
+ // presentation view and break the feature. Is there a better
+ // way to do this?
+ if ('presenterView' in window) {
+ var pv = window.presenterView;
+ pv.slidenum = slidenum;
+ pv.incrCurr = incrCurr
+ pv.incrSteps = incrSteps
+ pv.showSlide(true);
+ pv.postSlide();
+ }
+ return ret;
}
function getSlideProgress()
Something went wrong with that request. Please try again.