Commit 830d6dbe authored by Prakhar Agrawal's avatar Prakhar Agrawal
Browse files

Fixed v3 tag.

parent 665b06fd
Loading
Loading
Loading
Loading

.gitignore

0 → 100644
+1 −0
Original line number Diff line number Diff line
.idea/
 No newline at end of file
+1 −1
Original line number Diff line number Diff line
!function(){"use strict";function t(t){this.name="LeegalityExecption",this.message=t}(window.Leegality=function(s){if(!s||!s.callback)throw new t("Callback function is required.");this.callback=s.callback,this.logoUrl=s.logoUrl}).prototype={popup:null,callback:null,logoUrl:null,responseData:null,handleResponse:function(t){this.cancel(),this.callback(t),this.responseData=null},getLoadingHtml:function(){var t='<html><head><meta http-equiv="Content-Security-Policy" content="default-src *; img-src * \'self\' data: https:; script-src \'self\' \'unsafe-inline\' \'unsafe-eval\' *; style-src \'self\' \'unsafe-inline\' *"><link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"><script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"><\/script><script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"><\/script><style>body{background: #d2d6de;}.logo-div{margin-top: 5%;}.loading-div{margin-top: 10%;}.text-center{text-align: center;}.loading-text{font-size: 16px;}.logo-image{max-width: 50%;}.loader{max-width: 40px;max-height: 40px;}</style></head><body><div class="container"><div class="row logo-div"><div class="col-md-4"></div><div class="col-md-4 text-center"><img src="',s='" class="logo-image"></div><div class="col-md-4"></div></div><div class="row loading-div"><div class="col-md-4"></div><div class="col-md-4 text-center"><p class="loading-text">Loading..Please Wait!</p><img src="https://s3.ap-south-1.amazonaws.com/leegality-production-helpers/spinner2.gif" class="loader"/></div><div class="col-md-4"></div></div></div></body></html>';return this.logoUrl?t+this.logoUrl+s:t+"https://s3.ap-south-1.amazonaws.com/leegality-production-helpers/leegality-logo.png"+s},init:function(){this.popup&&this.popup.close();var t=.4*screen.width,s=.85*screen.height,e=.3*screen.width;this.popup=window.open("","_blank","toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=0,width="+t+",height="+s+",top=0, left="+e),this.popup.document.write(this.getLoadingHtml());var o=this;window.addEventListener("message",function(t){o.responseData=t.data},!1);var i=window.setInterval(function(){o.responseData?(window.clearInterval(i),o.handleResponse(o.responseData)):o.popup.closed&&(o.handleResponse({error:"Cancelled."}),window.clearInterval(i))},1e3)},esign:function(s){if(!s)throw new t("Url is required.");if(!this.popup)throw new t("Intialize signing first.");this.popup.location=s},cancel:function(){this.popup&&this.popup.close()}}}();
!function(){"use strict";function t(t){this.name="LeegalityExecption",this.message=t}(window.Leegality=function(s){if(!s||!s.callback)throw new t("Callback function is required.");this.callback=s.callback,this.logoUrl=s.logoUrl}).prototype={popup:null,callback:null,logoUrl:null,responseData:null,handleResponse:function(t){this.cancel(),this.callback(t),this.responseData=null},getLoadingHtml:function(){var t='<html><head><meta http-equiv="Content-Security-Policy" content="default-src *; img-src * \'self\' data: https:; script-src \'self\' \'unsafe-inline\' \'unsafe-eval\' *; style-src \'self\' \'unsafe-inline\' *"><link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"><script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"><\/script><script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"><\/script><style>body{background: #d2d6de;}.logo-div{margin-top: 5%;}.loading-div{margin-top: 10%;}.text-center{text-align: center;}.loading-text{font-size: 16px;}.logo-image{max-width: 50%;}.loader{max-width: 40px;max-height: 40px;}</style></head><body><div class="container"><div class="row logo-div"><div class="col-md-4"></div><div class="col-md-4 text-center"><img src="',s='" class="logo-image"></div><div class="col-md-4"></div></div><div class="row loading-div"><div class="col-md-4"></div><div class="col-md-4 text-center"><p class="loading-text">Loading..Please Wait!</p><img src="https://s3.ap-south-1.amazonaws.com/leegality-production-helpers/spinner2.gif" class="loader"/></div><div class="col-md-4"></div></div></div></body></html>';return this.logoUrl?t+this.logoUrl+s:t+"https://s3.ap-south-1.amazonaws.com/leegality-production-helpers/logo.png"+s},init:function(){this.popup&&this.popup.close();var t=.8*screen.width,s=.9*screen.height,e=.1*screen.width;this.popup=window.open("","_blank","toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=0,width="+t+",height="+s+",top=0, left="+e),this.popup.document.write(this.getLoadingHtml());var o=this;window.addEventListener("message",function(t){o.responseData=t.data},!1);var i=window.setInterval(function(){o.responseData?(window.clearInterval(i),o.handleResponse(o.responseData)):o.popup.closed&&(o.handleResponse({error:"Cancelled."}),window.clearInterval(i))},1e3)},esign:function(s){if(!s)throw new t("Url is required.");if(!this.popup)throw new t("Intialize signing first.");this.popup.location=s},cancel:function(){this.popup&&this.popup.close()}}}();
+4 −4
Original line number Diff line number Diff line
# Leegality Web SDK 4.0#
# Leegality Web SDK 3.0#

### Steps to use: ###

1. Download Leegality Library from http://gitlab.leegality.com/leegality-public/web-sdk/blob/master/leegalityv4.js
1. Download Leegality Library from http://gitlab.leegality.com/leegality-public/web-sdk/blob/v3/leegalityv3.js
2. Insert the SDK JS file in head tag of HTML.
    <br __>Ex. `<script src="leegalityv4.js" type="text/javascript"></script>`
    <br __>Ex. `<script src="leegalityv3.js" type="text/javascript"></script>`
3. Create a JSON object with following keys:
    <br __>3.1 logoUrl: (This is an optional parameter) This key contains a URL of your logo in any image file format. This Logo is shown on the Loading Page before the Signing Page appears. 
    <br __>3.2 callback: (This is a required parameter) This key contains a function which will be automatically executed after the completion of signing or in case of any error.
@@ -38,7 +38,7 @@
```
<html>
    <head>
        <script src="leegalityv4.js" type="text/javascript"></script>
        <script src="leegalityv3.js" type="text/javascript"></script>
    </head>
    <body>
        <p>Message: <span id="message"></span></p>