|
|
|
@ -44,7 +44,11 @@ function makeStampImage(callback) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function activateTextTool() {
|
|
|
|
|
var text = prompt("");
|
|
|
|
|
if (!canUseDrawTools()) {
|
|
|
|
|
showToast("Please open a document first.");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
var text = prompt("Enter a line of text to add to the document:");
|
|
|
|
|
if (text == "") {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
@ -69,6 +73,10 @@ function activateTextTool() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function activateStampDrawTool() {
|
|
|
|
|
if (!canUseDrawTools()) {
|
|
|
|
|
showToast("Please open a document first.");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
makeStampImage(function (image) {
|
|
|
|
|
activeDrawImage = image;
|
|
|
|
|
enableGuideBox(image);
|
|
|
|
@ -76,6 +84,10 @@ function activateStampDrawTool() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function activateNotarySignatureTool() {
|
|
|
|
|
if (!canUseDrawTools()) {
|
|
|
|
|
showToast("Please open a document first.");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (!inStorage("notary_signature")) {
|
|
|
|
|
showAlert("Please set a notary signature in the settings.");
|
|
|
|
|
return;
|
|
|
|
@ -91,6 +103,10 @@ function activateNotarySignatureTool() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function activateNotaryCertificateTool() {
|
|
|
|
|
if (!canUseDrawTools()) {
|
|
|
|
|
showToast("Please open a document first.");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
initCertificateBuilder();
|
|
|
|
|
|
|
|
|
|
certificateBuilderCallback = function () {
|
|
|
|
@ -108,6 +124,10 @@ function activateNotaryCertificateTool() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function activateClientSignaturePad() {
|
|
|
|
|
if (!canUseDrawTools()) {
|
|
|
|
|
showToast("Please open a document first.");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
initSignaturePad();
|
|
|
|
|
signaturePadCallback = function () {
|
|
|
|
|
if (clientSignatureSvg != "" && signaturePad.isEmpty()) {
|
|
|
|
@ -228,6 +248,14 @@ function getMousePos(canvas, evt) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns true if drawing tools should be available (i.e. there's a document to draw on)
|
|
|
|
|
* @returns {Boolean}
|
|
|
|
|
*/
|
|
|
|
|
function canUseDrawTools() {
|
|
|
|
|
return $("#page-canvas-container .page-canvas").length > 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Hide it at start
|
|
|
|
|
// doesn't work in CSS because of reasons
|
|
|
|
|
disableGuideBox();
|