corrade-nucleus-nucleons

Subversion Repositories:
Compare Path: Rev
With Path: Rev
?path1? @ 23  →  ?path2? @ 24
/pack-rat/003_pack_rat/pack-rat/index.html/index.html
@@ -35,10 +35,10 @@
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
 
<h1 id="title" class="modal-title"></h1>
<h1 class="modal-title">Item Information</h1>
</div>
 
<div id="content" class="modal-body">
<div id="item-info-content" class="modal-body">
<table id="info" data-height="460">
<thead>
<tr>
@@ -67,11 +67,11 @@
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
 
<h1 id="title" class="modal-title">Avatar Selection</h1>
<h1 class="modal-title">Avatar Selection</h1>
</div>
 
<form id="avatar-select-form" class="form-inline" data-toggle="validator" onSubmit="event.preventDefault();">
<div id="content" class="modal-body">
<div id="avatar-select-content" class="modal-body">
<p>Please enter the avatar firstname and lastname to send the script to.</p>
<div class="form-group has-feedback">
<label for="avatar-firstname">First Name</label>
@@ -82,7 +82,7 @@
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button id="send-script" type="submit" class="btn btn-primary">Confirm</button>
<button id="send-item" type="button" class="btn btn-primary">Confirm</button>
</div>
</form>
</div>
@@ -89,8 +89,8 @@
</div>
</div>
<!-- Texture Download Dialog -->
<div id="texture-download-modal" class="modal fade bs-example-modal-lg" role="dialog">
<!-- Inventory Item Download Dialog -->
<div id="item-download-modal" class="modal fade bs-example-modal-lg" role="dialog">
<div class="modal-dialog modal-lg">
<!-- Modal content-->
 
@@ -98,11 +98,11 @@
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
 
<h1 id="title" class="modal-title">Avatar Selection</h1>
<h1 class="modal-title">Download</h1>
</div>
<div id="content" class="modal-body">
<img src="" align="middle" id="texture">
<div id="item-download-content" class="modal-body">
<!-- <img width="100%" height="100%" src="" align="middle" id="texture"> -->
</div>
<div class="modal-footer">
@@ -135,6 +135,8 @@
<script src="/pack-rat/node_modules/bootstrap-table/dist/bootstrap-table.min.js" type="text/javascript"></script>
<!-- Bootstrap Form Validator -->
<script src="/node_modules/bootstrap-validator/dist/validator.min.js" type="text/javascript"></script>
<!-- Forge -->
<script src="/node_modules/node-forge/dist/forge.all.min.js" type="text/javascript"></script>
<!-- Moment JS -->
<script src="/pack-rat/node_modules/moment/min/moment.min.js" type="text/javascript"></script>
<!-- JsTree -->
@@ -192,8 +194,8 @@
action: function(obj) {
$('#avatar-select-modal')
.modal('show')
.on('click', '#send-script', function(e) {
$('#avatar-select-modal').modal('hide');
.on('click', '#send-item', function(e) {
$('#avatar-select-modal').modal('hide').unbind('click');
$.ajax({
type: 'POST',
url: '/',
@@ -223,8 +225,15 @@
downloadItem: {
label: "Download",
"action": function(obj) {
$('#texture').attr('src', '/pack-rat/img/loader.gif');
$('#texture-download-modal').modal('show');
$("<img id='item-download-texture' width='100%' height='100%'>")
.attr('src', '/pack-rat/img/loader.svg')
.appendTo('#item-download-content');
$('#item-download-modal')
.modal('show')
.on('hidden.bs.modal', function (e) {
$('#item-download-texture')
.html('');
});
$.ajax({
type: 'POST',
url: '/',
@@ -236,7 +245,9 @@
},
dataType: 'json'
}).done(function(response) {
$('#texture').attr('src', "data:image/png;base64," + response.data);
// Create the image tag and set the content.
$("#item-download-texture")
.attr('src', "data:image/png;base64," + response.data);
});
}
}
@@ -249,25 +260,37 @@
downloadItem: {
label: "Download",
"action": function(obj) {
$('#texture').attr('src', 'images/loader.gif');
$('#popup').dialog({
width: 800,
height: 600,
modal: true,
resizable: false,
dialogClass: 'no-close texture-dialog'
}).on('dialogclose', function(event) {
$('#content').html('');
});
$("<img id='item-download-texture' width='100%' height='100%'>")
.attr('src', '/pack-rat/img/loader.svg')
.appendTo('#item-download-content');
$('#item-download-modal')
.modal('show')
.on('hidden.bs.modal', function (e) {
$('#item-download-content')
.html('');
});
$.ajax({
type: 'POST',
url: "downloadNotecard.php?t=" + Math.random(),
url: '/',
data: {
uuid: node.id.split(/[\/]+/).pop()
}
}).done(function(data) {
$.base64.utf8decode = true;
$('#content').html('<pre>' + $.base64.atob(data) + '</pre>');
command: 'download',
item: node.id,
type: 'Notecard'
},
dataType: 'json'
}).done(function(response) {
// Remove loader texture.
$("#item-download-texture")
.html('');
// Decode notecard and display it.
$('#item-download-content').html(
'<pre>' +
forge.util.decodeUtf8(
forge.util.decode64(response.data)
) +
'</pre>'
);
});
}
}
@@ -280,25 +303,33 @@
downloadItem: {
label: "Download",
"action": function(obj) {
$('#texture').attr('src', 'images/loader.gif');
$('#popup').dialog({
width: 800,
height: 600,
modal: true,
resizable: false,
dialogClass: 'no-close texture-dialog'
}).on('dialogclose', function(event) {
$('#content').html('');
});
$("<img id='item-download-texture' width='100%' height='100%'>")
.attr('src', '/pack-rat/img/loader.svg')
.appendTo('#item-download-content');
$('#item-download-modal')
.modal('show')
.on('hidden.bs.modal', function (e) {
$('#item-download-content')
.html('');
});
$.ajax({
type: 'POST',
url: "downloadSound.php?t=" + Math.random(),
url: '/',
data: {
uuid: node.id.split(/[\/]+/).pop()
}
}).done(function(data) {
$('#content').html('<audio controls="controls"><source id="source" src="" type="audio/mp3"></source></audio>');
$('#source').attr('src', "data:audio/mp3;base64," + data);
command: 'download',
item: node.id,
type: 'Sound',
format: 'wav'
},
dataType: 'json'
}).done(function(response) {
// Remove loader texture.
$("#item-download-texture")
.html('');
// Create HTML5 audio tags and load the data.
$('#item-download-content').html("<audio controls='controls'><source id='item-download-audio-source' src='' type='audio/wav'></source></audio>");
$('#item-download-audio-source').attr('src', 'data:audio/mp3;base64,' + response.data);
});
}
}