Skip to content

Commit

Permalink
Merge pull request goodrobots#29 from SamuelDudley/static_prefix
Browse files Browse the repository at this point in the history
Apply application prefix to static files in tornado server and javascript
  • Loading branch information
SamuelDudley authored Sep 30, 2017
2 parents 7929981 + 359c97c commit 6cbd88a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
9 changes: 5 additions & 4 deletions app/cesium_web_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,11 @@ def __init__(self, module):
handlers.append((r"/"+APP_PREFIX+"websocket/", DefaultWebSocket, cb))

settings = dict(
cookie_secret=APP_SECRET_KEY,
template_path=APP_TEMPLATES,
static_path=APP_STATIC,
xsrf_cookies=False,
cookie_secret = APP_SECRET_KEY,
template_path = APP_TEMPLATES,
static_path = APP_STATIC,
static_url_prefix = "/"+APP_PREFIX+"static/",
xsrf_cookies = False,
)
super(Application, self).__init__(handlers, **settings)

Expand Down
2 changes: 1 addition & 1 deletion app/static/DST/js/context_menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ $contextMenu.on("mouseover", "a", function(evt){
if (marker != null){
selected.marker = marker
document.getElementsByTagName("body")[0].style.cursor = "pointer" // change the pointer to a hand
selected.marker.image= '/static/DST/wp_icons/ylw-blank.png'
selected.marker.image= '/'+app_prefix+'static/DST/wp_icons/ylw-blank.png'
selected.alt_line = get_by_id(alt_lines, selected.marker.id)

} else{
Expand Down
10 changes: 5 additions & 5 deletions app/static/DST/js/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ $(function () {
var vehicle_offset_x = 25
var vehicle_offset_y = 25
var vehicle_offset_z = 25
var vehicle_model = '/static/DST/models/rat.gltf'
var vehicle_model = '/'+app_prefix+'static/DST/models/rat.gltf'

var position = Cesium.Cartesian3.fromDegrees(0, 0, 0);
var heading = 0;
Expand Down Expand Up @@ -420,7 +420,7 @@ $(function () {
function clear_selected_marker(){
if (selected.marker != null){
document.getElementsByTagName("body")[0].style.cursor = "default"
selected.marker.image = '/static/DST/wp_icons/blu-blank.png' // re-set the wp icon to be unselected...
selected.marker.image = '/'+app_prefix+'static/DST/wp_icons/blu-blank.png' // re-set the wp icon to be unselected...
selected.marker = null
selected.alt_line = null
}
Expand Down Expand Up @@ -472,8 +472,8 @@ $(function () {


if (selected.marker != null && selected.dragging) {
selected.marker.image= '/static/DST/wp_icons/ylw-blank.png' // make / keep the marker yellow
document.getElementsByTagName("body")[0].style.cursor = "url(/static/DST/pointers/move.png), pointer"
selected.marker.image= '/'+app_prefix+'static/DST/wp_icons/ylw-blank.png' // make / keep the marker yellow
document.getElementsByTagName("body")[0].style.cursor = "url('/'+app_prefix+'static/DST/pointers/move.png), pointer"

if (!selected.camera_stored){
store_camera() // store the current camera until after release
Expand Down Expand Up @@ -544,7 +544,7 @@ $(function () {
if (selected.marker != null && !selected.dragging){ // this is the only point where we select the wp
// we dont select if we are dragging otherwise we can move wp's accidentally when panning the camera...
document.getElementsByTagName("body")[0].style.cursor = "pointer" // change the pointer to a hand
selected.marker.image= '/static/DST/wp_icons/ylw-blank.png'
selected.marker.image= '/'+app_prefix+'static/DST/wp_icons/ylw-blank.png'
selected.alt_line = get_by_id(alt_lines, selected.marker.id) //
selected.label = get_by_id(labels, selected.marker.id)
} else { // we have not picked a wp
Expand Down
2 changes: 1 addition & 1 deletion app/static/DST/js/wp.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function create_wp(id, wp_data){
markers.add({
id : id,
position : Cesium.Cartesian3.fromDegrees(wp_data.y, wp_data.x, wp_data.z+height_offset),
image : '/static/DST/wp_icons/blu-blank.png',
image : '/'+app_prefix+'static/DST/wp_icons/blu-blank.png',
verticalOrigin : Cesium.VerticalOrigin.BOTTOM,
horizontalOrigin : Cesium.HorizontalOrigin.CENTER
});
Expand Down

0 comments on commit 6cbd88a

Please sign in to comment.