Skip to content

Commit

Permalink
add app.js to load the app and bump font awesome to v4.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
btfou committed Sep 8, 2015
1 parent e29610a commit 17703e0
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 30 deletions.
33 changes: 3 additions & 30 deletions viewer/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<title>Configurable Map Viewer</title>
<link rel="stylesheet" type="text/css" href="//js.arcgis.com/3.14compact/esri/css/esri.css">
<link rel="stylesheet" type="text/css" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="//maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="css/theme/dbootstrap/dbootstrap.css">
<link rel="stylesheet" type="text/css" href="css/main.css">
</head>
Expand All @@ -34,37 +34,10 @@
</div>
</div>
</div>
<script type="text/javascript">
var dojoConfig = {
async: true,
packages: [{
name: 'viewer',
location: location.pathname.replace(/[^\/]+$/, '') + 'js/viewer'
},{
name: 'config',
location: location.pathname.replace(/[^\/]+$/, '') + 'js/config'
},{
name: 'gis',
location: location.pathname.replace(/[^\/]+$/, '') + 'js/gis'
}]
};
</script>
<!--[if lt IE 9]>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/es5-shim/4.0.3/es5-shim.min.js"></script>
<![endif]-->
<script type="text/javascript" src="//js.arcgis.com/3.14compact/"></script>
<script type="text/javascript">
// get the config file from the url if present
var file = 'config/viewer', s = window.location.search, q = s.match(/config=([^&]*)/i);
if (q && q.length > 0) {
file = q[1];
if(file.indexOf('/') < 0) {
file = 'config/' + file;
}
}
require(['viewer/Controller', file], function(Controller, config){
Controller.startup(config);
});
</script>
<script src="//js.arcgis.com/3.14compact/"></script>
<script src="js/config/app.js"></script>
</body>
</html>
32 changes: 32 additions & 0 deletions viewer/js/config/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
(function () {

// globel dojoConfig is required for async loading of gmaps api
window.dojoConfig = {
async: true,
packages: [{
name: 'viewer',
location: location.pathname.replace(/[^\/]+$/, '') + 'js/viewer'
}, {
name: 'config',
location: location.pathname.replace(/[^\/]+$/, '') + 'js/config'
}, {
name: 'gis',
location: location.pathname.replace(/[^\/]+$/, '') + 'js/gis'
}]
};

// get the config file from the url if present
var file = 'config/viewer',
s = window.location.search,
q = s.match(/config=([^&]*)/i);
if (q && q.length > 0) {
file = q[1];
if (file.indexOf('/') < 0) {
file = 'config/' + file;
}
}

require(window.dojoConfig, ['viewer/Controller', file, 'dojo/domReady!'], function (Controller, config) {
Controller.startup(config);
});
})();

0 comments on commit 17703e0

Please sign in to comment.