Español.MLB.com
|
|
|
|
|
|
|
|
|
|
|
|
.xml Message: WEB8002: HTTP status code 404 if (VideoPage.requestedItem.mid){ $("ul#searchResults").empty(); var itemHtml = "\
  • \
    \ ' ref=''>
    "+VideoPage.requestedItem.blurb+"
    \
    "+VideoPage.formatDuration(VideoPage.requestedItem.duration)+"
    \
    \
  • "; $("ul#searchResults").append(itemHtml); var searchParams = {}; // load initial keywords if (VideoPage.searchTagsRequested()){ searchParams = VideoPage.REQUESTED_TAGS; searchParams.hitsPerPage = 12; } else { // ############# IF TAGS ARE PASSED, USE THOSE INSTEAD!! ############### searchParams.hitsPerPage = 12; // since we're appending remaining items var keywordDisplayName = ""; var keywordValue = ""; $.each(VideoPage.requestedItem.keywords, function(i, keyword){ if (!(VideoPage.IGNORE_KEYWORD_REGEX.test(keyword.displayName))){ keywordDisplayName = keyword.displayName; keywordValue = keyword.displayName; if (keyword.type=="game_pk"){ // if gameId keyword is available, use that for search searchParams.game = keyword.value; keywordDisplayName = "More From This Game"; keywordValue = keyword.value; } else { $("
  • "+ keywordDisplayName +"
  • ").appendTo("#listVidTags"); } } }); if (!searchParams.game && VideoPage.requestedItem.keywords.length > 0){ // if gameId wasn't one of the available keywords, use first available keyword $.each(VideoPage.requestedItem.keywords, function(i, keyword){ if (!(VideoPage.IGNORE_KEYWORD_REGEX.test(keyword.displayName))){ searchParams.text = keyword.displayName; } }); } } //console.log("Getting additional items based on keyword search"); VideoPage.getSearchResults(searchParams, {keepOldResults:true}, function(){VideoPage.init()}); } else { // media meta file is missing. defaulting to Featured Videos tab //console.log("Meta file doesn't exist: /gen/multimedia/detail//alert('PaPPy Was here');.xml"); VideoPage.currentTabIndex = 0; VideoPage.init(); } } else { // search based on requested tags searchParams = VideoPage.REQUESTED_TAGS; VideoPage.getSearchResults(searchParams, {}, function(){VideoPage.init()}); } // end if specific mid requested } else { VideoPage.init(); } // add TAB click handler ------------------------- $.each(VideoPage.tabs, function(i, tab){ $("#"+tab.linkId).click(function(){ VideoPage.selectTab(i); // delay track call since it slows down tab rendering setTimeout(function(){bam.tracking.track({async:{isDynamic:true, compName:"Video Page Tab", compActivity:VideoPage.tabs[VideoPage.currentTabIndex].trackVal, actionGen:true}}, $(this)[0])}, 100); return false; }); }); // search/tag handlers --------------------------- $("#searchButton").click(function(){ var queryText = $.trim($("#searchQuery").val()); if (queryText != ""){ VideoPage.getSearchResults({text:queryText},{compName:'Search Videos', compActivity:queryText, self:$(this)[0]}); } return false; }); $("#videoPage_searchForm").submit(function(){ var queryText = $.trim($("#searchQuery").val()); if (queryText != ""){ VideoPage.getSearchResults({text:queryText},{compName:'Search Videos', compActivity:queryText, self:$(this)[0]}); } return false; }); $("#topSearches a").click(function(){ var queryText = "\"" + $(this).text() + "\""; $("#searchQuery").val(queryText); VideoPage.getSearchResults({text:queryText},{compName:'Top Searches', compActivity:queryText, self:$(this)[0]}); return false; }); }); //////////////////////////////////////////////////////