편집 필터 기록

편집 필터 둘러보기 (처음 | 최근 필터의 바뀜 | 과거의 편집 검토하기 | 편집 필터 기록)
기록 60,414에 대한 자세한 정보

2024년 2월 6일 (화) 23:17: 하늘 (토론 | 기여)님이 사용자:하늘/EditTools.js에서 "edit" 동작을 수행하여 필터 14이(가) 작동했습니다. 조치: 태그; 필터 설명: 삭제가 신청된 문서 (검사 | 차이)

편집에서 바뀐 내용

window.charinsert = {
  기본: {
    괄호: [
      "(+)",
      "[+]",
      "{+}",
      "〔+〕",
      "〈+〉",
      "【+】"
    ],
    위키텍스트: [
      "{{크기||+}}",
      "[[+]]",
      "[[#+]]",
      "{{+}}",
      "<!--+-->",
      " /*+*/",
      "[[분류:+]]",
      "[[분류:+|_]]",
      "[[파일:+]]",
      "&nbsp;",
      "<del>+</del>",
      "<br/>",
      "<hr/>",
      "----",
      "{{-}}",
      "{{각주}}",
      "<ref>+</ref>",
      "<ref.name='+' />",
      "{{URL|+}}",
      "__TOC__",
      "<span.id='+'/>"
    ],
    틀: [
      "{{색||+}}",
      "{{lang||+}}",
      "{{llang||+}}",
      "{{|+}}",
      "{{문서이름}}",
      "{{전체문서이름}}",
      "{{삭제|+}}",
      "{{특정판.삭제|+}}",
      "{{유튜브|+}}",
      "{{퍼온문서|문서=+|판=_|퍼온곳=_}}",
      "{{번역된.문서|en|+||}}",
      "{{string|+}}",
      "{{배지|+}}",
      "{{PD-author}}"
    ]
  },
  "틀 작성": [
    "{{{+}}}",
    "{{{+|}}}",
    "<onlyinclude>+</onlyinclude>",
    "<includeonly>+</includeonly>",
    "<noinclude>+</noinclude>",
    "{{풀기:+}}",
    "<templatestyles.src='+/styles.css'/>"
  ],
  "파서함수": [
    "{{#expr:+}}",
    "{{#if:+}}",
    "{{#ifeq:+}}",
    "{{#iferror:+}}",
    "{{#ifexist:+}}",
    "{{#switch:+}}",
    "{{#time:+}}",
    "{{#titlepart:+}}",
    "{{#invoke:|}}"
  ],
  "HTML": [
    "<p>+</p>",
    "<div>+</div>",
    "<div.style=''>+</div>",
    "<div.class=''.style=''>+</div>",
    "<span>+</span>",
    "<span.style=''>+</span>",
    "<span.class=''.style=''>+</span>",
    "<code>+</code>",
    "<code><nowiki>+</nowiki></code>",
    "<pre>+</pre>",
    "<syntaxhighlight.lang='+'>\n\n</syntaxhighlight>"
  ],
  "파일 저작권": [
    "{{PD-self}}",
    "{{PD-old}}",
    "{{PD-author}}",
    "{{CC-BY-3.0}}",
    "{{CC-BY-SA-3.0}}"
  ]
};
class EditToolsBox {
class EditToolsBox {


    /**
     constructor() {
    *
    * @param {{}} data
    */
     constructor(data) {
         /** @type {Array<HTMLDivElement>} */
         /** @type {Array<HTMLDivElement>} */
         const SubsetBoxes = [];
         const SubsetBoxes = [];


         data = window.charinsert = Object.assign(data, window.charinsertCustom);
         const data = Object.assign(window.charinsert, window.charinsertCustom);


         const specialchars_box = $('<div id="editpage-specialchars" class="nopopups"></div>');
         const specialchars_box = $('<div id="editpage-specialchars" class="nopopups"></div>');


         const DropdownMenu = DropdownWidget.getMenu();
         const DropdownMenu = DropdownWidget.getMenu();
         DropdownMenu.addItems(options)
         DropdownMenu.addItems(options);
         DropdownMenu.on('choose', (seletedItem) => {
         DropdownMenu.on('choose', (seletedItem) => {


                 const box = this.makeSubsetBox(seletedItem.getData());
                 const box = this.makeSubsetBox(seletedItem.getData());
                 if (box != null) {
                 if (box != null) {
                     specialchars_box.append(box.$element)
                     specialchars_box.append(box.$element);
                     SubsetBoxes[seletedIndex] = box.$element[0];
                     SubsetBoxes[seletedIndex] = box.$element[0];
                 }
                 }
             framed: false,
             framed: false,
             label: token
             label: token
         })
         });
         Button.$element.on('click', { toInsert: token }, this.InsertOnClick);
         Button.$element.on('click', { toInsert: token }, this.InsertOnClick);
         return Button;
         return Button;
                     pre: e.data.toInsert
                     pre: e.data.toInsert
                 }
                 }
                 )
                 );
             }
             }
         }
         }


         if (typeof curSubset == "undefined") {
         if (typeof curSubset == "undefined") {
             return null
             return null;
         }
         }
         else if (Array.isArray(curSubset)) {
         else if (Array.isArray(curSubset)) {
mw.loader.using(['oojs-ui']).then(() => {
mw.loader.using(['oojs-ui']).then(() => {
mw.hook('wikiEditor.toolbarReady').add(() => new EditToolsBox(data));
mw.hook('wikiEditor.toolbarReady').add(() => new EditToolsBox(data));
mw.loader.load('//librewiki.net/index.php?title=User:하늘/EditTools.css&action=raw&ctype=text/css', 'text/css');
});
});

명령 변수

변수
사용자의 편집 수 (user_editcount)
39845
사용자 계정 이름 (user_name)
'하늘'
사용자 계정 만든 후 지난 시간 (user_age)
127877573
사용자 권한 그룹 (자동으로 부여된 권한 포함) (user_groups)
[ 0 => '*', 1 => 'user', 2 => 'autoconfirmed' ]
문서 ID (page_id)
164397
문서 이름공간 (page_namespace)
2
(이름공간을 뺀) 문서 제목 (page_title)
'하늘/EditTools.js'
전체 문서 제목 (page_prefixedtitle)
'사용자:하늘/EditTools.js'
동작 (action)
'edit'
편집 요약/이유 (summary)
''
이전 콘텐츠 모델 (old_content_model)
'javascript'
새 콘텐츠 모델 (new_content_model)
'javascript'
편집 전 과거 문서의 위키텍스트 (old_wikitext)
'class EditToolsBox { /** * * @param {{}} data */ constructor(data) { /** @type {Array<HTMLDivElement>} */ const SubsetBoxes = []; data = window.charinsert = Object.assign(data, window.charinsertCustom); const specialchars_box = $('<div id="editpage-specialchars" class="nopopups"></div>'); specialchars_box[0].title = '편집 창에 입력할 글자 혹은 태그를 클릭하세요'; // 문자셋 드랍다운 메뉴를 만듭니다. const options = []; for (const i in data) { options.push(new OO.ui.MenuOptionWidget({ label: i, data: data[i] })); } /** * @type {OO.ui.DropdownWidget} */ const DropdownWidget = new OO.ui.DropdownWidget(); DropdownWidget.setLabel('Choose character subset'); const DropdownMenu = DropdownWidget.getMenu(); DropdownMenu.addItems(options) DropdownMenu.on('choose', (seletedItem) => { let seletedIndex = DropdownMenu.getItemIndex(seletedItem); if (SubsetBoxes.length === 0 || !SubsetBoxes[seletedIndex]) { const box = this.makeSubsetBox(seletedItem.getData()); if (box != null) { specialchars_box.append(box.$element) SubsetBoxes[seletedIndex] = box.$element[0]; } } SubsetBoxes.forEach(e => { e.style.display = 'none' }) SubsetBoxes[seletedIndex].style.display = 'inline'; }); DropdownMenu.chooseItem(options[0]); // Find the element that is focused this.$currentFocused = $('#wpTextbox1'); // Apply to dynamically created textboxes as well as normal ones $(document).on('focus', 'textarea, input:text', () => this.$currentFocused = $(this)); $(".wikiEditor-ui").append(specialchars_box); specialchars_box.before(DropdownWidget.$element); } /** * * @param {String} token * @returns {OO.ui.ButtonWidget}} */ makeButton(token) { const Button = new OO.ui.ButtonWidget({ useInputTag: true, framed: false, label: token }) Button.$element.on('click', { toInsert: token }, this.InsertOnClick); return Button; } InsertOnClick(e) { e.preventDefault(); if (this.$currentFocused && this.$currentFocused.length && !this.$currentFocused.prop('readonly')) { let splitterIndex; if ((splitterIndex = e.data.toInsert.indexOf("+")) > 0) { this.$currentFocused.textSelection( 'encapsulateSelection', { pre: e.data.toInsert.substr(0, splitterIndex), post: e.data.toInsert.substr(splitterIndex + 1) }); } else { this.$currentFocused.textSelection( 'encapsulateSelection', { pre: e.data.toInsert } ) } } } makeSubsetBox(curSubset) { const tokens = [] if (typeof curSubset == "undefined") { return null } else if (Array.isArray(curSubset)) { for (const token of curSubset) { tokens.push(this.makeButton(token)); } } else { for (const tokenKey in curSubset) { const tokenArray = curSubset[tokenKey]; tokens.push(new OO.ui.LabelWidget({ label: `${tokenKey} ` })); for (const token of tokenArray) { tokens.push(this.makeButton(token)); } } } return new OO.ui.ButtonGroupWidget({ items: tokens }); } } mw.loader.using(['oojs-ui']).then(() => { mw.hook('wikiEditor.toolbarReady').add(() => new EditToolsBox(data)); });'
편집 후 새 문서의 위키텍스트 (new_wikitext)
'window.charinsert = { 기본: { 괄호: [ "(+)", "[+]", "{+}", "〔+〕", "〈+〉", "【+】" ], 위키텍스트: [ "{{크기||+}}", "[[+]]", "[[#+]]", "{{+}}", "<!--+-->", " /*+*/", "[[분류:+]]", "[[분류:+|_]]", "[[파일:+]]", "&nbsp;", "<del>+</del>", "<br/>", "<hr/>", "----", "{{-}}", "{{각주}}", "<ref>+</ref>", "<ref.name='+' />", "{{URL|+}}", "__TOC__", "<span.id='+'/>" ], 틀: [ "{{색||+}}", "{{lang||+}}", "{{llang||+}}", "{{|+}}", "{{문서이름}}", "{{전체문서이름}}", "{{삭제|+}}", "{{특정판.삭제|+}}", "{{유튜브|+}}", "{{퍼온문서|문서=+|판=_|퍼온곳=_}}", "{{번역된.문서|en|+||}}", "{{string|+}}", "{{배지|+}}", "{{PD-author}}" ] }, "틀 작성": [ "{{{+}}}", "{{{+|}}}", "<onlyinclude>+</onlyinclude>", "<includeonly>+</includeonly>", "<noinclude>+</noinclude>", "{{풀기:+}}", "<templatestyles.src='+/styles.css'/>" ], "파서함수": [ "{{#expr:+}}", "{{#if:+}}", "{{#ifeq:+}}", "{{#iferror:+}}", "{{#ifexist:+}}", "{{#switch:+}}", "{{#time:+}}", "{{#titlepart:+}}", "{{#invoke:|}}" ], "HTML": [ "<p>+</p>", "<div>+</div>", "<div.style=''>+</div>", "<div.class=''.style=''>+</div>", "<span>+</span>", "<span.style=''>+</span>", "<span.class=''.style=''>+</span>", "<code>+</code>", "<code><nowiki>+</nowiki></code>", "<pre>+</pre>", "<syntaxhighlight.lang='+'>\n\n</syntaxhighlight>" ], "파일 저작권": [ "{{PD-self}}", "{{PD-old}}", "{{PD-author}}", "{{CC-BY-3.0}}", "{{CC-BY-SA-3.0}}" ] }; class EditToolsBox { constructor() { /** @type {Array<HTMLDivElement>} */ const SubsetBoxes = []; const data = Object.assign(window.charinsert, window.charinsertCustom); const specialchars_box = $('<div id="editpage-specialchars" class="nopopups"></div>'); specialchars_box[0].title = '편집 창에 입력할 글자 혹은 태그를 클릭하세요'; // 문자셋 드랍다운 메뉴를 만듭니다. const options = []; for (const i in data) { options.push(new OO.ui.MenuOptionWidget({ label: i, data: data[i] })); } /** * @type {OO.ui.DropdownWidget} */ const DropdownWidget = new OO.ui.DropdownWidget(); DropdownWidget.setLabel('Choose character subset'); const DropdownMenu = DropdownWidget.getMenu(); DropdownMenu.addItems(options); DropdownMenu.on('choose', (seletedItem) => { let seletedIndex = DropdownMenu.getItemIndex(seletedItem); if (SubsetBoxes.length === 0 || !SubsetBoxes[seletedIndex]) { const box = this.makeSubsetBox(seletedItem.getData()); if (box != null) { specialchars_box.append(box.$element); SubsetBoxes[seletedIndex] = box.$element[0]; } } SubsetBoxes.forEach(e => { e.style.display = 'none' }) SubsetBoxes[seletedIndex].style.display = 'inline'; }); DropdownMenu.chooseItem(options[0]); // Find the element that is focused this.$currentFocused = $('#wpTextbox1'); // Apply to dynamically created textboxes as well as normal ones $(document).on('focus', 'textarea, input:text', () => this.$currentFocused = $(this)); $(".wikiEditor-ui").append(specialchars_box); specialchars_box.before(DropdownWidget.$element); } /** * * @param {String} token * @returns {OO.ui.ButtonWidget}} */ makeButton(token) { const Button = new OO.ui.ButtonWidget({ useInputTag: true, framed: false, label: token }); Button.$element.on('click', { toInsert: token }, this.InsertOnClick); return Button; } InsertOnClick(e) { e.preventDefault(); if (this.$currentFocused && this.$currentFocused.length && !this.$currentFocused.prop('readonly')) { let splitterIndex; if ((splitterIndex = e.data.toInsert.indexOf("+")) > 0) { this.$currentFocused.textSelection( 'encapsulateSelection', { pre: e.data.toInsert.substr(0, splitterIndex), post: e.data.toInsert.substr(splitterIndex + 1) }); } else { this.$currentFocused.textSelection( 'encapsulateSelection', { pre: e.data.toInsert } ); } } } makeSubsetBox(curSubset) { const tokens = [] if (typeof curSubset == "undefined") { return null; } else if (Array.isArray(curSubset)) { for (const token of curSubset) { tokens.push(this.makeButton(token)); } } else { for (const tokenKey in curSubset) { const tokenArray = curSubset[tokenKey]; tokens.push(new OO.ui.LabelWidget({ label: `${tokenKey} ` })); for (const token of tokenArray) { tokens.push(this.makeButton(token)); } } } return new OO.ui.ButtonGroupWidget({ items: tokens }); } } mw.loader.using(['oojs-ui']).then(() => { mw.hook('wikiEditor.toolbarReady').add(() => new EditToolsBox(data)); mw.loader.load('//librewiki.net/index.php?title=User:하늘/EditTools.css&action=raw&ctype=text/css', 'text/css'); });'
편집 전후의 차이 (edit_diff)
'@@ -1,13 +1,101 @@ +window.charinsert = { + 기본: { + 괄호: [ + "(+)", + "[+]", + "{+}", + "〔+〕", + "〈+〉", + "【+】" + ], + 위키텍스트: [ + "{{크기||+}}", + "[[+]]", + "[[#+]]", + "{{+}}", + "<!--+-->", + " /*+*/", + "[[분류:+]]", + "[[분류:+|_]]", + "[[파일:+]]", + "&nbsp;", + "<del>+</del>", + "<br/>", + "<hr/>", + "----", + "{{-}}", + "{{각주}}", + "<ref>+</ref>", + "<ref.name='+' />", + "{{URL|+}}", + "__TOC__", + "<span.id='+'/>" + ], + 틀: [ + "{{색||+}}", + "{{lang||+}}", + "{{llang||+}}", + "{{|+}}", + "{{문서이름}}", + "{{전체문서이름}}", + "{{삭제|+}}", + "{{특정판.삭제|+}}", + "{{유튜브|+}}", + "{{퍼온문서|문서=+|판=_|퍼온곳=_}}", + "{{번역된.문서|en|+||}}", + "{{string|+}}", + "{{배지|+}}", + "{{PD-author}}" + ] + }, + "틀 작성": [ + "{{{+}}}", + "{{{+|}}}", + "<onlyinclude>+</onlyinclude>", + "<includeonly>+</includeonly>", + "<noinclude>+</noinclude>", + "{{풀기:+}}", + "<templatestyles.src='+/styles.css'/>" + ], + "파서함수": [ + "{{#expr:+}}", + "{{#if:+}}", + "{{#ifeq:+}}", + "{{#iferror:+}}", + "{{#ifexist:+}}", + "{{#switch:+}}", + "{{#time:+}}", + "{{#titlepart:+}}", + "{{#invoke:|}}" + ], + "HTML": [ + "<p>+</p>", + "<div>+</div>", + "<div.style=''>+</div>", + "<div.class=''.style=''>+</div>", + "<span>+</span>", + "<span.style=''>+</span>", + "<span.class=''.style=''>+</span>", + "<code>+</code>", + "<code><nowiki>+</nowiki></code>", + "<pre>+</pre>", + "<syntaxhighlight.lang='+'>\n\n</syntaxhighlight>" + ], + "파일 저작권": [ + "{{PD-self}}", + "{{PD-old}}", + "{{PD-author}}", + "{{CC-BY-3.0}}", + "{{CC-BY-SA-3.0}}" + ] +}; + class EditToolsBox { - /** - * - * @param {{}} data - */ - constructor(data) { + constructor() { /** @type {Array<HTMLDivElement>} */ const SubsetBoxes = []; - data = window.charinsert = Object.assign(data, window.charinsertCustom); + const data = Object.assign(window.charinsert, window.charinsertCustom); const specialchars_box = $('<div id="editpage-specialchars" class="nopopups"></div>'); @@ -28,5 +116,5 @@ const DropdownMenu = DropdownWidget.getMenu(); - DropdownMenu.addItems(options) + DropdownMenu.addItems(options); DropdownMenu.on('choose', (seletedItem) => { @@ -36,5 +124,5 @@ const box = this.makeSubsetBox(seletedItem.getData()); if (box != null) { - specialchars_box.append(box.$element) + specialchars_box.append(box.$element); SubsetBoxes[seletedIndex] = box.$element[0]; } @@ -66,5 +154,5 @@ framed: false, label: token - }) + }); Button.$element.on('click', { toInsert: token }, this.InsertOnClick); return Button; @@ -88,5 +176,5 @@ pre: e.data.toInsert } - ) + ); } } @@ -97,5 +185,5 @@ if (typeof curSubset == "undefined") { - return null + return null; } else if (Array.isArray(curSubset)) { @@ -119,3 +207,4 @@ mw.loader.using(['oojs-ui']).then(() => { mw.hook('wikiEditor.toolbarReady').add(() => new EditToolsBox(data)); + mw.loader.load('//librewiki.net/index.php?title=User:하늘/EditTools.css&action=raw&ctype=text/css', 'text/css'); }); '
편집 중 추가된 줄 (added_lines)
[ 0 => 'window.charinsert = {', 1 => ' 기본: {', 2 => ' 괄호: [', 3 => ' "(+)",', 4 => ' "[+]",', 5 => ' "{+}",', 6 => ' "〔+〕",', 7 => ' "〈+〉",', 8 => ' "【+】"', 9 => ' ],', 10 => ' 위키텍스트: [', 11 => ' "{{크기||+}}",', 12 => ' "[[+]]",', 13 => ' "[[#+]]",', 14 => ' "{{+}}",', 15 => ' "<!--+-->",', 16 => ' " /*+*/",', 17 => ' "[[분류:+]]",', 18 => ' "[[분류:+|_]]",', 19 => ' "[[파일:+]]",', 20 => ' "&nbsp;",', 21 => ' "<del>+</del>",', 22 => ' "<br/>",', 23 => ' "<hr/>",', 24 => ' "----",', 25 => ' "{{-}}",', 26 => ' "{{각주}}",', 27 => ' "<ref>+</ref>",', 28 => ' "<ref.name='+' />",', 29 => ' "{{URL|+}}",', 30 => ' "__TOC__",', 31 => ' "<span.id='+'/>"', 32 => ' ],', 33 => ' 틀: [', 34 => ' "{{색||+}}",', 35 => ' "{{lang||+}}",', 36 => ' "{{llang||+}}",', 37 => ' "{{|+}}",', 38 => ' "{{문서이름}}",', 39 => ' "{{전체문서이름}}",', 40 => ' "{{삭제|+}}",', 41 => ' "{{특정판.삭제|+}}",', 42 => ' "{{유튜브|+}}",', 43 => ' "{{퍼온문서|문서=+|판=_|퍼온곳=_}}",', 44 => ' "{{번역된.문서|en|+||}}",', 45 => ' "{{string|+}}",', 46 => ' "{{배지|+}}",', 47 => ' "{{PD-author}}"', 48 => ' ]', 49 => ' },', 50 => ' "틀 작성": [', 51 => ' "{{{+}}}",', 52 => ' "{{{+|}}}",', 53 => ' "<onlyinclude>+</onlyinclude>",', 54 => ' "<includeonly>+</includeonly>",', 55 => ' "<noinclude>+</noinclude>",', 56 => ' "{{풀기:+}}",', 57 => ' "<templatestyles.src='+/styles.css'/>"', 58 => ' ],', 59 => ' "파서함수": [', 60 => ' "{{#expr:+}}",', 61 => ' "{{#if:+}}",', 62 => ' "{{#ifeq:+}}",', 63 => ' "{{#iferror:+}}",', 64 => ' "{{#ifexist:+}}",', 65 => ' "{{#switch:+}}",', 66 => ' "{{#time:+}}",', 67 => ' "{{#titlepart:+}}",', 68 => ' "{{#invoke:|}}"', 69 => ' ],', 70 => ' "HTML": [', 71 => ' "<p>+</p>",', 72 => ' "<div>+</div>",', 73 => ' "<div.style=''>+</div>",', 74 => ' "<div.class=''.style=''>+</div>",', 75 => ' "<span>+</span>",', 76 => ' "<span.style=''>+</span>",', 77 => ' "<span.class=''.style=''>+</span>",', 78 => ' "<code>+</code>",', 79 => ' "<code><nowiki>+</nowiki></code>",', 80 => ' "<pre>+</pre>",', 81 => ' "<syntaxhighlight.lang='+'>\n\n</syntaxhighlight>"', 82 => ' ],', 83 => ' "파일 저작권": [', 84 => ' "{{PD-self}}",', 85 => ' "{{PD-old}}",', 86 => ' "{{PD-author}}",', 87 => ' "{{CC-BY-3.0}}",', 88 => ' "{{CC-BY-SA-3.0}}"', 89 => ' ]', 90 => '};', 91 => '', 92 => ' constructor() {', 93 => ' const data = Object.assign(window.charinsert, window.charinsertCustom);', 94 => ' DropdownMenu.addItems(options);', 95 => ' specialchars_box.append(box.$element);', 96 => ' });', 97 => ' );', 98 => ' return null;', 99 => ' mw.loader.load('//librewiki.net/index.php?title=User:하늘/EditTools.css&action=raw&ctype=text/css', 'text/css');' ]
편집이 토르 끝 노드를 통해 바뀌었는 지의 여부 (tor_exit_node)
false
바뀐 시점의 유닉스 시간 기록 (timestamp)
'1707229033'