Commit graph

80 commits

Author SHA1 Message Date
John Bender
9b73a750d4 use jQuery.trim 2011-10-11 08:31:37 -07:00
John Bender
1b6ac290d2 add keepNativeSelector method to page widget for use in child form creat bindings 2011-10-10 14:21:36 -07:00
scottjehl
ebafc02cfe add tabindex to page element 2011-09-06 12:58:14 -04:00
scottjehl
6de76168af Clarified the documentation around the purpose of the pagebeforecreate event and removed the pagebeforecreate return value check, as returning beforecreate false is no longer relevant now that all plugins auto-init externally, rather than inline in the page plugin. 2011-08-27 11:26:16 -04:00
scottjehl
10e2d5a61a previous commit should not have switched the order of trigger and add classes. Reverted, with cleanup still in place. 2011-08-27 11:07:21 -04:00
scottjehl
ce5ce102dc A little simplification in the page plugin 2011-08-27 10:58:46 -04:00
John Bender
27b4ba1691 ajaxDomCaching -> domCache 2011-07-29 10:10:26 -07:00
scottjehl
dc054a10e7 implemented ajax dom caching option of the page plugin, which can be overridden by page options or data attribute. Includes unit test to support feature. 2011-07-29 10:10:25 -07:00
scottjehl
2a6c7fc1b9 This commit decouples all widgets from the page plugin so that they can be used ad-hoc.
- Internally, each plugin self-initializes by binding to the pagecreate event.

- Unit tests have been added and adjusted to support some internal changes involved in this commit.

- In the process, the portions of the page plugin that were used to enhance the header,content,and footer sections of a native-app style page layout are now located in jquery.mobile.page.sections.js.

- No public API options have changed, except that the page plugin no longer has options for keepNative, and degradeInputs, as plugins now handle these internally (keepNative was never documented, and degradeInputs only affected slider, so it lives there now. Page options related to the page sections are now located in the page.sections script, but they are still configurable via the page plugin's options api.

- Make, Ant, and index files are updated with a new load order for all JS files.
2011-07-19 22:25:23 -04:00
scottjehl
3deaa97c3a removed the globalpagecreate event trigger that came with the previous pull request, as it was never necessary. 2011-07-10 16:12:05 -04:00
Eugen
1068f3e968 globalpagecreate-Event 2011-06-30 13:24:24 +02:00
Rick Waldron
658a420c3b Fixes regression: jquery.mobile.page.js - revert var decl 2011-06-29 13:24:55 -04:00
Rick Waldron
a98a0d951f Fixes regression: jquery.mobile.page.js 2011-06-29 13:08:04 -04:00
Rick Waldron
dfea9e2b83 jQuery core style guide conformance: jquery.mobile.page.js 2011-06-29 09:27:58 -04:00
Ghislain Seguin
ebd4eeced0 Fix for issue #1929 (second attempt) 2011-06-24 21:13:46 -07:00
scottjehl
fd0819f379 turned auto back button additions off by default. Fixes #1657. To turn auto backbuttons on, you can set the page plugin's autoBackBtn option to true per page, or globally via its configuration prototype. You can also use the data-auto-back-btn attribute on a page div. 2011-05-18 17:17:13 -04:00
scottjehl
4f4718731f Incorporating mariozaizar's changes to add a backBtnTheme option (null by default) to the page plugin. A few edits were needed to support namespacing and a proper null default so theme inheritance is the default. 2011-03-27 18:29:45 -04:00
scottjehl
d59ba5a31a moved a couple of concats over to :jqmData() selector 2011-03-26 10:09:52 -04:00
scottjehl
7503f62a10 changed our two new custom data helper names to jqmData() and :jqmData() 2011-03-25 17:50:40 -04:00
Kin Blas
db89e1f24d Switch find/filter selector calls over to using the new :jqdata() pseudo selector. 2011-03-22 13:31:17 -07:00
John Bender
63e8f6bfcb resolved merge conflicts and fixed 2 tests 2011-03-15 23:57:17 -07:00
John Bender
a987adb610 altered type attribute regex per @jblas, moved to 'private' prototype attribute for testing 2011-03-14 23:50:20 -07:00
John Bender
84ac4ebbb2 fixed input type regex for ff. It puts the type attribute at the end of the html string and breaks the trailing space. Checked in ie7 2011-03-14 08:22:44 -07:00
scottjehl
793d03b2e6 adjusted input element replacement regexp to account for non-quoted type attributes when replacing markup. This change lets things work properly in IE, so plugins like the slider now get enhanced. 2011-03-14 00:20:24 -04:00
scottjehl
ea60207c1b changed custom data method to $.fn.mobileData() and updated plugins that use it. 2011-03-09 23:27:21 -05:00
scottjehl
19f5fd7cae changed the default namespace to "" and updated the docs/demos as such 2011-03-09 22:36:14 -05:00
scottjehl
be0634efb8 fixed typo in class 2011-03-09 21:30:22 -05:00
scottjehl
9e91fa6752 updated docs with jq namespace, found some more stragglers 2011-03-09 21:03:40 -05:00
scottjehl
ce34ece257 namespaced data- attrs to $.mobile.ns (defaults to "jq-") throughout the JS 2011-03-09 20:47:44 -05:00
scottjehl
bd79c32c9a Page min-height was being calculated with JS and it was far too tall. This moves the values into CSS with values that are aimed towards iPhone (as this is addressing an iPhone transitions issue with the address bar show/hide). 2011-02-03 17:22:23 -05:00
scottjehl
eb2845d1dc fixed one additional back button condition mentioned in issue #930 where the back button is added to a page that is directly linked with no hash. All navigation tests passing. https://github.com/jquery/jquery-mobile/issues/issue/930 2011-02-01 00:32:59 -05:00
scottjehl
b3a8230638 This commit includes simplifications to the hashchange event handling & changePage logic, which results in a few bug fixes and removal of some previous limitations. Details:
- jquery.mobile.core.js  no longer creates pages from every page and dialog in the DOM automatically at domready. Instead, pages are created as they are referenced via changePage, which can speed up pageload in multi-page documents, and means local "dialogs" referenced via data-rel="dialog" no longer need a data-role="dialog" attribute when served.

- in changePage, "from" is now allowed to be undefined. This simplifies the logic involved in showing the first page, which never had a "from" page, and previously needed a custom pageChange workaround to accommodate that.

- The pageshow event is no longer used as a callback for returning false and preventing the $.mobile.activePage from being set to the newly shown page. In other words, a page always becomes $.mobile.activePage once its shown now (the only reason this was optional before was because of a dialog restriction that's no longer true)

- the hashchange event logic for showing a particular page is now greatly simplified. It either shows the page referenced in location.hash, or if there's no hash it changes to the first page in the dom. This means every pageshow (including the first one) now uses pageChange internally.

- the hashchange event listener is no longer disabled when ajaxEnabled == false. Doing this before prevented local non-ajax page navigation from working properly. To disable hashchange listening, use $.mobile.urlHistory.listeningEnabled. We might consider defining (or moving) this on the $.mobile hash later as well for easier access.

- The internal var $.mobile.startPage is now $.mobile.firstPage, because it's not necessarily the page you started on, but merely a reference to the first "page" in the dom.

- Back buttons are auto-added to every page after the first one you first visit (this includes generated pages, such as those in a multipage document or nested listviews). Keep in mind that a "back" button does not take the place of a standard "home" link, and when building an app with jQuery Mobile, it's good to make use of both (particularly on deep-linked pages). Fixes #908
2011-01-31 17:05:57 -05:00
Jesse Streb
d3077b491c [455] Am now setting the min-height of a page so that the address bar can always be hidden on a silent scroll. This helps our transitions feel smoother as the page does not jump down if the page is not taller then 100% of the window. On orientation change we also update this value. 2011-01-27 12:28:04 -05:00
scottjehl
e2c66fad49 Merge remote branch 'origin/master' 2011-01-26 22:15:10 -08:00
scottjehl
d1976fa265 removed click handler on back button - used data-rel='back' instead. 2011-01-26 18:57:14 -05:00
scottjehl
fa2b1903de only add a back button when there's a history entry to return to. 2011-01-26 17:56:20 -05:00
Kin Blas
63a82967fa Temporary workaround for Issue 785 - jQM text input forces use of iOS auto-correction.
- Added code to enhanceControls() that sets the autocorrect and autocomplete attributes on all inputs of type="text" to "off". This basically disables the use of autocorrection on iOS.

- Modified the code in enhanceControls() to cache the form controls query to reduce the number of times we search for controls in the current page.
2011-01-26 14:31:47 -08:00
scottjehl
9b57c46349 Refactored urlStack and updated dialog and page plugins to match. jQuery Mobile's internal history now attempts to follow the history menu when urls change from hashchange, even for changes that go multiple steps forward or back. The internal history stack is now pruned based on whether a user goes back and then changes direction, whereas before a back-button click would result in a pop off the history. Instead we now maintain an active index number in the history stack, which allows us to maintain references to transitions that are saved on pages reached through clicking the forward button as well. This fixes #636.
In the process, some other small changes should be noted:
urlStack is now urlHistory, a hash of methods and properties used for history stack management (stack, activeIndex, getActive, getPrev, getNext, addNew, clearForward, and listening Enabled). All these are documented inline and exposed on $.mobile.urlHistory (I'm not sure these will be publicly documented, but just exposed internally for plugins for now).

$.changePage has two argument changes: the "back" argument is now called "reverse"; this results in no change from an end-user standpoint, but reflects the fact that it only reverses the direction of a transition without affecting the internal history stack, and second, a new argument at the end defines whether changePage was called from a hashChange which makes that url open to history menu guessing.
2011-01-23 17:33:36 -05:00
scottjehl
44d6064fb6 Merge branch 'no_enhance_for_hidden' of https://github.com/hynkle/jquery-mobile into hynkle-no_enhance_for_hidden 2011-01-11 13:42:30 -05:00
Kin Blas
8a70cdb3de Initial patch from pull 672 had incorrect check for backbtn data value. Changed it from $this.data("backbtn") === false to $this.data("backbtn") !== false to match the original logic that was in place prior to the patch.
Original patch missed a nobackbtn reference in jquery.mobile.forms.select.js.
2011-01-11 09:34:50 -08:00
Kin Blas
8050fb0d01 Merge branch 'master' of https://github.com/walkingeyerobot/jquery-mobile into pull672 2011-01-11 09:04:32 -08:00
Jonathan Hinkle
6b799dad71 added 'hidden' to the types of inputs not to be enhanced by textinput 2011-01-07 12:33:59 -05:00
maggiewachs
926982b4f0 Fixed bug 595, where form elements were not properly inheriting the theme. Form controls need to be enhanced after the page containers so they'll pick up on the containers' theme classes. 2011-01-05 11:55:41 -05:00
Mitch Foley
ad757718c4 actually reversing backbtn logic this time. 2010-12-13 11:11:21 -05:00
Mitch Foley
df3bc91f80 renaming nobackbtn to backbtn. 2010-12-13 10:54:26 -05:00
John Bender
553b58567f added protection for nested links to ui-bar selector with tests 2010-12-09 00:16:48 -08:00
John Bender
970f46c5e0 header and footer links will now remain unstyled, Fixes #524 2010-12-08 22:16:45 -08:00
scottjehl
17f0340a0a improved keepNative option so that it's additive on top of data-role=none and data-role=nojs. 2010-12-01 09:52:07 -05:00
scottjehl
efe4c38ad4 added the keepNative option to page plugin, which defaults to this selector "[data-role='none'], .ui-nojs". Add the attribute data-role="none" to any form control or anchor and it will not be auto-enhanced. Thx @pharaoh for the syntax suggestion. Fixes #544, Fixes #528, Fixes #529 2010-11-30 18:18:53 -05:00
scottjehl
93179f9a3d updated comment about license to match other jQuery projects - MIT "or" GPL 2010-11-19 22:47:47 -05:00