Jump to content
 







Main menu
   


Navigation  



Main page
Contents
Current events
Random article
About Wikipedia
Contact us
Donate
 




Contribute  



Help
Learn to edit
Community portal
Recent changes
Upload file
 








Search  

































Create account

Log in
 









Create account
 Log in
 




Pages for logged out editors learn more  



Contributions
Talk
 



















Contents

   



(Top)
 


1 Installation  



1.1  Required  





1.2  Recommended  



1.2.1  Disable rollback links by default  





1.2.2  Deactivate conflicting gadgets  









2 Configuration  



2.1  Same everywhere  





2.2  Different on different pages  





2.3  Mobile and desktop  







3 Codes  





4 Bugs and troubleshooting  














User:Mr. Stradivarius/gadgets/ConfirmRollback

















User page
Talk
 

















Read
Edit
View history
 








Tools
   


Actions  



Read
Edit
View history
 




General  



What links here
Related changes
User contributions
User logs
View user groups
Upload file
Special pages
Permanent link
Page information
Get shortened URL
Download QR code
 




Print/export  



Download as PDF
Printable version
 
















Appearance
   

 






From Wikipedia, the free encyclopedia
 

< User:Mr. Stradivarius

Welcome to ConfirmRollback, the last word in customizing your rollback links. With this script you can:

  • Choose from three rollback link behaviours: hide, allow, or ask for confirmation
  • Use different behaviours on the watchlist, on page histories, in diff view, and more
  • Use different combinations of all the above for your desktop and mobile devices
  • The script uses sensible defaults, so if you are in a rush, just go ahead and install it.

    Installation[edit]

    Required[edit]

    Copy and paste the following code in Special:MyPage/common.js:

    importScript('User:Mr. Stradivarius/gadgets/ConfirmRollback.js'); // Linkback: [[User:Mr. Stradivarius/gadgets/ConfirmRollback.js]]
    

    Then save the page and bypass your browser cache.

    Recommended[edit]

    Disable rollback links by default[edit]

    Add the following code to Special:MyPage/common.css:

    .mw-rollback-link {
     display: none;
    }
    

    This step hides the rollback links by default. They are then shown by the script if necessary. This avoids situations where rollback links are active when they shouldn't be, due to the script not having been loaded yet.

    Deactivate conflicting gadgets[edit]

    Some gadgets conflict with ConfirmRollback, so it is recommended that you disable them. Go to the "Gadgets" tab in your preferences, and in the "Browsing" section, deselect the following checkboxes:

    Then scroll to the bottom of the page, and click "Save".

    Known conflicts
    Gadget Behaviour
    modrollback.js When you click on a rollback link, the user's contributions page will immediately open, causing the box to disappear and the rollback to happen with no confirmation.
    confirmationRollback-mobile.js If your ConfirmRollback settings are set to "confirm", you will be shown two different confirmation dialogs each time you click a rollback link.

    Configuration[edit]

    The configuration goes in Special:MyPage/common.js, and is always prefixed with ConfirmRollback. It should go an a separate line before the importScript line. For example, to configure the script to confirm rollback everywhere on both mobile and desktop, you would add the following code to your common.js:

    ConfirmRollback = "confirm";
    importScript('User:Mr. Stradivarius/gadgets/ConfirmRollback.js'); // Linkback: [[User:Mr. Stradivarius/gadgets/ConfirmRollback.js]]
    

    To help you edit the configuration, take a look at the examples below and at the list of codes. Once you have finished, save the page, and bypass your browser cache.

    Same everywhere[edit]

    The simplest set-up is to have the same rollback behaviour on every page, both mobile and desktop.

    For example, this code will ask for confirmation for all rollback links.

    ConfirmRollback = "confirm";
    

    Different on different pages[edit]

    To use different behaviours on different pages, you will need to use the JavaScript curly bracket syntax. Any pages that you don't specify will use the default behaviours.

    For example, to hide rollback links from the watchlist, ask for confirmation on user contributions pages, and do the default behaviour everywhere else, use this:

    ConfirmRollback = {
      watchlist: "hide",
      contributions: "confirm"
    };
    

    Mobile and desktop[edit]

    To use different behaviours on mobile and desktop, you need to have either "mobile" or "desktop" inside your curly brackets. The contents of "mobile" and "desktop" can be configured the same way as in the previous two sections.

    For example, to hide all rollback links on mobile and ask for confirmation for all rollback links on desktops, use this:

    ConfirmRollback = {
      mobile: "hide",
      desktop: "confirm"
    };
    

    To hide rollback links in diff view on mobile, ask for confirmation on page histories on desktops, and do the default everywhere else, use this:

    ConfirmRollback = {
      mobile: {
        diff: "hide"
      },
      desktop: {
        history: "confirm"
      }
    };
    

    You can mix and match all of these settings however you want.

    Codes[edit]

    The following three tables contain a complete list of available codes.

    Behaviour codes
    Code Description
    confirm A confirmation dialog is displayed when you click on a rollback link.
    hide Rollback links are hidden completely.
    allow Rollback links behave as normal.

    Page codes
    Code Description Desktop default Mobile default
    watchlist The watchlist. confirm confirm
    recentchanges Recent changes. allow confirm
    relatedchanges Related changes. allow confirm
    contributions User contributions. allow confirm
    history Page histories. allow confirm
    diff Diff views. allow confirm
    Device codes
    Code Description
    mobile Devices that can be identified as mobile from their user agent.
    desktop All devices not classified as mobile.

    Bugs and troubleshooting[edit]

    If you spot a bug, if you need help with your settings, or if you have any other kind of question, please ask on the talk page.


    Retrieved from "https://en.wikipedia.org/w/index.php?title=User:Mr._Stradivarius/gadgets/ConfirmRollback&oldid=1192514554"

    Categories: 
    Wikipedia scripts
    Wikipedia watchlist
    Wikipedia rollback feature
     



    This page was last edited on 29 December 2023, at 20:02 (UTC).

    Text is available under the Creative Commons Attribution-ShareAlike License 4.0; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.



    Privacy policy

    About Wikipedia

    Disclaimers

    Contact Wikipedia

    Code of Conduct

    Developers

    Statistics

    Cookie statement

    Mobile view



    Wikimedia Foundation
    Powered by MediaWiki