Skip to content

Page events demo and pagecontainer updates #7285

Closed
wants to merge 3 commits into from

4 participants

@arschmitz
jQuery Foundation member

This is demo of page events using the event debugger.
Also included to this is updates to page container based on our decision to unify params and events in pagecontainer.

@gabrielschulhof

@arschmitz After this has landed, we need to update demos/selectmenu-custom-filter/index.php to no longer rely on pagebeforeshow and pagehide. Until then, the deprecated events cannot be replaced, because during pagecontainerhide, I have no way of knowing which page is being hidden: $.mobile.activePage points to the new page, and data only has nextPage.

@coveralls

Coverage Status

Coverage increased (+0.16%) when pulling 303438a on page-events-demo into 8197bb0 on master.

@arschmitz arschmitz commented on an outdated diff May 22, 2014
js/widgets/pagecontainer.js
@@ -788,14 +803,14 @@ define( [
promise = ( new TransitionHandler( transition, reverse, to, from ) ).transition();
+ promise.done($.proxy(function() {
@arschmitz
jQuery Foundation member
arschmitz added a note May 22, 2014

spacing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@arschmitz arschmitz commented on an outdated diff May 22, 2014
js/widgets/pagecontainer.js
@@ -788,14 +803,14 @@ define( [
promise = ( new TransitionHandler( transition, reverse, to, from ) ).transition();
+ promise.done($.proxy(function() {
+ this._triggerCssTransitionEvents( to, from );
+ }, this));
@arschmitz
jQuery Foundation member
arschmitz added a note May 22, 2014

spacing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@arschmitz arschmitz commented on an outdated diff May 22, 2014
js/widgets/pagecontainer.js
- $.extend(triggerData, { toPage: to, options: settings });
+ triggerData.prevPage = this.activePage;
+ $.extend(triggerData, {
@arschmitz
jQuery Foundation member
arschmitz added a note May 22, 2014

spacing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@arschmitz arschmitz commented on the diff May 22, 2014
demos/page-events/docs.php
@@ -0,0 +1,8 @@
+<?php
+ $seconds_to_cache = 3600000;
+ $ts = gmdate("D, d M Y H:i:s", time() + $seconds_to_cache) . " GMT";
+ header("Expires: $ts");
+ header("Pragma: cache");
+ header("Cache-Control: max-age=$seconds_to_cache");
+ echo file_get_contents( "http://api.jquerymobile.com/resources/api.xml" );
+?>
@arschmitz
jQuery Foundation member
arschmitz added a note May 22, 2014

need extra line

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@jaspermdegroot jaspermdegroot added this to the 1.4.3 milestone Jun 5, 2014
@gabrielschulhof

You get the following exception from demos/page-events/alertevents.php when you attempt to open the popup: Uncaught TypeError: Converting circular structure to JSON

@coveralls

Coverage Status

Coverage decreased (-8.21%) when pulling 7aef437 on page-events-demo into 8197bb0 on master.

@coveralls

Coverage Status

Coverage decreased (-8.35%) when pulling 7aef437 on page-events-demo into 8197bb0 on master.

@coveralls

Coverage Status

Coverage decreased (-8.21%) when pulling 733a2fe on page-events-demo into 8197bb0 on master.

@arschmitz
jQuery Foundation member

@gabrielschulhof this failure is legit

@arschmitz arschmitz changed the title from Page events demo: Not for review testing only to Page events demo and pagecontainer updates Jun 14, 2014
@gabrielschulhof

Checking it out ...

@gabrielschulhof

OK ... I need to expect the file URL.

@gabrielschulhof

I haven't tested this with ?jquery=1.8.3 and such.

@gabrielschulhof

OK. This is weird. It's passing locally.

@arschmitz arschmitz added a commit that referenced this pull request Jun 16, 2014
@arschmitz arschmitz Pagecontainer: make all page events go through triggerWithDeprecated
To make sure all former page events have a page container counterpart,
and that this counterpart has both a toPage and prevPage prop on the ui
object
Also add a demo of how to debug pagecontainer events

Fixes gh-7063
Fixes gh-70283
Fixes gh-7176
Closes gh-7285
534e9fe
@coveralls

Coverage Status

Coverage increased (+0.29%) when pulling 534e9fe on page-events-demo into 373ddae on master.

@arschmitz arschmitz Pagecontainer: make all page events go through triggerWithDeprecated
To make sure all former page events have a page container counterpart,
and that this counterpart has both a toPage and prevPage prop on the ui
object
Also add a demo of how to debug pagecontainer events

Fixes gh-7063
Fixes gh-7283
Fixes gh-7176
Closes gh-7285
5319adc
@coveralls

Coverage Status

Coverage increased (+0.22%) when pulling 5319adc on page-events-demo into 373ddae on master.

@arschmitz arschmitz commented on an outdated diff Jun 18, 2014
...integration/pagecontainer/page_event_sequence_core.js
+ "pageload",
+ "pageloadfailed",
+ "pagebeforehide",
+ "pagebeforeshow",
+ "pagehide",
+ "pageshow",
+ "pagechange",
+
+ // Valid as of 1.4.x
+ "pagecontainerbeforechange",
+ "pagecontainerbeforeload",
+ "pagecontainerload",
+ "pagecontainerloadfailed",
+ "pagebeforecreate",
+ "pagecreate",
+ "pageinit",
@arschmitz
jQuery Foundation member
arschmitz added a note Jun 18, 2014

This is deprecated in 1.4.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@arschmitz arschmitz commented on an outdated diff Jun 18, 2014
...integration/pagecontainer/page_event_sequence_core.js
+ data: { prevPage: "start-page", nextPage: undefined, toPage: otherPageUrl } },
+
+ // Deprecated as of 1.4.0
+ { type: "pageload", target: "the-body",
+ data: { prevPage: undefined, nextPage: undefined, toPage: undefined } },
+
+ // Valid
+ { type: "pagecontainerload", target: "the-body",
+ data: { prevPage: undefined, nextPage: undefined, toPage: undefined } },
+
+ // Valid - page widget events
+ { type: "pagebeforecreate", target: "other-page",
+ data: { prevPage: undefined, nextPage: undefined, toPage: undefined } },
+ { type: "pagecreate", target: "other-page",
+ data: { prevPage: undefined, nextPage: undefined, toPage: undefined } },
+ { type: "pageinit", target: "other-page",
@arschmitz
jQuery Foundation member
arschmitz added a note Jun 18, 2014

Same as above this is deprecated in 1.4.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@arschmitz arschmitz added a commit that closed this pull request Jun 18, 2014
@arschmitz arschmitz Pagecontainer: make all page events go through triggerWithDeprecated
To make sure all former page events have a page container counterpart,
and that this counterpart has both a toPage and prevPage prop on the ui
object
Also add a demo of how to debug pagecontainer events

Fixes gh-7063
Fixes gh-7283
Fixes gh-7176
Closes gh-7285
3d4d7dd
@arschmitz arschmitz closed this in 3d4d7dd Jun 18, 2014
@coveralls

Coverage Status

Coverage increased (+0.17%) when pulling 5919875 on page-events-demo into 373ddae on master.

@arschmitz arschmitz added a commit that referenced this pull request Jun 18, 2014
@arschmitz arschmitz Pagecontainer: make all page events go through triggerWithDeprecated
To make sure all former page events have a page container counterpart,
and that this counterpart has both a toPage and prevPage prop on the ui
object
Also add a demo of how to debug pagecontainer events

Fixes gh-7063
Fixes gh-7283
Fixes gh-7176
Closes gh-7285

(cherry picked from commit 3d4d7dd)
40b626e
@arschmitz arschmitz deleted the page-events-demo branch Jul 1, 2014
@agcolom agcolom added a commit to agcolom/jquery-mobile that referenced this pull request Nov 26, 2014
@arschmitz arschmitz Pagecontainer: make all page events go through triggerWithDeprecated
To make sure all former page events have a page container counterpart,
and that this counterpart has both a toPage and prevPage prop on the ui
object
Also add a demo of how to debug pagecontainer events

Fixes gh-7063
Fixes gh-7283
Fixes gh-7176
Closes gh-7285
d76c5c9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.