Sha256: dacb7a3cf8d48e91fd4d763b4fc5565c788565ffbfc4ff5f1da30a5e37953886

Contents?: true

Size: 1.07 KB

Versions: 4

Compression:

Stored size: 1.07 KB

Contents

<!DOCTYPE html>

<html>
  <head>
    <title>Oso</title>
    <link href="/index.css" rel="stylesheet" type="text/css">
  </head>

  <body>
    <form action="/" method="POST">
      <input id="url" name="url" placeholder="http://example.org"
             type="text"><input id="shorten" type="submit" value="Shorten">
    </form>

    <div id="shortened" style="display:none">
      <input readonly>
      <p>Copy and share this URL.</p>
    </div>

    <script type="text/javascript"
            src="http://code.jquery.com/jquery-1.5.min.js"></script>

    <script type="text/javascript">
      $(function() {
        $("form").submit(function() {
          var url = $("#url").val()

          if (!/^\s*$/.test(url)) {
            $.post("/", { url: url }, function(short) {
              $("form").hide()
              $("#shortened").show()
              $("#shortened input").val(short).select()
            })
          }

          return false
        })

        $("#shortened").click(function() {
          $("input", this).select()
        })
      })
    </script>
  </body>
</html>

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
oso-2.0.1 lib/oso/public/index.html
oso-2.0.0 lib/oso/public/index.html
oso-1.0.1 lib/oso/public/index.html
oso-1.0.0 lib/oso/public/index.html