WeatherScript v1 - Documentation - 01/14/2018

Copryright © MidSpike.Com & Tyler S. Resch




Getting Started


  • Requirements to use WeatherScript:
    • We use jQuery (a JavaScript library) to speed up the development process and to ensure / provide the best compatibility for our users.
    • We use Font Awesome (an icon library) for the snowflakes icons.
    • This current WeatherScript relies on jQuery 3.1.1 and Font Awesome 5.
    • You can use the following code to add both jQuery and Font Awesome to your site.
      <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
      <script defer src="https://use.fontawesome.com/releases/v5.0.1/js/all.js"></script>
  • Setting up WeatherScript:
    • Download and move the SnowScript JavaScript file to your website's root directory.
    • You can use the following code to add WeatherScript to your site.
      <script type="text/javascript" async="async" src="/WeatherScript.js"></script>


Using WeatherScript


  • Custom Console Logging:
    • Time: weather.log("time");
    • Info: weather.log("info", "INFORMATION_TO_LOG");
    • Warn: weather.log("warn", "WARNING_TO_LOG");
    • Error: weather.log("error", "ERROR_TO_LOG");
  • Starting / Stopping / Restarting:
    • Toggle: weather.toggle("power");
    • Start: weather.start();
    • Stop: weather.stop();
    • Restart: weather.restart();
      • Restart with delayed start: weather.restart(TIME_IN_MS);
  • Showing / Hiding:
    • Toggle: weather.toggle("visibility");
    • Show: weather.show();
    • Hide: weather.hide();
  • Pausing / Resuming:
    • Toggle: weather.toggle("movement");
    • Pause: weather.pause();
      • Pause for set time: weather.pause(TIME_IN_MS);
    • Resume: weather.resume();
      • Resume for set time: weather.resume(TIME_IN_MS);
  • Creating / Deleting:
    • Create: weather.create();
    • Delete: weather.delete();
  • Weather Type Manipulation:
    • Getting List Of Types: weather.type('types');
    • Changing Weather Type: weather.type('NAME_OF_TYPE');


WeatherScript Demos


Starting / Stopping / Restarting


Showing / Hiding


Pausing / Resuming


Creating / Deleting