|
116 | 116 | methods: { |
117 | 117 | // drawer event handlers |
118 | 118 | onConsentCheckbox: function(ev) { |
119 | | - ev.links = { |
120 | | - "link": [ |
121 | | - { |
122 | | - "text": "Terms and Conditions", |
123 | | - "link": "https://termsandconditions.com", |
124 | | - "textValue": "Terms and Conditions", |
125 | | - "linkValue": "https://termsandconditions.com" |
126 | | - }, |
127 | | - { |
128 | | - "text": "Privacy Policy", |
129 | | - "link": "https://privacyPolicy.com", |
130 | | - "textValue": "Privacy Policy", |
131 | | - "linkValue": "https://privacyPolicy.com" |
132 | | - } |
133 | | - ], |
134 | | - "finalText": "I agree to the Terms and Conditions and Privacy Policy." |
135 | | - |
136 | | - }; |
| 119 | + if (!ev.links || ev.links.length < 1) { |
| 120 | + ev.links = { |
| 121 | + "link": [ |
| 122 | + { |
| 123 | + "text": "Terms and Conditions", |
| 124 | + "link": "https://termsandconditions.com", |
| 125 | + "textValue": "Terms and Conditions", |
| 126 | + "linkValue": "https://termsandconditions.com" |
| 127 | + }, |
| 128 | + { |
| 129 | + "text": "Privacy Policy", |
| 130 | + "link": "https://privacyPolicy.com", |
| 131 | + "textValue": "Privacy Policy", |
| 132 | + "linkValue": "https://privacyPolicy.com" |
| 133 | + } |
| 134 | + ], |
| 135 | + "finalText": "I agree to the Terms and Conditions and Privacy Policy.", |
| 136 | + }; |
| 137 | + } |
137 | 138 | }, |
138 | 139 | finalTxt: function(links) { |
139 | 140 | let finalText = links.finalText; |
|
222 | 223 | onOpen: function() { |
223 | 224 | var self = this; |
224 | 225 | var loadImage = new Image(); |
225 | | - if (this.controls.initialEditedObject.consent === true || this.controls.initialEditedObject.consent === "true") { |
226 | | - this.controls.initialEditedObject.consent = true; |
227 | | - this.consent = true; |
228 | | - } |
229 | | - else { |
230 | | - this.controls.initialEditedObject.consent = false; |
231 | | - } |
232 | | - if (Array.isArray(this.controls.initialEditedObject.links)) { |
233 | | - this.controls.initialEditedObject.links.forEach(function(link) { |
234 | | - if (link.linkValue.indexOf('term')) { |
235 | | - link.text = "Terms and Conditions"; |
236 | | - link.link = "https://termsandconditions.com"; |
237 | | - } |
238 | | - else if (link.linkValue.indexOf('privacy')) { |
239 | | - link.text = "Privacy Policy"; |
240 | | - link.link = "https://privacyPolicy.com"; |
241 | | - } |
242 | | - else { |
243 | | - link.text = "Another Link"; |
244 | | - link.link = "https://otherlink.com"; |
245 | | - } |
246 | | - link.linkValue = link.linkValue.replace(new RegExp('[?&]' + CLY_X_INT + '=[^&]*'), '').replace(/[?&]$/, ''); |
247 | | - }); |
248 | | - this.controls.initialEditedObject.links = {"link": this.controls.initialEditedObject.links, "finalText": this.controls.initialEditedObject.finalText}; |
249 | | - } |
| 226 | + |
250 | 227 | if (this.controls.initialEditedObject.logo) { |
251 | 228 |
|
252 | 229 | if (this.controls.initialEditedObject.logo.indexOf("feedback_logo") > -1 |
|
806 | 783 | } |
807 | 784 | } |
808 | 785 | this.openDrawer("widget", { |
809 | | - links: { |
810 | | - "link": [ |
811 | | - { |
812 | | - "text": "Terms and Conditions", |
813 | | - "link": "https://termsandconditions.com", |
814 | | - "textValue": "Terms and Conditions", |
815 | | - "linkValue": "https://termsandconditions.com" |
816 | | - }, |
817 | | - { |
818 | | - "text": "Privacy Policy", |
819 | | - "link": "https://privacyPolicy.com", |
820 | | - "textValue": "Privacy Policy", |
821 | | - "linkValue": "https://privacyPolicy.com" |
822 | | - } |
823 | | - ], |
824 | | - "finalText": "I agree to the Terms and Conditions and Privacy Policy." |
825 | | - |
826 | | - }, |
827 | 786 | consent: false, |
828 | 787 | popup_header_text: 'What\'s your opinion about this page?', |
829 | 788 | popup_thanks_message: 'Thanks for your feedback!', |
|
1145 | 1104 | steps: null |
1146 | 1105 | }; |
1147 | 1106 | } |
| 1107 | + |
| 1108 | + if (this.widget.consent === true || this.widget.consent === "true") { |
| 1109 | + this.widget.consent = true; |
| 1110 | + } |
| 1111 | + else { |
| 1112 | + this.widget.consent = false; |
| 1113 | + } |
| 1114 | + |
1148 | 1115 | if (Array.isArray(this.widget.links) && this.widget.links.length) { |
1149 | 1116 | this.widget.links.forEach(function(link) { |
1150 | 1117 | if (link.linkValue.indexOf('term')) { |
|
1162 | 1129 | link.linkValue = link.linkValue.replace(new RegExp('[?&]' + CLY_X_INT + '=[^&]*'), '').replace(/[?&]$/, ''); |
1163 | 1130 | }); |
1164 | 1131 | this.widget.links = {"link": this.widget.links, "finalText": this.widget.finalText}; |
1165 | | - this.widget.consent = true; |
1166 | 1132 | } |
1167 | 1133 | else { |
1168 | 1134 | this.widget.links = { |
|
1183 | 1149 | "finalText": "I agree to the Terms and Conditions and Privacy Policy." |
1184 | 1150 |
|
1185 | 1151 | }; |
1186 | | - this.widget.consent = false; |
1187 | 1152 | } |
| 1153 | + |
1188 | 1154 | if (!this.widget.rating_symbol) { |
1189 | 1155 | this.widget.rating_symbol = "emojis"; |
1190 | 1156 | } |
|
0 commit comments