Advertisement
Guest User

javascript.php

a guest
Feb 1st, 2015
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 10.46 KB | None | 0 0
  1. <?php global $asteria;?>
  2.  
  3. <?php if(($asteria['slider_type_id'] == "nivo") || !get_option( 'asteria' ) ){ ?>
  4.  
  5. <script type="text/javascript">
  6.  
  7.     jQuery(window).ready(function() {
  8.  
  9.  
  10.  
  11.         // nivoslider init
  12.  
  13.         jQuery('#zn_nivo').nivoSlider({
  14.  
  15.                 effect: 'random',
  16.  
  17.                 animSpeed:700,
  18.  
  19.                 pauseTime:<?php if(get_option( 'asteria' ) ){ ?><?php echo $asteria['n_slide_time_id']; ?><?php }else{ ?>4000<?php } ?>,
  20.  
  21.                 startSlide:0,
  22.  
  23.                 slices:10,
  24.  
  25.                 directionNav:true,
  26.  
  27.                 directionNavHide:true,
  28.  
  29.                 controlNav:true,
  30.  
  31.                 controlNavThumbs:false,
  32.  
  33.                 keyboardNav:true,
  34.  
  35.                 manualAdvance: false,
  36.  
  37.                 pauseOnHover:true,
  38.  
  39.                 captionOpacity:0.8,
  40.  
  41.                 afterLoad: function(){
  42.  
  43.                         if (jQuery(window).width() < 480) {
  44.  
  45.                     jQuery(".nivo-caption").animate({"opacity": "1", "right":"0"}, {easing:"easeOutBack", duration: 500});
  46.  
  47.                         }else{
  48.  
  49.                     jQuery(".nivo-caption").animate({"opacity": "1", "right":"11%"}, {easing:"easeOutBack", duration: 500});   
  50.  
  51.                     jQuery(".nivo-caption").has('.sld_layout3').addClass('sld3wrap');
  52.  
  53.                             }
  54.  
  55.                 },
  56.  
  57.                 beforeChange: function(){
  58.  
  59.                     jQuery(".nivo-caption").animate({right:"-500px"}, {easing:"easeInBack", duration: 500});
  60.  
  61.                     //jQuery(".nivo-caption").delay(400).removeClass('sld3wrap');
  62.  
  63.                     jQuery('.nivo-caption').animate({"opacity": "0"}, 100);
  64.  
  65.                     jQuery('.nivo-caption').delay(500).queue(function(next){
  66.  
  67.                         jQuery(this).removeClass("sld3wrap");next();});
  68.  
  69.  
  70.  
  71.                 },
  72.  
  73.                 afterChange: function(){
  74.  
  75.                         if (jQuery(window).width() < 480) {
  76.  
  77.                     jQuery(".nivo-caption").animate({"opacity": "1", "right":"0"}, {easing:"easeOutBack", duration: 500});
  78.  
  79.                         }else{
  80.  
  81.                     jQuery(".nivo-caption").animate({"opacity": "1", "right":"11%"}, {easing:"easeOutBack", duration: 500});   
  82.  
  83.                     jQuery(".nivo-caption").has('.sld_layout3').addClass('sld3wrap');  
  84.  
  85.                             }
  86.  
  87.                 }
  88.  
  89.             });
  90.  
  91.  
  92.  
  93.     });
  94.  
  95. </script>
  96.  
  97. <?php } ?>
  98.  
  99.  
  100.  
  101. <?php /*?><!------------------------------------------------------------Other Javascripts--------------------------------------------------------><?php */?>
  102.  
  103. <script type="text/javascript">
  104.  
  105. //Sidebar List style type
  106.  
  107. <?php if(($asteria['site_width_id'] == "1") || (!get_option( 'asteria' )) ) {?>
  108.  
  109. jQuery('#sidebar .widgets .widget li').prepend('<i class="fa-angle-double-right"></i> ');
  110.  
  111. <?php } ?>
  112.  
  113.  
  114.  
  115. //Header4 Fix
  116.  
  117. jQuery(window).bind("load", function() {
  118.  
  119. var headheight = (jQuery(".logo").outerHeight());
  120.  
  121. var logowidth = (jQuery(".logo").outerWidth());
  122.  
  123. var menuwidth = (jQuery("#topmenu").outerWidth());
  124.  
  125. if (logowidth + menuwidth <1100 ){
  126.  
  127. //var headheight = (jQuery(".header4").outerHeight());
  128.  
  129.  
  130.  
  131. jQuery(".header4 #topmenu").css({"minHeight":headheight});
  132.  
  133. jQuery(".header4 #topmenu ul li ul, .header4 .head_soc").css({"top": headheight + 'px'});
  134.  
  135. jQuery(".header4 #topmenu ul li").css({"paddingTop": "0px", "paddingBottom": "0px","height":headheight - 3 + 'px', "line-height" :headheight - 3 + 'px'});
  136.  
  137. jQuery(".header4 #topmenu ul li ul li ul").css({"marginTop": '-' + headheight + 'px'});
  138.  
  139. }else{
  140.  
  141.     jQuery(".header4 #topmenu").addClass('bigmenu');
  142.  
  143.     }
  144.  
  145. });
  146.  
  147.  
  148.  
  149.  
  150.  
  151. //Hide Slider until its loaded
  152.  
  153. jQuery('#zn_nivo, .nivo-controlNav').css({"display":"none"});  
  154.  
  155. var galleryloadergif = "<?php echo get_template_directory_uri(); ?>/images/newloader.gif";
  156.  
  157. <?php if(get_option( 'asteria' )){?>
  158.  
  159. //The Colors-------------------------------------------
  160.  
  161.     var primarytext = "<?php echo $asteria['primtxt_color_id']; ?>";
  162.  
  163.     var sechovertext = "<?php echo $asteria['sectxt_color_id']; ?>";   
  164.  
  165.     var menutext = "#FFFFFF";
  166.  
  167.     var footwidget ="#999999";
  168.  
  169.     var footwidgethover ="#ffffff";
  170.  
  171.            
  172.  
  173.     var primarycolor = "<?php echo $asteria['sec_color_id']; ?>";
  174.  
  175.     var primardefault = "#ffffff";
  176.  
  177.     var sechover = "<?php echo $asteria['sec_color_id']; ?>";
  178.  
  179.     var socialbuttons ="#cccccc";
  180.  
  181. <?php }else{ ?>
  182.  
  183.     var primarytext = "#888888";
  184.  
  185.     var sechovertext = "#FFFFFF";  
  186.  
  187.     var menutext = "#FFFFFF";
  188.  
  189.     var footwidget ="#999999";
  190.  
  191.     var footwidgethover ="#ffffff";        
  192.  
  193.     var primarycolor = "#2dcb73";
  194.  
  195.     var primardefault = "#ffffff";
  196.  
  197.     var sechover = "#2dcb73";
  198.  
  199.     var socialbuttons ="#cccccc";
  200.  
  201.  
  202.  
  203. <?php } ?>
  204.  
  205.  
  206.  
  207.     //Midrow Blocks Equal Width
  208.  
  209.     if(jQuery('.midrow_block').length == 4){ jQuery('.midrow_blocks').addClass('fourblocks'); }
  210.  
  211.     if(jQuery('.midrow_block').length == 3){ jQuery('.midrow_blocks').addClass('threeblocks'); }
  212.  
  213.     if(jQuery('.midrow_block').length == 2){ jQuery('.midrow_blocks').addClass('twoblocks'); }
  214.  
  215.     if(jQuery('.midrow_block').length == 1){ jQuery('.midrow_blocks').addClass('oneblock'); }
  216.  
  217.  
  218.  
  219.  
  220.  
  221. <?php if((!empty($asteria['offline_id']))){ ?>
  222.  
  223. jQuery(window).ready(function() {jQuery("#countdown_mntnc").countdown({
  224.  
  225.     date: "<?php echo $asteria['offline_date_id']; ?> <?php echo $asteria['offline_time_id'];?>:00",
  226.  
  227.     format: "on"});
  228.  
  229. });
  230.  
  231. <?php } ?>
  232.  
  233.  
  234.  
  235. <?php if (!empty ($asteria['ajax_id'])) { ?>
  236.  
  237. //AJAX PAGINATION
  238.  
  239. jQuery(document).ready(function(){
  240.  
  241.  
  242.  
  243. jQuery('.ast_pagenav span').replaceWith(function() {
  244.  
  245.         var pathname = window.location.pathname;
  246.  
  247.     var url = (jQuery(this).text());
  248.  
  249.      <?php global $wp; $current_url = add_query_arg( $wp->query_string, '', home_url('/', $wp->request ) ); ?>
  250.  
  251.      if (jQuery("span.page-numbers").prev().length === 0) {
  252.  
  253.     return '<a class="page-numbers current" href="<?php echo $current_url ?><?php if(is_category() || is_search() || is_author()) { ?>&paged=1<?php }else{ ?>?paged=1<?php } ?>" target="_blank">' + url + '</a>';
  254.  
  255.      }else{
  256.  
  257.             return '<a class="page-numbers current" href="<?php echo $current_url ?>" target="_blank">' + url + '</a>';
  258.  
  259.      }
  260.  
  261. });
  262.  
  263.  
  264.  
  265. jQuery('.ast_pagenav span.page-numbers').each(function () {
  266.  
  267.     var pathname = window.location.pathname;
  268.  
  269.    
  270.  
  271.     var href = jQuery(this).attr('href');
  272.  
  273.     <?php if(is_category() || is_search() || is_author()) {  ?>
  274.  
  275.     jQuery(this).attr('href', href + '&paged=1');
  276.  
  277.     <?php }else{ ?>
  278.  
  279.     jQuery(this).attr('href', href + '?paged=1');
  280.  
  281.     <?php } ?> 
  282.  
  283. });
  284.  
  285.  
  286.  
  287. jQuery('.ast_pagenav a').each(function(){
  288.  
  289.        
  290.  
  291.     <?php if(is_category() || is_search() || is_author()) {  ?>
  292.  
  293.     this.href = this.href.replace('/page/', '&#38;paged=');
  294.  
  295.     <?php }else{ ?>
  296.  
  297.     this.href = this.href.replace('/page/', '?paged=');
  298.  
  299.     <?php } ?>
  300.  
  301. });
  302.  
  303.     jQuery('.ast_pagenav a').on('click', function(e)  {
  304.  
  305.     jQuery('.ast_pagenav a, span.page-numbers').removeClass('current'); // remove if already existant
  306.  
  307.     jQuery(this).addClass('current');
  308.  
  309.  
  310.  
  311.  
  312.  
  313.     e.preventDefault();
  314.  
  315.  
  316.  
  317.    
  318.  
  319.     <?php wp_reset_query();
  320.  
  321.     $template = get_post_meta( get_the_ID(), '_wp_page_template', true );
  322.  
  323.    
  324.  
  325.     if( is_author() || ($template == 'page-blog.php' ) ){  ?>
  326.  
  327.     //Layout 4 Ajax
  328.  
  329.     var link = jQuery(this).attr('href');
  330.  
  331.     jQuery('.lay4_inner').html('<div class="ast_ajaxwrap"><div class="ast_ajax"></div></div>').load(link + '.lay4_inner .hentry', function(){
  332.  
  333.     jQuery('.lay4_inner').fadeIn(500);
  334.  
  335.     jQuery(".hentry").hide().each(function() {
  336.  
  337.     jQuery(this).fadeIn(500, "easeInSine");
  338.  
  339.     });
  340.  
  341.     //Layout 4 Ajax END
  342.  
  343.     <?php }else{ ?>
  344.  
  345.    
  346.  
  347.    
  348.  
  349. <?php if(($asteria['cat_layout_id'] == "1") && (!is_home())){ ?>
  350.  
  351.     //Layout 1 Ajax
  352.  
  353.             var link = jQuery(this).attr('href');
  354.  
  355.     jQuery('.lay1_wrap').html('<div class="ast_ajaxwrap"><div class="ast_ajax"></div></div>').load(link + '.lay1_wrap .hentry', function(){
  356.  
  357.        
  358.  
  359.     if (jQuery(window).width() < 360) {
  360.  
  361.         var divs = jQuery(".lay1 .hentry");
  362.  
  363.         for(var i = 0; i < divs.length; i+=1) {
  364.  
  365.           divs.slice(i, i+1).wrapAll("<div class='ast_row'></div>");
  366.  
  367.         }      
  368.  
  369.             }else if (jQuery(window).width() < 480) {
  370.  
  371.         var divs = jQuery(".lay1 .hentry");
  372.  
  373.         for(var i = 0; i < divs.length; i+=2) {
  374.  
  375.           divs.slice(i, i+2).wrapAll("<div class='ast_row'></div>");
  376.  
  377.         }
  378.  
  379.             }else{
  380.  
  381.         var divs = jQuery(".lay1 .hentry");
  382.  
  383.         for(var i = 0; i < divs.length; i+=3) {
  384.  
  385.           divs.slice(i, i+3).wrapAll("<div class='ast_row'></div>");
  386.  
  387.         }
  388.  
  389.     }
  390.  
  391.              
  392.  
  393.     if (jQuery(window).width() > 360) {          
  394.  
  395.         jQuery('.lay1_wrap').fadeIn(500);
  396.  
  397.         jQuery(".hentry").hide().each(function() {
  398.  
  399.         jQuery(this).fadeIn(500, "easeInSine");
  400.  
  401.         });
  402.  
  403.     }
  404.  
  405.     //Layout 1 Ajax END
  406.  
  407. <?php }elseif(($asteria['front_layout_id'] == "1") && (is_home())){ ?>
  408.  
  409.     //Layout 1 Ajax
  410.  
  411.             var link = jQuery(this).attr('href');
  412.  
  413.     jQuery('.lay1_wrap').html('<div class="ast_ajaxwrap"><div class="ast_ajax"></div></div>').load(link + '.lay1_wrap .hentry', function(){
  414.  
  415.        
  416.  
  417.     if (jQuery(window).width() < 360) {
  418.  
  419.         var divs = jQuery(".lay1 .hentry");
  420.  
  421.         for(var i = 0; i < divs.length; i+=1) {
  422.  
  423.           divs.slice(i, i+1).wrapAll("<div class='ast_row'></div>");
  424.  
  425.         }      
  426.  
  427.             }else if (jQuery(window).width() < 480) {
  428.  
  429.         var divs = jQuery(".lay1 .hentry");
  430.  
  431.         for(var i = 0; i < divs.length; i+=2) {
  432.  
  433.           divs.slice(i, i+2).wrapAll("<div class='ast_row'></div>");
  434.  
  435.         }
  436.  
  437.             }else{
  438.  
  439.         var divs = jQuery(".lay1 .hentry");
  440.  
  441.         for(var i = 0; i < divs.length; i+=3) {
  442.  
  443.           divs.slice(i, i+3).wrapAll("<div class='ast_row'></div>");
  444.  
  445.         }
  446.  
  447.     }
  448.  
  449.              
  450.  
  451.     if (jQuery(window).width() > 360) {          
  452.  
  453.         jQuery('.lay1_wrap').fadeIn(500);
  454.  
  455.         jQuery(".hentry").hide().each(function() {
  456.  
  457.         jQuery(this).fadeIn(500, "easeInSine");
  458.  
  459.         });
  460.  
  461.             var divheight = jQuery('.lay1 .ast_row .hentry:eq(0)').outerHeight();
  462.  
  463.         //jQuery(".ast_row").height(divheight);
  464.  
  465.         jQuery(window).resize(function() {
  466.  
  467.         var divheight = jQuery('.lay1 .ast_row .hentry:eq(0)').outerHeight();
  468.  
  469.         jQuery(".ast_row").height(divheight);
  470.  
  471.         });
  472.  
  473.     }
  474.  
  475.     //Layout 1 Ajax END
  476.  
  477. <?php } ?>
  478.  
  479.  
  480.  
  481.    
  482.  
  483. <?php if(($asteria['cat_layout_id'] == "4") && (!is_home())){ ?>
  484.  
  485.     //Layout 4 Ajax
  486.  
  487.     var link = jQuery(this).attr('href');
  488.  
  489.     jQuery('.lay4_inner').html('<div class="ast_ajaxwrap"><div class="ast_ajax"></div></div>').load(link + '.lay4_inner .hentry', function(){
  490.  
  491.     jQuery('.lay4_inner').fadeIn(500);
  492.  
  493.     jQuery(".hentry").hide().each(function() {
  494.  
  495.     jQuery(this).fadeIn(500, "easeInSine");
  496.  
  497.     });
  498.  
  499.     //Layout 4 Ajax END
  500.  
  501. <?php }elseif(($asteria['front_layout_id'] == "4") && (is_home())){ ?>
  502.  
  503.     //Layout 4 Ajax
  504.  
  505.     var link = jQuery(this).attr('href');
  506.  
  507.     jQuery('.lay4_inner').html('<div class="ast_ajaxwrap"><div class="ast_ajax"></div></div>').load(link + '.lay4_inner .hentry', function(){
  508.  
  509.     jQuery('.lay4_inner').fadeIn(500);
  510.  
  511.     jQuery(".hentry").hide().each(function() {
  512.  
  513.     jQuery(this).fadeIn(500, "easeInSine");
  514.  
  515.     });
  516.  
  517.     //Layout 4 Ajax END
  518.  
  519. <?php } ?>
  520.  
  521.  
  522.  
  523. <?php } ?> 
  524.  
  525.    
  526.  
  527.     });
  528.  
  529.  
  530.  
  531.     });
  532.  
  533.  
  534.  
  535. });  // end ready function
  536.  
  537. <?php } ?>
  538.  
  539. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement