|
@@ -11,13 +11,13 @@ $('.nav-data').click( function(e) {
|
|
|
name = current_nav.trim();
|
|
|
id = name.replace ( /[^\d.]/g, '' );
|
|
|
index = id;
|
|
|
- //<img id="img-preview" width="100%" src="img?id={{ index }}&name={{ name }}&type=preview&counter=0"/>
|
|
|
+ // Stop large processes
|
|
|
stopFlag = true;
|
|
|
- $("#img-preview").attr("src", "img?id="+id+"&name="+name+"&type=preview&counter=0");
|
|
|
- //stopFlag = true;
|
|
|
-
|
|
|
-
|
|
|
|
|
|
+ // Update Preview Image
|
|
|
+ $("#img-preview").attr("src", "img?id="+id+"&name="+name+"&type=preview&counter=0");
|
|
|
+
|
|
|
+ // Hide other nav bars
|
|
|
$('.nav-data').each(function(index) {
|
|
|
id = "#nav"+$(this).text().replace ( /[^\d.]/g, '' );
|
|
|
if ($(this).text() != current_nav) {
|
|
@@ -36,54 +36,74 @@ $('.nav-data').click( function(e) {
|
|
|
console.log("Success.");
|
|
|
console.log(response);
|
|
|
$("td#size"+response.index).text(response.data_size + " GB");
|
|
|
- /*
|
|
|
- $("#size").text("("+response.data_size+" GB)");
|
|
|
|
|
|
- var html = "<span>Description</span>";
|
|
|
- for (i = 0; i < response["desc"].length; i++) {
|
|
|
- if (response["desc"][i]["type"] == "i") {
|
|
|
- tmp = "<i>" + response["desc"][i]["text"] + "</i>";
|
|
|
- } else if (response["desc"][i]["type"] == "p") {
|
|
|
- tmp = response["desc"][i]["text"];
|
|
|
- }
|
|
|
- html += tmp;
|
|
|
+ var html = "";
|
|
|
+ for (i = 0; i < response["desc"].length; i++) {
|
|
|
+ if (response["desc"][i]["type"] == "i") {
|
|
|
+ tmp = "<i>" + response["desc"][i]["text"] + "</i>";
|
|
|
+ } else if (response["desc"][i]["type"] == "p") {
|
|
|
+ tmp = response["desc"][i]["text"];
|
|
|
}
|
|
|
- $("#description").empty().append(html);
|
|
|
+ html += tmp;
|
|
|
+ }
|
|
|
+ $("td#desc"+response.index).empty().append(html);
|
|
|
+
|
|
|
+
|
|
|
+ $("#front-count-text").text(" (max: " + response.front_count + ")");
|
|
|
+ $("#left-count-text").text(" (max: " + response.left_count + ")");
|
|
|
+ $("#top-count-text").text(" (max: " + response.top_count + ")");
|
|
|
+ $("#front-count").text(response.front_count);
|
|
|
+ $("#left-count").text(response.left_count);
|
|
|
+ $("#top-count").text(response.top_count);
|
|
|
+ $("#slider-right").slider("option", "max" , response.front_count );
|
|
|
+ $("#slider-left").slider("option", "max" , response.top_count );
|
|
|
+ $("#slider-center").slider("option", "max" , response.left_count );
|
|
|
+
|
|
|
+ var left_index = $( "#slider-left" ).slider( "option", "value" );
|
|
|
+ var top_index = $( "#slider-center" ).slider( "option", "value" );
|
|
|
+ var front_index = $( "#slider-right" ).slider( "option", "value" );
|
|
|
+ // update images
|
|
|
+ $("#placeholder-left").attr("src", "img?id="+index+"&name="+name+"&type=left-resized&counter="+(left_index-1));
|
|
|
+ $("#img-top").attr("src", "img?id="+index+"&name="+name+"&type=top-resized&counter="+(top_index-1));
|
|
|
+ $("#img-front").attr("src", "img?id="+index+"&name="+name+"&type=front-resized&counter="+(front_index-1));
|
|
|
+
|
|
|
+ var imageUrlLeft = "img?id="+index+"&name="+name+"&type=left&counter="+(left_index-1);
|
|
|
+ var imageUrlTop ="img?id="+index+"&name="+name+"&type=top&counter="+(top_index-1);
|
|
|
+ var imageUrlFront = "img?id="+index+"&name="+name+"&type=front&counter="+(front_index-1);
|
|
|
+ $("#placeholder-left-zoomContainer > .zoomWindowContainer > div").css('background-image', 'url("' + imageUrlLeft + '")');
|
|
|
+ $("#img-top-zoomContainer > .zoomWindowContainer > div").css('background-image', 'url("' + imageUrlTop + '")');
|
|
|
+ $("#img-front-zoomContainer > .zoomWindowContainer > div").css('background-image', 'url("' + imageUrlFront + '")');
|
|
|
+
|
|
|
+ $("#front-quality-text").text("Magnification: " + ($("#img-front").width() / parseInt($("#front-count").text())).toFixed(2).toString());
|
|
|
+ $("#top-quality-text").text("Magnification: " + ($("#img-top").height() / parseInt($("#top-count").text())).toFixed(2).toString());
|
|
|
+ $("#left-quality-text").text("Magnification: " + ($("#placeholder-left").height() / parseInt($("#left-count").text())).toFixed(2).toString());
|
|
|
+
|
|
|
+ if (index in imgTopArray) {
|
|
|
+ cur_value = parseInt( (imgTopArray[index].length/parseFloat(response.left_count))*100.0);
|
|
|
+ //console.log(imgTopArray[index].length, response.top_count, response.left_count, response.front_count);
|
|
|
+ $('#progress-top').css('width', cur_value+'%').attr('aria-valuenow', cur_value);
|
|
|
+ } else {
|
|
|
+ $('#progress-top').css('width', '0%').attr('aria-valuenow', 0);
|
|
|
+ }
|
|
|
|
|
|
- $("#front-count-text").text(" (max: " + response.front_count + ")");
|
|
|
- $("#left-count-text").text(" (max: " + response.left_count + ")");
|
|
|
- $("#top-count-text").text(" (max: " + response.top_count + ")");
|
|
|
- $("#front-count").text(response.front_count);
|
|
|
- $("#left-count").text(response.left_count);
|
|
|
- $("#top-count").text(response.top_count);
|
|
|
- $("#slider-right").slider("option", "max" , response.front_count );
|
|
|
- $("#slider-left").slider("option", "max" , response.left_count );
|
|
|
- $("#slider-center").slider("option", "max" , response.top_count );
|
|
|
-
|
|
|
- var left_index = $( "#slider-left" ).slider( "option", "value" );
|
|
|
- var top_index = $( "#slider-center" ).slider( "option", "value" );
|
|
|
- var front_index = $( "#slider-right" ).slider( "option", "value" );
|
|
|
- // update images
|
|
|
- $("#placeholder-left").attr("src", "img?id="+index+"&name="+name+"&type=left-resized&counter="+(left_index-1));
|
|
|
- $("#img-top").attr("src", "img?id="+index+"&name="+name+"&type=top-resized&counter="+(top_index-1));
|
|
|
- $("#img-front").attr("src", "img?id="+index+"&name="+name+"&type=front-resized&counter="+(front_index-1));
|
|
|
-
|
|
|
- var imageUrlLeft = "img?id="+index+"&name="+name+"&type=left&counter="+(left_index-1);
|
|
|
- var imageUrlTop ="img?id="+index+"&name="+name+"&type=top&counter="+(top_index-1);
|
|
|
- var imageUrlFront = "img?id="+index+"&name="+name+"&type=front&counter="+(front_index-1);
|
|
|
- $("#placeholder-left-zoomContainer > .zoomWindowContainer > div").css('background-image', 'url("' + imageUrlLeft + '")');
|
|
|
- $("#img-top-zoomContainer > .zoomWindowContainer > div").css('background-image', 'url("' + imageUrlTop + '")');
|
|
|
- $("#img-front-zoomContainer > .zoomWindowContainer > div").css('background-image', 'url("' + imageUrlFront + '")');
|
|
|
-
|
|
|
- $("#front-quality-text").text("Magnification: " + ($("#img-front").width() / parseInt($("#front-count").text())).toFixed(2).toString());
|
|
|
- $("#top-quality-text").text("Magnification: " + ($("#img-top").height() / parseInt($("#top-count").text())).toFixed(2).toString());
|
|
|
- $("#left-quality-text").text("Magnification: " + ($("#placeholder-left").height() / parseInt($("#left-count").text())).toFixed(2).toString());
|
|
|
- */
|
|
|
- },
|
|
|
- error: function () {
|
|
|
- console.log("Error.")
|
|
|
+ if (index in imgLeftArray) {
|
|
|
+ cur_value = parseInt( (imgLeftArray[index].length/parseFloat(response.top_count))*100.0);
|
|
|
+ $('#progress-left').css('width', cur_value+'%').attr('aria-valuenow', cur_value);
|
|
|
+ } else {
|
|
|
+ $('#progress-left').css('width', '0%').attr('aria-valuenow', 0);
|
|
|
}
|
|
|
- });
|
|
|
+
|
|
|
+ if (index in imgFrontArray) {
|
|
|
+ cur_value = parseInt( (imgFrontArray[index].length/parseFloat(response.front_count))*100.0);
|
|
|
+ $('#progress-front').css('width', cur_value+'%').attr('aria-valuenow', cur_value);
|
|
|
+ } else {
|
|
|
+ $('#progress-front').css('width', '0%').attr('aria-valuenow', 0);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error: function () {
|
|
|
+ console.log("Error.")
|
|
|
+ }
|
|
|
+ });
|
|
|
|
|
|
});
|
|
|
|
|
@@ -213,42 +233,67 @@ function IsImageOk(img) {
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
-var imgTopArray = [];
|
|
|
-var imgFrontArray = [];
|
|
|
-var imgLeftArray = [];
|
|
|
+var imgTopArray = {};
|
|
|
+var imgFrontArray = {};
|
|
|
+var imgLeftArray = {};
|
|
|
|
|
|
$(function() {
|
|
|
-
|
|
|
-
|
|
|
$(window).resize(function() {
|
|
|
$("#front-quality-text").text("Magnification: " + ($("#img-front").width() / parseInt($("#front-count").text())).toFixed(2).toString() + "%");
|
|
|
$("#top-quality-text").text("Magnification: " + ($("#img-top").height() / parseInt($("#top-count").text())).toFixed(2).toString() + "%");
|
|
|
$("#left-quality-text").text("Magnification: " + ($("#placeholder-left").height() / parseInt($("#left-count").text())).toFixed(2).toString() + "%");
|
|
|
});
|
|
|
-
|
|
|
|
|
|
- var name;
|
|
|
- var id;
|
|
|
$( "#slider-left" ).slider({
|
|
|
range: "max",
|
|
|
min: 1,
|
|
|
max: parseInt($("#left-count").text()),
|
|
|
//max: 1500,
|
|
|
value: 1,
|
|
|
+ start: function(event, ui) {
|
|
|
+ //if (leftFlag == false) {
|
|
|
+ // leftFlag = true;
|
|
|
+ //processLargeLeftArray( parseInt( $("#left-count").text()) );
|
|
|
+ //}
|
|
|
+ },
|
|
|
stop: function(event, ui) {
|
|
|
$("#placeholder-left").attr("src", "img?id="+id+"&name="+name+"&type=left&counter="+(ui.value-1));
|
|
|
+ imageUrl = "img?id="+id+"&name="+name+"&type=left&counter="+(ui.value-1);
|
|
|
+ var zoomConfig = {
|
|
|
+ zoomWindowPosition: "abcd",
|
|
|
+ zoomWindowHeight: "100%",
|
|
|
+ zoomWindowWidth: "33.3%",
|
|
|
+ borderSize: 0,
|
|
|
+ easing:true,
|
|
|
+ onShow: function () {
|
|
|
+ $("#sidebar" ).css("opacity", "0");
|
|
|
+ },
|
|
|
+ onHide: function () {
|
|
|
+ $("#sidebar" ).css("opacity", "1");
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ var zoomImage = $('#placeholder-left');
|
|
|
+ $('.zoomContainer').remove();
|
|
|
+ zoomImage.attr('src', imageUrl);
|
|
|
+ zoomImage.data('zoom-image', imageUrl);
|
|
|
+ // Reinitialize EZ
|
|
|
+ zoomImage.ezPlus(zoomConfig);
|
|
|
},
|
|
|
slide: function( event, ui ) {
|
|
|
- name = $( "#header_title" ).text();
|
|
|
+ name = $( "#header_title" ).text().trim();
|
|
|
id = name.replace ( /[^\d.]/g, '' );
|
|
|
- if (ui.value > imgFrontArray.length) {
|
|
|
- $("#img-left-container").empty();
|
|
|
- } else {
|
|
|
- if (IsImageOk(imgLeftArray[ui.value-1]) ) {
|
|
|
- $("#img-left-container").empty().append(imgLeftArray[ui.value-1]);
|
|
|
+ if (id in imgLeftArray) {
|
|
|
+ if (IsImageOk(imgLeftArray[id][ui.value-1]) ) {
|
|
|
+ console.log("Hellow");
|
|
|
+ $("#img-left-container").empty().append(imgLeftArray[id][ui.value-1]);
|
|
|
} else {
|
|
|
- //$("#placeholder-left").attr("src", "img?id="+id+"&name="+name+"&type=left-resized&counter="+(ui.value-1));
|
|
|
+ console.log("RIP2");
|
|
|
+ $("#placeholder-left").attr("src", "img?id="+id+"&name="+name+"&type=left-resized&counter="+(ui.value-1));
|
|
|
}
|
|
|
+ } else {
|
|
|
+ console.log("RIP");
|
|
|
+ $("#placeholder-left").attr("src", "img?id="+id+"&name="+name+"&type=left-resized&counter="+(ui.value-1));
|
|
|
}
|
|
|
$("#left-text").text(ui.value);
|
|
|
}
|
|
@@ -260,22 +305,46 @@ $(function() {
|
|
|
max: parseInt($("#front-count").text()),
|
|
|
value: 1,
|
|
|
start: function(event, ui) {
|
|
|
- processLargeFrontArray( parseInt( $("#front-count").text()) );
|
|
|
+ //processLargeFrontArray( parseInt( $("#front-count").text()) );
|
|
|
},
|
|
|
stop: function(event, ui) {
|
|
|
$("#img-front").attr("src", "img?id="+id+"&name="+name+"&type=front&counter="+(ui.value-1));
|
|
|
+ imageUrl = "img?id="+id+"&name="+name+"&type=front&counter="+(ui.value-1);
|
|
|
+ var zoomConfig = {
|
|
|
+ zoomWindowPosition: "abcd",
|
|
|
+ zoomWindowHeight: "100%",
|
|
|
+ zoomWindowWidth: "33.3%",
|
|
|
+ borderSize: 0,
|
|
|
+ easing:true,
|
|
|
+ onShow: function () {
|
|
|
+ $("#sidebar" ).css("opacity", "0");
|
|
|
+ },
|
|
|
+ onHide: function () {
|
|
|
+ $("#sidebar" ).css("opacity", "1");
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ var zoomImage = $('#img-front');
|
|
|
+ $('.zoomContainer').remove();
|
|
|
+ zoomImage.attr('src', imageUrl);
|
|
|
+ zoomImage.data('zoom-image', imageUrl);
|
|
|
+ // Reinitialize EZ
|
|
|
+ zoomImage.ezPlus(zoomConfig);
|
|
|
},
|
|
|
slide: function( event, ui ) {
|
|
|
- name = $( "#header_title" ).text();
|
|
|
+ name = $( "#header_title" ).text().trim();
|
|
|
id = name.replace ( /[^\d.]/g, '' );
|
|
|
- if (ui.value > imgFrontArray.length) {
|
|
|
- $("#img-front-container").empty();
|
|
|
- } else {
|
|
|
- if (IsImageOk(imgFrontArray[ui.value-1]) ) {
|
|
|
- $("#img-front-container").empty().append(imgFrontArray[ui.value-1]);
|
|
|
+ if (id in imgFrontArray) {
|
|
|
+ if (IsImageOk(imgFrontArray[id][ui.value-1]) ) {
|
|
|
+ console.log("Hellow");
|
|
|
+ $("#img-front-container").empty().append(imgFrontArray[id][ui.value-1]);
|
|
|
} else {
|
|
|
+ console.log("RIP2");
|
|
|
$("#img-front").attr("src", "img?id="+id+"&name="+name+"&type=front-resized&counter="+(ui.value-1));
|
|
|
}
|
|
|
+ } else {
|
|
|
+ console.log("RIP");
|
|
|
+ $("#img-front").attr("src", "img?id="+id+"&name="+name+"&type=front-resized&counter="+(ui.value-1));
|
|
|
}
|
|
|
$("#front-text").text(ui.value);
|
|
|
}
|
|
@@ -287,29 +356,96 @@ $(function() {
|
|
|
max: parseInt($("#top-count").text()),
|
|
|
//max: 1500,
|
|
|
value: 1,
|
|
|
+ start: function(event, ui) {
|
|
|
+ //processLargeTopArray( parseInt( $("#top-count").text()) );
|
|
|
+ },
|
|
|
stop: function(event, ui) {
|
|
|
$("#img-top").attr("src", "img?id="+id+"&name="+name+"&type=top&counter="+(ui.value-1));
|
|
|
+ imageUrl = "img?id="+id+"&name="+name+"&type=top&counter="+(ui.value-1);
|
|
|
+ var zoomConfig = {
|
|
|
+ zoomWindowPosition: "abcd",
|
|
|
+ zoomWindowHeight: "100%",
|
|
|
+ zoomWindowWidth: "33.3%",
|
|
|
+ borderSize: 0,
|
|
|
+ easing:true,
|
|
|
+ onShow: function () {
|
|
|
+ $("#sidebar" ).css("opacity", "0");
|
|
|
+ },
|
|
|
+ onHide: function () {
|
|
|
+ $("#sidebar" ).css("opacity", "1");
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ var zoomImage = $('#img-top');
|
|
|
+ $('.zoomContainer').remove();
|
|
|
+ zoomImage.attr('src', imageUrl);
|
|
|
+ zoomImage.data('zoom-image', imageUrl);
|
|
|
+ // Reinitialize EZ
|
|
|
+ zoomImage.ezPlus(zoomConfig);
|
|
|
},
|
|
|
slide: function( event, ui ) {
|
|
|
- name = $( "#header_title" ).text();
|
|
|
+ name = $( "#header_title" ).text().trim();
|
|
|
id = name.replace ( /[^\d.]/g, '' );
|
|
|
- if (ui.value > imgTopArray.length) {
|
|
|
- $("#img-top-container").empty();
|
|
|
- } else {
|
|
|
- if (IsImageOk(imgTopArray[ui.value-1]) ) {
|
|
|
- $("#img-top-container").empty().append(imgTopArray[ui.value-1]);
|
|
|
+ if (id in imgTopArray) {
|
|
|
+ if (IsImageOk(imgTopArray[id][ui.value-1]) ) {
|
|
|
+ console.log("Hellow");
|
|
|
+ $("#img-top-container").empty().append(imgTopArray[id][ui.value-1]);
|
|
|
} else {
|
|
|
+ console.log("RIP2");
|
|
|
$("#img-top").attr("src", "img?id="+id+"&name="+name+"&type=top-resized&counter="+(ui.value-1));
|
|
|
}
|
|
|
+ } else {
|
|
|
+ console.log("RIP");
|
|
|
+ $("#img-top").attr("src", "img?id="+id+"&name="+name+"&type=top-resized&counter="+(ui.value-1));
|
|
|
+ }
|
|
|
+ /*
|
|
|
+ if (imgTopArray[name].length > (parseInt( $("#top-count").text())*0.7) ) {
|
|
|
+ console.log("HELLO");
|
|
|
+ if (IsImageOk(imgTopArray[name][ui.value-1])) {
|
|
|
+ $("#img-top-container").empty().append(imgTopArray[name][ui.value-1]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ console.log("WUT", name, );
|
|
|
+ $("#img-top").attr("src", "img?id="+id+"&name="+name+"&type=top-resized&counter="+(ui.value-1));
|
|
|
}
|
|
|
+ */
|
|
|
$("#top-text").text(ui.value);
|
|
|
}
|
|
|
});
|
|
|
|
|
|
$( "#download" ).click(function(e) {
|
|
|
- var did = $( "select option:selected" ).text();
|
|
|
+ name = $( "#header_title" ).text().trim();
|
|
|
+ id = name.replace ( /[^\d.]/g, '' );
|
|
|
+ //var did = $( "select option:selected" ).text();
|
|
|
e.preventDefault(); //stop the browser from following
|
|
|
- window.location.href = 'download?did=' + did;
|
|
|
+ window.location.href = 'download?did=' + name;
|
|
|
+ });
|
|
|
+
|
|
|
+ $( "#bufferTop" ).click(function() {
|
|
|
+ name = $( "#header_title" ).text().trim();
|
|
|
+ total = parseInt( $("#top-count").text());
|
|
|
+ id = name.replace ( /[^\d.]/g, '' );
|
|
|
+ console.log(id, total, name);
|
|
|
+ if ( !(id in imgTopArray) || (imgTopArray[id].length != total) ) {
|
|
|
+ processLargeTopArray(name, total );
|
|
|
+ }
|
|
|
+ });
|
|
|
+ $( "#bufferLeft" ).click(function() {
|
|
|
+ name = $( "#header_title" ).text().trim();
|
|
|
+ total = parseInt( $("#left-count").text());
|
|
|
+ id = name.replace ( /[^\d.]/g, '' );
|
|
|
+ if ( !(id in imgLeftArray) || (imgLeftArray[id].length != total) ) {
|
|
|
+ processLargeLeftArray(name, total );
|
|
|
+ }
|
|
|
+ });
|
|
|
+ $( "#bufferFront" ).click(function() {
|
|
|
+ name = $( "#header_title" ).text().trim();
|
|
|
+ total = parseInt( $("#front-count").text());
|
|
|
+ id = name.replace ( /[^\d.]/g, '' );
|
|
|
+ if ( !(id in imgFrontArray) || (imgFrontArray[id].length != total) ) {
|
|
|
+ processLargeFrontArray(name, total );
|
|
|
+ }
|
|
|
});
|
|
|
|
|
|
/*
|
|
@@ -374,7 +510,7 @@ $(function() {
|
|
|
|
|
|
$("#front-left").click( function() {
|
|
|
var index = parseInt($("#front-text").text());
|
|
|
- name = $( "#header_title" ).text();
|
|
|
+ name = $( "#header_title" ).text().trim();
|
|
|
id = name.replace ( /[^\d.]/g, '' );
|
|
|
index -= 1;
|
|
|
if (index < 1) {
|
|
@@ -400,7 +536,7 @@ $(function() {
|
|
|
$("#front-right").click( function() {
|
|
|
var index = parseInt($("#front-text").text());
|
|
|
var max_count = parseInt($("#front-count").text());
|
|
|
- name = $( "#header_title" ).text();
|
|
|
+ name = $( "#header_title" ).text().trim();
|
|
|
id = name.replace ( /[^\d.]/g, '' );
|
|
|
|
|
|
//console.log(index, max_count);
|
|
@@ -428,7 +564,7 @@ $(function() {
|
|
|
|
|
|
$("#top-left").click( function() {
|
|
|
var index = parseInt($("#top-text").text());
|
|
|
- name = $( "#header_title" ).text();
|
|
|
+ name = $( "#header_title" ).text().trim();
|
|
|
id = name.replace ( /[^\d.]/g, '' );
|
|
|
index -= 1;
|
|
|
if (index < 1) {
|
|
@@ -453,7 +589,7 @@ $(function() {
|
|
|
$("#top-right").click( function() {
|
|
|
var index = parseInt($("#top-text").text());
|
|
|
var max_count = parseInt($("#top-count").text());
|
|
|
- name = $( "#header_title" ).text();
|
|
|
+ name = $( "#header_title" ).text().trim();
|
|
|
id = name.replace ( /[^\d.]/g, '' );
|
|
|
|
|
|
//console.log(index, max_count);
|
|
@@ -480,7 +616,7 @@ $(function() {
|
|
|
|
|
|
$("#left-left").click( function() {
|
|
|
var index = parseInt($("#left-text").text());
|
|
|
- name = $( "#header_title" ).text();
|
|
|
+ name = $( "#header_title" ).text().trim();
|
|
|
id = name.replace ( /[^\d.]/g, '' );
|
|
|
index -= 1;
|
|
|
if (index < 1) {
|
|
@@ -511,7 +647,7 @@ $(function() {
|
|
|
$("#left-right").click( function() {
|
|
|
var index = parseInt($("#left-text").text());
|
|
|
var max_count = parseInt($("#left-count").text());
|
|
|
- name = $( "#header_title" ).text();
|
|
|
+ name = $( "#header_title" ).text().trim();
|
|
|
id = name.replace ( /[^\d.]/g, '' );
|
|
|
|
|
|
//console.log(index, max_count);
|
|
@@ -586,25 +722,55 @@ $(function() {
|
|
|
zoomWindowWidth: 300,
|
|
|
zoomWindowHeight: 300
|
|
|
});
|
|
|
-
|
|
|
+ */
|
|
|
+
|
|
|
+ $("#img-top").ezPlus({
|
|
|
+ ////zoomWindowPosition: 1,
|
|
|
+ zoomWindowPosition: "abcd",
|
|
|
+ //scrollZoom: true,
|
|
|
+ zoomWindowHeight: "100%",
|
|
|
+ zoomWindowWidth: "33.3%",
|
|
|
+ borderSize: 0,
|
|
|
+ easing:true,
|
|
|
+ onShow: function () {
|
|
|
+ $("#sidebar" ).css("opacity", "0");
|
|
|
+ },
|
|
|
+ onHide: function () {
|
|
|
+ $("#sidebar" ).css("opacity", "1");
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
$("#placeholder-left").ezPlus({
|
|
|
- zoomWindowPosition: 9,
|
|
|
- scrollZoom: true,
|
|
|
- zoomLevel: 0.1,
|
|
|
- minZoomLevel: 0.1,
|
|
|
- zoomWindowWidth: 300,
|
|
|
- zoomWindowHeight: 300
|
|
|
+ zoomWindowPosition: "abcd",
|
|
|
+ //zoomWindowPosition: 9,
|
|
|
+ //scrollZoom: true,
|
|
|
+ //zoomLevel: 0.1,
|
|
|
+ //minZoomLevel: 0.1,
|
|
|
+ zoomWindowHeight: "100%",
|
|
|
+ zoomWindowWidth: "33.3%",
|
|
|
+ borderSize: 0,
|
|
|
+ easing:true,
|
|
|
+ onShow: function () {
|
|
|
+ $("#sidebar" ).css("opacity", "0");
|
|
|
+ },
|
|
|
+ onHide: function () {
|
|
|
+ $("#sidebar" ).css("opacity", "1");
|
|
|
+ }
|
|
|
});
|
|
|
|
|
|
$("#img-front").ezPlus({
|
|
|
- zoomWindowPosition: 11,
|
|
|
- scrollZoom: true,
|
|
|
- zoomLevel: 0.1,
|
|
|
- minZoomLevel: 0.1,
|
|
|
- zoomWindowWidth: 300,
|
|
|
- zoomWindowHeight: 300
|
|
|
+ zoomWindowPosition: "abcd",
|
|
|
+ zoomWindowHeight: "100%",
|
|
|
+ zoomWindowWidth: "33.3%",
|
|
|
+ borderSize: 0,
|
|
|
+ easing:true,
|
|
|
+ onShow: function () {
|
|
|
+ $("#sidebar" ).css("opacity", "0");
|
|
|
+ },
|
|
|
+ onHide: function () {
|
|
|
+ $("#sidebar" ).css("opacity", "1");
|
|
|
+ }
|
|
|
});
|
|
|
- */
|
|
|
|
|
|
/*
|
|
|
* print folder, imLeft.size, imTop.size, imFront.size
|
|
@@ -638,12 +804,14 @@ $(function() {
|
|
|
imgFrontArray[i] = img;
|
|
|
}
|
|
|
*/
|
|
|
-
|
|
|
- function processLargeFrontArray(max_iter) {
|
|
|
+
|
|
|
+ function processLargeFrontArray(name, max_iter) {
|
|
|
// set this to whatever number of items you can process at once
|
|
|
+ // Can use FPS to find the balance between chunk size and timeout value
|
|
|
var chunk = 10;
|
|
|
var index = 0;
|
|
|
- name = $( "#header_title" ).text();
|
|
|
+ var tmpArray = []
|
|
|
+ name = $( "#header_title" ).text().trim();
|
|
|
id = name.replace ( /[^\d.]/g, '' );
|
|
|
function doChunk() {
|
|
|
var cnt = chunk;
|
|
@@ -652,19 +820,125 @@ $(function() {
|
|
|
img.src = "img?id="+id+"&name="+name+"&type=front-resized&counter="+index;
|
|
|
img.id = "img-front";
|
|
|
img.style.width = 100 + '%';
|
|
|
- imgFrontArray[index] = img;
|
|
|
+ tmpArray[index] = img;
|
|
|
+ if (stopFlag == true) {
|
|
|
+ index = 999999;
|
|
|
+ stopFlag = false;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ // process array[index] here
|
|
|
+ ++index;
|
|
|
+ }
|
|
|
+ if (index < max_iter) {
|
|
|
+ // set Timeout for async iteration
|
|
|
+ setTimeout(doChunk, 100);
|
|
|
+ cur_value = parseInt( (tmpArray.length/parseFloat(max_iter))*100.0);
|
|
|
+ //console.log(tmpArray.length, max_iter)
|
|
|
+ $('#progress-front').css('width', cur_value+'%').attr('aria-valuenow', cur_value);
|
|
|
+ } else {
|
|
|
+ console.log(index);
|
|
|
+ if (tmpArray.length > 100) {
|
|
|
+ imgFrontArray[id] = tmpArray;
|
|
|
+ $('#progress-front').css('width', '100%').attr('aria-valuenow', 100);
|
|
|
+ }
|
|
|
+ stopFlag = false;
|
|
|
+ index = 0;
|
|
|
+ tmpArray = [];
|
|
|
+ }
|
|
|
+ /*else {
|
|
|
+ processLargeFrontArray( parseInt( $("#front-count").text()) );
|
|
|
+ }*/
|
|
|
+ }
|
|
|
+ doChunk();
|
|
|
+ }
|
|
|
+
|
|
|
+ function processLargeLeftArray(name, max_iter) {
|
|
|
+ // set this to whatever number of items you can process at once
|
|
|
+ // Can use FPS to find the balance between chunk size and timeout value
|
|
|
+ var chunk = 10;
|
|
|
+ var index = 0;
|
|
|
+ var tmpArray = []
|
|
|
+ name = $( "#header_title" ).text().trim();
|
|
|
+ id = name.replace ( /[^\d.]/g, '' );
|
|
|
+ function doChunk() {
|
|
|
+ var cnt = chunk;
|
|
|
+ while (cnt-- && index < max_iter) {
|
|
|
+ var img = new Image();
|
|
|
+ img.src = "img?id="+id+"&name="+name+"&type=left-resized&counter="+index;
|
|
|
+ img.id = "placeholder-left";
|
|
|
+ img.style.width = 100 + '%';
|
|
|
+ tmpArray[index] = img;
|
|
|
if (stopFlag == true) {
|
|
|
- max_iter = 999999;
|
|
|
- imgFrontArray = [];
|
|
|
+ index = 999999;
|
|
|
stopFlag = false;
|
|
|
break;
|
|
|
}
|
|
|
// process array[index] here
|
|
|
++index;
|
|
|
}
|
|
|
- if (index < max_iter && index < 1500) {
|
|
|
+ if (index < max_iter) {
|
|
|
// set Timeout for async iteration
|
|
|
setTimeout(doChunk, 100);
|
|
|
+ cur_value = parseInt( (tmpArray.length/parseFloat(max_iter))*100.0);
|
|
|
+ //console.log(tmpArray.length, max_iter)
|
|
|
+ $('#progress-left').css('width', cur_value+'%').attr('aria-valuenow', cur_value);
|
|
|
+ } else {
|
|
|
+ console.log(index);
|
|
|
+ if (tmpArray.length > 100) {
|
|
|
+ imgLeftArray[id] = tmpArray;
|
|
|
+ $('#progress-left').css('width', '100%').attr('aria-valuenow', 100);
|
|
|
+ }
|
|
|
+ stopFlag = false;
|
|
|
+ index = 0;
|
|
|
+ tmpArray = [];
|
|
|
+ }
|
|
|
+ /*else {
|
|
|
+ processLargeFrontArray( parseInt( $("#front-count").text()) );
|
|
|
+ }*/
|
|
|
+ }
|
|
|
+ doChunk();
|
|
|
+ }
|
|
|
+
|
|
|
+ function processLargeTopArray(name, max_iter) {
|
|
|
+ // set this to whatever number of items you can process at once
|
|
|
+ // Can use FPS to find the balance between chunk size and timeout value
|
|
|
+ var chunk = 10;
|
|
|
+ var index = 0;
|
|
|
+ var myVar;
|
|
|
+ var tmpArray = []
|
|
|
+ name = $( "#header_title" ).text().trim();
|
|
|
+ id = name.replace ( /[^\d.]/g, '' );
|
|
|
+ function doChunk() {
|
|
|
+ var cnt = chunk;
|
|
|
+ while (cnt-- && index < max_iter) {
|
|
|
+ var img = new Image();
|
|
|
+ img.src = "img?id="+id+"&name="+name+"&type=top-resized&counter="+index;
|
|
|
+ img.id = "img-top";
|
|
|
+ img.style.width = 100 + '%';
|
|
|
+ tmpArray[index] = img;
|
|
|
+ if (stopFlag == true) {
|
|
|
+ //index = 999999;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ // process array[index] here
|
|
|
+ ++index;
|
|
|
+ }
|
|
|
+ if ( (index < max_iter) && (stopFlag == false)) {
|
|
|
+ // set Timeout for async iteration
|
|
|
+ myVar = setTimeout(doChunk, 100);
|
|
|
+ cur_value = parseInt( (tmpArray.length/parseFloat(max_iter))*100.0);
|
|
|
+ //console.log(tmpArray.length, max_iter)
|
|
|
+ $('#progress-top').css('width', cur_value+'%').attr('aria-valuenow', cur_value);
|
|
|
+ } else {
|
|
|
+ console.log(index);
|
|
|
+ clearTimeout(myVar);
|
|
|
+ if (tmpArray.length > 100) {
|
|
|
+ imgTopArray[id] = tmpArray;
|
|
|
+ $('#progress-top').css('width', '100%').attr('aria-valuenow', 100);
|
|
|
+ }
|
|
|
+ stopFlag = false;
|
|
|
+ index = 0;
|
|
|
+ tmpArray = [];
|
|
|
}
|
|
|
/*else {
|
|
|
processLargeFrontArray( parseInt( $("#front-count").text()) );
|
|
@@ -672,7 +946,6 @@ $(function() {
|
|
|
}
|
|
|
doChunk();
|
|
|
}
|
|
|
- //processLargeFrontArray( parseInt( $("#front-count").text()) );
|
|
|
|
|
|
/*
|
|
|
// PRELOAD Top Images
|