コンテンツにスキップ

英文维基 | 中文维基 | 日文维基 | 草榴社区

利用者:HideBot/jastyleplus.js

お知らせ: 保存した後、ブラウザのキャッシュをクリアしてページを再読み込みする必要があります。

多くの WindowsLinux のブラウザ

  • Ctrl を押しながら F5 を押す。

Mac における Safari

  • Shift を押しながら、更新ボタン をクリックする。

Mac における ChromeFirefox

  • Cmd Shift を押しながら R を押す。

詳細についてはWikipedia:キャッシュを消すをご覧ください。

// jastyle
var jastyle_version = '0.7.0.1 改';
jastyle_autostyle_namespaces = [ '', 'Category', 'Template', 'Portal', 'Help', 'Wikipedia' ];

if(!window.$$) document.writeln('<script type="text/javascript" src="http://linky.wikipedia.jp/javascripts/prototype.js"><\/script>');

function jastyle() {
  if($('dontstyle') && $F('dontstyle')) return;
  
  var strips = new Array();
  var edit = $('wpTextbox1');
  var tmp = edit.value.
  
    replace(/\{\{Championshiptitle\|(.?)\|(.?)\|(.?)\|(.?)\|(.?)\|(.?)\}\}/g, '{{利用者:Hideki1976/Championshiptitle|$1|$2|$3|[[$4]]|[[$5]]|$6').
    
    replace(/<br>/g, '<br />');  
  
  edit.value = tmp + "\n";
  return true;
}

$(function() {
  var html = '';
  if(!$('editform')) return;
  if($A(jastyle_autostyle_namespaces).include(wgCanonicalNamespace)) {
    Event.observe('editform', 'submit', jastyle);
  }
  // チェックボックス - 「使用しない」チェックをつけておく
  html += '<label for="dontstyle"><input type="checkbox" id="dontstyle" value="1" checked />使用しない</label> ';
  // チェックボックス - 「厳しくチェック」チェックをつけておく
  html += '<label for="hardstyle"><input type="checkbox" id="hardstyle" value="1" checked />厳しくチェック</label> &nbsp;';
  // チェックボックス - 「連続空白除去」チェックをつけておく
  html += '<label for="spacestyle"><input type="checkbox" id="spacestyle" value="1" checked />連続空白除去</label> &nbsp;';
  // 実行ボタン
  html += '<button type="button" onclick="jastyle()">style</button>';
  html += ' (jastyle version ' + jastyle_version + ')';
  new Insertion.Before('wpSummaryLabel', '<p>' + html + '</p>');
  //new Insertion.Before('editform', '<p>' + html + '</p>');
  //new Insertion.Bottom('editform', '<p>' + html + '</p>');
});

function capitalize(str){
  return str.replace(/\w+/g, function(word){
    return word.charAt(0).toUpperCase() + word.substr(1).toLowerCase();
  });
}