hellosign-embedded
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -19,3 +19,6 @@ { | ||
"morgan": "^1.7.0" | ||
}, | ||
"devDependencies": { | ||
"webpack": "^1.13.1" | ||
} | ||
} |
{ | ||
"name": "hellosign-embedded", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "A JavaScript library required for embedding HelloSign features into your webapp. For more information, see our API documentation at https://www.hellosign.com/api/documentation.", | ||
@@ -5,0 +5,0 @@ "main": "src/embedded.js", |
@@ -542,23 +542,24 @@ /** | ||
// Add or remove the 'cancel' button | ||
if (!this.isInPage && (params['allowCancel'] === true || params['allowCancel'] === undefined) && !this.cancelButton) { | ||
this.cancelButton = document.createElement('a'); | ||
this.cancelButton.setAttribute('id', 'hsEmbeddedCancel'); | ||
this.cancelButton.setAttribute('href', 'javascript:;'); | ||
this.cancelButton.onclick = function(){ | ||
// Close iFrame | ||
HelloSign.close(); | ||
// Send 'cancel' message | ||
if (messageListener) { | ||
l('Reporting cancelation'); | ||
messageListener({ | ||
'event': HelloSign.EVENT_CANCELED | ||
}); | ||
} | ||
}; | ||
this.wrapper.appendChild(this.cancelButton); | ||
if (params['uxVersion'] != null && params['uxVersion'] < 2) { | ||
if (!this.isInPage && (params['allowCancel'] === true || params['allowCancel'] === undefined) && !this.cancelButton) { | ||
this.cancelButton = document.createElement('a'); | ||
this.cancelButton.setAttribute('id', 'hsEmbeddedCancel'); | ||
this.cancelButton.setAttribute('href', 'javascript:;'); | ||
this.cancelButton.onclick = function(){ | ||
// Close iFrame | ||
HelloSign.close(); | ||
// Send 'cancel' message | ||
if (messageListener) { | ||
l('Reporting cancelation'); | ||
messageListener({ | ||
'event': HelloSign.EVENT_CANCELED | ||
}); | ||
} | ||
}; | ||
this.wrapper.appendChild(this.cancelButton); | ||
} | ||
else if (!params['allowCancel'] && this.cancelButton) { | ||
this.wrapper.removeChild(this.cancelButton); | ||
} | ||
} | ||
else if (!params['allowCancel'] && this.cancelButton) { | ||
this.wrapper.removeChild(this.cancelButton); | ||
} | ||
@@ -608,5 +609,15 @@ // Add inline styling | ||
XWM.receive(function _parentWindowCallback(evt){ | ||
if (evt.data == 'close') { | ||
var source = evt.source || 'hsEmbeddedFrame'; | ||
if (evt.data === 'initialize' && params['uxVersion'] > 1) { | ||
XWM.send(JSON.stringify({ type: 'embeddedConfig', payload: params }), evt.origin, source); | ||
} else if (evt.data == 'close') { | ||
// Close iFrame | ||
HelloSign.close(); | ||
if (messageListener && params['uxVersion'] > 1) { | ||
messageListener({ | ||
'event': HelloSign.EVENT_CANCELED | ||
}); | ||
} | ||
} | ||
@@ -617,3 +628,3 @@ else if (evt.data.indexOf('hello:') === 0) { | ||
var token = parts[1]; | ||
XWM.send('helloback:' + token, frameUrl, evt.source || 'hsEmbeddedFrame'); | ||
XWM.send('helloback:' + token, frameUrl, source); | ||
} | ||
@@ -620,0 +631,0 @@ else if (messageListener && evt.data) { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
72381
1060