Changeset 3310968
- Timestamp:
- 06/13/2025 09:49:55 AM (10 months ago)
- Location:
- cookie-optimizer
- Files:
-
- 7 edited
-
tags/1.0.1/app/Services/CookieOptBannerService.php (modified) (1 diff)
-
tags/1.0.1/app/Services/CookieOptPolicyServices.php (modified) (3 diffs)
-
tags/1.0.1/templates/cookie_policy/cookie-policy-page-for-render.php (modified) (4 diffs)
-
trunk/app/Services/CookieOptBannerService.php (modified) (1 diff)
-
trunk/app/Services/CookieOptPolicyServices.php (modified) (3 diffs)
-
trunk/public/build/assets/js/cookie-scan.js (modified) (1 diff)
-
trunk/templates/cookie_policy/cookie-policy-page-for-render.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
cookie-optimizer/tags/1.0.1/app/Services/CookieOptBannerService.php
r3301089 r3310968 47 47 $wpdb->query($wpdb->prepare("DELETE FROM {$this->table} WHERE type = %d", 0)); // phpcs:ignore WordPress.DB 48 48 foreach ($results->en as $result) { 49 $cookie['name'] = $result->name; 50 $cookie['categoryID'] = $this->checkCategory($result->purposeID); 51 $cookie['description'] = $result->cookieFunction; 52 $cookie['publisher'] = $result->service; 49 $category_id = $this->checkCategory($result->purposeID); 50 if (in_array($category_id, [1, 2, 3, 4])){ 51 $cookie['name'] = $result->name; 52 $cookie['categoryID'] = $this->checkCategory($result->purposeID); 53 $cookie['description'] = $result->cookieFunction; 54 $cookie['publisher'] = $result->service; 53 55 54 $wpdb->insert($this->table, $cookie); // phpcs:ignore WordPress.DB 56 $wpdb->insert($this->table, $cookie); // phpcs:ignore WordPress.DB 57 } 55 58 } 56 59 } -
cookie-optimizer/tags/1.0.1/app/Services/CookieOptPolicyServices.php
r3309701 r3310968 17 17 18 18 public $category_list = [ 19 0 => [],20 19 1 => [], 21 20 2 => [], 22 3 => [] 21 3 => [], 22 4 => [] 23 23 ]; 24 24 … … 107 107 $table_cookie_opt_Category = $wpdb->prefix . 'cookie_opt_cookie_category'; 108 108 $search_query = $search ? $wpdb->prepare(" WHERE cl.name LIKE '%%%s%%' ", $wpdb->esc_like($search)) : ''; // phpcs:ignore WordPress.DB 109 $items = $wpdb->get_results("SELECT cl.id,cl.categoryID AS category_id,cl.name,cl.publisher,cat.name AS category_name, cl.description FROM {$table_cookie_opt_CookieList} AS cl JOIN {$table_cookie_opt_Category} AS cat ON cl.categoryID = cat.id {$search_query}ORDER BY cl.id", ARRAY_A); // phpcs:ignore WordPress.DB109 $items = $wpdb->get_results("SELECT cl.id,cl.categoryID AS category_id,cl.name,cl.publisher,cat.name AS category_name, cl.description FROM {$table_cookie_opt_CookieList} AS cl JOIN {$table_cookie_opt_Category} AS cat ON cl.categoryID = cat.id ORDER BY cl.id", ARRAY_A); // phpcs:ignore WordPress.DB 110 110 111 111 $translations = ['category_name']; … … 117 117 } 118 118 } 119 120 119 return $items; 121 120 } -
cookie-optimizer/tags/1.0.1/templates/cookie_policy/cookie-policy-page-for-render.php
r3309701 r3310968 61 61 <?php echo esc_attr($textOther[$setLanguage]['necessary_cookies_title']); ?> 62 62 </h4> 63 <?php if (count($data[ 0]) !== 0): ?>64 <?php foreach ($data[ 0] as $cookie): ?>63 <?php if (count($data[1]) !== 0): ?> 64 <?php foreach ($data[1] as $cookie): ?> 65 65 <div> 66 66 <p class="coop-text__underline"> … … 92 92 </h4> 93 93 <div> 94 <?php if (count($data[ 1]) !== 0): ?>95 <?php foreach ($data[ 1] as $cookie): ?>94 <?php if (count($data[2]) !== 0): ?> 95 <?php foreach ($data[2] as $cookie): ?> 96 96 <div> 97 97 <p class="coop-text__underline"> … … 124 124 </h4> 125 125 <div> 126 <?php if (count($data[ 2]) !== 0): ?>127 <?php foreach ($data[ 2] as $cookie): ?>126 <?php if (count($data[3]) !== 0): ?> 127 <?php foreach ($data[3] as $cookie): ?> 128 128 <div> 129 129 <p class="coop-text__underline"> … … 156 156 </h4> 157 157 <div> 158 <?php if (count($data[ 3]) !== 0): ?>159 <?php foreach ($data[ 3] as $cookie): ?>158 <?php if (count($data[4]) !== 0): ?> 159 <?php foreach ($data[4] as $cookie): ?> 160 160 <div> 161 161 <p class="coop-text__underline"> -
cookie-optimizer/trunk/app/Services/CookieOptBannerService.php
r3301089 r3310968 47 47 $wpdb->query($wpdb->prepare("DELETE FROM {$this->table} WHERE type = %d", 0)); // phpcs:ignore WordPress.DB 48 48 foreach ($results->en as $result) { 49 $cookie['name'] = $result->name; 50 $cookie['categoryID'] = $this->checkCategory($result->purposeID); 51 $cookie['description'] = $result->cookieFunction; 52 $cookie['publisher'] = $result->service; 49 $category_id = $this->checkCategory($result->purposeID); 50 if (in_array($category_id, [1, 2, 3, 4])){ 51 $cookie['name'] = $result->name; 52 $cookie['categoryID'] = $this->checkCategory($result->purposeID); 53 $cookie['description'] = $result->cookieFunction; 54 $cookie['publisher'] = $result->service; 53 55 54 $wpdb->insert($this->table, $cookie); // phpcs:ignore WordPress.DB 56 $wpdb->insert($this->table, $cookie); // phpcs:ignore WordPress.DB 57 } 55 58 } 56 59 } -
cookie-optimizer/trunk/app/Services/CookieOptPolicyServices.php
r3309701 r3310968 17 17 18 18 public $category_list = [ 19 0 => [],20 19 1 => [], 21 20 2 => [], 22 3 => [] 21 3 => [], 22 4 => [] 23 23 ]; 24 24 … … 107 107 $table_cookie_opt_Category = $wpdb->prefix . 'cookie_opt_cookie_category'; 108 108 $search_query = $search ? $wpdb->prepare(" WHERE cl.name LIKE '%%%s%%' ", $wpdb->esc_like($search)) : ''; // phpcs:ignore WordPress.DB 109 $items = $wpdb->get_results("SELECT cl.id,cl.categoryID AS category_id,cl.name,cl.publisher,cat.name AS category_name, cl.description FROM {$table_cookie_opt_CookieList} AS cl JOIN {$table_cookie_opt_Category} AS cat ON cl.categoryID = cat.id {$search_query}ORDER BY cl.id", ARRAY_A); // phpcs:ignore WordPress.DB109 $items = $wpdb->get_results("SELECT cl.id,cl.categoryID AS category_id,cl.name,cl.publisher,cat.name AS category_name, cl.description FROM {$table_cookie_opt_CookieList} AS cl JOIN {$table_cookie_opt_Category} AS cat ON cl.categoryID = cat.id ORDER BY cl.id", ARRAY_A); // phpcs:ignore WordPress.DB 110 110 111 111 $translations = ['category_name']; … … 117 117 } 118 118 } 119 120 119 return $items; 121 120 } -
cookie-optimizer/trunk/public/build/assets/js/cookie-scan.js
r3309701 r3310968 1 var X={};(function(t){(function(){var e={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function n(u){return i(a(u),arguments)}function r(u,d){return n.apply(null,[u].concat(d||[]))}function i(u,d){var l=1,y=u.length,s,g="",_,m,f,k,S,A,F,c;for(_=0;_<y;_++)if(typeof u[_]=="string")g+=u[_];else if(typeof u[_]=="object"){if(f=u[_],f.keys)for(s=d[l],m=0;m<f.keys.length;m++){if(s==null)throw new Error(n('[sprintf] Cannot access property "%s" of undefined value "%s"',f.keys[m],f.keys[m-1]));s=s[f.keys[m]]}else f.param_no?s=d[f.param_no]:s=d[l++];if(e.not_type.test(f.type)&&e.not_primitive.test(f.type)&&s instanceof Function&&(s=s()),e.numeric_arg.test(f.type)&&typeof s!="number"&&isNaN(s))throw new TypeError(n("[sprintf] expecting number but found %T",s));switch(e.number.test(f.type)&&(F=s>=0),f.type){case"b":s=parseInt(s,10).toString(2);break;case"c":s=String.fromCharCode(parseInt(s,10));break;case"d":case"i":s=parseInt(s,10);break;case"j":s=JSON.stringify(s,null,f.width?parseInt(f.width):0);break;case"e":s=f.precision?parseFloat(s).toExponential(f.precision):parseFloat(s).toExponential();break;case"f":s=f.precision?parseFloat(s).toFixed(f.precision):parseFloat(s);break;case"g":s=f.precision?String(Number(s.toPrecision(f.precision))):parseFloat(s);break;case"o":s=(parseInt(s,10)>>>0).toString(8);break;case"s":s=String(s),s=f.precision?s.substring(0,f.precision):s;break;case"t":s=String(!!s),s=f.precision?s.substring(0,f.precision):s;break;case"T":s=Object.prototype.toString.call(s).slice(8,-1).toLowerCase(),s=f.precision?s.substring(0,f.precision):s;break;case"u":s=parseInt(s,10)>>>0;break;case"v":s=s.valueOf(),s=f.precision?s.substring(0,f.precision):s;break;case"x":s=(parseInt(s,10)>>>0).toString(16);break;case"X":s=(parseInt(s,10)>>>0).toString(16).toUpperCase();break}e.json.test(f.type)?g+=s:(e.number.test(f.type)&&(!F||f.sign)?(c=F?"+":"-",s=s.toString().replace(e.sign,"")):c="",S=f.pad_char?f.pad_char==="0"?"0":f.pad_char.charAt(1):" ",A=f.width-(c+s).length,k=f.width&&A>0?S.repeat(A):"",g+=f.align?c+s+k:S==="0"?c+k+s:k+c+s)}return g}var o=Object.create(null);function a(u){if(o[u])return o[u];for(var d=u,l,y=[],s=0;d;){if((l=e.text.exec(d))!==null)y.push(l[0]);else if((l=e.modulo.exec(d))!==null)y.push("%");else if((l=e.placeholder.exec(d))!==null){if(l[2]){s|=1;var g=[],_=l[2],m=[];if((m=e.key.exec(_))!==null)for(g.push(m[1]);(_=_.substring(m[0].length))!=="";)if((m=e.key_access.exec(_))!==null)g.push(m[1]);else if((m=e.index_access.exec(_))!==null)g.push(m[1]);else throw new SyntaxError("[sprintf] failed to parse named argument key");else throw new SyntaxError("[sprintf] failed to parse named argument key");l[2]=g}else s|=2;if(s===3)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");y.push({placeholder:l[0],param_no:l[1],keys:l[2],sign:l[3],pad_char:l[4],align:l[5],width:l[6],precision:l[7],type:l[8]})}else throw new SyntaxError("[sprintf] unexpected placeholder");d=d.substring(l[0].length)}return o[u]=y}t.sprintf=n,t.vsprintf=r,typeof window<"u"&&(window.sprintf=n,window.vsprintf=r)})()})(X);var R,U,T,K;R={"(":9,"!":8,"*":7,"/":7,"%":7,"+":6,"-":6,"<":5,"<=":5,">":5,">=":5,"==":4,"!=":4,"&&":3,"||":2,"?":1,"?:":1};U=["(","?"];T={")":["("],":":["?","?:"]};K=/<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;function Z(t){for(var e=[],n=[],r,i,o,a;r=t.match(K);){for(i=r[0],o=t.substr(0,r.index).trim(),o&&e.push(o);a=n.pop();){if(T[i]){if(T[i][0]===a){i=T[i][1]||i;break}}else if(U.indexOf(a)>=0||R[a]<R[i]){n.push(a);break}e.push(a)}T[i]||n.push(i),t=t.substr(r.index+i.length)}return t=t.trim(),t&&e.push(t),e.concat(n.reverse())}var B={"!":function(t){return!t},"*":function(t,e){return t*e},"/":function(t,e){return t/e},"%":function(t,e){return t%e},"+":function(t,e){return t+e},"-":function(t,e){return t-e},"<":function(t,e){return t<e},"<=":function(t,e){return t<=e},">":function(t,e){return t>e},">=":function(t,e){return t>=e},"==":function(t,e){return t===e},"!=":function(t,e){return t!==e},"&&":function(t,e){return t&&e},"||":function(t,e){return t||e},"?:":function(t,e,n){if(t)throw e;return n}};function q(t,e){var n=[],r,i,o,a,u,d;for(r=0;r<t.length;r++){if(u=t[r],a=B[u],a){for(i=a.length,o=Array(i);i--;)o[i]=n.pop();try{d=a.apply(null,o)}catch(l){return l}}else e.hasOwnProperty(u)?d=e[u]:d=+u;n.push(d)}return n[0]}function G(t){var e=Z(t);return function(n){return q(e,n)}}function J(t){var e=G(t);return function(n){return+e({n})}}var D={contextDelimiter:"",onMissingKey:null};function W(t){var e,n,r;for(e=t.split(";"),n=0;n<e.length;n++)if(r=e[n].trim(),r.indexOf("plural=")===0)return r.substr(7)}function O(t,e){var n;this.data=t,this.pluralForms={},this.options={};for(n in D)this.options[n]=e!==void 0&&n in e?e[n]:D[n]}O.prototype.getPluralForm=function(t,e){var n=this.pluralForms[t],r,i,o;return n||(r=this.data[t][""],o=r["Plural-Forms"]||r["plural-forms"]||r.plural_forms,typeof o!="function"&&(i=W(r["Plural-Forms"]||r["plural-forms"]||r.plural_forms),o=J(i)),n=this.pluralForms[t]=o),n(e)};O.prototype.dcnpgettext=function(t,e,n,r,i){var o,a,u;return i===void 0?o=0:o=this.getPluralForm(t,i),a=n,e&&(a=e+this.options.contextDelimiter+n),u=this.data[t][a],u&&u[o]?u[o]:(this.options.onMissingKey&&this.options.onMissingKey(n,t),o===0?n:r)};const C={"":{plural_forms(t){return t===1?0:1}}},V=/^i18n\.(n?gettext|has_translation)(_|$)/,Y=(t,e,n)=>{const r=new O({}),i=new Set,o=()=>{i.forEach(c=>c())},a=c=>(i.add(c),()=>i.delete(c)),u=(c="default")=>r.data[c],d=(c,p="default")=>{var h;r.data[p]={...r.data[p],...c},r.data[p][""]={...C[""],...(h=r.data[p])==null?void 0:h[""]},delete r.pluralForms[p]},l=(c,p)=>{d(c,p),o()},y=(c,p="default")=>{var h;r.data[p]={...r.data[p],...c,"":{...C[""],...(h=r.data[p])==null?void 0:h[""],...c==null?void 0:c[""]}},delete r.pluralForms[p],o()},s=(c,p)=>{r.data={},r.pluralForms={},l(c,p)},g=(c="default",p,h,x,v)=>(r.data[c]||d(void 0,c),r.dcnpgettext(c,p,h,x,v)),_=(c="default")=>c,m=(c,p)=>{let h=g(p,void 0,c);return n?(h=n.applyFilters("i18n.gettext",h,c,p),n.applyFilters("i18n.gettext_"+_(p),h,c,p)):h},f=(c,p,h)=>{let x=g(h,p,c);return n?(x=n.applyFilters("i18n.gettext_with_context",x,c,p,h),n.applyFilters("i18n.gettext_with_context_"+_(h),x,c,p,h)):x},k=(c,p,h,x)=>{let v=g(x,void 0,c,p,h);return n?(v=n.applyFilters("i18n.ngettext",v,c,p,h,x),n.applyFilters("i18n.ngettext_"+_(x),v,c,p,h,x)):v},S=(c,p,h,x,v)=>{let w=g(v,x,c,p,h);return n?(w=n.applyFilters("i18n.ngettext_with_context",w,c,p,h,x,v),n.applyFilters("i18n.ngettext_with_context_"+_(v),w,c,p,h,x,v)):w},A=()=>f("ltr","text direction")==="rtl",F=(c,p,h)=>{var w,H;const x=p?p+""+c:c;let v=!!((H=(w=r.data)==null?void 0:w[h??"default"])!=null&&H[x]);return n&&(v=n.applyFilters("i18n.has_translation",v,c,p,h),v=n.applyFilters("i18n.has_translation_"+_(h),v,c,p,h)),v};if(n){const c=p=>{V.test(p)&&o()};n.addAction("hookAdded","core/i18n",c),n.addAction("hookRemoved","core/i18n",c)}return{getLocaleData:u,setLocaleData:l,addLocaleData:y,resetLocaleData:s,subscribe:a,__:m,_x:f,_n:k,_nx:S,isRTL:A,hasTranslation:F}};function M(t){return typeof t!="string"||t===""?(console.error("The namespace must be a non-empty string."),!1):/^[a-zA-Z][a-zA-Z0-9_.\-\/]*$/.test(t)?!0:(console.error("The namespace can only contain numbers, letters, dashes, periods, underscores and slashes."),!1)}function j(t){return typeof t!="string"||t===""?(console.error("The hook name must be a non-empty string."),!1):/^__/.test(t)?(console.error("The hook name cannot begin with `__`."),!1):/^[a-zA-Z][a-zA-Z0-9_.-]*$/.test(t)?!0:(console.error("The hook name can only contain numbers, letters, dashes, periods and underscores."),!1)}function P(t,e){return function(r,i,o,a=10){const u=t[e];if(!j(r)||!M(i))return;if(typeof o!="function"){console.error("The hook callback must be a function.");return}if(typeof a!="number"){console.error("If specified, the hook priority must be a number.");return}const d={callback:o,priority:a,namespace:i};if(u[r]){const l=u[r].handlers;let y;for(y=l.length;y>0&&!(a>=l[y-1].priority);y--);y===l.length?l[y]=d:l.splice(y,0,d),u.__current.forEach(s=>{s.name===r&&s.currentIndex>=y&&s.currentIndex++})}else u[r]={handlers:[d],runs:0};r!=="hookAdded"&&t.doAction("hookAdded",r,i,o,a)}}function I(t,e,n=!1){return function(i,o){const a=t[e];if(!j(i)||!n&&!M(o))return;if(!a[i])return 0;let u=0;if(n)u=a[i].handlers.length,a[i]={runs:a[i].runs,handlers:[]};else{const d=a[i].handlers;for(let l=d.length-1;l>=0;l--)d[l].namespace===o&&(d.splice(l,1),u++,a.__current.forEach(y=>{y.name===i&&y.currentIndex>=l&&y.currentIndex--}))}return i!=="hookRemoved"&&t.doAction("hookRemoved",i,o),u}}function L(t,e){return function(r,i){const o=t[e];return typeof i<"u"?r in o&&o[r].handlers.some(a=>a.namespace===i):r in o}}function E(t,e,n,r){return function(o,...a){const u=t[e];u[o]||(u[o]={handlers:[],runs:0}),u[o].runs++;const d=u[o].handlers;if(!d||!d.length)return n?a[0]:void 0;const l={name:o,currentIndex:0};async function y(){try{u.__current.add(l);let g=n?a[0]:void 0;for(;l.currentIndex<d.length;)g=await d[l.currentIndex].callback.apply(null,a),n&&(a[0]=g),l.currentIndex++;return n?g:void 0}finally{u.__current.delete(l)}}function s(){try{u.__current.add(l);let g=n?a[0]:void 0;for(;l.currentIndex<d.length;)g=d[l.currentIndex].callback.apply(null,a),n&&(a[0]=g),l.currentIndex++;return n?g:void 0}finally{u.__current.delete(l)}}return(r?y:s)()}}function $(t,e){return function(){var a;var r;const i=t[e];return(r=(a=Array.from(i.__current).at(-1))==null?void 0:a.name)!==null&&r!==void 0?r:null}}function z(t,e){return function(r){const i=t[e];return typeof r>"u"?i.__current.size>0:Array.from(i.__current).some(o=>o.name===r)}}function Q(t,e){return function(r){const i=t[e];if(j(r))return i[r]&&i[r].runs?i[r].runs:0}}class N{constructor(){this.actions=Object.create(null),this.actions.__current=new Set,this.filters=Object.create(null),this.filters.__current=new Set,this.addAction=P(this,"actions"),this.addFilter=P(this,"filters"),this.removeAction=I(this,"actions"),this.removeFilter=I(this,"filters"),this.hasAction=L(this,"actions"),this.hasFilter=L(this,"filters"),this.removeAllActions=I(this,"actions",!0),this.removeAllFilters=I(this,"filters",!0),this.doAction=E(this,"actions",!1,!1),this.doActionAsync=E(this,"actions",!1,!0),this.applyFilters=E(this,"filters",!0,!1),this.applyFiltersAsync=E(this,"filters",!0,!0),this.currentAction=$(this,"actions"),this.currentFilter=$(this,"filters"),this.doingAction=z(this,"actions"),this.doingFilter=z(this,"filters"),this.didAction=Q(this,"actions"),this.didFilter=Q(this,"filters")}}function tt(){return new N}const et=tt(),b=Y(void 0,void 0,et);b.getLocaleData.bind(b);b.setLocaleData.bind(b);b.resetLocaleData.bind(b);b.subscribe.bind(b);b.__.bind(b);b._x.bind(b);b._n.bind(b);b._nx.bind(b);b.isRTL.bind(b);b.hasTranslation.bind(b);const nt=async(t,e)=>{await jQuery.ajax({type:"POST",url:ajaxurl,data:{action:"get_cookie",data:t,nonce_action:e},success:function(n){},error:function(n){}})},rt=()=>{const t=document.cookie.split(";"),e={};for(const n of t){const r=n.split("="),i=r[0].trim(),o=r.length>1?r[1].trim():"";try{e[i]=decodeURIComponent(o)}catch{continue}}for(let n=0;n<sessionStorage.length;n++){const r=sessionStorage.key(n),i=sessionStorage.getItem(r);try{e[r]=decodeURIComponent(i)}catch{continue}}for(let n=0;n<localStorage.length;n++){const r=localStorage.key(n),i=localStorage.getItem(r);try{e[r]=decodeURIComponent(i)}catch{continue}}return e},st=async(t,e,n=null,r=null)=>{let i=Object.keys(e).length,o=Object.keys(e),a=i;r&&r.empty();for(let u=1;u<=a;u++){await new Promise(l=>setTimeout(l,500));const d=u/a*100;t.css("--progress-width",d+"%"),n&&n.text(u),r&&r.append(`<span>${o[u-1]}</span>`)}},it=(t,e,n=null)=>{cons ole.log(n);const r={progress:{message:t==="progress"?e??"Scan in progress...":"Scan in progress...",autoClose:!0,duration:3e3},success:{title:t==="success"?e??"Cookies scan complete":"Cookies scan complete",message:n??"Scanned cookies are automatically added to the cookie list.",buttonText:"OK",autoClose:!1}},i=typeof t=="string"?r[t]||{}:{...r[t.type]||{},...t},o=jQuery("<div></div>").css({position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)",backgroundColor:"#fff",textAlign:"center",color:"#000",padding:i.title?"0 24px 24px 24px":"24px",border:"1px solid #ccc",borderRadius:"6px",boxShadow:"0 4px 20px rgba(0,0,0,0.3)",fontSize:"16px",zIndex:1e4,maxWidth:"400px",width:"90%",opacity:0,transition:"opacity 0.3s ease"});if(i.title){const a=jQuery("<h3></h3>").text(i.title).css("margin-bottom","12px");o.append(a)}if(i.message){const a=jQuery("<p></p>").text(i.message);i.title&&a.css("margin-bottom","12px"),o.append(a)}if(i.buttonText){const a=jQuery("<button></button>").text(i.buttonText).css({marginTop:"20px",backgroundColor:"#135e96",color:"#fff",width:"100%",borderRadius:"6px",padding:"6px 12px",cursor:"pointer"});a.on("click",function(){o.css("opacity",0),setTimeout(()=>o.remove(),300)}),o.append(a)}jQuery("body").append(o),requestAnimationFrame(()=>{o.css("opacity",1)}),i.autoClose&&setTimeout(()=>{o.css("opacity",0),setTimeout(()=>o.remove(),300)},i.duration||3e3)},ot={getAllCookies:rt,sendDataCookie:nt,simulateTask:st,createAlertBox:it};export{ot as c};1 var X={};(function(t){(function(){var e={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function n(u){return i(a(u),arguments)}function r(u,d){return n.apply(null,[u].concat(d||[]))}function i(u,d){var l=1,y=u.length,s,g="",_,m,f,k,S,A,F,c;for(_=0;_<y;_++)if(typeof u[_]=="string")g+=u[_];else if(typeof u[_]=="object"){if(f=u[_],f.keys)for(s=d[l],m=0;m<f.keys.length;m++){if(s==null)throw new Error(n('[sprintf] Cannot access property "%s" of undefined value "%s"',f.keys[m],f.keys[m-1]));s=s[f.keys[m]]}else f.param_no?s=d[f.param_no]:s=d[l++];if(e.not_type.test(f.type)&&e.not_primitive.test(f.type)&&s instanceof Function&&(s=s()),e.numeric_arg.test(f.type)&&typeof s!="number"&&isNaN(s))throw new TypeError(n("[sprintf] expecting number but found %T",s));switch(e.number.test(f.type)&&(F=s>=0),f.type){case"b":s=parseInt(s,10).toString(2);break;case"c":s=String.fromCharCode(parseInt(s,10));break;case"d":case"i":s=parseInt(s,10);break;case"j":s=JSON.stringify(s,null,f.width?parseInt(f.width):0);break;case"e":s=f.precision?parseFloat(s).toExponential(f.precision):parseFloat(s).toExponential();break;case"f":s=f.precision?parseFloat(s).toFixed(f.precision):parseFloat(s);break;case"g":s=f.precision?String(Number(s.toPrecision(f.precision))):parseFloat(s);break;case"o":s=(parseInt(s,10)>>>0).toString(8);break;case"s":s=String(s),s=f.precision?s.substring(0,f.precision):s;break;case"t":s=String(!!s),s=f.precision?s.substring(0,f.precision):s;break;case"T":s=Object.prototype.toString.call(s).slice(8,-1).toLowerCase(),s=f.precision?s.substring(0,f.precision):s;break;case"u":s=parseInt(s,10)>>>0;break;case"v":s=s.valueOf(),s=f.precision?s.substring(0,f.precision):s;break;case"x":s=(parseInt(s,10)>>>0).toString(16);break;case"X":s=(parseInt(s,10)>>>0).toString(16).toUpperCase();break}e.json.test(f.type)?g+=s:(e.number.test(f.type)&&(!F||f.sign)?(c=F?"+":"-",s=s.toString().replace(e.sign,"")):c="",S=f.pad_char?f.pad_char==="0"?"0":f.pad_char.charAt(1):" ",A=f.width-(c+s).length,k=f.width&&A>0?S.repeat(A):"",g+=f.align?c+s+k:S==="0"?c+k+s:k+c+s)}return g}var o=Object.create(null);function a(u){if(o[u])return o[u];for(var d=u,l,y=[],s=0;d;){if((l=e.text.exec(d))!==null)y.push(l[0]);else if((l=e.modulo.exec(d))!==null)y.push("%");else if((l=e.placeholder.exec(d))!==null){if(l[2]){s|=1;var g=[],_=l[2],m=[];if((m=e.key.exec(_))!==null)for(g.push(m[1]);(_=_.substring(m[0].length))!=="";)if((m=e.key_access.exec(_))!==null)g.push(m[1]);else if((m=e.index_access.exec(_))!==null)g.push(m[1]);else throw new SyntaxError("[sprintf] failed to parse named argument key");else throw new SyntaxError("[sprintf] failed to parse named argument key");l[2]=g}else s|=2;if(s===3)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");y.push({placeholder:l[0],param_no:l[1],keys:l[2],sign:l[3],pad_char:l[4],align:l[5],width:l[6],precision:l[7],type:l[8]})}else throw new SyntaxError("[sprintf] unexpected placeholder");d=d.substring(l[0].length)}return o[u]=y}t.sprintf=n,t.vsprintf=r,typeof window<"u"&&(window.sprintf=n,window.vsprintf=r)})()})(X);var R,U,T,K;R={"(":9,"!":8,"*":7,"/":7,"%":7,"+":6,"-":6,"<":5,"<=":5,">":5,">=":5,"==":4,"!=":4,"&&":3,"||":2,"?":1,"?:":1};U=["(","?"];T={")":["("],":":["?","?:"]};K=/<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;function Z(t){for(var e=[],n=[],r,i,o,a;r=t.match(K);){for(i=r[0],o=t.substr(0,r.index).trim(),o&&e.push(o);a=n.pop();){if(T[i]){if(T[i][0]===a){i=T[i][1]||i;break}}else if(U.indexOf(a)>=0||R[a]<R[i]){n.push(a);break}e.push(a)}T[i]||n.push(i),t=t.substr(r.index+i.length)}return t=t.trim(),t&&e.push(t),e.concat(n.reverse())}var B={"!":function(t){return!t},"*":function(t,e){return t*e},"/":function(t,e){return t/e},"%":function(t,e){return t%e},"+":function(t,e){return t+e},"-":function(t,e){return t-e},"<":function(t,e){return t<e},"<=":function(t,e){return t<=e},">":function(t,e){return t>e},">=":function(t,e){return t>=e},"==":function(t,e){return t===e},"!=":function(t,e){return t!==e},"&&":function(t,e){return t&&e},"||":function(t,e){return t||e},"?:":function(t,e,n){if(t)throw e;return n}};function q(t,e){var n=[],r,i,o,a,u,d;for(r=0;r<t.length;r++){if(u=t[r],a=B[u],a){for(i=a.length,o=Array(i);i--;)o[i]=n.pop();try{d=a.apply(null,o)}catch(l){return l}}else e.hasOwnProperty(u)?d=e[u]:d=+u;n.push(d)}return n[0]}function G(t){var e=Z(t);return function(n){return q(e,n)}}function J(t){var e=G(t);return function(n){return+e({n})}}var D={contextDelimiter:"",onMissingKey:null};function W(t){var e,n,r;for(e=t.split(";"),n=0;n<e.length;n++)if(r=e[n].trim(),r.indexOf("plural=")===0)return r.substr(7)}function O(t,e){var n;this.data=t,this.pluralForms={},this.options={};for(n in D)this.options[n]=e!==void 0&&n in e?e[n]:D[n]}O.prototype.getPluralForm=function(t,e){var n=this.pluralForms[t],r,i,o;return n||(r=this.data[t][""],o=r["Plural-Forms"]||r["plural-forms"]||r.plural_forms,typeof o!="function"&&(i=W(r["Plural-Forms"]||r["plural-forms"]||r.plural_forms),o=J(i)),n=this.pluralForms[t]=o),n(e)};O.prototype.dcnpgettext=function(t,e,n,r,i){var o,a,u;return i===void 0?o=0:o=this.getPluralForm(t,i),a=n,e&&(a=e+this.options.contextDelimiter+n),u=this.data[t][a],u&&u[o]?u[o]:(this.options.onMissingKey&&this.options.onMissingKey(n,t),o===0?n:r)};const C={"":{plural_forms(t){return t===1?0:1}}},V=/^i18n\.(n?gettext|has_translation)(_|$)/,Y=(t,e,n)=>{const r=new O({}),i=new Set,o=()=>{i.forEach(c=>c())},a=c=>(i.add(c),()=>i.delete(c)),u=(c="default")=>r.data[c],d=(c,p="default")=>{var h;r.data[p]={...r.data[p],...c},r.data[p][""]={...C[""],...(h=r.data[p])==null?void 0:h[""]},delete r.pluralForms[p]},l=(c,p)=>{d(c,p),o()},y=(c,p="default")=>{var h;r.data[p]={...r.data[p],...c,"":{...C[""],...(h=r.data[p])==null?void 0:h[""],...c==null?void 0:c[""]}},delete r.pluralForms[p],o()},s=(c,p)=>{r.data={},r.pluralForms={},l(c,p)},g=(c="default",p,h,x,v)=>(r.data[c]||d(void 0,c),r.dcnpgettext(c,p,h,x,v)),_=(c="default")=>c,m=(c,p)=>{let h=g(p,void 0,c);return n?(h=n.applyFilters("i18n.gettext",h,c,p),n.applyFilters("i18n.gettext_"+_(p),h,c,p)):h},f=(c,p,h)=>{let x=g(h,p,c);return n?(x=n.applyFilters("i18n.gettext_with_context",x,c,p,h),n.applyFilters("i18n.gettext_with_context_"+_(h),x,c,p,h)):x},k=(c,p,h,x)=>{let v=g(x,void 0,c,p,h);return n?(v=n.applyFilters("i18n.ngettext",v,c,p,h,x),n.applyFilters("i18n.ngettext_"+_(x),v,c,p,h,x)):v},S=(c,p,h,x,v)=>{let w=g(v,x,c,p,h);return n?(w=n.applyFilters("i18n.ngettext_with_context",w,c,p,h,x,v),n.applyFilters("i18n.ngettext_with_context_"+_(v),w,c,p,h,x,v)):w},A=()=>f("ltr","text direction")==="rtl",F=(c,p,h)=>{var w,H;const x=p?p+""+c:c;let v=!!((H=(w=r.data)==null?void 0:w[h??"default"])!=null&&H[x]);return n&&(v=n.applyFilters("i18n.has_translation",v,c,p,h),v=n.applyFilters("i18n.has_translation_"+_(h),v,c,p,h)),v};if(n){const c=p=>{V.test(p)&&o()};n.addAction("hookAdded","core/i18n",c),n.addAction("hookRemoved","core/i18n",c)}return{getLocaleData:u,setLocaleData:l,addLocaleData:y,resetLocaleData:s,subscribe:a,__:m,_x:f,_n:k,_nx:S,isRTL:A,hasTranslation:F}};function M(t){return typeof t!="string"||t===""?(console.error("The namespace must be a non-empty string."),!1):/^[a-zA-Z][a-zA-Z0-9_.\-\/]*$/.test(t)?!0:(console.error("The namespace can only contain numbers, letters, dashes, periods, underscores and slashes."),!1)}function j(t){return typeof t!="string"||t===""?(console.error("The hook name must be a non-empty string."),!1):/^__/.test(t)?(console.error("The hook name cannot begin with `__`."),!1):/^[a-zA-Z][a-zA-Z0-9_.-]*$/.test(t)?!0:(console.error("The hook name can only contain numbers, letters, dashes, periods and underscores."),!1)}function P(t,e){return function(r,i,o,a=10){const u=t[e];if(!j(r)||!M(i))return;if(typeof o!="function"){console.error("The hook callback must be a function.");return}if(typeof a!="number"){console.error("If specified, the hook priority must be a number.");return}const d={callback:o,priority:a,namespace:i};if(u[r]){const l=u[r].handlers;let y;for(y=l.length;y>0&&!(a>=l[y-1].priority);y--);y===l.length?l[y]=d:l.splice(y,0,d),u.__current.forEach(s=>{s.name===r&&s.currentIndex>=y&&s.currentIndex++})}else u[r]={handlers:[d],runs:0};r!=="hookAdded"&&t.doAction("hookAdded",r,i,o,a)}}function I(t,e,n=!1){return function(i,o){const a=t[e];if(!j(i)||!n&&!M(o))return;if(!a[i])return 0;let u=0;if(n)u=a[i].handlers.length,a[i]={runs:a[i].runs,handlers:[]};else{const d=a[i].handlers;for(let l=d.length-1;l>=0;l--)d[l].namespace===o&&(d.splice(l,1),u++,a.__current.forEach(y=>{y.name===i&&y.currentIndex>=l&&y.currentIndex--}))}return i!=="hookRemoved"&&t.doAction("hookRemoved",i,o),u}}function L(t,e){return function(r,i){const o=t[e];return typeof i<"u"?r in o&&o[r].handlers.some(a=>a.namespace===i):r in o}}function E(t,e,n,r){return function(o,...a){const u=t[e];u[o]||(u[o]={handlers:[],runs:0}),u[o].runs++;const d=u[o].handlers;if(!d||!d.length)return n?a[0]:void 0;const l={name:o,currentIndex:0};async function y(){try{u.__current.add(l);let g=n?a[0]:void 0;for(;l.currentIndex<d.length;)g=await d[l.currentIndex].callback.apply(null,a),n&&(a[0]=g),l.currentIndex++;return n?g:void 0}finally{u.__current.delete(l)}}function s(){try{u.__current.add(l);let g=n?a[0]:void 0;for(;l.currentIndex<d.length;)g=d[l.currentIndex].callback.apply(null,a),n&&(a[0]=g),l.currentIndex++;return n?g:void 0}finally{u.__current.delete(l)}}return(r?y:s)()}}function $(t,e){return function(){var a;var r;const i=t[e];return(r=(a=Array.from(i.__current).at(-1))==null?void 0:a.name)!==null&&r!==void 0?r:null}}function z(t,e){return function(r){const i=t[e];return typeof r>"u"?i.__current.size>0:Array.from(i.__current).some(o=>o.name===r)}}function Q(t,e){return function(r){const i=t[e];if(j(r))return i[r]&&i[r].runs?i[r].runs:0}}class N{constructor(){this.actions=Object.create(null),this.actions.__current=new Set,this.filters=Object.create(null),this.filters.__current=new Set,this.addAction=P(this,"actions"),this.addFilter=P(this,"filters"),this.removeAction=I(this,"actions"),this.removeFilter=I(this,"filters"),this.hasAction=L(this,"actions"),this.hasFilter=L(this,"filters"),this.removeAllActions=I(this,"actions",!0),this.removeAllFilters=I(this,"filters",!0),this.doAction=E(this,"actions",!1,!1),this.doActionAsync=E(this,"actions",!1,!0),this.applyFilters=E(this,"filters",!0,!1),this.applyFiltersAsync=E(this,"filters",!0,!0),this.currentAction=$(this,"actions"),this.currentFilter=$(this,"filters"),this.doingAction=z(this,"actions"),this.doingFilter=z(this,"filters"),this.didAction=Q(this,"actions"),this.didFilter=Q(this,"filters")}}function tt(){return new N}const et=tt(),b=Y(void 0,void 0,et);b.getLocaleData.bind(b);b.setLocaleData.bind(b);b.resetLocaleData.bind(b);b.subscribe.bind(b);b.__.bind(b);b._x.bind(b);b._n.bind(b);b._nx.bind(b);b.isRTL.bind(b);b.hasTranslation.bind(b);const nt=async(t,e)=>{await jQuery.ajax({type:"POST",url:ajaxurl,data:{action:"get_cookie",data:t,nonce_action:e},success:function(n){},error:function(n){}})},rt=()=>{const t=document.cookie.split(";"),e={};for(const n of t){const r=n.split("="),i=r[0].trim(),o=r.length>1?r[1].trim():"";try{e[i]=decodeURIComponent(o)}catch{continue}}for(let n=0;n<sessionStorage.length;n++){const r=sessionStorage.key(n),i=sessionStorage.getItem(r);try{e[r]=decodeURIComponent(i)}catch{continue}}for(let n=0;n<localStorage.length;n++){const r=localStorage.key(n),i=localStorage.getItem(r);try{e[r]=decodeURIComponent(i)}catch{continue}}return e},st=async(t,e,n=null,r=null)=>{let i=Object.keys(e).length,o=Object.keys(e),a=i;r&&r.empty();for(let u=1;u<=a;u++){await new Promise(l=>setTimeout(l,500));const d=u/a*100;t.css("--progress-width",d+"%"),n&&n.text(u),r&&r.append(`<span>${o[u-1]}</span>`)}},it=(t,e,n=null)=>{const r={progress:{message:t==="progress"?e??"Scan in progress...":"Scan in progress...",autoClose:!0,duration:3e3},success:{title:t==="success"?e??"Cookies scan complete":"Cookies scan complete",message:n??"Scanned cookies are automatically added to the cookie list.",buttonText:"OK",autoClose:!1}},i=typeof t=="string"?r[t]||{}:{...r[t.type]||{},...t},o=jQuery("<div></div>").css({position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)",backgroundColor:"#fff",textAlign:"center",color:"#000",padding:i.title?"0 24px 24px 24px":"24px",border:"1px solid #ccc",borderRadius:"6px",boxShadow:"0 4px 20px rgba(0,0,0,0.3)",fontSize:"16px",zIndex:1e4,maxWidth:"400px",width:"90%",opacity:0,transition:"opacity 0.3s ease"});if(i.title){const a=jQuery("<h3></h3>").text(i.title).css("margin-bottom","12px");o.append(a)}if(i.message){const a=jQuery("<p></p>").text(i.message);i.title&&a.css("margin-bottom","12px"),o.append(a)}if(i.buttonText){const a=jQuery("<button></button>").text(i.buttonText).css({marginTop:"20px",backgroundColor:"#135e96",color:"#fff",width:"100%",borderRadius:"6px",padding:"6px 12px",cursor:"pointer"});a.on("click",function(){o.css("opacity",0),setTimeout(()=>o.remove(),300)}),o.append(a)}jQuery("body").append(o),requestAnimationFrame(()=>{o.css("opacity",1)}),i.autoClose&&setTimeout(()=>{o.css("opacity",0),setTimeout(()=>o.remove(),300)},i.duration||3e3)},ot={getAllCookies:rt,sendDataCookie:nt,simulateTask:st,createAlertBox:it};export{ot as c}; -
cookie-optimizer/trunk/templates/cookie_policy/cookie-policy-page-for-render.php
r3309701 r3310968 61 61 <?php echo esc_attr($textOther[$setLanguage]['necessary_cookies_title']); ?> 62 62 </h4> 63 <?php if (count($data[ 0]) !== 0): ?>64 <?php foreach ($data[ 0] as $cookie): ?>63 <?php if (count($data[1]) !== 0): ?> 64 <?php foreach ($data[1] as $cookie): ?> 65 65 <div> 66 66 <p class="coop-text__underline"> … … 92 92 </h4> 93 93 <div> 94 <?php if (count($data[ 1]) !== 0): ?>95 <?php foreach ($data[ 1] as $cookie): ?>94 <?php if (count($data[2]) !== 0): ?> 95 <?php foreach ($data[2] as $cookie): ?> 96 96 <div> 97 97 <p class="coop-text__underline"> … … 124 124 </h4> 125 125 <div> 126 <?php if (count($data[ 2]) !== 0): ?>127 <?php foreach ($data[ 2] as $cookie): ?>126 <?php if (count($data[3]) !== 0): ?> 127 <?php foreach ($data[3] as $cookie): ?> 128 128 <div> 129 129 <p class="coop-text__underline"> … … 156 156 </h4> 157 157 <div> 158 <?php if (count($data[ 3]) !== 0): ?>159 <?php foreach ($data[ 3] as $cookie): ?>158 <?php if (count($data[4]) !== 0): ?> 159 <?php foreach ($data[4] as $cookie): ?> 160 160 <div> 161 161 <p class="coop-text__underline">
Note: See TracChangeset
for help on using the changeset viewer.