From c0accb84196d996d4ddc66d1c02b7e7cc3ed9765 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sat, 14 May 2016 09:51:13 -0300 Subject: Slides location --- doc/s6/jquery.slideshow.js | 534 --------------------------------------------- 1 file changed, 534 deletions(-) delete mode 100644 doc/s6/jquery.slideshow.js (limited to 'doc/s6/jquery.slideshow.js') diff --git a/doc/s6/jquery.slideshow.js b/doc/s6/jquery.slideshow.js deleted file mode 100644 index 6d6c560..0000000 --- a/doc/s6/jquery.slideshow.js +++ /dev/null @@ -1,534 +0,0 @@ - -var Slideshow = {}; - - -/************************************ - * lets you define your own "global" transition function - * passes in a reference to from and to slide wrapped in jQuery wrapper - */ - -Slideshow.transition = function( $from, $to ) { - // $from.hide(); - // $to.show(); - - $from.hide('fast'); - $to.show('fast'); -} - -/*********************** - * sample custom transition using scrollUp effect - * inspired by Karl Swedberg's Scroll Up Headline Reader jQuery Tutorial[1] - * [1] http://docs.jquery.com/Tutorials:Scroll_Up_Headline_Reader - */ - -function transitionSlideUpSlideDown( $from, $to ) { - $from.slideUp( 500, function() { $to.slideDown( 1000 ); } ); -} - -function transitionFadeOutFadeIn( $from, $to ) { - $from.fadeOut( 500 ); - $to.fadeIn( 500 ); -} - -function transitionScrollUp( $from, $to ) { - var cheight = $from.outerHeight(); - - // hide scrollbar during animation - $( 'body' ).css( 'overflow-y', 'hidden' ); - - $to.css( 'top', cheight+'px' ); - $to.show(); - - $from.animate( {top: -cheight}, 'slow' ); - $to.animate( {top: 0}, 'slow', function() { - $from.hide().css( 'top', '0px'); - - // restore possible scrollbar - $( 'body' ).css( 'overflow-y', 'auto' ); - }); -} - -Slideshow.init = function( options ) { - - var settings = $.extend({ - mode : 'slideshow', // slideshow | outline | autoplay - projectionStyleId : '#styleProjection', - screenStyleId : '#styleScreen', - titleSelector : 'h1', - slideSelector : '.slide', // dummy (not yet working) - stepSelector : '.step', // dummy (not yet working) - debug : false, - change : null // todo: change to use a custom event and trigger - }, options || {}); - - settings.isProjection = true; // are we in projection (slideshow) mode (in contrast to screen (outline) mode)? - settings.snum = 1; // current slide # (non-zero based index e.g. starting with 1) - settings.smax = 1; // max number of slides - settings.incpos = 0; // current step in slide - settings.steps = null; - settings.autoplayInterval = null; - - function debug( msg ) - { - if( settings.debug && window.console && window.console.log ) - window.console.log( '[debug] ' + msg ); - } - - function showHide( action ) - { - var $navLinks = $( '#navLinks' ) - - switch( action ) { - case 's': $navLinks.css( 'visibility', 'visible' ); break; - case 'h': $navLinks.css( 'visibility', 'hidden' ); break; - case 'c': /* toggle control panel */ - if( $navLinks.css( 'visibility' ) != 'visible' ) - $navLinks.css( 'visibility', 'visible' ); - else - $navLinks.css( 'visibility', 'hidden' ); - break; - } - } - - function updateCurrentSlideCounter() - { - $( '#currentSlide' ).html( settings.snum + '/' + settings.smax ); - } - - function updateJumpList() - { - $('#jumplist').get(0).selectedIndex = (settings.snum-1); - } - - function updatePermaLink() - { - // todo: unify hash marks??; use #1 for div ids instead of #slide1? - window.location.hash = '#'+settings.snum; - } - - function goTo( target ) - { - if( target > settings.smax || target == settings.snum ) return; - go( target - settings.snum ); - } - - function go( dir ) - { - debug( 'go: ' + dir ); - - if( dir == 0 ) return; /* same slide; nothing to do */ - - var cid = '#slide' + settings.snum; /* current slide (selector) id */ - var csteps = settings.steps[settings.snum-1]; /* current slide steps array */ - - /* remove all step and stepcurrent classes from current slide */ - if( csteps.length > 0) { - $( csteps ).each( function() { - $(this).removeClass( 'step' ).removeClass( 'stepcurrent' ); - } ); - } - - /* set snum to next slide */ - settings.snum += dir; - if( settings.snum > settings.smax ) settings.snum = settings.smax; - if( settings.snum < 1 ) settings.snum = 1; - - var nid = '#slide' + settings.snum; /* next slide (selector) id */ - var nsteps = settings.steps[settings.snum-1]; /* next slide steps array */ - - if( dir < 0 ) /* go backwards? */ - { - settings.incpos = nsteps.length; - /* mark last step as current step */ - if( nsteps.length > 0 ) - $( nsteps[settings.incpos-1] ).addClass( 'stepcurrent' ); - } - else /* go forwards? */ - { - settings.incpos = 0; - if( nsteps.length > 0 ) { - $( nsteps ).each( function() { - $(this).addClass( 'step' ).removeClass( 'stepcurrent' ); - } ); - } - } - - if( !(cid == nid) ) { - debug( "transition from " + cid + " to " + nid ); - Slideshow.transition( $( cid ), $( nid ) ); - } - - updateJumpList(); - updateCurrentSlideCounter(); - updatePermaLink(); - - if (settings.change) { settings.change(); } -} - - function subgo( dir ) - { - debug( 'subgo: ' + dir + ', incpos before: ' + settings.incpos + ', after: ' + (settings.incpos+dir) ); - - var csteps = settings.steps[settings.snum-1]; /* current slide steps array */ - - if( dir > 0) - { /* go forward? */ - if( settings.incpos > 0 ) - $( csteps[settings.incpos-1] ).removeClass( 'stepcurrent' ); - $( csteps[settings.incpos] ).removeClass( 'step').addClass( 'stepcurrent' ); - settings.incpos++; - } - else - { /* go backwards? */ - settings.incpos--; - $( csteps[settings.incpos] ).removeClass( 'stepcurrent' ).addClass( 'step' ); - if( settings.incpos > 0 ) - $( csteps[settings.incpos-1] ).addClass( 'stepcurrent' ); - } -} - - -function notOperaFix() -{ - $( settings.projectionStyleId ).attr( 'media','screen' ); - - var styleScreen = $( settings.screenStyleId ).get(0); - styleScreen.disabled = true; -} - - -function toggle() -{ - // toggle between projection (slide show) mode - // and screen (outline) mode - - // get stylesheets - var styleProjection = $( settings.projectionStyleId ).get(0); - var styleScreen = $( settings.screenStyleId ).get(0); - - if( !styleProjection.disabled ) - { - styleProjection.disabled = true; - styleScreen.disabled = false; - settings.isProjection = false; - $('.slide').each( function() { $(this).show(); } ); - } - else - { - styleProjection.disabled = false; - styleScreen.disabled = true; - settings.isProjection = true; - $('.slide').each( function(i) { - if( i == (settings.snum-1) ) - $(this).show(); - else - $(this).hide(); - }); - } -} - - function populateJumpList() { - - var list = $('#jumplist').get(0); - - $( '.slide' ).each( function(i) { - var text = $(this).find( settings.titleSelector ).text(); - list.options[list.length] = new Option( (i+1)+' : '+ text, (i+1) ); - }); - } - - function createControls() - { - // todo: make layout into an id (not class?) - // do we need or allow more than one element? - - - // if no div.layout exists, create one - if( $( '.layout' ).length == 0 ) - $( "
").appendTo( 'body' ); - - $( '.layout' ) - .append( "
" ) - .append( "
" ); - - var $controls = $( '#controls' ) - - $controls.html( '