Version Description
Download this release
Release Info
Developer | tenpura |
Plugin | WP Multibyte Patch |
Version | 1.9 |
Comparing to | |
See all releases |
Code changes from version 1.8 to 1.9
- ext/ja/admin.css +4 -1
- ext/ja/class.php +5 -1
- js/word-count.js +3 -1
- js/word-count.min.js +1 -1
- js/wplink.js +38 -47
- js/wplink.min.js +1 -1
- readme.txt +3 -3
- wp-multibyte-patch.php +11 -43
- wpmp-config-sample-ja.php +4 -3
ext/ja/admin.css
CHANGED
@@ -1,6 +1,9 @@
|
|
1 |
@charset "utf-8";
|
2 |
|
|
|
|
|
|
|
|
|
3 |
body *:not(textarea) {
|
4 |
font-style: normal !important;
|
5 |
-
font-family: sans-serif !important;
|
6 |
}
|
1 |
@charset "utf-8";
|
2 |
|
3 |
+
body.branch-3-7 *:not(textarea) {
|
4 |
+
font-family: sans-serif !important;
|
5 |
+
}
|
6 |
+
|
7 |
body *:not(textarea) {
|
8 |
font-style: normal !important;
|
|
|
9 |
}
|
ext/ja/class.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* WP Multibyte Patch Japanese Locale Extension
|
4 |
*
|
5 |
* @package WP_Multibyte_Patch
|
6 |
-
* @version 1.
|
7 |
* @author Seisuke Kuraishi <210pura@gmail.com>
|
8 |
* @copyright Copyright (c) 2013 Seisuke Kuraishi, Tinybit Inc.
|
9 |
* @license http://opensource.org/licenses/gpl-2.0.php GPLv2
|
@@ -154,6 +154,10 @@ if ( class_exists( 'multibyte_patch' ) ) :
|
|
154 |
if ( 'characters' != _x( 'words', 'word count: words or characters?' ) )
|
155 |
return $text;
|
156 |
|
|
|
|
|
|
|
|
|
157 |
$text = $original_text;
|
158 |
$text = wp_strip_all_tags( $text );
|
159 |
$text = trim( preg_replace( "/[\n\r\t ]+/", ' ', $text ), ' ' );
|
3 |
* WP Multibyte Patch Japanese Locale Extension
|
4 |
*
|
5 |
* @package WP_Multibyte_Patch
|
6 |
+
* @version 1.9
|
7 |
* @author Seisuke Kuraishi <210pura@gmail.com>
|
8 |
* @copyright Copyright (c) 2013 Seisuke Kuraishi, Tinybit Inc.
|
9 |
* @license http://opensource.org/licenses/gpl-2.0.php GPLv2
|
154 |
if ( 'characters' != _x( 'words', 'word count: words or characters?' ) )
|
155 |
return $text;
|
156 |
|
157 |
+
// If the caller is wp_dashboard_recent_drafts()
|
158 |
+
if( false !== $this->conf['patch_dashboard_recent_drafts'] && 10 === $num_words && is_admin() && strpos( wp_debug_backtrace_summary(), 'wp_dashboard_recent_drafts' ) )
|
159 |
+
$num_words = $this->conf['dashboard_recent_drafts_mblength'];
|
160 |
+
|
161 |
$text = $original_text;
|
162 |
$text = wp_strip_all_tags( $text );
|
163 |
$text = trim( preg_replace( "/[\n\r\t ]+/", ' ', $text ), ' ' );
|
js/word-count.js
CHANGED
@@ -1,3 +1,5 @@
|
|
|
|
|
|
1 |
(function($,undefined) {
|
2 |
wpWordCount = {
|
3 |
|
@@ -40,7 +42,7 @@
|
|
40 |
setTimeout( function() { t.block = 0; }, 2000 );
|
41 |
}, 1 );
|
42 |
}
|
43 |
-
}
|
44 |
|
45 |
$(document).bind( 'wpcountwords', function(e, txt) {
|
46 |
wpWordCount.wc(txt);
|
1 |
+
/* global wordCountL10n */
|
2 |
+
var wpWordCount;
|
3 |
(function($,undefined) {
|
4 |
wpWordCount = {
|
5 |
|
42 |
setTimeout( function() { t.block = 0; }, 2000 );
|
43 |
}, 1 );
|
44 |
}
|
45 |
+
};
|
46 |
|
47 |
$(document).bind( 'wpcountwords', function(e, txt) {
|
48 |
wpWordCount.wc(txt);
|
js/word-count.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
(function(a,b){wpWordCount={settings:{strip:/<[a-zA-Z\/][^<>]*>/g,clean:/[0-9.(),;:!?%#$¿'"_+=\\/-]+/g,count:/\S\s+/g},block:0,wc:function(e,g){var f=this,d=a(".word-count"),c=0;if(g===b){g=wordCountL10n.type}if(g!=="w"&&g!=="c"){g="w"}if(f.block){return}f.block=1;setTimeout(function(){if(e){if(g=="w"){e=e.replace(f.settings.strip," ").replace(/ | /gi," ");e=e.replace(f.settings.clean,"");e.replace(f.settings.count,function(){c++})}else{if(g=="c"){e=e.replace(f.settings.strip,"").replace(/^ +| +$/gm,"");e=e.replace(/ +| | /gi," ");e.replace(/[\S \u00A0\u3000]/g,function(){c++})}}}d.html(c.toString());setTimeout(function(){f.block=0},2000)},1)}};a(document).bind("wpcountwords",function(d,c){wpWordCount.wc(c)})}(jQuery));
|
1 |
+
var wpWordCount;(function(a,b){wpWordCount={settings:{strip:/<[a-zA-Z\/][^<>]*>/g,clean:/[0-9.(),;:!?%#$¿'"_+=\\/-]+/g,count:/\S\s+/g},block:0,wc:function(e,g){var f=this,d=a(".word-count"),c=0;if(g===b){g=wordCountL10n.type}if(g!=="w"&&g!=="c"){g="w"}if(f.block){return}f.block=1;setTimeout(function(){if(e){if(g=="w"){e=e.replace(f.settings.strip," ").replace(/ | /gi," ");e=e.replace(f.settings.clean,"");e.replace(f.settings.count,function(){c++})}else{if(g=="c"){e=e.replace(f.settings.strip,"").replace(/^ +| +$/gm,"");e=e.replace(/ +| | /gi," ");e.replace(/[\S \u00A0\u3000]/g,function(){c++})}}}d.html(c.toString());setTimeout(function(){f.block=0},2000)},1)}};a(document).bind("wpcountwords",function(d,c){wpWordCount.wc(c)})}(jQuery));
|
js/wplink.js
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
var wpLink;
|
2 |
|
3 |
(function($){
|
@@ -113,7 +114,7 @@ var wpLink;
|
|
113 |
inputs.url.val( ed.dom.getAttrib(e, 'href') );
|
114 |
inputs.title.val( ed.dom.getAttrib(e, 'title') );
|
115 |
// Set open in new tab.
|
116 |
-
inputs.openInNewTab.prop('checked', (
|
117 |
// Update save prompt.
|
118 |
inputs.submit.val( wpLinkL10n.update );
|
119 |
|
@@ -156,7 +157,7 @@ var wpLink;
|
|
156 |
},
|
157 |
|
158 |
htmlUpdate : function() {
|
159 |
-
var attrs, html, begin, end, cursor,
|
160 |
textarea = wpLink.textarea;
|
161 |
|
162 |
if ( ! textarea )
|
@@ -197,13 +198,12 @@ var wpLink;
|
|
197 |
html = html + selection + '</a>';
|
198 |
cursor = begin + html.length;
|
199 |
|
200 |
-
// If no
|
201 |
if ( begin == end )
|
202 |
cursor -= '</a>'.length;
|
203 |
|
204 |
-
textarea.value = textarea.value.substring( 0, begin )
|
205 |
-
|
206 |
-
+ textarea.value.substring( end, textarea.value.length );
|
207 |
|
208 |
// Update cursor position
|
209 |
textarea.selectionStart = textarea.selectionEnd = cursor;
|
@@ -227,17 +227,17 @@ var wpLink;
|
|
227 |
b = ed.selection.getBookmark();
|
228 |
ed.dom.remove(e, 1);
|
229 |
ed.selection.moveToBookmark(b);
|
230 |
-
tinyMCEPopup.execCommand(
|
231 |
wpLink.close();
|
232 |
}
|
233 |
return;
|
234 |
}
|
235 |
|
236 |
if (e == null) {
|
237 |
-
ed.getDoc().execCommand(
|
238 |
-
tinyMCEPopup.execCommand(
|
239 |
|
240 |
-
tinymce.each(ed.dom.select(
|
241 |
if (ed.dom.getAttrib(n, 'href') == '#mce_temp_url#') {
|
242 |
e = n;
|
243 |
ed.dom.setAttribs(e, attrs);
|
@@ -262,7 +262,7 @@ var wpLink;
|
|
262 |
tinyMCEPopup.storeSelection();
|
263 |
}
|
264 |
|
265 |
-
ed.execCommand(
|
266 |
wpLink.close();
|
267 |
ed.focus();
|
268 |
},
|
@@ -270,7 +270,7 @@ var wpLink;
|
|
270 |
updateFields : function( e, li, originalEvent ) {
|
271 |
inputs.url.val( li.children('.item-permalink').val() );
|
272 |
inputs.title.val( li.hasClass('no-title') ? '' : li.children('.item-title').text() );
|
273 |
-
if ( originalEvent && originalEvent.type ==
|
274 |
inputs.url.focus();
|
275 |
},
|
276 |
setDefaultValues : function() {
|
@@ -318,39 +318,31 @@ var wpLink;
|
|
318 |
keydown : function( event ) {
|
319 |
var fn, key = $.ui.keyCode;
|
320 |
|
321 |
-
|
322 |
-
|
323 |
-
fn = 'prev';
|
324 |
-
case key.DOWN:
|
325 |
-
fn = fn || 'next';
|
326 |
-
clearInterval( wpLink.keyInterval );
|
327 |
-
wpLink[ fn ]();
|
328 |
-
wpLink.keyInterval = setInterval( wpLink[ fn ], wpLink.keySensitivity );
|
329 |
-
break;
|
330 |
-
default:
|
331 |
-
return;
|
332 |
}
|
|
|
|
|
|
|
|
|
|
|
333 |
event.preventDefault();
|
334 |
},
|
|
|
335 |
keyup: function( event ) {
|
336 |
var key = $.ui.keyCode;
|
337 |
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
clearInterval( wpLink.keyInterval );
|
349 |
-
break;
|
350 |
-
default:
|
351 |
-
return;
|
352 |
}
|
353 |
-
event.preventDefault();
|
354 |
},
|
355 |
|
356 |
delayedCallback : function( func, delay ) {
|
@@ -404,7 +396,7 @@ var wpLink;
|
|
404 |
});
|
405 |
event.preventDefault();
|
406 |
}
|
407 |
-
}
|
408 |
|
409 |
River = function( element, search ) {
|
410 |
var self = this;
|
@@ -507,19 +499,18 @@ var wpLink;
|
|
507 |
|
508 |
if ( !results ) {
|
509 |
if ( firstPage ) {
|
510 |
-
list += '<li class="unselectable"><span class="item-title"><em>'
|
511 |
-
|
512 |
-
+ '</em></span></li>';
|
513 |
}
|
514 |
} else {
|
515 |
$.each( results, function() {
|
516 |
classes = alt ? 'alternate' : '';
|
517 |
-
classes += this
|
518 |
list += classes ? '<li class="' + classes + '">' : '<li>';
|
519 |
-
list += '<input type="hidden" class="item-permalink" value="' + this
|
520 |
list += '<span class="item-title">';
|
521 |
-
list += this
|
522 |
-
list += '</span><span class="item-info">' + this
|
523 |
alt = ! alt;
|
524 |
});
|
525 |
}
|
@@ -578,7 +569,7 @@ var wpLink;
|
|
578 |
self.querying = false;
|
579 |
self.allLoaded = !r;
|
580 |
callback( r, query );
|
581 |
-
},
|
582 |
}
|
583 |
});
|
584 |
|
1 |
+
/* global ajaxurl, tinymce, wpLinkL10n, tinyMCEPopup, setUserSetting, wpActiveEditor */
|
2 |
var wpLink;
|
3 |
|
4 |
(function($){
|
114 |
inputs.url.val( ed.dom.getAttrib(e, 'href') );
|
115 |
inputs.title.val( ed.dom.getAttrib(e, 'title') );
|
116 |
// Set open in new tab.
|
117 |
+
inputs.openInNewTab.prop('checked', ( '_blank' == ed.dom.getAttrib( e, 'target' ) ) );
|
118 |
// Update save prompt.
|
119 |
inputs.submit.val( wpLinkL10n.update );
|
120 |
|
157 |
},
|
158 |
|
159 |
htmlUpdate : function() {
|
160 |
+
var attrs, html, begin, end, cursor, selection,
|
161 |
textarea = wpLink.textarea;
|
162 |
|
163 |
if ( ! textarea )
|
198 |
html = html + selection + '</a>';
|
199 |
cursor = begin + html.length;
|
200 |
|
201 |
+
// If no text is selected, place the cursor inside the closing tag.
|
202 |
if ( begin == end )
|
203 |
cursor -= '</a>'.length;
|
204 |
|
205 |
+
textarea.value = textarea.value.substring( 0, begin ) + html +
|
206 |
+
textarea.value.substring( end, textarea.value.length );
|
|
|
207 |
|
208 |
// Update cursor position
|
209 |
textarea.selectionStart = textarea.selectionEnd = cursor;
|
227 |
b = ed.selection.getBookmark();
|
228 |
ed.dom.remove(e, 1);
|
229 |
ed.selection.moveToBookmark(b);
|
230 |
+
tinyMCEPopup.execCommand('mceEndUndoLevel');
|
231 |
wpLink.close();
|
232 |
}
|
233 |
return;
|
234 |
}
|
235 |
|
236 |
if (e == null) {
|
237 |
+
ed.getDoc().execCommand('unlink', false, null);
|
238 |
+
tinyMCEPopup.execCommand('mceInsertLink', false, '#mce_temp_url#', {skip_undo : 1});
|
239 |
|
240 |
+
tinymce.each(ed.dom.select('a'), function(n) {
|
241 |
if (ed.dom.getAttrib(n, 'href') == '#mce_temp_url#') {
|
242 |
e = n;
|
243 |
ed.dom.setAttribs(e, attrs);
|
262 |
tinyMCEPopup.storeSelection();
|
263 |
}
|
264 |
|
265 |
+
ed.execCommand('mceEndUndoLevel');
|
266 |
wpLink.close();
|
267 |
ed.focus();
|
268 |
},
|
270 |
updateFields : function( e, li, originalEvent ) {
|
271 |
inputs.url.val( li.children('.item-permalink').val() );
|
272 |
inputs.title.val( li.hasClass('no-title') ? '' : li.children('.item-title').text() );
|
273 |
+
if ( originalEvent && originalEvent.type == 'click' )
|
274 |
inputs.url.focus();
|
275 |
},
|
276 |
setDefaultValues : function() {
|
318 |
keydown : function( event ) {
|
319 |
var fn, key = $.ui.keyCode;
|
320 |
|
321 |
+
if ( event.which !== key.UP && event.which !== key.DOWN ) {
|
322 |
+
return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
323 |
}
|
324 |
+
|
325 |
+
fn = event.which === key.UP ? 'prev' : 'next';
|
326 |
+
clearInterval( wpLink.keyInterval );
|
327 |
+
wpLink[ fn ]();
|
328 |
+
wpLink.keyInterval = setInterval( wpLink[ fn ], wpLink.keySensitivity );
|
329 |
event.preventDefault();
|
330 |
},
|
331 |
+
|
332 |
keyup: function( event ) {
|
333 |
var key = $.ui.keyCode;
|
334 |
|
335 |
+
if ( event.which === key.ESCAPE ) {
|
336 |
+
event.stopImmediatePropagation();
|
337 |
+
if ( ! $(document).triggerHandler( 'wp_CloseOnEscape', [{ event: event, what: 'wplink', cb: wpLink.close }] ) )
|
338 |
+
wpLink.close();
|
339 |
+
return false;
|
340 |
+
}
|
341 |
+
|
342 |
+
if ( event.which === key.UP || event.which === key.DOWN ) {
|
343 |
+
clearInterval( wpLink.keyInterval );
|
344 |
+
event.preventDefault();
|
|
|
|
|
|
|
|
|
345 |
}
|
|
|
346 |
},
|
347 |
|
348 |
delayedCallback : function( func, delay ) {
|
396 |
});
|
397 |
event.preventDefault();
|
398 |
}
|
399 |
+
};
|
400 |
|
401 |
River = function( element, search ) {
|
402 |
var self = this;
|
499 |
|
500 |
if ( !results ) {
|
501 |
if ( firstPage ) {
|
502 |
+
list += '<li class="unselectable"><span class="item-title"><em>' +
|
503 |
+
wpLinkL10n.noMatchesFound + '</em></span></li>';
|
|
|
504 |
}
|
505 |
} else {
|
506 |
$.each( results, function() {
|
507 |
classes = alt ? 'alternate' : '';
|
508 |
+
classes += this.title ? '' : ' no-title';
|
509 |
list += classes ? '<li class="' + classes + '">' : '<li>';
|
510 |
+
list += '<input type="hidden" class="item-permalink" value="' + this.permalink + '" />';
|
511 |
list += '<span class="item-title">';
|
512 |
+
list += this.title ? this.title : wpLinkL10n.noTitle;
|
513 |
+
list += '</span><span class="item-info">' + this.info + '</span></li>';
|
514 |
alt = ! alt;
|
515 |
});
|
516 |
}
|
569 |
self.querying = false;
|
570 |
self.allLoaded = !r;
|
571 |
callback( r, query );
|
572 |
+
}, 'json' );
|
573 |
}
|
574 |
});
|
575 |
|
js/wplink.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var wpLink
|
1 |
+
var wpLink;(function(f){var b={},e={},d,a,c;wpLink={timeToTriggerRiver:150,minRiverAJAXDuration:200,riverBottomThreshold:5,keySensitivity:100,lastSearch:"",textarea:"",init:function(){b.dialog=f("#wp-link");b.submit=f("#wp-link-submit");b.url=f("#url-field");b.nonce=f("#_ajax_linking_nonce");b.title=f("#link-title-field");b.openInNewTab=f("#link-target-checkbox");b.search=f("#search-field");e.search=new a(f("#search-results"));e.recent=new a(f("#most-recent-results"));e.elements=f(".query-results",b.dialog);b.dialog.keydown(wpLink.keydown);b.dialog.keyup(wpLink.keyup);b.submit.click(function(g){g.preventDefault();wpLink.update()});f("#wp-link-cancel").click(function(g){g.preventDefault();wpLink.close()});f("#internal-toggle").click(wpLink.toggleInternalLinking);e.elements.bind("river-select",wpLink.updateFields);b.search.keyup(wpLink.searchInternalLinks);b.dialog.bind("wpdialogrefresh",wpLink.refresh);b.dialog.bind("wpdialogbeforeopen",wpLink.beforeOpen);b.dialog.bind("wpdialogclose",wpLink.onClose)},beforeOpen:function(){wpLink.range=null;if(!wpLink.isMCE()&&document.selection){wpLink.textarea.focus();wpLink.range=document.selection.createRange()}},open:function(){if(!wpActiveEditor){return}this.textarea=f("#"+wpActiveEditor).get(0);if(!b.dialog.data("wpdialog")){b.dialog.wpdialog({title:wpLinkL10n.title,width:480,height:"auto",modal:true,dialogClass:"wp-dialog"})}b.dialog.wpdialog("open")},isMCE:function(){return tinyMCEPopup&&(d=tinyMCEPopup.editor)&&!d.isHidden()},refresh:function(){e.search.refresh();e.recent.refresh();if(wpLink.isMCE()){wpLink.mceRefresh()}else{wpLink.setDefaultValues()}b.url.focus()[0].select();if(!e.recent.ul.children().length){e.recent.ajax()}},mceRefresh:function(){var g;d=tinyMCEPopup.editor;tinyMCEPopup.restoreSelection();if(g=d.dom.getParent(d.selection.getNode(),"A")){b.url.val(d.dom.getAttrib(g,"href"));b.title.val(d.dom.getAttrib(g,"title"));b.openInNewTab.prop("checked",("_blank"==d.dom.getAttrib(g,"target")));b.submit.val(wpLinkL10n.update)}else{wpLink.setDefaultValues()}},close:function(){if(wpLink.isMCE()){tinyMCEPopup.close()}else{b.dialog.wpdialog("close")}},onClose:function(){if(!wpLink.isMCE()){wpLink.textarea.focus();if(wpLink.range){wpLink.range.moveToBookmark(wpLink.range.getBookmark());wpLink.range.select()}}},getAttrs:function(){return{href:b.url.val(),title:b.title.val(),target:b.openInNewTab.prop("checked")?"_blank":""}},update:function(){if(wpLink.isMCE()){wpLink.mceUpdate()}else{wpLink.htmlUpdate()}},htmlUpdate:function(){var i,j,l,h,m,k,g=wpLink.textarea;if(!g){return}i=wpLink.getAttrs();if(!i.href||i.href=="http://"){return}j='<a href="'+i.href+'"';if(i.title){j+=' title="'+i.title+'"'}if(i.target){j+=' target="'+i.target+'"'}j+=">";if(document.selection&&wpLink.range){g.focus();wpLink.range.text=j+wpLink.range.text+"</a>";wpLink.range.moveToBookmark(wpLink.range.getBookmark());wpLink.range.select();wpLink.range=null}else{if(typeof g.selectionStart!=="undefined"){l=g.selectionStart;h=g.selectionEnd;k=g.value.substring(l,h);j=j+k+"</a>";m=l+j.length;if(l==h){m-="</a>".length}g.value=g.value.substring(0,l)+j+g.value.substring(h,g.value.length);g.selectionStart=g.selectionEnd=m}}wpLink.close();g.focus()},mceUpdate:function(){var h=tinyMCEPopup.editor,i=wpLink.getAttrs(),j,g;tinyMCEPopup.restoreSelection();j=h.dom.getParent(h.selection.getNode(),"A");if(!i.href||i.href=="http://"){if(j){g=h.selection.getBookmark();h.dom.remove(j,1);h.selection.moveToBookmark(g);tinyMCEPopup.execCommand("mceEndUndoLevel");wpLink.close()}return}if(j==null){h.getDoc().execCommand("unlink",false,null);tinyMCEPopup.execCommand("mceInsertLink",false,"#mce_temp_url#",{skip_undo:1});tinymce.each(h.dom.select("a"),function(k){if(h.dom.getAttrib(k,"href")=="#mce_temp_url#"){j=k;h.dom.setAttribs(j,i)}});if(tinymce.isWebKit&&f(j).text()=="#mce_temp_url#"){h.dom.remove(j);j=null}}else{h.dom.setAttribs(j,i)}if(j&&(j.childNodes.length!=1||j.firstChild.nodeName!="IMG")){h.selection.select(j);h.selection.collapse(0);tinyMCEPopup.storeSelection()}h.execCommand("mceEndUndoLevel");wpLink.close();h.focus()},updateFields:function(i,h,g){b.url.val(h.children(".item-permalink").val());b.title.val(h.hasClass("no-title")?"":h.children(".item-title").text());if(g&&g.type=="click"){b.url.focus()}},setDefaultValues:function(){b.url.val("http://");b.title.val("");b.submit.val(wpLinkL10n.save)},searchInternalLinks:function(){var h=f(this),i,g=h.val();if(g.length>1){e.recent.hide();e.search.show();if(wpLink.lastSearch==g){return}wpLink.lastSearch=g;i=h.parent().find(".spinner").show();e.search.change(g);e.search.ajax(function(){i.hide()})}else{e.search.hide();e.recent.show()}},next:function(){e.search.next();e.recent.next()},prev:function(){e.search.prev();e.recent.prev()},keydown:function(i){var h,g=f.ui.keyCode;if(i.which!==g.UP&&i.which!==g.DOWN){return}h=i.which===g.UP?"prev":"next";clearInterval(wpLink.keyInterval);wpLink[h]();wpLink.keyInterval=setInterval(wpLink[h],wpLink.keySensitivity);i.preventDefault()},keyup:function(h){var g=f.ui.keyCode;if(h.which===g.ESCAPE){h.stopImmediatePropagation();if(!f(document).triggerHandler("wp_CloseOnEscape",[{event:h,what:"wplink",cb:wpLink.close}])){wpLink.close()}return false}if(h.which===g.UP||h.which===g.DOWN){clearInterval(wpLink.keyInterval);h.preventDefault()}},delayedCallback:function(i,g){var l,k,j,h;if(!g){return i}setTimeout(function(){if(k){return i.apply(h,j)}l=true},g);return function(){if(l){return i.apply(this,arguments)}j=arguments;h=this;k=true}},toggleInternalLinking:function(h){var g=f("#search-panel"),i=b.dialog.wpdialog("widget"),k=!g.is(":visible"),j=f(window);f(this).toggleClass("toggle-arrow-active",k);b.dialog.height("auto");g.slideToggle(300,function(){setUserSetting("wplink",k?"1":"0");b[k?"search":"url"].focus();var l=j.scrollTop(),o=i.offset().top,m=o+i.outerHeight(),n=m-j.height();if(n>l){i.animate({top:n<o?o-n:l},200)}});h.preventDefault()}};a=function(i,h){var g=this;this.element=i;this.ul=i.children("ul");this.waiting=i.find(".river-waiting");this.change(h);this.refresh();i.scroll(function(){g.maybeLoad()});i.delegate("li","click",function(j){g.select(f(this),j)})};f.extend(a.prototype,{refresh:function(){this.deselect();this.visible=this.element.is(":visible")},show:function(){if(!this.visible){this.deselect();this.element.show();this.visible=true}},hide:function(){this.element.hide();this.visible=false},select:function(h,k){var j,i,l,g;if(h.hasClass("unselectable")||h==this.selected){return}this.deselect();this.selected=h.addClass("selected");j=h.outerHeight();i=this.element.height();l=h.position().top;g=this.element.scrollTop();if(l<0){this.element.scrollTop(g+l)}else{if(l+j>i){this.element.scrollTop(g+l-i+j)}}this.element.trigger("river-select",[h,k,this])},deselect:function(){if(this.selected){this.selected.removeClass("selected")}this.selected=false},prev:function(){if(!this.visible){return}var g;if(this.selected){g=this.selected.prev("li");if(g.length){this.select(g)}}},next:function(){if(!this.visible){return}var g=this.selected?this.selected.next("li"):f("li:not(.unselectable):first",this.element);if(g.length){this.select(g)}},ajax:function(j){var h=this,i=this.query.page==1?0:wpLink.minRiverAJAXDuration,g=wpLink.delayedCallback(function(k,l){h.process(k,l);if(j){j(k,l)}},i);this.query.ajax(g)},change:function(g){if(this.query&&this._search==g){return}this._search=g;this.query=new c(g);this.element.scrollTop(0)},process:function(h,l){var i="",j=true,g="",k=l.page==1;if(!h){if(k){i+='<li class="unselectable"><span class="item-title"><em>'+wpLinkL10n.noMatchesFound+"</em></span></li>"}}else{f.each(h,function(){g=j?"alternate":"";g+=this.title?"":" no-title";i+=g?'<li class="'+g+'">':"<li>";i+='<input type="hidden" class="item-permalink" value="'+this.permalink+'" />';i+='<span class="item-title">';i+=this.title?this.title:wpLinkL10n.noTitle;i+='</span><span class="item-info">'+this.info+"</span></li>";j=!j})}this.ul[k?"html":"append"](i)},maybeLoad:function(){var h=this,i=this.element,g=i.scrollTop()+i.height();if(!this.query.ready()||g<this.ul.height()-wpLink.riverBottomThreshold){return}setTimeout(function(){var j=i.scrollTop(),k=j+i.height();if(!h.query.ready()||k<h.ul.height()-wpLink.riverBottomThreshold){return}h.waiting.show();i.scrollTop(j+h.waiting.outerHeight());h.ajax(function(){h.waiting.hide()})},wpLink.timeToTriggerRiver)}});c=function(g){this.page=1;this.allLoaded=false;this.querying=false;this.search=g};f.extend(c.prototype,{ready:function(){return !(this.querying||this.allLoaded)},ajax:function(i){var g=this,h={action:"wp-link-ajax",page:this.page,_ajax_linking_nonce:b.nonce.val()};if(this.search){h.search=this.search}this.querying=true;f.post(ajaxurl,h,function(j){g.page++;g.querying=false;g.allLoaded=!j;i(j,h)},"json")}});f(document).ready(wpLink.init)})(jQuery);
|
readme.txt
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
=== WP Multibyte Patch ===
|
2 |
Contributors: tenpura
|
3 |
Tags: multibyte,i18n,wp-multibyte-patch,Japanese
|
4 |
-
Requires at least: 3.
|
5 |
-
Tested up to: 3.
|
6 |
-
Stable tag: 1.
|
7 |
|
8 |
Multibyte functionality enhancement for the WordPress Japanese package.
|
9 |
|
1 |
=== WP Multibyte Patch ===
|
2 |
Contributors: tenpura
|
3 |
Tags: multibyte,i18n,wp-multibyte-patch,Japanese
|
4 |
+
Requires at least: 3.8-RC2
|
5 |
+
Tested up to: 3.8
|
6 |
+
Stable tag: 1.9
|
7 |
|
8 |
Multibyte functionality enhancement for the WordPress Japanese package.
|
9 |
|
wp-multibyte-patch.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/*
|
3 |
Plugin Name: WP Multibyte Patch
|
4 |
Description: Multibyte functionality enhancement for the WordPress Japanese package.
|
5 |
-
Version: 1.
|
6 |
Plugin URI: http://eastcoder.com/code/wp-multibyte-patch/
|
7 |
Author: Seisuke Kuraishi
|
8 |
Author URI: http://tinybit.co.jp/
|
@@ -15,7 +15,7 @@ Domain Path: /languages
|
|
15 |
* Multibyte functionality enhancement for the WordPress Japanese package.
|
16 |
*
|
17 |
* @package WP_Multibyte_Patch
|
18 |
-
* @version 1.
|
19 |
* @author Seisuke Kuraishi <210pura@gmail.com>
|
20 |
* @copyright Copyright (c) 2013 Seisuke Kuraishi, Tinybit Inc.
|
21 |
* @license http://opensource.org/licenses/gpl-2.0.php GPLv2
|
@@ -47,6 +47,7 @@ class multibyte_patch {
|
|
47 |
'patch_force_character_count' => false,
|
48 |
'patch_force_twentytwelve_open_sans_off' => false,
|
49 |
'patch_force_twentythirteen_google_fonts_off' => false,
|
|
|
50 |
'patch_sanitize_file_name' => true,
|
51 |
'patch_bp_create_excerpt' => false,
|
52 |
'bp_excerpt_mblength' => 110,
|
@@ -60,7 +61,7 @@ class multibyte_patch {
|
|
60 |
var $debug_suffix = '';
|
61 |
var $textdomain = 'wp-multibyte-patch';
|
62 |
var $lang_dir = 'languages';
|
63 |
-
var $required_version = '3.
|
64 |
var $query_based_vars = array();
|
65 |
|
66 |
// For fallback purpose only. (1.6)
|
@@ -290,43 +291,8 @@ class multibyte_patch {
|
|
290 |
wp_dequeue_style( 'twentythirteen-fonts' );
|
291 |
}
|
292 |
|
293 |
-
function
|
294 |
-
|
295 |
-
$drafts_query = new WP_Query( array(
|
296 |
-
'post_type' => 'post',
|
297 |
-
'post_status' => 'draft',
|
298 |
-
'author' => $GLOBALS['current_user']->ID,
|
299 |
-
'posts_per_page' => 5,
|
300 |
-
'orderby' => 'modified',
|
301 |
-
'order' => 'DESC'
|
302 |
-
) );
|
303 |
-
$drafts =& $drafts_query->posts;
|
304 |
-
}
|
305 |
-
|
306 |
-
if ( $drafts && is_array( $drafts ) ) {
|
307 |
-
$list = array();
|
308 |
-
foreach ( $drafts as $draft ) {
|
309 |
-
$url = get_edit_post_link( $draft->ID );
|
310 |
-
$title = _draft_or_post_title( $draft->ID );
|
311 |
-
$item = "<h4><a href='$url' title='" . sprintf( __( 'Edit “%s”' ), esc_attr( $title ) ) . "'>" . esc_html( $title ) . "</a> <abbr title='" . get_the_time( __( 'Y/m/d g:i:s A' ), $draft ) . "'>" . get_the_time( get_option( 'date_format' ), $draft ) . '</abbr></h4>';
|
312 |
-
$item .= '<p>' . $this->trim_multibyte_excerpt( $draft->post_content, $this->conf['dashboard_recent_drafts_mblength'], $more = '…', $this->blog_encoding ) . '</p>';
|
313 |
-
$list[] = $item;
|
314 |
-
}
|
315 |
-
?>
|
316 |
-
<ul>
|
317 |
-
<li><?php echo join( "</li>\n<li>", $list ); ?></li>
|
318 |
-
</ul>
|
319 |
-
<p class="textright"><a href="edit.php?post_status=draft" ><?php _e( 'View all' ); ?></a></p>
|
320 |
-
<?php
|
321 |
-
} else {
|
322 |
-
_e( 'There are no drafts at the moment' );
|
323 |
-
}
|
324 |
-
}
|
325 |
-
|
326 |
-
function dashboard_recent_drafts() {
|
327 |
-
global $wp_meta_boxes;
|
328 |
-
if ( !empty( $wp_meta_boxes['dashboard']['side']['core']['dashboard_recent_drafts']['callback'] ) )
|
329 |
-
$wp_meta_boxes['dashboard']['side']['core']['dashboard_recent_drafts']['callback'] = array( $this, 'wp_dashboard_recent_drafts' );
|
330 |
}
|
331 |
|
332 |
function query_based_settings() {
|
@@ -363,6 +329,11 @@ class multibyte_patch {
|
|
363 |
add_action( 'wp_enqueue_scripts', array( $this, 'force_twentythirteen_google_fonts_off' ), 99 );
|
364 |
add_action( 'admin_print_styles-appearance_page_custom-header', array( $this, 'force_twentythirteen_google_fonts_off' ), 99 );
|
365 |
}
|
|
|
|
|
|
|
|
|
|
|
366 |
}
|
367 |
|
368 |
function filters() {
|
@@ -411,9 +382,6 @@ class multibyte_patch {
|
|
411 |
if ( false !== $this->conf['patch_word_count_js'] )
|
412 |
add_action( 'wp_default_scripts', array( $this, 'word_count_js' ), 9 );
|
413 |
|
414 |
-
if ( false !== $this->conf['patch_dashboard_recent_drafts'] )
|
415 |
-
add_action( 'wp_dashboard_setup', array( $this, 'dashboard_recent_drafts' ) );
|
416 |
-
|
417 |
add_action( 'after_setup_theme', array( $this, 'filters_after_setup_theme' ), 99 );
|
418 |
}
|
419 |
|
2 |
/*
|
3 |
Plugin Name: WP Multibyte Patch
|
4 |
Description: Multibyte functionality enhancement for the WordPress Japanese package.
|
5 |
+
Version: 1.9
|
6 |
Plugin URI: http://eastcoder.com/code/wp-multibyte-patch/
|
7 |
Author: Seisuke Kuraishi
|
8 |
Author URI: http://tinybit.co.jp/
|
15 |
* Multibyte functionality enhancement for the WordPress Japanese package.
|
16 |
*
|
17 |
* @package WP_Multibyte_Patch
|
18 |
+
* @version 1.9
|
19 |
* @author Seisuke Kuraishi <210pura@gmail.com>
|
20 |
* @copyright Copyright (c) 2013 Seisuke Kuraishi, Tinybit Inc.
|
21 |
* @license http://opensource.org/licenses/gpl-2.0.php GPLv2
|
47 |
'patch_force_character_count' => false,
|
48 |
'patch_force_twentytwelve_open_sans_off' => false,
|
49 |
'patch_force_twentythirteen_google_fonts_off' => false,
|
50 |
+
'patch_force_twentyfourteen_google_fonts_off' => false,
|
51 |
'patch_sanitize_file_name' => true,
|
52 |
'patch_bp_create_excerpt' => false,
|
53 |
'bp_excerpt_mblength' => 110,
|
61 |
var $debug_suffix = '';
|
62 |
var $textdomain = 'wp-multibyte-patch';
|
63 |
var $lang_dir = 'languages';
|
64 |
+
var $required_version = '3.8-RC2';
|
65 |
var $query_based_vars = array();
|
66 |
|
67 |
// For fallback purpose only. (1.6)
|
291 |
wp_dequeue_style( 'twentythirteen-fonts' );
|
292 |
}
|
293 |
|
294 |
+
function force_twentyfourteen_google_fonts_off() {
|
295 |
+
wp_dequeue_style( 'twentyfourteen-lato' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
296 |
}
|
297 |
|
298 |
function query_based_settings() {
|
329 |
add_action( 'wp_enqueue_scripts', array( $this, 'force_twentythirteen_google_fonts_off' ), 99 );
|
330 |
add_action( 'admin_print_styles-appearance_page_custom-header', array( $this, 'force_twentythirteen_google_fonts_off' ), 99 );
|
331 |
}
|
332 |
+
|
333 |
+
if ( false !== $this->conf['patch_force_twentyfourteen_google_fonts_off'] && 'twentyfourteen' == get_template() ) {
|
334 |
+
add_action( 'wp_enqueue_scripts', array( $this, 'force_twentyfourteen_google_fonts_off' ), 99 );
|
335 |
+
add_action( 'admin_print_scripts-appearance_page_custom-header', array( $this, 'force_twentyfourteen_google_fonts_off' ), 99 );
|
336 |
+
}
|
337 |
}
|
338 |
|
339 |
function filters() {
|
382 |
if ( false !== $this->conf['patch_word_count_js'] )
|
383 |
add_action( 'wp_default_scripts', array( $this, 'word_count_js' ), 9 );
|
384 |
|
|
|
|
|
|
|
385 |
add_action( 'after_setup_theme', array( $this, 'filters_after_setup_theme' ), 99 );
|
386 |
}
|
387 |
|
wpmp-config-sample-ja.php
CHANGED
@@ -35,15 +35,15 @@ $wpmp_conf['excerpt_more'] = ' […]';
|
|
35 |
/**
|
36 |
* get_comment_excerpt() 抜粋の最大文字数
|
37 |
*
|
38 |
-
* この設定は comment_excerpt() (
|
39 |
* この設定は $wpmp_conf['patch_get_comment_excerpt'] が false の場合は無効となります。
|
40 |
*/
|
41 |
$wpmp_conf['comment_excerpt_mblength'] = 40;
|
42 |
|
43 |
/**
|
44 |
-
*
|
45 |
*
|
46 |
-
*
|
47 |
* この設定は $wpmp_conf['patch_dashboard_recent_drafts'] が false の場合は無効となります。
|
48 |
*/
|
49 |
$wpmp_conf['dashboard_recent_drafts_mblength'] = 40;
|
@@ -98,5 +98,6 @@ $wpmp_conf['patch_word_count_js'] = true;
|
|
98 |
$wpmp_conf['patch_force_character_count'] = true;
|
99 |
$wpmp_conf['patch_force_twentytwelve_open_sans_off'] = true;
|
100 |
$wpmp_conf['patch_force_twentythirteen_google_fonts_off'] = false;
|
|
|
101 |
$wpmp_conf['patch_sanitize_file_name'] = true;
|
102 |
$wpmp_conf['patch_bp_create_excerpt'] = false;
|
35 |
/**
|
36 |
* get_comment_excerpt() 抜粋の最大文字数
|
37 |
*
|
38 |
+
* この設定は comment_excerpt() (ダッシュボード > アクティビティ > コメント の抜粋で利用) に適用されます。
|
39 |
* この設定は $wpmp_conf['patch_get_comment_excerpt'] が false の場合は無効となります。
|
40 |
*/
|
41 |
$wpmp_conf['comment_excerpt_mblength'] = 40;
|
42 |
|
43 |
/**
|
44 |
+
* ダッシュボード「下書き」抜粋の最大文字数
|
45 |
*
|
46 |
+
* この設定は、ダッシュボード > クイックドラフト > 下書き の抜粋に適用されます。
|
47 |
* この設定は $wpmp_conf['patch_dashboard_recent_drafts'] が false の場合は無効となります。
|
48 |
*/
|
49 |
$wpmp_conf['dashboard_recent_drafts_mblength'] = 40;
|
98 |
$wpmp_conf['patch_force_character_count'] = true;
|
99 |
$wpmp_conf['patch_force_twentytwelve_open_sans_off'] = true;
|
100 |
$wpmp_conf['patch_force_twentythirteen_google_fonts_off'] = false;
|
101 |
+
$wpmp_conf['patch_force_twentyfourteen_google_fonts_off'] = false;
|
102 |
$wpmp_conf['patch_sanitize_file_name'] = true;
|
103 |
$wpmp_conf['patch_bp_create_excerpt'] = false;
|