/webportal/src/main/webapp/index.zul

http://alageospatialportal.googlecode.com/ · Unknown · 660 lines · 586 code · 74 blank · 0 comment · 0 complexity · 7a08ddfd36403e040990f99a45f77833 MD5 · raw file

  1. <?variable-resolver class="org.zkoss.spring.DelegatingVariableResolver"?>
  2. <?script type="text/javascript" src="index.js.dsp"?>
  3. <?component name="leftMenuSearch" macro-uri="/WEB-INF/zul/leftMenuSearch.zul"?>
  4. <?component name="footer" macro-uri="/WEB-INF/zul/footer.zul"?>
  5. <?component name="contextualMenu" macro-uri="/WEB-INF/zul/ContextualMenu.zul"?>
  6. <?page id="MapZul" title="${portalNaming.portalName}" cacheable="false"
  7. language="xul/html" zscriptLanguage="Java" contentType="text/html;charset=UTF-8"?>
  8. <?link rel="shortcut icon" type="image/x-icon" href="/img/favicon.ico"?>
  9. <?meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" ?>
  10. <zk xmlns="http://www.zkoss.org/2005/zul" xmlns:h="http://www.w3.org/1999/xhtml"
  11. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  12. xsi:schemaLocation="http://www.zkoss.org/2005/zul http://www.zkoss.org/2005/zul/zul.xsd"
  13. xmlns:w="http://www.zkoss.org/2005/zk/client" xmlns:n="http://www.zkoss.org/2005/zk/native">
  14. <!--<style src="css/test.ala.buttons.css" media="screen" />-->
  15. <style src="css/ala-skin.css" media="screen" />
  16. <style src="css/zkcomponents.css" media="screen" />
  17. <style src="css/zkprint.css" media="print" />
  18. <style src="css/sf.css" />
  19. <script defer="false" type="text/javascript">
  20. var mapLayers = null;
  21. var currFeature = null;
  22. var map = null;
  23. var bLayer = null;
  24. var bLayer2 = null;
  25. var bLayer3 = null;
  26. var bLayer4 = null;
  27. var OpenLayers = null;
  28. var baseLayers = null;
  29. var currentbaselayertxt = "normal";
  30. var currentBaseLayer = null;
  31. var safeToLoadMapId = null;
  32. var registerLayer = null;
  33. var tmpvars;
  34. var disableDepthServlet= ${settings.disableDepthServlet};
  35. var wms100 = ${layerUtilities.wms100};
  36. var wms110 = ${layerUtilities.wms110};
  37. var wms111 = ${layerUtilities.wms111};
  38. var wms130 = ${layerUtilities.wms130};
  39. var ncwms = ${layerUtilities.ncwms};
  40. var thredds = ${layerUtilities.thredds};
  41. var georss = ${layerUtilities.georss};
  42. var kml = ${layerUtilities.kml};
  43. var unsupported =${layerUtilities.unsupported};
  44. </script>
  45. <window id="mapPortalPage" width="100%" height="100%"
  46. use="au.org.emii.portal.composer.MapComposer" apply="au.org.emii.portal.composer.MapComposer"
  47. style="overflow:hidden;">
  48. <script defer="false" type="text/javascript">
  49. <!-- Set up the google analytics -->
  50. var _gaq = _gaq || [];
  51. _gaq.push(['_setAccount', 'UA-4355440-1']);
  52. _gaq.push(['_setDomainName', 'ala.org.au']);
  53. _gaq.push(['_trackPageview']);
  54. (function() {
  55. var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
  56. ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
  57. var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  58. })();
  59. </script>
  60. <script defer="true" type="text/JavaScript" src="scripts/index.js" />
  61. <timer id="timerKeepAliveSession" repeats="true" delay="30000" onTimer="" />
  62. <div id="menucontainer">
  63. <div width="400px" id="menudiv" sclass="menudiv" height="39px" style="position:absolute; top:58px">
  64. <n:div id="nav-sp">
  65. <n:ul class="sf">
  66. <n:li class='nav-home' style="display:none">
  67. <n:a href="http://www.ala.org.au/" target="_blank">Home</n:a>
  68. </n:li>
  69. <n:li>
  70. <n:a href="" n:onClick="doNothing()">Add to Map</n:a>
  71. <n:ul>
  72. <n:li>
  73. <n:a href="#" n:onClick="addSpeciesAction();">Species</n:a>
  74. </n:li>
  75. <n:li>
  76. <n:a href="#" n:onClick="addAreaAction();">Areas</n:a>
  77. </n:li>
  78. <n:li>
  79. <n:a href="#" n:onClick="addLayerAction();">Layers</n:a>
  80. </n:li>
  81. <n:li>
  82. <n:a href="#" n:onClick="addFacetAction();">Facet</n:a>
  83. </n:li>
  84. </n:ul>
  85. </n:li>
  86. <n:li>
  87. <n:a href="" n:onClick="doNothing()">Tools</n:a>
  88. <n:ul>
  89. <n:li>
  90. <n:a href="#" n:onClick="runAreaReport();">Area Report</n:a>
  91. </n:li>
  92. <n:li>
  93. <n:a href="#" n:onClick="runNearestLocality();">Nearest locality</n:a>
  94. </n:li>
  95. <n:li>
  96. <n:a href="#" n:onClick="runScatterPlot();">Scatterplot</n:a>
  97. </n:li>
  98. <n:li>
  99. <n:a href="#" n:onClick="runScatterPlotList();">Scatterplot List</n:a>
  100. </n:li>
  101. <n:li>
  102. <n:a href="#" n:onClick="runTabulation();">Tabulate</n:a>
  103. </n:li>
  104. <n:li>
  105. <n:a href="#" n:onClick="runSitesBySpecies();">Points to Grid</n:a>
  106. </n:li>
  107. <n:li>
  108. <n:a href="#" n:onClick="runClassification();">Classify</n:a>
  109. </n:li>
  110. <n:li>
  111. <n:a href="#" n:onClick="runPrediction();">Predict</n:a>
  112. </n:li>
  113. <n:li>
  114. <n:a href="#" n:onClick="runGDM();">GDM</n:a>
  115. </n:li>
  116. <n:li>
  117. <n:a href="#" n:onClick="runImportAnalysis();">Restore prior analysis</n:a>
  118. </n:li>
  119. </n:ul>
  120. </n:li>
  121. <n:li>
  122. <n:a href="" n:onClick="doNothing()">Import</n:a>
  123. <n:ul>
  124. <n:li>
  125. <n:a href="#" n:onClick="runImportSpecies('points');">Points</n:a>
  126. </n:li>
  127. <n:li>
  128. <n:a href="#" n:onClick="runImportSpecies('assemblage');">Species list</n:a>
  129. </n:li>
  130. <n:li>
  131. <n:a href="#" n:onClick="runImportAreas();">Areas</n:a>
  132. </n:li>
  133. <n:li>
  134. <n:a href="#" n:onClick="runImportAnalysis();">Restore prior analysis</n:a>
  135. </n:li>
  136. </n:ul>
  137. </n:li>
  138. <n:li>
  139. <n:a href="" n:onClick="doNothing()">Export</n:a>
  140. <n:ul>
  141. <n:li>
  142. <n:a href="#" n:onClick='printHack();'>Map</n:a>
  143. </n:li>
  144. <n:li>
  145. <n:a href="#" n:onClick="runSpeciesList();">Checklist</n:a>
  146. </n:li>
  147. <n:li>
  148. <n:a href="#" n:onClick="runSamplingAction();">Point Sample</n:a>
  149. </n:li>
  150. <n:li>
  151. <n:a href="#" n:onClick="runExport();">Areas</n:a>
  152. </n:li>
  153. </n:ul>
  154. </n:li>
  155. <n:li>
  156. <n:a href="" n:onClick="doNothing()">Help</n:a>
  157. <n:ul>
  158. <n:li>
  159. <n:a href="#" n:onClick="loadHelp('getting-started');">Getting Started</n:a>
  160. </n:li>
  161. <n:li>
  162. <n:a href="#" n:onClick="loadHelp('add-to-map');">Add To Map</n:a>
  163. </n:li>
  164. <n:li>
  165. <n:a href="#" n:onClick="loadHelp('tools');">Tools</n:a>
  166. </n:li>
  167. <n:li>
  168. <n:a href="#" n:onClick="loadHelp('import');">Import</n:a>
  169. </n:li>
  170. <n:li>
  171. <n:a href="#" n:onClick="loadHelp('export');">Export</n:a>
  172. </n:li>
  173. </n:ul>
  174. </n:li>
  175. </n:ul>
  176. </n:div>
  177. <div onClick='menus.setOpen(false);menudiv.setStyle("position:absolute; top:0px");menudiv.setParent(menucontainerwest);' sclass="z-west-colps z-borderlayout-icon"
  178. style="position: absolute; z-index: 201; left: 380px; top: 3px;" >
  179. </div>
  180. </div>
  181. </div>
  182. <borderlayout width="100%" height="100%">
  183. <north id="header" height="58" visible="true" style="height: 58px">
  184. <html id="headerhtml"><![CDATA[
  185. <header id="site-header">
  186. <div class="inner">
  187. <h1 title="Atlas of Living Australia"><a href="http://www.ala.org.au" title="Atlas of Living Australia home"><img src="img/test.ala.logo.png" width="315" height="33" alt="" /></a></h1>
  188. <section id="nav-search">
  189. <section id="header-search">
  190. <form id="search-form" action="http://bie.ala.org.au/search" method="get" name="search-form"><label for="search">Search</label>
  191. <input id="search" class="filled" title="Search" type="text" name="q" placeholder="Search the Atlas" />
  192. <span class="search-button-wrapper"><button id="search-button" class="search-button" value="Search" type="submit"><img src="img/test.ala.button_search-grey.png" alt="Search" width="12" height="12" /></button></span></form>
  193. </section>
  194. <nav class="not_logged_in">
  195. <ol>
  196. <li><a href="http://www.ala.org.au" title="Atlas of Living Australia home">Home</a></li>
  197. <!-- <li><a href="http://www.ala.org.au/my-profile/" title="My profile">My profile</a></li> -->
  198. <li><a href="/actions/dashboard" title="Spatial Portal Dashboard">Dashboard</a></li>
  199. <li><a href="javascript:saveSession();" title="Save current session">Save session</a></li>
  200. <li class="last"><a href="https://auth.ala.org.au/cas/login?service=http://spatial.ala.org.au/">Log in</a></li>
  201. </ol>
  202. </nav>
  203. <nav class="logged_in">
  204. <ol>
  205. <li><a href="http://www.ala.org.au" title="Atlas of Living Australia home">Home</a></li>
  206. <!-- <li><a href="http://www.ala.org.au/my-profile/" title="My profile">My profile</a></li> -->
  207. <li><a href="/actions/dashboard" title="Spatial Portal Dashboard">Dashboard</a></li>
  208. <li><a href="javascript:saveSession();" title="Save current session">Save session</a></li>
  209. <li class="last"><a href="https://auth.ala.org.au/cas/logout?service=http://spatial.ala.org.au/">Log out</a></li>
  210. </ol>
  211. </nav>
  212. </section>
  213. </div>
  214. </header>
  215. ]]>
  216. </html>
  217. </north>
  218. <west title=" " size="${settingsSupplementary.values.menu_default_width}"
  219. id="menus" collapsible="true"
  220. splittable="false" width="400px">
  221. <div id="westChild" vflex="1">
  222. <div id="westMinimised" visible="false" class="westMinimised" width="${settingsSupplementary.values.menu_minimised_width}" >
  223. <div zclass="closebox" zindex="500" left="2px" top="2px">
  224. <toolbarbutton
  225. id="showLeftMenu"
  226. label=""
  227. image="img/buttonopen.png"
  228. hoverImage="img/buttonopen-over.png"
  229. visible="false"
  230. />
  231. </div>
  232. </div>
  233. <div id="menucontainerwest" />
  234. <div id="westContent" class="westContent" visible="true" height="100%">
  235. <borderlayout style="position:absolute;top:0px;left:0px">
  236. <north height="189px">
  237. <div>
  238. <!-- space for top level menu -->
  239. <div height="39px" />
  240. <div id="activeLayersHolder" width="400px" style="overflow: auto;background:white" height="160px">
  241. <listbox id="activeLayersList" width="100%" />
  242. </div>
  243. <div width="100%" height="1px" sclass="selectedLayerDiv" />
  244. </div>
  245. </north>
  246. <center vflex="false">
  247. <vlayout height="100%" style="overflow-y: auto" >
  248. <div width="400px" style="margin-left:3px;">
  249. <label id="lblSelectedLayer" value="No layers added" sclass="selectedLayer" />
  250. </div>
  251. <separator />
  252. <div id="layerControls"/>
  253. </vlayout>
  254. </center>
  255. <south height="110px;">
  256. <div sclass="contextualDivMenu" height="90px" width="390px" style="margin:0; padding:0px;">
  257. <contextualMenu id="contextualMenu" style="margin:2px;" width="390px" />
  258. </div>
  259. </south>
  260. </borderlayout>
  261. </div>
  262. <leftMenuSearch id="leftMenuSearch" visible="false" />
  263. </div>
  264. </west>
  265. <center id="center">
  266. <div id="mapcontainer" width="100%" height="100%" >
  267. <div style="float:left" width="100%" height="100%" >
  268. <iframe id="mapIframe" width="100%" height="100%" name="mapFrame" src="./map2.html?" />
  269. </div>
  270. </div>
  271. </center>
  272. <south id="south" visible="false">
  273. <footer id="footer" />
  274. </south>
  275. </borderlayout>
  276. <script defer="false" type="text/javascript"><![CDATA[
  277. var onIframeMapFullyLoaded = function() {
  278. //update screen widths before map is loaded (hide header)
  279. var h0 = window.location.href.split('?');
  280. if(h0.length > 1){
  281. var h1 = h0[1].split("&");
  282. var i;
  283. for(i=0;i<h1.length;i++){
  284. if(h1[i].substring(0,2) == "p="){
  285. h1[i] = h1[i].substring(2,h1[i].length);
  286. var h2 = h1[i].split(",");
  287. if(h2.length > 6) {
  288. //style adjustment
  289. document.getElementsByTagName("body")[0].style.margin = "0px";
  290. document.getElementsByTagName("html")[0].style.margin = "0px";
  291. //hide map buttons
  292. //var q = jq('$mapbuttons')[0];
  293. //q.style.display="none";
  294. //hide menu
  295. q = document.getElementById(zk.Widget.$(jq('$menudiv')[0]).uuid);
  296. q.style.display="none";
  297. //hide north
  298. q = document.getElementById(zk.Widget.$(jq('$header')[0]).uuid + "-real");
  299. q.style.height="0px";
  300. //set west
  301. var m = document.getElementById(zk.Widget.$(jq('$menus')[0]).uuid + "-real");
  302. var w = m.style.width;
  303. var diff = (w.substring(0,w.length-2))*1 - h2[6]*1 + 10;
  304. m.style.width = h2[6] + "px";
  305. var p = document.getElementById(zk.Widget.$(jq('$menus')[0]).uuid + "-split");
  306. p.style.width = h2[6] + "px";
  307. p.style.left = h2[6] + "px";
  308. p.style.display = "none";
  309. var n = document.getElementById(zk.Widget.$(jq('$center')[0]).uuid + "-real");
  310. w = n.style.width;
  311. var l = n.style.left;
  312. l = (l.substring(0,l.length-2)*1);
  313. var val = diff + w.substring(0,w.length-2)*1;
  314. n.style.width = val + "px";
  315. n.style.top = "0px";
  316. w = n.style.height;
  317. val2 = w.substring(0,w.length-2)*1;
  318. n.style.height = val2 + "px";
  319. w = n.style.left;
  320. val = w.substring(0,w.length-2)*1 - diff;
  321. n.style.left = val + "px";
  322. var n = document.getElementById(zk.Widget.$(jq('$center')[0]).uuid + "-cave");
  323. w = n.style.width;
  324. var val = diff + w.substring(0,w.length-2)*1;
  325. n.style.width = val + "px";
  326. n.style.left = val + "px";
  327. n.style.top = "0px";
  328. n.style.height = val2 + "px";
  329. mapFrame.document.getElementById("zoomtolocation").style.display="none";
  330. mapFrame.document.getElementById("addPanoramio").style.display="none";
  331. if(mapFrame.document.getElementById("hoverTool") != null)
  332. mapFrame.document.getElementById("hoverTool").style.display="none";
  333. if(mapFrame.document.getElementById("nearestTool") != null)
  334. mapFrame.document.getElementById("nearestTool").style.display="none";
  335. if(mapFrame.document.getElementById("featureTool") != null)
  336. mapFrame.document.getElementById("featureTool").style.display="none";
  337. jQuery('.z-center')[0].style.border = "0px";
  338. }
  339. }
  340. }
  341. }
  342. ${session.attributes.portalSession.onIframeMapFullyLoaded};
  343. map = window.mapFrame.map;
  344. mapFrame = window.mapFrame;
  345. //update map extents
  346. var printing = false;
  347. var h0 = window.location.href.split('?');
  348. if(h0.length > 1){
  349. var h1 = h0[1].split("&");
  350. var i;
  351. for(i=0;i<h1.length;i++){
  352. if(h1[i].substring(0,2) == "p="){
  353. printing = true;
  354. h1[i] = h1[i].substring(2,h1[i].length);
  355. var h2 = h1[i].split(",");
  356. if(h2.length > 5){
  357. if(h2[2].substring(0,1) == 'n') {
  358. fixExtent4326(1*(h2[2].substring(1,h2[2].length)),1*h2[3],1*h2[4],1*h2[5]);
  359. } else {
  360. fixExtent(1*h2[2],1*h2[3],1*h2[4],1*h2[5]);
  361. }
  362. //map.zoomToExtent(new OpenLayers.Bounds(1*h2[2],1*h2[3],1*h2[4],1*h2[5]), true);
  363. while(map.controls.length > 0){
  364. map.controls[0].deactivate();
  365. map.removeControl(map.controls[0]);
  366. }
  367. window.frames["mapFrame"].document.getElementById('controlPanZoom').style.display = "none";
  368. }
  369. console.log(currentbaselayertxt);
  370. if(h2.length > 7 && currentbaselayertxt != h2[7]) {
  371. console.log(h2[7]);
  372. changeBaseLayer(h2[7]);
  373. }
  374. //draw grid
  375. if(h2.length > 8){
  376. if (h2[8] != '0' && h2[8] != '0.0') {
  377. var ctrl = new OpenLayers.Control.Graticule({
  378. numPoints: 2,
  379. labelled: true,
  380. visible: true
  381. });
  382. ctrl.labelSymbolizer.fontColor = "white";
  383. if(h2.length > 9) {
  384. ctrl.labelSymbolizer.fontSize = "15";
  385. ctrl.labelSymbolizer.fontWeight = "bold";
  386. ctrl.lineSymbolizer.strokeWidth = 2;
  387. //resize scale text
  388. mapFrame.document.getElementById("mapscale").style.fontSize = "15px"
  389. mapFrame.document.getElementById("mapscale").style.fontWeight = "bold"
  390. } else {
  391. ctrl.lineSymbolizer.strokeWidth = 1;
  392. }
  393. ctrl.lineSymbolizer.strokeColor = "white";
  394. ctrl.lineSymbolizer.strokeOpacity = 0.6;
  395. map.addControl(ctrl);
  396. }
  397. }
  398. //scale circles
  399. if(h2.length > 9){
  400. var scaleby = 1.0*(h2[9]);
  401. var vl = map.getLayersByClass("OpenLayers.Layer.Vector");
  402. for (var i = 0; i < vl.length; i++) {
  403. var f = vl[i].features;
  404. if(vl[i].style != undefined && vl[i].style.pointRadius != undefined) {
  405. vl[i].style.pointRadius *= scaleby;
  406. }
  407. for(var j=0;j<f.length;j++){
  408. if(f[j].geometry.toString().indexOf('POINT') == 0) {
  409. if(f[j].style != undefined && f[j].style.pointRadius != undefined) {
  410. f[j].style.pointRadius *= scaleby;
  411. }
  412. }
  413. }
  414. vl[i].redraw(true);
  415. }
  416. }
  417. //scale text?
  418. //...
  419. }
  420. }
  421. }
  422. //use session state extents for printing
  423. if (!printing) {
  424. window.mapFrame.loadBaseMap();
  425. if (!readCookie('ALA-Auth')) {
  426. $(".login-bubble").show().delay(8000).fadeOut(2000);
  427. }
  428. window.mapFrame.document.getElementById("layervalues").style.display= "block";
  429. }
  430. map.signalLayerLoaded = function (layerName) {
  431. zAu.send(new zk.Event(zk.Widget.$(jq('$mapPortalPage')[0]), 'onLayerLoaded', layerName));
  432. }
  433. map.baseLayer.redraw();
  434. };
  435. ]]>
  436. </script>
  437. <!--
  438. Nasty hack to stop you getting SEVERE errors in the console. The
  439. iframe in the holder gets moved into ErrorMessageWithDetail.zul when
  440. raw text is required to be displayed and then gets moved back here
  441. when the window is closed. Yuk
  442. -->
  443. <div id="rawMessageHackHolder" visible="false">
  444. <iframe id="rawMessageIframeHack" width="100%" height="250px" />
  445. </div>
  446. <!-- flag indicating whether safe to load map (OL library loaded) -->
  447. <!-- textbox visible="true" id="safeToLoadMap" value="false" / -->
  448. <doublebox id="southReal" visible="false" />
  449. <doublebox id="northReal" visible="false" />
  450. <doublebox id="westReal" visible="false" />
  451. <doublebox id="eastReal" visible="false" />
  452. <textbox id="baseMap" visible="false" />
  453. <textbox id="currentLayerExtent" visible="false" />
  454. <label id="sat_url" value="${settingsSupplementary.values.sat_url}" visible="false" />
  455. <label id="geoserver_url" value="${settingsSupplementary.values.geoserver_url}" visible="false" />
  456. <label id="layers_url" value="${settingsSupplementary.values.layers_url}" visible="false" />
  457. <label id="biocache_service_url" value="${settingsSupplementary.values.biocache_service_url}" visible="false" />
  458. <label id="biocache_webapp_url" value="${settingsSupplementary.values.biocache_webapp_url}" visible="false" />
  459. <label id="bie_url" value="${settingsSupplementary.values.bie_url}" visible="false" />
  460. <label id="print_server_url" value="${settingsSupplementary.values.print_server_url}" visible="false" />
  461. <label id="webportal_url" value="${settingsSupplementary.values.webportal_url}" visible="false" />
  462. <label id="help_url" value="${settingsSupplementary.values.help_url}" visible="false" />
  463. <!--script defer="false" type="text/javascript"><![CDATA[
  464. var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
  465. document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js'<http://google-analytics.com/ga.js'> type='text/javascript'%3E%3C/script%3E"));
  466. ]]></script>
  467. <script defer="true" type="text/javascript"><![CDATA[
  468. var pageTracker = _gat._getTracker("UA-4355440-1");
  469. pageTracker._initData();
  470. pageTracker._trackPageview();
  471. ]]>
  472. </script-->
  473. <script><![CDATA[
  474. function downloadSubmitButtonClick() {
  475. //e.preventDefault();
  476. if (validateForm()) {
  477. var downloadUrl = $("input#downloadUrl").val().replace(/\\ /g, " ");
  478. var fastDownloadUrl = $("input#fastDownloadUrl").val().replace(/\\ /g, " ");
  479. var downloadType = $('input:radio[name=downloadType]:checked').val();
  480. var reason = $("#reasonTypeId").val();
  481. if(typeof reason == "undefined")
  482. reason = "";
  483. if (downloadType == "fast") {
  484. downloadUrl = fastDownloadUrl + "&type=&email="+$("#email").val()+ "&reasonTypeId="+$("#reasonTypeId").val()+"&reason="+encodeURIComponent(reason)+"&file="+$("#filename").val();
  485. } else {
  486. downloadUrl = downloadUrl + "&type=&email="+$("#email").val()+ "&reasonTypeId="+$("#reasonTypeId").val()+"&reason="+encodeURIComponent(reason)+"&file="+$("#filename").val();
  487. }
  488. //console.log("downloadUrl = " + downloadUrl);
  489. //alert("downloadUrl = " + downloadUrl);
  490. window.location.href = downloadUrl;
  491. zk.Widget.$(jq('$externalContentWindow')).detach();
  492. return false;
  493. }
  494. }
  495. function validateForm() {
  496. var isValid = false;
  497. var reasonId = $("#reasonTypeId option:selected").val();
  498. if (reasonId) {
  499. isValid = true;
  500. } else {
  501. $("#reasonTypeId").focus();
  502. $("label[for='reasonTypeId']").css("color","red");
  503. alert("Please select a \"download reason\" from the drop-down list");
  504. }
  505. return isValid;
  506. }
  507. function readCookie(name) {
  508. var nameEQ = name+"=";
  509. var ca = document.cookie.split(";");
  510. for (var i = 0; i < ca.length; i++) {
  511. var c = ca[i];
  512. while (c.charAt(0)==' ') c = c.substring(1, c.length);
  513. if (c.indexOf(nameEQ)==0) return c.substring(nameEQ.length, c.length);
  514. }
  515. return null;
  516. }
  517. //capture mouse events during window resize or move over an iframe
  518. var overlayon = false;
  519. function needOverlay() {
  520. var zkresizing = parent.document.getElementById("zk_ddghost");
  521. var zkmoving = parent.document.getElementById("zk_wndghost");
  522. if(zkresizing != null && zkresizing.className.indexOf('drop') >= 0) {
  523. //do nothing with drag/drop
  524. } else if(!overlayon && (zkmoving != null || zkresizing != null)) {
  525. //sit above zk (z-index:1800)
  526. parent.jq(parent.document.body).append("<div id='overlay_' style='position:absolute;width:100%;height:100%;top:0;left:0;z-index:1900;background-color:white;opacity:0.01;filter:alpha(opacity=1);'></div>");
  527. overlayon = true;
  528. } else if(overlayon && zkmoving == null && zkresizing == null) {
  529. overlayon = false;
  530. parent.jq(parent.document.getElementById("overlay_")).remove();
  531. }
  532. setTimeout(needOverlay, 500);
  533. }
  534. setTimeout(needOverlay, 500); //start
  535. ]]>
  536. </script>
  537. <window id="hovertool" border="normal" sizable="true"
  538. xmlns:n="http://www.zkoss.org/2005/zk/native" mode="overlapped" width="450px" height="120px" position="center,top">
  539. <n:a class="fancybox-close" n:onClick="mapFrame.doSome('min');" style="display: inline" />
  540. <caption label="Layer value hover tool" />
  541. <div height="100%" style="background:white">
  542. <n:div id="hoverOutput"></n:div>
  543. </div>
  544. </window>
  545. <window id="nearesttool" border="normal" sizable="true"
  546. xmlns:n="http://www.zkoss.org/2005/zk/native" mode="overlapped" width="400px" height="120px" position="center,top">
  547. <n:a class="fancybox-close" n:onClick="clearNearestMarkerLayer();mapFrame.toggleActiveNearest();" style="display: inline" />
  548. <caption label="Nearest locality tool">
  549. <n:a href='#' n:onClick="clearNearestMarkerLayer();">
  550. <n:span style="color:black;text-decoration:underline">remove all markers</n:span>
  551. </n:a>
  552. </caption>
  553. <div height="100%" style="background:white">
  554. <n:div id="nearestOutput"></n:div>
  555. </div>
  556. </window>
  557. <window id="featuretool" border="normal" sizable="true"
  558. xmlns:n="http://www.zkoss.org/2005/zk/native" mode="overlapped" width="400px" height="120px" position="center,top">
  559. <n:a class="fancybox-close" n:onClick="clearNearestMarkerLayer();mapFrame.toggleActiveFeatures();" style="display: inline" />
  560. <caption label="Mapped features">
  561. <n:a href='#' n:onClick="clearNearestMarkerLayer();mapFrame.toggleActiveFeatures();">
  562. <n:span style="color:black;text-decoration:underline">remove all markers</n:span>
  563. </n:a>
  564. <n:a href='#' n:onClick="downloadFeaturesCSV()">
  565. <n:span style="color:black;text-decoration:underline">download CSV</n:span>
  566. </n:a>
  567. </caption>
  568. <div height="100%" style="background:white">
  569. <n:div n:style="height:300px;overflow:auto;" id="featureOutput"></n:div>
  570. </div>
  571. </window>
  572. <html><![CDATA[
  573. <div class="login-bubble">
  574. <div class="login-bubble-arrow"></div>
  575. <div class="login-bubble-arrow-border"></div>
  576. Log into the ALA Spatial Portal to keep track of your session.
  577. </div>
  578. ]]>
  579. </html>
  580. <zscript defer="true">
  581. hovertool.setVisible(false);
  582. nearesttool.setVisible(false);
  583. featuretool.setVisible(false);
  584. </zscript>
  585. </window>
  586. </zk>