diff options
Diffstat (limited to 'libs/bower_components/jquery-placeholder')
10 files changed, 56 insertions, 336 deletions
diff --git a/libs/bower_components/jquery-placeholder/.bower.json b/libs/bower_components/jquery-placeholder/.bower.json index b5282092dd..3b21bfba74 100644 --- a/libs/bower_components/jquery-placeholder/.bower.json +++ b/libs/bower_components/jquery-placeholder/.bower.json @@ -1,17 +1,33 @@ { "name": "jquery-placeholder", - "version": "2.0.8", + "description": "A jQuery plugin that enables HTML5 placeholder behavior for browsers that aren’t trying hard enough yet", + "version": "2.0.9", + "license": "MIT", "main": [ "jquery.placeholder.js" ], + "keywords": [ + "form", + "placeholder", + "jQuery", + "jquery-plugin" + ], + "dependencies": { + "jquery": ">=1.6" + }, + "ignore": [ + "*", + "!/bower.json", + "!/jquery.placeholder.js" + ], "homepage": "https://github.com/mathiasbynens/jquery-placeholder", - "_release": "2.0.8", + "_release": "2.0.9", "_resolution": { "type": "version", - "tag": "v2.0.8", - "commit": "051f21ef5279f4887d9caf6af7af211d933ba670" + "tag": "v2.0.9", + "commit": "510a577397713934b46ccaceaa7ecc558cff313a" }, - "_source": "git://github.com/mathiasbynens/jquery-placeholder.git", + "_source": "https://github.com/mathiasbynens/jquery-placeholder.git", "_target": "~2.0.8", "_originalSource": "jquery-placeholder" }
\ No newline at end of file diff --git a/libs/bower_components/jquery-placeholder/.gitattributes b/libs/bower_components/jquery-placeholder/.gitattributes deleted file mode 100644 index 44b4224b17..0000000000 --- a/libs/bower_components/jquery-placeholder/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -* eol=lf
\ No newline at end of file diff --git a/libs/bower_components/jquery-placeholder/.gitignore b/libs/bower_components/jquery-placeholder/.gitignore deleted file mode 100644 index 496ee2ca6a..0000000000 --- a/libs/bower_components/jquery-placeholder/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.DS_Store
\ No newline at end of file diff --git a/libs/bower_components/jquery-placeholder/LICENSE-MIT.txt b/libs/bower_components/jquery-placeholder/LICENSE-MIT.txt deleted file mode 100644 index 8d4d070394..0000000000 --- a/libs/bower_components/jquery-placeholder/LICENSE-MIT.txt +++ /dev/null @@ -1,20 +0,0 @@ -Copyright Mathias Bynens <http://mathiasbynens.be/> - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file diff --git a/libs/bower_components/jquery-placeholder/README.md b/libs/bower_components/jquery-placeholder/README.md deleted file mode 100644 index fa7ea38433..0000000000 --- a/libs/bower_components/jquery-placeholder/README.md +++ /dev/null @@ -1,76 +0,0 @@ -# HTML5 Placeholder jQuery Plugin - -## Demo & Examples - -[http://mathiasbynens.be/demo/placeholder](http://mathiasbynens.be/demo/placeholder) - -## Example Usage - -### HTML - -```html -<input type="text" name="name" placeholder="e.g. John Doe"> -<input type="email" name="email" placeholder="e.g. address@example.ext"> -<input type="url" name="url" placeholder="e.g. http://mathiasbynens.be/"> -<input type="tel" name="tel" placeholder="e.g. +32 472 77 69 88"> -<input type="password" name="password" placeholder="e.g. h4x0rpr00fz"> -<input type="search" name="search" placeholder="Search this site…"> -<textarea name="message" placeholder="Your message goes here"></textarea> -``` - -### jQuery - -Use the plugin as follows: - -```js -$('input, textarea').placeholder(); -``` - -You’ll still be able to use `jQuery#val()` to get and set the input values. If the element is currently showing a placeholder, `.val()` will return an empty string instead of the placeholder text, just like it does in browsers with a native `@placeholder` implementation. Calling `.val('')` to set an element’s value to the empty string will result in the placeholder text (re)appearing. - -### CSS - -The plugin automatically adds `class="placeholder"` to the elements who are currently showing their placeholder text. You can use this to style placeholder text differently: - -```css -input, textarea { color: #000; } -.placeholder { color: #aaa; } -``` - -I’d suggest sticking to the `#aaa` color for placeholder text, as it’s the default in most browsers that support `@placeholder`. If you really want to, though, you can [style the placeholder text in some of the browsers that natively support it](http://stackoverflow.com/questions/2610497/change-an-inputs-html5-placeholder-color-with-css/2610741#2610741). - -## Installation - -You can install jquery-placeholder by using [Bower](http://bower.io). - -```bash -bower install jquery-placeholder -``` - -## Notes - -* Requires jQuery 1.6+. For an older version of this plugin that works under jQuery 1.4.2+, see [v1.8.7](https://github.com/mathiasbynens/jquery-placeholder/tree/v1.8.7). -* Works in all A-grade browsers, including IE6. -* Automatically checks if the browser natively supports the HTML5 `placeholder` attribute for `input` and `textarea` elements. If this is the case, the plugin won’t do anything. If `@placeholder` is only supported for `input` elements, the plugin will leave those alone and apply to `textarea`s exclusively. (This is the case for Safari 4, Opera 11.00, and possibly other browsers.) -* Caches the results of its two feature tests in `jQuery.fn.placeholder.input` and `jQuery.fn.placeholder.textarea`. For example, if `@placeholder` is natively supported for `input` elements, `jQuery.fn.placeholder.input` will be `true`. After loading the plugin, you can re-use these properties in your own code. -* Makes sure it never causes duplicate IDs in your DOM, even in browsers that need an extra `input` element to fake `@placeholder` for password inputs. This means you can safely do stuff like: - - ```html - <label for="bar">Example label</label> - <input type="password" placeholder="foo" id="bar"> - ``` - - And the `<label>` will always point to the `<input>` element you’d expect. Also, all CSS styles based on the ID will just work™. - -## License - -This plugin is available under [the MIT license](http://mths.be/mit). - -## Thanks to… - -* [Paul Irish](http://paulirish.com/) for his inspiring snippet in [jQuery 1.4 Hawtness #1](http://jquery14.com/day-05/jquery-1-4-hawtness-1-with-paul-irish) -* everyone from [#jquery](http://webchat.freenode.net/?channels=jquery) for the tips, ideas and patches -* temp01 for his major contributions -* anyone who [contributed a patch](https://github.com/mathiasbynens/jquery-placeholder/contributors) or [made a helpful suggestion](https://github.com/mathiasbynens/jquery-placeholder/issues) - -_– [Mathias](http://mathiasbynens.be/)_ diff --git a/libs/bower_components/jquery-placeholder/bower.json b/libs/bower_components/jquery-placeholder/bower.json index 4e5a39068b..8b55e15971 100644 --- a/libs/bower_components/jquery-placeholder/bower.json +++ b/libs/bower_components/jquery-placeholder/bower.json @@ -1,5 +1,21 @@ { "name": "jquery-placeholder", + "description": "A jQuery plugin that enables HTML5 placeholder behavior for browsers that aren’t trying hard enough yet", "version": "2.0.8", - "main": ["jquery.placeholder.js"] + "license": "MIT", + "main": ["jquery.placeholder.js"], + "keywords": [ + "form", + "placeholder", + "jQuery", + "jquery-plugin" + ], + "dependencies": { + "jquery": ">=1.6" + }, + "ignore": [ + "*", + "!/bower.json", + "!/jquery.placeholder.js" + ] } diff --git a/libs/bower_components/jquery-placeholder/demo.html b/libs/bower_components/jquery-placeholder/demo.html deleted file mode 100644 index a25df403bf..0000000000 --- a/libs/bower_components/jquery-placeholder/demo.html +++ /dev/null @@ -1,55 +0,0 @@ -<!DOCTYPE html> -<!-- If you’re looking for the online demo, it’s here: http://mathiasbynens.be/demo/placeholder --> -<html lang="en"> - <head> - <meta charset="utf-8"> - <title>HTML5 placeholder jQuery Plugin</title> - <style> - body, input, textarea { font: 1em/1.4 Helvetica, Arial; } - label code { cursor: pointer; float: left; width: 150px; } - input { width: 14em; } - textarea { height: 5em; width: 20em; } - .placeholder { color: #aaa; } - .note { border: 1px solid orange; padding: 1em; background: #ffffe0; } - /* #p { background: lime; } */ - </style> - </head> - <body> - <h1>HTML5 Placeholder jQuery Plugin</h1> - <p>Check out <a href="http://mths.be/placeholder">the HTML5 Placeholder jQuery Plugin project page on GitHub</a>.</p> - <pre><code>$(function() {<br> $('input, textarea').placeholder();<br>});</code></pre> - <form> - <p><label><code>type=search</code> <input type="search" name="search" placeholder="Search this site…"></label></p> - <p><label><code>type=text</code> <input type="text" name="name" placeholder="e.g. John Doe"></label></p> - <p><label><code>type=email</code> <input type="email" name="email" placeholder="e.g. address@example.ext"></label></p> - <p><label><code>type=url</code> <input type="url" name="url" placeholder="e.g. http://mathiasbynens.be/"></label></p> - <p><label><code>type=tel</code> <input type="tel" name="tel" placeholder="e.g. +32 472 77 69 88"></label></p> - <p><label for="p"><code>type=password</code> </label><input type="password" name="password" placeholder="e.g. hunter2" id="p"></p> - <p><label><code>textarea</code> <textarea name="message" placeholder="Your message goes here"></textarea></label></p> - <p><input type="submit" value="type=submit"></p> - </form> - <p>— <a href="http://mathiasbynens.be/" title="Mathias Bynens, front-end developer">Mathias</a></p> - <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> - <script src="jquery.placeholder.js"></script> - <script> - // To test the @id toggling on password inputs in browsers that don’t support changing an input’s @type dynamically (e.g. Firefox 3.6 or IE), uncomment this: - // $.fn.hide = function() { return this; } - // Then uncomment the last rule in the <style> element (in the <head>). - $(function() { - // Invoke the plugin - $('input, textarea').placeholder(); - // That’s it, really. - // Now display a message if the browser supports placeholder natively - var html; - if ($.fn.placeholder.input && $.fn.placeholder.textarea) { - html = '<strong>Your current browser natively supports <code>placeholder</code> for <code>input</code> and <code>textarea</code> elements.</strong> The plugin won’t run in this case, since it’s not needed. If you want to test the plugin, use an older browser ;)'; - } else if ($.fn.placeholder.input) { - html = '<strong>Your current browser natively supports <code>placeholder</code> for <code>input</code> elements, but not for <code>textarea</code> elements.</strong> The plugin will only do its thang on the <code>textarea</code>s.'; - } - if (html) { - $('<p class="note">' + html + '</p>').insertAfter('form'); - } - }); - </script> - </body> -</html> diff --git a/libs/bower_components/jquery-placeholder/jquery.placeholder.js b/libs/bower_components/jquery-placeholder/jquery.placeholder.js index c951197961..94e5e2ca11 100644 --- a/libs/bower_components/jquery-placeholder/jquery.placeholder.js +++ b/libs/bower_components/jquery-placeholder/jquery.placeholder.js @@ -1,11 +1,18 @@ -/*! http://mths.be/placeholder v2.0.8 by @mathias */ -;(function(window, document, $) { +/*! http://mths.be/placeholder v2.0.9 by @mathias */ +(function(factory) { + if (typeof define === 'function' && define.amd) { + // AMD + define(['jquery'], factory); + } else { + // Browser globals + factory(jQuery); + } +}(function($) { // Opera Mini v7 doesn’t support placeholder although its DOM seems to indicate so var isOperaMini = Object.prototype.toString.call(window.operamini) == '[object OperaMini]'; var isInputSupported = 'placeholder' in document.createElement('input') && !isOperaMini; var isTextareaSupported = 'placeholder' in document.createElement('textarea') && !isOperaMini; - var prototype = $.fn; var valHooks = $.valHooks; var propHooks = $.propHooks; var hooks; @@ -13,7 +20,7 @@ if (isInputSupported && isTextareaSupported) { - placeholder = prototype.placeholder = function() { + placeholder = $.fn.placeholder = function() { return this; }; @@ -21,7 +28,7 @@ } else { - placeholder = prototype.placeholder = function() { + placeholder = $.fn.placeholder = function() { var $this = this; $this .filter((isInputSupported ? 'textarea' : ':input') + '[placeholder]') @@ -60,7 +67,7 @@ if (!$element.data('placeholder-enabled')) { return element.value = value; } - if (value == '') { + if (value === '') { element.value = value; // Issue #56: Setting the placeholder causes problems if the element continues to have focus. if (element != safeActiveElement()) { @@ -123,7 +130,7 @@ var $input = $(input); if (input.value == $input.attr('placeholder') && $input.hasClass('placeholder')) { if ($input.data('placeholder-password')) { - $input = $input.hide().next().show().attr('id', $input.removeAttr('id').data('placeholder-id')); + $input = $input.hide().nextAll('input[type="password"]:first').show().attr('id', $input.removeAttr('id').data('placeholder-id')); // If `clearPlaceholder` was called from `$.valHooks.input.set` if (event === true) { return $input[0].value = value; @@ -142,8 +149,8 @@ var input = this; var $input = $(input); var id = this.id; - if (input.value == '') { - if (input.type == 'password') { + if (input.value === '') { + if (input.type === 'password') { if (!$input.data('placeholder-textinput')) { try { $replacement = $input.clone().attr({ 'type': 'text' }); @@ -164,7 +171,7 @@ }) .before($replacement); } - $input = $input.removeAttr('id').hide().prev().attr('id', id).show(); + $input = $input.removeAttr('id').hide().prevAll('input[type="text"]:first').attr('id', id).show(); // Note: `$input[0] != input` now! } $input.addClass('placeholder'); @@ -182,4 +189,4 @@ } catch (exception) {} } -}(this, document, jQuery)); +})); diff --git a/libs/bower_components/jquery-placeholder/tests/index.html b/libs/bower_components/jquery-placeholder/tests/index.html deleted file mode 100644 index 160e3e8c57..0000000000 --- a/libs/bower_components/jquery-placeholder/tests/index.html +++ /dev/null @@ -1,32 +0,0 @@ -<!DOCTYPE html> -<html> - <head> - <meta charset="utf-8"> - <title>jquery-placeholder test suite</title> - <link rel="stylesheet" href="http://code.jquery.com/qunit/qunit-1.12.0.css"> - <style> - .placeholder { color: #aaa; } - #input-type-password { border: 5px solid lime; } - </style> - </head> - <body> - <div id="qunit"></div> - <div id="fixtures"> - <!-- I explicitly want these to be visible in the page, for easier debugging. --> - <form> - <p><label><code>type=search</code> <input id="input-type-search" type="search" name="search" placeholder="Search this site..."></label></p> - <p><label><code>type=text</code> <input id="input-type-text" type="text" name="name" placeholder="e.g. John Doe"></label></p> - <p><label><code>type=email</code> <input id="input-type-email" type="email" name="email" placeholder="e.g. address@example.ext"></label></p> - <p><label><code>type=url</code> <input id="input-type-url" type="url" name="url" placeholder="e.g. http://mathiasbynens.be/"></label></p> - <p><label><code>type=tel</code> <input id="input-type-tel" type="tel" name="tel" placeholder="e.g. +32 472 77 69 88"></label></p> - <p><label for="input-type-password"><code>type=password</code> </label><input id="input-type-password" type="password" name="password" placeholder="e.g. hunter2"></p> - <p><label><code>textarea</code> <textarea id="textarea" name="message" placeholder="Your message goes here"></textarea></label></p> - <p><input type="submit" value="type=submit"></p> - </form> - </div> - <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> - <script src="http://code.jquery.com/qunit/qunit-1.12.0.js"></script> - <script src="../jquery.placeholder.js"></script> - <script src="tests.js"></script> - </body> -</html> diff --git a/libs/bower_components/jquery-placeholder/tests/tests.js b/libs/bower_components/jquery-placeholder/tests/tests.js deleted file mode 100644 index f721564604..0000000000 --- a/libs/bower_components/jquery-placeholder/tests/tests.js +++ /dev/null @@ -1,134 +0,0 @@ -(function($) { - - module('jQuery#placeholder'); - - test('caches results of feature tests', function() { - strictEqual(typeof $.fn.placeholder.input, 'boolean', '$.fn.placeholder.input'); - strictEqual(typeof $.fn.placeholder.textarea, 'boolean', '$.fn.placeholder.textarea'); - }); - - if ($.fn.placeholder.input && $.fn.placeholder.textarea) { - return; - } - - var testElement = function($el) { - - var el = $el[0]; - var placeholder = el.getAttribute('placeholder'); - - strictEqual($el.placeholder(), $el, 'should be chainable'); - - strictEqual(el.value, placeholder, 'should set `placeholder` text as `value`'); - strictEqual($el.prop('value'), '', 'propHooks works properly'); - strictEqual($el.val(), '', 'valHooks works properly'); - ok($el.hasClass('placeholder'), 'should have `placeholder` class'); - - // test on focus - $el.focus(); - strictEqual(el.value, '', '`value` should be the empty string on focus'); - strictEqual($el.prop('value'), '', 'propHooks works properly'); - strictEqual($el.val(), '', 'valHooks works properly'); - ok(!$el.hasClass('placeholder'), 'should not have `placeholder` class on focus'); - - // and unfocus (blur) again - $el.blur(); - - strictEqual(el.value, placeholder, 'should set `placeholder` text as `value`'); - strictEqual($el.prop('value'), '', 'propHooks works properly'); - strictEqual($el.val(), '', 'valHooks works properly'); - ok($el.hasClass('placeholder'), 'should have `placeholder` class'); - - // change the value - $el.val('lorem ipsum'); - strictEqual($el.prop('value'), 'lorem ipsum', '`$el.val(string)` should change the `value` property'); - strictEqual(el.value, 'lorem ipsum', '`$el.val(string)` should change the `value` attribute'); - ok(!$el.hasClass('placeholder'), '`$el.val(string)` should remove `placeholder` class'); - - // and clear it again - $el.val(''); - strictEqual($el.prop('value'), '', '`$el.val("")` should change the `value` property'); - strictEqual(el.value, placeholder, '`$el.val("")` should change the `value` attribute'); - ok($el.hasClass('placeholder'), '`$el.val("")` should re-enable `placeholder` class'); - - // make sure the placeholder property works as expected. - strictEqual($el.prop('placeholder'), placeholder, '$el.prop(`placeholder`) should return the placeholder value'); - $el.prop('placeholder', 'new placeholder'); - strictEqual($el.prop('placeholder'), 'new placeholder', '$el.prop(`placeholder`, <string>) should set the placeholder value'); - strictEqual($el.value, 'new placeholder', '$el.prop(`placeholder`, <string>) should update the displayed placeholder value'); - $el.prop('placeholder', placeholder); - }; - - test('emulates placeholder for <input type=text>', function() { - testElement( $('#input-type-text') ); - }); - - test('emulates placeholder for <input type=search>', function() { - testElement( $('#input-type-search') ); - }); - - test('emulates placeholder for <input type=email>', function() { - testElement( $('#input-type-email') ); - }); - - test('emulates placeholder for <input type=url>', function() { - testElement( $('#input-type-url') ); - }); - - test('emulates placeholder for <input type=tel>', function() { - testElement( $('#input-type-tel') ); - }); - - test('emulates placeholder for <input type=tel>', function() { - testElement( $('#input-type-tel') ); - }); - - test('emulates placeholder for <input type=password>', function() { - var selector = '#input-type-password'; - - var $el = $(selector); - var el = $el[0]; - - var placeholder = el.getAttribute('placeholder'); - - strictEqual($el.placeholder(), $el, 'should be chainable'); - - // Re-select the element, as it gets replaced by another one in some browsers - $el = $(selector); - el = $el[0]; - - strictEqual(el.value, placeholder, 'should set `placeholder` text as `value`'); - strictEqual($el.prop('value'), '', 'propHooks works properly'); - strictEqual($el.val(), '', 'valHooks works properly'); - ok($el.hasClass('placeholder'), 'should have `placeholder` class'); - - // test on focus - $el.focus(); - - // Re-select the element, as it gets replaced by another one in some browsers - $el = $(selector); - el = $el[0]; - - strictEqual(el.value, '', '`value` should be the empty string on focus'); - strictEqual($el.prop('value'), '', 'propHooks works properly'); - strictEqual($el.val(), '', 'valHooks works properly'); - ok(!$el.hasClass('placeholder'), 'should not have `placeholder` class on focus'); - - // and unfocus (blur) again - $el.blur(); - - // Re-select the element, as it gets replaced by another one in some browsers - $el = $(selector); - el = $el[0]; - - strictEqual(el.value, placeholder, 'should set `placeholder` text as `value`'); - strictEqual($el.prop('value'), '', 'propHooks works properly'); - strictEqual($el.val(), '', 'valHooks works properly'); - ok($el.hasClass('placeholder'), 'should have `placeholder` class'); - - }); - - test('emulates placeholder for <textarea></textarea>', function() { - testElement( $('#textarea') ); - }); - -}(jQuery)); |