mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-05-15 18:13:09 +00:00
removed ajaxform plugin and experiments
This commit is contained in:
parent
9352d75487
commit
a4ae3b9c4c
3 changed files with 0 additions and 207 deletions
|
|
@ -1,118 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8" />
|
|
||||||
<title>jQuery Mobile Framework - Search Results</title>
|
|
||||||
<link rel="stylesheet" href="themes/default" />
|
|
||||||
<script type="text/javascript" src="js/all"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<div data-role="page" class="ui-body-c">
|
|
||||||
<div data-role="header">
|
|
||||||
<h1>Search Results</h1>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<form method="get" action="_searchresult.html" data-role="ajaxform" data-theme="c">
|
|
||||||
<label for="term" data-role="nojs">Search:</label>
|
|
||||||
<input type="search" name="term" id="term" placeholder="search..." />
|
|
||||||
<button type="submit" data-role="nojs">Search</button>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
<div data-role="content">
|
|
||||||
<p>12 Results for <em>"Justin Bieber"</em></p>
|
|
||||||
|
|
||||||
<ol data-role="listview" data-inset="true">
|
|
||||||
<li>
|
|
||||||
<img src="images/jb.jpg" alt="jb" />
|
|
||||||
<h3><a href="index.html">Page A</a></h3>
|
|
||||||
<p>Quick description about this item here</p>
|
|
||||||
<span class="ui-li-count">22</span>
|
|
||||||
<a href="index.html">browse details</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<img src="images/jb.jpg" alt="jb" />
|
|
||||||
<h3><a href="index.html">Page A</a></h3>
|
|
||||||
<p>Quick description about this item here</p>
|
|
||||||
<span class="ui-li-count">22</span>
|
|
||||||
<a href="index.html">browse details</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<img src="images/jb.jpg" alt="jb" />
|
|
||||||
<h3><a href="index.html">Page A</a></h3>
|
|
||||||
<p>Quick description about this item here</p>
|
|
||||||
<span class="ui-li-count">22</span>
|
|
||||||
<a href="index.html">browse details</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<img src="images/jb.jpg" alt="jb" />
|
|
||||||
<h3><a href="index.html">Page A</a></h3>
|
|
||||||
<p>Quick description about this item here</p>
|
|
||||||
<span class="ui-li-count">22</span>
|
|
||||||
<a href="index.html">browse details</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<img src="images/jb.jpg" alt="jb" />
|
|
||||||
<h3><a href="index.html">Page A</a></h3>
|
|
||||||
<p>Quick description about this item here</p>
|
|
||||||
<span class="ui-li-count">22</span>
|
|
||||||
<a href="index.html">browse details</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<img src="images/jb.jpg" alt="jb" />
|
|
||||||
<h3><a href="index.html">Page A</a></h3>
|
|
||||||
<p>Quick description about this item here</p>
|
|
||||||
<span class="ui-li-count">22</span>
|
|
||||||
<a href="index.html">browse details</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<img src="images/jb.jpg" alt="jb" />
|
|
||||||
<h3><a href="index.html">Page A</a></h3>
|
|
||||||
<p>Quick description about this item here</p>
|
|
||||||
<span class="ui-li-count">22</span>
|
|
||||||
<a href="index.html">browse details</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<img src="images/jb.jpg" alt="jb" />
|
|
||||||
<h3><a href="index.html">Page A</a></h3>
|
|
||||||
<p>Quick description about this item here</p>
|
|
||||||
<span class="ui-li-count">22</span>
|
|
||||||
<a href="index.html">browse details</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<img src="images/jb.jpg" alt="jb" />
|
|
||||||
<h3><a href="index.html">Page A</a></h3>
|
|
||||||
<p>Quick description about this item here</p>
|
|
||||||
<span class="ui-li-count">22</span>
|
|
||||||
<a href="index.html">browse details</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<img src="images/jb.jpg" alt="jb" />
|
|
||||||
<h3><a href="index.html">Page A</a></h3>
|
|
||||||
<p>Quick description about this item here</p>
|
|
||||||
<span class="ui-li-count">22</span>
|
|
||||||
<a href="index.html">browse details</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<img src="images/jb.jpg" alt="jb" />
|
|
||||||
<h3><a href="index.html">Page A</a></h3>
|
|
||||||
<p>Quick description about this item here</p>
|
|
||||||
<span class="ui-li-count">22</span>
|
|
||||||
<a href="index.html">browse details</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<img src="images/jb.jpg" alt="jb" />
|
|
||||||
<h3><a href="index.html">Page A</a></h3>
|
|
||||||
<p>Quick description about this item here</p>
|
|
||||||
<span class="ui-li-count">22</span>
|
|
||||||
<a href="index.html">browse details</a>
|
|
||||||
</li>
|
|
||||||
</ol>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
|
|
@ -1,31 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8" />
|
|
||||||
<title>jQuery Mobile Framework - Search Example</title>
|
|
||||||
<link rel="stylesheet" href="themes/default" />
|
|
||||||
<script type="text/javascript" src="js/all"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<div data-role="page" >
|
|
||||||
<div data-role="header">
|
|
||||||
<h1>Search</h1>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<form method="get" action="_search-results.html" data-role="ajaxform" d>
|
|
||||||
<label for="term" data-role="nojs">Search:</label>
|
|
||||||
<input type="search" name="term" id="term" placeholder="search..." />
|
|
||||||
<button type="submit" data-role="nojs">Search</button>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
<div data-role="content">
|
|
||||||
<p>No search results yet...</p>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
|
|
@ -1,58 +0,0 @@
|
||||||
/*
|
|
||||||
* jQuery Mobile Framework : "ajaxform" plugin
|
|
||||||
* Copyright (c) jQuery Project
|
|
||||||
* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
|
|
||||||
* Note: Code is in draft form and is subject to change
|
|
||||||
*/
|
|
||||||
(function($){
|
|
||||||
|
|
||||||
//ajax response callbacks
|
|
||||||
$.formhandlers = {
|
|
||||||
'default' : function(data,type){
|
|
||||||
return $(data).find('[data-role="content"]:eq(0)');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
$.fn.ajaxform = function(options){
|
|
||||||
return $(this).each(function(){
|
|
||||||
$this = $(this);
|
|
||||||
|
|
||||||
//extendable options
|
|
||||||
var o = $.extend({
|
|
||||||
submitEvents: '',
|
|
||||||
method: $this.attr('method'),
|
|
||||||
action: $this.attr('action'),
|
|
||||||
injectResponse: true,//should be data-attr driven
|
|
||||||
dataFilter: $.formhandlers['default'], //should be data-attr driven
|
|
||||||
theme: $this.data('theme') || 'b'
|
|
||||||
}, options);
|
|
||||||
|
|
||||||
$this.addClass('ui-autoform ui-bar-'+o.theme);
|
|
||||||
|
|
||||||
$this.bind(o.submitEvents, function(){
|
|
||||||
$(this).submit();
|
|
||||||
});
|
|
||||||
|
|
||||||
$this.submit(function(){
|
|
||||||
$.pageLoading();
|
|
||||||
$.ajax({
|
|
||||||
url: o.action,
|
|
||||||
type: o.method,
|
|
||||||
data: $(this).serialize(),
|
|
||||||
dataFilter: o.dataFilter,
|
|
||||||
success: function(data,textStatus){
|
|
||||||
$('.ui-page-active .ui-content').replaceWith( data );
|
|
||||||
$('.ui-page-active [data-role="content"]').page();
|
|
||||||
$.pageLoading(true);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
})(jQuery);
|
|
||||||
|
|
||||||
Loading…
Reference in a new issue