Mercurial > hg > Members > anatofuz > slideshow-s6cr
annotate s6/js/jquery.slideshow.controls.js @ 19:24c7aeff6159 default tip
fix overflow use scroll in code block
author | anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 30 Jul 2019 16:27:40 +0900 |
parents | 05d802167c0c |
children |
rev | line source |
---|---|
1
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1 /*********** |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
2 * |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
3 * control addon: |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
4 * |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
5 * adds toggle, prev slide, next slide links/buttons and jump list |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
6 * - use key-c to toggle controls (in projection mode) |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
7 * |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
8 * layout structure: |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
9 * |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
10 * .layout |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
11 * > #controls (holding navigation controls) |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
12 * > #navLinks |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
13 * > #toggle |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
14 * > #navList |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
15 * > #jumplist |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
16 */ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
17 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
18 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
19 Slideshow.ctrlInit = function() |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
20 { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
21 this.debug( 'calling ctrlInit()' ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
22 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
23 var self = this; // NOTE: jquery binds this in .each,.click, etc to element |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
24 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
25 // todo: make layout into an id (not class?) |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
26 // do we need or allow more than one element? |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
27 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
28 // if no div.layout exists, create one |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
29 if( $( '.layout' ).length == 0 ) |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
30 $( 'body' ).append( "<div class='layout'></div>"); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
31 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
32 $( '.layout' ).append( "<div id='controls'>" ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
33 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
34 var $controls = $( '#controls' ) |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
35 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
36 $controls.html( '<div id="navLinks">' |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
37 + '<a accesskey="t" id="toggle" href="#">Ø<\/a>' |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
38 + '<a accesskey="z" id="prev" href="#">«<\/a>' |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
39 + '<a accesskey="x" id="next" href="#">»<\/a>' |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
40 + '<div id="navList"><select id="jumplist" /><\/div>' |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
41 + '<\/div>' ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
42 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
43 $controls.hover( function() { self.ctrlShow(); }, function() { self.ctrlHide(); }); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
44 $('#toggle').click( function() { self.toggle(); } ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
45 $('#prev').click( function() { self.go(-1); } ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
46 $('#next').click( function() { self.go(1); } ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
47 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
48 $('#jumplist').change( function() { self.goTo( parseInt( $( '#jumplist' ).val() )); } ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
49 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
50 this.ctrlPopulateJumpList(); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
51 } |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
52 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
53 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
54 Slideshow.ctrlDebugOn = function() |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
55 { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
56 this.debug( 'calling ctrlDebugOn()' ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
57 $( '#controls' ).addClass( 'debug' ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
58 } |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
59 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
60 Slideshow.ctrlDebugOff = function() |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
61 { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
62 this.debug( 'calling ctrlDebugOff()' ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
63 $( '#controls' ).removeClass( 'debug' ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
64 } |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
65 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
66 Slideshow.ctrlKeys = function( event, key ) |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
67 { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
68 this.debug( 'calling ctrlKeys()' ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
69 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
70 switch( key.which ) { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
71 case 67: // c |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
72 this.ctrlToggle(); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
73 break; |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
74 } |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
75 } |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
76 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
77 Slideshow.ctrlChange = function() |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
78 { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
79 this.debug( 'calling ctrlChange()' ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
80 this.ctrlUpdateJumpList(); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
81 } |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
82 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
83 // ----------------------------------------------------- |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
84 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
85 Slideshow.ctrlPopulateJumpList = function() |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
86 { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
87 var self = this; // NOTE: jquery binds this in .each to element |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
88 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
89 var list = $('#jumplist').get(0); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
90 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
91 this.$slides.each( function(i) { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
92 var text = "-"; // untitled slide |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
93 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
94 // todo: use titleSelector if user set?? |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
95 // $(this).find( self.settings.titleSelector ).text(); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
96 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
97 var $h1 = $( 'h1', this ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
98 if( $h1.length > 0 ) |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
99 { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
100 text = $h1.first().text(); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
101 } |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
102 else // try h2 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
103 { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
104 var $h2 = $( 'h2', this ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
105 if( $h2.length > 0 ) |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
106 { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
107 text = $h2.first().text(); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
108 } |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
109 else // try h3 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
110 { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
111 var $h3 = $( 'h3', this ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
112 if( $h3.length > 0 ) |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
113 { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
114 text = $h3.first().text(); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
115 } |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
116 } |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
117 } |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
118 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
119 list.options[list.length] = new Option( (i+1)+' : '+ text, (i+1) ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
120 }); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
121 } |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
122 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
123 Slideshow.ctrlUpdateJumpList = function() |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
124 { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
125 $('#jumplist').get(0).selectedIndex = (this.snum-1); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
126 } |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
127 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
128 Slideshow.ctrlShow = function() |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
129 { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
130 $( '#navLinks' ).css( 'visibility', 'visible' ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
131 } |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
132 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
133 Slideshow.ctrlHide = function() |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
134 { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
135 $( '#navLinks' ).css( 'visibility', 'hidden' ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
136 } |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
137 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
138 Slideshow.ctrlToggle = function() |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
139 { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
140 // toggle control panel |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
141 var $navLinks = $( '#navLinks' ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
142 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
143 if( $navLinks.css( 'visibility' ) != 'visible' ) |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
144 $navLinks.css( 'visibility', 'visible' ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
145 else |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
146 $navLinks.css( 'visibility', 'hidden' ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
147 } |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
148 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
149 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
150 // ------------------------------------------------ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
151 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
152 Slideshow.ctrlAddEvents = function() |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
153 { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
154 $( document ).on( 'slideshow.init', $.proxy( Slideshow.ctrlInit, this )); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
155 $( document ).on( 'slideshow.debug.on', $.proxy( Slideshow.ctrlDebugOn, this )); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
156 $( document ).on( 'slideshow.debug.off', $.proxy( Slideshow.ctrlDebugOff, this )); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
157 $( document ).on( 'slideshow.keys', $.proxy( Slideshow.ctrlKeys, this )); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
158 $( document ).on( 'slideshow.change', $.proxy( Slideshow.ctrlChange, this )); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
159 } |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
160 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
161 Slideshow.ctrlAddStyles = function() { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
162 this.debug( 'add builtin controls css via inline style elements' ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
163 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
164 var styleProjection = |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
165 "<style media='screen,projection'> \n"+ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
166 " \n"+ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
167 " #controls.debug { background: #BBD; } \n"+ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
168 " \n"+ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
169 " #controls { position: fixed; \n"+ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
170 " left: 60%; bottom: 0; \n"+ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
171 " width: 40%; \n"+ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
172 " z-index: 100; \n"+ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
173 " text-align: right; \n"+ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
174 " font-weight: bold; \n"+ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
175 " font-size: 120%; \n"+ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
176 " } \n"+ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
177 " \n"+ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
178 " #controls :focus { outline: 1px dotted white;} \n"+ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
179 " \n"+ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
180 " #controls #navLinks { text-align: right; margin: 0; visibility: hidden; } \n"+ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
181 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
182 " \n"+ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
183 " #controls #navLinks a { padding: 0; margin: 0 0.5em; cursor: pointer; border: none; } \n"+ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
184 " \n"+ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
185 " #controls #navLinks :link, \n"+ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
186 " #controls #navLinks :visited {text-decoration: none; } \n"+ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
187 " \n"+ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
188 " #controls #navList #jumplist { background: white; color: black; } \n"+ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
189 "</style>"; |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
190 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
191 var styleScreen = |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
192 "<style media='screen'> \n"+ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
193 "/********* \n"+ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
194 " * make toggle button visible and reposition to upper right corner \n"+ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
195 " * note: toogle button is nested inside #controls > #navLinks > #toogle \n"+ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
196 " */ \n"+ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
197 " \n"+ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
198 " #controls, \n"+ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
199 " #navLinks, \n"+ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
200 " #toggle { display: block; \n"+ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
201 " visibility: visible; \n"+ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
202 " margin: 0; padding: 0; \n"+ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
203 " } \n"+ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
204 " \n"+ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
205 " #toggle { position: fixed; \n"+ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
206 " top: 0; right: 0; \n"+ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
207 " padding: 0.5em; \n"+ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
208 " border-left: 1px solid; \n"+ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
209 " border-bottom: 1px solid; \n"+ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
210 " background: white; \n"+ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
211 " } \n"+ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
212 "</style>"; |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
213 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
214 $( 'head' ).append( styleProjection ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
215 $( 'head' ).append( styleScreen ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
216 } |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
217 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
218 Slideshow.ctrlAddStyles(); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
219 Slideshow.ctrlAddEvents(); |