forked from jboss/ticket-monster
-
Notifications
You must be signed in to change notification settings - Fork 465
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6b63d75
commit 84478d2
Showing
3 changed files
with
30 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
demo/src/main/webapp/resources/js/configurations/loader.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
//detect the appropriate module to load | ||
define(function () { | ||
|
||
/* | ||
A simple check on the client. For touch devices or small-resolution screens) | ||
show the mobile client. By enabling the mobile client on a small-resolution screen | ||
we allow for testing outside a mobile device (like for example the Mobile Browser | ||
simulator in JBoss Tools and JBoss Developer Studio). | ||
*/ | ||
|
||
var environment; | ||
|
||
if (navigator.userAgent == "TicktetMonster Cordova Webview iOS") { | ||
environment = "hybrid-ios" | ||
} | ||
else if (navigator.userAgent == "TicketMonster Cordova Webview Android") { | ||
environment = "hybrid-android" | ||
} | ||
else if (Modernizr.touch || Modernizr.mq("only all and (max-width: 480px)")) { | ||
environment = "mobile" | ||
} else { | ||
environment = "desktop" | ||
} | ||
|
||
require([environment]); | ||
}); |