Refactor shorts.blade.php to improve visibility and structure of SVG content and canvas elements
Some checks failed
Deploy Production (admin.crewsportswear.app) / deploy (push) Failing after 2m27s
Some checks failed
Deploy Production (admin.crewsportswear.app) / deploy (push) Failing after 2m27s
This commit is contained in:
@@ -14,19 +14,20 @@
|
||||
</head>
|
||||
<body onload="loadPrintFile()">
|
||||
|
||||
<div id="svgFrontContent" style="display:none;"></div>
|
||||
<div id="svgBackContent" style="display:none;"></div>
|
||||
<div id="svgJockTag" style="display:none;"></div>
|
||||
<div id="svgFrontContent"></div>
|
||||
<div id="svgBackContent"></div>
|
||||
<div id="svgJockTag"></div>
|
||||
|
||||
<p>Please wait... Click here to go <a href="#" id="close_window" >back</a></p>
|
||||
<p>Please wait... Click here to go <a href="#" id="close_window" >back</a></p>
|
||||
<p>updated</p>
|
||||
|
||||
<!-- <canvas id="frontCanvas" width="220px" height="380px" style="border 1px solid black; display:none;" ></canvas>
|
||||
<canvas id="backCanvas" width="220px" height="380px" style="border 1px solid black; display:none;" ></canvas> -->
|
||||
|
||||
<canvas id="frontCanvas" width="171px" height="365px" style="border 1px solid black; display:none;" ></canvas>
|
||||
<canvas id="backCanvas" width="171px" height="365px" style="border 1px solid black; display:none;" ></canvas>
|
||||
<canvas id="frontCanvas" width="158px" height="316px" style="border 1px solid black;" ></canvas>
|
||||
<canvas id="backCanvas" width="158px" height="316px" style="border 1px solid black;" ></canvas>
|
||||
|
||||
<div id="printFileDiv" style="display:none;"></div>
|
||||
<div id="printFileDiv"></div>
|
||||
|
||||
<form id="myForm" action="{{ url('admin/orders/download') }}" method="post" accept-charset="UTF-8"></form>
|
||||
<p id="log"></p>
|
||||
@@ -143,8 +144,8 @@
|
||||
setTimeout(function() {
|
||||
|
||||
loadTemplateDesign();
|
||||
frontContent(rb_height, rb_width, rb_x, rb_y);
|
||||
backContent(lb_height, lb_width, lb_x, lb_y);
|
||||
frontContent(rb_height, rb_width, rb_x, rb_y); // right
|
||||
backContent(lb_height, lb_width, lb_x, lb_y); // left
|
||||
|
||||
setTimeout(function(){
|
||||
sendSVG();
|
||||
@@ -340,8 +341,11 @@
|
||||
try{
|
||||
var p_number = '{{ $order_item_array[0]->Number }}';
|
||||
for (var j in objects) {
|
||||
console.log(objects[j]);
|
||||
var id = objects[j].get('idNumber');
|
||||
if(id == "NumberFront"){
|
||||
console.log("idnumber", id);
|
||||
|
||||
if(id == "NumberLeftShorts"){
|
||||
objects[j].setText(p_number.toString());
|
||||
objects[j].centerH();
|
||||
objects[j].setCoords();
|
||||
@@ -427,6 +431,7 @@
|
||||
}
|
||||
|
||||
var contents = JSON.stringify(consolidatedContents1);
|
||||
console.log("front content", contents)
|
||||
|
||||
var con = jQuery.parseJSON(contents);
|
||||
var countContents = con.length;
|
||||
@@ -434,7 +439,7 @@
|
||||
var jContent = $.map(con, function(value) {
|
||||
return(value);
|
||||
});
|
||||
$("#Left_Border").html(jContent.join(""));
|
||||
$("#Right_Border").html(jContent.join(""));
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
@@ -452,7 +457,7 @@
|
||||
var p_number = '{{ $order_item_array[0]->Number }}';
|
||||
for (var j in objects) {
|
||||
var id = objects[j].get('idNumber');
|
||||
if(id == "NumberBack"){
|
||||
if(id == "NumberRightShorts"){
|
||||
objects[j].setText(p_number.toString());
|
||||
objects[j].centerH();
|
||||
objects[j].setCoords();
|
||||
@@ -498,6 +503,7 @@
|
||||
|
||||
try {
|
||||
var content = backCanvas.toSVG();
|
||||
|
||||
document.getElementById('svgBackContent').innerHTML = content;
|
||||
|
||||
var el_id = document.getElementById('svgBackContent');
|
||||
@@ -544,6 +550,7 @@
|
||||
}
|
||||
|
||||
var contents = JSON.stringify(consolidatedContents);
|
||||
console.log("back content", contents)
|
||||
var con = jQuery.parseJSON(contents);
|
||||
|
||||
var countContents = con.length;
|
||||
@@ -551,7 +558,7 @@
|
||||
var jContent = $.map(con, function(value) {
|
||||
return(value);
|
||||
});
|
||||
$("#Right_Border").html(jContent.join(""));
|
||||
$("#Left_Border").html(jContent.join(""));
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
@@ -571,8 +578,8 @@
|
||||
}
|
||||
|
||||
if(side == "Right" || side == "Left"){
|
||||
var SCALE_FACTOR_X = actualSizeX / 96;
|
||||
var SCALE_FACTOR_Y = actualSizeY / 112;
|
||||
var SCALE_FACTOR_X = actualSizeX / 158;
|
||||
var SCALE_FACTOR_Y = actualSizeY / 316;
|
||||
}
|
||||
|
||||
canvasScale = canvasScale * SCALE_FACTOR;
|
||||
@@ -636,9 +643,9 @@
|
||||
document.body.appendChild(form);
|
||||
form.submit();
|
||||
alert("Print file is successfully generated!");
|
||||
setTimeout(function(){
|
||||
window.location = "{{ url('admin/orders/view') }}" + "/" + "{{ $order_item_array[0]->CartKey }}"
|
||||
},2000);
|
||||
// setTimeout(function(){
|
||||
// window.location = "{{ url('admin/orders/view') }}" + "/" + "{{ $order_item_array[0]->CartKey }}"
|
||||
// },2000);
|
||||
}
|
||||
|
||||
function loadGradientTemplate(gradientFor, gradientIds, gradientColor1, gradientColor2, gradientColorOffset1, gradientColorOffset2, trimCount){
|
||||
|
||||
Reference in New Issue
Block a user