Version Description
- 6 December 2018 =
- Widget block: Fix Layout Slider not being editable.
- Widget block: Correct used of i18n for block editor.
- Widget block: Fix previews.
- Google map: Move global API key override to
modify_instance
to ensure key is available in form. - Widget block: Prevent multiple API requests.
Download this release
Release Info
Developer | gpriday |
Plugin | ![]() |
Version | 1.13.4 |
Comparing to | |
See all releases |
Code changes from version 1.13.3 to 1.13.4
- admin/admin.min.js +1 -1
- admin/trianglify.min.js +1 -2
- base/inc/fields/icon.class.php +93 -93
- base/inc/fields/js/autocomplete-field.min.js +1 -1
- base/inc/fields/js/code-field.min.js +1 -1
- base/inc/fields/js/date-range-field.min.js +1 -1
- base/inc/fields/js/icon-field.js +183 -183
- base/inc/fields/js/icon-field.min.js +1 -1
- base/inc/fields/js/media-field.min.js +1 -1
- base/inc/fields/js/multi-measurement-field.min.js +1 -1
- base/inc/fields/js/order-field.min.js +1 -1
- base/inc/fields/js/posts-field.min.js +1 -1
- base/inc/fields/js/presets-field.min.js +1 -1
- base/inc/fields/js/tinymce-field-pre48.min.js +1 -1
- base/inc/fields/js/tinymce-field.min.js +1 -1
- base/inc/routes/siteorigin-widgets-resource.class.php +2 -30
- base/js/admin.min.js +1 -1
- base/js/meta-box-manager.min.js +1 -1
- compat/beaver-builder/sowb-beaver-builder.min.js +1 -1
- compat/block-editor/widget-block.js +24 -38
- compat/block-editor/widget-block.min.js +1 -1
- compat/block-editor/widget-block.php +18 -0
- compat/elementor/sowb-elementor.min.js +1 -1
- compat/visual-composer/sowb-vc-widget.min.js +1 -1
- icons/fontawesome/filter.php +793 -793
- icons/fontawesome/font/fontawesome-webfont.svg +2178 -2671
admin/admin.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
jQuery(function(
|
1 |
+
jQuery(function(a){a(".so-widget-toggle-active button").click(function(){var i=a(this),e=i.data("status"),s=i.closest(".so-widget");e?s.addClass("so-widget-is-active").removeClass("so-widget-is-inactive"):s.removeClass("so-widget-is-active").addClass("so-widget-is-inactive"),a.post(soWidgetsAdmin.toggleUrl,{widget:s.data("id"),active:e},function(i){})}),a(".so-widget-banner").each(function(){var i=a(this),e=i.find("img");if(e.length)128<e.width()&&e.css("margin-left",-(e.width()-128)/2);else{var s=Trianglify({width:128,height:128,variance:1,cell_size:32,seed:i.data("seed")});i.append(s.svg())}});var i=function(){var e=a(this).val().toLowerCase();""===e?a(".so-widget-wrap").show():a(".so-widget").each(function(){var i=a(this);-1<i.find("h3").html().toLowerCase().indexOf(e)?i.parent().show():i.parent().hide()})};a("#sow-widget-search input").on({keyup:i,search:i}),a(window).resize(function(){var i=a(".so-widget-text").css("height","auto"),e=0;i.each(function(){e=Math.max(e,a(this).height())}),i.each(function(){a(this).css("height",e)})}).resize(),a("#sow-widgets-page .page-nav a").click(function(i){i.preventDefault();var e=a(this),s=e.attr("href"),t=e.closest("li");switch(a("#sow-widgets-page .page-nav li").not(t).removeClass("active"),t.addClass("active"),s){case"#all":a(".so-widget-wrap").show();break;case"#enabled":a(".so-widget-wrap").hide(),a(".so-widget-wrap .so-widget-is-active").each(function(){a(this).closest(".so-widget-wrap").show()}),a(".so-widget-wrap .so-widget-is-inactive").each(function(){a(this).closest(".so-widget-wrap").hide()});break;case"#disabled":a(".so-widget-wrap .so-widget-is-active").each(function(){a(this).closest(".so-widget-wrap").hide()}),a(".so-widget-wrap .so-widget-is-inactive").each(function(){a(this).closest(".so-widget-wrap").show()})}a(window).resize()}),a("#widgets-list").addClass("so-animated");var s=a("#sow-settings-dialog");a("#widgets-list .so-widget-settings").click(function(i){var e=a(this);i.preventDefault(),s.find(".so-content").empty().addClass("so-loading").load(e.data("form-url"),function(){a(this).removeClass("so-loading")}),s.show()}),s.find(".so-close").click(function(i){i.preventDefault(),s.hide()}),s.find(".so-save").click(function(i){i.preventDefault();var e=a(this);e.prop("disabled",!0),a("#widgets-list .so-widget-settings").prop("disabled",!0),s.find("form").submit(function(){e.prop("disabled",!1),s.hide()}).submit()}),a("#so-widget-settings-save").load(function(){a("#widgets-list .so-widget-settings").prop("disabled",!1)})});
|
admin/trianglify.min.js
CHANGED
@@ -1,2 +1 @@
|
|
1 |
-
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var r;r="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,r.Trianglify=e()}}(function(){var e;return function e(r,n,t){function f(o,i){if(!n[o]){if(!r[o]){var c="function"==typeof require&&require;if(!i&&c)return c(o,!0);if(a)return a(o,!0);var d=new Error("Cannot find module '"+o+"'");throw d.code="MODULE_NOT_FOUND",d}var s=n[o]={exports:{}};r[o][0].call(s.exports,function(e){var n=r[o][1][e];return f(n||e)},s,s.exports,e,r,n,t)}return n[o].exports}for(var a="function"==typeof require&&require,o=0;o<t.length;o++)f(t[o]);return f}({"./lib/trianglify.js":[function(e,r,n){function t(e){function r(e,r,n){return(e-r[0])*(n[1]-n[0])/(r[1]-r[0])+n[0]}function n(){if(e.palette instanceof Array)return e.palette[Math.floor(rand()*e.palette.length)];var r=Object.keys(e.palette);return e.palette[r[Math.floor(rand()*r.length)]]}if(e=function(e,r){var n={};for(var t in e)n[t]=e[t];for(t in r){if(!e.hasOwnProperty(t))throw new Error(t+" is not a configuration option for Trianglify. Check your spelling?");n[t]=r[t]}return n}(d,e),rand=a(e.seed),"random"===e.x_colors&&(e.x_colors=n()),"random"===e.y_colors&&(e.y_colors=n()),"match_x"===e.y_colors&&(e.y_colors=e.x_colors),!(e.width>0&&e.height>0))throw new Error("Width and height must be numbers greater than 0");if(e.cell_size<2)throw new Error("Cell size must be greater than 2.");var t;if(e.color_function)t=function(r,n){return o(e.color_function(r,n))};else{var i=o.scale(e.x_colors).mode(e.color_space),s=o.scale(e.y_colors).mode(e.color_space);t=function(r,n){return o.interpolate(i(r),s(n),.5,e.color_space)}}for(var u=e.width,l=e.height,b=Math.floor((u+4*e.cell_size)/e.cell_size),h=Math.floor((l+4*e.cell_size)/e.cell_size),g=(b*e.cell_size-u)/2,p=(h*e.cell_size-l)/2,m=e.cell_size*e.variance/2,y=function(n,t){for(var f=[],a=-g;a<n+g;a+=e.cell_size)for(var o=-p;o<t+p;o+=e.cell_size){var i=a+e.cell_size/2+r(rand(),[0,1],[-m,m]),c=o+e.cell_size/2+r(rand(),[0,1],[-m,m]);f.push([i,c].map(Math.floor))}return f}(u,l),w=f.triangulate(y),v=[],x=function(e){return y[e]},_=0;_<w.length;_+=3){var k=[w[_],w[_+1],w[_+2]].map(x),j=function(e){return{x:(e[0][0]+e[1][0]+e[2][0])/3,y:(e[0][1]+e[1][1]+e[2][1])/3}}(k),M=t(function(e){return r(e,[-g,u+g],[0,1])}(j.x),function(e){return r(e,[-p,l+p],[0,1])}(j.y)).hex();v.push([M,k])}return c(v,e)}var f=e("delaunay-fast"),a=e("seedrandom"),o=e("chroma-js"),i=e("./colorbrewer"),c=e("./pattern"),d={width:600,height:400,cell_size:75,variance:.75,seed:null,x_colors:"random",y_colors:"match_x",palette:i,color_space:"lab",color_function:null,stroke_width:1.51};t.colorbrewer=i,t.defaults=d,r.exports=t},{"./colorbrewer":"/Users/gpriday/Downloads/trianglify-master 2/lib/colorbrewer.js","./pattern":"/Users/gpriday/Downloads/trianglify-master 2/lib/pattern.js","chroma-js":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/chroma-js/chroma.js","delaunay-fast":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/delaunay-fast/delaunay.js",seedrandom:"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/index.js"}],"/Users/gpriday/Downloads/trianglify-master 2/lib/colorbrewer.js":[function(e,r,n){r.exports={YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"]}},{}],"/Users/gpriday/Downloads/trianglify-master 2/lib/pattern.js":[function(e,r,n){(function(n){function t(r,t){function a(){var e=f.createElementNS("http://www.w3.org/2000/svg","svg");return e.setAttribute("width",t.width),e.setAttribute("height",t.height),r.forEach(function(r){var n=f.createElementNS("http://www.w3.org/2000/svg","path");n.setAttribute("d","M"+r[1].join("L")+"Z"),n.setAttribute("fill",r[0]),n.setAttribute("stroke",r[0]),n.setAttribute("stroke-width",t.stroke_width),e.appendChild(n)}),e}function o(a){if(void 0!==n)try{e("canvas")}catch(e){throw Error("The optional node-canvas dependency is needed for Trianglify to render using canvas in node.")}return a||(a=f.createElement("canvas")),a.setAttribute("width",t.width),a.setAttribute("height",t.height),ctx=a.getContext("2d"),ctx.canvas.width=t.width,ctx.canvas.height=t.height,r.forEach(function(e){ctx.fillStyle=ctx.strokeStyle=e[0],ctx.lineWidth=t.stroke_width,ctx.beginPath(),ctx.moveTo.apply(ctx,e[1][0]),ctx.lineTo.apply(ctx,e[1][1]),ctx.lineTo.apply(ctx,e[1][2]),ctx.fill(),ctx.stroke()}),a}function i(){return o().toDataURL("image/png")}return{polys:r,opts:t,svg:a,canvas:o,png:i}}var f="undefined"!=typeof document?document:e("jsdom").jsdom("<html/>");r.exports=t}).call(this,e("_process"))},{_process:"/Users/gpriday/Downloads/trianglify-master 2/node_modules/browserify/node_modules/process/browser.js",canvas:"/Users/gpriday/Downloads/trianglify-master 2/node_modules/browserify/node_modules/browser-resolve/empty.js",jsdom:"/Users/gpriday/Downloads/trianglify-master 2/node_modules/browserify/node_modules/browser-resolve/empty.js"}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/browserify/node_modules/browser-resolve/empty.js":[function(e,r,n){},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/browserify/node_modules/process/browser.js":[function(e,r,n){function t(){if(!i){i=!0;for(var e,r=o.length;r;){e=o,o=[];for(var n=-1;++n<r;)e[n]();r=o.length}i=!1}}function f(){}var a=r.exports={},o=[],i=!1;a.nextTick=function(e){o.push(e),i||setTimeout(t,0)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={},a.on=f,a.addListener=f,a.once=f,a.off=f,a.removeListener=f,a.removeAllListeners=f,a.emit=f,a.binding=function(e){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(e){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/chroma-js/chroma.js":[function(r,n,t){(function(){var r,f,a,o,i,c,d,s,u,l,b,h,g,p,m,y,w,v,x,_,k,j,M,N,D,U,A,P,z,G,E,B,I,q,R;s=function(e,n,t,f){return new r(e,n,t,f)},void 0!==n&&null!==n&&null!=n.exports&&(n.exports=s),"function"==typeof e&&e.amd?e([],function(){return s}):(E=void 0!==t&&null!==t?t:this,E.chroma=s),s.color=function(e,n,t,f){return new r(e,n,t,f)},s.hsl=function(e,n,t,f){return new r(e,n,t,f,"hsl")},s.hsv=function(e,n,t,f){return new r(e,n,t,f,"hsv")},s.rgb=function(e,n,t,f){return new r(e,n,t,f,"rgb")},s.hex=function(e){return new r(e)},s.css=function(e){return new r(e)},s.lab=function(e,n,t){return new r(e,n,t,"lab")},s.lch=function(e,n,t){return new r(e,n,t,"lch")},s.hsi=function(e,n,t){return new r(e,n,t,"hsi")},s.gl=function(e,n,t,f){return new r(255*e,255*n,255*t,f,"gl")},s.interpolate=function(e,n,t,f){return null==e||null==n?"#000":("string"===B(e)&&(e=new r(e)),"string"===B(n)&&(n=new r(n)),e.interpolate(t,n,f))},s.mix=s.interpolate,s.contrast=function(e,n){var t,f;return"string"===B(e)&&(e=new r(e)),"string"===B(n)&&(n=new r(n)),t=e.luminance(),f=n.luminance(),t>f?(t+.05)/(f+.05):(f+.05)/(t+.05)},s.luminance=function(e){return s(e).luminance()},s._Color=r,r=function(){function e(){var e,r,n,t,f,a,o,i,c,d,s,l,b,y,v;for(f=this,n=[],c=0,d=arguments.length;c<d;c++)null!=(r=arguments[c])&&n.push(r);if(0===n.length)s=[255,0,255,1,"rgb"],a=s[0],o=s[1],i=s[2],e=s[3],t=s[4];else if("array"===B(n[0])){if(3===n[0].length)l=n[0],a=l[0],o=l[1],i=l[2],e=1;else{if(4!==n[0].length)throw"unknown input argument";b=n[0],a=b[0],o=b[1],i=b[2],e=b[3]}t=null!=(y=n[1])?y:"rgb"}else"string"===B(n[0])?(a=n[0],t="hex"):"object"===B(n[0])?(v=n[0]._rgb,a=v[0],o=v[1],i=v[2],e=v[3],t="rgb"):n.length>=3&&(a=n[0],o=n[1],i=n[2]);3===n.length?(t="rgb",e=1):4===n.length?"string"===B(n[3])?(t=n[3],e=1):"number"===B(n[3])&&(t="rgb",e=n[3]):5===n.length&&(e=n[3],t=n[4]),null==e&&(e=1),"rgb"===t?f._rgb=[a,o,i,e]:"gl"===t?f._rgb=[255*a,255*o,255*i,e]:"hsl"===t?(f._rgb=p(a,o,i),f._rgb[3]=e):"hsv"===t?(f._rgb=m(a,o,i),f._rgb[3]=e):"hex"===t?f._rgb=h(a):"lab"===t?(f._rgb=w(a,o,i),f._rgb[3]=e):"lch"===t?(f._rgb=_(a,o,i),f._rgb[3]=e):"hsi"===t&&(f._rgb=g(a,o,i),f._rgb[3]=e),u(f._rgb)}return e.prototype.rgb=function(){return this._rgb.slice(0,3)},e.prototype.rgba=function(){return this._rgb},e.prototype.hex=function(){return N(this._rgb)},e.prototype.toString=function(){return this.name()},e.prototype.hsl=function(){return U(this._rgb)},e.prototype.hsv=function(){return A(this._rgb)},e.prototype.lab=function(){return P(this._rgb)},e.prototype.lch=function(){return z(this._rgb)},e.prototype.hsi=function(){return D(this._rgb)},e.prototype.gl=function(){return[this._rgb[0]/255,this._rgb[1]/255,this._rgb[2]/255,this._rgb[3]]},e.prototype.luminance=function(r,n){var t,f,a,o;return null==n&&(n="rgb"),arguments.length?(0===r&&(this._rgb=[0,0,0,this._rgb[3]]),1===r&&(this._rgb=[255,255,255,this._rgb[3]]),t=j(this._rgb),f=1e-7,a=20,o=function(e,t){var i,c;return c=e.interpolate(.5,t,n),i=c.luminance(),Math.abs(r-i)<f||!a--?c:i>r?o(e,c):o(c,t)},this._rgb=(t>r?o(new e("black"),this):o(this,new e("white"))).rgba(),this):j(this._rgb)},e.prototype.name=function(){var e,r;e=this.hex();for(r in s.colors)if(e===s.colors[r])return r;return e},e.prototype.alpha=function(e){return arguments.length?(this._rgb[3]=e,this):this._rgb[3]},e.prototype.css=function(e){var r,n,t,f;return null==e&&(e="rgb"),n=this,t=n._rgb,3===e.length&&t[3]<1&&(e+="a"),"rgb"===e?e+"("+t.slice(0,3).map(Math.round).join(",")+")":"rgba"===e?e+"("+t.slice(0,3).map(Math.round).join(",")+","+t[3]+")":"hsl"===e||"hsla"===e?(r=n.hsl(),f=function(e){return Math.round(100*e)/100},r[0]=f(r[0]),r[1]=f(100*r[1])+"%",r[2]=f(100*r[2])+"%",4===e.length&&(r[3]=t[3]),e+"("+r.join(",")+")"):void 0},e.prototype.interpolate=function(r,n,t){var f,a,o,i,c,d,s,u,l,b,h,g,p,m;if(u=this,null==t&&(t="rgb"),"string"===B(n)&&(n=new e(n)),"hsl"===t||"hsv"===t||"lch"===t||"hsi"===t)"hsl"===t?(p=u.hsl(),m=n.hsl()):"hsv"===t?(p=u.hsv(),m=n.hsv()):"hsi"===t?(p=u.hsi(),m=n.hsi()):"lch"===t&&(p=u.lch(),m=n.lch()),"h"===t.substr(0,1)?(o=p[0],h=p[1],d=p[2],i=m[0],g=m[1],s=m[2]):(d=p[0],h=p[1],o=p[2],s=m[0],g=m[1],i=m[2]),isNaN(o)||isNaN(i)?isNaN(o)?isNaN(i)?a=Number.NaN:(a=i,1!==d&&0!==d||"hsv"===t||(b=g)):(a=o,1!==s&&0!==s||"hsv"===t||(b=h)):(f=i>o&&i-o>180?i-(o+360):i<o&&o-i>180?i+360-o:i-o,a=o+r*f),null==b&&(b=h+r*(g-h)),c=d+r*(s-d),l="h"===t.substr(0,1)?new e(a,b,c,t):new e(c,b,a,t);else if("rgb"===t)p=u._rgb,m=n._rgb,l=new e(p[0]+r*(m[0]-p[0]),p[1]+r*(m[1]-p[1]),p[2]+r*(m[2]-p[2]),t);else{if("lab"!==t)throw"color mode "+t+" is not supported";p=u.lab(),m=n.lab(),l=new e(p[0]+r*(m[0]-p[0]),p[1]+r*(m[1]-p[1]),p[2]+r*(m[2]-p[2]),t)}return l.alpha(u.alpha()+r*(n.alpha()-u.alpha())),l},e.prototype.premultiply=function(){var e,r;return r=this.rgb(),e=this.alpha(),s(r[0]*e,r[1]*e,r[2]*e,e)},e.prototype.darken=function(e){var r,n;return null==e&&(e=20),n=this,r=n.lch(),r[0]-=e,s.lch(r).alpha(n.alpha())},e.prototype.darker=function(e){return this.darken(e)},e.prototype.brighten=function(e){return null==e&&(e=20),this.darken(-e)},e.prototype.brighter=function(e){return this.brighten(e)},e.prototype.saturate=function(e){var r,n;return null==e&&(e=20),n=this,r=n.lch(),r[1]+=e,s.lch(r).alpha(n.alpha())},e.prototype.desaturate=function(e){return null==e&&(e=20),this.saturate(-e)},e}(),u=function(e){var r;for(r in e)r<3?(e[r]<0&&(e[r]=0),e[r]>255&&(e[r]=255)):3===r&&(e[r]<0&&(e[r]=0),e[r]>1&&(e[r]=1));return e},b=function(e){var r,n,t,f,a,o,i,c;if(e=e.toLowerCase(),null!=s.colors&&s.colors[e])return h(s.colors[e]);if(t=e.match(/rgb\(\s*(\-?\d+),\s*(\-?\d+)\s*,\s*(\-?\d+)\s*\)/)){for(f=t.slice(1,4),n=a=0;a<=2;n=++a)f[n]=+f[n];f[3]=1}else if(t=e.match(/rgba\(\s*(\-?\d+),\s*(\-?\d+)\s*,\s*(\-?\d+)\s*,\s*([01]|[01]?\.\d+)\)/))for(f=t.slice(1,5),n=o=0;o<=3;n=++o)f[n]=+f[n];else if(t=e.match(/rgb\(\s*(\-?\d+(?:\.\d+)?)%,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*\)/)){for(f=t.slice(1,4),n=i=0;i<=2;n=++i)f[n]=Math.round(2.55*f[n]);f[3]=1}else if(t=e.match(/rgba\(\s*(\-?\d+(?:\.\d+)?)%,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)/)){for(f=t.slice(1,5),n=c=0;c<=2;n=++c)f[n]=Math.round(2.55*f[n]);f[3]=+f[3]}else(t=e.match(/hsl\(\s*(\-?\d+(?:\.\d+)?),\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*\)/))?(r=t.slice(1,4),r[1]*=.01,r[2]*=.01,f=p(r),f[3]=1):(t=e.match(/hsla\(\s*(\-?\d+(?:\.\d+)?),\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)/))&&(r=t.slice(1,4),r[1]*=.01,r[2]*=.01,f=p(r),f[3]=+t[4]);return f},h=function(e){var r,n,t,f,a,o;if(e.match(/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/))return 4!==e.length&&7!==e.length||(e=e.substr(1)),3===e.length&&(e=e.split(""),e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),o=parseInt(e,16),f=o>>16,t=o>>8&255,n=255&o,[f,t,n,1];if(e.match(/^#?([A-Fa-f0-9]{8})$/))return 9===e.length&&(e=e.substr(1)),o=parseInt(e,16),f=o>>24&255,t=o>>16&255,n=o>>8&255,r=255&o,[f,t,n,r];if(a=b(e))return a;throw"unknown color: "+e},g=function(e,r,n){var t,o,i,c;return c=I(arguments),e=c[0],r=c[1],n=c[2],e/=360,e<1/3?(t=(1-r)/3,i=(1+r*l(a*e)/l(f-a*e))/3,o=1-(t+i)):e<2/3?(e-=1/3,i=(1-r)/3,o=(1+r*l(a*e)/l(f-a*e))/3,t=1-(i+o)):(e-=2/3,o=(1-r)/3,t=(1+r*l(a*e)/l(f-a*e))/3,i=1-(o+t)),i=k(n*i*3),o=k(n*o*3),t=k(n*t*3),[255*i,255*o,255*t]},p=function(){var e,r,n,t,f,a,o,i,c,d,s,u,l,b;if(l=I(arguments),t=l[0],i=l[1],a=l[2],0===i)o=n=e=255*a;else{for(s=[0,0,0],r=[0,0,0],d=a<.5?a*(1+i):a+i-a*i,c=2*a-d,t/=360,s[0]=t+1/3,s[1]=t,s[2]=t-1/3,f=u=0;u<=2;f=++u)s[f]<0&&(s[f]+=1),s[f]>1&&(s[f]-=1),6*s[f]<1?r[f]=c+6*(d-c)*s[f]:2*s[f]<1?r[f]=d:3*s[f]<2?r[f]=c+(d-c)*(2/3-s[f])*6:r[f]=c;b=[Math.round(255*r[0]),Math.round(255*r[1]),Math.round(255*r[2])],o=b[0],n=b[1],e=b[2]}return[o,n,e]},m=function(){var e,r,n,t,f,a,o,i,c,d,s,u,l,b,h,g,p,m;if(u=I(arguments),t=u[0],c=u[1],s=u[2],s*=255,0===c)i=n=e=s;else switch(360===t&&(t=0),t>360&&(t-=360),t<0&&(t+=360),t/=60,f=Math.floor(t),r=t-f,a=s*(1-c),o=s*(1-c*r),d=s*(1-c*(1-r)),f){case 0:l=[s,d,a],i=l[0],n=l[1],e=l[2];break;case 1:b=[o,s,a],i=b[0],n=b[1],e=b[2];break;case 2:h=[a,s,d],i=h[0],n=h[1],e=h[2];break;case 3:g=[a,o,s],i=g[0],n=g[1],e=g[2];break;case 4:p=[d,a,s],i=p[0],n=p[1],e=p[2];break;case 5:m=[s,a,o],i=m[0],n=m[1],e=m[2]}return i=Math.round(i),n=Math.round(n),e=Math.round(e),[i,n,e]},o=.95047,i=1,c=1.08883,y=function(){var e,r,n,t,f,a;return a=I(arguments),f=a[0],e=a[1],r=a[2],n=Math.sqrt(e*e+r*r),t=Math.atan2(r,e)/Math.PI*180,[f,n,t]},w=function(e,r,n){var t,f,a,d,s,u,l;return void 0!==e&&3===e.length&&(u=e,e=u[0],r=u[1],n=u[2]),void 0!==e&&3===e.length&&(l=e,e=l[0],r=l[1],n=l[2]),d=(e+16)/116,a=d+r/500,s=d-n/200,a=v(a)*o,d=v(d)*i,s=v(s)*c,f=R(3.2404542*a-1.5371385*d-.4985314*s),t=R(-.969266*a+1.8760108*d+.041556*s),n=R(.0556434*a-.2040259*d+1.0572252*s),[k(f,0,255),k(t,0,255),k(n,0,255),1]},v=function(e){return e>.206893034?e*e*e:(e-4/29)/7.787037},R=function(e){return Math.round(255*(e<=.00304?12.92*e:1.055*Math.pow(e,1/2.4)-.055))},x=function(){var e,r,n,t;return t=I(arguments),n=t[0],e=t[1],r=t[2],r=r*Math.PI/180,[n,Math.cos(r)*e,Math.sin(r)*e]},_=function(e,r,n){var t,f,a,o,i,c,d;return c=x(e,r,n),t=c[0],f=c[1],a=c[2],d=w(t,f,a),i=d[0],o=d[1],a=d[2],[k(i,0,255),k(o,0,255),k(a,0,255)]},j=function(e,r,n){var t;return t=I(arguments),e=t[0],r=t[1],n=t[2],e=M(e),r=M(r),n=M(n),.2126*e+.7152*r+.0722*n},M=function(e){return e/=255,e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)},N=function(){var e,r,n,t,f,a;return a=I(arguments),n=a[0],r=a[1],e=a[2],f=n<<16|r<<8|e,t="000000"+f.toString(16),"#"+t.substr(t.length-6)},D=function(){var e,r,n,t,f,a,o,i,c;return c=I(arguments),o=c[0],n=c[1],r=c[2],e=2*Math.PI,o/=255,n/=255,r/=255,a=Math.min(o,n,r),f=(o+n+r)/3,i=1-a/f,0===i?t=0:(t=(o-n+(o-r))/2,t/=Math.sqrt((o-n)*(o-n)+(o-r)*(n-r)),t=Math.acos(t),r>n&&(t=e-t),t/=e),[360*t,i,f]},U=function(e,r,n){var t,f,a,o,i,c;return void 0!==e&&e.length>=3&&(c=e,e=c[0],r=c[1],n=c[2]),e/=255,r/=255,n/=255,o=Math.min(e,r,n),a=Math.max(e,r,n),f=(a+o)/2,a===o?(i=0,t=Number.NaN):i=f<.5?(a-o)/(a+o):(a-o)/(2-a-o),e===a?t=(r-n)/(a-o):r===a?t=2+(n-e)/(a-o):n===a&&(t=4+(e-r)/(a-o)),t*=60,t<0&&(t+=360),[t,i,f]},A=function(){var e,r,n,t,f,a,o,i,c,d;return d=I(arguments),o=d[0],n=d[1],e=d[2],a=Math.min(o,n,e),f=Math.max(o,n,e),r=f-a,c=f/255,0===f?(t=Number.NaN,i=0):(i=r/f,o===f&&(t=(n-e)/r),n===f&&(t=2+(e-o)/r),e===f&&(t=4+(o-n)/r),(t*=60)<0&&(t+=360)),[t,i,c]},P=function(){var e,r,n,t,f,a,d;return d=I(arguments),n=d[0],r=d[1],e=d[2],n=G(n),r=G(r),e=G(e),t=q((.4124564*n+.3575761*r+.1804375*e)/o),f=q((.2126729*n+.7151522*r+.072175*e)/i),a=q((.0193339*n+.119192*r+.9503041*e)/c),[116*f-16,500*(t-f),200*(f-a)]},G=function(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)},q=function(e){return e>.008856?Math.pow(e,1/3):7.787037*e+4/29},z=function(){var e,r,n,t,f,a,o;return a=I(arguments),f=a[0],n=a[1],r=a[2],o=P(f,n,r),t=o[0],e=o[1],r=o[2],y(t,e,r)},s.scale=function(e,r){var n,t,f,a,o,i,c,d,u,l,b,h,g,p,m,y,w,v,x;return p="rgb",m=s("#ccc"),x=0,!1,b=[0,1],u=[],w=!1,v=[],g=0,h=1,l=!1,y=0,d={},o=function(e,r){var n,t,f,o,i,c,d;if(null==e&&(e=["#ddd","#222"]),null!=e&&"string"===B(e)&&null!=(null!=(i=s.brewer)?i[e]:void 0)&&(e=s.brewer[e]),"array"===B(e)){for(e=e.slice(0),n=f=0,c=e.length-1;0<=c?f<=c:f>=c;n=0<=c?++f:--f)t=e[n],"string"===B(t)&&(e[n]=s(t));if(null!=r)v=r;else for(v=[],n=o=0,d=e.length-1;0<=d?o<=d:o>=d;n=0<=d?++o:--o)v.push(n/(e.length-1))}return a(),u=e},i=function(e){return null==e&&(e=[]),b=e,g=e[0],h=e[e.length-1],a(),y=2===e.length?0:e.length-1},t=function(e){var r,n;if(null!=b){for(n=b.length-1,r=0;r<n&&e>=b[r];)r++;return r-1}return 0},c=function(e){return e},function(e){var r,n,f,a,o;return o=e,b.length>2&&(a=b.length-1,r=t(e),f=b[0]+(b[1]-b[0])*(0+.5*x),n=b[a-1]+(b[a]-b[a-1])*(1-.5*x),o=g+(b[r]+.5*(b[r+1]-b[r])-f)/(n-f)*(h-g)),o},f=function(e,r){var n,f,a,o,i,l,w,x;if(null==r&&(r=!1),isNaN(e))return m;if(r?l=e:b.length>2?(n=t(e),l=n/(y-1)):(l=g!==h?(e-g)/(h-g):0,l=(e-g)/(h-g),l=Math.min(1,Math.max(0,l))),r||(l=c(l)),o=Math.floor(1e4*l),d[o])f=d[o];else{if("array"===B(u))for(a=w=0,x=v.length-1;0<=x?w<=x:w>=x;a=0<=x?++w:--w){if(i=v[a],l<=i){f=u[a];break}if(l>=i&&a===v.length-1){f=u[a];break}if(l>i&&l<v[a+1]){l=(l-i)/(v[a+1]-i),f=s.interpolate(u[a],u[a+1],l,p);break}}else"function"===B(u)&&(f=u(l));d[o]=f}return f},a=function(){return d={}},o(e,r),n=function(e){var r;return r=f(e),w&&r[w]?r[w]():r},n.domain=function(e,r,t,f){var a;return null==t&&(t="e"),arguments.length?(null!=r&&(a=s.analyze(e,f),e=0===r?[a.min,a.max]:s.limits(a,t,r)),i(e),n):b},n.mode=function(e){return arguments.length?(p=e,a(),n):p},n.range=function(e,r){return o(e,r),n},n.out=function(e){return w=e,n},n.spread=function(e){return arguments.length?(x=e,n):x},n.correctLightness=function(e){return arguments.length?(l=e,a(),c=l?function(e){var r,n,t,a,o,i,c,d,s;for(r=f(0,!0).lab()[0],n=f(1,!0).lab()[0],c=r>n,t=f(e,!0).lab()[0],o=r+(n-r)*e,a=t-o,d=0,s=1,i=20;Math.abs(a)>.01&&i-- >0;)!function(){c&&(a*=-1),a<0?(d=e,e+=.5*(s-e)):(s=e,e+=.5*(d-e)),t=f(e,!0).lab()[0],a=t-o}();return e}:function(e){return e},n):l},n.colors=function(r){var t,f,a,o,i,c;if(null==r&&(r="hex"),e=[],f=[],b.length>2)for(t=a=1,c=b.length;1<=c?a<c:a>c;t=1<=c?++a:--a)f.push(.5*(b[t-1]+b[t]));else f=b;for(o=0,i=f.length;o<i;o++)t=f[o],e.push(n(t)[r]());return e},n},null==s.scales&&(s.scales={}),s.scales.cool=function(){return s.scale([s.hsl(180,1,.9),s.hsl(250,.7,.4)])},s.scales.hot=function(){return s.scale(["#000","#f00","#ff0","#fff"],[0,.25,.75,1]).mode("rgb")},s.analyze=function(e,r,n){var t,f,a,o,i,c,d;if(a={min:Number.MAX_VALUE,max:-1*Number.MAX_VALUE,sum:0,values:[],count:0},null==n&&(n=function(){return!0}),t=function(e){null==e||isNaN(e)||(a.values.push(e),a.sum+=e,e<a.min&&(a.min=e),e>a.max&&(a.max=e),a.count+=1)},i=function(e,f){if(n(e,f))return t(null!=r&&"function"===B(r)?r(e):null!=r&&"string"===B(r)||"number"===B(r)?e[r]:e)},"array"===B(e))for(c=0,d=e.length;c<d;c++)o=e[c],i(o);else for(f in e)o=e[f],i(o,f);return a.domain=[a.min,a.max],a.limits=function(e,r){return s.limits(a,e,r)},a},s.limits=function(e,r,n){var t,f,a,o,i,c,d,u,l,b,h,g,p,m,y,w,v,x,_,k,j,M,N,D,U,A,P,z,G,E,I,q,R,S,O,C,T,Y,L,F,V,X,W,$,Z,H,J,K,Q,ee,re,ne,te,fe,ae;if(null==r&&(r="equal"),null==n&&(n=7),"array"===B(e)&&(e=s.analyze(e)),p=e.min,h=e.max,e.sum,U=e.values.sort(function(e,r){return e-r}),b=[],"c"===r.substr(0,1)&&(b.push(p),b.push(h)),"e"===r.substr(0,1)){for(b.push(p),d=A=1,C=n-1;1<=C?A<=C:A>=C;d=1<=C?++A:--A)b.push(p+d/n*(h-p));b.push(h)}else if("l"===r.substr(0,1)){if(p<=0)throw"Logarithmic scales are only possible for values > 0";for(m=Math.LOG10E*Math.log(p),g=Math.LOG10E*Math.log(h),b.push(p),d=P=1,W=n-1;1<=W?P<=W:P>=W;d=1<=W?++P:--P)b.push(Math.pow(10,m+d/n*(g-m)));b.push(h)}else if("q"===r.substr(0,1)){for(b.push(p),d=z=1,$=n-1;1<=$?z<=$:z>=$;d=1<=$?++z:--z)_=U.length*d/n,k=Math.floor(_),k===_?b.push(U[k]):(j=_-k,b.push(U[k]*j+U[k+1]*(1-j)));b.push(h)}else if("k"===r.substr(0,1)){for(w=U.length,t=new Array(w),i=new Array(n),M=!0,v=0,a=null,a=[],a.push(p),d=G=1,Z=n-1;1<=Z?G<=Z:G>=Z;d=1<=Z?++G:--G)a.push(p+d/n*(h-p));for(a.push(h);M;){for(u=E=0,H=n-1;0<=H?E<=H:E>=H;u=0<=H?++E:--E)i[u]=0;for(d=I=0,J=w-1;0<=J?I<=J:I>=J;d=0<=J?++I:--I){for(D=U[d],y=Number.MAX_VALUE,u=q=0,K=n-1;0<=K?q<=K:q>=K;u=0<=K?++q:--q)(c=Math.abs(a[u]-D))<y&&(y=c,f=u);i[f]++,t[d]=f}for(x=new Array(n),u=R=0,Q=n-1;0<=Q?R<=Q:R>=Q;u=0<=Q?++R:--R)x[u]=null;for(d=S=0,ee=w-1;0<=ee?S<=ee:S>=ee;d=0<=ee?++S:--S)o=t[d],null===x[o]?x[o]=U[d]:x[o]+=U[d];for(u=O=0,T=n-1;0<=T?O<=T:O>=T;u=0<=T?++O:--O)x[u]*=1/i[u];for(M=!1,u=re=0,Y=n-1;0<=Y?re<=Y:re>=Y;u=0<=Y?++re:--re)if(x[u]!==a[d]){M=!0;break}a=x,v++,v>200&&(M=!1)}for(l={},u=ne=0,L=n-1;0<=L?ne<=L:ne>=L;u=0<=L?++ne:--ne)l[u]=[];for(d=te=0,F=w-1;0<=F?te<=F:te>=F;d=0<=F?++te:--te)o=t[d],l[o].push(U[d]);for(N=[],u=fe=0,V=n-1;0<=V?fe<=V:fe>=V;u=0<=V?++fe:--fe)N.push(l[u][0]),N.push(l[u][l[u].length-1]);for(N=N.sort(function(e,r){return e-r}),b.push(N[0]),d=ae=1,X=N.length-1;ae<=X;d=ae+=2)isNaN(N[d])||b.push(N[d])}return b},s.brewer={OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],Set2:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],Accent:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],Set1:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"],Set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],Dark2:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],Paired:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],Pastel2:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],Pastel1:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},s.colors={indigo:"#4b0082",gold:"#ffd700",hotpink:"#ff69b4",firebrick:"#b22222",indianred:"#cd5c5c",yellow:"#ffff00",mistyrose:"#ffe4e1",darkolivegreen:"#556b2f",olive:"#808000",darkseagreen:"#8fbc8f",pink:"#ffc0cb",tomato:"#ff6347",lightcoral:"#f08080",orangered:"#ff4500",navajowhite:"#ffdead",lime:"#00ff00",palegreen:"#98fb98",darkslategrey:"#2f4f4f",greenyellow:"#adff2f",burlywood:"#deb887",seashell:"#fff5ee",mediumspringgreen:"#00fa9a",fuchsia:"#ff00ff",papayawhip:"#ffefd5",blanchedalmond:"#ffebcd",chartreuse:"#7fff00",dimgray:"#696969",black:"#000000",peachpuff:"#ffdab9",springgreen:"#00ff7f",aquamarine:"#7fffd4",white:"#ffffff",orange:"#ffa500",lightsalmon:"#ffa07a",darkslategray:"#2f4f4f",brown:"#a52a2a",ivory:"#fffff0",dodgerblue:"#1e90ff",peru:"#cd853f",lawngreen:"#7cfc00",chocolate:"#d2691e",crimson:"#dc143c",forestgreen:"#228b22",darkgrey:"#a9a9a9",lightseagreen:"#20b2aa",cyan:"#00ffff",mintcream:"#f5fffa",silver:"#c0c0c0",antiquewhite:"#faebd7",mediumorchid:"#ba55d3",skyblue:"#87ceeb",gray:"#808080",darkturquoise:"#00ced1",goldenrod:"#daa520",darkgreen:"#006400",floralwhite:"#fffaf0",darkviolet:"#9400d3",darkgray:"#a9a9a9",moccasin:"#ffe4b5",saddlebrown:"#8b4513",grey:"#808080",darkslateblue:"#483d8b",lightskyblue:"#87cefa",lightpink:"#ffb6c1",mediumvioletred:"#c71585",slategrey:"#708090",red:"#ff0000",deeppink:"#ff1493",limegreen:"#32cd32",darkmagenta:"#8b008b",palegoldenrod:"#eee8aa",plum:"#dda0dd",turquoise:"#40e0d0",lightgrey:"#d3d3d3",lightgoldenrodyellow:"#fafad2",darkgoldenrod:"#b8860b",lavender:"#e6e6fa",maroon:"#800000",yellowgreen:"#9acd32",sandybrown:"#f4a460",thistle:"#d8bfd8",violet:"#ee82ee",navy:"#000080",magenta:"#ff00ff",dimgrey:"#696969",tan:"#d2b48c",rosybrown:"#bc8f8f",olivedrab:"#6b8e23",blue:"#0000ff",lightblue:"#add8e6",ghostwhite:"#f8f8ff",honeydew:"#f0fff0",cornflowerblue:"#6495ed",slateblue:"#6a5acd",linen:"#faf0e6",darkblue:"#00008b",powderblue:"#b0e0e6",seagreen:"#2e8b57",darkkhaki:"#bdb76b",snow:"#fffafa",sienna:"#a0522d",mediumblue:"#0000cd",royalblue:"#4169e1",lightcyan:"#e0ffff",green:"#008000",mediumpurple:"#9370db",midnightblue:"#191970",cornsilk:"#fff8dc",paleturquoise:"#afeeee",bisque:"#ffe4c4",slategray:"#708090",darkcyan:"#008b8b",khaki:"#f0e68c",wheat:"#f5deb3",teal:"#008080",darkorchid:"#9932cc",deepskyblue:"#00bfff",salmon:"#fa8072",darkred:"#8b0000",steelblue:"#4682b4",palevioletred:"#db7093",lightslategray:"#778899",aliceblue:"#f0f8ff",lightslategrey:"#778899",lightgreen:"#90ee90",orchid:"#da70d6",gainsboro:"#dcdcdc",mediumseagreen:"#3cb371",lightgray:"#d3d3d3",mediumturquoise:"#48d1cc",lemonchiffon:"#fffacd",cadetblue:"#5f9ea0",lightyellow:"#ffffe0",lavenderblush:"#fff0f5",coral:"#ff7f50",purple:"#800080",aqua:"#00ffff",whitesmoke:"#f5f5f5",mediumslateblue:"#7b68ee",darkorange:"#ff8c00",mediumaquamarine:"#66cdaa",darksalmon:"#e9967a",beige:"#f5f5dc",blueviolet:"#8a2be2",azure:"#f0ffff",lightsteelblue:"#b0c4de",oldlace:"#fdf5e6"},B=function(){var e,r,n,t,f;for(e={},f="Boolean Number String Function Array Date RegExp Undefined Null".split(" "),n=0,t=f.length;n<t;n++)r=f[n],e["[object "+r+"]"]=r.toLowerCase();return function(r){var n;return n=Object.prototype.toString.call(r),e[n]||"object"}}(),k=function(e,r,n){return null==r&&(r=0),null==n&&(n=1),e<r&&(e=r),e>n&&(e=n),e},I=function(e){return e.length>=3?e:e[0]},a=2*Math.PI,f=Math.PI/3,l=Math.cos,d=function(e){var r,n,t,f,a,o,i,c,u,l,b;return e=function(){var r,n,t;for(t=[],r=0,n=e.length;r<n;r++)f=e[r],t.push(s(f));return t}(),2===e.length?(u=function(){var r,n,t;for(t=[],r=0,n=e.length;r<n;r++)f=e[r],t.push(f.lab());return t}(),a=u[0],o=u[1],r=function(e){var r,n;return n=function(){
|
2 |
-
var n,t;for(t=[],r=n=0;n<=2;r=++n)t.push(a[r]+e*(o[r]-a[r]));return t}(),s.lab.apply(s,n)}):3===e.length?(l=function(){var r,n,t;for(t=[],r=0,n=e.length;r<n;r++)f=e[r],t.push(f.lab());return t}(),a=l[0],o=l[1],i=l[2],r=function(e){var r,n;return n=function(){var n,t;for(t=[],r=n=0;n<=2;r=++n)t.push((1-e)*(1-e)*a[r]+2*(1-e)*e*o[r]+e*e*i[r]);return t}(),s.lab.apply(s,n)}):4===e.length?(b=function(){var r,n,t;for(t=[],r=0,n=e.length;r<n;r++)f=e[r],t.push(f.lab());return t}(),a=b[0],o=b[1],i=b[2],c=b[3],r=function(e){var r,n;return n=function(){var n,t;for(t=[],r=n=0;n<=2;r=++n)t.push((1-e)*(1-e)*(1-e)*a[r]+3*(1-e)*(1-e)*e*o[r]+3*(1-e)*e*e*i[r]+e*e*e*c[r]);return t}(),s.lab.apply(s,n)}):5===e.length&&(n=d(e.slice(0,3)),t=d(e.slice(2,5)),r=function(e){return e<.5?n(2*e):t(2*(e-.5))}),r},s.interpolate.bezier=d}).call(this)},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/delaunay-fast/delaunay.js":[function(e,r,n){var t;!function(){"use strict";function e(e){var r,n,t,f,a,o,i=Number.POSITIVE_INFINITY,c=Number.POSITIVE_INFINITY,d=Number.NEGATIVE_INFINITY,s=Number.NEGATIVE_INFINITY;for(r=e.length;r--;)e[r][0]<i&&(i=e[r][0]),e[r][0]>d&&(d=e[r][0]),e[r][1]<c&&(c=e[r][1]),e[r][1]>s&&(s=e[r][1]);return n=d-i,t=s-c,f=Math.max(n,t),a=i+.5*n,o=c+.5*t,[[a-20*f,o-f],[a,o+20*f],[a+20*f,o-f]]}function n(e,r,n,t){var f,o,i,c,d,s,u,l,b,h,g=e[r][0],p=e[r][1],m=e[n][0],y=e[n][1],w=e[t][0],v=e[t][1],x=Math.abs(p-y),_=Math.abs(y-v);if(x<a&&_<a)throw new Error("Eek! Coincident points!");return x<a?(c=-(w-m)/(v-y),s=(m+w)/2,l=(y+v)/2,f=(m+g)/2,o=c*(f-s)+l):_<a?(i=-(m-g)/(y-p),d=(g+m)/2,u=(p+y)/2,f=(w+m)/2,o=i*(f-d)+u):(i=-(m-g)/(y-p),c=-(w-m)/(v-y),d=(g+m)/2,s=(m+w)/2,u=(p+y)/2,l=(y+v)/2,f=(i*d-c*s+l-u)/(i-c),o=x>_?i*(f-d)+u:c*(f-s)+l),b=m-f,h=y-o,{i:r,j:n,k:t,x:f,y:o,r:b*b+h*h}}function f(e){var r,n,t,f,a,o;for(n=e.length;n;)for(f=e[--n],t=e[--n],r=n;r;)if(o=e[--r],a=e[--r],t===a&&f===o||t===o&&f===a){e.splice(n,2),e.splice(r,2);break}}var a=1/1048576;t={triangulate:function(r,t){var o,i,c,d,s,u,l,b,h,g,p,m,y=r.length;if(y<3)return[];if(r=r.slice(0),t)for(o=y;o--;)r[o]=r[o][t];for(c=new Array(y),o=y;o--;)c[o]=o;for(c.sort(function(e,n){return r[n][0]-r[e][0]}),d=e(r),r.push(d[0],d[1],d[2]),s=[n(r,y+0,y+1,y+2)],u=[],l=[],o=c.length;o--;l.length=0){for(m=c[o],i=s.length;i--;)b=r[m][0]-s[i].x,b>0&&b*b>s[i].r?(u.push(s[i]),s.splice(i,1)):(h=r[m][1]-s[i].y,b*b+h*h-s[i].r>a||(l.push(s[i].i,s[i].j,s[i].j,s[i].k,s[i].k,s[i].i),s.splice(i,1)));for(f(l),i=l.length;i;)p=l[--i],g=l[--i],s.push(n(r,g,p,m))}for(o=s.length;o--;)u.push(s[o]);for(s.length=0,o=u.length;o--;)u[o].i<y&&u[o].j<y&&u[o].k<y&&s.push(u[o].i,u[o].j,u[o].k);return s},contains:function(e,r){if(r[0]<e[0][0]&&r[0]<e[1][0]&&r[0]<e[2][0]||r[0]>e[0][0]&&r[0]>e[1][0]&&r[0]>e[2][0]||r[1]<e[0][1]&&r[1]<e[1][1]&&r[1]<e[2][1]||r[1]>e[0][1]&&r[1]>e[1][1]&&r[1]>e[2][1])return null;var n=e[1][0]-e[0][0],t=e[2][0]-e[0][0],f=e[1][1]-e[0][1],a=e[2][1]-e[0][1],o=n*a-t*f;if(0===o)return null;var i=(a*(r[0]-e[0][0])-t*(r[1]-e[0][1]))/o,c=(n*(r[1]-e[0][1])-f*(r[0]-e[0][0]))/o;return i<0||c<0||i+c>1?null:[i,c]}},void 0!==r&&(r.exports=t)}()},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/index.js":[function(e,r,n){var t=e("./lib/alea"),f=e("./lib/xor128"),a=e("./lib/xorwow"),o=e("./lib/xorshift7"),i=e("./lib/xor4096"),c=e("./lib/tychei"),d=e("./seedrandom");d.alea=t,d.xor128=f,d.xorwow=a,d.xorshift7=o,d.xor4096=i,d.tychei=c,r.exports=d},{"./lib/alea":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/alea.js","./lib/tychei":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/tychei.js","./lib/xor128":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/xor128.js","./lib/xor4096":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/xor4096.js","./lib/xorshift7":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/xorshift7.js","./lib/xorwow":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/xorwow.js","./seedrandom":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/seedrandom.js"}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/alea.js":[function(r,n,t){!function(e,r,n){function t(e){var r=this,n=o();r.next=function(){var e=2091639*r.s0+2.3283064365386963e-10*r.c;return r.s0=r.s1,r.s1=r.s2,r.s2=e-(r.c=0|e)},r.c=1,r.s0=n(" "),r.s1=n(" "),r.s2=n(" "),r.s0-=n(e),r.s0<0&&(r.s0+=1),r.s1-=n(e),r.s1<0&&(r.s1+=1),r.s2-=n(e),r.s2<0&&(r.s2+=1),n=null}function f(e,r){return r.c=e.c,r.s0=e.s0,r.s1=e.s1,r.s2=e.s2,r}function a(e,r){var n=new t(e),a=r&&r.state,o=n.next;return o.int32=function(){return 4294967296*n.next()|0},o.double=function(){return o()+1.1102230246251565e-16*(2097152*o()|0)},o.quick=o,a&&("object"==typeof a&&f(a,n),o.state=function(){return f(n,{})}),o}function o(){var e=4022871197;return function(r){r=r.toString();for(var n=0;n<r.length;n++){e+=r.charCodeAt(n);var t=.02519603282416938*e;e=t>>>0,t-=e,t*=e,e=t>>>0,t-=e,e+=4294967296*t}return 2.3283064365386963e-10*(e>>>0)}}r&&r.exports?r.exports=a:n&&n.amd?n(function(){return a}):this.alea=a}(0,"object"==typeof n&&n,"function"==typeof e&&e)},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/tychei.js":[function(r,n,t){!function(e,r,n){function t(e){var r=this,n="";r.next=function(){var e=r.b,n=r.c,t=r.d,f=r.a;return e=e<<25^e>>>7^n,n=n-t|0,t=t<<24^t>>>8^f,f=f-e|0,r.b=e=e<<20^e>>>12^n,r.c=n=n-t|0,r.d=t<<16^n>>>16^f,r.a=f-e|0},r.a=0,r.b=0,r.c=-1640531527,r.d=1367130551,e===Math.floor(e)?(r.a=e/4294967296|0,r.b=0|e):n+=e;for(var t=0;t<n.length+20;t++)r.b^=0|n.charCodeAt(t),r.next()}function f(e,r){return r.a=e.a,r.b=e.b,r.c=e.c,r.d=e.d,r}function a(e,r){var n=new t(e),a=r&&r.state,o=function(){return(n.next()>>>0)/4294967296};return o.double=function(){do{var e=n.next()>>>11,r=(n.next()>>>0)/4294967296,t=(e+r)/(1<<21)}while(0===t);return t},o.int32=n.next,o.quick=o,a&&("object"==typeof a&&f(a,n),o.state=function(){return f(n,{})}),o}r&&r.exports?r.exports=a:n&&n.amd?n(function(){return a}):this.tychei=a}(0,"object"==typeof n&&n,"function"==typeof e&&e)},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/xor128.js":[function(r,n,t){!function(e,r,n){function t(e){var r=this,n="";r.x=0,r.y=0,r.z=0,r.w=0,r.next=function(){var e=r.x^r.x<<11;return r.x=r.y,r.y=r.z,r.z=r.w,r.w^=r.w>>>19^e^e>>>8},e===(0|e)?r.x=e:n+=e;for(var t=0;t<n.length+64;t++)r.x^=0|n.charCodeAt(t),r.next()}function f(e,r){return r.x=e.x,r.y=e.y,r.z=e.z,r.w=e.w,r}function a(e,r){var n=new t(e),a=r&&r.state,o=function(){return(n.next()>>>0)/4294967296};return o.double=function(){do{var e=n.next()>>>11,r=(n.next()>>>0)/4294967296,t=(e+r)/(1<<21)}while(0===t);return t},o.int32=n.next,o.quick=o,a&&("object"==typeof a&&f(a,n),o.state=function(){return f(n,{})}),o}r&&r.exports?r.exports=a:n&&n.amd?n(function(){return a}):this.xor128=a}(0,"object"==typeof n&&n,"function"==typeof e&&e)},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/xor4096.js":[function(r,n,t){!function(e,r,n){function t(e){var r=this;r.next=function(){var e,n,t=r.w,f=r.X,a=r.i;return r.w=t=t+1640531527|0,n=f[a+34&127],e=f[a=a+1&127],n^=n<<13,e^=e<<17,n^=n>>>15,e^=e>>>12,n=f[a]=n^e,r.i=a,n+(t^t>>>16)|0},function(e,r){var n,t,f,a,o,i=[],c=128;for(r===(0|r)?(t=r,r=null):(r+="\0",t=0,c=Math.max(c,r.length)),f=0,a=-32;a<c;++a)r&&(t^=r.charCodeAt((a+32)%r.length)),0===a&&(o=t),t^=t<<10,t^=t>>>15,t^=t<<4,t^=t>>>13,a>=0&&(o=o+1640531527|0,n=i[127&a]^=t+o,f=0==n?f+1:0);for(f>=128&&(i[127&(r&&r.length||0)]=-1),f=127,a=512;a>0;--a)t=i[f+34&127],n=i[f=f+1&127],t^=t<<13,n^=n<<17,t^=t>>>15,n^=n>>>12,i[f]=t^n;e.w=o,e.X=i,e.i=f}(r,e)}function f(e,r){return r.i=e.i,r.w=e.w,r.X=e.X.slice(),r}function a(e,r){null==e&&(e=+new Date);var n=new t(e),a=r&&r.state,o=function(){return(n.next()>>>0)/4294967296};return o.double=function(){do{var e=n.next()>>>11,r=(n.next()>>>0)/4294967296,t=(e+r)/(1<<21)}while(0===t);return t},o.int32=n.next,o.quick=o,a&&(a.X&&f(a,n),o.state=function(){return f(n,{})}),o}r&&r.exports?r.exports=a:n&&n.amd?n(function(){return a}):this.xor4096=a}(0,"object"==typeof n&&n,"function"==typeof e&&e)},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/xorshift7.js":[function(r,n,t){!function(e,r,n){function t(e){var r=this;r.next=function(){var e,n,t=r.x,f=r.i;return e=t[f],e^=e>>>7,n=e^e<<24,e=t[f+1&7],n^=e^e>>>10,e=t[f+3&7],n^=e^e>>>3,e=t[f+4&7],n^=e^e<<7,e=t[f+7&7],e^=e<<13,n^=e^e<<9,t[f]=n,r.i=f+1&7,n},function(e,r){var n,t=[];if(r===(0|r))t[0]=r;else for(r=""+r,n=0;n<r.length;++n)t[7&n]=t[7&n]<<15^r.charCodeAt(n)+t[n+1&7]<<13;for(;t.length<8;)t.push(0);for(n=0;n<8&&0===t[n];++n);for(8==n?t[7]=-1:t[n],e.x=t,e.i=0,n=256;n>0;--n)e.next()}(r,e)}function f(e,r){return r.x=e.x.slice(),r.i=e.i,r}function a(e,r){null==e&&(e=+new Date);var n=new t(e),a=r&&r.state,o=function(){return(n.next()>>>0)/4294967296};return o.double=function(){do{var e=n.next()>>>11,r=(n.next()>>>0)/4294967296,t=(e+r)/(1<<21)}while(0===t);return t},o.int32=n.next,o.quick=o,a&&(a.x&&f(a,n),o.state=function(){return f(n,{})}),o}r&&r.exports?r.exports=a:n&&n.amd?n(function(){return a}):this.xorshift7=a}(0,"object"==typeof n&&n,"function"==typeof e&&e)},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/xorwow.js":[function(r,n,t){!function(e,r,n){function t(e){var r=this,n="";r.next=function(){var e=r.x^r.x>>>2;return r.x=r.y,r.y=r.z,r.z=r.w,r.w=r.v,(r.d=r.d+362437|0)+(r.v=r.v^r.v<<4^e^e<<1)|0},r.x=0,r.y=0,r.z=0,r.w=0,r.v=0,e===(0|e)?r.x=e:n+=e;for(var t=0;t<n.length+64;t++)r.x^=0|n.charCodeAt(t),t==n.length&&(r.d=r.x<<10^r.x>>>4),r.next()}function f(e,r){return r.x=e.x,r.y=e.y,r.z=e.z,r.w=e.w,r.v=e.v,r.d=e.d,r}function a(e,r){var n=new t(e),a=r&&r.state,o=function(){return(n.next()>>>0)/4294967296};return o.double=function(){do{var e=n.next()>>>11,r=(n.next()>>>0)/4294967296,t=(e+r)/(1<<21)}while(0===t);return t},o.int32=n.next,o.quick=o,a&&("object"==typeof a&&f(a,n),o.state=function(){return f(n,{})}),o}r&&r.exports?r.exports=a:n&&n.amd?n(function(){return a}):this.xorwow=a}(0,"object"==typeof n&&n,"function"==typeof e&&e)},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/seedrandom.js":[function(r,n,t){!function(t,f){function a(e,r,n){var a=[];r=1==r?{entropy:!0}:r||{};var l=d(c(r.entropy?[e,u(t)]:null==e?s():e,3),a),b=new o(a),v=function(){for(var e=b.g(g),r=m,n=0;e<y;)e=(e+n)*h,r*=h,n=b.g(1);for(;e>=w;)e/=2,r/=2,n>>>=1;return(e+n)/r};return v.int32=function(){return 0|b.g(4)},v.quick=function(){return b.g(4)/4294967296},v.double=v,d(u(b.S),t),(r.pass||n||function(e,r,n,t){return t&&(t.S&&i(t,b),e.state=function(){return i(b,{})}),n?(f[p]=e,r):e})(v,l,"global"in r?r.global:this==f,r.state)}function o(e){var r,n=e.length,t=this,f=0,a=t.i=t.j=0,o=t.S=[];for(n||(e=[n++]);f<h;)o[f]=f++;for(f=0;f<h;f++)o[f]=o[a=v&a+e[f%n]+(r=o[f])],o[a]=r;(t.g=function(e){for(var r,n=0,f=t.i,a=t.j,o=t.S;e--;)r=o[f=v&f+1],n=n*h+o[v&(o[f]=o[a=v&a+r])+(o[a]=r)];return t.i=f,t.j=a,n})(h)}function i(e,r){return r.i=e.i,r.j=e.j,r.S=e.S.slice(),r}function c(e,r){var n,t=[],f=typeof e;if(r&&"object"==f)for(n in e)try{t.push(c(e[n],r-1))}catch(e){}return t.length?t:"string"==f?e:e+"\0"}function d(e,r){for(var n,t=e+"",f=0;f<t.length;)r[v&f]=v&(n^=19*r[v&f])+t.charCodeAt(f++);return u(r)}function s(){try{if(l)return u(l.randomBytes(h));var e=new Uint8Array(h);return(b.crypto||b.msCrypto).getRandomValues(e),u(e)}catch(e){var r=b.navigator,n=r&&r.plugins;return[+new Date,b,n,b.screen,u(t)]}}function u(e){return String.fromCharCode.apply(0,e)}var l,b=this,h=256,g=6,p="random",m=f.pow(h,g),y=f.pow(2,52),w=2*y,v=h-1;if(f["seed"+p]=a,d(f.random(),t),"object"==typeof n&&n.exports){n.exports=a;try{l=r("crypto")}catch(e){}}else"function"==typeof e&&e.amd&&e(function(){return a})}([],Math)},{crypto:!1}]},{},["./lib/trianglify.js"])("./lib/trianglify.js")});
|
1 |
+
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Trianglify=e()}}(function(){return function a(o,i,s){function d(n,e){if(!i[n]){if(!o[n]){var r="function"==typeof require&&require;if(!e&&r)return r(n,!0);if(c)return c(n,!0);var t=new Error("Cannot find module '"+n+"'");throw t.code="MODULE_NOT_FOUND",t}var f=i[n]={exports:{}};o[n][0].call(f.exports,function(e){var r=o[n][1][e];return d(r||e)},f,f.exports,a,o,i,s)}return i[n].exports}for(var c="function"==typeof require&&require,e=0;e<s.length;e++)d(s[e]);return d}({"./lib/trianglify.js":[function(e,r,n){var j=e("delaunay-fast"),M=e("seedrandom"),N=e("chroma-js"),t=e("./colorbrewer"),D=e("./pattern"),U={width:600,height:400,cell_size:75,variance:.75,seed:null,x_colors:"random",y_colors:"match_x",palette:t,color_space:"lab",color_function:null,stroke_width:1.51};function f(i){if(i=function(e,r){var n={};for(var t in e)n[t]=e[t];for(t in r){if(!e.hasOwnProperty(t))throw new Error(t+" is not a configuration option for Trianglify. Check your spelling?");n[t]=r[t]}return n}(U,i),rand=M(i.seed),"random"===i.x_colors&&(i.x_colors=k()),"random"===i.y_colors&&(i.y_colors=k()),"match_x"===i.y_colors&&(i.y_colors=i.x_colors),!(0<i.width&&0<i.height))throw new Error("Width and height must be numbers greater than 0");if(i.cell_size<2)throw new Error("Cell size must be greater than 2.");var e;if(i.color_function)e=function(e,r){return N(i.color_function(e,r))};else{var n=N.scale(i.x_colors).mode(i.color_space),t=N.scale(i.y_colors).mode(i.color_space);e=function(e,r){return N.interpolate(n(e),t(r),.5,i.color_space)}}for(var r,f,a,o=i.width,s=i.height,d=Math.floor((o+4*i.cell_size)/i.cell_size),c=Math.floor((s+4*i.cell_size)/i.cell_size),u=(d*i.cell_size-o)/2,l=(c*i.cell_size-s)/2,b=i.cell_size*i.variance/2,h=function(e,r){for(var n=[],t=-u;t<e+u;t+=i.cell_size)for(var f=-l;f<r+l;f+=i.cell_size){var a=t+i.cell_size/2+_(rand(),[0,1],[-b,b]),o=f+i.cell_size/2+_(rand(),[0,1],[-b,b]);n.push([a,o].map(Math.floor))}return n}(o,s),g=j.triangulate(h),p=[],m=function(e){return h[e]},y=0;y<g.length;y+=3){var w=[g[y],g[y+1],g[y+2]].map(m),v={x:((a=w)[0][0]+a[1][0]+a[2][0])/3,y:(a[0][1]+a[1][1]+a[2][1])/3},x=e((f=v.x,_(f,[-u,o+u],[0,1])),(r=v.y,_(r,[-l,s+l],[0,1]))).hex();p.push([x,w])}return D(p,i);function _(e,r,n){return(e-r[0])*(n[1]-n[0])/(r[1]-r[0])+n[0]}function k(){if(i.palette instanceof Array)return i.palette[Math.floor(rand()*i.palette.length)];var e=Object.keys(i.palette);return i.palette[e[Math.floor(rand()*e.length)]]}}f.colorbrewer=t,f.defaults=U,r.exports=f},{"./colorbrewer":"/Users/gpriday/Downloads/trianglify-master 2/lib/colorbrewer.js","./pattern":"/Users/gpriday/Downloads/trianglify-master 2/lib/pattern.js","chroma-js":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/chroma-js/chroma.js","delaunay-fast":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/delaunay-fast/delaunay.js",seedrandom:"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/index.js"}],"/Users/gpriday/Downloads/trianglify-master 2/lib/colorbrewer.js":[function(e,r,n){r.exports={YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"]}},{}],"/Users/gpriday/Downloads/trianglify-master 2/lib/pattern.js":[function(a,e,r){(function(n){var f="undefined"!=typeof document?document:a("jsdom").jsdom("<html/>");e.exports=function(r,t){function e(e){if(void 0!==n)try{a("canvas")}catch(e){throw Error("The optional node-canvas dependency is needed for Trianglify to render using canvas in node.")}return e||(e=f.createElement("canvas")),e.setAttribute("width",t.width),e.setAttribute("height",t.height),ctx=e.getContext("2d"),ctx.canvas.width=t.width,ctx.canvas.height=t.height,r.forEach(function(e){ctx.fillStyle=ctx.strokeStyle=e[0],ctx.lineWidth=t.stroke_width,ctx.beginPath(),ctx.moveTo.apply(ctx,e[1][0]),ctx.lineTo.apply(ctx,e[1][1]),ctx.lineTo.apply(ctx,e[1][2]),ctx.fill(),ctx.stroke()}),e}return{polys:r,opts:t,svg:function(){var n=f.createElementNS("http://www.w3.org/2000/svg","svg");return n.setAttribute("width",t.width),n.setAttribute("height",t.height),r.forEach(function(e){var r=f.createElementNS("http://www.w3.org/2000/svg","path");r.setAttribute("d","M"+e[1].join("L")+"Z"),r.setAttribute("fill",e[0]),r.setAttribute("stroke",e[0]),r.setAttribute("stroke-width",t.stroke_width),n.appendChild(r)}),n},canvas:e,png:function(){return e().toDataURL("image/png")}}}}).call(this,a("_process"))},{_process:"/Users/gpriday/Downloads/trianglify-master 2/node_modules/browserify/node_modules/process/browser.js",canvas:"/Users/gpriday/Downloads/trianglify-master 2/node_modules/browserify/node_modules/browser-resolve/empty.js",jsdom:"/Users/gpriday/Downloads/trianglify-master 2/node_modules/browserify/node_modules/browser-resolve/empty.js"}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/browserify/node_modules/browser-resolve/empty.js":[function(e,r,n){},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/browserify/node_modules/process/browser.js":[function(e,r,n){var t=r.exports={},f=[],a=!1;function o(){if(!a){var e;a=!0;for(var r=f.length;r;){e=f,f=[];for(var n=-1;++n<r;)e[n]();r=f.length}a=!1}}function i(){}t.nextTick=function(e){f.push(e),a||setTimeout(o,0)},t.title="browser",t.browser=!0,t.env={},t.argv=[],t.version="",t.versions={},t.on=i,t.addListener=i,t.once=i,t.off=i,t.removeListener=i,t.removeAllListeners=i,t.emit=i,t.binding=function(e){throw new Error("process.binding is not supported")},t.cwd=function(){return"/"},t.chdir=function(e){throw new Error("process.chdir is not supported")},t.umask=function(){return 0}},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/chroma-js/chroma.js":[function(e,A,P){(function(){var f,i,s,l,fe,g,d,t,m,y,w,v,c,x,u,b,_,h,r,a,e,n,o,k,j,M,p,ae,N,D,U;fe=function(e,r,n,t){return new f(e,r,n,t)},null!=A&&null!=A.exports&&(A.exports=fe),((null!=P?P:this).chroma=fe).color=function(e,r,n,t){return new f(e,r,n,t)},fe.hsl=function(e,r,n,t){return new f(e,r,n,t,"hsl")},fe.hsv=function(e,r,n,t){return new f(e,r,n,t,"hsv")},fe.rgb=function(e,r,n,t){return new f(e,r,n,t,"rgb")},fe.hex=function(e){return new f(e)},fe.css=function(e){return new f(e)},fe.lab=function(e,r,n){return new f(e,r,n,"lab")},fe.lch=function(e,r,n){return new f(e,r,n,"lch")},fe.hsi=function(e,r,n){return new f(e,r,n,"hsi")},fe.gl=function(e,r,n,t){return new f(255*e,255*r,255*n,t,"gl")},fe.mix=fe.interpolate=function(e,r,n,t){return null==e||null==r?"#000":("string"===ae(e)&&(e=new f(e)),"string"===ae(r)&&(r=new f(r)),e.interpolate(n,r,t))},fe.contrast=function(e,r){var n,t;return"string"===ae(e)&&(e=new f(e)),"string"===ae(r)&&(r=new f(r)),n=e.luminance(),(t=r.luminance())<n?(n+.05)/(t+.05):(t+.05)/(n+.05)},fe.luminance=function(e){return fe(e).luminance()},fe._Color=f,f=function(){function p(){var e,r,n,t,f,a,o,i,s,d,c,u,l,b,h;for(f=this,n=[],s=0,d=arguments.length;s<d;s++)null!=(r=arguments[s])&&n.push(r);if(0===n.length)a=(c=[255,0,255,1,"rgb"])[0],o=c[1],i=c[2],e=c[3],t=c[4];else if("array"===ae(n[0])){if(3===n[0].length)a=(u=n[0])[0],o=u[1],i=u[2],e=1;else{if(4!==n[0].length)throw"unknown input argument";a=(l=n[0])[0],o=l[1],i=l[2],e=l[3]}t=null!=(b=n[1])?b:"rgb"}else"string"===ae(n[0])?(a=n[0],t="hex"):"object"===ae(n[0])?(a=(h=n[0]._rgb)[0],o=h[1],i=h[2],e=h[3],t="rgb"):3<=n.length&&(a=n[0],o=n[1],i=n[2]);3===n.length?(t="rgb",e=1):4===n.length?"string"===ae(n[3])?(t=n[3],e=1):"number"===ae(n[3])&&(t="rgb",e=n[3]):5===n.length&&(e=n[3],t=n[4]),null==e&&(e=1),"rgb"===t?f._rgb=[a,o,i,e]:"gl"===t?f._rgb=[255*a,255*o,255*i,e]:"hsl"===t?(f._rgb=w(a,o,i),f._rgb[3]=e):"hsv"===t?(f._rgb=v(a,o,i),f._rgb[3]=e):"hex"===t?f._rgb=m(a):"lab"===t?(f._rgb=x(a,o,i),f._rgb[3]=e):"lch"===t?(f._rgb=_(a,o,i),f._rgb[3]=e):"hsi"===t&&(f._rgb=y(a,o,i),f._rgb[3]=e),g(f._rgb)}return p.prototype.rgb=function(){return this._rgb.slice(0,3)},p.prototype.rgba=function(){return this._rgb},p.prototype.hex=function(){return e(this._rgb)},p.prototype.toString=function(){return this.name()},p.prototype.hsl=function(){return o(this._rgb)},p.prototype.hsv=function(){return k(this._rgb)},p.prototype.lab=function(){return j(this._rgb)},p.prototype.lch=function(){return M(this._rgb)},p.prototype.hsi=function(){return n(this._rgb)},p.prototype.gl=function(){return[this._rgb[0]/255,this._rgb[1]/255,this._rgb[2]/255,this._rgb[3]]},p.prototype.luminance=function(f,a){var e,o,i;return null==a&&(a="rgb"),arguments.length?(0===f&&(this._rgb=[0,0,0,this._rgb[3]]),1===f&&(this._rgb=[255,255,255,this._rgb[3]]),e=r(this._rgb),1e-7,o=20,i=function(e,r){var n,t;return n=(t=e.interpolate(.5,r,a)).luminance(),Math.abs(f-n)<1e-7||!o--?t:f<n?i(e,t):i(t,r)},this._rgb=(f<e?i(new p("black"),this):i(this,new p("white"))).rgba(),this):r(this._rgb)},p.prototype.name=function(){var e,r;for(r in e=this.hex(),fe.colors)if(e===fe.colors[r])return r;return e},p.prototype.alpha=function(e){return arguments.length?(this._rgb[3]=e,this):this._rgb[3]},p.prototype.css=function(e){var r,n,t;return null==e&&(e="rgb"),n=this._rgb,3===e.length&&n[3]<1&&(e+="a"),"rgb"===e?e+"("+n.slice(0,3).map(Math.round).join(",")+")":"rgba"===e?e+"("+n.slice(0,3).map(Math.round).join(",")+","+n[3]+")":"hsl"===e||"hsla"===e?(t=function(e){return Math.round(100*e)/100},(r=this.hsl())[0]=t(r[0]),r[1]=t(100*r[1])+"%",r[2]=t(100*r[2])+"%",4===e.length&&(r[3]=n[3]),e+"("+r.join(",")+")"):void 0},p.prototype.interpolate=function(e,r,n){var t,f,a,o,i,s,d,c,u,l,b,h,g;if(d=this,null==n&&(n="rgb"),"string"===ae(r)&&(r=new p(r)),"hsl"===n||"hsv"===n||"lch"===n||"hsi"===n)"hsl"===n?(h=d.hsl(),g=r.hsl()):"hsv"===n?(h=d.hsv(),g=r.hsv()):"hsi"===n?(h=d.hsi(),g=r.hsi()):"lch"===n&&(h=d.lch(),g=r.lch()),"h"===n.substr(0,1)?(f=h[0],l=h[1],i=h[2],a=g[0],b=g[1],s=g[2]):(i=h[0],l=h[1],f=h[2],s=g[0],b=g[1],a=g[2]),isNaN(f)||isNaN(a)?isNaN(f)?isNaN(a)?t=Number.NaN:(t=a,1!==i&&0!==i||"hsv"===n||(u=b)):(t=f,1!==s&&0!==s||"hsv"===n||(u=l)):t=f+e*(f<a&&180<a-f?a-(f+360):a<f&&180<f-a?a+360-f:a-f),null==u&&(u=l+e*(b-l)),o=i+e*(s-i),c="h"===n.substr(0,1)?new p(t,u,o,n):new p(o,u,t,n);else if("rgb"===n)h=d._rgb,g=r._rgb,c=new p(h[0]+e*(g[0]-h[0]),h[1]+e*(g[1]-h[1]),h[2]+e*(g[2]-h[2]),n);else{if("lab"!==n)throw"color mode "+n+" is not supported";h=d.lab(),g=r.lab(),c=new p(h[0]+e*(g[0]-h[0]),h[1]+e*(g[1]-h[1]),h[2]+e*(g[2]-h[2]),n)}return c.alpha(d.alpha()+e*(r.alpha()-d.alpha())),c},p.prototype.premultiply=function(){var e,r;return r=this.rgb(),e=this.alpha(),fe(r[0]*e,r[1]*e,r[2]*e,e)},p.prototype.darken=function(e){var r;return null==e&&(e=20),(r=this.lch())[0]-=e,fe.lch(r).alpha(this.alpha())},p.prototype.darker=function(e){return this.darken(e)},p.prototype.brighten=function(e){return null==e&&(e=20),this.darken(-e)},p.prototype.brighter=function(e){return this.brighten(e)},p.prototype.saturate=function(e){var r;return null==e&&(e=20),(r=this.lch())[1]+=e,fe.lch(r).alpha(this.alpha())},p.prototype.desaturate=function(e){return null==e&&(e=20),this.saturate(-e)},p}(),g=function(e){var r;for(r in e)r<3?(e[r]<0&&(e[r]=0),255<e[r]&&(e[r]=255)):3===r&&(e[r]<0&&(e[r]=0),1<e[r]&&(e[r]=1));return e},t=function(e){var r,n,t,f,a,o,i,s;if(e=e.toLowerCase(),null!=fe.colors&&fe.colors[e])return m(fe.colors[e]);if(t=e.match(/rgb\(\s*(\-?\d+),\s*(\-?\d+)\s*,\s*(\-?\d+)\s*\)/)){for(f=t.slice(1,4),n=a=0;a<=2;n=++a)f[n]=+f[n];f[3]=1}else if(t=e.match(/rgba\(\s*(\-?\d+),\s*(\-?\d+)\s*,\s*(\-?\d+)\s*,\s*([01]|[01]?\.\d+)\)/))for(f=t.slice(1,5),n=o=0;o<=3;n=++o)f[n]=+f[n];else if(t=e.match(/rgb\(\s*(\-?\d+(?:\.\d+)?)%,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*\)/)){for(f=t.slice(1,4),n=i=0;i<=2;n=++i)f[n]=Math.round(2.55*f[n]);f[3]=1}else if(t=e.match(/rgba\(\s*(\-?\d+(?:\.\d+)?)%,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)/)){for(f=t.slice(1,5),n=s=0;s<=2;n=++s)f[n]=Math.round(2.55*f[n]);f[3]=+f[3]}else(t=e.match(/hsl\(\s*(\-?\d+(?:\.\d+)?),\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*\)/))?((r=t.slice(1,4))[1]*=.01,r[2]*=.01,(f=w(r))[3]=1):(t=e.match(/hsla\(\s*(\-?\d+(?:\.\d+)?),\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)/))&&((r=t.slice(1,4))[1]*=.01,r[2]*=.01,(f=w(r))[3]=+t[4]);return f},m=function(e){var r,n;if(e.match(/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/))return 4!==e.length&&7!==e.length||(e=e.substr(1)),3===e.length&&(e=(e=e.split(""))[0]+e[0]+e[1]+e[1]+e[2]+e[2]),[(n=parseInt(e,16))>>16,n>>8&255,255&n,1];if(e.match(/^#?([A-Fa-f0-9]{8})$/))return 9===e.length&&(e=e.substr(1)),[(n=parseInt(e,16))>>24&255,n>>16&255,n>>8&255,255&n];if(r=t(e))return r;throw"unknown color: "+e},y=function(e,r,n){var t,f,a,o;return e=(o=N(arguments))[0],r=o[1],n=o[2],(e/=360)<1/3?f=1-((t=(1-r)/3)+(a=(1+r*d(s*e)/d(i-s*e))/3)):e<2/3?t=1-((a=(1-r)/3)+(f=(1+r*d(s*(e-=1/3))/d(i-s*e))/3)):a=1-((f=(1-r)/3)+(t=(1+r*d(s*(e-=2/3))/d(i-s*e))/3)),[255*(a=h(n*a*3)),255*(f=h(n*f*3)),255*(t=h(n*t*3))]},w=function(){var e,r,n,t,f,a,o,i,s,d,c,u,l,b;if(t=(l=N(arguments))[0],i=l[1],a=l[2],0===i)o=n=e=255*a;else{for(r=[0,0,0],s=2*a-(d=a<.5?a*(1+i):a+i-a*i),(c=[0,0,0])[0]=(t/=360)+1/3,c[1]=t,c[2]=t-1/3,f=u=0;u<=2;f=++u)c[f]<0&&(c[f]+=1),1<c[f]&&(c[f]-=1),6*c[f]<1?r[f]=s+6*(d-s)*c[f]:2*c[f]<1?r[f]=d:3*c[f]<2?r[f]=s+(d-s)*(2/3-c[f])*6:r[f]=s;o=(b=[Math.round(255*r[0]),Math.round(255*r[1]),Math.round(255*r[2])])[0],n=b[1],e=b[2]}return[o,n,e]},v=function(){var e,r,n,t,f,a,o,i,s,d,c,u,l,b,h,g,p,m;if(t=(u=N(arguments))[0],s=u[1],c=u[2],c*=255,0===s)i=n=e=c;else switch(360===t&&(t=0),360<t&&(t-=360),t<0&&(t+=360),a=c*(1-s),o=c*(1-s*(r=(t/=60)-(f=Math.floor(t)))),d=c*(1-s*(1-r)),f){case 0:i=(l=[c,d,a])[0],n=l[1],e=l[2];break;case 1:i=(b=[o,c,a])[0],n=b[1],e=b[2];break;case 2:i=(h=[a,c,d])[0],n=h[1],e=h[2];break;case 3:i=(g=[a,o,c])[0],n=g[1],e=g[2];break;case 4:i=(p=[d,a,c])[0],n=p[1],e=p[2];break;case 5:i=(m=[c,a,o])[0],n=m[1],e=m[2]}return[i=Math.round(i),n=Math.round(n),e=Math.round(e)]},c=function(){var e,r,n,t;return n=(t=N(arguments))[0],e=t[1],r=t[2],[n,Math.sqrt(e*e+r*r),Math.atan2(r,e)/Math.PI*180]},x=function(e,r,n){var t,f,a,o,i,s,d;return void 0!==e&&3===e.length&&(e=(s=e)[0],r=s[1],n=s[2]),void 0!==e&&3===e.length&&(e=(d=e)[0],r=d[1],n=d[2]),i=(o=(e+16)/116)-n/200,a=.95047*u(a=o+r/500),o=1*u(o),i=1.08883*u(i),f=U(3.2404542*a-1.5371385*o-.4985314*i),t=U(-.969266*a+1.8760108*o+.041556*i),n=U(.0556434*a-.2040259*o+1.0572252*i),[h(f,0,255),h(t,0,255),h(n,0,255),1]},u=function(e){return.206893034<e?e*e*e:(e-4/29)/7.787037},U=function(e){return Math.round(255*(e<=.00304?12.92*e:1.055*Math.pow(e,1/2.4)-.055))},b=function(){var e,r,n,t;return n=(t=N(arguments))[0],e=t[1],r=(r=t[2])*Math.PI/180,[n,Math.cos(r)*e,Math.sin(r)*e]},_=function(e,r,n){var t,f,a,o,i,s,d;return t=(s=b(e,r,n))[0],f=s[1],a=s[2],i=(d=x(t,f,a))[0],o=d[1],a=d[2],[h(i,0,255),h(o,0,255),h(a,0,255)]},r=function(e,r,n){var t;return e=(t=N(arguments))[0],r=t[1],n=t[2],.2126*(e=a(e))+.7152*(r=a(r))+.0722*(n=a(n))},a=function(e){return(e/=255)<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)},e=function(){var e,r;return"#"+(e="000000"+((r=N(arguments))[0]<<16|r[1]<<8|r[2]).toString(16)).substr(e.length-6)},n=function(){var e,r,n,t,f,a,o,i;return a=(i=N(arguments))[0],n=i[1],r=i[2],e=2*Math.PI,a/=255,n/=255,r/=255,0===(o=1-Math.min(a,n,r)/(f=(a+n+r)/3))?t=0:(t=(a-n+(a-r))/2,t/=Math.sqrt((a-n)*(a-n)+(a-r)*(n-r)),t=Math.acos(t),n<r&&(t=e-t),t/=e),[360*t,o,f]},o=function(e,r,n){var t,f,a,o,i,s;return void 0!==e&&3<=e.length&&(e=(s=e)[0],r=s[1],n=s[2]),e/=255,r/=255,n/=255,o=Math.min(e,r,n),f=((a=Math.max(e,r,n))+o)/2,a===o?(i=0,t=Number.NaN):i=f<.5?(a-o)/(a+o):(a-o)/(2-a-o),e===a?t=(r-n)/(a-o):r===a?t=2+(n-e)/(a-o):n===a&&(t=4+(e-r)/(a-o)),(t*=60)<0&&(t+=360),[t,i,f]},k=function(){var e,r,n,t,f,a,o,i,s,d;return o=(d=N(arguments))[0],n=d[1],e=d[2],a=Math.min(o,n,e),r=(f=Math.max(o,n,e))-a,s=f/255,0===f?(t=Number.NaN,i=0):(i=r/f,o===f&&(t=(n-e)/r),n===f&&(t=2+(e-o)/r),e===f&&(t=4+(o-n)/r),(t*=60)<0&&(t+=360)),[t,i,s]},j=function(){var e,r,n,t,f,a;return n=(a=N(arguments))[0],r=a[1],e=a[2],n=p(n),r=p(r),e=p(e),t=D((.4124564*n+.3575761*r+.1804375*e)/.95047),[116*(f=D((.2126729*n+.7151522*r+.072175*e)/1))-16,500*(t-f),200*(f-D((.0193339*n+.119192*r+.9503041*e)/1.08883))]},p=function(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)},D=function(e){return.008856<e?Math.pow(e,1/3):7.787037*e+4/29},M=function(){var e,r,n,t,f,a,o;return f=(a=N(arguments))[0],n=a[1],r=a[2],t=(o=j(f,n,r))[0],e=o[1],r=o[2],c(t,e,r)},fe.scale=function(i,e){var s,d,c,u,n,a,l,b,h,r,g,p,m,y,w,v,t,x,o;return y="rgb",w=fe("#ccc"),!1,g=[o=0,1],t=!(h=[]),x=[],r=!(p=1),v=m=0,b={},n=function(e,r){var n,t,f,a,o,i,s;if(null==e&&(e=["#ddd","#222"]),null!=e&&"string"===ae(e)&&null!=(null!=(o=fe.brewer)?o[e]:void 0)&&(e=fe.brewer[e]),"array"===ae(e)){for(n=f=0,i=(e=e.slice(0)).length-1;0<=i?f<=i:i<=f;n=0<=i?++f:--f)t=e[n],"string"===ae(t)&&(e[n]=fe(t));if(null!=r)x=r;else for(x=[],n=a=0,s=e.length-1;0<=s?a<=s:s<=a;n=0<=s?++a:--a)x.push(n/(e.length-1))}return u(),h=e},a=function(e){return null==e&&(e=[]),m=(g=e)[0],p=e[e.length-1],u(),v=2===e.length?0:e.length-1},d=function(e){var r,n;if(null==g)return 0;for(n=g.length-1,r=0;r<n&&e>=g[r];)r++;return r-1},l=function(e){return e},function(e){var r,n,t,f,a;return a=e,2<g.length&&(f=g.length-1,r=d(e),t=g[0]+(g[1]-g[0])*(0+.5*o),n=g[f-1]+(g[f]-g[f-1])*(1-.5*o),a=m+(g[r]+.5*(g[r+1]-g[r])-t)/(n-t)*(p-m)),a},c=function(e,r){var n,t,f,a,o,i,s;if(null==r&&(r=!1),isNaN(e))return w;if(o=r?e:2<g.length?d(e)/(v-1):(o=m!==p?(e-m)/(p-m):0,o=(e-m)/(p-m),Math.min(1,Math.max(0,o))),r||(o=l(o)),f=Math.floor(1e4*o),b[f])n=b[f];else{if("array"===ae(h))for(t=i=0,s=x.length-1;0<=s?i<=s:s<=i;t=0<=s?++i:--i){if(o<=(a=x[t])){n=h[t];break}if(a<=o&&t===x.length-1){n=h[t];break}if(a<o&&o<x[t+1]){o=(o-a)/(x[t+1]-a),n=fe.interpolate(h[t],h[t+1],o,y);break}}else"function"===ae(h)&&(n=h(o));b[f]=n}return n},u=function(){return b={}},n(i,e),(s=function(e){var r;return r=c(e),t&&r[t]?r[t]():r}).domain=function(e,r,n,t){var f;return null==n&&(n="e"),arguments.length?(null!=r&&(f=fe.analyze(e,t),e=0===r?[f.min,f.max]:fe.limits(f,n,r)),a(e),s):g},s.mode=function(e){return arguments.length?(y=e,u(),s):y},s.range=function(e,r){return n(e,r),s},s.out=function(e){return t=e,s},s.spread=function(e){return arguments.length?(o=e,s):o},s.correctLightness=function(e){return arguments.length?(r=e,u(),l=r?function(e){var r,n,t,f,a,o,i,s,d;for(r=c(0,!0).lab()[0],n=c(1,!0).lab()[0],i=n<r,t=c(e,!0).lab()[0],f=t-(a=r+(n-r)*e),s=0,d=1,o=20;.01<Math.abs(f)&&0<o--;)i&&(f*=-1),e+=f<0?.5*(d-(s=e)):.5*(s-(d=e)),t=c(e,!0).lab()[0],f=t-a;return e}:function(e){return e},s):r},s.colors=function(e){var r,n,t,f,a,o;if(null==e&&(e="hex"),i=[],n=[],2<g.length)for(r=t=1,o=g.length;1<=o?t<o:o<t;r=1<=o?++t:--t)n.push(.5*(g[r-1]+g[r]));else n=g;for(f=0,a=n.length;f<a;f++)r=n[f],i.push(s(r)[e]());return i},s},null==fe.scales&&(fe.scales={}),fe.scales.cool=function(){return fe.scale([fe.hsl(180,1,.9),fe.hsl(250,.7,.4)])},fe.scales.hot=function(){return fe.scale(["#000","#f00","#ff0","#fff"],[0,.25,.75,1]).mode("rgb")},fe.analyze=function(e,n,t){var f,r,a,o,i,s;if(a={min:Number.MAX_VALUE,max:-1*Number.MAX_VALUE,sum:0,values:[],count:0},null==t&&(t=function(){return!0}),f=function(e){null==e||isNaN(e)||(a.values.push(e),a.sum+=e,e<a.min&&(a.min=e),e>a.max&&(a.max=e),a.count+=1)},o=function(e,r){if(t(e,r))return null!=n&&"function"===ae(n)?f(n(e)):null!=n&&"string"===ae(n)||"number"===ae(n)?f(e[n]):f(e)},"array"===ae(e))for(i=0,s=e.length;i<s;i++)o(e[i]);else for(r in e)o(e[r],r);return a.domain=[a.min,a.max],a.limits=function(e,r){return fe.limits(a,e,r)},a},fe.limits=function(e,r,n){var t,f,a,o,i,s,d,c,u,l,b,h,g,p,m,y,w,v,x,_,k,j,M,N,D,U,A,P,z,G,E,B,I,q,R,S,O,C,T,Y,L,F,V,X,W,$,Z,H,J,K,Q,ee,re,ne,te;if(null==r&&(r="equal"),null==n&&(n=7),"array"===ae(e)&&(e=fe.analyze(e)),g=e.min,b=e.max,e.sum,D=e.values.sort(function(e,r){return e-r}),l=[],"c"===r.substr(0,1)&&(l.push(g),l.push(b)),"e"===r.substr(0,1)){for(l.push(g),d=U=1,S=n-1;1<=S?U<=S:S<=U;d=1<=S?++U:--U)l.push(g+d/n*(b-g));l.push(b)}else if("l"===r.substr(0,1)){if(g<=0)throw"Logarithmic scales are only possible for values > 0";for(p=Math.LOG10E*Math.log(g),h=Math.LOG10E*Math.log(b),l.push(g),d=A=1,V=n-1;1<=V?A<=V:V<=A;d=1<=V?++A:--A)l.push(Math.pow(10,p+d/n*(h-p)));l.push(b)}else if("q"===r.substr(0,1)){for(l.push(g),d=P=1,X=n-1;1<=X?P<=X:X<=P;d=1<=X?++P:--P)x=D.length*d/n,(_=Math.floor(x))===x?l.push(D[_]):(k=x-_,l.push(D[_]*k+D[_+1]*(1-k)));l.push(b)}else if("k"===r.substr(0,1)){for(y=D.length,t=new Array(y),i=new Array(n),j=!0,w=0,a=null,(a=[]).push(g),d=z=1,W=n-1;1<=W?z<=W:W<=z;d=1<=W?++z:--z)a.push(g+d/n*(b-g));for(a.push(b);j;){for(c=G=0,$=n-1;0<=$?G<=$:$<=G;c=0<=$?++G:--G)i[c]=0;for(d=E=0,Z=y-1;0<=Z?E<=Z:Z<=E;d=0<=Z?++E:--E){for(N=D[d],m=Number.MAX_VALUE,c=B=0,H=n-1;0<=H?B<=H:H<=B;c=0<=H?++B:--B)(s=Math.abs(a[c]-N))<m&&(m=s,f=c);i[f]++,t[d]=f}for(v=new Array(n),c=I=0,J=n-1;0<=J?I<=J:J<=I;c=0<=J?++I:--I)v[c]=null;for(d=q=0,K=y-1;0<=K?q<=K:K<=q;d=0<=K?++q:--q)null===v[o=t[d]]?v[o]=D[d]:v[o]+=D[d];for(c=R=0,O=n-1;0<=O?R<=O:O<=R;c=0<=O?++R:--R)v[c]*=1/i[c];for(j=!1,c=Q=0,C=n-1;0<=C?Q<=C:C<=Q;c=0<=C?++Q:--Q)if(v[c]!==a[d]){j=!0;break}a=v,200<++w&&(j=!1)}for(u={},c=ee=0,T=n-1;0<=T?ee<=T:T<=ee;c=0<=T?++ee:--ee)u[c]=[];for(d=re=0,Y=y-1;0<=Y?re<=Y:Y<=re;d=0<=Y?++re:--re)u[o=t[d]].push(D[d]);for(M=[],c=ne=0,L=n-1;0<=L?ne<=L:L<=ne;c=0<=L?++ne:--ne)M.push(u[c][0]),M.push(u[c][u[c].length-1]);for(M=M.sort(function(e,r){return e-r}),l.push(M[0]),d=te=1,F=M.length-1;te<=F;d=te+=2)isNaN(M[d])||l.push(M[d])}return l},fe.brewer={OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],Set2:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],Accent:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],Set1:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"],Set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],Dark2:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],Paired:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],Pastel2:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],Pastel1:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},fe.colors={indigo:"#4b0082",gold:"#ffd700",hotpink:"#ff69b4",firebrick:"#b22222",indianred:"#cd5c5c",yellow:"#ffff00",mistyrose:"#ffe4e1",darkolivegreen:"#556b2f",olive:"#808000",darkseagreen:"#8fbc8f",pink:"#ffc0cb",tomato:"#ff6347",lightcoral:"#f08080",orangered:"#ff4500",navajowhite:"#ffdead",lime:"#00ff00",palegreen:"#98fb98",darkslategrey:"#2f4f4f",greenyellow:"#adff2f",burlywood:"#deb887",seashell:"#fff5ee",mediumspringgreen:"#00fa9a",fuchsia:"#ff00ff",papayawhip:"#ffefd5",blanchedalmond:"#ffebcd",chartreuse:"#7fff00",dimgray:"#696969",black:"#000000",peachpuff:"#ffdab9",springgreen:"#00ff7f",aquamarine:"#7fffd4",white:"#ffffff",orange:"#ffa500",lightsalmon:"#ffa07a",darkslategray:"#2f4f4f",brown:"#a52a2a",ivory:"#fffff0",dodgerblue:"#1e90ff",peru:"#cd853f",lawngreen:"#7cfc00",chocolate:"#d2691e",crimson:"#dc143c",forestgreen:"#228b22",darkgrey:"#a9a9a9",lightseagreen:"#20b2aa",cyan:"#00ffff",mintcream:"#f5fffa",silver:"#c0c0c0",antiquewhite:"#faebd7",mediumorchid:"#ba55d3",skyblue:"#87ceeb",gray:"#808080",darkturquoise:"#00ced1",goldenrod:"#daa520",darkgreen:"#006400",floralwhite:"#fffaf0",darkviolet:"#9400d3",darkgray:"#a9a9a9",moccasin:"#ffe4b5",saddlebrown:"#8b4513",grey:"#808080",darkslateblue:"#483d8b",lightskyblue:"#87cefa",lightpink:"#ffb6c1",mediumvioletred:"#c71585",slategrey:"#708090",red:"#ff0000",deeppink:"#ff1493",limegreen:"#32cd32",darkmagenta:"#8b008b",palegoldenrod:"#eee8aa",plum:"#dda0dd",turquoise:"#40e0d0",lightgrey:"#d3d3d3",lightgoldenrodyellow:"#fafad2",darkgoldenrod:"#b8860b",lavender:"#e6e6fa",maroon:"#800000",yellowgreen:"#9acd32",sandybrown:"#f4a460",thistle:"#d8bfd8",violet:"#ee82ee",navy:"#000080",magenta:"#ff00ff",dimgrey:"#696969",tan:"#d2b48c",rosybrown:"#bc8f8f",olivedrab:"#6b8e23",blue:"#0000ff",lightblue:"#add8e6",ghostwhite:"#f8f8ff",honeydew:"#f0fff0",cornflowerblue:"#6495ed",slateblue:"#6a5acd",linen:"#faf0e6",darkblue:"#00008b",powderblue:"#b0e0e6",seagreen:"#2e8b57",darkkhaki:"#bdb76b",snow:"#fffafa",sienna:"#a0522d",mediumblue:"#0000cd",royalblue:"#4169e1",lightcyan:"#e0ffff",green:"#008000",mediumpurple:"#9370db",midnightblue:"#191970",cornsilk:"#fff8dc",paleturquoise:"#afeeee",bisque:"#ffe4c4",slategray:"#708090",darkcyan:"#008b8b",khaki:"#f0e68c",wheat:"#f5deb3",teal:"#008080",darkorchid:"#9932cc",deepskyblue:"#00bfff",salmon:"#fa8072",darkred:"#8b0000",steelblue:"#4682b4",palevioletred:"#db7093",lightslategray:"#778899",aliceblue:"#f0f8ff",lightslategrey:"#778899",lightgreen:"#90ee90",orchid:"#da70d6",gainsboro:"#dcdcdc",mediumseagreen:"#3cb371",lightgray:"#d3d3d3",mediumturquoise:"#48d1cc",lemonchiffon:"#fffacd",cadetblue:"#5f9ea0",lightyellow:"#ffffe0",lavenderblush:"#fff0f5",coral:"#ff7f50",purple:"#800080",aqua:"#00ffff",whitesmoke:"#f5f5f5",mediumslateblue:"#7b68ee",darkorange:"#ff8c00",mediumaquamarine:"#66cdaa",darksalmon:"#e9967a",beige:"#f5f5dc",blueviolet:"#8a2be2",azure:"#f0ffff",lightsteelblue:"#b0c4de",oldlace:"#fdf5e6"},ae=function(){var n,e,r,t,f;for(n={},r=0,t=(f="Boolean Number String Function Array Date RegExp Undefined Null".split(" ")).length;r<t;r++)e=f[r],n["[object "+e+"]"]=e.toLowerCase();return function(e){var r;return r=Object.prototype.toString.call(e),n[r]||"object"}}(),h=function(e,r,n){return null==r&&(r=0),null==n&&(n=1),e<r&&(e=r),n<e&&(e=n),e},N=function(e){return 3<=e.length?e:e[0]},s=2*Math.PI,i=Math.PI/3,d=Math.cos,l=function(t){var e,r,n,f,a,o,i,s,d,c,u;return 2===(t=function(){var e,r,n;for(n=[],e=0,r=t.length;e<r;e++)f=t[e],n.push(fe(f));return n}()).length?(d=function(){var e,r,n;for(n=[],e=0,r=t.length;e<r;e++)f=t[e],n.push(f.lab());return n}(),a=d[0],o=d[1],e=function(n){var t,e;return e=function(){var e,r;for(r=[],t=e=0;e<=2;t=++e)r.push(a[t]+n*(o[t]-a[t]));return r}(),fe.lab.apply(fe,e)}):3===t.length?(c=function(){var e,r,n;for(n=[],e=0,r=t.length;e<r;e++)f=t[e],n.push(f.lab());return n}(),a=c[0],o=c[1],i=c[2],e=function(n){var t,e;return e=function(){var e,r;for(r=[],t=e=0;e<=2;t=++e)r.push((1-n)*(1-n)*a[t]+2*(1-n)*n*o[t]+n*n*i[t]);return r}(),fe.lab.apply(fe,e)}):4===t.length?(u=function(){var e,r,n;for(n=[],e=0,r=t.length;e<r;e++)f=t[e],n.push(f.lab());return n}(),a=u[0],o=u[1],i=u[2],s=u[3],e=function(n){var t,e;return e=function(){var e,r;for(r=[],t=e=0;e<=2;t=++e)r.push((1-n)*(1-n)*(1-n)*a[t]+3*(1-n)*(1-n)*n*o[t]+3*(1-n)*n*n*i[t]+n*n*n*s[t]);return r}(),fe.lab.apply(fe,e)}):5===t.length&&(r=l(t.slice(0,3)),n=l(t.slice(2,5)),e=function(e){return e<.5?r(2*e):n(2*(e-.5))}),e},fe.interpolate.bezier=l}).call(this)},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/delaunay-fast/delaunay.js":[function(e,r,n){var t;!function(){"use strict";var _=1/1048576;function g(e,r,n,t){var f,a,o,i,s,d,c,u,l,b,h=e[r][0],g=e[r][1],p=e[n][0],m=e[n][1],y=e[t][0],w=e[t][1],v=Math.abs(g-m),x=Math.abs(m-w);if(v<_&&x<_)throw new Error("Eek! Coincident points!");return a=v<_?(i=-(y-p)/(w-m))*((f=(p+h)/2)-(d=(p+y)/2))+(u=(m+w)/2):x<_?(o=-(p-h)/(m-g))*((f=(y+p)/2)-(s=(h+p)/2))+(c=(g+m)/2):(f=((o=-(p-h)/(m-g))*(s=(h+p)/2)-(i=-(y-p)/(w-m))*(d=(p+y)/2)+(u=(m+w)/2)-(c=(g+m)/2))/(o-i),x<v?o*(f-s)+c:i*(f-d)+u),{i:r,j:n,k:t,x:f,y:a,r:(l=p-f)*l+(b=m-a)*b}}function p(e){var r,n,t,f,a,o;for(n=e.length;n;)for(f=e[--n],t=e[--n],r=n;r;)if(o=e[--r],t===(a=e[--r])&&f===o||t===o&&f===a){e.splice(n,2),e.splice(r,2);break}}t={triangulate:function(n,e){var r,t,f,a,o,i,s,d,c,u,l,b,h=n.length;if(h<3)return[];if(n=n.slice(0),e)for(r=h;r--;)n[r]=n[r][e];for(f=new Array(h),r=h;r--;)f[r]=r;for(f.sort(function(e,r){return n[r][0]-n[e][0]}),a=function(e){var r,n,t,f,a,o,i=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY,d=Number.NEGATIVE_INFINITY,c=Number.NEGATIVE_INFINITY;for(r=e.length;r--;)e[r][0]<i&&(i=e[r][0]),e[r][0]>d&&(d=e[r][0]),e[r][1]<s&&(s=e[r][1]),e[r][1]>c&&(c=e[r][1]);return t=c-s,[[(a=i+.5*(n=d-i))-20*(f=Math.max(n,t)),(o=s+.5*t)-f],[a,o+20*f],[a+20*f,o-f]]}(n),n.push(a[0],a[1],a[2]),o=[g(n,h+0,h+1,h+2)],i=[],s=[],r=f.length;r--;s.length=0){for(b=f[r],t=o.length;t--;)0<(d=n[b][0]-o[t].x)&&d*d>o[t].r?(i.push(o[t]),o.splice(t,1)):d*d+(c=n[b][1]-o[t].y)*c-o[t].r>_||(s.push(o[t].i,o[t].j,o[t].j,o[t].k,o[t].k,o[t].i),o.splice(t,1));for(p(s),t=s.length;t;)l=s[--t],u=s[--t],o.push(g(n,u,l,b))}for(r=o.length;r--;)i.push(o[r]);for(o.length=0,r=i.length;r--;)i[r].i<h&&i[r].j<h&&i[r].k<h&&o.push(i[r].i,i[r].j,i[r].k);return o},contains:function(e,r){if(r[0]<e[0][0]&&r[0]<e[1][0]&&r[0]<e[2][0]||r[0]>e[0][0]&&r[0]>e[1][0]&&r[0]>e[2][0]||r[1]<e[0][1]&&r[1]<e[1][1]&&r[1]<e[2][1]||r[1]>e[0][1]&&r[1]>e[1][1]&&r[1]>e[2][1])return null;var n=e[1][0]-e[0][0],t=e[2][0]-e[0][0],f=e[1][1]-e[0][1],a=e[2][1]-e[0][1],o=n*a-t*f;if(0===o)return null;var i=(a*(r[0]-e[0][0])-t*(r[1]-e[0][1]))/o,s=(n*(r[1]-e[0][1])-f*(r[0]-e[0][0]))/o;return i<0||s<0||1<i+s?null:[i,s]}},void 0!==r&&(r.exports=t)}()},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/index.js":[function(e,r,n){var t=e("./lib/alea"),f=e("./lib/xor128"),a=e("./lib/xorwow"),o=e("./lib/xorshift7"),i=e("./lib/xor4096"),s=e("./lib/tychei"),d=e("./seedrandom");d.alea=t,d.xor128=f,d.xorwow=a,d.xorshift7=o,d.xor4096=i,d.tychei=s,r.exports=d},{"./lib/alea":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/alea.js","./lib/tychei":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/tychei.js","./lib/xor128":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/xor128.js","./lib/xor4096":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/xor4096.js","./lib/xorshift7":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/xorshift7.js","./lib/xorwow":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/xorwow.js","./seedrandom":"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/seedrandom.js"}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/alea.js":[function(e,r,n){!function(e,r,n){function a(e){var t,r=this,n=(t=4022871197,function(e){e=e.toString();for(var r=0;r<e.length;r++){var n=.02519603282416938*(t+=e.charCodeAt(r));n-=t=n>>>0,t=(n*=t)>>>0,t+=4294967296*(n-=t)}return 2.3283064365386963e-10*(t>>>0)});r.next=function(){var e=2091639*r.s0+2.3283064365386963e-10*r.c;return r.s0=r.s1,r.s1=r.s2,r.s2=e-(r.c=0|e)},r.c=1,r.s0=n(" "),r.s1=n(" "),r.s2=n(" "),r.s0-=n(e),r.s0<0&&(r.s0+=1),r.s1-=n(e),r.s1<0&&(r.s1+=1),r.s2-=n(e),r.s2<0&&(r.s2+=1),n=null}function o(e,r){return r.c=e.c,r.s0=e.s0,r.s1=e.s1,r.s2=e.s2,r}function t(e,r){var n=new a(e),t=r&&r.state,f=n.next;return f.int32=function(){return 4294967296*n.next()|0},f.double=function(){return f()+11102230246251565e-32*(2097152*f()|0)},f.quick=f,t&&("object"==typeof t&&o(t,n),f.state=function(){return o(n,{})}),f}r&&r.exports?r.exports=t:n&&n.amd?n(function(){return t}):this.alea=t}(0,"object"==typeof r&&r,!1)},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/tychei.js":[function(e,r,n){!function(e,r,n){function a(e){var f=this,r="";f.next=function(){var e=f.b,r=f.c,n=f.d,t=f.a;return e=e<<25^e>>>7^r,r=r-n|0,n=n<<24^n>>>8^t,t=t-e|0,f.b=e=e<<20^e>>>12^r,f.c=r=r-n|0,f.d=n<<16^r>>>16^t,f.a=t-e|0},f.a=0,f.b=0,f.c=-1640531527,f.d=1367130551,e===Math.floor(e)?(f.a=e/4294967296|0,f.b=0|e):r+=e;for(var n=0;n<r.length+20;n++)f.b^=0|r.charCodeAt(n),f.next()}function o(e,r){return r.a=e.a,r.b=e.b,r.c=e.c,r.d=e.d,r}function t(e,r){var n=new a(e),t=r&&r.state,f=function(){return(n.next()>>>0)/4294967296};return f.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},f.int32=n.next,f.quick=f,t&&("object"==typeof t&&o(t,n),f.state=function(){return o(n,{})}),f}r&&r.exports?r.exports=t:n&&n.amd?n(function(){return t}):this.tychei=t}(0,"object"==typeof r&&r,!1)},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/xor128.js":[function(e,r,n){!function(e,r,n){function a(e){var r=this,n="";r.x=0,r.y=0,r.z=0,r.w=0,r.next=function(){var e=r.x^r.x<<11;return r.x=r.y,r.y=r.z,r.z=r.w,r.w^=r.w>>>19^e^e>>>8},e===(0|e)?r.x=e:n+=e;for(var t=0;t<n.length+64;t++)r.x^=0|n.charCodeAt(t),r.next()}function o(e,r){return r.x=e.x,r.y=e.y,r.z=e.z,r.w=e.w,r}function t(e,r){var n=new a(e),t=r&&r.state,f=function(){return(n.next()>>>0)/4294967296};return f.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},f.int32=n.next,f.quick=f,t&&("object"==typeof t&&o(t,n),f.state=function(){return o(n,{})}),f}r&&r.exports?r.exports=t:n&&n.amd?n(function(){return t}):this.xor128=t}(0,"object"==typeof r&&r,!1)},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/xor4096.js":[function(e,r,n){!function(e,r,n){function a(e){var a=this;a.next=function(){var e,r,n=a.w,t=a.X,f=a.i;return a.w=n=n+1640531527|0,r=t[f+34&127],e=t[f=f+1&127],r^=r<<13,e^=e<<17,r^=r>>>15,e^=e>>>12,r=t[f]=r^e,a.i=f,r+(n^n>>>16)|0},function(e,r){var n,t,f,a,o,i=[],s=128;for(r===(0|r)?(t=r,r=null):(r+="\0",t=0,s=Math.max(s,r.length)),f=0,a=-32;a<s;++a)r&&(t^=r.charCodeAt((a+32)%r.length)),0===a&&(o=t),t^=t<<10,t^=t>>>15,t^=t<<4,t^=t>>>13,0<=a&&(o=o+1640531527|0,f=0==(n=i[127&a]^=t+o)?f+1:0);for(128<=f&&(i[127&(r&&r.length||0)]=-1),f=127,a=512;0<a;--a)t=i[f+34&127],n=i[f=f+1&127],t^=t<<13,n^=n<<17,t^=t>>>15,n^=n>>>12,i[f]=t^n;e.w=o,e.X=i,e.i=f}(a,e)}function o(e,r){return r.i=e.i,r.w=e.w,r.X=e.X.slice(),r}function t(e,r){null==e&&(e=+new Date);var n=new a(e),t=r&&r.state,f=function(){return(n.next()>>>0)/4294967296};return f.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},f.int32=n.next,f.quick=f,t&&(t.X&&o(t,n),f.state=function(){return o(n,{})}),f}r&&r.exports?r.exports=t:n&&n.amd?n(function(){return t}):this.xor4096=t}(0,"object"==typeof r&&r,!1)},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/xorshift7.js":[function(e,r,n){!function(e,r,n){function a(e){var f=this;f.next=function(){var e,r,n=f.x,t=f.i;return e=n[t],r=(e^=e>>>7)^e<<24,r^=(e=n[t+1&7])^e>>>10,r^=(e=n[t+3&7])^e>>>3,r^=(e=n[t+4&7])^e<<7,e=n[t+7&7],r^=(e^=e<<13)^e<<9,n[t]=r,f.i=t+1&7,r},function(e,r){var n,t=[];if(r===(0|r))t[0]=r;else for(r=""+r,n=0;n<r.length;++n)t[7&n]=t[7&n]<<15^r.charCodeAt(n)+t[n+1&7]<<13;for(;t.length<8;)t.push(0);for(n=0;n<8&&0===t[n];++n);for(8==n?t[7]=-1:t[n],e.x=t,e.i=0,n=256;0<n;--n)e.next()}(f,e)}function o(e,r){return r.x=e.x.slice(),r.i=e.i,r}function t(e,r){null==e&&(e=+new Date);var n=new a(e),t=r&&r.state,f=function(){return(n.next()>>>0)/4294967296};return f.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},f.int32=n.next,f.quick=f,t&&(t.x&&o(t,n),f.state=function(){return o(n,{})}),f}r&&r.exports?r.exports=t:n&&n.amd?n(function(){return t}):this.xorshift7=t}(0,"object"==typeof r&&r,!1)},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/lib/xorwow.js":[function(e,r,n){!function(e,r,n){function a(e){var r=this,n="";r.next=function(){var e=r.x^r.x>>>2;return r.x=r.y,r.y=r.z,r.z=r.w,r.w=r.v,(r.d=r.d+362437|0)+(r.v=r.v^r.v<<4^e^e<<1)|0},r.x=0,r.y=0,r.z=0,r.w=0,e===((r.v=0)|e)?r.x=e:n+=e;for(var t=0;t<n.length+64;t++)r.x^=0|n.charCodeAt(t),t==n.length&&(r.d=r.x<<10^r.x>>>4),r.next()}function o(e,r){return r.x=e.x,r.y=e.y,r.z=e.z,r.w=e.w,r.v=e.v,r.d=e.d,r}function t(e,r){var n=new a(e),t=r&&r.state,f=function(){return(n.next()>>>0)/4294967296};return f.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},f.int32=n.next,f.quick=f,t&&("object"==typeof t&&o(t,n),f.state=function(){return o(n,{})}),f}r&&r.exports?r.exports=t:n&&n.amd?n(function(){return t}):this.xorwow=t}(0,"object"==typeof r&&r,!1)},{}],"/Users/gpriday/Downloads/trianglify-master 2/node_modules/seedrandom/seedrandom.js":[function(r,n,e){!function(i,s){var d,c=this,u=256,l=6,b="random",h=s.pow(u,l),g=s.pow(2,52),p=2*g,m=u-1;function e(e,r,n){var t=[],f=v(function e(r,n){var t,f=[],a=typeof r;if(n&&"object"==a)for(t in r)try{f.push(e(r[t],n-1))}catch(e){}return f.length?f:"string"==a?r:r+"\0"}((r=1==r?{entropy:!0}:r||{}).entropy?[e,x(i)]:null==e?function(){try{if(d)return x(d.randomBytes(u));var e=new Uint8Array(u);return(c.crypto||c.msCrypto).getRandomValues(e),x(e)}catch(e){var r=c.navigator,n=r&&r.plugins;return[+new Date,c,n,c.screen,x(i)]}}():e,3),t),a=new y(t),o=function(){for(var e=a.g(l),r=h,n=0;e<g;)e=(e+n)*u,r*=u,n=a.g(1);for(;p<=e;)e/=2,r/=2,n>>>=1;return(e+n)/r};return o.int32=function(){return 0|a.g(4)},o.quick=function(){return a.g(4)/4294967296},o.double=o,v(x(a.S),i),(r.pass||n||function(e,r,n,t){return t&&(t.S&&w(t,a),e.state=function(){return w(a,{})}),n?(s[b]=e,r):e})(o,f,"global"in r?r.global:this==s,r.state)}function y(e){var r,n=e.length,o=this,t=0,f=o.i=o.j=0,a=o.S=[];for(n||(e=[n++]);t<u;)a[t]=t++;for(t=0;t<u;t++)a[t]=a[f=m&f+e[t%n]+(r=a[t])],a[f]=r;(o.g=function(e){for(var r,n=0,t=o.i,f=o.j,a=o.S;e--;)r=a[t=m&t+1],n=n*u+a[m&(a[t]=a[f=m&f+r])+(a[f]=r)];return o.i=t,o.j=f,n})(u)}function w(e,r){return r.i=e.i,r.j=e.j,r.S=e.S.slice(),r}function v(e,r){for(var n,t=e+"",f=0;f<t.length;)r[m&f]=m&(n^=19*r[m&f])+t.charCodeAt(f++);return x(r)}function x(e){return String.fromCharCode.apply(0,e)}if(s["seed"+b]=e,v(s.random(),i),"object"==typeof n&&n.exports){n.exports=e;try{d=r("crypto")}catch(e){}}else 0}([],Math)},{crypto:!1}]},{},["./lib/trianglify.js"])("./lib/trianglify.js")});
|
Â
|
base/inc/fields/icon.class.php
CHANGED
@@ -1,93 +1,93 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Class SiteOrigin_Widget_Field_Icon
|
5 |
-
*/
|
6 |
-
class SiteOrigin_Widget_Field_Icon extends SiteOrigin_Widget_Field_Base {
|
7 |
-
/**
|
8 |
-
* The number of visible rows in the icons selector.
|
9 |
-
*
|
10 |
-
* @access protected
|
11 |
-
* @var int
|
12 |
-
*
|
13 |
-
*/
|
14 |
-
protected $rows = 3;
|
15 |
-
|
16 |
-
protected $icons_callback;
|
17 |
-
|
18 |
-
protected function render_field( $value, $instance ) {
|
19 |
-
$widget_icon_families = $this->get_widget_icon_families();
|
20 |
-
list( $value_family, $null ) = !empty($value) ? explode('-', $value, 2) : array('fontawesome', '');
|
21 |
-
|
22 |
-
?>
|
23 |
-
|
24 |
-
<div class="siteorigin-widget-icon-selector-current">
|
25 |
-
<div class="siteorigin-widget-icon"><span></span></div>
|
26 |
-
<label><?php _e('Choose Icon', 'so-widgets-bundle') ?></label>
|
27 |
-
</div>
|
28 |
-
|
29 |
-
<a class="so-icon-remove" style="display: <?php echo !empty( $value ) ? 'inline-block' : 'none' ?>;"><?php esc_html_e( 'Remove', 'so-widgets-bundle' ) ?></a>
|
30 |
-
|
31 |
-
<div class="clear"></div>
|
32 |
-
|
33 |
-
<div class="siteorigin-widget-icon-selector siteorigin-widget-field-subcontainer">
|
34 |
-
<select class="siteorigin-widget-icon-family" >
|
35 |
-
<?php foreach( $widget_icon_families as $family_id => $family_info ) : ?>
|
36 |
-
<option value="<?php echo esc_attr( $family_id ) ?>"
|
37 |
-
<?php selected( $value_family, $family_id ) ?>
|
38 |
-
<?php if( !empty( $this->icons_callback ) ) echo 'data-icons="' . esc_attr( json_encode( $family_info ) ) . '"' ?>
|
39 |
-
>
|
40 |
-
<?php echo esc_html( $family_info['name'] ) ?> (<?php echo count( $family_info['icons'] ) ?>)
|
41 |
-
</option>
|
42 |
-
<?php endforeach; ?>
|
43 |
-
</select>
|
44 |
-
|
45 |
-
<input type="search" class="siteorigin-widget-icon-search" placeholder="<?php esc_attr_e( 'Search Icons' ) ?>" />
|
46 |
-
|
47 |
-
<input type="hidden" name="<?php echo esc_attr( $this->element_name ) ?>" value="<?php echo esc_attr( $value ) ?>"
|
48 |
-
class="siteorigin-widget-icon-icon siteorigin-widget-input" />
|
49 |
-
|
50 |
-
<div class="siteorigin-widget-icon-icons" style="height: <?php echo ( $this->rows * 54 ) - 3 ?>px;"></div>
|
51 |
-
</div>
|
52 |
-
<?php
|
53 |
-
}
|
54 |
-
|
55 |
-
protected function sanitize_field_input( $value, $instance ) {
|
56 |
-
$sanitized_value = $value;
|
57 |
-
// Alphanumeric characters and hyphens.
|
58 |
-
if( preg_match( '/[\w\d]+[\w\d-]*/', $sanitized_value, $sanitized_matches ) ) {
|
59 |
-
$sanitized_value = $sanitized_matches[0];
|
60 |
-
}
|
61 |
-
else {
|
62 |
-
$sanitized_value = '';
|
63 |
-
}
|
64 |
-
list( $value_family, $value_icon ) = ( ! empty( $sanitized_value ) && strpos( $sanitized_value, '-' ) !== false ) ? explode( '-', $sanitized_value, 2 ) : array('', '');
|
65 |
-
|
66 |
-
$widget_icon_families = $this->get_widget_icon_families();
|
67 |
-
if( ! ( isset( $widget_icon_families[$value_family] ) && isset( $widget_icon_families[$value_family]['icons'][$value_icon] ) ) ) {
|
68 |
-
$sanitized_value = isset( $this->default ) ? $this->default : '';
|
69 |
-
}
|
70 |
-
|
71 |
-
return $sanitized_value;
|
72 |
-
}
|
73 |
-
|
74 |
-
private function get_widget_icon_families(){
|
75 |
-
if( !empty( $this->icons_callback ) ) {
|
76 |
-
// We'll get the icons from the callback function
|
77 |
-
$widget_icon_families = call_user_func( $this->icons_callback );
|
78 |
-
}
|
79 |
-
else {
|
80 |
-
// We'll get icons from the main filter
|
81 |
-
static $widget_icon_families;
|
82 |
-
if( empty( $widget_icon_families ) ) $widget_icon_families = apply_filters('siteorigin_widgets_icon_families', array() );
|
83 |
-
}
|
84 |
-
|
85 |
-
return $widget_icon_families;
|
86 |
-
}
|
87 |
-
|
88 |
-
public function enqueue_scripts(){
|
89 |
-
wp_enqueue_script( 'so-icon-field', plugin_dir_url( __FILE__ ) . 'js/icon-field' . SOW_BUNDLE_JS_SUFFIX . '.js', array( 'jquery' ), SOW_BUNDLE_VERSION );
|
90 |
-
wp_enqueue_style( 'so-icon-field', plugin_dir_url( __FILE__ ) . 'css/icon-field.css', array( ), SOW_BUNDLE_VERSION );
|
91 |
-
}
|
92 |
-
|
93 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Class SiteOrigin_Widget_Field_Icon
|
5 |
+
*/
|
6 |
+
class SiteOrigin_Widget_Field_Icon extends SiteOrigin_Widget_Field_Base {
|
7 |
+
/**
|
8 |
+
* The number of visible rows in the icons selector.
|
9 |
+
*
|
10 |
+
* @access protected
|
11 |
+
* @var int
|
12 |
+
*
|
13 |
+
*/
|
14 |
+
protected $rows = 3;
|
15 |
+
|
16 |
+
protected $icons_callback;
|
17 |
+
|
18 |
+
protected function render_field( $value, $instance ) {
|
19 |
+
$widget_icon_families = $this->get_widget_icon_families();
|
20 |
+
list( $value_family, $null ) = !empty($value) ? explode('-', $value, 2) : array('fontawesome', '');
|
21 |
+
|
22 |
+
?>
|
23 |
+
|
24 |
+
<div class="siteorigin-widget-icon-selector-current">
|
25 |
+
<div class="siteorigin-widget-icon"><span></span></div>
|
26 |
+
<label><?php _e('Choose Icon', 'so-widgets-bundle') ?></label>
|
27 |
+
</div>
|
28 |
+
|
29 |
+
<a class="so-icon-remove" style="display: <?php echo !empty( $value ) ? 'inline-block' : 'none' ?>;"><?php esc_html_e( 'Remove', 'so-widgets-bundle' ) ?></a>
|
30 |
+
|
31 |
+
<div class="clear"></div>
|
32 |
+
|
33 |
+
<div class="siteorigin-widget-icon-selector siteorigin-widget-field-subcontainer">
|
34 |
+
<select class="siteorigin-widget-icon-family" >
|
35 |
+
<?php foreach( $widget_icon_families as $family_id => $family_info ) : ?>
|
36 |
+
<option value="<?php echo esc_attr( $family_id ) ?>"
|
37 |
+
<?php selected( $value_family, $family_id ) ?>
|
38 |
+
<?php if( !empty( $this->icons_callback ) ) echo 'data-icons="' . esc_attr( json_encode( $family_info ) ) . '"' ?>
|
39 |
+
>
|
40 |
+
<?php echo esc_html( $family_info['name'] ) ?> (<?php echo count( $family_info['icons'] ) ?>)
|
41 |
+
</option>
|
42 |
+
<?php endforeach; ?>
|
43 |
+
</select>
|
44 |
+
|
45 |
+
<input type="search" class="siteorigin-widget-icon-search" placeholder="<?php esc_attr_e( 'Search Icons' ) ?>" />
|
46 |
+
|
47 |
+
<input type="hidden" name="<?php echo esc_attr( $this->element_name ) ?>" value="<?php echo esc_attr( $value ) ?>"
|
48 |
+
class="siteorigin-widget-icon-icon siteorigin-widget-input" />
|
49 |
+
|
50 |
+
<div class="siteorigin-widget-icon-icons" style="height: <?php echo ( $this->rows * 54 ) - 3 ?>px;"></div>
|
51 |
+
</div>
|
52 |
+
<?php
|
53 |
+
}
|
54 |
+
|
55 |
+
protected function sanitize_field_input( $value, $instance ) {
|
56 |
+
$sanitized_value = $value;
|
57 |
+
// Alphanumeric characters and hyphens.
|
58 |
+
if( preg_match( '/[\w\d]+[\w\d-]*/', $sanitized_value, $sanitized_matches ) ) {
|
59 |
+
$sanitized_value = $sanitized_matches[0];
|
60 |
+
}
|
61 |
+
else {
|
62 |
+
$sanitized_value = '';
|
63 |
+
}
|
64 |
+
list( $value_family, $value_icon ) = ( ! empty( $sanitized_value ) && strpos( $sanitized_value, '-' ) !== false ) ? explode( '-', $sanitized_value, 2 ) : array('', '');
|
65 |
+
|
66 |
+
$widget_icon_families = $this->get_widget_icon_families();
|
67 |
+
if( ! ( isset( $widget_icon_families[$value_family] ) && isset( $widget_icon_families[$value_family]['icons'][$value_icon] ) ) ) {
|
68 |
+
$sanitized_value = isset( $this->default ) ? $this->default : '';
|
69 |
+
}
|
70 |
+
|
71 |
+
return $sanitized_value;
|
72 |
+
}
|
73 |
+
|
74 |
+
private function get_widget_icon_families(){
|
75 |
+
if( !empty( $this->icons_callback ) ) {
|
76 |
+
// We'll get the icons from the callback function
|
77 |
+
$widget_icon_families = call_user_func( $this->icons_callback );
|
78 |
+
}
|
79 |
+
else {
|
80 |
+
// We'll get icons from the main filter
|
81 |
+
static $widget_icon_families;
|
82 |
+
if( empty( $widget_icon_families ) ) $widget_icon_families = apply_filters('siteorigin_widgets_icon_families', array() );
|
83 |
+
}
|
84 |
+
|
85 |
+
return $widget_icon_families;
|
86 |
+
}
|
87 |
+
|
88 |
+
public function enqueue_scripts(){
|
89 |
+
wp_enqueue_script( 'so-icon-field', plugin_dir_url( __FILE__ ) . 'js/icon-field' . SOW_BUNDLE_JS_SUFFIX . '.js', array( 'jquery' ), SOW_BUNDLE_VERSION );
|
90 |
+
wp_enqueue_style( 'so-icon-field', plugin_dir_url( __FILE__ ) . 'css/icon-field.css', array( ), SOW_BUNDLE_VERSION );
|
91 |
+
}
|
92 |
+
|
93 |
+
}
|
base/inc/fields/js/autocomplete-field.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(
|
1 |
+
!function(d){d(document).on("sowsetupformfield",".siteorigin-widget-field-type-autocomplete",function(e){var l=d(this);if(!l.data("initialized")){var o=function(){var e=l.find("input.siteorigin-widget-input").val();return 0===e.length?[]:e.split(",")},i=function(){var n=o();l.find("ul.items > li").each(function(e,t){var i=d(this);-1<n.indexOf(i.data("value"))?i.addClass("selected"):i.removeClass("selected")})},n=function(){var e=l.find(".content-text-search"),t=e.val(),i=e.data("source"),n=e.data("postTypes"),a={action:"so_widgets_search_"+i};"posts"===i?(a.query=t,a.postTypes=n):"terms"===i&&(a.term=t);var s=l.find("ul.items").empty().addClass("loading");return d.get(soWidgets.ajaxurl,a,function(e){e.forEach(function(e){""===e.label&&(e.label=" "),s.append(d("<li>").html(e.label+"<span>("+e.type+")</span>").data(e))}),s.removeClass("loading")})};l.find(".siteorigin-widget-autocomplete-input").click(function(){var e=l.find(".existing-content-selector");e.show();var t=new d.Deferred;e.is(":visible")&&0===e.find("ul.items li").length?t=n():t.resolve(),t.done(i)});var t=function(){l.find(".existing-content-selector").hide()};d(window).mousedown(function(e){0===l.find(e.target).length&&t()}),l.find(".button-close").click(t),l.on("click",".items li",function(e){e.preventDefault();var t=d(this),i=o(),n=t.data("value"),a=i.indexOf(n);-1<a?(i.splice(a,1),t.removeClass("selected")):(i.push(n),t.addClass("selected"));var s=l.find("input.siteorigin-widget-input");s.val(i.join(",")),s.change()});var a=null;l.find(".content-text-search").keyup(function(){null!==a&&clearTimeout(a),a=setTimeout(function(){n()},500)}),l.data("initialized",!0)}})}(jQuery);
|
base/inc/fields/js/code-field.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
(function(
|
1 |
+
(function(l){"use strict";var a,u=u||(a={},{add:function(e,t){var r;if("object"==typeof e)for(r=0;r<e.length;r++){var n=e[r];a[n]||(a[n]=[]),a[n].push(t)}else a[e]||(a[e]=[]),a[e].push(t)},get:function(e){if(a[e])return a[e]}}),e=e||function(e){"function"!=typeof String.prototype.repeat&&(String.prototype.repeat=function(e){if(e<1)return"";if(e%2)return this.repeat(e-1)+this;var t=this.repeat(e/2);return t+t}),"function"!=typeof Array.prototype.filter&&(Array.prototype.filter=function(e){if(null===this)throw new TypeError;var t=Object(this),r=t.length>>>0;if("function"!=typeof e)throw new TypeError;for(var n=[],a=arguments[1],o=0;o<r;o++)if(o in t){var i=t[o];e.call(a,i,o,t)&&n.push(i)}return n});var g,p,t,c={textarea:null,replaceTab:!0,softTabs:!0,tabSize:4,autoOpen:!0,overwrite:!0,autoStrip:!0,autoIndent:!0,fence:!1},v={keyMap:[{open:'"',close:'"',canBreak:!1},{open:"'",close:"'",canBreak:!1},{open:"(",close:")",canBreak:!1},{open:"[",close:"]",canBreak:!0},{open:"{",close:"}",canBreak:!0}]},h={_callHook:function(e,t){var r=u.get(e);if(t="boolean"!=typeof t||!1!==t,r)if(t){var n,a=c.textarea,o=a.value,i=h.cursor.get();for(n=0;n<r.length;n++)r[n].call(l,{editor:{element:a,text:o,levelsDeep:h.levelsDeep()},caret:{pos:i},lines:{current:h.cursor.getLine(o,i),total:h.editor.getLines(o)}})}else for(n=0;n<r.length;n++)r[n].call(l)},defineNewLine:function(){var e=document.createElement("textarea");e.value="\n",p=2==e.value.length?"\r\n":"\n"},defineTabSize:function(e){void 0===c.textarea.style.OTabSize?void 0===c.textarea.style.MozTabSize?void 0===c.textarea.style.tabSize||(c.textarea.style.tabSize=e):c.textarea.style.MozTabSize=e:c.textarea.style.OTabSize=e},cursor:{getLine:function(e,t){return e.substring(0,t).split("\n").length},get:function(){if("number"==typeof document.createElement("textarea").selectionStart)return c.textarea.selectionStart;if(document.selection){var e=0,t=c.textarea.createTextRange(),r=document.selection.createRange().duplicate().getBookmark();for(t.moveToBookmark(r);0!==t.moveStart("character",-1);)e++;return e}},set:function(e,t){if(t||(t=e),c.textarea.setSelectionRange)c.textarea.focus(),c.textarea.setSelectionRange(e,t);else if(c.textarea.createTextRange){var r=c.textarea.createTextRange();r.collapse(!0),r.moveEnd("character",t),r.moveStart("character",e),r.select()}},selection:function(){var e,t,r,n,a,o=c.textarea,i=0,s=0;return"number"==typeof o.selectionStart&&"number"==typeof o.selectionEnd?(i=o.selectionStart,s=o.selectionEnd):(t=document.selection.createRange())&&t.parentElement()==o&&(n=(e=h.editor.get()).length,(r=o.createTextRange()).moveToBookmark(t.getBookmark()),(a=o.createTextRange()).collapse(!1),-1<r.compareEndPoints("StartToEnd",a)?i=s=n:(i=-r.moveStart("character",-n),i+=e.slice(0,i).split(p).length-1,-1<r.compareEndPoints("EndToEnd",a)?s=n:(s=-r.moveEnd("character",-n),s+=e.slice(0,s).split(p).length-1))),i!=s&&{start:i,end:s}}},editor:{getLines:function(e){return e.split("\n").length},get:function(){return c.textarea.value.replace(/\r/g,"")},set:function(e){c.textarea.value=e}},fenceRange:function(){if("string"!=typeof c.fence)return!0;for(var e=h.editor.get(),t=h.cursor.get(),r=0,n=e.indexOf(c.fence),a=0;0<=n&&(a++,!(t<n+r));)r+=n+c.fence.length,n=(e=e.substring(n+c.fence.length)).indexOf(c.fence);return r<t&&t<n+r&&a%2==0},isEven:function(e,t){return t%2},levelsDeep:function(){var e,t,r=h.cursor.get(),n=h.editor.get().substring(0,r),a=0;for(e=0;e<n.length;e++)for(t=0;t<v.keyMap.length;t++)v.keyMap[t].canBreak&&(v.keyMap[t].open==n.charAt(e)&&a++,v.keyMap[t].close==n.charAt(e)&&a--);var o=0,i=["'",'"'];for(e=0;e<v.keyMap.length;e++)if(v.keyMap[e].canBreak)for(t in i)o+=n.split(i[t]).filter(h.isEven).join("").split(v.keyMap[e].open).length-1;var s=a-o;return 0<=s?s:0},deepExtend:function(e,t){for(var r in t)t[r]&&t[r].constructor&&t[r].constructor===Object?(e[r]=e[r]||{},h.deepExtend(e[r],t[r])):e[r]=t[r];return e},addEvent:function(e,t,r){e.addEventListener?e.addEventListener(t,r,!1):e.attachEvent&&e.attachEvent("on"+t,r)},removeEvent:function(e,t,r){e.addEventListener?e.removeEventListener(t,r,!1):e.attachEvent&&e.detachEvent("on"+t,r)},preventDefaultEvent:function(e){e.preventDefault?e.preventDefault():e.returnValue=!1}},r=function(e){if(h.fenceRange()){if(9==e.keyCode){h.preventDefaultEvent(e);var t=!0;h._callHook("tab:before");var r=h.cursor.selection(),n=h.cursor.get(),a=h.editor.get();if(r){for(var o=r.start;o--;)if("\n"==a.charAt(o)){r.start=o+1;break}var i,s=a.substring(r.start,r.end),c=s.split("\n");if(e.shiftKey){for(i=0;i<c.length;i++)c[i].substring(0,g.length)==g&&(c[i]=c[i].substring(g.length));s=c.join("\n"),h.editor.set(a.substring(0,r.start)+s+a.substring(r.end)),h.cursor.set(r.start,r.start+s.length)}else{for(i in c)c[i]=g+c[i];s=c.join("\n"),h.editor.set(a.substring(0,r.start)+s+a.substring(r.end)),h.cursor.set(r.start,r.start+s.length)}}else{var l=a.substring(0,n),u=a.substring(n),f=l+g+u;e.shiftKey?a.substring(n-g.length,n)==g&&(f=a.substring(0,n-g.length)+u,h.editor.set(f),h.cursor.set(n-g.length)):(h.editor.set(f),h.cursor.set(n+g.length),t=!1)}h._callHook("tab:after")}return t}},n=function(e){if(h.fenceRange()&&13==e.keyCode){h.preventDefaultEvent(e),h._callHook("enter:before");var t,r,n=h.cursor.get(),a=h.editor.get(),o=a.substring(0,n),i=a.substring(n),s=o.charAt(o.length-1),c=i.charAt(0),l=h.levelsDeep(),u="",f="";if(l){for(;l--;)u+=g;for(t=(u=u).length+1,r=0;r<v.keyMap.length;r++)v.keyMap[r].open==s&&v.keyMap[r].close==c&&(f=p)}else t=1;var d=o+p+u+f+u.substring(0,u.length-g.length)+i;h.editor.set(d),h.cursor.set(n+t),h._callHook("enter:after")}},a=function(e){if(h.fenceRange()&&8==e.keyCode){h.preventDefaultEvent(e),h._callHook("delete:before");var t,r=h.cursor.get(),n=h.editor.get(),a=n.substring(0,r),o=n.substring(r),i=a.charAt(a.length-1),s=o.charAt(0);if(!1===h.cursor.selection()){for(t=0;t<v.keyMap.length;t++)if(v.keyMap[t].open==i&&v.keyMap[t].close==s){var c=n.substring(0,r-1)+n.substring(r+1);return h.editor.set(c),void h.cursor.set(r-1)}c=n.substring(0,r-1)+n.substring(r);h.editor.set(c),h.cursor.set(r-1)}else{var l=h.cursor.selection();c=n.substring(0,l.start)+n.substring(l.end);h.editor.set(c),h.cursor.set(r)}h._callHook("delete:after")}},o=function(e,t){h.preventDefaultEvent(t),h._callHook("openChar:before");var r=h.cursor.get(),n=h.editor.get(),a=n.substring(0,r),o=n.substring(r),i=a+e.open+e.close+o;c.textarea.value=i,h.cursor.set(r+1),h._callHook("openChar:after")},i=function(e,t){var r=h.cursor.get();return h.editor.get().substring(r,r+1)==e.close&&(h.preventDefaultEvent(t),h._callHook("closeChar:before"),h.cursor.set(h.cursor.get()+1),h._callHook("closeChar:after"),!0)},s={filter:function(e){if(h.fenceRange()){var t=e.which||e.keyCode;if(39!=t&&(40!=t||0!==e.which)){var r,n=String.fromCharCode(t);for(r=0;r<v.keyMap.length;r++){if(v.keyMap[r].close==n)!(c.overwrite&&i(v.keyMap[r],e))&&v.keyMap[r].open==n&&c.autoOpen&&o(v.keyMap[r],e);else v.keyMap[r].open==n&&c.autoOpen&&o(v.keyMap[r],e)}}}},listen:function(){c.replaceTab&&h.addEvent(c.textarea,"keydown",r),c.autoIndent&&h.addEvent(c.textarea,"keydown",n),c.autoStrip&&h.addEvent(c.textarea,"keydown",a),h.addEvent(c.textarea,"keypress",s.filter),h.addEvent(c.textarea,"keydown",function(){h._callHook("keydown")}),h.addEvent(c.textarea,"keyup",function(){h._callHook("keyup")})}};this.destroy=function(){h.removeEvent(c.textarea,"keydown",r),h.removeEvent(c.textarea,"keydown",n),h.removeEvent(c.textarea,"keydown",a),h.removeEvent(c.textarea,"keypress",s.filter)},(t=e).textarea&&(h._callHook("init:before",!1),h.deepExtend(c,t),h.defineNewLine(),c.softTabs?g=" ".repeat(c.tabSize):(g="\t",h.defineTabSize(c.tabSize)),s.listen(),h._callHook("init:after",!1))};"undefined"!=typeof module&&module.exports&&(module.exports=e),"undefined"==typeof ender&&(this.Behave=e,this.BehaveHooks=u),"function"==typeof define&&define.amd&&define("behave",[],function(){return e})}).call(this),function(r){r(document).on("sowsetupformfield",".siteorigin-widget-field-type-code",function(e){var t=r(this);new Behave({textarea:t.find(".siteorigin-widget-code-input").get(0)})})}(jQuery);
|
base/inc/fields/js/date-range-field.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(
|
1 |
+
!function(r){r(document).on("sowsetupformfield",".siteorigin-widget-field-type-date-range",function(e){var s=r(this),f=s.find('input[type="hidden"][class="siteorigin-widget-input"]');if(!s.data("initialized")){if(0<s.find('[class*="sowb-specific-date"]').length){var t=function(i,e){var a=s.find("."+i+"-picker"),n=function(e,t){if(isNaN(e.valueOf()))return"";var i=e.getDate();i=i<10?"0"+i.toString():i.toString();var a=e.getMonth()+1;return a=a<10?"0"+a.toString():a.toString(),e.getFullYear()+"-"+a+"-"+i},r=function(e,t){var i=e.split("-"),a=parseInt(i[2]),n=parseInt(i[1])-1,r=parseInt(i[0]);return new Date(r,n,a)},l=function(e){var t=""===f.val()?{}:JSON.parse(f.val());t[i]=n(e),a.val(t[i]),f.val(JSON.stringify(t)),f.trigger("change",{silent:!0})},t=new Pikaday({field:a[0],blurFieldOnSelect:!1,toString:n,parse:r,onSelect:l});return a.change(function(e){var t=r(a.val());return l(t),e.preventDefault(),!1}),e&&a.val(e),t}.bind(this),i=""===f.val()?{after:"",before:""}:JSON.parse(f.val()),a=t("after",i.after),n=t("before",i.before);f.change(function(e,t){if(!t||!t.silent){var i=""===f.val()?{after:"",before:""}:JSON.parse(f.val());a.setDate(i.after),n.setDate(i.before)}})}else 0<s.find(".sowb-relative-date").length&&s.find(".sowb-relative-date").each(function(){var a=r(this).data("name");r(this).change(function(){var e=""===f.val()?{}:JSON.parse(f.val());e.hasOwnProperty(a)||(e[a]={}),e[a].value=r(this).find("> input").val(),e[a].unit=r(this).find("> select").val(),f.val(JSON.stringify(e)),f.trigger("change",{silent:!0})}.bind(this)),f.change(function(e,t){if(!t||!t.silent){var i=""===f.val()?{from:{},to:{}}:JSON.parse(f.val());i.hasOwnProperty(a)&&(r(this).find("> input").val(i[a].value),r(this).find("> select").val(i[a].unit))}}.bind(this))});s.data("initialized",!0)}})}(jQuery);
|
base/inc/fields/js/icon-field.js
CHANGED
@@ -1,183 +1,183 @@
|
|
1 |
-
/* global jQuery, soWidgets */
|
2 |
-
|
3 |
-
( function( $ ) {
|
4 |
-
|
5 |
-
var iconWidgetCache = {};
|
6 |
-
|
7 |
-
$(document).on( 'sowsetupformfield', '.siteorigin-widget-field-type-icon', function(e) {
|
8 |
-
var $$ = $(this),
|
9 |
-
$is = $$.find('.siteorigin-widget-icon-selector'),
|
10 |
-
$v = $is.find('.siteorigin-widget-icon-icon'),
|
11 |
-
$b = $$.find('.siteorigin-widget-icon-selector-current'),
|
12 |
-
$remove = $$.find( '.so-icon-remove' ),
|
13 |
-
$search = $$.find( '.siteorigin-widget-icon-search' );
|
14 |
-
|
15 |
-
if ( $$.data( 'initialized' ) ) {
|
16 |
-
return;
|
17 |
-
}
|
18 |
-
|
19 |
-
// Clicking on the button should display the icon selector
|
20 |
-
$b.click( function(){
|
21 |
-
$is.slideToggle();
|
22 |
-
$search.val( '' );
|
23 |
-
searchIcons();
|
24 |
-
} );
|
25 |
-
|
26 |
-
// Clicking on the remove button
|
27 |
-
$remove.click( function( e ){
|
28 |
-
e.preventDefault();
|
29 |
-
|
30 |
-
// Trigger a click on the existing icon to remove it.
|
31 |
-
$$.find('.siteorigin-widget-active').click();
|
32 |
-
} );
|
33 |
-
|
34 |
-
var searchIcons = function(){
|
35 |
-
var q = $search.val().toLowerCase();
|
36 |
-
if( q === '' ) {
|
37 |
-
$is.find('.siteorigin-widget-icon-icons-icon').show();
|
38 |
-
}
|
39 |
-
else {
|
40 |
-
$is.find('.siteorigin-widget-icon-icons-icon').each( function(){
|
41 |
-
var $$ = $( this ),
|
42 |
-
value = $$.attr( 'data-value' );
|
43 |
-
|
44 |
-
value = value.replace( /-/, ' ' );
|
45 |
-
if( value.indexOf( q ) === -1 ) {
|
46 |
-
$$.hide();
|
47 |
-
}
|
48 |
-
else {
|
49 |
-
$$.show();
|
50 |
-
}
|
51 |
-
} );
|
52 |
-
}
|
53 |
-
};
|
54 |
-
|
55 |
-
$search.keyup( searchIcons ).change( searchIcons );
|
56 |
-
|
57 |
-
var rerenderIcons = function() {
|
58 |
-
var family = $is.find('select.siteorigin-widget-icon-family').val();
|
59 |
-
var container = $is.find('.siteorigin-widget-icon-icons');
|
60 |
-
|
61 |
-
if(typeof iconWidgetCache[family] === 'undefined') {
|
62 |
-
return;
|
63 |
-
}
|
64 |
-
|
65 |
-
container.empty();
|
66 |
-
|
67 |
-
if( $('#'+'siteorigin-widget-font-'+family).length === 0) {
|
68 |
-
|
69 |
-
$("<link rel='stylesheet' type='text/css'>")
|
70 |
-
.attr('id', 'siteorigin-widget-font-' + family)
|
71 |
-
.attr('href', iconWidgetCache[family].style_uri)
|
72 |
-
.appendTo('head');
|
73 |
-
}
|
74 |
-
|
75 |
-
for ( var i in iconWidgetCache[family].icons ) {
|
76 |
-
|
77 |
-
var icon = $('<div data-sow-icon="' + iconWidgetCache[family].icons[i] + '"/>')
|
78 |
-
.attr('data-value', family + '-' + i)
|
79 |
-
.addClass( 'sow-icon-' + family )
|
80 |
-
.addClass( 'siteorigin-widget-icon-icons-icon' )
|
81 |
-
.click(function(){
|
82 |
-
var $$ = $(this);
|
83 |
-
|
84 |
-
if( $$.hasClass('siteorigin-widget-active') ) {
|
85 |
-
// This is being unselected
|
86 |
-
$$.removeClass('siteorigin-widget-active');
|
87 |
-
$v.val( '' );
|
88 |
-
|
89 |
-
// Hide the button icon
|
90 |
-
$b.find('span').hide();
|
91 |
-
|
92 |
-
$remove.hide();
|
93 |
-
}
|
94 |
-
else {
|
95 |
-
// This is being selected
|
96 |
-
container.find('.siteorigin-widget-icon-icons-icon').removeClass('siteorigin-widget-active');
|
97 |
-
$$.addClass('siteorigin-widget-active');
|
98 |
-
$v.val( $$.data('value') );
|
99 |
-
|
100 |
-
// Also add this to the button
|
101 |
-
$b.find('span')
|
102 |
-
.show()
|
103 |
-
.attr( 'data-sow-icon', $$.attr('data-sow-icon') )
|
104 |
-
.attr( 'class', '' )
|
105 |
-
.addClass( 'sow-icon-' + family );
|
106 |
-
|
107 |
-
$remove.show();
|
108 |
-
}
|
109 |
-
|
110 |
-
$v.trigger( 'change', { isRendering: true });
|
111 |
-
|
112 |
-
// Hide the icon selector
|
113 |
-
$is.slideUp();
|
114 |
-
});
|
115 |
-
|
116 |
-
container.append(icon);
|
117 |
-
|
118 |
-
if( $v.val() === family + '-' + i ) {
|
119 |
-
// Add selected icon to the button.
|
120 |
-
$b.find('span')
|
121 |
-
.show()
|
122 |
-
.attr( 'data-sow-icon', icon.attr('data-sow-icon') )
|
123 |
-
.attr( 'class', '' )
|
124 |
-
.addClass( 'sow-icon-' + family );
|
125 |
-
icon.addClass('siteorigin-widget-active');
|
126 |
-
}
|
127 |
-
}
|
128 |
-
|
129 |
-
// Move a selected item to the first position
|
130 |
-
container.prepend( container.find('.siteorigin-widget-active') );
|
131 |
-
|
132 |
-
searchIcons();
|
133 |
-
};
|
134 |
-
|
135 |
-
// Create the function for changing the icon family and call it once
|
136 |
-
var changeIconFamily = function(){
|
137 |
-
// Fetch the family icons from the server
|
138 |
-
var family = $is.find('select.siteorigin-widget-icon-family').val();
|
139 |
-
|
140 |
-
var dataIcons = $is.find('select.siteorigin-widget-icon-family option:selected' ).data('icons');
|
141 |
-
if( dataIcons !== null ) {
|
142 |
-
iconWidgetCache[family] = dataIcons;
|
143 |
-
}
|
144 |
-
|
145 |
-
|
146 |
-
if(typeof family === 'undefined' || family === '') {
|
147 |
-
return;
|
148 |
-
}
|
149 |
-
|
150 |
-
if(typeof iconWidgetCache[family] === 'undefined') {
|
151 |
-
$.getJSON(
|
152 |
-
soWidgets.ajaxurl,
|
153 |
-
{
|
154 |
-
'action' : 'siteorigin_widgets_get_icons',
|
155 |
-
'family' : $is.find('select.siteorigin-widget-icon-family').val()
|
156 |
-
},
|
157 |
-
function(data) {
|
158 |
-
iconWidgetCache[family] = data;
|
159 |
-
rerenderIcons();
|
160 |
-
}
|
161 |
-
);
|
162 |
-
}
|
163 |
-
else {
|
164 |
-
rerenderIcons();
|
165 |
-
}
|
166 |
-
};
|
167 |
-
changeIconFamily();
|
168 |
-
|
169 |
-
$is.find('select.siteorigin-widget-icon-family').change(function(){
|
170 |
-
$is.find('.siteorigin-widget-icon-icons').empty();
|
171 |
-
changeIconFamily();
|
172 |
-
});
|
173 |
-
|
174 |
-
$v.change( function ( event, data ) {
|
175 |
-
if ( ! ( data && data.isRendering ) ) {
|
176 |
-
rerenderIcons();
|
177 |
-
}
|
178 |
-
} );
|
179 |
-
|
180 |
-
$$.data( 'initialized', true );
|
181 |
-
} );
|
182 |
-
|
183 |
-
} )( jQuery );
|
1 |
+
/* global jQuery, soWidgets */
|
2 |
+
|
3 |
+
( function( $ ) {
|
4 |
+
|
5 |
+
var iconWidgetCache = {};
|
6 |
+
|
7 |
+
$(document).on( 'sowsetupformfield', '.siteorigin-widget-field-type-icon', function(e) {
|
8 |
+
var $$ = $(this),
|
9 |
+
$is = $$.find('.siteorigin-widget-icon-selector'),
|
10 |
+
$v = $is.find('.siteorigin-widget-icon-icon'),
|
11 |
+
$b = $$.find('.siteorigin-widget-icon-selector-current'),
|
12 |
+
$remove = $$.find( '.so-icon-remove' ),
|
13 |
+
$search = $$.find( '.siteorigin-widget-icon-search' );
|
14 |
+
|
15 |
+
if ( $$.data( 'initialized' ) ) {
|
16 |
+
return;
|
17 |
+
}
|
18 |
+
|
19 |
+
// Clicking on the button should display the icon selector
|
20 |
+
$b.click( function(){
|
21 |
+
$is.slideToggle();
|
22 |
+
$search.val( '' );
|
23 |
+
searchIcons();
|
24 |
+
} );
|
25 |
+
|
26 |
+
// Clicking on the remove button
|
27 |
+
$remove.click( function( e ){
|
28 |
+
e.preventDefault();
|
29 |
+
|
30 |
+
// Trigger a click on the existing icon to remove it.
|
31 |
+
$$.find('.siteorigin-widget-active').click();
|
32 |
+
} );
|
33 |
+
|
34 |
+
var searchIcons = function(){
|
35 |
+
var q = $search.val().toLowerCase();
|
36 |
+
if( q === '' ) {
|
37 |
+
$is.find('.siteorigin-widget-icon-icons-icon').show();
|
38 |
+
}
|
39 |
+
else {
|
40 |
+
$is.find('.siteorigin-widget-icon-icons-icon').each( function(){
|
41 |
+
var $$ = $( this ),
|
42 |
+
value = $$.attr( 'data-value' );
|
43 |
+
|
44 |
+
value = value.replace( /-/, ' ' );
|
45 |
+
if( value.indexOf( q ) === -1 ) {
|
46 |
+
$$.hide();
|
47 |
+
}
|
48 |
+
else {
|
49 |
+
$$.show();
|
50 |
+
}
|
51 |
+
} );
|
52 |
+
}
|
53 |
+
};
|
54 |
+
|
55 |
+
$search.keyup( searchIcons ).change( searchIcons );
|
56 |
+
|
57 |
+
var rerenderIcons = function() {
|
58 |
+
var family = $is.find('select.siteorigin-widget-icon-family').val();
|
59 |
+
var container = $is.find('.siteorigin-widget-icon-icons');
|
60 |
+
|
61 |
+
if(typeof iconWidgetCache[family] === 'undefined') {
|
62 |
+
return;
|
63 |
+
}
|
64 |
+
|
65 |
+
container.empty();
|
66 |
+
|
67 |
+
if( $('#'+'siteorigin-widget-font-'+family).length === 0) {
|
68 |
+
|
69 |
+
$("<link rel='stylesheet' type='text/css'>")
|
70 |
+
.attr('id', 'siteorigin-widget-font-' + family)
|
71 |
+
.attr('href', iconWidgetCache[family].style_uri)
|
72 |
+
.appendTo('head');
|
73 |
+
}
|
74 |
+
|
75 |
+
for ( var i in iconWidgetCache[family].icons ) {
|
76 |
+
|
77 |
+
var icon = $('<div data-sow-icon="' + iconWidgetCache[family].icons[i] + '"/>')
|
78 |
+
.attr('data-value', family + '-' + i)
|
79 |
+
.addClass( 'sow-icon-' + family )
|
80 |
+
.addClass( 'siteorigin-widget-icon-icons-icon' )
|
81 |
+
.click(function(){
|
82 |
+
var $$ = $(this);
|
83 |
+
|
84 |
+
if( $$.hasClass('siteorigin-widget-active') ) {
|
85 |
+
// This is being unselected
|
86 |
+
$$.removeClass('siteorigin-widget-active');
|
87 |
+
$v.val( '' );
|
88 |
+
|
89 |
+
// Hide the button icon
|
90 |
+
$b.find('span').hide();
|
91 |
+
|
92 |
+
$remove.hide();
|
93 |
+
}
|
94 |
+
else {
|
95 |
+
// This is being selected
|
96 |
+
container.find('.siteorigin-widget-icon-icons-icon').removeClass('siteorigin-widget-active');
|
97 |
+
$$.addClass('siteorigin-widget-active');
|
98 |
+
$v.val( $$.data('value') );
|
99 |
+
|
100 |
+
// Also add this to the button
|
101 |
+
$b.find('span')
|
102 |
+
.show()
|
103 |
+
.attr( 'data-sow-icon', $$.attr('data-sow-icon') )
|
104 |
+
.attr( 'class', '' )
|
105 |
+
.addClass( 'sow-icon-' + family );
|
106 |
+
|
107 |
+
$remove.show();
|
108 |
+
}
|
109 |
+
|
110 |
+
$v.trigger( 'change', { isRendering: true });
|
111 |
+
|
112 |
+
// Hide the icon selector
|
113 |
+
$is.slideUp();
|
114 |
+
});
|
115 |
+
|
116 |
+
container.append(icon);
|
117 |
+
|
118 |
+
if( $v.val() === family + '-' + i ) {
|
119 |
+
// Add selected icon to the button.
|
120 |
+
$b.find('span')
|
121 |
+
.show()
|
122 |
+
.attr( 'data-sow-icon', icon.attr('data-sow-icon') )
|
123 |
+
.attr( 'class', '' )
|
124 |
+
.addClass( 'sow-icon-' + family );
|
125 |
+
icon.addClass('siteorigin-widget-active');
|
126 |
+
}
|
127 |
+
}
|
128 |
+
|
129 |
+
// Move a selected item to the first position
|
130 |
+
container.prepend( container.find('.siteorigin-widget-active') );
|
131 |
+
|
132 |
+
searchIcons();
|
133 |
+
};
|
134 |
+
|
135 |
+
// Create the function for changing the icon family and call it once
|
136 |
+
var changeIconFamily = function(){
|
137 |
+
// Fetch the family icons from the server
|
138 |
+
var family = $is.find('select.siteorigin-widget-icon-family').val();
|
139 |
+
|
140 |
+
var dataIcons = $is.find('select.siteorigin-widget-icon-family option:selected' ).data('icons');
|
141 |
+
if( dataIcons !== null ) {
|
142 |
+
iconWidgetCache[family] = dataIcons;
|
143 |
+
}
|
144 |
+
|
145 |
+
|
146 |
+
if(typeof family === 'undefined' || family === '') {
|
147 |
+
return;
|
148 |
+
}
|
149 |
+
|
150 |
+
if(typeof iconWidgetCache[family] === 'undefined') {
|
151 |
+
$.getJSON(
|
152 |
+
soWidgets.ajaxurl,
|
153 |
+
{
|
154 |
+
'action' : 'siteorigin_widgets_get_icons',
|
155 |
+
'family' : $is.find('select.siteorigin-widget-icon-family').val()
|
156 |
+
},
|
157 |
+
function(data) {
|
158 |
+
iconWidgetCache[family] = data;
|
159 |
+
rerenderIcons();
|
160 |
+
}
|
161 |
+
);
|
162 |
+
}
|
163 |
+
else {
|
164 |
+
rerenderIcons();
|
165 |
+
}
|
166 |
+
};
|
167 |
+
changeIconFamily();
|
168 |
+
|
169 |
+
$is.find('select.siteorigin-widget-icon-family').change(function(){
|
170 |
+
$is.find('.siteorigin-widget-icon-icons').empty();
|
171 |
+
changeIconFamily();
|
172 |
+
});
|
173 |
+
|
174 |
+
$v.change( function ( event, data ) {
|
175 |
+
if ( ! ( data && data.isRendering ) ) {
|
176 |
+
rerenderIcons();
|
177 |
+
}
|
178 |
+
} );
|
179 |
+
|
180 |
+
$$.data( 'initialized', true );
|
181 |
+
} );
|
182 |
+
|
183 |
+
} )( jQuery );
|
base/inc/fields/js/icon-field.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(
|
1 |
+
!function(g){var l={};g(document).on("sowsetupformfield",".siteorigin-widget-field-type-icon",function(i){var e=g(this),o=e.find(".siteorigin-widget-icon-selector"),a=o.find(".siteorigin-widget-icon-icon"),s=e.find(".siteorigin-widget-icon-selector-current"),d=e.find(".so-icon-remove"),t=e.find(".siteorigin-widget-icon-search");if(!e.data("initialized")){s.click(function(){o.slideToggle(),t.val(""),c()}),d.click(function(i){i.preventDefault(),e.find(".siteorigin-widget-active").click()});var c=function(){var n=t.val().toLowerCase();""===n?o.find(".siteorigin-widget-icon-icons-icon").show():o.find(".siteorigin-widget-icon-icons-icon").each(function(){var i=g(this),e=i.attr("data-value");-1===(e=e.replace(/-/," ")).indexOf(n)?i.hide():i.show()})};t.keyup(c).change(c);var n=function(){var e=o.find("select.siteorigin-widget-icon-family").val(),n=o.find(".siteorigin-widget-icon-icons");if(void 0!==l[e]){for(var i in n.empty(),0===g("#siteorigin-widget-font-"+e).length&&g("<link rel='stylesheet' type='text/css'>").attr("id","siteorigin-widget-font-"+e).attr("href",l[e].style_uri).appendTo("head"),l[e].icons){var t=g('<div data-sow-icon="'+l[e].icons[i]+'"/>').attr("data-value",e+"-"+i).addClass("sow-icon-"+e).addClass("siteorigin-widget-icon-icons-icon").click(function(){var i=g(this);i.hasClass("siteorigin-widget-active")?(i.removeClass("siteorigin-widget-active"),a.val(""),s.find("span").hide(),d.hide()):(n.find(".siteorigin-widget-icon-icons-icon").removeClass("siteorigin-widget-active"),i.addClass("siteorigin-widget-active"),a.val(i.data("value")),s.find("span").show().attr("data-sow-icon",i.attr("data-sow-icon")).attr("class","").addClass("sow-icon-"+e),d.show()),a.trigger("change",{isRendering:!0}),o.slideUp()});n.append(t),a.val()===e+"-"+i&&(s.find("span").show().attr("data-sow-icon",t.attr("data-sow-icon")).attr("class","").addClass("sow-icon-"+e),t.addClass("siteorigin-widget-active"))}n.prepend(n.find(".siteorigin-widget-active")),c()}},r=function(){var e=o.find("select.siteorigin-widget-icon-family").val(),i=o.find("select.siteorigin-widget-icon-family option:selected").data("icons");null!==i&&(l[e]=i),void 0!==e&&""!==e&&(void 0===l[e]?g.getJSON(soWidgets.ajaxurl,{action:"siteorigin_widgets_get_icons",family:o.find("select.siteorigin-widget-icon-family").val()},function(i){l[e]=i,n()}):n())};r(),o.find("select.siteorigin-widget-icon-family").change(function(){o.find(".siteorigin-widget-icon-icons").empty(),r()}),a.change(function(i,e){e&&e.isRendering||n()}),e.data("initialized",!0)}})}(jQuery);
|
base/inc/fields/js/media-field.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(
|
1 |
+
!function(f){f(document).on("sowsetupformfield",".siteorigin-widget-field-type-media",function(e){var n=f(this),t=n.find("> .media-field-wrapper"),r=n.find(".siteorigin-widget-input").not(".media-fallback-external");if(!t.data("initialized")){var u;t.find(".media-upload-button").click(function(e){if(e.preventDefault(),void 0!==wp.media){var t=f(this),i=f(this).data("frame");if(i)return i.open(),!1;i=wp.media({title:t.data("choose"),library:{type:t.data("library").split(",").map(function(e){return e.trim()})},button:{text:t.data("update"),close:!1}}),t.data("frame",i),i.on("select",function(){var e=i.state().get("selection").first().attributes;n.find(".current .title").html(e.title),r.val(e.id),r.trigger("change",{silent:!0});var t=n.find(".current .thumbnail");void 0!==e.sizes?void 0!==e.sizes.thumbnail?t.attr("src",e.sizes.thumbnail.url).fadeIn():t.attr("src",e.sizes.full.url).fadeIn():t.attr("src",e.icon).fadeIn(),n.find(".media-remove-button").removeClass("remove-hide"),i.close()}),i.open()}}),t.find(".current").mouseenter(function(){var e=f(this).find(".title");""!==e.html()&&e.fadeIn("fast")}).mouseleave(function(){f(this).find(".title").clearQueue().fadeOut("fast")}),n.find("a.media-remove-button").click(function(e){e.preventDefault(),n.find(".current .title").html(""),r.val(""),r.trigger("change",{silent:!0}),n.find(".current .thumbnail").fadeOut("fast"),f(this).addClass("remove-hide")});var s=function(){if(u){var e=u.find(".so-widgets-image-results");if(0!==e.length){var t=e.width(),i=Math.floor(t/276),a=(t-276*i)/i+260;e.find(".so-widgets-result-image").css({width:a,height:a/1.4})}}};f(window).resize(s);t.find(".find-image-button").click(function(e){e.preventDefault(),function(){if(!u){(u=f(f("#so-widgets-bundle-tpl-image-search-dialog").html().trim()).appendTo("body")).find(".close").click(function(){u.hide()});var e,a=u.find(".so-widgets-image-results"),i=function(t,i){u.find(".so-widgets-results-loading").fadeIn("fast"),u.find(".so-widgets-results-loading strong").html(u.find(".so-widgets-results-loading strong").data("loading")),u.find(".so-widgets-results-more").hide(),f.get(ajaxurl,{action:"so_widgets_image_search",q:t,page:i,_sononce:u.find('input[name="_sononce"]').val()},function(e){e.error?alert(e.message):(a.removeClass("so-loading"),f.each(e.items,function(e,t){var i=f(f("#so-widgets-bundle-tpl-image-search-result").html().trim()).appendTo(a).addClass("source-"+t.source).find(".so-widgets-result-image");i.css("background-image","url("+t.thumbnail+")"),i.data("thumbnail",t.thumbnail),i.data("preview",t.preview),t.url&&i.attr({href:t.url,target:"_blank"}),t.full_url&&(i.data({full_url:t.full_url,import_signature:t.import_signature}),i.attr("href",t.full_url)),"shutterstock"===t.source&&i.append(f("#so-widgets-bundle-tpl-image-search-result-sponsored").html())}),1===i&&(u.find("#so-widgets-image-search-suggestions ul").empty(),f.each(e.keywords,function(e,t){u.find("#so-widgets-image-search-suggestions").show(),u.find("#so-widgets-image-search-suggestions ul").append(f("<li></li>").append(f('<a href="#"></a>').html(t).data("keyword",t)))})),u.find(".so-widgets-results-loading").fadeOut("fast"),s(),u.find(".so-widgets-results-more").show().find("button").data({query:t,page:i+1}))})};u.find("#so-widgets-image-search-form").submit(function(e){e.preventDefault();var t=u.find(".so-widgets-search-input").val();a.empty(),""!==t&&i(t,1)}),u.on("click",".so-keywords-list a",function(e){e.preventDefault();var t=f(this).blur();u.find(".so-widgets-search-input").val(t.data("keyword")),u.find("#so-widgets-image-search-form").submit()}),u.find(".so-widgets-results-more button").click(function(){var e=f(this);i(e.data("query"),e.data("page"))}),u.on("click",".so-widgets-result-image",function(e){var t=f(this);if(t.data("full_url")&&(e.preventDefault(),confirm(u.data("confirm-import")))){u.addClass("so-widgets-importing");var i=f("#post_ID").val();null===i&&(i=""),f.get(ajaxurl,{action:"so_widgets_image_import",full_url:t.data("full_url"),import_signature:t.data("import_signature"),post_id:i,_sononce:u.find('input[name="_sononce"]').val()},function(e){u.find("#so-widgets-image-search-frame").removeClass("so-widgets-importing"),!1===e.error?(u.hide(),u.find(".so-widgets-results-loading").hide(),r.val(e.attachment_id).trigger("change",{silent:!0}),n.find(".current .thumbnail").attr("src",e.thumb).fadeIn(),n.find(".media-remove-button").removeClass("remove-hide")):(alert(e.message),u.find(".so-widgets-results-loading").hide())}),u.find(".so-widgets-results-loading").fadeIn("fast"),u.find(".so-widgets-results-loading strong").html(u.find(".so-widgets-results-loading strong").data("importing")),u.find(".so-widgets-results-more").hide(),u.find("#so-widgets-image-search-frame").addClass("so-widgets-importing")}});var o,d,l=u.find(".so-widgets-preview-window");u.on("mouseenter",".so-widgets-result-image",function(){var a=f(this),s=a.data("preview");clearTimeout(e),e=setTimeout(function(){var e=1,t=1;s[1]>.33*f(window).outerWidth()&&(e=.33*f(window).outerWidth()/s[1]),s[2]>.5*f(window).outerHeight()&&(t=.5*f(window).outerHeight()/s[2]);var i=Math.min(e,t);1<i&&(i=1),l.show().find(".so-widgets-preview-window-inside").css({"background-image":"url("+a.data("thumbnail")+")",width:s[1]*i,height:s[2]*i}).append(f("<img />").attr("src",s[0])),u.trigger("mousemove")},1e3)}).on("mouseleave",".so-widgets-result-image",function(){l.hide().find("img").remove(),clearTimeout(e)}),u.on("mousemove",function(e){if(e.clientX&&(o=e.clientX),e.clientY&&(d=e.clientY),l.is(":visible")){var t=l.outerHeight(),i=l.outerWidth(),a=f(window).outerHeight(),s=f(window).outerWidth(),n=d-t/2;n=Math.max(n,10),n=Math.min(n,a-10-t);var r=o<s/2?o+15:o-15-i;l.css({top:n,left:r})}})}u.show(),u.find(".so-widgets-search-input").focus()}()}),r.change(function(e,t){if(!t||!t.silent){var i=r.val();if(i){var a=n.find(".current .thumbnail"),s=wp.media.attachment(i);s.fetch().done(function(){if(s.has("sizes")){var e=s.get("sizes");void 0!==e.thumbnail?a.attr("src",e.thumbnail.url).fadeIn():a.attr("src",e.full.url).fadeIn()}else a.attr("src",s.get("icon")).fadeIn();n.find(".media-remove-button").removeClass("remove-hide")})}else n.find("a.media-remove-button").click()}}),t.data("initialized",!0)}})}(jQuery);
|
base/inc/fields/js/multi-measurement-field.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(
|
1 |
+
!function(r){r(document).on("sowsetupformfield",".siteorigin-widget-field-type-multi-measurement",function(t){var n=r(this).find('input[type="hidden"][class="siteorigin-widget-input"]'),a=n.data("separator"),i=n.data("autofill"),l=""===n.val()?[]:n.val().split(a),u=r(this).find(".sow-multi-measurement-input"),e=r(this).find(".sow-multi-measurement-input-container"),s=function(t){var i=""===n.val()?[]:n.val().split(a),e=t.find("+ .sow-multi-measurement-select-unit");i[u.index(t)]=t.val()+(""===t.val()?"":e.val()),n.val(i.join(a))};u.each(function(t,i){if(l.length>t){var e=l[t].match(/(\d+\.?\d*)([a-z%]+)*/);if(e&&e.length){var n=e[1],a=e[2];r(i).val(n),r(i).find("+ .sow-multi-measurement-select-unit").val(a)}}else s(r(i))}),e.change(function(t){var e=r(t.currentTarget).find("> .sow-multi-measurement-input"),n=i;i&&u.each(function(t,i){r(i).attr("id")!==e.eq(0).attr("id")&&(n=n&&!r(i).val())}),n?u.each(function(t,i){r(i).val(e.val()),s(r(i))}):s(e)})})}(jQuery);
|
base/inc/fields/js/order-field.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(
|
1 |
+
!function(t){t(document).on("sowsetupform",function(i){t(i.target).find(".siteorigin-widget-field-type-order").each(function(){var o=t(this),d=o.find(".siteorigin-widget-input"),g=o.find(".siteorigin-widget-order-items");g.sortable({stop:function(){var i=t(this).sortable("toArray",{attribute:"data-value"});d.val(i.join(",")),d.trigger("change",{silent:!0})}}),o.change(function(i,t){if(!t||!t.silent){var e=""===d.val()?[]:d.val().split(",");if(e.length)for(var n=0;n<e.length;n++){var r=e[n],a=o.find(".siteorigin-widget-order-item[data-value="+r+"]");g.append(a)}}})})})}(jQuery);
|
base/inc/fields/js/posts-field.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(
|
1 |
+
!function(r){r(document).on("sowsetupform",".siteorigin-widget-field-type-posts",function(t){var i=r(this);i.change(function(t){var o=sowbForms.getWidgetFormValues(i),s=o.hasOwnProperty("posts")?o.posts:null,n="";for(var e in s)""!==n&&(n+="&"),n+=e+"="+s[e];r.post(soWidgets.ajaxurl,{action:"sow_get_posts_count",query:n},function(t){i.find(".sow-current-count").text(t.posts_count)})})})}(jQuery);
|
base/inc/fields/js/presets-field.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(
|
1 |
+
!function(i){i(document).on("sowsetupformfield",".siteorigin-widget-field-type-presets",function(e){var u=i(this).find('select[class="siteorigin-widget-input"]');if(!u.data("initialized")){var l=u.find("+ .sowb-presets-field-undo");l.hide();var d=u.data("presets");u.change(function(){var e=u.val();if(e&&d.hasOwnProperty(e)){var i=d[e].values,t=u.closest(".siteorigin-widget-form-main"),s=u.data("previousValues");if(!s){var r=JSON.parse(JSON.stringify(i)),a=sowbForms.getWidgetFormValues(t),o=0,n=function(e,i){if(10<++o)return i;for(var t in i)if(e.hasOwnProperty(t)){var s=e[t],r=i[t];null!==s&&null!==r&&"object"==typeof s?n(s,r):i[t]=s}return i};s=n(a,r),u.data("previousValues",s)}l.not(":visible")&&(l.show(),l.click(function(e){e.preventDefault(),l.hide(),sowbForms.setWidgetFormValues(t,s,!0),u.removeData("previousValues"),u.val("")})),sowbForms.setWidgetFormValues(t,i,!0)}}),u.data("initialized",!0)}})}(jQuery);
|
base/inc/fields/js/tinymce-field-pre48.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(
|
1 |
+
!function(v){var i=function(e){"undefined"!=typeof tinyMCEPreInit?(tinyMCEPreInit.mceInit.hasOwnProperty("undefined")&&delete tinyMCEPreInit.mceInit[void 0],tinyMCEPreInit.qtInit.hasOwnProperty("undefined")&&delete tinyMCEPreInit.qtInit[void 0],QTags.instances.hasOwnProperty("undefined")&&delete QTags.instances[void 0],v(e).find("> .siteorigin-widget-field-type-tinymce > .siteorigin-widget-tinymce-container").each(function(e,t){var i=v(t),a=i.find("textarea"),o=a.attr("id");if("undefined"!=typeof tinymce){if(-1<o.indexOf("__i__"))return;var n,r=i.data("mceSettings"),s=i.data("widgetIdBase"),c=a.attr("name").replace(/\[\d*\]/g,""),d=/[a-zA-Z0-9-]+(?:\[[a-zA-Z0-9]+\])?\[(.*)\]/.exec(c)[1],f=new RegExp("widget-"+s+"-?.*-"+d.replace(/\]\[/g,"-")+"[-d]*");for(var g in tinyMCEPreInit.mceInit)g.match(f)&&(r=v.extend({},tinyMCEPreInit.mceInit[g],r));var l=tinymce.get(o);null!==l&&("undefined"==typeof vc&&0===i.closest(".vc_active").length&&(n=l.getContent()),l.remove());if(r=v.extend({},r,{selector:"#"+o,setup:function(e){e.on("change",function(){tinymce.get(o).save(),a.trigger("change"),a.val(window.switchEditors.pre_wpautop(e.getContent()))}),e.on("init",function(){n&&e.setContent(n)})}}),tinyMCEPreInit.mceInit[o]=r,i.find("div#wp-"+o+"-wrap").hasClass("tmce-active"))if(v("#"+o).is(":visible"))tinymce.init(tinyMCEPreInit.mceInit[o]);else var m=setInterval(function(){v("#"+o).is(":visible")&&(tinymce.init(tinyMCEPreInit.mceInit[o]),clearInterval(m))},500)}var u=i.data("qtSettings");u=v.extend({},tinyMCEPreInit.qtInit["siteorigin-widget-input-tinymce-field"],u,{id:o}),tinyMCEPreInit.qtInit[o]=u,i.find(".quicktags-toolbar").remove(),quicktags(tinyMCEPreInit.qtInit[o]),v(this).on("click",function(e){var t=v(e.target);if(t.hasClass("wp-switch-editor")){var i=t.hasClass("switch-tmce")?"tmce":"html";if("tmce"==i){var n=tinymce.get(o);if(null!=n){var r=a.val();-1!=r.search("<")&&-1==r.search(">")&&(r=r.replace(/</g,""),a.val(r)),n.setContent(window.switchEditors.wpautop(r))}}v(this).find("+ .siteorigin-widget-tinymce-selected-editor").val(i)}})}),QTags._buttonsInit()):setTimeout(function(){i(e)},500)};v(document).on("sowsetupform",function(e){var t=v(e.target);t.is(".siteorigin-widget-field-repeater-item-form")?t.is(":visible")?i(t):t.on("slideToggleOpenComplete",function(){t.is(":visible")&&(i(t),t.off("slideToggleOpenComplete"))}):i(t)}),v(document).on("sortstop",function(e,t){t.item.is(".siteorigin-widget-field-repeater-item")?t.item.find("> .siteorigin-widget-field-repeater-item-form").each(function(){i(v(this))}):i(t.item.find(".siteorigin-widget-form"))})}(jQuery);
|
base/inc/fields/js/tinymce-field.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(
|
1 |
+
!function(c){var t=function(r){if(!r.data("initialized")){var i=wp.oldEditor?wp.oldEditor:wp.editor;i&&i.hasOwnProperty("autop")&&(wp.editor.autop=i.autop,wp.editor.removep=i.removep,wp.editor.initialize=i.initialize);var e,n=r.find(".siteorigin-widget-tinymce-container"),d=n.data("editorSettings");if(d.wpautopToggleField){var t=n.closest(".siteorigin-widget-form");e=t.find(d.wpautopToggleField),d.tinymce.wpautop=e.is(":checked")}var a=n.find("textarea"),s=a.attr("id");if(d.tinymce&&(d.tinymce=c.extend({},d.tinymce,{selector:"#"+s,setup:function(i){i.on("change",function(){window.tinymce.get(s).save(),a.trigger("change")}),e&&(e.off("change"),e.on("change",function(){wp.editor.remove(s),d.tinymce.wpautop=e.is(":checked"),wp.editor.initialize(s,d)}))}})),c(document).on("wp-before-tinymce-init",function(i,e){if(e.selector===d.tinymce.selector){var t=n.data("mediaButtons");0===r.find(".wp-media-buttons").length&&r.find(".wp-editor-tabs").before(t.html)}}),c(document).on("tinymce-editor-setup",function(){r.find(".wp-editor-wrap").hasClass(d.selectedEditor+"-active")||setTimeout(function(){window.switchEditors.go(s)},10)}),i.remove(s),window.tinymce.EditorManager.overrideDefaults({base_url:d.baseURL,suffix:d.suffix}),a.is(":visible"))i.initialize(s,d);else var o=setInterval(function(){a.is(":visible")&&(i.initialize(s,d),clearInterval(o))},500);r.on("click",function(i){var e=c(i.target);if(e.is(".wp-switch-editor")){var t=e.hasClass("switch-tmce")?"tmce":"html";if("tmce"===t){var n=window.tinymce.get(s);if(null!==n){var o=a.val();-1!==o.search("<")&&-1===o.search(">")&&(o=o.replace(/</g,""),a.val(o)),n.setContent(window.switchEditors.wpautop(o))}}d.selectedEditor=t,r.find(".siteorigin-widget-tinymce-selected-editor").val(t)}}),r.data("initialized",!0)}};c(document).on("sowsetupformfield",".siteorigin-widget-field-type-tinymce",function(){var i=c(this),e=i.closest(".siteorigin-widget-field-repeater-item-form");0<e.length?e.is(":visible")?t(i):e.on("slideToggleOpenComplete",function(){e.is(":visible")&&(t(i),e.off("slideToggleOpenComplete"))}):t(i)}),c(document).on("sortstop",function(i,e){(e.item.is(".siteorigin-widget-field-repeater-item")?e.item.find("> .siteorigin-widget-field-repeater-item-form"):e.item.find(".siteorigin-widget-form")).find(".siteorigin-widget-field-type-tinymce").each(function(){c(this).data("initialized",null),t(c(this))})})}(jQuery);
|
base/inc/routes/siteorigin-widgets-resource.class.php
CHANGED
@@ -19,15 +19,9 @@ class SiteOrigin_Widgets_Resource extends WP_REST_Controller {
|
|
19 |
Â
$namespace = 'sowb/v' . $version;
|
20 |
Â
$resource = 'widgets';
|
21 |
Â
|
22 |
-
register_rest_route( $namespace, '/' . $resource, array(
|
23 |
-
'methods' => WP_REST_Server::READABLE,
|
24 |
-
'callback' => array( $this, 'get_widgets'),
|
25 |
-
'permission_callback' => array( $this, 'permissions_check' ),
|
26 |
-
) );
|
27 |
-
|
28 |
Â
$subresource = 'forms';
|
29 |
Â
register_rest_route( $namespace, '/' . $resource . '/' . $subresource, array(
|
30 |
-
'methods' => WP_REST_Server::
|
31 |
Â
'callback' => array( $this, 'get_widget_form'),
|
32 |
Â
'args' => array(
|
33 |
Â
'widgetClass' => array(
|
@@ -39,7 +33,7 @@ class SiteOrigin_Widgets_Resource extends WP_REST_Controller {
|
|
39 |
Â
|
40 |
Â
$subresource = 'previews';
|
41 |
Â
register_rest_route( $namespace, '/' . $resource . '/' . $subresource, array(
|
42 |
-
'methods' => WP_REST_Server::
|
43 |
Â
'callback' => array( $this, 'get_widget_preview'),
|
44 |
Â
'args' => array(
|
45 |
Â
'widgetClass' => array(
|
@@ -53,28 +47,6 @@ class SiteOrigin_Widgets_Resource extends WP_REST_Controller {
|
|
53 |
Â
) );
|
54 |
Â
}
|
55 |
Â
|
56 |
-
/**
|
57 |
-
* Get the collection of widgets.
|
58 |
-
*
|
59 |
-
* @param WP_REST_Request $request
|
60 |
-
*
|
61 |
-
* @return WP_Error|WP_REST_Response
|
62 |
-
*/
|
63 |
-
public function get_widgets( $request ) {
|
64 |
-
global $wp_widget_factory;
|
65 |
-
$so_widgets = array();
|
66 |
-
foreach ( $wp_widget_factory->widgets as $class => $widget_obj ) {
|
67 |
-
if ( ! empty( $widget_obj ) && is_object( $widget_obj ) && is_subclass_of( $widget_obj, 'SiteOrigin_Widget' ) ) {
|
68 |
-
$so_widgets[] = array(
|
69 |
-
'name' => preg_replace( '/^SiteOrigin /', '', $widget_obj->name ),
|
70 |
-
'class' => $class,
|
71 |
-
);
|
72 |
-
}
|
73 |
-
}
|
74 |
-
|
75 |
-
return rest_ensure_response( $so_widgets );
|
76 |
-
}
|
77 |
-
|
78 |
Â
/**
|
79 |
Â
*
|
80 |
Â
* @param WP_REST_Request $request Request.
|
19 |
Â
$namespace = 'sowb/v' . $version;
|
20 |
Â
$resource = 'widgets';
|
21 |
Â
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
22 |
Â
$subresource = 'forms';
|
23 |
Â
register_rest_route( $namespace, '/' . $resource . '/' . $subresource, array(
|
24 |
+
'methods' => WP_REST_Server::CREATABLE,
|
25 |
Â
'callback' => array( $this, 'get_widget_form'),
|
26 |
Â
'args' => array(
|
27 |
Â
'widgetClass' => array(
|
33 |
Â
|
34 |
Â
$subresource = 'previews';
|
35 |
Â
register_rest_route( $namespace, '/' . $resource . '/' . $subresource, array(
|
36 |
+
'methods' => WP_REST_Server::CREATABLE,
|
37 |
Â
'callback' => array( $this, 'get_widget_preview'),
|
38 |
Â
'args' => array(
|
39 |
Â
'widgetClass' => array(
|
47 |
Â
) );
|
48 |
Â
}
|
49 |
Â
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
50 |
Â
/**
|
51 |
Â
*
|
52 |
Â
* @param WP_REST_Request $request Request.
|
base/js/admin.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var sowbForms=window.sowbForms||{};!function(e){e.fn.sowSetupForm=function(){return e(this).each(function(i,t){var r,n=e(t),a=!0,s=e("body"),o=n.find("input[name]");if(o.length&&-1!==o.attr("name").indexOf("__i__"))return this;if(n.is(".siteorigin-widget-form-main")){if(!0===n.data("sow-form-setup"))return!0;if(s.hasClass("widgets-php")&&!n.is(":visible")&&0===n.closest(".panel-dialog").length)return!0;n.on("sowstatechange",function(i,t,r){n.find("[data-state-handler]").each(function(){var i=e(this),n=e.extend({},i.data("state-handler"),a?i.data("state-handler-initial"):{});if(0===Object.keys(n).length)return!0;var s,o,d,l,g,f,c={},p=sowbForms.getContainerFieldId(i,"repeater",".siteorigin-widget-field-repeater-item");if(!1!==p){var u={};for(var m in n)u[m.replace("{$repeater}",p)]=n[m];n=u}var w=sowbForms.getContainerFieldId(i,"widget",".siteorigin-widget-widget");if(!1!==w){var v={};for(var h in n){var b=h.match(/_else\[(.*)\]|(.*)\[(.*)\]/),y="";y=b&&b.length&&void 0===b[1]?b[2]+"_"+w+"["+b[3]+"]":"_else["+b[1]+"_"+w+"]",v[y]=n[h]}n=v}for(var F in n)if(g=!1,null!==(s=F.match(/^([a-zA-Z0-9_-]+)(\[([a-zA-Z0-9_\-,]+)\])?(\[\])?$/))){if(o={group:"default",name:"",multi:!1},void 0!==s[2]?(o.group=s[1],o.name=s[3]):o.name=s[0],o.multi=void 0!==s[4],"_else"===o.group)o.group=o.name,o.name="",g=o.group===t&&void 0===c[o.group];else{f=o.name.split(",").map(function(e){return e.trim()});for(var k=0;k<f.length&&!(g=o.group===t&&f[k]===r);k++);}if(g){d=n[F],o.multi||(d=[d]);for(var k=0;k<d.length;k++)l=void 0!==d[k][1]&&Boolean(d[k][1])?i.find(d[k][1]):i,l[d[k][0]].apply(l,void 0!==d[k][2]?d[k][2]:[]);c[o.group]=!0}}})}),n.sowSetupPreview(),r=n;var d=n.find(".siteorigin-widget-teaser");if(d.find(".dashicons-dismiss").click(function(){var i=e(this);e.get(i.data("dismiss-url")),d.slideUp("normal",function(){d.remove()})}),!n.data("backupDisabled")){var l=n.find("> .siteorigin-widgets-form-id").val(),g=n.find("> .siteorigin-widgets-form-timestamp"),f=parseInt(g.val()||0),c=JSON.parse(sessionStorage.getItem(l));if(c)if(c._sow_form_timestamp>f){var p=e('<div class="siteorigin-widget-form-notification"><span>'+soWidgets.backup.newerVersion+'</span><a class="button button-small so-backup-restore">'+soWidgets.backup.restore+'</a><a class="button button-small so-backup-dismiss">'+soWidgets.backup.dismiss+"</a><div><small>"+soWidgets.backup.replaceWarning+"</small></div></div>");n.prepend(p),p.find(".so-backup-restore").click(function(){sowbForms.setWidgetFormValues(r,c),p.slideUp("fast",function(){p.remove()})}),p.find(".so-backup-dismiss").click(function(){p.slideUp("fast",function(){sessionStorage.removeItem(l),p.remove()})})}else sessionStorage.removeItem(l);n.change(function(){g.val((new Date).getTime());var e=sowbForms.getWidgetFormValues(n);sessionStorage.setItem(l,JSON.stringify(e))})}}else r=n.closest(".siteorigin-widget-form-main");r.find("> .siteorigin-widgets-form-id").val();var u=n.find("> .siteorigin-widget-field");u.find("> .siteorigin-widget-section").sowSetupForm();var m=u.find("> .siteorigin-widget-widget");m.find("> .siteorigin-widget-section").sowSetupForm(),m.filter(":not(:has(> .siteorigin-widget-section))").sowSetupForm(),u.find(".siteorigin-widget-input").each(function(i,t){null===e(t).data("original-name")&&e(t).data("original-name",e(t).attr("name"))}),u.find("> .siteorigin-widget-field-repeater").sowSetupRepeater(),n.find(".siteorigin-widget-field-repeater-item").sowSetupRepeaterItems(),u.find("> .siteorigin-widget-input-color").each(function(){var i=e(this),t={change:function(i,t){setTimeout(function(){e(i.target).trigger("change")},100)}};i.data("defaultColor")&&(t.defaultColor=i.data("defaultColor")),i.wpColorPicker(t)});var w=function(){e(this).toggleClass("siteorigin-widget-section-visible"),e(this).parent().find("> .siteorigin-widget-section, > .siteorigin-widget-widget > .siteorigin-widget-section").slideToggle("fast",function(){if(e(window).resize(),e(this).find("> .siteorigin-widget-field-container-state").val(e(this).is(":visible")?"open":"closed"),e(this).is(":visible")){e(this).find("> .siteorigin-widget-field").trigger("sowsetupformfield")}})};u.filter(".siteorigin-widget-field-type-widget, .siteorigin-widget-field-type-section").find("> label").click(w),u.filter(".siteorigin-widget-field-type-posts").find(".posts-container-label-wrapper").click(w),u.filter(".siteorigin-widget-field-type-slider").each(function(){var i=e(this),t=i.find('input[type="number"]'),r=i.find(".siteorigin-widget-value-slider");r.slider({max:parseFloat(t.attr("max")),min:parseFloat(t.attr("min")),step:parseFloat(t.attr("step")),value:parseFloat(t.val()),slide:function(e,i){t.val(parseFloat(i.value)),t.trigger("change")},change:function(e,t){i.find(".siteorigin-widget-slider-value").html(t.value)}}),t.change(function(e,i){i&&i.silent||r.slider("value",parseFloat(t.val()))})}),u.filter(".siteorigin-widget-field-type-link").each(function(){var i=e(this),t=null,r=function(){null!==t&&t.abort();var r=i.find(".content-text-search"),n=r.val(),a=r.data("postTypes"),s=i.find("ul.posts").empty().addClass("loading");e.get(soWidgets.ajaxurl,{action:"so_widgets_search_posts",query:n,postTypes:a},function(i){for(var t=0;t<i.length;t++)""===i[t].label&&(i[t].label=" "),s.append(e("<li>").addClass("post").html(i[t].label+"<span>("+i[t].type+")</span>").data(i[t]));s.removeClass("loading")})};i.find(".select-content-button, .button-close").click(function(t){t.preventDefault(),e(this).blur();var n=i.find(".existing-content-selector");n.toggle(),n.is(":visible")&&0===n.find("ul.posts li").length&&r()}),i.on("click",".posts li",function(t){t.preventDefault();var r=e(this);i.find("input.siteorigin-widget-input").val("post: "+r.data("value")),i.change(),i.find(".existing-content-selector").toggle()});var n=null;i.find(".content-text-search").keyup(function(){null!==n&&clearTimeout(n),n=setTimeout(function(){r()},500)})}),void 0!==jQuery.fn.soPanelsSetupBuilderWidget&&u.filter(".siteorigin-widget-field-type-builder").each(function(){e(this).find("> .siteorigin-page-builder-field").each(function(){var i=e(this);i.soPanelsSetupBuilderWidget({builderType:i.data("type")})})});var v=function(){var i=e(this),t=i.closest("[data-state-emitter]").data("state-emitter");if(void 0!==t){var n={default:""};void 0===t.length&&(t=[t]);for(var a=0;a<t.length;a++)n=function(t,r){if(void 0===sowEmitters[t.callback]||"_"===t.callback.substr(0,1))return r;if(i.is('[type="radio"]')&&!i.is(":checked"))return r;var n=sowbForms.getContainerFieldId(i,"repeater",".siteorigin-widget-field-repeater-item");!1!==n&&(t.args=t.args.map(function(e){return e.replace("{$repeater}",n)}));var a=sowbForms.getContainerFieldId(i,"widget",".siteorigin-widget-widget");!1===a||t.hasOwnProperty("widgetFieldId")||(t.widgetFieldId=a,t.args=t.args.map(function(e){return e+"_"+a}));var s=i.is('[type="checkbox"]')?i.is(":checked"):i.val();return e.extend(r,sowEmitters[t.callback](s,t.args))}(t[a],n);var s=r.data("states");void 0===s&&(s={default:""});for(var o in n)void 0!==s[o]&&n[o]===s[o]||(s[o]=n[o],r.trigger("sowstatechange",[o,n[o]]));r.data("states",s)}};u.filter("[data-state-emitter]").each(function(){var i=e(this).find(".siteorigin-widget-input");i.on("keyup change",v),i.each(function(){var i=e(this);i.is(":radio")?i.is(":checked")&&v.call(i[0]):v.call(i[0])})}),n.trigger("sowsetupform",u).data("sow-form-setup",!0),u.trigger("sowsetupformfield"),n.find(".siteorigin-widget-field-repeater-item").trigger("updateFieldPositions"),(s.hasClass("wp-customizer")||s.hasClass("widgets-php"))&&n.closest(".ui-sortable").on("sortstop",function(e,i){i.item.find(".siteorigin-widget-form").find("> .siteorigin-widget-field").trigger("sowsetupformfield")}),a=!1})},e.fn.sowSetupPreview=function(){var i=e(this);i.siblings(".siteorigin-widget-preview").find("> a").click(function(t){t.preventDefault();var r=sowbForms.getWidgetFormValues(i),n=e(e("#so-widgets-bundle-tpl-preview-dialog").html().trim()).appendTo("body");n.find('input[name="data"]').val(JSON.stringify(r)),n.find('input[name="class"]').val(i.data("class")),n.find("iframe").on("load",function(){e(this).css("visibility","visible")}),n.find("form").submit(),n.find(".close").click(function(){n.remove()})})},e.fn.sowSetupRepeater=function(){return e(this).each(function(i,t){var r=e(t),n=r.find(".siteorigin-widget-field-repeater-items"),a=r.data("repeater-name");n.bind("updateFieldPositions",function(){var i=e(this),t=i.find("> .siteorigin-widget-field-repeater-item");t.each(function(i,t){e(t).find(".siteorigin-widget-input").each(function(t,r){var n=e(r).data("repeater-positions");void 0===n&&(n={}),n[a]=i,e(r).data("repeater-positions",n)})}),i.find(".siteorigin-widget-input").each(function(i,t){var r=e(t),n=r.data("repeater-positions");if(void 0!==n){var a=r.attr("data-original-name");if(a||(r.attr("data-original-name",r.attr("name")),a=r.attr("name")),!a)return;if(n)for(var s in n)a=a.replace("#"+s+"#",n[s]);r.attr("name",a)}}),i.data("initialSetup")||(i.find(".siteorigin-widget-input").each(function(i,t){var r=e(t);r.prop("checked",r.prop("defaultChecked"))}),i.data("initialSetup",!0));var n=r.data("scroll-count")?parseInt(r.data("scroll-count")):0;if(n>0&&t.length>n){var s=t.first().outerHeight();i.css("max-height",s*n).css("overflow","auto")}else i.css("max-height","").css("overflow","")}),n.sortable({handle:".siteorigin-widget-field-repeater-item-top",items:"> .siteorigin-widget-field-repeater-item",update:function(){n.find('input[type="radio"].siteorigin-widget-input').attr("name",""),n.trigger("updateFieldPositions"),r.trigger("change")},sortstop:function(i,t){if(t.item.is(".siteorigin-widget-field-repeater-item"))t.item.find("> .siteorigin-widget-field-repeater-item-form").each(function(){e(this).find("> .siteorigin-widget-field").trigger("sowsetupformfield")});else{t.item.find(".siteorigin-widget-form").find("> .siteorigin-widget-field").trigger("sowsetupformfield")}r.trigger("change")}}),n.trigger("updateFieldPositions"),r.find("> .siteorigin-widget-field-repeater-add").disableSelection().click(function(i){i.preventDefault(),r.closest(".siteorigin-widget-field-repeater").sowAddRepeaterItem().find("> .siteorigin-widget-field-repeater-items").slideDown("fast",function(){e(window).resize()})}),r.find("> .siteorigin-widget-field-repeater-top > .siteorigin-widget-field-repeater-expand").click(function(i){i.preventDefault(),r.closest(".siteorigin-widget-field-repeater").find("> .siteorigin-widget-field-repeateritems-").slideToggle("fast",function(){e(window).resize()})})})},e.fn.sowAddRepeaterItem=function(){return e(this).each(function(i,t){var r=e(t),n=r.find("> .siteorigin-widget-field-repeater-items").children().length+1,a=e("<div>"+r.find("> .siteorigin-widget-field-repeater-item-html").html()+"</div>");a.find(".siteorigin-widget-input[data-name]").each(function(){var i=e(this);0===i.closest(".siteorigin-widget-field-repeater-item-html").length&&i.attr("name",e(this).data("name"))});var s="";a.find("> .siteorigin-widget-field").each(function(i,t){var r=t.outerHTML;e(t).is(".siteorigin-widget-field-type-repeater")||(r=r.replace(/_id_/g,n)),s+=r});var o=void 0!==r.attr("readonly"),d=e('<div class="siteorigin-widget-field-repeater-item ui-draggable" />').append(e('<div class="siteorigin-widget-field-repeater-item-top" />').append(e('<div class="siteorigin-widget-field-expand" />')).append(o?"":e('<div class="siteorigin-widget-field-copy" />')).append(o?"":e('<div class="siteorigin-widget-field-remove" />')).append(e("<h4 />").html(r.data("item-name")))).append(e('<div class="siteorigin-widget-field-repeater-item-form" />').html(s));r.find("> .siteorigin-widget-field-repeater-items").append(d).sortable("refresh").trigger("updateFieldPositions"),d.sowSetupRepeaterItems(),d.hide().slideDown("fast",function(){e(window).resize()}),r.trigger("change")})},e.fn.sowRemoveRepeaterItem=function(){return e(this).each(function(i,t){var r=e(this).closest(".siteorigin-widget-field-repeater-items");e(this).remove(),r.sortable("refresh").trigger("updateFieldPositions"),e(t).trigger("change")})},e.fn.sowSetupRepeaterItems=function(){return e(this).each(function(i,t){var r=e(t);if(void 0===r.data("sowrepeater-actions-setup")){var n=r.closest(".siteorigin-widget-field-repeater"),a=r.find("> .siteorigin-widget-field-repeater-item-top"),s=n.data("item-label");if(s&&s.selector){var o=function(){var e=s.hasOwnProperty("valueMethod")&&s.valueMethod?s.valueMethod:"val",i=r.find(s.selector)[e]();i&&(i.length>80&&(i=i.substr(0,79)+"..."),a.find("h4").text(i))};o();var d=s.hasOwnProperty("updateEvent")&&s.updateEvent?s.updateEvent:"change";r.bind(d,o)}a.click(function(i){"siteorigin-widget-field-remove"!==i.target.className&&"siteorigin-widget-field-copy"!==i.target.className&&(i.preventDefault(),e(this).closest(".siteorigin-widget-field-repeater-item").find(".siteorigin-widget-field-repeater-item-form").eq(0).slideToggle("fast",function(){if(e(window).resize(),e(this).is(":visible")){e(this).trigger("slideToggleOpenComplete");e(this).find("> .siteorigin-widget-field").trigger("sowsetupformfield")}else e(this).trigger("slideToggleCloseComplete")}))}),a.find(".siteorigin-widget-field-remove").click(function(i,t){i.preventDefault();var n=e(this).closest(".siteorigin-widget-field-repeater-items"),a=e(this).closest(".siteorigin-widget-field-repeater-item"),s=function(){a.remove(),n.sortable("refresh").trigger("updateFieldPositions"),e(window).resize()};t&&t.silent?s():confirm(soWidgets.sure)&&a.slideUp("fast",s),r.trigger("change")}),a.find(".siteorigin-widget-field-copy").click(function(i){i.preventDefault();var t=e(this).closest(".siteorigin-widget-form-main"),n=e(this).closest(".siteorigin-widget-field-repeater-item"),a=n.clone(),s=n.closest(".siteorigin-widget-field-repeater-items"),o=s.children().length,d={};a.find("*[name]").each(function(){var i=e(this),s=i.attr("id"),l=i.attr("name");if(i.is("textarea")&&i.parent().is(".wp-editor-container")&&"undefined"!=typeof tinymce){i.parent().empty().append(i),i.css("display","");var g=tinymce.get(s);g&&i.val(g.getContent())}else if(i.is(".wp-color-picker")){var f=i.closest(".wp-picker-container"),c=i.closest(".siteorigin-widget-field");f.remove(),c.append(i.remove())}else{var p=s?n.find("#"+s):n.find('[name="'+l+'"]');p.length&&null!=p.val()&&i.val(p.val())}if(s){var u,m,w;if(i.is('[type="radio"]')){m=s.replace(/-\d+-\d+$/,"");var v=s.replace(/-\d+$/,"");if(!d[m]){var h={};d[m]=t.find(".siteorigin-widget-input[id^="+m+"]").not("[id*=_id_]").filter(function(i,t){var r=e(t).attr("name");return!h[r]&&(h[r]=!0,!0)}).length+1}var b=m+"-"+d[m];w=b+s.match(/-\d+$/)[0],a.find("label[for="+v+"]").attr("for",b)}else u=new RegExp("-\\d+$"),m=s.replace(u,""),d[m]||(d[m]=t.find(".siteorigin-widget-input[id^="+m+"]").not("[id*=_id_]").length+1),w=m+"-"+d[m]++;if(i.attr("id",w),i.is(".wp-editor-area")){var y=i.closest(".siteorigin-widget-tinymce-container"),F=y.data("media-buttons");if(F&&F.html){var u=new RegExp(s,"g");F.html=F.html.replace(u,w),y.data("media-buttons",F)}}a.find("label[for="+s+"]").attr("for",w),a.find("[id*="+s+"]").each(function(){var i=e(this).attr("id"),t=i.replace(s,w);e(this).attr("id",t)}),"undefined"!=typeof tinymce&&tinymce.get(w)&&tinymce.get(w).remove()}var k=n.parents(".siteorigin-widget-field-repeater").length,_=e("body");(_.hasClass("wp-customizer")||_.hasClass("widgets-php"))&&0===r.closest(".panel-dialog").length&&(k+=1);var C=l.replace(new RegExp("((?:.*?\\[\\d+\\]){"+(k-1).toString()+"})?(.*?\\[)\\d+(\\])"),"$1$2"+o.toString()+"$3");i.attr("name",C),i.data("original-name",C)}),s.append(a).sortable("refresh").trigger("updateFieldPositions"),a.sowSetupRepeaterItems(),a.hide().slideDown("fast",function(){e(window).resize()}),r.trigger("change")}),r.find("> .siteorigin-widget-field-repeater-item-form").sowSetupForm(),r.data("sowrepeater-actions-setup",!0)}})},sowbForms.getContainerFieldId=function(e,i,t){var r=i+"FieldId";this.hasOwnProperty(r)||(this[r]=1);var n=e.closest(t);if(n.length){var a=n.data("field-id");return void 0===a&&(a=this[r]++),n.data("field-id",a),a}return!1},sowbForms.getWidgetFieldVariable=function(e,i,t){var r=window.sow_field_javascript_variables[e];i=i.replace(/\[#.*?#\]/g,"");for(var n=/[a-zA-Z0-9\-]+(?:\[c?[0-9]+\])?\[(.*)\]/.exec(i)[1],a=n.split("]["),s=a.length?r:null;a.length;)s=s[a.shift()];return s[t]},sowbForms.fetchWidgetVariable=function(i,t,r){window.sowVars=window.sowVars||{},void 0===window.sowVars[t]?e.post(soWidgets.ajaxurl,{action:"sow_get_javascript_variables",widget:t,key:i},function(e){window.sowVars[t]=e,r(window.sowVars[t][i])}):r(window.sowVars[t][i])},sowbForms.getWidgetFormValues=function(i){if(_.isUndefined(i))return null;var t={};return i.find("*[name]").each(function(){var i=e(this);try{var r=/[a-zA-Z0-9\-]+\[[a-zA-Z0-9]+\]\[(.*)\]/.exec(i.attr("name"));if(_.isEmpty(r))return!0;r=r[1];var n=r.split("][");n=n.map(function(e){return!isNaN(parseFloat(e))&&isFinite(e)?parseInt(e):e});var a=t,s=null,o=_.isString(i.attr("type"))?i.attr("type").toLowerCase():null;if("checkbox"===o)s=!!i.is(":checked")&&(""===i.val()||i.val());else if("radio"===o){if(!i.is(":checked"))return;s=i.val()}else if("TEXTAREA"===i.prop("tagName")&&i.hasClass("wp-editor-area")){var d=null;"undefined"!=typeof tinyMCE&&(d=tinyMCE.get(i.attr("id"))),s=null===d||"function"!=typeof d.getContent||d.isHidden()?i.val():d.getContent()}else if("SELECT"===i.prop("tagName")){var l=i.find("option:selected");1===l.length?s=i.find("option:selected").val():l.length>1&&(s=_.map(i.find("option:selected"),function(i,t){return e(i).val()}))}else s=i.val();for(var g=0;g<n.length;g++)g===n.length-1?""===n[g]?a.push(s):a[n[g]]=s:(_.isUndefined(a[n[g]])&&(_.isNumber(n[g+1])||""===n[g+1]?a[n[g]]=[]:a[n[g]]={}),a=a[n[g]])}catch(e){console.error("Field ["+i.attr("name")+"] could not be processed and was skipped - "+e.message)}}),t},sowbForms.setWidgetFormValues=function(i,t,r,n){r=r||!1,n=void 0!==n&&n||void 0===n;var a=0,s=function(i,t){if(10==++a)return void--a;i.find("> .siteorigin-widget-field-type-repeater,> .siteorigin-widget-field-type-section > .siteorigin-widget-section > .siteorigin-widget-field-type-repeater").each(function(i,n){var a=e(this),o=a.find("> .siteorigin-widget-field-repeater"),d=o.data("repeaterName"),l=t.hasOwnProperty(d)?t[d]:null;if(a.parent().is(".siteorigin-widget-section")){var g=o.data("element-name");g=g.replace(/\[#.*?#\]/g,"");for(var f=/[a-zA-Z0-9\-]+(?:\[c?[0-9]+\])?\[(.*)\]/.exec(g)[1],c=f.split("]["),p=c.length?t:null;c.length;){var u=c.shift();p=p.hasOwnProperty(u)?p[u]:p}l=p}if(l&&Array.isArray(l)){var m=o.find("> .siteorigin-widget-field-repeater-items > .siteorigin-widget-field-repeater-item"),w=l.length,v=m.length;if(w>v)for(var h=0;h<w-v;h++)o.find("> .siteorigin-widget-field-repeater-add").click();else if(!r&&w<v)for(var b=w;b<v;b++){var y=e(m.eq(b));y.find("> .siteorigin-widget-field-repeater-item-top").find(".siteorigin-widget-field-remove").trigger("click",{silent:!0})}m=o.find("> .siteorigin-widget-field-repeater-items > .siteorigin-widget-field-repeater-item");for(var F=0;F<m.length;F++)m.eq(F).find("> .siteorigin-widget-field-repeater-item-form"),s(m.eq(F).find("> .siteorigin-widget-field-repeater-item-form"),l[F])}}),--a};s(i,t),i.find("*[name]").each(function(){var i=e(this),a=/[a-zA-Z0-9\-]+\[[a-zA-Z0-9]+\]\[(.*)\]/.exec(i.attr("name"));if(void 0===a||null===a)return!0;a=a[1];var s=a.split("][");s=s.map(function(e){return!isNaN(parseFloat(e))&&isFinite(e)?parseInt(e):e});for(var o,d=t,l=0;l<s.length;l++){if(!d.hasOwnProperty(s[l])){if(r)return!0;break}l===s.length-1?o=d[s[l]]:d=d[s[l]]}if("checkbox"===i.attr("type"))i.prop("checked",o);else if("radio"===i.attr("type"))i.prop("checked",o===i.val());else if("TEXTAREA"===i.prop("tagName")&&i.hasClass("wp-editor-area")){var g=null;"undefined"!=typeof tinyMCE&&(g=tinyMCE.get(i.attr("id"))),null!==g&&"function"==typeof g.setContent&&!g.isHidden()&&i.parent().is(":visible")?g.initialized?g.setContent(o):g.on("init",function(){g.setContent(o)}):i.val(o)}else if(i.is(".panels-data")){i.val(o);var f=i.data("builder");f&&f.setDataField(i)}else i.val(o);n&&i.trigger("change")})},e(".widgets-holder-wrap").on("click",".widget:has(.siteorigin-widget-form-main) .widget-top",function(){var i=e(this).closest(".widget").find(".siteorigin-widget-form-main");setTimeout(function(){i.sowSetupForm()},200)});var i=e("body");i.hasClass("wp-customizer")&&e(document).on("widget-added",function(e,i){i.find(".siteorigin-widget-form").sowSetupForm()}),i.hasClass("block-editor-page")&&e(document).on("panels_setup_preview",function(){e(sowb).trigger("setup_widgets")}),e(document).on("open_dialog",function(e,i){if(i.$el.find(".so-panels-dialog").is(".so-panels-dialog-edit-widget")){i.$el.find(".siteorigin-widget-form-main").find("> .siteorigin-widget-field").trigger("sowsetupformfield")}}),e(function(){e(document).trigger("sowadminloaded")})}(jQuery);var sowEmitters={_match:function(e,i){void 0===i&&(i=".*");var t=new RegExp("^([a-zA-Z0-9_-]+)(\\[([a-zA-Z0-9_-]+)\\])? *: *("+i+") *$"),r=t.exec(e);if(null===r)return!1;var n="",a="default";return void 0!==r[3]?(a=r[1],n=r[3]):n=r[1],{match:r[4].trim(),group:a,state:n}},_checker:function(e,i,t,r){var n={};void 0===i.length&&(i=[i]);for(var a,s=0;s<i.length;s++)!1!==(a=sowEmitters._match(i[s],t))&&("_true"===a.match||r(e,i,a.match))&&(n[a.group]=a.state);return n},select:function(e,i){void 0===i.length&&(i=[i]);for(var t={},r=0;r<i.length;r++)""===i[r]&&(i[r]="default"),t[i[r]]=e;return t},conditional:function(val,args){return sowEmitters._checker(val,args,"[^;{}]*",function(val,args,match){return eval(match)})},in:function(e,i){return sowEmitters._checker(e,i,"[^;{}]*",function(e,i,t){return-1!==t.split(",").map(function(e){return e.trim()}).indexOf(e)})}};window.sowbForms=sowbForms;
|
1 |
+
var sowbForms=window.sowbForms||{};!function(C){C.fn.sowSetupForm=function(){return C(this).each(function(e,i){var o,t=C(i),y=!0,r=C("body"),n=t.find("input[name]");if(n.length&&-1!==n.attr("name").indexOf("__i__"))return this;if(t.is(".siteorigin-widget-form-main")){if(!0===t.data("sow-form-setup"))return!0;if(r.hasClass("widgets-php")&&!t.is(":visible")&&0===t.closest(".panel-dialog").length)return!0;t.on("sowstatechange",function(e,h,b){t.find("[data-state-handler]").each(function(){var e,i,t,r,n,a,s=C(this),o=C.extend({},s.data("state-handler"),y?s.data("state-handler-initial"):{});if(0===Object.keys(o).length)return!0;var d={},l=sowbForms.getContainerFieldId(s,"repeater",".siteorigin-widget-field-repeater-item");if(!1!==l){var g={};for(var f in o)g[f.replace("{$repeater}",l)]=o[f];o=g}var c=sowbForms.getContainerFieldId(s,"widget",".siteorigin-widget-widget");if(!1!==c){var p={};for(var u in o){var m=u.match(/_else\[(.*)\]|(.*)\[(.*)\]/);p[m&&m.length&&void 0===m[1]?m[2]+"_"+c+"["+m[3]+"]":"_else["+m[1]+"_"+c+"]"]=o[u]}o=p}for(var w in o)if(n=!1,null!==(e=w.match(/^([a-zA-Z0-9_-]+)(\[([a-zA-Z0-9_\-,]+)\])?(\[\])?$/))){if(i={group:"default",name:"",multi:!1},void 0!==e[2]?(i.group=e[1],i.name=e[3]):i.name=e[0],i.multi=void 0!==e[4],"_else"===i.group)i.group=i.name,i.name="",n=i.group===h&&void 0===d[i.group];else{a=i.name.split(",").map(function(e){return e.trim()});for(var v=0;v<a.length&&!(n=i.group===h&&a[v]===b);v++);}if(n){t=o[w],i.multi||(t=[t]);for(v=0;v<t.length;v++)(r=void 0!==t[v][1]&&Boolean(t[v][1])?s.find(t[v][1]):s)[t[v][0]].apply(r,void 0!==t[v][2]?t[v][2]:[]);d[i.group]=!0}}})}),t.sowSetupPreview();var a=(o=t).find(".siteorigin-widget-teaser");if(a.find(".dashicons-dismiss").click(function(){var e=C(this);C.get(e.data("dismiss-url")),a.slideUp("normal",function(){a.remove()})}),!t.data("backupDisabled")){var s=t.find("> .siteorigin-widgets-form-id").val(),d=t.find("> .siteorigin-widgets-form-timestamp"),l=parseInt(d.val()||0),g=JSON.parse(sessionStorage.getItem(s));if(g)if(g._sow_form_timestamp>l){var f=C('<div class="siteorigin-widget-form-notification"><span>'+soWidgets.backup.newerVersion+'</span><a class="button button-small so-backup-restore">'+soWidgets.backup.restore+'</a><a class="button button-small so-backup-dismiss">'+soWidgets.backup.dismiss+"</a><div><small>"+soWidgets.backup.replaceWarning+"</small></div></div>");t.prepend(f),f.find(".so-backup-restore").click(function(){sowbForms.setWidgetFormValues(o,g),f.slideUp("fast",function(){f.remove()})}),f.find(".so-backup-dismiss").click(function(){f.slideUp("fast",function(){sessionStorage.removeItem(s),f.remove()})})}else sessionStorage.removeItem(s);t.change(function(){d.val((new Date).getTime());var e=sowbForms.getWidgetFormValues(t);sessionStorage.setItem(s,JSON.stringify(e))})}}else o=t.closest(".siteorigin-widget-form-main");o.find("> .siteorigin-widgets-form-id").val();var c=t.find("> .siteorigin-widget-field");c.find("> .siteorigin-widget-section").sowSetupForm();var p=c.find("> .siteorigin-widget-widget");p.find("> .siteorigin-widget-section").sowSetupForm(),p.filter(":not(:has(> .siteorigin-widget-section))").sowSetupForm(),c.find(".siteorigin-widget-input").each(function(e,i){null===C(i).data("original-name")&&C(i).data("original-name",C(i).attr("name"))}),c.find("> .siteorigin-widget-field-repeater").sowSetupRepeater(),t.find(".siteorigin-widget-field-repeater-item").sowSetupRepeaterItems(),c.find("> .siteorigin-widget-input-color").each(function(){var e=C(this),i={change:function(e,i){setTimeout(function(){C(e.target).trigger("change")},100)}};e.data("defaultColor")&&(i.defaultColor=e.data("defaultColor")),e.wpColorPicker(i)});var u=function(){C(this).toggleClass("siteorigin-widget-section-visible"),C(this).parent().find("> .siteorigin-widget-section, > .siteorigin-widget-widget > .siteorigin-widget-section").slideToggle("fast",function(){(C(window).resize(),C(this).find("> .siteorigin-widget-field-container-state").val(C(this).is(":visible")?"open":"closed"),C(this).is(":visible"))&&C(this).find("> .siteorigin-widget-field").trigger("sowsetupformfield")})};c.filter(".siteorigin-widget-field-type-widget, .siteorigin-widget-field-type-section").find("> label").click(u),c.filter(".siteorigin-widget-field-type-posts").find(".posts-container-label-wrapper").click(u),c.filter(".siteorigin-widget-field-type-slider").each(function(){var t=C(this),r=t.find('input[type="number"]'),n=t.find(".siteorigin-widget-value-slider");n.slider({max:parseFloat(r.attr("max")),min:parseFloat(r.attr("min")),step:parseFloat(r.attr("step")),value:parseFloat(r.val()),slide:function(e,i){r.val(parseFloat(i.value)),r.trigger("change")},change:function(e,i){t.find(".siteorigin-widget-slider-value").html(i.value)}}),r.change(function(e,i){i&&i.silent||n.slider("value",parseFloat(r.val()))})}),c.filter(".siteorigin-widget-field-type-link").each(function(){var n=C(this),t=function(){var e=n.find(".content-text-search"),i=e.val(),t=e.data("postTypes"),r=n.find("ul.posts").empty().addClass("loading");C.get(soWidgets.ajaxurl,{action:"so_widgets_search_posts",query:i,postTypes:t},function(e){for(var i=0;i<e.length;i++)""===e[i].label&&(e[i].label=" "),r.append(C("<li>").addClass("post").html(e[i].label+"<span>("+e[i].type+")</span>").data(e[i]));r.removeClass("loading")})};n.find(".select-content-button, .button-close").click(function(e){e.preventDefault(),C(this).blur();var i=n.find(".existing-content-selector");i.toggle(),i.is(":visible")&&0===i.find("ul.posts li").length&&t()}),n.on("click",".posts li",function(e){e.preventDefault();var i=C(this);n.find("input.siteorigin-widget-input").val("post: "+i.data("value")),n.change(),n.find(".existing-content-selector").toggle()});var e=null;n.find(".content-text-search").keyup(function(){null!==e&&clearTimeout(e),e=setTimeout(function(){t()},500)})}),void 0!==jQuery.fn.soPanelsSetupBuilderWidget&&c.filter(".siteorigin-widget-field-type-builder").each(function(){C(this).find("> .siteorigin-page-builder-field").each(function(){var e=C(this);e.soPanelsSetupBuilderWidget({builderType:e.data("type")})})});var m=function(){var a=C(this),e=a.closest("[data-state-emitter]").data("state-emitter");if(void 0!==e){var i=function(e,i){if(void 0===sowEmitters[e.callback]||"_"===e.callback.substr(0,1))return i;if(a.is('[type="radio"]')&&!a.is(":checked"))return i;var t=sowbForms.getContainerFieldId(a,"repeater",".siteorigin-widget-field-repeater-item");!1!==t&&(e.args=e.args.map(function(e){return e.replace("{$repeater}",t)}));var r=sowbForms.getContainerFieldId(a,"widget",".siteorigin-widget-widget");!1===r||e.hasOwnProperty("widgetFieldId")||(e.widgetFieldId=r,e.args=e.args.map(function(e){return e+"_"+r}));var n=a.is('[type="checkbox"]')?a.is(":checked"):a.val();return C.extend(i,sowEmitters[e.callback](n,e.args))},t={default:""};void 0===e.length&&(e=[e]);for(var r=0;r<e.length;r++)t=i(e[r],t);var n=o.data("states");for(var s in void 0===n&&(n={default:""}),t)void 0!==n[s]&&t[s]===n[s]||(n[s]=t[s],o.trigger("sowstatechange",[s,t[s]]));o.data("states",n)}};c.filter("[data-state-emitter]").each(function(){var e=C(this).find(".siteorigin-widget-input");e.on("keyup change",m),e.each(function(){var e=C(this);e.is(":radio")?e.is(":checked")&&m.call(e[0]):m.call(e[0])})}),t.trigger("sowsetupform",c).data("sow-form-setup",!0),c.trigger("sowsetupformfield"),t.find(".siteorigin-widget-field-repeater-item").trigger("updateFieldPositions"),(r.hasClass("wp-customizer")||r.hasClass("widgets-php"))&&t.closest(".ui-sortable").on("sortstop",function(e,i){i.item.find(".siteorigin-widget-form").find("> .siteorigin-widget-field").trigger("sowsetupformfield")}),y=!1})},C.fn.sowSetupPreview=function(){var r=C(this);r.siblings(".siteorigin-widget-preview").find("> a").click(function(e){e.preventDefault();var i=sowbForms.getWidgetFormValues(r),t=C(C("#so-widgets-bundle-tpl-preview-dialog").html().trim()).appendTo("body");t.find('input[name="data"]').val(JSON.stringify(i)),t.find('input[name="class"]').val(r.data("class")),t.find("iframe").on("load",function(){C(this).css("visibility","visible")}),t.find("form").submit(),t.find(".close").click(function(){t.remove()})})},C.fn.sowSetupRepeater=function(){return C(this).each(function(e,i){var n=C(i),t=n.find(".siteorigin-widget-field-repeater-items"),a=n.data("repeater-name");t.bind("updateFieldPositions",function(){var e=C(this),i=e.find("> .siteorigin-widget-field-repeater-item");i.each(function(r,e){C(e).find(".siteorigin-widget-input").each(function(e,i){var t=C(i).data("repeater-positions");void 0===t&&(t={}),t[a]=r,C(i).data("repeater-positions",t)})}),e.find(".siteorigin-widget-input").each(function(e,i){var t=C(i),r=t.data("repeater-positions");if(void 0!==r){var n=t.attr("data-original-name");if(n||(t.attr("data-original-name",t.attr("name")),n=t.attr("name")),!n)return;if(r)for(var a in r)n=n.replace("#"+a+"#",r[a]);t.attr("name",n)}}),e.data("initialSetup")||(e.find(".siteorigin-widget-input").each(function(e,i){var t=C(i);t.prop("checked",t.prop("defaultChecked"))}),e.data("initialSetup",!0));var t=n.data("scroll-count")?parseInt(n.data("scroll-count")):0;if(0<t&&i.length>t){var r=i.first().outerHeight();e.css("max-height",r*t).css("overflow","auto")}else e.css("max-height","").css("overflow","")}),t.sortable({handle:".siteorigin-widget-field-repeater-item-top",items:"> .siteorigin-widget-field-repeater-item",update:function(){t.find('input[type="radio"].siteorigin-widget-input').attr("name",""),t.trigger("updateFieldPositions"),n.trigger("change")},sortstop:function(e,i){i.item.is(".siteorigin-widget-field-repeater-item")?i.item.find("> .siteorigin-widget-field-repeater-item-form").each(function(){C(this).find("> .siteorigin-widget-field").trigger("sowsetupformfield")}):i.item.find(".siteorigin-widget-form").find("> .siteorigin-widget-field").trigger("sowsetupformfield");n.trigger("change")}}),t.trigger("updateFieldPositions"),n.find("> .siteorigin-widget-field-repeater-add").disableSelection().click(function(e){e.preventDefault(),n.closest(".siteorigin-widget-field-repeater").sowAddRepeaterItem().find("> .siteorigin-widget-field-repeater-items").slideDown("fast",function(){C(window).resize()})}),n.find("> .siteorigin-widget-field-repeater-top > .siteorigin-widget-field-repeater-expand").click(function(e){e.preventDefault(),n.closest(".siteorigin-widget-field-repeater").find("> .siteorigin-widget-field-repeateritems-").slideToggle("fast",function(){C(window).resize()})})})},C.fn.sowAddRepeaterItem=function(){return C(this).each(function(e,i){var t=C(i),r=t.find("> .siteorigin-widget-field-repeater-items").children().length+1,n=C("<div>"+t.find("> .siteorigin-widget-field-repeater-item-html").html()+"</div>");n.find(".siteorigin-widget-input[data-name]").each(function(){var e=C(this);0===e.closest(".siteorigin-widget-field-repeater-item-html").length&&e.attr("name",C(this).data("name"))});var a="";n.find("> .siteorigin-widget-field").each(function(e,i){var t=i.outerHTML;C(i).is(".siteorigin-widget-field-type-repeater")||(t=t.replace(/_id_/g,r)),a+=t});var s=void 0!==t.attr("readonly"),o=C('<div class="siteorigin-widget-field-repeater-item ui-draggable" />').append(C('<div class="siteorigin-widget-field-repeater-item-top" />').append(C('<div class="siteorigin-widget-field-expand" />')).append(s?"":C('<div class="siteorigin-widget-field-copy" />')).append(s?"":C('<div class="siteorigin-widget-field-remove" />')).append(C("<h4 />").html(t.data("item-name")))).append(C('<div class="siteorigin-widget-field-repeater-item-form" />').html(a));t.find("> .siteorigin-widget-field-repeater-items").append(o).sortable("refresh").trigger("updateFieldPositions"),o.sowSetupRepeaterItems(),o.hide().slideDown("fast",function(){C(window).resize()}),t.trigger("change")})},C.fn.sowRemoveRepeaterItem=function(){return C(this).each(function(e,i){var t=C(this).closest(".siteorigin-widget-field-repeater-items");C(this).remove(),t.sortable("refresh").trigger("updateFieldPositions"),C(i).trigger("change")})},C.fn.sowSetupRepeaterItems=function(){return C(this).each(function(e,i){var _=C(i);if(void 0===_.data("sowrepeater-actions-setup")){var t=_.closest(".siteorigin-widget-field-repeater"),r=_.find("> .siteorigin-widget-field-repeater-item-top"),n=t.data("item-label");if(n&&n.selector){var a=function(){var e=n.hasOwnProperty("valueMethod")&&n.valueMethod?n.valueMethod:"val",i=_.find(n.selector)[e]();i&&(80<i.length&&(i=i.substr(0,79)+"..."),r.find("h4").text(i))};a();var s=n.hasOwnProperty("updateEvent")&&n.updateEvent?n.updateEvent:"change";_.bind(s,a)}r.click(function(e){"siteorigin-widget-field-remove"!==e.target.className&&"siteorigin-widget-field-copy"!==e.target.className&&(e.preventDefault(),C(this).closest(".siteorigin-widget-field-repeater-item").find(".siteorigin-widget-field-repeater-item-form").eq(0).slideToggle("fast",function(){(C(window).resize(),C(this).is(":visible"))?(C(this).trigger("slideToggleOpenComplete"),C(this).find("> .siteorigin-widget-field").trigger("sowsetupformfield")):C(this).trigger("slideToggleCloseComplete")}))}),r.find(".siteorigin-widget-field-remove").click(function(e,i){e.preventDefault();var t=C(this).closest(".siteorigin-widget-field-repeater-items"),r=C(this).closest(".siteorigin-widget-field-repeater-item"),n=function(){r.remove(),t.sortable("refresh").trigger("updateFieldPositions"),C(window).resize()};i&&i.silent?n():confirm(soWidgets.sure)&&r.slideUp("fast",n),_.trigger("change")}),r.find(".siteorigin-widget-field-copy").click(function(e){e.preventDefault();var h=C(this).closest(".siteorigin-widget-form-main"),b=C(this).closest(".siteorigin-widget-field-repeater-item"),y=b.clone(),i=b.closest(".siteorigin-widget-field-repeater-items"),F=i.children().length,k={};y.find("*[name]").each(function(){var e=C(this),i=e.attr("id"),t=e.attr("name");if(e.is("textarea")&&e.parent().is(".wp-editor-container")&&"undefined"!=typeof tinymce){e.parent().empty().append(e),e.css("display","");var r=tinymce.get(i);r&&e.val(r.getContent())}else if(e.is(".wp-color-picker")){var n=e.closest(".wp-picker-container"),a=e.closest(".siteorigin-widget-field");n.remove(),a.append(e.remove())}else{var s=i?b.find("#"+i):b.find('[name="'+t+'"]');s.length&&null!=s.val()&&e.val(s.val())}if(i){var o,d;if(e.is('[type="radio"]')){o=i.replace(/-\d+-\d+$/,"");var l=i.replace(/-\d+$/,"");if(!k[o]){var g={};k[o]=h.find(".siteorigin-widget-input[id^="+o+"]").not("[id*=_id_]").filter(function(e,i){var t=C(i).attr("name");return!g[t]&&(g[t]=!0)}).length+1}var f=o+"-"+k[o];d=f+i.match(/-\d+$/)[0],y.find("label[for="+l+"]").attr("for",f)}else u=new RegExp("-\\d+$"),o=i.replace(u,""),k[o]||(k[o]=h.find(".siteorigin-widget-input[id^="+o+"]").not("[id*=_id_]").length+1),d=o+"-"+k[o]++;if(e.attr("id",d),e.is(".wp-editor-area")){var c=e.closest(".siteorigin-widget-tinymce-container"),p=c.data("media-buttons");if(p&&p.html){var u=new RegExp(i,"g");p.html=p.html.replace(u,d),c.data("media-buttons",p)}}y.find("label[for="+i+"]").attr("for",d),y.find("[id*="+i+"]").each(function(){var e=C(this).attr("id").replace(i,d);C(this).attr("id",e)}),"undefined"!=typeof tinymce&&tinymce.get(d)&&tinymce.get(d).remove()}var m=b.parents(".siteorigin-widget-field-repeater").length,w=C("body");(w.hasClass("wp-customizer")||w.hasClass("widgets-php"))&&0===_.closest(".panel-dialog").length&&(m+=1);var v=t.replace(new RegExp("((?:.*?\\[\\d+\\]){"+(m-1).toString()+"})?(.*?\\[)\\d+(\\])"),"$1$2"+F.toString()+"$3");e.attr("name",v),e.data("original-name",v)}),i.append(y).sortable("refresh").trigger("updateFieldPositions"),y.sowSetupRepeaterItems(),y.hide().slideDown("fast",function(){C(window).resize()}),_.trigger("change")}),_.find("> .siteorigin-widget-field-repeater-item-form").sowSetupForm(),_.data("sowrepeater-actions-setup",!0)}})},sowbForms.getContainerFieldId=function(e,i,t){var r=i+"FieldId";this.hasOwnProperty(r)||(this[r]=1);var n=e.closest(t);if(n.length){var a=n.data("field-id");return void 0===a&&(a=this[r]++),n.data("field-id",a),a}return!1},sowbForms.getWidgetFieldVariable=function(e,i,t){var r=window.sow_field_javascript_variables[e];i=i.replace(/\[#.*?#\]/g,"");for(var n=/[a-zA-Z0-9\-]+(?:\[c?[0-9]+\])?\[(.*)\]/.exec(i)[1].split("]["),a=n.length?r:null;n.length;)a=a[n.shift()];return a[t]},sowbForms.fetchWidgetVariable=function(i,t,r){window.sowVars=window.sowVars||{},void 0===window.sowVars[t]?C.post(soWidgets.ajaxurl,{action:"sow_get_javascript_variables",widget:t,key:i},function(e){window.sowVars[t]=e,r(window.sowVars[t][i])}):r(window.sowVars[t][i])},sowbForms.getWidgetFormValues=function(e){if(_.isUndefined(e))return null;var l={};return e.find("*[name]").each(function(){var i=C(this);try{var e=/[a-zA-Z0-9\-]+\[[a-zA-Z0-9]+\]\[(.*)\]/.exec(i.attr("name"));if(_.isEmpty(e))return!0;var t=(e=e[1]).split("][");t=t.map(function(e){return!isNaN(parseFloat(e))&&isFinite(e)?parseInt(e):e});var r=l,n=null,a=_.isString(i.attr("type"))?i.attr("type").toLowerCase():null;if("checkbox"===a)n=!!i.is(":checked")&&(""===i.val()||i.val());else if("radio"===a){if(!i.is(":checked"))return;n=i.val()}else if("TEXTAREA"===i.prop("tagName")&&i.hasClass("wp-editor-area")){var s=null;"undefined"!=typeof tinyMCE&&(s=tinyMCE.get(i.attr("id"))),n=null===s||"function"!=typeof s.getContent||s.isHidden()?i.val():s.getContent()}else if("SELECT"===i.prop("tagName")){var o=i.find("option:selected");1===o.length?n=i.find("option:selected").val():1<o.length&&(n=_.map(i.find("option:selected"),function(e,i){return C(e).val()}))}else n=i.val();for(var d=0;d<t.length;d++)d===t.length-1?""===t[d]?r.push(n):r[t[d]]=n:(_.isUndefined(r[t[d]])&&(_.isNumber(t[d+1])||""===t[d+1]?r[t[d]]=[]:r[t[d]]={}),r=r[t[d]])}catch(e){console.error("Field ["+i.attr("name")+"] could not be processed and was skipped - "+e.message)}}),l},sowbForms.setWidgetFormValues=function(e,d,v,l){v=v||!1,l=void 0!==l&&l||void 0===l;var i=0,h=function(e,w){10!=++i&&e.find("> .siteorigin-widget-field-type-repeater,> .siteorigin-widget-field-type-section > .siteorigin-widget-section > .siteorigin-widget-field-type-repeater").each(function(e,i){var t=C(this),r=t.find("> .siteorigin-widget-field-repeater"),n=r.data("repeaterName"),a=w.hasOwnProperty(n)?w[n]:null;if(t.parent().is(".siteorigin-widget-section")){var s=r.data("element-name");s=s.replace(/\[#.*?#\]/g,"");for(var o=/[a-zA-Z0-9\-]+(?:\[c?[0-9]+\])?\[(.*)\]/.exec(s)[1].split("]["),d=o.length?w:null;o.length;){var l=o.shift();d=d.hasOwnProperty(l)?d[l]:d}a=d}if(a&&Array.isArray(a)){var g=r.find("> .siteorigin-widget-field-repeater-items > .siteorigin-widget-field-repeater-item"),f=a.length,c=g.length;if(c<f)for(var p=0;p<f-c;p++)r.find("> .siteorigin-widget-field-repeater-add").click();else if(!v&&f<c)for(var u=f;u<c;u++){C(g.eq(u)).find("> .siteorigin-widget-field-repeater-item-top").find(".siteorigin-widget-field-remove").trigger("click",{silent:!0})}g=r.find("> .siteorigin-widget-field-repeater-items > .siteorigin-widget-field-repeater-item");for(var m=0;m<g.length;m++)g.eq(m).find("> .siteorigin-widget-field-repeater-item-form"),h(g.eq(m).find("> .siteorigin-widget-field-repeater-item-form"),a[m])}}),--i};h(e,d),e.find("*[name]").each(function(){var e=C(this),i=/[a-zA-Z0-9\-]+\[[a-zA-Z0-9]+\]\[(.*)\]/.exec(e.attr("name"));if(null==i)return!0;var t=(i=i[1]).split("][");t=t.map(function(e){return!isNaN(parseFloat(e))&&isFinite(e)?parseInt(e):e});for(var r,n=d,a=0;a<t.length;a++){if(!n.hasOwnProperty(t[a])){if(v)return!0;break}a===t.length-1?r=n[t[a]]:n=n[t[a]]}if("checkbox"===e.attr("type"))e.prop("checked",r);else if("radio"===e.attr("type"))e.prop("checked",r===e.val());else if("TEXTAREA"===e.prop("tagName")&&e.hasClass("wp-editor-area")){var s=null;"undefined"!=typeof tinyMCE&&(s=tinyMCE.get(e.attr("id"))),null!==s&&"function"==typeof s.setContent&&!s.isHidden()&&e.parent().is(":visible")?s.initialized?s.setContent(r):s.on("init",function(){s.setContent(r)}):e.val(r)}else if(e.is(".panels-data")){e.val(r);var o=e.data("builder");o&&o.setDataField(e)}else e.val(r);l&&e.trigger("change")})},C(".widgets-holder-wrap").on("click",".widget:has(.siteorigin-widget-form-main) .widget-top",function(){var e=C(this).closest(".widget").find(".siteorigin-widget-form-main");setTimeout(function(){e.sowSetupForm()},200)});var e=C("body");e.hasClass("wp-customizer")&&C(document).on("widget-added",function(e,i){i.find(".siteorigin-widget-form").sowSetupForm()}),e.hasClass("block-editor-page")&&C(document).on("panels_setup_preview",function(){C(sowb).trigger("setup_widgets")}),C(document).on("open_dialog",function(e,i){i.$el.find(".so-panels-dialog").is(".so-panels-dialog-edit-widget")&&i.$el.find(".siteorigin-widget-form-main").find("> .siteorigin-widget-field").trigger("sowsetupformfield")}),C(function(){C(document).trigger("sowadminloaded")})}(jQuery);var sowEmitters={_match:function(e,i){void 0===i&&(i=".*");var t=new RegExp("^([a-zA-Z0-9_-]+)(\\[([a-zA-Z0-9_-]+)\\])? *: *("+i+") *$").exec(e);if(null===t)return!1;var r="",n="default";return r=void 0!==t[3]?(n=t[1],t[3]):t[1],{match:t[4].trim(),group:n,state:r}},_checker:function(e,i,t,r){var n,a={};void 0===i.length&&(i=[i]);for(var s=0;s<i.length;s++)!1!==(n=sowEmitters._match(i[s],t))&&("_true"===n.match||r(e,i,n.match))&&(a[n.group]=n.state);return a},select:function(e,i){void 0===i.length&&(i=[i]);for(var t={},r=0;r<i.length;r++)""===i[r]&&(i[r]="default"),t[i[r]]=e;return t},conditional:function(val,args){return sowEmitters._checker(val,args,"[^;{}]*",function(val,args,match){return eval(match)})},in:function(e,i){return sowEmitters._checker(e,i,"[^;{}]*",function(e,i,t){return-1!==t.split(",").map(function(e){return e.trim()}).indexOf(e)})}};window.sowbForms=sowbForms;
|
base/js/meta-box-manager.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(
|
1 |
+
!function(n){n("#post").on("submit",function(t){var i=n("#siteorigin-widgets-meta-box"),e=sowbForms.getWidgetFormValues(i);i.find('input[name="widget_post_meta"]').val(JSON.stringify(e))})}(jQuery);
|
compat/beaver-builder/sowb-beaver-builder.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var sowb=window.sowb||{};!function(
|
1 |
+
var sowb=window.sowb||{};!function(c){"undefined"!=typeof FLBuilder&&(sowb.orig_FLBuilder_initJQueryReadyFix=FLBuilder._initJQueryReadyFix,FLBuilder._initJQueryReadyFix=function(){},sowb.orig_FLBuilder_getSettings=FLBuilder._getSettings,FLBuilder._getSettings=function(e){FLBuilder._updateEditorFields();var i=e.serializeArray(),r=0,t=0,n="",l="",d="",o=[],u=[],s={};for(r=0;r<i.length;r++)if(n=i[r].value.replace(/\r/gm,""),!(-1<i[r].name.indexOf("flrich")))if(-1<i[r].name.indexOf("[")){for(l=i[r].name.replace(/\[(.*)\]/,""),o=[],u=(d=i[r].name.replace(l,"")).match(/\[[^\]]*\]/g),t=0;t<u.length;t++)"[]"!==u[t]&&o.push(u[t].replace(/\[|\]/g,""));var a=function(e,i,r,t){0===t.length?e[r]=i:(void 0===e[r]&&(e[r]={}),a(e[r],i,t.shift(),t))};if(0<o.length){var g=o.slice();void 0===s[l]&&(s[l]={}),a(s[l],n,g.shift(),g)}else void 0===s[l]&&(s[l]=[]),s[l].push(n)}else s[i[r].name]=n;for(d in s)if(void 0!==s["as_values_"+d]){s[d]=c.grep(s["as_values_"+d].split(","),function(e){return""!==e}).join(",");try{delete s["as_values_"+d]}catch(e){}}"function"==typeof FLBuilder._getOriginalSettings&&(s=c.extend({},FLBuilder._getOriginalSettings(e),s));var f=e.find(".siteorigin-widget-form");return f.length&&(s[l]=sowbForms.getWidgetFormValues(f)),s}),c(document).on("fl-builder.preview-rendered fl-builder.layout-rendered",".fl-builder-content",function(){c(sowb).trigger("setup_widgets")})}(jQuery),window.sowb=sowb;
|
compat/block-editor/widget-block.js
CHANGED
@@ -12,9 +12,9 @@
|
|
12 |
Â
var __ = i18n.__;
|
13 |
Â
|
14 |
Â
registerBlockType( 'sowb/widget-block', {
|
15 |
-
title: __( 'SiteOrigin Widget' ),
|
16 |
Â
|
17 |
-
description: __( 'Select a SiteOrigin widget from the dropdown.' ),
|
18 |
Â
|
19 |
Â
icon: function() {
|
20 |
Â
return el(
|
@@ -41,32 +41,14 @@
|
|
41 |
Â
},
|
42 |
Â
|
43 |
Â
edit: withState( {
|
44 |
-
loadingWidgets: true,
|
45 |
Â
editing: false,
|
46 |
Â
formInitialized: false,
|
47 |
Â
previewInitialized: false,
|
48 |
-
widgets: null,
|
49 |
Â
widgetFormHtml: '',
|
50 |
Â
widgetSettingsChanged: false,
|
51 |
Â
widgetPreviewHtml: '',
|
52 |
Â
} )( function ( props ) {
|
53 |
Â
|
54 |
-
if ( props.loadingWidgets ) {
|
55 |
-
$.get( {
|
56 |
-
url: sowbBlockEditorAdmin.restUrl + 'sowb/v1/widgets',
|
57 |
-
beforeSend: function ( xhr ) {
|
58 |
-
xhr.setRequestHeader( 'X-WP-Nonce', sowbBlockEditorAdmin.nonce );
|
59 |
-
}
|
60 |
-
} )
|
61 |
-
.then( function( widgets ) {
|
62 |
-
var newState = { widgets: widgets, loadingWidgets: false };
|
63 |
-
if ( !props.attributes.widgetClass ) {
|
64 |
-
newState.editing = true;
|
65 |
-
}
|
66 |
-
props.setState( newState );
|
67 |
-
} );
|
68 |
-
}
|
69 |
-
|
70 |
Â
function onWidgetClassChange( newWidgetClass ) {
|
71 |
Â
if ( newWidgetClass !== '' ) {
|
72 |
Â
if ( props.widgetSettingsChanged && ! confirm( sowbBlockEditorAdmin.confirmChangeWidget ) ) {
|
@@ -74,6 +56,7 @@
|
|
74 |
Â
}
|
75 |
Â
props.setAttributes( { widgetClass: newWidgetClass, widgetData: null } );
|
76 |
Â
props.setState( {
|
Â
|
|
77 |
Â
widgetFormHtml: null,
|
78 |
Â
formInitialized: false,
|
79 |
Â
widgetSettingsChanged: false,
|
@@ -127,10 +110,10 @@
|
|
127 |
Â
}
|
128 |
Â
}
|
129 |
Â
|
130 |
-
if ( props.editing ) {
|
131 |
Â
var widgetsOptions = [];
|
132 |
-
if (
|
133 |
-
|
134 |
Â
if ( a.name < b.name ) {
|
135 |
Â
return -1;
|
136 |
Â
} else if ( a.name > b.name ) {
|
@@ -138,15 +121,15 @@
|
|
138 |
Â
}
|
139 |
Â
return 0;
|
140 |
Â
} );
|
141 |
-
widgetsOptions =
|
142 |
Â
return { value: widget.class, label: widget.name };
|
143 |
Â
} );
|
144 |
-
widgetsOptions.unshift( { value: '', label: __( 'Select widget type' ) } );
|
145 |
Â
}
|
146 |
Â
|
147 |
-
var
|
148 |
-
if (
|
149 |
-
$.
|
150 |
Â
url: sowbBlockEditorAdmin.restUrl + 'sowb/v1/widgets/forms',
|
151 |
Â
beforeSend: function ( xhr ) {
|
152 |
Â
xhr.setRequestHeader( 'X-WP-Nonce', sowbBlockEditorAdmin.nonce );
|
@@ -173,7 +156,7 @@
|
|
173 |
Â
IconButton,
|
174 |
Â
{
|
175 |
Â
className: 'components-icon-button components-toolbar__control',
|
176 |
-
label: __( 'Preview widget.' ),
|
177 |
Â
onClick: switchToPreview,
|
178 |
Â
icon: 'visibility'
|
179 |
Â
}
|
@@ -185,10 +168,10 @@
|
|
185 |
Â
{
|
186 |
Â
key: 'placeholder',
|
187 |
Â
className: 'so-widget-placeholder',
|
188 |
-
label: __( 'SiteOrigin Widget' ),
|
189 |
-
instructions: __( 'Select the type of widget you want to use:' )
|
190 |
Â
},
|
191 |
-
( props.loadingWidgets ||
|
192 |
Â
el( Spinner ) :
|
193 |
Â
el(
|
194 |
Â
'div',
|
@@ -212,9 +195,9 @@
|
|
212 |
Â
];
|
213 |
Â
} else {
|
214 |
Â
|
215 |
-
var
|
216 |
-
if (
|
217 |
-
$.
|
218 |
Â
url: sowbBlockEditorAdmin.restUrl + 'sowb/v1/widgets/previews',
|
219 |
Â
beforeSend: function ( xhr ) {
|
220 |
Â
xhr.setRequestHeader( 'X-WP-Nonce', sowbBlockEditorAdmin.nonce );
|
@@ -225,7 +208,10 @@
|
|
225 |
Â
}
|
226 |
Â
} )
|
227 |
Â
.then( function( widgetPreview ) {
|
228 |
-
props.setState( {
|
Â
|
|
Â
|
|
Â
|
|
229 |
Â
} );
|
230 |
Â
}
|
231 |
Â
var widgetPreview = props.widgetPreviewHtml ? props.widgetPreviewHtml : '';
|
@@ -240,7 +226,7 @@
|
|
240 |
Â
IconButton,
|
241 |
Â
{
|
242 |
Â
className: 'components-icon-button components-toolbar__control',
|
243 |
-
label: __( 'Edit widget.' ),
|
244 |
Â
onClick: switchToEditing,
|
245 |
Â
icon: 'edit'
|
246 |
Â
}
|
@@ -253,7 +239,7 @@
|
|
253 |
Â
key: 'preview',
|
254 |
Â
className: 'so-widget-preview-container'
|
255 |
Â
},
|
256 |
-
(
|
257 |
Â
el( 'div', {
|
258 |
Â
className: 'so-widgets-spinner-container'
|
259 |
Â
},
|
12 |
Â
var __ = i18n.__;
|
13 |
Â
|
14 |
Â
registerBlockType( 'sowb/widget-block', {
|
15 |
+
title: __( 'SiteOrigin Widget (in beta)', 'so-widgets-bundle' ),
|
16 |
Â
|
17 |
+
description: __( 'Select a SiteOrigin widget from the dropdown.', 'so-widgets-bundle' ),
|
18 |
Â
|
19 |
Â
icon: function() {
|
20 |
Â
return el(
|
41 |
Â
},
|
42 |
Â
|
43 |
Â
edit: withState( {
|
Â
|
|
44 |
Â
editing: false,
|
45 |
Â
formInitialized: false,
|
46 |
Â
previewInitialized: false,
|
Â
|
|
47 |
Â
widgetFormHtml: '',
|
48 |
Â
widgetSettingsChanged: false,
|
49 |
Â
widgetPreviewHtml: '',
|
50 |
Â
} )( function ( props ) {
|
51 |
Â
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
52 |
Â
function onWidgetClassChange( newWidgetClass ) {
|
53 |
Â
if ( newWidgetClass !== '' ) {
|
54 |
Â
if ( props.widgetSettingsChanged && ! confirm( sowbBlockEditorAdmin.confirmChangeWidget ) ) {
|
56 |
Â
}
|
57 |
Â
props.setAttributes( { widgetClass: newWidgetClass, widgetData: null } );
|
58 |
Â
props.setState( {
|
59 |
+
editing: true,
|
60 |
Â
widgetFormHtml: null,
|
61 |
Â
formInitialized: false,
|
62 |
Â
widgetSettingsChanged: false,
|
110 |
Â
}
|
111 |
Â
}
|
112 |
Â
|
113 |
+
if ( props.editing || ! props.attributes.widgetClass ) {
|
114 |
Â
var widgetsOptions = [];
|
115 |
+
if ( sowbBlockEditorAdmin.widgets ) {
|
116 |
+
sowbBlockEditorAdmin.widgets.sort( function ( a, b ) {
|
117 |
Â
if ( a.name < b.name ) {
|
118 |
Â
return -1;
|
119 |
Â
} else if ( a.name > b.name ) {
|
121 |
Â
}
|
122 |
Â
return 0;
|
123 |
Â
} );
|
124 |
+
widgetsOptions = sowbBlockEditorAdmin.widgets.map( function ( widget ) {
|
125 |
Â
return { value: widget.class, label: widget.name };
|
126 |
Â
} );
|
127 |
+
widgetsOptions.unshift( { value: '', label: __( 'Select widget type', 'so-widgets-bundle' ) } );
|
128 |
Â
}
|
129 |
Â
|
130 |
+
var loadWidgetForm = props.attributes.widgetClass && ! props.widgetFormHtml;
|
131 |
+
if ( loadWidgetForm ) {
|
132 |
+
$.post( {
|
133 |
Â
url: sowbBlockEditorAdmin.restUrl + 'sowb/v1/widgets/forms',
|
134 |
Â
beforeSend: function ( xhr ) {
|
135 |
Â
xhr.setRequestHeader( 'X-WP-Nonce', sowbBlockEditorAdmin.nonce );
|
156 |
Â
IconButton,
|
157 |
Â
{
|
158 |
Â
className: 'components-icon-button components-toolbar__control',
|
159 |
+
label: __( 'Preview widget.', 'so-widgets-bundle' ),
|
160 |
Â
onClick: switchToPreview,
|
161 |
Â
icon: 'visibility'
|
162 |
Â
}
|
168 |
Â
{
|
169 |
Â
key: 'placeholder',
|
170 |
Â
className: 'so-widget-placeholder',
|
171 |
+
label: __( 'SiteOrigin Widget', 'so-widgets-bundle' ),
|
172 |
+
instructions: __( 'Select the type of widget you want to use:', 'so-widgets-bundle' )
|
173 |
Â
},
|
174 |
+
( props.loadingWidgets || loadWidgetForm ?
|
175 |
Â
el( Spinner ) :
|
176 |
Â
el(
|
177 |
Â
'div',
|
195 |
Â
];
|
196 |
Â
} else {
|
197 |
Â
|
198 |
+
var loadWidgetPreview = ! props.loadingWidgets && ! props.editing && ! props.widgetPreviewHtml && props.attributes.widgetClass;
|
199 |
+
if ( loadWidgetPreview ) {
|
200 |
+
$.post( {
|
201 |
Â
url: sowbBlockEditorAdmin.restUrl + 'sowb/v1/widgets/previews',
|
202 |
Â
beforeSend: function ( xhr ) {
|
203 |
Â
xhr.setRequestHeader( 'X-WP-Nonce', sowbBlockEditorAdmin.nonce );
|
208 |
Â
}
|
209 |
Â
} )
|
210 |
Â
.then( function( widgetPreview ) {
|
211 |
+
props.setState( {
|
212 |
+
widgetPreviewHtml: widgetPreview,
|
213 |
+
previewInitialized: false,
|
214 |
+
} );
|
215 |
Â
} );
|
216 |
Â
}
|
217 |
Â
var widgetPreview = props.widgetPreviewHtml ? props.widgetPreviewHtml : '';
|
226 |
Â
IconButton,
|
227 |
Â
{
|
228 |
Â
className: 'components-icon-button components-toolbar__control',
|
229 |
+
label: __( 'Edit widget.', 'so-widgets-bundle' ),
|
230 |
Â
onClick: switchToEditing,
|
231 |
Â
icon: 'edit'
|
232 |
Â
}
|
239 |
Â
key: 'preview',
|
240 |
Â
className: 'so-widget-preview-container'
|
241 |
Â
},
|
242 |
+
( loadWidgetPreview ?
|
243 |
Â
el( 'div', {
|
244 |
Â
className: 'so-widgets-spinner-container'
|
245 |
Â
},
|
compat/block-editor/widget-block.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(e,t,i,n,o,s){var
|
1 |
+
!function(e,t,i,n,o,s){var a=n.createElement,d=t.registerBlockType,r=e.BlockControls,l=o.SelectControl,w=s.withState,g=o.Toolbar,c=o.IconButton,u=o.Placeholder,m=o.Spinner,b=i.__;d("sowb/widget-block",{title:b("SiteOrigin Widget (in beta)","so-widgets-bundle"),description:b("Select a SiteOrigin widget from the dropdown.","so-widgets-bundle"),icon:function(){return a("span",{className:"widget-icon so-widget-icon so-block-editor-icon"})},category:"widgets",supports:{html:!1},attributes:{widgetClass:{type:"string"},widgetData:{type:"object"}},edit:w({editing:!1,formInitialized:!1,previewInitialized:!1,widgetFormHtml:"",widgetSettingsChanged:!1,widgetPreviewHtml:""})(function(i){function n(){i.setState({editing:!1,previewInitialized:!1})}if(i.editing||!i.attributes.widgetClass){var e=[];sowbBlockEditorAdmin.widgets&&(sowbBlockEditorAdmin.widgets.sort(function(e,t){return e.name<t.name?-1:e.name>t.name?1:0}),(e=sowbBlockEditorAdmin.widgets.map(function(e){return{value:e.class,label:e.name}})).unshift({value:"",label:b("Select widget type","so-widgets-bundle")}));var t=i.attributes.widgetClass&&!i.widgetFormHtml;t&&$.post({url:sowbBlockEditorAdmin.restUrl+"sowb/v1/widgets/forms",beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",sowbBlockEditorAdmin.nonce)},data:{widgetClass:i.attributes.widgetClass}}).then(function(e){i.setState({widgetFormHtml:e})});var o=i.widgetFormHtml?i.widgetFormHtml:"";return[!!o&&a(r,{key:"controls"},a(g,null,a(c,{className:"components-icon-button components-toolbar__control",label:b("Preview widget.","so-widgets-bundle"),onClick:n,icon:"visibility"}))),a(u,{key:"placeholder",className:"so-widget-placeholder",label:b("SiteOrigin Widget","so-widgets-bundle"),instructions:b("Select the type of widget you want to use:","so-widgets-bundle")},i.loadingWidgets||t?a(m):a("div",{className:"so-widget-block-container"},a(l,{options:e,value:i.attributes.widgetClass,onChange:function(e){if(""!==e){if(i.widgetSettingsChanged&&!confirm(sowbBlockEditorAdmin.confirmChangeWidget))return!1;i.setAttributes({widgetClass:e,widgetData:null}),i.setState({editing:!0,widgetFormHtml:null,formInitialized:!1,widgetSettingsChanged:!1,widgetPreviewHtml:null,previewInitialized:!1})}}}),a("div",{className:"so-widget-block-form-container",dangerouslySetInnerHTML:{__html:o},ref:function(e){var t=$(e).find(".siteorigin-widget-form-main");0<t.length&&!i.formInitialized&&(t.siblings(".siteorigin-widget-preview").find("> a").on("click",function(e){e.stopImmediatePropagation(),n()}),t.data("backupDisabled",!0),t.sowSetupForm(),i.attributes.widgetData?sowbForms.setWidgetFormValues(t,i.attributes.widgetData):i.setAttributes({widgetData:sowbForms.getWidgetFormValues(t)}),t.on("change",function(){i.setAttributes({widgetData:sowbForms.getWidgetFormValues(t)}),i.setState({widgetSettingsChanged:!0,widgetPreviewHtml:null,previewInitialized:!1})}),i.setState({formInitialized:!0}))}})))]}var s=!i.loadingWidgets&&!i.editing&&!i.widgetPreviewHtml&&i.attributes.widgetClass;s&&$.post({url:sowbBlockEditorAdmin.restUrl+"sowb/v1/widgets/previews",beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",sowbBlockEditorAdmin.nonce)},data:{widgetClass:i.attributes.widgetClass,widgetData:i.attributes.widgetData||{}}}).then(function(e){i.setState({widgetPreviewHtml:e,previewInitialized:!1})});var d=i.widgetPreviewHtml?i.widgetPreviewHtml:"";return[a(r,{key:"controls"},a(g,null,a(c,{className:"components-icon-button components-toolbar__control",label:b("Edit widget.","so-widgets-bundle"),onClick:function(){i.setState({editing:!0,formInitialized:!1})},icon:"edit"}))),a("div",{key:"preview",className:"so-widget-preview-container"},s?a("div",{className:"so-widgets-spinner-container"},a("span",null,a(m))):a("div",{dangerouslySetInnerHTML:{__html:d},ref:function(){i.previewInitialized||($(window.sowb).trigger("setup_widgets"),i.setState({previewInitialized:!0}))}}))]}),save:function(){return null}})}(window.wp.editor,window.wp.blocks,window.wp.i18n,window.wp.element,window.wp.components,window.wp.compose);
|
compat/block-editor/widget-block.php
CHANGED
@@ -30,15 +30,31 @@ class SiteOrigin_Widgets_Bundle_Widget_Block {
|
|
30 |
Â
array( 'wp-editor', 'wp-blocks', 'wp-i18n', 'wp-element', 'wp-components', 'wp-compose' ),
|
31 |
Â
SOW_BUNDLE_VERSION
|
32 |
Â
);
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
33 |
Â
wp_localize_script(
|
34 |
Â
'sowb-widget-block',
|
35 |
Â
'sowbBlockEditorAdmin',
|
36 |
Â
array(
|
Â
|
|
37 |
Â
'restUrl' => esc_url_raw( rest_url() ),
|
38 |
Â
'nonce' => wp_create_nonce( 'wp_rest' ),
|
39 |
Â
'confirmChangeWidget' => __( 'Selecting a different widget will revert any changes. Continue?', 'so-widgets-bundle' ),
|
40 |
Â
)
|
41 |
Â
);
|
Â
|
|
Â
|
|
Â
|
|
42 |
Â
|
43 |
Â
$so_widgets_bundle = SiteOrigin_Widgets_Bundle::single();
|
44 |
Â
// This is to ensure necessary scripts can be enqueued for previews.
|
@@ -62,11 +78,13 @@ class SiteOrigin_Widgets_Bundle_Widget_Block {
|
|
62 |
Â
$instance = $attributes['widgetData'];
|
63 |
Â
|
64 |
Â
if ( ! empty( $widget ) && is_object( $widget ) && is_subclass_of( $widget, 'SiteOrigin_Widget' ) ) {
|
Â
|
|
65 |
Â
ob_start();
|
66 |
Â
/* @var $widget SiteOrigin_Widget */
|
67 |
Â
$instance = $widget->update( $instance, $instance );
|
68 |
Â
$widget->widget( array(), $instance );
|
69 |
Â
$rendered_widget = ob_get_clean();
|
Â
|
|
70 |
Â
} else {
|
71 |
Â
return '<div>'.
|
72 |
Â
sprintf(
|
30 |
Â
array( 'wp-editor', 'wp-blocks', 'wp-i18n', 'wp-element', 'wp-components', 'wp-compose' ),
|
31 |
Â
SOW_BUNDLE_VERSION
|
32 |
Â
);
|
33 |
+
|
34 |
+
global $wp_widget_factory;
|
35 |
+
$so_widgets = array();
|
36 |
+
foreach ( $wp_widget_factory->widgets as $class => $widget_obj ) {
|
37 |
+
if ( ! empty( $widget_obj ) && is_object( $widget_obj ) && is_subclass_of( $widget_obj, 'SiteOrigin_Widget' ) ) {
|
38 |
+
$so_widgets[] = array(
|
39 |
+
'name' => preg_replace( '/^SiteOrigin /', '', $widget_obj->name ),
|
40 |
+
'class' => $class,
|
41 |
+
);
|
42 |
+
}
|
43 |
+
}
|
44 |
+
|
45 |
Â
wp_localize_script(
|
46 |
Â
'sowb-widget-block',
|
47 |
Â
'sowbBlockEditorAdmin',
|
48 |
Â
array(
|
49 |
+
'widgets' => $so_widgets,
|
50 |
Â
'restUrl' => esc_url_raw( rest_url() ),
|
51 |
Â
'nonce' => wp_create_nonce( 'wp_rest' ),
|
52 |
Â
'confirmChangeWidget' => __( 'Selecting a different widget will revert any changes. Continue?', 'so-widgets-bundle' ),
|
53 |
Â
)
|
54 |
Â
);
|
55 |
+
if ( function_exists( 'wp_set_script_translations' ) ) {
|
56 |
+
wp_set_script_translations( 'sowb-widget-block', 'so-widgets-bundle' );
|
57 |
+
}
|
58 |
Â
|
59 |
Â
$so_widgets_bundle = SiteOrigin_Widgets_Bundle::single();
|
60 |
Â
// This is to ensure necessary scripts can be enqueued for previews.
|
78 |
Â
$instance = $attributes['widgetData'];
|
79 |
Â
|
80 |
Â
if ( ! empty( $widget ) && is_object( $widget ) && is_subclass_of( $widget, 'SiteOrigin_Widget' ) ) {
|
81 |
+
$GLOBALS['SITEORIGIN_WIDGET_BLOCK_RENDER'] = true;
|
82 |
Â
ob_start();
|
83 |
Â
/* @var $widget SiteOrigin_Widget */
|
84 |
Â
$instance = $widget->update( $instance, $instance );
|
85 |
Â
$widget->widget( array(), $instance );
|
86 |
Â
$rendered_widget = ob_get_clean();
|
87 |
+
unset( $GLOBALS['SITEORIGIN_WIDGET_BLOCK_RENDER'] );
|
88 |
Â
} else {
|
89 |
Â
return '<div>'.
|
90 |
Â
sprintf(
|
compat/elementor/sowb-elementor.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var sowb=window.sowb||{}
|
1 |
+
var sowb=window.sowb||{};jQuery(window).on("elementor:init",function(){elementor.on("preview:loaded",function(){var e,n=elementor.$preview.get(0).contentWindow,o=n.jQuery(n.sowb);elementorFrontend.hooks.addAction("frontend/element_ready/widget",function(){e&&clearTimeout(e),e=setTimeout(function(){o.trigger("setup_widgets"),e=null},300)})})});
|
compat/visual-composer/sowb-vc-widget.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var sowbForms=window.sowbForms||{};sowbForms.setupVcWidgetForm=function(){var
|
1 |
+
var sowbForms=window.sowbForms||{};sowbForms.setupVcWidgetForm=function(){var n,t=jQuery,i=t('[name="so_widget_class"]'),r=t(".siteorigin_widget_form_container"),s=!1;r.on("change",".siteorigin-widget-field",function(){s=!0;var e=sowbForms.getWidgetFormValues(r),o=i.val(),n=JSON.stringify({widget_class:o,widget_data:e});n=n.replace(/\\/g,"\\\\"),t('[name="so_widget_data"]').val(n)}),i.mousedown(function(){n=i.find("option:selected")}),i.on("change",function(e){if(!s||confirm(soWidgetsVC.confirmChangeWidget)){s=!1;var o={action:"sowb_vc_widget_render_form",widget:i.val()};t.post(soWidgetsVC.ajaxUrl,o,function(e){r.html(e),r.trigger("change")},"html")}else n.attr("selected",!0)}),vc.atts.sowb_json_escaped={parse:function(e){var o=this.content().find(".wpb_vc_param_value[name="+e.param_name+"]");return _.escape(_.escape(o.val().toString()).replace(/\[/g,"[").replace(/\]/g,"]"))},render:function(e,o){return _.unescape(_.unescape(o)).replace(/[/g,"[").replace(/]/g,"]")}},vc.events.on("shortcodeView:updated:siteorigin_widget_vc",function(){void 0!==vc.frame_window&&void 0!==vc.frame_window.sowb&&(0,vc.frame_window.jQuery)(vc.frame_window.sowb).trigger("setup_widgets")})},jQuery(function(e){sowbForms.setupVcWidgetForm()}),window.sowbForms=sowbForms;
|
icons/fontawesome/filter.php
CHANGED
@@ -1,793 +1,793 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
function siteorigin_widgets_icons_fontawesome_filter( $icons ){
|
4 |
-
return array_merge($icons, array(
|
5 |
-
'500px' => '',
|
6 |
-
'address-book' => '',
|
7 |
-
'address-book-o' => '',
|
8 |
-
'address-card' => '',
|
9 |
-
'address-card-o' => '',
|
10 |
-
'adjust' => '',
|
11 |
-
'adn' => '',
|
12 |
-
'align-center' => '',
|
13 |
-
'align-justify' => '',
|
14 |
-
'align-left' => '',
|
15 |
-
'align-right' => '',
|
16 |
-
'amazon' => '',
|
17 |
-
'ambulance' => '',
|
18 |
-
'american-sign-language-interpreting' => '',
|
19 |
-
'anchor' => '',
|
20 |
-
'android' => '',
|
21 |
-
'angellist' => '',
|
22 |
-
'angle-double-down' => '',
|
23 |
-
'angle-double-left' => '',
|
24 |
-
'angle-double-right' => '',
|
25 |
-
'angle-double-up' => '',
|
26 |
-
'angle-down' => '',
|
27 |
-
'angle-left' => '',
|
28 |
-
'angle-right' => '',
|
29 |
-
'angle-up' => '',
|
30 |
-
'apple' => '',
|
31 |
-
'archive' => '',
|
32 |
-
'area-chart' => '',
|
33 |
-
'arrow-circle-down' => '',
|
34 |
-
'arrow-circle-left' => '',
|
35 |
-
'arrow-circle-o-down' => '',
|
36 |
-
'arrow-circle-o-left' => '',
|
37 |
-
'arrow-circle-o-right' => '',
|
38 |
-
'arrow-circle-o-up' => '',
|
39 |
-
'arrow-circle-right' => '',
|
40 |
-
'arrow-circle-up' => '',
|
41 |
-
'arrow-down' => '',
|
42 |
-
'arrow-left' => '',
|
43 |
-
'arrow-right' => '',
|
44 |
-
'arrow-up' => '',
|
45 |
-
'arrows' => '',
|
46 |
-
'arrows-alt' => '',
|
47 |
-
'arrows-h' => '',
|
48 |
-
'arrows-v' => '',
|
49 |
-
'asl-interpreting' => '',
|
50 |
-
'assistive-listening-systems' => '',
|
51 |
-
'asterisk' => '',
|
52 |
-
'at' => '',
|
53 |
-
'audio-description' => '',
|
54 |
-
'automobile' => '',
|
55 |
-
'backward' => '',
|
56 |
-
'balance-scale' => '',
|
57 |
-
'ban' => '',
|
58 |
-
'bandcamp' => '',
|
59 |
-
'bank' => '',
|
60 |
-
'bar-chart' => '',
|
61 |
-
'bar-chart-o' => '',
|
62 |
-
'barcode' => '',
|
63 |
-
'bars' => '',
|
64 |
-
'bath' => '',
|
65 |
-
'bathtub' => '',
|
66 |
-
'battery' => '',
|
67 |
-
'battery-0' => '',
|
68 |
-
'battery-1' => '',
|
69 |
-
'battery-2' => '',
|
70 |
-
'battery-3' => '',
|
71 |
-
'battery-4' => '',
|
72 |
-
'battery-empty' => '',
|
73 |
-
'battery-full' => '',
|
74 |
-
'battery-half' => '',
|
75 |
-
'battery-quarter' => '',
|
76 |
-
'battery-three-quarters' => '',
|
77 |
-
'bed' => '',
|
78 |
-
'beer' => '',
|
79 |
-
'behance' => '',
|
80 |
-
'behance-square' => '',
|
81 |
-
'bell' => '',
|
82 |
-
'bell-o' => '',
|
83 |
-
'bell-slash' => '',
|
84 |
-
'bell-slash-o' => '',
|
85 |
-
'bicycle' => '',
|
86 |
-
'binoculars' => '',
|
87 |
-
'birthday-cake' => '',
|
88 |
-
'bitbucket' => '',
|
89 |
-
'bitbucket-square' => '',
|
90 |
-
'bitcoin' => '',
|
91 |
-
'black-tie' => '',
|
92 |
-
'blind' => '',
|
93 |
-
'bluetooth' => '',
|
94 |
-
'bluetooth-b' => '',
|
95 |
-
'bold' => '',
|
96 |
-
'bolt' => '',
|
97 |
-
'bomb' => '',
|
98 |
-
'book' => '',
|
99 |
-
'bookmark' => '',
|
100 |
-
'bookmark-o' => '',
|
101 |
-
'braille' => '',
|
102 |
-
'briefcase' => '',
|
103 |
-
'btc' => '',
|
104 |
-
'bug' => '',
|
105 |
-
'building' => '',
|
106 |
-
'building-o' => '',
|
107 |
-
'bullhorn' => '',
|
108 |
-
'bullseye' => '',
|
109 |
-
'bus' => '',
|
110 |
-
'buysellads' => '',
|
111 |
-
'cab' => '',
|
112 |
-
'calculator' => '',
|
113 |
-
'calendar' => '',
|
114 |
-
'calendar-check-o' => '',
|
115 |
-
'calendar-minus-o' => '',
|
116 |
-
'calendar-o' => '',
|
117 |
-
'calendar-plus-o' => '',
|
118 |
-
'calendar-times-o' => '',
|
119 |
-
'camera' => '',
|
120 |
-
'camera-retro' => '',
|
121 |
-
'car' => '',
|
122 |
-
'caret-down' => '',
|
123 |
-
'caret-left' => '',
|
124 |
-
'caret-right' => '',
|
125 |
-
'caret-square-o-down' => '',
|
126 |
-
'caret-square-o-left' => '',
|
127 |
-
'caret-square-o-right' => '',
|
128 |
-
'caret-square-o-up' => '',
|
129 |
-
'caret-up' => '',
|
130 |
-
'cart-arrow-down' => '',
|
131 |
-
'cart-plus' => '',
|
132 |
-
'cc' => '',
|
133 |
-
'cc-amex' => '',
|
134 |
-
'cc-diners-club' => '',
|
135 |
-
'cc-discover' => '',
|
136 |
-
'cc-jcb' => '',
|
137 |
-
'cc-mastercard' => '',
|
138 |
-
'cc-paypal' => '',
|
139 |
-
'cc-stripe' => '',
|
140 |
-
'cc-visa' => '',
|
141 |
-
'certificate' => '',
|
142 |
-
'chain' => '',
|
143 |
-
'chain-broken' => '',
|
144 |
-
'check' => '',
|
145 |
-
'check-circle' => '',
|
146 |
-
'check-circle-o' => '',
|
147 |
-
'check-square' => '',
|
148 |
-
'check-square-o' => '',
|
149 |
-
'chevron-circle-down' => '',
|
150 |
-
'chevron-circle-left' => '',
|
151 |
-
'chevron-circle-right' => '',
|
152 |
-
'chevron-circle-up' => '',
|
153 |
-
'chevron-down' => '',
|
154 |
-
'chevron-left' => '',
|
155 |
-
'chevron-right' => '',
|
156 |
-
'chevron-up' => '',
|
157 |
-
'child' => '',
|
158 |
-
'chrome' => '',
|
159 |
-
'circle' => '',
|
160 |
-
'circle-o' => '',
|
161 |
-
'circle-o-notch' => '',
|
162 |
-
'circle-thin' => '',
|
163 |
-
'clipboard' => '',
|
164 |
-
'clock-o' => '',
|
165 |
-
'clone' => '',
|
166 |
-
'close' => '',
|
167 |
-
'cloud' => '',
|
168 |
-
'cloud-download' => '',
|
169 |
-
'cloud-upload' => '',
|
170 |
-
'cny' => '',
|
171 |
-
'code' => '',
|
172 |
-
'code-fork' => '',
|
173 |
-
'codepen' => '',
|
174 |
-
'codiepie' => '',
|
175 |
-
'coffee' => '',
|
176 |
-
'cog' => '',
|
177 |
-
'cogs' => '',
|
178 |
-
'columns' => '',
|
179 |
-
'comment' => '',
|
180 |
-
'comment-o' => '',
|
181 |
-
'commenting' => '',
|
182 |
-
'commenting-o' => '',
|
183 |
-
'comments' => '',
|
184 |
-
'comments-o' => '',
|
185 |
-
'compass' => '',
|
186 |
-
'compress' => '',
|
187 |
-
'connectdevelop' => '',
|
188 |
-
'contao' => '',
|
189 |
-
'copy' => '',
|
190 |
-
'copyright' => '',
|
191 |
-
'creative-commons' => '',
|
192 |
-
'credit-card' => '',
|
193 |
-
'credit-card-alt' => '',
|
194 |
-
'crop' => '',
|
195 |
-
'crosshairs' => '',
|
196 |
-
'css3' => '',
|
197 |
-
'cube' => '',
|
198 |
-
'cubes' => '',
|
199 |
-
'cut' => '',
|
200 |
-
'cutlery' => '',
|
201 |
-
'dashboard' => '',
|
202 |
-
'dashcube' => '',
|
203 |
-
'database' => '',
|
204 |
-
'deaf' => '',
|
205 |
-
'deafness' => '',
|
206 |
-
'dedent' => '',
|
207 |
-
'delicious' => '',
|
208 |
-
'desktop' => '',
|
209 |
-
'deviantart' => '',
|
210 |
-
'diamond' => '',
|
211 |
-
'digg' => '',
|
212 |
-
'dollar' => '',
|
213 |
-
'dot-circle-o' => '',
|
214 |
-
'download' => '',
|
215 |
-
'dribbble' => '',
|
216 |
-
'drivers-license' => '',
|
217 |
-
'drivers-license-o' => '',
|
218 |
-
'dropbox' => '',
|
219 |
-
'drupal' => '',
|
220 |
-
'edge' => '',
|
221 |
-
'edit' => '',
|
222 |
-
'eercast' => '',
|
223 |
-
'eject' => '',
|
224 |
-
'ellipsis-h' => '',
|
225 |
-
'ellipsis-v' => '',
|
226 |
-
'empire' => '',
|
227 |
-
'envelope' => '',
|
228 |
-
'envelope-o' => '',
|
229 |
-
'envelope-open' => '',
|
230 |
-
'envelope-open-o' => '',
|
231 |
-
'envelope-square' => '',
|
232 |
-
'envira' => '',
|
233 |
-
'eraser' => '',
|
234 |
-
'etsy' => '',
|
235 |
-
'eur' => '',
|
236 |
-
'euro' => '',
|
237 |
-
'exchange' => '',
|
238 |
-
'exclamation' => '',
|
239 |
-
'exclamation-circle' => '',
|
240 |
-
'exclamation-triangle' => '',
|
241 |
-
'expand' => '',
|
242 |
-
'expeditedssl' => '',
|
243 |
-
'external-link' => '',
|
244 |
-
'external-link-square' => '',
|
245 |
-
'eye' => '',
|
246 |
-
'eye-slash' => '',
|
247 |
-
'eyedropper' => '',
|
248 |
-
'fa' => '',
|
249 |
-
'facebook' => '',
|
250 |
-
'facebook-f' => '',
|
251 |
-
'facebook-official' => '',
|
252 |
-
'facebook-square' => '',
|
253 |
-
'fast-backward' => '',
|
254 |
-
'fast-forward' => '',
|
255 |
-
'fax' => '',
|
256 |
-
'feed' => '',
|
257 |
-
'female' => '',
|
258 |
-
'fighter-jet' => '',
|
259 |
-
'file' => '',
|
260 |
-
'file-archive-o' => '',
|
261 |
-
'file-audio-o' => '',
|
262 |
-
'file-code-o' => '',
|
263 |
-
'file-excel-o' => '',
|
264 |
-
'file-image-o' => '',
|
265 |
-
'file-movie-o' => '',
|
266 |
-
'file-o' => '',
|
267 |
-
'file-pdf-o' => '',
|
268 |
-
'file-photo-o' => '',
|
269 |
-
'file-picture-o' => '',
|
270 |
-
'file-powerpoint-o' => '',
|
271 |
-
'file-sound-o' => '',
|
272 |
-
'file-text' => '',
|
273 |
-
'file-text-o' => '',
|
274 |
-
'file-video-o' => '',
|
275 |
-
'file-word-o' => '',
|
276 |
-
'file-zip-o' => '',
|
277 |
-
'files-o' => '',
|
278 |
-
'film' => '',
|
279 |
-
'filter' => '',
|
280 |
-
'fire' => '',
|
281 |
-
'fire-extinguisher' => '',
|
282 |
-
'firefox' => '',
|
283 |
-
'first-order' => '',
|
284 |
-
'flag' => '',
|
285 |
-
'flag-checkered' => '',
|
286 |
-
'flag-o' => '',
|
287 |
-
'flash' => '',
|
288 |
-
'flask' => '',
|
289 |
-
'flickr' => '',
|
290 |
-
'floppy-o' => '',
|
291 |
-
'folder' => '',
|
292 |
-
'folder-o' => '',
|
293 |
-
'folder-open' => '',
|
294 |
-
'folder-open-o' => '',
|
295 |
-
'font' => '',
|
296 |
-
'font-awesome' => '',
|
297 |
-
'fonticons' => '',
|
298 |
-
'fort-awesome' => '',
|
299 |
-
'forumbee' => '',
|
300 |
-
'forward' => '',
|
301 |
-
'foursquare' => '',
|
302 |
-
'free-code-camp' => '',
|
303 |
-
'frown-o' => '',
|
304 |
-
'futbol-o' => '',
|
305 |
-
'gamepad' => '',
|
306 |
-
'gavel' => '',
|
307 |
-
'gbp' => '',
|
308 |
-
'ge' => '',
|
309 |
-
'gear' => '',
|
310 |
-
'gears' => '',
|
311 |
-
'genderless' => '',
|
312 |
-
'get-pocket' => '',
|
313 |
-
'gg' => '',
|
314 |
-
'gg-circle' => '',
|
315 |
-
'gift' => '',
|
316 |
-
'git' => '',
|
317 |
-
'git-square' => '',
|
318 |
-
'github' => '',
|
319 |
-
'github-alt' => '',
|
320 |
-
'github-square' => '',
|
321 |
-
'gitlab' => '',
|
322 |
-
'gittip' => '',
|
323 |
-
'glass' => '',
|
324 |
-
'glide' => '',
|
325 |
-
'glide-g' => '',
|
326 |
-
'globe' => '',
|
327 |
-
'google' => '',
|
328 |
-
'google-plus' => '',
|
329 |
-
'google-plus-circle' => '',
|
330 |
-
'google-plus-official' => '',
|
331 |
-
'google-plus-square' => '',
|
332 |
-
'google-wallet' => '',
|
333 |
-
'graduation-cap' => '',
|
334 |
-
'gratipay' => '',
|
335 |
-
'grav' => '',
|
336 |
-
'group' => '',
|
337 |
-
'h-square' => '',
|
338 |
-
'hacker-news' => '',
|
339 |
-
'hand-grab-o' => '',
|
340 |
-
'hand-lizard-o' => '',
|
341 |
-
'hand-o-down' => '',
|
342 |
-
'hand-o-left' => '',
|
343 |
-
'hand-o-right' => '',
|
344 |
-
'hand-o-up' => '',
|
345 |
-
'hand-paper-o' => '',
|
346 |
-
'hand-peace-o' => '',
|
347 |
-
'hand-pointer-o' => '',
|
348 |
-
'hand-rock-o' => '',
|
349 |
-
'hand-scissors-o' => '',
|
350 |
-
'hand-spock-o' => '',
|
351 |
-
'hand-stop-o' => '',
|
352 |
-
'handshake-o' => '',
|
353 |
-
'hard-of-hearing' => '',
|
354 |
-
'hashtag' => '',
|
355 |
-
'hdd-o' => '',
|
356 |
-
'header' => '',
|
357 |
-
'headphones' => '',
|
358 |
-
'heart' => '',
|
359 |
-
'heart-o' => '',
|
360 |
-
'heartbeat' => '',
|
361 |
-
'history' => '',
|
362 |
-
'home' => '',
|
363 |
-
'hospital-o' => '',
|
364 |
-
'hotel' => '',
|
365 |
-
'hourglass' => '',
|
366 |
-
'hourglass-1' => '',
|
367 |
-
'hourglass-2' => '',
|
368 |
-
'hourglass-3' => '',
|
369 |
-
'hourglass-end' => '',
|
370 |
-
'hourglass-half' => '',
|
371 |
-
'hourglass-o' => '',
|
372 |
-
'hourglass-start' => '',
|
373 |
-
'houzz' => '',
|
374 |
-
'html5' => '',
|
375 |
-
'i-cursor' => '',
|
376 |
-
'id-badge' => '',
|
377 |
-
'id-card' => '',
|
378 |
-
'id-card-o' => '',
|
379 |
-
'ils' => '',
|
380 |
-
'image' => '',
|
381 |
-
'imdb' => '',
|
382 |
-
'inbox' => '',
|
383 |
-
'indent' => '',
|
384 |
-
'industry' => '',
|
385 |
-
'info' => '',
|
386 |
-
'info-circle' => '',
|
387 |
-
'inr' => '',
|
388 |
-
'instagram' => '',
|
389 |
-
'institution' => '',
|
390 |
-
'internet-explorer' => '',
|
391 |
-
'intersex' => '',
|
392 |
-
'ioxhost' => '',
|
393 |
-
'italic' => '',
|
394 |
-
'joomla' => '',
|
395 |
-
'jpy' => '',
|
396 |
-
'jsfiddle' => '',
|
397 |
-
'key' => '',
|
398 |
-
'keyboard-o' => '',
|
399 |
-
'krw' => '',
|
400 |
-
'language' => '',
|
401 |
-
'laptop' => '',
|
402 |
-
'lastfm' => '',
|
403 |
-
'lastfm-square' => '',
|
404 |
-
'leaf' => '',
|
405 |
-
'leanpub' => '',
|
406 |
-
'legal' => '',
|
407 |
-
'lemon-o' => '',
|
408 |
-
'level-down' => '',
|
409 |
-
'level-up' => '',
|
410 |
-
'life-bouy' => '',
|
411 |
-
'life-buoy' => '',
|
412 |
-
'life-ring' => '',
|
413 |
-
'life-saver' => '',
|
414 |
-
'lightbulb-o' => '',
|
415 |
-
'line-chart' => '',
|
416 |
-
'link' => '',
|
417 |
-
'linkedin' => '',
|
418 |
-
'linkedin-square' => '',
|
419 |
-
'linode' => '',
|
420 |
-
'linux' => '',
|
421 |
-
'list' => '',
|
422 |
-
'list-alt' => '',
|
423 |
-
'list-ol' => '',
|
424 |
-
'list-ul' => '',
|
425 |
-
'location-arrow' => '',
|
426 |
-
'lock' => '',
|
427 |
-
'long-arrow-down' => '',
|
428 |
-
'long-arrow-left' => '',
|
429 |
-
'long-arrow-right' => '',
|
430 |
-
'long-arrow-up' => '',
|
431 |
-
'low-vision' => '',
|
432 |
-
'magic' => '',
|
433 |
-
'magnet' => '',
|
434 |
-
'mail-forward' => '',
|
435 |
-
'mail-reply' => '',
|
436 |
-
'mail-reply-all' => '',
|
437 |
-
'male' => '',
|
438 |
-
'map' => '',
|
439 |
-
'map-marker' => '',
|
440 |
-
'map-o' => '',
|
441 |
-
'map-pin' => '',
|
442 |
-
'map-signs' => '',
|
443 |
-
'mars' => '',
|
444 |
-
'mars-double' => '',
|
445 |
-
'mars-stroke' => '',
|
446 |
-
'mars-stroke-h' => '',
|
447 |
-
'mars-stroke-v' => '',
|
448 |
-
'maxcdn' => '',
|
449 |
-
'meanpath' => '',
|
450 |
-
'medium' => '',
|
451 |
-
'medkit' => '',
|
452 |
-
'meetup' => '',
|
453 |
-
'meh-o' => '',
|
454 |
-
'mercury' => '',
|
455 |
-
'microchip' => '',
|
456 |
-
'microphone' => '',
|
457 |
-
'microphone-slash' => '',
|
458 |
-
'minus' => '',
|
459 |
-
'minus-circle' => '',
|
460 |
-
'minus-square' => '',
|
461 |
-
'minus-square-o' => '',
|
462 |
-
'mixcloud' => '',
|
463 |
-
'mobile' => '',
|
464 |
-
'mobile-phone' => '',
|
465 |
-
'modx' => '',
|
466 |
-
'money' => '',
|
467 |
-
'moon-o' => '',
|
468 |
-
'mortar-board' => '',
|
469 |
-
'motorcycle' => '',
|
470 |
-
'mouse-pointer' => '',
|
471 |
-
'music' => '',
|
472 |
-
'navicon' => '',
|
473 |
-
'neuter' => '',
|
474 |
-
'newspaper-o' => '',
|
475 |
-
'object-group' => '',
|
476 |
-
'object-ungroup' => '',
|
477 |
-
'odnoklassniki' => '',
|
478 |
-
'odnoklassniki-square' => '',
|
479 |
-
'opencart' => '',
|
480 |
-
'openid' => '',
|
481 |
-
'opera' => '',
|
482 |
-
'optin-monster' => '',
|
483 |
-
'outdent' => '',
|
484 |
-
'pagelines' => '',
|
485 |
-
'paint-brush' => '',
|
486 |
-
'paper-plane' => '',
|
487 |
-
'paper-plane-o' => '',
|
488 |
-
'paperclip' => '',
|
489 |
-
'paragraph' => '',
|
490 |
-
'paste' => '',
|
491 |
-
'pause' => '',
|
492 |
-
'pause-circle' => '',
|
493 |
-
'pause-circle-o' => '',
|
494 |
-
'paw' => '',
|
495 |
-
'paypal' => '',
|
496 |
-
'pencil' => '',
|
497 |
-
'pencil-square' => '',
|
498 |
-
'pencil-square-o' => '',
|
499 |
-
'percent' => '',
|
500 |
-
'phone' => '',
|
501 |
-
'phone-square' => '',
|
502 |
-
'photo' => '',
|
503 |
-
'picture-o' => '',
|
504 |
-
'pie-chart' => '',
|
505 |
-
'pied-piper' => '',
|
506 |
-
'pied-piper-alt' => '',
|
507 |
-
'pied-piper-pp' => '',
|
508 |
-
'pinterest' => '',
|
509 |
-
'pinterest-p' => '',
|
510 |
-
'pinterest-square' => '',
|
511 |
-
'plane' => '',
|
512 |
-
'play' => '',
|
513 |
-
'play-circle' => '',
|
514 |
-
'play-circle-o' => '',
|
515 |
-
'plug' => '',
|
516 |
-
'plus' => '',
|
517 |
-
'plus-circle' => '',
|
518 |
-
'plus-square' => '',
|
519 |
-
'plus-square-o' => '',
|
520 |
-
'podcast' => '',
|
521 |
-
'power-off' => '',
|
522 |
-
'print' => '',
|
523 |
-
'product-hunt' => '',
|
524 |
-
'puzzle-piece' => '',
|
525 |
-
'qq' => '',
|
526 |
-
'qrcode' => '',
|
527 |
-
'question' => '',
|
528 |
-
'question-circle' => '',
|
529 |
-
'question-circle-o' => '',
|
530 |
-
'quora' => '',
|
531 |
-
'quote-left' => '',
|
532 |
-
'quote-right' => '',
|
533 |
-
'ra' => '',
|
534 |
-
'random' => '',
|
535 |
-
'ravelry' => '',
|
536 |
-
'rebel' => '',
|
537 |
-
'recycle' => '',
|
538 |
-
'reddit' => '',
|
539 |
-
'reddit-alien' => '',
|
540 |
-
'reddit-square' => '',
|
541 |
-
'refresh' => '',
|
542 |
-
'registered' => '',
|
543 |
-
'remove' => '',
|
544 |
-
'renren' => '',
|
545 |
-
'reorder' => '',
|
546 |
-
'repeat' => '',
|
547 |
-
'reply' => '',
|
548 |
-
'reply-all' => '',
|
549 |
-
'resistance' => '',
|
550 |
-
'retweet' => '',
|
551 |
-
'rmb' => '',
|
552 |
-
'road' => '',
|
553 |
-
'rocket' => '',
|
554 |
-
'rotate-left' => '',
|
555 |
-
'rotate-right' => '',
|
556 |
-
'rouble' => '',
|
557 |
-
'rss' => '',
|
558 |
-
'rss-square' => '',
|
559 |
-
'rub' => '',
|
560 |
-
'ruble' => '',
|
561 |
-
'rupee' => '',
|
562 |
-
's15' => '',
|
563 |
-
'safari' => '',
|
564 |
-
'save' => '',
|
565 |
-
'scissors' => '',
|
566 |
-
'scribd' => '',
|
567 |
-
'search' => '',
|
568 |
-
'search-minus' => '',
|
569 |
-
'search-plus' => '',
|
570 |
-
'sellsy' => '',
|
571 |
-
'send' => '',
|
572 |
-
'send-o' => '',
|
573 |
-
'server' => '',
|
574 |
-
'share' => '',
|
575 |
-
'share-alt' => '',
|
576 |
-
'share-alt-square' => '',
|
577 |
-
'share-square' => '',
|
578 |
-
'share-square-o' => '',
|
579 |
-
'shekel' => '',
|
580 |
-
'sheqel' => '',
|
581 |
-
'shield' => '',
|
582 |
-
'ship' => '',
|
583 |
-
'shirtsinbulk' => '',
|
584 |
-
'shopping-bag' => '',
|
585 |
-
'shopping-basket' => '',
|
586 |
-
'shopping-cart' => '',
|
587 |
-
'shower' => '',
|
588 |
-
'sign-in' => '',
|
589 |
-
'sign-language' => '',
|
590 |
-
'sign-out' => '',
|
591 |
-
'signal' => '',
|
592 |
-
'signing' => '',
|
593 |
-
'simplybuilt' => '',
|
594 |
-
'sitemap' => '',
|
595 |
-
'skyatlas' => '',
|
596 |
-
'skype' => '',
|
597 |
-
'slack' => '',
|
598 |
-
'sliders' => '',
|
599 |
-
'slideshare' => '',
|
600 |
-
'smile-o' => '',
|
601 |
-
'snapchat' => '',
|
602 |
-
'snapchat-ghost' => '',
|
603 |
-
'snapchat-square' => '',
|
604 |
-
'snowflake-o' => '',
|
605 |
-
'soccer-ball-o' => '',
|
606 |
-
'sort' => '',
|
607 |
-
'sort-alpha-asc' => '',
|
608 |
-
'sort-alpha-desc' => '',
|
609 |
-
'sort-amount-asc' => '',
|
610 |
-
'sort-amount-desc' => '',
|
611 |
-
'sort-asc' => '',
|
612 |
-
'sort-desc' => '',
|
613 |
-
'sort-down' => '',
|
614 |
-
'sort-numeric-asc' => '',
|
615 |
-
'sort-numeric-desc' => '',
|
616 |
-
'sort-up' => '',
|
617 |
-
'soundcloud' => '',
|
618 |
-
'space-shuttle' => '',
|
619 |
-
'spinner' => '',
|
620 |
-
'spoon' => '',
|
621 |
-
'spotify' => '',
|
622 |
-
'square' => '',
|
623 |
-
'square-o' => '',
|
624 |
-
'stack-exchange' => '',
|
625 |
-
'stack-overflow' => '',
|
626 |
-
'star' => '',
|
627 |
-
'star-half' => '',
|
628 |
-
'star-half-empty' => '',
|
629 |
-
'star-half-full' => '',
|
630 |
-
'star-half-o' => '',
|
631 |
-
'star-o' => '',
|
632 |
-
'steam' => '',
|
633 |
-
'steam-square' => '',
|
634 |
-
'step-backward' => '',
|
635 |
-
'step-forward' => '',
|
636 |
-
'stethoscope' => '',
|
637 |
-
'sticky-note' => '',
|
638 |
-
'sticky-note-o' => '',
|
639 |
-
'stop' => '',
|
640 |
-
'stop-circle' => '',
|
641 |
-
'stop-circle-o' => '',
|
642 |
-
'street-view' => '',
|
643 |
-
'strikethrough' => '',
|
644 |
-
'stumbleupon' => '',
|
645 |
-
'stumbleupon-circle' => '',
|
646 |
-
'subscript' => '',
|
647 |
-
'subway' => '',
|
648 |
-
'suitcase' => '',
|
649 |
-
'sun-o' => '',
|
650 |
-
'superpowers' => '',
|
651 |
-
'superscript' => '',
|
652 |
-
'support' => '',
|
653 |
-
'table' => '',
|
654 |
-
'tablet' => '',
|
655 |
-
'tachometer' => '',
|
656 |
-
'tag' => '',
|
657 |
-
'tags' => '',
|
658 |
-
'tasks' => '',
|
659 |
-
'taxi' => '',
|
660 |
-
'telegram' => '',
|
661 |
-
'television' => '',
|
662 |
-
'tencent-weibo' => '',
|
663 |
-
'terminal' => '',
|
664 |
-
'text-height' => '',
|
665 |
-
'text-width' => '',
|
666 |
-
'th' => '',
|
667 |
-
'th-large' => '',
|
668 |
-
'th-list' => '',
|
669 |
-
'themeisle' => '',
|
670 |
-
'thermometer' => '',
|
671 |
-
'thermometer-0' => '',
|
672 |
-
'thermometer-1' => '',
|
673 |
-
'thermometer-2' => '',
|
674 |
-
'thermometer-3' => '',
|
675 |
-
'thermometer-4' => '',
|
676 |
-
'thermometer-empty' => '',
|
677 |
-
'thermometer-full' => '',
|
678 |
-
'thermometer-half' => '',
|
679 |
-
'thermometer-quarter' => '',
|
680 |
-
'thermometer-three-quarters' => '',
|
681 |
-
'thumb-tack' => '',
|
682 |
-
'thumbs-down' => '',
|
683 |
-
'thumbs-o-down' => '',
|
684 |
-
'thumbs-o-up' => '',
|
685 |
-
'thumbs-up' => '',
|
686 |
-
'ticket' => '',
|
687 |
-
'times' => '',
|
688 |
-
'times-circle' => '',
|
689 |
-
'times-circle-o' => '',
|
690 |
-
'times-rectangle' => '',
|
691 |
-
'times-rectangle-o' => '',
|
692 |
-
'tint' => '',
|
693 |
-
'toggle-down' => '',
|
694 |
-
'toggle-left' => '',
|
695 |
-
'toggle-off' => '',
|
696 |
-
'toggle-on' => '',
|
697 |
-
'toggle-right' => '',
|
698 |
-
'toggle-up' => '',
|
699 |
-
'trademark' => '',
|
700 |
-
'train' => '',
|
701 |
-
'transgender' => '',
|
702 |
-
'transgender-alt' => '',
|
703 |
-
'trash' => '',
|
704 |
-
'trash-o' => '',
|
705 |
-
'tree' => '',
|
706 |
-
'trello' => '',
|
707 |
-
'tripadvisor' => '',
|
708 |
-
'trophy' => '',
|
709 |
-
'truck' => '',
|
710 |
-
'try' => '',
|
711 |
-
'tty' => '',
|
712 |
-
'tumblr' => '',
|
713 |
-
'tumblr-square' => '',
|
714 |
-
'turkish-lira' => '',
|
715 |
-
'tv' => '',
|
716 |
-
'twitch' => '',
|
717 |
-
'twitter' => '',
|
718 |
-
'twitter-square' => '',
|
719 |
-
'umbrella' => '',
|
720 |
-
'underline' => '',
|
721 |
-
'undo' => '',
|
722 |
-
'universal-access' => '',
|
723 |
-
'university' => '',
|
724 |
-
'unlink' => '',
|
725 |
-
'unlock' => '',
|
726 |
-
'unlock-alt' => '',
|
727 |
-
'unsorted' => '',
|
728 |
-
'upload' => '',
|
729 |
-
'usb' => '',
|
730 |
-
'usd' => '',
|
731 |
-
'user' => '',
|
732 |
-
'user-circle' => '',
|
733 |
-
'user-circle-o' => '',
|
734 |
-
'user-md' => '',
|
735 |
-
'user-o' => '',
|
736 |
-
'user-plus' => '',
|
737 |
-
'user-secret' => '',
|
738 |
-
'user-times' => '',
|
739 |
-
'users' => '',
|
740 |
-
'vcard' => '',
|
741 |
-
'vcard-o' => '',
|
742 |
-
'venus' => '',
|
743 |
-
'venus-double' => '',
|
744 |
-
'venus-mars' => '',
|
745 |
-
'viacoin' => '',
|
746 |
-
'viadeo' => '',
|
747 |
-
'viadeo-square' => '',
|
748 |
-
'video-camera' => '',
|
749 |
-
'vimeo' => '',
|
750 |
-
'vimeo-square' => '',
|
751 |
-
'vine' => '',
|
752 |
-
'vk' => '',
|
753 |
-
'volume-control-phone' => '',
|
754 |
-
'volume-down' => '',
|
755 |
-
'volume-off' => '',
|
756 |
-
'volume-up' => '',
|
757 |
-
'warning' => '',
|
758 |
-
'wechat' => '',
|
759 |
-
'weibo' => '',
|
760 |
-
'weixin' => '',
|
761 |
-
'whatsapp' => '',
|
762 |
-
'wheelchair' => '',
|
763 |
-
'wheelchair-alt' => '',
|
764 |
-
'wifi' => '',
|
765 |
-
'wikipedia-w' => '',
|
766 |
-
'window-close' => '',
|
767 |
-
'window-close-o' => '',
|
768 |
-
'window-maximize' => '',
|
769 |
-
'window-minimize' => '',
|
770 |
-
'window-restore' => '',
|
771 |
-
'windows' => '',
|
772 |
-
'won' => '',
|
773 |
-
'wordpress' => '',
|
774 |
-
'wpbeginner' => '',
|
775 |
-
'wpexplorer' => '',
|
776 |
-
'wpforms' => '',
|
777 |
-
'wrench' => '',
|
778 |
-
'xing' => '',
|
779 |
-
'xing-square' => '',
|
780 |
-
'y-combinator' => '',
|
781 |
-
'y-combinator-square' => '',
|
782 |
-
'yahoo' => '',
|
783 |
-
'yc' => '',
|
784 |
-
'yc-square' => '',
|
785 |
-
'yelp' => '',
|
786 |
-
'yen' => '',
|
787 |
-
'yoast' => '',
|
788 |
-
'youtube' => '',
|
789 |
-
'youtube-play' => '',
|
790 |
-
'youtube-square' => '',
|
791 |
-
));
|
792 |
-
}
|
793 |
-
add_filter('siteorigin_widgets_icons_fontawesome', 'siteorigin_widgets_icons_fontawesome_filter');
|
1 |
+
<?php
|
2 |
+
|
3 |
+
function siteorigin_widgets_icons_fontawesome_filter( $icons ){
|
4 |
+
return array_merge($icons, array(
|
5 |
+
'500px' => '',
|
6 |
+
'address-book' => '',
|
7 |
+
'address-book-o' => '',
|
8 |
+
'address-card' => '',
|
9 |
+
'address-card-o' => '',
|
10 |
+
'adjust' => '',
|
11 |
+
'adn' => '',
|
12 |
+
'align-center' => '',
|
13 |
+
'align-justify' => '',
|
14 |
+
'align-left' => '',
|
15 |
+
'align-right' => '',
|
16 |
+
'amazon' => '',
|
17 |
+
'ambulance' => '',
|
18 |
+
'american-sign-language-interpreting' => '',
|
19 |
+
'anchor' => '',
|
20 |
+
'android' => '',
|
21 |
+
'angellist' => '',
|
22 |
+
'angle-double-down' => '',
|
23 |
+
'angle-double-left' => '',
|
24 |
+
'angle-double-right' => '',
|
25 |
+
'angle-double-up' => '',
|
26 |
+
'angle-down' => '',
|
27 |
+
'angle-left' => '',
|
28 |
+
'angle-right' => '',
|
29 |
+
'angle-up' => '',
|
30 |
+
'apple' => '',
|
31 |
+
'archive' => '',
|
32 |
+
'area-chart' => '',
|
33 |
+
'arrow-circle-down' => '',
|
34 |
+
'arrow-circle-left' => '',
|
35 |
+
'arrow-circle-o-down' => '',
|
36 |
+
'arrow-circle-o-left' => '',
|
37 |
+
'arrow-circle-o-right' => '',
|
38 |
+
'arrow-circle-o-up' => '',
|
39 |
+
'arrow-circle-right' => '',
|
40 |
+
'arrow-circle-up' => '',
|
41 |
+
'arrow-down' => '',
|
42 |
+
'arrow-left' => '',
|
43 |
+
'arrow-right' => '',
|
44 |
+
'arrow-up' => '',
|
45 |
+
'arrows' => '',
|
46 |
+
'arrows-alt' => '',
|
47 |
+
'arrows-h' => '',
|
48 |
+
'arrows-v' => '',
|
49 |
+
'asl-interpreting' => '',
|
50 |
+
'assistive-listening-systems' => '',
|
51 |
+
'asterisk' => '',
|
52 |
+
'at' => '',
|
53 |
+
'audio-description' => '',
|
54 |
+
'automobile' => '',
|
55 |
+
'backward' => '',
|
56 |
+
'balance-scale' => '',
|
57 |
+
'ban' => '',
|
58 |
+
'bandcamp' => '',
|
59 |
+
'bank' => '',
|
60 |
+
'bar-chart' => '',
|
61 |
+
'bar-chart-o' => '',
|
62 |
+
'barcode' => '',
|
63 |
+
'bars' => '',
|
64 |
+
'bath' => '',
|
65 |
+
'bathtub' => '',
|
66 |
+
'battery' => '',
|
67 |
+
'battery-0' => '',
|
68 |
+
'battery-1' => '',
|
69 |
+
'battery-2' => '',
|
70 |
+
'battery-3' => '',
|
71 |
+
'battery-4' => '',
|
72 |
+
'battery-empty' => '',
|
73 |
+
'battery-full' => '',
|
74 |
+
'battery-half' => '',
|
75 |
+
'battery-quarter' => '',
|
76 |
+
'battery-three-quarters' => '',
|
77 |
+
'bed' => '',
|
78 |
+
'beer' => '',
|
79 |
+
'behance' => '',
|
80 |
+
'behance-square' => '',
|
81 |
+
'bell' => '',
|
82 |
+
'bell-o' => '',
|
83 |
+
'bell-slash' => '',
|
84 |
+
'bell-slash-o' => '',
|
85 |
+
'bicycle' => '',
|
86 |
+
'binoculars' => '',
|
87 |
+
'birthday-cake' => '',
|
88 |
+
'bitbucket' => '',
|
89 |
+
'bitbucket-square' => '',
|
90 |
+
'bitcoin' => '',
|
91 |
+
'black-tie' => '',
|
92 |
+
'blind' => '',
|
93 |
+
'bluetooth' => '',
|
94 |
+
'bluetooth-b' => '',
|
95 |
+
'bold' => '',
|
96 |
+
'bolt' => '',
|
97 |
+
'bomb' => '',
|
98 |
+
'book' => '',
|
99 |
+
'bookmark' => '',
|
100 |
+
'bookmark-o' => '',
|
101 |
+
'braille' => '',
|
102 |
+
'briefcase' => '',
|
103 |
+
'btc' => '',
|
104 |
+
'bug' => '',
|
105 |
+
'building' => '',
|
106 |
+
'building-o' => '',
|
107 |
+
'bullhorn' => '',
|
108 |
+
'bullseye' => '',
|
109 |
+
'bus' => '',
|
110 |
+
'buysellads' => '',
|
111 |
+
'cab' => '',
|
112 |
+
'calculator' => '',
|
113 |
+
'calendar' => '',
|
114 |
+
'calendar-check-o' => '',
|
115 |
+
'calendar-minus-o' => '',
|
116 |
+
'calendar-o' => '',
|
117 |
+
'calendar-plus-o' => '',
|
118 |
+
'calendar-times-o' => '',
|
119 |
+
'camera' => '',
|
120 |
+
'camera-retro' => '',
|
121 |
+
'car' => '',
|
122 |
+
'caret-down' => '',
|
123 |
+
'caret-left' => '',
|
124 |
+
'caret-right' => '',
|
125 |
+
'caret-square-o-down' => '',
|
126 |
+
'caret-square-o-left' => '',
|
127 |
+
'caret-square-o-right' => '',
|
128 |
+
'caret-square-o-up' => '',
|
129 |
+
'caret-up' => '',
|
130 |
+
'cart-arrow-down' => '',
|
131 |
+
'cart-plus' => '',
|
132 |
+
'cc' => '',
|
133 |
+
'cc-amex' => '',
|
134 |
+
'cc-diners-club' => '',
|
135 |
+
'cc-discover' => '',
|
136 |
+
'cc-jcb' => '',
|
137 |
+
'cc-mastercard' => '',
|
138 |
+
'cc-paypal' => '',
|
139 |
+
'cc-stripe' => '',
|
140 |
+
'cc-visa' => '',
|
141 |
+
'certificate' => '',
|
142 |
+
'chain' => '',
|
143 |
+
'chain-broken' => '',
|
144 |
+
'check' => '',
|
145 |
+
'check-circle' => '',
|
146 |
+
'check-circle-o' => '',
|
147 |
+
'check-square' => '',
|
148 |
+
'check-square-o' => '',
|
149 |
+
'chevron-circle-down' => '',
|
150 |
+
'chevron-circle-left' => '',
|
151 |
+
'chevron-circle-right' => '',
|
152 |
+
'chevron-circle-up' => '',
|
153 |
+
'chevron-down' => '',
|
154 |
+
'chevron-left' => '',
|
155 |
+
'chevron-right' => '',
|
156 |
+
'chevron-up' => '',
|
157 |
+
'child' => '',
|
158 |
+
'chrome' => '',
|
159 |
+
'circle' => '',
|
160 |
+
'circle-o' => '',
|
161 |
+
'circle-o-notch' => '',
|
162 |
+
'circle-thin' => '',
|
163 |
+
'clipboard' => '',
|
164 |
+
'clock-o' => '',
|
165 |
+
'clone' => '',
|
166 |
+
'close' => '',
|
167 |
+
'cloud' => '',
|
168 |
+
'cloud-download' => '',
|
169 |
+
'cloud-upload' => '',
|
170 |
+
'cny' => '',
|
171 |
+
'code' => '',
|
172 |
+
'code-fork' => '',
|
173 |
+
'codepen' => '',
|
174 |
+
'codiepie' => '',
|
175 |
+
'coffee' => '',
|
176 |
+
'cog' => '',
|
177 |
+
'cogs' => '',
|
178 |
+
'columns' => '',
|
179 |
+
'comment' => '',
|
180 |
+
'comment-o' => '',
|
181 |
+
'commenting' => '',
|
182 |
+
'commenting-o' => '',
|
183 |
+
'comments' => '',
|
184 |
+
'comments-o' => '',
|
185 |
+
'compass' => '',
|