diff options
author | Andreas Fitzek <andreas.fitzek@iaik.tugraz.at> | 2015-04-27 16:41:06 +0200 |
---|---|---|
committer | Andreas Fitzek <andreas.fitzek@iaik.tugraz.at> | 2015-04-27 16:41:06 +0200 |
commit | 55194159de4eb2c6ce4c37d4367a788aa390ce5d (patch) | |
tree | df6963de14df006e94d263fb1d2e39013165dfb3 /simpleSigning/src/main/resources | |
parent | dbd565ec8195117306ae869f4e7b507ff275ed32 (diff) | |
download | einfach-signieren-55194159de4eb2c6ce4c37d4367a788aa390ce5d.tar.gz einfach-signieren-55194159de4eb2c6ce4c37d4367a788aa390ce5d.tar.bz2 einfach-signieren-55194159de4eb2c6ce4c37d4367a788aa390ce5d.zip |
added locale parameter, and pdfas_innerdiv css class
Diffstat (limited to 'simpleSigning/src/main/resources')
-rw-r--r-- | simpleSigning/src/main/resources/js/pdfas.js | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/simpleSigning/src/main/resources/js/pdfas.js b/simpleSigning/src/main/resources/js/pdfas.js index 30f27f9..a96feee 100644 --- a/simpleSigning/src/main/resources/js/pdfas.js +++ b/simpleSigning/src/main/resources/js/pdfas.js @@ -1,9 +1,5 @@ /** - * - */ - -/** - * Operation Decsription + * Operation Description */ var operation = { /** @@ -19,7 +15,12 @@ var operation = { /** * DIV id where to place to UI */ - uiId: "" + uiId: "", + + /** + * Locale to use + */ + locale: "DE" }; var pdfAsOrigin = "##REPLACE##DOMAIN##"; @@ -37,15 +38,15 @@ var pdfAs = {}; * @returns */ pdfAs.signText = function(content, error, success) { - this.createAsyncSignature(content.content, content.connector, content.uiId, pdfAsUrl, content.qrdata, "TEXT", success, error); + this.createAsyncSignature(content.content, content.connector, content.uiId, pdfAsUrl, content.qrdata, content.locale, "TEXT", success, error); }; pdfAs.signPdf = function(content, error, success) { - this.createAsyncSignature(content.content, content.connector, content.uiId, pdfAsUrl, content.qrdata, "PDF", success, error); + this.createAsyncSignature(content.content, content.connector, content.uiId, pdfAsUrl, content.qrdata, content.locale, "PDF", success, error); }; pdfAs.signPdfBase64 = function(content, error, success) { - this.createAsyncSignature(content.content, content.connector, content.uiId, pdfAsUrl, content.qrdata, "B64", success, error); + this.createAsyncSignature(content.content, content.connector, content.uiId, pdfAsUrl, content.qrdata, content.locale, "B64", success, error); }; pdfAs.getVersion = function(cb, err) { @@ -124,7 +125,7 @@ pdfAs.autoResize = function(eventId, height, width){ var newheight = height; var newwidth = width; - console.log("Resising iframe " + width + "x" + height); + console.log("Resizing iframe " + width + "x" + height); newheight = newheight + 20; @@ -133,10 +134,12 @@ pdfAs.autoResize = function(eventId, height, width){ eventId = eventId.substring(0, eventId.length - 7); var custDiv = eventId + "_div"; var element = document.getElementById(custDiv); - element.style.margin = '-' + element.scrollHeight / 2 + 'px 0 0 -' + element.scrollWidth / 2 + 'px'; + if ((typeof(element) !== 'undefined') && (element !== null)) { + element.style.margin = '-' + element.scrollHeight / 2 + 'px 0 0 -' + element.scrollWidth / 2 + 'px'; + } }; -pdfAs.createAsyncSignature = function(pdfUrl, connector, divID, pdfAsURL, qrcode, type, success, error) { +pdfAs.createAsyncSignature = function(pdfUrl, connector, divID, pdfAsURL, qrcode, locale, type, success, error) { // generate EventID var eventId = guid(); @@ -147,7 +150,8 @@ pdfAs.createAsyncSignature = function(pdfUrl, connector, divID, pdfAsURL, qrcode TYPE: type, TARGETURL: document.URL, NEW: "1", - QRCODE: qrcode + QRCODE: qrcode, + LOCALE: locale }; /*var querystring = encodeQueryData(parameters); @@ -211,6 +215,7 @@ pdfAs.createAsyncSignature = function(pdfUrl, connector, divID, pdfAsURL, qrcode var element = document.getElementById(divID); var innerdiv = document.createElement('div'); + innerdiv.setAttribute('class', 'pdfas_innerdiv'); innerdiv.style.display = 'block'; element.appendChild(innerdiv); var innerdivbottom = document.createElement('div'); |