1 2 3// Adds a class 'js_on' to the <html> tag if JavaScript is enabled, 4// also helps remove flickering... 5document.documentElement.className += 'js_on'; 6 7// Cufon Related Script 8jQuery(function($){ 9 if( $('body').hasClass('cufon-on') ) { 10 // Add Cufon fonts 11 Cufon.replace('#slogan'); 12 Cufon.replace('h1'); 13 Cufon.replace('h2:not(.slide-desc h2)'); 14 Cufon.replace('h3:not(.twtr-widget, .slide-desc h2, .accordion-toggle)'); 15 Cufon.replace('h4:not(.twtr-widget, #bottom .latest_posts h4)'); 16 Cufon.replace('h5'); 17 Cufon.replace('h6'); 18 Cufon.replace('#page-content #page-title h2'); 19 Cufon.replace('.single-post-categories'); 20 } 21}); 22 23// Signup Button 24jQuery(document).ready(function($){ 25 $('p.signup-button a') 26 .css({ 'backgroundPosition': '0 0' }) 27 .hover(function(){ 28 $(this).stop() 29 .animate({ 30 'opacity': 0 31 }, 650); 32 }, 33 function(){ 34 $(this).stop() 35 .animate({ 36 'opacity': 1 37 }, 650); 38 } 39 ); 40}); 41 42// Scroll to Top script 43jQuery(document).ready(function($){ 44 $('a[href=#top]').click(function(){ 45 $('html, body').animate({scrollTop:0}, 'slow'); 46 return false; 47 }); 48}); 49 50 51// initialise Superfish Menu 52jQuery(document).ready(function($){ 53 var showAutoArrows = parseInt( $("meta[name='show-menu-auto-arrows']").attr('content') ); 54 var showDropShadows = parseInt( $("meta[name='show-menu-drop-shadows']").attr('content') ); 55 $("ul.sf-menu").supersubs({ 56 minWidth: 12, // minimum width of sub-menus in em units 57 maxWidth: 15, // maximum width of sub-menus in em units 58 extraWidth: 1 // extra width can ensure lines don't sometimes turn over 59 // due to slight rounding differences and font-family 60 }).superfish({ // call supersubs first, then superfish, so that subs are not display:none when measuring. Call before initialising containing tabs for same reason. 61 delay: 700, // the delay in milliseconds that the mouse can remain outside a submenu without it closing 62 animation: {opacity:'show',height:'show'}, // fade-in and slide-down animation 63 speed: 'normal', 64 autoArrows: showAutoArrows, 65 dropShadows: showDropShadows 66 }); 67}); 68 69/** 70 * CoolInput Plugin 71 * 72 * @version 1.5 (10/09/2009) 73 * @requires jQuery v1.2.6+ 74 * @author Alex Weber <alexweber.com.br> 75 * @author Evan Winslow <[email protected]> (v1.5) 76 * @copyright Copyright (c) 2008-2009, Alex Weber 77 * @see http://remysharp.com/2007/01/25/jquery-tutorial-text-box-hints/ 78 * 79 * Distributed under the terms of the GNU General Public License 80 * http://www.gnu.org/licenses/gpl-3.0.html 81 */ 82jQuery(document).ready(function($){ 83 $.fn.coolinput=function(b){ 84 var c={ 85 hint:null, 86 source:"value", 87 blurClass:"blur", 88 iconClass:false, 89 clearOnSubmit:true, 90 clearOnFocus:true, 91 persistent:true 92 };if(b&&typeof b=="object") 93 $.extend(c,b);else 94 c.hint=b;return this.each(function(){ 95 var d=$(this);var e=c.hint||d.attr(c.source);var f=c.blurClass;function g(){ 96 if(d.val()=="") 97 d.val(e).addClass(f) 98 } 99 function h(){ 100 if(d.val()==e&&d.hasClass(f)) 101 d.val("").removeClass(f) 102 } 103 if(e){ 104 if(c.persistent) 105 d.blur(g);if(c.clearOnFocus) 106 d.focus(h);if(c.clearOnSubmit) 107 d.parents("form:first").submit(h);if(c.iconClass) 108 d.addClass(c.iconClass);g() 109 } 110 }) 111 } 112 }); 113jQuery(document).ready(function($){ 114 // first input box is a search box, notice passing of a custom class and an icon to the coolInput function 115 $('#search_field').coolinput({ 116 blurClass: 'blur' 117 }); 118}); 119 120 121// ThumbCaption script 122jQuery(document).ready(function($){ 123 $(".portfolio-img-thumb-1-col, .portfolio-img-thumb-2-col, .portfolio-img-thumb-3-col, .portfolio-img-thumb-4-col").hover(function(){ 124 var info=$(this).find(".hover-opacity"); 125 info.stop().animate({opacity:0.4},400); 126 }, 127 function(){ 128 var info=$(this).find(".hover-opacity"); 129 info.stop().animate({opacity:1},400); 130 }); 131 132 $(".post-image").hover(function(){ 133 var info=$(this).find(".hover-opacity"); 134 info.stop().animate({opacity:0.6},400); 135 }, 136 function(){ 137 var info=$(this).find(".hover-opacity"); 138 info.stop().animate({opacity:1},400); 139 });
140}); 141 142// jQuery Validate 143jQuery(document).ready(function($){ 144 if( $('body').hasClass('page-template-page-Contact-php') ) { 145 // load js translated strings only when Contact page template is loaded 146 $("#contactForm").validate({ 147 rules: { 148 contact_name: { 149 required: true, 150 minlength: 2 151 }, 152 contact_email: { 153 required: true, 154 email: true 155 }, 156 contact_message: $('input#rules_contact_message').val() 157 }, 158 messages: { 159 contact_name: { 160 required: $('input#contact_name_required').val(), 161 minlength: $('input#contact_name_min_length').val() 162 }, 163 contact_email: $('input#messages_contact_email').val(), 164 contact_message: $('input#messages_contact_message').val() 165 } 166 }); 167 // phone number + extension format validator 168 $("#contact_phone_NA_format").mask("(999) 999-9999"); 169 $("#contact_ext_NA_format").mask("? 99999"); 170 } 171}); 172 173 174// Content Toggle 175jQuery(function($){ 176 // Initial state of toggle (hide) 177 $(".slide_toggle_content").hide(); 178 // Process Toggle click (http://api.jquery.com/toggle/) 179 $("h4.slide_toggle").toggle(function(){ 180 $(this).addClass("clicked"); 181 }, function () { 182 $(this).removeClass("clicked"); 183 }); 184 // Toggle animation (http://api.jquery.com/slideToggle/) 185 $("h4.slide_toggle").click(function(){ 186 $(this).next(".slide_toggle_content").slideToggle(); 187 }); 188}); 189 190// Content Accordion 191jQuery(document).ready(function($){ 192 $('.accordion-container').hide(); 193 $('.accordion-toggle:first').addClass('active').next().show(); 194 $('.accordion-toggle').click(function(){ 195 if( $(this).next().is(':hidden') ) { 196 $('.accordion-toggle').removeClass('active').next().slideUp(); 197 $(this).toggleClass('active').next().slideDown(); 198 } 199 return false; // Prevent the browser jump to the link anchor 200 }); 201}); 202 203//Page Peel 204jQuery(document).ready(function($){ 205 $("#page-peel").hover(function() { 206 $("#page-peel img, .msg_block").stop() 207 .animate({ width: '307px', height: '319px' }, 500); 208 }, function() { 209 $("#page-peel img").stop() 210 .animate({ width: '50px', height: '52px' }, 220); 211 $(".msg_block").stop() 212 .animate({ width: '50px', height: '50px' }, 200); 213 }); 214}); 215 216// remove the title attributes from the Subpages Widget 217jQuery(document).ready(function($) { 218 // remove 'title' attribute from menu items 219 $("#navigation-menu a, .widget_subpages a").removeAttr("title"); 220 // Add the 'default' cursor when hover to menu link that have no links 221 $('#navigation-menu a').each(function() { 222 if ( !$(this).attr("href") ) { 223 $(this).addClass("default-cursor"); 224 } 225 }); 226}); 227 228// Tabs 229jQuery(document).ready(function($){ 230 $('.tabs a').click(function(){ 231 switch_tabs($(this)); 232 }); 233 switch_tabs($('.defaulttab')); 234 function switch_tabs(obj) { 235 $('.tab-content').hide(); 236 $('.tabs a').removeClass("selected"); 237 var id = obj.attr("rel"); 238 $('#'+id).show(); 239 obj.addClass("selected"); 240 } 241});
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.