home *** CD-ROM | disk | FTP | other *** search
- function index_AttachEventHandlers() {
- //Preview thumbnail animation
- $('.summaryContainer:not(.hasListener) .previewImage').hover(
- function(event) {
- isAnimationActive = true;
- summaryanimation_AnimationStartDelay($(event.currentTarget));
- },
- function(event) {
- if(!$(event.relatedTarget).hasClass('noVisualIndex')) {
- isAnimationActive = false;
- summaryanimation_AnimationStop($(event.currentTarget));
- }
- }
- );
- $('.summaryContainer:not(.hasListener) .noVisualIndex').mouseleave(function(event) {
- if(!$(event.relatedTarget).hasClass('previewImage')) {
- $('.summaryContainer:not(.vs_enhanced) .previewImage').trigger('mouseleave');
- }
- });
-
- //Remove image DIVs when looking at thumbnails
- $('.summaryContainer:not(.hasListener, .summaryContainerNonVisuallyIndexed)').hover(search_OnMouseEnterSummary, search_OnMouseLeaveSummary);
-
- //Thumbnail preview
- $('.summaryContainer:not(.hasListener) .summaryThumbnailFrame').hover(search_OnMouseEnterThumbnail, search_OnMouseLeaveThumbnail);
- $('.summaryContainer:not(.hasListener) .jumpToTime').mouseleave(function(event) {
- if(!$(event.relatedTarget).hasClass('summaryThumbnailFrame')) {
- $('.summaryContainer:not(.hasListener) .summaryThumbnailFrame').trigger('mouseleave');
- }
- });
-
- $('.summaryContainer').addClass('hasListener');
- }
-
- var summaryMouseEnterTimeout;
- function search_OnMouseEnterSummary(event) {
- return;
-
- var elementID = $(event.currentTarget).attr('id').split('_');
-
- summaryMouseEnterTimeout = setTimeout(function() {
- $('#previewImageContainer_' + elementID[1] + ' div:not(.noVisualIndex)').fadeOut(500);
- }, 400);
- }
-
- function search_OnMouseLeaveSummary(event) {
- return;
-
- clearTimeout(summaryMouseEnterTimeout);
-
- var elementID = $(event.currentTarget).attr('id').split('_');
-
- $('#previewImageContainer_' + elementID[1] + ' div:not(.noVisualIndex)').fadeIn(500);
- }
-
- function search_OnMouseEnterThumbnail(event) {
- isThumbnailHoverActive = true;
- summarythumbnail_ThumbnailHoverOn($(event.currentTarget));
- }
-
- function search_OnMouseLeaveThumbnail(event) {
- if(!$(event.relatedTarget).hasClass('jumpToTime')) {
- isThumbnailHoverActive = false;
- summarythumbnail_ThumbnailHoverOff($(event.currentTarget));
- }
- }
-
- var isThumbnailHoverActive;
-
- function summarythumbnail_ThumbnailHoverOn(element) {
- var elementID = element.attr('id').split('_');
-
- if(elementID[0] == "summaryThumbnailFaceFrame" || elementID[0] == "summaryThumbnailAllFrame") {
- $('#previewImage_' + elementID[1]).css({'width' : '160px'});
- $('#' + elementID[0] + 'Hover_' + elementID[1] + '_' + elementID[2]).addClass('on');
- $('#previewImage_' + elementID[1]).attr('src', element.attr('src'));
- }
- else {
- var spriteURL = $('#spriteBig_' + elementID[1]).val();
- var spriteCache = new Image();
-
- $('#summaryThumbnailFrameHover_' + elementID[1] + '_' + elementID[2]).addClass('on');
- $(spriteCache).load(function() {
- if(isThumbnailHoverActive) {
- $('#previewImage_' + elementID[1]).css({'background' : 'url("' + spriteURL + '") -' + (elementID[2] * 160) + 'px 0px'});
- $('#previewImage_' + elementID[1]).attr('src', 'http://rexee-00.vo.llnwd.net/d1/application/images/spacer.gif');
- }
- }).attr('src', spriteURL);
- }
- }
-
- function summarythumbnail_ThumbnailHoverOff(element) {
- var elementID = element.attr('id').split('_');
-
- if(elementID[0] == "summaryThumbnailFaceFrame" || elementID[0] == "summaryThumbnailAllFrame") {
- $('#' + elementID[0] + 'Hover_' + elementID[1] + '_' + elementID[2]).removeClass('on');
- $('#previewImage_' + elementID[1]).attr('src', $('#thumbnail_' + elementID[1]).val());
- }
- else {
- $('#summaryThumbnailFrameHover_' + elementID[1] + '_' + elementID[2]).removeClass('on');
- $('#previewImage_' + elementID[1]).attr('src', $('#thumbnail_' + elementID[1]).val());
- }
- }
-
- var isAnimationActive;
- var animationStartDelayTimeout;
- var animationTimeout;
-
- function summaryanimation_AnimationStartDelay(element) {
- var elementID = element.attr('id').split('_');
-
- if($('#spriteOrder_' + elementID[1]).val() == '') {
- animationStartDelayTimeout = setTimeout(function() {
- $('#previewImageContainer_' + elementID[1] + ' .noVisualIndex').fadeIn(500);
- }, 250);
- }
- else {
- animationStartDelayTimeout = setTimeout(function() {
- summaryanimation_AnimationStart(element);
- }, 400);
- }
- }
-
- function summaryanimation_AnimationStart(element) {
- var elementID = element.attr('id').split('_');
-
- var spriteURL = $('#spriteBig_' + elementID[1]).val();
- var currentThumbnail = $('#previewImage_' + elementID[1]);
-
- var scaledStep = currentThumbnail.attr('width');
- var scaledHeight = currentThumbnail.attr('height');
- var scaledWidth = scaledStep * 20;
-
- var spriteCache = new Image();
- $(spriteCache).load(function() {
- if(isAnimationActive) {
- //$('#previewImageContainer_' + elementID[1] + ' div:not(.noVisualIndex)').fadeOut(500);
-
- currentThumbnail.attr('src', 'http://rexee-00.vo.llnwd.net/d1/application/images/spacer.gif').css({
- 'width' : scaledWidth,
- 'height' : scaledHeight
- }).attr('src', spriteURL);
-
- summaryanimation_AnimationNextFrame(element, 0, scaledStep);
- }
- }).attr('src', spriteURL);
- }
-
- function summaryanimation_AnimationNextFrame(element, index, scaledStep) {
- clearTimeout(animationStartDelayTimeout);
- clearTimeout(animationTimeout);
-
- var elementID = element.attr('id').split('_');
- var spriteOrder = $('#spriteOrder_' + elementID[1]).attr('value').split(',');
-
- $('#previewImage_' + elementID[1]).css({'margin-left' : '-' + (spriteOrder[index % spriteOrder.length] * scaledStep) + 'px'});
-
- $('#summaryThumbnailFrameHover_' + elementID[1] + '_' + spriteOrder[(index - 1) % spriteOrder.length]).removeClass('on');
- $('#summaryThumbnailFrameHover_' + elementID[1] + '_' + spriteOrder[index % spriteOrder.length]).addClass('on');
-
- animationTimeout = setTimeout(function() {
- summaryanimation_AnimationNextFrame(element, index + 1, scaledStep);
- }, 500);
- }
-
- function summaryanimation_AnimationStop(element) {
- var elementID = element.attr('id').split('_');
-
- clearTimeout(animationStartDelayTimeout);
- clearTimeout(animationTimeout);
-
- if($('#spriteOrder_' + elementID[1]).val() == '') {
- $('#previewImageContainer_' + elementID[1] + ' .noVisualIndex').fadeOut(500);
- }
- else {
- var currentThumbnail = $('#previewImage_' + elementID[1]);
- var imageSource = $('#thumbnail_' + elementID[1]).attr('value');
-
- currentThumbnail.attr('src', imageSource).css({
- width : '',
- height : '',
- marginLeft : ''
- });
-
- //$('#previewImageContainer_' + elementID[1] + ' div:not(.noVisualIndex)').fadeIn(500);
-
- $('.summaryThumbnails .summaryThumbnailFrameHover.on').removeClass('on');
- }
- }