Skip to content

Commit

Permalink
Fix IE issues
Browse files Browse the repository at this point in the history
  • Loading branch information
mbogoevici committed Nov 26, 2012
1 parent 6b63d75 commit 84478d2
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 26 deletions.
26 changes: 2 additions & 24 deletions demo/src/main/webapp/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,8 @@
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=0"/>

<script type="text/javascript" src="resources/js/libs/modernizr-2.0.6.js"></script>

<!--
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).
-->
<script type="text/javascript">
var loader = document.createElement("script")
loader.setAttribute("src", "resources/js/libs/require.js");
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"
};
loader.setAttribute("data-main","resources/js/configurations/" + environment);
document.head.appendChild(loader)
</script>
<script type="text/javascript" src="resources/js/libs/require.js"
data-main="resources/js/configurations/loader"></script>
</head>
<body>
</body>
Expand Down
4 changes: 2 additions & 2 deletions demo/src/main/webapp/resources/js/app/utilities.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
define(['order!underscore', 'order!backbone'], function (_) {

const dayNames = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
const monthNames = ["January", "February", "March", "April", "May", "June",
var dayNames = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
var monthNames = ["January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December"];


Expand Down
26 changes: 26 additions & 0 deletions demo/src/main/webapp/resources/js/configurations/loader.js
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]);
});

0 comments on commit 84478d2

Please sign in to comment.