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
<h1><?php print str_replace('[', '<span>', str_replace(']', '</span>', $h1_title)); ?></h1> | |
of <h1><?php print str_replace(array('[', ']'), array('<span>', '</span>'), $h1_title); ?></h1> |
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
function basetheme_preprocess_html(&$vars) { | |
$vars['theme_folder'] = base_path() . path_to_theme(); | |
// Function to cleanup html source a bit more | |
function indent($string) { | |
$spacing = " "; | |
$string = ltrim(str_replace('<link', $spacing . '<link', $string)); | |
$string = ltrim(str_replace('<meta', $spacing . '<meta', $string)); | |
$string = ltrim(str_replace('<script', $spacing . '<script', $string)); |
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
// capitalize only first letter of a string | |
function capitaliseFirstLetter(string){ | |
return string.charAt(0).toUpperCase() + string.slice(1); | |
} |
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
/** | |
* accordion effect on hover | |
* HTML: .sub-menu-1 ul li.expanded ul li | |
*/ | |
$('.sub-menu-1 .expanded').hover(function() { | |
that = this; | |
setTimeout(function() { | |
$(that).find('ul').slideDown(); | |
$(that).siblings().find('ul').slideUp(); |
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
/* disable html5 validation */ | |
$('form').each(function() { | |
$(this).attr('novalidate', 'novalidate'); | |
}); |
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
/** | |
* jQuery function will convert each color to gray scale and return average of all pixels, so final value will be between 0 (darkest) and 255 (brightest){Object} $ | |
* docu: http://stackoverflow.com/questions/13762864/image-dark-light-detection-client-sided-script | |
* docu: http://jsfiddle.net/s7Wx2/7/ | |
*/ | |
(function ($) { | |
//darkness of picture | |
function getImageLightness(imageSrc,callback) { |
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
if($(window).width() > 550){ | |
// make a select from our language list | |
$('.language ul').each(function(){ | |
var select = $(document.createElement('select')).attr('class', 'select').insertBefore($(this).hide()); | |
$('ul.language-switcher-locale-url > li').each(function(){ | |
var link = $(this).find('a'); | |
var url = link.attr('href'); | |
option = $(document.createElement('option')).appendTo(select).val(url).html($(this).html()); |
OlderNewer