Skip to content

Commit ca698fc

Browse files
author
Gabriel Schulhof
committed
Merge branch 'master' into fix-4423
2 parents 46acf6e + 7ad1e84 commit ca698fc

File tree

56 files changed

+482
-439
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+482
-439
lines changed

build/config.js

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,22 +101,37 @@ module.exports = function( grunt ) {
101101
};
102102

103103
grunt.registerTask( 'test_config', 'glob all the test files', function() {
104-
var done = this.async(), test_paths, server_paths = [];
104+
var done = this.async(), test_paths, server_paths = [], env = process.env;
105105

106+
107+
// TODO move the glob to a legit config or pull the one from the qunit config
106108
test_paths = glob.glob( 'tests/unit/*/' );
107109
test_paths = test_paths.concat( glob.glob('tests/unit/**/*-tests.html') );
110+
111+
// select the proper domain + paths
108112
test_paths.forEach( function( file_path ) {
109-
var final_path = process.env.ROOT_DOMAIN + file_path;
113+
var full_path = env.ROOT_DOMAIN + file_path;
110114

111115
// if no test path is defined or if the path matches that specified in the env
112116
// add it to the config
113117
if( !process.env.TEST_PATH || file_path.indexOf(process.env.TEST_PATH) >= 0 ) {
114-
server_paths.push( final_path );
118+
server_paths.push( full_path );
115119
}
116120
});
117121

118-
grunt.config.set( 'qunit', { all: server_paths });
122+
// append the jquery version query param where defined
123+
var paths_with_jquery = [];
124+
if( env.JQUERY ){
125+
server_paths.forEach(function( full_path ) {
126+
env.JQUERY.split( "," ).forEach( function( version ) {
127+
paths_with_jquery.push(full_path + "?jquery=" + version);
128+
});
129+
});
119130

131+
server_paths = paths_with_jquery;
132+
}
133+
134+
grunt.config.set( 'qunit', { all: server_paths });
120135
done();
121136
});
122137

build/tasks/qunit/qunit.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ function sendMessage() {
2222
alert(JSON.stringify(args));
2323
}
2424

25+
sendMessage('console', "" );
26+
sendMessage('console', "jquery version: " + $.fn.jquery + " pathname: " + location.pathname );
27+
2528
QUnit.log = function(obj) {
2629
// What is this I don’t even
2730
if (obj.message === '[object Object], undefined:undefined') { return; }

css/structure/jquery.mobile.listview.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
.ui-li, .ui-li.ui-field-contain { display: block; margin:0; position: relative; overflow: visible; text-align: left; border-width: 0; border-top-width: 1px; }
66
.ui-li .ui-btn-text a.ui-link-inherit { text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
77
.ui-li-divider, .ui-li-static { padding: .5em 15px; font-size: 14px; font-weight: bold; }
8+
/* Fixes #4254 to prevent inherit font-size from .ui-li-divider, .ui-li-static */
9+
.ui-li-divider .ui-btn-text, .ui-li-static .ui-btn-text { font-size: 16px; }
10+
.ui-li-divider .ui-mini .ui-btn-text, .ui-li-static .ui-mini .ui-btn-text { font-size: inherit; }
811
.ui-li-divider { counter-reset: listnumbering; }
912
ol.ui-listview .ui-link-inherit:before, ol.ui-listview .ui-li-static:before, .ui-li-dec { font-size: .8em; display: inline-block; padding-right: .3em; font-weight: normal;counter-increment: listnumbering; content: counter(listnumbering) ". "; }
1013
ol.ui-listview .ui-li-jsnumbering:before { content: "" !important; } /* to avoid chance of duplication */

docs/api/events.html

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,17 @@ <h2>Touch events</h2>
4848
<dt><code>taphold</code></dt>
4949
<dd><p>Triggers after a held complete touch event (close to one second).</p>
5050
<ul>
51-
<li><code>tapholdThreshold</code> (default: 750ms) – This value dictates how long the user must hold their tap before the taphold event is fired on the target element.</li>
51+
<li><code>$.event.special.tap.tapholdThreshold</code> (default: 750ms) – This value dictates how long the user must hold their tap before the taphold event is fired on the target element.</li>
5252
</ul>
5353
</dd>
5454

5555
<dt><code>swipe</code></dt>
5656
<dd><p>Triggers when a horizontal drag of 30px or more (and less than 20px vertically) occurs within 1 second duration but these can be configured:</p>
5757
<ul>
58-
<li><code>scrollSupressionThreshold</code> (default: 10px) – More than this horizontal displacement, and we will suppress scrolling</li>
59-
<li><code>durationThreshold</code> (default: 1000ms) – More time than this, and it isn’t a swipe</li>
60-
<li><code>horizontalDistanceThreshold</code> (default: 30px) – Swipe horizontal displacement must be more than this.</li>
61-
<li><code>verticalDistanceThreshold</code> (default: 75px) – Swipe vertical displacement must be less than this.</li>
58+
<li><code>$.event.special.swipe.scrollSupressionThreshold</code> (default: 10px) – More than this horizontal displacement, and we will suppress scrolling.</li>
59+
<li><code>$.event.special.swipe.durationThreshold</code> (default: 1000ms) – More time than this, and it isn’t a swipe.</li>
60+
<li><code>$.event.special.swipe.horizontalDistanceThreshold</code> (default: 30px) – Swipe horizontal displacement must be more than this.</li>
61+
<li><code>$.event.special.swipe.verticalDistanceThreshold</code> (default: 75px) – Swipe vertical displacement must be less than this.</li>
6262
</ul>
6363
</dd>
6464

@@ -73,16 +73,19 @@ <h2>Virtual mouse events</h2>
7373
<p>We provide a set of "virtual" mouse events that attempt to abstract away mouse and touch events. This allows the developer to register listeners for the basic mouse events, such as mousedown, mousemove, mouseup, and click, and the plugin will take care of registering the correct listeners behind the scenes to invoke the listener at the fastest possible time for that device. In touch environments, the plugin retains the order of event firing that is seen in traditional mouse environments, so for example, vmouseup is always dispatched before vmousedown, and vmousedown before vclick, etc. The virtual mouse events also normalize how coordinate information is extracted from the event, so in touch based environments, coordinates are available from the pageX, pageY, screenX, screenY, clientX, and clientY properties, directly on the event object.</p>
7474
<dl>
7575
<dt><code>vmouseover</code></dt>
76-
<dd>Normalized event for handling touch or <code>mouseover</code> events</dd>
76+
<dd>Normalized event for handling touch or <code>mouseover</code> events</dd>
77+
78+
<dt><code>vmouseout</code></dt>
79+
<dd>Normalized event for handling touch or <code>mouseout</code> events</dd>
7780

7881
<dt><code>vmousedown</code></dt>
79-
<dd>Normalized event for handling touchstart or <code>mousedown</code> events</dd>
82+
<dd>Normalized event for handling touchstart or <code>mousedown</code> events</dd>
8083

8184
<dt><code>vmousemove</code></dt>
82-
<dd>Normalized event for handling touchmove or <code>mousemove</code> events</dd>
85+
<dd>Normalized event for handling touchmove or <code>mousemove</code> events</dd>
8386

8487
<dt><code>vmouseup</code></dt>
85-
<dd>Normalized event for handling touchend or <code>mouseup</code> events</dd>
88+
<dd>Normalized event for handling touchend or <code>mouseup</code> events</dd>
8689

8790
<dt><code>vclick</code></dt>
8891
<dd>Normalized event for handling touchend or mouse <code>click</code> events. On touch devices, this event is dispatched *AFTER* vmouseup. </dd>
@@ -299,7 +302,7 @@ <h2>Page load events</h2>
299302
</li>
300303
<li><code>errorThrown</code> (null, string, object)
301304
<ul>
302-
<li>According to the jQuery Core <a href="http://api.jquery.com/jQuery.ajax/">documentation</a>, this property may be an exception object if one occured, or if an HTTP error occured this will be set to the textual portion of the HTTP status. This is what gets passed as the 3rd argument to the framework's $.ajax() error callback.</li>
305+
<li>According to the jQuery Core <a href="http://api.jquery.com/jQuery.ajax/">documentation</a>, this property may be an exception object if one occurred, or if an HTTP error occurred this will be set to the textual portion of the HTTP status. This is what gets passed as the 3rd argument to the framework's $.ajax() error callback.</li>
303306
</ul>
304307
</li>
305308
</ul>
@@ -421,7 +424,7 @@ <h2>Page initialization events</h2>
421424

422425
<p>Internally, jQuery Mobile auto-initializes plugins based on the markup conventions found in a given "page". For example, an <code>input</code> element with a <code>type</code> of <code>range</code> will automatically generate a custom slider control.</p>
423426

424-
<p>This auto-initialization is controlled by the "page" plugin, which dispatches events before and after it executes, allowing you to manipulate a page either pre-or-post initialization, or even provide your own intialization behavior and prevent the auto-initializations from occuring. Note that these events will only fire once per "page", as opposed to the show/hide events, which fire every time a page is shown and hidden.</p>
427+
<p>This auto-initialization is controlled by the "page" plugin, which dispatches events before and after it executes, allowing you to manipulate a page either pre-or-post initialization, or even provide your own initialization behavior and prevent the auto-initializations from occurring. Note that these events will only fire once per "page", as opposed to the show/hide events, which fire every time a page is shown and hidden.</p>
425428

426429
<dl>
427430
<dt><code>pagebeforecreate</code></dt>

docs/api/methods.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ <h1>Methods</h1>
184184
</dd>
185185

186186
<dt><code>$.mobile.loading</code> (<em>method</em>)</dt>
187-
<dd>Show or hide the page loading message, which is configurable via <code>$.mobile.loader</code> prototype options as described in the <a href="../docs/pages/loader.html">widget docs</a> or can be controlled via a params object.</dd>
187+
<dd>Show or hide the page loading message, which is configurable via <code>$.mobile.loader</code> prototype options as described in the <a href="../pages/loader.html">widget docs</a> or can be controlled via a params object.</dd>
188188
<dd>
189189
<dl>
190190
<dt><code>&#183;</code> Object Param Arguments</dt>

docs/lists/docs-lists.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,14 @@ <h2>Search filter</h2>
106106

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

109-
<p>If you want to change the way in which list items are filtered, ie fuzzy search or matching from the beginning of the string, you can configure the callback used internally by defining <code>$.mobile.listview.prototype.options.filterCallback</code> during <code>mobileinit</code> or after the widget has been created with <code>$("#mylist").listview('option', 'filterCallback', yourFilterFunction)</code>. Any function defined for the callback will be provided two arguments. First, the text of the current list item and second, the value being searched for. A truthy value will result in a hidden list item. The default callback which filters entries without the <code>searchValue</code> as a substring is described below:
109+
<p>If you want to change the way in which list items are filtered, ie fuzzy search or matching from the beginning of the string, you can configure the callback used internally by defining <code>$.mobile.listview.prototype.options.filterCallback</code> during <code>mobileinit</code> or after the widget has been created with <code>$("#mylist").listview('option', 'filterCallback', yourFilterFunction)</code>. Any function defined for the callback will be provided three arguments. First, the text of the current list item, second the value being searched for, and third the list item being filtered. A truthy value will result in a hidden list item. The default callback which filters entries without the <code>searchValue</code> as a substring is described below:
110110
</p>
111111

112-
<pre><code>function( text, searchValue ){
113-
return text.toLowerCase().indexOf( searchValue ) === -1;
112+
<pre><code>function( text, searchValue, item ){
113+
return text.toString().toLowerCase().indexOf( searchValue ) === -1;
114114
};</code></pre>
115115

116-
<p>To filter list items by values other than the text, add a <code>data-filtertext</code> attribute to the list item. The value of this attribute will be passed as the first argument to the <code>filterCallback</code> function instead of the text.</p>
116+
<p>To filter list items by values other than the text, add a <code>data-filtertext</code> attribute to the list item. The value of this attribute will be passed as the first argument to the <code>filterCallback</code> function instead of the text. Alternately you can use an attribute of our choosing as defined on the list item itself.</p>
117117

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

docs/pages/loader.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ <h3>More in this section</h3>
107107
<li><a href="page-links.html">Linking pages</a></li>
108108
<li><a href="page-transitions.html">Page transitions</a></li>
109109
<li data-theme="a"><a href="loader.html">Page loading widget</a></li>
110-
<li><a href="page-dialogs.html">Dialogs</a></li>
110+
<li><a href="page-dialogs.html">Dialogs</a></li>
111+
<li><a href="popup/index.html">Popups</a></li>
111112
<li><a href="page-cache.html">Prefetching &amp; caching pages</a></li>
112113
<li><a href="page-navmodel.html">Ajax, hashes &amp; history</a></li>
113114
<li><a href="page-dynamic.html">Dynamically injecting pages</a></li>

docs/pages/page-scripting.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,10 @@ <h2>Binding to mouse and touch events</h2>
113113

114114

115115
<h2>Passing parameters between pages</h2>
116-
<p>jQuery Mobile does not support query parameter passing to internal/embedded pages. For example, if the framework sees a link to <code>"#somePage?someId=1"</code> it interprets that as "#somePage" and navigates to the internal page div with an <code>id</code> of "somePage" and applies a data-url of "#somePage?someId=1" to that page container. Subsequent calls to other params such as <code>"#somePage?someId=2"<code> will find the same div because jQuery Mobile refers to the data-url on the div which is only set once and will remain at <code>"#somePage?someId=1"</code>.</p>
116+
<p>jQuery Mobile does not support query parameter passing to internal/embedded pages. For example, if the framework sees a link to <code>"#somePage?someId=1"</code> it interprets that as <code>"#somePage"</code> and navigates to the internal page div with an <code>id</code> of <code>"somePage"</code> and applies a <code>data-url</code> of <code>"#somePage?someId=1"</code> to that page container.
117+
Subsequent calls to other params such as <code>"#somePage?someId=2"</code> will find the same div because jQuery Mobile refers to the <code>data-url</code> on the <code>div</code> which is only set once and will remain at <code>"#somePage?someId=1"</code>.</p>
117118

118-
<p>There are two plugins that you can add to your project if query parameters are needed between pages. There is a lightweight <a href="https://github.com/jblas/jquery-mobile-plugins/tree/master/page-params" rel="external">page params plugin</a> and a more fully featured <a href="https://github.com/azicchetti/jquerymobile-router" rel="external">jQuery Mobile router plugin</a> for use with backbone.js or spine.js.</p>
119+
<p>There are two plugins that can be added to your project if query parameters are needed between pages. There is a lightweight <a href="https://github.com/jblas/jquery-mobile-plugins/tree/master/page-params" rel="external">page params plugin</a> and a more fully featured <a href="https://github.com/azicchetti/jquerymobile-router" rel="external">jQuery Mobile router plugin</a> for use with backbone.js or spine.js.</p>
119120

120121

121122

docs/pages/popup/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ <h3>More in this section</h3>
238238
<li><a href="../page-titles.html">Page titles</a></li>
239239
<li><a href="../page-links.html">Linking pages</a></li>
240240
<li><a href="../page-transitions.html" data-ajax="false">Page transitions</a></li>
241+
<li><a href="../loader.html">Page loading widget</a></li>
241242
<li><a href="../page-dialogs.html">Dialogs</a></li>
242243
<li data-theme="a"><a href="index.html">Popups</a></li>
243244
<li><a href="../page-cache.html">Prefetching &amp; caching pages</a></li>

docs/toolbars/docs-navbar.html

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,25 @@ <h1>Navbar</h1>
2727
<h2>Simple navbar</h2>
2828

2929
<p>jQuery Mobile has a very basic navbar widget that is useful for providing up to 5 buttons with optional icons in a bar, typically within a header or footer. There is also a <a href="footer-persist-a.html">persistent navbar</a> variation that works more like a tab bar that stays fixed as you navigate across pages.</p>
30-
<p>A navbar is coded as an unordered list of links wrapped in a container element that has the <code> data-role="navbar"</code> attribute. To set one of the links to the active (selected) state, add <code>class="ui-btn-active"</code> to the anchor. In this example, we have a two-button navbar with the "One" item set to active:</p>
30+
<p>A navbar is coded as an unordered list of links wrapped in a container element that has the <code> data-role="navbar"</code> attribute. This is an example of a two-button navbar:</p>
3131

3232
<pre><code>
3333
<strong>&lt;div data-role=&quot;navbar&quot;&gt;</strong>
3434
&lt;ul&gt;
35-
&lt;li&gt;&lt;a href=&quot;a.html&quot; class=&quot;ui-btn-active&quot;&gt;One&lt;/a&gt;&lt;/li&gt;
35+
&lt;li&gt;&lt;a href=&quot;a.html&quot;&gt;One&lt;/a&gt;&lt;/li&gt;
36+
&lt;li&gt;&lt;a href=&quot;b.html&quot;&gt;Two&lt;/a&gt;&lt;/li&gt;
37+
&lt;/ul&gt;
38+
<strong>&lt;/div&gt;&lt;!-- /navbar --&gt;</strong>
39+
</code></pre>
40+
41+
<p>When a link in the navbar is clicked it gets the active (selected) state. The <code>ui-btn-active</code> class is first removed from all anchors in the navbar before it is added to the activated link. If this is a link to another page, the class will be removed again after the transition has completed.</p>
42+
43+
<p>To set an item to the active state upon initialization of the navbar, add <code>class="ui-btn-active"</code> to the corresponding anchor in your markup. Additionaly add a class of <code>ui-state-persist</code> to make the framework restore the active state each time the page is shown while it exists in the DOM. The example below shows a navbar with item "One" set to active:</p>
44+
45+
<pre><code>
46+
<strong>&lt;div data-role=&quot;navbar&quot;&gt;</strong>
47+
&lt;ul&gt;
48+
&lt;li&gt;&lt;a href=&quot;a.html&quot; class=&quot;ui-btn-active ui-state-persist&quot;&gt;One&lt;/a&gt;&lt;/li&gt;
3649
&lt;li&gt;&lt;a href=&quot;b.html&quot;&gt;Two&lt;/a&gt;&lt;/li&gt;
3750
&lt;/ul&gt;
3851
<strong>&lt;/div&gt;&lt;!-- /navbar --&gt;</strong>

0 commit comments

Comments
 (0)