Jump to content

User:Polygnotus/WarnVandalButtons.js: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Created page with '//I should be able to combine these //colours are weird in dark mode if (['edit', 'submit'].indexOf(mw.config.get('wgAction')) !== -1) { mw.hook('wikiEditor.toolbarReady').add(function($textarea) { $textarea.wikiEditor('addToToolbar', { section: 'advanced', group: 'insert', tools: { buttonId: { label: 'Vandalism warning level 1', type: 'button', icon: '//upload.wikimedia.org/wikipedia/commons/8/...'
 
No edit summary
Line 1: Line 1:
//I should be able to combine these
//I should be able to combine these
//colours are weird in dark mode
//colours are weird in dark mode



if (['edit', 'submit'].indexOf(mw.config.get('wgAction')) !== -1) {
mw.hook('wikiEditor.toolbarReady').add(function($textarea) {
$textarea.wikiEditor('addToToolbar', {
section: 'advanced',
group: 'insert',
tools: {
buttonId: {
label: 'Welcome',
type: 'button',
icon: '//https://upload.wikimedia.org/wikipedia/commons/8/82/NotoSans_-_Raised_Hand_With_Fingers_Splayed_-_1F590.svg',
action: {
type: 'encapsulate',
options: {
pre: '{{subst:' + 'Welcome-newuser|heading=no}} ~~' + '~~',
}
}
}
}
});
});
}





if (['edit', 'submit'].indexOf(mw.config.get('wgAction')) !== -1) {
if (['edit', 'submit'].indexOf(mw.config.get('wgAction')) !== -1) {
Line 17: Line 44:
pre: '{{subst:' + 'uw-vand1}} ~~' + '~~',
pre: '{{subst:' + 'uw-vand1}} ~~' + '~~',
}
}

}
}
}
}
Line 41: Line 67:
pre: '{{subst:' + 'uw-vand2}} ~~' + '~~',
pre: '{{subst:' + 'uw-vand2}} ~~' + '~~',
}
}

}
}
}
}
Line 65: Line 90:
pre: '{{subst:' + 'uw-vand3}} ~~' + '~~',
pre: '{{subst:' + 'uw-vand3}} ~~' + '~~',
}
}

}
}
}
}
Line 89: Line 113:
pre: '{{subst:' + 'uw-vand4}} ~~' + '~~',
pre: '{{subst:' + 'uw-vand4}} ~~' + '~~',
}
}

}
}
}
}

Revision as of 01:41, 25 June 2024

//I should be able to combine these
//colours are weird in dark mode



if (['edit', 'submit'].indexOf(mw.config.get('wgAction')) !== -1) {
  mw.hook('wikiEditor.toolbarReady').add(function($textarea) {
    $textarea.wikiEditor('addToToolbar', {
      section: 'advanced',
      group: 'insert',
      tools: {
        buttonId: {
          label: 'Welcome',
          type: 'button',
          icon: '//https://upload.wikimedia.org/wikipedia/commons/8/82/NotoSans_-_Raised_Hand_With_Fingers_Splayed_-_1F590.svg',
          action: {
            type: 'encapsulate',
            options: {
              pre: '{{subst:' + 'Welcome-newuser|heading=no}} ~~' + '~~',
            }
          }
        }
      }
    });
  });
}




if (['edit', 'submit'].indexOf(mw.config.get('wgAction')) !== -1) {
  mw.hook('wikiEditor.toolbarReady').add(function($textarea) {
    $textarea.wikiEditor('addToToolbar', {
      section: 'advanced',
      group: 'insert',
      tools: {
        buttonId: {
          label: 'Vandalism warning level 1',
          type: 'button',
          icon: '//upload.wikimedia.org/wikipedia/commons/8/8a/Eo_circle_grey_number-1.svg',
          action: {
            type: 'encapsulate',
            options: {
              pre: '{{subst:' + 'uw-vand1}} ~~' + '~~',
            }
          }
        }
      }
    });
  });
}


if (['edit', 'submit'].indexOf(mw.config.get('wgAction')) !== -1) {
  mw.hook('wikiEditor.toolbarReady').add(function($textarea) {
    $textarea.wikiEditor('addToToolbar', {
      section: 'advanced',
      group: 'insert',
      tools: {
        buttonId: {
          label: 'Vandalism warning level 2',
          type: 'button',
          icon: '//upload.wikimedia.org/wikipedia/commons/c/c7/Eo_circle_yellow_number-2.svg',
          action: {
            type: 'encapsulate',
            options: {
              pre: '{{subst:' + 'uw-vand2}} ~~' + '~~',
            }
          }
        }
      }
    });
  });
}


if (['edit', 'submit'].indexOf(mw.config.get('wgAction')) !== -1) {
  mw.hook('wikiEditor.toolbarReady').add(function($textarea) {
    $textarea.wikiEditor('addToToolbar', {
      section: 'advanced',
      group: 'insert',
      tools: {
        buttonId: {
          label: 'Vandalism warning level 3',
          type: 'button',
          icon: '//upload.wikimedia.org/wikipedia/commons/c/c5/Eo_circle_deep-orange_number-3.svg',
          action: {
            type: 'encapsulate',
            options: {
              pre: '{{subst:' + 'uw-vand3}} ~~' + '~~',
            }
          }
        }
      }
    });
  });
}


if (['edit', 'submit'].indexOf(mw.config.get('wgAction')) !== -1) {
  mw.hook('wikiEditor.toolbarReady').add(function($textarea) {
    $textarea.wikiEditor('addToToolbar', {
      section: 'advanced',
      group: 'insert',
      tools: {
        buttonId: {
          label: 'Vandalism warning level 4',
          type: 'button',
          icon: '//upload.wikimedia.org/wikipedia/commons/c/cd/Eo_circle_red_number-4.svg',
          action: {
            type: 'encapsulate',
            options: {
              pre: '{{subst:' + 'uw-vand4}} ~~' + '~~',
            }
          }
        }
      }
    });
  });
}