PS Disable Auto Formatting - Version 0.9.2

Version Description

Download this release

Release Info

Developer jim912
Plugin Icon wp plugin PS Disable Auto Formatting
Version 0.9.2
Comparing to
See all releases

Code changes from version 0.9.1 to 0.9.2

js/250/ps_editor.js ADDED
@@ -0,0 +1,169 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ wpEditorInit = function() {
2
+ // Activate tinyMCE if it's the user's default editor
3
+ if ( ( 'undefined' == typeof wpTinyMCEConfig ) || 'tinymce' == wpTinyMCEConfig.defaultEditor ) {
4
+ document.getElementById('editorcontainer').style.padding = '0px';
5
+ tinyMCE.execCommand("mceAddControl", false, "content");
6
+ } else {
7
+ var H;
8
+ if ( H = tinymce.util.Cookie.getHash("TinyMCE_content_size") )
9
+ document.getElementById('content').style.height = H.ch - 30 + 'px';
10
+ }
11
+ };
12
+
13
+ switchEditors = {
14
+
15
+ saveCallback : function(el, content, body) {
16
+
17
+ document.getElementById(el).style.color = '#fff';
18
+ if ( tinyMCE.activeEditor.isHidden() )
19
+ content = document.getElementById(el).value;
20
+ else
21
+ content = this.pre_wpautop(content);
22
+
23
+ return content;
24
+ },
25
+
26
+ pre_wpautop : function(content) {
27
+ // We have a TON of cleanup to do. Line breaks are already stripped.
28
+
29
+ // Protect pre|script tags
30
+ content = content.replace(/<(pre|script)[^>]*>[\s\S]+?<\/\1>/g, function(a) {
31
+ a = a.replace(/<br ?\/?>[\r\n]*/g, '<wp_temp>');
32
+ return a.replace(/<\/?p( [^>]*)?>[\r\n]*/g, '<wp_temp>');
33
+ });
34
+
35
+ // Pretty it up for the source editor
36
+ var blocklist1 = 'blockquote|ul|ol|li|table|thead|tbody|tr|th|td|div|h[1-6]|p';
37
+ content = content.replace(new RegExp('\\s*</('+blocklist1+')>\\s*', 'mg'), '</$1>\n');
38
+ content = content.replace(new RegExp('\\s*<(('+blocklist1+')[^>]*)>', 'mg'), '\n<$1>');
39
+
40
+ content = content.replace(new RegExp('<p( [^>]*)?>[\\s\\n]*<(/?script[^>]*)>', 'mg'), '\n<$2>');
41
+ content = content.replace(new RegExp('<(/?script[^>]*)>[\\s\\n]*</p>', 'mg'), '\n<$1>');
42
+
43
+ // Fix some block element newline issues
44
+ content = content.replace(new RegExp('\\s*<div', 'mg'), '\n<div');
45
+ content = content.replace(new RegExp('</div>\\s*', 'mg'), '</div>\n');
46
+ content = content.replace(new RegExp('\\s*\\[caption([^\\[]+)\\[/caption\\]\\s*', 'gi'), '\n\n[caption$1[/caption]\n\n');
47
+ content = content.replace(new RegExp('caption\\]\\n\\n+\\[caption', 'g'), 'caption]\n\n[caption');
48
+
49
+ var blocklist2 = 'blockquote|ul|ol|li|table|thead|tr|th|td|h[1-6]|pre';
50
+ content = content.replace(new RegExp('\\s*<(('+blocklist2+') ?[^>]*)\\s*>', 'mg'), '\n<$1>');
51
+ content = content.replace(new RegExp('\\s*</('+blocklist2+')>\\s*', 'mg'), '</$1>\n');
52
+ content = content.replace(new RegExp('<li([^>]*)>', 'g'), '\t<li$1>');
53
+
54
+ if ( content.indexOf('<object') != -1 ) {
55
+ content = content.replace(new RegExp('\\s*<param([^>]*)>\\s*', 'mg'), "<param$1>");
56
+ content = content.replace(new RegExp('\\s*</embed>\\s*', 'mg'), '</embed>');
57
+ }
58
+
59
+ // Unmark special paragraph closing tags
60
+ content = content.replace(new RegExp('</p#>', 'g'), '</p>\n');
61
+ content = content.replace(new RegExp('\\s*(<p [^>]+>.*</p>)', 'mg'), '\n$1');
62
+ content = content.replace(new RegExp('<p>\\s*</p>', 'mg'), "<p>&nbsp;</p>\n");
63
+
64
+ // put back the line breaks in pre|script
65
+ content = content.replace(/<wp_temp>/g, '\n');
66
+
67
+ // Hope.
68
+ return content;
69
+ },
70
+
71
+ go : function(id) {
72
+ var ed = tinyMCE.get(id);
73
+ var qt = document.getElementById('quicktags');
74
+ var H = document.getElementById('edButtonHTML');
75
+ var P = document.getElementById('edButtonPreview');
76
+ var ta = document.getElementById(id);
77
+ var ec = document.getElementById('editorcontainer');
78
+
79
+ if ( ! ed || ed.isHidden() ) {
80
+ ta.style.color = '#fff';
81
+
82
+ this.edToggle(P, H);
83
+ edCloseAllTags(); // :-(
84
+
85
+ qt.style.display = 'none';
86
+ ec.style.padding = '0px';
87
+ ta.style.padding = '0px';
88
+
89
+ ta.value = this.wpautop(ta.value);
90
+
91
+ if ( ed ) ed.show();
92
+ else tinyMCE.execCommand("mceAddControl", false, id);
93
+
94
+ this.wpSetDefaultEditor('tinymce');
95
+ } else {
96
+ this.edToggle(H, P);
97
+ ta.style.height = ed.getContentAreaContainer().offsetHeight + 6 + 'px';
98
+
99
+ ed.hide();
100
+ qt.style.display = 'block';
101
+
102
+ if ( tinymce.isIE6 ) {
103
+ ta.style.width = '98%';
104
+ ec.style.padding = '0px';
105
+ ta.style.padding = '6px';
106
+ } else {
107
+ ta.style.width = '100%';
108
+ ec.style.padding = '6px';
109
+ }
110
+
111
+ ta.style.color = '';
112
+ this.wpSetDefaultEditor('html');
113
+ }
114
+ },
115
+
116
+ edToggle : function(A, B) {
117
+ A.className = 'active';
118
+ B.className = '';
119
+
120
+ B.onclick = A.onclick;
121
+ A.onclick = null;
122
+ },
123
+
124
+ wpSetDefaultEditor : function(editor) {
125
+ try {
126
+ editor = escape( editor.toString() );
127
+ } catch(err) {
128
+ editor = 'tinymce';
129
+ }
130
+
131
+ var userID = document.getElementById('user-id');
132
+ var date = new Date();
133
+ date.setTime(date.getTime()+(10*365*24*60*60*1000));
134
+ document.cookie = "wordpress_editor_" + userID.value + "=" + editor + "; expires=" + date.toGMTString();
135
+ },
136
+
137
+ wpautop : function(pee) {
138
+ // filtered when switching html to visual
139
+ var blocklist = 'table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6]|script';
140
+ var blocklist2 = 'table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|h[1-6]|script';
141
+ pee = pee + "\n\n";
142
+ pee = pee.replace(new RegExp('(<(?:'+blocklist+')[^>]*>)', 'gi'), "\n$1");
143
+ pee = pee.replace(new RegExp('(</(?:'+blocklist+')>)', 'gi'), "$1\n\n");
144
+ pee = pee.replace(new RegExp("\\r\\n|\\r", 'g'), "\n");
145
+ pee = pee.replace(new RegExp("\\n\\s*\\n+", 'g'), "\n\n");
146
+ pee = pee.replace(new RegExp('([\\s\\S]+?)\\n\\n', 'mg'), "<p>$1</p>\n");
147
+ pee = pee.replace(new RegExp('<p( [^>]*)?>[\\s\\n]*</p>', 'mg'), "<p$1>&nbsp;</p>\n");
148
+ pee = pee.replace(new RegExp('<p>\\s*(</?(?:'+blocklist+')[^>]*>)\\s*</p>', 'gi'), "$1");
149
+ pee = pee.replace(new RegExp("<p>(<li.+?)</p>", 'gi'), "$1");
150
+ pee = pee.replace(new RegExp("<p ?[^>]*>(<!--(.*)?-->)", 'gi'), "$1");
151
+ pee = pee.replace(new RegExp("(<!--(.*)?-->)</p>", 'gi'), "$1");
152
+ pee = pee.replace(new RegExp('<p>\\s*<blockquote([^>]*)>', 'gi'), "<blockquote$1><p>");
153
+ pee = pee.replace(new RegExp('</blockquote>\\s*</p>', 'gi'), '</p></blockquote>');
154
+ pee = pee.replace(new RegExp('<p>[\\s\\n]*(<(?:'+blocklist+')[^>]*>)', 'gi'), "$1");
155
+ pee = pee.replace(new RegExp('<p>[\\s\\n]*(</(?:'+blocklist2+')[^>]*>)', 'gi'), "$1");
156
+ pee = pee.replace(new RegExp('(<(?:'+blocklist2+')[^>]*>)[\\s\\n]*</p>', 'gi'), "$1");
157
+ pee = pee.replace(new RegExp('(</(?:'+blocklist+')[^>]*>)[\\s\\n]*</p>', 'gi'), "$1");
158
+ pee = pee.replace(new RegExp('(</?(?:'+blocklist+')[^>]*>)\\s*<br />', 'gi'), "$1");
159
+ pee = pee.replace(new RegExp('<br />(\\s*</?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)>)', 'gi'), '$1');
160
+ pee = pee.replace(new RegExp('(?:<p>|<br ?/?>)*\\s*\\[caption([^\\[]+)\\[/caption\\]\\s*(?:</p>|<br ?/?>)*', 'gi'), '[caption$1[/caption]');
161
+
162
+ // Fix the pre|script tags
163
+ pee = pee.replace(/<(pre|script)[^>]*>[\s\S]+?<\/\1>/g, function(a) {
164
+ a = a.replace(/<br ?\/?>[\r\n]*/g, '\n');
165
+ return a.replace(/<\/?p( [^>]*)?>[\r\n]*/g, '\n');
166
+ });
167
+ return pee;
168
+ }
169
+ }
js/{ps_editor.js → 270/ps_editor.js} RENAMED
@@ -1,157 +1,163 @@
1
- switchEditors = {
2
-
3
- mode : '',
4
-
5
- I : function(e) {
6
- return document.getElementById(e);
7
- },
8
-
9
- edInit : function() {
10
- var h = tinymce.util.Cookie.getHash("TinyMCE_content_size"), H = this.I('edButtonHTML'), P = this.I('edButtonPreview');
11
-
12
- // Activate TinyMCE if it's the user's default editor
13
- if ( getUserSetting( 'editor' ) == 'html' ) {
14
- if ( h )
15
- try { this.I('content').style.height = h.ch - 30 + 'px'; } catch(e){};
16
- } else {
17
- try {
18
- this.I("quicktags").style.display = "none";
19
- } catch(e){};
20
- tinyMCE.execCommand("mceAddControl", false, "content");
21
- }
22
- },
23
-
24
- saveCallback : function(el, content, body) {
25
-
26
- if ( tinyMCE.activeEditor.isHidden() )
27
- content = this.I(el).value;
28
- else
29
- content = this.pre_wpautop(content);
30
-
31
- return content;
32
- },
33
-
34
- pre_wpautop : function(content) {
35
- // We have a TON of cleanup to do. Line breaks are already stripped.
36
-
37
- // Protect pre|script tags
38
- content = content.replace(/<(pre|script)[^>]*>[\s\S]+?<\/\1>/g, function(a) {
39
- a = a.replace(/<br ?\/?>[\r\n]*/g, '<wp_temp>');
40
- return a.replace(/<\/?p( [^>]*)?>[\r\n]*/g, '<wp_temp>');
41
- });
42
-
43
- // Pretty it up for the source editor
44
- var blocklist1 = 'blockquote|ul|ol|li|table|thead|tbody|tr|th|td|div|h[1-6]|p';
45
- content = content.replace(new RegExp('\\s*</('+blocklist1+')>\\s*', 'mg'), '</$1>\n');
46
- content = content.replace(new RegExp('\\s*<(('+blocklist1+')[^>]*)>', 'mg'), '\n<$1>');
47
-
48
- content = content.replace(new RegExp('<p ?[^>]*>[\\s\\n]*<(/?script[^>]*)>', 'mg'), '\n<$1>');
49
- content = content.replace(new RegExp('<(/?script[^>]*)>[\\s\\n]*</p>', 'mg'), '\n<$1>');
50
-
51
- // Fix some block element newline issues
52
- content = content.replace(new RegExp('\\s*<div', 'mg'), '\n<div');
53
- content = content.replace(new RegExp('</div>\\s*', 'mg'), '</div>\n');
54
- content = content.replace(new RegExp('\\s*\\[caption([^\\[]+)\\[/caption\\]\\s*', 'gi'), '\n\n[caption$1[/caption]\n\n');
55
- content = content.replace(new RegExp('caption\\]\\n\\n+\\[caption', 'g'), 'caption]\n\n[caption');
56
-
57
- var blocklist2 = 'blockquote|ul|ol|li|table|thead|tr|th|td|h[1-6]|pre';
58
- content = content.replace(new RegExp('\\s*<(('+blocklist2+') ?[^>]*)\\s*>', 'mg'), '\n<$1>');
59
- content = content.replace(new RegExp('\\s*</('+blocklist2+')>\\s*', 'mg'), '</$1>\n');
60
- content = content.replace(new RegExp('<li([^>]*)>', 'g'), '\t<li$1>');
61
-
62
- if ( content.indexOf('<object') != -1 ) {
63
- content = content.replace(new RegExp('\\s*<param([^>]*)>\\s*', 'mg'), "<param$1>");
64
- content = content.replace(new RegExp('\\s*</embed>\\s*', 'mg'), '</embed>');
65
- }
66
-
67
- // Unmark special paragraph closing tags
68
- content = content.replace(new RegExp('</p#>', 'g'), '</p>\n');
69
- content = content.replace(new RegExp('\\s*(<p [^>]+>.*</p>)', 'mg'), '\n$1');
70
-
71
- // put back the line breaks in pre|script
72
- content = content.replace(/<wp_temp>/g, '\n');
73
-
74
- // Hope.
75
- return content;
76
- },
77
-
78
- go : function(id, mode) {
79
- id = id || 'content';
80
- mode = mode || this.mode || '';
81
-
82
- var ed = tinyMCE.get(id) || false;
83
- var qt = this.I('quicktags');
84
- var H = this.I('edButtonHTML');
85
- var P = this.I('edButtonPreview');
86
- var ta = this.I(id);
87
-
88
- if ( 'tinymce' == mode ) {
89
-
90
- if ( ed && ! ed.isHidden() )
91
- return false;
92
-
93
- this.mode = 'html';
94
- ta.style.color = '#fff';
95
-
96
- P.className = 'active';
97
- H.className = '';
98
- edCloseAllTags(); // :-(
99
-
100
- qt.style.display = 'none';
101
-
102
- ta.value = this.wpautop(ta.value);
103
-
104
- if ( ed ) ed.show();
105
- else tinyMCE.execCommand("mceAddControl", false, id);
106
-
107
- setUserSetting( 'editor', 'tinymce' );
108
- } else {
109
- if ( ! ed || ed.isHidden() )
110
- return false;
111
-
112
- this.mode = 'tinymce';
113
- H.className = 'active';
114
- P.className = '';
115
-
116
- ta.style.height = ed.getContentAreaContainer().offsetHeight + 6 + 'px';
117
-
118
- ed.hide();
119
- qt.style.display = 'block';
120
-
121
- ta.style.color = '';
122
- setUserSetting( 'editor', 'html' );
123
- }
124
- return false;
125
- },
126
-
127
- wpautop : function(pee) {
128
- var blocklist = 'table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6]|script';
129
- var blocklist2 = 'table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|h[1-6]|script';
130
- pee = pee + "\n\n";
131
- pee = pee.replace(new RegExp('(<(?:'+blocklist+')[^>]*>)', 'gi'), "\n$1");
132
- pee = pee.replace(new RegExp('(</(?:'+blocklist+')>)', 'gi'), "$1\n\n");
133
- pee = pee.replace(new RegExp("\\r\\n|\\r", 'g'), "\n");
134
- pee = pee.replace(new RegExp("\\n\\s*\\n+", 'g'), "\n\n");
135
- pee = pee.replace(new RegExp('([\\s\\S]+?)\\n\\n', 'mg'), "<p>$1</p>\n");
136
- pee = pee.replace(new RegExp('<p>\\s*(</?(?:'+blocklist+')[^>]*>)\\s*</p>', 'gi'), "$1");
137
- pee = pee.replace(new RegExp("<p>(<li.+?)</p>", 'gi'), "$1");
138
- pee = pee.replace(new RegExp("<p ?[^>]*>(<!--(.*)?-->)", 'gi'), "$1");
139
- pee = pee.replace(new RegExp("(<!--(.*)?-->)</p>", 'gi'), "$1");
140
- pee = pee.replace(new RegExp('<p>\\s*<blockquote([^>]*)>', 'gi'), "<blockquote$1><p>");
141
- pee = pee.replace(new RegExp('</blockquote>\\s*</p>', 'gi'), '</p></blockquote>');
142
- pee = pee.replace(new RegExp('<p>[\\s\\n]*(<(?:'+blocklist+')[^>]*>)', 'gi'), "$1");
143
- pee = pee.replace(new RegExp('<p>[\\s\\n]*(</(?:'+blocklist2+')[^>]*>)', 'gi'), "$1");
144
- pee = pee.replace(new RegExp('(<(?:'+blocklist2+')[^>]*>)[\\s\\n]*</p>', 'gi'), "$1");
145
- pee = pee.replace(new RegExp('(</(?:'+blocklist+')[^>]*>)[\\s\\n]*</p>', 'gi'), "$1");
146
- pee = pee.replace(new RegExp('(</?(?:'+blocklist+')[^>]*>)\\s*<br />', 'gi'), "$1");
147
- pee = pee.replace(new RegExp('<br />(\\s*</?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)>)', 'gi'), '$1');
148
- pee = pee.replace(new RegExp('(?:<p>|<br ?/?>)*\\s*\\[caption([^\\[]+)\\[/caption\\]\\s*(?:</p>|<br ?/?>)*', 'gi'), '[caption$1[/caption]');
149
-
150
- // Fix the pre|script tags
151
- pee = pee.replace(/<(pre|script)[^>]*>[\s\S]+?<\/\1>/g, function(a) {
152
- a = a.replace(/<br ?\/?>[\r\n]*/g, '\n');
153
- return a.replace(/<\/?p( [^>]*)?>[\r\n]*/g, '\n');
154
- });
155
- return pee;
156
- }
157
- }
 
 
 
 
 
 
1
+
2
+ switchEditors = {
3
+
4
+ mode : '',
5
+
6
+ I : function(e) {
7
+ return document.getElementById(e);
8
+ },
9
+
10
+ edInit : function() {
11
+ var h = tinymce.util.Cookie.getHash("TinyMCE_content_size"), H = this.I('edButtonHTML'), P = this.I('edButtonPreview');
12
+
13
+ // Activate TinyMCE if it's the user's default editor
14
+ if ( getUserSetting( 'editor' ) == 'html' ) {
15
+ if ( h )
16
+ try { this.I('content').style.height = h.ch - 30 + 'px'; } catch(e){};
17
+ } else {
18
+ try {
19
+ this.I("quicktags").style.display = "none";
20
+ } catch(e){};
21
+ tinyMCE.execCommand("mceAddControl", false, "content");
22
+ }
23
+ },
24
+
25
+ saveCallback : function(el, content, body) {
26
+
27
+ if ( tinyMCE.activeEditor.isHidden() )
28
+ content = this.I(el).value;
29
+ else
30
+ content = this.pre_wpautop(content);
31
+
32
+ return content;
33
+ },
34
+
35
+ pre_wpautop : function(content) {
36
+ // filtered when switching visual to html
37
+
38
+ // We have a TON of cleanup to do. Line breaks are already stripped.
39
+
40
+ // Protect pre|script tags
41
+ content = content.replace(/<(pre|script)[^>]*>[\s\S]+?<\/\1>/g, function(a) {
42
+ a = a.replace(/<br ?\/?>[\r\n]*/g, '<wp_temp>');
43
+ return a.replace(/<\/?p( [^>]*)?>[\r\n]*/g, '<wp_temp>');
44
+ });
45
+
46
+ // Pretty it up for the source editor
47
+ var blocklist1 = 'blockquote|ul|ol|li|table|thead|tbody|tr|th|td|div|h[1-6]|p';
48
+ content = content.replace(new RegExp('\\s*</('+blocklist1+')>\\s*', 'mg'), '</$1>\n');
49
+ content = content.replace(new RegExp('\\s*<(('+blocklist1+')[^>]*)>', 'mg'), '\n<$1>');
50
+
51
+ content = content.replace(new RegExp('<p( [^>]*)?>[\\s\\n]*<(/?script[^>]*)>', 'mg'), '\n<$2>');
52
+ content = content.replace(new RegExp('<(/?script[^>]*)>[\\s\\n]*</p>', 'mg'), '\n<$1>');
53
+
54
+ // Fix some block element newline issues
55
+ content = content.replace(new RegExp('\\s*<div', 'mg'), '\n<div');
56
+ content = content.replace(new RegExp('</div>\\s*', 'mg'), '</div>\n');
57
+ content = content.replace(new RegExp('\\s*\\[caption([^\\[]+)\\[/caption\\]\\s*', 'gi'), '\n\n[caption$1[/caption]\n\n');
58
+ content = content.replace(new RegExp('caption\\]\\n\\n+\\[caption', 'g'), 'caption]\n\n[caption');
59
+
60
+ var blocklist2 = 'blockquote|ul|ol|li|table|thead|tr|th|td|h[1-6]|pre';
61
+ content = content.replace(new RegExp('\\s*<(('+blocklist2+') ?[^>]*)\\s*>', 'mg'), '\n<$1>');
62
+ content = content.replace(new RegExp('\\s*</('+blocklist2+')>\\s*', 'mg'), '</$1>\n');
63
+ content = content.replace(new RegExp('<li([^>]*)>', 'g'), '\t<li$1>');
64
+
65
+ if ( content.indexOf('<object') != -1 ) {
66
+ content = content.replace(new RegExp('\\s*<param([^>]*)>\\s*', 'mg'), "<param$1>");
67
+ content = content.replace(new RegExp('\\s*</embed>\\s*', 'mg'), '</embed>');
68
+ }
69
+
70
+ // Unmark special paragraph closing tags
71
+ content = content.replace(new RegExp('</p#>', 'g'), '</p>\n');
72
+ content = content.replace(new RegExp('\\s*(<p [^>]+>.*</p>)', 'mg'), '\n$1');
73
+ content = content.replace(new RegExp('<p>\\s*</p>', 'mg'), "<p>&nbsp;</p>\n");
74
+
75
+ // put back the line breaks in pre|script
76
+ content = content.replace(/<wp_temp>/g, '\n');
77
+ // Hope.
78
+ return content;
79
+ },
80
+
81
+ go : function(id, mode) {
82
+ id = id || 'content';
83
+ mode = mode || this.mode || '';
84
+
85
+ var ed = tinyMCE.get(id) || false;
86
+ var qt = this.I('quicktags');
87
+ var H = this.I('edButtonHTML');
88
+ var P = this.I('edButtonPreview');
89
+ var ta = this.I(id);
90
+
91
+ if ( 'tinymce' == mode ) {
92
+
93
+ if ( ed && ! ed.isHidden() )
94
+ return false;
95
+
96
+ this.mode = 'html';
97
+ ta.style.color = '#fff';
98
+
99
+ P.className = 'active';
100
+ H.className = '';
101
+ edCloseAllTags(); // :-(
102
+
103
+ qt.style.display = 'none';
104
+
105
+ ta.value = this.wpautop(ta.value);
106
+
107
+ if ( ed ) ed.show();
108
+ else tinyMCE.execCommand("mceAddControl", false, id);
109
+
110
+ setUserSetting( 'editor', 'tinymce' );
111
+ } else {
112
+ if ( ! ed || ed.isHidden() )
113
+ return false;
114
+
115
+ this.mode = 'tinymce';
116
+ H.className = 'active';
117
+ P.className = '';
118
+
119
+ ta.style.height = ed.getContentAreaContainer().offsetHeight + 6 + 'px';
120
+
121
+ ed.hide();
122
+ qt.style.display = 'block';
123
+
124
+ ta.style.color = '';
125
+ setUserSetting( 'editor', 'html' );
126
+ }
127
+ return false;
128
+ },
129
+
130
+ wpautop : function(pee) {
131
+ // filtered when switching html to visual
132
+ var blocklist = 'table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6]|script';
133
+ var blocklist2 = 'table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|h[1-6]|script';
134
+ pee = pee + "\n\n";
135
+ pee = pee.replace(new RegExp('(<(?:'+blocklist+')[^>]*>)', 'gi'), "\n$1");
136
+ pee = pee.replace(new RegExp('(</(?:'+blocklist+')>)', 'gi'), "$1\n\n");
137
+ pee = pee.replace(new RegExp("\\r\\n|\\r", 'g'), "\n");
138
+ pee = pee.replace(new RegExp("\\n\\s*\\n+", 'g'), "\n\n");
139
+ pee = pee.replace(new RegExp('([\\s\\S]+?)\\n\\n', 'mg'), "<p>$1</p>\n");
140
+ pee = pee.replace(new RegExp('<p( [^>]*)?>[\\s\\n]*</p>', 'mg'), "<p$1>&nbsp;</p>\n");
141
+ pee = pee.replace(new RegExp('<p>\\s*(</?(?:'+blocklist+')[^>]*>)\\s*</p>', 'gi'), "$1");
142
+ pee = pee.replace(new RegExp("<p>(<li.+?)</p>", 'gi'), "$1");
143
+ pee = pee.replace(new RegExp("<p ?[^>]*>(<!--(.*)?-->)", 'gi'), "$1");
144
+ pee = pee.replace(new RegExp("(<!--(.*)?-->)</p>", 'gi'), "$1");
145
+ pee = pee.replace(new RegExp('<p>\\s*<blockquote([^>]*)>', 'gi'), "<blockquote$1><p>");
146
+ pee = pee.replace(new RegExp('</blockquote>\\s*</p>', 'gi'), '</p></blockquote>');
147
+ pee = pee.replace(new RegExp('<p>[\\s\\n]*(<(?:'+blocklist+')[^>]*>)', 'gi'), "$1");
148
+ pee = pee.replace(new RegExp('<p>[\\s\\n]*(</(?:'+blocklist2+')[^>]*>)', 'gi'), "$1");
149
+ pee = pee.replace(new RegExp('(<(?:'+blocklist2+')[^>]*>)[\\s\\n]*</p>', 'gi'), "$1");
150
+ pee = pee.replace(new RegExp('(</(?:'+blocklist+')[^>]*>)[\\s\\n]*</p>', 'gi'), "$1");
151
+ pee = pee.replace(new RegExp('(</?(?:'+blocklist+')[^>]*>)\\s*<br />', 'gi'), "$1");
152
+ pee = pee.replace(new RegExp('<br />(\\s*</?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)>)', 'gi'), '$1');
153
+ pee = pee.replace(new RegExp('(?:<p>|<br ?/?>)*\\s*\\[caption([^\\[]+)\\[/caption\\]\\s*(?:</p>|<br ?/?>)*', 'gi'), '[caption$1[/caption]');
154
+
155
+ // Fix the pre|script tags
156
+ pee = pee.replace(/<(pre|script)[^>]*>[\s\S]+?<\/\1>/g, function(a) {
157
+ a = a.replace(/<br ?\/?>[\r\n]*/g, '\n');
158
+ return a.replace(/<\/?p( [^>]*)?>[\r\n]*/g, '\n');
159
+ });
160
+
161
+ return pee;
162
+ }
163
+ }
language/ps_disable_auto_formatting-ja.mo CHANGED
Binary file
language/ps_disable_auto_formatting-ja.po CHANGED
@@ -3,7 +3,7 @@ msgstr ""
3
  "Project-Id-Version: PS Disable Auto Formatting\n"
4
  "Report-Msgid-Bugs-To: \n"
5
  "POT-Creation-Date: 2009-01-13 11:37+0900\n"
6
- "PO-Revision-Date: \n"
7
  "Last-Translator: hitoshi omagari\n"
8
  "Language-Team: Prime Strategy Co.,Ltd. <system@prime-strategy.co.jp>\n"
9
  "MIME-Version: 1.0\n"
@@ -13,7 +13,6 @@ msgstr ""
13
  "X-Poedit-Country: JAPAN\n"
14
  "X-Poedit-SourceCharset: utf-8\n"
15
  "X-Poedit-KeywordsList: __;_e\n"
16
- "X-Poedit-Basepath: T:\\wp_test\\DocumentRoot\\wp-content\\plugins\\\n"
17
  "X-Poedit-SearchPath-0: ps_disable_auto_formatting\n"
18
 
19
  #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:15
@@ -32,49 +31,49 @@ msgstr "抜粋の自動整形"
32
  msgid "term description formatting"
33
  msgstr "説明(カテゴリー、リンクなど)の自動整形"
34
 
35
- #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:110
36
- #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:184
37
  msgid "Auto Formatting"
38
  msgstr "自動整形"
39
 
40
- #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:150
41
  msgid "Could not update post in the database"
42
  msgstr "データベースのアップデートに失敗いたしました。"
43
 
44
- #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:153
45
  msgid "Database is not found."
46
  msgstr "データベースが見つかりません。"
47
 
48
- #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:163
49
  msgid "No formatting post or page exists."
50
  msgstr "整形する記事が存在しません。"
51
 
52
- #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:166
53
  msgid "Require checked allow batch formatting."
54
  msgstr "一括整形処理の許可が必要です。"
55
 
56
- #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:187
57
  msgid "The settings has changed successfully."
58
  msgstr "設定が変更されました。"
59
 
60
- #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:191
61
  #, php-format
62
  msgid "Batch fomatting process has completed. total %d posts formatted."
63
  msgstr "一括整形処理が完了いたしました。整形処理が行われた記事は、全部で%dです。"
64
 
65
- #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:199
66
  msgid "The settings has not been changed. There were no changes or failed to update the data base."
67
  msgstr "設定は変更されていません。変更された項目が存在しないか、データベースのアップデート失敗です。"
68
 
69
- #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:210
70
  msgid "disable"
71
  msgstr "停止"
72
 
73
- #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:219
74
  msgid "Batch formatting for past posts"
75
  msgstr "過去記事の一括整形"
76
 
77
- #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:220
78
  msgid ""
79
  "<p>To make it display the same as the format before run this plug-in,\n"
80
  "automatic operation process to the specified period of the posts.<br />\n"
@@ -84,27 +83,27 @@ msgid ""
84
  "* It is strongly recommended to take the <a href=\"http://codex.wordpress.org/Backing_Up_Your_Database\" title=\"Backing Up Your Database\">backup your database</a> before processing.</p>"
85
  msgstr "<p>プラグインを利用する場合にも段落・改行が以前通り表示されるよう、最新の編集が指定日以前の投稿・ページ全てに対し、自動段落整形の一括処理を行います。<br />整形処理を行った投稿・ページについては、リビジョンを作成しますので、万が一不具合が発生した投稿・ページにおいても復元が可能です。<br />複数回整形処理を行ってもおそらく問題にはならないと思いますが、極力避けてください。<br />※ 処理を行う前に極力<a href=\"http://wpdocs.sourceforge.jp/%E3%83%87%E3%83%BC%E3%82%BF%E3%83%99%E3%83%BC%E3%82%B9%E3%81%AE%E3%83%90%E3%83%83%E3%82%AF%E3%82%A2%E3%83%83%E3%83%97\" title=\"データベースのバックアップ\">データベースのバックアップ</a>を行っておいてください。</p>"
86
 
87
- #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:228
88
  msgid "Formatting before"
89
  msgstr "整形処理時限"
90
 
91
- #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:231
92
  msgid "* Formatting posts and pages are modified before this time."
93
  msgstr "※ 最新の更新時刻が指定時刻以前である記事に対して整形処理が行われます。"
94
 
95
- #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:236
96
  msgid "Batch formatting"
97
  msgstr "一括整形処理"
98
 
99
- #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:238
100
  msgid "Allow batch formatting"
101
  msgstr "一括整形処理を許可"
102
 
103
- #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:242
104
  msgid "If you have any problems or find a bug in this plugin, please <a href=\"http://www.web-strategy.jp/wp_plugin/ps_disable_auto_formatting/#postcomment\">report to us</a>."
105
  msgstr "本プラグインのご利用に際して問題があったり、バグを発見された場合には、<a href=\"http://www.web-strategy.jp/wp_plugin/ps_disable_auto_formatting/#postcomment\">ご連絡</a>いただければ幸いです。"
106
 
107
- #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:250
108
  msgid "Sorry, Your WordPress (version %s) is old to use PS Disable Auto Formatting plugin. Please upgrade to version 2.5 or higher."
109
  msgstr "ご利用中のWordPress (バージョン %s)では、PS Natural Paragraph Formatting プラグインはご利用になれません。2.5以上のバージョンにアップグレードしてください。"
110
 
3
  "Project-Id-Version: PS Disable Auto Formatting\n"
4
  "Report-Msgid-Bugs-To: \n"
5
  "POT-Creation-Date: 2009-01-13 11:37+0900\n"
6
+ "PO-Revision-Date: 2009-01-21 17:38+0900\n"
7
  "Last-Translator: hitoshi omagari\n"
8
  "Language-Team: Prime Strategy Co.,Ltd. <system@prime-strategy.co.jp>\n"
9
  "MIME-Version: 1.0\n"
13
  "X-Poedit-Country: JAPAN\n"
14
  "X-Poedit-SourceCharset: utf-8\n"
15
  "X-Poedit-KeywordsList: __;_e\n"
 
16
  "X-Poedit-SearchPath-0: ps_disable_auto_formatting\n"
17
 
18
  #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:15
31
  msgid "term description formatting"
32
  msgstr "説明(カテゴリー、リンクなど)の自動整形"
33
 
34
+ #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:155
35
+ #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:229
36
  msgid "Auto Formatting"
37
  msgstr "自動整形"
38
 
39
+ #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:195
40
  msgid "Could not update post in the database"
41
  msgstr "データベースのアップデートに失敗いたしました。"
42
 
43
+ #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:198
44
  msgid "Database is not found."
45
  msgstr "データベースが見つかりません。"
46
 
47
+ #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:208
48
  msgid "No formatting post or page exists."
49
  msgstr "整形する記事が存在しません。"
50
 
51
+ #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:211
52
  msgid "Require checked allow batch formatting."
53
  msgstr "一括整形処理の許可が必要です。"
54
 
55
+ #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:232
56
  msgid "The settings has changed successfully."
57
  msgstr "設定が変更されました。"
58
 
59
+ #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:236
60
  #, php-format
61
  msgid "Batch fomatting process has completed. total %d posts formatted."
62
  msgstr "一括整形処理が完了いたしました。整形処理が行われた記事は、全部で%dです。"
63
 
64
+ #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:244
65
  msgid "The settings has not been changed. There were no changes or failed to update the data base."
66
  msgstr "設定は変更されていません。変更された項目が存在しないか、データベースのアップデート失敗です。"
67
 
68
+ #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:255
69
  msgid "disable"
70
  msgstr "停止"
71
 
72
+ #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:264
73
  msgid "Batch formatting for past posts"
74
  msgstr "過去記事の一括整形"
75
 
76
+ #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:265
77
  msgid ""
78
  "<p>To make it display the same as the format before run this plug-in,\n"
79
  "automatic operation process to the specified period of the posts.<br />\n"
83
  "* It is strongly recommended to take the <a href=\"http://codex.wordpress.org/Backing_Up_Your_Database\" title=\"Backing Up Your Database\">backup your database</a> before processing.</p>"
84
  msgstr "<p>プラグインを利用する場合にも段落・改行が以前通り表示されるよう、最新の編集が指定日以前の投稿・ページ全てに対し、自動段落整形の一括処理を行います。<br />整形処理を行った投稿・ページについては、リビジョンを作成しますので、万が一不具合が発生した投稿・ページにおいても復元が可能です。<br />複数回整形処理を行ってもおそらく問題にはならないと思いますが、極力避けてください。<br />※ 処理を行う前に極力<a href=\"http://wpdocs.sourceforge.jp/%E3%83%87%E3%83%BC%E3%82%BF%E3%83%99%E3%83%BC%E3%82%B9%E3%81%AE%E3%83%90%E3%83%83%E3%82%AF%E3%82%A2%E3%83%83%E3%83%97\" title=\"データベースのバックアップ\">データベースのバックアップ</a>を行っておいてください。</p>"
85
 
86
+ #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:273
87
  msgid "Formatting before"
88
  msgstr "整形処理時限"
89
 
90
+ #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:276
91
  msgid "* Formatting posts and pages are modified before this time."
92
  msgstr "※ 最新の更新時刻が指定時刻以前である記事に対して整形処理が行われます。"
93
 
94
+ #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:281
95
  msgid "Batch formatting"
96
  msgstr "一括整形処理"
97
 
98
+ #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:283
99
  msgid "Allow batch formatting"
100
  msgstr "一括整形処理を許可"
101
 
102
+ #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:287
103
  msgid "If you have any problems or find a bug in this plugin, please <a href=\"http://www.web-strategy.jp/wp_plugin/ps_disable_auto_formatting/#postcomment\">report to us</a>."
104
  msgstr "本プラグインのご利用に際して問題があったり、バグを発見された場合には、<a href=\"http://www.web-strategy.jp/wp_plugin/ps_disable_auto_formatting/#postcomment\">ご連絡</a>いただければ幸いです。"
105
 
106
+ #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:295
107
  msgid "Sorry, Your WordPress (version %s) is old to use PS Disable Auto Formatting plugin. Please upgrade to version 2.5 or higher."
108
  msgstr "ご利用中のWordPress (バージョン %s)では、PS Natural Paragraph Formatting プラグインはご利用になれません。2.5以上のバージョンにアップグレードしてください。"
109
 
language/ps_disable_auto_formatting.pot CHANGED
@@ -1,20 +1,20 @@
1
  msgid ""
2
  msgstr ""
3
- "Project-Id-Version: PS Disable Auto Formatting\n"
4
  "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: \n"
6
  "PO-Revision-Date: \n"
7
  "Last-Translator: \n"
8
  "Language-Team: \n"
9
  "MIME-Version: 1.0\n"
10
- "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
  "X-Poedit-Language: \n"
13
  "X-Poedit-Country: \n"
14
  "X-Poedit-SourceCharset: utf-8\n"
15
  "X-Poedit-KeywordsList: __;_e\n"
16
- "X-Poedit-Basepath: T:\n"
17
- "X-Poedit-SearchPath-0: \n"
18
 
19
  #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:15
20
  msgid "content formatting"
@@ -32,49 +32,49 @@ msgstr ""
32
  msgid "term description formatting"
33
  msgstr ""
34
 
35
- #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:110
36
- #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:184
37
  msgid "Auto Formatting"
38
  msgstr ""
39
 
40
- #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:150
41
  msgid "Could not update post in the database"
42
  msgstr ""
43
 
44
- #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:153
45
  msgid "Database is not found."
46
  msgstr ""
47
 
48
- #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:163
49
  msgid "No formatting post or page exists."
50
  msgstr ""
51
 
52
- #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:166
53
  msgid "Require checked allow batch formatting."
54
  msgstr ""
55
 
56
- #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:187
57
  msgid "The settings has changed successfully."
58
  msgstr ""
59
 
60
- #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:191
61
  #, php-format
62
  msgid "Batch fomatting process has completed. total %d posts formatted."
63
  msgstr ""
64
 
65
- #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:199
66
  msgid "The settings has not been changed. There were no changes or failed to update the data base."
67
  msgstr ""
68
 
69
- #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:210
70
  msgid "disable"
71
  msgstr ""
72
 
73
- #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:219
74
  msgid "Batch formatting for past posts"
75
  msgstr ""
76
 
77
- #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:220
78
  msgid ""
79
  "<p>To make it display the same as the format before run this plug-in,\n"
80
  "automatic operation process to the specified period of the posts.<br />\n"
@@ -84,26 +84,27 @@ msgid ""
84
  "* It is strongly recommended to take the <a href=\"http://codex.wordpress.org/Backing_Up_Your_Database\" title=\"Backing Up Your Database\">backup your database</a> before processing.</p>"
85
  msgstr ""
86
 
87
- #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:228
88
  msgid "Formatting before"
89
  msgstr ""
90
 
91
- #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:231
92
  msgid "* Formatting posts and pages are modified before this time."
93
  msgstr ""
94
 
95
- #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:236
96
  msgid "Batch formatting"
97
  msgstr ""
98
 
99
- #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:238
100
  msgid "Allow batch formatting"
101
  msgstr ""
102
 
103
- #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:242
104
  msgid "If you have any problems or find a bug in this plugin, please <a href=\"http://www.web-strategy.jp/wp_plugin/ps_disable_auto_formatting/#postcomment\">report to us</a>."
105
  msgstr ""
106
 
107
- #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:250
108
  msgid "Sorry, Your WordPress (version %s) is old to use PS Disable Auto Formatting plugin. Please upgrade to version 2.5 or higher."
109
  msgstr ""
 
1
  msgid ""
2
  msgstr ""
3
+ "Project-Id-Version: PS Disable Auto Formatting 0.9.2\n"
4
  "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2009-01-21 17:35+0900\n"
6
  "PO-Revision-Date: \n"
7
  "Last-Translator: \n"
8
  "Language-Team: \n"
9
  "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
  "X-Poedit-Language: \n"
13
  "X-Poedit-Country: \n"
14
  "X-Poedit-SourceCharset: utf-8\n"
15
  "X-Poedit-KeywordsList: __;_e\n"
16
+ "X-Poedit-Basepath: \n"
17
+ "X-Poedit-SearchPath-0: ps_disable_auto_formatting\n"
18
 
19
  #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:15
20
  msgid "content formatting"
32
  msgid "term description formatting"
33
  msgstr ""
34
 
35
+ #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:155
36
+ #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:229
37
  msgid "Auto Formatting"
38
  msgstr ""
39
 
40
+ #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:195
41
  msgid "Could not update post in the database"
42
  msgstr ""
43
 
44
+ #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:198
45
  msgid "Database is not found."
46
  msgstr ""
47
 
48
+ #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:208
49
  msgid "No formatting post or page exists."
50
  msgstr ""
51
 
52
+ #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:211
53
  msgid "Require checked allow batch formatting."
54
  msgstr ""
55
 
56
+ #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:232
57
  msgid "The settings has changed successfully."
58
  msgstr ""
59
 
60
+ #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:236
61
  #, php-format
62
  msgid "Batch fomatting process has completed. total %d posts formatted."
63
  msgstr ""
64
 
65
+ #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:244
66
  msgid "The settings has not been changed. There were no changes or failed to update the data base."
67
  msgstr ""
68
 
69
+ #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:255
70
  msgid "disable"
71
  msgstr ""
72
 
73
+ #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:264
74
  msgid "Batch formatting for past posts"
75
  msgstr ""
76
 
77
+ #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:265
78
  msgid ""
79
  "<p>To make it display the same as the format before run this plug-in,\n"
80
  "automatic operation process to the specified period of the posts.<br />\n"
84
  "* It is strongly recommended to take the <a href=\"http://codex.wordpress.org/Backing_Up_Your_Database\" title=\"Backing Up Your Database\">backup your database</a> before processing.</p>"
85
  msgstr ""
86
 
87
+ #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:273
88
  msgid "Formatting before"
89
  msgstr ""
90
 
91
+ #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:276
92
  msgid "* Formatting posts and pages are modified before this time."
93
  msgstr ""
94
 
95
+ #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:281
96
  msgid "Batch formatting"
97
  msgstr ""
98
 
99
+ #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:283
100
  msgid "Allow batch formatting"
101
  msgstr ""
102
 
103
+ #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:287
104
  msgid "If you have any problems or find a bug in this plugin, please <a href=\"http://www.web-strategy.jp/wp_plugin/ps_disable_auto_formatting/#postcomment\">report to us</a>."
105
  msgstr ""
106
 
107
+ #: ps_disable_auto_formatting/ps_disable_auto_formatting.php:295
108
  msgid "Sorry, Your WordPress (version %s) is old to use PS Disable Auto Formatting plugin. Please upgrade to version 2.5 or higher."
109
  msgstr ""
110
+
ps_disable_auto_formatting.php CHANGED
@@ -1,9 +1,9 @@
1
  <?php
2
  /*
3
  Plugin Name: PS Disable Auto Formatting
4
- Plugin URI: http://www.web-strategy.co.jp/
5
  Description: PS Disable Auto Formatting is able to disable function auto formatting (wpautop) and save &lt;p&gt; and &lt;br /&gt; formatted content.
6
- Version: 0.9.1
7
  Author: Hitoshi Omagari
8
  Author URI: http://www.web-strategy.jp/
9
  */
@@ -18,7 +18,7 @@ var $setting_items = array(
18
  'term description formatting' => 'term_description',
19
  );
20
 
21
- var $mce_version = '20090120';
22
 
23
  function __construct() {
24
  global $wp_version;
@@ -28,6 +28,8 @@ function __construct() {
28
  add_action( 'admin_menu', array( &$this, 'add_disable_formatting_setting_page') );
29
  add_filter( 'print_scripts_array', array( &$this, 'rewrite_default_script' ) );
30
  add_filter( 'wp_insert_post_data', array( &$this, 'formatting_quickpress_post' ) );
 
 
31
  } else {
32
  add_action('admin_notices', array( &$this, 'version_too_old' ) );
33
  }
@@ -55,7 +57,6 @@ function disable_auto_formatting_init() {
55
  } elseif ( ! $this->option_settings ) {
56
  $this->option_settings = array();
57
  }
58
-
59
  $this->delete_default_filters();
60
  }
61
 
@@ -88,13 +89,26 @@ function set_default_settings() {
88
 
89
 
90
  function rewrite_default_script( $todo ) {
91
- global $wp_scripts;
92
-
93
- $wp_scripts->add( 'ps_editor', get_option( 'home' ) . '/' . str_replace( str_replace( '\\', '/', ABSPATH ), '', str_replace( '\\', '/', dirname( __file__ ) ) ) . '/js/ps_editor.js', false, $this->mce_version );
94
-
 
 
 
 
 
 
 
 
 
95
  $key = array_search( 'editor', $todo );
96
  if ( $key !== false ) {
97
- $todo[$key] = 'ps_editor';
 
 
 
 
98
  }
99
  return $todo;
100
  }
@@ -112,6 +126,29 @@ function formatting_quickpress_post( $data ) {
112
  }
113
 
114
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
115
  function add_disable_formatting_setting_page() {
116
  if ( function_exists( 'add_options_page' ) ) {
117
  add_options_page( 'PS Disable Auto Formatting',
1
  <?php
2
  /*
3
  Plugin Name: PS Disable Auto Formatting
4
+ Plugin URI: http://www.web-strategy.jp/wp_plugin/ps_disable_auto_formatting/
5
  Description: PS Disable Auto Formatting is able to disable function auto formatting (wpautop) and save &lt;p&gt; and &lt;br /&gt; formatted content.
6
+ Version: 0.9.2
7
  Author: Hitoshi Omagari
8
  Author URI: http://www.web-strategy.jp/
9
  */
18
  'term description formatting' => 'term_description',
19
  );
20
 
21
+ var $mce_version = '20080121';
22
 
23
  function __construct() {
24
  global $wp_version;
28
  add_action( 'admin_menu', array( &$this, 'add_disable_formatting_setting_page') );
29
  add_filter( 'print_scripts_array', array( &$this, 'rewrite_default_script' ) );
30
  add_filter( 'wp_insert_post_data', array( &$this, 'formatting_quickpress_post' ) );
31
+ add_action( 'media_buttons', array( &$this, 'check_edit_mode_and_add_ichedit_pre' ), 9 );
32
+ add_action( 'media_buttons', array( &$this, 'delete_filtering_wp_richedit_pre' ) );
33
  } else {
34
  add_action('admin_notices', array( &$this, 'version_too_old' ) );
35
  }
57
  } elseif ( ! $this->option_settings ) {
58
  $this->option_settings = array();
59
  }
 
60
  $this->delete_default_filters();
61
  }
62
 
89
 
90
 
91
  function rewrite_default_script( $todo ) {
92
+ global $wp_version, $wp_scripts;
93
+
94
+ if ( version_compare( $wp_version, '2.7', '>=' ) ) {
95
+ $scripyt_src = get_option( 'siteurl' ) . '/' . str_replace( str_replace( '\\', '/', ABSPATH ), '', str_replace( '\\', '/', dirname( __file__ ) ) ) . '/js/270/ps_editor.js';
96
+ } else {
97
+ $scripyt_src = get_option( 'siteurl' ) . '/' . str_replace( str_replace( '\\', '/', ABSPATH ), '', str_replace( '\\', '/', dirname( __file__ ) ) ) . '/js/250/ps_editor.js';
98
+ if ( version_compare( $wp_version, '2.6', '>=' ) ) {
99
+ $wp_scripts->registered['editor_functions']->src = $scripyt_src;
100
+ } else {
101
+ $wp_scripts->scripts['editor_functions']->src = $scripyt_src;
102
+ }
103
+ }
104
+ $wp_scripts->add( 'ps_editor', $scripyt_src, false, $this->mce_version );
105
  $key = array_search( 'editor', $todo );
106
  if ( $key !== false ) {
107
+ if ( version_compare( $wp_version, '2.7', '>=' ) ) {
108
+ $todo[$key] = 'ps_editor';
109
+ } else {
110
+ unset( $todo[$key] );
111
+ }
112
  }
113
  return $todo;
114
  }
126
  }
127
 
128
 
129
+ function delete_filtering_wp_richedit_pre() {
130
+ remove_filter( 'the_editor_content', 'wp_richedit_pre' );
131
+ }
132
+
133
+
134
+ function check_edit_mode_and_add_ichedit_pre() {
135
+ global $wp_filter;
136
+ if ( isset( $wp_filter['the_editor_content'][10]['wp_richedit_pre'] ) ) {
137
+ add_filter( 'the_editor_content', array( &$this, 'ps_richedit_pre' ) );
138
+ }
139
+ }
140
+
141
+
142
+ function ps_richedit_pre( $text ) {
143
+ if ( empty($text) ) return apply_filters('richedit_pre', '');
144
+
145
+ $output = convert_chars($text);
146
+ $output = htmlspecialchars($output, ENT_NOQUOTES);
147
+
148
+ return apply_filters('richedit_pre', $output);
149
+ }
150
+
151
+
152
  function add_disable_formatting_setting_page() {
153
  if ( function_exists( 'add_options_page' ) ) {
154
  add_options_page( 'PS Disable Auto Formatting',
readme.txt CHANGED
@@ -24,6 +24,10 @@ And when editing in the visual mode, it achieves to generate natural changing li
24
  * Batch formatting to all articles that you have already posted.
25
 
26
  = Version History =
 
 
 
 
27
  * **0.9.1**
28
  * bugfix : disappearing paragraph element with swithing mode in some browsers
29
  * compatible with quickpress
24
  * Batch formatting to all articles that you have already posted.
25
 
26
  = Version History =
27
+ * **0.9.2**
28
+ * bugfix : disappearing nothing included paragraph and linebreak element when load a post to edit
29
+ * bugfix : wrong javascript path in case of WordPress is set as sub directory.
30
+ * bugfix : in version 2.6 or 2.5, javascript isn't replaced.
31
  * **0.9.1**
32
  * bugfix : disappearing paragraph element with swithing mode in some browsers
33
  * compatible with quickpress