From 0dcfcc6e2099d5ea2cb6a10dff59f73bdb8adc0f Mon Sep 17 00:00:00 2001 From: nacin Date: Thu, 18 Feb 2010 05:14:48 +0000 Subject: [PATCH] Allow tab to intent in plugin/theme editors. Reverts first pass, [13131]. Props azaozz, fixes #12204 git-svn-id: http://svn.automattic.com/wordpress/trunk@13191 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/js/common.dev.js | 22 +++ wp-admin/js/common.js | 2 +- wp-admin/plugin-editor.php | 3 +- wp-admin/theme-editor.php | 3 +- wp-includes/js/jquery/tabby.dev.js | 254 ----------------------------- wp-includes/js/jquery/tabby.js | 1 - wp-includes/script-loader.php | 5 +- 7 files changed, 26 insertions(+), 264 deletions(-) delete mode 100644 wp-includes/js/jquery/tabby.dev.js delete mode 100644 wp-includes/js/jquery/tabby.js diff --git a/wp-admin/js/common.dev.js b/wp-admin/js/common.dev.js index 2ef85e6b1..df904d522 100644 --- a/wp-admin/js/common.dev.js +++ b/wp-admin/js/common.dev.js @@ -267,6 +267,28 @@ jQuery(document).ready( function($) { $('div.default-password-nag').hide(); return false; }); + + // tab in textareas + $('textarea#newcontent').keydown(function(e) { + if ( e.keyCode != 9 ) + return true; + + var el = e.target, selStart = el.selectionStart, selEnd = el.selectionEnd, val = el.value, scroll, sel; + + e.stopPropagation(); + e.preventDefault(); + + if ( document.selection ) { + el.focus(); + sel = document.selection.createRange(); + sel.text = '\t'; + } else if ( selStart >= 0 ) { + scroll = this.scrollTop; + el.value = val.substring(0, selStart).concat('\t', val.substring(selEnd) ); + el.selectionStart = el.selectionEnd = selStart + 1; + this.scrollTop = scroll; + } + }); }); jQuery(document).ready( function($){ diff --git a/wp-admin/js/common.js b/wp-admin/js/common.js index eaef37f8e..f584301ee 100644 --- a/wp-admin/js/common.js +++ b/wp-admin/js/common.js @@ -1 +1 @@ -var showNotice,adminMenu,columns,validateForm;(function(a){adminMenu={init:function(){var b=a("#adminmenu");a(".wp-menu-toggle",b).each(function(){var c=a(this),d=c.siblings(".wp-submenu");if(d.length){c.click(function(){adminMenu.toggle(d)})}else{c.hide()}});this.favorites();a(".separator",b).click(function(){if(a("body").hasClass("folded")){adminMenu.fold(1);deleteUserSetting("mfold")}else{adminMenu.fold();setUserSetting("mfold","f")}return false});if(a("body").hasClass("folded")){this.fold()}this.restoreMenuState()},restoreMenuState:function(){a("li.wp-has-submenu","#adminmenu").each(function(c,d){var b=getUserSetting("m"+c);if(a(d).hasClass("wp-has-current-submenu")){return true}if("o"==b){a(d).addClass("wp-menu-open")}else{if("c"==b){a(d).removeClass("wp-menu-open")}}})},toggle:function(b){var c=b.slideToggle(150,function(){b.css("display","")}).parent().toggleClass("wp-menu-open").attr("id");if(c){a("li.wp-has-submenu","#adminmenu").each(function(f,g){if(c==g.id){var d=a(g).hasClass("wp-menu-open")?"o":"c";setUserSetting("m"+f,d)}})}return false},fold:function(b){if(b){a("body").removeClass("folded");a("#adminmenu li.wp-has-submenu").unbind()}else{a("body").addClass("folded");a("#adminmenu li.wp-has-submenu").hoverIntent({over:function(j){var d,c,g,k,i;d=a(this).find(".wp-submenu");c=a(this).offset().top+d.height()+1;g=a("#wpwrap").height();k=60+c-g;i=a(window).height()+a(window).scrollTop()-15;if(i<(c-k)){k=c-i}if(k>1){d.css({marginTop:"-"+k+"px"})}else{if(d.css("marginTop")){d.css({marginTop:""})}}d.addClass("sub-open")},out:function(){a(this).find(".wp-submenu").removeClass("sub-open").css({marginTop:""})},timeout:220,sensitivity:8,interval:100})}},favorites:function(){a("#favorite-inside").width(a("#favorite-actions").width()-4);a("#favorite-toggle, #favorite-inside").bind("mouseenter",function(){a("#favorite-inside").removeClass("slideUp").addClass("slideDown");setTimeout(function(){if(a("#favorite-inside").hasClass("slideDown")){a("#favorite-inside").slideDown(100);a("#favorite-first").addClass("slide-down")}},200)}).bind("mouseleave",function(){a("#favorite-inside").removeClass("slideDown").addClass("slideUp");setTimeout(function(){if(a("#favorite-inside").hasClass("slideUp")){a("#favorite-inside").slideUp(100,function(){a("#favorite-first").removeClass("slide-down")})}},300)})}};a(document).ready(function(){adminMenu.init()});columns={init:function(){a(".hide-column-tog","#adv-settings").click(function(){var b=a(this).val();if(a(this).attr("checked")){a(".column-"+b).show()}else{a(".column-"+b).hide()}columns.save_manage_columns_state()})},save_manage_columns_state:function(){var b=a(".manage-column").filter(":hidden").map(function(){return this.id}).get().join(",");a.post(ajaxurl,{action:"hidden-columns",hidden:b,screenoptionnonce:a("#screenoptionnonce").val(),page:pagenow})}};a(document).ready(function(){columns.init()});validateForm=function(b){return !a(b).find(".form-required").filter(function(){return a("input:visible",this).val()==""}).addClass("form-invalid").find("input:visible").change(function(){a(this).closest(".form-invalid").removeClass("form-invalid")}).size()}})(jQuery);showNotice={warn:function(){var a=commonL10n.warnDelete||"";if(confirm(a)){return true}return false},note:function(a){alert(a)}};jQuery(document).ready(function(d){var f=false,a,e,c,b;d("div.wrap h2:first").nextAll("div.updated, div.error").addClass("below-h2");d("div.updated, div.error").not(".below-h2").insertAfter(d("div.wrap h2:first"));d("#show-settings-link").click(function(){if(!d("#screen-options-wrap").hasClass("screen-options-open")){d("#contextual-help-link-wrap").css("visibility","hidden")}d("#screen-options-wrap").slideToggle("fast",function(){if(d(this).hasClass("screen-options-open")){d("#show-settings-link").css({backgroundImage:'url("images/screen-options-right.gif")'});d("#contextual-help-link-wrap").css("visibility","");d(this).removeClass("screen-options-open")}else{d("#show-settings-link").css({backgroundImage:'url("images/screen-options-right-up.gif")'});d(this).addClass("screen-options-open")}});return false});d("#contextual-help-link").click(function(){if(!d("#contextual-help-wrap").hasClass("contextual-help-open")){d("#screen-options-link-wrap").css("visibility","hidden")}d("#contextual-help-wrap").slideToggle("fast",function(){if(d(this).hasClass("contextual-help-open")){d("#contextual-help-link").css({backgroundImage:'url("images/screen-options-right.gif")'});d("#screen-options-link-wrap").css("visibility","");d(this).removeClass("contextual-help-open")}else{d("#contextual-help-link").css({backgroundImage:'url("images/screen-options-right-up.gif")'});d(this).addClass("contextual-help-open")}});return false});d("tbody").children().children(".check-column").find(":checkbox").click(function(g){if("undefined"==g.shiftKey){return true}if(g.shiftKey){if(!f){return true}a=d(f).closest("form").find(":checkbox");e=a.index(f);c=a.index(this);b=d(this).attr("checked");if(01){d.css({marginTop:"-"+k+"px"})}else{if(d.css("marginTop")){d.css({marginTop:""})}}d.addClass("sub-open")},out:function(){a(this).find(".wp-submenu").removeClass("sub-open").css({marginTop:""})},timeout:220,sensitivity:8,interval:100})}},favorites:function(){a("#favorite-inside").width(a("#favorite-actions").width()-4);a("#favorite-toggle, #favorite-inside").bind("mouseenter",function(){a("#favorite-inside").removeClass("slideUp").addClass("slideDown");setTimeout(function(){if(a("#favorite-inside").hasClass("slideDown")){a("#favorite-inside").slideDown(100);a("#favorite-first").addClass("slide-down")}},200)}).bind("mouseleave",function(){a("#favorite-inside").removeClass("slideDown").addClass("slideUp");setTimeout(function(){if(a("#favorite-inside").hasClass("slideUp")){a("#favorite-inside").slideUp(100,function(){a("#favorite-first").removeClass("slide-down")})}},300)})}};a(document).ready(function(){adminMenu.init()});columns={init:function(){a(".hide-column-tog","#adv-settings").click(function(){var b=a(this).val();if(a(this).attr("checked")){a(".column-"+b).show()}else{a(".column-"+b).hide()}columns.save_manage_columns_state()})},save_manage_columns_state:function(){var b=a(".manage-column").filter(":hidden").map(function(){return this.id}).get().join(",");a.post(ajaxurl,{action:"hidden-columns",hidden:b,screenoptionnonce:a("#screenoptionnonce").val(),page:pagenow})}};a(document).ready(function(){columns.init()});validateForm=function(b){return !a(b).find(".form-required").filter(function(){return a("input:visible",this).val()==""}).addClass("form-invalid").find("input:visible").change(function(){a(this).closest(".form-invalid").removeClass("form-invalid")}).size()}})(jQuery);showNotice={warn:function(){var a=commonL10n.warnDelete||"";if(confirm(a)){return true}return false},note:function(a){alert(a)}};jQuery(document).ready(function(d){var f=false,a,e,c,b;d("div.wrap h2:first").nextAll("div.updated, div.error").addClass("below-h2");d("div.updated, div.error").not(".below-h2").insertAfter(d("div.wrap h2:first"));d("#show-settings-link").click(function(){if(!d("#screen-options-wrap").hasClass("screen-options-open")){d("#contextual-help-link-wrap").css("visibility","hidden")}d("#screen-options-wrap").slideToggle("fast",function(){if(d(this).hasClass("screen-options-open")){d("#show-settings-link").css({backgroundImage:'url("images/screen-options-right.gif")'});d("#contextual-help-link-wrap").css("visibility","");d(this).removeClass("screen-options-open")}else{d("#show-settings-link").css({backgroundImage:'url("images/screen-options-right-up.gif")'});d(this).addClass("screen-options-open")}});return false});d("#contextual-help-link").click(function(){if(!d("#contextual-help-wrap").hasClass("contextual-help-open")){d("#screen-options-link-wrap").css("visibility","hidden")}d("#contextual-help-wrap").slideToggle("fast",function(){if(d(this).hasClass("contextual-help-open")){d("#contextual-help-link").css({backgroundImage:'url("images/screen-options-right.gif")'});d("#screen-options-link-wrap").css("visibility","");d(this).removeClass("contextual-help-open")}else{d("#contextual-help-link").css({backgroundImage:'url("images/screen-options-right-up.gif")'});d(this).addClass("contextual-help-open")}});return false});d("tbody").children().children(".check-column").find(":checkbox").click(function(g){if("undefined"==g.shiftKey){return true}if(g.shiftKey){if(!f){return true}a=d(f).closest("form").find(":checkbox");e=a.index(f);c=a.index(this);b=d(this).attr("checked");if(0=0){g=this.scrollTop;i.value=l.substring(0,m).concat("\t",l.substring(h));i.selectionStart=i.selectionEnd=m+1;this.scrollTop=g}}})});jQuery(document).ready(function(b){var a=b("span.turbo-nag","#user_info");if(!a.length||("undefined"!=typeof(google)&&google.gears)){return}if("undefined"!=typeof GearsFactory){return}else{try{if(("undefined"!=typeof window.ActiveXObject&&ActiveXObject("Gears.Factory"))||("undefined"!=typeof navigator.mimeTypes&&navigator.mimeTypes["application/x-googlegears"])){return}}catch(c){}}a.show()}); \ No newline at end of file diff --git a/wp-admin/plugin-editor.php b/wp-admin/plugin-editor.php index 1494f1b76..9b8137c82 100644 --- a/wp-admin/plugin-editor.php +++ b/wp-admin/plugin-editor.php @@ -18,7 +18,6 @@ $parent_file = 'plugins.php'; wp_reset_vars(array('action', 'redirect', 'profile', 'error', 'warning', 'a', 'file', 'plugin')); wp_admin_css( 'theme-editor' ); -wp_enqueue_script( 'tabby' ); $plugins = get_plugins(); @@ -230,7 +229,7 @@ foreach ( $plugin_files as $plugin_file ) : /* */ diff --git a/wp-admin/theme-editor.php b/wp-admin/theme-editor.php index d942cdc0d..8a818b817 100644 --- a/wp-admin/theme-editor.php +++ b/wp-admin/theme-editor.php @@ -18,7 +18,6 @@ $parent_file = 'themes.php'; wp_reset_vars(array('action', 'redirect', 'profile', 'error', 'warning', 'a', 'file', 'theme', 'dir')); wp_admin_css( 'theme-editor' ); -wp_enqueue_script( 'tabby' ); $themes = get_themes(); @@ -233,7 +232,7 @@ if ($allowed_files) : /* */ diff --git a/wp-includes/js/jquery/tabby.dev.js b/wp-includes/js/jquery/tabby.dev.js deleted file mode 100644 index ffee6424f..000000000 --- a/wp-includes/js/jquery/tabby.dev.js +++ /dev/null @@ -1,254 +0,0 @@ -/* - * Tabby jQuery plugin version 0.12 - * - * Ted Devito - http://teddevito.com/demos/textarea.html - * - * You should have received a copy of the GNU General Public License - * along with Easy Widgets. If not, see - * - * Plugin development pattern based on: http://www.learningjquery.com/2007/10/a-plugin-development-pattern - * - */ - -// create closure - -(function($) { - - // plugin definition - - $.fn.tabby = function(options) { - //debug(this); - // build main options before element iteration - var opts = $.extend({}, $.fn.tabby.defaults, options); - var pressed = $.fn.tabby.pressed; - - // iterate and reformat each matched element - return this.each(function() { - $this = $(this); - - // build element specific options - var options = $.meta ? $.extend({}, opts, $this.data()) : opts; - - $this.bind('keydown',function (e) { - var kc = $.fn.tabby.catch_kc(e); - if (16 == kc) pressed.shft = true; - /* - because both CTRL+TAB and ALT+TAB default to an event (changing tab/window) that - will prevent js from capturing the keyup event, we'll set a timer on releasing them. - */ - if (17 == kc) {pressed.ctrl = true; setTimeout("$.fn.tabby.pressed.ctrl = false;",1000);} - if (18 == kc) {pressed.alt = true; setTimeout("$.fn.tabby.pressed.alt = false;",1000);} - - if (9 == kc && !pressed.ctrl && !pressed.alt) { - e.preventDefault; // does not work in O9.63 ?? - pressed.last = kc; setTimeout("$.fn.tabby.pressed.last = null;",0); - process_keypress ($(e.target).get(0), pressed.shft, options); - return false; - } - - }).bind('keyup',function (e) { - if (16 == $.fn.tabby.catch_kc(e)) pressed.shft = false; - }).bind('blur',function (e) { // workaround for Opera -- http://www.webdeveloper.com/forum/showthread.php?p=806588 - if (9 == pressed.last) $(e.target).one('focus',function (e) {pressed.last = null;}).get(0).focus(); - }); - - }); - }; - - // define and expose any extra methods - $.fn.tabby.catch_kc = function(e) { return e.keyCode ? e.keyCode : e.charCode ? e.charCode : e.which; }; - $.fn.tabby.pressed = {shft : false, ctrl : false, alt : false, last: null}; - - // private function for debugging - function debug($obj) { - if (window.console && window.console.log) - window.console.log('textarea count: ' + $obj.size()); - }; - - function process_keypress (o,shft,options) { - var scrollTo = o.scrollTop; - //var tabString = String.fromCharCode(9); - - // gecko; o.setSelectionRange is only available when the text box has focus - if (o.setSelectionRange) gecko_tab (o, shft, options); - - // ie; document.selection is always available - else if (document.selection) ie_tab (o, shft, options); - - o.scrollTop = scrollTo; - } - - // plugin defaults - $.fn.tabby.defaults = {tabString : String.fromCharCode(9)}; - - function gecko_tab (o, shft, options) { - var ss = o.selectionStart; - var es = o.selectionEnd; - - // when there's no selection and we're just working with the caret, we'll add/remove the tabs at the caret, providing more control - if(ss == es) { - // SHIFT+TAB - if (shft) { - // check to the left of the caret first - if ("\t" == o.value.substring(ss-options.tabString.length, ss)) { - o.value = o.value.substring(0, ss-options.tabString.length) + o.value.substring(ss); // put it back together omitting one character to the left - o.focus(); - o.setSelectionRange(ss - options.tabString.length, ss - options.tabString.length); - } - // then check to the right of the caret - else if ("\t" == o.value.substring(ss, ss + options.tabString.length)) { - o.value = o.value.substring(0, ss) + o.value.substring(ss + options.tabString.length); // put it back together omitting one character to the right - o.focus(); - o.setSelectionRange(ss,ss); - } - } - // TAB - else { - o.value = o.value.substring(0, ss) + options.tabString + o.value.substring(ss); - o.focus(); - o.setSelectionRange(ss + options.tabString.length, ss + options.tabString.length); - } - } - // selections will always add/remove tabs from the start of the line - else { - // split the textarea up into lines and figure out which lines are included in the selection - var lines = o.value.split("\n"); - var indices = new Array(); - var sl = 0; // start of the line - var el = 0; // end of the line - var sel = false; - for (var i in lines) { - el = sl + lines[i].length; - indices.push({start: sl, end: el, selected: (sl <= ss && el > ss) || (el >= es && sl < es) || (sl > ss && el < es)}); - sl = el + 1;// for "\n" - } - - // walk through the array of lines (indices) and add tabs where appropriate - var modifier = 0; - for (var i in indices) { - if (indices[i].selected) { - var pos = indices[i].start + modifier; // adjust for tabs already inserted/removed - // SHIFT+TAB - if (shft && options.tabString == o.value.substring(pos,pos+options.tabString.length)) { // only SHIFT+TAB if there's a tab at the start of the line - o.value = o.value.substring(0,pos) + o.value.substring(pos + options.tabString.length); // omit the tabstring to the right - modifier -= options.tabString.length; - } - // TAB - else if (!shft) { - o.value = o.value.substring(0,pos) + options.tabString + o.value.substring(pos); // insert the tabstring - modifier += options.tabString.length; - } - } - } - o.focus(); - var ns = ss + ((modifier > 0) ? options.tabString.length : (modifier < 0) ? -options.tabString.length : 0); - var ne = es + modifier; - o.setSelectionRange(ns,ne); - } - } - - function ie_tab (o, shft, options) { - var range = document.selection.createRange(); - - if (o == range.parentElement()) { - // when there's no selection and we're just working with the caret, we'll add/remove the tabs at the caret, providing more control - if ('' == range.text) { - // SHIFT+TAB - if (shft) { - var bookmark = range.getBookmark(); - //first try to the left by moving opening up our empty range to the left - range.moveStart('character', -options.tabString.length); - if (options.tabString == range.text) { - range.text = ''; - } else { - // if that didn't work then reset the range and try opening it to the right - range.moveToBookmark(bookmark); - range.moveEnd('character', options.tabString.length); - if (options.tabString == range.text) - range.text = ''; - } - // move the pointer to the start of them empty range and select it - range.collapse(true); - range.select(); - } - - else { - // very simple here. just insert the tab into the range and put the pointer at the end - range.text = options.tabString; - range.collapse(false); - range.select(); - } - } - // selections will always add/remove tabs from the start of the line - else { - - var selection_text = range.text; - var selection_len = selection_text.length; - var selection_arr = selection_text.split("\r\n"); - - var before_range = document.body.createTextRange(); - before_range.moveToElementText(o); - before_range.setEndPoint("EndToStart", range); - var before_text = before_range.text; - var before_arr = before_text.split("\r\n"); - var before_len = before_text.length; // - before_arr.length + 1; - - var after_range = document.body.createTextRange(); - after_range.moveToElementText(o); - after_range.setEndPoint("StartToEnd", range); - var after_text = after_range.text; // we can accurately calculate distance to the end because we're not worried about MSIE trimming a \r\n - - var end_range = document.body.createTextRange(); - end_range.moveToElementText(o); - end_range.setEndPoint("StartToEnd", before_range); - var end_text = end_range.text; // we can accurately calculate distance to the end because we're not worried about MSIE trimming a \r\n - - var check_html = $(o).html(); - $("#r3").text(before_len + " + " + selection_len + " + " + after_text.length + " = " + check_html.length); - if((before_len + end_text.length) < check_html.length) { - before_arr.push(""); - before_len += 2; // for the \r\n that was trimmed - if (shft && options.tabString == selection_arr[0].substring(0,options.tabString.length)) - selection_arr[0] = selection_arr[0].substring(options.tabString.length); - else if (!shft) selection_arr[0] = options.tabString + selection_arr[0]; - } else { - if (shft && options.tabString == before_arr[before_arr.length-1].substring(0,options.tabString.length)) - before_arr[before_arr.length-1] = before_arr[before_arr.length-1].substring(options.tabString.length); - else if (!shft) before_arr[before_arr.length-1] = options.tabString + before_arr[before_arr.length-1]; - } - - for (var i = 1; i < selection_arr.length; i++) { - if (shft && options.tabString == selection_arr[i].substring(0,options.tabString.length)) - selection_arr[i] = selection_arr[i].substring(options.tabString.length); - else if (!shft) selection_arr[i] = options.tabString + selection_arr[i]; - } - - if (1 == before_arr.length && 0 == before_len) { - if (shft && options.tabString == selection_arr[0].substring(0,options.tabString.length)) - selection_arr[0] = selection_arr[0].substring(options.tabString.length); - else if (!shft) selection_arr[0] = options.tabString + selection_arr[0]; - } - - if ((before_len + selection_len + after_text.length) < check_html.length) { - selection_arr.push(""); - selection_len += 2; // for the \r\n that was trimmed - } - - before_range.text = before_arr.join("\r\n"); - range.text = selection_arr.join("\r\n"); - - var new_range = document.body.createTextRange(); - new_range.moveToElementText(o); - - if (0 < before_len) new_range.setEndPoint("StartToEnd", before_range); - else new_range.setEndPoint("StartToStart", before_range); - new_range.setEndPoint("EndToEnd", range); - - new_range.select(); - - } - } - } - -// end of closure -})(jQuery); diff --git a/wp-includes/js/jquery/tabby.js b/wp-includes/js/jquery/tabby.js deleted file mode 100644 index 546f9c33f..000000000 --- a/wp-includes/js/jquery/tabby.js +++ /dev/null @@ -1 +0,0 @@ -(function(d){d.fn.tabby=function(f){var g=d.extend({},d.fn.tabby.defaults,f);var h=d.fn.tabby.pressed;return this.each(function(){$this=d(this);var i=d.meta?d.extend({},g,$this.data()):g;$this.bind("keydown",function(k){var j=d.fn.tabby.catch_kc(k);if(16==j){h.shft=true}if(17==j){h.ctrl=true;setTimeout("$.fn.tabby.pressed.ctrl = false;",1000)}if(18==j){h.alt=true;setTimeout("$.fn.tabby.pressed.alt = false;",1000)}if(9==j&&!h.ctrl&&!h.alt){k.preventDefault;h.last=j;setTimeout("$.fn.tabby.pressed.last = null;",0);e(d(k.target).get(0),h.shft,i);return false}}).bind("keyup",function(j){if(16==d.fn.tabby.catch_kc(j)){h.shft=false}}).bind("blur",function(j){if(9==h.last){d(j.target).one("focus",function(k){h.last=null}).get(0).focus()}})})};d.fn.tabby.catch_kc=function(f){return f.keyCode?f.keyCode:f.charCode?f.charCode:f.which};d.fn.tabby.pressed={shft:false,ctrl:false,alt:false,last:null};function b(f){if(window.console&&window.console.log){window.console.log("textarea count: "+f.size())}}function e(i,h,g){var f=i.scrollTop;if(i.setSelectionRange){a(i,h,g)}else{if(document.selection){c(i,h,g)}}i.scrollTop=f}d.fn.tabby.defaults={tabString:String.fromCharCode(9)};function a(j,f,u){var t=j.selectionStart;var r=j.selectionEnd;if(t==r){if(f){if("\t"==j.value.substring(t-u.tabString.length,t)){j.value=j.value.substring(0,t-u.tabString.length)+j.value.substring(t);j.focus();j.setSelectionRange(t-u.tabString.length,t-u.tabString.length)}else{if("\t"==j.value.substring(t,t+u.tabString.length)){j.value=j.value.substring(0,t)+j.value.substring(t+u.tabString.length);j.focus();j.setSelectionRange(t,t)}}}else{j.value=j.value.substring(0,t)+u.tabString+j.value.substring(t);j.focus();j.setSelectionRange(t+u.tabString.length,t+u.tabString.length)}}else{var v=j.value.split("\n");var s=new Array();var l=0;var h=0;var g=false;for(var n in v){h=l+v[n].length;s.push({start:l,end:h,selected:(l<=t&&h>t)||(h>=r&&lt&&h0)?u.tabString.length:(k<0)?-u.tabString.length:0);var m=r+k;j.setSelectionRange(p,m)}}function c(q,w,f){var p=document.selection.createRange();if(q==p.parentElement()){if(""==p.text){if(w){var l=p.getBookmark();p.moveStart("character",-f.tabString.length);if(f.tabString==p.text){p.text=""}else{p.moveToBookmark(l);p.moveEnd("character",f.tabString.length);if(f.tabString==p.text){p.text=""}}p.collapse(true);p.select()}else{p.text=f.tabString;p.collapse(false);p.select()}}else{var k=p.text;var n=k.length;var u=k.split("\r\n");var z=document.body.createTextRange();z.moveToElementText(q);z.setEndPoint("EndToStart",p);var m=z.text;var x=m.split("\r\n");var r=m.length;var y=document.body.createTextRange();y.moveToElementText(q);y.setEndPoint("StartToEnd",p);var v=y.text;var g=document.body.createTextRange();g.moveToElementText(q);g.setEndPoint("StartToEnd",z);var s=g.text;var h=d(q).html();d("#r3").text(r+" + "+n+" + "+v.length+" = "+h.length);if((r+s.length)add( 'utils', "/wp-admin/js/utils$suffix.js", false, '20090102' ); - $scripts->add( 'common', "/wp-admin/js/common$suffix.js", array('jquery', 'hoverIntent', 'utils'), '20091212' ); + $scripts->add( 'common', "/wp-admin/js/common$suffix.js", array('jquery', 'hoverIntent', 'utils'), '20100218' ); $scripts->add_data( 'common', 'group', 1 ); $scripts->localize( 'common', 'commonL10n', array( 'warnDelete' => __("You are about to permanently delete the selected items.\n 'Cancel' to stop, 'OK' to delete."), @@ -155,9 +155,6 @@ function wp_default_scripts( &$scripts ) { $scripts->add( 'suggest', "/wp-includes/js/jquery/suggest$suffix.js", array('jquery'), '1.1-20090125'); $scripts->add_data( 'suggest', 'group', 1 ); - $scripts->add( 'tabby', "/wp-includes/js/jquery/tabby$suffix.js", array('jquery'), '0.12'); - $scripts->add_data( 'tabby', 'group', 1 ); - $scripts->add( 'schedule', '/wp-includes/js/jquery/jquery.schedule.js', array('jquery'), '20m'); $scripts->add_data( 'schedule', 'group', 1 );