1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- var Unibase;
- (function (Unibase) {
- let Platform;
- (function (Platform) {
- let Crypto;
- (function (Crypto_1) {
- let Components;
- (function (Components) {
- class Crypto extends Unibase.Platform.Core.BaseComponent {
- cssFiles() {
- return [];
- }
- jsFiles() {
- return ["platform/crypto/managers/cryptomanager.js"];
- }
- html(id, containerid) {
- var html = '';
- return html;
- }
- load(id, containerid, callback) {
- return;
- }
- init(containerid) {
- var instance = this;
- var jsFiles = ["platform/crypto/managers/cryptomanager.js"];
- instance.fileCacheHelper.loadJsFiles(jsFiles, function () {
- instance.loaddesign(containerid);
- $("#cardfooter").hide();
- $("#submit_btn1").click(function () {
- let inputstr = $('#txt_inputString').val();
- let secretkey = $('#txt_secretkey').val();
- var uniqueid = "";
- for (let obj of Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters) {
- if (obj.Key === "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_uniqueid") {
- uniqueid = obj.Value;
- }
- }
- instance.crypto(inputstr, uniqueid, secretkey, $('#cmb_isencrypt').is(":checked"));
- });
- $("#clipboardCopy").click(function () {
- $("#clipBoardText").select();
- document.execCommand("copy");
- });
- });
- }
- crypto(token, uniqueid, secretkey, isencrypt) {
- var postData = {
- token: token,
- uniqueid: uniqueid,
- secretkey: secretkey,
- isencrypt: isencrypt
- };
- Unibase.Platform.Crypto.Managers.CryptoManger.Instance().crypto(postData).then(function (response) {
- $("#cardfooter").show();
- response.result = JSON.parse(response.result);
- $('#clipBoardText').val(response.result.Result);
- });
- }
- loaddesign(containerid) {
- var html = ' <div class="d-flex flex-column"> <ul class="card p-5"> <li> <ul class="card d-flex flex-column"> <li class="card-header"> <span class="font-weight-500 font-18">Cryptography</span> </li><li class="card-body"> <ul class="d-flex flex-column"> <li class="d-flex flex-column pt-1 pb-20"> <label for="inputString" class="font-weight-600">Input String</label> <input type="text" id="txt_inputString" class="form-control" placeholder="Input String" data-placeholder="Input String" data-validatename="Input String" data-label="Input String" autocomplete="off" style="box-shadow: none;"> </li><li class="d-flex flex-row w-100 align-items-end"> <div class="d-flex flex-column pt-1 pb-20 w-50"> <label for="security" class="font-weight-600">Security</label> <input type="text" id="txt_secretkey" class="form-control" placeholder="Security" data-placeholder="Security" data-validatename="Security" data-label="Security" autocomplete="off" style="box-shadow: none;"> </div><div class="d-flex justify-content-center pt-1 pb-20 w-50"> <div class="d-flex align-items-center"> <input class="form-check-input isencrypt" type="checkbox" value="" id="cmb_isencrypt" style="width: 18px; height:18px;"> <label class="form-check-label pl-2" for="isencrypt"> IsEncrypt</label> </div></div></li><li class="d-flex justify-content-end"> <a href="javascript:;" class="btn btn-primary" id="submit_btn1">Generate</a> </li></ul> </li></ul> </li></ul> <ul id="cardfooter"> <li> <ul class="card d-flex flex-column"> <li class="card-header"> <div class="d-flex justify-content-between align-items-center"> <span id="sp_Encrypt" class="font-weight-500 font-18">Encrypt</span> <a href="javascript:;" id="clipboardCopy" style="cursor:pointer;"><i class="la la-copy"></i></a></div></li><li class="card-body"> <div> <input type="text" class="alert alert-danger mb-0 py-1 d-flex align-items-center px-10 w-100 text-truncate" style="box-shadow: none;outline:none;" id="clipBoardText" value="" readonly=""> </div></li></ul> </li></ul> </div>';
- $("." + containerid).append(html);
- $("#cmb_isencrypt").prop("checked", true);
- }
- static Instance() {
- if (this.instance === null || this.instance === undefined)
- this.instance = new Crypto();
- return this.instance;
- }
- }
- Components.Crypto = Crypto;
- })(Components = Crypto_1.Components || (Crypto_1.Components = {}));
- })(Crypto = Platform.Crypto || (Platform.Crypto = {}));
- })(Platform = Unibase.Platform || (Unibase.Platform = {}));
- })(Unibase || (Unibase = {}));
|