Mercurial > hg > Members > atton > slideshow-s6cr
annotate s6/js/jquery.slideshow.js @ 10:e5301b055cea
Delete letter-spacing setting
author | Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 04 Aug 2016 13:27:27 +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 var Slideshow = { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
3 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
4 settings: { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
5 debug: true |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
6 }, |
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 isProjection: false, // are we in projection (slideshow) mode (in contrast to screen (outline) mode)? |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
9 snum: 1, // current slide # (non-zero based index e.g. starting with 1) |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
10 smax: 1, // max number of slides |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
11 incpos: 0, // current step in slide |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
12 steps: null, |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
13 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
14 $slides: null, |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
15 $stylesProjection: null, |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
16 $stylesScreen: null, |
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 slideClasses: [ 'far-past', 'past', 'current', 'next', 'far-next' ] |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
19 }; |
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 |
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 * lets you define your own "global" transition function |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
24 * passes in a reference to from and to slide wrapped in jQuery wrapper |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
25 * |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
26 * see jquery.slideshow.transition.js for more examples |
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 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
29 Slideshow.transition = function( $from, $to ) { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
30 // do nothing here; by default lets use css3 for transition effects |
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 |
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 Slideshow.debug = function( msg ) { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
35 if( this.settings.debug && window.console && window.console.log ) |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
36 window.console.log( '[debug] ' + msg ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
37 } |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
38 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
39 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
40 Slideshow.init = function( options ) { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
41 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
42 this.settings = $.extend({ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
43 mode : 'slideshow', // slideshow | outline | autoplay |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
44 titleSelector : 'h1', |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
45 slideSelector : '.slide', // dummy (not yet working) |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
46 stepSelector : '.step', // dummy (not yet working) |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
47 debug : false, |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
48 normalize : true // normalize selectors (that is, allow aliases |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
49 // e.g. build,action,etc. for step and so on) |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
50 }, options || {}); |
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 this.isProjection = false; // are we in projection (slideshow) mode (in contrast to screen (outline) mode)? |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
53 this.snum = 1; // current slide # (non-zero based index e.g. starting with 1) |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
54 this.smax = 1; // max number of slides |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
55 this.incpos = 0; // current step in slide |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
56 this.steps = null; |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
57 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
58 if( this.settings.normalize == true ) |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
59 this.normalize(); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
60 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
61 this.$slides = $( '.slide' ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
62 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
63 this.smax = this.$slides.length; |
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 this.addSlideIds(); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
66 this.steps = this.collectSteps(); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
67 this.updateSlides(); // mark slides w/ far-past,past,current,next,far-next |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
68 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
69 // $stylesProjection holds all styles (<link rel="stylesheet"> or <style> w/ media type projection) |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
70 // $stylesScreen holds all styles (<link rel="stylesheet"> or <style> w/ media type screen) |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
71 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
72 // add workaround for chrome |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
73 // use screen,projection instead of projection |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
74 // (without projection inline style tag gets not parsed into a styleSheet accesible via JavaScript) |
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 this.$stylesProjection = $( 'link[media*=projection], style[media*=projection]' ).not('[rel*=less]').not('[type*=less]'); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
77 this.$stylesScreen = $( 'link[media*=screen], style[media*=screen]' ).not('[media*=projection]').not('[rel*=less]').not('[type*=less]') ; |
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 $( document ).trigger( 'slideshow.init' ); // fire init for addons |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
80 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
81 this.addClicker(); |
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 // opera is the only browser currently supporting css projection mode |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
85 this.notOperaFix(); |
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 // store possible slidenumber from hash */ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
88 // todo: use regex to extract number |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
89 // might be #slide1 or just #1 |
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 var gotoSlideNum = parseInt( window.location.hash.substring(1) ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
92 this.debug( "gotoSlideNum=" + gotoSlideNum ); |
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 if( !isNaN( gotoSlideNum )) |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
95 { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
96 this.debug( "restoring slide on (re)load #: " + gotoSlideNum ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
97 this.goTo( gotoSlideNum ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
98 } |
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 if( this.settings.mode == 'outline' ) |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
101 this.toggle(); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
102 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
103 $( document ).trigger( 'slideshow.start' ); // fire start for addons |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
104 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
105 $( document ).on( 'keyup', $.proxy( Slideshow.keys, this )); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
106 } // end init() |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
107 |
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 Slideshow.normalize = function() { |
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 // check for .presentation aliases, that is, .deck, .slides |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
112 $( '.deck, .slides' ).addClass( 'presentation' ); |
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 // add slide class to immediate children |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
115 // todo: use autoslide option that lets you turn on/off option? |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
116 $( '.presentation' ).children().addClass( 'slide' ); |
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 // todo: scope with .slide?? e.g .slide .incremental |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
119 // todo: make removing "old" class an option?? |
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 // check for .step aliases, that is, .incremental, .delayed, .action, .build |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
122 $( '.incremental, .delayed, .action, .build' ).addClass( 'step' ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
123 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
124 // check for .notes aliases, that is, .note, .handout |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
125 $( '.note, .handout' ).addClass( 'notes' ); |
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 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
129 Slideshow.notOperaFix = function() { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
130 // 1) switch media type from projection to screen |
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 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
|
133 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
134 this.$stylesProjection.each( function(i) { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
135 var styleProjection = this; |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
136 // note: no longer used; workaround for chrome needs screen,projection to make it work (thus, no need to switch to screen) |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
137 // styleProjection.media = 'screen'; |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
138 styleProjection.disabled = true; |
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 self.debug( "notOperaFix - stylesProjection["+i+"] switching media type from projection to screen" ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
141 } ); |
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 this.isProjection = false; |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
144 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
145 // 2) disable screen styles and enable projection styles (thus, switch into projection mode) |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
146 this.toggle(); |
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 // now we should be in project mode |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
149 } // end notOperatFix() |
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.toggle = function() { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
153 // todo: use settings.isProjection for state tracking |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
154 // and change disable accordingly (plus assert that all styles are in the state as expected) |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
155 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
156 // toggle between projection (slide show) mode |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
157 // and screen (outline) mode |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
158 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
159 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
|
160 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
161 this.$stylesProjection.each( function(i) { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
162 var styleProjection = this; |
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 styleProjection.disabled = !styleProjection.disabled; |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
165 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
166 self.debug( "toggle - stylesProjection["+i+"] disabled? " + styleProjection.disabled ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
167 }); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
168 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
169 this.$stylesScreen.each( function(i) { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
170 var styleScreen = this; |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
171 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
172 styleScreen.disabled = !styleScreen.disabled; |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
173 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
174 self.debug( "toggle - stylesScreen["+i+"] disabled? " + styleScreen.disabled ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
175 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
176 // update isProjection flag |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
177 self.isProjection = styleScreen.disabled; |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
178 }); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
179 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
180 /* |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
181 * note: code no longer needed; using (adding/removing) css classes hide/show) |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
182 * |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
183 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
184 if( this.isProjection ) |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
185 { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
186 this.$slides.each( function(i) { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
187 if( i == (self.snum-1) ) |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
188 $(this).show(); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
189 else |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
190 $(this).hide(); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
191 }); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
192 } |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
193 else |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
194 { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
195 this.$slides.show(); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
196 } |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
197 */ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
198 } // end toggle() |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
199 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
200 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
201 Slideshow.updatePermaLink = function() |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
202 { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
203 // todo: unify hash marks??; use #1 for div ids instead of #slide1? |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
204 window.location.hash = '#'+ this.snum; |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
205 } |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
206 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
207 Slideshow.goTo = function( target ) |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
208 { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
209 if( target > this.smax || target == this.snum ) |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
210 return; |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
211 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
212 this.go( target - this.snum ); |
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 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
215 Slideshow.go = function( dir ) |
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 this.debug( 'go: ' + dir ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
218 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
219 if( dir == 0 ) return; /* same slide; nothing to do */ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
220 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
221 var cid = '#slide' + this.snum; /* current slide (selector) id */ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
222 var csteps = this.steps[ this.snum-1 ]; /* current slide steps array */ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
223 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
224 /* remove all step and stepcurrent classes from current slide */ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
225 if( csteps.length > 0) { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
226 $( csteps ).each( function() { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
227 $(this).removeClass( 'step' ).removeClass( 'stepcurrent' ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
228 } ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
229 } |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
230 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
231 /* set snum to next slide */ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
232 this.snum += dir; |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
233 if( this.snum > this.smax ) this.snum = this.smax; |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
234 if( this.snum < 1 ) this.snum = 1; |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
235 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
236 var nid = '#slide' + this.snum; /* next slide (selector) id */ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
237 var nsteps = this.steps[this.snum-1]; /* next slide steps array */ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
238 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
239 if( dir < 0 ) /* go backwards? */ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
240 { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
241 this.incpos = nsteps.length; |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
242 /* mark last step as current step */ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
243 if( nsteps.length > 0 ) |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
244 $( nsteps[this.incpos-1] ).addClass( 'stepcurrent' ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
245 } |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
246 else /* go forwards? */ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
247 { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
248 this.incpos = 0; |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
249 if( nsteps.length > 0 ) { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
250 $( nsteps ).each( function() { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
251 $(this).addClass( 'step' ).removeClass( 'stepcurrent' ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
252 } ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
253 } |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
254 } |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
255 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
256 if( !(cid == nid) ) { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
257 this.updateSlides(); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
258 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
259 this.debug( "transition from " + cid + " to " + nid ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
260 this.transition( $( cid ), $( nid ) ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
261 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
262 // only fire change event if slide changes |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
263 $( document ).trigger( 'slideshow.change', [$( cid ), $( nid )]); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
264 } |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
265 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
266 this.updatePermaLink(); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
267 } // end go() |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
268 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
269 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
270 Slideshow.updateSlideClass = function( $slide, className ) |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
271 { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
272 if( className ) |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
273 $slide.addClass( className ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
274 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
275 for( var i in this.slideClasses ) |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
276 { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
277 if( className != this.slideClasses[i] ) |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
278 $slide.removeClass( this.slideClasses[i] ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
279 } |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
280 } |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
281 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
282 Slideshow.updateSlides = function() |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
283 { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
284 var self = this; |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
285 this.$slides.each( function( i ) { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
286 switch( i ) { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
287 case (self.snum-1)-2: |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
288 self.updateSlideClass( $(this), 'far-past' ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
289 break; |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
290 case (self.snum-1)-1: |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
291 self.updateSlideClass( $(this), 'past' ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
292 break; |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
293 case (self.snum-1): |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
294 self.updateSlideClass( $(this), 'current' ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
295 break; |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
296 case (self.snum-1)+1: |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
297 self.updateSlideClass( $(this), 'next' ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
298 break; |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
299 case (self.snum-1)+2: |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
300 self.updateSlideClass( $(this), 'far-next' ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
301 break; |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
302 default: |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
303 self.updateSlideClass( $(this) ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
304 break; |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
305 } |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
306 }); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
307 } |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
308 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
309 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
310 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
311 Slideshow.subgo = function( dir ) |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
312 { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
313 this.debug( 'subgo: ' + dir + ', incpos before: ' + this.incpos + ', after: ' + (this.incpos+dir) ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
314 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
315 var csteps = this.steps[this.snum-1]; /* current slide steps array */ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
316 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
317 if( dir > 0) |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
318 { /* go forward? */ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
319 if( this.incpos > 0 ) |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
320 $( csteps[this.incpos-1] ).removeClass( 'stepcurrent' ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
321 $( csteps[this.incpos] ).removeClass( 'step').addClass( 'stepcurrent' ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
322 this.incpos++; |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
323 } |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
324 else |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
325 { /* go backwards? */ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
326 this.incpos--; |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
327 $( csteps[this.incpos] ).removeClass( 'stepcurrent' ).addClass( 'step' ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
328 if( this.incpos > 0 ) |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
329 $( csteps[this.incpos-1] ).addClass( 'stepcurrent' ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
330 } |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
331 } // end subgo() |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
332 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
333 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
334 Slideshow.keys = function( key ) |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
335 { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
336 this.debug( "enter keys()" ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
337 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
338 if( !key ) { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
339 key = event; |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
340 key.which = key.keyCode; |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
341 } |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
342 if( key.which == 84 ) { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
343 this.toggle(); // toggle between project and screen css media mode |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
344 return; |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
345 } |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
346 if( this.isProjection ) { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
347 switch( key.which ) { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
348 case 32: // spacebar |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
349 case 34: // page down |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
350 case 39: // rightkey |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
351 case 40: // downkey |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
352 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
353 var csteps = this.steps[this.snum-1]; /* current slide steps array */ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
354 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
355 if( !csteps || this.incpos >= csteps.length ) { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
356 this.go(1); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
357 } else { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
358 this.subgo(1); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
359 } |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
360 break; |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
361 case 33: // page up |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
362 case 37: // leftkey |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
363 case 38: // upkey |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
364 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
365 if( !this.steps[this.snum-1] || this.incpos <= 0 ) { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
366 this.go(-1); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
367 } else { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
368 this.subgo(-1); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
369 } |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
370 break; |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
371 case 36: // home |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
372 this.goTo(1); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
373 break; |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
374 case 35: // end |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
375 this.goTo( this.smax ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
376 break; |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
377 case 68: // d |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
378 this.toggleDebug(); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
379 break; |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
380 } |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
381 $( document ).trigger( 'slideshow.keys', key ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
382 } |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
383 } // end keys() |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
384 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
385 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
386 Slideshow.toggleDebug = function() |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
387 { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
388 this.settings.debug = !this.settings.debug; |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
389 this.doDebug(); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
390 } |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
391 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
392 Slideshow.doDebug = function() |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
393 { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
394 if( this.settings.debug == true ) |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
395 { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
396 $( document ).trigger( 'slideshow.debug.on' ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
397 } |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
398 else |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
399 { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
400 $( document ).trigger( 'slideshow.debug.off' ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
401 } |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
402 } |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
403 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
404 Slideshow.collectStepsWorker = function(obj) |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
405 { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
406 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
|
407 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
408 var steps = []; |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
409 if( !obj ) |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
410 return steps; |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
411 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
412 $(obj).children().each( function() { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
413 if( $(this).hasClass( 'step' ) ) { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
414 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
415 self.debug( 'step found for ' + this.tagName ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
416 $(this).removeClass( 'step' ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
417 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
418 /* don't add enclosing list; instead add step class to all list items/children */ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
419 if( $(this).is( 'ol,ul' ) ) { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
420 self.debug( ' ol or ul found; adding auto steps' ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
421 $(this).children().addClass( 'step' ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
422 } |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
423 else |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
424 { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
425 steps.push( this ) |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
426 } |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
427 } |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
428 steps = steps.concat( self.collectStepsWorker( this ) ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
429 }); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
430 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
431 return steps; |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
432 } // end collectStepWorkers |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
433 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
434 Slideshow.collectSteps = function() |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
435 { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
436 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
|
437 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
438 var steps = []; |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
439 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
440 this.$slides.each( function(i) { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
441 self.debug ( 'collectSteps for ' + this.id + ':' ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
442 steps[i] = self.collectStepsWorker( this ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
443 }); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
444 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
445 $( steps ).each( function(i) { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
446 self.debug( 'slide ' + (i+1) + ': found ' + this.length + ' steps' ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
447 }); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
448 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
449 return steps; |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
450 } // end collectSteps() |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
451 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
452 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
453 Slideshow.addClicker = function() |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
454 { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
455 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
|
456 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
457 // if you click on heading of slide -> go to next slide (or next step) |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
458 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
459 $( this.settings.titleSelector, this.$slides ).click( function( ev ) { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
460 if(ev.which != 1) return; // only process left clicks (e.g 1; middle and rightclick use 2 and 3) |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
461 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
462 if( !self.isProjection ) // suspend clicker in outline view (just slideshow view) |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
463 return; |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
464 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
465 var csteps = self.steps[self.snum-1]; // current slide steps array |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
466 if ( !csteps || self.incpos >= csteps.length ) |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
467 self.go(1); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
468 else |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
469 self.subgo(1); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
470 }); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
471 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
472 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
473 $( this.settings.titleSelector, this.$slides ).on('contextmenu', function() { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
474 if( !self.isProjection ) // suspend clicker in outline view (just slideshow view) |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
475 return; |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
476 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
477 var csteps = self.steps[self.snum-1]; // current slide steps array |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
478 if ( !csteps || self.incpos >= csteps.length ) |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
479 self.go(-1); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
480 else |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
481 self.subgo(-1); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
482 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
483 return false; |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
484 } ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
485 } // end addClicker() |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
486 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
487 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
488 Slideshow.addSlideIds = function() { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
489 this.$slides.each( function(i) { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
490 this.id = 'slide'+(i+1); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
491 }); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
492 } |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
493 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
494 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
495 Slideshow.addStyles = function() { |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
496 this.debug( 'add builtin css via inline style elements' ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
497 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
498 var styleProjection = |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
499 "<style media='screen,projection'> \n"+ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
500 " .slide { display: block; } \n"+ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
501 " .notes { display: none; } \n"+ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
502 " .layout { display: block; } \n"+ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
503 "</style>"; |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
504 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
505 var styleScreen = |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
506 "<style media='screen'> \n"+ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
507 "/**** \n"+ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
508 " * hide layout stuff (header, footer, navLinks, navList etc.) \n"+ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
509 " */ \n"+ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
510 " \n"+ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
511 " .layout * { display: none; } \n"+ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
512 "</style>"; |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
513 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
514 var stylePrint = |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
515 "<style media='print'> \n"+ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
516 " \n"+ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
517 " .slide { display: block !important; } \n"+ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
518 " .layout, .layout * { display: none !important; } \n"+ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
519 " \n"+ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
520 "/****** \n"+ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
521 " * Turn on print-specific stuff/classes \n"+ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
522 " */ \n"+ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
523 " \n"+ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
524 " .extra { display: block !important; } \n"+ |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
525 "</style>"; |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
526 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
527 // note: use prepend (not append) to make sure this |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
528 // styles come first (and do not overrule user supplied styles) |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
529 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
530 $( 'head' ).prepend( styleProjection ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
531 $( 'head' ).prepend( styleScreen ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
532 $( 'head' ).prepend( stylePrint ); |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
533 } |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
534 |
05d802167c0c
Apply cr-style from Members/kaito/slides
Yasutaka Higa <e115763@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
535 Slideshow.addStyles(); |