Skip to content

Instantly share code, notes, and snippets.

View elijahmanor's full-sized avatar
😀

Elijah Manor elijahmanor

😀
View GitHub Profile
@elijahmanor
elijahmanor / custom-scripting.js
Created April 25, 2012 02:32
jQuery Mobile Cookbook: C5R8 - Custom List Filter (Simple)
// This has to run before jquery.mobile-1.1.0.js has been loaded
$( document ).bind( "mobileinit", function() {
// on mobileinit set all listview widgets to use the startsWith filter method by default
$.mobile.listview.prototype.options.filterCallback = $.filterMethods.startsWith );
});
@elijahmanor
elijahmanor / node-type-pollyfill.js
Created April 27, 2012 14:10
Polyfill For Node Types
if ( !window.Node ) {
window.Node = {
ELEMENT_NODE: 1,
ATTRIBUTE_NODE: 2,
TEXT_NODE: 3,
CDATA_SECTION_NODE: 4,
ENTITY_REFERENCE_NODE: 5,
ENTITY_NODE: 6,
PROCESSING_INSTRUCTION_NODE: 7,
COMMENT_NODE: 8,
@elijahmanor
elijahmanor / fiddle.css
Created April 28, 2012 16:20 — forked from donwalter/fiddle.html
jQuery Mobile Cookbook: C5R2 - Data Inset List
/* Nothing here */
@elijahmanor
elijahmanor / fiddle.html
Created May 9, 2012 05:11
QUnit Test Suite Runner
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>QUnit Test Suite Runner</title>
<link rel="stylesheet" href="./qunit.css" />
<link rel="stylesheet" href="./qunit-composite.css" />
<script src="./qunit.js"></script>
<script src="./qunit-composite.js"></script>
@elijahmanor
elijahmanor / jabbr-count.js
Last active October 7, 2015 08:38
Show Total JabbR Count Across All Rooms
(function( $ ) {
var $lobby = $( "#tabs-lobby" ), $sparkline, counts = [];
$lobby.find( "button" ).append( $( "<span />", { "class": "count", text: "0" } ) );
$.getScript( "//cdnjs.cloudflare.com/ajax/libs/jquery-sparklines/2.1.1/jquery.sparkline.min.js", function() {
$sparkline = $( "<span style='height: 20px; width: 500px; padding: 0; margin: 0;' class='sparkline'>Loading..</span>" ).appendTo( "#room-filter-form" );
});
@elijahmanor
elijahmanor / jquery.qrlinkify.js
Created July 19, 2012 20:51
jQuery qrLinkify Plugin: Add QR codes next to anchor links
/* jQuery qrLinkify Plugin: Add QR codes next to anchor links
* Author: @elijahmanor
* Example Usage:
* $( "a" ).qrLinkify();
* $( "a" ).qrLinkify({ width: 250, height: 250 });
*/
$.fn.qrLinkify = function( options ) {
options = $.extend( {}, $.fn.qrLinkify.defaults, options );
return this.each( function( index ) {
@elijahmanor
elijahmanor / fiddle-slow.js
Created July 25, 2012 05:09
Just In Time Initialization of jQuery UI Date Picker On Focus
$( document ).ready( function() {
$( "input.date" ).datepicker({
minDate: moment().subtract( "months", 1 ).toDate(),
maxDate: moment().add( "months", 1 ).toDate(),
dateFormat: "d M, y",
constrainInput: true,
beforeShowDay: $.datepicker.noWeekends
});
@elijahmanor
elijahmanor / fiddle.js
Created August 5, 2012 00:38
CSS Property to DOM Style Property
function cssPropertyToDomStyleProperty( name ) {
return name.replace( /-(\w)/g, function(match, group) {
return group.toUpperCase();
});
}
@elijahmanor
elijahmanor / bug.js
Created August 14, 2012 21:25
jQuery Core Ticket #12266: IE9 AND JQUERY 1.8 BUILDFRAGMENT METHOD ISSUE
// Set context from what may come in as undefined or a jQuery collection or a node
context = context || document;
context = (context[0] || context).ownerDocument || context[0] || context;
@elijahmanor
elijahmanor / fiddle.html
Created August 19, 2012 03:11
Find jQuery Bugs Unit Tests - Broken
<div id="qunit"></div>
<div id="qunit-fixture"></div>