diff --git a/CHANGELOG.md b/CHANGELOG.md index 98c2ea2a4..3d31cb461 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,57 +4,71 @@ All notable changes to this project will be documented in this file, per [the Ke ## [Unreleased] - TBD -## [1.6.0] - TBD +## [1.6.1] - 2020-11-19 ### Added -- Authorization Setup Wizard for External Connections leveraging [Application Passwords](https://github.com/WordPress/application-passwords) (props [@adamsilverstein](https://github.com/adamsilverstein), [@dkotter](https://github.com/dkotter), [@dinhtungdu](https://github.com/dinhtungdu), [@helen](https://github.com/helen), [@jeffpaul](https://github.com/jeffpaul), [@hearvox](https://github.com/hearvox) via [#368](https://github.com/10up/distributor/pull/368), [#594](https://github.com/10up/distributor/pull/594), [#601](https://github.com/10up/distributor/pull/601)) -- "Select All" and "Clear" options in the Push menu (props [@biggiebangle](https://github.com/biggiebangle), [@dkotter](https://github.com/dkotter), [@oszkarnagy](https://github.com/oszkarnagy), [@helen](https://github.com/helen) via [#495](https://github.com/10up/distributor/pull/495), [#589](https://github.com/10up/distributor/pull/589)) -- "Pull" row action in the Pull menu (props [@lakrisgubben](https://github.com/lakrisgubben) via [#508](https://github.com/10up/distributor/pull/508)) -- "View" link for distribguted posts in Push menu for External Connections (props [@dinhtungdu](https://github.com/dinhtungdu), [@PaddyWhacks](https://github.com/PaddyWhacks) via [#571](https://github.com/10up/distributor/pull/571)) -- Accessibility improvements (props [@samikeijonen](https://github.com/samikeijonen), [@dinhtungdu](https://github.com/dinhtungdu), [@dkotter](https://github.com/dkotter) via [#558](https://github.com/10up/distributor/pull/558), [#559](https://github.com/10up/distributor/pull/559), [#560](https://github.com/10up/distributor/pull/560), [#562](https://github.com/10up/distributor/pull/562), [#565](https://github.com/10up/distributor/pull/565), [#566](https://github.com/10up/distributor/pull/566), [#569](https://github.com/10up/distributor/pull/569)) -- Site Health integration to display Distributor debug information (props [@dinhtungdu](https://github.com/dinhtungdu), [@jeffpaul](https://github.com/jeffpaul), [@johnwatkins0](https://github.com/johnwatkins0), [@dkotter](https://github.com/dkotter) via [#517](https://github.com/10up/distributor/pull/517)) -- `dt_syndicatable_capabilities` filter to Push menu (props [@pragmatic-tf](https://github.com/pragmatic-tf) via [#473](https://github.com/10up/distributor/pull/473)) -- `dt_subscription_post_timeout` filter to modify request timeout (props [@ahovhannissian](https://github.com/ahovhannissian), [@dinhtungdu](https://github.com/dinhtungdu) via [#529](https://github.com/10up/distributor/pull/529)) -- [Hook documentation GitHub Pages site](https://10up.github.io/distributor/) generated by GitHub Actions (props [@adamsilverstein](https://github.com/adamsilverstein), [@helen](https://github.com/helen), [@jeffpaul](https://github.com/jeffpaul) via [#448](https://github.com/10up/distributor/pull/448), [#467](https://github.com/10up/distributor/pull/467), [#474](https://github.com/10up/distributor/pull/474), [#475](https://github.com/10up/distributor/pull/475), [#476](https://github.com/10up/distributor/pull/476), [#477](https://github.com/10up/distributor/pull/477), [#478](https://github.com/10up/distributor/pull/478), [#479](https://github.com/10up/distributor/pull/479), [#482](https://github.com/10up/distributor/pull/482), [#485](https://github.com/10up/distributor/pull/485), [#545](https://github.com/10up/distributor/pull/545)) -- JSON PHP extension as a Composer requirement (props [@moebrowne](https://github.com/moebrowne), [@adamsilverstein](https://github.com/adamsilverstein), [@dinhtungdu](https://github.com/dinhtungdu) via [#460](https://github.com/10up/distributor/pull/460)) -- GitHub Actions to build and add release asset (props [@helen](https://github.com/helen), [@jeffpaul](https://github.com/jeffpaul) via [#608](https://github.com/10up/distributor/pull/608)) -- Documentation improvements (props [@jeffpaul](https://github.com/jeffpaul), [@dmchale](https://github.com/dmchale), [@kant](https://github.com/kant), [@petenelson](https://github.com/petenelson), [@dinhtungdu](https://github.com/dinhtungdu), [@jakemgold](https://github.com/jakemgold) via [#433](https://github.com/10up/distributor/pull/433), [#462](https://github.com/10up/distributor/pull/462), [#489](https://github.com/10up/distributor/pull/489), [#513](https://github.com/10up/distributor/pull/513), [#525](https://github.com/10up/distributor/pull/525), [#528](https://github.com/10up/distributor/pull/528), [#542](https://github.com/10up/distributor/pull/542), [#544](https://github.com/10up/distributor/pull/544), [#588](https://github.com/10up/distributor/pull/588), [#598](https://github.com/10up/distributor/pull/598), [#599](https://github.com/10up/distributor/pull/599)) +- Support for the [official AMP plugin](https://github.com/ampproject/amp-wp) and front-end Push distribution via `amp-dev-mode` and new Mustache templates (props [@dkotter](https://github.com/dkotter), [@dinhtungdu](https://github.com/dinhtungdu), [@rickalee](https://github.com/rickalee) via [#665](https://github.com/10up/distributor/pull/665)). +- Better error reporting when creating External Connections and Pushing or Pulling content (props [@dinhtungdu](https://github.com/dinhtungdu), [@dkotter](https://github.com/dkotter) via [#630](https://github.com/10up/distributor/pull/630)). + +### Fixed +- Empty admin body class causing compatibility issues with other plugins' styling (props [@dinhtungdu](https://github.com/dinhtungdu), [@PaddyWhacks](https://github.com/PaddyWhacks), [@robcain](https://github.com/robcain) via [#654](https://github.com/10up/distributor/pull/654)). +- `permission_callback` error on WordPress 5.5 (props [@dkotter](https://github.com/dkotter) via [#632](https://github.com/10up/distributor/pull/632)). + +### Security +- Bump `lodash` from 4.17.15 to 4.17.19 (props [@dependabot](https://github.com/apps/dependabot) via [#614](https://github.com/10up/distributor/pull/614)). +- Bump `elliptic` from 6.5.2 to 6.5.3 (props [@dependabot](https://github.com/apps/dependabot) via [#621](https://github.com/10up/distributor/pull/621)). +- Bump `dot-prop` from 4.2.0 to 4.2.1 (props [@dependabot](https://github.com/apps/dependabot) via [#664](https://github.com/10up/distributor/pull/664)). + +## [1.6.0] - 2020-07-02 +### Added +- Authorization Setup Wizard for External Connections leveraging [Application Passwords](https://github.com/WordPress/application-passwords) (props [@adamsilverstein](https://github.com/adamsilverstein), [@dkotter](https://github.com/dkotter), [@dinhtungdu](https://github.com/dinhtungdu), [@helen](https://github.com/helen), [@jeffpaul](https://github.com/jeffpaul), [@hearvox](https://github.com/hearvox) via [#368](https://github.com/10up/distributor/pull/368), [#594](https://github.com/10up/distributor/pull/594), [#601](https://github.com/10up/distributor/pull/601)). +- "Select All" and "Clear" options in the Push menu (props [@biggiebangle](https://github.com/biggiebangle), [@dkotter](https://github.com/dkotter), [@oszkarnagy](https://github.com/oszkarnagy), [@helen](https://github.com/helen) via [#495](https://github.com/10up/distributor/pull/495), [#589](https://github.com/10up/distributor/pull/589)). +- "Pull" row action in the Pull menu (props [@lakrisgubben](https://github.com/lakrisgubben) via [#508](https://github.com/10up/distributor/pull/508)). +- "View" link for distribguted posts in Push menu for External Connections (props [@dinhtungdu](https://github.com/dinhtungdu), [@PaddyWhacks](https://github.com/PaddyWhacks) via [#571](https://github.com/10up/distributor/pull/571)). +- Accessibility improvements (props [@samikeijonen](https://github.com/samikeijonen), [@dinhtungdu](https://github.com/dinhtungdu), [@dkotter](https://github.com/dkotter) via [#558](https://github.com/10up/distributor/pull/558), [#559](https://github.com/10up/distributor/pull/559), [#560](https://github.com/10up/distributor/pull/560), [#562](https://github.com/10up/distributor/pull/562), [#565](https://github.com/10up/distributor/pull/565), [#566](https://github.com/10up/distributor/pull/566), [#569](https://github.com/10up/distributor/pull/569)). +- Site Health integration to display Distributor debug information (props [@dinhtungdu](https://github.com/dinhtungdu), [@jeffpaul](https://github.com/jeffpaul), [@johnwatkins0](https://github.com/johnwatkins0), [@dkotter](https://github.com/dkotter) via [#517](https://github.com/10up/distributor/pull/517)). +- `dt_syndicatable_capabilities` filter to Push menu (props [@pragmatic-tf](https://github.com/pragmatic-tf) via [#473](https://github.com/10up/distributor/pull/473)). +- `dt_subscription_post_timeout` filter to modify request timeout (props [@ahovhannissian](https://github.com/ahovhannissian), [@dinhtungdu](https://github.com/dinhtungdu) via [#529](https://github.com/10up/distributor/pull/529)). +- [Hook documentation GitHub Pages site](https://10up.github.io/distributor/) generated by GitHub Actions (props [@adamsilverstein](https://github.com/adamsilverstein), [@helen](https://github.com/helen), [@jeffpaul](https://github.com/jeffpaul) via [#448](https://github.com/10up/distributor/pull/448), [#467](https://github.com/10up/distributor/pull/467), [#474](https://github.com/10up/distributor/pull/474), [#475](https://github.com/10up/distributor/pull/475), [#476](https://github.com/10up/distributor/pull/476), [#477](https://github.com/10up/distributor/pull/477), [#478](https://github.com/10up/distributor/pull/478), [#479](https://github.com/10up/distributor/pull/479), [#482](https://github.com/10up/distributor/pull/482), [#485](https://github.com/10up/distributor/pull/485), [#545](https://github.com/10up/distributor/pull/545)). +- JSON PHP extension as a Composer requirement (props [@moebrowne](https://github.com/moebrowne), [@adamsilverstein](https://github.com/adamsilverstein), [@dinhtungdu](https://github.com/dinhtungdu) via [#460](https://github.com/10up/distributor/pull/460)). +- GitHub Actions to build and add release asset (props [@helen](https://github.com/helen), [@jeffpaul](https://github.com/jeffpaul) via [#608](https://github.com/10up/distributor/pull/608)). +- Documentation improvements (props [@jeffpaul](https://github.com/jeffpaul), [@dmchale](https://github.com/dmchale), [@kant](https://github.com/kant), [@petenelson](https://github.com/petenelson), [@dinhtungdu](https://github.com/dinhtungdu), [@jakemgold](https://github.com/jakemgold) via [#433](https://github.com/10up/distributor/pull/433), [#462](https://github.com/10up/distributor/pull/462), [#489](https://github.com/10up/distributor/pull/489), [#513](https://github.com/10up/distributor/pull/513), [#525](https://github.com/10up/distributor/pull/525), [#528](https://github.com/10up/distributor/pull/528), [#542](https://github.com/10up/distributor/pull/542), [#544](https://github.com/10up/distributor/pull/544), [#588](https://github.com/10up/distributor/pull/588), [#598](https://github.com/10up/distributor/pull/598), [#599](https://github.com/10up/distributor/pull/599)). ### Changed -- Internal distribution prepares posts the same for Push or Pull actions (props [@rmarscher](https://github.com/rmarscher), [@dinhtungdu](https://github.com/dinhtungdu) via [#169](https://github.com/10up/distributor/pull/169)) -- Use filesystem for copying media when doing a network pull/push instead of `download_url()` (props [@petenelson](https://github.com/petenelson), [@dkotter](https://github.com/dkotter), [@dmaslogh](https://github.com/dmaslogh), [@Kpudlo](https://github.com/Kpudlo) via [#567](https://github.com/10up/distributor/pull/567)) -- Redirect to pulled content tab after content is pulled (props [@joshuaabenazer](https://github.com/joshuaabenazer), [@dkotter](https://github.com/dkotter), [@hearvox](https://github.com/hearvox) via [#575](https://github.com/10up/distributor/pull/575)) -- Remove `hoverIntent` and add empty placeholder child item in Push menu to improve keyboard support (props [@samikeijonen](https://github.com/samikeijonen), [@dinhtungdu](https://github.com/dinhtungdu), [@dkotter](https://github.com/dkotter) via [#564](https://github.com/10up/distributor/pull/564), [#607](https://github.com/10up/distributor/pull/607)) -- Order of "View" and "Edit" links in the Pull menu to match WordPress standard order (props [@jspellman814](https://github.com/jspellman814), [@hearvox](https://github.com/hearvox) via [#532](https://github.com/10up/distributor/pull/532)) -- Show/hide credentials fields based on registration status on that Registration and Settings screen (props [@dinhtungdu](https://github.com/dinhtungdu), [@oszkarnagy](https://github.com/oszkarnagy) via [#543](https://github.com/10up/distributor/pull/543)) -- `date()` to `gmdate()` per PHPCS (props [@helen](https://github.com/helen) via [#602](https://github.com/10up/distributor/pull/602)) -- Bumped WordPress version support to 5.3 (props [@dkotter](https://github.com/dkotter) via [#499](https://github.com/10up/distributor/pull/499)) -- Update all packages and build process (props [@adamsilverstein](https://github.com/adamsilverstein), [@dkotter](https://github.com/dkotter) via [#450](https://github.com/10up/distributor/pull/450)) -- Run [WP Acceptance](https://github.com/10up/wpacceptance/) tests in parallel in Travis (props [@adamsilverstein](https://github.com/adamsilverstein) via [#439](https://github.com/10up/distributor/pull/439)) - -### Fixed -- Gutenberg compatibility issues ([@dkotter](https://github.com/dkotter), [@dinhtungdu](https://github.com/dinhtungdu) via [#579](https://github.com/10up/distributor/pull/579)) -- Issue where push menu would disappear when push is in progress (props [@dinhtungdu](https://github.com/dinhtungdu), [@dkotter](https://github.com/dkotter), [@helen](https://github.com/helen) via [#538](https://github.com/10up/distributor/pull/538)) -- Undefined variable issue causing external pushes to not fully work (props [@dkotter](https://github.com/dkotter) via [#578](https://github.com/10up/distributor/pull/578)) -- Check for value of remote post id to verify push result (props [@dinhtungdu](https://github.com/dinhtungdu), [@eriktad](https://github.com/eriktad), [@arsendovlatyan](https://github.com/arsendovlatyan) via [#574](https://github.com/10up/distributor/pull/574)) -- Issue with wrong permission route that causes External Connections to fail on creation (props [@dinhtungdu](https://github.com/dinhtungdu), [@dkotter](https://github.com/dkotter) via [#570](https://github.com/10up/distributor/pull/570)) -- Issue where view links for external connections are incorrect if it is set up with a trailing slash (props [@dkotter](https://github.com/dkotter) via [#586](https://github.com/10up/distributor/pull/586)) -- Issue with timeouts on `ajax_verify_external_connection` (props [@madmax3365](https://github.com/madmax3365), [@dinhtungdu](https://github.com/dinhtungdu) via [#245](https://github.com/10up/distributor/pull/245)) -- Issue where searching for posts during a multisite pull does not work correctly (props [@petenelson](https://github.com/petenelson), [@dinhtungdu](https://github.com/dinhtungdu) via [#533](https://github.com/10up/distributor/pull/533)) -- Issue where block content pulled through External Connections get converted to classic block (props [@dinhtungdu](https://github.com/dinhtungdu), [@jshwlkr](https://github.com/jshwlkr) via [#534](https://github.com/10up/distributor/pull/534)) -- Issue where shortcodes were not rendered when pulling content within a multisite instance (props [@petenelson](https://github.com/petenelson), [@dkotter](https://github.com/dkotter) via [#498](https://github.com/10up/distributor/pull/498)) -- Issue where updating a post in a multisite environment was setting the distributed post's author to the current user rather than maintaining the original author (props [@petenelson](https://github.com/petenelson) via [#527](https://github.com/10up/distributor/pull/527)) -- Issue where REST API field was not getting populated correctly (props [@dinhtungdu](https://github.com/dinhtungdu), [@dkotter](https://github.com/dkotter), [@ivanlopez](https://github.com/ivanlopez) via [#519](https://github.com/10up/distributor/pull/519)) -- Issue where terms/meta/etc. gets distributed when updating a previously distributed post (props [@lakrisgubben](https://github.com/lakrisgubben), [@dkotter](https://github.com/dkotter) via [#518](https://github.com/10up/distributor/pull/518)) -- Replace `has_blocks` with `use_block_editor_for_post` in `is_using_gutenberg check` (props [@johnwatkins0](https://github.com/johnwatkins0), [@dkotter](https://github.com/dkotter) via [#514](https://github.com/10up/distributor/pull/514)) -- Issue where previously distributed posts appear as distributable for External Connections (props [@madmax3365](https://github.com/madmax3365), [@avag-novembit](https://github.com/avag-novembit), [@adamsilverstein](https://github.com/adamsilverstein) via [#444](https://github.com/10up/distributor/pull/444)) -- Enable multisite support for VIP Go sites (props [@dinhtungdu](https://github.com/dinhtungdu), [@WPprodigy](https://github.com/WPprodigy), [@jonny-bull](https://github.com/jonny-bull) via [#606](https://github.com/10up/distributor/pull/606)) -- External connections page markup enhancements (props [@joshuaabenazer](https://github.com/joshuaabenazer), [@samikeijonen](https://github.com/samikeijonen) via [#576](https://github.com/10up/distributor/pull/576)) -- Fixes and updates unit and acceptance tests, coding standards issues, and WordPress tested-up-to version (props [@dinhtungdu](https://github.com/dinhtungdu) via [#603](https://github.com/10up/distributor/pull/603)) +- Internal distribution prepares posts the same for Push or Pull actions (props [@rmarscher](https://github.com/rmarscher), [@dinhtungdu](https://github.com/dinhtungdu) via [#169](https://github.com/10up/distributor/pull/169)). +- Use filesystem for copying media when doing a network pull/push instead of `download_url()` (props [@petenelson](https://github.com/petenelson), [@dkotter](https://github.com/dkotter), [@dmaslogh](https://github.com/dmaslogh), [@Kpudlo](https://github.com/Kpudlo) via [#567](https://github.com/10up/distributor/pull/567)). +- Redirect to pulled content tab after content is pulled (props [@joshuaabenazer](https://github.com/joshuaabenazer), [@dkotter](https://github.com/dkotter), [@hearvox](https://github.com/hearvox) via [#575](https://github.com/10up/distributor/pull/575)). +- Remove `hoverIntent` and add empty placeholder child item in Push menu to improve keyboard support (props [@samikeijonen](https://github.com/samikeijonen), [@dinhtungdu](https://github.com/dinhtungdu), [@dkotter](https://github.com/dkotter) via [#564](https://github.com/10up/distributor/pull/564), [#607](https://github.com/10up/distributor/pull/607)). +- Order of "View" and "Edit" links in the Pull menu to match WordPress standard order (props [@jspellman814](https://github.com/jspellman814), [@hearvox](https://github.com/hearvox) via [#532](https://github.com/10up/distributor/pull/532)). +- Show/hide credentials fields based on registration status on that Registration and Settings screen (props [@dinhtungdu](https://github.com/dinhtungdu), [@oszkarnagy](https://github.com/oszkarnagy) via [#543](https://github.com/10up/distributor/pull/543)). +- `date()` to `gmdate()` per PHPCS (props [@helen](https://github.com/helen) via [#602](https://github.com/10up/distributor/pull/602)). +- Bumped WordPress version support to 5.3 (props [@dkotter](https://github.com/dkotter) via [#499](https://github.com/10up/distributor/pull/499)). +- Update all packages and build process (props [@adamsilverstein](https://github.com/adamsilverstein), [@dkotter](https://github.com/dkotter) via [#450](https://github.com/10up/distributor/pull/450)). +- Run [WP Acceptance](https://github.com/10up/wpacceptance/) tests in parallel in Travis (props [@adamsilverstein](https://github.com/adamsilverstein) via [#439](https://github.com/10up/distributor/pull/439)). + +### Fixed +- Gutenberg compatibility issues ([@dkotter](https://github.com/dkotter), [@dinhtungdu](https://github.com/dinhtungdu) via [#579](https://github.com/10up/distributor/pull/579)). +- Issue where push menu would disappear when push is in progress (props [@dinhtungdu](https://github.com/dinhtungdu), [@dkotter](https://github.com/dkotter), [@helen](https://github.com/helen) via [#538](https://github.com/10up/distributor/pull/538)). +- Undefined variable issue causing external pushes to not fully work (props [@dkotter](https://github.com/dkotter) via [#578](https://github.com/10up/distributor/pull/578)). +- Check for value of remote post id to verify push result (props [@dinhtungdu](https://github.com/dinhtungdu), [@eriktad](https://github.com/eriktad), [@arsendovlatyan](https://github.com/arsendovlatyan) via [#574](https://github.com/10up/distributor/pull/574)). +- Issue with wrong permission route that causes External Connections to fail on creation (props [@dinhtungdu](https://github.com/dinhtungdu), [@dkotter](https://github.com/dkotter) via [#570](https://github.com/10up/distributor/pull/570)). +- Issue where view links for external connections are incorrect if it is set up with a trailing slash (props [@dkotter](https://github.com/dkotter) via [#586](https://github.com/10up/distributor/pull/586)). +- Issue with timeouts on `ajax_verify_external_connection` (props [@madmax3365](https://github.com/madmax3365), [@dinhtungdu](https://github.com/dinhtungdu) via [#245](https://github.com/10up/distributor/pull/245)). +- Issue where searching for posts during a multisite pull does not work correctly (props [@petenelson](https://github.com/petenelson), [@dinhtungdu](https://github.com/dinhtungdu) via [#533](https://github.com/10up/distributor/pull/533)). +- Issue where block content pulled through External Connections get converted to classic block (props [@dinhtungdu](https://github.com/dinhtungdu), [@jshwlkr](https://github.com/jshwlkr) via [#534](https://github.com/10up/distributor/pull/534)). +- Issue where shortcodes were not rendered when pulling content within a multisite instance (props [@petenelson](https://github.com/petenelson), [@dkotter](https://github.com/dkotter) via [#498](https://github.com/10up/distributor/pull/498)). +- Issue where updating a post in a multisite environment was setting the distributed post's author to the current user rather than maintaining the original author (props [@petenelson](https://github.com/petenelson) via [#527](https://github.com/10up/distributor/pull/527)). +- Issue where REST API field was not getting populated correctly (props [@dinhtungdu](https://github.com/dinhtungdu), [@dkotter](https://github.com/dkotter), [@ivanlopez](https://github.com/ivanlopez) via [#519](https://github.com/10up/distributor/pull/519)). +- Issue where terms/meta/etc. gets distributed when updating a previously distributed post (props [@lakrisgubben](https://github.com/lakrisgubben), [@dkotter](https://github.com/dkotter) via [#518](https://github.com/10up/distributor/pull/518)). +- Replace `has_blocks` with `use_block_editor_for_post` in `is_using_gutenberg check` (props [@johnwatkins0](https://github.com/johnwatkins0), [@dkotter](https://github.com/dkotter) via [#514](https://github.com/10up/distributor/pull/514)). +- Issue where previously distributed posts appear as distributable for External Connections (props [@madmax3365](https://github.com/madmax3365), [@avag-novembit](https://github.com/avag-novembit), [@adamsilverstein](https://github.com/adamsilverstein) via [#444](https://github.com/10up/distributor/pull/444)). +- Enable multisite support for VIP Go sites (props [@dinhtungdu](https://github.com/dinhtungdu), [@WPprodigy](https://github.com/WPprodigy), [@jonny-bull](https://github.com/jonny-bull) via [#606](https://github.com/10up/distributor/pull/606)). +- External connections page markup enhancements (props [@joshuaabenazer](https://github.com/joshuaabenazer), [@samikeijonen](https://github.com/samikeijonen) via [#576](https://github.com/10up/distributor/pull/576)). +- Fixes and updates unit and acceptance tests, coding standards issues, and WordPress tested-up-to version (props [@dinhtungdu](https://github.com/dinhtungdu) via [#603](https://github.com/10up/distributor/pull/603)). ### Security -- Bump `websocket-extensions` from 0.1.3 to 0.1.4 (props [@dependabot](https://github.com/apps/dependabot) via [#587](https://github.com/10up/distributor/pull/587)) -- Bump `acorn` from 5.7.3 to 5.7.4 (props [@dependabot](https://github.com/apps/dependabot) via [#548](https://github.com/10up/distributor/pull/548)) -- Bump `extend` from 3.0.1 to 3.0.2 (props [@dependabot](https://github.com/apps/dependabot) via [#447](https://github.com/10up/distributor/pull/447)) +- Bump `websocket-extensions` from 0.1.3 to 0.1.4 (props [@dependabot](https://github.com/apps/dependabot) via [#587](https://github.com/10up/distributor/pull/587)). +- Bump `acorn` from 5.7.3 to 5.7.4 (props [@dependabot](https://github.com/apps/dependabot) via [#548](https://github.com/10up/distributor/pull/548)). +- Bump `extend` from 3.0.1 to 3.0.2 (props [@dependabot](https://github.com/apps/dependabot) via [#447](https://github.com/10up/distributor/pull/447)). ## [1.5.0] - 2019-07-18 ### Added @@ -213,6 +227,7 @@ This adds a post type selector when viewing the Pull Content list for both exter - Initial closed release. [Unreleased]: https://github.com/10up/distributor/compare/trunk...develop +[1.6.1]: https://github.com/10up/distributor/compare/1.6.0...1.6.1 [1.6.0]: https://github.com/10up/distributor/compare/1.5.0...1.6.0 [1.5.0]: https://github.com/10up/distributor/compare/1.4.1...1.5.0 [1.4.1]: https://github.com/10up/distributor/compare/1.4.0...1.4.1 diff --git a/README.md b/README.md index 491ef39e5..78c255b96 100644 --- a/README.md +++ b/README.md @@ -12,11 +12,13 @@ _Note:_ The latest stable version of the plugin is the _stable_ branch. [Downloa ## Table of Contents * [Features](#features) - * [Gutenberg Support](#gutenberg-support-beta) * [Requirements](#requirements) * [Installation](#installation) * [Registration](#registration) * [Setup External Connections](#setup-external-connections-using-application-passwords) +* [How to Distribute Content](#how-to-distribute-content) + * [Pushing Content](#pushing-content) + * [Pulling Content](#pulling-content) * [Known Caveats/Issues](#known-caveatsissues) * [Developers](#developers) * [Running Locally](#running-locally) @@ -58,7 +60,7 @@ Distributor is built with the same extensible approach as WordPress itself, with ## Installation -For production use, we recommend [registering and downloading the plugin from DistributorPlugin.com](https://distributorplugin.com/#cta) – it's 100% free. You will be emailed a direct link to download the latest, production-ready build. Alternatively, you can [download the latest release from GitHub](https://github.com/10up/distributor/archive/trunk.zip). +For Production use, we recommend [registering and downloading the plugin from DistributorPlugin.com](https://distributorplugin.com/#cta) – it's 100% free. You will be emailed a direct link to download the latest, production-ready build. Alternatively, you can [download the latest release from GitHub](https://github.com/10up/distributor/archive/trunk.zip). You can upload and install the archived (zip) plugin via the WordPress dashboard (`Plugins` > `Add New` -> `Upload Plugin`) or manually inside of the `wp-content/plugins` directory, and activate on the Plugins dashboard. @@ -75,6 +77,46 @@ To help inform our roadmap, keep adopters apprised of major updates and changes 5. On mainsite.com, add the `External Connection URL` (e.g., http://remotesite.com/wp-json). You should see a green circle and "_Connection established._". 6. Ensure the roles selected in `Roles Allowed to Push` are the ones you want to support, then press the `Create Connection` button. You should now be able to push from mainsite.com to remotesite.com. If you want to pull from remotesite.com to mainsite.com, simply repeat these instructions swapping mainsite.com and remotesite.com. +## How to Distribute Content + +There are two methods for distributing content between multiple WordPress sites, Push and Pull. Pushing allows you to share content from your site to one or more connected sites while Pulling allows you to bring content into your site from one of your connected sites. In either method, once content has been distributed it will stay in sync with any changes made to the origin post (when Pushing the origin is the site being Pushed from, when Pulling the origin is the site being Pulled from). + +### Pushing Content + +The `Distributor` menu in the WP Admin Bar will appear after a piece of content has been published. Hovering over that menu item will expose the Push menu that displays the list of connected sites on the left, the list of sites that have been selected for push distribution on the right, and a button to `Distribute` the content to those selected sites. + +Push menu exposed when viewing published content on the front-end + +The same Push menu and set of Distributor options are also available after publishing a piece of content within the WordPress Block Editor. + +Push menu exposed when viewing published content in the Block Editor + +After you click the `Distribute` button, Distributor will push the content to the selected connected sites, showing a `View` link when those pieces of content have been distributed, and noting `Post successfully distributed.` once the content has completed distributing to selected sites. + +Push menu showing details after content distribution + +When viewing that piece of content in the Block Editor, there will be a Distributor notice in the `Status & visibility` section noting how many sites the content has been distributed to. + +Block Editor sidebar showing Distributor count of sites that content has been distributed to (via Push and Pull) + +The same Push menu is available in the WP Admin Bar if you are using the Classic Editor. The Distributor notice is also available in the `Publish` metabox noting how many sites the content has been distributed to. + +Classic Editor showing the Push menu and metabox showing Distributor count of sites that content has been distributed to (via Push and Pull) + +### Pulling Content + +Navigating to the `Distributor` > `Pull Content` screen in the WP Admin will present you with a dropdown to select any of the sites you are connected to and will display all available pieces of content that can be Pulled into the current site. You can select Posts, Pages, and other Custom Post Types to filter on this screen; you can use the Bulk Edit menu to Pull or Skip more than one piece of content at a time; and you can use individual row actions on each piece of content pull, view, or skip each piece of content. + +Pull Content screen showing row actions and a single post selected for Pulling + +After you have Bulk Pulled several pieces of content or used the row actions to Pull a single piece of content, the Pull Content screen will show a confirmation message that the Pull action was successful and redirect you to the `Pulled` list view to see all the items that have been pulled into the current site. The same process will happen if you opt to Skip specific piece(s) of content. + +Pull Content screen showing confirmation on content being pulled + +You can navigate to the `Posts` > `All Posts` table list view to see all content that has been pushed or pulled to the current site via the Distributor column denoted with the Distributor icon (Distributor icon). Rows that include the Distributor icon will link off that icon to the origin site and post where that content was either pushed or pulled from. + +All Posts screen showing Distributor links for pushed and pulled content + ## Support Level **Active:** 10up is actively working on this, and we expect to continue work for the foreseeable future including keeping tested up to the most recent version of WordPress. Bug reports, feature requests, questions, and pull requests are welcome. @@ -107,7 +149,7 @@ __Distributing Post Date__ - By default, the "post date" on distributed stories __Distributing Canonical URL__ - By default, canonical URL of distributed post will point to original content, which corresponds to SEO best practices. This can be overridden by extending Distributor with custom code and removing Distributor's default front end canonical URL filtering (look for `'get_canonical_url'` and `'wpseo_canonical'`). -__Drafts as preferred Status__ - By default, drafts are the preferred status and can't be changed at the source site. +__Drafts as Preferred Status__ - By default, drafts are the preferred status and can't be changed at the source site. ## Developers diff --git a/assets/img/screenshot-1.png b/assets/img/screenshot-1.png new file mode 100644 index 000000000..91b067c6b Binary files /dev/null and b/assets/img/screenshot-1.png differ diff --git a/assets/img/screenshot-2.png b/assets/img/screenshot-2.png new file mode 100644 index 000000000..bf514aae3 Binary files /dev/null and b/assets/img/screenshot-2.png differ diff --git a/assets/img/screenshot-3.png b/assets/img/screenshot-3.png new file mode 100644 index 000000000..378a8d46b Binary files /dev/null and b/assets/img/screenshot-3.png differ diff --git a/assets/img/screenshot-4.png b/assets/img/screenshot-4.png new file mode 100644 index 000000000..5ab1e38e1 Binary files /dev/null and b/assets/img/screenshot-4.png differ diff --git a/assets/img/screenshot-5.png b/assets/img/screenshot-5.png new file mode 100644 index 000000000..b4051665e Binary files /dev/null and b/assets/img/screenshot-5.png differ diff --git a/assets/img/screenshot-6.png b/assets/img/screenshot-6.png new file mode 100644 index 000000000..36f5131be Binary files /dev/null and b/assets/img/screenshot-6.png differ diff --git a/assets/img/screenshot-7.png b/assets/img/screenshot-7.png new file mode 100644 index 000000000..eb503fc8f Binary files /dev/null and b/assets/img/screenshot-7.png differ diff --git a/assets/img/screenshot-8.png b/assets/img/screenshot-8.png new file mode 100644 index 000000000..bc89d4c69 Binary files /dev/null and b/assets/img/screenshot-8.png differ diff --git a/dist/css/admin-external-connection.min.css b/dist/css/admin-external-connection.min.css index a8ea8fde1..4c722d962 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-roles-allowed legend{font-size:14px;font-weight:700;margin-bottom:4px}#dt_external_connection_details .dt-roles-allowed label{font-weight:400;vertical-align:top}#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 .dt-roles-allowed,#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:.5em solid #cfcfcf;border-left-color:#666;-webkit-transform:translateZ(0);transform:translateZ(0);-webkit-animation:load8 1.1s linear infinite;animation:load8 1.1s linear infinite}.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 load8{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes load8{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}.post-new-php .connection-field-wrap,.post-new-php .dt-roles-allowed,.post-new-php .dt-submit-connection,.post-new-php .external-connection-setup,.post-new-php .external-connection-wizard,.post-php .external-connection-wizard{display:none}.post-new-php #wpbody.wp .external-connection-wizard{display:inline-block}.post-new-php .auth-credentials.dotcom-oauth2,.post-php #wpbody.wp .auth-credentials.dotcom-oauth2{display:none}.post-new-php #wpbody.wpdotcom .auth-credentials.dotcom-oauth2{display:inline-block}.post-php #wpbody.wpdotcom .external-connection-setup,.post-php .choose-authentication{display:none}.manual-setup-button{padding-left:5px}.dt-wizard-status{display:none}.dt-wizard-status .spinner{float:none;margin-top:0;margin-left:0}.dt-wizard-error{color:#a00} +#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-roles-allowed legend{font-size:14px;font-weight:700;margin-bottom:4px}#dt_external_connection_details .dt-roles-allowed label{font-weight:400;vertical-align:top}#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 .dt-roles-allowed,#dt_external_connection_details .post-types-permissions,#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:.5em solid #cfcfcf;border-left-color:#666;-webkit-transform:translateZ(0);transform:translateZ(0);-webkit-animation:load8 1.1s linear infinite;animation:load8 1.1s linear infinite}.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 load8{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes load8{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}.post-new-php .connection-field-wrap,.post-new-php .dt-roles-allowed,.post-new-php .dt-submit-connection,.post-new-php .external-connection-setup,.post-new-php .external-connection-wizard,.post-php .external-connection-wizard{display:none}.post-new-php #wpbody.wp .external-connection-wizard{display:inline-block}.post-new-php .auth-credentials.dotcom-oauth2,.post-php #wpbody.wp .auth-credentials.dotcom-oauth2{display:none}.post-new-php #wpbody.wpdotcom .auth-credentials.dotcom-oauth2{display:inline-block}.post-php #wpbody.wpdotcom .external-connection-setup,.post-php .choose-authentication{display:none}.manual-setup-button{padding-left:5px}.dt-wizard-status{display:none}.dt-wizard-status .spinner{float:none;margin-top:0;margin-left:0}.dt-wizard-error{color:#a00} /*# 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 fc087a2cd..8dd664f5c 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-roles-allowed legend{font-size:14px;font-weight:700;margin-bottom:4px}#dt_external_connection_details .dt-roles-allowed label{font-weight:400;vertical-align:top}#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 .dt-roles-allowed,#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:.5em solid #cfcfcf;border-left-color:#666;-webkit-transform:translateZ(0);transform:translateZ(0);-webkit-animation:load8 1.1s linear infinite;animation:load8 1.1s linear infinite}.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 load8{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes load8{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}.post-new-php .connection-field-wrap,.post-new-php .dt-roles-allowed,.post-new-php .dt-submit-connection,.post-new-php .external-connection-setup,.post-new-php .external-connection-wizard,.post-php .external-connection-wizard{display:none}.post-new-php #wpbody.wp .external-connection-wizard{display:inline-block}.post-new-php .auth-credentials.dotcom-oauth2,.post-php #wpbody.wp .auth-credentials.dotcom-oauth2{display:none}.post-new-php #wpbody.wpdotcom .auth-credentials.dotcom-oauth2{display:inline-block}.post-php #wpbody.wpdotcom .external-connection-setup,.post-php .choose-authentication{display:none}.manual-setup-button{padding-left:5px}.dt-wizard-status{display:none}.dt-wizard-status .spinner{float:none;margin-top:0;margin-left:0}.dt-wizard-error{color:#a00}"],"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-roles-allowed legend{font-size:14px;font-weight:700;margin-bottom:4px}#dt_external_connection_details .dt-roles-allowed label{font-weight:400;vertical-align:top}#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 .dt-roles-allowed,#dt_external_connection_details .post-types-permissions,#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:.5em solid #cfcfcf;border-left-color:#666;-webkit-transform:translateZ(0);transform:translateZ(0);-webkit-animation:load8 1.1s linear infinite;animation:load8 1.1s linear infinite}.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 load8{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes load8{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}.post-new-php .connection-field-wrap,.post-new-php .dt-roles-allowed,.post-new-php .dt-submit-connection,.post-new-php .external-connection-setup,.post-new-php .external-connection-wizard,.post-php .external-connection-wizard{display:none}.post-new-php #wpbody.wp .external-connection-wizard{display:inline-block}.post-new-php .auth-credentials.dotcom-oauth2,.post-php #wpbody.wp .auth-credentials.dotcom-oauth2{display:none}.post-new-php #wpbody.wpdotcom .auth-credentials.dotcom-oauth2{display:inline-block}.post-php #wpbody.wpdotcom .external-connection-setup,.post-php .choose-authentication{display:none}.manual-setup-button{padding-left:5px}.dt-wizard-status{display:none}.dt-wizard-status .spinner{float:none;margin-top:0;margin-left:0}.dt-wizard-error{color:#a00}"],"file":"admin-external-connection.min.css"} \ No newline at end of file diff --git a/dist/css/admin-pull-table.min.css b/dist/css/admin-pull-table.min.css index 72d9c56b8..75d679c1e 100644 --- a/dist/css/admin-pull-table.min.css +++ b/dist/css/admin-pull-table.min.css @@ -1,2 +1,2 @@ -.distributor_page_pull.dt-loading #posts-filter,.distributor_page_pull.dt-loading .subsubsub{opacity:.5;pointer-events:none;cursor:default}.wp-list-table .disabled{opacity:.7}.status-sync .check-column{display:none} +.distributor_page_pull.dt-loading #posts-filter,.distributor_page_pull.dt-loading .subsubsub{opacity:.5;pointer-events:none;cursor:default}.wp-list-table .disabled{opacity:.7}.status-sync .check-column{display:none}#pull-errors ul ul{list-style:disc;padding-left:20px} /*# sourceMappingURL=admin-pull-table.min.css.map */ diff --git a/dist/css/admin-pull-table.min.css.map b/dist/css/admin-pull-table.min.css.map index f2ec70a62..7d7c77a45 100644 --- a/dist/css/admin-pull-table.min.css.map +++ b/dist/css/admin-pull-table.min.css.map @@ -1 +1 @@ -{"version":3,"names":[],"mappings":"","sources":["admin-pull-table.min.css"],"sourcesContent":[".distributor_page_pull.dt-loading #posts-filter,.distributor_page_pull.dt-loading .subsubsub{opacity:.5;pointer-events:none;cursor:default}.wp-list-table .disabled{opacity:.7}.status-sync .check-column{display:none}"],"file":"admin-pull-table.min.css"} \ No newline at end of file +{"version":3,"names":[],"mappings":"","sources":["admin-pull-table.min.css"],"sourcesContent":[".distributor_page_pull.dt-loading #posts-filter,.distributor_page_pull.dt-loading .subsubsub{opacity:.5;pointer-events:none;cursor:default}.wp-list-table .disabled{opacity:.7}.status-sync .check-column{display:none}#pull-errors ul ul{list-style:disc;padding-left:20px}"],"file":"admin-pull-table.min.css"} \ No newline at end of file diff --git a/dist/css/push.min.css b/dist/css/push.min.css index 3b2b7ed63..9c4b7478a 100644 --- a/dist/css/push.min.css +++ b/dist/css/push.min.css @@ -1,2 +1,2 @@ -#distributor-push-wrapper,#wpadminbar #wp-admin-bar-distributor-placeholder>.ab-item{display:none}#wpadminbar #distributor-push-wrapper{display:-webkit-box;display:-ms-flexbox;display:flex;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}#wp-admin-bar-distributor.syncing>.ab-sub-wrapper{display:block}#wp-admin-bar-distributor.hover:before,#wp-admin-bar-distributor.syncing:before{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,.6);z-index:-1;content:"";pointer-events:none}#wpadminbar #distributor-push-wrapper .inner{width:100%;max-width:768px;margin:0 auto}#wpadminbar #distributor-push-wrapper .new-connections-list{border:1px solid #555;max-height:155px;overflow:auto}#wpadminbar #distributor-push-wrapper .new-connections-list .no-results{margin:0!important;padding:.5em}#wpadminbar #distributor-push-wrapper .selected-connections-list{margin-bottom:.5em;max-height:145px;overflow:auto}#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 button.selectno-connections{margin-left:10px}#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:calc(100% - 1.0556em - 2px);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]::-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-color:#a6a6a6}#wpadminbar #distributor-push-wrapper button{padding:.5em 1em;border-radius:3px;min-height:0}#wpadminbar #distributor-push-wrapper button.button-link{margin:0;padding:0;-webkit-box-shadow:none;box-shadow:none;border:0;border-radius:0;background:none;cursor:pointer;text-align:left;color:#00a0d2;text-decoration:underline;-webkit-transition-property:border,background,color;transition-property:border,background,color;-webkit-transition-duration:.05s;transition-duration:.05s;-webkit-transition-timing-function:ease-in-out;transition-timing-function:ease-in-out}#wpadminbar #distributor-push-wrapper button.button-link:hover{color:#fff;text-decoration:none}#wpadminbar #distributor-push-wrapper button.button-primary:hover{background-color:#005b85;border-color:#005b85}#wpadminbar #distributor-push-wrapper button.selectall-connections{margin-top:.5em;margin-bottom:-10px}#wpadminbar #distributor-push-wrapper .new-connections-list>.add-connection:nth-child(odd){background-color:#23282d}#wpadminbar #distributor-push-wrapper .add-connection,#wpadminbar #distributor-push-wrapper .added-connection{background-color:transparent;border:0;border-radius:0;-webkit-box-shadow:none;box-shadow:none;display:block;width:100%;padding:.5em;-webkit-box-sizing:border-box;box-sizing:border-box;color:inherit;cursor:pointer;text-align:left}#wpadminbar #distributor-push-wrapper .add-connection:focus,#wpadminbar #distributor-push-wrapper .added-connection:focus{-webkit-box-shadow:inset 0 0 0 2px #fff;box-shadow:inset 0 0 0 2px #fff;outline:2px solid transparent;outline-offset:0}#wpadminbar #distributor-push-wrapper .add-connection:hover,#wpadminbar #distributor-push-wrapper .added-connection:hover{text-decoration:underline}#wpadminbar #distributor-push-wrapper .new-connections-list .add-connection.added{background-color:#5d666f}#wpadminbar #distributor-push-wrapper .add-connection.syndicated{position:relative;pointer-events:none;cursor:not-allowed}#wpadminbar #distributor-push-wrapper .add-connection.syndicated:after{content:"\f147";font-family:dashicons;color:#555}#wpadminbar #distributor-push-wrapper .add-connection.syndicated:hover{text-decoration:none}#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;pointer-events:all}#wpadminbar #distributor-push-wrapper .add-connection.syndicated a:focus{-webkit-box-shadow:inset 0 0 0 1px #fff;box-shadow:inset 0 0 0 1px #fff}#wpadminbar #distributor-push-wrapper .add-connection.syndicated a:hover{text-decoration:none}#wpadminbar #distributor-push-wrapper .added-connection{background-color:#555;margin-bottom:.5em;cursor:normal;position:relative}#wpadminbar #distributor-push-wrapper .added-connection:hover{text-decoration:none}#wpadminbar #distributor-push-wrapper .added-connection:hover .remove-connection:after{color:red}#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 .syncing #distributor-push-wrapper .action-wrapper .selectall-connections:after,#wpadminbar .syncing #distributor-push-wrapper .action-wrapper .selectno-connections:after,#wpadminbar .syncing #distributor-push-wrapper .action-wrapper .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:3px solid #cfcfcf;border-left-color:#00aef2;-webkit-transform:translateZ(0);transform:translateZ(0);-webkit-animation:load8 1.1s linear infinite;animation:load8 1.1s linear infinite;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}#distributor-push-wrapper .loader-item{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;overflow:hidden}#distributor-push-wrapper.message-error .loader-item{display:none}@media (min-width:480px){#wpadminbar #distributor-push-wrapper .loader-messages{width:100%;float:none;padding-left:0}}#distributor-push-wrapper .loader-item,#distributor-push-wrapper .loader-item *,#distributor-push-wrapper .loader-item :after,#distributor-push-wrapper .loader-item :before{-webkit-box-sizing:border-box;box-sizing:border-box}#distributor-push-wrapper .loader-item:before{content:" ";position:absolute;top:0;right:0;bottom:0;left:50%;z-index:1;width:349%;margin-left:-250%;-webkit-animation:loaderAnimation .8s linear infinite;animation:loaderAnimation .8s linear infinite;background:-webkit-gradient(linear,left top,right top,color-stop(46%,hsla(0,0%,100%,0)),color-stop(50%,hsla(0,0%,100%,.35)),color-stop(54%,hsla(0,0%,100%,0))) 50% 50%;background:linear-gradient(90deg,hsla(0,0%,100%,0) 46%,hsla(0,0%,100%,.35) 50%,hsla(0,0%,100%,0) 54%) 50% 50%}#distributor-push-wrapper .loader-item>*{-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-flow:column;flex-flow:column}#distributor-push-wrapper .loader-row{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap}#distributor-push-wrapper .loader-row.border{border:1px solid #555}#distributor-push-wrapper .loader-row div{height:15px}#distributor-push-wrapper .loader-row .big,#distributor-push-wrapper .loader-row.big div{height:30px}#distributor-push-wrapper .loader-row .odd{background-color:#23282d}#distributor-push-wrapper .loader-row .bottom{margin-bottom:15px}#distributor-push-wrapper .loader-col-4{-webkit-box-flex:0;-ms-flex:0 0 30%;flex:0 0 30%;padding-left:3em}#distributor-push-wrapper .loader-col-8{-webkit-box-flex:0;-ms-flex:0 0 60%;flex:0 0 60%}#distributor-push-wrapper .loader-col-12{-webkit-box-flex:0;-ms-flex:0 0 100%;flex:0 0 100%}@-webkit-keyframes load8{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes load8{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@-webkit-keyframes loaderAnimation{0%{-webkit-transform:translate3d(-30%,0,0);transform:translate3d(-30%,0,0)}to{-webkit-transform:translate3d(30%,0,0);transform:translate3d(30%,0,0)}}@keyframes loaderAnimation{0%{-webkit-transform:translate3d(-30%,0,0);transform:translate3d(-30%,0,0)}to{-webkit-transform:translate3d(30%,0,0);transform:translate3d(30%,0,0)}} +#distributor-push-wrapper,#wpadminbar #wp-admin-bar-distributor-placeholder>.ab-item{display:none}#wpadminbar #distributor-push-wrapper{display:-webkit-box;display:-ms-flexbox;display:flex;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}#wp-admin-bar-distributor.syncing>.ab-sub-wrapper{display:block}#wp-admin-bar-distributor.hover:before,#wp-admin-bar-distributor.syncing:before{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,.6);z-index:-1;content:"";pointer-events:none}#wpadminbar #distributor-push-wrapper .inner{width:100%;max-width:768px;margin:0 auto}#wpadminbar #distributor-push-wrapper .new-connections-list{border:1px solid #555;max-height:155px;overflow:auto}#wpadminbar #distributor-push-wrapper .new-connections-list .no-results{margin:0!important;padding:.5em}#wpadminbar #distributor-push-wrapper .selected-connections-list{margin-bottom:.5em;max-height:145px;overflow:auto}#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 button.selectno-connections{margin-left:10px}#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:calc(100% - 1.0556em - 2px);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]::-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-color:#a6a6a6}#wpadminbar #distributor-push-wrapper button{padding:.5em 1em;border-radius:3px;min-height:0}#wpadminbar #distributor-push-wrapper button.button-link{margin:0;padding:0;-webkit-box-shadow:none;box-shadow:none;border:0;border-radius:0;background:none;cursor:pointer;text-align:left;color:#00a0d2;text-decoration:underline;-webkit-transition-property:border,background,color;transition-property:border,background,color;-webkit-transition-duration:.05s;transition-duration:.05s;-webkit-transition-timing-function:ease-in-out;transition-timing-function:ease-in-out}#wpadminbar #distributor-push-wrapper button.button-link:hover{color:#fff;text-decoration:none}#wpadminbar #distributor-push-wrapper button.button-primary:hover{background-color:#005b85;border-color:#005b85}#wpadminbar #distributor-push-wrapper button.selectall-connections{margin-top:.5em;margin-bottom:-10px}#wpadminbar #distributor-push-wrapper .new-connections-list>.add-connection:nth-child(odd){background-color:#23282d}#wpadminbar #distributor-push-wrapper .add-connection,#wpadminbar #distributor-push-wrapper .added-connection{background-color:transparent;border:0;border-radius:0;-webkit-box-shadow:none;box-shadow:none;display:block;width:100%;padding:.5em;-webkit-box-sizing:border-box;box-sizing:border-box;color:inherit;cursor:pointer;text-align:left}#wpadminbar #distributor-push-wrapper .add-connection:focus,#wpadminbar #distributor-push-wrapper .added-connection:focus{-webkit-box-shadow:inset 0 0 0 2px #fff;box-shadow:inset 0 0 0 2px #fff;outline:2px solid transparent;outline-offset:0}#wpadminbar #distributor-push-wrapper .add-connection:hover,#wpadminbar #distributor-push-wrapper .added-connection:hover{text-decoration:underline}#wpadminbar #distributor-push-wrapper .new-connections-list .add-connection.added{background-color:#5d666f}#wpadminbar #distributor-push-wrapper .add-connection.syndicated{position:relative;pointer-events:none;cursor:not-allowed}#wpadminbar #distributor-push-wrapper .add-connection.syndicated:after{content:"\f147";font-family:dashicons;color:#555}#wpadminbar #distributor-push-wrapper .add-connection.syndicated:hover{text-decoration:none}#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;pointer-events:all}#wpadminbar #distributor-push-wrapper .add-connection.syndicated a:focus{-webkit-box-shadow:inset 0 0 0 1px #fff;box-shadow:inset 0 0 0 1px #fff}#wpadminbar #distributor-push-wrapper .add-connection.syndicated a:hover{text-decoration:none}#wpadminbar #distributor-push-wrapper .added-connection{background-color:#555;margin-bottom:.5em;cursor:normal;position:relative}#wpadminbar #distributor-push-wrapper .added-connection:hover{text-decoration:none}#wpadminbar #distributor-push-wrapper .added-connection:hover .remove-connection:after{color:red}#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 .syncing #distributor-push-wrapper .action-wrapper .selectall-connections:after,#wpadminbar .syncing #distributor-push-wrapper .action-wrapper .selectno-connections:after,#wpadminbar .syncing #distributor-push-wrapper .action-wrapper .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:3px solid #cfcfcf;border-left-color:#00aef2;-webkit-transform:translateZ(0);transform:translateZ(0);-webkit-animation:load8 1.1s linear infinite;animation:load8 1.1s linear infinite;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}#wpadminbar #distributor-push-wrapper .messages ul.details{padding-left:1.5rem}#wpadminbar #distributor-push-wrapper .messages ul.details li{list-style:disc}#distributor-push-wrapper .loader-item{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;overflow:hidden}#distributor-push-wrapper.message-error .loader-item{display:none}@media (min-width:480px){#wpadminbar #distributor-push-wrapper .loader-messages{width:100%;float:none;padding-left:0}}#distributor-push-wrapper .loader-item,#distributor-push-wrapper .loader-item *,#distributor-push-wrapper .loader-item :after,#distributor-push-wrapper .loader-item :before{-webkit-box-sizing:border-box;box-sizing:border-box}#distributor-push-wrapper .loader-item:before{content:" ";position:absolute;top:0;right:0;bottom:0;left:50%;z-index:1;width:349%;margin-left:-250%;-webkit-animation:loaderAnimation .8s linear infinite;animation:loaderAnimation .8s linear infinite;background:-webkit-gradient(linear,left top,right top,color-stop(46%,hsla(0,0%,100%,0)),color-stop(50%,hsla(0,0%,100%,.35)),color-stop(54%,hsla(0,0%,100%,0))) 50% 50%;background:linear-gradient(90deg,hsla(0,0%,100%,0) 46%,hsla(0,0%,100%,.35) 50%,hsla(0,0%,100%,0) 54%) 50% 50%}#distributor-push-wrapper .loader-item>*{-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-flow:column;flex-flow:column}#distributor-push-wrapper .loader-row{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap}#distributor-push-wrapper .loader-row.border{border:1px solid #555}#distributor-push-wrapper .loader-row div{height:15px}#distributor-push-wrapper .loader-row .big,#distributor-push-wrapper .loader-row.big div{height:30px}#distributor-push-wrapper .loader-row .odd{background-color:#23282d}#distributor-push-wrapper .loader-row .bottom{margin-bottom:15px}#distributor-push-wrapper .loader-col-4{-webkit-box-flex:0;-ms-flex:0 0 30%;flex:0 0 30%;padding-left:3em}#distributor-push-wrapper .loader-col-8{-webkit-box-flex:0;-ms-flex:0 0 60%;flex:0 0 60%}#distributor-push-wrapper .loader-col-12{-webkit-box-flex:0;-ms-flex:0 0 100%;flex:0 0 100%}@-webkit-keyframes load8{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes load8{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@-webkit-keyframes loaderAnimation{0%{-webkit-transform:translate3d(-30%,0,0);transform:translate3d(-30%,0,0)}to{-webkit-transform:translate3d(30%,0,0);transform:translate3d(30%,0,0)}}@keyframes loaderAnimation{0%{-webkit-transform:translate3d(-30%,0,0);transform:translate3d(-30%,0,0)}to{-webkit-transform:translate3d(30%,0,0);transform:translate3d(30%,0,0)}} /*# sourceMappingURL=push.min.css.map */ diff --git a/dist/css/push.min.css.map b/dist/css/push.min.css.map index 38a9d3fa5..90bd6b1dd 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,#wpadminbar #wp-admin-bar-distributor-placeholder>.ab-item{display:none}#wpadminbar #distributor-push-wrapper{display:-webkit-box;display:-ms-flexbox;display:flex;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}#wp-admin-bar-distributor.syncing>.ab-sub-wrapper{display:block}#wp-admin-bar-distributor.hover:before,#wp-admin-bar-distributor.syncing:before{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,.6);z-index:-1;content:\"\";pointer-events:none}#wpadminbar #distributor-push-wrapper .inner{width:100%;max-width:768px;margin:0 auto}#wpadminbar #distributor-push-wrapper .new-connections-list{border:1px solid #555;max-height:155px;overflow:auto}#wpadminbar #distributor-push-wrapper .new-connections-list .no-results{margin:0!important;padding:.5em}#wpadminbar #distributor-push-wrapper .selected-connections-list{margin-bottom:.5em;max-height:145px;overflow:auto}#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 button.selectno-connections{margin-left:10px}#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:calc(100% - 1.0556em - 2px);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]::-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-color:#a6a6a6}#wpadminbar #distributor-push-wrapper button{padding:.5em 1em;border-radius:3px;min-height:0}#wpadminbar #distributor-push-wrapper button.button-link{margin:0;padding:0;-webkit-box-shadow:none;box-shadow:none;border:0;border-radius:0;background:none;cursor:pointer;text-align:left;color:#00a0d2;text-decoration:underline;-webkit-transition-property:border,background,color;transition-property:border,background,color;-webkit-transition-duration:.05s;transition-duration:.05s;-webkit-transition-timing-function:ease-in-out;transition-timing-function:ease-in-out}#wpadminbar #distributor-push-wrapper button.button-link:hover{color:#fff;text-decoration:none}#wpadminbar #distributor-push-wrapper button.button-primary:hover{background-color:#005b85;border-color:#005b85}#wpadminbar #distributor-push-wrapper button.selectall-connections{margin-top:.5em;margin-bottom:-10px}#wpadminbar #distributor-push-wrapper .new-connections-list>.add-connection:nth-child(odd){background-color:#23282d}#wpadminbar #distributor-push-wrapper .add-connection,#wpadminbar #distributor-push-wrapper .added-connection{background-color:transparent;border:0;border-radius:0;-webkit-box-shadow:none;box-shadow:none;display:block;width:100%;padding:.5em;-webkit-box-sizing:border-box;box-sizing:border-box;color:inherit;cursor:pointer;text-align:left}#wpadminbar #distributor-push-wrapper .add-connection:focus,#wpadminbar #distributor-push-wrapper .added-connection:focus{-webkit-box-shadow:inset 0 0 0 2px #fff;box-shadow:inset 0 0 0 2px #fff;outline:2px solid transparent;outline-offset:0}#wpadminbar #distributor-push-wrapper .add-connection:hover,#wpadminbar #distributor-push-wrapper .added-connection:hover{text-decoration:underline}#wpadminbar #distributor-push-wrapper .new-connections-list .add-connection.added{background-color:#5d666f}#wpadminbar #distributor-push-wrapper .add-connection.syndicated{position:relative;pointer-events:none;cursor:not-allowed}#wpadminbar #distributor-push-wrapper .add-connection.syndicated:after{content:\"\\f147\";font-family:dashicons;color:#555}#wpadminbar #distributor-push-wrapper .add-connection.syndicated:hover{text-decoration:none}#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;pointer-events:all}#wpadminbar #distributor-push-wrapper .add-connection.syndicated a:focus{-webkit-box-shadow:inset 0 0 0 1px #fff;box-shadow:inset 0 0 0 1px #fff}#wpadminbar #distributor-push-wrapper .add-connection.syndicated a:hover{text-decoration:none}#wpadminbar #distributor-push-wrapper .added-connection{background-color:#555;margin-bottom:.5em;cursor:normal;position:relative}#wpadminbar #distributor-push-wrapper .added-connection:hover{text-decoration:none}#wpadminbar #distributor-push-wrapper .added-connection:hover .remove-connection:after{color:red}#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 .syncing #distributor-push-wrapper .action-wrapper .selectall-connections:after,#wpadminbar .syncing #distributor-push-wrapper .action-wrapper .selectno-connections:after,#wpadminbar .syncing #distributor-push-wrapper .action-wrapper .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:3px solid #cfcfcf;border-left-color:#00aef2;-webkit-transform:translateZ(0);transform:translateZ(0);-webkit-animation:load8 1.1s linear infinite;animation:load8 1.1s linear infinite;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}#distributor-push-wrapper .loader-item{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;overflow:hidden}#distributor-push-wrapper.message-error .loader-item{display:none}@media (min-width:480px){#wpadminbar #distributor-push-wrapper .loader-messages{width:100%;float:none;padding-left:0}}#distributor-push-wrapper .loader-item,#distributor-push-wrapper .loader-item *,#distributor-push-wrapper .loader-item :after,#distributor-push-wrapper .loader-item :before{-webkit-box-sizing:border-box;box-sizing:border-box}#distributor-push-wrapper .loader-item:before{content:\" \";position:absolute;top:0;right:0;bottom:0;left:50%;z-index:1;width:349%;margin-left:-250%;-webkit-animation:loaderAnimation .8s linear infinite;animation:loaderAnimation .8s linear infinite;background:-webkit-gradient(linear,left top,right top,color-stop(46%,hsla(0,0%,100%,0)),color-stop(50%,hsla(0,0%,100%,.35)),color-stop(54%,hsla(0,0%,100%,0))) 50% 50%;background:linear-gradient(90deg,hsla(0,0%,100%,0) 46%,hsla(0,0%,100%,.35) 50%,hsla(0,0%,100%,0) 54%) 50% 50%}#distributor-push-wrapper .loader-item>*{-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-flow:column;flex-flow:column}#distributor-push-wrapper .loader-row{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap}#distributor-push-wrapper .loader-row.border{border:1px solid #555}#distributor-push-wrapper .loader-row div{height:15px}#distributor-push-wrapper .loader-row .big,#distributor-push-wrapper .loader-row.big div{height:30px}#distributor-push-wrapper .loader-row .odd{background-color:#23282d}#distributor-push-wrapper .loader-row .bottom{margin-bottom:15px}#distributor-push-wrapper .loader-col-4{-webkit-box-flex:0;-ms-flex:0 0 30%;flex:0 0 30%;padding-left:3em}#distributor-push-wrapper .loader-col-8{-webkit-box-flex:0;-ms-flex:0 0 60%;flex:0 0 60%}#distributor-push-wrapper .loader-col-12{-webkit-box-flex:0;-ms-flex:0 0 100%;flex:0 0 100%}@-webkit-keyframes load8{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes load8{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@-webkit-keyframes loaderAnimation{0%{-webkit-transform:translate3d(-30%,0,0);transform:translate3d(-30%,0,0)}to{-webkit-transform:translate3d(30%,0,0);transform:translate3d(30%,0,0)}}@keyframes loaderAnimation{0%{-webkit-transform:translate3d(-30%,0,0);transform:translate3d(-30%,0,0)}to{-webkit-transform:translate3d(30%,0,0);transform:translate3d(30%,0,0)}}"],"file":"push.min.css"} \ No newline at end of file +{"version":3,"names":[],"mappings":"","sources":["push.min.css"],"sourcesContent":["#distributor-push-wrapper,#wpadminbar #wp-admin-bar-distributor-placeholder>.ab-item{display:none}#wpadminbar #distributor-push-wrapper{display:-webkit-box;display:-ms-flexbox;display:flex;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}#wp-admin-bar-distributor.syncing>.ab-sub-wrapper{display:block}#wp-admin-bar-distributor.hover:before,#wp-admin-bar-distributor.syncing:before{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,.6);z-index:-1;content:\"\";pointer-events:none}#wpadminbar #distributor-push-wrapper .inner{width:100%;max-width:768px;margin:0 auto}#wpadminbar #distributor-push-wrapper .new-connections-list{border:1px solid #555;max-height:155px;overflow:auto}#wpadminbar #distributor-push-wrapper .new-connections-list .no-results{margin:0!important;padding:.5em}#wpadminbar #distributor-push-wrapper .selected-connections-list{margin-bottom:.5em;max-height:145px;overflow:auto}#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 button.selectno-connections{margin-left:10px}#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:calc(100% - 1.0556em - 2px);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]::-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-color:#a6a6a6}#wpadminbar #distributor-push-wrapper button{padding:.5em 1em;border-radius:3px;min-height:0}#wpadminbar #distributor-push-wrapper button.button-link{margin:0;padding:0;-webkit-box-shadow:none;box-shadow:none;border:0;border-radius:0;background:none;cursor:pointer;text-align:left;color:#00a0d2;text-decoration:underline;-webkit-transition-property:border,background,color;transition-property:border,background,color;-webkit-transition-duration:.05s;transition-duration:.05s;-webkit-transition-timing-function:ease-in-out;transition-timing-function:ease-in-out}#wpadminbar #distributor-push-wrapper button.button-link:hover{color:#fff;text-decoration:none}#wpadminbar #distributor-push-wrapper button.button-primary:hover{background-color:#005b85;border-color:#005b85}#wpadminbar #distributor-push-wrapper button.selectall-connections{margin-top:.5em;margin-bottom:-10px}#wpadminbar #distributor-push-wrapper .new-connections-list>.add-connection:nth-child(odd){background-color:#23282d}#wpadminbar #distributor-push-wrapper .add-connection,#wpadminbar #distributor-push-wrapper .added-connection{background-color:transparent;border:0;border-radius:0;-webkit-box-shadow:none;box-shadow:none;display:block;width:100%;padding:.5em;-webkit-box-sizing:border-box;box-sizing:border-box;color:inherit;cursor:pointer;text-align:left}#wpadminbar #distributor-push-wrapper .add-connection:focus,#wpadminbar #distributor-push-wrapper .added-connection:focus{-webkit-box-shadow:inset 0 0 0 2px #fff;box-shadow:inset 0 0 0 2px #fff;outline:2px solid transparent;outline-offset:0}#wpadminbar #distributor-push-wrapper .add-connection:hover,#wpadminbar #distributor-push-wrapper .added-connection:hover{text-decoration:underline}#wpadminbar #distributor-push-wrapper .new-connections-list .add-connection.added{background-color:#5d666f}#wpadminbar #distributor-push-wrapper .add-connection.syndicated{position:relative;pointer-events:none;cursor:not-allowed}#wpadminbar #distributor-push-wrapper .add-connection.syndicated:after{content:\"\\f147\";font-family:dashicons;color:#555}#wpadminbar #distributor-push-wrapper .add-connection.syndicated:hover{text-decoration:none}#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;pointer-events:all}#wpadminbar #distributor-push-wrapper .add-connection.syndicated a:focus{-webkit-box-shadow:inset 0 0 0 1px #fff;box-shadow:inset 0 0 0 1px #fff}#wpadminbar #distributor-push-wrapper .add-connection.syndicated a:hover{text-decoration:none}#wpadminbar #distributor-push-wrapper .added-connection{background-color:#555;margin-bottom:.5em;cursor:normal;position:relative}#wpadminbar #distributor-push-wrapper .added-connection:hover{text-decoration:none}#wpadminbar #distributor-push-wrapper .added-connection:hover .remove-connection:after{color:red}#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 .syncing #distributor-push-wrapper .action-wrapper .selectall-connections:after,#wpadminbar .syncing #distributor-push-wrapper .action-wrapper .selectno-connections:after,#wpadminbar .syncing #distributor-push-wrapper .action-wrapper .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:3px solid #cfcfcf;border-left-color:#00aef2;-webkit-transform:translateZ(0);transform:translateZ(0);-webkit-animation:load8 1.1s linear infinite;animation:load8 1.1s linear infinite;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}#wpadminbar #distributor-push-wrapper .messages ul.details{padding-left:1.5rem}#wpadminbar #distributor-push-wrapper .messages ul.details li{list-style:disc}#distributor-push-wrapper .loader-item{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;overflow:hidden}#distributor-push-wrapper.message-error .loader-item{display:none}@media (min-width:480px){#wpadminbar #distributor-push-wrapper .loader-messages{width:100%;float:none;padding-left:0}}#distributor-push-wrapper .loader-item,#distributor-push-wrapper .loader-item *,#distributor-push-wrapper .loader-item :after,#distributor-push-wrapper .loader-item :before{-webkit-box-sizing:border-box;box-sizing:border-box}#distributor-push-wrapper .loader-item:before{content:\" \";position:absolute;top:0;right:0;bottom:0;left:50%;z-index:1;width:349%;margin-left:-250%;-webkit-animation:loaderAnimation .8s linear infinite;animation:loaderAnimation .8s linear infinite;background:-webkit-gradient(linear,left top,right top,color-stop(46%,hsla(0,0%,100%,0)),color-stop(50%,hsla(0,0%,100%,.35)),color-stop(54%,hsla(0,0%,100%,0))) 50% 50%;background:linear-gradient(90deg,hsla(0,0%,100%,0) 46%,hsla(0,0%,100%,.35) 50%,hsla(0,0%,100%,0) 54%) 50% 50%}#distributor-push-wrapper .loader-item>*{-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-flow:column;flex-flow:column}#distributor-push-wrapper .loader-row{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap}#distributor-push-wrapper .loader-row.border{border:1px solid #555}#distributor-push-wrapper .loader-row div{height:15px}#distributor-push-wrapper .loader-row .big,#distributor-push-wrapper .loader-row.big div{height:30px}#distributor-push-wrapper .loader-row .odd{background-color:#23282d}#distributor-push-wrapper .loader-row .bottom{margin-bottom:15px}#distributor-push-wrapper .loader-col-4{-webkit-box-flex:0;-ms-flex:0 0 30%;flex:0 0 30%;padding-left:3em}#distributor-push-wrapper .loader-col-8{-webkit-box-flex:0;-ms-flex:0 0 60%;flex:0 0 60%}#distributor-push-wrapper .loader-col-12{-webkit-box-flex:0;-ms-flex:0 0 100%;flex:0 0 100%}@-webkit-keyframes load8{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes load8{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@-webkit-keyframes loaderAnimation{0%{-webkit-transform:translate3d(-30%,0,0);transform:translate3d(-30%,0,0)}to{-webkit-transform:translate3d(30%,0,0);transform:translate3d(30%,0,0)}}@keyframes loaderAnimation{0%{-webkit-transform:translate3d(-30%,0,0);transform:translate3d(-30%,0,0)}to{-webkit-transform:translate3d(30%,0,0);transform:translate3d(30%,0,0)}}"],"file":"push.min.css"} \ No newline at end of file diff --git a/dist/js/admin-distributed-post.min.js b/dist/js/admin-distributed-post.min.js index dc85a5162..fe34e1d6f 100644 --- a/dist/js/admin-distributed-post.min.js +++ b/dist/js/admin-distributed-post.min.js @@ -1,2 +1,2 @@ -!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=11)}({1:function(e,t){e.exports=jQuery},11:function(e,t,n){"use strict";n.r(t);for(var r=n(1),o=n.n(r),u=document.querySelectorAll(".open-distributor-help"),i=document.getElementById("contextual-help-link"),l=document.querySelector("#tab-link-distributer a"),c=0;c {\n\t\thelpLink.click();\n\t\tdistributorTab.click();\n\t} );\n}\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"jQuery\"","webpack:///./assets/js/admin-distributed-post.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","jQuery","openLinks","document","querySelectorAll","helpLink","getElementById","distributorTab","querySelector","length","on","click"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAAS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MA,IANA,oBAEMC,EAAiBC,SAASC,iBAAkB,0BAC5CC,EAAiBF,SAASG,eAAgB,wBAC1CC,EAAiBJ,SAASK,cAAe,2BAErCvC,EAAI,EAAGA,EAAIiC,EAAUO,OAAQxC,IACtCgC,IAAQC,EAAUjC,IAAKyC,GAAI,SAAS,WACnCL,EAASM,QACTJ,EAAeI","file":"admin-distributed-post.min.js","sourcesContent":[" \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, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\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\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 12);\n","module.exports = jQuery;","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"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/js/admin-external-connection.min.js b/dist/js/admin-external-connection.min.js index 68614e0cd..f9a5c417e 100644 --- a/dist/js/admin-external-connection.min.js +++ b/dist/js/admin-external-connection.min.js @@ -1,2 +1,2 @@ -!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=15)}([function(e,t){e.exports=window},function(e,t){e.exports=jQuery},function(e,t){e.exports=_},function(e,t){e.exports=wp},function(e,t,r){"use strict";var n=Object.prototype.hasOwnProperty,o=Array.isArray,i=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),a=function(e,t){for(var r=t&&t.plainObjects?Object.create(null):{},n=0;n1;){var t=e.pop(),r=t.obj[t.prop];if(o(r)){for(var n=[],i=0;i=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122?o+=n.charAt(a):c<128?o+=i[c]:c<2048?o+=i[192|c>>6]+i[128|63&c]:c<55296||c>=57344?o+=i[224|c>>12]+i[128|c>>6&63]+i[128|63&c]:(a+=1,c=65536+((1023&c)<<10|1023&n.charCodeAt(a)),o+=i[240|c>>18]+i[128|c>>12&63]+i[128|c>>6&63]+i[128|63&c])}return o},isBuffer:function(e){return!(!e||"object"!=typeof e)&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},merge:function e(t,r,i){if(!r)return t;if("object"!=typeof r){if(o(t))t.push(r);else{if(!t||"object"!=typeof t)return[t,r];(i&&(i.plainObjects||i.allowPrototypes)||!n.call(Object.prototype,r))&&(t[r]=!0)}return t}if(!t||"object"!=typeof t)return[t].concat(r);var c=t;return o(t)&&!o(r)&&(c=a(t,i)),o(t)&&o(r)?(r.forEach((function(r,o){if(n.call(t,o)){var a=t[o];a&&"object"==typeof a&&r&&"object"==typeof r?t[o]=e(a,r,i):t.push(r)}else t[o]=r})),t):Object.keys(r).reduce((function(t,o){var a=r[o];return n.call(t,o)?t[o]=e(t[o],a,i):t[o]=a,t}),c)}}},function(e,t,r){"use strict";var n=r(8),o=r(9),i=r(6);e.exports={formats:i,parse:o,stringify:n}},function(e,t,r){"use strict";var n=String.prototype.replace,o=/%20/g,i=r(4),a={RFC1738:"RFC1738",RFC3986:"RFC3986"};e.exports=i.assign({default:a.RFC3986,formatters:{RFC1738:function(e){return n.call(e,o,"+")},RFC3986:function(e){return String(e)}}},a)},function(e,t,r){var n,o,i;o=[],void 0===(i="function"==typeof(n=function(){var e=/^v?(?:\d+)(\.(?:[x*]|\d+)(\.(?:[x*]|\d+)(\.(?:[x*]|\d+))?(?:-[\da-z\-]+(?:\.[\da-z\-]+)*)?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i;function t(e){var t,r,n=e.replace(/^v/,"").replace(/\+.*$/,""),o=(r="-",-1===(t=n).indexOf(r)?t.length:t.indexOf(r)),i=n.substring(0,o).split(".");return i.push(n.substring(o+1)),i}function r(e){return isNaN(Number(e))?e:Number(e)}function n(t){if("string"!=typeof t)throw new TypeError("Invalid argument expected string");if(!e.test(t))throw new Error("Invalid argument not valid semver ('"+t+"' received)")}function o(e,o){[e,o].forEach(n);for(var i=t(e),a=t(o),c=0;cu)return 1;if(u>l)return-1}var s=i[i.length-1],d=a[a.length-1];if(s&&d){var f=s.split(".").map(r),p=d.split(".").map(r);for(c=0;cp[c])return 1;if(p[c]>f[c])return-1}}else if(s||d)return s?-1:1;return 0}var i=[">",">=","=","<","<="],a={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1]};return o.validate=function(t){return"string"==typeof t&&e.test(t)},o.compare=function(e,t,r){!function(e){if("string"!=typeof e)throw new TypeError("Invalid operator type, expected string but got "+typeof e);if(-1===i.indexOf(e))throw new TypeError("Invalid operator, expected one of "+i.join("|"))}(r);var n=o(e,t);return a[r].indexOf(n)>-1},o})?n.apply(t,o):n)||(e.exports=i)},function(e,t,r){"use strict";var n=r(4),o=r(6),i=Object.prototype.hasOwnProperty,a={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},c=Array.isArray,l=Array.prototype.push,u=function(e,t){l.apply(e,c(t)?t:[t])},s=Date.prototype.toISOString,d=o.default,f={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:n.encode,encodeValuesOnly:!1,format:d,formatter:o.formatters[d],indices:!1,serializeDate:function(e){return s.call(e)},skipNulls:!1,strictNullHandling:!1},p=function e(t,r,o,i,a,l,s,d,p,m,y,g,v){var h,b=t;if("function"==typeof s?b=s(r,b):b instanceof Date?b=m(b):"comma"===o&&c(b)&&(b=b.join(",")),null===b){if(i)return l&&!g?l(r,f.encoder,v,"key"):r;b=""}if("string"==typeof(h=b)||"number"==typeof h||"boolean"==typeof h||"symbol"==typeof h||"bigint"==typeof h||n.isBuffer(b))return l?[y(g?r:l(r,f.encoder,v,"key"))+"="+y(l(b,f.encoder,v,"value"))]:[y(r)+"="+y(String(b))];var x,_=[];if(void 0===b)return _;if(c(s))x=s;else{var w=Object.keys(b);x=d?w.sort(d):w}for(var j=0;j0?h+v:""}},function(e,t,r){"use strict";var n=r(4),o=Object.prototype.hasOwnProperty,i={allowDots:!1,allowPrototypes:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:n.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},a=function(e){return e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(parseInt(t,10))}))},c=function(e,t,r){if(e){var n=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,i=/(\[[^[\]]*])/g,a=r.depth>0&&/(\[[^[\]]*])/.exec(n),c=a?n.slice(0,a.index):n,l=[];if(c){if(!r.plainObjects&&o.call(Object.prototype,c)&&!r.allowPrototypes)return;l.push(c)}for(var u=0;r.depth>0&&null!==(a=i.exec(n))&&u=0;--o){var i,a=e[o];if("[]"===a&&r.parseArrays)i=[].concat(n);else{i=r.plainObjects?Object.create(null):{};var c="["===a.charAt(0)&&"]"===a.charAt(a.length-1)?a.slice(1,-1):a,l=parseInt(c,10);r.parseArrays||""!==c?!isNaN(l)&&a!==c&&String(l)===c&&l>=0&&r.parseArrays&&l<=r.arrayLimit?(i=[])[l]=n:i[c]=n:i={0:n}}n=i}return n}(l,t,r)}};e.exports=function(e,t){var r=function(e){if(!e)return i;if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new Error("The charset option must be either utf-8, iso-8859-1, or undefined");var t=void 0===e.charset?i.charset:e.charset;return{allowDots:void 0===e.allowDots?i.allowDots:!!e.allowDots,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:i.allowPrototypes,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:i.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:i.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:i.comma,decoder:"function"==typeof e.decoder?e.decoder:i.decoder,delimiter:"string"==typeof e.delimiter||n.isRegExp(e.delimiter)?e.delimiter:i.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:i.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:i.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:i.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:i.plainObjects,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:i.strictNullHandling}}(t);if(""===e||null==e)return r.plainObjects?Object.create(null):{};for(var l="string"==typeof e?function(e,t){var r,c={},l=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,u=t.parameterLimit===1/0?void 0:t.parameterLimit,s=l.split(t.delimiter,u),d=-1,f=t.charset;if(t.charsetSentinel)for(r=0;r-1&&(m=m.split(",")),o.call(c,p)?c[p]=n.combine(c[p],m):c[p]=m}return c}(e,r):e,u=r.plainObjects?Object.create(null):{},s=Object.keys(l),d=0;d0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;if(!t||!Object.keys(t).length)return e;var r=e,n=e.indexOf("?");return-1!==n&&(t=Object.assign(Object(d.parse)(e.substr(n+1)),t),r=r.substr(0,n)),r+"?"+Object(d.stringify)(t)}var p=r(7),m=r.n(p),y=r(3),g=r.n(y);function v(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var a,c=e[Symbol.iterator]();!(n=(a=c.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==c.return||c.return()}finally{if(o)throw i}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return h(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return h(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1;){var t=e.pop(),r=t.obj[t.prop];if(o(r)){for(var n=[],a=0;a=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122?o+=n.charAt(i):c<128?o+=a[c]:c<2048?o+=a[192|c>>6]+a[128|63&c]:c<55296||c>=57344?o+=a[224|c>>12]+a[128|c>>6&63]+a[128|63&c]:(i+=1,c=65536+((1023&c)<<10|1023&n.charCodeAt(i)),o+=a[240|c>>18]+a[128|c>>12&63]+a[128|c>>6&63]+a[128|63&c])}return o},isBuffer:function(e){return!(!e||"object"!=typeof e)&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},merge:function e(t,r,a){if(!r)return t;if("object"!=typeof r){if(o(t))t.push(r);else{if(!t||"object"!=typeof t)return[t,r];(a&&(a.plainObjects||a.allowPrototypes)||!n.call(Object.prototype,r))&&(t[r]=!0)}return t}if(!t||"object"!=typeof t)return[t].concat(r);var c=t;return o(t)&&!o(r)&&(c=i(t,a)),o(t)&&o(r)?(r.forEach((function(r,o){if(n.call(t,o)){var i=t[o];i&&"object"==typeof i&&r&&"object"==typeof r?t[o]=e(i,r,a):t.push(r)}else t[o]=r})),t):Object.keys(r).reduce((function(t,o){var i=r[o];return n.call(t,o)?t[o]=e(t[o],i,a):t[o]=i,t}),c)}}},function(e,t,r){"use strict";var n=r(9),o=r(10),a=r(7);e.exports={formats:a,parse:o,stringify:n}},function(e,t,r){"use strict";var n=String.prototype.replace,o=/%20/g,a=r(5),i={RFC1738:"RFC1738",RFC3986:"RFC3986"};e.exports=a.assign({default:i.RFC3986,formatters:{RFC1738:function(e){return n.call(e,o,"+")},RFC3986:function(e){return String(e)}}},i)},function(e,t,r){var n,o,a;o=[],void 0===(a="function"==typeof(n=function(){var e=/^v?(?:\d+)(\.(?:[x*]|\d+)(\.(?:[x*]|\d+)(\.(?:[x*]|\d+))?(?:-[\da-z\-]+(?:\.[\da-z\-]+)*)?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i;function t(e){var t,r,n=e.replace(/^v/,"").replace(/\+.*$/,""),o=(r="-",-1===(t=n).indexOf(r)?t.length:t.indexOf(r)),a=n.substring(0,o).split(".");return a.push(n.substring(o+1)),a}function r(e){return isNaN(Number(e))?e:Number(e)}function n(t){if("string"!=typeof t)throw new TypeError("Invalid argument expected string");if(!e.test(t))throw new Error("Invalid argument not valid semver ('"+t+"' received)")}function o(e,o){[e,o].forEach(n);for(var a=t(e),i=t(o),c=0;cu)return 1;if(u>l)return-1}var s=a[a.length-1],d=i[i.length-1];if(s&&d){var p=s.split(".").map(r),f=d.split(".").map(r);for(c=0;cf[c])return 1;if(f[c]>p[c])return-1}}else if(s||d)return s?-1:1;return 0}var a=[">",">=","=","<","<="],i={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1]};return o.validate=function(t){return"string"==typeof t&&e.test(t)},o.compare=function(e,t,r){!function(e){if("string"!=typeof e)throw new TypeError("Invalid operator type, expected string but got "+typeof e);if(-1===a.indexOf(e))throw new TypeError("Invalid operator, expected one of "+a.join("|"))}(r);var n=o(e,t);return i[r].indexOf(n)>-1},o})?n.apply(t,o):n)||(e.exports=a)},function(e,t,r){"use strict";var n=r(5),o=r(7),a=Object.prototype.hasOwnProperty,i={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},c=Array.isArray,l=Array.prototype.push,u=function(e,t){l.apply(e,c(t)?t:[t])},s=Date.prototype.toISOString,d=o.default,p={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:n.encode,encodeValuesOnly:!1,format:d,formatter:o.formatters[d],indices:!1,serializeDate:function(e){return s.call(e)},skipNulls:!1,strictNullHandling:!1},f=function e(t,r,o,a,i,l,s,d,f,y,m,h,g){var v,b=t;if("function"==typeof s?b=s(r,b):b instanceof Date?b=y(b):"comma"===o&&c(b)&&(b=b.join(",")),null===b){if(a)return l&&!h?l(r,p.encoder,g,"key"):r;b=""}if("string"==typeof(v=b)||"number"==typeof v||"boolean"==typeof v||"symbol"==typeof v||"bigint"==typeof v||n.isBuffer(b))return l?[m(h?r:l(r,p.encoder,g,"key"))+"="+m(l(b,p.encoder,g,"value"))]:[m(r)+"="+m(String(b))];var x,_=[];if(void 0===b)return _;if(c(s))x=s;else{var w=Object.keys(b);x=d?w.sort(d):w}for(var j=0;j0?v+g:""}},function(e,t,r){"use strict";var n=r(5),o=Object.prototype.hasOwnProperty,a={allowDots:!1,allowPrototypes:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:n.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},i=function(e){return e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(parseInt(t,10))}))},c=function(e,t,r){if(e){var n=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,a=/(\[[^[\]]*])/g,i=r.depth>0&&/(\[[^[\]]*])/.exec(n),c=i?n.slice(0,i.index):n,l=[];if(c){if(!r.plainObjects&&o.call(Object.prototype,c)&&!r.allowPrototypes)return;l.push(c)}for(var u=0;r.depth>0&&null!==(i=a.exec(n))&&u=0;--o){var a,i=e[o];if("[]"===i&&r.parseArrays)a=[].concat(n);else{a=r.plainObjects?Object.create(null):{};var c="["===i.charAt(0)&&"]"===i.charAt(i.length-1)?i.slice(1,-1):i,l=parseInt(c,10);r.parseArrays||""!==c?!isNaN(l)&&i!==c&&String(l)===c&&l>=0&&r.parseArrays&&l<=r.arrayLimit?(a=[])[l]=n:a[c]=n:a={0:n}}n=a}return n}(l,t,r)}};e.exports=function(e,t){var r=function(e){if(!e)return a;if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new Error("The charset option must be either utf-8, iso-8859-1, or undefined");var t=void 0===e.charset?a.charset:e.charset;return{allowDots:void 0===e.allowDots?a.allowDots:!!e.allowDots,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:a.allowPrototypes,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:a.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:a.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:a.comma,decoder:"function"==typeof e.decoder?e.decoder:a.decoder,delimiter:"string"==typeof e.delimiter||n.isRegExp(e.delimiter)?e.delimiter:a.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:a.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:a.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:a.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:a.plainObjects,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:a.strictNullHandling}}(t);if(""===e||null==e)return r.plainObjects?Object.create(null):{};for(var l="string"==typeof e?function(e,t){var r,c={},l=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,u=t.parameterLimit===1/0?void 0:t.parameterLimit,s=l.split(t.delimiter,u),d=-1,p=t.charset;if(t.charsetSentinel)for(r=0;r-1&&(y=y.split(",")),o.call(c,f)?c[f]=n.combine(c[f],y):c[f]=y}return c}(e,r):e,u=r.plainObjects?Object.create(null):{},s=Object.keys(l),d=0;d0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;if(!t||!Object.keys(t).length)return e;var r=e,n=e.indexOf("?");return-1!==n&&(t=Object.assign(Object(d.parse)(e.substr(n+1)),t),r=r.substr(0,n)),r+"?"+Object(d.stringify)(t)}var f=r(8),y=r.n(f),m=r(3),h=r.n(m);function g(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,o=!1,a=void 0;try{for(var i,c=e[Symbol.iterator]();!(n=(i=c.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){o=!0,a=e}finally{try{n||null==c.return||c.return()}finally{if(o)throw a}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return v(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return v(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r"),e.data.forEach((function(e){o()(T[0]).append("".concat(e.message," ").concat(e.code?"(".concat(e.code,")"):"","
"))})))));var t=e.data.version.replace(/-dev/,"");if(y.a.compare(t,"1.6.0","<"))o()(T[0]).text(c.dt.minversion);else{var r=p(document.location.href,{setupStatus:"success",titleField:E.value,externalSiteUrlField:n,restRoot:e.data.rest_url}),a=p(document.location.href,{setupStatus:"failure"}),i=p("".concat(n,"wp-admin/admin.php"),{page:"auth_app",app_name:c.dt.distributor_from,success_url:encodeURI(r),reject_url:encodeURI(a)});document.location=i}})),!1):(o()(T[0]).text(c.dt.invalid_url),!1)})),o()(L).on("click",(function(e){e.preventDefault(),o()(".external-connection-wizard").hide(),o()(".external-connection-setup, .hide-until-authed").show()})),setTimeout((function(){var e=c.dt.wizard_return;e&&(""===E.value&&(o()(E).val(e.titleField).focus().blur(),o()(R).empty()),o()($).val(e.user_login),o()(U).val(e.password),o()(x).val(e.restRoot),A.className="wizard-return",I.click()),Q()}),300),o()(_).on("click",".suggest",(function(e){x.value=e.currentTarget.innerText,o()(x).trigger("input")})),o()(x).on("focus click",(function(e){e.target.setAttribute("initial-url",e.target.value)})),o()(x).on("keyup input",i.a.debounce((function(){x.value.replace(/\/$/,"")!==x.getAttribute("initial-url").replace(/\/$/,"")&&(x.setAttribute("initial-url",x.value),Q())}),250)),o()(x).on("blur",(function(e){""===E.value&&""!==e.currentTarget.value&&(E.value=e.currentTarget.value.replace(/https?:\/\//i,""),E.focus(),E.blur())}));var U=document.getElementById("dt_password"),$=document.getElementById("dt_username"),M=document.querySelector(".change-password");o()($).on("focus click",(function(e){e.target.setAttribute("initial-username",e.target.value)})),o()($).on("keyup input",i.a.debounce((function(){$.getAttribute("initial-username")!==$.value&&M&&(U.disabled=!1,U.value="",M.style.display="none")}),250)),o()(U).on("keyup input",i.a.debounce((function(){Q()}),250)),o()(M).on("click",(function(e){e.preventDefault(),U.disabled?(U.disabled=!1,U.value="",e.currentTarget.innerText=c.dt.cancel):(U.disabled=!0,U.value="sdfdsfsdfdsfdsfsd",e.currentTarget.innerText=c.dt.change),Q()})),o()(O).on("click",".dt-role-checkbox",(function(e){e.target.classList.contains("dt-role-checkbox")&&e.target.checked&&"administrator"!==e.target.value&&"editor"!==e.target.value&&alert(c.dt.roles_warning)}));var q=o()(".hide-until-authed"),V=o()(document.getElementById("dt_client_secret")),G=o()(document.getElementById("dt_client_id")),J=function(){0===document.getElementsByClassName("oauth-connection-established").length&&q.hide()},K=function(e,t){return""===e.val()?(t.preventDefault(),e.addClass("error-required"),!1):(e.removeClass("error-required"),!0)};o()(w).on("change",(function(){var e=w.value;A.className=e})),"wpdotcom"===w.value&&J(),z&&o()(z).on("click",(function(e){var t=K(V,e),r=K(G,e);if(!t||!r)return e.preventDefault(),!1}));var W=document.getElementById("oauth-authentication-change-credentials"),X=o()(".oauth-authentication-details-wrapper");W&&o()(W).on("click",(function(){X.show(),V.val(""),o()(".oauth-connection-established").remove(),J()}));var Y=document.getElementById("begin-authorization");function Z(e){return null===e.offsetParent}Y&&o()(Y).on("click",(function(e){var t=o()(E),r=t.val();K(t,e)&&(o()(Y).addClass("disabled"),t.removeClass("error-required"),o.a.ajax({url:c.ajaxurl,method:"post",data:{nonce:c.dt.nonce,action:"dt_begin_authorization",title:r,id:o()(document.getElementById("post_ID")).val()}}).done((function(e){if(e.success&&e.data.id){var t="".concat(c.dt.admin_url,"post.php?post=").concat(e.data.id,"&action=edit");history.pushState({},"Oauth Authorize Details",t),o()(document.getElementById("dt_redirect_uri")).val(t),o()(document.getElementById("dt_created_post_id")).val(e.data.id),o()(document.getElementById("original_post_status")).val("publish"),o()(".oauth-begin-authentication-wrapper").hide(),X.show()}})).complete((function(){o()(Y).removeClass("disabled")})))}))}]); //# sourceMappingURL=admin-external-connection.min.js.map \ 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 8a491ebf3..abfad6996 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:///webpack/bootstrap","webpack:///external \"window\"","webpack:///external \"jQuery\"","webpack:///external \"_\"","webpack:///external \"wp\"","webpack:///./node_modules/qs/lib/utils.js","webpack:///./node_modules/qs/lib/index.js","webpack:///./node_modules/qs/lib/formats.js","webpack:///./node_modules/compare-versions/index.js","webpack:///./node_modules/qs/lib/stringify.js","webpack:///./node_modules/qs/lib/parse.js","webpack:///@wordpress/url/src/is-email.js","webpack:///@wordpress/url/src/prepend-http.js","webpack:///@wordpress/url/src/add-query-args.js","webpack:///./assets/js/admin-external-connection.js","webpack:///@wordpress/url/src/is-url.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","window","jQuery","_","wp","has","isArray","Array","hexTable","array","push","toString","toUpperCase","arrayToObject","source","options","obj","plainObjects","length","assign","target","keys","reduce","acc","combine","a","b","concat","compact","queue","prop","refs","item","j","val","indexOf","pop","compacted","compactQueue","decode","str","decoder","charset","strWithoutPlus","replace","unescape","decodeURIComponent","e","encode","defaultEncoder","string","String","escape","$0","parseInt","slice","out","charCodeAt","charAt","isBuffer","constructor","isRegExp","merge","allowPrototypes","mergeTarget","forEach","targetItem","stringify","require","parse","formats","percentTwenties","util","Format","RFC1738","RFC3986","formatters","define","semver","split","v","q","patchIndex","arr","substring","tryParse","isNaN","Number","validate","version","TypeError","test","Error","compareVersions","v1","v2","s1","s2","Math","max","n1","n2","sp1","sp2","p1","map","p2","undefined","allowedOperators","operatorResMap","compare","operator","op","join","validateOperator","res","utils","arrayPrefixGenerators","brackets","prefix","comma","indices","repeat","pushToArray","valueOrArray","apply","toISO","Date","toISOString","defaultFormat","defaults","addQueryPrefix","allowDots","charsetSentinel","delimiter","encoder","encodeValuesOnly","format","formatter","serializeDate","date","skipNulls","strictNullHandling","generateArrayPrefix","filter","sort","objKeys","values","opts","normalizeStringifyOptions","arrayFormat","joined","arrayLimit","depth","ignoreQueryPrefix","interpretNumericEntities","parameterLimit","parseArrays","numberStr","fromCharCode","parseKeys","givenKey","child","segment","exec","parent","index","chain","leaf","root","cleanRoot","0","parseObject","normalizeParseOptions","tempObj","cleanStr","limit","Infinity","parts","skipIndex","part","bracketEqualsPos","pos","parseValues","newObj","EMAIL_REGEXP","USABLE_HREF_REGEXP","prependHTTP","url","addQueryArgs","args","baseUrl","queryStringIndex","body","document","getElementsByTagName","externalConnectionUrlField","getElementById","externalConnectionMetaBox","externalConnectionTypeField","authFields","getElementsByClassName","rolesAllowed","titleField","endpointResult","querySelector","endpointErrors","postIdField","createConnection","wpbody","externalSiteUrlField","wizardError","wizardStatus","authorizeConnectionButton","beginOauthConnectionButton","createOauthConnectionButton","manualSetupButton","titlePrompt","slug","$apiVerify","checkConnections","abort","innerText","removeAttribute","setAttribute","dt","endpoint_checking_message","auth","each","authField","disabled","getAttribute","postId","ajax","ajaxurl","method","data","nonce","action","type","endpointId","done","response","success","errors","no_external_connection","endpoint_suggestion","suggestion","createElement","classList","add","appendChild","a11y","speak","bad_connection","no_distributor","can_post","limited_connection","warnings","bad_auth","no_push","pull_limited","warning","warningNode","append","good_connection","complete","remove","className","on","event","which","contains","trigger","isHidden","preventDefault","text","validateTitle","validateField","validateURL","siteURL","isURL","style","display","minversion","successURL","location","href","setupStatus","restRoot","rest_url","failureURL","authURL","page","app_name","distributor_from","success_url","encodeURI","reject_url","noconnection","invalid_url","hide","show","setTimeout","wizard_return","focus","blur","empty","usernameField","user_login","passwordField","password","click","currentTarget","debounce","changePassword","cancel","change","checked","alert","roles_warning","$hideUntilAuthed","$clientSecret","$clientId","hideItemsRequiringAuth","$field","addClass","removeClass","validateClientSecret","validateClientId","changeCredentials","$authenticationDetailsWrapper","beginAuthorize","el","offsetParent","$titleEl","title","id","admin_url","history","pushState"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/B,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\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, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\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\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 15);\n","module.exports = window;","module.exports = jQuery;","module.exports = _;","module.exports = wp;","'use strict';\n\nvar has = Object.prototype.hasOwnProperty;\nvar isArray = Array.isArray;\n\nvar hexTable = (function () {\n var array = [];\n for (var i = 0; i < 256; ++i) {\n array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());\n }\n\n return array;\n}());\n\nvar compactQueue = function compactQueue(queue) {\n while (queue.length > 1) {\n var item = queue.pop();\n var obj = item.obj[item.prop];\n\n if (isArray(obj)) {\n var compacted = [];\n\n for (var j = 0; j < obj.length; ++j) {\n if (typeof obj[j] !== 'undefined') {\n compacted.push(obj[j]);\n }\n }\n\n item.obj[item.prop] = compacted;\n }\n }\n};\n\nvar arrayToObject = function arrayToObject(source, options) {\n var obj = options && options.plainObjects ? Object.create(null) : {};\n for (var i = 0; i < source.length; ++i) {\n if (typeof source[i] !== 'undefined') {\n obj[i] = source[i];\n }\n }\n\n return obj;\n};\n\nvar merge = function merge(target, source, options) {\n if (!source) {\n return target;\n }\n\n if (typeof source !== 'object') {\n if (isArray(target)) {\n target.push(source);\n } else if (target && typeof target === 'object') {\n if ((options && (options.plainObjects || options.allowPrototypes)) || !has.call(Object.prototype, source)) {\n target[source] = true;\n }\n } else {\n return [target, source];\n }\n\n return target;\n }\n\n if (!target || typeof target !== 'object') {\n return [target].concat(source);\n }\n\n var mergeTarget = target;\n if (isArray(target) && !isArray(source)) {\n mergeTarget = arrayToObject(target, options);\n }\n\n if (isArray(target) && isArray(source)) {\n source.forEach(function (item, i) {\n if (has.call(target, i)) {\n var targetItem = target[i];\n if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') {\n target[i] = merge(targetItem, item, options);\n } else {\n target.push(item);\n }\n } else {\n target[i] = item;\n }\n });\n return target;\n }\n\n return Object.keys(source).reduce(function (acc, key) {\n var value = source[key];\n\n if (has.call(acc, key)) {\n acc[key] = merge(acc[key], value, options);\n } else {\n acc[key] = value;\n }\n return acc;\n }, mergeTarget);\n};\n\nvar assign = function assignSingleSource(target, source) {\n return Object.keys(source).reduce(function (acc, key) {\n acc[key] = source[key];\n return acc;\n }, target);\n};\n\nvar decode = function (str, decoder, charset) {\n var strWithoutPlus = str.replace(/\\+/g, ' ');\n if (charset === 'iso-8859-1') {\n // unescape never throws, no try...catch needed:\n return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);\n }\n // utf-8\n try {\n return decodeURIComponent(strWithoutPlus);\n } catch (e) {\n return strWithoutPlus;\n }\n};\n\nvar encode = function encode(str, defaultEncoder, charset) {\n // This code was originally written by Brian White (mscdex) for the io.js core querystring library.\n // It has been adapted here for stricter adherence to RFC 3986\n if (str.length === 0) {\n return str;\n }\n\n var string = str;\n if (typeof str === 'symbol') {\n string = Symbol.prototype.toString.call(str);\n } else if (typeof str !== 'string') {\n string = String(str);\n }\n\n if (charset === 'iso-8859-1') {\n return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) {\n return '%26%23' + parseInt($0.slice(2), 16) + '%3B';\n });\n }\n\n var out = '';\n for (var i = 0; i < string.length; ++i) {\n var c = string.charCodeAt(i);\n\n if (\n c === 0x2D // -\n || c === 0x2E // .\n || c === 0x5F // _\n || c === 0x7E // ~\n || (c >= 0x30 && c <= 0x39) // 0-9\n || (c >= 0x41 && c <= 0x5A) // a-z\n || (c >= 0x61 && c <= 0x7A) // A-Z\n ) {\n out += string.charAt(i);\n continue;\n }\n\n if (c < 0x80) {\n out = out + hexTable[c];\n continue;\n }\n\n if (c < 0x800) {\n out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]);\n continue;\n }\n\n if (c < 0xD800 || c >= 0xE000) {\n out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);\n continue;\n }\n\n i += 1;\n c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));\n out += hexTable[0xF0 | (c >> 18)]\n + hexTable[0x80 | ((c >> 12) & 0x3F)]\n + hexTable[0x80 | ((c >> 6) & 0x3F)]\n + hexTable[0x80 | (c & 0x3F)];\n }\n\n return out;\n};\n\nvar compact = function compact(value) {\n var queue = [{ obj: { o: value }, prop: 'o' }];\n var refs = [];\n\n for (var i = 0; i < queue.length; ++i) {\n var item = queue[i];\n var obj = item.obj[item.prop];\n\n var keys = Object.keys(obj);\n for (var j = 0; j < keys.length; ++j) {\n var key = keys[j];\n var val = obj[key];\n if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {\n queue.push({ obj: obj, prop: key });\n refs.push(val);\n }\n }\n }\n\n compactQueue(queue);\n\n return value;\n};\n\nvar isRegExp = function isRegExp(obj) {\n return Object.prototype.toString.call(obj) === '[object RegExp]';\n};\n\nvar isBuffer = function isBuffer(obj) {\n if (!obj || typeof obj !== 'object') {\n return false;\n }\n\n return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));\n};\n\nvar combine = function combine(a, b) {\n return [].concat(a, b);\n};\n\nmodule.exports = {\n arrayToObject: arrayToObject,\n assign: assign,\n combine: combine,\n compact: compact,\n decode: decode,\n encode: encode,\n isBuffer: isBuffer,\n isRegExp: isRegExp,\n merge: merge\n};\n","'use strict';\n\nvar stringify = require('./stringify');\nvar parse = require('./parse');\nvar formats = require('./formats');\n\nmodule.exports = {\n formats: formats,\n parse: parse,\n stringify: stringify\n};\n","'use strict';\n\nvar replace = String.prototype.replace;\nvar percentTwenties = /%20/g;\n\nvar util = require('./utils');\n\nvar Format = {\n RFC1738: 'RFC1738',\n RFC3986: 'RFC3986'\n};\n\nmodule.exports = util.assign(\n {\n 'default': Format.RFC3986,\n formatters: {\n RFC1738: function (value) {\n return replace.call(value, percentTwenties, '+');\n },\n RFC3986: function (value) {\n return String(value);\n }\n }\n },\n Format\n);\n","/* global define */\n(function (root, factory) {\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define([], factory);\n } else if (typeof exports === 'object') {\n module.exports = factory();\n } else {\n root.compareVersions = factory();\n }\n}(this, function () {\n\n var semver = /^v?(?:\\d+)(\\.(?:[x*]|\\d+)(\\.(?:[x*]|\\d+)(\\.(?:[x*]|\\d+))?(?:-[\\da-z\\-]+(?:\\.[\\da-z\\-]+)*)?(?:\\+[\\da-z\\-]+(?:\\.[\\da-z\\-]+)*)?)?)?$/i;\n\n function indexOrEnd(str, q) {\n return str.indexOf(q) === -1 ? str.length : str.indexOf(q);\n }\n\n function split(v) {\n var c = v.replace(/^v/, '').replace(/\\+.*$/, '');\n var patchIndex = indexOrEnd(c, '-');\n var arr = c.substring(0, patchIndex).split('.');\n arr.push(c.substring(patchIndex + 1));\n return arr;\n }\n\n function tryParse(v) {\n return isNaN(Number(v)) ? v : Number(v);\n }\n\n function validate(version) {\n if (typeof version !== 'string') {\n throw new TypeError('Invalid argument expected string');\n }\n if (!semver.test(version)) {\n throw new Error('Invalid argument not valid semver (\\''+version+'\\' received)');\n }\n }\n\n function compareVersions(v1, v2) {\n [v1, v2].forEach(validate);\n\n var s1 = split(v1);\n var s2 = split(v2);\n\n for (var i = 0; i < Math.max(s1.length - 1, s2.length - 1); i++) {\n var n1 = parseInt(s1[i] || 0, 10);\n var n2 = parseInt(s2[i] || 0, 10);\n\n if (n1 > n2) return 1;\n if (n2 > n1) return -1;\n }\n\n var sp1 = s1[s1.length - 1];\n var sp2 = s2[s2.length - 1];\n\n if (sp1 && sp2) {\n var p1 = sp1.split('.').map(tryParse);\n var p2 = sp2.split('.').map(tryParse);\n\n for (i = 0; i < Math.max(p1.length, p2.length); i++) {\n if (p1[i] === undefined || typeof p2[i] === 'string' && typeof p1[i] === 'number') return -1;\n if (p2[i] === undefined || typeof p1[i] === 'string' && typeof p2[i] === 'number') return 1;\n\n if (p1[i] > p2[i]) return 1;\n if (p2[i] > p1[i]) return -1;\n }\n } else if (sp1 || sp2) {\n return sp1 ? -1 : 1;\n }\n\n return 0;\n };\n\n var allowedOperators = [\n '>',\n '>=',\n '=',\n '<',\n '<='\n ];\n\n var operatorResMap = {\n '>': [1],\n '>=': [0, 1],\n '=': [0],\n '<=': [-1, 0],\n '<': [-1]\n };\n\n function validateOperator(op) {\n if (typeof op !== 'string') {\n throw new TypeError('Invalid operator type, expected string but got ' + typeof op);\n }\n if (allowedOperators.indexOf(op) === -1) {\n throw new TypeError('Invalid operator, expected one of ' + allowedOperators.join('|'));\n }\n }\n\n compareVersions.validate = function(version) {\n return typeof version === 'string' && semver.test(version);\n }\n\n compareVersions.compare = function (v1, v2, operator) {\n // Validate operator\n validateOperator(operator);\n\n // since result of compareVersions can only be -1 or 0 or 1\n // a simple map can be used to replace switch\n var res = compareVersions(v1, v2);\n return operatorResMap[operator].indexOf(res) > -1;\n }\n\n return compareVersions;\n}));\n","'use strict';\n\nvar utils = require('./utils');\nvar formats = require('./formats');\nvar has = Object.prototype.hasOwnProperty;\n\nvar arrayPrefixGenerators = {\n brackets: function brackets(prefix) {\n return prefix + '[]';\n },\n comma: 'comma',\n indices: function indices(prefix, key) {\n return prefix + '[' + key + ']';\n },\n repeat: function repeat(prefix) {\n return prefix;\n }\n};\n\nvar isArray = Array.isArray;\nvar push = Array.prototype.push;\nvar pushToArray = function (arr, valueOrArray) {\n push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]);\n};\n\nvar toISO = Date.prototype.toISOString;\n\nvar defaultFormat = formats['default'];\nvar defaults = {\n addQueryPrefix: false,\n allowDots: false,\n charset: 'utf-8',\n charsetSentinel: false,\n delimiter: '&',\n encode: true,\n encoder: utils.encode,\n encodeValuesOnly: false,\n format: defaultFormat,\n formatter: formats.formatters[defaultFormat],\n // deprecated\n indices: false,\n serializeDate: function serializeDate(date) {\n return toISO.call(date);\n },\n skipNulls: false,\n strictNullHandling: false\n};\n\nvar isNonNullishPrimitive = function isNonNullishPrimitive(v) {\n return typeof v === 'string'\n || typeof v === 'number'\n || typeof v === 'boolean'\n || typeof v === 'symbol'\n || typeof v === 'bigint';\n};\n\nvar stringify = function stringify(\n object,\n prefix,\n generateArrayPrefix,\n strictNullHandling,\n skipNulls,\n encoder,\n filter,\n sort,\n allowDots,\n serializeDate,\n formatter,\n encodeValuesOnly,\n charset\n) {\n var obj = object;\n if (typeof filter === 'function') {\n obj = filter(prefix, obj);\n } else if (obj instanceof Date) {\n obj = serializeDate(obj);\n } else if (generateArrayPrefix === 'comma' && isArray(obj)) {\n obj = obj.join(',');\n }\n\n if (obj === null) {\n if (strictNullHandling) {\n return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, 'key') : prefix;\n }\n\n obj = '';\n }\n\n if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) {\n if (encoder) {\n var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key');\n return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value'))];\n }\n return [formatter(prefix) + '=' + formatter(String(obj))];\n }\n\n var values = [];\n\n if (typeof obj === 'undefined') {\n return values;\n }\n\n var objKeys;\n if (isArray(filter)) {\n objKeys = filter;\n } else {\n var keys = Object.keys(obj);\n objKeys = sort ? keys.sort(sort) : keys;\n }\n\n for (var i = 0; i < objKeys.length; ++i) {\n var key = objKeys[i];\n\n if (skipNulls && obj[key] === null) {\n continue;\n }\n\n if (isArray(obj)) {\n pushToArray(values, stringify(\n obj[key],\n typeof generateArrayPrefix === 'function' ? generateArrayPrefix(prefix, key) : prefix,\n generateArrayPrefix,\n strictNullHandling,\n skipNulls,\n encoder,\n filter,\n sort,\n allowDots,\n serializeDate,\n formatter,\n encodeValuesOnly,\n charset\n ));\n } else {\n pushToArray(values, stringify(\n obj[key],\n prefix + (allowDots ? '.' + key : '[' + key + ']'),\n generateArrayPrefix,\n strictNullHandling,\n skipNulls,\n encoder,\n filter,\n sort,\n allowDots,\n serializeDate,\n formatter,\n encodeValuesOnly,\n charset\n ));\n }\n }\n\n return values;\n};\n\nvar normalizeStringifyOptions = function normalizeStringifyOptions(opts) {\n if (!opts) {\n return defaults;\n }\n\n if (opts.encoder !== null && opts.encoder !== undefined && typeof opts.encoder !== 'function') {\n throw new TypeError('Encoder has to be a function.');\n }\n\n var charset = opts.charset || defaults.charset;\n if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {\n throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');\n }\n\n var format = formats['default'];\n if (typeof opts.format !== 'undefined') {\n if (!has.call(formats.formatters, opts.format)) {\n throw new TypeError('Unknown format option provided.');\n }\n format = opts.format;\n }\n var formatter = formats.formatters[format];\n\n var filter = defaults.filter;\n if (typeof opts.filter === 'function' || isArray(opts.filter)) {\n filter = opts.filter;\n }\n\n return {\n addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix,\n allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,\n charset: charset,\n charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,\n delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter,\n encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode,\n encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder,\n encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly,\n filter: filter,\n formatter: formatter,\n serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate,\n skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls,\n sort: typeof opts.sort === 'function' ? opts.sort : null,\n strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling\n };\n};\n\nmodule.exports = function (object, opts) {\n var obj = object;\n var options = normalizeStringifyOptions(opts);\n\n var objKeys;\n var filter;\n\n if (typeof options.filter === 'function') {\n filter = options.filter;\n obj = filter('', obj);\n } else if (isArray(options.filter)) {\n filter = options.filter;\n objKeys = filter;\n }\n\n var keys = [];\n\n if (typeof obj !== 'object' || obj === null) {\n return '';\n }\n\n var arrayFormat;\n if (opts && opts.arrayFormat in arrayPrefixGenerators) {\n arrayFormat = opts.arrayFormat;\n } else if (opts && 'indices' in opts) {\n arrayFormat = opts.indices ? 'indices' : 'repeat';\n } else {\n arrayFormat = 'indices';\n }\n\n var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];\n\n if (!objKeys) {\n objKeys = Object.keys(obj);\n }\n\n if (options.sort) {\n objKeys.sort(options.sort);\n }\n\n for (var i = 0; i < objKeys.length; ++i) {\n var key = objKeys[i];\n\n if (options.skipNulls && obj[key] === null) {\n continue;\n }\n pushToArray(keys, stringify(\n obj[key],\n key,\n generateArrayPrefix,\n options.strictNullHandling,\n options.skipNulls,\n options.encode ? options.encoder : null,\n options.filter,\n options.sort,\n options.allowDots,\n options.serializeDate,\n options.formatter,\n options.encodeValuesOnly,\n options.charset\n ));\n }\n\n var joined = keys.join(options.delimiter);\n var prefix = options.addQueryPrefix === true ? '?' : '';\n\n if (options.charsetSentinel) {\n if (options.charset === 'iso-8859-1') {\n // encodeURIComponent('✓'), the \"numeric entity\" representation of a checkmark\n prefix += 'utf8=%26%2310003%3B&';\n } else {\n // encodeURIComponent('✓')\n prefix += 'utf8=%E2%9C%93&';\n }\n }\n\n return joined.length > 0 ? prefix + joined : '';\n};\n","'use strict';\n\nvar utils = require('./utils');\n\nvar has = Object.prototype.hasOwnProperty;\n\nvar defaults = {\n allowDots: false,\n allowPrototypes: false,\n arrayLimit: 20,\n charset: 'utf-8',\n charsetSentinel: false,\n comma: false,\n decoder: utils.decode,\n delimiter: '&',\n depth: 5,\n ignoreQueryPrefix: false,\n interpretNumericEntities: false,\n parameterLimit: 1000,\n parseArrays: true,\n plainObjects: false,\n strictNullHandling: false\n};\n\nvar interpretNumericEntities = function (str) {\n return str.replace(/&#(\\d+);/g, function ($0, numberStr) {\n return String.fromCharCode(parseInt(numberStr, 10));\n });\n};\n\n// This is what browsers will submit when the ✓ character occurs in an\n// application/x-www-form-urlencoded body and the encoding of the page containing\n// the form is iso-8859-1, or when the submitted form has an accept-charset\n// attribute of iso-8859-1. Presumably also with other charsets that do not contain\n// the ✓ character, such as us-ascii.\nvar isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('✓')\n\n// These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded.\nvar charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')\n\nvar parseValues = function parseQueryStringValues(str, options) {\n var obj = {};\n var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\\?/, '') : str;\n var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;\n var parts = cleanStr.split(options.delimiter, limit);\n var skipIndex = -1; // Keep track of where the utf8 sentinel was found\n var i;\n\n var charset = options.charset;\n if (options.charsetSentinel) {\n for (i = 0; i < parts.length; ++i) {\n if (parts[i].indexOf('utf8=') === 0) {\n if (parts[i] === charsetSentinel) {\n charset = 'utf-8';\n } else if (parts[i] === isoSentinel) {\n charset = 'iso-8859-1';\n }\n skipIndex = i;\n i = parts.length; // The eslint settings do not allow break;\n }\n }\n }\n\n for (i = 0; i < parts.length; ++i) {\n if (i === skipIndex) {\n continue;\n }\n var part = parts[i];\n\n var bracketEqualsPos = part.indexOf(']=');\n var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;\n\n var key, val;\n if (pos === -1) {\n key = options.decoder(part, defaults.decoder, charset, 'key');\n val = options.strictNullHandling ? null : '';\n } else {\n key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');\n val = options.decoder(part.slice(pos + 1), defaults.decoder, charset, 'value');\n }\n\n if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {\n val = interpretNumericEntities(val);\n }\n\n if (val && options.comma && val.indexOf(',') > -1) {\n val = val.split(',');\n }\n\n if (has.call(obj, key)) {\n obj[key] = utils.combine(obj[key], val);\n } else {\n obj[key] = val;\n }\n }\n\n return obj;\n};\n\nvar parseObject = function (chain, val, options) {\n var leaf = val;\n\n for (var i = chain.length - 1; i >= 0; --i) {\n var obj;\n var root = chain[i];\n\n if (root === '[]' && options.parseArrays) {\n obj = [].concat(leaf);\n } else {\n obj = options.plainObjects ? Object.create(null) : {};\n var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;\n var index = parseInt(cleanRoot, 10);\n if (!options.parseArrays && cleanRoot === '') {\n obj = { 0: leaf };\n } else if (\n !isNaN(index)\n && root !== cleanRoot\n && String(index) === cleanRoot\n && index >= 0\n && (options.parseArrays && index <= options.arrayLimit)\n ) {\n obj = [];\n obj[index] = leaf;\n } else {\n obj[cleanRoot] = leaf;\n }\n }\n\n leaf = obj;\n }\n\n return leaf;\n};\n\nvar parseKeys = function parseQueryStringKeys(givenKey, val, options) {\n if (!givenKey) {\n return;\n }\n\n // Transform dot notation to bracket notation\n var key = options.allowDots ? givenKey.replace(/\\.([^.[]+)/g, '[$1]') : givenKey;\n\n // The regex chunks\n\n var brackets = /(\\[[^[\\]]*])/;\n var child = /(\\[[^[\\]]*])/g;\n\n // Get the parent\n\n var segment = options.depth > 0 && brackets.exec(key);\n var parent = segment ? key.slice(0, segment.index) : key;\n\n // Stash the parent if it exists\n\n var keys = [];\n if (parent) {\n // If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties\n if (!options.plainObjects && has.call(Object.prototype, parent)) {\n if (!options.allowPrototypes) {\n return;\n }\n }\n\n keys.push(parent);\n }\n\n // Loop through children appending to the array until we hit depth\n\n var i = 0;\n while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) {\n i += 1;\n if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {\n if (!options.allowPrototypes) {\n return;\n }\n }\n keys.push(segment[1]);\n }\n\n // If there's a remainder, just add whatever is left\n\n if (segment) {\n keys.push('[' + key.slice(segment.index) + ']');\n }\n\n return parseObject(keys, val, options);\n};\n\nvar normalizeParseOptions = function normalizeParseOptions(opts) {\n if (!opts) {\n return defaults;\n }\n\n if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') {\n throw new TypeError('Decoder has to be a function.');\n }\n\n if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {\n throw new Error('The charset option must be either utf-8, iso-8859-1, or undefined');\n }\n var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;\n\n return {\n allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,\n allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes,\n arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit,\n charset: charset,\n charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,\n comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma,\n decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder,\n delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,\n // eslint-disable-next-line no-implicit-coercion, no-extra-parens\n depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth,\n ignoreQueryPrefix: opts.ignoreQueryPrefix === true,\n interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities,\n parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit,\n parseArrays: opts.parseArrays !== false,\n plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects,\n strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling\n };\n};\n\nmodule.exports = function (str, opts) {\n var options = normalizeParseOptions(opts);\n\n if (str === '' || str === null || typeof str === 'undefined') {\n return options.plainObjects ? Object.create(null) : {};\n }\n\n var tempObj = typeof str === 'string' ? parseValues(str, options) : str;\n var obj = options.plainObjects ? Object.create(null) : {};\n\n // Iterate over the keys and setup the new object\n\n var keys = Object.keys(tempObj);\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n var newObj = parseKeys(key, tempObj[key], options);\n obj = utils.merge(obj, newObj, options);\n }\n\n return utils.compact(obj);\n};\n","const EMAIL_REGEXP = /^(mailto:)?[a-z0-9._%+-]+@[a-z0-9][a-z0-9.-]*\\.[a-z]{2,63}$/i;\n\n/**\n * Determines whether the given string looks like an email.\n *\n * @param {string} email The string to scrutinise.\n *\n * @example\n * ```js\n * const isEmail = isEmail( 'hello@wordpress.org' ); // true\n * ```\n *\n * @return {boolean} Whether or not it looks like an email.\n */\nexport function isEmail( email ) {\n\treturn EMAIL_REGEXP.test( email );\n}\n","/**\n * Internal dependencies\n */\nimport { isEmail } from './is-email';\n\nconst USABLE_HREF_REGEXP = /^(?:[a-z]+:|#|\\?|\\.|\\/)/i;\n\n/**\n * Prepends \"http://\" to a url, if it looks like something that is meant to be a TLD.\n *\n * @param {string} url The URL to test.\n *\n * @example\n * ```js\n * const actualURL = prependHTTP( 'wordpress.org' ); // http://wordpress.org\n * ```\n *\n * @return {string} The updated URL.\n */\nexport function prependHTTP( url ) {\n\tif ( ! url ) {\n\t\treturn url;\n\t}\n\n\turl = url.trim();\n\tif ( ! USABLE_HREF_REGEXP.test( url ) && ! isEmail( url ) ) {\n\t\treturn 'http://' + url;\n\t}\n\n\treturn url;\n}\n","/**\n * External dependencies\n */\nimport { parse, stringify } from 'qs';\n\n/**\n * Appends arguments as querystring to the provided URL. If the URL already\n * includes query arguments, the arguments are merged with (and take precedent\n * over) the existing set.\n *\n * @param {string} [url=''] URL to which arguments should be appended. If omitted,\n * only the resulting querystring is returned.\n * @param {Object} [args] Query arguments to apply to URL.\n *\n * @example\n * ```js\n * const newURL = addQueryArgs( 'https://google.com', { q: 'test' } ); // https://google.com/?q=test\n * ```\n *\n * @return {string} URL with arguments applied.\n */\nexport function addQueryArgs( url = '', args ) {\n\t// If no arguments are to be appended, return original URL.\n\tif ( ! args || ! Object.keys( args ).length ) {\n\t\treturn url;\n\t}\n\n\tlet baseUrl = url;\n\n\t// Determine whether URL already had query arguments.\n\tconst queryStringIndex = url.indexOf( '?' );\n\tif ( queryStringIndex !== -1 ) {\n\t\t// Merge into existing query arguments.\n\t\targs = Object.assign(\n\t\t\tparse( url.substr( queryStringIndex + 1 ) ),\n\t\t\targs\n\t\t);\n\n\t\t// Change working base URL to omit previous query arguments.\n\t\tbaseUrl = baseUrl.substr( 0, queryStringIndex );\n\t}\n\n\treturn baseUrl + '?' + stringify( args );\n}\n","import jQuery from 'jquery';\nimport _ from 'underscores';\nimport { dt, ajaxurl } from 'window';\nimport {\n\taddQueryArgs,\n\tisURL,\n\tprependHTTP,\n} from '@wordpress/url';\nimport compareVersions from 'compare-versions';\nimport wp from 'wp';\n\nconst [ body ] = document.getElementsByTagName( 'body' );\nconst externalConnectionUrlField = document.getElementById( 'dt_external_connection_url' );\nconst externalConnectionMetaBox = document.getElementById( 'dt_external_connection_details' );\nconst externalConnectionTypeField = document.getElementById( 'dt_external_connection_type' );\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' );\nconst createConnection = document.getElementById( 'create-connection' );\nconst wpbody = document.getElementById( 'wpbody' );\nconst externalSiteUrlField = document.getElementById( 'dt_external_site_url' );\nconst wizardError = document.getElementsByClassName( 'dt-wizard-error' );\nconst [ wizardStatus ] = document.getElementsByClassName( 'dt-wizard-status' );\nconst authorizeConnectionButton = document.getElementsByClassName( 'establish-connection-button' );\nconst beginOauthConnectionButton = document.getElementById( 'begin-authorization' );\nconst createOauthConnectionButton = document.getElementById( 'create-oauth-connection' );\nconst manualSetupButton = document.getElementsByClassName( 'manual-setup-button' );\nconst titlePrompt = document.getElementById( '#title-prompt-text' );\nconst slug = externalConnectionTypeField.value;\nlet $apiVerify = false;\nwpbody.className = slug;\n\n// Prevent the `enter` key from submitting the form.\njQuery( '#post' ).on( 'keypress', function ( event ) {\n\tif ( 13 != event.which || body.classList.contains( 'post-php' ) ) {\n\t\treturn true;\n\t}\n\n\tif ( 'wp' === jQuery( externalConnectionTypeField ).val() ) {\n\t\tjQuery( authorizeConnectionButton ).trigger( 'click' );\n\t}\n\n\tif ( 'wpdotcom' === jQuery( externalConnectionTypeField ).val() ) {\n\t\t! isHidden( beginOauthConnectionButton ) && jQuery( beginOauthConnectionButton ).trigger( 'click' );\n\t\t! isHidden( createOauthConnectionButton ) && jQuery( createOauthConnectionButton ).trigger( 'click' );\n\t}\n\n\treturn false;\n} );\n\n/**\n * Handle Setup Connection Wizard \"Authorize Connection\" button.\n */\njQuery( authorizeConnectionButton ).on( 'click', ( event ) => {\n\tevent.preventDefault();\n\n\t// Clear any previous errors.\n\tjQuery( wizardError[0] ).text( '' );\n\n\t// Verify Title and Site URL fields are non-empty.\n\tconst validateTitle = validateField( jQuery( titleField ), event );\n\tconst validateURL = validateField( jQuery( externalSiteUrlField ), event );\n\n\tif (\n\t\t! validateTitle ||\n\t\t! validateURL\n\t) {\n\t\tevent.preventDefault();\n\t\treturn false;\n\t}\n\n\tlet siteURL = prependHTTP( externalSiteUrlField.value );\n\tif ( ! isURL( siteURL ) ) {\n\t\tjQuery( wizardError[0] ).text( dt.invalid_url );\n\t\treturn false;\n\t}\n\n\t// Show the spinner and loading message.\n\twizardStatus.style.display = 'block';\n\n\t// Remove wp-json from URL, if that was added\n\tsiteURL = siteURL.replace( /wp-json(\\/)*/, '' );\n\n\t// Ensure URL ends with trailing slash\n\tsiteURL = siteURL.replace( /\\/?$/, '/' );\n\n\tjQuery.ajax( {\n\t\turl: ajaxurl,\n\t\tmethod: 'post',\n\t\tdata: {\n\t\t\tnonce: dt.nonce,\n\t\t\taction: 'dt_get_remote_info',\n\t\t\turl: siteURL\n\t\t}\n\t} ).done( response => {\n\t\twizardStatus.style.display = 'none';\n\n\t\tif ( ! response.success ) {\n\t\t\tif (\n\t\t\t\tObject.prototype.hasOwnProperty.call( response, 'data' )\n\t\t\t\t&& Object.prototype.hasOwnProperty.call( response.data, 'rest_url' )\n\t\t\t\t&& ! Object.prototype.hasOwnProperty.call( response.data, 'version' )\n\t\t\t) {\n\t\t\t\tjQuery( wizardError[0] ).text( dt.no_distributor );\n\t\t\t} else {\n\t\t\t\tjQuery( wizardError[0] ).text( dt.noconnection );\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\t// Remove -dev from the version number, if running from the develop branch\n\t\tconst version = response.data.version.replace( /-dev/, '' );\n\n\t\t// Requires Distributor version 1.6.0.\n\t\tif ( compareVersions.compare( version, '1.6.0', '<' ) ) {\n\t\t\tjQuery( wizardError[0] ).text( dt.minversion );\n\t\t\treturn;\n\t\t}\n\n\t\tconst successURL = addQueryArgs( document.location.href,\n\t\t\t{\n\t\t\t\tsetupStatus: 'success',\n\t\t\t\ttitleField: titleField.value,\n\t\t\t\texternalSiteUrlField: siteURL,\n\t\t\t\trestRoot: response.data.rest_url,\n\t\t\t}\n\t\t);\n\n\t\tconst failureURL = addQueryArgs( document.location.href,\n\t\t\t{\n\t\t\t\tsetupStatus: 'failure'\n\t\t\t}\n\t\t);\n\n\t\tconst authURL = addQueryArgs(\n\t\t\t`${ siteURL }wp-admin/admin.php`,\n\t\t\t{\n\t\t\t\tpage: 'auth_app',\n\t\t\t\tapp_name: dt.distributor_from, /*eslint camelcase: 0*/\n\t\t\t\tsuccess_url: encodeURI( successURL ), /*eslint camelcase: 0*/\n\t\t\t\treject_url: encodeURI( failureURL ), /*eslint camelcase: 0*/\n\t\t\t}\n\t\t);\n\t\tdocument.location = authURL;\n\t} );\n\n\treturn false;\n} );\n\n/**\n * Handle Manual Setup Connection button.\n *\n * This hides the wizard box and shows the\n * default fields.\n */\njQuery( manualSetupButton ).on( 'click', ( event ) => {\n\tevent.preventDefault();\n\n\tjQuery( '.external-connection-wizard' ).hide();\n\tjQuery( '.external-connection-setup, .hide-until-authed' ).show();\n} );\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\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\tconst 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( 'button' );\n\t\t\t\t\tsuggestion.classList.add( 'suggest' );\n\t\t\t\t\tsuggestion.classList.add( 'button-link' );\n\t\t\t\t\tsuggestion.setAttribute( 'type', 'button' );\n\t\t\t\t\tsuggestion.innerText = response.data.endpoint_suggestion;\n\n\t\t\t\t\tendpointResult.appendChild( suggestion );\n\n\t\t\t\t\twp.a11y.speak( `${ dt.endpoint_suggestion } ${ response.data.endpoint_suggestion }`, 'polite' );\n\t\t\t\t} else {\n\t\t\t\t\tendpointResult.innerText = dt.bad_connection;\n\n\t\t\t\t\twp.a11y.speak( dt.bad_connection, 'polite' );\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\twp.a11y.speak( `${ dt.limited_connection } ${ dt.no_distributor }`, 'polite' );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tendpointResult.innerText += ` ${ dt.bad_auth }`;\n\t\t\t\t\t\twp.a11y.speak( `${ dt.limited_connection } ${ dt.bad_auth }`, 'polite' );\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\n\t\t\t\t\twp.a11y.speak( dt.good_connection, 'polite' );\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\n// Initialize after load.\nsetTimeout( () => {\n\t// Repopulate fields on wizard flow.\n\tconst { wizard_return } = dt;\n\n\tif ( wizard_return ) {\n\t\tif ( '' === titleField.value ) {\n\t\t\tjQuery( titleField ).val( wizard_return.titleField ).focus().blur();\n\t\t\tjQuery( titlePrompt ).empty();\n\t\t}\n\t\tjQuery( usernameField ).val( wizard_return.user_login );\n\t\tjQuery( passwordField ).val( wizard_return.password );\n\t\tjQuery( externalConnectionUrlField ).val( wizard_return.restRoot );\n\t\twpbody.className = 'wizard-return';\n\t\tcreateConnection.click();\n\t}\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( externalConnectionUrlField ).on( 'focus click', event => {\n\tevent.target.setAttribute( 'initial-url', event.target.value );\n} );\n\njQuery( externalConnectionUrlField ).on( 'keyup input', _.debounce( () => {\n\tif ( externalConnectionUrlField.value.replace( /\\/$/, '' ) === externalConnectionUrlField.getAttribute( 'initial-url' ).replace( /\\/$/, '' ) ) {\n\t\treturn;\n\t}\n\n\texternalConnectionUrlField.setAttribute( 'initial-url', externalConnectionUrlField.value );\n\tcheckConnections();\n}, 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( 'focus click', event => {\n\tevent.target.setAttribute( 'initial-username', event.target.value );\n} );\n\njQuery( usernameField ).on( 'keyup input', _.debounce( () => {\n\tif ( usernameField.getAttribute( 'initial-username' ) === usernameField.value ) {\n\t\treturn;\n\t}\n\tif ( changePassword ) {\n\t\tpasswordField.disabled = false;\n\t\tpasswordField.value = '';\n\t\tchangePassword.style.display = 'none';\n\t}\n}, 250 ) );\n\njQuery( passwordField ).on( 'keyup input', _.debounce( () => {\n\tcheckConnections();\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$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\twpbody.className = slug;\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.\nif ( createOauthConnectionButton ) {\n\tjQuery( createOauthConnectionButton ).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 * Check if an element is hidden or not.\n * @param {*} el Element to check.\n */\nfunction isHidden( el ) {\n\treturn ( null === el.offsetParent );\n}\n","/**\n * Determines whether the given string looks like a URL.\n *\n * @param {string} url The string to scrutinise.\n *\n * @example\n * ```js\n * const isURL = isURL( 'https://wordpress.org' ); // true\n * ```\n *\n * @see https://url.spec.whatwg.org/\n * @see https://url.spec.whatwg.org/#valid-url-string\n *\n * @return {boolean} Whether or not it looks like a URL.\n */\nexport function isURL( url ) {\n\t// A URL can be considered value if the `URL` constructor is able to parse\n\t// it. The constructor throws an error for an invalid URL.\n\ttry {\n\t\tnew URL( url );\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n}\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"window\"","webpack:///external \"jQuery\"","webpack:///external \"_\"","webpack:///external \"wp\"","webpack:///./node_modules/qs/lib/utils.js","webpack:///./node_modules/qs/lib/index.js","webpack:///./node_modules/qs/lib/formats.js","webpack:///./node_modules/compare-versions/index.js","webpack:///./node_modules/qs/lib/stringify.js","webpack:///./node_modules/qs/lib/parse.js","webpack:///@wordpress/url/src/is-email.js","webpack:///@wordpress/url/src/prepend-http.js","webpack:///@wordpress/url/src/add-query-args.js","webpack:///./assets/js/admin-external-connection.js","webpack:///@wordpress/url/src/is-url.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","window","jQuery","_","wp","has","isArray","Array","hexTable","array","push","toString","toUpperCase","arrayToObject","source","options","obj","plainObjects","length","assign","target","keys","reduce","acc","combine","a","b","concat","compact","queue","prop","refs","item","j","val","indexOf","pop","compacted","compactQueue","decode","str","decoder","charset","strWithoutPlus","replace","unescape","decodeURIComponent","e","encode","defaultEncoder","string","String","escape","$0","parseInt","slice","out","charCodeAt","charAt","isBuffer","constructor","isRegExp","merge","allowPrototypes","mergeTarget","forEach","targetItem","stringify","require","parse","formats","percentTwenties","util","Format","RFC1738","RFC3986","formatters","define","semver","split","v","q","patchIndex","arr","substring","tryParse","isNaN","Number","validate","version","TypeError","test","Error","compareVersions","v1","v2","s1","s2","Math","max","n1","n2","sp1","sp2","p1","map","p2","undefined","allowedOperators","operatorResMap","compare","operator","op","join","validateOperator","res","utils","arrayPrefixGenerators","brackets","prefix","comma","indices","repeat","pushToArray","valueOrArray","apply","toISO","Date","toISOString","defaultFormat","defaults","addQueryPrefix","allowDots","charsetSentinel","delimiter","encoder","encodeValuesOnly","format","formatter","serializeDate","date","skipNulls","strictNullHandling","generateArrayPrefix","filter","sort","objKeys","values","opts","normalizeStringifyOptions","arrayFormat","joined","arrayLimit","depth","ignoreQueryPrefix","interpretNumericEntities","parameterLimit","parseArrays","numberStr","fromCharCode","parseKeys","givenKey","child","segment","exec","parent","index","chain","leaf","root","cleanRoot","0","parseObject","normalizeParseOptions","tempObj","cleanStr","limit","Infinity","parts","skipIndex","part","bracketEqualsPos","pos","parseValues","newObj","EMAIL_REGEXP","USABLE_HREF_REGEXP","prependHTTP","url","addQueryArgs","args","baseUrl","queryStringIndex","body","document","getElementsByTagName","externalConnectionUrlField","getElementById","externalConnectionMetaBox","externalConnectionTypeField","authFields","getElementsByClassName","rolesAllowed","titleField","endpointResult","querySelector","endpointErrors","postIdField","createConnection","wpbody","externalSiteUrlField","wizardError","wizardStatus","authorizeConnectionButton","beginOauthConnectionButton","createOauthConnectionButton","manualSetupButton","titlePrompt","slug","$apiVerify","checkConnections","abort","innerText","removeAttribute","setAttribute","dt","endpoint_checking_message","auth","each","authField","disabled","getAttribute","postId","ajax","ajaxurl","method","data","nonce","action","type","endpointId","done","response","success","errors","no_external_connection","endpoint_suggestion","suggestion","createElement","classList","add","appendChild","a11y","speak","bad_connection","no_distributor","can_post","limited_connection","warnings","is_authenticated","bad_auth","no_permissions","no_push","pull_limited","warning","warningNode","append","good_connection","complete","remove","className","on","event","which","contains","trigger","isHidden","preventDefault","text","validateTitle","validateField","validateURL","siteURL","isURL","style","display","noconnection","error","message","code","minversion","successURL","location","href","setupStatus","restRoot","rest_url","failureURL","authURL","page","app_name","distributor_from","success_url","encodeURI","reject_url","invalid_url","hide","show","setTimeout","wizard_return","focus","blur","empty","usernameField","user_login","passwordField","password","click","currentTarget","debounce","changePassword","cancel","change","checked","alert","roles_warning","$hideUntilAuthed","$clientSecret","$clientId","hideItemsRequiringAuth","$field","addClass","removeClass","validateClientSecret","validateClientId","changeCredentials","$authenticationDetailsWrapper","beginAuthorize","el","offsetParent","$titleEl","title","id","admin_url","history","pushState"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAAS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,GACxB0I,EAAQD,EAASlT,MAGbsP,EAAe4D,EAAUpE,KAG7B9Q,IAAQ+U,GAAiBN,SAAU,YAGnCS,EAASR,YAAa,kBAGtB1U,IAAOuO,KAAM,CACZ7C,IAAK8C,UACLC,OAAQ,OACRC,KAAM,CACLC,MAAOZ,KAAGY,MACVC,OAAQ,yBACRuG,MAAOA,EACPC,GAAIpV,IAAQgM,SAASG,eAAgB,YAAcnK,SAEjD+M,MAAM,SAAEC,GACX,GAAKA,EAASC,SAAWD,EAASN,KAAK0G,GAAK,CAG3C,IAAM1J,EAAM,GAAH,OAAOqC,KAAGsH,UAAV,yBAAsCrG,EAASN,KAAK0G,GAApD,gBACTE,QAAQC,UAAW,GAAI,0BAA2B7J,GAGlD1L,IAAQgM,SAASG,eAAgB,oBAAsBnK,IAAK0J,GAC5D1L,IAAQgM,SAASG,eAAgB,uBAAyBnK,IAAKgN,EAASN,KAAK0G,IAC7EpV,IAAQgM,SAASG,eAAgB,yBAA2BnK,IAAK,WAGjEhC,IAAQ,uCAAwCgT,OAChD8B,EAA8B7B,WAI5BvC,UAAU,WAGb1Q,IAAQ+U,GAAiBL,YAAa","file":"admin-external-connection.min.js","sourcesContent":[" \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, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\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\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 16);\n","module.exports = window;","module.exports = jQuery;","module.exports = _;","module.exports = wp;","'use strict';\n\nvar has = Object.prototype.hasOwnProperty;\nvar isArray = Array.isArray;\n\nvar hexTable = (function () {\n var array = [];\n for (var i = 0; i < 256; ++i) {\n array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());\n }\n\n return array;\n}());\n\nvar compactQueue = function compactQueue(queue) {\n while (queue.length > 1) {\n var item = queue.pop();\n var obj = item.obj[item.prop];\n\n if (isArray(obj)) {\n var compacted = [];\n\n for (var j = 0; j < obj.length; ++j) {\n if (typeof obj[j] !== 'undefined') {\n compacted.push(obj[j]);\n }\n }\n\n item.obj[item.prop] = compacted;\n }\n }\n};\n\nvar arrayToObject = function arrayToObject(source, options) {\n var obj = options && options.plainObjects ? Object.create(null) : {};\n for (var i = 0; i < source.length; ++i) {\n if (typeof source[i] !== 'undefined') {\n obj[i] = source[i];\n }\n }\n\n return obj;\n};\n\nvar merge = function merge(target, source, options) {\n if (!source) {\n return target;\n }\n\n if (typeof source !== 'object') {\n if (isArray(target)) {\n target.push(source);\n } else if (target && typeof target === 'object') {\n if ((options && (options.plainObjects || options.allowPrototypes)) || !has.call(Object.prototype, source)) {\n target[source] = true;\n }\n } else {\n return [target, source];\n }\n\n return target;\n }\n\n if (!target || typeof target !== 'object') {\n return [target].concat(source);\n }\n\n var mergeTarget = target;\n if (isArray(target) && !isArray(source)) {\n mergeTarget = arrayToObject(target, options);\n }\n\n if (isArray(target) && isArray(source)) {\n source.forEach(function (item, i) {\n if (has.call(target, i)) {\n var targetItem = target[i];\n if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') {\n target[i] = merge(targetItem, item, options);\n } else {\n target.push(item);\n }\n } else {\n target[i] = item;\n }\n });\n return target;\n }\n\n return Object.keys(source).reduce(function (acc, key) {\n var value = source[key];\n\n if (has.call(acc, key)) {\n acc[key] = merge(acc[key], value, options);\n } else {\n acc[key] = value;\n }\n return acc;\n }, mergeTarget);\n};\n\nvar assign = function assignSingleSource(target, source) {\n return Object.keys(source).reduce(function (acc, key) {\n acc[key] = source[key];\n return acc;\n }, target);\n};\n\nvar decode = function (str, decoder, charset) {\n var strWithoutPlus = str.replace(/\\+/g, ' ');\n if (charset === 'iso-8859-1') {\n // unescape never throws, no try...catch needed:\n return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);\n }\n // utf-8\n try {\n return decodeURIComponent(strWithoutPlus);\n } catch (e) {\n return strWithoutPlus;\n }\n};\n\nvar encode = function encode(str, defaultEncoder, charset) {\n // This code was originally written by Brian White (mscdex) for the io.js core querystring library.\n // It has been adapted here for stricter adherence to RFC 3986\n if (str.length === 0) {\n return str;\n }\n\n var string = str;\n if (typeof str === 'symbol') {\n string = Symbol.prototype.toString.call(str);\n } else if (typeof str !== 'string') {\n string = String(str);\n }\n\n if (charset === 'iso-8859-1') {\n return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) {\n return '%26%23' + parseInt($0.slice(2), 16) + '%3B';\n });\n }\n\n var out = '';\n for (var i = 0; i < string.length; ++i) {\n var c = string.charCodeAt(i);\n\n if (\n c === 0x2D // -\n || c === 0x2E // .\n || c === 0x5F // _\n || c === 0x7E // ~\n || (c >= 0x30 && c <= 0x39) // 0-9\n || (c >= 0x41 && c <= 0x5A) // a-z\n || (c >= 0x61 && c <= 0x7A) // A-Z\n ) {\n out += string.charAt(i);\n continue;\n }\n\n if (c < 0x80) {\n out = out + hexTable[c];\n continue;\n }\n\n if (c < 0x800) {\n out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]);\n continue;\n }\n\n if (c < 0xD800 || c >= 0xE000) {\n out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);\n continue;\n }\n\n i += 1;\n c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));\n out += hexTable[0xF0 | (c >> 18)]\n + hexTable[0x80 | ((c >> 12) & 0x3F)]\n + hexTable[0x80 | ((c >> 6) & 0x3F)]\n + hexTable[0x80 | (c & 0x3F)];\n }\n\n return out;\n};\n\nvar compact = function compact(value) {\n var queue = [{ obj: { o: value }, prop: 'o' }];\n var refs = [];\n\n for (var i = 0; i < queue.length; ++i) {\n var item = queue[i];\n var obj = item.obj[item.prop];\n\n var keys = Object.keys(obj);\n for (var j = 0; j < keys.length; ++j) {\n var key = keys[j];\n var val = obj[key];\n if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {\n queue.push({ obj: obj, prop: key });\n refs.push(val);\n }\n }\n }\n\n compactQueue(queue);\n\n return value;\n};\n\nvar isRegExp = function isRegExp(obj) {\n return Object.prototype.toString.call(obj) === '[object RegExp]';\n};\n\nvar isBuffer = function isBuffer(obj) {\n if (!obj || typeof obj !== 'object') {\n return false;\n }\n\n return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));\n};\n\nvar combine = function combine(a, b) {\n return [].concat(a, b);\n};\n\nmodule.exports = {\n arrayToObject: arrayToObject,\n assign: assign,\n combine: combine,\n compact: compact,\n decode: decode,\n encode: encode,\n isBuffer: isBuffer,\n isRegExp: isRegExp,\n merge: merge\n};\n","'use strict';\n\nvar stringify = require('./stringify');\nvar parse = require('./parse');\nvar formats = require('./formats');\n\nmodule.exports = {\n formats: formats,\n parse: parse,\n stringify: stringify\n};\n","'use strict';\n\nvar replace = String.prototype.replace;\nvar percentTwenties = /%20/g;\n\nvar util = require('./utils');\n\nvar Format = {\n RFC1738: 'RFC1738',\n RFC3986: 'RFC3986'\n};\n\nmodule.exports = util.assign(\n {\n 'default': Format.RFC3986,\n formatters: {\n RFC1738: function (value) {\n return replace.call(value, percentTwenties, '+');\n },\n RFC3986: function (value) {\n return String(value);\n }\n }\n },\n Format\n);\n","/* global define */\n(function (root, factory) {\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define([], factory);\n } else if (typeof exports === 'object') {\n module.exports = factory();\n } else {\n root.compareVersions = factory();\n }\n}(this, function () {\n\n var semver = /^v?(?:\\d+)(\\.(?:[x*]|\\d+)(\\.(?:[x*]|\\d+)(\\.(?:[x*]|\\d+))?(?:-[\\da-z\\-]+(?:\\.[\\da-z\\-]+)*)?(?:\\+[\\da-z\\-]+(?:\\.[\\da-z\\-]+)*)?)?)?$/i;\n\n function indexOrEnd(str, q) {\n return str.indexOf(q) === -1 ? str.length : str.indexOf(q);\n }\n\n function split(v) {\n var c = v.replace(/^v/, '').replace(/\\+.*$/, '');\n var patchIndex = indexOrEnd(c, '-');\n var arr = c.substring(0, patchIndex).split('.');\n arr.push(c.substring(patchIndex + 1));\n return arr;\n }\n\n function tryParse(v) {\n return isNaN(Number(v)) ? v : Number(v);\n }\n\n function validate(version) {\n if (typeof version !== 'string') {\n throw new TypeError('Invalid argument expected string');\n }\n if (!semver.test(version)) {\n throw new Error('Invalid argument not valid semver (\\''+version+'\\' received)');\n }\n }\n\n function compareVersions(v1, v2) {\n [v1, v2].forEach(validate);\n\n var s1 = split(v1);\n var s2 = split(v2);\n\n for (var i = 0; i < Math.max(s1.length - 1, s2.length - 1); i++) {\n var n1 = parseInt(s1[i] || 0, 10);\n var n2 = parseInt(s2[i] || 0, 10);\n\n if (n1 > n2) return 1;\n if (n2 > n1) return -1;\n }\n\n var sp1 = s1[s1.length - 1];\n var sp2 = s2[s2.length - 1];\n\n if (sp1 && sp2) {\n var p1 = sp1.split('.').map(tryParse);\n var p2 = sp2.split('.').map(tryParse);\n\n for (i = 0; i < Math.max(p1.length, p2.length); i++) {\n if (p1[i] === undefined || typeof p2[i] === 'string' && typeof p1[i] === 'number') return -1;\n if (p2[i] === undefined || typeof p1[i] === 'string' && typeof p2[i] === 'number') return 1;\n\n if (p1[i] > p2[i]) return 1;\n if (p2[i] > p1[i]) return -1;\n }\n } else if (sp1 || sp2) {\n return sp1 ? -1 : 1;\n }\n\n return 0;\n };\n\n var allowedOperators = [\n '>',\n '>=',\n '=',\n '<',\n '<='\n ];\n\n var operatorResMap = {\n '>': [1],\n '>=': [0, 1],\n '=': [0],\n '<=': [-1, 0],\n '<': [-1]\n };\n\n function validateOperator(op) {\n if (typeof op !== 'string') {\n throw new TypeError('Invalid operator type, expected string but got ' + typeof op);\n }\n if (allowedOperators.indexOf(op) === -1) {\n throw new TypeError('Invalid operator, expected one of ' + allowedOperators.join('|'));\n }\n }\n\n compareVersions.validate = function(version) {\n return typeof version === 'string' && semver.test(version);\n }\n\n compareVersions.compare = function (v1, v2, operator) {\n // Validate operator\n validateOperator(operator);\n\n // since result of compareVersions can only be -1 or 0 or 1\n // a simple map can be used to replace switch\n var res = compareVersions(v1, v2);\n return operatorResMap[operator].indexOf(res) > -1;\n }\n\n return compareVersions;\n}));\n","'use strict';\n\nvar utils = require('./utils');\nvar formats = require('./formats');\nvar has = Object.prototype.hasOwnProperty;\n\nvar arrayPrefixGenerators = {\n brackets: function brackets(prefix) {\n return prefix + '[]';\n },\n comma: 'comma',\n indices: function indices(prefix, key) {\n return prefix + '[' + key + ']';\n },\n repeat: function repeat(prefix) {\n return prefix;\n }\n};\n\nvar isArray = Array.isArray;\nvar push = Array.prototype.push;\nvar pushToArray = function (arr, valueOrArray) {\n push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]);\n};\n\nvar toISO = Date.prototype.toISOString;\n\nvar defaultFormat = formats['default'];\nvar defaults = {\n addQueryPrefix: false,\n allowDots: false,\n charset: 'utf-8',\n charsetSentinel: false,\n delimiter: '&',\n encode: true,\n encoder: utils.encode,\n encodeValuesOnly: false,\n format: defaultFormat,\n formatter: formats.formatters[defaultFormat],\n // deprecated\n indices: false,\n serializeDate: function serializeDate(date) {\n return toISO.call(date);\n },\n skipNulls: false,\n strictNullHandling: false\n};\n\nvar isNonNullishPrimitive = function isNonNullishPrimitive(v) {\n return typeof v === 'string'\n || typeof v === 'number'\n || typeof v === 'boolean'\n || typeof v === 'symbol'\n || typeof v === 'bigint';\n};\n\nvar stringify = function stringify(\n object,\n prefix,\n generateArrayPrefix,\n strictNullHandling,\n skipNulls,\n encoder,\n filter,\n sort,\n allowDots,\n serializeDate,\n formatter,\n encodeValuesOnly,\n charset\n) {\n var obj = object;\n if (typeof filter === 'function') {\n obj = filter(prefix, obj);\n } else if (obj instanceof Date) {\n obj = serializeDate(obj);\n } else if (generateArrayPrefix === 'comma' && isArray(obj)) {\n obj = obj.join(',');\n }\n\n if (obj === null) {\n if (strictNullHandling) {\n return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, 'key') : prefix;\n }\n\n obj = '';\n }\n\n if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) {\n if (encoder) {\n var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key');\n return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value'))];\n }\n return [formatter(prefix) + '=' + formatter(String(obj))];\n }\n\n var values = [];\n\n if (typeof obj === 'undefined') {\n return values;\n }\n\n var objKeys;\n if (isArray(filter)) {\n objKeys = filter;\n } else {\n var keys = Object.keys(obj);\n objKeys = sort ? keys.sort(sort) : keys;\n }\n\n for (var i = 0; i < objKeys.length; ++i) {\n var key = objKeys[i];\n\n if (skipNulls && obj[key] === null) {\n continue;\n }\n\n if (isArray(obj)) {\n pushToArray(values, stringify(\n obj[key],\n typeof generateArrayPrefix === 'function' ? generateArrayPrefix(prefix, key) : prefix,\n generateArrayPrefix,\n strictNullHandling,\n skipNulls,\n encoder,\n filter,\n sort,\n allowDots,\n serializeDate,\n formatter,\n encodeValuesOnly,\n charset\n ));\n } else {\n pushToArray(values, stringify(\n obj[key],\n prefix + (allowDots ? '.' + key : '[' + key + ']'),\n generateArrayPrefix,\n strictNullHandling,\n skipNulls,\n encoder,\n filter,\n sort,\n allowDots,\n serializeDate,\n formatter,\n encodeValuesOnly,\n charset\n ));\n }\n }\n\n return values;\n};\n\nvar normalizeStringifyOptions = function normalizeStringifyOptions(opts) {\n if (!opts) {\n return defaults;\n }\n\n if (opts.encoder !== null && opts.encoder !== undefined && typeof opts.encoder !== 'function') {\n throw new TypeError('Encoder has to be a function.');\n }\n\n var charset = opts.charset || defaults.charset;\n if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {\n throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');\n }\n\n var format = formats['default'];\n if (typeof opts.format !== 'undefined') {\n if (!has.call(formats.formatters, opts.format)) {\n throw new TypeError('Unknown format option provided.');\n }\n format = opts.format;\n }\n var formatter = formats.formatters[format];\n\n var filter = defaults.filter;\n if (typeof opts.filter === 'function' || isArray(opts.filter)) {\n filter = opts.filter;\n }\n\n return {\n addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix,\n allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,\n charset: charset,\n charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,\n delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter,\n encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode,\n encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder,\n encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly,\n filter: filter,\n formatter: formatter,\n serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate,\n skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls,\n sort: typeof opts.sort === 'function' ? opts.sort : null,\n strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling\n };\n};\n\nmodule.exports = function (object, opts) {\n var obj = object;\n var options = normalizeStringifyOptions(opts);\n\n var objKeys;\n var filter;\n\n if (typeof options.filter === 'function') {\n filter = options.filter;\n obj = filter('', obj);\n } else if (isArray(options.filter)) {\n filter = options.filter;\n objKeys = filter;\n }\n\n var keys = [];\n\n if (typeof obj !== 'object' || obj === null) {\n return '';\n }\n\n var arrayFormat;\n if (opts && opts.arrayFormat in arrayPrefixGenerators) {\n arrayFormat = opts.arrayFormat;\n } else if (opts && 'indices' in opts) {\n arrayFormat = opts.indices ? 'indices' : 'repeat';\n } else {\n arrayFormat = 'indices';\n }\n\n var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];\n\n if (!objKeys) {\n objKeys = Object.keys(obj);\n }\n\n if (options.sort) {\n objKeys.sort(options.sort);\n }\n\n for (var i = 0; i < objKeys.length; ++i) {\n var key = objKeys[i];\n\n if (options.skipNulls && obj[key] === null) {\n continue;\n }\n pushToArray(keys, stringify(\n obj[key],\n key,\n generateArrayPrefix,\n options.strictNullHandling,\n options.skipNulls,\n options.encode ? options.encoder : null,\n options.filter,\n options.sort,\n options.allowDots,\n options.serializeDate,\n options.formatter,\n options.encodeValuesOnly,\n options.charset\n ));\n }\n\n var joined = keys.join(options.delimiter);\n var prefix = options.addQueryPrefix === true ? '?' : '';\n\n if (options.charsetSentinel) {\n if (options.charset === 'iso-8859-1') {\n // encodeURIComponent('✓'), the \"numeric entity\" representation of a checkmark\n prefix += 'utf8=%26%2310003%3B&';\n } else {\n // encodeURIComponent('✓')\n prefix += 'utf8=%E2%9C%93&';\n }\n }\n\n return joined.length > 0 ? prefix + joined : '';\n};\n","'use strict';\n\nvar utils = require('./utils');\n\nvar has = Object.prototype.hasOwnProperty;\n\nvar defaults = {\n allowDots: false,\n allowPrototypes: false,\n arrayLimit: 20,\n charset: 'utf-8',\n charsetSentinel: false,\n comma: false,\n decoder: utils.decode,\n delimiter: '&',\n depth: 5,\n ignoreQueryPrefix: false,\n interpretNumericEntities: false,\n parameterLimit: 1000,\n parseArrays: true,\n plainObjects: false,\n strictNullHandling: false\n};\n\nvar interpretNumericEntities = function (str) {\n return str.replace(/&#(\\d+);/g, function ($0, numberStr) {\n return String.fromCharCode(parseInt(numberStr, 10));\n });\n};\n\n// This is what browsers will submit when the ✓ character occurs in an\n// application/x-www-form-urlencoded body and the encoding of the page containing\n// the form is iso-8859-1, or when the submitted form has an accept-charset\n// attribute of iso-8859-1. Presumably also with other charsets that do not contain\n// the ✓ character, such as us-ascii.\nvar isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('✓')\n\n// These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded.\nvar charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')\n\nvar parseValues = function parseQueryStringValues(str, options) {\n var obj = {};\n var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\\?/, '') : str;\n var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;\n var parts = cleanStr.split(options.delimiter, limit);\n var skipIndex = -1; // Keep track of where the utf8 sentinel was found\n var i;\n\n var charset = options.charset;\n if (options.charsetSentinel) {\n for (i = 0; i < parts.length; ++i) {\n if (parts[i].indexOf('utf8=') === 0) {\n if (parts[i] === charsetSentinel) {\n charset = 'utf-8';\n } else if (parts[i] === isoSentinel) {\n charset = 'iso-8859-1';\n }\n skipIndex = i;\n i = parts.length; // The eslint settings do not allow break;\n }\n }\n }\n\n for (i = 0; i < parts.length; ++i) {\n if (i === skipIndex) {\n continue;\n }\n var part = parts[i];\n\n var bracketEqualsPos = part.indexOf(']=');\n var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;\n\n var key, val;\n if (pos === -1) {\n key = options.decoder(part, defaults.decoder, charset, 'key');\n val = options.strictNullHandling ? null : '';\n } else {\n key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');\n val = options.decoder(part.slice(pos + 1), defaults.decoder, charset, 'value');\n }\n\n if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {\n val = interpretNumericEntities(val);\n }\n\n if (val && options.comma && val.indexOf(',') > -1) {\n val = val.split(',');\n }\n\n if (has.call(obj, key)) {\n obj[key] = utils.combine(obj[key], val);\n } else {\n obj[key] = val;\n }\n }\n\n return obj;\n};\n\nvar parseObject = function (chain, val, options) {\n var leaf = val;\n\n for (var i = chain.length - 1; i >= 0; --i) {\n var obj;\n var root = chain[i];\n\n if (root === '[]' && options.parseArrays) {\n obj = [].concat(leaf);\n } else {\n obj = options.plainObjects ? Object.create(null) : {};\n var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;\n var index = parseInt(cleanRoot, 10);\n if (!options.parseArrays && cleanRoot === '') {\n obj = { 0: leaf };\n } else if (\n !isNaN(index)\n && root !== cleanRoot\n && String(index) === cleanRoot\n && index >= 0\n && (options.parseArrays && index <= options.arrayLimit)\n ) {\n obj = [];\n obj[index] = leaf;\n } else {\n obj[cleanRoot] = leaf;\n }\n }\n\n leaf = obj;\n }\n\n return leaf;\n};\n\nvar parseKeys = function parseQueryStringKeys(givenKey, val, options) {\n if (!givenKey) {\n return;\n }\n\n // Transform dot notation to bracket notation\n var key = options.allowDots ? givenKey.replace(/\\.([^.[]+)/g, '[$1]') : givenKey;\n\n // The regex chunks\n\n var brackets = /(\\[[^[\\]]*])/;\n var child = /(\\[[^[\\]]*])/g;\n\n // Get the parent\n\n var segment = options.depth > 0 && brackets.exec(key);\n var parent = segment ? key.slice(0, segment.index) : key;\n\n // Stash the parent if it exists\n\n var keys = [];\n if (parent) {\n // If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties\n if (!options.plainObjects && has.call(Object.prototype, parent)) {\n if (!options.allowPrototypes) {\n return;\n }\n }\n\n keys.push(parent);\n }\n\n // Loop through children appending to the array until we hit depth\n\n var i = 0;\n while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) {\n i += 1;\n if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {\n if (!options.allowPrototypes) {\n return;\n }\n }\n keys.push(segment[1]);\n }\n\n // If there's a remainder, just add whatever is left\n\n if (segment) {\n keys.push('[' + key.slice(segment.index) + ']');\n }\n\n return parseObject(keys, val, options);\n};\n\nvar normalizeParseOptions = function normalizeParseOptions(opts) {\n if (!opts) {\n return defaults;\n }\n\n if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') {\n throw new TypeError('Decoder has to be a function.');\n }\n\n if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {\n throw new Error('The charset option must be either utf-8, iso-8859-1, or undefined');\n }\n var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;\n\n return {\n allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,\n allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes,\n arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit,\n charset: charset,\n charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,\n comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma,\n decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder,\n delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,\n // eslint-disable-next-line no-implicit-coercion, no-extra-parens\n depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth,\n ignoreQueryPrefix: opts.ignoreQueryPrefix === true,\n interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities,\n parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit,\n parseArrays: opts.parseArrays !== false,\n plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects,\n strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling\n };\n};\n\nmodule.exports = function (str, opts) {\n var options = normalizeParseOptions(opts);\n\n if (str === '' || str === null || typeof str === 'undefined') {\n return options.plainObjects ? Object.create(null) : {};\n }\n\n var tempObj = typeof str === 'string' ? parseValues(str, options) : str;\n var obj = options.plainObjects ? Object.create(null) : {};\n\n // Iterate over the keys and setup the new object\n\n var keys = Object.keys(tempObj);\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n var newObj = parseKeys(key, tempObj[key], options);\n obj = utils.merge(obj, newObj, options);\n }\n\n return utils.compact(obj);\n};\n","const EMAIL_REGEXP = /^(mailto:)?[a-z0-9._%+-]+@[a-z0-9][a-z0-9.-]*\\.[a-z]{2,63}$/i;\n\n/**\n * Determines whether the given string looks like an email.\n *\n * @param {string} email The string to scrutinise.\n *\n * @example\n * ```js\n * const isEmail = isEmail( 'hello@wordpress.org' ); // true\n * ```\n *\n * @return {boolean} Whether or not it looks like an email.\n */\nexport function isEmail( email ) {\n\treturn EMAIL_REGEXP.test( email );\n}\n","/**\n * Internal dependencies\n */\nimport { isEmail } from './is-email';\n\nconst USABLE_HREF_REGEXP = /^(?:[a-z]+:|#|\\?|\\.|\\/)/i;\n\n/**\n * Prepends \"http://\" to a url, if it looks like something that is meant to be a TLD.\n *\n * @param {string} url The URL to test.\n *\n * @example\n * ```js\n * const actualURL = prependHTTP( 'wordpress.org' ); // http://wordpress.org\n * ```\n *\n * @return {string} The updated URL.\n */\nexport function prependHTTP( url ) {\n\tif ( ! url ) {\n\t\treturn url;\n\t}\n\n\turl = url.trim();\n\tif ( ! USABLE_HREF_REGEXP.test( url ) && ! isEmail( url ) ) {\n\t\treturn 'http://' + url;\n\t}\n\n\treturn url;\n}\n","/**\n * External dependencies\n */\nimport { parse, stringify } from 'qs';\n\n/**\n * Appends arguments as querystring to the provided URL. If the URL already\n * includes query arguments, the arguments are merged with (and take precedent\n * over) the existing set.\n *\n * @param {string} [url=''] URL to which arguments should be appended. If omitted,\n * only the resulting querystring is returned.\n * @param {Object} [args] Query arguments to apply to URL.\n *\n * @example\n * ```js\n * const newURL = addQueryArgs( 'https://google.com', { q: 'test' } ); // https://google.com/?q=test\n * ```\n *\n * @return {string} URL with arguments applied.\n */\nexport function addQueryArgs( url = '', args ) {\n\t// If no arguments are to be appended, return original URL.\n\tif ( ! args || ! Object.keys( args ).length ) {\n\t\treturn url;\n\t}\n\n\tlet baseUrl = url;\n\n\t// Determine whether URL already had query arguments.\n\tconst queryStringIndex = url.indexOf( '?' );\n\tif ( queryStringIndex !== -1 ) {\n\t\t// Merge into existing query arguments.\n\t\targs = Object.assign(\n\t\t\tparse( url.substr( queryStringIndex + 1 ) ),\n\t\t\targs\n\t\t);\n\n\t\t// Change working base URL to omit previous query arguments.\n\t\tbaseUrl = baseUrl.substr( 0, queryStringIndex );\n\t}\n\n\treturn baseUrl + '?' + stringify( args );\n}\n","import jQuery from 'jquery';\nimport _ from 'underscores';\nimport { dt, ajaxurl } from 'window';\nimport {\n\taddQueryArgs,\n\tisURL,\n\tprependHTTP,\n} from '@wordpress/url';\nimport compareVersions from 'compare-versions';\nimport wp from 'wp';\n\nconst [ body ] = document.getElementsByTagName( 'body' );\nconst externalConnectionUrlField = document.getElementById( 'dt_external_connection_url' );\nconst externalConnectionMetaBox = document.getElementById( 'dt_external_connection_details' );\nconst externalConnectionTypeField = document.getElementById( 'dt_external_connection_type' );\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' );\nconst createConnection = document.getElementById( 'create-connection' );\nconst wpbody = document.getElementById( 'wpbody' );\nconst externalSiteUrlField = document.getElementById( 'dt_external_site_url' );\nconst wizardError = document.getElementsByClassName( 'dt-wizard-error' );\nconst [ wizardStatus ] = document.getElementsByClassName( 'dt-wizard-status' );\nconst authorizeConnectionButton = document.getElementsByClassName( 'establish-connection-button' );\nconst beginOauthConnectionButton = document.getElementById( 'begin-authorization' );\nconst createOauthConnectionButton = document.getElementById( 'create-oauth-connection' );\nconst manualSetupButton = document.getElementsByClassName( 'manual-setup-button' );\nconst titlePrompt = document.getElementById( '#title-prompt-text' );\nconst slug = externalConnectionTypeField.value;\nlet $apiVerify = false;\nwpbody.className = slug;\n\n// Prevent the `enter` key from submitting the form.\njQuery( '#post' ).on( 'keypress', function ( event ) {\n\tif ( 13 != event.which || body.classList.contains( 'post-php' ) ) {\n\t\treturn true;\n\t}\n\n\tif ( 'wp' === jQuery( externalConnectionTypeField ).val() ) {\n\t\tjQuery( authorizeConnectionButton ).trigger( 'click' );\n\t}\n\n\tif ( 'wpdotcom' === jQuery( externalConnectionTypeField ).val() ) {\n\t\t! isHidden( beginOauthConnectionButton ) && jQuery( beginOauthConnectionButton ).trigger( 'click' );\n\t\t! isHidden( createOauthConnectionButton ) && jQuery( createOauthConnectionButton ).trigger( 'click' );\n\t}\n\n\treturn false;\n} );\n\n/**\n * Handle Setup Connection Wizard \"Authorize Connection\" button.\n */\njQuery( authorizeConnectionButton ).on( 'click', ( event ) => {\n\tevent.preventDefault();\n\n\t// Clear any previous errors.\n\tjQuery( wizardError[0] ).text( '' );\n\n\t// Verify Title and Site URL fields are non-empty.\n\tconst validateTitle = validateField( jQuery( titleField ), event );\n\tconst validateURL = validateField( jQuery( externalSiteUrlField ), event );\n\n\tif (\n\t\t! validateTitle ||\n\t\t! validateURL\n\t) {\n\t\tevent.preventDefault();\n\t\treturn false;\n\t}\n\n\tlet siteURL = prependHTTP( externalSiteUrlField.value );\n\tif ( ! isURL( siteURL ) ) {\n\t\tjQuery( wizardError[0] ).text( dt.invalid_url );\n\t\treturn false;\n\t}\n\n\t// Show the spinner and loading message.\n\twizardStatus.style.display = 'block';\n\n\t// Remove wp-json from URL, if that was added\n\tsiteURL = siteURL.replace( /wp-json(\\/)*/, '' );\n\n\t// Ensure URL ends with trailing slash\n\tsiteURL = siteURL.replace( /\\/?$/, '/' );\n\n\tjQuery.ajax( {\n\t\turl: ajaxurl,\n\t\tmethod: 'post',\n\t\tdata: {\n\t\t\tnonce: dt.nonce,\n\t\t\taction: 'dt_get_remote_info',\n\t\t\turl: siteURL\n\t\t}\n\t} ).done( response => {\n\t\twizardStatus.style.display = 'none';\n\n\t\tif ( ! response.success ) {\n\t\t\tif (\n\t\t\t\tObject.prototype.hasOwnProperty.call( response, 'data' )\n\t\t\t\t&& Object.prototype.hasOwnProperty.call( response.data, 'rest_url' )\n\t\t\t\t&& ! Object.prototype.hasOwnProperty.call( response.data, 'version' )\n\t\t\t) {\n\t\t\t\tjQuery( wizardError[0] ).text( dt.no_distributor );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tjQuery( wizardError[0] ).text( dt.noconnection );\n\n\t\t\tif (\n\t\t\t\tObject.prototype.hasOwnProperty.call( response, 'data' )\n\t\t\t\t&& Array.isArray( response.data )\n\t\t\t\t&& 0 < response.data.length\n\t\t\t\t&& Object.prototype.hasOwnProperty.call( response.data[0], 'code' )\n\t\t\t\t&& Object.prototype.hasOwnProperty.call( response.data[0], 'message' )\n\t\t\t) {\n\t\t\t\tjQuery( wizardError[0] ).append( '
' );\n\t\t\t\tresponse.data.forEach( ( error ) => {\n\t\t\t\t\tjQuery( wizardError[0] ).append( `${error.message} ${error.code ? `(${ error.code })` : ''}
` );\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\t// Remove -dev from the version number, if running from the develop branch\n\t\tconst version = response.data.version.replace( /-dev/, '' );\n\n\t\t// Requires Distributor version 1.6.0.\n\t\tif ( compareVersions.compare( version, '1.6.0', '<' ) ) {\n\t\t\tjQuery( wizardError[0] ).text( dt.minversion );\n\t\t\treturn;\n\t\t}\n\n\t\tconst successURL = addQueryArgs( document.location.href,\n\t\t\t{\n\t\t\t\tsetupStatus: 'success',\n\t\t\t\ttitleField: titleField.value,\n\t\t\t\texternalSiteUrlField: siteURL,\n\t\t\t\trestRoot: response.data.rest_url,\n\t\t\t}\n\t\t);\n\n\t\tconst failureURL = addQueryArgs( document.location.href,\n\t\t\t{\n\t\t\t\tsetupStatus: 'failure'\n\t\t\t}\n\t\t);\n\n\t\tconst authURL = addQueryArgs(\n\t\t\t`${ siteURL }wp-admin/admin.php`,\n\t\t\t{\n\t\t\t\tpage: 'auth_app',\n\t\t\t\tapp_name: dt.distributor_from, /*eslint camelcase: 0*/\n\t\t\t\tsuccess_url: encodeURI( successURL ), /*eslint camelcase: 0*/\n\t\t\t\treject_url: encodeURI( failureURL ), /*eslint camelcase: 0*/\n\t\t\t}\n\t\t);\n\t\tdocument.location = authURL;\n\t} );\n\n\treturn false;\n} );\n\n/**\n * Handle Manual Setup Connection button.\n *\n * This hides the wizard box and shows the\n * default fields.\n */\njQuery( manualSetupButton ).on( 'click', ( event ) => {\n\tevent.preventDefault();\n\n\tjQuery( '.external-connection-wizard' ).hide();\n\tjQuery( '.external-connection-setup, .hide-until-authed' ).show();\n} );\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\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\tconst 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( 'button' );\n\t\t\t\t\tsuggestion.classList.add( 'suggest' );\n\t\t\t\t\tsuggestion.classList.add( 'button-link' );\n\t\t\t\t\tsuggestion.setAttribute( 'type', 'button' );\n\t\t\t\t\tsuggestion.innerText = response.data.endpoint_suggestion;\n\n\t\t\t\t\tendpointResult.appendChild( suggestion );\n\n\t\t\t\t\twp.a11y.speak( `${ dt.endpoint_suggestion } ${ response.data.endpoint_suggestion }`, 'polite' );\n\t\t\t\t} else {\n\t\t\t\t\tendpointResult.innerText = dt.bad_connection;\n\n\t\t\t\t\twp.a11y.speak( dt.bad_connection, 'polite' );\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\twp.a11y.speak( `${ dt.limited_connection } ${ dt.no_distributor }`, 'polite' );\n\t\t\t\t\t} else {\n\t\t\t\t\t\twp.a11y.speak( `${ dt.limited_connection }`, 'polite' );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( 'no' === response.data.is_authenticated ) {\n\t\t\t\t\t\twarnings.push( dt.bad_auth );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( 'yes' === response.data.is_authenticated ) {\n\t\t\t\t\t\twarnings.push( dt.no_permissions );\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\n\t\t\t\t\twp.a11y.speak( dt.good_connection, 'polite' );\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\n// Initialize after load.\nsetTimeout( () => {\n\t// Repopulate fields on wizard flow.\n\tconst { wizard_return } = dt;\n\n\tif ( wizard_return ) {\n\t\tif ( '' === titleField.value ) {\n\t\t\tjQuery( titleField ).val( wizard_return.titleField ).focus().blur();\n\t\t\tjQuery( titlePrompt ).empty();\n\t\t}\n\t\tjQuery( usernameField ).val( wizard_return.user_login );\n\t\tjQuery( passwordField ).val( wizard_return.password );\n\t\tjQuery( externalConnectionUrlField ).val( wizard_return.restRoot );\n\t\twpbody.className = 'wizard-return';\n\t\tcreateConnection.click();\n\t}\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( externalConnectionUrlField ).on( 'focus click', event => {\n\tevent.target.setAttribute( 'initial-url', event.target.value );\n} );\n\njQuery( externalConnectionUrlField ).on( 'keyup input', _.debounce( () => {\n\tif ( externalConnectionUrlField.value.replace( /\\/$/, '' ) === externalConnectionUrlField.getAttribute( 'initial-url' ).replace( /\\/$/, '' ) ) {\n\t\treturn;\n\t}\n\n\texternalConnectionUrlField.setAttribute( 'initial-url', externalConnectionUrlField.value );\n\tcheckConnections();\n}, 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( 'focus click', event => {\n\tevent.target.setAttribute( 'initial-username', event.target.value );\n} );\n\njQuery( usernameField ).on( 'keyup input', _.debounce( () => {\n\tif ( usernameField.getAttribute( 'initial-username' ) === usernameField.value ) {\n\t\treturn;\n\t}\n\tif ( changePassword ) {\n\t\tpasswordField.disabled = false;\n\t\tpasswordField.value = '';\n\t\tchangePassword.style.display = 'none';\n\t}\n}, 250 ) );\n\njQuery( passwordField ).on( 'keyup input', _.debounce( () => {\n\tcheckConnections();\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$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\twpbody.className = slug;\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.\nif ( createOauthConnectionButton ) {\n\tjQuery( createOauthConnectionButton ).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 * Check if an element is hidden or not.\n * @param {*} el Element to check.\n */\nfunction isHidden( el ) {\n\treturn ( null === el.offsetParent );\n}\n","/**\n * Determines whether the given string looks like a URL.\n *\n * @param {string} url The string to scrutinise.\n *\n * @example\n * ```js\n * const isURL = isURL( 'https://wordpress.org' ); // true\n * ```\n *\n * @see https://url.spec.whatwg.org/\n * @see https://url.spec.whatwg.org/#valid-url-string\n *\n * @return {boolean} Whether or not it looks like a URL.\n */\nexport function isURL( url ) {\n\t// A URL can be considered value if the `URL` constructor is able to parse\n\t// it. The constructor throws an error for an invalid URL.\n\ttry {\n\t\tnew URL( url );\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n}\n"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/js/admin-pull.min.js b/dist/js/admin-pull.min.js index 26003bd73..f302e1357 100644 --- a/dist/js/admin-pull.min.js +++ b/dist/js/admin-pull.min.js @@ -1,2 +1,2 @@ -!function(e){var t={};function n(o){if(t[o])return t[o].exports;var u=t[o]={i:o,l:!1,exports:{}};return e[o].call(u.exports,u,u.exports,n),u.l=!0,u.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var u in e)n.d(o,u,function(t){return e[t]}.bind(null,u));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=10)}({1:function(e,t){e.exports=jQuery},10:function(e,t,n){"use strict";n.r(t);var o=n(1),u=n.n(o),c=document.getElementById("pull_connections"),r=document.getElementById("pull_post_type"),l=document.getElementById("pull_post_type_submit"),a=document.getElementById("post-search-input"),d=document.getElementById("search-submit"),i=document.getElementById("posts-filter");u()(c).on("change",(function(e){document.location=e.currentTarget.options[e.currentTarget.selectedIndex].getAttribute("data-pull-url"),document.body.className+=" dt-loading"})),c&&r&&i&&(l&&u()(l).on("click",(function(e){e.preventDefault(),document.location=s(),document.body.className+=" dt-loading"})),a&&d&&u()(d).on("click",(function(e){e.preventDefault();var t=a.value;document.location="".concat(s(),"&s=").concat(t),document.body.className+=" dt-loading"})));var s=function(){var e=r.options[r.selectedIndex].value,t=c.options[c.selectedIndex].getAttribute("data-pull-url"),n="new";return-1<" ".concat(i.className," ").indexOf(" status-skipped ")?n="skipped":-1<" ".concat(i.className," ").indexOf(" status-pulled ")&&(n="pulled"),"".concat(t,"&pull_post_type=").concat(e,"&status=").concat(n)}}}); +!function(e){var t={};function n(o){if(t[o])return t[o].exports;var u=t[o]={i:o,l:!1,exports:{}};return e[o].call(u.exports,u,u.exports,n),u.l=!0,u.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var u in e)n.d(o,u,function(t){return e[t]}.bind(null,u));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=11)}({1:function(e,t){e.exports=jQuery},11:function(e,t,n){"use strict";n.r(t);var o=n(1),u=n.n(o),c=document.getElementById("pull_connections"),r=document.getElementById("pull_post_type"),l=document.getElementById("pull_post_type_submit"),a=document.getElementById("post-search-input"),d=document.getElementById("search-submit"),i=document.getElementById("posts-filter");u()(c).on("change",(function(e){document.location=e.currentTarget.options[e.currentTarget.selectedIndex].getAttribute("data-pull-url"),document.body.className+=" dt-loading"})),c&&r&&i&&(l&&u()(l).on("click",(function(e){e.preventDefault(),document.location=s(),document.body.className+=" dt-loading"})),a&&d&&u()(d).on("click",(function(e){e.preventDefault();var t=a.value;document.location="".concat(s(),"&s=").concat(t),document.body.className+=" dt-loading"})));var s=function(){var e=r.options[r.selectedIndex].value,t=c.options[c.selectedIndex].getAttribute("data-pull-url"),n="new";return-1<" ".concat(i.className," ").indexOf(" status-skipped ")?n="skipped":-1<" ".concat(i.className," ").indexOf(" status-pulled ")&&(n="pulled"),"".concat(t,"&pull_post_type=").concat(e,"&status=").concat(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 6af51733a..8c20586ab 100644 --- a/dist/js/admin-pull.min.js.map +++ b/dist/js/admin-pull.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"jQuery\"","webpack:///./assets/js/admin-pull.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","jQuery","chooseConnection","document","getElementById","choosePostType","choosePostTypeBtn","searchField","searchBtn","form","on","event","location","currentTarget","options","selectedIndex","getAttribute","body","className","preventDefault","getURL","search","postType","baseURL","status","indexOf"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EAChF,IAAII,EAAKX,OAAOY,OAAO,MAGvB,GAFA1B,EAAoBkB,EAAEO,GACtBX,OAAOC,eAAeU,EAAI,UAAW,CAAET,YAAY,EAAMK,MAAOA,IACtD,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UrB,EAAiBY,QAASZ,EAAiBa,eAAgBC,aAAc,iBACrFQ,EAAS,MAQb,OANM,EAAI,WAAOf,EAAKS,UAAZ,KAA4BO,QAAS,oBAC9CD,EAAS,WACG,EAAI,WAAOf,EAAKS,UAAZ,KAA4BO,QAAS,qBACrDD,EAAS,UAGV,UAAWD,EAAX,2BAAuCD,EAAvC,mBAA4DE","file":"admin-pull.min.js","sourcesContent":[" \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, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\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\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 10);\n","module.exports = jQuery;","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"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"jQuery\"","webpack:///./assets/js/admin-pull.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","jQuery","chooseConnection","document","getElementById","choosePostType","choosePostTypeBtn","searchField","searchBtn","form","on","event","location","currentTarget","options","selectedIndex","getAttribute","body","className","preventDefault","getURL","search","postType","baseURL","status","indexOf"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxB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,eAAgB,qBACvCI,EAAYL,SAASC,eAAgB,iBACrCK,EAAON,SAASC,eAAgB,gBAEtCH,IAAQC,GAAmBQ,GAAI,UAAU,SAAEC,GAE1CR,SAASS,SAAWD,EAAME,cAAcC,QAAQH,EAAME,cAAcE,eAAeC,aAAc,iBAEjGb,SAASc,KAAKC,WAAa,iBAGvBhB,GAAoBG,GAAkBI,IAErCH,GACJL,IAAQK,GAAoBI,GAAI,SAAS,SAAEC,GAE1CA,EAAMQ,iBAENhB,SAASS,SAAWQ,IAEpBjB,SAASc,KAAKC,WAAa,iBAIxBX,GAAeC,GACnBP,IAAQO,GAAYE,GAAI,SAAS,SAAEC,GAClCA,EAAMQ,iBAEN,IAAME,EAASd,EAAYrB,MAE3BiB,SAASS,SAAT,UAAwBQ,IAAxB,cAAwCC,GAExClB,SAASc,KAAKC,WAAa,kBAU9B,IAAME,EAAS,WACd,IAAME,EAAWjB,EAAeS,QAAST,EAAeU,eAAgB7B,MAClEqC,EAAUrB,EAAiBY,QAASZ,EAAiBa,eAAgBC,aAAc,iBACrFQ,EAAS,MAQb,OANM,EAAI,WAAOf,EAAKS,UAAZ,KAA4BO,QAAS,oBAC9CD,EAAS,WACG,EAAI,WAAOf,EAAKS,UAAZ,KAA4BO,QAAS,qBACrDD,EAAS,UAGV,UAAWD,EAAX,2BAAuCD,EAAvC,mBAA4DE","file":"admin-pull.min.js","sourcesContent":[" \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, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\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\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 11);\n","module.exports = jQuery;","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"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/js/gutenberg-status-plugin.min.js b/dist/js/gutenberg-status-plugin.min.js index 1049e9b4e..70e1c3ce1 100644 --- a/dist/js/gutenberg-status-plugin.min.js +++ b/dist/js/gutenberg-status-plugin.min.js @@ -1,2 +1,2 @@ -!function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=14)}({0:function(t,e){t.exports=window},14:function(t,e,n){"use strict";n.r(e);var r=n(0);if(void 0!==r.wp.editPost.PluginPostStatusInfo){var i=r.wp.plugins.registerPlugin,o=r.wp.i18n.__,u=r.wp.editPost.PluginPostStatusInfo;0 {\n\t\treturn(\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t{ __( 'Distributed on: ' ) }\n\t\t\t\t\t { dtGutenberg.syndicationTime } \n\t\t\t\t\n\t\t\t\n\t\t);\n\t};\n\n\t/**\n\t * Render the distributed to component.\n\t */\n\tconst renderDistributedTo = () => {\n\t\treturn(\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t{ wp.i18n.sprintf( wp.i18n.__( 'Distributed to %1$s connection%2$s.', 'distributor' ),\n\t\t\t\t\t\tdtGutenberg.syndicationCount,\n\t\t\t\t\t\t'1' === dtGutenberg.syndicationCount ? '' : 's' ) }\n\t\t\t\t\n\t\t\t\n\t\t);\n\t};\n\n\tif ( 0 < parseInt( dtGutenberg.syndicationCount ) ) {\n\t\tregisterPlugin( 'distributor-status-panel', { render: renderDistributedTo } );\n\t} else if ( 0 !== parseInt( dtGutenberg.syndicationTime ) ) {\n\t\tregisterPlugin( 'distributor-status-panel', { render: renderDistributedFrom } );\n\t}\n}\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"window\"","webpack:///./assets/js/gutenberg-status-plugin.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","window","wp","editPost","PluginPostStatusInfo","registerPlugin","plugins","__","i18n","parseInt","dtGutenberg","syndicationCount","render","id","sprintf","syndicationTime"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,G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,4BAAMS,GAAG,oBACNN,EAAI,oBACN,sCAAWG,cAAYK,gBAAvB","file":"gutenberg-status-plugin.min.js","sourcesContent":[" \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, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\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\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 15);\n","module.exports = window;","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\n\t\t\t\t\n\t\t\t\t\t{ __( 'Distributed on: ' ) }\n\t\t\t\t\t { dtGutenberg.syndicationTime } \n\t\t\t\t\n\t\t\t\n\t\t);\n\t};\n\n\t/**\n\t * Render the distributed to component.\n\t */\n\tconst renderDistributedTo = () => {\n\t\treturn(\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t{ wp.i18n.sprintf( wp.i18n.__( 'Distributed to %1$s connection%2$s.', 'distributor' ),\n\t\t\t\t\t\tdtGutenberg.syndicationCount,\n\t\t\t\t\t\t'1' === dtGutenberg.syndicationCount ? '' : 's' ) }\n\t\t\t\t\n\t\t\t\n\t\t);\n\t};\n\n\tif ( 0 < parseInt( dtGutenberg.syndicationCount ) ) {\n\t\tregisterPlugin( 'distributor-status-panel', { render: renderDistributedTo } );\n\t} else if ( 0 !== parseInt( dtGutenberg.syndicationTime ) ) {\n\t\tregisterPlugin( 'distributor-status-panel', { render: renderDistributedFrom } );\n\t}\n}\n"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/js/gutenberg-syndicated-post.min.js b/dist/js/gutenberg-syndicated-post.min.js index f969a9e1f..8efda3d96 100644 --- a/dist/js/gutenberg-syndicated-post.min.js +++ b/dist/js/gutenberg-syndicated-post.min.js @@ -1,2 +1,2 @@ -!function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=13)}({0:function(e,t){e.exports=window},13:function(e,t,r){"use strict";r.r(t);var n=r(0);if(n.wp.i18n.setLocaleData(n.dtGutenberg.i18n,"distributor"),"0"!==n.dtGutenberg.originalSourceId||"0"!==n.dtGutenberg.originalBlogId){var i="",o=[];parseInt(n.dtGutenberg.originalDelete)?i=n.wp.i18n.sprintf(n.wp.i18n.__("This %1$s was distributed from %2$s. However, the original has been deleted."),n.dtGutenberg.postTypeSingular,n.dtGutenberg.originalLocationName):parseInt(n.dtGutenberg.unlinked)?(i=n.wp.i18n.sprintf(n.wp.i18n.__("Originally distributed from %1$s. This %2$s has been unlinked from the original. However, you can always","distributor"),n.dtGutenberg.originalLocationName,n.dtGutenberg.postTypeSingular),o.push({label:n.wp.i18n.__("restore it.","distributor"),url:n.dtGutenberg.linkNonceUrl}),o.push({label:n.wp.i18n.__("View Original","distributor"),url:n.dtGutenberg.postUrl})):(i=n.wp.i18n.sprintf(n.wp.i18n.__("Distributed from %s. The original will update this unless you","distributor"),n.dtGutenberg.originalLocationName),o.push({label:n.wp.i18n.__("unlink from original.","distributor"),url:n.dtGutenberg.unlinkNonceUrl}),o.push({label:n.wp.i18n.__("View Original","distributor"),url:n.dtGutenberg.postUrl})),n.wp.data.dispatch("core/notices").createWarningNotice(i,{id:"distributor-notice",actions:o})}}}); +!function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=14)}({0:function(e,t){e.exports=window},14:function(e,t,r){"use strict";r.r(t);var n=r(0);if(n.wp.i18n.setLocaleData(n.dtGutenberg.i18n,"distributor"),"0"!==n.dtGutenberg.originalSourceId||"0"!==n.dtGutenberg.originalBlogId){var i="",o=[];parseInt(n.dtGutenberg.originalDelete)?i=n.wp.i18n.sprintf(n.wp.i18n.__("This %1$s was distributed from %2$s. However, the original has been deleted."),n.dtGutenberg.postTypeSingular,n.dtGutenberg.originalLocationName):parseInt(n.dtGutenberg.unlinked)?(i=n.wp.i18n.sprintf(n.wp.i18n.__("Originally distributed from %1$s. This %2$s has been unlinked from the original. However, you can always","distributor"),n.dtGutenberg.originalLocationName,n.dtGutenberg.postTypeSingular),o.push({label:n.wp.i18n.__("restore it.","distributor"),url:n.dtGutenberg.linkNonceUrl}),o.push({label:n.wp.i18n.__("View Original","distributor"),url:n.dtGutenberg.postUrl})):(i=n.wp.i18n.sprintf(n.wp.i18n.__("Distributed from %s. The original will update this unless you","distributor"),n.dtGutenberg.originalLocationName),o.push({label:n.wp.i18n.__("unlink from original.","distributor"),url:n.dtGutenberg.unlinkNonceUrl}),o.push({label:n.wp.i18n.__("View Original","distributor"),url:n.dtGutenberg.postUrl})),n.wp.data.dispatch("core/notices").createWarningNotice(i,{id:"distributor-notice",actions:o})}}}); //# sourceMappingURL=gutenberg-syndicated-post.min.js.map \ No newline at end of file diff --git a/dist/js/gutenberg-syndicated-post.min.js.map b/dist/js/gutenberg-syndicated-post.min.js.map index 3e0392b85..820c82759 100644 --- a/dist/js/gutenberg-syndicated-post.min.js.map +++ b/dist/js/gutenberg-syndicated-post.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"window\"","webpack:///./assets/js/gutenberg-syndicated-post.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","window","wp","i18n","setLocaleData","dtGutenberg","originalSourceId","originalBlogId","message","actions","parseInt","originalDelete","sprintf","__","postTypeSingular","originalLocationName","unlinked","push","label","url","linkNonceUrl","postUrl","unlinkNonceUrl","data","dispatch","createWarningNotice","id"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAo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AAI,SAASiB,EAAQC,GAAY,OAAOjB,OAAOkB,UAAUC,eAAe1B,KAAKuB,EAAQC,IAGzG/B,EAAoBkC,EAAI,GAIjBlC,EAAoBA,EAAoBmC,EAAI,I,kBClFrDhC,EAAOD,QAAUkC,Q,gCCAjB,kBAKA,GAFAC,KAAGC,KAAKC,cAAeC,cAAYF,KAAM,eAEpC,MAAQE,cAAYC,kBAAoB,MAAQD,cAAYE,eAAiB,CAEjF,IAAIC,EAAU,GACRC,EAAU,GAEXC,SAAUL,cAAYM,gBAC1BH,EAAUN,KAAGC,KAAKS,QAASV,KAAGC,KAAKU,GAAI,gFAAkFR,cAAYS,iBAAkBT,cAAYU,sBACtJL,SAAUL,cAAYW,WAenCR,EAAUN,KAAGC,KAAKS,QAASV,KAAGC,KAAKU,GAAI,2GAA4G,eAAiBR,cAAYU,qBAAsBV,cAAYS,kBAElNL,EAAQQ,KAAM,CACbC,MAAOhB,KAAGC,KAAMU,GAAI,cAAe,eACnCM,IAAKd,cAAYe,eAGlBX,EAAQQ,KAAM,CACbC,MAAOhB,KAAGC,KAAMU,GAAI,gBAAiB,eACrCM,IAAKd,cAAYgB,YAvBlBb,EAAUN,KAAGC,KAAKS,QAASV,KAAGC,KAAKU,GAAI,gEAAiE,eAAiBR,cAAYU,sBAErIN,EAAQQ,KAAM,CACbC,MAAOhB,KAAGC,KAAMU,GAAI,wBAAyB,eAC7CM,IAAKd,cAAYiB,iBAGlBb,EAAQQ,KAAM,CACbC,MAAOhB,KAAGC,KAAKU,GAAI,gBAAiB,eACpCM,IAAKd,cAAYgB,WAkBnBnB,KAAGqB,KAAKC,SAAU,gBAAiBC,oBAAqBjB,EAAS,CAChEkB,GAAI,qBACJjB","file":"gutenberg-syndicated-post.min.js","sourcesContent":[" \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, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\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\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 13);\n","module.exports = window;","import { wp, dtGutenberg } from 'window';\n\n\nwp.i18n.setLocaleData( dtGutenberg.i18n, 'distributor' );\n\nif ( '0' !== dtGutenberg.originalSourceId || '0' !== dtGutenberg.originalBlogId ) {\n\n\tlet message = '';\n\tconst actions = [];\n\n\tif ( parseInt( dtGutenberg.originalDelete ) ) {\n\t\tmessage = wp.i18n.sprintf( wp.i18n.__( 'This %1$s was distributed from %2$s. However, the original has been deleted.' ), dtGutenberg.postTypeSingular, dtGutenberg.originalLocationName );\n\t} else if ( ! parseInt( dtGutenberg.unlinked ) ) {\n\t\tmessage = wp.i18n.sprintf( wp.i18n.__( 'Distributed from %s. The original will update this unless you', 'distributor' ), dtGutenberg.originalLocationName );\n\n\t\tactions.push( {\n\t\t\tlabel: wp.i18n. __( 'unlink from original.', 'distributor' ),\n\t\t\turl: dtGutenberg.unlinkNonceUrl\n\t\t} );\n\n\t\tactions.push( {\n\t\t\tlabel: wp.i18n.__( 'View Original', 'distributor' ),\n\t\t\turl: dtGutenberg.postUrl,\n\t\t} );\n\n\n\t} else {\n\t\tmessage = wp.i18n.sprintf( wp.i18n.__( 'Originally distributed from %1$s. This %2$s has been unlinked from the original. However, you can always', 'distributor' ), dtGutenberg.originalLocationName, dtGutenberg.postTypeSingular );\n\n\t\tactions.push( {\n\t\t\tlabel: wp.i18n. __( 'restore it.', 'distributor' ),\n\t\t\turl: dtGutenberg.linkNonceUrl\n\t\t} );\n\n\t\tactions.push( {\n\t\t\tlabel: wp.i18n. __( 'View Original', 'distributor' ),\n\t\t\turl: dtGutenberg.postUrl\n\t\t} );\n\t}\n\n\twp.data.dispatch( 'core/notices' ).createWarningNotice( message, {\n\t\tid: 'distributor-notice',\n\t\tactions,\n\t} );\n}\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"window\"","webpack:///./assets/js/gutenberg-syndicated-post.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","window","wp","i18n","setLocaleData","dtGutenberg","originalSourceId","originalBlogId","message","actions","parseInt","originalDelete","sprintf","__","postTypeSingular","originalLocationName","unlinked","push","label","url","linkNonceUrl","postUrl","unlinkNonceUrl","data","dispatch","createWarningNotice","id"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA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Bb,EAAUN,KAAGC,KAAKS,QAASV,KAAGC,KAAKU,GAAI,gEAAiE,eAAiBR,cAAYU,sBAErIN,EAAQQ,KAAM,CACbC,MAAOhB,KAAGC,KAAMU,GAAI,wBAAyB,eAC7CM,IAAKd,cAAYiB,iBAGlBb,EAAQQ,KAAM,CACbC,MAAOhB,KAAGC,KAAKU,GAAI,gBAAiB,eACpCM,IAAKd,cAAYgB,WAkBnBnB,KAAGqB,KAAKC,SAAU,gBAAiBC,oBAAqBjB,EAAS,CAChEkB,GAAI,qBACJjB","file":"gutenberg-syndicated-post.min.js","sourcesContent":[" \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, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\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\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 14);\n","module.exports = window;","import { wp, dtGutenberg } from 'window';\n\n\nwp.i18n.setLocaleData( dtGutenberg.i18n, 'distributor' );\n\nif ( '0' !== dtGutenberg.originalSourceId || '0' !== dtGutenberg.originalBlogId ) {\n\n\tlet message = '';\n\tconst actions = [];\n\n\tif ( parseInt( dtGutenberg.originalDelete ) ) {\n\t\tmessage = wp.i18n.sprintf( wp.i18n.__( 'This %1$s was distributed from %2$s. However, the original has been deleted.' ), dtGutenberg.postTypeSingular, dtGutenberg.originalLocationName );\n\t} else if ( ! parseInt( dtGutenberg.unlinked ) ) {\n\t\tmessage = wp.i18n.sprintf( wp.i18n.__( 'Distributed from %s. The original will update this unless you', 'distributor' ), dtGutenberg.originalLocationName );\n\n\t\tactions.push( {\n\t\t\tlabel: wp.i18n. __( 'unlink from original.', 'distributor' ),\n\t\t\turl: dtGutenberg.unlinkNonceUrl\n\t\t} );\n\n\t\tactions.push( {\n\t\t\tlabel: wp.i18n.__( 'View Original', 'distributor' ),\n\t\t\turl: dtGutenberg.postUrl,\n\t\t} );\n\n\n\t} else {\n\t\tmessage = wp.i18n.sprintf( wp.i18n.__( 'Originally distributed from %1$s. This %2$s has been unlinked from the original. However, you can always', 'distributor' ), dtGutenberg.originalLocationName, dtGutenberg.postTypeSingular );\n\n\t\tactions.push( {\n\t\t\tlabel: wp.i18n. __( 'restore it.', 'distributor' ),\n\t\t\turl: dtGutenberg.linkNonceUrl\n\t\t} );\n\n\t\tactions.push( {\n\t\t\tlabel: wp.i18n. __( 'View Original', 'distributor' ),\n\t\t\turl: dtGutenberg.postUrl\n\t\t} );\n\t}\n\n\twp.data.dispatch( 'core/notices' ).createWarningNotice( message, {\n\t\tid: 'distributor-notice',\n\t\tactions,\n\t} );\n}\n"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/js/push.min.js b/dist/js/push.min.js index 5d5f25173..d53f36d08 100644 --- a/dist/js/push.min.js +++ b/dist/js/push.min.js @@ -1,2 +1,6 @@ -!function(e){var t={};function n(a){if(t[a])return t[a].exports;var o=t[a]={i:a,l:!1,exports:{}};return e[a].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(a,o,function(t){return e[t]}.bind(null,o));return a},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=12)}({0:function(e,t){e.exports=window},1:function(e,t){e.exports=jQuery},12:function(e,t,n){"use strict";n.r(t);var a=n(1),o=n.n(a),c=n(2),r=n.n(c),i=n(0),s={},d="",l=r.a.memoize((function(e){var t=document.getElementById(e);if(!t)return!1;return r.a.template(t.innerHTML,null,{evaluate:/<#([\s\S]+?)#>/g,interpolate:/{{{([\s\S]+?)}}}/g,escape:/{{([^}]+?)}}(?!})/g})}));o()(window).on("load",(function(){var e=document.querySelector("#wp-admin-bar-distributor > a"),t=document.querySelector("#wp-admin-bar-distributor"),n=document.querySelector("#wp-admin-bar-distributor #wp-admin-bar-distributor-placeholder"),a=document.querySelector("#distributor-push-wrapper");if(n&&a){var c="",u="",p="",m="",f="",v="",y="",b="",g="",L="",h="";n.appendChild(a),e.addEventListener("keydown",(function(e){13===e.keyCode&&x()}),!1),e.addEventListener("touchstart",x,!1),e.addEventListener("mouseenter",x,!1),o()(a).on("click",".syndicate-button",(function(){if(!t.classList.contains("syncing")){t.classList.add("syncing");var e={action:"dt_push",nonce:i.dt.nonce,connections:s,postId:i.dt.postId};e.postStatus=null!==h&&h.checked?"draft":L.value;var n=!!i.dt.usexhr&&{withCredentials:!0};o.a.ajax({url:i.dt.ajaxurl,xhrFields:n,method:"post",data:e}).done((function(e){setTimeout((function(){var n,o;(t.classList.remove("syncing"),e.data&&e.data.results)?(n=e.data.results,o=!1,["internal","external"].map((function(e){r.a.each(n[e],(function(t,n){"fail"===t.status?o=!0:c["".concat(e).concat(n)].syndicated=t.url}))})),o?T():(a.classList.add("message-success"),u.classList.add("empty"),p.innerText="",setTimeout((function(){a.classList.remove("message-success")}),6e3)),s={},w()):T()}),500)})).error((function(){setTimeout((function(){t.classList.remove("syncing"),T()}),500)}))}})),o()(a).on("click",".add-connection",(function(e){if("A"!==e.target.nodeName&&(e.preventDefault(),!e.currentTarget.classList.contains("syndicated")))if(e.currentTarget.classList.contains("added")){var t=e.currentTarget.getAttribute("data-connection-type"),n=e.currentTarget.getAttribute("data-connection-id"),a=p.querySelector('[data-connection-id="'.concat(n,'"][data-connection-type="').concat(t,'"]'));a.parentNode.removeChild(a),delete s[t+n],y.classList.contains("unavailable")&&C("all"),Object.keys(s).length||(C("addEmpty"),C("noneUnavailable")),w()}else{var o=e.currentTarget.getAttribute("data-connection-type"),r=e.currentTarget.getAttribute("data-connection-id");s[o+r]=c[o+r];var i=e.currentTarget.cloneNode(!0),d=document.createElement("span");d.classList.add("remove-connection"),i.appendChild(d),i.classList="added-connection",p.appendChild(i),b.classList.contains("unavailable")&&(C("removeEmpty"),C("none")),Object.keys(s).length==v&&C("allUnavailable"),w()}})),o()(a).on("click",".selectall-connections",(function(){o()(m).children(".add-connection").each((function(e,t){if(!t.classList.contains("syndicated")&&!t.classList.contains("added")){var n=t.getAttribute("data-connection-type"),a=t.getAttribute("data-connection-id");s[n+a]=c[n+a];var o=t.cloneNode();o.innerText=t.innerText;var r=document.createElement("span");r.classList.add("remove-connection"),o.appendChild(r),o.classList="added-connection",p.appendChild(o),""!==v&&(C("removeEmpty"),C("allUnavailable"),C("none"))}})),w()})),o()(a).on("click",".selectno-connections",(function(){for(;p.firstChild;){var e=p.firstChild.getAttribute("data-connection-type"),t=p.firstChild.getAttribute("data-connection-id");delete s[e+t],p.removeChild(p.firstChild)}""!==v&&(C("addEmpty"),C("noneUnavailable"),C("all")),w()})),o()(a).on("click",".added-connection",(function(e){e.currentTarget.parentNode.removeChild(e.currentTarget);var t=e.currentTarget.getAttribute("data-connection-type"),n=e.currentTarget.getAttribute("data-connection-id");delete s[t+n],y.classList.contains("unavailable")&&C("all"),Object.keys(s).length||(C("addEmpty"),C("noneUnavailable")),w()}))}function T(){a.classList.add("message-error"),setTimeout((function(){a.classList.remove("message-error")}),6e3)}function w(){m.innerText="",r.a.each(c,(function(e){if(""!==d){var t=e.name.replace(/[^0-9a-zA-Z ]+/,"").toLowerCase().match(d.toLowerCase()),n=e.url.replace(/https?:\/\//i,"").replace(/www/i,"").replace(/[^0-9a-zA-Z ]+/,"").toLowerCase().match(d.toLowerCase());if(!t&&!n)return}var a=l("dt-add-connection")({connection:e,selectedConnections:s});m.innerHTML+=a})),""===m.innerHTML&&(m.innerHTML='

No results

')}function C(e){switch(e){case"addEmpty":u.classList.add("empty");break;case"removeEmpty":u.classList.remove("empty");break;case"allUnavailable":y.classList.add("unavailable");break;case"all":y.classList.remove("unavailable");break;case"noneUnavailable":b.classList.add("unavailable");break;case"none":b.classList.remove("unavailable")}}function x(){if(n.focus(),!a.classList.contains("loaded")){a.classList.remove("message-error"),a.classList.add("loaded");var e={action:"dt_load_connections",loadConnectionsNonce:i.dt.loadConnectionsNonce,postId:i.dt.postId},t=!!i.dt.usexhr&&{withCredentials:!0};o.a.ajax({url:i.dt.ajaxurl,xhrFields:t,method:"post",data:e}).done((function(e){if(!e.success||!e.data)return a.classList.remove("loaded"),void a.classList.add("message-error");c=e.data,a.innerHTML=l("dt-show-connections")({connections:c}),u=a.querySelector(".connections-selected"),p=a.querySelector(".selected-connections-list"),m=a.querySelector(".new-connections-list"),y=a.querySelector(".selectall-connections"),b=a.querySelector(".selectno-connections"),g=document.getElementById("dt-connection-search"),L=document.getElementById("dt-post-status"),h=document.getElementById("dt-as-draft"),null!==m&&(f=m.querySelectorAll(".add-connection")),o()(g).on("keyup change",r.a.debounce((function(e){""===e.currentTarget.value&&w(),d=e.currentTarget.value.replace(/https?:\/\//i,"").replace(/www/i,"").replace(/[^0-9a-zA-Z ]+/,""),w()}),300)),r.a.each(f,(function(e){e.classList.contains("syndicated")||(y.classList.remove("unavailable"),v++)}))})).error((function(){a.classList.remove("loaded"),a.classList.add("message-error")}))}}}))},2:function(e,t){e.exports=_}}); +!function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=13)}([function(e,t){e.exports=window},function(e,t){e.exports=jQuery},function(e,t){e.exports=_},,function(e,t,n){e.exports=function(){"use strict"; +/*! + * mustache.js - Logic-less {{mustache}} templates with JavaScript + * http://github.com/janl/mustache.js + */var e=Object.prototype.toString,t=Array.isArray||function(t){return"[object Array]"===e.call(t)};function n(e){return"function"==typeof e}function r(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function a(e,t){return null!=e&&"object"==typeof e&&t in e}var o=RegExp.prototype.test,i=/\S/;function c(e){return!function(e,t){return o.call(e,t)}(i,e)}var s={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="},l=/\s*/,u=/\s+/,d=/\s*=/,p=/\s*\}/,f=/#|\^|\/|>|\{|&|=|!/;function h(e){this.string=e,this.tail=e,this.pos=0}function v(e,t){this.view=e,this.cache={".":this.view},this.parent=t}function m(){this.templateCache={_cache:{},set:function(e,t){this._cache[e]=t},get:function(e){return this._cache[e]},clear:function(){this._cache={}}}}h.prototype.eos=function(){return""===this.tail},h.prototype.scan=function(e){var t=this.tail.match(e);if(!t||0!==t.index)return"";var n=t[0];return this.tail=this.tail.substring(n.length),this.pos+=n.length,n},h.prototype.scanUntil=function(e){var t,n=this.tail.search(e);switch(n){case-1:t=this.tail,this.tail="";break;case 0:t="";break;default:t=this.tail.substring(0,n),this.tail=this.tail.substring(n)}return this.pos+=t.length,t},v.prototype.push=function(e){return new v(e,this)},v.prototype.lookup=function(e){var t,r,o,i=this.cache;if(i.hasOwnProperty(e))t=i[e];else{for(var c,s,l,u=this,d=!1;u;){if(e.indexOf(".")>0)for(c=u.view,s=e.split("."),l=0;null!=c&&l0?a[a.length-1][4]:n;break;default:r.push(t)}return n}(function(e){for(var t,n,r=[],a=0,o=e.length;a"===i?c=this.renderPartial(o,t,n,a):"&"===i?c=this.unescapedValue(o,t):"name"===i?c=this.escapedValue(o,t):"text"===i&&(c=this.rawValue(o)),void 0!==c&&(s+=c);return s},m.prototype.renderSection=function(e,r,a,o){var i=this,c="",s=r.lookup(e[1]);if(s){if(t(s))for(var l=0,u=s.length;l0||!n)&&(a[o]=r+a[o]);return a.join("\n")},m.prototype.renderPartial=function(e,t,r,a){if(r){var o=n(r)?r(e[1]):r[e[1]];if(null!=o){var i=e[6],c=e[5],s=e[4],l=o;return 0==c&&s&&(l=this.indentPartial(o,s,i)),this.renderTokens(this.parse(l,a),t,r,l,a)}}},m.prototype.unescapedValue=function(e,t){var n=t.lookup(e[1]);if(null!=n)return n},m.prototype.escapedValue=function(e,t){var n=t.lookup(e[1]);if(null!=n)return g.escape(n)},m.prototype.rawValue=function(e){return e[1]};var g={name:"mustache.js",version:"4.0.1",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(e){y.templateCache=e},get templateCache(){return y.templateCache}},y=new m;return g.clearCache=function(){return y.clearCache()},g.parse=function(e,t){return y.parse(e,t)},g.render=function(e,n,r,a){if("string"!=typeof e)throw new TypeError('Invalid template! Template should be a "string" but "'+(t(o=e)?"array":typeof o)+'" was given as the first argument for mustache#render(template, view, partials)');var o;return y.render(e,n,r,a)},g.escape=function(e){return String(e).replace(/[&<>"'`=\/]/g,(function(e){return s[e]}))},g.Scanner=h,g.Context=v,g.Writer=m,g}()},,,,,,,,,function(e,t,n){"use strict";n.r(t);var r=n(1),a=n.n(r),o=n(2),i=n.n(o),c=n(0),s=n(4),l=n.n(s),u={},d="",p=i.a.memoize((function(e){var t=document.getElementById(e);if(!t)return!1;if(t.attributes.template)return l.a.parse(t.innerHTML),"mustache";return i.a.template(t.innerHTML,null,{evaluate:/<#([\s\S]+?)#>/g,interpolate:/{{{([\s\S]+?)}}}/g,escape:/{{([^}]+?)}}(?!})/g})}));a()(window).on("load",(function(){var e=document.querySelector("#wp-admin-bar-distributor > a"),t=document.querySelector("#wp-admin-bar-distributor"),n=document.querySelector("#wp-admin-bar-distributor #wp-admin-bar-distributor-placeholder"),r=document.querySelector("#distributor-push-wrapper");if(n&&r){var o="",s="",f="",h="",v="",m="",g="",y="",b="",w="",L="",T="";n.appendChild(r),e.addEventListener("keydown",(function(e){13===e.keyCode&&S()}),!1),e.addEventListener("touchstart",S,!1),e.addEventListener("mouseenter",S,!1),a()(r).on("click",".syndicate-button",(function(){if(!t.classList.contains("syncing")){t.classList.add("syncing");var e={action:"dt_push",nonce:c.dt.nonce,connections:u,postId:c.dt.postId};e.postStatus=null!==L&&L.checked?"draft":w.value;var n=!!c.dt.usexhr&&{withCredentials:!0};a.a.ajax({url:c.dt.ajaxurl,xhrFields:n,method:"post",data:e}).done((function(e){setTimeout((function(){var n,a,l;(t.classList.remove("syncing"),e.success)?e.data&&e.data.results?(n=e.data.results,a=!1,l={},["internal","external"].map((function(e){i.a.each(n[e],(function(t,n){"success"===t.status&&(o["".concat(e).concat(n)].syndicated=t.url,a=!0),i.a.isEmpty(t.errors)||(l["".concat(e).concat(n)]=t.errors)}))})),i.a.isEmpty(l)||C(i.a.map(l,(function(e,t){return"".concat(o[t].name,":\n").concat(i.a.map(e,(function(e){return"- ".concat(e,"\n")})))}))),a&&i.a.isEmpty(l)&&(r.classList.add("message-success"),s.classList.add("empty"),f.innerText="",setTimeout((function(){r.classList.remove("message-success")}),6e3)),u={},k()):C(c.dt.messages.empty_result):C(e.data)}),500)})).error((function(e,n,r){setTimeout((function(){t.classList.remove("syncing"),C("".concat(c.dt.messages.ajax_error," ").concat(r))}),500)}))}})),a()(r).on("click",".add-connection",(function(e){if("A"!==e.target.nodeName&&(e.preventDefault(),!e.currentTarget.classList.contains("syndicated")))if(e.currentTarget.classList.contains("added")){var t=e.currentTarget.getAttribute("data-connection-type"),n=e.currentTarget.getAttribute("data-connection-id"),r=f.querySelector('[data-connection-id="'.concat(n,'"][data-connection-type="').concat(t,'"]'));r.parentNode.removeChild(r),delete u[t+n],g.classList.contains("unavailable")&&E("all"),Object.keys(u).length||(E("addEmpty"),E("noneUnavailable")),k()}else{var a=e.currentTarget.getAttribute("data-connection-type"),i=e.currentTarget.getAttribute("data-connection-id");u[a+i]=o[a+i];var c=e.currentTarget.cloneNode(!0),s=document.createElement("span");s.classList.add("remove-connection"),c.appendChild(s),c.classList="added-connection",f.appendChild(c),y.classList.contains("unavailable")&&(E("removeEmpty"),E("none")),Object.keys(u).length==m&&E("allUnavailable"),k()}})),a()(r).on("click",".selectall-connections",(function(){a()(h).children(".add-connection").each((function(e,t){if(!t.classList.contains("syndicated")&&!t.classList.contains("added")){var n=t.getAttribute("data-connection-type"),r=t.getAttribute("data-connection-id");u[n+r]=o[n+r];var a=t.cloneNode();a.innerText=t.innerText;var i=document.createElement("span");i.classList.add("remove-connection"),a.appendChild(i),a.classList="added-connection",f.appendChild(a),""!==m&&(E("removeEmpty"),E("allUnavailable"),E("none"))}})),k()})),a()(r).on("click",".selectno-connections",(function(){for(;f.firstChild;){var e=f.firstChild.getAttribute("data-connection-type"),t=f.firstChild.getAttribute("data-connection-id");delete u[e+t],f.removeChild(f.firstChild)}""!==m&&(E("addEmpty"),E("noneUnavailable"),E("all")),k()})),a()(r).on("click",".added-connection",(function(e){e.currentTarget.parentNode.removeChild(e.currentTarget);var t=e.currentTarget.getAttribute("data-connection-type"),n=e.currentTarget.getAttribute("data-connection-id");delete u[t+n],g.classList.contains("unavailable")&&E("all"),Object.keys(u).length||(E("addEmpty"),E("noneUnavailable")),k()}))}function x(){null!==(h=r.querySelector(".new-connections-list"))&&(v=h.querySelectorAll(".add-connection"),i.a.each(v,(function(e){e.classList.contains("syndicated")&&(e.disabled=!0)})))}function C(e){r.classList.add("message-error"),T.innerText="",i.a.each(function(e){if(!i.a.isArray(e))return[e];return i.a.map(e,(function(e){return i.a.isString(e)?e:i.a.has(e,"message")?e.message:void 0}))}(e),(function(e){var t=document.createElement("li");t.innerText=e,T.appendChild(t)}))}function k(){h.innerText="";var e=p("dt-add-connection"),t="";i.a.each(o,(function(n){if(""!==d){var r=n.name.replace(/[^0-9a-zA-Z ]+/,"").toLowerCase().match(d.toLowerCase()),a=n.url.replace(/https?:\/\//i,"").replace(/www/i,"").replace(/[^0-9a-zA-Z ]+/,"").toLowerCase().match(d.toLowerCase());if(!r&&!a)return}"mustache"===e?(u[n.type+n.id]?n.added=!0:n.added=!1,"internal"===n.type&&(n.internal=!0),t=l.a.render(document.getElementById("dt-add-connection").innerHTML,{connection:n})):t=e({connection:n,selectedConnections:u}),h.innerHTML+=t})),""===h.innerHTML&&(h.innerHTML='

No results

'),"mustache"===e&&x()}function E(e){switch(e){case"addEmpty":s.classList.add("empty");break;case"removeEmpty":s.classList.remove("empty");break;case"allUnavailable":g.classList.add("unavailable");break;case"all":g.classList.remove("unavailable");break;case"noneUnavailable":y.classList.add("unavailable");break;case"none":y.classList.remove("unavailable")}}function S(){if(n.focus(),!r.classList.contains("loaded")){r.classList.remove("message-error"),r.classList.add("loaded");var e={action:"dt_load_connections",loadConnectionsNonce:c.dt.loadConnectionsNonce,postId:c.dt.postId},t=p("dt-show-connections"),u=!!c.dt.usexhr&&{withCredentials:!0};a.a.ajax({url:c.dt.ajaxurl,xhrFields:u,method:"post",data:e}).done((function(e){if(!e.success||!e.data)return r.classList.remove("loaded"),void r.classList.add("message-error");if(o=e.data,"mustache"===t){var n={connections:[]};i.a.each(o,(function(e){"internal"===e.type&&(e.internal=!0),n.connections.push(e)})),r.innerHTML=l.a.render(document.getElementById("dt-show-connections").innerHTML,{connections:n.connections,foundConnections:n.connections.length,showSearch:5 {\n\tconst element = document.getElementById( id );\n\tif ( ! element ) {\n\t\treturn false;\n\t}\n\n\t// Use WordPress style Backbone template syntax\n\tconst options = {\n\t\tevaluate: /<#([\\s\\S]+?)#>/g,\n\t\tinterpolate: /{{{([\\s\\S]+?)}}}/g,\n\t\tescape: /{{([^}]+?)}}(?!})/g\n\t};\n\n\treturn _.template( element.innerHTML, null, options );\n} );\n\njQuery( window ).on( 'load', () => {\n\tconst distributorAdminItem = document.querySelector( '#wp-admin-bar-distributor > a' );\n\tconst distributorTopMenu = document.querySelector( '#wp-admin-bar-distributor' );\n\tconst distributorMenuItem = document.querySelector( '#wp-admin-bar-distributor #wp-admin-bar-distributor-placeholder' );\n\tconst distributorPushWrapper = document.querySelector( '#distributor-push-wrapper' );\n\n\tif ( ! distributorMenuItem || ! distributorPushWrapper ) {\n\t\treturn;\n\t}\n\n\tlet dtConnections \t\t= '';\n\tlet connectionsSelected \t\t= '';\n\tlet connectionsSelectedList \t\t= '';\n\tlet connectionsNewList \t\t= '';\n\tlet connectionsNewListChildren \t= '';\n\tlet connectionsAvailableTotal\t\t= '';\n\tlet selectAllConnections \t\t\t= '';\n\tlet selectNoConnections\t\t\t\t= '';\n\tlet connectionsSearchInput \t\t= '';\n\tlet postStatusInput \t\t= '';\n\tlet asDraftInput \t\t= '';\n\n\tdistributorMenuItem.appendChild( distributorPushWrapper );\n\n\t/**\n\t * Set variables after connections have been rendered\n\t */\n\tfunction setVariables() {\n\t\tconnectionsSelected \t= distributorPushWrapper.querySelector( '.connections-selected' );\n\t\tconnectionsSelectedList \t= distributorPushWrapper.querySelector( '.selected-connections-list' );\n\t\tconnectionsNewList \t= distributorPushWrapper.querySelector( '.new-connections-list' );\n\t\tselectAllConnections \t\t= distributorPushWrapper.querySelector( '.selectall-connections' );\n\t\tselectNoConnections \t\t= distributorPushWrapper.querySelector( '.selectno-connections' );\n\t\tconnectionsSearchInput \t= document.getElementById( 'dt-connection-search' );\n\t\tpostStatusInput \t= document.getElementById( 'dt-post-status' );\n\t\tasDraftInput \t= document.getElementById( 'dt-as-draft' );\n\n\t\tif ( null !== connectionsNewList ){\n\t\t\tconnectionsNewListChildren = connectionsNewList.querySelectorAll( '.add-connection' );\n\t\t}\n\n\t\t/**\n\t\t * Listen for connection filtering\n\t\t */\n\t\tjQuery( connectionsSearchInput ).on( 'keyup change', _.debounce( ( event ) => {\n\t\t\tif ( '' === event.currentTarget.value ) {\n\t\t\t\tshowConnections( dtConnections );\n\t\t\t}\n\t\t\tsearchString = event.currentTarget.value.replace( /https?:\\/\\//i, '' ).replace( /www/i, '' ).replace( /[^0-9a-zA-Z ]+/, '' );\n\t\t\tshowConnections();\n\t\t}, 300 ) );\n\n\t\t/**\n\t\t * Disable select all button if all connections are syndicated and set variable for total connections available\n\t\t */\n\t\t_.each( connectionsNewListChildren, ( element ) => {\n\t\t\tif ( ! element.classList.contains ( 'syndicated' ) ) {\n\t\t\t\tselectAllConnections.classList.remove( 'unavailable' );\n\t\t\t\tconnectionsAvailableTotal ++;\n\t\t\t}\n\t\t} );\n\n\t}\n\n\t/**\n\t * Handle UI error changes\n\t */\n\tfunction doError() {\n\t\tdistributorPushWrapper.classList.add( 'message-error' );\n\n\t\tsetTimeout( () => {\n\t\t\tdistributorPushWrapper.classList.remove( 'message-error' );\n\t\t}, 6000 );\n\t}\n\n\t/**\n\t * Handle UI success changes\n\t */\n\tfunction doSuccess( results ) {\n\t\tlet error = false;\n\n\t\t[ 'internal', 'external' ].map( type => {\n\t\t\t_.each( results[type], ( result, connectionId ) => {\n\t\t\t\tif ( 'fail' === result.status ) {\n\t\t\t\t\terror = true;\n\t\t\t\t} else {\n\t\t\t\t\tdtConnections[ `${type}${ connectionId }` ].syndicated = result.url;\n\t\t\t\t}\n\t\t\t} );\n\t\t} );\n\n\t\tif ( error ) {\n\t\t\tdoError();\n\t\t} else {\n\t\t\tdistributorPushWrapper.classList.add( 'message-success' );\n\n\t\t\tconnectionsSelected.classList.add( 'empty' );\n\t\t\tconnectionsSelectedList.innerText = '';\n\n\t\t\tsetTimeout( () => {\n\t\t\t\tdistributorPushWrapper.classList.remove( 'message-success' );\n\t\t\t}, 6000 );\n\t\t}\n\n\t\tselectedConnections = {};\n\n\t\tshowConnections();\n\t}\n\n\t/**\n\t * Show connections. If there is a search string, then filter by it\n\t*/\n\tfunction showConnections() {\n\t\tconnectionsNewList.innerText = '';\n\n\t\t_.each( dtConnections, ( connection ) => {\n\t\t\tif ( '' !== searchString ) {\n\t\t\t\tconst nameMatch = connection.name.replace( /[^0-9a-zA-Z ]+/, '' ).toLowerCase().match( searchString.toLowerCase() );\n\t\t\t\tconst urlMatch = connection.url.replace( /https?:\\/\\//i, '' ).replace( /www/i, '' ).replace( /[^0-9a-zA-Z ]+/, '' ).toLowerCase().match( searchString.toLowerCase() );\n\n\t\t\t\tif ( ! nameMatch && ! urlMatch ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst showConnection = processTemplate( 'dt-add-connection' )( {\n\t\t\t\tconnection: connection,\n\t\t\t\tselectedConnections: selectedConnections\n\t\t\t} );\n\n\t\t\tconnectionsNewList.innerHTML += showConnection;\n\t\t} );\n\n\t\tif ( '' === connectionsNewList.innerHTML ) {\n\t\t\tconnectionsNewList.innerHTML = '

No results

';\n\t\t}\n\t}\n\n\t/**\n\t * Add or remove CSS classes to indicate button functionality\n\t*/\n\tfunction classList( expr ) {\n\t\tswitch ( expr ) {\n\t\t\t\tcase 'addEmpty':\n\t\t\t\t\tconnectionsSelected.classList.add( 'empty' );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'removeEmpty':\n\t\t\t\t\tconnectionsSelected.classList.remove( 'empty' );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'allUnavailable':\n\t\t\t\t\tselectAllConnections.classList.add ( 'unavailable' );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'all':\n\t\t\t\t\tselectAllConnections.classList.remove ( 'unavailable' );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'noneUnavailable':\n\t\t\t\t\tselectNoConnections.classList.add ( 'unavailable' );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'none':\n\t\t\t\t\tselectNoConnections.classList.remove ( 'unavailable' );\n\t\t\t\t\tbreak;\n\t\t}\n\t}\n\n\t/**\n\t * Handle distributor push dropdown menu.\n\t */\n\tfunction distributorMenuEntered() {\n\t\tdistributorMenuItem.focus();\n\n\t\tif ( distributorPushWrapper.classList.contains( 'loaded' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tdistributorPushWrapper.classList.remove( 'message-error' );\n\t\tdistributorPushWrapper.classList.add( 'loaded' );\n\n\t\tconst data = {\n\t\t\taction: 'dt_load_connections',\n\t\t\tloadConnectionsNonce: dt.loadConnectionsNonce,\n\t\t\tpostId: dt.postId\n\t\t};\n\n\t\tconst xhr = dt.usexhr ? { withCredentials: true } : false;\n\n\t\tjQuery.ajax( {\n\t\t\turl: dt.ajaxurl,\n\t\t\txhrFields: xhr,\n\t\t\tmethod: 'post',\n\t\t\tdata: data\n\t\t} ).done( ( response ) => {\n\t\t\tif ( ! response.success || ! response.data ) {\n\t\t\t\tdistributorPushWrapper.classList.remove( 'loaded' );\n\t\t\t\tdistributorPushWrapper.classList.add( 'message-error' );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tdtConnections = response.data;\n\n\t\t\tdistributorPushWrapper.innerHTML = processTemplate( 'dt-show-connections' )( {\n\t\t\t\tconnections: dtConnections,\n\t\t\t} );\n\n\t\t\tsetVariables();\n\t\t} ).error( () => {\n\t\t\tdistributorPushWrapper.classList.remove( 'loaded' );\n\t\t\tdistributorPushWrapper.classList.add( 'message-error' );\n\t\t} );\n\t}\n\n\t// Event listerners when to fetch distributor data.\n\tdistributorAdminItem.addEventListener( 'keydown', function( e ) {\n\t\t// Pressing Enter.\n\t\tif ( ( 13 === e.keyCode ) ) {\n\t\t\tdistributorMenuEntered();\n\t\t}\n\t}, false );\n\n\tdistributorAdminItem.addEventListener( 'touchstart', distributorMenuEntered, false );\n\tdistributorAdminItem.addEventListener( 'mouseenter', distributorMenuEntered, false );\n\n\t/**\n\t * Do syndication ajax\n\t */\n\tjQuery( distributorPushWrapper ).on( 'click', '.syndicate-button', () => {\n\t\tif ( distributorTopMenu.classList.contains( 'syncing' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tdistributorTopMenu.classList.add( 'syncing' );\n\n\t\tconst data = {\n\t\t\taction: 'dt_push',\n\t\t\tnonce: dt.nonce,\n\t\t\tconnections: selectedConnections,\n\t\t\tpostId: dt.postId\n\t\t};\n\n\t\tdata.postStatus = ( null !== asDraftInput && asDraftInput.checked ) ? 'draft' : postStatusInput.value;\n\n\t\tconst xhr = dt.usexhr ? { withCredentials: true } : false;\n\n\t\tjQuery.ajax( {\n\t\t\turl: dt.ajaxurl,\n\t\t\txhrFields: xhr,\n\t\t\tmethod: 'post',\n\t\t\tdata: data\n\t\t} ).done( ( response ) => {\n\t\t\tsetTimeout( () => {\n\t\t\t\tdistributorTopMenu.classList.remove( 'syncing' );\n\n\t\t\t\tif ( ! response.data || ! response.data.results ) {\n\t\t\t\t\tdoError();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tdoSuccess( response.data.results );\n\t\t\t}, 500 );\n\t\t} ).error( () => {\n\t\t\tsetTimeout( () => {\n\t\t\t\tdistributorTopMenu.classList.remove( 'syncing' );\n\n\t\t\t\tdoError();\n\t\t\t}, 500 );\n\t\t} );\n\t} );\n\n\t/**\n\t * Add a connection to selected connections for ajax and to the UI list.\n\t */\n\tjQuery( distributorPushWrapper ).on( 'click', '.add-connection', ( event ) => {\n\t\tif ( 'A' === event.target.nodeName ) {\n\t\t\treturn;\n\t\t}\n\n\t\tevent.preventDefault();\n\n\t\tif ( event.currentTarget.classList.contains( 'syndicated' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( event.currentTarget.classList.contains( 'added' ) ) {\n\t\t\tconst type = event.currentTarget.getAttribute( 'data-connection-type' );\n\t\t\tconst id = event.currentTarget.getAttribute( 'data-connection-id' );\n\n\t\t\tconst deleteNode = connectionsSelectedList.querySelector( `[data-connection-id=\"${ id }\"][data-connection-type=\"${ type }\"]` );\n\n\t\t\tdeleteNode.parentNode.removeChild( deleteNode );\n\n\t\t\tdelete selectedConnections[type + id];\n\n\t\t\tif ( selectAllConnections.classList.contains ( 'unavailable' ) ) {\n\t\t\t\tclassList ( 'all' );\n\t\t\t}\n\t\t\tif ( ! Object.keys( selectedConnections ).length ) {\n\t\t\t\tclassList ( 'addEmpty' );\n\t\t\t\tclassList ( 'noneUnavailable' );\n\t\t\t}\n\n\t\t\tshowConnections();\n\t\t} else {\n\t\t\tconst type = event.currentTarget.getAttribute( 'data-connection-type' );\n\t\t\tconst id = event.currentTarget.getAttribute( 'data-connection-id' );\n\n\t\t\tselectedConnections[type + id] = dtConnections[type + id];\n\n\t\t\tconst element = event.currentTarget.cloneNode( true );\n\n\t\t\tconst removeLink = document.createElement( 'span' );\n\t\t\tremoveLink.classList.add( 'remove-connection' );\n\n\t\t\telement.appendChild( removeLink );\n\t\t\telement.classList = 'added-connection';\n\n\t\t\tconnectionsSelectedList.appendChild( element );\n\n\t\t\tif ( selectNoConnections.classList.contains ( 'unavailable' ) ) {\n\t\t\t\tclassList ( 'removeEmpty' );\n\t\t\t\tclassList ( 'none' );\n\t\t\t}\n\n\t\t\tif ( Object.keys( selectedConnections ).length == connectionsAvailableTotal ){\n\t\t\t\tclassList ( 'allUnavailable' );\n\t\t\t}\n\n\t\t\tshowConnections();\n\t\t}\n\t} );\n\n\t/**\n\t * Select all connections for distribution.\n\t*/\n\tjQuery( distributorPushWrapper ).on( 'click', '.selectall-connections', () => {\n\t\tjQuery ( connectionsNewList ).children( '.add-connection' ).each( ( index, childTarget ) => {\n\t\t\tif ( childTarget.classList.contains( 'syndicated' ) || childTarget.classList.contains( 'added' ) ) {\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\tconst type = childTarget.getAttribute( 'data-connection-type' );\n\t\t\t\tconst id = childTarget.getAttribute( 'data-connection-id' );\n\n\t\t\t\tselectedConnections[type + id] = dtConnections[type + id];\n\n\t\t\t\tconst element = childTarget.cloneNode();\n\t\t\t\telement.innerText = childTarget.innerText;\n\n\t\t\t\tconst removeLink = document.createElement( 'span' );\n\t\t\t\tremoveLink.classList.add( 'remove-connection' );\n\n\t\t\t\telement.appendChild( removeLink );\n\t\t\t\telement.classList = 'added-connection';\n\n\t\t\t\tconnectionsSelectedList.appendChild( element );\n\n\t\t\t}\n\n\t\t\tif ( '' !== connectionsAvailableTotal ) {\n\t\t\t\tclassList ( 'removeEmpty' );\n\t\t\t\tclassList ( 'allUnavailable' );\n\t\t\t\tclassList ( 'none' );\n\t\t\t}\n\n\t\t} );\n\n\t\tshowConnections();\n\t} );\n\n\t/**\n\t * Select no connections for distribution.\n\t*/\n\tjQuery( distributorPushWrapper ).on( 'click', '.selectno-connections', () => {\n\n\t\twhile ( connectionsSelectedList.firstChild ) {\n\t\t\tconst type = connectionsSelectedList.firstChild.getAttribute( 'data-connection-type' );\n\t\t\tconst id = connectionsSelectedList.firstChild.getAttribute( 'data-connection-id' );\n\n\t\t\tdelete selectedConnections[type + id];\n\n\t\t\tconnectionsSelectedList.removeChild( connectionsSelectedList.firstChild );\n\n\t\t}\n\n\t\tif ( '' !== connectionsAvailableTotal ) {\n\t\t\tclassList ( 'addEmpty' );\n\t\t\tclassList ( 'noneUnavailable' );\n\t\t\tclassList ( 'all' );\n\t\t}\n\n\t\tshowConnections();\n\t} );\n\n\t/**\n\t * Remove a connection from selected connections and the UI list\n\t */\n\tjQuery( distributorPushWrapper ).on( 'click', '.added-connection', ( event ) => {\n\t\tevent.currentTarget.parentNode.removeChild( event.currentTarget );\n\t\tconst type = event.currentTarget.getAttribute( 'data-connection-type' );\n\t\tconst id = event.currentTarget.getAttribute( 'data-connection-id' );\n\n\t\tdelete selectedConnections[type + id];\n\n\t\tif ( selectAllConnections.classList.contains ( 'unavailable' ) ) {\n\t\t\tclassList ( 'all' );\n\t\t}\n\t\tif ( ! Object.keys( selectedConnections ).length ) {\n\t\t\tclassList ( 'addEmpty' );\n\t\t\tclassList ( 'noneUnavailable' );\n\t\t}\n\n\t\tshowConnections();\n\t} );\n} );\n","module.exports = _;"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"window\"","webpack:///external \"jQuery\"","webpack:///external \"_\"","webpack:///./node_modules/mustache/mustache.js","webpack:///./assets/js/push.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","window","jQuery","_","objectToString","toString","isArray","Array","isFunction","escapeRegExp","string","replace","hasProperty","obj","propName","regExpTest","RegExp","test","nonSpaceRe","isWhitespace","re","testRegExp","entityMap","whiteRe","spaceRe","equalsRe","curlyRe","tagRe","Scanner","this","tail","pos","Context","view","parentContext","cache","parent","Writer","templateCache","_cache","set","clear","eos","scan","match","index","substring","length","scanUntil","search","push","lookup","primitive","intermediateValue","names","context","lookupHit","indexOf","split","clearCache","parse","template","tags","cacheKey","mustache","join","isCacheEnabled","tokens","undefined","openingTagRe","closingTagRe","closingCurlyRe","lineHasNonSpace","sections","spaces","hasTag","nonSpace","indentation","tagIndex","stripSpace","pop","compileTags","tagsToCompile","Error","start","type","chr","token","openSection","scanner","valueLength","charAt","nestedTokens","collector","numTokens","nestTokens","lastToken","squashedTokens","squashTokens","parseTemplate","render","partials","renderTokens","originalTemplate","symbol","buffer","renderSection","renderInverted","renderPartial","unescapedValue","escapedValue","rawValue","self","j","slice","indentPartial","partial","filteredIndentation","partialByNl","indentedValue","escape","version","defaultWriter","TypeError","String","factory","selectedConnections","searchString","processTemplate","memoize","id","element","document","getElementById","attributes","Mustache","innerHTML","evaluate","interpolate","on","distributorAdminItem","querySelector","distributorTopMenu","distributorMenuItem","distributorPushWrapper","dtConnections","connectionsSelected","connectionsSelectedList","connectionsNewList","connectionsNewListChildren","connectionsAvailableTotal","selectAllConnections","selectNoConnections","connectionsSearchInput","postStatusInput","asDraftInput","errorDetails","appendChild","addEventListener","e","keyCode","distributorMenuEntered","classList","contains","add","data","action","nonce","dt","connections","postId","postStatus","checked","xhr","usexhr","withCredentials","ajax","url","ajaxurl","xhrFields","method","done","response","setTimeout","results","success","errors","remove","map","each","result","connectionId","status","syndicated","isEmpty","doError","messages","message","innerText","showConnections","empty_result","error","textStatus","errorThrown","ajax_error","event","target","nodeName","preventDefault","currentTarget","getAttribute","deleteNode","parentNode","removeChild","keys","cloneNode","removeLink","createElement","children","childTarget","firstChild","setDisabledConnections","querySelectorAll","disabled","isString","has","prepareMessages","errorItem","showConnection","connection","nameMatch","toLowerCase","urlMatch","added","internal","expr","focus","loadConnectionsNonce","mustacheData","foundConnections","showSearch","debounce"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1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AKA,QAAS,OAAQ,IAAKA,QAAS,iBAAkB,IACxH4L,MACE,MAKHpM,IAAE0L,KAAMxC,GAA4B,SAAElB,GAC9BA,EAAQ+B,UAAUC,SAAW,gBACnCZ,EAAqBW,UAAUyB,OAAQ,eACvCrC,WAwPEmD,OAAO,WACVzD,EAAuBkB,UAAUyB,OAAQ,UACzC3C,EAAuBkB,UAAUE,IAAK","file":"push.min.js","sourcesContent":[" \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, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\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\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 13);\n","module.exports = window;","module.exports = jQuery;","module.exports = _;","// This file has been generated from mustache.mjs\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global = global || self, global.Mustache = factory());\n}(this, (function () { 'use strict';\n\n /*!\n * mustache.js - Logic-less {{mustache}} templates with JavaScript\n * http://github.com/janl/mustache.js\n */\n\n var objectToString = Object.prototype.toString;\n var isArray = Array.isArray || function isArrayPolyfill (object) {\n return objectToString.call(object) === '[object Array]';\n };\n\n function isFunction (object) {\n return typeof object === 'function';\n }\n\n /**\n * More correct typeof string handling array\n * which normally returns typeof 'object'\n */\n function typeStr (obj) {\n return isArray(obj) ? 'array' : typeof obj;\n }\n\n function escapeRegExp (string) {\n return string.replace(/[\\-\\[\\]{}()*+?.,\\\\\\^$|#\\s]/g, '\\\\$&');\n }\n\n /**\n * Null safe way of checking whether or not an object,\n * including its prototype, has a given property\n */\n function hasProperty (obj, propName) {\n return obj != null && typeof obj === 'object' && (propName in obj);\n }\n\n /**\n * Safe way of detecting whether or not the given thing is a primitive and\n * whether it has the given property\n */\n function primitiveHasOwnProperty (primitive, propName) {\n return (\n primitive != null\n && typeof primitive !== 'object'\n && primitive.hasOwnProperty\n && primitive.hasOwnProperty(propName)\n );\n }\n\n // Workaround for https://issues.apache.org/jira/browse/COUCHDB-577\n // See https://github.com/janl/mustache.js/issues/189\n var regExpTest = RegExp.prototype.test;\n function testRegExp (re, string) {\n return regExpTest.call(re, string);\n }\n\n var nonSpaceRe = /\\S/;\n function isWhitespace (string) {\n return !testRegExp(nonSpaceRe, string);\n }\n\n var entityMap = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": ''',\n '/': '/',\n '`': '`',\n '=': '='\n };\n\n function escapeHtml (string) {\n return String(string).replace(/[&<>\"'`=\\/]/g, function fromEntityMap (s) {\n return entityMap[s];\n });\n }\n\n var whiteRe = /\\s*/;\n var spaceRe = /\\s+/;\n var equalsRe = /\\s*=/;\n var curlyRe = /\\s*\\}/;\n var tagRe = /#|\\^|\\/|>|\\{|&|=|!/;\n\n /**\n * Breaks up the given `template` string into a tree of tokens. If the `tags`\n * argument is given here it must be an array with two string values: the\n * opening and closing tags used in the template (e.g. [ \"<%\", \"%>\" ]). Of\n * course, the default is to use mustaches (i.e. mustache.tags).\n *\n * A token is an array with at least 4 elements. The first element is the\n * mustache symbol that was used inside the tag, e.g. \"#\" or \"&\". If the tag\n * did not contain a symbol (i.e. {{myValue}}) this element is \"name\". For\n * all text that appears outside a symbol this element is \"text\".\n *\n * The second element of a token is its \"value\". For mustache tags this is\n * whatever else was inside the tag besides the opening symbol. For text tokens\n * this is the text itself.\n *\n * The third and fourth elements of the token are the start and end indices,\n * respectively, of the token in the original template.\n *\n * Tokens that are the root node of a subtree contain two more elements: 1) an\n * array of tokens in the subtree and 2) the index in the original template at\n * which the closing tag for that section begins.\n *\n * Tokens for partials also contain two more elements: 1) a string value of\n * indendation prior to that tag and 2) the index of that tag on that line -\n * eg a value of 2 indicates the partial is the third tag on this line.\n */\n function parseTemplate (template, tags) {\n if (!template)\n return [];\n var lineHasNonSpace = false;\n var sections = []; // Stack to hold section tokens\n var tokens = []; // Buffer to hold the tokens\n var spaces = []; // Indices of whitespace tokens on the current line\n var hasTag = false; // Is there a {{tag}} on the current line?\n var nonSpace = false; // Is there a non-space char on the current line?\n var indentation = ''; // Tracks indentation for tags that use it\n var tagIndex = 0; // Stores a count of number of tags encountered on a line\n\n // Strips all whitespace tokens array for the current line\n // if there was a {{#tag}} on it and otherwise only space.\n function stripSpace () {\n if (hasTag && !nonSpace) {\n while (spaces.length)\n delete tokens[spaces.pop()];\n } else {\n spaces = [];\n }\n\n hasTag = false;\n nonSpace = false;\n }\n\n var openingTagRe, closingTagRe, closingCurlyRe;\n function compileTags (tagsToCompile) {\n if (typeof tagsToCompile === 'string')\n tagsToCompile = tagsToCompile.split(spaceRe, 2);\n\n if (!isArray(tagsToCompile) || tagsToCompile.length !== 2)\n throw new Error('Invalid tags: ' + tagsToCompile);\n\n openingTagRe = new RegExp(escapeRegExp(tagsToCompile[0]) + '\\\\s*');\n closingTagRe = new RegExp('\\\\s*' + escapeRegExp(tagsToCompile[1]));\n closingCurlyRe = new RegExp('\\\\s*' + escapeRegExp('}' + tagsToCompile[1]));\n }\n\n compileTags(tags || mustache.tags);\n\n var scanner = new Scanner(template);\n\n var start, type, value, chr, token, openSection;\n while (!scanner.eos()) {\n start = scanner.pos;\n\n // Match any text between tags.\n value = scanner.scanUntil(openingTagRe);\n\n if (value) {\n for (var i = 0, valueLength = value.length; i < valueLength; ++i) {\n chr = value.charAt(i);\n\n if (isWhitespace(chr)) {\n spaces.push(tokens.length);\n indentation += chr;\n } else {\n nonSpace = true;\n lineHasNonSpace = true;\n indentation += ' ';\n }\n\n tokens.push([ 'text', chr, start, start + 1 ]);\n start += 1;\n\n // Check for whitespace on the current line.\n if (chr === '\\n') {\n stripSpace();\n indentation = '';\n tagIndex = 0;\n lineHasNonSpace = false;\n }\n }\n }\n\n // Match the opening tag.\n if (!scanner.scan(openingTagRe))\n break;\n\n hasTag = true;\n\n // Get the tag type.\n type = scanner.scan(tagRe) || 'name';\n scanner.scan(whiteRe);\n\n // Get the tag value.\n if (type === '=') {\n value = scanner.scanUntil(equalsRe);\n scanner.scan(equalsRe);\n scanner.scanUntil(closingTagRe);\n } else if (type === '{') {\n value = scanner.scanUntil(closingCurlyRe);\n scanner.scan(curlyRe);\n scanner.scanUntil(closingTagRe);\n type = '&';\n } else {\n value = scanner.scanUntil(closingTagRe);\n }\n\n // Match the closing tag.\n if (!scanner.scan(closingTagRe))\n throw new Error('Unclosed tag at ' + scanner.pos);\n\n if (type == '>') {\n token = [ type, value, start, scanner.pos, indentation, tagIndex, lineHasNonSpace ];\n } else {\n token = [ type, value, start, scanner.pos ];\n }\n tagIndex++;\n tokens.push(token);\n\n if (type === '#' || type === '^') {\n sections.push(token);\n } else if (type === '/') {\n // Check section nesting.\n openSection = sections.pop();\n\n if (!openSection)\n throw new Error('Unopened section \"' + value + '\" at ' + start);\n\n if (openSection[1] !== value)\n throw new Error('Unclosed section \"' + openSection[1] + '\" at ' + start);\n } else if (type === 'name' || type === '{' || type === '&') {\n nonSpace = true;\n } else if (type === '=') {\n // Set the tags for the next time around.\n compileTags(value);\n }\n }\n\n stripSpace();\n\n // Make sure there are no open sections when we're done.\n openSection = sections.pop();\n\n if (openSection)\n throw new Error('Unclosed section \"' + openSection[1] + '\" at ' + scanner.pos);\n\n return nestTokens(squashTokens(tokens));\n }\n\n /**\n * Combines the values of consecutive text tokens in the given `tokens` array\n * to a single token.\n */\n function squashTokens (tokens) {\n var squashedTokens = [];\n\n var token, lastToken;\n for (var i = 0, numTokens = tokens.length; i < numTokens; ++i) {\n token = tokens[i];\n\n if (token) {\n if (token[0] === 'text' && lastToken && lastToken[0] === 'text') {\n lastToken[1] += token[1];\n lastToken[3] = token[3];\n } else {\n squashedTokens.push(token);\n lastToken = token;\n }\n }\n }\n\n return squashedTokens;\n }\n\n /**\n * Forms the given array of `tokens` into a nested tree structure where\n * tokens that represent a section have two additional items: 1) an array of\n * all tokens that appear in that section and 2) the index in the original\n * template that represents the end of that section.\n */\n function nestTokens (tokens) {\n var nestedTokens = [];\n var collector = nestedTokens;\n var sections = [];\n\n var token, section;\n for (var i = 0, numTokens = tokens.length; i < numTokens; ++i) {\n token = tokens[i];\n\n switch (token[0]) {\n case '#':\n case '^':\n collector.push(token);\n sections.push(token);\n collector = token[4] = [];\n break;\n case '/':\n section = sections.pop();\n section[5] = token[2];\n collector = sections.length > 0 ? sections[sections.length - 1][4] : nestedTokens;\n break;\n default:\n collector.push(token);\n }\n }\n\n return nestedTokens;\n }\n\n /**\n * A simple string scanner that is used by the template parser to find\n * tokens in template strings.\n */\n function Scanner (string) {\n this.string = string;\n this.tail = string;\n this.pos = 0;\n }\n\n /**\n * Returns `true` if the tail is empty (end of string).\n */\n Scanner.prototype.eos = function eos () {\n return this.tail === '';\n };\n\n /**\n * Tries to match the given regular expression at the current position.\n * Returns the matched text if it can match, the empty string otherwise.\n */\n Scanner.prototype.scan = function scan (re) {\n var match = this.tail.match(re);\n\n if (!match || match.index !== 0)\n return '';\n\n var string = match[0];\n\n this.tail = this.tail.substring(string.length);\n this.pos += string.length;\n\n return string;\n };\n\n /**\n * Skips all text until the given regular expression can be matched. Returns\n * the skipped string, which is the entire tail if no match can be made.\n */\n Scanner.prototype.scanUntil = function scanUntil (re) {\n var index = this.tail.search(re), match;\n\n switch (index) {\n case -1:\n match = this.tail;\n this.tail = '';\n break;\n case 0:\n match = '';\n break;\n default:\n match = this.tail.substring(0, index);\n this.tail = this.tail.substring(index);\n }\n\n this.pos += match.length;\n\n return match;\n };\n\n /**\n * Represents a rendering context by wrapping a view object and\n * maintaining a reference to the parent context.\n */\n function Context (view, parentContext) {\n this.view = view;\n this.cache = { '.': this.view };\n this.parent = parentContext;\n }\n\n /**\n * Creates a new context using the given view with this context\n * as the parent.\n */\n Context.prototype.push = function push (view) {\n return new Context(view, this);\n };\n\n /**\n * Returns the value of the given name in this context, traversing\n * up the context hierarchy if the value is absent in this context's view.\n */\n Context.prototype.lookup = function lookup (name) {\n var cache = this.cache;\n\n var value;\n if (cache.hasOwnProperty(name)) {\n value = cache[name];\n } else {\n var context = this, intermediateValue, names, index, lookupHit = false;\n\n while (context) {\n if (name.indexOf('.') > 0) {\n intermediateValue = context.view;\n names = name.split('.');\n index = 0;\n\n /**\n * Using the dot notion path in `name`, we descend through the\n * nested objects.\n *\n * To be certain that the lookup has been successful, we have to\n * check if the last object in the path actually has the property\n * we are looking for. We store the result in `lookupHit`.\n *\n * This is specially necessary for when the value has been set to\n * `undefined` and we want to avoid looking up parent contexts.\n *\n * In the case where dot notation is used, we consider the lookup\n * to be successful even if the last \"object\" in the path is\n * not actually an object but a primitive (e.g., a string, or an\n * integer), because it is sometimes useful to access a property\n * of an autoboxed primitive, such as the length of a string.\n **/\n while (intermediateValue != null && index < names.length) {\n if (index === names.length - 1)\n lookupHit = (\n hasProperty(intermediateValue, names[index])\n || primitiveHasOwnProperty(intermediateValue, names[index])\n );\n\n intermediateValue = intermediateValue[names[index++]];\n }\n } else {\n intermediateValue = context.view[name];\n\n /**\n * Only checking against `hasProperty`, which always returns `false` if\n * `context.view` is not an object. Deliberately omitting the check\n * against `primitiveHasOwnProperty` if dot notation is not used.\n *\n * Consider this example:\n * ```\n * Mustache.render(\"The length of a football field is {{#length}}{{length}}{{/length}}.\", {length: \"100 yards\"})\n * ```\n *\n * If we were to check also against `primitiveHasOwnProperty`, as we do\n * in the dot notation case, then render call would return:\n *\n * \"The length of a football field is 9.\"\n *\n * rather than the expected:\n *\n * \"The length of a football field is 100 yards.\"\n **/\n lookupHit = hasProperty(context.view, name);\n }\n\n if (lookupHit) {\n value = intermediateValue;\n break;\n }\n\n context = context.parent;\n }\n\n cache[name] = value;\n }\n\n if (isFunction(value))\n value = value.call(this.view);\n\n return value;\n };\n\n /**\n * A Writer knows how to take a stream of tokens and render them to a\n * string, given a context. It also maintains a cache of templates to\n * avoid the need to parse the same template twice.\n */\n function Writer () {\n this.templateCache = {\n _cache: {},\n set: function set (key, value) {\n this._cache[key] = value;\n },\n get: function get (key) {\n return this._cache[key];\n },\n clear: function clear () {\n this._cache = {};\n }\n };\n }\n\n /**\n * Clears all cached templates in this writer.\n */\n Writer.prototype.clearCache = function clearCache () {\n if (typeof this.templateCache !== 'undefined') {\n this.templateCache.clear();\n }\n };\n\n /**\n * Parses and caches the given `template` according to the given `tags` or\n * `mustache.tags` if `tags` is omitted, and returns the array of tokens\n * that is generated from the parse.\n */\n Writer.prototype.parse = function parse (template, tags) {\n var cache = this.templateCache;\n var cacheKey = template + ':' + (tags || mustache.tags).join(':');\n var isCacheEnabled = typeof cache !== 'undefined';\n var tokens = isCacheEnabled ? cache.get(cacheKey) : undefined;\n\n if (tokens == undefined) {\n tokens = parseTemplate(template, tags);\n isCacheEnabled && cache.set(cacheKey, tokens);\n }\n return tokens;\n };\n\n /**\n * High-level method that is used to render the given `template` with\n * the given `view`.\n *\n * The optional `partials` argument may be an object that contains the\n * names and templates of partials that are used in the template. It may\n * also be a function that is used to load partial templates on the fly\n * that takes a single argument: the name of the partial.\n *\n * If the optional `tags` argument is given here it must be an array with two\n * string values: the opening and closing tags used in the template (e.g.\n * [ \"<%\", \"%>\" ]). The default is to mustache.tags.\n */\n Writer.prototype.render = function render (template, view, partials, tags) {\n var tokens = this.parse(template, tags);\n var context = (view instanceof Context) ? view : new Context(view, undefined);\n return this.renderTokens(tokens, context, partials, template, tags);\n };\n\n /**\n * Low-level method that renders the given array of `tokens` using\n * the given `context` and `partials`.\n *\n * Note: The `originalTemplate` is only ever used to extract the portion\n * of the original template that was contained in a higher-order section.\n * If the template doesn't use higher-order sections, this argument may\n * be omitted.\n */\n Writer.prototype.renderTokens = function renderTokens (tokens, context, partials, originalTemplate, tags) {\n var buffer = '';\n\n var token, symbol, value;\n for (var i = 0, numTokens = tokens.length; i < numTokens; ++i) {\n value = undefined;\n token = tokens[i];\n symbol = token[0];\n\n if (symbol === '#') value = this.renderSection(token, context, partials, originalTemplate);\n else if (symbol === '^') value = this.renderInverted(token, context, partials, originalTemplate);\n else if (symbol === '>') value = this.renderPartial(token, context, partials, tags);\n else if (symbol === '&') value = this.unescapedValue(token, context);\n else if (symbol === 'name') value = this.escapedValue(token, context);\n else if (symbol === 'text') value = this.rawValue(token);\n\n if (value !== undefined)\n buffer += value;\n }\n\n return buffer;\n };\n\n Writer.prototype.renderSection = function renderSection (token, context, partials, originalTemplate) {\n var self = this;\n var buffer = '';\n var value = context.lookup(token[1]);\n\n // This function is used to render an arbitrary template\n // in the current context by higher-order sections.\n function subRender (template) {\n return self.render(template, context, partials);\n }\n\n if (!value) return;\n\n if (isArray(value)) {\n for (var j = 0, valueLength = value.length; j < valueLength; ++j) {\n buffer += this.renderTokens(token[4], context.push(value[j]), partials, originalTemplate);\n }\n } else if (typeof value === 'object' || typeof value === 'string' || typeof value === 'number') {\n buffer += this.renderTokens(token[4], context.push(value), partials, originalTemplate);\n } else if (isFunction(value)) {\n if (typeof originalTemplate !== 'string')\n throw new Error('Cannot use higher-order sections without the original template');\n\n // Extract the portion of the original template that the section contains.\n value = value.call(context.view, originalTemplate.slice(token[3], token[5]), subRender);\n\n if (value != null)\n buffer += value;\n } else {\n buffer += this.renderTokens(token[4], context, partials, originalTemplate);\n }\n return buffer;\n };\n\n Writer.prototype.renderInverted = function renderInverted (token, context, partials, originalTemplate) {\n var value = context.lookup(token[1]);\n\n // Use JavaScript's definition of falsy. Include empty arrays.\n // See https://github.com/janl/mustache.js/issues/186\n if (!value || (isArray(value) && value.length === 0))\n return this.renderTokens(token[4], context, partials, originalTemplate);\n };\n\n Writer.prototype.indentPartial = function indentPartial (partial, indentation, lineHasNonSpace) {\n var filteredIndentation = indentation.replace(/[^ \\t]/g, '');\n var partialByNl = partial.split('\\n');\n for (var i = 0; i < partialByNl.length; i++) {\n if (partialByNl[i].length && (i > 0 || !lineHasNonSpace)) {\n partialByNl[i] = filteredIndentation + partialByNl[i];\n }\n }\n return partialByNl.join('\\n');\n };\n\n Writer.prototype.renderPartial = function renderPartial (token, context, partials, tags) {\n if (!partials) return;\n\n var value = isFunction(partials) ? partials(token[1]) : partials[token[1]];\n if (value != null) {\n var lineHasNonSpace = token[6];\n var tagIndex = token[5];\n var indentation = token[4];\n var indentedValue = value;\n if (tagIndex == 0 && indentation) {\n indentedValue = this.indentPartial(value, indentation, lineHasNonSpace);\n }\n return this.renderTokens(this.parse(indentedValue, tags), context, partials, indentedValue, tags);\n }\n };\n\n Writer.prototype.unescapedValue = function unescapedValue (token, context) {\n var value = context.lookup(token[1]);\n if (value != null)\n return value;\n };\n\n Writer.prototype.escapedValue = function escapedValue (token, context) {\n var value = context.lookup(token[1]);\n if (value != null)\n return mustache.escape(value);\n };\n\n Writer.prototype.rawValue = function rawValue (token) {\n return token[1];\n };\n\n var mustache = {\n name: 'mustache.js',\n version: '4.0.1',\n tags: [ '{{', '}}' ],\n clearCache: undefined,\n escape: undefined,\n parse: undefined,\n render: undefined,\n Scanner: undefined,\n Context: undefined,\n Writer: undefined,\n /**\n * Allows a user to override the default caching strategy, by providing an\n * object with set, get and clear methods. This can also be used to disable\n * the cache by setting it to the literal `undefined`.\n */\n set templateCache (cache) {\n defaultWriter.templateCache = cache;\n },\n /**\n * Gets the default or overridden caching object from the default writer.\n */\n get templateCache () {\n return defaultWriter.templateCache;\n }\n };\n\n // All high-level mustache.* functions use this writer.\n var defaultWriter = new Writer();\n\n /**\n * Clears all cached templates in the default writer.\n */\n mustache.clearCache = function clearCache () {\n return defaultWriter.clearCache();\n };\n\n /**\n * Parses and caches the given template in the default writer and returns the\n * array of tokens it contains. Doing this ahead of time avoids the need to\n * parse templates on the fly as they are rendered.\n */\n mustache.parse = function parse (template, tags) {\n return defaultWriter.parse(template, tags);\n };\n\n /**\n * Renders the `template` with the given `view` and `partials` using the\n * default writer. If the optional `tags` argument is given here it must be an\n * array with two string values: the opening and closing tags used in the\n * template (e.g. [ \"<%\", \"%>\" ]). The default is to mustache.tags.\n */\n mustache.render = function render (template, view, partials, tags) {\n if (typeof template !== 'string') {\n throw new TypeError('Invalid template! Template should be a \"string\" ' +\n 'but \"' + typeStr(template) + '\" was given as the first ' +\n 'argument for mustache#render(template, view, partials)');\n }\n\n return defaultWriter.render(template, view, partials, tags);\n };\n\n // Export the escaping function so that the user may override it.\n // See https://github.com/janl/mustache.js/issues/244\n mustache.escape = escapeHtml;\n\n // Export these mainly for testing, but also for advanced usage.\n mustache.Scanner = Scanner;\n mustache.Context = Context;\n mustache.Writer = Writer;\n\n return mustache;\n\n})));\n","import jQuery from 'jquery';\nimport _ from 'underscores';\nimport { dt } from 'window';\nimport Mustache from 'mustache';\n\nlet selectedConnections = {},\n\tsearchString = '';\nconst processTemplate = _.memoize( ( id ) => {\n\tconst element = document.getElementById( id );\n\tif ( ! element ) {\n\t\treturn false;\n\t}\n\n\tif ( element.attributes.template ) {\n\t\tMustache.parse( element.innerHTML );\n\t\treturn 'mustache';\n\t} else {\n\t\t// Use WordPress style Backbone template syntax\n\t\tconst options = {\n\t\t\tevaluate: /<#([\\s\\S]+?)#>/g,\n\t\t\tinterpolate: /{{{([\\s\\S]+?)}}}/g,\n\t\t\tescape: /{{([^}]+?)}}(?!})/g\n\t\t};\n\n\t\treturn _.template( element.innerHTML, null, options );\n\t}\n} );\n\njQuery( window ).on( 'load', () => {\n\tconst distributorAdminItem = document.querySelector( '#wp-admin-bar-distributor > a' );\n\tconst distributorTopMenu = document.querySelector( '#wp-admin-bar-distributor' );\n\tconst distributorMenuItem = document.querySelector( '#wp-admin-bar-distributor #wp-admin-bar-distributor-placeholder' );\n\tconst distributorPushWrapper = document.querySelector( '#distributor-push-wrapper' );\n\n\tif ( ! distributorMenuItem || ! distributorPushWrapper ) {\n\t\treturn;\n\t}\n\n\tlet dtConnections \t\t= '';\n\tlet connectionsSelected \t\t= '';\n\tlet connectionsSelectedList \t\t= '';\n\tlet connectionsNewList \t\t= '';\n\tlet connectionsNewListChildren \t= '';\n\tlet connectionsAvailableTotal\t\t= '';\n\tlet selectAllConnections \t\t\t= '';\n\tlet selectNoConnections\t\t\t\t= '';\n\tlet connectionsSearchInput \t\t= '';\n\tlet postStatusInput \t\t= '';\n\tlet asDraftInput \t\t= '';\n\tlet errorDetails \t\t= '';\n\n\tdistributorMenuItem.appendChild( distributorPushWrapper );\n\n\t/**\n\t * Set variables after connections have been rendered\n\t */\n\tfunction setVariables() {\n\t\tconnectionsSelected \t= distributorPushWrapper.querySelector( '.connections-selected' );\n\t\tconnectionsSelectedList \t= distributorPushWrapper.querySelector( '.selected-connections-list' );\n\t\tconnectionsNewList \t= distributorPushWrapper.querySelector( '.new-connections-list' );\n\t\tselectAllConnections \t\t= distributorPushWrapper.querySelector( '.selectall-connections' );\n\t\tselectNoConnections \t\t= distributorPushWrapper.querySelector( '.selectno-connections' );\n\t\tconnectionsSearchInput \t= document.getElementById( 'dt-connection-search' );\n\t\tpostStatusInput \t= document.getElementById( 'dt-post-status' );\n\t\tasDraftInput \t= document.getElementById( 'dt-as-draft' );\n\t\terrorDetails = document.querySelector( '.dt-error ul.details' );\n\n\t\tif ( null !== connectionsNewList ){\n\t\t\tconnectionsNewListChildren = connectionsNewList.querySelectorAll( '.add-connection' );\n\t\t}\n\n\t\t/**\n\t\t * Listen for connection filtering\n\t\t */\n\t\tjQuery( connectionsSearchInput ).on( 'keyup change', _.debounce( ( event ) => {\n\t\t\tif ( '' === event.currentTarget.value ) {\n\t\t\t\tshowConnections( dtConnections );\n\t\t\t}\n\t\t\tsearchString = event.currentTarget.value.replace( /https?:\\/\\//i, '' ).replace( /www/i, '' ).replace( /[^0-9a-zA-Z ]+/, '' );\n\t\t\tshowConnections();\n\t\t}, 300 ) );\n\n\t\t/**\n\t\t * Disable select all button if all connections are syndicated and set variable for total connections available\n\t\t */\n\t\t_.each( connectionsNewListChildren, ( element ) => {\n\t\t\tif ( ! element.classList.contains ( 'syndicated' ) ) {\n\t\t\t\tselectAllConnections.classList.remove( 'unavailable' );\n\t\t\t\tconnectionsAvailableTotal ++;\n\t\t\t}\n\t\t} );\n\n\t}\n\n\t/**\n\t * Set the disabled attribute on connections already syndicated\n\t *\n\t * This is currently only used for the mustache templates, which\n\t * are only used in AMP contexts. Seems the AMP plugin will\n\t * strip out any normal disabled attributes, so we handle that here\n\t * instead of in the template.\n\t */\n\tfunction setDisabledConnections() {\n\t\tconnectionsNewList = distributorPushWrapper.querySelector( '.new-connections-list' );\n\n\t\tif ( null !== connectionsNewList ) {\n\t\t\tconnectionsNewListChildren = connectionsNewList.querySelectorAll( '.add-connection' );\n\n\t\t\t_.each( connectionsNewListChildren, ( element ) => {\n\t\t\t\tif ( element.classList.contains ( 'syndicated' ) ) {\n\t\t\t\t\telement.disabled = true;\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t}\n\n\t/**\n\t * Handle UI error changes\n\t */\n\tfunction doError( messages ) {\n\t\tdistributorPushWrapper.classList.add( 'message-error' );\n\t\terrorDetails.innerText = '';\n\n\t\t_.each( prepareMessages( messages ), function( message ) {\n\t\t\tconst errorItem = document.createElement( 'li' );\n\t\t\terrorItem.innerText = message;\n\t\t\terrorDetails.appendChild( errorItem );\n\t\t} );\n\t}\n\n\t/**\n\t * Prepare error messages for printing.\n\t *\n\t * @param {string|array} messages Error messages.\n\t */\n\tfunction prepareMessages( messages ) {\n\t\tif ( ! _.isArray( messages ) ) {\n\t\t\treturn [ messages ];\n\t\t}\n\n\t\treturn _.map( messages, function( message ) {\n\t\t\tif ( _.isString( message ) ) {\n\t\t\t\treturn message;\n\t\t\t}\n\t\t\tif ( _.has( message, 'message' ) ) {\n\t\t\t\treturn message.message;\n\t\t\t}\n\t\t} );\n\t}\n\n\t/**\n\t * Handle UI success changes\n\t */\n\tfunction doSuccess( results ) {\n\t\tlet success = false;\n\t\tconst errors = {};\n\n\t\t[ 'internal', 'external' ].map( type => {\n\t\t\t_.each( results[type], ( result, connectionId ) => {\n\t\t\t\tif ( 'success' === result.status ) {\n\t\t\t\t\tdtConnections[ `${type}${ connectionId }` ].syndicated = result.url;\n\t\t\t\t\tsuccess = true;\n\t\t\t\t}\n\n\t\t\t\tif ( ! _.isEmpty( result.errors ) ) {\n\t\t\t\t\terrors[ `${type}${ connectionId }` ] = result.errors;\n\t\t\t\t}\n\t\t\t} );\n\t\t} );\n\n\t\tif ( ! _.isEmpty( errors ) ) {\n\t\t\tconst formattedErrors = _.map( errors, function( messages, connectionId ) {\n\t\t\t\treturn `${dtConnections[ connectionId ].name }:\\n${\n\t\t\t\t\t_.map( messages, function( message ) {\n\t\t\t\t\t\treturn `- ${message}\\n`;\n\t\t\t\t\t} )}`;\n\t\t\t} );\n\n\t\t\tdoError( formattedErrors );\n\t\t}\n\n\t\tif ( success && _.isEmpty( errors ) ) {\n\t\t\tdistributorPushWrapper.classList.add( 'message-success' );\n\n\t\t\tconnectionsSelected.classList.add( 'empty' );\n\t\t\tconnectionsSelectedList.innerText = '';\n\n\t\t\tsetTimeout( () => {\n\t\t\t\tdistributorPushWrapper.classList.remove( 'message-success' );\n\t\t\t}, 6000 );\n\t\t}\n\n\t\tselectedConnections = {};\n\n\t\tshowConnections();\n\t}\n\n\t/**\n\t * Show connections. If there is a search string, then filter by it\n\t*/\n\tfunction showConnections() {\n\t\tconnectionsNewList.innerText = '';\n\t\tconst template = processTemplate( 'dt-add-connection' );\n\t\tlet showConnection = '';\n\n\t\t_.each( dtConnections, ( connection ) => {\n\t\t\tif ( '' !== searchString ) {\n\t\t\t\tconst nameMatch = connection.name.replace( /[^0-9a-zA-Z ]+/, '' ).toLowerCase().match( searchString.toLowerCase() );\n\t\t\t\tconst urlMatch = connection.url.replace( /https?:\\/\\//i, '' ).replace( /www/i, '' ).replace( /[^0-9a-zA-Z ]+/, '' ).toLowerCase().match( searchString.toLowerCase() );\n\n\t\t\t\tif ( ! nameMatch && ! urlMatch ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( 'mustache' === template ) {\n\t\t\t\t// Modify connection data to match what mustache wants\n\t\t\t\tif ( selectedConnections[connection.type + connection.id] ) {\n\t\t\t\t\tconnection.added = true;\n\t\t\t\t} else {\n\t\t\t\t\tconnection.added = false;\n\t\t\t\t}\n\n\t\t\t\tif ( 'internal' === connection.type ) {\n\t\t\t\t\tconnection.internal = true;\n\t\t\t\t}\n\n\t\t\t\tshowConnection = Mustache.render( document.getElementById( 'dt-add-connection' ).innerHTML, {\n\t\t\t\t\tconnection: connection,\n\t\t\t\t} );\n\t\t\t} else {\n\t\t\t\tshowConnection = template( {\n\t\t\t\t\tconnection: connection,\n\t\t\t\t\tselectedConnections: selectedConnections\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tconnectionsNewList.innerHTML += showConnection;\n\t\t} );\n\n\t\tif ( '' === connectionsNewList.innerHTML ) {\n\t\t\tconnectionsNewList.innerHTML = '

No results

';\n\t\t}\n\n\t\tif ( 'mustache' === template ) {\n\t\t\tsetDisabledConnections();\n\t\t}\n\t}\n\n\t/**\n\t * Add or remove CSS classes to indicate button functionality\n\t*/\n\tfunction classList( expr ) {\n\t\tswitch ( expr ) {\n\t\t\t\tcase 'addEmpty':\n\t\t\t\t\tconnectionsSelected.classList.add( 'empty' );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'removeEmpty':\n\t\t\t\t\tconnectionsSelected.classList.remove( 'empty' );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'allUnavailable':\n\t\t\t\t\tselectAllConnections.classList.add ( 'unavailable' );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'all':\n\t\t\t\t\tselectAllConnections.classList.remove ( 'unavailable' );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'noneUnavailable':\n\t\t\t\t\tselectNoConnections.classList.add ( 'unavailable' );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'none':\n\t\t\t\t\tselectNoConnections.classList.remove ( 'unavailable' );\n\t\t\t\t\tbreak;\n\t\t}\n\t}\n\n\t/**\n\t * Handle distributor push dropdown menu.\n\t */\n\tfunction distributorMenuEntered() {\n\t\tdistributorMenuItem.focus();\n\n\t\tif ( distributorPushWrapper.classList.contains( 'loaded' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tdistributorPushWrapper.classList.remove( 'message-error' );\n\t\tdistributorPushWrapper.classList.add( 'loaded' );\n\n\t\tconst data = {\n\t\t\taction: 'dt_load_connections',\n\t\t\tloadConnectionsNonce: dt.loadConnectionsNonce,\n\t\t\tpostId: dt.postId\n\t\t};\n\n\t\tconst template = processTemplate( 'dt-show-connections' );\n\t\tconst xhr = dt.usexhr ? { withCredentials: true } : false;\n\n\t\tjQuery.ajax( {\n\t\t\turl: dt.ajaxurl,\n\t\t\txhrFields: xhr,\n\t\t\tmethod: 'post',\n\t\t\tdata: data\n\t\t} ).done( ( response ) => {\n\t\t\tif ( ! response.success || ! response.data ) {\n\t\t\t\tdistributorPushWrapper.classList.remove( 'loaded' );\n\t\t\t\tdistributorPushWrapper.classList.add( 'message-error' );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tdtConnections = response.data;\n\n\t\t\tif ( 'mustache' === template ) {\n\t\t\t\t// Manipulate the data to match what mustache needs\n\t\t\t\tconst mustacheData = { 'connections' : [] };\n\t\t\t\t_.each( dtConnections, ( connection ) => {\n\t\t\t\t\tif ( 'internal' === connection.type ) {\n\t\t\t\t\t\tconnection.internal = true;\n\t\t\t\t\t}\n\n\t\t\t\t\tmustacheData.connections.push( connection );\n\t\t\t\t} );\n\n\t\t\t\tdistributorPushWrapper.innerHTML = Mustache.render( document.getElementById( 'dt-show-connections' ).innerHTML, {\n\t\t\t\t\tconnections: mustacheData.connections,\n\t\t\t\t\tfoundConnections: mustacheData.connections.length,\n\t\t\t\t\tshowSearch: 5 < mustacheData.connections.length,\n\t\t\t\t} );\n\n\t\t\t\tsetDisabledConnections();\n\t\t\t} else {\n\t\t\t\tdistributorPushWrapper.innerHTML = template( {\n\t\t\t\t\tconnections: dtConnections,\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tsetVariables();\n\t\t} ).error( () => {\n\t\t\tdistributorPushWrapper.classList.remove( 'loaded' );\n\t\t\tdistributorPushWrapper.classList.add( 'message-error' );\n\t\t} );\n\t}\n\n\t// Event listerners when to fetch distributor data.\n\tdistributorAdminItem.addEventListener( 'keydown', function( e ) {\n\t\t// Pressing Enter.\n\t\tif ( ( 13 === e.keyCode ) ) {\n\t\t\tdistributorMenuEntered();\n\t\t}\n\t}, false );\n\n\tdistributorAdminItem.addEventListener( 'touchstart', distributorMenuEntered, false );\n\tdistributorAdminItem.addEventListener( 'mouseenter', distributorMenuEntered, false );\n\n\t/**\n\t * Do syndication ajax\n\t */\n\tjQuery( distributorPushWrapper ).on( 'click', '.syndicate-button', () => {\n\t\tif ( distributorTopMenu.classList.contains( 'syncing' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tdistributorTopMenu.classList.add( 'syncing' );\n\n\t\tconst data = {\n\t\t\taction: 'dt_push',\n\t\t\tnonce: dt.nonce,\n\t\t\tconnections: selectedConnections,\n\t\t\tpostId: dt.postId\n\t\t};\n\n\t\tdata.postStatus = ( null !== asDraftInput && asDraftInput.checked ) ? 'draft' : postStatusInput.value;\n\n\t\tconst xhr = dt.usexhr ? { withCredentials: true } : false;\n\n\t\tjQuery.ajax( {\n\t\t\turl: dt.ajaxurl,\n\t\t\txhrFields: xhr,\n\t\t\tmethod: 'post',\n\t\t\tdata: data\n\t\t} ).done( ( response ) => {\n\t\t\tsetTimeout( () => {\n\t\t\t\tdistributorTopMenu.classList.remove( 'syncing' );\n\n\t\t\t\tif ( ! response.success ) {\n\t\t\t\t\tdoError( response.data );\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( ! response.data || ! response.data.results ) {\n\t\t\t\t\tdoError( dt.messages.empty_result );\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tdoSuccess( response.data.results );\n\t\t\t}, 500 );\n\t\t} ).error( ( xhr, textStatus, errorThrown ) => {\n\t\t\tsetTimeout( () => {\n\t\t\t\tdistributorTopMenu.classList.remove( 'syncing' );\n\n\t\t\t\tdoError( `${dt.messages.ajax_error} ${errorThrown}` );\n\t\t\t}, 500 );\n\t\t} );\n\t} );\n\n\t/**\n\t * Add a connection to selected connections for ajax and to the UI list.\n\t */\n\tjQuery( distributorPushWrapper ).on( 'click', '.add-connection', ( event ) => {\n\t\tif ( 'A' === event.target.nodeName ) {\n\t\t\treturn;\n\t\t}\n\n\t\tevent.preventDefault();\n\n\t\tif ( event.currentTarget.classList.contains( 'syndicated' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( event.currentTarget.classList.contains( 'added' ) ) {\n\t\t\tconst type = event.currentTarget.getAttribute( 'data-connection-type' );\n\t\t\tconst id = event.currentTarget.getAttribute( 'data-connection-id' );\n\n\t\t\tconst deleteNode = connectionsSelectedList.querySelector( `[data-connection-id=\"${ id }\"][data-connection-type=\"${ type }\"]` );\n\n\t\t\tdeleteNode.parentNode.removeChild( deleteNode );\n\n\t\t\tdelete selectedConnections[type + id];\n\n\t\t\tif ( selectAllConnections.classList.contains ( 'unavailable' ) ) {\n\t\t\t\tclassList ( 'all' );\n\t\t\t}\n\t\t\tif ( ! Object.keys( selectedConnections ).length ) {\n\t\t\t\tclassList ( 'addEmpty' );\n\t\t\t\tclassList ( 'noneUnavailable' );\n\t\t\t}\n\n\t\t\tshowConnections();\n\t\t} else {\n\t\t\tconst type = event.currentTarget.getAttribute( 'data-connection-type' );\n\t\t\tconst id = event.currentTarget.getAttribute( 'data-connection-id' );\n\n\t\t\tselectedConnections[type + id] = dtConnections[type + id];\n\n\t\t\tconst element = event.currentTarget.cloneNode( true );\n\n\t\t\tconst removeLink = document.createElement( 'span' );\n\t\t\tremoveLink.classList.add( 'remove-connection' );\n\n\t\t\telement.appendChild( removeLink );\n\t\t\telement.classList = 'added-connection';\n\t\t\tconnectionsSelectedList.appendChild( element );\n\n\t\t\tif ( selectNoConnections.classList.contains ( 'unavailable' ) ) {\n\t\t\t\tclassList ( 'removeEmpty' );\n\t\t\t\tclassList ( 'none' );\n\t\t\t}\n\n\t\t\tif ( Object.keys( selectedConnections ).length == connectionsAvailableTotal ){\n\t\t\t\tclassList ( 'allUnavailable' );\n\t\t\t}\n\n\t\t\tshowConnections();\n\t\t}\n\t} );\n\n\t/**\n\t * Select all connections for distribution.\n\t*/\n\tjQuery( distributorPushWrapper ).on( 'click', '.selectall-connections', () => {\n\t\tjQuery ( connectionsNewList ).children( '.add-connection' ).each( ( index, childTarget ) => {\n\t\t\tif ( childTarget.classList.contains( 'syndicated' ) || childTarget.classList.contains( 'added' ) ) {\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\tconst type = childTarget.getAttribute( 'data-connection-type' );\n\t\t\t\tconst id = childTarget.getAttribute( 'data-connection-id' );\n\n\t\t\t\tselectedConnections[type + id] = dtConnections[type + id];\n\n\t\t\t\tconst element = childTarget.cloneNode();\n\t\t\t\telement.innerText = childTarget.innerText;\n\n\t\t\t\tconst removeLink = document.createElement( 'span' );\n\t\t\t\tremoveLink.classList.add( 'remove-connection' );\n\n\t\t\t\telement.appendChild( removeLink );\n\t\t\t\telement.classList = 'added-connection';\n\n\t\t\t\tconnectionsSelectedList.appendChild( element );\n\n\t\t\t}\n\n\t\t\tif ( '' !== connectionsAvailableTotal ) {\n\t\t\t\tclassList ( 'removeEmpty' );\n\t\t\t\tclassList ( 'allUnavailable' );\n\t\t\t\tclassList ( 'none' );\n\t\t\t}\n\n\t\t} );\n\n\t\tshowConnections();\n\t} );\n\n\t/**\n\t * Select no connections for distribution.\n\t*/\n\tjQuery( distributorPushWrapper ).on( 'click', '.selectno-connections', () => {\n\n\t\twhile ( connectionsSelectedList.firstChild ) {\n\t\t\tconst type = connectionsSelectedList.firstChild.getAttribute( 'data-connection-type' );\n\t\t\tconst id = connectionsSelectedList.firstChild.getAttribute( 'data-connection-id' );\n\n\t\t\tdelete selectedConnections[type + id];\n\n\t\t\tconnectionsSelectedList.removeChild( connectionsSelectedList.firstChild );\n\n\t\t}\n\n\t\tif ( '' !== connectionsAvailableTotal ) {\n\t\t\tclassList ( 'addEmpty' );\n\t\t\tclassList ( 'noneUnavailable' );\n\t\t\tclassList ( 'all' );\n\t\t}\n\n\t\tshowConnections();\n\t} );\n\n\t/**\n\t * Remove a connection from selected connections and the UI list\n\t */\n\tjQuery( distributorPushWrapper ).on( 'click', '.added-connection', ( event ) => {\n\t\tevent.currentTarget.parentNode.removeChild( event.currentTarget );\n\t\tconst type = event.currentTarget.getAttribute( 'data-connection-type' );\n\t\tconst id = event.currentTarget.getAttribute( 'data-connection-id' );\n\n\t\tdelete selectedConnections[type + id];\n\n\t\tif ( selectAllConnections.classList.contains ( 'unavailable' ) ) {\n\t\t\tclassList ( 'all' );\n\t\t}\n\t\tif ( ! Object.keys( selectedConnections ).length ) {\n\t\t\tclassList ( 'addEmpty' );\n\t\t\tclassList ( 'noneUnavailable' );\n\t\t}\n\n\t\tshowConnections();\n\t} );\n} );\n"],"sourceRoot":""} \ No newline at end of file diff --git a/distributor.php b/distributor.php index 39ef59b51..d767e0f11 100644 --- a/distributor.php +++ b/distributor.php @@ -2,7 +2,7 @@ /** * Plugin Name: Distributor * Description: Makes it easy to distribute and reuse content across your websites, whether inside of a multisite or across the web. - * Version: 1.6.0 + * Version: 1.6.1 * Author: 10up Inc. * Author URI: https://distributorplugin.com * License: GPLv2 or later @@ -17,8 +17,9 @@ exit; // Exit if accessed directly. } -define( 'DT_VERSION', '1.6.0' ); +define( 'DT_VERSION', '1.6.1' ); define( 'DT_PLUGIN_FILE', preg_replace( '#^.*plugins/(.*)$#i', '$1', __FILE__ ) ); +define( 'DT_PLUGIN_PATH', plugin_dir_path( __FILE__ ) ); // Define a constant if we're network activated to allow plugin to respond accordingly. $active_plugins = get_site_option( 'active_sitewide_plugins' ); diff --git a/includes/classes/Connection.php b/includes/classes/Connection.php index e2648830d..72af93b0d 100644 --- a/includes/classes/Connection.php +++ b/includes/classes/Connection.php @@ -18,7 +18,7 @@ abstract class Connection { * @param int $item_id Item ID to push if an update. * @param array $args Array of args to push. * @since 0.8 - * @return bool|WP_Error + * @return array|\WP_Error */ abstract public function push( $item_id, $args = array() ); diff --git a/includes/classes/ExternalConnections/WordPressExternalConnection.php b/includes/classes/ExternalConnections/WordPressExternalConnection.php index 9cb5cea5d..8b377f463 100644 --- a/includes/classes/ExternalConnections/WordPressExternalConnection.php +++ b/includes/classes/ExternalConnections/WordPressExternalConnection.php @@ -480,7 +480,7 @@ public function pull( $items ) { * @param int $post_id Post id * @param array $args Post args to push. * @since 0.8 - * @return bool|\WP_Error + * @return array|\WP_Error */ public function push( $post_id, $args = array() ) { if ( empty( $post_id ) ) { @@ -658,7 +658,15 @@ public function push( $post_id, $args = array() ) { \Distributor\Subscriptions\create_subscription( $post_id, $body_array['id'], untrailingslashit( $this->base_url ), $signature ); } - return $body_array['id']; + $remote_post = array( + 'id' => $body_array['id'], + ); + + if ( ! empty( $body_array['push-errors'] ) ) { + $remote_post['push-errors'] = $body_array['push-errors']; + } + + return $remote_post; } /** @@ -733,6 +741,7 @@ public function check_connections() { } else { $response = wp_remote_get( untrailingslashit( $this->base_url ), $this->auth_handler->format_get_args( array( 'timeout' => self::$timeout ) ) ); } + $body = wp_remote_retrieve_body( $response ); if ( is_wp_error( $response ) || empty( $body ) ) { @@ -787,70 +796,67 @@ public function check_connections() { } else { $types_response = wp_remote_get( $types_path, $this->auth_handler->format_get_args( array( 'timeout' => self::$timeout ) ) ); } + $types_body = wp_remote_retrieve_body( $types_response ); + $types = json_decode( $types_body, true ); - if ( is_wp_error( $types_response ) || empty( $types_body ) ) { + if ( is_wp_error( $types_response ) || 200 !== wp_remote_retrieve_response_code( $types_response ) || empty( $types_body ) || empty( $types ) ) { $output['errors']['no_types'] = 'no_types'; } else { - $types = json_decode( $types_body, true ); + $can_get = array(); + $can_post = array(); - if ( 200 !== wp_remote_retrieve_response_code( $types_response ) || empty( $types ) ) { - $output['errors']['no_types'] = 'no_types'; - } else { - $can_get = array(); - $can_post = array(); - - $permission_url = untrailingslashit( $this->base_url ) . '/' . self::$namespace . '/distributor/post-types-permissions'; - - if ( function_exists( 'vip_safe_wp_remote_get' ) && \Distributor\Utils\is_vip_com() ) { - $permission_response = vip_safe_wp_remote_get( - $permission_url, - false, - 3, - 3, - 10, - $this->auth_handler->format_get_args() - ); - } else { + $permission_url = untrailingslashit( $this->base_url ) . '/' . self::$namespace . '/distributor/post-types-permissions'; - $permission_response = wp_remote_get( - $permission_url, - $this->auth_handler->format_get_args( - array( - 'timeout' => self::$timeout, - ) + if ( function_exists( 'vip_safe_wp_remote_get' ) && \Distributor\Utils\is_vip_com() ) { + $permission_response = vip_safe_wp_remote_get( + $permission_url, + false, + 3, + 3, + 10, + $this->auth_handler->format_get_args() + ); + } else { + $permission_response = wp_remote_get( + $permission_url, + $this->auth_handler->format_get_args( + array( + 'timeout' => self::$timeout, ) - ); - } + ) + ); + } - $permissions = json_decode( wp_remote_retrieve_body( $permission_response ) ); + $permissions = json_decode( wp_remote_retrieve_body( $permission_response ) ); - if ( - is_wp_error( $permission_response ) - || empty( $permissions ) - || ! isset( $permissions->can_get ) - || ! isset( $permissions->can_post ) - ) { - $output['errors']['no_permissions'] = 'no_permissions'; - } else { - $can_get = array_values( - array_filter( - $permissions->can_get, - [ $this, 'not_distributor_internal_post_type' ] - ) - ); + $output['is_authenticated'] = isset( $permissions->is_authenticated ) ? $permissions->is_authenticated : 'na'; - $can_post = array_values( - array_filter( - $permissions->can_post, - [ $this, 'not_distributor_internal_post_type' ] - ) - ); - } + if ( + is_wp_error( $permission_response ) + || empty( $permissions ) + || ! isset( $permissions->can_get ) + || ! isset( $permissions->can_post ) + ) { + $output['errors']['no_permissions'] = 'no_permissions'; + } else { + $can_get = array_values( + array_filter( + $permissions->can_get, + [ $this, 'not_distributor_internal_post_type' ] + ) + ); - $output['can_get'] = $can_get; - $output['can_post'] = $can_post; + $can_post = array_values( + array_filter( + $permissions->can_post, + [ $this, 'not_distributor_internal_post_type' ] + ) + ); } + + $output['can_get'] = $can_get; + $output['can_post'] = $can_post; } return $output; diff --git a/includes/classes/InternalConnections/NetworkSiteConnection.php b/includes/classes/InternalConnections/NetworkSiteConnection.php index fe0d8c079..0c330206f 100644 --- a/includes/classes/InternalConnections/NetworkSiteConnection.php +++ b/includes/classes/InternalConnections/NetworkSiteConnection.php @@ -60,13 +60,14 @@ public function __construct( WP_Site $site ) { * @param int $post_id Post ID. * @param array $args Push args. * @since 0.8 - * @return int|WP_Error + * @return array|\WP_Error */ public function push( $post_id, $args = array() ) { $post = get_post( $post_id ); $original_blog_id = get_current_blog_id(); $original_post_url = get_permalink( $post_id ); $using_gutenberg = \Distributor\Utils\is_using_gutenberg( $post ); + $output = array(); $new_post_args = array( 'post_title' => get_the_title( $post_id ), @@ -115,6 +116,8 @@ public function push( $post_id, $args = array() ) { remove_filter( 'wp_insert_post_data', array( '\Distributor\InternalConnections\NetworkSiteConnection', 'maybe_set_modified_date' ), 10, 2 ); if ( ! is_wp_error( $new_post_id ) ) { + $output['id'] = $new_post_id; + update_post_meta( $new_post_id, 'dt_original_post_id', (int) $post_id ); update_post_meta( $new_post_id, 'dt_original_blog_id', (int) $original_blog_id ); update_post_meta( $new_post_id, 'dt_syndicate_time', time() ); @@ -144,6 +147,13 @@ public function push( $post_id, $args = array() ) { if ( apply_filters( 'dt_push_post_media', true, $new_post_id, $post->media, $post_id, $args, $this ) ) { Utils\set_media( $new_post_id, $post->media, [ 'use_filesystem' => true ] ); }; + + $media_errors = get_transient( 'dt_media_errors_' . $new_post_id ); + + if ( $media_errors ) { + $output['push-errors'] = $media_errors; + delete_transient( 'dt_media_errors_' . $new_post_id ); + } } /** @@ -160,7 +170,11 @@ public function push( $post_id, $args = array() ) { restore_current_blog(); - return $new_post_id; + if ( is_wp_error( $new_post_id ) ) { + return $new_post_id; + } + + return $output; } /** diff --git a/includes/external-connection-cpt.php b/includes/external-connection-cpt.php index 22a811be6..40e509a7c 100644 --- a/includes/external-connection-cpt.php +++ b/includes/external-connection-cpt.php @@ -281,10 +281,11 @@ function admin_enqueue_scripts( $hook ) { 'good_connection' => esc_html__( 'Connection established.', 'distributor' ), 'limited_connection' => esc_html__( 'Limited connection established.', 'distributor' ), 'no_push' => esc_html__( 'Push distribution unavailable.', 'distributor' ), + 'no_permissions' => esc_html__( 'Authentication succeeded but your account does not have permissions to create posts on the external site.', 'distributor' ), 'pull_limited' => esc_html__( 'Pull distribution limited to basic content, i.e. title and content body.', 'distributor' ), 'endpoint_suggestion' => esc_html__( 'Did you mean: ', 'distributor' ), 'endpoint_checking_message' => esc_html__( 'Checking endpoint...', 'distributor' ), - 'bad_auth' => esc_html__( 'Authentication failed.', 'distributor' ), + 'bad_auth' => esc_html__( 'Authentication failed due to invalid credentials.', 'distributor' ), 'change' => esc_html__( 'Change', 'distributor' ), 'cancel' => esc_html__( 'Cancel', 'distributor' ), 'invalid_url' => esc_html__( 'Please enter a valid URL, including the HTTP(S).', 'distributor' ), @@ -444,6 +445,15 @@ function meta_box_external_connection_details( $post ) { $external_connection_url = ''; } + $external_connection_status = get_post_meta( $post->ID, 'dt_external_connections', true ); + + $post_types = get_post_types( + array( + 'show_in_rest' => true, + ), + 'objects' + ); + $registered_external_connection_types = \Distributor\Connections::factory()->get_registered(); foreach ( $registered_external_connection_types as $slug => $class ) { @@ -469,7 +479,7 @@ function meta_box_external_connection_details( $post ) { ?>

- +

+ +
+

+ + + + + + + + + + name ) { + continue; + } + ?> + + + + + + + +
label ); ?>name, $external_connection_status['can_get'] ) ? esc_html__( 'Yes', 'distributor' ) : esc_html__( 'No', 'distributor' ); ?>name, $external_connection_status['can_post'] ) ? esc_html__( 'Yes', 'distributor' ) : esc_html__( 'No', 'distributor' ); ?>
+
+ +
@@ -557,7 +595,7 @@ function meta_box_external_connection_details( $post ) { function dashboard() { global $connection_list_table; - $_GET['post_type'] = 'dt_ext_connection'; + $_GET['post_type'] = 'dt_ext_connection'; $_REQUEST['all_posts'] = true; // Default to replacite "All" tab $connection_list_table->prepare_items(); @@ -736,14 +774,14 @@ function filter_post_updated_messages( $messages ) { * * @param string $site_url Remote site URL. * - * @return false|string + * @return false|string|WP_Error */ function get_rest_url( $site_url ) { $source = wp_remote_get( $site_url ); if ( is_wp_error( $source ) ) { - return false; + return $source; } $dom = new \DOMDocument(); @@ -757,7 +795,7 @@ function get_rest_url( $site_url ) { } } - return false; + return new \WP_Error( 'rest_api_uri_not_found', __( 'The external site is private or not a WordPress site.', 'distributor' ) ); } /** @@ -776,8 +814,8 @@ function get_remote_distributor_info() { $rest_url = get_rest_url( $_POST['url'] ); - if ( ! $rest_url ) { - wp_send_json_error(); + if ( is_wp_error( $rest_url ) ) { + wp_send_json_error( $rest_url ); exit; } diff --git a/includes/pull-ui.php b/includes/pull-ui.php index 76a64f1d2..ae1cdefcd 100644 --- a/includes/pull-ui.php +++ b/includes/pull-ui.php @@ -235,12 +235,25 @@ function( $remote_post_id ) use ( $post_type ) { } $post_id_mappings = array(); + $pull_errors = array(); foreach ( $posts as $key => $post_array ) { if ( is_wp_error( $new_posts[ $key ] ) ) { + $pull_errors[ $post_array['remote_post_id'] ] = [ $new_posts[ $key ]->get_error_message() ]; continue; } $post_id_mappings[ $post_array['remote_post_id'] ] = $new_posts[ $key ]; + + $media_errors = get_transient( 'dt_media_errors_' . $new_posts[ $key ] ); + + if ( ! empty( $media_errors ) ) { + delete_transient( 'dt_media_errors_' . $new_posts[ $key ] ); + $pull_errors[ $post_array['remote_post_id'] ] = $media_errors; + } + } + + if ( ! empty( $pull_errors ) ) { + set_transient( 'dt_connection_pull_errors_' . $connection->id, $pull_errors, DAY_IN_SECONDS ); } $connection->log_sync( $post_id_mappings ); @@ -435,6 +448,8 @@ function dashboard() { + + prepare_items(); ?> pull_error ) ) : ?> @@ -458,3 +473,56 @@ function dashboard() { id ); + + if ( empty( $pull_errors ) ) { + return; + } + + delete_transient( 'dt_connection_pull_errors_' . $connection_now->id ); + + $post_ids = array_keys( $pull_errors ); + + $_posts = $connection_now->remote_get( [ 'post__in' => $post_ids ] ); + $posts = []; + + if ( empty( $_posts ) ) { + return; + } + + foreach ( $_posts['items'] as $post ) { + $posts[ $post->ID ] = $post->post_title; + } + ?> + +
+

+
    + $errors ) : ?> +
  • + : +
      + +
    • + +
    +
  • + +
+
+ + push( intval( $_POST['postId'] ), $push_args ); + $remote_post = $external_connection->push( intval( $_POST['postId'] ), $push_args ); /** * Record the external connection id's remote post id for this local post */ - if ( ! is_wp_error( $remote_id ) ) { + if ( ! is_wp_error( $remote_post ) ) { $connection_map['external'][ (int) $connection['id'] ] = array( - 'post_id' => (int) $remote_id, + 'post_id' => (int) $remote_post['id'], 'time' => time(), ); $external_push_results[ (int) $connection['id'] ] = array( - 'post_id' => (int) $remote_id, + 'post_id' => (int) $remote_post['id'], 'date' => gmdate( 'F j, Y g:i a' ), 'status' => 'success', 'url' => sprintf( '%1$s/?p=%2$d', get_site_url_from_rest_url( $external_connection_url ), - (int) $remote_id + (int) $remote_post['id'] ), + 'errors' => empty( $remote_post['push-errors'] ) ? array() : $remote_post['push-errors'], ); - $external_connection->log_sync( array( $remote_id => $_POST['postId'] ) ); + $external_connection->log_sync( array( (int) $remote_post['id'] => $_POST['postId'] ) ); } else { $external_push_results[ (int) $connection['id'] ] = array( - 'post_id' => (int) $remote_id, - 'date' => gmdate( 'F j, Y g:i a' ), - 'status' => 'fail', + 'date' => gmdate( 'F j, Y g:i a' ), + 'status' => 'fail', + 'errors' => array( $remote_post->get_error_message() ), ); } } @@ -322,34 +325,35 @@ function ajax_push() { $push_args['post_status'] = esc_attr( $_POST['postStatus'] ); } - $remote_id = $internal_connection->push( intval( $_POST['postId'] ), $push_args ); + $remote_post = $internal_connection->push( intval( $_POST['postId'] ), $push_args ); /** * Record the internal connection id's remote post id for this local post */ - if ( ! is_wp_error( $remote_id ) ) { + if ( ! is_wp_error( $remote_post ) ) { $origin_site = get_current_blog_id(); switch_to_blog( intval( $connection['id'] ) ); - $remote_url = get_permalink( $remote_id ); - $internal_connection->log_sync( array( $_POST['postId'] => $remote_id ), $origin_site ); + $remote_url = get_permalink( $remote_post['id'] ); + $internal_connection->log_sync( array( $_POST['postId'] => $remote_post['id'] ), $origin_site ); restore_current_blog(); $connection_map['internal'][ (int) $connection['id'] ] = array( - 'post_id' => (int) $remote_id, + 'post_id' => (int) $remote_post['id'], 'time' => time(), ); $internal_push_results[ (int) $connection['id'] ] = array( - 'post_id' => (int) $remote_id, + 'post_id' => (int) $remote_post['id'], 'url' => esc_url_raw( $remote_url ), 'date' => gmdate( 'F j, Y g:i a' ), 'status' => 'success', + 'errors' => empty( $remote_post['push-errors'] ) ? array() : $remote_post['push-errors'], ); } else { $internal_push_results[ (int) $connection['id'] ] = array( - 'post_id' => (int) $remote_id, - 'date' => gmdate( 'F j, Y g:i a' ), - 'status' => 'fail', + 'errors' => array( $remote_post->get_error_message() ), + 'date' => gmdate( 'F j, Y g:i a' ), + 'status' => 'fail', ); } } @@ -390,6 +394,10 @@ function enqueue_scripts( $hook ) { 'loadConnectionsNonce' => wp_create_nonce( 'dt-load-connections' ), 'postId' => (int) get_the_ID(), 'ajaxurl' => esc_url( admin_url( 'admin-ajax.php' ) ), + 'messages' => array( + 'ajax_error' => __( 'Ajax error:', 'distributor' ), + 'empty_result' => __( 'Received empty result.', 'distributor' ), + ), /** * Filter whether front end ajax requests should use xhrFields credentials:true. @@ -410,6 +418,59 @@ function enqueue_scripts( $hook ) { ); } +/** + * Add the elements we want amp dev mode added to + * + * @param array $xpaths Current array of element paths + * @return array + */ +function add_element_xpaths( $xpaths = [] ) { + if ( ! syndicatable() ) { + return $xpaths; + } + + $ids = [ + 'dt-push-css', + 'dt-push-js', + 'dt-push-js-extra', + ]; + + foreach ( $ids as $id ) { + $xpaths[] = sprintf( '//*[ @id = "%s" ]', $id ); + } + + return $xpaths; +} + +/** + * Add the amp dev mode to assets we need for distribution to work + * + * @param string $tag The ` - - -
diff --git a/includes/rest-api.php b/includes/rest-api.php index 545956899..c9bbb0fd1 100644 --- a/includes/rest-api.php +++ b/includes/rest-api.php @@ -20,6 +20,7 @@ function setup() { function() { add_action( 'rest_api_init', __NAMESPACE__ . '\register_endpoints' ); add_action( 'rest_api_init', __NAMESPACE__ . '\register_rest_routes' ); + add_action( 'rest_api_init', __NAMESPACE__ . '\register_push_errors_field' ); $post_types = get_post_types( array( @@ -137,8 +138,9 @@ function register_rest_routes() { 'wp/v2', 'distributor/post-types-permissions', array( - 'methods' => 'GET', - 'callback' => __NAMESPACE__ . '\check_post_types_permissions', + 'methods' => 'GET', + 'callback' => __NAMESPACE__ . '\check_post_types_permissions', + 'permission_callback' => '__return_true', ) ); } @@ -158,13 +160,16 @@ function prepare_distributor_content( $response, $post, $request ) { if ( '1' !== $request->get_param( 'distributor_request' ) ) { return $response; } + + $post_data = $response->get_data(); + // Is the local site is running Gutenberg? if ( \Distributor\Utils\is_using_gutenberg( $post ) ) { - $post_data = $response->get_data(); $post_data['is_using_gutenberg'] = true; - $response->set_data( $post_data ); } + $response->set_data( $post_data ); + return $response; } @@ -273,8 +278,9 @@ function register_endpoints() { 'wp/v2', '/dt_meta', array( - 'methods' => 'GET', - 'callback' => __NAMESPACE__ . '\distributor_meta', + 'methods' => 'GET', + 'callback' => __NAMESPACE__ . '\distributor_meta', + 'permission_callback' => '__return_true', ) ); @@ -301,8 +307,9 @@ function check_post_types_permissions() { ); $response = array( - 'can_get' => array(), - 'can_post' => array(), + 'can_get' => array(), + 'can_post' => array(), + 'is_authenticated' => get_current_user_id() ? 'yes' : 'no', ); foreach ( $types as $type ) { @@ -316,3 +323,33 @@ function check_post_types_permissions() { return $response; } + +/** + * Register push errors field so we can send errors over the REST API. + */ +function register_push_errors_field() { + + $post_types = get_post_types( + array( + 'show_in_rest' => true, + ) + ); + + foreach ( $post_types as $post_type ) { + register_rest_field( + $post_type, + 'push-errors', + array( + 'get_callback' => function( $params ) { + $media_errors = get_transient( 'dt_media_errors_' . $params['id'] ); + + if ( ! empty( $media_errors ) ) { + delete_transient( 'dt_media_errors_' . $params['id'] ); + return $media_errors; + } + return false; + }, + ) + ); + } +} diff --git a/includes/syndicated-post-ui.php b/includes/syndicated-post-ui.php index 9b6c0c1cc..32edd97e6 100644 --- a/includes/syndicated-post-ui.php +++ b/includes/syndicated-post-ui.php @@ -142,11 +142,10 @@ function remove_quick_edit( $actions, $post ) { function add_linked_class( $classes ) { global $post, $pagenow; - if ( 'post.php' !== $pagenow && 'post-new.php' !== $pagenow ) { - return ''; // Must stick to docblock, cannot return void. - } - - if ( empty( $_GET['post'] ) ) { // @codingStandardsIgnoreLine No nonce needed. + if ( + 'post.php' !== $pagenow && 'post-new.php' !== $pagenow + || empty( $_GET['post'] ) // @codingStandardsIgnoreLine No nonce needed. + ) { return $classes; } diff --git a/includes/utils.php b/includes/utils.php index 6077d715e..1b59fe1ff 100644 --- a/includes/utils.php +++ b/includes/utils.php @@ -895,6 +895,7 @@ function process_media( $url, $post_id, $args = [] ) { // Distributor is in debug mode, display the issue, could be storage related. if ( is_dt_debug() ) { error_log( sprintf( 'Distributor: %s', $file_array['tmp_name']->get_error_message() ) ); // @codingStandardsIgnoreLine + set_media_errors( $post_id, $file_array['tmp_name']->get_error_message() ); } return false; @@ -906,7 +907,8 @@ function process_media( $url, $post_id, $args = [] ) { // Distributor is in debug mode, display the issue, could be storage related. if ( is_dt_debug() ) { - error_log( sprintf( 'Distributor: %s', $file_array['tmp_name']->get_error_message() ) ); // @codingStandardsIgnoreLine + error_log( sprintf( 'Distributor: %s', $result->get_error_message() ) ); // @codingStandardsIgnoreLine + set_media_errors( $post_id, $result->get_error_message() ); } return false; @@ -1024,3 +1026,25 @@ function prepare_post( $post ) { $post->media = prepare_media( $post->ID ); return $post; } + +/** + * Use transient to store media errors temporarily. + * + * @param int $post_id Post ID where the media attaches to. + * @param array|string $data Error message. + */ +function set_media_errors( $post_id, $data ) { + $errors = get_transient( "dt_media_errors_$post_id" ); + + if ( ! $errors ) { + $errors = []; + } + + if ( is_array( $data ) ) { + $errors += $data; + } else { + $errors[] = $data; + } + + set_transient( "dt_media_errors_$post_id", $errors, HOUR_IN_SECONDS ); +} diff --git a/lang/distributor.pot b/lang/distributor.pot index 1f977ac5b..9d20b15b3 100644 --- a/lang/distributor.pot +++ b/lang/distributor.pot @@ -2,9 +2,9 @@ # This file is distributed under the GPLv2 or later. msgid "" msgstr "" -"Project-Id-Version: Distributor 1.6.0\n" +"Project-Id-Version: Distributor 1.6.1\n" "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/distributor\n" -"POT-Creation-Date: 2020-07-02 20:13:48+00:00\n" +"POT-Creation-Date: 2020-11-20 16:56:06+00:00\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -13,11 +13,11 @@ msgstr "" "Language-Team: LANGUAGE \n" "X-Generator: node-wp-i18n 1.2.3\n" -#: distributor.php:63 +#: distributor.php:64 msgid "Distributor requires PHP version 5.6." msgstr "" -#: distributor.php:64 +#: distributor.php:65 msgid "Error Activating" msgstr "" @@ -246,7 +246,7 @@ msgstr "" #: includes/classes/ExternalConnections/WordPressExternalConnection.php:205 #: includes/classes/ExternalConnections/WordPressExternalConnection.php:325 -#: includes/classes/ExternalConnections/WordPressExternalConnection.php:696 +#: includes/classes/ExternalConnections/WordPressExternalConnection.php:704 msgid "Could not connect to API endpoint." msgstr "" @@ -254,7 +254,7 @@ msgstr "" #: includes/classes/ExternalConnections/WordPressExternalConnection.php:339 #: includes/classes/ExternalConnections/WordPressExternalConnection.php:529 #: includes/classes/ExternalConnections/WordPressExternalConnection.php:645 -#: includes/classes/ExternalConnections/WordPressExternalConnection.php:702 +#: includes/classes/ExternalConnections/WordPressExternalConnection.php:710 msgid "Response body is empty" msgstr "" @@ -367,8 +367,9 @@ msgstr "" #: includes/classes/PullListTable.php:314 #: includes/classes/PullListTable.php:320 -#: includes/classes/PullListTable.php:330 includes/push-ui.php:535 -#: includes/push-ui.php:604 +#: includes/classes/PullListTable.php:330 templates/add-connection-amp.php:25 +#: templates/add-connection.php:19 templates/show-connections-amp.php:36 +#: templates/show-connections.php:35 msgid "View" msgstr "" @@ -399,10 +400,14 @@ msgid "Valid registration" msgstr "" #: includes/debug-info.php:85 includes/debug-info.php:99 +#: includes/external-connection-cpt.php:548 +#: includes/external-connection-cpt.php:549 msgid "Yes" msgstr "" #: includes/debug-info.php:85 includes/debug-info.php:99 +#: includes/external-connection-cpt.php:548 +#: includes/external-connection-cpt.php:549 msgid "No" msgstr "" @@ -440,10 +445,10 @@ msgstr "" msgid "Internal Connections" msgstr "" -#: includes/debug-info.php:108 includes/external-connection-cpt.php:567 -#: includes/external-connection-cpt.php:642 -#: includes/external-connection-cpt.php:643 -#: includes/external-connection-cpt.php:667 includes/pull-ui.php:375 +#: includes/debug-info.php:108 includes/external-connection-cpt.php:605 +#: includes/external-connection-cpt.php:680 +#: includes/external-connection-cpt.php:681 +#: includes/external-connection-cpt.php:705 includes/pull-ui.php:388 msgid "External Connections" msgstr "" @@ -480,7 +485,7 @@ msgstr "" msgid "WordPress.com Application" msgstr "" -#: includes/debug-info.php:201 includes/external-connection-cpt.php:520 +#: includes/debug-info.php:201 includes/external-connection-cpt.php:558 msgid "Roles Allowed to Push" msgstr "" @@ -546,195 +551,221 @@ msgid "Push distribution unavailable." msgstr "" #: includes/external-connection-cpt.php:284 -msgid "Pull distribution limited to basic content, i.e. title and content body." +msgid "" +"Authentication succeeded but your account does not have permissions to " +"create posts on the external site." msgstr "" #: includes/external-connection-cpt.php:285 -msgid "Did you mean: " +msgid "Pull distribution limited to basic content, i.e. title and content body." msgstr "" #: includes/external-connection-cpt.php:286 -msgid "Checking endpoint..." +msgid "Did you mean: " msgstr "" #: includes/external-connection-cpt.php:287 -msgid "Authentication failed." +msgid "Checking endpoint..." msgstr "" #: includes/external-connection-cpt.php:288 -msgid "Change" +msgid "Authentication failed due to invalid credentials." msgstr "" #: includes/external-connection-cpt.php:289 -msgid "Cancel" +msgid "Change" msgstr "" #: includes/external-connection-cpt.php:290 -msgid "Please enter a valid URL, including the HTTP(S)." +msgid "Cancel" msgstr "" #: includes/external-connection-cpt.php:291 -msgid "No REST API endpoint was located for this site." +msgid "Please enter a valid URL, including the HTTP(S)." msgstr "" #: includes/external-connection-cpt.php:292 -msgid "Unable to connect to site." +msgid "No REST API endpoint was located for this site." msgstr "" #: includes/external-connection-cpt.php:293 +msgid "Unable to connect to site." +msgstr "" + +#: includes/external-connection-cpt.php:294 msgid "" "Remote site requires Distributor version 1.6.0 or greater. Upgrade " "Distributor on the remote site to use the Authentication Wizard." msgstr "" -#: includes/external-connection-cpt.php:294 +#: includes/external-connection-cpt.php:295 msgid "Distributor not installed on remote site." msgstr "" -#: includes/external-connection-cpt.php:295 +#: includes/external-connection-cpt.php:296 msgid "" "Be careful assigning less trusted roles push privileges as they will " "inherit the capabilities of the user on the remote site." msgstr "" -#: includes/external-connection-cpt.php:298 +#: includes/external-connection-cpt.php:299 #. translators: %1$s: site name, %2$s: site URL msgid "Distributor on %1$s (%2$s)" msgstr "" -#: includes/external-connection-cpt.php:341 +#: includes/external-connection-cpt.php:342 msgid "Label this external connection" msgstr "" -#: includes/external-connection-cpt.php:423 +#: includes/external-connection-cpt.php:424 msgid "External Connection Details" msgstr "" -#: includes/external-connection-cpt.php:472 +#: includes/external-connection-cpt.php:482 msgid "Authorization rejected, please try again." msgstr "" -#: includes/external-connection-cpt.php:485 +#: includes/external-connection-cpt.php:495 msgid "Authentication Method" msgstr "" -#: includes/external-connection-cpt.php:510 +#: includes/external-connection-cpt.php:520 msgid "External Connection URL" msgstr "" -#: includes/external-connection-cpt.php:533 +#: includes/external-connection-cpt.php:531 +msgid "Post types permissions" +msgstr "" + +#: includes/external-connection-cpt.php:535 +msgid "Post types" +msgstr "" + +#: includes/external-connection-cpt.php:536 +msgid "Can pull?" +msgstr "" + +#: includes/external-connection-cpt.php:537 +msgid "Can push?" +msgstr "" + +#: includes/external-connection-cpt.php:571 msgid "" "Select the roles of users on this site that will be allowed to push content " "to this connection. Keep in mind that pushing will use the permissions of " "the user credentials provided for this connection." msgstr "" -#: includes/external-connection-cpt.php:542 +#: includes/external-connection-cpt.php:580 msgid "Update Connection" msgstr "" -#: includes/external-connection-cpt.php:544 +#: includes/external-connection-cpt.php:582 msgid "Move to Trash" msgstr "" -#: includes/external-connection-cpt.php:546 +#: includes/external-connection-cpt.php:584 msgid "Create Connection" msgstr "" -#: includes/external-connection-cpt.php:568 -#: includes/external-connection-cpt.php:669 +#: includes/external-connection-cpt.php:606 +#: includes/external-connection-cpt.php:707 #: vendor/georgestephanis/application-passwords/class.application-passwords.php:583 msgid "Add New" msgstr "" -#: includes/external-connection-cpt.php:571 -#: includes/external-connection-cpt.php:678 +#: includes/external-connection-cpt.php:609 +#: includes/external-connection-cpt.php:716 msgid "Filter connections list" msgstr "" -#: includes/external-connection-cpt.php:596 +#: includes/external-connection-cpt.php:634 msgid "External connections per page: " msgstr "" -#: includes/external-connection-cpt.php:668 +#: includes/external-connection-cpt.php:706 msgid "External Connection" msgstr "" -#: includes/external-connection-cpt.php:670 +#: includes/external-connection-cpt.php:708 msgid "Add New External Connection" msgstr "" -#: includes/external-connection-cpt.php:671 +#: includes/external-connection-cpt.php:709 msgid "Edit External Connection" msgstr "" -#: includes/external-connection-cpt.php:672 +#: includes/external-connection-cpt.php:710 msgid "New External Connection" msgstr "" -#: includes/external-connection-cpt.php:673 +#: includes/external-connection-cpt.php:711 msgid "All External Connections" msgstr "" -#: includes/external-connection-cpt.php:674 +#: includes/external-connection-cpt.php:712 msgid "View External Connection" msgstr "" -#: includes/external-connection-cpt.php:675 +#: includes/external-connection-cpt.php:713 msgid "Search External Connections" msgstr "" -#: includes/external-connection-cpt.php:676 +#: includes/external-connection-cpt.php:714 msgid "No external connections found." msgstr "" -#: includes/external-connection-cpt.php:677 +#: includes/external-connection-cpt.php:715 msgid "No external connections found in trash." msgstr "" -#: includes/external-connection-cpt.php:712 -#: includes/external-connection-cpt.php:715 +#: includes/external-connection-cpt.php:750 +#: includes/external-connection-cpt.php:753 msgid "External connection updated." msgstr "" -#: includes/external-connection-cpt.php:713 +#: includes/external-connection-cpt.php:751 msgid "Custom field updated." msgstr "" -#: includes/external-connection-cpt.php:714 +#: includes/external-connection-cpt.php:752 msgid "Custom field deleted." msgstr "" -#: includes/external-connection-cpt.php:717 +#: includes/external-connection-cpt.php:755 #. translators: %s: revision title msgid " External connection restored to revision from %s" msgstr "" -#: includes/external-connection-cpt.php:718 +#: includes/external-connection-cpt.php:756 msgid "External connection created." msgstr "" -#: includes/external-connection-cpt.php:719 +#: includes/external-connection-cpt.php:757 msgid "External connection saved." msgstr "" -#: includes/external-connection-cpt.php:720 +#: includes/external-connection-cpt.php:758 msgid "External connection submitted." msgstr "" -#: includes/external-connection-cpt.php:723 +#: includes/external-connection-cpt.php:761 #. translators: %s: a date and time msgid "External connection scheduled for: %1$s." msgstr "" -#: includes/external-connection-cpt.php:724 +#: includes/external-connection-cpt.php:762 msgid "M j, Y @ G:i" msgstr "" -#: includes/external-connection-cpt.php:726 +#: includes/external-connection-cpt.php:764 msgid "External connection draft updated." msgstr "" +#: includes/external-connection-cpt.php:798 +msgid "The external site is private or not a WordPress site." +msgstr "" + #: includes/pull-ui.php:129 includes/pull-ui.php:130 msgid "Pull Content" msgstr "" @@ -743,129 +774,110 @@ msgstr "" msgid "Posts per page" msgstr "" -#: includes/pull-ui.php:198 includes/pull-ui.php:268 +#: includes/pull-ui.php:198 includes/pull-ui.php:281 msgid "Cheatin’ uh?" msgstr "" -#: includes/pull-ui.php:199 includes/pull-ui.php:269 +#: includes/pull-ui.php:199 includes/pull-ui.php:282 msgid "Sorry, you are not allowed to add this item." msgstr "" -#: includes/pull-ui.php:344 +#: includes/pull-ui.php:357 msgid "No Connections to Pull from," msgstr "" -#: includes/pull-ui.php:346 +#: includes/pull-ui.php:359 msgid "Create One?" msgstr "" -#: includes/pull-ui.php:349 +#: includes/pull-ui.php:362 msgid "Pull Content from" msgstr "" -#: includes/pull-ui.php:353 +#: includes/pull-ui.php:366 msgid "Network Connections" msgstr "" -#: includes/pull-ui.php:422 +#: includes/pull-ui.php:435 msgid "Post(s) have been marked as skipped." msgstr "" -#: includes/pull-ui.php:428 +#: includes/pull-ui.php:441 msgid "Post(s) have been pulled." msgstr "" -#: includes/pull-ui.php:434 +#: includes/pull-ui.php:447 msgid "Post(s) have been already distributed." msgstr "" -#: includes/pull-ui.php:441 +#: includes/pull-ui.php:456 msgid "Could not pull content from connection due to error." msgstr "" -#: includes/pull-ui.php:453 +#: includes/pull-ui.php:468 msgid "Search" msgstr "" -#: includes/push-ui.php:498 -#. translators: %s: post type name -msgid "This %s has been distributed from" -msgstr "" - -#: includes/push-ui.php:501 -msgid "You can " -msgstr "" - -#: includes/push-ui.php:502 -msgid "view the original" -msgstr "" - -#: includes/push-ui.php:514 -#. translators: %s the post title -msgid "Distribute "%s" to other connections." -msgstr "" - -#: includes/push-ui.php:519 -msgid "Search available connections" -msgstr "" - -#: includes/push-ui.php:541 -msgid "Select All" +#: includes/pull-ui.php:512 +msgid "" +"Some errors occurred while pulling selected posts. Please review the list " +"of the errors bellow for more details." msgstr "" -#: includes/push-ui.php:547 -msgid "Selected connections" +#: includes/push-ui.php:226 +msgid "Invalid Ajax referer." msgstr "" -#: includes/push-ui.php:548 -msgid "Clear" +#: includes/push-ui.php:231 +msgid "No post ID provided." msgstr "" -#: includes/push-ui.php:551 -msgid "No connections selected" +#: includes/push-ui.php:236 +msgid "No connection provided." msgstr "" -#: includes/push-ui.php:573 -msgid "Distribute" +#: includes/push-ui.php:398 +msgid "Ajax error:" msgstr "" -#: includes/push-ui.php:573 -msgid "As draft" +#: includes/push-ui.php:399 +msgid "Received empty result." msgstr "" -#: includes/push-ui.php:580 -msgid "Post successfully distributed." +#: includes/push-ui.php:559 +#. translators: %s: post type name +msgid "This %s has been distributed from" msgstr "" -#: includes/push-ui.php:583 -msgid "There was an issue distributing the post." +#: includes/push-ui.php:562 +msgid "You can " msgstr "" -#: includes/push-ui.php:589 -msgid "No connections available for distribution." +#: includes/push-ui.php:563 +msgid "view the original" msgstr "" -#: includes/push-ui.php:627 +#: includes/push-ui.php:596 msgid "There was an issue loading connections." msgstr "" -#: includes/rest-api.php:197 +#: includes/rest-api.php:202 msgid "Post meta for Distributor." msgstr "" -#: includes/rest-api.php:216 +#: includes/rest-api.php:221 msgid "Taxonomy terms for Distributor." msgstr "" -#: includes/rest-api.php:235 +#: includes/rest-api.php:240 msgid "Media for Distributor." msgstr "" -#: includes/rest-api.php:250 +#: includes/rest-api.php:255 msgid "Original site name for Distributor." msgstr "" -#: includes/rest-api.php:265 +#: includes/rest-api.php:270 msgid "Original site url for Distributor." msgstr "" @@ -964,50 +976,50 @@ msgstr "" msgid "Linked" msgstr "" -#: includes/syndicated-post-ui.php:197 +#: includes/syndicated-post-ui.php:196 msgid "Distributed on: " msgstr "" -#: includes/syndicated-post-ui.php:225 +#: includes/syndicated-post-ui.php:224 msgid "Revisions" msgstr "" -#: includes/syndicated-post-ui.php:240 +#: includes/syndicated-post-ui.php:239 #. translators: %s the post type name msgid "Distributed %s do not support revisions unless unlinked." msgstr "" -#: includes/syndicated-post-ui.php:434 includes/syndicated-post-ui.php:548 +#: includes/syndicated-post-ui.php:433 includes/syndicated-post-ui.php:547 #. translators: %d: the blog ID #. translators: %d: the original blog id msgid "Blog #%d" msgstr "" -#: includes/syndicated-post-ui.php:448 +#: includes/syndicated-post-ui.php:447 #. translators: %1$s: post type name, %2$s: site url, %3$s: site name msgid "" "This %1$s was distributed from %3$s. However, the " "original has been deleted." msgstr "" -#: includes/syndicated-post-ui.php:455 +#: includes/syndicated-post-ui.php:454 #. translators: %1$s: site url, %2$s: site name msgid "Distributed from %2$s." msgstr "" -#: includes/syndicated-post-ui.php:462 +#: includes/syndicated-post-ui.php:461 #. translators: %1$s: post type name, %2$s: unlink url msgid "" "The original %1$s will update this version unless you unlink from the original." msgstr "" -#: includes/syndicated-post-ui.php:468 +#: includes/syndicated-post-ui.php:467 #. translators: %1$s: site url, %2$s: site name msgid "Originally distributed from %1$s." msgstr "" -#: includes/syndicated-post-ui.php:470 +#: includes/syndicated-post-ui.php:469 #. translators: %1$s: post type name, %2$s: link url msgid "" "This %1$s has been unlinked from the original. However, you can always `External Connections`. Administrators can decide which user roles are allowed to distribute content to and from that connection (Editors and Administrators by default). All users with those roles will inherit the permissions of the user account used to establish the remote connection. +* External connections require HTTP Basic Authentication or [WordPress.com OAuth2](https://developer.wordpress.com/docs/oauth2/) (must be on VIP) be set up on the remote website. For Basic Auth, we recommend the [Application Passwords](https://wordpress.org/plugins/application-passwords/) plugin. +* For external connections, Distributor needs to be installed on BOTH sides of the connection. diff --git a/templates/add-connection-amp.php b/templates/add-connection-amp.php new file mode 100644 index 000000000..39c4c5df0 --- /dev/null +++ b/templates/add-connection-amp.php @@ -0,0 +1,29 @@ + + + diff --git a/templates/add-connection.php b/templates/add-connection.php new file mode 100644 index 000000000..b8f5b8463 --- /dev/null +++ b/templates/add-connection.php @@ -0,0 +1,22 @@ + + + diff --git a/templates/show-connections-amp.php b/templates/show-connections-amp.php new file mode 100644 index 000000000..39c041c4b --- /dev/null +++ b/templates/show-connections-amp.php @@ -0,0 +1,95 @@ + + + diff --git a/templates/show-connections.php b/templates/show-connections.php new file mode 100644 index 000000000..e62435244 --- /dev/null +++ b/templates/show-connections.php @@ -0,0 +1,92 @@ + + +