inputs with type=search now get turned into search widgets. Their type then degrades to "text" . Demos updated to match changes.

This commit is contained in:
scottjehl 2010-10-06 00:44:03 -04:00
parent 160777a83a
commit c5ceff745c
5 changed files with 6 additions and 6 deletions

View file

@ -15,7 +15,7 @@
<form method="get" action="_searchresult.html" data-role="ajaxform">
<label for="term" data-role="nojs">Search:</label>
<input type="text" name="term" id="term" placeholder="search..." data-role="search" />
<input type="search" name="term" id="term" placeholder="search..." />
<button type="submit" data-role="nojs">Search</button>
</form>

View file

@ -15,7 +15,7 @@
<form method="get" action="_search-results.html" data-role="ajaxform">
<label for="term" data-role="nojs">Search:</label>
<input type="text" name="term" id="term" placeholder="search..." data-role="search" />
<input type="search" name="term" id="term" placeholder="search..." />
<button type="submit" data-role="nojs">Search</button>
</form>

View file

@ -26,7 +26,7 @@
<div data-role="content" class="ui-body-b">
<form method="get" action="" data-role="autoform">
<label for="term" data-role="nojs">Search:</label>
<input type="number" name="term" id="term" placeholder="search..." data-role="search" value="1" />
<input type="search" name="term" id="term" placeholder="search..." value="1" />
</form>
<div class="ui-content">
<ul id="conversions" data-role="listview" data-inset="true"></ul>

View file

@ -10,7 +10,7 @@ jQuery.fn.customTextInput = function(options){
var input = $(this);
var o = $.extend({
search: input.is('[data-role="search"]')
search: input.is('[type="search"],[data-type="search"]')
//defaultTheme: "a"
}, options);

View file

@ -286,14 +286,14 @@
$el.find('[data-role="nojs"]').addClass('ui-nojs');
//replace HTML5 input types that have crap browser implementations
$el.find('input[type=number],input[type=range],input[type=tel],input[type=url],input[type=email],input[type=date]').each(function(){
$el.find('input[type=number],input[type=range],input[type=tel],input[type=url],input[type=email],input[type=date],input[type=search]').each(function(){
$(this).replaceWith( $( '<div>' ).html( $(this).clone() ).html().replace(/type="([a-zA-Z]+)"/, 'type="text" data-type="$1"') );
});
$el.find('input[type=radio],input[type=checkbox]').customCheckboxRadio();
$el.find('button, input[type=submit], input[type=reset], input[type=image]').not('.ui-nojs').customButton();
$el.find('input[type=text],input[type=number],input[type=tel],input[type=url],input[type=email],input[type=password],textarea').customTextInput();
$el.find('input[type=text],input[type=password],textarea').customTextInput();
$el.find("input, select").filter('[data-role="slider"]').slider();
$el.find('select').not('[data-role="slider"]').customSelect();