-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathslides.js
88 lines (64 loc) · 1.99 KB
/
slides.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
var BASE_URL_PREFIX = '../s6/';
function debug( msg )
{
if( console && console.log )
{
console.log( "[debug:slides.js]" + msg );
}
}
function addScript( name )
{
// note:
// Scripts that are dynamically created and added to the document
// are **async** by default
debug( "addScript " + name );
var el = document.createElement( 'script' );
el.type = 'text/javascript';
el.src = BASE_URL_PREFIX + name;
el.async = false; // note: new attrib added in HTML5
// note: no longer care about old firefox - why? why not?
// if(!document.head) // fix for Firefox <4.0
// document.head = document.getElementsByTagName('head')[0];
document.head.appendChild( el );
}
function addStyle( name, media )
{
debug( "addStyle " + name + ", " + media );
var el = document.createElement( 'link' );
el.rel = 'stylesheet';
el.type = 'text/css';
el.href = BASE_URL_PREFIX + name;
el.media = media;
// if(!document.head) // fix for Firefox <4.0
// document.head = document.getElementsByTagName('head')[0];
document.head.appendChild( el );
}
function letsGo()
{
debug( "letsGo" );
/*********
* add style sheet links
*/
addStyle( 'css/themes/blank5.css', 'screen,projection' );
addStyle( 'css/screen.css', 'screen' );
addStyle( 'css/print.css', 'print' );
/********
* add js libs (jquery, etc.)
*/
addScript( 'js/jquery-2.1.1.min.js' );
/********
* add S6 js code
*/
addScript( 'js/jquery.slideshow.js' );
addScript( 'js/jquery.slideshow.counter.js' );
addScript( 'js/jquery.slideshow.controls.js' );
addScript( 'js/jquery.slideshow.footer.js' );
addScript( 'js/jquery.slideshow.autoplay.js' );
addScript( 'js/jquery.slideshow.ready.js' );
// todo - check why we can't access Slideshow object here
// Slideshow.debug( 'letsGo says hello' );
// Slideshow.init();
}
letsGo();
// use document ready why? why not?
// document.addEventListener('DOMContentLoaded', letsGo, false);