[
  {
    "path": ".gitignore",
    "content": ".classpath\n.project\n.settings\n.idea\n*.iml\n\nwar\ntarget\n\ngoogle_maps_api_key\n\n"
  },
  {
    "path": "LICENSE",
    "content": "Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"{}\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright {yyyy} {name of copyright owner}\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License."
  },
  {
    "path": "README.md",
    "content": "android-gps-emulator\n====================\n\nandroid-gps-emulator is a GPS location emulator for changing/setting/simulating the GPS location of the Android emulator through a simple map-based interface, using the geo fix command.\n\nUsing GWT and Google Maps in combination with [JTA (Java telnet support)](http://javassh.org/space/start), this is a simple tool for emulating the geospatial (GPS) location of your local android emulator using the telnet geo fix command.\n\n\n**NOTE:** You must have a Google account _with billing enabled_ to generate an API key for the Google Maps JavaScript API. \nSee Google's documentation at [Get API Key](https://developers.google.com/maps/documentation/javascript/get-api-key)\n\nQuick Start\n-----------\n1. Download the [latest release](https://github.com/dpdearing/android-gps-emulator/releases/latest)\n2. Create a file named **`google_maps_api_key`** containing your API key\n3. Run the executable war: **`java -jar android-gps-emulator-0.3.war`**\n4. http://localhost:8080/gpsemulator/\n\n![android-gps-emulator](http://dpdearing.github.io/android-gps-emulator/img/android-gps-emulator.png)\n\n\nRunning on a Different Port\n---------------------------\n\nandroid-gps-emulator runs by default on port 8080.  The port can be changed by passing the desired port as a parameter when running the executable war.  For example, to run on port 9001:\n\n&nbsp;&nbsp;&nbsp;**`java -jar android-gps-emulator-0.3.war 9001`**\n\n\nGWT Hosted Mode (from source)\n-----------------------------\n1. Clone the repository\n2. Create a file named **`google_maps_api_key`** containing your API key\n3. From the command line execute **`mvn gwt:run`**\n4. Click `Launch Default Browser` from the GWT Development Mode\n\n"
  },
  {
    "path": "pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n         xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd\">\n  <modelVersion>4.0.0</modelVersion>\n  \n  <groupId>com.dpdearing.sandbox</groupId>\n  <artifactId>android-gps-emulator</artifactId>\n  <packaging>war</packaging>\n  <version>0.4-SNAPSHOT</version>\n\n  <name>Android GPS Emulator</name>\n  \n  <repositories>\n    <repository>\n      <id>project.local</id>\n      <url>file://${basedir}/./repo</url>\n    </repository>\n  </repositories>\n\n  <properties>\n    <!-- GWT configuration -->\n    <gwt.version>2.8.0</gwt.version>\n    <!-- Jetty configuration -->\n    <jetty.version>9.2.14.v20151106</jetty.version>\n\n    <!-- Compiler configuration -->\n    <!-- Setting maven.compiler.source to something different to 1.8\n         needs that you configure the sourceLevel in gwt-maven-plugin since\n         GWT compiler 2.8 requires 1.8 (see gwt-maven-plugin block below) -->\n    <maven.compiler.source>1.8</maven.compiler.source>\n    <maven.compiler.target>1.8</maven.compiler.target>\n\n    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>\n    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>\n\n    <gwt.module>com.dpdearing.sandbox.gpsemulator.GpsEmulator</gwt.module>\n    <gwt.module.name>gpsemulator</gwt.module.name>\n  </properties>\n\n  <dependencyManagement>\n    <dependencies>\n      <!-- ensure all GWT dependencies use the same version (unless overridden) -->\n      <dependency>\n        <groupId>com.google.gwt</groupId>\n        <artifactId>gwt</artifactId>\n        <version>${gwt.version}</version>\n        <scope>import</scope>\n        <type>pom</type>\n      </dependency>\n    </dependencies>\n  </dependencyManagement>\n\n  <dependencies>\n    <!-- JTA Java Telnet dependency -->\n    <dependency>\n      <groupId>de.mud</groupId>\n      <artifactId>jta</artifactId>\n      <version>2.6</version>\n    </dependency>\n    \n    <!-- GWT dependencies -->\n    <dependency>\n      <groupId>com.google.gwt</groupId>\n      <artifactId>gwt-servlet</artifactId>\n      <scope>runtime</scope>\n    </dependency>\n    <dependency>\n      <groupId>com.google.gwt</groupId>\n      <artifactId>gwt-user</artifactId>\n      <scope>provided</scope>\n    </dependency>\n    <dependency>\n      <groupId>com.google.gwt</groupId>\n      <artifactId>gwt-dev</artifactId>\n      <scope>provided</scope>\n    </dependency>\n    <dependency>\n      <groupId>com.google.gwt</groupId>\n      <artifactId>gwt-codeserver</artifactId>\n      <scope>provided</scope>\n    </dependency>\n\n    <!-- GWT Maps API V3 -->\n    <dependency>\n      <groupId>com.github.branflake2267</groupId>\n      <artifactId>gwt-maps-api</artifactId>\n      <version>3.10.0-alpha-7</version>\n    </dependency>\n\n    <!-- Jetty dependencies -->\n    <dependency>\n      <groupId>org.eclipse.jetty</groupId>\n      <artifactId>jetty-webapp</artifactId>\n      <version>${jetty.version}</version>\n      <scope>provided</scope>\n    </dependency>\n  </dependencies>\n  \n  <build>\n    <outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/classes</outputDirectory>\n\n    <plugins>\n      <!-- GWT Maven Plugin-->\n      <plugin>\n        <groupId>org.codehaus.mojo</groupId>\n        <artifactId>gwt-maven-plugin</artifactId>\n        <version>${gwt.version}</version>\n        <executions>\n          <execution>\n            <goals>\n              <goal>compile</goal>\n              <goal>generateAsync</goal>\n            </goals>\n          </execution>\n          <execution>\n            <!-- Run tests through gwt:test, this allows reusing the plugin configuration for GWTTestCases -->\n            <id>gwt-tests</id>\n            <phase>test</phase>\n            <goals>\n              <goal>test</goal>\n            </goals>\n          </execution>\n        </executions>\n        <configuration>\n          <!-- Plugin configuration. There are many available options,\n               see gwt-maven-plugin documentation at codehaus.org -->\n          <modules>\n            <module>com.dpdearing.sandbox.gpsemulator</module>\n          </modules>\n          <!-- GWT compiler 2.8 requires 1.8, hence define sourceLevel here if you use\n               a different source language for java compilation -->\n          <sourceLevel>1.8</sourceLevel>\n          <!-- URL that should be opened by DevMode (gwt:run). -->\n          <runTarget>${gwt.module.name}/index.html</runTarget>\n          <copyWebapp>true</copyWebapp>\n          <!-- Ask GWT to create the Story of Your Compile (SOYC) (gwt:compile) -->\n          <compileReport>true</compileReport>\n          <!-- Run tests using HtmlUnit -->\n          <mode>htmlunit</mode>\n          <!-- Tests patterns -->\n          <includes>**/Test*.java,**/*Test.java,**/*TestCase.java</includes>\n        </configuration>\n      </plugin>\n\n      <!-- Skip normal test execution, we use gwt:test instead -->\n      <plugin>\n        <artifactId>maven-surefire-plugin</artifactId>\n        <version>2.17</version>\n        <configuration>\n          <skip>true</skip>\n        </configuration>\n      </plugin>\n\n      <!-- Generate a war file with the deployment web.xml -->\n      <plugin>\n        <groupId>org.apache.maven.plugins</groupId>\n        <artifactId>maven-war-plugin</artifactId>\n        <version>2.0.2</version>\n        <configuration>\n          <archive>\n            <manifest>\n              <mainClass>Main</mainClass>\n            </manifest>\n          </archive>\n        </configuration>\n      </plugin>\n      \n      <!-- From http://uguptablog.blogspot.com/2012/09/embedded-jetty-executable-war-with.html -->\n      <!-- Ant Task to copy Main.class to the root of the war -->\n      <plugin>\n        <artifactId>maven-antrun-plugin</artifactId>\n        <executions>\n          <execution>\n            <id>main-class-placement</id>\n            <phase>prepare-package</phase>\n            <configuration>\n              <tasks>\n                <copy todir=\"${project.build.directory}/${project.artifactId}-${project.version}/\">\n                  <fileset dir=\"${project.build.outputDirectory}\">\n                    <include name=\"Main.class\" />\n                  </fileset>\n                </copy>\n              </tasks>\n            </configuration>\n            <goals>\n              <goal>run</goal>\n            </goals>\n          </execution>\n        </executions>\n      </plugin>\n            \n      <!-- From http://uguptablog.blogspot.com/2012/09/embedded-jetty-executable-war-with.html -->\n      <!-- Extract Jetty classes to the root of the war -->\n      <plugin>\n        <groupId>org.apache.maven.plugins</groupId>\n        <artifactId>maven-dependency-plugin</artifactId>\n        <version>2.3</version>\n        <executions>\n          <execution>\n            <id>jetty-classpath</id>\n            <phase>prepare-package</phase>\n            <goals>\n              <goal>unpack-dependencies</goal>\n            </goals>\n            <configuration>\n              <includeGroupIds>org.eclipse.jetty,javax.servlet,org.mortbay.jasper</includeGroupIds>\n              <outputDirectory>\n                ${project.build.directory}/${project.artifactId}-${project.version}\n              </outputDirectory>\n            </configuration>\n          </execution>\n        </executions>\n      </plugin>\n\n    </plugins>\n  </build>\n\n</project>\n"
  },
  {
    "path": "repo/de/mud/jta/2.6/jta-2.6.jar.md5",
    "content": "b47e203ccd4f3aae0c53e47052be9c68"
  },
  {
    "path": "repo/de/mud/jta/2.6/jta-2.6.jar.sha1",
    "content": "f278e7c4a3c0a43022a13766bb73c9d4339eb25a"
  },
  {
    "path": "repo/de/mud/jta/2.6/jta-2.6.pom",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\" xmlns=\"http://maven.apache.org/POM/4.0.0\"\n    xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n  <modelVersion>4.0.0</modelVersion>\n  <groupId>de.mud</groupId>\n  <artifactId>jta</artifactId>\n  <version>2.6</version>\n</project>\n"
  },
  {
    "path": "repo/de/mud/jta/2.6/jta-2.6.pom.md5",
    "content": "08d96f8b61f9aa224c79c9fb0d92ef5a"
  },
  {
    "path": "repo/de/mud/jta/2.6/jta-2.6.pom.sha1",
    "content": "23277ac79f4fe7be4bcdb39e8232a8ef23f326ef"
  },
  {
    "path": "repo/de/mud/jta/maven-metadata.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<metadata>\n  <groupId>de.mud</groupId>\n  <artifactId>jta</artifactId>\n  <versioning>\n    <release>2.6</release>\n    <versions>\n      <version>2.6</version>\n    </versions>\n    <lastUpdated>20140520044720</lastUpdated>\n  </versioning>\n</metadata>\n"
  },
  {
    "path": "repo/de/mud/jta/maven-metadata.xml.md5",
    "content": "1daa35267720b26493c6baa2a9284bd9"
  },
  {
    "path": "repo/de/mud/jta/maven-metadata.xml.sha1",
    "content": "ec44209de74ca4ebe675869a5aa3882983ae1cc8"
  },
  {
    "path": "src/main/java/Main.java",
    "content": "/**\n * Copyright (c) 2014-17 David Dearing\n */\n\nimport java.net.URL;\nimport java.security.ProtectionDomain;\n \nimport org.eclipse.jetty.server.HttpConfiguration;\nimport org.eclipse.jetty.server.HttpConnectionFactory;\nimport org.eclipse.jetty.server.Server;\nimport org.eclipse.jetty.server.ServerConnector;\nimport org.eclipse.jetty.webapp.WebAppContext;\n \n/**\n * Embedded Jetty executable WAR main entry point.\n * \n * See http://uguptablog.blogspot.com/2012/09/embedded-jetty-executable-war-with.html\n */\npublic class Main {\n\n\t/**\n\t * @param args\n\t */\n\tpublic static void main(String[] args) throws Exception\n\t{\n\t\tServer server = new Server();\n\n\t\tHttpConfiguration config = new HttpConfiguration();\n\t\tServerConnector http = new ServerConnector(server, new HttpConnectionFactory(config));\n\n\t\tint port = 8080;\n\t\tif (args.length > 0) {\n\t\t\tport = Integer.parseInt(args[0]);\n\t\t}\n\n\t\thttp.setPort(port);\n\t\tserver.addConnector(http);\n\t\t\n\t\tProtectionDomain domain = Main.class.getProtectionDomain();\n\t\tURL location = domain.getCodeSource().getLocation();\n\t\tWebAppContext webapp = new WebAppContext();\n\t\twebapp.setContextPath(\"/\");\n\t\twebapp.setWar(location.toExternalForm());\n\t\tserver.setHandler(webapp);\n\t\t\n\t\tserver.start();\n\t\tserver.join();\n\t}\n}\n"
  },
  {
    "path": "src/main/java/com/dpdearing/sandbox/gpsemulator/client/GpsEmulator.java",
    "content": "/**\r\n * Copyright (c) 2010-17 David Dearing\r\n */\r\n\r\npackage com.dpdearing.sandbox.gpsemulator.client;\r\n\r\nimport com.dpdearing.sandbox.gpsemulator.common.LocationServiceAsync;\r\nimport com.google.gwt.core.client.EntryPoint;\r\nimport com.google.gwt.core.client.GWT;\r\nimport com.google.gwt.dom.client.Document;\r\nimport com.google.gwt.dom.client.Element;\r\nimport com.google.gwt.event.dom.client.ClickEvent;\r\nimport com.google.gwt.event.dom.client.ClickHandler;\r\nimport com.google.gwt.maps.client.LoadApi;\r\nimport com.google.gwt.maps.client.MapOptions;\r\nimport com.google.gwt.maps.client.MapWidget;\r\nimport com.google.gwt.maps.client.base.LatLng;\r\nimport com.google.gwt.maps.client.events.click.ClickMapEvent;\r\nimport com.google.gwt.maps.client.events.click.ClickMapHandler;\r\nimport com.google.gwt.maps.client.overlays.Marker;\r\nimport com.google.gwt.maps.client.overlays.MarkerOptions;\r\nimport com.google.gwt.user.client.Command;\r\nimport com.google.gwt.user.client.rpc.AsyncCallback;\r\nimport com.google.gwt.user.client.ui.Button;\r\nimport com.google.gwt.user.client.ui.FlowPanel;\r\nimport com.google.gwt.user.client.ui.InlineLabel;\r\nimport com.google.gwt.user.client.ui.Label;\r\nimport com.google.gwt.user.client.ui.RootLayoutPanel;\r\nimport com.google.gwt.user.client.ui.TextBox;\r\n\r\n/**\r\n * Entry point classes define <code>onModuleLoad()</code>.\r\n */\r\npublic class GpsEmulator implements EntryPoint, ClickMapHandler {\r\n   /**\r\n    * The default emulator hostname port\r\n    */\r\n   static private final String DEFAULT_HOST = \"localhost\";\r\n   static private final int DEFAULT_PORT = 5554;\r\n\r\n   static private final String SUCCESS_STYLE = \"success\";\r\n   static private final String ERROR_STYLE = \"error\";\r\n\r\n   /**\r\n    * Create a remote service proxy to talk to the server-side Location service.\r\n    */\r\n   private final LocationServiceAsync _service =\r\n         LocationServiceAsync.Util.getInstance();\r\n\r\n   /**\r\n    * The map and current marker shown\r\n    */\r\n   private MapWidget _map;\r\n   private Marker _currentMarker = null;\r\n\r\n   /**\r\n    * The textboxes, button, and info label for configuring the host and port.\r\n    */\r\n   private TextBox _hostname;\r\n   private TextBox _port;\r\n   private Button _button;\r\n   private Label _info;\r\n   \r\n   /**\r\n    * This is the entry point method.\r\n    */\r\n   public void onModuleLoad() {\r\n      GWT.setUncaughtExceptionHandler(\r\n            new GWT.UncaughtExceptionHandler() {\r\n               public void onUncaughtException(Throwable t) {\r\n                  GWT.log(\"Client-side uncaught exception\", t);\r\n               }\r\n           }\r\n      );\r\n\r\n      initializeUI();\r\n      loadMapApi();\r\n   }\r\n\r\n   /**\r\n    * Retrieve the Google Maps API key and load the API\r\n    */\r\n   private void loadMapApi() {\r\n      // retrieve the Google Maps API Key and then initialize the UI\r\n      _service.getApiKey(new AsyncCallback<String>() {\r\n\r\n         @Override\r\n         public void onFailure(Throwable caught) {\r\n            setErrorMessage(caught.getLocalizedMessage());\r\n         }\r\n\r\n         @Override\r\n         public void onSuccess(String apiKey) {\r\n            loadMapApi(apiKey);\r\n         }\r\n      });\r\n   }\r\n\r\n   /**\r\n    * Load the GWT Google Maps API using the provided API key.\r\n    *\r\n    * @param apiKey\r\n    */\r\n   private void loadMapApi(String apiKey) {\r\n      final StringBuilder otherParameters = new StringBuilder();\r\n      if (apiKey != null) {\r\n         otherParameters.append(\"key=\");\r\n         otherParameters.append(apiKey);\r\n      }\r\n      GWT.log(\"LoadApi otherParameters: \"+otherParameters.toString());\r\n\r\n      LoadApi.go(this::initializeMap, null, false, otherParameters.toString());\r\n   }\r\n   \r\n   /**\r\n    * Initialize the Emulator UI\r\n    */\r\n   private void initializeUI() {\r\n      // Create textboxes and set default hostname and port\r\n      _hostname = new TextBox();\r\n      _hostname.setText(DEFAULT_HOST);\r\n      _hostname.getElement().setPropertyString(\"placeholder\", \"hostname\");\r\n      _port = new TextBox();\r\n      _port.setText(String.valueOf(DEFAULT_PORT));\r\n      _port.getElement().setPropertyString(\"placeholder\", \"port\");\r\n\r\n      // Create button to connect\r\n      _button = new Button(\"Connect\");\r\n      // Create the info/status label, initially not visible\r\n      _info = new InlineLabel();\r\n      _info.setVisible(false);\r\n\r\n      // register the button action\r\n      _button.addClickHandler(new ClickHandler() {\r\n         public void onClick(final ClickEvent event) {\r\n            final String hostname = _hostname.getText();\r\n            final int port = Integer.valueOf(_port.getText());\r\n            new PortAsyncCallback(hostname, port).execute();\r\n         }\r\n      });\r\n      \r\n      // Create panel for textbox, button and info label\r\n      final FlowPanel div = new FlowPanel();\r\n      div.setStylePrimaryName(\"emulator-controls\");\r\n      _hostname.setStyleName(\"emulator-hostname\");\r\n      _port.setStyleName(\"emulator-port\");\r\n      _button.setStyleName(\"emulator-connect\");\r\n      _info.setStyleName(\"emulator-info\");\r\n      div.add(_hostname);\r\n      div.add(_port);\r\n      div.add(_button);\r\n      div.add(_info);\r\n\r\n      // add the controls before the map so that the div doesn't cover the map\r\n      RootLayoutPanel.get().add(div);\r\n   }\r\n\r\n   /**\r\n    * Initialize the Map widget and default zoom/position\r\n    */\r\n   private void initializeMap() {\r\n      // Create a map centered on Cawker City, KS USA\r\n      final MapOptions opts = MapOptions.newInstance();\r\n      if (opts == null) {\r\n         GWT.log(\"MapOptions was null\");\r\n      }\r\n      final LatLng center = LatLng.newInstance(30.0, 0.00);\r\n      opts.setCenter(center);\r\n      opts.setZoom(2);\r\n\r\n      _map = new MapWidget(opts);\r\n\r\n      // Register map click handler\r\n      _map.addClickHandler(this);\r\n      RootLayoutPanel.get().add(_map);\r\n   }\r\n\r\n      /**\r\n       * Handle a map click event\r\n       */\r\n   public void onEvent(ClickMapEvent clickMapEvent) {\r\n      final LatLng point = clickMapEvent.getMouseEvent().getLatLng();\r\n\r\n      // set the location\r\n      new GeoFixAsyncCallback(point.getLatitude(), point.getLongitude()).execute();\r\n   }\r\n\r\n   /**\r\n    * Create and add a new marker\r\n    *\r\n    * @param latitude\r\n    * @param longitude\r\n    * @return\r\n    */\r\n   private Marker addMarker(double latitude, double longitude) {\r\n      return addMarker(LatLng.newInstance(latitude, longitude));\r\n   }\r\n\r\n   /**\r\n    * Create and add a new marker\r\n    *\r\n    * @param point\r\n    * @return\r\n    */\r\n   private Marker addMarker(LatLng point) {\r\n      MarkerOptions opts = MarkerOptions.newInstance();\r\n      opts.setMap(_map);\r\n      opts.setPosition(point);\r\n      return Marker.newInstance(opts);\r\n   }\r\n\r\n   /**\r\n    * Clear the last-placed marker\r\n    */\r\n   private void clearMarker() {\r\n      if (_currentMarker != null) {\r\n         _currentMarker.clear();\r\n      }\r\n   }\r\n\r\n   private void setSuccessMessage(String message) {\r\n      _info.addStyleDependentName(SUCCESS_STYLE);\r\n      _info.setText(message);\r\n      _info.setVisible(true);\r\n   }\r\n\r\n   private void setErrorMessage(String message) {\r\n      _info.addStyleDependentName(ERROR_STYLE);\r\n      _info.setText(message);\r\n      _info.setVisible(true);\r\n      flash();\r\n   }\r\n\r\n   private void clearMessage() {\r\n      _info.setText(\"\");\r\n      _info.removeStyleDependentName(ERROR_STYLE);\r\n      _info.removeStyleDependentName(SUCCESS_STYLE);\r\n      _info.setVisible(false);\r\n      resetFlash();\r\n   }\r\n\r\n   private void flash() {\r\n      getFlashElement().addClassName(\"active\");\r\n   }\r\n\r\n   private void resetFlash() {\r\n      getFlashElement().removeClassName(\"active\");\r\n   }\r\n\r\n   private Element getFlashElement() {\r\n      return Document.get().getElementById(\"error-flash\");\r\n   }\r\n\r\n   /**\r\n    * Asynchronous callback for setting the telnet port.\r\n    */\r\n   private class PortAsyncCallback implements AsyncCallback<Void>, Command {\r\n      private final String _hostname;\r\n      private final int _port;\r\n      \r\n      /**\r\n       * Constructor\r\n       *\r\n       * @param hostname the hostname\r\n       * @param port the port\r\n       */\r\n      public PortAsyncCallback(final String hostname, final int port) {\r\n         _hostname = hostname;\r\n         _port = port;\r\n      }\r\n      \r\n      /**\r\n       * Success!\r\n       * \r\n       * @param result void\r\n       */\r\n      public void onSuccess(final Void result) {\r\n         setSuccessMessage(\"Connected to \" + _hostname + \":\" + _port);\r\n      }\r\n\r\n      /**\r\n       * Oh no!\r\n       */\r\n      public void onFailure(final Throwable caught) {\r\n         setErrorMessage(\"Error connecting to \" + _hostname + \":\" + _port + \" - \"\r\n               + caught.getLocalizedMessage());\r\n      }\r\n      \r\n      /**\r\n       * Execute service method\r\n       */\r\n      public void execute() {\r\n         // clear the marker and message when (re-)connecting\r\n         clearMarker();\r\n         clearMessage();\r\n         _service.connect(_hostname, _port, this);\r\n      }\r\n   }\r\n   \r\n   /**\r\n    * Asynchronous callback for changing the emulator's location\r\n    */\r\n   private class GeoFixAsyncCallback implements AsyncCallback<Void>, Command {\r\n      private final double _latitude;\r\n      private final double _longitude;\r\n\r\n      /**\r\n       * Constructor.\r\n       * \r\n       * @param latitude\r\n       *           latitude\r\n       * @param longitude\r\n       *           longitude\r\n       */\r\n      public GeoFixAsyncCallback(final double latitude, final double longitude) {\r\n         _latitude = latitude;\r\n         _longitude = longitude;\r\n      }\r\n      \r\n      /**\r\n       * Success!\r\n       * \r\n       * @param result void\r\n       */\r\n      public void onSuccess(final Void result) {\r\n         // add the new marker\r\n         _currentMarker = addMarker(_latitude, _longitude);\r\n         setSuccessMessage(\"geo fix \" + _longitude + \" \" + _latitude);\r\n      }\r\n      \r\n      /**\r\n       * Oh no!\r\n       */\r\n      public void onFailure(final Throwable caught) {\r\n         setErrorMessage(\"Error setting location: \" + caught.getLocalizedMessage());\r\n      }\r\n\r\n      /**\r\n       * Execute service method\r\n       */\r\n      public void execute() {\r\n         // clear the marker and message before setting new location\r\n         clearMarker();\r\n         clearMessage();\r\n         _service.setLocation(_latitude, _longitude, this);\r\n      }\r\n   }\r\n}\r\n"
  },
  {
    "path": "src/main/java/com/dpdearing/sandbox/gpsemulator/common/EmulatorCommandException.java",
    "content": "/**\n * Copyright (c) 2017 David Dearing\n */\n\npackage com.dpdearing.sandbox.gpsemulator.common;\n\nimport com.google.gwt.user.client.rpc.IsSerializable;\n\n/**\n * A GWT-IsSerializable exception for unexpected events when sending a command to the android emulator.\n */\npublic class EmulatorCommandException extends Exception implements IsSerializable {\n    public EmulatorCommandException() {\n        super();\n    }\n\n    public EmulatorCommandException(String message) {\n        super(message);\n    }\n}\n"
  },
  {
    "path": "src/main/java/com/dpdearing/sandbox/gpsemulator/common/EmulatorConnectionException.java",
    "content": "/**\n * Copyright (c) 2017 David Dearing\n */\n\npackage com.dpdearing.sandbox.gpsemulator.common;\n\nimport com.google.gwt.user.client.rpc.IsSerializable;\n\n/**\n * A GWT-IsSerializable exception for unexpected events when making a connection to the android emulator.\n */\npublic class EmulatorConnectionException extends Exception implements IsSerializable {\n    public EmulatorConnectionException() {\n        super();\n    }\n\n    public EmulatorConnectionException(String message) {\n        super(message);\n    }\n}\n"
  },
  {
    "path": "src/main/java/com/dpdearing/sandbox/gpsemulator/common/LocationService.java",
    "content": "/**\r\n * Copyright (c) 2010-17 David Dearing\r\n */\r\n\r\npackage com.dpdearing.sandbox.gpsemulator.common;\r\n\r\nimport com.google.gwt.user.client.rpc.RemoteService;\r\nimport com.google.gwt.user.client.rpc.RemoteServiceRelativePath;\r\n\r\n/**\r\n * The client side stub for the RPC service.\r\n */\r\n@RemoteServiceRelativePath(\"location\")\r\npublic interface LocationService extends RemoteService {\r\n   /**\r\n    * Connect to the hostname and port\r\n    *\r\n    * @param hostname\r\n    *           the hostname\r\n    * @param port\r\n    *           the port number\r\n    * @throws EmulatorConnectionException\r\n    */\r\n   void connect(String hostname, int port) throws EmulatorConnectionException;\r\n\r\n   /**\r\n    * Set the geospatial location\r\n    * \r\n    * @param latitude\r\n    *           latitude\r\n    * @param longitude\r\n    *           longitude\r\n    * @throws EmulatorCommandException\r\n    */\r\n   void setLocation(double latitude, double longitude) throws EmulatorCommandException;\r\n\r\n   /**\r\n    * @return the Google Maps API Key\r\n    * @throws EmulatorCommandException\r\n    */\r\n   String getApiKey() throws EmulatorCommandException;\r\n}\r\n"
  },
  {
    "path": "src/main/java/com/dpdearing/sandbox/gpsemulator/server/LocationServiceImpl.java",
    "content": "/**\r\n * Copyright (c) 2010-17 David Dearing\r\n */\r\n\r\npackage com.dpdearing.sandbox.gpsemulator.server;\r\n\r\nimport java.io.File;\r\nimport java.io.IOException;\r\nimport java.util.Scanner;\r\nimport java.util.logging.Level;\r\nimport java.util.logging.Logger;\r\n\r\nimport com.dpdearing.sandbox.gpsemulator.common.EmulatorCommandException;\r\nimport com.dpdearing.sandbox.gpsemulator.common.EmulatorConnectionException;\r\nimport com.dpdearing.sandbox.gpsemulator.common.LocationService;\r\nimport com.google.gwt.user.server.rpc.RemoteServiceServlet;\r\n\r\nimport de.mud.telnet.TelnetWrapper;\r\n\r\n/**\r\n * The server side implementation of the RPC service.\r\n */\r\n@SuppressWarnings(\"serial\")\r\npublic class LocationServiceImpl extends RemoteServiceServlet implements LocationService {\r\n\r\n   private static Logger logger =\r\n           Logger.getLogger(LocationServiceImpl.class.getName());\r\n\r\n   /**\r\n    * The Google Maps API Key file\r\n    */\r\n   final private File GOOGLE_MAPS_API_KEY_FILE = new File(\"google_maps_api_key\");\r\n\r\n   /**\r\n    * The telnet wrapper.\r\n    */\r\n   final private TelnetWrapper _telnet;\r\n   private Boolean _isTelnetActive = false;\r\n\r\n   /**\r\n    * The emulator authentication token\r\n    */\r\n   private String _emulator_console_auth_token = null;\r\n\r\n   /**\r\n    * Constructor.\r\n    */\r\n   public LocationServiceImpl() {\r\n      _telnet = new TelnetWrapper();\r\n\r\n      //TODO does this work on all platforms?\r\n      final String home = System.getProperty(\"user.home\");\r\n      final File authTokenFile = new File(home, \".emulator_console_auth_token\");\r\n      try {\r\n         // read the entire contents of the file\r\n         _emulator_console_auth_token = new Scanner(authTokenFile).useDelimiter(\"\\\\Z\").next();\r\n         logger.info(\"Loaded emulator_console_auth_token \" + _emulator_console_auth_token);\r\n      } catch (IOException ioe) {\r\n         logger.log(Level.SEVERE,\r\n                 \"Failed to read the emulator_console_auth_token from \" +\r\n                         authTokenFile.getAbsolutePath(),\r\n                 ioe);\r\n      }\r\n   }\r\n\r\n   /**\r\n    * {@inheritDoc}\r\n    */\r\n   public void connect(final String hostname, final int port)\r\n         throws EmulatorConnectionException {\r\n      // disconnect from any previous connection\r\n      try {\r\n         _telnet.disconnect();\r\n      } catch (IOException ioe) {\r\n         throw new EmulatorConnectionException(ioe.getMessage());\r\n      }\r\n      _isTelnetActive = false;\r\n\r\n      // connect to the specified host\r\n      logger.info(\"Connecting to emulator at \"+ hostname + \":\" + port);\r\n\r\n      try {\r\n         _telnet.connect(hostname, port);\r\n         _isTelnetActive = true;\r\n      } catch (IOException ioe) {\r\n         throw new EmulatorConnectionException(ioe.getMessage());\r\n      }\r\n\r\n      if (_emulator_console_auth_token == null) {\r\n         logger.info(\"No emulator_console_auth_token; skipping authentication\");\r\n      } else {\r\n         logger.info(\"Authenticating with emulator_console_auth_token: \" +\r\n               _emulator_console_auth_token);\r\n         try {\r\n            _telnet.send(\"auth \" + _emulator_console_auth_token);\r\n         } catch (IOException ioe) {\r\n            throw new EmulatorConnectionException(ioe.getMessage());\r\n         }\r\n      }\r\n   }\r\n   \r\n   /**\r\n    * {@inheritDoc}\r\n    */\r\n   public void setLocation(final double latitude, final double longitude)\r\n         throws EmulatorCommandException {\r\n      if (_isTelnetActive) {\r\n         try {\r\n            // telnet the geo fix location: longitude first!\r\n            String geo = \"geo fix \" + longitude + \" \" + latitude;\r\n            logger.info(\"Sending command: \" + geo);\r\n            _telnet.send(geo);\r\n         } catch (IOException ioe) {\r\n            throw new EmulatorCommandException(ioe.getMessage());\r\n         } catch (Exception npe) {\r\n            throw new EmulatorCommandException(\"Unexpected error within telnet connection.\");\r\n         }\r\n      }\r\n      else {\r\n         // throw an exception or client will think that setLocation() was a success\r\n         throw new EmulatorCommandException(\"Not connected to the emulator.\");\r\n      }\r\n   }\r\n\r\n   /**\r\n    * {@inheritDoc}\r\n    */\r\n   public String getApiKey() throws EmulatorCommandException {\r\n      try {\r\n         return loadGoogleMapsApiKey();\r\n      } catch (IOException ioe) {\r\n         final String message = \"Failed to read the Google Maps API Key from \" +\r\n               GOOGLE_MAPS_API_KEY_FILE.getAbsolutePath();\r\n\r\n         logger.log(Level.SEVERE, message, ioe);\r\n         throw new EmulatorCommandException(message);\r\n      }\r\n   }\r\n\r\n   private String loadGoogleMapsApiKey() throws IOException {\r\n      // read the entire contents of the file\r\n      logger.info(\"Reading Google Maps API Key file at \" +\r\n            GOOGLE_MAPS_API_KEY_FILE.getAbsolutePath());\r\n      final String apiKey = new Scanner(GOOGLE_MAPS_API_KEY_FILE).useDelimiter(\"\\\\Z\").next();\r\n      logger.info(\"Loaded Google Maps API Key: \" + apiKey);\r\n      return apiKey;\r\n   }\r\n\r\n}\r\n"
  },
  {
    "path": "src/main/resources/com/dpdearing/sandbox/gpsemulator/GpsEmulator.gwt.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<module rename-to='gpsemulator'>\r\n  <!-- Inherit the core Web Toolkit stuff.                        -->\r\n  <inherits name='com.google.gwt.user.User'/>\r\n\r\n  <!-- Inherit the GWT Google Maps stuff.                         -->\r\n  <inherits name='com.google.gwt.maps.Maps' />\r\n\r\n  <!-- Inherit the default GWT style sheet.  You can change       -->\r\n  <!-- the theme of your GWT application by uncommenting          -->\r\n  <!-- any one of the following lines.                            -->\r\n  <inherits name='com.google.gwt.user.theme.standard.Standard'/>\r\n  <!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->\r\n  <!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/>     -->\r\n\r\n  <!-- Other module inherits                                      -->\r\n\r\n  <!-- Specify the app entry point class.                         -->\r\n  <entry-point class='com.dpdearing.sandbox.gpsemulator.client.GpsEmulator'/>\r\n\r\n  <!-- Specify the paths for translatable code                    -->\r\n  <source path='client'/>\r\n  <source path='common'/>\r\n\r\n</module>\r\n"
  },
  {
    "path": "src/main/webapp/WEB-INF/web.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<!DOCTYPE web-app\r\n    PUBLIC \"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN\"\r\n    \"http://java.sun.com/dtd/web-app_2_3.dtd\">\r\n\r\n<web-app>\r\n  \r\n  <!-- Servlets -->\r\n  <servlet>\r\n    <servlet-name>locationServlet</servlet-name>\r\n    <servlet-class>com.dpdearing.sandbox.gpsemulator.server.LocationServiceImpl</servlet-class>\r\n  </servlet>\r\n  \r\n  <servlet-mapping>\r\n    <servlet-name>locationServlet</servlet-name>\r\n    <url-pattern>/gpsemulator/location</url-pattern>\r\n  </servlet-mapping>\r\n  \r\n  <!-- Default page to serve -->\r\n  <welcome-file-list>\r\n    <welcome-file>index.html</welcome-file>\r\n  </welcome-file-list>\r\n\r\n</web-app>\r\n"
  },
  {
    "path": "src/main/webapp/gpsemulator/index.html",
    "content": "<!doctype html>\r\n<!-- The DOCTYPE declaration above will set the    -->\r\n<!-- browser's rendering engine into               -->\r\n<!-- \"Standards Mode\". Replacing this declaration  -->\r\n<!-- with a \"Quirks Mode\" doctype may lead to some -->\r\n<!-- differences in layout.                        -->\r\n\r\n<html>\r\n  <head>\r\n    <meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\">\r\n    <title>Android GPS Emulator: Geospatial Location Emulation</title>\r\n    <script type=\"text/javascript\" language=\"javascript\" src=\"gpsemulator.nocache.js\"></script>\r\n    <style type=\"text/css\">\r\n      /* Makes the page fill the window. */\r\n      html, body {\r\n        height: 100%;\r\n        margin: 0;\r\n        padding: 0;\r\n      }\r\n      body {\r\n        background-color: #d4d4d4 !important;\r\n      }\r\n      .emulator-controls {\r\n        z-index: 1;\r\n        display: inline-block;\r\n        top: 9px !important;\r\n        margin: auto;\r\n        width: 400px;\r\n        pointer-events: none;\r\n      }\r\n      .emulator-hostname {\r\n        margin: 0;\r\n        padding: 8px;\r\n        font-size: 18px;\r\n        font-family: Roboto,Arial,sans-serif;\r\n        pointer-events: initial;\r\n      }\r\n      .emulator-port {\r\n        margin: 0;\r\n        padding: 8px;\r\n        width: 3em;\r\n        font-size: 18px;\r\n        font-family: Roboto,Arial,sans-serif;\r\n        pointer-events: initial;\r\n      }\r\n      .emulator-connect {\r\n        margin: 0 4px;\r\n        padding: 8px;\r\n        font-size: 18px;\r\n        font-family: Roboto,Arial,sans-serif;\r\n        pointer-events: initial;\r\n      }\r\n      .emulator-info {\r\n        display: block;\r\n        margin: 5px 0px;\r\n        padding: 6px;\r\n        border: 1px solid white;\r\n        border-radius: 5px;\r\n        background-color: white;\r\n        font-family: Roboto,Arial,sans-serif;\r\n        font-size: 16px;\r\n        pointer-events: initial;\r\n      }\r\n      .emulator-info-error {\r\n        color: #940000;\r\n        background-color: #f8d7da;\r\n        border-color: #eeaaaa;\r\n      }\r\n      .emulator-info-success {\r\n        color: #155724;\r\n        background-color: #d4edda;\r\n        border-color: #83cb94;\r\n      }\r\n      #error-flash {\r\n        pointer-events: none;\r\n        z-index: 1;\r\n        opacity:0;\r\n        background-color: #c30000;\r\n        position: absolute;\r\n        top: 0;\r\n        bottom: 0;\r\n        left: 0;\r\n        right: 0;\r\n      }\r\n      @-webkit-keyframes flash {\r\n        0% {\r\n          opacity:1;\r\n        }\r\n        50% {\r\n          opacity:.5;\r\n        }\r\n        100% {\r\n          opacity: 0;\r\n        }\r\n      }\r\n      .active {\r\n        -webkit-animation-name: flash;\r\n        -webkit-animation-duration: 200ms;\r\n        -webkit-animation-iteration-count: 1;\r\n        -webkit-animation-timing-function: linear;\r\n        -moz-animation-name: flash;\r\n        -moz-animation-duration: 200ms;\r\n        -moz-animation-iteration-count: 1;\r\n        -moz-animation-timing-function: linear;\r\n      }\r\n    </style>\r\n  </head>\r\n\r\n  <body>\r\n\r\n    <!-- RECOMMENDED if your web app will not function without JavaScript enabled -->\r\n    <noscript>\r\n      <div style=\"width: 22em; position: absolute; left: 50%; margin-left: -11em; color: red; background-color: white; border: 1px solid red; padding: 4px; font-family: sans-serif\">\r\n        Your web browser must have JavaScript enabled\r\n        in order for this application to display correctly.\r\n      </div>\r\n    </noscript>\r\n\r\n    <div id=\"error-flash\"></div>\r\n\r\n  </body>\r\n</html>\r\n"
  }
]