1var __extends = (this && this.__extends) || (function () { 2 var extendStatics = function (d, b) { 3 extendStatics = Object.setPrototypeOf || 4 ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || 5 function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; 6 return extendStatics(d, b); 7 }; 8 return function (d, b) { 9 extendStatics(d, b); 10 function __() { this.constructor = d; } 11 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 12 }; 13})(); 14var SmartFormsFields; 15(function (SmartFormsFields) { 16 var rednaotermofservice = /** @class */ (function (_super) { 17 __extends(rednaotermofservice, _super); 18 function rednaotermofservice(options, serverOptions) { 19 var _this = _super.call(this, options, serverOptions) || this; 20 _this.IsDynamicField = true; 21 if (_this.IsNew) { 22 _this.Options.ClassName = 'rednaotermofservice'; 23 _this.Options.LinkType = "PopUp"; 24 _this.Options.PopUpTitle = "Term of service"; 25 _this.Options.PopUpText = "<p>Term of service content.</p>"; 26 _this.Options.LinkURL = ""; 27 _this.Options.Label = "Term of service"; 28 _this.Options.Text = "I agree to the $$Term of Services$$"; 29 _this.Options.CustomCSS = ''; 30 } 31 return _this; 32 } 33 rednaotermofservice.prototype.GetValueString = function () { 34 return { 35 LinkType: this.Options.LinkType, 36 PopUpText: this.Options.PopUpText, 37 PopUpTitle: this.Options.PopUpTitle, 38 Text: this.Options.Text 39 }; 40 }; 41 rednaotermofservice.prototype.StoresInformation = function () { 42 return true; 43 }; 44 rednaotermofservice.prototype.SetData = function (data) { 45 }; 46 rednaotermofservice.prototype.IsValid = function () { 47 if (!this.JQueryElement.find('.redNaoInputCheckBox').is(':checked')) 48 this.AddError('root', this.InvalidInputMessage); 49 else 50 this.RemoveError('root'); 51 return this.InternalIsValid(); 52 }; 53 rednaotermofservice.prototype.GenerationCompleted = function ($element) { 54 var _this = this; 55 var links = $element.find('a'); 56 if (smartFormsDesignMode) { 57 for (var _i = 0, links_1 = links; _i < links_1.length; _i++) { 58 var currentLink = links_1[_i]; 59 currentLink.addEventListener('click', function (e) { 60 e.preventDefault(); 61 }); 62 } 63 return; 64 } 65 for (var _a = 0, links_2 = links; _a < links_2.length; _a++) { 66 var currentLink = links_2[_a]; 67 if (this.Options.LinkType == "OpenLink") 68 return; 69 currentLink.setAttribute('target', '_blank'); 70 currentLink.addEventListener('click', function (e) { 71 e.preventDefault(); 72 var $dialog = rnJQuery("<div class=\"modal fade\" tabindex=\"-1\">\n <div class=\"modal-dialog\">\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <h4 style=\"display: inline\" class=\"modal-title\">" + RedNaoEscapeHtml(_this.Options.PopUpTitle) + "</h4>\n </div>\n <div class=\"modal-body\">\n " + _this.Options.PopUpText + "\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-success\">Close</button>\n </div>\n </div>\n </div>\n </div>"); 73 var container = rnJQuery('<div class="bootstrap-wrapper"></div>'); 74 container.append($dialog); 75 rnJQuery('body').append(container); 76 $dialog.modal('show'); 77 $dialog.on('hidden.bs.modal', function () { 78 $dialog.remove(); 79 }); 80 $dialog.find(".btn-success").click(function () { 81 $dialog.modal('hide'); 82 }); 83 }); 84 } 85 }; 86 rednaotermofservice.prototype.GenerateInlineElement = function () { 87 var id = this.Options.FormId + this.Id; 88 var label = ''; 89 var text = this.Options.Text; 90 var startIndex = text.indexOf('$$'); 91 var endIndex = 0; 92 if (startIndex >= 0) { 93 endIndex = text.indexOf('$$', startIndex + 2); 94 } 95 var textToReplace = ''; 96 if (endIndex >= 0) { 97 textToReplace = text.substring(startIndex, endIndex + 2); 98 }
99 if (textToReplace != '') { 100 var linkLabel = textToReplace.replace(/\$\$/g, ''); 101 var linkURL = '#'; 102 if (this.Options.LinkType == "OpenLink") 103 linkURL = this.Options.LinkURL; 104 var link = '<a target="_blank" href="' + linkURL + '">' + RedNaoEscapeHtml(linkLabel) + '</a>'; 105 text = text.replace(textToReplace, link); 106 } 107 if (this.Options.Label.trim() != '') 108 label = '<div class="rednao_label_container col-sm-3"><label class="rednao_control_label">' + RedNaoEscapeHtml(this.Options.Label) + '</label></div>'; 109 return label + "<div class=\"redNaoControls col-sm-9\"> \n <div class=\"checkbox-inline\" style=\"display: flex;align-items: center;\">\n <input type=\"checkbox\" class=\"redNaoInputCheckBox\" id=\"" + id + "\" name=\"" + this.Id + "\" value=\"1\"/>\n <label style=\"padding-left: 18px !important;margin:0\" class=\"redNaoCheckBox redNaoCheckBox-inline\" for=\"" + id + "\"> </label>\n <label style=\"margin:0\">" + text + "</label>\n </div>\n </div>"; 110 }; 111 rednaotermofservice.prototype.CreateProperties = function () { 112 var _this = this; 113 var properties = [ 114 new SimpleTextProperty(this, this.Options, "Label", "Label", { ManipulatorType: 'basic' }), 115 new SimpleTextProperty(this, this.Options, "Text", "Text", { ManipulatorType: 'basic', RefreshFormData: true, MultipleLine: true, Notes: 'Surround the link with <span style="color:red">$$</span> e.g. <span style="color:red">$$Term of Services$$</span>' }), 116 ]; 117 properties.push(new ComboBoxProperty(this, this.Options, "LinkType", "LinkType", { ManipulatorType: 'basic', 118 Values: [ 119 { label: 'Open Link', value: 'OpenLink' }, 120 { label: 'Popup', value: 'PopUp' } 121 ], 122 ChangeCallBack: function (newValue, oldValue) { 123 _this.Properties = []; 124 _this.CreateProperties(); 125 SmartFormsAddNewVar.FormBuilder.FillPropertiesPanel(_this); 126 } })); 127 if (this.Options.LinkType == "PopUp") { 128 properties.push(new SimpleTextProperty(this, this.Options, "PopUpTitle", "PopUp Title", { ManipulatorType: 'basic' })); 129 properties.push(new TinyMCEProperty(this, this.Options, "PopUpText", "PopUp Text", { ManipulatorType: 'basic' })); 130 } 131 else { 132 properties.push(new SimpleTextProperty(this, this.Options, "LinkURL", "Link URL", { ManipulatorType: 'basic' })); 133 } 134 this.Properties.push(new PropertyContainer('general', 'General').AddProperties(properties)); 135 this.Properties.push(new PropertyContainer('advanced', 'Advanced').AddProperties([ 136 new CustomCSSProperty(this, this.Options) 137 ])); 138 }; 139 return rednaotermofservice; 140 }(sfFormElementBase)); 141 SmartFormsFields.rednaotermofservice = rednaotermofservice; 142})(SmartFormsFields || (SmartFormsFields = {})); 143//# sourceMappingURL=rednaotermofservice.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.