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
// moustache replacement | |
const soupStrainer = (template, values) => | |
[...template.matchAll(/\{\{([^}]*)\}\}/gi)].reduce( | |
(acc, [full, path]) => | |
acc.replace( | |
full, | |
path.split(`.`).reduce((acc, curr) => acc[curr], values) | |
), | |
template | |
) |
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
import React, {Component, createRef } from 'react' | |
// Include Matt Stow's fetchSvgInline from https://gist.github.com/stowball/e51dde035346eba783f3d8b54dbbf2a4 | |
import { fetchSvgInline } from '../utilities/helpers' | |
export default class extends Component { | |
constructor(props) { | |
super(props) | |
this.imgRef = createRef() | |
} |
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
var handleCheckboxes = function (html, rowIndex, colIndex, cellNode) { | |
var $cellNode = $(cellNode); | |
var $check = $cellNode.find(':checked'); | |
return ($check.length) ? $check.val() : $cellNode.text(); | |
} | |
// Then add to exportOptions.format.body option for each file type, eg: | |
[...] |
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(win, $){ | |
$(document).ready(function(){ | |
var scroll_class = 'scrolled-top'; | |
var scroll_timer; | |
var $win = $(win); | |
var $head = $('#head'); | |
$win.on('scroll', function(){ |
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
'use strict' | |
module.exports = (grunt) -> | |
# Project configuration. | |
grunt.initConfig | |
# Task configuration. | |
compass: | |
options: |
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 fix_foobox_initialisation() { | |
remove_action('wp_print_footer_scripts', array($GLOBALS['foobox'], 'inline_dynamic_js') ); | |
add_action('wp_footer', array($GLOBALS['foobox'], 'inline_dynamic_js'), 99999 ); | |
} | |
add_action('wp', 'fix_foobox_initialisation'); |
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
/* adding sf-vertical class in addition to sf-menu creates a vertical menu */ | |
/* eg. <ul class="sf-menu sf-vertical"> ... */ | |
.sf-vertical { | |
min-width: 10em; /* <--- MAKE THIS MIN-WIDTH */ | |
*width: 10em; /* <--- ADD FALLBACK WIDTH FOR IE7 */ | |
} | |
.sf-vertical ul { | |
left: 100%; | |
top: 0; | |
} |
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
/* | |
* Supposition v0.3a - an optional enhancer for Superfish jQuery menu widget | |
* | |
* Copyright (c) 2013 Joel Birch - based on work by Jesse Klaasse - credit goes largely to him. | |
* Special thanks to Karl Swedberg for valuable input. | |
* | |
* Dual licensed under the MIT and GPL licenses: | |
* http://www.opensource.org/licenses/mit-license.php | |
* http://www.gnu.org/licenses/gpl.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
if (/iPhone|iPad|iPod/i.test(navigator.userAgent)) { | |
$(window).on('pageshow', function(e) { | |
if (e.originalEvent.persisted) { | |
window.location.reload(); | |
} | |
}); | |
} |
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
$(document).ready(function(){ | |
//this will be used more than once so save it to a variable | |
var menu = $('ul.sf-menu') | |
//given that you already seem to have the current page marked with 'current' on the relevant li, | |
//find that li, then find any ancestors of it and add 'current' to them also | |
menu.find('.current').parents('li').addClass('current'); | |
//once you have done that, then initialise Superfish |