No edit summary
Tag: Reverted
No edit summary
Tag: Reverted
Line 1: Line 1:
== OneClickArchiver ==
'''OneClickArchiver''' (OCA) adds an '''Archive''' link next to every section heading on a talk page. Clicking it moves that section to the configured archive page in one step.
'''OneClickArchiver''' (OCA) adds an '''Archive''' link next to every section heading on a talk page. Clicking it moves that section to the configured archive page in one step.


It is an optional gadget, you can enable or disable it at any time. It only affects '''your''' view and actions.
It is an optional gadget — you can enable or disable it at any time. It only affects '''your''' view and actions.


=== How to enable ===
=== How to enable ===


Add the following line to '''your own''' <code>common.js</code> page:
# '''Click here to open your common.js in edit mode:'''
 
#* '''[[Special:MyPage/common.js?action=edit|Open my common.js]]'''  
<pre>
# Paste the following line anywhere in the file. '''Click on the box below to auto-select the entire line, then press <kbd>Ctrl</kbd>+<kbd>C</kbd> (or <kbd>Cmd</kbd>+<kbd>C</kbd> on Mac).'''
mw.loader.load('https://en.bharatpedia.org/w/index.php?title=MediaWiki:Gadget-OneClickArchiver.js&action=raw&ctype=text/javascript&maxage=0&smaxage=0&t=' + Date.now());
</pre>
 
Your <code>common.js</code> page is at:
 
<code><nowiki>https://en.bharatpedia.org/wiki/User:YOUR_USERNAME/common.js</nowiki></code>


Replace <code>YOUR_USERNAME</code> with your actual username, then:
<div style="user-select: all; -webkit-user-select: all; -moz-user-select: all; -ms-user-select: all; background: #f8f9fa; border: 1px solid #a2a9b1; border-radius: 3px; padding: 10px; margin: 8px 0; font-family: monospace; font-size: 13px; white-space: pre-wrap; word-break: break-all; cursor: pointer;" title="Click to select all">mw.loader.load('https://en.bharatpedia.org/w/index.php?title=MediaWiki:Gadget-OneClickArchiver.js&action=raw&ctype=text/javascript&maxage=0&smaxage=0&t=' + Date.now());</div>


# Open the page in edit mode.
# Click '''Save changes'''.
# Paste the line above anywhere in the file.
# Save the page.
# '''Clear your browser cache''':
# '''Clear your browser cache''':
#* '''Windows / Linux:''' press <code>Ctrl + Shift + Delete</code>, choose "All time", tick "Cached images and files", click "Clear".
#* '''Windows / Linux:''' press <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>Delete</kbd>, choose "All time", tick "Cached images and files", click "Clear".
#* '''Mac:''' press <code>Cmd + Shift + Delete</code> and do the same.
#* '''Mac:''' press <kbd>Cmd</kbd>+<kbd>Shift</kbd>+<kbd>Delete</kbd> and do the same.
#* Then do a hard reload on any talk page with <code>Ctrl + Shift + R</code> (or <code>Cmd + Shift + R</code>).
#* Then hard-reload any talk page with <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>R</kbd> (or <kbd>Cmd</kbd>+<kbd>Shift</kbd>+<kbd>R</kbd>).


=== How to disable ===
=== How to disable ===


Just remove that line from your <code>common.js</code> and save. Clear your cache again. The Archive links will disappear.
# '''Click here to open your common.js in edit mode:'''
#* '''[[Special:MyPage/common.js?action=edit|Open my common.js]]'''
# Remove the <code>mw.loader.load(...)</code> line for OneClickArchiver.
# Save, then clear your cache again. The Archive links will disappear.


=== How to use ===
=== How to use ===
Line 45: Line 42:
</pre>
</pre>


If you want a custom archive location, add the following template to the top of the talk page:
If you want a custom archive location, add the following template to the top of the talk page. '''Click the box to select, then copy:'''


<pre>
<div style="user-select: all; -webkit-user-select: all; -moz-user-select: all; -ms-user-select: all; background: #f8f9fa; border: 1px solid #a2a9b1; border-radius: 3px; padding: 10px; margin: 8px 0; font-family: monospace; font-size: 13px; white-space: pre-wrap; cursor: pointer;" title="Click to select all">{{Archive config
{{Archive config
| archive  = Talk:Example/Archive %(counter)d
| archive  = Talk:Example/Archive %(counter)d
| counter  = 1
| counter  = 1
| maxsize  = 100K
| maxsize  = 100K
| header    = {{Archive}}
| header    = {{Archive}}
}}
}}</div>
</pre>


=== Notes ===
=== Notes ===
Line 61: Line 56:
* The Archive link only appears on talk pages (namespaces 1, 3, 5, 7, 9, 11, 13, 15).
* The Archive link only appears on talk pages (namespaces 1, 3, 5, 7, 9, 11, 13, 15).
* If a section is marked with <code>Do Not Archive Until</code>, it will not be archived until that date passes.
* If a section is marked with <code>Do Not Archive Until</code>, it will not be archived until that date passes.
* Do not click Archive on a section you want to keep, the action is immediate and cannot be undone with a single click. You would need to restore it from the archive page's history.
* Do not click Archive on a section you want to keep — the action is immediate and cannot be undone with a single click. You would need to restore it from the archive page's history.


=== Report problems ===
=== Report problems ===
Line 68: Line 63:
* The page where it failed
* The page where it failed
* Your browser and OS
* Your browser and OS
* Any error messages from the browser console (press <code>F12</code> → Console tab)
* Any error messages from the browser console (press <kbd>F12</kbd> → Console tab)

Revision as of 15:37, 6 October 2026

OneClickArchiver

OneClickArchiver (OCA) adds an Archive link next to every section heading on a talk page. Clicking it moves that section to the configured archive page in one step.

It is an optional gadget — you can enable or disable it at any time. It only affects your view and actions.

How to enable

  1. Click here to open your common.js in edit mode:
  2. Paste the following line anywhere in the file. Click on the box below to auto-select the entire line, then press Ctrl+C (or Cmd+C on Mac).
  1. Click Save changes.
  2. Clear your browser cache:
    • Windows / Linux: press Ctrl+Shift+Delete, choose "All time", tick "Cached images and files", click "Clear".
    • Mac: press Cmd+Shift+Delete and do the same.
    • Then hard-reload any talk page with Ctrl+Shift+R (or Cmd+Shift+R).

How to disable

  1. Click here to open your common.js in edit mode:
  2. Remove the mw.loader.load(...) line for OneClickArchiver.
  3. Save, then clear your cache again. The Archive links will disappear.

How to use

  1. Go to any talk page.
  2. Next to every section heading you will see a small [ Archive ] link.
  3. Click it.
  4. A popup appears showing progress. The section is copied to the archive page and removed from the talk page.
  5. The page reloads automatically.

By default, sections are archived to:

<Page name>/Archive 1
<Page name>/Archive 2
...

If you want a custom archive location, add the following template to the top of the talk page. Click the box to select, then copy:

Notes

  • If the script does not appear, clear your browser cache first. This solves the issue in almost every case.
  • The Archive link only appears on talk pages (namespaces 1, 3, 5, 7, 9, 11, 13, 15).
  • If a section is marked with Do Not Archive Until, it will not be archived until that date passes.
  • Do not click Archive on a section you want to keep — the action is immediate and cannot be undone with a single click. You would need to restore it from the archive page's history.

Report problems

Post on the talk page with:

  • The page where it failed
  • Your browser and OS
  • Any error messages from the browser console (press F12 → Console tab)