scratch – Diff between revs 30 and 31
?pathlinks?
Rev 30 | Rev 31 | |||
---|---|---|---|---|
Line 9... | Line 9... | |||
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"> |
|
Line 11... | Line 11... | |||
11 | |
11 | |
|
Line -... | Line 12... | |||
- | 12 | <title>Quickload</title> |
||
- | 13 | |
||
- | 14 | <!-- Polyfill --> |
||
12 | <title>Quickload</title> |
15 | <!-- <script src="js/polyfill/polyfill.min.js"></script> --> |
|
13 | |
16 | |
|
Line 14... | Line 17... | |||
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"> |
|
Line 47... | Line 50... | |||
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> |
|
Line -... | Line 54... | |||
- | 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"> |
|
52 | <div id="trumbowyg" style="height: 334px; display: none; font-family: monospace;"> |
67 | <div id="trumbowyg" style="height: 334px; display: none; font-family: monospace;"> |
|
- | 68 | </div> |
||
- | 69 | </div> |
||
Line 53... | Line 70... | |||
53 | </div> |
70 | </div> |
|
Line 54... | Line 71... | |||
54 | |
71 | |
|
55 | </div> <!-- /container --> |
72 | </div> <!-- /container --> |
|
Line 67... | Line 84... | |||
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> |
|
- | 88 | $(document).ready(() => { |
||
71 | $(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', () => { |
|
Line 80... | Line 98... | |||
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> |