diff --git a/CHANGELOG.md b/CHANGELOG.md
index bad7e61c0..be1ee710e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,17 @@
All notable changes to this project will be documented in this file, per [the Keep a Changelog standard](http://keepachangelog.com/).
+## [ 1.4.0 ] - 2019-03-07
+### Added
+* Clearer instructions and help text when adding an external connection.
+* Log image sideloading failures when using `DISTRIBUTOR_DEBUG`.
+
+### Fixed
+* Allow attachments to be distributed from local environments.
+* Ensure pagination is reset when switching views on the pull content screen.
+* Remove extraneous checkboxes from pulled content screen.
+* Suppress a PHP warning when no meta is being distributed for attachments.
+
## [ 1.3.9 ] - 2019-02-21
### Fixed
* Ensure posts distributed as draft can be published.
diff --git a/README.md b/README.md
index 9ba919be8..d6e354c87 100644
--- a/README.md
+++ b/README.md
@@ -71,6 +71,8 @@ The plugin contains a standard test suite compatible with PHPUnit. If you want t
You can define a constant `DISTRIBUTOR_DEBUG` to `true` to increase the ease of debugging in Distributor. This will make all remote requests blocking and expose the subscription post type.
+Enabling this will also provide more debugging information in your error log for image side loading issues. The specific logging method may change in the future.
+
### Work with us
diff --git a/composer.json b/composer.json
index 2e1c572e3..ebe97cf90 100644
--- a/composer.json
+++ b/composer.json
@@ -17,14 +17,14 @@
}
},
"require-dev": {
- "10up/wp_mock": "dev-dev",
- "10up/phpcs-composer": "dev-master",
- "phpunit/phpunit": "^6.5",
- "10up/wpacceptance": "~0.10.0"
+ "10up/wpacceptance": "~0.12.0",
+ "10up/wp_mock": "~0.4",
+ "phpunit/phpunit": "~7.5",
+ "10up/phpcs-composer": "dev-master"
},
"scripts": {
- "lint": "phpcs .",
- "lint-fix": "phpcbf ."
+ "lint": "./vendor/bin/phpcs . --runtime-set testVersion 5.6-",
+ "lint-fix": "phpcbf . --runtime-set testVersion 5.6-"
},
"minimum-stability": "dev",
"prefer-stable": true
diff --git a/dist/css/admin-external-connection.min.css b/dist/css/admin-external-connection.min.css
index ac7bbeeb0..baed92bcb 100644
--- a/dist/css/admin-external-connection.min.css
+++ b/dist/css/admin-external-connection.min.css
@@ -1,2 +1,2 @@
-#dt_external_connection_details .handlediv,#dt_external_connection_details h2{display:none}#dt_external_connection_details .inside{padding:0}#dt_external_connection_details{background-color:inherit;border:0;-webkit-box-shadow:none;box-shadow:none}#dt_external_connection_details .dt-roles-allowed label{font-weight:400}#dt_external_connection_details .dt-roles-allowed label:first-child{margin-bottom:5px;display:inline-block;font-weight:700}#dt_external_connection_details label{font-size:14px;font-weight:700}#dt_external_connection_details input,#dt_external_connection_details select{margin:0 0 8px}#dt_external_connection_details select[multiple=multiple]{height:auto}#dt_external_connection_details .suggest{font-weight:700;cursor:pointer}.description{display:block}#dt_external_connection_details .connection-field-wrap,#dt_external_connection_details p{margin-bottom:3em}.endpoint-errors{margin:5px 0 0}.endpoint-errors li{padding-left:15px;font-style:italic}.endpoint-errors li:before{content:"-";margin-right:5px}.misc-pub-visibility{display:none}.endpoint-result[data-endpoint-state=loading]:before{content:" ";vertical-align:middle;top:-.25em;border-radius:50%;width:.8em;margin-right:8px;height:.8em;display:inline-block;font-size:9px;position:relative;text-indent:-9999em;border-top:.5em solid #cfcfcf;border-right:.5em solid #cfcfcf;border-bottom:.5em solid #cfcfcf;border-left:.5em solid #666;-webkit-transform:translateZ(0);transform:translateZ(0);-webkit-animation:a 1.1s infinite linear;animation:a 1.1s infinite linear}.endpoint-result[data-endpoint-state=error]:before,.endpoint-result[data-endpoint-state=valid]:before,.endpoint-result[data-endpoint-state=warning]:before{content:" ";display:inline-block;border-radius:50%;background-color:red;width:10px;height:10px;border:1px solid #999;vertical-align:middle;top:-2px;position:relative;margin-right:5px}.endpoint-result[data-endpoint-state=valid]:before{background-color:#62ff00}.endpoint-result[data-endpoint-state=warning]:before{background-color:#ffe000}.endpoint-result .dashicons-yes{color:#46b450}.endpoint-result .dashicons-warning{color:#ffb900}@-webkit-keyframes a{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes a{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}#submitdiv{display:none}.delete-link{color:#a00;margin-left:1em;text-decoration:none}.delete-link:hover{color:red;text-decoration:none}#poststuff #post-body.columns-2{margin-right:0}#side-sortables{display:none}.oauth-connection-established .message-header{font-size:16px;color:green;font-weight:700}input[type=password].error-required,input[type=text].error-required{border:2px solid red}
+#dt_external_connection_details .handlediv,#dt_external_connection_details h2{display:none}#dt_external_connection_details .inside{padding:0}#dt_external_connection_details{background-color:inherit;border:0;-webkit-box-shadow:none;box-shadow:none}#dt_external_connection_details .dt-roles-allowed label{font-weight:400}#dt_external_connection_details .dt-roles-allowed label:first-child{margin-bottom:5px;display:inline-block;font-weight:700}#dt_external_connection_details label{font-size:14px;font-weight:700}#dt_external_connection_details input,#dt_external_connection_details select{margin:0 0 8px}#dt_external_connection_details select[multiple=multiple]{height:auto}#dt_external_connection_details .suggest{font-weight:700;cursor:pointer}.description{display:block}#dt_external_connection_details .card,#dt_external_connection_details .connection-field-wrap,#dt_external_connection_details p{margin-bottom:2em}#dt_external_connection_details .card p{margin-bottom:1em}.endpoint-errors{margin:5px 0 0}.endpoint-errors li{padding-left:15px;font-style:italic}.endpoint-errors li:before{content:"-";margin-right:5px}.misc-pub-visibility{display:none}.endpoint-result[data-endpoint-state=loading]:before{content:" ";vertical-align:middle;top:-.25em;border-radius:50%;width:.8em;margin-right:8px;height:.8em;display:inline-block;font-size:9px;position:relative;text-indent:-9999em;border-top:.5em solid #cfcfcf;border-right:.5em solid #cfcfcf;border-bottom:.5em solid #cfcfcf;border-left:.5em solid #666;-webkit-transform:translateZ(0);transform:translateZ(0);-webkit-animation:a 1.1s infinite linear;animation:a 1.1s infinite linear}.endpoint-result[data-endpoint-state=error]:before,.endpoint-result[data-endpoint-state=valid]:before,.endpoint-result[data-endpoint-state=warning]:before{content:" ";display:inline-block;border-radius:50%;background-color:red;width:10px;height:10px;border:1px solid #999;vertical-align:middle;top:-2px;position:relative;margin-right:5px}.endpoint-result[data-endpoint-state=valid]:before{background-color:#62ff00}.endpoint-result[data-endpoint-state=warning]:before{background-color:#ffe000}.endpoint-result .dashicons-yes{color:#46b450}.endpoint-result .dashicons-warning{color:#ffb900}@-webkit-keyframes a{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes a{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}#submitdiv{display:none}.delete-link{color:#a00;margin-left:1em;text-decoration:none}.delete-link:hover{color:red;text-decoration:none}#poststuff #post-body.columns-2{margin-right:0}#side-sortables{display:none}.oauth-connection-established .message-header{font-size:16px;color:green;font-weight:700}input[type=password].error-required,input[type=text].error-required{border:2px solid red}
/*# sourceMappingURL=admin-external-connection.min.css.map */
diff --git a/dist/css/admin-external-connection.min.css.map b/dist/css/admin-external-connection.min.css.map
index 577fad93e..ea97564db 100644
--- a/dist/css/admin-external-connection.min.css.map
+++ b/dist/css/admin-external-connection.min.css.map
@@ -1 +1 @@
-{"version":3,"names":[],"mappings":"","sources":["admin-external-connection.min.css"],"sourcesContent":["#dt_external_connection_details .handlediv,#dt_external_connection_details h2{display:none}#dt_external_connection_details .inside{padding:0}#dt_external_connection_details{background-color:inherit;border:0;-webkit-box-shadow:none;box-shadow:none}#dt_external_connection_details .dt-roles-allowed label{font-weight:400}#dt_external_connection_details .dt-roles-allowed label:first-child{margin-bottom:5px;display:inline-block;font-weight:700}#dt_external_connection_details label{font-size:14px;font-weight:700}#dt_external_connection_details input,#dt_external_connection_details select{margin:0 0 8px}#dt_external_connection_details select[multiple=multiple]{height:auto}#dt_external_connection_details .suggest{font-weight:700;cursor:pointer}.description{display:block}#dt_external_connection_details .connection-field-wrap,#dt_external_connection_details p{margin-bottom:3em}.endpoint-errors{margin:5px 0 0}.endpoint-errors li{padding-left:15px;font-style:italic}.endpoint-errors li:before{content:\"-\";margin-right:5px}.misc-pub-visibility{display:none}.endpoint-result[data-endpoint-state=loading]:before{content:\" \";vertical-align:middle;top:-.25em;border-radius:50%;width:.8em;margin-right:8px;height:.8em;display:inline-block;font-size:9px;position:relative;text-indent:-9999em;border-top:.5em solid #cfcfcf;border-right:.5em solid #cfcfcf;border-bottom:.5em solid #cfcfcf;border-left:.5em solid #666;-webkit-transform:translateZ(0);transform:translateZ(0);-webkit-animation:a 1.1s infinite linear;animation:a 1.1s infinite linear}.endpoint-result[data-endpoint-state=error]:before,.endpoint-result[data-endpoint-state=valid]:before,.endpoint-result[data-endpoint-state=warning]:before{content:\" \";display:inline-block;border-radius:50%;background-color:red;width:10px;height:10px;border:1px solid #999;vertical-align:middle;top:-2px;position:relative;margin-right:5px}.endpoint-result[data-endpoint-state=valid]:before{background-color:#62ff00}.endpoint-result[data-endpoint-state=warning]:before{background-color:#ffe000}.endpoint-result .dashicons-yes{color:#46b450}.endpoint-result .dashicons-warning{color:#ffb900}@-webkit-keyframes a{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes a{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}#submitdiv{display:none}.delete-link{color:#a00;margin-left:1em;text-decoration:none}.delete-link:hover{color:red;text-decoration:none}#poststuff #post-body.columns-2{margin-right:0}#side-sortables{display:none}.oauth-connection-established .message-header{font-size:16px;color:green;font-weight:700}input[type=password].error-required,input[type=text].error-required{border:2px solid red}"],"file":"admin-external-connection.min.css"}
\ No newline at end of file
+{"version":3,"names":[],"mappings":"","sources":["admin-external-connection.min.css"],"sourcesContent":["#dt_external_connection_details .handlediv,#dt_external_connection_details h2{display:none}#dt_external_connection_details .inside{padding:0}#dt_external_connection_details{background-color:inherit;border:0;-webkit-box-shadow:none;box-shadow:none}#dt_external_connection_details .dt-roles-allowed label{font-weight:400}#dt_external_connection_details .dt-roles-allowed label:first-child{margin-bottom:5px;display:inline-block;font-weight:700}#dt_external_connection_details label{font-size:14px;font-weight:700}#dt_external_connection_details input,#dt_external_connection_details select{margin:0 0 8px}#dt_external_connection_details select[multiple=multiple]{height:auto}#dt_external_connection_details .suggest{font-weight:700;cursor:pointer}.description{display:block}#dt_external_connection_details .card,#dt_external_connection_details .connection-field-wrap,#dt_external_connection_details p{margin-bottom:2em}#dt_external_connection_details .card p{margin-bottom:1em}.endpoint-errors{margin:5px 0 0}.endpoint-errors li{padding-left:15px;font-style:italic}.endpoint-errors li:before{content:\"-\";margin-right:5px}.misc-pub-visibility{display:none}.endpoint-result[data-endpoint-state=loading]:before{content:\" \";vertical-align:middle;top:-.25em;border-radius:50%;width:.8em;margin-right:8px;height:.8em;display:inline-block;font-size:9px;position:relative;text-indent:-9999em;border-top:.5em solid #cfcfcf;border-right:.5em solid #cfcfcf;border-bottom:.5em solid #cfcfcf;border-left:.5em solid #666;-webkit-transform:translateZ(0);transform:translateZ(0);-webkit-animation:a 1.1s infinite linear;animation:a 1.1s infinite linear}.endpoint-result[data-endpoint-state=error]:before,.endpoint-result[data-endpoint-state=valid]:before,.endpoint-result[data-endpoint-state=warning]:before{content:\" \";display:inline-block;border-radius:50%;background-color:red;width:10px;height:10px;border:1px solid #999;vertical-align:middle;top:-2px;position:relative;margin-right:5px}.endpoint-result[data-endpoint-state=valid]:before{background-color:#62ff00}.endpoint-result[data-endpoint-state=warning]:before{background-color:#ffe000}.endpoint-result .dashicons-yes{color:#46b450}.endpoint-result .dashicons-warning{color:#ffb900}@-webkit-keyframes a{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes a{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}#submitdiv{display:none}.delete-link{color:#a00;margin-left:1em;text-decoration:none}.delete-link:hover{color:red;text-decoration:none}#poststuff #post-body.columns-2{margin-right:0}#side-sortables{display:none}.oauth-connection-established .message-header{font-size:16px;color:green;font-weight:700}input[type=password].error-required,input[type=text].error-required{border:2px solid red}"],"file":"admin-external-connection.min.css"}
\ No newline at end of file
diff --git a/dist/css/push.min.css b/dist/css/push.min.css
index 54b6b210e..5ebeae0d9 100644
--- a/dist/css/push.min.css
+++ b/dist/css/push.min.css
@@ -1,2 +1,2 @@
-#distributor-push-wrapper{display:none}#wpadminbar #distributor-push-wrapper{display:none;font-size:13px;font-weight:400;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;position:absolute;top:32px;left:0;right:0;padding:2em 1em;height:auto;background-color:#32373c;-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:#eee;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;z-index:9999;-webkit-box-shadow:0 2px 1px 0 #000;box-shadow:0 2px 1px 0 #000;line-height:1.5}@media (min-width:480px){#wpadminbar #distributor-push-wrapper{padding:2em 0}}#wpadminbar #distributor-push-wrapper *{line-height:1.5}.distributor-show #wp-admin-bar-distributor #distributor-push-wrapper{display:-webkit-box;display:-ms-flexbox;display:flex}#wpadminbar #distributor-push-wrapper .inner{width:100%;max-width:768px;margin:0 auto}#wpadminbar #distributor-push-wrapper .new-connections-list{overflow:auto;border:1px solid #555;max-height:125px}#wpadminbar #distributor-push-wrapper .selected-connections-list{margin-bottom:1em}#wpadminbar #distributor-push-wrapper .connections-selected{margin-top:2em;position:relative}#wpadminbar #distributor-push-wrapper .connections-selected .no-selected{display:none}#wpadminbar #distributor-push-wrapper .connections-selected.empty{opacity:.5}#wpadminbar #distributor-push-wrapper .connections-selected.empty .no-selected{display:block}#wpadminbar #distributor-push-wrapper .connections-selected.empty .with-selected{display:none}#wpadminbar #distributor-push-wrapper .connections-selected label{color:inherit}#wpadminbar #distributor-push-wrapper .connections-selected input[type=checkbox]{vertical-align:middle;margin-right:2px}#wpadminbar #distributor-push-wrapper .connections-selected.empty:after{content:" ";position:absolute;top:0;left:0;right:0;bottom:0;background-color:transparent}#wpadminbar #distributor-push-wrapper .syndicated-notice a{display:inline-block;padding:0;margin:0}@media (min-width:480px){#wpadminbar #distributor-push-wrapper{position:fixed}#wpadminbar #distributor-push-wrapper .connections-selector{width:60%;position:relative;float:left;padding-right:0;-webkit-box-sizing:border-box;box-sizing:border-box;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}#wpadminbar #distributor-push-wrapper .connections-selector div{width:100%}#wpadminbar #distributor-push-wrapper .connections-selected{width:40%;float:right;margin-top:0;padding-left:3em;-webkit-box-sizing:border-box;box-sizing:border-box}}#wpadminbar #distributor-push-wrapper .no-connections-notice,#wpadminbar #distributor-push-wrapper .syndicated-notice{text-align:center;margin:0}#wpadminbar #distributor-push-wrapper .no-connections-notice a,#wpadminbar #distributor-push-wrapper .syndicated-notice a{color:inherit;text-decoration:underline}#wpadminbar #distributor-push-wrapper input[type=checkbox]{height:16px!important}#wpadminbar #distributor-push-wrapper input[type=text]{font-size:inherit;padding:.5278em;width:100%;background-color:#32373c;border:2px solid #555;color:#eee;margin-bottom:.5em}#wpadminbar #distributor-push-wrapper input[type=text]::-webkit-input-placeholder{color:#a6a6a6}#wpadminbar #distributor-push-wrapper input[type=text]:-ms-input-placeholder,#wpadminbar #distributor-push-wrapper input[type=text]::-ms-input-placeholder{color:#a6a6a6}#wpadminbar #distributor-push-wrapper input[type=text]::placeholder{color:#a6a6a6}#wpadminbar #distributor-push-wrapper input[type=text]:focus{color:#eee;background-color:#32373c;border:2px solid #555}#wpadminbar #distributor-push-wrapper button{background:#0085ba;border-color:#0073aa #006799 #006799;border-width:1px;border-style:solid;-webkit-box-shadow:0 1px 0 #006799;box-shadow:0 1px 0 #006799;color:#fff;text-decoration:none;text-shadow:0 -1px 1px #006799,1px 0 1px #006799,0 1px 1px #006799,-1px 0 1px #006799;height:30px;line-height:28px;padding:0 12px 2px;border-radius:3px;text-transform:none;font-size:13px;vertical-align:top;font-weight:400;cursor:pointer;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif}#wpadminbar #distributor-push-wrapper button:focus,#wpadminbar #distributor-push-wrapper button:hover{background-color:#0085ba;outline:none}#wpadminbar #distributor-push-wrapper .new-connections-list>div:nth-child(odd){background-color:#23282d}#wpadminbar #distributor-push-wrapper .add-connection,#wpadminbar #distributor-push-wrapper .added-connection{display:block;width:100%;padding:.5em;-webkit-box-sizing:border-box;box-sizing:border-box;color:inherit;cursor:pointer}#wpadminbar #distributor-push-wrapper .new-connections-list .add-connection.added{background-color:#3a4045}#wpadminbar #distributor-push-wrapper .add-connection.syndicated{cursor:default}#wpadminbar #distributor-push-wrapper .add-connection.syndicated span{color:#555}#wpadminbar #distributor-push-wrapper .add-connection.syndicated a{color:inherit;text-decoration:underline;float:right;height:auto}#wpadminbar #distributor-push-wrapper .added-connection{background-color:#555;margin-bottom:.5em;cursor:normal;position:relative}#wpadminbar #distributor-push-wrapper .added-connection .remove-connection{cursor:pointer;top:1px;display:inline-block;float:right;font-size:20px;line-height:19px;vertical-align:middle;margin-left:6px;position:relative}#wpadminbar #distributor-push-wrapper .added-connection .remove-connection:after{content:"\f335";font-family:dashicons}#wpadminbar #distributor-push-wrapper header,#wpadminbar #distributor-push-wrapper p{margin:0 0 1em!important;padding:0}#wpadminbar #distributor-push-wrapper .as-draft{margin-left:.5em;height:30px;line-height:28px;padding:2px 12px;display:inline-block;-webkit-box-sizing:border-box;box-sizing:border-box}#wpadminbar #distributor-push-wrapper .action-wrapper.loading .syndicate-button:after{content:" ";vertical-align:middle;border-radius:50%;width:6px;margin-left:8px;height:6px;display:inline-block;font-size:9px;text-indent:-9999em;border-top:3px solid #cfcfcf;border-right:3px solid #cfcfcf;border-bottom:3px solid #cfcfcf;border-left:3px solid #00aef2;-webkit-transform:translateZ(0);transform:translateZ(0);-webkit-animation:a 1.1s infinite linear;animation:a 1.1s infinite linear;position:relative;top:-1px;-webkit-box-sizing:content-box;box-sizing:content-box;-webkit-box-sizing:initial;box-sizing:initial}#wpadminbar #distributor-push-wrapper .messages{margin-top:1em;-webkit-box-sizing:border-box;box-sizing:border-box}@media (min-width:480px){#wpadminbar #distributor-push-wrapper .messages{width:40%;float:right;clear:right;padding-left:3em}}#wpadminbar #distributor-push-wrapper .messages *{display:none}#wpadminbar #distributor-push-wrapper.message-error .messages .dt-error,#wpadminbar #distributor-push-wrapper.message-success .messages .dt-success{display:block}@-webkit-keyframes a{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes a{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}
+#distributor-push-wrapper{display:none}#wpadminbar #distributor-push-wrapper{display:none;font-size:13px;font-weight:400;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;position:absolute;top:32px;left:0;right:0;padding:2em 1em;height:auto;background-color:#32373c;-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:#eee;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;z-index:9999;-webkit-box-shadow:0 2px 1px 0 #000;box-shadow:0 2px 1px 0 #000;line-height:1.5}@media (min-width:480px){#wpadminbar #distributor-push-wrapper{padding:2em 0}}#wpadminbar #distributor-push-wrapper *{line-height:1.5}.distributor-show #wp-admin-bar-distributor #distributor-push-wrapper{display:-webkit-box;display:-ms-flexbox;display:flex}#wpadminbar #distributor-push-wrapper .inner{width:100%;max-width:768px;margin:0 auto}#wpadminbar #distributor-push-wrapper .new-connections-list{overflow:auto;border:1px solid #555;max-height:125px}#wpadminbar #distributor-push-wrapper .selected-connections-list{margin-bottom:1em}#wpadminbar #distributor-push-wrapper .connections-selected{margin-top:2em;position:relative}#wpadminbar #distributor-push-wrapper .connections-selected .no-selected{display:none}#wpadminbar #distributor-push-wrapper .connections-selected.empty{opacity:.5}#wpadminbar #distributor-push-wrapper .connections-selected.empty .no-selected{display:block}#wpadminbar #distributor-push-wrapper .connections-selected.empty .with-selected{display:none}#wpadminbar #distributor-push-wrapper .connections-selected label{color:inherit}#wpadminbar #distributor-push-wrapper .connections-selected input[type=checkbox]{vertical-align:middle;margin-right:2px}#wpadminbar #distributor-push-wrapper .connections-selected.empty:after{content:" ";position:absolute;top:0;left:0;right:0;bottom:0;background-color:transparent}#wpadminbar #distributor-push-wrapper .syndicated-notice a{display:inline-block;padding:0;margin:0}@media (min-width:480px){#wpadminbar #distributor-push-wrapper{position:fixed}#wpadminbar #distributor-push-wrapper .connections-selector{width:60%;position:relative;float:left;padding-right:0;-webkit-box-sizing:border-box;box-sizing:border-box;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}#wpadminbar #distributor-push-wrapper .connections-selector div{width:100%}#wpadminbar #distributor-push-wrapper .connections-selected{width:40%;float:right;margin-top:0;padding-left:3em;-webkit-box-sizing:border-box;box-sizing:border-box}}#wpadminbar #distributor-push-wrapper .no-connections-notice,#wpadminbar #distributor-push-wrapper .syndicated-notice{text-align:center;margin:0}#wpadminbar #distributor-push-wrapper .no-connections-notice a,#wpadminbar #distributor-push-wrapper .syndicated-notice a{color:inherit;text-decoration:underline}#wpadminbar #distributor-push-wrapper input[type=checkbox]{height:16px!important}#wpadminbar #distributor-push-wrapper input[type=text]{font-size:inherit;padding:.5278em;width:100%;background-color:#32373c;border:2px solid #555;color:#eee;margin-bottom:.5em}#wpadminbar #distributor-push-wrapper input[type=text]::-webkit-input-placeholder{color:#a6a6a6}#wpadminbar #distributor-push-wrapper input[type=text]::-ms-input-placeholder{color:#a6a6a6}#wpadminbar #distributor-push-wrapper input[type=text]::placeholder{color:#a6a6a6}#wpadminbar #distributor-push-wrapper input[type=text]:focus{color:#eee;background-color:#32373c;border:2px solid #555}#wpadminbar #distributor-push-wrapper button{background:#0085ba;border-color:#0073aa #006799 #006799;border-width:1px;border-style:solid;-webkit-box-shadow:0 1px 0 #006799;box-shadow:0 1px 0 #006799;color:#fff;text-decoration:none;text-shadow:0 -1px 1px #006799,1px 0 1px #006799,0 1px 1px #006799,-1px 0 1px #006799;height:30px;line-height:28px;padding:0 12px 2px;border-radius:3px;text-transform:none;font-size:13px;vertical-align:top;font-weight:400;cursor:pointer;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif}#wpadminbar #distributor-push-wrapper button:focus,#wpadminbar #distributor-push-wrapper button:hover{background-color:#0085ba;outline:none}#wpadminbar #distributor-push-wrapper .new-connections-list>div:nth-child(odd){background-color:#23282d}#wpadminbar #distributor-push-wrapper .add-connection,#wpadminbar #distributor-push-wrapper .added-connection{display:block;width:100%;padding:.5em;-webkit-box-sizing:border-box;box-sizing:border-box;color:inherit;cursor:pointer}#wpadminbar #distributor-push-wrapper .new-connections-list .add-connection.added{background-color:#3a4045}#wpadminbar #distributor-push-wrapper .add-connection.syndicated{cursor:default}#wpadminbar #distributor-push-wrapper .add-connection.syndicated span{color:#555}#wpadminbar #distributor-push-wrapper .add-connection.syndicated a{color:inherit;text-decoration:underline;float:right;height:auto}#wpadminbar #distributor-push-wrapper .added-connection{background-color:#555;margin-bottom:.5em;cursor:normal;position:relative}#wpadminbar #distributor-push-wrapper .added-connection .remove-connection{cursor:pointer;top:1px;display:inline-block;float:right;font-size:20px;line-height:19px;vertical-align:middle;margin-left:6px;position:relative}#wpadminbar #distributor-push-wrapper .added-connection .remove-connection:after{content:"\f335";font-family:dashicons}#wpadminbar #distributor-push-wrapper header,#wpadminbar #distributor-push-wrapper p{margin:0 0 1em!important;padding:0}#wpadminbar #distributor-push-wrapper .as-draft{margin-left:.5em;height:30px;line-height:28px;padding:2px 12px;display:inline-block;-webkit-box-sizing:border-box;box-sizing:border-box}#wpadminbar #distributor-push-wrapper .action-wrapper.loading .syndicate-button:after{content:" ";vertical-align:middle;border-radius:50%;width:6px;margin-left:8px;height:6px;display:inline-block;font-size:9px;text-indent:-9999em;border-top:3px solid #cfcfcf;border-right:3px solid #cfcfcf;border-bottom:3px solid #cfcfcf;border-left:3px solid #00aef2;-webkit-transform:translateZ(0);transform:translateZ(0);-webkit-animation:a 1.1s infinite linear;animation:a 1.1s infinite linear;position:relative;top:-1px;-webkit-box-sizing:content-box;box-sizing:content-box;-webkit-box-sizing:initial;box-sizing:initial}#wpadminbar #distributor-push-wrapper .messages{margin-top:1em;-webkit-box-sizing:border-box;box-sizing:border-box}@media (min-width:480px){#wpadminbar #distributor-push-wrapper .messages{width:40%;float:right;clear:right;padding-left:3em}}#wpadminbar #distributor-push-wrapper .messages *{display:none}#wpadminbar #distributor-push-wrapper.message-error .messages .dt-error,#wpadminbar #distributor-push-wrapper.message-success .messages .dt-success{display:block}@-webkit-keyframes a{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes a{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}
/*# sourceMappingURL=push.min.css.map */
diff --git a/dist/css/push.min.css.map b/dist/css/push.min.css.map
index 77abce9b3..08b94b00f 100644
--- a/dist/css/push.min.css.map
+++ b/dist/css/push.min.css.map
@@ -1 +1 @@
-{"version":3,"names":[],"mappings":"","sources":["push.min.css"],"sourcesContent":["#distributor-push-wrapper{display:none}#wpadminbar #distributor-push-wrapper{display:none;font-size:13px;font-weight:400;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;position:absolute;top:32px;left:0;right:0;padding:2em 1em;height:auto;background-color:#32373c;-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:#eee;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;z-index:9999;-webkit-box-shadow:0 2px 1px 0 #000;box-shadow:0 2px 1px 0 #000;line-height:1.5}@media (min-width:480px){#wpadminbar #distributor-push-wrapper{padding:2em 0}}#wpadminbar #distributor-push-wrapper *{line-height:1.5}.distributor-show #wp-admin-bar-distributor #distributor-push-wrapper{display:-webkit-box;display:-ms-flexbox;display:flex}#wpadminbar #distributor-push-wrapper .inner{width:100%;max-width:768px;margin:0 auto}#wpadminbar #distributor-push-wrapper .new-connections-list{overflow:auto;border:1px solid #555;max-height:125px}#wpadminbar #distributor-push-wrapper .selected-connections-list{margin-bottom:1em}#wpadminbar #distributor-push-wrapper .connections-selected{margin-top:2em;position:relative}#wpadminbar #distributor-push-wrapper .connections-selected .no-selected{display:none}#wpadminbar #distributor-push-wrapper .connections-selected.empty{opacity:.5}#wpadminbar #distributor-push-wrapper .connections-selected.empty .no-selected{display:block}#wpadminbar #distributor-push-wrapper .connections-selected.empty .with-selected{display:none}#wpadminbar #distributor-push-wrapper .connections-selected label{color:inherit}#wpadminbar #distributor-push-wrapper .connections-selected input[type=checkbox]{vertical-align:middle;margin-right:2px}#wpadminbar #distributor-push-wrapper .connections-selected.empty:after{content:\" \";position:absolute;top:0;left:0;right:0;bottom:0;background-color:transparent}#wpadminbar #distributor-push-wrapper .syndicated-notice a{display:inline-block;padding:0;margin:0}@media (min-width:480px){#wpadminbar #distributor-push-wrapper{position:fixed}#wpadminbar #distributor-push-wrapper .connections-selector{width:60%;position:relative;float:left;padding-right:0;-webkit-box-sizing:border-box;box-sizing:border-box;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}#wpadminbar #distributor-push-wrapper .connections-selector div{width:100%}#wpadminbar #distributor-push-wrapper .connections-selected{width:40%;float:right;margin-top:0;padding-left:3em;-webkit-box-sizing:border-box;box-sizing:border-box}}#wpadminbar #distributor-push-wrapper .no-connections-notice,#wpadminbar #distributor-push-wrapper .syndicated-notice{text-align:center;margin:0}#wpadminbar #distributor-push-wrapper .no-connections-notice a,#wpadminbar #distributor-push-wrapper .syndicated-notice a{color:inherit;text-decoration:underline}#wpadminbar #distributor-push-wrapper input[type=checkbox]{height:16px!important}#wpadminbar #distributor-push-wrapper input[type=text]{font-size:inherit;padding:.5278em;width:100%;background-color:#32373c;border:2px solid #555;color:#eee;margin-bottom:.5em}#wpadminbar #distributor-push-wrapper input[type=text]::-webkit-input-placeholder{color:#a6a6a6}#wpadminbar #distributor-push-wrapper input[type=text]:-ms-input-placeholder,#wpadminbar #distributor-push-wrapper input[type=text]::-ms-input-placeholder{color:#a6a6a6}#wpadminbar #distributor-push-wrapper input[type=text]::placeholder{color:#a6a6a6}#wpadminbar #distributor-push-wrapper input[type=text]:focus{color:#eee;background-color:#32373c;border:2px solid #555}#wpadminbar #distributor-push-wrapper button{background:#0085ba;border-color:#0073aa #006799 #006799;border-width:1px;border-style:solid;-webkit-box-shadow:0 1px 0 #006799;box-shadow:0 1px 0 #006799;color:#fff;text-decoration:none;text-shadow:0 -1px 1px #006799,1px 0 1px #006799,0 1px 1px #006799,-1px 0 1px #006799;height:30px;line-height:28px;padding:0 12px 2px;border-radius:3px;text-transform:none;font-size:13px;vertical-align:top;font-weight:400;cursor:pointer;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif}#wpadminbar #distributor-push-wrapper button:focus,#wpadminbar #distributor-push-wrapper button:hover{background-color:#0085ba;outline:none}#wpadminbar #distributor-push-wrapper .new-connections-list>div:nth-child(odd){background-color:#23282d}#wpadminbar #distributor-push-wrapper .add-connection,#wpadminbar #distributor-push-wrapper .added-connection{display:block;width:100%;padding:.5em;-webkit-box-sizing:border-box;box-sizing:border-box;color:inherit;cursor:pointer}#wpadminbar #distributor-push-wrapper .new-connections-list .add-connection.added{background-color:#3a4045}#wpadminbar #distributor-push-wrapper .add-connection.syndicated{cursor:default}#wpadminbar #distributor-push-wrapper .add-connection.syndicated span{color:#555}#wpadminbar #distributor-push-wrapper .add-connection.syndicated a{color:inherit;text-decoration:underline;float:right;height:auto}#wpadminbar #distributor-push-wrapper .added-connection{background-color:#555;margin-bottom:.5em;cursor:normal;position:relative}#wpadminbar #distributor-push-wrapper .added-connection .remove-connection{cursor:pointer;top:1px;display:inline-block;float:right;font-size:20px;line-height:19px;vertical-align:middle;margin-left:6px;position:relative}#wpadminbar #distributor-push-wrapper .added-connection .remove-connection:after{content:\"\\f335\";font-family:dashicons}#wpadminbar #distributor-push-wrapper header,#wpadminbar #distributor-push-wrapper p{margin:0 0 1em!important;padding:0}#wpadminbar #distributor-push-wrapper .as-draft{margin-left:.5em;height:30px;line-height:28px;padding:2px 12px;display:inline-block;-webkit-box-sizing:border-box;box-sizing:border-box}#wpadminbar #distributor-push-wrapper .action-wrapper.loading .syndicate-button:after{content:\" \";vertical-align:middle;border-radius:50%;width:6px;margin-left:8px;height:6px;display:inline-block;font-size:9px;text-indent:-9999em;border-top:3px solid #cfcfcf;border-right:3px solid #cfcfcf;border-bottom:3px solid #cfcfcf;border-left:3px solid #00aef2;-webkit-transform:translateZ(0);transform:translateZ(0);-webkit-animation:a 1.1s infinite linear;animation:a 1.1s infinite linear;position:relative;top:-1px;-webkit-box-sizing:content-box;box-sizing:content-box;-webkit-box-sizing:initial;box-sizing:initial}#wpadminbar #distributor-push-wrapper .messages{margin-top:1em;-webkit-box-sizing:border-box;box-sizing:border-box}@media (min-width:480px){#wpadminbar #distributor-push-wrapper .messages{width:40%;float:right;clear:right;padding-left:3em}}#wpadminbar #distributor-push-wrapper .messages *{display:none}#wpadminbar #distributor-push-wrapper.message-error .messages .dt-error,#wpadminbar #distributor-push-wrapper.message-success .messages .dt-success{display:block}@-webkit-keyframes a{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes a{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}"],"file":"push.min.css"}
\ No newline at end of file
+{"version":3,"names":[],"mappings":"","sources":["push.min.css"],"sourcesContent":["#distributor-push-wrapper{display:none}#wpadminbar #distributor-push-wrapper{display:none;font-size:13px;font-weight:400;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;position:absolute;top:32px;left:0;right:0;padding:2em 1em;height:auto;background-color:#32373c;-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:#eee;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;z-index:9999;-webkit-box-shadow:0 2px 1px 0 #000;box-shadow:0 2px 1px 0 #000;line-height:1.5}@media (min-width:480px){#wpadminbar #distributor-push-wrapper{padding:2em 0}}#wpadminbar #distributor-push-wrapper *{line-height:1.5}.distributor-show #wp-admin-bar-distributor #distributor-push-wrapper{display:-webkit-box;display:-ms-flexbox;display:flex}#wpadminbar #distributor-push-wrapper .inner{width:100%;max-width:768px;margin:0 auto}#wpadminbar #distributor-push-wrapper .new-connections-list{overflow:auto;border:1px solid #555;max-height:125px}#wpadminbar #distributor-push-wrapper .selected-connections-list{margin-bottom:1em}#wpadminbar #distributor-push-wrapper .connections-selected{margin-top:2em;position:relative}#wpadminbar #distributor-push-wrapper .connections-selected .no-selected{display:none}#wpadminbar #distributor-push-wrapper .connections-selected.empty{opacity:.5}#wpadminbar #distributor-push-wrapper .connections-selected.empty .no-selected{display:block}#wpadminbar #distributor-push-wrapper .connections-selected.empty .with-selected{display:none}#wpadminbar #distributor-push-wrapper .connections-selected label{color:inherit}#wpadminbar #distributor-push-wrapper .connections-selected input[type=checkbox]{vertical-align:middle;margin-right:2px}#wpadminbar #distributor-push-wrapper .connections-selected.empty:after{content:\" \";position:absolute;top:0;left:0;right:0;bottom:0;background-color:transparent}#wpadminbar #distributor-push-wrapper .syndicated-notice a{display:inline-block;padding:0;margin:0}@media (min-width:480px){#wpadminbar #distributor-push-wrapper{position:fixed}#wpadminbar #distributor-push-wrapper .connections-selector{width:60%;position:relative;float:left;padding-right:0;-webkit-box-sizing:border-box;box-sizing:border-box;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}#wpadminbar #distributor-push-wrapper .connections-selector div{width:100%}#wpadminbar #distributor-push-wrapper .connections-selected{width:40%;float:right;margin-top:0;padding-left:3em;-webkit-box-sizing:border-box;box-sizing:border-box}}#wpadminbar #distributor-push-wrapper .no-connections-notice,#wpadminbar #distributor-push-wrapper .syndicated-notice{text-align:center;margin:0}#wpadminbar #distributor-push-wrapper .no-connections-notice a,#wpadminbar #distributor-push-wrapper .syndicated-notice a{color:inherit;text-decoration:underline}#wpadminbar #distributor-push-wrapper input[type=checkbox]{height:16px!important}#wpadminbar #distributor-push-wrapper input[type=text]{font-size:inherit;padding:.5278em;width:100%;background-color:#32373c;border:2px solid #555;color:#eee;margin-bottom:.5em}#wpadminbar #distributor-push-wrapper input[type=text]::-webkit-input-placeholder{color:#a6a6a6}#wpadminbar #distributor-push-wrapper input[type=text]::-ms-input-placeholder{color:#a6a6a6}#wpadminbar #distributor-push-wrapper input[type=text]::placeholder{color:#a6a6a6}#wpadminbar #distributor-push-wrapper input[type=text]:focus{color:#eee;background-color:#32373c;border:2px solid #555}#wpadminbar #distributor-push-wrapper button{background:#0085ba;border-color:#0073aa #006799 #006799;border-width:1px;border-style:solid;-webkit-box-shadow:0 1px 0 #006799;box-shadow:0 1px 0 #006799;color:#fff;text-decoration:none;text-shadow:0 -1px 1px #006799,1px 0 1px #006799,0 1px 1px #006799,-1px 0 1px #006799;height:30px;line-height:28px;padding:0 12px 2px;border-radius:3px;text-transform:none;font-size:13px;vertical-align:top;font-weight:400;cursor:pointer;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif}#wpadminbar #distributor-push-wrapper button:focus,#wpadminbar #distributor-push-wrapper button:hover{background-color:#0085ba;outline:none}#wpadminbar #distributor-push-wrapper .new-connections-list>div:nth-child(odd){background-color:#23282d}#wpadminbar #distributor-push-wrapper .add-connection,#wpadminbar #distributor-push-wrapper .added-connection{display:block;width:100%;padding:.5em;-webkit-box-sizing:border-box;box-sizing:border-box;color:inherit;cursor:pointer}#wpadminbar #distributor-push-wrapper .new-connections-list .add-connection.added{background-color:#3a4045}#wpadminbar #distributor-push-wrapper .add-connection.syndicated{cursor:default}#wpadminbar #distributor-push-wrapper .add-connection.syndicated span{color:#555}#wpadminbar #distributor-push-wrapper .add-connection.syndicated a{color:inherit;text-decoration:underline;float:right;height:auto}#wpadminbar #distributor-push-wrapper .added-connection{background-color:#555;margin-bottom:.5em;cursor:normal;position:relative}#wpadminbar #distributor-push-wrapper .added-connection .remove-connection{cursor:pointer;top:1px;display:inline-block;float:right;font-size:20px;line-height:19px;vertical-align:middle;margin-left:6px;position:relative}#wpadminbar #distributor-push-wrapper .added-connection .remove-connection:after{content:\"\\f335\";font-family:dashicons}#wpadminbar #distributor-push-wrapper header,#wpadminbar #distributor-push-wrapper p{margin:0 0 1em!important;padding:0}#wpadminbar #distributor-push-wrapper .as-draft{margin-left:.5em;height:30px;line-height:28px;padding:2px 12px;display:inline-block;-webkit-box-sizing:border-box;box-sizing:border-box}#wpadminbar #distributor-push-wrapper .action-wrapper.loading .syndicate-button:after{content:\" \";vertical-align:middle;border-radius:50%;width:6px;margin-left:8px;height:6px;display:inline-block;font-size:9px;text-indent:-9999em;border-top:3px solid #cfcfcf;border-right:3px solid #cfcfcf;border-bottom:3px solid #cfcfcf;border-left:3px solid #00aef2;-webkit-transform:translateZ(0);transform:translateZ(0);-webkit-animation:a 1.1s infinite linear;animation:a 1.1s infinite linear;position:relative;top:-1px;-webkit-box-sizing:content-box;box-sizing:content-box;-webkit-box-sizing:initial;box-sizing:initial}#wpadminbar #distributor-push-wrapper .messages{margin-top:1em;-webkit-box-sizing:border-box;box-sizing:border-box}@media (min-width:480px){#wpadminbar #distributor-push-wrapper .messages{width:40%;float:right;clear:right;padding-left:3em}}#wpadminbar #distributor-push-wrapper .messages *{display:none}#wpadminbar #distributor-push-wrapper.message-error .messages .dt-error,#wpadminbar #distributor-push-wrapper.message-success .messages .dt-success{display:block}@-webkit-keyframes a{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes a{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}"],"file":"push.min.css"}
\ No newline at end of file
diff --git a/dist/js/admin-distributed-post.min.js.map b/dist/js/admin-distributed-post.min.js.map
index 8800f64c7..2637423fe 100644
--- a/dist/js/admin-distributed-post.min.js.map
+++ b/dist/js/admin-distributed-post.min.js.map
@@ -1 +1 @@
-{"version":3,"sources":["webpack:///admin-distributed-post.min.js","webpack:///webpack/bootstrap f1938fcf27bd493f1dae","webpack:///external \"jQuery\"","webpack:///./assets/js/admin-distributed-post.js"],"names":["modules","__webpack_require__","moduleId","installedModules","exports","module","i","l","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","0","jQuery","5","_jquery","_jquery2","obj","default","openLinks","document","querySelectorAll","helpLink","getElementById","distributorTab","querySelector","length","on","click"],"mappings":"CAAS,SAAUA,GCInB,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAE,OAGA,IAAAC,GAAAF,EAAAD,IACAI,EAAAJ,EACAK,GAAA,EACAH,WAUA,OANAJ,GAAAE,GAAAM,KAAAH,EAAAD,QAAAC,IAAAD,QAAAH,GAGAI,EAAAE,GAAA,EAGAF,EAAAD,QAvBA,GAAAD,KA4BAF,GAAAQ,EAAAT,EAGAC,EAAAS,EAAAP,EAGAF,EAAAU,EAAA,SAAAP,EAAAQ,EAAAC,GACAZ,EAAAa,EAAAV,EAAAQ,IACAG,OAAAC,eAAAZ,EAAAQ,GACAK,cAAA,EACAC,YAAA,EACAC,IAAAN,KAMAZ,EAAAmB,EAAA,SAAAf,GACA,GAAAQ,GAAAR,KAAAgB,WACA,WAA2B,MAAAhB,GAAA,SAC3B,WAAiC,MAAAA,GAEjC,OADAJ,GAAAU,EAAAE,EAAA,IAAAA,GACAA,GAIAZ,EAAAa,EAAA,SAAAQ,EAAAC,GAAsD,MAAAR,QAAAS,UAAAC,eAAAjB,KAAAc,EAAAC,IAGtDtB,EAAAyB,EAAA,GAGAzB,IAAA0B,EAAA,KDMMC,EACA,SAAUvB,EAAQD,GEpExBC,EAAAD,QAAAyB,QF0EMC,EACA,SAAUzB,EAAQD,EAASH,GAEjC,YGvEA,KAAM,GANN8B,GAAA9B,EAAA,GHkFI+B,EAEJ,SAAgCC,GAAO,MAAOA,IAAOA,EAAIZ,WAAaY,GAAQC,QAASD,IAFjDF,GGhFhCI,EAAiBC,SAASC,iBAAkB,0BAC5CC,EAAiBF,SAASG,eAAgB,wBAC1CC,EAAiBJ,SAASK,cAAe,2BAErCnC,EAAI,EAAGA,EAAI6B,EAAUO,OAAQpC,KACtC,EAAA0B,EAAAE,SAAQC,EAAU7B,IAAKqC,GAAI,QAAS,WACnCL,EAASM,QACTJ,EAAeI","file":"admin-distributed-post.min.js","sourcesContent":["/******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 5);\n/******/ })\n/************************************************************************/\n/******/ ({\n\n/***/ 0:\n/***/ (function(module, exports) {\n\nmodule.exports = jQuery;\n\n/***/ }),\n\n/***/ 5:\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar _jquery = __webpack_require__(0);\n\nvar _jquery2 = _interopRequireDefault(_jquery);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar openLinks = document.querySelectorAll('.open-distributor-help');\nvar helpLink = document.getElementById('contextual-help-link');\nvar distributorTab = document.querySelector('#tab-link-distributer a');\n\nfor (var i = 0; i < openLinks.length; i++) {\n\t(0, _jquery2.default)(openLinks[i]).on('click', function () {\n\t\thelpLink.click();\n\t\tdistributorTab.click();\n\t});\n}\n\n/***/ })\n\n/******/ });\n\n\n// WEBPACK FOOTER //\n// admin-distributed-post.min.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 5);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap f1938fcf27bd493f1dae","module.exports = jQuery;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"jQuery\"\n// module id = 0\n// module chunks = 0 1 4 5","import jQuery from 'jquery';\n\nconst openLinks = document.querySelectorAll( '.open-distributor-help' );\nconst helpLink = document.getElementById( 'contextual-help-link' );\nconst distributorTab = document.querySelector( '#tab-link-distributer a' );\n\nfor ( let i = 0; i < openLinks.length; i++ ) {\n\tjQuery( openLinks[i] ).on( 'click', () => {\n\t\thelpLink.click();\n\t\tdistributorTab.click();\n\t} );\n}\n\n\n\n// WEBPACK FOOTER //\n// ./assets/js/admin-distributed-post.js"],"sourceRoot":""}
\ No newline at end of file
+{"version":3,"sources":["webpack:///admin-distributed-post.min.js","webpack:///webpack/bootstrap fff10cbf8520b51427a4","webpack:///external \"jQuery\"","webpack:///./assets/js/admin-distributed-post.js"],"names":["modules","__webpack_require__","moduleId","installedModules","exports","module","i","l","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","0","jQuery","5","_jquery","_jquery2","obj","default","openLinks","document","querySelectorAll","helpLink","getElementById","distributorTab","querySelector","length","on","click"],"mappings":"CAAS,SAAUA,GCInB,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAE,OAGA,IAAAC,GAAAF,EAAAD,IACAI,EAAAJ,EACAK,GAAA,EACAH,WAUA,OANAJ,GAAAE,GAAAM,KAAAH,EAAAD,QAAAC,IAAAD,QAAAH,GAGAI,EAAAE,GAAA,EAGAF,EAAAD,QAvBA,GAAAD,KA4BAF,GAAAQ,EAAAT,EAGAC,EAAAS,EAAAP,EAGAF,EAAAU,EAAA,SAAAP,EAAAQ,EAAAC,GACAZ,EAAAa,EAAAV,EAAAQ,IACAG,OAAAC,eAAAZ,EAAAQ,GACAK,cAAA,EACAC,YAAA,EACAC,IAAAN,KAMAZ,EAAAmB,EAAA,SAAAf,GACA,GAAAQ,GAAAR,KAAAgB,WACA,WAA2B,MAAAhB,GAAA,SAC3B,WAAiC,MAAAA,GAEjC,OADAJ,GAAAU,EAAAE,EAAA,IAAAA,GACAA,GAIAZ,EAAAa,EAAA,SAAAQ,EAAAC,GAAsD,MAAAR,QAAAS,UAAAC,eAAAjB,KAAAc,EAAAC,IAGtDtB,EAAAyB,EAAA,GAGAzB,IAAA0B,EAAA,KDMMC,EACA,SAAUvB,EAAQD,GEpExBC,EAAAD,QAAAyB,QF0EMC,EACA,SAAUzB,EAAQD,EAASH,GAEjC,YGvEA,KAAM,GANN8B,GAAA9B,EAAA,GHkFI+B,EAEJ,SAAgCC,GAAO,MAAOA,IAAOA,EAAIZ,WAAaY,GAAQC,QAASD,IAFjDF,GGhFhCI,EAAiBC,SAASC,iBAAkB,0BAC5CC,EAAiBF,SAASG,eAAgB,wBAC1CC,EAAiBJ,SAASK,cAAe,2BAErCnC,EAAI,EAAGA,EAAI6B,EAAUO,OAAQpC,KACtC,EAAA0B,EAAAE,SAAQC,EAAU7B,IAAKqC,GAAI,QAAS,WACnCL,EAASM,QACTJ,EAAeI","file":"admin-distributed-post.min.js","sourcesContent":["/******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 5);\n/******/ })\n/************************************************************************/\n/******/ ({\n\n/***/ 0:\n/***/ (function(module, exports) {\n\nmodule.exports = jQuery;\n\n/***/ }),\n\n/***/ 5:\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar _jquery = __webpack_require__(0);\n\nvar _jquery2 = _interopRequireDefault(_jquery);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar openLinks = document.querySelectorAll('.open-distributor-help');\nvar helpLink = document.getElementById('contextual-help-link');\nvar distributorTab = document.querySelector('#tab-link-distributer a');\n\nfor (var i = 0; i < openLinks.length; i++) {\n\t(0, _jquery2.default)(openLinks[i]).on('click', function () {\n\t\thelpLink.click();\n\t\tdistributorTab.click();\n\t});\n}\n\n/***/ })\n\n/******/ });\n\n\n// WEBPACK FOOTER //\n// admin-distributed-post.min.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 5);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap fff10cbf8520b51427a4","module.exports = jQuery;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"jQuery\"\n// module id = 0\n// module chunks = 0 1 4 5","import jQuery from 'jquery';\n\nconst openLinks = document.querySelectorAll( '.open-distributor-help' );\nconst helpLink = document.getElementById( 'contextual-help-link' );\nconst distributorTab = document.querySelector( '#tab-link-distributer a' );\n\nfor ( let i = 0; i < openLinks.length; i++ ) {\n\tjQuery( openLinks[i] ).on( 'click', () => {\n\t\thelpLink.click();\n\t\tdistributorTab.click();\n\t} );\n}\n\n\n\n// WEBPACK FOOTER //\n// ./assets/js/admin-distributed-post.js"],"sourceRoot":""}
\ No newline at end of file
diff --git a/dist/js/admin-external-connection.min.js.map b/dist/js/admin-external-connection.min.js.map
index 69c6cf083..9d73c6af3 100644
--- a/dist/js/admin-external-connection.min.js.map
+++ b/dist/js/admin-external-connection.min.js.map
@@ -1 +1 @@
-{"version":3,"sources":["webpack:///admin-external-connection.min.js","webpack:///webpack/bootstrap f1938fcf27bd493f1dae","webpack:///external \"jQuery\"","webpack:///external \"window\"","webpack:///external \"_\"","webpack:///./assets/js/admin-external-connection.js"],"names":["modules","__webpack_require__","moduleId","installedModules","exports","module","i","l","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","jQuery","window","_","_interopRequireDefault","obj","default","checkConnections","$apiVerify","abort","externalConnectionUrlField","value","endpointErrors","innerText","endpointResult","removeAttribute","setAttribute","_window","dt","endpoint_checking_message","auth","_underscores2","each","authFields","authField","disabled","key","getAttribute","postId","postIdField","_jquery2","ajax","url","method","data","nonce","action","type","externalConnectionTypeField","endpointId","done","response","success","errors","no_external_connection","endpoint_suggestion","suggestion","document","createElement","classList","add","appendChild","bad_connection","no_distributor","can_post","length","limited_connection","warnings","bad_auth","push","no_push","pull_limited","forEach","warning","warningNode","append","good_connection","complete","remove","_jquery","_underscores","getElementsByClassName","externalConnectionMetaBox","getElementById","rolesAllowed","titleField","querySelector","setTimeout","on","event","currentTarget","trigger","debounce","replace","focus","blur","passwordField","usernameField","changePassword","style","display","preventDefault","cancel","change","target","contains","checked","alert","roles_warning","$hideUntilAuthed","$authCredentials","$clientSecret","$clientId","hideItemsRequiringAuth","hide","validateField","$field","val","addClass","removeClass","slug","show","createConnectionButton","validateClientSecret","validateClientId","changeCredentials","$authenticationDetailsWrapper","beginAuthorize","$titleEl","title","id","admin_url","history","pushState"],"mappings":"CAAS,SAAUA,GCInB,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAE,OAGA,IAAAC,GAAAF,EAAAD,IACAI,EAAAJ,EACAK,GAAA,EACAH,WAUA,OANAJ,GAAAE,GAAAM,KAAAH,EAAAD,QAAAC,IAAAD,QAAAH,GAGAI,EAAAE,GAAA,EAGAF,EAAAD,QAvBA,GAAAD,KA4BAF,GAAAQ,EAAAT,EAGAC,EAAAS,EAAAP,EAGAF,EAAAU,EAAA,SAAAP,EAAAQ,EAAAC,GACAZ,EAAAa,EAAAV,EAAAQ,IACAG,OAAAC,eAAAZ,EAAAQ,GACAK,cAAA,EACAC,YAAA,EACAC,IAAAN,KAMAZ,EAAAmB,EAAA,SAAAf,GACA,GAAAQ,GAAAR,KAAAgB,WACA,WAA2B,MAAAhB,GAAA,SAC3B,WAAiC,MAAAA,GAEjC,OADAJ,GAAAU,EAAAE,EAAA,IAAAA,GACAA,GAIAZ,EAAAa,EAAA,SAAAQ,EAAAC,GAAsD,MAAAR,QAAAS,UAAAC,eAAAjB,KAAAc,EAAAC,IAGtDtB,EAAAyB,EAAA,GAGAzB,IAAA0B,EAAA,KDMM,SAAUtB,EAAQD,GEnExBC,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YAAa,kBAGtB/E,EAAAxB,QAAOyB,MACNC,cACAC,OAAQ,OACRC,MACCC,MAAOlB,EAAAC,GAAGiB,MACVC,OAAQ,yBACRmF,MAAOA,EACPC,IAAI,EAAA1F,EAAAxB,SAAQyC,SAAS0B,eAAgB,YAAckC,SAEjDnE,KAAM,SAAEC,GACX,GAAKA,EAASC,SAAWD,EAASP,KAAKsF,GAAK,CAG3C,GAAMxF,GAAMf,EAAAC,GAAGuG,UAAY,iBAAmBhF,EAASP,KAAKsF,GAAM,cAClEE,SAAQC,aAAe,0BAA2B3F,IAGlD,EAAAF,EAAAxB,SAAQyC,SAAS0B,eAAgB,oBAAsBkC,IAAK3E,IAC5D,EAAAF,EAAAxB,SAAQyC,SAAS0B,eAAgB,uBAAyBkC,IAAKlE,EAASP,KAAKsF,KAC7E,EAAA1F,EAAAxB,SAAQyC,SAAS0B,eAAgB,yBAA2BkC,IAAK,YAGjE,EAAA7E,EAAAxB,SAAQ,uCAAwCkG,OAChDY,EAA8BL,UAI5B5C,SAAU,YAGb,EAAArC,EAAAxB,SAAQ+G,GAAiBR,YAAa","file":"admin-external-connection.min.js","sourcesContent":["/******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 3);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports) {\n\nmodule.exports = jQuery;\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports) {\n\nmodule.exports = window;\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports) {\n\nmodule.exports = _;\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar _jquery = __webpack_require__(0);\n\nvar _jquery2 = _interopRequireDefault(_jquery);\n\nvar _underscores = __webpack_require__(2);\n\nvar _underscores2 = _interopRequireDefault(_underscores);\n\nvar _window = __webpack_require__(1);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar externalConnectionUrlField = document.getElementsByClassName('external-connection-url-field')[0];\nvar externalConnectionMetaBox = document.getElementById('dt_external_connection_details');\nvar externalConnectionTypeField = document.getElementsByClassName('external-connection-type-field')[0];\nvar authFields = document.getElementsByClassName('auth-field');\nvar rolesAllowed = document.getElementsByClassName('dt-roles-allowed');\nvar titleField = document.getElementById('title');\nvar endpointResult = document.querySelector('.endpoint-result');\nvar endpointErrors = document.querySelector('.endpoint-errors');\nvar postIdField = document.getElementById('post_ID');\nvar $apiVerify = false;\n\n/**\n * Check the external connection.\n */\nfunction checkConnections() {\n\tif (false !== $apiVerify) {\n\t\t$apiVerify.abort();\n\t}\n\n\tif ('' === externalConnectionUrlField.value) {\n\t\tendpointErrors.innerText = '';\n\t\tendpointResult.innerText = '';\n\n\t\tendpointResult.removeAttribute('data-endpoint-state');\n\t\treturn;\n\t}\n\n\tendpointResult.setAttribute('data-endpoint-state', 'loading');\n\tendpointResult.innerText = _window.dt.endpoint_checking_message;\n\n\tendpointErrors.innerText = '';\n\n\tvar auth = {};\n\n\t_underscores2.default.each(authFields, function (authField) {\n\t\tif (authField.disabled) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar key = authField.getAttribute('data-auth-field');\n\n\t\tif (key) {\n\t\t\tauth[key] = authField.value;\n\t\t}\n\t});\n\n\tvar postId = 0;\n\tif (postIdField && postIdField.value) {\n\t\tpostId = postIdField.value;\n\t}\n\n\t$apiVerify = _jquery2.default.ajax({\n\t\turl: _window.ajaxurl,\n\t\tmethod: 'post',\n\t\tdata: {\n\t\t\tnonce: _window.dt.nonce,\n\t\t\taction: 'dt_verify_external_connection',\n\t\t\tauth: auth,\n\t\t\turl: externalConnectionUrlField.value,\n\t\t\ttype: externalConnectionTypeField.value,\n\t\t\tendpointId: postId\n\t\t}\n\t}).done(function (response) {\n\t\tif (!response.success) {\n\t\t\tendpointResult.setAttribute('data-endpoint-state', 'error');\n\t\t} else {\n\t\t\tif (response.data.errors.no_external_connection) {\n\t\t\t\tendpointResult.setAttribute('data-endpoint-state', 'error');\n\n\t\t\t\tif (response.data.endpoint_suggestion) {\n\t\t\t\t\tendpointResult.innerText = _window.dt.endpoint_suggestion + ' ';\n\n\t\t\t\t\tvar suggestion = document.createElement('a');\n\t\t\t\t\tsuggestion.classList.add('suggest');\n\t\t\t\t\tsuggestion.innerText = response.data.endpoint_suggestion;\n\n\t\t\t\t\tendpointResult.appendChild(suggestion);\n\t\t\t\t} else {\n\t\t\t\t\tendpointResult.innerText = _window.dt.bad_connection;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (response.data.errors.no_distributor || !response.data.can_post.length) {\n\t\t\t\t\tendpointResult.setAttribute('data-endpoint-state', 'warning');\n\t\t\t\t\tendpointResult.innerText = _window.dt.limited_connection;\n\n\t\t\t\t\tvar warnings = [];\n\n\t\t\t\t\tif (response.data.errors.no_distributor) {\n\t\t\t\t\t\tendpointResult.innerText += ' ' + _window.dt.no_distributor;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tendpointResult.innerText += ' ' + _window.dt.bad_auth;\n\t\t\t\t\t}\n\n\t\t\t\t\twarnings.push(_window.dt.no_push);\n\t\t\t\t\twarnings.push(_window.dt.pull_limited);\n\n\t\t\t\t\twarnings.forEach(function (warning) {\n\t\t\t\t\t\tvar warningNode = document.createElement('li');\n\t\t\t\t\t\twarningNode.innerText = warning;\n\n\t\t\t\t\t\tendpointErrors.append(warningNode);\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tendpointResult.setAttribute('data-endpoint-state', 'valid');\n\t\t\t\t\tendpointResult.innerText = _window.dt.good_connection;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}).complete(function () {\n\t\tendpointResult.classList.remove('loading');\n\t});\n}\n\nsetTimeout(function () {\n\tcheckConnections();\n}, 300);\n\n(0, _jquery2.default)(externalConnectionMetaBox).on('click', '.suggest', function (event) {\n\texternalConnectionUrlField.value = event.currentTarget.innerText;\n\t(0, _jquery2.default)(externalConnectionUrlField).trigger('input');\n});\n\n(0, _jquery2.default)(externalConnectionMetaBox).on('keyup input', '.auth-field, .external-connection-url-field', _underscores2.default.debounce(checkConnections, 250));\n\n(0, _jquery2.default)(externalConnectionUrlField).on('blur', function (event) {\n\tif ('' === titleField.value && '' !== event.currentTarget.value) {\n\t\ttitleField.value = event.currentTarget.value.replace(/https?:\\/\\//i, '');\n\t\ttitleField.focus();\n\t\ttitleField.blur();\n\t}\n});\n/**\n * JS for basic auth\n *\n * @todo separate\n */\nvar passwordField = document.getElementById('dt_password');\nvar usernameField = document.getElementById('dt_username');\nvar changePassword = document.querySelector('.change-password');\n\n(0, _jquery2.default)(usernameField).on('keyup change', _underscores2.default.debounce(function () {\n\tif (changePassword) {\n\t\tpasswordField.disabled = false;\n\t\tpasswordField.value = '';\n\t\tchangePassword.style.display = 'none';\n\t}\n}, 250));\n\n(0, _jquery2.default)(changePassword).on('click', function (event) {\n\tevent.preventDefault();\n\n\tif (passwordField.disabled) {\n\t\tpasswordField.disabled = false;\n\t\tpasswordField.value = '';\n\t\tevent.currentTarget.innerText = _window.dt.cancel;\n\t} else {\n\t\tpasswordField.disabled = true;\n\t\tpasswordField.value = 'sdfdsfsdfdsfdsfsd'; // filler password\n\t\tevent.currentTarget.innerText = _window.dt.change;\n\t}\n\n\tcheckConnections();\n});\n\n(0, _jquery2.default)(rolesAllowed).on('click', '.dt-role-checkbox', function (event) {\n\tif (!event.target.classList.contains('dt-role-checkbox')) {\n\t\treturn;\n\t}\n\n\tif (!event.target.checked) {\n\t\treturn;\n\t}\n\n\tif ('administrator' !== event.target.value && 'editor' !== event.target.value) {\n\t\talert(_window.dt.roles_warning); // eslint-disable-line no-alert\n\t}\n});\n\n/**\n * Code for WordPress.com Oauth2 Authentication.\n *\n * @todo separate out code.\n */\n\n/**\n * If the client id and secret are unavailable, hide all '.hide-until-authed' areas.\n *\n * For Oauth authentication, simplify the interface by hiding certain elements until the user has\n * completed the authorization process.\n *\n * Creates a cleaner flow for authorization by separating the authorization steps.\n */\nvar $hideUntilAuthed = (0, _jquery2.default)('.hide-until-authed'),\n $authCredentials = (0, _jquery2.default)('.auth-credentials'),\n $clientSecret = (0, _jquery2.default)(document.getElementById('dt_client_secret')),\n $clientId = (0, _jquery2.default)(document.getElementById('dt_client_id')),\n hideItemsRequiringAuth = function hideItemsRequiringAuth() {\n\tvar oauthconnectionestablished = document.getElementsByClassName('oauth-connection-established');\n\tif (0 === oauthconnectionestablished.length) {\n\t\t$hideUntilAuthed.hide();\n\t}\n},\n\n\n/**\n * Validate a form field, ensuring it is non-empty. Add an error class if empty.\n *\n * @param {jQuery DomElement} $field The field to check.\n */\nvalidateField = function validateField($field, event) {\n\tif ('' === $field.val()) {\n\t\tevent.preventDefault();\n\t\t$field.addClass('error-required');\n\t\treturn false;\n\t} else {\n\t\t$field.removeClass('error-required');\n\t}\n\treturn true;\n};\n\n/**\n * When the External connection type drop-down is changed, show the corresponding authorization fields.\n */\n(0, _jquery2.default)(externalConnectionTypeField).on('change', function () {\n\tvar slug = externalConnectionTypeField.value;\n\n\t$authCredentials.hide();\n\t(0, _jquery2.default)('.auth-credentials.' + slug).show();\n\n\t// For WordPress.com Oauth authentication, hide fields until authentication is complete.\n\tif ('wpdotcom' === slug) {\n\t\thideItemsRequiringAuth();\n\t} else {\n\n\t\t// Otherwise, ensure all areas are showing.\n\t\t$hideUntilAuthed.show();\n\t}\n});\n\n// On load for WordPress.com Oauth authentication, hide fields until authentication is complete.\nif ('wpdotcom' === externalConnectionTypeField.value) {\n\thideItemsRequiringAuth();\n}\n\n// When authorization is initiated, ensure fields are non-empty.\nvar createConnectionButton = document.getElementById('create-oauth-connection');\nif (createConnectionButton) {\n\t(0, _jquery2.default)(createConnectionButton).on('click', function (event) {\n\t\tvar validateClientSecret = validateField($clientSecret, event),\n\t\t validateClientId = validateField($clientId, event);\n\t\tif (!validateClientSecret || !validateClientId) {\n\t\t\tevent.preventDefault();\n\t\t\treturn false;\n\t\t}\n\t});\n}\n\n// Handle the changeCredentials link.\nvar changeCredentials = document.getElementById('oauth-authentication-change-credentials'),\n $authenticationDetailsWrapper = (0, _jquery2.default)('.oauth-authentication-details-wrapper');\n\nif (changeCredentials) {\n\n\t(0, _jquery2.default)(changeCredentials).on('click', function () {\n\n\t\t// Show the credentials fields.\n\t\t$authenticationDetailsWrapper.show();\n\n\t\t// Clear the secret field.\n\t\t$clientSecret.val('');\n\n\t\t// Remove the authorized message.\n\t\t(0, _jquery2.default)('.oauth-connection-established').remove();\n\n\t\t// Hide the remaining fields that only show after authorization is complete.\n\t\thideItemsRequiringAuth();\n\t});\n}\n\n// Handle the Authorize Connection button.\nvar beginAuthorize = document.getElementById('begin-authorization');\nif (beginAuthorize) {\n\n\t// Handle click to the wpdotcom begin-authorization button.\n\t(0, _jquery2.default)(beginAuthorize).on('click', function (event) {\n\t\tvar $titleEl = (0, _jquery2.default)(titleField),\n\t\t title = $titleEl.val();\n\n\t\t// Ensure the connection title is not blank.\n\t\tif (validateField($titleEl, event)) {\n\n\t\t\t// Disable the button during the ajax request.\n\t\t\t(0, _jquery2.default)(beginAuthorize).addClass('disabled');\n\n\t\t\t// Remove any error highlighting.\n\t\t\t$titleEl.removeClass('error-required');\n\n\t\t\t// Make an ajax request to save the connection and retrieve the resulting post id.\n\t\t\t_jquery2.default.ajax({\n\t\t\t\turl: _window.ajaxurl,\n\t\t\t\tmethod: 'post',\n\t\t\t\tdata: {\n\t\t\t\t\tnonce: _window.dt.nonce,\n\t\t\t\t\taction: 'dt_begin_authorization',\n\t\t\t\t\ttitle: title,\n\t\t\t\t\tid: (0, _jquery2.default)(document.getElementById('post_ID')).val()\n\t\t\t\t}\n\t\t\t}).done(function (response) {\n\t\t\t\tif (response.success && response.data.id) {\n\n\t\t\t\t\t// The post has been saved, update the url in case the user refreshes.\n\t\t\t\t\tvar url = _window.dt.admin_url + 'post.php?post=' + response.data.id + '&action=edit';\n\t\t\t\t\thistory.pushState({}, 'Oauth Authorize Details', url);\n\n\t\t\t\t\t// Update the form field for dt_redirect_uri and post id.\n\t\t\t\t\t(0, _jquery2.default)(document.getElementById('dt_redirect_uri')).val(url);\n\t\t\t\t\t(0, _jquery2.default)(document.getElementById('dt_created_post_id')).val(response.data.id);\n\t\t\t\t\t(0, _jquery2.default)(document.getElementById('original_post_status')).val('publish');\n\n\t\t\t\t\t// Hide the first step and show the authentication details.\n\t\t\t\t\t(0, _jquery2.default)('.oauth-begin-authentication-wrapper').hide();\n\t\t\t\t\t$authenticationDetailsWrapper.show();\n\t\t\t\t} else {\n\t\t\t\t\t// @todo handle errors.\n\t\t\t\t}\n\t\t\t}).complete(function () {\n\n\t\t\t\t// Ensure the\n\t\t\t\t(0, _jquery2.default)(beginAuthorize).removeClass('disabled');\n\t\t\t});\n\t\t}\n\t});\n}\n\n/***/ })\n/******/ ]);\n\n\n// WEBPACK FOOTER //\n// admin-external-connection.min.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 3);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap f1938fcf27bd493f1dae","module.exports = jQuery;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"jQuery\"\n// module id = 0\n// module chunks = 0 1 4 5","module.exports = window;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"window\"\n// module id = 1\n// module chunks = 0 1 2 3","module.exports = _;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"_\"\n// module id = 2\n// module chunks = 0 1","import jQuery from 'jquery';\nimport _ from 'underscores';\nimport { dt, ajaxurl } from 'window';\n\nconst externalConnectionUrlField = document.getElementsByClassName( 'external-connection-url-field' )[0];\nconst externalConnectionMetaBox = document.getElementById( 'dt_external_connection_details' );\nconst externalConnectionTypeField = document.getElementsByClassName( 'external-connection-type-field' )[0];\nconst authFields = document.getElementsByClassName( 'auth-field' );\nconst rolesAllowed = document.getElementsByClassName( 'dt-roles-allowed' );\nconst titleField = document.getElementById( 'title' );\nconst endpointResult = document.querySelector( '.endpoint-result' );\nconst endpointErrors = document.querySelector( '.endpoint-errors' );\nconst postIdField = document.getElementById( 'post_ID' );\nlet $apiVerify = false;\n\n/**\n * Check the external connection.\n */\nfunction checkConnections() {\n\tif ( false !== $apiVerify ) {\n\t\t$apiVerify.abort();\n\t}\n\n\tif ( '' === externalConnectionUrlField.value ) {\n\t\tendpointErrors.innerText = '';\n\t\tendpointResult.innerText = '';\n\n\t\tendpointResult.removeAttribute( 'data-endpoint-state' );\n\t\treturn;\n\t}\n\n\tendpointResult.setAttribute( 'data-endpoint-state', 'loading' );\n\tendpointResult.innerText = dt.endpoint_checking_message;\n\n\tendpointErrors.innerText = '';\n\n\tconst auth = {};\n\n\t_.each( authFields, ( authField ) => {\n\t\tif ( authField.disabled ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar key = authField.getAttribute( 'data-auth-field' );\n\n\t\tif ( key ) {\n\t\t\tauth[key] = authField.value;\n\t\t}\n\t} );\n\n\tlet postId = 0;\n\tif ( postIdField && postIdField.value ) {\n\t\tpostId = postIdField.value;\n\t}\n\n\t$apiVerify = jQuery.ajax( {\n\t\turl: ajaxurl,\n\t\tmethod: 'post',\n\t\tdata: {\n\t\t\tnonce: dt.nonce,\n\t\t\taction: 'dt_verify_external_connection',\n\t\t\tauth: auth,\n\t\t\turl: externalConnectionUrlField.value,\n\t\t\ttype: externalConnectionTypeField.value,\n\t\t\tendpointId: postId\n\t\t}\n\t} ).done( ( response ) => {\n\t\tif ( ! response.success ) {\n\t\t\tendpointResult.setAttribute( 'data-endpoint-state', 'error' );\n\t\t} else {\n\t\t\tif ( response.data.errors.no_external_connection ) {\n\t\t\t\tendpointResult.setAttribute( 'data-endpoint-state', 'error' );\n\n\t\t\t\tif ( response.data.endpoint_suggestion ) {\n\t\t\t\t\tendpointResult.innerText = dt.endpoint_suggestion + ' ';\n\n\t\t\t\t\tconst suggestion = document.createElement( 'a' );\n\t\t\t\t\tsuggestion.classList.add( 'suggest' );\n\t\t\t\t\tsuggestion.innerText = response.data.endpoint_suggestion;\n\n\t\t\t\t\tendpointResult.appendChild( suggestion );\n\t\t\t\t} else {\n\t\t\t\t\tendpointResult.innerText = dt.bad_connection;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ( response.data.errors.no_distributor || ! response.data.can_post.length ) {\n\t\t\t\t\tendpointResult.setAttribute( 'data-endpoint-state', 'warning' );\n\t\t\t\t\tendpointResult.innerText = dt.limited_connection;\n\n\t\t\t\t\tconst warnings = [];\n\n\t\t\t\t\tif ( response.data.errors.no_distributor ) {\n\t\t\t\t\t\tendpointResult.innerText += ' ' + dt.no_distributor;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tendpointResult.innerText += ' ' + dt.bad_auth;\n\t\t\t\t\t}\n\n\t\t\t\t\twarnings.push( dt.no_push );\n\t\t\t\t\twarnings.push( dt.pull_limited );\n\n\t\t\t\t\twarnings.forEach( ( warning ) => {\n\t\t\t\t\t\tconst warningNode = document.createElement( 'li' );\n\t\t\t\t\t\twarningNode.innerText = warning;\n\n\t\t\t\t\t\tendpointErrors.append( warningNode );\n\t\t\t\t\t} );\n\t\t\t\t} else {\n\t\t\t\t\tendpointResult.setAttribute( 'data-endpoint-state', 'valid' );\n\t\t\t\t\tendpointResult.innerText = dt.good_connection;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} ).complete( () => {\n\t\tendpointResult.classList.remove( 'loading' );\n\t} );\n}\n\nsetTimeout( () => {\n\tcheckConnections();\n}, 300 );\n\njQuery( externalConnectionMetaBox ).on( 'click', '.suggest', ( event ) => {\n\texternalConnectionUrlField.value = event.currentTarget.innerText;\n\tjQuery( externalConnectionUrlField ).trigger( 'input' );\n} );\n\njQuery( externalConnectionMetaBox ).on( 'keyup input', '.auth-field, .external-connection-url-field', _.debounce( checkConnections, 250 ) );\n\njQuery( externalConnectionUrlField ).on( 'blur', ( event ) => {\n\tif ( '' === titleField.value && '' !== event.currentTarget.value ) {\n\t\ttitleField.value = event.currentTarget.value.replace( /https?:\\/\\//i, '' );\n\t\ttitleField.focus();\n\t\ttitleField.blur();\n\t}\n} );\n/**\n * JS for basic auth\n *\n * @todo separate\n */\nconst passwordField = document.getElementById( 'dt_password' );\nconst usernameField = document.getElementById( 'dt_username' );\nconst changePassword = document.querySelector( '.change-password' );\n\njQuery( usernameField ).on( 'keyup change', _.debounce( () => {\n\tif ( changePassword ) {\n\t\tpasswordField.disabled = false;\n\t\tpasswordField.value = '';\n\t\tchangePassword.style.display = 'none';\n\t}\n}, 250 ) );\n\njQuery( changePassword ).on( 'click', ( event ) => {\n\tevent.preventDefault();\n\n\tif ( passwordField.disabled ) {\n\t\tpasswordField.disabled = false;\n\t\tpasswordField.value = '';\n\t\tevent.currentTarget.innerText = dt.cancel;\n\t} else {\n\t\tpasswordField.disabled = true;\n\t\tpasswordField.value = 'sdfdsfsdfdsfdsfsd'; // filler password\n\t\tevent.currentTarget.innerText = dt.change;\n\t}\n\n\tcheckConnections();\n} );\n\njQuery( rolesAllowed ).on( 'click', '.dt-role-checkbox', ( event ) => {\n\tif ( ! event.target.classList.contains( 'dt-role-checkbox' ) ) {\n\t\treturn;\n\t}\n\n\tif ( ! event.target.checked ) {\n\t\treturn;\n\t}\n\n\tif ( 'administrator' !== event.target.value && 'editor' !== event.target.value ) {\n\t\talert( dt.roles_warning ); // eslint-disable-line no-alert\n\t}\n} );\n\n/**\n * Code for WordPress.com Oauth2 Authentication.\n *\n * @todo separate out code.\n */\n\n/**\n * If the client id and secret are unavailable, hide all '.hide-until-authed' areas.\n *\n * For Oauth authentication, simplify the interface by hiding certain elements until the user has\n * completed the authorization process.\n *\n * Creates a cleaner flow for authorization by separating the authorization steps.\n */\nconst $hideUntilAuthed = jQuery( '.hide-until-authed' ),\n\t$authCredentials = jQuery( '.auth-credentials' ),\n\t$clientSecret = jQuery( document.getElementById( 'dt_client_secret' ) ),\n\t$clientId = jQuery( document.getElementById( 'dt_client_id' ) ),\n\thideItemsRequiringAuth = () => {\n\t\tconst oauthconnectionestablished = document.getElementsByClassName( 'oauth-connection-established' );\n\t\tif ( 0 === oauthconnectionestablished.length ) {\n\t\t\t$hideUntilAuthed.hide();\n\t\t}\n\t},\n\n\t/**\n\t * Validate a form field, ensuring it is non-empty. Add an error class if empty.\n\t *\n\t * @param {jQuery DomElement} $field The field to check.\n\t */\n\tvalidateField = ( $field, event ) => {\n\t\tif ( '' === $field.val() ) {\n\t\t\tevent.preventDefault();\n\t\t\t$field.addClass( 'error-required' );\n\t\t\treturn false;\n\t\t} else {\n\t\t\t$field.removeClass( 'error-required' );\n\t\t}\n\t\treturn true;\n\t};\n\n/**\n * When the External connection type drop-down is changed, show the corresponding authorization fields.\n */\njQuery( externalConnectionTypeField ).on( 'change', () => {\n\tconst slug = externalConnectionTypeField.value;\n\n\t$authCredentials.hide();\n\tjQuery( '.auth-credentials.' + slug ).show();\n\n\t// For WordPress.com Oauth authentication, hide fields until authentication is complete.\n\tif ( 'wpdotcom' === slug ) {\n\t\thideItemsRequiringAuth();\n\t} else {\n\n\t\t// Otherwise, ensure all areas are showing.\n\t\t$hideUntilAuthed.show();\n\t}\n} );\n\n\n// On load for WordPress.com Oauth authentication, hide fields until authentication is complete.\nif ( 'wpdotcom' === externalConnectionTypeField.value ) {\n\thideItemsRequiringAuth();\n}\n\n// When authorization is initiated, ensure fields are non-empty.\nconst createConnectionButton = document.getElementById( 'create-oauth-connection' );\nif ( createConnectionButton ) {\n\tjQuery( createConnectionButton ).on( 'click', ( event ) => {\n\t\tconst validateClientSecret = validateField( $clientSecret, event ),\n\t\t\tvalidateClientId = validateField( $clientId, event );\n\t\tif (\n\t\t\t! validateClientSecret ||\n\t\t\t! validateClientId\n\t\t) {\n\t\t\tevent.preventDefault();\n\t\t\treturn false;\n\t\t}\n\t} );\n}\n\n// Handle the changeCredentials link.\nconst changeCredentials = document.getElementById( 'oauth-authentication-change-credentials' ),\n\t$authenticationDetailsWrapper = jQuery( '.oauth-authentication-details-wrapper' );\n\nif ( changeCredentials ) {\n\n\tjQuery( changeCredentials ).on( 'click', function() {\n\n\t\t// Show the credentials fields.\n\t\t$authenticationDetailsWrapper.show();\n\n\t\t// Clear the secret field.\n\t\t$clientSecret.val( '' );\n\n\t\t// Remove the authorized message.\n\t\tjQuery( '.oauth-connection-established' ).remove();\n\n\t\t// Hide the remaining fields that only show after authorization is complete.\n\t\thideItemsRequiringAuth();\n\t} );\n}\n\n// Handle the Authorize Connection button.\nconst beginAuthorize = document.getElementById( 'begin-authorization' );\nif ( beginAuthorize ) {\n\n\t// Handle click to the wpdotcom begin-authorization button.\n\tjQuery( beginAuthorize ).on( 'click', ( event ) => {\n\t\tconst $titleEl = jQuery( titleField ),\n\t\t\ttitle = $titleEl.val();\n\n\t\t// Ensure the connection title is not blank.\n\t\tif ( validateField( $titleEl, event ) ) {\n\n\t\t\t// Disable the button during the ajax request.\n\t\t\tjQuery( beginAuthorize ).addClass( 'disabled' );\n\n\t\t\t// Remove any error highlighting.\n\t\t\t$titleEl.removeClass( 'error-required' );\n\n\t\t\t// Make an ajax request to save the connection and retrieve the resulting post id.\n\t\t\tjQuery.ajax( {\n\t\t\t\turl: ajaxurl,\n\t\t\t\tmethod: 'post',\n\t\t\t\tdata: {\n\t\t\t\t\tnonce: dt.nonce,\n\t\t\t\t\taction: 'dt_begin_authorization',\n\t\t\t\t\ttitle: title,\n\t\t\t\t\tid: jQuery( document.getElementById( 'post_ID' ) ).val()\n\t\t\t\t}\n\t\t\t} ).done( ( response ) => {\n\t\t\t\tif ( response.success && response.data.id ) {\n\n\t\t\t\t\t// The post has been saved, update the url in case the user refreshes.\n\t\t\t\t\tconst url = dt.admin_url + 'post.php?post=' + response.data.id + '&action=edit';\n\t\t\t\t\thistory.pushState( {}, 'Oauth Authorize Details', url );\n\n\t\t\t\t\t// Update the form field for dt_redirect_uri and post id.\n\t\t\t\t\tjQuery( document.getElementById( 'dt_redirect_uri' ) ).val( url );\n\t\t\t\t\tjQuery( document.getElementById( 'dt_created_post_id' ) ).val( response.data.id );\n\t\t\t\t\tjQuery( document.getElementById( 'original_post_status' ) ).val( 'publish' );\n\n\t\t\t\t\t// Hide the first step and show the authentication details.\n\t\t\t\t\tjQuery( '.oauth-begin-authentication-wrapper' ).hide();\n\t\t\t\t\t$authenticationDetailsWrapper.show();\n\t\t\t\t} else {\n\t\t\t\t\t// @todo handle errors.\n\t\t\t\t}\n\t\t\t} ).complete( () => {\n\n\t\t\t\t// Ensure the\n\t\t\t\tjQuery( beginAuthorize ).removeClass( 'disabled' );\n\t\t\t} );\n\t\t}\n\t} );\n}\n\n\n\n// WEBPACK FOOTER //\n// ./assets/js/admin-external-connection.js"],"sourceRoot":""}
\ No newline at end of file
+{"version":3,"sources":["webpack:///admin-external-connection.min.js","webpack:///webpack/bootstrap fff10cbf8520b51427a4","webpack:///external \"jQuery\"","webpack:///external \"window\"","webpack:///external \"_\"","webpack:///./assets/js/admin-external-connection.js"],"names":["modules","__webpack_require__","moduleId","installedModules","exports","module","i","l","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","jQuery","window","_","_interopRequireDefault","obj","default","checkConnections","$apiVerify","abort","externalConnectionUrlField","value","endpointErrors","innerText","endpointResult","removeAttribute","setAttribute","dt","endpoint_checking_message","auth","each","authFields","authField","disabled","key","getAttribute","postId","postIdField","ajax","url","ajaxurl","method","data","nonce","action","type","externalConnectionTypeField","endpointId","done","response","success","errors","no_external_connection","endpoint_suggestion","suggestion","document","createElement","classList","add","appendChild","bad_connection","no_distributor","can_post","length","limited_connection","warnings","bad_auth","push","no_push","pull_limited","forEach","warning","warningNode","append","good_connection","complete","remove","_jquery","_jquery2","_underscores","_underscores2","_window","getElementsByClassName","externalConnectionMetaBox","getElementById","rolesAllowed","titleField","querySelector","setTimeout","on","event","currentTarget","trigger","debounce","replace","focus","blur","passwordField","usernameField","changePassword","style","display","preventDefault","cancel","change","target","contains","checked","alert","roles_warning","$hideUntilAuthed","$authCredentials","$clientSecret","$clientId","hideItemsRequiringAuth","hide","validateField","$field","val","addClass","removeClass","slug","show","createConnectionButton","validateClientSecret","validateClientId","changeCredentials","$authenticationDetailsWrapper","beginAuthorize","$titleEl","title","id","admin_url","history","pushState"],"mappings":"CAAS,SAAUA,GCInB,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GA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connection.min.js","sourcesContent":["/******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 3);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports) {\n\nmodule.exports = jQuery;\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports) {\n\nmodule.exports = window;\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports) {\n\nmodule.exports = _;\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar _jquery = __webpack_require__(0);\n\nvar _jquery2 = _interopRequireDefault(_jquery);\n\nvar _underscores = __webpack_require__(2);\n\nvar _underscores2 = _interopRequireDefault(_underscores);\n\nvar _window = __webpack_require__(1);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar externalConnectionUrlField = document.getElementsByClassName('external-connection-url-field')[0];\nvar externalConnectionMetaBox = document.getElementById('dt_external_connection_details');\nvar externalConnectionTypeField = document.getElementsByClassName('external-connection-type-field')[0];\nvar authFields = document.getElementsByClassName('auth-field');\nvar rolesAllowed = document.getElementsByClassName('dt-roles-allowed');\nvar titleField = document.getElementById('title');\nvar endpointResult = document.querySelector('.endpoint-result');\nvar endpointErrors = document.querySelector('.endpoint-errors');\nvar postIdField = document.getElementById('post_ID');\nvar $apiVerify = false;\n\n/**\n * Check the external connection.\n */\nfunction checkConnections() {\n\tif (false !== $apiVerify) {\n\t\t$apiVerify.abort();\n\t}\n\n\tif ('' === externalConnectionUrlField.value) {\n\t\tendpointErrors.innerText = '';\n\t\tendpointResult.innerText = '';\n\n\t\tendpointResult.removeAttribute('data-endpoint-state');\n\t\treturn;\n\t}\n\n\tendpointResult.setAttribute('data-endpoint-state', 'loading');\n\tendpointResult.innerText = _window.dt.endpoint_checking_message;\n\n\tendpointErrors.innerText = '';\n\n\tvar auth = {};\n\n\t_underscores2.default.each(authFields, function (authField) {\n\t\tif (authField.disabled) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar key = authField.getAttribute('data-auth-field');\n\n\t\tif (key) {\n\t\t\tauth[key] = authField.value;\n\t\t}\n\t});\n\n\tvar postId = 0;\n\tif (postIdField && postIdField.value) {\n\t\tpostId = postIdField.value;\n\t}\n\n\t$apiVerify = _jquery2.default.ajax({\n\t\turl: _window.ajaxurl,\n\t\tmethod: 'post',\n\t\tdata: {\n\t\t\tnonce: _window.dt.nonce,\n\t\t\taction: 'dt_verify_external_connection',\n\t\t\tauth: auth,\n\t\t\turl: externalConnectionUrlField.value,\n\t\t\ttype: externalConnectionTypeField.value,\n\t\t\tendpointId: postId\n\t\t}\n\t}).done(function (response) {\n\t\tif (!response.success) {\n\t\t\tendpointResult.setAttribute('data-endpoint-state', 'error');\n\t\t} else {\n\t\t\tif (response.data.errors.no_external_connection) {\n\t\t\t\tendpointResult.setAttribute('data-endpoint-state', 'error');\n\n\t\t\t\tif (response.data.endpoint_suggestion) {\n\t\t\t\t\tendpointResult.innerText = _window.dt.endpoint_suggestion + ' ';\n\n\t\t\t\t\tvar suggestion = document.createElement('a');\n\t\t\t\t\tsuggestion.classList.add('suggest');\n\t\t\t\t\tsuggestion.innerText = response.data.endpoint_suggestion;\n\n\t\t\t\t\tendpointResult.appendChild(suggestion);\n\t\t\t\t} else {\n\t\t\t\t\tendpointResult.innerText = _window.dt.bad_connection;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (response.data.errors.no_distributor || !response.data.can_post.length) {\n\t\t\t\t\tendpointResult.setAttribute('data-endpoint-state', 'warning');\n\t\t\t\t\tendpointResult.innerText = _window.dt.limited_connection;\n\n\t\t\t\t\tvar warnings = [];\n\n\t\t\t\t\tif (response.data.errors.no_distributor) {\n\t\t\t\t\t\tendpointResult.innerText += ' ' + _window.dt.no_distributor;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tendpointResult.innerText += ' ' + _window.dt.bad_auth;\n\t\t\t\t\t}\n\n\t\t\t\t\twarnings.push(_window.dt.no_push);\n\t\t\t\t\twarnings.push(_window.dt.pull_limited);\n\n\t\t\t\t\twarnings.forEach(function (warning) {\n\t\t\t\t\t\tvar warningNode = document.createElement('li');\n\t\t\t\t\t\twarningNode.innerText = warning;\n\n\t\t\t\t\t\tendpointErrors.append(warningNode);\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tendpointResult.setAttribute('data-endpoint-state', 'valid');\n\t\t\t\t\tendpointResult.innerText = _window.dt.good_connection;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}).complete(function () {\n\t\tendpointResult.classList.remove('loading');\n\t});\n}\n\nsetTimeout(function () {\n\tcheckConnections();\n}, 300);\n\n(0, _jquery2.default)(externalConnectionMetaBox).on('click', '.suggest', function (event) {\n\texternalConnectionUrlField.value = event.currentTarget.innerText;\n\t(0, _jquery2.default)(externalConnectionUrlField).trigger('input');\n});\n\n(0, _jquery2.default)(externalConnectionMetaBox).on('keyup input', '.auth-field, .external-connection-url-field', _underscores2.default.debounce(checkConnections, 250));\n\n(0, _jquery2.default)(externalConnectionUrlField).on('blur', function (event) {\n\tif ('' === titleField.value && '' !== event.currentTarget.value) {\n\t\ttitleField.value = event.currentTarget.value.replace(/https?:\\/\\//i, '');\n\t\ttitleField.focus();\n\t\ttitleField.blur();\n\t}\n});\n/**\n * JS for basic auth\n *\n * @todo separate\n */\nvar passwordField = document.getElementById('dt_password');\nvar usernameField = document.getElementById('dt_username');\nvar changePassword = document.querySelector('.change-password');\n\n(0, _jquery2.default)(usernameField).on('keyup change', _underscores2.default.debounce(function () {\n\tif (changePassword) {\n\t\tpasswordField.disabled = false;\n\t\tpasswordField.value = '';\n\t\tchangePassword.style.display = 'none';\n\t}\n}, 250));\n\n(0, _jquery2.default)(changePassword).on('click', function (event) {\n\tevent.preventDefault();\n\n\tif (passwordField.disabled) {\n\t\tpasswordField.disabled = false;\n\t\tpasswordField.value = '';\n\t\tevent.currentTarget.innerText = _window.dt.cancel;\n\t} else {\n\t\tpasswordField.disabled = true;\n\t\tpasswordField.value = 'sdfdsfsdfdsfdsfsd'; // filler password\n\t\tevent.currentTarget.innerText = _window.dt.change;\n\t}\n\n\tcheckConnections();\n});\n\n(0, _jquery2.default)(rolesAllowed).on('click', '.dt-role-checkbox', function (event) {\n\tif (!event.target.classList.contains('dt-role-checkbox')) {\n\t\treturn;\n\t}\n\n\tif (!event.target.checked) {\n\t\treturn;\n\t}\n\n\tif ('administrator' !== event.target.value && 'editor' !== event.target.value) {\n\t\talert(_window.dt.roles_warning); // eslint-disable-line no-alert\n\t}\n});\n\n/**\n * Code for WordPress.com Oauth2 Authentication.\n *\n * @todo separate out code.\n */\n\n/**\n * If the client id and secret are unavailable, hide all '.hide-until-authed' areas.\n *\n * For Oauth authentication, simplify the interface by hiding certain elements until the user has\n * completed the authorization process.\n *\n * Creates a cleaner flow for authorization by separating the authorization steps.\n */\nvar $hideUntilAuthed = (0, _jquery2.default)('.hide-until-authed'),\n $authCredentials = (0, _jquery2.default)('.auth-credentials'),\n $clientSecret = (0, _jquery2.default)(document.getElementById('dt_client_secret')),\n $clientId = (0, _jquery2.default)(document.getElementById('dt_client_id')),\n hideItemsRequiringAuth = function hideItemsRequiringAuth() {\n\tvar oauthconnectionestablished = document.getElementsByClassName('oauth-connection-established');\n\tif (0 === oauthconnectionestablished.length) {\n\t\t$hideUntilAuthed.hide();\n\t}\n},\n\n\n/**\n * Validate a form field, ensuring it is non-empty. Add an error class if empty.\n *\n * @param {jQuery DomElement} $field The field to check.\n */\nvalidateField = function validateField($field, event) {\n\tif ('' === $field.val()) {\n\t\tevent.preventDefault();\n\t\t$field.addClass('error-required');\n\t\treturn false;\n\t} else {\n\t\t$field.removeClass('error-required');\n\t}\n\treturn true;\n};\n\n/**\n * When the External connection type drop-down is changed, show the corresponding authorization fields.\n */\n(0, _jquery2.default)(externalConnectionTypeField).on('change', function () {\n\tvar slug = externalConnectionTypeField.value;\n\n\t$authCredentials.hide();\n\t(0, _jquery2.default)('.auth-credentials.' + slug).show();\n\n\t// For WordPress.com Oauth authentication, hide fields until authentication is complete.\n\tif ('wpdotcom' === slug) {\n\t\thideItemsRequiringAuth();\n\t} else {\n\n\t\t// Otherwise, ensure all areas are showing.\n\t\t$hideUntilAuthed.show();\n\t}\n});\n\n// On load for WordPress.com Oauth authentication, hide fields until authentication is complete.\nif ('wpdotcom' === externalConnectionTypeField.value) {\n\thideItemsRequiringAuth();\n}\n\n// When authorization is initiated, ensure fields are non-empty.\nvar createConnectionButton = document.getElementById('create-oauth-connection');\nif (createConnectionButton) {\n\t(0, _jquery2.default)(createConnectionButton).on('click', function (event) {\n\t\tvar validateClientSecret = validateField($clientSecret, event),\n\t\t validateClientId = validateField($clientId, event);\n\t\tif (!validateClientSecret || !validateClientId) {\n\t\t\tevent.preventDefault();\n\t\t\treturn false;\n\t\t}\n\t});\n}\n\n// Handle the changeCredentials link.\nvar changeCredentials = document.getElementById('oauth-authentication-change-credentials'),\n $authenticationDetailsWrapper = (0, _jquery2.default)('.oauth-authentication-details-wrapper');\n\nif (changeCredentials) {\n\n\t(0, _jquery2.default)(changeCredentials).on('click', function () {\n\n\t\t// Show the credentials fields.\n\t\t$authenticationDetailsWrapper.show();\n\n\t\t// Clear the secret field.\n\t\t$clientSecret.val('');\n\n\t\t// Remove the authorized message.\n\t\t(0, _jquery2.default)('.oauth-connection-established').remove();\n\n\t\t// Hide the remaining fields that only show after authorization is complete.\n\t\thideItemsRequiringAuth();\n\t});\n}\n\n// Handle the Authorize Connection button.\nvar beginAuthorize = document.getElementById('begin-authorization');\nif (beginAuthorize) {\n\n\t// Handle click to the wpdotcom begin-authorization button.\n\t(0, _jquery2.default)(beginAuthorize).on('click', function (event) {\n\t\tvar $titleEl = (0, _jquery2.default)(titleField),\n\t\t title = $titleEl.val();\n\n\t\t// Ensure the connection title is not blank.\n\t\tif (validateField($titleEl, event)) {\n\n\t\t\t// Disable the button during the ajax request.\n\t\t\t(0, _jquery2.default)(beginAuthorize).addClass('disabled');\n\n\t\t\t// Remove any error highlighting.\n\t\t\t$titleEl.removeClass('error-required');\n\n\t\t\t// Make an ajax request to save the connection and retrieve the resulting post id.\n\t\t\t_jquery2.default.ajax({\n\t\t\t\turl: _window.ajaxurl,\n\t\t\t\tmethod: 'post',\n\t\t\t\tdata: {\n\t\t\t\t\tnonce: _window.dt.nonce,\n\t\t\t\t\taction: 'dt_begin_authorization',\n\t\t\t\t\ttitle: title,\n\t\t\t\t\tid: (0, _jquery2.default)(document.getElementById('post_ID')).val()\n\t\t\t\t}\n\t\t\t}).done(function (response) {\n\t\t\t\tif (response.success && response.data.id) {\n\n\t\t\t\t\t// The post has been saved, update the url in case the user refreshes.\n\t\t\t\t\tvar url = _window.dt.admin_url + 'post.php?post=' + response.data.id + '&action=edit';\n\t\t\t\t\thistory.pushState({}, 'Oauth Authorize Details', url);\n\n\t\t\t\t\t// Update the form field for dt_redirect_uri and post id.\n\t\t\t\t\t(0, _jquery2.default)(document.getElementById('dt_redirect_uri')).val(url);\n\t\t\t\t\t(0, _jquery2.default)(document.getElementById('dt_created_post_id')).val(response.data.id);\n\t\t\t\t\t(0, _jquery2.default)(document.getElementById('original_post_status')).val('publish');\n\n\t\t\t\t\t// Hide the first step and show the authentication details.\n\t\t\t\t\t(0, _jquery2.default)('.oauth-begin-authentication-wrapper').hide();\n\t\t\t\t\t$authenticationDetailsWrapper.show();\n\t\t\t\t} else {\n\t\t\t\t\t// @todo handle errors.\n\t\t\t\t}\n\t\t\t}).complete(function () {\n\n\t\t\t\t// Ensure the\n\t\t\t\t(0, _jquery2.default)(beginAuthorize).removeClass('disabled');\n\t\t\t});\n\t\t}\n\t});\n}\n\n/***/ })\n/******/ ]);\n\n\n// WEBPACK FOOTER //\n// admin-external-connection.min.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 3);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap fff10cbf8520b51427a4","module.exports = jQuery;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"jQuery\"\n// module id = 0\n// module chunks = 0 1 4 5","module.exports = window;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"window\"\n// module id = 1\n// module chunks = 0 1 2 3","module.exports = _;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"_\"\n// module id = 2\n// module chunks = 0 1","import jQuery from 'jquery';\nimport _ from 'underscores';\nimport { dt, ajaxurl } from 'window';\n\nconst externalConnectionUrlField = document.getElementsByClassName( 'external-connection-url-field' )[0];\nconst externalConnectionMetaBox = document.getElementById( 'dt_external_connection_details' );\nconst externalConnectionTypeField = document.getElementsByClassName( 'external-connection-type-field' )[0];\nconst authFields = document.getElementsByClassName( 'auth-field' );\nconst rolesAllowed = document.getElementsByClassName( 'dt-roles-allowed' );\nconst titleField = document.getElementById( 'title' );\nconst endpointResult = document.querySelector( '.endpoint-result' );\nconst endpointErrors = document.querySelector( '.endpoint-errors' );\nconst postIdField = document.getElementById( 'post_ID' );\nlet $apiVerify = false;\n\n/**\n * Check the external connection.\n */\nfunction checkConnections() {\n\tif ( false !== $apiVerify ) {\n\t\t$apiVerify.abort();\n\t}\n\n\tif ( '' === externalConnectionUrlField.value ) {\n\t\tendpointErrors.innerText = '';\n\t\tendpointResult.innerText = '';\n\n\t\tendpointResult.removeAttribute( 'data-endpoint-state' );\n\t\treturn;\n\t}\n\n\tendpointResult.setAttribute( 'data-endpoint-state', 'loading' );\n\tendpointResult.innerText = dt.endpoint_checking_message;\n\n\tendpointErrors.innerText = '';\n\n\tconst auth = {};\n\n\t_.each( authFields, ( authField ) => {\n\t\tif ( authField.disabled ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar key = authField.getAttribute( 'data-auth-field' );\n\n\t\tif ( key ) {\n\t\t\tauth[key] = authField.value;\n\t\t}\n\t} );\n\n\tlet postId = 0;\n\tif ( postIdField && postIdField.value ) {\n\t\tpostId = postIdField.value;\n\t}\n\n\t$apiVerify = jQuery.ajax( {\n\t\turl: ajaxurl,\n\t\tmethod: 'post',\n\t\tdata: {\n\t\t\tnonce: dt.nonce,\n\t\t\taction: 'dt_verify_external_connection',\n\t\t\tauth: auth,\n\t\t\turl: externalConnectionUrlField.value,\n\t\t\ttype: externalConnectionTypeField.value,\n\t\t\tendpointId: postId\n\t\t}\n\t} ).done( ( response ) => {\n\t\tif ( ! response.success ) {\n\t\t\tendpointResult.setAttribute( 'data-endpoint-state', 'error' );\n\t\t} else {\n\t\t\tif ( response.data.errors.no_external_connection ) {\n\t\t\t\tendpointResult.setAttribute( 'data-endpoint-state', 'error' );\n\n\t\t\t\tif ( response.data.endpoint_suggestion ) {\n\t\t\t\t\tendpointResult.innerText = dt.endpoint_suggestion + ' ';\n\n\t\t\t\t\tconst suggestion = document.createElement( 'a' );\n\t\t\t\t\tsuggestion.classList.add( 'suggest' );\n\t\t\t\t\tsuggestion.innerText = response.data.endpoint_suggestion;\n\n\t\t\t\t\tendpointResult.appendChild( suggestion );\n\t\t\t\t} else {\n\t\t\t\t\tendpointResult.innerText = dt.bad_connection;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ( response.data.errors.no_distributor || ! response.data.can_post.length ) {\n\t\t\t\t\tendpointResult.setAttribute( 'data-endpoint-state', 'warning' );\n\t\t\t\t\tendpointResult.innerText = dt.limited_connection;\n\n\t\t\t\t\tconst warnings = [];\n\n\t\t\t\t\tif ( response.data.errors.no_distributor ) {\n\t\t\t\t\t\tendpointResult.innerText += ' ' + dt.no_distributor;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tendpointResult.innerText += ' ' + dt.bad_auth;\n\t\t\t\t\t}\n\n\t\t\t\t\twarnings.push( dt.no_push );\n\t\t\t\t\twarnings.push( dt.pull_limited );\n\n\t\t\t\t\twarnings.forEach( ( warning ) => {\n\t\t\t\t\t\tconst warningNode = document.createElement( 'li' );\n\t\t\t\t\t\twarningNode.innerText = warning;\n\n\t\t\t\t\t\tendpointErrors.append( warningNode );\n\t\t\t\t\t} );\n\t\t\t\t} else {\n\t\t\t\t\tendpointResult.setAttribute( 'data-endpoint-state', 'valid' );\n\t\t\t\t\tendpointResult.innerText = dt.good_connection;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} ).complete( () => {\n\t\tendpointResult.classList.remove( 'loading' );\n\t} );\n}\n\nsetTimeout( () => {\n\tcheckConnections();\n}, 300 );\n\njQuery( externalConnectionMetaBox ).on( 'click', '.suggest', ( event ) => {\n\texternalConnectionUrlField.value = event.currentTarget.innerText;\n\tjQuery( externalConnectionUrlField ).trigger( 'input' );\n} );\n\njQuery( externalConnectionMetaBox ).on( 'keyup input', '.auth-field, .external-connection-url-field', _.debounce( checkConnections, 250 ) );\n\njQuery( externalConnectionUrlField ).on( 'blur', ( event ) => {\n\tif ( '' === titleField.value && '' !== event.currentTarget.value ) {\n\t\ttitleField.value = event.currentTarget.value.replace( /https?:\\/\\//i, '' );\n\t\ttitleField.focus();\n\t\ttitleField.blur();\n\t}\n} );\n/**\n * JS for basic auth\n *\n * @todo separate\n */\nconst passwordField = document.getElementById( 'dt_password' );\nconst usernameField = document.getElementById( 'dt_username' );\nconst changePassword = document.querySelector( '.change-password' );\n\njQuery( usernameField ).on( 'keyup change', _.debounce( () => {\n\tif ( changePassword ) {\n\t\tpasswordField.disabled = false;\n\t\tpasswordField.value = '';\n\t\tchangePassword.style.display = 'none';\n\t}\n}, 250 ) );\n\njQuery( changePassword ).on( 'click', ( event ) => {\n\tevent.preventDefault();\n\n\tif ( passwordField.disabled ) {\n\t\tpasswordField.disabled = false;\n\t\tpasswordField.value = '';\n\t\tevent.currentTarget.innerText = dt.cancel;\n\t} else {\n\t\tpasswordField.disabled = true;\n\t\tpasswordField.value = 'sdfdsfsdfdsfdsfsd'; // filler password\n\t\tevent.currentTarget.innerText = dt.change;\n\t}\n\n\tcheckConnections();\n} );\n\njQuery( rolesAllowed ).on( 'click', '.dt-role-checkbox', ( event ) => {\n\tif ( ! event.target.classList.contains( 'dt-role-checkbox' ) ) {\n\t\treturn;\n\t}\n\n\tif ( ! event.target.checked ) {\n\t\treturn;\n\t}\n\n\tif ( 'administrator' !== event.target.value && 'editor' !== event.target.value ) {\n\t\talert( dt.roles_warning ); // eslint-disable-line no-alert\n\t}\n} );\n\n/**\n * Code for WordPress.com Oauth2 Authentication.\n *\n * @todo separate out code.\n */\n\n/**\n * If the client id and secret are unavailable, hide all '.hide-until-authed' areas.\n *\n * For Oauth authentication, simplify the interface by hiding certain elements until the user has\n * completed the authorization process.\n *\n * Creates a cleaner flow for authorization by separating the authorization steps.\n */\nconst $hideUntilAuthed = jQuery( '.hide-until-authed' ),\n\t$authCredentials = jQuery( '.auth-credentials' ),\n\t$clientSecret = jQuery( document.getElementById( 'dt_client_secret' ) ),\n\t$clientId = jQuery( document.getElementById( 'dt_client_id' ) ),\n\thideItemsRequiringAuth = () => {\n\t\tconst oauthconnectionestablished = document.getElementsByClassName( 'oauth-connection-established' );\n\t\tif ( 0 === oauthconnectionestablished.length ) {\n\t\t\t$hideUntilAuthed.hide();\n\t\t}\n\t},\n\n\t/**\n\t * Validate a form field, ensuring it is non-empty. Add an error class if empty.\n\t *\n\t * @param {jQuery DomElement} $field The field to check.\n\t */\n\tvalidateField = ( $field, event ) => {\n\t\tif ( '' === $field.val() ) {\n\t\t\tevent.preventDefault();\n\t\t\t$field.addClass( 'error-required' );\n\t\t\treturn false;\n\t\t} else {\n\t\t\t$field.removeClass( 'error-required' );\n\t\t}\n\t\treturn true;\n\t};\n\n/**\n * When the External connection type drop-down is changed, show the corresponding authorization fields.\n */\njQuery( externalConnectionTypeField ).on( 'change', () => {\n\tconst slug = externalConnectionTypeField.value;\n\n\t$authCredentials.hide();\n\tjQuery( '.auth-credentials.' + slug ).show();\n\n\t// For WordPress.com Oauth authentication, hide fields until authentication is complete.\n\tif ( 'wpdotcom' === slug ) {\n\t\thideItemsRequiringAuth();\n\t} else {\n\n\t\t// Otherwise, ensure all areas are showing.\n\t\t$hideUntilAuthed.show();\n\t}\n} );\n\n\n// On load for WordPress.com Oauth authentication, hide fields until authentication is complete.\nif ( 'wpdotcom' === externalConnectionTypeField.value ) {\n\thideItemsRequiringAuth();\n}\n\n// When authorization is initiated, ensure fields are non-empty.\nconst createConnectionButton = document.getElementById( 'create-oauth-connection' );\nif ( createConnectionButton ) {\n\tjQuery( createConnectionButton ).on( 'click', ( event ) => {\n\t\tconst validateClientSecret = validateField( $clientSecret, event ),\n\t\t\tvalidateClientId = validateField( $clientId, event );\n\t\tif (\n\t\t\t! validateClientSecret ||\n\t\t\t! validateClientId\n\t\t) {\n\t\t\tevent.preventDefault();\n\t\t\treturn false;\n\t\t}\n\t} );\n}\n\n// Handle the changeCredentials link.\nconst changeCredentials = document.getElementById( 'oauth-authentication-change-credentials' ),\n\t$authenticationDetailsWrapper = jQuery( '.oauth-authentication-details-wrapper' );\n\nif ( changeCredentials ) {\n\n\tjQuery( changeCredentials ).on( 'click', function() {\n\n\t\t// Show the credentials fields.\n\t\t$authenticationDetailsWrapper.show();\n\n\t\t// Clear the secret field.\n\t\t$clientSecret.val( '' );\n\n\t\t// Remove the authorized message.\n\t\tjQuery( '.oauth-connection-established' ).remove();\n\n\t\t// Hide the remaining fields that only show after authorization is complete.\n\t\thideItemsRequiringAuth();\n\t} );\n}\n\n// Handle the Authorize Connection button.\nconst beginAuthorize = document.getElementById( 'begin-authorization' );\nif ( beginAuthorize ) {\n\n\t// Handle click to the wpdotcom begin-authorization button.\n\tjQuery( beginAuthorize ).on( 'click', ( event ) => {\n\t\tconst $titleEl = jQuery( titleField ),\n\t\t\ttitle = $titleEl.val();\n\n\t\t// Ensure the connection title is not blank.\n\t\tif ( validateField( $titleEl, event ) ) {\n\n\t\t\t// Disable the button during the ajax request.\n\t\t\tjQuery( beginAuthorize ).addClass( 'disabled' );\n\n\t\t\t// Remove any error highlighting.\n\t\t\t$titleEl.removeClass( 'error-required' );\n\n\t\t\t// Make an ajax request to save the connection and retrieve the resulting post id.\n\t\t\tjQuery.ajax( {\n\t\t\t\turl: ajaxurl,\n\t\t\t\tmethod: 'post',\n\t\t\t\tdata: {\n\t\t\t\t\tnonce: dt.nonce,\n\t\t\t\t\taction: 'dt_begin_authorization',\n\t\t\t\t\ttitle: title,\n\t\t\t\t\tid: jQuery( document.getElementById( 'post_ID' ) ).val()\n\t\t\t\t}\n\t\t\t} ).done( ( response ) => {\n\t\t\t\tif ( response.success && response.data.id ) {\n\n\t\t\t\t\t// The post has been saved, update the url in case the user refreshes.\n\t\t\t\t\tconst url = dt.admin_url + 'post.php?post=' + response.data.id + '&action=edit';\n\t\t\t\t\thistory.pushState( {}, 'Oauth Authorize Details', url );\n\n\t\t\t\t\t// Update the form field for dt_redirect_uri and post id.\n\t\t\t\t\tjQuery( document.getElementById( 'dt_redirect_uri' ) ).val( url );\n\t\t\t\t\tjQuery( document.getElementById( 'dt_created_post_id' ) ).val( response.data.id );\n\t\t\t\t\tjQuery( document.getElementById( 'original_post_status' ) ).val( 'publish' );\n\n\t\t\t\t\t// Hide the first step and show the authentication details.\n\t\t\t\t\tjQuery( '.oauth-begin-authentication-wrapper' ).hide();\n\t\t\t\t\t$authenticationDetailsWrapper.show();\n\t\t\t\t} else {\n\t\t\t\t\t// @todo handle errors.\n\t\t\t\t}\n\t\t\t} ).complete( () => {\n\n\t\t\t\t// Ensure the\n\t\t\t\tjQuery( beginAuthorize ).removeClass( 'disabled' );\n\t\t\t} );\n\t\t}\n\t} );\n}\n\n\n\n// WEBPACK FOOTER //\n// ./assets/js/admin-external-connection.js"],"sourceRoot":""}
\ No newline at end of file
diff --git a/dist/js/admin-pull.min.js b/dist/js/admin-pull.min.js
index a32a91ed0..cf9998229 100644
--- a/dist/js/admin-pull.min.js
+++ b/dist/js/admin-pull.min.js
@@ -1,2 +1,2 @@
-!function(e){function t(o){if(n[o])return n[o].exports;var u=n[o]={i:o,l:!1,exports:{}};return e[o].call(u.exports,u,u.exports,t),u.l=!0,u.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=4)}([function(e,t){e.exports=jQuery},,,,function(e,t,n){"use strict";var o=n(0),u=function(e){return e&&e.__esModule?e:{default:e}}(o),l=document.getElementById("pull_connections"),r=document.getElementById("pull_post_type"),c=document.getElementById("pull_post_type_submit"),d=document.getElementById("posts-filter");(0,u.default)(l).on("change",function(e){document.location=e.currentTarget.options[e.currentTarget.selectedIndex].getAttribute("data-pull-url"),document.body.className+=" dt-loading"}),l&&r&&c&&d&&(0,u.default)(c).on("click",function(e){e.preventDefault();var t=r.options[r.selectedIndex].value,n=l.options[l.selectedIndex].getAttribute("data-pull-url"),o="new";-1<(" "+d.className+" ").indexOf(" status-skipped ")?o="skipped":-1<(" "+d.className+" ").indexOf(" status-pulled ")&&(o="pulled"),document.location=n+"&pull_post_type="+t+"&status="+o,document.body.className+=" dt-loading"})}]);
+!function(e){function t(o){if(n[o])return n[o].exports;var u=n[o]={i:o,l:!1,exports:{}};return e[o].call(u.exports,u,u.exports,t),u.l=!0,u.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=4)}([function(e,t){e.exports=jQuery},,,,function(e,t,n){"use strict";var o=n(0),u=function(e){return e&&e.__esModule?e:{default:e}}(o),l=document.getElementById("pull_connections"),c=document.getElementById("pull_post_type"),r=document.getElementById("pull_post_type_submit"),d=document.getElementById("post-search-input"),a=document.getElementById("search-submit"),s=document.getElementById("posts-filter");(0,u.default)(l).on("change",function(e){document.location=e.currentTarget.options[e.currentTarget.selectedIndex].getAttribute("data-pull-url"),document.body.className+=" dt-loading"}),l&&c&&s&&(r&&(0,u.default)(r).on("click",function(e){e.preventDefault(),document.location=i(),document.body.className+=" dt-loading"}),d&&a&&(0,u.default)(a).on("click",function(e){e.preventDefault();var t=d.value;document.location=i()+"&s="+t,document.body.className+=" dt-loading"}));var i=function(){var e=c.options[c.selectedIndex].value,t=l.options[l.selectedIndex].getAttribute("data-pull-url"),n="new";return-1<(" "+s.className+" ").indexOf(" status-skipped ")?n="skipped":-1<(" "+s.className+" ").indexOf(" status-pulled ")&&(n="pulled"),t+"&pull_post_type="+e+"&status="+n}}]);
//# sourceMappingURL=admin-pull.min.js.map
\ No newline at end of file
diff --git a/dist/js/admin-pull.min.js.map b/dist/js/admin-pull.min.js.map
index 32031fbba..3b74518bf 100644
--- a/dist/js/admin-pull.min.js.map
+++ b/dist/js/admin-pull.min.js.map
@@ -1 +1 @@
-{"version":3,"sources":["webpack:///admin-pull.min.js","webpack:///webpack/bootstrap f1938fcf27bd493f1dae","webpack:///external \"jQuery\"","webpack:///./assets/js/admin-pull.js"],"names":["modules","__webpack_require__","moduleId","installedModules","exports","module","i","l","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","jQuery","_jquery","_jquery2","obj","default","chooseConnection","document","getElementById","choosePostType","choosePostTypeBtn","form","on","event","location","currentTarget","options","selectedIndex","getAttribute","body","className","preventDefault","postType","value","url","status","indexOf"],"mappings":"CAAS,SAAUA,GCInB,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAE,OAGA,IAAAC,GAAAF,EAAAD,IACAI,EAAAJ,EACAK,GAAA,EACAH,WAUA,OANAJ,GAAAE,GAAAM,KAAAH,EAAAD,QAAAC,IAAAD,QAAAH,GAGAI,EAAAE,GAAA,EAGAF,EAAAD,QAvBA,GAAAD,KA4BAF,GAAAQ,EAAAT,EAGAC,EAAAS,EAAAP,EAGAF,EAAAU,EAAA,SAAAP,EAAAQ,EAAAC,GACAZ,EAAAa,EAAAV,EAAAQ,IACAG,OAAAC,eAAAZ,EAAAQ,GACAK,cAAA,EACAC,YAAA,EACAC,IAAAN,KAMAZ,EAAAmB,EAAA,SAAAf,GACA,GAAAQ,GAAAR,KAAAgB,WACA,WAA2B,MAAAhB,GAAA,SAC3B,WAAiC,MAAAA,GAEjC,OADAJ,GAAAU,EAAAE,EAAA,IAAAA,GACAA,GAIAZ,EAAAa,EAAA,SAAAQ,EAAAC,GAAsD,MAAAR,QAAAS,UAAAC,eAAAjB,KAAAc,EAAAC,IAGtDtB,EAAAyB,EAAA,GAGAzB,IAAA0B,EAAA,KDMM,SAAUtB,EAAQD,GEnExBC,EAAAD,QAAAwB,QFwEO,CACA,CACA,CAED,SAAUvB,EAAQD,EAASH,GAEjC,YG9EA,IAAA4B,GAAA5B,EAAA,GHmFI6B,EAEJ,SAAgCC,GAAO,MAAOA,IAAOA,EAAIV,WAAaU,GAAQC,QAASD,IAFjDF,GGjFhCI,EAAmBC,SAASC,eAAgB,oBAC5CC,EAAiBF,SAASC,eAAgB,kBAC1CE,EAAoBH,SAASC,eAAgB,yBAC7CG,EAAOJ,SAASC,eAAgB,iBAEtC,EAAAL,EAAAE,SAAQC,GAAmBM,GAAI,SAAU,SAAEC,GAE1CN,SAASO,SAAWD,EAAME,cAAcC,QAAQH,EAAME,cAAcE,eAAeC,aAAc,iBAEjGX,SAASY,KAAKC,WAAa,gBAGvBd,GAAoBG,GAAkBC,GAAqBC,IAC/D,EAAAR,EAAAE,SAAQK,GAAoBE,GAAI,QAAS,SAAEC,GAE1CA,EAAMQ,gBAEN,IAAMC,GAAWb,EAAeO,QAASP,EAAeQ,eAAgBM,MAClEC,EAAMlB,EAAiBU,QAASV,EAAiBW,eAAgBC,aAAc,iBACjFO,EAAS,OAEP,GAAM,IAAMd,EAAKS,UAAY,KAAMM,QAAS,oBACjDD,EAAS,WACG,GAAM,IAAMd,EAAKS,UAAY,KAAMM,QAAS,qBACxDD,EAAS,UAGVlB,SAASO,SAAWU,EAAM,mBAAqBF,EAAW,WAAaG,EAEvElB,SAASY,KAAKC,WAAa","file":"admin-pull.min.js","sourcesContent":["/******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 4);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports) {\n\nmodule.exports = jQuery;\n\n/***/ }),\n/* 1 */,\n/* 2 */,\n/* 3 */,\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar _jquery = __webpack_require__(0);\n\nvar _jquery2 = _interopRequireDefault(_jquery);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar chooseConnection = document.getElementById('pull_connections');\nvar choosePostType = document.getElementById('pull_post_type');\nvar choosePostTypeBtn = document.getElementById('pull_post_type_submit');\nvar form = document.getElementById('posts-filter');\n\n(0, _jquery2.default)(chooseConnection).on('change', function (event) {\n\n\tdocument.location = event.currentTarget.options[event.currentTarget.selectedIndex].getAttribute('data-pull-url');\n\n\tdocument.body.className += ' ' + 'dt-loading';\n});\n\nif (chooseConnection && choosePostType && choosePostTypeBtn && form) {\n\t(0, _jquery2.default)(choosePostTypeBtn).on('click', function (event) {\n\n\t\tevent.preventDefault();\n\n\t\tvar postType = choosePostType.options[choosePostType.selectedIndex].value;\n\t\tvar url = chooseConnection.options[chooseConnection.selectedIndex].getAttribute('data-pull-url');\n\t\tvar status = 'new';\n\n\t\tif (-1 < (' ' + form.className + ' ').indexOf(' status-skipped ')) {\n\t\t\tstatus = 'skipped';\n\t\t} else if (-1 < (' ' + form.className + ' ').indexOf(' status-pulled ')) {\n\t\t\tstatus = 'pulled';\n\t\t}\n\n\t\tdocument.location = url + '&pull_post_type=' + postType + '&status=' + status;\n\n\t\tdocument.body.className += ' ' + 'dt-loading';\n\t});\n}\n\n/***/ })\n/******/ ]);\n\n\n// WEBPACK FOOTER //\n// admin-pull.min.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 4);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap f1938fcf27bd493f1dae","module.exports = jQuery;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"jQuery\"\n// module id = 0\n// module chunks = 0 1 4 5","import jQuery from 'jquery';\n\nconst chooseConnection = document.getElementById( 'pull_connections' );\nconst choosePostType = document.getElementById( 'pull_post_type' );\nconst choosePostTypeBtn = document.getElementById( 'pull_post_type_submit' );\nconst form = document.getElementById( 'posts-filter' );\n\njQuery( chooseConnection ).on( 'change', ( event ) => {\n\n\tdocument.location = event.currentTarget.options[event.currentTarget.selectedIndex].getAttribute( 'data-pull-url' );\n\n\tdocument.body.className += ' ' + 'dt-loading';\n} );\n\nif ( chooseConnection && choosePostType && choosePostTypeBtn && form ) {\n\tjQuery( choosePostTypeBtn ).on( 'click', ( event ) => {\n\n\t\tevent.preventDefault();\n\n\t\tconst postType = choosePostType.options[ choosePostType.selectedIndex ].value;\n\t\tconst url = chooseConnection.options[ chooseConnection.selectedIndex ].getAttribute( 'data-pull-url' );\n\t\tlet status = 'new';\n\n\t\tif ( -1 < ( ' ' + form.className + ' ' ).indexOf( ' status-skipped ' ) ) {\n\t\t\tstatus = 'skipped';\n\t\t} else if ( -1 < ( ' ' + form.className + ' ' ).indexOf( ' status-pulled ' ) ) {\n\t\t\tstatus = 'pulled';\n\t\t}\n\n\t\tdocument.location = url + '&pull_post_type=' + postType + '&status=' + status;\n\n\t\tdocument.body.className += ' ' + 'dt-loading';\n\t} );\n}\n\n\n\n// WEBPACK FOOTER //\n// ./assets/js/admin-pull.js"],"sourceRoot":""}
\ No newline at end of file
+{"version":3,"sources":["webpack:///admin-pull.min.js","webpack:///webpack/bootstrap fff10cbf8520b51427a4","webpack:///external \"jQuery\"","webpack:///./assets/js/admin-pull.js"],"names":["modules","__webpack_require__","moduleId","installedModules","exports","module","i","l","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","jQuery","_jquery","_jquery2","obj","default","chooseConnection","document","getElementById","choosePostType","choosePostTypeBtn","searchField","searchBtn","form","on","event","location","currentTarget","options","selectedIndex","getAttribute","body","className","preventDefault","getURL","search","value","postType","baseURL","status","indexOf"],"mappings":"CAAS,SAAUA,GCInB,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAE,OAGA,IAAAC,GAAAF,EAAAD,IACAI,EAAAJ,EACAK,GAAA,EACAH,WAUA,OANAJ,GAAAE,GAAAM,KAAAH,EAAAD,QAAAC,IAAAD,QAAAH,G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BAIxBX,GAAeC,IACnB,EAAAT,EAAAE,SAAQO,GAAYE,GAAI,QAAS,SAAEC,GAClCA,EAAMQ,gBAEN,IAAME,GAASd,EAAYe,KAE3BnB,UAASS,SAAWQ,IAAW,MAAQC,EAEvClB,SAASc,KAAKC,WAAa,gBAU9B,IAAME,GAAS,WACd,GAAMG,GAAWlB,EAAeS,QAAST,EAAeU,eAAgBO,MAClEE,EAAUtB,EAAiBY,QAASZ,EAAiBa,eAAgBC,aAAc,iBACrFS,EAAS,KAQb,QANM,GAAM,IAAMhB,EAAKS,UAAY,KAAMQ,QAAS,oBACjDD,EAAS,WACG,GAAM,IAAMhB,EAAKS,UAAY,KAAMQ,QAAS,qBACxDD,EAAS,UAGHD,EAAU,mBAAqBD,EAAW,WAAaE","file":"admin-pull.min.js","sourcesContent":["/******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 4);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports) {\n\nmodule.exports = jQuery;\n\n/***/ }),\n/* 1 */,\n/* 2 */,\n/* 3 */,\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar _jquery = __webpack_require__(0);\n\nvar _jquery2 = _interopRequireDefault(_jquery);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar chooseConnection = document.getElementById('pull_connections');\nvar choosePostType = document.getElementById('pull_post_type');\nvar choosePostTypeBtn = document.getElementById('pull_post_type_submit');\nvar searchField = document.getElementById('post-search-input');\nvar searchBtn = document.getElementById('search-submit');\nvar form = document.getElementById('posts-filter');\n\n(0, _jquery2.default)(chooseConnection).on('change', function (event) {\n\n\tdocument.location = event.currentTarget.options[event.currentTarget.selectedIndex].getAttribute('data-pull-url');\n\n\tdocument.body.className += ' ' + 'dt-loading';\n});\n\nif (chooseConnection && choosePostType && form) {\n\n\tif (choosePostTypeBtn) {\n\t\t(0, _jquery2.default)(choosePostTypeBtn).on('click', function (event) {\n\n\t\t\tevent.preventDefault();\n\n\t\t\tdocument.location = getURL();\n\n\t\t\tdocument.body.className += ' ' + 'dt-loading';\n\t\t});\n\t}\n\n\tif (searchField && searchBtn) {\n\t\t(0, _jquery2.default)(searchBtn).on('click', function (event) {\n\t\t\tevent.preventDefault();\n\n\t\t\tvar search = searchField.value;\n\n\t\t\tdocument.location = getURL() + '&s=' + search;\n\n\t\t\tdocument.body.className += ' ' + 'dt-loading';\n\t\t});\n\t}\n}\n\n/**\n * Build our Distribution URL.\n *\n * @return {string}\n */\nvar getURL = function getURL() {\n\tvar postType = choosePostType.options[choosePostType.selectedIndex].value;\n\tvar baseURL = chooseConnection.options[chooseConnection.selectedIndex].getAttribute('data-pull-url');\n\tvar status = 'new';\n\n\tif (-1 < (' ' + form.className + ' ').indexOf(' status-skipped ')) {\n\t\tstatus = 'skipped';\n\t} else if (-1 < (' ' + form.className + ' ').indexOf(' status-pulled ')) {\n\t\tstatus = 'pulled';\n\t}\n\n\treturn baseURL + '&pull_post_type=' + postType + '&status=' + status;\n};\n\n/***/ })\n/******/ ]);\n\n\n// WEBPACK FOOTER //\n// admin-pull.min.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 4);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap fff10cbf8520b51427a4","module.exports = jQuery;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"jQuery\"\n// module id = 0\n// module chunks = 0 1 4 5","import jQuery from 'jquery';\n\nconst chooseConnection = document.getElementById( 'pull_connections' );\nconst choosePostType = document.getElementById( 'pull_post_type' );\nconst choosePostTypeBtn = document.getElementById( 'pull_post_type_submit' );\nconst searchField = document.getElementById( 'post-search-input' );\nconst searchBtn = document.getElementById( 'search-submit' );\nconst form = document.getElementById( 'posts-filter' );\n\njQuery( chooseConnection ).on( 'change', ( event ) => {\n\n\tdocument.location = event.currentTarget.options[event.currentTarget.selectedIndex].getAttribute( 'data-pull-url' );\n\n\tdocument.body.className += ' ' + 'dt-loading';\n} );\n\nif ( chooseConnection && choosePostType && form ) {\n\n\tif ( choosePostTypeBtn ) {\n\t\tjQuery( choosePostTypeBtn ).on( 'click', ( event ) => {\n\n\t\t\tevent.preventDefault();\n\n\t\t\tdocument.location = getURL();\n\n\t\t\tdocument.body.className += ' ' + 'dt-loading';\n\t\t} );\n\t}\n\n\tif ( searchField && searchBtn ) {\n\t\tjQuery( searchBtn ).on( 'click', ( event ) => {\n\t\t\tevent.preventDefault();\n\n\t\t\tconst search = searchField.value;\n\n\t\t\tdocument.location = getURL() + '&s=' + search;\n\n\t\t\tdocument.body.className += ' ' + 'dt-loading';\n\t\t} );\n\t}\n}\n\n/**\n * Build our Distribution URL.\n *\n * @return {string}\n */\nconst getURL = () => {\n\tconst postType = choosePostType.options[ choosePostType.selectedIndex ].value;\n\tconst baseURL = chooseConnection.options[ chooseConnection.selectedIndex ].getAttribute( 'data-pull-url' );\n\tlet status = 'new';\n\n\tif ( -1 < ( ' ' + form.className + ' ' ).indexOf( ' status-skipped ' ) ) {\n\t\tstatus = 'skipped';\n\t} else if ( -1 < ( ' ' + form.className + ' ' ).indexOf( ' status-pulled ' ) ) {\n\t\tstatus = 'pulled';\n\t}\n\n\treturn baseURL + '&pull_post_type=' + postType + '&status=' + status;\n};\n\n\n\n// WEBPACK FOOTER //\n// ./assets/js/admin-pull.js"],"sourceRoot":""}
\ No newline at end of file
diff --git a/dist/js/gutenberg-status-plugin.min.js.map b/dist/js/gutenberg-status-plugin.min.js.map
index cd97ca8c1..88b813056 100644
--- a/dist/js/gutenberg-status-plugin.min.js.map
+++ b/dist/js/gutenberg-status-plugin.min.js.map
@@ -1 +1 @@
-{"version":3,"sources":["webpack:///gutenberg-status-plugin.min.js","webpack:///webpack/bootstrap f1938fcf27bd493f1dae","webpack:///external \"window\"","webpack:///./assets/js/gutenberg-status-plugin.js"],"names":["modules","__webpack_require__","moduleId","installedModules","exports","module","i","l","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","1","window","8","_window","wp","editPost","PluginPostStatusInfo","registerPlugin","plugins","__","i18n","renderDistributedFrom","React","createElement","id","dtGutenberg","syndicationTime","renderDistributedTo","sprintf","syndicationCount","parse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AC,cAAA,QAAMC,GAAG,kBACNX,EAAAC,GAAGM,KAAKQ,QAASf,EAAAC,GAAGM,KAAKD,GAAI,sCAAuC,eACrEN,EAAAY,YAAYI,iBACZ,MAAQhB,EAAAY,YAAYI,iBAAmB,GAAK,OAM5C,GAAIC,SAAUjB,EAAAY,YAAYI,kBAC9BZ,EAAgB,4BAA8Bc,OAAQJ,IAC3C,IAAMG,SAAUjB,EAAAY,YAAYC,kBACvCT,EAAgB,4BAA8Bc,OAAQV","file":"gutenberg-status-plugin.min.js","sourcesContent":["/******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 8);\n/******/ })\n/************************************************************************/\n/******/ ({\n\n/***/ 1:\n/***/ (function(module, exports) {\n\nmodule.exports = window;\n\n/***/ }),\n\n/***/ 8:\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar _window = __webpack_require__(1);\n\nif ('undefined' !== typeof _window.wp.editPost.PluginPostStatusInfo) {\n\tvar registerPlugin = _window.wp.plugins.registerPlugin;\n\tvar __ = _window.wp.i18n.__;\n\tvar PluginPostStatusInfo = _window.wp.editPost.PluginPostStatusInfo; // eslint-disable-line no-unused-vars\n\n\t/**\n * Render the distributed from component.\n */\n\n\tvar renderDistributedFrom = function renderDistributedFrom() {\n\t\treturn React.createElement(\n\t\t\tPluginPostStatusInfo,\n\t\t\tnull,\n\t\t\tReact.createElement(\n\t\t\t\t'span',\n\t\t\t\t{ id: 'distributed-from' },\n\t\t\t\t__('Distributed on: '),\n\t\t\t\tReact.createElement(\n\t\t\t\t\t'strong',\n\t\t\t\t\tnull,\n\t\t\t\t\t' ',\n\t\t\t\t\t_window.dtGutenberg.syndicationTime,\n\t\t\t\t\t' '\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t};\n\n\t/**\n * Render the distributed to component.\n */\n\tvar renderDistributedTo = function renderDistributedTo() {\n\t\treturn React.createElement(\n\t\t\tPluginPostStatusInfo,\n\t\t\tnull,\n\t\t\tReact.createElement(\n\t\t\t\t'span',\n\t\t\t\t{ id: 'distributed-to' },\n\t\t\t\t_window.wp.i18n.sprintf(_window.wp.i18n.__('Distributed to %1$s connection%2$s.', 'distributor'), _window.dtGutenberg.syndicationCount, '1' === _window.dtGutenberg.syndicationCount ? '' : 's')\n\t\t\t)\n\t\t);\n\t};\n\n\tif (0 < parseInt(_window.dtGutenberg.syndicationCount)) {\n\t\tregisterPlugin('distributor-status-panel', { render: renderDistributedTo });\n\t} else if (0 !== parseInt(_window.dtGutenberg.syndicationTime)) {\n\t\tregisterPlugin('distributor-status-panel', { render: renderDistributedFrom });\n\t}\n}\n\n/***/ })\n\n/******/ });\n\n\n// WEBPACK FOOTER //\n// gutenberg-status-plugin.min.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 8);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap f1938fcf27bd493f1dae","module.exports = window;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"window\"\n// module id = 1\n// module chunks = 0 1 2 3","import { wp, dtGutenberg } from 'window';\n\nif ( 'undefined' !== typeof wp.editPost.PluginPostStatusInfo ) {\n\tconst { registerPlugin } = wp.plugins;\n\tconst { __ } = wp.i18n;\n\tconst { PluginPostStatusInfo } = wp.editPost; // eslint-disable-line no-unused-vars\n\n\t/**\n\t * Render the distributed from component.\n\t */\n\tconst renderDistributedFrom = () => {\n\t\treturn(\n\t\t\t
-
+
@@ -80,6 +80,14 @@ public static function credentials_form( $args = array() ) { + + + Important: We strongly recommend using the Application Passwords plugin on the site you are connecting to in order to create a unique password for this connection. This helps limit the use of your primary password and will allow you to revoke access in the future if needed.', 'distributor' ) ), esc_url( $plugin_link ) ); + ?>
- + get_error_message() ); $count ++; if ( $count <= 3 ) { - $this->is_valid_token( $count ); + self::is_valid_token( $count ); } return false; diff --git a/includes/classes/ExternalConnections/WordPressDotcomExternalConnection.php b/includes/classes/ExternalConnections/WordPressDotcomExternalConnection.php index 52e2d29b5..ec504f60d 100644 --- a/includes/classes/ExternalConnections/WordPressDotcomExternalConnection.php +++ b/includes/classes/ExternalConnections/WordPressDotcomExternalConnection.php @@ -19,27 +19,33 @@ class WordPressDotcomExternalConnection extends WordPressExternalConnection { * * @var string */ - static public $slug = 'wpdotcom'; + public static $slug = 'wpdotcom'; /** * Connection pretty label * + * This is to represent the authentication method, + * not the connection type. This value was previously + * "WordPress.com REST API". + * + * @since 1.4.0 Label as authentication method, not connection type + * * @var string */ - static public $label = 'WordPress.com REST API'; + public static $label = 'WordPress.com Application'; /** * Connection auth class * * @var string */ - static public $auth_handler_class = '\Distributor\Authentications\WordPressDotcomOauth2Authentication'; + public static $auth_handler_class = '\Distributor\Authentications\WordPressDotcomOauth2Authentication'; /** * Connection REST API namespace * * @var string */ - static public $namespace = 'wp/v2'; + public static $namespace = 'wp/v2'; } diff --git a/includes/classes/ExternalConnections/WordPressExternalConnection.php b/includes/classes/ExternalConnections/WordPressExternalConnection.php index a5f17caa0..cff5eac73 100644 --- a/includes/classes/ExternalConnections/WordPressExternalConnection.php +++ b/includes/classes/ExternalConnections/WordPressExternalConnection.php @@ -20,35 +20,41 @@ class WordPressExternalConnection extends ExternalConnection { * * @var string */ - static public $slug = 'wp'; + public static $slug = 'wp'; /** * Connection pretty label * + * This is to represent the authentication method, + * not the connection type. This value was previously + * "WordPress REST API". + * + * @since 1.4.0 Label as authentication method, not connection type + * * @var string */ - static public $label = 'WordPress REST API'; + public static $label = 'Username / Password'; /** * Auth handler to use * * @var string */ - static public $auth_handler_class = '\Distributor\Authentications\WordPressBasicAuth'; + public static $auth_handler_class = '\Distributor\Authentications\WordPressBasicAuth'; /** * REST API namespace * * @var string */ - static public $namespace = 'wp/v2'; + public static $namespace = 'wp/v2'; /** * Remote request timeout * * @var integer */ - static public $timeout = 5; + public static $timeout = 5; /** * Default post type to pull. @@ -877,8 +883,8 @@ public function check_connections() { private function to_wp_post( $post ) { $obj = new \stdClass(); - $obj->ID = $post['id']; - $obj->post_title = $post['title']['rendered']; + $obj->ID = $post['id']; + $obj->post_title = $post['title']['rendered']; if ( isset( $post['excerpt']['raw'] ) ) { $obj->post_excerpt = $post['excerpt']['raw']; @@ -888,8 +894,8 @@ private function to_wp_post( $post ) { $obj->post_excerpt = ''; } - $obj->post_status = 'draft'; - $obj->post_author = get_current_user_id(); + $obj->post_status = 'draft'; + $obj->post_author = get_current_user_id(); $obj->post_password = $post['password']; $obj->post_date = $post['date']; diff --git a/includes/classes/InternalConnections/NetworkSiteConnection.php b/includes/classes/InternalConnections/NetworkSiteConnection.php index d308d7b8e..786ffcc3e 100644 --- a/includes/classes/InternalConnections/NetworkSiteConnection.php +++ b/includes/classes/InternalConnections/NetworkSiteConnection.php @@ -28,7 +28,7 @@ class NetworkSiteConnection extends Connection { * * @var string */ - static public $slug = 'networkblog'; + public static $slug = 'networkblog'; /** * Default post type to pull. @@ -186,7 +186,7 @@ public function pull( $items ) { if ( ! empty( $post_props['meta']['dt_connection_map'] ) ) { foreach ( $post_props['meta']['dt_connection_map'] as $distributed ) { - $distributed = unserialize( $distributed ); + $distributed = maybe_unserialize( $distributed ); if ( array_key_exists( $current_blog_id, $distributed['internal'] ) ) { $dt_pull_messages['duplicated'] = 1; diff --git a/includes/classes/PullListTable.php b/includes/classes/PullListTable.php index a104965bb..20d1145ab 100644 --- a/includes/classes/PullListTable.php +++ b/includes/classes/PullListTable.php @@ -59,6 +59,11 @@ public function get_columns() { 'date' => esc_html__( 'Date', 'distributor' ), ]; + // Remove checkbox column on the Pulled view + if ( isset( $_GET['status'] ) && 'pulled' === $_GET['status'] ) { + unset( $columns['cb'] ); + } + return $columns; } @@ -85,14 +90,40 @@ public function get_sortable_columns() { */ protected function get_views() { - $current_status = ( empty( $_GET['status'] ) ) ? 'new' : sanitize_key( $_GET['status'] ); + $current_status = ( empty( $_GET['status'] ) ) ? 'new' : sanitize_key( $_GET['status'] ); // @codingStandardsIgnoreLine No nonce needed. $request_uri = $_SERVER['REQUEST_URI']; + $url = add_query_arg( + array( + 'paged' => false, + 's' => false, + ), + $request_uri + ); + $new_url = add_query_arg( + array( + 'status' => 'new', + ), + $url + ); + $pulled_url = add_query_arg( + array( + 'status' => 'pulled', + ), + $url + ); + $skipped_url = add_query_arg( + array( + 'status' => 'skipped', + ), + $url + ); + $status_links = [ - 'new' => '' . esc_html__( 'New', 'distributor' ) . '', - 'pulled' => '' . esc_html__( 'Pulled', 'distributor' ) . '', - 'skipped' => '' . esc_html__( 'Skipped', 'distributor' ) . '', + 'new' => '' . esc_html__( 'New', 'distributor' ) . '', + 'pulled' => '' . esc_html__( 'Pulled', 'distributor' ) . '', + 'skipped' => '' . esc_html__( 'Skipped', 'distributor' ) . '', ]; return $status_links; @@ -123,7 +154,7 @@ protected function bulk_actions( $which = '' ) { * * @param array $actions An array of the available bulk actions. */ - $this->_actions = apply_filters( "bulk_actions-{$this->screen->id}", $this->_actions ); + $this->_actions = apply_filters( "bulk_actions-{$this->screen->id}", $this->_actions ); // @codingStandardsIgnoreLine valid filter name $this->_actions = array_intersect_assoc( $this->_actions, $no_new_actions ); $two = ''; } else { @@ -155,12 +186,12 @@ protected function bulk_actions( $which = '' ) { * * @global string $mode * - * @param WP_Post $post The current WP_Post object. + * @param \WP_Post $post The current WP_Post object. */ public function column_date( $post ) { global $mode; - if ( ! empty( $_GET['status'] ) && 'pulled' === $_GET['status'] ) { + if ( ! empty( $_GET['status'] ) && 'pulled' === $_GET['status'] ) { // @codingStandardsIgnoreLine Nonce isn't required. if ( ! empty( $this->sync_log[ $post->ID ] ) ) { $syndicated_at = get_post_meta( $this->sync_log[ $post->ID ], 'dt_syndicate_time', true ); @@ -172,11 +203,13 @@ public function column_date( $post ) { $time_diff = time() - $syndicated_at; if ( $time_diff > 0 && $time_diff < DAY_IN_SECONDS ) { + /* translators: %s: a human readable time */ $h_time = sprintf( esc_html__( '%s ago', 'distributor' ), human_time_diff( $syndicated_at ) ); } else { $h_time = date( 'F j, Y', $syndicated_at ); } + /* translators: %s: time of pull */ echo sprintf( esc_html__( 'Pulled %s', 'distributor' ), esc_html( $h_time ) ); } } @@ -193,6 +226,7 @@ public function column_date( $post ) { $time_diff = time() - $time; if ( $time_diff > 0 && $time_diff < DAY_IN_SECONDS ) { + /* translators: %s: a human readable time */ $h_time = sprintf( esc_html__( '%s ago', 'distributor' ), human_time_diff( $time ) ); } else { $h_time = mysql2date( esc_html__( 'Y/m/d', 'distributor' ), $m_time ); @@ -222,15 +256,16 @@ public function column_date( $post ) { /** * Output standard table columns (not name) * - * @param array $item Item to output. - * @param string $column_name Column name. + * @param array|\WP_Post $item Item to output. + * @param string $column_name Column name. + * + * @return string Url, post title, or empty string. * @since 0.8 */ public function column_default( $item, $column_name ) { switch ( $column_name ) { case 'name': return $item['post_title']; - break; case 'url': $url = get_post_meta( $item->ID, 'dt_external_connection_url', true ); @@ -239,20 +274,21 @@ public function column_default( $item, $column_name ) { } return $url; - break; } + + return ''; } /** * Output name column wrapper * * @since 4.3.0 - * @param WP_Post $item Post object. - * @param string $classes CSS classes. - * @param string $data Column data. - * @param string $primary Whether primary or not. + * @param \WP_Post $item Post object. + * @param string $classes CSS classes. + * @param string $data Column data. + * @param string $primary Whether primary or not. */ - protected function _column_name( $item, $classes, $data, $primary ) { + protected function _column_name( $item, $classes, $data, $primary ) { // @codingStandardsIgnoreLine valid function name echo '' . sprintf( esc_html__( 'The number of connections this %1$s has been distributed to is shown in the publish meta box. If this %2$s is deleted, it could have ramifications across all those %3$s.', 'distributor' ), esc_html( strtolower( $post_type_object->labels->singular_name ) ), esc_html( strtolower( $post_type_object->labels->singular_name ) ), esc_html( strtolower( $post_type_object->labels->name ) ) ) . '
', ) ); @@ -60,7 +63,7 @@ function add_help_tab() { /** * Output distributed to number * - * @param WP_Post $post Post object. + * @param \WP_Post $post Post object. * @since 0.8 */ function distributed_to( $post ) { @@ -83,6 +86,7 @@ function distributed_to( $post ) {
-
+
-