Difference between revisions of "Template:Draft article check/doc"

From blackwiki
Jump to navigation Jump to search
imported>HectorMoffet
imported>HectorMoffet
Line 13: Line 13:
  
 
==View content for Logged-in Users==
 
==View content for Logged-in Users==
Viewing DraftChecker links in Article space requires two lines of javascript code: the [[User:HectorMoffet/ShowOnlyToLoggedInUsers.js|ShowOnlyToLoggedInUsers.js]] script.       
+
In order to view '''DraftChecker''''s links in the main Article namespace, two lines of javascript code must be installed: the [[User:HectorMoffet/ShowOnlyToLoggedInUsers.js|ShowOnlyToLoggedInUsers.js]] script.       
  
Currently, you can install this script by adding the following line to [[Special:MyPage/common.js|your common.js file]]:
+
While '''DraftChecker''' is in development, you can install this script by adding the following line to [[Special:MyPage/common.js|your common.js file]]:
 
:importScript('[[User:HectorMoffet/ShowOnlyToLoggedInUsers.js]]');
 
:importScript('[[User:HectorMoffet/ShowOnlyToLoggedInUsers.js]]');
  
In future, the ShowOnlyToLoggedInUsers.js script could be added as a [[Wikipedia:Gadget|Gadget]] enabled by default, or included in Wikipedia's  default javascript ([[MediaWiki:Common.js]]).
+
In future, the ShowOnlyToLoggedInUsers.js script could be added as either a [[Wikipedia:Gadget|Gadget]] enabled by default, or included in Wikipedia's  default javascript ([[MediaWiki:Common.js]]).
  
 
==Test Cases==
 
==Test Cases==

Revision as of 15:57, 23 December 2013

DraftChecker is a template to alert editors to the existence of relevant articles or drafts.

  • In Draft or Draft_Talk, DraftChecker will check for an Article of the same title.
  • In Article_Talk, DraftChecker will check for a Draft of the same title.
  • In the Article namespace, Draftchecker will check for a Draft of the same title, but will only show a message if a custom javascript determines the user is logged in.

Usage

{{DraftChecker}}

Technical details

View content for Logged-in Users

In order to view DraftChecker's links in the main Article namespace, two lines of javascript code must be installed: the ShowOnlyToLoggedInUsers.js script.

While DraftChecker is in development, you can install this script by adding the following line to your common.js file:

importScript('User:HectorMoffet/ShowOnlyToLoggedInUsers.js');

In future, the ShowOnlyToLoggedInUsers.js script could be added as either a Gadget enabled by default, or included in Wikipedia's default javascript (MediaWiki:Common.js).

Test Cases

As of 15:43, 23 December 2013 (UTC), the following testcases passed: (altering the text/existence of relevant pages in future may alter the results)