Initial Commit
This commit is contained in:
parent
4c352bf02e
commit
1ab6e5f0b0
1085 changed files with 195258 additions and 0 deletions
36
plugins/jetpack/_inc/facebook-embed.js
Normal file
36
plugins/jetpack/_inc/facebook-embed.js
Normal file
|
@ -0,0 +1,36 @@
|
|||
/* global FB, jpfbembed */
|
||||
(function( window ) {
|
||||
var facebookEmbed = function() {
|
||||
var fbroot, src;
|
||||
|
||||
if ( 'undefined' !== typeof FB && FB.XFBML ) {
|
||||
FB.XFBML.parse();
|
||||
} else {
|
||||
fbroot = document.createElement( 'div' );
|
||||
fbroot.id = 'fb-root';
|
||||
document.getElementsByTagName( 'body' )[0].appendChild( fbroot );
|
||||
|
||||
src = '//connect.facebook.net/' + jpfbembed.locale + '/sdk.js#xfbml=1';
|
||||
if ( jpfbembed.appid ) {
|
||||
src += '&appId=' + jpfbembed.appid;
|
||||
}
|
||||
src += '&version=v2.3';
|
||||
jQuery.getScript( src );
|
||||
}
|
||||
};
|
||||
|
||||
window.fbAsyncInit = function() {
|
||||
FB.init( {
|
||||
appId : jpfbembed.appid,
|
||||
version: 'v2.3'
|
||||
} );
|
||||
|
||||
FB.XFBML.parse();
|
||||
};
|
||||
|
||||
if ( 'undefined' !== typeof infiniteScroll ) {
|
||||
jQuery( document.body ).on( 'post-load', facebookEmbed );
|
||||
}
|
||||
|
||||
facebookEmbed();
|
||||
})( this );
|
BIN
plugins/jetpack/_inc/fonts/automatticons/automatticons.eot
Normal file
BIN
plugins/jetpack/_inc/fonts/automatticons/automatticons.eot
Normal file
Binary file not shown.
44
plugins/jetpack/_inc/fonts/automatticons/automatticons.svg
Normal file
44
plugins/jetpack/_inc/fonts/automatticons/automatticons.svg
Normal file
|
@ -0,0 +1,44 @@
|
|||
<?xml version="1.0" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
|
||||
<svg xmlns="http://www.w3.org/2000/svg">
|
||||
<metadata></metadata>
|
||||
<defs>
|
||||
<font id="automatticonsregular" horiz-adv-x="2048" >
|
||||
<font-face units-per-em="2048" ascent="1638" descent="-410" />
|
||||
<missing-glyph horiz-adv-x="1200" />
|
||||
<glyph />
|
||||
<glyph />
|
||||
<glyph unicode="
" />
|
||||
<glyph unicode=" " horiz-adv-x="1200" />
|
||||
<glyph unicode="	" horiz-adv-x="1200" />
|
||||
<glyph unicode=" " horiz-adv-x="1200" />
|
||||
<glyph unicode="." d="M24 1100l1000 -1000l1000 1000h-2000z" />
|
||||
<glyph unicode="@" d="M24 -8q48 -6 100 -6q281 0 508 176q-133 1 -238.5 81t-145.5 203q39 -6 78 -6q60 0 108 14q-142 29 -236 142t-94 260v6q86 -49 186 -52q-84 57 -133 146.5t-49 195.5q0 110 56 206q154 -189 374 -303t472 -127q-12 45 -12 94q0 111 55 205.5t149.5 149.5t205.5 55 q87 0 165 -34t135 -94q142 27 260 100q-46 -149 -182 -228q123 14 238 64q-82 -124 -206 -212q2 -18 2 -54q0 -117 -24.5 -235.5t-75 -233t-122 -218t-170 -191t-214 -152t-260 -100.5t-302.5 -36q-344 0 -628 184z" />
|
||||
<glyph unicode="A" horiz-adv-x="12288" d="M128 356h176l110 220h492l92 -220h176l-458 852h-118zM460 692l186 342l198 -342h-384zM1458 716q0 -174 112.5 -279t337.5 -105q116 0 204 30t140.5 83.5t78 121.5t25.5 149v492h-162v-492q0 -129 -63.5 -197.5t-208.5 -68.5q-147 0 -230.5 71.5t-83.5 194.5v492h-150 v-492zM2710 1056h364v-700h150v700h378v152h-892v-152zM3904 772q0 -82 35 -161t96.5 -141t153 -100t195.5 -38q107 0 199.5 38t153 100.5t95 141t34.5 160.5v24q0 85 -34.5 165t-95 142.5t-152.5 100.5t-200 38q-105 0 -196 -38t-152.5 -100.5t-96.5 -142.5t-35 -165v-24z M4048 784v12q0 125 90.5 216.5t245.5 91.5q82 0 147.5 -26t104.5 -70t59.5 -98t20.5 -114v-12q0 -147 -84.5 -240.5t-247.5 -93.5q-158 0 -247 95t-89 239zM4251 671q0 -15 10 -34q11 -21 33 -37q7 -12 28 -1t30 35l150 224q15 19 10 42t-24 42q-24 10 -46 4.5t-22 -28.5 l-164 -214q-5 -18 -5 -33zM5278 356h152v666l46 -70l330 -596h92l342 596l46 70v-666h164v852h-222l-318 -588l-46 -66l-46 66l-320 588h-220v-852zM6756 356h186l92 220h504l104 -220h160l-448 852h-140zM7092 692l180 342l186 -342h-366zM7928 1056h366v-700h152v700h376 v152h-894v-152zM9076 1056h364v-700h164v700h386v152h-914v-152zM10370 356h160v852h-80q0 -43 -19 -62.5t-61 -19.5v-770zM10908 772q0 -88 37 -167t104 -140t170.5 -97t228.5 -36q237 0 440 164l-104 90q-55 -39 -94.5 -62.5t-108.5 -48.5t-133 -25q-179 0 -277.5 92.5 t-98.5 229.5v12q0 134 98.5 227t277.5 93q170 0 326 -152l114 104q-206 186 -440 186q-116 0 -218.5 -38t-172 -100.5t-109.5 -142.5t-40 -165v-24z" />
|
||||
<glyph unicode="C" d="M0 402v286q0 8 2.5 17.5t5.5 14.5l2 6l16 28q6 13 0 26l-16 28q-10 18 -10 38v284q0 28 16.5 52t41.5 30l914 378q27 10 54 10q29 0 52 -10l912 -374q26 -9 42 -33.5t16 -52.5v-284q0 -9 -2.5 -18.5t-5.5 -14.5l-2 -5l-16 -28q-6 -13 0 -26l16 -28q10 -20 10 -38v-286 q0 -27 -16 -51t-42 -33l-912 -374q-23 -10 -52 -10q-27 0 -54 10l-914 374q-25 9 -41.5 33.5t-16.5 50.5zM236 574q0 -42 24 -70t56 -28q36 0 59 27.5t23 70.5v90q0 7 -6 13.5t-14 6.5h-24v-120q0 -15 -9.5 -25.5t-24.5 -10.5t-24.5 10.5t-9.5 25.5v406q0 15 9.5 25.5 t24.5 10.5t24.5 -10.5t9.5 -25.5v-116h24q20 0 20 20v84q0 43 -23 70.5t-59 27.5q-32 0 -56 -28t-24 -70v-384zM256 568v398q0 30 18 50t46 20t45 -19.5t17 -50.5v-88q0 -8 -8 -8h-6v96q0 24 -13.5 41t-34.5 17q-22 0 -36 -17t-14 -41v-398q0 -25 13.5 -40.5t36.5 -15.5 q21 0 34.5 15.5t13.5 40.5v96h10h4v-4v-4v-88q0 -31 -17 -51.5t-45 -20.5t-46 21t-18 51zM432 574q0 -43 25.5 -70.5t60.5 -27.5q37 0 61.5 27.5t24.5 70.5v384q0 43 -24.5 70.5t-61.5 27.5q-35 0 -60.5 -27.5t-25.5 -70.5v-384zM452 568v398q0 30 19 50t47 20 q27 0 45.5 -20t18.5 -50v-398q0 -30 -18.5 -51t-45.5 -21q-28 0 -47 21t-19 51zM468 568q0 -25 13.5 -40.5t36.5 -15.5t36.5 15.5t13.5 40.5v398q0 24 -14 41t-36 17t-36 -17t-14 -41v-398zM480 294h4l4 -4h288l34 -24v6q0 4 -2 7t-4 4l-2 1l-16 12l16 14q8 4 8 12v8 l-34 -28h-296v-8zM484 564v406q0 15 9.5 25.5t24.5 10.5t24.5 -10.5t9.5 -25.5v-406q0 -15 -9.5 -25.5t-24.5 -10.5t-24.5 10.5t-9.5 25.5zM592 1220h256v-28q0 -11 8 -16l58 -34h12h8l58 34q12 6 12 16v28h42v-28q0 -4 12 -16l60 -34h6h12l58 34q8 5 8 16v28h256v10l-4 4 h-252v28q0 11 -8 16l-58 34q-12 6 -18 0l-26 -18l-22 30l24 12q8 8 8 16v68q0 10 -8 18l-60 34q-3 3 -9 3t-9 -3l-60 -34q-6 -6 -6 -18v-68q0 -10 6 -16l24 -12l-22 -30l-24 18q-7 7 -20 0l-58 -34q-8 -5 -8 -16v-28h-252l-4 -4v-10zM636 504q0 -8 7 -14t17 -6h60 q43 0 62.5 27t19.5 83v344q0 58 -19.5 85t-62.5 27h-60q-10 0 -17 -6t-7 -14v-526zM658 508v4v514l2 4h60q34 0 48 -21t14 -67v-352q0 -47 -14 -66.5t-48 -19.5h-60v4h-2zM670 516h50q27 0 37.5 17t10.5 57v352q0 41 -10.5 57.5t-37.5 16.5h-50v-500zM690 534v464h30 q18 0 25 -11t7 -39v-362q0 -29 -7 -40.5t-25 -11.5h-30zM836 504q0 -8 7.5 -14t16.5 -6h96q8 0 14 6t6 14v28h-84v220h38q22 0 22 20v28h-60v202h84v28q0 8 -6 14t-14 6h-96q-9 0 -16.5 -6t-7.5 -14v-526zM850 268h38v8h-28v20h24v6h-24v20h28v4h-38v-58zM856 504v4v518 q0 4 4 4l4 4h86l2 -4l4 -4v-6h-84v-238h58v-6q0 -8 -4 -8h-54v-254h84v-6l-4 -4l-2 -4h-90v4h-4zM860 1192v70q0 4 4 4l58 32l4 4q4 0 4 -4l22 -14l-22 -34h-4q-24 0 -24 -24q0 -22 24 -22q18 0 24 16h38v-28q0 -4 -2 -4l-56 -32q-8 -8 -8 0l-58 32zM902 280q0 -12 8 -12h20 q8 0 8 12v10q0 10 -8 10q-8 2 -16 2q-6 6 -6 8v8q2 4 6 4h12l4 -4v-8h8v8q0 8 -8 8h-20q-8 0 -8 -8v-12q0 -5 8 -10q8 0 16 -2l4 -4v-10q0 -4 -4 -4h-16l-2 4v6h-6v-6zM942 1244l24 34l20 -12q2 0 2 -4v-28h-38q-2 2 -4 5t-4 5zM950 322h16v-54h10v54h16v4h-42v-4zM962 1348 v76l62 32q0 4 2 4v-4l62 -32l4 -4v-68l-4 -4l-24 -12l-20 34q0 2 3 7t3 9q0 10 -7.5 17t-16.5 7q-11 0 -18.5 -7t-7.5 -17q0 -4 8 -16l-22 -34zM972 1288l16 32l28 -18h10h8l28 18l16 -32l-20 -10q-12 -12 -12 -16v-28h-42v28q0 10 -12 16zM986 268h10v12h-10v-12zM996 1328 l24 34h6h8l20 -34l-28 -12q0 -3 -1 -3t-1 3zM1030 268h34v8h-24v10q0 4 4 4q4 2 8.5 4t5.5 2q6 4 6 10v12q0 8 -6 8h-18q-2 0 -6 -2.5t-4 -5.5v-4l10 -4v8q0 4 4 4h10q4 0 4 -4v-12q0 -4 -4 -4q-8 -2 -14 -6q-10 0 -10 -6v-22zM1062 1192v28h40q1 -7 8 -11.5t14 -4.5 q24 0 24 22q0 24 -24 24h-6l-20 34l24 14l2 4q4 0 4 -4l58 -32q4 0 4 -4v-70q0 -4 -4 -4l-58 -32q0 -3 -2 -3t-4 3l-58 32zM1062 1234v28l2 4l20 12l24 -34q-2 -2 -6 -10h-40zM1082 280q0 -12 10 -12h12q12 0 12 12v38q0 8 -12 8h-12q-10 0 -10 -8v-38zM1088 280v38l4 4h12 q4 0 4 -4v-38l-4 -4h-12q-4 0 -4 4zM1094 504q0 -8 6.5 -14t15.5 -6h30v242h34q30 0 52 22t22 72v142q0 88 -74 88h-64q-9 0 -15.5 -6t-6.5 -14v-526zM1112 508v516l4 2l2 4h62q54 0 54 -68v-146q0 -68 -54 -68h-56v-248h-6q-6 0 -6 8zM1124 314l16 8v-54h8v58h-8l-16 -4v-8 zM1124 762h56q44 0 44 54v146q0 54 -44 54h-56v-254zM1146 780v218h34q22 0 22 -32v-158q0 -28 -22 -28h-34zM1166 268h34v8h-28v10l4 4q4 2 18 6q6 6 6 10v12q0 8 -10 8h-18q-6 0 -6 -8v-4l6 -4v8l4 4h10q4 0 4 -4v-12q0 -4 -4 -4l-14 -6q-6 0 -6 -6v-22zM1240 266l38 24 h286l2 4h4v2v6h-292l-38 28v-8q0 -4 2 -7t4 -4l2 -1l20 -14l-20 -12q-8 -4 -8 -12v-6zM1292 574q0 -42 24 -70t56 -28q37 0 61.5 27.5t24.5 70.5v384q0 43 -24.5 70.5t-61.5 27.5q-32 0 -56 -28t-24 -70v-384zM1308 568v398q0 30 19 50t45 20q30 0 50 -20t20 -50v-398 q0 -31 -19.5 -51.5t-50.5 -20.5q-28 0 -46 21t-18 51zM1322 568q0 -25 15 -40.5t35 -15.5q24 0 40 15.5t16 40.5v398q0 24 -16 41t-40 17q-20 0 -35 -17t-15 -41v-398zM1342 564v406q0 15 8.5 25.5t21.5 10.5q15 0 25.5 -10.5t10.5 -25.5v-406q0 -15 -10.5 -25.5 t-25.5 -10.5q-13 0 -21.5 10.5t-8.5 25.5zM1496 504q0 -8 6 -14t14 -6h94q20 0 20 20v28h-84v220h40q20 0 20 20v28h-60v202h84v28q0 20 -20 20h-94q-8 0 -14 -6t-6 -14v-526zM1512 508v518l4 4l4 4h84l2 -4l4 -4v-6h-84v-238h60v-6q0 -8 -6 -8h-54v-254h84v-6q0 -4 -4 -4 l-2 -4h-84l-4 4zM1658 1002h54v-498q0 -8 6.5 -14t15.5 -6h30v518h52v28q0 7 -7 13.5t-15 6.5h-114q-22 0 -22 -20v-28zM1680 1020v6q0 4 2 4q0 4 2 4h104q0 -4 4 -4v-10h-50v-520h-4q-8 0 -8 8v512h-50z" />
|
||||
<glyph unicode="F" d="M24 -286q0 -46 34 -80t80 -34h1772q46 0 80 34t34 80v1772q0 46 -34 80t-80 34h-1772q-46 0 -80 -34t-34 -80v-1772zM972 478v264h194v228q0 68 23 128t67.5 108t119 76t170.5 28q48 0 94.5 -2.5t69.5 -5.5l22 -2l-4 -248q-82 2 -170 2q-67 0 -89.5 -28.5t-22.5 -89.5 v-194h288l-12 -264h-276v-736h-280v736h-194z" />
|
||||
<glyph unicode="G" d="M134 708q0 183 68 345.5t190 284.5q54 52 129 52t127 -52q50 -52 50 -125t-50 -127q-74 -73 -116 -171.5t-42 -206.5q0 -109 42 -208t113.5 -170.5t170.5 -113.5t208 -42q147 0 270.5 71t195.5 194t72 269q0 173 -99 311.5t-257 194.5v-416q0 -75 -53.5 -126.5 t-128.5 -51.5q-74 0 -126 51.5t-52 126.5v624q0 74 52 126t126 52q182 0 347.5 -70.5t284.5 -190.5t189.5 -285t70.5 -346q0 -182 -70.5 -347.5t-189.5 -285t-284.5 -190.5t-347.5 -71q-181 0 -345.5 71t-284 190.5t-190 285t-70.5 347.5z" />
|
||||
<glyph unicode="I" d="M0 26v934q146 30 216.5 53.5t103.5 56.5q16 20 32 54t24 58l8 24q3 -3 6.5 -9t14 -24.5t15 -35.5t8.5 -42.5t-6 -44.5q-6 -12 -11 -20.5t-8.5 -15.5t-9.5 -14t-8 -11t-9.5 -9.5t-10 -8t-12.5 -9t-13.5 -8.5t-17.5 -10.5t-20 -11.5q-48 -40 -48 -91v-7q4 -55 48 -86 q17 -11 33 -11q21 1 41 19q36 34 82 122q17 34 26.5 79.5t13.5 78t25.5 72t62.5 70.5q31 24 70 30q29 4 56 5q10 0 20 -1q11 -1 22 -1q28 0 58 4q42 5 92.5 38.5t101.5 100.5q38 47 81 74t83 33q24 4 47 3q16 0 31 -1q39 -4 70.5 -16.5t56 -25.5t37.5 -23l14 -10 q-6 2 -15.5 6t-38.5 12q-30 8 -58 12q-15 2 -33 1q-15 0 -32 -1q-37 -3 -68.5 -16.5t-61.5 -44t-49 -77.5q-19 -43 -35.5 -75t-29.5 -54t-29 -38t-27 -25t-30 -16t-31.5 -10t-38 -9t-43.5 -11q-60 -16 -77 -69q-5 -16 -5 -30q0 -29 21 -52q22 -24 55 -24q28 0 65 18 q10 5 21 11q59 37 93.5 77.5t46 69t39.5 61t77 56.5q69 32 131 43.5t126 14t99 8.5q304 41 384 174q34 52 53 102t21 74l2 24q2 -6 4 -17.5t7 -45.5q4 -30 4 -60q-1 -4 -1 -7q0 -33 -10.5 -78.5t-30.5 -84.5t-59.5 -79t-95.5 -68q-94 -49 -166 -76t-106 -32t-74 -15t-78 -31 q-107 -58 -107 -146q0 -43 25 -92q36 -62 97 -68q6 -1 12 -1q55 0 111 49q33 29 51.5 72.5t20.5 72.5l2 29q3 -7 7 -19.5t11 -48.5q8 -38 8 -71t-13 -72q-13 -41 -41 -71q-56 -60 -94 -84t-92 -25h-4q-54 0 -138 27q-78 22 -135 26q-20 1 -36 1q-31 -1 -49 -5 q-28 -6 -54 -22q-46 -22 -70 -64q-13 -23 -13 -43q0 -17 9 -31q14 -25 31.5 -35.5t48.5 -5.5t74 31q60 33 102 44.5t100 11.5q122 0 218 -56q25 -16 53 -39t43 -38l16 -15q-9 5 -24.5 13t-61.5 21q-44 14 -86 16q-5 0 -11 1q-38 0 -83 -16q-52 -18 -90 -61 q-74 -82 -122 -114q-46 -31 -79 -31q-1 1 -3 1q-34 2 -90 26q-84 34 -126 46q-12 -18 -12 -56q0 -16 5 -30t10 -20l5 -6q36 0 54 -8q92 0 128 -64q12 -25 17 -50t4 -38l-1 -12q-4 3 -11.5 8.5t-31 17t-47 18t-57 6t-63.5 -13.5q-50 -20 -86 -65.5t-42 -98.5h-424 q-87 0 -152.5 65t-65.5 153z" />
|
||||
<glyph unicode="J" d="M305 433q0 152 21 325.5t62 315.5q54 193 138 398q2 4 4 4q9 17 55 27.5t107 10.5q60 0 107 -11t57 -27l2 -4q76 -179 138 -398q1 -2 2 -7t2 -7l28 6l-6 16q-46 160 -86 262q48 138 80 216q4 4 4 6q12 14 56.5 24t99.5 10q57 0 102 -10.5t54 -25.5l4 -4q69 -169 112 -312 l8 -8q5 -4 13 -11.5t30 -32.5t40.5 -53.5t37.5 -73.5t27 -93q5 -27 5 -55q0 -11 -1 -23q-1 -15 -1 -33q0 -32 3 -75q5 -68 22 -126q14 -45 18 -54l-68 -26l-42 -14l-54 -22q-16 31 -30 72q-10 37 -10 102q0 26 2 56q1 29 1 56q0 75 -11 136q-11 57 -41.5 115.5t-52 86 t-36.5 42.5l-12 -2q36 -106 64 -242q19 -87 22.5 -208.5t7.5 -159.5q6 -73 34 -193t32 -171v-8q8 -67 72 -88q5 -3 34 -8q40 64 40 132q0 14 -2 28q0 2 -1 6t-1 6l40 18l128 60q11 -32 14 -80q-1 -57 -11.5 -98.5t-20.5 -54.5l-10 -13l-220 -60l2 4l-10 -4q-26 -8 -53 -8 q-32 0 -65 12q-87 -21 -194 -24q-20 -4 -44 0q-22 0 -34 2q2 22 2 92l156 38q16 3 26 22l-230 -46l-132 -28q0 -10 7.5 -17t18.5 -7l106 26q-8 -104 -8 -114q-3 -20 -22 -34q-41 -20 -94 -36q24 48 24 122h-8q-16 -83 -66 -136q-8 -10 -28 -30q-40 -26 -76 -32q29 34 40 48 q44 59 64 136l6 28q6 24 6 52q4 39 13.5 100t12.5 92q1 13 1 34q0 26 -2 61q-3 65 -17 153q-30 185 -32 356q-1 15 -1 29q0 147 25 185h-10q-21 -19 -39 -51t-25.5 -52t-21.5 -63q-17 -51 -22 -106q-1 -18 -1 -36q0 -38 7 -80q9 -60 19 -102.5t29 -109.5q12 -57 12 -107 q0 -29 -4 -55q0 -1 -46.5 9.5t-93.5 21.5l-46 11v21q0 63 -16 111q-38 80 -45 196q-2 27 -2 51q0 83 19 143q21 96 60 146q-57 -53 -82 -152q-12 -57 -15 -121q-1 -14 -1 -29q0 -51 8 -106q11 -72 36 -124q21 -58 21 -110q0 -10 -1 -20l-10 4q-52 -27 -85.5 -78.5 t-40.5 -89.5l-8 -38l12 -22l12 -6q0 -8 -8 -12q-60 -85 -60 -167q0 -45 18 -89q-78 18 -142 50q-20 12 -20 34q-7 63 -11 159t-4 248zM423 -169q0 6 5 11l54 54q39 -11 74 -16q14 -8 46 -20q70 -23 163 -23q83 0 185 19l10 -14q9 -6 7 -15.5t-11 -14.5q-95 -35 -234 -38 q-14 -2 -27 -2l-27 2q-139 3 -234 38q-11 6 -11 19zM488 19q0 89 64 179h2l178 -86q-46 -78 -46 -154v-14q0 -18 2 -26q1 -8 4 -19.5t4 -14.5q0 -6 4 -10v-4l-22 6q-10 4 -30 8q-61 15 -122 26h-8l-2 2l-14 24q-14 41 -14 83zM548 1472q0 -14 42.5 -24t101.5 -10t101.5 10 t42.5 24q0 15 -41.5 24.5t-102.5 9.5t-102.5 -9.5t-41.5 -24.5zM646 284q19 38 28 42q4 -1 17.5 -6t29 -10.5t27.5 -9.5l-14 -46l-86 30h-2zM942 964q0 -11 8 -18t18 -6l60 10q51 -246 51 -588q0 -52 -1 -106l46 8q-8 403 -70 692l192 36q19 4 26 22zM1038 1560 q0 -13 40.5 -22.5t97.5 -9.5t97.5 9.5t40.5 22.5t-40.5 22.5t-97.5 9.5t-97.5 -9.5t-40.5 -22.5zM1046 -74q16 8 44 24q31 17 28 48q0 6 2 8q20 0 64 -4q14 -2 60 -2q68 0 164 12l28 -28q7 -8 5 -17.5t-11 -12.5q-92 -33 -224 -36q-14 -2 -27 -2l-27 2q-63 0 -106 8z M1610 488l68 26q16 -24 16 -40q-6 -3 -21.5 -9t-28 -10.5t-20.5 -8.5l-8 16z" />
|
||||
<glyph unicode="K" d="M126 -198v1798h1798v-1798h-1798zM446 688q0 -20 13 -33t37 -13q25 0 39.5 15t14.5 41q0 19 -12.5 31.5t-35.5 12.5q-26 0 -41 -15t-15 -39zM526 306q0 -18 20 -18h268q8 0 14 5.5t6 12.5q0 20 -20 20q-94 0 -94 48q0 20 14 40l58 138q8 17 20 27.5t30 14.5t29 5t31 1 h252q12 0 12 -10l66 -176q10 -22 10 -46q0 -42 -64 -42q-18 0 -18 -20q0 -18 18 -18h302q16 0 16 18q0 20 -14 20q-49 3 -77.5 23t-44.5 65l-278 722q-6 30 -32 30q-22 0 -42.5 -16.5t-31.5 -39.5l-320 -696q-18 -46 -41.5 -67t-68.5 -21q-9 0 -14.5 -6t-5.5 -14zM840 658v6 l124 272q31 59 38 98q0 6 4 6q2 0 2 -6q6 -51 52 -152l70 -194q4 -6 4 -20t-26 -14h-258q-10 0 -10 4zM1480 688q0 -46 44 -46q27 0 41.5 15t14.5 41q0 19 -12 31.5t-36 12.5q-52 0 -52 -54z" />
|
||||
<glyph unicode="P" d="M34 606q0 200 79 384t212 317.5t317 213t386 79.5q201 0 384 -79.5t315.5 -213t210.5 -317t78 -384.5q0 -162 -50 -313.5t-141 -272.5t-212.5 -212t-272.5 -140.5t-312 -49.5q-202 0 -386 77.5t-317 209.5t-212 315.5t-79 385.5zM128 606q0 -182 70.5 -348.5t190.5 -288 t287 -193.5t352 -72q262 0 476 137t326 363q68 139 68 294q0 129 -48.5 245t-131.5 202t-193.5 144t-234.5 77q127 -51 224 -158.5t138 -241.5q36 -100 36 -207q0 -71 -16 -145q-40 -186 -166 -318q-122 -134 -303 -196q-125 -43 -252 -43q-57 0 -115 9q-187 26 -340 151 t-230 303q-77 159 -77 341q0 15 1 31q7 200 104 368q94 173 261.5 289t366.5 149q3 0 12.5 3.5t15.5 4.5q-172 -15 -324.5 -91.5t-261.5 -195.5t-172.5 -278.5t-63.5 -334.5zM282 645q1 -35 4 -71q24 -162 115 -302.5t225 -221.5q138 -80 298 -88q17 -1 33 -1q141 0 265 59 q-84 -24 -170 -24q-122 0 -234 48t-193 129t-129 194.5t-48 238.5q0 231 162 406v8l16 16q110 125 264 198.5t324 73.5q176 0 335.5 -80t264.5 -216q-30 50 -78 110q-116 140 -275.5 221t-332.5 87q-27 2 -54 2q-149 0 -289 -56q-165 -66 -281 -194q-120 -114 -176 -276 q-45 -128 -46 -261zM572 650q0 -22 2 -44q6 -127 92 -235.5t208 -144.5q52 -14 103 -14q69 0 141 26q124 44 186 142q59 90 59 193q1 17 -1 35q-12 122 -96 206q-80 85 -201 97q-19 2 -37 2q-98 0 -170 -55q-88 -63 -114 -178q-7 -28 -7 -58q0 -67 35 -140q61 -94 162 -118 q34 -8 66 -8q65 0 120 32q99 74 110 154q5 25 5 49q0 69 -45 129q-23 33 -64 56.5t-82 29.5q-84 0 -162 -62q-48 -48 -48 -117q0 -20 2 -37q7 -69 86 -132q28 -14 98 -14q-51 0 -89 29.5t-57 76.5v8q-15 30 -15 60q0 43 31 86q47 70 146 70q96 -15 138 -94q25 -34 28 -80 v-11q0 -40 -20 -77q-36 -90 -146 -116q-21 -6 -43 -6l-143 62q-36 36 -56 85q-15 38 -15 76q0 11 1 23q0 71 46.5 130.5t120.5 85.5q39 14 80 14h5q32 0 64 -8q76 -18 131 -78q55 -58 71 -136q6 -31 6 -64q0 -48 -14 -98q-26 -76 -95 -130.5t-153 -68.5q-27 -5 -54 -5 q-57 0 -114 20q-117 41 -186 176q-28 57 -34 128q-2 18 -2 35q0 52 14 99q42 134 172 212q94 56 191 56q37 0 75 -8q144 -15 247 -134.5t109 -271.5q0 -77 -24 -153.5t-68 -132.5q-98 -132 -248 -176q-67 -19 -142 -19q-57 0 -120 11q107 -40 194 -40q143 0 263.5 71.5 t189.5 192.5t69 262q-10 119 -69.5 224.5t-152.5 173.5q-109 88 -256 100q-13 1 -27 1h-13q-123 0 -228 -61q-124 -59 -202 -186q-54 -93 -54 -208z" />
|
||||
<glyph unicode="V" d="M155 1198q1 38 21 73q28 49 80 67l718 254q21 8 50 8t50 -8l718 -254q52 -18 80 -67q21 -35 21 -73q0 -15 -3 -30q-6 -30 -14.5 -65.5t-40 -144t-69 -209.5t-102.5 -244t-138.5 -267t-179.5 -258.5t-224 -237.5q-41 -38 -98 -38t-98 38q-118 103 -224 237.5t-179.5 258.5 t-138.5 267t-102.5 244t-69 209.5t-40 144t-14.5 65.5q-3 15 -3 30zM224 1199q0 -8 2 -17q3 -17 13.5 -62.5t39.5 -142.5t66.5 -203t99.5 -240.5t134 -258.5t174.5 -253.5t216.5 -229.5q23 -20 54 -20t54 20q114 101 216.5 230.5t175 253.5t134.5 258.5t99.5 240t66 202.5 t39 142t13.5 63q2 9 2 17q0 21 -11 39q-15 26 -43 36l-718 254q-14 4 -28 4l-28 -4l-718 -254q-28 -10 -43 -36q-11 -19 -11 -39zM306 1198l718 252l718 -252q-4 -18 -11 -50.5t-36 -131.5t-63.5 -197.5t-95.5 -234t-130.5 -256t-170 -248.5t-211.5 -226q-111 98 -211 224.5 t-170.5 251.5t-130 253t-96.5 237t-63 194.5t-37 134.5zM508 1112l96 -242h22q12 0 22 -8.5t14 -17.5l4 -8l254 -626h208l250 618l4 8q14 34 40 34h22l96 242h-284l-232 -586l-232 586h-284z" />
|
||||
<glyph unicode="W" d="M24 606q0 203 79.5 388.5t213.5 319t319 213t388 79.5q163 0 315.5 -50.5t275.5 -143t215.5 -215.5t143 -275.5t50.5 -315.5t-50.5 -315.5t-143 -275.5t-215.5 -215.5t-275.5 -143t-315.5 -50.5q-203 0 -388 79.5t-319 213t-213.5 319t-79.5 388.5zM150 606 q0 -252 132 -461.5t352 -320.5l-412 1130q-72 -162 -72 -348zM304 1100h26q68 0 124.5 2.5t79.5 5.5l22 2q28 1 46 -16t19.5 -39.5t-13 -42.5t-42.5 -24t-70 -6l288 -858l194 578l-102 276l-88 10q-22 1 -36.5 14.5t-16.5 31.5t2.5 36t21 29.5t39.5 10.5q52 -10 194 -10 q69 0 125.5 2.5t78.5 5.5l22 2q28 1 46 -16t19.5 -39.5t-13 -42.5t-42.5 -24q-26 -4 -68 -6l286 -850l88 292q68 179 68 288q0 50 -14 102q-21 54 -38 82q-33 51 -45.5 72.5t-27.5 60.5t-15 73q0 62 41 108.5t103 47.5q-117 107 -267 165.5t-315 58.5q-220 0 -410.5 -103 t-309.5 -279zM778 -232q123 -38 246 -38q152 0 290 52q0 2 -2 2l-272 746zM1476 -144q194 118 309 317t115 433q0 208 -96 400q4 -44 4 -66q0 -149 -70 -316z" />
|
||||
<glyph unicode="s" horiz-adv-x="1200" d="M604 186q154 133 278.5 378.5t179.5 497.5l-458 168v-24q18 -7 61 -22t65 -24l256 -90q4 -2 17 -7t23 -9t10 -6q0 -6 -4 -18l-428 154v-28q102 -35 178 -64q244 -85 244 -90q0 -4 -6 -16l-416 150v-30l292 -104h30q-1 -2 -2 -5t-2 -5l92 -34q-1 -2 -3 -8t-5 -8l-92 32 l-8 -26q20 -5 57 -18t37 -16l-6 -18l-94 34l-12 -24l98 -34q-3 -13 -8 -20l-96 36q-5 -9 -8 -26l98 -34q-2 -4 -4 -10.5t-4 -9.5l-120 42q-3 0 -9.5 -8t-6.5 -12l128 -46q-1 -2 -4 -9t-6 -9l-126 44q-5 -14 -10 -22l128 -48q-1 -2 -2.5 -6t-3 -6.5t-4.5 -3.5l-124 44 q-2 -4 -10 -24l128 -48l-10 -16l-126 44q-1 -4 -4 -12t-4 -12l124 -46q-1 -2 -4.5 -8t-5.5 -8l-122 44q-2 -4 -5 -12t-5 -12l122 -46l-8 -16l-122 44q-1 -3 -4 -11.5t-4 -14.5l118 -42l-10 -18l-118 42l-8 -24l114 -42q-8 -12 -10 -18l-112 40q-2 -3 -5 -12t-5 -12l106 -36 l2 -4q-8 -12 -12 -16l-104 38l-8 -26l100 -36q-8 -12 -12 -16l-96 34q-8 -16 -10 -24l92 -34q-4 -4 -12 -16l-84 32h-66v-6l134 -48q-8 -12 -14 -16l-120 44v-28l104 -40l-14 -14l-90 32v-28l72 -26q-4 -6 -14 -16l-58 22v-30q28 -8 38 -14l-14 -16q-4 2 -12 5t-12 5v-64z M604 616q10 15 10 24q0 2 -10 2v-26zM604 664l18 -6q1 2 4 10.5t4 15.5l-26 8v-28zM604 714l36 -12q1 4 4 12t4 12l-44 16v-28zM604 764l52 -20q4 10 8 26l-60 20v-26zM604 812l66 -24q9 12 12 24l-78 28v-28zM604 862l86 -32q1 4 2.5 8t3 9t2.5 7l-94 34v-26zM604 910 l102 -36q1 3 4 10.5t4 13.5l-110 40v-28zM604 960l120 -42q1 2 2.5 7t3 9t2.5 8l-128 46v-28zM604 1008l136 -48q3 6 8 26l-144 50v-28zM604 1058l156 -56h74l-230 84v-28z" />
|
||||
<glyph unicode="v" horiz-adv-x="1372" d="M155 1059q0 21 10 39q13 24 39 36l460 164q12 4 25 4l25 -4l460 -164q26 -12 39 -36q10 -19 10 -39q0 -6 -1 -13q0 -1 -1 -6q-8 -36 -18 -72.5t-36 -123.5t-63.5 -172t-88 -183.5t-123 -193.5t-154.5 -169q-20 -20 -50 -20q-28 0 -48 20q-102 91 -189 219t-138 238 t-89.5 223.5t-51 165.5t-16.5 74q-1 7 -1 13zM199 1049q0 -5 1 -9q2 -13 8.5 -39.5t24.5 -89t40.5 -128t61 -151t83 -163.5t107.5 -160t133 -145q14 -10 31 -10t29 10q97 87 179.5 209t130 225.5t84.5 214t48.5 156.5t15.5 71q1 6 1 13q0 9 -5 19q-8 16 -24 22l-444 160 q-3 0 -8 1t-8 1l-14 -2l-444 -160q-16 -6 -24 -22q-6 -11 -7 -23zM368 1000h168l152 -390l154 390h168q-6 -15 -16 -43.5t-19 -51.5t-19 -43q-2 -4 -6.5 -6t-10.5 -3.5t-9 -2.5q-5 -3 -8.5 -6.5t-6 -9t-4 -8.5t-4 -10.5t-3.5 -9.5l-24 -60q-108 -273 -128 -324h-126l-54 132 q-8 24 -28 72q-8 24 -28 72l-30 74q-4 9 -9 24t-10.5 27t-14.5 23q-4 4 -9 5.5t-11 1.5t-8 1q-25 61 -56 146z" />
|
||||
<glyph unicode=" " horiz-adv-x="803" />
|
||||
<glyph unicode=" " horiz-adv-x="1606" />
|
||||
<glyph unicode=" " horiz-adv-x="803" />
|
||||
<glyph unicode=" " horiz-adv-x="1606" />
|
||||
<glyph unicode=" " horiz-adv-x="535" />
|
||||
<glyph unicode=" " horiz-adv-x="401" />
|
||||
<glyph unicode=" " horiz-adv-x="267" />
|
||||
<glyph unicode=" " horiz-adv-x="267" />
|
||||
<glyph unicode=" " horiz-adv-x="200" />
|
||||
<glyph unicode=" " horiz-adv-x="321" />
|
||||
<glyph unicode=" " horiz-adv-x="89" />
|
||||
<glyph unicode=" " horiz-adv-x="321" />
|
||||
<glyph unicode=" " horiz-adv-x="401" />
|
||||
<glyph unicode="" horiz-adv-x="500" d="M0 0z" />
|
||||
</font>
|
||||
</defs></svg>
|
After Width: | Height: | Size: 20 KiB |
BIN
plugins/jetpack/_inc/fonts/automatticons/automatticons.ttf
Normal file
BIN
plugins/jetpack/_inc/fonts/automatticons/automatticons.ttf
Normal file
Binary file not shown.
BIN
plugins/jetpack/_inc/fonts/automatticons/automatticons.woff
Normal file
BIN
plugins/jetpack/_inc/fonts/automatticons/automatticons.woff
Normal file
Binary file not shown.
BIN
plugins/jetpack/_inc/fonts/jetpack/jetpack.eot
Normal file
BIN
plugins/jetpack/_inc/fonts/jetpack/jetpack.eot
Normal file
Binary file not shown.
32
plugins/jetpack/_inc/fonts/jetpack/jetpack.svg
Normal file
32
plugins/jetpack/_inc/fonts/jetpack/jetpack.svg
Normal file
|
@ -0,0 +1,32 @@
|
|||
<?xml version="1.0" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
|
||||
<!--
|
||||
2014-6-30: Created.
|
||||
-->
|
||||
<svg xmlns="http://www.w3.org/2000/svg">
|
||||
<metadata>
|
||||
Created by FontForge 20120731 at Mon Jun 30 11:24:39 2014
|
||||
By Michael Arestad
|
||||
Created by Michael Arestad with FontForge 2.0 (http://fontforge.sf.net)
|
||||
</metadata>
|
||||
<defs>
|
||||
<font id="jetpack" horiz-adv-x="512" >
|
||||
<font-face
|
||||
font-family="jetpack"
|
||||
font-weight="500"
|
||||
font-stretch="normal"
|
||||
units-per-em="512"
|
||||
panose-1="2 0 6 9 0 0 0 0 0 0"
|
||||
ascent="448"
|
||||
descent="-64"
|
||||
bbox="51.2002 -12.7998 460.8 396.8"
|
||||
underline-thickness="25.6"
|
||||
underline-position="-51.2"
|
||||
unicode-range="U+F102-F102"
|
||||
/>
|
||||
<missing-glyph />
|
||||
<glyph glyph-name="uniF102" unicode=""
|
||||
d="M256 396.8c113.101 0 204.8 -91.6992 204.8 -204.8s-91.6992 -204.8 -204.8 -204.8s-204.8 91.6992 -204.8 204.8s91.6992 204.8 204.8 204.8zM230.4 140.8v179.2l-80.0771 -125.491c-8.42285 -14.5918 -0.563477 -33.1777 15.7441 -37.3252zM361.677 189.491
|
||||
c8.39648 14.5918 0.563477 33.1777 -15.7441 37.3252l-64.333 16.3838v-179.2z" />
|
||||
</font>
|
||||
</defs></svg>
|
After Width: | Height: | Size: 1.1 KiB |
BIN
plugins/jetpack/_inc/fonts/jetpack/jetpack.ttf
Normal file
BIN
plugins/jetpack/_inc/fonts/jetpack/jetpack.ttf
Normal file
Binary file not shown.
BIN
plugins/jetpack/_inc/fonts/jetpack/jetpack.woff
Normal file
BIN
plugins/jetpack/_inc/fonts/jetpack/jetpack.woff
Normal file
Binary file not shown.
44
plugins/jetpack/_inc/footer.php
Normal file
44
plugins/jetpack/_inc/footer.php
Normal file
|
@ -0,0 +1,44 @@
|
|||
</div><!-- .wrapper -->
|
||||
<div class="footer">
|
||||
|
||||
<nav class="primary nav-horizontal">
|
||||
<div class="a8c-attribution">
|
||||
<span>
|
||||
<?php echo sprintf( __( 'An %s Airline', 'jetpack' ),
|
||||
'<a href="http://automattic.com/" class="a8c-logo" target="_blank">Automattic</a>'
|
||||
); ?>
|
||||
</span>
|
||||
</div>
|
||||
</nav><!-- .primary -->
|
||||
|
||||
<nav class="secondary nav-horizontal">
|
||||
<div class="secondary-footer">
|
||||
<a href="http://jetpack.com" target="_blank">Jetpack <?php echo JETPACK__VERSION; ?></a>
|
||||
<a href="http://wordpress.com/tos/" target="_blank"><?php esc_html_e( 'Terms', 'jetpack' ); ?></a>
|
||||
<a href="http://automattic.com/privacy/" target="_blank"><?php esc_html_e( 'Privacy', 'jetpack' ); ?></a>
|
||||
<?php if ( current_user_can( 'jetpack_manage_modules' ) ) : ?><a href="<?php echo esc_url( Jetpack::admin_url( 'page=jetpack-debugger' ) ); ?>" title="<?php esc_attr_e( 'Test your site’s compatibility with Jetpack.', 'jetpack' ); ?>"><?php _e( 'Debug', 'jetpack' ); ?><?php endif; ?></a>
|
||||
<a href="http://jetpack.com/contact-support/" target="_blank" title="<?php esc_attr_e( 'Contact the Jetpack Happiness Squad.', 'jetpack' ); ?>"><?php _e( 'Support', 'jetpack' ); ?></a>
|
||||
<a href="http://jetpack.com/survey/?rel=<?php echo JETPACK__VERSION; ?>" target="_blank" title="<?php esc_attr_e( 'Take a survey. Tell us how we’re doing.', 'jetpack' ); ?>"><?php _e( 'Give Us Feedback', 'jetpack' ); ?></a>
|
||||
<?php if ( Jetpack::is_active() && current_user_can( 'jetpack_disconnect' ) ) : ?>
|
||||
<a href="<?php echo esc_url( Jetpack::admin_url( 'page=my_jetpack#disconnect' ) ); ?>"><?php esc_html_e( 'Disconnect Jetpack', 'jetpack' ); ?></a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</nav><!-- .secondary -->
|
||||
</div><!-- .footer -->
|
||||
|
||||
<div class="modal" aria-labelledby="modal-label">
|
||||
<header>
|
||||
<a href="#" class="close">×</a>
|
||||
<ul>
|
||||
<li class="learn-more"><a href="javascript:;" data-tab="learn-more"><?php esc_html_e( 'Learn More', 'jetpack' ); ?></a></li>
|
||||
<li class="config"><a href="javascript:;" data-tab="config"><?php esc_html_e( 'Config', 'jetpack' ); ?></a></li>
|
||||
</ul>
|
||||
</header>
|
||||
<div class="content-container"><div class="content"></div></div>
|
||||
</div>
|
||||
<div class="shade"></div>
|
||||
|
||||
</div><!-- .jp-frame -->
|
||||
</div><!-- .jp-content -->
|
||||
|
||||
<?php if ( 'jetpack_modules' == $_GET['page'] ) return; ?>
|
33
plugins/jetpack/_inc/gallery-settings.js
Normal file
33
plugins/jetpack/_inc/gallery-settings.js
Normal file
|
@ -0,0 +1,33 @@
|
|||
/**
|
||||
* Jetpack Gallery Settings
|
||||
*/
|
||||
(function($) {
|
||||
var media = wp.media;
|
||||
|
||||
// Wrap the render() function to append controls.
|
||||
media.view.Settings.Gallery = media.view.Settings.Gallery.extend({
|
||||
render: function() {
|
||||
var $el = this.$el;
|
||||
|
||||
media.view.Settings.prototype.render.apply( this, arguments );
|
||||
|
||||
// Append the type template and update the settings.
|
||||
$el.append( media.template( 'jetpack-gallery-settings' ) );
|
||||
media.gallery.defaults.type = 'default'; // lil hack that lets media know there's a type attribute.
|
||||
this.update.apply( this, ['type'] );
|
||||
|
||||
// Hide the Columns setting for all types except Default
|
||||
$el.find( 'select[name=type]' ).on( 'change', function () {
|
||||
var columnSetting = $el.find( 'select[name=columns]' ).closest( 'label.setting' );
|
||||
|
||||
if ( 'default' === $( this ).val() || 'thumbnails' === $( this ).val() ) {
|
||||
columnSetting.show();
|
||||
} else {
|
||||
columnSetting.hide();
|
||||
}
|
||||
} ).change();
|
||||
|
||||
return this;
|
||||
}
|
||||
});
|
||||
})(jQuery);
|
13
plugins/jetpack/_inc/genericons.php
Normal file
13
plugins/jetpack/_inc/genericons.php
Normal file
|
@ -0,0 +1,13 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Globally registers the 'genericons' style and font.
|
||||
*
|
||||
* This ensures any theme or plugin using it is on the latest version of Genericons, and helps to avoid conflicts.
|
||||
*/
|
||||
add_action( 'init', 'jetpack_register_genericons', 1 );
|
||||
function jetpack_register_genericons() {
|
||||
if ( ! wp_style_is( 'genericons', 'registered' ) ) {
|
||||
wp_register_style( 'genericons', plugins_url( 'genericons/genericons/genericons.css', __FILE__ ), false, '3.1' );
|
||||
}
|
||||
}
|
9
plugins/jetpack/_inc/genericons/COPYING.txt
Normal file
9
plugins/jetpack/_inc/genericons/COPYING.txt
Normal file
|
@ -0,0 +1,9 @@
|
|||
Genericons is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
|
||||
|
||||
The fonts are distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
As a special exception, if you create a document which uses this font, and embed this font or unaltered portions of this font into the document, this font does not by itself cause the resulting document to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the document might be covered by the GNU General Public License. If you modify this font, you may extend this exception to your version of the font, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version.
|
||||
|
||||
This license does not convey any intellectual property rights to third party trademarks that may be included in the icon font; such marks remain subject to all rights and guidelines of use of their owner.
|
339
plugins/jetpack/_inc/genericons/LICENSE.txt
Normal file
339
plugins/jetpack/_inc/genericons/LICENSE.txt
Normal file
|
@ -0,0 +1,339 @@
|
|||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License.
|
218
plugins/jetpack/_inc/genericons/README.md
Normal file
218
plugins/jetpack/_inc/genericons/README.md
Normal file
|
@ -0,0 +1,218 @@
|
|||
# Genericons
|
||||
|
||||
Genericons are vector icons embedded in a webfont designed to be clean and simple keeping with a generic aesthetic.
|
||||
|
||||
Use genericons for instant HiDPI, to change icon colors on the fly, or even with CSS effects such as drop-shadows or gradients!
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
To use it, place the `genericons` folder in your stylesheet directory and enqueue the genericons.css file. Now you can create an icon like this:
|
||||
|
||||
```
|
||||
.my-icon:before {
|
||||
content: '\f101';
|
||||
font: normal 16px/1 'Genericons';
|
||||
display: inline-block;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
```
|
||||
|
||||
This will output a comment icon before every element with the class "my-icon". The `content: '\f101';` part of this CSS is easily copied from the helper tool at http://genericons.com/, or `example.html` in the `font` directory.
|
||||
|
||||
You can also use the bundled example.css if you'd rather insert the icons using HTML tags.
|
||||
|
||||
|
||||
## Building your own Genericons
|
||||
|
||||
In the `source` directory, you'll find all Genericons source icons in SVG format. This will allow you to bake your own flavor of Genericons using a tool such as FontCustom (http://fontcustom.com) or Fontello (http://fontello.com). Perhaps you need more logos than are available in the base Genericons package? Just add those logos and bake your own expanded set. Maybe you need just a few of the icons Genericons provides, but would like to trim the fat? Remove the ones you won't need!
|
||||
|
||||
|
||||
### FontCustom instructions
|
||||
|
||||
FontCustom is a powerful commandline tool which which bakes icon fonts from the SVG source files. It's the tool Genericons is built on, and it provides highly accurate and perfectly crisp icons, *provided all SVGs have the same pixel height*.
|
||||
|
||||
It's not that hard to use, and once it's installed you'll never think of icon-fonts the same way again. Seriously, you should try it. Icon fonts for everyone!
|
||||
|
||||
1. Install FontCustom. Follow the instructions on the website: http://fontcustom.com/
|
||||
2. In the `source` directory from the Genericons download, open the file called `fontcustom.yml` in a text editor. Customize the `font_name` and `css_selector`.
|
||||
3. Open a terminal. Browse to the `source` directory. Type `fontcustom compile`.
|
||||
|
||||
You'll now receive a brand new subdirectory called `fontcustom-webfont`. Inside here you'll find your very own flavor of Genericons, with only the icons you want, including a handy example page that'll help you copy/paste the necessary glyphs or CSS values.
|
||||
|
||||
*Please note*: In the source directory, there's a hidden file called `.fontcustom-manifest.json`. This file is auto-generated by the FontCustom tool, and holds codepoints (unicode addresses) for every glyph, so its address doesn't change when you add or remove icons. If you feel the need to "start fresh" with the unicode addresses, you should delete this file.
|
||||
|
||||
|
||||
### Fontello instructions
|
||||
|
||||
Fontello is very easy to use. Just drop the SVG files of the icons you want onto their website and download the font. The downside is that Fontello seems to ignore the 16px pixelgrid, so you'll end up with fuzzy icons. Buyer beware.
|
||||
|
||||
|
||||
## Notes
|
||||
|
||||
**Photoshop mockups**
|
||||
|
||||
The `Genericons.ttf` file can be placed in your system fonts folder and used Photoshop or other graphics apps if you like.
|
||||
|
||||
If you're using Genericons in your Photoshop mockups, please remember to delete the old version of the font from Font Book, and grab the new one from the zip file. This also affects using it in your webdesigns: if you have an old version of the font installed locally, that's the font that'll be used in your website as well, so if you're missing icons, check for old versions of the font on your system.
|
||||
|
||||
**Pixel grid**
|
||||
|
||||
Genericons has been designed for a 16x16px grid. That means it'll look sharp at font-size: 16px exactly. It'll also be crisp at multiples thereof, such as 32px or 64px. It'll look reasonably crisp at in-between font sizes such as 24px or 48px, but not quite as crisp as 16 or 32. Please don't set the font-size to 17px, though, that'll just look terrible blurry.
|
||||
|
||||
**Antialiasing**
|
||||
|
||||
If you keep intact the `-webkit-font-smoothing: antialiased;` and `-moz-osx-font-smoothing: grayscale;` CSS properties. That'll make the icons look their best possible, in Firefox and WebKit based browsers.
|
||||
|
||||
**optimizeLegibility**
|
||||
|
||||
Note: On Android browsers with version 4.2, 4.3, and probably later, Genericons will simply not show up if you're using the CSS property "text-rendering" set to "optimizeLegibility.
|
||||
|
||||
**Updates**
|
||||
|
||||
We don't often update icons, but do very carefully when we get good feedback suggesting improvements. Please be mindful if you upgrade, and check that the updated icons behave as you intended.
|
||||
|
||||
**Base64 encoding**
|
||||
|
||||
By default, Genericons ships with a stylesheet that includes a base64 encoded version of the font. This is to sidestep issues with cross-origin requests for fonts, that happen when a stylesheet loads a font that's stored on a different domain or subdomain. This is very common when using caching plugins.
|
||||
|
||||
Base64 encoding comes with a 25% filesize overhead compared to just loading the WOFF file directly. If you know that you won't be loading fonts across domains, or have the ability to edit your server config files to allow it, you can get slightly faster performance by loading Genericons without the base64 encoding. Simply edit `genericons.css` and edit the `@font-face` declaration to match this:
|
||||
|
||||
```
|
||||
@font-face {
|
||||
font-family: 'Genericons';
|
||||
src: url('Genericons.woff') format('woff'),
|
||||
url('Genericons.ttf') format('truetype'),
|
||||
url('Genericons.svg#genericonsregular') format('svg');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
## Changelog
|
||||
|
||||
**3.4.1**
|
||||
|
||||
* IE8 support restored.
|
||||
|
||||
**3.4**
|
||||
|
||||
* Updated: Update Google Plus icon to new geometric version. This also *retires* the "alt" version, so *please be mindful if you choose to update, make sure you use the `f206` glyph, not the `f218` glyph, as it no longer exists!
|
||||
* New: Added helper rotation classes to the base CSS, thanks to geminorum. Apply `genericon-rotate-90` to rotate 90 degrees, -180, -270. Or `genericon-flip-horizontal` or -vertical.
|
||||
|
||||
*Again, it is important if you choose to update to this version, make sure you're not using `genericon-googleplus-alt` or unicode character `f218`, as that has been retired! Use `genericon-googleplus` and glyph `f206` instead!*
|
||||
|
||||
**3.3.1**
|
||||
|
||||
Security Hardening: Remove Genericons example.html file. Please visit genericons.com instead.
|
||||
|
||||
**3.3**
|
||||
|
||||
The Open Source release.
|
||||
|
||||
You can now build your own flavors of Genericons with all the SVGs provided.
|
||||
|
||||
|
||||
**3.2**
|
||||
|
||||
A number of new icons and a couple of quick updates.
|
||||
|
||||
* New: Activity
|
||||
* New: HTML anchor
|
||||
* New: Bug
|
||||
* New: Download
|
||||
* New: Handset
|
||||
* New: Microphone
|
||||
* New: Minus
|
||||
* New: Plus
|
||||
* New: Move
|
||||
* New: Rating stars, empty, half, full
|
||||
* New: Shuffle
|
||||
* New: video camera
|
||||
* New: Spotify
|
||||
* New: Twitch
|
||||
* Update: Fixed geometry in Edit icon
|
||||
* Update: Updated Foursquare icon
|
||||
* IE8 bugfix, slipstreamed into this.
|
||||
|
||||
Twitch and Spotify mark the last social icons that will be added to Genericons.
|
||||
Future social icons will have to happen in a separate font.
|
||||
|
||||
**3.1**
|
||||
|
||||
Genericons is now generated using a commandline tool called FontCustom. This makes it far easier to add new icons to the font, but the switch means the download zip now has a different layout, fonts have different filenames, there's now no .otf font included (but the .ttf should suffice), and the font now has slightly different metrics. I've taken great care to ensure this new version should work as a drop-in replacement, but please be mindful and test carefully if you choose to upgrade.
|
||||
|
||||
* Per feedback, the baked-in 16px width and height has been removed from the helper CSS. It wasn't really necessary (the glyph itself has these dimensions naturally), and it caused some headaches.
|
||||
* Base64 encoding is now included by default in the helper CSS. This makes it drop-in easy to get Genericons working in Firefox even when using a CDN.
|
||||
* Title attribute on website tool.
|
||||
* New: Website.
|
||||
* New: Ellipsis.
|
||||
* New: Foursquare.
|
||||
* New: X-post.
|
||||
* New: Sitemap.
|
||||
* New: Hierarchy.
|
||||
* New: Paintbrush.
|
||||
* Updated: Show and Hide icons were updated for clarity.
|
||||
|
||||
**3.0.3**
|
||||
|
||||
Bunch of updates mostly.
|
||||
|
||||
* Two new icons, Dropbox and Fullscreen.
|
||||
* Updates to all icons containing an exclamation mark.
|
||||
* Updates to Image and Quote.
|
||||
* Nicer "Share" icon.
|
||||
* Bigger default Linkedin icon.
|
||||
|
||||
**3.0.2**
|
||||
|
||||
A slew of new stuff and updates.
|
||||
|
||||
* Social icons: Skype, Digg, Reddit, Stumbleupon, Pocket.
|
||||
* New generic icons: heart, lock and print.
|
||||
* New editing icons: code, bold, italic, image
|
||||
* New interaction icons: subscribe, unsubscribe, subscribed, reply all, reply, flag.
|
||||
* The hyperlink icon has been updated to be clearer, chunkier.
|
||||
* The "home" icon has been updated for style, size and clarity.
|
||||
* The email icon has been updated for style and clarity, and to fit with the new subscribe icons.
|
||||
* The document icon has been updated for style.
|
||||
* The "pin" icon has been updated for style and clarity.
|
||||
* The Twitter icon has been scaled down to fit with the other social icons.
|
||||
|
||||
**3.0.1**
|
||||
|
||||
Mostly maintenance.
|
||||
|
||||
* Fixed an issue with the example page that showed an old "top" icon instead of the actual NEW "refresh" icon.
|
||||
* Added inverse Google+ and Path.
|
||||
* Replaced tabs with spaces in the helper CSS.
|
||||
* Changed the Genericons.com copy/paste tool to serve span's instead of div's for casual icon insertion. It's being converted to "inline-block" anyway.
|
||||
|
||||
**3.0**
|
||||
|
||||
Mainly maintenance and a few new icons.
|
||||
|
||||
* Fast forward, rewind, PollDaddy, Notice, Info, Help, Portfolio
|
||||
* Updated the feed icon. It's a bit smaller now for consistency, the previous one was rather big.
|
||||
* So, the previous version numbering, 2.09, wasn't very PHP version compare friendly. So from now on it'll be 3.0, 3.1 etc. Props Ipstenu.
|
||||
* Genericons.com now has a mini release blog.
|
||||
* The CSS has prettier formatting, props Konstantin Obenland.
|
||||
|
||||
**2.09**
|
||||
|
||||
Updated Facebook icon to new version. Updated Instagram logo to use new one-color version. Updated Google+ icon to use same radius as Instagram and Facebook. Added a bunch of new icons, cog, unapprove, cart, media player buttons, tablet, send to tablet.
|
||||
|
||||
**2.06**
|
||||
|
||||
Included Base64 encoded version. This is necessary for Genericons to work with CDNs in Firefox. Firefox blocks fonts linked from a different domain. A CDN (typically s.example.com) usually puts the font on a subdomain, and is hence blocked in Firefox.
|
||||
|
||||
**2.05**
|
||||
|
||||
Added a bunch of new icons, including upload to cloud, download to cloud, many more.
|
||||
|
||||
**2.0**
|
||||
|
||||
Initial public release
|
11
plugins/jetpack/_inc/genericons/genericons.css
Normal file
11
plugins/jetpack/_inc/genericons/genericons.css
Normal file
|
@ -0,0 +1,11 @@
|
|||
@import url('genericons/genericons.css');
|
||||
|
||||
/*
|
||||
|
||||
|
||||
This file location is deprecated
|
||||
|
||||
Please link to the genericons.css file in the font folder instead
|
||||
|
||||
|
||||
*/
|
BIN
plugins/jetpack/_inc/genericons/genericons/Genericons.eot
Normal file
BIN
plugins/jetpack/_inc/genericons/genericons/Genericons.eot
Normal file
Binary file not shown.
537
plugins/jetpack/_inc/genericons/genericons/Genericons.svg
Normal file
537
plugins/jetpack/_inc/genericons/genericons/Genericons.svg
Normal file
|
@ -0,0 +1,537 @@
|
|||
<?xml version="1.0" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
|
||||
<!--
|
||||
2015-9-18: Created with FontForge (http://fontforge.org)
|
||||
-->
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1">
|
||||
<metadata>
|
||||
Created by FontForge 20150618 at Fri Sep 18 10:24:13 2015
|
||||
By Joen Asmussen
|
||||
Copyright (c) 2015, Joen Asmussen
|
||||
</metadata>
|
||||
<defs>
|
||||
<font id="Genericons" horiz-adv-x="2048" >
|
||||
<font-face
|
||||
font-family="Genericons"
|
||||
font-weight="400"
|
||||
font-stretch="normal"
|
||||
units-per-em="2048"
|
||||
panose-1="2 0 5 3 0 0 0 0 0 0"
|
||||
ascent="2048"
|
||||
descent="0"
|
||||
bbox="-0.0140489 0 2048.01 2048"
|
||||
underline-thickness="102.4"
|
||||
underline-position="-204.8"
|
||||
unicode-range="U+0020-F517"
|
||||
/>
|
||||
<missing-glyph />
|
||||
<glyph glyph-name="space" unicode=" " horiz-adv-x="200"
|
||||
/>
|
||||
<glyph glyph-name="uniF413" unicode=""
|
||||
d="M256 1280c565.504 0 1024 -458.496 1024 -1024h-256c0 423.552 -344.448 768 -768 768v256zM256 1792c848.256 0 1536 -687.744 1536 -1536h-256c0 705.792 -574.208 1280 -1280 1280v256zM448 640c106.112 0 192 -86.0156 192 -192s-85.8877 -192 -192 -192
|
||||
s-192 86.0156 -192 192s85.8877 192 192 192z" />
|
||||
<glyph glyph-name="uniF462" unicode=""
|
||||
d="M618.502 1337l-213.004 142.004l-303.335 -455.002l303.335 -455.002l213.004 142.004l-208.665 312.998zM1642.5 1479l-213.004 -142.004l208.665 -312.998l-208.665 -312.998l213.004 -142.004l303.335 455.002zM771.821 543.045l248.357 -62.0898l256 1024
|
||||
l-248.357 62.0898z" />
|
||||
<glyph glyph-name="uniF457" unicode=""
|
||||
d="M1024 1792c424.064 0 768 -343.936 768 -768s-343.936 -768 -768 -768c-424.192 0 -768 343.936 -768 768s343.808 768 768 768zM1024 512c70.6562 0 128 57.4717 128 128s-57.3438 128 -128 128c-70.7842 0 -128 -57.4717 -128 -128s57.2158 -128 128 -128z
|
||||
M1342.72 1155.84c24.832 38.9121 37.248 85.1201 37.1201 138.752c0 74.4961 -27.6475 133.504 -83.7119 176.641c-55.9355 43.2637 -133.632 64.7676 -231.936 64.7676c-119.809 0 -234.496 -31.2324 -344.32 -93.9521l91.9043 -180.096
|
||||
c89.2158 47.2314 167.168 70.9121 233.983 70.9121c26.752 0 48.5127 -5.37598 65.2803 -16.2559c17.2803 -10.752 25.4717 -25.4727 25.4717 -44.0322c0 -23.2959 -8.06348 -44.0322 -23.5518 -62.208c-16 -18.0479 -41.4717 -38.4004 -77.1836 -60.9277
|
||||
c-45.1846 -28.1602 -76.416 -57.0889 -94.3359 -87.04c-17.5361 -29.6963 -26.3682 -66.4326 -26.3682 -109.44v-56.96h203.647v34.0479c0 18.6885 5.50391 35.2002 17.2803 48.8965c12.0322 14.0801 40.96 36.0957 86.9121 66.0479
|
||||
c55.04 34.8154 94.5918 71.6797 119.808 110.848z" />
|
||||
<glyph glyph-name="uniF403" unicode=""
|
||||
d="M1541.38 1530.62l506.624 -506.624l-506.624 -506.624c-131.456 -134.272 -314.752 -217.728 -517.376 -217.728c-202.752 0 -386.048 83.4551 -517.504 217.983l-506.496 506.368v0l506.496 506.496c131.456 134.4 314.624 217.984 517.504 217.984
|
||||
c202.752 0 385.92 -83.584 517.376 -217.856zM1404.42 651.776l372.096 372.224l-370.943 370.944c-102.528 104.704 -237.568 161.536 -381.568 161.536c-144.128 0 -279.168 -56.9609 -380.288 -160.385l-372.096 -372.096l370.688 -370.56
|
||||
c102.528 -104.96 237.696 -161.792 381.824 -161.792c144 0 279.168 56.832 380.288 160.128zM1408 1024zM640 1024c0 212.096 172.032 384 384 384s384 -171.904 384 -384c0 -211.968 -172.032 -384 -384 -384s-384 172.032 -384 384zM768 1152
|
||||
c0 -70.6562 57.2158 -128 128 -128c70.6562 0 128 57.3438 128 128s-57.3438 128 -128 128c-70.7842 0 -128 -57.3438 -128 -128z" />
|
||||
<glyph glyph-name="uniF505" unicode=""
|
||||
d="M256 1408v256h256v-256h-256zM768 1664h1024v-256h-1024v256zM256 896v256h256v-256h-256zM1408 1152v-256h-640v256h640zM256 384v256h256v-256h-256zM768 384v256h896v-256h-896z" />
|
||||
<glyph glyph-name="uniF50F" unicode=""
|
||||
d="M1920 1024l-384 -384v256h-384v-384h256l-384 -384l-384 384h256v384h-384v-256l-384 384l384 384v-256h384v384h-256l384 384l384 -384h-256v-384h384v256z" />
|
||||
<glyph glyph-name="uniF307" unicode=""
|
||||
d="M768 640v128h128v-128h-128zM768 896v128h128v-128h-128zM768 1152v128h128v-128h-128zM512 640v128h128v-128h-128zM512 896v128h128v-128h-128zM1280 896v128h128v-128h-128zM1024 1152v128h128v-128h-128zM1280 1152v128h128v-128h-128zM1408 1664h256v-1280h-1408
|
||||
v1280h256v128h128v-128h640v128h128v-128zM1536 640v640c0 70.7842 -57.2158 128 -128 128h-896c-70.6562 0 -128 -57.2158 -128 -128v-640c0 -70.7842 57.3438 -128 128 -128h896c70.7842 0 128 57.2158 128 128zM1024 896v128h128v-128h-128zM1024 640v128h128v-128h-128z
|
||||
" />
|
||||
<glyph glyph-name="uniF460" unicode=""
|
||||
d="M1664 1280h128l-256 -768h-768l256 768h128l86.2725 256h339.455zM1300.86 1280h214.271l-43.1357 128h-128zM809.728 1536l86.2725 -256l-256 -768h-128l-256 768h128l86.2725 256h339.455zM532.864 1280h214.271l-43.1357 128h-128z" />
|
||||
<glyph glyph-name="uniF430" unicode=""
|
||||
d="M1024 1453.31l86.6562 -86.6553l-342.656 -342.656h896v-128h-896l342.656 -342.656l-86.6562 -86.6553l-493.312 493.312z" />
|
||||
<glyph glyph-name="uniF515" unicode=""
|
||||
d="M1024 1920c499.2 0 896 -396.8 896 -896s-396.8 -896 -896 -896s-896 396.8 -896 896s396.8 896 896 896zM1382.4 601.6c38.3994 0 64 25.6006 64 51.2002c0 38.4004 -12.8008 51.2002 -38.4004 64c-153.6 89.6006 -332.8 140.8 -524.8 140.8
|
||||
c-115.2 0 -217.601 -25.5996 -320 -51.1992c-25.6006 -12.8008 -51.2002 -25.6006 -51.2002 -64c0 -25.6006 12.7998 -51.2002 51.2002 -51.2002c0 0 25.5996 12.7998 38.3994 12.7998c89.6006 12.7998 192 25.5996 281.601 25.5996
|
||||
c166.399 0 332.8 -38.3994 460.8 -115.199c12.7998 -12.8008 25.5996 -12.8008 38.4004 -12.8008zM1484.8 832c38.4004 0 64 38.4004 64 76.7998c0 38.4004 -12.7998 64 -38.3994 76.7998c-179.2 102.4 -409.601 166.4 -640 166.4c-153.601 0 -256 -25.5996 -358.4 -51.2002
|
||||
c-38.4004 -12.7998 -51.2002 -38.3994 -51.2002 -76.7998s38.4004 -76.7998 76.7998 -89.5996c12.8008 0 25.6006 12.7998 38.4004 12.7998c76.7998 25.5996 179.2 38.3994 294.4 38.3994c217.6 0 422.399 -51.1992 563.199 -140.8
|
||||
c25.6006 0 25.6006 -12.7998 51.2002 -12.7998zM1600 1113.6c38.4004 0 76.7998 38.4004 76.7998 89.6006c0 38.3994 -25.5996 64 -51.2002 76.7998c-204.8 128 -473.6 179.2 -742.399 179.2c-153.601 0 -294.4 -12.7998 -422.4 -51.2002
|
||||
c-38.3994 -12.7998 -64 -38.4004 -64 -89.5996c0 -51.2002 38.4004 -89.6006 89.6006 -89.6006c25.5996 0 38.3994 12.7998 51.1992 12.7998c115.2 25.6006 230.4 38.4004 358.4 38.4004c243.2 0 486.4 -51.2002 652.8 -153.6
|
||||
c25.6006 -12.8008 38.4004 -12.8008 51.2002 -12.8008z" />
|
||||
<glyph glyph-name="uniF448" unicode=""
|
||||
d="M512 384v1280h384v-1280h-384zM1152 1664h384v-1280h-384v1280z" />
|
||||
<glyph glyph-name="uniF453" unicode=""
|
||||
d="M1536 2048c141.312 0 256 -114.688 256 -256v-1536c0 -141.312 -114.688 -256 -256 -256h-1024c-141.312 0 -256 114.688 -256 256v1536c0 141.312 114.688 256 256 256h1024zM1024 128c70.7842 0 128 57.2158 128 128s-57.2158 128 -128 128
|
||||
c-70.6562 0 -128 -57.2158 -128 -128s57.3438 -128 128 -128zM1536 512v1280h-1024v-1280h1024z" />
|
||||
<glyph glyph-name="uniF419" unicode=""
|
||||
d="M0 256v256h2048v-256h-2048zM0 1792h2048v-256h-2048v256zM0 896v256h2048v-256h-2048z" />
|
||||
<glyph glyph-name="uniF423" unicode=""
|
||||
d="M567.936 1440.9l-267.136 -480.896h403.2v-384h-128v256h-492.8l372.864 671.104zM1644.8 960h403.2v-384h-128v256h-492.8l372.864 671.104l112 -62.207zM1088 1344c176.768 0 320 -143.232 320 -320s-143.232 -320 -320 -320s-320 143.232 -320 320
|
||||
s143.232 320 320 320zM1088 832c105.856 0 192 86.1436 192 192s-86.1436 192 -192 192s-192 -86.1436 -192 -192s86.1436 -192 192 -192z" />
|
||||
<glyph glyph-name="uniF512" unicode=""
|
||||
d="M1920 1280l-555.136 -387.968l212.863 -636.032l-553.728 394.496l-553.728 -394.496l212.991 636.032l-555.264 387.968h685.312l210.688 640l210.688 -640h685.312z" />
|
||||
<glyph glyph-name="uniF417" unicode=""
|
||||
d="M960 1792c318.08 0 576 -257.92 576 -576c0 -159.232 -64.6396 -303.36 -169.088 -407.68l-406.912 -407.04l-406.912 407.04c-104.448 104.319 -169.088 248.447 -169.088 407.68c0 318.08 257.92 576 576 576zM960 896c176.64 0 320 143.36 320 320
|
||||
s-143.36 320 -320 320c-176.768 0 -320 -143.36 -320 -320s143.232 -320 320 -320z" />
|
||||
<glyph glyph-name="uniF410" unicode=""
|
||||
d="M256 1536h1536v-128l-768 -384l-768 384v128zM256 1216l768 -384l768 384v-704h-1536v704z" />
|
||||
<glyph glyph-name="uniF449" unicode=""
|
||||
d="M512 512v1024h1024v-1024h-1024z" />
|
||||
<glyph glyph-name="uniF467" unicode=""
|
||||
d="M1280 1280c282.752 0 512 -229.248 512 -512v-299.904l-150.016 149.889c-99.9688 99.9678 -231.04 150.016 -361.984 150.016h-256v-384l-640 640l640 640v-384h256z" />
|
||||
<glyph glyph-name="uniF224" unicode=""
|
||||
d="M1536 1792c141.312 0 256 -114.688 256 -256v-384c0 -424.064 -343.936 -768 -768 -768s-768 343.936 -768 768v384c0 141.312 114.688 256 256 256h1024zM1498.5 1189.5c50.0479 50.0479 50.0479 131.072 0 180.992c-50.0479 50.0479 -130.944 50.0479 -180.992 0
|
||||
l-293.504 -293.504l-293.504 293.504c-50.0479 50.0479 -131.072 50.0479 -180.992 0c-50.0479 -49.9199 -50.0479 -130.944 0 -180.992l361.984 -361.984l4.22363 4.22461c22.4004 -37.376 61.5684 -63.7441 108.288 -63.7441s85.8877 26.3682 108.288 63.7441
|
||||
l4.22363 -4.22461z" />
|
||||
<glyph glyph-name="uniF203" unicode=""
|
||||
d="M1664 1920c141.312 0 256 -114.688 256 -256v-1280c0 -141.312 -114.688 -256 -256 -256h-281.856v711.168h269.44l12.416 259.456h-281.984v192.384v0.255859v12.0322c0 71.2959 15.2324 114.432 108.544 114.432c86.6562 0 166.017 -0.639648 166.017 -0.639648
|
||||
l5.8877 242.304s-77.6963 9.98438 -182.528 9.98438c-259.584 0 -372.096 -159.872 -372.096 -333.952v-236.8h-254.336v-259.328h254.336v-711.296h-723.84c-141.312 0 -256 114.688 -256 256v1280c0 141.312 114.688 256 256 256h1280z" />
|
||||
<glyph glyph-name="uniF502" unicode=""
|
||||
d="M128 2048h1920l-960 -960z" />
|
||||
<glyph glyph-name="uniF412" unicode=""
|
||||
d="M1920 832l-640 -640v448h-1024v704l384 384v-704h640v448z" />
|
||||
<glyph glyph-name="uniF440" unicode=""
|
||||
d="M1152 640v-256h256l-384 -384l-384 384h256v256h256zM1664 1024c141.312 0 256 -114.688 256 -256s-114.688 -256 -256 -256h-384v256h-512v-256h-384c-141.312 0 -256 114.688 -256 256s114.688 256 256 256h6.40039c-4.09668 20.7363 -6.40039 42.1123 -6.40039 64
|
||||
c0 176.768 143.232 320 320 320c89.3438 0 169.984 -36.7363 227.968 -95.8721c60.7998 131.84 193.408 223.872 348.032 223.872c211.968 0 384 -171.904 384 -384c0 -45.1836 -9.21582 -87.8076 -23.5518 -128h23.5518z" />
|
||||
<glyph glyph-name="uniF305" unicode=""
|
||||
d="M1408 1664h256v-1280h-1408v1280h256v128h128v-128h640v128h128v-128zM1536 640v640c0 70.7842 -57.2158 128 -128 128h-896c-70.6562 0 -128 -57.2158 -128 -128v-640c0 -70.7842 57.3438 -128 128 -128h896c70.7842 0 128 57.2158 128 128zM960 1280
|
||||
c35.3281 0 64 -28.6719 64 -64v-512c0 -35.3281 -28.6719 -64 -64 -64s-64 28.6719 -64 64v448h-64c-35.3281 0 -64 28.6719 -64 64s28.6719 64 64 64h128z" />
|
||||
<glyph glyph-name="uniF443" unicode=""
|
||||
d="M1152 1664l384 -384v-121.472v-6.52832v-768h-1024v1280h512h128zM1408 512v640h-256h-128v128v256h-384v-1024h768z" />
|
||||
<glyph glyph-name="uniF411" unicode=""
|
||||
d="M1280 1728l448 -448l-896 -896h-448v448zM1280 1536l-594.688 -594.688l96 -96l594.688 594.688zM768 512l128 128l-96 96v0l-64 64v0l-96 96l-128 -128zM845.312 781.312l96 -96l594.688 594.688l-96 96z" />
|
||||
<glyph glyph-name="uniF402" unicode=""
|
||||
d="M896 1536v-256h256v-128h-256v-256h-128v256h-256v128h256v256h128zM1297.15 878.848l494.848 -494.848l-128 -128l-494.848 494.848c-94.8486 -68.9912 -210.816 -110.848 -337.152 -110.848c-318.08 0 -576 257.92 -576 576s257.92 576 576 576s576 -257.92 576 -576
|
||||
c0 -126.336 -41.8564 -242.304 -110.848 -337.152zM832 768c247.552 0 448 200.576 448 448s-200.448 448 -448 448c-247.424 0 -448 -200.576 -448 -448s200.576 -448 448 -448z" />
|
||||
<glyph glyph-name="uniF420" unicode=""
|
||||
d="M483.2 1564.8l-227.2 227.2h640v-640l-232.32 232.32c-93.0557 -92.1602 -151.68 -218.88 -151.68 -360.32c0 -238.208 163.584 -436.736 384 -493.824v-262.656c-363.008 61.0566 -640 376.064 -640 756.48c0 212.096 88.0645 402.048 227.2 540.8zM1792 1024
|
||||
c0 -212.096 -88.0645 -401.92 -227.2 -540.8l227.2 -227.2h-640v640l18.5596 -18.5596l213.761 -213.761c93.0557 92.1602 151.68 218.88 151.68 360.32c0 238.208 -163.584 436.736 -384 493.824v262.656c363.008 -61.0566 640 -376.064 640 -756.48z" />
|
||||
<glyph glyph-name="uniF425" unicode=""
|
||||
d="M704 1024c35.3281 0 64 -28.6719 64 -64s-28.6719 -64 -64 -64s-64 28.6719 -64 64s28.6719 64 64 64zM704 1280c35.3281 0 64 -28.6719 64 -64s-28.6719 -64 -64 -64s-64 28.6719 -64 64s28.6719 64 64 64zM704 768c35.3281 0 64 -28.6719 64 -64s-28.6719 -64 -64 -64
|
||||
s-64 28.6719 -64 64s28.6719 64 64 64zM896 896v128h384v-128h-384zM896 640v128h384v-128h-384zM1280 1664h256v-1280h-1152v1280h256c0 70.7842 57.3438 128 128 128h384c70.7842 0 128 -57.2158 128 -128zM832 1664c-35.3281 0 -64 -28.6719 -64 -64s28.6719 -64 64 -64
|
||||
h256c35.3281 0 64 28.6719 64 64s-28.6719 64 -64 64h-256zM1408 512v1024h-128v-128h-640v128h-128v-1024h896zM896 1152v128h384v-128h-384z" />
|
||||
<glyph glyph-name="uniF508" unicode=""
|
||||
d="M1450.5 1395.2c45.6963 -69.376 124.288 -115.2 213.504 -115.2c5.50391 0 10.4961 1.28027 15.8721 1.66406l-399.872 -799.872l-256 512l-256 -512l-128 256l-256 -512l-299.776 599.424l228.992 114.561l70.7842 -141.568l256 512l128 -256l256 512l256 -512z
|
||||
M1664 1728c106.112 0 192 -86.0156 192 -192s-85.8877 -192 -192 -192s-192 86.0156 -192 192s85.8877 192 192 192z" />
|
||||
<glyph glyph-name="uniF507" unicode=""
|
||||
d="M1792 604.544c76.2881 -44.416 128 -126.08 128 -220.544c0 -141.312 -114.688 -256 -256 -256s-256 114.688 -256 256c0 94.5918 51.7119 176.128 128 220.544v163.456c0 70.7842 -57.2158 128 -128 128h-256v-291.456c76.2881 -44.416 128 -126.08 128 -220.544
|
||||
c0 -141.312 -114.688 -256 -256 -256s-256 114.688 -256 256c0 94.4639 51.8398 176.128 128 220.544v291.456h-256c-70.6562 0 -128 -57.2158 -128 -128v-163.456c76.1602 -44.416 128 -126.08 128 -220.544c0 -141.312 -114.688 -256 -256 -256s-256 114.688 -256 256
|
||||
c0 94.4639 51.8398 176.128 128 220.544v163.456c0 212.096 171.904 384 384 384h256v291.456c-76.1602 44.416 -128 126.08 -128 220.544c0 141.312 114.688 256 256 256s256 -114.688 256 -256c0 -94.4639 -51.7119 -176.128 -128 -220.544v-291.456h256
|
||||
c211.968 0 384 -171.904 384 -384v-163.456zM1024 1792c-70.6562 0 -128 -57.3438 -128 -128s57.3438 -128 128 -128s128 57.3438 128 128s-57.3438 128 -128 128zM384 256c70.6562 0 128 57.2158 128 128s-57.3438 128 -128 128s-128 -57.2158 -128 -128
|
||||
s57.3438 -128 128 -128zM1024 256c70.6562 0 128 57.2158 128 128s-57.3438 128 -128 128s-128 -57.2158 -128 -128s57.3438 -128 128 -128zM1664 256c70.7842 0 128 57.2158 128 128s-57.2158 128 -128 128s-128 -57.2158 -128 -128s57.2158 -128 128 -128z" />
|
||||
<glyph glyph-name="uniF306" unicode=""
|
||||
d="M1151.87 1219.46c0.12793 -0.511719 0.12793 -0.896484 0.12793 -1.4082v-1.79199v-0.255859c0 -5.12012 -0.639648 -10.3682 -1.91992 -15.4883l-128 -512c-8.57617 -34.1758 -43.2637 -55.04 -77.5684 -46.5918c-34.3037 8.57617 -55.168 43.2637 -46.5918 77.5684
|
||||
l108.16 432.512h-174.08c-35.3281 0 -64 28.6719 -64 64s28.6719 64 64 64h256h1.53613h1.28027c1.02344 -0.12793 1.91992 -0.12793 2.81543 -0.255859h0.255859c30.3359 -2.68848 54.5283 -26.624 57.8564 -56.96v0c0 -0.768555 0.12793 -1.4082 0.12793 -2.04785
|
||||
v-1.28027zM1408 1664h256v-1280h-1408v1280h256v128h128v-128h640v128h128v-128zM1536 640v640c0 70.7842 -57.2158 128 -128 128h-896c-70.6562 0 -128 -57.2158 -128 -128v-640c0 -70.7842 57.3438 -128 128 -128h896c70.7842 0 128 57.2158 128 128z" />
|
||||
<glyph glyph-name="uniF406" unicode=""
|
||||
d="M2048 1920l-832 -832l832 -832l-128 -128l-832 832l-832 -832l-128 128l832 832l-832 832l128 128l832 -832l832 832z" />
|
||||
<glyph glyph-name="uniF215" unicode=""
|
||||
d="M1664 1920c141.312 0 256 -114.688 256 -256v-1280c0 -141.312 -114.688 -256 -256 -256h-1280c-141.312 0 -256 114.688 -256 256v1280c0 141.312 114.688 256 256 256h1280zM1024 1408c-212.096 0 -384 -171.904 -384 -384c0 -211.968 171.904 -384 384 -384
|
||||
c211.968 0 384 172.032 384 384c0 212.096 -172.032 384 -384 384zM1792 384v768h-274.176c10.624 -41.0879 18.1758 -83.4561 18.1758 -128c0 -282.752 -229.248 -512 -512 -512s-512 229.248 -512 512c0 44.5439 7.42383 86.9121 18.1758 128h-274.176v-768
|
||||
c0 -70.7842 57.3438 -128 128 -128h1280c70.7842 0 128 57.2158 128 128zM1792 1536v128c0 70.6562 -57.2158 128 -128 128h-128c-70.7842 0 -128 -57.3438 -128 -128v-128c0 -70.6562 57.2158 -128 128 -128h128c70.7842 0 128 57.3438 128 128z" />
|
||||
<glyph glyph-name="uniF202" unicode=""
|
||||
d="M1920 1583.74c-49.2803 -73.7285 -111.744 -138.368 -183.552 -190.208c0.767578 -15.7441 1.2793 -31.6162 1.2793 -47.4883c0 -485.76 -369.92 -1046.02 -1046.27 -1046.02c-207.616 0 -400.768 60.7998 -563.456 165.248
|
||||
c28.7998 -3.45605 58.1123 -5.24805 87.8076 -5.24805c172.032 0 330.752 58.752 456.448 157.439c-160.768 2.81641 -296.576 108.929 -343.424 255.104c22.5283 -3.96777 45.4404 -6.52832 69.248 -6.52832c33.5361 0 65.9199 4.48047 96.7676 12.7998
|
||||
c-168.319 33.792 -294.912 182.272 -294.912 360.448v4.73633c49.6641 -27.5205 106.368 -44.0322 166.528 -45.9521c-98.6875 65.9199 -163.456 178.432 -163.456 305.92c0 67.3281 18.1758 130.688 49.792 184.96c181.376 -222.464 452.353 -368.768 757.889 -384.128
|
||||
c-6.27246 26.8799 -9.60059 54.9121 -9.60059 83.7119c0 203.008 164.608 367.616 367.616 367.616c105.855 0 201.472 -44.6719 268.544 -116.096c83.584 16.5117 162.304 47.1035 233.216 89.2158c-27.3916 -85.8887 -85.7598 -157.952 -161.536 -203.393
|
||||
c74.3682 8.83203 145.152 28.5439 211.072 57.8564z" />
|
||||
<glyph glyph-name="uniF222" unicode=""
|
||||
d="M1223.94 775.936c20.0967 20.0967 52.0967 19.9688 72.0645 0c19.9678 -19.9678 19.9678 -52.9912 0 -72.96c-56.96 -56.96 -145.92 -86.0156 -270.976 -86.0156c-126.977 0 -216.064 29.0557 -273.024 86.0156c-19.9678 19.9688 -19.9678 52.9922 0 72.96
|
||||
c19.9678 19.9688 51.9678 19.9688 71.9355 0c38.0166 -38.0156 103.04 -56.0635 199.04 -56.0635c97.9209 0 162.944 18.0479 200.96 56.0635zM894.976 982.016c0 -61.0557 -49.9199 -112 -112 -112c-60.9277 0 -110.976 50.9443 -110.976 112
|
||||
c0 61.9521 49.9199 112 110.976 112c61.9521 0 112 -50.0479 112 -112zM1265.02 1094.02c61.9512 0 112 -50.0479 112 -112c0 -61.0557 -50.0488 -112 -112 -112c-61.9521 0 -112 50.9443 -112 112c0 61.9521 50.0479 112 112 112zM1698.05 1089.02
|
||||
c24.96 17.9199 43.0078 45.9512 43.1357 78.9756c0 54.0156 -44.0312 98.0479 -98.0479 98.0479c-32 0 -57.9834 -16 -76.0322 -39.04c53.8887 -39.9355 98.9443 -87.04 130.944 -137.983zM1021.06 500.992c347.904 0 631.937 177.023 632.064 393.983
|
||||
c0 219.009 -284.032 396.032 -632.064 396.032c-349.056 0 -632.96 -177.023 -632.96 -395.008s283.904 -395.008 632.96 -395.008zM306.944 1168c0 -30.9756 16 -57.9844 39.9355 -74.8799c32 50.9443 76.9277 97.0234 131.968 136.96
|
||||
c-17.9199 22.0156 -43.0078 35.9678 -72.96 35.9678c-54.9121 0 -98.9434 -44.0322 -98.9434 -98.0479zM1600 1805.06c-41.9844 0 -77.0557 -35.0713 -77.0557 -77.0557s35.0713 -77.0557 77.0557 -77.0557s77.0557 34.9434 77.0557 77.0557
|
||||
s-35.0713 77.0557 -77.0557 77.0557zM1842.94 1168c0 -75.0078 -41.9844 -137.984 -101.889 -173.056c8.95996 -32 13.9521 -64.8965 13.9521 -98.9443c0 -274.944 -329.088 -498.048 -734.08 -498.048s-734.976 222.976 -734.976 497.023
|
||||
c0 35.9688 6.01562 70.0166 16.1279 104.064c-57.9844 34.9443 -97.0244 97.0244 -97.0244 168.96c0 110.976 89.9844 200.96 200.96 200.96c66.0488 0 124.032 -32.8955 160 -82.9443c114.944 60.9287 257.024 99.9688 411.904 105.984l92.0322 456.96
|
||||
c3.07227 14.0801 11.0078 25.9844 23.04 33.0244c12.0322 8.06348 25.9834 9.9834 39.04 7.04004l312.96 -72.0645c30.9756 52.9922 88.96 89.9844 155.008 89.9844c98.9443 0 179.072 -80 179.072 -178.944s-80 -178.944 -178.944 -178.944
|
||||
c-95.1035 0 -172.032 73.9844 -178.048 167.937l-262.016 60.0322l-77.0566 -386.049c148.992 -7.93555 285.952 -46.9756 397.057 -108.031c35.9678 51.9678 94.9756 86.0156 162.943 86.0156c109.952 0 199.937 -89.9844 199.937 -200.96z" />
|
||||
<glyph glyph-name="uniF214" unicode=""
|
||||
d="M1091.2 1920v-452.992h425.216v-281.216h-425.216v-459.52c0 -103.937 5.50391 -170.624 16.6396 -200.192c10.8799 -29.3125 31.4883 -52.8643 61.3125 -70.5283c39.6797 -23.8076 84.8633 -35.7119 135.936 -35.7119c90.624 0 180.864 29.4404 270.72 88.4482v-282.624
|
||||
c-76.6719 -35.9678 -146.048 -61.3125 -208 -75.9043c-61.9512 -14.4639 -129.023 -21.7598 -201.216 -21.7598c-81.9199 0 -154.368 10.3682 -217.344 30.9756c-62.9756 20.6084 -116.608 50.3047 -161.024 88.4482c-44.5439 38.2725 -75.2637 78.9766 -92.416 122.112
|
||||
c-17.1514 43.1357 -25.7275 105.6 -25.7275 187.52v628.736h-198.016v253.568c70.3994 22.9121 130.688 55.6797 180.863 98.4316c50.3047 42.624 90.4961 93.8242 120.832 153.856c30.3359 59.7754 51.2002 135.808 62.7207 228.352h254.72z" />
|
||||
<glyph glyph-name="uniF104" unicode=""
|
||||
d="M512 1664l1152 -640l-1152 -640v1280z" />
|
||||
<glyph glyph-name="uniF50B" unicode=""
|
||||
d="M1408 1152l-384 -384l-384 384h256v512h256v-512h256zM384 640h1280v-256h-1280v256z" />
|
||||
<glyph glyph-name="uniF409" unicode=""
|
||||
d="M1024 1664l640 -512l-128 -128v-512h-1024v512l-128 128zM1152 576v448h-256v-448h256z" />
|
||||
<glyph glyph-name="uniF458" unicode=""
|
||||
d="M1920 1024l-1024 -640v480l-768 -480v1280l768 -480v480z" />
|
||||
<glyph glyph-name="uniF218" unicode=""
|
||||
d="M729.6 1152h550.4s12.7998 -38.4004 12.7998 -89.5996c0 -332.801 -230.399 -563.2 -563.2 -563.2c-320 0 -588.8 268.8 -588.8 588.8s281.601 588.8 588.8 588.8c153.601 0 294.4 -51.2002 384 -153.6l-153.6 -153.601c-38.4004 25.6006 -102.4 76.8008 -230.4 76.8008
|
||||
c-204.8 0 -371.199 -166.4 -371.199 -371.2s166.399 -371.2 371.199 -371.2c230.4 0 320 166.4 332.801 243.2h-332.801v204.8zM1664 1152h128v-128h-128v-128h-128v128h-128v128h128v128h128v-128z" />
|
||||
<glyph glyph-name="uniF513" unicode=""
|
||||
d="M1920 1280l-555.136 -387.968l212.863 -636.032l-553.728 394.496l-553.728 -394.496l212.991 636.032l-555.264 387.968h685.312l210.688 640l210.688 -640h685.312zM1024 807.68l307.584 -219.136l-118.4 353.536l300.288 209.92h-371.456l-118.016 358.528v-702.849z
|
||||
" />
|
||||
<glyph glyph-name="uniF301" unicode=""
|
||||
d="M704 1152h960l-256 -640h-1024v1024h384l64 -128h448v-128h-640l-128 -256h128z" />
|
||||
<glyph glyph-name="uniF474" unicode=""
|
||||
d="M128 1408v384h384zM640 768v512h768v-512h-768zM1536 1792h384v-384zM128 640l384 -384h-384v384zM1536 256l384 384v-384h-384zM1536 1408l256 384l128 -128zM1536 640l384 -256l-128 -128zM128 384l384 256l-256 -384zM128 1664l128 128l256 -384z" />
|
||||
<glyph glyph-name="uniF438" unicode=""
|
||||
d="M1280 1792c141.312 0 256 -114.688 256 -256v-1024c0 -141.312 -114.688 -256 -256 -256h-512c-141.312 0 -256 114.688 -256 256v384h128v-128h768v768h-768v-128h-128v128c0 141.312 114.688 256 256 256h512zM1024 384c70.7842 0 128 57.2158 128 128
|
||||
s-57.2158 128 -128 128c-70.6562 0 -128 -57.2158 -128 -128s57.3438 -128 128 -128zM768 896v128h-512v256h512v128l384 -256z" />
|
||||
<glyph glyph-name="uniF451" unicode=""
|
||||
d="M256 384v1280l1024 -640zM1408 1664h384v-1280h-384v1280z" />
|
||||
<glyph glyph-name="uniF404" unicode=""
|
||||
d="M1024 640c-19.8398 0 -39.04 2.43164 -57.8564 5.63184l436.225 436.225c3.2002 -18.8164 5.63184 -38.0166 5.63184 -57.8564c0 -211.968 -172.032 -384 -384 -384zM1696.26 1375.74l351.744 -351.744l-506.624 -506.624
|
||||
c-131.456 -134.272 -314.752 -217.728 -517.376 -217.728c-117.248 0 -226.944 29.3115 -324.864 79.1035l147.072 146.944c56.7041 -20.6084 115.968 -34.0479 177.92 -34.0479c144 0 279.168 56.832 380.288 160.128l372.096 372.224l-216.063 215.936zM1606.02 1722.11
|
||||
l128.641 -129.024l-1279.87 -1279.87l-128.896 128.769l128 128.128l-453.888 453.888v0l506.496 506.496c131.456 134.4 314.624 217.984 517.504 217.984c170.368 0 324.48 -61.8242 448 -160.385zM896 1024c70.6562 0 128 57.3438 128 128s-57.3438 128 -128 128
|
||||
c-70.7842 0 -128 -57.3438 -128 -128s57.2158 -128 128 -128zM1229.18 1345.28l105.729 105.728c-90.752 66.8164 -197.12 105.473 -310.912 105.473c-144.128 0 -279.168 -56.9609 -380.288 -160.385l-372.096 -372.096l318.208 -318.336l113.023 113.024
|
||||
c-38.6553 59.5195 -62.8477 129.023 -62.8477 205.312c0 212.096 172.032 384 384 384c76.2881 0 145.792 -24.1924 205.184 -62.7197z" />
|
||||
<glyph glyph-name="uniF209" unicode=""
|
||||
d="M1073.15 2048c481.664 0 798.976 -348.672 798.976 -722.944c0 -495.104 -275.328 -865.151 -680.96 -865.151c-136.32 0 -264.448 73.7275 -308.352 157.439c0 0 -73.2168 -290.943 -88.832 -347.136c-26.8809 -97.2803 -79.2324 -194.56 -127.104 -270.208
|
||||
l-148.992 54.0156c-3.58398 88.3203 -0.639648 194.049 22.0166 289.92c24.1914 102.4 162.304 687.744 162.304 687.744s-40.3203 80.6406 -40.3203 199.809c0 187.008 108.544 326.784 243.456 326.784c114.816 0 170.24 -86.1445 170.24 -189.44
|
||||
c0 -115.328 -73.7275 -288 -111.488 -448c-31.6152 -133.632 67.2002 -242.816 199.168 -242.816c239.232 0 400.128 307.072 400.128 670.977c0 276.607 -186.367 483.712 -525.184 483.712c-382.72 0 -621.312 -285.568 -621.312 -604.544
|
||||
c0 -110.08 32.5117 -187.521 83.1992 -247.424c23.5527 -27.7764 26.624 -38.9121 18.3047 -70.6562c-6.0166 -23.04 -19.9688 -78.9766 -25.7285 -101.248c-8.44824 -32 -34.3037 -43.2637 -63.2314 -31.3604c-176.257 71.6807 -258.433 264.96 -258.433 482.048
|
||||
c0 358.656 302.336 788.48 902.145 788.48z" />
|
||||
<glyph glyph-name="uniF217" unicode=""
|
||||
d="M1024 1920c494.08 0 896 -402.048 896 -896c0 -494.08 -401.92 -896 -896 -896c-493.952 0 -896 401.92 -896 896c0 493.952 402.048 896 896 896zM1112.83 1769.47c-211.2 10.4961 -420.864 -73.4717 -564.608 -220.16
|
||||
c-146.432 -144.256 -216.063 -354.176 -189.695 -551.68c23.4238 -197.248 142.592 -378.496 307.584 -476.032c160.768 -96 365.312 -104.191 530.943 -29.0557c-47.1035 -13.0557 -96.6396 -20.3516 -147.712 -20.3516c-303.487 0 -550.399 246.911 -550.399 550.399
|
||||
c0 143.872 55.6797 274.944 146.304 373.12c1.02441 1.02441 1.91992 1.91992 2.81641 2.94434c4.60742 4.73535 9.08789 9.47168 13.6953 14.208c0.512695 0.383789 0.896484 1.02344 1.4082 1.2793c128 148.353 317.056 242.177 528.256 242.177
|
||||
c221.057 0 418.176 -102.912 546.048 -263.424c-20.8633 33.5352 -44.0312 65.6631 -69.376 95.6152c-137.983 168.832 -343.68 273.408 -555.264 280.96zM1415.04 1006.21c4.35156 -90.3682 -25.3438 -182.912 -80.7676 -257.152
|
||||
c-55.5527 -73.8555 -135.169 -129.664 -225.28 -156.928c-74.8799 -22.7842 -156.544 -25.5996 -234.112 -7.04004c54.0166 -21.6318 112.896 -33.6641 174.464 -33.6641c259.968 0 471.296 211.456 471.296 471.296c0 0.768555 -0.12793 1.66406 -0.12793 2.68848
|
||||
c-13.6953 142.336 -88.1914 276.352 -200.319 359.168c-137.345 104.576 -332.288 116.864 -479.232 38.0156c-73.2158 -38.5273 -136.832 -97.1514 -176.896 -166.912c-40.5762 -69.8877 -58.4961 -151.68 -52.2246 -230.912
|
||||
c10.624 -158.976 124.8 -305.023 271.616 -345.216c146.432 -44.0322 313.344 19.584 391.936 142.849c82.5605 120.447 62.7207 293.119 -36.3516 391.68c-94.0801 104.192 -260.992 115.968 -367.872 36.8643c-54.0156 -38.6562 -92.5439 -94.3359 -105.344 -157.057
|
||||
c-13.3125 -62.0801 -1.66406 -128.64 30.4639 -181.76c32.1279 -53.7598 83.7119 -93.5684 141.952 -108.032c58.2402 -15.1035 121.6 -4.86328 171.52 25.6006c50.5605 30.4639 87.5518 80.1279 97.9199 135.68c11.3926 55.2959 -1.66406 114.432 -34.3037 158.848
|
||||
c-32.1279 45.5684 -82.8164 73.3447 -135.936 76.9287c-52.9922 4.0957 -105.856 -17.2803 -141.568 -54.2725c-36.6084 -35.9678 -52.0957 -89.0879 -44.6719 -137.855c7.55176 -48.6406 38.2715 -93.6963 80 -115.584c26.4961 -14.7207 57.4717 -19.8408 86.9121 -16.3848
|
||||
c-62.0801 1.53613 -114.177 43.2646 -131.456 100.097c-0.512695 0.767578 -1.02441 1.66406 -1.4082 2.6875c-17.9199 41.4717 -13.0557 94.3359 16.1279 133.376c28.416 38.7842 77.5684 63.3604 128.768 60.7998c51.0723 -1.66406 101.376 -33.0234 128 -78.9756
|
||||
c27.3926 -45.8242 32 -106.752 7.80859 -158.336c-24.0645 -51.7119 -73.7285 -90.2402 -131.584 -101.632c-57.4717 -12.416 -122.752 4.73535 -167.68 47.3594c-44.8008 40.96 -72.0645 104.192 -67.4561 168.32c3.83984 133.12 150.911 237.44 287.104 200.96
|
||||
c138.368 -31.6162 226.944 -196.736 173.824 -338.304c-48.6406 -142.72 -224.769 -225.536 -373.888 -166.912c-74.1123 27.5195 -134.784 85.8877 -169.729 157.568c-34.9443 72.1914 -42.2402 158.592 -17.9199 237.695c47.8721 161.664 226.176 269.185 398.848 238.464
|
||||
c175.36 -25.5996 313.217 -192.64 317.568 -374.016zM1024 207.488c319.232 0 595.968 184.319 730.112 451.712c37.248 84.7354 58.8799 175.744 58.8799 265.728c0 318.977 -247.04 554.368 -553.216 607.616c154.496 -64 279.296 -200.32 331.52 -362.496
|
||||
c70.1445 -203.136 20.8643 -447.872 -133.12 -608.896c-148.224 -162.944 -384.384 -245.633 -608.128 -206.208c-226.048 35.584 -422.912 198.271 -517.504 407.936c-97.792 209.408 -90.3682 468.224 26.8799 674.432c116.736 206.337 329.344 354.433 566.272 395.009
|
||||
c11.7754 2.17578 23.6797 3.96777 35.584 5.37598c-420.992 -32.1279 -753.664 -384.641 -753.664 -813.696c0 -450.304 366.208 -816.512 816.384 -816.512z" />
|
||||
<glyph glyph-name="uniF469" unicode=""
|
||||
d="M256 1280h1536v-768h-256v384h-1024v-384h-256v768zM1408 1664v-256h-768v256h768zM1408 640c0 -98.3037 37.5039 -196.48 112.512 -271.488l112.513 -112.512h-768l-112.513 112.512c-75.0078 75.0078 -112.512 173.185 -112.512 271.488v128h768v-128z" />
|
||||
<glyph glyph-name="uniF476" unicode=""
|
||||
d="M384 1248c123.776 0 224 -100.224 224 -224c0 -123.648 -100.224 -224 -224 -224s-224 100.352 -224 224c0 123.776 100.224 224 224 224zM1024 1248c123.648 0 224 -100.224 224 -224c0 -123.648 -100.352 -224 -224 -224c-123.776 0 -224 100.352 -224 224
|
||||
c0 123.776 100.224 224 224 224zM1664 1248c123.648 0 224 -100.224 224 -224c0 -123.648 -100.352 -224 -224 -224s-224 100.352 -224 224c0 123.776 100.352 224 224 224z" />
|
||||
<glyph glyph-name="uniF211" unicode=""
|
||||
d="M1472 1440c229.888 0 416 -186.24 416 -416s-186.112 -416 -416 -416s-416 186.24 -416 416s186.112 416 416 416zM576 1440c229.76 0 416 -186.24 416 -416s-186.24 -416 -416 -416s-416 186.24 -416 416s186.24 416 416 416z" />
|
||||
<glyph glyph-name="uniF456" unicode=""
|
||||
d="M1024 1792c424.064 0 768 -343.936 768 -768s-343.936 -768 -768 -768c-424.192 0 -768 343.936 -768 768s343.808 768 768 768zM1024 512c70.7842 0 128 57.2158 128 128s-57.2158 128 -128 128c-70.6562 0 -128 -57.2158 -128 -128s57.3438 -128 128 -128zM1113.22 896
|
||||
l51.584 640h-281.6l51.2002 -640h178.815z" />
|
||||
<glyph glyph-name="uniF471" unicode=""
|
||||
d="M512 1664h358.656c163.328 0 281.855 -23.2959 355.712 -69.7598c73.7275 -46.4639 110.592 -120.448 110.592 -221.824c0 -68.8643 -16.1279 -125.312 -48.3838 -169.344c-32.3838 -44.1602 -75.2646 -70.6562 -128.769 -79.6162v-7.93652
|
||||
c72.96 -16.2559 125.568 -46.7197 157.952 -91.3916c32.2559 -44.6719 48.5127 -104.063 48.5127 -178.048c0 -105.088 -38.0166 -187.008 -113.921 -245.888c-76.0312 -58.8809 -178.943 -88.1924 -309.248 -88.1924h-431.104v1152zM768 1207.81h130.176
|
||||
c66.3047 0 114.176 10.2402 143.872 30.7207c29.5684 20.4795 44.5439 54.3994 44.5439 101.632c0 44.1602 -16.1279 75.7754 -48.5117 94.9756c-32.3838 19.0723 -83.4561 28.7998 -153.344 28.7998h-116.736v-256.128zM768 1013.89v-300.16h147.456
|
||||
c67.2002 0 116.864 12.9287 148.864 38.6562c32.1279 25.7285 48.1279 65.1523 48.1279 118.145c0 95.6152 -68.3525 143.487 -204.929 143.487h-139.52v-0.12793z" />
|
||||
<glyph glyph-name="uniF433" unicode=""
|
||||
d="M0 896l896 -896h-896v896z" />
|
||||
<glyph glyph-name="uniF447" unicode=""
|
||||
d="M1408 512c70.7842 0 128 -57.2158 128 -128s-57.2158 -128 -128 -128s-128 57.2158 -128 128s57.2158 128 128 128zM640 512c70.6562 0 128 -57.2158 128 -128s-57.3438 -128 -128 -128s-128 57.2158 -128 128s57.3438 128 128 128zM1536 896h-896v-128h896v-128h-1024
|
||||
v1024h-256v128h384v-256h1152z" />
|
||||
<glyph glyph-name="uniF511" unicode=""
|
||||
d="M1024 1510.53l-118.016 -358.528h-371.328l300.288 -209.92l-118.272 -353.28l307.328 218.88l307.584 -219.136l-118.4 353.536l300.288 209.92h-371.456zM1024 1920v0l210.688 -640h685.312l-555.136 -387.968l212.863 -636.032l-553.728 394.496l-553.728 -394.496
|
||||
l212.991 636.032l-555.264 387.968h685.312z" />
|
||||
<glyph glyph-name="uniF427" unicode=""
|
||||
d="M1717.72 1436.21c99.7246 -99.7246 99.7246 -261.281 0 -361.006l-232.861 -232.989c-98.5723 -98.5723 -257.44 -99.3398 -357.421 -2.81543l-455.353 -455.354h-288.036v287.908l455.097 454.969l-0.767578 0.768555c-99.5967 99.5957 -99.5967 261.408 0 361.005
|
||||
l232.989 232.989c99.5957 99.7246 261.408 99.7246 361.005 0zM1344.04 1104.01l160.02 160.021l-256.031 256.031l-160.021 -160.02z" />
|
||||
<glyph glyph-name="uniF219" unicode=""
|
||||
d="M1438.08 1832.7c0 0 563.456 -229.376 370.176 -838.4c-267.264 -554.496 -784.64 -349.056 -784.64 -349.056v-277.504s-19.7119 -153.344 -202.88 -220.288c-183.296 -66.6885 -351.616 59.5195 -351.616 59.5195v279.809
|
||||
c83.584 -85.5039 195.712 -134.272 240.128 -9.98438v945.92h311.68v-537.472s460.416 -138.496 522.368 289.792c9.85645 475.392 -546.944 472.832 -546.944 472.832s-349.184 22.2715 -522.495 -257.536c-131.2 -222.848 37.1191 -423.424 37.1191 -423.424
|
||||
l-225.279 -200.448s-339.2 418.433 -7.42383 871.552c430.848 487.681 1159.81 194.688 1159.81 194.688z" />
|
||||
<glyph glyph-name="uniF100" unicode=""
|
||||
d="M512 1408h1024v-128h-1024v128zM1152 1152v-128h-640v128h640zM1280 1024v128h256v-128h-256zM896 768v128h640v-128h-640zM768 896v-128h-256v128h256zM512 512v128h768v-128h-768z" />
|
||||
<glyph glyph-name="uniF400" unicode=""
|
||||
d="M1792 384l-128 -128l-494.848 494.848c-94.8486 -68.9912 -210.816 -110.848 -337.152 -110.848c-318.08 0 -576 257.92 -576 576s257.92 576 576 576s576 -257.92 576 -576c0 -126.336 -41.8564 -242.304 -110.848 -337.152zM384 1216c0 -247.424 200.576 -448 448 -448
|
||||
c247.552 0 448 200.576 448 448s-200.448 448 -448 448c-247.424 0 -448 -200.576 -448 -448z" />
|
||||
<glyph glyph-name="uniF439" unicode=""
|
||||
d="M896 1664v-384h-256v384c0 70.7842 57.3438 128 128 128s128 -57.2158 128 -128zM1408 1664v-384h-256v384c0 70.7842 57.2158 128 128 128s128 -57.2158 128 -128zM384 1152h1280c0 -309.632 -219.904 -567.68 -512 -627.072v-268.928h-256v268.928
|
||||
c-292.096 59.2646 -512 317.44 -512 627.072z" />
|
||||
<glyph glyph-name="uniF509" unicode=""
|
||||
d="M1534.21 717.824l147.712 -88.5762c-134.4 -223.36 -378.24 -373.248 -657.92 -373.248c-279.552 0 -523.52 149.888 -657.92 373.248l147.712 88.7041c92.1602 -98.1758 226.816 -168.96 382.208 -194.688v500.736h-128v128h128v163.456
|
||||
c-76.1602 44.416 -128 126.08 -128 220.544c0 141.312 114.688 256 256 256s256 -114.688 256 -256c0 -94.4639 -51.7119 -176.128 -128 -220.544v-163.456h128v-128h-128v-500.864c155.52 25.7285 289.92 96.3838 382.208 194.688zM1024 1664
|
||||
c-70.6562 0 -128 -57.3438 -128 -128s57.3438 -128 128 -128c70.7842 0 128 57.3438 128 128s-57.2158 128 -128 128z" />
|
||||
<glyph glyph-name="uniF510" unicode=""
|
||||
d="M1664 1152v-256h-512v-512h-256v512h-512v256h512v512h256v-512h512z" />
|
||||
<glyph glyph-name="uniF445" unicode=""
|
||||
d="M1888 748.032l-57.5996 -139.648l-305.408 21.8887c-31.3604 -39.9365 -66.9443 -75.6484 -106.88 -107.009l21.7598 -305.536l-139.264 -57.5996l-200.704 231.552c-25.2158 -3.07129 -49.9199 -7.67969 -75.9043 -7.67969c-25.7275 0 -50.1758 4.6084 -75.1357 7.67969
|
||||
l-200.96 -231.808l-139.393 57.7275l21.7607 305.408c-39.9365 31.3604 -75.5205 66.9443 -107.009 106.88l-305.536 -21.7598l-57.7275 139.264l231.68 200.832c-3.07129 25.0879 -7.67969 49.792 -7.67969 75.7764c0 25.7275 4.6084 50.1758 7.55176 75.1357
|
||||
l-231.552 200.96l57.7275 139.393l305.28 -21.7607c31.4883 39.9365 67.2002 75.7764 107.265 107.265l-21.7607 305.408l139.137 57.5996l200.96 -231.68c24.96 2.94336 49.5352 7.67969 75.3916 7.67969s50.4316 -4.73633 75.3916 -7.67969l200.96 231.68
|
||||
l139.265 -57.5996l-21.8887 -305.408c39.9365 -31.3604 75.6484 -67.0723 107.137 -107.008l305.408 21.6318l57.5996 -139.136l-231.552 -200.832c3.07129 -25.0889 7.67969 -49.6641 7.67969 -75.6484c0 -25.7275 -4.6084 -50.3037 -7.67969 -75.2637zM1280 1024
|
||||
c0 141.312 -114.688 256 -256 256s-256 -114.688 -256 -256s114.688 -256 256 -256s256 114.688 256 256z" />
|
||||
<glyph glyph-name="uniF516" unicode=""
|
||||
d="M1024 1452.42v-467.328h-155.776v467.328h155.776zM1408 1452.42v-467.328h-155.776v467.328h155.776zM323.2 1920h1596.8v-1090.82l-467.456 -445.184h-350.464l-233.6 -256h-228.48v256h-512v1224.32zM1764.22 907.136v857.088h-1285.5v-1129.73h350.977v-211.328
|
||||
l233.472 211.328h428.16z" />
|
||||
<glyph glyph-name="uniF435" unicode=""
|
||||
d="M384 512l640 640l640 -640h-1280zM384 1408h1280v-128h-1280v128z" />
|
||||
<glyph glyph-name="uniF300" unicode=""
|
||||
d="M1536 1536c141.312 0 256 -114.688 256 -256v-384c0 -141.312 -114.688 -256 -256 -256h-448l-448 -448v448h-128c-141.312 0 -256 114.688 -256 256v384c0 141.312 114.688 256 256 256h1024z" />
|
||||
<glyph glyph-name="uniF514" unicode=""
|
||||
d="M1664 768v128l256 -256l-256 -256v128h-256c-282.752 0 -512 229.248 -512 512c0 141.312 -114.688 256 -256 256h-384v256h384c282.752 0 512 -229.248 512 -512c0 -141.312 114.688 -256 256 -256h256zM1408 1280c-61.8242 0 -117.888 -22.9121 -162.176 -59.3916
|
||||
c-27.3926 83.9678 -70.7842 160 -128 224.768c82.5596 56.96 182.271 90.624 290.176 90.624h256v128l256 -256l-256 -256v128h-256zM640 768c61.8242 0 117.888 22.9121 162.176 59.3916c27.3926 -83.9678 70.7842 -160 128 -224.768
|
||||
c-82.5596 -56.832 -182.271 -90.624 -290.176 -90.624h-384v256h384z" />
|
||||
<glyph glyph-name="uniF102" unicode=""
|
||||
d="M1408 1408l512 -128v-896h-1792v896l512 128l128 256h512zM1024 512.256c247.552 0 448 200.448 448 448c0 247.424 -200.448 448 -448 448c-247.424 0 -448 -200.576 -448 -448c0 -247.552 200.576 -448 448 -448zM512 1600v-96.1279l-256 -64v160.128h256z
|
||||
M1024 1280.13c176.768 0 320 -143.231 320 -320c0 -176.768 -143.232 -320 -320 -320s-320 143.232 -320 320c0 176.769 143.232 320 320 320z" />
|
||||
<glyph glyph-name="uniF466" unicode=""
|
||||
d="M640 1344l-320 -320l320 -320v-320l-640 640l640 640v-320zM1408 1280c282.752 0 512 -229.248 512 -512v-299.904l-150.016 149.889c-99.9688 99.9678 -231.04 150.016 -361.984 150.016h-256v-384l-640 640l640 640v-384h256z" />
|
||||
<glyph glyph-name="uniF463" unicode=""
|
||||
d="M1536 1408l-768 -384l-768 384v128h1536v-128zM0 1216l768 -384l256 128v-448h-1024v704zM1920 1152c70.7842 0 128 -57.3438 128 -128v-640c0 -70.7842 -57.2158 -128 -128 -128h-640c-70.7842 0 -128 57.2158 -128 128v640c0 70.6562 57.2158 128 128 128h640z
|
||||
M1920 640v128h-256v256h-128v-256h-256v-128h256v-256h128v256h256z" />
|
||||
<glyph glyph-name="uniF422" unicode=""
|
||||
d="M384 1536h1152v-1024h-1152v1024zM1408 640v640h-896v-640h896z" />
|
||||
<glyph glyph-name="uniF201" unicode=""
|
||||
d="M1024 128c128 0 256 32 368 80c-16 144 -64 368 -208 688c-288 -96 -560 -304 -704 -576c144 -128 336 -192 544 -192zM1536 288c208 144 352 384 384 640c-192 32 -368 32 -576 0c16 -32 128 -304 192 -640zM128 1088v-64c0 -224 80 -432 224 -592
|
||||
c176 288 496 496 784 592c-16 48 -48 112 -80 176c-368 -112 -592 -144 -928 -112zM1760 1536c-160 -128 -368 -192 -560 -288c48 -64 64 -112 96 -176c208 48 480 32 624 0c-16 176 -64 336 -160 464zM672 1856c-256 -112 -448 -336 -512 -624c288 -32 688 48 832 96
|
||||
c-96 192 -192 352 -320 528zM1024 1920c-64 0 -128 -16 -192 -16c128 -208 192 -320 304 -512c128 48 384 128 528 256c-160 160 -384 272 -640 272zM1024 2048c560 0 1024 -464 1024 -1024s-464 -1024 -1024 -1024s-1024 464 -1024 1024s464 1024 1024 1024z" />
|
||||
<glyph glyph-name="uniF426" unicode=""
|
||||
d="M1664 1024c141.312 0 256 -114.688 256 -256s-114.688 -256 -256 -256h-1280c-141.312 0 -256 114.688 -256 256s114.688 256 256 256h6.52832c-4.35254 20.8643 -6.52832 41.9844 -6.52832 64c0 176.768 143.232 320 320 320
|
||||
c89.3438 0 169.984 -36.8643 227.968 -95.8721c60.7998 131.84 193.408 223.872 348.032 223.872c211.968 0 384 -171.904 384 -384c0 -45.1836 -9.21582 -87.8076 -23.5518 -128h23.5518z" />
|
||||
<glyph glyph-name="uniF446" unicode=""
|
||||
d="M1024 1792c424.064 0 768 -343.936 768 -768s-343.936 -768 -768 -768s-768 343.936 -768 768s343.936 768 768 768zM1536 1024c0 282.752 -229.248 512 -512 512c-94.8477 0 -182.528 -27.5195 -258.688 -72.4482l698.368 -698.24
|
||||
c44.8008 76.1602 72.3203 163.969 72.3203 258.688zM512 1024c0 -282.752 229.248 -512 512 -512c94.7197 0 182.4 27.5195 258.56 72.3203l-698.239 698.239c-44.8008 -76.1592 -72.3203 -163.84 -72.3203 -258.56z" />
|
||||
<glyph glyph-name="uniF504" unicode=""
|
||||
d="M1664 1536c0 -94.4639 -51.7119 -176.128 -128 -220.544v-163.456c0 -282.752 -229.248 -512 -512 -512c-141.312 0 -256 -114.688 -256 -256v-128h-256v1059.46c-76.1602 44.416 -128 126.08 -128 220.544c0 141.312 114.688 256 256 256s256 -114.688 256 -256
|
||||
c0 -94.4639 -51.8398 -176.128 -128 -220.544v-490.496c75.5195 44.0322 162.304 71.04 256 71.04c141.312 0 256 114.688 256 256v163.456c-76.2881 44.416 -128 126.08 -128 220.544c0 141.312 114.688 256 256 256s256 -114.688 256 -256zM640 1664
|
||||
c-70.6562 0 -128 -57.3438 -128 -128s57.3438 -128 128 -128s128 57.3438 128 128s-57.3438 128 -128 128zM1408 1408c70.7842 0 128 57.3438 128 128s-57.2158 128 -128 128s-128 -57.3438 -128 -128s57.2158 -128 128 -128z" />
|
||||
<glyph glyph-name="uniF465" unicode=""
|
||||
d="M1536 1408l-768 -384l-768 384v128h1536v-128zM0 1216l768 -384l256 128v-448h-1024v704zM1920 1152c70.7842 0 128 -57.3438 128 -128v-640c0 -70.7842 -57.2158 -128 -128 -128h-640c-70.7842 0 -128 57.2158 -128 128v640c0 70.6562 57.2158 128 128 128h640z
|
||||
M1531.52 384l452.48 452.48l-90.4961 90.4951l-361.984 -361.983l-180.991 180.992l-90.4961 -90.4961z" />
|
||||
<glyph glyph-name="uniF424" unicode=""
|
||||
d="M1408 1792l384 -384v-768l-384 -384h-768l-384 384v768l384 384h768zM1024 512c70.7842 0 128 57.2158 128 128s-57.2158 128 -128 128c-70.6562 0 -128 -57.2158 -128 -128s57.3438 -128 128 -128zM1113.22 896l51.584 640h-281.6l51.2002 -640h178.815z" />
|
||||
<glyph glyph-name="uniF418" unicode=""
|
||||
d="M1408 1504l128 -96l-512 -768h-128l-288 416l128 128l224 -192z" />
|
||||
<glyph glyph-name="uniF429" unicode=""
|
||||
d="M1024 1453.31l493.312 -493.312l-493.312 -493.312l-86.6562 86.6553l342.656 342.656h-896v128h896l-342.656 342.656z" />
|
||||
<glyph glyph-name="uniF308" unicode=""
|
||||
d="M477.696 568.192l543.104 543.104l90.3682 -90.624l-542.976 -542.976c-100.225 -100.353 -152.32 -115.84 -226.305 -135.809c20.0967 74.1123 35.584 126.08 135.809 226.305zM1189.5 1732.61l180.992 180.991l542.976 -543.104l-180.991 -180.992
|
||||
c-50.0488 50.0479 -130.944 50.0479 -180.992 0l-180.992 -180.992c-50.0479 -50.0479 -50.0479 -130.943 0 -180.992l-180.992 -180.991l-543.104 542.976l180.991 180.992c50.0488 -50.0479 131.072 -50.0479 181.12 0l180.992 181.12
|
||||
c50.0479 50.0479 50.0479 130.943 0 180.992z" />
|
||||
<glyph glyph-name="uniF226" unicode=""
|
||||
d="M1477.76 1792c120.32 0 152.576 -68.6084 126.464 -195.584l-51.8398 -258.688c-40.96 -206.848 -88.0635 -445.695 -94.0801 -470.144c-11.0078 -44.1602 -27.9033 -119.168 -132.992 -119.168h-250.367c-9.98438 0 -9.98438 0 -20.0967 -10.1123
|
||||
c-6.65527 -6.65527 -393.344 -455.424 -393.344 -455.424c-30.208 -34.6875 -80.3838 -28.5439 -98.6875 -21.1201c-18.3047 7.2959 -50.6885 29.6963 -50.6885 89.9844v1301.63s33.2803 138.624 146.304 138.624h819.328zM1394.94 1391.1l34.3037 179.2
|
||||
c6.27148 29.6963 -16.3838 52.4805 -40.5762 52.4805h-657.536c-29.8242 0 -49.792 -26.8799 -49.792 -49.792v-1015.68c0 -3.19922 2.43262 -3.83984 4.86426 -1.15137c0 0 242.304 290.815 269.184 324.352c26.8809 33.4082 39.168 38.6562 79.3604 38.6562h221.184
|
||||
c30.208 0 47.2324 25.3438 50.3047 40.1924c3.2002 14.8477 28.9277 149.12 34.4316 176.256s-19.3281 54.9121 -44.7998 54.9121h-270.976c-35.9688 0 -61.8242 25.4717 -61.8242 61.3115v39.04c0 35.9678 25.7275 60.416 61.5674 60.416h319.232
|
||||
s46.9756 20.4805 51.0723 39.8076z" />
|
||||
<glyph glyph-name="uniF205" unicode=""
|
||||
d="M1024 1920c493.952 0 896 -401.92 896 -896c0 -493.952 -402.048 -896 -896 -896c-494.08 0 -896 402.048 -896 896c0 494.08 401.92 896 896 896zM218.496 1024c0 -318.848 185.216 -594.432 454.016 -724.992l-384.256 1052.93
|
||||
c-44.6719 -100.224 -69.7598 -211.071 -69.7598 -327.936zM1024 218.496c93.8242 0 183.808 16.1279 267.648 45.5684c-2.17676 3.45508 -4.09668 7.16797 -5.76074 11.2637l-247.552 678.271l-241.92 -702.336c72.1924 -21.248 148.48 -32.7676 227.584 -32.7676z
|
||||
M1134.98 1401.73l291.072 -866.176l80.3838 268.544c34.9443 111.488 61.3125 191.488 61.3125 260.48c0 99.584 -35.8398 168.576 -66.4326 222.08c-40.7031 66.4316 -78.9756 122.624 -78.9756 189.056c0 74.1123 56.1924 142.977 135.168 142.977
|
||||
c3.58398 0 7.04004 -0.384766 10.4961 -0.640625c-143.36 131.328 -334.208 211.456 -544 211.456c-281.472 0 -529.024 -144.256 -673.024 -363.008c18.9443 -0.639648 36.7363 -0.896484 51.8408 -0.896484c84.2236 0 214.655 10.2402 214.655 10.2402
|
||||
c43.3926 2.56055 48.5127 -61.3115 5.24805 -66.4316c0 0 -43.7754 -5.12012 -92.1602 -7.68066l293.12 -872.575l176.256 528.64l-125.439 343.936c-43.3926 2.56055 -84.4805 7.68066 -84.4805 7.68066c-43.2637 2.55957 -38.2715 68.9922 5.12012 66.4316
|
||||
c0 0 132.992 -10.2402 212.225 -10.2402c84.2236 0 214.783 10.2402 214.783 10.2402c43.3926 2.56055 48.5127 -61.3115 5.12012 -66.4316c0 0 -43.6475 -5.12012 -92.2881 -7.68066zM1730.82 1410.56c3.58398 -25.7275 5.50391 -53.248 5.63184 -82.8154
|
||||
c0 -81.792 -15.4883 -173.696 -61.3125 -288.512l-246.144 -711.425c239.488 139.521 400.512 399.104 400.512 696.192c0 140.16 -35.8398 271.872 -98.6875 386.56z" />
|
||||
<glyph glyph-name="uniF472" unicode=""
|
||||
d="M1368.06 1408h-128l-240.129 -768h128l-39.9355 -128h-448l39.9355 128h128l240.129 768h-128l39.9355 128h448z" />
|
||||
<glyph glyph-name="uniF216" unicode=""
|
||||
d="M1791.62 1265.92c0.383789 -2.94434 0.639648 -5.75977 0.639648 -8.7041v-466.943c0 -2.94434 -0.255859 -5.76074 -0.511719 -8.96094c-0.12793 -0.767578 -0.383789 -1.79199 -0.511719 -2.81543c-0.384766 -1.79199 -0.640625 -3.58398 -1.15234 -5.50391
|
||||
c-0.255859 -1.02441 -0.768555 -2.04785 -1.02441 -3.07227c-0.639648 -1.66406 -1.15137 -3.2002 -1.79199 -4.86426c-0.511719 -1.02344 -1.02344 -2.04785 -1.53613 -3.07129c-0.639648 -1.53613 -1.40723 -2.94434 -2.30371 -4.48047
|
||||
c-0.511719 -0.895508 -1.28027 -1.91992 -1.91992 -2.94434c-0.767578 -1.2793 -1.66406 -2.55957 -2.6875 -3.96777c-0.768555 -0.895508 -1.53613 -1.79199 -2.30469 -2.81543c-1.02344 -1.02441 -2.04785 -2.30469 -3.32812 -3.45605
|
||||
c-0.767578 -0.896484 -1.66406 -1.79199 -2.6875 -2.68848c-1.02441 -0.895508 -2.30371 -2.04785 -3.71191 -3.07227c-0.768555 -0.767578 -1.79199 -1.53516 -2.81641 -2.30371l-1.15137 -0.767578l-702.208 -467.072
|
||||
c-11.1367 -7.42383 -23.8086 -11.0078 -36.6084 -11.0078s-25.4717 3.58398 -36.7363 11.2637l-702.208 467.072c-0.255859 0.255859 -0.639648 0.511719 -1.02344 0.767578l-2.94434 2.30469c-1.28027 0.895508 -2.55957 2.04785 -3.71191 3.07129
|
||||
c-0.895508 0.896484 -1.79199 1.79199 -2.6875 2.68848c-1.02441 1.02344 -2.17676 2.30371 -3.2002 3.45605c-0.768555 0.895508 -1.53613 1.79199 -2.30469 2.81543c-0.895508 1.28027 -1.79199 2.56055 -2.6875 3.96875
|
||||
c-0.768555 0.895508 -1.4082 1.91992 -1.91992 2.94336c-0.896484 1.53613 -1.66406 2.94434 -2.30371 4.48047c-0.512695 0.895508 -1.02441 1.91992 -1.53613 3.07129c-0.640625 1.66406 -1.15234 3.2002 -1.66406 4.86426
|
||||
c-0.383789 0.896484 -0.768555 1.91992 -1.02441 3.07227c-0.511719 1.91992 -0.767578 3.71191 -1.15137 5.50391c-0.128906 1.02441 -0.384766 2.04785 -0.512695 2.94434c-0.383789 2.81543 -0.639648 5.75977 -0.639648 8.57617v466.943
|
||||
c0 2.94434 0.255859 5.75977 0.639648 8.7041c0.12793 0.896484 0.383789 1.79199 0.512695 2.81641c0.383789 1.91992 0.639648 3.71191 1.15137 5.50391c0.255859 1.15137 0.640625 2.17578 1.02441 3.2002c0.511719 1.53516 1.02344 3.19922 1.66406 4.86328
|
||||
c0.511719 1.02441 1.02344 2.04785 1.53613 3.2002c0.639648 1.53613 1.40723 2.81641 2.30371 4.48047c0.639648 0.895508 1.28027 1.91992 1.91992 2.94336c0.767578 1.28027 1.79199 2.68848 2.6875 3.96875c0.640625 1.02344 1.4082 1.79199 2.30469 2.81543
|
||||
c1.02344 1.28027 2.04785 2.43164 3.2002 3.58398c0.895508 0.768555 1.79199 1.66406 2.6875 2.68848c1.15234 1.02344 2.43164 2.04785 3.71191 3.07129l2.94434 2.17676c0.383789 0.255859 0.767578 0.639648 1.15137 0.895508l702.208 466.944
|
||||
c22.1445 14.7197 51.0723 14.7197 73.2168 0l702.08 -467.2c0.383789 -0.255859 0.767578 -0.639648 1.15137 -0.896484c0.896484 -0.767578 1.91992 -1.53516 2.81641 -2.30371c1.2793 -0.895508 2.55957 -1.91992 3.71191 -3.07227
|
||||
c1.02344 -0.895508 1.91992 -1.79199 2.6875 -2.6875c1.15234 -1.02441 2.17676 -2.17578 3.32812 -3.45605c0.768555 -0.896484 1.53613 -1.79199 2.30469 -2.81641c0.895508 -1.2793 1.79199 -2.55957 2.6875 -3.96777
|
||||
c0.639648 -0.895508 1.4082 -1.91992 1.91992 -2.94434c0.896484 -1.53516 1.66406 -2.81543 2.30371 -4.35156c0.512695 -1.02441 1.02441 -2.04785 1.53613 -3.2002c0.640625 -1.66406 1.15234 -3.2002 1.79199 -4.73535
|
||||
c0.255859 -1.02441 0.768555 -2.04883 1.02441 -3.2002c0.511719 -1.79199 0.767578 -3.58398 1.15137 -5.50391c0.128906 -0.896484 0.384766 -1.79199 0.512695 -2.81641zM1090.05 1601.28v-307.328l286.208 -190.977l231.168 154.24zM957.952 1601.28l-517.248 -344.064
|
||||
l231.04 -154.24l286.208 191.104v307.2zM387.84 1133.95v-220.416l165.12 110.208zM957.952 446.208v307.328l-286.208 190.976l-231.04 -154.111zM1024 867.84l233.472 155.904l-233.472 155.904l-233.472 -155.904zM1090.05 446.208l517.376 344.064l-231.168 154.111
|
||||
l-286.208 -190.976v-307.2zM1660.29 913.536v220.416l-165.248 -110.208z" />
|
||||
<glyph glyph-name="uniF475" unicode=""
|
||||
d="M1024 1792c424.064 0 768 -343.936 768 -768s-343.936 -768 -768 -768s-768 343.936 -768 768s343.936 768 768 768zM476.16 1340.54l-2.81641 3.96777c-4.60742 -7.93555 -8.83203 -16.1279 -13.1836 -24.3193l4.47949 1.02344l17.5361 6.27246l30.208 2.6875zM1024 384
|
||||
c265.088 0 493.056 162.176 590.208 392.576l-6.52832 10.4961l14.9766 50.8154l-34.6885 25.2158l-25.3438 7.55273l-23.5518 19.8398l-55.8086 -21.1201l-52.7354 -3.07227l-39.9365 29.0566l-39.04 53.5039l-0.767578 32.5117l0.895508 54.2725l5.63184 7.55176
|
||||
l4.86426 18.1758l22.7842 35.0723l13.3125 13.0557l18.6875 20.7363l13.0557 25.5996l36.8643 34.9443l37.7598 -0.383789l27.6484 9.59961l66.4316 7.16797l25.9844 -36.8643l24.1924 -10.4961c-8.44824 39.4248 -20.2246 77.6963 -35.585 114.049l-5.50391 5.11914
|
||||
l-13.4395 -6.65527l-28.9277 -2.68848l-23.8086 -21.248l-25.9834 -35.0723l-50.6885 -11.6475l-23.5518 9.21582l2.6875 40.5762l13.3125 25.2158l46.4639 -2.6875l8.57617 21.8877l-24.0645 26.624l20.6084 8.32031l40.4482 22.0156l14.4639 11.6484
|
||||
c-49.1523 77.6953 -113.664 144.256 -190.721 194.688l-4.35156 -1.79199l20.3516 -17.792l-32.8955 5.24805l-4.6084 -9.34375l21.248 -2.56055l-7.93555 -8.95996l-59.9043 -10.3682l-77.3115 -34.3037l-59.9043 -28.9277l-6.27246 59.6475l16.8965 32.6406
|
||||
l-12.416 21.7598l-45.9521 19.4561l-22.1436 17.1523l32.1279 7.67969l69.1201 16.8955l29.8232 1.66406c-64.7676 22.1445 -132.991 36.7363 -205.056 36.7363c-146.56 0 -280.064 -51.4561 -388.096 -134.656l38.2715 1.15234l47.7441 -12.2881l32 -8.19238
|
||||
l34.8164 7.80859l47.6152 -6.0166l29.9521 7.2959l5.63184 18.0488l28.1602 -2.94434l11.0078 -22.7842l47.6162 4.35254l-74.752 -24.7041l-36.0957 -20.8643l-55.168 -42.2402l13.6963 -14.9756l38.3994 -18.0479l27.3926 -28.0322l33.6641 34.4316l19.4551 37.8887
|
||||
l33.0244 22.6553l33.0244 -16.7676l9.08789 -18.4316l28.9277 10.2393l10.2402 -55.168l20.4795 -20.0957l-74.752 -19.0723l-54.7842 -21.5039l42.752 11.7764l-5.24707 -17.1523l13.5674 -15.3604l11.2646 -7.16797l-45.9521 -18.6875l16.1279 18.8154l-25.9844 -5.63184
|
||||
l-31.2314 -14.8477l-14.208 -16.5117l-34.9443 -19.3281l-25.6006 -20.2246l-9.72754 -23.4238l-32.7676 -26.752l-25.8564 -59.3916l-8.06348 -25.7285l-23.6807 47.4883l-46.208 -0.12793l-38.3994 0.255859l-49.2803 -39.6797l-6.52832 -43.5205l29.6963 -32.3838
|
||||
l57.2158 30.7197l-14.8477 -43.5195l-40.4482 -26.1123l-39.2959 9.47266l-43.5205 18.1758l-49.9199 79.1035l-22.1436 47.2324l-5.24805 16.2559l7.42383 -66.0479l-0.639648 -17.1523l-8.19238 10.2402l-4.99219 16.6396l-9.9834 12.416l-5.12012 22.9121
|
||||
l-0.255859 35.9678l-26.752 46.3359c-17.4082 -58.1113 -29.5684 -118.399 -29.5684 -182.144c0 -295.936 202.88 -543.232 476.16 -616.192l-4.0957 12.6729l-9.60059 137.6l-11.1357 62.8477l-67.3281 65.792l-31.7441 56.3203l-10.624 27.9043l7.67969 16.5117
|
||||
l14.0801 52.9922l7.55273 61.6953l-8.32031 4.73633l-14.9756 -10.8799l-19.9688 9.34375l13.4404 6.27246l59.9043 13.8242l39.4238 17.6631l-2.43262 -26.752l14.5928 24.1924l19.7119 -6.91211l67.7119 -21.6318l48.5117 -33.6641l34.9443 -19.3281l8.31934 -5.50391
|
||||
l-8.19141 -48.7676l33.4082 9.47168l-8.32031 -16.6396l47.3604 -10.1123l48 -3.96777l31.3594 -19.7119l1.28027 -57.3447l-22.7842 -65.4072l-27.6475 -68.0967l-50.1768 -30.8477l-39.9355 -90.8799l-36.0957 5.12012l17.1514 -23.4238l-1.91992 -16.5127
|
||||
l-33.2803 -26.4961c19.4561 -1.79199 38.1445 -5.8877 57.9844 -5.8877z" />
|
||||
<glyph glyph-name="uniF432" unicode=""
|
||||
d="M1408 640l-448 448l-448 -448l-128 128l576 576l576 -576z" />
|
||||
<glyph glyph-name="uniF210" unicode=""
|
||||
d="M1024 2048c565.632 0 1024 -458.496 1024 -1024c0 -565.632 -458.368 -1024 -1024 -1024c-100.864 0 -198.016 14.7197 -290.176 42.1123c38.7842 61.4395 81.2793 140.288 103.04 219.264c12.6719 45.5684 72.0635 281.6 72.0635 281.6
|
||||
c35.7119 -67.9678 139.648 -127.743 250.24 -127.743c329.088 0 552.448 300.159 552.448 701.823c0 303.744 -257.28 586.624 -648.192 586.624c-486.527 0 -731.904 -348.8 -731.904 -639.744c0 -176.128 66.5605 -332.928 209.664 -391.168
|
||||
c23.4248 -9.59961 44.416 -0.511719 51.2002 25.4727c4.73633 18.0479 16 63.4873 20.9922 82.1758c6.78418 25.7275 4.0957 34.6875 -14.8477 57.2158c-41.0879 48.6406 -67.4561 111.488 -67.4561 200.704c0 258.816 193.536 490.496 504.063 490.496
|
||||
c274.944 0 426.112 -168.064 426.112 -392.448c0 -295.296 -130.432 -544.384 -324.608 -544.384c-107.136 0 -187.264 88.5762 -161.664 197.12c30.7207 129.664 90.4961 269.824 90.4961 363.392c0 83.8398 -44.9277 153.729 -138.111 153.729
|
||||
c-109.44 0 -197.504 -113.28 -197.504 -265.088c0 -96.6406 32.7676 -162.049 32.7676 -162.049s-112.128 -474.88 -131.712 -557.951c-18.4316 -77.8242 -20.7363 -163.456 -17.9199 -235.137c-360.832 158.336 -612.992 518.784 -612.992 937.984
|
||||
c0 565.504 458.496 1024 1024 1024z" />
|
||||
<glyph glyph-name="uniF437" unicode=""
|
||||
d="M1280 1792c141.312 0 256 -114.688 256 -256v-1024c0 -141.312 -114.688 -256 -256 -256h-512c-141.312 0 -256 114.688 -256 256v1024c0 141.312 114.688 256 256 256h512zM1024 384c70.7842 0 128 57.2158 128 128s-57.2158 128 -128 128
|
||||
c-70.6562 0 -128 -57.2158 -128 -128s57.3438 -128 128 -128zM1408 768v768h-768v-768h768z" />
|
||||
<glyph glyph-name="uniF468" unicode=""
|
||||
d="M256 256v1536h256v-1536h-256zM1536 1664h256v-768h-256c-256 0 -256 128 -512 128s-256 -128 -384 -128v768c128 0 128 128 384 128s256 -128 512 -128z" />
|
||||
<glyph glyph-name="uniF107" unicode=""
|
||||
d="M1088 1792c176.768 0 320 -143.232 320 -320v-384c0 -131.2 -78.9756 -243.584 -192 -292.992v150.912c39.04 35.2002 64 85.6318 64 142.08v384c0 105.856 -86.1436 192 -192 192s-192 -86.1436 -192 -192v-384c0 -56.4482 24.96 -106.88 64 -142.08v-150.912
|
||||
c-112.896 49.4082 -192 161.792 -192 292.992v384c0 176.768 143.232 320 320 320zM960 1380.99c112.896 -49.4082 192 -161.792 192 -292.992v-384c0 -176.768 -143.232 -320 -320 -320s-320 143.232 -320 320v384c0 131.2 79.1035 243.584 192 292.992v-150.912
|
||||
c-39.04 -35.2002 -64 -85.6318 -64 -142.08v-384c0 -105.856 86.1436 -192 192 -192s192 86.1436 192 192v384c0 56.4482 -24.96 106.88 -64 142.08v150.912z" />
|
||||
<glyph glyph-name="uniF442" unicode=""
|
||||
d="M1280 640v256l128 128v-512h-896v896h512l-128 -128h-256v-640h640zM1024 1664h640v-640h-128v421.504l-549.504 -549.504l-90.4961 90.4961l549.504 549.504h-421.504v128z" />
|
||||
<glyph glyph-name="uniF221" unicode=""
|
||||
d="M1664 1024c0 -55.9355 -35.9678 -102.912 -85.8877 -120.32c13.8232 -20.6074 21.8877 -45.0557 21.8877 -71.6797c0 -55.8076 -35.9678 -102.784 -85.8877 -120.32c13.8232 -20.6074 21.8877 -45.0557 21.8877 -71.6797c0 -70.6562 -57.3438 -128 -128 -128h-64
|
||||
c70.6562 0 128 -57.3438 128 -128s-57.3438 -128 -128 -128h-448c-192 0 -256 128 -384 128h-128v640h192c128 0 320 256 320 640c0 0 0 128 64 128s192 -144 192 -320c0 -192 -32 -320 -32 -320h416c70.6562 0 128 -57.3438 128 -128z" />
|
||||
<glyph glyph-name="uniF50A" unicode=""
|
||||
d="M1856 1024c35.3281 0 64 -28.6719 64 -64s-28.6719 -64 -64 -64h-204.928c-9.85645 -48.7676 -26.624 -94.5918 -46.8486 -138.624c116.608 -134.528 187.776 -309.376 187.776 -501.376v-64c0 -35.2002 -28.6719 -64 -64 -64s-64 28.7998 -64 64v64
|
||||
c0 144.896 -48.7676 277.888 -130.048 385.152c-116.736 -155.265 -300.672 -257.152 -509.952 -257.152c-208.768 0 -392.448 101.504 -509.312 256.128c-81.2803 -106.88 -130.688 -239.231 -130.688 -384.128v-64c0 -35.2002 -28.6719 -64 -64 -64s-64 28.7998 -64 64v64
|
||||
c0 192 71.2959 366.72 187.904 501.376c-20.3525 44.0322 -36.9922 89.8564 -46.9766 138.624h-204.928c-35.3281 0 -64 28.6719 -64 64s28.6719 64 64 64h192c0 61.6963 12.1602 119.936 29.0557 176c-98.1758 129.024 -157.056 289.408 -157.056 464v64
|
||||
c0 35.3281 28.6719 64 64 64s64 -28.6719 64 -64v-64c0 -353.408 286.592 -640 640 -640c353.536 0 640 286.592 640 640v64c0 35.3281 28.6719 64 64 64s64 -28.6719 64 -64v-64c0 -173.952 -58.4961 -333.824 -156.032 -462.592
|
||||
c17.2803 -56.3203 28.0322 -115.328 28.0322 -177.408h192zM1024 1152c-208.896 0 -388.352 126.08 -467.84 305.92c116.864 126.08 282.496 206.08 467.84 206.08c185.472 0 350.976 -80 467.84 -206.08c-79.4883 -179.84 -258.815 -305.92 -467.84 -305.92z" />
|
||||
<glyph glyph-name="uniF455" unicode=""
|
||||
d="M1024 1792c424.064 0 768 -343.936 768 -768s-343.936 -768 -768 -768c-424.192 0 -768 343.936 -768 768s343.808 768 768 768zM1024 1536c-70.7842 0 -128 -57.3438 -128 -128s57.2158 -128 128 -128c70.6562 0 128 57.3438 128 128s-57.3438 128 -128 128zM1280 512
|
||||
v128h-160v512h-320.128v-128h128.128v-384h-160v-128h512z" />
|
||||
<glyph glyph-name="uniF223" unicode=""
|
||||
d="M1105.28 1232.51v92.9287c0 44.1592 -36.4805 79.8711 -81.2803 79.8711s-81.2803 -35.7119 -81.2803 -79.8711l-0.383789 -481.024c-2.55957 -184.192 -155.008 -332.416 -342.912 -332.416c-189.696 0 -343.424 150.912 -343.424 337.28v209.151h262.784v-206.592
|
||||
c0 -43.9043 36.3516 -79.7441 81.2803 -79.7441c44.9277 0 81.2793 35.7119 81.2793 79.7441v487.168c6.65625 180.48 157.185 324.992 342.656 324.992c186.112 0 337.152 -145.536 342.656 -327.04v-106.624l-156.416 -45.8242zM1529.22 1058.43h262.784v-209.151
|
||||
c0 -186.368 -153.728 -337.28 -343.424 -337.28c-188.544 0 -341.632 149.376 -343.296 334.08v210.304l104.96 -48l156.288 45.8242v-211.84c0 -44.2881 36.3516 -80 81.4072 -80c44.9287 0 81.2803 35.7119 81.2803 80v216.063z" />
|
||||
<glyph glyph-name="uniF212" unicode=""
|
||||
d="M1658.75 1791.87c184.192 -5.37598 270.976 -123.776 260.352 -355.072c-7.93555 -172.928 -129.792 -409.472 -365.439 -710.016c-243.584 -313.729 -449.792 -470.784 -618.368 -470.784c-104.448 0 -192.896 95.6162 -264.96 286.72
|
||||
c-48.2559 175.232 -96.5117 350.336 -144.64 525.568c-53.6318 190.976 -111.232 286.592 -172.672 286.592c-13.4404 0 -60.416 -27.7764 -140.673 -83.584l-84.3516 107.648c88.4482 77.0557 175.616 154.111 261.504 231.168
|
||||
c117.888 100.991 206.464 154.111 265.472 159.487c139.521 13.3125 225.28 -81.2793 257.536 -283.392c34.8164 -218.24 58.8799 -353.92 72.4482 -407.04c40.1924 -180.992 84.4805 -271.36 132.736 -271.36c37.5039 0 93.8232 58.752 169.088 176.128
|
||||
c75.0078 117.376 115.2 206.849 120.576 268.16c10.624 101.376 -29.4404 152.192 -120.576 152.192c-43.0078 0 -87.2959 -9.98438 -132.736 -29.1846c88.0645 285.952 256.512 424.704 504.704 416.769z" />
|
||||
<glyph glyph-name="uniF206" unicode=""
|
||||
d="M729.6 1152h550.4s12.7998 -38.4004 12.7998 -89.5996c0 -332.801 -230.399 -563.2 -563.2 -563.2c-320 0 -588.8 268.8 -588.8 588.8s281.601 588.8 588.8 588.8c153.601 0 294.4 -51.2002 384 -153.6l-153.6 -153.601c-38.4004 25.6006 -102.4 76.8008 -230.4 76.8008
|
||||
c-204.8 0 -371.199 -166.4 -371.199 -371.2s166.399 -371.2 371.199 -371.2c230.4 0 320 166.4 332.801 243.2h-332.801v204.8zM1664 1152h128v-128h-128v-128h-128v128h-128v128h128v128h128v-128z" />
|
||||
<glyph glyph-name="uniF407" unicode=""
|
||||
d="M1280 1536l256 -128v-128h-128h-128h-128h-128h-128h-128h-128h-128h-128v128l256 128c0 70.7842 57.3438 128 128 128h384c70.7842 0 128 -57.2158 128 -128zM1088 1408c35.3281 0 64 28.6719 64 64s-28.6719 64 -64 64h-256c-35.3281 0 -64 -28.6719 -64 -64
|
||||
s28.6719 -64 64 -64h256zM1280 1216h128v-704c0 -70.7842 -57.2158 -128 -128 -128h-640c-70.6562 0 -128 57.2158 -128 128v704h128v-704h128v704h128v-704h128v704h128v-704h128v704z" />
|
||||
<glyph glyph-name="uniF414" unicode=""
|
||||
d="M1996.03 601.984c116.992 -190.208 29.6953 -345.984 -193.536 -345.984h-1556.99c-223.231 0 -310.528 155.776 -193.536 345.984l759.552 1236.99c116.864 190.336 308.097 190.336 424.961 0zM1024 512c70.7842 0 128 57.2158 128 128s-57.2158 128 -128 128
|
||||
c-70.6562 0 -128 -57.2158 -128 -128s57.3438 -128 128 -128zM1113.22 896l51.584 640h-281.6l51.2002 -640h178.815z" />
|
||||
<glyph glyph-name="uniF50E" unicode=""
|
||||
d="M384 896v256h1280v-256h-1280z" />
|
||||
<glyph glyph-name="uniF461" unicode=""
|
||||
d="M1024 384l-647.552 612.992c-149.376 141.312 -161.408 383.231 -27.1367 540.288c134.4 157.184 364.416 169.855 513.792 28.5439l160.896 -152.32l160.768 152.32c149.248 141.184 379.393 128.64 513.792 -28.5439
|
||||
c134.656 -157.057 122.368 -398.977 -27.0078 -540.416z" />
|
||||
<glyph glyph-name="uniF470" unicode=""
|
||||
d="M1536 1152c70.7842 0 128 -57.3438 128 -128v-640c0 -70.7842 -57.2158 -128 -128 -128h-1024c-70.6562 0 -128 57.2158 -128 128v640c0 70.6562 57.3438 128 128 128v128c0 282.752 229.248 512 512 512s512 -229.248 512 -512v-128zM768 1152h512v128
|
||||
c0 141.312 -114.688 256 -256 256s-256 -114.688 -256 -256v-128z" />
|
||||
<glyph glyph-name="uniF50C" unicode=""
|
||||
d="M1479.55 819.2c98.5605 -32 203.137 -51.2002 312.448 -51.2002v-512c-848.256 0 -1536 687.744 -1536 1536h512c0 -162.048 38.5283 -314.752 105.856 -450.816l-189.185 -189.184c136.192 -235.008 344.96 -422.4 595.328 -532.224z" />
|
||||
<glyph glyph-name="uniF220" unicode=""
|
||||
d="M1856.77 834.048c32.3848 -65.6641 50.6885 -138.88 50.3047 -217.344c0 -269.696 -218.88 -488.704 -488.576 -488.704c-83.584 0 -161.92 21.376 -230.656 58.1123c-50.4316 -8.83203 -102.016 -13.8242 -154.496 -13.8242
|
||||
c-465.279 0 -842.624 377.216 -842.624 842.496c0 58.2402 6.14453 114.688 17.2803 169.6c-42.4961 72.1924 -67.0723 156.8 -67.0723 246.912c0 269.824 218.88 488.704 488.704 488.704c95.7441 0 184.704 -27.3916 260.225 -75.0078
|
||||
c46.4639 7.80762 94.5918 12.416 143.871 12.416c465.408 0 842.624 -377.344 842.624 -842.624c0 -62.0801 -6.65527 -122.752 -19.584 -180.736zM1466.11 612.096c38.9121 55.5527 58.624 118.656 58.752 188.16c0 58.2402 -11.2646 107.904 -34.1758 148.353
|
||||
c-22.9121 40.3193 -54.7842 73.8555 -95.2324 100.224c-39.168 25.7275 -87.8076 48.1279 -143.744 66.0479c-55.4238 17.9199 -118.271 34.1758 -186.496 48.6396c-53.7598 12.416 -93.0557 21.8887 -116.479 28.6729c-23.04 6.14355 -45.4404 15.2314 -67.8398 26.3672
|
||||
c-21.8887 10.624 -38.5283 23.5527 -50.4326 38.0166c-11.1357 13.9521 -16.7676 30.3359 -16.7676 49.2803c0 31.2314 16.8955 57.4717 52.2236 80.5117c36.3525 23.5518 85.6318 35.9678 146.048 35.9678c64.8965 0 112.384 -11.2637 140.544 -32.6396
|
||||
c29.1846 -21.6318 54.2725 -53.6318 75.5205 -93.3125c18.5596 -31.3594 34.9434 -53.248 50.6875 -67.2002c16.3838 -14.5918 40.5762 -22.3994 71.9365 -22.3994c34.9434 0 63.8721 12.416 86.9121 36.4795c23.04 23.4248 34.6875 50.8164 34.6875 81.1523
|
||||
c0 31.3604 -9.08789 63.3604 -25.2158 95.7441c-17.2803 32.3838 -44.7998 63.1035 -81.9199 92.2881c-36.8643 28.5439 -83.8398 52.0957 -139.008 69.5039c-55.8086 16.7676 -121.729 25.5996 -196.736 25.5996c-94.7197 0 -177.536 -13.1836 -247.424 -39.04
|
||||
c-70.5283 -26.3682 -125.952 -64.3838 -163.584 -113.664c-38.0166 -49.2793 -56.96 -106.496 -56.96 -170.239c0 -67.2002 17.792 -123.776 54.2715 -169.217c35.0723 -44.1592 83.9688 -79.8721 144.385 -105.728c58.752 -25.2158 133.247 -47.3604 220.672 -66.0479
|
||||
c64.2559 -13.3125 115.712 -26.2402 154.239 -38.0166c36.8643 -11.2637 67.3281 -27.9033 89.9844 -49.2793c22.1436 -20.7363 32.6396 -46.9766 32.6396 -80.1279c0 -42.3682 -20.2236 -76.8008 -62.0801 -105.345c-43.1357 -29.0557 -100.352 -43.9033 -169.728 -43.9033
|
||||
c-50.9443 0 -92.416 7.16797 -122.624 21.6318c-30.3359 13.9521 -54.2715 32.5117 -70.5283 54.2715c-17.2793 22.6562 -33.4072 51.4561 -48.6396 85.7607c-13.4404 31.3594 -29.5684 55.8076 -49.2803 72.0635c-20.7354 17.2803 -45.3115 25.7285 -74.4961 25.7285
|
||||
c-35.0713 0 -64.7676 -10.3682 -87.8076 -32.3848c-23.5518 -21.8877 -35.3281 -48.6396 -35.3281 -79.6152c0 -48.8965 17.9199 -100.608 53.8877 -152.192c35.0723 -50.9443 82.3047 -92.416 138.752 -123.136c79.3604 -41.8564 180.864 -63.1045 301.696 -63.1045
|
||||
c100.736 0 189.44 15.4883 263.04 46.208c75.3926 30.9766 132.225 74.4961 171.648 129.92z" />
|
||||
<glyph glyph-name="uniF415" unicode=""
|
||||
d="M1408 1024h512v-256h-310.016c-98.8164 -225.92 -323.584 -384 -585.984 -384c-176.768 0 -335.488 72.832 -451.072 188.928l0.640625 0.640625c-50.0488 50.0479 -50.0488 130.943 0 180.991c50.0479 50.0488 130.943 50.1768 180.991 0
|
||||
c69.376 -69.6318 163.456 -114.56 269.44 -114.56c212.096 0 384 171.904 384 384zM1024 1408c-212.096 0 -384 -171.904 -384 -384h-512v256h310.016c98.8164 225.92 323.712 384 585.984 384c176.896 0 335.488 -72.96 451.072 -188.928
|
||||
c50.0479 -50.0479 50.0479 -130.944 0 -180.992s-130.944 -50.0479 -180.992 0l-0.639648 -0.639648c-69.376 69.6318 -163.328 114.56 -269.44 114.56zM832 1024c0 106.112 86.0156 192 192 192c106.112 0 192 -85.8877 192 -192s-85.8877 -192 -192 -192
|
||||
c-105.984 0 -192 85.8877 -192 192z" />
|
||||
<glyph glyph-name="uniF207" unicode=""
|
||||
d="M604.672 256h-329.216v990.72h329.216v-990.72zM440.064 1381.89h-2.04883c-110.464 0 -182.016 76.1602 -182.016 171.137c0 97.1514 73.5996 171.136 186.368 171.136c112.512 0 181.888 -74.1123 184.063 -171.136c0 -94.9766 -71.5518 -171.137 -186.367 -171.137z
|
||||
M1792 256h-329.216v530.048c0 133.12 -47.3604 224 -166.656 224c-91.1357 0 -145.28 -61.1836 -169.088 -120.32c-8.57617 -21.2471 -10.752 -50.9434 -10.752 -80.5117v-553.216h-329.344s4.35156 897.792 0 990.72h329.344v-140.416
|
||||
c43.7764 67.4561 121.984 163.584 296.448 163.584c216.704 0 379.264 -141.567 379.264 -445.823v-568.064z" />
|
||||
<glyph glyph-name="uniF500" unicode=""
|
||||
d="M2048 0h-1920l960 959.872z" />
|
||||
<glyph glyph-name="uniF302" unicode=""
|
||||
d="M1024 1536h512v-512l-768 -768l-512 512zM1280 1152c70.7842 0 128 57.2158 128 128s-57.2158 128 -128 128s-128 -57.2158 -128 -128s57.2158 -128 128 -128z" />
|
||||
<glyph glyph-name="uniF108" unicode=""
|
||||
d="M1664 1536c141.312 0 256 -114.688 256 -256v-384c0 -141.312 -114.688 -256 -256 -256h-128v-448l-448 448h-331.008l128 128h395.008c211.712 0 384 172.288 384 384v384zM1280 1792c141.312 0 256 -114.688 256 -256v-384c0 -141.312 -114.688 -256 -256 -256h-448
|
||||
l-448 -448v448h-128c-141.312 0 -256 114.688 -256 256v384c0 141.312 114.688 256 256 256h1024z" />
|
||||
<glyph glyph-name="uniF405" unicode=""
|
||||
d="M1536 1408l-320 -320l320 -320l-128 -128l-320 320l-320 -320l-128 128l320 320l-320 320l128 128l320 -320l320 320z" />
|
||||
<glyph glyph-name="uniF501" unicode=""
|
||||
d="M0 128v1920l960 -960z" />
|
||||
<glyph glyph-name="uniF50D" unicode=""
|
||||
d="M1024.13 896c-105.984 0 -192.128 86.0156 -192.128 192v512c0 105.856 86.1436 192 192.128 192c106.112 0 191.872 -86.1436 191.872 -192v-512c0 -105.984 -85.7598 -192 -191.872 -192zM1401.47 1024h192c-27.3916 -244.48 -206.464 -441.984 -441.472 -496v-272
|
||||
h-256v272c-234.88 54.0156 -414.08 251.52 -441.472 496h192c30.5918 -181.504 187.52 -320 377.472 -320c190.208 0 347.008 138.496 377.472 320z" />
|
||||
<glyph glyph-name="uniF503" unicode=""
|
||||
d="M2048 2048v-1920l-960 960z" />
|
||||
<glyph glyph-name="uniF101" unicode=""
|
||||
d="M1024 1792c424.064 0 768 -343.936 768 -768s-343.936 -768 -768 -768s-768 343.936 -768 768s343.936 768 768 768zM1024 768c141.312 0 256 114.688 256 256s-114.688 256 -256 256s-256 -114.688 -256 -256s114.688 -256 256 -256z" />
|
||||
<glyph glyph-name="uniF204" unicode=""
|
||||
d="M1182.21 1271.81h328.704l-14.4639 -302.72h-314.24v-841.088h-320.128v841.088h-222.08v302.72h222.08v258.561c0 203.008 131.456 389.632 434.176 389.632c122.496 0 212.992 -11.6484 212.992 -11.6484l-7.04004 -282.624s-92.5439 0.640625 -193.536 0.640625
|
||||
c-108.928 0 -126.464 -50.3037 -126.464 -133.504c0 -12.416 0 -15.3604 0 -13.9521v-207.104z" />
|
||||
<glyph glyph-name="uniF444" unicode=""
|
||||
d="M1600 640c-70.7842 0 -128 -57.2158 -128 -128s57.2158 -128 128 -128h64v-128h-1024c-141.312 0 -256 114.688 -256 256v1024c0 141.312 114.688 256 256 256h1024v-1152h-64zM640 384h817.92c-30.7197 34.0479 -49.9199 78.5918 -49.9199 128
|
||||
s19.2002 93.9521 49.9199 128h-817.92c-70.6562 0 -128 -57.2158 -128 -128s57.3438 -128 128 -128z" />
|
||||
<glyph glyph-name="uniF416" unicode=""
|
||||
d="M1088 1792c176.768 0 320 -143.232 320 -320v-640c0 -247.424 -200.576 -448 -448 -448s-448 200.576 -448 448v320h128v-320c0 -176.768 143.232 -320 320 -320c176.64 0 320 143.232 320 320v640c0 105.984 -86.0156 192 -192 192c-106.112 0 -192 -86.0156 -192 -192
|
||||
v-512c0 -35.3281 28.6719 -64 64 -64s64 28.6719 64 64v451.968h128v-451.968c0 -105.984 -86.0156 -192 -192 -192c-106.112 0 -192 86.0156 -192 192v512c0 176.768 143.232 320 320 320z" />
|
||||
<glyph glyph-name="uniF459" unicode=""
|
||||
d="M1920 1664v-1280l-768 480v-480l-1024 640l1024 640v-480z" />
|
||||
<glyph glyph-name="uniF441" unicode=""
|
||||
d="M1664 1024c141.312 0 256 -114.688 256 -256s-114.688 -256 -256 -256h-512v256h256l-384 384l-384 -384h256v-256h-512c-141.312 0 -256 114.688 -256 256s114.688 256 256 256h6.40039c-4.09668 20.7363 -6.40039 42.1123 -6.40039 64c0 176.768 143.232 320 320 320
|
||||
c89.3438 0 169.984 -36.7363 227.968 -95.8721c60.7998 131.84 193.408 223.872 348.032 223.872c211.968 0 384 -171.904 384 -384c0 -45.1836 -9.21582 -87.8076 -23.5518 -128h23.5518z" />
|
||||
<glyph glyph-name="uniF506" unicode=""
|
||||
d="M768 1920l489.344 -489.472l-640 -640l-268.928 269.056c-49.792 49.792 -49.792 131.2 0 180.992l292.864 292.735l-1.28027 2.68848s128 128 128 384zM1738.24 565.76c33.1514 -32.7676 53.7598 -78.208 53.7598 -128.64c0 -99.9678 -81.1523 -181.12 -181.12 -181.12
|
||||
c-50.4316 0 -95.7441 20.6084 -128.64 53.7598l-330.24 330.24v128l-64 64c-35.2002 35.2002 -104.704 23.2959 -154.496 -26.4961l-75.0078 -75.0078c-49.792 -49.792 -131.2 -49.792 -180.992 0l-14.8477 14.8477l640 640l14.8477 -14.8477
|
||||
c49.792 -49.792 49.792 -131.2 0 -180.992l-75.0078 -75.0078c-49.792 -49.792 -61.6963 -119.296 -26.4961 -154.496l64 -64h128zM1610.88 373.12c35.3281 0 64 28.6719 64 64s-28.6719 64 -64 64s-64 -28.6719 -64 -64s28.6719 -64 64 -64z" />
|
||||
<glyph glyph-name="uniF105" unicode=""
|
||||
d="M1408 1408c0 -167.04 -107.264 -307.584 -256 -360.448v-535.552l-256 -128v663.552c-148.864 52.8643 -256 193.408 -256 360.448c0 212.096 171.904 384 384 384c211.968 0 384 -171.904 384 -384z" />
|
||||
<glyph glyph-name="uniF473" unicode=""
|
||||
d="M384 1664h1280v-1280h-1280v1280zM768 1408c-70.6562 0 -128 -57.3438 -128 -128s57.3438 -128 128 -128s128 57.3438 128 128s-57.3438 128 -128 128zM1536 512v576l-128 192l-448 -672l-192 288l-256 -384h1024z" />
|
||||
<glyph glyph-name="uniF452" unicode=""
|
||||
d="M512 1664l1024 -640l-1024 -640v1280z" />
|
||||
<glyph glyph-name="uniF408" unicode=""
|
||||
d="M1792 1150.72l-475.904 -329.983l182.528 -535.04l-474.624 331.903l-474.624 -331.903l182.528 535.04l-475.904 329.983l587.52 -1.02344l180.48 535.68l180.48 -535.68z" />
|
||||
<glyph glyph-name="uniF450" unicode=""
|
||||
d="M768 1024l1024 640v-1280zM256 384v1280h384v-1280h-384z" />
|
||||
<glyph glyph-name="uniF517" unicode=""
|
||||
d="M1408 1152l384 384v-1024l-384 384v-256c0 -70.7842 -57.2158 -128 -128 -128h-896c-70.6562 0 -128 57.2158 -128 128v768c0 70.6562 57.3438 128 128 128h896c70.7842 0 128 -57.3438 128 -128v-256z" />
|
||||
<glyph glyph-name="uniF106" unicode=""
|
||||
d="M256 896v640h640v-640c0 -282.752 -229.248 -512 -512 -512v256c141.312 0 256 114.688 256 256h-384zM1152 1536h640v-640c0 -282.752 -229.248 -512 -512 -512v256c141.312 0 256 114.688 256 256h-384v640z" />
|
||||
<glyph glyph-name="uniF208" unicode=""
|
||||
d="M1664 1920c141.312 0 256 -114.688 256 -256v-1280c0 -141.312 -114.688 -256 -256 -256h-1280c-141.312 0 -256 114.688 -256 256v1280c0 141.312 114.688 256 256 256h1280zM663.168 384v792.96h-263.552v-792.96h263.552zM531.328 1285.25
|
||||
c91.9043 0 149.12 60.9277 149.12 136.96c-1.66406 77.6963 -57.2158 136.96 -147.328 136.96c-90.2402 0 -149.12 -59.2637 -149.12 -136.96c0 -76.0322 57.2158 -136.96 145.664 -136.96h1.66406zM1613.44 384v454.656c0 243.456 -130.049 356.863 -303.488 356.863
|
||||
c-139.776 0 -202.496 -76.9277 -237.44 -130.943v112.384h-263.552c3.45605 -74.3682 0 -792.96 0 -792.96h263.552v442.88c0 23.6797 1.79199 47.3604 8.57617 64.1279c19.0723 47.3604 62.4639 96.3838 135.296 96.3838c95.4883 0 133.504 -72.7031 133.504 -179.199
|
||||
v-424.192h263.553z" />
|
||||
<glyph glyph-name="uniF304" unicode=""
|
||||
d="M1024 1152c-141.312 0 -256 114.688 -256 256s114.688 256 256 256s256 -114.688 256 -256s-114.688 -256 -256 -256zM1152 1024c211.968 0 384 -171.904 384 -384v-256h-1024v256c0 212.096 172.032 384 384 384h256z" />
|
||||
<glyph glyph-name="uniF225" unicode=""
|
||||
d="M655.104 1857.54l368.896 -307.968l-531.456 -328.192l-364.544 291.84zM128 929.536l364.544 291.84l531.456 -328.064l-368.896 -308.096zM1024 893.312l531.456 328.064l364.544 -291.84l-527.232 -344.32zM1920 1513.22l-364.544 -291.84l-531.456 328.192
|
||||
l368.768 307.968zM1025.02 826.88l369.92 -306.944l158.464 103.297v-115.713l-528.384 -317.056l-528.257 317.056v115.713l158.336 -103.297z" />
|
||||
<glyph glyph-name="uniF103" unicode=""
|
||||
d="M1152 1408h896v-896h-896v896zM128 1024v384h896v-384h-896zM640 512v384h384v-384h-384zM128 512v384h384v-384h-384z" />
|
||||
<glyph glyph-name="uniF431" unicode=""
|
||||
d="M1408 1280l128 -128l-576 -576l-576 576l128 128l448 -448z" />
|
||||
<glyph glyph-name="uniF200" unicode=""
|
||||
d="M1024 2048c565.504 0 1024 -458.496 1024 -1024c0 -452.224 -293.12 -835.712 -699.776 -971.392c-51.9678 -9.98438 -70.3994 21.7598 -70.3994 49.2793c0 33.4082 1.2793 144 1.2793 280.704c0 95.7441 -32.7676 158.208 -69.5039 189.696
|
||||
c228.097 25.3438 467.456 112 467.456 505.344c0 111.744 -39.5518 203.136 -105.088 274.688c10.4961 25.8555 45.6963 130.048 -10.2402 270.976c0 0 -85.8877 27.5205 -281.344 -104.96c-81.792 22.7842 -169.344 34.0479 -256.384 34.4316
|
||||
c-87.04 -0.383789 -174.592 -11.6475 -256.384 -34.4316c-195.584 132.48 -281.601 104.96 -281.601 104.96c-55.6797 -140.928 -20.4795 -244.992 -9.85547 -270.976c-65.5361 -71.5527 -105.472 -162.944 -105.472 -274.688c0 -392.32 239.104 -480.384 466.432 -506.112
|
||||
c-29.3125 -25.7275 -55.6797 -70.6553 -65.0244 -136.96c-58.2393 -26.2393 -206.72 -71.2959 -297.983 85.248c0 0 -54.1445 98.1768 -156.929 105.473c0 0 -100.096 1.2793 -7.04004 -62.208c0 0 67.0723 -31.4883 113.664 -150.017c0 0 60.0322 -198.912 344.96 -137.216
|
||||
c0.512695 -85.248 1.4082 -149.76 1.4082 -173.952c0 -27.2637 -18.6875 -58.752 -69.8877 -49.5361c-406.912 135.425 -700.288 519.168 -700.288 971.648c0 565.504 458.496 1024 1024 1024z" />
|
||||
<glyph glyph-name="uniF421" unicode=""
|
||||
d="M384 896v256h1152v-256h-1152z" />
|
||||
<glyph glyph-name="uniF454" unicode=""
|
||||
d="M640 896v128h-512v256h512v128l384 -256zM1536 2048c141.312 0 256 -114.688 256 -256v-1536c0 -141.312 -114.688 -256 -256 -256h-1024c-141.312 0 -256 114.688 -256 256v640h256v-384h1024v1280h-1024v-384h-256v384c0 141.312 114.688 256 256 256h1024zM1024 128
|
||||
c70.7842 0 128 57.2158 128 128s-57.2158 128 -128 128c-70.6562 0 -128 -57.2158 -128 -128s57.3438 -128 128 -128z" />
|
||||
<glyph glyph-name="uniF213" unicode=""
|
||||
d="M1536 1664c211.968 0 384 -171.904 384 -384v-512c0 -212.096 -172.032 -384 -384 -384h-1024c-212.096 0 -384 171.904 -384 384v512c0 212.096 171.904 384 384 384h1024zM768 640l640 384l-640 384v-768z" />
|
||||
<glyph glyph-name="uniF401" unicode=""
|
||||
d="M1297.15 878.848l494.848 -494.848l-128 -128l-494.848 494.848c-94.8486 -68.9912 -210.816 -110.848 -337.152 -110.848c-318.08 0 -576 257.92 -576 576s257.92 576 576 576s576 -257.92 576 -576c0 -126.336 -41.8564 -242.304 -110.848 -337.152zM832 768
|
||||
c247.552 0 448 200.576 448 448s-200.448 448 -448 448c-247.424 0 -448 -200.576 -448 -448s200.576 -448 448 -448zM512 1152v128h640v-128h-640z" />
|
||||
<glyph glyph-name="uniF436" unicode=""
|
||||
d="M512 1408v128h128v-128h-128zM768 1408v128h128v-128h-128zM1024 1408v128h128v-128h-128zM1280 1536h128v-128h-128v128zM512 1152v128h128v-128h-128zM768 1152v128h128v-128h-128zM1024 1152v128h128v-128h-128zM1280 1152v128h128v-128h-128zM512 896v128h128v-128
|
||||
h-128zM768 896v128h128v-128h-128zM1024 896v128h128v-128h-128zM1280 896v128h128v-128h-128zM512 640v128h128v-128h-128zM768 640v128h128v-128h-128zM1024 640v128h128v-128h-128zM1280 640v128h128v-128h-128z" />
|
||||
<glyph glyph-name="uniF434" unicode=""
|
||||
d="M1152 0l896 896v-896h-896z" />
|
||||
<glyph glyph-name="uniF303" unicode=""
|
||||
d="M960 1792c388.736 0 704 -315.136 704 -704c0 -388.736 -315.264 -704 -704 -704c-388.864 0 -704 315.264 -704 704c0 388.864 315.136 704 704 704zM960 512c317.952 0 576 257.92 576 576s-258.048 576 -576 576c-318.08 0 -576 -257.92 -576 -576
|
||||
s257.92 -576 576 -576zM1024 1536v-421.504l297.984 -297.984l-90.4961 -90.4961l-335.488 335.488v474.496h128z" />
|
||||
<glyph glyph-name="uniF464" unicode=""
|
||||
d="M1536 1408l-768 -384l-768 384v128h1536v-128zM0 1216l768 -384l256 128v-448h-1024v704zM1920 1152c70.7842 0 128 -57.3438 128 -128v-640c0 -70.7842 -57.2158 -128 -128 -128h-640c-70.7842 0 -128 57.2158 -128 128v640c0 70.6562 57.2158 128 128 128h640z
|
||||
M1920 640v128h-640v-128h640z" />
|
||||
<glyph glyph-name="uniF109" unicode=""
|
||||
d="M256 1280h384l384 384v-1280l-384 384h-384v512zM1295.49 1295.62c69.5039 -69.5039 112.512 -165.504 112.512 -271.616s-43.0078 -202.112 -112.512 -271.488l-90.4961 90.4961c46.3359 46.208 75.0078 110.208 75.0078 180.992
|
||||
c0 70.6562 -28.6719 134.656 -75.0078 181.12zM1476.61 1476.61c115.712 -115.841 187.392 -275.841 187.392 -452.608c0 -176.896 -71.6797 -336.896 -187.392 -452.608l-90.4961 90.4961c92.6719 92.6719 149.888 220.672 149.888 362.112
|
||||
c0 141.312 -57.2158 269.44 -149.888 361.984z" />
|
||||
<glyph glyph-name="uniF428" unicode=""
|
||||
d="M1024 1280c141.312 0 256 -114.688 256 -256s-114.688 -256 -256 -256s-256 114.688 -256 256s114.688 256 256 256z" />
|
||||
</font>
|
||||
</defs></svg>
|
After Width: | Height: | Size: 75 KiB |
BIN
plugins/jetpack/_inc/genericons/genericons/Genericons.ttf
Normal file
BIN
plugins/jetpack/_inc/genericons/genericons/Genericons.ttf
Normal file
Binary file not shown.
BIN
plugins/jetpack/_inc/genericons/genericons/Genericons.woff
Normal file
BIN
plugins/jetpack/_inc/genericons/genericons/Genericons.woff
Normal file
Binary file not shown.
263
plugins/jetpack/_inc/genericons/genericons/genericons.css
Normal file
263
plugins/jetpack/_inc/genericons/genericons/genericons.css
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
27
plugins/jetpack/_inc/header.php
Normal file
27
plugins/jetpack/_inc/header.php
Normal file
|
@ -0,0 +1,27 @@
|
|||
<?php $current = $_GET['page']; ?>
|
||||
<div class="jp-content">
|
||||
<div class="jp-frame">
|
||||
<div class="header">
|
||||
<nav role="navigation" class="header-nav drawer-nav nav-horizontal">
|
||||
|
||||
<ul class="main-nav">
|
||||
<li class="jetpack-logo"><a href="<?php echo Jetpack::admin_url(); ?>" title="<?php esc_attr_e( 'Jetpack', 'jetpack' ); ?>" <?php if ( 'jetpack' == $current ) { echo 'class="current"'; } ?>><span><?php esc_html_e( 'Jetpack', 'jetpack' ); ?></span></a></li>
|
||||
<?php if ( ( Jetpack::is_active() || Jetpack::is_development_mode() ) && current_user_can( 'jetpack_manage_modules' ) ) : ?>
|
||||
<li class="jetpack-modules">
|
||||
<a href="<?php echo Jetpack::admin_url( 'page=jetpack_modules' ); ?>" class="jp-button--settings <?php if ( 'jetpack_modules' == $current ) { echo 'current'; } ?>"><?php esc_html_e( 'Settings', 'jetpack' ); ?></a>
|
||||
</li>
|
||||
<li class="jetpack-modules">
|
||||
<a href="http://jetpack.com/survey/?rel=<?php echo JETPACK__VERSION; ?>" target="_blank" class="jp-button--settings"><?php esc_html_e( 'Feedback', 'jetpack' ); ?></a>
|
||||
</li>
|
||||
<?php endif; // End if connected or dev mode and is admin ?>
|
||||
|
||||
<?php if ( Jetpack::is_active() && ! Jetpack::is_development_mode() ) : ?>
|
||||
<li class="jetpack-modules">
|
||||
<a href="<?php echo Jetpack::admin_url( 'page=my_jetpack' ); ?>" class="jp-button--settings <?php if ( 'my_jetpack' == $current ) { echo 'current'; } ?>"><?php esc_html_e( 'My Jetpack', 'jetpack' ); ?></a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
|
||||
</nav>
|
||||
</div><!-- .header -->
|
||||
<div class="wrapper">
|
54
plugins/jetpack/_inc/jetpack-admin.js
Normal file
54
plugins/jetpack/_inc/jetpack-admin.js
Normal file
|
@ -0,0 +1,54 @@
|
|||
(function($) {
|
||||
|
||||
///////////////////////////////////////
|
||||
// INIT
|
||||
///////////////////////////////////////
|
||||
|
||||
$(document).ready(function () {
|
||||
initEvents();
|
||||
configFixedElements();
|
||||
});
|
||||
|
||||
///////////////////////////////////////
|
||||
// FUNCTIONS
|
||||
///////////////////////////////////////
|
||||
|
||||
function configFixedElements() {
|
||||
var jpTopFrame = $('.frame.top'),
|
||||
jpBottomFrame = $('.frame.bottom'),
|
||||
$body = $('body');
|
||||
|
||||
$body.scroll(function(){
|
||||
if ( 33 > jpTopFrame.offset().top ) {
|
||||
jpTopFrame.addClass('fixed');
|
||||
$body.addClass('jp-frame-top-fixed');
|
||||
}
|
||||
if ( 120 <= jpBottomFrame.offset().top ) {
|
||||
jpTopFrame.removeClass('fixed');
|
||||
$body.removeClass('jp-frame-top-fixed');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function initEvents() {
|
||||
// toggle search and filters at mobile resolution
|
||||
$('.filter-search').on('click', function () {
|
||||
$(this).toggleClass('active');
|
||||
$('.manage-right').toggleClass('show');
|
||||
$('.shade').toggle();
|
||||
});
|
||||
|
||||
// Toggle all checkboxes
|
||||
$('.checkall').on('click', function () {
|
||||
$('.table-bordered').find(':checkbox').prop('checked', this.checked);
|
||||
});
|
||||
|
||||
// Clicking outside modal, or close X closes modal
|
||||
$('.shade, .modal .close').on('click', function ( event ) {
|
||||
$('.shade, .modal').hide();
|
||||
$('.manage-right').removeClass('show');
|
||||
event.preventDefault();
|
||||
});
|
||||
}
|
||||
|
||||
})(jQuery);
|
135
plugins/jetpack/_inc/jetpack-jitm.js
Normal file
135
plugins/jetpack/_inc/jetpack-jitm.js
Normal file
|
@ -0,0 +1,135 @@
|
|||
/* global jitmL10n, jQuery */
|
||||
|
||||
(function($, jitmL10n) {
|
||||
|
||||
///////////////////////////////////////
|
||||
// INIT
|
||||
///////////////////////////////////////
|
||||
|
||||
var data;
|
||||
|
||||
$(document).ready(function () {
|
||||
|
||||
data = {
|
||||
'action' : 'jitm_ajax',
|
||||
'jitmNonce' : jitmL10n.jitm_nonce,
|
||||
'photon' : jitmL10n.photon_msgs,
|
||||
'manage' : jitmL10n.manage_msgs,
|
||||
'stats' : jitmL10n.stats_msgs,
|
||||
'jitm_stats_url' : jitmL10n.jitm_stats_url,
|
||||
'enabledModules' : []
|
||||
};
|
||||
|
||||
initEvents();
|
||||
|
||||
});
|
||||
|
||||
///////////////////////////////////////
|
||||
// FUNCTIONS
|
||||
///////////////////////////////////////
|
||||
|
||||
function initEvents() {
|
||||
|
||||
var module_slug, success_msg, fail_msg, hide_msg,
|
||||
$body = $( 'body' );
|
||||
|
||||
// On dismiss of JITM admin notice
|
||||
$body.on( 'click', '.jp-jitm .dismiss', function() {
|
||||
var $self = $( this );
|
||||
|
||||
// hide the notice
|
||||
$self.closest( '.jp-jitm' ).hide();
|
||||
|
||||
// ajax request to save dismiss and never show again
|
||||
data.jitmActionToTake = 'dismiss';
|
||||
module_slug = $self.data( 'module' );
|
||||
data.jitmModule = module_slug;
|
||||
|
||||
$.post( jitmL10n.ajaxurl, data, function ( response ) {
|
||||
if ( true === response.success ) {
|
||||
//console.log('successfully dismissed for ever')
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$body.on( 'click', '.jp-jitm .activate', function() {
|
||||
|
||||
var $self = $( this ),
|
||||
$jitm = $self.closest( '.jp-jitm' );
|
||||
$jitm.find( '.button' ).addClass( 'hide' );
|
||||
$jitm.find( '.j-spinner' ).toggleClass( 'hide' );
|
||||
data.jitmActionToTake = 'activate';
|
||||
|
||||
// get the module we're working with using the data-module attribute
|
||||
module_slug = $self.data( 'module' );
|
||||
// Check if there's a custom success message, otherwise use default.
|
||||
success_msg = $self.data( 'module-success' ) ? $self.data( 'module-success' ) : data[module_slug].success;
|
||||
fail_msg = data[module_slug].fail;
|
||||
|
||||
data.jitmModule = module_slug;
|
||||
|
||||
// since 2.8 ajaxurl is always defined in the admin header and points to admin-ajax.php
|
||||
$.post( jitmL10n.ajaxurl, data, function ( response ) {
|
||||
// If there's no response, something bad happened
|
||||
if ( true === response.success ) {
|
||||
var $msg = $jitm.find( '.msg' );
|
||||
$msg.html( success_msg );
|
||||
$jitm.find( '.j-spinner' ).add( '#jetpack-wordpressdotcom' ).toggleClass( 'hide' );
|
||||
if ( 'manage' !== data.jitmModule ) {
|
||||
hide_msg = setTimeout( function () {
|
||||
$jitm.hide( 'slow' );
|
||||
}, 5000 );
|
||||
}
|
||||
$jitm.find( '.show-after-enable.hide' ).removeClass( 'hide' );
|
||||
data.enabledModules.push( module_slug );
|
||||
} else {
|
||||
$jitm.html( '<p><span class="icon"></span>' + fail_msg + '</p>' );
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$body.on( 'click', '.jp-jitm .launch', function() {
|
||||
var $jitm = $(this).closest( '.jp-jitm' );
|
||||
|
||||
if ( $jitm.data( 'stats_url' ) ) {
|
||||
data.jitm_stats_url = $jitm.data( 'stats_url' );
|
||||
new Image().src = data.jitm_stats_url;
|
||||
}
|
||||
|
||||
data.jitmModule = $jitm.data( 'track' ) ? $jitm.data( 'track' ) : $(this).data( 'module' );
|
||||
data.jitmActionToTake = 'launch';
|
||||
// ajax request to save click in stat
|
||||
$.post( jitmL10n.ajaxurl, data );
|
||||
} );
|
||||
|
||||
$body.on( 'click', '#jetpack-wordpressdotcom', function() {
|
||||
//Log user heads to wordpress.com/plugins
|
||||
new Image().src = data.jitm_stats_url;
|
||||
});
|
||||
|
||||
// Display Photon JITM after user started uploading an image.
|
||||
if ( $( '#tmpl-jitm-photon' ).length > 0 ) {
|
||||
wp.Uploader.queue.on( 'add', function ( e ) {
|
||||
if ( -1 === $.inArray( 'photon', data.enabledModules ) ) {
|
||||
if ( 'image' === e.attributes.type ) {
|
||||
var jitmTemplate = wp.template( 'jitm-photon' ),
|
||||
$menu = wp.media.frame.$el.find( '.media-menu' ),
|
||||
$jitm;
|
||||
if ( $menu.length > 0 && 0 === $menu.find( '.jp-jitm' ).length ) {
|
||||
$jitm = $menu.append( jitmTemplate() ).find( '.jp-jitm' );
|
||||
|
||||
// JITM is visible to user, track it.
|
||||
data.jitmActionToTake = 'viewed';
|
||||
data.jitmModule = $jitm.data( 'track' );
|
||||
$.post( jitmL10n.ajaxurl, data );
|
||||
}
|
||||
} else {
|
||||
$( '.media-menu' ).find( '.jp-jitm' ).remove();
|
||||
}
|
||||
}
|
||||
} );
|
||||
}
|
||||
}
|
||||
|
||||
})(jQuery, jitmL10n);
|
150
plugins/jetpack/_inc/jetpack-modules.js
Normal file
150
plugins/jetpack/_inc/jetpack-modules.js
Normal file
|
@ -0,0 +1,150 @@
|
|||
|
||||
( function( window, $, items, models, views, i18n, modalinfo, nonces ) {
|
||||
'use strict';
|
||||
|
||||
var modules, list_table, handle_module_tag_click, $the_table, $the_filters, $the_search, $jp_frame, $bulk_button, show_modal, hide_modal, set_modal_tab, originPoint;
|
||||
|
||||
$the_table = $( '.wp-list-table.jetpack-modules' );
|
||||
$the_filters = $( '.navbar-form' );
|
||||
$the_search = $( '#srch-term-search-input' );
|
||||
$jp_frame = $( '.jp-frame' );
|
||||
$bulk_button = $( '#doaction' );
|
||||
|
||||
modules = new models.Modules( {
|
||||
items : items
|
||||
} );
|
||||
|
||||
list_table = new views.List_Table( {
|
||||
el : '#the-list',
|
||||
model : modules
|
||||
} );
|
||||
|
||||
// Kick off an initial redraw.
|
||||
modules.trigger( 'change' );
|
||||
|
||||
// Handle the filtering of modules.
|
||||
handle_module_tag_click = function( event ) {
|
||||
// Switch the item in the subsubsub list that's flagged as current.
|
||||
$( '.subsubsub' ).find( 'a[data-title="' + $(this).data('title') + '"]' ).addClass( 'current' )
|
||||
.closest( 'li' ).siblings().find( 'a.current' ).removeClass( 'current' );
|
||||
|
||||
event.preventDefault();
|
||||
modules.trigger( 'change' );
|
||||
};
|
||||
|
||||
$( '.subsubsub a' ).on( 'click', { modules : modules }, handle_module_tag_click );
|
||||
|
||||
/**
|
||||
* Attach event listener for ESC key to close modal
|
||||
*/
|
||||
|
||||
$( window ).on( 'keydown', function( e ) {
|
||||
// If pressing ESC close the modal
|
||||
if ( 27 === e.keyCode ) {
|
||||
hide_modal();
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* The modal details.
|
||||
*/
|
||||
|
||||
show_modal = function( module ) {
|
||||
$jp_frame.children( '.modal, .shade' ).show();
|
||||
$( '.modal ').empty().html( wp.template( 'modal' )( items[ module ] ) );
|
||||
$( '.modal' )[0].setAttribute( 'tabindex', '0' );
|
||||
$( '.modal' ).focus();
|
||||
$( 'body' ).css( 'overflow', 'hidden' );
|
||||
};
|
||||
|
||||
/**
|
||||
* If modalinfo is defined, auto popup the modal
|
||||
*/
|
||||
$( document ).ready(function() {
|
||||
if ( modalinfo ) {
|
||||
show_modal( modalinfo );
|
||||
}
|
||||
});
|
||||
|
||||
hide_modal = function() {
|
||||
$jp_frame.children( '.modal, .shade' ).hide();
|
||||
$jp_frame.children( '.modal' ).data( 'current-module', '' );
|
||||
set_modal_tab( null );
|
||||
originPoint.focus();
|
||||
$( '.modal' )[0].removeAttribute( 'tabindex' );
|
||||
$( 'body' ).css( 'overflow', 'auto' );
|
||||
event.preventDefault();
|
||||
};
|
||||
|
||||
set_modal_tab = function( tab ) {
|
||||
$jp_frame.find( '.modal .active' ).removeClass( 'active' );
|
||||
switch ( tab ) {
|
||||
case 'learn-more':
|
||||
$jp_frame.find( '.modal .learn-more a' ).addClass( 'active' );
|
||||
$jp_frame.children( '.modal' ).trigger( 'learn-more' );
|
||||
break;
|
||||
case 'config':
|
||||
$jp_frame.find( '.modal .config a' ).addClass( 'active' );
|
||||
$jp_frame.children( '.modal' ).trigger( 'config' );
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
$jp_frame.on( 'click', '.modal .close, .shade', hide_modal );
|
||||
|
||||
$jp_frame.children( '.modal' ).on( 'learn-more', function() {
|
||||
var current_module = $jp_frame.children( '.modal' ).data( 'current-module' );
|
||||
$(this).find('.content').html( items[ current_module ].long_description );
|
||||
} );
|
||||
|
||||
$jp_frame.children( '.modal' ).on( 'config', function() {
|
||||
var current_module = $jp_frame.children( '.modal' ).data( 'current-module' );
|
||||
// Hack. Until we import the form to the modal, just redirect to where it would have gone.
|
||||
hide_modal();
|
||||
window.location.href = items[ current_module ].configure_url;
|
||||
// $(this).find('.content').html( items[ current_module ].configure_form );
|
||||
} );
|
||||
|
||||
$the_table.on( 'click', '.info a', { modules : modules }, function( event ) {
|
||||
event.preventDefault();
|
||||
originPoint = this;
|
||||
show_modal( $(this).closest('.jetpack-module').attr('id'), 'learn-more' );
|
||||
} );
|
||||
|
||||
$the_filters.on( 'click', '.button-group .button', { modules : modules }, function( event ) {
|
||||
event.preventDefault();
|
||||
$(this).addClass('active').siblings('.active').removeClass('active');
|
||||
modules.trigger( 'change' );
|
||||
} );
|
||||
|
||||
$the_search.on( 'keyup search', function( e ) {
|
||||
// Don't trigger change on tab, since it's only used for accessibility
|
||||
// anyway, and will remove all checked boxes
|
||||
if ( e.keyCode !== 9 ) {
|
||||
modules.trigger( 'change' );
|
||||
}
|
||||
} );
|
||||
|
||||
$the_search.prop( 'placeholder', i18n.search_placeholder );
|
||||
|
||||
$bulk_button.on( 'click', function( event ) {
|
||||
var selectedModules = $('.jetpack-modules-list-table-form').serialize(),
|
||||
selectedAction = $(this).siblings('select').val(),
|
||||
url;
|
||||
|
||||
if ( selectedModules.length && '-1' !== selectedAction ) {
|
||||
url = 'admin.php?page=jetpack&action=' + encodeURIComponent( selectedAction );
|
||||
url += '&' + selectedModules;
|
||||
url += '&_wpnonce=' + encodeURIComponent( nonces.bulk );
|
||||
|
||||
window.location.href = url;
|
||||
} else {
|
||||
// Possibly add in an alert here explaining why nothing's happening?
|
||||
}
|
||||
|
||||
event.preventDefault();
|
||||
} );
|
||||
|
||||
} ) ( this, jQuery, window.jetpackModulesData.modules, this.jetpackModules.models, this.jetpackModules.views, window.jetpackModulesData.i18n, window.jetpackModulesData.modalinfo, window.jetpackModulesData.nonces );
|
72
plugins/jetpack/_inc/jetpack-modules.models.js
Normal file
72
plugins/jetpack/_inc/jetpack-modules.models.js
Normal file
|
@ -0,0 +1,72 @@
|
|||
|
||||
this.jetpackModules = this.jetpackModules || {};
|
||||
|
||||
window.jetpackModules.models = (function( window, $, _, Backbone ) {
|
||||
'use strict';
|
||||
|
||||
var models = {};
|
||||
|
||||
models.Modules = Backbone.Model.extend({
|
||||
visibles : {},
|
||||
|
||||
/**
|
||||
* Updates modules.items dataset to be a reflection of both the current
|
||||
* modules.raw data, as well as any filters or sorting that may be in effect.
|
||||
*/
|
||||
filter_and_sort : function() {
|
||||
var subsubsub = $('.subsubsub .current'),
|
||||
items = this.get( 'raw' ),
|
||||
m_filter = $('.button-group.filter-active .active'),
|
||||
m_sort = $('.button-group.sort .active'),
|
||||
m_search = $('#srch-term-search-input').val().toLowerCase(),
|
||||
groups;
|
||||
|
||||
// If a module filter has been selected, filter it!
|
||||
if ( ! subsubsub.closest('li').hasClass( 'all' ) ) {
|
||||
items = _.filter( items, function( item ) {
|
||||
return _.contains( item.module_tags, subsubsub.data( 'title' ) );
|
||||
} );
|
||||
}
|
||||
|
||||
if ( m_filter.data('filter-by') ) {
|
||||
items = _.filter( items, function( item ) {
|
||||
return item[ m_filter.data('filter-by') ] === m_filter.data('filter-value');
|
||||
} );
|
||||
}
|
||||
|
||||
if ( m_search.length ) {
|
||||
items = _.filter( items, function( item ) {
|
||||
var search_text = item.name + ' ' + item.description + ' ' + item.long_description + ' ' + item.search_terms + ' ' + item.jumpstart_desc + ' ' + item.module_tags;
|
||||
return ( -1 !== search_text.toLowerCase().indexOf( m_search ) );
|
||||
} );
|
||||
}
|
||||
|
||||
if ( m_sort.data('sort-by') ) {
|
||||
items = _.sortBy( items, m_sort.data('sort-by') );
|
||||
if ( 'reverse' === m_sort.data('sort-order') ) {
|
||||
items.reverse();
|
||||
}
|
||||
}
|
||||
|
||||
// Sort unavailable modules to the end if the user is running in local mode.
|
||||
groups = _.groupBy( items, 'available' );
|
||||
if ( _.has( groups, 'false' ) ) {
|
||||
items = [].concat( groups[true], groups[false] );
|
||||
}
|
||||
|
||||
// Now shove it back in.
|
||||
this.set( 'items', items );
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
initialize : function() {
|
||||
var items = this.get( 'items' );
|
||||
this.set( 'raw', items );
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
return models;
|
||||
|
||||
})( this, jQuery, _, Backbone );
|
62
plugins/jetpack/_inc/jetpack-modules.views.js
Normal file
62
plugins/jetpack/_inc/jetpack-modules.views.js
Normal file
|
@ -0,0 +1,62 @@
|
|||
|
||||
this.jetpackModules = this.jetpackModules || {};
|
||||
|
||||
window.jetpackModules.views = (function( window, $, _, Backbone, wp ) {
|
||||
'use strict';
|
||||
|
||||
var views = {};
|
||||
|
||||
views.List_Table = Backbone.View.extend({
|
||||
|
||||
template : wp.template( 'Jetpack_Modules_List_Table_Template' ),
|
||||
|
||||
/**
|
||||
* If we can, use replaceState to change the URL and indicate the new filtering.
|
||||
* This will be handy with redirecting back to the same state after activating/deactivating.
|
||||
*/
|
||||
updateUrl : function() {
|
||||
if ( ! window.history.replaceState ) {
|
||||
return;
|
||||
}
|
||||
|
||||
var url = window.location.href.split('?')[0] + '?page=jetpack_modules',
|
||||
m_tag = $('.subsubsub .current'),
|
||||
m_filter = $('.button-group.filter-active .active'),
|
||||
m_sort = $('.button-group.sort .active'),
|
||||
m_search = $('#srch-term-search-input').val();
|
||||
|
||||
if ( m_search.length ) {
|
||||
url += '&s=' + encodeURIComponent( m_search );
|
||||
}
|
||||
|
||||
if ( ! m_tag.hasClass('all') ) {
|
||||
url += '&module_tag=' + encodeURIComponent( m_tag.data('title') );
|
||||
}
|
||||
|
||||
if ( m_filter.data('filter-by') ) {
|
||||
url += '&' + encodeURIComponent( m_filter.data('filter-by') ) + '=' + encodeURIComponent( m_filter.data('filter-value') );
|
||||
}
|
||||
|
||||
if ( 'name' !== m_sort.data('sort-by') ) {
|
||||
url += '&sort_by=' + encodeURIComponent( m_sort.data('sort-by') );
|
||||
}
|
||||
|
||||
window.history.replaceState( {}, '', url );
|
||||
},
|
||||
|
||||
render : function() {
|
||||
this.model.filter_and_sort();
|
||||
this.$el.html( this.template( this.model.attributes ) );
|
||||
this.updateUrl();
|
||||
return this;
|
||||
},
|
||||
|
||||
initialize : function() {
|
||||
this.listenTo( this.model, 'change', this.render );
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
return views;
|
||||
|
||||
})( this, jQuery, _, Backbone, wp );
|
256
plugins/jetpack/_inc/jetpack.js
Normal file
256
plugins/jetpack/_inc/jetpack.js
Normal file
|
@ -0,0 +1,256 @@
|
|||
/* global jetpack: true, isRtl, jetpackL10n, userSettings, confirm */
|
||||
|
||||
// ScrollTo Plugin 1.4.2 | Copyright (c) 2007-2009 Ariel Flesler | GPL/MIT License
|
||||
/* jshint ignore:start */
|
||||
;(function(d){var k=d.scrollTo=function(a,i,e){d(window).scrollTo(a,i,e)};k.defaults={axis:'xy',duration:parseFloat(d.fn.jquery)>=1.3?0:1};k.window=function(a){return d(window)._scrollable()};d.fn._scrollable=function(){return this.map(function(){var a=this,i=!a.nodeName||d.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!i)return a;var e=(a.contentWindow||a).document||a.ownerDocument||a;return d.browser.safari||e.compatMode=='BackCompat'?e.body:e.documentElement})};d.fn.scrollTo=function(n,j,b){if(typeof j=='object'){b=j;j=0}if(typeof b=='function')b={onAfter:b};if(n=='max')n=9e9;b=d.extend({},k.defaults,b);j=j||b.speed||b.duration;b.queue=b.queue&&b.axis.length>1;if(b.queue)j/=2;b.offset=p(b.offset);b.over=p(b.over);return this._scrollable().each(function(){var q=this,r=d(q),f=n,s,g={},u=r.is('html,body');switch(typeof f){case'number':case'string':if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(f)){f=p(f);break}f=d(f,this);case'object':if(f.is||f.style)s=(f=d(f)).offset()}d.each(b.axis.split(''),function(a,i){var e=i=='x'?'Left':'Top',h=e.toLowerCase(),c='scroll'+e,l=q[c],m=k.max(q,i);if(s){g[c]=s[h]+(u?0:l-r.offset()[h]);if(b.margin){g[c]-=parseInt(f.css('margin'+e))||0;g[c]-=parseInt(f.css('border'+e+'Width'))||0}g[c]+=b.offset[h]||0;if(b.over[h])g[c]+=f[i=='x'?'width':'height']()*b.over[h]}else{var o=f[h];g[c]=o.slice&&o.slice(-1)=='%'?parseFloat(o)/100*m:o}if(/^\d+$/.test(g[c]))g[c]=g[c]<=0?0:Math.min(g[c],m);if(!a&&b.queue){if(l!=g[c])t(b.onAfterFirst);delete g[c]}});t(b.onAfter);function t(a){r.animate(g,j,b.easing,a&&function(){a.call(this,n,b)})}}).end()};k.max=function(a,i){var e=i=='x'?'Width':'Height',h='scroll'+e;if(!d(a).is('html,body'))return a[h]-d(a)[e.toLowerCase()]();var c='client'+e,l=a.ownerDocument.documentElement,m=a.ownerDocument.body;return Math.max(l[h],m[h])-Math.min(l[c],m[c])};function p(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery);
|
||||
/* jshint ignore:end */
|
||||
|
||||
jetpack = {
|
||||
numModules: 0,
|
||||
container: null,
|
||||
arrow: null,
|
||||
linkClicked: null,
|
||||
resizeTimeout: null,
|
||||
resizeTimer: null,
|
||||
shadowTimer: null,
|
||||
statusText: null,
|
||||
isRTL: !( 'undefined' === typeof isRtl || !isRtl ),
|
||||
didDebug: false,
|
||||
|
||||
init: function() {
|
||||
jetpack.numModules = jQuery( 'div.jetpack-module' ).not( '.placeholder' ).size();
|
||||
jetpack.container = jQuery( 'div.module-container' );
|
||||
|
||||
jetpack.level_modules();
|
||||
jetpack.level_placeholders();
|
||||
jetpack.level_placeholders_on_resize();
|
||||
|
||||
jQuery( 'a.more-info-link', 'div.jetpack-module' ).bind( 'click', function(e) {
|
||||
e.preventDefault();
|
||||
jetpack.hide_shadows();
|
||||
|
||||
if ( jetpack.linkClicked && jetpack.linkClicked.parents( 'div.jetpack-module' ).attr( 'id' ) === jQuery(this).parents( 'div.jetpack-module' ).attr( 'id' ) ) {
|
||||
jetpack.close_learn_more( function() { jetpack.show_shadows(); } );
|
||||
} else {
|
||||
jetpack.linkClicked = jQuery(this);
|
||||
jetpack.insert_learn_more( jQuery(this).parents( 'div.jetpack-module' ), function() { jetpack.show_shadows(); } );
|
||||
jQuery( 'a.jetpack-deactivate-button' ).hide();
|
||||
jQuery( 'a.jetpack-configure-button' ).show();
|
||||
jetpack.linkClicked.parents( 'div.jetpack-module' ).children( '.jetpack-module-actions' ).children( 'a.jetpack-deactivate-button' ).show();
|
||||
jetpack.linkClicked.parents( 'div.jetpack-module' ).children( '.jetpack-module-actions' ).children( 'a.jetpack-configure-button' ).hide();
|
||||
}
|
||||
} );
|
||||
|
||||
jQuery( window ).bind( 'resize', function() {
|
||||
jetpack.hide_shadows();
|
||||
|
||||
clearTimeout( jetpack.shadowTimer );
|
||||
jetpack.shadowTimer = setTimeout( function() { jetpack.show_shadows(); }, 200 );
|
||||
});
|
||||
|
||||
jQuery( 'a#jp-debug' ).bind( 'click', function(e) {
|
||||
e.preventDefault();
|
||||
if ( !jetpack.didDebug ) {
|
||||
jetpack.didDebug = true;
|
||||
jQuery( '#jetpack-configuration' ).load( this.href, function() {
|
||||
jQuery.scrollTo( 'max', 'fast' );
|
||||
} );
|
||||
}
|
||||
|
||||
jetpack.toggle_debug();
|
||||
});
|
||||
|
||||
jQuery( '#jp-disconnect a' ).click( function() {
|
||||
if ( confirm( jetpackL10n.ays_disconnect ) ) {
|
||||
jQuery( this ).addClass( 'clicked' ).css( {
|
||||
'background-image': 'url( ' + userSettings.url + 'wp-includes/images/spinner-2x.gif )',
|
||||
'background-position': '9px 5px',
|
||||
'background-size': '16px 16px'
|
||||
} ).unbind( 'click' ).click( function() { return false; } );
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} );
|
||||
jQuery( '#jp-unlink a' ).click( function() {
|
||||
if ( confirm( jetpackL10n.ays_unlink ) ) {
|
||||
jQuery( this ).css( {
|
||||
'background-image': 'url( ' + userSettings.url + 'wp-includes/images/spinner-2x.gif )',
|
||||
'background-position': '9px 5px',
|
||||
'background-size': '16px 16px'
|
||||
} ).unbind( 'click' ).click( function() { return false; } );
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} );
|
||||
|
||||
jQuery( '#screen-meta, #screen-meta-links' ).wrapAll( '<div class="screen-meta-wrap" />' );
|
||||
},
|
||||
|
||||
level_modules: function() {
|
||||
var max_height = 0;
|
||||
|
||||
// Get the tallest module card and set them all to be that tall.
|
||||
jQuery( 'div.jetpack-module', 'div.module-container' ).each( function() {
|
||||
max_height = Math.max( max_height, jQuery(this).height() );
|
||||
} ).height( max_height );
|
||||
},
|
||||
|
||||
level_placeholders: function() {
|
||||
jQuery( 'div.placeholder' ).show();
|
||||
|
||||
var containerWidth = jetpack.container.width(),
|
||||
needed = 5 * parseInt( containerWidth / 242, 10 ) - jetpack.numModules;
|
||||
|
||||
if ( jetpack.numModules * 242 > containerWidth ) {
|
||||
jQuery( 'div.placeholder' ).slice( needed ).hide();
|
||||
} else {
|
||||
jQuery( 'div.placeholder' ).hide();
|
||||
}
|
||||
},
|
||||
|
||||
level_placeholders_on_resize: function() {
|
||||
jQuery( window ).bind( 'resize', function() {
|
||||
if ( jetpack.resizeTimer ) {
|
||||
return;
|
||||
}
|
||||
|
||||
jetpack.resizeTimer = setTimeout( function() {
|
||||
jetpack.resizeTimer = false;
|
||||
jetpack.level_placeholders();
|
||||
jetpack.level_placeholders_on_resize();
|
||||
}, 100 );
|
||||
} );
|
||||
},
|
||||
|
||||
insert_learn_more: function( card, callback ) {
|
||||
var perRow = parseInt( jetpack.container.width() / 242, 10 ),
|
||||
cardPosition = 0,
|
||||
cardRow = 0,
|
||||
learnMoreOffset = jetpack.isRTL ? 144 : 28;
|
||||
|
||||
// Get the position of the card clicked.
|
||||
jQuery( 'div.jetpack-module', 'div.module-container' ).each( function( i, el ) {
|
||||
if ( jQuery(el).attr('id') === jQuery(card).attr('id') ) {
|
||||
cardPosition = i;
|
||||
}
|
||||
} );
|
||||
|
||||
cardRow = 1 + parseInt( cardPosition / perRow, 10 );
|
||||
|
||||
// Insert the more info box after the last item of the row.
|
||||
jQuery( 'div.jetpack-module', 'div.module-container' ).each( function( i, el ) {
|
||||
if ( i + 1 === ( perRow * cardRow ) ) {
|
||||
// More info box already exists.
|
||||
if ( jQuery( 'div.more-info' ).length ) {
|
||||
if ( jQuery( el ).next().hasClass( 'more-info' ) ) {
|
||||
jQuery( 'div.more-info div.jp-content' ).fadeOut( 100 );
|
||||
jetpack.learn_more_content( jQuery(card).attr( 'id' ) );
|
||||
jQuery( window ).scrollTo( ( jQuery( 'div.more-info' ).prev().offset().top ) - 70, 600, function() { if ( typeof callback === 'function' ) { callback.call( this ); } } );
|
||||
} else {
|
||||
jQuery( 'div.more-info div.jp-content' ).hide();
|
||||
jQuery( 'div.more-info' ).css( { height: '230px', minHeight: 0 } ).slideUp( 200, function() {
|
||||
var $this = jQuery(this);
|
||||
$this.detach().insertAfter( el );
|
||||
jQuery( 'div.more-info div.jp-content' ).hide();
|
||||
jetpack.learn_more_content( jQuery(card).attr( 'id' ) );
|
||||
$this.css( { height: '230px', minHeight: 0 } ).slideDown( 300, function() {
|
||||
$this.css( { height: 'auto', minHeight: '230px' } );
|
||||
} );
|
||||
jQuery( window ).scrollTo( ( $this.prev().offset().top ) - 70, 600, function() { if ( typeof callback === 'function' ) { callback.call( this ); } } );
|
||||
} );
|
||||
}
|
||||
|
||||
// More info box does not exist.
|
||||
} else {
|
||||
// Insert the box.
|
||||
jQuery( el ).after( '<div id="message" class="more-info jetpack-message"><div class="arrow"></div><div class="jp-content"></div><div class="jp-close">×</div><div class="clear"></div></div>' );
|
||||
|
||||
// Show the box
|
||||
jQuery( 'div.more-info' ).css( { height: '230px', minHeight: 0 } );
|
||||
jQuery( 'div.more-info', 'div.module-container' ).hide().slideDown( 400, function() {
|
||||
jQuery( 'div.more-info' ).css( { height: 'auto', minHeight: '230px' } );
|
||||
// Load the content and scroll to it
|
||||
jetpack.learn_more_content( jQuery(card).attr( 'id' ) );
|
||||
jQuery( window ).scrollTo( ( jQuery( 'div.more-info' ).prev().offset().top ) - 70, 600 );
|
||||
|
||||
if ( typeof callback === 'function' ) { callback.call( this ); }
|
||||
} );
|
||||
|
||||
jQuery( 'div.more-info' ).children( 'div.arrow' ).animate( { left: jQuery(card).offset().left - jetpack.container.offset().left + learnMoreOffset + 'px' }, 300 );
|
||||
}
|
||||
jQuery( 'div.more-info' ).children( 'div.arrow' ).animate( { left: jQuery(card).offset().left - jetpack.container.offset().left + learnMoreOffset + 'px' }, 300 );
|
||||
|
||||
return;
|
||||
}
|
||||
} );
|
||||
|
||||
// Listen for resize
|
||||
jQuery( window ).bind( 'resize', function() {
|
||||
jetpack.reposition_learn_more( card );
|
||||
jetpack.level_placeholders_on_resize();
|
||||
} );
|
||||
|
||||
// Listen for close.
|
||||
jQuery( 'div.more-info div.jp-close' ).unbind( 'click' ).bind( 'click', function() {
|
||||
jetpack.close_learn_more();
|
||||
} );
|
||||
},
|
||||
|
||||
reposition_learn_more: function( card ) {
|
||||
var perRow = parseInt( jetpack.container.width() / 242, 10 ),
|
||||
cardPosition = 0,
|
||||
cardRow;
|
||||
|
||||
// Get the position of the card clicked.
|
||||
jQuery( 'div.jetpack-module', 'div.module-container' ).each( function( i, el ) {
|
||||
if ( jQuery(el).attr('id') === jQuery(card).attr('id') ) {
|
||||
cardPosition = i;
|
||||
}
|
||||
} );
|
||||
|
||||
cardRow = 1 + parseInt( cardPosition / perRow, 10 );
|
||||
|
||||
jQuery( 'div.jetpack-module', 'div.module-container' ).each( function( i, el ) {
|
||||
if ( i + 1 === ( perRow * cardRow ) ) {
|
||||
jQuery( 'div.more-info' ).detach().insertAfter( el );
|
||||
jQuery( 'div.more-info' ).children( 'div.arrow' ).css( { left: jQuery(card).offset().left - jetpack.container.offset().left + 28 + 'px' }, 300 );
|
||||
}
|
||||
} );
|
||||
},
|
||||
|
||||
learn_more_content: function( module_id ) {
|
||||
var response = jQuery( '#jp-more-info-' + module_id ).html();
|
||||
jQuery( 'div.more-info div.jp-content' ).html( response ).hide().fadeIn( 300 );
|
||||
},
|
||||
|
||||
close_learn_more: function( callback ) {
|
||||
jQuery( 'div.more-info div.jp-content' ).hide();
|
||||
|
||||
jQuery( 'div.more-info' ).css( { height: '230px', minHeight: 0 } ).slideUp( 200, function() {
|
||||
jQuery( this ).remove();
|
||||
jQuery( 'a.jetpack-deactivate-button' ).hide();
|
||||
jetpack.linkClicked.parents( 'div.jetpack-module' ).children( '.jetpack-module-actions' ).children( 'a.jetpack-configure-button' ).show();
|
||||
jetpack.linkClicked = null;
|
||||
|
||||
if ( typeof callback === 'function' ) { callback.call( this ); }
|
||||
} );
|
||||
},
|
||||
|
||||
toggle_debug: function() {
|
||||
jQuery('div#jetpack-configuration').toggle( 0, function() {
|
||||
if ( jQuery( this ).is( ':visible' ) ) {
|
||||
jQuery.scrollTo( 'max', 'fast' );
|
||||
}
|
||||
} );
|
||||
},
|
||||
|
||||
hide_shadows: function() {
|
||||
jQuery( 'div.jetpack-module, div.more-info' ).css( { '-webkit-box-shadow': 'none' } );
|
||||
},
|
||||
|
||||
show_shadows: function() {
|
||||
jQuery( 'div.jetpack-module' ).css( { '-webkit-box-shadow': 'inset 0 1px 0 #fff, inset 0 0 20px rgba(0,0,0,0.05), 0 1px 2px rgba( 0,0,0,0.1 )' } );
|
||||
jQuery( 'div.more-info' ).css( { '-webkit-box-shadow': 'inset 0 0 20px rgba(0,0,0,0.05), 0 1px 2px rgba( 0,0,0,0.1 )' } );
|
||||
}
|
||||
};
|
||||
jQuery( function() { jetpack.init(); } );
|
86
plugins/jetpack/_inc/jp-my-jetpack.js
Normal file
86
plugins/jetpack/_inc/jp-my-jetpack.js
Normal file
|
@ -0,0 +1,86 @@
|
|||
/* global jpConnection, jQuery */
|
||||
|
||||
(function( $, jpConnection ) {
|
||||
|
||||
///////////////////////////////////////
|
||||
// INIT
|
||||
///////////////////////////////////////
|
||||
|
||||
var data = {
|
||||
'jetpackIsActive' : jpConnection.jetpackIsActive,
|
||||
'isAdmin' : jpConnection.isAdmin,
|
||||
'otherAdminsLinked' : jpConnection.otherAdminsLinked,
|
||||
'stats_urls' : jpConnection.my_jetpack_stats_urls,
|
||||
'masterUser' : jpConnection.masterUser,
|
||||
'masterUserLink' : jpConnection.masterUser.masterUserLink,
|
||||
'currentUser' : jpConnection.currentUser
|
||||
};
|
||||
|
||||
$( document ).ready(function () {
|
||||
renderPageTemplate( data );
|
||||
|
||||
// Set someone as master.
|
||||
$( '#change-primary-btn' ).click( function() {
|
||||
$( '#change-primary-btn' ).hide();
|
||||
$( '#user-list' ).show();
|
||||
$( '#save-primary-btn' ).show();
|
||||
|
||||
//Log My Jetpack event "change primary" in MC Stats
|
||||
new Image().src = data.stats_urls.change_primary;
|
||||
});
|
||||
|
||||
// Hide the success message after a little bit
|
||||
setTimeout( function(){
|
||||
jQuery( '.jetpack-message:not( .stay-visible, .jetpack-err )' ).hide( 600 );
|
||||
}, 6000);
|
||||
|
||||
});
|
||||
|
||||
function renderPageTemplate( data ) {
|
||||
$( '#my-jetpack-page-template' ).html( wp.template( 'connection-page' )( data ) );
|
||||
// Save the focused element, then shift focus to the modal window.
|
||||
confirmJetpackDisconnect();
|
||||
}
|
||||
|
||||
/*
|
||||
The function used to display the disconnect confirmation and support buttons
|
||||
*/
|
||||
function confirmJetpackDisconnect() {
|
||||
if ( window.location.hash.substr( '#disconnect' ) ) {
|
||||
$( '#jetpack-disconnect-content' ).show();
|
||||
$( '#my-jetpack-content, .my-jetpack-actions' ).hide();
|
||||
|
||||
//Log My Jetpack event "wants to disconnect Jetpack" in MC Stats
|
||||
new Image().src = data.stats_urls.disconnect_site;
|
||||
}
|
||||
|
||||
$( '#jetpack-disconnect' ).click( function() {
|
||||
$( '#jetpack-disconnect-content' ).show();
|
||||
$( '#my-jetpack-content, .my-jetpack-actions' ).hide();
|
||||
|
||||
//Log My Jetpack event "wants to disconnect Jetpack" in MC Stats
|
||||
new Image().src = data.stats_urls.disconnect_site;
|
||||
});
|
||||
|
||||
$( '#cancel-disconnect' ).click( function() {
|
||||
event.preventDefault();
|
||||
|
||||
$( '#jetpack-disconnect-content' ).hide();
|
||||
$( '#my-jetpack-content, .my-jetpack-actions' ).show();
|
||||
|
||||
//Log My Jetpack event "decided not to disconnect Jetpack" in MC Stats
|
||||
new Image().src = data.stats_urls.cancel_disconnect;
|
||||
});
|
||||
|
||||
$( '#jetpack-disconnect-content #support-no-disconnect' ).click( function() {
|
||||
//Log My Jetpack event "get support instead of disconnecting site" in MC Stats
|
||||
new Image().src = data.stats_urls.support_no_disconnect;
|
||||
});
|
||||
|
||||
$( '#jetpack-disconnect-content #confirm-disconnect' ).click( function() {
|
||||
//Log My Jetpack event "confirm the disconnecting of a the site" in MC Stats
|
||||
new Image().src = data.stats_urls.confirm_disconnect;
|
||||
});
|
||||
}
|
||||
|
||||
})( jQuery, jpConnection );
|
433
plugins/jetpack/_inc/jp.js
Normal file
433
plugins/jetpack/_inc/jp.js
Normal file
|
@ -0,0 +1,433 @@
|
|||
/* global wp, jetpackL10n, jQuery */
|
||||
|
||||
(function( $, modules, currentVersion, jetpackL10n ) {
|
||||
|
||||
///////////////////////////////////////
|
||||
// INIT
|
||||
///////////////////////////////////////
|
||||
|
||||
var originPoint,
|
||||
data;
|
||||
|
||||
$( document ).ready(function () {
|
||||
|
||||
data = {
|
||||
'jumpstartModules' : jetpackL10n.jumpstart_modules,
|
||||
'jumpstartModSlug' : jetpackL10n.jumpstart_modules,
|
||||
'jumpstartNonce' : jetpackL10n.activate_nonce,
|
||||
'jumpstartStatsURLS' : jetpackL10n.jumpstart_stats_urls,
|
||||
'nuxAdminStatsURLS' : jetpackL10n.admin_stats_urls,
|
||||
'showJumpstart' : jetpackL10n.show_jumpstart,
|
||||
'adminNonce' : jetpackL10n.admin_nonce
|
||||
};
|
||||
|
||||
initEvents();
|
||||
loadModules( 'Performance-Security', 'mod-nux', '#nux-performance-security' );
|
||||
loadModules( 'Traffic', 'mod-nux', '#nux-traffic' );
|
||||
if('1' === data.showJumpstart) {
|
||||
loadModules( 'Jumpstart', 'mod-jumpstart', '#jp-config-list' );
|
||||
}
|
||||
|
||||
/*
|
||||
We are listening to see if we need to refresh the data.
|
||||
We'd need to refresh the data only if the page is navigated to
|
||||
via the back or forward browser buttons. We do this so the
|
||||
browser cache isn't out of sync with the real data generated by the
|
||||
AJAX event.
|
||||
*/
|
||||
onload = function() {
|
||||
if ( window.location.hash.substr( '#refresh' ) ) {
|
||||
refreshData();
|
||||
}
|
||||
};
|
||||
|
||||
jumpStartAJAX();
|
||||
adminAJAX();
|
||||
});
|
||||
|
||||
///////////////////////////////////////
|
||||
// FUNCTIONS
|
||||
///////////////////////////////////////
|
||||
|
||||
function closeShadeToggle() {
|
||||
// Clicking outside modal, or close X closes modal
|
||||
$( '.shade, .modal .close' ).on( 'click', function () {
|
||||
$( '.shade, .modal' ).hide();
|
||||
$( '.manage-right' ).removeClass( 'show' );
|
||||
originPoint.focus();
|
||||
$( '.modal' )[0].removeAttribute( 'tabindex' );
|
||||
$( 'body' ).css( 'overflow', 'auto' );
|
||||
return false;
|
||||
});
|
||||
|
||||
$( window ).on( 'keydown', function( e ) {
|
||||
// If pressing ESC close the modal
|
||||
if ( 27 === e.keyCode ) {
|
||||
$( '.shade, .modal' ).hide();
|
||||
$( '.manage-right' ).removeClass( 'show' );
|
||||
originPoint.focus();
|
||||
$( '.modal' )[0].removeAttribute( 'tabindex' );
|
||||
$( 'body' ).css( 'overflow', 'auto' );
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function initEvents () {
|
||||
// Only show module table if Jumpstart isn't there
|
||||
if ( ! data.showJumpstart ) {
|
||||
$( '.nux-intro' ).show();
|
||||
}
|
||||
|
||||
// Show preconfigured list of features to enable via "Jump-start"
|
||||
$( '.jp-config-list-btn' ).click(function(){
|
||||
$( '#jp-config-list' ).toggle();
|
||||
recalculateModuleHeights();
|
||||
|
||||
//Log Jump Start event "learn more" in MC Stats
|
||||
new Image().src = data.jumpstartStatsURLS.learnmore;
|
||||
});
|
||||
|
||||
// Hide the successful connection message after a little bit
|
||||
setTimeout( function(){
|
||||
jQuery( '.jetpack-message:not( .stay-visible, .jetpack-err )' ).hide( 600 );
|
||||
}, 6000);
|
||||
|
||||
// Modal events
|
||||
$( document ).ready(function () {
|
||||
initModalEvents();
|
||||
});
|
||||
|
||||
// Debounce the resize event
|
||||
var pauseResize = false;
|
||||
window.onresize = function() {
|
||||
if ( !pauseResize ) {
|
||||
pauseResize = true;
|
||||
recalculateModuleHeights();
|
||||
setTimeout(function () {
|
||||
pauseResize = false;
|
||||
}, 100 );
|
||||
}
|
||||
};
|
||||
|
||||
// This function will track the number of clicks on the "See the other X Jetpack features"
|
||||
$( '.full-features-btn' ).click( function() {
|
||||
new Image().src = data.nuxAdminStatsURLS.learnmore+'-full-features-btn';
|
||||
});
|
||||
}
|
||||
|
||||
function initModalEvents() {
|
||||
var $modal = $( '.modal' );
|
||||
$( '.module h3, .feature a, .configs a, .more-info, .feat h4' ).on( 'click keypress', function (e) {
|
||||
// Only show modal on enter when keypress recorded (accessibility)
|
||||
if ( e.keyCode && 13 !== e.keyCode ) {
|
||||
return;
|
||||
}
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
$( '.shade' ).show();
|
||||
|
||||
// Show loading message on init
|
||||
$modal.html( wp.template( 'modalLoading' )( {} ) ).fadeIn();
|
||||
// Load & populate with content
|
||||
var $this = $( this ).parent(),
|
||||
index = $this.data( 'index' ),
|
||||
name = $this.data( 'name' );
|
||||
|
||||
$modal.empty().html( wp.template( 'modal' )( $.extend( modules[index], { name: name } ) ) );
|
||||
// Save the focused element, then shift focus to the modal window.
|
||||
originPoint = this;
|
||||
$modal[0].setAttribute( 'tabindex', '0' );
|
||||
$modal.focus();
|
||||
|
||||
// Disallow scroll
|
||||
$( 'body' ).css( 'overflow', 'hidden' );
|
||||
|
||||
closeShadeToggle();
|
||||
|
||||
// Modal header links
|
||||
$( '.modal header li a.title' ).on( 'click', function () {
|
||||
$( '.modal header li a.title' ).removeClass( 'active' );
|
||||
$( this ).addClass( 'active' );
|
||||
return false;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Load Modules for a template
|
||||
@param string: The module tag you'd like to filter by
|
||||
@param string: The template name
|
||||
@param string: The target element to display the template
|
||||
*/
|
||||
function loadModules( prop, template, location ) {
|
||||
// Mapping prior to sorting improves performance by over 50%
|
||||
var html = '',
|
||||
result = [],
|
||||
val = '',
|
||||
i,
|
||||
length,
|
||||
renderingmodules = [];
|
||||
|
||||
// create the map
|
||||
for ( i = 0, length = modules.length; i < length; i++ ) {
|
||||
if( modules[i].feature.indexOf(prop) !== -1 ) {
|
||||
val = modules[i].name.toLowerCase();
|
||||
result.push( {
|
||||
index: i,
|
||||
value: val,
|
||||
order: modules[i].recommendation_order
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Sort modules by recommendation order
|
||||
result.sort(function( a, b ) {
|
||||
if (a.order === b.order ) {
|
||||
return 0;
|
||||
}
|
||||
return ( a.order < b.order ) ? -1 : 1;
|
||||
});
|
||||
|
||||
// copy values in right order
|
||||
for ( i = 0, length = result.length; i < length; i++ ) {
|
||||
renderingmodules.push( modules[result[i].index] );
|
||||
renderingmodules[i].index = result[i].index; // make sure we set the index to the right order*/
|
||||
}
|
||||
|
||||
|
||||
// Render modules. Don't show active in Jumpstart.
|
||||
for ( i = 0; i < renderingmodules.length; i++ ) {
|
||||
if ( 'Jumpstart' === prop && ! renderingmodules[i].activated ) {
|
||||
html += wp.template( template )( renderingmodules[i] );
|
||||
} else if ( 'Jumpstart' !== prop ) {
|
||||
html += wp.template( template )( renderingmodules[i] );
|
||||
}
|
||||
}
|
||||
|
||||
$( location ).append( html );
|
||||
|
||||
// track Jump Start views
|
||||
if('Jumpstart' === prop) {
|
||||
new Image().src = data.jumpstartStatsURLS.viewed;
|
||||
}
|
||||
|
||||
recalculateModuleHeights();
|
||||
initModalEvents();
|
||||
}
|
||||
|
||||
function recalculateModuleHeights () {
|
||||
// Resize module heights based on screen resolution
|
||||
var module = $( '.jp-jumpstart, .module, .jp-support-column-left .widget-text' ),
|
||||
tallest = 0,
|
||||
thisHeight;
|
||||
|
||||
// Remove heights
|
||||
module.css( 'height', 'auto' );
|
||||
|
||||
// Determine new height
|
||||
module.each(function() {
|
||||
|
||||
thisHeight = $( this ).outerHeight();
|
||||
|
||||
if ( thisHeight > tallest ) {
|
||||
tallest = thisHeight;
|
||||
}
|
||||
});
|
||||
|
||||
// Apply new height plus 20 pixels
|
||||
module.css( 'height', ( parseInt( tallest, 10 ) + 5 ) + 'px' );
|
||||
}
|
||||
|
||||
/*
|
||||
Handles the jump start ajax requests.
|
||||
|
||||
Dismissing the Jump Start area will set an option, so it will never be seen again
|
||||
Initiating Jump Start will activate all modules that are recommended and set a sharing options while doing so.
|
||||
For either request, if update_option has failed, look for an error in the console.
|
||||
@todo delete the "reset everything" call - meant for testing only.
|
||||
*/
|
||||
function jumpStartAJAX() {
|
||||
|
||||
// Will dismiss the Jump Start area, and set wp option in callback
|
||||
$( '.dismiss-jumpstart' ).click(function(){
|
||||
$( '#jump-start-area' ).hide( 600 );
|
||||
|
||||
data.disableJumpStart = true;
|
||||
data.action = 'jetpack_jumpstart_ajax';
|
||||
|
||||
$.post( jetpackL10n.ajaxurl, data, function (response) {
|
||||
// If there's no response, something bad happened
|
||||
if ( ! response ) {
|
||||
//console.log( 'Option "jetpack_dismiss_jumpstart" not updated.' );
|
||||
}
|
||||
|
||||
window.location.hash = 'refresh';
|
||||
});
|
||||
|
||||
$( '.nux-intro' ).show();
|
||||
|
||||
// Log Jump Start event in MC Stats
|
||||
new Image().src = data.jumpstartStatsURLS.dismiss;
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
// Activate all Jump-start modules
|
||||
$( '#jump-start' ).click(function () {
|
||||
var module, dataName, configURL, checkBox;
|
||||
|
||||
$( '.jumpstart-spinner' ).show().css( 'display', 'block' );
|
||||
$( '#jump-start' ).hide();
|
||||
$( '.dismiss-jumpstart' ).hide();
|
||||
|
||||
data.jumpStartActivate = 'jump-start-activate';
|
||||
data.action = 'jetpack_jumpstart_ajax';
|
||||
|
||||
$( '#jp-config-list' ).hide();
|
||||
|
||||
$.post( jetpackL10n.ajaxurl, data, function (response) {
|
||||
// If there's no response, option 'sharing-services' was not updated.
|
||||
if ( ! response ) {
|
||||
//console.log( 'Option "sharing-services" not updated. Either you already had sharing buttons enabled, or something is broken.' );
|
||||
}
|
||||
|
||||
module = data.jumpstartModules;
|
||||
|
||||
// Only target Jump Start modules
|
||||
_.each( module, function( mod ) {
|
||||
dataName = $( 'label[for="active-' + mod.module_slug + '"]' + '.plugin-action__label' );
|
||||
configURL = mod.configure_url;
|
||||
checkBox = $( 'input[id="active-' + mod.module_slug + '"]' );
|
||||
|
||||
$( '#toggle-' + mod.module_slug ).addClass( 'activated' );
|
||||
dataName.html( 'ACTIVE' );
|
||||
$( checkBox ).prop( 'checked', true );
|
||||
});
|
||||
|
||||
$( '.jumpstart-spinner, .jstart, #jumpstart-cta, .manage-cta-inactive' ).hide();
|
||||
$( '.jumpstart-message, .manage-cta-active' ).toggle();
|
||||
$( '#jump-start-area' ).delay( 5000 ).hide( 600 );
|
||||
|
||||
// Log Jump Start event in MC Stats
|
||||
new Image().src = data.jumpstartStatsURLS.jumpstarted;
|
||||
|
||||
$( '.nux-intro' ).show();
|
||||
|
||||
window.location.hash = 'refresh';
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
/*
|
||||
RESET EVERYTHING (for testing only)
|
||||
@todo remove
|
||||
*/
|
||||
|
||||
$( '#jump-start-deactivate' ).click(function () {
|
||||
$( '.jumpstart-spinner' ).show();
|
||||
|
||||
data.jumpStartDeactivate = 'jump-start-deactivate';
|
||||
data.action = 'jetpack_jumpstart_ajax';
|
||||
|
||||
$.post( jetpackL10n.ajaxurl, data, function ( response ) {
|
||||
//$('#jumpstart-cta').html(response);
|
||||
$( '#deactivate-success' ).html( response );
|
||||
$( '.jumpstart-spinner' ).hide();
|
||||
window.location.hash = '';
|
||||
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
Handles the module activation ajax actions
|
||||
*/
|
||||
function adminAJAX() {
|
||||
$( '.nux-in' ).on( 'keypress click', '.form-toggle', function( e ){
|
||||
if ( e.which !== 13 && e.type !== 'click' ) {
|
||||
return;
|
||||
}
|
||||
var thisElementId = e.target.id,
|
||||
thisLabel = $( 'label[for="' + thisElementId + '"]' + '.plugin-action__label'),
|
||||
index;
|
||||
|
||||
data.action = 'jetpack_admin_ajax';
|
||||
data.thisModuleSlug = thisElementId.replace( 'active-', '' );
|
||||
data.toggleModule = 'nux-toggle-module';
|
||||
|
||||
index = $( '#toggle-' + data.thisModuleSlug ).data( 'index' );
|
||||
|
||||
thisLabel.hide();
|
||||
$( '.module-spinner-' + data.thisModuleSlug ).show();
|
||||
|
||||
$.post( jetpackL10n.ajaxurl, data, function ( response ) {
|
||||
if ( 0 !== response ) {
|
||||
|
||||
// Log NUX Admin event in MC Stats
|
||||
if( true === response.activated ){
|
||||
new Image().src = data.nuxAdminStatsURLS.enabled+','+'enabled-'+data.thisModuleSlug;
|
||||
}else{
|
||||
new Image().src = data.nuxAdminStatsURLS.deactivated+','+'deactivated-'+data.thisModuleSlug;
|
||||
}
|
||||
|
||||
$( '.module-spinner-' + response.module ).hide();
|
||||
|
||||
// This is a hacky way around not showing the config link when activated.
|
||||
response.noConfig = _.indexOf( [ 'photon', 'enhanced-distribution' ], response.module );
|
||||
|
||||
// Preserves the modal index so it can be rendered properly after the data has changed
|
||||
response.index = index;
|
||||
|
||||
$( '#toggle-' + response.module ).replaceWith( wp.template( 'mod-nux' )( response ) );
|
||||
|
||||
// Refreshes the modal element data
|
||||
_.extend( _.findWhere( modules, { module: response.module } ), response );
|
||||
|
||||
// Manual element alteration for Manage, since it's not part of the template
|
||||
if ( 'manage' === data.thisModuleSlug ) {
|
||||
if ( response.activated ) {
|
||||
thisLabel.show().html( 'ACTIVE' );
|
||||
$( '#manage-row' ).addClass( 'activated' );
|
||||
} else {
|
||||
thisLabel.show().html( 'INACTIVE' );
|
||||
$( '#manage-row' ).removeClass( 'activated' );
|
||||
}
|
||||
|
||||
$( '.manage-cta-inactive' ).toggle();
|
||||
$( '.manage-cta-active' ).toggle();
|
||||
return;
|
||||
}
|
||||
|
||||
initModalEvents();
|
||||
window.location.hash = 'refresh';
|
||||
}
|
||||
|
||||
}, 'json' );
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
This function will refresh any data elements that we've
|
||||
changed via AJAX. Necessary when page is visited via back/forward
|
||||
browsing.
|
||||
*/
|
||||
function refreshData() {
|
||||
// Clean up
|
||||
$( '#nux-performance-security, #nux-traffic' ).empty();
|
||||
$( '#jump-start-area' ).hide();
|
||||
$( '.nux-intro' ).show();
|
||||
|
||||
data.action = 'jetpack_admin_ajax_refresh';
|
||||
data.refreshData = 'refresh';
|
||||
$.post( jetpackL10n.ajaxurl, data, function ( response ) {
|
||||
modules = _.values( response );
|
||||
loadModules( 'Performance-Security', 'mod-nux', '#nux-performance-security' );
|
||||
loadModules( 'Traffic', 'mod-nux', '#nux-traffic' );
|
||||
}, 'json' );
|
||||
}
|
||||
})( jQuery, jetpackL10n.modules, jetpackL10n.currentVersion, jetpackL10n );
|
143
plugins/jetpack/_inc/jquery.inview.js
Normal file
143
plugins/jetpack/_inc/jquery.inview.js
Normal file
|
@ -0,0 +1,143 @@
|
|||
/**
|
||||
* author Christopher Blum
|
||||
* - based on the idea of Remy Sharp, http://remysharp.com/2009/01/26/element-in-view-event-plugin/
|
||||
* - forked from http://github.com/zuk/jquery.inview/
|
||||
*/
|
||||
(function ($) {
|
||||
var inviewObjects = {}, viewportSize, viewportOffset,
|
||||
d = document, w = window, documentElement = d.documentElement, expando = $.expando;
|
||||
|
||||
$.event.special.inview = {
|
||||
add: function(data) {
|
||||
inviewObjects[data.guid + "-" + this[expando]] = { data: data, $element: $(this) };
|
||||
},
|
||||
|
||||
remove: function(data) {
|
||||
try { delete inviewObjects[data.guid + "-" + this[expando]]; } catch(e) {}
|
||||
}
|
||||
};
|
||||
|
||||
function getViewportSize() {
|
||||
var mode, domObject, size = { height: w.innerHeight, width: w.innerWidth };
|
||||
|
||||
// if this is correct then return it. iPad has compat Mode, so will
|
||||
// go into check clientHeight/clientWidth (which has the wrong value).
|
||||
if (!size.height) {
|
||||
mode = d.compatMode;
|
||||
if (mode || !$.support.boxModel) { // IE, Gecko
|
||||
domObject = mode === 'CSS1Compat' ?
|
||||
documentElement : // Standards
|
||||
d.body; // Quirks
|
||||
size = {
|
||||
height: domObject.clientHeight,
|
||||
width: domObject.clientWidth
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
function getViewportOffset() {
|
||||
return {
|
||||
top: w.pageYOffset || documentElement.scrollTop || d.body.scrollTop,
|
||||
left: w.pageXOffset || documentElement.scrollLeft || d.body.scrollLeft
|
||||
};
|
||||
}
|
||||
|
||||
function checkInView() {
|
||||
var $elements = $(), elementsLength, i = 0;
|
||||
|
||||
$.each(inviewObjects, function(i, inviewObject) {
|
||||
var selector = inviewObject.data.selector,
|
||||
$element = inviewObject.$element;
|
||||
$elements = $elements.add(selector ? $element.find(selector) : $element);
|
||||
});
|
||||
|
||||
elementsLength = $elements.length;
|
||||
if (elementsLength) {
|
||||
viewportSize = viewportSize || getViewportSize();
|
||||
viewportOffset = viewportOffset || getViewportOffset();
|
||||
|
||||
for (; i<elementsLength; i++) {
|
||||
// Ignore elements that are not in the DOM tree
|
||||
if (!$.contains(documentElement, $elements[i])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
var element = $elements[i],
|
||||
$element = $(element),
|
||||
elementSize = {},
|
||||
elementOffset = {},
|
||||
inView = $element.data('inview'),
|
||||
visiblePartX,
|
||||
visiblePartY,
|
||||
visiblePartsMerged;
|
||||
|
||||
// for the case where 'display:none' is used in place of 'visibility:hidden'
|
||||
// count and sum the above items to get and move closer to the correct values
|
||||
// IMPORTANT :: insert element into container empty
|
||||
if($element.css('display') == 'none')
|
||||
{
|
||||
var parentElement = $element.parent();
|
||||
|
||||
elementOffset.top = parentElement.offset().top;
|
||||
elementOffset.left = parentElement.offset().left;
|
||||
elementSize.height = parentElement.height();
|
||||
elementSize.width = parentElement.width();
|
||||
} else {
|
||||
elementSize = { height: $element.height(), width: $element.width() }
|
||||
elementOffset = $element.offset();
|
||||
}
|
||||
|
||||
// Don't ask me why because I haven't figured out yet:
|
||||
// viewportOffset and viewportSize are sometimes suddenly null in Firefox 5.
|
||||
// Even though it sounds weird:
|
||||
// It seems that the execution of this function is interferred by the onresize/onscroll event
|
||||
// where viewportOffset and viewportSize are unset
|
||||
if (!viewportOffset || !viewportSize) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (element.offsetWidth >= 0 && element.offsetHeight >= 0 && element.style.display != "none" &&
|
||||
elementOffset.top + elementSize.height > viewportOffset.top &&
|
||||
elementOffset.top < viewportOffset.top + viewportSize.height &&
|
||||
elementOffset.left + elementSize.width > viewportOffset.left &&
|
||||
elementOffset.left < viewportOffset.left + viewportSize.width) {
|
||||
visiblePartX = (viewportOffset.left > elementOffset.left ?
|
||||
'right' : (viewportOffset.left + viewportSize.width) < (elementOffset.left + elementSize.width) ?
|
||||
'left' : 'both');
|
||||
visiblePartY = (viewportOffset.top > elementOffset.top ?
|
||||
'bottom' : (viewportOffset.top + viewportSize.height) < (elementOffset.top + elementSize.height) ?
|
||||
'top' : 'both');
|
||||
visiblePartsMerged = visiblePartX + "-" + visiblePartY;
|
||||
if (!inView || inView !== visiblePartsMerged) {
|
||||
$element.data('inview', visiblePartsMerged).trigger('inview', [true, visiblePartX, visiblePartY]);
|
||||
}
|
||||
} else if (inView) {
|
||||
$element.data('inview', false).trigger('inview', [false]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$(w).bind("scroll resize", function() {
|
||||
viewportSize = viewportOffset = null;
|
||||
});
|
||||
|
||||
// IE < 9 scrolls to focused elements without firing the "scroll" event
|
||||
if (!documentElement.addEventListener && documentElement.attachEvent) {
|
||||
documentElement.attachEvent("onfocusin", function() {
|
||||
viewportOffset = null;
|
||||
});
|
||||
}
|
||||
|
||||
// Use setInterval in order to also make sure this captures elements within
|
||||
// "overflow:scroll" elements or elements that appeared in the dom tree due to
|
||||
// dom manipulation and reflow
|
||||
// old: $(window).scroll(checkInView);
|
||||
//
|
||||
// By the way, iOS (iPad, iPhone, ...) seems to not execute, or at least delays
|
||||
// intervals while the user scrolls. Therefore the inview event might fire a bit late there
|
||||
setInterval(checkInView, 250);
|
||||
})(jQuery);
|
285
plugins/jetpack/_inc/jquery.jetpack-resize.js
Normal file
285
plugins/jetpack/_inc/jquery.jetpack-resize.js
Normal file
|
@ -0,0 +1,285 @@
|
|||
/* global Jetpack */
|
||||
/**
|
||||
* Resizeable Iframes.
|
||||
*
|
||||
* Start listening to resize postMessage events for selected iframes:
|
||||
* $( selector ).Jetpack( 'resizeable' );
|
||||
* - OR -
|
||||
* Jetpack.resizeable( 'on', context );
|
||||
*
|
||||
* Resize selected iframes:
|
||||
* $( selector ).Jetpack( 'resizeable', 'resize', { width: 100, height: 200 } );
|
||||
* - OR -
|
||||
* Jetpack.resizeable( 'resize', { width: 100, height: 200 }, context );
|
||||
*
|
||||
* Stop listening to resize postMessage events for selected iframes:
|
||||
* $( selector ).Jetpack( 'resizeable', 'off' );
|
||||
* - OR -
|
||||
* Jetpack.resizeable( 'off', context );
|
||||
*
|
||||
* Stop listening to all resize postMessage events:
|
||||
* Jetpack.resizeable( 'off' );
|
||||
*/
|
||||
(function($) {
|
||||
var listening = false, // Are we listening for resize postMessage events
|
||||
sourceOrigins = [], // What origins are allowed to send resize postMessage events
|
||||
$sources = false, // What iframe elements are we tracking resize postMessage events from
|
||||
|
||||
URLtoOrigin, // Utility to convert URLs into origins
|
||||
setupListener, // Binds global resize postMessage event handler
|
||||
destroyListener, // Unbinds global resize postMessage event handler
|
||||
|
||||
methods; // Jetpack.resizeable methods
|
||||
|
||||
// Setup the Jetpack global
|
||||
if ( 'undefined' === typeof window.Jetpack ) {
|
||||
window.Jetpack = {
|
||||
/**
|
||||
* Handles the two different calling methods:
|
||||
* $( selector ).Jetpack( 'namespace', 'method', context ) // here, context is optional and is used to filter the collection
|
||||
* - vs. -
|
||||
* Jetpack.namespace( 'method', context ) // here context defines the collection
|
||||
*
|
||||
* @internal
|
||||
*
|
||||
* Call as: Jetpack.getTarget.call( this, context )
|
||||
*
|
||||
* @param string context: jQuery selector
|
||||
* @return jQuery|undefined object on which to perform operations or undefined when context cannot be determined
|
||||
*/
|
||||
getTarget: function( context ) {
|
||||
if ( this instanceof jQuery ) {
|
||||
return context ? this.filter( context ) : this;
|
||||
}
|
||||
|
||||
return context ? $( context ) : context;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// Setup the Jetpack jQuery method
|
||||
if ( 'undefined' === typeof $.fn.Jetpack ) {
|
||||
/**
|
||||
* Dispatches calls to the correct namespace
|
||||
*
|
||||
* @param string namespace
|
||||
* @param ...
|
||||
* @return mixed|jQuery (chainable)
|
||||
*/
|
||||
$.fn.Jetpack = function( namespace ) {
|
||||
if ( 'function' === typeof Jetpack[namespace] ) {
|
||||
// Send the call to the correct Jetpack.namespace
|
||||
return Jetpack[namespace].apply( this, Array.prototype.slice.call( arguments, 1 ) );
|
||||
} else {
|
||||
$.error( 'Namespace "' + namespace + '" does not exist on jQuery.Jetpack' );
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// Define Jetpack.resizeable() namespace to just always bail if no postMessage
|
||||
if ( 'function' !== typeof window.postMessage ) {
|
||||
$.extend( window.Jetpack, {
|
||||
/**
|
||||
* Defines the Jetpack.resizeable() namespace.
|
||||
* See below for non-trivial definition for browsers with postMessage.
|
||||
*/
|
||||
resizeable: function() {
|
||||
$.error( 'Browser does not support window.postMessage' );
|
||||
}
|
||||
} );
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Utility to convert URLs into origins
|
||||
*
|
||||
* http://example.com:port/path?query#fragment -> http://example.com:port
|
||||
*
|
||||
* @param string URL
|
||||
* @return string origin
|
||||
*/
|
||||
URLtoOrigin = function( URL ) {
|
||||
if ( ! URL.match( /^https?:\/\// ) ) {
|
||||
URL = document.location.href;
|
||||
}
|
||||
return URL.split( '/' ).slice( 0, 3 ).join( '/' );
|
||||
};
|
||||
|
||||
/**
|
||||
* Binds global resize postMessage event handler
|
||||
*/
|
||||
setupListener = function() {
|
||||
listening = true;
|
||||
|
||||
$( window ).on( 'message.JetpackResizeableIframe', function( e ) {
|
||||
var event = e.originalEvent,
|
||||
data;
|
||||
|
||||
// Ensure origin is allowed
|
||||
if ( -1 === $.inArray( event.origin, sourceOrigins ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Some browsers send structured data, some send JSON strings
|
||||
if ( 'object' === typeof event.data ) {
|
||||
data = event.data.data;
|
||||
} else {
|
||||
try {
|
||||
data = JSON.parse( event.data );
|
||||
} catch ( err ) {
|
||||
data = false;
|
||||
}
|
||||
}
|
||||
|
||||
if ( !data.data ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Un-nest
|
||||
data = data.data;
|
||||
|
||||
// Is it a resize event?
|
||||
if ( 'undefined' === typeof data.action || 'resize' !== data.action ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Find the correct iframe and resize it
|
||||
$sources.filter( function() {
|
||||
if ( 'undefined' !== typeof data.name ) {
|
||||
return this.name === data.name;
|
||||
} else {
|
||||
return event.source === this.contentWindow;
|
||||
}
|
||||
} ).first().Jetpack( 'resizeable', 'resize', data );
|
||||
} );
|
||||
};
|
||||
|
||||
/**
|
||||
* Unbinds global resize postMessage event handler
|
||||
*/
|
||||
destroyListener = function() {
|
||||
listening = false;
|
||||
$( window ).off( 'message.JetpackResizeableIframe' );
|
||||
|
||||
sourceOrigins = [];
|
||||
$( '.jetpack-resizeable' ).removeClass( 'jetpack-resizeable' );
|
||||
$sources = false;
|
||||
};
|
||||
|
||||
// Methods for Jetpack.resizeable() namespace
|
||||
methods = {
|
||||
/**
|
||||
* Start listening for resize postMessage events on the given iframes
|
||||
*
|
||||
* Call statically as: Jetpack.resizeable( 'on', context )
|
||||
* Call as: $( selector ).Jetpack( 'resizeable', 'on', context ) // context optional: used to filter the collectino
|
||||
*
|
||||
* @param string context jQuery selector.
|
||||
* @return jQuery (chainable)
|
||||
*/
|
||||
on: function( context ) {
|
||||
var target = Jetpack.getTarget.call( this, context );
|
||||
|
||||
if ( ! listening ) {
|
||||
setupListener();
|
||||
}
|
||||
|
||||
target.each( function() {
|
||||
sourceOrigins.push( URLtoOrigin( $( this ).attr( 'src' ) ) );
|
||||
} ).addClass( 'jetpack-resizeable' );
|
||||
|
||||
$sources = $( '.jetpack-resizeable' );
|
||||
|
||||
return target;
|
||||
},
|
||||
|
||||
/**
|
||||
* Stop listening for resize postMessage events on the given iframes
|
||||
*
|
||||
* Call statically as: Jetpack.resizeable( 'off', context )
|
||||
* Call as: $( selector ).Jetpack( 'resizeable', 'off', context ) // context optional: used to filter the collectino
|
||||
*
|
||||
* @param string context jQuery selector
|
||||
* @return jQuery (chainable)
|
||||
*/
|
||||
off: function( context ) {
|
||||
var target = Jetpack.getTarget.call( this, context );
|
||||
|
||||
if ( 'undefined' === typeof target ) {
|
||||
destroyListener();
|
||||
|
||||
return target;
|
||||
}
|
||||
|
||||
target.each( function() {
|
||||
var origin = URLtoOrigin( $( this ).attr( 'src' ) ),
|
||||
pos = $.inArray( origin, sourceOrigins );
|
||||
|
||||
if ( -1 !== pos ) {
|
||||
sourceOrigins.splice( pos, 1 );
|
||||
}
|
||||
} ).removeClass( 'jetpack-resizeable' );
|
||||
|
||||
$sources = $( '.jetpack-resizeable' );
|
||||
|
||||
return target;
|
||||
},
|
||||
|
||||
/**
|
||||
* Resize the given iframes
|
||||
*
|
||||
* Call statically as: Jetpack.resizeable( 'resize', dimensions, context )
|
||||
* Call as: $( selector ).Jetpack( 'resizeable', 'resize', dimensions, context ) // context optional: used to filter the collectino
|
||||
*
|
||||
* @param object dimensions in pixels: { width: (int), height: (int) }
|
||||
* @param string context jQuery selector
|
||||
* @return jQuery (chainable)
|
||||
*/
|
||||
resize: function( dimensions, context ) {
|
||||
var target = Jetpack.getTarget.call( this, context );
|
||||
|
||||
$.each( [ 'width', 'height' ], function( i, variable ) {
|
||||
var value = 0,
|
||||
container;
|
||||
if ( 'undefined' !== typeof dimensions[variable] ) {
|
||||
value = parseInt( dimensions[variable], 10 );
|
||||
}
|
||||
|
||||
if ( 0 !== value ) {
|
||||
target[variable]( value );
|
||||
container = target.parent();
|
||||
if ( container.hasClass( 'slim-likes-widget' ) ) {
|
||||
container[variable]( value );
|
||||
}
|
||||
}
|
||||
} );
|
||||
|
||||
return target;
|
||||
}
|
||||
};
|
||||
|
||||
// Define Jetpack.resizeable() namespace
|
||||
$.extend( window.Jetpack, {
|
||||
/**
|
||||
* Defines the Jetpack.resizeable() namespace.
|
||||
* See above for trivial definition for browsers with no postMessage.
|
||||
*
|
||||
* @param string method
|
||||
* @param ...
|
||||
* @return mixed|jQuery (chainable)
|
||||
*/
|
||||
resizeable: function( method ) {
|
||||
if ( methods[method] ) {
|
||||
// Send the call to the correct Jetpack.resizeable() method
|
||||
return methods[method].apply( this, Array.prototype.slice.call( arguments, 1 ) );
|
||||
} else if ( ! method ) {
|
||||
// By default, send to Jetpack.resizeable( 'on' ), which isn't useful in that form but is when called as
|
||||
// jQuery( selector ).Jetpack( 'resizeable' )
|
||||
return methods.on.apply( this );
|
||||
} else {
|
||||
$.error( 'Method ' + method + ' does not exist on Jetpack.resizeable' );
|
||||
}
|
||||
}
|
||||
} );
|
||||
})(jQuery);
|
68
plugins/jetpack/_inc/jquery.jetpack-sync.js
Normal file
68
plugins/jetpack/_inc/jquery.jetpack-sync.js
Normal file
|
@ -0,0 +1,68 @@
|
|||
/* global ajaxurl */
|
||||
jQuery( document ).ready( function($) {
|
||||
var update = function( cooldown ) {
|
||||
var self = $( '.jetpack_sync_reindex_control' ),
|
||||
data;
|
||||
|
||||
self
|
||||
.find( '.jetpack_sync_reindex_control_action' )
|
||||
.attr( 'disabled', true );
|
||||
|
||||
self
|
||||
.find( '.jetpack_sync_reindex_control_status' )
|
||||
.html( '…' );
|
||||
|
||||
if ( 'DONE' === self.data( 'status' ) ) {
|
||||
data = { action:'jetpack-sync-reindex-trigger' };
|
||||
} else {
|
||||
data = { action:'jetpack-sync-reindex-status' };
|
||||
}
|
||||
|
||||
$.getJSON(
|
||||
ajaxurl,
|
||||
data,
|
||||
function( response ) {
|
||||
var self = $( '.jetpack_sync_reindex_control' ),
|
||||
strings,
|
||||
status;
|
||||
|
||||
if ( 0 === self.length ) {
|
||||
return;
|
||||
}
|
||||
|
||||
strings = self.data( 'strings' );
|
||||
status = strings[response.status].status;
|
||||
|
||||
if ( 'INDEXING' === response.status ) {
|
||||
status += ' (' + Math.floor( 100 * response.posts.imported / response.posts.total ) + '%)';
|
||||
}
|
||||
|
||||
self
|
||||
.data( 'status', response.status );
|
||||
|
||||
self
|
||||
.find( '.jetpack_sync_reindex_control_action' )
|
||||
.val( strings[response.status].action );
|
||||
|
||||
self
|
||||
.find( '.jetpack_sync_reindex_control_status' )
|
||||
.text( status );
|
||||
|
||||
setTimeout( function() {
|
||||
$( '.jetpack_sync_reindex_control' )
|
||||
.find( '.jetpack_sync_reindex_control_action' )
|
||||
.attr( 'disabled', false );
|
||||
}, cooldown );
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
$( '.jetpack_sync_reindex_control' )
|
||||
.find( '.jetpack_sync_reindex_control_action' )
|
||||
.live( 'click', function( event ) {
|
||||
event.preventDefault();
|
||||
update( 5000 );
|
||||
} );
|
||||
|
||||
update( 1000 );
|
||||
} );
|
104
plugins/jetpack/_inc/jquery.spin.js
Normal file
104
plugins/jetpack/_inc/jquery.spin.js
Normal file
|
@ -0,0 +1,104 @@
|
|||
/**
|
||||
* Copyright (c) 2011-2013 Felix Gnass
|
||||
* Licensed under the MIT license
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
Basic Usage:
|
||||
============
|
||||
|
||||
$('#el').spin(); // Creates a default Spinner using the text color of #el.
|
||||
$('#el').spin({ ... }); // Creates a Spinner using the provided options.
|
||||
|
||||
$('#el').spin(false); // Stops and removes the spinner.
|
||||
|
||||
Using Presets:
|
||||
==============
|
||||
|
||||
$('#el').spin('small'); // Creates a 'small' Spinner using the text color of #el.
|
||||
$('#el').spin('large', '#fff'); // Creates a 'large' white Spinner.
|
||||
|
||||
Adding a custom preset:
|
||||
=======================
|
||||
|
||||
$.fn.spin.presets.flower = {
|
||||
lines: 9
|
||||
length: 10
|
||||
width: 20
|
||||
radius: 0
|
||||
}
|
||||
|
||||
$('#el').spin('flower', 'red');
|
||||
|
||||
*/
|
||||
|
||||
(function(factory) {
|
||||
|
||||
if (typeof exports == 'object') {
|
||||
// CommonJS
|
||||
factory(require('jquery'), require('spin'))
|
||||
}
|
||||
else if (typeof define == 'function' && define.amd) {
|
||||
// AMD, register as anonymous module
|
||||
define(['jquery', 'spin'], factory)
|
||||
}
|
||||
else {
|
||||
// Browser globals
|
||||
if (!window.Spinner) throw new Error('Spin.js not present')
|
||||
factory(window.jQuery, window.Spinner)
|
||||
}
|
||||
|
||||
}(function($, Spinner) {
|
||||
|
||||
$.fn.spin = function(opts, color) {
|
||||
|
||||
return this.each(function() {
|
||||
var $this = $(this),
|
||||
data = $this.data();
|
||||
|
||||
if (data.spinner) {
|
||||
data.spinner.stop();
|
||||
delete data.spinner;
|
||||
}
|
||||
if (opts !== false) {
|
||||
opts = $.extend(
|
||||
{ color: color || $this.css('color') },
|
||||
$.fn.spin.presets[opts] || opts
|
||||
)
|
||||
// Begin WordPress Additions
|
||||
// To use opts.right, you need to have specified a length, width, and radius.
|
||||
if ( typeof opts.right !== 'undefined' && typeof opts.length !== 'undefined'
|
||||
&& typeof opts.width !== 'undefined' && typeof opts.radius !== 'undefined' ) {
|
||||
var pad = $this.css( 'padding-left' );
|
||||
pad = ( typeof pad === 'undefined' ) ? 0 : parseInt( pad, 10 );
|
||||
opts.left = $this.outerWidth() - ( 2 * ( opts.length + opts.width + opts.radius ) ) - pad - opts.right;
|
||||
delete opts.right;
|
||||
}
|
||||
// End WordPress Additions
|
||||
data.spinner = new Spinner(opts).spin(this)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
$.fn.spin.presets = {
|
||||
tiny: { lines: 8, length: 2, width: 2, radius: 3 },
|
||||
small: { lines: 8, length: 4, width: 3, radius: 5 },
|
||||
large: { lines: 10, length: 8, width: 4, radius: 8 }
|
||||
}
|
||||
|
||||
}));
|
||||
|
||||
// Jetpack Presets Overrides:
|
||||
(function($){
|
||||
$.fn.spin.presets.wp = { trail: 60, speed: 1.3 };
|
||||
$.fn.spin.presets.small = $.extend( { lines: 8, length: 2, width: 2, radius: 3 }, $.fn.spin.presets.wp );
|
||||
$.fn.spin.presets.medium = $.extend( { lines: 8, length: 4, width: 3, radius: 5 }, $.fn.spin.presets.wp );
|
||||
$.fn.spin.presets.large = $.extend( { lines: 10, length: 6, width: 4, radius: 7 }, $.fn.spin.presets.wp );
|
||||
$.fn.spin.presets['small-left'] = $.extend( { left: 5 }, $.fn.spin.presets.small );
|
||||
$.fn.spin.presets['small-right'] = $.extend( { right: 5 }, $.fn.spin.presets.small );
|
||||
$.fn.spin.presets['medium-left'] = $.extend( { left: 5 }, $.fn.spin.presets.medium );
|
||||
$.fn.spin.presets['medium-right'] = $.extend( { right: 5 }, $.fn.spin.presets.medium );
|
||||
$.fn.spin.presets['large-left'] = $.extend( { left: 5 }, $.fn.spin.presets.large );
|
||||
$.fn.spin.presets['large-right'] = $.extend( { right: 5 }, $.fn.spin.presets.large );
|
||||
})(jQuery);
|
|
@ -0,0 +1,109 @@
|
|||
<?php
|
||||
|
||||
// Shared logic between Jetpack admin pages
|
||||
abstract class Jetpack_Admin_Page {
|
||||
// Add page specific actions given the page hook
|
||||
abstract function add_page_actions( $hook );
|
||||
|
||||
// Create a menu item for the page and returns the hook
|
||||
abstract function get_page_hook();
|
||||
|
||||
// Enqueue and localize page specific scripts
|
||||
abstract function page_admin_scripts();
|
||||
|
||||
// Render page specific HTML
|
||||
abstract function page_render();
|
||||
|
||||
function __construct() {
|
||||
$this->jetpack = Jetpack::init();
|
||||
}
|
||||
|
||||
function add_actions() {
|
||||
/**
|
||||
* Don't add in the modules page unless modules are available!
|
||||
*/
|
||||
if ( $this->dont_show_if_not_active && ! Jetpack::is_active() && ! Jetpack::is_development_mode() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Initialize menu item for the page in the admin
|
||||
$hook = $this->get_page_hook();
|
||||
|
||||
// Attach hooks common to all Jetpack admin pages based on the created
|
||||
// hook
|
||||
add_action( "load-$hook", array( $this, 'admin_help' ) );
|
||||
add_action( "load-$hook", array( $this, 'admin_page_load' ) );
|
||||
add_action( "admin_head-$hook", array( $this, 'admin_head' ) );
|
||||
|
||||
add_action( "admin_footer-$hook", array( $this, 'module_modal_js_template' ) );
|
||||
|
||||
add_action( "admin_print_styles-$hook", array( $this, 'admin_styles' ) );
|
||||
add_action( "admin_print_scripts-$hook", array( $this, 'admin_scripts' ) );
|
||||
|
||||
// Attach page specific actions in addition to the above
|
||||
$this->add_page_actions( $hook );
|
||||
}
|
||||
|
||||
function admin_head() {
|
||||
if ( isset( $_GET['configure'] ) && Jetpack::is_module( $_GET['configure'] ) && current_user_can( 'manage_options' ) ) {
|
||||
/**
|
||||
* Fires in the <head> of a particular Jetpack configuation page.
|
||||
*
|
||||
* The dynamic portion of the hook name, `$_GET['configure']`,
|
||||
* refers to the slug of module, such as 'stats', 'sso', etc.
|
||||
* A complete hook for the latter would be
|
||||
* 'jetpack_module_configuation_head_sso'.
|
||||
*
|
||||
* @since 3.0.0
|
||||
*/
|
||||
do_action( 'jetpack_module_configuration_head_' . $_GET['configure'] );
|
||||
}
|
||||
}
|
||||
|
||||
// Render the page with a common top and bottom part, and page specific
|
||||
// content
|
||||
function render() {
|
||||
$this->admin_page_top();
|
||||
$this->page_render();
|
||||
$this->admin_page_bottom();
|
||||
}
|
||||
|
||||
function admin_help() {
|
||||
$this->jetpack->admin_help();
|
||||
}
|
||||
|
||||
function admin_page_load() {
|
||||
// This is big. For the moment, just call the existing one.
|
||||
$this->jetpack->admin_page_load();
|
||||
}
|
||||
|
||||
// Load underscore template for the landing page and settings page modal
|
||||
function module_modal_js_template() {
|
||||
Jetpack::init()->load_view( 'admin/module-modal-template.php' );
|
||||
}
|
||||
|
||||
function admin_page_top() {
|
||||
include_once( JETPACK__PLUGIN_DIR . '_inc/header.php' );
|
||||
}
|
||||
|
||||
function admin_page_bottom() {
|
||||
include_once( JETPACK__PLUGIN_DIR . '_inc/footer.php' );
|
||||
}
|
||||
|
||||
// Add page specific scripts and jetpack stats for all menu pages
|
||||
function admin_scripts() {
|
||||
$this->page_admin_scripts(); // Delegate to inheriting class
|
||||
add_action( 'admin_footer', array( $this->jetpack, 'do_stats' ) );
|
||||
}
|
||||
|
||||
// Enqueue the Jetpack admin stylesheet
|
||||
function admin_styles() {
|
||||
$min = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
|
||||
|
||||
wp_enqueue_style( 'jetpack-google-fonts', '//fonts.googleapis.com/css?family=Open+Sans:400italic,400,700,600,800' );
|
||||
|
||||
wp_enqueue_style( 'jetpack-admin', plugins_url( "css/jetpack-admin{$min}.css", JETPACK__PLUGIN_FILE ), array( 'genericons' ), JETPACK__VERSION . '-20121016' );
|
||||
wp_style_add_data( 'jetpack-admin', 'rtl', 'replace' );
|
||||
wp_style_add_data( 'jetpack-admin', 'suffix', $min );
|
||||
}
|
||||
}
|
|
@ -0,0 +1,299 @@
|
|||
<?php
|
||||
include_once( 'class.jetpack-admin-page.php' );
|
||||
|
||||
// Builds the landing page and its menu
|
||||
class Jetpack_Landing_Page extends Jetpack_Admin_Page {
|
||||
protected $dont_show_if_not_active = false;
|
||||
|
||||
function get_page_hook() {
|
||||
$title = _x( 'Jetpack', 'The menu item label', 'jetpack' );
|
||||
|
||||
list( $jetpack_version ) = explode( ':', Jetpack_Options::get_option( 'version' ) );
|
||||
if (
|
||||
$jetpack_version
|
||||
&&
|
||||
$jetpack_version != JETPACK__VERSION
|
||||
&&
|
||||
( $new_modules = Jetpack::get_default_modules( $jetpack_version, JETPACK__VERSION ) )
|
||||
&&
|
||||
is_array( $new_modules )
|
||||
&&
|
||||
( $new_modules_count = count( $new_modules ) )
|
||||
&&
|
||||
( Jetpack::is_active() || Jetpack::is_development_mode() )
|
||||
) {
|
||||
$new_count_i18n = number_format_i18n( $new_modules_count );
|
||||
$span_title = esc_attr( sprintf( _n( 'One New Jetpack Module', '%s New Jetpack Modules', $new_modules_count, 'jetpack' ), $new_count_i18n ) );
|
||||
$format = _x( 'Jetpack %s', 'The menu item label with a new module count as %s', 'jetpack' );
|
||||
$update_markup = "<span class='update-plugins count-{$new_modules_count}' title='$span_title'><span class='update-count'>$new_count_i18n</span></span>";
|
||||
$title = sprintf( $format, $update_markup );
|
||||
}
|
||||
|
||||
// Add the main admin Jetpack menu with possible information about new
|
||||
// modules
|
||||
add_menu_page( 'Jetpack', $title, 'jetpack_admin_page', 'jetpack', array( $this, 'render' ), 'div' );
|
||||
// also create the submenu
|
||||
return add_submenu_page( 'jetpack', $title, $title, 'jetpack_admin_page', 'jetpack' );
|
||||
}
|
||||
|
||||
function add_page_actions( $hook ) {
|
||||
// Add landing page specific underscore templates
|
||||
/**
|
||||
* Filters the js_templates callback value
|
||||
*
|
||||
* @since 3.6.0
|
||||
*
|
||||
* @param array array( $this, 'js_templates' ) js_templates callback.
|
||||
* @param string $hook Specific admin page.
|
||||
*/
|
||||
add_action( "admin_footer-$hook", apply_filters( 'jetpack_landing_page_js_templates_callback', array( $this, 'js_templates' ), $hook ) );
|
||||
/** This action is documented in class.jetpack.php */
|
||||
do_action( 'jetpack_admin_menu', $hook );
|
||||
|
||||
// Place the Jetpack menu item on top and others in the order they
|
||||
// appear
|
||||
add_filter( 'custom_menu_order', '__return_true' );
|
||||
add_filter( 'menu_order', array( $this, 'jetpack_menu_order' ) );
|
||||
|
||||
add_action( 'jetpack_notices_update_settings', array( $this, 'show_notices_update_settings' ), 10, 1 );
|
||||
}
|
||||
|
||||
/*
|
||||
* Build an array of a specific module tag.
|
||||
*
|
||||
* @param string Name of the module tag
|
||||
* @return array The module slug, config url, and name of each Jump Start module
|
||||
*/
|
||||
function jumpstart_module_tag( $tag ) {
|
||||
$modules = Jetpack_Admin::init()->get_modules();
|
||||
|
||||
$module_info = array();
|
||||
foreach ( $modules as $module => $value ) {
|
||||
if ( in_array( $tag, $value['feature'] ) ) {
|
||||
$module_info[] = array(
|
||||
'module_slug' => $value['module'],
|
||||
'module_name' => $value['name'],
|
||||
'configure_url' => $value['configure_url'],
|
||||
);
|
||||
}
|
||||
}
|
||||
return $module_info;
|
||||
}
|
||||
|
||||
/*
|
||||
* Only show Jump Start on first activation.
|
||||
* Any option 'jumpstart' other than 'new connection' will hide it.
|
||||
*
|
||||
* The option can be of 4 things, and will be stored as such:
|
||||
* new_connection : Brand new connection - Show
|
||||
* jumpstart_activated : Jump Start has been activated - dismiss
|
||||
* jetpack_action_taken: Manual activation of a module already happened - dismiss
|
||||
* jumpstart_dismissed : Manual dismissal of Jump Start - dismiss
|
||||
*
|
||||
* @return bool | show or hide
|
||||
*/
|
||||
function jetpack_show_jumpstart() {
|
||||
$jumpstart_option = Jetpack_Options::get_option( 'jumpstart' );
|
||||
|
||||
$hide_options = array(
|
||||
'jumpstart_activated',
|
||||
'jetpack_action_taken',
|
||||
'jumpstart_dismissed'
|
||||
);
|
||||
|
||||
if ( ! $jumpstart_option || in_array( $jumpstart_option, $hide_options ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* List of recommended modules for the Jump Start paragraph text.
|
||||
* Will only show up in the paragraph if they are not active.
|
||||
*
|
||||
* @return string | comma-separated recommended modules that are not active
|
||||
*/
|
||||
function jumpstart_list_modules() {
|
||||
$jumpstart_recommended = $this->jumpstart_module_tag( 'Jumpstart' );
|
||||
|
||||
$module_name = array();
|
||||
foreach ( $jumpstart_recommended as $module => $val ) {
|
||||
if ( ! Jetpack::is_module_active( $val['module_slug'] ) ) {
|
||||
$module_name[] = $val['module_name'];
|
||||
}
|
||||
}
|
||||
|
||||
return $module_name;
|
||||
}
|
||||
|
||||
function jetpack_menu_order( $menu_order ) {
|
||||
$jp_menu_order = array();
|
||||
|
||||
foreach ( $menu_order as $index => $item ) {
|
||||
if ( $item != 'jetpack' )
|
||||
$jp_menu_order[] = $item;
|
||||
|
||||
if ( $index == 0 )
|
||||
$jp_menu_order[] = 'jetpack';
|
||||
}
|
||||
|
||||
return $jp_menu_order;
|
||||
}
|
||||
|
||||
function js_templates() {
|
||||
Jetpack::init()->load_view( 'admin/landing-page-templates.php' );
|
||||
}
|
||||
|
||||
function page_render() {
|
||||
// Handle redirects to configuration pages
|
||||
if ( ! empty( $_GET['configure'] ) ) {
|
||||
return $this->render_nojs_configurable();
|
||||
}
|
||||
|
||||
global $current_user;
|
||||
|
||||
$is_connected = Jetpack::is_active();
|
||||
$user_token = Jetpack_Data::get_access_token( $current_user->ID );
|
||||
$is_user_connected = $user_token && ! is_wp_error( $user_token );
|
||||
$is_master_user = $current_user->ID == Jetpack_Options::get_option( 'master_user' );
|
||||
|
||||
if ( Jetpack::is_development_mode() ) {
|
||||
$is_connected = true;
|
||||
$is_user_connected = true;
|
||||
$is_master_user = false;
|
||||
}
|
||||
|
||||
// Set template data for the admin page template
|
||||
$data = array(
|
||||
'is_connected' => $is_connected,
|
||||
'is_user_connected' => $is_user_connected,
|
||||
'is_master_user' => $is_master_user,
|
||||
'show_jumpstart' => $this->jetpack_show_jumpstart(),
|
||||
'jumpstart_list' => $this->jumpstart_list_modules(),
|
||||
'recommended_list' => $this->jumpstart_module_tag( 'Recommended' ),
|
||||
);
|
||||
Jetpack::init()->load_view( 'admin/admin-page.php', $data );
|
||||
}
|
||||
|
||||
/**
|
||||
* Shows a notice message to users after they save Module config settings
|
||||
* @param string $module_id
|
||||
* @return null
|
||||
*/
|
||||
function show_notices_update_settings( $module_id ) {
|
||||
$state = Jetpack::state( 'message' );
|
||||
|
||||
switch( $state ) {
|
||||
case 'module_activated' :
|
||||
if ( $module = Jetpack::get_module( Jetpack::state( 'module' ) ) ) {
|
||||
$message = sprintf( __( '<strong>%s Activated!</strong> You can change the setting of it here.', 'jetpack' ), $module['name'] );
|
||||
}
|
||||
break;
|
||||
case 'module_configured':
|
||||
$message = __( '<strong>Module settings were saved.</strong> ', 'jetpack' );
|
||||
break;
|
||||
case 'no_message' :
|
||||
break;
|
||||
}
|
||||
|
||||
if ( isset( $message ) ) {
|
||||
?>
|
||||
<div id="message" class="jetpack-message">
|
||||
<div class="squeezer">
|
||||
<h2><?php echo wp_kses( $message, array( 'strong' => array(), 'a' => array( 'href' => true ), 'br' => true ) ); ?></h2>
|
||||
<?php
|
||||
/**
|
||||
* Fires within the displayed message when a feature configuation is updated.
|
||||
*
|
||||
* This is a dynamic hook with `$module_id` being the slug of the module being updated.
|
||||
*
|
||||
* @since 3.4.0
|
||||
*/
|
||||
do_action( 'jetpack_notices_update_settings_' . $module_id ); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
add_action( 'jetpack_notices', array( Jetpack::init(), 'admin_notices' ) );
|
||||
}
|
||||
|
||||
// Render the configuration page for the module if it exists and an error
|
||||
// screen if the module is not configurable
|
||||
function render_nojs_configurable() {
|
||||
echo '<div class="clouds-sm"></div>';
|
||||
echo '<div class="wrap configure-module">';
|
||||
|
||||
$module_name = preg_replace( '/[^\da-z\-]+/', '', $_GET['configure'] );
|
||||
if ( Jetpack::is_module( $module_name ) && current_user_can( 'jetpack_configure_modules' ) ) {
|
||||
Jetpack::admin_screen_configure_module( $module_name );
|
||||
} else {
|
||||
echo '<h2>' . esc_html__( 'Error, bad module.', 'jetpack' ) . '</h2>';
|
||||
}
|
||||
|
||||
echo '</div><!-- /wrap -->';
|
||||
}
|
||||
|
||||
/*
|
||||
* Build an array of Jump Start stats urls.
|
||||
* requires the build URL args passed as an array
|
||||
*
|
||||
* @param array $jumpstart_stats
|
||||
* @return (array) of built stats urls
|
||||
*/
|
||||
function build_jumpstart_stats_urls( $jumpstart_stats ) {
|
||||
$jumpstart_urls = array();
|
||||
|
||||
foreach ( $jumpstart_stats as $value) {
|
||||
$jumpstart_urls[$value] = Jetpack::build_stats_url( array( 'x_jetpack-jumpstart' => $value ) );
|
||||
}
|
||||
|
||||
return $jumpstart_urls;
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Build an array of NUX admin stats urls.
|
||||
* requires the build URL args passed as an array
|
||||
*
|
||||
* @param array $nux_admin_stats
|
||||
* @return (array) of built stats urls
|
||||
*/
|
||||
function build_nux_admin_stats_urls( $nux_admin_stats ) {
|
||||
$nux_admin_urls = array();
|
||||
|
||||
foreach ( $nux_admin_stats as $value) {
|
||||
$nux_admin_urls[ $value ] = Jetpack::build_stats_url( array( 'x_jetpack-nux' => $value ) );
|
||||
}
|
||||
|
||||
return $nux_admin_urls;
|
||||
|
||||
}
|
||||
|
||||
function page_admin_scripts() {
|
||||
// Enqueue jp.js and localize it
|
||||
wp_enqueue_script( 'jetpack-js', plugins_url( '_inc/jp.js', JETPACK__PLUGIN_FILE ),
|
||||
array( 'jquery', 'wp-util' ), JETPACK__VERSION . '-20121111' );
|
||||
wp_localize_script(
|
||||
'jetpack-js',
|
||||
'jetpackL10n',
|
||||
array(
|
||||
'ays_disconnect' => __( "This will deactivate all Jetpack modules.\nAre you sure you want to disconnect?", 'jetpack' ),
|
||||
'ays_unlink' => __( "This will prevent user-specific modules such as Publicize, Notifications and Post By Email from working.\nAre you sure you want to unlink?", 'jetpack' ),
|
||||
'ays_dismiss' => __( "This will deactivate Jetpack.\nAre you sure you want to deactivate Jetpack?", 'jetpack' ),
|
||||
'view_all_features' => __( 'View all Jetpack features', 'jetpack' ),
|
||||
'no_modules_found' => sprintf( __( 'Sorry, no modules were found for the search term "%s"', 'jetpack' ), '{term}' ),
|
||||
'modules' => Jetpack::get_translated_modules( array_values( Jetpack_Admin::init()->get_modules() ) ),
|
||||
'currentVersion' => JETPACK__VERSION,
|
||||
'ajaxurl' => admin_url( 'admin-ajax.php' ),
|
||||
'jumpstart_modules' => $this->jumpstart_module_tag( 'Jumpstart' ),
|
||||
'show_jumpstart' => $this->jetpack_show_jumpstart(),
|
||||
'activate_nonce' => wp_create_nonce( 'jetpack-jumpstart-nonce' ),
|
||||
'admin_nonce' => wp_create_nonce( 'jetpack-admin-nonce' ),
|
||||
'jumpstart_stats_urls' => $this->build_jumpstart_stats_urls( array( 'dismiss', 'jumpstarted', 'learnmore', 'viewed', 'manual' ) ),
|
||||
'admin_stats_urls' => $this->build_nux_admin_stats_urls( array( 'enabled', 'deactivated', 'learnmore' ) ),
|
||||
'site_url_manage' => Jetpack::build_raw_urls( get_site_url() ),
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,187 @@
|
|||
<?php
|
||||
include_once( 'class.jetpack-admin-page.php' );
|
||||
include_once( JETPACK__PLUGIN_DIR . 'class.jetpack-modules-list-table.php' );
|
||||
|
||||
// Builds the My Jetpack page
|
||||
class Jetpack_My_Jetpack_Page extends Jetpack_Admin_Page {
|
||||
// Show the settings page only when Jetpack is connected or in dev mode
|
||||
protected $dont_show_if_not_active = true;
|
||||
function add_page_actions( $hook ) {} // There are no page specific actions to attach to the menu
|
||||
|
||||
// Adds the My Jetpack page, but hides it from the submenu
|
||||
function get_page_hook() {
|
||||
return add_submenu_page( null, __( 'My Jetpack', 'jetpack' ), __( 'My Jetpack', 'jetpack' ), 'jetpack_connect_user', 'my_jetpack', array( $this, 'render' ) );
|
||||
}
|
||||
|
||||
// Renders the view file
|
||||
function page_render() {
|
||||
Jetpack::init()->load_view( 'admin/my-jetpack-page.php' );
|
||||
|
||||
//My Jetpack view tracking, send to MC Stats
|
||||
Jetpack::init()->stat( 'admin', 'my-jetpack' );
|
||||
Jetpack::init()->do_stats( 'server_side' );
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Handle the change in master user
|
||||
*/
|
||||
function jetpack_my_jetpack_change_user() {
|
||||
if ( ! isset( $_POST['_my_jetpack_nonce'] ) || ! wp_verify_nonce( $_POST['_my_jetpack_nonce'], 'jetpack_change_primary_user' ) ) {
|
||||
wp_die( __( 'Failed permissions, please try again.', 'jetpack' ) );
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( isset( $_POST['jetpack-new-master'] ) ) {
|
||||
$old_master_user = Jetpack_Options::get_option( 'master_user' );
|
||||
$new_master_user = $_POST['jetpack-new-master'];
|
||||
$user_token = Jetpack_Data::get_access_token( $new_master_user );
|
||||
$is_user_connected = $user_token && ! is_wp_error( $user_token );
|
||||
if ( current_user_can( 'manage_options' ) && $is_user_connected ) {
|
||||
Jetpack::log( 'switch_master_user', array( 'old_master' => $old_master_user, 'new_master' => $new_master_user ) );
|
||||
Jetpack_Options::update_option( 'master_user', $new_master_user );
|
||||
Jetpack::state( 'message', 'switch_master' );
|
||||
|
||||
//My Jetpack primary user successfully changed, send to MC Stats
|
||||
Jetpack::init()->stat( 'admin', 'change-primary-successful' );
|
||||
Jetpack::init()->do_stats( 'server_side' );
|
||||
|
||||
// Change the blog owner dotcom side
|
||||
$this->wpcom_switch_blog_owner( $new_master_user );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Tell wpcom that the master user has switched
|
||||
* so we can update the 'wpcom_blog_owner'
|
||||
*/
|
||||
function wpcom_switch_blog_owner( $new_master ) {
|
||||
$request = array(
|
||||
'new_blog_owner' => $new_master
|
||||
);
|
||||
|
||||
// Tell wpcom about the change
|
||||
Jetpack::load_xml_rpc_client();
|
||||
$xml = new Jetpack_IXR_Client( array(
|
||||
'user_id' => get_current_user_id(),
|
||||
) );
|
||||
|
||||
$xml->query( 'jetpack.switchBlogOwner', $request );
|
||||
}
|
||||
|
||||
/*
|
||||
* Checks to see if there are any other users available to become primary
|
||||
* Users must both:
|
||||
* - Be linked to wpcom
|
||||
* - Be an admin
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function jetpack_are_other_users_linked_and_admin() {
|
||||
// If only one admin
|
||||
$all_users = count_users();
|
||||
if ( 2 > $all_users['avail_roles']['administrator'] ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$users = get_users();
|
||||
$available = array();
|
||||
// If no one else is linked to dotcom
|
||||
foreach ( $users as $user ) {
|
||||
if ( isset( $user->caps['administrator'] ) && Jetpack::is_user_connected( $user->ID ) ) {
|
||||
$available[] = $user->ID;
|
||||
}
|
||||
}
|
||||
|
||||
if ( 2 > count( $available ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* All the data we'll need about the Master User
|
||||
* for the My Jetpack page template
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function jetpack_master_user_data() {
|
||||
// If the master user has disappeared, none of this is useful.
|
||||
// @todo throw up a warning and offer a solution
|
||||
$master = Jetpack_Options::get_option( 'master_user' );
|
||||
if ( ! get_user_by( 'id', $master ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$master_user = get_userdata( $master );
|
||||
$master_user_data_com = Jetpack::get_connected_user_data( $master_user->ID );
|
||||
$gravatar = sprintf( '<a href="%s">%s</a>', get_edit_user_link( $master_user->ID ), get_avatar( $master_user->ID, 40 ) );
|
||||
|
||||
$master_user_data = array(
|
||||
'masterUser' => $master_user,
|
||||
'masterDataCom' => $master_user_data_com,
|
||||
'gravatar' => $gravatar,
|
||||
);
|
||||
|
||||
return $master_user_data;
|
||||
}
|
||||
|
||||
/*
|
||||
* All the data we'll need about the Current User
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function jetpack_current_user_data() {
|
||||
global $current_user;
|
||||
$is_master_user = $current_user->ID == Jetpack_Options::get_option( 'master_user' );
|
||||
$dotcom_data = Jetpack::get_connected_user_data();
|
||||
|
||||
$current_user_data = array(
|
||||
'isUserConnected' => Jetpack::is_user_connected( $current_user->ID ),
|
||||
'isMasterUser' => $is_master_user,
|
||||
'adminUsername' => $current_user->user_login,
|
||||
'userComData' => $dotcom_data,
|
||||
'gravatar' => sprintf( '<a href="%s">%s</a>', get_edit_user_link( $current_user->ID ), get_avatar( $current_user->ID, 40 ) ),
|
||||
);
|
||||
|
||||
return $current_user_data;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Build an array of My Jetpack stats urls.
|
||||
* requires the build URL args passed as an array
|
||||
*
|
||||
* @param array $my_jetpack_stats
|
||||
* @return (array) of built stats urls
|
||||
*/
|
||||
function build_my_jetpack_stats_urls( $my_jetpack_stats ) {
|
||||
$my_jetpack_urls = array();
|
||||
|
||||
foreach ( $my_jetpack_stats as $value ) {
|
||||
$my_jetpack_urls[ $value ] = Jetpack::build_stats_url( array( 'x_jetpack-admin' => $value ) );
|
||||
}
|
||||
|
||||
return $my_jetpack_urls;
|
||||
|
||||
}
|
||||
|
||||
// Load up admin scripts
|
||||
function page_admin_scripts() {
|
||||
wp_enqueue_script( 'jp-connection-js', plugins_url( '_inc/jp-my-jetpack.js', JETPACK__PLUGIN_FILE ), array( 'jquery', 'wp-util' ), JETPACK__VERSION . 'yep' );
|
||||
|
||||
wp_localize_script( 'jp-connection-js', 'jpConnection',
|
||||
array(
|
||||
'jetpackIsActive' => Jetpack::is_active(),
|
||||
'isAdmin' => current_user_can( 'jetpack_manage_modules' ),
|
||||
'otherAdminsLinked' => $this->jetpack_are_other_users_linked_and_admin(),
|
||||
'masterUser' => $this->jetpack_master_user_data(),
|
||||
'currentUser' => $this->jetpack_current_user_data(),
|
||||
'my_jetpack_stats_urls' => $this->build_my_jetpack_stats_urls( array( 'change_primary', 'disconnect_site', 'confirm_disconnect', 'support_no_disconnect', 'cancel_disconnect' ) ),
|
||||
'alertText' => __( 'You must link another admin account before switching primary account holders.', 'jetpack' ),
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,87 @@
|
|||
<?php
|
||||
include_once( 'class.jetpack-admin-page.php' );
|
||||
include_once( JETPACK__PLUGIN_DIR . 'class.jetpack-modules-list-table.php' );
|
||||
|
||||
// Builds the settings page and its menu
|
||||
class Jetpack_Settings_Page extends Jetpack_Admin_Page {
|
||||
// Show the settings page only when Jetpack is connected or in dev mode
|
||||
protected $dont_show_if_not_active = true;
|
||||
function add_page_actions( $hook ) {} // There are no page specific actions to attach to the menu
|
||||
|
||||
// Adds the Settings sub menu
|
||||
function get_page_hook() {
|
||||
return add_submenu_page( 'jetpack', __( 'Jetpack Settings', 'jetpack' ), __( 'Settings', 'jetpack' ), 'jetpack_manage_modules', 'jetpack_modules', array( $this, 'render' ) );
|
||||
}
|
||||
|
||||
// Renders the module list table where you can use bulk action or row
|
||||
// actions to activate/deactivate and configure modules
|
||||
function page_render() {
|
||||
$list_table = new Jetpack_Modules_List_Table;
|
||||
?>
|
||||
<div class="clouds-sm"></div>
|
||||
<?php /** This action is already documented in views/admin/admin-page.php */
|
||||
do_action( 'jetpack_notices' ) ?>
|
||||
<div class="page-content configure">
|
||||
<div class="frame top hide-if-no-js">
|
||||
<div class="wrap">
|
||||
<div class="manage-left">
|
||||
<table class="table table-bordered fixed-top">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="check-column"><input type="checkbox" class="checkall"></th>
|
||||
<th colspan="2">
|
||||
<?php $list_table->unprotected_display_tablenav( 'top' ); ?>
|
||||
<span class="filter-search">
|
||||
<button type="button" class="button">Filter</button>
|
||||
</span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div><!-- /.wrap -->
|
||||
</div><!-- /.frame -->
|
||||
<div class="frame bottom">
|
||||
<div class="wrap">
|
||||
<div class="manage-right">
|
||||
<div class="bumper">
|
||||
<form class="navbar-form" role="search">
|
||||
<input type="hidden" name="page" value="jetpack_modules" />
|
||||
<?php $list_table->search_box( __( 'Search', 'jetpack' ), 'srch-term' ); ?>
|
||||
<p><?php esc_html_e( 'View:', 'jetpack' ); ?></p>
|
||||
<div class="button-group filter-active">
|
||||
<button type="button" class="button <?php if ( empty( $_GET['activated'] ) ) echo 'active'; ?>"><?php esc_html_e( 'All', 'jetpack' ); ?></button>
|
||||
<button type="button" class="button <?php if ( ! empty( $_GET['activated'] ) && 'true' == $_GET['activated'] ) echo 'active'; ?>" data-filter-by="activated" data-filter-value="true"><?php esc_html_e( 'Active', 'jetpack' ); ?></button>
|
||||
<button type="button" class="button <?php if ( ! empty( $_GET['activated'] ) && 'false' == $_GET['activated'] ) echo 'active'; ?>" data-filter-by="activated" data-filter-value="false"><?php esc_html_e( 'Inactive', 'jetpack' ); ?></button>
|
||||
</div>
|
||||
<p><?php esc_html_e( 'Sort by:', 'jetpack' ); ?></p>
|
||||
<div class="button-group sort">
|
||||
<button type="button" class="button <?php if ( empty( $_GET['sort_by'] ) ) echo 'active'; ?>" data-sort-by="name"><?php esc_html_e( 'Alphabetical', 'jetpack' ); ?></button>
|
||||
<button type="button" class="button <?php if ( ! empty( $_GET['sort_by'] ) && 'introduced' == $_GET['sort_by'] ) echo 'active'; ?>" data-sort-by="introduced" data-sort-order="reverse"><?php esc_html_e( 'Newest', 'jetpack' ); ?></button>
|
||||
<button type="button" class="button <?php if ( ! empty( $_GET['sort_by'] ) && 'sort' == $_GET['sort_by'] ) echo 'active'; ?>" data-sort-by="sort"><?php esc_html_e( 'Popular', 'jetpack' ); ?></button>
|
||||
</div>
|
||||
<p><?php esc_html_e( 'Show:', 'jetpack' ); ?></p>
|
||||
<?php $list_table->views(); ?>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="manage-left">
|
||||
<form class="jetpack-modules-list-table-form" onsubmit="return false;">
|
||||
<table class="<?php echo implode( ' ', $list_table->get_table_classes() ); ?>">
|
||||
<tbody id="the-list">
|
||||
<?php $list_table->display_rows_or_placeholder(); ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</div><!-- /.wrap -->
|
||||
</div><!-- /.frame -->
|
||||
</div><!-- /.content -->
|
||||
<?php
|
||||
}
|
||||
|
||||
// Javascript logic specific to the list table
|
||||
function page_admin_scripts() {
|
||||
wp_enqueue_script( 'jetpack-admin-js', plugins_url( '_inc/jetpack-admin.js', JETPACK__PLUGIN_FILE ), array( 'jquery' ), JETPACK__VERSION . '-20121111' );
|
||||
}
|
||||
}
|
755
plugins/jetpack/_inc/lib/class.color.php
Normal file
755
plugins/jetpack/_inc/lib/class.color.php
Normal file
|
@ -0,0 +1,755 @@
|
|||
<?php
|
||||
/**
|
||||
* Color utility and conversion
|
||||
*
|
||||
* Represents a color value, and converts between RGB/HSV/XYZ/Lab/HSL
|
||||
*
|
||||
* Example:
|
||||
* $color = new Jetpack_Color(0xFFFFFF);
|
||||
*
|
||||
* @author Harold Asbridge <hasbridge@gmail.com>
|
||||
* @author Matt Wiebe <wiebe@automattic.com>
|
||||
* @license http://www.opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
class Jetpack_Color {
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
protected $color = 0;
|
||||
|
||||
/**
|
||||
* Initialize object
|
||||
*
|
||||
* @param string|array $color A color of the type $type
|
||||
* @param string $type The type of color we will construct from.
|
||||
* One of hex (default), rgb, hsl, int
|
||||
*/
|
||||
public function __construct( $color = null, $type = 'hex' ) {
|
||||
if ( $color ) {
|
||||
switch ( $type ) {
|
||||
case 'hex':
|
||||
$this->fromHex( $color );
|
||||
break;
|
||||
case 'rgb':
|
||||
if ( is_array( $color ) && count( $color ) == 3 ) {
|
||||
list( $r, $g, $b ) = array_values( $color );
|
||||
$this->fromRgbInt( $r, $g, $b );
|
||||
}
|
||||
break;
|
||||
case 'hsl':
|
||||
if ( is_array( $color ) && count( $color ) == 3 ) {
|
||||
list( $h, $s, $l ) = array_values( $color );
|
||||
$this->fromHsl( $h, $s, $l );
|
||||
}
|
||||
break;
|
||||
case 'int':
|
||||
$this->fromInt( $color );
|
||||
break;
|
||||
default:
|
||||
// there is no default.
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Init color from hex value
|
||||
*
|
||||
* @param string $hexValue
|
||||
*
|
||||
* @return Jetpack_Color
|
||||
*/
|
||||
public function fromHex($hexValue) {
|
||||
$hexValue = str_replace( '#', '', $hexValue );
|
||||
// handle short hex codes like #fff
|
||||
if ( 3 === strlen( $hexValue ) ) {
|
||||
$short = $hexValue;
|
||||
$i = 0;
|
||||
$hexValue = '';
|
||||
while ( $i < 3 ) {
|
||||
$chunk = substr($short, $i, 1 );
|
||||
$hexValue .= $chunk . $chunk;
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
$intValue = hexdec( $hexValue );
|
||||
|
||||
if ( $intValue < 0 || $intValue > 16777215 ) {
|
||||
throw new RangeException( $hexValue . " out of valid color code range" );
|
||||
}
|
||||
|
||||
$this->color = $intValue;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Init color from integer RGB values
|
||||
*
|
||||
* @param int $red
|
||||
* @param int $green
|
||||
* @param int $blue
|
||||
*
|
||||
* @return Jetpack_Color
|
||||
*/
|
||||
public function fromRgbInt($red, $green, $blue)
|
||||
{
|
||||
if ( $red < 0 || $red > 255 )
|
||||
throw new RangeException( "Red value " . $red . " out of valid color code range" );
|
||||
|
||||
if ( $green < 0 || $green > 255 )
|
||||
throw new RangeException( "Green value " . $green . " out of valid color code range" );
|
||||
|
||||
if ( $blue < 0 || $blue > 255 )
|
||||
throw new RangeException( "Blue value " . $blue . " out of valid color code range" );
|
||||
|
||||
$this->color = (int)(($red << 16) + ($green << 8) + $blue);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Init color from hex RGB values
|
||||
*
|
||||
* @param string $red
|
||||
* @param string $green
|
||||
* @param string $blue
|
||||
*
|
||||
* @return Jetpack_Color
|
||||
*/
|
||||
public function fromRgbHex($red, $green, $blue)
|
||||
{
|
||||
return $this->fromRgbInt(hexdec($red), hexdec($green), hexdec($blue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts an HSL color value to RGB. Conversion formula
|
||||
* adapted from http://en.wikipedia.org/wiki/HSL_color_space.
|
||||
* @param int $h Hue. [0-360]
|
||||
* @param in $s Saturation [0, 100]
|
||||
* @param int $l Lightness [0, 100]
|
||||
*/
|
||||
public function fromHsl( $h, $s, $l ) {
|
||||
$h /= 360; $s /= 100; $l /= 100;
|
||||
|
||||
if ( $s == 0 ) {
|
||||
$r = $g = $b = $l; // achromatic
|
||||
}
|
||||
else {
|
||||
$q = $l < 0.5 ? $l * ( 1 + $s ) : $l + $s - $l * $s;
|
||||
$p = 2 * $l - $q;
|
||||
$r = $this->hue2rgb( $p, $q, $h + 1/3 );
|
||||
$g = $this->hue2rgb( $p, $q, $h );
|
||||
$b = $this->hue2rgb( $p, $q, $h - 1/3 );
|
||||
}
|
||||
|
||||
return $this->fromRgbInt( $r * 255, $g * 255, $b * 255 );
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function for Jetpack_Color::fromHsl()
|
||||
*/
|
||||
private function hue2rgb( $p, $q, $t ) {
|
||||
if ( $t < 0 ) $t += 1;
|
||||
if ( $t > 1 ) $t -= 1;
|
||||
if ( $t < 1/6 ) return $p + ( $q - $p ) * 6 * $t;
|
||||
if ( $t < 1/2 ) return $q;
|
||||
if ( $t < 2/3 ) return $p + ( $q - $p ) * ( 2/3 - $t ) * 6;
|
||||
return $p;
|
||||
}
|
||||
|
||||
/**
|
||||
* Init color from integer value
|
||||
*
|
||||
* @param int $intValue
|
||||
*
|
||||
* @return Jetpack_Color
|
||||
*/
|
||||
public function fromInt($intValue)
|
||||
{
|
||||
if ( $intValue < 0 || $intValue > 16777215 )
|
||||
throw new RangeException( $intValue . " out of valid color code range" );
|
||||
|
||||
$this->color = $intValue;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert color to hex
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function toHex()
|
||||
{
|
||||
return str_pad(dechex($this->color), 6, '0', STR_PAD_LEFT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert color to RGB array (integer values)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function toRgbInt()
|
||||
{
|
||||
return array(
|
||||
'red' => (int)(255 & ($this->color >> 16)),
|
||||
'green' => (int)(255 & ($this->color >> 8)),
|
||||
'blue' => (int)(255 & ($this->color))
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert color to RGB array (hex values)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function toRgbHex()
|
||||
{
|
||||
$r = array();
|
||||
foreach ($this->toRgbInt() as $item) {
|
||||
$r[] = dechex($item);
|
||||
}
|
||||
return $r;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Hue/Saturation/Value for the current color
|
||||
* (float values, slow but accurate)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function toHsvFloat()
|
||||
{
|
||||
$rgb = $this->toRgbInt();
|
||||
|
||||
$rgbMin = min($rgb);
|
||||
$rgbMax = max($rgb);
|
||||
|
||||
$hsv = array(
|
||||
'hue' => 0,
|
||||
'sat' => 0,
|
||||
'val' => $rgbMax
|
||||
);
|
||||
|
||||
// If v is 0, color is black
|
||||
if ($hsv['val'] == 0) {
|
||||
return $hsv;
|
||||
}
|
||||
|
||||
// Normalize RGB values to 1
|
||||
$rgb['red'] /= $hsv['val'];
|
||||
$rgb['green'] /= $hsv['val'];
|
||||
$rgb['blue'] /= $hsv['val'];
|
||||
$rgbMin = min($rgb);
|
||||
$rgbMax = max($rgb);
|
||||
|
||||
// Calculate saturation
|
||||
$hsv['sat'] = $rgbMax - $rgbMin;
|
||||
if ($hsv['sat'] == 0) {
|
||||
$hsv['hue'] = 0;
|
||||
return $hsv;
|
||||
}
|
||||
|
||||
// Normalize saturation to 1
|
||||
$rgb['red'] = ($rgb['red'] - $rgbMin) / ($rgbMax - $rgbMin);
|
||||
$rgb['green'] = ($rgb['green'] - $rgbMin) / ($rgbMax - $rgbMin);
|
||||
$rgb['blue'] = ($rgb['blue'] - $rgbMin) / ($rgbMax - $rgbMin);
|
||||
$rgbMin = min($rgb);
|
||||
$rgbMax = max($rgb);
|
||||
|
||||
// Calculate hue
|
||||
if ($rgbMax == $rgb['red']) {
|
||||
$hsv['hue'] = 0.0 + 60 * ($rgb['green'] - $rgb['blue']);
|
||||
if ($hsv['hue'] < 0) {
|
||||
$hsv['hue'] += 360;
|
||||
}
|
||||
} else if ($rgbMax == $rgb['green']) {
|
||||
$hsv['hue'] = 120 + (60 * ($rgb['blue'] - $rgb['red']));
|
||||
} else {
|
||||
$hsv['hue'] = 240 + (60 * ($rgb['red'] - $rgb['green']));
|
||||
}
|
||||
|
||||
return $hsv;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get HSV values for color
|
||||
* (integer values from 0-255, fast but less accurate)
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function toHsvInt()
|
||||
{
|
||||
$rgb = $this->toRgbInt();
|
||||
|
||||
$rgbMin = min($rgb);
|
||||
$rgbMax = max($rgb);
|
||||
|
||||
$hsv = array(
|
||||
'hue' => 0,
|
||||
'sat' => 0,
|
||||
'val' => $rgbMax
|
||||
);
|
||||
|
||||
// If value is 0, color is black
|
||||
if ($hsv['val'] == 0) {
|
||||
return $hsv;
|
||||
}
|
||||
|
||||
// Calculate saturation
|
||||
$hsv['sat'] = round(255 * ($rgbMax - $rgbMin) / $hsv['val']);
|
||||
if ($hsv['sat'] == 0) {
|
||||
$hsv['hue'] = 0;
|
||||
return $hsv;
|
||||
}
|
||||
|
||||
// Calculate hue
|
||||
if ($rgbMax == $rgb['red']) {
|
||||
$hsv['hue'] = round(0 + 43 * ($rgb['green'] - $rgb['blue']) / ($rgbMax - $rgbMin));
|
||||
} else if ($rgbMax == $rgb['green']) {
|
||||
$hsv['hue'] = round(85 + 43 * ($rgb['blue'] - $rgb['red']) / ($rgbMax - $rgbMin));
|
||||
} else {
|
||||
$hsv['hue'] = round(171 + 43 * ($rgb['red'] - $rgb['green']) / ($rgbMax - $rgbMin));
|
||||
}
|
||||
if ($hsv['hue'] < 0) {
|
||||
$hsv['hue'] += 255;
|
||||
}
|
||||
|
||||
return $hsv;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts an RGB color value to HSL. Conversion formula
|
||||
* adapted from http://en.wikipedia.org/wiki/HSL_color_space.
|
||||
* Assumes r, g, and b are contained in the set [0, 255] and
|
||||
* returns h in [0, 360], s in [0, 100], l in [0, 100]
|
||||
*
|
||||
* @return Array The HSL representation
|
||||
*/
|
||||
public function toHsl() {
|
||||
list( $r, $g, $b ) = array_values( $this->toRgbInt() );
|
||||
$r /= 255; $g /= 255; $b /= 255;
|
||||
$max = max( $r, $g, $b );
|
||||
$min = min( $r, $g, $b );
|
||||
$h = $s = $l = ( $max + $min ) / 2;
|
||||
#var_dump( array( compact('max', 'min', 'r', 'g', 'b')) );
|
||||
if ( $max == $min ) {
|
||||
$h = $s = 0; // achromatic
|
||||
}
|
||||
else {
|
||||
$d = $max - $min;
|
||||
$s = $l > 0.5 ? $d / ( 2 - $max - $min ) : $d / ( $max + $min );
|
||||
switch ( $max ) {
|
||||
case $r:
|
||||
$h = ( $g - $b ) / $d + ( $g < $b ? 6 : 0 );
|
||||
break;
|
||||
case $g:
|
||||
$h = ( $b - $r ) / $d + 2;
|
||||
break;
|
||||
case $b:
|
||||
$h = ( $r - $g ) / $d + 4;
|
||||
break;
|
||||
}
|
||||
$h /= 6;
|
||||
}
|
||||
$h = (int) round( $h * 360 );
|
||||
$s = (int) round( $s * 100 );
|
||||
$l = (int) round( $l * 100 );
|
||||
return compact( 'h', 's', 'l' );
|
||||
}
|
||||
|
||||
public function toCSS( $type = 'hex', $alpha = 1 ) {
|
||||
switch ( $type ) {
|
||||
case 'hex':
|
||||
return $this->toString();
|
||||
break;
|
||||
case 'rgb':
|
||||
case 'rgba':
|
||||
list( $r, $g, $b ) = array_values( $this->toRgbInt() );
|
||||
if ( is_numeric( $alpha ) && $alpha < 1 ) {
|
||||
return "rgba( {$r}, {$g}, {$b}, $alpha )";
|
||||
}
|
||||
else {
|
||||
return "rgb( {$r}, {$g}, {$b} )";
|
||||
}
|
||||
break;
|
||||
case 'hsl':
|
||||
case 'hsla':
|
||||
list( $h, $s, $l ) = array_values( $this->toHsl() );
|
||||
if ( is_numeric( $alpha ) && $alpha < 1 ) {
|
||||
return "hsla( {$h}, {$s}, {$l}, $alpha )";
|
||||
}
|
||||
else {
|
||||
return "hsl( {$h}, {$s}, {$l} )";
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return $this->toString();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get current color in XYZ format
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function toXyz()
|
||||
{
|
||||
$rgb = $this->toRgbInt();
|
||||
|
||||
// Normalize RGB values to 1
|
||||
|
||||
$rgb_new = array();
|
||||
foreach ($rgb as $item) {
|
||||
$rgb_new[] = $item / 255;
|
||||
}
|
||||
$rgb = $rgb_new;
|
||||
|
||||
$rgb_new = array();
|
||||
foreach ($rgb as $item) {
|
||||
if ($item > 0.04045) {
|
||||
$item = pow((($item + 0.055) / 1.055), 2.4);
|
||||
} else {
|
||||
$item = $item / 12.92;
|
||||
}
|
||||
$rgb_new[] = $item * 100;
|
||||
}
|
||||
$rgb = $rgb_new;
|
||||
|
||||
// Observer. = 2°, Illuminant = D65
|
||||
$xyz = array(
|
||||
'x' => ($rgb['red'] * 0.4124) + ($rgb['green'] * 0.3576) + ($rgb['blue'] * 0.1805),
|
||||
'y' => ($rgb['red'] * 0.2126) + ($rgb['green'] * 0.7152) + ($rgb['blue'] * 0.0722),
|
||||
'z' => ($rgb['red'] * 0.0193) + ($rgb['green'] * 0.1192) + ($rgb['blue'] * 0.9505)
|
||||
);
|
||||
|
||||
return $xyz;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get color CIE-Lab values
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function toLabCie()
|
||||
{
|
||||
$xyz = $this->toXyz();
|
||||
|
||||
//Ovserver = 2*, Iluminant=D65
|
||||
$xyz['x'] /= 95.047;
|
||||
$xyz['y'] /= 100;
|
||||
$xyz['z'] /= 108.883;
|
||||
|
||||
$xyz_new = array();
|
||||
foreach ($xyz as $item) {
|
||||
if ($item > 0.008856) {
|
||||
$xyz_new[] = pow($item, 1/3);
|
||||
} else {
|
||||
$xyz_new[] = (7.787 * $item) + (16 / 116);
|
||||
}
|
||||
}
|
||||
$xyz = $xyz_new;
|
||||
|
||||
$lab = array(
|
||||
'l' => (116 * $xyz['y']) - 16,
|
||||
'a' => 500 * ($xyz['x'] - $xyz['y']),
|
||||
'b' => 200 * ($xyz['y'] - $xyz['z'])
|
||||
);
|
||||
|
||||
return $lab;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert color to integer
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function toInt()
|
||||
{
|
||||
return $this->color;
|
||||
}
|
||||
|
||||
/**
|
||||
* Alias of toString()
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return $this->toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get color as string
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function toString()
|
||||
{
|
||||
$str = $this->toHex();
|
||||
return strtoupper("#{$str}");
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the distance between this color and the given color
|
||||
*
|
||||
* @param Jetpack_Color $color
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getDistanceRgbFrom(Jetpack_Color $color)
|
||||
{
|
||||
$rgb1 = $this->toRgbInt();
|
||||
$rgb2 = $color->toRgbInt();
|
||||
|
||||
$rDiff = abs($rgb1['red'] - $rgb2['red']);
|
||||
$gDiff = abs($rgb1['green'] - $rgb2['green']);
|
||||
$bDiff = abs($rgb1['blue'] - $rgb2['blue']);
|
||||
|
||||
// Sum of RGB differences
|
||||
$diff = $rDiff + $gDiff + $bDiff;
|
||||
return $diff;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get distance from the given color using the Delta E method
|
||||
*
|
||||
* @param Jetpack_Color $color
|
||||
*
|
||||
* @return float
|
||||
*/
|
||||
public function getDistanceLabFrom(Jetpack_Color $color)
|
||||
{
|
||||
$lab1 = $this->toLabCie();
|
||||
$lab2 = $color->toLabCie();
|
||||
|
||||
$lDiff = abs($lab2['l'] - $lab1['l']);
|
||||
$aDiff = abs($lab2['a'] - $lab1['a']);
|
||||
$bDiff = abs($lab2['b'] - $lab1['b']);
|
||||
|
||||
$delta = sqrt($lDiff + $aDiff + $bDiff);
|
||||
|
||||
return $delta;
|
||||
}
|
||||
|
||||
public function toLuminosity() {
|
||||
$lum = array();
|
||||
foreach( $this->toRgbInt() as $slot => $value ) {
|
||||
$chan = $value / 255;
|
||||
$lum[ $slot ] = ( $chan <= 0.03928 ) ? $chan / 12.92 : pow( ( ( $chan + 0.055 ) / 1.055 ), 2.4 );
|
||||
}
|
||||
return 0.2126 * $lum['red'] + 0.7152 * $lum['green'] + 0.0722 * $lum['blue'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get distance between colors using luminance.
|
||||
* Should be more than 5 for readable contrast
|
||||
*
|
||||
* @param Jetpack_Color $color Another color
|
||||
* @return float
|
||||
*/
|
||||
public function getDistanceLuminosityFrom( Jetpack_Color $color ) {
|
||||
$L1 = $this->toLuminosity();
|
||||
$L2 = $color->toLuminosity();
|
||||
if ( $L1 > $L2 ) {
|
||||
return ( $L1 + 0.05 ) / ( $L2 + 0.05 );
|
||||
}
|
||||
else{
|
||||
return ( $L2 + 0.05 ) / ( $L1 + 0.05 );
|
||||
}
|
||||
}
|
||||
|
||||
public function getMaxContrastColor() {
|
||||
$withBlack = $this->getDistanceLuminosityFrom( new Jetpack_Color( '#000') );
|
||||
$withWhite = $this->getDistanceLuminosityFrom( new Jetpack_Color( '#fff') );
|
||||
$color = new Jetpack_Color;
|
||||
$hex = ( $withBlack >= $withWhite ) ? '#000000' : '#ffffff';
|
||||
return $color->fromHex( $hex );
|
||||
}
|
||||
|
||||
public function getGrayscaleContrastingColor( $contrast = false ) {
|
||||
if ( ! $contrast ) {
|
||||
return $this->getMaxContrastColor();
|
||||
}
|
||||
// don't allow less than 5
|
||||
$target_contrast = ( $contrast < 5 ) ? 5 : $contrast;
|
||||
$color = $this->getMaxContrastColor();
|
||||
$contrast = $color->getDistanceLuminosityFrom( $this );
|
||||
|
||||
// if current max contrast is less than the target contrast, we had wishful thinking.
|
||||
if ( $contrast <= $target_contrast ) {
|
||||
return $color;
|
||||
}
|
||||
|
||||
$incr = ( '#000000' === $color->toString() ) ? 1 : -1;
|
||||
while ( $contrast > $target_contrast ) {
|
||||
$color = $color->incrementLightness( $incr );
|
||||
$contrast = $color->getDistanceLuminosityFrom( $this );
|
||||
}
|
||||
|
||||
return $color;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a readable contrasting color. $this is assumed to be the text and $color the background color.
|
||||
* @param object $bg_color A Color object that will be compared against $this
|
||||
* @param integer $min_contrast The minimum contrast to achieve, if possible.
|
||||
* @return object A Color object, an increased contrast $this compared against $bg_color
|
||||
*/
|
||||
public function getReadableContrastingColor( $bg_color = false, $min_contrast = 5 ) {
|
||||
if ( ! $bg_color || ! is_a( $bg_color, 'Jetpack_Color' ) ) {
|
||||
return $this;
|
||||
}
|
||||
// you shouldn't use less than 5, but you might want to.
|
||||
$target_contrast = $min_contrast;
|
||||
// working things
|
||||
$contrast = $bg_color->getDistanceLuminosityFrom( $this );
|
||||
$max_contrast_color = $bg_color->getMaxContrastColor();
|
||||
$max_contrast = $max_contrast_color->getDistanceLuminosityFrom( $bg_color );
|
||||
|
||||
// if current max contrast is less than the target contrast, we had wishful thinking.
|
||||
// still, go max
|
||||
if ( $max_contrast <= $target_contrast ) {
|
||||
return $max_contrast_color;
|
||||
}
|
||||
// or, we might already have sufficient contrast
|
||||
if ( $contrast >= $target_contrast ) {
|
||||
return $this;
|
||||
}
|
||||
|
||||
$incr = ( 0 === $max_contrast_color->toInt() ) ? -1 : 1;
|
||||
while ( $contrast < $target_contrast ) {
|
||||
$this->incrementLightness( $incr );
|
||||
$contrast = $bg_color->getDistanceLuminosityFrom( $this );
|
||||
// infininite loop prevention: you never know.
|
||||
if ( $this->color === 0 || $this->color === 16777215 ) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Detect if color is grayscale
|
||||
*
|
||||
* @param int @threshold
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isGrayscale($threshold = 16)
|
||||
{
|
||||
$rgb = $this->toRgbInt();
|
||||
|
||||
// Get min and max rgb values, then difference between them
|
||||
$rgbMin = min($rgb);
|
||||
$rgbMax = max($rgb);
|
||||
$diff = $rgbMax - $rgbMin;
|
||||
|
||||
return $diff < $threshold;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the closest matching color from the given array of colors
|
||||
*
|
||||
* @param array $colors array of integers or Jetpack_Color objects
|
||||
*
|
||||
* @return mixed the array key of the matched color
|
||||
*/
|
||||
public function getClosestMatch(array $colors)
|
||||
{
|
||||
$matchDist = 10000;
|
||||
$matchKey = null;
|
||||
foreach($colors as $key => $color) {
|
||||
if (false === ($color instanceof Jetpack_Color)) {
|
||||
$c = new Jetpack_Color($color);
|
||||
}
|
||||
$dist = $this->getDistanceLabFrom($c);
|
||||
if ($dist < $matchDist) {
|
||||
$matchDist = $dist;
|
||||
$matchKey = $key;
|
||||
}
|
||||
}
|
||||
|
||||
return $matchKey;
|
||||
}
|
||||
|
||||
/* TRANSFORMS */
|
||||
|
||||
public function darken( $amount = 5 ) {
|
||||
return $this->incrementLightness( - $amount );
|
||||
}
|
||||
|
||||
public function lighten( $amount = 5 ) {
|
||||
return $this->incrementLightness( $amount );
|
||||
}
|
||||
|
||||
public function incrementLightness( $amount ) {
|
||||
$hsl = $this->toHsl();
|
||||
extract( $hsl );
|
||||
$l += $amount;
|
||||
if ( $l < 0 ) $l = 0;
|
||||
if ( $l > 100 ) $l = 100;
|
||||
return $this->fromHsl( $h, $s, $l );
|
||||
}
|
||||
|
||||
public function saturate( $amount = 15 ) {
|
||||
return $this->incrementSaturation( $amount );
|
||||
}
|
||||
|
||||
public function desaturate( $amount = 15 ) {
|
||||
return $this->incrementSaturation( - $amount );
|
||||
}
|
||||
|
||||
public function incrementSaturation( $amount ) {
|
||||
$hsl = $this->toHsl();
|
||||
extract( $hsl );
|
||||
$s += $amount;
|
||||
if ( $s < 0 ) $s = 0;
|
||||
if ( $s > 100 ) $s = 100;
|
||||
return $this->fromHsl( $h, $s, $l );
|
||||
}
|
||||
|
||||
public function toGrayscale() {
|
||||
$hsl = $this->toHsl();
|
||||
extract( $hsl );
|
||||
$s = 0;
|
||||
return $this->fromHsl( $h, $s, $l );
|
||||
}
|
||||
|
||||
public function getComplement() {
|
||||
return $this->incrementHue( 180 );
|
||||
}
|
||||
|
||||
public function getSplitComplement( $step = 1 ) {
|
||||
$incr = 180 + ( $step * 30 );
|
||||
return $this->incrementHue( $incr );
|
||||
}
|
||||
|
||||
public function getAnalog( $step = 1 ) {
|
||||
$incr = $step * 30;
|
||||
return $this->incrementHue( $incr );
|
||||
}
|
||||
|
||||
public function getTetrad( $step = 1 ) {
|
||||
$incr = $step * 60;
|
||||
return $this->incrementHue( $incr );
|
||||
}
|
||||
|
||||
public function getTriad( $step = 1 ) {
|
||||
$incr = $step * 120;
|
||||
return $this->incrementHue( $incr );
|
||||
}
|
||||
|
||||
public function incrementHue( $amount ) {
|
||||
$hsl = $this->toHsl();
|
||||
extract( $hsl );
|
||||
$h = ( $h + $amount ) % 360;
|
||||
if ( $h < 0 ) $h = 360 - $h;
|
||||
return $this->fromHsl( $h, $s, $l );
|
||||
}
|
||||
|
||||
} // class Jetpack_Color
|
436
plugins/jetpack/_inc/lib/class.media-extractor.php
Normal file
436
plugins/jetpack/_inc/lib/class.media-extractor.php
Normal file
|
@ -0,0 +1,436 @@
|
|||
<?php
|
||||
/**
|
||||
* Class with methods to extract metadata from a post/page about videos, images, links, mentions embedded
|
||||
* in or attached to the post/page.
|
||||
*
|
||||
* @todo Additionally, have some filters on number of items in each field
|
||||
*/
|
||||
class Jetpack_Media_Meta_Extractor {
|
||||
|
||||
// Some consts for what to extract
|
||||
const ALL = 255;
|
||||
const LINKS = 1;
|
||||
const MENTIONS = 2;
|
||||
const IMAGES = 4;
|
||||
const SHORTCODES = 8; // Only the keeper shortcodes below
|
||||
const EMBEDS = 16;
|
||||
const HASHTAGS = 32;
|
||||
|
||||
// For these, we try to extract some data from the shortcode, rather than just recording its presence (which we do for all)
|
||||
// There should be a function get_{shortcode}_id( $atts ) or static method SomethingShortcode::get_{shortcode}_id( $atts ) for these.
|
||||
private static $KEEPER_SHORTCODES = array(
|
||||
'youtube',
|
||||
'vimeo',
|
||||
'hulu',
|
||||
'ted',
|
||||
'wpvideo',
|
||||
'audio',
|
||||
);
|
||||
|
||||
/**
|
||||
* Gets the specified media and meta info from the given post.
|
||||
* NOTE: If you have the post's HTML content already and don't need image data, use extract_from_content() instead.
|
||||
*
|
||||
* @param $blog_id The ID of the blog
|
||||
* @param $post_id The ID of the post
|
||||
* @param $what_to_extract (int) A mask of things to extract, e.g. Jetpack_Media_Meta_Extractor::IMAGES | Jetpack_Media_Meta_Extractor::MENTIONS
|
||||
* @returns a structure containing metadata about the embedded things, or empty array if nothing found, or WP_Error on error
|
||||
*/
|
||||
static public function extract( $blog_id, $post_id, $what_to_extract = self::ALL ) {
|
||||
|
||||
// multisite?
|
||||
if ( function_exists( 'switch_to_blog') )
|
||||
switch_to_blog( $blog_id );
|
||||
|
||||
$post = get_post( $post_id );
|
||||
$content = $post->post_title . "\n\n" . $post->post_content;
|
||||
$char_cnt = strlen( $content );
|
||||
|
||||
//prevent running extraction on really huge amounts of content
|
||||
if ( $char_cnt > 100000 ) //about 20k English words
|
||||
$content = substr( $content, 0, 100000 );
|
||||
|
||||
$extracted = array();
|
||||
|
||||
// Get images first, we need the full post for that
|
||||
if ( self::IMAGES & $what_to_extract ) {
|
||||
$extracted = self::get_image_fields( $post );
|
||||
|
||||
// Turn off images so we can safely call extract_from_content() below
|
||||
$what_to_extract = $what_to_extract - self::IMAGES;
|
||||
}
|
||||
|
||||
if ( function_exists( 'switch_to_blog') )
|
||||
restore_current_blog();
|
||||
|
||||
// All of the other things besides images can be extracted from just the content
|
||||
$extracted = self::extract_from_content( $content, $what_to_extract, $extracted );
|
||||
|
||||
return $extracted;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the specified meta info from the given post content.
|
||||
* NOTE: If you want IMAGES, call extract( $blog_id, $post_id, ...) which will give you more/better image extraction
|
||||
* This method will give you an error if you ask for IMAGES.
|
||||
*
|
||||
* @param $content The HTML post_content of a post
|
||||
* @param $what_to_extract (int) A mask of things to extract, e.g. Jetpack_Media_Meta_Extractor::IMAGES | Jetpack_Media_Meta_Extractor::MENTIONS
|
||||
* @param $already_extracted (array) Previously extracted things, e.g. images from extract(), which can be used for x-referencing here
|
||||
* @returns a structure containing metadata about the embedded things, or empty array if nothing found, or WP_Error on error
|
||||
*/
|
||||
static public function extract_from_content( $content, $what_to_extract = self::ALL, $already_extracted = array() ) {
|
||||
$stripped_content = self::get_stripped_content( $content );
|
||||
|
||||
// Maybe start with some previously extracted things (e.g. images from extract()
|
||||
$extracted = $already_extracted;
|
||||
|
||||
// Embedded media objects will have already been converted to shortcodes by pre_kses hooks on save.
|
||||
|
||||
if ( self::IMAGES & $what_to_extract ) {
|
||||
$images = Jetpack_Media_Meta_Extractor::extract_images_from_content( $stripped_content, array() );
|
||||
$extracted = array_merge( $extracted, $images );
|
||||
}
|
||||
|
||||
// ----------------------------------- MENTIONS ------------------------------
|
||||
|
||||
if ( self::MENTIONS & $what_to_extract ) {
|
||||
if ( preg_match_all( '/(^|\s)@(\w+)/u', $stripped_content, $matches ) ) {
|
||||
$mentions = array_values( array_unique( $matches[2] ) ); //array_unique() retains the keys!
|
||||
$mentions = array_map( 'strtolower', $mentions );
|
||||
$extracted['mention'] = array( 'name' => $mentions );
|
||||
if ( !isset( $extracted['has'] ) )
|
||||
$extracted['has'] = array();
|
||||
$extracted['has']['mention'] = count( $mentions );
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------------------- HASHTAGS ------------------------------
|
||||
/** Some hosts may not compile with --enable-unicode-properties and kick a warning:
|
||||
* Warning: preg_match_all() [function.preg-match-all]: Compilation failed: support for \P, \p, and \X has not been compiled
|
||||
* Therefore, we only run this code block on wpcom, not in Jetpack.
|
||||
*/
|
||||
if ( ( defined( 'IS_WPCOM' ) && IS_WPCOM ) && ( self::HASHTAGS & $what_to_extract ) ) {
|
||||
//This regex does not exactly match Twitter's
|
||||
// if there are problems/complaints we should implement this:
|
||||
// https://github.com/twitter/twitter-text/blob/master/java/src/com/twitter/Regex.java
|
||||
if ( preg_match_all( '/(?:^|\s)#(\w*\p{L}+\w*)/u', $stripped_content, $matches ) ) {
|
||||
$hashtags = array_values( array_unique( $matches[1] ) ); //array_unique() retains the keys!
|
||||
$hashtags = array_map( 'strtolower', $hashtags );
|
||||
$extracted['hashtag'] = array( 'name' => $hashtags );
|
||||
if ( !isset( $extracted['has'] ) )
|
||||
$extracted['has'] = array();
|
||||
$extracted['has']['hashtag'] = count( $hashtags );
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------------------- SHORTCODES ------------------------------
|
||||
|
||||
// Always look for shortcodes.
|
||||
// If we don't want them, we'll just remove them, so we don't grab them as links below
|
||||
$shortcode_pattern = '/' . get_shortcode_regex() . '/s';
|
||||
if ( preg_match_all( $shortcode_pattern, $content, $matches ) ) {
|
||||
|
||||
$shortcode_total_count = 0;
|
||||
$shortcode_type_counts = array();
|
||||
$shortcode_types = array();
|
||||
$shortcode_details = array();
|
||||
|
||||
if ( self::SHORTCODES & $what_to_extract ) {
|
||||
|
||||
foreach( $matches[2] as $key => $shortcode ) {
|
||||
//Elasticsearch (and probably other things) doesn't deal well with some chars as key names
|
||||
$shortcode_name = preg_replace( '/[.,*"\'\/\\\\#+ ]/', '_', $shortcode );
|
||||
|
||||
$attr = shortcode_parse_atts( $matches[3][ $key ] );
|
||||
|
||||
$shortcode_total_count++;
|
||||
if ( ! isset( $shortcode_type_counts[$shortcode_name] ) )
|
||||
$shortcode_type_counts[$shortcode_name] = 0;
|
||||
$shortcode_type_counts[$shortcode_name]++;
|
||||
|
||||
// Store (uniquely) presence of all shortcode regardless of whether it's a keeper (for those, get ID below)
|
||||
// @todo Store number of occurrences?
|
||||
if ( ! in_array( $shortcode_name, $shortcode_types ) )
|
||||
$shortcode_types[] = $shortcode_name;
|
||||
|
||||
// For keeper shortcodes, also store the id/url of the object (e.g. youtube video, TED talk, etc.)
|
||||
if ( in_array( $shortcode, self::$KEEPER_SHORTCODES ) ) {
|
||||
unset( $id ); // Clear shortcode ID data left from the last shortcode
|
||||
// We'll try to get the salient ID from the function jetpack_shortcode_get_xyz_id()
|
||||
// If the shortcode is a class, we'll call XyzShortcode::get_xyz_id()
|
||||
$shortcode_get_id_func = "jetpack_shortcode_get_{$shortcode}_id";
|
||||
$shortcode_class_name = ucfirst( $shortcode ) . 'Shortcode';
|
||||
$shortcode_get_id_method = "get_{$shortcode}_id";
|
||||
if ( function_exists( $shortcode_get_id_func ) ) {
|
||||
$id = call_user_func( $shortcode_get_id_func, $attr );
|
||||
} else if ( method_exists( $shortcode_class_name, $shortcode_get_id_method ) ) {
|
||||
$id = call_user_func( array( $shortcode_class_name, $shortcode_get_id_method ), $attr );
|
||||
}
|
||||
if ( ! empty( $id )
|
||||
&& ( ! isset( $shortcode_details[$shortcode_name] ) || ! in_array( $id, $shortcode_details[$shortcode_name] ) ) )
|
||||
$shortcode_details[$shortcode_name][] = $id;
|
||||
}
|
||||
}
|
||||
|
||||
if ( $shortcode_total_count > 0 ) {
|
||||
// Add the shortcode info to the $extracted array
|
||||
if ( !isset( $extracted['has'] ) )
|
||||
$extracted['has'] = array();
|
||||
$extracted['has']['shortcode'] = $shortcode_total_count;
|
||||
$extracted['shortcode'] = array();
|
||||
foreach ( $shortcode_type_counts as $type => $count )
|
||||
$extracted['shortcode'][$type] = array( 'count' => $count );
|
||||
if ( ! empty( $shortcode_types ) )
|
||||
$extracted['shortcode_types'] = $shortcode_types;
|
||||
foreach ( $shortcode_details as $type => $id )
|
||||
$extracted['shortcode'][$type]['id'] = $id;
|
||||
}
|
||||
}
|
||||
|
||||
// Remove the shortcodes form our copy of $content, so we don't count links in them as links below.
|
||||
$content = preg_replace( $shortcode_pattern, ' ', $content );
|
||||
}
|
||||
|
||||
// ----------------------------------- LINKS ------------------------------
|
||||
|
||||
if ( self::LINKS & $what_to_extract ) {
|
||||
|
||||
// To hold the extracted stuff we find
|
||||
$links = array();
|
||||
|
||||
// @todo Get the text inside the links?
|
||||
|
||||
// Grab any links, whether in <a href="..." or not, but subtract those from shortcodes and images
|
||||
// (we treat embed links as just another link)
|
||||
if ( preg_match_all( '#(?:^|\s|"|\')(https?://([^\s()<>]+(?:\([\w\d]+\)|([^[:punct:]\s]|/))))#', $content, $matches ) ) {
|
||||
|
||||
foreach ( $matches[1] as $link_raw ) {
|
||||
$url = parse_url( $link_raw );
|
||||
|
||||
// Data URI links
|
||||
if ( isset( $url['scheme'] ) && 'data' === $url['scheme'] )
|
||||
continue;
|
||||
|
||||
// Remove large (and likely invalid) links
|
||||
if ( 4096 < strlen( $link_raw ) )
|
||||
continue;
|
||||
|
||||
// Build a simple form of the URL so we can compare it to ones we found in IMAGES or SHORTCODES and exclude those
|
||||
$simple_url = $url['scheme'] . '://' . $url['host'] . ( ! empty( $url['path'] ) ? $url['path'] : '' );
|
||||
if ( isset( $extracted['image']['url'] ) ) {
|
||||
if ( in_array( $simple_url, (array) $extracted['image']['url'] ) )
|
||||
continue;
|
||||
}
|
||||
|
||||
list( $proto, $link_all_but_proto ) = explode( '://', $link_raw );
|
||||
|
||||
// Build a reversed hostname
|
||||
$host_parts = array_reverse( explode( '.', $url['host'] ) );
|
||||
$host_reversed = '';
|
||||
foreach ( $host_parts as $part ) {
|
||||
$host_reversed .= ( ! empty( $host_reversed ) ? '.' : '' ) . $part;
|
||||
}
|
||||
|
||||
$link_analyzed = '';
|
||||
if ( !empty( $url['path'] ) ) {
|
||||
// The whole path (no query args or fragments)
|
||||
$path = substr( $url['path'], 1 ); // strip the leading '/'
|
||||
$link_analyzed .= ( ! empty( $link_analyzed ) ? ' ' : '' ) . $path;
|
||||
|
||||
// The path split by /
|
||||
$path_split = explode( '/', $path );
|
||||
if ( count( $path_split ) > 1 ) {
|
||||
$link_analyzed .= ' ' . implode( ' ', $path_split );
|
||||
}
|
||||
|
||||
// The fragment
|
||||
if ( ! empty( $url['fragment'] ) )
|
||||
$link_analyzed .= ( ! empty( $link_analyzed ) ? ' ' : '' ) . $url['fragment'];
|
||||
}
|
||||
|
||||
// @todo Check unique before adding
|
||||
$links[] = array(
|
||||
'url' => $link_all_but_proto,
|
||||
'host_reversed' => $host_reversed,
|
||||
'host' => $url['host'],
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$link_count = count( $links );
|
||||
if ( $link_count ) {
|
||||
$extracted[ 'link' ] = $links;
|
||||
if ( !isset( $extracted['has'] ) )
|
||||
$extracted['has'] = array();
|
||||
$extracted['has']['link'] = $link_count;
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------------------- EMBEDS ------------------------------
|
||||
|
||||
//Embeds are just individual links on their own line
|
||||
if ( self::EMBEDS & $what_to_extract ) {
|
||||
|
||||
if ( !function_exists( '_wp_oembed_get_object' ) )
|
||||
include( ABSPATH . WPINC . '/class-oembed.php' );
|
||||
|
||||
// get an oembed object
|
||||
$oembed = _wp_oembed_get_object();
|
||||
|
||||
// Grab any links on their own lines that may be embeds
|
||||
if ( preg_match_all( '|^\s*(https?://[^\s"]+)\s*$|im', $content, $matches ) ) {
|
||||
|
||||
// To hold the extracted stuff we find
|
||||
$embeds = array();
|
||||
|
||||
foreach ( $matches[1] as $link_raw ) {
|
||||
$url = parse_url( $link_raw );
|
||||
|
||||
list( $proto, $link_all_but_proto ) = explode( '://', $link_raw );
|
||||
|
||||
// Check whether this "link" is really an embed.
|
||||
foreach ( $oembed->providers as $matchmask => $data ) {
|
||||
list( $providerurl, $regex ) = $data;
|
||||
|
||||
// Turn the asterisk-type provider URLs into regex
|
||||
if ( !$regex ) {
|
||||
$matchmask = '#' . str_replace( '___wildcard___', '(.+)', preg_quote( str_replace( '*', '___wildcard___', $matchmask ), '#' ) ) . '#i';
|
||||
$matchmask = preg_replace( '|^#http\\\://|', '#https?\://', $matchmask );
|
||||
}
|
||||
|
||||
if ( preg_match( $matchmask, $link_raw ) ) {
|
||||
$provider = str_replace( '{format}', 'json', $providerurl ); // JSON is easier to deal with than XML
|
||||
$embeds[] = $link_all_but_proto; // @todo Check unique before adding
|
||||
|
||||
// @todo Try to get ID's for the ones we care about (shortcode_keepers)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! empty( $embeds ) ) {
|
||||
if ( !isset( $extracted['has'] ) )
|
||||
$extracted['has'] = array();
|
||||
$extracted['has']['embed'] = count( $embeds );
|
||||
$extracted['embed'] = array( 'url' => array() );
|
||||
foreach ( $embeds as $e )
|
||||
$extracted['embed']['url'][] = $e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $extracted;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $post A post object
|
||||
* @param $args (array) Optional args, see defaults list for details
|
||||
* @returns array Returns an array of all images meeting the specified criteria in $args
|
||||
*
|
||||
* Uses Jetpack Post Images
|
||||
*/
|
||||
private static function get_image_fields( $post, $args = array() ) {
|
||||
|
||||
$defaults = array(
|
||||
'width' => 200, // Required minimum width (if possible to determine)
|
||||
'height' => 200, // Required minimum height (if possible to determine)
|
||||
);
|
||||
|
||||
$args = wp_parse_args( $args, $defaults );
|
||||
|
||||
$image_list = array();
|
||||
$image_booleans = array();
|
||||
$image_booleans['gallery'] = 0;
|
||||
|
||||
$from_featured_image = Jetpack_PostImages::from_thumbnail( $post->ID, $args['width'], $args['height'] );
|
||||
if ( !empty( $from_featured_image ) ) {
|
||||
$srcs = wp_list_pluck( $from_featured_image, 'src' );
|
||||
$image_list = array_merge( $image_list, $srcs );
|
||||
}
|
||||
|
||||
$from_slideshow = Jetpack_PostImages::from_slideshow( $post->ID, $args['width'], $args['height'] );
|
||||
if ( !empty( $from_slideshow ) ) {
|
||||
$srcs = wp_list_pluck( $from_slideshow, 'src' );
|
||||
$image_list = array_merge( $image_list, $srcs );
|
||||
}
|
||||
|
||||
$from_gallery = Jetpack_PostImages::from_gallery( $post->ID );
|
||||
if ( !empty( $from_gallery ) ) {
|
||||
$srcs = wp_list_pluck( $from_gallery, 'src' );
|
||||
$image_list = array_merge( $image_list, $srcs );
|
||||
$image_booleans['gallery']++; // @todo This count isn't correct, will only every count 1
|
||||
}
|
||||
|
||||
// @todo Can we check width/height of these efficiently? Could maybe use query args at least, before we strip them out
|
||||
$image_list = Jetpack_Media_Meta_Extractor::get_images_from_html( $post->post_content, $image_list );
|
||||
|
||||
return Jetpack_Media_Meta_Extractor::build_image_struct( $image_list );
|
||||
}
|
||||
|
||||
public static function extract_images_from_content( $content, $image_list ) {
|
||||
$image_list = Jetpack_Media_Meta_Extractor::get_images_from_html( $content, $image_list );
|
||||
return Jetpack_Media_Meta_Extractor::build_image_struct( $image_list );
|
||||
}
|
||||
|
||||
public static function build_image_struct( $image_list ) {
|
||||
if ( ! empty( $image_list ) ) {
|
||||
$retval = array( 'image' => array() );
|
||||
$image_list = array_unique( $image_list );
|
||||
foreach ( $image_list as $img ) {
|
||||
$retval['image'][] = array( 'url' => $img );
|
||||
}
|
||||
$image_booleans['image'] = count( $retval['image'] );
|
||||
if ( ! empty( $image_booleans ) )
|
||||
$retval['has'] = $image_booleans;
|
||||
return $retval;
|
||||
} else {
|
||||
return array();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param string $html Some markup, possibly containing image tags
|
||||
* @param array $images_already_extracted (just an array of image URLs without query strings, no special structure), used for de-duplication
|
||||
* @return array Image URLs extracted from the HTML, stripped of query params and de-duped
|
||||
*/
|
||||
public static function get_images_from_html( $html, $images_already_extracted ) {
|
||||
$image_list = $images_already_extracted;
|
||||
$from_html = Jetpack_PostImages::from_html( $html );
|
||||
if ( !empty( $from_html ) ) {
|
||||
$srcs = wp_list_pluck( $from_html, 'src' );
|
||||
foreach( $srcs as $image_url ) {
|
||||
if ( ( $src = parse_url( $image_url ) ) && isset( $src['scheme'], $src['host'], $src['path'] ) ) {
|
||||
// Rebuild the URL without the query string
|
||||
$queryless = $src['scheme'] . '://' . $src['host'] . $src['path'];
|
||||
} elseif ( $length = strpos( $image_url, '?' ) ) {
|
||||
// If parse_url() didn't work, strip off the query string the old fashioned way
|
||||
$queryless = substr( $image_url, 0, $length );
|
||||
} else {
|
||||
// Failing that, there was no spoon! Err ... query string!
|
||||
$queryless = $image_url;
|
||||
}
|
||||
|
||||
// Discard URLs that are longer then 4KB, these are likely data URIs or malformed HTML.
|
||||
if ( 4096 < strlen( $queryless ) ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( ! in_array( $queryless, $image_list ) ) {
|
||||
$image_list[] = $queryless;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $image_list;
|
||||
}
|
||||
|
||||
private static function get_stripped_content( $content ) {
|
||||
$clean_content = strip_tags( $content );
|
||||
$clean_content = html_entity_decode( $clean_content );
|
||||
//completely strip shortcodes and any content they enclose
|
||||
$clean_content = strip_shortcodes( $clean_content );
|
||||
return $clean_content;
|
||||
}
|
||||
}
|
281
plugins/jetpack/_inc/lib/class.media-summary.php
Normal file
281
plugins/jetpack/_inc/lib/class.media-summary.php
Normal file
|
@ -0,0 +1,281 @@
|
|||
<?php
|
||||
/**
|
||||
* Class Jetpack_Media_Summary
|
||||
*
|
||||
* embed [video] > gallery > image > text
|
||||
*/
|
||||
class Jetpack_Media_Summary {
|
||||
|
||||
static function get( $post_id, $blog_id = 0, $args = array() ) {
|
||||
$defaults = array(
|
||||
'max_words' => 16,
|
||||
'max_chars' => 256,
|
||||
);
|
||||
$args = wp_parse_args( $args, $defaults );
|
||||
|
||||
$switched = false;
|
||||
if ( !empty( $blog_id ) && $blog_id != get_current_blog_id() && function_exists( 'switch_to_blog' ) ) {
|
||||
switch_to_blog( $blog_id );
|
||||
$switched = true;
|
||||
} else {
|
||||
$blog_id = get_current_blog_id();
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'Jetpack_Media_Meta_Extractor' ) ) {
|
||||
jetpack_require_lib( 'class.media-extractor' );
|
||||
}
|
||||
|
||||
$post = get_post( $post_id );
|
||||
$permalink = get_permalink( $post_id );
|
||||
|
||||
$return = array(
|
||||
'type' => 'standard',
|
||||
'permalink' => $permalink,
|
||||
'image' => '',
|
||||
'excerpt' => '',
|
||||
'word_count' => 0,
|
||||
'secure' => array(
|
||||
'image' => '',
|
||||
),
|
||||
'count' => array(
|
||||
'image' => 0,
|
||||
'video' => 0,
|
||||
'word' => 0,
|
||||
'link' => 0,
|
||||
),
|
||||
);
|
||||
|
||||
if ( empty( $post->post_password ) ) {
|
||||
$return['excerpt'] = self::get_excerpt( $post->post_content, $post->post_excerpt, $args['max_words'], $args['max_chars'] );
|
||||
$return['count']['word'] = self::get_word_count( $post->post_content );
|
||||
$return['count']['word_remaining'] = self::get_word_remaining_count( $post->post_content, $return['excerpt'] );
|
||||
$return['count']['link'] = self::get_link_count( $post->post_content );
|
||||
}
|
||||
|
||||
$extract = Jetpack_Media_Meta_Extractor::extract( $blog_id, $post_id, Jetpack_Media_Meta_Extractor::ALL );
|
||||
|
||||
if ( empty( $extract['has'] ) )
|
||||
return $return;
|
||||
|
||||
// Prioritize [some] video embeds
|
||||
if ( !empty( $extract['has']['shortcode'] ) ) {
|
||||
foreach ( $extract['shortcode'] as $type => $data ) {
|
||||
switch ( $type ) {
|
||||
case 'wpvideo':
|
||||
if ( 0 == $return['count']['video'] ) {
|
||||
$return['type'] = 'video';
|
||||
$return['video'] = esc_url_raw( 'http://s0.videopress.com/player.swf?guid=' . $extract['shortcode']['wpvideo']['id'][0] . '&isDynamicSeeking=true' );
|
||||
$return['image'] = self::get_video_poster( 'videopress', $extract['shortcode']['wpvideo']['id'][0] );
|
||||
$return['secure']['video'] = preg_replace( '@http://[^\.]+.videopress.com/@', 'https://v0.wordpress.com/', $return['video'] );
|
||||
$return['secure']['image'] = str_replace( 'http://videos.videopress.com', 'https://videos.files.wordpress.com', $return['image'] );
|
||||
}
|
||||
$return['count']['video']++;
|
||||
break;
|
||||
case 'youtube':
|
||||
if ( 0 == $return['count']['video'] ) {
|
||||
$return['type'] = 'video';
|
||||
$return['video'] = esc_url_raw( 'http://www.youtube.com/watch?feature=player_embedded&v=' . $extract['shortcode']['youtube']['id'][0] );
|
||||
$return['image'] = self::get_video_poster( 'youtube', $extract['shortcode']['youtube']['id'][0] );
|
||||
$return['secure']['video'] = self::https( $return['video'] );
|
||||
$return['secure']['image'] = self::https( $return['image'] );
|
||||
}
|
||||
$return['count']['video']++;
|
||||
break;
|
||||
case 'vimeo':
|
||||
if ( 0 == $return['count']['video'] ) {
|
||||
$return['type'] = 'video';
|
||||
$return['video'] = esc_url_raw( 'http://vimeo.com/' . $extract['shortcode']['vimeo']['id'][0] );
|
||||
$return['secure']['video'] = self::https( $return['video'] );
|
||||
|
||||
$poster_image = get_post_meta( $post_id, 'vimeo_poster_image', true );
|
||||
if ( !empty( $poster_image ) ) {
|
||||
$return['image'] = $poster_image;
|
||||
$poster_url_parts = parse_url( $poster_image );
|
||||
$return['secure']['image'] = 'https://secure-a.vimeocdn.com' . $poster_url_parts['path'];
|
||||
}
|
||||
}
|
||||
$return['count']['video']++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ( !empty( $extract['has']['embed'] ) ) {
|
||||
foreach( $extract['embed']['url'] as $embed ) {
|
||||
if ( preg_match( '/((youtube|vimeo|dailymotion)\.com|youtu.be)/', $embed ) ) {
|
||||
if ( 0 == $return['count']['video'] ) {
|
||||
$return['type'] = 'video';
|
||||
$return['video'] = 'http://' . $embed;
|
||||
$return['secure']['video'] = self::https( $return['video'] );
|
||||
if ( false !== strpos( $embed, 'youtube' ) ) {
|
||||
$return['image'] = self::get_video_poster( 'youtube', jetpack_get_youtube_id( $return['video'] ) );
|
||||
$return['secure']['image'] = self::https( $return['image'] );
|
||||
} else if ( false !== strpos( $embed, 'youtu.be' ) ) {
|
||||
$youtube_id = jetpack_get_youtube_id( $return['video'] );
|
||||
$return['video'] = 'http://youtube.com/watch?v=' . $youtube_id . '&feature=youtu.be';
|
||||
$return['secure']['video'] = self::https( $return['video'] );
|
||||
$return['image'] = self::get_video_poster( 'youtube', jetpack_get_youtube_id( $return['video'] ) );
|
||||
$return['secure']['image'] = self::https( $return['image'] );
|
||||
} else if ( false !== strpos( $embed, 'vimeo' ) ) {
|
||||
$poster_image = get_post_meta( $post_id, 'vimeo_poster_image', true );
|
||||
if ( !empty( $poster_image ) ) {
|
||||
$return['image'] = $poster_image;
|
||||
$poster_url_parts = parse_url( $poster_image );
|
||||
$return['secure']['image'] = 'https://secure-a.vimeocdn.com' . $poster_url_parts['path'];
|
||||
}
|
||||
} else if ( false !== strpos( $embed, 'dailymotion' ) ) {
|
||||
$return['image'] = str_replace( 'dailymotion.com/video/','dailymotion.com/thumbnail/video/', $embed );
|
||||
$return['image'] = parse_url( $return['image'], PHP_URL_SCHEME ) === null ? 'http://' . $return['image'] : $return['image'];
|
||||
$return['secure']['image'] = self::https( $return['image'] );
|
||||
}
|
||||
|
||||
}
|
||||
$return['count']['video']++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Do we really want to make the video the primary focus of the post?
|
||||
if ( 'video' == $return['type'] ) {
|
||||
$content = wpautop( strip_tags( $post->post_content ) );
|
||||
$paragraphs = explode( '</p>', $content );
|
||||
$number_of_paragraphs = 0;
|
||||
|
||||
foreach ( $paragraphs as $i => $paragraph ) {
|
||||
// Don't include blank lines as a paragraph
|
||||
if ( '' == trim( $paragraph ) ) {
|
||||
unset( $paragraphs[$i] );
|
||||
continue;
|
||||
}
|
||||
$number_of_paragraphs++;
|
||||
}
|
||||
|
||||
$number_of_paragraphs = $number_of_paragraphs - $return['count']['video']; // subtract amount for videos..
|
||||
|
||||
// More than 2 paragraph? The video is not the primary focus so we can do some more analysis
|
||||
if ( $number_of_paragraphs > 2 )
|
||||
$return['type'] = 'standard';
|
||||
}
|
||||
|
||||
// If we don't have any prioritized embed...
|
||||
if ( 'standard' == $return['type'] ) {
|
||||
if ( ( ! empty( $extract['has']['gallery'] ) || ! empty( $extract['shortcode']['gallery']['count'] ) ) && ! empty( $extract['image'] ) ) {
|
||||
//... Then we prioritize galleries first (multiple images returned)
|
||||
$return['type'] = 'gallery';
|
||||
$return['images'] = $extract['image'];
|
||||
foreach ( $return['images'] as $image ) {
|
||||
$return['secure']['images'][] = array( 'url' => self::ssl_img( $image['url'] ) );
|
||||
$return['count']['image']++;
|
||||
}
|
||||
} else if ( ! empty( $extract['has']['image'] ) ) {
|
||||
// ... Or we try and select a single image that would make sense
|
||||
$content = wpautop( strip_tags( $post->post_content ) );
|
||||
$paragraphs = explode( '</p>', $content );
|
||||
$number_of_paragraphs = 0;
|
||||
|
||||
foreach ( $paragraphs as $i => $paragraph ) {
|
||||
// Don't include 'actual' captions as a paragraph
|
||||
if ( false !== strpos( $paragraph, '[caption' ) ) {
|
||||
unset( $paragraphs[$i] );
|
||||
continue;
|
||||
}
|
||||
// Don't include blank lines as a paragraph
|
||||
if ( '' == trim( $paragraph ) ) {
|
||||
unset( $paragraphs[$i] );
|
||||
continue;
|
||||
}
|
||||
$number_of_paragraphs++;
|
||||
}
|
||||
|
||||
$return['image'] = $extract['image'][0]['url'];
|
||||
$return['secure']['image'] = self::ssl_img( $return['image'] );
|
||||
$return['count']['image']++;
|
||||
|
||||
if ( $number_of_paragraphs <= 2 && 1 == count( $extract['image'] ) ) {
|
||||
// If we have lots of text or images, let's not treat it as an image post, but return its first image
|
||||
$return['type'] = 'image';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( $switched ) {
|
||||
restore_current_blog();
|
||||
}
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
static function https( $str ) {
|
||||
return str_replace( 'http://', 'https://', $str );
|
||||
}
|
||||
|
||||
static function ssl_img( $url ) {
|
||||
if ( false !== strpos( $url, 'files.wordpress.com' ) ) {
|
||||
return self::https( $url );
|
||||
} else {
|
||||
return self::https( jetpack_photon_url( $url ) );
|
||||
}
|
||||
}
|
||||
|
||||
static function get_video_poster( $type, $id ) {
|
||||
if ( 'videopress' == $type ) {
|
||||
if ( function_exists( 'video_get_highest_resolution_image_url' ) ) {
|
||||
return video_get_highest_resolution_image_url( $id );
|
||||
} else if ( class_exists( 'VideoPress_Video' ) ) {
|
||||
$video = new VideoPress_Video( $id );
|
||||
return $video->poster_frame_uri;
|
||||
}
|
||||
} else if ( 'youtube' == $type ) {
|
||||
return 'http://img.youtube.com/vi/'.$id.'/0.jpg';
|
||||
}
|
||||
}
|
||||
|
||||
static function clean_text( $text ) {
|
||||
return trim(
|
||||
preg_replace(
|
||||
'/[\s]+/',
|
||||
' ',
|
||||
preg_replace(
|
||||
'@https?://[\S]+@',
|
||||
'',
|
||||
strip_shortcodes(
|
||||
strip_tags(
|
||||
$text
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
static function get_excerpt( $post_content, $post_excerpt, $max_words = 16, $max_chars = 256 ) {
|
||||
if ( function_exists( 'wpcom_enhanced_excerpt_extract_excerpt' ) ) {
|
||||
return self::clean_text( wpcom_enhanced_excerpt_extract_excerpt( array(
|
||||
'text' => $post_content,
|
||||
'excerpt_only' => true,
|
||||
'show_read_more' => false,
|
||||
'max_words' => $max_words,
|
||||
'max_chars' => $max_chars,
|
||||
'read_more_threshold' => 25,
|
||||
) ) );
|
||||
} else {
|
||||
|
||||
/** This filter is documented in core/src/wp-includes/post-template.php */
|
||||
$post_excerpt = apply_filters( 'get_the_excerpt', $post_excerpt );
|
||||
return self::clean_text( $post_excerpt );
|
||||
}
|
||||
}
|
||||
|
||||
static function get_word_count( $post_content ) {
|
||||
return str_word_count( self::clean_text( $post_content ) );
|
||||
}
|
||||
|
||||
static function get_word_remaining_count( $post_content, $excerpt_content ) {
|
||||
return str_word_count( self::clean_text( $post_content ) ) - str_word_count( self::clean_text( $excerpt_content ) );
|
||||
}
|
||||
|
||||
static function get_link_count( $post_content ) {
|
||||
return preg_match_all( '/\<a[\> ]/', $post_content, $matches );
|
||||
}
|
||||
}
|
6
plugins/jetpack/_inc/lib/markdown/0-load.php
Normal file
6
plugins/jetpack/_inc/lib/markdown/0-load.php
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?php
|
||||
|
||||
if ( ! class_exists( 'MarkdownExtra_Parser' ) )
|
||||
jetpack_require_lib( 'markdown/extra' );
|
||||
|
||||
jetpack_require_lib( 'markdown/gfm' );
|
19
plugins/jetpack/_inc/lib/markdown/README.md
Normal file
19
plugins/jetpack/_inc/lib/markdown/README.md
Normal file
|
@ -0,0 +1,19 @@
|
|||
# Markdown parsing library
|
||||
|
||||
Contains two libraries:
|
||||
|
||||
* `/extra`
|
||||
- Gives you `MardownExtra_Parser` and `Markdown_Parser`
|
||||
- Docs at http://michelf.ca/projects/php-markdown/extra/
|
||||
|
||||
* `/gfm` -- Github Flavored MArkdown
|
||||
- Gives you `WPCom_GHF_Markdown_Parser`
|
||||
- It has the same interface as `MarkdownExtra_Parser`
|
||||
- Adds support for fenced code blocks: https://help.github.com/articles/github-flavored-markdown#fenced-code-blocks
|
||||
- By default it replaces them with a code shortcode
|
||||
- You can change this using the `$use_code_shortcode` member variable
|
||||
- You can change the code shortcode wrapping with `$shortcode_start` and `$shortcode_end` member variables
|
||||
- The `$preserve_shortcodes` member variable will preserve all registered shortcodes untouched. Requires WordPress to be loaded for `get_shortcode_regex()`
|
||||
- The `$preserve_latex` member variable will preserve oldskool $latex yer-latex$ codes untouched.
|
||||
- The `$strip_paras` member variable will strip <p> tags because that's what WordPress likes.
|
||||
- See `WPCom_GHF_Markdown_Parser::__construct()` for how the above member variable defaults are set.
|
3194
plugins/jetpack/_inc/lib/markdown/extra.php
Normal file
3194
plugins/jetpack/_inc/lib/markdown/extra.php
Normal file
File diff suppressed because it is too large
Load diff
389
plugins/jetpack/_inc/lib/markdown/gfm.php
Normal file
389
plugins/jetpack/_inc/lib/markdown/gfm.php
Normal file
|
@ -0,0 +1,389 @@
|
|||
<?php
|
||||
/**
|
||||
* GitHub-Flavoured Markdown. Inspired by Evan's plugin, but modified.
|
||||
*
|
||||
* @author Evan Solomon
|
||||
* @author Matt Wiebe <wiebe@automattic.com>
|
||||
* @link https://github.com/evansolomon/wp-github-flavored-markdown-comments
|
||||
*
|
||||
* Add a few extras from GitHub's Markdown implementation. Must be used in a WordPress environment.
|
||||
*/
|
||||
|
||||
class WPCom_GHF_Markdown_Parser extends MarkdownExtra_Parser {
|
||||
|
||||
/**
|
||||
* Hooray somewhat arbitrary numbers that are fearful of 1.0.x.
|
||||
*/
|
||||
const WPCOM_GHF_MARDOWN_VERSION = '0.9.0';
|
||||
|
||||
/**
|
||||
* Use a [code] shortcode when encountering a fenced code block
|
||||
* @var boolean
|
||||
*/
|
||||
public $use_code_shortcode = true;
|
||||
|
||||
/**
|
||||
* Preserve shortcodes, untouched by Markdown.
|
||||
* This requires use within a WordPress installation.
|
||||
* @var boolean
|
||||
*/
|
||||
public $preserve_shortcodes = true;
|
||||
|
||||
/**
|
||||
* Preserve the legacy $latex your-latex-code-here$ style
|
||||
* LaTeX markup
|
||||
*/
|
||||
public $preserve_latex = true;
|
||||
|
||||
/**
|
||||
* Preserve single-line <code> blocks.
|
||||
* @var boolean
|
||||
*/
|
||||
public $preserve_inline_code_blocks = true;
|
||||
|
||||
/**
|
||||
* Strip paragraphs from the output. This is the right default for WordPress,
|
||||
* which generally wants to create its own paragraphs with `wpautop`
|
||||
* @var boolean
|
||||
*/
|
||||
public $strip_paras = true;
|
||||
|
||||
// Will run through sprintf - you can supply your own syntax if you want
|
||||
public $shortcode_start = '[code lang=%s]';
|
||||
public $shortcode_end = '[/code]';
|
||||
|
||||
// Stores shortcodes we remove and then replace
|
||||
protected $preserve_text_hash = array();
|
||||
|
||||
/**
|
||||
* Set environment defaults based on presence of key functions/classes.
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->use_code_shortcode = class_exists( 'SyntaxHighlighter' );
|
||||
$this->preserve_shortcodes = function_exists( 'get_shortcode_regex' );
|
||||
$this->preserve_latex = function_exists( 'latex_markup' );
|
||||
$this->strip_paras = function_exists( 'wpautop' );
|
||||
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Overload to specify heading styles only if the hash has space(s) after it. This is actually in keeping with
|
||||
* the documentation and eases the semantic overload of the hash character.
|
||||
* #Will Not Produce a Heading 1
|
||||
* # This Will Produce a Heading 1
|
||||
*
|
||||
* @param string $text Markdown text
|
||||
* @return string HTML-transformed text
|
||||
*/
|
||||
public function transform( $text ) {
|
||||
// Preserve anything inside a single-line <code> element
|
||||
if ( $this->preserve_inline_code_blocks ) {
|
||||
$text = $this->single_line_code_preserve( $text );
|
||||
}
|
||||
// Remove all shortcodes so their interiors are left intact
|
||||
if ( $this->preserve_shortcodes ) {
|
||||
$text = $this->shortcode_preserve( $text );
|
||||
}
|
||||
// Remove legacy LaTeX so it's left intact
|
||||
if ( $this->preserve_latex ) {
|
||||
$text = $this->latex_preserve( $text );
|
||||
}
|
||||
|
||||
// escape line-beginning # chars that do not have a space after them.
|
||||
$text = preg_replace_callback( '|^#{1,6}( )?|um', array( $this, '_doEscapeForHashWithoutSpacing' ), $text );
|
||||
|
||||
/**
|
||||
* Allow third-party plugins to define custom patterns that won't be processed by Markdown.
|
||||
*
|
||||
* @module markdown
|
||||
*
|
||||
* @since 3.9.2
|
||||
*
|
||||
* @param array $custom_patterns Array of custom patterns to be ignored by Markdown.
|
||||
*/
|
||||
$custom_patterns = apply_filters( 'jetpack_markdown_preserve_pattern', array() );
|
||||
if ( is_array( $custom_patterns ) && ! empty( $custom_patterns ) ) {
|
||||
foreach ( $custom_patterns as $pattern ) {
|
||||
$text = preg_replace_callback( $pattern, array( $this, '_doRemoveText'), $text );
|
||||
}
|
||||
}
|
||||
|
||||
// run through core Markdown
|
||||
$text = parent::transform( $text );
|
||||
|
||||
// Occasionally Markdown Extra chokes on a para structure, producing odd paragraphs.
|
||||
$text = str_replace( "<p><</p>\n\n<p>p>", '<p>', $text );
|
||||
|
||||
// put start-of-line # chars back in place
|
||||
$text = $this->restore_leading_hash( $text );
|
||||
|
||||
// Strip paras if set
|
||||
if ( $this->strip_paras ) {
|
||||
$text = $this->unp( $text );
|
||||
}
|
||||
|
||||
// Restore preserved things like shortcodes/LaTeX
|
||||
$text = $this->do_restore( $text );
|
||||
|
||||
return $text;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prevents blocks like <code>__this__</code> from turning into <code><strong>this</strong></code>
|
||||
* @param string $text Text that may need preserving
|
||||
* @return string Text that was preserved if needed
|
||||
*/
|
||||
public function single_line_code_preserve( $text ) {
|
||||
return preg_replace_callback( '|<code\b[^>]*>(.*?)</code>|', array( $this, 'do_single_line_code_preserve' ), $text );
|
||||
}
|
||||
|
||||
/**
|
||||
* Regex callback for inline code presevation
|
||||
* @param array $matches Regex matches
|
||||
* @return string Hashed content for later restoration
|
||||
*/
|
||||
public function do_single_line_code_preserve( $matches ) {
|
||||
return '<code>' . $this->hash_block( $matches[1] ) . '</code>';
|
||||
}
|
||||
|
||||
/**
|
||||
* Preserve code block contents by HTML encoding them. Useful before getting to KSES stripping.
|
||||
* @param string $text Markdown/HTML content
|
||||
* @return string Markdown/HTML content with escaped code blocks
|
||||
*/
|
||||
public function codeblock_preserve( $text ) {
|
||||
return preg_replace_callback( "/^([`~]{3})([^`\n]+)?\n([^`~]+)(\\1)/m", array( $this, 'do_codeblock_preserve' ), $text );
|
||||
}
|
||||
|
||||
/**
|
||||
* Regex callback for code block preservation.
|
||||
* @param array $matches Regex matches
|
||||
* @return string Codeblock with escaped interior
|
||||
*/
|
||||
public function do_codeblock_preserve( $matches ) {
|
||||
$block = stripslashes( $matches[3] );
|
||||
$block = esc_html( $block );
|
||||
$block = str_replace( '\\', '\\\\', $block );
|
||||
$open = $matches[1] . $matches[2] . "\n";
|
||||
return $open . $block . $matches[4];
|
||||
}
|
||||
|
||||
/**
|
||||
* Restore previously preserved (i.e. escaped) code block contents.
|
||||
* @param string $text Markdown/HTML content with escaped code blocks
|
||||
* @return string Markdown/HTML content
|
||||
*/
|
||||
public function codeblock_restore( $text ) {
|
||||
return preg_replace_callback( "/^([`~]{3})([^`\n]+)?\n([^`~]+)(\\1)/m", array( $this, 'do_codeblock_restore' ), $text );
|
||||
}
|
||||
|
||||
/**
|
||||
* Regex callback for code block restoration (unescaping).
|
||||
* @param array $matches Regex matches
|
||||
* @return string Codeblock with unescaped interior
|
||||
*/
|
||||
public function do_codeblock_restore( $matches ) {
|
||||
$block = html_entity_decode( $matches[3], ENT_QUOTES );
|
||||
$open = $matches[1] . $matches[2] . "\n";
|
||||
return $open . $block . $matches[4];
|
||||
}
|
||||
|
||||
/**
|
||||
* Called to preserve legacy LaTeX like $latex some-latex-text $
|
||||
* @param string $text Text in which to preserve LaTeX
|
||||
* @return string Text with LaTeX replaced by a hash that will be restored later
|
||||
*/
|
||||
protected function latex_preserve( $text ) {
|
||||
// regex from latex_remove()
|
||||
$regex = '%
|
||||
\$latex(?:=\s*|\s+)
|
||||
((?:
|
||||
[^$]+ # Not a dollar
|
||||
|
|
||||
(?<=(?<!\\\\)\\\\)\$ # Dollar preceded by exactly one slash
|
||||
)+)
|
||||
(?<!\\\\)\$ # Dollar preceded by zero slashes
|
||||
%ix';
|
||||
$text = preg_replace_callback( $regex, array( $this, '_doRemoveText'), $text );
|
||||
return $text;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called to preserve WP shortcodes from being formatted by Markdown in any way.
|
||||
* @param string $text Text in which to preserve shortcodes
|
||||
* @return string Text with shortcodes replaced by a hash that will be restored later
|
||||
*/
|
||||
protected function shortcode_preserve( $text ) {
|
||||
$text = preg_replace_callback( $this->get_shortcode_regex(), array( $this, '_doRemoveText' ), $text );
|
||||
return $text;
|
||||
}
|
||||
|
||||
/**
|
||||
* Restores any text preserved by $this->hash_block()
|
||||
* @param string $text Text that may have hashed preservation placeholders
|
||||
* @return string Text with hashed preseravtion placeholders replaced by original text
|
||||
*/
|
||||
protected function do_restore( $text ) {
|
||||
foreach( $this->preserve_text_hash as $hash => $value ) {
|
||||
$placeholder = $this->hash_maker( $hash );
|
||||
$text = str_replace( $placeholder, $value, $text );
|
||||
}
|
||||
// reset the hash
|
||||
$this->preserve_text_hash = array();
|
||||
return $text;
|
||||
}
|
||||
|
||||
/**
|
||||
* Regex callback for text preservation
|
||||
* @param array $m Regex $matches array
|
||||
* @return string A placeholder that will later be replaced by the original text
|
||||
*/
|
||||
protected function _doRemoveText( $m ) {
|
||||
return $this->hash_block( $m[0] );
|
||||
}
|
||||
|
||||
/**
|
||||
* Call this to store a text block for later restoration.
|
||||
* @param string $text Text to preserve for later
|
||||
* @return string Placeholder that will be swapped out later for the original text
|
||||
*/
|
||||
protected function hash_block( $text ) {
|
||||
$hash = md5( $text );
|
||||
$this->preserve_text_hash[ $hash ] = $text;
|
||||
$placeholder = $this->hash_maker( $hash );
|
||||
return $placeholder;
|
||||
}
|
||||
|
||||
/**
|
||||
* Less glamorous than the Keymaker
|
||||
* @param string $hash An md5 hash
|
||||
* @return string A placeholder hash
|
||||
*/
|
||||
protected function hash_maker( $hash ) {
|
||||
return 'MARKDOWN_HASH' . $hash . 'MARKDOWN_HASH';
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove bare <p> elements. <p>s with attributes will be preserved.
|
||||
* @param string $text HTML content
|
||||
* @return string <p>-less content
|
||||
*/
|
||||
public function unp( $text ) {
|
||||
return preg_replace( "#<p>(.*?)</p>(\n|$)#ums", '$1$2', $text );
|
||||
}
|
||||
|
||||
/**
|
||||
* A regex of all shortcodes currently registered by the current
|
||||
* WordPress installation
|
||||
* @uses get_shortcode_regex()
|
||||
* @return string A regex for grabbing shortcodes.
|
||||
*/
|
||||
protected function get_shortcode_regex() {
|
||||
$pattern = get_shortcode_regex();
|
||||
|
||||
// don't match markdown link anchors that could be mistaken for shortcodes.
|
||||
$pattern .= '(?!\()';
|
||||
|
||||
return "/$pattern/s";
|
||||
}
|
||||
|
||||
/**
|
||||
* Since we escape unspaced #Headings, put things back later.
|
||||
* @param string $text text with a leading escaped hash
|
||||
* @return string text with leading hashes unescaped
|
||||
*/
|
||||
protected function restore_leading_hash( $text ) {
|
||||
return preg_replace( "/^(<p>)?(#|\\\\#)/um", "$1#", $text );
|
||||
}
|
||||
|
||||
/**
|
||||
* Overload to support ```-fenced code blocks for pre-Markdown Extra 1.2.8
|
||||
* https://help.github.com/articles/github-flavored-markdown#fenced-code-blocks
|
||||
*/
|
||||
public function doFencedCodeBlocks( $text ) {
|
||||
// If we're at least at 1.2.8, native fenced code blocks are in.
|
||||
// Below is just copied from it in case we somehow got loaded on
|
||||
// top of someone else's Markdown Extra
|
||||
if ( version_compare( MARKDOWNEXTRA_VERSION, '1.2.8', '>=' ) )
|
||||
return parent::doFencedCodeBlocks( $text );
|
||||
|
||||
#
|
||||
# Adding the fenced code block syntax to regular Markdown:
|
||||
#
|
||||
# ~~~
|
||||
# Code block
|
||||
# ~~~
|
||||
#
|
||||
$less_than_tab = $this->tab_width;
|
||||
|
||||
$text = preg_replace_callback('{
|
||||
(?:\n|\A)
|
||||
# 1: Opening marker
|
||||
(
|
||||
(?:~{3,}|`{3,}) # 3 or more tildes/backticks.
|
||||
)
|
||||
[ ]*
|
||||
(?:
|
||||
\.?([-_:a-zA-Z0-9]+) # 2: standalone class name
|
||||
|
|
||||
'.$this->id_class_attr_catch_re.' # 3: Extra attributes
|
||||
)?
|
||||
[ ]* \n # Whitespace and newline following marker.
|
||||
|
||||
# 4: Content
|
||||
(
|
||||
(?>
|
||||
(?!\1 [ ]* \n) # Not a closing marker.
|
||||
.*\n+
|
||||
)+
|
||||
)
|
||||
|
||||
# Closing marker.
|
||||
\1 [ ]* (?= \n )
|
||||
}xm',
|
||||
array($this, '_doFencedCodeBlocks_callback'), $text);
|
||||
|
||||
return $text;
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback for pre-processing start of line hashes to slyly escape headings that don't
|
||||
* have a leading space
|
||||
* @param array $m preg_match matches
|
||||
* @return string possibly escaped start of line hash
|
||||
*/
|
||||
public function _doEscapeForHashWithoutSpacing( $m ) {
|
||||
if ( ! isset( $m[1] ) )
|
||||
$m[0] = '\\' . $m[0];
|
||||
return $m[0];
|
||||
}
|
||||
|
||||
/**
|
||||
* Overload to support Viper's [code] shortcode. Because awesome.
|
||||
*/
|
||||
public function _doFencedCodeBlocks_callback( $matches ) {
|
||||
// in case we have some escaped leading hashes right at the start of the block
|
||||
$matches[4] = $this->restore_leading_hash( $matches[4] );
|
||||
// just MarkdownExtra_Parser if we're not going ultra-deluxe
|
||||
if ( ! $this->use_code_shortcode ) {
|
||||
return parent::_doFencedCodeBlocks_callback( $matches );
|
||||
}
|
||||
|
||||
// default to a "text" class if one wasn't passed. Helps with encoding issues later.
|
||||
if ( empty( $matches[2] ) ) {
|
||||
$matches[2] = 'text';
|
||||
}
|
||||
|
||||
$classname =& $matches[2];
|
||||
$codeblock = preg_replace_callback('/^\n+/', array( $this, '_doFencedCodeBlocks_newlines' ), $matches[4] );
|
||||
|
||||
if ( $classname{0} == '.' )
|
||||
$classname = substr( $classname, 1 );
|
||||
|
||||
$codeblock = esc_html( $codeblock );
|
||||
$codeblock = sprintf( $this->shortcode_start, $classname ) . "\n{$codeblock}" . $this->shortcode_end;
|
||||
return "\n\n" . $this->hashBlock( $codeblock ). "\n\n";
|
||||
}
|
||||
|
||||
}
|
215
plugins/jetpack/_inc/lib/tonesque.php
Normal file
215
plugins/jetpack/_inc/lib/tonesque.php
Normal file
|
@ -0,0 +1,215 @@
|
|||
<?php
|
||||
/*
|
||||
Plugin Name: Tonesque
|
||||
Plugin URI: http://automattic.com/
|
||||
Description: Grab an average color representation from an image.
|
||||
Version: 1.0
|
||||
Author: Automattic, Matias Ventura
|
||||
Author URI: http://automattic.com/
|
||||
License: GNU General Public License v2 or later
|
||||
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*/
|
||||
|
||||
class Tonesque {
|
||||
|
||||
private $image_url = '';
|
||||
private $image_obj = NULL;
|
||||
private $color = '';
|
||||
|
||||
function __construct( $image_url ) {
|
||||
if ( ! class_exists( 'Jetpack_Color' ) )
|
||||
jetpack_require_lib( 'class.color' );
|
||||
|
||||
$this->image_url = esc_url_raw( $image_url );
|
||||
$this->image_url = trim( $this->image_url );
|
||||
/**
|
||||
* Allows any image URL to be passed in for $this->image_url.
|
||||
*
|
||||
* @module theme-tools
|
||||
*
|
||||
* @since 2.5.0
|
||||
*
|
||||
* @param string $image_url The URL to any image
|
||||
*/
|
||||
$this->image_url = apply_filters( 'tonesque_image_url', $this->image_url );
|
||||
|
||||
$this->image_obj = self::imagecreatefromurl( $this->image_url );
|
||||
}
|
||||
|
||||
public static function imagecreatefromurl( $image_url ) {
|
||||
// Grab the extension
|
||||
$file = strtolower( pathinfo( $image_url, PATHINFO_EXTENSION ) );
|
||||
$file = explode( '?', $file );
|
||||
$file = $file[ 0 ];
|
||||
|
||||
switch ( $file ) {
|
||||
case 'gif' :
|
||||
$image_obj = imagecreatefromgif( $image_url );
|
||||
break;
|
||||
case 'png' :
|
||||
$image_obj = imagecreatefrompng( $image_url );
|
||||
break;
|
||||
case 'jpg' :
|
||||
case 'jpeg' :
|
||||
$image_obj = imagecreatefromjpeg( $image_url );
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
return $image_obj;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Construct object from image.
|
||||
*
|
||||
* @param optional $type (hex, rgb, hsl)
|
||||
* @return color as a string formatted as $type
|
||||
*
|
||||
*/
|
||||
function color( $type = 'hex' ) {
|
||||
// Bail if there is no image to work with
|
||||
if ( ! $this->image_obj )
|
||||
return false;
|
||||
|
||||
// Finds dominant color
|
||||
$color = self::grab_color();
|
||||
// Passes value to Color class
|
||||
$color = self::get_color( $color, $type );
|
||||
return $color;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Grabs the color index for each of five sample points of the image
|
||||
*
|
||||
* @param $image
|
||||
* @param $type can be 'index' or 'hex'
|
||||
* @return array() with color indices
|
||||
*
|
||||
*/
|
||||
function grab_points( $type = 'index' ) {
|
||||
$img = $this->image_obj;
|
||||
if ( ! $img )
|
||||
return false;
|
||||
|
||||
$height = imagesy( $img );
|
||||
$width = imagesx( $img );
|
||||
|
||||
// Sample five points in the image
|
||||
// Based on rule of thirds and center
|
||||
$topy = round( $height / 3 );
|
||||
$bottomy = round( ( $height / 3 ) * 2 );
|
||||
$leftx = round( $width / 3 );
|
||||
$rightx = round( ( $width / 3 ) * 2 );
|
||||
$centery = round( $height / 2 );
|
||||
$centerx = round( $width / 2 );
|
||||
|
||||
// Cast those colors into an array
|
||||
$points = array(
|
||||
imagecolorat( $img, $leftx, $topy ),
|
||||
imagecolorat( $img, $rightx, $topy ),
|
||||
imagecolorat( $img, $leftx, $bottomy ),
|
||||
imagecolorat( $img, $rightx, $bottomy ),
|
||||
imagecolorat( $img, $centerx, $centery ),
|
||||
);
|
||||
|
||||
if ( 'hex' == $type ) {
|
||||
foreach ( $points as $i => $p ) {
|
||||
$c = imagecolorsforindex( $img, $p );
|
||||
$points[ $i ] = self::get_color( array(
|
||||
'r' => $c['red'],
|
||||
'g' => $c['green'],
|
||||
'b' => $c['blue'],
|
||||
), 'hex' );
|
||||
}
|
||||
}
|
||||
|
||||
return $points;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Finds the average color of the image based on five sample points
|
||||
*
|
||||
* @param $image
|
||||
* @return array() with rgb color
|
||||
*
|
||||
*/
|
||||
function grab_color() {
|
||||
$img = $this->image_obj;
|
||||
if ( ! $img )
|
||||
return false;
|
||||
|
||||
$rgb = self::grab_points();
|
||||
|
||||
// Process the color points
|
||||
// Find the average representation
|
||||
foreach ( $rgb as $color ) {
|
||||
$index = imagecolorsforindex( $img, $color );
|
||||
$r[] = $index['red'];
|
||||
$g[] = $index['green'];
|
||||
$b[] = $index['blue'];
|
||||
|
||||
$red = round( array_sum( $r ) / 5 );
|
||||
$green = round( array_sum( $g ) / 5 );
|
||||
$blue = round( array_sum( $b ) / 5 );
|
||||
}
|
||||
|
||||
// The average color of the image as rgb array
|
||||
$color = array(
|
||||
'r' => $red,
|
||||
'g' => $green,
|
||||
'b' => $blue,
|
||||
);
|
||||
|
||||
return $color;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Get a Color object using /lib class.color
|
||||
* Convert to appropriate type
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
*/
|
||||
function get_color( $color, $type ) {
|
||||
$c = new Jetpack_Color( $color, 'rgb' );
|
||||
$this->color = $c;
|
||||
|
||||
switch ( $type ) {
|
||||
case 'rgb' :
|
||||
$color = implode( $c->toRgbInt(), ',' );
|
||||
break;
|
||||
case 'hex' :
|
||||
$color = $c->toHex();
|
||||
break;
|
||||
case 'hsv' :
|
||||
$color = implode( $c->toHsvInt(), ',' );
|
||||
break;
|
||||
default:
|
||||
return $color = $c->toHex();
|
||||
}
|
||||
|
||||
return $color;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Checks contrast against main color
|
||||
* Gives either black or white for using with opacity
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
*/
|
||||
function contrast() {
|
||||
if ( ! $this->color )
|
||||
return false;
|
||||
|
||||
$c = $this->color->getMaxContrastColor();
|
||||
return implode( $c->toRgbInt(), ',' );
|
||||
}
|
||||
|
||||
};
|
168
plugins/jetpack/_inc/lib/tracks/class.tracks-client.php
Normal file
168
plugins/jetpack/_inc/lib/tracks/class.tracks-client.php
Normal file
|
@ -0,0 +1,168 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Jetpack_Tracks_Client
|
||||
* @autounit nosara tracks-client
|
||||
*
|
||||
* Send Tracks events on behalf of a user
|
||||
*
|
||||
* Example Usage:
|
||||
```php
|
||||
require( dirname(__FILE__).'path/to/tracks/class.tracks-client' );
|
||||
|
||||
$result = Jetpack_Tracks_Client::record_event( array(
|
||||
'_en' => $event_name, // required
|
||||
'_ui' => $user_id, // required unless _ul is provided
|
||||
'_ul' => $user_login, // required unless _ui is provided
|
||||
|
||||
// Optional, but recommended
|
||||
'_ts' => $ts_in_ms, // Default: now
|
||||
'_via_ip' => $client_ip, // we use it for geo, etc.
|
||||
|
||||
// Possibly useful to set some context for the event
|
||||
'_via_ua' => $client_user_agent,
|
||||
'_via_url' => $client_url,
|
||||
'_via_ref' => $client_referrer,
|
||||
|
||||
// For user-targeted tests
|
||||
'abtest_name' => $abtest_name,
|
||||
'abtest_variation' => $abtest_variation,
|
||||
|
||||
// Your application-specific properties
|
||||
'custom_property' => $some_value,
|
||||
) );
|
||||
|
||||
if ( is_wp_error( $result ) ) {
|
||||
// Handle the error in your app
|
||||
}
|
||||
```
|
||||
*/
|
||||
|
||||
require_once( dirname(__FILE__).'/class.tracks-client.php' );
|
||||
|
||||
class Jetpack_Tracks_Client {
|
||||
const PIXEL = 'http://pixel.wp.com/t.gif';
|
||||
const BROWSER_TYPE = 'php-agent';
|
||||
const USER_AGENT_SLUG = 'tracks-client';
|
||||
const VERSION = '0.3';
|
||||
|
||||
/**
|
||||
* record_event
|
||||
* @param mixed $event Event object to send to Tracks. An array will be cast to object. Required.
|
||||
* Properties are included directly in the pixel query string after light validation.
|
||||
* @return mixed True on success, WP_Error on failure
|
||||
*/
|
||||
static function record_event( $event ) {
|
||||
if ( ! $event instanceof Jetpack_Tracks_Event ) {
|
||||
$event = new Jetpack_Tracks_Event( $event );
|
||||
}
|
||||
if ( is_wp_error( $event ) ) {
|
||||
return $event;
|
||||
}
|
||||
|
||||
$pixel = $event->build_pixel_url( $event );
|
||||
|
||||
if ( ! $pixel ) {
|
||||
return new WP_Error( 'invalid_pixel', 'cannot generate tracks pixel for given input', 400 );
|
||||
}
|
||||
|
||||
return self::record_pixel( $pixel );
|
||||
}
|
||||
|
||||
/**
|
||||
* Synchronously request the pixel
|
||||
*/
|
||||
static function record_pixel( $pixel ) {
|
||||
// Add the Request Timestamp and URL terminator just before the HTTP request.
|
||||
$pixel .= '&_rt=' . self::build_timestamp() . '&_=_';
|
||||
|
||||
$response = wp_remote_get( $pixel, array(
|
||||
'blocking' => true, // The default, but being explicit here :)
|
||||
'timeout' => 1,
|
||||
'redirection' => 2,
|
||||
'httpversion' => '1.1',
|
||||
'user-agent' => self::get_user_agent(),
|
||||
) );
|
||||
|
||||
if ( is_wp_error( $response ) ) {
|
||||
return $response;
|
||||
}
|
||||
|
||||
$code = isset( $response['response']['code'] ) ? $response['response']['code'] : 0;
|
||||
|
||||
if ( $code !== 200 ) {
|
||||
return new WP_Error( 'request_failed', 'Tracks pixel request failed', $code );
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static function get_user_agent() {
|
||||
return Jetpack_Tracks_Client::USER_AGENT_SLUG . '-v' . Jetpack_Tracks_Client::VERSION;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build an event and return its tracking URL
|
||||
* @deprecated Call the `build_pixel_url` method on a Jetpack_Tracks_Event object instead.
|
||||
* @param array $event Event keys and values
|
||||
* @return string URL of a tracking pixel
|
||||
*/
|
||||
static function build_pixel_url( $event ) {
|
||||
$_event = new Jetpack_Tracks_Event( $event );
|
||||
return $_event->build_pixel_url();
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate input for a tracks event.
|
||||
* @deprecated Instantiate a Jetpack_Tracks_Event object instead
|
||||
* @param array $event Event keys and values
|
||||
* @return mixed Validated keys and values or WP_Error on failure
|
||||
*/
|
||||
private static function validate_and_sanitize( $event ) {
|
||||
$_event = new Jetpack_Tracks_Event( $event );
|
||||
if ( is_wp_error( $_event ) ) {
|
||||
return $_event;
|
||||
}
|
||||
return get_object_vars( $_event );
|
||||
}
|
||||
|
||||
// Milliseconds since 1970-01-01
|
||||
static function build_timestamp() {
|
||||
$ts = round( microtime( true ) * 1000 );
|
||||
return number_format( $ts, 0, '', '' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Grabs the user's anon id from cookies, or generates and sets a new one
|
||||
*
|
||||
* @return string An anon id for the user
|
||||
*/
|
||||
static function get_anon_id() {
|
||||
static $anon_id = null;
|
||||
|
||||
if ( ! isset( $anon_id ) ) {
|
||||
|
||||
// Did the browser send us a cookie?
|
||||
if ( isset( $_COOKIE[ 'tk_ai' ] ) && preg_match( '#^[A-Za-z0-9+/=]{24}$#', $_COOKIE[ 'tk_ai' ] ) ) {
|
||||
$anon_id = $_COOKIE[ 'tk_ai' ];
|
||||
} else {
|
||||
|
||||
$binary = '';
|
||||
|
||||
// Generate a new anonId and try to save it in the browser's cookies
|
||||
// Note that base64-encoding an 18 character string generates a 24-character anon id
|
||||
for ( $i = 0; $i < 18; ++$i ) {
|
||||
$binary .= chr( mt_rand( 0, 255 ) );
|
||||
}
|
||||
|
||||
$anon_id = 'jetpack:' . base64_encode( $binary );
|
||||
|
||||
if ( ! headers_sent() ) {
|
||||
setcookie( 'tk_ai', $anon_id );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $anon_id;
|
||||
}
|
||||
}
|
149
plugins/jetpack/_inc/lib/tracks/class.tracks-event.php
Normal file
149
plugins/jetpack/_inc/lib/tracks/class.tracks-event.php
Normal file
|
@ -0,0 +1,149 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @autounit nosara tracks-client
|
||||
*
|
||||
* Example Usage:
|
||||
```php
|
||||
require_once( dirname(__FILE__) . 'path/to/tracks/class.tracks-event' );
|
||||
|
||||
$event = new Jetpack_Tracks_Event( array(
|
||||
'_en' => $event_name, // required
|
||||
'_ui' => $user_id, // required unless _ul is provided
|
||||
'_ul' => $user_login, // required unless _ui is provided
|
||||
|
||||
// Optional, but recommended
|
||||
'_via_ip' => $client_ip, // for geo, etc.
|
||||
|
||||
// Possibly useful to set some context for the event
|
||||
'_via_ua' => $client_user_agent,
|
||||
'_via_url' => $client_url,
|
||||
'_via_ref' => $client_referrer,
|
||||
|
||||
// For user-targeted tests
|
||||
'abtest_name' => $abtest_name,
|
||||
'abtest_variation' => $abtest_variation,
|
||||
|
||||
// Your application-specific properties
|
||||
'custom_property' => $some_value,
|
||||
) );
|
||||
|
||||
if ( is_wp_error( $event->error ) ) {
|
||||
// Handle the error in your app
|
||||
}
|
||||
|
||||
$bump_and_redirect_pixel = $event->build_signed_pixel_url();
|
||||
```
|
||||
*/
|
||||
|
||||
require_once( dirname(__FILE__) . '/class.tracks-client.php' );
|
||||
|
||||
class Jetpack_Tracks_Event {
|
||||
const EVENT_NAME_REGEX = '/^(([a-z0-9]+)_){2}([a-z0-9_]+)$/';
|
||||
const PROP_NAME_REGEX = '/^[a-z_][a-z0-9_]*$/';
|
||||
public $error;
|
||||
|
||||
function __construct( $event ) {
|
||||
$_event = self::validate_and_sanitize( $event );
|
||||
if ( is_wp_error( $_event ) ) {
|
||||
$this->error = $_event;
|
||||
return;
|
||||
}
|
||||
|
||||
foreach( $_event as $key => $value ) {
|
||||
$this->{$key} = $value;
|
||||
}
|
||||
}
|
||||
|
||||
function record() {
|
||||
return Jetpack_Tracks_Client::record_event( $this );
|
||||
}
|
||||
|
||||
/**
|
||||
* Annotate the event with all relevant info.
|
||||
* @param mixed $event Object or (flat) array
|
||||
* @return mixed The transformed event array or WP_Error on failure.
|
||||
*/
|
||||
static function validate_and_sanitize( $event ) {
|
||||
$event = (object) $event;
|
||||
|
||||
// Required
|
||||
if ( ! $event->_en ) {
|
||||
return new WP_Error( 'invalid_event', 'A valid event must be specified via `_en`', 400 );
|
||||
}
|
||||
|
||||
// delete non-routable addresses otherwise geoip will discard the record entirely
|
||||
if ( property_exists( $event, '_via_ip' ) && preg_match( '/^192\.168|^10\./', $event->_via_ip ) ) {
|
||||
unset($event->_via_ip);
|
||||
}
|
||||
|
||||
$validated = array(
|
||||
'browser_type' => Jetpack_Tracks_Client::BROWSER_TYPE,
|
||||
'_aua' => Jetpack_Tracks_Client::get_user_agent(),
|
||||
);
|
||||
|
||||
$_event = (object) array_merge( (array) $event, $validated );
|
||||
|
||||
// If you want to blacklist property names, do it here.
|
||||
|
||||
// Make sure we have an event timestamp.
|
||||
if ( ! isset( $_event->_ts ) ) {
|
||||
$_event->_ts = Jetpack_Tracks_Client::build_timestamp();
|
||||
}
|
||||
|
||||
return $_event;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build a pixel URL that will send a Tracks event when fired.
|
||||
* On error, returns an empty string ('').
|
||||
*
|
||||
* @return string A pixel URL or empty string ('') if there were invalid args.
|
||||
*/
|
||||
function build_pixel_url() {
|
||||
if ( $this->error ) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$args = get_object_vars( $this );
|
||||
|
||||
// Request Timestamp and URL Terminator must be added just before the HTTP request or not at all.
|
||||
unset( $args['_rt'] );
|
||||
unset( $args['_'] );
|
||||
|
||||
$validated = self::validate_and_sanitize( $args );
|
||||
|
||||
if ( is_wp_error( $validated ) )
|
||||
return '';
|
||||
|
||||
return Jetpack_Tracks_Client::PIXEL . '?' . http_build_query( $validated );
|
||||
}
|
||||
|
||||
static function event_name_is_valid( $name ) {
|
||||
return preg_match( Jetpack_Tracks_Event::EVENT_NAME_REGEX, $name );
|
||||
}
|
||||
|
||||
static function prop_name_is_valid( $name ) {
|
||||
return preg_match( Jetpack_Tracks_Event::PROP_NAME_REGEX, $name );
|
||||
}
|
||||
|
||||
static function scrutinize_event_names( $event ) {
|
||||
if ( ! Jetpack_Tracks_Event::event_name_is_valid( $event->_en ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$whitelisted_key_names = array(
|
||||
'anonId',
|
||||
'Browser_Type',
|
||||
);
|
||||
|
||||
foreach ( array_keys( (array) $event ) as $key ) {
|
||||
if ( in_array( $key, $whitelisted_key_names ) ) {
|
||||
continue;
|
||||
}
|
||||
if ( ! Jetpack_Tracks_Event::prop_name_is_valid( $key ) ) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
124
plugins/jetpack/_inc/lib/tracks/client.php
Normal file
124
plugins/jetpack/_inc/lib/tracks/client.php
Normal file
|
@ -0,0 +1,124 @@
|
|||
<?php
|
||||
/**
|
||||
* PHP Tracks Client
|
||||
* @autounit nosara tracks-client
|
||||
* Example Usage:
|
||||
*
|
||||
```php
|
||||
include( plugin_dir_path( __FILE__ ) . 'lib/tracks/client.php');
|
||||
$result = jetpack_tracks_record_event( $user, $event_name, $properties );
|
||||
|
||||
if ( is_wp_error( $result ) ) {
|
||||
// Handle the error in your app
|
||||
}
|
||||
```
|
||||
*/
|
||||
|
||||
// Load the client classes
|
||||
require_once( dirname(__FILE__) . '/class.tracks-event.php' );
|
||||
require_once( dirname(__FILE__) . '/class.tracks-client.php' );
|
||||
|
||||
// Now, let's export a sprinkling of syntactic sugar!
|
||||
|
||||
/**
|
||||
* Procedurally (vs. Object-oriented), track an event object (or flat array)
|
||||
* NOTE: Use this only when the simpler jetpack_tracks_record_event() function won't work for you.
|
||||
* @param \Jetpack_Tracks_Event $event The event object.
|
||||
* @return \Jetpack_Tracks_Event|\WP_Error
|
||||
*/
|
||||
function jetpack_tracks_record_event_raw( $event ) {
|
||||
return Jetpack_Tracks_Client::record_event( $event );
|
||||
}
|
||||
|
||||
/**
|
||||
* Procedurally build a Tracks Event Object.
|
||||
* NOTE: Use this only when the simpler jetpack_tracks_record_event() function won't work for you.
|
||||
* @param $identity WP_user object
|
||||
* @param string $event_name The name of the event
|
||||
* @param array $properties Custom properties to send with the event
|
||||
* @param int $event_timestamp_millis The time in millis since 1970-01-01 00:00:00 when the event occurred
|
||||
* @return \Jetpack_Tracks_Event|\WP_Error
|
||||
*/
|
||||
function jetpack_tracks_build_event_obj( $user, $event_name, $properties = array(), $event_timestamp_millis = false ) {
|
||||
|
||||
$identity = jetpack_tracks_get_identity( $user->ID );
|
||||
|
||||
$properties['user_lang'] = $user->get( 'WPLANG' );
|
||||
|
||||
$blog_details = array(
|
||||
'blog_lang' => isset( $properties['blog_lang'] ) ? $properties['blog_lang'] : get_bloginfo( 'language' )
|
||||
);
|
||||
|
||||
$timestamp = ( $event_timestamp_millis !== false ) ? $event_timestamp_millis : round( microtime( true ) * 1000 );
|
||||
$timestamp_string = is_string( $timestamp ) ? $timestamp : number_format( $timestamp, 0, '', '' );
|
||||
|
||||
return new Jetpack_Tracks_Event( array_merge( $blog_details, (array) $properties, $identity, array(
|
||||
'_en' => $event_name,
|
||||
'_ts' => $timestamp_string
|
||||
) ) );
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the identity to send to tracks.
|
||||
*
|
||||
* @param int $user_id The user id of the local user
|
||||
* @return array $identity
|
||||
*/
|
||||
function jetpack_tracks_get_identity( $user_id ) {
|
||||
|
||||
// Meta is set, and user is still connected. Use WPCOM ID
|
||||
$wpcom_id = get_user_meta( $user_id, 'jetpack_tracks_wpcom_id', true );
|
||||
if ( $wpcom_id && Jetpack::is_user_connected( $user_id ) ) {
|
||||
return array(
|
||||
'_ut' => 'wpcom:user_id',
|
||||
'_ui' => $wpcom_id
|
||||
);
|
||||
}
|
||||
|
||||
// User is connected, but no meta is set yet. Use WPCOM ID and set meta.
|
||||
if ( Jetpack::is_user_connected( $user_id ) ) {
|
||||
$wpcom_user_data = Jetpack::get_connected_user_data( $user_id );
|
||||
add_user_meta( $user_id, 'jetpack_tracks_wpcom_id', $wpcom_user_data['ID'], true );
|
||||
|
||||
return array(
|
||||
'_ut' => 'wpcom:user_id',
|
||||
'_ui' => $wpcom_user_data['ID']
|
||||
);
|
||||
}
|
||||
|
||||
// User isn't linked at all. Fall back to anonymous ID.
|
||||
$anon_id = get_user_meta( $user_id, 'jetpack_tracks_anon_id', true );
|
||||
if ( ! $anon_id ) {
|
||||
$anon_id = Jetpack_Tracks_Client::get_anon_id();
|
||||
add_user_meta( $user_id, 'jetpack_tracks_anon_id', $anon_id, false );
|
||||
}
|
||||
|
||||
if ( ! isset( $_COOKIE[ 'tk_ai' ] ) && ! headers_sent() ) {
|
||||
setcookie( 'tk_ai', $anon_id );
|
||||
}
|
||||
|
||||
return array(
|
||||
'_ut' => 'anon',
|
||||
'_ui' => $anon_id
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Record an event in Tracks - this is the preferred way to record events from PHP.
|
||||
*
|
||||
* @param mixed $identity username, user_id, or WP_user object
|
||||
* @param string $event_name The name of the event
|
||||
* @param array $properties Custom properties to send with the event
|
||||
* @param int $event_timestamp_millis The time in millis since 1970-01-01 00:00:00 when the event occurred
|
||||
* @return bool true for success | \WP_Error if the event pixel could not be fired
|
||||
*/
|
||||
function jetpack_tracks_record_event( $user, $event_name, $properties = array(), $event_timestamp_millis = false ) {
|
||||
$event_obj = jetpack_tracks_build_event_obj( $user, $event_name, $properties, $event_timestamp_millis );
|
||||
|
||||
if ( is_wp_error( $event_obj->error ) ) {
|
||||
return $event_obj->error;
|
||||
}
|
||||
|
||||
return $event_obj->record();
|
||||
}
|
49
plugins/jetpack/_inc/lib/tracks/tracks-ajax.js
Normal file
49
plugins/jetpack/_inc/lib/tracks/tracks-ajax.js
Normal file
|
@ -0,0 +1,49 @@
|
|||
/* global jpTracksAJAX, jQuery */
|
||||
|
||||
(function( $, jpTracksAJAX ) {
|
||||
|
||||
$( document ).ready( function () {
|
||||
$( 'body' ).on( 'click', '.jptracks a, a.jptracks', function( event ) {
|
||||
|
||||
// We know that the jptracks element is either this, or its ancestor
|
||||
var $jptracks = $( this ).closest( '.jptracks' );
|
||||
|
||||
var data = {
|
||||
tracksNonce: jpTracksAJAX.jpTracksAJAX_nonce,
|
||||
action: 'jetpack_tracks',
|
||||
tracksEventType: 'click',
|
||||
tracksEventName: $jptracks.attr( 'data-jptracks-name' ),
|
||||
tracksEventProp: $jptracks.attr( 'data-jptracks-prop' ) || false
|
||||
};
|
||||
|
||||
// We need an event name at least
|
||||
if ( undefined === data.tracksEventName ) {
|
||||
return;
|
||||
}
|
||||
|
||||
var url = $( this ).attr( 'href' );
|
||||
var target = $( this ).get( 0 ).target;
|
||||
if ( url && target && '_self' !== target ) {
|
||||
var newTabWindow = window.open( '', target );
|
||||
}
|
||||
|
||||
event.preventDefault();
|
||||
|
||||
$.ajax( {
|
||||
type: 'POST',
|
||||
url: jpTracksAJAX.ajaxurl,
|
||||
data: data
|
||||
} ).always( function() {
|
||||
// Continue on to whatever url they were trying to get to.
|
||||
if ( url ) {
|
||||
if ( newTabWindow ) {
|
||||
newTabWindow.location = url;
|
||||
return;
|
||||
}
|
||||
window.location = url;
|
||||
}
|
||||
} );
|
||||
});
|
||||
});
|
||||
|
||||
})( jQuery, jpTracksAJAX );
|
438
plugins/jetpack/_inc/postmessage.js
Normal file
438
plugins/jetpack/_inc/postmessage.js
Normal file
|
@ -0,0 +1,438 @@
|
|||
/**
|
||||
The MIT License
|
||||
|
||||
Copyright (c) 2010 Daniel Park (http://metaweb.com, http://postmessage.freebaseapps.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
**/
|
||||
var NO_JQUERY = {};
|
||||
(function(window, $, undefined) {
|
||||
|
||||
if (!("console" in window)) {
|
||||
var c = window.console = {};
|
||||
c.log = c.warn = c.error = c.debug = function(){};
|
||||
}
|
||||
|
||||
if ($ === NO_JQUERY) {
|
||||
// jQuery is optional
|
||||
$ = {
|
||||
fn: {},
|
||||
extend: function() {
|
||||
var a = arguments[0];
|
||||
for (var i=1,len=arguments.length; i<len; i++) {
|
||||
var b = arguments[i];
|
||||
for (var prop in b) {
|
||||
a[prop] = b[prop];
|
||||
}
|
||||
}
|
||||
return a;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
$.fn.pm = function() {
|
||||
console.log("usage: \nto send: $.pm(options)\nto receive: $.pm.bind(type, fn, [origin])");
|
||||
return this;
|
||||
};
|
||||
|
||||
// send postmessage
|
||||
$.pm = window.pm = function(options) {
|
||||
pm.send(options);
|
||||
};
|
||||
|
||||
// bind postmessage handler
|
||||
$.pm.bind = window.pm.bind = function(type, fn, origin, hash, async_reply) {
|
||||
pm.bind(type, fn, origin, hash, async_reply === true);
|
||||
};
|
||||
|
||||
// unbind postmessage handler
|
||||
$.pm.unbind = window.pm.unbind = function(type, fn) {
|
||||
pm.unbind(type, fn);
|
||||
};
|
||||
|
||||
// default postmessage origin on bind
|
||||
$.pm.origin = window.pm.origin = null;
|
||||
|
||||
// default postmessage polling if using location hash to pass postmessages
|
||||
$.pm.poll = window.pm.poll = 200;
|
||||
|
||||
var pm = {
|
||||
|
||||
send: function(options) {
|
||||
var o = $.extend({}, pm.defaults, options),
|
||||
target = o.target;
|
||||
if (!o.target) {
|
||||
console.warn("postmessage target window required");
|
||||
return;
|
||||
}
|
||||
if (!o.type) {
|
||||
console.warn("postmessage type required");
|
||||
return;
|
||||
}
|
||||
var msg = {data:o.data, type:o.type};
|
||||
if (o.success) {
|
||||
msg.callback = pm._callback(o.success);
|
||||
}
|
||||
if (o.error) {
|
||||
msg.errback = pm._callback(o.error);
|
||||
}
|
||||
if (("postMessage" in target) && !o.hash) {
|
||||
pm._bind();
|
||||
target.postMessage(JSON.stringify(msg), o.origin || '*');
|
||||
}
|
||||
else {
|
||||
pm.hash._bind();
|
||||
pm.hash.send(o, msg);
|
||||
}
|
||||
},
|
||||
|
||||
bind: function(type, fn, origin, hash, async_reply) {
|
||||
pm._replyBind ( type, fn, origin, hash, async_reply );
|
||||
},
|
||||
|
||||
_replyBind: function(type, fn, origin, hash, isCallback) {
|
||||
if (("postMessage" in window) && !hash) {
|
||||
pm._bind();
|
||||
}
|
||||
else {
|
||||
pm.hash._bind();
|
||||
}
|
||||
var l = pm.data("listeners.postmessage");
|
||||
if (!l) {
|
||||
l = {};
|
||||
pm.data("listeners.postmessage", l);
|
||||
}
|
||||
var fns = l[type];
|
||||
if (!fns) {
|
||||
fns = [];
|
||||
l[type] = fns;
|
||||
}
|
||||
fns.push({fn:fn, callback: isCallback, origin:origin || $.pm.origin});
|
||||
},
|
||||
|
||||
unbind: function(type, fn) {
|
||||
var l = pm.data("listeners.postmessage");
|
||||
if (l) {
|
||||
if (type) {
|
||||
if (fn) {
|
||||
// remove specific listener
|
||||
var fns = l[type];
|
||||
if (fns) {
|
||||
var m = [];
|
||||
for (var i=0,len=fns.length; i<len; i++) {
|
||||
var o = fns[i];
|
||||
if (o.fn !== fn) {
|
||||
m.push(o);
|
||||
}
|
||||
}
|
||||
l[type] = m;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// remove all listeners by type
|
||||
delete l[type];
|
||||
}
|
||||
}
|
||||
else {
|
||||
// unbind all listeners of all type
|
||||
for (var i in l) {
|
||||
delete l[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
data: function(k, v) {
|
||||
if (v === undefined) {
|
||||
return pm._data[k];
|
||||
}
|
||||
pm._data[k] = v;
|
||||
return v;
|
||||
},
|
||||
|
||||
_data: {},
|
||||
|
||||
_CHARS: '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split(''),
|
||||
|
||||
_random: function() {
|
||||
var r = [];
|
||||
for (var i=0; i<32; i++) {
|
||||
r[i] = pm._CHARS[0 | Math.random() * 32];
|
||||
};
|
||||
return r.join("");
|
||||
},
|
||||
|
||||
_callback: function(fn) {
|
||||
var cbs = pm.data("callbacks.postmessage");
|
||||
if (!cbs) {
|
||||
cbs = {};
|
||||
pm.data("callbacks.postmessage", cbs);
|
||||
}
|
||||
var r = pm._random();
|
||||
cbs[r] = fn;
|
||||
return r;
|
||||
},
|
||||
|
||||
_bind: function() {
|
||||
// are we already listening to message events on this w?
|
||||
if (!pm.data("listening.postmessage")) {
|
||||
if (window.addEventListener) {
|
||||
window.addEventListener("message", pm._dispatch, false);
|
||||
}
|
||||
else if (window.attachEvent) {
|
||||
window.attachEvent("onmessage", pm._dispatch);
|
||||
}
|
||||
pm.data("listening.postmessage", 1);
|
||||
}
|
||||
},
|
||||
|
||||
_dispatch: function(e) {
|
||||
//console.log("$.pm.dispatch", e, this);
|
||||
try {
|
||||
var msg = JSON.parse(e.data);
|
||||
}
|
||||
catch (ex) {
|
||||
//console.warn("postmessage data invalid json: ", ex); //message wasn't meant for pm
|
||||
return;
|
||||
}
|
||||
if (!msg.type) {
|
||||
//console.warn("postmessage message type required"); //message wasn't meant for pm
|
||||
return;
|
||||
}
|
||||
var cbs = pm.data("callbacks.postmessage") || {},
|
||||
cb = cbs[msg.type];
|
||||
if (cb) {
|
||||
cb(msg.data);
|
||||
}
|
||||
else {
|
||||
var l = pm.data("listeners.postmessage") || {};
|
||||
var fns = l[msg.type] || [];
|
||||
for (var i=0,len=fns.length; i<len; i++) {
|
||||
var o = fns[i];
|
||||
if (o.origin && o.origin !== '*' && e.origin !== o.origin) {
|
||||
console.warn("postmessage message origin mismatch", e.origin, o.origin);
|
||||
if (msg.errback) {
|
||||
// notify post message errback
|
||||
var error = {
|
||||
message: "postmessage origin mismatch",
|
||||
origin: [e.origin, o.origin]
|
||||
};
|
||||
pm.send({target:e.source, data:error, type:msg.errback});
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
function sendReply ( data ) {
|
||||
if (msg.callback) {
|
||||
pm.send({target:e.source, data:data, type:msg.callback});
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
if ( o.callback ) {
|
||||
o.fn(msg.data, sendReply, e);
|
||||
} else {
|
||||
sendReply ( o.fn(msg.data, e) );
|
||||
}
|
||||
}
|
||||
catch (ex) {
|
||||
if (msg.errback) {
|
||||
// notify post message errback
|
||||
pm.send({target:e.source, data:ex, type:msg.errback});
|
||||
} else {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// location hash polling
|
||||
pm.hash = {
|
||||
|
||||
send: function(options, msg) {
|
||||
//console.log("hash.send", target_window, options, msg);
|
||||
var target_window = options.target,
|
||||
target_url = options.url;
|
||||
if (!target_url) {
|
||||
console.warn("postmessage target window url is required");
|
||||
return;
|
||||
}
|
||||
target_url = pm.hash._url(target_url);
|
||||
var source_window,
|
||||
source_url = pm.hash._url(window.location.href);
|
||||
if (window == target_window.parent) {
|
||||
source_window = "parent";
|
||||
}
|
||||
else {
|
||||
try {
|
||||
for (var i=0,len=parent.frames.length; i<len; i++) {
|
||||
var f = parent.frames[i];
|
||||
if (f == window) {
|
||||
source_window = i;
|
||||
break;
|
||||
}
|
||||
};
|
||||
}
|
||||
catch(ex) {
|
||||
// Opera: security error trying to access parent.frames x-origin
|
||||
// juse use window.name
|
||||
source_window = window.name;
|
||||
}
|
||||
}
|
||||
if (source_window == null) {
|
||||
console.warn("postmessage windows must be direct parent/child windows and the child must be available through the parent window.frames list");
|
||||
return;
|
||||
}
|
||||
var hashmessage = {
|
||||
"x-requested-with": "postmessage",
|
||||
source: {
|
||||
name: source_window,
|
||||
url: source_url
|
||||
},
|
||||
postmessage: msg
|
||||
};
|
||||
var hash_id = "#x-postmessage-id=" + pm._random();
|
||||
target_window.location = target_url + hash_id + encodeURIComponent(JSON.stringify(hashmessage));
|
||||
},
|
||||
|
||||
_regex: /^\#x\-postmessage\-id\=(\w{32})/,
|
||||
|
||||
_regex_len: "#x-postmessage-id=".length + 32,
|
||||
|
||||
_bind: function() {
|
||||
// are we already listening to message events on this w?
|
||||
if (!pm.data("polling.postmessage")) {
|
||||
setInterval(function() {
|
||||
var hash = "" + window.location.hash,
|
||||
m = pm.hash._regex.exec(hash);
|
||||
if (m) {
|
||||
var id = m[1];
|
||||
if (pm.hash._last !== id) {
|
||||
pm.hash._last = id;
|
||||
pm.hash._dispatch(hash.substring(pm.hash._regex_len));
|
||||
}
|
||||
}
|
||||
}, $.pm.poll || 200);
|
||||
pm.data("polling.postmessage", 1);
|
||||
}
|
||||
},
|
||||
|
||||
_dispatch: function(hash) {
|
||||
if (!hash) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
hash = JSON.parse(decodeURIComponent(hash));
|
||||
if (!(hash['x-requested-with'] === 'postmessage' &&
|
||||
hash.source && hash.source.name != null && hash.source.url && hash.postmessage)) {
|
||||
// ignore since hash could've come from somewhere else
|
||||
return;
|
||||
}
|
||||
}
|
||||
catch (ex) {
|
||||
// ignore since hash could've come from somewhere else
|
||||
return;
|
||||
}
|
||||
var msg = hash.postmessage,
|
||||
cbs = pm.data("callbacks.postmessage") || {},
|
||||
cb = cbs[msg.type];
|
||||
if (cb) {
|
||||
cb(msg.data);
|
||||
}
|
||||
else {
|
||||
var source_window;
|
||||
if (hash.source.name === "parent") {
|
||||
source_window = window.parent;
|
||||
}
|
||||
else {
|
||||
source_window = window.frames[hash.source.name];
|
||||
}
|
||||
var l = pm.data("listeners.postmessage") || {};
|
||||
var fns = l[msg.type] || [];
|
||||
for (var i=0,len=fns.length; i<len; i++) {
|
||||
var o = fns[i];
|
||||
if (o.origin) {
|
||||
var origin = /https?\:\/\/[^\/]*/.exec(hash.source.url)[0];
|
||||
if (o.origin !== '*' && origin !== o.origin) {
|
||||
console.warn("postmessage message origin mismatch", origin, o.origin);
|
||||
if (msg.errback) {
|
||||
// notify post message errback
|
||||
var error = {
|
||||
message: "postmessage origin mismatch",
|
||||
origin: [origin, o.origin]
|
||||
};
|
||||
pm.send({target:source_window, data:error, type:msg.errback, hash:true, url:hash.source.url});
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
function sendReply ( data ) {
|
||||
if (msg.callback) {
|
||||
pm.send({target:source_window, data:data, type:msg.callback, hash:true, url:hash.source.url});
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
if ( o.callback ) {
|
||||
o.fn(msg.data, sendReply);
|
||||
} else {
|
||||
sendReply ( o.fn(msg.data) );
|
||||
}
|
||||
}
|
||||
catch (ex) {
|
||||
if (msg.errback) {
|
||||
// notify post message errback
|
||||
pm.send({target:source_window, data:ex, type:msg.errback, hash:true, url:hash.source.url});
|
||||
} else {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
},
|
||||
|
||||
_url: function(url) {
|
||||
// url minus hash part
|
||||
return (""+url).replace(/#.*$/, "");
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
$.extend(pm, {
|
||||
defaults: {
|
||||
target: null, /* target window (required) */
|
||||
url: null, /* target window url (required if no window.postMessage or hash == true) */
|
||||
type: null, /* message type (required) */
|
||||
data: null, /* message data (required) */
|
||||
success: null, /* success callback (optional) */
|
||||
error: null, /* error callback (optional) */
|
||||
origin: "*", /* postmessage origin (optional) */
|
||||
hash: false /* use location hash for message passing (optional) */
|
||||
}
|
||||
});
|
||||
|
||||
})(this, typeof jQuery === "undefined" ? NO_JQUERY : jQuery);
|
||||
|
||||
/**
|
||||
* http://www.JSON.org/json2.js
|
||||
**/
|
||||
if (! ("JSON" in window && window.JSON)){JSON={}}(function(){function f(n){return n<10?"0"+n:n}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(key){return this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z"};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf()}}var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==="string"?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+string+'"'}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==="object"&&typeof value.toJSON==="function"){value=value.toJSON(key)}if(typeof rep==="function"){value=rep.call(holder,key,value)}switch(typeof value){case"string":return quote(value);case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value){return"null"}gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==="[object Array]"){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||"null"}v=partial.length===0?"[]":gap?"[\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"]":"["+partial.join(",")+"]";gap=mind;return v}if(rep&&typeof rep==="object"){length=rep.length;for(i=0;i<length;i+=1){k=rep[i];if(typeof k==="string"){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}else{for(k in value){if(Object.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}v=partial.length===0?"{}":gap?"{\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"}":"{"+partial.join(",")+"}";gap=mind;return v}}if(typeof JSON.stringify!=="function"){JSON.stringify=function(value,replacer,space){var i;gap="";indent="";if(typeof space==="number"){for(i=0;i<space;i+=1){indent+=" "}}else{if(typeof space==="string"){indent=space}}rep=replacer;if(replacer&&typeof replacer!=="function"&&(typeof replacer!=="object"||typeof replacer.length!=="number")){throw new Error("JSON.stringify")}return str("",{"":value})}}if(typeof JSON.parse!=="function"){JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==="object"){for(k in value){if(Object.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v}else{delete value[k]}}}}return reviver.call(holder,key,value)}cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})}if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+text+")");return typeof reviver==="function"?walk({"":j},""):j}throw new SyntaxError("JSON.parse")}}}());
|
349
plugins/jetpack/_inc/spin.js
Normal file
349
plugins/jetpack/_inc/spin.js
Normal file
|
@ -0,0 +1,349 @@
|
|||
//fgnass.github.com/spin.js#v1.3
|
||||
|
||||
/**
|
||||
* Copyright (c) 2011-2013 Felix Gnass
|
||||
* Licensed under the MIT license
|
||||
*/
|
||||
(function(root, factory) {
|
||||
|
||||
/* CommonJS */
|
||||
if (typeof exports == 'object') module.exports = factory()
|
||||
|
||||
/* AMD module */
|
||||
else if (typeof define == 'function' && define.amd) define(factory)
|
||||
|
||||
/* Browser global */
|
||||
else root.Spinner = factory()
|
||||
}
|
||||
(this, function() {
|
||||
"use strict";
|
||||
|
||||
var prefixes = ['webkit', 'Moz', 'ms', 'O'] /* Vendor prefixes */
|
||||
, animations = {} /* Animation rules keyed by their name */
|
||||
, useCssAnimations /* Whether to use CSS animations or setTimeout */
|
||||
|
||||
/**
|
||||
* Utility function to create elements. If no tag name is given,
|
||||
* a DIV is created. Optionally properties can be passed.
|
||||
*/
|
||||
function createEl(tag, prop) {
|
||||
var el = document.createElement(tag || 'div')
|
||||
, n
|
||||
|
||||
for(n in prop) el[n] = prop[n]
|
||||
return el
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends children and returns the parent.
|
||||
*/
|
||||
function ins(parent /* child1, child2, ...*/) {
|
||||
for (var i=1, n=arguments.length; i<n; i++)
|
||||
parent.appendChild(arguments[i])
|
||||
|
||||
return parent
|
||||
}
|
||||
|
||||
/**
|
||||
* Insert a new stylesheet to hold the @keyframe or VML rules.
|
||||
*/
|
||||
var sheet = (function() {
|
||||
var el = createEl('style', {type : 'text/css'})
|
||||
ins(document.getElementsByTagName('head')[0], el)
|
||||
return el.sheet || el.styleSheet
|
||||
}())
|
||||
|
||||
/**
|
||||
* Creates an opacity keyframe animation rule and returns its name.
|
||||
* Since most mobile Webkits have timing issues with animation-delay,
|
||||
* we create separate rules for each line/segment.
|
||||
*/
|
||||
function addAnimation(alpha, trail, i, lines) {
|
||||
var name = ['opacity', trail, ~~(alpha*100), i, lines].join('-')
|
||||
, start = 0.01 + i/lines * 100
|
||||
, z = Math.max(1 - (1-alpha) / trail * (100-start), alpha)
|
||||
, prefix = useCssAnimations.substring(0, useCssAnimations.indexOf('Animation')).toLowerCase()
|
||||
, pre = prefix && '-' + prefix + '-' || ''
|
||||
|
||||
if (!animations[name]) {
|
||||
sheet.insertRule(
|
||||
'@' + pre + 'keyframes ' + name + '{' +
|
||||
'0%{opacity:' + z + '}' +
|
||||
start + '%{opacity:' + alpha + '}' +
|
||||
(start+0.01) + '%{opacity:1}' +
|
||||
(start+trail) % 100 + '%{opacity:' + alpha + '}' +
|
||||
'100%{opacity:' + z + '}' +
|
||||
'}', sheet.cssRules.length)
|
||||
|
||||
animations[name] = 1
|
||||
}
|
||||
|
||||
return name
|
||||
}
|
||||
|
||||
/**
|
||||
* Tries various vendor prefixes and returns the first supported property.
|
||||
*/
|
||||
function vendor(el, prop) {
|
||||
var s = el.style
|
||||
, pp
|
||||
, i
|
||||
|
||||
if(s[prop] !== undefined) return prop
|
||||
prop = prop.charAt(0).toUpperCase() + prop.slice(1)
|
||||
for(i=0; i<prefixes.length; i++) {
|
||||
pp = prefixes[i]+prop
|
||||
if(s[pp] !== undefined) return pp
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets multiple style properties at once.
|
||||
*/
|
||||
function css(el, prop) {
|
||||
for (var n in prop)
|
||||
el.style[vendor(el, n)||n] = prop[n]
|
||||
|
||||
return el
|
||||
}
|
||||
|
||||
/**
|
||||
* Fills in default values.
|
||||
*/
|
||||
function merge(obj) {
|
||||
for (var i=1; i < arguments.length; i++) {
|
||||
var def = arguments[i]
|
||||
for (var n in def)
|
||||
if (obj[n] === undefined) obj[n] = def[n]
|
||||
}
|
||||
return obj
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the absolute page-offset of the given element.
|
||||
*/
|
||||
function pos(el) {
|
||||
var o = { x:el.offsetLeft, y:el.offsetTop }
|
||||
while((el = el.offsetParent))
|
||||
o.x+=el.offsetLeft, o.y+=el.offsetTop
|
||||
|
||||
return o
|
||||
}
|
||||
|
||||
// Built-in defaults
|
||||
|
||||
var defaults = {
|
||||
lines: 12, // The number of lines to draw
|
||||
length: 7, // The length of each line
|
||||
width: 5, // The line thickness
|
||||
radius: 10, // The radius of the inner circle
|
||||
rotate: 0, // Rotation offset
|
||||
corners: 1, // Roundness (0..1)
|
||||
color: '#000', // #rgb or #rrggbb
|
||||
direction: 1, // 1: clockwise, -1: counterclockwise
|
||||
speed: 1, // Rounds per second
|
||||
trail: 100, // Afterglow percentage
|
||||
opacity: 1/4, // Opacity of the lines
|
||||
fps: 20, // Frames per second when using setTimeout()
|
||||
zIndex: 2e9, // Use a high z-index by default
|
||||
className: 'spinner', // CSS class to assign to the element
|
||||
top: 'auto', // center vertically
|
||||
left: 'auto', // center horizontally
|
||||
position: 'relative' // element position
|
||||
}
|
||||
|
||||
/** The constructor */
|
||||
function Spinner(o) {
|
||||
if (typeof this == 'undefined') return new Spinner(o)
|
||||
this.opts = merge(o || {}, Spinner.defaults, defaults)
|
||||
}
|
||||
|
||||
// Global defaults that override the built-ins:
|
||||
Spinner.defaults = {}
|
||||
|
||||
merge(Spinner.prototype, {
|
||||
|
||||
/**
|
||||
* Adds the spinner to the given target element. If this instance is already
|
||||
* spinning, it is automatically removed from its previous target b calling
|
||||
* stop() internally.
|
||||
*/
|
||||
spin: function(target) {
|
||||
this.stop()
|
||||
|
||||
var self = this
|
||||
, o = self.opts
|
||||
, el = self.el = css(createEl(0, {className: o.className}), {position: o.position, width: 0, zIndex: o.zIndex})
|
||||
, mid = o.radius+o.length+o.width
|
||||
, ep // element position
|
||||
, tp // target position
|
||||
|
||||
if (target) {
|
||||
target.insertBefore(el, target.firstChild||null)
|
||||
tp = pos(target)
|
||||
ep = pos(el)
|
||||
css(el, {
|
||||
left: (o.left == 'auto' ? tp.x-ep.x + (target.offsetWidth >> 1) : parseInt(o.left, 10) + mid) + 'px',
|
||||
top: (o.top == 'auto' ? tp.y-ep.y + (target.offsetHeight >> 1) : parseInt(o.top, 10) + mid) + 'px'
|
||||
})
|
||||
}
|
||||
|
||||
el.setAttribute('role', 'progressbar')
|
||||
self.lines(el, self.opts)
|
||||
|
||||
if (!useCssAnimations) {
|
||||
// No CSS animation support, use setTimeout() instead
|
||||
var i = 0
|
||||
, start = (o.lines - 1) * (1 - o.direction) / 2
|
||||
, alpha
|
||||
, fps = o.fps
|
||||
, f = fps/o.speed
|
||||
, ostep = (1-o.opacity) / (f*o.trail / 100)
|
||||
, astep = f/o.lines
|
||||
|
||||
;(function anim() {
|
||||
i++;
|
||||
for (var j = 0; j < o.lines; j++) {
|
||||
alpha = Math.max(1 - (i + (o.lines - j) * astep) % f * ostep, o.opacity)
|
||||
|
||||
self.opacity(el, j * o.direction + start, alpha, o)
|
||||
}
|
||||
self.timeout = self.el && setTimeout(anim, ~~(1000/fps))
|
||||
})()
|
||||
}
|
||||
return self
|
||||
},
|
||||
|
||||
/**
|
||||
* Stops and removes the Spinner.
|
||||
*/
|
||||
stop: function() {
|
||||
var el = this.el
|
||||
if (el) {
|
||||
clearTimeout(this.timeout)
|
||||
if (el.parentNode) el.parentNode.removeChild(el)
|
||||
this.el = undefined
|
||||
}
|
||||
return this
|
||||
},
|
||||
|
||||
/**
|
||||
* Internal method that draws the individual lines. Will be overwritten
|
||||
* in VML fallback mode below.
|
||||
*/
|
||||
lines: function(el, o) {
|
||||
var i = 0
|
||||
, start = (o.lines - 1) * (1 - o.direction) / 2
|
||||
, seg
|
||||
|
||||
function fill(color, shadow) {
|
||||
return css(createEl(), {
|
||||
position: 'absolute',
|
||||
width: (o.length+o.width) + 'px',
|
||||
height: o.width + 'px',
|
||||
background: color,
|
||||
boxShadow: shadow,
|
||||
transformOrigin: 'left',
|
||||
transform: 'rotate(' + ~~(360/o.lines*i+o.rotate) + 'deg) translate(' + o.radius+'px' +',0)',
|
||||
borderRadius: (o.corners * o.width>>1) + 'px'
|
||||
})
|
||||
}
|
||||
|
||||
for (; i < o.lines; i++) {
|
||||
seg = css(createEl(), {
|
||||
position: 'absolute',
|
||||
top: 1+~(o.width/2) + 'px',
|
||||
transform: o.hwaccel ? 'translate3d(0,0,0)' : '',
|
||||
opacity: o.opacity,
|
||||
animation: useCssAnimations && addAnimation(o.opacity, o.trail, start + i * o.direction, o.lines) + ' ' + 1/o.speed + 's linear infinite'
|
||||
})
|
||||
|
||||
if (o.shadow) ins(seg, css(fill('#000', '0 0 4px ' + '#000'), {top: 2+'px'}))
|
||||
|
||||
ins(el, ins(seg, fill(o.color, '0 0 1px rgba(0,0,0,.1)')))
|
||||
}
|
||||
return el
|
||||
},
|
||||
|
||||
/**
|
||||
* Internal method that adjusts the opacity of a single line.
|
||||
* Will be overwritten in VML fallback mode below.
|
||||
*/
|
||||
opacity: function(el, i, val) {
|
||||
if (i < el.childNodes.length) el.childNodes[i].style.opacity = val
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
|
||||
function initVML() {
|
||||
|
||||
/* Utility function to create a VML tag */
|
||||
function vml(tag, attr) {
|
||||
return createEl('<' + tag + ' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">', attr)
|
||||
}
|
||||
|
||||
// No CSS transforms but VML support, add a CSS rule for VML elements:
|
||||
sheet.addRule('.spin-vml', 'behavior:url(#default#VML)')
|
||||
|
||||
Spinner.prototype.lines = function(el, o) {
|
||||
var r = o.length+o.width
|
||||
, s = 2*r
|
||||
|
||||
function grp() {
|
||||
return css(
|
||||
vml('group', {
|
||||
coordsize: s + ' ' + s,
|
||||
coordorigin: -r + ' ' + -r
|
||||
}),
|
||||
{ width: s, height: s }
|
||||
)
|
||||
}
|
||||
|
||||
var margin = -(o.width+o.length)*2 + 'px'
|
||||
, g = css(grp(), {position: 'absolute', top: margin, left: margin})
|
||||
, i
|
||||
|
||||
function seg(i, dx, filter) {
|
||||
ins(g,
|
||||
ins(css(grp(), {rotation: 360 / o.lines * i + 'deg', left: ~~dx}),
|
||||
ins(css(vml('roundrect', {arcsize: o.corners}), {
|
||||
width: r,
|
||||
height: o.width,
|
||||
left: o.radius,
|
||||
top: -o.width>>1,
|
||||
filter: filter
|
||||
}),
|
||||
vml('fill', {color: o.color, opacity: o.opacity}),
|
||||
vml('stroke', {opacity: 0}) // transparent stroke to fix color bleeding upon opacity change
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
if (o.shadow)
|
||||
for (i = 1; i <= o.lines; i++)
|
||||
seg(i, -2, 'progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)')
|
||||
|
||||
for (i = 1; i <= o.lines; i++) seg(i)
|
||||
return ins(el, g)
|
||||
}
|
||||
|
||||
Spinner.prototype.opacity = function(el, i, val, o) {
|
||||
var c = el.firstChild
|
||||
o = o.shadow && o.lines || 0
|
||||
if (c && i+o < c.childNodes.length) {
|
||||
c = c.childNodes[i+o]; c = c && c.firstChild; c = c && c.firstChild
|
||||
if (c) c.opacity = val
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var probe = css(createEl('group'), {behavior: 'url(#default#VML)'})
|
||||
|
||||
if (!vendor(probe, 'transform') && probe.adj) initVML()
|
||||
else useCssAnimations = vendor(probe, 'animation')
|
||||
|
||||
return Spinner
|
||||
|
||||
}));
|
10
plugins/jetpack/_inc/twitter-timeline.js
Normal file
10
plugins/jetpack/_inc/twitter-timeline.js
Normal file
|
@ -0,0 +1,10 @@
|
|||
/* jshint ignore:start */
|
||||
!function(d,s,id){
|
||||
var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';
|
||||
if(!d.getElementById(id)){
|
||||
js=d.createElement(s);
|
||||
js.id=id;js.src=p+"://platform.twitter.com/widgets.js";
|
||||
fjs.parentNode.insertBefore(js,fjs);
|
||||
}
|
||||
}(document,"script","twitter-wjs");
|
||||
/* jshint ignore:end */
|
Reference in a new issue