c67ac37d by Jeff Balicki

h

1 parent 57aa86b8
//var pluginUrl = "http://contact-form.dev";
//var pdf_customizer = "http://pdf-customizer.dev/public";
//var pluginUrl = "http://localhost:8888/Forms";
//var pdf_customizer = "http://localhost:8888/pdf-customizer/public";
var pluginUrl = "http://contact.gotenzing.com";
var pdf_customizer = "http://pdf-customizer.synapsus.co";
......@@ -41,6 +42,19 @@ function offFocus(id) {
});
}
CanvasRenderingContext2D.prototype.roundRect = function (x, y, w, h, r) {
if (w < 2 * r) r = w / 2;
if (h < 2 * r) r = h / 2;
this.beginPath();
this.moveTo(x+r, y);
this.arcTo(x+w, y, x+w, y+h, r);
this.arcTo(x+w, y+h, x, y+h, r);
this.arcTo(x, y+h, x, y, r);
this.arcTo(x, y, x+w, y, r);
this.closePath();
return this;
}
function ShowBox(pheight, pwidth, up, right, height, width, count, example) {
jQuery(document).ready(function($) {
$('span').hide();
......@@ -52,6 +66,8 @@ function ShowBox(pheight, pwidth, up, right, height, width, count, example) {
Qctx.clearRect(0, 0, Qc.width, Qc.height);
Qctx.restore();
var down = pheight - (up + height);
var scaleH = $("Canvas").height() / pheight;
var scaleW = $("Canvas").width() / pwidth;
......@@ -59,14 +75,20 @@ function ShowBox(pheight, pwidth, up, right, height, width, count, example) {
var scaleRight = right * scaleW;
var scalewidth = width * scaleW;
var scaleheight = height * scaleH;
var radius = '50';
var c = document.getElementById("Canvas");
var ctx = c.getContext("2d");
ctx.save();
ctx.rect(scaleRight, scaleDown, scalewidth, scaleheight);
console.log(scaleRight, scaleDown, scalewidth, scaleheight);
console.log($("Canvas").height(), $("Canvas").width(), scaleW, scaleH);
ctx.stroke();
ctx.lineWidth=2;
ctx.strokeStyle="#F7A800";
ctx.roundRect(scaleRight, scaleDown, scalewidth, scaleheight, 20).stroke();
//ctx.rect(scaleRight, scaleDown, scalewidth, scaleheight );
//console.log(scaleRight, scaleDown, scalewidth, scaleheight);
//console.log($("Canvas").height(), $("Canvas").width(), scaleW, scaleH);
//
//ctx.lineWidth=2;
//ctx.lineCap = "round";
//ctx.stroke();
//console.log(pheight, pwidth,up, right, height, width);
// console.log(myrect )
});
......@@ -200,7 +222,8 @@ function changePdfOptions(json) {
}
if (json[i].change_type == "date") {
pdfChange += json[i].names + ': <input onfocusout="HideBoxwithdate()" onfocus="ShowBox(' + json[0].pheight + ',' + json[0].pwidth + ',' + json[i].locationUp + ',' + json[i].locationRight + ',' + json[i].height + ',' + json[i].width + ',' + i + ',\'' + example + '\')" id="changescontentdate" type="text" class="required date" name="content[' + i + ']" value="' + json[i].content + '"">';
pdfChange += '<span id="span' + i + '"> </span><br/>';
}
}
......