This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var videos = [], | |
tag = document.createElement( 'script' ); | |
// Load the API | |
tag.src = "//www.youtube.com/iframe_api"; | |
var firstScriptTag = document.getElementsByTagName( 'script' )[0]; | |
firstScriptTag.parentNode.insertBefore( tag, firstScriptTag ); | |
// Enqueue new youtube video for loading and event tracking |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_.reduceRight( num.toString().split('').reverse(), function ( stack, next, i ) { return stack + ( i % 3 == 0 && i > 0 ? next + ',' : next ); }, '' ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$( $.grep( $('#toc_rows .row'), function ( el ) { return /Sparks|Carson|Tahoe|Zephyr\sCove|Tahoma|Genoa|Wingfield|Vizcaya|Dayton|Gardnerville|Stead|Stagecoach|Fernley|Stateline|Silver\sSprings|Lovelock/gi.test( $(el).find('.l2 .pnr small').text() ); } ) ).remove() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Return array of items visible in container. This means items which are not | |
// only viewable in the DOM, but also viewable to the user (inside the container). | |
// Note this will only check left and right boundaries and also that it will return | |
// elements which are partially visible (one foot in the door). | |
$.fn.visibleInContainer = (function ( container ) { | |
var left = container.offset().left, | |
right = left + container.outerWidth(); | |
var visible = $.grep( this, function ( el ) { | |
var el_left = $(el).offset().left, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Initialize the Soundcloud API and set up player functionality | |
Soundcloud: { | |
// Start the API up | |
Init: function () { | |
SC.initialize({ | |
client_id: app.Config.soundcloudClient | |
}); | |
// For each audio player, bind soundcloud functionality | |
$('.audio-player').each( function () { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Round value to nearest <n> | |
// multiplier allows values to be multiplied and stay rounded to nearest <n> | |
// (i.e. 1732 * 2 => nearest 50) | |
function RoundTo ( value, to, multiplier ) { | |
multiplier = multiplier || 1; | |
return Math.round( ( parseInt( value ) * multiplier ) / to ) * to; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Example of ellipsizing | |
$( function () { | |
var ellipsis_length = 10; | |
// Ellipsize text | |
var text_elements = $('.promotion__content__text *'); | |
// Flip through content elements looking for ellipsis boundary | |
var boundary = null; | |
text_elements.each( function() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Pull all crons from options | |
$crons = get_option('cron'); | |
// Kill each one. Filter by timestamp or hook_name if desired. | |
foreach ($crons as $timestamp => $hook) { | |
foreach ($hook as $hook_name => $details) { | |
wp_unschedule_event( $timestamp, $hook_name ); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
var waiting = setInterval( function () { | |
var nodes = document.querySelectorAll('.inline-svg[class^="icon-"], .inline-svg[class*=" icon-"]'); | |
for ( var i = 0; i < nodes.length; i++ ) { | |
// Pull the background in (this should always be a background image) | |
var background = document.defaultView.getComputedStyle(nodes[i])['background-image']; | |
// Check to see if an element has a background - if so, background has loaded | |
if (background && background !== 'none') { | |
if ( waiting ) clearInterval( waiting ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('.jscrollpane__container').jScrollPane().bind( 'mouseup.jsp', function () { | |
$('html').unbind('dragstart.jsp selectstart.jsp mousemove.jsp mouseup.jsp mouseleave.jsp'); | |
// This will remove the active class from ALL windows, so keep that in mind | |
// if that isn't the desired behavior. | |
$('.jspActive').removeClass( 'jspActive' ); | |
}); |
OlderNewer