Jump to content

User:Awesome Aasim/savedraft

From Wikipedia, the free encyclopedia
Drafts
UpdatedMarch 15, 2021
    (3 years ago)
SourceUser:Awesome Aasim/savedraft.js

This script allows for you to save edits in progress as a draft (not to Draft: namespace but to your computer) to avoid losing data from browser glitches, etc. This will add a button "Save draft" to the editing window that will allow you to save a draft immediately. Drafts are saved to your localStorage and do not sync between your devices (unless if you have a browser or browser extension that syncs your cache and browsing data).

Installation

[edit]
importScript("User:Awesome Aasim/savedraft.js");

on common.js or

mw.loader.load("https://en.wikipedia.org/wiki/User:Awesome Aasim/savedraft.js?action=raw&ctype=text/javascript");

to global.js.

Using the Script

[edit]

This only works with the classic editor.

At the bottom of the edit form, there will be a new button labeled "Save draft". This will save the contents of your page as a draft on your computer. Right now, you can only have one draft per page, but multiple drafts may be a future feature.

If you already have a draft for a page, you will see two buttons at the top of the edit form: Load draft and delete draft. The first button will load the draft into the edit form. The second button will delete the draft from your computer.

You can view and manage your drafts here.