From 9e255e6e750455bb65e83d1b66bc6db849d8ee8c Mon Sep 17 00:00:00 2001 From: John Bender Date: Mon, 7 Nov 2011 15:48:55 -0800 Subject: [PATCH 01/15] add the pathname to the stats to differentiate tests. add grouping --- tests/speed/stats/index.php | 11 ++++++----- tests/speed/stats/perf.js | 2 ++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/tests/speed/stats/index.php b/tests/speed/stats/index.php index 9f912a17..b0b65315 100644 --- a/tests/speed/stats/index.php +++ b/tests/speed/stats/index.php @@ -1,23 +1,24 @@ query('CREATE TABLE IF NOT EXISTS stats (id INTEGER, agent TEXT, point TEXT, value REAL, time TIMESTAMP, PRIMARY KEY (id))'); + $db->query('CREATE TABLE IF NOT EXISTS stats (id INTEGER, agent 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 agent, point, value, time FROM stats' ); + $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);' ); $st->execute(); $result = $st->fetchAll(PDO::FETCH_ASSOC); header("Content-Type: application/json"); echo json_encode($result); - } elseif ( $_POST['datapoint'] && $_POST['value'] && $_POST['agent'] ) { - $st = $db->prepare('INSERT INTO stats (agent, point, value, time) VALUES (:agent, :data_point, :value, DATETIME(\'now\'))'); + } 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\'))'); $st->execute(array( ':agent' => $_POST['agent'], ':data_point' => $_POST['datapoint'], - ':value' => $_POST['value'] + ':value' => $_POST['value'], + ':pathname' => $_POST['pathname'] )); echo "success"; diff --git a/tests/speed/stats/perf.js b/tests/speed/stats/perf.js index 343c0be6..06873378 100644 --- a/tests/speed/stats/perf.js +++ b/tests/speed/stats/perf.js @@ -9,6 +9,8 @@ window.Perf = (function($, Perf) { report: function( data, after ) { var self = this; + data.pathname = location.pathname; + $.post( self.reportUrl, data, after ); }, From 1d5f2af29306c0c4bc5e304d21b0867680afaa9a Mon Sep 17 00:00:00 2001 From: John Bender Date: Mon, 7 Nov 2011 16:56:00 -0800 Subject: [PATCH 02/15] first pass at visualizing data collection --- tests/speed/stats/index.php | 2 +- tests/speed/stats/visualize/index.html | 18 ++++++++ tests/speed/stats/visualize/visualize.css | 46 +++++++++++++++++++++ tests/speed/stats/visualize/visualize.js | 50 +++++++++++++++++++++++ 4 files changed, 115 insertions(+), 1 deletion(-) create mode 100644 tests/speed/stats/visualize/index.html create mode 100644 tests/speed/stats/visualize/visualize.css create mode 100644 tests/speed/stats/visualize/visualize.js diff --git a/tests/speed/stats/index.php b/tests/speed/stats/index.php index b0b65315..5922f256 100644 --- a/tests/speed/stats/index.php +++ b/tests/speed/stats/index.php @@ -7,7 +7,7 @@ // 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);' ); + $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(); $result = $st->fetchAll(PDO::FETCH_ASSOC); header("Content-Type: application/json"); diff --git a/tests/speed/stats/visualize/index.html b/tests/speed/stats/visualize/index.html new file mode 100644 index 00000000..0a8c6afb --- /dev/null +++ b/tests/speed/stats/visualize/index.html @@ -0,0 +1,18 @@ + + + + + + + + + + +
+
+ +
+ +
+ + diff --git a/tests/speed/stats/visualize/visualize.css b/tests/speed/stats/visualize/visualize.css new file mode 100644 index 00000000..2999fe1d --- /dev/null +++ b/tests/speed/stats/visualize/visualize.css @@ -0,0 +1,46 @@ +/*plugin styles*/ +.visualize { border: 1px solid #888; position: relative; background: #fafafa; } +.visualize canvas { position: absolute; } +.visualize ul,.visualize li { margin: 0; padding: 0;} + +/*table title, key elements*/ +.visualize .visualize-info { padding: 3px 5px; background: #fafafa; border: 1px solid #888; position: absolute; top: -20px; right: 10px; opacity: .8; } +.visualize .visualize-title { display: block; color: #333; margin-bottom: 3px; font-size: 1.1em; } +.visualize ul.visualize-key { list-style: none; } +.visualize ul.visualize-key li { list-style: none; float: left; margin-right: 10px; padding-left: 10px; position: relative;} +.visualize ul.visualize-key .visualize-key-color { width: 6px; height: 6px; left: 0; position: absolute; top: 50%; margin-top: -3px; } +.visualize ul.visualize-key .visualize-key-label { color: #000; } + +/*pie labels*/ +.visualize-pie .visualize-labels { list-style: none; } +.visualize-pie .visualize-label-pos, .visualize-pie .visualize-label { position: absolute; margin: 0; padding:0; } +.visualize-pie .visualize-label { display: block; color: #fff; font-weight: bold; font-size: 1em; } +.visualize-pie-outside .visualize-label { color: #000; font-weight: normal; } + +/*line,bar, area labels*/ +.visualize-labels-x,.visualize-labels-y { position: absolute; left: 0; top: 0; list-style: none; } +.visualize-labels-x li, .visualize-labels-y li { position: absolute; bottom: 0; } +.visualize-labels-x li span.label, .visualize-labels-y li span.label { position: absolute; color: #555; } +.visualize-labels-x li span.line, .visualize-labels-y li span.line { position: absolute; border: 0 solid #ccc; } +.visualize-labels-x li { height: 100%; } +.visualize-labels-x li span.label { top: 100%; margin-top: 5px; } +.visualize-labels-x li span.line { border-left-width: 1px; height: 100%; display: block; } +.visualize-labels-x li span.line { border: 0;} /*hide vertical lines on area, line, bar*/ +.visualize-labels-y li { width: 100%; } +.visualize-labels-y li span.label { right: 100%; margin-right: 5px; display: block; width: 100px; text-align: right; } +.visualize-labels-y li span.line { border-top-width: 1px; width: 100%; } +.visualize-bar .visualize-labels-x li span.label { width: 100%; text-align: center; } + +body { + margin-top: 50px; +} + +table { + display: none; +} + +div.visualize { + float: left; + margin-left: 50px; + margin-right: 50px; +} \ No newline at end of file diff --git a/tests/speed/stats/visualize/visualize.js b/tests/speed/stats/visualize/visualize.js new file mode 100644 index 00000000..32de8c8d --- /dev/null +++ b/tests/speed/stats/visualize/visualize.js @@ -0,0 +1,50 @@ +(function($) { + $(function() { + $.get("../", function(data) { + $.each(data, function( i, avg ) { + var $table = $( "#" + avg.point + "[data-pathname='" + avg.pathname + "']"); + + if( !$table.length ) { + $table = $( "", { + id: avg.point, + "data-pathname": avg.pathname + }); + + $table.append( ""); + $table.append( "" ); + $table.append( "" ); + } + + // TODO assume time ordering in the data set + var $heading = $table.find("thead > tr > th:contains(" + avg.day + ")"); + + if( !$heading.length ) { + $heading = $("" ); + + $("#tables").append($table); + }); + + $("#tables table").visualize({ type: "line", width: 400, height: 400 }).appendTo("#graphs"); + }); + }); +})(jQuery); \ No newline at end of file From 4f354bafbcdda07ab119d443f8737a76408770c0 Mon Sep 17 00:00:00 2001 From: "Eddie Monge Jr." Date: Mon, 7 Nov 2011 18:14:29 -0800 Subject: [PATCH 03/15] Wrong OR operator to compare values --- experiments/scrollview/scrollview.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/experiments/scrollview/scrollview.js b/experiments/scrollview/scrollview.js index f033c784..cac968ed 100644 --- a/experiments/scrollview/scrollview.js +++ b/experiments/scrollview/scrollview.js @@ -1,8 +1,8 @@ function ResizePageContentHeight(page) { var $page = $(page), $content = $page.children( ".ui-content" ), - hh = $page.children( ".ui-header" ).outerHeight() : 0, - fh = $page.children( ".ui-footer" ).outerHeight() : 0, + hh = $page.children( ".ui-header" ).outerHeight() || 0, + fh = $page.children( ".ui-footer" ).outerHeight() || 0, pt = parseFloat($content.css( "padding-top" )), pb = parseFloat($content.css( "padding-bottom" )), wh = window.innerHeight; From 2b618a1215058d393179ab17ff056857cb9df25a Mon Sep 17 00:00:00 2001 From: Todd Parker Date: Mon, 7 Nov 2011 22:29:00 -0500 Subject: [PATCH 04/15] Added docs for dialog overlay attr, created a demo page to show this in action --- docs/pages/dialog-overlay.html | 37 ++++++++++++++++++++++++++++++++++ docs/pages/page-dialogs.html | 22 +++++++++++++------- 2 files changed, 52 insertions(+), 7 deletions(-) create mode 100644 docs/pages/dialog-overlay.html diff --git a/docs/pages/dialog-overlay.html b/docs/pages/dialog-overlay.html new file mode 100644 index 00000000..41bff2f9 --- /dev/null +++ b/docs/pages/dialog-overlay.html @@ -0,0 +1,37 @@ + + + + + + jQuery Mobile Framework - Dialog Example + + + + + + + + + +
+
+

Dialog

+
+ +
+

Custom overlay

+

This dialog adds data-overlay-theme="e" to the page container to set the overlay swatch color.

+ I like it +
+ +
+
+ + + +
+
+ + + + \ No newline at end of file diff --git a/docs/pages/page-dialogs.html b/docs/pages/page-dialogs.html index 4a5118b1..e3dfc396 100755 --- a/docs/pages/page-dialogs.html +++ b/docs/pages/page-dialogs.html @@ -60,21 +60,29 @@

Since dialogs are typically used to support actions within a page, the framework does not include dialogs in the hash state history tracking. This means that dialogs will not appear in your browsing history chronology when the Back button is clicked. For example, if you are on a page, click a link to open a dialog, close the dialog, then navigate to another page, if you were to click the browser's Back button at that point you will navigate back to the first page, not the dialog.

Styling & theming

-

Dialogs can be styled with different themes, just like any page. Here is a different dialog design:

+

Dialogs can be styled with different theme swatches, just like any page by adding data-theme attributes to the header, content, or footer containers. Here is an example of a different dialog design:

An alternate color scheme + +

Dialogs appear float above an overlay layer. This overlay adopts the swatch A content color by default, but the data-overlay-theme attribute can be added to the page wrapper to set the overlay to any swatch letter. Here is an example of a dialog with the overlay set to swatch e:

+ Custom overlay swatch

And dialogs can be can used more like a control sheet to offer multiple buttons by removing the header:

Share photos... -

For the sake of readability, dialogs have a default max-width of 500 pixels (plus 15px padding on each side). To override this, use the following CSS in your theme:

+

Dialog width and margins

+

For the sake of readability, dialogs have a default max-width of 500 pixels (plus 15px padding on each side). There is also a 10% top margin to give dialogs larger top margin on larger screens, but collapse to a small margin on smartphones. To override these styles, add the following CSS override rule to your stylesheet and tweak as needed:

- -.ui-dialog .ui-header, -.ui-dialog .ui-content, -.ui-dialog .ui-footer { max-width: 100%; } - +
+.ui-dialog .ui-header, 
+.ui-dialog .ui-content, 
+.ui-dialog .ui-footer { 
+	max-width: 500px; 
+	margin: 10% auto 15px auto; 
+}
+
+ From 82b7dcc1d136d86d8b8fbff4073bcfd1d11fc1af Mon Sep 17 00:00:00 2001 From: Todd Parker Date: Mon, 7 Nov 2011 22:47:47 -0500 Subject: [PATCH 05/15] Added overlay-theme attr info for selects --- docs/forms/selects/index.html | 73 +++++++++++++++++++++++++++++++++-- 1 file changed, 70 insertions(+), 3 deletions(-) diff --git a/docs/forms/selects/index.html b/docs/forms/selects/index.html index 7ae82e53..894bd61a 100644 --- a/docs/forms/selects/index.html +++ b/docs/forms/selects/index.html @@ -583,18 +583,85 @@ $.mobile.selectmenu.prototype.options.hidePlaceholderMenuItems = false; -

Styling with data attributes

+

Theming selects

You can specify any jQuery Mobile button data- attribute on a select element, too. In this example, we're setting the theme, icon and inline properties:

-
- +

The data-overlay-theme attribute can be added a select element to set the color of the overlay layer that the dialog-based custom select menus and the outer border of the smaller custom menus. By default, the content block colors for swatch A will be used for the overlays.

+ +
+ + +
+ +
+ + +
+

Calling the select menu plugin

The select menu plugin will auto initialize on any page that contains a select menu, no need for a data-role attribute in the markup. However, you can directly call the select menu plugin on any selector, just like any normal jQuery plugin:

From 72ff4596026ba0b331c951e7192a783ca989971a Mon Sep 17 00:00:00 2001 From: Todd Parker Date: Mon, 7 Nov 2011 22:52:06 -0500 Subject: [PATCH 06/15] Adjusted dialog docs --- docs/api/data-attributes.html | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/docs/api/data-attributes.html b/docs/api/data-attributes.html index 75a7dc09..cfdd8083 100644 --- a/docs/api/data-attributes.html +++ b/docs/api/data-attributes.html @@ -109,12 +109,37 @@
" + avg.point + " " + avg.pathname + "
", { + text: avg.day, + scope: "column" + }); + + $table.find("thead > tr").append($heading); + } + + var $rowHeading = $table.find("tbody > tr > th:contains(" + avg.point + ")" ), + $row = $table.find( "tbody > tr" ); + + if( !$rowHeading.length ) { + $rowHeading = $("", { + text: avg.point, + scope: "row" + }); + + $row.append( $rowHeading ); + } + + $row.append( "" + avg.avg_value + "swatch letter (a-z) - Sets all collapsibles in set
- +

Dialog

+

Container with data-role="page" or "dialog" linked to with data-rel="dialog" on the anchor.

+ + + + + + + + + + + + + + + + - + + + + + + + + +
data-close-btn-textstring (text for the close button, dialog only)
data-dom-cachetrue | false
data-idstring (unique id for the page)
data-fullscreentrue | false (used in conjunction with fixed toolbars)
data-overlay-themeswatch letter (a-z) - overlay themeswatch letter (a-z) - overlay theme when the page is opened in a dialog
data-themeswatch letter (a-z)
data-titlestring (title used when page is shown)
@@ -280,7 +305,7 @@

Page

-

Container with data-role="page" or "dialog"

+

Container with data-role="page"

From 8dcef4493d4ab2e54421b79b5e06bafdcbebc530 Mon Sep 17 00:00:00 2001 From: Ghislain Seguin Date: Mon, 7 Nov 2011 21:01:26 -0800 Subject: [PATCH 07/15] Fix for #2954 --- js/jquery.mobile.forms.select.custom.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/jquery.mobile.forms.select.custom.js b/js/jquery.mobile.forms.select.custom.js index 2bccb6ab..7ca8ed14 100644 --- a/js/jquery.mobile.forms.select.custom.js +++ b/js/jquery.mobile.forms.select.custom.js @@ -24,7 +24,7 @@ "
"+ "" ).appendTo( $.mobile.pageContainer ).page(), - listbox = $("
", { "class": "ui-selectmenu ui-selectmenu-hidden ui-overlay-shadow ui-corner-all ui-overlay-" + widget.options.overlayTheme + " " + $.mobile.defaultDialogTransition } ).insertAfter(screen), + listbox = $("
", { "class": "ui-selectmenu ui-selectmenu-hidden ui-overlay-shadow ui-corner-all ui-body-" + widget.options.overlayTheme + " " + $.mobile.defaultDialogTransition } ).insertAfter(screen), list = $( "
    ", { "class": "ui-selectmenu-list", From c832f64ae890602d33e6328e8649128e1a76e4fc Mon Sep 17 00:00:00 2001 From: Anne-Gaelle Colom Date: Tue, 8 Nov 2011 13:45:37 +0000 Subject: [PATCH 08/15] Update docs/api/globalconfig.html --- docs/api/globalconfig.html | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/api/globalconfig.html b/docs/api/globalconfig.html index 55745e83..2b40ab55 100755 --- a/docs/api/globalconfig.html +++ b/docs/api/globalconfig.html @@ -145,6 +145,7 @@ $(document).bind("mobileinit", function(){
  • Configuring defaults
  • Events
  • Methods & Utilities
  • +
  • Responsive layout
  • Data attribute reference
  • Theme framework
From 7dba08a10ba96d2eab733c643d21dad831a0cae0 Mon Sep 17 00:00:00 2001 From: Anne-Gaelle Colom Date: Tue, 8 Nov 2011 13:47:51 +0000 Subject: [PATCH 09/15] Update docs/api/events.html --- docs/api/events.html | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/api/events.html b/docs/api/events.html index 359ebb1a..191bcbab 100755 --- a/docs/api/events.html +++ b/docs/api/events.html @@ -493,6 +493,7 @@ $( '#foo' ).hide().trigger( 'updatelayout' );
  • Configuring defaults
  • Events
  • Methods & Utilities
  • +
  • Responsive layout
  • Data attribute reference
  • Theme framework
  • From b019fa4c585a26eb7d42a1801bf45a5fa30a3e44 Mon Sep 17 00:00:00 2001 From: Anne-Gaelle Colom Date: Tue, 8 Nov 2011 13:49:10 +0000 Subject: [PATCH 10/15] Update docs/api/methods.html --- docs/api/methods.html | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/api/methods.html b/docs/api/methods.html index ebd2f78b..3dd2e9a1 100755 --- a/docs/api/methods.html +++ b/docs/api/methods.html @@ -548,6 +548,7 @@ $.mobile.silentScroll(100);
  • Configuring defaults
  • Events
  • Methods & Utilities
  • +
  • Responsive layout
  • Data attribute reference
  • Theme framework
  • From b64da2f5f24c608f4777ebce138f41e3c0fc08c1 Mon Sep 17 00:00:00 2001 From: Ghislain Seguin Date: Tue, 8 Nov 2011 06:26:12 -0800 Subject: [PATCH 11/15] Revert "Update docs/api/methods.html" This reverts commit b019fa4c585a26eb7d42a1801bf45a5fa30a3e44. --- docs/api/methods.html | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/api/methods.html b/docs/api/methods.html index 3dd2e9a1..ebd2f78b 100755 --- a/docs/api/methods.html +++ b/docs/api/methods.html @@ -548,7 +548,6 @@ $.mobile.silentScroll(100);
  • Configuring defaults
  • Events
  • Methods & Utilities
  • -
  • Responsive layout
  • Data attribute reference
  • Theme framework
  • From 103a59c24bd64b8560f120a0b4609c0c3e300833 Mon Sep 17 00:00:00 2001 From: Ghislain Seguin Date: Tue, 8 Nov 2011 06:26:22 -0800 Subject: [PATCH 12/15] Revert "Update docs/api/events.html" This reverts commit 7dba08a10ba96d2eab733c643d21dad831a0cae0. --- docs/api/events.html | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/api/events.html b/docs/api/events.html index 191bcbab..359ebb1a 100755 --- a/docs/api/events.html +++ b/docs/api/events.html @@ -493,7 +493,6 @@ $( '#foo' ).hide().trigger( 'updatelayout' );
  • Configuring defaults
  • Events
  • Methods & Utilities
  • -
  • Responsive layout
  • Data attribute reference
  • Theme framework
  • From 80644f305e9b5524c868fe3ef12b5b748b582c13 Mon Sep 17 00:00:00 2001 From: Ghislain Seguin Date: Tue, 8 Nov 2011 06:26:24 -0800 Subject: [PATCH 13/15] Revert "Update docs/api/globalconfig.html" This reverts commit c832f64ae890602d33e6328e8649128e1a76e4fc. --- docs/api/globalconfig.html | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/api/globalconfig.html b/docs/api/globalconfig.html index 2b40ab55..55745e83 100755 --- a/docs/api/globalconfig.html +++ b/docs/api/globalconfig.html @@ -145,7 +145,6 @@ $(document).bind("mobileinit", function(){
  • Configuring defaults
  • Events
  • Methods & Utilities
  • -
  • Responsive layout
  • Data attribute reference
  • Theme framework
  • From d53d3f8359ec0466c1a9e58d203c5fe950af8879 Mon Sep 17 00:00:00 2001 From: Maurice Gottlieb Date: Tue, 8 Nov 2011 15:37:47 +0100 Subject: [PATCH 14/15] removing link to discarded page Responsive Layout Helpers --- docs/api/data-attributes.html | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/api/data-attributes.html b/docs/api/data-attributes.html index cfdd8083..67b441d7 100644 --- a/docs/api/data-attributes.html +++ b/docs/api/data-attributes.html @@ -432,7 +432,6 @@
  • Configuring defaults
  • Events
  • Methods & Utilities
  • -
  • Responsive layout
  • Data attribute reference
  • Theme framework
  • From 7a1d5ec057a99cb4bda25cdb3d3a00cb5726a69c Mon Sep 17 00:00:00 2001 From: Anne-Gaelle Colom Date: Tue, 8 Nov 2011 15:14:21 +0000 Subject: [PATCH 15/15] Update docs/toolbars/docs-headers.html --- docs/toolbars/docs-headers.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/toolbars/docs-headers.html b/docs/toolbars/docs-headers.html index b20eebb3..c9ef4764 100644 --- a/docs/toolbars/docs-headers.html +++ b/docs/toolbars/docs-headers.html @@ -169,7 +169,7 @@
  • Navbars
  • Fixed positioning
  • Fullscreen positioning
  • -
  • Persistent footer nav bar
  • +
  • Persistent footer navbar
  • Theming toolbars
  • data-close-btn-text