User:Nefastu/Projects/SVH template rework

From Guild Wars 2 Wiki
Jump to navigationJump to search

Checklist[edit]

  • 1Yes Widget:Game mode buttons
    • 1Yes Switch game modes via buttons
      • 1Yes Add cooldown to buttons (rapid switching causes multiple game modes to appear)
    • 1Yes Design - seems okay for now
    • 1Yes Move css out of widget
    • 1Yes Automatically switch game mode based on location.hash (e.g. [[Panic Strike#PvP]]; working examples: Demo1#PvP)
    • 1Yes 'Code review': in progress?
  • 1Yes Game mode version
    • 1Yes Scope support
    • 1Yes Will only be called via Trait/Skill infoboxes (/historical)
  • 1Yes Version history
  • 1Yes Skill fact
  • 1Yes Skill infobox, Trait infobox
    • 1Yes Properties: subobjects
    • 1Yes Implement logic: {{#if:{{{recharge-wvw|}}}{{{recharge-pvp|}}} | <!-- is split --> | <!-- is not split, check if set --> }}
    • 1Yes Fix spacing issue if recharge, upkeep etc is split
  • 1Yes /historical infoboxes
    • 1Yes Implement logic as above

Description[edit]

I'd like to rework how skill splits are displayed on the wiki. Currently, we're using separate pages for the PvP and/or WvW version, example Panic Strike, Panic Strike (WvW), Panic Strike (PvP). With the amount of overhead to update this skill, I'd like to keep all split information back on two pages: the skill/trait/effect page and the /history subpage.

The idea[edit]

  • If something that is displayed within the infobox differs between game modes, I only need to add the game mode that applies to the fact (example {{skill fact|burning|4|game mode=pve}}{{skill fact|burning|2|game mode=wvw pvp}}).
    • If I want to view (as a user, not as an editor) the WvW or PvP version of the skill/trait/effect, I only need to click on the button/link within the {{game mode version}} template at the top of the page.

Implementation[edit]

Widget:Game mode buttons
This template supplies the necessary javascript/jquery functions to switch between game modes as well as creates the buttons that call said functions.
Parameters:
button1, button2, button3: buttons that will be created
scope: jquery selector to limit switching game modes to a specific area (i.e. swapping game modes on a /histoy subpage)
{{Game mode version}}
rework the template to accept one unnamed parameter that is set like |pve,wvw pvp or |pve,wvw,pvp. For each game mode version separated by comma, create a button/link to show the selected game mode version. This template calls the buttons widget.
Additionally, creates three variables "gmv-pve", "gmv-wvw" and "gmv-pvp" with the content being the css class to apply. These variables will be used by the infoboxes.
Two subpages will be added to this template:
  • [[Template:Game mode version/script.js]] containing a minified version of jquery-color, and
  • [[Template:Game mode version/style.css]], containing additional css classes that are only needed if this template is loaded.
{{Version history}}
This template now displays the current status: split / unsplit as well as the past status (if skill has been split and merged back together). If the skill is currently split/has been split in the past, includes a notice of the buttons above the infoboxes to select the desired game mode version of that update.
{{Skill fact}}
the skill fact needs to be wrapped in a div that has a pve, wvw or pvp class set if the game mode parameter is set.
{{Skill infobox}}, {{Trait infobox}}
If the non-split parameter is not set, the template checks for split parameters with naming convention <<param>>-<<gamemode>>. The result is wrapped in a div with classes gamemode and the value from one of the variables set.
Properties for wvw and pvp versions will be created as a subobject. Thanks to Relyk for the suggestion.
{{Skill infobox/historical}}, {{Trait infobox/historical}}
In addition to the above changes, these templates includes the buttons widget with the scope parameter set to the update date. In order to get the correct buttons, the logic to call the widget from the game mode version template will be implemented here as well (or maybe a subtemplate, since both skill and trait infoboxes will use it).
{{recharge/split}}, {{energy/split}}, {{upkeep/split}}, {{initiative/split}}
Since the infobox templates gain quite a bit of logic in order to support switching game modes, some of the logic is moved to the templates that will be called.
The subpage template includes the parent page for each game mode with the correct value.

Templates[edit]

Demo templates[edit]

Demo pages[edit]