Built files from Bizgaze WebServer
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

filedragndrop.settings.js 5.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. var Unibase;
  2. (function (Unibase) {
  3. let Forms;
  4. (function (Forms) {
  5. let Controls;
  6. (function (Controls) {
  7. class FileDragNDrop_Settings {
  8. loadSettingHtml() {
  9. return ``;
  10. }
  11. bindControlData(controldatajson) {
  12. return "";
  13. }
  14. SaveControlData(controldatajson) {
  15. return "";
  16. }
  17. loadControlPropertiesHtml(Container) {
  18. var html = `<section class="">` +
  19. `<div class="card PropertySettings">` +
  20. `<div class="card-header"><h6><b>Property Settings</b></h6></div>` +
  21. `<div class="card-body" id="divPropSetting"><div class="row"><div class="col-sm-6 Controlproperties-Element" data-propertysettingid="0" data-controlpropertyid="0" data-controlpropertyname="IsMultiple"><label for="IsMultiple" style="margin-top:19px"><b>IsMultiple</b></label><label id="lblIsMultiple" class="switch m-t form-inline pull-right mt-10" style="color:grey"><input id="IsMultiple" data-group="IsRequired" type="checkbox"><span></span></label></div><div class="col-sm-6 Controlproperties-Element" data-propertysettingid="0" data-controlpropertyid="0" data-controlpropertyname="IsFileControl"><label for="IsFileControl" style="margin-top:19px"><b>IsFileControl</b></label><label id="lblIsFileControl" class="switch m-t form-inline pull-right mt-10" style="color:grey"><input id="IsFileControl" data-group="IsRequired" type="checkbox"><span></span></label></div></div>` +
  22. `<div class="row" id="divValidate"><div class="col-sm-6 Controlproperties-Element" data-propertysettingid="0" data-controlpropertyid="0" data-controlpropertyname="IsValidate"><label for="IsValidate" style="margin-top:19px"><b>IsValidate</b></label><label id="lblIsValidate" class="switch m-t form-inline pull-right mt-10" style="color:grey"><input id="IsValidate" data-group="IsRequired" type="checkbox"><span></span></label></div></div></div>` +
  23. `</div></section>`;
  24. $(Container).html(html);
  25. $("#divPropSetting").removeClass('hidden');
  26. }
  27. bindPropertySettings(prop) {
  28. var propertySettings = prop.PropertySettings;
  29. if (propertySettings != null && propertySettings != undefined) {
  30. var i = 0;
  31. $(".Controlproperties-Element").each(function () {
  32. var currentPropSetting = $(this).children().find("input").attr("id");
  33. var propSetting = propertySettings.find(x => x.ControlPropertyName == currentPropSetting);
  34. $(this).attr("data-controlpropertyid", propSetting.ControlPropertyId);
  35. $(this).attr("data-controlpropertyname", propSetting.ControlPropertyName);
  36. $(this).attr("data-propertysettingid", propSetting.PropertySettingId);
  37. if (currentPropSetting == "IsMultiple") {
  38. if (propSetting.ControlPropertyValue == "true") {
  39. $("#IsMultiple").prop("checked", true);
  40. }
  41. else {
  42. $("#IsMultiple").prop("checked", false);
  43. }
  44. }
  45. if (currentPropSetting == "IsFileControl") {
  46. if (propSetting.ControlPropertyValue == "true") {
  47. $("#IsFileControl").prop("checked", true);
  48. }
  49. else {
  50. $("#IsFileControl").prop("checked", false);
  51. }
  52. }
  53. if (currentPropSetting == "IsValidate") {
  54. if (propSetting.ControlPropertyValue == "true") {
  55. $("#IsValidate").prop("checked", true);
  56. }
  57. else {
  58. $("#IsValidate").prop("checked", false);
  59. }
  60. }
  61. i += 1;
  62. });
  63. }
  64. }
  65. savePropertySettings(prop) {
  66. var propertySettings = prop.PropertySettings;
  67. var propSettingReq = [];
  68. $(".Controlproperties-Element").each(function () {
  69. var data = {
  70. FormPropertyId: isNaN(Number(prop.FormPropertyId)) ? 0 : Number(prop.FormPropertyId),
  71. ControlPropertyId: Number($(this).attr("data-controlpropertyid")),
  72. ControlPropertyValue: $(this).children().find("input").prop("checked").toString(),
  73. ControlPropertyName: $(this).attr("data-controlpropertyname"),
  74. ControlId: isNaN(Number(prop.ControlId)) ? 0 : Number(prop.ControlId),
  75. PropertySettingId: Number($(this).attr("data-propertysettingid")),
  76. };
  77. propSettingReq.push(data);
  78. });
  79. return propSettingReq;
  80. }
  81. static Instance() {
  82. if (this._instance === undefined)
  83. this._instance = new FileDragNDrop_Settings();
  84. return this._instance;
  85. }
  86. }
  87. Controls.FileDragNDrop_Settings = FileDragNDrop_Settings;
  88. })(Controls = Forms.Controls || (Forms.Controls = {}));
  89. })(Forms = Unibase.Forms || (Unibase.Forms = {}));
  90. })(Unibase || (Unibase = {}));