सदस्य:Siddhartha Ghai/pagecreator
PageCreator is a userscript for quickly creating new entries in a standard format. The script has been designed for use with the vector skin and has been tested with Google Chrome v33.
The script is in alpha stage as of April 2014. This means that it is under active development and may break at any time or may cause unexpected changes.
Features
सम्पादन- Activates when viewing or editing a non-existing page in the mainspace; or when viewing a non-existent page in the userspace. Note that it is not active when editing a non-existent page in userspace.
- Multiple meanings in multiple (maximum nine) languages can be added
- Synonyms, antonyms and translations can be added for each meaning
- Only one translation per language is accepted
- A maximum of nine synonyms and antonyms are accepted per meaning (and they're automatically wikilinked and formatted)
- Entries are automatically categorised in the appropriate language category and subcategory according to the grammatical type(s) of the entry
- The template UI is available in Hindi and English (appropriate interface is shown according to your mediawiki interface language). If any other interface language is chosen, the script defaults to hindi.
Installation
सम्पादनTo use this script, add the following to your vector.js:
mw.loader.load( '//hi.wiktionary.org/w/index.php?title=%E0%A4%B8%E0%A4%A6%E0%A4%B8%E0%A5%8D%E0%A4%AF:Siddhartha_Ghai/pagecreator.js&action=raw&ctype=text/javascript' );
mw.loader.load( '//hi.wiktionary.org/w/index.php?title=%E0%A4%B8%E0%A4%A6%E0%A4%B8%E0%A5%8D%E0%A4%AF:Siddhartha_Ghai/pagecreator.css&action=raw&ctype=text/css', 'text/css' );
Usage
सम्पादन- Open any non-existant page in the mainspace. This can be done by manually typing the URL in your browser's address bar or by clicking any existing redlink.
- The gadget will automatically show up and replace the default input form.
- Use the gadget's input form to create the page. You can also preview the page before saving it.
Inputs
सम्पादन- The meaning/अर्थ input accepts wikitext.
- The synonyms/पर्यायवाची, antonyms/विलोम inputs accept comma-separated lists. The list is automatically formatted and wikilinked. Example: synonyms for पानी could be
जल, नीर, वारि
. - The translations accept only plain-text input. This is automatically formatted and wikified.
Customization
सम्पादनThe script offers some customization. To customize the script, a JavaScript object may be added to your vector.js named pagecreatorPrefs
. This object may contain the following three properties:
lang
: An array containing string elements, each string a two-letter language code. The chosen languages will be shown in the "Preferred" ("पसंदीदा") section of the language dropdown menu.summary
: A string containing the default editsummarysummaryAd
: A string containing the default editsummary Ad appended at the end of the summary
The default preferences set in the script are the following. You may copy-paste these and then modify them according to your choice.
pagecreatorPrefs = {
langs: ['hi', 'en'],
summary: 'पृष्ठ निर्माण',
summaryAd: ' ([[User:Siddhartha Ghai/pagecreator|पृष्ठ निर्माता]] द्वारा)'
};
Technical details
सम्पादन- The script's UI is translatable
- The script substitutes various templates (as listed at /templates) to create pages. The page's formatting depends entirely on these templates and can be changed without changing the javascript.
- (Almost) Everything is softcoded.
Update Log
सम्पादन- Version 0.1 Alpha - 8 March 2014