Version Description
- Fix jQuery deprecation notices in WordPress 5.7.
- Tested up to WordPress 5.7.
Download this release
Release Info
Developer | figureone |
Plugin | Insert Pages |
Version | 3.5.9 |
Comparing to | |
See all releases |
Code changes from version 3.5.8 to 3.5.9
- insert-pages.php +2 -2
- js/wpinsertpages.js +31 -19
- readme.txt +5 -1
insert-pages.php
CHANGED
@@ -7,7 +7,7 @@
|
|
7 |
* Text Domain: insert-pages
|
8 |
* Domain Path: /languages
|
9 |
* License: GPL2
|
10 |
-
* Version: 3.5.
|
11 |
*
|
12 |
* @package insert-pages
|
13 |
*/
|
@@ -230,7 +230,7 @@ if ( ! class_exists( 'InsertPagesPlugin' ) ) {
|
|
230 |
'wpinsertpages',
|
231 |
plugins_url( '/js/wpinsertpages.js', __FILE__ ),
|
232 |
array( 'wpdialogs' ),
|
233 |
-
'
|
234 |
false
|
235 |
);
|
236 |
wp_localize_script(
|
7 |
* Text Domain: insert-pages
|
8 |
* Domain Path: /languages
|
9 |
* License: GPL2
|
10 |
+
* Version: 3.5.9
|
11 |
*
|
12 |
* @package insert-pages
|
13 |
*/
|
230 |
'wpinsertpages',
|
231 |
plugins_url( '/js/wpinsertpages.js', __FILE__ ),
|
232 |
array( 'wpdialogs' ),
|
233 |
+
'20210225',
|
234 |
false
|
235 |
);
|
236 |
wp_localize_script(
|
js/wpinsertpages.js
CHANGED
@@ -1,9 +1,16 @@
|
|
1 |
-
|
|
|
|
|
|
|
2 |
/* global ajaxurl, tinymce, wpLinkL10n, setUserSetting, wpActiveEditor */
|
|
|
3 |
var wpInsertPages;
|
4 |
|
5 |
(function ( $ ) {
|
6 |
-
var
|
|
|
|
|
|
|
7 |
|
8 |
wpInsertPages = {
|
9 |
timeToTriggerRiverInsertPages: 150,
|
@@ -19,43 +26,48 @@ var wpInsertPages;
|
|
19 |
inputs.backdrop = $( '#wp-insertpage-backdrop' );
|
20 |
inputs.submit = $('#wp-insertpage-submit' );
|
21 |
inputs.close = $( '#wp-insertpage-close' );
|
22 |
-
|
|
|
23 |
inputs.slug = $( '#insertpage-slug-field' );
|
24 |
inputs.pageID = $( '#insertpage-page-id' );
|
25 |
inputs.parentPageID = $( '#insertpage-parent-page-id' );
|
26 |
-
|
|
|
27 |
inputs.format = $( '#insertpage-format-select' );
|
28 |
-
|
|
|
29 |
inputs.extraClasses = $( '#insertpage-extra-classes' );
|
30 |
inputs.extraID = $( '#insertpage-extra-id' );
|
31 |
inputs.extraInline = $( '#insertpage-extra-inline' );
|
32 |
inputs.extraPublic = $( '#insertpage-extra-public' );
|
33 |
inputs.extraQuerystring = $( '#insertpage-extra-querystring' );
|
34 |
-
|
|
|
35 |
inputs.template = $( '#insertpage-template-select' );
|
36 |
inputs.search = $( '#insertpage-search-field' );
|
37 |
-
|
|
|
38 |
rivers.search = new RiverInsertPages( $( '#insertpage-search-results' ) );
|
39 |
rivers.recent = new RiverInsertPages( $( '#insertpage-most-recent-results' ) );
|
40 |
rivers.elements = inputs.dialog.find( '.query-results' );
|
41 |
|
42 |
-
// Bind event handlers
|
43 |
-
inputs.dialog.
|
44 |
-
inputs.dialog.
|
45 |
-
inputs.submit.
|
46 |
event.preventDefault();
|
47 |
wpInsertPages.update();
|
48 |
});
|
49 |
-
inputs.close.add( inputs.backdrop ).add( '#wp-insertpage-cancel a' ).
|
50 |
event.preventDefault();
|
51 |
wpInsertPages.close();
|
52 |
});
|
53 |
|
54 |
-
$( '#insertpage-options-toggle' ).
|
55 |
|
56 |
rivers.elements.on('river-select', wpInsertPages.updateFields );
|
57 |
|
58 |
-
inputs.format.
|
59 |
if ( inputs.format.val() == 'template' ) {
|
60 |
inputs.template.removeAttr( 'disabled' );
|
61 |
inputs.template.focus();
|
@@ -71,7 +83,7 @@ var wpInsertPages;
|
|
71 |
}, function (r) {}, 'json' );
|
72 |
});
|
73 |
|
74 |
-
inputs.template.
|
75 |
// Save last selected template for this user.
|
76 |
$.post( ajaxurl, {
|
77 |
action : 'insertpage_save_presets',
|
@@ -81,12 +93,12 @@ var wpInsertPages;
|
|
81 |
});
|
82 |
|
83 |
// Set search type to plaintext if someone types in the search field.
|
84 |
-
//
|
85 |
-
inputs.search.
|
86 |
inputs.search.data( 'type', 'text' );
|
87 |
});
|
88 |
|
89 |
-
inputs.search.
|
90 |
var self = this;
|
91 |
|
92 |
window.clearTimeout( searchTimer );
|
@@ -520,7 +532,7 @@ var wpInsertPages;
|
|
520 |
this.change( search, type );
|
521 |
this.refresh();
|
522 |
|
523 |
-
$( '#wp-insertpage .query-results, #wp-insertpage #link-selector' ).
|
524 |
self.maybeLoad();
|
525 |
});
|
526 |
element.on( 'click', 'li', function( event ) {
|
1 |
+
/**
|
2 |
+
* Modified from WordPress Advanced Link dialog, wp-includes/js/wplink.js
|
3 |
+
*/
|
4 |
+
|
5 |
/* global ajaxurl, tinymce, wpLinkL10n, setUserSetting, wpActiveEditor */
|
6 |
+
|
7 |
var wpInsertPages;
|
8 |
|
9 |
(function ( $ ) {
|
10 |
+
var editor, searchTimer, RiverInsertPages, QueryInsertPages, correctedURL,
|
11 |
+
inputs = {},
|
12 |
+
rivers = {},
|
13 |
+
isTouch = ( 'ontouchend' in document );
|
14 |
|
15 |
wpInsertPages = {
|
16 |
timeToTriggerRiverInsertPages: 150,
|
26 |
inputs.backdrop = $( '#wp-insertpage-backdrop' );
|
27 |
inputs.submit = $('#wp-insertpage-submit' );
|
28 |
inputs.close = $( '#wp-insertpage-close' );
|
29 |
+
|
30 |
+
// Input.
|
31 |
inputs.slug = $( '#insertpage-slug-field' );
|
32 |
inputs.pageID = $( '#insertpage-page-id' );
|
33 |
inputs.parentPageID = $( '#insertpage-parent-page-id' );
|
34 |
+
|
35 |
+
// Format field (title, link, content, all, choose a custom template ->).
|
36 |
inputs.format = $( '#insertpage-format-select' );
|
37 |
+
|
38 |
+
// Extra fields (wrapper classes, inline checkbox, "visible to all" checkbox).
|
39 |
inputs.extraClasses = $( '#insertpage-extra-classes' );
|
40 |
inputs.extraID = $( '#insertpage-extra-id' );
|
41 |
inputs.extraInline = $( '#insertpage-extra-inline' );
|
42 |
inputs.extraPublic = $( '#insertpage-extra-public' );
|
43 |
inputs.extraQuerystring = $( '#insertpage-extra-querystring' );
|
44 |
+
|
45 |
+
// Custom template select field.
|
46 |
inputs.template = $( '#insertpage-template-select' );
|
47 |
inputs.search = $( '#insertpage-search-field' );
|
48 |
+
|
49 |
+
// Build rivers.
|
50 |
rivers.search = new RiverInsertPages( $( '#insertpage-search-results' ) );
|
51 |
rivers.recent = new RiverInsertPages( $( '#insertpage-most-recent-results' ) );
|
52 |
rivers.elements = inputs.dialog.find( '.query-results' );
|
53 |
|
54 |
+
// Bind event handlers.
|
55 |
+
inputs.dialog.on( 'keydown', wpInsertPages.keydown );
|
56 |
+
inputs.dialog.on( 'keyup', wpInsertPages.keyup );
|
57 |
+
inputs.submit.on( 'click', function( event ) {
|
58 |
event.preventDefault();
|
59 |
wpInsertPages.update();
|
60 |
});
|
61 |
+
inputs.close.add( inputs.backdrop ).add( '#wp-insertpage-cancel a' ).on( 'click', function( event ) {
|
62 |
event.preventDefault();
|
63 |
wpInsertPages.close();
|
64 |
});
|
65 |
|
66 |
+
$( '#insertpage-options-toggle' ).on( 'click', wpInsertPages.toggleInternalLinking );
|
67 |
|
68 |
rivers.elements.on('river-select', wpInsertPages.updateFields );
|
69 |
|
70 |
+
inputs.format.on( 'change', function() {
|
71 |
if ( inputs.format.val() == 'template' ) {
|
72 |
inputs.template.removeAttr( 'disabled' );
|
73 |
inputs.template.focus();
|
83 |
}, function (r) {}, 'json' );
|
84 |
});
|
85 |
|
86 |
+
inputs.template.on( 'change', function() {
|
87 |
// Save last selected template for this user.
|
88 |
$.post( ajaxurl, {
|
89 |
action : 'insertpage_save_presets',
|
93 |
});
|
94 |
|
95 |
// Set search type to plaintext if someone types in the search field.
|
96 |
+
// Might have been set to 'slug' or 'id' if editing a current shortcode.
|
97 |
+
inputs.search.on( 'keydown', function () {
|
98 |
inputs.search.data( 'type', 'text' );
|
99 |
});
|
100 |
|
101 |
+
inputs.search.on( 'keyup', function() {
|
102 |
var self = this;
|
103 |
|
104 |
window.clearTimeout( searchTimer );
|
532 |
this.change( search, type );
|
533 |
this.refresh();
|
534 |
|
535 |
+
$( '#wp-insertpage .query-results, #wp-insertpage #link-selector' ).on( 'scroll', function() {
|
536 |
self.maybeLoad();
|
537 |
});
|
538 |
element.on( 'click', 'li', function( event ) {
|
readme.txt
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
Contributors: figureone, the_magician
|
3 |
Tags: insert, pages, shortcode, embed
|
4 |
Requires at least: 3.0.1
|
5 |
-
Tested up to: 5.
|
6 |
Stable tag: trunk
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
@@ -111,6 +111,10 @@ Just one! The plugin prevents you from embedding a page in itself, but you can t
|
|
111 |
|
112 |
== Changelog ==
|
113 |
|
|
|
|
|
|
|
|
|
114 |
= 3.5.8 =
|
115 |
* Allow adding query vars for the inserted page (for example, to insert a specific tab of the WooCommerce My Account page: `[insert page=‘my-account’ display=‘content’ querystring=‘pagename=my-account&downloads’]`).
|
116 |
* Tested up to WordPress 5.6.1.
|
2 |
Contributors: figureone, the_magician
|
3 |
Tags: insert, pages, shortcode, embed
|
4 |
Requires at least: 3.0.1
|
5 |
+
Tested up to: 5.7
|
6 |
Stable tag: trunk
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
111 |
|
112 |
== Changelog ==
|
113 |
|
114 |
+
= 3.5.9 =
|
115 |
+
* Fix jQuery deprecation notices in WordPress 5.7.
|
116 |
+
* Tested up to WordPress 5.7.
|
117 |
+
|
118 |
= 3.5.8 =
|
119 |
* Allow adding query vars for the inserted page (for example, to insert a specific tab of the WooCommerce My Account page: `[insert page=‘my-account’ display=‘content’ querystring=‘pagename=my-account&downloads’]`).
|
120 |
* Tested up to WordPress 5.6.1.
|