Sha256: 64f2dd50aeb2812881c399bd6baaa1e04eafd037e1ed79ff72b58d6034fbbdc5

Contents?: true

Size: 1.58 KB

Versions: 4

Compression:

Stored size: 1.58 KB

Contents

<!doctype html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>Trix</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <link rel="stylesheet" type="text/css" href="trix.css">
    <style type="text/css">
      main {
        margin: 20px auto;
        max-width: 700px;
      }
    </style>
    <script type="text/javascript" src="trix.js"></script>
    <script type="text/javascript" src="trix/inspector.js"></script>
    <script type="text/javascript">
      document.addEventListener("trix-initialize", function(event) {
        Trix.Inspector.install(event.target);
      });

      document.addEventListener("trix-attachment-add", function(event) {
        var attachment = event.attachment;
        if (attachment.file) {
          var xhr = new XMLHttpRequest;
          xhr.open("POST", "/attachments", true);

          xhr.upload.onprogress = function(event) {
            var progress = event.loaded / event.total * 100;
            attachment.setUploadProgress(progress);
          };

          xhr.onload = function() {
            if (xhr.status === 201) {
              setTimeout(function() {
                var url = xhr.responseText;
                attachment.setAttributes({ url: url, href: url });
              }, 30)
            }
          };

          attachment.setUploadProgress(10);

          setTimeout(function() {
            xhr.send(attachment.file);
          }, 30)
        }
      });
    </script>
  </head>
  <body>
    <main>
      <trix-editor autofocus class="trix-content"></trix-editor>
    </main>
  </body>
</html>

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
vapid-0.1.3 lib/vapid/vendor/trix/assets/index.html
vapid-0.1.2 lib/vapid/vendor/trix/assets/index.html
vapid-0.1.1 lib/vapid/vendor/trix/assets/index.html
vapid-0.1.0 lib/vapid/vendor/trix/assets/index.html