$(window).bind('orientationchange', function(event) { correct_screen_orientation_problems(); // alert('orientation change'); }); $(window).bind('resize', function() { if(PAGENAME_Current != 'saving_documents'){ adjustDivs(); } else { adjustHeighttoContentDiv(); } }); $('.main_header_btn_arrow').bind('click', function() { search_move_back(); }); ///// what happens when you click an individual result $('#search_leftControl, .search_individual_result_btn_more, .search_individual_result_textarea, .search_individual_result_header, .search_individual_result_icon').bind('click', function() { if(globobj_bigslides.currentPosition != ((globobj_bigslides.numberOfSlides * -1) + 1)) { globobj_bigslides.currentPosition-- // Move slideInner using margin-left } globobj_listitem = new Object; globobj_listitem.jstreeid = $(this).parent().attr('jstreeid'); globobj_listitem.jstreetype = $(this).parent().attr('jstreetype'); globobj_listitem.jstreetypecat = $(this).parent().attr('jstreetypecat'); /// if($(this).parent().attr('class') == 'search_individual_result_more'){ globobj_listitem.jstreeid = $(this).parent().parent().attr('jstreeid'); globobj_listitem.jstreetype = $(this).parent().parent().attr('jstreetype'); globobj_listitem.jstreetypecat = $(this).parent().parent().attr('jstreetypecat'); } //////////////////////////////////////////////////////////////////////////////////////// //////////////////////////// get information when item clicked ////////////////////////// //////////////////////////////////////////////////////////////////////////////////////// ////console.log(globobj_listitem); //////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////// //// add or remove a slide when clicked // add_or_remove_screens($(this)); search_results_moveBigSlides() }); ////////////////////////////////////////////////////////////////////////////////////// //////////////////////// Get Checkboxes ////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////// function search_results_checkboxes(){ ////console.log('inside fun'); globobj_checkboxResult = new Array; $("input:[name=search_results_checkboxes()]:checked").each(function() { globobj_tempObj = new Object; globobj_tempObj.JSTreeId = $(this).parent().parent().attr('jstreeid'); globobj_tempObj.JSTreeType = $(this).parent().parent().attr('jstreetype'); globobj_tempObj.JSTreeTypeCat = $(this).parent().parent().attr('jstreetypecat'); globobj_checkboxResult.push(globobj_tempObj); }); ////console.log(globobj_checkboxResult); } /////////////////////////////////////////////////////////////////////////////////// function moveBigScreen(){ //////console.log("inside big screen"); globobj_bigslides.currentPosition = 0; globobj_bigslides.slideWidth = $('.search_results_slide_visiblearea').width(); globobj_bigslides.slides = $('.search_results_individual_slide'); globobj_bigslides.numberOfSlides = globobj_bigslides.slides.length; globobj_bigslides.currentSlideType = 'null'; $('.search_results_slide_container').css('overflow', 'hidden'); ////////console.log(globobj_bigslides.numberOfSlides); globobj_bigslides.slides.wrapAll('
').css({ 'float' : 'left', 'width' : globobj_bigslides.slideWidth, }); ////////console.log($('#slideInnerTempBig')); $('#slideInnerTempBig').css('width', globobj_bigslides.slideWidth * globobj_bigslides.numberOfSlides); } /// at the first click add or remove the correct slides from the scroll function add_or_remove_screens(item_clicked) { ////console.log('add or remove screens'); ////console.log(globobj_listitem.jstreetype); ////console.log(globobj_bigslides.currentPosition); //$("#slide_list").show(); if(globobj_bigslides.currentPosition == -1){ if(globobj_listitem.jstreetype == 'news' || globobj_listitem.jstreetype == 'document') { $("#slide_list").hide(); } else { $("#slide_list").show(); } } } function search_move_forward() { if(globobj_bigslides.currentPosition != ((globobj_bigslides.numberOfSlides * -1) + 1)) { globobj_bigslides.currentPosition-- // Move slideInner using margin-left } search_results_moveBigSlides(); } function search_move_back() { if(globobj_bigslides.currentPosition != 0) { globobj_bigslides.currentPosition++ //////////console.log('++'); } else { window.location = "dashboard.htm" } search_results_moveBigSlides(); adjustHeighttoContentDiv(); ; } //// move the Big Slides in Search Results //////////// function search_results_moveBigSlides() { // alert('hit here'); // console.log('change the slides'); ////////console.log(globobj_bigslides.slideWidth + " : " + globobj_bigslides.currentPosition); $('#slideInnerTempBig').delay('500').animate({ 'marginLeft' : globobj_bigslides.slideWidth * (globobj_bigslides.currentPosition) }) setTimeout(adjustHeighttoContentDiv,600); }; function get_current_big_screen(){ tempvar1 = $('.search_results_individual_slide').css('width'); /// size of the entire block of slides tempvar2 = $('#slideInnerTempBig').css('marginLeft'); /// size of individual slide tempvar3 = (parseInt(tempvar2) / parseInt(tempvar1)); /// divide to get current slide tempvar4 = Math.round(tempvar3); /// round to whole integer // alert(tempvar4); return tempvar4; } function correct_screen_orientation_problems(){ moveBigScreen(); if(PAGENAME_Current != 'saving_documents'){ adjustDivs() }; ///// cheap hack to make sure the tabs CSS loads currectly moveBigScreen(); if(PAGENAME_Current != 'saving_documents'){ adjustDivs(); }; globobj_bigslides.currentPosition = get_current_big_screen(); search_results_moveBigSlides(); } function adjustHeighttoContentDiv() { if(PAGENAME_Current == 'Search') { $('.tab_control_text_bubble_right_content').css('height', (window.innerHeight - 440) + 'px'); $('#tab_control_text_bubble_left_content').css('height', (window.innerHeight - 440) + 'px'); } if(PAGENAME_Current == 'search_results' || PAGENAME_Current == 'trending_this_week' || PAGENAME_Current == 'saving_documents' ) { //////console.log(PAGENAME_Current); //////console.log(globobj_bigslides.currentPosition); $('.search_results_scroller').css('height', (window.innerHeight - 255) + 'px'); if(globobj_bigslides.currentPosition == 0){ $('.search_results_slide_visiblearea').css('height', (window.innerHeight - 155) + 'px'); $('.main_contentwrapper').css('height', (window.innerHeight - 175) + 'px'); }; if(globobj_bigslides.currentPosition == -1){ $('#tab_control_text_bubble_left_content').css('height', (window.innerHeight - 440) + 'px'); $('.document_container').css('height', (window.innerHeight - 185) + 'px'); $('.main_contentwrapper').css('height', (window.innerHeight - 180) + 'px'); $('.search_results_scroller').css('height', (window.innerHeight - 230) + 'px'); }; if(globobj_bigslides.currentPosition == -2){ $('.document_container').css('height', (window.innerHeight - 185) + 'px'); $('.main_contentwrapper').css('height', (window.innerHeight - 175) + 'px'); }; } $('.search_results_slide_visiblearea').css('height', (window.innerHeight - 179) + 'px'); //////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////// if(navigator && navigator.platform && navigator.platform.match(/^(iPad)$/)) { if(PAGENAME_Current != 'saving_documents'){tabs_fix_stacking_error()}; } }