diff --git a/WebContent/localization/OSRM.Localization.js b/WebContent/localization/OSRM.Localization.js index bab6ee258..4cf346dda 100644 --- a/WebContent/localization/OSRM.Localization.js +++ b/WebContent/localization/OSRM.Localization.js @@ -21,8 +21,12 @@ or see http://www.gnu.org/licenses/agpl.txt. OSRM.Localization = { +// default directory for localization files +DIRECTORY: "localization/", + +// holds currently active language current_language: OSRM.DEFAULTS.LANGUAGE, - + // initialize localization init: function() { // create dropdown menu @@ -92,7 +96,7 @@ setLanguage: function(language) { if( supported_languages[i].encoding == language) { var script = document.createElement('script'); script.type = 'text/javascript'; - script.src = "localization/OSRM.Locale."+language+".js"; + script.src = OSRM.Localization.DIRECTORY+"OSRM.Locale."+language+".js"; document.head.appendChild(script); break; } diff --git a/WebContent/printing/OSRM.Printing.js b/WebContent/printing/OSRM.Printing.js index e1641324c..e00aaf855 100644 --- a/WebContent/printing/OSRM.Printing.js +++ b/WebContent/printing/OSRM.Printing.js @@ -21,6 +21,10 @@ or see http://www.gnu.org/licenses/agpl.txt. OSRM.Printing = { +// directory with printing code, and base OSRM directory relative to this directory +DIRECTORY: 'printing/', +BASE_DIRECTORY: '../', + // create UI for printing in mainwindow init: function() { var icon = document.createElement('div'); @@ -106,7 +110,7 @@ show: function(response) { body += ''; body += ''; - body += ''; + body += ''; body += ""; // build route description @@ -137,7 +141,7 @@ show: function(response) { var zoom = print_window.OSRM.drawMap( OSRM.DEFAULTS.TILE_SERVERS[tile_server_id], new L.LatLngBounds( positions ) ); // draw markers - print_window.OSRM.prefetchIcons( OSRM.G.images ); + print_window.OSRM.prefetchIcons( OSRM.G.images, OSRM.Printing.BASE_DIRECTORY ); print_window.OSRM.drawMarkers( OSRM.G.markers.route ); // draw route & query for better geometry @@ -164,7 +168,7 @@ openPrintWindow: function() { OSRM.G.printwindow.close(); // generate a new window and wait till it has finished loading - OSRM.G.printwindow = window.open("printing/printing.html","","width=540,height=500,left=100,top=100,dependent=yes,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no,resizable=yes"); + OSRM.G.printwindow = window.open( OSRM.Printing.DIRECTORY + "printing.html","","width=540,height=500,left=100,top=100,dependent=yes,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no,resizable=yes"); }, @@ -182,7 +186,7 @@ printWindowLoaded: function(){ ]; var stylesheet = OSRM.CSS.getStylesheet("printing.css", print_document); for(var i=0; i