changeset 1807:d419124e284a

More work on the front-end.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 30 Oct 2017 00:04:00 +0200
parents 5dadfde159dd
children 54607b2d0c8c
files www/search.html www/search.js
diffstat 2 files changed, 8 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/www/search.html	Sun Oct 29 23:17:34 2017 +0200
+++ b/www/search.html	Mon Oct 30 00:04:00 2017 +0200
@@ -89,8 +89,11 @@
 </head>
 <body onload="mapInitSearch()">
 
-<h1>Map search</h1>
-
+<h1>Pupunen Map search (DEMO/ALPHA)</h1>
+<div>NOTICE: Testing only. Not on-line/available all the time.
+The map pattern parser is not very tolerant currently, best is to have
+strictly "square" patterns.
+</div>
 <noscript>
   <div id="error">
   This page requires JavaScript to be enabled to work.
@@ -100,19 +103,6 @@
 <div id="searchBox">
   <h2>Search pattern</h2>
 <textarea id="pattern" cols="30" rows="15">
-hhvv/vv^^^^^^^^^^^^^^
-ffv/vv^^^^^^^^^^^^^^^
-fv/v^^^^^^^^^^^^^^^^!
--+^^^^^^^^^^^^^^^^^!!
-y^^^^^^^^^^^^^^^^!!!^
-^^^^^^^^v^^^^^^^!!HHH
-^^^^^^^^vv*^^^^^^!^^f
-^^^^^^^^^vv^^^^^^^^^H
-^^^^^^^^^^^^^^^^^^^HH
-^^^^^^^^^^^^^^^^^^HHr
-^^^^^^^^^^^^hh^^^^HH^
-^^^^^^^^^^^hh^^^^^HH^
-^^^^^^^^^hhhhvvvvHH^R
 </textarea>
   <div id="controls">
     <div id="mapList">LOADING MAP LIST...</div>
--- a/www/search.js	Sun Oct 29 23:17:34 2017 +0200
+++ b/www/search.js	Mon Oct 30 00:04:00 2017 +0200
@@ -4,7 +4,7 @@
 // (C) Copyright 2017 Tecnic Software productions (TNSP)
 //
 
-var mapServer = "wss://localhost:4200";
+var mapServer = "wss://tnsp.org:4200";
 var fieldPattern, fieldRes, fieldLog;
 var msgLog, mapWS, mapList = [];
 
@@ -105,7 +105,7 @@
   {
     // Web Socket is connected, send data using send()
     mapLog("Sending query to server.");
-    mapWS.send("MAPSEARCH:"+ 10 +":"+ searchList.join(":") +"\n" + fieldPattern.value);
+    mapWS.send("MAPSEARCH:"+ -1 +":"+ searchList.join(":") +"\n" + fieldPattern.value);
   };
 
   // Register events
@@ -129,6 +129,7 @@
         for (var i = 0; i < results.length; i++)
         {
           var res = results[i];
+
           str += "<div class=\"result\">"+
             "<a href=\"http://jeskko.pupunen.net/gmap2/?x="+
             res[5] +"&y="+ res[6] +"&zoom=10\">"+