Iniit
This commit is contained in:
@@ -0,0 +1,74 @@
|
||||
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 = {}));
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"crypto.js","sourceRoot":"","sources":["crypto.ts"],"names":[],"mappings":"AAAA,IAAU,OAAO,CAuFhB;AAvFD,WAAU,OAAO;IACb,IAAiB,QAAQ,CAqFxB;IArFD,WAAiB,QAAQ;QACrB,IAAiB,MAAM,CAmFtB;QAnFD,WAAiB,QAAM;YACnB,IAAiB,UAAU,CAgF1B;YAhFD,WAAiB,UAAU;gBACvB,MAAa,MAAO,SAAQ,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa;oBAE3D,QAAQ;wBACJ,OAAO,EAAE,CAAC;oBACd,CAAC;oBAED,OAAO;wBACH,OAAO,CAAC,2CAA2C,CAAC,CAAC;oBACzD,CAAC;oBACD,IAAI,CAAC,EAAO,EAAE,WAAmB;wBAC7B,IAAI,IAAI,GAAG,EAAE,CAAC;wBACd,OAAO,IAAI,CAAC;oBAEhB,CAAC;oBACD,IAAI,CAAC,EAAO,EAAE,WAAmB,EAAE,QAAkB;wBAEjD,OAAO;oBACX,CAAC;oBAED,IAAI,CAAC,WAAW;wBAEZ,IAAI,QAAQ,GAAG,IAAI,CAAC;wBACpB,IAAI,OAAO,GAAG,CAAC,2CAA2C,CAAC,CAAC;wBAC5D,QAAQ,CAAC,eAAe,CAAC,WAAW,CAAC,OAAO,EAAE;4BAC1C,QAAQ,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;4BACjC,CAAC,CAAC,aAAa,CAAC,CAAC,IAAI,EAAE,CAAC;4BACxB,CAAC,CAAC,cAAc,CAAC,CAAC,KAAK,CAAC;gCACpB,IAAI,QAAQ,GAAG,CAAC,CAAC,kBAAkB,CAAC,CAAC,GAAG,EAAE,CAAC;gCAC3C,IAAI,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AAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;4BAE9C,CAAC,CAAC,gBAAgB,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;wBACpD,CAAC,CAAC,CAAC;oBAEP,CAAC;oBAED,UAAU,CAAC,WAAW;wBAElB,IAAI,IAAI,GAAG,i9DAAi9D,CAAC;wBAE79D,CAAC,CAAC,GAAG,GAAG,WAAW,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;wBAElC,CAAC,CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;oBAC9C,CAAC;oBAED,MAAM,CAAC,QAAQ;wBACX,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS;4BACrD,IAAI,CAAC,QAAQ,GAAG,IAAI,MAAM,EAAE,CAAC;wBACjC,OAAO,IAAI,CAAC,QAAQ,CAAC;oBACzB,CAAC;iBACJ;gBA9EY,iBAAM,SA8ElB,CAAA;YACL,CAAC,EAhFgB,UAAU,GAAV,mBAAU,KAAV,mBAAU,QAgF1B;QAEL,CAAC,EAnFgB,MAAM,GAAN,eAAM,KAAN,eAAM,QAmFtB;IACL,CAAC,EArFgB,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAqFxB;AACL,CAAC,EAvFS,OAAO,KAAP,OAAO,QAuFhB"}
|
||||
+1
@@ -0,0 +1 @@
|
||||
var Unibase;(function(n){let t;(function(t){let i;(function(t){let i;(function(t){class i extends n.Platform.Core.BaseComponent{cssFiles(){return[]}jsFiles(){return["platform/crypto/managers/cryptomanager.js"]}html(){return""}load(){return}init(t){var i=this;i.fileCacheHelper.loadJsFiles(["platform/crypto/managers/cryptomanager.js"],function(){i.loaddesign(t);$("#cardfooter").hide();$("#submit_btn1").click(function(){let r=$("#txt_inputString").val(),u=$("#txt_secretkey").val();var t="";for(let i of n.Themes.Providers.Detail_Settings.Instance().InputParameters)i.Key==="hf_"+n.Themes.Providers.DetailHelper.installedAppId+"_uniqueid"&&(t=i.Value);i.crypto(r,t,u,$("#cmb_isencrypt").is(":checked"))});$("#clipboardCopy").click(function(){$("#clipBoardText").select();document.execCommand("copy")})})}crypto(t,i,r,u){var f={token:t,uniqueid:i,secretkey:r,isencrypt:u};n.Platform.Crypto.Managers.CryptoManger.Instance().crypto(f).then(function(n){$("#cardfooter").show();n.result=JSON.parse(n.result);$("#clipBoardText").val(n.result.Result)})}loaddesign(n){$("."+n).append(' <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>');$("#cmb_isencrypt").prop("checked",!0)}static Instance(){return(this.instance===null||this.instance===undefined)&&(this.instance=new i),this.instance}}t.Crypto=i})(i=t.Components||(t.Components={}))})(i=t.Crypto||(t.Crypto={}))})(t=n.Platform||(n.Platform={}))})(Unibase||(Unibase={}));
|
||||
Reference in New Issue
Block a user