Pz-LinkCard - Version 2.4.6.1

Version Description

= * WordPress 6.0.1 Compatible with WordPress 6.0.1. * Thanks @kozy_1919 on Twitter Fixed: Fixed a bug that prevented the acquisition of articles with an IDNA-ASCII-Domain.

Download this release

Release Info

Developer poporon
Plugin Icon 128x128 Pz-LinkCard
Version 2.4.6.1
Comparing to
See all releases

Code changes from version 2.4.6 to 2.4.6.1

Files changed (3) hide show
  1. js/mce-button.js.backup +112 -0
  2. pz-linkcard.php +3 -3
  3. readme.txt +7 -1
js/mce-button.js.backup ADDED
@@ -0,0 +1,112 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ( function( $ ) {
2
+ tinymce.create( "tinymce.plugins.pz_linkcard_tinymce", {
3
+ getInfo: function() {
4
+ return {
5
+ longname: "Pz-LinkCard Insert Button",
6
+ author: "poporon",
7
+ authorurl: "https://popozure.info",
8
+ infourl: "https://popozure.info/pz-linkcard",
9
+ version: "0.7"
10
+ };
11
+ },
12
+ init: function( ed, url ) {
13
+ var id = "pz_linkcard_insert_shortcode";
14
+ ed.addButton(id, {
15
+ title: 'Insert Linkcard',
16
+ cmd: id,
17
+ image: url + "/mce-button.png"
18
+ } );
19
+ ed.addCommand(id, function() {
20
+ $("#pz-lkc-overlay").css("display", "block");
21
+ $("#pz-lkc-modal").css("display", "block");
22
+ $("#pz-lkc-url").val("");
23
+ var st = tinymce.activeEditor.selection.getContent();
24
+ var ur = cut_url(st);
25
+ if (ur != null) {
26
+ ur = ur[1];
27
+ } else {
28
+ var cb = undefined;
29
+ if (window.clipboardData && window.clipboardData.getData) {
30
+ cb = window.clipboardData.getData('Text');
31
+ ur = cut_url(cb);
32
+ if (ur != null) {
33
+ ur = ur[1];
34
+ }
35
+ }
36
+ }
37
+ $("#pz-lkc-url").val(ur);
38
+ modal_move_center();
39
+ $("#pz-lkc-url").focus();
40
+ $("#pz-lkc-url").select();
41
+ } );
42
+ },
43
+ } );
44
+
45
+ tinymce.PluginManager.add( "pz_linkcard_tinymce", tinymce.plugins.pz_linkcard_tinymce );
46
+ tinymce.PluginManager.requireLangPack('pz_linkcard_tinymce');
47
+
48
+ // 画面のどこかをクリックしたらモーダルを閉じる
49
+ $("#pz-lkc-overlay,#pz-lkc-close").unbind().click( function() {
50
+ $("#pz-lkc-overlay").css("display", "none");
51
+ $("#pz-lkc-modal").css("display"," none");
52
+ $("#pz-lkc-serif").val("");
53
+ $("#pz-lkc-check").prop("checked", false);
54
+ } ) ;
55
+
56
+ // [ESC]キーが押されたらCLOSEをクリック
57
+ $(document).keydown( function(e) {
58
+ if (e.keyCode == 27) {
59
+ $("#pz-lkc-close").click();
60
+ }
61
+ } ) ;
62
+
63
+ // 貼り付け
64
+ $("#pz-lkc-url").bind('paste', function(e) {
65
+ if ($("#pz-lkc-url").val() == "") {
66
+ var cb = undefined;
67
+ if (window.clipboardData && window.clipboardData.getData) {
68
+ cb = window.clipboardData.getData('Text');
69
+ } else if (e.originalEvent.clipboardData && e.originalEvent.clipboardData.getData) {
70
+ cb = e.originalEvent.clipboardData.getData('text/plain');
71
+ }
72
+ var ur = cut_url(cb);
73
+ if (ur != null) {
74
+ ur = ur[1];
75
+ $("#pz-lkc-url").val(ur);
76
+ $("#pz-lkc-url").select();
77
+ return false;
78
+ }
79
+ }
80
+ } ) ;
81
+
82
+ // 挿入ボタン
83
+ $("#pz-lkc-insert").unbind().click( function() {
84
+ $("#pz-lkc-overlay").css("display","none");
85
+ $("#pz-lkc-modal").css("display","none");
86
+ if ($("#pz-lkc-url").val() != "") {
87
+ var sc = "<p>[" + $("#pz-lkc-code").val() + " url=\"" + $("#pz-lkc-url").val() + "\"]</p>";
88
+ tinymce.activeEditor.selection.setContent(sc);
89
+ }
90
+ tinymce.activeEditor.focus()
91
+ $("#pz-lkc-serif").val("");
92
+ $("#pz-lkc-check").prop("checked", false);
93
+ } ) ;
94
+
95
+ // ウィンドウのリサイズ
96
+ $(window).resize(modal_move_center);
97
+ function modal_move_center() {
98
+ var w = $(window).width();
99
+ var h = $(window).height();
100
+ var mw = $("#pz-lkc-modal").outerWidth();
101
+ var mh = $("#pz-lkc-modal").outerHeight();
102
+ $("#pz-lkc-modal").css( {"left": ((w - mw)/2) + "px","top": ((h - mh)/2) + "px"} );
103
+ }
104
+
105
+ // 文字列からURLを切り出す
106
+ function cut_url(s) {
107
+ var reg = '((https?|file|ftp|data|ogg):\/\/[^ \'"<]+)';
108
+ var ur = s.match(reg );
109
+ return ur;
110
+ }
111
+
112
+ } ) ( jQuery );
pz-linkcard.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Pz-LinkCard
4
  Plugin URI: http://poporon.poponet.jp/pz-linkcard
5
  Description: リンクをカード形式で表示します。
6
- Version: 2.4.6
7
  Author: Poporon
8
  Author URI: http://poporon.poponet.jp
9
  Text Domain: pz-linkcard
@@ -16,7 +16,7 @@ class class_pz_linkcard {
16
  // 設定値
17
  protected $defaults =
18
  array(
19
- 'plugin-version' => '2.4.6',
20
  'plugin-name' => 'Pz-LinkCard',
21
  'plugin-abbreviation' => 'Pz-LkC',
22
  'plugin-path' => '/pz-linkcard',
@@ -987,7 +987,7 @@ class class_pz_linkcard {
987
  $url_info = $this->pz_GetURLInfo($url );
988
  if (function_exists('idn_to_utf8' ) && !preg_match("/^[\x20-\x7E]+$/", $url_info['domain'] ) ) {
989
  $domain_before = (isset($url_info['scheme'] ) ? $url_info['scheme'] : null).'://'.(isset($url_info['domain'] ) ? $url_info['domain'] : null);
990
- $domain_after = (isset($url_info['scheme'] ) ? $url_info['scheme'] : null).'://'.(isset($url_info['domain'] ) ? idn_to_utf8($url_info['domain'], 0, INTL_IDNA_VARIANT_UTS46 ) : null);
991
  $url = $domain_after.mb_substr($url, mb_strlen($domain_before ) ); // URLのスキーム+ドメイン部分だけ入れ替え
992
  }
993
 
3
  Plugin Name: Pz-LinkCard
4
  Plugin URI: http://poporon.poponet.jp/pz-linkcard
5
  Description: リンクをカード形式で表示します。
6
+ Version: 2.4.6.1
7
  Author: Poporon
8
  Author URI: http://poporon.poponet.jp
9
  Text Domain: pz-linkcard
16
  // 設定値
17
  protected $defaults =
18
  array(
19
+ 'plugin-version' => '2.4.6.1',
20
  'plugin-name' => 'Pz-LinkCard',
21
  'plugin-abbreviation' => 'Pz-LkC',
22
  'plugin-path' => '/pz-linkcard',
987
  $url_info = $this->pz_GetURLInfo($url );
988
  if (function_exists('idn_to_utf8' ) && !preg_match("/^[\x20-\x7E]+$/", $url_info['domain'] ) ) {
989
  $domain_before = (isset($url_info['scheme'] ) ? $url_info['scheme'] : null).'://'.(isset($url_info['domain'] ) ? $url_info['domain'] : null);
990
+ $domain_after = (isset($url_info['scheme'] ) ? $url_info['scheme'] : null).'://'.(isset($url_info['domain'] ) ? idn_to_ascii($url_info['domain'], 0, INTL_IDNA_VARIANT_UTS46 ) : null);
991
  $url = $domain_after.mb_substr($url, mb_strlen($domain_before ) ); // URLのスキーム+ドメイン部分だけ入れ替え
992
  }
993
 
readme.txt CHANGED
@@ -2,7 +2,7 @@
2
  Contributors: Poporon
3
  Tags: LinkCard, BlogCard, Internal Link, External Link
4
  Requires at least: 5.7
5
- Tested up to: 6.0
6
  Requires PHP: 7.0
7
  Stable tag: trunk
8
  License: GPLv2 or later
@@ -151,6 +151,12 @@ Ver.2.1.2から200px四方に変更、Ver.2.4.1から自由に指定できるよ
151
 
152
  == Changelog ==
153
 
 
 
 
 
 
 
154
  = 2.4.6 ==
155
  * WordPress 6.0 での動作確認。
156
  Compatible with WordPress 6.0.
2
  Contributors: Poporon
3
  Tags: LinkCard, BlogCard, Internal Link, External Link
4
  Requires at least: 5.7
5
+ Tested up to: 6.0.1
6
  Requires PHP: 7.0
7
  Stable tag: trunk
8
  License: GPLv2 or later
151
 
152
  == Changelog ==
153
 
154
+ = 2.4.6.1 ==
155
+ * WordPress 6.0.1 での動作確認。
156
+ Compatible with WordPress 6.0.1.
157
+ * 国際化ドメイン(日本語ドメイン)の記事が取得できない不具合を修正。(Thanks @kozy_1919 on Twitter)
158
+ Fixed: Fixed a bug that prevented the acquisition of articles with an IDNA-ASCII-Domain.
159
+
160
  = 2.4.6 ==
161
  * WordPress 6.0 での動作確認。
162
  Compatible with WordPress 6.0.