Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into issue-1470
Browse files Browse the repository at this point in the history
Conflicts:
	tests/unit/listview/index.html
	tests/unit/listview/listview_core.js
  • Loading branch information
Ghislain Seguin committed Jun 20, 2011
2 parents f32fe66 + b3aa565 commit 31bd038
Show file tree
Hide file tree
Showing 13 changed files with 249 additions and 123 deletions.
10 changes: 4 additions & 6 deletions README.md
Expand Up @@ -17,13 +17,13 @@ Clone this repo and build the js and css files (you'll need Git and Make install
cd jquery-mobile
make

Two complete versions, one minified, one not, of jQuery Mobile js and css files will be created.
A full, complete version and a minified, complete version of the jQuery Mobile JavaScript and CSS files will be created in a folder named "compiled".


Submitting bugs
===================================

If you think you've found a bug, please visit the Issue tracker (https://github.com/jquery/jquery-mobile/issues) and create an issue explaining the problem and expected result. Be sure to include any relevant information for reproducing the issue, such as the browser/device (with version #), and the version of the jQuery Mobile code you're running. It also helps a lot to make sure that the bug still exists on jquerymobile.com/test/, as it's possible we may have fixed it already!
If you think you've found a bug, please visit the Issue tracker (https://github.com/jquery/jquery-mobile/issues) and create an issue explaining the problem and expected result. Be sure to include any relevant information for reproducing the issue, such as the browser/device (with version #), and the version of the jQuery Mobile code you're running. It also helps a lot to make sure that the bug still exists on jquerymobile.com/test/, as it's possible we may have fixed it already! It is also best to include code to reproduce the bug.


Submitting patches
Expand All @@ -32,6 +32,8 @@ Submitting patches
To contribute code and bug fixes to jQuery Mobile: fork this project on Github, make changes to the code in your fork, and then send a
"pull request" to notify the team of updates that are ready to be reviewed for inclusion.

Detailed instructions can be found at https://gist.github.com/726275


Running the jQuery Mobile demos & docs locally
===================================
Expand All @@ -44,7 +46,3 @@ Another quick way to get up and running is to download and install MAMP for Mac

Another alternative is XAMPP, which is also available for Windows, though you need to actually modify Apache's httpd.conf to point to your checkout: http://www.apachefriends.org/en/xampp.html
You need the Rewrite (mod_rewrite.so), Expire (mod_expires.so) and Header (mod_headers.so) modules loaded.




85 changes: 83 additions & 2 deletions docs/api/methods.html
Expand Up @@ -183,10 +183,91 @@ <h1>Methods</h1>

</dd>


<dt><code>$.mobile.path.parseUrl</code> (<em>method</em>)</dt>
<dd>Utility method for parsing a URL and its relative variants into an object that makes accessing the components of the URL easy. When parsing relative variants, the resulting object will contain empty string values for missing components (like protocol, host, etc). Also, when parsing URLs that have no authority, such as tel: urls, the pathname property of the object will contain the data after the protocol/scheme colon.</dd>

<dt><code>$.mobile.path</code> (<em>methods, properties</em>)</dt>
<dd>Utilities for getting, setting, and manipulating url paths. TODO: document as public API is finalized.</dd>
<dd>

<dl>
<dt>Arguments</dt>
<dd><code>url</code> (<em>string</em>, required) A relative or absolute URL.</dd>

<dt>Return Value</dt>
<dd>
<p>This function returns an object that contains the various components of the URL as strings. The properties on the object mimic the browser's location object:</p>
<dl>
<dt>hash</dt>
<dd>The fragment conponent of the URL, including the leading '#' character.</dd>
<dt>host</dt>
<dd>The host and port number of the URL.</dd>
<dt>hostname</dt>
<dd>The name of the host within the URL.</dd>
<dt>href</dt>
<dd>The original URL that was parsed.</dd>
<dt>pathname</dt>
<dd>The path of the file or directory referenced by the URL.</dd>
<dt>port</dt>
<dd>The port specified within the URL. Most URLs rely on the default port for the protocol used, so this may be an empty string most of the time.</dd>
<dt>protocol</dt>
<dd>The protocol for the URL including the trailing ':' character.</dd>
<dt>search</dt>
<dd>The query component of the URL including the leading '?' character.</dd>
</dl>
<p>But it also contains additional properties that provide access to additional components as well as some common forms of the URL developers access:</p>
<dl>
<dt>authority</dt>
<dd>The username, password, and host components of the URL</dd>
<dt>directory</dt>
<dd>The directory component of the pathname, minus any filename.</dd>
<dt>domain</dt>
<dd>The protocol and authority components of the URL.</dd>
<dt>filename</dt>
<dd>The filename within the pathname component, minus the directory.</dd>
<dt>hrefNoHash</dt>
<dd>The original URL minus the fragment (hash) components.</dd>
<dt>hrefNoSearch</dt>
<dd>The original URL minus the query (search) and fragment (hash) components.</dd>
<dt>password</dt>
<dd>The password contained within the authority component.</dd>
<dt>username</dt>
<dd>The username contained within the authority component.</dd>
</dl>
</dd>

</dl>
</dd>

<dd>Examples:
<pre>
<code>
<strong>// Parsing the Url below results an object that is returned with the
// following properties:
//
// obj.href: http://jblas:password@mycompany.com:8080/mail/inbox?msg=1234&type=unread#msg-content
// obj.hrefNoHash: http://jblas:password@mycompany.com:8080/mail/inbox?msg=1234&type=unread
// obj.hrefNoSearch: http://jblas:password@mycompany.com:8080/mail/inbox
// obj.domain: http://jblas:password@mycompany.com:8080
// obj.protocol: http:
// obj.authority: jblas:password@mycompany.com:8080
// obj.username: jblas
// obj.password: password
// obj.host: mycompany.com:8080
// obj.hostname: mycompany.com
// obj.port: 8080
// obj.pathname: /mail/inbox
// obj.directory: /mail/
// obj.filename: inbox
// obj.search: ?msg=1234&type=unread
// obj.hash: #msg-content</strong>

var obj = $.mobile.path.parseUrl("http://jblas:password@mycompany.com:8080/mail/inbox?msg=1234");
</code>
</pre>

</dd>


<dt><code>$.mobile.base</code> (<em>methods, properties</em>)</dt>
<dd>Utilities for working with generated base element. TODO: document as public API is finalized.</dd>

Expand Down
2 changes: 1 addition & 1 deletion docs/lists/docs-lists.html
Expand Up @@ -62,7 +62,7 @@ <h2>List dividers</h2>


<h2>Search filter</h2>
<p>jQuery Mobile provides a very easy way to filter a list with a simple client-side search feature. To make a list filterable, simply add the <code>data-filter="true"</code> attribute to the list. The framework will then append a search box above the list and add the behavior to filter out list items that don't contain the current search string as the user types. The input's placeholder text defaults to "Filter items...". To configure the placeholder text in the search input, you can either bind to the <code>mobileinit</code> event and set the <code>$.mobile.listview.prototype.options.filterPlaceholder</code> option to a string of your choosing, or use the data-attribute <code>data-filter-placeholder</code> on your listview.</p>
<p>jQuery Mobile provides a very easy way to filter a list with a simple client-side search feature. To make a list filterable, simply add the <code>data-filter="true"</code> attribute to the list. The framework will then append a search box above the list and add the behavior to filter out list items that don't contain the current search string as the user types. The input's placeholder text defaults to "Filter items...". To configure the placeholder text in the search input, you can either bind to the <code>mobileinit</code> event and set the <code>$.mobile.listview.prototype.options.filterPlaceholder</code> option to a string of your choosing, or use the data-attribute <code>data-filter-placeholder</code> on your listview. By default the search box will inherit its theme from its parent. The search box theme can be configured using the data-attribute <code>data-filter-theme</code> on your listview.</p>

<a href="lists-search.html" data-role="button" data-icon="arrow-r" data-iconpos="right">Search filter example</a>

Expand Down
2 changes: 1 addition & 1 deletion docs/lists/lists-search-with-dividers.html
Expand Up @@ -19,7 +19,7 @@ <h1>List dividers</h1>
</div><!-- /header -->

<div data-role="content">
<ul data-role="listview" data-filter="true">
<ul data-role="listview" data-filter="true" data-filter-placeholder="Search people..." data-filter-theme="b">
<li data-role="list-divider">A</li>
<li><a href="index.html">Adam Kinkaid</a></li>
<li><a href="index.html">Alex Wickerham</a></li>
Expand Down
3 changes: 2 additions & 1 deletion docs/pages/docs-transitions.html
Expand Up @@ -36,9 +36,10 @@ <h2>Page transitions</h2>
<a href="transition-success.html" data-role="button" data-rel="dialog" data-transition="slidedown">slidedown</a>
<a href="transition-success.html" data-role="button" data-rel="dialog" data-transition="pop">pop</a>
<a href="transition-success.html" data-role="button" data-rel="dialog" data-transition="fade">fade</a>
<a href="transition-success.html" data-role="button" data-rel="dialog" data-transition="flip">flip</a>
<a href="transition-success.html" data-role="button" data-rel="dialog" data-transition="flip">flip *</a>
</p>

<p>NOTE: The flip transition isn't rendered correctly on most versions of Android because it lacks 3D CSS transform capabilities. Unfortunately, instead of ignoring the flip, Android makes the page "cartwheel" away by rotating instead of flipping. We recommend using this transition sparingly until support improves.</p>
<p>In addition, you can also force a "backwards" transition by specifying <code>data-direction="reverse"</code> on your link. Note: (this was formerly <code>data-back="true"</code>, which will remain supported until 1.0)</p>

<div class="ui-body ui-body-e">
Expand Down
93 changes: 48 additions & 45 deletions js/jquery.mobile.collapsible.js
Expand Up @@ -14,7 +14,7 @@ $.widget( "mobile.collapsible", $.mobile.widget, {
theme: null,
iconTheme: "d"
},
_create: function(){
_create: function() {

var $el = this.element,
o = this.options,
Expand All @@ -24,45 +24,45 @@ $.widget( "mobile.collapsible", $.mobile.widget, {
collapsibleParent = $el.closest( ":jqmData(role='collapsible-set')" ).addClass( "ui-collapsible-set" );

//replace collapsibleHeading if it's a legend
if( collapsibleHeading.is( "legend" )){
if ( collapsibleHeading.is( "legend" ) ) {
collapsibleHeading = $( '<div role="heading">'+ collapsibleHeading.html() +"</div>" ).insertBefore( collapsibleHeading );
collapsibleHeading.next().remove();
}

//drop heading in before content
collapsibleHeading.insertBefore( collapsibleContent );

//modify markup & attributes
collapsibleHeading.addClass( "ui-collapsible-heading" )
collapsibleHeading
//drop heading in before content
.insertBefore( collapsibleContent )
//modify markup & attributes
.addClass( "ui-collapsible-heading" )
.append( '<span class="ui-collapsible-heading-status"></span>' )
.wrapInner( '<a href="#" class="ui-collapsible-heading-toggle"></a>' )
.find( "a:eq(0)" )
.buttonMarkup( {
shadow: !!!collapsibleParent.length,
corners:false,
iconPos: "left",
icon: "plus",
theme: o.theme
} )
.find( ".ui-icon" )
.removeAttr( "class" )
.buttonMarkup( {
shadow: true,
corners:true,
iconPos: "notext",
icon: "plus",
theme: o.iconTheme
} );

if( !collapsibleParent.length ){
.buttonMarkup( {
shadow: !collapsibleParent.length,
corners: false,
iconPos: "left",
icon: "plus",
theme: o.theme
} )
.find( ".ui-icon" )
.removeAttr( "class" )
.buttonMarkup( {
shadow: true,
corners: true,
iconPos: "notext",
icon: "plus",
theme: o.iconTheme
} );

if ( ! collapsibleParent.length ) {
collapsibleHeading
.find( "a:eq(0)" )
.addClass( "ui-corner-all" )
.addClass( "ui-corner-all" )
.find( ".ui-btn-inner" )
.addClass( "ui-corner-all" );
.addClass( "ui-corner-all" );
}
else {
if( collapsibleContain.jqmData( "collapsible-last" ) ){
if ( collapsibleContain.jqmData( "collapsible-last" ) ) {
collapsibleHeading
.find( "a:eq(0), .ui-btn-inner" )
.addClass( "ui-corner-bottom" );
Expand All @@ -71,26 +71,29 @@ $.widget( "mobile.collapsible", $.mobile.widget, {

//events
collapsibleContain
.bind( "collapse", function( event ){
if( !event.isDefaultPrevented() && $( event.target ).closest( ".ui-collapsible-contain" ).is( collapsibleContain ) ){
.bind( "collapse", function( event ) {
if ( ! event.isDefaultPrevented() && $( event.target ).closest( ".ui-collapsible-contain" ).is( collapsibleContain ) ) {
event.preventDefault();
collapsibleHeading
.addClass( "ui-collapsible-heading-collapsed" )
.find( ".ui-collapsible-heading-status" ).text( o.expandCueText );

collapsibleHeading.find( ".ui-icon" ).removeClass( "ui-icon-minus" ).addClass( "ui-icon-plus" );
.find( ".ui-collapsible-heading-status" )
.text( o.expandCueText )
.end()
.find( ".ui-icon" )
.removeClass( "ui-icon-minus" )
.addClass( "ui-icon-plus" );
collapsibleContent.addClass( "ui-collapsible-content-collapsed" ).attr( "aria-hidden", true );

if( collapsibleContain.jqmData( "collapsible-last" ) ){
if ( collapsibleContain.jqmData( "collapsible-last" ) ) {
collapsibleHeading
.find( "a:eq(0), .ui-btn-inner" )
.addClass( "ui-corner-bottom" );
}
}

} )
.bind( "expand", function( event ){
if( !event.isDefaultPrevented() ){
.bind( "expand", function( event ) {
if ( ! event.isDefaultPrevented() ) {
event.preventDefault();
collapsibleHeading
.removeClass( "ui-collapsible-heading-collapsed" )
Expand All @@ -99,7 +102,7 @@ $.widget( "mobile.collapsible", $.mobile.widget, {
collapsibleHeading.find( ".ui-icon" ).removeClass( "ui-icon-plus" ).addClass( "ui-icon-minus" );
collapsibleContent.removeClass( "ui-collapsible-content-collapsed" ).attr( "aria-hidden", false );

if( collapsibleContain.jqmData( "collapsible-last" ) ){
if ( collapsibleContain.jqmData( "collapsible-last" ) ) {
collapsibleHeading
.find( "a:eq(0), .ui-btn-inner" )
.removeClass( "ui-corner-bottom" );
Expand All @@ -110,7 +113,7 @@ $.widget( "mobile.collapsible", $.mobile.widget, {


//close others in a set
if( collapsibleParent.length && !collapsibleParent.jqmData( "collapsiblebound" ) ){
if ( collapsibleParent.length && !collapsibleParent.jqmData( "collapsiblebound" ) ) {
collapsibleParent
.jqmData( "collapsiblebound", true )
.bind( "expand", function( event ){
Expand All @@ -123,20 +126,20 @@ $.widget( "mobile.collapsible", $.mobile.widget, {
} );


var set = collapsibleParent.find( ":jqmData(role=collapsible ):first" );
var set = collapsibleParent.find( ":jqmData(role='collapsible'):first" );

set.first()
.find( "a:eq(0)" )
.addClass( "ui-corner-top" )
.find( ".ui-btn-inner" )
.addClass( "ui-corner-top" );
.addClass( "ui-corner-top" )
.find( ".ui-btn-inner" )
.addClass( "ui-corner-top" );

set.last().jqmData( "collapsible-last", true );
}

collapsibleHeading
.bind( "vclick", function( e ){
if( collapsibleHeading.is( ".ui-collapsible-heading-collapsed" ) ){
.bind( "vclick", function( e ) {
if ( collapsibleHeading.is( ".ui-collapsible-heading-collapsed" ) ) {
collapsibleContain.trigger( "expand" );
}
else {
Expand All @@ -146,4 +149,4 @@ $.widget( "mobile.collapsible", $.mobile.widget, {
} );
}
} );
} )( jQuery );
} )( jQuery );
3 changes: 3 additions & 0 deletions js/jquery.mobile.dialog.js
Expand Up @@ -43,6 +43,9 @@ $.widget( "mobile.dialog", $.mobile.widget, {
.attr( "data-" + $.mobile.ns + "transition", ( active.transition || $.mobile.defaultDialogTransition ) )
.attr( "data-" + $.mobile.ns + "direction", "reverse" );
}
})
.bind( "pagehide", function() {
$( this ).find( "." + $.mobile.activeBtnClass ).removeClass( $.mobile.activeBtnClass );
});
},

Expand Down
2 changes: 1 addition & 1 deletion js/jquery.mobile.forms.select.js
Expand Up @@ -245,7 +245,7 @@ $.widget( "mobile.selectmenu", $.mobile.widget, {
}

// trigger change if value changed
if( oldIndex !== newIndex ){
if( isMultiple || oldIndex !== newIndex ){
select.trigger( "change" );
}

Expand Down
3 changes: 2 additions & 1 deletion js/jquery.mobile.listview.filter.js
Expand Up @@ -8,6 +8,7 @@

$.mobile.listview.prototype.options.filter = false;
$.mobile.listview.prototype.options.filterPlaceholder = "Filter items...";
$.mobile.listview.prototype.options.filterTheme = "c";

$( ":jqmData(role='listview')" ).live( "listviewcreate", function() {
var list = $( this ),
Expand All @@ -17,7 +18,7 @@ $( ":jqmData(role='listview')" ).live( "listviewcreate", function() {
return;
}

var wrapper = $( "<form>", { "class": "ui-listview-filter ui-bar-c", "role": "search" } ),
var wrapper = $( "<form>", { "class": "ui-listview-filter ui-bar-" + listview.options.filterTheme, "role": "search" } ),

search = $( "<input>", {
placeholder: listview.options.filterPlaceholder
Expand Down

0 comments on commit 31bd038

Please sign in to comment.