1class redturtlechefcookie extends chefcookie { 2 showSettings() { 3 this.logTracking("settings_open"); 4 let el = document.querySelector(".chefcookie__settings-container"); 5 el.classList.add("chefcookie__settings-container--visible"); 6 el.style.minHeight = el.scrollHeight + "px"; 7 setTimeout(() => { 8 if (el.classList.contains("chefcookie__settings-container--visible")) { 9 el.style.height = "auto"; 10 } 11 el.focus(); 12 }, this.animationSpeed); 13 this.fixMaxHeight(); 14 } 15 acceptAllScripts() { 16 let providers = []; 17 this.config.settings.forEach((settings__value) => { 18 if (settings__value.scripts !== undefined) { 19 Object.entries(settings__value.scripts).forEach( 20 ([scripts__key, scripts__value]) => { 21 this.accept(scripts__key, false); 22 } 23 ); 24 } 25 }); 26 } 27 switchSettingsLabelsOpen() { 28 document.querySelector(".chefcookie__button--accept").style.display = 29 "block"; 30 document.querySelector(".chefcookie__button--settings").style.display = 31 "none"; 32 } 33 buildDom() { 34 document.body.insertAdjacentHTML( 35 "afterbegin", 36 ` 37 <div id="cc-banner" class="chefcookie chefcookie--${ 38 this.config.style.layout 39 } chefcookie--columns-${ 40 "columns" in this.config.style ? this.config.style.columns : "auto" 41 }${ 42 "scripts_selection" in this.config && 43 this.config.scripts_selection !== false 44 ? ` chefcookie--has-scripts` 45 : `` 46 } chefcookie--hidden"> 47 <div class="chefcookie__inner"> 48 <div class="chefcookie__box"> 49 50 <a data-cc-destroy href="#" class="close" title="${this.getLabel( 51 "close" 52 )}"></a> 53 54 <div class="chefcookie__message">${this.translate( 55 this.config.message 56 )}</div> 57 <div class="chefcookie__settings-container" id="chefcookie__settings" tabindex="0"> 58 <ul class="chefcookie__groups chefcookie__groups--count-${ 59 this.config.settings.length 60 }"> 61 ${this.config.settings 62 .map( 63 (group, i) => ` 64 <li class="chefcookie__group${ 65 group.cannot_be_modified 66 ? ` chefcookie__group--disabled` 67 : `` 68 }"> 69 <div class="chefcookie__group_wrapper"> 70 ${ 71 "scripts_selection" in 72 this.config && 73 this.config.scripts_selection === 74 "collapse" && 75 "scripts" in group && 76 Object.keys(group.scripts).length > 77 0 && 78 Object.keys( 79 group.scripts 80 )[0].indexOf("dummy_") === -1 81 ? ` 82 <a href="#" class="chefcookie__group-collapse">${ 83 this.getLabel( 84 "group_open" 85 ) != "" 86 ? this.getLabel( 87 "group_open" 88 ) 89 : this.getLabel( 90 "settings_open" 91 ) 92 }</a> 93 ` 94 : `` 95 } 96 <label class="chefcookie__group-label" for="chefcookie_group_${i}"> 97 <h3 class="chefcookie__group-label-text"> 98 ${this.translate(group.title)} 99 </h3>
100 <span class="show-info" aria-controls="chefcookie_group_${i}_description"> 101 102 ${ 103 "description" in group && 104 group.description != "" 105 ? ` 106 <span class="chefcookie__group-description" id="chefcookie_group_${i}_description">${this.translate( 107 group.description 108 )}</span> 109 ` 110 : `` 111 } 112 </span> 113 114 <input${ 115 group.cannot_be_modified 116 ? ` disabled="disabled"` 117 : `` 118 } class="chefcookie__group-checkbox" data-status="${this.isCheckboxActiveForGroup( 119 i 120 )}" id="chefcookie_group_${i}" type="checkbox" role="checkbox" aria-describedby="chefcookie_group_${i}_description" aria-checked="${ 121 this.isCheckboxActiveForGroup(i) === 2 122 ? "true" 123 : "false" 124 }" name="chefcookie_group[]" value="${i}"${ 125 this.isCheckboxActiveForGroup(i) === 2 126 ? ` checked="checked"` 127 : `` 128 } /> 129 <span class="chefcookie__group-checkbox-icon"></span> 130 </label> 131 132 133 134 135 </div> 136 137 ${ 138 "scripts_selection" in this.config && 139 this.config.scripts_selection !== 140 false && 141 "scripts" in group && 142 Object.keys(group.scripts).length > 143 0 && 144 Object.keys(group.scripts)[0].indexOf( 145 "dummy_" 146 ) === -1 147 ? ` 148 <ul class="chefcookie__scripts chefcookie__scripts--count-${ 149 Object.keys(group.scripts) 150 .length 151 }${ 152 this.config 153 .scripts_selection !== 154 "collapse" 155 ? ` chefcookie__scripts--visible` 156 : `` 157 }"> 158 ${Object.keys(group.scripts) 159 .map( 160 (j) => ` 161 <li class="chefcookie__script${ 162 group.cannot_be_modified 163 ? ` chefcookie__script--disabled` 164 : `` 165 }"> 166 <div class="chefcookie__script_wrapper"> 167 <label class="chefcookie__script-label" for="chefcookie_script_${i}_${j}"> 168 <input${ 169 group.cannot_be_modified 170 ? ` disabled="disabled"` 171 : `` 172 } class="chefcookie__script-checkbox" id="chefcookie_script_${i}_${j}" aria-describedby="chefcookie_script_${i}_${j}_description" type="checkbox" name="chefcookie_script[]" value="${i}|${j}"${ 173 this.isCheckboxActiveForProvider( 174 i, 175 j 176 ) 177 ? ` checked="checked"` 178 : `` 179 } /> 180 <sp
180an class="chefcookie__script-title">${ 181 typeof group 182 .scripts[ 183 j 184 ] === 185 "object" && 186 group 187 .scripts[ 188 j 189 ] !== 190 null && 191 "title" in 192 group 193 .scripts[ 194 j 195 ] && 196 group 197 .scripts[ 198 j 199 ].title != 200 "" 201 ? this.translate( 202 group 203 .scripts[ 204 j 205 ] 206 .title 207 ) 208 : j 209 }</span> 210 <span class="chefcookie__script-checkbox-icon"></span> 211 </label> 212 ${ 213 typeof group 214 .scripts[ 215 j 216 ] === 217 "object" && 218 group.scripts[ 219 j 220 ] !== null && 221 "description" in 222 group.scripts[ 223 j 224 ] && 225 group.scripts[j] 226 .description != 227 "" 228 ? '<div class="chefcookie__script-description">' + 229 '<a href="#" class="chefcookie__script-description-collapse" aria-hidden="true" aria-controls="chefcookie_script_' + 230 i + 231 "_" + 232 j + 233 '_description" aria-label="' + 234 this.getLabel( 235 "details_open" 236 ) + 237 '">' + 238 this.getLabel( 239 "details_open" 240 ) + 241 "</a>" + 242 '<div class="chefcookie__script-description-content" id="chefcookie_script_' + 243 i + 244 "_" + 245 j + 246 '_description">' + 247 this.translate( 248 group 249 .scripts[ 250 j 251 ] 252 .description 253 ) + 254 "</div>" + 255 "</div>" 256 : "" 257 } 258 </div> 259 </li> 260 ` 261 ) 262 .join("")} 263 </ul> 264 ` 265 : `` 266 } 267 268 </li> 269 ` 270 ) 271 .join("")} 272 </ul> 273 </div> 274 <div class="chefcookie__buttons chefcookie__buttons--count-${ 275 "show_decline_button" in this.config && 276 this.config.show_decline_button === true 277 ? "3" 278 : "2" 279 }"> 280 <a href="#chefcookie__decline" class="chefcookie__button chefcookie__button--decline" role="button">${this.getLabel( 281 "decline" 282 )}</a> 283 <a href="#chefcookie__accept_all" data-cc-accept-all class="chefcookie__button chefcookie__button--accept_all" role="button">${this.getLabel( 284 "accept_all" 285 )}</a> 286 ${ 287 "" 288 // <a href="#chefcookie__accept" class="chefcookie__button chefcookie__button--accept">${this.getLabel( 289 // this.config.accept_all_if_settings_closed === undefined || 290 // this.config.accept_all_if_settings_closed === false 291 // ? 'accept' 292 // : 'accept_all' 293 // )}</a> 294 } 295 <a href="#chefcookie__settings" class="chefcookie__button chefcookie__button--settings" aria-controls="chefcookie__settings" role="button">${this.getLabel( 296 "settings_open" 297 )}</a> 298 <a href="#chefcookie__accept" style="display:none" class="chefcookie__button chefcookie__button--accept" role="button">${this.getLabel( 299 "accept" 300 )}</a> 301 ${ 302 "" 303 // 'show_decline_button' in this.config && this.config.show_decline_button === true 304 // ? ` 305 // <a href="#chefcookie__decline" class="chefcookie__button chefcookie__button--decline">${this.getLabel( 306 // 'decline' 307 // )}</a> 308 // ` 309 // : '' 310 } 311 </div> 312 </div> 313 </div> 314 </div> 315 ` 316 ); 317 } 318}
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.