scratch – Blame information for rev 31

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">
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 -->
8 <meta name="description" content="quick asset upload">
9 <meta name="author" content="Wizardry and Steamworks">
10 <link rel="icon" href="favicon.ico">
11  
12 <title>Quickload</title>
31 office 13  
14 <!-- Polyfill -->
15 <!-- <script src="js/polyfill/polyfill.min.js"></script> -->
25 office 16  
17 <!-- Bootstrap core CSS -->
18 <link href="css/bootstrap/bootstrap.min.css" rel="stylesheet">
19  
20 <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
21 <link href="css/bootstrap/ie10-viewport-bug-workaround.css" rel="stylesheet">
22  
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]-->
25 <script src="js/bootstrap/ie-emulation-modes-warning.js"></script>
26  
27 <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
28 <!--[if lt IE 9]>
29 <script src="js/bootstrap/html5shiv.min.js"></script>
30 <script src="js/bootstrap/respond.min.js"></script>
31 <![endif]-->
32  
33 <!-- Trumbowyg -->
34 <link href="css/trumbowyg/trumbowyg.min.css" rel="stylesheet">
35 <!-- Local style -->
36 <!-- <link href="css/style.css" rel="stylesheet"> -->
37 </head>
38  
39 <body>
40  
41 <div class="container">
42  
43 <!-- Main component for a primary marketing message or call to action -->
44 <div class="jumbotron">
45 <h1>Quickload</h1>
46 <p>Asset sharing platform.</p>
47 </div>
48  
49 <ul class="nav nav-tabs">
50 <li><a href="index.html">Home</a></li>
51 <li><a href="files.html">Files</a></li>
52 <li class="active"><a href="#">Text</a></li>
53 </ul>
54  
31 office 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>
66 <div class="panel-body" id="uploadpanel">
67 <div id="trumbowyg" style="height: 334px; display: none; font-family: monospace;">
68 </div>
69 </div>
25 office 70 </div>
71  
72 </div> <!-- /container -->
73  
74 <div id="footer">
75 <div class="container">
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>
77 </div>
78 </div>
79  
80 <script src="js/jquery/jquery.min.js"></script>
81 <script src="js/bootstrap/bootstrap.min.js"></script>
82 <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
83 <script src="js/bootstrap/ie10-viewport-bug-workaround.js"></script>
84  
85 <!-- Trumbowyg -->
86 <script src="js/trumbowyg/trumbowyg.min.js"></script>
87 <script>
88 $(document).ready(() => {
31 office 89 // Load the editor.
25 office 90 $('#trumbowyg').trumbowyg({
29 office 91 autogrow: true,
92 disabled: true
93 }).on('tbwchange', () => {
94 $('#editor').trumbowyg('disable');
95 $.post('share-text.php', {
96 data: $('#trumbowyg').trumbowyg('html'),
97 }).done((data) => {
98 $('#trumbowyg').trumbowyg('enable');
99 }).fail(() => {
100 $('#trumbowyg').trumbowyg('enable');
25 office 101 });
102 });
31 office 103  
104 // Retrieve the contents of the shared file.
29 office 105 $.get('share-text.php').done((data) => {
106 $('#trumbowyg')
107 .trumbowyg('html', data);
108 $('#trumbowyg').trumbowyg('enable');
30 office 109 $('#trumbowyg').show();
29 office 110 }).fail(() => {
111 $('#trumbowyg').trumbowyg('enable');
30 office 112 $('#trumbowyg').show();
29 office 113 });
31 office 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 });
25 office 142 });
143 </script>
144 </body>
145 </html>