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.enterPress | |
@license The MIT License (MIT) | |
*/ | |
(function($){ | |
'use strict'; | |
$.fn.enterPress = function() { | |
return this.keypress(function(e) { | |
if (e.which == 13) { |
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
<h2>Search</h2> | |
<form class="form-search"> | |
<fieldset> | |
<input type="text" class="input-medium search-query"> | |
<button type="submit" class="btn"> | |
<span class="icon-mag-glass">→</span> | |
<i>Search</i> | |
</button> | |
</fieldset> | |
</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
/** | |
* A jquery plugin to prevent a form being submitted twice | |
* | |
* You'd use this on the form itself | |
* $('form').preventDoubleSubmit(); | |
*/ | |
;(function($) { | |
function submitHandler(e) { | |
var $form = $(this); |
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
given([ | |
"1234", | |
"^", | |
"<xss>", | |
"^", | |
",", | |
"' --", | |
"\"" | |
]) | |
.it('the name should be invalid', function(name){ |
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
/** | |
* Converts a string to Title case | |
* eg: hello how are you -> Hello How Are You | |
* @return {String} | |
*/ | |
String.prototype.toTitleCase = function(){ | |
return this.replace(/\w\S*/g, function(txt){ | |
return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase(); | |
}); | |
}; |
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
/** | |
* @author Remy Sharp | |
* @url http://remysharp.com/2007/01/25/jquery-tutorial-text-box-hints/ | |
*/ | |
/*jshint curly:false */ | |
(function ($) { | |
var isInputSupported = 'placeholder' in document.createElement('input'), | |
isTextareaSupported = 'placeholder' in document.createElement('textarea'); |
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
<div id="scene"></div> | |
<script id="world" type="text/x-tmpl"> | |
<span class="box"> | |
<i class="front"></i> | |
<i class="back"></i> | |
</span> | |
</script> |
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.collapseContainer v0.1 | |
Dave Taylor http://the-taylors.org | |
@license The MIT License (MIT) | |
*/ | |
/*global define,require */ | |
(function($){ | |
'use strict'; |
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
/** | |
* Once script to make sure a function is only run once! | |
*/ | |
(function(global){ | |
function once(func) { | |
var ran = false, memo; | |
return function() { | |
if (ran) return memo; | |
ran = true; |
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
/** | |
* Equal Heights Plugin | |
* Equalize the heights of elements. Great for columns or any elements | |
* that need to be the same size (floats, etc). | |
* | |
* Version 1.0 | |
* Updated 12/10/2008 | |
* | |
* Copyright (c) 2008 Rob Glazebrook (cssnewbie.com) | |
* |
NewerOlder