works on local, testing
This commit is contained in:
parent
58ad185e04
commit
fb67606ba7
|
@ -2,7 +2,10 @@ $(function() {
|
|||
$('#filterForm').submit(function(e) {
|
||||
e.preventDefault();
|
||||
var formData = $(this).serializeArray();
|
||||
$('#submitFilter').val("Loading...").attr("disabled", "disabled");
|
||||
$.post("files/json_list", formData, function(response) {
|
||||
$('#submitFilter').val("Submit").removeAttr("disabled");
|
||||
// MAAKICHUT = response;
|
||||
var data = JSON.parse(response);
|
||||
var files = data.files;
|
||||
// console.log(files);
|
||||
|
@ -19,13 +22,16 @@ $(function() {
|
|||
function getJQ(f) {
|
||||
var jq = $("<div />").data("data", f).addClass("fileItem").text(f.type + ": " + f.title);
|
||||
jq.click(function() {
|
||||
var d = $(this).data("data");
|
||||
var $this = $(this);
|
||||
$('.selectedItem').removeClass("selectedItem");
|
||||
$this.addClass("selectedItem");
|
||||
var d = $this.data("data");
|
||||
switch (d.type) {
|
||||
case "image":
|
||||
var html = "<img src='" + d.url + "' />";
|
||||
var html = "<img width='400' src='" + d.url + "' />";
|
||||
break;
|
||||
default:
|
||||
var html = "<a href='" + d.url + "'>Click to view</a>";
|
||||
var html = "<a href='" + d.url + "' target='_blank'>Click to view</a>";
|
||||
}
|
||||
$('#previewPane').html(html);
|
||||
});
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<form id="filterForm">
|
||||
{{ filterForm.as_p }}
|
||||
<p>
|
||||
<input type="submit" value="Submit" />
|
||||
<input type="submit" value="Submit" id="submitFilter" />
|
||||
</p>
|
||||
</form>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue
Block a user