diff --git a/css/imageflow.packed.css b/css/imageflow.packed.css new file mode 100644 index 00000000..ab22684b --- /dev/null +++ b/css/imageflow.packed.css @@ -0,0 +1 @@ +@charset "utf-8"; @media screen, projection{.imageflow{overflow:hidden; position:relative; text-align:left; visibility:hidden; width:100%}.imageflow img{border:none; position:absolute; top:0px; visibility:hidden; -ms-interpolation-mode:bicubic}.imageflow p{margin:0 auto; text-align:center}.imageflow .loading{border:1px solid white; height:15px; left:50%; margin-left:-106px; padding:5px; position:relative; visibility:visible; width:200px}.imageflow .loading_bar{background:#fff; height:15px; visibility:visible; width:1%}.imageflow .navigation{z-index:10000}.imageflow .caption{font-weight:bold; position:relative; text-align:center; z-index:10001}.imageflow .scrollbar{border-bottom:1px solid #b3b3b3; position:relative; visibility:hidden; z-index:10002; height:1px}.imageflow .slider{background:url(slider.png) no-repeat; height:14px; margin:-6px 0 0 -7px; position:absolute; width:14px; z-index:10003}.imageflow .slideshow{cursor:pointer; height:14px; margin:20px 0 0 20px; position:absolute; width:14px; z-index:10003}.imageflow .slideshow.pause{background:url(button_pause.png) no-repeat}.imageflow .slideshow.play{background:url(button_play.png) no-repeat}.imageflow .images{overflow:hidden; white-space:nowrap}.imageflow .button{cursor:pointer; height:17px; position:relative; width:17px}.imageflow .previous{background:url(button_left.png) top left no-repeat; float:left; margin:-7px 0 0 -30px}.imageflow .next{background:url(button_right.png) top left no-repeat; float:right; margin:-7px -30px 0 30px}} \ No newline at end of file diff --git a/js/imageflow.js b/js/imageflow.js deleted file mode 100644 index f283c760..00000000 --- a/js/imageflow.js +++ /dev/null @@ -1,437 +0,0 @@ -/** - * ImageFlow 0.9 - * - * This code is based on Michael L. Perrys Cover flow in Javascript. - * For he wrote that "You can take this code and use it as your own" [1] - * this is my attempt to improve some things. Feel free to use it! If - * you have any questions on it leave me a message in my shoutbox [2]. - * - * The reflection is generated server-sided by a slightly hacked - * version of Richard Daveys easyreflections [3] written in PHP. - * - * The mouse wheel support is an implementation of Adomas Paltanavicius - * JavaScript mouse wheel code [4]. - * - * Thanks to Stephan Droste ImageFlow is now compatible with Safari 1.x. - * - * - * [1] http://www.adventuresinsoftware.com/blog/?p=104#comment-1981 - * [2] http://shoutbox.finnrudolph.de/ - * [3] http://reflection.corephp.co.uk/v2.php - * [4] http://adomas.org/javascript-mouse-wheel/ - */ - - -/* Configuration variables */ -var conf_reflection_p = 0.0; // Sets the height of the reflection in % of the source image -var conf_focus = 4; // Sets the numbers of images on each side of the focussed one -var conf_slider_width = 14; // Sets the px width of the slider div -var conf_images_cursor = 'pointer'; // Sets the cursor type for all images default is 'default' -var conf_slider_cursor = 'default'; // Sets the slider cursor type: try "e-resize" default is 'default' - -/* Id names used in the HTML */ -var conf_imageflow = 'imageflow'; // Default is 'imageflow' -var conf_loading = 'loading'; // Default is 'loading' -var conf_images = 'images'; // Default is 'images' -var conf_captions = 'captions'; // Default is 'captions' -var conf_scrollbar = 'scrollbar'; // Default is 'scrollbar' -var conf_slider = 'slider'; // Default is 'slider' - -/* Define global variables */ -var caption_id = 0; -var new_caption_id = 0; -var current = 0; -var target = 0; -var mem_target = 0; -var timer = 0; -var array_images = new Array(); -var new_slider_pos = 0; -var dragging = false; -var dragobject = null; -var dragx = 0; -var posx = 0; -var new_posx = 0; -var xstep = 150; - - -function step() -{ - switch (target < current-1 || target > current+1) - { - case true: - moveTo(current + (target-current)/3); - window.setTimeout(step, 50); - timer = 1; - break; - - default: - timer = 0; - break; - } -} - -function glideTo(x, new_caption_id) -{ - /* Animate gliding to new x position */ - target = x; - mem_target = x; - if (timer == 0) - { - window.setTimeout(step, 50); - timer = 1; - } - - /* Display new caption */ - caption_id = new_caption_id; - caption = img_div.childNodes.item(array_images[caption_id]).getAttribute('alt'); - if (caption == '') caption = ' '; - caption_div.innerHTML = caption; - - /*swatchImg() */ - currentImg=caption_id; - - /* Set scrollbar slider to new position */ - if (dragging == false) - { - new_slider_pos = (scrollbar_width * (-(x*100/((max-1)*xstep))) / 100) - new_posx; - slider_div.style.marginLeft = (new_slider_pos - conf_slider_width) + 'px'; - } -} - -function moveTo(x) -{ - current = x; - var zIndex = max; - - /* Main loop */ - for (var index = 0; index < max; index++) - { - var image = img_div.childNodes.item(array_images[index]); - var current_image = index * -xstep; - - /* Don't display images that are not conf_focussed */ - if ((current_image+max_conf_focus) < mem_target || (current_image-max_conf_focus) > mem_target) - { - image.style.visibility = 'hidden'; - image.style.display = 'none'; - } - else - { - var z = Math.sqrt(10000 + x * x) + 100; - var xs = x / z * size + size; - - /* Still hide images until they are processed, but set display style to block */ - image.style.display = 'block'; - - /* Process new image height and image width */ - var new_img_h = (image.h / image.w * image.pc) / z * size; - switch ( new_img_h > max_height ) - { - case false: - var new_img_w = image.pc / z * size; - break; - - default: - new_img_h = max_height; - var new_img_w = image.w * new_img_h / image.h; - break; - } - var new_img_top = (images_width * 0.34 - new_img_h) + images_top + ((new_img_h / (conf_reflection_p + 1)) * conf_reflection_p); - - /* Set new image properties */ - image.style.left = xs - (image.pc / 2) / z * size + images_left + 'px'; - if(new_img_w && new_img_h) - { - image.style.height = new_img_h + 'px'; - image.style.width = new_img_w + 'px'; - image.style.top = new_img_top + 'px'; - } - image.style.visibility = 'visible'; - - /* Set image layer through zIndex */ - switch ( x < 0 ) - { - case true: - zIndex++; - break; - - default: - zIndex = zIndex - 1; - break; - } - - /* Change zIndex and onclick function of the focussed image */ - switch ( image.i == caption_id ) - { - case false: - image.onclick = function() { glideTo(this.x_pos, this.i); } - break; - - default: - zIndex = zIndex + 1; - image.onclick = function() { document.location = this.url; } - break; - } - image.style.zIndex = zIndex; - } - x += xstep; - } -} - -/* Main function */ -function refresh(onload) -{ - /* Cache document objects in global variables */ - imageflow_div = document.getElementById(conf_imageflow); - img_div = document.getElementById(conf_images); - scrollbar_div = document.getElementById(conf_scrollbar); - slider_div = document.getElementById(conf_slider); - caption_div = document.getElementById(conf_captions); - - /* Cache global variables, that only change on refresh */ - images_width = img_div.offsetWidth; - images_top = imageflow_div.offsetTop; - images_left = imageflow_div.offsetLeft; - max_conf_focus = conf_focus * xstep; - size = images_width * 0.5; - scrollbar_width = images_width * 0.6; - conf_slider_width = conf_slider_width * 0.5; - max_height = images_width * 0.51; - - /* Change imageflow div properties */ -// imageflow_div.style.height = max_height + 'px'; - - /* Change images div properties */ - img_div.style.height = images_width * 0.338 + 'px'; - - /* Change captions div properties */ - caption_div.style.width = images_width + 'px'; - caption_div.style.marginTop = images_width * 0.03 + 'px'; - caption_div.style.marginTop = images_width * 0.06 + 'px'; - caption_div.style.marginTop = 20 + 'px'; - - /* Change scrollbar div properties */ - scrollbar_div.style.marginTop = images_width * 0.02 + 'px'; - scrollbar_div.style.marginTop = 15 + 'px'; - scrollbar_div.style.marginLeft = images_width * 0.2 + 'px'; - scrollbar_div.style.width = scrollbar_width + 'px'; - - /* Set slider attributes */ - slider_div.onmousedown = function () { dragstart(this); }; - slider_div.style.cursor = conf_slider_cursor; - - /* Cache EVERYTHING! */ - max = img_div.childNodes.length; - var i = 0; - for (var index = 0; index < max; index++) - { - var image = img_div.childNodes.item(index); - if (image.nodeType == 1) - { - array_images[i] = index; - - /* Set image onclick by adding i and x_pos as attributes! */ - image.onclick = function() { glideTo(this.x_pos, this.i); } - image.x_pos = (-i * xstep); - image.i = i; - - /* Add width and height as attributes ONLY once onload */ - if(onload == true) - { - image.w = slideshowImages[i][2]; - image.h = slideshowImages[i][3]; - } - - /* Check source image format. Get image height minus reflection height! */ - switch ((image.w + 1) > (image.h / (conf_reflection_p + 1))) - { - /* Landscape format */ - case true: - image.pc = 155; - break; - - /* Portrait and square format */ - default: - image.pc = 112; - image.pc = 92; - break; - } - - /* Set ondblclick event */ - image.url = image.getAttribute('longdesc'); - image.ondblclick = function() { document.location = this.url; } - - /* Set image cursor type */ - image.style.cursor = conf_images_cursor; - - i++; - } - } - max = array_images.length; - - /* Display images in current order */ - moveTo(current); - glideTo(current, caption_id); -} - -/* Show/hide element functions */ -function iShow(id) -{ - var element = document.getElementById(id); - element.style.visibility = 'visible'; -} -function iHide(id) -{ - var element = document.getElementById(id); - element.style.visibility = 'hidden'; - element.style.display = 'none'; -} - -/* Hide loading bar, show content and initialize mouse event listening after loading */ -window.onload = function() -{ - if(document.getElementById(conf_imageflow)) - { - iHide(conf_loading); - refresh(true); - iShow(conf_images); - iShow(conf_scrollbar); - initMouseWheel(); - initMouseDrag(); - } -} - -/* Refresh ImageFlow on window resize */ -window.onresize = function() -{ - if(document.getElementById(conf_imageflow)) refresh(); -} - -/* Fixes the back button issue */ -window.onunload = function() -{ - document = null; -} - - -/* Handle the wheel angle change (delta) of the mouse wheel */ -function handle(delta) -{ - var change = false; - switch (delta > 0) - { - case true: - if(caption_id >= 1) - { - target = target + xstep; - new_caption_id = caption_id - 1; - change = true; - } - break; - - default: - if(caption_id < (max-1)) - { - target = target - xstep; - new_caption_id = caption_id + 1; - change = true; - } - break; - } - - /* Glide to next (mouse wheel down) / previous (mouse wheel up) image */ - if (change == true) - { - glideTo(target, new_caption_id); - } -} - -/* Event handler for mouse wheel event */ -function wheel(event) -{ - var delta = 0; - if (!event) event = window.event; - if (event.wheelDelta) - { - delta = event.wheelDelta / 120; - } - else if (event.detail) - { - delta = -event.detail / 3; - } - if (delta) handle(delta); - if (event.preventDefault) event.preventDefault(); - event.returnValue = false; -} - -/* Initialize mouse wheel event listener */ -function initMouseWheel() -{ - if(window.addEventListener) imageflow_div.addEventListener('DOMMouseScroll', wheel, false); - imageflow_div.onmousewheel = wheel; -} - -/* This function is called to drag an object (= slider div) */ -function dragstart(element) -{ - dragobject = element; - dragx = posx - dragobject.offsetLeft + new_slider_pos; -} - -/* This function is called to stop dragging an object */ -function dragstop() -{ - dragobject = null; - dragging = false; -} - -/* This function is called on mouse movement and moves an object (= slider div) on user action */ -function drag(e) -{ - posx = document.all ? window.event.clientX : e.pageX; - if(dragobject != null) - { - dragging = true; - new_posx = (posx - dragx) + conf_slider_width; - - /* Make sure, that the slider is moved in proper relation to previous movements by the glideTo function */ - if(new_posx < ( - new_slider_pos)) new_posx = - new_slider_pos; - if(new_posx > (scrollbar_width - new_slider_pos)) new_posx = scrollbar_width - new_slider_pos; - - var slider_pos = (new_posx + new_slider_pos); - var step_width = slider_pos / ((scrollbar_width) / (max-1)); - var image_number = Math.round(step_width); - var new_target = (image_number) * -xstep; - var new_caption_id = image_number; - - dragobject.style.left = new_posx + 'px'; - glideTo(new_target, new_caption_id); - } -} - -/* Initialize mouse event listener */ -function initMouseDrag() -{ - document.onmousemove = drag; - document.onmouseup = dragstop; - - /* Avoid text and image selection while dragging */ - document.onselectstart = function () - { - if (dragging == true) - { - return false; - } - else - { - return true; - } - } -} - -function getKeyCode(event) -{ - event = event || window.event; - return event.keyCode; -} - diff --git a/js/imageflow.packed.js b/js/imageflow.packed.js new file mode 100644 index 00000000..dc3f1017 --- /dev/null +++ b/js/imageflow.packed.js @@ -0,0 +1,38 @@ +/* +Name: ImageFlow +Version: 1.3.0 (March 9 2010) +Author: Finn Rudolph +Support: http://finnrudolph.de/ImageFlow + +License: ImageFlow is licensed under a Creative Commons + Attribution-Noncommercial 3.0 Unported License + (http://creativecommons.org/licenses/by-nc/3.0/). + + You are free: + + to Share - to copy, distribute and transmit the work + + to Remix - to adapt the work + + Under the following conditions: + + Attribution. You must attribute the work in the manner specified by the author or licensor + (but not in any way that suggests that they endorse you or your use of the work). + + Noncommercial. You may not use this work for commercial purposes. + + + For any reuse or distribution, you must make clear to others the license terms of this work. + + Any of the above conditions can be waived if you get permission from the copyright holder. + + Nothing in this license impairs or restricts the author's moral rights. + +Credits: This script is based on Michael L. Perrys Cover flow in Javascript [1]. + The reflections are generated server-sided by a slightly hacked version + of Richard Daveys easyreflections [2] written in PHP. The mouse wheel + support is an implementation of Adomas Paltanavicius JavaScript mouse + wheel code [3]. It also uses the domReadyEvent from Tanny O'Haley [4]. + + [1] http://www.adventuresinsoftware.com/blog/?p=104#comment-1981 + [2] http://reflection.corephp.co.uk/v2.php + [3] http://adomas.org/javascript-mouse-wheel/ + [4] http://tanny.ica.com/ICA/TKO/tkoblog.nsf/dx/domcontentloaded-for-browsers-part-v +*/ + +/* ImageFlow - compressed with http://dean.edwards.name/packer/ */ +eval(function(p,a,c,k,e,r){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('v 4Z(){u.2v={3Q:50,2N:1.5a,2J:y,30:C,1a:y,3j:\'1E\',S:\'5u\',2h:1.0,J:4,33:\'\',2f:C,3a:0.49,36:1.0,2z:v(){B.3V=u.2i},1Y:y,1T:[10,8,6,4,2],2x:5t,2y:1d,3e:C,2M:C,3G:\'\',1N:0.5,31:y,3L:\'\',3u:0.6,2G:C,2X:\'e-5m\',1q:14,1y:y,34:5n,3k:y,3r:1,3D:C,3H:y,1g:4w};9 t=u;u.X=v(a){17(9 b 3T t.2v){u[b]=(a!==1t&&a[b]!==1t)?a[b]:t.2v[b]}9 c=B.R(t.S);7(c){c.A.1H=\'2g\';u.N=c;7(u.3N()){u.H=B.R(t.S+\'5j\');u.2j=B.R(t.S+\'4z\');u.1V=B.R(t.S+\'3X\');u.1B=B.R(t.S+\'4c\');u.1R=B.R(t.S+\'4f\');u.3x=B.R(t.S+\'4j\');u.3l=B.R(t.S+\'4s\');u.1L=B.R(t.S+\'5e\');u.1M=[];u.1w=0;u.E=0;u.1C=0;u.1D=0;u.2q=C;u.2s=C;u.T=y;9 d=u.N.3F;9 e=W.11(d/t.2N);B.R(t.S+\'2A\').A.3b=((e*0.5)-22)+\'M\';c.A.1c=e+\'M\';u.21()}}};u.3N=v(){9 a=t.D.U(\'12\',\'23\');9 b,2S,1l,15;9 c=t.N.F.1r;17(9 d=0;d1){9 i;17(i=0;i1){t.1e.X();t.I.X();t.K.X();t.2o.X();7(t.1y){t.P.X()}7(t.2G){t.1B.A.1H=\'2g\'}}}};u.2Y=v(){9 a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J)+\'M\'}x+=t.1g}};u.1J=v(a){9 b,1v;7(t.1a){7(a+1===t.J){1v=t.O-t.J;b=-1v*t.1g;a=1v-1}7(a===(t.O-t.J)){1v=t.J-1;b=-1v*t.1g;a=1v+1}}9 x=-a*t.1g;u.1C=x;u.1D=x;u.E=a;9 c=t.H.F[a].1z(\'4v\');7(c===\'\'||t.30===y){c=\'&56;\'}t.2j.4e=c;7(t.I.T===y){7(t.1a){u.1b=((a-t.J)*t.1f)/(t.O-(t.J*2)-1)-t.I.2k}G{u.1b=(a*t.1f)/(t.O-1)-t.I.2k}t.1R.A.2R=(t.1b-t.1q)+\'M\'}7(t.1Y===C||t.2h!==t.2v.2h){t.D.27(t.H.F[a],t.1T[0]);t.H.F[a].1j=t.H.F[a].1j*t.2h;9 d=0;9 e=0;9 f=0;9 g=t.1T.1r;17(9 i=1;i<(t.J+1);i++){7((i+1)>g){d=t.1T[g-1]}G{d=t.1T[i]}e=a+i;f=a-i;7(e=0){t.D.27(t.H.F[f],d);t.H.F[f].1j=t.H.F[f].26}}}7(b){t.1K(b)}7(t.T===y){t.T=C;t.2E()}};u.2E=v(){1G(t.1Ct.1w+1){1x C:t.1K(t.1w+(t.1C-t.1w)/3);L.1n(t.2E,t.3Q);t.T=C;13;1E:t.T=y;13}};u.2l=v(a){7(t.1y){t.P.2c()}t.1J(a)};u.P={2n:1,X:v(){(t.3k)?t.P.1p():t.P.1h()},2c:v(){t.D.2L(t.N,\'3m\',t.P.2c);t.P.1h()},3o:v(){t.D.16(t.N,\'3m\',t.P.2c)},1p:v(){t.D.25(t.1L,\'1y 43\');t.1L.1k=v(){t.P.1h()};t.P.3t=L.47(t.P.2P,t.34);L.1n(t.P.3o,1d)},1h:v(){t.D.25(t.1L,\'1y 4b\');t.1L.1k=v(){t.P.1p()};L.4d(t.P.3t)},2P:v(){9 a=t.E+t.P.2n;9 b=y;7(a===t.O){t.P.2n=-1;b=C}7(a<0){t.P.2n=1;b=C}(b)?t.P.2P():t.1J(a)}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.K.3w&&t.K.3f(e)){9 a=(t.1a)?(t.O-(t.J*2)-1):(t.O-1);7(t.K.2F){t.K.2r=(a-t.E)*(t.Y/a);t.K.2F=y}9 b=-(t.K.2C(e)-t.K.2B-t.K.2r);7(b<0){b=0}7(b>t.Y){b=t.Y}t.K.x=b;9 c=W.11(b/(t.Y/a));c=a-c;7(t.E!==c){7(t.1a){c=c+t.J}t.2l(c)}t.D.2p(e)}},1h:v(){t.K.2r=t.K.x;t.K.T=y}};u.2o={X:v(){B.5d=v(a){t.2o.19(a)}},19:v(a){9 b=t.2o.1W(a);1G(b){1x 39:t.1e.19(-1);13;1x 37:t.1e.19(1);13}},1W:v(a){a=a||L.1F;V a.5h}};u.D={16:v(a,b,c){7(a.1m){a.1m(b,c,y)}G 7(a.3g){a["e"+b+c]=c;a[b+c]=v(){a["e"+b+c](L.1F)};a.3g("3y"+b,a[b+c])}},2L:v(a,b,c){7(a.32){a.32(b,c,y)}G 7(a.3A){7(a[b+c]===1t){5r(\'D.2L » 4G 3i 3C 1F 48 1t - 4K 4l 4M 42 3i 3C 4N 4n 1F?\')}a.3A(\'3y\'+b,a[b+c]);a[b+c]=Z;a[\'e\'+b+c]=Z}},27:v(a,b){7(t.1Y===C){a.A.1Y=b/10;a.A.4P=\'4a(1Y=\'+b*10+\')\'}},U:v(a,b,c){9 d=B.4R(a);d.2d(\'38\',t.S+\'4T\'+b);7(c!==1t){b+=\' \'+c}t.D.25(d,b);V d},25:v(a,b){7(a){a.2d(\'3Z\',b);a.2d(\'4V\',b)}},2p:v(e){7(e.3E){e.3E()}G{e.4X=y}V y},3c:v(){9 a=L.2t;7(1X L.2t!=\'v\'){L.2t=v(){t.2m()}}G{L.2t=v(){7(a){a()}t.2m()}}}}}9 1i={2Q:"1i",1S:{},1s:1,1Q:y,2O:Z,3n:v(a){7(!a.$$1s){a.$$1s=u.1s++;7(u.1Q){a()}u.1S[a.$$1s]=a}},58:v(a){7(a.$$1s){4x u.1S[a.$$1s]}},18:v(){7(u.1Q){V}u.1Q=C;17(9 i 3T u.1S){u.1S[i]()}},2w:v(){7(u.1Q){V}7(/5c|4y/i.3O(4g.5f)){7(/4A|2I/.3O(B.3p)){u.18()}G{1n(u.2Q+".2w()",1d)}}G 7(B.R("2V")){V C}7(1X u.2O==="v"){7(1X B.2W!==\'1t\'&&(B.2W(\'2K\')[0]!==Z||B.2K!==Z)){7(u.2O()){u.18()}G{1n(u.2Q+".2w()",4C)}}}V C},X:v(){7(B.1m){B.1m("5k",v(){1i.18()},y)}1n("1i.2w()",1d);v 18(){1i.18()}7(1X 16!=="1t"){16(L,"3R",18)}G 7(B.1m){B.1m("3R",18,y)}G 7(1X L.2a==="v"){9 a=L.2a;L.2a=v(){1i.18();a()}}G{L.2a=18}/*@4E@7(@5o||@3Y)B.44("<3U 38=2V 54 1l=\\"//:\\"><\\/3U>");9 b=B.R("2V");b.59=v(){7(u.3p=="2I"){1i.18()}};@5b@*/}};9 5l=v(a){1i.3n(a)};1i.X();',62,342,'|||||||if||var|||||||||||||||||||||this|function|||false||style|document|true|Helper|imageID|childNodes|else|imagesDiv|MouseDrag|imageFocusMax|Touch|window|px|ImageFlowDiv|max|Slideshow|appendChild|getElementById|ImageFlowID|busy|createDocumentElement|return|Math|init|imagesDivWidth|null||round|div|break||imageNode|addEvent|for|run|handle|circular|newSliderX|height|100|MouseWheel|scrollbarWidth|xStep|stop|domReadyEvent|pc|onclick|src|addEventListener|setTimeout|zIndex|start|sliderWidth|length|domReadyID|undefined|width|clonedImageID|current|case|slideshow|getAttribute|maxHeight|scrollbarDiv|target|memTarget|default|event|switch|visibility|size|glideTo|moveTo|buttonSlideshow|indexArray|reflectionP|cloneNode|object|bDone|sliderDiv|events|opacityArray|maxFocus|navigationDiv|get|typeof|opacity|display|completed|loadingProgress||images|nodeType|setClassName|pcMem|setOpacity|touches|nodeName|onload|IMG|interrupt|setAttribute|mouseX|imageScaling|visible|imageFocusM|url|captionDiv|newX|glideOnEvent|refresh|direction|Key|suppressBrowserDefault|firstRefresh|stopX|firstCheck|onresize|imagesDivHeight|defaults|schedule|percentLandscape|percentOther|onClick|_loading_txt|startX|getX|pageX|animate|first|slider|none|complete|buttons|body|removeEvent|reflections|aspectRatio|DOMContentLoadedCustom|slide|name|marginLeft|version|objectX|maxId|__ie_onload|getElementsByTagName|sliderCursor|loadingStatus|left|captions|reflectionPNG|removeEventListener|imagePath|slideshowSpeed|button|imagesM||id||imagesHeight|paddingTop|addResizeEvent|scrollLeft|preloadImages|isOnNavigationDiv|attachEvent|createTextNode|to|imageCursor|slideshowAutoplay|buttonPreviousDiv|click|add|addInterruptEvent|readyState|02|startID|cursor|action|scrollbarP|loading|isBusy|buttonNextDiv|on|wheelDelta|detachEvent|detail|detach|glideToStartID|preventDefault|offsetWidth|reflectionGET|startAnimation|offsetLeft|totalImagesWidth|drag|reflectPath|mouseup|createStructure|test|clientX|animationSpeed|load|hidden|in|script|location|reflect|_navigation|_win64|class||next|trying|pause|write|php|navigation|setInterval|is|67|alpha|play|_scrollbar|clearInterval|innerHTML|_slider|navigator|DOMMouseScroll|firstChild|_next|mousewheel|you|marginTop|unattached|loading_bar|10000|120|block|_previous|previous|onmousedown|alt|150|delete|WebKit|_caption|loaded|mousemove|250|longdesc|cc_on|xPosition|Pointer|onselectstart|sqrt|caption|perhaps|_loading|are|an|position|filter|documentElement|createElement|relative|_|inline|className|1000|returnValue|touchstart|ImageFlow||touchmove|loading_txt|touchend|defer|paddingLeft|nbsp|scrollbar|remove|onreadystatechange|964|end|KHTML|onkeydown|_slideshow|userAgent|_loading_bar|keyCode|replaceChild|_images|DOMContentLoaded|domReady|resize|1500|_win32|img|removeChild|alert|top|118|imageflow|5000'.split('|'),0,{})); + diff --git a/js/pear.js b/js/pear.js index 773900e1..c342e33b 100644 --- a/js/pear.js +++ b/js/pear.js @@ -265,7 +265,7 @@ function bodyLoad(viewMode, bgcolor) { checkCookie(); } $('#loading').hide(); - //window.setTimeout("preFetch()", 500); + window.setTimeout("preFetch()", 500); setKeys(); } @@ -273,7 +273,7 @@ function switchToGrid() { toggleReflex(true); $('#pearImageFlow').hide(); - $('#ContentAlbum').show(); + $('#mosaicTable').show(); if(!$('#mosaicGridContainer').length) return; mosaicView=false; maxSize=225; @@ -290,7 +290,7 @@ function switchToMosaic() { toggleReflex(false); $('#pearImageFlow').hide(); //.hide(); - $('#ContentAlbum').show(); + $('#mosaicTable').show(); if(!$('#mosaicGridContainer').length) return; mosaicView=true; maxSize=125; @@ -354,24 +354,26 @@ function focusImage(id) updateHash(); $.get(slideshowImages[currentImg][1]); } - +var pearCarousel; function startImageFlow() { - var objBody = $('gsContent'); - $('ContentAlbum').hide(); - if ( document.getElementById('pearImageFlow') ) { - objBody.removeChild( document.getElementById('pearImageFlow') ); - } - var objSlide = new Element('div', {'id': 'pearImageFlow'}); + $('#mosaicTable').hide(); - objSlide.update('
'); - objBody.appendChild(objSlide); + $('#pearImageFlow').show(); toggleReflex(true); - for (var i = 0; i < slideshowImages.length; i++) { - $('images').insert(new Element('img', {'src': slideshowImages[i][0],'longdesc': 'javascript:focusImage(\''+i+'\');', 'alt': document.getElementById('mosaicGridContainer').getElementsByTagName('img')[i].getAttribute('alt')})); - } + for (var i = 0; i < slideshowImages.length; i++) { + var img = '
'+$('#mosaicGridContainer img').eq(i).attr('alt')+'"
'; + var img = ''+slideshowImages[i][4]+''; + console.log(img); + $('#pearImageFlow').append(img); + } + if(!pearCarousel){ + pearCarousel = new ImageFlow(); + pearCarousel.init({ImageFlowID: 'pearImageFlow', aspectRatio: 2.4, imagesHeight: 0.6, opacity: true, reflections: false, startID: currentImg, onClick: function() {focusImage($(this).attr('longdesc'));}, startAnimation: true, xStep: 200, imageFocusM: 1.7, imageFocusMax: 4, opacityArray: [10, 9, 6, 2], percentOther: 130, captions: false, slider: false}); + } +/* current=(currentImg)*-xstep; caption_id=currentImg; refresh(true); @@ -384,19 +386,19 @@ function startImageFlow() moveTo(current); glideTo(current, caption_id); - +*/ switchMode('carousel'); } function setKeys() { /* Fixes the back button issue */ - window.onunload = function() +/* window.onunload = function() { document = null; } - document.onkeydown = function(event) +*/ $(document).keydown(function(e) { - var charCode = getKeyCode(event); + var charCode = (e.keyCode ? e.keyCode: e.which); switch (charCode) { case 32: /* Space */ @@ -404,17 +406,15 @@ function setKeys() case 39: /* Right arrow key */ case 78: /* N */ swatchImg(currentImg+1); - if($('imageflow')) - handle(-1); + // if($('imageflow')) handle(-1); break; case 80: /* P */ case 37: /* Left arrow key */ swatchImg(currentImg-1); - if($('imageflow')) - handle(1); + // if($('imageflow')) handle(1); break; } - } + }); } function showHoverView(){ if(hideHoverV != null) clearTimeout(hideHoverV); @@ -434,9 +434,9 @@ function switchMode(mode){ function preFetch() { - for (var i = 0; i < slideshowImages.length; i++) { +/* for (var i = 0; i < slideshowImages.length; i++) { var tempImage = new Element('img', {'src': slideshowImages[i][0]}); - } + }*/ } function toggleReflex(hide) diff --git a/views/album.html.php b/views/album.html.php index 36eae1ff..1bd7ee27 100644 --- a/views/album.html.php +++ b/views/album.html.php @@ -86,3 +86,4 @@ endif; album_bottom() ?> paginator() ?> +
diff --git a/views/page.html.php b/views/page.html.php index 2f3a9d08..e04522d8 100644 --- a/views/page.html.php +++ b/views/page.html.php @@ -63,10 +63,12 @@ script("ui.init.js") ?> script("jquery.parsequery.js") ?> + script("imageflow.packed.js") ?> css("yui/reset-fonts-grids.css") ?> css("superfish/css/superfish.css") ?> css("themeroller/ui.base.css") ?> css("screen.css") ?> + css("imageflow.packed.css") ?>