Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

changing slides will now set a slide anchor in the window URL. users …

…can restore their last-viewed slide using the back button when browsing off-slide links
  • Loading branch information...
commit 0bf037c088c274b32ee7eec3149879bca31584b0 1 parent d3a0c6b
@danski authored
View
1  index.html
@@ -9,7 +9,6 @@
<!-- Common dependencies -->
<script type="text/javascript" src="/public/common/js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="/public/common/js/jquery-ui-1.8.2.custom.min.js"></script>
- <script type="text/javascript" src="/public/common/js/jqtouch.min.js"></script>
<script type="text/javascript" src="/public/common/js/socket.io.js"></script>
<!-- Squeenote core -->
<script type="text/javascript" src="/public/common/js/squeenote.device.js"></script>
View
22 public/common/js/squeenote.presentation.js
@@ -136,9 +136,19 @@ squeenote.Presentation.prototype = {
// Trigger the ready event for any theme javascript to pick up on.
$(document).trigger("presentationLoaded.squeenote", this);
// Default to following the presenter.
+
+
+ // Check for a #slide-I anchor and default to zero otherwise.
+ var loc = window.location.href.toString();
+ var bootSlide = 0;
+
this.startFollowingPresenter();
- // Reset the slide count. Anything bound to the presentationLoaded event should now be listening for the change.
- this.showSlide(0);
+
+ if(loc.indexOf("#slide-") > -1) {
+ this.showSlide(parseInt(loc.split("#slide-")[1]));
+ } else {
+ this.showSlide(0);
+ }
},
prevSlide: function(index) {
@@ -160,6 +170,14 @@ squeenote.Presentation.prototype = {
if(client_event) this.stopFollowingPresenter();
this.jq_presentation.trigger("presentationClientSlideChanged.squeenote", this);
var i = 0;
+
+ // Append the slide index to the location
+ var loc = window.location.href.toString();
+ var url = loc.split("#")[0];
+ var anchor = loc.split("#")[1];
+ window.location = url+"#slide-"+index;
+
+ // Do the slide iteration
$(this.jq_slide_selector).each(function() {
li = $(this);
li_state = li.attr("data-slide-state");
View
2  public/squeenote-default/theme.css
@@ -30,7 +30,7 @@ body > ol {
body > ol > li {
position: absolute;
width: 100%;
- height: 550px;
+ height: 600px;
margin: 0;
padding: 0;
background: #FFF;
Please sign in to comment.
Something went wrong with that request. Please try again.