User:קיפודנחש/pageCollector

From Wikipedia, the free encyclopedia

Documentation for pageCollector script[edit]

What does it do?[edit]

This script lets you define "todo" pages, and add to the hidden menu (i.e., the menu under the inverted triangle, next to the search box), buttons per each todo list.

Pressing the button will add a link to the current page to the bottom of the "todo" page.

Installation[edit]

  1. open Special:MyPage/common.js
  2. add the line
    importScript('User:קיפודנחש/pageCollector.js');
    
  3. add a new list as described below, defining the "todo" pages, and the button legends for them

the "todo pages" list[edit]

This list, that should be added to Special:MyPage/common.js, lists the "todo" pages, and the button legends for the buttons that activate them.

example[edit]

Let's say you want to maintain two "todo" lists. one of them is in WP namespace, and is used by many editors. let's say you participate in wikiproject "bananas"/ Among other things, the project maintains a list of pages that contain suspicious information about bananas.

In addition, you want to maintain another "todo" list in your own user space. let's call it "User:LyzzysAunt/Pages I want to show to my niece".

We'll call the button legend for the first list "suspicious bananas", and the second one we'll use the niece name, "Lizzy".

So here is what you would add to Special:MyPage/common.js, including the todo page list, and the line that loads the script itself:

// list of "todo" pages and button legends for PageCollector
var pagesToCollect = [
	{page: 'Wikipedia:WikiProject bananas/suspicious', caption: 'Suspicious bananas'},
	{page: 'User:LizzysAunt/Pages I want to show to my niece', caption: 'Lizzy'}
];

// load pageCollector script:
importScript('User:קיפודנחש/pageCollector.js');

In other words, each line looks like so: {page: '<PAGENAME>', caption: '<button legend>'}, except the last line, which looks almost the same, but does not have a comma at the end (some browsers don't care if you leave a comma after the last line, but some do. We should avoid it). replace <PAGENAME> with the full page name for the "todo", and <button legend> with whatever you want to show on the button.

Also note that if you want to use single or double quote in the page name or legend, you should make sure to use the other type of quotes to enclose this item: for instance, if your user name is Lyzzy'sAunt, use double quotes to enclose the page name: "User:Lizzy'sAunt/Pages I want to show to my niece"

Using the script[edit]

When reading wikipedia, you arrive to a page you want to add to one of the "todo" lists. Without leaving the page, press the "hidden menu" button (the inverted triangle next to the search box), and press the legend that correspond to the todo list you want to add this page to.

Please note that the script does not care if this page already exists in this list or not: you press the button, a new line linking to current page will be added. Press the button again - and a second (or third, etc.) line will be added.

Maintaining the "todo" pages[edit]

Usually, you would want to maintain the "todo" page in some manner. Remember that new pages will be added by the pageCollector script always to the very bottom of the "todo" page. You might want to have sections above it listing the activity regarding those pages: e.g., once a project participant verified the suspicious page and made sure all the information about bananas on this page is accurate, they's move the link to the page from the "suspicious" list at the bottom of the page to a different section, where "verified" pages are listed. Next time someone will "collect" another page to this "todo", it will be added at the very bottom again.