This file contains 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
/** | |
* This example will work with foundation 4 sections. However, the idea is the same for any collapsed map. | |
* Load a map object | |
* Find it's parent (which is hidden) | |
* Bind a click event to the element which 'unhides' your container | |
* */ | |
(function($) { | |
Drupal.behaviors.foundationCollapseHack = { | |
attach: function(context, settings) { | |
// check whether we have a map |
This file contains 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
Drupal.behaviors.crossDomainTracking = { | |
attach: function(context, settings) { | |
//Catch all outgoing links for a specific domain | |
$('a[href*="mydomain.com"]').click(function() { | |
_gaq.push(['_link', this.href]); | |
return false; | |
}); | |
// Add onSubmit _linkByPost to all <form> elements for a specific domain | |
$('form[action*="mydomain.com"]').attr('onSubmit','_gaq.push(["_linkByPost", this])'); | |
} |
This file contains 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
// Make sure that other JS has finished it's stuff | |
$(window).load(function() { | |
// Existence check for elements as well as whether we are in mobile or not | |
if($('.MY-CSS-SELECTOR .section-container .section p.title').length > 0 && $(window).width() > 480) { | |
// Simple math to determine the percentage width of each title | |
var c = $('.MY-CSS-SELECTOR .section-container .section p.title').length; | |
var w = Math.floor(100 / c); | |
// Iterate over DOM elements and get the index so we can set an offset | |
$('.MY-CSS-SELECTOR .section-container .section p.title').each(function() { | |
// The left position will be the index of the element in relation to the tab container TIMES the width |
This file contains 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
<?php | |
if ( ! class_exists( 'Autoload_WP' ) ) { | |
/** | |
* Generic autoloader for classes named in WordPress coding style. | |
*/ | |
class Autoload_WP { | |
public $dir = __DIR__; |
This file contains 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
<?php | |
/** | |
* | |
* Custom sortable columns on property admin list | |
* | |
*/ | |
function property_id_column_register( $columns ) { | |
// Insert property ID in between date/title |
This file contains 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
<?php | |
/** | |
* | |
* Class for our options | |
* | |
* | |
* @TODO: Make this into separate pages instead of sections | |
* @TODO: ->theme single field templates maybe? But Def a better way for blocks of HTML |
This file contains 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
<?php | |
/** | |
* Revert specified features. | |
* | |
* @TODO Check that it really is Forced features revert. Currently an exact | |
* copy of the function initially placed in feature_projects.install. | |
* | |
* Code mostly taken from drush. | |
*/ |
This file contains 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
# Requre a specific version in this file: | |
# gem 'zurb-foundation', '=4.3.1' | |
require 'zurb-foundation' | |
# Require any additional compass plugins here. | |
# IE 9 and below only support up to 4095 CSS selectors | |
# This class will split all selectors after that point | |
class CssSplitter | |
def self.split(infile, outdir = File.dirname(infile), max_selectors = 4095) |
This file contains 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
<?php | |
/** | |
* All code should live in functions.php of the active theme | |
*/ | |
function attach_js() { ?> | |
<script type="text/javascript"> | |
document.write('ALL MY JS CAN GO IN BETWEEN THESE SCRIPT TAGS'); //Test script only, not required | |
</script> | |
<?php } |
OlderNewer