Skip to content

Commit 7ad2ca8

Browse files
authored
Merge pull request #42 from INN/39-rename-plugin
Rename the plugin to "Pym.js Embeds" in most places.
2 parents 8193da2 + d381607 commit 7ad2ca8

File tree

10 files changed

+86
-83
lines changed

10 files changed

+86
-83
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Pym Shortcode
1+
# Pym.js Embeds
22

3-
This plugin allows the use of NPR's [Pym.js](http://blog.apps.npr.org/pym.js/) responsive iframe script on WordPress sites, through the use of shortcodes and Gutenberg block.
3+
This plugin allows the use of NPR's [Pym.js](http://blog.apps.npr.org/pym.js/) responsive iframe script on WordPress sites, through the use of shortcodes and Gutenberg blocks.
44

55
For detailed examples, ➡️ [read the docs!](./docs/) ⬅️

docs/readme.md

Lines changed: 40 additions & 40 deletions
Large diffs are not rendered by default.

inc/block.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
22
/**
3-
* The Gutenberg block for Pym embeds
3+
* The Gutenberg block for Pym.js embeds
44
*
5-
* @package pym-shortcode
5+
* @package pym-embeds
66
*/
77

88
/**

inc/class-pymsrc-output.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* The class and related methods for tracking which pymsrc tags will be output upon the page
44
*
5-
* @package pym-shortcode
5+
* @package pym-embeds
66
*/
77

88
/**
@@ -129,13 +129,13 @@ public function warning_message_debug() {
129129
/**
130130
* Output a thing in the footer that shows up in the browser console, to assist in debugging
131131
*
132-
* This has to support IE 9 because Pym supports IE 9, but `console.log` and `console.error` aren't available in IE 9 unless the dev tools are open. Thus, the check `window.console`.
132+
* This has to support IE 9 because Pym.js supports IE 9, but `console.log` and `console.error` aren't available in IE 9 unless the dev tools are open. Thus, the check `window.console`.
133133
* @link https://stackoverflow.com/questions/8002116/should-i-be-removing-console-log-from-production-code/15771110
134134
*/
135135
public function warning_message_footer() {
136136
printf(
137137
'<script type="text/javascript">window.console && console.log( \'%1$s\', %2$s );</script>',
138-
wp_json_encode( __( 'Hi Pym user! It looks like your post has multiple values for pymsrc for the blocks and shortcodes in use on this page. This may be causing problems for your Pym embeds. For more details, see https://github.com/INN/pym-shortcode/tree/master/docs#ive-set-a-different-pymsrc-option-but-now-im-seeing-a-message-in-the-console', 'pym_shortcode' ) ),
138+
wp_json_encode( __( 'Hi Pym.js user! It looks like your post has multiple values for pymsrc for the blocks and shortcodes in use on this page. This may be causing problems for your Pym.js embeds. For more details, see https://github.com/INN/pym-shortcode/tree/master/docs#ive-set-a-different-pymsrc-option-but-now-im-seeing-a-message-in-the-console', 'pym_shortcode' ) ),
139139
wp_json_encode( $this->sources )
140140
);
141141
}

inc/info-page.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* The informational page for this plugin.
44
*
55
* This is available to everyone who can edit posts, because they'll need this info if they're creating new child pages for embed using the shortcode or plugin.
6+
*
7+
* @package pym-embeds
68
*/
79

810
namespace INN\PymEmbeds\Info;

inc/settings-page.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
/**
33
* The settings page for this plugin.
44
*
5+
* @package pym-embeds
56
*/
67

78
namespace INN\PymEmbeds\Settings;

inc/shortcode.php

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@
22
/**
33
* The [pym] shortcode and related functions
44
*
5-
* @package pym-shortcode
5+
* @package pym-embeds
66
*/
77

88
use INN\PymEmbeds\Settings\option_key;
99

1010
/**
1111
* A shortcode to simplify the process of embedding articles using pym.js
1212
*
13-
* This function also powers the Pym Embed block output.
13+
* This function also powers the Pym.js Embed block output in Gutenberg,
14+
* as the render callback for a dynamic block.
1415
*
1516
* @param Array $atts the attributes passed in the shortcode.
1617
* @param String $content the enclosed content; should be empty for this shortcode.
@@ -72,8 +73,10 @@ function pym_shortcode( $atts = array(), $content = '', $tag = '' ) {
7273
$pymsrc = $atts['pymsrc'];
7374
}
7475

75-
// If this is the first Pym element on the page, output the pymsrc script tag
76-
// or if the pymsrc is set, output that.
76+
// If this is the first Pym.js element on the page,
77+
// register the default pymsrc script tag for output.
78+
//
79+
// Or, if the pymsrc is set, register that specific pymsrc for output.
7780
if ( 0 === $pym_id || ! empty( $atts['pymsrc'] ) ) {
7881
$pymsrc_output = Pymsrc_Output::get_instance();
7982
$pymsrc_output->add( $pymsrc );
@@ -111,19 +114,19 @@ function pym_shortcode( $atts = array(), $content = '', $tag = '' ) {
111114
* @link https://github.com/INN/pym-shortcode/issues/19
112115
*
113116
* @param Array $args Has the following indices:
114-
* - 'pym_id' Which Pym instance this is on the page, provided for
117+
* - 'pym_id' Which Pym.js embed instance this is on the page, provided for
115118
* informational purposes. In this function, the pym_id value is
116119
* used as the variable name in `var pym_id = new pym.Parent(...);`
117-
* - 'actual_id' the element ID used for the Pym container element,
120+
* - 'actual_id' the element ID used for the Pym.js container element,
118121
* which is at this point set on the page and not changeable from
119122
* this function. This is the first argument for `new pym.Parent()`.
120-
* - 'src' the URL for the Pym child page. This is the second argument
123+
* - 'src' the URL for the Pym.js child page. This is the second argument
121124
* for `new pym.Parent()`.
122125
* - 'pymoptions' The third argument for `pym.Parent()` See the xdomain
123126
* argument in http://blog.apps.npr.org/pym.js/#example-block
124-
* - 'actual_classes' The classes used on the Pym container element,
127+
* - 'actual_classes' The classes used on the Pym.js container element,
125128
* provided to this function for informational purposes.
126-
* - 'pymsrc' The URL from which Pym is to be loaded for this emebed,
129+
* - 'pymsrc' The URL from which Pym.js is to be loaded for this emebed,
127130
* based on the shortcode/block options and the plugin settings.
128131
*
129132
* @since 1.3.2.1

js/block.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
* This is the display title for your block, which can be translated with `i18n` functions.
5050
* The block inserter will show this name.
5151
*/
52-
title: __( 'Pym Embed' ),
52+
title: __( 'Pym.js Embed' ),
5353

5454
/**
5555
* An icon property should be specified to make it easier to identify a block.
@@ -114,10 +114,10 @@
114114
icon: 'analytics'
115115
},
116116
),
117-
__( 'Pym Child URL' )
117+
__( 'Pym.js Child URL' )
118118
],
119119
value: props.attributes.src,
120-
placeholder: __( 'What is the URL of your Pym child page?' ),
120+
placeholder: __( 'What is the URL of your Pym.js child page?' ),
121121
onChange: ( value ) => { props.setAttributes( { src: value } ); },
122122
} )
123123
),
@@ -130,26 +130,26 @@
130130
*/
131131
el( InspectorControls, {},
132132
el( TextControl, {
133-
label: __( 'Pym Child URL' ),
133+
label: __( 'Pym.js Child URL' ),
134134
value: props.attributes.src,
135-
placeholder: __( 'What is the URL of your Pym child page?' ),
135+
placeholder: __( 'What is the URL of your Pym.js child page?' ),
136136
onChange: ( value ) => { props.setAttributes( { src: value } ); },
137137
} ),
138138
),
139139
el( InspectorAdvancedControls, {},
140140
el( TextControl, {
141-
label: __( 'Parent element ID (optional)' ),
141+
label: __( 'Parent Element ID (optional)' ),
142142
value: props.attributes.id,
143143
onChange: ( value ) => { props.setAttributes( { id: value } ); },
144-
help: __( 'The Pym block will automatically generate an ID for the parent element and use that to initiate the Pym embed. If your child page\'s code requires its parent to have a specific element ID, set that here.' ),
144+
help: __( 'The Pym.js block will automatically generate an ID for the parent element and use that to initiate the Pym.js embed. If your child page\'s code requires its parent to have a specific element ID, set that here.' ),
145145
} ),
146146
el( TextControl, {
147-
label: __( 'Pym.js source URL (optional)' ),
147+
label: __( 'Pym.js Source URL (optional)' ),
148148
value: props.attributes.pymsrc,
149149
onChange: ( value ) => { props.setAttributes( { pymsrc: value } ); },
150150
} ),
151151
el( TextControl, {
152-
label: __( 'Pym Options' ),
152+
label: __( 'Pym.js Options' ),
153153
value: props.attributes.pymoptions,
154154
onChange: ( value ) => { props.setAttributes( { pymoptions: value } ); },
155155
// @todo make this translatable https://github.com/WordPress/gutenberg/blob/master/packages/i18n/README.md

pym-shortcode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/*
3-
Plugin Name: Pym Shortcode
3+
Plugin Name: Pym.js Embeds
44
Plugin URI: https://github.com/INN/pym-shortcode
55
Description: Adds a [pym src=""] shortcode to simplify use of NPR's Pym.js
66
Version: 1.3.2.1

readme.txt

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
=== Pym Shortcode ===
1+
=== Pym.js Embeds ===
22
Contributors: inn_nerds
33
Donate link: https://inn.org/donate
44
Tags: shortcode, iframe, javascript, embeds, responsive, pym, NPR
@@ -9,15 +9,15 @@ Stable tag: 1.3.2
99
License: GPLv2 or later
1010
License URI: http://www.gnu.org/licenses/gpl-2.0.html
1111

12-
A WordPress solution to embed iframes that are responsive horizontally and vertically using the NPR Visuals Team's pym.js.
12+
A WordPress solution to embed iframes that are responsive horizontally and vertically using the NPR Visuals Team's `Pym.js`.
1313

1414
== Description ==
1515

16-
Pym Shortcode will resize an iframe responsively depending on the height of its content and the width of its container. The plugin uses [Pym.js](http://blog.apps.npr.org/pym.js/), developed by the NPR Visuals Team, to allow embedded content in WordPress posts and pages using a simple shortcode.
16+
Pym.js Embeds provides shortcode and Gutenberg block wrappers for embedding responsive iframes using [Pym.js](http://blog.apps.npr.org/pym.js/), developed by the NPR Visuals Team. Embedded content resizes vertically to match its container's width.
1717

1818
== Installation ==
1919

20-
1. In the WordPress Dashboard go to **Plugins**, then click the **Add Plugins** button and search the WordPress Plugins Directory for Pym Shortcode. Alternatively, you can download the zip file from this Github repo and upload it manually to your WordPress site.
20+
1. In the WordPress Dashboard go to **Plugins**, then click the **Add Plugins** button and search the WordPress Plugins Directory for Pym.js Embeds. Alternatively, you can download the zip file from this Github repo and upload it manually to your WordPress site.
2121
2. Activate the plugin through the 'Plugins' screen in WordPress
2222
3. In **Settings > Pym.js Embed Settings**, decide whether you'd like to change the plugin's behavior to use a non-default source URL for `Pym.js`, and whether you'd like to prevent post authors from setting embed-specific URLs for `Pym.js`
2323
4. Begin embedding content!
@@ -32,17 +32,17 @@ Embeddable table from NPR:
3232

3333
![an embeddable table from NPR](img/responsive-iframe-npr.png)
3434

35-
Pym Shortcode in a WordPress post:
35+
Pym.js Shortcode in a WordPress post:
3636

37-
![Pym Shortcode in a WordPress post](img/pym-shortcode-in-post.png)
37+
![Pym.js Shortcode in a WordPress post](img/pym-shortcode-in-post.png)
3838

39-
Desktop view of the WordPress post with the NPR embed using Pym Shortcode:
39+
Desktop view of the WordPress post with the NPR embed using Pym.js Shortcode:
4040

41-
![Desktop view of the WordPress post with the NPR embed using Pym Shortcode](img/pym-example-desktop.png)
41+
![Desktop view of the WordPress post with the NPR embed using Pym.js Shortcode](img/pym-example-desktop.png)
4242

43-
Mobile view of the WordPress post with the NPR embed using Pym Shortcode:
43+
Mobile view of the WordPress post with the NPR embed using Pym.js Shortcode:
4444

45-
![Mobile view of the WordPress post with the NPR embed using Pym Shortcode](img/pym-example-phone.png)
45+
![Mobile view of the WordPress post with the NPR embed using Pym.js Shortcode](img/pym-example-phone.png)
4646

4747
== Changelog ==
4848

@@ -54,7 +54,8 @@ Following the practice begun at plugin version 1.1.2 of [having the plugin versi
5454

5555
New features:
5656

57-
* Adds a "Pym Embed" block for use in Gutenberg. [PR #34](https://github.com/INN/pym-shortcode/pull/34) for issue [#28](https://github.com/INN/pym-shortcode/issues/28).
57+
* Plugin renamed from "Pym Shortcode" to "Pym.js Embeds".
58+
* Adds a "Pym.js Embed" block for use in Gutenberg. [PR #34](https://github.com/INN/pym-shortcode/pull/34) for issue [#28](https://github.com/INN/pym-shortcode/issues/28).
5859
* If a block is created using this plugin and Gutenberg, and Gutenberg is then disabled, the block will show a link to the embedded graphic.
5960
* Through the settings page, you can now serve pym.js using your newsroom's CDN or NPR's CDN! [PR #45]() for [issue #31](https://github.com/INN/pym-shortcode/issues/31).
6061
* Adds a settings page, available to those with the `manage_options` capability, with the following options:
@@ -77,7 +78,7 @@ Changes:
7778

7879
= 1.3.2 =
7980

80-
* *RECOMMENDED UPDATE* : Pym users, NPR has released an update that closes a potential security hole. We recommend everyone update to 1.3.2.
81+
* *RECOMMENDED UPDATE* : Pym.js users, NPR has released an update that closes a potential security hole. We recommend everyone update to 1.3.2.
8182
* Update to pym.js version 1.3.2: https://github.com/nprapps/pym.js/releases/tag/v1.3.2 (Changelog at https://github.com/nprapps/pym.js/blob/v1.3.2/CHANGELOG)
8283

8384
= 1.3.1 =
@@ -118,11 +119,7 @@ Changes:
118119

119120
* First release of the plugin
120121

121-
== Upgrade Notice ==
122-
123-
No updates at this time.
124-
125-
== Pym Resources from NPR ==
122+
== Pym.js Resources from NPR ==
126123

127124
You may also want to look at NPR's Pym.js resources:
128125

0 commit comments

Comments
 (0)