Opened 7 years ago

Closed 6 years ago

Last modified 6 years ago

#15827 closed enhancement (fixed)

merge dojox/mobile/sniff into dojo/sniff

Reported by: bill Owned by: Eric Durocher
Priority: undecided Milestone: 1.9
Component: DojoX Mobile Version: 1.7.3
Keywords: Cc: cjolif
Blocked By: Blocking:

Description

dojox/mobile/sniff detects a few things that dojo/sniff doesn't, like the version of iOS. That code should be rolled into dojo/sniff, and dojox/mobile/sniff should be removed (or at least deprecated).

Attachments (1)

15827.patch (23.1 KB) - added by Eric Durocher 6 years ago.
Move dojox/mobile/sniff tests to dojo/sniff + rename "iphone" tests to " ios" - Eric Durocher (IBM, CCLA)

Download all attachments as: .zip

Change History (13)

comment:1 Changed 7 years ago by bill

Milestone: tbd2.0

comment:2 Changed 7 years ago by Eric Durocher

Reminder to remove duplicated iOS 4 sniff code from dojo/touch when this is done (see #15831).

comment:3 Changed 7 years ago by cjolif

#16063 is a duplicate of this ticket.

comment:4 Changed 7 years ago by cjolif

Milestone: 2.01.9

comment:5 Changed 7 years ago by Adrian Vasiliu

While doing so, it would be nice to also change the code such that has("ios") returns the ios version number when running on iOS. Currently, we need to use has("iphone") for this purpose, which is a bit misleading in my eyes.

comment:6 Changed 7 years ago by bill

Also, please update dojo/touch.js to take advantage of the ios version being defined by dojo/sniff.

comment:7 Changed 6 years ago by Eric Durocher

Cc: cjolif added

Notes on the patch:

  • The "ios" (+ "iphone"/"ipad"/"ipod") and "bb" tests are moved to dojo/sniff, but other tests ("css3-animation", "svg") remain in dojox/mobile: "css3-animations" because we test only webkit, and I don't feel the test is general enough for use by other code, and also "svg" because there does not seem to be a need for it elsewhere. If anyone feels "svg" could be useful I can move it too (to dojo/has? since it checks the global SVGAngle window property?)
  • As noted in the comments, the use of "iphone" as an alias to "ios" was confusing and "iphone" should be used in the future to test an actual iPhone device (like "ipad" and "ipod"). The old "iphone" value is still set in dojox/mobile/sniff for compatibility but is documented as deprecated, and all uses of "iphone" are renamed to "ios" in the code accordingly, as well as the .dj_iphone pseudo-class -> .dj_ios. Dojo/sniff sets "iphone" only on real iPhones.
  • Also updated dojo/touch to use the new "ios" version value.

Changed 6 years ago by Eric Durocher

Attachment: 15827.patch added

Move dojox/mobile/sniff tests to dojo/sniff + rename "iphone" tests to " ios" - Eric Durocher (IBM, CCLA)

comment:8 Changed 6 years ago by Eric Durocher

New patch:

  • fixed single quotes -> double quotes for consistency
  • moved has("svg") to dojo/sniff after all, it is useful for gfx

comment:9 Changed 6 years ago by bill

It looks OK to me. The code in dojo/sniff.js to get the iOS platform and version is a little long, but I guess that's unavoidable.

comment:10 Changed 6 years ago by cjolif

Ok. I will commit. I guess if someone comes up with a shorter version it will still be time to improve it.

comment:11 Changed 6 years ago by cjolif

Resolution: fixed
Status: newclosed

In [30582]:

fixes #15827. Move dojox/mobile/sniff tests to dojo/sniff + rename "iphone" tests to " ios". Stop using _base version in dojox/mobile. Thanks Eric Durocher (IBM, CCLA). !strict

comment:12 Changed 6 years ago by bill

In [30881]:

since has("ios") returns undefined on non-iOS platforms (same as the has() check for any browser), condition has("ios") && has("ios") < 5 can be reduced to has("ios") < 5, refs #15827 !strict

Note: See TracTickets for help on using tickets.