Re: [screen-orient] Updated editor draft
On Mon, Nov 5, 2012 at 9:19 AM, Lars Knudsen wrote: > Why not use the existing definitions in the orientation change event? > > http://developer.apple.com/library/ios/#documentation/AppleApplications/Reference/SafariWebContent/HandlingEvents/HandlingEvents.html#//apple_ref/doc/uid/TP40006511-SW16 > > simple "landscape" and "portrait" can always be deducted from the values - > but you have more precise info. This is also possible to map to/from > accelerometer data if needed. > > (speaking as a web demos/apps/games developer). > > code quote: > > switch(window.orientation) > { > case 0: > displayStr += "Portrait"; > break; > > case -90: > displayStr += "Landscape (right, screen turned > clockwise)"; > break; > > case 90: > displayStr += "Landscape (left, screen turned > counterclockwise)"; > break; > > case 180: > displayStr += "Portrait (upside-down portrait)"; > break; > > } This is only true on devices whose "main orientation" is portrait mode. At least on some devices which have the normal mode of operation being in landscape mode, the above returns flipped values. / Jonas
Re: [screen-orient] Updated editor draft
Why not use the existing definitions in the orientation change event? http://developer.apple.com/library/ios/#documentation/AppleApplications/Reference/SafariWebContent/HandlingEvents/HandlingEvents.html#//apple_ref/doc/uid/TP40006511-SW16 simple "landscape" and "portrait" can always be deducted from the values - but you have more precise info. This is also possible to map to/from accelerometer data if needed. (speaking as a web demos/apps/games developer). code quote: switch(window.orientation) { case 0: displayStr += "Portrait"; break; case -90: displayStr += "Landscape (right, screen turned clockwise)"; break; case 90: displayStr += "Landscape (left, screen turned counterclockwise)"; break; case 180: displayStr += "Portrait (upside-down portrait)"; break; } br Lars On Mon, Nov 5, 2012 at 4:54 PM, Mounir Lamouri wrote: > Hi, > > I've just pushed a new editor draft [1] with some cosmetic/editorial > changes and a new feature: lockOrientation() can now be called with a > sequence to lock the screen to different orientations (for > example, "portrait-primary" and "landscape-primary"). > > Any feedback is welcome! > > Note that I will update the WD in about a week if I do not hear anything > in the meantime. > > [1] http://dvcs.w3.org/hg/screen-orientation/raw-file/tip/Overview.html > > Thanks, > -- > Mounir > >
[screen-orient] Updated editor draft
Hi, I've just pushed a new editor draft [1] with some cosmetic/editorial changes and a new feature: lockOrientation() can now be called with a sequence to lock the screen to different orientations (for example, "portrait-primary" and "landscape-primary"). Any feedback is welcome! Note that I will update the WD in about a week if I do not hear anything in the meantime. [1] http://dvcs.w3.org/hg/screen-orientation/raw-file/tip/Overview.html Thanks, -- Mounir