<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[8550] sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks: WordCamp Block: Applied coding standards for JavaScript</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="http://meta.trac.wordpress.org/changeset/8550">8550</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"http://meta.trac.wordpress.org/changeset/8550","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>vedjain</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2019-03-28 13:36:34 +0000 (Thu, 28 Mar 2019)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>WordCamp Block: Applied coding standards for JavaScript</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentmupluginsblocksassetssrcorganizerseditjs">sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/assets/src/organizers/edit.js</a></li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentmupluginsblocksassetssrcsessionsblockcontentjs">sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/assets/src/sessions/block-content.js</a></li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentmupluginsblocksassetssrcsessionsinspectorcontrolsjs">sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/assets/src/sessions/inspector-controls.js</a></li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentmupluginsblocksassetssrcsharedfeaturedimageindexjs">sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/assets/src/shared/featured-image/index.js</a></li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentmupluginsblocksassetssrcsharedfeaturedimageinspectorcontroljs">sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/assets/src/shared/featured-image/inspector-control.js</a></li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentmupluginsblocksassetssrcsharedgridlayoutblockcontentjs">sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/assets/src/shared/grid-layout/block-content.js</a></li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentmupluginsblocksassetssrcsharedgridlayoutinspectorcontroljs">sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/assets/src/shared/grid-layout/inspector-control.js</a></li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentmupluginsblocksassetssrcsharedgridlayouttoolbarjs">sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/assets/src/shared/grid-layout/toolbar.js</a></li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentmupluginsblocksassetssrcsponsorsblockcontentjs">sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/assets/src/sponsors/block-content.js</a></li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentmupluginsblocksassetssrcsponsorsblockcontrolsjs">sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/assets/src/sponsors/block-controls.js</a></li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentmupluginsblocksassetssrcsponsorseditjs">sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/assets/src/sponsors/edit.js</a></li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentmupluginsblocksassetssrcsponsorsinspectorcontrolsjs">sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/assets/src/sponsors/inspector-controls.js</a></li>
<li><a href="#sitestrunkwordcamporgpublic_htmlwpcontentmupluginsblockswebpackconfigjs">sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/webpack.config.js</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentmupluginsblocksassetssrcorganizerseditjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/assets/src/organizers/edit.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/assets/src/organizers/edit.js 2019-03-27 22:41:24 UTC (rev 8549)
+++ sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/assets/src/organizers/edit.js 2019-03-28 13:36:34 UTC (rev 8550)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -117,7 +117,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return {
</span><span class="cx" style="display: block; padding: 0 10px"> blockData,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- organizerPosts : getEntityRecords( 'postType', 'wcb_organizer', organizersQuery ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ organizerPosts: getEntityRecords( 'postType', 'wcb_organizer', organizersQuery ),
</ins><span class="cx" style="display: block; padding: 0 10px"> };
</span><span class="cx" style="display: block; padding: 0 10px"> };
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentmupluginsblocksassetssrcsessionsblockcontentjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/assets/src/sessions/block-content.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/assets/src/sessions/block-content.js 2019-03-27 22:41:24 UTC (rev 8549)
+++ sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/assets/src/sessions/block-content.js 2019-03-28 13:36:34 UTC (rev 8550)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -163,10 +163,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> { show_images &&
</span><span class="cx" style="display: block; padding: 0 10px"> <FeaturedImage
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- className={'wordcamp-session-image-container align-' + decodeEntities( image_align ) }
- size={featuredImageSize}
- wpMediaDetails={ get( post, "_embedded.wp:featuredmedia[0].media_details.sizes", {} ) }
- alt={post.title.rendered}
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ className={ 'wordcamp-session-image-container align-' + decodeEntities( image_align ) }
+ size={ featuredImageSize }
+ wpMediaDetails={ get( post, '_embedded.wp:featuredmedia[0].media_details.sizes', {} ) }
+ alt={ post.title.rendered }
</ins><span class="cx" style="display: block; padding: 0 10px"> { ...this.props }
</span><span class="cx" style="display: block; padding: 0 10px"> />
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentmupluginsblocksassetssrcsessionsinspectorcontrolsjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/assets/src/sessions/inspector-controls.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/assets/src/sessions/inspector-controls.js 2019-03-27 22:41:24 UTC (rev 8549)
+++ sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/assets/src/sessions/inspector-controls.js 2019-03-28 13:36:34 UTC (rev 8550)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -67,9 +67,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> </PanelBody>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <FeaturedImageInspectorControls
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- title = { __( 'Image size', 'wordcamporg' ) }
- help = { __( 'Specify image height and width, or select a predefined size.', 'wordcamporg' ) }
- selectLabel = { __( 'Size', 'wordcamporg') }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ title={ __( 'Image size', 'wordcamporg' ) }
+ help={ __( 'Specify image height and width, or select a predefined size.', 'wordcamporg' ) }
+ selectLabel={ __( 'Size', 'wordcamporg' ) }
</ins><span class="cx" style="display: block; padding: 0 10px"> { ...this.props }
</span><span class="cx" style="display: block; padding: 0 10px"> />
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentmupluginsblocksassetssrcsharedfeaturedimageindexjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/assets/src/shared/featured-image/index.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/assets/src/shared/featured-image/index.js 2019-03-27 22:41:24 UTC (rev 8549)
+++ sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/assets/src/shared/featured-image/index.js 2019-03-28 13:36:34 UTC (rev 8550)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -12,7 +12,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Displays featured image, can be linked with block control for size.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> export default class FeaturedImage extends Component {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * @param props Props for function.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param props.wpMediaDetails Available sizes of images in the format as returned by WP API. This is the `sizes` object inside `media_details` inside `wp:featuredMedia` object.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -30,7 +29,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Get 'full' size image to be displayed in editor. Or get the widest one.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> getFullImage() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><span class="cx" style="display: block; padding: 0 10px"> const availableSizes = this.props.wpMediaDetails;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> const { selectedImage } = this.state;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -39,12 +37,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return selectedImage;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( availableSizes.hasOwnProperty( 'full' ) && availableSizes['full'].hasOwnProperty( 'source_url' ) ) {
- this.setState( { selectedImage: availableSizes['full'] } );
- return availableSizes[ 'full' ];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( availableSizes.hasOwnProperty( 'full' ) && availableSizes.full.hasOwnProperty( 'source_url' ) ) {
+ this.setState( { selectedImage: availableSizes.full } );
+ return availableSizes.full;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- let widestImage = { source_url : '' };
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ let widestImage = { source_url: '' };
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> for ( const size in availableSizes ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! availableSizes.hasOwnProperty( size ) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -51,7 +49,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> continue;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( availableSizes[ size ]['width'] > ( widestImage[ 'width '] || 0 ) && availableSizes[ size ].hasOwnProperty( 'source_url' ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( availableSizes[ size ].width > ( widestImage[ 'width' ] || 0 ) && availableSizes[ size ].hasOwnProperty( 'source_url' ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> widestImage = availableSizes[ size ];
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -64,7 +62,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Renders FeaturedImage component.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @returns {*}
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return {*}
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> render() {
</span><span class="cx" style="display: block; padding: 0 10px"> const { className, alt, attributes } = this.props;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -72,15 +70,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> const { featured_image_width } = attributes;
</span><span class="cx" style="display: block; padding: 0 10px"> const image = this.getFullImage();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- const width = featured_image_width || 150 ;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ const width = featured_image_width || 150;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return (
</ins><span class="cx" style="display: block; padding: 0 10px"> <img
</span><span class="cx" style="display: block; padding: 0 10px"> className={ classnames( 'wordcamp-featured-image', className ) }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- src = { image['source_url'] }
- alt = { alt }
- width = { width + 'px' }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ src={ image.source_url }
+ alt={ alt }
+ width={ width + 'px' }
</ins><span class="cx" style="display: block; padding: 0 10px"> />
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentmupluginsblocksassetssrcsharedfeaturedimageinspectorcontroljs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/assets/src/shared/featured-image/inspector-control.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/assets/src/shared/featured-image/inspector-control.js 2019-03-27 22:41:24 UTC (rev 8549)
+++ sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/assets/src/shared/featured-image/inspector-control.js 2019-03-28 13:36:34 UTC (rev 8550)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -33,7 +33,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> label : __( '(Custom)', 'wordcamporg' ),
</span><span class="cx" style="display: block; padding: 0 10px"> value : '',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ },
</ins><span class="cx" style="display: block; padding: 0 10px"> ];
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -40,9 +40,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Implements inspector control for FeaturedImage component defined in ./index.js. Uses and sets attribute `featured_image_height` and `featured_image_width`.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> class FeaturedImageInspectorControls extends Component {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><span class="cx" style="display: block; padding: 0 10px"> componentWillMount() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- this.availableSizes = sizePresets.map( (size) => size.value );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ this.availableSizes = sizePresets.map( ( size ) => size.value );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> onPresetSizeSelect( size ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -54,18 +53,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> render() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><span class="cx" style="display: block; padding: 0 10px"> const { attributes, setAttributes, title, help, selectLabel, cropLabel } = this.props;
</span><span class="cx" style="display: block; padding: 0 10px"> const { featured_image_width } = attributes;
</span><span class="cx" style="display: block; padding: 0 10px"> const selectedValue = this.availableSizes.indexOf( featured_image_width.toString() ) === -1 ? '' : featured_image_width.toString();
</span><span class="cx" style="display: block; padding: 0 10px"> return (
</span><span class="cx" style="display: block; padding: 0 10px"> <PanelBody
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- title = { title }
- initialopen = { false }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ title={ title }
+ initialopen={ false }
</ins><span class="cx" style="display: block; padding: 0 10px"> >
</span><span class="cx" style="display: block; padding: 0 10px"> <PanelRow>
</span><span class="cx" style="display: block; padding: 0 10px"> <BaseControl
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- help = { help }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ help={ help }
</ins><span class="cx" style="display: block; padding: 0 10px"> >
</span><span class="cx" style="display: block; padding: 0 10px"> <PanelRow>
</span><span class="cx" style="display: block; padding: 0 10px"> <SelectControl
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -77,10 +75,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> </PanelRow>
</span><span class="cx" style="display: block; padding: 0 10px"> <PanelRow>
</span><span class="cx" style="display: block; padding: 0 10px"> <TextControl
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- label = { __('Width (in px)', 'wordcamporg' ) }
- type = 'number'
- value = { featured_image_width }
- onChange = { ( width ) => setAttributes( { featured_image_width: Number( width ) } ) }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ label={ __( 'Width (in px)', 'wordcamporg' ) }
+ type="number"
+ value={ featured_image_width }
+ onChange={ ( width ) => setAttributes( { featured_image_width: Number( width ) } ) }
</ins><span class="cx" style="display: block; padding: 0 10px"> />
</span><span class="cx" style="display: block; padding: 0 10px"> </PanelRow>
</span><span class="cx" style="display: block; padding: 0 10px"> </BaseControl>
</span></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentmupluginsblocksassetssrcsharedgridlayoutblockcontentjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/assets/src/shared/grid-layout/block-content.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/assets/src/shared/grid-layout/block-content.js 2019-03-27 22:41:24 UTC (rev 8549)
+++ sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/assets/src/shared/grid-layout/block-content.js 2019-03-28 13:36:34 UTC (rev 8550)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -17,7 +17,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Implements grid / list layout for WordCamp blocks. Should be used with rest of the components in this folder. Uses attribute `layout` and `columnns`.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> class GridContentLayout extends Component {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><span class="cx" style="display: block; padding: 0 10px"> render() {
</span><span class="cx" style="display: block; padding: 0 10px"> const { attributes, className, children } = this.props;
</span><span class="cx" style="display: block; padding: 0 10px"> const { grid_columns, layout } = attributes;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -43,7 +42,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> >
</span><span class="cx" style="display: block; padding: 0 10px"> { childComponent }
</span><span class="cx" style="display: block; padding: 0 10px"> </li>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -50,7 +49,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> </ul>
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> export default GridContentLayout;
</span></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentmupluginsblocksassetssrcsharedgridlayoutinspectorcontroljs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/assets/src/shared/grid-layout/inspector-control.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/assets/src/shared/grid-layout/inspector-control.js 2019-03-27 22:41:24 UTC (rev 8549)
+++ sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/assets/src/shared/grid-layout/inspector-control.js 2019-03-28 13:36:34 UTC (rev 8550)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -7,9 +7,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> const DEFAULT_SCHEMA = {
</span><span class="cx" style="display: block; padding: 0 10px"> grid_columns: {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- default: 2,
- minimum: 2,
- maximum: 4,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ default : 2,
+ minimum : 2,
+ maximum : 4,
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px"> };
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -16,7 +16,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Add a slider for increasing and decreasing columns. Should be used with rest of the components in this folder. Will use and set attributes `layout` and `gird_columns`.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> class GridInspectorControl extends Component {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><span class="cx" style="display: block; padding: 0 10px"> render() {
</span><span class="cx" style="display: block; padding: 0 10px"> const { attributes, setAttributes } = this.props;
</span><span class="cx" style="display: block; padding: 0 10px"> const { layout, grid_columns } = attributes;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -26,21 +25,21 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> const schema = DEFAULT_SCHEMA;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return (
</ins><span class="cx" style="display: block; padding: 0 10px"> <PanelBody>
</span><span class="cx" style="display: block; padding: 0 10px"> <PanelBody
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- title={__('Layout', 'wordcamporg')}
- initialOpen={true}
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ title={ __( 'Layout', 'wordcamporg' ) }
+ initialOpen={ true }
</ins><span class="cx" style="display: block; padding: 0 10px"> >
</span><span class="cx" style="display: block; padding: 0 10px"> <PanelRow>
</span><span class="cx" style="display: block; padding: 0 10px"> <RangeControl
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- label={__('Grid Columns', 'wordcamporg')}
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ label={ __( 'Grid Columns', 'wordcamporg' ) }
</ins><span class="cx" style="display: block; padding: 0 10px"> value={ Number( grid_columns ) }
</span><span class="cx" style="display: block; padding: 0 10px"> min={ schema.grid_columns.minimum }
</span><span class="cx" style="display: block; padding: 0 10px"> max={ schema.grid_columns.maximum }
</span><span class="cx" style="display: block; padding: 0 10px"> initialPosition={ schema.grid_columns.default }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- onChange={(option) => setAttributes(
- {grid_columns: option})}
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ onChange={ ( option ) => setAttributes(
+ { grid_columns: option } ) }
</ins><span class="cx" style="display: block; padding: 0 10px"> />
</span><span class="cx" style="display: block; padding: 0 10px"> </PanelRow>
</span><span class="cx" style="display: block; padding: 0 10px"> </PanelBody>
</span></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentmupluginsblocksassetssrcsharedgridlayouttoolbarjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/assets/src/shared/grid-layout/toolbar.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/assets/src/shared/grid-layout/toolbar.js 2019-03-27 22:41:24 UTC (rev 8549)
+++ sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/assets/src/shared/grid-layout/toolbar.js 2019-03-28 13:36:34 UTC (rev 8550)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -13,20 +13,19 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Sets attribute `layout` to `grid` / `list`. Also sets `grid_columns` to 2 for `grid`, and 1 for `list`.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> class GridToolbar extends Component {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><span class="cx" style="display: block; padding: 0 10px"> render() {
</span><span class="cx" style="display: block; padding: 0 10px"> const { attributes, setAttributes } = this.props;
</span><span class="cx" style="display: block; padding: 0 10px"> const { layout } = attributes;
</span><span class="cx" style="display: block; padding: 0 10px"> const layoutOptions = [
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- value: 'grid',
- label: __('Grid', 'wordcamporg'),
- isActive: layout === 'grid'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ value : 'grid',
+ label : __( 'Grid', 'wordcamporg' ),
+ isActive : layout === 'grid',
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- value: 'list',
- label: __('List', 'wordcamporg'),
- isActive: layout === 'grid'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ value : 'list',
+ label : __( 'List', 'wordcamporg' ),
+ isActive : layout === 'grid',
</ins><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px"> ];
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -33,24 +32,24 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return (
</span><span class="cx" style="display: block; padding: 0 10px"> <BlockControls>
</span><span class="cx" style="display: block; padding: 0 10px"> <Toolbar
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- controls={layoutOptions.map((option) => {
- const icon = `${option.value}-view`;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ controls={ layoutOptions.map( ( option ) => {
+ const icon = `${ option.value }-view`;
</ins><span class="cx" style="display: block; padding: 0 10px"> const isActive = layout === option.value;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- icon: icon,
- title: option.label,
- isActive: isActive,
- onClick: () => {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ icon : icon,
+ title : option.label,
+ isActive : isActive,
+ onClick : () => {
</ins><span class="cx" style="display: block; padding: 0 10px"> setAttributes(
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- layout: option.value,
- grid_columns: option.value === 'grid' ? 2 : 1,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ layout : option.value,
+ grid_columns : option.value === 'grid' ? 2 : 1,
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><span class="cx" style="display: block; padding: 0 10px"> };
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- })}
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } ) }
</ins><span class="cx" style="display: block; padding: 0 10px"> />
</span><span class="cx" style="display: block; padding: 0 10px"> </BlockControls>
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentmupluginsblocksassetssrcsponsorsblockcontentjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/assets/src/sponsors/block-content.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/assets/src/sponsors/block-content.js 2019-03-27 22:41:24 UTC (rev 8549)
+++ sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/assets/src/sponsors/block-content.js 2019-03-28 13:36:34 UTC (rev 8550)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -22,23 +22,22 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param sponsorPost
</span><span class="cx" style="display: block; padding: 0 10px"> * @param attributes
</span><span class="cx" style="display: block; padding: 0 10px"> * @param onFeatureImageChange
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @returns {*}
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return {*}
</ins><span class="cx" style="display: block; padding: 0 10px"> * @constructor
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function SponsorDetail( { sponsorPost, attributes, onFeatureImageChange } ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><span class="cx" style="display: block; padding: 0 10px"> const {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- show_name, show_logo, show_desc
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ show_name, show_logo, show_desc,
</ins><span class="cx" style="display: block; padding: 0 10px"> } = attributes;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- const featuredImageSizes = get( sponsorPost, "_embedded.wp:featuredmedia[0].media_details.sizes", {} );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ const featuredImageSizes = get( sponsorPost, '_embedded.wp:featuredmedia[0].media_details.sizes', {} );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return (
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <div className={ "wordcamp-sponsor-details wordcamp-sponsor-details-" + sponsorPost.slug }>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <div className={ 'wordcamp-sponsor-details wordcamp-sponsor-details-' + sponsorPost.slug }>
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> { ( show_name || show_name === undefined ) &&
</span><span class="cx" style="display: block; padding: 0 10px"> <ItemTitle
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- className='wordcamp-sponsor-title'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ className="wordcamp-sponsor-title"
</ins><span class="cx" style="display: block; padding: 0 10px"> headingLevel={ 3 }
</span><span class="cx" style="display: block; padding: 0 10px"> title={ sponsorPost.title.rendered.trim() }
</span><span class="cx" style="display: block; padding: 0 10px"> link={ sponsorPost.link }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -46,10 +45,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> { ( show_logo || show_logo === undefined ) &&
</span><span class="cx" style="display: block; padding: 0 10px"> <FeaturedImage
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- className={"wordcamp-sponsor-featured-image wordcamp-sponsor-logo"}
- wpMediaDetails={featuredImageSizes}
- alt={sponsorPost.title.rendered}
- attributes={attributes}
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ className={ 'wordcamp-sponsor-featured-image wordcamp-sponsor-logo' }
+ wpMediaDetails={ featuredImageSizes }
+ alt={ sponsorPost.title.rendered }
+ attributes={ attributes }
</ins><span class="cx" style="display: block; padding: 0 10px"> />
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> { ( show_desc || show_desc === undefined ) &&
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -66,13 +65,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Component for rendering Sponsors post inside editor.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> class SponsorBlockContent extends Component {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><span class="cx" style="display: block; padding: 0 10px"> constructor( props ) {
</span><span class="cx" style="display: block; padding: 0 10px"> super();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> this.state = {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- selectedPosts: [],
- sortBy: 'name_asc',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ selectedPosts : [],
+ sortBy : 'name_asc',
</ins><span class="cx" style="display: block; padding: 0 10px"> };
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -84,7 +82,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param sponsorId
</span><span class="cx" style="display: block; padding: 0 10px"> * @param imageURL
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- setFeaturedImageURL( sponsorId, imageURL) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ setFeaturedImageURL( sponsorId, imageURL ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> const sponsor_image_urls = this.sponsorImageUrl || {};
</span><span class="cx" style="display: block; padding: 0 10px"> sponsor_image_urls[ sponsorId ] = imageURL;
</span><span class="cx" style="display: block; padding: 0 10px"> this.sponsorImageUrl = sponsor_image_urls;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -98,10 +96,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Sort the sponsor posts. Since this could potentially be expensive, lets do it in componentWillReceiveProps hook and set state with result if anything is changed.
</span><span class="cx" style="display: block; padding: 0 10px"> const { selectedPosts: newSelectedPosts, attributes: newAttributes, sponsorTermOrder: newSponsorTermOrder } = nextProps;
</span><span class="cx" style="display: block; padding: 0 10px"> const { sort_by: newSortBy } = newAttributes;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- const newSelectedPostIds = newSelectedPosts.map( post => post.id ).sort();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ const newSelectedPostIds = newSelectedPosts.map( ( post ) => post.id ).sort();
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> const { selectedPosts, sortBy } = this.state;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- const selectedPostsIds = selectedPosts.map( post => post.id ).sort();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ const selectedPostsIds = selectedPosts.map( ( post ) => post.id ).sort();
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( sortBy === newSortBy && newSelectedPosts.length === selectedPosts.length && difference( selectedPostsIds, newSelectedPostIds ).length === 0 ) {
</span><span class="cx" style="display: block; padding: 0 10px"> // Everything is same. No need to calculate sorting. Lets bail.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -117,7 +115,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> sortedPosts = newSelectedPosts.sort( ( sponsor1, sponsor2 ) => {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return newSponsorTermOrder.indexOf( ( sponsor1.sponsor_level || [] )[0] ) - newSponsorTermOrder.indexOf( ( sponsor2.sponsor_level || [] )[0] )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return newSponsorTermOrder.indexOf( ( sponsor1.sponsor_level || [] )[ 0 ] ) - newSponsorTermOrder.indexOf( ( sponsor2.sponsor_level || [] )[ 0 ] );
</ins><span class="cx" style="display: block; padding: 0 10px"> } );
</span><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -125,7 +123,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> sortedPosts = newSelectedPosts.sort( ( sponsor1, sponsor2 ) => {
</span><span class="cx" style="display: block; padding: 0 10px"> const title1 = sponsor1.title.rendered.trim();
</span><span class="cx" style="display: block; padding: 0 10px"> const title2 = sponsor2.title.rendered.trim();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return title1 > title2 ? -1 : 1 ;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return title1 > title2 ? -1 : 1;
</ins><span class="cx" style="display: block; padding: 0 10px"> } );
</span><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -134,14 +132,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> sortedPosts = newSelectedPosts.sort( ( sponsor1, sponsor2 ) => {
</span><span class="cx" style="display: block; padding: 0 10px"> const title1 = sponsor1.title.rendered.trim();
</span><span class="cx" style="display: block; padding: 0 10px"> const title2 = sponsor2.title.rendered.trim();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return title1 < title2 ? -1 : 1 ;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return title1 < title2 ? -1 : 1;
</ins><span class="cx" style="display: block; padding: 0 10px"> } );
</span><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> this.setState(
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- selectedPosts: sortedPosts,
- sortBy: newSortBy,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ selectedPosts : sortedPosts,
+ sortBy : newSortBy,
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -149,7 +147,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Renders Sponsor Block content inside editor.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @returns {*}
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return {*}
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> render() {
</span><span class="cx" style="display: block; padding: 0 10px"> const { attributes } = this.props;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -162,17 +160,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> selectedPosts.map( ( post ) => {
</span><span class="cx" style="display: block; padding: 0 10px"> return (
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <SponsorDetail
- sponsorPost={ post }
- attributes={ attributes }
- />
- )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <SponsorDetail
+ sponsorPost={ post }
+ attributes={ attributes }
+ />
+ );
</ins><span class="cx" style="display: block; padding: 0 10px"> } )
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> </GridContentLayout>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> export default SponsorBlockContent;
</span></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentmupluginsblocksassetssrcsponsorsblockcontrolsjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/assets/src/sponsors/block-controls.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/assets/src/sponsors/block-controls.js 2019-03-27 22:41:24 UTC (rev 8549)
+++ sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/assets/src/sponsors/block-controls.js 2019-03-28 13:36:34 UTC (rev 8550)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -9,9 +9,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Internal dependencies.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-import { BlockControls, PlaceholderNoContent } from "../shared/block-controls";
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+import { BlockControls, PlaceholderNoContent } from '../shared/block-controls';
</ins><span class="cx" style="display: block; padding: 0 10px"> import SponsorBlockContent from './block-content';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-import ItemSelect from '../shared/item-select'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+import ItemSelect from '../shared/item-select';
</ins><span class="cx" style="display: block; padding: 0 10px"> import { LABEL } from './index';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> const { Button, Placeholder } = wp.components;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -19,14 +19,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function SponsorOption( option ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 'post' === option.type ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return SponsorPostOption( option );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } else {
- return SponsorLevelOption( option );
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return SponsorLevelOption( option );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function SponsorPostOption( sponsor ) {
</span><span class="cx" style="display: block; padding: 0 10px"> const imageUrl = get( sponsor.featuredImageData, 'sizes.thumbnail.source_url', false );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return (
</ins><span class="cx" style="display: block; padding: 0 10px"> <span>
</span><span class="cx" style="display: block; padding: 0 10px"> { sponsor.label }
</span><span class="cx" style="display: block; padding: 0 10px"> </span>
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -34,7 +33,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> function SponsorLevelOption( sponsorLevel ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return (
</ins><span class="cx" style="display: block; padding: 0 10px"> <span className="wordcamp-item-select-option-label">
</span><span class="cx" style="display: block; padding: 0 10px"> { sponsorLevel.label }
</span><span class="cx" style="display: block; padding: 0 10px"> <span className="wordcamp-item-select-option-label-term-count">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -48,15 +47,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Implements sponsor block controls.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> class SponsorBlockControls extends BlockControls {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><span class="cx" style="display: block; padding: 0 10px"> constructor( props ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- super(props);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ super( props );
</ins><span class="cx" style="display: block; padding: 0 10px"> this.state = {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- posts : [],
- terms : [],
- loading : true,
- selectedPosts : [],
- sponsorTermOrder : []
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ posts : [],
+ terms : [],
+ loading : true,
+ selectedPosts : [],
+ sponsorTermOrder : [],
</ins><span class="cx" style="display: block; padding: 0 10px"> };
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -87,7 +85,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> case 'specific_terms':
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( intersection( term_ids, post.sponsor_level || [] ) .length ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( intersection( term_ids, post.sponsor_level || [] ).length ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> selectedPosts.push( post );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -109,18 +107,16 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> const parsedPosts = sponsorPosts.then(
</span><span class="cx" style="display: block; padding: 0 10px"> ( fetchedPosts ) => {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><span class="cx" style="display: block; padding: 0 10px"> const posts = fetchedPosts.map(
</span><span class="cx" style="display: block; padding: 0 10px"> ( post ) => {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><span class="cx" style="display: block; padding: 0 10px"> return {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- label: decodeEntities(post.title.rendered.trim()) ||
- __('(Untitled)', 'wordcamporg'),
- value: post.id,
- type: 'post',
- featuredImageData: get( post,
- '_embedded.wp:featuredmedia[0].media_details', '' ),
- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ label: decodeEntities( post.title.rendered.trim() ) ||
+ __( '(Untitled)', 'wordcamporg' ),
+ value : post.id,
+ type : 'post',
+ featuredImageData : get( post,
+ '_embedded.wp:featuredmedia[0].media_details', '' ),
+ };
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( this.isStillMounted ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -128,9 +124,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> this.setState( { posts } );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ).catch( (e) => {
- console.error("Error fetching data", e );
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ).catch( ( e ) => {
+ console.error( 'Error fetching data', e );
+ } );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> const parsedTerms = sponsorLevels.then(
</span><span class="cx" style="display: block; padding: 0 10px"> ( fetchedTerms ) => {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -148,9 +144,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> this.setState( { terms } );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ).catch( (e) => {
- console.error("Error fetching data", e );
- });
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ).catch( ( e ) => {
+ console.error( 'Error fetching data', e );
+ } );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> const parsedSettings = siteSettings.then(
</span><span class="cx" style="display: block; padding: 0 10px"> ( fetchedSettings ) => {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -182,7 +178,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> const chosen = selectedOptions.mode;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( newValue && chosen ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><span class="cx" style="display: block; padding: 0 10px"> switch ( chosen ) {
</span><span class="cx" style="display: block; padding: 0 10px"> case 'post' :
</span><span class="cx" style="display: block; padding: 0 10px"> setAttributes( {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -242,12 +237,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( mode && ! hasPosts ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return (
</span><span class="cx" style="display: block; padding: 0 10px"> <PlaceholderNoContent
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- label = { LABEL }
- loading = { () => {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ label={ LABEL }
+ loading={ () => {
</ins><span class="cx" style="display: block; padding: 0 10px"> return ! Array.isArray( sponsorPosts );
</span><span class="cx" style="display: block; padding: 0 10px"> } }
</span><span class="cx" style="display: block; padding: 0 10px"> />
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> let selectedOptions = [];
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -274,20 +269,20 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <SponsorBlockContent
</span><span class="cx" style="display: block; padding: 0 10px"> selectedPosts={ selectedPosts }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- sponsorTermOrder = { sponsorTermOrder }
- {...this.props}
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ sponsorTermOrder={ sponsorTermOrder }
+ { ...this.props }
</ins><span class="cx" style="display: block; padding: 0 10px"> />
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- {'all' !== mode &&
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ { 'all' !== mode &&
</ins><span class="cx" style="display: block; padding: 0 10px"> <Placeholder
</span><span class="cx" style="display: block; padding: 0 10px"> icon={ icon }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- label = { __('Sponsors', 'wordcamporg') }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ label={ __( 'Sponsors', 'wordcamporg' ) }
</ins><span class="cx" style="display: block; padding: 0 10px"> >
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <div className='' >
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <div className="" >
</ins><span class="cx" style="display: block; padding: 0 10px"> <Button
</span><span class="cx" style="display: block; padding: 0 10px"> isDefault
</span><span class="cx" style="display: block; padding: 0 10px"> isLarge
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- onClick = {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ onClick={
</ins><span class="cx" style="display: block; padding: 0 10px"> () => {
</span><span class="cx" style="display: block; padding: 0 10px"> setAttributes( { mode: 'all' } );
</span><span class="cx" style="display: block; padding: 0 10px"> setTimeout( () => this.setSelectedPosts() );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -294,7 +289,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> >
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- { __('List all sponsors', 'wordcamporg') }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ { __( 'List all sponsors', 'wordcamporg' ) }
</ins><span class="cx" style="display: block; padding: 0 10px"> </Button>
</span><span class="cx" style="display: block; padding: 0 10px"> </div>
</span><span class="cx" style="display: block; padding: 0 10px"> <div className="wordcamp-block-edit-mode-option">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -301,28 +296,28 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <ItemSelect
</span><span class="cx" style="display: block; padding: 0 10px"> buildSelectOptions={
</span><span class="cx" style="display: block; padding: 0 10px"> () => {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return this.buildSelectOptions()
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return this.buildSelectOptions();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- isLoading={this.state.loading}
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ isLoading={ this.state.loading }
</ins><span class="cx" style="display: block; padding: 0 10px"> onChange={
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- (selectedOptions) => {
- return this.onChange(selectedOptions);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ( selectedOptions ) => {
+ return this.onChange( selectedOptions );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> selectProps={
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- formatOptionLabel: (optionData) => {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ formatOptionLabel: ( optionData ) => {
</ins><span class="cx" style="display: block; padding: 0 10px"> return (
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <SponsorOption {...optionData} />
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <SponsorOption { ...optionData } />
</ins><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ },
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- label={__('Or, choose specific sponsors or levels',
- 'wordcamporg')}
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ label={ __( 'Or, choose specific sponsors or levels',
+ 'wordcamporg' ) }
</ins><span class="cx" style="display: block; padding: 0 10px"> value={ selectedOptions }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- {...this.props}
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ { ...this.props }
</ins><span class="cx" style="display: block; padding: 0 10px"> />
</span><span class="cx" style="display: block; padding: 0 10px"> </div>
</span><span class="cx" style="display: block; padding: 0 10px"> </Placeholder>
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -330,7 +325,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> </div>
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-export default SponsorBlockControls;
</del><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+export default SponsorBlockControls;
</ins></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentmupluginsblocksassetssrcsponsorseditjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/assets/src/sponsors/edit.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/assets/src/sponsors/edit.js 2019-03-27 22:41:24 UTC (rev 8549)
+++ sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/assets/src/sponsors/edit.js 2019-03-28 13:36:34 UTC (rev 8550)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -17,7 +17,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> const MAX_PAGE = 100;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> class SponsorsEdit extends Component {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Constructor for SponsorsEdit block.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -31,24 +30,24 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> componentWillMount() {
</span><span class="cx" style="display: block; padding: 0 10px"> const sponsorQuery = {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- orderby : 'title',
- order : 'asc',
- per_page: MAX_PAGE,
- _embed : true,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ orderby : 'title',
+ order : 'asc',
+ per_page : MAX_PAGE,
+ _embed : true,
</ins><span class="cx" style="display: block; padding: 0 10px"> };
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> const sponsorLevelQuery = {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- orderby : 'id',
- order: 'asc',
- per_page: MAX_PAGE,
- _embed: true
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ orderby : 'id',
+ order : 'asc',
+ per_page : MAX_PAGE,
+ _embed : true,
</ins><span class="cx" style="display: block; padding: 0 10px"> };
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> this.setState(
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- sponsorPosts: apiFetch( { path: addQueryArgs( '/wp/v2/sponsors', sponsorQuery ) } ),
- sponsorLevels: apiFetch( { path: addQueryArgs( '/wp/v2/sponsor_level', sponsorLevelQuery ) } ),
- siteSettings: apiFetch( { path: addQueryArgs( '/wp/v2/settings', {} ) } ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ sponsorPosts : apiFetch( { path: addQueryArgs( '/wp/v2/sponsors', sponsorQuery ) } ),
+ sponsorLevels : apiFetch( { path: addQueryArgs( '/wp/v2/sponsor_level', sponsorLevelQuery ) } ),
+ siteSettings : apiFetch( { path: addQueryArgs( '/wp/v2/settings', {} ) } ),
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -66,27 +65,27 @@
</span><span class="cx" style="display: block; padding: 0 10px"> {
</span><span class="cx" style="display: block; padding: 0 10px"> <SponsorBlockControls
</span><span class="cx" style="display: block; padding: 0 10px"> icon={ SPONSORS_ICON }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- sponsorPosts = { sponsorPosts }
- sponsorLevels = { sponsorLevels }
- siteSettings = { siteSettings }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ sponsorPosts={ sponsorPosts }
+ sponsorLevels={ sponsorLevels }
+ siteSettings={ siteSettings }
</ins><span class="cx" style="display: block; padding: 0 10px"> { ...this.props }
</span><span class="cx" style="display: block; padding: 0 10px"> />
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> <Fragment>
</span><span class="cx" style="display: block; padding: 0 10px"> <SponsorInspectorControls
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- sponsorPosts = { sponsorPosts }
- sponsorLevels = { sponsorLevels }
- {...this.props}
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ sponsorPosts={ sponsorPosts }
+ sponsorLevels={ sponsorLevels }
+ { ...this.props }
</ins><span class="cx" style="display: block; padding: 0 10px"> />
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- {mode &&
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ { mode &&
</ins><span class="cx" style="display: block; padding: 0 10px"> <GridToolbar
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- {...this.props}
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ { ...this.props }
</ins><span class="cx" style="display: block; padding: 0 10px"> />
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> </Fragment>
</span><span class="cx" style="display: block; padding: 0 10px"> </Fragment>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-export const edit = SponsorsEdit;
</del><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+export const edit = SponsorsEdit;
</ins></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentmupluginsblocksassetssrcsponsorsinspectorcontrolsjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/assets/src/sponsors/inspector-controls.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/assets/src/sponsors/inspector-controls.js 2019-03-27 22:41:24 UTC (rev 8549)
+++ sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/assets/src/sponsors/inspector-controls.js 2019-03-28 13:36:34 UTC (rev 8550)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -16,21 +16,19 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Class for defining Inspector control in sponsor block.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> class SponsorInspectorControls extends Component {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Renders inspector controls.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> render() {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><span class="cx" style="display: block; padding: 0 10px"> const sortOptions = [
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- { label : __( 'Name (A to Z)', 'wordcamporg' ), value : 'name_asc' },
- { label : __( 'Name (Z to A)', 'wordcamporg' ), value : 'name_desc' },
- { label : __( 'Sponsor Level', 'wordcamporg' ), value : 'sponsor_level' },
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ { label: __( 'Name (A to Z)', 'wordcamporg' ), value: 'name_asc' },
+ { label: __( 'Name (Z to A)', 'wordcamporg' ), value: 'name_desc' },
+ { label: __( 'Sponsor Level', 'wordcamporg' ), value: 'sponsor_level' },
</ins><span class="cx" style="display: block; padding: 0 10px"> ];
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> const { attributes, setAttributes } = this.props;
</span><span class="cx" style="display: block; padding: 0 10px"> const {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- show_name, show_logo, show_desc, sort_by
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ show_name, show_logo, show_desc, sort_by,
</ins><span class="cx" style="display: block; padding: 0 10px"> } = attributes;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return (
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -39,51 +37,51 @@
</span><span class="cx" style="display: block; padding: 0 10px"> { ...this.props }
</span><span class="cx" style="display: block; padding: 0 10px"> />
</span><span class="cx" style="display: block; padding: 0 10px"> <PanelBody
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- title = { __( 'Content Settings', 'wordcamporg' ) }
- initialOpen = { true }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ title={ __( 'Content Settings', 'wordcamporg' ) }
+ initialOpen={ true }
</ins><span class="cx" style="display: block; padding: 0 10px"> >
</span><span class="cx" style="display: block; padding: 0 10px"> <PanelRow>
</span><span class="cx" style="display: block; padding: 0 10px"> <ToggleControl
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- label = { __( 'Name', 'wordcamporg' ) }
- help = { __( 'Show or hide sponsor name', 'wordcamporg' ) }
- checked = { show_name === undefined ? true : show_name }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ label={ __( 'Name', 'wordcamporg' ) }
+ help={ __( 'Show or hide sponsor name', 'wordcamporg' ) }
+ checked={ show_name === undefined ? true : show_name }
</ins><span class="cx" style="display: block; padding: 0 10px"> onChange={ ( value ) => setAttributes( { show_name: value } ) }
</span><span class="cx" style="display: block; padding: 0 10px"> />
</span><span class="cx" style="display: block; padding: 0 10px"> </PanelRow>
</span><span class="cx" style="display: block; padding: 0 10px"> <PanelRow>
</span><span class="cx" style="display: block; padding: 0 10px"> <ToggleControl
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- label = { __( 'Logo', 'wordcamporg' ) }
- help = { __( 'Show or hide sponsor logo', 'wordcamporg' ) }
- checked = { show_logo === undefined ? true : show_logo }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ label={ __( 'Logo', 'wordcamporg' ) }
+ help={ __( 'Show or hide sponsor logo', 'wordcamporg' ) }
+ checked={ show_logo === undefined ? true : show_logo }
</ins><span class="cx" style="display: block; padding: 0 10px"> onChange={ ( value ) => setAttributes( { show_logo: value } ) }
</span><span class="cx" style="display: block; padding: 0 10px"> />
</span><span class="cx" style="display: block; padding: 0 10px"> </PanelRow>
</span><span class="cx" style="display: block; padding: 0 10px"> <PanelRow>
</span><span class="cx" style="display: block; padding: 0 10px"> <ToggleControl
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- label = { __( 'Description', 'wordcamporg' ) }
- help = { __( 'Show or hide sponsor description', 'wordcamporg' ) }
- checked = { show_desc === undefined ? true : show_desc }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ label={ __( 'Description', 'wordcamporg' ) }
+ help={ __( 'Show or hide sponsor description', 'wordcamporg' ) }
+ checked={ show_desc === undefined ? true : show_desc }
</ins><span class="cx" style="display: block; padding: 0 10px"> onChange={ ( value ) => setAttributes( { show_desc: value } ) }
</span><span class="cx" style="display: block; padding: 0 10px"> />
</span><span class="cx" style="display: block; padding: 0 10px"> </PanelRow>
</span><span class="cx" style="display: block; padding: 0 10px"> <PanelRow>
</span><span class="cx" style="display: block; padding: 0 10px"> <SelectControl
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- label = { __( 'Sort by', 'wordcamporg' ) }
- options = { sortOptions }
- value = { sort_by || 'name_asc' }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ label={ __( 'Sort by', 'wordcamporg' ) }
+ options={ sortOptions }
+ value={ sort_by || 'name_asc' }
</ins><span class="cx" style="display: block; padding: 0 10px"> onChange={ ( value ) => setAttributes( { sort_by: value } ) }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- help = { __( 'Configure sponsor levels from the Sponsor -> Order Sponsor Levels page.', 'wordcamporg' ) }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ help={ __( 'Configure sponsor levels from the Sponsor -> Order Sponsor Levels page.', 'wordcamporg' ) }
</ins><span class="cx" style="display: block; padding: 0 10px"> />
</span><span class="cx" style="display: block; padding: 0 10px"> </PanelRow>
</span><span class="cx" style="display: block; padding: 0 10px"> </PanelBody>
</span><span class="cx" style="display: block; padding: 0 10px"> <FeaturedImageInspectorControls
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- title = { __( 'Logo size', 'wordcamporg' ) }
- help = { __( 'Specify logo width, or select a predefined size.', 'wordcamporg' ) }
- selectLabel = { __( 'Size', 'wordcamporg') }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ title={ __( 'Logo size', 'wordcamporg' ) }
+ help={ __( 'Specify logo width, or select a predefined size.', 'wordcamporg' ) }
+ selectLabel={ __( 'Size', 'wordcamporg' ) }
</ins><span class="cx" style="display: block; padding: 0 10px"> { ...this.props }
</span><span class="cx" style="display: block; padding: 0 10px"> />
</span><span class="cx" style="display: block; padding: 0 10px"> </InspectorControls>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="sitestrunkwordcamporgpublic_htmlwpcontentmupluginsblockswebpackconfigjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/webpack.config.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/webpack.config.js 2019-03-27 22:41:24 UTC (rev 8549)
+++ sites/trunk/wordcamp.org/public_html/wp-content/mu-plugins/blocks/webpack.config.js 2019-03-28 13:36:34 UTC (rev 8550)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5,7 +5,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> const NODE_ENV = process.env.NODE_ENV || 'development';
</span><span class="cx" style="display: block; padding: 0 10px"> const SOURCE_MAPS = process.env.SOURCE_MAPS ? true : false;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><span class="cx" style="display: block; padding: 0 10px"> const externals = {
</span><span class="cx" style="display: block; padding: 0 10px"> react : 'React',
</span><span class="cx" style="display: block; padding: 0 10px"> 'react-dom' : 'ReactDOM',
</span></span></pre>
</div>
</div>
</body>
</html>