geomena / sinatra / views / index.erb

  <div id="apsearch">
   <div>Search by network name: <span class="example">homenetwork</span></div>
   <div>or by MAC address: <span class="example">00:01:0a:22:3f:a1</span></div>
   <form action="/search">
    <input id="mac" type="text" name="q">
    <input type="submit" value="Search">
    <% if session[:searchmsg] %>
      <span id="searchmsg"> <%= session[:searchmsg] %> </span>
      <% session[:searchmsg] = nil %>
    <% end %>
   </form>
  </div>

  <p id="ocount">
   There are <%= ocount %> observations in the database. <br/>
   Mostly recently "<a href="/ap/<%=aplast["mac"]%>"><%=aplast["essid"]%></a>" was observed  at 
    <script>
      var localtime = new Date();
      <% time = Time.parse(aplast["created_at"]) %>
      localtime.setUTCFullYear(<%=time.year%>);
      localtime.setUTCMonth(<%=time.month%>);
      localtime.setUTCDate(<%=time.day%>);
      localtime.setUTCHours(<%=time.hour%>);
      localtime.setUTCMinutes(<%=time.min%>);
      localtime.setUTCSeconds(<%=time.sec%>);
      var hours = ""+localtime.getHours();
      if (hours > 12) { hours = hours - 12; ampm = "pm"} else {ampm = "am"}
      var minutes = ""+localtime.getMinutes();
      if (minutes.length == 1) { minutes = "0"+minutes }
      document.write(""+localtime.getFullYear()+"-"+
                       localtime.getMonth()+"-"+
                       localtime.getDate()+" "+
                       hours + ":" + minutes + ampm );
    </script>
  </p>

  <div id="browsersetupbox">
   To configure firefox, go to about:config and edit <i>geo.wifi.url</i> to be 
   "http://geomena.org"
  </div>

  <div id="browsersetupbox">
   To configure opera, go to opera:config and edit <i>Location Provider URL</i> to be 
   "http://geomena.org"
  </div>

  <p class="clear">
    See geolocation in action by <a href="/locate">looking up your location</a>.
  </p>

  <p>
   Sourcecode is available at <a href="http://bitbucket.org/donpdonp/geomena/">http://bitbucket.org/donpdonp/geomena/</a>.
  </p>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.