Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Works consistently in FireFox and also on Meta

  • Loading branch information...
commit 0ed9c01bedd57b4a31db51ae4a78ac09e018e332 1 parent 0aa2fb6
@markelliot authored
Showing with 6 additions and 2 deletions.
  1. +6 −2 SOTabRemover.user.js
View
8 SOTabRemover.user.js
@@ -3,7 +3,9 @@
// @author Mark Elliot
// @description Adds a button in the SO edit context to replace tab literals (\t) with 4 spaces
// @include http://stackoverflow.com/posts/*/edit*
+// @include http://meta.stackoverflow.com/posts/*/edit*
// @match http://stackoverflow.com/posts/*/edit*
+// @match http://meta.stackoverflow.com/posts/*/edit*
// ==/UserScript==
// This work is licensed under the Creative Commons Attribution 3.0 Unported License.
@@ -18,14 +20,16 @@ function with_jquery(f) {
with_jquery(function($){
- $(function(){
+ $(window).load(function(){
+
$('ul#wmd-button-row li:last')
.before('<li class="wmd-button" id="fix-tabs" style="left: 400px; font-family: monospace; padding-top: 3px; font-size: 11px;">\\t</li>')
.before('<li class="wmd-spacer" style="left: 375px;"></li>');
-
+
$('li#fix-tabs').click(function(){
$('textarea#wmd-input.processed').val($('textarea#wmd-input.processed').text().replace(/\t/g, ' '));
});
+
});
});
Please sign in to comment.
Something went wrong with that request. Please try again.