0
|
1 var BASE_URL_PREFIX = './';
|
|
2
|
|
3 function addScript( name )
|
|
4 {
|
|
5 var el = document.createElement( 'script' );
|
|
6 el.type = 'text/javascript';
|
|
7 el.src = BASE_URL_PREFIX + name;
|
|
8
|
|
9 if(!document.head) // fix for Firefox <4.0
|
|
10 document.head = document.getElementsByTagName('head')[0];
|
|
11
|
|
12 document.head.appendChild( el );
|
|
13 }
|
|
14
|
|
15 function addStyle( name, media )
|
|
16 {
|
|
17 var el = document.createElement( 'link' );
|
|
18 el.rel = 'stylesheet';
|
|
19 el.type = 'text/css';
|
|
20 el.href = BASE_URL_PREFIX + name;
|
|
21 el.media = media;
|
|
22
|
|
23 if(!document.head) // fix for Firefox <4.0
|
|
24 document.head = document.getElementsByTagName('head')[0];
|
|
25
|
|
26 document.head.appendChild( el );
|
|
27 }
|
|
28
|
|
29 function addStyleLess( name, media )
|
|
30 {
|
|
31 var el = document.createElement( 'link' );
|
|
32 el.rel = 'stylesheet/less';
|
|
33 el.type = 'text/css';
|
|
34 el.href = BASE_URL_PREFIX + name;
|
|
35 el.media = media;
|
|
36
|
|
37 if(!document.head) // fix for Firefox <4.0
|
|
38 document.head = document.getElementsByTagName('head')[0];
|
|
39
|
|
40 document.head.appendChild( el );
|
|
41 }
|
|
42
|
|
43
|
|
44 function letsGo()
|
|
45 {
|
|
46 var useLess = true;
|
|
47
|
|
48 /*********
|
|
49 * add style sheet links
|
|
50 */
|
|
51
|
|
52 if( useLess )
|
|
53 {
|
|
54 addStyleLess( 'themes/blank5/projection.css.less', 'screen,projection' );
|
|
55 addStyleLess( 'themes/blank5/screen.css.less', 'screen' );
|
|
56 addStyleLess( 'themes/blank5/print.css.less', 'print' );
|
|
57 }
|
|
58 else
|
|
59 {
|
|
60 addStyle( 'themes/blank5/o/projection.css', 'screen,projection' );
|
|
61 addStyle( 'themes/blank5/o/screen.css', 'screen' );
|
|
62 addStyle( 'themes/blank5/o/print.css', 'print' );
|
|
63 }
|
|
64
|
|
65 /********
|
|
66 * add js libs (less, jquery)
|
|
67 */
|
|
68
|
|
69 if( useLess )
|
|
70 addScript( 'js/less-1.1.4.min.js' );
|
|
71
|
|
72 addScript( 'js/jquery-1.7.min.js' );
|
|
73
|
|
74 /********
|
|
75 * add S6 js code
|
|
76 */
|
|
77
|
|
78 addScript( 'js/jquery.slideshow.js' );
|
|
79 addScript( 'js/jquery.slideshow.counter.js' );
|
|
80 addScript( 'js/jquery.slideshow.controls.js' );
|
|
81 addScript( 'js/jquery.slideshow.footer.js' );
|
|
82 addScript( 'js/jquery.slideshow.autoplay.js' );
|
|
83 addScript( 'js/jquery.slideshow.ready.js' );
|
|
84
|
|
85 // todo - check why we can't access Slideshow object here
|
|
86 // Slideshow.debug( 'letsGo says hello' );
|
|
87 // Slideshow.init();
|
|
88 }
|
|
89
|
|
90 // letsGo();
|
|
91 document.addEventListener('DOMContentLoaded', letsGo, false); |