projects
/
hacks
/
simpleWebSlides.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ad268c9
)
Some fixes in the CSS for printout mode and correct selection of current theme in...
author
Kim Nguyễn
<kn@lri.fr>
Fri, 20 Sep 2013 08:10:26 +0000
(10:10 +0200)
committer
Kim Nguyễn
<kn@lri.fr>
Fri, 20 Sep 2013 08:10:26 +0000
(10:10 +0200)
simpleWebSlides.css
patch
|
blob
|
history
simpleWebSlides.js
patch
|
blob
|
history
diff --git
a/simpleWebSlides.css
b/simpleWebSlides.css
index
0a43418
..
3668572
100644
(file)
--- a/
simpleWebSlides.css
+++ b/
simpleWebSlides.css
@@
-1,38
+1,73
@@
/* default is 4:3 */
/* default is 4:3 */
-@page { margin: 0pt 0pt 0pt 0pt; }
-:root.sws-print body {
- width: 297mm;
-
overflow:auto
;
- padding: 0
pt 0pt 0pt 0pt
;
- margin: 0pt 0pt 0pt 0pt;
+/* Common */
+body {
+
margin: 0 0
;
+ padding: 0
0
;
+}
+.sws-active-slide {
+ display: block;
+}
+.sws-active-object {
+ visibility: visible;
+}
+.sws-canvas {
+ display: block;
}
}
-:root.sws-print .sws-canvas {
- position: relative;
+.sws-title {
+ vertical-align:middle;
+}
+.sws-inner-canvas {
+ /* white-space: nowrap;*/
+}
+.sws-content {
+ margin: 0vh;
+ padding: 0vh;
display:inline-block;
display:inline-block;
- height: 210mm;
- page-break-after: auto;
- padding: 0pt 0pt 0pt 0pt;
- margin: 0pt 0pt 0pt 0pt;
- overflow: hidden;
+ width: 100%;
+ vertical-align: middle;
+ max-height: 100%;
+ overflow:hidden;
+}
+.sws-vertical-align {
+ display:inline-block;
+ height: 33%;
+ width: 0%;
+ vertical-align:text-bottom;
}
}
-.sws-canvas :last {
- page-break-after: avoid;
+
+body > h1, body > h2, body > h3 {
+ display: none;
+}
+/* Display Mode */
+/****************************************/
+
+:root.sws-display .sws-inactive-object {
+ visibility: hidden;
+}
+
+:root.sws-display body {
+ background: black;
}
:root.sws-display .sws-canvas {
width:133.3vh;
height:100vh;
}
}
:root.sws-display .sws-canvas {
width:133.3vh;
height:100vh;
}
+:root.sws-display .sws-inner-canvas {
+ display:inline-block;
+}
+/* display mode */
+/* Aspect is 4/3, 16/9, 16/10 (default is 4/3) */
:root.sws-aspect-4-3 .sws-canvas {
width:133.3vh;
height:100vh;
:root.sws-aspect-4-3 .sws-canvas {
width:133.3vh;
height:100vh;
-
}
}
+
:root.sws-aspect-16-9 .sws-canvas {
width:177.7vh;
height:100vh;
:root.sws-aspect-16-9 .sws-canvas {
width:177.7vh;
height:100vh;
@@
-43,7
+78,6
@@
height:100vh;
}
height:100vh;
}
-
:root.sws-display .sws-canvas {
position: relative;
margin-left: auto;
:root.sws-display .sws-canvas {
position: relative;
margin-left: auto;
@@
-53,63
+87,71
@@
margin-bottom: 0vh;
}
margin-bottom: 0vh;
}
-.sws-active-slide {
- display: block;
-}
-
:root.sws-display .sws-inactive-slide {
display: none;
}
:root.sws-display .sws-inactive-slide {
display: none;
}
-:root.sws-print .sws-inactive-slide {
- opacity: 1;
+
+/* Print Mode */
+/* ****************************************** */
+
+@page { margin: 0pt 0pt 0pt 0pt; }
+
+:root.sws-print body {
+ background: white;
}
}
-.sws-active-object {
- visibility: visible;
+:root.sws-print body {
+ width: 297mm;
+ overflow:auto;
+ padding: 0pt 0pt 0pt 0pt;
+ margin: 0pt 0pt 0pt 0pt;
+
+}
+
+:root.sws-print .sws-canvas {
+ position: relative;
+ display:inline-block;
+ width: 297mm;
+ height: 210mm;
+ page-break-after: auto;
+ padding: 0pt 0pt 0pt 0pt;
+ margin: 0pt 0pt 0pt 0pt;
+ overflow: hidden;
}
}
+:root.sws-print .sws-canvas:last {
+ page-break-after: avoid;
+}
-@media screen {
- .sws-inactive-object {
- visibility: hidden;
- }
+
+
+:root.sws-print .sws-inactive-slide {
+ opacity: 1;
+ display: inline-block;
}
}
+
+p { width: 100%; }
+
.sws-header, .sws-title, .sws-inner-canvas, .sws-footer {
position: absolute;
width: 100%;
.sws-header, .sws-title, .sws-inner-canvas, .sws-footer {
position: absolute;
width: 100%;
- display:inline-block;
padding: 0vh;
margin: 0vh;
border: 0vh;
}
padding: 0vh;
margin: 0vh;
border: 0vh;
}
-.sws-title {
- vertical-align:middle;
-}
-.sws-inner-canvas {
- /* white-space: nowrap;*/
-}
-.sws-content {
- margin: 0vh;
- padding: 0vh;
- display:inline-block;
- width: 100%;
- vertical-align: middle;
- max-height: 100%;
- overflow:hidden;
-}
-.sws-vertical-align {
- display:inline-block;
- height: 33%;
- width: 0%;
- vertical-align:text-bottom;
+
+:root.sws-print .sws-inner-canvas {
+ display:block;
}
}
-body > h1, body > h2, body > h3 {
- display: none;
-}
+
+/* Control Panel */
+/*****************************************/
+
+
@font-face {
font-family: 'entypo';
@font-face {
font-family: 'entypo';
diff --git
a/simpleWebSlides.js
b/simpleWebSlides.js
index
6229a74
..
76cbeba
100644
(file)
--- a/
simpleWebSlides.js
+++ b/
simpleWebSlides.js
@@
-105,7
+105,7
@@
SWS.Templates = new function () {
self.objectActivate = function (o) {
if (!(o.hasClass("sws-active-object"))){
o.removeClass("sws-inactive-object").addClass("sws-active-object");
self.objectActivate = function (o) {
if (!(o.hasClass("sws-active-object"))){
o.removeClass("sws-inactive-object").addClass("sws-active-object");
- o.css(
{'visibility':'visible'}
);
+ o.css(
'visibility','visible'
);
return true;
};
return false;
return true;
};
return false;
@@
-153,7
+153,7
@@
SWS.Effects = new function () {
var self = this;
self.objectDeactivateFadeOut = function (o) {
var self = this;
self.objectDeactivateFadeOut = function (o) {
- o.animate({'opacity': '0
.1
'}, 200,
+ o.animate({'opacity': '0'}, 200,
function () { SWS.Templates.objectDeactivate(o)});
};
function () { SWS.Templates.objectDeactivate(o)});
};
@@
-168,11
+168,11
@@
SWS.Effects = new function () {
self.slideChangeHorizontalFlip = function (from, to){
var f = SWS.Presentation.getSlide(from);
var t = SWS.Presentation.getSlide(to);
self.slideChangeHorizontalFlip = function (from, to){
var f = SWS.Presentation.getSlide(from);
var t = SWS.Presentation.getSlide(to);
- f.animate({ 'left': '50%', 'width': '0pt', 'opacity':'0
.2
' }, 150,
+ f.animate({ 'left': '50%', 'width': '0pt', 'opacity':'0' }, 150,
function () {
SWS.Templates.slideDeactivate(f);
f.css({'left':'0%', 'width': '100%'});
function () {
SWS.Templates.slideDeactivate(f);
f.css({'left':'0%', 'width': '100%'});
- t.css({ 'left': '50%', 'width': '0pt','opacity':'0
.3
' });
+ t.css({ 'left': '50%', 'width': '0pt','opacity':'0' });
SWS.Templates.slideActivate(t);
t.animate({'left':'0%', 'width': '100%','opacity':'1'});
});
SWS.Templates.slideActivate(t);
t.animate({'left':'0%', 'width': '100%','opacity':'1'});
});
@@
-180,10
+180,10
@@
SWS.Effects = new function () {
self.slideChangeFadeOutIn = function (from, to) {
var f = SWS.Presentation.getSlide(from);
var t = SWS.Presentation.getSlide(to);
self.slideChangeFadeOutIn = function (from, to) {
var f = SWS.Presentation.getSlide(from);
var t = SWS.Presentation.getSlide(to);
- f.animate({ 'opacity': '0
.4
'}, 150,
+ f.animate({ 'opacity': '0'}, 150,
function () { SWS.Templates.slideDeactivate(f);
SWS.Templates.slideActivate(t);
function () { SWS.Templates.slideDeactivate(f);
SWS.Templates.slideActivate(t);
- t.css('opacity', '0
.5
');
+ t.css('opacity', '0');
t.animate({ 'opacity': '1'}, 150);
});
};
t.animate({ 'opacity': '1'}, 150);
});
};
@@
-195,14
+195,14
@@
SWS.Effects = new function () {
t.css('opacity', '1');
SWS.Templates.slideActivate(t);
f.animate({ 'left': '-100%' }, 250, function () { SWS.Templates.slideDeactivate(f);
t.css('opacity', '1');
SWS.Templates.slideActivate(t);
f.animate({ 'left': '-100%' }, 250, function () { SWS.Templates.slideDeactivate(f);
- f.css('opacity', '0
.6
');
+ f.css('opacity', '0');
t.animate({ 'left': '0%' }, 250);
});
} else {
t.css('left', '-100%');
SWS.Templates.slideActivate(t);
f.animate({ 'left': '100%' }, 250, function () { SWS.Templates.slideDeactivate(f);
t.animate({ 'left': '0%' }, 250);
});
} else {
t.css('left', '-100%');
SWS.Templates.slideActivate(t);
f.animate({ 'left': '100%' }, 250, function () { SWS.Templates.slideDeactivate(f);
- f.css('opacity', '0
.7
');
+ f.css('opacity', '0');
});
t.css('opacity', '1');
t.animate({ 'left': '0%' }, 250);
});
t.css('opacity', '1');
t.animate({ 'left': '0%' }, 250);
@@
-469,13
+469,14
@@
SWS.Presentation = new function () {
var loop;
loop = function () {
if (steps >= 0) {
var loop;
loop = function () {
if (steps >= 0) {
+ //Crazy workaround for chromium
+ ($("link.sws-theme[rel='stylesheet']")[0]).disabled = false;
$(".sws-canvas").find("*").addBack().promise().done(function() {
var percent = ((total_steps - steps) / total_steps) * 100;
$("#sws-percent-progress").text(Math.round(percent));
$(".sws-canvas").find("*").addBack().promise().done(function() {
var percent = ((total_steps - steps) / total_steps) * 100;
$("#sws-percent-progress").text(Math.round(percent));
- console.log ("Step: " + steps);
SWS.Config['sws-slide-change'] = SWS.Templates.slideChange;
self.refresh();
SWS.Config['sws-slide-change'] = SWS.Templates.slideChange;
self.refresh();
- $($(".sws-canvas")[self.getCurrentSlide()]).css(
{ 'opacity': 1 }
);
+ $($(".sws-canvas")[self.getCurrentSlide()]).css(
'opacity', 1
);
self.next();
steps--;
loop();
self.next();
steps--;
loop();
@@
-483,7
+484,6
@@
SWS.Presentation = new function () {
} else {
$("#sws-percent-progress").text(100);
progress.remove();
} else {
$("#sws-percent-progress").text(100);
progress.remove();
- window.print();
}
};
loop();
}
};
loop();
@@
-601,11
+601,14
@@
SWS.Presentation = new function () {
};
/* Forces redrawing the page without reloading */
};
/* Forces redrawing the page without reloading */
- self.redraw = function () {
- $("body").hide();
- $("body").show();
+ self.redraw = function (f) {
+ if (SWS.Utils.isUndefined(f))
+ $("body").hide().show(400, function () {
+ $("body").css("display","block");
+ if (!SWS.Utils.isUndefined(f))
+ f();
+ });
};
};
-
self.changeAspect = function() {
$("html").removeClass("sws-aspect-4-3")
.removeClass("sws-aspect-16-9")
self.changeAspect = function() {
$("html").removeClass("sws-aspect-4-3")
.removeClass("sws-aspect-16-9")
@@
-614,6
+617,14
@@
SWS.Presentation = new function () {
self.redraw();
};
self.redraw();
};
+ self.getCurrentTheme = function () {
+ var l = $("link.sws-theme[rel='stylesheet']")[0];
+ console.log(l);
+ if (l) {
+ return l.title;
+ } else
+ return ""
+ };
self.changeTheme = function (name) {
var theme_name;
self.changeTheme = function (name) {
var theme_name;
@@
-621,26
+632,29
@@
SWS.Presentation = new function () {
theme_name = $("#sws-theme-select").val()
else
theme_name = name;
theme_name = $("#sws-theme-select").val()
else
theme_name = name;
+// if (self.getCurrentTheme() == theme_name) {
+ // return;
+ // };
_current_theme = theme_name;
$("link.sws-theme").each (function (i) {
_current_theme = theme_name;
$("link.sws-theme").each (function (i) {
- var e =
$(this)
;
- var title = e.
attr("title")
;
+ var e =
this
;
+ var title = e.
title
;
if (title == theme_name) {
if (title == theme_name) {
- e[0].rel = "stylesheet";
- e[0].disabled = false;
- e[0].media="all";
-
+ e.rel = "stylesheet";
+ e.disabled = false;
+ e.media="all";
} else {
} else {
- e
[0]
.rel = "alternate stylesheet";
- e
[0]
.disabled = true;
- e
[0]
.media="all";
+ e.rel = "alternate stylesheet";
+ e.disabled = true;
+ e.media="all";
};
});
self.redraw();
};
});
self.redraw();
+
};
self.openPrint = function () {
};
self.openPrint = function () {
- window.open
("?mode=print&theme=" + _current_theme
);
+ window.open
("?mode=print&theme=" + self.getCurrentTheme()
);
}
var _fullscreen_icon_on = "";
var _fullscreen_icon_off = "";
}
var _fullscreen_icon_on = "";
var _fullscreen_icon_off = "";
@@
-764,14
+778,12
@@
SWS.Presentation = new function () {
self.changeTheme(passed_theme);
if (SWS.Utils.getParameterByName("mode") == "print") {
self.changeTheme(passed_theme);
if (SWS.Utils.getParameterByName("mode") == "print") {
-
self.printMode();
+ self.printMode();
}
}
- else
+ else
self.refresh();
self.refresh();
-
_initialized = true;
_initialized = true;
-
};
};
};
};