\
\
\
@@ -152,6 +165,7 @@ SWS.Effects = new function () {
var self = this;
self.objectDeactivateFadeOut = function (o) {
+ if (o.is("embed")) return;
o.animate({'opacity': '0'}, 200,
function () {
@@ -316,11 +330,18 @@ SWS.Presentation = new function () {
sessionStorage.setItem("current_slide", i);
};
+ self.showHelpAtStartup = function () {
+ var r = sessionStorage.getItem("show_help");
+ if (r == "hide") return false;
+ sessionStorage.setItem("show_help", "hide");
+ return true;
+ };
+
} else {
var _current_slide = 0;
self.getCurrentSlide = function () { return _current_slide; };
self.setCurrentSlide = function (i) { _current_slide = i; };
-
+ self.showHelpAtStartup = function () { return false; };
};
self.firstSlide = function () { return 0; };
self.lastSlide = function () { return self.getNumSlides() - 1; };
@@ -354,23 +375,29 @@ SWS.Presentation = new function () {
var cur = info.current;
var custom = info.custom;
var real_slide = to_slide.find(".sws-slide");
-
- real_slide.find("*").andSelf().each(function (i){
+ var dont_touch = real_slide.find("sws-protect").find("*").addBack();
+ real_slide.find("*").addBack().not(dont_touch).each(function (i){
var frameset = $(this).data("sws-frame-set") || {};
if (frameset[cur])
SWS.Config['sws-object-activate']($(this));
else
SWS.Config['sws-object-deactivate']($(this));
});
- var callbacks;
- if (callbacks = info.callbacks.at_frame[self.getCurrentFrame()]){
- for (var k = 0; k < callbacks.length; k++)
- callbacks[k]($(to_slide));
- };
+
var all = $(from_slide).add(to_slide);
all.find("*").addBack().promise().done(function() {
- _disable_input_events = false;
+ var callbacks;
+ //execute callbacks when all elements are finished transitioning
+ if (callbacks = info.callbacks.at_frame[self.getCurrentFrame()]){
+ for (var k = 0; k < callbacks.length; k++)
+ callbacks[k]($(to_slide));
+ };
+ all.find("*").addBack().promise().done(function() {
+ //wait for all elements to finish transitionning, in case a callback animate something
+ //an denable _input_events again.
+ _disable_input_events = false;
+ });
});
};
@@ -560,6 +587,7 @@ SWS.Presentation = new function () {
default:
return;
};
+
switch (code) {
case 36:/* Home */
self.setCurrentSlide(self.firstSlide());
@@ -591,6 +619,9 @@ SWS.Presentation = new function () {
return;
case 67: /* c */
$("#sws-control-panel-canvas").toggle();
+ return;
+ case 72: /* h */
+ $("#sws-help-panel-canvas").toggle();
default:
return;
@@ -776,12 +807,12 @@ SWS.Presentation = new function () {
var j;
var secnum = toc.length + '.';
for (j = 0; j < i; ++j)
- this_html += "
" + secnum + (j+1) + ' ' +
+ this_html += "" + secnum + (j+1) + ' ' +
sections[j].title + "";
this_html += "
" + secnum + (i+1) + ' ' +
sections[i].title + "";
for (j = i+1; j < sections.length; j++)
- this_html += "
" + secnum + (j+1) + ' '
+ this_html += "" + secnum + (j+1) + ' '
+sections[j].title + "";
this_html += "
";
$(this).after(this_html);
@@ -832,6 +863,7 @@ SWS.Presentation = new function () {
// Initialize the control panel
$("body").append($(SWS.Templates.controlPanel));
+ $("body").append($(SWS.Templates.helpPanel));
// Fill the theme switcher
$("link.sws-theme").each (function (i) {
var e = $(this);
@@ -858,7 +890,6 @@ SWS.Presentation = new function () {
nav.attr("max", SWS.Presentation.lastSlide() + 1);
$('#sws-control-panel-total-slides').text('/' + SWS.Presentation.getNumSlides());
_update_ui();
-
_slide_callbacks = null; /* avoid a leak */
var passed_theme = SWS.Utils.getParameterByName("theme");
@@ -873,12 +904,14 @@ SWS.Presentation = new function () {
if (SWS.Utils.getParameterByName("mode") == "print") {
self.printMode();
}
- else
+ else {
+ if (self.showHelpAtStartup()) $("#sws-help-panel-canvas").show();
self.refresh();
+ };
$(document).keydown(self.inputHandler);
document.body.addEventListener('touchstart',self.inputHandler, false);
document.body.addEventListener('touchend',self.inputHandler, false);
-
+
_initialized = true;
};
setTimeout(f, 100);