For faster navigation, this Iframe is preloading the Wikiwand page for User:Cdip150/customEdittools.js.

User:Cdip150/customEdittools.js

/*
// 更換「短簽名」按鈕
mwCustomEditButtons.remove(mwCustomEditButtons['btnSigOnly']);
mwCustomEditButtons.insert( createEditButton('btnMyShortSign',{
 src        : 'd/d8/Button_sig_zh.png',
 tagOpen    : '—{\{subst:User:Cdip150\/sign|short}\} ~~\~~\~',
 sampleText : '',
 tagClose   : '',
 speedTip   : '短簽名',
 width      : 12
}) , mwCustomEditButtons['btnSignature']);
*/

// 載入「澳門條目專用編輯工具」
importScript('User:Cdip150/工具/介面/MacauEditTool.js');

// 載入「個人化的下拉選單」
importScript('User:Cdip150/工具/介面/customEditMenu.js');


function myinst(tagOpen, tagClose){
 var textarea = document.editform.wpTextbox1;
 
 var len = textarea.value.length;
 var start = textarea.selectionStart;
 var end = textarea.selectionEnd;
 var sel = textarea.value.substring(start, end);
 var sTop=textarea.scrollTop;
 
 var replace = tagOpen + sel + tagClose;
 
 textarea.value = textarea.value.substring(0,start) + replace + textarea.value.substring(end,len);
 textarea.scrollTop=sTop;
 textarea.selectionStart=start;
 textarea.selectionEnd=start+replace.length;
 textarea.focus();
}

$( function(){

 // 延長編輯摘要的字數限制
 var setLongSummary=function(){
  document.editform.wpSummary.maxLength=10000;
 }
 setLongSummary();
 setTimeout(setLongSummary,1000);


 if(document.editform) if(document.editform.wpTextbox1 && window.createElement) {
  window.getSelfStr=function(){
   return (document.editform.chkSelf.checked)?"\|type=self":"";
  }
 
  var chkSelf=[
   createElement("input", null, {
    name:"chkSelf",
    id:"chkSelf",
    type:"checkbox"
   }) ,
   createElement("label", "自己", {
    for:"chkSelf"
   })
  ]
 
  var btnSdeeSock=createElement("input", null, {
   name:"btnSdeeSock",
   id:"btnSdeeSock",
   type:"button",
   value:"Sdee傀儡",
   events: {
    click: function(){
     myinst("\{\{sockvoteduph\}\}", "\{\{sockvotedupf\|Sdee"+getSelfStr()+"\}\}");
    }
   }
  });

  var btnInhinsSelf=createElement("input", null, {
   name:"btnInhinsSelf",
   id:"btnInhinsSelf",
   type:"button",
   value:"Inhins本體",
   events: {
    click: function(){
     myinst("\{\{sockvoteduph\}\}", "\{\{sockvotedupf\|sockfirst=1\|Inhins"+getSelfStr()+"\}\}");
    }
   }
  });

  var btnRonochenSelf=createElement("input", null, {
   name:"btnRonochenSelf",
   id:"btnRonochenSelf",
   type:"button",
   value:"Ronochen本體",
   events: {
    click: function(){
     myinst("\{\{sockvoteduph\}\}", "\{\{sockvotedupf\|sockfirst=1\|Ronochen"+getSelfStr()+"\}\}");
    }
   }
  });

  var btnInhins=createElement("input", null, {
   name:"btnInhins",
   id:"btnInhins",
   type:"button",
   value:"Inhins先投",
   events: {
    click: function(){
     myinst("\{\{sockvoteduph\}\}", "\{\{sockvotedupf\|Sdee\|another=Inhins"+getSelfStr()+"\}\}");
    }
   }
  });

  var btnRonochen=createElement("input", null, {
   name:"btnRonochen",
   id:"btnRonochen",
   type:"button",
   value:"Ronochen先投",
   events: {
    click: function(){
     myinst("\{\{sockvoteduph\}\}", "\{\{sockvotedupf\|Sdee\|another=Ronochen"+getSelfStr()+"\}\}");
    }
   }
  });

  var btnNote=createElement("input", null, {
   name:"btnNote",
   id:"btnNote",
   type:"button",
   value:"注意",
   events: {
    click: function(){
     var textarea=document.editform.wpTextbox1;

     var sTop=textarea.scrollTop;

     textarea.value=textarea.value.replace(/\s*$/ , "\n----\n:;\{\{注意\}\}:事後發現,\[\[User:Sdee\]\]在以上投票中行使傀儡,是故相關傀儡投票將被換算為Sdee所投,"+((document.editform.chkSelf.checked)?"而由於本投票的被提名人為Sdee,且本項不能對自己投票,故其傀儡所投出的票均一律作廢":"而其所作的票將祇視第一票為有效,第二票及以後均視為無效")+"。參見\[\[Wikipedia:傀儡\/Sdee事件\]\]。\n");

     textarea.scrollTop=sTop;
     textarea.selectionStart=document.editform.wpTextbox1.value.length;
     textarea.focus();

     document.editform.wpSummary.value="";
    }
   }
  });

  elementMoveto([chkSelf," ",btnNote," ",btnSdeeSock," ",btnInhinsSelf,btnRonochenSelf," ",btnInhins,btnRonochen], document.editform.wpTextbox1, "after");
 }

});

//importScript('User:Cdip150/工具/介面/ConvertRefNoteTag.js');
{{bottomLinkPreText}} {{bottomLinkText}}
User:Cdip150/customEdittools.js
Listen to this article

This browser is not supported by Wikiwand :(
Wikiwand requires a browser with modern capabilities in order to provide you with the best reading experience.
Please download and use one of the following browsers:

This article was just edited, click to reload
This article has been deleted on Wikipedia (Why?)

Back to homepage

Please click Add in the dialog above
Please click Allow in the top-left corner,
then click Install Now in the dialog
Please click Open in the download dialog,
then click Install
Please click the "Downloads" icon in the Safari toolbar, open the first download in the list,
then click Install
{{::$root.activation.text}}

Install Wikiwand

Install on Chrome Install on Firefox
Don't forget to rate us

Tell your friends about Wikiwand!

Gmail Facebook Twitter Link

Enjoying Wikiwand?

Tell your friends and spread the love:
Share on Gmail Share on Facebook Share on Twitter Share on Buffer

Our magic isn't perfect

You can help our automatic cover photo selection by reporting an unsuitable photo.

This photo is visually disturbing This photo is not a good choice

Thank you for helping!


Your input will affect cover photo selection, along with input from other users.

X

Get ready for Wikiwand 2.0 🎉! the new version arrives on September 1st! Don't want to wait?