Skip to content

Commit

Permalink
block: Add support for partial blocks
Browse files Browse the repository at this point in the history
Closes wikimedia-gadgets#802.

- Move partial field to block options, better place
- Select partial block template and hide article if partial (MA smart as fuck, use pageparam and reasonparam)
- add hidden partial to field (helps build query and preview)
- Build rest of query
- Add defaultToPartialBlocks preference option
- Only show tooltip if partial
- Add checks for no talk editing and noemail/nocreate
- Don't disable partial block button, can add pblock template
- Better previous block log message
- Use a global variable for formatted namespace.  Empty string no good; Morebits.wikipedia.namespacesFriendly previously handled this, removed in wikimedia-gadgets#600

Use select2

This system needs multiple user inputs, which can't be done nicely with chosen (See harvesthq/chosen#166).  Can use select2's tags system.

Can't stop multiselect from showing dropdown:

- the empty string is awful
- minimumResultsForSearch: -1 doesn't work, nor does infinity
- dropdownCss and dropdownCssClass require the full version (https://stackoverflow.com/a/22138303/2521092)
- css stuff applies to both(?) absent the above
- dropdownParent: $form.find('[name=pagerestrictions]') weirdly works (puts it somewhere invisible?) but breaks scrolling without a visual cue
  • Loading branch information
Amorymeltzer committed Jan 22, 2020
1 parent 3501e6c commit a51d4ca
Show file tree
Hide file tree
Showing 3 changed files with 202 additions and 25 deletions.
Loading

0 comments on commit a51d4ca

Please sign in to comment.