Version Description
- Fixed an issue with the Legacy Widget
Download this release
Release Info
Developer | WPZOOM |
Plugin | Social Icons Widget by WPZOOM |
Version | 4.2.2 |
Comparing to | |
See all releases |
Code changes from version 4.2.0 to 4.2.2
- assets/images/social-icons-pro-avatar.png +0 -0
- assets/js/social-icons-settings-page.js +1 -1
- block/dist/style-wpzoom-social-icons.css +1 -1
- block/dist/wpzoom-social-icons.asset.php +1 -1
- block/dist/wpzoom-social-icons.js +3 -3
- block/src/init.php +86 -72
- class.zoom-social-icons-settings.php +0 -701
- class.zoom-social-icons-widget.php +0 -1584
- includes/classes/class-wpzoom-social-icons-settings.php +735 -0
- includes/classes/class-zoom-social-icons-widget.php +1395 -0
- icons-data.php → includes/icons-data.php +252 -246
- includes/zoom-helper.php +183 -0
- readme.txt +9 -2
- social-icons-widget-by-wpzoom.php +346 -91
- zoom-helper.php +0 -134
assets/images/social-icons-pro-avatar.png
ADDED
Binary file
|
assets/js/social-icons-settings-page.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
jQuery(function ($) {
|
2 |
-
$(".
|
3 |
classes: {"ui-tabs-active": "current"},
|
4 |
active: localStorage.getItem("socialIconsCurrentSettingsTab"),
|
5 |
activate: function (event, ui) {
|
1 |
jQuery(function ($) {
|
2 |
+
$(".wpzoom-social-icons-settings-inner").tabs({
|
3 |
classes: {"ui-tabs-active": "current"},
|
4 |
active: localStorage.getItem("socialIconsCurrentSettingsTab"),
|
5 |
activate: function (event, ui) {
|
block/dist/style-wpzoom-social-icons.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.wp-block-wpzoom-blocks-social-icons{margin:0 auto;display:flex;box-sizing:content-box;flex-flow:row wrap;justify-content:var(--wpz-social-icons-alignment)}.wp-block-wpzoom-blocks-social-icons a.social-icon-link{text-decoration:none !important;box-shadow:none}.wp-block-wpzoom-blocks-social-icons .social-icon.socicon,.wp-block-wpzoom-blocks-social-icons .social-icon.dashicons,.wp-block-wpzoom-blocks-social-icons .social-icon.genericon,.wp-block-wpzoom-blocks-social-icons .social-icon.academicons,.wp-block-wpzoom-blocks-social-icons .social-icon.fas,.wp-block-wpzoom-blocks-social-icons .social-icon.fab,.wp-block-wpzoom-blocks-social-icons .social-icon.far{color:#fff;padding:10px;margin:5px;background:#5a5a59;font-size:1.2em;width:1.2em;height:1.2em;vertical-align:middle;box-sizing:content-box;line-height:1.2em;text-align:center}.wp-block-wpzoom-blocks-social-icons .social-icon.socicon:empty{width:1.2em;height:1.2em}.wp-block-wpzoom-blocks-social-icons .social-icon.socicon{top:0px}.wp-block-wpzoom-blocks-social-icons.is-style-with-canvas-round .social-icon{font-size:var(--wpz-social-icons-block-item-font-size);padding:var(--wpz-social-icons-block-item-padding-vertical) var(--wpz-social-icons-block-item-padding-horizontal);margin:var(--wpz-social-icons-block-item-margin-vertical) var(--wpz-social-icons-block-item-margin-horizontal);border-radius:var(--wpz-social-icons-block-item-border-radius);background-color:var(--wpz-social-icons-block-item-color)}.wp-block-wpzoom-blocks-social-icons.is-style-with-canvas-round .social-icon:hover{background-color:var(--wpz-social-icons-block-item-color-hover)}.wp-block-wpzoom-blocks-social-icons.is-style-with-canvas-round .icon-label{color:var(--wpz-social-icons-block-label-color);font-size:var(--wpz-social-icons-block-label-font-size)}.wp-block-wpzoom-blocks-social-icons.is-style-with-canvas-round .icon-label:hover{color:var(--wpz-social-icons-block-label-color-hover)}.wp-block-wpzoom-blocks-social-icons.is-style-with-canvas-rounded .social-icon{font-size:var(--wpz-social-icons-block-item-font-size);padding:var(--wpz-social-icons-block-item-padding-vertical) var(--wpz-social-icons-block-item-padding-horizontal);margin:var(--wpz-social-icons-block-item-margin-vertical) var(--wpz-social-icons-block-item-margin-horizontal);border-radius:var(--wpz-social-icons-block-item-border-radius);background-color:var(--wpz-social-icons-block-item-color)}.wp-block-wpzoom-blocks-social-icons.is-style-with-canvas-rounded .social-icon:hover{background-color:var(--wpz-social-icons-block-item-color-hover)}.wp-block-wpzoom-blocks-social-icons.is-style-with-canvas-rounded .icon-label{color:var(--wpz-social-icons-block-label-color);font-size:var(--wpz-social-icons-block-label-font-size)}.wp-block-wpzoom-blocks-social-icons.is-style-with-canvas-rounded .icon-label:hover{color:var(--wpz-social-icons-block-label-color-hover)}.wp-block-wpzoom-blocks-social-icons.is-style-with-canvas-squared .social-icon{font-size:var(--wpz-social-icons-block-item-font-size);padding:var(--wpz-social-icons-block-item-padding-vertical) var(--wpz-social-icons-block-item-padding-horizontal);margin:var(--wpz-social-icons-block-item-margin-vertical) var(--wpz-social-icons-block-item-margin-horizontal);border-radius:var(--wpz-social-icons-block-item-border-radius);background-color:var(--wpz-social-icons-block-item-color)}.wp-block-wpzoom-blocks-social-icons.is-style-with-canvas-squared .social-icon:hover{background-color:var(--wpz-social-icons-block-item-color-hover)}.wp-block-wpzoom-blocks-social-icons.is-style-with-canvas-squared .icon-label{color:var(--wpz-social-icons-block-label-color);font-size:var(--wpz-social-icons-block-label-font-size)}.wp-block-wpzoom-blocks-social-icons.is-style-with-canvas-squared .icon-label:hover{color:var(--wpz-social-icons-block-label-color-hover)}.wp-block-wpzoom-blocks-social-icons.is-style-without-canvas .social-icon{font-size:var(--wpz-social-icons-block-item-font-size);padding:var(--wpz-social-icons-block-item-padding-vertical) var(--wpz-social-icons-block-item-padding-horizontal);margin:var(--wpz-social-icons-block-item-margin-vertical) var(--wpz-social-icons-block-item-margin-horizontal);border-radius:var(--wpz-social-icons-block-item-border-radius);color:var(--wpz-social-icons-block-item-color);background-color:transparent}.wp-block-wpzoom-blocks-social-icons.is-style-without-canvas .social-icon:hover{color:var(--wpz-social-icons-block-item-color-hover)}.wp-block-wpzoom-blocks-social-icons.is-style-without-canvas .icon-label{color:var(--wpz-social-icons-block-label-color);font-size:var(--wpz-social-icons-block-label-font-size)}.wp-block-wpzoom-blocks-social-icons.is-style-without-canvas .icon-label:hover{color:var(--wpz-social-icons-block-label-color-hover)}.wp-block-wpzoom-blocks-social-icons.is-style-without-canvas-with-border .social-icon{font-size:var(--wpz-social-icons-block-item-font-size);padding:var(--wpz-social-icons-block-item-padding-vertical) var(--wpz-social-icons-block-item-padding-horizontal);margin:var(--wpz-social-icons-block-item-margin-vertical) var(--wpz-social-icons-block-item-margin-horizontal);border-radius:var(--wpz-social-icons-block-item-border-radius);color:var(--wpz-social-icons-block-item-color);background-color:transparent;border-width:
|
1 |
+
.wp-block-wpzoom-blocks-social-icons{margin:0 auto;display:flex;box-sizing:content-box;flex-flow:row wrap;justify-content:var(--wpz-social-icons-alignment)}.wp-block-wpzoom-blocks-social-icons a.social-icon-link{text-decoration:none !important;box-shadow:none;transition:opacity .2s ease}.wp-block-wpzoom-blocks-social-icons a.social-icon-link:hover{opacity:.8}.wp-block-wpzoom-blocks-social-icons .social-icon.socicon,.wp-block-wpzoom-blocks-social-icons .social-icon.dashicons,.wp-block-wpzoom-blocks-social-icons .social-icon.genericon,.wp-block-wpzoom-blocks-social-icons .social-icon.academicons,.wp-block-wpzoom-blocks-social-icons .social-icon.fas,.wp-block-wpzoom-blocks-social-icons .social-icon.fab,.wp-block-wpzoom-blocks-social-icons .social-icon.far{color:#fff;padding:10px;margin:5px;background:#5a5a59;font-size:1.2em;width:1.2em;height:1.2em;vertical-align:middle;box-sizing:content-box;line-height:1.2em;text-align:center}.wp-block-wpzoom-blocks-social-icons .social-icon.socicon:empty{width:1.2em;height:1.2em}.wp-block-wpzoom-blocks-social-icons .social-icon.socicon{top:0px}.wp-block-wpzoom-blocks-social-icons.is-style-with-canvas-round .social-icon{font-size:var(--wpz-social-icons-block-item-font-size);padding:var(--wpz-social-icons-block-item-padding-vertical) var(--wpz-social-icons-block-item-padding-horizontal);margin:var(--wpz-social-icons-block-item-margin-vertical) var(--wpz-social-icons-block-item-margin-horizontal);border-radius:var(--wpz-social-icons-block-item-border-radius);background-color:var(--wpz-social-icons-block-item-color)}.wp-block-wpzoom-blocks-social-icons.is-style-with-canvas-round .social-icon:hover{background-color:var(--wpz-social-icons-block-item-color-hover)}.wp-block-wpzoom-blocks-social-icons.is-style-with-canvas-round .icon-label{color:var(--wpz-social-icons-block-label-color);font-size:var(--wpz-social-icons-block-label-font-size)}.wp-block-wpzoom-blocks-social-icons.is-style-with-canvas-round .icon-label:hover{color:var(--wpz-social-icons-block-label-color-hover)}.wp-block-wpzoom-blocks-social-icons.is-style-with-canvas-rounded .social-icon{font-size:var(--wpz-social-icons-block-item-font-size);padding:var(--wpz-social-icons-block-item-padding-vertical) var(--wpz-social-icons-block-item-padding-horizontal);margin:var(--wpz-social-icons-block-item-margin-vertical) var(--wpz-social-icons-block-item-margin-horizontal);border-radius:var(--wpz-social-icons-block-item-border-radius);background-color:var(--wpz-social-icons-block-item-color)}.wp-block-wpzoom-blocks-social-icons.is-style-with-canvas-rounded .social-icon:hover{background-color:var(--wpz-social-icons-block-item-color-hover)}.wp-block-wpzoom-blocks-social-icons.is-style-with-canvas-rounded .icon-label{color:var(--wpz-social-icons-block-label-color);font-size:var(--wpz-social-icons-block-label-font-size)}.wp-block-wpzoom-blocks-social-icons.is-style-with-canvas-rounded .icon-label:hover{color:var(--wpz-social-icons-block-label-color-hover)}.wp-block-wpzoom-blocks-social-icons.is-style-with-canvas-squared .social-icon{font-size:var(--wpz-social-icons-block-item-font-size);padding:var(--wpz-social-icons-block-item-padding-vertical) var(--wpz-social-icons-block-item-padding-horizontal);margin:var(--wpz-social-icons-block-item-margin-vertical) var(--wpz-social-icons-block-item-margin-horizontal);border-radius:var(--wpz-social-icons-block-item-border-radius);background-color:var(--wpz-social-icons-block-item-color)}.wp-block-wpzoom-blocks-social-icons.is-style-with-canvas-squared .social-icon:hover{background-color:var(--wpz-social-icons-block-item-color-hover)}.wp-block-wpzoom-blocks-social-icons.is-style-with-canvas-squared .icon-label{color:var(--wpz-social-icons-block-label-color);font-size:var(--wpz-social-icons-block-label-font-size)}.wp-block-wpzoom-blocks-social-icons.is-style-with-canvas-squared .icon-label:hover{color:var(--wpz-social-icons-block-label-color-hover)}.wp-block-wpzoom-blocks-social-icons.is-style-without-canvas .social-icon{font-size:var(--wpz-social-icons-block-item-font-size);padding:var(--wpz-social-icons-block-item-padding-vertical) var(--wpz-social-icons-block-item-padding-horizontal);margin:var(--wpz-social-icons-block-item-margin-vertical) var(--wpz-social-icons-block-item-margin-horizontal);border-radius:var(--wpz-social-icons-block-item-border-radius);color:var(--wpz-social-icons-block-item-color);background-color:transparent}.wp-block-wpzoom-blocks-social-icons.is-style-without-canvas .social-icon:hover{color:var(--wpz-social-icons-block-item-color-hover)}.wp-block-wpzoom-blocks-social-icons.is-style-without-canvas .icon-label{color:var(--wpz-social-icons-block-label-color);font-size:var(--wpz-social-icons-block-label-font-size)}.wp-block-wpzoom-blocks-social-icons.is-style-without-canvas .icon-label:hover{color:var(--wpz-social-icons-block-label-color-hover)}.wp-block-wpzoom-blocks-social-icons.is-style-without-canvas-with-border .social-icon{font-size:var(--wpz-social-icons-block-item-font-size);padding:var(--wpz-social-icons-block-item-padding-vertical) var(--wpz-social-icons-block-item-padding-horizontal);margin:var(--wpz-social-icons-block-item-margin-vertical) var(--wpz-social-icons-block-item-margin-horizontal);border-radius:var(--wpz-social-icons-block-item-border-radius);color:var(--wpz-social-icons-block-item-color);background-color:transparent;border-width:2px;border-style:solid}.wp-block-wpzoom-blocks-social-icons.is-style-without-canvas-with-border .social-icon:hover{color:var(--wpz-social-icons-block-item-color-hover)}.wp-block-wpzoom-blocks-social-icons.is-style-without-canvas-with-border .icon-label{color:var(--wpz-social-icons-block-label-color);font-size:var(--wpz-social-icons-block-label-font-size)}.wp-block-wpzoom-blocks-social-icons.is-style-without-canvas-with-border .icon-label:hover{color:var(--wpz-social-icons-block-label-color-hover)}.wp-block-wpzoom-blocks-social-icons.is-style-without-canvas-with-label .social-icon-link{display:flex;flex-direction:column;align-items:center}.wp-block-wpzoom-blocks-social-icons.is-style-without-canvas-with-label .social-icon-link .social-icon,.wp-block-wpzoom-blocks-social-icons.is-style-without-canvas-with-label .social-icon-link .icon-label{display:flex;justify-content:center}.wp-block-wpzoom-blocks-social-icons.is-style-without-canvas-with-label .social-icon-link .social-icon{background-color:transparent;color:var(--wpz-social-icons-block-item-color);font-size:var(--wpz-social-icons-block-item-font-size);padding:var(--wpz-social-icons-block-item-padding-vertical) var(--wpz-social-icons-block-item-padding-horizontal);margin:var(--wpz-social-icons-block-item-margin-vertical) var(--wpz-social-icons-block-item-margin-horizontal);border-radius:var(--wpz-social-icons-block-item-border-radius)}.wp-block-wpzoom-blocks-social-icons.is-style-without-canvas-with-label .social-icon-link .social-icon:hover{color:var(--wpz-social-icons-block-item-color-hover)}.wp-block-wpzoom-blocks-social-icons.is-style-without-canvas-with-label .social-icon-link .icon-label{padding:0px 5px 5px 5px;color:var(--wpz-social-icons-block-label-color);font-size:var(--wpz-social-icons-block-label-font-size)}.wp-block-wpzoom-blocks-social-icons.is-style-without-canvas-with-label .social-icon-link .icon-label:hover{color:var(--wpz-social-icons-block-label-color-hover)}.wp-block-wpzoom-blocks-social-icons.is-style-with-label-canvas-rounded .social-icon-link{color:#fff;margin:16px 10px;background-color:var(--wpz-social-icons-block-item-color);padding:var(--wpz-social-icons-block-item-padding-vertical) var(--wpz-social-icons-block-item-padding-horizontal);margin:var(--wpz-social-icons-block-item-margin-vertical) var(--wpz-social-icons-block-item-margin-horizontal);border-radius:var(--wpz-social-icons-block-item-border-radius)}.wp-block-wpzoom-blocks-social-icons.is-style-with-label-canvas-rounded .social-icon-link .social-icon{font-size:var(--wpz-social-icons-block-item-font-size);background-color:transparent;padding:0px}.wp-block-wpzoom-blocks-social-icons.is-style-with-label-canvas-rounded .social-icon-link:hover{background-color:var(--wpz-social-icons-block-item-color-hover)}.wp-block-wpzoom-blocks-social-icons.is-style-with-label-canvas-rounded .social-icon-link .icon-label{padding:5px 5px 5px 0px;color:var(--wpz-social-icons-block-label-color);font-size:var(--wpz-social-icons-block-label-font-size)}.wp-block-wpzoom-blocks-social-icons.is-style-with-label-canvas-rounded .social-icon-link .icon-label:hover{color:var(--wpz-social-icons-block-label-color-hover)}.zoom-social-icons-legacy-widget-title:empty,.zoom-social-icons-legacy-widget-description:empty{display:none !important}
|
block/dist/wpzoom-social-icons.asset.php
CHANGED
@@ -1 +1 @@
|
|
1 |
-
<?php return array('dependencies' => array('lodash', 'react', 'wp-a11y', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-polyfill', 'wp-primitives', 'wp-token-list', 'wp-url'), 'version' => '
|
1 |
+
<?php return array('dependencies' => array('lodash', 'react', 'wp-a11y', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-polyfill', 'wp-primitives', 'wp-token-list', 'wp-url'), 'version' => 'e6a448e5af5d5739675f0b35e7f3f0fb');
|
block/dist/wpzoom-social-icons.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
(window.webpackJsonp=window.webpackJsonp||[]).push([[0],{29:function(e,t,o){}}]),function(e){function t(t){for(var n,s,a=t[0],c=t[1],l=t[2],p=0,d=[];p<a.length;p++)s=a[p],Object.prototype.hasOwnProperty.call(r,s)&&r[s]&&d.push(r[s][0]),r[s]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);for(u&&u(t);d.length;)d.shift()();return i.push.apply(i,l||[]),o()}function o(){for(var e,t=0;t<i.length;t++){for(var o=i[t],n=!0,a=1;a<o.length;a++){var c=o[a];0!==r[c]&&(n=!1)}n&&(i.splice(t--,1),e=s(s.s=o[0]))}return e}var n={},r={1:0},i=[];function s(t){if(n[t])return n[t].exports;var o=n[t]={i:t,l:!1,exports:{}};return e[t].call(o.exports,o,o.exports,s),o.l=!0,o.exports}s.m=e,s.c=n,s.d=function(e,t,o){s.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.t=function(e,t){if(1&t&&(e=s(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(s.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)s.d(o,n,function(t){return e[t]}.bind(null,n));return o},s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,"a",t),t},s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.p="";var a=window.webpackJsonp=window.webpackJsonp||[],c=a.push.bind(a);a.push=t,a=a.slice();for(var l=0;l<a.length;l++)t(a[l]);var u=c;i.push([38,0]),o()}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.wp.components},function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.lodash},function(e,t){e.exports=function(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,o){var n;!function(){"use strict";var o={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var i=typeof n;if("string"===i||"number"===i)e.push(n);else if(Array.isArray(n)){if(n.length){var s=r.apply(null,n);s&&e.push(s)}}else if("object"===i)if(n.toString===Object.prototype.toString)for(var a in n)o.call(n,a)&&n[a]&&e.push(a);else e.push(n.toString())}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(n=function(){return r}.apply(t,[]))||(e.exports=n)}()},function(e,t){function o(t){return e.exports=o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.default=e.exports,e.exports.__esModule=!0,o(t)}e.exports=o,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function o(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=window.wp.blocks},function(e,t){e.exports=window.wp.primitives},function(e,t,o){var n=o(32);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&n(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,o){var n=o(33).default,r=o(5);e.exports=function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?r(e):t},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=window.wp.data},function(e,t){e.exports=window.wp.hooks},function(e,t,o){var n,r,i;!function(s,a){"use strict";e.exports?e.exports=a(o(20),o(21),o(22)):(r=[o(20),o(21),o(22)],void 0===(i="function"==typeof(n=a)?n.apply(t,r):n)||(e.exports=i))}(0,(function(e,t,o,n){"use strict";var r=n&&n.URI;function i(e,t){var o=arguments.length>=1,n=arguments.length>=2;if(!(this instanceof i))return o?n?new i(e,t):new i(e):new i;if(void 0===e){if(o)throw new TypeError("undefined is not a valid argument for URI");e="undefined"!=typeof location?location.href+"":""}if(null===e&&o)throw new TypeError("null is not a valid argument for URI");return this.href(e),void 0!==t?this.absoluteTo(t):this}i.version="1.19.7";var s=i.prototype,a=Object.prototype.hasOwnProperty;function c(e){return e.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function l(e){return void 0===e?"Undefined":String(Object.prototype.toString.call(e)).slice(8,-1)}function u(e){return"Array"===l(e)}function p(e,t){var o,n,r={};if("RegExp"===l(t))r=null;else if(u(t))for(o=0,n=t.length;o<n;o++)r[t[o]]=!0;else r[t]=!0;for(o=0,n=e.length;o<n;o++)(r&&void 0!==r[e[o]]||!r&&t.test(e[o]))&&(e.splice(o,1),n--,o--);return e}function d(e,t){var o,n;if(u(t)){for(o=0,n=t.length;o<n;o++)if(!d(e,t[o]))return!1;return!0}var r=l(t);for(o=0,n=e.length;o<n;o++)if("RegExp"===r){if("string"==typeof e[o]&&e[o].match(t))return!0}else if(e[o]===t)return!0;return!1}function h(e,t){if(!u(e)||!u(t))return!1;if(e.length!==t.length)return!1;e.sort(),t.sort();for(var o=0,n=e.length;o<n;o++)if(e[o]!==t[o])return!1;return!0}function m(e){return e.replace(/^\/+|\/+$/g,"")}function f(e){return escape(e)}function g(e){return encodeURIComponent(e).replace(/[!'()*]/g,f).replace(/\*/g,"%2A")}i._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:i.preventInvalidHostname,duplicateQueryParameters:i.duplicateQueryParameters,escapeQuerySpace:i.escapeQuerySpace}},i.preventInvalidHostname=!1,i.duplicateQueryParameters=!1,i.escapeQuerySpace=!0,i.protocol_expression=/^[a-z][a-z0-9.+-]*$/i,i.idn_expression=/[^a-z0-9\._-]/i,i.punycode_expression=/(xn--)/i,i.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,i.ip6_expression=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,i.find_uri_expression=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/gi,i.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},i.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},i.hostProtocols=["http","https"],i.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,i.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},i.getDomAttribute=function(e){if(e&&e.nodeName){var t=e.nodeName.toLowerCase();if("input"!==t||"image"===e.type)return i.domAttributes[t]}},i.encode=g,i.decode=decodeURIComponent,i.iso8859=function(){i.encode=escape,i.decode=unescape},i.unicode=function(){i.encode=g,i.decode=decodeURIComponent},i.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/gi,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/gi,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/gi,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},i.encodeQuery=function(e,t){var o=i.encode(e+"");return void 0===t&&(t=i.escapeQuerySpace),t?o.replace(/%20/g,"+"):o},i.decodeQuery=function(e,t){e+="",void 0===t&&(t=i.escapeQuerySpace);try{return i.decode(t?e.replace(/\+/g,"%20"):e)}catch(t){return e}};var b,v={encode:"encode",decode:"decode"},y=function(e,t){return function(o){try{return i[t](o+"").replace(i.characters[e][t].expression,(function(o){return i.characters[e][t].map[o]}))}catch(e){return o}}};for(b in v)i[b+"PathSegment"]=y("pathname",v[b]),i[b+"UrnPathSegment"]=y("urnpath",v[b]);var w=function(e,t,o){return function(n){var r;r=o?function(e){return i[t](i[o](e))}:i[t];for(var s=(n+"").split(e),a=0,c=s.length;a<c;a++)s[a]=r(s[a]);return s.join(e)}};function k(e){return function(t,o){return void 0===t?this._parts[e]||"":(this._parts[e]=t||null,this.build(!o),this)}}function I(e,t){return function(o,n){return void 0===o?this._parts[e]||"":(null!==o&&(o+="").charAt(0)===t&&(o=o.substring(1)),this._parts[e]=o,this.build(!n),this)}}i.decodePath=w("/","decodePathSegment"),i.decodeUrnPath=w(":","decodeUrnPathSegment"),i.recodePath=w("/","encodePathSegment","decode"),i.recodeUrnPath=w(":","encodeUrnPathSegment","decode"),i.encodeReserved=y("reserved","encode"),i.parse=function(e,t){var o;return t||(t={preventInvalidHostname:i.preventInvalidHostname}),(o=e.indexOf("#"))>-1&&(t.fragment=e.substring(o+1)||null,e=e.substring(0,o)),(o=e.indexOf("?"))>-1&&(t.query=e.substring(o+1)||null,e=e.substring(0,o)),"//"===(e=e.replace(/^(https?|ftp|wss?)?:[/\\]*/,"$1://")).substring(0,2)?(t.protocol=null,e=e.substring(2),e=i.parseAuthority(e,t)):(o=e.indexOf(":"))>-1&&(t.protocol=e.substring(0,o)||null,t.protocol&&!t.protocol.match(i.protocol_expression)?t.protocol=void 0:"//"===e.substring(o+1,o+3).replace(/\\/g,"/")?(e=e.substring(o+3),e=i.parseAuthority(e,t)):(e=e.substring(o+1),t.urn=!0)),t.path=e,t},i.parseHost=function(e,t){e||(e="");var o,n,r=(e=e.replace(/\\/g,"/")).indexOf("/");if(-1===r&&(r=e.length),"["===e.charAt(0))o=e.indexOf("]"),t.hostname=e.substring(1,o)||null,t.port=e.substring(o+2,r)||null,"/"===t.port&&(t.port=null);else{var s=e.indexOf(":"),a=e.indexOf("/"),c=e.indexOf(":",s+1);-1!==c&&(-1===a||c<a)?(t.hostname=e.substring(0,r)||null,t.port=null):(n=e.substring(0,r).split(":"),t.hostname=n[0]||null,t.port=n[1]||null)}return t.hostname&&"/"!==e.substring(r).charAt(0)&&(r++,e="/"+e),t.preventInvalidHostname&&i.ensureValidHostname(t.hostname,t.protocol),t.port&&i.ensureValidPort(t.port),e.substring(r)||"/"},i.parseAuthority=function(e,t){return e=i.parseUserinfo(e,t),i.parseHost(e,t)},i.parseUserinfo=function(e,t){var o=e;-1!==e.indexOf("\\")&&(e=e.replace(/\\/g,"/"));var n,r=e.indexOf("/"),s=e.lastIndexOf("@",r>-1?r:e.length-1);return s>-1&&(-1===r||s<r)?(n=e.substring(0,s).split(":"),t.username=n[0]?i.decode(n[0]):null,n.shift(),t.password=n[0]?i.decode(n.join(":")):null,e=o.substring(s+1)):(t.username=null,t.password=null),e},i.parseQuery=function(e,t){if(!e)return{};if(!(e=e.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,"")))return{};for(var o,n,r,s={},c=e.split("&"),l=c.length,u=0;u<l;u++)o=c[u].split("="),n=i.decodeQuery(o.shift(),t),r=o.length?i.decodeQuery(o.join("="),t):null,"__proto__"!==n&&(a.call(s,n)?("string"!=typeof s[n]&&null!==s[n]||(s[n]=[s[n]]),s[n].push(r)):s[n]=r);return s},i.build=function(e){var t="",o=!1;return e.protocol&&(t+=e.protocol+":"),e.urn||!t&&!e.hostname||(t+="//",o=!0),t+=i.buildAuthority(e)||"","string"==typeof e.path&&("/"!==e.path.charAt(0)&&o&&(t+="/"),t+=e.path),"string"==typeof e.query&&e.query&&(t+="?"+e.query),"string"==typeof e.fragment&&e.fragment&&(t+="#"+e.fragment),t},i.buildHost=function(e){var t="";return e.hostname?(i.ip6_expression.test(e.hostname)?t+="["+e.hostname+"]":t+=e.hostname,e.port&&(t+=":"+e.port),t):""},i.buildAuthority=function(e){return i.buildUserinfo(e)+i.buildHost(e)},i.buildUserinfo=function(e){var t="";return e.username&&(t+=i.encode(e.username)),e.password&&(t+=":"+i.encode(e.password)),t&&(t+="@"),t},i.buildQuery=function(e,t,o){var n,r,s,c,l="";for(r in e)if("__proto__"!==r&&a.call(e,r))if(u(e[r]))for(n={},s=0,c=e[r].length;s<c;s++)void 0!==e[r][s]&&void 0===n[e[r][s]+""]&&(l+="&"+i.buildQueryParameter(r,e[r][s],o),!0!==t&&(n[e[r][s]+""]=!0));else void 0!==e[r]&&(l+="&"+i.buildQueryParameter(r,e[r],o));return l.substring(1)},i.buildQueryParameter=function(e,t,o){return i.encodeQuery(e,o)+(null!==t?"="+i.encodeQuery(t,o):"")},i.addQuery=function(e,t,o){if("object"==typeof t)for(var n in t)a.call(t,n)&&i.addQuery(e,n,t[n]);else{if("string"!=typeof t)throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");if(void 0===e[t])return void(e[t]=o);"string"==typeof e[t]&&(e[t]=[e[t]]),u(o)||(o=[o]),e[t]=(e[t]||[]).concat(o)}},i.setQuery=function(e,t,o){if("object"==typeof t)for(var n in t)a.call(t,n)&&i.setQuery(e,n,t[n]);else{if("string"!=typeof t)throw new TypeError("URI.setQuery() accepts an object, string as the name parameter");e[t]=void 0===o?null:o}},i.removeQuery=function(e,t,o){var n,r,s;if(u(t))for(n=0,r=t.length;n<r;n++)e[t[n]]=void 0;else if("RegExp"===l(t))for(s in e)t.test(s)&&(e[s]=void 0);else if("object"==typeof t)for(s in t)a.call(t,s)&&i.removeQuery(e,s,t[s]);else{if("string"!=typeof t)throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter");void 0!==o?"RegExp"===l(o)?!u(e[t])&&o.test(e[t])?e[t]=void 0:e[t]=p(e[t],o):e[t]!==String(o)||u(o)&&1!==o.length?u(e[t])&&(e[t]=p(e[t],o)):e[t]=void 0:e[t]=void 0}},i.hasQuery=function(e,t,o,n){switch(l(t)){case"String":break;case"RegExp":for(var r in e)if(a.call(e,r)&&t.test(r)&&(void 0===o||i.hasQuery(e,r,o)))return!0;return!1;case"Object":for(var s in t)if(a.call(t,s)&&!i.hasQuery(e,s,t[s]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(l(o)){case"Undefined":return t in e;case"Boolean":return o===Boolean(u(e[t])?e[t].length:e[t]);case"Function":return!!o(e[t],t,e);case"Array":return!!u(e[t])&&(n?d:h)(e[t],o);case"RegExp":return u(e[t])?!!n&&d(e[t],o):Boolean(e[t]&&e[t].match(o));case"Number":o=String(o);case"String":return u(e[t])?!!n&&d(e[t],o):e[t]===o;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},i.joinPaths=function(){for(var e=[],t=[],o=0,n=0;n<arguments.length;n++){var r=new i(arguments[n]);e.push(r);for(var s=r.segment(),a=0;a<s.length;a++)"string"==typeof s[a]&&t.push(s[a]),s[a]&&o++}if(!t.length||!o)return new i("");var c=new i("").segment(t);return""!==e[0].path()&&"/"!==e[0].path().slice(0,1)||c.path("/"+c.path()),c.normalize()},i.commonPath=function(e,t){var o,n=Math.min(e.length,t.length);for(o=0;o<n;o++)if(e.charAt(o)!==t.charAt(o)){o--;break}return o<1?e.charAt(0)===t.charAt(0)&&"/"===e.charAt(0)?"/":"":("/"===e.charAt(o)&&"/"===t.charAt(o)||(o=e.substring(0,o).lastIndexOf("/")),e.substring(0,o+1))},i.withinString=function(e,t,o){o||(o={});var n=o.start||i.findUri.start,r=o.end||i.findUri.end,s=o.trim||i.findUri.trim,a=o.parens||i.findUri.parens,c=/[a-z0-9-]=["']?$/i;for(n.lastIndex=0;;){var l=n.exec(e);if(!l)break;var u=l.index;if(o.ignoreHtml){var p=e.slice(Math.max(u-3,0),u);if(p&&c.test(p))continue}for(var d=u+e.slice(u).search(r),h=e.slice(u,d),m=-1;;){var f=a.exec(h);if(!f)break;var g=f.index+f[0].length;m=Math.max(m,g)}if(!((h=m>-1?h.slice(0,m)+h.slice(m).replace(s,""):h.replace(s,"")).length<=l[0].length||o.ignore&&o.ignore.test(h))){var b=t(h,u,d=u+h.length,e);void 0!==b?(b=String(b),e=e.slice(0,u)+b+e.slice(d),n.lastIndex=u+b.length):n.lastIndex=d}}return n.lastIndex=0,e},i.ensureValidHostname=function(t,o){var n=!!t,r=!1;if(!!o&&(r=d(i.hostProtocols,o)),r&&!n)throw new TypeError("Hostname cannot be empty, if protocol is "+o);if(t&&t.match(i.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(t).match(i.invalid_hostname_characters))throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-:_]')}},i.ensureValidPort=function(e){if(e){var t=Number(e);if(!(/^[0-9]+$/.test(t)&&t>0&&t<65536))throw new TypeError('Port "'+e+'" is not a valid port')}},i.noConflict=function(e){if(e){var t={URI:this.noConflict()};return n.URITemplate&&"function"==typeof n.URITemplate.noConflict&&(t.URITemplate=n.URITemplate.noConflict()),n.IPv6&&"function"==typeof n.IPv6.noConflict&&(t.IPv6=n.IPv6.noConflict()),n.SecondLevelDomains&&"function"==typeof n.SecondLevelDomains.noConflict&&(t.SecondLevelDomains=n.SecondLevelDomains.noConflict()),t}return n.URI===this&&(n.URI=r),this},s.build=function(e){return!0===e?this._deferred_build=!0:(void 0===e||this._deferred_build)&&(this._string=i.build(this._parts),this._deferred_build=!1),this},s.clone=function(){return new i(this)},s.valueOf=s.toString=function(){return this.build(!1)._string},s.protocol=k("protocol"),s.username=k("username"),s.password=k("password"),s.hostname=k("hostname"),s.port=k("port"),s.query=I("query","?"),s.fragment=I("fragment","#"),s.search=function(e,t){var o=this.query(e,t);return"string"==typeof o&&o.length?"?"+o:o},s.hash=function(e,t){var o=this.fragment(e,t);return"string"==typeof o&&o.length?"#"+o:o},s.pathname=function(e,t){if(void 0===e||!0===e){var o=this._parts.path||(this._parts.hostname?"/":"");return e?(this._parts.urn?i.decodeUrnPath:i.decodePath)(o):o}return this._parts.urn?this._parts.path=e?i.recodeUrnPath(e):"":this._parts.path=e?i.recodePath(e):"/",this.build(!t),this},s.path=s.pathname,s.href=function(e,t){var o;if(void 0===e)return this.toString();this._string="",this._parts=i._parts();var n=e instanceof i,r="object"==typeof e&&(e.hostname||e.path||e.pathname);if(e.nodeName&&(e=e[i.getDomAttribute(e)]||"",r=!1),!n&&r&&void 0!==e.pathname&&(e=e.toString()),"string"==typeof e||e instanceof String)this._parts=i.parse(String(e),this._parts);else{if(!n&&!r)throw new TypeError("invalid input");var s=n?e._parts:e;for(o in s)"query"!==o&&a.call(this._parts,o)&&(this._parts[o]=s[o]);s.query&&this.query(s.query,!1)}return this.build(!t),this},s.is=function(e){var t=!1,n=!1,r=!1,s=!1,a=!1,c=!1,l=!1,u=!this._parts.urn;switch(this._parts.hostname&&(u=!1,n=i.ip4_expression.test(this._parts.hostname),r=i.ip6_expression.test(this._parts.hostname),a=(s=!(t=n||r))&&o&&o.has(this._parts.hostname),c=s&&i.idn_expression.test(this._parts.hostname),l=s&&i.punycode_expression.test(this._parts.hostname)),e.toLowerCase()){case"relative":return u;case"absolute":return!u;case"domain":case"name":return s;case"sld":return a;case"ip":return t;case"ip4":case"ipv4":case"inet4":return n;case"ip6":case"ipv6":case"inet6":return r;case"idn":return c;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return l}return null};var O=s.protocol,A=s.port,j=s.hostname;s.protocol=function(e,t){if(e&&!(e=e.replace(/:(\/\/)?$/,"")).match(i.protocol_expression))throw new TypeError('Protocol "'+e+"\" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]");return O.call(this,e,t)},s.scheme=s.protocol,s.port=function(e,t){return this._parts.urn?void 0===e?"":this:(void 0!==e&&(0===e&&(e=null),e&&(":"===(e+="").charAt(0)&&(e=e.substring(1)),i.ensureValidPort(e))),A.call(this,e,t))},s.hostname=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0!==e){var o={preventInvalidHostname:this._parts.preventInvalidHostname};if("/"!==i.parseHost(e,o))throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');e=o.hostname,this._parts.preventInvalidHostname&&i.ensureValidHostname(e,this._parts.protocol)}return j.call(this,e,t)},s.origin=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e){var o=this.protocol();return this.authority()?(o?o+"://":"")+this.authority():""}var n=i(e);return this.protocol(n.protocol()).authority(n.authority()).build(!t),this},s.host=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e)return this._parts.hostname?i.buildHost(this._parts):"";if("/"!==i.parseHost(e,this._parts))throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');return this.build(!t),this},s.authority=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e)return this._parts.hostname?i.buildAuthority(this._parts):"";if("/"!==i.parseAuthority(e,this._parts))throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');return this.build(!t),this},s.userinfo=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e){var o=i.buildUserinfo(this._parts);return o?o.substring(0,o.length-1):o}return"@"!==e[e.length-1]&&(e+="@"),i.parseUserinfo(e,this._parts),this.build(!t),this},s.resource=function(e,t){var o;return void 0===e?this.path()+this.search()+this.hash():(o=i.parse(e),this._parts.path=o.path,this._parts.query=o.query,this._parts.fragment=o.fragment,this.build(!t),this)},s.subdomain=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e){if(!this._parts.hostname||this.is("IP"))return"";var o=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,o)||""}var n=this._parts.hostname.length-this.domain().length,r=this._parts.hostname.substring(0,n),s=new RegExp("^"+c(r));if(e&&"."!==e.charAt(e.length-1)&&(e+="."),-1!==e.indexOf(":"))throw new TypeError("Domains cannot contain colons");return e&&i.ensureValidHostname(e,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(s,e),this.build(!t),this},s.domain=function(e,t){if(this._parts.urn)return void 0===e?"":this;if("boolean"==typeof e&&(t=e,e=void 0),void 0===e){if(!this._parts.hostname||this.is("IP"))return"";var o=this._parts.hostname.match(/\./g);if(o&&o.length<2)return this._parts.hostname;var n=this._parts.hostname.length-this.tld(t).length-1;return n=this._parts.hostname.lastIndexOf(".",n-1)+1,this._parts.hostname.substring(n)||""}if(!e)throw new TypeError("cannot set domain empty");if(-1!==e.indexOf(":"))throw new TypeError("Domains cannot contain colons");if(i.ensureValidHostname(e,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=e;else{var r=new RegExp(c(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(r,e)}return this.build(!t),this},s.tld=function(e,t){if(this._parts.urn)return void 0===e?"":this;if("boolean"==typeof e&&(t=e,e=void 0),void 0===e){if(!this._parts.hostname||this.is("IP"))return"";var n=this._parts.hostname.lastIndexOf("."),r=this._parts.hostname.substring(n+1);return!0!==t&&o&&o.list[r.toLowerCase()]&&o.get(this._parts.hostname)||r}var i;if(!e)throw new TypeError("cannot set TLD empty");if(e.match(/[^a-zA-Z0-9-]/)){if(!o||!o.is(e))throw new TypeError('TLD "'+e+'" contains characters other than [A-Z0-9]');i=new RegExp(c(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(i,e)}else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");i=new RegExp(c(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(i,e)}return this.build(!t),this},s.directory=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e||!0===e){if(!this._parts.path&&!this._parts.hostname)return"";if("/"===this._parts.path)return"/";var o=this._parts.path.length-this.filename().length-1,n=this._parts.path.substring(0,o)||(this._parts.hostname?"/":"");return e?i.decodePath(n):n}var r=this._parts.path.length-this.filename().length,s=this._parts.path.substring(0,r),a=new RegExp("^"+c(s));return this.is("relative")||(e||(e="/"),"/"!==e.charAt(0)&&(e="/"+e)),e&&"/"!==e.charAt(e.length-1)&&(e+="/"),e=i.recodePath(e),this._parts.path=this._parts.path.replace(a,e),this.build(!t),this},s.filename=function(e,t){if(this._parts.urn)return void 0===e?"":this;if("string"!=typeof e){if(!this._parts.path||"/"===this._parts.path)return"";var o=this._parts.path.lastIndexOf("/"),n=this._parts.path.substring(o+1);return e?i.decodePathSegment(n):n}var r=!1;"/"===e.charAt(0)&&(e=e.substring(1)),e.match(/\.?\//)&&(r=!0);var s=new RegExp(c(this.filename())+"$");return e=i.recodePath(e),this._parts.path=this._parts.path.replace(s,e),r?this.normalizePath(t):this.build(!t),this},s.suffix=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e||!0===e){if(!this._parts.path||"/"===this._parts.path)return"";var o,n,r=this.filename(),s=r.lastIndexOf(".");return-1===s?"":(o=r.substring(s+1),n=/^[a-z0-9%]+$/i.test(o)?o:"",e?i.decodePathSegment(n):n)}"."===e.charAt(0)&&(e=e.substring(1));var a,l=this.suffix();if(l)a=e?new RegExp(c(l)+"$"):new RegExp(c("."+l)+"$");else{if(!e)return this;this._parts.path+="."+i.recodePath(e)}return a&&(e=i.recodePath(e),this._parts.path=this._parts.path.replace(a,e)),this.build(!t),this},s.segment=function(e,t,o){var n=this._parts.urn?":":"/",r=this.path(),i="/"===r.substring(0,1),s=r.split(n);if(void 0!==e&&"number"!=typeof e&&(o=t,t=e,e=void 0),void 0!==e&&"number"!=typeof e)throw new Error('Bad segment "'+e+'", must be 0-based integer');if(i&&s.shift(),e<0&&(e=Math.max(s.length+e,0)),void 0===t)return void 0===e?s:s[e];if(null===e||void 0===s[e])if(u(t)){s=[];for(var a=0,c=t.length;a<c;a++)(t[a].length||s.length&&s[s.length-1].length)&&(s.length&&!s[s.length-1].length&&s.pop(),s.push(m(t[a])))}else(t||"string"==typeof t)&&(t=m(t),""===s[s.length-1]?s[s.length-1]=t:s.push(t));else t?s[e]=m(t):s.splice(e,1);return i&&s.unshift(""),this.path(s.join(n),o)},s.segmentCoded=function(e,t,o){var n,r,s;if("number"!=typeof e&&(o=t,t=e,e=void 0),void 0===t){if(u(n=this.segment(e,t,o)))for(r=0,s=n.length;r<s;r++)n[r]=i.decode(n[r]);else n=void 0!==n?i.decode(n):void 0;return n}if(u(t))for(r=0,s=t.length;r<s;r++)t[r]=i.encode(t[r]);else t="string"==typeof t||t instanceof String?i.encode(t):t;return this.segment(e,t,o)};var C=s.query;return s.query=function(e,t){if(!0===e)return i.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if("function"==typeof e){var o=i.parseQuery(this._parts.query,this._parts.escapeQuerySpace),n=e.call(this,o);return this._parts.query=i.buildQuery(n||o,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!t),this}return void 0!==e&&"string"!=typeof e?(this._parts.query=i.buildQuery(e,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!t),this):C.call(this,e,t)},s.setQuery=function(e,t,o){var n=i.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if("string"==typeof e||e instanceof String)n[e]=void 0!==t?t:null;else{if("object"!=typeof e)throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");for(var r in e)a.call(e,r)&&(n[r]=e[r])}return this._parts.query=i.buildQuery(n,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!=typeof e&&(o=t),this.build(!o),this},s.addQuery=function(e,t,o){var n=i.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return i.addQuery(n,e,void 0===t?null:t),this._parts.query=i.buildQuery(n,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!=typeof e&&(o=t),this.build(!o),this},s.removeQuery=function(e,t,o){var n=i.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return i.removeQuery(n,e,t),this._parts.query=i.buildQuery(n,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!=typeof e&&(o=t),this.build(!o),this},s.hasQuery=function(e,t,o){var n=i.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return i.hasQuery(n,e,t,o)},s.setSearch=s.setQuery,s.addSearch=s.addQuery,s.removeSearch=s.removeQuery,s.hasSearch=s.hasQuery,s.normalize=function(){return this._parts.urn?this.normalizeProtocol(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build():this.normalizeProtocol(!1).normalizeHostname(!1).normalizePort(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build()},s.normalizeProtocol=function(e){return"string"==typeof this._parts.protocol&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!e)),this},s.normalizeHostname=function(o){return this._parts.hostname&&(this.is("IDN")&&e?this._parts.hostname=e.toASCII(this._parts.hostname):this.is("IPv6")&&t&&(this._parts.hostname=t.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!o)),this},s.normalizePort=function(e){return"string"==typeof this._parts.protocol&&this._parts.port===i.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!e)),this},s.normalizePath=function(e){var t,o=this._parts.path;if(!o)return this;if(this._parts.urn)return this._parts.path=i.recodeUrnPath(this._parts.path),this.build(!e),this;if("/"===this._parts.path)return this;var n,r,s="";for("/"!==(o=i.recodePath(o)).charAt(0)&&(t=!0,o="/"+o),"/.."!==o.slice(-3)&&"/."!==o.slice(-2)||(o+="/"),o=o.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),t&&(s=o.substring(1).match(/^(\.\.\/)+/)||"")&&(s=s[0]);-1!==(n=o.search(/\/\.\.(\/|$)/));)0!==n?(-1===(r=o.substring(0,n).lastIndexOf("/"))&&(r=n),o=o.substring(0,r)+o.substring(n+3)):o=o.substring(3);return t&&this.is("relative")&&(o=s+o.substring(1)),this._parts.path=o,this.build(!e),this},s.normalizePathname=s.normalizePath,s.normalizeQuery=function(e){return"string"==typeof this._parts.query&&(this._parts.query.length?this.query(i.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!e)),this},s.normalizeFragment=function(e){return this._parts.fragment||(this._parts.fragment=null,this.build(!e)),this},s.normalizeSearch=s.normalizeQuery,s.normalizeHash=s.normalizeFragment,s.iso8859=function(){var e=i.encode,t=i.decode;i.encode=escape,i.decode=decodeURIComponent;try{this.normalize()}finally{i.encode=e,i.decode=t}return this},s.unicode=function(){var e=i.encode,t=i.decode;i.encode=g,i.decode=unescape;try{this.normalize()}finally{i.encode=e,i.decode=t}return this},s.readable=function(){var t=this.clone();t.username("").password("").normalize();var o="";if(t._parts.protocol&&(o+=t._parts.protocol+"://"),t._parts.hostname&&(t.is("punycode")&&e?(o+=e.toUnicode(t._parts.hostname),t._parts.port&&(o+=":"+t._parts.port)):o+=t.host()),t._parts.hostname&&t._parts.path&&"/"!==t._parts.path.charAt(0)&&(o+="/"),o+=t.path(!0),t._parts.query){for(var n="",r=0,s=t._parts.query.split("&"),a=s.length;r<a;r++){var c=(s[r]||"").split("=");n+="&"+i.decodeQuery(c[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),void 0!==c[1]&&(n+="="+i.decodeQuery(c[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}o+="?"+n.substring(1)}return o+i.decodeQuery(t.hash(),!0)},s.absoluteTo=function(e){var t,o,n,r=this.clone(),s=["protocol","username","password","hostname","port"];if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(e instanceof i||(e=new i(e)),r._parts.protocol)return r;if(r._parts.protocol=e._parts.protocol,this._parts.hostname)return r;for(o=0;n=s[o];o++)r._parts[n]=e._parts[n];return r._parts.path?(".."===r._parts.path.substring(-2)&&(r._parts.path+="/"),"/"!==r.path().charAt(0)&&(t=(t=e.directory())||(0===e.path().indexOf("/")?"/":""),r._parts.path=(t?t+"/":"")+r._parts.path,r.normalizePath())):(r._parts.path=e._parts.path,r._parts.query||(r._parts.query=e._parts.query)),r.build(),r},s.relativeTo=function(e){var t,o,n,r,s,a=this.clone().normalize();if(a._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(e=new i(e).normalize(),t=a._parts,o=e._parts,r=a.path(),s=e.path(),"/"!==r.charAt(0))throw new Error("URI is already relative");if("/"!==s.charAt(0))throw new Error("Cannot calculate a URI relative to another relative URI");if(t.protocol===o.protocol&&(t.protocol=null),t.username!==o.username||t.password!==o.password)return a.build();if(null!==t.protocol||null!==t.username||null!==t.password)return a.build();if(t.hostname!==o.hostname||t.port!==o.port)return a.build();if(t.hostname=null,t.port=null,r===s)return t.path="",a.build();if(!(n=i.commonPath(r,s)))return a.build();var c=o.path.substring(n.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return t.path=c+t.path.substring(n.length)||"./",a.build()},s.equals=function(e){var t,o,n,r,s,c=this.clone(),l=new i(e),p={};if(c.normalize(),l.normalize(),c.toString()===l.toString())return!0;if(n=c.query(),r=l.query(),c.query(""),l.query(""),c.toString()!==l.toString())return!1;if(n.length!==r.length)return!1;for(s in t=i.parseQuery(n,this._parts.escapeQuerySpace),o=i.parseQuery(r,this._parts.escapeQuerySpace),t)if(a.call(t,s)){if(u(t[s])){if(!h(t[s],o[s]))return!1}else if(t[s]!==o[s])return!1;p[s]=!0}for(s in o)if(a.call(o,s)&&!p[s])return!1;return!0},s.preventInvalidHostname=function(e){return this._parts.preventInvalidHostname=!!e,this},s.duplicateQueryParameters=function(e){return this._parts.duplicateQueryParameters=!!e,this},s.escapeQuerySpace=function(e){return this._parts.escapeQuerySpace=!!e,this},i}))},function(e,t){e.exports=window.wp.blockEditor},function(e,t){e.exports=window.wp.compose},function(e,t){e.exports=window.wp.url},function(e,t,o){(function(e,n){var r;!function(i){t&&t.nodeType,e&&e.nodeType;var s="object"==typeof n&&n;s.global!==s&&s.window!==s&&s.self;var a,c=2147483647,l=/^xn--/,u=/[^\x20-\x7E]/,p=/[\x2E\u3002\uFF0E\uFF61]/g,d={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},h=Math.floor,m=String.fromCharCode;function f(e){throw new RangeError(d[e])}function g(e,t){for(var o=e.length,n=[];o--;)n[o]=t(e[o]);return n}function b(e,t){var o=e.split("@"),n="";return o.length>1&&(n=o[0]+"@",e=o[1]),n+g((e=e.replace(p,".")).split("."),t).join(".")}function v(e){for(var t,o,n=[],r=0,i=e.length;r<i;)(t=e.charCodeAt(r++))>=55296&&t<=56319&&r<i?56320==(64512&(o=e.charCodeAt(r++)))?n.push(((1023&t)<<10)+(1023&o)+65536):(n.push(t),r--):n.push(t);return n}function y(e){return g(e,(function(e){var t="";return e>65535&&(t+=m((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+m(e)})).join("")}function w(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function k(e,t,o){var n=0;for(e=o?h(e/700):e>>1,e+=h(e/t);e>455;n+=36)e=h(e/35);return h(n+36*e/(e+38))}function I(e){var t,o,n,r,i,s,a,l,u,p,d,m=[],g=e.length,b=0,v=128,w=72;for((o=e.lastIndexOf("-"))<0&&(o=0),n=0;n<o;++n)e.charCodeAt(n)>=128&&f("not-basic"),m.push(e.charCodeAt(n));for(r=o>0?o+1:0;r<g;){for(i=b,s=1,a=36;r>=g&&f("invalid-input"),((l=(d=e.charCodeAt(r++))-48<10?d-22:d-65<26?d-65:d-97<26?d-97:36)>=36||l>h((c-b)/s))&&f("overflow"),b+=l*s,!(l<(u=a<=w?1:a>=w+26?26:a-w));a+=36)s>h(c/(p=36-u))&&f("overflow"),s*=p;w=k(b-i,t=m.length+1,0==i),h(b/t)>c-v&&f("overflow"),v+=h(b/t),b%=t,m.splice(b++,0,v)}return y(m)}function O(e){var t,o,n,r,i,s,a,l,u,p,d,g,b,y,I,O=[];for(g=(e=v(e)).length,t=128,o=0,i=72,s=0;s<g;++s)(d=e[s])<128&&O.push(m(d));for(n=r=O.length,r&&O.push("-");n<g;){for(a=c,s=0;s<g;++s)(d=e[s])>=t&&d<a&&(a=d);for(a-t>h((c-o)/(b=n+1))&&f("overflow"),o+=(a-t)*b,t=a,s=0;s<g;++s)if((d=e[s])<t&&++o>c&&f("overflow"),d==t){for(l=o,u=36;!(l<(p=u<=i?1:u>=i+26?26:u-i));u+=36)I=l-p,y=36-p,O.push(m(w(p+I%y,0))),l=h(I/y);O.push(m(w(l,0))),i=k(o,b,n==r),o=0,++n}++o,++t}return O.join("")}a={version:"1.3.2",ucs2:{decode:v,encode:y},decode:I,encode:O,toASCII:function(e){return b(e,(function(e){return u.test(e)?"xn--"+O(e):e}))},toUnicode:function(e){return b(e,(function(e){return l.test(e)?I(e.slice(4).toLowerCase()):e}))}},void 0===(r=function(){return a}.call(t,o,t,e))||(e.exports=r)}()}).call(this,o(30)(e),o(31))},function(e,t,o){var n,r;!function(i,s){"use strict";e.exports?e.exports=s():void 0===(r="function"==typeof(n=s)?n.call(t,o,t,e):n)||(e.exports=r)}(0,(function(e){"use strict";var t=e&&e.IPv6;return{best:function(e){var t,o,n=e.toLowerCase().split(":"),r=n.length,i=8;for(""===n[0]&&""===n[1]&&""===n[2]?(n.shift(),n.shift()):""===n[0]&&""===n[1]?n.shift():""===n[r-1]&&""===n[r-2]&&n.pop(),-1!==n[(r=n.length)-1].indexOf(".")&&(i=7),t=0;t<r&&""!==n[t];t++);if(t<i)for(n.splice(t,1,"0000");n.length<i;)n.splice(t,0,"0000");for(var s=0;s<i;s++){o=n[s].split("");for(var a=0;a<3&&"0"===o[0]&&o.length>1;a++)o.splice(0,1);n[s]=o.join("")}var c=-1,l=0,u=0,p=-1,d=!1;for(s=0;s<i;s++)d?"0"===n[s]?u+=1:(d=!1,u>l&&(c=p,l=u)):"0"===n[s]&&(d=!0,p=s,u=1);u>l&&(c=p,l=u),l>1&&n.splice(c,l,""),r=n.length;var h="";for(""===n[0]&&(h=":"),s=0;s<r&&(h+=n[s],s!==r-1);s++)h+=":";return""===n[r-1]&&(h+=":"),h},noConflict:function(){return e.IPv6===this&&(e.IPv6=t),this}}}))},function(e,t,o){var n,r;!function(i,s){"use strict";e.exports?e.exports=s():void 0===(r="function"==typeof(n=s)?n.call(t,o,t,e):n)||(e.exports=r)}(0,(function(e){"use strict";var t=e&&e.SecondLevelDomains,o={list:{ac:" com gov mil net org ",ae:" ac co gov mil name net org pro sch ",af:" com edu gov net org ",al:" com edu gov mil net org ",ao:" co ed gv it og pb ",ar:" com edu gob gov int mil net org tur ",at:" ac co gv or ",au:" asn com csiro edu gov id net org ",ba:" co com edu gov mil net org rs unbi unmo unsa untz unze ",bb:" biz co com edu gov info net org store tv ",bh:" biz cc com edu gov info net org ",bn:" com edu gov net org ",bo:" com edu gob gov int mil net org tv ",br:" adm adv agr am arq art ato b bio blog bmd cim cng cnt com coop ecn edu eng esp etc eti far flog fm fnd fot fst g12 ggf gov imb ind inf jor jus lel mat med mil mus net nom not ntr odo org ppg pro psc psi qsl rec slg srv tmp trd tur tv vet vlog wiki zlg ",bs:" com edu gov net org ",bz:" du et om ov rg ",ca:" ab bc mb nb nf nl ns nt nu on pe qc sk yk ",ck:" biz co edu gen gov info net org ",cn:" ac ah bj com cq edu fj gd gov gs gx gz ha hb he hi hl hn jl js jx ln mil net nm nx org qh sc sd sh sn sx tj tw xj xz yn zj ",co:" com edu gov mil net nom org ",cr:" ac c co ed fi go or sa ",cy:" ac biz com ekloges gov ltd name net org parliament press pro tm ",do:" art com edu gob gov mil net org sld web ",dz:" art asso com edu gov net org pol ",ec:" com edu fin gov info med mil net org pro ",eg:" com edu eun gov mil name net org sci ",er:" com edu gov ind mil net org rochest w ",es:" com edu gob nom org ",et:" biz com edu gov info name net org ",fj:" ac biz com info mil name net org pro ",fk:" ac co gov net nom org ",fr:" asso com f gouv nom prd presse tm ",gg:" co net org ",gh:" com edu gov mil org ",gn:" ac com gov net org ",gr:" com edu gov mil net org ",gt:" com edu gob ind mil net org ",gu:" com edu gov net org ",hk:" com edu gov idv net org ",hu:" 2000 agrar bolt casino city co erotica erotika film forum games hotel info ingatlan jogasz konyvelo lakas media news org priv reklam sex shop sport suli szex tm tozsde utazas video ",id:" ac co go mil net or sch web ",il:" ac co gov idf k12 muni net org ",in:" ac co edu ernet firm gen gov i ind mil net nic org res ",iq:" com edu gov i mil net org ",ir:" ac co dnssec gov i id net org sch ",it:" edu gov ",je:" co net org ",jo:" com edu gov mil name net org sch ",jp:" ac ad co ed go gr lg ne or ",ke:" ac co go info me mobi ne or sc ",kh:" com edu gov mil net org per ",ki:" biz com de edu gov info mob net org tel ",km:" asso com coop edu gouv k medecin mil nom notaires pharmaciens presse tm veterinaire ",kn:" edu gov net org ",kr:" ac busan chungbuk chungnam co daegu daejeon es gangwon go gwangju gyeongbuk gyeonggi gyeongnam hs incheon jeju jeonbuk jeonnam k kg mil ms ne or pe re sc seoul ulsan ",kw:" com edu gov net org ",ky:" com edu gov net org ",kz:" com edu gov mil net org ",lb:" com edu gov net org ",lk:" assn com edu gov grp hotel int ltd net ngo org sch soc web ",lr:" com edu gov net org ",lv:" asn com conf edu gov id mil net org ",ly:" com edu gov id med net org plc sch ",ma:" ac co gov m net org press ",mc:" asso tm ",me:" ac co edu gov its net org priv ",mg:" com edu gov mil nom org prd tm ",mk:" com edu gov inf name net org pro ",ml:" com edu gov net org presse ",mn:" edu gov org ",mo:" com edu gov net org ",mt:" com edu gov net org ",mv:" aero biz com coop edu gov info int mil museum name net org pro ",mw:" ac co com coop edu gov int museum net org ",mx:" com edu gob net org ",my:" com edu gov mil name net org sch ",nf:" arts com firm info net other per rec store web ",ng:" biz com edu gov mil mobi name net org sch ",ni:" ac co com edu gob mil net nom org ",np:" com edu gov mil net org ",nr:" biz com edu gov info net org ",om:" ac biz co com edu gov med mil museum net org pro sch ",pe:" com edu gob mil net nom org sld ",ph:" com edu gov i mil net ngo org ",pk:" biz com edu fam gob gok gon gop gos gov net org web ",pl:" art bialystok biz com edu gda gdansk gorzow gov info katowice krakow lodz lublin mil net ngo olsztyn org poznan pwr radom slupsk szczecin torun warszawa waw wroc wroclaw zgora ",pr:" ac biz com edu est gov info isla name net org pro prof ",ps:" com edu gov net org plo sec ",pw:" belau co ed go ne or ",ro:" arts com firm info nom nt org rec store tm www ",rs:" ac co edu gov in org ",sb:" com edu gov net org ",sc:" com edu gov net org ",sh:" co com edu gov net nom org ",sl:" com edu gov net org ",st:" co com consulado edu embaixada gov mil net org principe saotome store ",sv:" com edu gob org red ",sz:" ac co org ",tr:" av bbs bel biz com dr edu gen gov info k12 name net org pol tel tsk tv web ",tt:" aero biz cat co com coop edu gov info int jobs mil mobi museum name net org pro tel travel ",tw:" club com ebiz edu game gov idv mil net org ",mu:" ac co com gov net or org ",mz:" ac co edu gov org ",na:" co com ",nz:" ac co cri geek gen govt health iwi maori mil net org parliament school ",pa:" abo ac com edu gob ing med net nom org sld ",pt:" com edu gov int net nome org publ ",py:" com edu gov mil net org ",qa:" com edu gov mil net org ",re:" asso com nom ",ru:" ac adygeya altai amur arkhangelsk astrakhan bashkiria belgorod bir bryansk buryatia cbg chel chelyabinsk chita chukotka chuvashia com dagestan e-burg edu gov grozny int irkutsk ivanovo izhevsk jar joshkar-ola kalmykia kaluga kamchatka karelia kazan kchr kemerovo khabarovsk khakassia khv kirov koenig komi kostroma kranoyarsk kuban kurgan kursk lipetsk magadan mari mari-el marine mil mordovia mosreg msk murmansk nalchik net nnov nov novosibirsk nsk omsk orenburg org oryol penza perm pp pskov ptz rnd ryazan sakhalin samara saratov simbirsk smolensk spb stavropol stv surgut tambov tatarstan tom tomsk tsaritsyn tsk tula tuva tver tyumen udm udmurtia ulan-ude vladikavkaz vladimir vladivostok volgograd vologda voronezh vrn vyatka yakutia yamal yekaterinburg yuzhno-sakhalinsk ",rw:" ac co com edu gouv gov int mil net ",sa:" com edu gov med net org pub sch ",sd:" com edu gov info med net org tv ",se:" a ac b bd c d e f g h i k l m n o org p parti pp press r s t tm u w x y z ",sg:" com edu gov idn net org per ",sn:" art com edu gouv org perso univ ",sy:" com edu gov mil net news org ",th:" ac co go in mi net or ",tj:" ac biz co com edu go gov info int mil name net nic org test web ",tn:" agrinet com defense edunet ens fin gov ind info intl mincom nat net org perso rnrt rns rnu tourism ",tz:" ac co go ne or ",ua:" biz cherkassy chernigov chernovtsy ck cn co com crimea cv dn dnepropetrovsk donetsk dp edu gov if in ivano-frankivsk kh kharkov kherson khmelnitskiy kiev kirovograd km kr ks kv lg lugansk lutsk lviv me mk net nikolaev od odessa org pl poltava pp rovno rv sebastopol sumy te ternopil uzhgorod vinnica vn zaporizhzhe zhitomir zp zt ",ug:" ac co go ne or org sc ",uk:" ac bl british-library co cym gov govt icnet jet lea ltd me mil mod national-library-scotland nel net nhs nic nls org orgn parliament plc police sch scot soc ",us:" dni fed isa kids nsn ",uy:" com edu gub mil net org ",ve:" co com edu gob info mil net org web ",vi:" co com k12 net org ",vn:" ac biz com edu gov health info int name net org pro ",ye:" co com gov ltd me net org plc ",yu:" ac co edu gov org ",za:" ac agric alt bourse city co cybernet db edu gov grondar iaccess imt inca landesign law mil net ngo nis nom olivetti org pix school tm web ",zm:" ac co com edu gov net org sch ",com:"ar br cn de eu gb gr hu jpn kr no qc ru sa se uk us uy za ",net:"gb jp se uk ",org:"ae",de:"com "},has:function(e){var t=e.lastIndexOf(".");if(t<=0||t>=e.length-1)return!1;var n=e.lastIndexOf(".",t-1);if(n<=0||n>=t-1)return!1;var r=o.list[e.slice(t+1)];return!!r&&r.indexOf(" "+e.slice(n+1,t)+" ")>=0},is:function(e){var t=e.lastIndexOf(".");if(t<=0||t>=e.length-1)return!1;if(e.lastIndexOf(".",t-1)>=0)return!1;var n=o.list[e.slice(t+1)];return!!n&&n.indexOf(" "+e.slice(0,t)+" ")>=0},get:function(e){var t=e.lastIndexOf(".");if(t<=0||t>=e.length-1)return null;var n=e.lastIndexOf(".",t-1);if(n<=0||n>=t-1)return null;var r=o.list[e.slice(t+1)];return r?r.indexOf(" "+e.slice(n+1,t)+" ")<0?null:e.slice(n+1):null},noConflict:function(){return e.SecondLevelDomains===this&&(e.SecondLevelDomains=t),this}};return o}))},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,n=new Array(t);o<t;o++)n[o]=e[o];return n},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function o(){return e.exports=o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},e.exports.default=e.exports,e.exports.__esModule=!0,o.apply(this,arguments)}e.exports=o,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=window.wp.tokenList},function(e,t){e.exports=window.React},function(e,t,o){var n=o(34),r=o(35),i=o(36),s=o(37);e.exports=function(e){return n(e)||r(e)||i(e)||s()},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=window.wp.a11y},,function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t){var o;o=function(){return this}();try{o=o||new Function("return this")()}catch(e){"object"==typeof window&&(o=window)}e.exports=o},function(e,t){function o(t,n){return e.exports=o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,o(t,n)}e.exports=o,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function o(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=o=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=o=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),o(t)}e.exports=o,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,o){var n=o(23);e.exports=function(e){if(Array.isArray(e))return n(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,o){var n=o(23);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?n(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,o){"use strict";o.r(t);var n=o(24),r=o.n(n),i=o(0),s=o(3),a=(o(29),o(11)),c=Object(i.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 225.43 225.56"},Object(i.createElement)(a.Path,{d:"M947.67,465.69h72a18,18,0,0,0,18-18v-72a18,18,0,0,0-18-18h-72a18,18,0,0,0-18,18v12a6,6,0,0,0,12,0v-12a6,6,0,0,1,6-6h72a6,6,0,0,1,6,6v72a6,6,0,0,1-6,6h-72a6,6,0,0,1-6-6v-36a6,6,0,1,0-12,0v36A18,18,0,0,0,947.67,465.69Z",transform:"translate(-812.57 -357.69)"}),Object(i.createElement)(a.Path,{d:"M984,505a24,24,0,1,0,22.17,14.82A24,24,0,0,0,984,505Zm4.59,35.09A12,12,0,1,1,996,529,12,12,0,0,1,988.59,540.09Z",transform:"translate(-812.57 -357.69)"}),Object(i.createElement)(a.Path,{d:"M1032,535a6,6,0,0,0,6-6V493a18,18,0,0,0-18-18H948a18,18,0,0,0-18,18v72a18,18,0,0,0,18,18h72a18,18,0,0,0,18-18V553a6,6,0,0,0-12,0v12a6,6,0,0,1-6,6H948a6,6,0,0,1-6-6V493a6,6,0,0,1,6-6h72a6,6,0,0,1,6,6v36A6,6,0,0,0,1032,535Z",transform:"translate(-812.57 -357.69)"}),Object(i.createElement)(a.Path,{d:"M902.57,475.25h-72a18,18,0,0,0-18,18v12a6,6,0,1,0,12,0v-12a6,6,0,0,1,6-6h72a6,6,0,0,1,6,6v72a6,6,0,0,1-6,6h-72a6,6,0,0,1-6-6v-36a6,6,0,0,0-12,0v36a18,18,0,0,0,18,18h72a18,18,0,0,0,18-18v-72A18,18,0,0,0,902.57,475.25Z",transform:"translate(-812.57 -357.69)"}),Object(i.createElement)(a.Path,{d:"M893.7,406.66l-36-18A6,6,0,0,0,849,394v36a6,6,0,0,0,6,6,5.92,5.92,0,0,0,2.7-.66l36-18a6,6,0,0,0,0-10.68ZM861,420.28V403.72L877.56,412Z",transform:"translate(-812.57 -357.69)"}),Object(i.createElement)(a.Path,{d:"M846.34,362.11a54,54,0,1,0,58.84,11.71A54,54,0,0,0,846.34,362.11ZM896.7,441.7a42,42,0,1,1,9.1-45.77A42,42,0,0,1,896.7,441.7Z",transform:"translate(-812.57 -357.69)"}),Object(i.createElement)(a.Path,{d:"M859.91,504.71v4.5c0,3.24-2.14,5.7-6.59,5.7h-2.13v9.36h7.52v15c0,7,5.38,11.26,14.19,11.26a18.45,18.45,0,0,0,6.75-1v-8.87a19.38,19.38,0,0,1-3.42.35c-2.82,0-4.7-.77-4.7-3.66V524.27h8.29v-9.36h-8.29v-10.2Z",transform:"translate(-812.57 -357.69)"}),Object(i.createElement)(a.Path,{d:"M994.39,395.08a17.74,17.74,0,0,1,3.85.35v-8.72a18.83,18.83,0,0,0-6.16-.78c-10.34,0-16.23,5.49-16.23,13.52v3h-6.76v9h6.76v26h13v-26h9.23v-9h-9.23V399.8C988.84,395.93,992.08,395.08,994.39,395.08Z",transform:"translate(-812.57 -357.69)"})),l=o(4),u=o.n(l),p=o(8),d=o.n(p),h=o(9),m=o.n(h),f=o(16),g=o.n(f),b=o(25),v=o.n(b);function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,n=new Array(t);o<t;o++)n[o]=e[o];return n}var w=wpzSocialIconsBlock.icons,k=function(){function e(){d()(this,e)}return m()(e,null,[{key:"filterIcons",value:function(e){var t={};return""===e?w:(Object(s.forEach)(w,(function(o,n){t[n]=o.filter((function(t){return Object(s.isObject)(t)?t.icon.indexOf(e)>-1:t.indexOf(e)>-1}))})),t)}},{key:"filterUrlScheme",value:function(e){var t={mailto:"mail",viber:"viber",skype:"skype",tg:"tg",tel:"mobile",sms:"comments",fax:"fax",news:"newspaper-o",feed:"rss"},o={"feedburner.google.com":"rss","ok.ru":"odnoklassniki","t.me":"telegram","wa.me":"whatsapp","zen.yandex.com":"zen-yandex","zen.yandex.ru":"zen-yandex"},n=new g.a(e),r=void 0!==n.domain()?n.domain().split(".").shift():n.scheme(),i=Object(s.findKey)(t,(function(e,t){return t===n.scheme()}));r=void 0!==i?t[i]:r;var a=Object(s.findKey)(o,(function(e,t){return t===n.hostname()}));return void 0!==a?o[a]:r}},{key:"hyphensToSpaces",value:function(e){return e.replace(/-/g," ")}},{key:"capitalize",value:function(e){return"string"!=typeof e?"":e.charAt(0).toUpperCase()+e.slice(1)}},{key:"humanizeIconLabel",value:function(e){return this.hyphensToSpaces(this.capitalize(e))}},{key:"getBlockStyle",value:function(e){var t=/is-style-(\S*)/g.exec(e);return null!==t?t[1]:null}},{key:"getIconClassList",value:function(e,t){var o={"social-icon":!0};return o[e]=!0,["fab","fas","far"].includes(e)?o["fa-"+t]=!0:o[e+"-"+t]=!0,o}},{key:"addPercentagePipe",value:function(e){return"".concat(e,"%")}},{key:"addPercentageHalfPipe",value:function(e){return"".concat(.5*e,"%/").concat(e,"%")}},{key:"addPixelsPipe",value:function(e){return"".concat(e,"px")}},{key:"arrayMoveMutate",value:function(e,t,o){e.splice(o<0?e.length+o:o,0,e.splice(t,1)[0])}},{key:"arrayMove",value:function(e,t,o){return e=e.slice(),this.arrayMoveMutate(e,t,o),e}},{key:"getActiveStyle",value:function(e,t){var o,n=function(e,t){var o="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!o){if(Array.isArray(e)||(o=function(e,t){if(e){if("string"==typeof e)return y(e,void 0);var o=Object.prototype.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?y(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){o&&(e=o);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,a=!1;return{s:function(){o=o.call(e)},n:function(){var e=o.next();return s=e.done,e},e:function(e){a=!0,i=e},f:function(){try{s||null==o.return||o.return()}finally{if(a)throw i}}}}(new v.a(t).values());try{for(n.s();!(o=n.n()).done;){var r=o.value;if(-1!==r.indexOf("is-style-")){var i=r.substring(9),a=Object(s.find)(e,{name:i});if(a)return a}}}catch(e){n.e(e)}finally{n.f()}return Object(s.find)(e,["isDefault",!0])}}]),e}(),I=o(6),O=o.n(I),A=o(5),j=o.n(A),C=o(12),x=o.n(C),E=o(13),z=o.n(E),S=o(7),_=o.n(S),P=o(1);var B=function(e){x()(r,e);var t,o,n=(t=r,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=_()(t);if(o){var r=_()(this).constructor;e=Reflect.construct(n,arguments,r)}else e=n.apply(this,arguments);return z()(this,e)});function r(){var e;d()(this,r);for(var t=arguments.length,o=new Array(t),i=0;i<t;i++)o[i]=arguments[i];return e=n.call.apply(n,[this].concat(o)),u()(j()(e),"state",{color:e.props.color,showColorPicker:!1}),u()(j()(e),"onClickColorIndicatorHandler",(function(){e.setState({showColorPicker:!0})})),u()(j()(e),"setColorPickerHandler",(function(t){e.setState({color:t.hex},(function(){e.props.save(e.state)}))})),u()(j()(e),"focusOutsideHandler",(function(){e.setState({showColorPicker:!1})})),e}return m()(r,[{key:"render",value:function(){return Object(i.createElement)(P.ColorIndicator,{title:this.props.title,className:this.props.className,colorValue:this.state.color,onClick:this.onClickColorIndicatorHandler},this.state.showColorPicker&&Object(i.createElement)(P.Popover,{position:"middle right",onFocusOutside:this.focusOutsideHandler},Object(i.createElement)("div",{className:"popover-content"},Object(i.createElement)(P.ColorPicker,{className:"wpzoom-color-picker",disableAlpha:!0,color:this.state.color,onChangeComplete:this.setColorPickerHandler}))))}}]),r}(i.Component);var R=function(e){x()(r,e);var t,o,n=(t=r,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=_()(t);if(o){var r=_()(this).constructor;e=Reflect.construct(n,arguments,r)}else e=n.apply(this,arguments);return z()(this,e)});function r(){var e;d()(this,r);for(var t=arguments.length,o=new Array(t),i=0;i<t;i++)o[i]=arguments[i];return e=n.call.apply(n,[this].concat(o)),u()(j()(e),"state",{isHover:!1}),u()(j()(e),"onMouseEnterCallback",(function(){e.setState({isHover:!0})})),u()(j()(e),"onMouseLeaveCallback",(function(){e.setState({isHover:!1})})),e}return m()(r,[{key:"render",value:function(){var e=this;return Object(i.createElement)("span",{ref:this.props.setRef,onClick:function(){return e.props.click(e.props.icon)},className:O()(k.getIconClassList(this.props.iconKit,this.props.icon),{selected:this.props.isSelected}),style:{backgroundColor:this.state.isHover?this.props.hoverColor:this.props.color},onMouseEnter:this.onMouseEnterCallback,onMouseLeave:this.onMouseLeaveCallback})}}]),r}(i.Component),Q=o(26),H=o.n(Q),F=o(2);var N=wpzSocialIconsBlock.iconKitsCategories,L=function(e){x()(r,e);var t,o,n=(t=r,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=_()(t);if(o){var r=_()(this).constructor;e=Reflect.construct(n,arguments,r)}else e=n.apply(this,arguments);return z()(this,e)});function r(e){var t;return d()(this,r),t=n.call(this,e),u()(j()(t),"state",{modalShow:t.props.show,modalUrl:t.props.url,modalLabel:t.props.label,modalIcon:t.props.icon,modalIconKit:t.props.iconKit,modalColor:t.props.color,modalHoverColor:t.props.hoverColor,modalSearch:""}),u()(j()(t),"urlTextControlHandler",(function(e){var o={modalUrl:e=Object(s.isEmpty)(new g.a(e).protocol())?"https://".concat(e):e},n=k.filterUrlScheme(e);if(n){var r=k.filterIcons(n);r[t.state.modalIconKit].length&&(o.modalIcon=r[t.state.modalIconKit][0].icon)}t.setState(o)})),u()(j()(t),"labelTextControlHandler",(function(e){t.setState({modalLabel:e})})),u()(j()(t),"searchTextControlHandler",(function(e){t.setState({modalSearch:e})})),u()(j()(t),"saveColorPickerHandler",(function(e){t.setState({modalColor:e.color})})),u()(j()(t),"saveHoverColorPickerHandler",(function(e){t.setState({modalHoverColor:e.color})})),u()(j()(t),"onClickIconHandler",(function(e){t.setState({modalIcon:e,modalLabel:k.humanizeIconLabel(e)})})),u()(j()(t),"scrollMe",(function(){var e=t.myRef.current;null!==e&&e.scrollIntoView(!0)})),t.myRef=H.a.createRef(),t.scrollMeDebounced=Object(s.debounce)(t.scrollMe,1e3),t}return m()(r,[{key:"componentDidUpdate",value:function(){this.scrollMeDebounced()}},{key:"render",value:function(){var e=this;if(!this.state.modalShow)return null;var t=Object.keys(k.filterIcons(this.state.modalSearch)).map((function(t,o){return Object(i.createElement)("div",{key:o,className:O()("option-item","icon-kit","".concat(t,"-wrapper")),style:{display:e.state.modalIconKit===t?"block":"none"}},k.filterIcons(e.state.modalSearch)[t].map((function(o,n){return Object(i.createElement)(R,{key:n,setRef:e.state.modalIcon===o.icon&&e.state.modalIconKit===t?e.myRef:null,color:e.state.modalColor,hoverColor:e.state.modalHoverColor,icon:o.icon,click:e.onClickIconHandler,isSelected:e.state.modalIcon===o.icon,iconKit:t})})))}));return Object(i.createElement)(P.Modal,{className:O()("wpzoom-social-icons-modal",this.props.className),style:{"--wpz-social-icons-block-modal-item-border-radius":k.addPixelsPipe(this.props.iconsBorderRadius)},title:Object(F.__)("Select Icon","zoom-social-icons-widget"),shouldCloseOnClickOutside:!1,onRequestClose:function(){return e.props.onClose(e.state)}},Object(i.createElement)("div",{className:"modal-content"},Object(i.createElement)("div",{className:"option-item"},Object(i.createElement)("div",{className:"label"},Object(F.__)("URL","zoom-social-icons-widget")),Object(i.createElement)("div",{className:"option-wrapper"},Object(i.createElement)(P.TextControl,{value:this.state.modalUrl,onChange:this.urlTextControlHandler}))),this.props.showIconsLabel?Object(i.createElement)("div",{className:"option-item"},Object(i.createElement)("div",{className:"label"},Object(F.__)("Label","zoom-social-icons-widget")),Object(i.createElement)("div",{className:"option-wrapper"},Object(i.createElement)(P.TextControl,{value:this.state.modalLabel,onChange:this.labelTextControlHandler}))):null,Object(i.createElement)("div",{className:"option-item"},Object(i.createElement)("div",{className:"label"},Object(F.__)("Pick icon color","zoom-social-icons-widget")),Object(i.createElement)("div",{className:"option-wrapper"},Object(i.createElement)(B,{save:this.saveColorPickerHandler,color:this.state.modalColor}))),Object(i.createElement)("div",{className:"option-item"},Object(i.createElement)("div",{className:"label"},Object(F.__)("Pick hover color","zoom-social-icons-widget")),Object(i.createElement)("div",{className:"option-wrapper"},Object(i.createElement)(B,{save:this.saveHoverColorPickerHandler,color:this.state.modalHoverColor}))),Object(i.createElement)("div",{className:"option-item"},Object(i.createElement)("div",{className:"label"},Object(F.__)("Select Icon Kit","zoom-social-icons-widget")),Object(i.createElement)("div",{className:"option-wrapper"},Object(i.createElement)(P.SelectControl,{value:this.state.modalIconKit,onChange:function(t){e.setState({modalIconKit:t})},options:Object.values(N)}))),Object(i.createElement)("div",{className:"option-item icon-kits-wrapper"},t)),Object(i.createElement)("div",{className:"modal-controls"},Object(i.createElement)("div",{className:"modal-search"},Object(i.createElement)(P.TextControl,{placeholder:Object(F.__)("Type to search icon","zoom-social-icons-widget"),value:this.state.modalSearch,onChange:this.searchTextControlHandler})),Object(i.createElement)("div",{className:"modal-buttons"},this.props.showDeleteBtn&&Object(i.createElement)(P.Button,{className:"button-link-delete is-button",onClick:function(){return e.props.delete()}},Object(F.__)("Delete Icon","zoom-social-icons-widget")),Object(i.createElement)(P.Button,{isPrimary:!0,onClick:function(){return e.props.save(e.state)}},Object(F.__)("Save","zoom-social-icons-widget")))))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return e.show!==t.modalShow?{modalShow:e.show,modalUrl:e.url,modalLabel:e.label,modalIcon:e.icon,modalIconKit:e.iconKit,modalColor:e.color,modalHoverColor:e.hoverColor,modalSearch:""}:null}}]),r}(i.Component),M=o(27),U=o.n(M),V=o(17);var T=function(e){x()(r,e);var t,o,n=(t=r,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=_()(t);if(o){var r=_()(this).constructor;e=Reflect.construct(n,arguments,r)}else e=n.apply(this,arguments);return z()(this,e)});function r(e){var t;return d()(this,r),t=n.apply(this,arguments),u()(j()(t),"state",{selectedIcons:JSON.parse(JSON.stringify(t.props.attributes.selectedIcons))}),u()(j()(t),"setAlignment",(function(e){t.props.setAttributes({iconsAlignment:e})})),t}return m()(r,[{key:"getBlockStyle",value:function(e){var t=k.getBlockStyle(e);return null===t?"with-canvas-round":t}},{key:"render",value:function(){var e=this,t=[{name:Object(F.__)("Turquoise","zoom-social-icons-widget"),color:"#4ECDC4"},{name:Object(F.__)("Charcoal","zoom-social-icons-widget"),color:"#2E3131"},{name:Object(F.__)("White","zoom-social-icons-widget"),color:"#fff"},{name:Object(F.__)("Dodger blue","zoom-social-icons-widget"),color:"#22A7F0"},{name:Object(F.__)("Red","zoom-social-icons-widget"),color:"#D91E18"},{name:Object(F.__)("Orange","zoom-social-icons-widget"),color:"#F89406"}],o=this.props.setAttributes,n="left"===this.props.attributes.iconsAlignment,r="center"===this.props.attributes.iconsAlignment,s="right"===this.props.attributes.iconsAlignment;return Object(i.createElement)(V.InspectorControls,null,Object(i.createElement)(P.PanelBody,{title:Object(F.__)("Icon Labels Settings","zoom-social-icons-widget")},Object(i.createElement)(P.PanelRow,null,Object(i.createElement)("label",{htmlFor:"show-icon-labels"},Object(F.__)(" Show icon labels?","zoom-social-icons-widget")),Object(i.createElement)(P.FormToggle,{id:"show-icon-labels",label:Object(F.__)(" Show icon labels?","zoom-social-icons-widget"),checked:this.props.attributes.showIconsLabel,onChange:function(){o({showIconsLabel:!e.props.attributes.showIconsLabel})}})),Object(i.createElement)(P.PanelRow,null,Object(i.createElement)("label",{htmlFor:"open-link-in-new-tab"},Object(F.__)("Open links in new tab?","zoom-social-icons-widget")),Object(i.createElement)(P.FormToggle,{id:"open-link-in-new-tab",label:Object(F.__)("Open links in new tab?","zoom-social-icons-widget"),checked:this.props.attributes.openLinkInNewTab,onChange:function(){o({openLinkInNewTab:!e.props.attributes.openLinkInNewTab})}})),!this.props.attributes.openLinkInNewTab&&Object(i.createElement)(i.Fragment,null,Object(i.createElement)(P.PanelRow,null,Object(i.createElement)("label",{htmlFor:"add-nofollow-to-links"},Object(F.__)('Add rel="nofollow" to links',"zoom-social-icons-widget")),Object(i.createElement)(P.FormToggle,{id:"add-nofollow-to-links",label:Object(F.__)('Add rel="nofollow" to links',"zoom-social-icons-widget"),checked:this.props.attributes.nofollow,onChange:function(){o({nofollow:!e.props.attributes.nofollow})}})),Object(i.createElement)(P.PanelRow,null,Object(i.createElement)("label",{htmlFor:"add-noreferrer-to-links"},Object(F.__)('Add rel="noreferrer" to links',"zoom-social-icons-widget")),Object(i.createElement)(P.FormToggle,{id:"add-noreferrer-to-links",label:Object(F.__)('Add rel="noreferrer" to links',"zoom-social-icons-widget"),checked:this.props.attributes.noreferrer,onChange:function(){o({noreferrer:!e.props.attributes.noreferrer})}})),Object(i.createElement)(P.PanelRow,null,Object(i.createElement)("label",{htmlFor:"add-noopener-to-links"},Object(F.__)('Add rel="noopener" to links',"zoom-social-icons-widget")),Object(i.createElement)(P.FormToggle,{id:"add-noopener-to-links",label:Object(F.__)('Add rel="noopener" to links',"zoom-social-icons-widget"),checked:this.props.attributes.noopener,onChange:function(){o({noopener:!e.props.attributes.noopener})}})))),Object(i.createElement)(P.PanelBody,{title:Object(F.__)("Icon Styling Settings","zoom-social-icons-widget")},this.props.attributes.iconsHasBorder?Object(i.createElement)(i.Fragment,null,Object(i.createElement)(P.PanelRow,null,Object(i.createElement)("label",{htmlFor:"icons-border-radius"},Object(F.__)("Icons Border Radius:","zoom-social-icons-widget"))),Object(i.createElement)(P.PanelRow,null,Object(i.createElement)(P.RangeControl,{id:"icons-border-radius",min:0,max:55,value:this.props.attributes.iconsBorderRadius,onChange:function(e){o({iconsBorderRadius:e})}}))):null,Object(i.createElement)(P.PanelRow,null,Object(i.createElement)("label",{htmlFor:"add-noopener-to-links"},Object(F.__)("Icons Alignment:","zoom-social-icons-widget"))),Object(i.createElement)(P.PanelRow,null,Object(i.createElement)(P.ButtonGroup,null,Object(i.createElement)(P.Button,{onClick:function(){return e.setAlignment("left")},isPrimary:n,isSecondary:!n},"Left"),Object(i.createElement)(P.Button,{onClick:function(){return e.setAlignment("center")},isPrimary:r,isSecondary:!r},"Center"),Object(i.createElement)(P.Button,{onClick:function(){return e.setAlignment("right")},isPrimary:s,isSecondary:!s},"Right"))),Object(i.createElement)(P.PanelRow,null,Object(i.createElement)("label",{htmlFor:"icons-font-size"},Object(F.__)("Icons Font Size:","zoom-social-icons-widget"))),Object(i.createElement)(P.PanelRow,null,Object(i.createElement)(P.RangeControl,{id:"icons-font-size",min:0,max:200,value:this.props.attributes.iconsFontSize,onChange:function(e){o({iconsFontSize:e})}})),this.props.attributes.showIconsLabel?Object(i.createElement)(i.Fragment,null,Object(i.createElement)(P.PanelRow,null,Object(i.createElement)("label",{htmlFor:"icons-label-font-size"},Object(F.__)("Icons Label Font Size:","zoom-social-icons-widget"))),Object(i.createElement)(P.PanelRow,null,Object(i.createElement)(P.RangeControl,{id:"icons-label-font-size",min:0,max:200,value:this.props.attributes.iconsLabelFontSize,onChange:function(e){o({iconsLabelFontSize:e})}}))):null,Object(i.createElement)(P.PanelRow,null,Object(i.createElement)("label",{htmlFor:"icons-padding"},Object(F.__)("Icons Padding Horizontal:","zoom-social-icons-widget"))),Object(i.createElement)(P.PanelRow,null,Object(i.createElement)(P.RangeControl,{id:"icons-padding-horizontal",beforeIcon:"image-flip-horizontal",value:this.props.attributes.iconsPaddingHorizontal,onChange:function(e){return o({iconsPaddingHorizontal:e})},min:0,max:200})),Object(i.createElement)(P.PanelRow,null,Object(i.createElement)("label",{htmlFor:"icons-padding"},Object(F.__)("Icons Padding Vertical:","zoom-social-icons-widget"))),Object(i.createElement)(P.PanelRow,null,Object(i.createElement)(P.RangeControl,{id:"icons-padding-vertical",beforeIcon:"image-flip-vertical",value:this.props.attributes.iconsPaddingVertical,onChange:function(e){return o({iconsPaddingVertical:e})},min:0,max:200})),Object(i.createElement)(P.PanelRow,null,Object(i.createElement)("label",{htmlFor:"icons-margin-horizontal"},Object(F.__)("Icons Margin Horizontal:","zoom-social-icons-widget"))),Object(i.createElement)(P.PanelRow,null,Object(i.createElement)(P.RangeControl,{id:"icons-margin-horizontal",beforeIcon:"image-flip-horizontal",value:this.props.attributes.iconsMarginHorizontal,onChange:function(e){return o({iconsMarginHorizontal:e})},min:0,max:200})),Object(i.createElement)(P.PanelRow,null,Object(i.createElement)("label",{htmlFor:"icons-margin-vertical"},Object(F.__)("Icons Margin Vertical:","zoom-social-icons-widget"))),Object(i.createElement)(P.PanelRow,null,Object(i.createElement)(P.RangeControl,{id:"icons-margin-vertical",beforeIcon:"image-flip-vertical",value:this.props.attributes.iconsMarginVertical,onChange:function(e){return o({iconsMarginVertical:e})},min:0,max:200}))),Object(i.createElement)(P.PanelBody,{title:Object(F.__)("Icon Color Settings","zoom-social-icons-widget")},Object(i.createElement)(P.PanelRow,null,Object(i.createElement)("label",{htmlFor:"icon-color"},Object(F.__)("Set color for all icons","zoom-social-icons-widget")),Object(i.createElement)(P.ColorIndicator,{colorValue:this.props.attributes.iconsColor})),Object(i.createElement)(P.PanelRow,null,Object(i.createElement)(P.ColorPalette,{id:"icon-color",colors:t,value:this.props.attributes.iconsColor,onChange:function(t){var n=JSON.parse(JSON.stringify(e.props.attributes.selectedIcons));n.map((function(o,n){return o.color=void 0===t?e.state.selectedIcons[n].color:t,o})),o({iconsColor:t,selectedIcons:n})}})),Object(i.createElement)(P.PanelRow,null,Object(i.createElement)("label",{htmlFor:"icon-hover-color"},Object(F.__)("Set hover color for all icons","zoom-social-icons-widget")),Object(i.createElement)(P.ColorIndicator,{colorValue:this.props.attributes.iconsHoverColor})),Object(i.createElement)(P.PanelRow,null,Object(i.createElement)(P.ColorPalette,{id:"icon-hover-color",colors:t,value:this.props.attributes.iconsHoverColor,onChange:function(t){var n=U()(e.props.attributes.selectedIcons);n.map((function(o,n){return o.hoverColor=void 0===t?e.state.selectedIcons[n].hoverColor:t,o})),o({iconsHoverColor:t,selectedIcons:n})}})),this.props.attributes.showIconsLabel?Object(i.createElement)(i.Fragment,null,Object(i.createElement)(P.PanelRow,null,Object(i.createElement)("label",{htmlFor:"icon-label-color"},Object(F.__)("Set color for all label icons","zoom-social-icons-widget")),Object(i.createElement)(P.ColorIndicator,{colorValue:this.props.attributes.iconsLabelColor})),Object(i.createElement)(P.PanelRow,null,Object(i.createElement)(P.ColorPalette,{id:"icon-label-color",colors:t,value:this.props.attributes.iconsLabelColor,onChange:function(e){o({iconsLabelColor:e})}})),Object(i.createElement)(P.PanelRow,null,Object(i.createElement)("label",{htmlFor:"icon-hover-label-color"},Object(F.__)("Set hover color for all label icons","zoom-social-icons-widget")),Object(i.createElement)(P.ColorIndicator,{colorValue:this.props.attributes.iconsLabelHoverColor})),Object(i.createElement)(P.PanelRow,null,Object(i.createElement)(P.ColorPalette,{id:"icon-hover-label-color",colors:t,value:this.props.attributes.iconsLabelHoverColor,onChange:function(e){o({iconsLabelHoverColor:e})}}))):null))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return t.selectedIcons.length!==e.attributes.selectedIcons.length?{selectedIcons:JSON.parse(JSON.stringify(e.attributes.selectedIcons))}:null}}]),r}(i.Component);var K=function(e){x()(r,e);var t,o,n=(t=r,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=_()(t);if(o){var r=_()(this).constructor;e=Reflect.construct(n,arguments,r)}else e=n.apply(this,arguments);return z()(this,e)});function r(){var e;d()(this,r);for(var t=arguments.length,o=new Array(t),i=0;i<t;i++)o[i]=arguments[i];return e=n.call.apply(n,[this].concat(o)),u()(j()(e),"state",{searchValue:e.props.value}),u()(j()(e),"onChangeTextControlHandler",(function(t){e.setState({searchValue:t})})),u()(j()(e),"onKeyDownHandler",(function(t){t.stopPropagation(),"Enter"===t.key&&e.props.save(t,e.state.searchValue)})),u()(j()(e),"onClickHandler",(function(t){t.stopPropagation(),e.props.save(t,e.state.searchValue)})),e}return m()(r,[{key:"render",value:function(){return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(P.TextControl,{className:"url-input",type:"text",value:this.state.searchValue,onChange:this.onChangeTextControlHandler,onKeyDown:this.onKeyDownHandler}),Object(i.createElement)(P.Button,{icon:"editor-break",label:Object(F.__)("Apply","zoom-social-icons-widget"),onClick:this.onClickHandler,className:["is-button","button-small","is-default","url-button"]}))}}]),r}(i.Component),D=function(e){return e.isActive&&Object(i.createElement)(P.ButtonGroup,{className:O()("sortable-arrows")},Object(i.createElement)(P.Button,{className:O()("arrow-btn"),isSmall:!0,disabled:0===e.itemKey,onClick:function(t){return e.left(t,e.itemKey)}},Object(i.createElement)(P.Icon,{icon:"arrow-left-alt2",label:"Move Left",size:14,className:O()("arrow-icon")})),Object(i.createElement)(P.Button,{className:O()("arrow-btn"),isSmall:!0,disabled:e.itemKey===e.length-1,onClick:function(t){return e.right(t,e.itemKey)}},Object(i.createElement)(P.Icon,{icon:"arrow-right-alt2",label:"Move Right",size:14,className:O()("arrow-icon")})))},X=o(14),W=o(18);class Z extends i.Component{constructor(...e){super(...e),u()(this,"closeModal",()=>{this.props.setAttributes({showModal:!1})}),u()(this,"getIconsAlignmentStyle",e=>({left:"flex-start",right:"flex-end",center:"center"}[e])),u()(this,"setAlignment",e=>{this.props.setAttributes({iconsAlignment:e})}),u()(this,"saveModalHandler",e=>{const t=JSON.parse(JSON.stringify(this.props.attributes.selectedIcons)),o=t[this.props.attributes.activeIconIndex],n={url:e.modalUrl,label:e.modalLabel,icon:e.modalIcon,iconKit:e.modalIconKit,color:e.modalColor,hoverColor:e.modalHoverColor};t[this.props.attributes.activeIconIndex]={...o,...n},this.props.setAttributes({selectedIcons:t,showModal:!1})}),u()(this,"insertIcon",e=>{if(e.preventDefault(),e.stopPropagation(),0===e.detail)return;const t=this.getStyleVariations(k.getBlockStyle(this.props.className)),o={url:"https://wordpress.org",icon:"wordpress",iconKit:"socicon",color:"#444140",hoverColor:"#444140",label:"WordPress",showPopover:!0,isActive:!0};Object(s.isEmpty)(t.defaultIcon.color)||(o.color=t.defaultIcon.color),Object(s.isEmpty)(t.defaultIcon.hoverColor)||(o.hoverColor=t.defaultIcon.hoverColor);const n=JSON.parse(JSON.stringify(this.props.attributes.selectedIcons));n.map(e=>e.isActive=!1);const r=n.push(o);this.props.setAttributes({selectedIcons:n,activeIconIndex:r-1})}),u()(this,"onClickIconHandler",(e,t,o)=>{e.preventDefault();const n=JSON.parse(JSON.stringify(this.props.attributes.selectedIcons));n.map(e=>e.isActive=!1),n[t].showPopover=!0,n[t].isActive=!0,this.props.setAttributes({activeIconIndex:t,selectedIcons:n})}),u()(this,"popoverCloseHandler",e=>{const t=JSON.parse(JSON.stringify(this.props.attributes.selectedIcons));t[e].showPopover=!1,this.props.setAttributes({selectedIcons:t})}),u()(this,"deleteIconHandler",()=>{const e=JSON.parse(JSON.stringify(this.props.attributes.selectedIcons));e.splice(this.props.attributes.activeIconIndex,1),this.props.setAttributes({selectedIcons:e,showModal:!1,activeIconIndex:0})}),u()(this,"popoverDeleteIconHandler",(e,t)=>{e.stopPropagation();const o=JSON.parse(JSON.stringify(this.props.attributes.selectedIcons));o.splice(t,1),this.props.setAttributes({selectedIcons:o,activeIconIndex:0})}),u()(this,"popoverEditSettingsHandler",(e,t)=>{e.stopPropagation();const o=JSON.parse(JSON.stringify(this.props.attributes.selectedIcons));o[t].showPopover=!1,this.props.setAttributes({showModal:!0,selectedIcons:o})}),u()(this,"popoverSearchHandler",(e,t)=>{t=Object(s.isEmpty)(new g.a(t).protocol())?"https://"+t:t;const o=JSON.parse(JSON.stringify(this.props.attributes.selectedIcons)),n=k.filterUrlScheme(t);if(n){const t=k.filterIcons(n);t[o[e].iconKit].length&&(o[e].icon=t[o[e].iconKit][0].icon,t[o[e].iconKit][0].color&&(o[e].color=t[o[e].iconKit][0].color,o[e].hoverColor=t[o[e].iconKit][0].color),o[e].label=k.humanizeIconLabel(n))}o[e].url=t,o[e].showPopover=!1,this.props.setAttributes({selectedIcons:o})}),u()(this,"moveLeftHandler",(e,t)=>{let o=JSON.parse(JSON.stringify(this.props.attributes.selectedIcons));o=k.arrayMove(o,t,t-1),this.props.setAttributes({selectedIcons:o,activeIconIndex:t-1})}),u()(this,"moveRightHandler",(e,t)=>{let o=JSON.parse(JSON.stringify(this.props.attributes.selectedIcons));o=k.arrayMove(o,t,t+1),this.props.setAttributes({selectedIcons:o,activeIconIndex:t+1})}),u()(this,"getRelAttr",()=>{let e=[];return this.props.attributes.nofollow&&e.push("nofollow"),this.props.attributes.noreferrer&&e.push("noreferrer"),this.props.attributes.noopener&&e.push("noopener"),this.props.attributes.openLinkInNewTab&&(e=["noopener","noreferrer"]),e})}getStyleVariations(e){const t={"with-label-canvas-rounded":{canvasType:"with-label-canvas",showIconsLabel:!0,iconsColor:"#2f4974",iconsLabelColor:"#fff",iconsHoverColor:"#2f4974",iconsLabelHoverColor:"#fff",iconsFontSize:20,iconsLabelFontSize:15,iconsPaddingHorizontal:5,iconsPaddingVertical:5,iconsMarginHorizontal:5,iconsMarginVertical:5,iconsHasBorder:!0,iconsBorderRadius:50,wasStyled:!0,defaultIcon:{icon:"facebook",color:"#2f4974",hoverColor:"#2f4974"}},"with-canvas-rounded":{canvasType:"with-canvas",showIconsLabel:!1,iconsColor:!1,iconsLabelColor:"#2e3131",iconsHoverColor:!1,iconsLabelHoverColor:"#2e3131",iconsFontSize:20,iconsLabelFontSize:20,iconsPaddingHorizontal:10,iconsPaddingVertical:10,iconsMarginHorizontal:5,iconsMarginVertical:5,iconsHasBorder:!0,iconsBorderRadius:10,wasStyled:!0,defaultIcon:{icon:"facebook",color:"#3b5998",hoverColor:"#3b5998"},selectedIcons:[{icon:"facebook",color:"#3b5998",hoverColor:"#3b5998"},{icon:"twitter",color:"#1da1f2",hoverColor:"#1da1f2"},{icon:"instagram",color:"#E44060",hoverColor:"#E44060"}]},"with-canvas-round":{canvasType:"with-canvas",showIconsLabel:!1,iconsColor:!1,iconsLabelColor:"#2e3131",iconsHoverColor:!1,iconsLabelHoverColor:"#2e3131",iconsFontSize:20,iconsLabelFontSize:20,iconsPaddingHorizontal:10,iconsPaddingVertical:10,iconsMarginHorizontal:5,iconsMarginVertical:5,iconsHasBorder:!0,iconsBorderRadius:50,wasStyled:!0,defaultIcon:{icon:"facebook",color:"#3b5998",hoverColor:"#3b5998"},selectedIcons:[{icon:"facebook",color:"#3b5998",hoverColor:"#3b5998"},{icon:"twitter",color:"#1da1f2",hoverColor:"#1da1f2"},{icon:"instagram",color:"#E44060",hoverColor:"#E44060"}]},"with-canvas-squared":{canvasType:"with-canvas",showIconsLabel:!1,iconsColor:!1,iconsLabelColor:"#2e3131",iconsHoverColor:!1,iconsLabelHoverColor:"#2e3131",iconsFontSize:20,iconsLabelFontSize:20,iconsPaddingHorizontal:10,iconsPaddingVertical:10,iconsMarginHorizontal:5,iconsMarginVertical:5,iconsBorderRadius:0,iconsHasBorder:!0,wasStyled:!0,defaultIcon:{icon:"facebook",color:"#3b5998",hoverColor:"#3b5998"},selectedIcons:[{icon:"facebook",color:"#3b5998",hoverColor:"#3b5998"},{icon:"twitter",color:"#1da1f2",hoverColor:"#1da1f2"},{icon:"instagram",color:"#E44060",hoverColor:"#E44060"}]},"without-canvas":{canvasType:"without-canvas",showIconsLabel:!1,iconsColor:!1,iconsLabelColor:"#2e3131",iconsHoverColor:!1,iconsLabelHoverColor:"#2e3131",iconsFontSize:20,iconsLabelFontSize:20,iconsPaddingHorizontal:10,iconsPaddingVertical:10,iconsMarginHorizontal:5,iconsMarginVertical:5,iconsHasBorder:!1,wasStyled:!0,defaultIcon:{icon:"facebook",color:"#3b5998",hoverColor:"#3b5998"},selectedIcons:[{icon:"facebook",color:"#3b5998",hoverColor:"#3b5998"},{icon:"twitter",color:"#1da1f2",hoverColor:"#1da1f2"},{icon:"instagram",color:"#E44060",hoverColor:"#E44060"}]},"without-canvas-with-border":{canvasType:"without-canvas",showIconsLabel:!1,iconsColor:"#2f4974",iconsLabelColor:"#2f4974",iconsHoverColor:"#2f4974",iconsLabelHoverColor:"#2f4974",iconsFontSize:20,iconsLabelFontSize:20,iconsPaddingHorizontal:10,iconsPaddingVertical:10,iconsMarginHorizontal:5,iconsMarginVertical:5,iconsHasBorder:!0,iconsBorderRadius:0,wasStyled:!0,defaultIcon:{icon:"facebook",color:"#2f4974",hoverColor:"#2f4974"}},"without-canvas-with-label":{canvasType:"without-canvas",showIconsLabel:!0,iconsColor:"#2f4974",iconsLabelColor:"#2f4974",iconsHoverColor:"#2f4974",iconsLabelHoverColor:"#2f4974",iconsFontSize:40,iconsLabelFontSize:15,iconsPaddingHorizontal:10,iconsPaddingVertical:10,iconsMarginHorizontal:0,iconsMarginVertical:0,iconsHasBorder:!1,wasStyled:!0,defaultIcon:{icon:"facebook",color:"#2f4974",hoverColor:"#2f4974"}}};return Object(s.get)(t,e,!1)?Object(s.get)(t,e,!1):Object(s.get)(t,this.getActiveStyle())}getActiveStyle(){const{blockStyles:e}=this.props,t=k.getActiveStyle(e,this.props.className);return t&&t.name||""}componentDidUpdate(e,t){if(k.getBlockStyle(e.className)!==k.getBlockStyle(this.props.className)){const e=this.getStyleVariations(this.getActiveStyle());if(!Object(s.isEmpty)(e)){this.props.setAttributes(Object(s.omit)(e,["selectedIcons"]));const t=JSON.parse(JSON.stringify(this.props.attributes.selectedIcons));Object(s.isEmpty)(e.selectedIcons)||(t.map(t=>{const o=Object(s.find)(e.selectedIcons,["icon",t.icon]);return t.color=Object(s.isEmpty)(o)?e.defaultIcon.color:o.color,t.hoverColor=Object(s.isEmpty)(o)?e.defaultIcon.hoverColor:o.hoverColor,t}),this.props.setAttributes({selectedIcons:t})),Object(s.isEmpty)(e.iconsColor)||t.map(t=>(t.color=e.iconsColor,t)),Object(s.isEmpty)(e.iconsHoverColor)||t.map(t=>(t.hoverColor=e.iconsHoverColor,t)),this.props.setAttributes({selectedIcons:t})}}}componentDidMount(){if(!0===this.props.attributes.wasStyled)return;const e=this.getStyleVariations(this.getActiveStyle());if(!Object(s.isEmpty)(e)){e.wasStyled=!0,this.props.setAttributes(Object(s.omit)(e,["selectedIcons"]));const t=JSON.parse(JSON.stringify(this.props.attributes.selectedIcons));Object(s.isEmpty)(e.selectedIcons)||t.map(t=>{const o=Object(s.find)(e.selectedIcons,["icon",t.icon]);return t.color=Object(s.isEmpty)(o)?e.defaultIcon.color:o.color,t.hoverColor=Object(s.isEmpty)(o)?e.defaultIcon.hoverColor:o.hoverColor,t}),Object(s.isEmpty)(e.iconsColor)||t.map(t=>(t.color=e.iconsColor,t)),Object(s.isEmpty)(e.iconsHoverColor)||t.map(t=>(t.hoverColor=e.iconsHoverColor,t)),this.props.setAttributes({selectedIcons:t})}}render(){const{attributes:e,setAttributes:t,isSelected:o}=this.props;let{className:n}=this.props;null===k.getBlockStyle(n)&&(n=O()(n,"is-style-with-canvas-round"));const r=e.selectedIcons.map((n,r)=>{const s=e.showIconsLabel?Object(i.createElement)("span",{className:O()("icon-label")},n.label):"",a=this.getRelAttr();return Object(i.createElement)(i.Fragment,{key:r},Object(i.createElement)("a",{onClick:e=>this.onClickIconHandler(e,r,n),href:n.url,className:O()("social-icon-link",{selected:n.isActive}),target:e.openLinkInNewTab?"_blank":void 0,rel:a.length?a.join(" "):void 0,style:{"--wpz-social-icons-block-item-color":n.color,"--wpz-social-icons-block-item-color-hover":n.hoverColor}},Object(i.createElement)("span",{className:O()(k.getIconClassList(n.iconKit,n.icon))}),s,n.showPopover&&o&&Object(i.createElement)(P.Popover,{className:O()("wpzoom-social-icons-popover"),key:r,position:"bottom center",onClose:()=>this.popoverCloseHandler(r)},Object(i.createElement)("div",{className:O()("popover-content")},Object(i.createElement)("div",{className:O()("popover-url-wrapper")},Object(i.createElement)(K,{key:r,value:n.url,save:(e,t)=>this.popoverSearchHandler(r,t,e)})),Object(i.createElement)("div",{className:O()("popover-controls")},Object(i.createElement)(P.Button,{isLink:!0,onClick:e=>this.popoverEditSettingsHandler(e,r)},Object(F.__)("Edit Details","zoom-social-icons-widget")),Object(i.createElement)("div",{className:O()("popover-color-picker-wrapper")},Object(i.createElement)(B,{title:"Color",className:O()("popover-color-picker"),save:o=>{const n=[...e.selectedIcons];n[e.activeIconIndex].color=o.color,t({selectedIcons:n})},color:n.color}),Object(i.createElement)(B,{title:"Hover Color",className:O()("popover-color-picker"),save:o=>{const n=[...e.selectedIcons];n[e.activeIconIndex].hoverColor=o.color,t({selectedIcons:n})},color:n.hoverColor}),e.selectedIcons.length>1&&Object(i.createElement)(P.Button,{onClick:e=>this.popoverDeleteIconHandler(e,r),className:["is-button","button-link-delete","is-small"]},Object(F.__)("Delete Icon","zoom-social-icons-widget"))))))),Object(i.createElement)(D,{left:this.moveLeftHandler,right:this.moveRightHandler,length:e.selectedIcons.length,isActive:n.isActive&&o,itemKey:r}))});return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(T,this.props),Object(i.createElement)(V.BlockControls,null,Object(i.createElement)(V.AlignmentToolbar,{value:e.iconsAlignment,onChange:e=>this.setAlignment(e)})),Object(i.createElement)("div",{className:n,style:{"--wpz-social-icons-block-item-font-size":k.addPixelsPipe(e.iconsFontSize),"--wpz-social-icons-block-item-padding-horizontal":k.addPixelsPipe(e.iconsPaddingHorizontal),"--wpz-social-icons-block-item-padding-vertical":k.addPixelsPipe(e.iconsPaddingVertical),"--wpz-social-icons-block-item-margin-horizontal":k.addPixelsPipe(e.iconsMarginHorizontal),"--wpz-social-icons-block-item-margin-vertical":k.addPixelsPipe(e.iconsMarginVertical),"--wpz-social-icons-block-item-border-radius":k.addPixelsPipe(e.iconsBorderRadius),"--wpz-social-icons-block-label-font-size":k.addPixelsPipe(e.iconsLabelFontSize),"--wpz-social-icons-block-label-color":e.iconsLabelColor,"--wpz-social-icons-block-label-color-hover":e.iconsLabelHoverColor,"--wpz-social-icons-alignment":this.getIconsAlignmentStyle(e.iconsAlignment)}},r,o&&Object(i.createElement)(P.Button,{type:"button",onClick:this.insertIcon,style:{padding:e.iconsPadding},className:"insert-icon"},Object(i.createElement)(P.Icon,{icon:"insert",size:"20"})),e.selectedIcons[e.activeIconIndex]&&Object(i.createElement)(L,{className:O()(k.getBlockStyle(n)),showIconsLabel:e.showIconsLabel,iconsBorderRadius:e.iconsBorderRadius,show:e.showModal,url:e.selectedIcons[e.activeIconIndex].url,label:e.selectedIcons[e.activeIconIndex].label,icon:e.selectedIcons[e.activeIconIndex].icon,iconKit:e.selectedIcons[e.activeIconIndex].iconKit,color:e.selectedIcons[e.activeIconIndex].color,hoverColor:e.selectedIcons[e.activeIconIndex].hoverColor,save:this.saveModalHandler,delete:this.deleteIconHandler,showDeleteBtn:e.selectedIcons.length>1,onClose:this.closeModal})))}}const q=Object(X.withSelect)((e,t)=>{const{getBlockStyles:o}=e("core/blocks");return{blockStyles:o(t.name)}});var Y=Object(W.compose)(q)(Z);var J=function(e){x()(r,e);var t,o,n=(t=r,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,n=_()(t);if(o){var r=_()(this).constructor;e=Reflect.construct(n,arguments,r)}else e=n.apply(this,arguments);return z()(this,e)});function r(e){var t;return d()(this,r),t=n.apply(this,arguments),u()(j()(t),"getIconsAlignmentStyle",(function(e){return{left:"flex-start",right:"flex-end",center:"center"}[e]})),u()(j()(t),"getRelAttr",(function(){var e=[];return t.props.attributes.nofollow&&e.push("nofollow"),t.props.attributes.noreferrer&&e.push("noreferrer"),t.props.attributes.noopener&&e.push("noopener"),t.props.attributes.openLinkInNewTab&&(e=["noopener","noreferrer"]),e})),t}return m()(r,[{key:"render",value:function(){var e=this,t=this.props.attributes,o=t.className;null==k.getBlockStyle(o)&&(o=O()(o,"is-style-with-canvas-round"));var n=t.selectedIcons.map((function(o,n){var r=t.showIconsLabel?Object(i.createElement)("span",{className:O()("icon-label")},o.label):"",s=e.getRelAttr();return Object(i.createElement)("a",{key:n,href:o.url,className:"social-icon-link",target:t.openLinkInNewTab?"_blank":void 0,rel:s.length?s.join(" "):void 0,style:{"--wpz-social-icons-block-item-color":o.color,"--wpz-social-icons-block-item-color-hover":o.hoverColor}},Object(i.createElement)("span",{className:O()(k.getIconClassList(o.iconKit,o.icon))}),r)}));return Object(i.createElement)("div",{className:o,style:{"--wpz-social-icons-block-item-font-size":k.addPixelsPipe(t.iconsFontSize),"--wpz-social-icons-block-item-padding-horizontal":k.addPixelsPipe(t.iconsPaddingHorizontal),"--wpz-social-icons-block-item-padding-vertical":k.addPixelsPipe(t.iconsPaddingVertical),"--wpz-social-icons-block-item-margin-horizontal":k.addPixelsPipe(t.iconsMarginHorizontal),"--wpz-social-icons-block-item-margin-vertical":k.addPixelsPipe(t.iconsMarginVertical),"--wpz-social-icons-block-item-border-radius":k.addPixelsPipe(t.iconsBorderRadius),"--wpz-social-icons-block-label-font-size":k.addPixelsPipe(t.iconsLabelFontSize),"--wpz-social-icons-block-label-color":t.iconsLabelColor,"--wpz-social-icons-block-label-color-hover":t.iconsLabelHoverColor,"--wpz-social-icons-alignment":this.getIconsAlignmentStyle(t.iconsAlignment)}},n)}}]),r}(i.Component),G=o(10),$=o(15),ee=o(19),te=o(28);const oe={},ne=({replacementData:e,isConvertRun:t})=>{const[o,n]=Object(i.useState)(!1);return t&&!o?(function(e){return new Promise((function(t){let o=0;Object(s.map)(e,n=>{const{clientId:r,attributes:a}=n,{title:c,description:l,iconsAlignment:u}=a,{rootClientId:p}=Object(X.useSelect)(e=>({rootClientId:e("core/block-editor").getBlockRootClientId(r)})),d=[Object(G.createBlock)("core/heading",{content:c,level:3,placeholder:Object(F.__)("Title","zoom-social-icons-widget"),className:"zoom-social-icons-legacy-widget-title widget-title title heading-size-3"}),Object(G.createBlock)("core/paragraph",{content:l,placeholder:Object(F.__)("Text above icons","zoom-social-icons-widget"),className:O()("zoom-social-icons-legacy-widget-description",{["zoom-social-icons-list--align-"+u]:void 0!==u&&"none"!==u})}),Object(G.createBlock)("wpzoom-blocks/social-icons",a)],[h]=function({rootClientId:e="",insertionIndex:t,clientId:o,shouldFocusBlock:n=!0}){const{sidebar:r,destinationRootClientId:a,destinationIndex:c}=Object(X.useSelect)(n=>{const{getBlockIndex:r,getBlockOrder:i,getBlock:s}=n("core/block-editor"),a=e;let c;return c=void 0!==t?t:o?r(o,a):""!==a?r(e):i(a).length,{sidebar:s(a),destinationRootClientId:a,destinationIndex:c}},[e,t,o]),{replaceBlock:l}=Object(X.useDispatch)("core/block-editor");return[Object(i.useCallback)((e,t,i=!1)=>{const{attributes:{name:a}}=r;l(o,e,c,n||i?0:null,t);const u=Object(F.sprintf)(// translators: %d: the name of the block that has been added %s: sidebar name.
|
2 |
-
Object(
|
3 |
-
Object(F._n)('%d legacy widget "Social Icons" successfully converted to block','%d legacy widgets "Social Icons" successfully converted to block',o,"zoom-social-icons-widget"),o);t(e)}})}))}(e).then(e=>{n(!0),Object($.doAction)("converter.isConvertDone",{message:e})}),null):Object(i.createElement)(P.Placeholder,null,Object(i.createElement)(P.Spinner,null))};var re=Object(i.memo)(({clientId:e,attributes:t,widgetId:o})=>{const[n,r]=Object(i.useState)(!1),{createInfoNotice:s,createWarningNotice:a,createSuccessNotice:c}=Object(X.useDispatch)("core/notices");oe[o]={},oe[o].clientId=e,oe[o].attributes=t;const l=Object(F.__)('Social Icons Widget is currently not supported by the new block-based widget screen in WordPress 5.8. We highly recommend to edit it in the Customizer or transform it to Social Icons Block by clicking on the "Convert to block" button. You can also disable the new block-based widget screen by installing the Classic Widgets plugin.',"zoom-social-icons-widget");return Object(i.useEffect)(()=>{a(l,{id:"wpzoom-social-icons-notice",isDismissible:!0,actions:[{url:Object(ee.addQueryArgs)("customize.php",{"autofocus[panel]":"widgets",return:window.location.pathname}),label:Object(F.__)("Manage in Customizer","zoom-social-icons-widget")},{url:Object(ee.addQueryArgs)("plugin-install.php",{s:"classic%20widgets",tab:"search",type:"term"}),label:"Install Classic Widgets"},{label:Object(F.__)("Convert to block","zoom-social-icons-widget"),onClick:()=>r(!n)}]})},[a,n]),Object(i.useEffect)(()=>{n&&s(Object(F.__)("Convert process is started. Please wait…","zoom-social-icons-widget"),{type:"snackbar",id:"wpzoom-social-icons-notice"})},[n,s]),Object($.addAction)("converter.isConvertDone","wpzoom-blocks/social-icons/convert-legacy-widget",({message:e})=>{c(e,{type:"snackbar",id:"wpzoom-social-icons-notice"})}),e&&n?Object(i.createElement)(i.Fragment,null,Object(i.createElement)(ne,{replacementData:oe,isConvertRun:n})):null}),ie=function(e){const t=Object(G.getBlockTypes)().filter(e=>-1!==e.name.indexOf("wpzoom-blocks/social-icons"))[0],{attributes:o}=t,n=Object(s.mapValues)(o,e=>e.default),r={wasStyled:!0,canvasType:e.icon_style,showIconsLabel:"true"===e.show_icon_labels,openLinkInNewTab:"true"===e.open_new_tab,nofollow:"true"===e.no_follow,noreferrer:"true"===e.no_referrer,noopener:"true"===e.no_opener,iconsAlignment:e.icon_alignment,iconsColor:e.global_color_picker,iconsHoverColor:e.global_color_picker_hover,iconsLabelHoverColor:"inherit",iconsFontSize:e.icon_font_size,iconsPaddingVertical:e.icon_padding_size,iconsPaddingHorizontal:e.icon_padding_size,iconsBackgroundStyle:e.icon_canvas_style||"round",selectedIcons:e.fields.map(e=>function(e){return{url:e.url,icon:e.icon,iconKit:e.icon_kit,color:e.color_picker,hoverColor:e.color_picker_hover,label:e.label,showPopover:!1,isActive:!1}}(e)),title:e.title,description:e.description},i=Object(s.assign)(n,r);return"rounded"===i.iconsBackgroundStyle?i.iconsBorderRadius=3:"round"===i.iconsBackgroundStyle?i.iconsBorderRadius=50:i.iconsBorderRadius=0,"without-canvas"===i.canvasType?i.className="is-style-"+i.canvasType:"with-canvas"===i.canvasType&&(i.className="is-style-with-canvas-round"),[{name:"without-canvas",label:"Color Icon / No Background",isDefault:"without-canvas"===i.canvasType},{name:"with-canvas-round",label:"Color Background / Round White Icon",isDefault:"with-canvas"===i.canvasType}].map(e=>{Object(G.unregisterBlockStyle)("wpzoom-blocks/social-icons",e.name),Object(G.registerBlockStyle)("wpzoom-blocks/social-icons",e)}),i};const se=document.getElementById("customize-theme-controls"),ae=Object(W.createHigherOrderComponent)(e=>t=>{const{attributes:o,name:n}=t,{id:s,idBase:a,instance:c,__internalWidgetId:l}=o,u=null!=s?s:a;if("core/legacy-widget"===n&&"zoom-social-icons-widget"===u){const{widgetType:o,hasResolvedWidgetType:n}=Object(X.useSelect)(e=>({widgetType:e("core").getWidgetType(u),hasResolvedWidgetType:e("core").hasFinishedResolution("getWidgetType",[u])}),[s,a]),p=ie(c.raw);return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(e,t),o&&n&&Object(i.createElement)(re,r()({},t,{attributes:p,widgetId:l})))}return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(e,t))},"withGroupedBlock");Object($.addFilter)("blocks.registerBlockType","wpzoom-blocks/social-icons/class-names/heading-paragraph-block",(function(e,t){return"core/heading"!==t||"core/paragraph"!==t?e:Object(s.assign)({},e,{supports:Object(s.assign)({},e.supports,{className:!0})})})),Object($.addFilter)("blocks.getBlockAttributes","wpzoom-blocks/social-icons",(function(e){if(void 0!==e.selectedIcons){const t=[...e.selectedIcons];t.map(e=>(e.isActive=!1,e)),e.selectedIcons=t,e.showModal=!1}return e})),se||Object($.addFilter)("editor.BlockEdit","wpzoom-blocks/social-icons/wrap-group-blocks",ae),Object(G.registerBlockType)("wpzoom-blocks/social-icons",{title:Object(F.__)("Social Icons Block","zoom-social-icons-widget"),description:Object(F.__)("Display icons with links to social media platforms.","zoom-social-icons-widget"),icon:{foreground:"#274474",src:c},example:{attributes:{cover:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQoAAADJCAYAAADbwHxnAAAKz2lDQ1BJQ0MgUHJvZmlsZQAASImVlwdUU2kWx7/30kNCS4iAlNB77yAl9AAK0kFUQhKSUEJIQcWODI7AiKIigmVEh6rgWAAZCyKKbRCsWAdkUFHGwYINlX3AEmZ2z+6e/Z9zz/vl5n73fved7zvnPgDI6iyRKANWBiBTKBVHBvnS4xMS6bhBAAEYEIA2sGWxJSJGREQYQDTz/Lve30GiEd20msz17///V6lwuBI2AFAEwikcCTsT4eOIfWOLxFIAUAgDg2VS0ST3IUwVIxtEeGSSeVOMnsxDTZlm6lRMdKQfwqYA4EkslpgHAMkR8dNz2DwkDykaYVshRyBEOB9hLzafxUG4E2HLzMysSR5F2DTlL3l4f8uZIs/JYvHkPN3LlPD+Aokog7Xi/3wd/1uZGbKZGsaIkfji4MhphvrSs0LlLExZED7DAs5MPNTHlwXHzDBb4pc4wxyWf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UEnCZAoXC6eVk5ErBDgEJhhyO9kIDTBCgUTjcvK0cCdghQKOxwpBcScJoAhcLp5mXlSMAOAQqFHY70QgJOE6BQON28rBwJ2CFAobDDkV5IwGkCFAqnm5eVIwE7BCgUdjjSCwk4TYBC4XTzsnIkYIcAhcIOR3ohAacJUCicbl5WjgTsEKBQ2OFILyTgNAEKhdPNy8qRgB0CFAo7HOmFBJwmQKFwunlZORKwQ4BCYYcjvZCA0wQoFE43LytHAnYIUCjscKQXEnCaAIXC6eZl5UjADgEKhR2O9EICThOgUDjdvKwcCdghQKGww5FeSMBpAhQKp5uXlSMBOwQoFHY40gsJOE2AQuF087JyJGCHAIXCDkd6IQGnCVAonG5eVo4E7BCgUNjhSC8k4DQBCoXTzcvKkYAdAhQKOxzphQScJkChcLp5WTkSsEOAQmGHI72QgNMEKBRONy8rRwJ2CFAo7HCkFxJwmgCFwunmZeVIwA4BCoUdjvRCAk4ToFA43bysHAnYIUChsMORXkjAaQIUCqebl5UjATsEKBR2ONILCThNgELhdPOyciRghwCFwg5HeiEBpwlQKJxuXlaOBOwQoFDY4UgvJOA0gf8DAD8xcfX+GGoAAAAASUVORK5CYII=",author:"WPZOOM"}},category:"wpzoom-blocks",keywords:[Object(F.__)("Social Icons","zoom-social-icons-widget"),Object(F.__)("Dashicons","zoom-social-icons-widget"),Object(F.__)("Socicons","zoom-social-icons-widget"),Object(F.__)("Fontawesome","zoom-social-icons-widget"),Object(F.__)("Academic Icons","zoom-social-icons-widget")],attributes:{wasStyled:{type:"boolean",default:!1},canvasType:{type:"string",default:"with-canvas"},showIconsLabel:{type:"boolean",default:!1},showModal:{type:"boolean",default:!1},openLinkInNewTab:{type:"boolean",default:!1},nofollow:{type:"boolean",default:!1},noreferrer:{type:"boolean",default:!1},noopener:{type:"boolean",default:!1},iconsAlignment:{type:"string",default:"left"},iconsColor:{type:"string",default:"#f1f1f1"},iconsLabelColor:{type:"string",default:"inherit"},iconsHoverColor:{type:"string",default:"#f1f1f1"},iconsLabelHoverColor:{type:"string",default:"#f1f1f1"},iconsFontSize:{type:"number",default:20},iconsLabelFontSize:{type:"number",default:20},iconsPaddingVertical:{type:"number",default:10},iconsPaddingHorizontal:{type:"number",default:10},iconsMarginVertical:{type:"number",default:5},iconsMarginHorizontal:{type:"number",default:5},iconsBorderRadius:{type:"number",default:0},iconsBackgroundStyle:{type:"string",default:"round"},iconsHasBorder:{type:"boolean",default:!1},activeIconIndex:{type:"integer",default:0},defaultIcon:{type:"object",default:{icon:"facebook",color:"#f89406",hoverColor:"#f89406"}},selectedIcons:{type:"array",default:[{url:"https://facebook.com",icon:"facebook",iconKit:"socicon",color:"#3b5998",hoverColor:"#3b5998",label:"Facebook",showPopover:!1,isActive:!1},{url:"https://twitter.com",icon:"twitter",iconKit:"socicon",color:"#1da1f2",hoverColor:"#1da1f2",label:"Twitter",showPopover:!1,isActive:!1},{url:"https://instagram.com",icon:"instagram",iconKit:"socicon",color:"#E44060",hoverColor:"#E44060",label:"Instagram",showPopover:!1,isActive:!1}]}},styles:[{name:"with-canvas-round",label:Object(F.__)("Color Background / Round White Icon","zoom-social-icons-widget"),isDefault:!0},{name:"with-canvas-rounded",label:Object(F.__)("Color Background / Rounded White Icon","zoom-social-icons-widget")},{name:"with-canvas-squared",label:Object(F.__)("Color Background / Squared White Icon","zoom-social-icons-widget")},{name:"without-canvas",label:Object(F.__)("Color Icon / No Background","zoom-social-icons-widget")},{name:"without-canvas-with-border",label:Object(F.__)("Color Icon / No Background with border","zoom-social-icons-widget")},{name:"with-label-canvas-rounded",label:Object(F.__)("Color Background / Rounded White Icon with label","zoom-social-icons-widget")},{name:"without-canvas-with-label",label:Object(F.__)("Color Icon / No Background with label","zoom-social-icons-widget")}],transforms:{from:[{type:"block",blocks:["core/legacy-widget"],isMatch:({idBase:e,instance:t})=>!!t.raw&&"zoom-social-icons-widget"===e,transform:({instance:e})=>Object(G.createBlock)("wpzoom-blocks/social-icons",ie(e.raw))}]},edit:Y,save:J});var ce=Object(i.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 64 1024 1024"},Object(i.createElement)(a.Path,{fill:"#08618a",transform:"scale(1,-1) translate(0,-1024)",d:"M581.456 542.931h-31.41v-102.1c6.669-0.4 12.537-0.867 31.877-0.867 35.745 0 57.085 21.207 57.085 54.018 0 29.009-23.541 48.949-57.552 48.949zM512.033 956.666c-280.958 0-508.699-227.741-508.699-508.699s227.741-508.699 508.699-508.699 508.699 227.741 508.699 508.699-227.807 508.699-508.699 508.699zM450.013 542.931h-32.010l-74.358-240.078h-26.475l-73.957 170.189-74.358-170.189h-26.475l-75.625 240.078h-30.21v40.013h120.039v-40.013h-38.146l44.948-146.448 68.489 159.785h25.208l68.489-159.785 42.014 146.448h-37.612v40.013h120.039v-40.013zM577.721 398.417c-13.004 0-21.007 0-27.676 0.4v-49.283h33.344v-40.013h-113.37v40.013h33.344v193.396h-33.344v40.013h113.97c59.219 0 104.234-33.878 104.234-90.163-0.067-63.487-45.415-94.364-110.503-94.364zM925.101 309.522h-213.003l-4.201 25.342 202.066 208.068h-105.901l-10.537-46.682h-43.281l20.14 86.695h206.734l4.201-25.342-202.066-208.068h112.17l10.537 46.682h43.281l-20.14-86.695z"}));Object(G.updateCategory)("wpzoom-blocks",{icon:ce})}]);
|
1 |
+
(window.webpackJsonp=window.webpackJsonp||[]).push([[0],{27:function(e,t,o){}}]),function(e){function t(t){for(var r,i,a=t[0],c=t[1],l=t[2],p=0,d=[];p<a.length;p++)i=a[p],Object.prototype.hasOwnProperty.call(n,i)&&n[i]&&d.push(n[i][0]),n[i]=0;for(r in c)Object.prototype.hasOwnProperty.call(c,r)&&(e[r]=c[r]);for(u&&u(t);d.length;)d.shift()();return s.push.apply(s,l||[]),o()}function o(){for(var e,t=0;t<s.length;t++){for(var o=s[t],r=!0,a=1;a<o.length;a++){var c=o[a];0!==n[c]&&(r=!1)}r&&(s.splice(t--,1),e=i(i.s=o[0]))}return e}var r={},n={1:0},s=[];function i(t){if(r[t])return r[t].exports;var o=r[t]={i:t,l:!1,exports:{}};return e[t].call(o.exports,o,o.exports,i),o.l=!0,o.exports}i.m=e,i.c=r,i.d=function(e,t,o){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(i.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)i.d(o,r,function(t){return e[t]}.bind(null,r));return o},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="";var a=window.webpackJsonp=window.webpackJsonp||[],c=a.push.bind(a);a.push=t,a=a.slice();for(var l=0;l<a.length;l++)t(a[l]);var u=c;s.push([32,0]),o()}([function(e,t){e.exports=window.wp.element},function(e,t){e.exports=window.wp.components},function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.lodash},function(e,t){e.exports=function(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,o){var r;!function(){"use strict";var o={}.hasOwnProperty;function n(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var s=typeof r;if("string"===s||"number"===s)e.push(r);else if(Array.isArray(r)){if(r.length){var i=n.apply(null,r);i&&e.push(i)}}else if("object"===s)if(r.toString===Object.prototype.toString)for(var a in r)o.call(r,a)&&r[a]&&e.push(a);else e.push(r.toString())}}return e.join(" ")}e.exports?(n.default=n,e.exports=n):void 0===(r=function(){return n}.apply(t,[]))||(e.exports=r)}()},function(e,t){e.exports=window.wp.blocks},function(e,t){e.exports=window.wp.primitives},function(e,t){e.exports=window.wp.data},function(e,t){e.exports=window.wp.hooks},function(e,t,o){var r,n,s;!function(i,a){"use strict";e.exports?e.exports=a(o(16),o(17),o(18)):(n=[o(16),o(17),o(18)],void 0===(s="function"==typeof(r=a)?r.apply(t,n):r)||(e.exports=s))}(0,(function(e,t,o,r){"use strict";var n=r&&r.URI;function s(e,t){var o=arguments.length>=1,r=arguments.length>=2;if(!(this instanceof s))return o?r?new s(e,t):new s(e):new s;if(void 0===e){if(o)throw new TypeError("undefined is not a valid argument for URI");e="undefined"!=typeof location?location.href+"":""}if(null===e&&o)throw new TypeError("null is not a valid argument for URI");return this.href(e),void 0!==t?this.absoluteTo(t):this}s.version="1.19.7";var i=s.prototype,a=Object.prototype.hasOwnProperty;function c(e){return e.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function l(e){return void 0===e?"Undefined":String(Object.prototype.toString.call(e)).slice(8,-1)}function u(e){return"Array"===l(e)}function p(e,t){var o,r,n={};if("RegExp"===l(t))n=null;else if(u(t))for(o=0,r=t.length;o<r;o++)n[t[o]]=!0;else n[t]=!0;for(o=0,r=e.length;o<r;o++)(n&&void 0!==n[e[o]]||!n&&t.test(e[o]))&&(e.splice(o,1),r--,o--);return e}function d(e,t){var o,r;if(u(t)){for(o=0,r=t.length;o<r;o++)if(!d(e,t[o]))return!1;return!0}var n=l(t);for(o=0,r=e.length;o<r;o++)if("RegExp"===n){if("string"==typeof e[o]&&e[o].match(t))return!0}else if(e[o]===t)return!0;return!1}function h(e,t){if(!u(e)||!u(t))return!1;if(e.length!==t.length)return!1;e.sort(),t.sort();for(var o=0,r=e.length;o<r;o++)if(e[o]!==t[o])return!1;return!0}function m(e){return e.replace(/^\/+|\/+$/g,"")}function g(e){return escape(e)}function b(e){return encodeURIComponent(e).replace(/[!'()*]/g,g).replace(/\*/g,"%2A")}s._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:s.preventInvalidHostname,duplicateQueryParameters:s.duplicateQueryParameters,escapeQuerySpace:s.escapeQuerySpace}},s.preventInvalidHostname=!1,s.duplicateQueryParameters=!1,s.escapeQuerySpace=!0,s.protocol_expression=/^[a-z][a-z0-9.+-]*$/i,s.idn_expression=/[^a-z0-9\._-]/i,s.punycode_expression=/(xn--)/i,s.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,s.ip6_expression=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,s.find_uri_expression=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/gi,s.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},s.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},s.hostProtocols=["http","https"],s.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,s.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},s.getDomAttribute=function(e){if(e&&e.nodeName){var t=e.nodeName.toLowerCase();if("input"!==t||"image"===e.type)return s.domAttributes[t]}},s.encode=b,s.decode=decodeURIComponent,s.iso8859=function(){s.encode=escape,s.decode=unescape},s.unicode=function(){s.encode=b,s.decode=decodeURIComponent},s.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/gi,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/gi,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/gi,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},s.encodeQuery=function(e,t){var o=s.encode(e+"");return void 0===t&&(t=s.escapeQuerySpace),t?o.replace(/%20/g,"+"):o},s.decodeQuery=function(e,t){e+="",void 0===t&&(t=s.escapeQuerySpace);try{return s.decode(t?e.replace(/\+/g,"%20"):e)}catch(t){return e}};var f,v={encode:"encode",decode:"decode"},w=function(e,t){return function(o){try{return s[t](o+"").replace(s.characters[e][t].expression,(function(o){return s.characters[e][t].map[o]}))}catch(e){return o}}};for(f in v)s[f+"PathSegment"]=w("pathname",v[f]),s[f+"UrnPathSegment"]=w("urnpath",v[f]);var y=function(e,t,o){return function(r){var n;n=o?function(e){return s[t](s[o](e))}:s[t];for(var i=(r+"").split(e),a=0,c=i.length;a<c;a++)i[a]=n(i[a]);return i.join(e)}};function I(e){return function(t,o){return void 0===t?this._parts[e]||"":(this._parts[e]=t||null,this.build(!o),this)}}function O(e,t){return function(o,r){return void 0===o?this._parts[e]||"":(null!==o&&(o+="").charAt(0)===t&&(o=o.substring(1)),this._parts[e]=o,this.build(!r),this)}}s.decodePath=y("/","decodePathSegment"),s.decodeUrnPath=y(":","decodeUrnPathSegment"),s.recodePath=y("/","encodePathSegment","decode"),s.recodeUrnPath=y(":","encodeUrnPathSegment","decode"),s.encodeReserved=w("reserved","encode"),s.parse=function(e,t){var o;return t||(t={preventInvalidHostname:s.preventInvalidHostname}),(o=e.indexOf("#"))>-1&&(t.fragment=e.substring(o+1)||null,e=e.substring(0,o)),(o=e.indexOf("?"))>-1&&(t.query=e.substring(o+1)||null,e=e.substring(0,o)),"//"===(e=e.replace(/^(https?|ftp|wss?)?:[/\\]*/,"$1://")).substring(0,2)?(t.protocol=null,e=e.substring(2),e=s.parseAuthority(e,t)):(o=e.indexOf(":"))>-1&&(t.protocol=e.substring(0,o)||null,t.protocol&&!t.protocol.match(s.protocol_expression)?t.protocol=void 0:"//"===e.substring(o+1,o+3).replace(/\\/g,"/")?(e=e.substring(o+3),e=s.parseAuthority(e,t)):(e=e.substring(o+1),t.urn=!0)),t.path=e,t},s.parseHost=function(e,t){e||(e="");var o,r,n=(e=e.replace(/\\/g,"/")).indexOf("/");if(-1===n&&(n=e.length),"["===e.charAt(0))o=e.indexOf("]"),t.hostname=e.substring(1,o)||null,t.port=e.substring(o+2,n)||null,"/"===t.port&&(t.port=null);else{var i=e.indexOf(":"),a=e.indexOf("/"),c=e.indexOf(":",i+1);-1!==c&&(-1===a||c<a)?(t.hostname=e.substring(0,n)||null,t.port=null):(r=e.substring(0,n).split(":"),t.hostname=r[0]||null,t.port=r[1]||null)}return t.hostname&&"/"!==e.substring(n).charAt(0)&&(n++,e="/"+e),t.preventInvalidHostname&&s.ensureValidHostname(t.hostname,t.protocol),t.port&&s.ensureValidPort(t.port),e.substring(n)||"/"},s.parseAuthority=function(e,t){return e=s.parseUserinfo(e,t),s.parseHost(e,t)},s.parseUserinfo=function(e,t){var o=e;-1!==e.indexOf("\\")&&(e=e.replace(/\\/g,"/"));var r,n=e.indexOf("/"),i=e.lastIndexOf("@",n>-1?n:e.length-1);return i>-1&&(-1===n||i<n)?(r=e.substring(0,i).split(":"),t.username=r[0]?s.decode(r[0]):null,r.shift(),t.password=r[0]?s.decode(r.join(":")):null,e=o.substring(i+1)):(t.username=null,t.password=null),e},s.parseQuery=function(e,t){if(!e)return{};if(!(e=e.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,"")))return{};for(var o,r,n,i={},c=e.split("&"),l=c.length,u=0;u<l;u++)o=c[u].split("="),r=s.decodeQuery(o.shift(),t),n=o.length?s.decodeQuery(o.join("="),t):null,"__proto__"!==r&&(a.call(i,r)?("string"!=typeof i[r]&&null!==i[r]||(i[r]=[i[r]]),i[r].push(n)):i[r]=n);return i},s.build=function(e){var t="",o=!1;return e.protocol&&(t+=e.protocol+":"),e.urn||!t&&!e.hostname||(t+="//",o=!0),t+=s.buildAuthority(e)||"","string"==typeof e.path&&("/"!==e.path.charAt(0)&&o&&(t+="/"),t+=e.path),"string"==typeof e.query&&e.query&&(t+="?"+e.query),"string"==typeof e.fragment&&e.fragment&&(t+="#"+e.fragment),t},s.buildHost=function(e){var t="";return e.hostname?(s.ip6_expression.test(e.hostname)?t+="["+e.hostname+"]":t+=e.hostname,e.port&&(t+=":"+e.port),t):""},s.buildAuthority=function(e){return s.buildUserinfo(e)+s.buildHost(e)},s.buildUserinfo=function(e){var t="";return e.username&&(t+=s.encode(e.username)),e.password&&(t+=":"+s.encode(e.password)),t&&(t+="@"),t},s.buildQuery=function(e,t,o){var r,n,i,c,l="";for(n in e)if("__proto__"!==n&&a.call(e,n))if(u(e[n]))for(r={},i=0,c=e[n].length;i<c;i++)void 0!==e[n][i]&&void 0===r[e[n][i]+""]&&(l+="&"+s.buildQueryParameter(n,e[n][i],o),!0!==t&&(r[e[n][i]+""]=!0));else void 0!==e[n]&&(l+="&"+s.buildQueryParameter(n,e[n],o));return l.substring(1)},s.buildQueryParameter=function(e,t,o){return s.encodeQuery(e,o)+(null!==t?"="+s.encodeQuery(t,o):"")},s.addQuery=function(e,t,o){if("object"==typeof t)for(var r in t)a.call(t,r)&&s.addQuery(e,r,t[r]);else{if("string"!=typeof t)throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");if(void 0===e[t])return void(e[t]=o);"string"==typeof e[t]&&(e[t]=[e[t]]),u(o)||(o=[o]),e[t]=(e[t]||[]).concat(o)}},s.setQuery=function(e,t,o){if("object"==typeof t)for(var r in t)a.call(t,r)&&s.setQuery(e,r,t[r]);else{if("string"!=typeof t)throw new TypeError("URI.setQuery() accepts an object, string as the name parameter");e[t]=void 0===o?null:o}},s.removeQuery=function(e,t,o){var r,n,i;if(u(t))for(r=0,n=t.length;r<n;r++)e[t[r]]=void 0;else if("RegExp"===l(t))for(i in e)t.test(i)&&(e[i]=void 0);else if("object"==typeof t)for(i in t)a.call(t,i)&&s.removeQuery(e,i,t[i]);else{if("string"!=typeof t)throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter");void 0!==o?"RegExp"===l(o)?!u(e[t])&&o.test(e[t])?e[t]=void 0:e[t]=p(e[t],o):e[t]!==String(o)||u(o)&&1!==o.length?u(e[t])&&(e[t]=p(e[t],o)):e[t]=void 0:e[t]=void 0}},s.hasQuery=function(e,t,o,r){switch(l(t)){case"String":break;case"RegExp":for(var n in e)if(a.call(e,n)&&t.test(n)&&(void 0===o||s.hasQuery(e,n,o)))return!0;return!1;case"Object":for(var i in t)if(a.call(t,i)&&!s.hasQuery(e,i,t[i]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(l(o)){case"Undefined":return t in e;case"Boolean":return o===Boolean(u(e[t])?e[t].length:e[t]);case"Function":return!!o(e[t],t,e);case"Array":return!!u(e[t])&&(r?d:h)(e[t],o);case"RegExp":return u(e[t])?!!r&&d(e[t],o):Boolean(e[t]&&e[t].match(o));case"Number":o=String(o);case"String":return u(e[t])?!!r&&d(e[t],o):e[t]===o;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},s.joinPaths=function(){for(var e=[],t=[],o=0,r=0;r<arguments.length;r++){var n=new s(arguments[r]);e.push(n);for(var i=n.segment(),a=0;a<i.length;a++)"string"==typeof i[a]&&t.push(i[a]),i[a]&&o++}if(!t.length||!o)return new s("");var c=new s("").segment(t);return""!==e[0].path()&&"/"!==e[0].path().slice(0,1)||c.path("/"+c.path()),c.normalize()},s.commonPath=function(e,t){var o,r=Math.min(e.length,t.length);for(o=0;o<r;o++)if(e.charAt(o)!==t.charAt(o)){o--;break}return o<1?e.charAt(0)===t.charAt(0)&&"/"===e.charAt(0)?"/":"":("/"===e.charAt(o)&&"/"===t.charAt(o)||(o=e.substring(0,o).lastIndexOf("/")),e.substring(0,o+1))},s.withinString=function(e,t,o){o||(o={});var r=o.start||s.findUri.start,n=o.end||s.findUri.end,i=o.trim||s.findUri.trim,a=o.parens||s.findUri.parens,c=/[a-z0-9-]=["']?$/i;for(r.lastIndex=0;;){var l=r.exec(e);if(!l)break;var u=l.index;if(o.ignoreHtml){var p=e.slice(Math.max(u-3,0),u);if(p&&c.test(p))continue}for(var d=u+e.slice(u).search(n),h=e.slice(u,d),m=-1;;){var g=a.exec(h);if(!g)break;var b=g.index+g[0].length;m=Math.max(m,b)}if(!((h=m>-1?h.slice(0,m)+h.slice(m).replace(i,""):h.replace(i,"")).length<=l[0].length||o.ignore&&o.ignore.test(h))){var f=t(h,u,d=u+h.length,e);void 0!==f?(f=String(f),e=e.slice(0,u)+f+e.slice(d),r.lastIndex=u+f.length):r.lastIndex=d}}return r.lastIndex=0,e},s.ensureValidHostname=function(t,o){var r=!!t,n=!1;if(!!o&&(n=d(s.hostProtocols,o)),n&&!r)throw new TypeError("Hostname cannot be empty, if protocol is "+o);if(t&&t.match(s.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(t).match(s.invalid_hostname_characters))throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-:_]')}},s.ensureValidPort=function(e){if(e){var t=Number(e);if(!(/^[0-9]+$/.test(t)&&t>0&&t<65536))throw new TypeError('Port "'+e+'" is not a valid port')}},s.noConflict=function(e){if(e){var t={URI:this.noConflict()};return r.URITemplate&&"function"==typeof r.URITemplate.noConflict&&(t.URITemplate=r.URITemplate.noConflict()),r.IPv6&&"function"==typeof r.IPv6.noConflict&&(t.IPv6=r.IPv6.noConflict()),r.SecondLevelDomains&&"function"==typeof r.SecondLevelDomains.noConflict&&(t.SecondLevelDomains=r.SecondLevelDomains.noConflict()),t}return r.URI===this&&(r.URI=n),this},i.build=function(e){return!0===e?this._deferred_build=!0:(void 0===e||this._deferred_build)&&(this._string=s.build(this._parts),this._deferred_build=!1),this},i.clone=function(){return new s(this)},i.valueOf=i.toString=function(){return this.build(!1)._string},i.protocol=I("protocol"),i.username=I("username"),i.password=I("password"),i.hostname=I("hostname"),i.port=I("port"),i.query=O("query","?"),i.fragment=O("fragment","#"),i.search=function(e,t){var o=this.query(e,t);return"string"==typeof o&&o.length?"?"+o:o},i.hash=function(e,t){var o=this.fragment(e,t);return"string"==typeof o&&o.length?"#"+o:o},i.pathname=function(e,t){if(void 0===e||!0===e){var o=this._parts.path||(this._parts.hostname?"/":"");return e?(this._parts.urn?s.decodeUrnPath:s.decodePath)(o):o}return this._parts.urn?this._parts.path=e?s.recodeUrnPath(e):"":this._parts.path=e?s.recodePath(e):"/",this.build(!t),this},i.path=i.pathname,i.href=function(e,t){var o;if(void 0===e)return this.toString();this._string="",this._parts=s._parts();var r=e instanceof s,n="object"==typeof e&&(e.hostname||e.path||e.pathname);if(e.nodeName&&(e=e[s.getDomAttribute(e)]||"",n=!1),!r&&n&&void 0!==e.pathname&&(e=e.toString()),"string"==typeof e||e instanceof String)this._parts=s.parse(String(e),this._parts);else{if(!r&&!n)throw new TypeError("invalid input");var i=r?e._parts:e;for(o in i)"query"!==o&&a.call(this._parts,o)&&(this._parts[o]=i[o]);i.query&&this.query(i.query,!1)}return this.build(!t),this},i.is=function(e){var t=!1,r=!1,n=!1,i=!1,a=!1,c=!1,l=!1,u=!this._parts.urn;switch(this._parts.hostname&&(u=!1,r=s.ip4_expression.test(this._parts.hostname),n=s.ip6_expression.test(this._parts.hostname),a=(i=!(t=r||n))&&o&&o.has(this._parts.hostname),c=i&&s.idn_expression.test(this._parts.hostname),l=i&&s.punycode_expression.test(this._parts.hostname)),e.toLowerCase()){case"relative":return u;case"absolute":return!u;case"domain":case"name":return i;case"sld":return a;case"ip":return t;case"ip4":case"ipv4":case"inet4":return r;case"ip6":case"ipv6":case"inet6":return n;case"idn":return c;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return l}return null};var k=i.protocol,A=i.port,j=i.hostname;i.protocol=function(e,t){if(e&&!(e=e.replace(/:(\/\/)?$/,"")).match(s.protocol_expression))throw new TypeError('Protocol "'+e+"\" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]");return k.call(this,e,t)},i.scheme=i.protocol,i.port=function(e,t){return this._parts.urn?void 0===e?"":this:(void 0!==e&&(0===e&&(e=null),e&&(":"===(e+="").charAt(0)&&(e=e.substring(1)),s.ensureValidPort(e))),A.call(this,e,t))},i.hostname=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0!==e){var o={preventInvalidHostname:this._parts.preventInvalidHostname};if("/"!==s.parseHost(e,o))throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');e=o.hostname,this._parts.preventInvalidHostname&&s.ensureValidHostname(e,this._parts.protocol)}return j.call(this,e,t)},i.origin=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e){var o=this.protocol();return this.authority()?(o?o+"://":"")+this.authority():""}var r=s(e);return this.protocol(r.protocol()).authority(r.authority()).build(!t),this},i.host=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e)return this._parts.hostname?s.buildHost(this._parts):"";if("/"!==s.parseHost(e,this._parts))throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');return this.build(!t),this},i.authority=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e)return this._parts.hostname?s.buildAuthority(this._parts):"";if("/"!==s.parseAuthority(e,this._parts))throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');return this.build(!t),this},i.userinfo=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e){var o=s.buildUserinfo(this._parts);return o?o.substring(0,o.length-1):o}return"@"!==e[e.length-1]&&(e+="@"),s.parseUserinfo(e,this._parts),this.build(!t),this},i.resource=function(e,t){var o;return void 0===e?this.path()+this.search()+this.hash():(o=s.parse(e),this._parts.path=o.path,this._parts.query=o.query,this._parts.fragment=o.fragment,this.build(!t),this)},i.subdomain=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e){if(!this._parts.hostname||this.is("IP"))return"";var o=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,o)||""}var r=this._parts.hostname.length-this.domain().length,n=this._parts.hostname.substring(0,r),i=new RegExp("^"+c(n));if(e&&"."!==e.charAt(e.length-1)&&(e+="."),-1!==e.indexOf(":"))throw new TypeError("Domains cannot contain colons");return e&&s.ensureValidHostname(e,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(i,e),this.build(!t),this},i.domain=function(e,t){if(this._parts.urn)return void 0===e?"":this;if("boolean"==typeof e&&(t=e,e=void 0),void 0===e){if(!this._parts.hostname||this.is("IP"))return"";var o=this._parts.hostname.match(/\./g);if(o&&o.length<2)return this._parts.hostname;var r=this._parts.hostname.length-this.tld(t).length-1;return r=this._parts.hostname.lastIndexOf(".",r-1)+1,this._parts.hostname.substring(r)||""}if(!e)throw new TypeError("cannot set domain empty");if(-1!==e.indexOf(":"))throw new TypeError("Domains cannot contain colons");if(s.ensureValidHostname(e,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=e;else{var n=new RegExp(c(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(n,e)}return this.build(!t),this},i.tld=function(e,t){if(this._parts.urn)return void 0===e?"":this;if("boolean"==typeof e&&(t=e,e=void 0),void 0===e){if(!this._parts.hostname||this.is("IP"))return"";var r=this._parts.hostname.lastIndexOf("."),n=this._parts.hostname.substring(r+1);return!0!==t&&o&&o.list[n.toLowerCase()]&&o.get(this._parts.hostname)||n}var s;if(!e)throw new TypeError("cannot set TLD empty");if(e.match(/[^a-zA-Z0-9-]/)){if(!o||!o.is(e))throw new TypeError('TLD "'+e+'" contains characters other than [A-Z0-9]');s=new RegExp(c(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(s,e)}else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");s=new RegExp(c(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(s,e)}return this.build(!t),this},i.directory=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e||!0===e){if(!this._parts.path&&!this._parts.hostname)return"";if("/"===this._parts.path)return"/";var o=this._parts.path.length-this.filename().length-1,r=this._parts.path.substring(0,o)||(this._parts.hostname?"/":"");return e?s.decodePath(r):r}var n=this._parts.path.length-this.filename().length,i=this._parts.path.substring(0,n),a=new RegExp("^"+c(i));return this.is("relative")||(e||(e="/"),"/"!==e.charAt(0)&&(e="/"+e)),e&&"/"!==e.charAt(e.length-1)&&(e+="/"),e=s.recodePath(e),this._parts.path=this._parts.path.replace(a,e),this.build(!t),this},i.filename=function(e,t){if(this._parts.urn)return void 0===e?"":this;if("string"!=typeof e){if(!this._parts.path||"/"===this._parts.path)return"";var o=this._parts.path.lastIndexOf("/"),r=this._parts.path.substring(o+1);return e?s.decodePathSegment(r):r}var n=!1;"/"===e.charAt(0)&&(e=e.substring(1)),e.match(/\.?\//)&&(n=!0);var i=new RegExp(c(this.filename())+"$");return e=s.recodePath(e),this._parts.path=this._parts.path.replace(i,e),n?this.normalizePath(t):this.build(!t),this},i.suffix=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e||!0===e){if(!this._parts.path||"/"===this._parts.path)return"";var o,r,n=this.filename(),i=n.lastIndexOf(".");return-1===i?"":(o=n.substring(i+1),r=/^[a-z0-9%]+$/i.test(o)?o:"",e?s.decodePathSegment(r):r)}"."===e.charAt(0)&&(e=e.substring(1));var a,l=this.suffix();if(l)a=e?new RegExp(c(l)+"$"):new RegExp(c("."+l)+"$");else{if(!e)return this;this._parts.path+="."+s.recodePath(e)}return a&&(e=s.recodePath(e),this._parts.path=this._parts.path.replace(a,e)),this.build(!t),this},i.segment=function(e,t,o){var r=this._parts.urn?":":"/",n=this.path(),s="/"===n.substring(0,1),i=n.split(r);if(void 0!==e&&"number"!=typeof e&&(o=t,t=e,e=void 0),void 0!==e&&"number"!=typeof e)throw new Error('Bad segment "'+e+'", must be 0-based integer');if(s&&i.shift(),e<0&&(e=Math.max(i.length+e,0)),void 0===t)return void 0===e?i:i[e];if(null===e||void 0===i[e])if(u(t)){i=[];for(var a=0,c=t.length;a<c;a++)(t[a].length||i.length&&i[i.length-1].length)&&(i.length&&!i[i.length-1].length&&i.pop(),i.push(m(t[a])))}else(t||"string"==typeof t)&&(t=m(t),""===i[i.length-1]?i[i.length-1]=t:i.push(t));else t?i[e]=m(t):i.splice(e,1);return s&&i.unshift(""),this.path(i.join(r),o)},i.segmentCoded=function(e,t,o){var r,n,i;if("number"!=typeof e&&(o=t,t=e,e=void 0),void 0===t){if(u(r=this.segment(e,t,o)))for(n=0,i=r.length;n<i;n++)r[n]=s.decode(r[n]);else r=void 0!==r?s.decode(r):void 0;return r}if(u(t))for(n=0,i=t.length;n<i;n++)t[n]=s.encode(t[n]);else t="string"==typeof t||t instanceof String?s.encode(t):t;return this.segment(e,t,o)};var C=i.query;return i.query=function(e,t){if(!0===e)return s.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if("function"==typeof e){var o=s.parseQuery(this._parts.query,this._parts.escapeQuerySpace),r=e.call(this,o);return this._parts.query=s.buildQuery(r||o,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!t),this}return void 0!==e&&"string"!=typeof e?(this._parts.query=s.buildQuery(e,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!t),this):C.call(this,e,t)},i.setQuery=function(e,t,o){var r=s.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if("string"==typeof e||e instanceof String)r[e]=void 0!==t?t:null;else{if("object"!=typeof e)throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");for(var n in e)a.call(e,n)&&(r[n]=e[n])}return this._parts.query=s.buildQuery(r,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!=typeof e&&(o=t),this.build(!o),this},i.addQuery=function(e,t,o){var r=s.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return s.addQuery(r,e,void 0===t?null:t),this._parts.query=s.buildQuery(r,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!=typeof e&&(o=t),this.build(!o),this},i.removeQuery=function(e,t,o){var r=s.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return s.removeQuery(r,e,t),this._parts.query=s.buildQuery(r,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!=typeof e&&(o=t),this.build(!o),this},i.hasQuery=function(e,t,o){var r=s.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return s.hasQuery(r,e,t,o)},i.setSearch=i.setQuery,i.addSearch=i.addQuery,i.removeSearch=i.removeQuery,i.hasSearch=i.hasQuery,i.normalize=function(){return this._parts.urn?this.normalizeProtocol(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build():this.normalizeProtocol(!1).normalizeHostname(!1).normalizePort(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build()},i.normalizeProtocol=function(e){return"string"==typeof this._parts.protocol&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!e)),this},i.normalizeHostname=function(o){return this._parts.hostname&&(this.is("IDN")&&e?this._parts.hostname=e.toASCII(this._parts.hostname):this.is("IPv6")&&t&&(this._parts.hostname=t.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!o)),this},i.normalizePort=function(e){return"string"==typeof this._parts.protocol&&this._parts.port===s.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!e)),this},i.normalizePath=function(e){var t,o=this._parts.path;if(!o)return this;if(this._parts.urn)return this._parts.path=s.recodeUrnPath(this._parts.path),this.build(!e),this;if("/"===this._parts.path)return this;var r,n,i="";for("/"!==(o=s.recodePath(o)).charAt(0)&&(t=!0,o="/"+o),"/.."!==o.slice(-3)&&"/."!==o.slice(-2)||(o+="/"),o=o.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),t&&(i=o.substring(1).match(/^(\.\.\/)+/)||"")&&(i=i[0]);-1!==(r=o.search(/\/\.\.(\/|$)/));)0!==r?(-1===(n=o.substring(0,r).lastIndexOf("/"))&&(n=r),o=o.substring(0,n)+o.substring(r+3)):o=o.substring(3);return t&&this.is("relative")&&(o=i+o.substring(1)),this._parts.path=o,this.build(!e),this},i.normalizePathname=i.normalizePath,i.normalizeQuery=function(e){return"string"==typeof this._parts.query&&(this._parts.query.length?this.query(s.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!e)),this},i.normalizeFragment=function(e){return this._parts.fragment||(this._parts.fragment=null,this.build(!e)),this},i.normalizeSearch=i.normalizeQuery,i.normalizeHash=i.normalizeFragment,i.iso8859=function(){var e=s.encode,t=s.decode;s.encode=escape,s.decode=decodeURIComponent;try{this.normalize()}finally{s.encode=e,s.decode=t}return this},i.unicode=function(){var e=s.encode,t=s.decode;s.encode=b,s.decode=unescape;try{this.normalize()}finally{s.encode=e,s.decode=t}return this},i.readable=function(){var t=this.clone();t.username("").password("").normalize();var o="";if(t._parts.protocol&&(o+=t._parts.protocol+"://"),t._parts.hostname&&(t.is("punycode")&&e?(o+=e.toUnicode(t._parts.hostname),t._parts.port&&(o+=":"+t._parts.port)):o+=t.host()),t._parts.hostname&&t._parts.path&&"/"!==t._parts.path.charAt(0)&&(o+="/"),o+=t.path(!0),t._parts.query){for(var r="",n=0,i=t._parts.query.split("&"),a=i.length;n<a;n++){var c=(i[n]||"").split("=");r+="&"+s.decodeQuery(c[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),void 0!==c[1]&&(r+="="+s.decodeQuery(c[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}o+="?"+r.substring(1)}return o+s.decodeQuery(t.hash(),!0)},i.absoluteTo=function(e){var t,o,r,n=this.clone(),i=["protocol","username","password","hostname","port"];if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(e instanceof s||(e=new s(e)),n._parts.protocol)return n;if(n._parts.protocol=e._parts.protocol,this._parts.hostname)return n;for(o=0;r=i[o];o++)n._parts[r]=e._parts[r];return n._parts.path?(".."===n._parts.path.substring(-2)&&(n._parts.path+="/"),"/"!==n.path().charAt(0)&&(t=(t=e.directory())||(0===e.path().indexOf("/")?"/":""),n._parts.path=(t?t+"/":"")+n._parts.path,n.normalizePath())):(n._parts.path=e._parts.path,n._parts.query||(n._parts.query=e._parts.query)),n.build(),n},i.relativeTo=function(e){var t,o,r,n,i,a=this.clone().normalize();if(a._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(e=new s(e).normalize(),t=a._parts,o=e._parts,n=a.path(),i=e.path(),"/"!==n.charAt(0))throw new Error("URI is already relative");if("/"!==i.charAt(0))throw new Error("Cannot calculate a URI relative to another relative URI");if(t.protocol===o.protocol&&(t.protocol=null),t.username!==o.username||t.password!==o.password)return a.build();if(null!==t.protocol||null!==t.username||null!==t.password)return a.build();if(t.hostname!==o.hostname||t.port!==o.port)return a.build();if(t.hostname=null,t.port=null,n===i)return t.path="",a.build();if(!(r=s.commonPath(n,i)))return a.build();var c=o.path.substring(r.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return t.path=c+t.path.substring(r.length)||"./",a.build()},i.equals=function(e){var t,o,r,n,i,c=this.clone(),l=new s(e),p={};if(c.normalize(),l.normalize(),c.toString()===l.toString())return!0;if(r=c.query(),n=l.query(),c.query(""),l.query(""),c.toString()!==l.toString())return!1;if(r.length!==n.length)return!1;for(i in t=s.parseQuery(r,this._parts.escapeQuerySpace),o=s.parseQuery(n,this._parts.escapeQuerySpace),t)if(a.call(t,i)){if(u(t[i])){if(!h(t[i],o[i]))return!1}else if(t[i]!==o[i])return!1;p[i]=!0}for(i in o)if(a.call(o,i)&&!p[i])return!1;return!0},i.preventInvalidHostname=function(e){return this._parts.preventInvalidHostname=!!e,this},i.duplicateQueryParameters=function(e){return this._parts.duplicateQueryParameters=!!e,this},i.escapeQuerySpace=function(e){return this._parts.escapeQuerySpace=!!e,this},s}))},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=window.wp.blockEditor},function(e,t){e.exports=window.wp.compose},function(e,t){function o(t){return e.exports=o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.default=e.exports,e.exports.__esModule=!0,o(t)}e.exports=o,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=window.wp.url},function(e,t,o){(function(e,r){var n;!function(s){t&&t.nodeType,e&&e.nodeType;var i="object"==typeof r&&r;i.global!==i&&i.window!==i&&i.self;var a,c=2147483647,l=/^xn--/,u=/[^\x20-\x7E]/,p=/[\x2E\u3002\uFF0E\uFF61]/g,d={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},h=Math.floor,m=String.fromCharCode;function g(e){throw new RangeError(d[e])}function b(e,t){for(var o=e.length,r=[];o--;)r[o]=t(e[o]);return r}function f(e,t){var o=e.split("@"),r="";return o.length>1&&(r=o[0]+"@",e=o[1]),r+b((e=e.replace(p,".")).split("."),t).join(".")}function v(e){for(var t,o,r=[],n=0,s=e.length;n<s;)(t=e.charCodeAt(n++))>=55296&&t<=56319&&n<s?56320==(64512&(o=e.charCodeAt(n++)))?r.push(((1023&t)<<10)+(1023&o)+65536):(r.push(t),n--):r.push(t);return r}function w(e){return b(e,(function(e){var t="";return e>65535&&(t+=m((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+m(e)})).join("")}function y(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function I(e,t,o){var r=0;for(e=o?h(e/700):e>>1,e+=h(e/t);e>455;r+=36)e=h(e/35);return h(r+36*e/(e+38))}function O(e){var t,o,r,n,s,i,a,l,u,p,d,m=[],b=e.length,f=0,v=128,y=72;for((o=e.lastIndexOf("-"))<0&&(o=0),r=0;r<o;++r)e.charCodeAt(r)>=128&&g("not-basic"),m.push(e.charCodeAt(r));for(n=o>0?o+1:0;n<b;){for(s=f,i=1,a=36;n>=b&&g("invalid-input"),((l=(d=e.charCodeAt(n++))-48<10?d-22:d-65<26?d-65:d-97<26?d-97:36)>=36||l>h((c-f)/i))&&g("overflow"),f+=l*i,!(l<(u=a<=y?1:a>=y+26?26:a-y));a+=36)i>h(c/(p=36-u))&&g("overflow"),i*=p;y=I(f-s,t=m.length+1,0==s),h(f/t)>c-v&&g("overflow"),v+=h(f/t),f%=t,m.splice(f++,0,v)}return w(m)}function k(e){var t,o,r,n,s,i,a,l,u,p,d,b,f,w,O,k=[];for(b=(e=v(e)).length,t=128,o=0,s=72,i=0;i<b;++i)(d=e[i])<128&&k.push(m(d));for(r=n=k.length,n&&k.push("-");r<b;){for(a=c,i=0;i<b;++i)(d=e[i])>=t&&d<a&&(a=d);for(a-t>h((c-o)/(f=r+1))&&g("overflow"),o+=(a-t)*f,t=a,i=0;i<b;++i)if((d=e[i])<t&&++o>c&&g("overflow"),d==t){for(l=o,u=36;!(l<(p=u<=s?1:u>=s+26?26:u-s));u+=36)O=l-p,w=36-p,k.push(m(y(p+O%w,0))),l=h(O/w);k.push(m(y(l,0))),s=I(o,f,r==n),o=0,++r}++o,++t}return k.join("")}a={version:"1.3.2",ucs2:{decode:v,encode:w},decode:O,encode:k,toASCII:function(e){return f(e,(function(e){return u.test(e)?"xn--"+k(e):e}))},toUnicode:function(e){return f(e,(function(e){return l.test(e)?O(e.slice(4).toLowerCase()):e}))}},void 0===(n=function(){return a}.call(t,o,t,e))||(e.exports=n)}()}).call(this,o(28)(e),o(29))},function(e,t,o){var r,n;!function(s,i){"use strict";e.exports?e.exports=i():void 0===(n="function"==typeof(r=i)?r.call(t,o,t,e):r)||(e.exports=n)}(0,(function(e){"use strict";var t=e&&e.IPv6;return{best:function(e){var t,o,r=e.toLowerCase().split(":"),n=r.length,s=8;for(""===r[0]&&""===r[1]&&""===r[2]?(r.shift(),r.shift()):""===r[0]&&""===r[1]?r.shift():""===r[n-1]&&""===r[n-2]&&r.pop(),-1!==r[(n=r.length)-1].indexOf(".")&&(s=7),t=0;t<n&&""!==r[t];t++);if(t<s)for(r.splice(t,1,"0000");r.length<s;)r.splice(t,0,"0000");for(var i=0;i<s;i++){o=r[i].split("");for(var a=0;a<3&&"0"===o[0]&&o.length>1;a++)o.splice(0,1);r[i]=o.join("")}var c=-1,l=0,u=0,p=-1,d=!1;for(i=0;i<s;i++)d?"0"===r[i]?u+=1:(d=!1,u>l&&(c=p,l=u)):"0"===r[i]&&(d=!0,p=i,u=1);u>l&&(c=p,l=u),l>1&&r.splice(c,l,""),n=r.length;var h="";for(""===r[0]&&(h=":"),i=0;i<n&&(h+=r[i],i!==n-1);i++)h+=":";return""===r[n-1]&&(h+=":"),h},noConflict:function(){return e.IPv6===this&&(e.IPv6=t),this}}}))},function(e,t,o){var r,n;!function(s,i){"use strict";e.exports?e.exports=i():void 0===(n="function"==typeof(r=i)?r.call(t,o,t,e):r)||(e.exports=n)}(0,(function(e){"use strict";var t=e&&e.SecondLevelDomains,o={list:{ac:" com gov mil net org ",ae:" ac co gov mil name net org pro sch ",af:" com edu gov net org ",al:" com edu gov mil net org ",ao:" co ed gv it og pb ",ar:" com edu gob gov int mil net org tur ",at:" ac co gv or ",au:" asn com csiro edu gov id net org ",ba:" co com edu gov mil net org rs unbi unmo unsa untz unze ",bb:" biz co com edu gov info net org store tv ",bh:" biz cc com edu gov info net org ",bn:" com edu gov net org ",bo:" com edu gob gov int mil net org tv ",br:" adm adv agr am arq art ato b bio blog bmd cim cng cnt com coop ecn edu eng esp etc eti far flog fm fnd fot fst g12 ggf gov imb ind inf jor jus lel mat med mil mus net nom not ntr odo org ppg pro psc psi qsl rec slg srv tmp trd tur tv vet vlog wiki zlg ",bs:" com edu gov net org ",bz:" du et om ov rg ",ca:" ab bc mb nb nf nl ns nt nu on pe qc sk yk ",ck:" biz co edu gen gov info net org ",cn:" ac ah bj com cq edu fj gd gov gs gx gz ha hb he hi hl hn jl js jx ln mil net nm nx org qh sc sd sh sn sx tj tw xj xz yn zj ",co:" com edu gov mil net nom org ",cr:" ac c co ed fi go or sa ",cy:" ac biz com ekloges gov ltd name net org parliament press pro tm ",do:" art com edu gob gov mil net org sld web ",dz:" art asso com edu gov net org pol ",ec:" com edu fin gov info med mil net org pro ",eg:" com edu eun gov mil name net org sci ",er:" com edu gov ind mil net org rochest w ",es:" com edu gob nom org ",et:" biz com edu gov info name net org ",fj:" ac biz com info mil name net org pro ",fk:" ac co gov net nom org ",fr:" asso com f gouv nom prd presse tm ",gg:" co net org ",gh:" com edu gov mil org ",gn:" ac com gov net org ",gr:" com edu gov mil net org ",gt:" com edu gob ind mil net org ",gu:" com edu gov net org ",hk:" com edu gov idv net org ",hu:" 2000 agrar bolt casino city co erotica erotika film forum games hotel info ingatlan jogasz konyvelo lakas media news org priv reklam sex shop sport suli szex tm tozsde utazas video ",id:" ac co go mil net or sch web ",il:" ac co gov idf k12 muni net org ",in:" ac co edu ernet firm gen gov i ind mil net nic org res ",iq:" com edu gov i mil net org ",ir:" ac co dnssec gov i id net org sch ",it:" edu gov ",je:" co net org ",jo:" com edu gov mil name net org sch ",jp:" ac ad co ed go gr lg ne or ",ke:" ac co go info me mobi ne or sc ",kh:" com edu gov mil net org per ",ki:" biz com de edu gov info mob net org tel ",km:" asso com coop edu gouv k medecin mil nom notaires pharmaciens presse tm veterinaire ",kn:" edu gov net org ",kr:" ac busan chungbuk chungnam co daegu daejeon es gangwon go gwangju gyeongbuk gyeonggi gyeongnam hs incheon jeju jeonbuk jeonnam k kg mil ms ne or pe re sc seoul ulsan ",kw:" com edu gov net org ",ky:" com edu gov net org ",kz:" com edu gov mil net org ",lb:" com edu gov net org ",lk:" assn com edu gov grp hotel int ltd net ngo org sch soc web ",lr:" com edu gov net org ",lv:" asn com conf edu gov id mil net org ",ly:" com edu gov id med net org plc sch ",ma:" ac co gov m net org press ",mc:" asso tm ",me:" ac co edu gov its net org priv ",mg:" com edu gov mil nom org prd tm ",mk:" com edu gov inf name net org pro ",ml:" com edu gov net org presse ",mn:" edu gov org ",mo:" com edu gov net org ",mt:" com edu gov net org ",mv:" aero biz com coop edu gov info int mil museum name net org pro ",mw:" ac co com coop edu gov int museum net org ",mx:" com edu gob net org ",my:" com edu gov mil name net org sch ",nf:" arts com firm info net other per rec store web ",ng:" biz com edu gov mil mobi name net org sch ",ni:" ac co com edu gob mil net nom org ",np:" com edu gov mil net org ",nr:" biz com edu gov info net org ",om:" ac biz co com edu gov med mil museum net org pro sch ",pe:" com edu gob mil net nom org sld ",ph:" com edu gov i mil net ngo org ",pk:" biz com edu fam gob gok gon gop gos gov net org web ",pl:" art bialystok biz com edu gda gdansk gorzow gov info katowice krakow lodz lublin mil net ngo olsztyn org poznan pwr radom slupsk szczecin torun warszawa waw wroc wroclaw zgora ",pr:" ac biz com edu est gov info isla name net org pro prof ",ps:" com edu gov net org plo sec ",pw:" belau co ed go ne or ",ro:" arts com firm info nom nt org rec store tm www ",rs:" ac co edu gov in org ",sb:" com edu gov net org ",sc:" com edu gov net org ",sh:" co com edu gov net nom org ",sl:" com edu gov net org ",st:" co com consulado edu embaixada gov mil net org principe saotome store ",sv:" com edu gob org red ",sz:" ac co org ",tr:" av bbs bel biz com dr edu gen gov info k12 name net org pol tel tsk tv web ",tt:" aero biz cat co com coop edu gov info int jobs mil mobi museum name net org pro tel travel ",tw:" club com ebiz edu game gov idv mil net org ",mu:" ac co com gov net or org ",mz:" ac co edu gov org ",na:" co com ",nz:" ac co cri geek gen govt health iwi maori mil net org parliament school ",pa:" abo ac com edu gob ing med net nom org sld ",pt:" com edu gov int net nome org publ ",py:" com edu gov mil net org ",qa:" com edu gov mil net org ",re:" asso com nom ",ru:" ac adygeya altai amur arkhangelsk astrakhan bashkiria belgorod bir bryansk buryatia cbg chel chelyabinsk chita chukotka chuvashia com dagestan e-burg edu gov grozny int irkutsk ivanovo izhevsk jar joshkar-ola kalmykia kaluga kamchatka karelia kazan kchr kemerovo khabarovsk khakassia khv kirov koenig komi kostroma kranoyarsk kuban kurgan kursk lipetsk magadan mari mari-el marine mil mordovia mosreg msk murmansk nalchik net nnov nov novosibirsk nsk omsk orenburg org oryol penza perm pp pskov ptz rnd ryazan sakhalin samara saratov simbirsk smolensk spb stavropol stv surgut tambov tatarstan tom tomsk tsaritsyn tsk tula tuva tver tyumen udm udmurtia ulan-ude vladikavkaz vladimir vladivostok volgograd vologda voronezh vrn vyatka yakutia yamal yekaterinburg yuzhno-sakhalinsk ",rw:" ac co com edu gouv gov int mil net ",sa:" com edu gov med net org pub sch ",sd:" com edu gov info med net org tv ",se:" a ac b bd c d e f g h i k l m n o org p parti pp press r s t tm u w x y z ",sg:" com edu gov idn net org per ",sn:" art com edu gouv org perso univ ",sy:" com edu gov mil net news org ",th:" ac co go in mi net or ",tj:" ac biz co com edu go gov info int mil name net nic org test web ",tn:" agrinet com defense edunet ens fin gov ind info intl mincom nat net org perso rnrt rns rnu tourism ",tz:" ac co go ne or ",ua:" biz cherkassy chernigov chernovtsy ck cn co com crimea cv dn dnepropetrovsk donetsk dp edu gov if in ivano-frankivsk kh kharkov kherson khmelnitskiy kiev kirovograd km kr ks kv lg lugansk lutsk lviv me mk net nikolaev od odessa org pl poltava pp rovno rv sebastopol sumy te ternopil uzhgorod vinnica vn zaporizhzhe zhitomir zp zt ",ug:" ac co go ne or org sc ",uk:" ac bl british-library co cym gov govt icnet jet lea ltd me mil mod national-library-scotland nel net nhs nic nls org orgn parliament plc police sch scot soc ",us:" dni fed isa kids nsn ",uy:" com edu gub mil net org ",ve:" co com edu gob info mil net org web ",vi:" co com k12 net org ",vn:" ac biz com edu gov health info int name net org pro ",ye:" co com gov ltd me net org plc ",yu:" ac co edu gov org ",za:" ac agric alt bourse city co cybernet db edu gov grondar iaccess imt inca landesign law mil net ngo nis nom olivetti org pix school tm web ",zm:" ac co com edu gov net org sch ",com:"ar br cn de eu gb gr hu jpn kr no qc ru sa se uk us uy za ",net:"gb jp se uk ",org:"ae",de:"com "},has:function(e){var t=e.lastIndexOf(".");if(t<=0||t>=e.length-1)return!1;var r=e.lastIndexOf(".",t-1);if(r<=0||r>=t-1)return!1;var n=o.list[e.slice(t+1)];return!!n&&n.indexOf(" "+e.slice(r+1,t)+" ")>=0},is:function(e){var t=e.lastIndexOf(".");if(t<=0||t>=e.length-1)return!1;if(e.lastIndexOf(".",t-1)>=0)return!1;var r=o.list[e.slice(t+1)];return!!r&&r.indexOf(" "+e.slice(0,t)+" ")>=0},get:function(e){var t=e.lastIndexOf(".");if(t<=0||t>=e.length-1)return null;var r=e.lastIndexOf(".",t-1);if(r<=0||r>=t-1)return null;var n=o.list[e.slice(t+1)];return n?n.indexOf(" "+e.slice(r+1,t)+" ")<0?null:e.slice(r+1):null},noConflict:function(){return e.SecondLevelDomains===this&&(e.SecondLevelDomains=t),this}};return o}))},function(e,t){function o(){return e.exports=o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},e.exports.default=e.exports,e.exports.__esModule=!0,o.apply(this,arguments)}e.exports=o,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=window.wp.tokenList},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function o(e,t){for(var o=0;o<t.length;o++){var r=t[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,t,r){return t&&o(e.prototype,t),r&&o(e,r),e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,o){var r=o(30);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,o){var r=o(31).default,n=o(11);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?n(e):t},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=window.React},function(e,t){e.exports=window.wp.a11y},,function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t){var o;o=function(){return this}();try{o=o||new Function("return this")()}catch(e){"object"==typeof window&&(o=window)}e.exports=o},function(e,t){function o(t,r){return e.exports=o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,o(t,r)}e.exports=o,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function o(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=o=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=o=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),o(t)}e.exports=o,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,o){"use strict";o.r(t);var r=o(19),n=o.n(r),s=o(0),i=o(3),a=(o(27),o(7)),c=Object(s.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 225.43 225.56"},Object(s.createElement)(a.Path,{d:"M947.67,465.69h72a18,18,0,0,0,18-18v-72a18,18,0,0,0-18-18h-72a18,18,0,0,0-18,18v12a6,6,0,0,0,12,0v-12a6,6,0,0,1,6-6h72a6,6,0,0,1,6,6v72a6,6,0,0,1-6,6h-72a6,6,0,0,1-6-6v-36a6,6,0,1,0-12,0v36A18,18,0,0,0,947.67,465.69Z",transform:"translate(-812.57 -357.69)"}),Object(s.createElement)(a.Path,{d:"M984,505a24,24,0,1,0,22.17,14.82A24,24,0,0,0,984,505Zm4.59,35.09A12,12,0,1,1,996,529,12,12,0,0,1,988.59,540.09Z",transform:"translate(-812.57 -357.69)"}),Object(s.createElement)(a.Path,{d:"M1032,535a6,6,0,0,0,6-6V493a18,18,0,0,0-18-18H948a18,18,0,0,0-18,18v72a18,18,0,0,0,18,18h72a18,18,0,0,0,18-18V553a6,6,0,0,0-12,0v12a6,6,0,0,1-6,6H948a6,6,0,0,1-6-6V493a6,6,0,0,1,6-6h72a6,6,0,0,1,6,6v36A6,6,0,0,0,1032,535Z",transform:"translate(-812.57 -357.69)"}),Object(s.createElement)(a.Path,{d:"M902.57,475.25h-72a18,18,0,0,0-18,18v12a6,6,0,1,0,12,0v-12a6,6,0,0,1,6-6h72a6,6,0,0,1,6,6v72a6,6,0,0,1-6,6h-72a6,6,0,0,1-6-6v-36a6,6,0,0,0-12,0v36a18,18,0,0,0,18,18h72a18,18,0,0,0,18-18v-72A18,18,0,0,0,902.57,475.25Z",transform:"translate(-812.57 -357.69)"}),Object(s.createElement)(a.Path,{d:"M893.7,406.66l-36-18A6,6,0,0,0,849,394v36a6,6,0,0,0,6,6,5.92,5.92,0,0,0,2.7-.66l36-18a6,6,0,0,0,0-10.68ZM861,420.28V403.72L877.56,412Z",transform:"translate(-812.57 -357.69)"}),Object(s.createElement)(a.Path,{d:"M846.34,362.11a54,54,0,1,0,58.84,11.71A54,54,0,0,0,846.34,362.11ZM896.7,441.7a42,42,0,1,1,9.1-45.77A42,42,0,0,1,896.7,441.7Z",transform:"translate(-812.57 -357.69)"}),Object(s.createElement)(a.Path,{d:"M859.91,504.71v4.5c0,3.24-2.14,5.7-6.59,5.7h-2.13v9.36h7.52v15c0,7,5.38,11.26,14.19,11.26a18.45,18.45,0,0,0,6.75-1v-8.87a19.38,19.38,0,0,1-3.42.35c-2.82,0-4.7-.77-4.7-3.66V524.27h8.29v-9.36h-8.29v-10.2Z",transform:"translate(-812.57 -357.69)"}),Object(s.createElement)(a.Path,{d:"M994.39,395.08a17.74,17.74,0,0,1,3.85.35v-8.72a18.83,18.83,0,0,0-6.16-.78c-10.34,0-16.23,5.49-16.23,13.52v3h-6.76v9h6.76v26h13v-26h9.23v-9h-9.23V399.8C988.84,395.93,992.08,395.08,994.39,395.08Z",transform:"translate(-812.57 -357.69)"})),l=o(4),u=o.n(l),p=o(10),d=o.n(p),h=o(5),m=o.n(h),g=o(2),b=o(8),f=o(1),v=o(12),w=o(13),y=o(20),I=o.n(y);const{icons:O}=wpzSocialIconsBlock;var k=class{static filterIcons(e){const t={};return""===e?O:(Object(i.forEach)(O,(o,r)=>{t[r]=o.filter(t=>Object(i.isObject)(t)?t.icon.indexOf(e)>-1:t.indexOf(e)>-1)}),t)}static filterUrlScheme(e){const t={mailto:"mail",viber:"viber",skype:"skype",tg:"tg",tel:"mobile",sms:"comments",fax:"fax",news:"newspaper-o",feed:"rss"},o={"feedburner.google.com":"rss","ok.ru":"odnoklassniki","yt.com":"youtube","fb.com":"facebook","t.me":"telegram","wa.me":"whatsapp","zen.yandex.com":"zen-yandex","zen.yandex.ru":"zen-yandex"},r=new d.a(e);let n=void 0!==r.domain()?r.domain().split(".").shift():r.scheme();const s=Object(i.findKey)(t,(e,t)=>t===r.scheme());n=void 0!==s?t[s]:n;const a=Object(i.findKey)(o,(e,t)=>t===r.hostname());return void 0!==a?o[a]:n}static hyphensToSpaces(e){return e.replace(/-/g," ")}static capitalize(e){return"string"!=typeof e?"":e.charAt(0).toUpperCase()+e.slice(1)}static humanizeIconLabel(e){return this.hyphensToSpaces(this.capitalize(e))}static getBlockStyle(e){const t=/is-style-(\S*)/g.exec(e);return null!==t?t[1]:null}static getIconClassList(e,t){const o={"social-icon":!0};return o[e]=!0,["fab","fas","far"].includes(e)?o["fa-"+t]=!0:o[e+"-"+t]=!0,o}static addPercentagePipe(e){return e+"%"}static addPercentageHalfPipe(e){return`${.5*e}%/${e}%`}static addPixelsPipe(e){return e+"px"}static arrayMoveMutate(e,t,o){e.splice(o<0?e.length+o:o,0,e.splice(t,1)[0])}static arrayMove(e,t,o){return e=e.slice(),this.arrayMoveMutate(e,t,o),e}static getActiveStyle(e,t){for(const o of new I.a(t).values()){if(-1===o.indexOf("is-style-"))continue;const t=o.substring(9),r=Object(i.find)(e,{name:t});if(r)return r}return Object(i.find)(e,["isDefault",!0])}},A=o(21),j=o.n(A),C=o(22),E=o.n(C),x=o(11),z=o.n(x),S=o(23),_=o.n(S),P=o(24),B=o.n(P),Q=o(14),F=o.n(Q);var R=function(e){_()(n,e);var t,o,r=(t=n,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=F()(t);if(o){var n=F()(this).constructor;e=Reflect.construct(r,arguments,n)}else e=r.apply(this,arguments);return B()(this,e)});function n(){var e;j()(this,n);for(var t=arguments.length,o=new Array(t),s=0;s<t;s++)o[s]=arguments[s];return e=r.call.apply(r,[this].concat(o)),u()(z()(e),"state",{color:e.props.color,showColorPicker:!1}),u()(z()(e),"onClickColorIndicatorHandler",(function(){e.setState({showColorPicker:!0})})),u()(z()(e),"setColorPickerHandler",(function(t){e.setState({color:t.hex},(function(){e.props.save(e.state)}))})),u()(z()(e),"focusOutsideHandler",(function(){e.setState({showColorPicker:!1})})),e}return E()(n,[{key:"render",value:function(){return Object(s.createElement)(f.ColorIndicator,{title:this.props.title,className:this.props.className,colorValue:this.state.color,onClick:this.onClickColorIndicatorHandler},this.state.showColorPicker&&Object(s.createElement)(f.Popover,{position:"middle right",onFocusOutside:this.focusOutsideHandler},Object(s.createElement)("div",{className:"popover-content"},Object(s.createElement)(f.ColorPicker,{className:"wpzoom-color-picker",disableAlpha:!0,color:this.state.color,onChangeComplete:this.setColorPickerHandler}))))}}]),n}(s.Component);class H extends s.Component{constructor(...e){super(...e),u()(this,"state",{isHover:!1}),u()(this,"onMouseEnterCallback",()=>{this.setState({isHover:!0})}),u()(this,"onMouseLeaveCallback",()=>{this.setState({isHover:!1})})}render(){return Object(s.createElement)("span",{ref:this.props.setRef,onClick:()=>this.props.click(this.props.icon),className:m()(k.getIconClassList(this.props.iconKit,this.props.icon),{selected:this.props.isSelected}),style:{backgroundColor:this.state.isHover?this.props.hoverColor:this.props.color},onMouseEnter:this.onMouseEnterCallback,onMouseLeave:this.onMouseLeaveCallback})}}var N=H,L=o(25),U=o.n(L);const{iconKitsCategories:M}=wpzSocialIconsBlock;class V extends s.Component{constructor(e){super(e),u()(this,"state",{modalShow:this.props.show,modalUrl:this.props.url,modalLabel:this.props.label,modalIcon:this.props.icon,modalIconKit:this.props.iconKit,modalColor:this.props.color,modalHoverColor:this.props.hoverColor,modalSearch:""}),u()(this,"urlTextControlHandler",e=>{const t={modalUrl:e=Object(i.isEmpty)(new d.a(e).protocol())?"https://"+e:e},o=k.filterUrlScheme(e);if(o){const e=k.filterIcons(o);e[this.state.modalIconKit].length&&(t.modalIcon=e[this.state.modalIconKit][0].icon)}this.setState(t)}),u()(this,"labelTextControlHandler",e=>{this.setState({modalLabel:e})}),u()(this,"searchTextControlHandler",e=>{this.setState({modalSearch:e})}),u()(this,"saveColorPickerHandler",e=>{this.setState({modalColor:e.color})}),u()(this,"saveHoverColorPickerHandler",e=>{this.setState({modalHoverColor:e.color})}),u()(this,"onClickIconHandler",e=>{this.setState({modalIcon:e,modalLabel:k.humanizeIconLabel(e)})}),u()(this,"scrollMe",()=>{const e=this.myRef.current;null!==e&&e.scrollIntoView(!0)}),this.myRef=U.a.createRef(),this.scrollMeDebounced=Object(i.debounce)(this.scrollMe,1e3)}static getDerivedStateFromProps(e,t){return e.show!==t.modalShow?{modalShow:e.show,modalUrl:e.url,modalLabel:e.label,modalIcon:e.icon,modalIconKit:e.iconKit,modalColor:e.color,modalHoverColor:e.hoverColor,modalSearch:""}:null}componentDidUpdate(){this.scrollMeDebounced()}render(){if(!this.state.modalShow)return null;const e=Object.keys(k.filterIcons(this.state.modalSearch)).map((e,t)=>Object(s.createElement)("div",{key:t,className:m()("option-item","icon-kit",e+"-wrapper"),style:{display:this.state.modalIconKit===e?"block":"none"}},k.filterIcons(this.state.modalSearch)[e].map((t,o)=>Object(s.createElement)(N,{key:o,setRef:this.state.modalIcon===t.icon&&this.state.modalIconKit===e?this.myRef:null,color:this.state.modalColor,hoverColor:this.state.modalHoverColor,icon:t.icon,click:this.onClickIconHandler,isSelected:this.state.modalIcon===t.icon,iconKit:e}))));return Object(s.createElement)(f.Modal,{className:m()("wpzoom-social-icons-modal",this.props.className),style:{"--wpz-social-icons-block-modal-item-border-radius":k.addPixelsPipe(this.props.iconsBorderRadius)},title:Object(g.__)("Select Icon","zoom-social-icons-widget"),shouldCloseOnClickOutside:!1,onRequestClose:()=>this.props.onClose(this.state)},Object(s.createElement)("div",{className:"modal-content"},Object(s.createElement)("div",{className:"option-item"},Object(s.createElement)("div",{className:"label"},Object(g.__)("URL","zoom-social-icons-widget")),Object(s.createElement)("div",{className:"option-wrapper"},Object(s.createElement)(f.TextControl,{value:this.state.modalUrl,onChange:this.urlTextControlHandler}))),this.props.showIconsLabel?Object(s.createElement)("div",{className:"option-item"},Object(s.createElement)("div",{className:"label"},Object(g.__)("Label","zoom-social-icons-widget")),Object(s.createElement)("div",{className:"option-wrapper"},Object(s.createElement)(f.TextControl,{value:this.state.modalLabel,onChange:this.labelTextControlHandler}))):null,Object(s.createElement)("div",{className:"option-item"},Object(s.createElement)("div",{className:"label"},Object(g.__)("Pick icon color","zoom-social-icons-widget")),Object(s.createElement)("div",{className:"option-wrapper"},Object(s.createElement)(R,{save:this.saveColorPickerHandler,color:this.state.modalColor}))),Object(s.createElement)("div",{className:"option-item"},Object(s.createElement)("div",{className:"label"},Object(g.__)("Pick hover color","zoom-social-icons-widget")),Object(s.createElement)("div",{className:"option-wrapper"},Object(s.createElement)(R,{save:this.saveHoverColorPickerHandler,color:this.state.modalHoverColor}))),Object(s.createElement)("div",{className:"option-item"},Object(s.createElement)("div",{className:"label"},Object(g.__)("Select Icon Kit","zoom-social-icons-widget")),Object(s.createElement)("div",{className:"option-wrapper"},Object(s.createElement)(f.SelectControl,{value:this.state.modalIconKit,onChange:e=>{this.setState({modalIconKit:e})},options:Object.values(M)}))),Object(s.createElement)("div",{className:"option-item icon-kits-wrapper"},e)),Object(s.createElement)("div",{className:"modal-controls"},Object(s.createElement)("div",{className:"modal-search"},Object(s.createElement)(f.TextControl,{placeholder:Object(g.__)("Type to search icon","zoom-social-icons-widget"),value:this.state.modalSearch,onChange:this.searchTextControlHandler})),Object(s.createElement)("div",{className:"modal-buttons"},this.props.showDeleteBtn&&Object(s.createElement)(f.Button,{className:"button-link-delete is-button",onClick:()=>this.props.delete()},Object(g.__)("Delete Icon","zoom-social-icons-widget")),Object(s.createElement)(f.Button,{isPrimary:!0,onClick:()=>this.props.save(this.state)},Object(g.__)("Save","zoom-social-icons-widget")))))}}var T=V;class K extends s.Component{constructor(e){super(...arguments),u()(this,"state",{selectedIcons:JSON.parse(JSON.stringify(this.props.attributes.selectedIcons))}),u()(this,"setAlignment",e=>{this.props.setAttributes({iconsAlignment:e})})}static getDerivedStateFromProps(e,t){return t.selectedIcons.length!==e.attributes.selectedIcons.length?{selectedIcons:JSON.parse(JSON.stringify(e.attributes.selectedIcons))}:null}getBlockStyle(e){const t=k.getBlockStyle(e);return null===t?"with-canvas-round":t}render(){const e=[{name:Object(g.__)("Turquoise","zoom-social-icons-widget"),color:"#4ECDC4"},{name:Object(g.__)("Charcoal","zoom-social-icons-widget"),color:"#2E3131"},{name:Object(g.__)("White","zoom-social-icons-widget"),color:"#fff"},{name:Object(g.__)("Dodger blue","zoom-social-icons-widget"),color:"#22A7F0"},{name:Object(g.__)("Red","zoom-social-icons-widget"),color:"#D91E18"},{name:Object(g.__)("Orange","zoom-social-icons-widget"),color:"#F89406"}],{setAttributes:t}=this.props,o="left"===this.props.attributes.iconsAlignment,r="center"===this.props.attributes.iconsAlignment,n="right"===this.props.attributes.iconsAlignment;return Object(s.createElement)(v.InspectorControls,null,Object(s.createElement)(f.PanelBody,{title:Object(g.__)("Icon Labels Settings","zoom-social-icons-widget")},Object(s.createElement)(f.PanelRow,null,Object(s.createElement)("label",{htmlFor:"show-icon-labels"},Object(g.__)(" Show icon labels?","zoom-social-icons-widget")),Object(s.createElement)(f.FormToggle,{id:"show-icon-labels",label:Object(g.__)(" Show icon labels?","zoom-social-icons-widget"),checked:this.props.attributes.showIconsLabel,onChange:()=>{t({showIconsLabel:!this.props.attributes.showIconsLabel})}})),Object(s.createElement)(f.PanelRow,null,Object(s.createElement)("label",{htmlFor:"open-link-in-new-tab"},Object(g.__)("Open links in new tab?","zoom-social-icons-widget")),Object(s.createElement)(f.FormToggle,{id:"open-link-in-new-tab",label:Object(g.__)("Open links in new tab?","zoom-social-icons-widget"),checked:this.props.attributes.openLinkInNewTab,onChange:()=>{t({openLinkInNewTab:!this.props.attributes.openLinkInNewTab})}})),!this.props.attributes.openLinkInNewTab&&Object(s.createElement)(s.Fragment,null,Object(s.createElement)(f.PanelRow,null,Object(s.createElement)("label",{htmlFor:"add-nofollow-to-links"},Object(g.__)('Add rel="nofollow" to links',"zoom-social-icons-widget")),Object(s.createElement)(f.FormToggle,{id:"add-nofollow-to-links",label:Object(g.__)('Add rel="nofollow" to links',"zoom-social-icons-widget"),checked:this.props.attributes.nofollow,onChange:()=>{t({nofollow:!this.props.attributes.nofollow})}})),Object(s.createElement)(f.PanelRow,null,Object(s.createElement)("label",{htmlFor:"add-noreferrer-to-links"},Object(g.__)('Add rel="noreferrer" to links',"zoom-social-icons-widget")),Object(s.createElement)(f.FormToggle,{id:"add-noreferrer-to-links",label:Object(g.__)('Add rel="noreferrer" to links',"zoom-social-icons-widget"),checked:this.props.attributes.noreferrer,onChange:()=>{t({noreferrer:!this.props.attributes.noreferrer})}})),Object(s.createElement)(f.PanelRow,null,Object(s.createElement)("label",{htmlFor:"add-noopener-to-links"},Object(g.__)('Add rel="noopener" to links',"zoom-social-icons-widget")),Object(s.createElement)(f.FormToggle,{id:"add-noopener-to-links",label:Object(g.__)('Add rel="noopener" to links',"zoom-social-icons-widget"),checked:this.props.attributes.noopener,onChange:()=>{t({noopener:!this.props.attributes.noopener})}})))),Object(s.createElement)(f.PanelBody,{title:Object(g.__)("Icon Styling Settings","zoom-social-icons-widget")},this.props.attributes.iconsHasBorder?Object(s.createElement)(s.Fragment,null,Object(s.createElement)(f.PanelRow,null,Object(s.createElement)("label",{htmlFor:"icons-border-radius"},Object(g.__)("Icons Border Radius:","zoom-social-icons-widget"))),Object(s.createElement)(f.PanelRow,null,Object(s.createElement)(f.RangeControl,{id:"icons-border-radius",min:0,max:55,value:this.props.attributes.iconsBorderRadius,onChange:e=>{t({iconsBorderRadius:e})}}))):null,Object(s.createElement)(f.PanelRow,null,Object(s.createElement)("label",{htmlFor:"add-noopener-to-links"},Object(g.__)("Icons Alignment:","zoom-social-icons-widget"))),Object(s.createElement)(f.PanelRow,null,Object(s.createElement)(f.ButtonGroup,null,Object(s.createElement)(f.Button,{onClick:()=>this.setAlignment("left"),isPrimary:o,isSecondary:!o},"Left"),Object(s.createElement)(f.Button,{onClick:()=>this.setAlignment("center"),isPrimary:r,isSecondary:!r},"Center"),Object(s.createElement)(f.Button,{onClick:()=>this.setAlignment("right"),isPrimary:n,isSecondary:!n},"Right"))),Object(s.createElement)(f.PanelRow,null,Object(s.createElement)("label",{htmlFor:"icons-font-size"},Object(g.__)("Icons Font Size:","zoom-social-icons-widget"))),Object(s.createElement)(f.PanelRow,null,Object(s.createElement)(f.RangeControl,{id:"icons-font-size",min:0,max:200,value:this.props.attributes.iconsFontSize,onChange:e=>{t({iconsFontSize:e})}})),this.props.attributes.showIconsLabel?Object(s.createElement)(s.Fragment,null,Object(s.createElement)(f.PanelRow,null,Object(s.createElement)("label",{htmlFor:"icons-label-font-size"},Object(g.__)("Icons Label Font Size:","zoom-social-icons-widget"))),Object(s.createElement)(f.PanelRow,null,Object(s.createElement)(f.RangeControl,{id:"icons-label-font-size",min:0,max:200,value:this.props.attributes.iconsLabelFontSize,onChange:e=>{t({iconsLabelFontSize:e})}}))):null,Object(s.createElement)(f.PanelRow,null,Object(s.createElement)("label",{htmlFor:"icons-padding"},Object(g.__)("Icons Padding Horizontal:","zoom-social-icons-widget"))),Object(s.createElement)(f.PanelRow,null,Object(s.createElement)(f.RangeControl,{id:"icons-padding-horizontal",beforeIcon:"image-flip-horizontal",value:this.props.attributes.iconsPaddingHorizontal,onChange:e=>t({iconsPaddingHorizontal:e}),min:0,max:200})),Object(s.createElement)(f.PanelRow,null,Object(s.createElement)("label",{htmlFor:"icons-padding"},Object(g.__)("Icons Padding Vertical:","zoom-social-icons-widget"))),Object(s.createElement)(f.PanelRow,null,Object(s.createElement)(f.RangeControl,{id:"icons-padding-vertical",beforeIcon:"image-flip-vertical",value:this.props.attributes.iconsPaddingVertical,onChange:e=>t({iconsPaddingVertical:e}),min:0,max:200})),Object(s.createElement)(f.PanelRow,null,Object(s.createElement)("label",{htmlFor:"icons-margin-horizontal"},Object(g.__)("Icons Margin Horizontal:","zoom-social-icons-widget"))),Object(s.createElement)(f.PanelRow,null,Object(s.createElement)(f.RangeControl,{id:"icons-margin-horizontal",beforeIcon:"image-flip-horizontal",value:this.props.attributes.iconsMarginHorizontal,onChange:e=>t({iconsMarginHorizontal:e}),min:0,max:200})),Object(s.createElement)(f.PanelRow,null,Object(s.createElement)("label",{htmlFor:"icons-margin-vertical"},Object(g.__)("Icons Margin Vertical:","zoom-social-icons-widget"))),Object(s.createElement)(f.PanelRow,null,Object(s.createElement)(f.RangeControl,{id:"icons-margin-vertical",beforeIcon:"image-flip-vertical",value:this.props.attributes.iconsMarginVertical,onChange:e=>t({iconsMarginVertical:e}),min:0,max:200}))),Object(s.createElement)(f.PanelBody,{title:Object(g.__)("Icon Color Settings","zoom-social-icons-widget")},Object(s.createElement)(f.PanelRow,null,Object(s.createElement)("label",{htmlFor:"icon-color"},Object(g.__)("Set color for all icons","zoom-social-icons-widget")),Object(s.createElement)(f.ColorIndicator,{colorValue:this.props.attributes.iconsColor})),Object(s.createElement)(f.PanelRow,null,Object(s.createElement)(f.ColorPalette,{id:"icon-color",colors:e,value:this.props.attributes.iconsColor,onChange:e=>{const o=JSON.parse(JSON.stringify(this.props.attributes.selectedIcons));o.map((t,o)=>(t.color=void 0===e?this.state.selectedIcons[o].color:e,t)),t({iconsColor:e,selectedIcons:o})}})),Object(s.createElement)(f.PanelRow,null,Object(s.createElement)("label",{htmlFor:"icon-hover-color"},Object(g.__)("Set hover color for all icons","zoom-social-icons-widget")),Object(s.createElement)(f.ColorIndicator,{colorValue:this.props.attributes.iconsHoverColor})),Object(s.createElement)(f.PanelRow,null,Object(s.createElement)(f.ColorPalette,{id:"icon-hover-color",colors:e,value:this.props.attributes.iconsHoverColor,onChange:e=>{const o=[...this.props.attributes.selectedIcons];o.map((t,o)=>(t.hoverColor=void 0===e?this.state.selectedIcons[o].hoverColor:e,t)),t({iconsHoverColor:e,selectedIcons:o})}})),this.props.attributes.showIconsLabel?Object(s.createElement)(s.Fragment,null,Object(s.createElement)(f.PanelRow,null,Object(s.createElement)("label",{htmlFor:"icon-label-color"},Object(g.__)("Set color for all label icons","zoom-social-icons-widget")),Object(s.createElement)(f.ColorIndicator,{colorValue:this.props.attributes.iconsLabelColor})),Object(s.createElement)(f.PanelRow,null,Object(s.createElement)(f.ColorPalette,{id:"icon-label-color",colors:e,value:this.props.attributes.iconsLabelColor,onChange:e=>{t({iconsLabelColor:e})}})),Object(s.createElement)(f.PanelRow,null,Object(s.createElement)("label",{htmlFor:"icon-hover-label-color"},Object(g.__)("Set hover color for all label icons","zoom-social-icons-widget")),Object(s.createElement)(f.ColorIndicator,{colorValue:this.props.attributes.iconsLabelHoverColor})),Object(s.createElement)(f.PanelRow,null,Object(s.createElement)(f.ColorPalette,{id:"icon-hover-label-color",colors:e,value:this.props.attributes.iconsLabelHoverColor,onChange:e=>{t({iconsLabelHoverColor:e})}}))):null))}}function D({value:e,save:t}){const[o,r]=Object(s.useState)(e);return Object(s.createElement)(s.Fragment,null,Object(s.createElement)(f.TextControl,{className:"url-input",type:"text",value:o,onChange:r,onKeyDown:e=>{e.stopPropagation(),"Enter"===e.key&&t(o)},onFocus:e=>e.target.select()}),Object(s.createElement)(f.Button,{icon:"editor-break",label:Object(g.__)("Apply","zoom-social-icons-widget"),onClick:e=>{e.stopPropagation(),t(o)},className:["is-button","button-small","is-default","url-button"]}))}var X=function(e){return e.isActive&&Object(s.createElement)(f.ButtonGroup,{className:m()("sortable-arrows")},Object(s.createElement)(f.Button,{className:m()("arrow-btn"),isSmall:!0,disabled:0===e.itemKey,onClick:function(t){return e.left(t,e.itemKey)}},Object(s.createElement)(f.Icon,{icon:"arrow-left-alt2",label:"Move Left",size:14,className:m()("arrow-icon")})),Object(s.createElement)(f.Button,{className:m()("arrow-btn"),isSmall:!0,disabled:e.itemKey===e.length-1,onClick:function(t){return e.right(t,e.itemKey)}},Object(s.createElement)(f.Icon,{icon:"arrow-right-alt2",label:"Move Right",size:14,className:m()("arrow-icon")})))};class W extends s.Component{constructor(...e){super(...e),u()(this,"closeModal",()=>{this.props.setAttributes({showModal:!1})}),u()(this,"getIconsAlignmentStyle",e=>({left:"flex-start",right:"flex-end",center:"center"}[e])),u()(this,"setAlignment",e=>{this.props.setAttributes({iconsAlignment:e})}),u()(this,"saveModalHandler",e=>{const t=JSON.parse(JSON.stringify(this.props.attributes.selectedIcons)),o=t[this.props.attributes.activeIconIndex],r={url:e.modalUrl,label:e.modalLabel,icon:e.modalIcon,iconKit:e.modalIconKit,color:e.modalColor,hoverColor:e.modalHoverColor};t[this.props.attributes.activeIconIndex]={...o,...r},this.props.setAttributes({selectedIcons:t,showModal:!1})}),u()(this,"insertIcon",e=>{if(e.preventDefault(),e.stopPropagation(),0===e.detail)return;const t=this.getStyleVariations(k.getBlockStyle(this.props.className)),o={url:"https://wordpress.org",icon:"wordpress",iconKit:"socicon",color:"#444140",hoverColor:"#444140",label:"WordPress",showPopover:!0,isActive:!0};Object(i.isEmpty)(t.defaultIcon.color)||(o.color=t.defaultIcon.color),Object(i.isEmpty)(t.defaultIcon.hoverColor)||(o.hoverColor=t.defaultIcon.hoverColor);const r=JSON.parse(JSON.stringify(this.props.attributes.selectedIcons));r.map(e=>e.isActive=!1);const n=r.push(o);this.props.setAttributes({selectedIcons:r,activeIconIndex:n-1})}),u()(this,"onClickIconHandler",(e,t,o)=>{e.preventDefault();const r=JSON.parse(JSON.stringify(this.props.attributes.selectedIcons));r.map(e=>e.isActive=!1),r[t].showPopover=!0,r[t].isActive=!0,this.props.setAttributes({activeIconIndex:t,selectedIcons:r})}),u()(this,"popoverCloseHandler",e=>{const t=JSON.parse(JSON.stringify(this.props.attributes.selectedIcons));t[e].showPopover=!1,this.props.setAttributes({selectedIcons:t})}),u()(this,"deleteIconHandler",()=>{const e=JSON.parse(JSON.stringify(this.props.attributes.selectedIcons));e.splice(this.props.attributes.activeIconIndex,1),this.props.setAttributes({selectedIcons:e,showModal:!1,activeIconIndex:0})}),u()(this,"popoverDeleteIconHandler",(e,t)=>{e.stopPropagation();const o=JSON.parse(JSON.stringify(this.props.attributes.selectedIcons));o.splice(t,1),this.props.setAttributes({selectedIcons:o,activeIconIndex:0})}),u()(this,"popoverEditSettingsHandler",(e,t)=>{e.stopPropagation();const o=JSON.parse(JSON.stringify(this.props.attributes.selectedIcons));o[t].showPopover=!1,this.props.setAttributes({showModal:!0,selectedIcons:o})}),u()(this,"popoverSearchHandler",(e,t)=>{t=Object(i.isEmpty)(new d.a(t).protocol())?"https://"+t:t;const o=JSON.parse(JSON.stringify(this.props.attributes.selectedIcons)),r=k.filterUrlScheme(t);if(r){const t=k.filterIcons(r);Object(i.map)(t,(t,n)=>{Object(i.isEmpty)(t)||Object(i.filter)(t,(function(t){t.icon===r&&o[e].icon!==t.icon&&(o[e].iconKit=n,o[e].icon=t.icon,t.color&&(o[e].color=t.color,o[e].hoverColor=t.color),o[e].label=k.humanizeIconLabel(r))}))})}o[e].url=t,o[e].showPopover=!1,this.props.setAttributes({selectedIcons:o})}),u()(this,"moveLeftHandler",(e,t)=>{let o=JSON.parse(JSON.stringify(this.props.attributes.selectedIcons));o=k.arrayMove(o,t,t-1),this.props.setAttributes({selectedIcons:o,activeIconIndex:t-1})}),u()(this,"moveRightHandler",(e,t)=>{let o=JSON.parse(JSON.stringify(this.props.attributes.selectedIcons));o=k.arrayMove(o,t,t+1),this.props.setAttributes({selectedIcons:o,activeIconIndex:t+1})}),u()(this,"getRelAttr",()=>{let e=[];return this.props.attributes.nofollow&&e.push("nofollow"),this.props.attributes.noreferrer&&e.push("noreferrer"),this.props.attributes.noopener&&e.push("noopener"),this.props.attributes.openLinkInNewTab&&(e=["noopener","noreferrer"]),e})}getStyleVariations(e){const t={"with-label-canvas-rounded":{canvasType:"with-label-canvas",showIconsLabel:!0,iconsColor:!1,iconsLabelColor:"#fff",iconsHoverColor:!1,iconsLabelHoverColor:"#fff",iconsFontSize:20,iconsLabelFontSize:15,iconsPaddingHorizontal:5,iconsPaddingVertical:5,iconsMarginHorizontal:5,iconsMarginVertical:5,iconsHasBorder:!0,iconsBorderRadius:50,wasStyled:!0,defaultIcon:{icon:"facebook",color:!1,hoverColor:!1}},"with-canvas-rounded":{canvasType:"with-canvas",showIconsLabel:!1,iconsColor:!1,iconsLabelColor:"#2e3131",iconsHoverColor:!1,iconsLabelHoverColor:"#2e3131",iconsFontSize:20,iconsLabelFontSize:20,iconsPaddingHorizontal:10,iconsPaddingVertical:10,iconsMarginHorizontal:5,iconsMarginVertical:5,iconsHasBorder:!0,iconsBorderRadius:5,wasStyled:!0,defaultIcon:{icon:"facebook",color:"#1877F2",hoverColor:"#1877F2"},selectedIcons:[{icon:"facebook",color:"#1877F2",hoverColor:"#1877F2"},{icon:"twitter",color:"#1da1f2",hoverColor:"#1da1f2"},{icon:"instagram",color:"#E4405F",hoverColor:"#E4405F"}]},"with-canvas-round":{canvasType:"with-canvas",showIconsLabel:!1,iconsColor:!1,iconsLabelColor:"#2e3131",iconsHoverColor:!1,iconsLabelHoverColor:"#2e3131",iconsFontSize:20,iconsLabelFontSize:20,iconsPaddingHorizontal:10,iconsPaddingVertical:10,iconsMarginHorizontal:5,iconsMarginVertical:5,iconsHasBorder:!0,iconsBorderRadius:50,wasStyled:!0,defaultIcon:{icon:"facebook",color:"#1877F2",hoverColor:"#1877F2"},selectedIcons:[{icon:"facebook",color:"#1877F2",hoverColor:"#1877F2"},{icon:"twitter",color:"#1da1f2",hoverColor:"#1da1f2"},{icon:"instagram",color:"#E4405F",hoverColor:"#E4405F"}]},"with-canvas-squared":{canvasType:"with-canvas",showIconsLabel:!1,iconsColor:!1,iconsLabelColor:"#2e3131",iconsHoverColor:!1,iconsLabelHoverColor:"#2e3131",iconsFontSize:20,iconsLabelFontSize:20,iconsPaddingHorizontal:10,iconsPaddingVertical:10,iconsMarginHorizontal:5,iconsMarginVertical:5,iconsBorderRadius:0,iconsHasBorder:!0,wasStyled:!0,defaultIcon:{icon:"facebook",color:"#1877F2",hoverColor:"#1877F2"},selectedIcons:[{icon:"facebook",color:"#1877F2",hoverColor:"#1877F2"},{icon:"twitter",color:"#1da1f2",hoverColor:"#1da1f2"},{icon:"instagram",color:"#E4405F",hoverColor:"#E4405F"}]},"without-canvas":{canvasType:"without-canvas",showIconsLabel:!1,iconsColor:!1,iconsLabelColor:"#2e3131",iconsHoverColor:!1,iconsLabelHoverColor:"#2e3131",iconsFontSize:20,iconsLabelFontSize:20,iconsPaddingHorizontal:10,iconsPaddingVertical:10,iconsMarginHorizontal:5,iconsMarginVertical:5,iconsHasBorder:!1,wasStyled:!0,defaultIcon:{icon:"facebook",color:"#1877F2",hoverColor:"#1877F2"},selectedIcons:[{icon:"facebook",color:"#1877F2",hoverColor:"#1877F2"},{icon:"twitter",color:"#1da1f2",hoverColor:"#1da1f2"},{icon:"instagram",color:"#E4405F",hoverColor:"#E4405F"}]},"without-canvas-with-border":{canvasType:"without-canvas",showIconsLabel:!1,iconsColor:!1,iconsLabelColor:!1,iconsHoverColor:!1,iconsLabelHoverColor:!1,iconsFontSize:20,iconsLabelFontSize:20,iconsPaddingHorizontal:10,iconsPaddingVertical:10,iconsMarginHorizontal:5,iconsMarginVertical:5,iconsHasBorder:!0,iconsBorderRadius:0,wasStyled:!0,defaultIcon:{icon:"facebook",color:!1,hoverColor:!1}},"without-canvas-with-label":{canvasType:"without-canvas",showIconsLabel:!0,iconsColor:!1,iconsLabelColor:!1,iconsHoverColor:!1,iconsLabelHoverColor:!1,iconsFontSize:40,iconsLabelFontSize:15,iconsPaddingHorizontal:10,iconsPaddingVertical:10,iconsMarginHorizontal:0,iconsMarginVertical:0,iconsHasBorder:!1,wasStyled:!0,defaultIcon:{icon:"facebook",color:!1,hoverColor:!1}}};return Object(i.get)(t,e,!1)?Object(i.get)(t,e,!1):Object(i.get)(t,this.getActiveStyle())}getActiveStyle(){const{blockStyles:e}=this.props,t=k.getActiveStyle(e,this.props.className);return t&&t.name||""}componentDidUpdate(e,t){if(k.getBlockStyle(e.className)!==k.getBlockStyle(this.props.className)){const e=this.getStyleVariations(this.getActiveStyle());if(!Object(i.isEmpty)(e)){this.props.setAttributes(Object(i.omit)(e,["selectedIcons"]));const t=JSON.parse(JSON.stringify(this.props.attributes.selectedIcons));Object(i.isEmpty)(e.selectedIcons)||t.map(t=>(Object(i.isEmpty)(t.color)&&(t.color=e.defaultIcon.color),Object(i.isEmpty)(t.hoverColor)&&(t.hoverColor=e.defaultIcon.hoverColor),t)),Object(i.isEmpty)(e.iconsColor)||t.map(t=>(t.color=e.iconsColor,t)),Object(i.isEmpty)(e.iconsHoverColor)||t.map(t=>(t.hoverColor=e.iconsHoverColor,t)),this.props.setAttributes({selectedIcons:t})}}}componentDidMount(){if(!0===this.props.attributes.wasStyled)return;const e=this.getStyleVariations(this.getActiveStyle());if(!Object(i.isEmpty)(e)){e.wasStyled=!0,this.props.setAttributes(Object(i.omit)(e,["selectedIcons"]));const t=JSON.parse(JSON.stringify(this.props.attributes.selectedIcons));Object(i.isEmpty)(e.selectedIcons)||t.map(t=>{const o=Object(i.find)(e.selectedIcons,["icon",t.icon]);return t.color=Object(i.isEmpty)(o)?e.defaultIcon.color:o.color,t.hoverColor=Object(i.isEmpty)(o)?e.defaultIcon.hoverColor:o.hoverColor,t}),Object(i.isEmpty)(e.iconsColor)||t.map(t=>(t.color=e.iconsColor,t)),Object(i.isEmpty)(e.iconsHoverColor)||t.map(t=>(t.hoverColor=e.iconsHoverColor,t)),this.props.setAttributes({selectedIcons:t})}}render(){const{attributes:e,setAttributes:t,isSelected:o}=this.props;let{className:r}=this.props;null===k.getBlockStyle(r)&&(r=m()(r,"is-style-with-canvas-round"));const n=e.selectedIcons.map((r,n)=>{const i=e.showIconsLabel?Object(s.createElement)("span",{className:m()("icon-label")},r.label):"",a=this.getRelAttr();return Object(s.createElement)(s.Fragment,{key:n},Object(s.createElement)("a",{onClick:e=>this.onClickIconHandler(e,n,r),href:r.url,className:m()("social-icon-link",{selected:r.isActive}),target:e.openLinkInNewTab?"_blank":void 0,rel:a.length?a.join(" "):void 0,style:{"--wpz-social-icons-block-item-color":r.color,"--wpz-social-icons-block-item-color-hover":r.hoverColor}},Object(s.createElement)("span",{className:m()(k.getIconClassList(r.iconKit,r.icon))}),i,r.showPopover&&o&&Object(s.createElement)(f.Popover,{className:m()("wpzoom-social-icons-popover"),key:n,position:"bottom center",onClose:()=>this.popoverCloseHandler(n)},Object(s.createElement)("div",{className:m()("popover-content")},Object(s.createElement)("div",{className:m()("popover-url-wrapper")},Object(s.createElement)(D,{key:n,value:r.url,save:e=>this.popoverSearchHandler(n,e)})),Object(s.createElement)("div",{className:m()("popover-controls")},Object(s.createElement)(f.Button,{isLink:!0,onClick:e=>this.popoverEditSettingsHandler(e,n)},Object(g.__)("Edit Details","zoom-social-icons-widget")),Object(s.createElement)("div",{className:m()("popover-color-picker-wrapper")},Object(s.createElement)(R,{title:"Color",className:m()("popover-color-picker"),save:o=>{const r=[...e.selectedIcons];r[e.activeIconIndex].color=o.color,t({selectedIcons:r})},color:r.color}),Object(s.createElement)(R,{title:"Hover Color",className:m()("popover-color-picker"),save:o=>{const r=[...e.selectedIcons];r[e.activeIconIndex].hoverColor=o.color,t({selectedIcons:r})},color:r.hoverColor}),e.selectedIcons.length>1&&Object(s.createElement)(f.Button,{onClick:e=>this.popoverDeleteIconHandler(e,n),className:["is-button","button-link-delete","is-small"]},Object(g.__)("Delete Icon","zoom-social-icons-widget"))))))),Object(s.createElement)(X,{left:this.moveLeftHandler,right:this.moveRightHandler,length:e.selectedIcons.length,isActive:r.isActive&&o,itemKey:n}))});return Object(s.createElement)(s.Fragment,null,Object(s.createElement)(K,this.props),Object(s.createElement)(v.BlockControls,null,Object(s.createElement)(v.AlignmentToolbar,{value:e.iconsAlignment,onChange:e=>this.setAlignment(e)})),Object(s.createElement)("div",{className:r,style:{"--wpz-social-icons-block-item-font-size":k.addPixelsPipe(e.iconsFontSize),"--wpz-social-icons-block-item-padding-horizontal":k.addPixelsPipe(e.iconsPaddingHorizontal),"--wpz-social-icons-block-item-padding-vertical":k.addPixelsPipe(e.iconsPaddingVertical),"--wpz-social-icons-block-item-margin-horizontal":k.addPixelsPipe(e.iconsMarginHorizontal),"--wpz-social-icons-block-item-margin-vertical":k.addPixelsPipe(e.iconsMarginVertical),"--wpz-social-icons-block-item-border-radius":k.addPixelsPipe(e.iconsBorderRadius),"--wpz-social-icons-block-label-font-size":k.addPixelsPipe(e.iconsLabelFontSize),"--wpz-social-icons-block-label-color":e.iconsLabelColor,"--wpz-social-icons-block-label-color-hover":e.iconsLabelHoverColor,"--wpz-social-icons-alignment":this.getIconsAlignmentStyle(e.iconsAlignment)}},n,o&&Object(s.createElement)(f.Button,{type:"button",onClick:this.insertIcon,style:{padding:e.iconsPadding},className:"insert-icon"},Object(s.createElement)(f.Icon,{icon:"insert",size:"20"})),e.selectedIcons[e.activeIconIndex]&&Object(s.createElement)(T,{className:m()(k.getBlockStyle(r)),showIconsLabel:e.showIconsLabel,iconsBorderRadius:e.iconsBorderRadius,show:e.showModal,url:e.selectedIcons[e.activeIconIndex].url,label:e.selectedIcons[e.activeIconIndex].label,icon:e.selectedIcons[e.activeIconIndex].icon,iconKit:e.selectedIcons[e.activeIconIndex].iconKit,color:e.selectedIcons[e.activeIconIndex].color,hoverColor:e.selectedIcons[e.activeIconIndex].hoverColor,save:this.saveModalHandler,delete:this.deleteIconHandler,showDeleteBtn:e.selectedIcons.length>1,onClose:this.closeModal})))}}const Z=Object(b.withSelect)((e,t)=>{const{getBlockStyles:o}=e("core/blocks");return{blockStyles:o(t.name)}});var q=Object(w.compose)(Z)(W);class Y extends s.Component{constructor(e){super(...arguments),u()(this,"getIconsAlignmentStyle",e=>({left:"flex-start",right:"flex-end",center:"center"}[e])),u()(this,"getRelAttr",()=>{let e=[];return this.props.attributes.nofollow&&e.push("nofollow"),this.props.attributes.noreferrer&&e.push("noreferrer"),this.props.attributes.noopener&&e.push("noopener"),this.props.attributes.openLinkInNewTab&&(e=["noopener","noreferrer"]),e})}render(){const{attributes:e}=this.props;let{className:t}=e;null==k.getBlockStyle(t)&&(t=m()(t,"is-style-with-canvas-round"));const o=e.selectedIcons.map((t,o)=>{const r=e.showIconsLabel?Object(s.createElement)("span",{className:m()("icon-label")},t.label):"",n=this.getRelAttr();return Object(s.createElement)("a",{key:o,href:t.url,className:"social-icon-link",target:e.openLinkInNewTab?"_blank":void 0,rel:n.length?n.join(" "):void 0,style:{"--wpz-social-icons-block-item-color":t.color,"--wpz-social-icons-block-item-color-hover":t.hoverColor}},Object(s.createElement)("span",{className:m()(k.getIconClassList(t.iconKit,t.icon))}),r)});return Object(s.createElement)("div",{className:t,style:{"--wpz-social-icons-block-item-font-size":k.addPixelsPipe(e.iconsFontSize),"--wpz-social-icons-block-item-padding-horizontal":k.addPixelsPipe(e.iconsPaddingHorizontal),"--wpz-social-icons-block-item-padding-vertical":k.addPixelsPipe(e.iconsPaddingVertical),"--wpz-social-icons-block-item-margin-horizontal":k.addPixelsPipe(e.iconsMarginHorizontal),"--wpz-social-icons-block-item-margin-vertical":k.addPixelsPipe(e.iconsMarginVertical),"--wpz-social-icons-block-item-border-radius":k.addPixelsPipe(e.iconsBorderRadius),"--wpz-social-icons-block-label-font-size":k.addPixelsPipe(e.iconsLabelFontSize),"--wpz-social-icons-block-label-color":e.iconsLabelColor,"--wpz-social-icons-block-label-color-hover":e.iconsLabelHoverColor,"--wpz-social-icons-alignment":this.getIconsAlignmentStyle(e.iconsAlignment)}},o)}}var J=Y,G=o(6),$=o(9),ee=o(15),te=o(26);const oe={},re=({replacementData:e,isConvertRun:t})=>{const[o,r]=Object(s.useState)(!1);return t&&!o?(function(e){return new Promise((function(t){let o=0;Object(i.map)(e,r=>{const{clientId:n,attributes:a}=r,{title:c,description:l,iconsAlignment:u}=a,{rootClientId:p}=Object(b.useSelect)(e=>({rootClientId:e("core/block-editor").getBlockRootClientId(n)})),d=[Object(G.createBlock)("core/heading",{content:c,level:3,placeholder:Object(g.__)("Title","zoom-social-icons-widget"),className:"zoom-social-icons-legacy-widget-title widget-title title heading-size-3"}),Object(G.createBlock)("core/paragraph",{content:l,placeholder:Object(g.__)("Text above icons","zoom-social-icons-widget"),className:m()("zoom-social-icons-legacy-widget-description",{["zoom-social-icons-list--align-"+u]:void 0!==u&&"none"!==u})}),Object(G.createBlock)("wpzoom-blocks/social-icons",a)],[h]=function({rootClientId:e="",insertionIndex:t,clientId:o,shouldFocusBlock:r=!0}){const{sidebar:n,destinationRootClientId:a,destinationIndex:c}=Object(b.useSelect)(r=>{const{getBlockIndex:n,getBlockOrder:s,getBlock:i}=r("core/block-editor"),a=e;let c;return c=void 0!==t?t:o?n(o,a):""!==a?n(e):s(a).length,{sidebar:i(a),destinationRootClientId:a,destinationIndex:c}},[e,t,o]),{replaceBlock:l}=Object(b.useDispatch)("core/block-editor");return[Object(s.useCallback)((e,t,s=!1)=>{const{attributes:{name:a}}=n;l(o,e,c,r||s?0:null,t);const u=Object(g.sprintf)(// translators: %d: the name of the block that has been added %s: sidebar name.
|
2 |
+
Object(g._n)("%1$d group block added in the sidebar: %2$s.","%1$d group blocks added in the sidebar: %2$s.",Object(i.castArray)(e).length),Object(i.castArray)(e).length,a);Object(te.speak)(u)},[l,n,o,a,c,r]),c]}({rootClientId:p,clientId:n});if(h(Object(G.createBlock)("core/group",{tagName:"div",className:"zoom-social-icons-widget zoom-social-icons-legacy-widget-group",layout:{inherit:!0}},d)),o++,Object(i.size)(e)===o){const e=Object(g.sprintf)(// translators: %d: the number of the block that has been converted
|
3 |
+
Object(g._n)('%d legacy widget "Social Icons" successfully converted to block','%d legacy widgets "Social Icons" successfully converted to block',o,"zoom-social-icons-widget"),o);t(e)}})}))}(e).then(e=>{r(!0),Object($.doAction)("converter.isConvertDone",{message:e})}),null):Object(s.createElement)(f.Placeholder,null,Object(s.createElement)(f.Spinner,null))};var ne=Object(s.memo)(({clientId:e,attributes:t,widgetId:o})=>{const[r,n]=Object(s.useState)(!1),{createInfoNotice:i,createWarningNotice:a,createSuccessNotice:c}=Object(b.useDispatch)("core/notices");oe[o]={},oe[o].clientId=e,oe[o].attributes=t;const l=Object(g.__)('Legacy Social Icons Widget has been detected on this page. Since our plugin includes a Social Icons Block, supported by WordPress 5.8, we highly recommend transforming legacy widgets to blocks. You can do that by clicking on the "Convert to block" button. You can also disable the new block-based widget screen by installing the Classic Widgets plugin.',"zoom-social-icons-widget");return Object(s.useEffect)(()=>{a(l,{id:"wpzoom-social-icons-notice",isDismissible:!0,actions:[{url:Object(ee.addQueryArgs)("customize.php",{"autofocus[panel]":"widgets",return:window.location.pathname}),label:Object(g.__)("Manage in Customizer","zoom-social-icons-widget")},{url:Object(ee.addQueryArgs)("plugin-install.php",{s:"classic%20widgets",tab:"search",type:"term"}),label:"Install Classic Widgets"},{label:Object(g.__)("Convert to block","zoom-social-icons-widget"),onClick:()=>n(!r)}]})},[a,r]),Object(s.useEffect)(()=>{r&&i(Object(g.__)("Convert process is started. Please wait…","zoom-social-icons-widget"),{type:"snackbar",id:"wpzoom-social-icons-notice"})},[r,i]),Object($.addAction)("converter.isConvertDone","wpzoom-blocks/social-icons/convert-legacy-widget",({message:e})=>{c(e,{type:"snackbar",id:"wpzoom-social-icons-notice"})}),e&&r?Object(s.createElement)(s.Fragment,null,Object(s.createElement)(re,{replacementData:oe,isConvertRun:r})):null}),se=function(e){const t=Object(G.getBlockTypes)().filter(e=>-1!==e.name.indexOf("wpzoom-blocks/social-icons"))[0],{attributes:o}=t,r=Object(i.mapValues)(o,e=>e.default),n={wasStyled:!0,canvasType:e.icon_style,showIconsLabel:"true"===e.show_icon_labels,openLinkInNewTab:"true"===e.open_new_tab,nofollow:"true"===e.no_follow,noreferrer:"true"===e.no_referrer,noopener:"true"===e.no_opener,iconsAlignment:e.icon_alignment,iconsColor:e.global_color_picker,iconsHoverColor:e.global_color_picker_hover,iconsLabelHoverColor:"inherit",iconsFontSize:e.icon_font_size,iconsPaddingVertical:e.icon_padding_size,iconsPaddingHorizontal:e.icon_padding_size,iconsBackgroundStyle:e.icon_canvas_style||"round",selectedIcons:e.fields.map(e=>function(e){return{url:e.url,icon:e.icon,iconKit:e.icon_kit,color:e.color_picker,hoverColor:e.color_picker_hover,label:e.label,showPopover:!1,isActive:!1}}(e)),title:e.title,description:e.description},s=Object(i.assign)(r,n);"rounded"===s.iconsBackgroundStyle?s.iconsBorderRadius=3:"round"===s.iconsBackgroundStyle?s.iconsBorderRadius=50:s.iconsBorderRadius=0,"without-canvas"===s.canvasType?s.className="is-style-"+s.canvasType:"with-canvas"===s.canvasType&&(s.className="is-style-with-canvas-round");const a=[{name:"without-canvas",label:"Color Icon / No Background",isDefault:"without-canvas"===s.canvasType},{name:"with-canvas-round",label:"Color Background / Round White Icon",isDefault:"with-canvas"===s.canvasType}];for(let e=0;e<a.length;e++){const t=a[e];Object(G.unregisterBlockStyle)("wpzoom-blocks/social-icons",t.name),Object(G.registerBlockStyle)("wpzoom-blocks/social-icons",t)}return s};const ie=document.getElementById("customize-theme-controls"),ae=Object(w.createHigherOrderComponent)(e=>t=>{const{attributes:o,name:r}=t,{id:i,idBase:a,instance:c,__internalWidgetId:l}=o,u=null!=i?i:a;if("core/legacy-widget"===r&&"zoom-social-icons-widget"===u){const{widgetType:o,hasResolvedWidgetType:r}=Object(b.useSelect)(e=>({widgetType:e("core").getWidgetType(u),hasResolvedWidgetType:e("core").hasFinishedResolution("getWidgetType",[u])}),[i,a]),p=se(c.raw);return Object(s.createElement)(s.Fragment,null,Object(s.createElement)(e,t),o&&r&&Object(s.createElement)(ne,n()({},t,{attributes:p,widgetId:l})))}return Object(s.createElement)(s.Fragment,null,Object(s.createElement)(e,t))},"withGroupedBlock");Object($.addFilter)("blocks.registerBlockType","wpzoom-blocks/social-icons/class-names/heading-paragraph-block",(function(e,t){return"core/heading"!==t||"core/paragraph"!==t?e:Object(i.assign)({},e,{supports:Object(i.assign)({},e.supports,{className:!0})})})),Object($.addFilter)("blocks.getBlockAttributes","wpzoom-blocks/social-icons",(function(e){if(void 0!==e.selectedIcons){const t=[...e.selectedIcons];t.map(e=>(e.isActive=!1,e)),e.selectedIcons=t,e.showModal=!1}return e})),ie||Object($.addFilter)("editor.BlockEdit","wpzoom-blocks/social-icons/wrap-group-blocks",ae),Object(G.registerBlockType)("wpzoom-blocks/social-icons",{title:Object(g.__)("Social Icons Block","zoom-social-icons-widget"),description:Object(g.__)("Display icons with links to social media platforms.","zoom-social-icons-widget"),icon:{foreground:"#274474",src:c},example:{attributes:{cover:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQoAAAD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f8DAD8xcfX+GGoAAAAASUVORK5CYII=",author:"WPZOOM"}},category:"wpzoom-blocks",keywords:[Object(g.__)("Social Icons","zoom-social-icons-widget"),Object(g.__)("Dashicons","zoom-social-icons-widget"),Object(g.__)("Socicons","zoom-social-icons-widget"),Object(g.__)("Fontawesome","zoom-social-icons-widget"),Object(g.__)("Academic Icons","zoom-social-icons-widget")],attributes:{wasStyled:{type:"boolean",default:!1},canvasType:{type:"string",default:"with-canvas"},showIconsLabel:{type:"boolean",default:!1},showModal:{type:"boolean",default:!1},openLinkInNewTab:{type:"boolean",default:!1},nofollow:{type:"boolean",default:!1},noreferrer:{type:"boolean",default:!1},noopener:{type:"boolean",default:!1},iconsAlignment:{type:"string",default:"left"},iconsColor:{type:"string",default:"#f1f1f1"},iconsLabelColor:{type:"string",default:"inherit"},iconsHoverColor:{type:"string",default:"#f1f1f1"},iconsLabelHoverColor:{type:"string",default:"#f1f1f1"},iconsFontSize:{type:"number",default:20},iconsLabelFontSize:{type:"number",default:20},iconsPaddingVertical:{type:"number",default:10},iconsPaddingHorizontal:{type:"number",default:10},iconsMarginVertical:{type:"number",default:5},iconsMarginHorizontal:{type:"number",default:5},iconsBorderRadius:{type:"number",default:0},iconsBackgroundStyle:{type:"string",default:"round"},iconsHasBorder:{type:"boolean",default:!1},activeIconIndex:{type:"integer",default:0},defaultIcon:{type:"object",default:{icon:"facebook",color:"#f89406",hoverColor:"#f89406"}},selectedIcons:{type:"array",default:[{url:"https://facebook.com",icon:"facebook",iconKit:"socicon",color:"#3b5998",hoverColor:"#3b5998",label:"Facebook",showPopover:!1,isActive:!1},{url:"https://twitter.com",icon:"twitter",iconKit:"socicon",color:"#1da1f2",hoverColor:"#1da1f2",label:"Twitter",showPopover:!1,isActive:!1},{url:"https://instagram.com",icon:"instagram",iconKit:"socicon",color:"#E44060",hoverColor:"#E44060",label:"Instagram",showPopover:!1,isActive:!1}]}},styles:[{name:"with-canvas-round",label:Object(g.__)("Color Background / Round White Icon","zoom-social-icons-widget"),isDefault:!0},{name:"with-canvas-rounded",label:Object(g.__)("Color Background / Rounded White Icon","zoom-social-icons-widget")},{name:"with-canvas-squared",label:Object(g.__)("Color Background / Squared White Icon","zoom-social-icons-widget")},{name:"without-canvas",label:Object(g.__)("Color Icon / No Background","zoom-social-icons-widget")},{name:"without-canvas-with-border",label:Object(g.__)("Color Icon / No Background with border","zoom-social-icons-widget")},{name:"with-label-canvas-rounded",label:Object(g.__)("Color Background / Rounded White Icon with label","zoom-social-icons-widget")},{name:"without-canvas-with-label",label:Object(g.__)("Color Icon / No Background with label","zoom-social-icons-widget")}],transforms:{from:[{type:"block",blocks:["core/legacy-widget"],transform:({instance:e})=>Object(G.createBlock)("wpzoom-blocks/social-icons",se(e.raw))}]},edit:q,save:J});var ce=Object(s.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 64 1024 1024"},Object(s.createElement)(a.Path,{fill:"#08618a",transform:"scale(1,-1) translate(0,-1024)",d:"M581.456 542.931h-31.41v-102.1c6.669-0.4 12.537-0.867 31.877-0.867 35.745 0 57.085 21.207 57.085 54.018 0 29.009-23.541 48.949-57.552 48.949zM512.033 956.666c-280.958 0-508.699-227.741-508.699-508.699s227.741-508.699 508.699-508.699 508.699 227.741 508.699 508.699-227.807 508.699-508.699 508.699zM450.013 542.931h-32.010l-74.358-240.078h-26.475l-73.957 170.189-74.358-170.189h-26.475l-75.625 240.078h-30.21v40.013h120.039v-40.013h-38.146l44.948-146.448 68.489 159.785h25.208l68.489-159.785 42.014 146.448h-37.612v40.013h120.039v-40.013zM577.721 398.417c-13.004 0-21.007 0-27.676 0.4v-49.283h33.344v-40.013h-113.37v40.013h33.344v193.396h-33.344v40.013h113.97c59.219 0 104.234-33.878 104.234-90.163-0.067-63.487-45.415-94.364-110.503-94.364zM925.101 309.522h-213.003l-4.201 25.342 202.066 208.068h-105.901l-10.537-46.682h-43.281l20.14 86.695h206.734l4.201-25.342-202.066-208.068h112.17l10.537 46.682h43.281l-20.14-86.695z"}));Object(G.updateCategory)("wpzoom-blocks",{icon:ce})}]);
|
block/src/init.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* Enqueue CSS/JS of all the blocks.
|
6 |
*
|
7 |
* @since 1.0.0
|
8 |
-
* @package
|
9 |
*/
|
10 |
|
11 |
// Exit if accessed directly.
|
@@ -28,8 +28,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
28 |
* @since 1.0.0
|
29 |
*/
|
30 |
function wpzoom_social_icons_block_enqueue_assets() {
|
31 |
-
|
32 |
-
$asset_file = wpzoom_social_icons_get_asset_file('block/dist/style-wpzoom-social-icons');
|
33 |
|
34 |
wp_register_style(
|
35 |
'wpzoom-social-icons-block-style',
|
@@ -38,7 +37,7 @@ function wpzoom_social_icons_block_enqueue_assets() {
|
|
38 |
$asset_file['version']
|
39 |
);
|
40 |
|
41 |
-
$asset_file = wpzoom_social_icons_get_asset_file('block/dist/wpzoom-social-icons');
|
42 |
|
43 |
// Register block editor script for backend.
|
44 |
wp_register_script(
|
@@ -49,7 +48,6 @@ function wpzoom_social_icons_block_enqueue_assets() {
|
|
49 |
true
|
50 |
);
|
51 |
|
52 |
-
|
53 |
// Register block editor styles for backend.
|
54 |
wp_register_style(
|
55 |
'wpzoom-social-icons-block-editor',
|
@@ -58,16 +56,16 @@ function wpzoom_social_icons_block_enqueue_assets() {
|
|
58 |
$asset_file['version']
|
59 |
);
|
60 |
|
61 |
-
// WP Localized globals.
|
62 |
wp_localize_script(
|
63 |
'wpzoom-social-icons-block-js',
|
64 |
'wpzSocialIconsBlock',
|
65 |
-
|
66 |
-
'pluginDirPath'
|
67 |
-
'pluginDirUrl'
|
68 |
-
'icons'
|
69 |
-
'iconKitsCategories' => zoom_social_icons_kits_categories_list('block')
|
70 |
-
|
71 |
);
|
72 |
|
73 |
/**
|
@@ -80,16 +78,19 @@ function wpzoom_social_icons_block_enqueue_assets() {
|
|
80 |
* @link https://wordpress.org/gutenberg/handbook/blocks/writing-your-first-block-type#enqueuing-block-scripts
|
81 |
* @since 1.16.0
|
82 |
*/
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
|
|
|
|
|
|
93 |
}
|
94 |
|
95 |
// Hook: Block assets.
|
@@ -99,8 +100,11 @@ add_action( 'init', 'wpzoom_social_icons_block_enqueue_assets' );
|
|
99 |
* Add custom block category
|
100 |
*
|
101 |
* @since 1.0.0
|
|
|
|
|
|
|
102 |
*/
|
103 |
-
function wpzoom_social_icons_block_add_custom_category( $categories
|
104 |
return array_merge(
|
105 |
$categories,
|
106 |
array(
|
@@ -112,13 +116,20 @@ function wpzoom_social_icons_block_add_custom_category( $categories, $post ) {
|
|
112 |
);
|
113 |
}
|
114 |
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
121 |
}
|
|
|
122 |
|
123 |
/**
|
124 |
* Register css and js files.
|
@@ -164,26 +175,32 @@ function wpzoom_social_icons_block_register_secondary_assets() {
|
|
164 |
array(),
|
165 |
filemtime( WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/css/genericons.css' )
|
166 |
);
|
167 |
-
|
168 |
}
|
169 |
|
170 |
add_action( 'wp_enqueue_scripts', 'wpzoom_social_icons_block_register_secondary_assets' );
|
171 |
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
177 |
$content = get_post_field( 'post_content', $id );
|
178 |
-
$blocks
|
179 |
|
180 |
if ( ! is_array( $blocks ) || empty( $blocks ) ) {
|
181 |
return false;
|
182 |
}
|
183 |
|
184 |
foreach ( $blocks as $block ) {
|
185 |
-
if ( $block['blockName']
|
186 |
-
if( has_block( $block_name, $block['attrs']['ref'] ) ){
|
187 |
return true;
|
188 |
}
|
189 |
}
|
@@ -198,28 +215,26 @@ function wpzoom_has_reusable_block( $block_name, $id = false ){
|
|
198 |
* Enqueue css and js files.
|
199 |
*/
|
200 |
function wpzoom_social_icons_block_enqueue_secondary_assets() {
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
|
|
|
|
205 |
|
206 |
/**
|
207 |
* Enqueue dashicons.css
|
208 |
*/
|
209 |
|
210 |
-
if ( !empty(
|
211 |
-
|
212 |
wp_enqueue_style( 'dashicons' );
|
213 |
-
|
214 |
}
|
215 |
|
216 |
-
|
217 |
/**
|
218 |
* Enqueue academicons.css
|
219 |
*/
|
220 |
|
221 |
-
if ( !empty(
|
222 |
-
|
223 |
wp_enqueue_style(
|
224 |
'wpzoom-social-icons-academicons',
|
225 |
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/css/academicons.min.css',
|
@@ -230,8 +245,7 @@ function wpzoom_social_icons_block_enqueue_secondary_assets() {
|
|
230 |
/**
|
231 |
* Enqueue socicons.css
|
232 |
*/
|
233 |
-
if ( !empty(
|
234 |
-
|
235 |
wp_enqueue_style(
|
236 |
'wpzoom-social-icons-socicon',
|
237 |
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/css/wpzoom-socicon.css',
|
@@ -243,8 +257,7 @@ function wpzoom_social_icons_block_enqueue_secondary_assets() {
|
|
243 |
/**
|
244 |
* Enqueue font-awesome.css
|
245 |
*/
|
246 |
-
if ( !empty(
|
247 |
-
|
248 |
wp_enqueue_style(
|
249 |
'wpzoom-social-icons-font-awesome-5',
|
250 |
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/css/font-awesome-5.min.css',
|
@@ -256,8 +269,7 @@ function wpzoom_social_icons_block_enqueue_secondary_assets() {
|
|
256 |
/**
|
257 |
* Enqueue genericons.css
|
258 |
*/
|
259 |
-
if ( !empty(
|
260 |
-
|
261 |
wp_enqueue_style(
|
262 |
'wpzoom-social-icons-genericons',
|
263 |
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/css/genericons.css',
|
@@ -270,22 +282,24 @@ function wpzoom_social_icons_block_enqueue_secondary_assets() {
|
|
270 |
|
271 |
add_action( 'enqueue_block_assets', 'wpzoom_social_icons_block_enqueue_secondary_assets' );
|
272 |
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
|
|
|
|
291 |
}
|
5 |
* Enqueue CSS/JS of all the blocks.
|
6 |
*
|
7 |
* @since 1.0.0
|
8 |
+
* @package WPZOOM_Social_Icons
|
9 |
*/
|
10 |
|
11 |
// Exit if accessed directly.
|
28 |
* @since 1.0.0
|
29 |
*/
|
30 |
function wpzoom_social_icons_block_enqueue_assets() {
|
31 |
+
$asset_file = wpzoom_social_icons_get_asset_file( 'block/dist/style-wpzoom-social-icons' );
|
|
|
32 |
|
33 |
wp_register_style(
|
34 |
'wpzoom-social-icons-block-style',
|
37 |
$asset_file['version']
|
38 |
);
|
39 |
|
40 |
+
$asset_file = wpzoom_social_icons_get_asset_file( 'block/dist/wpzoom-social-icons' );
|
41 |
|
42 |
// Register block editor script for backend.
|
43 |
wp_register_script(
|
48 |
true
|
49 |
);
|
50 |
|
|
|
51 |
// Register block editor styles for backend.
|
52 |
wp_register_style(
|
53 |
'wpzoom-social-icons-block-editor',
|
56 |
$asset_file['version']
|
57 |
);
|
58 |
|
59 |
+
// WP Localized globals.
|
60 |
wp_localize_script(
|
61 |
'wpzoom-social-icons-block-js',
|
62 |
'wpzSocialIconsBlock',
|
63 |
+
array(
|
64 |
+
'pluginDirPath' => plugin_dir_path( __DIR__ ),
|
65 |
+
'pluginDirUrl' => plugin_dir_url( __DIR__ ),
|
66 |
+
'icons' => include WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'includes/icons-data.php',
|
67 |
+
'iconKitsCategories' => zoom_social_icons_kits_categories_list( 'block' ),
|
68 |
+
)
|
69 |
);
|
70 |
|
71 |
/**
|
78 |
* @link https://wordpress.org/gutenberg/handbook/blocks/writing-your-first-block-type#enqueuing-block-scripts
|
79 |
* @since 1.16.0
|
80 |
*/
|
81 |
+
if ( ! WP_Block_Type_Registry::get_instance()->is_registered( 'wpzoom-blocks/social-icons' ) ) {
|
82 |
+
register_block_type(
|
83 |
+
'wpzoom-blocks/social-icons',
|
84 |
+
array(
|
85 |
+
// Enqueue style-wpzoom-social-icons.css on both frontend & backend.
|
86 |
+
'style' => 'wpzoom-social-icons-block-style',
|
87 |
+
// Enqueue wpzoom-social-icons.js in the editor only.
|
88 |
+
'editor_script' => 'wpzoom-social-icons-block-js',
|
89 |
+
// Enqueue wpzoom-social-icons.css in the editor only.
|
90 |
+
'editor_style' => 'wpzoom-social-icons-block-editor',
|
91 |
+
)
|
92 |
+
);
|
93 |
+
}
|
94 |
}
|
95 |
|
96 |
// Hook: Block assets.
|
100 |
* Add custom block category
|
101 |
*
|
102 |
* @since 1.0.0
|
103 |
+
*
|
104 |
+
* @param array $categories Array of categories for block types.
|
105 |
+
* @return array Filters the default array of categories for block types.
|
106 |
*/
|
107 |
+
function wpzoom_social_icons_block_add_custom_category( $categories ) {
|
108 |
return array_merge(
|
109 |
$categories,
|
110 |
array(
|
116 |
);
|
117 |
}
|
118 |
|
119 |
+
/**
|
120 |
+
* Use hook for block categories depending by WordPress version.
|
121 |
+
*
|
122 |
+
* @return void
|
123 |
+
*/
|
124 |
+
function wpzoom_social_icons_block_categories() {
|
125 |
+
global $wp_version;
|
126 |
+
if ( version_compare( $wp_version, '5.8', '<' ) ) {
|
127 |
+
add_filter( 'block_categories', 'wpzoom_social_icons_block_add_custom_category', 10, 2 );
|
128 |
+
} else {
|
129 |
+
add_filter( 'block_categories_all', 'wpzoom_social_icons_block_add_custom_category', 10, 2 );
|
130 |
+
}
|
131 |
}
|
132 |
+
wpzoom_social_icons_block_categories();
|
133 |
|
134 |
/**
|
135 |
* Register css and js files.
|
175 |
array(),
|
176 |
filemtime( WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/css/genericons.css' )
|
177 |
);
|
|
|
178 |
}
|
179 |
|
180 |
add_action( 'wp_enqueue_scripts', 'wpzoom_social_icons_block_register_secondary_assets' );
|
181 |
|
182 |
+
/**
|
183 |
+
* Check has reusable block
|
184 |
+
*
|
185 |
+
* @param string $block_name The block name.
|
186 |
+
* @param int $id The post id.
|
187 |
+
* @return boolean
|
188 |
+
*/
|
189 |
+
function wpzoom_has_reusable_block( $block_name, $id = 0 ) {
|
190 |
+
$id = ( ! $id ) ? get_the_ID() : $id;
|
191 |
+
if ( $id ) {
|
192 |
+
if ( has_block( 'block', $id ) ) {
|
193 |
+
// Check reusable blocks.
|
194 |
$content = get_post_field( 'post_content', $id );
|
195 |
+
$blocks = parse_blocks( $content );
|
196 |
|
197 |
if ( ! is_array( $blocks ) || empty( $blocks ) ) {
|
198 |
return false;
|
199 |
}
|
200 |
|
201 |
foreach ( $blocks as $block ) {
|
202 |
+
if ( 'core/block' === $block['blockName'] && ! empty( $block['attrs']['ref'] ) ) {
|
203 |
+
if ( has_block( $block_name, $block['attrs']['ref'] ) ) {
|
204 |
return true;
|
205 |
}
|
206 |
}
|
215 |
* Enqueue css and js files.
|
216 |
*/
|
217 |
function wpzoom_social_icons_block_enqueue_secondary_assets() {
|
218 |
+
if ( wpzoom_has_reusable_block( 'wpzoom-blocks/social-icons' ) || has_block( 'wpzoom-blocks/social-icons' ) || is_admin() ) {
|
219 |
+
$disable_css_loading_socicons = WPZOOM_Social_Icons_Settings::get_option_key( 'disable-css-loading-for-socicons' );
|
220 |
+
$disable_css_loading_genericons = WPZOOM_Social_Icons_Settings::get_option_key( 'disable-css-loading-for-genericons' );
|
221 |
+
$disable_css_loading_academicons = WPZOOM_Social_Icons_Settings::get_option_key( 'disable-css-loading-for-academicons' );
|
222 |
+
$disable_css_loading_fa5 = WPZOOM_Social_Icons_Settings::get_option_key( 'disable-css-loading-for-font-awesome-5' );
|
223 |
+
$disable_css_loading_dashicons = WPZOOM_Social_Icons_Settings::get_option_key( 'disable-css-loading-for-dashicons' );
|
224 |
|
225 |
/**
|
226 |
* Enqueue dashicons.css
|
227 |
*/
|
228 |
|
229 |
+
if ( ! empty( $disable_css_loading_dashicons ) ) {
|
|
|
230 |
wp_enqueue_style( 'dashicons' );
|
|
|
231 |
}
|
232 |
|
|
|
233 |
/**
|
234 |
* Enqueue academicons.css
|
235 |
*/
|
236 |
|
237 |
+
if ( ! empty( $disable_css_loading_academicons ) ) {
|
|
|
238 |
wp_enqueue_style(
|
239 |
'wpzoom-social-icons-academicons',
|
240 |
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/css/academicons.min.css',
|
245 |
/**
|
246 |
* Enqueue socicons.css
|
247 |
*/
|
248 |
+
if ( ! empty( $disable_css_loading_socicons ) ) {
|
|
|
249 |
wp_enqueue_style(
|
250 |
'wpzoom-social-icons-socicon',
|
251 |
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/css/wpzoom-socicon.css',
|
257 |
/**
|
258 |
* Enqueue font-awesome.css
|
259 |
*/
|
260 |
+
if ( ! empty( $disable_css_loading_fa5 ) ) {
|
|
|
261 |
wp_enqueue_style(
|
262 |
'wpzoom-social-icons-font-awesome-5',
|
263 |
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/css/font-awesome-5.min.css',
|
269 |
/**
|
270 |
* Enqueue genericons.css
|
271 |
*/
|
272 |
+
if ( ! empty( $disable_css_loading_genericons ) ) {
|
|
|
273 |
wp_enqueue_style(
|
274 |
'wpzoom-social-icons-genericons',
|
275 |
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/css/genericons.css',
|
282 |
|
283 |
add_action( 'enqueue_block_assets', 'wpzoom_social_icons_block_enqueue_secondary_assets' );
|
284 |
|
285 |
+
if ( ! function_exists( 'wpzoom_social_icons_get_asset_file' ) ) {
|
286 |
+
/**
|
287 |
+
* Loads the asset file for the given script or style.
|
288 |
+
* Returns a default if the asset file is not found.
|
289 |
+
*
|
290 |
+
* @since 4.2.0
|
291 |
+
* @param string $filepath The name of the file without the extension.
|
292 |
+
*
|
293 |
+
* @return array The asset file contents.
|
294 |
+
*/
|
295 |
+
function wpzoom_social_icons_get_asset_file( $filepath ) {
|
296 |
+
$asset_path = WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . $filepath . '.asset.php';
|
297 |
+
|
298 |
+
return file_exists( $asset_path )
|
299 |
+
? include $asset_path
|
300 |
+
: array(
|
301 |
+
'dependencies' => array(),
|
302 |
+
'version' => WPZOOM_SOCIAL_ICONS_PLUGIN_VERSION,
|
303 |
+
);
|
304 |
+
}
|
305 |
}
|
class.zoom-social-icons-settings.php
DELETED
@@ -1,701 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
// Exit if accessed directly.
|
3 |
-
if ( ! defined( 'ABSPATH' ) ) {
|
4 |
-
exit;
|
5 |
-
}
|
6 |
-
|
7 |
-
|
8 |
-
class WPZOOM_Social_Icons_Settings {
|
9 |
-
public static $option_name = 'wpzoom-social-icons-widget-settings';
|
10 |
-
|
11 |
-
public static $menu_slug = 'wpzoom-social-icons-widget';
|
12 |
-
public static $option_defaults = [
|
13 |
-
'disable-widget' => false,
|
14 |
-
'disable-block' => false,
|
15 |
-
'disable-fonts-preloading' => true,
|
16 |
-
'disable-css-loading-for-academicons' => true,
|
17 |
-
'disable-css-loading-for-font-awesome-3' => true,
|
18 |
-
'disable-css-loading-for-font-awesome-5' => true,
|
19 |
-
'disable-css-loading-for-genericons' => true,
|
20 |
-
'disable-css-loading-for-dashicons' => true,
|
21 |
-
'disable-css-loading-for-socicons' => true,
|
22 |
-
'categories-sync' => true
|
23 |
-
];
|
24 |
-
/**
|
25 |
-
* Holds the values to be used in the fields callbacks
|
26 |
-
*/
|
27 |
-
private $options;
|
28 |
-
|
29 |
-
/**
|
30 |
-
* Start up
|
31 |
-
*/
|
32 |
-
public function __construct() {
|
33 |
-
add_action( 'admin_menu', [ $this, 'add_plugin_page' ] );
|
34 |
-
add_action( 'admin_init', [ $this, 'page_init' ] );
|
35 |
-
add_action( 'admin_enqueue_scripts', [ $this, 'enqueue' ] );
|
36 |
-
|
37 |
-
}
|
38 |
-
|
39 |
-
static public function get_settings_for_icons_kits() {
|
40 |
-
return [
|
41 |
-
'socicon' => self::get_option_key( 'disable-css-loading-for-socicons' ),
|
42 |
-
'dashicons' => self::get_option_key( 'disable-css-loading-for-dashicons' ),
|
43 |
-
'genericon' => self::get_option_key( 'disable-css-loading-for-genericons' ),
|
44 |
-
'academicons' => self::get_option_key( 'disable-css-loading-for-academicons' ),
|
45 |
-
'fab' => self::get_option_key( 'disable-css-loading-for-font-awesome-5' ),
|
46 |
-
'far' => self::get_option_key( 'disable-css-loading-for-font-awesome-5' ),
|
47 |
-
'fas' => self::get_option_key( 'disable-css-loading-for-font-awesome-5' ),
|
48 |
-
'fa' => self::get_option_key( 'disable-css-loading-for-font-awesome-3' ),
|
49 |
-
];
|
50 |
-
}
|
51 |
-
|
52 |
-
function enqueue( $hook ) {
|
53 |
-
if ( $this->get_hook_name() === $hook ) {
|
54 |
-
wp_enqueue_style(
|
55 |
-
'zoom-social-icons-settings-page',
|
56 |
-
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/css/social-icons-settings-page.css',
|
57 |
-
[],
|
58 |
-
filemtime( WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/css/social-icons-settings-page.css' )
|
59 |
-
);
|
60 |
-
|
61 |
-
wp_enqueue_script(
|
62 |
-
'zoom-social-icons-settings-page',
|
63 |
-
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/js/social-icons-settings-page.js',
|
64 |
-
[ 'jquery', 'jquery-ui-tabs' ],
|
65 |
-
filemtime( WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/js/social-icons-settings-page.js' ),
|
66 |
-
true
|
67 |
-
);
|
68 |
-
}
|
69 |
-
}
|
70 |
-
|
71 |
-
function get_hook_name() {
|
72 |
-
return 'settings_page_' . self::$menu_slug;
|
73 |
-
}
|
74 |
-
|
75 |
-
|
76 |
-
/**
|
77 |
-
* Add options page
|
78 |
-
*/
|
79 |
-
public function add_plugin_page() {
|
80 |
-
// This page will be under "Settings"
|
81 |
-
add_options_page(
|
82 |
-
__( 'Social Icons Widget By WPZOOM Settings Page', 'zoom-social-icons-widget' ),
|
83 |
-
__( 'Social Icons Widget', 'zoom-social-icons-widget' ),
|
84 |
-
'manage_options',
|
85 |
-
self::$menu_slug,
|
86 |
-
[ $this, 'create_admin_page' ]
|
87 |
-
);
|
88 |
-
}
|
89 |
-
|
90 |
-
public static function get_option_key($key){
|
91 |
-
$options = self::get_settings();
|
92 |
-
|
93 |
-
return array_key_exists($key, $options) ? $options[$key] :self::$option_defaults[$key];
|
94 |
-
}
|
95 |
-
|
96 |
-
/**
|
97 |
-
* Options page callback
|
98 |
-
*/
|
99 |
-
public function create_admin_page() {
|
100 |
-
// Set class property
|
101 |
-
$this->options = self::get_settings();
|
102 |
-
|
103 |
-
?>
|
104 |
-
<div class="wrap zoom-social-icons-settings">
|
105 |
-
<h1><?php _e( 'Social Icons Widget & Block by WPZOOM', 'zoom-social-icons-widget' ) ?></h1>
|
106 |
-
|
107 |
-
<div class="wp-filter">
|
108 |
-
<ul class="filter-links">
|
109 |
-
<li>
|
110 |
-
<a href="#font-styles"><?php _e( 'Icon Sets', 'zoom-social-icons-widget' ) ?></a>
|
111 |
-
</li>
|
112 |
-
|
113 |
-
<li>
|
114 |
-
<a href="#font-preload"><?php _e( 'Optimization', 'zoom-social-icons-widget' ) ?></a>
|
115 |
-
</li>
|
116 |
-
<li>
|
117 |
-
<a href="#general-tab"><?php _e( 'Misc.', 'zoom-social-icons-widget' ) ?></a>
|
118 |
-
</li>
|
119 |
-
|
120 |
-
<li>
|
121 |
-
<a href="#upload-pro"><?php _e( 'Upload Icons <span>PRO</span>', 'zoom-social-icons-widget' ) ?></a>
|
122 |
-
</li>
|
123 |
-
</ul>
|
124 |
-
</div>
|
125 |
-
|
126 |
-
<form method="post" action="options.php">
|
127 |
-
|
128 |
-
<div id="font-styles" class="tab">
|
129 |
-
<?php settings_fields( 'wpzoom-social-icons-widget-settings-group-font-styles' );
|
130 |
-
do_settings_sections( 'wpzoom-social-icons-widget-settings-group-font-styles' ); ?>
|
131 |
-
</div>
|
132 |
-
|
133 |
-
<div id="font-preload" class="tab">
|
134 |
-
<?php settings_fields( 'wpzoom-social-icons-widget-settings-group-font-preload' );
|
135 |
-
do_settings_sections( 'wpzoom-social-icons-widget-settings-group-font-preload' ); ?>
|
136 |
-
</div>
|
137 |
-
|
138 |
-
<div id="general-tab" class="tab">
|
139 |
-
<?php settings_fields( 'wpzoom-social-icons-widget-settings-group-general' );
|
140 |
-
do_settings_sections( 'wpzoom-social-icons-widget-settings-group-general' ); ?>
|
141 |
-
</div>
|
142 |
-
|
143 |
-
<div id="upload-pro" class="tab">
|
144 |
-
<?php settings_fields( 'wpzoom-social-icons-widget-settings-upload-pro' );
|
145 |
-
do_settings_sections( 'wpzoom-social-icons-widget-settings-upload-pro' ); ?>
|
146 |
-
</div>
|
147 |
-
|
148 |
-
<?php submit_button(); ?>
|
149 |
-
</form>
|
150 |
-
</div>
|
151 |
-
|
152 |
-
<?php
|
153 |
-
}
|
154 |
-
|
155 |
-
static public function get_settings() {
|
156 |
-
return get_option( self::$option_name, self::$option_defaults );
|
157 |
-
}
|
158 |
-
|
159 |
-
/**
|
160 |
-
* Register and add settings
|
161 |
-
*/
|
162 |
-
public function page_init() {
|
163 |
-
/**
|
164 |
-
* Register settings for General tab.
|
165 |
-
*/
|
166 |
-
register_setting(
|
167 |
-
'wpzoom-social-icons-widget-settings-group-general',
|
168 |
-
self::$option_name, // Option name
|
169 |
-
[
|
170 |
-
'sanitize_callback' => [ $this, 'sanitize' ],
|
171 |
-
'default' => self::$option_defaults
|
172 |
-
]
|
173 |
-
);
|
174 |
-
|
175 |
-
/**
|
176 |
-
* Register settings for Upload Icons tab.
|
177 |
-
*/
|
178 |
-
register_setting(
|
179 |
-
'wpzoom-social-icons-widget-settings-upload-pro',
|
180 |
-
self::$option_name, // Option name
|
181 |
-
[
|
182 |
-
'sanitize_callback' => [ $this, 'sanitize' ],
|
183 |
-
'default' => self::$option_defaults
|
184 |
-
]
|
185 |
-
);
|
186 |
-
|
187 |
-
/**
|
188 |
-
* Register settings for Font Preload tab.
|
189 |
-
*/
|
190 |
-
register_setting(
|
191 |
-
'wpzoom-social-icons-widget-settings-group-font-preload',
|
192 |
-
self::$option_name, // Option name
|
193 |
-
[
|
194 |
-
'sanitize_callback' => [ $this, 'sanitize' ],
|
195 |
-
'default' => self::$option_defaults
|
196 |
-
]
|
197 |
-
);
|
198 |
-
|
199 |
-
/**
|
200 |
-
* Register settings for Font Styles tab.
|
201 |
-
*/
|
202 |
-
register_setting(
|
203 |
-
'wpzoom-social-icons-widget-settings-group-font-styles',
|
204 |
-
self::$option_name, // Option name
|
205 |
-
[
|
206 |
-
'sanitize_callback' => [ $this, 'sanitize' ],
|
207 |
-
'default' => self::$option_defaults
|
208 |
-
]
|
209 |
-
);
|
210 |
-
|
211 |
-
|
212 |
-
/**
|
213 |
-
* General tab section and settings.
|
214 |
-
*/
|
215 |
-
add_settings_section(
|
216 |
-
'wpzoom-social-icons-widget-settings-general',
|
217 |
-
false, // Title
|
218 |
-
'__return_false', // Callback
|
219 |
-
'wpzoom-social-icons-widget-settings-group-general'
|
220 |
-
);
|
221 |
-
|
222 |
-
add_settings_field(
|
223 |
-
'wpzoom-disable-social-icons-widget-checkbox',
|
224 |
-
__( 'Social Icons Widget', 'zoom-social-icons-widget' ),
|
225 |
-
[ $this, 'field_disable_widget_checkbox' ],
|
226 |
-
'wpzoom-social-icons-widget-settings-group-general',
|
227 |
-
'wpzoom-social-icons-widget-settings-general'
|
228 |
-
);
|
229 |
-
|
230 |
-
add_settings_field(
|
231 |
-
'wpzoom-disable-social-icons-block-checkbox',
|
232 |
-
__( 'Social Icons Block', 'zoom-social-icons-widget' ),
|
233 |
-
[ $this, 'field_disable_block_checkbox' ],
|
234 |
-
'wpzoom-social-icons-widget-settings-group-general',
|
235 |
-
'wpzoom-social-icons-widget-settings-general'
|
236 |
-
);
|
237 |
-
|
238 |
-
/**
|
239 |
-
* Upload tab section .
|
240 |
-
*/
|
241 |
-
add_settings_section(
|
242 |
-
'wpzoom-social-icons-widget-settings-upload',
|
243 |
-
false, // Title
|
244 |
-
'__return_false', // Callback
|
245 |
-
'wpzoom-social-icons-widget-settings-upload-pro'
|
246 |
-
);
|
247 |
-
|
248 |
-
add_settings_section(
|
249 |
-
'wpzoom-instagram-widget-settings-user-info',
|
250 |
-
false,
|
251 |
-
array( $this, 'settings_field_user_details' ),
|
252 |
-
'wpzoom-social-icons-widget-settings-upload-pro'
|
253 |
-
);
|
254 |
-
|
255 |
-
|
256 |
-
/**
|
257 |
-
* Font Preloader tab section and settings.
|
258 |
-
*/
|
259 |
-
add_settings_section(
|
260 |
-
'wpzoom-social-icons-widget-settings-font-preload',
|
261 |
-
false,
|
262 |
-
'__return_false',
|
263 |
-
'wpzoom-social-icons-widget-settings-group-font-preload'
|
264 |
-
);
|
265 |
-
|
266 |
-
add_settings_field(
|
267 |
-
'wpzoom-enable-social-icons-fonts-preloader',
|
268 |
-
__( 'Preload Fonts', 'zoom-social-icons-widget' ),
|
269 |
-
[ $this, 'field_disable_fonts_preloading' ],
|
270 |
-
'wpzoom-social-icons-widget-settings-group-font-preload',
|
271 |
-
'wpzoom-social-icons-widget-settings-font-preload'
|
272 |
-
);
|
273 |
-
|
274 |
-
/**
|
275 |
-
* Font Styles tab section and settings.
|
276 |
-
*/
|
277 |
-
add_settings_section(
|
278 |
-
'wpzoom-social-icons-widget-settings-font-styles',
|
279 |
-
false, // Title
|
280 |
-
'__return_false',
|
281 |
-
'wpzoom-social-icons-widget-settings-group-font-styles'
|
282 |
-
);
|
283 |
-
|
284 |
-
add_settings_field(
|
285 |
-
'wpzoom-disable-css-loading-for-academicons',
|
286 |
-
__( 'Academicons', 'zoom-social-icons-widget' ),
|
287 |
-
[ $this, 'field_disable_css_loading_for_academicons' ],
|
288 |
-
'wpzoom-social-icons-widget-settings-group-font-styles',
|
289 |
-
'wpzoom-social-icons-widget-settings-font-styles'
|
290 |
-
);
|
291 |
-
|
292 |
-
add_settings_field(
|
293 |
-
'wpzoom-disable-css-loading-for-font-awesome-3',
|
294 |
-
__( 'Font Awesome 3', 'zoom-social-icons-widget' ),
|
295 |
-
[ $this, 'field_disable_css_loading_for_font_awesome_3' ],
|
296 |
-
'wpzoom-social-icons-widget-settings-group-font-styles',
|
297 |
-
'wpzoom-social-icons-widget-settings-font-styles'
|
298 |
-
);
|
299 |
-
|
300 |
-
add_settings_field(
|
301 |
-
'wpzoom-disable-css-loading-for-font-awesome-5',
|
302 |
-
__( 'Font Awesome 5', 'zoom-social-icons-widget' ),
|
303 |
-
[ $this, 'field_disable_css_loading_for_font_awesome_5' ],
|
304 |
-
'wpzoom-social-icons-widget-settings-group-font-styles',
|
305 |
-
'wpzoom-social-icons-widget-settings-font-styles'
|
306 |
-
);
|
307 |
-
|
308 |
-
add_settings_field(
|
309 |
-
'wpzoom-disable-css-loading-for-font-genericons',
|
310 |
-
__( 'Genericons', 'zoom-social-icons-widget' ),
|
311 |
-
[ $this, 'field_disable_css_loading_for_genericons' ],
|
312 |
-
'wpzoom-social-icons-widget-settings-group-font-styles',
|
313 |
-
'wpzoom-social-icons-widget-settings-font-styles'
|
314 |
-
);
|
315 |
-
|
316 |
-
add_settings_field(
|
317 |
-
'wpzoom-disable-css-loading-for-font-dashicons',
|
318 |
-
__( 'Dashicons', 'zoom-social-icons-widget' ),
|
319 |
-
[ $this, 'field_disable_css_loading_for_dashicons' ],
|
320 |
-
'wpzoom-social-icons-widget-settings-group-font-styles',
|
321 |
-
'wpzoom-social-icons-widget-settings-font-styles'
|
322 |
-
);
|
323 |
-
|
324 |
-
add_settings_field(
|
325 |
-
'wpzoom-disable-css-loading-for-font-socicons',
|
326 |
-
__( 'Socicons', 'zoom-social-icons-widget' ),
|
327 |
-
[ $this, 'field_disable_css_loading_for_socicons' ],
|
328 |
-
'wpzoom-social-icons-widget-settings-group-font-styles',
|
329 |
-
'wpzoom-social-icons-widget-settings-font-styles'
|
330 |
-
);
|
331 |
-
|
332 |
-
add_settings_field(
|
333 |
-
'wpzoom-categories-sync',
|
334 |
-
__( 'Sync Icon Sets', 'zoom-social-icons-widget' ),
|
335 |
-
[ $this, 'field_categories_sync' ],
|
336 |
-
'wpzoom-social-icons-widget-settings-group-font-styles',
|
337 |
-
'wpzoom-social-icons-widget-settings-font-styles'
|
338 |
-
);
|
339 |
-
}
|
340 |
-
|
341 |
-
/**
|
342 |
-
* Sanitize each setting field as needed
|
343 |
-
*
|
344 |
-
* @param array $input Contains all settings fields as array keys
|
345 |
-
*
|
346 |
-
* @return array
|
347 |
-
*/
|
348 |
-
public function sanitize( $input ) {
|
349 |
-
$new_input = [];
|
350 |
-
if ( isset( $input['disable-widget'] ) ) {
|
351 |
-
$new_input['disable-widget'] = wp_validate_boolean( $input['disable-widget'] );
|
352 |
-
}
|
353 |
-
|
354 |
-
if ( isset( $input['disable-block'] ) ) {
|
355 |
-
$new_input['disable-block'] = wp_validate_boolean( $input['disable-block'] );
|
356 |
-
}
|
357 |
-
|
358 |
-
if ( isset( $input['disable-fonts-preloading'] ) ) {
|
359 |
-
$new_input['disable-fonts-preloading'] = wp_validate_boolean( $input['disable-fonts-preloading'] );
|
360 |
-
}
|
361 |
-
|
362 |
-
if ( isset( $input['disable-css-loading-for-academicons'] ) ) {
|
363 |
-
$new_input['disable-css-loading-for-academicons'] = wp_validate_boolean( $input['disable-css-loading-for-academicons'] );
|
364 |
-
}
|
365 |
-
|
366 |
-
if ( isset( $input['disable-css-loading-for-font-awesome-3'] ) ) {
|
367 |
-
$new_input['disable-css-loading-for-font-awesome-3'] = wp_validate_boolean( $input['disable-css-loading-for-font-awesome-3'] );
|
368 |
-
}
|
369 |
-
|
370 |
-
if ( isset( $input['disable-css-loading-for-font-awesome-5'] ) ) {
|
371 |
-
$new_input['disable-css-loading-for-font-awesome-5'] = wp_validate_boolean( $input['disable-css-loading-for-font-awesome-5'] );
|
372 |
-
}
|
373 |
-
|
374 |
-
if ( isset( $input['disable-css-loading-for-genericons'] ) ) {
|
375 |
-
$new_input['disable-css-loading-for-genericons'] = wp_validate_boolean( $input['disable-css-loading-for-genericons'] );
|
376 |
-
}
|
377 |
-
|
378 |
-
if ( isset( $input['disable-css-loading-for-dashicons'] ) ) {
|
379 |
-
$new_input['disable-css-loading-for-dashicons'] = wp_validate_boolean( $input['disable-css-loading-for-dashicons'] );
|
380 |
-
}
|
381 |
-
|
382 |
-
if ( isset( $input['disable-css-loading-for-socicons'] ) ) {
|
383 |
-
$new_input['disable-css-loading-for-socicons'] = wp_validate_boolean( $input['disable-css-loading-for-socicons'] );
|
384 |
-
}
|
385 |
-
|
386 |
-
if ( isset( $input['categories-sync'] ) ) {
|
387 |
-
$new_input['categories-sync'] = wp_validate_boolean( $input['categories-sync'] );
|
388 |
-
}
|
389 |
-
|
390 |
-
return $new_input;
|
391 |
-
}
|
392 |
-
|
393 |
-
/**
|
394 |
-
* Render Disable Widget checkbox in settings page.
|
395 |
-
*/
|
396 |
-
public function field_disable_widget_checkbox() {
|
397 |
-
?>
|
398 |
-
<label>
|
399 |
-
<input type="hidden" name="wpzoom-social-icons-widget-settings[disable-widget]" value="0"/>
|
400 |
-
<input type="checkbox"
|
401 |
-
id="disable-widget"
|
402 |
-
name="wpzoom-social-icons-widget-settings[disable-widget]"
|
403 |
-
value="1"
|
404 |
-
<?php checked( self::get_option_key('disable-widget'), 1 ) ?>/>
|
405 |
-
<?php _e( 'Disable', 'zoom-social-icons-widget' ) ?>
|
406 |
-
</label>
|
407 |
-
<span class="description"><?php _e( 'Social Icons Widget module functionality, by default enabled.', 'zoom-social-icons-widget' ) ?></span>
|
408 |
-
|
409 |
-
<?php
|
410 |
-
}
|
411 |
-
|
412 |
-
/**
|
413 |
-
* Render Disable Block checkbox in settings page.
|
414 |
-
*/
|
415 |
-
public function field_disable_block_checkbox() {
|
416 |
-
?>
|
417 |
-
<label>
|
418 |
-
<input type="hidden" name="wpzoom-social-icons-widget-settings[disable-block]" value="0"/>
|
419 |
-
<input type="checkbox"
|
420 |
-
id="disable-block"
|
421 |
-
name="wpzoom-social-icons-widget-settings[disable-block]"
|
422 |
-
value="1"
|
423 |
-
<?php checked( self::get_option_key('disable-block'), 1 ) ?>/>
|
424 |
-
<?php _e( 'Disable', 'zoom-social-icons-widget' ) ?>
|
425 |
-
</label>
|
426 |
-
<span class="description"><?php _e( 'Social Icons Block module functionality, by default enabled.', 'zoom-social-icons-widget' ) ?></span>
|
427 |
-
|
428 |
-
<?php
|
429 |
-
}
|
430 |
-
|
431 |
-
/**
|
432 |
-
* Render Fonts Preloading checkbox in settings page.
|
433 |
-
*/
|
434 |
-
public function field_disable_fonts_preloading() {
|
435 |
-
?>
|
436 |
-
<label>
|
437 |
-
<input type="hidden" name="wpzoom-social-icons-widget-settings[disable-fonts-preloading]" value="0"/>
|
438 |
-
<input type="checkbox"
|
439 |
-
id="disable-fonts-preloading"
|
440 |
-
name="wpzoom-social-icons-widget-settings[disable-fonts-preloading]"
|
441 |
-
value="1"
|
442 |
-
<?php checked( self::get_option_key('disable-fonts-preloading'), 1 ) ?>/>
|
443 |
-
<?php _e( 'Enable', 'zoom-social-icons-widget' ) ?>
|
444 |
-
</label>
|
445 |
-
<span class="description"><?php _e( 'Preload web fonts using rel="preload" to remove any flash of unstyled text and improve the PageSpeed score.', 'zoom-social-icons-widget' ) ?></span>
|
446 |
-
<?php
|
447 |
-
}
|
448 |
-
|
449 |
-
/**
|
450 |
-
* Render Academicons CSS Loading checkbox in settings page.
|
451 |
-
*/
|
452 |
-
public function field_disable_css_loading_for_academicons() {
|
453 |
-
?>
|
454 |
-
<label>
|
455 |
-
<input type="hidden" name="wpzoom-social-icons-widget-settings[disable-css-loading-for-academicons]"
|
456 |
-
value="0"/>
|
457 |
-
<input type="checkbox"
|
458 |
-
id="disable-css-loading-for-academicons"
|
459 |
-
name="wpzoom-social-icons-widget-settings[disable-css-loading-for-academicons]"
|
460 |
-
value="1"
|
461 |
-
<?php checked( self::get_option_key('disable-css-loading-for-academicons'), 1 ) ?>/>
|
462 |
-
<?php _e( 'Enable this font', 'zoom-social-icons-widget' ) ?>
|
463 |
-
</label>
|
464 |
-
<?php
|
465 |
-
}
|
466 |
-
|
467 |
-
/**
|
468 |
-
* Render Font Awesome 3 CSS Loading checkbox in settings page.
|
469 |
-
*/
|
470 |
-
public function field_disable_css_loading_for_font_awesome_3() {
|
471 |
-
?>
|
472 |
-
<label>
|
473 |
-
<input type="hidden" name="wpzoom-social-icons-widget-settings[disable-css-loading-for-font-awesome-3]"
|
474 |
-
value="0"/>
|
475 |
-
<input type="checkbox"
|
476 |
-
id="disable-css-loading-for-font-awesome-3"
|
477 |
-
name="wpzoom-social-icons-widget-settings[disable-css-loading-for-font-awesome-3]"
|
478 |
-
value="1"
|
479 |
-
<?php checked( self::get_option_key('disable-css-loading-for-font-awesome-3'), 1 ) ?>/>
|
480 |
-
<?php _e( 'Enable this font', 'zoom-social-icons-widget' ) ?>
|
481 |
-
</label>
|
482 |
-
<span class="description"><?php _e( 'Font Awesome 3 is loaded only in the Social Icons Widget', 'zoom-social-icons-widget' ) ?></span>
|
483 |
-
<?php
|
484 |
-
}
|
485 |
-
|
486 |
-
/**
|
487 |
-
* Render Font Awesome 5 CSS Loading checkbox in settings page.
|
488 |
-
*/
|
489 |
-
public function field_disable_css_loading_for_font_awesome_5() {
|
490 |
-
?>
|
491 |
-
<label>
|
492 |
-
<input type="hidden" name="wpzoom-social-icons-widget-settings[disable-css-loading-for-font-awesome-5]"
|
493 |
-
value="0"/>
|
494 |
-
<input type="checkbox"
|
495 |
-
id="disable-css-loading-for-font-awesome-5"
|
496 |
-
name="wpzoom-social-icons-widget-settings[disable-css-loading-for-font-awesome-5]"
|
497 |
-
value="1"
|
498 |
-
<?php checked( self::get_option_key('disable-css-loading-for-font-awesome-5'), 1 ) ?>/>
|
499 |
-
<?php _e( 'Enable this font', 'zoom-social-icons-widget' ) ?>
|
500 |
-
</label>
|
501 |
-
<span class="description"><?php _e( 'Font Awesome 5 is loaded only in the Social Icons Block.', 'zoom-social-icons-widget' ) ?></span>
|
502 |
-
|
503 |
-
<?php
|
504 |
-
}
|
505 |
-
|
506 |
-
/**
|
507 |
-
* Render Genericons CSS Loading checkbox in settings page.
|
508 |
-
*/
|
509 |
-
public function field_disable_css_loading_for_genericons() {
|
510 |
-
?>
|
511 |
-
<label>
|
512 |
-
<input type="hidden" name="wpzoom-social-icons-widget-settings[disable-css-loading-for-genericons]"
|
513 |
-
value="0"/>
|
514 |
-
<input type="checkbox"
|
515 |
-
id="disable-css-loading-for-genericons"
|
516 |
-
name="wpzoom-social-icons-widget-settings[disable-css-loading-for-genericons]"
|
517 |
-
value="1"
|
518 |
-
<?php checked( self::get_option_key('disable-css-loading-for-genericons'), 1 ) ?>/>
|
519 |
-
<?php _e( 'Enable this font', 'zoom-social-icons-widget' ) ?>
|
520 |
-
</label>
|
521 |
-
<?php
|
522 |
-
}
|
523 |
-
|
524 |
-
/**
|
525 |
-
* Render Dashicons CSS Loading checkbox in settings page.
|
526 |
-
*/
|
527 |
-
public function field_disable_css_loading_for_dashicons() {
|
528 |
-
?>
|
529 |
-
<label>
|
530 |
-
<input type="hidden" name="wpzoom-social-icons-widget-settings[disable-css-loading-for-dashicons]"
|
531 |
-
value="0"/>
|
532 |
-
<input type="checkbox"
|
533 |
-
id="disable-css-loading-for-dashicons"
|
534 |
-
name="wpzoom-social-icons-widget-settings[disable-css-loading-for-dashicons]"
|
535 |
-
value="1"
|
536 |
-
<?php checked( self::get_option_key('disable-css-loading-for-dashicons'), 1 ) ?>/>
|
537 |
-
<?php _e( 'Enable this font', 'zoom-social-icons-widget' ) ?>
|
538 |
-
</label>
|
539 |
-
<?php
|
540 |
-
}
|
541 |
-
|
542 |
-
/**
|
543 |
-
* Render Socicons CSS Loading checkbox in settings page.
|
544 |
-
*/
|
545 |
-
public function field_disable_css_loading_for_socicons() {
|
546 |
-
?>
|
547 |
-
<label>
|
548 |
-
<input type="hidden" name="wpzoom-social-icons-widget-settings[disable-css-loading-for-socicons]"
|
549 |
-
value="0"/>
|
550 |
-
<input type="checkbox"
|
551 |
-
id="disable-css-loading-for-socicons"
|
552 |
-
name="wpzoom-social-icons-widget-settings[disable-css-loading-for-socicons]"
|
553 |
-
value="1"
|
554 |
-
<?php checked( self::get_option_key('disable-css-loading-for-socicons'), 1 ) ?>/>
|
555 |
-
<?php _e( 'Enable this font', 'zoom-social-icons-widget' ) ?>
|
556 |
-
</label>
|
557 |
-
<span class="description"><?php _e( 'Main icon set', 'zoom-social-icons-widget' ) ?></span>
|
558 |
-
|
559 |
-
<?php
|
560 |
-
}
|
561 |
-
|
562 |
-
/**
|
563 |
-
* Render categories sync checkbox in settings page.
|
564 |
-
*/
|
565 |
-
public function field_categories_sync() {
|
566 |
-
?>
|
567 |
-
<label>
|
568 |
-
<input type="hidden" name="wpzoom-social-icons-widget-settings[categories-sync]"
|
569 |
-
value="0"/>
|
570 |
-
<input type="checkbox"
|
571 |
-
id="categories-sync"
|
572 |
-
name="wpzoom-social-icons-widget-settings[categories-sync]"
|
573 |
-
value="1"
|
574 |
-
<?php checked( self::get_option_key('categories-sync'), 1 ) ?>/>
|
575 |
-
<?php _e( 'Enable sync', 'zoom-social-icons-widget' ) ?>
|
576 |
-
</label>
|
577 |
-
<span class="description"><?php _e( 'Sync Icon sets with Block and Widget Settings from popup.', 'zoom-social-icons-widget' ) ?></span>
|
578 |
-
<?php
|
579 |
-
}
|
580 |
-
|
581 |
-
public function settings_field_user_details() {
|
582 |
-
?>
|
583 |
-
|
584 |
-
<div class="wpz-pro-plugin-wrap">
|
585 |
-
|
586 |
-
<div class="wpz-pro-btn-wrap">
|
587 |
-
<a class="wpz-social-pro-btn" href="https://www.wpzoom.com/plugins/social-widget/?utm_source=wpadmin&utm_medium=website&utm_campaign=social_free_promotab" target="_blank"><?php _e('Get Social Icons Widget PRO', 'zoom-social-icons-widget' ) ?></a>
|
588 |
-
</div>
|
589 |
-
|
590 |
-
|
591 |
-
<table class="form-table wpz-section_disabled_pro" role="presentation"><tbody><tr><th scope="row">Upload Icons</th><td><p style="margin-bottom: 16px;">
|
592 |
-
Upload your icons here and create a new Custom Icons set</p>
|
593 |
-
|
594 |
-
<div class="zoom-instagram-user-avatar-media-uploader" data-type="image" data-button-add-text="Upload an SVG icon" data-button-replace-text="Replace SVG icon">
|
595 |
-
<a href="#" class="button add-media" title="Upload SVG icon">Upload an SVG icon</a>
|
596 |
-
|
597 |
-
<div class="file-wrapper custom-icon__list" style="display: none;"></div>
|
598 |
-
|
599 |
-
<button type="button" class="remove-avatar button-link delete-attachment" style="display: none;">
|
600 |
-
Remove Icon </button>
|
601 |
-
|
602 |
-
<input class="attachment-url-input" type="hidden" name="wpzoom-custom-icon[attachment-url]">
|
603 |
-
<input class="attachment-title-input" type="hidden" name="wpzoom-custom-icon[attachment-title]">
|
604 |
-
</div>
|
605 |
-
<div class="add-to-custom-iconset" id="add-to-custom-iconset">
|
606 |
-
<p class="submit"><input type="submit" name="submit" id="submit" class="button button-primary" value="Add icon to set"></p></div>
|
607 |
-
|
608 |
-
<div class="modal-icons-wrapper" style="margin-top: 1em;">
|
609 |
-
|
610 |
-
<div class="" style="display: flex; flex-direction: row; align-items: center; justify-content: space-between;">
|
611 |
-
<div style=" width: 50%; max-width: 300px; display: flex; flex-direction: row; align-items: center;">
|
612 |
-
<div class="custom-icon__list" style="margin-right: 2em;">
|
613 |
-
|
614 |
-
<svg xmlns="http://www.w3.org/2000/svg" role="img" viewBox="0 0 24 24">
|
615 |
-
<title>Yoast</title>
|
616 |
-
<path d="M15.864 0L14.55 3.652H5.422A3.592 3.592 0 0 0 1.84 7.233v9.529a3.592 3.592 0 0 0 3.582 3.581h1.495a4.9 4.9 0 0 1-.18.029l-.34.047V24h.391c2.76 0 4.442-1.385 5.706-3.657h9.666V7.233a3.593 3.593 0 0 0-3.253-3.565L20.275 0zm.556.778h2.738l-6.055 16.22c-1.55 4.335-3.186 6.064-5.924 6.21v-2.12c1.767-.354 2.418-1.461 2.785-2.408a3.902 3.902 0 0 0 0-2.828L6.43 6.772h2.488l2.512 7.86z"></path>
|
617 |
-
</svg>
|
618 |
-
</div>
|
619 |
-
<label>
|
620 |
-
<input type="checkbox" name="remove[]" value="0">
|
621 |
-
Remove
|
622 |
-
</label>
|
623 |
-
</div>
|
624 |
-
<p class="submit"><input type="submit" name="submit" id="submit" class="button button-primary" value="update"></p> </div>
|
625 |
-
<div class="" style="display: flex; flex-direction: row; align-items: center; justify-content: space-between;">
|
626 |
-
<div style=" width: 50%; max-width: 300px; display: flex; flex-direction: row; align-items: center;">
|
627 |
-
<div class="custom-icon__list" style="margin-right: 2em;">
|
628 |
-
|
629 |
-
<svg xmlns="http://www.w3.org/2000/svg" role="img" viewBox="0 0 24 24">
|
630 |
-
<title>Bitcoin</title>
|
631 |
-
<path d="M23.638 14.904c-1.602 6.43-8.113 10.34-14.542 8.736C2.67 22.05-1.244 15.525.362 9.105 1.962 2.67 8.475-1.243 14.9.358c6.43 1.605 10.342 8.115 8.738 14.548v-.002zm-6.35-4.613c.24-1.59-.974-2.45-2.64-3.03l.54-2.153-1.315-.33-.525 2.107c-.345-.087-.705-.167-1.064-.25l.526-2.127-1.32-.33-.54 2.165c-.285-.067-.565-.132-.84-.2l-1.815-.45-.35 1.407s.975.225.955.236c.535.136.63.486.615.766l-1.477 5.92c-.075.166-.24.406-.614.314.015.02-.96-.24-.96-.24l-.66 1.51 1.71.426.93.242-.54 2.19 1.32.327.54-2.17c.36.1.705.19 1.05.273l-.51 2.154 1.32.33.545-2.19c2.24.427 3.93.257 4.64-1.774.57-1.637-.03-2.58-1.217-3.196.854-.193 1.5-.76 1.68-1.93h.01zm-3.01 4.22c-.404 1.64-3.157.75-4.05.53l.72-2.9c.896.23 3.757.67 3.33 2.37zm.41-4.24c-.37 1.49-2.662.735-3.405.55l.654-2.64c.744.18 3.137.524 2.75 2.084v.006z"></path>
|
632 |
-
</svg>
|
633 |
-
</div>
|
634 |
-
<label>
|
635 |
-
<input type="checkbox" name="remove[]" value="1">
|
636 |
-
Remove
|
637 |
-
</label>
|
638 |
-
</div>
|
639 |
-
<p class="submit"><input type="submit" name="submit" id="submit" class="button button-primary" value="update"></p> </div>
|
640 |
-
<div class="" style="display: flex; flex-direction: row; align-items: center; justify-content: space-between;">
|
641 |
-
<div style=" width: 50%; max-width: 300px; display: flex; flex-direction: row; align-items: center;">
|
642 |
-
<div class="custom-icon__list" style="margin-right: 2em;">
|
643 |
-
|
644 |
-
<svg xmlns="http://www.w3.org/2000/svg" role="img" viewBox="0 0 24 24">
|
645 |
-
<title>Tesla</title>
|
646 |
-
<path d="M12 5.362l2.475-3.026s4.245.09 8.471 2.054c-1.082 1.636-3.231 2.438-3.231 2.438-.146-1.439-1.154-1.79-4.354-1.79L12 24 8.619 5.034c-3.18 0-4.188.354-4.335 1.792 0 0-2.146-.795-3.229-2.43C5.28 2.431 9.525 2.34 9.525 2.34L12 5.362l-.004.002H12v-.002zm0-3.899c3.415-.03 7.326.528 11.328 2.28.535-.968.672-1.395.672-1.395C19.625.612 15.528.015 12 0 8.472.015 4.375.61 0 2.349c0 0 .195.525.672 1.396C4.674 1.989 8.585 1.435 12 1.46v.003z"></path>
|
647 |
-
</svg>
|
648 |
-
</div>
|
649 |
-
<label>
|
650 |
-
<input type="checkbox" name="remove[]" value="2">
|
651 |
-
Remove
|
652 |
-
</label>
|
653 |
-
</div>
|
654 |
-
<p class="submit"><input type="submit" name="submit" id="submit" class="button button-primary" value="update"></p> </div>
|
655 |
-
<div class="" style="display: flex; flex-direction: row; align-items: center; justify-content: space-between;">
|
656 |
-
<div style=" width: 50%; max-width: 300px; display: flex; flex-direction: row; align-items: center;">
|
657 |
-
<div class="custom-icon__list" style="margin-right: 2em;">
|
658 |
-
|
659 |
-
<svg xmlns="http://www.w3.org/2000/svg" role="img" viewBox="0 0 24 24">
|
660 |
-
<title>foodpanda</title>
|
661 |
-
<path d="M4.224 0a3.14 3.14 0 00-3.14 3.127 3.1 3.1 0 001.079 2.36 11.811 11.811 0 00-2.037 6.639C.126 18.68 5.458 24 12 24c6.542 0 11.874-5.32 11.874-11.874a11.69 11.69 0 00-2.025-6.614 3.136 3.136 0 001.09-2.373A3.132 3.132 0 0019.8.012a3.118 3.118 0 00-2.636 1.438A11.792 11.792 0 0012.012.264c-1.845 0-3.595.419-5.152 1.174A3.133 3.133 0 004.224 0zM12 1.198c1.713 0 3.331.396 4.78 1.102a10.995 10.995 0 014.29 3.715 10.89 10.89 0 011.882 6.135c.011 6.039-4.901 10.951-10.94 10.951-6.04 0-10.951-4.912-10.951-10.951 0-2.277.694-4.386 1.88-6.135A11.08 11.08 0 017.232 2.3 10.773 10.773 0 0112 1.198zM7.367 6.345c-.853.012-1.743.292-2.28.653-1.031.682-2.29 2.156-2.085 4.181.191 2.025 1.785 3.283 2.612 3.283.826 0 1.234-.42 1.485-1.45.252-1.018 1.115-2.192 2.217-3.45s-.024-2.469-.024-2.469c-.393-.513-1.052-.727-1.755-.747a3.952 3.952 0 00-.17-.001zm9.233.007l-.17.001c-.702.02-1.358.233-1.746.752 0 0-1.126 1.21-.024 2.469 1.114 1.258 1.965 2.432 2.217 3.45.251 1.019.659 1.438 1.485 1.45.827 0 2.409-1.258 2.612-3.283.204-2.025-1.054-3.51-2.084-4.182-.544-.36-1.437-.643-2.29-.657zm-8.962 2c.348 0 .624.275.624.623-.012.335-.288.623-.624.623a.619.619 0 01-.623-.623c0-.348.276-.624.623-.624zm8.891 0c.348 0 .623.275.623.623-.012.335-.287.623-.623.623a.619.619 0 01-.623-.623c0-.348.288-.624.623-.624zm-4.541 4.025c-.527 0-2.06.096-2.06.587 0 .887 1.88 1.522 2.06 1.474.18.048 2.06-.587 2.06-1.474 0-.49-1.52-.587-2.06-.587zM9.076 15.17c0 1.414 1.294 2.564 2.912 2.564 1.618 0 2.924-1.15 2.924-2.564z"></path>
|
662 |
-
</svg>
|
663 |
-
</div>
|
664 |
-
<label>
|
665 |
-
<input type="checkbox" name="remove[]" value="3">
|
666 |
-
Remove
|
667 |
-
</label>
|
668 |
-
</div>
|
669 |
-
<p class="submit"><input type="submit" name="submit" id="submit" class="button button-primary" value="update"></p> </div>
|
670 |
-
<div class="" style="display: flex; flex-direction: row; align-items: center; justify-content: space-between;">
|
671 |
-
<div style=" width: 50%; max-width: 300px; display: flex; flex-direction: row; align-items: center;">
|
672 |
-
<div class="custom-icon__list" style="margin-right: 2em;">
|
673 |
-
|
674 |
-
<svg xmlns="http://www.w3.org/2000/svg" role="img" viewBox="0 0 24 24">
|
675 |
-
<title>WP Rocket</title>
|
676 |
-
<path d="M3.723.666c-.08-.276.08-.47.356-.47h2.283c.16 0 .31.137.356.274L8.393 7.07h.08L11.491.218A.374.374 0 0111.824 0h.356c.172 0 .287.092.333.218l3.018 6.85h.08L17.286.47a.397.397 0 01.356-.275h2.284c.275 0 .424.195.355.47l-3.683 13.082a.369.369 0 01-.356.275h-.31a.38.38 0 01-.333-.218l-3.568-7.963h-.058l-3.545 7.963a.403.403 0 01-.333.218h-.31a.379.379 0 01-.356-.275L3.723.666m8.308 7.917l-2.594 5.818a1.663 1.663 0 01-.344.448v.004a1.466 1.466 0 01-.688.34l1.4 8.687c.091.16.263.16.367 0l1.79-2.72 1.64 2.708c.104.16.265.16.368 0l1.584-8.698a1.5 1.5 0 01-.832-.618l-.02-.03a1.405 1.405 0 01-.066-.12l-.609-1.366h-.003Z"></path>
|
677 |
-
</svg>
|
678 |
-
</div>
|
679 |
-
<label>
|
680 |
-
<input type="checkbox" name="remove[]" value="4">
|
681 |
-
Remove
|
682 |
-
</label>
|
683 |
-
</div>
|
684 |
-
<p class="submit"><input type="submit" name="submit" id="submit" class="button button-primary" value="update"></p> </div>
|
685 |
-
|
686 |
-
</div>
|
687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_Widget extends WP_Widget
|
4 |
-
{
|
5 |
-
|
6 |
-
/**
|
7 |
-
* @var string Path to plugin file.
|
8 |
-
*/
|
9 |
-
protected $plugin_file;
|
10 |
-
|
11 |
-
|
12 |
-
/**
|
13 |
-
* @var array $icons
|
14 |
-
* Collection of icon kits including socicon, dashicons, fontawesome and genericons
|
15 |
-
*/
|
16 |
-
protected $icons = null;
|
17 |
-
|
18 |
-
|
19 |
-
/**
|
20 |
-
* Settings from database.
|
21 |
-
*
|
22 |
-
* @var array
|
23 |
-
*/
|
24 |
-
protected $settings = [];
|
25 |
-
|
26 |
-
/**
|
27 |
-
* @var array protocols that are allowed in esc_url validation function.
|
28 |
-
*/
|
29 |
-
protected $protocols = array(
|
30 |
-
'skype',
|
31 |
-
'tg',
|
32 |
-
'viber',
|
33 |
-
'http',
|
34 |
-
'https',
|
35 |
-
'mailto',
|
36 |
-
'news',
|
37 |
-
'irc',
|
38 |
-
'feed',
|
39 |
-
'tel',
|
40 |
-
'fax',
|
41 |
-
'mms',
|
42 |
-
'xmpp'
|
43 |
-
);
|
44 |
-
|
45 |
-
public $id_base = 'zoom-social-icons-widget';
|
46 |
-
|
47 |
-
public $widget_name;
|
48 |
-
|
49 |
-
public $widget_options = array();
|
50 |
-
|
51 |
-
/**
|
52 |
-
* Zoom_Social_Icons_Widget constructor.
|
53 |
-
*/
|
54 |
-
public function __construct()
|
55 |
-
{
|
56 |
-
$this->widget_name = esc_html__('Social Icons by WPZOOM', 'zoom-social-icons-widget');
|
57 |
-
$this->widget_options = array(
|
58 |
-
'classname' => 'zoom-social-icons-widget',
|
59 |
-
'description' => __('Sortable widget that supports more than 80+ social networks', 'zoom-social-icons-widget'),
|
60 |
-
'show_instance_in_rest' => true,
|
61 |
-
);
|
62 |
-
|
63 |
-
parent::__construct(
|
64 |
-
$this->id_base,
|
65 |
-
$this->widget_name,
|
66 |
-
$this->widget_options
|
67 |
-
);
|
68 |
-
|
69 |
-
add_action( 'wp_enqueue_scripts', [ $this, 'enqueue_scripts' ] );
|
70 |
-
|
71 |
-
|
72 |
-
$this->icons = include WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'icons-data.php';
|
73 |
-
$removed_keys = ['fab', 'fas', 'far'];
|
74 |
-
$this->icons = array_diff_key($this->icons, array_flip($removed_keys));
|
75 |
-
$this->icons = apply_filters('zoom_social_icons_filter', $this->icons);
|
76 |
-
$this->protocols = apply_filters('zoom_social_protocols_filter', $this->protocols);
|
77 |
-
|
78 |
-
$this->plugin_file = dirname(__FILE__) . '/social-icons-widget-by-wpzoom.php';
|
79 |
-
|
80 |
-
add_action('current_screen', array($this, 'check_current_screen'));
|
81 |
-
add_action('wp_enqueue_scripts', array($this, 'register_scripts'));
|
82 |
-
|
83 |
-
//Hooks to enqueue javascript file in SiteOrigin builder.
|
84 |
-
add_action('siteorigin_panel_enqueue_admin_scripts', array($this, 'admin_scripts'));
|
85 |
-
add_action('siteorigin_panel_enqueue_admin_scripts', array($this, 'admin_js_templates'));
|
86 |
-
|
87 |
-
// Hooks to enqueue javascript for beaver builder.
|
88 |
-
add_action('wp_enqueue_scripts', array($this, 'enqueue_scripts_for_beaver'));
|
89 |
-
add_action('wp_footer', array($this, 'admin_js_templates_for_beaver'));
|
90 |
-
|
91 |
-
// Hooks to enqueue admin scripts in Elementor
|
92 |
-
add_action( 'elementor/editor/before_enqueue_scripts', function() {
|
93 |
-
$this->admin_scripts();
|
94 |
-
$this->admin_js_templates();
|
95 |
-
} );
|
96 |
-
|
97 |
-
}
|
98 |
-
|
99 |
-
function admin_js_templates_for_beaver()
|
100 |
-
{
|
101 |
-
if ((class_exists('FLBuilderModel') && FLBuilderModel::is_builder_active())) {
|
102 |
-
$this->admin_js_templates();
|
103 |
-
}
|
104 |
-
}
|
105 |
-
|
106 |
-
function enqueue_scripts_for_beaver()
|
107 |
-
{
|
108 |
-
|
109 |
-
if (!(class_exists('FLBuilderModel') && FLBuilderModel::is_builder_active())) {
|
110 |
-
return;
|
111 |
-
}
|
112 |
-
|
113 |
-
wp_enqueue_style(
|
114 |
-
'social-icons-widget-admin',
|
115 |
-
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/css/social-icons-widget-admin.css',
|
116 |
-
array('wpzoom-social-icons-socicon'),
|
117 |
-
filemtime(WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/css/social-icons-widget-admin.css')
|
118 |
-
);
|
119 |
-
|
120 |
-
wp_enqueue_style('wp-color-picker');
|
121 |
-
|
122 |
-
wp_enqueue_script(
|
123 |
-
'iris',
|
124 |
-
admin_url('js/iris.min.js'),
|
125 |
-
array(
|
126 |
-
'jquery-ui-draggable',
|
127 |
-
'jquery-ui-slider',
|
128 |
-
'jquery-touch-punch'
|
129 |
-
),
|
130 |
-
false,
|
131 |
-
1
|
132 |
-
);
|
133 |
-
|
134 |
-
wp_enqueue_script(
|
135 |
-
'wp-color-picker',
|
136 |
-
admin_url('js/color-picker.min.js'),
|
137 |
-
array('iris'),
|
138 |
-
false,
|
139 |
-
1
|
140 |
-
);
|
141 |
-
|
142 |
-
$colorpicker_l10n = array(
|
143 |
-
'clear' => __('Clear'),
|
144 |
-
'defaultString' => __('Default'),
|
145 |
-
'pick' => __('Select Color'),
|
146 |
-
'current' => __('Current Color'),
|
147 |
-
);
|
148 |
-
wp_localize_script(
|
149 |
-
'wp-color-picker',
|
150 |
-
'wpColorPickerL10n',
|
151 |
-
$colorpicker_l10n
|
152 |
-
);
|
153 |
-
|
154 |
-
|
155 |
-
wp_enqueue_media();
|
156 |
-
|
157 |
-
wp_enqueue_script(
|
158 |
-
'zoom-social-icons-widget-vue-js',
|
159 |
-
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/js/vue.min.js',
|
160 |
-
array(),
|
161 |
-
filemtime(WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/js/vue.min.js'),
|
162 |
-
true
|
163 |
-
);
|
164 |
-
|
165 |
-
wp_enqueue_script(
|
166 |
-
'zoom-social-icons-widget-sortable-js',
|
167 |
-
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/js/sortable.min.js',
|
168 |
-
array(),
|
169 |
-
filemtime(WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/js/sortable.min.js'),
|
170 |
-
true
|
171 |
-
);
|
172 |
-
|
173 |
-
wp_enqueue_script(
|
174 |
-
'zoom-social-icons-widget-vue-sortable-js',
|
175 |
-
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/js/vue-sortable.js',
|
176 |
-
array('zoom-social-icons-widget-sortable-js'),
|
177 |
-
filemtime(WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/js/vue-sortable.js'),
|
178 |
-
true
|
179 |
-
);
|
180 |
-
|
181 |
-
wp_enqueue_script(
|
182 |
-
'zoom-social-icons-widget-uri-js',
|
183 |
-
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/js/URI.min.js',
|
184 |
-
array(),
|
185 |
-
filemtime(WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/js/URI.min.js'),
|
186 |
-
true
|
187 |
-
);
|
188 |
-
|
189 |
-
wp_enqueue_script(
|
190 |
-
'zoom-social-icons-widget-scroll-to',
|
191 |
-
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/js/jquery.scrollTo.min.js',
|
192 |
-
array('jquery'),
|
193 |
-
filemtime(WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/js/jquery.scrollTo.min.js'),
|
194 |
-
true
|
195 |
-
);
|
196 |
-
|
197 |
-
wp_enqueue_script(
|
198 |
-
'zoom-social-icons-widget',
|
199 |
-
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/js/social-icons-widget-backend.js',
|
200 |
-
array(
|
201 |
-
'jquery',
|
202 |
-
'underscore',
|
203 |
-
'wp-util',
|
204 |
-
'wp-color-picker'
|
205 |
-
),
|
206 |
-
filemtime(WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/js/social-icons-widget-backend.js'),
|
207 |
-
true
|
208 |
-
);
|
209 |
-
|
210 |
-
wp_localize_script('zoom-social-icons-widget', 'zoom_social_widget_data', array(
|
211 |
-
'icons' => $this->get_icons_pack(),
|
212 |
-
'categories' => $this->get_icon_categories()
|
213 |
-
));
|
214 |
-
|
215 |
-
}
|
216 |
-
|
217 |
-
/**
|
218 |
-
* Enqueue admin javascript only on widgets and customizer pages.
|
219 |
-
*/
|
220 |
-
public function check_current_screen() {
|
221 |
-
$current_screen = get_current_screen();
|
222 |
-
|
223 |
-
if ( ! empty( $current_screen->id ) &&
|
224 |
-
( $current_screen->id === 'widgets' ||
|
225 |
-
$current_screen->id === 'appearance_page_gutenberg-widgets' ||
|
226 |
-
$current_screen->id === 'customize' ) ) {
|
227 |
-
add_action( 'admin_enqueue_scripts', array( $this, 'admin_scripts' ) );
|
228 |
-
add_action( 'admin_print_footer_scripts', array( $this, 'admin_js_templates' ) );
|
229 |
-
}
|
230 |
-
}
|
231 |
-
|
232 |
-
/**
|
233 |
-
* JavaScript templates for back-end widget form.
|
234 |
-
*/
|
235 |
-
public function admin_js_templates()
|
236 |
-
{
|
237 |
-
?>
|
238 |
-
<script type="text/x-template" id="tmpl-zoom-social-modal"><?php $this->get_modal_template(); ?></script>
|
239 |
-
<?php
|
240 |
-
}
|
241 |
-
|
242 |
-
/**
|
243 |
-
* Modal template render function.
|
244 |
-
*/
|
245 |
-
public function get_modal_template()
|
246 |
-
{
|
247 |
-
?>
|
248 |
-
<div class="modal-mask">
|
249 |
-
<div class="media-modal wp-core-ui zoom-social-modal-wrapper">
|
250 |
-
<button type="button" class="media-modal-close" @click="$emit('close')"><span
|
251 |
-
class="media-modal-icon"><span class="screen-reader-text">Close media panel</span></span>
|
252 |
-
</button>
|
253 |
-
<div class="media-modal-content" ref="mediaModal">
|
254 |
-
|
255 |
-
<div class="zoom-social-modal-title">
|
256 |
-
<slot name="header">
|
257 |
-
<h3><?php _e('Select Icon', 'zoom-social-icons-widget') ?></h3>
|
258 |
-
</slot>
|
259 |
-
</div>
|
260 |
-
|
261 |
-
<div class="zoom-social-modal-content">
|
262 |
-
<slot name="body">
|
263 |
-
|
264 |
-
<div class="zoom-social-modal-form">
|
265 |
-
<div class="form-group">
|
266 |
-
<div class="wrap-label">
|
267 |
-
<label><?php _e('Choose icon color', 'zoom-social-icons-widget') ?></label>
|
268 |
-
|
269 |
-
</div>
|
270 |
-
<div class="wrap-input wrap-input-color-picker">
|
271 |
-
<input type="text" class="zoom-social-icons__field-color-picker"
|
272 |
-
name="zoom-social-icons__field-color-picker"
|
273 |
-
v-model="modal_color_picker" :value="modal_color_picker">
|
274 |
-
</div>
|
275 |
-
</div>
|
276 |
-
<div class="form-group">
|
277 |
-
<div class="wrap-label">
|
278 |
-
<label><?php _e('Choose hover color', 'zoom-social-icons-widget') ?></label>
|
279 |
-
|
280 |
-
</div>
|
281 |
-
<div class="wrap-input wrap-input-color-picker-hover">
|
282 |
-
<input type="text" class="zoom-social-icons__field-color-picker"
|
283 |
-
name="zoom-social-icons__field-color-picker-hover"
|
284 |
-
v-model="modal_color_picker_hover" :value="modal_color_picker_hover">
|
285 |
-
</div>
|
286 |
-
</div>
|
287 |
-
<div class="form-group">
|
288 |
-
<div class="wrap-label">
|
289 |
-
<label><?php _e('Select Icon Kit', 'zoom-social-icons-widget') ?></label>
|
290 |
-
</div>
|
291 |
-
<div class="wrap-input">
|
292 |
-
<select v-model='modal_icon_kit' class="zoom-social-icons__field-icon-kit"
|
293 |
-
name="zoom-social-icons__field-icon-kit">
|
294 |
-
<?php $icons_kits = zoom_social_icons_kits_categories_list();
|
295 |
-
foreach ( $icons_kits as $icon_kit ): ?>
|
296 |
-
<option value="<?php echo $icon_kit['value'] ?>"><?php echo $icon_kit['label'] ?></option>
|
297 |
-
<?php endforeach; ?>
|
298 |
-
</select>
|
299 |
-
<select v-model="modal_icon_kit_category">
|
300 |
-
<option v-for="cat in getIconCategories" :value="cat">{{cat | spacify |
|
301 |
-
capitalize }}
|
302 |
-
</option>
|
303 |
-
</select>
|
304 |
-
</div>
|
305 |
-
</div>
|
306 |
-
|
307 |
-
<div class='modal-icons-wrapper'>
|
308 |
-
<template v-for="(icons_kit, icon_type) in filterBySocicons">
|
309 |
-
<p v-show="searchIconsLength && icons_kit.length ">{{ icon_type | humanizeIconType | capitalize }}</p>
|
310 |
-
<div
|
311 |
-
v-show=" modal_icon_kit == icon_type || searchIconsLength && icons_kit.length "
|
312 |
-
class="icon-kit" :class="[icon_type+'-wrapper']">
|
313 |
-
<span
|
314 |
-
:style="normalizeStyle(icon.icon, icon_type)"
|
315 |
-
:data-icon="icon.icon"
|
316 |
-
:data-kit="icon_type"
|
317 |
-
@click="clickOnIcon"
|
318 |
-
@mouseover="overOnIcon"
|
319 |
-
@mouseleave="leaveOnIcon"
|
320 |
-
v-for="(icon, icon_key) in icons_kit"
|
321 |
-
:class='["zoom-social-icons__single-element social-icon" ,icon_type , icon_type+"-"+icon.icon, icon_canvas_style, {selected : icon.icon === modal_icon && icon_type === modal_icon_kit }]'
|
322 |
-
></span>
|
323 |
-
</div>
|
324 |
-
</template>
|
325 |
-
</div>
|
326 |
-
|
327 |
-
|
328 |
-
<input type="hidden" v-model="modal_icon" name="zoom-social-icons__field-icon"
|
329 |
-
class="zoom-social-icons__field-icon"/>
|
330 |
-
</div>
|
331 |
-
</slot>
|
332 |
-
</div>
|
333 |
-
|
334 |
-
<div class="zoom-social-modal-toolbar">
|
335 |
-
<slot name="footer">
|
336 |
-
<input class="search-action-input" style="width: 50%; float: left;" type="text"
|
337 |
-
v-model='searchIcons' placeholder="Type to search icon"/>
|
338 |
-
<a href='#' class="button-primary zoom-social-modal-save-btn" @click.prevent="saveModal">Save</a>
|
339 |
-
</slot>
|
340 |
-
</div>
|
341 |
-
</div>
|
342 |
-
</div>
|
343 |
-
</div>
|
344 |
-
<?php
|
345 |
-
}
|
346 |
-
|
347 |
-
/**
|
348 |
-
* Included styles and js files in the backend part.
|
349 |
-
*/
|
350 |
-
public function admin_scripts()
|
351 |
-
{
|
352 |
-
|
353 |
-
wp_enqueue_style(
|
354 |
-
'wpzoom-social-icons-socicon',
|
355 |
-
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/css/wpzoom-socicon.css',
|
356 |
-
array(),
|
357 |
-
filemtime(WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/css/wpzoom-socicon.css')
|
358 |
-
);
|
359 |
-
|
360 |
-
wp_enqueue_style(
|
361 |
-
'wpzoom-social-icons-styles',
|
362 |
-
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/css/wpzoom-social-icons-styles.css',
|
363 |
-
array(),
|
364 |
-
filemtime(WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/css/wpzoom-social-icons-styles.css')
|
365 |
-
);
|
366 |
-
|
367 |
-
wp_enqueue_style(
|
368 |
-
'wpzoom-social-icons-admin',
|
369 |
-
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/css/social-icons-widget-admin.css',
|
370 |
-
array('wpzoom-social-icons-socicon'),
|
371 |
-
filemtime(WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/css/social-icons-widget-admin.css')
|
372 |
-
|
373 |
-
);
|
374 |
-
|
375 |
-
wp_enqueue_style(
|
376 |
-
'wpzoom-social-icons-genericons',
|
377 |
-
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/css/genericons.css',
|
378 |
-
array(),
|
379 |
-
filemtime(WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/css/genericons.css')
|
380 |
-
|
381 |
-
);
|
382 |
-
|
383 |
-
wp_enqueue_style(
|
384 |
-
'wpzoom-social-icons-academicons',
|
385 |
-
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/css/academicons.min.css',
|
386 |
-
array(),
|
387 |
-
filemtime(WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/css/academicons.min.css')
|
388 |
-
|
389 |
-
);
|
390 |
-
|
391 |
-
wp_enqueue_style(
|
392 |
-
'wpzoom-social-icons-fontawesome-3',
|
393 |
-
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/css/font-awesome-3.min.css',
|
394 |
-
array(),
|
395 |
-
filemtime(WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/css/font-awesome-3.min.css')
|
396 |
-
|
397 |
-
);
|
398 |
-
|
399 |
-
wp_enqueue_style('dashicons');
|
400 |
-
wp_enqueue_style('wp-color-picker');
|
401 |
-
wp_enqueue_media();
|
402 |
-
|
403 |
-
wp_enqueue_script(
|
404 |
-
'wpzoom-social-icons-vue-js',
|
405 |
-
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/js/vue.min.js',
|
406 |
-
array(),
|
407 |
-
filemtime(WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/js/vue.min.js'),
|
408 |
-
true
|
409 |
-
);
|
410 |
-
|
411 |
-
wp_enqueue_script(
|
412 |
-
'wpzoom-social-icons-sortable-js',
|
413 |
-
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/js/sortable.min.js',
|
414 |
-
array(),
|
415 |
-
filemtime(WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/js/sortable.min.js'),
|
416 |
-
true
|
417 |
-
);
|
418 |
-
|
419 |
-
wp_enqueue_script(
|
420 |
-
'wpzoom-social-icons-vue-sortable-js',
|
421 |
-
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/js/vue-sortable.js',
|
422 |
-
array(),
|
423 |
-
filemtime(WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/js/vue-sortable.js'),
|
424 |
-
true
|
425 |
-
);
|
426 |
-
|
427 |
-
wp_enqueue_script(
|
428 |
-
'wpzoom-social-icons-uri-js',
|
429 |
-
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/js/URI.min.js',
|
430 |
-
array(),
|
431 |
-
filemtime(WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/js/URI.min.js'),
|
432 |
-
true
|
433 |
-
);
|
434 |
-
|
435 |
-
wp_enqueue_script(
|
436 |
-
'wpzoom-social-icons-scroll-to',
|
437 |
-
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/js/jquery.scrollTo.min.js',
|
438 |
-
array('jquery'),
|
439 |
-
filemtime(WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/js/jquery.scrollTo.min.js'),
|
440 |
-
true
|
441 |
-
);
|
442 |
-
|
443 |
-
wp_enqueue_script(
|
444 |
-
'wpzoom-social-icons-widget',
|
445 |
-
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/js/social-icons-widget-backend.js',
|
446 |
-
array('jquery', 'underscore', 'wp-util', 'wp-color-picker'),
|
447 |
-
filemtime(WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/js/social-icons-widget-backend.js'),
|
448 |
-
true
|
449 |
-
);
|
450 |
-
|
451 |
-
wp_localize_script(
|
452 |
-
'wpzoom-social-icons-widget',
|
453 |
-
'zoom_social_widget_data',
|
454 |
-
[
|
455 |
-
'icons' => $this->get_icons_pack(),
|
456 |
-
'categories' => $this->get_icon_categories()
|
457 |
-
]
|
458 |
-
);
|
459 |
-
|
460 |
-
}
|
461 |
-
|
462 |
-
/**
|
463 |
-
* Get icons pack by its name by default return all packs.
|
464 |
-
*
|
465 |
-
* @param string $type
|
466 |
-
*
|
467 |
-
* @return array
|
468 |
-
*/
|
469 |
-
public function get_icons_pack($type = 'all')
|
470 |
-
{
|
471 |
-
|
472 |
-
return array_key_exists($type, $this->icons) ? $this->icons[$type] : $this->icons;
|
473 |
-
}
|
474 |
-
|
475 |
-
/**
|
476 |
-
* Get icons pack categories.
|
477 |
-
*
|
478 |
-
* @return array
|
479 |
-
*/
|
480 |
-
public function get_icon_categories()
|
481 |
-
{
|
482 |
-
return apply_filters('zoom_social_icons_get_icon_categories',
|
483 |
-
array(
|
484 |
-
'socicon' =>
|
485 |
-
array(
|
486 |
-
'all',
|
487 |
-
'audio',
|
488 |
-
'blogging',
|
489 |
-
'communication',
|
490 |
-
'design',
|
491 |
-
'ecommerce',
|
492 |
-
'games',
|
493 |
-
'learning',
|
494 |
-
'music',
|
495 |
-
'news',
|
496 |
-
'payment',
|
497 |
-
'photography',
|
498 |
-
'programming',
|
499 |
-
'search-engines',
|
500 |
-
'social-media',
|
501 |
-
'software',
|
502 |
-
'travel',
|
503 |
-
'video',
|
504 |
-
'web-tools'
|
505 |
-
),
|
506 |
-
'dashicons' =>
|
507 |
-
array(
|
508 |
-
'all',
|
509 |
-
'admin-menu',
|
510 |
-
'image-editing',
|
511 |
-
'media',
|
512 |
-
'misc',
|
513 |
-
'notifications',
|
514 |
-
'post-formats',
|
515 |
-
'posts-screen',
|
516 |
-
'products',
|
517 |
-
'social',
|
518 |
-
'sorting',
|
519 |
-
'taxonomies',
|
520 |
-
'tinymce',
|
521 |
-
'welcome-screen',
|
522 |
-
'widgets',
|
523 |
-
'wordpress-specific'
|
524 |
-
),
|
525 |
-
'genericon' =>
|
526 |
-
array(
|
527 |
-
'all',
|
528 |
-
),
|
529 |
-
'academicons' =>
|
530 |
-
array(
|
531 |
-
'all',
|
532 |
-
),
|
533 |
-
'fa' =>
|
534 |
-
array(
|
535 |
-
'accessibility',
|
536 |
-
'all',
|
537 |
-
'brand',
|
538 |
-
'chart',
|
539 |
-
'currency',
|
540 |
-
'directional',
|
541 |
-
'file-type',
|
542 |
-
'form-control',
|
543 |
-
'gender',
|
544 |
-
'hand',
|
545 |
-
'medical',
|
546 |
-
'payment',
|
547 |
-
'spinner',
|
548 |
-
'text-editor',
|
549 |
-
'transportation',
|
550 |
-
'video-player',
|
551 |
-
'web-application',
|
552 |
-
)
|
553 |
-
));
|
554 |
-
}
|
555 |
-
|
556 |
-
/**
|
557 |
-
* Sanitize widget form values as they are saved.
|
558 |
-
*
|
559 |
-
* @see WP_Widget::update()
|
560 |
-
*
|
561 |
-
* @param array $new_instance Values just sent to be saved.
|
562 |
-
* @param array $old_instance Previously saved values from database.
|
563 |
-
*
|
564 |
-
* @return array Updated safe values to be saved.
|
565 |
-
*/
|
566 |
-
public function update($new_instance, $old_instance)
|
567 |
-
{
|
568 |
-
|
569 |
-
$instance['title'] = sanitize_text_field($new_instance['title']);
|
570 |
-
$instance['description'] = balanceTags(wp_kses($new_instance['description'], wp_kses_allowed_html()), true);
|
571 |
-
$instance['show_icon_labels'] = (!empty($new_instance['show_icon_labels']) && $new_instance['show_icon_labels'] === 'true') ? 'true' : 'false';
|
572 |
-
$instance['open_new_tab'] = (!empty($new_instance['open_new_tab']) && $new_instance['open_new_tab'] === 'true') ? 'true' : 'false';
|
573 |
-
$instance['no_follow'] = (!empty($new_instance['no_follow']) && $new_instance['no_follow'] === 'true') ? 'true' : 'false';
|
574 |
-
$instance['no_opener'] = (!empty($new_instance['no_opener']) && $new_instance['no_opener'] === 'true') ? 'true' : 'false';
|
575 |
-
$instance['no_referrer'] = (!empty($new_instance['no_referrer']) && $new_instance['no_referrer'] === 'true') ? 'true' : 'false';
|
576 |
-
$instance['icon_padding_size'] = (int)$new_instance['icon_padding_size'];
|
577 |
-
$instance['icon_font_size'] = (int)$new_instance['icon_font_size'];
|
578 |
-
$instance['global_color_picker'] = $new_instance['global_color_picker'];
|
579 |
-
$instance['global_color_picker_hover'] = $new_instance['global_color_picker_hover'];
|
580 |
-
|
581 |
-
if (in_array($new_instance['icon_style'], array('with-canvas', 'without-canvas'))) {
|
582 |
-
$instance['icon_style'] = $new_instance['icon_style'];
|
583 |
-
}
|
584 |
-
|
585 |
-
if (in_array($new_instance['icon_alignment'], array('left', 'center', 'right', 'none'))) {
|
586 |
-
$instance['icon_alignment'] = $new_instance['icon_alignment'];
|
587 |
-
}
|
588 |
-
|
589 |
-
if (in_array($new_instance['icon_canvas_style'], array('round', 'rounded', 'square'))) {
|
590 |
-
$instance['icon_canvas_style'] = $new_instance['icon_canvas_style'];
|
591 |
-
}
|
592 |
-
|
593 |
-
$field_count = empty($new_instance['url_fields']) ? 0 : count($new_instance['url_fields']);
|
594 |
-
|
595 |
-
$instance['fields'] = array();
|
596 |
-
|
597 |
-
for ($i = 0; $i < $field_count; $i++) {
|
598 |
-
$url = esc_url($new_instance['url_fields'][$i], $this->protocols);
|
599 |
-
$label = esc_html($new_instance['label_fields'][$i]);
|
600 |
-
|
601 |
-
if ($url) {
|
602 |
-
$instance['fields'][] = array(
|
603 |
-
'url' => $url,
|
604 |
-
'label' => $label,
|
605 |
-
'icon' => $new_instance['icon_fields'][$i],
|
606 |
-
'icon_kit' => $new_instance['icon_kit_fields'][$i],
|
607 |
-
'color_picker' => $new_instance['color_picker_fields'][$i],
|
608 |
-
'color_picker_hover' => $new_instance['color_picker_hover_fields'][$i],
|
609 |
-
'aria_label' => !empty($new_instance['aria_label_fields'][$i]) ? $new_instance['aria_label_fields'][$i] : '',
|
610 |
-
// 'is_rel_me' => ( ! empty( $new_instance['is_rel_me_fields'][ $i ] ) && $new_instance['is_rel_me_fields'][ $i ] === 'true' ) ? 'true' : 'false'
|
611 |
-
);
|
612 |
-
}
|
613 |
-
|
614 |
-
/**
|
615 |
-
* Register strings for translation.
|
616 |
-
*/
|
617 |
-
if (function_exists('icl_register_string')) {
|
618 |
-
icl_register_string('zoom-social-icons-widget', 'url-' . $i, $url);
|
619 |
-
}
|
620 |
-
}
|
621 |
-
|
622 |
-
return $instance;
|
623 |
-
}
|
624 |
-
|
625 |
-
/**
|
626 |
-
* Render wigdet form in the backend.
|
627 |
-
*
|
628 |
-
* @param array $instance
|
629 |
-
*
|
630 |
-
* @return void
|
631 |
-
*/
|
632 |
-
public function form($instance)
|
633 |
-
{
|
634 |
-
global $wp_version;
|
635 |
-
|
636 |
-
$defaults = $this->get_defaults();
|
637 |
-
|
638 |
-
if (isset($instance['show-icon-labels']) or
|
639 |
-
isset($instance['open-new-tab']) or
|
640 |
-
isset($instance['no-follow'])
|
641 |
-
) {
|
642 |
-
$instance['show-icon-labels'] = !empty($instance['show-icon-labels']) ? "true" : "false";
|
643 |
-
$instance['open-new-tab'] = !empty($instance['open-new-tab']) ? "true" : "false";
|
644 |
-
$instance['no-follow'] = !empty($instance['no-follow']) ? "true" : "false";
|
645 |
-
}
|
646 |
-
|
647 |
-
$instance = $this->normalize_data_array($instance);
|
648 |
-
$instance = wp_parse_args($instance, $defaults);
|
649 |
-
|
650 |
-
$this->inject_values($instance);
|
651 |
-
|
652 |
-
$instance['fields'] = $this->inject_fields_with_data($instance['fields']);
|
653 |
-
|
654 |
-
$instance_attr = '';
|
655 |
-
$default_field = $this->inject_fields_with_data($this->get_default_field());
|
656 |
-
$default_field = array_pop($default_field);
|
657 |
-
|
658 |
-
if (!empty($instance)) {
|
659 |
-
$encoded = array(
|
660 |
-
'id' => $this->id,
|
661 |
-
'instance' => $instance,
|
662 |
-
'default_field' => $default_field
|
663 |
-
);
|
664 |
-
|
665 |
-
$instance_attr = 'data-instance="' . htmlentities(json_encode($encoded)) . '"';
|
666 |
-
}
|
667 |
-
|
668 |
-
// $transform_to_block = '';
|
669 |
-
// if ( current_theme_supports( 'widgets-block-editor' ) && version_compare( $wp_version, '5.8', '>=' ) ) {
|
670 |
-
// $transform_to_block = sprintf( __('<strong>%s</strong> is currently not supported by the new block-based widget screen in WordPress 5.8. You can edit it in the Customizer or transform it to Social Icons Block by clicking on the calendar icon.
|
671 |
-
// You can also disable the new block-based widget screen by installing the Classic Widget plugin', 'zoom-social-icons-widget'), $this->widget_name);
|
672 |
-
// $transform_to_block .= '(<a href="https://wordpress.org/plugins/classic-widgets/" target="_blank">https://wordpress.org/plugins/classic-widgets/</a>)';
|
673 |
-
// }
|
674 |
-
|
675 |
-
// if ( ! empty( $transform_to_block ) ) {
|
676 |
-
// echo '<p class="notice notice-warning zoom-social-icons__notice">' . wp_kses_post( $transform_to_block ) .'</p>';
|
677 |
-
// return;
|
678 |
-
// }
|
679 |
-
|
680 |
-
?>
|
681 |
-
<div class="form-instance" <?php echo $instance_attr ?> id="<?php echo $this->id ?>">
|
682 |
-
<p>
|
683 |
-
<label for="<?php echo $this->get_field_id('title'); ?>"><?php esc_html_e('Title:', 'zoom-social-icons-widget'); ?></label>
|
684 |
-
<input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" v-model="title"
|
685 |
-
name="<?php echo $this->get_field_name('title'); ?>" type="text"/>
|
686 |
-
</p>
|
687 |
-
|
688 |
-
<p>
|
689 |
-
<label for="<?php echo $this->get_field_id('description'); ?>"><?php esc_html_e('Text above icons:', 'zoom-social-icons-widget'); ?></label>
|
690 |
-
<textarea class="widefat" id="<?php echo $this->get_field_id('description'); ?>"
|
691 |
-
name="<?php echo $this->get_field_name('description'); ?>" cols="20" v-model="description"
|
692 |
-
rows="3"></textarea>
|
693 |
-
</p>
|
694 |
-
|
695 |
-
<p class="description"><?php _e('You can add here a text above the icons. Basic HTML allowed.', 'zoom-social-icons-widget'); ?></p>
|
696 |
-
|
697 |
-
|
698 |
-
<p>
|
699 |
-
<input class="checkbox zoom-social-icons-show-icon-labels"
|
700 |
-
type="checkbox"
|
701 |
-
v-model="show_icon_labels"
|
702 |
-
:true-value="'true'"
|
703 |
-
:false-value="'false'"
|
704 |
-
:value="show_icon_labels"
|
705 |
-
id="<?php echo $this->get_field_id('show_icon_labels'); ?>"
|
706 |
-
name="<?php echo $this->get_field_name('show_icon_labels'); ?>"/>
|
707 |
-
<label
|
708 |
-
for="<?php echo $this->get_field_id('show_icon_labels'); ?>"><?php _e('Show icon labels? ', 'zoom-social-icons-widget'); ?></label>
|
709 |
-
</p>
|
710 |
-
|
711 |
-
<p>
|
712 |
-
<input class="checkbox" type="checkbox"
|
713 |
-
v-model="open_new_tab"
|
714 |
-
:true-value="'true'"
|
715 |
-
:false-value="'false'"
|
716 |
-
:value="open_new_tab"
|
717 |
-
id="<?php echo $this->get_field_id('open_new_tab'); ?>"
|
718 |
-
name="<?php echo $this->get_field_name('open_new_tab'); ?>"/>
|
719 |
-
<label for="<?php echo $this->get_field_id('open_new_tab'); ?>"><?php _e('Open links in new tab? ', 'zoom-social-icons-widget'); ?></label>
|
720 |
-
</p>
|
721 |
-
|
722 |
-
<p>
|
723 |
-
<input class="checkbox" type="checkbox"
|
724 |
-
v-model="no_follow"
|
725 |
-
:true-value="'true'"
|
726 |
-
:false-value="'false'"
|
727 |
-
:value="no_follow"
|
728 |
-
id="<?php echo $this->get_field_id('no_follow'); ?>"
|
729 |
-
name="<?php echo $this->get_field_name('no_follow'); ?>"/>
|
730 |
-
<label
|
731 |
-
for="<?php echo $this->get_field_id('no_follow'); ?>"><?php _e('Add <code>rel="nofollow"</code> to links', 'zoom-social-icons-widget'); ?></label>
|
732 |
-
</p>
|
733 |
-
|
734 |
-
<p>
|
735 |
-
<input class="checkbox" type="checkbox"
|
736 |
-
v-model="no_referrer"
|
737 |
-
:true-value="'true'"
|
738 |
-
:false-value="'false'"
|
739 |
-
:value="no_referrer"
|
740 |
-
id="<?php echo $this->get_field_id('no_referrer'); ?>"
|
741 |
-
name="<?php echo $this->get_field_name('no_referrer'); ?>"/>
|
742 |
-
<label
|
743 |
-
for="<?php echo $this->get_field_id('no_referrer'); ?>"><?php _e('Add <code>rel="noreferrer"</code> to links', 'zoom-social-icons-widget'); ?></label>
|
744 |
-
</p>
|
745 |
-
|
746 |
-
<p>
|
747 |
-
<input class="checkbox" type="checkbox"
|
748 |
-
v-model="no_opener"
|
749 |
-
:true-value="'true'"
|
750 |
-
:false-value="'false'"
|
751 |
-
:value="no_opener"
|
752 |
-
id="<?php echo $this->get_field_id('no_opener'); ?>"
|
753 |
-
name="<?php echo $this->get_field_name('no_opener'); ?>"/>
|
754 |
-
<label
|
755 |
-
for="<?php echo $this->get_field_id('no_opener'); ?>"><?php _e('Add <code>rel="noopener"</code> to links', 'zoom-social-icons-widget'); ?></label>
|
756 |
-
</p>
|
757 |
-
|
758 |
-
<p class="description"><?php _e('Recommended if links or icons open in a new tab', 'zoom-social-icons-widget'); ?></p>
|
759 |
-
|
760 |
-
|
761 |
-
<p>
|
762 |
-
<label
|
763 |
-
for="<?php echo $this->get_field_id('icon_alignment'); ?>"><?php _e('Icons Alignment:', 'zoom-social-icons-widget'); ?>
|
764 |
-
</label>
|
765 |
-
<select name="<?php echo $this->get_field_name('icon_alignment'); ?>"
|
766 |
-
id="<?php echo $this->get_field_id('icon_alignment'); ?>"
|
767 |
-
v-model="icon_alignment"
|
768 |
-
class="widefat">
|
769 |
-
<option
|
770 |
-
value="none"><?php esc_html_e('None', 'zoom-social-icons-widget'); ?></option>
|
771 |
-
<option
|
772 |
-
value="left"><?php esc_html_e('Align Left', 'zoom-social-icons-widget'); ?></option>
|
773 |
-
<option
|
774 |
-
value="center"><?php esc_html_e('Align Center', 'zoom-social-icons-widget'); ?></option>
|
775 |
-
<option
|
776 |
-
value="right"><?php esc_html_e('Align Right', 'zoom-social-icons-widget'); ?></option>
|
777 |
-
</select>
|
778 |
-
</p>
|
779 |
-
|
780 |
-
<p>
|
781 |
-
<label
|
782 |
-
for="<?php echo $this->get_field_id('icon_style'); ?>"><?php _e('Icon Style:', 'zoom-social-icons-widget'); ?>
|
783 |
-
</label>
|
784 |
-
<select name="<?php echo $this->get_field_name('icon_style'); ?>"
|
785 |
-
id="<?php echo $this->get_field_id('icon_style'); ?>"
|
786 |
-
v-model="icon_style"
|
787 |
-
class="widefat">
|
788 |
-
<option
|
789 |
-
value="with-canvas"><?php esc_html_e('Color Background / White Icon', 'zoom-social-icons-widget'); ?></option>
|
790 |
-
<option
|
791 |
-
value="without-canvas"><?php esc_html_e('Color Icon / No Background', 'zoom-social-icons-widget'); ?></option>
|
792 |
-
</select>
|
793 |
-
</p>
|
794 |
-
|
795 |
-
<p>
|
796 |
-
<label
|
797 |
-
:style="iconCanvasStyleLabel()"
|
798 |
-
for="<?php echo $this->get_field_id('icon_canvas_style'); ?>"><?php _e('Icon Background Style:', 'zoom-social-icons-widget'); ?></label>
|
799 |
-
<select
|
800 |
-
:disabled="this.icon_style == 'without-canvas'"
|
801 |
-
name="<?php echo $this->get_field_name('icon_canvas_style'); ?>"
|
802 |
-
id="<?php echo $this->get_field_id('icon_canvas_style'); ?>"
|
803 |
-
v-model="icon_canvas_style"
|
804 |
-
class="widefat zoom-social-icons-change-icon-canvas-style">
|
805 |
-
<option
|
806 |
-
value="round"><?php esc_html_e('Round', 'zoom-social-icons-widget'); ?></option>
|
807 |
-
<option
|
808 |
-
value="rounded"><?php esc_html_e('Rounded Corners', 'zoom-social-icons-widget'); ?></option>
|
809 |
-
<option
|
810 |
-
value="square"><?php esc_html_e('Square', 'zoom-social-icons-widget'); ?></option>
|
811 |
-
</select>
|
812 |
-
</p>
|
813 |
-
|
814 |
-
<p class="description">
|
815 |
-
<?php echo wp_kses_post(__('This option has no effect if <i>Color Icon / No Background</i> icon style is selected.', 'zoom-social-icons-widget')); ?>
|
816 |
-
</p>
|
817 |
-
|
818 |
-
<p>
|
819 |
-
<label
|
820 |
-
for="<?php echo $this->get_field_id('icon_padding_size') ?>"><?php _e('Icon Padding (pixels):', 'zoom-social-icons-widget') ?>
|
821 |
-
<input type="number" min="0" max="200"
|
822 |
-
id="<?php echo $this->get_field_id('icon_padding_size') ?>"
|
823 |
-
name="<?php echo $this->get_field_name('icon_padding_size') ?>"
|
824 |
-
v-model="icon_padding_size"
|
825 |
-
class="widefat"/>
|
826 |
-
</label>
|
827 |
-
</p>
|
828 |
-
|
829 |
-
<p>
|
830 |
-
<label
|
831 |
-
for="<?php echo $this->get_field_id('icon_font_size') ?>"><?php _e('Icon Size (pixels):', 'zoom-social-icons-widget') ?>
|
832 |
-
<input type="number" min="0" max="200"
|
833 |
-
id="<?php echo $this->get_field_id('icon_font_size') ?>"
|
834 |
-
name="<?php echo $this->get_field_name('icon_font_size') ?>"
|
835 |
-
v-model="icon_font_size"
|
836 |
-
class="widefat"/>
|
837 |
-
</label>
|
838 |
-
</p>
|
839 |
-
|
840 |
-
<p>
|
841 |
-
<label><?php _e('Set color for all icons') ?></label>
|
842 |
-
<div class="wrap-input-color-picker">
|
843 |
-
<input
|
844 |
-
v-model="global_color_picker"
|
845 |
-
type="text"
|
846 |
-
class="zoom-social-icons__field-color-picker"
|
847 |
-
id="<?php echo $this->get_field_id('global_color_picker') ?>"
|
848 |
-
name="<?php echo $this->get_field_name('global_color_picker') ?>"
|
849 |
-
:value="global_color_picker"
|
850 |
-
>
|
851 |
-
</div>
|
852 |
-
</p>
|
853 |
-
<p>
|
854 |
-
<label><?php _e('Set hover color for all icons') ?></label>
|
855 |
-
<div class="wrap-input-color-picker">
|
856 |
-
<input
|
857 |
-
v-model="global_color_picker_hover"
|
858 |
-
type="text"
|
859 |
-
class="zoom-social-icons__field-color-picker"
|
860 |
-
id="<?php echo $this->get_field_id('global_color_picker_hover') ?>"
|
861 |
-
name="<?php echo $this->get_field_name('global_color_picker_hover') ?>"
|
862 |
-
:value="global_color_picker_hover"
|
863 |
-
>
|
864 |
-
</div>
|
865 |
-
</p>
|
866 |
-
<p style="margin-bottom: 0;"><?php _e('Icons:', 'zoom-social-icons-widget'); ?></p>
|
867 |
-
|
868 |
-
<div class="must-remove">
|
869 |
-
<input type="hidden" value="<?php echo $defaults['title'] ?>"
|
870 |
-
id="<?php echo $this->get_field_id('title'); ?>"
|
871 |
-
name="<?php echo $this->get_field_name('title'); ?>"/>
|
872 |
-
<input type="hidden" value="<?php echo $defaults['description'] ?>"
|
873 |
-
id="<?php echo $this->get_field_id('description'); ?>"
|
874 |
-
name="<?php echo $this->get_field_name('description'); ?>"/>
|
875 |
-
<input type='hidden' value="<?php echo $defaults['open_new_tab'] ?>"
|
876 |
-
id="<?php echo $this->get_field_id('open_new_tab'); ?>"
|
877 |
-
name="<?php echo $this->get_field_name('open_new_tab'); ?>"/>
|
878 |
-
<input type='hidden' value="<?php echo $defaults['icon_alignment'] ?>"
|
879 |
-
id="<?php echo $this->get_field_id('icon_alignment'); ?>"
|
880 |
-
name="<?php echo $this->get_field_name('icon_alignment'); ?>"/>
|
881 |
-
<input type='hidden' value="<?php echo $defaults['no_follow'] ?>"
|
882 |
-
id="<?php echo $this->get_field_id('no_follow'); ?>"
|
883 |
-
name="<?php echo $this->get_field_name('no_follow'); ?>"/>
|
884 |
-
<input type='hidden' value="<?php echo $defaults['no_opener'] ?>"
|
885 |
-
id="<?php echo $this->get_field_id('no_opener'); ?>"
|
886 |
-
name="<?php echo $this->get_field_name('no_opener'); ?>"/>
|
887 |
-
<input type='hidden' value="<?php echo $defaults['no_referrer'] ?>"
|
888 |
-
id="<?php echo $this->get_field_id('no_referrer'); ?>"
|
889 |
-
name="<?php echo $this->get_field_name('no_referrer'); ?>"/>
|
890 |
-
|
891 |
-
<input type='hidden' value="<?php echo $defaults['show_icon_labels'] ?>"
|
892 |
-
id="<?php echo $this->get_field_id('show_icon_labels'); ?>"
|
893 |
-
name="<?php echo $this->get_field_name('show_icon_labels'); ?>"/>
|
894 |
-
<?php
|
895 |
-
|
896 |
-
foreach ($instance['fields'] as $field) {
|
897 |
-
printf('<input type="hidden" id="%1$s" name="%2$s" value="%3$s">',
|
898 |
-
$field['url_field_id'],
|
899 |
-
$field['url_field_name'],
|
900 |
-
esc_attr($field['url'])
|
901 |
-
);
|
902 |
-
|
903 |
-
printf('<input type="hidden" id="%1$s" name="%2$s" value="%3$s">',
|
904 |
-
$field['label_field_id'],
|
905 |
-
$field['label_field_name'],
|
906 |
-
esc_attr($field['label'])
|
907 |
-
);
|
908 |
-
|
909 |
-
printf('<input type="hidden" id="%1$s" name="%2$s" value="%3$s">',
|
910 |
-
$field['color_picker_field_id'],
|
911 |
-
$field['color_picker_field_name'],
|
912 |
-
esc_attr($field['color_picker'])
|
913 |
-
);
|
914 |
-
|
915 |
-
printf('<input type="hidden" id="%1$s" name="%2$s" value="%3$s">',
|
916 |
-
$field['color_picker_hover_field_id'],
|
917 |
-
$field['color_picker_hover_field_name'],
|
918 |
-
esc_attr($field['color_picker_hover'])
|
919 |
-
);
|
920 |
-
|
921 |
-
printf('<input type="hidden" id="%1$s" name="%2$s" value="%3$s">',
|
922 |
-
$field['icon_field_id'],
|
923 |
-
$field['icon_field_name'],
|
924 |
-
esc_attr($field['icon'])
|
925 |
-
);
|
926 |
-
|
927 |
-
printf('<input type="hidden" id="%1$s" name="%2$s" value="%3$s">',
|
928 |
-
$field['icon_kit_field_id'],
|
929 |
-
$field['icon_kit_field_name'],
|
930 |
-
esc_attr($field['icon_kit'])
|
931 |
-
);
|
932 |
-
|
933 |
-
}
|
934 |
-
?>
|
935 |
-
</div>
|
936 |
-
|
937 |
-
<ul v-sortable="{ handle: '.zoom-social-icons__field-handle', onUpdate : onUpdate }"
|
938 |
-
class="zoom-social-icons__list"
|
939 |
-
:class="{ 'zoom-social-icons__list--no-labels' : show_icon_labels !== 'true' }">
|
940 |
-
|
941 |
-
<template v-for="(field, key) in fields">
|
942 |
-
|
943 |
-
<li class="zoom-social-icons__field">
|
944 |
-
|
945 |
-
<modal
|
946 |
-
ref="modals"
|
947 |
-
@input='onInputModal'
|
948 |
-
@keyup.esc.stop="closeModal(key)"
|
949 |
-
@close='closeModal(key)'
|
950 |
-
v-if='field.show_modal'
|
951 |
-
:field_key="key"
|
952 |
-
:icon="field.icon"
|
953 |
-
:icon_style="icon_style"
|
954 |
-
:icon_canvas_style="icon_canvas_style"
|
955 |
-
:icon_kit="field.icon_kit"
|
956 |
-
:color_picker="field.color_picker"
|
957 |
-
:color_picker_hover="field.color_picker_hover"
|
958 |
-
:icon_categories='icons.categories'
|
959 |
-
:icons="icons.icons">
|
960 |
-
</modal>
|
961 |
-
|
962 |
-
<span class="dashicons dashicons-sort zoom-social-icons__field-handle"></span>
|
963 |
-
<span class="zoom-social-icons__field-icon-handler social-icon"
|
964 |
-
:style="normalizeStyle(key)"
|
965 |
-
:class="[ field.icon_kit, field.icon_kit+'-'+field.icon, icon_canvas_style]"
|
966 |
-
@mouseover='mouseoverIcon(key, $event)'
|
967 |
-
@mouseleave='mouseleaveIcon(key, $event)'
|
968 |
-
@click.stop="clickonIconHandler(key)"></span>
|
969 |
-
<div class="zoom-social-icons__cw">
|
970 |
-
<div class="zoom-social-icons__inputs" ref="inputFields">
|
971 |
-
|
972 |
-
<input class="widefat zoom-social-icons__field-url"
|
973 |
-
:id="field.url_field_id"
|
974 |
-
:name="field.url_field_name"
|
975 |
-
v-model="field.url"
|
976 |
-
type="text"
|
977 |
-
:value="field.url_field_name"
|
978 |
-
@input="urlFieldNameHandler(key)"
|
979 |
-
@keyup.enter.stop="insertField"
|
980 |
-
placeholder="<?php _e('Start typing the URL...', 'zoom-social-icons-widget') ?>">
|
981 |
-
<input class="widefat zoom-social-icons__field-label"
|
982 |
-
:id="field.label_field_id"
|
983 |
-
:name="field.label_field_name"
|
984 |
-
v-model="field.label"
|
985 |
-
type="text"
|
986 |
-
:value="field.label_field_name"
|
987 |
-
placeholder="<?php _e('Label', 'zoom-social-icons-widget') ?>">
|
988 |
-
<input type="hidden"
|
989 |
-
:id="field.color_picker_field_id"
|
990 |
-
:name="field.color_picker_field_name"
|
991 |
-
v-model='field.color_picker'
|
992 |
-
:value="field.color_picker">
|
993 |
-
<input type="hidden"
|
994 |
-
:id="field.color_picker_hover_field_id"
|
995 |
-
:name="field.color_picker_hover_field_name"
|
996 |
-
v-model='field.color_picker_hover'
|
997 |
-
:value="field.color_picker_hover">
|
998 |
-
<input type="hidden"
|
999 |
-
:id="field.icon_field_id"
|
1000 |
-
:name="field.icon_field_name"
|
1001 |
-
v-model="field.icon"
|
1002 |
-
:value="field.icon">
|
1003 |
-
<input type="hidden"
|
1004 |
-
:id="field.icon_kit_field_id"
|
1005 |
-
:name="field.icon_kit_field_name"
|
1006 |
-
v-model="field.icon_kit"
|
1007 |
-
:value="field.icon_kit">
|
1008 |
-
</div>
|
1009 |
-
</div>
|
1010 |
-
|
1011 |
-
|
1012 |
-
<a v-show='fields.length > 1' class="zoom-social-icons__field-trash" href="#"
|
1013 |
-
@click.prevent="clickOnDeleteIconHandler(key)"><span
|
1014 |
-
class="dashicons dashicons-trash"></span></a>
|
1015 |
-
<span :class="toggleExtraOptionsClass(key)"
|
1016 |
-
@click.prevent='toggleExtraOptions(key, field)'></span>
|
1017 |
-
<br style="clear:both">
|
1018 |
-
<div class="extra-options" v-show="field.show_extra_options == true">
|
1019 |
-
<p>
|
1020 |
-
<label :for="field.aria_label_field_id">
|
1021 |
-
<?php _e('<code>"aria-label"</code> description', 'zoom-social-icons-widget'); ?>
|
1022 |
-
<input class="widefat"
|
1023 |
-
:id="field.aria_label_field_id"
|
1024 |
-
:name="field.aria_label_field_name" v-model="field.aria_label" type="text"
|
1025 |
-
:value="field.aria_label_field_name">
|
1026 |
-
</label>
|
1027 |
-
</p>
|
1028 |
-
|
1029 |
-
<p class="description">
|
1030 |
-
<?php echo wp_kses_post(__('This is used to provide a description of this icon to screen reader users (for accessibility purposes).', 'zoom-social-icons-widget')); ?>
|
1031 |
-
</p>
|
1032 |
-
|
1033 |
-
<?php /* <p>
|
1034 |
-
<input type="hidden"
|
1035 |
-
:true-value="'true'"
|
1036 |
-
:false-value="'false'"
|
1037 |
-
:value="field.is_rel_me"
|
1038 |
-
v-model="field.is_rel_me"
|
1039 |
-
:name="field.is_rel_me_field_name"/>
|
1040 |
-
<input class="checkbox" type="checkbox"
|
1041 |
-
v-model="field.is_rel_me"
|
1042 |
-
:true-value="'true'"
|
1043 |
-
:false-value="'false'"
|
1044 |
-
:id="field.is_rel_me_field_id"
|
1045 |
-
:value="field.is_rel_me"/>
|
1046 |
-
<label
|
1047 |
-
:for="field.is_rel_me_field_id"><?php _e( 'Add <code>rel="me"</code>?', 'zoom-social-icons-widget' ); ?></label>
|
1048 |
-
</p>
|
1049 |
-
*/ ?>
|
1050 |
-
|
1051 |
-
</div>
|
1052 |
-
</li>
|
1053 |
-
|
1054 |
-
</template>
|
1055 |
-
|
1056 |
-
</ul>
|
1057 |
-
|
1058 |
-
<div class="zoom-social-icons__add-button">
|
1059 |
-
<a @click.prevent='insertField'
|
1060 |
-
class="button"><?php _e('Add more', 'zoom-social-icons-widget'); ?></a>
|
1061 |
-
</div>
|
1062 |
-
|
1063 |
-
<p class="description">
|
1064 |
-
<?php echo wp_kses_post(__('To add an icon with an email address, use the <strong><em>mailto:mail@example.com</em></strong> format.', 'zoom-social-icons-widget')); ?>
|
1065 |
-
</p>
|
1066 |
-
|
1067 |
-
<p class="description">
|
1068 |
-
<?php echo wp_kses_post(__('Note that icons above is not how they will look on front-end. This is just for reference.', 'zoom-social-icons-widget')); ?>
|
1069 |
-
</p>
|
1070 |
-
</div>
|
1071 |
-
<?php
|
1072 |
-
}
|
1073 |
-
|
1074 |
-
/**
|
1075 |
-
* Get default values for the first render when nothing is saved in databases.
|
1076 |
-
*
|
1077 |
-
* @return array
|
1078 |
-
*/
|
1079 |
-
public function get_defaults()
|
1080 |
-
{
|
1081 |
-
return apply_filters('zoom_social_icons_get_defaults', array(
|
1082 |
-
'title' => esc_html__('Follow us', 'zoom-social-icons-widget'),
|
1083 |
-
'description' => '',
|
1084 |
-
'show_icon_labels' => 'false',
|
1085 |
-
'open_new_tab' => 'true',
|
1086 |
-
'no_follow' => 'false',
|
1087 |
-
'no_opener' => 'false',
|
1088 |
-
'no_referrer' => 'false',
|
1089 |
-
'icon_style' => 'with-canvas',
|
1090 |
-
'icon_alignment' => 'none',
|
1091 |
-
'icon_canvas_style' => 'round',
|
1092 |
-
'icon_padding_size' => 8,
|
1093 |
-
'icon_font_size' => 18,
|
1094 |
-
'global_color_picker' => '#1e73be',
|
1095 |
-
'global_color_picker_hover' => '#1e73be',
|
1096 |
-
'fields' => array(
|
1097 |
-
array(
|
1098 |
-
'url' => 'https://facebook.com/',
|
1099 |
-
'label' => 'Facebook',
|
1100 |
-
'icon' => 'facebook',
|
1101 |
-
'icon_kit' => 'socicon',
|
1102 |
-
'color_picker' => '#1877F2',
|
1103 |
-
'color_picker_hover' => '#1877F2',
|
1104 |
-
'aria_label' => '',
|
1105 |
-
// 'is_rel_me' => 'false'
|
1106 |
-
),
|
1107 |
-
array(
|
1108 |
-
'url' => 'https://twitter.com/',
|
1109 |
-
'label' => 'Twitter',
|
1110 |
-
'icon' => 'twitter',
|
1111 |
-
'icon_kit' => 'socicon',
|
1112 |
-
'color_picker' => '#1da1f2',
|
1113 |
-
'color_picker_hover' => '#1da1f2',
|
1114 |
-
'aria_label' => '',
|
1115 |
-
// 'is_rel_me' => 'false'
|
1116 |
-
|
1117 |
-
),
|
1118 |
-
array(
|
1119 |
-
'url' => 'https://instagram.com/',
|
1120 |
-
'label' => 'Instagram',
|
1121 |
-
'icon' => 'instagram',
|
1122 |
-
'icon_kit' => 'socicon',
|
1123 |
-
'color_picker' => '#e4405f',
|
1124 |
-
'color_picker_hover' => '#e4405f',
|
1125 |
-
'aria_label' => '',
|
1126 |
-
// 'is_rel_me' => 'false'
|
1127 |
-
),
|
1128 |
-
)
|
1129 |
-
)
|
1130 |
-
);
|
1131 |
-
}
|
1132 |
-
|
1133 |
-
/**
|
1134 |
-
* Recursive function that replace kebab-case keys with snake_case keys for backward compatibility.
|
1135 |
-
*
|
1136 |
-
* @param $value
|
1137 |
-
*
|
1138 |
-
* @return array
|
1139 |
-
*/
|
1140 |
-
public function normalize_data_array( $value ) {
|
1141 |
-
|
1142 |
-
$collector = [];
|
1143 |
-
|
1144 |
-
if ( empty( $value ) ) {
|
1145 |
-
return $collector;
|
1146 |
-
}
|
1147 |
-
|
1148 |
-
foreach ( $value as $val_key => $val ) {
|
1149 |
-
if ( is_array( $val ) ) {
|
1150 |
-
$val = $this->normalize_data_array( $val );
|
1151 |
-
}
|
1152 |
-
$collector[ str_replace( '-', '_', $val_key ) ] = $val;
|
1153 |
-
}
|
1154 |
-
|
1155 |
-
return $collector;
|
1156 |
-
}
|
1157 |
-
|
1158 |
-
/**
|
1159 |
-
* It is a function for backward compatibility that normalize data values between old and new version
|
1160 |
-
* in order to work properly after users will make an update to the new version.
|
1161 |
-
*
|
1162 |
-
* @param $data
|
1163 |
-
*/
|
1164 |
-
public function inject_values(&$data)
|
1165 |
-
{
|
1166 |
-
$socicons = wp_list_pluck($this->icons['socicon'], 'color', 'icon');
|
1167 |
-
foreach ($data['fields'] as &$field) {
|
1168 |
-
|
1169 |
-
$get_icon = $this->get_icon($field['url']);
|
1170 |
-
$parsed_icon = empty($get_icon) ? 'wordpress' : $get_icon;
|
1171 |
-
|
1172 |
-
if (empty($field['icon']) && empty($field['icon_kit'])) {
|
1173 |
-
$field['icon'] = $parsed_icon;
|
1174 |
-
$field['icon_kit'] = 'socicon';
|
1175 |
-
|
1176 |
-
$field['color_picker'] = $socicons[$parsed_icon];
|
1177 |
-
$field['color_picker_hover'] = $socicons[$parsed_icon];
|
1178 |
-
}
|
1179 |
-
|
1180 |
-
if (empty($field['color_picker']) or (strpos($field['color_picker'], 'rgb') !== false)) {
|
1181 |
-
|
1182 |
-
$color = empty($field['color_picker']) ? $socicons[$parsed_icon] : $this->rgb2hex($field['color_picker']);
|
1183 |
-
$field['color_picker'] = $color;
|
1184 |
-
$field['color_picker_hover'] = $color;
|
1185 |
-
}
|
1186 |
-
|
1187 |
-
if (empty($field['color_picker_hover'])) {
|
1188 |
-
$field['color_picker_hover'] = $field['color_picker'];
|
1189 |
-
}
|
1190 |
-
}
|
1191 |
-
}
|
1192 |
-
|
1193 |
-
/**
|
1194 |
-
* Parse icon name from an url and return it.
|
1195 |
-
*
|
1196 |
-
* @param $url
|
1197 |
-
*
|
1198 |
-
* @return mixed|void
|
1199 |
-
*/
|
1200 |
-
protected function get_icon($url)
|
1201 |
-
{
|
1202 |
-
$icon = '';
|
1203 |
-
$parsed_url = $this->extract_domain($url);
|
1204 |
-
if ($url) {
|
1205 |
-
if (strstr($url, 'feedburner.google.com')
|
1206 |
-
or strstr($url, 'mailto:')
|
1207 |
-
) {
|
1208 |
-
$icon = 'mail';
|
1209 |
-
}
|
1210 |
-
if (strstr($url, 'feedburner.com')) {
|
1211 |
-
$icon = 'rss';
|
1212 |
-
}
|
1213 |
-
if (!$icon) {
|
1214 |
-
$icons = wp_list_pluck($this->icons['socicon'], 'icon');
|
1215 |
-
foreach ($icons as $icon_id) {
|
1216 |
-
if (strstr($parsed_url, $icon_id)) {
|
1217 |
-
$icon = $icon_id;
|
1218 |
-
break;
|
1219 |
-
}
|
1220 |
-
}
|
1221 |
-
}
|
1222 |
-
}
|
1223 |
-
|
1224 |
-
return apply_filters('zoom-social-icons-widget-icon', $icon, $url);
|
1225 |
-
}
|
1226 |
-
|
1227 |
-
/**
|
1228 |
-
* Extract domain from an url.
|
1229 |
-
*
|
1230 |
-
* @param $url
|
1231 |
-
*
|
1232 |
-
* @return mixed
|
1233 |
-
*/
|
1234 |
-
public function extract_domain($url)
|
1235 |
-
{
|
1236 |
-
$parsed_url = parse_url(trim($url));
|
1237 |
-
$path = empty($parsed_url['path']) ? array($url) : explode('/', $parsed_url['path'], 2);
|
1238 |
-
|
1239 |
-
return empty($parsed_url['host']) ? array_shift($path) : $parsed_url['host'];
|
1240 |
-
}
|
1241 |
-
|
1242 |
-
/**
|
1243 |
-
* Convert rgb string to hex string.
|
1244 |
-
*
|
1245 |
-
* @param $rgb
|
1246 |
-
*
|
1247 |
-
* @return string
|
1248 |
-
*/
|
1249 |
-
function rgb2hex($rgb)
|
1250 |
-
{
|
1251 |
-
$rgb = $this->parse_rgb($rgb);
|
1252 |
-
|
1253 |
-
return '#' . sprintf('%02x', $rgb['r']) . sprintf('%02x', $rgb['g']) . sprintf('%02x', $rgb['b']);
|
1254 |
-
}
|
1255 |
-
|
1256 |
-
/**
|
1257 |
-
* Parse rgb string and covert its to an array.
|
1258 |
-
*
|
1259 |
-
* @param $rgb_string
|
1260 |
-
*
|
1261 |
-
* @return array
|
1262 |
-
*/
|
1263 |
-
function parse_rgb($rgb_string)
|
1264 |
-
{
|
1265 |
-
$rgb = array('r' => 0, 'g' => 1, 'b' => 2);
|
1266 |
-
$exploded = explode(',', $rgb_string);
|
1267 |
-
foreach ($rgb as $key => &$value) {
|
1268 |
-
$value = filter_var($exploded[$value], FILTER_SANITIZE_NUMBER_INT);
|
1269 |
-
}
|
1270 |
-
|
1271 |
-
return $rgb;
|
1272 |
-
}
|
1273 |
-
|
1274 |
-
/**
|
1275 |
-
* Inject field with data in order to render the correct names ids and other html attributes in the template.
|
1276 |
-
*
|
1277 |
-
* @param $fields
|
1278 |
-
*
|
1279 |
-
* @return array
|
1280 |
-
*/
|
1281 |
-
private function inject_fields_with_data($fields)
|
1282 |
-
{
|
1283 |
-
|
1284 |
-
$merged_fields = array();
|
1285 |
-
|
1286 |
-
$will_be_merged = array(
|
1287 |
-
'show_modal' => false,
|
1288 |
-
'show_extra_options' => false,
|
1289 |
-
'url_field_id' => $this->get_field_id('url_fields'),
|
1290 |
-
'url_field_name' => $this->get_field_name('url_fields') . '[]',
|
1291 |
-
'label_field_id' => $this->get_field_id('label_fields'),
|
1292 |
-
'label_field_name' => $this->get_field_name('label_fields') . '[]',
|
1293 |
-
'color_picker_field_id' => $this->get_field_id('color_picker_fields'),
|
1294 |
-
'color_picker_field_name' => $this->get_field_name('color_picker_fields') . '[]',
|
1295 |
-
'color_picker_hover_field_id' => $this->get_field_id('color_picker_hover_fields'),
|
1296 |
-
'color_picker_hover_field_name' => $this->get_field_name('color_picker_hover_fields') . '[]',
|
1297 |
-
'icon_field_id' => $this->get_field_id('icon_fields'),
|
1298 |
-
'icon_field_name' => $this->get_field_name('icon_fields') . '[]',
|
1299 |
-
'icon_kit_field_id' => $this->get_field_id('icon_kit_fields'),
|
1300 |
-
'icon_kit_field_name' => $this->get_field_name('icon_kit_fields') . '[]',
|
1301 |
-
'aria_label_field_id' => $this->get_field_id('aria_label_fields'),
|
1302 |
-
'aria_label_field_name' => $this->get_field_name('aria_label_fields') . '[]',
|
1303 |
-
// 'is_rel_me_field_id' => $this->get_field_id( 'is_rel_me_fields' ),
|
1304 |
-
// 'is_rel_me_field_name' => $this->get_field_name( 'is_rel_me_fields' ) . '[]'
|
1305 |
-
|
1306 |
-
);
|
1307 |
-
|
1308 |
-
foreach ($fields as $field) {
|
1309 |
-
$merged_fields[] = array_merge($field, $will_be_merged);
|
1310 |
-
}
|
1311 |
-
|
1312 |
-
return $merged_fields;
|
1313 |
-
}
|
1314 |
-
|
1315 |
-
/**
|
1316 |
-
* Get default field for a new added element.
|
1317 |
-
*
|
1318 |
-
* @return array
|
1319 |
-
*/
|
1320 |
-
public function get_default_field()
|
1321 |
-
{
|
1322 |
-
return array(
|
1323 |
-
array(
|
1324 |
-
'url' => '',
|
1325 |
-
'label' => __('Default Label', 'zoom-social-icons-widget'),
|
1326 |
-
'icon' => 'wordpress',
|
1327 |
-
'icon_kit' => 'socicon',
|
1328 |
-
'color_picker' => '#1e73be',
|
1329 |
-
'color_picker_hover' => '#1e73be',
|
1330 |
-
// 'is_rel_me' => 'false',
|
1331 |
-
'aria_label' => ''
|
1332 |
-
)
|
1333 |
-
);
|
1334 |
-
}
|
1335 |
-
|
1336 |
-
/**
|
1337 |
-
* Front-end display of widget.
|
1338 |
-
*
|
1339 |
-
* @see WP_Widget::widget()
|
1340 |
-
*
|
1341 |
-
* @param array $args Widget arguments.
|
1342 |
-
* @param array $instance Saved values from database.
|
1343 |
-
*/
|
1344 |
-
public function widget($args, $instance)
|
1345 |
-
{
|
1346 |
-
$instance = $this->normalize_data_array($instance);
|
1347 |
-
$instance = wp_parse_args((array)$instance, $this->get_defaults());
|
1348 |
-
|
1349 |
-
$this->inject_values($instance);
|
1350 |
-
|
1351 |
-
echo $args['before_widget'];
|
1352 |
-
|
1353 |
-
if ($instance['title']) {
|
1354 |
-
|
1355 |
-
echo $args['before_title'] . apply_filters('widget_title', $instance['title']) . $args['after_title'];
|
1356 |
-
}
|
1357 |
-
|
1358 |
-
$class_list = array();
|
1359 |
-
$desc_class = '';
|
1360 |
-
$class_list[] = 'zoom-social-icons-list--' . $instance['icon_style'];
|
1361 |
-
$class_list[] = 'zoom-social-icons-list--' . $instance['icon_canvas_style'];
|
1362 |
-
|
1363 |
-
if (!empty($instance['icon_alignment']) &&
|
1364 |
-
in_array($instance['icon_alignment'], array('left', 'center', 'right'))
|
1365 |
-
) {
|
1366 |
-
$class_list[] = $desc_class = 'zoom-social-icons-list--align-' . $instance['icon_alignment'];
|
1367 |
-
$desc_class = "class='" . $desc_class . "'";
|
1368 |
-
}
|
1369 |
-
|
1370 |
-
|
1371 |
-
if (is_bool($instance['show_icon_labels'])) {
|
1372 |
-
$instance['show_icon_labels'] = $instance['show_icon_labels'] === true ? 'true' : 'false';
|
1373 |
-
}
|
1374 |
-
|
1375 |
-
if (is_bool($instance['open_new_tab'])) {
|
1376 |
-
$instance['open_new_tab'] = $instance['open_new_tab'] === true ? 'true' : 'false';
|
1377 |
-
}
|
1378 |
-
|
1379 |
-
if (is_bool($instance['no_follow'])) {
|
1380 |
-
$instance['no_follow'] = $instance['no_follow'] === true ? 'true' : 'false';
|
1381 |
-
}
|
1382 |
-
|
1383 |
-
if (is_bool($instance['no_opener'])) {
|
1384 |
-
$instance['no_opener'] = $instance['no_opener'] === true ? 'true' : 'false';
|
1385 |
-
}
|
1386 |
-
|
1387 |
-
if (is_bool($instance['no_referrer'])) {
|
1388 |
-
$instance['no_referrer'] = $instance['no_referrer'] === true ? 'true' : 'false';
|
1389 |
-
}
|
1390 |
-
|
1391 |
-
if ($instance['show_icon_labels'] === 'false') {
|
1392 |
-
$class_list[] = 'zoom-social-icons-list--no-labels';
|
1393 |
-
}
|
1394 |
-
?>
|
1395 |
-
|
1396 |
-
<?php if (!empty($instance['description'])) : ?>
|
1397 |
-
|
1398 |
-
<p <?php echo $desc_class; ?>><?php echo $instance['description']; ?></p>
|
1399 |
-
|
1400 |
-
<?php endif; ?>
|
1401 |
-
|
1402 |
-
<ul class="zoom-social-icons-list <?php echo esc_attr(implode(' ', $class_list)); ?>">
|
1403 |
-
|
1404 |
-
<?php
|
1405 |
-
foreach ($instance['fields'] as $key => $field) : ?>
|
1406 |
-
|
1407 |
-
<?php
|
1408 |
-
$rule = ($instance['icon_style'] === 'with-canvas') ? 'background-color' : 'color';
|
1409 |
-
$hover_style = empty($field['color_picker_hover']) ? '' : 'data-hover-rule="' . $rule . '" data-hover-color="' . $field['color_picker_hover'] . '"';
|
1410 |
-
$rel_tag = 'true' == $instance['no_follow'] ? 'nofollow' : '';
|
1411 |
-
$rel_tag .= 'true' == $instance['no_opener'] ? ' noopener' : '';
|
1412 |
-
$rel_tag .= 'true' == $instance['no_referrer'] ? ' noreferrer' : '';
|
1413 |
-
$aria_image_role = '';
|
1414 |
-
$url = esc_url($field['url'], $this->protocols);
|
1415 |
-
|
1416 |
-
if (function_exists('icl_t')) {
|
1417 |
-
$url = icl_t('zoom-social-icons-widget', 'url-' . $key, $field['url']);
|
1418 |
-
}
|
1419 |
-
|
1420 |
-
if (!empty($field['aria_label'])) {
|
1421 |
-
$aria_image_role = "role='img' aria-label='" . $field['aria_label'] . "'";
|
1422 |
-
}
|
1423 |
-
// if ( ! empty( $field['is_rel_me'] ) && $field['is_rel_me'] == 'true' ) {
|
1424 |
-
// $rel_tag .= " me";
|
1425 |
-
// }
|
1426 |
-
?>
|
1427 |
-
<li class="zoom-social_icons-list__item">
|
1428 |
-
<a class="zoom-social_icons-list__link"
|
1429 |
-
href="<?php echo $url; ?>" <?php echo($instance['open_new_tab'] === 'true' ? 'target="_blank"' : ''); ?> <?php echo(strlen($rel_tag) > 0 ? 'rel="' . $rel_tag . '"' : ''); ?>>
|
1430 |
-
<?php if (!empty($field['icon']) && !empty($field['icon_kit']) && !empty($field['color_picker'])) {
|
1431 |
-
$class = $field['icon_kit'] . ' ' . $field['icon_kit'] . '-' . $field['icon'];
|
1432 |
-
$style = $rule . ' : ' . $field['color_picker'];
|
1433 |
-
} else {
|
1434 |
-
$style = '';
|
1435 |
-
|
1436 |
-
$class = 'socicon socicon-' . esc_attr($this->get_icon($field['url']));
|
1437 |
-
} ?>
|
1438 |
-
<?php if (!empty($instance['icon_font_size'])) {
|
1439 |
-
$style .= '; font-size: ' . $instance['icon_font_size'] . 'px';
|
1440 |
-
} ?>
|
1441 |
-
<?php if (!empty($instance['icon_padding_size'])) {
|
1442 |
-
$style .= '; padding:' . $instance['icon_padding_size'] . 'px';
|
1443 |
-
} ?>
|
1444 |
-
|
1445 |
-
<?php if ($instance['show_icon_labels'] === 'false') : ?>
|
1446 |
-
<span class="screen-reader-text"><?php echo esc_html($field['icon']); ?></span>
|
1447 |
-
<?php endif; ?>
|
1448 |
-
|
1449 |
-
<span class="zoom-social_icons-list-span social-icon <?php echo $class ?>" <?php echo $hover_style ?> style="<?php echo $style ?>" <?php echo $aria_image_role; ?>></span>
|
1450 |
-
|
1451 |
-
<?php
|
1452 |
-
if ($instance['show_icon_labels'] === 'true') : ?>
|
1453 |
-
<span class="zoom-social_icons-list__label"><?php echo esc_html($field['label']); ?></span>
|
1454 |
-
<?php endif; ?>
|
1455 |
-
</a>
|
1456 |
-
</li>
|
1457 |
-
|
1458 |
-
<?php endforeach; ?>
|
1459 |
-
|
1460 |
-
</ul>
|
1461 |
-
|
1462 |
-
<?php
|
1463 |
-
|
1464 |
-
echo $args['after_widget'];
|
1465 |
-
}
|
1466 |
-
|
1467 |
-
/**
|
1468 |
-
* Register scripts & styles.
|
1469 |
-
*/
|
1470 |
-
public function register_scripts()
|
1471 |
-
{
|
1472 |
-
wp_register_style(
|
1473 |
-
'wpzoom-social-icons-socicon',
|
1474 |
-
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/css/wpzoom-socicon.css',
|
1475 |
-
array(),
|
1476 |
-
filemtime(WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/css/wpzoom-socicon.css')
|
1477 |
-
);
|
1478 |
-
|
1479 |
-
wp_register_style(
|
1480 |
-
'wpzoom-social-icons-styles',
|
1481 |
-
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/css/wpzoom-social-icons-styles.css',
|
1482 |
-
array(),
|
1483 |
-
filemtime(WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/css/wpzoom-social-icons-styles.css')
|
1484 |
-
);
|
1485 |
-
|
1486 |
-
wp_register_style(
|
1487 |
-
'wpzoom-social-icons-genericons',
|
1488 |
-
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/css/genericons.css',
|
1489 |
-
array(),
|
1490 |
-
filemtime(WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/css/genericons.css')
|
1491 |
-
);
|
1492 |
-
|
1493 |
-
wp_register_style(
|
1494 |
-
'wpzoom-social-icons-academicons',
|
1495 |
-
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/css/academicons.min.css',
|
1496 |
-
array(),
|
1497 |
-
filemtime(WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/css/academicons.min.css')
|
1498 |
-
);
|
1499 |
-
|
1500 |
-
wp_register_style(
|
1501 |
-
'wpzoom-social-icons-font-awesome-3',
|
1502 |
-
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/css/font-awesome-3.min.css',
|
1503 |
-
array(),
|
1504 |
-
filemtime(WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/css/font-awesome-3.min.css')
|
1505 |
-
);
|
1506 |
-
|
1507 |
-
wp_register_script(
|
1508 |
-
'zoom-social-icons-widget-frontend',
|
1509 |
-
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/js/social-icons-widget-frontend.js',
|
1510 |
-
array('jquery'),
|
1511 |
-
filemtime(WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/js/social-icons-widget-frontend.js'),
|
1512 |
-
true
|
1513 |
-
);
|
1514 |
-
}
|
1515 |
-
|
1516 |
-
/**
|
1517 |
-
* Scripts & styles for front-end display of widget.
|
1518 |
-
*/
|
1519 |
-
public function enqueue_scripts()
|
1520 |
-
{
|
1521 |
-
|
1522 |
-
if ( !empty( WPZOOM_Social_Icons_Settings::get_option_key('disable-css-loading-for-socicons') ) ) {
|
1523 |
-
wp_enqueue_style(
|
1524 |
-
'wpzoom-social-icons-socicon',
|
1525 |
-
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/css/wpzoom-socicon.css',
|
1526 |
-
array(),
|
1527 |
-
filemtime( WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/css/wpzoom-socicon.css' )
|
1528 |
-
);
|
1529 |
-
}
|
1530 |
-
|
1531 |
-
|
1532 |
-
if ( !empty( WPZOOM_Social_Icons_Settings::get_option_key('disable-css-loading-for-genericons') ) ) {
|
1533 |
-
|
1534 |
-
wp_enqueue_style(
|
1535 |
-
'wpzoom-social-icons-genericons',
|
1536 |
-
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/css/genericons.css',
|
1537 |
-
array(),
|
1538 |
-
filemtime( WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/css/genericons.css' )
|
1539 |
-
);
|
1540 |
-
}
|
1541 |
-
|
1542 |
-
if ( !empty( WPZOOM_Social_Icons_Settings::get_option_key('disable-css-loading-for-academicons') ) ) {
|
1543 |
-
|
1544 |
-
wp_enqueue_style(
|
1545 |
-
'wpzoom-social-icons-academicons',
|
1546 |
-
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/css/academicons.min.css',
|
1547 |
-
array(),
|
1548 |
-
filemtime( WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/css/academicons.min.css' )
|
1549 |
-
);
|
1550 |
-
}
|
1551 |
-
|
1552 |
-
if ( !empty( WPZOOM_Social_Icons_Settings::get_option_key('disable-css-loading-for-font-awesome-3') ) ) {
|
1553 |
-
|
1554 |
-
wp_enqueue_style(
|
1555 |
-
'wpzoom-social-icons-font-awesome-3',
|
1556 |
-
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/css/font-awesome-3.min.css',
|
1557 |
-
array(),
|
1558 |
-
filemtime( WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/css/font-awesome-3.min.css' )
|
1559 |
-
);
|
1560 |
-
}
|
1561 |
-
|
1562 |
-
if ( !empty( WPZOOM_Social_Icons_Settings::get_option_key('disable-css-loading-for-dashicons') ) ) {
|
1563 |
-
|
1564 |
-
wp_enqueue_style( 'dashicons' );
|
1565 |
-
|
1566 |
-
}
|
1567 |
-
|
1568 |
-
wp_enqueue_style(
|
1569 |
-
'wpzoom-social-icons-styles',
|
1570 |
-
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/css/wpzoom-social-icons-styles.css',
|
1571 |
-
array(),
|
1572 |
-
filemtime(WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/css/wpzoom-social-icons-styles.css')
|
1573 |
-
);
|
1574 |
-
|
1575 |
-
wp_enqueue_script(
|
1576 |
-
'zoom-social-icons-widget-frontend',
|
1577 |
-
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/js/social-icons-widget-frontend.js',
|
1578 |
-
array('jquery'),
|
1579 |
-
filemtime(WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/js/social-icons-widget-frontend.js'),
|
1580 |
-
true
|
1581 |
-
);
|
1582 |
-
}
|
1583 |
-
|
1584 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Class for Social Icons Settings
|
4 |
+
*
|
5 |
+
* @package WPZOOM_Social_Icons
|
6 |
+
*/
|
7 |
+
|
8 |
+
// Exit if accessed directly.
|
9 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
10 |
+
exit;
|
11 |
+
}
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Class WPZOOM_Social_Icons_Settings
|
15 |
+
*/
|
16 |
+
class WPZOOM_Social_Icons_Settings {
|
17 |
+
/**
|
18 |
+
* Settings option name
|
19 |
+
*
|
20 |
+
* @var string
|
21 |
+
*/
|
22 |
+
public static $option_name = 'wpzoom-social-icons-widget-settings';
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Admin menu slug
|
26 |
+
*
|
27 |
+
* @var string
|
28 |
+
*/
|
29 |
+
public static $menu_slug = 'wpzoom-social-icons-widget';
|
30 |
+
|
31 |
+
/**
|
32 |
+
* Settings options defaults
|
33 |
+
*
|
34 |
+
* @var array
|
35 |
+
*/
|
36 |
+
public static $option_defaults = array(
|
37 |
+
'disable-widget' => false,
|
38 |
+
'disable-block' => false,
|
39 |
+
'disable-fonts-preloading' => true,
|
40 |
+
'disable-css-loading-for-academicons' => true,
|
41 |
+
'disable-css-loading-for-font-awesome-3' => true,
|
42 |
+
'disable-css-loading-for-font-awesome-5' => true,
|
43 |
+
'disable-css-loading-for-genericons' => true,
|
44 |
+
'disable-css-loading-for-dashicons' => true,
|
45 |
+
'disable-css-loading-for-socicons' => true,
|
46 |
+
'categories-sync' => true,
|
47 |
+
'custom-icon-set' => array(),
|
48 |
+
);
|
49 |
+
|
50 |
+
/**
|
51 |
+
* Holds the values to be used in the fields callbacks
|
52 |
+
*
|
53 |
+
* @var array
|
54 |
+
*/
|
55 |
+
private $options;
|
56 |
+
|
57 |
+
/**
|
58 |
+
* Constructor
|
59 |
+
*/
|
60 |
+
public function __construct() {
|
61 |
+
add_action( 'admin_menu', array( $this, 'add_plugin_page' ) );
|
62 |
+
add_action( 'admin_init', array( $this, 'page_init' ) );
|
63 |
+
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue' ) );
|
64 |
+
}
|
65 |
+
|
66 |
+
/**
|
67 |
+
* Get settings for icons kits
|
68 |
+
*
|
69 |
+
* @return array
|
70 |
+
*/
|
71 |
+
public static function get_settings_for_icons_kits() {
|
72 |
+
return array(
|
73 |
+
'socicon' => self::get_option_key( 'disable-css-loading-for-socicons' ),
|
74 |
+
'dashicons' => self::get_option_key( 'disable-css-loading-for-dashicons' ),
|
75 |
+
'genericon' => self::get_option_key( 'disable-css-loading-for-genericons' ),
|
76 |
+
'academicons' => self::get_option_key( 'disable-css-loading-for-academicons' ),
|
77 |
+
'fab' => self::get_option_key( 'disable-css-loading-for-font-awesome-5' ),
|
78 |
+
'far' => self::get_option_key( 'disable-css-loading-for-font-awesome-5' ),
|
79 |
+
'fas' => self::get_option_key( 'disable-css-loading-for-font-awesome-5' ),
|
80 |
+
'fa' => self::get_option_key( 'disable-css-loading-for-font-awesome-3' ),
|
81 |
+
);
|
82 |
+
}
|
83 |
+
|
84 |
+
/**
|
85 |
+
* Load scripts and styles
|
86 |
+
*
|
87 |
+
* @param string $hook The current admin page.
|
88 |
+
* @return void
|
89 |
+
*/
|
90 |
+
public function enqueue( $hook ) {
|
91 |
+
if ( $this->get_hook_name() === $hook ) {
|
92 |
+
wp_enqueue_style(
|
93 |
+
'zoom-social-icons-settings-page',
|
94 |
+
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/css/social-icons-settings-page.css',
|
95 |
+
array(),
|
96 |
+
filemtime( WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/css/social-icons-settings-page.css' )
|
97 |
+
);
|
98 |
+
|
99 |
+
wp_enqueue_script(
|
100 |
+
'zoom-social-icons-settings-page',
|
101 |
+
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/js/social-icons-settings-page.js',
|
102 |
+
array( 'jquery', 'jquery-ui-tabs' ),
|
103 |
+
filemtime( WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/js/social-icons-settings-page.js' ),
|
104 |
+
true
|
105 |
+
);
|
106 |
+
}
|
107 |
+
}
|
108 |
+
|
109 |
+
/**
|
110 |
+
* Get hook name
|
111 |
+
*
|
112 |
+
* @return string
|
113 |
+
*/
|
114 |
+
public function get_hook_name() {
|
115 |
+
return 'settings_page_' . self::$menu_slug;
|
116 |
+
}
|
117 |
+
|
118 |
+
/**
|
119 |
+
* Add page to admin menu
|
120 |
+
*
|
121 |
+
* @return void
|
122 |
+
*/
|
123 |
+
public function add_plugin_page() {
|
124 |
+
// This page will be under "Settings".
|
125 |
+
add_options_page(
|
126 |
+
__( 'Social Icons Widget By WPZOOM Settings Page', 'zoom-social-icons-widget' ),
|
127 |
+
__( 'Social Icons Widget', 'zoom-social-icons-widget' ),
|
128 |
+
'manage_options',
|
129 |
+
self::$menu_slug,
|
130 |
+
array( $this, 'create_admin_page' )
|
131 |
+
);
|
132 |
+
}
|
133 |
+
|
134 |
+
/**
|
135 |
+
* Get option name by passed parameter $key
|
136 |
+
*
|
137 |
+
* @param string $key The option key to receive options for.
|
138 |
+
* @return array|string
|
139 |
+
*/
|
140 |
+
public static function get_option_key( $key ) {
|
141 |
+
$options = self::get_settings();
|
142 |
+
|
143 |
+
return array_key_exists( $key, $options ) ? $options[ $key ] : self::$option_defaults[ $key ];
|
144 |
+
}
|
145 |
+
|
146 |
+
/**
|
147 |
+
* Options page callback
|
148 |
+
*
|
149 |
+
* @return void
|
150 |
+
*/
|
151 |
+
public function create_admin_page() {
|
152 |
+
// Set class property.
|
153 |
+
$this->options = self::get_settings();
|
154 |
+
|
155 |
+
?>
|
156 |
+
<div class="wrap zoom-social-icons-settings">
|
157 |
+
<h1><?php esc_html_e( 'Social Icons Widget & Block by WPZOOM', 'zoom-social-icons-widget' ); ?></h1>
|
158 |
+
|
159 |
+
<div class="wpzoom-social-icons-settings-inner">
|
160 |
+
<div class="wp-filter">
|
161 |
+
<ul class="filter-links">
|
162 |
+
<li>
|
163 |
+
<a href="#font-styles"><?php esc_html_e( 'Icon Sets', 'zoom-social-icons-widget' ); ?></a>
|
164 |
+
</li>
|
165 |
+
|
166 |
+
<li>
|
167 |
+
<a href="#font-preload"><?php esc_html_e( 'Optimization', 'zoom-social-icons-widget' ); ?></a>
|
168 |
+
</li>
|
169 |
+
<li>
|
170 |
+
<a href="#general-tab"><?php esc_html_e( 'Misc.', 'zoom-social-icons-widget' ); ?></a>
|
171 |
+
</li>
|
172 |
+
|
173 |
+
<li>
|
174 |
+
<a href="#upload-pro"><?php esc_html_e( 'Upload Icons', 'zoom-social-icons-widget' ); ?> <span>PRO</span></a>
|
175 |
+
</li>
|
176 |
+
</ul>
|
177 |
+
</div>
|
178 |
+
|
179 |
+
<form method="post" action="options.php">
|
180 |
+
|
181 |
+
<div id="font-styles" class="tab">
|
182 |
+
<?php
|
183 |
+
settings_fields( 'wpzoom-social-icons-widget-settings-group-font-styles' );
|
184 |
+
do_settings_sections( 'wpzoom-social-icons-widget-settings-group-font-styles' );
|
185 |
+
?>
|
186 |
+
</div>
|
187 |
+
|
188 |
+
<div id="font-preload" class="tab">
|
189 |
+
<?php
|
190 |
+
settings_fields( 'wpzoom-social-icons-widget-settings-group-font-preload' );
|
191 |
+
do_settings_sections( 'wpzoom-social-icons-widget-settings-group-font-preload' );
|
192 |
+
?>
|
193 |
+
</div>
|
194 |
+
|
195 |
+
<div id="general-tab" class="tab">
|
196 |
+
<?php
|
197 |
+
settings_fields( 'wpzoom-social-icons-widget-settings-group-general' );
|
198 |
+
do_settings_sections( 'wpzoom-social-icons-widget-settings-group-general' );
|
199 |
+
?>
|
200 |
+
</div>
|
201 |
+
|
202 |
+
<div id="upload-pro" class="tab">
|
203 |
+
<?php
|
204 |
+
settings_fields( 'wpzoom-social-icons-widget-settings-upload-pro' );
|
205 |
+
do_settings_sections( 'wpzoom-social-icons-widget-settings-upload-pro' );
|
206 |
+
?>
|
207 |
+
</div>
|
208 |
+
|
209 |
+
<?php submit_button(); ?>
|
210 |
+
</form>
|
211 |
+
</div>
|
212 |
+
</div>
|
213 |
+
|
214 |
+
<?php
|
215 |
+
}
|
216 |
+
|
217 |
+
/**
|
218 |
+
* Get all social icons settings
|
219 |
+
*
|
220 |
+
* @return array
|
221 |
+
*/
|
222 |
+
public static function get_settings() {
|
223 |
+
return get_option( self::$option_name, self::$option_defaults );
|
224 |
+
}
|
225 |
+
|
226 |
+
/**
|
227 |
+
* Register settings, add sections and settings
|
228 |
+
*
|
229 |
+
* @return void
|
230 |
+
*/
|
231 |
+
public function page_init() {
|
232 |
+
/**
|
233 |
+
* Register settings for General tab.
|
234 |
+
*/
|
235 |
+
register_setting(
|
236 |
+
'wpzoom-social-icons-widget-settings-group-general',
|
237 |
+
self::$option_name, // Option name.
|
238 |
+
array(
|
239 |
+
'sanitize_callback' => array( $this, 'sanitize' ),
|
240 |
+
'default' => self::$option_defaults,
|
241 |
+
)
|
242 |
+
);
|
243 |
+
|
244 |
+
/**
|
245 |
+
* Register settings for Upload Icons tab.
|
246 |
+
*/
|
247 |
+
register_setting(
|
248 |
+
'wpzoom-social-icons-widget-settings-upload-pro',
|
249 |
+
self::$option_name, // Option name.
|
250 |
+
array(
|
251 |
+
'sanitize_callback' => array( $this, 'sanitize' ),
|
252 |
+
'default' => self::$option_defaults,
|
253 |
+
)
|
254 |
+
);
|
255 |
+
|
256 |
+
/**
|
257 |
+
* Register settings for Font Preload tab.
|
258 |
+
*/
|
259 |
+
register_setting(
|
260 |
+
'wpzoom-social-icons-widget-settings-group-font-preload',
|
261 |
+
self::$option_name, // Option name.
|
262 |
+
array(
|
263 |
+
'sanitize_callback' => array( $this, 'sanitize' ),
|
264 |
+
'default' => self::$option_defaults,
|
265 |
+
)
|
266 |
+
);
|
267 |
+
|
268 |
+
/**
|
269 |
+
* Register settings for Font Styles tab.
|
270 |
+
*/
|
271 |
+
register_setting(
|
272 |
+
'wpzoom-social-icons-widget-settings-group-font-styles',
|
273 |
+
self::$option_name, // Option name.
|
274 |
+
array(
|
275 |
+
'sanitize_callback' => array( $this, 'sanitize' ),
|
276 |
+
'default' => self::$option_defaults,
|
277 |
+
)
|
278 |
+
);
|
279 |
+
|
280 |
+
/**
|
281 |
+
* General tab section and settings.
|
282 |
+
*/
|
283 |
+
add_settings_section(
|
284 |
+
'wpzoom-social-icons-widget-settings-general',
|
285 |
+
false, // Title.
|
286 |
+
'__return_false', // Callback.
|
287 |
+
'wpzoom-social-icons-widget-settings-group-general'
|
288 |
+
);
|
289 |
+
|
290 |
+
add_settings_field(
|
291 |
+
'wpzoom-disable-social-icons-widget-checkbox',
|
292 |
+
__( 'Social Icons Widget', 'zoom-social-icons-widget' ),
|
293 |
+
array( $this, 'field_disable_widget_checkbox' ),
|
294 |
+
'wpzoom-social-icons-widget-settings-group-general',
|
295 |
+
'wpzoom-social-icons-widget-settings-general'
|
296 |
+
);
|
297 |
+
|
298 |
+
add_settings_field(
|
299 |
+
'wpzoom-disable-social-icons-block-checkbox',
|
300 |
+
__( 'Social Icons Block', 'zoom-social-icons-widget' ),
|
301 |
+
array( $this, 'field_disable_block_checkbox' ),
|
302 |
+
'wpzoom-social-icons-widget-settings-group-general',
|
303 |
+
'wpzoom-social-icons-widget-settings-general'
|
304 |
+
);
|
305 |
+
|
306 |
+
/**
|
307 |
+
* Upload tab section.
|
308 |
+
*/
|
309 |
+
add_settings_section(
|
310 |
+
'wpzoom-social-icons-widget-settings-upload',
|
311 |
+
false, // Title.
|
312 |
+
'__return_false', // Callback.
|
313 |
+
'wpzoom-social-icons-widget-settings-upload-pro'
|
314 |
+
);
|
315 |
+
|
316 |
+
add_settings_section(
|
317 |
+
'wpzoom-instagram-widget-settings-user-info',
|
318 |
+
false,
|
319 |
+
array( $this, 'settings_field_user_details' ),
|
320 |
+
'wpzoom-social-icons-widget-settings-upload-pro'
|
321 |
+
);
|
322 |
+
|
323 |
+
/**
|
324 |
+
* Font Preloader tab section and settings.
|
325 |
+
*/
|
326 |
+
add_settings_section(
|
327 |
+
'wpzoom-social-icons-widget-settings-font-preload',
|
328 |
+
false,
|
329 |
+
'__return_false',
|
330 |
+
'wpzoom-social-icons-widget-settings-group-font-preload'
|
331 |
+
);
|
332 |
+
|
333 |
+
add_settings_field(
|
334 |
+
'wpzoom-enable-social-icons-fonts-preloader',
|
335 |
+
__( 'Preload Fonts', 'zoom-social-icons-widget' ),
|
336 |
+
array( $this, 'field_disable_fonts_preloading' ),
|
337 |
+
'wpzoom-social-icons-widget-settings-group-font-preload',
|
338 |
+
'wpzoom-social-icons-widget-settings-font-preload'
|
339 |
+
);
|
340 |
+
|
341 |
+
/**
|
342 |
+
* Font Styles tab section and settings.
|
343 |
+
*/
|
344 |
+
add_settings_section(
|
345 |
+
'wpzoom-social-icons-widget-settings-font-styles',
|
346 |
+
false, // Title.
|
347 |
+
'__return_false',
|
348 |
+
'wpzoom-social-icons-widget-settings-group-font-styles'
|
349 |
+
);
|
350 |
+
|
351 |
+
add_settings_field(
|
352 |
+
'wpzoom-disable-css-loading-for-academicons',
|
353 |
+
__( 'Academicons', 'zoom-social-icons-widget' ),
|
354 |
+
array( $this, 'field_disable_css_loading_for_academicons' ),
|
355 |
+
'wpzoom-social-icons-widget-settings-group-font-styles',
|
356 |
+
'wpzoom-social-icons-widget-settings-font-styles'
|
357 |
+
);
|
358 |
+
|
359 |
+
add_settings_field(
|
360 |
+
'wpzoom-disable-css-loading-for-font-awesome-3',
|
361 |
+
__( 'Font Awesome 3', 'zoom-social-icons-widget' ),
|
362 |
+
array( $this, 'field_disable_css_loading_for_font_awesome_3' ),
|
363 |
+
'wpzoom-social-icons-widget-settings-group-font-styles',
|
364 |
+
'wpzoom-social-icons-widget-settings-font-styles'
|
365 |
+
);
|
366 |
+
|
367 |
+
add_settings_field(
|
368 |
+
'wpzoom-disable-css-loading-for-font-awesome-5',
|
369 |
+
__( 'Font Awesome 5', 'zoom-social-icons-widget' ),
|
370 |
+
array( $this, 'field_disable_css_loading_for_font_awesome_5' ),
|
371 |
+
'wpzoom-social-icons-widget-settings-group-font-styles',
|
372 |
+
'wpzoom-social-icons-widget-settings-font-styles'
|
373 |
+
);
|
374 |
+
|
375 |
+
add_settings_field(
|
376 |
+
'wpzoom-disable-css-loading-for-font-genericons',
|
377 |
+
__( 'Genericons', 'zoom-social-icons-widget' ),
|
378 |
+
array( $this, 'field_disable_css_loading_for_genericons' ),
|
379 |
+
'wpzoom-social-icons-widget-settings-group-font-styles',
|
380 |
+
'wpzoom-social-icons-widget-settings-font-styles'
|
381 |
+
);
|
382 |
+
|
383 |
+
add_settings_field(
|
384 |
+
'wpzoom-disable-css-loading-for-font-dashicons',
|
385 |
+
__( 'Dashicons', 'zoom-social-icons-widget' ),
|
386 |
+
array( $this, 'field_disable_css_loading_for_dashicons' ),
|
387 |
+
'wpzoom-social-icons-widget-settings-group-font-styles',
|
388 |
+
'wpzoom-social-icons-widget-settings-font-styles'
|
389 |
+
);
|
390 |
+
|
391 |
+
add_settings_field(
|
392 |
+
'wpzoom-disable-css-loading-for-font-socicons',
|
393 |
+
__( 'Socicons', 'zoom-social-icons-widget' ),
|
394 |
+
array( $this, 'field_disable_css_loading_for_socicons' ),
|
395 |
+
'wpzoom-social-icons-widget-settings-group-font-styles',
|
396 |
+
'wpzoom-social-icons-widget-settings-font-styles'
|
397 |
+
);
|
398 |
+
|
399 |
+
add_settings_field(
|
400 |
+
'wpzoom-categories-sync',
|
401 |
+
__( 'Sync Icon Sets', 'zoom-social-icons-widget' ),
|
402 |
+
array( $this, 'field_categories_sync' ),
|
403 |
+
'wpzoom-social-icons-widget-settings-group-font-styles',
|
404 |
+
'wpzoom-social-icons-widget-settings-font-styles'
|
405 |
+
);
|
406 |
+
}
|
407 |
+
|
408 |
+
/**
|
409 |
+
* Sanitize each setting field as needed
|
410 |
+
*
|
411 |
+
* @param array $input Contains all settings fields as array keys.
|
412 |
+
* @return array
|
413 |
+
*/
|
414 |
+
public function sanitize( $input ) {
|
415 |
+
$new_input = array();
|
416 |
+
if ( isset( $input['disable-widget'] ) ) {
|
417 |
+
$new_input['disable-widget'] = wp_validate_boolean( $input['disable-widget'] );
|
418 |
+
}
|
419 |
+
|
420 |
+
if ( isset( $input['disable-block'] ) ) {
|
421 |
+
$new_input['disable-block'] = wp_validate_boolean( $input['disable-block'] );
|
422 |
+
}
|
423 |
+
|
424 |
+
if ( isset( $input['disable-fonts-preloading'] ) ) {
|
425 |
+
$new_input['disable-fonts-preloading'] = wp_validate_boolean( $input['disable-fonts-preloading'] );
|
426 |
+
}
|
427 |
+
|
428 |
+
if ( isset( $input['disable-css-loading-for-academicons'] ) ) {
|
429 |
+
$new_input['disable-css-loading-for-academicons'] = wp_validate_boolean( $input['disable-css-loading-for-academicons'] );
|
430 |
+
}
|
431 |
+
|
432 |
+
if ( isset( $input['disable-css-loading-for-font-awesome-3'] ) ) {
|
433 |
+
$new_input['disable-css-loading-for-font-awesome-3'] = wp_validate_boolean( $input['disable-css-loading-for-font-awesome-3'] );
|
434 |
+
}
|
435 |
+
|
436 |
+
if ( isset( $input['disable-css-loading-for-font-awesome-5'] ) ) {
|
437 |
+
$new_input['disable-css-loading-for-font-awesome-5'] = wp_validate_boolean( $input['disable-css-loading-for-font-awesome-5'] );
|
438 |
+
}
|
439 |
+
|
440 |
+
if ( isset( $input['disable-css-loading-for-genericons'] ) ) {
|
441 |
+
$new_input['disable-css-loading-for-genericons'] = wp_validate_boolean( $input['disable-css-loading-for-genericons'] );
|
442 |
+
}
|
443 |
+
|
444 |
+
if ( isset( $input['disable-css-loading-for-dashicons'] ) ) {
|
445 |
+
$new_input['disable-css-loading-for-dashicons'] = wp_validate_boolean( $input['disable-css-loading-for-dashicons'] );
|
446 |
+
}
|
447 |
+
|
448 |
+
if ( isset( $input['disable-css-loading-for-socicons'] ) ) {
|
449 |
+
$new_input['disable-css-loading-for-socicons'] = wp_validate_boolean( $input['disable-css-loading-for-socicons'] );
|
450 |
+
}
|
451 |
+
|
452 |
+
if ( isset( $input['categories-sync'] ) ) {
|
453 |
+
$new_input['categories-sync'] = wp_validate_boolean( $input['categories-sync'] );
|
454 |
+
}
|
455 |
+
|
456 |
+
return $new_input;
|
457 |
+
}
|
458 |
+
|
459 |
+
/**
|
460 |
+
* Render Disable Widget checkbox in settings page.
|
461 |
+
*/
|
462 |
+
public function field_disable_widget_checkbox() {
|
463 |
+
?>
|
464 |
+
<label>
|
465 |
+
<input type="hidden" name="wpzoom-social-icons-widget-settings[disable-widget]" value="0" />
|
466 |
+
<input type="checkbox" id="disable-widget" name="wpzoom-social-icons-widget-settings[disable-widget]" value="1" <?php checked( self::get_option_key( 'disable-widget' ), 1 ); ?> />
|
467 |
+
<?php esc_html_e( 'Disable', 'zoom-social-icons-widget' ); ?>
|
468 |
+
</label>
|
469 |
+
<span class="description"><?php esc_html_e( 'Social Icons Widget module functionality, by default enabled.', 'zoom-social-icons-widget' ); ?></span>
|
470 |
+
|
471 |
+
<?php
|
472 |
+
}
|
473 |
+
|
474 |
+
/**
|
475 |
+
* Render Disable Block checkbox in settings page.
|
476 |
+
*/
|
477 |
+
public function field_disable_block_checkbox() {
|
478 |
+
?>
|
479 |
+
<label>
|
480 |
+
<input type="hidden" name="wpzoom-social-icons-widget-settings[disable-block]" value="0" />
|
481 |
+
<input type="checkbox" id="disable-block" name="wpzoom-social-icons-widget-settings[disable-block]" value="1" <?php checked( self::get_option_key( 'disable-block' ), 1 ); ?> />
|
482 |
+
<?php esc_html_e( 'Disable', 'zoom-social-icons-widget' ); ?>
|
483 |
+
</label>
|
484 |
+
<span class="description"><?php esc_html_e( 'Social Icons Block module functionality, by default enabled.', 'zoom-social-icons-widget' ); ?></span>
|
485 |
+
|
486 |
+
<?php
|
487 |
+
}
|
488 |
+
|
489 |
+
/**
|
490 |
+
* Render Fonts Preloading checkbox in settings page.
|
491 |
+
*/
|
492 |
+
public function field_disable_fonts_preloading() {
|
493 |
+
?>
|
494 |
+
<label>
|
495 |
+
<input type="hidden" name="wpzoom-social-icons-widget-settings[disable-fonts-preloading]" value="0" />
|
496 |
+
<input type="checkbox" id="disable-fonts-preloading" name="wpzoom-social-icons-widget-settings[disable-fonts-preloading]" value="1" <?php checked( self::get_option_key( 'disable-fonts-preloading' ), 1 ); ?> />
|
497 |
+
<?php esc_html_e( 'Enable', 'zoom-social-icons-widget' ); ?>
|
498 |
+
</label>
|
499 |
+
<span class="description"><?php esc_html_e( 'Preload web fonts using rel="preload" to remove any flash of unstyled text and improve the PageSpeed score.', 'zoom-social-icons-widget' ); ?></span>
|
500 |
+
<?php
|
501 |
+
}
|
502 |
+
|
503 |
+
/**
|
504 |
+
* Render Academicons CSS Loading checkbox in settings page.
|
505 |
+
*/
|
506 |
+
public function field_disable_css_loading_for_academicons() {
|
507 |
+
?>
|
508 |
+
<label>
|
509 |
+
<input type="hidden" name="wpzoom-social-icons-widget-settings[disable-css-loading-for-academicons]" value="0" />
|
510 |
+
<input type="checkbox" id="disable-css-loading-for-academicons" name="wpzoom-social-icons-widget-settings[disable-css-loading-for-academicons]" value="1" <?php checked( self::get_option_key( 'disable-css-loading-for-academicons' ), 1 ); ?> />
|
511 |
+
<?php esc_html_e( 'Enable this font', 'zoom-social-icons-widget' ); ?>
|
512 |
+
</label>
|
513 |
+
<?php
|
514 |
+
}
|
515 |
+
|
516 |
+
/**
|
517 |
+
* Render Font Awesome 3 CSS Loading checkbox in settings page.
|
518 |
+
*/
|
519 |
+
public function field_disable_css_loading_for_font_awesome_3() {
|
520 |
+
?>
|
521 |
+
<label>
|
522 |
+
<input type="hidden" name="wpzoom-social-icons-widget-settings[disable-css-loading-for-font-awesome-3]" value="0" />
|
523 |
+
<input type="checkbox" id="disable-css-loading-for-font-awesome-3" name="wpzoom-social-icons-widget-settings[disable-css-loading-for-font-awesome-3]" value="1" <?php checked( self::get_option_key( 'disable-css-loading-for-font-awesome-3' ), 1 ); ?> />
|
524 |
+
<?php esc_html_e( 'Enable this font', 'zoom-social-icons-widget' ); ?>
|
525 |
+
</label>
|
526 |
+
<span class="description"><?php esc_html_e( 'Font Awesome 3 is loaded only in the Social Icons Widget', 'zoom-social-icons-widget' ); ?></span>
|
527 |
+
<?php
|
528 |
+
}
|
529 |
+
|
530 |
+
/**
|
531 |
+
* Render Font Awesome 5 CSS Loading checkbox in settings page.
|
532 |
+
*/
|
533 |
+
public function field_disable_css_loading_for_font_awesome_5() {
|
534 |
+
?>
|
535 |
+
<label>
|
536 |
+
<input type="hidden" name="wpzoom-social-icons-widget-settings[disable-css-loading-for-font-awesome-5]" value="0" />
|
537 |
+
<input type="checkbox" id="disable-css-loading-for-font-awesome-5" name="wpzoom-social-icons-widget-settings[disable-css-loading-for-font-awesome-5]" value="1" <?php checked( self::get_option_key( 'disable-css-loading-for-font-awesome-5' ), 1 ); ?> />
|
538 |
+
<?php esc_html_e( 'Enable this font', 'zoom-social-icons-widget' ); ?>
|
539 |
+
</label>
|
540 |
+
<span class="description"><?php esc_html_e( 'Font Awesome 5 is loaded only in the Social Icons Block.', 'zoom-social-icons-widget' ); ?></span>
|
541 |
+
<?php
|
542 |
+
}
|
543 |
+
|
544 |
+
/**
|
545 |
+
* Render Genericons CSS Loading checkbox in settings page.
|
546 |
+
*/
|
547 |
+
public function field_disable_css_loading_for_genericons() {
|
548 |
+
?>
|
549 |
+
<label>
|
550 |
+
<input type="hidden" name="wpzoom-social-icons-widget-settings[disable-css-loading-for-genericons]" value="0" />
|
551 |
+
<input type="checkbox" id="disable-css-loading-for-genericons" name="wpzoom-social-icons-widget-settings[disable-css-loading-for-genericons]" value="1" <?php checked( self::get_option_key( 'disable-css-loading-for-genericons' ), 1 ); ?> />
|
552 |
+
<?php esc_html_e( 'Enable this font', 'zoom-social-icons-widget' ); ?>
|
553 |
+
</label>
|
554 |
+
<?php
|
555 |
+
}
|
556 |
+
|
557 |
+
/**
|
558 |
+
* Render Dashicons CSS Loading checkbox in settings page.
|
559 |
+
*/
|
560 |
+
public function field_disable_css_loading_for_dashicons() {
|
561 |
+
?>
|
562 |
+
<label>
|
563 |
+
<input type="hidden" name="wpzoom-social-icons-widget-settings[disable-css-loading-for-dashicons]" value="0" />
|
564 |
+
<input type="checkbox" id="disable-css-loading-for-dashicons" name="wpzoom-social-icons-widget-settings[disable-css-loading-for-dashicons]" value="1" <?php checked( self::get_option_key( 'disable-css-loading-for-dashicons' ), 1 ); ?> />
|
565 |
+
<?php esc_html_e( 'Enable this font', 'zoom-social-icons-widget' ); ?>
|
566 |
+
</label>
|
567 |
+
<?php
|
568 |
+
}
|
569 |
+
|
570 |
+
/**
|
571 |
+
* Render Socicons CSS Loading checkbox in settings page.
|
572 |
+
*/
|
573 |
+
public function field_disable_css_loading_for_socicons() {
|
574 |
+
?>
|
575 |
+
<label>
|
576 |
+
<input type="hidden" name="wpzoom-social-icons-widget-settings[disable-css-loading-for-socicons]" value="0" />
|
577 |
+
<input type="checkbox" id="disable-css-loading-for-socicons" name="wpzoom-social-icons-widget-settings[disable-css-loading-for-socicons]" value="1" <?php checked( self::get_option_key( 'disable-css-loading-for-socicons' ), 1 ); ?> />
|
578 |
+
<?php esc_html_e( 'Enable this font', 'zoom-social-icons-widget' ); ?>
|
579 |
+
</label>
|
580 |
+
<span class="description"><?php esc_html_e( 'Main icon set', 'zoom-social-icons-widget' ); ?></span>
|
581 |
+
<?php
|
582 |
+
}
|
583 |
+
|
584 |
+
/**
|
585 |
+
* Render categories sync checkbox in settings page.
|
586 |
+
*/
|
587 |
+
public function field_categories_sync() {
|
588 |
+
?>
|
589 |
+
<label>
|
590 |
+
<input type="hidden" name="wpzoom-social-icons-widget-settings[categories-sync]" value="0" />
|
591 |
+
<input type="checkbox" id="categories-sync" name="wpzoom-social-icons-widget-settings[categories-sync]" value="1" <?php checked( self::get_option_key( 'categories-sync' ), 1 ); ?> />
|
592 |
+
<?php esc_html_e( 'Enable sync', 'zoom-social-icons-widget' ); ?>
|
593 |
+
</label>
|
594 |
+
<span class="description"><?php esc_html_e( 'Sync Icon sets with Block and Widget Settings from popup.', 'zoom-social-icons-widget' ); ?></span>
|
595 |
+
<?php
|
596 |
+
}
|
597 |
+
|
598 |
+
/**
|
599 |
+
* Display promo tab of Social Icons PRO
|
600 |
+
*
|
601 |
+
* @return void
|
602 |
+
*/
|
603 |
+
public function settings_field_user_details() {
|
604 |
+
?>
|
605 |
+
|
606 |
+
<div class="wpz-pro-plugin-wrap">
|
607 |
+
|
608 |
+
<div class="wpz-pro-btn-wrap">
|
609 |
+
<a class="wpz-social-pro-btn" href="https://www.wpzoom.com/plugins/social-widget/?utm_source=wpadmin&utm_medium=website&utm_campaign=social_free_promotab" target="_blank"><?php esc_html_e( 'Get Social Icons Widget PRO', 'zoom-social-icons-widget' ); ?></a>
|
610 |
+
</div>
|
611 |
+
|
612 |
+
|
613 |
+
<table class="form-table wpz-section_disabled_pro" role="presentation">
|
614 |
+
<tbody>
|
615 |
+
<tr>
|
616 |
+
<th scope="row"><?php esc_html_e( 'Upload Icons', 'zoom-social-icons-widget' ); ?></th>
|
617 |
+
<td>
|
618 |
+
<p style="margin-bottom: 16px;"><?php esc_html_e( 'Upload your icons here and create a new Custom Icons set', 'zoom-social-icons-widget' ); ?></p>
|
619 |
+
|
620 |
+
<div class="zoom-instagram-user-avatar-media-uploader" data-type="image" data-button-add-text="<?php esc_html_e( 'Upload an SVG icon', 'zoom-social-icons-widget' ); ?>" data-button-replace-text="Replace SVG icon">
|
621 |
+
<a href="#" class="button add-media" title="<?php esc_html_e( 'Upload SVG icon', 'zoom-social-icons-widget' ); ?>"><?php esc_html_e( 'Upload an SVG icon', 'zoom-social-icons-widget' ); ?></a>
|
622 |
+
|
623 |
+
<div class="file-wrapper custom-icon__list" style="display: none;"></div>
|
624 |
+
|
625 |
+
<button type="button" class="remove-avatar button-link delete-attachment" style="display: none;"><?php esc_html_e( 'Remove Icon', 'zoom-social-icons-widget' ); ?></button>
|
626 |
+
|
627 |
+
<input class="attachment-url-input" type="hidden" name="wpzoom-custom-icon[attachment-url]">
|
628 |
+
<input class="attachment-title-input" type="hidden" name="wpzoom-custom-icon[attachment-title]">
|
629 |
+
</div>
|
630 |
+
<div class="add-to-custom-iconset" id="add-to-custom-iconset">
|
631 |
+
<p class="submit"><input type="submit" name="submit" id="submit" class="button button-primary" value="<?php esc_html_e( 'Add icon to set', 'zoom-social-icons-widget' ); ?>"></p>
|
632 |
+
</div>
|
633 |
+
|
634 |
+
<div class="modal-icons-wrapper" style="margin-top: 1em;">
|
635 |
+
|
636 |
+
<div class="" style="display: flex; flex-direction: row; align-items: center; justify-content: space-between;">
|
637 |
+
<div style=" width: 50%; max-width: 300px; display: flex; flex-direction: row; align-items: center;">
|
638 |
+
<div class="custom-icon__list" style="margin-right: 2em;">
|
639 |
+
|
640 |
+
<svg xmlns="http://www.w3.org/2000/svg" role="img" viewBox="0 0 24 24">
|
641 |
+
<title>Yoast</title>
|
642 |
+
<path d="M15.864 0L14.55 3.652H5.422A3.592 3.592 0 0 0 1.84 7.233v9.529a3.592 3.592 0 0 0 3.582 3.581h1.495a4.9 4.9 0 0 1-.18.029l-.34.047V24h.391c2.76 0 4.442-1.385 5.706-3.657h9.666V7.233a3.593 3.593 0 0 0-3.253-3.565L20.275 0zm.556.778h2.738l-6.055 16.22c-1.55 4.335-3.186 6.064-5.924 6.21v-2.12c1.767-.354 2.418-1.461 2.785-2.408a3.902 3.902 0 0 0 0-2.828L6.43 6.772h2.488l2.512 7.86z"></path>
|
643 |
+
</svg>
|
644 |
+
</div>
|
645 |
+
<label>
|
646 |
+
<input type="checkbox" name="remove[]" value="0">
|
647 |
+
<?php esc_html_e( 'Remove', 'zoom-social-icons-widget' ); ?>
|
648 |
+
</label>
|
649 |
+
</div>
|
650 |
+
<p class="submit"><input type="submit" name="submit" id="submit" class="button button-primary" value="update"></p>
|
651 |
+
</div>
|
652 |
+
<div class="" style="display: flex; flex-direction: row; align-items: center; justify-content: space-between;">
|
653 |
+
<div style=" width: 50%; max-width: 300px; display: flex; flex-direction: row; align-items: center;">
|
654 |
+
<div class="custom-icon__list" style="margin-right: 2em;">
|
655 |
+
|
656 |
+
<svg xmlns="http://www.w3.org/2000/svg" role="img" viewBox="0 0 24 24">
|
657 |
+
<title>Bitcoin</title>
|
658 |
+
<path d="M23.638 14.904c-1.602 6.43-8.113 10.34-14.542 8.736C2.67 22.05-1.244 15.525.362 9.105 1.962 2.67 8.475-1.243 14.9.358c6.43 1.605 10.342 8.115 8.738 14.548v-.002zm-6.35-4.613c.24-1.59-.974-2.45-2.64-3.03l.54-2.153-1.315-.33-.525 2.107c-.345-.087-.705-.167-1.064-.25l.526-2.127-1.32-.33-.54 2.165c-.285-.067-.565-.132-.84-.2l-1.815-.45-.35 1.407s.975.225.955.236c.535.136.63.486.615.766l-1.477 5.92c-.075.166-.24.406-.614.314.015.02-.96-.24-.96-.24l-.66 1.51 1.71.426.93.242-.54 2.19 1.32.327.54-2.17c.36.1.705.19 1.05.273l-.51 2.154 1.32.33.545-2.19c2.24.427 3.93.257 4.64-1.774.57-1.637-.03-2.58-1.217-3.196.854-.193 1.5-.76 1.68-1.93h.01zm-3.01 4.22c-.404 1.64-3.157.75-4.05.53l.72-2.9c.896.23 3.757.67 3.33 2.37zm.41-4.24c-.37 1.49-2.662.735-3.405.55l.654-2.64c.744.18 3.137.524 2.75 2.084v.006z"></path>
|
659 |
+
</svg>
|
660 |
+
</div>
|
661 |
+
<label>
|
662 |
+
<input type="checkbox" name="remove[]" value="1">
|
663 |
+
<?php esc_html_e( 'Remove', 'zoom-social-icons-widget' ); ?>
|
664 |
+
</label>
|
665 |
+
</div>
|
666 |
+
<p class="submit"><input type="submit" name="submit" id="submit" class="button button-primary" value="update"></p>
|
667 |
+
</div>
|
668 |
+
<div class="" style="display: flex; flex-direction: row; align-items: center; justify-content: space-between;">
|
669 |
+
<div style=" width: 50%; max-width: 300px; display: flex; flex-direction: row; align-items: center;">
|
670 |
+
<div class="custom-icon__list" style="margin-right: 2em;">
|
671 |
+
|
672 |
+
<svg xmlns="http://www.w3.org/2000/svg" role="img" viewBox="0 0 24 24">
|
673 |
+
<title>Tesla</title>
|
674 |
+
<path d="M12 5.362l2.475-3.026s4.245.09 8.471 2.054c-1.082 1.636-3.231 2.438-3.231 2.438-.146-1.439-1.154-1.79-4.354-1.79L12 24 8.619 5.034c-3.18 0-4.188.354-4.335 1.792 0 0-2.146-.795-3.229-2.43C5.28 2.431 9.525 2.34 9.525 2.34L12 5.362l-.004.002H12v-.002zm0-3.899c3.415-.03 7.326.528 11.328 2.28.535-.968.672-1.395.672-1.395C19.625.612 15.528.015 12 0 8.472.015 4.375.61 0 2.349c0 0 .195.525.672 1.396C4.674 1.989 8.585 1.435 12 1.46v.003z"></path>
|
675 |
+
</svg>
|
676 |
+
</div>
|
677 |
+
<label>
|
678 |
+
<input type="checkbox" name="remove[]" value="2">
|
679 |
+
<?php esc_html_e( 'Remove', 'zoom-social-icons-widget' ); ?>
|
680 |
+
</label>
|
681 |
+
</div>
|
682 |
+
<p class="submit"><input type="submit" name="submit" id="submit" class="button button-primary" value="update"></p>
|
683 |
+
</div>
|
684 |
+
<div class="" style="display: flex; flex-direction: row; align-items: center; justify-content: space-between;">
|
685 |
+
<div style=" width: 50%; max-width: 300px; display: flex; flex-direction: row; align-items: center;">
|
686 |
+
<div class="custom-icon__list" style="margin-right: 2em;">
|
687 |
+
|
688 |
+
<svg xmlns="http://www.w3.org/2000/svg" role="img" viewBox="0 0 24 24">
|
689 |
+
<title>foodpanda</title>
|
690 |
+
<path d="M4.224 0a3.14 3.14 0 00-3.14 3.127 3.1 3.1 0 001.079 2.36 11.811 11.811 0 00-2.037 6.639C.126 18.68 5.458 24 12 24c6.542 0 11.874-5.32 11.874-11.874a11.69 11.69 0 00-2.025-6.614 3.136 3.136 0 001.09-2.373A3.132 3.132 0 0019.8.012a3.118 3.118 0 00-2.636 1.438A11.792 11.792 0 0012.012.264c-1.845 0-3.595.419-5.152 1.174A3.133 3.133 0 004.224 0zM12 1.198c1.713 0 3.331.396 4.78 1.102a10.995 10.995 0 014.29 3.715 10.89 10.89 0 011.882 6.135c.011 6.039-4.901 10.951-10.94 10.951-6.04 0-10.951-4.912-10.951-10.951 0-2.277.694-4.386 1.88-6.135A11.08 11.08 0 017.232 2.3 10.773 10.773 0 0112 1.198zM7.367 6.345c-.853.012-1.743.292-2.28.653-1.031.682-2.29 2.156-2.085 4.181.191 2.025 1.785 3.283 2.612 3.283.826 0 1.234-.42 1.485-1.45.252-1.018 1.115-2.192 2.217-3.45s-.024-2.469-.024-2.469c-.393-.513-1.052-.727-1.755-.747a3.952 3.952 0 00-.17-.001zm9.233.007l-.17.001c-.702.02-1.358.233-1.746.752 0 0-1.126 1.21-.024 2.469 1.114 1.258 1.965 2.432 2.217 3.45.251 1.019.659 1.438 1.485 1.45.827 0 2.409-1.258 2.612-3.283.204-2.025-1.054-3.51-2.084-4.182-.544-.36-1.437-.643-2.29-.657zm-8.962 2c.348 0 .624.275.624.623-.012.335-.288.623-.624.623a.619.619 0 01-.623-.623c0-.348.276-.624.623-.624zm8.891 0c.348 0 .623.275.623.623-.012.335-.287.623-.623.623a.619.619 0 01-.623-.623c0-.348.288-.624.623-.624zm-4.541 4.025c-.527 0-2.06.096-2.06.587 0 .887 1.88 1.522 2.06 1.474.18.048 2.06-.587 2.06-1.474 0-.49-1.52-.587-2.06-.587zM9.076 15.17c0 1.414 1.294 2.564 2.912 2.564 1.618 0 2.924-1.15 2.924-2.564z"></path>
|
691 |
+
</svg>
|
692 |
+
</div>
|
693 |
+
<label>
|
694 |
+
<input type="checkbox" name="remove[]" value="3">
|
695 |
+
<?php esc_html_e( 'Remove', 'zoom-social-icons-widget' ); ?>
|
696 |
+
</label>
|
697 |
+
</div>
|
698 |
+
<p class="submit"><input type="submit" name="submit" id="submit" class="button button-primary" value="update"></p>
|
699 |
+
</div>
|
700 |
+
<div class="" style="display: flex; flex-direction: row; align-items: center; justify-content: space-between;">
|
701 |
+
<div style=" width: 50%; max-width: 300px; display: flex; flex-direction: row; align-items: center;">
|
702 |
+
<div class="custom-icon__list" style="margin-right: 2em;">
|
703 |
+
|
704 |
+
<svg xmlns="http://www.w3.org/2000/svg" role="img" viewBox="0 0 24 24">
|
705 |
+
<title>WP Rocket</title>
|
706 |
+
<path d="M3.723.666c-.08-.276.08-.47.356-.47h2.283c.16 0 .31.137.356.274L8.393 7.07h.08L11.491.218A.374.374 0 0111.824 0h.356c.172 0 .287.092.333.218l3.018 6.85h.08L17.286.47a.397.397 0 01.356-.275h2.284c.275 0 .424.195.355.47l-3.683 13.082a.369.369 0 01-.356.275h-.31a.38.38 0 01-.333-.218l-3.568-7.963h-.058l-3.545 7.963a.403.403 0 01-.333.218h-.31a.379.379 0 01-.356-.275L3.723.666m8.308 7.917l-2.594 5.818a1.663 1.663 0 01-.344.448v.004a1.466 1.466 0 01-.688.34l1.4 8.687c.091.16.263.16.367 0l1.79-2.72 1.64 2.708c.104.16.265.16.368 0l1.584-8.698a1.5 1.5 0 01-.832-.618l-.02-.03a1.405 1.405 0 01-.066-.12l-.609-1.366h-.003Z"></path>
|
707 |
+
</svg>
|
708 |
+
</div>
|
709 |
+
<label>
|
710 |
+
<input type="checkbox" name="remove[]" value="4">
|
711 |
+
<?php esc_html_e( 'Remove', 'zoom-social-icons-widget' ); ?>
|
712 |
+
</label>
|
713 |
+
</div>
|
714 |
+
<p class="submit"><input type="submit" name="submit" id="submit" class="button button-primary" value="update"></p>
|
715 |
+
</div>
|
716 |
+
|
717 |
+
</div>
|
718 |
+
</td>
|
719 |
+
</tr>
|
720 |
+
</tbody>
|
721 |
+
</table>
|
722 |
+
|
723 |
+
|
724 |
+
</div>
|
725 |
+
|
726 |
+
</p>
|
727 |
+
<?php
|
728 |
+
}
|
729 |
+
|
730 |
+
|
731 |
+
}
|
732 |
+
|
733 |
+
if ( is_admin() ) {
|
734 |
+
$wpzoom_social_icons_settings = new WPZOOM_Social_Icons_Settings();
|
735 |
+
}
|
includes/classes/class-zoom-social-icons-widget.php
ADDED
@@ -0,0 +1,1395 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Class for Social Icons Widget
|
4 |
+
*
|
5 |
+
* @package WPZOOM_Social_Icons
|
6 |
+
*/
|
7 |
+
|
8 |
+
// Exit if accessed directly.
|
9 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
10 |
+
exit;
|
11 |
+
}
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Class Zoom_Social_Icons_Widget
|
15 |
+
*/
|
16 |
+
class Zoom_Social_Icons_Widget extends WP_Widget {
|
17 |
+
/**
|
18 |
+
* Path to plugin file.
|
19 |
+
*
|
20 |
+
* @var string
|
21 |
+
*/
|
22 |
+
protected $plugin_file;
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Collection of icon kits including socicon, dashicons, fontawesome and genericons
|
26 |
+
*
|
27 |
+
* @var array|null
|
28 |
+
*/
|
29 |
+
protected $icons = null;
|
30 |
+
|
31 |
+
/**
|
32 |
+
* Settings from database.
|
33 |
+
*
|
34 |
+
* @var array
|
35 |
+
*/
|
36 |
+
protected $settings = array();
|
37 |
+
|
38 |
+
/**
|
39 |
+
* Protocols that are allowed in esc_url validation function.
|
40 |
+
*
|
41 |
+
* @var array
|
42 |
+
*/
|
43 |
+
protected $protocols = array(
|
44 |
+
'skype',
|
45 |
+
'tg',
|
46 |
+
'viber',
|
47 |
+
'http',
|
48 |
+
'https',
|
49 |
+
'mailto',
|
50 |
+
'news',
|
51 |
+
'irc',
|
52 |
+
'feed',
|
53 |
+
'tel',
|
54 |
+
'fax',
|
55 |
+
'mms',
|
56 |
+
'xmpp',
|
57 |
+
);
|
58 |
+
|
59 |
+
/**
|
60 |
+
* Widget base ID.
|
61 |
+
*
|
62 |
+
* @var string
|
63 |
+
*/
|
64 |
+
public $id_base = 'zoom-social-icons-widget';
|
65 |
+
|
66 |
+
/**
|
67 |
+
* Widget name.
|
68 |
+
*
|
69 |
+
* @var string
|
70 |
+
*/
|
71 |
+
public $widget_name;
|
72 |
+
|
73 |
+
/**
|
74 |
+
* Widget options.
|
75 |
+
*
|
76 |
+
* @var array
|
77 |
+
*/
|
78 |
+
public $widget_options = array();
|
79 |
+
|
80 |
+
/**
|
81 |
+
* Constructor.
|
82 |
+
*/
|
83 |
+
public function __construct() {
|
84 |
+
$this->widget_name = esc_html__( 'Social Icons by WPZOOM', 'zoom-social-icons-widget' );
|
85 |
+
$this->widget_options = array(
|
86 |
+
'classname' => 'zoom-social-icons-widget',
|
87 |
+
'description' => __( 'Sortable widget that supports more than 80+ social networks', 'zoom-social-icons-widget' ),
|
88 |
+
'show_instance_in_rest' => true,
|
89 |
+
);
|
90 |
+
|
91 |
+
parent::__construct(
|
92 |
+
$this->id_base,
|
93 |
+
$this->widget_name,
|
94 |
+
$this->widget_options
|
95 |
+
);
|
96 |
+
|
97 |
+
add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
|
98 |
+
|
99 |
+
$this->icons = include WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'includes/icons-data.php';
|
100 |
+
$removed_keys = array( 'fab', 'fas', 'far' );
|
101 |
+
$this->icons = array_diff_key( $this->icons, array_flip( $removed_keys ) );
|
102 |
+
$this->icons = apply_filters( 'zoom_social_icons_filter', $this->icons );
|
103 |
+
$this->protocols = apply_filters( 'zoom_social_protocols_filter', $this->protocols );
|
104 |
+
|
105 |
+
$this->plugin_file = WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . '/social-icons-widget-by-wpzoom.php';
|
106 |
+
|
107 |
+
add_action( 'current_screen', array( $this, 'check_current_screen' ) );
|
108 |
+
add_action( 'wp_enqueue_scripts', array( $this, 'register_scripts' ) );
|
109 |
+
|
110 |
+
// Hooks to enqueue javascript file in SiteOrigin builder.
|
111 |
+
add_action( 'siteorigin_panel_enqueue_admin_scripts', array( $this, 'admin_scripts' ) );
|
112 |
+
add_action( 'siteorigin_panel_enqueue_admin_scripts', array( $this, 'admin_js_templates' ) );
|
113 |
+
|
114 |
+
// Hooks to enqueue javascript for beaver builder.
|
115 |
+
add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts_for_beaver' ) );
|
116 |
+
add_action( 'wp_footer', array( $this, 'admin_js_templates_for_beaver' ) );
|
117 |
+
|
118 |
+
// Hooks to enqueue admin scripts in Elementor.
|
119 |
+
add_action( 'elementor/editor/before_enqueue_scripts', array( $this, 'admin_enqueue_scripts_elementor' ) );
|
120 |
+
}
|
121 |
+
|
122 |
+
/**
|
123 |
+
* Include templates for Beaver
|
124 |
+
*
|
125 |
+
* @return void
|
126 |
+
*/
|
127 |
+
public function admin_js_templates_for_beaver() {
|
128 |
+
if ( ( class_exists( 'FLBuilderModel' ) && FLBuilderModel::is_builder_active() ) ) {
|
129 |
+
$this->admin_js_templates();
|
130 |
+
}
|
131 |
+
}
|
132 |
+
|
133 |
+
/**
|
134 |
+
* Load scripts for Beaver.
|
135 |
+
*
|
136 |
+
* @return void
|
137 |
+
*/
|
138 |
+
public function enqueue_scripts_for_beaver() {
|
139 |
+
if ( ! ( class_exists( 'FLBuilderModel' ) && FLBuilderModel::is_builder_active() ) ) {
|
140 |
+
return;
|
141 |
+
}
|
142 |
+
|
143 |
+
wp_enqueue_style(
|
144 |
+
'social-icons-widget-admin',
|
145 |
+
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/css/social-icons-widget-admin.css',
|
146 |
+
array( 'wpzoom-social-icons-socicon' ),
|
147 |
+
filemtime( WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/css/social-icons-widget-admin.css' )
|
148 |
+
);
|
149 |
+
|
150 |
+
wp_enqueue_style( 'wp-color-picker' );
|
151 |
+
|
152 |
+
// phpcs:ignore WordPress.WP.EnqueuedResourceParameters.NoExplicitVersion
|
153 |
+
wp_enqueue_script(
|
154 |
+
'iris',
|
155 |
+
admin_url( 'js/iris.min.js' ),
|
156 |
+
array(
|
157 |
+
'jquery-ui-draggable',
|
158 |
+
'jquery-ui-slider',
|
159 |
+
'jquery-touch-punch',
|
160 |
+
),
|
161 |
+
false,
|
162 |
+
true
|
163 |
+
);
|
164 |
+
|
165 |
+
// phpcs:ignore WordPress.WP.EnqueuedResourceParameters.NoExplicitVersion
|
166 |
+
wp_enqueue_script(
|
167 |
+
'wp-color-picker',
|
168 |
+
admin_url( 'js/color-picker.min.js' ),
|
169 |
+
array( 'iris' ),
|
170 |
+
false,
|
171 |
+
true
|
172 |
+
);
|
173 |
+
|
174 |
+
$colorpicker_l10n = array(
|
175 |
+
'clear' => __( 'Clear', 'zoom-social-icons-widget' ),
|
176 |
+
'defaultString' => __( 'Default', 'zoom-social-icons-widget' ),
|
177 |
+
'pick' => __( 'Select Color', 'zoom-social-icons-widget' ),
|
178 |
+
'current' => __( 'Current Color', 'zoom-social-icons-widget' ),
|
179 |
+
);
|
180 |
+
wp_localize_script(
|
181 |
+
'wp-color-picker',
|
182 |
+
'wpColorPickerL10n',
|
183 |
+
$colorpicker_l10n
|
184 |
+
);
|
185 |
+
|
186 |
+
wp_enqueue_media();
|
187 |
+
|
188 |
+
wp_enqueue_script(
|
189 |
+
'zoom-social-icons-widget-vue-js',
|
190 |
+
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/js/vue.min.js',
|
191 |
+
array(),
|
192 |
+
filemtime( WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/js/vue.min.js' ),
|
193 |
+
true
|
194 |
+
);
|
195 |
+
|
196 |
+
wp_enqueue_script(
|
197 |
+
'zoom-social-icons-widget-sortable-js',
|
198 |
+
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/js/sortable.min.js',
|
199 |
+
array(),
|
200 |
+
filemtime( WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/js/sortable.min.js' ),
|
201 |
+
true
|
202 |
+
);
|
203 |
+
|
204 |
+
wp_enqueue_script(
|
205 |
+
'zoom-social-icons-widget-vue-sortable-js',
|
206 |
+
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/js/vue-sortable.js',
|
207 |
+
array( 'zoom-social-icons-widget-sortable-js' ),
|
208 |
+
filemtime( WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/js/vue-sortable.js' ),
|
209 |
+
true
|
210 |
+
);
|
211 |
+
|
212 |
+
wp_enqueue_script(
|
213 |
+
'zoom-social-icons-widget-uri-js',
|
214 |
+
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/js/URI.min.js',
|
215 |
+
array(),
|
216 |
+
filemtime( WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/js/URI.min.js' ),
|
217 |
+
true
|
218 |
+
);
|
219 |
+
|
220 |
+
wp_enqueue_script(
|
221 |
+
'zoom-social-icons-widget-scroll-to',
|
222 |
+
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/js/jquery.scrollTo.min.js',
|
223 |
+
array( 'jquery' ),
|
224 |
+
filemtime( WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/js/jquery.scrollTo.min.js' ),
|
225 |
+
true
|
226 |
+
);
|
227 |
+
|
228 |
+
wp_enqueue_script(
|
229 |
+
'zoom-social-icons-widget',
|
230 |
+
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/js/social-icons-widget-backend.js',
|
231 |
+
array(
|
232 |
+
'jquery',
|
233 |
+
'underscore',
|
234 |
+
'wp-util',
|
235 |
+
'wp-color-picker',
|
236 |
+
),
|
237 |
+
filemtime( WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/js/social-icons-widget-backend.js' ),
|
238 |
+
true
|
239 |
+
);
|
240 |
+
|
241 |
+
wp_localize_script(
|
242 |
+
'zoom-social-icons-widget',
|
243 |
+
'zoom_social_widget_data',
|
244 |
+
array(
|
245 |
+
'icons' => $this->get_icons_pack(),
|
246 |
+
'categories' => $this->get_icon_categories(),
|
247 |
+
)
|
248 |
+
);
|
249 |
+
}
|
250 |
+
|
251 |
+
/**
|
252 |
+
* Include admin scripts for Elementor
|
253 |
+
*
|
254 |
+
* @return void
|
255 |
+
*/
|
256 |
+
public function admin_enqueue_scripts_elementor() {
|
257 |
+
$this->admin_scripts();
|
258 |
+
$this->admin_js_templates();
|
259 |
+
}
|
260 |
+
|
261 |
+
/**
|
262 |
+
* Enqueue admin javascript only on widgets and customizer pages.
|
263 |
+
*/
|
264 |
+
public function check_current_screen() {
|
265 |
+
$current_screen = get_current_screen();
|
266 |
+
|
267 |
+
$is_screen_widgets = ! empty( $current_screen->id ) && 'widgets' === $current_screen->id;
|
268 |
+
$is_screen_block_widgets = ! empty( $current_screen->id ) && 'appearance_page_gutenberg-widgets' === $current_screen->id;
|
269 |
+
$is_screen_customize = ! empty( $current_screen->id ) && 'customize' === $current_screen->id;
|
270 |
+
|
271 |
+
if ( $is_screen_widgets || $is_screen_block_widgets || $is_screen_customize ) {
|
272 |
+
add_action( 'admin_enqueue_scripts', array( $this, 'admin_scripts' ) );
|
273 |
+
add_action( 'admin_print_footer_scripts', array( $this, 'admin_js_templates' ) );
|
274 |
+
}
|
275 |
+
}
|
276 |
+
|
277 |
+
/**
|
278 |
+
* JavaScript templates for back-end widget form.
|
279 |
+
*/
|
280 |
+
public function admin_js_templates() {
|
281 |
+
?>
|
282 |
+
<script type="text/x-template" id="tmpl-zoom-social-modal"><?php $this->get_modal_template(); ?></script>
|
283 |
+
<?php
|
284 |
+
}
|
285 |
+
|
286 |
+
/**
|
287 |
+
* Modal template render function.
|
288 |
+
*/
|
289 |
+
public function get_modal_template() {
|
290 |
+
?>
|
291 |
+
<div class="modal-mask">
|
292 |
+
<div class="media-modal wp-core-ui zoom-social-modal-wrapper">
|
293 |
+
<button type="button" class="media-modal-close" @click="$emit('close')"><span class="media-modal-icon"><span class="screen-reader-text"><?php esc_html_e( 'Close media panel', 'zoom-social-icons-widget' ); ?></span></span>
|
294 |
+
</button>
|
295 |
+
<div class="media-modal-content" ref="mediaModal">
|
296 |
+
|
297 |
+
<div class="zoom-social-modal-title">
|
298 |
+
<slot name="header">
|
299 |
+
<h3><?php esc_html_e( 'Select Icon', 'zoom-social-icons-widget' ); ?></h3>
|
300 |
+
</slot>
|
301 |
+
</div>
|
302 |
+
|
303 |
+
<div class="zoom-social-modal-content">
|
304 |
+
<slot name="body">
|
305 |
+
|
306 |
+
<div class="zoom-social-modal-form">
|
307 |
+
<div class="form-group">
|
308 |
+
<div class="wrap-label">
|
309 |
+
<label><?php esc_html_e( 'Choose icon color', 'zoom-social-icons-widget' ); ?></label>
|
310 |
+
|
311 |
+
</div>
|
312 |
+
<div class="wrap-input wrap-input-color-picker">
|
313 |
+
<input type="text" class="zoom-social-icons__field-color-picker" name="zoom-social-icons__field-color-picker" v-model="modal_color_picker" :value="modal_color_picker">
|
314 |
+
</div>
|
315 |
+
</div>
|
316 |
+
<div class="form-group">
|
317 |
+
<div class="wrap-label">
|
318 |
+
<label><?php esc_html_e( 'Choose hover color', 'zoom-social-icons-widget' ); ?></label>
|
319 |
+
|
320 |
+
</div>
|
321 |
+
<div class="wrap-input wrap-input-color-picker-hover">
|
322 |
+
<input type="text" class="zoom-social-icons__field-color-picker" name="zoom-social-icons__field-color-picker-hover" v-model="modal_color_picker_hover" :value="modal_color_picker_hover">
|
323 |
+
</div>
|
324 |
+
</div>
|
325 |
+
<div class="form-group">
|
326 |
+
<div class="wrap-label">
|
327 |
+
<label><?php esc_html_e( 'Select Icon Kit', 'zoom-social-icons-widget' ); ?></label>
|
328 |
+
</div>
|
329 |
+
<div class="wrap-input">
|
330 |
+
<select v-model='modal_icon_kit' class="zoom-social-icons__field-icon-kit" name="zoom-social-icons__field-icon-kit">
|
331 |
+
<?php
|
332 |
+
$icons_kits = zoom_social_icons_kits_categories_list();
|
333 |
+
foreach ( $icons_kits as $icon_kit ) :
|
334 |
+
?>
|
335 |
+
<option value="<?php echo esc_attr( $icon_kit['value'] ); ?>"><?php echo esc_html( $icon_kit['label'] ); ?></option>
|
336 |
+
<?php endforeach; ?>
|
337 |
+
</select>
|
338 |
+
<select v-model="modal_icon_kit_category">
|
339 |
+
<option v-for="cat in getIconCategories" :value="cat">{{cat | spacify |
|
340 |
+
capitalize }}
|
341 |
+
</option>
|
342 |
+
</select>
|
343 |
+
</div>
|
344 |
+
</div>
|
345 |
+
|
346 |
+
<div class='modal-icons-wrapper'>
|
347 |
+
<template v-for="(icons_kit, icon_type) in filterBySocicons">
|
348 |
+
<p v-show="searchIconsLength && icons_kit.length ">{{ icon_type | humanizeIconType | capitalize }}</p>
|
349 |
+
<div v-show=" modal_icon_kit == icon_type || searchIconsLength && icons_kit.length " class="icon-kit" :class="[icon_type+'-wrapper']">
|
350 |
+
<span :style="normalizeStyle(icon.icon, icon_type)" :data-icon="icon.icon" :data-kit="icon_type" @click="clickOnIcon" @mouseover="overOnIcon" @mouseleave="leaveOnIcon" v-for="(icon, icon_key) in icons_kit" :class='["zoom-social-icons__single-element social-icon" ,icon_type , icon_type+"-"+icon.icon, icon_canvas_style, {selected : icon.icon === modal_icon && icon_type === modal_icon_kit }]'></span>
|
351 |
+
</div>
|
352 |
+
</template>
|
353 |
+
</div>
|
354 |
+
|
355 |
+
|
356 |
+
<input type="hidden" v-model="modal_icon" name="zoom-social-icons__field-icon" class="zoom-social-icons__field-icon" />
|
357 |
+
</div>
|
358 |
+
</slot>
|
359 |
+
</div>
|
360 |
+
|
361 |
+
<div class="zoom-social-modal-toolbar">
|
362 |
+
<slot name="footer">
|
363 |
+
<input class="search-action-input" style="width: 50%; float: left;" type="text" v-model='searchIcons' placeholder="Type to search icon" />
|
364 |
+
<a href='#' class="button-primary zoom-social-modal-save-btn" @click.prevent="saveModal"><?php esc_html_e( 'Save', 'zoom-social-icons-widget' ); ?></a>
|
365 |
+
</slot>
|
366 |
+
</div>
|
367 |
+
</div>
|
368 |
+
</div>
|
369 |
+
</div>
|
370 |
+
<?php
|
371 |
+
}
|
372 |
+
|
373 |
+
/**
|
374 |
+
* Included styles and js files in the backend part.
|
375 |
+
*/
|
376 |
+
public function admin_scripts() {
|
377 |
+
wp_enqueue_style(
|
378 |
+
'wpzoom-social-icons-socicon',
|
379 |
+
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/css/wpzoom-socicon.css',
|
380 |
+
array(),
|
381 |
+
filemtime( WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/css/wpzoom-socicon.css' )
|
382 |
+
);
|
383 |
+
|
384 |
+
wp_enqueue_style(
|
385 |
+
'wpzoom-social-icons-styles',
|
386 |
+
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/css/wpzoom-social-icons-styles.css',
|
387 |
+
array(),
|
388 |
+
filemtime( WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/css/wpzoom-social-icons-styles.css' )
|
389 |
+
);
|
390 |
+
|
391 |
+
wp_enqueue_style(
|
392 |
+
'wpzoom-social-icons-admin',
|
393 |
+
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/css/social-icons-widget-admin.css',
|
394 |
+
array( 'wpzoom-social-icons-socicon' ),
|
395 |
+
filemtime( WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/css/social-icons-widget-admin.css' )
|
396 |
+
);
|
397 |
+
|
398 |
+
wp_enqueue_style(
|
399 |
+
'wpzoom-social-icons-genericons',
|
400 |
+
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/css/genericons.css',
|
401 |
+
array(),
|
402 |
+
filemtime( WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/css/genericons.css' )
|
403 |
+
);
|
404 |
+
|
405 |
+
wp_enqueue_style(
|
406 |
+
'wpzoom-social-icons-academicons',
|
407 |
+
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/css/academicons.min.css',
|
408 |
+
array(),
|
409 |
+
filemtime( WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/css/academicons.min.css' )
|
410 |
+
);
|
411 |
+
|
412 |
+
wp_enqueue_style(
|
413 |
+
'wpzoom-social-icons-fontawesome-3',
|
414 |
+
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/css/font-awesome-3.min.css',
|
415 |
+
array(),
|
416 |
+
filemtime( WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/css/font-awesome-3.min.css' )
|
417 |
+
);
|
418 |
+
|
419 |
+
wp_enqueue_style( 'dashicons' );
|
420 |
+
wp_enqueue_style( 'wp-color-picker' );
|
421 |
+
wp_enqueue_media();
|
422 |
+
|
423 |
+
wp_enqueue_script(
|
424 |
+
'wpzoom-social-icons-vue-js',
|
425 |
+
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/js/vue.min.js',
|
426 |
+
array(),
|
427 |
+
filemtime( WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/js/vue.min.js' ),
|
428 |
+
true
|
429 |
+
);
|
430 |
+
|
431 |
+
wp_enqueue_script(
|
432 |
+
'wpzoom-social-icons-sortable-js',
|
433 |
+
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/js/sortable.min.js',
|
434 |
+
array(),
|
435 |
+
filemtime( WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/js/sortable.min.js' ),
|
436 |
+
true
|
437 |
+
);
|
438 |
+
|
439 |
+
wp_enqueue_script(
|
440 |
+
'wpzoom-social-icons-vue-sortable-js',
|
441 |
+
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/js/vue-sortable.js',
|
442 |
+
array(),
|
443 |
+
filemtime( WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/js/vue-sortable.js' ),
|
444 |
+
true
|
445 |
+
);
|
446 |
+
|
447 |
+
wp_enqueue_script(
|
448 |
+
'wpzoom-social-icons-uri-js',
|
449 |
+
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/js/URI.min.js',
|
450 |
+
array(),
|
451 |
+
filemtime( WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/js/URI.min.js' ),
|
452 |
+
true
|
453 |
+
);
|
454 |
+
|
455 |
+
wp_enqueue_script(
|
456 |
+
'wpzoom-social-icons-scroll-to',
|
457 |
+
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/js/jquery.scrollTo.min.js',
|
458 |
+
array( 'jquery' ),
|
459 |
+
filemtime( WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/js/jquery.scrollTo.min.js' ),
|
460 |
+
true
|
461 |
+
);
|
462 |
+
|
463 |
+
wp_enqueue_script(
|
464 |
+
'wpzoom-social-icons-widget',
|
465 |
+
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/js/social-icons-widget-backend.js',
|
466 |
+
array( 'jquery', 'underscore', 'wp-util', 'wp-color-picker' ),
|
467 |
+
filemtime( WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/js/social-icons-widget-backend.js' ),
|
468 |
+
true
|
469 |
+
);
|
470 |
+
|
471 |
+
wp_localize_script(
|
472 |
+
'wpzoom-social-icons-widget',
|
473 |
+
'zoom_social_widget_data',
|
474 |
+
array(
|
475 |
+
'icons' => $this->get_icons_pack(),
|
476 |
+
'categories' => $this->get_icon_categories(),
|
477 |
+
)
|
478 |
+
);
|
479 |
+
}
|
480 |
+
|
481 |
+
/**
|
482 |
+
* Get icons pack by its name by default return all packs.
|
483 |
+
*
|
484 |
+
* @param string $type The icons type name.
|
485 |
+
* @return array
|
486 |
+
*/
|
487 |
+
public function get_icons_pack( $type = 'all' ) {
|
488 |
+
return array_key_exists( $type, $this->icons ) ? $this->icons[ $type ] : $this->icons;
|
489 |
+
}
|
490 |
+
|
491 |
+
/**
|
492 |
+
* Get icons pack categories.
|
493 |
+
*
|
494 |
+
* @return array
|
495 |
+
*/
|
496 |
+
public function get_icon_categories() {
|
497 |
+
return apply_filters(
|
498 |
+
'zoom_social_icons_get_icon_categories',
|
499 |
+
array(
|
500 |
+
'socicon' =>
|
501 |
+
array(
|
502 |
+
'all',
|
503 |
+
'audio',
|
504 |
+
'blogging',
|
505 |
+
'communication',
|
506 |
+
'design',
|
507 |
+
'ecommerce',
|
508 |
+
'games',
|
509 |
+
'learning',
|
510 |
+
'music',
|
511 |
+
'news',
|
512 |
+
'payment',
|
513 |
+
'photography',
|
514 |
+
'programming',
|
515 |
+
'search-engines',
|
516 |
+
'social-media',
|
517 |
+
'software',
|
518 |
+
'travel',
|
519 |
+
'video',
|
520 |
+
'web-tools',
|
521 |
+
),
|
522 |
+
'dashicons' =>
|
523 |
+
array(
|
524 |
+
'all',
|
525 |
+
'admin-menu',
|
526 |
+
'image-editing',
|
527 |
+
'media',
|
528 |
+
'misc',
|
529 |
+
'notifications',
|
530 |
+
'post-formats',
|
531 |
+
'posts-screen',
|
532 |
+
'products',
|
533 |
+
'social',
|
534 |
+
'sorting',
|
535 |
+
'taxonomies',
|
536 |
+
'tinymce',
|
537 |
+
'welcome-screen',
|
538 |
+
'widgets',
|
539 |
+
'wordpress-specific',
|
540 |
+
),
|
541 |
+
'genericon' =>
|
542 |
+
array(
|
543 |
+
'all',
|
544 |
+
),
|
545 |
+
'academicons' =>
|
546 |
+
array(
|
547 |
+
'all',
|
548 |
+
),
|
549 |
+
'fa' =>
|
550 |
+
array(
|
551 |
+
'accessibility',
|
552 |
+
'all',
|
553 |
+
'brand',
|
554 |
+
'chart',
|
555 |
+
'currency',
|
556 |
+
'directional',
|
557 |
+
'file-type',
|
558 |
+
'form-control',
|
559 |
+
'gender',
|
560 |
+
'hand',
|
561 |
+
'medical',
|
562 |
+
'payment',
|
563 |
+
'spinner',
|
564 |
+
'text-editor',
|
565 |
+
'transportation',
|
566 |
+
'video-player',
|
567 |
+
'web-application',
|
568 |
+
),
|
569 |
+
)
|
570 |
+
);
|
571 |
+
}
|
572 |
+
|
573 |
+
/**
|
574 |
+
* Sanitize widget form values as they are saved.
|
575 |
+
*
|
576 |
+
* @see WP_Widget::update()
|
577 |
+
*
|
578 |
+
* @param array $new_instance Values just sent to be saved.
|
579 |
+
* @param array $old_instance Previously saved values from database.
|
580 |
+
*
|
581 |
+
* @return array Updated safe values to be saved.
|
582 |
+
*/
|
583 |
+
public function update( $new_instance, $old_instance ) {
|
584 |
+
$instance['title'] = sanitize_text_field( $new_instance['title'] );
|
585 |
+
$instance['description'] = balanceTags( wp_kses( $new_instance['description'], wp_kses_allowed_html() ), true );
|
586 |
+
$instance['show_icon_labels'] = ( ! empty( $new_instance['show_icon_labels'] ) && 'true' === $new_instance['show_icon_labels'] ) ? 'true' : 'false';
|
587 |
+
$instance['open_new_tab'] = ( ! empty( $new_instance['open_new_tab'] ) && 'true' === $new_instance['open_new_tab'] ) ? 'true' : 'false';
|
588 |
+
$instance['no_follow'] = ( ! empty( $new_instance['no_follow'] ) && 'true' === $new_instance['no_follow'] ) ? 'true' : 'false';
|
589 |
+
$instance['no_opener'] = ( ! empty( $new_instance['no_opener'] ) && 'true' === $new_instance['no_opener'] ) ? 'true' : 'false';
|
590 |
+
$instance['no_referrer'] = ( ! empty( $new_instance['no_referrer'] ) && 'true' === $new_instance['no_referrer'] ) ? 'true' : 'false';
|
591 |
+
$instance['icon_padding_size'] = (int) $new_instance['icon_padding_size'];
|
592 |
+
$instance['icon_font_size'] = (int) $new_instance['icon_font_size'];
|
593 |
+
$instance['global_color_picker'] = $new_instance['global_color_picker'];
|
594 |
+
$instance['global_color_picker_hover'] = $new_instance['global_color_picker_hover'];
|
595 |
+
|
596 |
+
if ( in_array( $new_instance['icon_style'], array( 'with-canvas', 'without-canvas' ) ) ) {
|
597 |
+
$instance['icon_style'] = $new_instance['icon_style'];
|
598 |
+
}
|
599 |
+
|
600 |
+
if ( in_array( $new_instance['icon_alignment'], array( 'left', 'center', 'right', 'none' ) ) ) {
|
601 |
+
$instance['icon_alignment'] = $new_instance['icon_alignment'];
|
602 |
+
}
|
603 |
+
|
604 |
+
if ( in_array( $new_instance['icon_canvas_style'], array( 'round', 'rounded', 'square' ) ) ) {
|
605 |
+
$instance['icon_canvas_style'] = $new_instance['icon_canvas_style'];
|
606 |
+
}
|
607 |
+
|
608 |
+
$field_count = empty( $new_instance['url_fields'] ) ? 0 : count( $new_instance['url_fields'] );
|
609 |
+
|
610 |
+
$instance['fields'] = array();
|
611 |
+
|
612 |
+
for ( $i = 0; $i < $field_count; $i++ ) {
|
613 |
+
$url = esc_url( $new_instance['url_fields'][ $i ], $this->protocols );
|
614 |
+
$label = esc_html( $new_instance['label_fields'][ $i ] );
|
615 |
+
|
616 |
+
if ( $url ) {
|
617 |
+
$instance['fields'][] = array(
|
618 |
+
'url' => $url,
|
619 |
+
'label' => $label,
|
620 |
+
'icon' => $new_instance['icon_fields'][ $i ],
|
621 |
+
'icon_kit' => $new_instance['icon_kit_fields'][ $i ],
|
622 |
+
'color_picker' => $new_instance['color_picker_fields'][ $i ],
|
623 |
+
'color_picker_hover' => $new_instance['color_picker_hover_fields'][ $i ],
|
624 |
+
'aria_label' => ! empty( $new_instance['aria_label_fields'][ $i ] ) ? $new_instance['aria_label_fields'][ $i ] : '',
|
625 |
+
);
|
626 |
+
}
|
627 |
+
|
628 |
+
/**
|
629 |
+
* Register strings for translation.
|
630 |
+
*/
|
631 |
+
if ( function_exists( 'icl_register_string' ) ) {
|
632 |
+
icl_register_string( 'zoom-social-icons-widget', 'url-' . $i, $url );
|
633 |
+
}
|
634 |
+
}
|
635 |
+
|
636 |
+
return $instance;
|
637 |
+
}
|
638 |
+
|
639 |
+
/**
|
640 |
+
* Render wigdet form in the backend.
|
641 |
+
*
|
642 |
+
* @param array $instance Widget instance.
|
643 |
+
* @return void
|
644 |
+
*/
|
645 |
+
public function form( $instance ) {
|
646 |
+
global $wp_version;
|
647 |
+
|
648 |
+
$defaults = $this->get_defaults();
|
649 |
+
|
650 |
+
if ( isset( $instance['show-icon-labels'] ) || isset( $instance['open-new-tab'] ) || isset( $instance['no-follow'] ) ) {
|
651 |
+
$instance['show-icon-labels'] = ! empty( $instance['show-icon-labels'] ) ? 'true' : 'false';
|
652 |
+
$instance['open-new-tab'] = ! empty( $instance['open-new-tab'] ) ? 'true' : 'false';
|
653 |
+
$instance['no-follow'] = ! empty( $instance['no-follow'] ) ? 'true' : 'false';
|
654 |
+
}
|
655 |
+
|
656 |
+
$instance = $this->normalize_data_array( $instance );
|
657 |
+
$instance = wp_parse_args( $instance, $defaults );
|
658 |
+
|
659 |
+
$this->inject_values( $instance );
|
660 |
+
|
661 |
+
$instance['fields'] = $this->inject_fields_with_data( $instance['fields'] );
|
662 |
+
|
663 |
+
$instance_attr = '';
|
664 |
+
$default_field = $this->inject_fields_with_data( $this->get_default_field() );
|
665 |
+
$default_field = array_pop( $default_field );
|
666 |
+
|
667 |
+
if ( ! empty( $instance ) ) {
|
668 |
+
$encoded = array(
|
669 |
+
'id' => $this->id,
|
670 |
+
'instance' => $instance,
|
671 |
+
'default_field' => $default_field,
|
672 |
+
);
|
673 |
+
|
674 |
+
$instance_attr = 'data-instance="' . htmlentities( json_encode( $encoded ) ) . '"'; // phpcs:ignore PHPCompatibility.ParameterValues.NewHTMLEntitiesEncodingDefault.NotSet
|
675 |
+
}
|
676 |
+
// phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped
|
677 |
+
?>
|
678 |
+
<div class="form-instance" <?php echo $instance_attr; ?> id="<?php echo $this->id; ?>">
|
679 |
+
<p>
|
680 |
+
<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php esc_html_e( 'Title:', 'zoom-social-icons-widget' ); ?></label>
|
681 |
+
<input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" v-model="title" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" />
|
682 |
+
</p>
|
683 |
+
|
684 |
+
<p>
|
685 |
+
<label for="<?php echo $this->get_field_id( 'description' ); ?>"><?php esc_html_e( 'Text above icons:', 'zoom-social-icons-widget' ); ?></label>
|
686 |
+
<textarea class="widefat" id="<?php echo $this->get_field_id( 'description' ); ?>" name="<?php echo $this->get_field_name( 'description' ); ?>" cols="20" v-model="description" rows="3"></textarea>
|
687 |
+
</p>
|
688 |
+
|
689 |
+
<p class="description"><?php esc_html_e( 'You can add here a text above the icons. Basic HTML allowed.', 'zoom-social-icons-widget' ); ?></p>
|
690 |
+
|
691 |
+
|
692 |
+
<p>
|
693 |
+
<input class="checkbox zoom-social-icons-show-icon-labels" type="checkbox" v-model="show_icon_labels" :true-value="'true'" :false-value="'false'" :value="show_icon_labels" id="<?php echo $this->get_field_id( 'show_icon_labels' ); ?>" name="<?php echo $this->get_field_name( 'show_icon_labels' ); ?>" />
|
694 |
+
<label for="<?php echo $this->get_field_id( 'show_icon_labels' ); ?>"><?php esc_html_e( 'Show icon labels? ', 'zoom-social-icons-widget' ); ?></label>
|
695 |
+
</p>
|
696 |
+
|
697 |
+
<p>
|
698 |
+
<input class="checkbox" type="checkbox" v-model="open_new_tab" :true-value="'true'" :false-value="'false'" :value="open_new_tab" id="<?php echo $this->get_field_id( 'open_new_tab' ); ?>" name="<?php echo $this->get_field_name( 'open_new_tab' ); ?>" />
|
699 |
+
<label for="<?php echo $this->get_field_id( 'open_new_tab' ); ?>"><?php esc_html_e( 'Open links in new tab? ', 'zoom-social-icons-widget' ); ?></label>
|
700 |
+
</p>
|
701 |
+
<?php // phpcs:disable WordPress.WP.I18n.MissingTranslatorsComment ?>
|
702 |
+
<p>
|
703 |
+
<input class="checkbox" type="checkbox" v-model="no_follow" :true-value="'true'" :false-value="'false'" :value="no_follow" id="<?php echo $this->get_field_id( 'no_follow' ); ?>" name="<?php echo $this->get_field_name( 'no_follow' ); ?>" />
|
704 |
+
<label for="<?php echo $this->get_field_id( 'no_follow' ); ?>"><?php echo sprintf( __( 'Add %s to links', 'zoom-social-icons-widget' ), '<code>rel="nofollow"</code>' ); ?></label>
|
705 |
+
</p>
|
706 |
+
|
707 |
+
<p>
|
708 |
+
<input class="checkbox" type="checkbox" v-model="no_referrer" :true-value="'true'" :false-value="'false'" :value="no_referrer" id="<?php echo $this->get_field_id( 'no_referrer' ); ?>" name="<?php echo $this->get_field_name( 'no_referrer' ); ?>" />
|
709 |
+
<label for="<?php echo $this->get_field_id( 'no_referrer' ); ?>"><?php echo sprintf( __( 'Add %s to links', 'zoom-social-icons-widget' ), '<code>rel="noreferrer"</code>' ); ?></label>
|
710 |
+
</p>
|
711 |
+
|
712 |
+
<p>
|
713 |
+
<input class="checkbox" type="checkbox" v-model="no_opener" :true-value="'true'" :false-value="'false'" :value="no_opener" id="<?php echo $this->get_field_id( 'no_opener' ); ?>" name="<?php echo $this->get_field_name( 'no_opener' ); ?>" />
|
714 |
+
<label for="<?php echo $this->get_field_id( 'no_opener' ); ?>"><?php echo sprintf( __( 'Add %s to links', 'zoom-social-icons-widget' ), '<code>rel="noopener"</code>' ); ?></label>
|
715 |
+
</p>
|
716 |
+
<?php // phpcs:enable WordPress.WP.I18n.MissingTranslatorsComment ?>
|
717 |
+
|
718 |
+
<p class="description"><?php esc_html_e( 'Recommended if links or icons open in a new tab', 'zoom-social-icons-widget' ); ?></p>
|
719 |
+
|
720 |
+
|
721 |
+
<p>
|
722 |
+
<label for="<?php echo $this->get_field_id( 'icon_alignment' ); ?>"><?php esc_html_e( 'Icons Alignment:', 'zoom-social-icons-widget' ); ?>
|
723 |
+
</label>
|
724 |
+
<select name="<?php echo $this->get_field_name( 'icon_alignment' ); ?>" id="<?php echo $this->get_field_id( 'icon_alignment' ); ?>" v-model="icon_alignment" class="widefat">
|
725 |
+
<option value="none"><?php esc_html_e( 'None', 'zoom-social-icons-widget' ); ?></option>
|
726 |
+
<option value="left"><?php esc_html_e( 'Align Left', 'zoom-social-icons-widget' ); ?></option>
|
727 |
+
<option value="center"><?php esc_html_e( 'Align Center', 'zoom-social-icons-widget' ); ?></option>
|
728 |
+
<option value="right"><?php esc_html_e( 'Align Right', 'zoom-social-icons-widget' ); ?></option>
|
729 |
+
</select>
|
730 |
+
</p>
|
731 |
+
|
732 |
+
<p>
|
733 |
+
<label for="<?php echo $this->get_field_id( 'icon_style' ); ?>"><?php esc_html_e( 'Icon Style:', 'zoom-social-icons-widget' ); ?>
|
734 |
+
</label>
|
735 |
+
<select name="<?php echo $this->get_field_name( 'icon_style' ); ?>" id="<?php echo $this->get_field_id( 'icon_style' ); ?>" v-model="icon_style" class="widefat">
|
736 |
+
<option value="with-canvas"><?php esc_html_e( 'Color Background / White Icon', 'zoom-social-icons-widget' ); ?></option>
|
737 |
+
<option value="without-canvas"><?php esc_html_e( 'Color Icon / No Background', 'zoom-social-icons-widget' ); ?></option>
|
738 |
+
</select>
|
739 |
+
</p>
|
740 |
+
|
741 |
+
<p>
|
742 |
+
<label :style="iconCanvasStyleLabel()" for="<?php echo $this->get_field_id( 'icon_canvas_style' ); ?>"><?php esc_html_e( 'Icon Background Style:', 'zoom-social-icons-widget' ); ?></label>
|
743 |
+
<select :disabled="this.icon_style == 'without-canvas'" name="<?php echo $this->get_field_name( 'icon_canvas_style' ); ?>" id="<?php echo $this->get_field_id( 'icon_canvas_style' ); ?>" v-model="icon_canvas_style" class="widefat zoom-social-icons-change-icon-canvas-style">
|
744 |
+
<option value="round"><?php esc_html_e( 'Round', 'zoom-social-icons-widget' ); ?></option>
|
745 |
+
<option value="rounded"><?php esc_html_e( 'Rounded Corners', 'zoom-social-icons-widget' ); ?></option>
|
746 |
+
<option value="square"><?php esc_html_e( 'Square', 'zoom-social-icons-widget' ); ?></option>
|
747 |
+
</select>
|
748 |
+
</p>
|
749 |
+
|
750 |
+
<p class="description">
|
751 |
+
<?php echo wp_kses_post( __( 'This option has no effect if <i>Color Icon / No Background</i> icon style is selected.', 'zoom-social-icons-widget' ) ); ?>
|
752 |
+
</p>
|
753 |
+
|
754 |
+
<p>
|
755 |
+
<label for="<?php echo $this->get_field_id( 'icon_padding_size' ); ?>"><?php esc_html_e( 'Icon Padding (pixels):', 'zoom-social-icons-widget' ); ?>
|
756 |
+
<input type="number" min="0" max="200" id="<?php echo $this->get_field_id( 'icon_padding_size' ); ?>" name="<?php echo $this->get_field_name( 'icon_padding_size' ); ?>" v-model="icon_padding_size" class="widefat" />
|
757 |
+
</label>
|
758 |
+
</p>
|
759 |
+
|
760 |
+
<p>
|
761 |
+
<label for="<?php echo $this->get_field_id( 'icon_font_size' ); ?>"><?php esc_html_e( 'Icon Size (pixels):', 'zoom-social-icons-widget' ); ?>
|
762 |
+
<input type="number" min="0" max="200" id="<?php echo $this->get_field_id( 'icon_font_size' ); ?>" name="<?php echo $this->get_field_name( 'icon_font_size' ); ?>" v-model="icon_font_size" class="widefat" />
|
763 |
+
</label>
|
764 |
+
</p>
|
765 |
+
|
766 |
+
<p>
|
767 |
+
<label><?php esc_html_e( 'Set color for all icons', 'zoom-social-icons-widget' ); ?></label>
|
768 |
+
<div class="wrap-input-color-picker">
|
769 |
+
<input v-model="global_color_picker" type="text" class="zoom-social-icons__field-color-picker" id="<?php echo $this->get_field_id( 'global_color_picker' ); ?>" name="<?php echo $this->get_field_name( 'global_color_picker' ); ?>" :value="global_color_picker">
|
770 |
+
</div>
|
771 |
+
</p>
|
772 |
+
<p>
|
773 |
+
<label><?php esc_html_e( 'Set hover color for all icons', 'zoom-social-icons-widget' ); ?></label>
|
774 |
+
<div class="wrap-input-color-picker">
|
775 |
+
<input v-model="global_color_picker_hover" type="text" class="zoom-social-icons__field-color-picker" id="<?php echo $this->get_field_id( 'global_color_picker_hover' ); ?>" name="<?php echo $this->get_field_name( 'global_color_picker_hover' ); ?>" :value="global_color_picker_hover">
|
776 |
+
</div>
|
777 |
+
</p>
|
778 |
+
<p style="margin-bottom: 0;"><?php esc_html_e( 'Icons:', 'zoom-social-icons-widget' ); ?></p>
|
779 |
+
|
780 |
+
<div class="must-remove">
|
781 |
+
<input type="hidden" value="<?php echo $defaults['title']; ?>" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" />
|
782 |
+
<input type="hidden" value="<?php echo $defaults['description']; ?>" id="<?php echo $this->get_field_id( 'description' ); ?>" name="<?php echo $this->get_field_name( 'description' ); ?>" />
|
783 |
+
<input type='hidden' value="<?php echo $defaults['open_new_tab']; ?>" id="<?php echo $this->get_field_id( 'open_new_tab' ); ?>" name="<?php echo $this->get_field_name( 'open_new_tab' ); ?>" />
|
784 |
+
<input type='hidden' value="<?php echo $defaults['icon_alignment']; ?>" id="<?php echo $this->get_field_id( 'icon_alignment' ); ?>" name="<?php echo $this->get_field_name( 'icon_alignment' ); ?>" />
|
785 |
+
<input type='hidden' value="<?php echo $defaults['no_follow']; ?>" id="<?php echo $this->get_field_id( 'no_follow' ); ?>" name="<?php echo $this->get_field_name( 'no_follow' ); ?>" />
|
786 |
+
<input type='hidden' value="<?php echo $defaults['no_opener']; ?>" id="<?php echo $this->get_field_id( 'no_opener' ); ?>" name="<?php echo $this->get_field_name( 'no_opener' ); ?>" />
|
787 |
+
<input type='hidden' value="<?php echo $defaults['no_referrer']; ?>" id="<?php echo $this->get_field_id( 'no_referrer' ); ?>" name="<?php echo $this->get_field_name( 'no_referrer' ); ?>" />
|
788 |
+
|
789 |
+
<input type='hidden' value="<?php echo $defaults['show_icon_labels']; ?>" id="<?php echo $this->get_field_id( 'show_icon_labels' ); ?>" name="<?php echo $this->get_field_name( 'show_icon_labels' ); ?>" />
|
790 |
+
<?php
|
791 |
+
|
792 |
+
foreach ( $instance['fields'] as $field ) {
|
793 |
+
printf(
|
794 |
+
'<input type="hidden" id="%1$s" name="%2$s" value="%3$s">',
|
795 |
+
$field['url_field_id'],
|
796 |
+
$field['url_field_name'],
|
797 |
+
esc_attr( $field['url'] )
|
798 |
+
);
|
799 |
+
|
800 |
+
printf(
|
801 |
+
'<input type="hidden" id="%1$s" name="%2$s" value="%3$s">',
|
802 |
+
$field['label_field_id'],
|
803 |
+
$field['label_field_name'],
|
804 |
+
esc_attr( $field['label'] )
|
805 |
+
);
|
806 |
+
|
807 |
+
printf(
|
808 |
+
'<input type="hidden" id="%1$s" name="%2$s" value="%3$s">',
|
809 |
+
$field['color_picker_field_id'],
|
810 |
+
$field['color_picker_field_name'],
|
811 |
+
esc_attr( $field['color_picker'] )
|
812 |
+
);
|
813 |
+
|
814 |
+
printf(
|
815 |
+
'<input type="hidden" id="%1$s" name="%2$s" value="%3$s">',
|
816 |
+
$field['color_picker_hover_field_id'],
|
817 |
+
$field['color_picker_hover_field_name'],
|
818 |
+
esc_attr( $field['color_picker_hover'] )
|
819 |
+
);
|
820 |
+
|
821 |
+
printf(
|
822 |
+
'<input type="hidden" id="%1$s" name="%2$s" value="%3$s">',
|
823 |
+
$field['icon_field_id'],
|
824 |
+
$field['icon_field_name'],
|
825 |
+
esc_attr( $field['icon'] )
|
826 |
+
);
|
827 |
+
|
828 |
+
printf(
|
829 |
+
'<input type="hidden" id="%1$s" name="%2$s" value="%3$s">',
|
830 |
+
$field['icon_kit_field_id'],
|
831 |
+
$field['icon_kit_field_name'],
|
832 |
+
esc_attr( $field['icon_kit'] )
|
833 |
+
);
|
834 |
+
}
|
835 |
+
?>
|
836 |
+
</div>
|
837 |
+
|
838 |
+
<ul v-sortable="{ handle: '.zoom-social-icons__field-handle', onUpdate : onUpdate }" class="zoom-social-icons__list" :class="{ 'zoom-social-icons__list--no-labels' : show_icon_labels !== 'true' }">
|
839 |
+
|
840 |
+
<template v-for="(field, key) in fields">
|
841 |
+
|
842 |
+
<li class="zoom-social-icons__field">
|
843 |
+
|
844 |
+
<modal ref="modals" @input='onInputModal' @keyup.esc.stop="closeModal(key)" @close='closeModal(key)' v-if='field.show_modal' :field_key="key" :icon="field.icon" :icon_style="icon_style" :icon_canvas_style="icon_canvas_style" :icon_kit="field.icon_kit" :color_picker="field.color_picker" :color_picker_hover="field.color_picker_hover" :icon_categories='icons.categories' :icons="icons.icons">
|
845 |
+
</modal>
|
846 |
+
|
847 |
+
<span class="dashicons dashicons-sort zoom-social-icons__field-handle"></span>
|
848 |
+
<span class="zoom-social-icons__field-icon-handler social-icon" :style="normalizeStyle(key)" :class="[ field.icon_kit, field.icon_kit+'-'+field.icon, icon_canvas_style]" @mouseover='mouseoverIcon(key, $event)' @mouseleave='mouseleaveIcon(key, $event)' @click.stop="clickonIconHandler(key)"></span>
|
849 |
+
<div class="zoom-social-icons__cw">
|
850 |
+
<div class="zoom-social-icons__inputs" ref="inputFields">
|
851 |
+
|
852 |
+
<input class="widefat zoom-social-icons__field-url" :id="field.url_field_id" :name="field.url_field_name" v-model="field.url" type="text" :value="field.url_field_name" @input="urlFieldNameHandler(key)" @keyup.enter.stop="insertField" placeholder="<?php esc_html_e( 'Start typing the URL...', 'zoom-social-icons-widget' ); ?>">
|
853 |
+
<input class="widefat zoom-social-icons__field-label" :id="field.label_field_id" :name="field.label_field_name" v-model="field.label" type="text" :value="field.label_field_name" placeholder="<?php esc_html_e( 'Label', 'zoom-social-icons-widget' ); ?>">
|
854 |
+
<input type="hidden" :id="field.color_picker_field_id" :name="field.color_picker_field_name" v-model='field.color_picker' :value="field.color_picker">
|
855 |
+
<input type="hidden" :id="field.color_picker_hover_field_id" :name="field.color_picker_hover_field_name" v-model='field.color_picker_hover' :value="field.color_picker_hover">
|
856 |
+
<input type="hidden" :id="field.icon_field_id" :name="field.icon_field_name" v-model="field.icon" :value="field.icon">
|
857 |
+
<input type="hidden" :id="field.icon_kit_field_id" :name="field.icon_kit_field_name" v-model="field.icon_kit" :value="field.icon_kit">
|
858 |
+
</div>
|
859 |
+
</div>
|
860 |
+
|
861 |
+
|
862 |
+
<a v-show='fields.length > 1' class="zoom-social-icons__field-trash" href="#" @click.prevent="clickOnDeleteIconHandler(key)"><span class="dashicons dashicons-trash"></span></a>
|
863 |
+
<span :class="toggleExtraOptionsClass(key)" @click.prevent='toggleExtraOptions(key, field)'></span>
|
864 |
+
<br style="clear:both">
|
865 |
+
<div class="extra-options" v-show="field.show_extra_options == true">
|
866 |
+
<p>
|
867 |
+
<label :for="field.aria_label_field_id">
|
868 |
+
<code>"aria-label"</code> <?php esc_html_e( 'description', 'zoom-social-icons-widget' ); ?>
|
869 |
+
<input class="widefat" :id="field.aria_label_field_id" :name="field.aria_label_field_name" v-model="field.aria_label" type="text" :value="field.aria_label_field_name">
|
870 |
+
</label>
|
871 |
+
</p>
|
872 |
+
|
873 |
+
<p class="description">
|
874 |
+
<?php echo wp_kses_post( __( 'This is used to provide a description of this icon to screen reader users (for accessibility purposes).', 'zoom-social-icons-widget' ) ); ?>
|
875 |
+
</p>
|
876 |
+
|
877 |
+
</div>
|
878 |
+
</li>
|
879 |
+
|
880 |
+
</template>
|
881 |
+
|
882 |
+
</ul>
|
883 |
+
|
884 |
+
<div class="zoom-social-icons__add-button">
|
885 |
+
<a @click.prevent='insertField' class="button"><?php esc_html_e( 'Add more', 'zoom-social-icons-widget' ); ?></a>
|
886 |
+
</div>
|
887 |
+
|
888 |
+
<p class="description">
|
889 |
+
<?php echo wp_kses_post( __( 'To add an icon with an email address, use the <strong><em>mailto:mail@example.com</em></strong> format.', 'zoom-social-icons-widget' ) ); ?>
|
890 |
+
</p>
|
891 |
+
|
892 |
+
<p class="description">
|
893 |
+
<?php echo wp_kses_post( __( 'Note that icons above is not how they will look on front-end. This is just for reference.', 'zoom-social-icons-widget' ) ); ?>
|
894 |
+
</p>
|
895 |
+
</div>
|
896 |
+
<?php
|
897 |
+
// phpcs:enable WordPress.Security.EscapeOutput.OutputNotEscaped
|
898 |
+
}
|
899 |
+
|
900 |
+
/**
|
901 |
+
* Get default values for the first render when nothing is saved in databases.
|
902 |
+
*
|
903 |
+
* @return array
|
904 |
+
*/
|
905 |
+
public function get_defaults() {
|
906 |
+
return apply_filters(
|
907 |
+
'zoom_social_icons_get_defaults',
|
908 |
+
array(
|
909 |
+
'title' => esc_html__( 'Follow us', 'zoom-social-icons-widget' ),
|
910 |
+
'description' => '',
|
911 |
+
'show_icon_labels' => 'false',
|
912 |
+
'open_new_tab' => 'true',
|
913 |
+
'no_follow' => 'false',
|
914 |
+
'no_opener' => 'false',
|
915 |
+
'no_referrer' => 'false',
|
916 |
+
'icon_style' => 'with-canvas',
|
917 |
+
'icon_alignment' => 'none',
|
918 |
+
'icon_canvas_style' => 'round',
|
919 |
+
'icon_padding_size' => 8,
|
920 |
+
'icon_font_size' => 18,
|
921 |
+
'global_color_picker' => '#1e73be',
|
922 |
+
'global_color_picker_hover' => '#1e73be',
|
923 |
+
'fields' => array(
|
924 |
+
array(
|
925 |
+
'url' => 'https://facebook.com/',
|
926 |
+
'label' => 'Facebook',
|
927 |
+
'icon' => 'facebook',
|
928 |
+
'icon_kit' => 'socicon',
|
929 |
+
'color_picker' => '#1877F2',
|
930 |
+
'color_picker_hover' => '#1877F2',
|
931 |
+
'aria_label' => '',
|
932 |
+
),
|
933 |
+
array(
|
934 |
+
'url' => 'https://twitter.com/',
|
935 |
+
'label' => 'Twitter',
|
936 |
+
'icon' => 'twitter',
|
937 |
+
'icon_kit' => 'socicon',
|
938 |
+
'color_picker' => '#1da1f2',
|
939 |
+
'color_picker_hover' => '#1da1f2',
|
940 |
+
'aria_label' => '',
|
941 |
+
|
942 |
+
),
|
943 |
+
array(
|
944 |
+
'url' => 'https://instagram.com/',
|
945 |
+
'label' => 'Instagram',
|
946 |
+
'icon' => 'instagram',
|
947 |
+
'icon_kit' => 'socicon',
|
948 |
+
'color_picker' => '#e4405f',
|
949 |
+
'color_picker_hover' => '#e4405f',
|
950 |
+
'aria_label' => '',
|
951 |
+
),
|
952 |
+
),
|
953 |
+
)
|
954 |
+
);
|
955 |
+
}
|
956 |
+
|
957 |
+
/**
|
958 |
+
* Recursive function that replace kebab-case keys with snake_case keys for backward compatibility.
|
959 |
+
*
|
960 |
+
* @param array $value Widget instance data.
|
961 |
+
*
|
962 |
+
* @return array
|
963 |
+
*/
|
964 |
+
public function normalize_data_array( $value ) {
|
965 |
+
$collector = array();
|
966 |
+
|
967 |
+
if ( empty( $value ) ) {
|
968 |
+
return $collector;
|
969 |
+
}
|
970 |
+
|
971 |
+
foreach ( $value as $val_key => $val ) {
|
972 |
+
if ( is_array( $val ) ) {
|
973 |
+
$val = $this->normalize_data_array( $val );
|
974 |
+
}
|
975 |
+
$collector[ str_replace( '-', '_', $val_key ) ] = $val;
|
976 |
+
}
|
977 |
+
|
978 |
+
return $collector;
|
979 |
+
}
|
980 |
+
|
981 |
+
/**
|
982 |
+
* It is a function for backward compatibility that normalize data values between old and new version
|
983 |
+
* in order to work properly after users will make an update to the new version.
|
984 |
+
*
|
985 |
+
* @param array $data Widget instance data.
|
986 |
+
*/
|
987 |
+
public function inject_values( &$data ) {
|
988 |
+
$socicons = wp_list_pluck( $this->icons['socicon'], 'color', 'icon' );
|
989 |
+
foreach ( $data['fields'] as $key => &$field ) {
|
990 |
+
$get_icon = $this->get_icon( $field['url'] );
|
991 |
+
$parsed_icon = empty( $get_icon ) ? 'WordPress' : $get_icon;
|
992 |
+
|
993 |
+
if ( empty( $field['icon'] ) && empty( $field['icon_kit'] ) ) {
|
994 |
+
$field['icon'] = $parsed_icon;
|
995 |
+
$field['icon_kit'] = 'socicon';
|
996 |
+
|
997 |
+
$field['color_picker'] = $socicons[ $parsed_icon ];
|
998 |
+
$field['color_picker_hover'] = $socicons[ $parsed_icon ];
|
999 |
+
}
|
1000 |
+
|
1001 |
+
if ( empty( $field['color_picker'] ) || ( strpos( $field['color_picker'], 'rgb' ) !== false ) ) {
|
1002 |
+
$color = empty( $field['color_picker'] ) ? $socicons[ $parsed_icon ] : $this->rgb2hex( $field['color_picker'] );
|
1003 |
+
$field['color_picker'] = $color;
|
1004 |
+
$field['color_picker_hover'] = $color;
|
1005 |
+
}
|
1006 |
+
|
1007 |
+
if ( empty( $field['color_picker_hover'] ) ) {
|
1008 |
+
$field['color_picker_hover'] = $field['color_picker'];
|
1009 |
+
}
|
1010 |
+
}
|
1011 |
+
}
|
1012 |
+
|
1013 |
+
/**
|
1014 |
+
* Parse icon name from an url and return it.
|
1015 |
+
*
|
1016 |
+
* @param string $url Icon url.
|
1017 |
+
*
|
1018 |
+
* @return mixed|void
|
1019 |
+
*/
|
1020 |
+
protected function get_icon( $url ) {
|
1021 |
+
$icon = '';
|
1022 |
+
$parsed_url = $this->extract_domain( $url );
|
1023 |
+
if ( $url ) {
|
1024 |
+
if ( strstr( $url, 'feedburner.google.com' )
|
1025 |
+
|| strstr( $url, 'mailto:' )
|
1026 |
+
) {
|
1027 |
+
$icon = 'mail';
|
1028 |
+
}
|
1029 |
+
if ( strstr( $url, 'feedburner.com' ) ) {
|
1030 |
+
$icon = 'rss';
|
1031 |
+
}
|
1032 |
+
if ( ! $icon ) {
|
1033 |
+
$icons = wp_list_pluck( $this->icons['socicon'], 'icon' );
|
1034 |
+
foreach ( $icons as $icon_id ) {
|
1035 |
+
if ( strstr( $parsed_url, $icon_id ) ) {
|
1036 |
+
$icon = $icon_id;
|
1037 |
+
break;
|
1038 |
+
}
|
1039 |
+
}
|
1040 |
+
}
|
1041 |
+
}
|
1042 |
+
|
1043 |
+
return apply_filters( 'zoom-social-icons-widget-icon', $icon, $url );
|
1044 |
+
}
|
1045 |
+
|
1046 |
+
/**
|
1047 |
+
* Extract domain from an url.
|
1048 |
+
*
|
1049 |
+
* @param string $url Icon url.
|
1050 |
+
*
|
1051 |
+
* @return mixed
|
1052 |
+
*/
|
1053 |
+
public function extract_domain( $url ) {
|
1054 |
+
$parsed_url = parse_url( trim( $url ) );
|
1055 |
+
$path = empty( $parsed_url['path'] ) ? array( $url ) : explode( '/', $parsed_url['path'], 2 );
|
1056 |
+
|
1057 |
+
return empty( $parsed_url['host'] ) ? array_shift( $path ) : $parsed_url['host'];
|
1058 |
+
}
|
1059 |
+
|
1060 |
+
/**
|
1061 |
+
* Convert rgb string to hex string.
|
1062 |
+
*
|
1063 |
+
* @param string $rgb RGB code color.
|
1064 |
+
*
|
1065 |
+
* @return string
|
1066 |
+
*/
|
1067 |
+
public function rgb2hex( $rgb ) {
|
1068 |
+
$rgb = $this->parse_rgb( $rgb );
|
1069 |
+
|
1070 |
+
return '#' . sprintf( '%02x', $rgb['r'] ) . sprintf( '%02x', $rgb['g'] ) . sprintf( '%02x', $rgb['b'] );
|
1071 |
+
}
|
1072 |
+
|
1073 |
+
/**
|
1074 |
+
* Parse rgb string and covert its to an array.
|
1075 |
+
*
|
1076 |
+
* @param string $rgb_string RGB code color.
|
1077 |
+
*
|
1078 |
+
* @return array
|
1079 |
+
*/
|
1080 |
+
public function parse_rgb( $rgb_string ) {
|
1081 |
+
$rgb = array(
|
1082 |
+
'r' => 0,
|
1083 |
+
'g' => 1,
|
1084 |
+
'b' => 2,
|
1085 |
+
);
|
1086 |
+
$exploded = explode( ',', $rgb_string );
|
1087 |
+
foreach ( $rgb as $key => &$value ) {
|
1088 |
+
$value = filter_var( $exploded[ $value ], FILTER_SANITIZE_NUMBER_INT );
|
1089 |
+
}
|
1090 |
+
|
1091 |
+
return $rgb;
|
1092 |
+
}
|
1093 |
+
|
1094 |
+
/**
|
1095 |
+
* Inject field with data in order to render the correct names ids and other html attributes in the template.
|
1096 |
+
*
|
1097 |
+
* @param array $fields Icon fields.
|
1098 |
+
*
|
1099 |
+
* @return array
|
1100 |
+
*/
|
1101 |
+
private function inject_fields_with_data( $fields ) {
|
1102 |
+
$merged_fields = array();
|
1103 |
+
|
1104 |
+
$will_be_merged = array(
|
1105 |
+
'show_modal' => false,
|
1106 |
+
'show_extra_options' => false,
|
1107 |
+
'url_field_id' => $this->get_field_id( 'url_fields' ),
|
1108 |
+
'url_field_name' => $this->get_field_name( 'url_fields' ) . '[]',
|
1109 |
+
'label_field_id' => $this->get_field_id( 'label_fields' ),
|
1110 |
+
'label_field_name' => $this->get_field_name( 'label_fields' ) . '[]',
|
1111 |
+
'color_picker_field_id' => $this->get_field_id( 'color_picker_fields' ),
|
1112 |
+
'color_picker_field_name' => $this->get_field_name( 'color_picker_fields' ) . '[]',
|
1113 |
+
'color_picker_hover_field_id' => $this->get_field_id( 'color_picker_hover_fields' ),
|
1114 |
+
'color_picker_hover_field_name' => $this->get_field_name( 'color_picker_hover_fields' ) . '[]',
|
1115 |
+
'icon_field_id' => $this->get_field_id( 'icon_fields' ),
|
1116 |
+
'icon_field_name' => $this->get_field_name( 'icon_fields' ) . '[]',
|
1117 |
+
'icon_kit_field_id' => $this->get_field_id( 'icon_kit_fields' ),
|
1118 |
+
'icon_kit_field_name' => $this->get_field_name( 'icon_kit_fields' ) . '[]',
|
1119 |
+
'aria_label_field_id' => $this->get_field_id( 'aria_label_fields' ),
|
1120 |
+
'aria_label_field_name' => $this->get_field_name( 'aria_label_fields' ) . '[]',
|
1121 |
+
|
1122 |
+
);
|
1123 |
+
|
1124 |
+
foreach ( $fields as $field ) {
|
1125 |
+
$merged_fields[] = array_merge( $field, $will_be_merged );
|
1126 |
+
}
|
1127 |
+
|
1128 |
+
return $merged_fields;
|
1129 |
+
}
|
1130 |
+
|
1131 |
+
/**
|
1132 |
+
* Get default field for a new added element.
|
1133 |
+
*
|
1134 |
+
* @return array
|
1135 |
+
*/
|
1136 |
+
public function get_default_field() {
|
1137 |
+
return array(
|
1138 |
+
array(
|
1139 |
+
'url' => '',
|
1140 |
+
'label' => __( 'Default Label', 'zoom-social-icons-widget' ),
|
1141 |
+
'icon' => 'wordpress',
|
1142 |
+
'icon_kit' => 'socicon',
|
1143 |
+
'color_picker' => '#1e73be',
|
1144 |
+
'color_picker_hover' => '#1e73be',
|
1145 |
+
'aria_label' => '',
|
1146 |
+
),
|
1147 |
+
);
|
1148 |
+
}
|
1149 |
+
|
1150 |
+
/**
|
1151 |
+
* Front-end display of widget.
|
1152 |
+
*
|
1153 |
+
* @see WP_Widget::widget()
|
1154 |
+
*
|
1155 |
+
* @param array $args Widget arguments.
|
1156 |
+
* @param array $instance Saved values from database.
|
1157 |
+
*/
|
1158 |
+
public function widget( $args, $instance ) {
|
1159 |
+
$instance = $this->normalize_data_array( $instance );
|
1160 |
+
$instance = wp_parse_args( (array) $instance, $this->get_defaults() );
|
1161 |
+
|
1162 |
+
$this->inject_values( $instance );
|
1163 |
+
|
1164 |
+
echo wp_kses_post( $args['before_widget'] );
|
1165 |
+
|
1166 |
+
if ( $instance['title'] ) {
|
1167 |
+
echo wp_kses_post( $args['before_title'] . apply_filters( 'widget_title', $instance['title'] ) . $args['after_title'] );
|
1168 |
+
}
|
1169 |
+
|
1170 |
+
$class_list = array();
|
1171 |
+
$desc_class = '';
|
1172 |
+
$class_list[] = 'zoom-social-icons-list--' . $instance['icon_style'];
|
1173 |
+
$class_list[] = 'zoom-social-icons-list--' . $instance['icon_canvas_style'];
|
1174 |
+
|
1175 |
+
if ( ! empty( $instance['icon_alignment'] ) && in_array( $instance['icon_alignment'], array( 'left', 'center', 'right' ) ) ) {
|
1176 |
+
$class_list[] = 'zoom-social-icons-list--align-' . $instance['icon_alignment'];
|
1177 |
+
$desc_class = 'zoom-social-icons-list--align-' . $instance['icon_alignment'];
|
1178 |
+
}
|
1179 |
+
|
1180 |
+
if ( is_bool( $instance['show_icon_labels'] ) ) {
|
1181 |
+
$instance['show_icon_labels'] = true === $instance['show_icon_labels'] ? 'true' : 'false';
|
1182 |
+
}
|
1183 |
+
|
1184 |
+
if ( is_bool( $instance['open_new_tab'] ) ) {
|
1185 |
+
$instance['open_new_tab'] = true === $instance['open_new_tab'] ? 'true' : 'false';
|
1186 |
+
}
|
1187 |
+
|
1188 |
+
if ( is_bool( $instance['no_follow'] ) ) {
|
1189 |
+
$instance['no_follow'] = true === $instance['no_follow'] ? 'true' : 'false';
|
1190 |
+
}
|
1191 |
+
|
1192 |
+
if ( is_bool( $instance['no_opener'] ) ) {
|
1193 |
+
$instance['no_opener'] = true === $instance['no_opener'] ? 'true' : 'false';
|
1194 |
+
}
|
1195 |
+
|
1196 |
+
if ( is_bool( $instance['no_referrer'] ) ) {
|
1197 |
+
$instance['no_referrer'] = true === $instance['no_referrer'] ? 'true' : 'false';
|
1198 |
+
}
|
1199 |
+
|
1200 |
+
if ( 'false' === $instance['show_icon_labels'] ) {
|
1201 |
+
$class_list[] = 'zoom-social-icons-list--no-labels';
|
1202 |
+
}
|
1203 |
+
?>
|
1204 |
+
|
1205 |
+
<?php if ( ! empty( $instance['description'] ) ) : ?>
|
1206 |
+
|
1207 |
+
<p class="<?php echo esc_attr( $desc_class ); ?>"><?php echo wp_kses_post( $instance['description'] ); ?></p>
|
1208 |
+
|
1209 |
+
<?php endif; ?>
|
1210 |
+
|
1211 |
+
<ul class="zoom-social-icons-list <?php echo esc_attr( implode( ' ', $class_list ) ); ?>">
|
1212 |
+
|
1213 |
+
<?php
|
1214 |
+
foreach ( $instance['fields'] as $key => $field ) :
|
1215 |
+
?>
|
1216 |
+
|
1217 |
+
<?php
|
1218 |
+
$rule = ( 'with-canvas' === $instance['icon_style'] ) ? 'background-color' : 'color';
|
1219 |
+
$hover_style = empty( $field['color_picker_hover'] ) ? '' : 'data-hover-rule="' . $rule . '" data-hover-color="' . $field['color_picker_hover'] . '"';
|
1220 |
+
$rel_tag = 'true' == $instance['no_follow'] ? 'nofollow' : '';
|
1221 |
+
$rel_tag .= 'true' == $instance['no_opener'] ? ' noopener' : '';
|
1222 |
+
$rel_tag .= 'true' == $instance['no_referrer'] ? ' noreferrer' : '';
|
1223 |
+
$aria_image_role = '';
|
1224 |
+
$url = esc_url( $field['url'], $this->protocols );
|
1225 |
+
|
1226 |
+
if ( function_exists( 'icl_t' ) ) {
|
1227 |
+
$url = icl_t( 'zoom-social-icons-widget', 'url-' . $key, $field['url'] );
|
1228 |
+
}
|
1229 |
+
|
1230 |
+
if ( ! empty( $field['aria_label'] ) ) {
|
1231 |
+
$aria_image_role = "role='img' aria-label='" . $field['aria_label'] . "'";
|
1232 |
+
}
|
1233 |
+
?>
|
1234 |
+
<li class="zoom-social_icons-list__item">
|
1235 |
+
<a class="zoom-social_icons-list__link" href="<?php echo esc_url( $url ); ?>" <?php echo( 'true' === $instance['open_new_tab'] ? 'target="_blank"' : '' ); ?> <?php echo( strlen( $rel_tag ) > 0 ? 'rel="' . esc_attr( $rel_tag ) . '"' : '' ); ?>>
|
1236 |
+
<?php
|
1237 |
+
if ( ! empty( $field['icon'] ) && ! empty( $field['icon_kit'] ) && ! empty( $field['color_picker'] ) ) {
|
1238 |
+
$class = $field['icon_kit'] . ' ' . $field['icon_kit'] . '-' . $field['icon'];
|
1239 |
+
$style = $rule . ' : ' . $field['color_picker'];
|
1240 |
+
} else {
|
1241 |
+
$style = '';
|
1242 |
+
|
1243 |
+
$class = 'socicon socicon-' . esc_attr( $this->get_icon( $field['url'] ) );
|
1244 |
+
}
|
1245 |
+
?>
|
1246 |
+
<?php
|
1247 |
+
if ( ! empty( $instance['icon_font_size'] ) ) {
|
1248 |
+
$style .= '; font-size: ' . $instance['icon_font_size'] . 'px';
|
1249 |
+
}
|
1250 |
+
?>
|
1251 |
+
<?php
|
1252 |
+
if ( ! empty( $instance['icon_padding_size'] ) ) {
|
1253 |
+
$style .= '; padding:' . $instance['icon_padding_size'] . 'px';
|
1254 |
+
}
|
1255 |
+
?>
|
1256 |
+
|
1257 |
+
<?php if ( 'false' === $instance['show_icon_labels'] ) : ?>
|
1258 |
+
<span class="screen-reader-text"><?php echo esc_html( $field['icon'] ); ?></span>
|
1259 |
+
<?php endif; ?>
|
1260 |
+
|
1261 |
+
<?php // phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
1262 |
+
<span class="zoom-social_icons-list-span social-icon <?php echo esc_attr( $class ); ?>" <?php echo $hover_style; ?> style="<?php echo $style; ?>" <?php echo $aria_image_role; ?>></span>
|
1263 |
+
<?php // phpcs:enable WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
1264 |
+
|
1265 |
+
<?php
|
1266 |
+
if ( 'true' === $instance['show_icon_labels'] ) :
|
1267 |
+
?>
|
1268 |
+
<span class="zoom-social_icons-list__label"><?php echo esc_html( $field['label'] ); ?></span>
|
1269 |
+
<?php endif; ?>
|
1270 |
+
</a>
|
1271 |
+
</li>
|
1272 |
+
|
1273 |
+
<?php endforeach; ?>
|
1274 |
+
|
1275 |
+
</ul>
|
1276 |
+
|
1277 |
+
<?php
|
1278 |
+
echo wp_kses_post( $args['after_widget'] );
|
1279 |
+
}
|
1280 |
+
|
1281 |
+
/**
|
1282 |
+
* Register scripts & styles.
|
1283 |
+
*/
|
1284 |
+
public function register_scripts() {
|
1285 |
+
wp_register_style(
|
1286 |
+
'wpzoom-social-icons-socicon',
|
1287 |
+
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/css/wpzoom-socicon.css',
|
1288 |
+
array(),
|
1289 |
+
filemtime( WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/css/wpzoom-socicon.css' )
|
1290 |
+
);
|
1291 |
+
|
1292 |
+
wp_register_style(
|
1293 |
+
'wpzoom-social-icons-styles',
|
1294 |
+
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/css/wpzoom-social-icons-styles.css',
|
1295 |
+
array(),
|
1296 |
+
filemtime( WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/css/wpzoom-social-icons-styles.css' )
|
1297 |
+
);
|
1298 |
+
|
1299 |
+
wp_register_style(
|
1300 |
+
'wpzoom-social-icons-genericons',
|
1301 |
+
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/css/genericons.css',
|
1302 |
+
array(),
|
1303 |
+
filemtime( WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/css/genericons.css' )
|
1304 |
+
);
|
1305 |
+
|
1306 |
+
wp_register_style(
|
1307 |
+
'wpzoom-social-icons-academicons',
|
1308 |
+
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/css/academicons.min.css',
|
1309 |
+
array(),
|
1310 |
+
filemtime( WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/css/academicons.min.css' )
|
1311 |
+
);
|
1312 |
+
|
1313 |
+
wp_register_style(
|
1314 |
+
'wpzoom-social-icons-font-awesome-3',
|
1315 |
+
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/css/font-awesome-3.min.css',
|
1316 |
+
array(),
|
1317 |
+
filemtime( WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/css/font-awesome-3.min.css' )
|
1318 |
+
);
|
1319 |
+
|
1320 |
+
wp_register_script(
|
1321 |
+
'zoom-social-icons-widget-frontend',
|
1322 |
+
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/js/social-icons-widget-frontend.js',
|
1323 |
+
array( 'jquery' ),
|
1324 |
+
filemtime( WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/js/social-icons-widget-frontend.js' ),
|
1325 |
+
true
|
1326 |
+
);
|
1327 |
+
}
|
1328 |
+
|
1329 |
+
/**
|
1330 |
+
* Scripts & styles for front-end display of widget.
|
1331 |
+
*/
|
1332 |
+
public function enqueue_scripts() {
|
1333 |
+
$disable_css_loading_socicons = WPZOOM_Social_Icons_Settings::get_option_key( 'disable-css-loading-for-socicons' );
|
1334 |
+
$disable_css_loading_genericons = WPZOOM_Social_Icons_Settings::get_option_key( 'disable-css-loading-for-genericons' );
|
1335 |
+
$disable_css_loading_academicons = WPZOOM_Social_Icons_Settings::get_option_key( 'disable-css-loading-for-academicons' );
|
1336 |
+
$disable_css_loading_fa3 = WPZOOM_Social_Icons_Settings::get_option_key( 'disable-css-loading-for-font-awesome-3' );
|
1337 |
+
$disable_css_loading_dashicons = WPZOOM_Social_Icons_Settings::get_option_key( 'disable-css-loading-for-dashicons' );
|
1338 |
+
|
1339 |
+
if ( ! empty( $disable_css_loading_socicons ) ) {
|
1340 |
+
wp_enqueue_style(
|
1341 |
+
'wpzoom-social-icons-socicon',
|
1342 |
+
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/css/wpzoom-socicon.css',
|
1343 |
+
array(),
|
1344 |
+
filemtime( WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/css/wpzoom-socicon.css' )
|
1345 |
+
);
|
1346 |
+
}
|
1347 |
+
|
1348 |
+
if ( ! empty( $disable_css_loading_genericons ) ) {
|
1349 |
+
wp_enqueue_style(
|
1350 |
+
'wpzoom-social-icons-genericons',
|
1351 |
+
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/css/genericons.css',
|
1352 |
+
array(),
|
1353 |
+
filemtime( WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/css/genericons.css' )
|
1354 |
+
);
|
1355 |
+
}
|
1356 |
+
|
1357 |
+
if ( ! empty( $disable_css_loading_academicons ) ) {
|
1358 |
+
wp_enqueue_style(
|
1359 |
+
'wpzoom-social-icons-academicons',
|
1360 |
+
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/css/academicons.min.css',
|
1361 |
+
array(),
|
1362 |
+
filemtime( WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/css/academicons.min.css' )
|
1363 |
+
);
|
1364 |
+
}
|
1365 |
+
|
1366 |
+
if ( ! empty( $disable_css_loading_fa3 ) ) {
|
1367 |
+
wp_enqueue_style(
|
1368 |
+
'wpzoom-social-icons-font-awesome-3',
|
1369 |
+
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/css/font-awesome-3.min.css',
|
1370 |
+
array(),
|
1371 |
+
filemtime( WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/css/font-awesome-3.min.css' )
|
1372 |
+
);
|
1373 |
+
}
|
1374 |
+
|
1375 |
+
if ( ! empty( $disable_css_loading_dashicons ) ) {
|
1376 |
+
wp_enqueue_style( 'dashicons' );
|
1377 |
+
}
|
1378 |
+
|
1379 |
+
wp_enqueue_style(
|
1380 |
+
'wpzoom-social-icons-styles',
|
1381 |
+
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/css/wpzoom-social-icons-styles.css',
|
1382 |
+
array(),
|
1383 |
+
filemtime( WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/css/wpzoom-social-icons-styles.css' )
|
1384 |
+
);
|
1385 |
+
|
1386 |
+
wp_enqueue_script(
|
1387 |
+
'zoom-social-icons-widget-frontend',
|
1388 |
+
WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/js/social-icons-widget-frontend.js',
|
1389 |
+
array( 'jquery' ),
|
1390 |
+
filemtime( WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/js/social-icons-widget-frontend.js' ),
|
1391 |
+
true
|
1392 |
+
);
|
1393 |
+
}
|
1394 |
+
|
1395 |
+
}
|
icons-data.php → includes/icons-data.php
RENAMED
@@ -1,4 +1,10 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
return array(
|
3 |
'socicon' => array(
|
4 |
array(
|
@@ -15,13 +21,13 @@ return array(
|
|
15 |
),
|
16 |
'color' => '#FF5A5F',
|
17 |
),
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
array(
|
26 |
'icon' => 'android',
|
27 |
'category' => array(
|
@@ -50,13 +56,13 @@ return array(
|
|
50 |
),
|
51 |
'color' => '#B9BFC1',
|
52 |
),
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
array(
|
61 |
'icon' => 'appnet',
|
62 |
'category' => array(
|
@@ -74,9 +80,9 @@ return array(
|
|
74 |
array(
|
75 |
'icon' => 'artstation',
|
76 |
'category' => array(
|
77 |
-
'software'
|
78 |
),
|
79 |
-
'color' => '#13aff0'
|
80 |
),
|
81 |
array(
|
82 |
'icon' => 'baidu',
|
@@ -136,13 +142,13 @@ return array(
|
|
136 |
),
|
137 |
'color' => '#000000',
|
138 |
),
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
array(
|
147 |
'icon' => 'codered',
|
148 |
'category' => array(
|
@@ -159,13 +165,13 @@ return array(
|
|
159 |
),
|
160 |
'color' => '#3E8DCC',
|
161 |
),
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
array(
|
170 |
'icon' => 'crunchbase',
|
171 |
'category' => array(
|
@@ -230,14 +236,14 @@ return array(
|
|
230 |
),
|
231 |
'color' => '#2e9fff',
|
232 |
),
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
array(
|
242 |
'icon' => 'dribbble',
|
243 |
'category' => array(
|
@@ -275,13 +281,13 @@ return array(
|
|
275 |
),
|
276 |
'color' => '#82B540',
|
277 |
),
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
array(
|
286 |
'icon' => 'eyeem',
|
287 |
'category' => array(
|
@@ -319,13 +325,13 @@ return array(
|
|
319 |
),
|
320 |
'color' => '#34B151',
|
321 |
),
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
array(
|
330 |
'icon' => 'flattr',
|
331 |
'category' => array(
|
@@ -372,13 +378,13 @@ return array(
|
|
372 |
),
|
373 |
'color' => '#2F72C4',
|
374 |
),
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
array(
|
383 |
'icon' => 'github',
|
384 |
'category' => array(
|
@@ -403,31 +409,31 @@ return array(
|
|
403 |
array(
|
404 |
'icon' => 'google-calendar',
|
405 |
'category' => array(
|
406 |
-
'calendar'
|
407 |
),
|
408 |
-
'color' => '#3D81F6'
|
409 |
),
|
410 |
array(
|
411 |
'icon' => 'google-maps',
|
412 |
'category' => array(
|
413 |
-
'maps'
|
414 |
-
),
|
415 |
-
'color' => '#4285F4'
|
416 |
-
),
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
array(
|
432 |
'icon' => 'grooveshark',
|
433 |
'category' => array(
|
@@ -435,13 +441,13 @@ return array(
|
|
435 |
),
|
436 |
'color' => '#000000',
|
437 |
),
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
array(
|
446 |
'icon' => 'hellocoton',
|
447 |
'category' => array(
|
@@ -471,14 +477,14 @@ return array(
|
|
471 |
),
|
472 |
'color' => '#000000',
|
473 |
),
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
array(
|
483 |
'icon' => 'instagram',
|
484 |
'category' => array(
|
@@ -490,9 +496,9 @@ return array(
|
|
490 |
array(
|
491 |
'icon' => 'issuu',
|
492 |
'category' => array(
|
493 |
-
'reading'
|
494 |
),
|
495 |
-
'color' => '#F26F61'
|
496 |
),
|
497 |
array(
|
498 |
'icon' => 'itunes',
|
@@ -501,27 +507,27 @@ return array(
|
|
501 |
),
|
502 |
'color' => '#F16061',
|
503 |
),
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
array(
|
526 |
'icon' => 'lanyrd',
|
527 |
'category' => array(
|
@@ -534,14 +540,14 @@ return array(
|
|
534 |
'category' => array(
|
535 |
'audio',
|
536 |
),
|
537 |
-
'color' => '#d41316'
|
538 |
),
|
539 |
array(
|
540 |
'icon' => 'letterboxd',
|
541 |
'category' => array(
|
542 |
-
'communication'
|
543 |
),
|
544 |
-
'color' => '#2c3440'
|
545 |
),
|
546 |
array(
|
547 |
'icon' => 'line',
|
@@ -573,30 +579,30 @@ return array(
|
|
573 |
),
|
574 |
'color' => '#000000',
|
575 |
),
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
|
588 |
-
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
array(
|
601 |
'icon' => 'mastodon',
|
602 |
'category' => array(
|
@@ -624,23 +630,23 @@ return array(
|
|
624 |
'social-media',
|
625 |
'communication',
|
626 |
),
|
627 |
-
'color' => '#0084ff'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
628 |
),
|
629 |
-
array(
|
630 |
-
'icon' => 'mewe',
|
631 |
-
'category' => array(
|
632 |
-
'social-media',
|
633 |
-
'communication',
|
634 |
-
),
|
635 |
-
'color' => '#17377F'
|
636 |
-
),
|
637 |
array(
|
638 |
'icon' => 'mixer',
|
639 |
'category' => array(
|
640 |
'social-media',
|
641 |
-
'video'
|
642 |
),
|
643 |
-
'color' => '#1FBAED'
|
644 |
),
|
645 |
array(
|
646 |
'icon' => 'myspace',
|
@@ -663,13 +669,13 @@ return array(
|
|
663 |
),
|
664 |
'color' => '#075B2F',
|
665 |
),
|
666 |
-
|
667 |
-
|
668 |
-
|
669 |
-
|
670 |
-
|
671 |
-
|
672 |
-
|
673 |
array(
|
674 |
'icon' => 'nextdoor',
|
675 |
'category' => array(
|
@@ -677,13 +683,13 @@ return array(
|
|
677 |
),
|
678 |
'color' => '#8ed500',
|
679 |
),
|
680 |
-
|
681 |
-
|
682 |
-
|
683 |
-
|
684 |
-
|
685 |
-
|
686 |
-
|
687 |
array(
|
688 |
'icon' => 'odnoklassniki',
|
689 |
'category' => array(
|
@@ -706,13 +712,13 @@ return array(
|
|
706 |
),
|
707 |
'color' => '#0072C6',
|
708 |
),
|
709 |
-
|
710 |
-
|
711 |
-
|
712 |
-
|
713 |
-
|
714 |
-
|
715 |
-
|
716 |
array(
|
717 |
'icon' => 'overwatch',
|
718 |
'category' => array(
|
@@ -722,13 +728,13 @@ return array(
|
|
722 |
),
|
723 |
'color' => '#9E9E9E',
|
724 |
),
|
725 |
-
|
726 |
-
|
727 |
-
|
728 |
-
|
729 |
-
|
730 |
-
|
731 |
-
|
732 |
array(
|
733 |
'icon' => 'patreon',
|
734 |
'category' => array(
|
@@ -767,13 +773,13 @@ return array(
|
|
767 |
),
|
768 |
'color' => '#c92619',
|
769 |
),
|
770 |
-
|
771 |
-
|
772 |
-
|
773 |
-
|
774 |
-
|
775 |
-
|
776 |
-
|
777 |
array(
|
778 |
'icon' => 'play',
|
779 |
'category' => array(
|
@@ -781,14 +787,14 @@ return array(
|
|
781 |
),
|
782 |
'color' => '#000000',
|
783 |
),
|
784 |
-
|
785 |
-
|
786 |
-
|
787 |
-
|
788 |
-
|
789 |
-
|
790 |
-
|
791 |
-
|
792 |
array(
|
793 |
'icon' => 'playstation',
|
794 |
'category' => array(
|
@@ -797,28 +803,28 @@ return array(
|
|
797 |
),
|
798 |
'color' => '#000000',
|
799 |
),
|
800 |
-
|
801 |
-
|
802 |
-
|
803 |
-
|
804 |
-
|
805 |
-
|
806 |
-
|
807 |
-
|
808 |
-
|
809 |
-
|
810 |
-
|
811 |
-
|
812 |
-
|
813 |
-
|
814 |
-
|
815 |
-
|
816 |
-
|
817 |
-
|
818 |
-
|
819 |
-
|
820 |
-
|
821 |
-
|
822 |
array(
|
823 |
'icon' => 'reddit',
|
824 |
'category' => array(
|
@@ -918,13 +924,13 @@ return array(
|
|
918 |
),
|
919 |
'color' => '#7bb342',
|
920 |
),
|
921 |
-
|
922 |
-
|
923 |
-
|
924 |
-
|
925 |
-
|
926 |
-
|
927 |
-
|
928 |
array(
|
929 |
'icon' => 'stackoverflow',
|
930 |
'category' => array(
|
@@ -1199,22 +1205,22 @@ return array(
|
|
1199 |
),
|
1200 |
'color' => '#e02a20',
|
1201 |
),
|
1202 |
-
|
1203 |
-
|
1204 |
-
|
1205 |
-
|
1206 |
-
|
1207 |
-
|
1208 |
-
|
1209 |
-
|
1210 |
-
|
1211 |
-
|
1212 |
-
|
1213 |
-
|
1214 |
-
|
1215 |
-
|
1216 |
-
|
1217 |
-
|
1218 |
array(
|
1219 |
'icon' => 'zerply',
|
1220 |
'category' => array(
|
@@ -5332,7 +5338,7 @@ return array(
|
|
5332 |
'icon' => 'info-circle',
|
5333 |
'category' => array(
|
5334 |
'web-application',
|
5335 |
-
'spinner'
|
5336 |
),
|
5337 |
),
|
5338 |
|
@@ -18813,5 +18819,5 @@ return array(
|
|
18813 |
'marketing',
|
18814 |
),
|
18815 |
),
|
18816 |
-
)
|
18817 |
-
);
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* All icons packs data.
|
4 |
+
*
|
5 |
+
* @package WPZOOM_Social_Icons
|
6 |
+
*/
|
7 |
+
|
8 |
return array(
|
9 |
'socicon' => array(
|
10 |
array(
|
21 |
),
|
22 |
'color' => '#FF5A5F',
|
23 |
),
|
24 |
+
array(
|
25 |
+
'icon' => 'anchor',
|
26 |
+
'category' => array(
|
27 |
+
'business',
|
28 |
+
),
|
29 |
+
'color' => '#8940fa',
|
30 |
+
),
|
31 |
array(
|
32 |
'icon' => 'android',
|
33 |
'category' => array(
|
56 |
),
|
57 |
'color' => '#B9BFC1',
|
58 |
),
|
59 |
+
array(
|
60 |
+
'icon' => 'apple-podcasts',
|
61 |
+
'category' => array(
|
62 |
+
'podcast',
|
63 |
+
),
|
64 |
+
'color' => '#9933CC',
|
65 |
+
),
|
66 |
array(
|
67 |
'icon' => 'appnet',
|
68 |
'category' => array(
|
80 |
array(
|
81 |
'icon' => 'artstation',
|
82 |
'category' => array(
|
83 |
+
'software',
|
84 |
),
|
85 |
+
'color' => '#13aff0',
|
86 |
),
|
87 |
array(
|
88 |
'icon' => 'baidu',
|
142 |
),
|
143 |
'color' => '#000000',
|
144 |
),
|
145 |
+
array(
|
146 |
+
'icon' => 'castbox',
|
147 |
+
'category' => array(
|
148 |
+
'podcast',
|
149 |
+
),
|
150 |
+
'color' => '#F55B23',
|
151 |
+
),
|
152 |
array(
|
153 |
'icon' => 'codered',
|
154 |
'category' => array(
|
165 |
),
|
166 |
'color' => '#3E8DCC',
|
167 |
),
|
168 |
+
array(
|
169 |
+
'icon' => 'coronavirus',
|
170 |
+
'category' => array(
|
171 |
+
'general',
|
172 |
+
),
|
173 |
+
'color' => '#E6502A',
|
174 |
+
),
|
175 |
array(
|
176 |
'icon' => 'crunchbase',
|
177 |
'category' => array(
|
236 |
),
|
237 |
'color' => '#2e9fff',
|
238 |
),
|
239 |
+
array(
|
240 |
+
'icon' => 'displate',
|
241 |
+
'category' => array(
|
242 |
+
'communication',
|
243 |
+
'web-tools',
|
244 |
+
),
|
245 |
+
'color' => '#2e9fff',
|
246 |
+
),
|
247 |
array(
|
248 |
'icon' => 'dribbble',
|
249 |
'category' => array(
|
281 |
),
|
282 |
'color' => '#82B540',
|
283 |
),
|
284 |
+
array(
|
285 |
+
'icon' => 'etsy',
|
286 |
+
'category' => array(
|
287 |
+
'ecommerce',
|
288 |
+
),
|
289 |
+
'color' => '#F16521',
|
290 |
+
),
|
291 |
array(
|
292 |
'icon' => 'eyeem',
|
293 |
'category' => array(
|
325 |
),
|
326 |
'color' => '#34B151',
|
327 |
),
|
328 |
+
array(
|
329 |
+
'icon' => 'fiverr',
|
330 |
+
'category' => array(
|
331 |
+
'web-tools',
|
332 |
+
),
|
333 |
+
'color' => '#1DBF73',
|
334 |
+
),
|
335 |
array(
|
336 |
'icon' => 'flattr',
|
337 |
'category' => array(
|
378 |
),
|
379 |
'color' => '#2F72C4',
|
380 |
),
|
381 |
+
array(
|
382 |
+
'icon' => 'gab',
|
383 |
+
'category' => array(
|
384 |
+
'social-network',
|
385 |
+
),
|
386 |
+
'color' => '#28cf7a',
|
387 |
+
),
|
388 |
array(
|
389 |
'icon' => 'github',
|
390 |
'category' => array(
|
409 |
array(
|
410 |
'icon' => 'google-calendar',
|
411 |
'category' => array(
|
412 |
+
'calendar',
|
413 |
),
|
414 |
+
'color' => '#3D81F6',
|
415 |
),
|
416 |
array(
|
417 |
'icon' => 'google-maps',
|
418 |
'category' => array(
|
419 |
+
'maps',
|
420 |
+
),
|
421 |
+
'color' => '#4285F4',
|
422 |
+
),
|
423 |
+
array(
|
424 |
+
'icon' => 'google-news',
|
425 |
+
'category' => array(
|
426 |
+
'maps',
|
427 |
+
),
|
428 |
+
'color' => '#174EA6',
|
429 |
+
),
|
430 |
+
array(
|
431 |
+
'icon' => 'google-podcasts',
|
432 |
+
'category' => array(
|
433 |
+
'podcasts',
|
434 |
+
),
|
435 |
+
'color' => '#4285F4',
|
436 |
+
),
|
437 |
array(
|
438 |
'icon' => 'grooveshark',
|
439 |
'category' => array(
|
441 |
),
|
442 |
'color' => '#000000',
|
443 |
),
|
444 |
+
array(
|
445 |
+
'icon' => 'guilded',
|
446 |
+
'category' => array(
|
447 |
+
'gaming',
|
448 |
+
),
|
449 |
+
'color' => '#F5C400',
|
450 |
+
),
|
451 |
array(
|
452 |
'icon' => 'hellocoton',
|
453 |
'category' => array(
|
477 |
),
|
478 |
'color' => '#000000',
|
479 |
),
|
480 |
+
array(
|
481 |
+
'icon' => 'iheartradio',
|
482 |
+
'category' => array(
|
483 |
+
'blogging',
|
484 |
+
'social-media',
|
485 |
+
),
|
486 |
+
'color' => '#C6002B',
|
487 |
+
),
|
488 |
array(
|
489 |
'icon' => 'instagram',
|
490 |
'category' => array(
|
496 |
array(
|
497 |
'icon' => 'issuu',
|
498 |
'category' => array(
|
499 |
+
'reading',
|
500 |
),
|
501 |
+
'color' => '#F26F61',
|
502 |
),
|
503 |
array(
|
504 |
'icon' => 'itunes',
|
507 |
),
|
508 |
'color' => '#F16061',
|
509 |
),
|
510 |
+
array(
|
511 |
+
'icon' => 'kkbox',
|
512 |
+
'category' => array(
|
513 |
+
'music',
|
514 |
+
),
|
515 |
+
'color' => '#20afd6',
|
516 |
+
),
|
517 |
+
array(
|
518 |
+
'icon' => 'ko-fi',
|
519 |
+
'category' => array(
|
520 |
+
'music',
|
521 |
+
),
|
522 |
+
'color' => '#ff5e51',
|
523 |
+
),
|
524 |
+
array(
|
525 |
+
'icon' => 'komoot',
|
526 |
+
'category' => array(
|
527 |
+
'travel',
|
528 |
+
),
|
529 |
+
'color' => '#6AA127',
|
530 |
+
),
|
531 |
array(
|
532 |
'icon' => 'lanyrd',
|
533 |
'category' => array(
|
540 |
'category' => array(
|
541 |
'audio',
|
542 |
),
|
543 |
+
'color' => '#d41316',
|
544 |
),
|
545 |
array(
|
546 |
'icon' => 'letterboxd',
|
547 |
'category' => array(
|
548 |
+
'communication',
|
549 |
),
|
550 |
+
'color' => '#2c3440',
|
551 |
),
|
552 |
array(
|
553 |
'icon' => 'line',
|
579 |
),
|
580 |
'color' => '#000000',
|
581 |
),
|
582 |
+
array(
|
583 |
+
'icon' => 'mailru',
|
584 |
+
'category' => array(
|
585 |
+
'web-tools',
|
586 |
+
'communication',
|
587 |
+
),
|
588 |
+
'color' => '#005FF9',
|
589 |
+
),
|
590 |
+
array(
|
591 |
+
'icon' => 'mailchimp',
|
592 |
+
'category' => array(
|
593 |
+
'web-tools',
|
594 |
+
'communication',
|
595 |
+
),
|
596 |
+
'color' => '#FFE01B',
|
597 |
+
),
|
598 |
+
array(
|
599 |
+
'icon' => 'mailchimp2',
|
600 |
+
'category' => array(
|
601 |
+
'web-tools',
|
602 |
+
'communication',
|
603 |
+
),
|
604 |
+
'color' => '#FFE01B',
|
605 |
+
),
|
606 |
array(
|
607 |
'icon' => 'mastodon',
|
608 |
'category' => array(
|
630 |
'social-media',
|
631 |
'communication',
|
632 |
),
|
633 |
+
'color' => '#0084ff',
|
634 |
+
),
|
635 |
+
array(
|
636 |
+
'icon' => 'mewe',
|
637 |
+
'category' => array(
|
638 |
+
'social-media',
|
639 |
+
'communication',
|
640 |
+
),
|
641 |
+
'color' => '#17377F',
|
642 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
643 |
array(
|
644 |
'icon' => 'mixer',
|
645 |
'category' => array(
|
646 |
'social-media',
|
647 |
+
'video',
|
648 |
),
|
649 |
+
'color' => '#1FBAED',
|
650 |
),
|
651 |
array(
|
652 |
'icon' => 'myspace',
|
669 |
),
|
670 |
'color' => '#075B2F',
|
671 |
),
|
672 |
+
array(
|
673 |
+
'icon' => 'newgrounds',
|
674 |
+
'category' => array(
|
675 |
+
'news',
|
676 |
+
),
|
677 |
+
'color' => '#000',
|
678 |
+
),
|
679 |
array(
|
680 |
'icon' => 'nextdoor',
|
681 |
'category' => array(
|
683 |
),
|
684 |
'color' => '#8ed500',
|
685 |
),
|
686 |
+
array(
|
687 |
+
'icon' => 'nextdoor2',
|
688 |
+
'category' => array(
|
689 |
+
'business',
|
690 |
+
),
|
691 |
+
'color' => '#01B247',
|
692 |
+
),
|
693 |
array(
|
694 |
'icon' => 'odnoklassniki',
|
695 |
'category' => array(
|
712 |
),
|
713 |
'color' => '#0072C6',
|
714 |
),
|
715 |
+
array(
|
716 |
+
'icon' => 'overcast',
|
717 |
+
'category' => array(
|
718 |
+
'podcast',
|
719 |
+
),
|
720 |
+
'color' => '#FC7E0F',
|
721 |
+
),
|
722 |
array(
|
723 |
'icon' => 'overwatch',
|
724 |
'category' => array(
|
728 |
),
|
729 |
'color' => '#9E9E9E',
|
730 |
),
|
731 |
+
array(
|
732 |
+
'icon' => 'parler',
|
733 |
+
'category' => array(
|
734 |
+
'social-network',
|
735 |
+
),
|
736 |
+
'color' => '#b91d2b',
|
737 |
+
),
|
738 |
array(
|
739 |
'icon' => 'patreon',
|
740 |
'category' => array(
|
773 |
),
|
774 |
'color' => '#c92619',
|
775 |
),
|
776 |
+
array(
|
777 |
+
'icon' => 'pixiv',
|
778 |
+
'category' => array(
|
779 |
+
'social-media',
|
780 |
+
),
|
781 |
+
'color' => '#049CFF',
|
782 |
+
),
|
783 |
array(
|
784 |
'icon' => 'play',
|
785 |
'category' => array(
|
787 |
),
|
788 |
'color' => '#000000',
|
789 |
),
|
790 |
+
array(
|
791 |
+
'icon' => 'playerfm',
|
792 |
+
'category' => array(
|
793 |
+
'podcast',
|
794 |
+
'video',
|
795 |
+
),
|
796 |
+
'color' => '#C8122A',
|
797 |
+
),
|
798 |
array(
|
799 |
'icon' => 'playstation',
|
800 |
'category' => array(
|
803 |
),
|
804 |
'color' => '#000000',
|
805 |
),
|
806 |
+
array(
|
807 |
+
'icon' => 'pocketcasts',
|
808 |
+
'category' => array(
|
809 |
+
'podcast',
|
810 |
+
),
|
811 |
+
'color' => '#F43E37',
|
812 |
+
),
|
813 |
+
array(
|
814 |
+
'icon' => 'ravelry',
|
815 |
+
'category' => array(
|
816 |
+
'social-media',
|
817 |
+
),
|
818 |
+
'color' => '#EE6E62',
|
819 |
+
),
|
820 |
+
array(
|
821 |
+
'icon' => 'redbubble',
|
822 |
+
'category' => array(
|
823 |
+
'news',
|
824 |
+
'social-media',
|
825 |
+
),
|
826 |
+
'color' => '#E41321',
|
827 |
+
),
|
828 |
array(
|
829 |
'icon' => 'reddit',
|
830 |
'category' => array(
|
924 |
),
|
925 |
'color' => '#7bb342',
|
926 |
),
|
927 |
+
array(
|
928 |
+
'icon' => 'ssrn',
|
929 |
+
'category' => array(
|
930 |
+
'audio',
|
931 |
+
),
|
932 |
+
'color' => '#063a73',
|
933 |
+
),
|
934 |
array(
|
935 |
'icon' => 'stackoverflow',
|
936 |
'category' => array(
|
1205 |
),
|
1206 |
'color' => '#e02a20',
|
1207 |
),
|
1208 |
+
array(
|
1209 |
+
'icon' => 'yummly',
|
1210 |
+
'category' => array(
|
1211 |
+
'video',
|
1212 |
+
'search-engines',
|
1213 |
+
),
|
1214 |
+
'color' => '#e16220',
|
1215 |
+
),
|
1216 |
+
array(
|
1217 |
+
'icon' => 'zazzle',
|
1218 |
+
'category' => array(
|
1219 |
+
'video',
|
1220 |
+
'games',
|
1221 |
+
),
|
1222 |
+
'color' => '#46c3e0',
|
1223 |
+
),
|
1224 |
array(
|
1225 |
'icon' => 'zerply',
|
1226 |
'category' => array(
|
5338 |
'icon' => 'info-circle',
|
5339 |
'category' => array(
|
5340 |
'web-application',
|
5341 |
+
'spinner',
|
5342 |
),
|
5343 |
),
|
5344 |
|
18819 |
'marketing',
|
18820 |
),
|
18821 |
),
|
18822 |
+
),
|
18823 |
+
);
|
includes/zoom-helper.php
ADDED
@@ -0,0 +1,183 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Helper functions.
|
4 |
+
*
|
5 |
+
* @package WPZOOM_Social_Icons
|
6 |
+
*/
|
7 |
+
|
8 |
+
// Exit if accessed directly.
|
9 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
10 |
+
exit;
|
11 |
+
}
|
12 |
+
|
13 |
+
if ( ! function_exists( 'zoom_pointer_load' ) ) :
|
14 |
+
/**
|
15 |
+
* Load pointer scripts
|
16 |
+
*
|
17 |
+
* @param string $hook_suffix The current admin page.
|
18 |
+
* @return void
|
19 |
+
*/
|
20 |
+
function zoom_pointer_load( $hook_suffix ) {
|
21 |
+
|
22 |
+
// Don't run on WP < 3.3.
|
23 |
+
if ( get_bloginfo( 'version' ) < '3.3' ) {
|
24 |
+
return;
|
25 |
+
}
|
26 |
+
|
27 |
+
$screen = get_current_screen();
|
28 |
+
$screen_id = $screen->id;
|
29 |
+
|
30 |
+
// Get pointers for this screen.
|
31 |
+
$pointers = apply_filters( 'zoom_admin_pointers_' . $screen_id, array() );
|
32 |
+
|
33 |
+
if ( ! $pointers || ! is_array( $pointers ) ) {
|
34 |
+
return;
|
35 |
+
}
|
36 |
+
|
37 |
+
// Get dismissed pointers.
|
38 |
+
$dismissed = explode( ',', (string) get_user_meta( get_current_user_id(), 'dismissed_wp_pointers', true ) );
|
39 |
+
$valid_pointers = array();
|
40 |
+
|
41 |
+
// Check pointers and remove dismissed ones.
|
42 |
+
foreach ( $pointers as $pointer_id => $pointer ) {
|
43 |
+
|
44 |
+
// Sanity check.
|
45 |
+
if ( in_array( $pointer_id, $dismissed ) || empty( $pointer ) || empty( $pointer_id ) || empty( $pointer['target'] ) || empty( $pointer['options'] ) ) {
|
46 |
+
continue;
|
47 |
+
}
|
48 |
+
|
49 |
+
$pointer['pointer_id'] = $pointer_id;
|
50 |
+
|
51 |
+
// Add the pointer to $valid_pointers array.
|
52 |
+
$valid_pointers['pointers'][] = $pointer;
|
53 |
+
}
|
54 |
+
|
55 |
+
// No valid pointers? Stop here.
|
56 |
+
if ( empty( $valid_pointers ) ) {
|
57 |
+
return;
|
58 |
+
}
|
59 |
+
|
60 |
+
wp_localize_script(
|
61 |
+
'wp-pointer',
|
62 |
+
'wpPointerL10n',
|
63 |
+
array(
|
64 |
+
'dismiss' => __( 'I already did this', 'zoom-social-icons-widget' ),
|
65 |
+
)
|
66 |
+
);
|
67 |
+
// Add pointers style to queue.
|
68 |
+
wp_enqueue_style( 'wp-pointer' );
|
69 |
+
|
70 |
+
// Add pointers script to queue. Add custom script.
|
71 |
+
wp_enqueue_script(
|
72 |
+
'zoom-social-pointer',
|
73 |
+
plugins_url( 'assets/js/zoom-social-pointer.js', WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . '/social-icons-widget-by-wpzoom.php' ),
|
74 |
+
array( 'wp-pointer' ),
|
75 |
+
filemtime( WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . 'assets/js/zoom-social-pointer.js' ),
|
76 |
+
true
|
77 |
+
);
|
78 |
+
|
79 |
+
// Add pointer options to script.
|
80 |
+
wp_localize_script( 'zoom-social-pointer', 'zoom_social_pointer', $valid_pointers );
|
81 |
+
}
|
82 |
+
endif;
|
83 |
+
|
84 |
+
if ( ! function_exists( 'zoom_register_pointer_callback' ) ) :
|
85 |
+
/**
|
86 |
+
* Register pointer callback
|
87 |
+
*
|
88 |
+
* @param array $p Pointer data.
|
89 |
+
* @return array
|
90 |
+
*/
|
91 |
+
function zoom_register_pointer_callback( $p ) {
|
92 |
+
$pointer = zoom_get_pointer_data();
|
93 |
+
|
94 |
+
if ( ! empty( $pointer['transient_name'] ) && ! empty( $pointer['lifetime'] ) && ! get_site_transient( $pointer['transient_name'] ) ) {
|
95 |
+
zoom_set_pointer_transient( $pointer['transient_name'], $pointer['lifetime'] );
|
96 |
+
}
|
97 |
+
|
98 |
+
if ( ! empty( $pointer['transient_name'] ) && get_option( '_site_transient_timeout_' . $pointer['transient_name'] ) ) {
|
99 |
+
$data_timeout = get_option( '_site_transient_timeout_' . $pointer['transient_name'] );
|
100 |
+
$lifetime = ! empty( $pointer['lifetime'] ) ? $pointer['lifetime'] : MONTH_IN_SECONDS * 6;
|
101 |
+
$delay_time = ! empty( $pointer['delay_time'] ) ? $pointer['delay_time'] : DAY_IN_SECONDS * 3;
|
102 |
+
|
103 |
+
if ( time() > $data_timeout - ( $lifetime - $delay_time ) ) {
|
104 |
+
$p[ $pointer['transient_name'] ] = $pointer;
|
105 |
+
}
|
106 |
+
}
|
107 |
+
|
108 |
+
return $p;
|
109 |
+
}
|
110 |
+
endif;
|
111 |
+
|
112 |
+
if ( ! function_exists( 'zoom_set_pointer_transient' ) ) :
|
113 |
+
/**
|
114 |
+
* Set pointer transient
|
115 |
+
*
|
116 |
+
* @param string $key Transient key name.
|
117 |
+
* @param string $time Transient expiration time.
|
118 |
+
* @return void
|
119 |
+
*/
|
120 |
+
function zoom_set_pointer_transient( $key, $time ) {
|
121 |
+
set_site_transient( $key, true, $time );
|
122 |
+
}
|
123 |
+
endif;
|
124 |
+
|
125 |
+
if ( ! function_exists( 'zoom_ajax_set_pointer_transient' ) ) :
|
126 |
+
/**
|
127 |
+
* Set pointer transient via AJAX
|
128 |
+
*
|
129 |
+
* @return mixed|void
|
130 |
+
*/
|
131 |
+
function zoom_ajax_set_pointer_transient() {
|
132 |
+
// phpcs:ignore WordPress.Security.NonceVerification.Missing
|
133 |
+
if ( empty( $_POST['lifetime'] ) && empty( $_POST['transient_name'] ) && ! is_int( $_POST['lifetime'] ) && ! is_string( $_POST['transient_name'] ) ) {
|
134 |
+
return wp_send_json_error( array( 'response' => 'Failed, $lifetime is not int or empty, $transient name is not string or empty' ) );
|
135 |
+
}
|
136 |
+
|
137 |
+
// phpcs:ignore WordPress.Security.NonceVerification.Missing
|
138 |
+
zoom_set_pointer_transient( $_POST['transient_name'], $_POST['lifetime'] );
|
139 |
+
wp_send_json_success( array( 'response' => 'Done, transient is set' ) );
|
140 |
+
}
|
141 |
+
endif;
|
142 |
+
|
143 |
+
if ( ! function_exists( 'zoom_get_pointer_data' ) ) :
|
144 |
+
/**
|
145 |
+
* Get pointer data
|
146 |
+
*
|
147 |
+
* @return array
|
148 |
+
*/
|
149 |
+
function zoom_get_pointer_data() {
|
150 |
+
$plugin_data = get_plugin_data( WPZOOM_SOCIAL_ICONS_PLUGIN_PATH . '/social-icons-widget-by-wpzoom.php' );
|
151 |
+
$plugin_name = $plugin_data['Name'];
|
152 |
+
|
153 |
+
$pointer_content = esc_html__( 'Thank you for using', 'zoom-social-icons-widget' ) . ' <b>Social Icons Widget by WPZOOM!</b><br/>';
|
154 |
+
$pointer_content .= esc_html__( 'Would you mind taking a moment to rate it! It won\'t take more than two minutes.', 'zoom-social-icons-widget' );
|
155 |
+
$pointer_content .= '<p><b>' . esc_html__( 'Thanks for your support!', 'zoom-social-icons-widget' ) . '</b></p>';
|
156 |
+
$pointer_content .= '<p><a class="button button-primary button-hero" href="https://wordpress.org/support/plugin/social-icons-widget-by-wpzoom/reviews/#new-post" target="_blank"> ★ ' . esc_html__( 'Rate Now', 'zoom-social-icons-widget' ) . ' ★</a></p>';
|
157 |
+
$pointer_content .= '<p><a class="zoom-social-remind-me-later button button-secondary button-hero">' . esc_html__( 'Remind Me later!', 'zoom-social-icons-widget' ) . '</a></p>';
|
158 |
+
|
159 |
+
return array(
|
160 |
+
'target' => '#wp-admin-bar-my-account',
|
161 |
+
'options' => array(
|
162 |
+
'content' => sprintf(
|
163 |
+
'<h3> %s </h3> <p> %s </p>',
|
164 |
+
__( 'Rate Social Icons Widget by WPZOOM', 'zoom-social-icons-widget' ),
|
165 |
+
$pointer_content
|
166 |
+
),
|
167 |
+
'position' => array(
|
168 |
+
'edge' => 'top',
|
169 |
+
'align' => 'left',
|
170 |
+
),
|
171 |
+
'pointerClass' => 'wp-pointer zoom-pointer-class',
|
172 |
+
'pointerWidth' => 400,
|
173 |
+
),
|
174 |
+
'lifetime' => MONTH_IN_SECONDS * 6,
|
175 |
+
'delay_time' => DAY_IN_SECONDS * 2,
|
176 |
+
'transient_name' => 'zoom-social-pointer',
|
177 |
+
);
|
178 |
+
}
|
179 |
+
endif;
|
180 |
+
|
181 |
+
add_action( 'admin_enqueue_scripts', 'zoom_pointer_load', 1000 );
|
182 |
+
add_action( 'wp_ajax_zoom_ajax_set_pointer_transient', 'zoom_ajax_set_pointer_transient' );
|
183 |
+
add_filter( 'zoom_admin_pointers_widgets', 'zoom_register_pointer_callback' );
|
readme.txt
CHANGED
@@ -2,11 +2,11 @@
|
|
2 |
Contributors: WPZOOM, nvartolomei, ciorici, llemurya
|
3 |
Donate link: https://www.wpzoom.com/
|
4 |
Tags: social icons, social networks, social media, social media icons, icons, social profiles, social widget, widget, block, social block, block icons, academicons, elementor, social networking, sharing, share buttons, fontawesome
|
5 |
-
Requires at least: 5.
|
6 |
Requires PHP: 5.6
|
7 |
Tested up to: 5.8
|
8 |
Stable tag: trunk
|
9 |
-
License:
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
12 |
Social Icons Widget & Block helps adding icons with links to social media profiles on your website. Supports more than 100 websites and includes 400 icons.
|
@@ -152,6 +152,13 @@ You can also create a hidden widget area using a plugin like Custom Sidebars if
|
|
152 |
|
153 |
== Changelog ==
|
154 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
155 |
= 4.2.0 =
|
156 |
* Fixed compatibility issues with WordPress 5.8
|
157 |
* Added warning notice to widgets block-based page. Please make sure you've read the message before doing some changes to widgets!
|
2 |
Contributors: WPZOOM, nvartolomei, ciorici, llemurya
|
3 |
Donate link: https://www.wpzoom.com/
|
4 |
Tags: social icons, social networks, social media, social media icons, icons, social profiles, social widget, widget, block, social block, block icons, academicons, elementor, social networking, sharing, share buttons, fontawesome
|
5 |
+
Requires at least: 5.2
|
6 |
Requires PHP: 5.6
|
7 |
Tested up to: 5.8
|
8 |
Stable tag: trunk
|
9 |
+
License: GNU General Public License v2.0 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
12 |
Social Icons Widget & Block helps adding icons with links to social media profiles on your website. Supports more than 100 websites and includes 400 icons.
|
152 |
|
153 |
== Changelog ==
|
154 |
|
155 |
+
= 4.2.2 =
|
156 |
+
* Fixed an issue with the Legacy Widget
|
157 |
+
|
158 |
+
= 4.2.1 =
|
159 |
+
* Multiple fixes and improvements when converting legacy widgets to blocks
|
160 |
+
* Improvements to icon styles in the Social Icons Block
|
161 |
+
|
162 |
= 4.2.0 =
|
163 |
* Fixed compatibility issues with WordPress 5.8
|
164 |
* Added warning notice to widgets block-based page. Please make sure you've read the message before doing some changes to widgets!
|
social-icons-widget-by-wpzoom.php
CHANGED
@@ -1,17 +1,22 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Plugin Name:
|
4 |
-
* Plugin URI:
|
5 |
-
* Description:
|
6 |
-
*
|
7 |
-
* Author
|
8 |
-
*
|
9 |
-
*
|
10 |
-
*
|
11 |
-
*
|
|
|
|
|
|
|
|
|
12 |
*/
|
|
|
13 |
if ( ! defined( 'WPZOOM_SOCIAL_ICONS_PLUGIN_VERSION' ) ) {
|
14 |
-
define( 'WPZOOM_SOCIAL_ICONS_PLUGIN_VERSION', '4.
|
15 |
}
|
16 |
|
17 |
if ( ! defined( 'WPZOOM_SOCIAL_ICONS_PLUGIN_URL' ) ) {
|
@@ -22,8 +27,12 @@ if ( ! defined( 'WPZOOM_SOCIAL_ICONS_PLUGIN_PATH' ) ) {
|
|
22 |
define( 'WPZOOM_SOCIAL_ICONS_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
|
23 |
}
|
24 |
|
25 |
-
|
26 |
-
|
|
|
|
|
|
|
|
|
27 |
|
28 |
$wpzoom_social_icons_settings = WPZOOM_Social_Icons_Settings::get_settings();
|
29 |
|
@@ -32,95 +41,113 @@ if ( empty( $wpzoom_social_icons_settings['disable-block'] ) ) {
|
|
32 |
}
|
33 |
|
34 |
if ( empty( $wpzoom_social_icons_settings['disable-widget'] ) ) {
|
35 |
-
require_once plugin_dir_path( __FILE__ ) . 'class
|
36 |
|
37 |
/**
|
38 |
* Register the widget
|
39 |
*/
|
40 |
-
add_action(
|
41 |
-
|
42 |
-
|
43 |
-
|
|
|
|
|
44 |
}
|
45 |
|
|
|
|
|
|
|
|
|
|
|
46 |
function zoom_social_icons_enqueue_fonts() {
|
47 |
-
|
48 |
if ( wp_style_is( 'wpzoom-social-icons-academicons' ) ) {
|
49 |
-
wp_enqueue_style( 'wpzoom-social-icons-font-academicons-ttf', WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/font/academicons.ttf?v=1.8.6',
|
50 |
-
wp_enqueue_style( 'wpzoom-social-icons-font-academicons-woff', WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/font/academicons.woff?v=1.8.6',
|
51 |
}
|
52 |
|
53 |
if ( wp_style_is( 'wpzoom-social-icons-font-awesome-3' ) ) {
|
54 |
-
wp_enqueue_style( 'wpzoom-social-icons-font-fontawesome-3-ttf', WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/font/fontawesome-webfont.ttf?v=4.7.0',
|
55 |
-
wp_enqueue_style( 'wpzoom-social-icons-font-fontawesome-3-woff', WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/font/fontawesome-webfont.woff?v=4.7.0',
|
56 |
-
wp_enqueue_style( 'wpzoom-social-icons-font-fontawesome-3-woff2', WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/font/fontawesome-webfont.woff2?v=4.7.0',
|
57 |
}
|
58 |
|
59 |
if ( wp_style_is( 'wpzoom-social-icons-font-awesome-5' ) ) {
|
60 |
-
wp_enqueue_style( 'wpzoom-social-icons-font-fontawesome-5-brands-ttf', WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/font/fa-brands-400.ttf',
|
61 |
-
wp_enqueue_style( 'wpzoom-social-icons-font-fontawesome-5-brands-woff', WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/font/fa-brands-400.woff',
|
62 |
-
wp_enqueue_style( 'wpzoom-social-icons-font-fontawesome-5-brands-woff2', WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/font/fa-brands-400.woff2',
|
63 |
|
64 |
-
wp_enqueue_style( 'wpzoom-social-icons-font-fontawesome-5-regular-ttf', WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/font/fa-regular-400.ttf',
|
65 |
-
wp_enqueue_style( 'wpzoom-social-icons-font-fontawesome-5-regular-woff', WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/font/fa-regular-400.woff',
|
66 |
-
wp_enqueue_style( 'wpzoom-social-icons-font-fontawesome-5-regular-woff2', WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/font/fa-regular-400.woff2',
|
67 |
|
68 |
-
wp_enqueue_style( 'wpzoom-social-icons-font-fontawesome-5-solid-ttf', WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/font/fa-solid-900.ttf',
|
69 |
-
wp_enqueue_style( 'wpzoom-social-icons-font-fontawesome-5-solid-woff', WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/font/fa-solid-900.woff',
|
70 |
-
wp_enqueue_style( 'wpzoom-social-icons-font-fontawesome-5-solid-woff2', WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/font/fa-solid-900.woff2',
|
71 |
|
72 |
-
wp_enqueue_style( 'wpzoom-social-icons-font-fontawesome-5-solid-ttf', WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/font/fa-solid-900.ttf',
|
73 |
-
wp_enqueue_style( 'wpzoom-social-icons-font-fontawesome-5-solid-woff', WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/font/fa-solid-900.woff',
|
74 |
-
wp_enqueue_style( 'wpzoom-social-icons-font-fontawesome-5-solid-woff2', WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/font/fa-solid-900.woff2',
|
75 |
}
|
76 |
|
77 |
if ( wp_style_is( 'wpzoom-social-icons-genericons' ) ) {
|
78 |
-
wp_enqueue_style( 'wpzoom-social-icons-font-genericons-ttf', WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/font/Genericons.ttf',
|
79 |
-
wp_enqueue_style( 'wpzoom-social-icons-font-genericons-woff', WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/font/Genericons.woff',
|
80 |
}
|
81 |
|
82 |
if ( wp_style_is( 'wpzoom-social-icons-socicon' ) ) {
|
83 |
-
wp_enqueue_style( 'wpzoom-social-icons-font-socicon-ttf', WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/font/socicon.ttf?v='.WPZOOM_SOCIAL_ICONS_PLUGIN_VERSION,
|
84 |
-
wp_enqueue_style( 'wpzoom-social-icons-font-socicon-woff', WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/font/socicon.woff?v='.WPZOOM_SOCIAL_ICONS_PLUGIN_VERSION,
|
85 |
}
|
86 |
-
|
87 |
}
|
88 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
89 |
function zoom_social_icons_add_preload_to_rel_attribute( $tag, $handle, $href ) {
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
|
|
|
|
117 |
|
118 |
return $tag;
|
119 |
}
|
120 |
|
121 |
-
|
122 |
/**
|
123 |
* Load textdomain
|
|
|
|
|
124 |
*/
|
125 |
function zoom_social_icons_widget_load_textdomain() {
|
126 |
load_plugin_textdomain( 'zoom-social-icons-widget', false, plugin_basename( dirname( __FILE__ ) ) . '/languages' );
|
@@ -128,6 +155,10 @@ function zoom_social_icons_widget_load_textdomain() {
|
|
128 |
|
129 |
/**
|
130 |
* Hide old widget
|
|
|
|
|
|
|
|
|
131 |
*/
|
132 |
function zoom_social_icons_widget_hide( $widget_types ) {
|
133 |
$widget_types[] = 'zoom-social-icons-widget';
|
@@ -138,50 +169,274 @@ add_filter( 'widget_types_to_hide_from_legacy_widget_block', 'zoom_social_icons_
|
|
138 |
/**
|
139 |
* Generate select values for block and widget options that are synced with fonts loading values from Settings Page.
|
140 |
*
|
141 |
-
* @param string $type
|
142 |
*
|
143 |
-
* @return array
|
144 |
*/
|
145 |
function zoom_social_icons_kits_categories_list( $type = 'widget' ) {
|
146 |
-
|
147 |
$icons_kits = WPZOOM_Social_Icons_Settings::get_settings_for_icons_kits();
|
148 |
|
149 |
-
$categories_list =
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
155 |
|
156 |
if ( 'widget' === $type ) {
|
157 |
-
$categories_list[] =
|
|
|
|
|
|
|
158 |
}
|
159 |
|
160 |
if ( 'block' === $type ) {
|
161 |
-
$categories_list[] =
|
162 |
-
|
163 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
164 |
}
|
165 |
|
166 |
-
|
|
|
167 |
return $categories_list;
|
168 |
}
|
169 |
|
170 |
-
return array_filter(
|
171 |
-
|
172 |
-
|
|
|
|
|
|
|
173 |
}
|
174 |
-
|
175 |
add_action( 'init', 'zoom_social_icons_widget_load_textdomain' );
|
176 |
|
177 |
/**
|
178 |
-
* Set hooks for enqueue preloaded fonts
|
|
|
|
|
179 |
*/
|
180 |
-
|
181 |
-
|
182 |
-
if ( ! empty(
|
183 |
add_action( 'wp_enqueue_scripts', 'zoom_social_icons_enqueue_fonts', 999 );
|
184 |
add_filter( 'style_loader_tag', 'zoom_social_icons_add_preload_to_rel_attribute', 10, 3 );
|
185 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
186 |
|
187 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<?php
|
2 |
/**
|
3 |
+
* Plugin Name: Social Icons Widget & Block by WPZOOM
|
4 |
+
* Plugin URI: https://www.wpzoom.com/plugins/social-widget/
|
5 |
+
* Description: Social Icons Widget & Block to display links to social media networks websites. Supports most of the known social networks and includes more than 400 icons. Sort icons by Drag & Drop and change their color easily.
|
6 |
+
* Version: 4.2.2
|
7 |
+
* Author: WPZOOM
|
8 |
+
* Author URI: https://www.wpzoom.com/
|
9 |
+
* Text Domain: zoom-social-icons-widget
|
10 |
+
* License: GNU General Public License v2.0 or later
|
11 |
+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
|
12 |
+
* Requires at least: 5.2
|
13 |
+
* Tested up to: 5.8
|
14 |
+
*
|
15 |
+
* @package WPZOOM_Social_Icons
|
16 |
*/
|
17 |
+
|
18 |
if ( ! defined( 'WPZOOM_SOCIAL_ICONS_PLUGIN_VERSION' ) ) {
|
19 |
+
define( 'WPZOOM_SOCIAL_ICONS_PLUGIN_VERSION', '4.2.2' );
|
20 |
}
|
21 |
|
22 |
if ( ! defined( 'WPZOOM_SOCIAL_ICONS_PLUGIN_URL' ) ) {
|
27 |
define( 'WPZOOM_SOCIAL_ICONS_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
|
28 |
}
|
29 |
|
30 |
+
if ( ! defined( 'WPZOOM_SOCIAL_ICONS_PLUGIN_BASE' ) ) {
|
31 |
+
define( 'WPZOOM_SOCIAL_ICONS_PLUGIN_BASE', plugin_basename( __FILE__ ) );
|
32 |
+
}
|
33 |
+
|
34 |
+
require_once plugin_dir_path( __FILE__ ) . 'includes/classes/class-wpzoom-social-icons-settings.php';
|
35 |
+
require_once plugin_dir_path( __FILE__ ) . 'includes/zoom-helper.php';
|
36 |
|
37 |
$wpzoom_social_icons_settings = WPZOOM_Social_Icons_Settings::get_settings();
|
38 |
|
41 |
}
|
42 |
|
43 |
if ( empty( $wpzoom_social_icons_settings['disable-widget'] ) ) {
|
44 |
+
require_once plugin_dir_path( __FILE__ ) . 'includes/classes/class-zoom-social-icons-widget.php';
|
45 |
|
46 |
/**
|
47 |
* Register the widget
|
48 |
*/
|
49 |
+
add_action(
|
50 |
+
'widgets_init',
|
51 |
+
function () {
|
52 |
+
register_widget( 'Zoom_Social_Icons_Widget' );
|
53 |
+
}
|
54 |
+
);
|
55 |
}
|
56 |
|
57 |
+
/**
|
58 |
+
* Load icon fonts libraries
|
59 |
+
*
|
60 |
+
* @return void
|
61 |
+
*/
|
62 |
function zoom_social_icons_enqueue_fonts() {
|
63 |
+
// phpcs:disable WordPress.WP.EnqueuedResourceParameters.MissingVersion
|
64 |
if ( wp_style_is( 'wpzoom-social-icons-academicons' ) ) {
|
65 |
+
wp_enqueue_style( 'wpzoom-social-icons-font-academicons-ttf', WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/font/academicons.ttf?v=1.8.6', array(), null );
|
66 |
+
wp_enqueue_style( 'wpzoom-social-icons-font-academicons-woff', WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/font/academicons.woff?v=1.8.6', array(), null );
|
67 |
}
|
68 |
|
69 |
if ( wp_style_is( 'wpzoom-social-icons-font-awesome-3' ) ) {
|
70 |
+
wp_enqueue_style( 'wpzoom-social-icons-font-fontawesome-3-ttf', WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/font/fontawesome-webfont.ttf?v=4.7.0', array(), null );
|
71 |
+
wp_enqueue_style( 'wpzoom-social-icons-font-fontawesome-3-woff', WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/font/fontawesome-webfont.woff?v=4.7.0', array(), null );
|
72 |
+
wp_enqueue_style( 'wpzoom-social-icons-font-fontawesome-3-woff2', WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/font/fontawesome-webfont.woff2?v=4.7.0', array(), null );
|
73 |
}
|
74 |
|
75 |
if ( wp_style_is( 'wpzoom-social-icons-font-awesome-5' ) ) {
|
76 |
+
wp_enqueue_style( 'wpzoom-social-icons-font-fontawesome-5-brands-ttf', WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/font/fa-brands-400.ttf', array(), null );
|
77 |
+
wp_enqueue_style( 'wpzoom-social-icons-font-fontawesome-5-brands-woff', WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/font/fa-brands-400.woff', array(), null );
|
78 |
+
wp_enqueue_style( 'wpzoom-social-icons-font-fontawesome-5-brands-woff2', WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/font/fa-brands-400.woff2', array(), null );
|
79 |
|
80 |
+
wp_enqueue_style( 'wpzoom-social-icons-font-fontawesome-5-regular-ttf', WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/font/fa-regular-400.ttf', array(), null );
|
81 |
+
wp_enqueue_style( 'wpzoom-social-icons-font-fontawesome-5-regular-woff', WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/font/fa-regular-400.woff', array(), null );
|
82 |
+
wp_enqueue_style( 'wpzoom-social-icons-font-fontawesome-5-regular-woff2', WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/font/fa-regular-400.woff2', array(), null );
|
83 |
|
84 |
+
wp_enqueue_style( 'wpzoom-social-icons-font-fontawesome-5-solid-ttf', WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/font/fa-solid-900.ttf', array(), null );
|
85 |
+
wp_enqueue_style( 'wpzoom-social-icons-font-fontawesome-5-solid-woff', WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/font/fa-solid-900.woff', array(), null );
|
86 |
+
wp_enqueue_style( 'wpzoom-social-icons-font-fontawesome-5-solid-woff2', WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/font/fa-solid-900.woff2', array(), null );
|
87 |
|
88 |
+
wp_enqueue_style( 'wpzoom-social-icons-font-fontawesome-5-solid-ttf', WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/font/fa-solid-900.ttf', array(), null );
|
89 |
+
wp_enqueue_style( 'wpzoom-social-icons-font-fontawesome-5-solid-woff', WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/font/fa-solid-900.woff', array(), null );
|
90 |
+
wp_enqueue_style( 'wpzoom-social-icons-font-fontawesome-5-solid-woff2', WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/font/fa-solid-900.woff2', array(), null );
|
91 |
}
|
92 |
|
93 |
if ( wp_style_is( 'wpzoom-social-icons-genericons' ) ) {
|
94 |
+
wp_enqueue_style( 'wpzoom-social-icons-font-genericons-ttf', WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/font/Genericons.ttf', array(), null );
|
95 |
+
wp_enqueue_style( 'wpzoom-social-icons-font-genericons-woff', WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/font/Genericons.woff', array(), null );
|
96 |
}
|
97 |
|
98 |
if ( wp_style_is( 'wpzoom-social-icons-socicon' ) ) {
|
99 |
+
wp_enqueue_style( 'wpzoom-social-icons-font-socicon-ttf', WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/font/socicon.ttf?v=' . WPZOOM_SOCIAL_ICONS_PLUGIN_VERSION, array(), null );
|
100 |
+
wp_enqueue_style( 'wpzoom-social-icons-font-socicon-woff', WPZOOM_SOCIAL_ICONS_PLUGIN_URL . 'assets/font/socicon.woff?v=' . WPZOOM_SOCIAL_ICONS_PLUGIN_VERSION, array(), null );
|
101 |
}
|
|
|
102 |
}
|
103 |
|
104 |
+
/**
|
105 |
+
* Add preload to rel attribute
|
106 |
+
*
|
107 |
+
* @param string $tag The link tag for the enqueued style.
|
108 |
+
* @param string $handle The style's registered handle.
|
109 |
+
* @param string $href The stylesheet's source URL.
|
110 |
+
*
|
111 |
+
* @return string $tag The HTML link tag of an enqueued style.
|
112 |
+
*/
|
113 |
function zoom_social_icons_add_preload_to_rel_attribute( $tag, $handle, $href ) {
|
114 |
+
$style_handlers = apply_filters(
|
115 |
+
'wpzoom-social-icons-fonts-preload-filter',
|
116 |
+
array(
|
117 |
+
'wpzoom-social-icons-font-academicons-ttf',
|
118 |
+
'wpzoom-social-icons-font-academicons-woff',
|
119 |
+
'wpzoom-social-icons-font-fontawesome-3-ttf',
|
120 |
+
'wpzoom-social-icons-font-fontawesome-3-woff',
|
121 |
+
'wpzoom-social-icons-font-fontawesome-3-woff2',
|
122 |
+
'wpzoom-social-icons-font-genericons-ttf',
|
123 |
+
'wpzoom-social-icons-font-genericons-woff',
|
124 |
+
'wpzoom-social-icons-font-socicon-ttf',
|
125 |
+
'wpzoom-social-icons-font-socicon-woff',
|
126 |
+
'wpzoom-social-icons-font-fontawesome-5-brands-ttf',
|
127 |
+
'wpzoom-social-icons-font-fontawesome-5-brands-woff',
|
128 |
+
'wpzoom-social-icons-font-fontawesome-5-brands-woff2',
|
129 |
+
'wpzoom-social-icons-font-fontawesome-5-regular-ttf',
|
130 |
+
'wpzoom-social-icons-font-fontawesome-5-regular-woff',
|
131 |
+
'wpzoom-social-icons-font-fontawesome-5-regular-woff2',
|
132 |
+
'wpzoom-social-icons-font-fontawesome-5-solid-ttf',
|
133 |
+
'wpzoom-social-icons-font-fontawesome-5-solid-woff',
|
134 |
+
'wpzoom-social-icons-font-fontawesome-5-solid-woff2',
|
135 |
+
)
|
136 |
+
);
|
137 |
+
|
138 |
+
if ( in_array( $handle, $style_handlers ) ) {
|
139 |
+
$file_type = strtolower( pathinfo( basename( parse_url( $href, PHP_URL_PATH ) ), PATHINFO_EXTENSION ) );
|
140 |
+
$file_type = ! empty( $file_type ) ? ( "type='font/{$file_type}'" ) : '';
|
141 |
+
$tag = preg_replace( array( "/='stylesheet'/", "/media='all'/", "/type=['\"]text\/(css)['\"]/" ), array( "='preload' as='font' ", $file_type . ' crossorigin', '' ), $tag );
|
142 |
+
}
|
143 |
|
144 |
return $tag;
|
145 |
}
|
146 |
|
|
|
147 |
/**
|
148 |
* Load textdomain
|
149 |
+
*
|
150 |
+
* @return void
|
151 |
*/
|
152 |
function zoom_social_icons_widget_load_textdomain() {
|
153 |
load_plugin_textdomain( 'zoom-social-icons-widget', false, plugin_basename( dirname( __FILE__ ) ) . '/languages' );
|
155 |
|
156 |
/**
|
157 |
* Hide old widget
|
158 |
+
*
|
159 |
+
* @since 4.2.0
|
160 |
+
* @param array $widget_types Array of widgets types to hide from legacy widget block.
|
161 |
+
* @return array The parsed widget types
|
162 |
*/
|
163 |
function zoom_social_icons_widget_hide( $widget_types ) {
|
164 |
$widget_types[] = 'zoom-social-icons-widget';
|
169 |
/**
|
170 |
* Generate select values for block and widget options that are synced with fonts loading values from Settings Page.
|
171 |
*
|
172 |
+
* @param string $type Category type [widget, block].
|
173 |
*
|
174 |
+
* @return array
|
175 |
*/
|
176 |
function zoom_social_icons_kits_categories_list( $type = 'widget' ) {
|
|
|
177 |
$icons_kits = WPZOOM_Social_Icons_Settings::get_settings_for_icons_kits();
|
178 |
|
179 |
+
$categories_list = array(
|
180 |
+
array(
|
181 |
+
'value' => 'socicon',
|
182 |
+
'label' => __( 'Socicons', 'zoom-social-icons-widget' ),
|
183 |
+
),
|
184 |
+
array(
|
185 |
+
'value' => 'dashicons',
|
186 |
+
'label' => __( 'Dashicons', 'zoom-social-icons-widget' ),
|
187 |
+
),
|
188 |
+
array(
|
189 |
+
'value' => 'genericon',
|
190 |
+
'label' => __( 'Genericons', 'zoom-social-icons-widget' ),
|
191 |
+
),
|
192 |
+
array(
|
193 |
+
'value' => 'academicons',
|
194 |
+
'label' => __( 'Academicons', 'zoom-social-icons-widget' ),
|
195 |
+
),
|
196 |
+
);
|
197 |
|
198 |
if ( 'widget' === $type ) {
|
199 |
+
$categories_list[] = array(
|
200 |
+
'value' => 'fa',
|
201 |
+
'label' => __( 'Font Awesome', 'zoom-social-icons-widget' ),
|
202 |
+
);
|
203 |
}
|
204 |
|
205 |
if ( 'block' === $type ) {
|
206 |
+
$categories_list[] = array(
|
207 |
+
'value' => 'fab',
|
208 |
+
'label' => __( 'Font Awesome Brands', 'zoom-social-icons-widget' ),
|
209 |
+
);
|
210 |
+
$categories_list[] = array(
|
211 |
+
'value' => 'far',
|
212 |
+
'label' => __( 'Font Awesome Regular', 'zoom-social-icons-widget' ),
|
213 |
+
);
|
214 |
+
$categories_list[] = array(
|
215 |
+
'value' => 'fas',
|
216 |
+
'label' => __( 'Font Awesome Solid', 'zoom-social-icons-widget' ),
|
217 |
+
);
|
218 |
}
|
219 |
|
220 |
+
$categories_sync = WPZOOM_Social_Icons_Settings::get_option_key( 'categories-sync' );
|
221 |
+
if ( empty( $categories_sync ) ) {
|
222 |
return $categories_list;
|
223 |
}
|
224 |
|
225 |
+
return array_filter(
|
226 |
+
$categories_list,
|
227 |
+
function ( $category_item ) use ( $icons_kits ) {
|
228 |
+
return ! empty( $icons_kits[ $category_item['value'] ] );
|
229 |
+
}
|
230 |
+
);
|
231 |
}
|
|
|
232 |
add_action( 'init', 'zoom_social_icons_widget_load_textdomain' );
|
233 |
|
234 |
/**
|
235 |
+
* Set hooks for enqueue preloaded fonts
|
236 |
+
*
|
237 |
+
* @return void
|
238 |
*/
|
239 |
+
function zoom_enqueue_preloaded_fonts() {
|
240 |
+
$fonts_preloading = WPZOOM_Social_Icons_Settings::get_option_key( 'disable-fonts-preloading' );
|
241 |
+
if ( ! empty( $fonts_preloading ) ) {
|
242 |
add_action( 'wp_enqueue_scripts', 'zoom_social_icons_enqueue_fonts', 999 );
|
243 |
add_filter( 'style_loader_tag', 'zoom_social_icons_add_preload_to_rel_attribute', 10, 3 );
|
244 |
}
|
245 |
+
}
|
246 |
+
add_action( 'init', 'zoom_enqueue_preloaded_fonts' );
|
247 |
+
|
248 |
+
if ( ! function_exists( 'wpzoom_social_icons_plugin_action_links' ) ) {
|
249 |
+
/**
|
250 |
+
* Plugin action links.
|
251 |
+
*
|
252 |
+
* Adds action links to the plugin list table
|
253 |
+
*
|
254 |
+
* Fired by `plugin_action_links` filter.
|
255 |
+
*
|
256 |
+
* @since 4.2.2
|
257 |
+
*
|
258 |
+
* @param array $links An array of plugin action links.
|
259 |
+
*
|
260 |
+
* @return array An array of plugin action links.
|
261 |
+
*/
|
262 |
+
function wpzoom_social_icons_plugin_action_links( $links ) {
|
263 |
+
$is_active = is_plugin_active( WPZOOM_SOCIAL_ICONS_PLUGIN_BASE ); // Used to prevent the display of admin notice when activate PRO version of the plugin.
|
264 |
+
|
265 |
+
if ( $is_active ) {
|
266 |
+
$settings_link = sprintf( '<a href="%1$s">%2$s</a>', admin_url( 'options-general.php?page=' . WPZOOM_Social_Icons_Settings::$menu_slug ), esc_html__( 'Settings', 'zoom-social-icons-widget' ) );
|
267 |
+
|
268 |
+
array_unshift( $links, $settings_link );
|
269 |
+
|
270 |
+
$links['go_pro'] = sprintf( '<a href="%1$s" target="_blank" class="wpzoom-social-icons-gopro" style="font-weight: bold;">%2$s</a>', 'https://www.wpzoom.com/plugins/social-widget/?utm_source=plugins-admin-page&utm_medium=plugins-row-action-links&utm_campaign=go_pro', esc_html__( 'Go Pro', 'zoom-social-icons-widget' ) );
|
271 |
+
}
|
272 |
+
|
273 |
+
return $links;
|
274 |
+
}
|
275 |
+
add_filter( 'plugin_action_links_' . WPZOOM_SOCIAL_ICONS_PLUGIN_BASE, 'wpzoom_social_icons_plugin_action_links' );
|
276 |
+
}
|
277 |
+
|
278 |
+
if ( ! function_exists( 'wpzoom_social_icons_plugin_row_meta' ) ) {
|
279 |
+
/**
|
280 |
+
* Plugin row meta.
|
281 |
+
*
|
282 |
+
* Adds row meta links to the plugin list table
|
283 |
+
*
|
284 |
+
* Fired by `plugin_row_meta` filter.
|
285 |
+
*
|
286 |
+
* @since 4.2.2
|
287 |
+
*
|
288 |
+
* @param array $plugin_meta An array of the plugin's metadata, including
|
289 |
+
* the version, author, author URI, and plugin URI.
|
290 |
+
* @param string $plugin_file Path to the plugin file, relative to the plugins
|
291 |
+
* directory.
|
292 |
+
*
|
293 |
+
* @return array An array of plugin row meta links.
|
294 |
+
*/
|
295 |
+
function wpzoom_social_icons_plugin_row_meta( $plugin_meta, $plugin_file ) {
|
296 |
+
$is_active = is_plugin_active( WPZOOM_SOCIAL_ICONS_PLUGIN_BASE ); // Used to prevent the display of admin notice when activate PRO version of the plugin.
|
297 |
+
|
298 |
+
if ( $is_active && WPZOOM_SOCIAL_ICONS_PLUGIN_BASE === $plugin_file ) {
|
299 |
+
$row_meta = array(
|
300 |
+
'docs' => '<a href="https://www.wpzoom.com/documentation/social-icons-widget-by-wpzoom/?utm_source=plugins-admin-page&utm_medium=plugin-row-meta&utm_campaign=plugins-admin-docs" aria-label="' . esc_attr( esc_html__( 'View Documentation', 'zoom-social-icons-widget' ) ) . '" target="_blank">' . esc_html__( 'Documentation', 'zoom-social-icons-widget' ) . '</a>',
|
301 |
+
);
|
302 |
+
|
303 |
+
$plugin_meta = array_merge( $plugin_meta, $row_meta );
|
304 |
+
}
|
305 |
+
|
306 |
+
return $plugin_meta;
|
307 |
+
}
|
308 |
+
add_filter( 'plugin_row_meta', 'wpzoom_social_icons_plugin_row_meta', 10, 2 );
|
309 |
+
}
|
310 |
+
|
311 |
+
if ( ! function_exists( 'wpzoom_social_icons_upgrade_pro_notice' ) ) {
|
312 |
+
/**
|
313 |
+
* Content of Admin Notices in WordPress Dashboard
|
314 |
+
*
|
315 |
+
* @since 4.2.2
|
316 |
+
* @return void
|
317 |
+
*/
|
318 |
+
function wpzoom_social_icons_upgrade_pro_notice() {
|
319 |
+
?>
|
320 |
+
<div class="notice notice-success wpz-social-icons-notice is-dismissible">
|
321 |
+
<a class="notice-dismiss" href="<?php echo esc_url( wp_nonce_url( add_query_arg( 'social-icons-dismiss', 'dismiss_admin_notices' ), 'wpz_social_icons_hide_notices_nonce', '_wpz_social_icons_notice_nonce' ) ); ?>" style="text-decoration: none">
|
322 |
+
<span class="screen-reader-text">
|
323 |
+
<?php echo esc_html__( 'Dismiss this notice.', 'zoom-social-icons-widget' ); ?>
|
324 |
+
</span>
|
325 |
+
</a>
|
326 |
+
<div class="wpz-social-icons-notice-wrap-content">
|
327 |
+
<div class="wpz-social-icons-notice-aside">
|
328 |
+
<img src="<?php echo esc_url( WPZOOM_SOCIAL_ICONS_PLUGIN_URL . '/assets/images/social-icons-pro-avatar.png' ); ?>" width="100" height="100" alt="Social Icons PRO"/>
|
329 |
+
</div>
|
330 |
+
<div class="wpz-social-icons-notice-content">
|
331 |
+
<?php
|
332 |
+
/* translators: %s The heading title */
|
333 |
+
echo sprintf( '<h3>%s</h3>', esc_html__( '🤩 Thank you for using Social Icons Widget by WPZOOM!', 'zoom-social-icons-widget' ) );
|
334 |
+
?>
|
335 |
+
<p class="wpz-social-icons-notice-text">
|
336 |
+
<?php
|
337 |
+
/* translators: %s The pro version features */
|
338 |
+
echo sprintf( esc_html__( 'Big News! We\'ve released a new PRO version with unique features such as %s', 'zoom-social-icons-widget' ), '<strong>' . esc_html__( 'SVG Icons Uploader, Loading Icons in SVG format, and many other improvements to boost your PageSpeed score!', 'zoom-social-icons-widget' ) . '</strong>' );
|
339 |
+
?>
|
340 |
+
</p>
|
341 |
+
<p class="wpz-social-icons-notice-actions">
|
342 |
+
<a class="button-primary" href="https://www.wpzoom.com/plugins/social-widget/?utm_source=admin-notices&utm_medium=admin-notice-actions&utm_campaign=go_pro" target="_blank"><strong><?php esc_html_e( 'Get Social Icons Widget PRO →', 'zoom-social-icons-widget' ); ?></strong></a>
|
343 |
+
<?php
|
344 |
+
// phpcs:disable
|
345 |
+
/*
|
346 |
+
<a class="button-link" href="https://www.wpzoom.com/documentation/social-icons-widget-by-wpzoom/?utm_source=admin-notice&utm_medium=admin-notice-actions&utm_campaign=docs" target="_blank"><?php esc_html_e( 'Documentation', 'zoom-social-icons-widget' ); ?></a>
|
347 |
+
<a class="button-link" href="<?php echo esc_url( admin_url( 'admin.php?page=' . WPZOOM_Social_Icons_Settings::$menu_slug ) ); ?>"><?php esc_html_e( 'Settings', 'zoom-social-icons-widget' ); ?></a> */
|
348 |
+
// phpcs:enable
|
349 |
+
?>
|
350 |
+
</p>
|
351 |
+
</div>
|
352 |
+
</div>
|
353 |
+
</div>
|
354 |
+
<?php
|
355 |
+
}
|
356 |
+
|
357 |
+
/**
|
358 |
+
* Admin styles.
|
359 |
+
*
|
360 |
+
* @since 4.2.2
|
361 |
+
*/
|
362 |
+
function wpzoom_social_icons_custom_admin_styles() {
|
363 |
+
echo '<style id="wpzoom-social-icons-custom-admin-styles">
|
364 |
+
|
365 |
+
.wpz-social-icons-notice .wpz-social-icons-notice-actions a {
|
366 |
+
margin-right: .5em;
|
367 |
+
}
|
368 |
+
.wpz-social-icons-notice .wpz-social-icons-notice-actions a:last-child {
|
369 |
+
margin-right: 0;
|
370 |
+
}
|
371 |
+
.wpz-social-icons-notice .wpz-social-icons-notice-wrap-content {
|
372 |
+
padding: 0;
|
373 |
+
display: flex;
|
374 |
+
}
|
375 |
+
.wpz-social-icons-notice .wpz-social-icons-notice-aside {
|
376 |
+
overflow: hidden;
|
377 |
+
padding-top: 10px;
|
378 |
+
width: 110px;
|
379 |
+
flex-grow: 0;
|
380 |
+
flex-shrink: 0;
|
381 |
+
}
|
382 |
+
.wpz-social-icons-notice .wpz-social-icons-notice-content {
|
383 |
+
padding: 15px 0;
|
384 |
+
}
|
385 |
+
.wpz-social-icons-notice .wpz-social-icons-notice-content h3 {
|
386 |
+
margin-top: 0;
|
387 |
+
margin-bottom: .5em;
|
388 |
+
}
|
389 |
+
.wpz-social-icons-notice .wpz-social-icons-notice-content p:last-child {
|
390 |
+
margin-bottom: 0;
|
391 |
+
}
|
392 |
+
</style>';
|
393 |
+
}
|
394 |
+
add_action( 'admin_head', 'wpzoom_social_icons_custom_admin_styles' );
|
395 |
+
}
|
396 |
+
|
397 |
+
if ( ! function_exists( 'wpzoom_social_icons_admin_notices' ) ) {
|
398 |
+
/**
|
399 |
+
* Admin Notice after Plugin Activation
|
400 |
+
*
|
401 |
+
* @since 4.2.2
|
402 |
+
* @return void
|
403 |
+
*/
|
404 |
+
function wpzoom_social_icons_admin_notices() {
|
405 |
+
global $pagenow;
|
406 |
+
|
407 |
+
$page = isset( $_GET['page'] ) ? sanitize_text_field( $_GET['page'] ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
408 |
+
$is_active = is_plugin_active( WPZOOM_SOCIAL_ICONS_PLUGIN_BASE ); // Used to prevent the display of admin notice when activate PRO version of the plugin.
|
409 |
+
$dismiss_notice = get_option( 'wpz_social_icons_dismiss_admin_notices' );
|
410 |
+
$should_display_notice = ( ( 'index.php' === $pagenow || 'plugins.php' === $pagenow || 'options-general.php' === $pagenow && 'wpzoom-social-icons-widget' === $page ) && $is_active && ! $dismiss_notice ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
411 |
+
|
412 |
+
if ( $should_display_notice ) {
|
413 |
+
wpzoom_social_icons_upgrade_pro_notice();
|
414 |
+
}
|
415 |
+
}
|
416 |
+
add_action( 'admin_notices', 'wpzoom_social_icons_admin_notices' );
|
417 |
+
}
|
418 |
+
|
419 |
+
if ( ! function_exists( 'wpzoom_social_icons_hide_notice' ) ) {
|
420 |
+
/**
|
421 |
+
* Hide Admin Notice in WordPress Dashboard
|
422 |
+
*
|
423 |
+
* @since 4.2.2
|
424 |
+
* @return void
|
425 |
+
*/
|
426 |
+
function wpzoom_social_icons_hide_notice() {
|
427 |
+
$hide_notice = isset( $_GET['social-icons-dismiss'] ) ? sanitize_text_field( wp_unslash( $_GET['social-icons-dismiss'] ) ) : '';
|
428 |
|
429 |
+
if ( 'dismiss_admin_notices' === $hide_notice && isset( $_GET['_wpz_social_icons_notice_nonce'] ) ) {
|
430 |
+
if ( ! check_admin_referer( 'wpz_social_icons_hide_notices_nonce', '_wpz_social_icons_notice_nonce' ) ) {
|
431 |
+
wp_die( esc_html__( 'Action failed. Please refresh the page and retry.', 'zoom-social-icons-widget' ) );
|
432 |
+
}
|
433 |
+
|
434 |
+
if ( ! current_user_can( 'edit_theme_options' ) ) {
|
435 |
+
wp_die( esc_html__( 'You do not have the necessary permission to perform this action.', 'zoom-social-icons-widget' ) );
|
436 |
+
}
|
437 |
+
|
438 |
+
update_option( 'wpz_social_icons_' . $hide_notice, 1 );
|
439 |
+
}
|
440 |
+
}
|
441 |
+
}
|
442 |
+
add_action( 'wp_loaded', 'wpzoom_social_icons_hide_notice' );
|
zoom-helper.php
DELETED
@@ -1,134 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
if ( ! function_exists( 'zoom_pointer_load' ) ):
|
3 |
-
function zoom_pointer_load( $hook_suffix ) {
|
4 |
-
|
5 |
-
// Don't run on WP < 3.3
|
6 |
-
if ( get_bloginfo( 'version' ) < '3.3' ) {
|
7 |
-
return;
|
8 |
-
}
|
9 |
-
|
10 |
-
$screen = get_current_screen();
|
11 |
-
$screen_id = $screen->id;
|
12 |
-
|
13 |
-
// Get pointers for this screen
|
14 |
-
$pointers = apply_filters( 'zoom_admin_pointers_' . $screen_id, array() );
|
15 |
-
|
16 |
-
if ( ! $pointers || ! is_array( $pointers ) ) {
|
17 |
-
return;
|
18 |
-
}
|
19 |
-
|
20 |
-
// Get dismissed pointers
|
21 |
-
$dismissed = explode( ',', (string) get_user_meta( get_current_user_id(), 'dismissed_wp_pointers', true ) );
|
22 |
-
$valid_pointers = array();
|
23 |
-
|
24 |
-
// Check pointers and remove dismissed ones.
|
25 |
-
foreach ( $pointers as $pointer_id => $pointer ) {
|
26 |
-
|
27 |
-
// Sanity check
|
28 |
-
if ( in_array( $pointer_id, $dismissed ) || empty( $pointer ) || empty( $pointer_id ) || empty( $pointer['target'] ) || empty( $pointer['options'] ) ) {
|
29 |
-
continue;
|
30 |
-
}
|
31 |
-
|
32 |
-
$pointer['pointer_id'] = $pointer_id;
|
33 |
-
|
34 |
-
// Add the pointer to $valid_pointers array
|
35 |
-
$valid_pointers['pointers'][] = $pointer;
|
36 |
-
}
|
37 |
-
|
38 |
-
// No valid pointers? Stop here.
|
39 |
-
if ( empty( $valid_pointers ) ) {
|
40 |
-
return;
|
41 |
-
}
|
42 |
-
|
43 |
-
wp_localize_script( 'wp-pointer', 'wpPointerL10n', array(
|
44 |
-
'dismiss' => __( 'I already did this' ),
|
45 |
-
) );
|
46 |
-
// Add pointers style to queue.
|
47 |
-
wp_enqueue_style( 'wp-pointer' );
|
48 |
-
|
49 |
-
// Add pointers script to queue. Add custom script.
|
50 |
-
wp_enqueue_script( 'zoom-social-pointer', plugins_url( 'assets/js/zoom-social-pointer.js', dirname( __FILE__ ) . '/social-icons-widget-by-wpzoom.php' ), array( 'wp-pointer' ) );
|
51 |
-
|
52 |
-
// Add pointer options to script.
|
53 |
-
wp_localize_script( 'zoom-social-pointer', 'zoom_social_pointer', $valid_pointers );
|
54 |
-
}
|
55 |
-
endif;
|
56 |
-
|
57 |
-
if ( ! function_exists( 'zoom_register_pointer_callback' ) ):
|
58 |
-
function zoom_register_pointer_callback( $p ) {
|
59 |
-
|
60 |
-
$pointer = zoom_get_pointer_data();
|
61 |
-
|
62 |
-
if ( ! empty( $pointer['transient_name'] ) &&
|
63 |
-
! empty( $pointer['lifetime'] ) &&
|
64 |
-
! get_site_transient( $pointer['transient_name'] )
|
65 |
-
) {
|
66 |
-
zoom_set_pointer_transient( $pointer['transient_name'], $pointer['lifetime'] );
|
67 |
-
}
|
68 |
-
|
69 |
-
if ( ! empty( $pointer['transient_name'] ) && get_option( '_site_transient_timeout_' . $pointer['transient_name'] ) ) {
|
70 |
-
|
71 |
-
$data_timeout = get_option( '_site_transient_timeout_' . $pointer['transient_name'] );
|
72 |
-
$lifetime = ! empty( $pointer['lifetime'] ) ? $pointer['lifetime'] : MONTH_IN_SECONDS * 6;
|
73 |
-
$delay_time = ! empty( $pointer['delay_time'] ) ? $pointer['delay_time'] : DAY_IN_SECONDS * 3;
|
74 |
-
|
75 |
-
if ( time() > $data_timeout - ( $lifetime - $delay_time ) ) {
|
76 |
-
$p[ $pointer['transient_name'] ] = $pointer;
|
77 |
-
}
|
78 |
-
}
|
79 |
-
|
80 |
-
return $p;
|
81 |
-
}
|
82 |
-
endif;
|
83 |
-
|
84 |
-
if ( ! function_exists( 'zoom_set_pointer_transient' ) ):
|
85 |
-
function zoom_set_pointer_transient( $key, $time ) {
|
86 |
-
set_site_transient( $key, true, $time );
|
87 |
-
}
|
88 |
-
endif;
|
89 |
-
|
90 |
-
if ( ! function_exists( 'zoom_ajax_set_pointer_transient' ) ):
|
91 |
-
function zoom_ajax_set_pointer_transient() {
|
92 |
-
|
93 |
-
if ( empty( $_POST['lifetime'] ) &&
|
94 |
-
empty( $_POST['transient_name'] ) &&
|
95 |
-
! is_int( $_POST['lifetime'] ) &&
|
96 |
-
! is_string( $_POST['transient_name'] )
|
97 |
-
) {
|
98 |
-
return wp_send_json_error( array( 'response' => 'Failed, $lifetime is not int or empty, $transient name is not string or empty ' ) );
|
99 |
-
}
|
100 |
-
|
101 |
-
zoom_set_pointer_transient( $_POST['transient_name'], $_POST['lifetime'] );
|
102 |
-
wp_send_json_success( array( 'response' => 'Done, transient is set' ) );
|
103 |
-
}
|
104 |
-
endif;
|
105 |
-
|
106 |
-
if ( ! function_exists( 'zoom_get_pointer_data' ) ):
|
107 |
-
function zoom_get_pointer_data() {
|
108 |
-
|
109 |
-
$plugin_data = get_plugin_data( dirname( __FILE__ ) . '/social-icons-widget-by-wpzoom.php' );
|
110 |
-
$plugin_name = $plugin_data['Name'];
|
111 |
-
|
112 |
-
return array(
|
113 |
-
'target' => '#wp-admin-bar-my-account',
|
114 |
-
'options' => array(
|
115 |
-
'content' => sprintf( '<h3> %s </h3> <p> %s </p>',
|
116 |
-
__( 'Rate Social Icons Widget by WPZOOM', 'zoom-social-icons-widget' ),
|
117 |
-
__( 'Thank you for using <b>Social Icons Widget by WPZOOM</b><br/>Would you mind taking a moment to rate it! It won\'t take more than two minutes.<p><b>Thanks for your support!</b></p><p>' .
|
118 |
-
'<a class="button button-primary button-hero" href="https://wordpress.org/support/plugin/social-icons-widget-by-wpzoom/reviews/#new-post" target="_blank"> ★ Rate Now ★</a></p>' .
|
119 |
-
'<p><a class="zoom-social-remind-me-later button button-secondary button-hero">Remind Me later!</a></p>', 'zoom-social-icons-widget' )
|
120 |
-
),
|
121 |
-
'position' => array( 'edge' => 'top', 'align' => 'left' ),
|
122 |
-
'pointerClass' => 'wp-pointer zoom-pointer-class',
|
123 |
-
'pointerWidth' => 400
|
124 |
-
),
|
125 |
-
'lifetime' => MONTH_IN_SECONDS * 6,
|
126 |
-
'delay_time' => DAY_IN_SECONDS * 2,
|
127 |
-
'transient_name' => 'zoom-social-pointer'
|
128 |
-
);
|
129 |
-
}
|
130 |
-
endif;
|
131 |
-
|
132 |
-
add_action( 'admin_enqueue_scripts', 'zoom_pointer_load', 1000 );
|
133 |
-
add_action( 'wp_ajax_zoom_ajax_set_pointer_transient', 'zoom_ajax_set_pointer_transient' );
|
134 |
-
add_filter( 'zoom_admin_pointers_widgets', 'zoom_register_pointer_callback' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|