Changeset 3320657
- Timestamp:
- 07/01/2025 01:14:42 PM (9 months ago)
- Location:
- woorewards/trunk
- Files:
-
- 16 edited
-
assets/lws-adminpanel/functions.php (modified) (2 diffs)
-
assets/lws-adminpanel/include/internal/ajax.php (modified) (1 diff)
-
assets/lws-adminpanel/include/legacy/duration.php (modified) (10 diffs)
-
assets/lws-adminpanel/include/pages/field/wpeditor.php (modified) (1 diff)
-
assets/lws-adminpanel/include/pages/head.php (modified) (3 diffs)
-
assets/lws-adminpanel/include/tools/duration.php (modified) (4 diffs)
-
assets/lws-adminpanel/lws-adminpanel.php (modified) (2 diffs)
-
build/index.asset.php (modified) (1 diff)
-
build/index.js (modified) (1 diff)
-
build/pointsoncart.asset.php (modified) (1 diff)
-
build/pointsoncart.js (modified) (1 diff)
-
include/core/pool.php (modified) (5 diffs)
-
include/core/sponsorship.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
styling/css/pointsoncart.css (modified) (1 diff)
-
woorewards.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
woorewards/trunk/assets/lws-adminpanel/functions.php
r3188612 r3320657 18 18 function lws_admin_delete_notice($key) 19 19 { 20 $notices = get_site_option('lws_adminpanel_notices', array());20 $notices = (array)get_site_option('lws_adminpanel_notices', array()); 21 21 if( isset($notices[$key]) ) 22 22 { … … 33 33 { 34 34 $options['message'] = $message; 35 \update_site_option('lws_adminpanel_notices', array_merge( get_site_option('lws_adminpanel_notices', array()), array($key => $options)));35 \update_site_option('lws_adminpanel_notices', array_merge((array)get_site_option('lws_adminpanel_notices', array()), array($key => $options))); 36 36 } 37 37 } -
woorewards/trunk/assets/lws-adminpanel/include/internal/ajax.php
r3284714 r3320657 43 43 'lws_adminpanel_notices', 44 44 array_filter( 45 \get_site_option('lws_adminpanel_notices', array()),45 (array)\get_site_option('lws_adminpanel_notices', array()), 46 46 function($k)use($key){return $key!=$k;}, 47 47 ARRAY_FILTER_USE_KEY -
woorewards/trunk/assets/lws-adminpanel/include/legacy/duration.php
r3198286 r3320657 108 108 /** @return \DateTimeInterface clone of given arg. 109 109 * @param $d if null, use now(). */ 110 function addDate( \DateTimeInterface $d=null)110 function addDate(?\DateTimeInterface $d=null): \DateTimeInterface 111 111 { 112 112 $d = $d ? clone $d : \date_create(); … … 116 116 /** @return \DateTimeInterface clone of given arg. 117 117 * @param $d if null, use now(). */ 118 function subDate( \DateTimeInterface $d=null)118 function subDate(?\DateTimeInterface $d=null): \DateTimeInterface 119 119 { 120 120 $d = $d ? clone $d : \date_create(); … … 123 123 124 124 /** Compute the date at end of duration. 125 * @param $from ( false|\DateTime) Starting date, default false means today.125 * @param $from (null|false|\DateTimeInterface) Starting date, default false means today. 126 126 * @return \DateTime = $form + interval */ 127 function getEndingDate($from=false) 128 { 129 if( false === $from ) 130 $from = \date_create(); 127 function getEndingDate($from=false): \DateTimeInterface 128 { 129 $from = $from ? clone $from : \date_create(); 131 130 return $from->add($this->toInterval()); 132 131 } … … 156 155 } 157 156 157 /** @param \DateInterval $interval 158 * @return \LWS\Adminpanel\Tools\Duration */ 158 159 static function fromInterval($interval) 159 160 { … … 161 162 if( !$def ) 162 163 { 163 $def = array (164 $def = array_intersect_key(array( 164 165 'Y' => '%y', 165 166 'M' => '%m', … … 168 169 'I' => '%i', 169 170 'S' => '%s', 170 ) ;171 ), \array_fill_keys(self::getSupportedPeriodsKeys(true), true)); 171 172 } 172 173 foreach( $def as $out => $in ) … … 182 183 /** @param $interval first int is assumed as delay and first [YMD] as unit. if unit is omitted, day is assumed. 183 184 * A starting 'P' is ignored. */ 184 static function fromString($interval )185 static function fromString($interval, $falseOnError=false) 185 186 { 186 187 if( empty($interval) ) … … 196 197 return new self($match[2], $match[3]); 197 198 } 198 else 199 elseif ($falseOnError) { 200 if (\is_numeric($interval)) 201 return new self(intval($interval), 'D'); 202 else 203 return false; 204 } else 199 205 return new self(intval($interval), 'D'); 200 206 } … … 271 277 } 272 278 273 protectedfunction __construct($n=0, $p='D')279 function __construct($n=0, $p='D') 274 280 { 275 281 $this->number = abs(intval($n)); … … 296 302 'Y' => __("Years", 'lws-adminpanel'), 297 303 ); 298 $allPeriods = array_merge($periods, array( 304 $allPeriods = array( 305 'S' => __("Seconds", 'lws-adminpanel'), 306 'I' => __("Minutes", 'lws-adminpanel'), 307 'H' => __("Hours", 'lws-adminpanel'), 308 'D' => __("Days", 'lws-adminpanel'), 299 309 'W' => __("Weeks", 'lws-adminpanel'), 300 'H' => __("Hours", 'lws-adminpanel'), 301 'I' => __("Minutes", 'lws-adminpanel'), 302 'S' => __("Seconds", 'lws-adminpanel'), 303 )); 310 'M' => __("Months", 'lws-adminpanel'), 311 'Y' => __("Years", 'lws-adminpanel'), 312 ); 304 313 } 305 314 return \apply_filters('lws_adminpanel_duration_supported_periods', $extended ? $allPeriods : $periods); -
woorewards/trunk/assets/lws-adminpanel/include/pages/field/wpeditor.php
r3234695 r3320657 9 9 { 10 10 $name = $this->extra['name'] ?? $this->m_Id; 11 $settings = $this->extra['settings'] ?? $this->extra; 11 $settings = (array)($this->extra['settings'] ?? $this->extra); 12 $rename = \str_replace(['[', ']'], '_', $name); 13 if ($rename !== $name && !isset($settings['textarea_name'])) { 14 $settings['textarea_name'] = $name; 15 } 12 16 $value = $this->readOption(false); 13 \wp_editor($value, $ name, $settings);17 \wp_editor($value, $rename, $settings); 14 18 } 15 19 } -
woorewards/trunk/assets/lws-adminpanel/include/pages/head.php
r3253191 r3320657 310 310 'support' => __("Support", 'lws-adminpanel'), 311 311 'tshooting'=> __("Troubleshooting", 'lws-adminpanel'), 312 'chat' => __("Live Chat", 'lws-adminpanel'),312 // 'chat' => __("Live Chat", 'lws-adminpanel'), 313 313 'doc' => __("Documentation", 'lws-adminpanel'), 314 314 'patch' => __("Patch Notes", 'lws-adminpanel'), … … 379 379 */ 380 380 381 / ** Live Chat */382 echo "<a href='{$settings['chat']}' target='_blank' class='top-menu-item'>";383 echo "<div class='top-menu-item-icon lws-icon-discord'></div>";384 echo "<div class='top-menu-item-text'>{$labels['chat']}</div></a>";385 386 /** Live Chat*/381 // Live Chat 382 // echo "<a href='{$settings['chat']}' target='_blank' class='top-menu-item'>"; 383 // echo "<div class='top-menu-item-icon lws-icon-discord'></div>"; 384 // echo "<div class='top-menu-item-text'>{$labels['chat']}</div></a>"; 385 386 /** Web documentation */ 387 387 echo "<a href='{$settings['doc']}' target='_blank' class='top-menu-item separator'>"; 388 388 echo "<div class='top-menu-item-icon lws-icon-books'></div>"; … … 560 560 'origin' => \apply_filters('lws_adminpanel_plugin_origin_' . $id, array('LWS', 'Long Watch Studio'), $this->id), 561 561 'doc' => \apply_filters('lws_adminpanel_documentation_url_' . $id, __('https://plugins.longwatchstudio.com/knowledge-base/', 'lws-adminpanel'), $this->id), 562 'chat' => \apply_filters('lws_adminpanel_plugin_chat_url_' . $id, self::CHAT, $this->id),562 // 'chat' => \apply_filters('lws_adminpanel_plugin_chat_url_' . $id, self::CHAT, $this->id), 563 563 'mailto' => \apply_filters('lws_adminpanel_plugin_support_email'. $id, self::MAILTO, $this->id), 564 564 'purchase' => false, -
woorewards/trunk/assets/lws-adminpanel/include/tools/duration.php
r3198286 r3320657 108 108 /** @return \DateTimeInterface clone of given arg. 109 109 * @param $d if null, use now(). */ 110 function addDate( \DateTimeInterface $d=null)110 function addDate(?\DateTimeInterface $d=null): \DateTimeInterface 111 111 { 112 112 $d = $d ? clone $d : \date_create(); … … 116 116 /** @return \DateTimeInterface clone of given arg. 117 117 * @param $d if null, use now(). */ 118 function subDate( \DateTimeInterface $d=null)118 function subDate(?\DateTimeInterface $d=null): \DateTimeInterface 119 119 { 120 120 $d = $d ? clone $d : \date_create(); … … 123 123 124 124 /** Compute the date at end of duration. 125 * @param $from ( false|\DateTime) Starting date, default false means today.125 * @param $from (null|false|\DateTimeInterface) Starting date, default false means today. 126 126 * @return \DateTime = $form + interval */ 127 function getEndingDate($from=false) 128 { 129 if( false === $from ) 130 $from = \date_create(); 127 function getEndingDate($from=false): \DateTimeInterface 128 { 129 $from = $from ? clone $from : \date_create(); 131 130 return $from->add($this->toInterval()); 132 131 } … … 156 155 } 157 156 157 /** @param \DateInterval $interval 158 * @return \LWS\Adminpanel\Tools\Duration */ 158 159 static function fromInterval($interval) 159 160 { -
woorewards/trunk/assets/lws-adminpanel/lws-adminpanel.php
r3288989 r3320657 6 6 * Author: Long Watch Studio 7 7 * Author URI: https://longwatchstudio.com 8 * Version: 5.6. 2.28 * Version: 5.6.4 9 9 * Text Domain: lws-adminpanel 10 10 * … … 58 58 59 59 add_filter('lws_adminpanel_versions', function($versions){ 60 $versions['5.6. 2.2'] = __FILE__;60 $versions['5.6.4'] = __FILE__; 61 61 return $versions; 62 62 }); -
woorewards/trunk/build/index.asset.php
r3227529 r3320657 1 <?php return array('dependencies' => array('react', 'wc-blocks-checkout', 'wc-blocks-components', 'wc-settings', 'wp-element', 'wp-i18n', 'wp-plugins'), 'version' => ' 97c8cf19b7dc954deff2');1 <?php return array('dependencies' => array('react', 'wc-blocks-checkout', 'wc-blocks-components', 'wc-settings', 'wp-element', 'wp-i18n', 'wp-plugins'), 'version' => 'd91cf270554b7db6d5ed'); -
woorewards/trunk/build/index.js
r3227529 r3320657 1 (()=>{"use strict";var e,s={980:(e,s,t)=>{t(439)},439:(e,s,t)=>{const n=window.wp.i18n,l=window.wp.element,o=window.wc.wcSettings,r=window.wc.blocksComponents,a=window.wp.plugins,c=window.wc.blocksCheckout;var i=t(848);const d=({system:e})=>{const s=()=>null==e.values||e.values.used<=0?"":e.values.used,[t,o]=(0,l.useState)(s);(0,l.useEffect)((()=>{if(t.length)try{let e=t.replace(/\s/,"").match(/\d*/);o(null==e?"":e[0])}catch(e){o("")}}),[t]);const[a,d]=(0,l.useState)(!1);(0,l.useEffect)((()=>{a||o(s())}),[a]);const[u,w]=(0,l.useState)(!0),p=e=>{e.preventDefault(),w(!u)};let m="XX";return null!=e.values&&(m=e.values.amount_formated),(0,i.jsx)(i.Fragment,{children:u?(0,i.jsxs)("a",{role:"button",className:"lws-wr-blocks pointsoncart-component_unfold","aria-label":(0,n.__)("Use your points","woorewards-lite"),onClick:p,children:[(0,i.jsxs)("span",{className:"wr-label",children:[(0,i.jsx)("span",{dangerouslySetInnerHTML:{__html:e.labels.field}})," ",e.labels.show?(0,i.jsx)("b",{title:(0,n.__)("balance","woorewards-lite"),dangerouslySetInnerHTML:{__html:m}}):""]}),(0,i.jsx)("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24","aria-hidden":"true",className:"wr-unfold-icon",focusable:"false",children:(0,i.jsx)("path",{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"})})]}):(0,i.jsxs)("div",{className:"lws-wr-blocks pointsoncart-component"+(a?" is_loading":""),children:[(0,i.jsxs)("label",{role:"button",className:"pointsoncart-component_fold","aria-label":(0,n.__)("Use your points","woorewards-lite"),onClick:p,children:[(0,i.jsxs)("span",{children:[(0,i.jsx)("span",{dangerouslySetInnerHTML:{__html:e.labels.title}})," ",(0,i.jsx)("b",{dangerouslySetInnerHTML:{__html:m}})]}),(0,i.jsx)("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24","aria-hidden":"true",className:"wr-unfold-icon",focusable:"false",children:(0,i.jsx)("path",{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"})})]}),void 0===e.values||e.values.max>0?(0,i.jsxs)("form",{className:"pointsoncart-component_form",id:"lws-wr-blocks_pointsoncart-component_form",children:[(0,i.jsx)(r.ValidatedTextInput,{id:"lws-wr-blocks_pointsoncart-component_input",errorId:"wr-pointsoncart-value",className:"pointsoncart-component_input",label:e.labels.input,value:t,onChange:e=>{o(e)},focusOnMount:!0,validateOnMount:!1,showError:!1}),(0,i.jsx)("button",{className:"wc-block-components-button wp-element-button",id:"lws-wr-blocks_pointsoncart-component_apply",type:"submit",disabled:a||void 0===e.values||t==e.values.used,onClick:s=>{s.preventDefault(),null!=e.values&&(d(!0),(0,c.extensionCartUpdate)({namespace:"lws_woorewards",data:{action:"use_points",system:e.values.name,value:t}}).then((()=>{d(!1)})))},children:a?(0,i.jsxs)("span",{className:"loading-dots",children:[(0,i.jsx)("span",{className:"dot1",children:"."})," ",(0,i.jsx)("span",{className:"dot2",children:"."})," ",(0,i.jsx)("span",{className:"dot3",children:"."})]}):e.labels.apply})]}):"",Object.entries(e.labels.details).map((([e,s])=>(0,i.jsx)("label",{className:"points-on-cart-details details-"+e,dangerouslySetInnerHTML:{__html:s}})))]})})},u=({cart:e,extensions:s,context:t})=>{try{const n=(0,o.getSetting)("lws-wr-blocks_data");return n.enable&&n["logged-user"]&&void 0!==n.systems&&Object.entries(n.systems).length?(0,i.jsx)(i.Fragment,{children:Object.entries(n.systems).map((([l,o])=>(0,i.jsx)(d,{cart:e,context:t,system:{enable:n.enable,logged:n["logged-user"],labels:o,values:null!=s.lws_woorewards&&(null!=s.lws_woorewards.systems[l]?s.lws_woorewards.systems[l]:void 0)}},l)))}):""}catch(e){return""}};(0,a.registerPlugin)("lws-wr-blocks",{render:function(){return(0,i.jsx)(c.ExperimentalDiscountsMeta,{children:(0,i.jsx)(u,{})},"lwspointsoncart")},scope:"woocommerce-checkout"})},20:(e,s,t)=>{var n=t(609),l=Symbol.for("react.element"),o=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,a=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function i(e,s,t){var n,o={},i=null,d=null;for(n in void 0!==t&&(i=""+t),void 0!==s.key&&(i=""+s.key),void 0!==s.ref&&(d=s.ref),s)r.call(s,n)&&!c.hasOwnProperty(n)&&(o[n]=s[n]);if(e&&e.defaultProps)for(n in s=e.defaultProps)void 0===o[n]&&(o[n]=s[n]);return{$$typeof:l,type:e,key:i,ref:d,props:o,_owner:a.current}}s.Fragment=o,s.jsx=i,s.jsxs=i},848:(e,s,t)=>{e.exports=t(20)},609:e=>{e.exports=window.React}},t={};function n(e){var l=t[e];if(void 0!==l)return l.exports;var o=t[e]={exports:{}};return s[e](o,o.exports,n),o.exports}n.m=s,e=[],n.O=(s,t,l,o)=>{if(!t){var r=1/0;for(d=0;d<e.length;d++){t=e[d][0],l=e[d][1],o=e[d][2];for(var a=!0,c=0;c<t.length;c++)(!1&o||r>=o)&&Object.keys(n.O).every((e=>n.O[e](t[c])))?t.splice(c--,1):(a=!1,o<r&&(r=o));if(a){e.splice(d--,1);var i=l();void 0!==i&&(s=i)}}return s}o=o||0;for(var d=e.length;d>0&&e[d-1][2]>o;d--)e[d]=e[d-1];e[d]=[t,l,o]},n.o=(e,s)=>Object.prototype.hasOwnProperty.call(e,s),(()=>{var e={57:0,59:0,350:0};n.O.j=s=>0===e[s];var s=(s,t)=>{var l,o,r=t[0],a=t[1],c=t[2],i=0;if(r.some((s=>0!==e[s]))){for(l in a)n.o(a,l)&&(n.m[l]=a[l]);if(c)var d=c(n)}for(s&&s(t);i<r.length;i++)o=r[i],n.o(e,o)&&e[o]&&e[o][0](),e[o]=0;return n.O(d)},t=self.webpackChunklws_wr_blocks=self.webpackChunklws_wr_blocks||[];t.forEach(s.bind(null,0)),t.push=s.bind(null,t.push.bind(t))})();var l=n.O(void 0,[350],(()=>n(980)));l=n.O(l)})()1 (()=>{"use strict";var e,s={980:(e,s,t)=>{t(439)},439:(e,s,t)=>{const o=window.wp.i18n,n=window.wp.element,l=window.wc.wcSettings,r=window.wc.blocksComponents,a=window.wp.plugins,i=window.wc.blocksCheckout;var c=t(848);const d=({system:e})=>{const s=()=>void 0===e.values||void 0===e.values.used||e.values.used<=0?"":e.values.used.toString(),[t,l]=(0,n.useState)(s);(0,n.useEffect)((()=>{if(void 0!==t&&t.length){let e=t;try{let s=t.replace(/\s/,"").match(/\d*/);e=null===s?"":s[0]}catch(s){e=""}e.toString()!==t.toString()&&l(e)}}),[t]);const[a,d]=(0,n.useState)(!1);(0,n.useEffect)((()=>{void 0!==t&&void 0!==a&&(a||l(s()))}),[a]);const[u,w]=(0,n.useState)(!0),p=e=>{e.preventDefault(),w(!u)};let m="XX";return void 0!==e.values&&(m=e.values.amount_formated),(0,c.jsx)(c.Fragment,{children:u?(0,c.jsxs)("a",{role:"button",className:"lws-wr-blocks pointsoncart-component_unfold","aria-label":(0,o.__)("Use your points","woorewards-lite"),onClick:p,children:[(0,c.jsxs)("span",{className:"wr-label",children:[(0,c.jsx)("span",{dangerouslySetInnerHTML:{__html:e.labels.field}})," ",e.labels.show?(0,c.jsx)("b",{title:(0,o.__)("balance","woorewards-lite"),dangerouslySetInnerHTML:{__html:m}}):""]}),(0,c.jsx)("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24","aria-hidden":"true",className:"wr-unfold-icon",focusable:"false",children:(0,c.jsx)("path",{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"})})]}):(0,c.jsxs)("div",{className:"lws-wr-blocks pointsoncart-component"+(a?" is_loading":""),children:[(0,c.jsxs)("label",{role:"button",className:"pointsoncart-component_fold","aria-label":(0,o.__)("Use your points","woorewards-lite"),onClick:p,children:[(0,c.jsxs)("span",{children:[(0,c.jsx)("span",{dangerouslySetInnerHTML:{__html:e.labels.title}})," ",(0,c.jsx)("b",{dangerouslySetInnerHTML:{__html:m}})]}),(0,c.jsx)("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24","aria-hidden":"true",className:"wr-unfold-icon",focusable:"false",children:(0,c.jsx)("path",{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"})})]}),void 0===e.values||e.values.max>0?(0,c.jsxs)("form",{className:"pointsoncart-component_form",id:"lws-wr-blocks_pointsoncart-component_form",children:[(0,c.jsx)(r.ValidatedTextInput,{id:"lws-wr-blocks_pointsoncart-component_input",errorId:"wr-pointsoncart-value",className:"pointsoncart-component_input",label:e.labels.input,value:t,onChange:e=>{l(e)},focusOnMount:!0,validateOnMount:!1,showError:!1}),(0,c.jsx)("button",{className:"wc-block-components-button wp-element-button",id:"lws-wr-blocks_pointsoncart-component_apply",type:"submit",disabled:a||void 0===e.values||t.toString()===e.values.used.toString(),onClick:s=>{s.preventDefault(),void 0!==e.values&&(d(!0),(0,i.extensionCartUpdate)({namespace:"lws_woorewards",data:{action:"use_points",system:e.values.name,value:t}}).then((()=>{d(!1)})))},children:a?(0,c.jsxs)("span",{className:"loading-dots",children:[(0,c.jsx)("span",{className:"dot1",children:"."})," ",(0,c.jsx)("span",{className:"dot2",children:"."})," ",(0,c.jsx)("span",{className:"dot3",children:"."})]}):e.labels.apply})]}):"",Object.entries(e.labels.details).map((([e,s])=>(0,c.jsx)("label",{className:"points-on-cart-details details-"+e,dangerouslySetInnerHTML:{__html:s}},e)))]})})},u=({cart:e,extensions:s,context:t})=>{try{const o=(0,l.getSetting)("lws-wr-blocks_data");return o.enable&&o["logged-user"]&&void 0!==o.systems&&Object.entries(o.systems).length?(0,c.jsx)(c.Fragment,{children:Object.entries(o.systems).map((([n,l])=>(0,c.jsx)(d,{cart:e,context:t,system:{enable:o.enable,logged:o["logged-user"],labels:l,values:void 0!==s.lws_woorewards&&(void 0!==s.lws_woorewards.systems[n]?s.lws_woorewards.systems[n]:void 0)}},n)))}):""}catch(e){return""}};(0,a.registerPlugin)("lws-wr-blocks",{render:function(){return(0,c.jsx)(i.ExperimentalDiscountsMeta,{children:(0,c.jsx)(u,{})},"lwspointsoncart")},scope:"woocommerce-checkout"})},20:(e,s,t)=>{var o=t(609),n=Symbol.for("react.element"),l=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,a=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function c(e,s,t){var o,l={},c=null,d=null;for(o in void 0!==t&&(c=""+t),void 0!==s.key&&(c=""+s.key),void 0!==s.ref&&(d=s.ref),s)r.call(s,o)&&!i.hasOwnProperty(o)&&(l[o]=s[o]);if(e&&e.defaultProps)for(o in s=e.defaultProps)void 0===l[o]&&(l[o]=s[o]);return{$$typeof:n,type:e,key:c,ref:d,props:l,_owner:a.current}}s.Fragment=l,s.jsx=c,s.jsxs=c},848:(e,s,t)=>{e.exports=t(20)},609:e=>{e.exports=window.React}},t={};function o(e){var n=t[e];if(void 0!==n)return n.exports;var l=t[e]={exports:{}};return s[e](l,l.exports,o),l.exports}o.m=s,e=[],o.O=(s,t,n,l)=>{if(!t){var r=1/0;for(d=0;d<e.length;d++){for(var[t,n,l]=e[d],a=!0,i=0;i<t.length;i++)(!1&l||r>=l)&&Object.keys(o.O).every((e=>o.O[e](t[i])))?t.splice(i--,1):(a=!1,l<r&&(r=l));if(a){e.splice(d--,1);var c=n();void 0!==c&&(s=c)}}return s}l=l||0;for(var d=e.length;d>0&&e[d-1][2]>l;d--)e[d]=e[d-1];e[d]=[t,n,l]},o.o=(e,s)=>Object.prototype.hasOwnProperty.call(e,s),(()=>{var e={57:0,59:0,350:0};o.O.j=s=>0===e[s];var s=(s,t)=>{var n,l,[r,a,i]=t,c=0;if(r.some((s=>0!==e[s]))){for(n in a)o.o(a,n)&&(o.m[n]=a[n]);if(i)var d=i(o)}for(s&&s(t);c<r.length;c++)l=r[c],o.o(e,l)&&e[l]&&e[l][0](),e[l]=0;return o.O(d)},t=globalThis.webpackChunklws_wr_blocks=globalThis.webpackChunklws_wr_blocks||[];t.forEach(s.bind(null,0)),t.push=s.bind(null,t.push.bind(t))})();var n=o.O(void 0,[350],(()=>o(980)));n=o.O(n)})() -
woorewards/trunk/build/pointsoncart.asset.php
r3227529 r3320657 1 <?php return array('dependencies' => array('react', 'wc-blocks-checkout', 'wc-blocks-components', 'wc-settings', 'wp-element', 'wp-i18n', 'wp-plugins'), 'version' => ' 060c95b90786c21bf89e');1 <?php return array('dependencies' => array('react', 'wc-blocks-checkout', 'wc-blocks-components', 'wc-settings', 'wp-element', 'wp-i18n', 'wp-plugins'), 'version' => '160323f8252a9612eeb4'); -
woorewards/trunk/build/pointsoncart.js
r3227529 r3320657 1 (()=>{"use strict";var e,s={439:(e,s,t)=>{const n=window.wp.i18n,l=window.wp.element,o=window.wc.wcSettings,r=window.wc.blocksComponents,a=window.wp.plugins,c=window.wc.blocksCheckout;var i=t(848);const d=({system:e})=>{const s=()=>null==e.values||e.values.used<=0?"":e.values.used,[t,o]=(0,l.useState)(s);(0,l.useEffect)((()=>{if(t.length)try{let e=t.replace(/\s/,"").match(/\d*/);o(null==e?"":e[0])}catch(e){o("")}}),[t]);const[a,d]=(0,l.useState)(!1);(0,l.useEffect)((()=>{a||o(s())}),[a]);const[u,w]=(0,l.useState)(!0),p=e=>{e.preventDefault(),w(!u)};let m="XX";return null!=e.values&&(m=e.values.amount_formated),(0,i.jsx)(i.Fragment,{children:u?(0,i.jsxs)("a",{role:"button",className:"lws-wr-blocks pointsoncart-component_unfold","aria-label":(0,n.__)("Use your points","woorewards-lite"),onClick:p,children:[(0,i.jsxs)("span",{className:"wr-label",children:[(0,i.jsx)("span",{dangerouslySetInnerHTML:{__html:e.labels.field}})," ",e.labels.show?(0,i.jsx)("b",{title:(0,n.__)("balance","woorewards-lite"),dangerouslySetInnerHTML:{__html:m}}):""]}),(0,i.jsx)("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24","aria-hidden":"true",className:"wr-unfold-icon",focusable:"false",children:(0,i.jsx)("path",{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"})})]}):(0,i.jsxs)("div",{className:"lws-wr-blocks pointsoncart-component"+(a?" is_loading":""),children:[(0,i.jsxs)("label",{role:"button",className:"pointsoncart-component_fold","aria-label":(0,n.__)("Use your points","woorewards-lite"),onClick:p,children:[(0,i.jsxs)("span",{children:[(0,i.jsx)("span",{dangerouslySetInnerHTML:{__html:e.labels.title}})," ",(0,i.jsx)("b",{dangerouslySetInnerHTML:{__html:m}})]}),(0,i.jsx)("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24","aria-hidden":"true",className:"wr-unfold-icon",focusable:"false",children:(0,i.jsx)("path",{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"})})]}),void 0===e.values||e.values.max>0?(0,i.jsxs)("form",{className:"pointsoncart-component_form",id:"lws-wr-blocks_pointsoncart-component_form",children:[(0,i.jsx)(r.ValidatedTextInput,{id:"lws-wr-blocks_pointsoncart-component_input",errorId:"wr-pointsoncart-value",className:"pointsoncart-component_input",label:e.labels.input,value:t,onChange:e=>{o(e)},focusOnMount:!0,validateOnMount:!1,showError:!1}),(0,i.jsx)("button",{className:"wc-block-components-button wp-element-button",id:"lws-wr-blocks_pointsoncart-component_apply",type:"submit",disabled:a||void 0===e.values||t==e.values.used,onClick:s=>{s.preventDefault(),null!=e.values&&(d(!0),(0,c.extensionCartUpdate)({namespace:"lws_woorewards",data:{action:"use_points",system:e.values.name,value:t}}).then((()=>{d(!1)})))},children:a?(0,i.jsxs)("span",{className:"loading-dots",children:[(0,i.jsx)("span",{className:"dot1",children:"."})," ",(0,i.jsx)("span",{className:"dot2",children:"."})," ",(0,i.jsx)("span",{className:"dot3",children:"."})]}):e.labels.apply})]}):"",Object.entries(e.labels.details).map((([e,s])=>(0,i.jsx)("label",{className:"points-on-cart-details details-"+e,dangerouslySetInnerHTML:{__html:s}})))]})})},u=({cart:e,extensions:s,context:t})=>{try{const n=(0,o.getSetting)("lws-wr-blocks_data");return n.enable&&n["logged-user"]&&void 0!==n.systems&&Object.entries(n.systems).length?(0,i.jsx)(i.Fragment,{children:Object.entries(n.systems).map((([l,o])=>(0,i.jsx)(d,{cart:e,context:t,system:{enable:n.enable,logged:n["logged-user"],labels:o,values:null!=s.lws_woorewards&&(null!=s.lws_woorewards.systems[l]?s.lws_woorewards.systems[l]:void 0)}},l)))}):""}catch(e){return""}};(0,a.registerPlugin)("lws-wr-blocks",{render:function(){return(0,i.jsx)(c.ExperimentalDiscountsMeta,{children:(0,i.jsx)(u,{})},"lwspointsoncart")},scope:"woocommerce-checkout"})},20:(e,s,t)=>{var n=t(609),l=Symbol.for("react.element"),o=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,a=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function i(e,s,t){var n,o={},i=null,d=null;for(n in void 0!==t&&(i=""+t),void 0!==s.key&&(i=""+s.key),void 0!==s.ref&&(d=s.ref),s)r.call(s,n)&&!c.hasOwnProperty(n)&&(o[n]=s[n]);if(e&&e.defaultProps)for(n in s=e.defaultProps)void 0===o[n]&&(o[n]=s[n]);return{$$typeof:l,type:e,key:i,ref:d,props:o,_owner:a.current}}s.Fragment=o,s.jsx=i,s.jsxs=i},848:(e,s,t)=>{e.exports=t(20)},609:e=>{e.exports=window.React}},t={};function n(e){var l=t[e];if(void 0!==l)return l.exports;var o=t[e]={exports:{}};return s[e](o,o.exports,n),o.exports}n.m=s,e=[],n.O=(s,t,l,o)=>{if(!t){var r=1/0;for(d=0;d<e.length;d++){t=e[d][0],l=e[d][1],o=e[d][2];for(var a=!0,c=0;c<t.length;c++)(!1&o||r>=o)&&Object.keys(n.O).every((e=>n.O[e](t[c])))?t.splice(c--,1):(a=!1,o<r&&(r=o));if(a){e.splice(d--,1);var i=l();void 0!==i&&(s=i)}}return s}o=o||0;for(var d=e.length;d>0&&e[d-1][2]>o;d--)e[d]=e[d-1];e[d]=[t,l,o]},n.o=(e,s)=>Object.prototype.hasOwnProperty.call(e,s),(()=>{var e={59:0,350:0};n.O.j=s=>0===e[s];var s=(s,t)=>{var l,o,r=t[0],a=t[1],c=t[2],i=0;if(r.some((s=>0!==e[s]))){for(l in a)n.o(a,l)&&(n.m[l]=a[l]);if(c)var d=c(n)}for(s&&s(t);i<r.length;i++)o=r[i],n.o(e,o)&&e[o]&&e[o][0](),e[o]=0;return n.O(d)},t=self.webpackChunklws_wr_blocks=self.webpackChunklws_wr_blocks||[];t.forEach(s.bind(null,0)),t.push=s.bind(null,t.push.bind(t))})();var l=n.O(void 0,[350],(()=>n(439)));l=n.O(l)})()1 (()=>{"use strict";var e,s={439:(e,s,t)=>{const o=window.wp.i18n,n=window.wp.element,l=window.wc.wcSettings,r=window.wc.blocksComponents,a=window.wp.plugins,i=window.wc.blocksCheckout;var c=t(848);const d=({system:e})=>{const s=()=>void 0===e.values||void 0===e.values.used||e.values.used<=0?"":e.values.used.toString(),[t,l]=(0,n.useState)(s);(0,n.useEffect)((()=>{if(void 0!==t&&t.length){let e=t;try{let s=t.replace(/\s/,"").match(/\d*/);e=null===s?"":s[0]}catch(s){e=""}e.toString()!==t.toString()&&l(e)}}),[t]);const[a,d]=(0,n.useState)(!1);(0,n.useEffect)((()=>{void 0!==t&&void 0!==a&&(a||l(s()))}),[a]);const[u,w]=(0,n.useState)(!0),p=e=>{e.preventDefault(),w(!u)};let m="XX";return void 0!==e.values&&(m=e.values.amount_formated),(0,c.jsx)(c.Fragment,{children:u?(0,c.jsxs)("a",{role:"button",className:"lws-wr-blocks pointsoncart-component_unfold","aria-label":(0,o.__)("Use your points","woorewards-lite"),onClick:p,children:[(0,c.jsxs)("span",{className:"wr-label",children:[(0,c.jsx)("span",{dangerouslySetInnerHTML:{__html:e.labels.field}})," ",e.labels.show?(0,c.jsx)("b",{title:(0,o.__)("balance","woorewards-lite"),dangerouslySetInnerHTML:{__html:m}}):""]}),(0,c.jsx)("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24","aria-hidden":"true",className:"wr-unfold-icon",focusable:"false",children:(0,c.jsx)("path",{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"})})]}):(0,c.jsxs)("div",{className:"lws-wr-blocks pointsoncart-component"+(a?" is_loading":""),children:[(0,c.jsxs)("label",{role:"button",className:"pointsoncart-component_fold","aria-label":(0,o.__)("Use your points","woorewards-lite"),onClick:p,children:[(0,c.jsxs)("span",{children:[(0,c.jsx)("span",{dangerouslySetInnerHTML:{__html:e.labels.title}})," ",(0,c.jsx)("b",{dangerouslySetInnerHTML:{__html:m}})]}),(0,c.jsx)("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24","aria-hidden":"true",className:"wr-unfold-icon",focusable:"false",children:(0,c.jsx)("path",{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"})})]}),void 0===e.values||e.values.max>0?(0,c.jsxs)("form",{className:"pointsoncart-component_form",id:"lws-wr-blocks_pointsoncart-component_form",children:[(0,c.jsx)(r.ValidatedTextInput,{id:"lws-wr-blocks_pointsoncart-component_input",errorId:"wr-pointsoncart-value",className:"pointsoncart-component_input",label:e.labels.input,value:t,onChange:e=>{l(e)},focusOnMount:!0,validateOnMount:!1,showError:!1}),(0,c.jsx)("button",{className:"wc-block-components-button wp-element-button",id:"lws-wr-blocks_pointsoncart-component_apply",type:"submit",disabled:a||void 0===e.values||t.toString()===e.values.used.toString(),onClick:s=>{s.preventDefault(),void 0!==e.values&&(d(!0),(0,i.extensionCartUpdate)({namespace:"lws_woorewards",data:{action:"use_points",system:e.values.name,value:t}}).then((()=>{d(!1)})))},children:a?(0,c.jsxs)("span",{className:"loading-dots",children:[(0,c.jsx)("span",{className:"dot1",children:"."})," ",(0,c.jsx)("span",{className:"dot2",children:"."})," ",(0,c.jsx)("span",{className:"dot3",children:"."})]}):e.labels.apply})]}):"",Object.entries(e.labels.details).map((([e,s])=>(0,c.jsx)("label",{className:"points-on-cart-details details-"+e,dangerouslySetInnerHTML:{__html:s}},e)))]})})},u=({cart:e,extensions:s,context:t})=>{try{const o=(0,l.getSetting)("lws-wr-blocks_data");return o.enable&&o["logged-user"]&&void 0!==o.systems&&Object.entries(o.systems).length?(0,c.jsx)(c.Fragment,{children:Object.entries(o.systems).map((([n,l])=>(0,c.jsx)(d,{cart:e,context:t,system:{enable:o.enable,logged:o["logged-user"],labels:l,values:void 0!==s.lws_woorewards&&(void 0!==s.lws_woorewards.systems[n]?s.lws_woorewards.systems[n]:void 0)}},n)))}):""}catch(e){return""}};(0,a.registerPlugin)("lws-wr-blocks",{render:function(){return(0,c.jsx)(i.ExperimentalDiscountsMeta,{children:(0,c.jsx)(u,{})},"lwspointsoncart")},scope:"woocommerce-checkout"})},20:(e,s,t)=>{var o=t(609),n=Symbol.for("react.element"),l=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,a=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function c(e,s,t){var o,l={},c=null,d=null;for(o in void 0!==t&&(c=""+t),void 0!==s.key&&(c=""+s.key),void 0!==s.ref&&(d=s.ref),s)r.call(s,o)&&!i.hasOwnProperty(o)&&(l[o]=s[o]);if(e&&e.defaultProps)for(o in s=e.defaultProps)void 0===l[o]&&(l[o]=s[o]);return{$$typeof:n,type:e,key:c,ref:d,props:l,_owner:a.current}}s.Fragment=l,s.jsx=c,s.jsxs=c},848:(e,s,t)=>{e.exports=t(20)},609:e=>{e.exports=window.React}},t={};function o(e){var n=t[e];if(void 0!==n)return n.exports;var l=t[e]={exports:{}};return s[e](l,l.exports,o),l.exports}o.m=s,e=[],o.O=(s,t,n,l)=>{if(!t){var r=1/0;for(d=0;d<e.length;d++){for(var[t,n,l]=e[d],a=!0,i=0;i<t.length;i++)(!1&l||r>=l)&&Object.keys(o.O).every((e=>o.O[e](t[i])))?t.splice(i--,1):(a=!1,l<r&&(r=l));if(a){e.splice(d--,1);var c=n();void 0!==c&&(s=c)}}return s}l=l||0;for(var d=e.length;d>0&&e[d-1][2]>l;d--)e[d]=e[d-1];e[d]=[t,n,l]},o.o=(e,s)=>Object.prototype.hasOwnProperty.call(e,s),(()=>{var e={59:0,350:0};o.O.j=s=>0===e[s];var s=(s,t)=>{var n,l,[r,a,i]=t,c=0;if(r.some((s=>0!==e[s]))){for(n in a)o.o(a,n)&&(o.m[n]=a[n]);if(i)var d=i(o)}for(s&&s(t);c<r.length;c++)l=r[c],o.o(e,l)&&e[l]&&e[l][0](),e[l]=0;return o.O(d)},t=globalThis.webpackChunklws_wr_blocks=globalThis.webpackChunklws_wr_blocks||[];t.forEach(s.bind(null,0)),t.push=s.bind(null,t.push.bind(t))})();var n=o.O(void 0,[350],(()=>o(439)));n=o.O(n)})() -
woorewards/trunk/include/core/pool.php
r3284714 r3320657 34 34 protected $drmCats = array(); /// directRewardMode restriction: assign category to virtual coupon 35 35 36 public $cmpData = null; 37 36 38 /** A pool is active if set as activated */ 37 39 public function isActive() … … 52 54 * @param $reason (string) optional, the cause of the earning. 53 55 * @param $origin (\LWS\WOOREWARDS\Abstracts\Event) optional, the source Event. */ 54 public function addPoints($userId, $value, $reason='', \LWS\WOOREWARDS\Abstracts\Event $origin=null, $origin2=false)56 public function addPoints($userId, $value, $reason='', ?\LWS\WOOREWARDS\Abstracts\Event $origin=null, $origin2=false) 55 57 { 56 58 $old = $this->getPoints($userId); … … 96 98 * @param $reason (string|\LWS\WOOREWARDS\Core\Trace) optional, the cause of the earning. 97 99 * @param $origin (\LWS\WOOREWARDS\Abstracts\Unlockable) optional, the source Event. */ 98 public function usePoints($userId, $value, $reason='', \LWS\WOOREWARDS\Abstracts\Unlockable $origin=null, $origin2=false)100 public function usePoints($userId, $value, $reason='', ?\LWS\WOOREWARDS\Abstracts\Unlockable $origin=null, $origin2=false) 99 101 { 100 102 $old = $this->getPoints($userId); … … 1017 1019 } 1018 1020 1019 if( !isset($a->cmpData)) {1021 if( null === $a->cmpData ) { 1020 1022 $a->cmpData = array( 1021 1023 // 'label' => $a->getOption('display_title'), … … 1024 1026 ); 1025 1027 } 1026 if( !isset($b->cmpData)) {1028 if( null === $b->cmpData ) { 1027 1029 $b->cmpData = array( 1028 1030 // 'label' => $b->getOption('display_title'), -
woorewards/trunk/include/core/sponsorship.php
r3188612 r3320657 322 322 if (!$users->sponsor_id) 323 323 $users->origin = false; 324 return $users; 324 325 return \apply_filters('lws_woorewards_order_sponsored_by', $users, $order, $guestAllowed, $ref); 325 326 } 326 327 -
woorewards/trunk/readme.txt
r3288989 r3320657 4 4 Requires at least: 5.3 5 5 Tested up to: 6.8 6 Requires PHP: 7. 0.07 Stable tag: 5.4.1 3.16 Requires PHP: 7.3.0 7 Stable tag: 5.4.14 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 110 110 == Changelog == 111 111 112 = 5.4.14 = 113 * Tag - Require PHP 7.3 114 * Tag - WooCommerce 9.9 115 * Fix - Duration: a const method modifies the value of the argument. 116 * Fix - Point discount block may display wrong 117 * Dev - PHP 8.4 support 118 * Dev - new filter 'lws_woorewards_order_sponsored_by' 119 * Tweak - responsive for Storefront theme 120 112 121 = 5.4.13.1 = 113 122 * Update - translation templates -
woorewards/trunk/styling/css/pointsoncart.css
r3188612 r3320657 102 102 width: 41%; 103 103 } 104 @media screen and (orientation:portrait) { 105 body.theme-storefront form.woocommerce-checkout .lws-wr-pointsoncart { 106 float: none; 107 width: 100%; 108 } 109 } 104 110 body.theme-storefront form.woocommerce-checkout .woocommerce-billing-fields .lws-wr-pointsoncart { 105 111 float: left; -
woorewards/trunk/woorewards.php
r3288989 r3320657 7 7 * Author: Long Watch Studio 8 8 * Author URI: https://longwatchstudio.com 9 * Version: 5.4.1 3.19 * Version: 5.4.14 10 10 * License: Copyright LongWatchStudio 2022 11 11 * Text Domain: woorewards-lite 12 12 * Domain Path: /languages 13 13 * WC requires at least: 7.1.0 14 * WC tested up to: 9. 814 * WC tested up to: 9.9 15 15 * 16 16 * Copyright (c) 2022 Long Watch Studio (email: plugins@longwatchstudio.com). All rights reserved. … … 111 111 private function defineConstants() 112 112 { 113 define('LWS_WOOREWARDS_VERSION', '5.4.1 3.1');113 define('LWS_WOOREWARDS_VERSION', '5.4.14'); 114 114 define('LWS_WOOREWARDS_FILE', __FILE__); 115 115 define('LWS_WOOREWARDS_DOMAIN', 'woorewards-lite'); … … 149 149 public function addPluginVersion($url) 150 150 { 151 return '5.4.1 3.1';151 return '5.4.14'; 152 152 } 153 153
Note: See TracChangeset
for help on using the changeset viewer.