/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
(function() {
var singleFile = (typeof Heron == "object" && Heron.singleFile);
/**
* Relative path of this script.
*/
var scriptName = (!singleFile) ? "lib/DynLoader.js" : "Heron.js";
var jsFiles = window.heron;
window.heron = {
/**
* Method: _getScriptLocation
* Return the path to this script. This is also implemented in
* OpenLayers/SingleFile.js
*
* Returns:
* {String} Path to this script
*/
_getScriptLocation: (function() {
var r = new RegExp("(^|(.*?\\/))(" + scriptName + ")(\\?|$)"),
s = document.getElementsByTagName('script'),
src, m, l = "";
for (var i = 0, len = s.length; i < len; i++) {
src = s[i].getAttribute('src');
if (src) {
var m = src.match(r);
if (m) {
l = m[1];
break;
}
}
}
return (function() {
return l;
});
})()
};
/**
* heron.singleFile is a flag indicating this file is being included
* in a Single File Library build of the heron Library.
*
* When we are *not* part of a SFL build we dynamically include the
* OpenLayers library code.
*
* When we *are* part of a SFL build we do not dynamically include the
* heron library code as it will be appended at the end of this file.
*/
if (!singleFile) {
if (!jsFiles) {
jsFiles = [
"i18n.js",
"override-openlayers.js",
"override-ext.js",
"override-geoext.js",
"App.js",
"Launcher.js",
"Utils.js",
"data/OpenLS_XLSReader.js",
"data/DataExporter.js",
"ext.ux/Exporter-all.js",
"widgets/GridCellRenderer.js",
"widgets/ActiveLayersPanel.js",
"widgets/ActiveThemesPanel.js",
"widgets/BaseLayerCombo.js",
"widgets/CapabilitiesTreePanel.js",
"widgets/CoordSearchPanel.js",
"widgets/FeaturePanel.js",
"widgets/FeatureInfoPanel.js",
"widgets/FeatureInfoTooltip.js",
"widgets/XMLTreePanel.js",
"widgets/HTMLPanel.js",
"widgets/ContextBrowserPanel.js",
"widgets/LayerTreePanel.js",
"widgets/LayerLegendPanel.js",
"widgets/LoadingPanel.js",
"widgets/MapPanel.js",
"widgets/MenuPanel.js",
"widgets/MultiLayerNode.js",
"widgets/GeocoderCombo.js",
"widgets/OpenLSSearchCombo.js",
"widgets/NominatimSearchCombo.js",
"widgets/PrintPreviewWindow.js",
"widgets/SearchPanel.js",
"widgets/FeatSelGridPanel.js",
"widgets/FeatSelSearchPanel.js",
"widgets/ToolbarBuilder.js",
"widgets/ScaleSelectorCombo.js"
];
}
// use "parser-inserted scripts" for guaranteed execution order
// http://hsivonen.iki.fi/script-execution/
var scriptTags = new Array(jsFiles.length);
var host = heron._getScriptLocation() + "lib/";
for (var i = 0, len = jsFiles.length; i < len; i++) {
scriptTags[i] = "";
}
if (scriptTags.length > 0) {
document.write(scriptTags.join(""));
}
}
})();