X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=simpleWebSlides.js;h=59c5a3f7bf5afefc0e5fd7a683caa458630d0568;hb=HEAD;hp=798d2acbc41ff73015f3b2214c501046c44357f4;hpb=cd25deac22fee9a675c575eb9b7e7804e2cf67f6;p=hacks%2FsimpleWebSlides.git
diff --git a/simpleWebSlides.js b/simpleWebSlides.js
index 798d2ac..59c5a3f 100644
--- a/simpleWebSlides.js
+++ b/simpleWebSlides.js
@@ -163,7 +163,7 @@ SWS.Config = new SWS.ConfigBuilder ();
SWS.Effects = new function () {
var self = this;
-
+
self.objectDeactivateFadeOut = function (o) {
if (o.is("embed")) return;
o.animate({'opacity': '0'}, 200,
@@ -310,7 +310,6 @@ SWS.Presentation = new function () {
var slides = $(".sws-slide");
var h1s = $("body").children("h1");
var slide_num = slides.add(h1s).length - 1;
-
SWS.Utils.push2(_slide_callbacks, slide_num,{ 'fn': f, 'frame': i });
};
@@ -395,7 +394,7 @@ SWS.Presentation = new function () {
};
all.find("*").addBack().promise().done(function() {
//wait for all elements to finish transitionning, in case a callback animate something
- //an denable _input_events again.
+ //and enable _input_events again.
_disable_input_events = false;
});
});
@@ -487,6 +486,11 @@ SWS.Presentation = new function () {
self.printMode = function () {
_print_mode = true;
+
+ var old_fx_status = $.fx.off;
+ //disable animation while printing.
+
+ $.fx.off = true;
var progress = $("
Rendering presentation: %
");
$("body").append(progress);
@@ -513,7 +517,8 @@ SWS.Presentation = new function () {
$("#sws-percent-progress").text(100);
progress.remove();
window.status = 'Ready';
- window.print();
+ $.fx.off = old_fx_status;
+
}
};
loop();
@@ -722,13 +727,12 @@ SWS.Presentation = new function () {
});
};
self.changeAspect = function() {
+ if (_print_mode) return;
var newClass = $("#sws-aspect-select").val();
var args = newClass.split("-");
var targetRatio = (args[2] - 0) / (args[3] - 0);
var realRatio = window.innerWidth / window.innerHeight;
var byClass = (targetRatio > realRatio ) ? "sws-by-height" : "sws-by-width";
- console.log(byClass);
-
if ($("html").hasClass(newClass)
&& $("html").hasClass(byClass))
return;
@@ -857,18 +861,28 @@ SWS.Presentation = new function () {
if (!($(this).hasClass("sws-option-noheader"))) {
canvas.append($(''));
};
+
if (!$(this).hasClass("sws-cover")) {
var title = $($(this).find("h1")[0]);
var title_div = $('');
title_div.append(title);
canvas.append(title_div);
- }
+ };
+
var inner = $('');
var content = $('');
$(this).find('script[type="text/javascript"]').remove();
content.append($(this));
inner.append(content);
canvas.append(inner);
+ var that = this;
+ [ "sws-cover", "sws-toc" ].forEach(
+ function(v) {
+ if ($(that).hasClass(v)) {
+ inner.addClass(v);
+ $(that).removeClass(v);
+ }
+ });
if (!($(this).hasClass("sws-option-nofooter"))) {
canvas.append($(''));