diff --git a/Makefile b/Makefile index 241589df..7c78838d 100644 --- a/Makefile +++ b/Makefile @@ -111,15 +111,12 @@ docs: init css js # ... Update the JavaScript and CSS paths @@find tmp/${NAME} -type f \ \( -name '*.html' -o -name '*.php' \) \ - -exec sed -i '' 's|js/"|${NAME}.min.js"|g' {} \; \ - -exec sed -i '' 's|css/themes/default/|${NAME}.min.css|g' {} \; \ - -exec sed -i '' 's|js/jquery.js"|jquery.js"|g' {} \; - # ... And then move it the finished directory + -exec perl -pi -e \ + 's|js/"|${NAME}.min.js"|g;s|css/themes/default/|${NAME}.min.css|g;s|js/jquery.js"|jquery.js"|g' {} \; + # ... Move and zip up the the whole folder + @@zip -rq ${OUTPUT}/${NAME}.docs.zip tmp/${NAME} @@mv tmp/${NAME} ${OUTPUT}/demos - # Last, zip up the the whole folder - @@zip -rq tmp/${NAME}.zip ${OUTPUT} - @@mv tmp/${NAME}.zip ${OUTPUT}/${NAME}.docs.zip - # Remove the temporary files + # Finish by removing the temporary files @@rm -rf tmp # ------------------------------------------------- @@ -182,7 +179,7 @@ nightlies: init js css zip docs # Time to put these on the CDN @@mkdir -p tmp/nightlies @@mv ${OUTPUT} tmp/nightlies/$$(date "+%Y%m%d") - @@scp -r nightlies/* jqadmin@code.origin.jquery.com:/var/www/html/code.jquery.com/mobile/nightlies/ + @@scp -r tmp/nightlies/* jqadmin@code.origin.jquery.com:/var/www/html/code.jquery.com/mobile/nightlies/ # Do some cleanup to wrap it up @@rm -rf tmp # ------------------------------------------------- diff --git a/README.md b/README.md index 6a4511dc..fb4c2b50 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,16 @@ Clone this repo and build the js and css files (you'll need Git and Make install A full version and a minified version of the jQuery Mobile JavaScript and CSS files will be created in a folder named "compiled". There is also now a Structure only css file so you can add your own theme on top of it. +How to build a self-contained version of the Docs/Demos +======================================================= +Once you have your own cloned repo on your computer: + + make docs + +The docs will be built and available in the compiled/demos folder. You can move this folder to your web server or +other location. It has no dependencies on anything other than a basic HTML web server. + + Submitting bugs =============== If you think you've found a bug, please report it by following these instructions: diff --git a/docs/lists/docs-lists.html b/docs/lists/docs-lists.html index 38025a0d..10963752 100755 --- a/docs/lists/docs-lists.html +++ b/docs/lists/docs-lists.html @@ -35,41 +35,41 @@ Basic list example -
Style note: all standard, non-inset lists have a -15px margin to negate the 15px of padding on the content area to make lists fill to the edges of the screen. If you add other widgets above or below a list, the negative margin may make these elements overlap so you'll need to add additional spacing in your custom CSS.
+Style note on non-inset lists: all standard, non-inset lists have a -15px margin to negate the 15px of padding on the content area to make lists fill to the edges of the screen. If you add other widgets above or below a list, the negative margin may make these elements overlap so you'll need to add additional spacing in your custom CSS.
By nesting child ul or ol inside list items, you can create nested lists. When a list item with a child list is clicked, the framework will generate a new ui-page populated with the title of the parent in the header and the list of child elements. These dynamic nested lists are styled with the "b" theme swatch (blue in the default theme) to indicate that you are in a secondary level of navigation. Lists can be nested multiple level deep and all pages and linking will be automatically handled by the framework.
To set the swatch color of the child list views, data-theme attribute on each list inside.
By nesting child ul or ol inside list items, you can create nested lists. When a list item with a child list is clicked, the framework will generate a new ui-page populated with the title of the parent in the header and the list of child elements. These dynamic nested lists are styled with the "b" theme swatch (blue in the default theme) to indicate that you are in a secondary level of navigation. Lists can be nested multiple levels deep and all pages and linking will be automatically handled by the framework.
To set the swatch color of the child list views, set the data-theme attribute on each list inside.
Lists can also be created from ordered lists (ol) which is useful when presented items that are in a sequence such as search results or a movie queue. When the enhanced markup is applied to the list view, jQuery Mobile will try to first use CSS to add numbers to the list and, if not supported, will fall back to injecting numbers with JavaScript.
Lists can also be created from ordered lists (ol) which is useful when presenting items that are in a sequence such as search results or a movie queue. When the enhanced markup is applied to the list view, jQuery Mobile will try to first use CSS to add numbers to the list and, if not supported, will fall back to injecting numbers with JavaScript.
List views can also be used to display a non-interactive list of items, usually as an inset list. This list is built from an unordered or ordered list that don't have linked list items. The framework defaults to styling these list with the "c" theme swatch (flat white in the default theme) and sets the text size to a smaller size than the clickable lists to save a bit of space.
- Read-only list example + Read-only list exampleIn cases where there is more than one possible action per list item, a split button can be used to offer two independently clickable items -- the list item and a small arrow icon in the far right. To make a split list item, simply add a second link inside the li and the framework will add a vertical divider line, style the link as an icon-only arrow button, and sets the title attribute of the link to the text the link for accessibility.
In cases where there is more than one possible action per list item, a split button can be used to offer two independently clickable items -- the list item and a small arrow icon in the far right. To make a split list item, simply add a second link inside the li and the framework will add a vertical divider line, style the link as an icon-only arrow button, and set the title attribute of the link to the text the link for accessibility.
You can set the icon for the right split icon by specifying a data-split-icon attribute with the icon name you want. The theme swatch color of the split button can be set by specifying a swatch letter in the data-split-theme attribute
List items can be turned into dividers to organize and group the list items. This is done by adding the data-role="list-divider" to any list item. These items are styled with the body swatch "b" by default (light gray in the default theme) but you can specify a theme for dividers by adding the data-dividertheme attribute to the list element (ul or ol) and specifying a theme swatch letter.
List items can be turned into dividers to organize and group the list items. This is done by adding the data-role="list-divider" to any list item. These items are styled with the body swatch "b" by default (light gray in the default theme) but you can specify a theme for dividers by adding the data-dividertheme attribute to the list element (ul or ol) and specifying a theme swatch letter.
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 data-filter="true" 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 mobileinit event and set the $.mobile.listview.prototype.options.filterPlaceholder option to a string of your choosing, or use the data-attribute data-filter-placeholder 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 data-filter-theme on your listview.
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 data-filter="true" 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 mobileinit event and set the $.mobile.listview.prototype.options.filterPlaceholder option to a string of your choosing, or use the data-attribute data-filter-placeholder 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 data-filter-theme on your listview.
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 $.mobile.listview.prototype.options.filterCallback during mobileinit or after the widget has been created with $("#mylist").listview('option', 'filterCallback', yourFilterFunction). 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 searchValue as a substring is described below:
+
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 $.mobile.listview.prototype.options.filterCallback during mobileinit or after the widget has been created with $("#mylist").listview('option', 'filterCallback', yourFilterFunction). 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 searchValue as a substring is described below:
@@ -81,7 +81,7 @@ function( text, searchValue ){
The framework includes text formatting conventions for common list patterns like header/descriptions, secondary information, counts through HTML semantic markup.
+The framework includes text formatting conventions for common list patterns like header/descriptions, secondary information and counts through semantic HTML markup.
ui-li-countTo add thumbnails to the left of a list item, simply add an image inside a list item as the first child element. The framework will scale the image to 80 pixels square. To use standard 16x16 pixel icons in list items, add the class of ui-li-icon to the image element to size.
To add thumbnails to the left of a list item, simply add an image inside a list item as the first child element. The framework will scale the image to 80 pixels square. To use standard 16x16 pixel icons in list items, add the class of ui-li-icon to the image element.
Usually, it's a good idea to store your app's pages in several single-page templates instead of one large multi-page template. This minimizes the size of the page's DOM.
-When using single-page templates, you can prefetch pages into the DOM so that they're available instantly when the user visits them. To prefetch a page, add the data-prefetch attribute to a link that points to the page. jQuery Mobile then loads the target page in the background after the primary page has loaded and the pagecreate event has triggered. For example:
When using single-page templates, you can prefetch pages into the DOM so that they're available instantly when the user visits them. To prefetch a page, add the data-prefetch attribute to a link that points to the page. jQuery Mobile then loads the target page in the background after the primary page has loaded and the pagecreate event has triggered. For example:
<a href="prefetchThisPage.html" data-prefetch> ... </a>
@@ -51,7 +51,7 @@ $.mobile.loadPage( pageUrl, { showLoadMsg: false } );
For animated page transitions to work, the pages you're transitioning from and to both need to be in the DOM. However, keeping old pages in the DOM quickly fills the browser's memory, and can cause some mobile browsers to slow down or even crash.
- jQuery Mobile therefore has a simple mechanism to keep the DOM tidy. Whenever it loads a page via Ajax, jQuery Mobile flags the page to be removed from the DOM when you navigate away from it later (technically, on the pagehide event). If you revisit a removed page, the browser may be able to retrieve the page's HTML file from its cache. If not, it refetches the file from the server. (In the case of nested list views, jQuery Mobile removes all the pages that make up the nested list once you navigate to a page that's not part of the list.)
+ jQuery Mobile therefore has a simple mechanism to keep the DOM tidy. Whenever it loads a page via Ajax, jQuery Mobile flags the page to be removed from the DOM when you navigate away from it later (technically, on the pagehide event). If you revisit a removed page, the browser may be able to retrieve the page's HTML file from its cache. If not, it refetches the file from the server. (In the case of nested list views, jQuery Mobile removes all the pages that make up the nested list once you navigate to a page that's not part of the list.)
Pages inside a multi-page template aren't affected by this feature at all - jQuery Mobile only removes pages loaded via Ajax.
diff --git a/docs/pages/page-scripting.html b/docs/pages/page-scripting.html
index 30c01d90..33df6700 100644
--- a/docs/pages/page-scripting.html
+++ b/docs/pages/page-scripting.html
@@ -22,11 +22,11 @@
- Since jQuery Mobile uses an Ajax-powered navigation system, there are a few helpful things to know when writing scripts that manipulate your content. You can explore the mobile API in more detail by reading up on global configuration options, events, and methods or dig into the technical details of the Ajax navigation model.
+ Since jQuery Mobile uses an Ajax-powered navigation system, there are a few helpful things to know when writing scripts that manipulate your content. You can explore the mobile API in more detail by reading up on global configuration options, events, and methods or dig into the technical details of the Ajax navigation model.
Scripts & styles in the head
- When the user clicks a link in a jQuery Mobile-driven site, the default behavior of the navigation system is to use that link's href to formulate an Ajax request (instead of allowing the browser's default link behavior of requesting that href with full page load). When that Ajax request goes out, the framework will receive its entire text content, but it will only inject the contents of the response's body element (or more specifically the data-role="page" element, if it's provided), meaning nothing in the head of the page will be used (with the exception of the page title, which is fetched specifically).
+ When the user clicks a link in a jQuery Mobile-driven site, the default behavior of the navigation system is to use that link's href to formulate an Ajax request (instead of allowing the browser's default link behavior of requesting that href with full page load). When that Ajax request goes out, the framework will receive its entire text content, but it will only inject the contents of the response's body element (or more specifically the data-role="page" element, if it's provided), meaning nothing in the head of the page will be used (with the exception of the page title, which is fetched specifically).
This means that any scripts and styles referenced the head of a page won't have any effect when a page is loaded via Ajax, but they will execute if the page is requested normally via HTTP. When scripting jQuery Mobile sites, both scenarios need to be considered. The reason that the head of a page is ignored when requested via Ajax is that the potential of re-executing the same JavaScript is very high (it's common to reference the same scripts in every page of a site). Due to the complexity of attempting to work around that issue, we leave the task of executing page-specific scripts to the developer, and assume head scripts are only expected to execute once per browsing session.
@@ -36,7 +36,7 @@
pagecreate = DOM ready
- One of the first things people learn in jQuery is to use the $(document).ready() function for executing DOM-specific code as soon as the DOM is ready (which often occurs long before the onload event). However, in jQuery Mobile site and apps, pages are requested and injected into the same DOM as the user navigates, so the DOM ready event is not as useful, as it only executes for the first page. To execute code whenever a new page is loaded and created in jQuery Mobile, you can bind to the pagecreate event.
+ One of the first things people learn in jQuery is to use the $(document).ready() function for executing DOM-specific code as soon as the DOM is ready (which often occurs long before the onload event). However, in jQuery Mobile site and apps, pages are requested and injected into the same DOM as the user navigates, so the DOM ready event is not as useful, as it only executes for the first page. To execute code whenever a new page is loaded and created in jQuery Mobile, you can bind to the pagecreate event.
The pagecreate event is triggered on a page when it is initialized, right after initialization occurs. Most of jQuery Mobile's official widgets auto-initialize themselves based on this event, and you can set up your code to do the same.
@@ -74,8 +74,8 @@ $.mobile.loadPage( "about/us.html" );
Enhancing new markup
- The page plugin dispatches a “pagecreate” event, which most widgets use to auto-initialize themselves. As long as a widget plugin script is referenced, it will automatically enhance any instances of the widgets it finds on the page.
- However, if you generate new markup client-side or load in content via Ajax and inject it into a page, you can trigger the create event to handle the auto-initialization for all the plugins contained within the new markup. This can be triggered on any element (even the page div itself), saving you the task of manually initializing each plugin (listview button, select, etc.).
+ The page plugin dispatches a pagecreate event, which most widgets use to auto-initialize themselves. As long as a widget plugin script is referenced, it will automatically enhance any instances of the widgets it finds on the page.
+ However, if you generate new markup client-side or load in content via Ajax and inject it into a page, you can trigger the create event to handle the auto-initialization for all the plugins contained within the new markup. This can be triggered on any element (even the page div itself), saving you the task of manually initializing each plugin (listview button, select, etc.).
For example, if a block of HTML markup (say a login form) was loaded in through Ajax, trigger the create event to automatically transform all the widgets it contains (inputs and buttons in this case) into the enhanced versions. The code for this scenario would be:
$( ...new markup that contains widgets... ).appendTo( ".ui-page" ).trigger( "create" );
diff --git a/js/jquery.mobile.collapsible.js b/js/jquery.mobile.collapsible.js
index 27bb2805..115e83e2 100644
--- a/js/jquery.mobile.collapsible.js
+++ b/js/jquery.mobile.collapsible.js
@@ -23,7 +23,7 @@ $.widget( "mobile.collapsible", $.mobile.widget, {
collapsibleHeading = $el.children( o.heading ).first(),
collapsibleContent = collapsible.wrapInner( "" ).find( ".ui-collapsible-content" ),
collapsibleSet = $el.closest( ":jqmData(role='collapsible-set')" ).addClass( "ui-collapsible-set" ),
- colllapsiblesInSet = collapsibleSet.children( ":jqmData(role='collapsible')" );
+ collapsiblesInSet = collapsibleSet.children( ":jqmData(role='collapsible')" );
// Replace collapsibleHeading if it's a legend
if ( collapsibleHeading.is( "legend" ) ) {
@@ -84,14 +84,14 @@ $.widget( "mobile.collapsible", $.mobile.widget, {
});
}
- colllapsiblesInSet.first()
+ collapsiblesInSet.first()
.find( "a" )
.first()
.addClass( "ui-corner-top" )
.find( ".ui-btn-inner" )
.addClass( "ui-corner-top" );
- colllapsiblesInSet.last()
+ collapsiblesInSet.last()
.jqmData( "collapsible-last", true )
.find( "a" )
.first()
diff --git a/js/jquery.mobile.forms.select.custom.js b/js/jquery.mobile.forms.select.custom.js
index b895c99e..cd8ada09 100644
--- a/js/jquery.mobile.forms.select.custom.js
+++ b/js/jquery.mobile.forms.select.custom.js
@@ -30,7 +30,9 @@
"aria-labelledby": buttonId
}).attr( "data-" + $.mobile.ns + "theme", widget.options.theme ).appendTo( listbox ),
- header = $( "" ).attr( "data-" + $.mobile.ns + "theme", widget.options.theme ).prependTo( listbox ),
+ header = $( "", {
+ "class": "ui-header ui-bar-" + widget.options.theme
+ }).prependTo( listbox ),
headerTitle = $( "", {
"class": "ui-title"
diff --git a/tests/speed/stats/index.php b/tests/speed/stats/index.php
index 5922f256..d90e13ac 100644
--- a/tests/speed/stats/index.php
+++ b/tests/speed/stats/index.php
@@ -1,21 +1,48 @@
query('CREATE TABLE IF NOT EXISTS stats (id INTEGER, agent TEXT, point TEXT, value REAL, time TIMESTAMP, pathname TEXT, PRIMARY KEY (id))');
+ $db->query('CREATE TABLE IF NOT EXISTS stats (id INTEGER, agent TEXT, agent_version Text, agent_full TEXT, point TEXT, value REAL, time TIMESTAMP, pathname TEXT, PRIMARY KEY (id))');
// making a sad attempt here to provide a clean REST-respecting url scheme.
// stats with a GET returns - wait for it - the stats, and a post with the
// the right params will create a new entry
if ( $_SERVER['REQUEST_METHOD'] == "GET" ) {
- $json = Array();
- $st = $db->prepare( 'SELECT point, avg(value) as avg_value, pathname, strftime(\'%Y-%m-%d\', time) as day FROM stats GROUP BY pathname, point, strftime(\'%Y-%m-%d\', time) ORDER BY time;' );
- $st->execute();
+ $agent = (empty($_GET['agent'])) ? '' : urldecode($_GET['agent']);
+ $data_point = (empty($_GET['data_point'])) ? '' : urldecode($_GET['data_point']);
+
+ $st = $db->prepare( '
+ SELECT agent, agent_version, point, avg(value) as avg_value,
+ pathname, strftime(\'%Y-%m-%d\', time) as day
+ FROM stats
+ WHERE (agent_full like \'%Mobile%\' or agent_full like \'%mobile%\')
+ and agent like :agent and point like :data_point
+ GROUP BY agent, agent_version, pathname, point, strftime(\'%Y-%m-%d\', time)
+ ORDER BY time;
+ ');
+
+ $st->execute(array(
+ ':agent' => '%' . $agent . '%',
+ ':data_point' => '%' . $data_point . '%'
+ ));
+
$result = $st->fetchAll(PDO::FETCH_ASSOC);
header("Content-Type: application/json");
echo json_encode($result);
- } elseif ( $_POST['datapoint'] && $_POST['value'] && $_POST['agent'] && $_POST['pathname']) {
- $st = $db->prepare('INSERT INTO stats (agent, point, value, pathname, time) VALUES (:agent, :data_point, :value, :pathname, DATETIME(\'now\'))');
+
+ } elseif ( $_POST['datapoint'] &&
+ $_POST['value'] &&
+ $_POST['agent'] &&
+ $_POST['pathname'] &&
+ $_POST['agentVersion'] ) {
+
+ $st = $db->prepare('
+ INSERT INTO stats (agent, agent_full, agent_version, point, value, pathname, time)
+ VALUES (:agent, :agent_full, :agent_version, :data_point, :value, :pathname, DATETIME(\'now\'))
+ ');
+
$st->execute(array(
':agent' => $_POST['agent'],
+ ':agent_full' => $_POST['agentFull'],
+ ':agent_version' => $_POST['agentVersion'],
':data_point' => $_POST['datapoint'],
':value' => $_POST['value'],
':pathname' => $_POST['pathname']
diff --git a/tests/speed/stats/perf.js b/tests/speed/stats/perf.js
index 06873378..7bf21931 100644
--- a/tests/speed/stats/perf.js
+++ b/tests/speed/stats/perf.js
@@ -7,11 +7,14 @@ window.Perf = (function($, Perf) {
currentRev: undefined,
report: function( data, after ) {
- var self = this;
+ $.extend(data, {
+ pathname: location.pathname,
+ agent: this.agent(),
+ agentFull: window.navigator.userAgent,
+ agentVersion: this.agentVersion()
+ });
- data.pathname = location.pathname;
-
- $.post( self.reportUrl, data, after );
+ $.post( this.reportUrl, data, after );
},
poll: function() {
@@ -34,8 +37,44 @@ window.Perf = (function($, Perf) {
$.get( self.revUrl, function( data ) {
self.currentRev = data;
});
- }
+ },
+
+ agent: function() {
+ var agent = window.navigator.userAgent;
+
+ for( name in this.agents ) {
+ if( agent.indexOf( this.agents[name] ) > -1 ) {
+ return this.agents[name];
+ }
+ }
+
+ return agent;
+ },
+
+ agentVersion: function() {
+ var agent = window.navigator.userAgent;
+
+ agent.search(this.vRegexs[this.agent()] || "");
+
+ return RegExp.$1 ? RegExp.$1 : "0.0";
+ },
+
+ agents: {
+ ANDROID: "Android",
+ WP: "Windows Phone OS",
+ IPHONE: "iPhone OS",
+ IPAD: "iPad; U; CPU OS",
+ BLACKBERRY: "BlackBerry"
+ },
+
+ vRegexs: {}
});
+ Perf.vRegexs[Perf.agents.ANDROID] = /([0-9].[0-9].[0-9]);/;
+ Perf.vRegexs[Perf.agents.WP] = /Windows Phone OS ([0-9].[0-9]);/;
+ Perf.vRegexs[Perf.agents.IPHONE] = /iPhone OS ([0-9]_[0-9])/;
+ Perf.vRegexs[Perf.agents.IPAD] = /iPad; U; CPU OS ([0-9]_[0-9])/;
+ Perf.vRegexs[Perf.agents.BLACKBERRY] = /BlackBerry ([0-9]{4})/;
+
return Perf;
})(jQuery, window.Perf || {});
diff --git a/tests/speed/stats/startup.js b/tests/speed/stats/startup.js
index c3e5bccd..6bb389dd 100644
--- a/tests/speed/stats/startup.js
+++ b/tests/speed/stats/startup.js
@@ -22,7 +22,6 @@
// report the time taken for a full app boot
Perf.report({
- agent: window.navigator.userAgent,
datapoint: "fullboot",
value: Perf.pageLoadEnd - Perf.pageLoadStart
});
@@ -30,7 +29,6 @@
// record the time taken to load and enhance the page
// start polling for a new revision
Perf.report({
- agent: window.navigator.userAgent,
datapoint: "pageload",
value: Perf.pageCreateStart - Perf.pageLoadStart,
after: function() {
diff --git a/tests/speed/stats/visualize/visualize.css b/tests/speed/stats/visualize/visualize.css
index 01d40488..5269fd40 100644
--- a/tests/speed/stats/visualize/visualize.css
+++ b/tests/speed/stats/visualize/visualize.css
@@ -41,6 +41,5 @@ table {
div.visualize {
float: left;
- margin-left: 100px;
- margin-right: 50px;
+ margin: 0 50px 70px 100px;
}
\ No newline at end of file
diff --git a/tests/speed/stats/visualize/visualize.js b/tests/speed/stats/visualize/visualize.js
index 32de8c8d..70eda316 100644
--- a/tests/speed/stats/visualize/visualize.js
+++ b/tests/speed/stats/visualize/visualize.js
@@ -1,16 +1,37 @@
(function($) {
+ // TODO this is entire thing sucks
$(function() {
- $.get("../", function(data) {
+ var searchMap = (function() {
+ var searchSplit, searchMap = {};
+
+ if ( !location.search ){
+ return searchMap;
+ }
+
+ searchSplit = location.search.replace(/^\?/, "").split( /&|;/ );
+
+ for( var i = 0; i < searchSplit.length; i++ ) {
+ var kv = searchSplit[i].split(/=/);
+ searchMap[ kv[0] ] = kv[1];
+ }
+
+ return searchMap;
+ })();
+
+ $.get("../", searchMap, function(data) {
$.each(data, function( i, avg ) {
- var $table = $( "#" + avg.point + "[data-pathname='" + avg.pathname + "']");
+ var tablename = avg.point + " " + avg.agent + " " + avg.pathname + " " + avg.agent_version,
+ $table = $( "table > caption:contains(" + tablename + ")");
if( !$table.length ) {
- $table = $( "
", {
- id: avg.point,
- "data-pathname": avg.pathname
+ $table = $( "
", {
+ "data-pathname": avg.pathname,
+ "data-point": avg.point,
+ "data-agent": avg.agent,
+ "data-agent": avg.agent_version
});
- $table.append( "" + avg.point + " " + avg.pathname + " ");
+ $table.append( "" + tablename + " ");
$table.append( " " );
$table.append( " " );
}
@@ -19,7 +40,7 @@
var $heading = $table.find("thead > tr > th:contains(" + avg.day + ")");
if( !$heading.length ) {
- $heading = $("", {
+ $heading = $(" ", {
text: avg.day,
scope: "column"
});
@@ -31,7 +52,7 @@
$row = $table.find( "tbody > tr" );
if( !$rowHeading.length ) {
- $rowHeading = $("", {
+ $rowHeading = $(" ", {
text: avg.point,
scope: "row"
});
@@ -41,10 +62,10 @@
$row.append( "" + avg.avg_value + " " );
- $("#tables").append($table);
+ $("#tables").append($table);
});
- $("#tables table").visualize({ type: "line", width: 400, height: 400 }).appendTo("#graphs");
+ $("#tables table").visualize({ type: "bar", width: 400, height: 400 }).appendTo("#graphs");
});
});
})(jQuery);
\ No newline at end of file
diff --git a/tests/unit/collapsible/collapsible_core.js b/tests/unit/collapsible/collapsible_core.js
index d353e8ac..2aa8d516 100644
--- a/tests/unit/collapsible/collapsible_core.js
+++ b/tests/unit/collapsible/collapsible_core.js
@@ -147,14 +147,17 @@
function() {
var collapsibles = $.mobile.activePage.find( ".ui-collapsible" );
ok( collapsibles.eq(0).find( ".ui-collapsible-heading-toggle" ).hasClass( "ui-btn-up-a" ), "Heading of first collapsible should have class ui-btn-up-a");
- ok( !collapsibles.eq(0).find( ".ui-collapsible-content" ).hasClass( "ui-body-a" ), "Content of first collapsible should NOT have class ui-btn-up-a");
+ ok( !collapsibles.eq(0).find( ".ui-collapsible-content" ).is( ".ui-body-a,.ui-body-b,.ui-body-c" ), "Content of first collapsible should NOT have class ui-btn-up-[a,b,c]");
ok( collapsibles.eq(0).find( ".ui-collapsible-content" ).hasClass( "ui-body-d" ), "Content of first collapsible should NOT have class ui-btn-up-d");
ok( collapsibles.eq(1).find( ".ui-collapsible-heading-toggle" ).hasClass( "ui-btn-up-b" ), "Heading of second collapsible should have class ui-btn-up-b");
+ ok( !collapsibles.eq(1).find( ".ui-collapsible-content" ).is( ".ui-body-a,.ui-body-c,.ui-body-d" ), "Content of second collapsible should NOT have class ui-btn-up-[a,c,d]");
ok( collapsibles.eq(1).find( ".ui-collapsible-content" ).hasClass( "ui-body-b" ), "Content of second collapsible should have class ui-btn-up-b");
ok( collapsibles.eq(2).find( ".ui-collapsible-heading-toggle" ).hasClass( "ui-btn-up-d" ), "Heading of third collapsible should have class ui-btn-up-d");
+ ok( !collapsibles.eq(2).find( ".ui-collapsible-content" ).is( ".ui-body-a,.ui-body-b,.ui-body-c" ), "Content of third collapsible should NOT have class ui-btn-up-[a,b,c]");
ok( collapsibles.eq(2).find( ".ui-collapsible-content" ).hasClass( "ui-body-d" ), "Content of third collapsible should have class ui-btn-up-d");
ok( !collapsibles.eq(2).find( ".ui-collapsible-content" ).hasClass( "ui-collapsible-content-collapsed" ), "Content of third collapsible should NOT have class ui-collapsible-content-collapsed");
ok( collapsibles.eq(3).find( ".ui-collapsible-heading-toggle" ).hasClass( "ui-btn-up-d" ), "Heading of fourth collapsible should have class ui-btn-up-d");
+ ok( !collapsibles.eq(3).find( ".ui-collapsible-content" ).is( ".ui-body-a,.ui-body-b,.ui-body-c" ), "Content of fourth collapsible should NOT have class ui-btn-up-[a,b,c]");
ok( collapsibles.eq(3).find( ".ui-collapsible-content" ).hasClass( "ui-body-d" ), "Content of fourth collapsible should have class ui-btn-up-d");
start();
}