Jump to content

User:DannyS712 test/QP

From Wikipedia, the free encyclopedia

Pseudo code for User:DannyS712 test/QP.js / User:The Transhumanist/QuickPortal.js

Only the core functionality is fully described - matchingPortal() and invokeEditPage() are summarized in the instance they are used, set up code is ignored

main function:
     if you are on a page with "Creating Portal:" in the title, run insertQuickPortal

     if you are on a page with "Portal" in the title, and it isn't a subpage or the results of a search, add a link
          when the link is clicked, and you are already editing the page, run insertQuickPortal
          otherwise, go to the edit window

     if you are in mainspace but not at a list, index, outline, timeline, or page with a "/" in the title
          add a link to go to the portal of the same name

insertQuickPortal function:
     select the edit box
     replace the contents with "{{subst:bpsp}}"
     go to the preview window