16d2f67a by Jeff Balicki

commit

1 parent 262fa897
// var pluginUrl = "http://localhost:8888/Forms";
// var pdf_customizer = "http://localhost:8888/pdf-customizer/public";
//var pluginUrl = "http://localhost:8888/Forms";
//var pdf_customizer = "http://localhost:8888/pdf-customizer/public";
var pluginUrl = "http://contact.gotenzing.com";
......@@ -101,21 +101,23 @@ function ShowBox(pheight, pwidth, up, right, height, width, count, example) {
function HideBox() {
jQuery(document).ready(function($) {
$('span').hide();
console.log('hide');
var Qc = document.getElementById("Canvas");
var Qctx = Qc.getContext("2d");
Qctx.clearRect(0, 0, Qc.width, Qc.height);
Qctx.restore();
var cnv = document.getElementById("Canvas");
var ctx = cnv.getContext('2d'); // gets reference to canvas context
ctx.beginPath(); // clear existing drawing paths
ctx.save(); // store the current transformation matrix
});
}
function HideBoxwithdate() {
jQuery(document).ready(function($) {
var cnv = document.getElementById("Canvas");
var ctx = cnv.getContext('2d'); // gets reference to canvas context
ctx.beginPath(); // clear existing drawing paths
ctx.save(); // store the current transformation matrix
var Qc = document.getElementById("Canvas");
var Qctx = Qc.getContext("2d");
Qctx.clearRect(0, 0, Qc.width, Qc.height);
Qctx.restore();
});
}
......@@ -180,7 +182,16 @@ function changePdfOptions(json) {
// '$(this)' refers to '$("#datepicker")'
});
$("#changes").validate();
$("#changes").validate({
errorPlacement: function(error, element) {
var isFile = $(element).attr('type') == 'file';
if(isFile) {
error.insertAfter($(element).parent('label'));
} else {
error.insertAfter(element);
}
}
});
});
var strVar2 = "";
......@@ -188,9 +199,9 @@ function changePdfOptions(json) {
var pdfChange = "";
var f = 0;
var scaleImage = 400 / json[0].pwidth;
var scaleImage = 350 / json[0].pwidth;
var imageHeight = json[0].pheight * scaleImage;
var imageWidth = 400;
var imageWidth = 350;
console.log(json[0].pheight, scaleImage, imageHeight);
pdflist += '<div id="pdfPreview" class="column">';
......@@ -295,9 +306,14 @@ function changePdfOptions(json) {
} else {
$(target).parent('label').find('.file-name').text('');
}
$(target).parent('label').trigger('focus');
});
$('.custom-file-input').keypress(function(event) {
if(event.which == 13) {
$(this).trigger('click');
}
});
$("#changes").submit(function(e) {
e.preventDefault();
......