1/* 2 * vha - vioma highslide adapter 3 * 4 */ 5jQuery(function(){ 6 if ( window.console && window.console.info ) { 7 console.info( 'vioma highslide adapter' ); 8 console.info( 'Version 0.1' ); 9 } 10 11 if ( typeof vha_indexes == 'undefined' ) { 12 var vha_indexes = 5; 13 var vha_timer = {}; 14 } 15 16 jQuery( 'a.vha_link' ).each(function( i ){ 17 var link = jQuery( this ); 18 var settings = {}; 19 20 if ( link.attr( 'rev' ) ) { 21 var parts = link.attr( 'rev' ).split( ';' ); 22 var length = parts.length; 23 24 for( var i = 0; i < length; i++ ) { 25 var cur = parts[i].split( ':' ); 26 cur[0] = cur[0].replace (/^\s+/, '').replace (/\s+$/, ''); 27 cur[1] = cur[1].replace (/^\s+/, '').replace (/\s+$/, ''); 28 29 if ( cur[1] == 'true' ) cur[1] = true; 30 if ( cur[1] == 'false' ) cur[1] = false; 31 32 settings[cur[0]] = cur[1]; 33 } 34 } 35 36 if ( settings.table ) { 37 var table = jQuery( settings.table ); 38 i = settings.table.substr( 1 ); 39 } 40 41 if ( settings.clickable == undefined ) { 42 settings.clickable = false; 43 } 44 45 if ( typeof table == 'undefined' ){ 46 var table = jQuery( this, i ) 47 .siblings( 'table:first[class!=vha_table]' ); 48 } 49 50 table 51 .attr( 'id', 'vha_element' + i + '_table' ) 52 .addClass( 'vha_table' ); 53 54 link 55 .attr( 'id', 'vha_element' + i ) 56 .bind( 'click', function( j ){ 57 if ( link.attr( 'href' ).length > 1 ) { 58 hs.expand( this ); 59 } 60 else { 61 var table = jQuery( 'table#' + jQuery( this ).attr( 'id' ) + '_table' ), 62 container = jQuery( '<div class="highslide-html" />' ) 63 .attr( 'id', jQuery( this ).attr( 'id' ) + '_container' ) 64 .css( 'background', '#fff' ); 65 66 if ( table.length == -1 ) return false; 67 68 table.wrap( container ); 69 70 if ( vha_timer[table.attr( 'id' )] ) window.clearTimeout( vha_timer[table.attr( 'id' )] ); 71 72 if ( settings.height ) { 73 container.height( settings.height || table.height() ); 74 } 75 76 if ( settings.width ) { 77 container.width( settings.width ||Â table.width() ); 78 } 79 80 if ( typeof hs != 'undefined' ) { 81 hs.htmlExpand( this, { maincontentId: jQuery( this ).attr( 'id' ) + '_container' } ); 82 } 83 } 84 85 return false; 86 }); 87 }); 88 89 jQuery( 'img.vha_image' ).bind( 'click', function(){ 90 var a = jQuery(this).parent() 91 92 a 93 .unbind() 94 .attr( 'href', '/(cms)/media/resize/size=1000x0/' + parseInt( a.attr( 'href' ).match( /\d+\./ )[0], 10 ) ) 95 .attr( 'onclick', 'return hs.expand( this, {wrapperClassName: "in-page controls-in-heading"} );' ) 96 .trigger( 'click' ); 97 98 return false; 99 }); 100});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.