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