Skip to content

Instantly share code, notes, and snippets.

@alexmac05
Created April 19, 2018 14:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexmac05/efef7a557fcc7ccc89bd17b5ac3cb1a9 to your computer and use it in GitHub Desktop.
Save alexmac05/efef7a557fcc7ccc89bd17b5ac3cb1a9 to your computer and use it in GitHub Desktop.
HelloSign - Overriding the app white labelling settings when doing the embedded iframe loading in JavaScript
HelloSign.init("<?php echo $client_id ?>");
HelloSign.open({
url: "<?php echo $sign_url ?>",
allowCancel: true,
skipDomainVerification: true,
uxVersion: 2,
whiteLabelingOptions: {
"header_background_color": "#00adbb",
"primary_button_color": "#43454d",
"primary_button_text_color": "#ffffff",
"primary_button_color_hover": "#43454d",
"primary_button_text_color_hover": "#ffffff",
"link_color": "#00adbb",
"page_background_color": "#f4f7f9",
"secondary_button_color": "#43454d",
"secondary_button_text_color": "#ffffff",
"legal_version": "terms2"
},
messageListener: function (eventData) {
(console.log(">-*>-*>-*> Got message data: " + JSON.stringify(eventData)));
if (eventData.event == HelloSign.EVENT_SIGNED) {
HelloSign.close();
console.log(eventData.signature_id) + "this is the signature_id";
} else if (eventData.event == HelloSign.EVENT_CANCELED) {
HelloSign.close();
console.log(eventData);
} else if (eventData.event == HelloSign.EVENT_ERROR) {
HelloSign.close();
alert("There Was An Error And Stuff!");
console.log(eventData);
} else if (eventData.event == HelloSign.EVENT_SENT) {
HelloSign.close();
console.log(eventData);
console.log(eventData.signature_request_id);
} else if (eventData.event == HelloSign.EVENT_TEMPLATE_CREATED) {
HelloSign.close();
console.log(eventData);
} else if (eventData.event == HelloSign.EVENT_DECLINED) {
HelloSign.close();
console.log(eventData);
}
}
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment