Built files from Bizgaze WebServer
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

crypto.js 5.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. var Unibase;
  2. (function (Unibase) {
  3. let Platform;
  4. (function (Platform) {
  5. let Crypto;
  6. (function (Crypto_1) {
  7. let Components;
  8. (function (Components) {
  9. class Crypto extends Unibase.Platform.Core.BaseComponent {
  10. cssFiles() {
  11. return [];
  12. }
  13. jsFiles() {
  14. return ["platform/crypto/managers/cryptomanager.js"];
  15. }
  16. html(id, containerid) {
  17. var html = '';
  18. return html;
  19. }
  20. load(id, containerid, callback) {
  21. return;
  22. }
  23. init(containerid) {
  24. var instance = this;
  25. var jsFiles = ["platform/crypto/managers/cryptomanager.js"];
  26. instance.fileCacheHelper.loadJsFiles(jsFiles, function () {
  27. instance.loaddesign(containerid);
  28. $("#cardfooter").hide();
  29. $("#submit_btn1").click(function () {
  30. let inputstr = $('#txt_inputString').val();
  31. let secretkey = $('#txt_secretkey').val();
  32. var uniqueid = "";
  33. for (let obj of Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters) {
  34. if (obj.Key === "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_uniqueid") {
  35. uniqueid = obj.Value;
  36. }
  37. }
  38. instance.crypto(inputstr, uniqueid, secretkey, $('#cmb_isencrypt').is(":checked"));
  39. });
  40. $("#clipboardCopy").click(function () {
  41. $("#clipBoardText").select();
  42. document.execCommand("copy");
  43. });
  44. });
  45. }
  46. crypto(token, uniqueid, secretkey, isencrypt) {
  47. var postData = {
  48. token: token,
  49. uniqueid: uniqueid,
  50. secretkey: secretkey,
  51. isencrypt: isencrypt
  52. };
  53. Unibase.Platform.Crypto.Managers.CryptoManger.Instance().crypto(postData).then(function (response) {
  54. $("#cardfooter").show();
  55. response.result = JSON.parse(response.result);
  56. $('#clipBoardText').val(response.result.Result);
  57. });
  58. }
  59. loaddesign(containerid) {
  60. 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>';
  61. $("." + containerid).append(html);
  62. $("#cmb_isencrypt").prop("checked", true);
  63. }
  64. static Instance() {
  65. if (this.instance === null || this.instance === undefined)
  66. this.instance = new Crypto();
  67. return this.instance;
  68. }
  69. }
  70. Components.Crypto = Crypto;
  71. })(Components = Crypto_1.Components || (Crypto_1.Components = {}));
  72. })(Crypto = Platform.Crypto || (Platform.Crypto = {}));
  73. })(Platform = Unibase.Platform || (Unibase.Platform = {}));
  74. })(Unibase || (Unibase = {}));