Skip to content

Commit

Permalink
Updated build steps.
Browse files Browse the repository at this point in the history
Added Embedded js and demo html file.
Updated app.App to app/App.
Removed .pyc files.
  • Loading branch information
Scott Davis committed May 24, 2013
1 parent e63ec8f commit aaeafa6
Show file tree
Hide file tree
Showing 14 changed files with 103 additions and 3 deletions.
24 changes: 23 additions & 1 deletion BUILD_STEPS.md
@@ -1,2 +1,24 @@
For Single Page Apps
====================
- copy mxd's to hnas/serverprojects
- add analytics code
- add analytics code
- _SpecRunner.html
- Bump app version number and update changelog
- change apiKey in main.js from localhost to server
- build.sh
- test in dist
- change apiKey in main.js back

For Embedded Widget Projects
============================
- copy mxd's to hnas/serverprojects
- add analytics code
- _SpecRunner.html
- Bump app version number and update changelog
- change apiKey in main.js from localhost to server
- build.sh
- test in dist
- change server to point to url in dist/EmbeddedMapLoader.js
- push to server and test dist again
- change apiKey in main.js back
- change dist/EmbeddedMapLoader.js to point back to relative path
52 changes: 52 additions & 0 deletions src/EmbeddedMapLoader.js
@@ -0,0 +1,52 @@
// This file is used when the app is an embedded widget in another web site.
// This is the file that loads the widget and it's dependencies.
(function(){
var server = location.pathname.replace(/\/[^\/]+$/, "");
if (window.jasmine) {
server += '/src';
window.dojoConfig = {
has: {
"dojo-undef-api": true,
isDebug: true
}
};
} else {
window.dojoConfig = {
isDebug: true
};
}
// var server = 'http://168.177.223.158/SolarMapWidget';

var head = document.getElementsByTagName('head').item(0);

function loadCss(href){
// summary:
// Adds a css link element to the document head with the
// passed in href
console.log(this.declaredClass + "::loadCss", arguments);

var link = document.createElement('link');
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = href;
head.appendChild(link);
}

function loadJavaScript(src){
// summary:
// Adds a script element to the head with the passed
// in src.
console.log(this.declaredClass + "::loadJavaScript", arguments);

document.write("<script type='text/javascript' src='" + src + "'></script>");
}


// load dojo and agrc css
loadCss('http://serverapi.arcgisonline.com/jsapi/arcgis/3.4/js/dojo/dijit/themes/claro/claro.css');
loadCss('http://serverapi.arcgisonline.com/jsapi/arcgis/3.4/js/esri/css/esri.css');
loadCss(server + '/app/resources/App.css');

loadJavaScript('http://serverapi.arcgisonline.com/jsapi/arcgis/3.4');
loadJavaScript(server + '/app/run.js');
})();
2 changes: 1 addition & 1 deletion src/app/App.js
Expand Up @@ -28,7 +28,7 @@ function (
SideBarToggler,
PaneStack
) {
return declare("app.App",
return declare("app/App",
[_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin],
{
// summary:
Expand Down
2 changes: 1 addition & 1 deletion src/index.html
Expand Up @@ -13,7 +13,7 @@
<link rel='stylesheet' href='app/resources/App.css'>
</head>
<body class='claro'>
<div data-dojo-type='app.App'></div>
<div data-dojo-type='app/App'></div>

<!-- JAVASCRIPT -->
<script data-dojo-config="isDebug: 1, tlmSiblingOfDojo: 1" src='http://serverapi.arcgisonline.com/jsapi/arcgis/3.4' defer></script>
Expand Down
26 changes: 26 additions & 0 deletions src/index_embedded.html
@@ -0,0 +1,26 @@
<!--
This file is for when the application will be an embedded widget in another website
It is intended to be a demo page to show how to embed the widget.
-->
<!DOCTYPE html>
<html>
<head>
<title>Project Title Demo Page</title>
<style>
html, body {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}
</style>
</head>
<body>

<div class="agrc-container">
<div data-dojo-type='app/App'></div>
</div>
<script src="EmbeddedMapLoader.js"></script>

</body>
</html>
Binary file removed ui-tests/tests/__init__.pyc
Binary file not shown.
Binary file removed ui-tests/tests/basetest.pyc
Binary file not shown.
Binary file removed ui-tests/tests/test_feedback.pyc
Binary file not shown.
Binary file removed ui-tests/tests/test_find_address.pyc
Binary file not shown.
Binary file removed ui-tests/tests/test_geosearch.pyc
Binary file not shown.
Binary file removed ui-tests/tests/test_map_click.pyc
Binary file not shown.
Binary file removed ui-tests/tests/test_satellite_dialog.pyc
Binary file not shown.
Binary file removed ui-tests/tests/test_select_providers.pyc
Binary file not shown.
Binary file removed ui-tests/tests/test_urlparams.pyc
Binary file not shown.

0 comments on commit aaeafa6

Please sign in to comment.