Index: CHANGELOG.txt =================================================================== --- CHANGELOG.txt (revision 0) +++ CHANGELOG.txt (revision 313) @@ -0,0 +1,12 @@ +Patched by garywiz (http://drupal.org/user/72198) with the following changes: + +* Added most recent version (1.1.1) of scrollable from http://flowplayer.org/tools/download.html. +* Corrected module code to use new calling sequence. +* Added dependency on jquery_update. Code was tested with jQuery 1.3.2. +* Added circular looping capability (claimed as experimental by JQuery Tools developers). +* Changed code to create initialization functions which uniquely identify multiple views + on a page. +* Made it possible to have multiple views on the same page be of different types (combining + horizontal and vertical). This may have some stylesheet implications, but only for those + that need this feature. The containing div (previously classless), now has a class which + indicates its type, and this affects all elements (navi, etc.) Index: theme/scrollable.tpl.php =================================================================== --- theme/scrollable.tpl.php (revision 97) +++ theme/scrollable.tpl.php (working copy) @@ -1,4 +1,4 @@ -
+
Index: scrollable.module =================================================================== --- scrollable.module (revision 97) +++ scrollable.module (working copy) @@ -37,33 +37,56 @@ //print_r($rows); $path = drupal_get_path('module', 'scrollable'); - drupal_add_js($path .'/js/jquery.scrollable.min.js'); + drupal_add_js($path .'/js/jquery.scrollable-1.1.1-min.js'); drupal_add_css($path .'/css/scrollable_'. (($options['vertical']) ? 'vertical' : 'horizontal') .'.css'); - if ( $options['mousewheel'] ) { - drupal_add_js($path .'/js/jquery.mousewheel.min.js'); + // Add navigator only if requested. + + if ($options['navigator']) { + $add_nav = '.navigator({ + navi: ".'. $options['navi'] .'", + })'; } - + + // Only add autoscroll if it is requested. + + if ($options['interval']) { + $add_auto = '.autoscroll({ + interval: '. $options['interval'] .', + autopause: true, + })'; + } + + // Add circular if needed. + + if ($options['circular']) { + $add_circular = '.circular()'; + } + + // Same deal with the ol' mousewheel. + + if ($options['mousewheel']) { + $add_mouse = '.mousewheel()'; + } + $js = '$(document).ready(function() { - // initialize scrollable - $("div.scrollable").scrollable({ - size: '. $options['size'] .', - vertical: '. $options['vertical'] .', - clickable: '. $options['clickable'] .', - loop: '. $options['loop'] .', - interval: '. $options['interval'] .', - speed: '. $options['speed'] .', - keyboard: '. $options['keyboard'] .', - items: ".'. $options['items'] .'", - prev: ".'. $options['prev'] .'", - next: ".'. $options['next'] .'", - prevPage: ".'. $options['prevPage'] .'", - nextPage: ".'. $options['nextPage'] .'", - navi: ".'. $options['navi'] .'", - easing: "'. $options['easing'] .'", - }); - });'; + // initialize scrollable instance + $(".view-id-'.$view->name.' div.scrollable").scrollable({ + size: '. $options['size'] .', + vertical: '. $options['vertical'] .', + clickable: '. $options['clickable'] .', + loop: '. $options['loop'] .', + speed: '. $options['speed'] .', + keyboard: '. $options['keyboard'] .', + items: ".'. $options['items'] .'", + prev: ".'. $options['prev'] .'", + next: ".'. $options['next'] .'", + prevPage: ".'. $options['prevPage'] .'", + nextPage: ".'. $options['nextPage'] .'", + easing: "'. $options['easing'] .'" + })' . $add_nav . $add_auto . $add_mouse . $add_circular . '; + });'; drupal_add_js($js, 'inline'); Index: css/scrollable_horizontal.css =================================================================== --- css/scrollable_horizontal.css (revision 97) +++ css/scrollable_horizontal.css (working copy) @@ -8,7 +8,7 @@ * root element for the scrollable. * when scrolling occurs this element stays still. */ -div.scrollable { +.scrollparent-horizontal div.scrollable { /* required settings */ position: relative; overflow: hidden; @@ -23,7 +23,7 @@ * it's enough that you set width and height for the root element and * not for this element. */ -div.scrollable div.items { +.scrollparent-horizontal div.scrollable div.items { /* this cannot be too large */ position: absolute; width: 2000em; @@ -34,13 +34,13 @@ * typically this element is the one that *you* will style * the most. */ -div.scrollable div.items div.item { +.scrollparent-horizontal div.scrollable div.items div.item { float: left; width: 220px; } /* you may want to setup some decorations to active item */ -div.items div.active { +.scrollparent-horizontal div.items div.active { border: 1px inset #ccc; background-color: #fff; } @@ -48,7 +48,7 @@ /*********** navigator ***********/ /* position and dimensions of the navigator */ -div.navi { +.scrollparent-horizontal div.navi { margin-left: 328px; width: 200px; height: 20px; @@ -56,7 +56,7 @@ /* items inside navigator */ -div.navi a { +.scrollparent-horizontal div.navi a { width: 8px; height: 8px; float: left; @@ -66,19 +66,22 @@ } /* mouseover state */ -div.navi a:hover { +.scrollparent-horizontal div.navi a:hover { background-position: 0 -8px; } /* active state (current page state) */ -div.navi a.active { +.scrollparent-horizontal div.navi a.active { background-position: 0 -16px; } /*********** left/right buttons ***********/ /* prev, next, prevPage and nextPage buttons */ -a.prev, a.next, a.prevPage, a.nextPage { +.scrollparent-horizontal a.prev, +.scrollparent-horizontal a.next, +.scrollparent-horizontal a.prevPage, +.scrollparent-horizontal a.nextPage { display: block; width: 18px; height: 18px; @@ -89,18 +92,20 @@ } /* mouseover state */ -a.prev:hover, a.next:hover, a.prevPage:hover, a.nextPage:hover { +.scrollparent-horizontal a.prev:hover, +.scrollparent-horizontal a.next:hover, +.scrollparent-horizontal a.prevPage:hover, +.scrollparent-horizontal a.nextPage:hover { background-position: 0px -18px; } /* disabled navigational button */ -a.disabled { +.scrollparent-horizontal a.disabled { visibility: hidden !important; } /* next button uses another background image */ -a.next, a.nextPage { +.scrollparent-horizontal a.next, a.nextPage { background-image: url(../img/right.png); clear: right; } - Index: css/scrollable_vertical.css =================================================================== --- css/scrollable_vertical.css (revision 97) +++ css/scrollable_vertical.css (working copy) @@ -8,7 +8,7 @@ * root element for the scrollable. * when scrolling occurs this element stays still. */ -div.scrollable { +.scrollparent-vertical div.scrollable { /* required settings */ position: relative; overflow: hidden; @@ -23,7 +23,7 @@ * it's enough that you set width and height for the root element and * not for this element. */ -div.scrollable div.items { +.scrollparent-vertical div.scrollable div.items { /* this cannot be too large */ position: absolute; height: 2000em; @@ -34,13 +34,13 @@ * typically this element is the one that *you* will style * the most. */ -div.scrollable div.items div.item { +.scrollparent-vertical div.scrollable div.items div.item { float: left; height: 220px; } /* you may want to setup some decorations to active item */ -div.items div.active { +.scrollparent-vertical div.items div.active { border: 1px inset #ccc; background-color: #fff; } @@ -48,7 +48,7 @@ /*********** navigator ***********/ /* position and dimensions of the navigator */ -div.navi { +.scrollparent-vertical div.navi { margin-left: 148px; width: 200px; height: 20px; @@ -56,7 +56,7 @@ /* items inside navigator */ -div.navi a { +.scrollparent-vertical div.navi a { width: 8px; height: 8px; float: left; @@ -66,19 +66,22 @@ } /* mouseover state */ -div.navi a:hover { +.scrollparent-vertical div.navi a:hover { background-position: 0 -8px; } /* active state (current page state) */ -div.navi a.active { +.scrollparent-vertical div.navi a.active { background-position: 0 -16px; } /*********** left/right buttons ***********/ /* prev, next, prevPage and nextPage buttons */ -a.prev, a.next, a.prevPage, a.nextPage { +.scrollparent-vertical a.prev, +.scrollparent-vertical a.next, +.scrollparent-vertical a.prevPage, +.scrollparent-vertical a.nextPage { display: block; width: 18px; height: 18px; @@ -89,17 +92,21 @@ } /* mouseover state */ -a.prev:hover, a.next:hover, a.prevPage:hover, a.nextPage:hover { +.scrollparent-vertical a.prev:hover, +.scrollparent-vertical a.next:hover, +.scrollparent-vertical a.prevPage:hover, +.scrollparent-vertical a.nextPage:hover { background-position: 0px -18px; } /* disabled navigational button */ -a.disabled { +.scrollparent-vertical a.disabled { visibility: hidden !important; } /* next button uses another background image */ -a.next, a.nextPage { +.scrollparent-vertical a.next, +.scrollparent-vertical a.nextPage { background-image: url(../img/right.png); clear: right; } Index: scrollable_style_plugin.inc =================================================================== --- scrollable_style_plugin.inc (revision 97) +++ scrollable_style_plugin.inc (working copy) @@ -15,6 +15,7 @@ $options['vertical'] = array('default' => FALSE); $options['clickable'] = array('default' => TRUE); $options['loop'] = array('default' => FALSE); + $options['circular'] = array('default' => FALSE); $options['interval'] = array('default' => 0); $options['speed'] = array('default' => 400); $options['keyboard'] = array('default' => TRUE); @@ -65,6 +66,12 @@ '#description' => t('Whether scrolling starts from the first item in the list when the last item is reached.'), '#default_value' => $this->options['loop'], ); + $form['circular'] = array( + '#type' => 'checkbox', + '#title' => t('Circular Scrolling'), + '#description' => t('If true, then the items will appear to be a continous looped circle with no first or last. Note that the jQuery Tools author at flowplayer.org says this is experimental (as of 1-Oct-2009)'), + '#default_value' => $this->options['circular'], + ); $form['interval'] = array( '#type' => 'select', '#title' => t('Interval'), Index: js/jquery.scrollable-1.1.1-min.js =================================================================== --- js/jquery.scrollable-1.1.1-min.js (revision 0) +++ js/jquery.scrollable-1.1.1-min.js (revision 313) @@ -0,0 +1,28 @@ +/* + * jquery.tools 1.1.1 - The missing UI library for the Web + * + * [tools.scrollable-1.1.1, tools.scrollable.circular-0.5.1, tools.scrollable.autoscroll-1.0.1, tools.scrollable.navigator-1.0.1, tools.scrollable.mousewheel-1.0.1] + * + * Copyright (c) 2009 Tero Piirainen + * http://flowplayer.org/tools/ + * + * Dual licensed under MIT and GPL 2+ licenses + * http://www.opensource.org/licenses + * + * ----- + * + * jquery.event.wheel.js - rev 1 + * Copyright (c) 2008, Three Dub Media (http://threedubmedia.com) + * Liscensed under the MIT License (MIT-LICENSE.txt) + * http://www.opensource.org/licenses/mit-license.php + * Created: 2008-07-01 | Updated: 2008-07-14 + * + * ----- + * + * File generated: Fri Sep 18 10:59:44 GMT+00:00 2009 + */ +(function(c){c.tools=c.tools||{};c.tools.scrollable={version:"1.1.1",conf:{size:5,vertical:false,speed:400,keyboard:true,keyboardSteps:null,disabledClass:"disabled",hoverClass:null,clickable:true,activeClass:"active",easing:"swing",loop:false,items:".items",item:null,prev:".prev",next:".next",prevPage:".prevPage",nextPage:".nextPage",api:false}};var d,a=0;function b(q,o,m){var t=this,r=c(this),e=!o.vertical,f=q.children(),l=0,j;if(!d){d=t}c.each(o,function(u,v){if(c.isFunction(v)){r.bind(u,v)}});if(f.length>1){f=c(o.items,q)}function n(v){var u=c(v);return m==1||u.length==1||o.globalNav?u:q.parent().find(v)}q.data("finder",n);var g=n(o.prev),i=n(o.next),h=n(o.prevPage),p=n(o.nextPage);c.extend(t,{getIndex:function(){return l},getClickIndex:function(){var u=t.getItems();return u.index(u.filter("."+o.activeClass))},getConf:function(){return o},getSize:function(){return t.getItems().size()},getPageAmount:function(){return Math.ceil(this.getSize()/o.size)},getPageIndex:function(){return Math.ceil(l/o.size)},getNaviButtons:function(){return g.add(i).add(h).add(p)},getRoot:function(){return q},getItemWrap:function(){return f},getItems:function(){return f.children(o.item)},getVisibleItems:function(){return t.getItems().slice(l,l+o.size)},seekTo:function(u,y,v){if(u<0){u=0}if(l===u){return t}if(y===undefined){y=o.speed}if(c.isFunction(y)){v=y;y=o.speed}if(u>t.getSize()-o.size){return o.loop?t.begin():this.end()}var w=t.getItems().eq(u);if(!w.length){return t}var x=c.Event("onBeforeSeek");r.trigger(x,[u]);if(x.isDefaultPrevented()){return t}function z(){if(v){v.call(t)}r.trigger("onSeek",[u])}if(e){f.animate({left:-w.position().left},y,o.easing,z)}else{f.animate({top:-w.position().top},y,o.easing,z)}d=t;l=u;return t},move:function(w,v,u){j=w>0;return this.seekTo(l+w,v,u)},next:function(v,u){return this.move(1,v,u)},prev:function(v,u){return this.move(-1,v,u)},movePage:function(y,x,w){j=y>0;var u=o.size*y;var v=l%o.size;if(v>0){u+=(y>0?-v:o.size-v)}return this.move(u,x,w)},prevPage:function(v,u){return this.movePage(-1,v,u)},nextPage:function(v,u){return this.movePage(1,v,u)},setPage:function(v,w,u){return this.seekTo(v*o.size,w,u)},begin:function(v,u){j=false;return this.seekTo(0,v,u)},end:function(v,u){j=true;var w=this.getSize()-o.size;return w>0?this.seekTo(w,v,u):t},reload:function(){r.trigger("onReload");return t},bind:function(u,v){r.bind(u,v);return t},onBeforeSeek:function(u){return this.bind("onBeforeSeek",u)},onSeek:function(u){return this.bind("onSeek",u)},onReload:function(u){return this.bind("onReload",u)},unbind:function(u){r.unbind(u);return t},focus:function(){d=t;return t},click:function(w){var x=t.getItems().eq(w),u=o.activeClass,v=o.size;if(w<0||w>=t.getSize()){return t}if(v==1){if(o.loop){return t.next()}if(w===0||w==t.getSize()-1){j=(j===undefined)?true:!j}return j===false?t.prev():t.next()}if(v==2){if(w==l){w--}t.getItems().removeClass(u);x.addClass(u);return t.seekTo(w,time,fn)}if(!x.hasClass(u)){t.getItems().removeClass(u);x.addClass(u);var z=Math.floor(v/2);var y=w-z;if(y>t.getSize()-v){y=t.getSize()-v}if(y!==w){return t.seekTo(y)}}return t}});g.addClass(o.disabledClass).click(function(){t.prev()});i.click(function(){t.next()});p.click(function(){t.nextPage()});h.addClass(o.disabledClass).click(function(){t.prevPage()});t.onSeek(function(v,u){if(u===0){g.add(h).addClass(o.disabledClass)}else{g.add(h).removeClass(o.disabledClass)}if(u>=t.getSize()-o.size){i.add(p).addClass(o.disabledClass)}else{i.add(p).removeClass(o.disabledClass)}});var k=o.hoverClass,s="keydown."+Math.random().toString().substring(10);t.onReload(function(){if(k){t.getItems().hover(function(){c(this).addClass(k)},function(){c(this).removeClass(k)})}if(o.clickable){t.getItems().each(function(u){c(this).unbind("click.scrollable").bind("click.scrollable",function(v){if(c(v.target).is("a")){return}return t.click(u)})})}if(o.keyboard){c(document).unbind(s).bind(s,function(u){if(u.altKey||u.ctrlKey){return}if(o.keyboard!="static"&&d!=t){return}var v=o.keyboardSteps;if(e&&(u.keyCode==37||u.keyCode==39)){t.move(u.keyCode==37?-v:v);return u.preventDefault()}if(!e&&(u.keyCode==38||u.keyCode==40)){t.move(u.keyCode==38?-v:v);return u.preventDefault()}return true})}else{c(document).unbind(s)}});t.reload()}c.fn.scrollable=function(e){var f=this.eq(typeof e=="number"?e:0).data("scrollable");if(f){return f}var g=c.extend({},c.tools.scrollable.conf);e=c.extend(g,e);e.keyboardSteps=e.keyboardSteps||e.size;a+=this.length;this.each(function(){f=new b(c(this),e);c(this).data("scrollable",f)});return e.api?f:this}})(jQuery); +(function(b){var a=b.tools.scrollable;a.plugins=a.plugins||{};a.plugins.circular={version:"0.5.1",conf:{api:false,clonedClass:"cloned"}};b.fn.circular=function(e){var d=b.extend({},a.plugins.circular.conf),c;b.extend(d,e);this.each(function(){var i=b(this).scrollable(),n=i.getItems(),k=i.getConf(),f=i.getItemWrap(),j=0;if(i){c=i}if(n.lengthi.getSize()-k.size;if(u<0||t){var o=j+k.size+(t?-n.length:n.length);g(o);u=o+s}if(q){m.removeClass(k.activeClass).eq(u+Math.floor(k.size/2)).addClass(k.activeClass)}if(u===j+k.size){return self}return i.seekTo(u,r,p)},begin:function(p,o){return this.seekTo(k.size,p,o)},end:function(p,o){return this.seekTo(n.length,p,o)},click:function(p,r,q){if(!k.clickable){return self}if(k.size==1){return this.next()}var s=p-j,o=k.activeClass;s-=Math.floor(k.size/2);return this.move(s,r,q,true)},getIndex:function(){return j},setPage:function(p,q,o){return this.seekTo(p*k.size+k.size,q,o)},getPageAmount:function(){return Math.ceil(n.length/k.size)},getPageIndex:function(){if(j<0){return this.getPageAmount()-1}if(j>=n.length){return 0}return(j+k.size)/k.size-1},getVisibleItems:function(){var o=j+k.size;return m.slice(o,o+k.size)}});i.onSeek(function(p,o){j=o-k.size;i.getNaviButtons().removeClass(k.disabledClass)});i.getNaviButtons().removeClass(k.disabledClass)});return d.api?c:this}})(jQuery); +(function(b){var a=b.tools.scrollable;a.plugins=a.plugins||{};a.plugins.autoscroll={version:"1.0.1",conf:{autoplay:true,interval:3000,autopause:true,steps:1,api:false}};b.fn.autoscroll=function(d){if(typeof d=="number"){d={interval:d}}var e=b.extend({},a.plugins.autoscroll.conf),c;b.extend(e,d);this.each(function(){var g=b(this).scrollable();if(g){c=g}var i,f,h=true;g.play=function(){if(i){return}h=false;i=setInterval(function(){g.move(e.steps)},e.interval);g.move(e.steps)};g.pause=function(){i=clearInterval(i)};g.stop=function(){g.pause();h=true};if(e.autopause){g.getRoot().add(g.getNaviButtons()).hover(function(){g.pause();clearInterval(f)},function(){if(!h){f=setTimeout(g.play,e.interval)}})}if(e.autoplay){setTimeout(g.play,e.interval)}});return e.api?c:this}})(jQuery); +(function(b){var a=b.tools.scrollable;a.plugins=a.plugins||{};a.plugins.navigator={version:"1.0.1",conf:{navi:".navi",naviItem:null,activeClass:"active",indexed:false,api:false}};b.fn.navigator=function(d){var e=b.extend({},a.plugins.navigator.conf),c;if(typeof d=="string"){d={navi:d}}d=b.extend(e,d);this.each(function(){var i=b(this).scrollable(),f=i.getRoot(),l=f.data("finder").call(null,d.navi),g=null,k=i.getNaviButtons();if(i){c=i}i.getNaviButtons=function(){return k.add(l)};function j(){if(!l.children().length||l.data("navi")==i){l.empty();l.data("navi",i);for(var m=0;m"))}g=l.children().each(function(n){b(this).click(function(o){i.setPage(n);return o.preventDefault()});if(d.indexed){b(this).text(n)}})}else{g=d.naviItem?l.find(d.naviItem):l.children();g.each(function(n){var o=b(this);o.click(function(p){i.setPage(n);return p.preventDefault()})})}g.eq(0).addClass(d.activeClass)}i.onSeek(function(n){var m=d.activeClass;g.removeClass(m).eq(i.getPageIndex()).addClass(m)});i.onReload(function(){j()});j();var h=g.filter("[href="+location.hash+"]");if(h.length){i.move(g.index(h))}});return d.api?c:this}})(jQuery); +(function(b){b.fn.wheel=function(e){return this[e?"bind":"trigger"]("wheel",e)};b.event.special.wheel={setup:function(){b.event.add(this,d,c,{})},teardown:function(){b.event.remove(this,d,c)}};var d=!b.browser.mozilla?"mousewheel":"DOMMouseScroll"+(b.browser.version<"1.9"?" mousemove":"");function c(e){switch(e.type){case"mousemove":return b.extend(e.data,{clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY});case"DOMMouseScroll":b.extend(e,e.data);e.delta=-e.detail/3;break;case"mousewheel":e.delta=e.wheelDelta/120;break}e.type="wheel";return b.event.handle.call(this,e,e.delta)}var a=b.tools.scrollable;a.plugins=a.plugins||{};a.plugins.mousewheel={version:"1.0.1",conf:{api:false,speed:50}};b.fn.mousewheel=function(f){var g=b.extend({},a.plugins.mousewheel.conf),e;if(typeof f=="number"){f={speed:f}}f=b.extend(g,f);this.each(function(){var h=b(this).scrollable();if(h){e=h}h.getRoot().wheel(function(i,j){h.move(j<0?1:-1,f.speed||50);return false})});return f.api?e:this}})(jQuery); Index: js/jquery.mousewheel.min.js =================================================================== --- js/jquery.mousewheel.min.js (revision 97) +++ js/jquery.mousewheel.min.js (working copy) @@ -1,13 +0,0 @@ -/* $Id: jquery.mousewheel.min.js,v 1.2 2009/05/31 15:43:31 cptncauliflower Exp $ */ - -/* Copyright (c) 2009 Brandon Aaron (http://brandonaaron.net) - * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) - * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. - * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers. - * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix. - * - * Version: 3.0.2 - * - * Requires: 1.2.2+ - */ -(function(c){var a=["DOMMouseScroll","mousewheel"];c.event.special.mousewheel={setup:function(){if(this.addEventListener){for(var d=a.length;d;){this.addEventListener(a[--d],b,false)}}else{this.onmousewheel=b}},teardown:function(){if(this.removeEventListener){for(var d=a.length;d;){this.removeEventListener(a[--d],b,false)}}else{this.onmousewheel=null}}};c.fn.extend({mousewheel:function(d){return d?this.bind("mousewheel",d):this.trigger("mousewheel")},unmousewheel:function(d){return this.unbind("mousewheel",d)}});function b(f){var d=[].slice.call(arguments,1),g=0,e=true;f=c.event.fix(f||window.event);f.type="mousewheel";if(f.wheelDelta){g=f.wheelDelta/120}if(f.detail){g=-f.detail/3}d.unshift(f,g);return c.event.handle.apply(this,d)}})(jQuery); \ No newline at end of file Index: js/jquery.scrollable.min.js =================================================================== --- js/jquery.scrollable.min.js (revision 97) +++ js/jquery.scrollable.min.js (working copy) @@ -1,13 +0,0 @@ -/** - * jquery.scrollable 1.0.2. Put your HTML scroll. - * - * Copyright (c) 2009 Tero Piirainen - * http://flowplayer.org/tools/scrollable.html - * - * Dual licensed under MIT and GPL 2+ licenses - * http://www.opensource.org/licenses - * - * Launch : March 2008 - * Version : 1.0.2 - Tue Feb 24 2009 10:52:04 GMT-0000 (GMT+00:00) - */ -(function($){function fireEvent(opts,name,self,arg){var fn=opts[name];if($.isFunction(fn)){try{return fn.call(self,arg);}catch(error){if(opts.alert){alert("Error calling scrollable."+name+": "+error);}else{throw error;}return false;}}return true;}var current=null;function Scrollable(root,conf){var self=this;if(!current){current=self;}var horizontal=!conf.vertical;var wrap=$(conf.items,root);var index=0;var navi=root.siblings(conf.navi).eq(0);var prev=root.siblings(conf.prev).eq(0);var next=root.siblings(conf.next).eq(0);var prevPage=root.siblings(conf.prevPage).eq(0);var nextPage=root.siblings(conf.nextPage).eq(0);$.extend(self,{getVersion:function(){return[1,0,1];},getIndex:function(){return index;},getConf:function(){return conf;},getSize:function(){return self.getItems().size();},getPageAmount:function(){return Math.ceil(this.getSize()/conf.size);},getPageIndex:function(){return Math.ceil(index/conf.size);},getRoot:function(){return root;},getItemWrap:function(){return wrap;},getItems:function(){return wrap.children();},seekTo:function(i,time,fn){time=time||conf.speed;if($.isFunction(time)){fn=time;time=conf.speed;}if(i<0){i=0;}if(i>self.getSize()-conf.size){return self;}var item=self.getItems().eq(i);if(!item.length){return self;}if(fireEvent(conf,"onBeforeSeek",self,i)===false){return self;}if(horizontal){var left=-(item.outerWidth(true)*i);wrap.animate({left:left},time,conf.easing,fn?function(){fn.call(self);}:null);}else{var top=-(item.outerHeight(true)*i);wrap.animate({top:top},time,conf.easing,fn?function(){fn.call(self);}:null);}if(navi.length){var klass=conf.activeClass;var page=Math.ceil(i/conf.size);page=Math.min(page,navi.children().length-1);navi.children().removeClass(klass).eq(page).addClass(klass);}if(i===0){prev.add(prevPage).addClass(conf.disabledClass);}else{prev.add(prevPage).removeClass(conf.disabledClass);}if(i>=self.getSize()-conf.size){next.add(nextPage).addClass(conf.disabledClass);}else{next.add(nextPage).removeClass(conf.disabledClass);}current=self;index=i;fireEvent(conf,"onSeek",self,i);return self;},move:function(offset,time,fn){var to=index+offset;if(conf.loop&&to>(self.getSize()-conf.size)){to=0;}return this.seekTo(to,time,fn);},next:function(time,fn){return this.move(1,time,fn);},prev:function(time,fn){return this.move(-1,time,fn);},movePage:function(offset,time,fn){return this.move(conf.size*offset,time,fn);},setPage:function(page,time,fn){var size=conf.size;var index=size*page;var lastPage=index+size>=this.getSize();if(lastPage){index=this.getSize()-conf.size;}return this.seekTo(index,time,fn);},prevPage:function(time,fn){return this.setPage(this.getPageIndex()-1,time,fn);},nextPage:function(time,fn){return this.setPage(this.getPageIndex()+1,time,fn);},begin:function(time,fn){return this.seekTo(0,time,fn);},end:function(time,fn){return this.seekTo(this.getSize()-conf.size,time,fn);},reload:function(){return load();},click:function(index,time,fn){var item=self.getItems().eq(index);var klass=conf.activeClass;if(!item.hasClass(klass)&&(index>=0||indexself.getSize()-conf.size){to--;}if(to!==index){return this.seekTo(to,time,fn);}}return self;}});if($.isFunction($.fn.mousewheel)){root.bind("mousewheel.scrollable",function(e,delta){var step=$.browser.opera?1:-1;self.move(delta>0?step:-step,50);return false;});}prev.addClass(conf.disabledClass).click(function(){self.prev();});next.click(function(){self.next();});nextPage.click(function(){self.nextPage();});prevPage.addClass(conf.disabledClass).click(function(){self.prevPage();});if(conf.keyboard){$(window).unbind("keypress.scrollable").bind("keypress.scrollable",function(evt){var el=current;if(!el){return;}if(horizontal&&(evt.keyCode==37||evt.keyCode==39)){el.move(evt.keyCode==37?-1:1);return evt.preventDefault();}if(!horizontal&&(evt.keyCode==38||evt.keyCode==40)){el.move(evt.keyCode==38?-1:1);return evt.preventDefault();}return true;});}function load(){navi.each(function(){var nav=$(this);if(nav.is(":empty")||nav.data("me")==self){nav.empty();nav.data("me",self);for(var i=0;i").attr("href",i).click(function(e){var el=$(this);el.parent().children().removeClass(conf.activeClass);el.addClass(conf.activeClass);self.setPage(el.attr("href"));return e.preventDefault();});if(i===0){item.addClass(conf.activeClass);}nav.append(item);}}else{var els=nav.children();els.each(function(i){var item=$(this);item.attr("href",i);if(i===0){item.addClass(conf.activeClass);}item.click(function(){nav.find("."+conf.activeClass).removeClass(conf.activeClass);item.addClass(conf.activeClass);self.setPage(item.attr("href"));});});}});if(conf.clickable){self.getItems().each(function(index,arg){var el=$(this);if(!el.data("set")){el.bind("click.scrollable",function(){self.click(index);});el.data("set",true);}});}if(conf.hoverClass){self.getItems().hover(function(){$(this).addClass(conf.hoverClass);},function(){$(this).removeClass(conf.hoverClass);});}return self;}load();var timer=null;function setTimer(){timer=setInterval(function(){self.next();},conf.interval);}if(conf.interval>0){root.hover(function(){clearInterval(timer);},function(){setTimer();});setTimer();}}jQuery.prototype.scrollable=function(conf){var api=this.eq(typeof conf=='number'?conf:0).data("scrollable");if(api){return api;}var opts={size:5,vertical:false,clickable:true,loop:false,interval:0,speed:400,keyboard:true,activeClass:'active',disabledClass:'disabled',hoverClass:null,easing:'swing',items:'.items',prev:'.prev',next:'.next',prevPage:'.prevPage',nextPage:'.nextPage',navi:'.navi',naviItem:'a',onBeforeSeek:null,onSeek:null,alert:true};$.extend(opts,conf);this.each(function(){var el=new Scrollable($(this),opts);$(this).data("scrollable",el);});return this;};})(jQuery); \ No newline at end of file Index: scrollable.info =================================================================== --- scrollable.info (revision 97) +++ scrollable.info (working copy) @@ -3,10 +3,11 @@ description = Provide Views Style plugin for jScrollable. core = 6.x package = Views -dependencies[] = views -; Information added by drupal.org packaging script on 2009-06-01 -version = "6.x-1.x-dev" -core = "6.x" -project = "scrollable" -datestamp = "1243815696" - +dependencies[] = views +dependencies[] = jquery_update +; Information added by drupal.org packaging script on 2009-06-01 +version = "6.x-1.x-dev" +core = "6.x" +project = "scrollable" +datestamp = "1243815696" +