scratch – Diff between revs 34 and 35

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