# HG changeset patch # User Raphael Velt # Date 1330969271 -3600 # Node ID 0a2505c3b5470aef069beb048f462e714e6a4cc3 # Parent d824146a95893fceb6855a5b6e8be92d98e01aa5 New metadata player and big directory reorganization diff -r d824146a9589 -r 0a2505c3b547 web/common.php --- a/web/common.php Sun Mar 04 14:13:39 2012 +0100 +++ b/web/common.php Mon Mar 05 18:41:11 2012 +0100 @@ -174,41 +174,44 @@ $js_registry = array( 'local' => array( + 'libdir' => URL_ROOT.'res/js/', 'jquery' => URL_ROOT.'res/js/jquery-1.4.3.min.js', - 'raphael' => URL_ROOT.'res/raphael/raphael-min.js', + 'raphael' => URL_ROOT.'res/js/raphael.js', 'jquery-ui' => URL_ROOT.'res/js/jquery-ui-1.8.13.min.js', - 'niceforms' => URL_ROOT.'res/niceforms/niceforms.js', + 'niceforms' => URL_ROOT.'res/js/niceforms.js', 'jquery-url' => URL_ROOT.'res/js/jquery.url.js', 'ldtplayer' => URL_ROOT.'res/metadataplayer/src/js/LdtPlayer.js', - 'fancybox' => URL_ROOT.'res/jquery.fancybox/fancybox/jquery.fancybox-1.3.4.pack.js', - 'jquery-tools' => URL_ROOT.'res/metadataplayer/res/js/jquery.tools.min.js', + 'fancybox' => URL_ROOT.'res/js/fancybox/jquery.fancybox-1.3.4.pack.js', + 'jquery-tools' => URL_ROOT.'res/js/jquery.tools.min.js', 'tw-widget' => URL_ROOT.'res/js/tw_widget.js', - 'jquery-mousewheel' => URL_ROOT.'res/jquery.fancybox/fancybox/jquery.mousewheel-3.0.4.pack.js', - 'swfobject' => URL_ROOT.'res/metadataplayer/res/js/swfobject.js', - 'json-js' => URL_ROOT.'res/douglascrockford-JSON-js/json2.js', - 'underscore' => URL_ROOT.'res/underscore/underscore-min.js' , - 'jquery-scrollto'=>URL_ROOT.'res/jquery.scrollto/jquery.scrollTo-1.4.2-min.js' , - 'twcx-main' => URL_ROOT.'res/js-tweetcast/live-polemic.js' , - 'semanticboard' => URL_ROOT.'res/js-tweetcast/semanticboard.js' , - + 'jquery-mousewheel' => URL_ROOT.'res/js/jquery.mousewheel-3.0.4.pack.js', + 'swfobject' => URL_ROOT.'res/js/swfobject.js', + 'json-js' => URL_ROOT.'res/js/json2.js', + 'underscore' => URL_ROOT.'res/js/underscore-min.js' , + 'jquery-scrollto'=>URL_ROOT.'res/js/jquery.scrollTo-1.4.2-min.js' , + 'twcx-main' => URL_ROOT.'res/js/live-polemic.js' , + 'semanticboard' => URL_ROOT.'res/js/semanticboard.js' , + 'metadataplayer'=> URL_ROOT.'res/js/LdtPlayer-release.js' , ), 'cdn' => array( + 'libdir' => URL_ROOT.'res/js/', 'jquery' => 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js', - 'raphael' => URL_ROOT.'res/raphael/raphael-min.js', + 'raphael' => URL_ROOT.'res/js/raphael.js', 'jquery-ui' => 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/jquery-ui.min.js', - 'niceforms' => URL_ROOT.'res/niceforms/niceforms.js', + 'niceforms' => URL_ROOT.'res/js/niceforms.js', 'jquery-url' => URL_ROOT.'res/js/jquery.url.js', 'ldtplayer' => URL_ROOT.'res/metadataplayer/src/js/LdtPlayer.js', - 'fancybox' => URL_ROOT.'res/jquery.fancybox/fancybox/jquery.fancybox-1.3.4.pack.js', + 'fancybox' => URL_ROOT.'res/js/fancybox/jquery.fancybox-1.3.4.pack.js', 'jquery-tools' => 'http://cdn.jquerytools.org/1.2.4/all/jquery.tools.min.js', 'tw-widget' => 'http://widgets.twimg.com/j/2/widget.js', - 'jquery-mousewheel' => URL_ROOT.'res/jquery.fancybox/fancybox/jquery.mousewheel-3.0.4.pack.js', + 'jquery-mousewheel' => URL_ROOT.'res/js/jquery.mousewheel-3.0.4.pack.js', 'swfobject' => 'http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js', - 'json-js' => URL_ROOT.'res/douglascrockford-JSON-js/json2.js', - 'underscore' => URL_ROOT.'res/underscore/underscore-min.js' , - 'jquery-scrollto'=>URL_ROOT.'res/jquery.scrollto/jquery.scrollTo-1.4.2-min.js' , - 'twcx-main' => URL_ROOT.'res/js-tweetcast/live-polemic.js' , - 'semanticboard' => URL_ROOT.'res/js-tweetcast/semanticboard.js' , + 'json-js' => URL_ROOT.'res/js/json2.js', + 'underscore' => URL_ROOT.'res/js/underscore-min.js' , + 'jquery-scrollto'=>URL_ROOT.'res/js/jquery.scrollTo-1.4.2-min.js' , + 'twcx-main' => URL_ROOT.'res/js/live-polemic.js' , + 'semanticboard' => URL_ROOT.'res/js/semanticboard.js' , + 'metadataplayer'=> URL_ROOT.'res/js/LdtPlayer-release.js' , ) ); @@ -229,23 +232,24 @@ $css_registry = array( 'local' => array( - 'blueprint-screen' => URL_ROOT.'res/blueprint/screen.css', - 'blueprint-print' => URL_ROOT.'res/blueprint/print.css', - 'blueprint-ie' => URL_ROOT.'res/blueprint/ie.css', - 'blueprint-plugins-fancy-type' => URL_ROOT.'res/blueprint/plugins/fancy-type/screen.css', + 'blueprint-screen' => URL_ROOT.'res/css/blueprint-screen.css', + 'blueprint-print' => URL_ROOT.'res/css/blueprint-print.css', + 'blueprint-ie' => URL_ROOT.'res/css/blueprint-ie.css', + 'blueprint-plugins-fancy-type' => URL_ROOT.'res/css/blueprint-plugins/fancy-type/screen.css', 'custom' => URL_ROOT.'res/css/custom.css', - 'fancybox' => URL_ROOT.'res/jquery.fancybox/fancybox/jquery.fancybox-1.3.4.css', + 'fancybox' => URL_ROOT.'res/js/fancybox/jquery.fancybox-1.3.4.css', 'jquery-ui' => URL_ROOT.'res/metadataplayer/res/css/jq-css/themes/base/jquery-ui.css', 'tabs-slideshow' => URL_ROOT.'res/css/tabs-slideshow.css', 'tweetcast' => URL_ROOT.'res/css/tweetcast.css', 'semanticboard' => URL_ROOT.'res/css/semanticboard.css', 'archives-iframe' => URL_ROOT.'res/css/archives-iframe.css', + 'metadataplayer' => URL_ROOT.'res/css/metadataplayer/LdtPlayer.css', ), 'cdn' => array( - 'blueprint-screen' => URL_ROOT.'res/blueprint/screen.css', - 'blueprint-print' => URL_ROOT.'res/blueprint/print.css', - 'blueprint-ie' => URL_ROOT.'res/blueprint/ie.css', - 'blueprint-plugins-fancy-type' => URL_ROOT.'res/blueprint/plugins/fancy-type/screen.css', + 'blueprint-screen' => URL_ROOT.'res/css/blueprint-screen.css', + 'blueprint-print' => URL_ROOT.'res/css/blueprint-print.css', + 'blueprint-ie' => URL_ROOT.'res/css/blueprint-ie.css', + 'blueprint-plugins-fancy-type' => URL_ROOT.'res/css/blueprint-plugins/fancy-type/screen.css', 'custom' => URL_ROOT.'res/css/custom.css', 'fancybox' => URL_ROOT.'res/jquery.fancybox/fancybox/jquery.fancybox-1.3.4.css', 'jquery-ui' => "http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/themes/base/jquery-ui.css", @@ -253,6 +257,7 @@ 'tweetcast' => URL_ROOT.'res/css/tweetcast.css', 'semanticboard' => URL_ROOT.'res/css/semanticboard.css', 'archives-iframe' => URL_ROOT.'res/css/archives-iframe.css', + 'metadataplayer' => URL_ROOT.'res/css/metadataplayer/LdtPlayer.css', ) ); diff -r d824146a9589 -r 0a2505c3b547 web/polemicaltimeline.php --- a/web/polemicaltimeline.php Sun Mar 04 14:13:39 2012 +0100 +++ b/web/polemicaltimeline.php Mon Mar 05 18:41:11 2012 +0100 @@ -20,6 +20,10 @@ $tweet_explain_background = URL_ROOT.$rep.'/images/tweetExplainBgd.gif'; } +$head_logo = URL_ROOT."$rep/images/head_logo.gif"; +if($translate->_('config__head_logo') != 'config__head_logo' && $translate->_('config__head_logo') != null ) { + $head_logo = URL_ROOT."$rep/".$translate->_('config__head_logo'); +} $url = (!empty($_SERVER['HTTPS'])) ? "https://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'] : "http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; @@ -41,65 +45,26 @@ - - + - - - - - + ' rel='stylesheet' type='text/css'/> ' rel='stylesheet' type='text/css'/> - ' rel='stylesheet' type='text/css'/> - + - - @@ -174,54 +190,86 @@
-
-
-
-
- " class="logo"> - - - - - _('config__metadata'))): ?> - -
- * CSS - * #carousel - * { - * width: 700px; - * height: 150px; - * background-color: #111; - * position: absolute; - * top: 200px; - * left: 100px; - * } - * #carousel a - * { - * position: absolute; - * width: 110px; - * } - * - * @desc Creates a 3D carousel from all images inside div tag with id 'carousel' - * - * - * @name 3D Carousel - * @description Created a 3D Carousel from a list of images, with reflections and animated by mouse position - * @param Hash hash A hash of parameters - * @option String items items selection - * @option Integer itemWidth the max width for each item - * @option Integer itemHeight the max height for each item - * @option Integer itemMinWidth the minimum width for each item, the height is automaticaly calculated to keep proportions - * @option Float rotationSpeed the speed for rotation animation - * @option Float reflectionSize the reflection size a fraction from items' height - * - * @type jQuery - * @cat Plugins/Interface - * @author Stefan Petre - */ -jQuery.iCarousel = { - - build : function(options) - { - return this.each( - function() - { - var el = this; - var increment = 2*Math.PI/360; - var maxRotation = 2*Math.PI; - if(jQuery(el).css('position') != 'relative' && jQuery(el).css('position') != 'absolute') { - jQuery(el).css('position', 'relative'); - } - el.carouselCfg = { - items : jQuery(options.items, this), - itemWidth : options.itemWidth, - itemHeight : options.itemHeight, - itemMinWidth : options.itemMinWidth, - maxRotation : maxRotation, - size : jQuery.iUtil.getSize(this), - position : jQuery.iUtil.getPosition(this), - start : Math.PI/2, - rotationSpeed : options.rotationSpeed, - reflectionSize : options.reflections, - reflections : [], - protectRotation : false, - increment: 2*Math.PI/360 - }; - el.carouselCfg.radiusX = (el.carouselCfg.size.w - el.carouselCfg.itemWidth)/2; - el.carouselCfg.radiusY = (el.carouselCfg.size.h - el.carouselCfg.itemHeight - el.carouselCfg.itemHeight * el.carouselCfg.reflectionSize)/2; - el.carouselCfg.step = 2*Math.PI/el.carouselCfg.items.size(); - el.carouselCfg.paddingX = el.carouselCfg.size.w/2; - el.carouselCfg.paddingY = el.carouselCfg.size.h/2 - el.carouselCfg.itemHeight * el.carouselCfg.reflectionSize; - var reflexions = document.createElement('div'); - jQuery(reflexions) - .css( - { - position: 'absolute', - zIndex: 1, - top: 0, - left: 0 - } - ); - jQuery(el).append(reflexions); - el.carouselCfg.items - .each( - function(nr) - { - image = jQuery('img', this).get(0); - height = parseInt(el.carouselCfg.itemHeight*el.carouselCfg.reflectionSize); - if (jQuery.browser.msie) { - canvas = document.createElement('img'); - jQuery(canvas).css('position', 'absolute'); - canvas.src = image.src; - canvas.style.filter = 'flipv progid:DXImageTransform.Microsoft.Alpha(opacity=60, style=1, finishOpacity=0, startx=0, starty=0, finishx=0)'; - - } else { - canvas = document.createElement('canvas'); - if (canvas.getContext) { - context = canvas.getContext("2d"); - canvas.style.position = 'absolute'; - canvas.style.height = height +'px'; - canvas.style.width = el.carouselCfg.itemWidth+'px'; - canvas.height = height; - canvas.width = el.carouselCfg.itemWidth; - context.save(); - - context.translate(0,height); - context.scale(1,-1); - - context.drawImage( - image, - 0, - 0, - el.carouselCfg.itemWidth, - height - ); - - context.restore(); - - context.globalCompositeOperation = "destination-out"; - var gradient = context.createLinearGradient( - 0, - 0, - 0, - height - ); - - gradient.addColorStop(1, "rgba(255, 255, 255, 1)"); - gradient.addColorStop(0, "rgba(255, 255, 255, 0.6)"); - - context.fillStyle = gradient; - if (navigator.appVersion.indexOf('WebKit') != -1) { - context.fill(); - } else { - context.fillRect( - 0, - 0, - el.carouselCfg.itemWidth, - height - ); - } - } - } - - el.carouselCfg.reflections[nr] = canvas; - jQuery(reflexions).append(canvas); - } - ) - .bind( - 'mouseover', - function(e) - { - el.carouselCfg.protectRotation = true; - el.carouselCfg.speed = el.carouselCfg.increment*0.1 * el.carouselCfg.speed / Math.abs(el.carouselCfg.speed); - return false; - } - ) - .bind( - 'mouseout', - function(e) - { - el.carouselCfg.protectRotation = false; - return false; - } - ); - jQuery.iCarousel.positionItems(el); - el.carouselCfg.speed = el.carouselCfg.increment*0.2; - el.carouselCfg.rotationTimer = window.setInterval( - function() - { - el.carouselCfg.start += el.carouselCfg.speed; - if (el.carouselCfg.start > maxRotation) - el.carouselCfg.start = 0; - jQuery.iCarousel.positionItems(el); - }, - 20 - ); - jQuery(el) - .bind( - 'mouseout', - function() - { - el.carouselCfg.speed = el.carouselCfg.increment*0.2 * el.carouselCfg.speed / Math.abs(el.carouselCfg.speed); - } - ) - .bind( - 'mousemove', - function(e) - { - if (el.carouselCfg.protectRotation == false) { - pointer = jQuery.iUtil.getPointer(e); - mousex = el.carouselCfg.size.w - pointer.x + el.carouselCfg.position.x; - el.carouselCfg.speed = el.carouselCfg.rotationSpeed * el.carouselCfg.increment * (el.carouselCfg.size.w/2 - mousex) / (el.carouselCfg.size.w/2); - } - } - ); - } - ); - }, - - positionItems : function(el) - { - el.carouselCfg.items.each( - function (nr) - { - angle = el.carouselCfg.start+nr*el.carouselCfg.step; - x = el.carouselCfg.radiusX*Math.cos(angle); - y = el.carouselCfg.radiusY*Math.sin(angle) ; - itemZIndex = parseInt(100*(el.carouselCfg.radiusY+y)/(2*el.carouselCfg.radiusY)); - parte = (el.carouselCfg.radiusY+y)/(2*el.carouselCfg.radiusY); - - width = parseInt((el.carouselCfg.itemWidth - el.carouselCfg.itemMinWidth) * parte + el.carouselCfg.itemMinWidth); - height = parseInt(width * el.carouselCfg.itemHeight / el.carouselCfg.itemWidth); - this.style.top = el.carouselCfg.paddingY + y - height/2 + "px"; - this.style.left = el.carouselCfg.paddingX + x - width/2 + "px"; - this.style.width = width + "px"; - this.style.height = height + "px"; - this.style.zIndex = itemZIndex; - el.carouselCfg.reflections[nr].style.top = parseInt(el.carouselCfg.paddingY + y + height - 1 - height/2) + "px"; - el.carouselCfg.reflections[nr].style.left = parseInt(el.carouselCfg.paddingX + x - width/2) + "px"; - el.carouselCfg.reflections[nr].style.width = width + "px"; - el.carouselCfg.reflections[nr].style.height = parseInt(height * el.carouselCfg.reflectionSize) + "px"; - } - ); - } -}; -jQuery.fn.Carousel = jQuery.iCarousel.build; \ No newline at end of file diff -r d824146a9589 -r 0a2505c3b547 web/res/metadataplayer/test/interface 1.2/source/easing.js --- a/web/res/metadataplayer/test/interface 1.2/source/easing.js Sun Mar 04 14:13:39 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,124 +0,0 @@ -/** - * Interface Elements for jQuery - * Easing formulas - * - * http://interface.eyecon.ro - * - * Copyright (c) 2006 Stefan Petre - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - */ - -/** - * Starting with jQuery 1.1 the fx function accepts easing formulas that can be used with .animation() and most of FX plugins from Interface. The object can be extended to accept new easing formulas - */ - - jQuery.extend({ - /** - * - * @param Integer p period step in animation - * @param Integer n current time - * @param Mixed firstNum begin value - * @param Mixed delta change in - * @param Integer duration duration - */ - easing : { - linear: function(p, n, firstNum, delta, duration) { - return ((-Math.cos(p*Math.PI)/2) + 0.5) * delta + firstNum; - }, - - easein: function(p, n, firstNum, delta, duration) { - return delta*(n/=duration)*n*n + firstNum; - }, - - easeout: function(p, n, firstNum, delta, duration) { - return -delta * ((n=n/duration-1)*n*n*n - 1) + firstNum; - }, - - easeboth: function(p, n, firstNum, delta, duration) { - if ((n/=duration/2) < 1) - return delta/2*n*n*n*n + firstNum; - return -delta/2 * ((n-=2)*n*n*n - 2) + firstNum; - }, - - bounceout: function(p, n, firstNum, delta, duration) { - if ((n/=duration) < (1/2.75)) { - return delta*(7.5625*n*n) + firstNum; - } else if (n < (2/2.75)) { - return delta*(7.5625*(n-=(1.5/2.75))*n + .75) + firstNum; - } else if (n < (2.5/2.75)) { - return delta*(7.5625*(n-=(2.25/2.75))*n + .9375) + firstNum; - } else { - return delta*(7.5625*(n-=(2.625/2.75))*n + .984375) + firstNum; - } - }, - - bouncein: function(p, n, firstNum, delta, duration) { - if (jQuery.easing.bounceout) - return delta - jQuery.easing.bounceout (p, duration - n, 0, delta, duration) + firstNum; - return firstNum + delta; - }, - - bounceboth: function(p, n, firstNum, delta, duration) { - if (jQuery.easing.bouncein && jQuery.easing.bounceout) - if (n < duration/2) - return jQuery.easing.bouncein(p, n*2, 0, delta, duration) * .5 + firstNum; - return jQuery.easing.bounceout(p, n*2-duration, 0, delta, duration) * .5 + delta*.5 + firstNum; - return firstNum + delta; - }, - - elasticin: function(p, n, firstNum, delta, duration) { - var a, s; - if (n == 0) - return firstNum; - if ((n/=duration)==1) - return firstNum+delta; - a = delta * 0.3; - p=duration*.3; - if (a < Math.abs(delta)) { - a=delta; - s=p/4; - } else { - s = p/(2*Math.PI) * Math.asin (delta/a); - } - return -(a*Math.pow(2,10*(n-=1)) * Math.sin( (n*duration-s)*(2*Math.PI)/p )) + firstNum; - }, - - elasticout:function(p, n, firstNum, delta, duration) { - var a, s; - if (n==0) - return firstNum; - if ((n/=duration/2)==2) - return firstNum + delta; - a = delta * 0.3; - p=duration*.3; - if (a < Math.abs(delta)){ - a = delta; - s=p/4; - } else { - s = p/(2*Math.PI) * Math.asin (delta/a); - } - return a*Math.pow(2,-10*n) * Math.sin( (n*duration-s)*(2*Math.PI)/p ) + delta + firstNum; - }, - - elasticboth: function(p, n, firstNum, delta, duration) { - var a, s; - if (n==0) - return firstNum; - if ((n/=duration/2)==2) - return firstNum + delta; - a = delta * 0.3; - p=duration*.3; - if (a < Math.abs(delta)){ - a = delta; - s=p/4; - } else { - s = p/(2*Math.PI) * Math.asin (delta/a); - } - if (n < 1) { - return -.5*(a*Math.pow(2,10*(n-=1)) * Math.sin( (n*duration-s)*(2*Math.PI)/p )) + firstNum; - } - return a*Math.pow(2,-10*(n-=1)) * Math.sin( (n*duration-s)*(2*Math.PI)/p )*.5 + delta + firstNum; - } - } -}); \ No newline at end of file diff -r d824146a9589 -r 0a2505c3b547 web/res/metadataplayer/test/interface 1.2/source/fisheye.js --- a/web/res/metadataplayer/test/interface 1.2/source/fisheye.js Sun Mar 04 14:13:39 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,142 +0,0 @@ -/** - * Interface Elements for jQuery - * Fisheye menu - * - * http://interface.eyecon.ro - * - * Copyright (c) 2006 Stefan Petre - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - */ - -/** - * Build a Fisheye menu from a list of links - * - * @name Fisheye - * @description Build a Fisheye menu from a list of links - * @param Hash hash A hash of parameters - * @option String items items selection - * @option String container container element - * @option Integer itemWidth the minimum width for each item - * @option Integer maxWidth the maximum width for each item - * @option String itemsText selection of element that contains the text for each item - * @option Integer proximity the distance from element that make item to interact - * @option String valign vertical alignment - * @option String halign horizontal alignment - * - * @type jQuery - * @cat Plugins/Interface - * @author Stefan Petre - */ -jQuery.iFisheye = { - - build : function(options) - { - - return this.each( - function() - { - var el = this; - el.fisheyeCfg = { - items : jQuery(options.items, this), - container: jQuery(options.container, this), - pos : jQuery.iUtil.getPosition(this), - itemWidth: options.itemWidth, - itemsText: options.itemsText, - proximity: options.proximity, - valign: options.valign, - halign: options.halign, - maxWidth : options.maxWidth - }; - jQuery.iFisheye.positionContainer(el, 0); - jQuery(window).bind( - 'resize', - function() - { - el.fisheyeCfg.pos = jQuery.iUtil.getPosition(el); - jQuery.iFisheye.positionContainer(el, 0); - jQuery.iFisheye.positionItems(el); - } - ); - jQuery.iFisheye.positionItems(el); - el.fisheyeCfg.items - .bind( - 'mouseover', - function() - { - jQuery(el.fisheyeCfg.itemsText, this).get(0).style.display = 'block'; - } - ) - .bind( - 'mouseout', - function() - { - jQuery(el.fisheyeCfg.itemsText, this).get(0).style.display = 'none'; - } - ); - jQuery(document).bind( - 'mousemove', - function(e) - { - var pointer = jQuery.iUtil.getPointer(e); - var toAdd = 0; - if (el.fisheyeCfg.halign && el.fisheyeCfg.halign == 'center') - var posx = pointer.x - el.fisheyeCfg.pos.x - (el.offsetWidth - el.fisheyeCfg.itemWidth * el.fisheyeCfg.items.size())/2 - el.fisheyeCfg.itemWidth/2; - else if (el.fisheyeCfg.halign && el.fisheyeCfg.halign == 'right') - var posx = pointer.x - el.fisheyeCfg.pos.x - el.offsetWidth + el.fisheyeCfg.itemWidth * el.fisheyeCfg.items.size(); - else - var posx = pointer.x - el.fisheyeCfg.pos.x; - var posy = Math.pow(pointer.y - el.fisheyeCfg.pos.y - el.offsetHeight/2,2); - el.fisheyeCfg.items.each( - function(nr) - { - distance = Math.sqrt( - Math.pow(posx - nr*el.fisheyeCfg.itemWidth, 2) - + posy - ); - distance -= el.fisheyeCfg.itemWidth/2; - - distance = distance < 0 ? 0 : distance; - distance = distance > el.fisheyeCfg.proximity ? el.fisheyeCfg.proximity : distance; - distance = el.fisheyeCfg.proximity - distance; - - extraWidth = el.fisheyeCfg.maxWidth * distance/el.fisheyeCfg.proximity; - - this.style.width = el.fisheyeCfg.itemWidth + extraWidth + 'px'; - this.style.left = el.fisheyeCfg.itemWidth * nr + toAdd + 'px'; - toAdd += extraWidth; - } - ); - jQuery.iFisheye.positionContainer(el, toAdd); - } - ); - } - ) - }, - - positionContainer : function(el, toAdd) - { - if (el.fisheyeCfg.halign) - if (el.fisheyeCfg.halign == 'center') - el.fisheyeCfg.container.get(0).style.left = (el.offsetWidth - el.fisheyeCfg.itemWidth * el.fisheyeCfg.items.size())/2 - toAdd/2 + 'px'; - else if (el.fisheyeCfg.halign == 'left') - el.fisheyeCfg.container.get(0).style.left = - toAdd/el.fisheyeCfg.items.size() + 'px'; - else if (el.fisheyeCfg.halign == 'right') - el.fisheyeCfg.container.get(0).style.left = (el.offsetWidth - el.fisheyeCfg.itemWidth * el.fisheyeCfg.items.size()) - toAdd/2 + 'px'; - el.fisheyeCfg.container.get(0).style.width = el.fisheyeCfg.itemWidth * el.fisheyeCfg.items.size() + toAdd + 'px'; - }, - - positionItems : function(el) - { - el.fisheyeCfg.items.each( - function(nr) - { - this.style.width = el.fisheyeCfg.itemWidth + 'px'; - this.style.left = el.fisheyeCfg.itemWidth * nr + 'px'; - } - ); - } -}; - -jQuery.fn.Fisheye = jQuery.iFisheye.build; \ No newline at end of file diff -r d824146a9589 -r 0a2505c3b547 web/res/metadataplayer/test/interface 1.2/source/iautocompleter.js --- a/web/res/metadataplayer/test/interface 1.2/source/iautocompleter.js Sun Mar 04 14:13:39 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,536 +0,0 @@ -/** - * Interface Elements for jQuery - * Autocompleter - * - * http://interface.eyecon.ro - * - * Copyright (c) 2006 Stefan Petre - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - */ - -/** - * Attach AJAX driven autocomplete/sugestion box to text input fields. - * - * - * - * @name Autocomplete - * @description Attach AJAX driven autocomplete/sugestion box to text input fields. - * @param Hash hash A hash of parameters - * @option String source the URL to request - * @option Integer delay (optional) the delayed time to start the AJAX request - * @option Boolean autofill (optional) when true the first sugested value fills the input - * @option String helperClass (optional) the CSS class applied to sugestion box - * @option String selectClass (optional) the CSS class applied to selected/hovered item - * @option Integer minchars (optional) the number of characters needed before starting AJAX request - * @option Hash fx (optional) {type:[slide|blind|fade]; duration: integer} the fx type to apply to sugestion box and duration for that fx - * @option Function onSelect (optional) A function to be executed whenever an item it is selected - * @option Function onShow (optional) A function to be executed whenever the suggection box is displayed - * @option Function onHide (optional) A function to be executed whenever the suggection box is hidden - * @option Function onHighlight (optional) A function to be executed whenever an item it is highlighted - * - * @type jQuery - * @cat Plugins/Interface - * @author Stefan Petre - */ -jQuery.iAuto = { - helper : null, - content : null, - iframe: null, - timer : null, - lastValue: null, - currentValue: null, - subject: null, - selectedItem : null, - items: null, - - empty : function() - { - jQuery.iAuto.content.empty(); - if (jQuery.iAuto.iframe) { - jQuery.iAuto.iframe.hide(); - } - }, - - clear : function() - { - jQuery.iAuto.items = null; - jQuery.iAuto.selectedItem = null; - jQuery.iAuto.lastValue = jQuery.iAuto.subject.value; - if(jQuery.iAuto.helper.css('display') == 'block') { - if (jQuery.iAuto.subject.autoCFG.fx) { - switch(jQuery.iAuto.subject.autoCFG.fx.type) { - case 'fade': - jQuery.iAuto.helper.fadeOut(jQuery.iAuto.subject.autoCFG.fx.duration, jQuery.iAuto.empty); - break; - case 'slide': - jQuery.iAuto.helper.SlideOutUp(jQuery.iAuto.subject.autoCFG.fx.duration, jQuery.iAuto.empty); - break; - case 'blind': - jQuery.iAuto.helper.BlindUp(jQuery.iAuto.subject.autoCFG.fx.duration, jQuery.iAuto.empty); - break; - } - } else { - jQuery.iAuto.helper.hide(); - } - if (jQuery.iAuto.subject.autoCFG.onHide) - jQuery.iAuto.subject.autoCFG.onHide.apply(jQuery.iAuto.subject, [jQuery.iAuto.helper, jQuery.iAuto.iframe]); - } else { - jQuery.iAuto.empty(); - } - window.clearTimeout(jQuery.iAuto.timer); - }, - - update : function () - { - var subject = jQuery.iAuto.subject; - var subjectValue = jQuery.iAuto.getFieldValues(subject); - //var selectionStart = jQuery.iAuto.getSelectionStart(subject); - if (subject && subjectValue.item != jQuery.iAuto.lastValue && subjectValue.item.length >= subject.autoCFG.minchars) { - jQuery.iAuto.lastValue = subjectValue.item; - jQuery.iAuto.currentValue = subjectValue.item; - - data = { - field: jQuery(subject).attr('name')||'field', - value: subjectValue.item - }; - - jQuery.ajax( - { - type: 'POST', - data: jQuery.param(data), - success: function(xml) - { - subject.autoCFG.lastSuggestion = jQuery('item',xml); - size = subject.autoCFG.lastSuggestion.size(); - if (size > 0) { - var toWrite = ''; - subject.autoCFG.lastSuggestion.each( - function(nr) - { - toWrite += '
  • ' + jQuery('text', this).text() + '
  • '; - } - ); - if (subject.autoCFG.autofill) { - var valueToAdd = jQuery('value', subject.autoCFG.lastSuggestion.get(0)).text(); - subject.value = subjectValue.pre + valueToAdd + subject.autoCFG.multipleSeparator + subjectValue.post; - jQuery.iAuto.selection( - subject, - subjectValue.item.length != valueToAdd.length ? (subjectValue.pre.length + subjectValue.item.length) : valueToAdd.length, - subjectValue.item.length != valueToAdd.length ? (subjectValue.pre.length + valueToAdd.length) : valueToAdd.length - ); - } - - if (size > 0) { - jQuery.iAuto.writeItems(subject, toWrite); - } else { - jQuery.iAuto.clear(); - } - } else { - jQuery.iAuto.clear(); - } - }, - url : subject.autoCFG.source - } - ); - } - }, - - writeItems : function(subject, toWrite) - { - jQuery.iAuto.content.html(toWrite); - jQuery.iAuto.items = jQuery('li', jQuery.iAuto.content.get(0)); - jQuery.iAuto.items - .mouseover(jQuery.iAuto.hoverItem) - .bind('click', jQuery.iAuto.clickItem); - var position = jQuery.iUtil.getPosition(subject); - var size = jQuery.iUtil.getSize(subject); - jQuery.iAuto.helper - .css('top', position.y + size.hb + 'px') - .css('left', position.x + 'px') - .addClass(subject.autoCFG.helperClass); - if (jQuery.iAuto.iframe) { - jQuery.iAuto.iframe - .css('display', 'block') - .css('top', position.y + size.hb + 'px') - .css('left', position.x + 'px') - .css('width', jQuery.iAuto.helper.css('width')) - .css('height', jQuery.iAuto.helper.css('height')); - } - jQuery.iAuto.selectedItem = 0; - jQuery.iAuto.items.get(0).className = subject.autoCFG.selectClass; - jQuery.iAuto.applyOn(subject,subject.autoCFG.lastSuggestion.get(0), 'onHighlight'); - - if (jQuery.iAuto.helper.css('display') == 'none') { - if (subject.autoCFG.inputWidth) { - var borders = jQuery.iUtil.getPadding(subject, true); - var paddings = jQuery.iUtil.getBorder(subject, true); - jQuery.iAuto.helper.css('width', subject.offsetWidth - (jQuery.boxModel ? (borders.l + borders.r + paddings.l + paddings.r) : 0 ) + 'px'); - } - if (subject.autoCFG.fx) { - switch(subject.autoCFG.fx.type) { - case 'fade': - jQuery.iAuto.helper.fadeIn(subject.autoCFG.fx.duration); - break; - case 'slide': - jQuery.iAuto.helper.SlideInUp(subject.autoCFG.fx.duration); - break; - case 'blind': - jQuery.iAuto.helper.BlindDown(subject.autoCFG.fx.duration); - break; - } - } else { - jQuery.iAuto.helper.show(); - } - - if (jQuery.iAuto.subject.autoCFG.onShow) - jQuery.iAuto.subject.autoCFG.onShow.apply(jQuery.iAuto.subject, [jQuery.iAuto.helper, jQuery.iAuto.iframe]); - } - }, - - checkCache : function() - { - var subject = this; - if (subject.autoCFG.lastSuggestion) { - - jQuery.iAuto.lastValue = subject.value; - jQuery.iAuto.currentValue = subject.value; - - var toWrite = ''; - subject.autoCFG.lastSuggestion.each( - function(nr) - { - value = jQuery('value', this).text().toLowerCase(); - inputValue = subject.value.toLowerCase(); - if (value.indexOf(inputValue) == 0) { - toWrite += '
  • ' + jQuery('text', this).text() + '
  • '; - } - } - ); - - if (toWrite != '') { - jQuery.iAuto.writeItems(subject, toWrite); - - this.autoCFG.inCache = true; - return; - } - } - subject.autoCFG.lastSuggestion = null; - this.autoCFG.inCache = false; - }, - - selection : function(field, start, end) - { - if (field.createTextRange) { - var selRange = field.createTextRange(); - selRange.collapse(true); - selRange.moveStart("character", start); - selRange.moveEnd("character", - end + start); - selRange.select(); - } else if (field.setSelectionRange) { - field.setSelectionRange(start, end); - } else { - if (field.selectionStart) { - field.selectionStart = start; - field.selectionEnd = end; - } - } - field.focus(); - }, - - getSelectionStart : function(field) - { - if (field.selectionStart) - return field.selectionStart; - else if(field.createTextRange) { - var selRange = document.selection.createRange(); - var selRange2 = selRange.duplicate(); - return 0 - selRange2.moveStart('character', -100000); - //result.end = result.start + range.text.length; - /*var selRange = document.selection.createRange(); - var isCollapsed = selRange.compareEndPoints("StartToEnd", selRange) == 0; - if (!isCollapsed) - selRange.collapse(true); - var bookmark = selRange.getBookmark(); - return bookmark.charCodeAt(2) - 2;*/ - } - }, - - getFieldValues : function(field) - { - var fieldData = { - value: field.value, - pre: '', - post: '', - item: '' - }; - - if(field.autoCFG.multiple) { - var finishedPre = false; - var selectionStart = jQuery.iAuto.getSelectionStart(field)||0; - var chunks = fieldData.value.split(field.autoCFG.multipleSeparator); - for (var i=0; i= selectionStart - || - selectionStart == 0) - && - !finishedPre - ) { - if (fieldData.pre.length <= selectionStart) - fieldData.item = chunks[i]; - else - fieldData.post += chunks[i] + (chunks[i] != '' ? field.autoCFG.multipleSeparator : ''); - finishedPre = true; - } else if (finishedPre){ - fieldData.post += chunks[i] + (chunks[i] != '' ? field.autoCFG.multipleSeparator : ''); - } - if(!finishedPre) { - fieldData.pre += chunks[i] + (chunks.length > 1 ? field.autoCFG.multipleSeparator : ''); - } - } - } else { - fieldData.item = fieldData.value; - } - return fieldData; - }, - - autocomplete : function(e) - { - window.clearTimeout(jQuery.iAuto.timer); - var subject = jQuery.iAuto.getFieldValues(this); - - var pressedKey = e.charCode || e.keyCode || -1; - if (/13|27|35|36|38|40|9/.test(pressedKey) && jQuery.iAuto.items) { - if (window.event) { - window.event.cancelBubble = true; - window.event.returnValue = false; - } else { - e.preventDefault(); - e.stopPropagation(); - } - if (jQuery.iAuto.selectedItem != null) - jQuery.iAuto.items.get(jQuery.iAuto.selectedItem||0).className = ''; - else - jQuery.iAuto.selectedItem = -1; - switch(pressedKey) { - //enter - case 9: - case 13: - if (jQuery.iAuto.selectedItem == -1) - jQuery.iAuto.selectedItem = 0; - var selectedItem = jQuery.iAuto.items.get(jQuery.iAuto.selectedItem||0); - var valueToAdd = selectedItem.getAttribute('rel'); - this.value = subject.pre + valueToAdd + this.autoCFG.multipleSeparator + subject.post; - jQuery.iAuto.lastValue = subject.item; - jQuery.iAuto.selection( - this, - subject.pre.length + valueToAdd.length + this.autoCFG.multipleSeparator.length, - subject.pre.length + valueToAdd.length + this.autoCFG.multipleSeparator.length - ); - jQuery.iAuto.clear(); - if (this.autoCFG.onSelect) { - iteration = parseInt(selectedItem.getAttribute('dir'))||0; - jQuery.iAuto.applyOn(this,this.autoCFG.lastSuggestion.get(iteration), 'onSelect'); - } - if (this.scrollIntoView) - this.scrollIntoView(false); - return pressedKey != 13; - break; - //escape - case 27: - this.value = subject.pre + jQuery.iAuto.lastValue + this.autoCFG.multipleSeparator + subject.post; - this.autoCFG.lastSuggestion = null; - jQuery.iAuto.clear(); - if (this.scrollIntoView) - this.scrollIntoView(false); - return false; - break; - //end - case 35: - jQuery.iAuto.selectedItem = jQuery.iAuto.items.size() - 1; - break; - //home - case 36: - jQuery.iAuto.selectedItem = 0; - break; - //up - case 38: - jQuery.iAuto.selectedItem --; - if (jQuery.iAuto.selectedItem < 0) - jQuery.iAuto.selectedItem = jQuery.iAuto.items.size() - 1; - break; - case 40: - jQuery.iAuto.selectedItem ++; - if (jQuery.iAuto.selectedItem == jQuery.iAuto.items.size()) - jQuery.iAuto.selectedItem = 0; - break; - } - jQuery.iAuto.applyOn(this,this.autoCFG.lastSuggestion.get(jQuery.iAuto.selectedItem||0), 'onHighlight'); - jQuery.iAuto.items.get(jQuery.iAuto.selectedItem||0).className = this.autoCFG.selectClass; - if (jQuery.iAuto.items.get(jQuery.iAuto.selectedItem||0).scrollIntoView) - jQuery.iAuto.items.get(jQuery.iAuto.selectedItem||0).scrollIntoView(false); - if(this.autoCFG.autofill) { - var valToAdd = jQuery.iAuto.items.get(jQuery.iAuto.selectedItem||0).getAttribute('rel'); - this.value = subject.pre + valToAdd + this.autoCFG.multipleSeparator + subject.post; - if(jQuery.iAuto.lastValue.length != valToAdd.length) - jQuery.iAuto.selection( - this, - subject.pre.length + jQuery.iAuto.lastValue.length, - subject.pre.length + valToAdd.length - ); - } - return false; - } - jQuery.iAuto.checkCache.apply(this); - - if (this.autoCFG.inCache == false) { - if (subject.item != jQuery.iAuto.lastValue && subject.item.length >= this.autoCFG.minchars) - jQuery.iAuto.timer = window.setTimeout(jQuery.iAuto.update, this.autoCFG.delay); - if (jQuery.iAuto.items) { - jQuery.iAuto.clear(); - } - } - return true; - }, - - applyOn: function(field, item, type) - { - if (field.autoCFG[type]) { - var data = {}; - childs = item.getElementsByTagName('*'); - for(i=0; i