View gist:fb3f256ce57e85c51ad9
wordpress:
endpoint: 'http://local.wordpress.dev/wp-json'
cacheLimit: 3600000 # 1000ms * 60s * 60m = 1hr
View gist:a8584a5b422f2ea5e6db
javascript:(function()%7Bfunction callback()%7Bdocument.getElementsByTagName('table')%5B0%5D.className %3D "timesheet_summary invoice_dashboard sortable"%7Dvar s%3Ddocument.createElement("script")%3Bs.src%3D"https%3A%2F%2Fcdn.jsdelivr.net%2Fsorttable%2F2%2Fsorttable.min.js"%3Bif(s.addEventListener)%7Bs.addEventListener("load"%2Ccallback%2Cfalse)%7Delse if(s.readyState)%7Bs.onreadystatechange%3Dcallback%7Ddocument.body.appendChild(s)%3B%7D)()
View gist:68261e7d42cf6dc3d184
document.getElementsByTagName('table')[0].className = "timesheet_summary invoice_dashboard sortable";
/*
SortTable
version 2
7th April 2007
Stuart Langridge, http://www.kryogenix.org/code/browser/sorttable/
Instructions:
Download this file
Add <script src="sorttable.js"></script> to your HTML
View events.js
//based on and borrowing heavily from http://tdanemar.wordpress.com/2010/01/19/global-events-with-jquery/
//define an addAction plugin method that will store the event in a single container object (WP.eventHolder)
//so that it doesn't pollute the global space, but we can still access it in a 'global' way
$.fn.addAction = function(eventName, func) {
$(WP.eventHolder).bind(eventName, this, function(e) { func.call(e.data);
});
//add an action that will fire when the addFeaturedPost WP event fires
$('.featured-post').addAction('WP.eventTriggers.addFeaturedPost', function(e){
View gist:2703078
Index: class.wp-dependencies.php
===================================================================
--- class.wp-dependencies.php (revision 20792)
+++ class.wp-dependencies.php (working copy)
@@ -245,7 +245,9 @@
function __construct() {
@list($this->handle, $this->src, $this->deps, $this->ver, $this->args) = func_get_args();
- if ( !is_array($this->deps) )
+ if ( is_string( $this->deps ) )
View gist:2703013
Index: functions.wp-scripts.php
===================================================================
--- functions.wp-scripts.php (revision 20792)
+++ functions.wp-scripts.php (working copy)
@@ -131,6 +131,11 @@
$wp_scripts = new WP_Scripts();
}
+ //if a single param is passed as the dependency, convert to an array so WP_Dependencies won't convert
+ //it to an empty array
View gist:2702967
<?php
function wp_enqueue_script( $handle, $src = false, $deps = array(), $ver = false, $in_footer = false ) {
global $wp_scripts;
if ( !is_a($wp_scripts, 'WP_Scripts') )
$wp_scripts = new WP_Scripts();
if ( $src ) {
$_handle = explode('?', $handle);
$wp_scripts->add( $_handle[0], $src, $deps, $ver );
View gist:1525319
Index: inc/js.php
===================================================================
--- inc/js.php (revision 18733)
+++ inc/js.php (working copy)
@@ -239,26 +239,26 @@
<script type="text/javascript">
/* <![CDATA[ */
- jQuery(document).ready( function() {
+ jQuery(document).ready( function($) {
View facebook.html
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US"
xmlns:fb="https://www.facebook.com/2008/fbml">
<head prefix="og: http://ogp.me/ns# brandwaffel:
http://ogp.me/ns/apps/brandwaffel#">
<meta property="fb:app_id" content="164019983683858" />
<meta property="og:type" content="brandwaffel:the_noid" />
<meta property="og:title" content="the Noid" />
<meta property="og:image" content="http://brandwaffle.info/facebook/noid.gif" />
<meta property="og:description" content="Can you do it?" />
View jquery.commentswitcher.js
jQuery('.switch-to-fb-comments').live('click', function(){
window.wp_comm_form = jQuery('#respond').html();
jQuery('#facebook_comments').remove();
jQuery('#respond').html('<a href="#" class="switch-to-wp-comments">Switch to WP</a><fb:comments id="facebook_comments" href="url_to_comment"></fb:comments>');
fbAsyncInit();
event.preventDefault();
});
jQuery('.switch-to-wp-comments').live('click', function(){
jQuery('#respond').html(window.wp_comm_form);
event.preventDefault();