This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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) { |
OlderNewer