scratch – Blame information for rev 35

Subversion Repositories:
Rev:
Rev Author Line No. Line
25 office 1 <!DOCTYPE html>
2 <html lang="en">
3 <head>
4 <meta charset="utf-8">
5 <meta http-equiv="X-UA-Compatible" content="IE=edge">
35 office 6 <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
7 <meta http-equiv="Pragma" content="no-cache" />
8 <meta http-equiv="Expires" content="0" />
25 office 9 <meta name="viewport" content="width=device-width, initial-scale=1">
10 <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
11 <meta name="description" content="quick asset upload">
12 <meta name="author" content="Wizardry and Steamworks">
13 <link rel="icon" href="favicon.ico">
14  
15 <title>Quickload</title>
31 office 16  
17 <!-- Polyfill -->
32 office 18 <script src="js/polyfill/polyfill.min.js"></script>
25 office 19  
20 <!-- Bootstrap core CSS -->
21 <link href="css/bootstrap/bootstrap.min.css" rel="stylesheet">
22  
23 <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
24 <link href="css/bootstrap/ie10-viewport-bug-workaround.css" rel="stylesheet">
25  
26 <!-- Just for debugging purposes. Don't actually copy these 2 lines! -->
27 <!--[if lt IE 9]><script src="js/bootstrap/ie8-responsive-file-warning.js"></script><![endif]-->
28 <script src="js/bootstrap/ie-emulation-modes-warning.js"></script>
29  
30 <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
31 <!--[if lt IE 9]>
32 <script src="js/bootstrap/html5shiv.min.js"></script>
33 <script src="js/bootstrap/respond.min.js"></script>
34 <![endif]-->
35  
36 <!-- Trumbowyg -->
37 <link href="css/trumbowyg/trumbowyg.min.css" rel="stylesheet">
38 <!-- Local style -->
32 office 39 <link href="css/text/style.css" rel="stylesheet">
25 office 40 </head>
41  
42 <body>
43  
44 <div class="container">
45  
46 <!-- Main component for a primary marketing message or call to action -->
47 <div class="jumbotron">
48 <h1>Quickload</h1>
49 <p>Asset sharing platform.</p>
50 </div>
51  
52 <ul class="nav nav-tabs">
53 <li><a href="index.html">Home</a></li>
54 <li><a href="files.html">Files</a></li>
55 <li class="active"><a href="#">Text</a></li>
56 </ul>
57  
31 office 58 <div class="panel panel-default">
59 <div class="panel-heading">
60 <div class="input-group">
61 <input id="URL" type="text" class="form-control" readonly>
62 <span class="input-group-btn">
63 <button id="save" class="btn btn-default" type="button">
64 <i class="glyphicon glyphicon-globe"></i>
65 </button>
66 </span>
32 office 67 <span class="input-group-btn">
68 <button id="clippy" class="btn btn-default" type="button" data-clipboard-target="#URL"><img class="clippy" src="img/clipboard/clippy.svg" width="13" alt="Copy to Clipboard"></button>
69 </span>
31 office 70 </div>
71 </div>
32 office 72 <div class="panel-body" id="editorpanel">
73 <div id="trumbowyg" style="display: none; font-family: monospace;">
31 office 74 </div>
75 </div>
25 office 76 </div>
77  
78 </div> <!-- /container -->
79  
80 <div id="footer">
81 <div class="container">
82 <p class="text-muted credit">Copyright <i class="glyphicon glyphicon-copyright-mark"></i> 2017 <a href="http://grimore.org">Wizardry and Steamworks</a>.</p>
83 </div>
84 </div>
85  
86 <script src="js/jquery/jquery.min.js"></script>
87 <script src="js/bootstrap/bootstrap.min.js"></script>
88 <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
89 <script src="js/bootstrap/ie10-viewport-bug-workaround.js"></script>
90  
91 <!-- Trumbowyg -->
92 <script src="js/trumbowyg/trumbowyg.min.js"></script>
32 office 93 <!-- Clipboard -->
94 <script src="js/clipboard/clipboard.min.js"></script>
25 office 95 <script>
96 $(document).ready(() => {
31 office 97 // Load the editor.
25 office 98 $('#trumbowyg').trumbowyg({
29 office 99 autogrow: true,
100 disabled: true
101 }).on('tbwchange', () => {
102 $('#editor').trumbowyg('disable');
103 $.post('share-text.php', {
104 data: $('#trumbowyg').trumbowyg('html'),
105 }).done((data) => {
106 $('#trumbowyg').trumbowyg('enable');
107 }).fail(() => {
108 $('#trumbowyg').trumbowyg('enable');
25 office 109 });
110 });
31 office 111  
112 // Retrieve the contents of the shared file.
35 office 113 $.get('share-text.php' + '?t=' + window.performance.now(),
34 office 114 {
115 cache: false
116 }).done((data) => {
29 office 117 $('#trumbowyg')
118 .trumbowyg('html', data);
119 $('#trumbowyg').trumbowyg('enable');
30 office 120 $('#trumbowyg').show();
29 office 121 }).fail(() => {
122 $('#trumbowyg').trumbowyg('enable');
30 office 123 $('#trumbowyg').show();
29 office 124 });
31 office 125  
32 office 126 // Enable the Clipboard button.
127 new Clipboard('#clippy');
128  
31 office 129 $('#save').click(() => {
130 $('#editor').trumbowyg('disable');
131  
132 var formData = new FormData();
133 formData.append('file', new Blob(
134 [
135 $('#trumbowyg').trumbowyg('html')
136 ]
137 ),
138 '.html'
139 );
140  
141 $.ajax({
142 url: 'upload-files.php',
143 type: 'POST',
144 data: formData,
145 cache: false,
146 processData: false,
147 contentType: false
148 }).done((data) => {
149 $('#URL').val(data);
150 $('#trumbowyg').trumbowyg('enable');
151 }).fail(() => {
152 alert('failed');
153 $('#trumbowyg').trumbowyg('enable');
154 });
155 });
32 office 156  
25 office 157 });
158 </script>
159 </body>
160 </html>