Page MenuHomePhabricator

Consolidate popup types
Open, MediumPublic

Description

The popup extensions contains different popup types. Some elements (like the settings icon) are used (or could be used) in more than one type.

All shared elements should also be shared in the code and not copy pasted (like currently in T234205).

Advantages: simplified maintenance, easy reuse of elements and addition of new types

Current types: reference preview, page preview, disambiguation, empty

popup_types.jpg (552×1 px, 96 KB)

Elements (all optional):

  • header: icon & title
  • content: text & image
  • footer: text/link & cogwheel

Possible implementations

  1. Extend existing function renderPreview() to include needed options like cogwheel and title icon.
  2. Create structure of the popup in html and fill data with shared js functions. Example in html and pseudocode:
<title>
 <img class="icon"></img
</title>
<div class="content"></div>
<footer>
 <div class="settings"></div>
</footer>
...
if($(.settings)) addSettingsCogwheel()
...

Event Timeline

Jdlrobson added a subscriber: Jdlrobson.

FWIW I think longer term we hope to port this code to the Vue component library, but given our current commitments, I don't think we (readers web team) can provide much assistance with doing this right now.

ovasileva triaged this task as Medium priority.Feb 22 2021, 1:41 PM