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
// Display placeholder="" text as tooltip for :focused, non-empty inputs | |
$('form input').blur(function() { | |
var inputVal = $(this).val(), | |
titleText = $(this).attr('placeholder'); | |
if ( inputVal != '' ) { | |
$(this).tooltip({ | |
title: titleText, | |
trigger: 'focus', | |
container: 'form' | |
}); |
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() { | |
var myWidget = document.createElement('section'), | |
widgetStyles = document.createElement('style'), | |
tag = document.querySelectorAll('[src*="myWidget"]')[0]; | |
myWidget.innerHTML = '\ | |
<!-- Add your HTML here, with line-breaks escaped by a "\" backslash character. -->\ | |
<!-- (Don\'t forget: you can escape any character, like quotes, as well -->\ | |
Hello\ | |
'; | |
widgetStyles.innerHTML = '\ |
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() { | |
if (typeof EQCSS === 'undefined') { | |
var eq = document.createElement('script'); | |
eq.src = 'http://elementqueries.com/EQCSS.js'; | |
document.body.appendChild(eq); | |
}; | |
var myWidget = document.createElement('section'), | |
widgetStyles = document.createElement('script'), | |
tag = document.querySelectorAll('[src*=\'myWidget\']')[0]; | |
myWidget.innerHTML = '\ |
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
data-personas | |
data-default="<?php $dd = get_field_escaped($field); echo $dd; ?>" | |
<?php | |
$field = 'YourTagGoesHere'; | |
if(get_field($field . '_mm')) { | |
$mm = get_field_escaped($field . '_mm'); echo 'data-persona-marketing-maggie="' . $mm . '" '; | |
} else { | |
$mm = get_field_escaped($field); echo 'data-persona-marketing-maggie="' . $mm . '" '; | |
} | |
if(get_field($field . '_tt')) { |
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
// Add this code to Reddit.com | |
/* Hide the Side */ | |
if (document.getElementsByTagName('html')[0].classList.contains('reddit')) { | |
var input = document.createElement('input'), | |
inputCSS = document.createElement('style'), | |
inputJS = document.createElement('script'); | |
input.id = 'hTS'; | |
input.setAttribute('type','checkbox'); | |
input.setAttribute('onclick','hideTheSide()'); |
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
<!-- need jquery for this, this line should really go in your theme html | |
just after the <head> marker, might work OK here if you aren't already using jquery --> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> | |
<!-- Mimic the style of the tumblr headers from your theme --> | |
<div class="heading">Recent Posts</div> | |
<!-- The javascript below will insert your recent posts lists in here --> | |
<div id="recentPosts"></div> |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title></title> | |
<!-- Bootstrap CSS --> | |
<link href="http://cdn.staticresource.com/bootstrap.min.css" type="text/css" rel="stylesheet"> | |
<!-- Source Sans via Google Web Fonts --> | |
<link href="http://fonts.googleapis.com/css?family=Source+Sans+Pro:200,300,400,600,700,900,200italic,300italic,400italic,600italic,700italic,900italic&subset=latin,latin-ext" rel="stylesheet" type="text/css"> | |
<!-- FontAwesome --> |
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
https://github.com/Snugug/eq.js | |
https://github.com/tysonmatanich/elementQuery | |
http://eqcss.github.io/eqcss/ |
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 clamp(min, max, mid){ | |
if (min <= max) { // Sanity check | |
if (mid > max) { | |
// Also implied: mid is not NaN | |
return max; | |
} | |
if (mid < min) { | |
// Also implied: mid is not NaN |
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
// The wrong way: | |
if (something === true) | |
doAThing(); | |
// Requirements change, now you need to do two things: | |
if (something === true) | |
doAThing(); | |
doASecondThing(); |
OlderNewer