corrade-nucleus-nucleons – Diff between revs 23 and 24
?pathlinks?
Rev 23 | Rev 24 | |||
---|---|---|---|---|
Line 33... | Line 33... | |||
33 | |
33 | |
|
34 | <div class="modal-content"> |
34 | <div class="modal-content"> |
|
35 | <div class="modal-header"> |
35 | <div class="modal-header"> |
|
Line 36... | Line 36... | |||
36 | <button type="button" class="close" data-dismiss="modal">×</button> |
36 | <button type="button" class="close" data-dismiss="modal">×</button> |
|
37 | |
37 | |
|
Line 38... | Line 38... | |||
38 | <h1 id="title" class="modal-title"></h1> |
38 | <h1 class="modal-title">Item Information</h1> |
|
39 | </div> |
39 | </div> |
|
40 | |
40 | |
|
41 | <div id="content" class="modal-body"> |
41 | <div id="item-info-content" class="modal-body"> |
|
42 | <table id="info" data-height="460"> |
42 | <table id="info" data-height="460"> |
|
43 | <thead> |
43 | <thead> |
|
Line 65... | Line 65... | |||
65 | |
65 | |
|
66 | <div class="modal-content"> |
66 | <div class="modal-content"> |
|
67 | <div class="modal-header"> |
67 | <div class="modal-header"> |
|
Line 68... | Line 68... | |||
68 | <button type="button" class="close" data-dismiss="modal">×</button> |
68 | <button type="button" class="close" data-dismiss="modal">×</button> |
|
69 | |
69 | |
|
Line 70... | Line 70... | |||
70 | <h1 id="title" class="modal-title">Avatar Selection</h1> |
70 | <h1 class="modal-title">Avatar Selection</h1> |
|
71 | </div> |
71 | </div> |
|
72 | |
72 | |
|
73 | <form id="avatar-select-form" class="form-inline" data-toggle="validator" onSubmit="event.preventDefault();"> |
73 | <form id="avatar-select-form" class="form-inline" data-toggle="validator" onSubmit="event.preventDefault();"> |
|
74 | <div id="content" class="modal-body"> |
74 | <div id="avatar-select-content" class="modal-body"> |
|
75 | <p>Please enter the avatar firstname and lastname to send the script to.</p> |
75 | <p>Please enter the avatar firstname and lastname to send the script to.</p> |
|
76 | <div class="form-group has-feedback"> |
76 | <div class="form-group has-feedback"> |
|
77 | <label for="avatar-firstname">First Name</label> |
77 | <label for="avatar-firstname">First Name</label> |
|
78 | <input id="avatar-firstname" type="text" class="form-control" aria-describedby="basic-addon1" required> |
78 | <input id="avatar-firstname" type="text" class="form-control" aria-describedby="basic-addon1" required> |
|
79 | <label for="avatar-lastname">Last Name</label> |
79 | <label for="avatar-lastname">Last Name</label> |
|
80 | <input id="avatar-lastname" type="text" class="form-control" aria-describedby="basic-addon1" required> |
80 | <input id="avatar-lastname" type="text" class="form-control" aria-describedby="basic-addon1" required> |
|
81 | </div> |
81 | </div> |
|
82 | </div> |
82 | </div> |
|
83 | <div class="modal-footer"> |
83 | <div class="modal-footer"> |
|
84 | <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> |
84 | <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> |
|
85 | <button id="send-script" type="submit" class="btn btn-primary">Confirm</button> |
85 | <button id="send-item" type="button" class="btn btn-primary">Confirm</button> |
|
86 | </div> |
86 | </div> |
|
87 | </form> |
87 | </form> |
|
Line 88... | Line 88... | |||
88 | </div> |
88 | </div> |
|
89 | </div> |
89 | </div> |
|
90 | </div> |
90 | </div> |
|
91 | |
91 | |
|
Line 92... | Line 92... | |||
92 | <!-- Texture Download Dialog --> |
92 | <!-- Inventory Item Download Dialog --> |
|
93 | <div id="texture-download-modal" class="modal fade bs-example-modal-lg" role="dialog"> |
93 | <div id="item-download-modal" class="modal fade bs-example-modal-lg" role="dialog"> |
|
94 | <div class="modal-dialog modal-lg"> |
94 | <div class="modal-dialog modal-lg"> |
|
Line 95... | Line 95... | |||
95 | <!-- Modal content--> |
95 | <!-- Modal content--> |
|
96 | |
96 | |
|
Line 97... | Line 97... | |||
97 | <div class="modal-content"> |
97 | <div class="modal-content"> |
|
98 | <div class="modal-header"> |
98 | <div class="modal-header"> |
|
99 | <button type="button" class="close" data-dismiss="modal">×</button> |
99 | <button type="button" class="close" data-dismiss="modal">×</button> |
|
Line 100... | Line 100... | |||
100 | |
100 | |
|
101 | <h1 id="title" class="modal-title">Avatar Selection</h1> |
101 | <h1 class="modal-title">Download</h1> |
|
102 | </div> |
102 | </div> |
|
Line 133... | Line 133... | |||
133 | <!-- Bootstrap Javascript --> |
133 | <!-- Bootstrap Javascript --> |
|
134 | <script src="/node_modules/bootstrap/dist/js/bootstrap.min.js" type="text/javascript"></script> |
134 | <script src="/node_modules/bootstrap/dist/js/bootstrap.min.js" type="text/javascript"></script> |
|
135 | <script src="/pack-rat/node_modules/bootstrap-table/dist/bootstrap-table.min.js" type="text/javascript"></script> |
135 | <script src="/pack-rat/node_modules/bootstrap-table/dist/bootstrap-table.min.js" type="text/javascript"></script> |
|
136 | <!-- Bootstrap Form Validator --> |
136 | <!-- Bootstrap Form Validator --> |
|
137 | <script src="/node_modules/bootstrap-validator/dist/validator.min.js" type="text/javascript"></script> |
137 | <script src="/node_modules/bootstrap-validator/dist/validator.min.js" type="text/javascript"></script> |
|
- | 138 | <!-- Forge --> |
||
- | 139 | <script src="/node_modules/node-forge/dist/forge.all.min.js" type="text/javascript"></script> |
||
138 | <!-- Moment JS --> |
140 | <!-- Moment JS --> |
|
139 | <script src="/pack-rat/node_modules/moment/min/moment.min.js" type="text/javascript"></script> |
141 | <script src="/pack-rat/node_modules/moment/min/moment.min.js" type="text/javascript"></script> |
|
140 | <!-- JsTree --> |
142 | <!-- JsTree --> |
|
141 | <script src="/pack-rat/node_modules/jstree/dist/jstree.min.js" type="text/javascript"></script> |
143 | <script src="/pack-rat/node_modules/jstree/dist/jstree.min.js" type="text/javascript"></script> |
|
142 | <!-- JSON to Table --> |
144 | <!-- JSON to Table --> |
|
Line 190... | Line 192... | |||
190 | giveItem: { |
192 | giveItem: { |
|
191 | label: "Give", |
193 | label: "Give", |
|
192 | action: function(obj) { |
194 | action: function(obj) { |
|
193 | $('#avatar-select-modal') |
195 | $('#avatar-select-modal') |
|
194 | .modal('show') |
196 | .modal('show') |
|
195 | .on('click', '#send-script', function(e) { |
197 | .on('click', '#send-item', function(e) { |
|
196 | $('#avatar-select-modal').modal('hide'); |
198 | $('#avatar-select-modal').modal('hide').unbind('click'); |
|
197 | $.ajax({ |
199 | $.ajax({ |
|
198 | type: 'POST', |
200 | type: 'POST', |
|
199 | url: '/', |
201 | url: '/', |
|
200 | data: { |
202 | data: { |
|
201 | command: 'give', |
203 | command: 'give', |
|
Line 221... | Line 223... | |||
221 | if (node.data.type == "texture" || node.data.type == "snapshot") { |
223 | if (node.data.type == "texture" || node.data.type == "snapshot") { |
|
222 | $.extend(items, { |
224 | $.extend(items, { |
|
223 | downloadItem: { |
225 | downloadItem: { |
|
224 | label: "Download", |
226 | label: "Download", |
|
225 | "action": function(obj) { |
227 | "action": function(obj) { |
|
- | 228 | $("<img id='item-download-texture' width='100%' height='100%'>") |
||
226 | $('#texture').attr('src', '/pack-rat/img/loader.gif'); |
229 | .attr('src', '/pack-rat/img/loader.svg') |
|
- | 230 | .appendTo('#item-download-content'); |
||
227 | $('#texture-download-modal').modal('show'); |
231 | $('#item-download-modal') |
|
- | 232 | .modal('show') |
||
- | 233 | .on('hidden.bs.modal', function (e) { |
||
- | 234 | $('#item-download-texture') |
||
- | 235 | .html(''); |
||
- | 236 | }); |
||
228 | $.ajax({ |
237 | $.ajax({ |
|
229 | type: 'POST', |
238 | type: 'POST', |
|
230 | url: '/', |
239 | url: '/', |
|
231 | data: { |
240 | data: { |
|
232 | command: 'download', |
241 | command: 'download', |
|
Line 234... | Line 243... | |||
234 | format: 'Png', |
243 | format: 'Png', |
|
235 | type: 'Texture' |
244 | type: 'Texture' |
|
236 | }, |
245 | }, |
|
237 | dataType: 'json' |
246 | dataType: 'json' |
|
238 | }).done(function(response) { |
247 | }).done(function(response) { |
|
- | 248 | // Create the image tag and set the content. |
||
- | 249 | $("#item-download-texture") |
||
239 | $('#texture').attr('src', "data:image/png;base64," + response.data); |
250 | .attr('src', "data:image/png;base64," + response.data); |
|
240 | }); |
251 | }); |
|
241 | } |
252 | } |
|
242 | } |
253 | } |
|
243 | }); |
254 | }); |
|
244 | } |
255 | } |
|
Line 247... | Line 258... | |||
247 | if (node.data.type == "notecard") { |
258 | if (node.data.type == "notecard") { |
|
248 | $.extend(items, { |
259 | $.extend(items, { |
|
249 | downloadItem: { |
260 | downloadItem: { |
|
250 | label: "Download", |
261 | label: "Download", |
|
251 | "action": function(obj) { |
262 | "action": function(obj) { |
|
252 | $('#texture').attr('src', 'images/loader.gif'); |
263 | $("<img id='item-download-texture' width='100%' height='100%'>") |
|
253 | $('#popup').dialog({ |
264 | .attr('src', '/pack-rat/img/loader.svg') |
|
254 | width: 800, |
265 | .appendTo('#item-download-content'); |
|
255 | height: 600, |
266 | $('#item-download-modal') |
|
256 | modal: true, |
267 | .modal('show') |
|
257 | resizable: false, |
- | ||
258 | dialogClass: 'no-close texture-dialog' |
268 | .on('hidden.bs.modal', function (e) { |
|
259 | }).on('dialogclose', function(event) { |
269 | $('#item-download-content') |
|
260 | $('#content').html(''); |
270 | .html(''); |
|
261 | }); |
271 | }); |
|
262 | $.ajax({ |
272 | $.ajax({ |
|
263 | type: 'POST', |
273 | type: 'POST', |
|
264 | url: "downloadNotecard.php?t=" + Math.random(), |
274 | url: '/', |
|
265 | data: { |
275 | data: { |
|
- | 276 | command: 'download', |
||
266 | uuid: node.id.split(/[\/]+/).pop() |
277 | item: node.id, |
|
- | 278 | type: 'Notecard' |
||
267 | } |
279 | }, |
|
- | 280 | dataType: 'json' |
||
268 | }).done(function(data) { |
281 | }).done(function(response) { |
|
- | 282 | // Remove loader texture. |
||
- | 283 | $("#item-download-texture") |
||
- | 284 | .html(''); |
||
- | 285 | |
||
- | 286 | // Decode notecard and display it. |
||
- | 287 | $('#item-download-content').html( |
||
- | 288 | '<pre>' + |
||
269 | $.base64.utf8decode = true; |
289 | forge.util.decodeUtf8( |
|
270 | $('#content').html('<pre>' + $.base64.atob(data) + '</pre>'); |
290 | forge.util.decode64(response.data) |
|
- | 291 | ) + |
||
- | 292 | '</pre>' |
||
- | 293 | ); |
||
271 | }); |
294 | }); |
|
272 | } |
295 | } |
|
273 | } |
296 | } |
|
274 | }); |
297 | }); |
|
275 | } |
298 | } |
|
Line 278... | Line 301... | |||
278 | if (node.data.type == "sound") { |
301 | if (node.data.type == "sound") { |
|
279 | $.extend(items, { |
302 | $.extend(items, { |
|
280 | downloadItem: { |
303 | downloadItem: { |
|
281 | label: "Download", |
304 | label: "Download", |
|
282 | "action": function(obj) { |
305 | "action": function(obj) { |
|
283 | $('#texture').attr('src', 'images/loader.gif'); |
306 | $("<img id='item-download-texture' width='100%' height='100%'>") |
|
284 | $('#popup').dialog({ |
307 | .attr('src', '/pack-rat/img/loader.svg') |
|
285 | width: 800, |
308 | .appendTo('#item-download-content'); |
|
286 | height: 600, |
309 | $('#item-download-modal') |
|
287 | modal: true, |
310 | .modal('show') |
|
288 | resizable: false, |
- | ||
289 | dialogClass: 'no-close texture-dialog' |
311 | .on('hidden.bs.modal', function (e) { |
|
290 | }).on('dialogclose', function(event) { |
312 | $('#item-download-content') |
|
291 | $('#content').html(''); |
313 | .html(''); |
|
292 | }); |
314 | }); |
|
293 | $.ajax({ |
315 | $.ajax({ |
|
294 | type: 'POST', |
316 | type: 'POST', |
|
295 | url: "downloadSound.php?t=" + Math.random(), |
317 | url: '/', |
|
296 | data: { |
318 | data: { |
|
- | 319 | command: 'download', |
||
297 | uuid: node.id.split(/[\/]+/).pop() |
320 | item: node.id, |
|
- | 321 | type: 'Sound', |
||
- | 322 | format: 'wav' |
||
298 | } |
323 | }, |
|
- | 324 | dataType: 'json' |
||
299 | }).done(function(data) { |
325 | }).done(function(response) { |
|
- | 326 | // Remove loader texture. |
||
- | 327 | $("#item-download-texture") |
||
- | 328 | .html(''); |
||
- | 329 | |
||
- | 330 | // Create HTML5 audio tags and load the data. |
||
300 | $('#content').html('<audio controls="controls"><source id="source" src="" type="audio/mp3"></source></audio>'); |
331 | $('#item-download-content').html("<audio controls='controls'><source id='item-download-audio-source' src='' type='audio/wav'></source></audio>"); |
|
301 | $('#source').attr('src', "data:audio/mp3;base64," + data); |
332 | $('#item-download-audio-source').attr('src', 'data:audio/mp3;base64,' + response.data); |
|
302 | }); |
333 | }); |
|
303 | } |
334 | } |
|
304 | } |
335 | } |
|
305 | }); |
336 | }); |
|
306 | } |
337 | } |