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