WP Multibyte Patch - Version 1.8

Version Description

Download this release

Release Info

Developer tenpura
Plugin Icon wp plugin WP Multibyte Patch
Version 1.8
Comparing to
See all releases

Code changes from version 1.7 to 1.8

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
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
@@ -118,7 +118,7 @@ if ( class_exists( 'multibyte_patch' ) ) :
118
  $blog_encoding = $this->blog_encoding;
119
 
120
  if ( isset( $_GET['s'] ) ) {
121
- $_GET['s'] = stripslashes( $_GET['s'] );
122
  $_GET['s'] = mb_convert_kana( $_GET['s'], 's', $blog_encoding );
123
  $_GET['s'] = preg_replace( "/ +/", " ", $_GET['s'] );
124
  $_GET['s'] = wp_slash( $_GET['s'] );
3
  * WP Multibyte Patch Japanese Locale Extension
4
  *
5
  * @package WP_Multibyte_Patch
6
+ * @version 1.8
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
118
  $blog_encoding = $this->blog_encoding;
119
 
120
  if ( isset( $_GET['s'] ) ) {
121
+ $_GET['s'] = wp_unslash( $_GET['s'] );
122
  $_GET['s'] = mb_convert_kana( $_GET['s'], 's', $blog_encoding );
123
  $_GET['s'] = preg_replace( "/ +/", " ", $_GET['s'] );
124
  $_GET['s'] = wp_slash( $_GET['s'] );
js/word-count.js CHANGED
@@ -4,7 +4,7 @@
4
  settings : {
5
  strip : /<[a-zA-Z\/][^<>]*>/g, // strip HTML tags
6
  clean : /[0-9.(),;:!?%#$¿'"_+=\\/-]+/g, // regexp to remove punctuation, etc.
7
- count : /\S\s+/g, // word-counting regexp
8
  },
9
 
10
  block : 0,
4
  settings : {
5
  strip : /<[a-zA-Z\/][^<>]*>/g, // strip HTML tags
6
  clean : /[0-9.(),;:!?%#$¿'"_+=\\/-]+/g, // regexp to remove punctuation, etc.
7
+ count : /\S\s+/g // word-counting regexp
8
  },
9
 
10
  block : 0,
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(/&nbsp;|&#160;/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(/ +|&nbsp;|&#160;/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
+ (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(/&nbsp;|&#160;/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(/ +|&nbsp;|&#160;/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
@@ -121,8 +121,6 @@ var wpLink;
121
  } else {
122
  wpLink.setDefaultValues();
123
  }
124
-
125
- tinyMCEPopup.storeSelection();
126
  },
127
 
128
  close : function() {
@@ -226,7 +224,6 @@ var wpLink;
226
  // If the values are empty, unlink and return
227
  if ( ! attrs.href || attrs.href == 'http://' ) {
228
  if ( e ) {
229
- tinyMCEPopup.execCommand("mceBeginUndoLevel");
230
  b = ed.selection.getBookmark();
231
  ed.dom.remove(e, 1);
232
  ed.selection.moveToBookmark(b);
@@ -236,8 +233,6 @@ var wpLink;
236
  return;
237
  }
238
 
239
- tinyMCEPopup.execCommand("mceBeginUndoLevel");
240
-
241
  if (e == null) {
242
  ed.getDoc().execCommand("unlink", false, null);
243
  tinyMCEPopup.execCommand("mceInsertLink", false, "#mce_temp_url#", {skip_undo : 1});
@@ -252,7 +247,7 @@ var wpLink;
252
  // Sometimes WebKit lets a user create a link where
253
  // they shouldn't be able to. In this case, CreateLink
254
  // injects "#mce_temp_url#" into their content. Fix it.
255
- if ( $(e).text() == '#mce_temp_url#' ) {
256
  ed.dom.remove(e);
257
  e = null;
258
  }
@@ -260,16 +255,16 @@ var wpLink;
260
  ed.dom.setAttribs(e, attrs);
261
  }
262
 
263
- // Don't move caret if selection was image
264
  if ( e && (e.childNodes.length != 1 || e.firstChild.nodeName != 'IMG') ) {
265
- ed.focus();
266
  ed.selection.select(e);
267
  ed.selection.collapse(0);
268
  tinyMCEPopup.storeSelection();
269
  }
270
 
271
- tinyMCEPopup.execCommand("mceEndUndoLevel");
272
  wpLink.close();
 
273
  },
274
 
275
  updateFields : function( e, li, originalEvent ) {
121
  } else {
122
  wpLink.setDefaultValues();
123
  }
 
 
124
  },
125
 
126
  close : function() {
224
  // If the values are empty, unlink and return
225
  if ( ! attrs.href || attrs.href == 'http://' ) {
226
  if ( e ) {
 
227
  b = ed.selection.getBookmark();
228
  ed.dom.remove(e, 1);
229
  ed.selection.moveToBookmark(b);
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});
247
  // Sometimes WebKit lets a user create a link where
248
  // they shouldn't be able to. In this case, CreateLink
249
  // injects "#mce_temp_url#" into their content. Fix it.
250
+ if ( tinymce.isWebKit && $(e).text() == '#mce_temp_url#' ) {
251
  ed.dom.remove(e);
252
  e = null;
253
  }
255
  ed.dom.setAttribs(e, attrs);
256
  }
257
 
258
+ // Move the caret if selection was not an image.
259
  if ( e && (e.childNodes.length != 1 || e.firstChild.nodeName != 'IMG') ) {
 
260
  ed.selection.select(e);
261
  ed.selection.collapse(0);
262
  tinyMCEPopup.storeSelection();
263
  }
264
 
265
+ ed.execCommand("mceEndUndoLevel");
266
  wpLink.close();
267
+ ed.focus();
268
  },
269
 
270
  updateFields : function( e, li, originalEvent ) {
js/wplink.min.js CHANGED
@@ -1 +1 @@
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()}tinyMCEPopup.storeSelection()},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,k,h,l,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"){k=g.selectionStart;h=g.selectionEnd;selection=g.value.substring(k,h);j=j+selection+"</a>";l=k+j.length;if(k==h){l-="</a>".length}g.value=g.value.substring(0,k)+j+g.value.substring(h,g.value.length);g.selectionStart=g.selectionEnd=l}}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){tinyMCEPopup.execCommand("mceBeginUndoLevel");g=h.selection.getBookmark();h.dom.remove(j,1);h.selection.moveToBookmark(g);tinyMCEPopup.execCommand("mceEndUndoLevel");wpLink.close()}return}tinyMCEPopup.execCommand("mceBeginUndoLevel");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(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.focus();h.selection.select(j);h.selection.collapse(0);tinyMCEPopup.storeSelection()}tinyMCEPopup.execCommand("mceEndUndoLevel");wpLink.close()},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;switch(i.which){case g.UP:h="prev";case g.DOWN:h=h||"next";clearInterval(wpLink.keyInterval);wpLink[h]();wpLink.keyInterval=setInterval(wpLink[h],wpLink.keySensitivity);break;default:return}i.preventDefault()},keyup:function(h){var g=f.ui.keyCode;switch(h.which){case g.ESCAPE:h.stopImmediatePropagation();if(!f(document).triggerHandler("wp_CloseOnEscape",[{event:h,what:"wplink",cb:wpLink.close}])){wpLink.close()}return false;break;case g.UP:case g.DOWN:clearInterval(wpLink.keyInterval);break;default:return}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);
1
+ var wpLink;!function(a){var b,c,d,e={},f={};wpLink={timeToTriggerRiver:150,minRiverAJAXDuration:200,riverBottomThreshold:5,keySensitivity:100,lastSearch:"",textarea:"",init:function(){e.dialog=a("#wp-link"),e.submit=a("#wp-link-submit"),e.url=a("#url-field"),e.nonce=a("#_ajax_linking_nonce"),e.title=a("#link-title-field"),e.openInNewTab=a("#link-target-checkbox"),e.search=a("#search-field"),f.search=new c(a("#search-results")),f.recent=new c(a("#most-recent-results")),f.elements=a(".query-results",e.dialog),e.dialog.keydown(wpLink.keydown),e.dialog.keyup(wpLink.keyup),e.submit.click(function(a){a.preventDefault(),wpLink.update()}),a("#wp-link-cancel").click(function(a){a.preventDefault(),wpLink.close()}),a("#internal-toggle").click(wpLink.toggleInternalLinking),f.elements.bind("river-select",wpLink.updateFields),e.search.keyup(wpLink.searchInternalLinks),e.dialog.bind("wpdialogrefresh",wpLink.refresh),e.dialog.bind("wpdialogbeforeopen",wpLink.beforeOpen),e.dialog.bind("wpdialogclose",wpLink.onClose)},beforeOpen:function(){wpLink.range=null,!wpLink.isMCE()&&document.selection&&(wpLink.textarea.focus(),wpLink.range=document.selection.createRange())},open:function(){wpActiveEditor&&(this.textarea=a("#"+wpActiveEditor).get(0),e.dialog.data("wpdialog")||e.dialog.wpdialog({title:wpLinkL10n.title,width:480,height:"auto",modal:!0,dialogClass:"wp-dialog"}),e.dialog.wpdialog("open"))},isMCE:function(){return tinyMCEPopup&&(b=tinyMCEPopup.editor)&&!b.isHidden()},refresh:function(){f.search.refresh(),f.recent.refresh(),wpLink.isMCE()?wpLink.mceRefresh():wpLink.setDefaultValues(),e.url.focus()[0].select(),f.recent.ul.children().length||f.recent.ajax()},mceRefresh:function(){var a;b=tinyMCEPopup.editor,tinyMCEPopup.restoreSelection(),(a=b.dom.getParent(b.selection.getNode(),"A"))?(e.url.val(b.dom.getAttrib(a,"href")),e.title.val(b.dom.getAttrib(a,"title")),e.openInNewTab.prop("checked","_blank"==b.dom.getAttrib(a,"target")),e.submit.val(wpLinkL10n.update)):wpLink.setDefaultValues()},close:function(){wpLink.isMCE()?tinyMCEPopup.close():e.dialog.wpdialog("close")},onClose:function(){wpLink.isMCE()||(wpLink.textarea.focus(),wpLink.range&&(wpLink.range.moveToBookmark(wpLink.range.getBookmark()),wpLink.range.select()))},getAttrs:function(){return{href:e.url.val(),title:e.title.val(),target:e.openInNewTab.prop("checked")?"_blank":""}},update:function(){wpLink.isMCE()?wpLink.mceUpdate():wpLink.htmlUpdate()},htmlUpdate:function(){var a,b,c,d,e,f=wpLink.textarea;f&&(a=wpLink.getAttrs(),a.href&&"http://"!=a.href&&(b='<a href="'+a.href+'"',a.title&&(b+=' title="'+a.title+'"'),a.target&&(b+=' target="'+a.target+'"'),b+=">",document.selection&&wpLink.range?(f.focus(),wpLink.range.text=b+wpLink.range.text+"</a>",wpLink.range.moveToBookmark(wpLink.range.getBookmark()),wpLink.range.select(),wpLink.range=null):"undefined"!=typeof f.selectionStart&&(c=f.selectionStart,d=f.selectionEnd,selection=f.value.substring(c,d),b=b+selection+"</a>",e=c+b.length,c==d&&(e-="</a>".length),f.value=f.value.substring(0,c)+b+f.value.substring(d,f.value.length),f.selectionStart=f.selectionEnd=e),wpLink.close(),f.focus()))},mceUpdate:function(){var b,c,d=tinyMCEPopup.editor,e=wpLink.getAttrs();return tinyMCEPopup.restoreSelection(),b=d.dom.getParent(d.selection.getNode(),"A"),e.href&&"http://"!=e.href?(null==b?(d.getDoc().execCommand("unlink",!1,null),tinyMCEPopup.execCommand("mceInsertLink",!1,"#mce_temp_url#",{skip_undo:1}),tinymce.each(d.dom.select("a"),function(a){"#mce_temp_url#"==d.dom.getAttrib(a,"href")&&(b=a,d.dom.setAttribs(b,e))}),tinymce.isWebKit&&"#mce_temp_url#"==a(b).text()&&(d.dom.remove(b),b=null)):d.dom.setAttribs(b,e),!b||1==b.childNodes.length&&"IMG"==b.firstChild.nodeName||(d.selection.select(b),d.selection.collapse(0),tinyMCEPopup.storeSelection()),d.execCommand("mceEndUndoLevel"),wpLink.close(),d.focus(),void 0):(b&&(c=d.selection.getBookmark(),d.dom.remove(b,1),d.selection.moveToBookmark(c),tinyMCEPopup.execCommand("mceEndUndoLevel"),wpLink.close()),void 0)},updateFields:function(a,b,c){e.url.val(b.children(".item-permalink").val()),e.title.val(b.hasClass("no-title")?"":b.children(".item-title").text()),c&&"click"==c.type&&e.url.focus()},setDefaultValues:function(){e.url.val("http://"),e.title.val(""),e.submit.val(wpLinkL10n.save)},searchInternalLinks:function(){var b,c=a(this),d=c.val();if(d.length>1){if(f.recent.hide(),f.search.show(),wpLink.lastSearch==d)return;wpLink.lastSearch=d,b=c.parent().find(".spinner").show(),f.search.change(d),f.search.ajax(function(){b.hide()})}else f.search.hide(),f.recent.show()},next:function(){f.search.next(),f.recent.next()},prev:function(){f.search.prev(),f.recent.prev()},keydown:function(b){var c,d=a.ui.keyCode;switch(b.which){case d.UP:c="prev";case d.DOWN:c=c||"next",clearInterval(wpLink.keyInterval),wpLink[c](),wpLink.keyInterval=setInterval(wpLink[c],wpLink.keySensitivity);break;default:return}b.preventDefault()},keyup:function(b){var c=a.ui.keyCode;switch(b.which){case c.ESCAPE:return b.stopImmediatePropagation(),a(document).triggerHandler("wp_CloseOnEscape",[{event:b,what:"wplink",cb:wpLink.close}])||wpLink.close(),!1;case c.UP:case c.DOWN:clearInterval(wpLink.keyInterval);break;default:return}b.preventDefault()},delayedCallback:function(a,b){var c,d,e,f;return b?(setTimeout(function(){return d?a.apply(f,e):(c=!0,void 0)},b),function(){return c?a.apply(this,arguments):(e=arguments,f=this,d=!0,void 0)}):a},toggleInternalLinking:function(b){var c=a("#search-panel"),d=e.dialog.wpdialog("widget"),f=!c.is(":visible"),g=a(window);a(this).toggleClass("toggle-arrow-active",f),e.dialog.height("auto"),c.slideToggle(300,function(){setUserSetting("wplink",f?"1":"0"),e[f?"search":"url"].focus();var a=g.scrollTop(),b=d.offset().top,c=b+d.outerHeight(),h=c-g.height();h>a&&d.animate({top:b>h?b-h:a},200)}),b.preventDefault()}},c=function(b,c){var d=this;this.element=b,this.ul=b.children("ul"),this.waiting=b.find(".river-waiting"),this.change(c),this.refresh(),b.scroll(function(){d.maybeLoad()}),b.delegate("li","click",function(b){d.select(a(this),b)})},a.extend(c.prototype,{refresh:function(){this.deselect(),this.visible=this.element.is(":visible")},show:function(){this.visible||(this.deselect(),this.element.show(),this.visible=!0)},hide:function(){this.element.hide(),this.visible=!1},select:function(a,b){var c,d,e,f;a.hasClass("unselectable")||a==this.selected||(this.deselect(),this.selected=a.addClass("selected"),c=a.outerHeight(),d=this.element.height(),e=a.position().top,f=this.element.scrollTop(),0>e?this.element.scrollTop(f+e):e+c>d&&this.element.scrollTop(f+e-d+c),this.element.trigger("river-select",[a,b,this]))},deselect:function(){this.selected&&this.selected.removeClass("selected"),this.selected=!1},prev:function(){if(this.visible){var a;this.selected&&(a=this.selected.prev("li"),a.length&&this.select(a))}},next:function(){if(this.visible){var b=this.selected?this.selected.next("li"):a("li:not(.unselectable):first",this.element);b.length&&this.select(b)}},ajax:function(a){var b=this,c=1==this.query.page?0:wpLink.minRiverAJAXDuration,d=wpLink.delayedCallback(function(c,d){b.process(c,d),a&&a(c,d)},c);this.query.ajax(d)},change:function(a){this.query&&this._search==a||(this._search=a,this.query=new d(a),this.element.scrollTop(0))},process:function(b,c){var d="",e=!0,f="",g=1==c.page;b?a.each(b,function(){f=e?"alternate":"",f+=this.title?"":" no-title",d+=f?'<li class="'+f+'">':"<li>",d+='<input type="hidden" class="item-permalink" value="'+this.permalink+'" />',d+='<span class="item-title">',d+=this.title?this.title:wpLinkL10n.noTitle,d+='</span><span class="item-info">'+this.info+"</span></li>",e=!e}):g&&(d+='<li class="unselectable"><span class="item-title"><em>'+wpLinkL10n.noMatchesFound+"</em></span></li>"),this.ul[g?"html":"append"](d)},maybeLoad:function(){var a=this,b=this.element,c=b.scrollTop()+b.height();!this.query.ready()||c<this.ul.height()-wpLink.riverBottomThreshold||setTimeout(function(){var c=b.scrollTop(),d=c+b.height();!a.query.ready()||d<a.ul.height()-wpLink.riverBottomThreshold||(a.waiting.show(),b.scrollTop(c+a.waiting.outerHeight()),a.ajax(function(){a.waiting.hide()}))},wpLink.timeToTriggerRiver)}}),d=function(a){this.page=1,this.allLoaded=!1,this.querying=!1,this.search=a},a.extend(d.prototype,{ready:function(){return!(this.querying||this.allLoaded)},ajax:function(b){var c=this,d={action:"wp-link-ajax",page:this.page,_ajax_linking_nonce:e.nonce.val()};this.search&&(d.search=this.search),this.querying=!0,a.post(ajaxurl,d,function(a){c.page++,c.querying=!1,c.allLoaded=!a,b(a,d)},"json")}}),a(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.6
5
- Tested up to: 3.6
6
- Stable tag: 1.7
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.7-RC1
5
+ Tested up to: 3.7
6
+ Stable tag: 1.8
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.7
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.7
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
@@ -60,7 +60,7 @@ class multibyte_patch {
60
  var $debug_suffix = '';
61
  var $textdomain = 'wp-multibyte-patch';
62
  var $lang_dir = 'languages';
63
- var $required_version = '3.6';
64
  var $query_based_vars = array();
65
 
66
  // For fallback purpose only. (1.6)
@@ -354,8 +354,10 @@ class multibyte_patch {
354
  if ( false !== $this->conf['patch_force_character_count'] && 'characters' != _x( 'words', 'word count: words or characters?' ) )
355
  add_filter( 'gettext_with_context', array( $this, 'force_character_count' ), 10, 3 );
356
 
357
- if ( false !== $this->conf['patch_force_twentytwelve_open_sans_off'] && 'twentytwelve' == get_template() )
358
  add_action( 'wp_enqueue_scripts', array( $this, 'force_twentytwelve_open_sans_off' ), 99 );
 
 
359
 
360
  if ( false !== $this->conf['patch_force_twentythirteen_google_fonts_off'] && 'twentythirteen' == get_template() ) {
361
  add_action( 'wp_enqueue_scripts', array( $this, 'force_twentythirteen_google_fonts_off' ), 99 );
@@ -466,7 +468,7 @@ class multibyte_patch {
466
  $this->has_mb_strlen = function_exists( 'mb_strlen' );
467
  $this->debug_suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
468
 
469
- load_textdomain( $this->textdomain, plugin_dir_path( __FILE__ ) . $this->lang_dir . '/' . $this->textdomain . '-' . get_locale() . '.mo' );
470
  register_activation_hook( __FILE__, array( $this, 'activation_check' ) );
471
  $this->filters();
472
  }
2
  /*
3
  Plugin Name: WP Multibyte Patch
4
  Description: Multibyte functionality enhancement for the WordPress Japanese package.
5
+ Version: 1.8
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.8
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
60
  var $debug_suffix = '';
61
  var $textdomain = 'wp-multibyte-patch';
62
  var $lang_dir = 'languages';
63
+ var $required_version = '3.7-RC1';
64
  var $query_based_vars = array();
65
 
66
  // For fallback purpose only. (1.6)
354
  if ( false !== $this->conf['patch_force_character_count'] && 'characters' != _x( 'words', 'word count: words or characters?' ) )
355
  add_filter( 'gettext_with_context', array( $this, 'force_character_count' ), 10, 3 );
356
 
357
+ if ( false !== $this->conf['patch_force_twentytwelve_open_sans_off'] && 'twentytwelve' == get_template() ) {
358
  add_action( 'wp_enqueue_scripts', array( $this, 'force_twentytwelve_open_sans_off' ), 99 );
359
+ add_action( 'admin_print_styles-appearance_page_custom-header', array( $this, 'force_twentytwelve_open_sans_off' ), 99 );
360
+ }
361
 
362
  if ( false !== $this->conf['patch_force_twentythirteen_google_fonts_off'] && 'twentythirteen' == get_template() ) {
363
  add_action( 'wp_enqueue_scripts', array( $this, 'force_twentythirteen_google_fonts_off' ), 99 );
468
  $this->has_mb_strlen = function_exists( 'mb_strlen' );
469
  $this->debug_suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
470
 
471
+ load_plugin_textdomain( $this->textdomain, false, dirname( plugin_basename( __FILE__ ) ) . '/' . $this->lang_dir );
472
  register_activation_hook( __FILE__, array( $this, 'activation_check' ) );
473
  $this->filters();
474
  }