diff options
Diffstat (limited to 'simpleSigning/src/main/resources/js/pdfas.js')
| -rw-r--r-- | simpleSigning/src/main/resources/js/pdfas.js | 38 | 
1 files changed, 29 insertions, 9 deletions
| diff --git a/simpleSigning/src/main/resources/js/pdfas.js b/simpleSigning/src/main/resources/js/pdfas.js index 3b74994..4c520aa 100644 --- a/simpleSigning/src/main/resources/js/pdfas.js +++ b/simpleSigning/src/main/resources/js/pdfas.js @@ -92,6 +92,10 @@ pdfAs.autoResize = function(eventId, height, width){      document.getElementById(eventId).height= (newheight) + "px";      document.getElementById(eventId).width= (newwidth) + "px"; +    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';  };  pdfAs.createAsyncSignature = function(pdfUrl, connector, divID, pdfAsURL, type, success, error) { @@ -122,8 +126,8 @@ pdfAs.createAsyncSignature = function(pdfUrl, connector, divID, pdfAsURL, type,  	console.log("URL: " + url);*/  	var iframeid = eventId + "_iframe";  	var iframe = document.createElement('iframe'); -	iframe.width = '95%'; -	iframe.height = '95%'; +	iframe.width = '100%'; +	iframe.height = '100%';  	iframe.frameBorder = '0';      //iframe.src = url;      iframe.id = iframeid; @@ -140,19 +144,30 @@ pdfAs.createAsyncSignature = function(pdfUrl, connector, divID, pdfAsURL, type,  		document.body.appendChild(div);  		div.id = custDiv;  		div.style.display = 'block'; -		div.style.zIndex = 2; +		div.style.zIndex = 32770;  		div.style.background = '#FFF';  		div.style.position = 'absolute'; -		div.style.width = '45em'; +		//div.style.width = '45em';  		//div.style.height = '300px';  		div.style.top = '50%';  		div.style.left = '50%';  		div.style.margin = '-150px 0 0 -22.5em';  		div.style.textAlign = 'center'; -		div.style.borderRadius = '4px'; -		div.style.boxShadow = '0 0 5px rgba(0,0,0,0.9)'; - -		div.appendChild(iframe); +		div.style.boxShadow = '0 0 5px #E0E4CC'; +		div.style.borderStyle= 'groove'; +		div.style.borderRadius= '8px'; +		div.style.borderColor= '#E0E4CC'; +		 +		var innerdiv = document.createElement('div'); +		innerdiv.style.display = 'block'; +		div.appendChild(innerdiv); +		var innerdivbottom = document.createElement('div'); +		innerdivbottom.style.display = 'block'; +		div.appendChild(innerdivbottom); +		innerdivbottom.innerHTML = "<center><button type='button' style='margin: 8px;' onclick='pdfAs.closeInstance(\"" + eventId + "\")'>Abbrechen</button></center>" +		 +		//innerdiv.innerHTML = "<a href='#' onclick='pdfAs.checkOverlay(\"" + eventId + "\")'>close</a>"; +		innerdiv.appendChild(iframe);  	} else {  		var element = document.getElementById(divID);  		element.appendChild(iframe); @@ -175,6 +190,11 @@ pdfAs.addCallback = function(eventId, custDiv, error, success) {  	pdfAs.cbMap.eventId = {suc: success, err: error, div: custDiv};  }; +pdfAs.closeInstance = function(eventId) { +	pdfAs.checkOverlay(eventId); +	pdfAs.doErrorCB(eventId, "Abort", "Aborted by the user."); +} +  pdfAs.checkOverlay = function(eventId) {  	if(pdfAs.cbMap.eventId) {  		if(typeof pdfAs.cbMap.eventId.div != "undefined") { @@ -193,7 +213,7 @@ pdfAs.doSuccessCB = function(eventId, pdfurl) {  pdfAs.doErrorCB = function(eventId, error, cause) {  	if(pdfAs.cbMap.eventId) { -		pdfAs.cbMap.eventId.err(error, cause); +		pdfAs.cbMap.eventId.err(decodeURIComponent(error), decodeURIComponent(cause));  	}  }; | 
