scratch – Blame information for rev 125
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
91 | office | 1 | <!DOCTYPE html> |
125 | office | 2 | <html lang="en" ng-app="scratch"> |
91 | office | 3 | <head> |
4 | <meta charset="utf-8"> |
||
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" /> |
||
9 | <meta name="viewport" content="width=device-width, initial-scale=1"> |
||
10 | <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags --> |
||
11 | <meta name="description" content="quick asset upload"> |
||
12 | <meta name="author" content="Wizardry and Steamworks"> |
||
13 | <link rel="icon" href="favicon.ico"> |
||
14 | |||
15 | <title>scratch</title> |
||
16 | |||
17 | <!-- Bootstrap core CSS --> |
||
18 | <link href="bower_components/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet"> |
||
19 | <!-- Font Awesome --> |
||
20 | <link href="bower_components/font-awesome/css/font-awesome.min.css" rel="stylesheet"> |
||
21 | |||
22 | <!-- Site-wide style CCS --> |
||
23 | <link href="css/style.css" rel="stylesheet"> |
||
24 | |||
25 | <!-- Local style --> |
||
95 | office | 26 | <!-- <link href="css/link/style.css" rel="stylesheet"> --> |
125 | office | 27 | |
28 | <!-- Scratch Angular Includes --> |
||
29 | <ng-include src="'html/scratch-head-last.html'"></ng-include> |
||
91 | office | 30 | </head> |
31 | |||
32 | <body> |
||
125 | office | 33 | |
34 | <!-- Scratch Angular Includes --> |
||
35 | <ng-include src="'html/scratch-body-first.html'"></ng-include> |
||
91 | office | 36 | |
37 | <!-- Main component for a primary marketing message or call to action --> |
||
38 | <div class="paralax-background"></div> |
||
39 | <div class="jumbotron"> |
||
40 | <h1>scratch copy</h1> |
||
41 | <p class="quote">the asset sharer</p> |
||
42 | </div> |
||
43 | |||
44 | <div class="container"> |
||
45 | |||
46 | <ul class="nav nav-tabs"> |
||
115 | office | 47 | <li><a href="index.html">Home</a></li> |
91 | office | 48 | <li><a href="file.html">File</a></li> |
49 | <li><a href="text.html">Text</a></li> |
||
50 | <li><a href="draw.html">Draw</a></li> |
||
51 | <li class="active"><a href="#">Link</a></li> |
||
121 | office | 52 | <li><a href="view.html">View</a></li> |
91 | office | 53 | </ul> |
54 | |||
55 | <div id="main-panel" class="panel panel-default"> |
||
115 | office | 56 | <div class="panel-body"> |
91 | office | 57 | <form id="link-form" role="form"> |
115 | office | 58 | <div class="form-group has-feedback"> |
91 | office | 59 | <div class="input-group"> |
60 | <span class="input-group-btn"> |
||
61 | <button id="save" class="btn btn-default" type="button" data-toggle="tooltip" data-placement="auto" title="Generate link." data-disable="true" disabled> |
||
62 | <i class="glyphicon glyphicon-share"></i> |
||
63 | </button> |
||
64 | </span> |
||
65 | <input id="link" type="text" class="form-control" pattern="^https?://[\-_\.\+!\*'\(\),a-zA-Z0-9]+:?[0-9]{0,5}/.*$"> |
||
66 | </div> |
||
67 | <div class="input-group"> |
||
68 | <input id="URL" type="text" class="form-control" readonly> |
||
69 | <span class="input-group-btn"> |
||
70 | <button id="copy-url" class="btn btn-default" type="button" data-clipboard-target="#URL" data-toggle="tooltip" data-placement="auto" title="Copy to clipboard."><i class="glyphicon glyphicon-paperclip"></i></button> |
||
71 | </span> |
||
72 | </div> |
||
92 | office | 73 | <div class="input-group"> |
74 | <input id="deleteURL" type="text" class="form-control" readonly> |
||
75 | <span class="input-group-btn"> |
||
76 | <button id="delete-url" class="btn btn-default" type="button" data-clipboard-target="#deleteURL"><i class="glyphicon glyphicon-paperclip"></i></button> |
||
77 | </span> |
||
78 | </div> |
||
115 | office | 79 | </div> |
80 | </form> |
||
81 | </div> |
||
82 | </div> |
||
83 | |||
84 | </div> <!-- container --> |
||
91 | office | 85 | |
86 | <div id="footer"> |
||
87 | <div class="container"> |
||
88 | <p class="text-muted credit text-center">Copyright <i class="glyphicon glyphicon-copyright-mark"></i> 2017 <a href="http://grimore.org">Wizardry and Steamworks</a>.</p> |
||
89 | </div> |
||
90 | </div> |
||
91 | |||
92 | <!-- jQuery --> |
||
93 | <script src="bower_components/jquery/dist/jquery.min.js"></script> |
||
125 | office | 94 | <!-- Angular JS --> |
95 | <script src="bower_components/angular/angular.min.js"></script> |
||
91 | office | 96 | <!-- BootStrap --> |
97 | <script src="bower_components/bootstrap/dist/js/bootstrap.min.js"></script> |
||
98 | <!-- Bootstrap Validator --> |
||
99 | <script src="bower_components/bootstrap-validator/dist/validator.min.js"></script> |
||
100 | <!-- Clipboard --> |
||
101 | <script src="bower_components/clipboard/dist/clipboard.min.js"></script> |
||
125 | office | 102 | <!-- Angular Initialization. --> |
91 | office | 103 | <script> |
125 | office | 104 | var app = angular.module('scratch', []); |
105 | </script> |
||
106 | <script> |
||
91 | office | 107 | $(document).ready(() => { |
108 | // Attach the form validator. |
||
109 | $('#link-form').validator({ |
||
110 | focus: false, |
||
111 | delay: 1000 |
||
112 | }).on('invalid.bs.validator', () => { |
||
113 | $('#save').attr('disabled', true); |
||
114 | }).on('valid.bs.validator', () => { |
||
115 | $('#save').attr('disabled', false); |
||
116 | }); |
||
117 | |||
118 | // Save image and create URL. |
||
119 | $('#save').click(() => { |
||
120 | |||
121 | var formData = new FormData(); |
||
122 | formData.append('file', new Blob( |
||
123 | [ |
||
124 | '[InternetShortcut]' |
||
125 | .concat('\n') |
||
126 | .concat('URL=') |
||
127 | .concat($('#link') |
||
128 | .val() |
||
129 | ) |
||
130 | .concat('\n') |
||
131 | ] |
||
132 | ), |
||
133 | '.url' |
||
134 | ); |
||
135 | |||
98 | office | 136 | $.get('session.php').then((token) => { |
137 | formData.append('token', token); |
||
138 | $.ajax({ |
||
139 | url: 'file.php', |
||
140 | type: 'POST', |
||
141 | data: formData, |
||
142 | // cache: false // FF |
||
143 | processData: false, |
||
144 | contentType: false |
||
145 | }).done((data) => { |
||
146 | // Serialize JSON to object. |
||
147 | data = JSON.parse(data); |
||
91 | office | 148 | |
98 | office | 149 | $('#URL') |
150 | .val( |
||
151 | location.protocol |
||
152 | .concat("//") |
||
153 | .concat(window.location.hostname) |
||
154 | .concat("/") |
||
155 | .concat(data.hash) |
||
156 | ); |
||
92 | office | 157 | |
98 | office | 158 | $('#deleteURL') |
159 | .val( |
||
160 | location |
||
161 | .protocol.concat("//") |
||
162 | .concat(window.location.hostname) |
||
163 | .concat("/") |
||
164 | .concat(data.timestamp) |
||
165 | .concat("/") |
||
166 | .concat(data.hash) |
||
167 | ); |
||
168 | }); |
||
91 | office | 169 | }); |
170 | }); |
||
171 | |||
172 | // Enable the Clipboard button. |
||
173 | new Clipboard('#copy-url'); |
||
92 | office | 174 | new Clipboard('#delete-url'); |
91 | office | 175 | |
176 | // Scroll to the panel. |
||
177 | $('html, body').animate({ |
||
178 | scrollTop: $('#main-panel').offset().top |
||
179 | }, 'slow'); |
||
180 | }); |
||
181 | </script> |
||
182 | <!-- Jumbotron parallax effect --> |
||
183 | <script> |
||
184 | var jumboHeight = $('.jumbotron').outerHeight(); |
||
185 | function parallax(){ |
||
186 | var scrolled = $(window).scrollTop(); |
||
187 | $('.paralax-background').css('height', (jumboHeight-scrolled) + 'px'); |
||
188 | } |
||
189 | |||
190 | $(window).scroll(function(e){ |
||
191 | parallax(); |
||
192 | }); |
||
193 | </script> |
||
194 | </body> |
||
195 | </html> |