跳转到内容

User:SickManWP/common.js

维基百科,自由的百科全书

这是本页的一个历史版本,由SickManWP留言 | 贡献2016年8月16日 (二) 05:44 (// Edit via Wikiplus)编辑。这可能和当前版本存在着巨大的差异。

注意:保存之后,你必须清除浏览器缓存才能看到做出的更改。Google ChromeFirefoxMicrosoft EdgeSafari:按住⇧ Shift键并单击工具栏的“刷新”按钮。参阅Help:绕过浏览器缓存以获取更多帮助。
/***開放引用區***/

// this example code adds or removes div tags around the selected text

function TestHandler(obj) {

// select the appropriate text change target (whole, selection, cursor, focusWord, focusLine, selectionWord, or selectionLine)
//   focus... is the text under the cursor; ...Word and ...Line extend the target to the start/end of the word or line
  wikEd.GetText(obj, 'selection, cursor');
  if (obj.selection.plain != '') {
    obj.changed = obj.selection;
  }
  else {
    obj.changed = obj.cursor;
  }

// make your changes to the plain target text in obj.changed.plain

// remove the previously added formatting
  if ( /<div>(.*?)<\/div>/i.test(obj.changed.plain) ) {
    obj.changed.plain = obj.changed.plain.replace(/<div>(.*?)<\/div>/gi, '$1');
  }

// add the text formatting
 else {
    obj.changed.plain = '<div>' + obj.changed.plain + '</div>';
    obj.changed.plain = obj.changed.plain.replace(/(<div>)( *)(.*?)( *)(<\/div>)/, '$2$1$3$5$4');
  }

// keep the changed text selected
  obj.changed.keepSel = true;

// return to wikEd.EditButton() to apply changes
  return;
}

if (typeof(window.wikEd.useWikEd) != 'undefined') {
  wikEd.EditButton(null, null, null, TestHandler);
}
importScript('User:Lakocat/littlestar.js'); //Littlestar
importScript('User:和平奮鬥救地球/whatredirect.js'); //What Redirects Here
importScript('User:和平奮鬥救地球/checklinks.js'); //Checklinks
//importScript('User:和平奮鬥救地球/purgebutton.js'); // "Purge now" button
importScript('User:和平奮鬥救地球/Reflinks.js'); //Reflinks
importScript('User:和平奮鬥救地球/CVcheck.js'); //Copyright Violation Check, 目前本侵權檢查工具只有在copyvio search功能壞掉,url comparison功能大致上還是能用的,但是就沒那麼方便了...
importScript('User:和平奮鬥救地球/link-ts.js');//Link translation

//mw.loader.load('https://wikiplus-app.smartgslb.com/Main.js'); //WikiPlus
//importScript('User:Panintelize/link-ts.js'); //Link translation
importScript('User:Shizhao/admins.js'); //How many admins are online now
importScript('User:Liangent/Gadgets/Toolkit/wordcount.js'); //Count how many characters


//importScript('User:和平奮鬥救地球/duplinks.js'); //Show duplicate links
//importScript('User:Chiefwei/rater/rater-t.js'); // [[User:Chiefwei/rater]],作者:[[:en:User:Kephir/gadgets/rater]]
//importScript('User:Bencmq/Mass rollback.js');
//importScript('User:Alexander Misel/admin.js');
//importScript('User:小躍/member-online.js');
//importScript('User:小躍/RedirectionTemplate.js');
importScript('User:Alexander_Misel/smart_rollback.js'); //Smart Rollback
//mw.loader.load( "https://meta.wikimedia.org/w/index.php?title=User:Zhaofeng_Li/Reflinks.js&action=raw&ctype=text/javascript" ); //refill

/***個人專用區***/

//importScript('User:和平奮鬥救地球/WikiBreak.js');
//importScript('User:和平奮鬥救地球/DailyWikiBreak.js');

mw.loader.load('https://wikiplus-app.smartgslb.com/Main.js');