This was used for setting incremental tabindex attributes
on the <button> elements of the "Find and replace" dialog
as opened from the "Advanced" toolbar section. I was unable to
find a difference in behaviour with and without this code running.
Both with and without this, when tabbing from the first input
field in the dialog, the buttons are in the tab order after
the input fields (matching the visual rendering). Unclear
what this was doing.
This re-applies commit 81b08daa48, which was reverted (5f356b1a),
because I forgot to remove the calls in dialogs.config.js.
Bug: T234581
Bug: T235701
Change-Id: Ic51074c3d2b2e9b9b050c9f42862519a3e78af16
This was used for setting incremental tabindex attributes
on the <button> elements of the "Find and replace" dialog
as opened from the "Advanced" toolbar section.
I was unable to find a difference in behaviour with and without
this code running.
Both with and without this, when tabbing from the first input
field in the dialog, the buttons are in the tab order after
the input fields (matching the visual rendering). Unclear
what this was doing.
Bug: T234581
Change-Id: I5de97733091d0e123913f272b00784205d69267f
Also, clean up the invalid logging of some prefixed schema items.
Depends-On: I79e04dda6323ebb05b129bb96c0323db112bcdd0
Bug: T229079
Change-Id: I73eae25d83b8d3f73128d3b800b267a8288a76e8
This appears to have been an oversight in the above change. Since the magic
words variable was no longer set, magicWordsI18N became null which broke
things, and caused whitespace info to not get recorded, which broke the
ability to handle the dialog being submitted too.
Bug: T230078
Change-Id: I5c44ed348de6ac2363d3d789b38053caa3935f62
This allows us to bundle the wgWikiEditorMagicWords and
mw.msg.wikiEditor(?!) config vars that were previously exported globally
in the startup module.
This code is old and crufty, so this is a somewhat minimal conversion:
* Use require() for jquery.wikiEditor.{dialogs,toolbar}.config.js,
and for jquery.wikiEditor.{dialogs,toolbar}.js
* Don't attempt to convert jquery.wikiEditor.js to something
require-based, instead just run it and let it set the $.wikiEditor and
$.fn.wikiEditor globals
* Consolidate ext.wikiEditor.{dialogs,toolbars}.js into
ext.wikiEditor.js
Bug: T222828
Change-Id: Ia75d685cbde786e8fceb6db36f2436b2beea1499
This commit adds a function to parse image syntax selected in the
editor and uses the parsed data to automatically fill the fields
of the WikiEditor image dialog. Surrounding whitespace in the
selected wikitext is now included in the result. This causes an
issue with the ownline option in line 840, which appends an extra
line regardless of the post text.
Bug: T40829
Change-Id: Ib117a2e6350400f9298d4892a00981ac41f3dbbf
Also, avoid distorting the logging of abort when VE is switched to from
WikiEditor. Log it immediately, rather than waiting until the end of the VE
session triggers a page-unload.
Bug: T221191
Change-Id: I3ddccd8df973a289f3bcdc4cdc42df1ab23ce6a4
These modules are deprecated and will be removed, see parent task for
details and deprecation information.
Bug: T223286
Change-Id: I72a1ab68f94842b2fa9bcd84c21ea736a48e0614
Similar to makecollapsible.. Played around with CSS transitions, but
due to the non-predictable and variant sizing of the section elements
isn't really worth the trouble in my opinion.
Also was an accessibility issue on the select (header) dropdown.
Bug: T210671
Bug: T175379
Change-Id: I6fa476645bae7f0e1b01c563c4395e2af003c2c5
This bumps the extension to requiring the 1.33.x releases of MediaWiki,
which are currently in alpha.
Change-Id: I55f77294d271c81f510ce54181a24435b840d3d2
Depends-On: Ib2faa22c429096d545ddb829a6b4025427ad6071
When you use replace, before having used find, matchIndex gets out of
sync with what replace is expecting and encapsulateSelection won't
have a selection and thus defaults to position 0.
Bug: T76750
Change-Id: I1dcc724e7548690a3cc63672f93a3099c028f123
The old S&R implementation introduces problems with regexes (T58228 and
T50614) and is also rather slow. At some point in the past it was faster
to do multiple search/replace actions using textSelection perhaps, but
with current browsers doing a one shot replace will perform much faster.
If you have CodeMirror enabled, there will be a delay after replacing
all content on a major page, but no worse than the original page load
one, which I think is acceptable.
Bug: T58228
Bug: T50614
Bug: T25510
Change-Id: Ifab1d071d9f09ec55aa6556b5dca04378c4e5273
1: reftoolbar is used in more advanced situations
2: it doesn't actually do much
3: leaner
Keeping it in the same file, because that will preserve order. seems
safer.
Change-Id: I9bb2cf1e8731d12551a00b717b11602e6192d299
Use proper placeholder attribute instead of faking it with a value.
This predated even jquery.placeholder and is no longer needed.
Also fixes a bug where it was checking with the API for the existence
of the placeholder value.
Bug: T133716
Change-Id: I290ec48f6b1d250da28efffd7ebdb6b681c0227e
At the default line-height the background image tends to
get clipped. Set it to the same line-height as the adjacent label
and both the label and the icon are aligned and the icon won't be
cutoff
Bug: T193480
Change-Id: Id94ba02a305a5150ad5b266bb0e2bb01b8a637ac
CodeMirror forces WikiEditor to load. While CodeMirror handles readonly
textareas, the WikiEditor toolbar doesn't. CodeMirror and
syntaxhighlighting is pretty useful in readonly actually,
so I'm making WikiEditor a tad more resistent against readonly mode.
Bug: T188817
Change-Id: I927a780e1aea86a19750387f530bad84b1ff5ef4
The schema itself is being renamed, and many of the field names are
different.
Bug: T207803
Depends-On: I2949c9782669b75cf17978698c8cef21fdee6dea
Change-Id: I07d9bc1530005914043911b7906c1602522c9162
Respect the config var exported by WikimediaEvents that, if set to true,
forces oversampling. When oversampling, all events are logged even if
they would have been sampled out. The isOversample property is set to
true if the event was oversampled and would not otherwise have been
logged.
Bug: T206543
Depends-On: I5fdf5fdd2dc0d99a0a0d7eb7ab2e3dce4798009b
Change-Id: I7e504884a888c4d080cd4762549b72489126ed65
Instead of hard-coding the 6.25% sampling rate, allow it to be
controlled by the config variable in the WikimediaEvents extension
(which also defines the RL module for the Edit schema).
Also use sampling code from EventLogging so we can configure the
sampling rate as a number, rather than using a hex-digit based strategy.
Bug: T206543
Depends-On: I00383cec62f6c2a0137b329565b0ca84bfbb223f
Depends-On: Ib746fc708e7b752cebc5fd8d080e40819dfa34f3
Change-Id: I2956efc9294768742dd49dcb36770f0509e4090f
The only use of raw HTML messages is in the help panel, which is the only user
of `layout: 'table'`, so we can replace all other callers.
Bug: T154891
Change-Id: I2df3ec8c05d4daaa094378354566356a822c081f
A new toggle tooltype which makes use of ToggleButtonWidget in order
to provide proper accessibility for all buttons that require on/off
state
Bug: T198781
Change-Id: I8b7fd41571a48fa4f6560790d94bb966972e740f
Replaces the insert and advanced-insert groups, which
are currently multi-colour icons.
Drops the button-sprite + offset mode, according to
mwgrep there are no other users of this.
Bug: T191031
Bug: T143508
Change-Id: I7032f98908a591ea5c9d3dbbb7616e2c10bbfc80
There is quite low contranst between dialog
background and the overlay, so it makes sense
to just leave the border, which is consistent
with MWUI dialogs in OOUI.
Change-Id: I90ad752b91d15a25e8b36d43df44ac56df75cd9c
The backgorund colour is more selectively applied
elsewhere. This just causes problems if the skin
sets <textarea>s to transparent (e.g. Minerva).
Change-Id: I6695dc5af9224238efdc3eac97817010cf52237d
Five tools are registered in toolbar.config, then overridden
in dialogs.config with more advanced verisons. As the dialog
module is no longer optional, the simplified versions are
no longer accessible.
Change-Id: Ib66025d209a36fb821c5619cbfe63330fb6c9a1f
mw.Api uses U+001f as separator when the title contains a '|'.
This is activated by using an array instead of a string.
The local check for an invalid title because of a '|' is not necessary
anymore.
This changes requires MediaWiki 1.28+ which is already required.
Change-Id: I8450c478d42158f064bf5309efae6bd1d81244ea
This allows them to use the natural text direction which will
be right-to-left for right-to-left alphabets.
Also fix bottom padding to match top padding.
Bug: T56310
Change-Id: I7b2ebf9d1682fe827517fc959618531c904c94ca
Make sure messages are escaped and not feed on raw html
before inserting into the group.
Also, updated the minus-x version to 0.3.0.
Bug: T154891
Change-Id: I12e5dc03396fa8bed9beb362ae91a77e64646113
These were always jointly loaded, so they just bloated the module table
to no benefit.
Bug: T165112
Change-Id: I51745e84d6b840a18d84385dfb5ea4f96ada311d
These features were ideas in the Usability Initiative but were never
finished to the level that they would be deployed on Wikimedia wikis
and have been marked as "going to be removed" for years. Now is time
to act on that promise.
Change-Id: Ia1eb91d2dfb1979518d97badc1477146b4606f7c
This change duplicates the Change-Id: Ie3615866 in core and is needed to load
the module 'mediawiki.toc' since Change-Id: Iaad84d24.
Change-Id: Ie667e97737acb66a8efcb299bc081b9577ae24d6
The module 'jquery.tablesorter' is already loaded a few lines above.
The previous situation depends on a race-condition of the function is called
or not.
Change-Id: If6777fcc7d9d49604eb78b6d233a32898fc82446
jQuery .unbind() is deprecated since jQuery 3.0.
https://api.jquery.com/unbind/
The deprecated jQuery .bind() was aready replaced by .on() in 7769baa5.
Change-Id: Ia03d7a26754cc26345d9551d740719c43f598995
> JQMIGRATE: jQuery.fn.bind() is deprecated
> JQMIGRATE: jQuery.fn.size() is deprecated; use the .length property
Note that bind() is not removed in v3, merely deprecated.
Even after the jQuery Migrate phase, it will continue to work.
size() was removed in v3 and works only during the Migrate phase.
https://api.jquery.com/size/https://api.jquery.com/bind/https://jquery.com/upgrade-guide/3.0/
Bug: T124742
Change-Id: I6bbd8f829ecf987228c6a5abd32c84e4e088a9bd
The "Upload" button is now displayed on the left side of the dialog,
which make it clear it's a "secondary" action. "Insert" is on the
right, like all jQuery UI buttons, and the primary action.
Unfortunately jQuery UI doesn't give us a lot of styling options for
buttons or dialogs, even this is a bit of a hack.
Bug: T135917
Change-Id: Ia64229b880653668c11787744c177f6c91900382
The loading of the diff styles get lost in 6627f2cd.
In MediaWiki 1.28 the name of the module was renamed from
'mediawiki.action.history.diff' to 'mediawiki.diff.styles'.
Bug: T142845
Change-Id: I86ed2a0568c6bc4e81819633a295cec2e8924215
This avoids part of the reflow that occurs when the WikiEditor has
finished loading it's toolbar, by reserving 33px above the textarea.
I will still reflow to uncollapse a Advanced or Help section of
course, but there is only so much we can do.
Bug: T125843
Change-Id: Ibadea803bdfde9f88cff082b043ed58a05ed75a9
- load jsconfigvars
- trigger the hooks for wikipage.content and wikipage.diff
- rvdifftotextpst for diffs
- improve section support
This module is not used within WMF, but has some users amongst 3rd
parties.
Change-Id: I7f0b2de4a984d811ccd94149670390929a6182f6
When quickly clicking on a tab (the same one or a different one) in the
toolbar the new animation is started immediately even though previously
triggered animations might still be running. This leads to potential
issues as reported in T106993 bug report.
Make sure to stop previous animation first before issuing a new one.
Additionally 'resize' trigger is under racing conditions when
expanding/collapsing tabs, and needs to be invoked explicitly on any
size-change event (cannot rely on the fact that the last issued animation
will trigger last).
Bug: T106993
Change-Id: I874dd7cb9f2fe96e3a6493508cbae4de56f7a6c0
Since e8d37102 the loading spinner is not visible, because all actions
relating to it are in the same render step of the browser.
The loading occurs fast enough now, that we also don't want to show an
intermediate spinner.
Change-Id: Id2a3584deed2ecde807d8f354341dd6868b10009
Zopfli is the most efficient DEFLATE compression algorithm, trading run-time
performance for file sizes that are typically 3-8% smaller than those produced
by zlib with the maximum compression setting. Its output is Deflate-compatible,
so no specialized decoder is needed.
This change was created by running zopflipng against all the PNG files in this
repository. The exact invocation was:
git ls-files --exclude-per-directory=.gitignore -- '*.png' \|
parallel zopflipng -m -y {} {} \;
Files which zopflipng was not able to compress more efficiently were left unmodified.
Bug: T127608
Change-Id: I56c6870e86f9b359fc8c025caf6917560ebb606b
Zopfli is the most efficient DEFLATE compression algorithm, trading run-time
performance for file sizes that are typically 3-8% smaller than those produced
by zlib with the maximum compression setting. Its output is Deflate-compatible,
so no specialized decoder is needed.
This change was created by running zopflipng against all the PNG files in this
repository. The exact invocation was:
git ls-files --exclude-per-directory=.gitignore -- '*.png' \|
parallel zopflipng -m -y {} {} \;
Files which zopflipng was not able to compress more efficiently were left unmodified.
Bug: T127608
Change-Id: Ic0aa0017f97411a282b54d51217a019871a93433
With formatversion=2 the JSON response uses UTF-8 instead of escape sequence
with hex for encoding of non-ASCII characters (e.g. "\u00e4" for "ä").
The JSON response from formatversion=2 has some structural improvements.
This allows a simplification of the processing of the response.
The parameter indexpageids= is not necessary anymore.
Change-Id: Ic08c8ba46b7529952c0fb2f04564b458b55112fd
strings
* This avoids escaping of double quotes.
* Exceptions: "''" and "'''"
* https://www.mediawiki.org/wiki/Manual:Coding_conventions/JavaScript#Quotes
Set "validateQuoteMarks": { "mark": "'", "escape": true } in .jscsrc
This tests for single quotes but allows double quotes to avoid escaping.
Change-Id: Ibd32a63c4c97a7ef8938c6d2dff83b952cfca43e
* Follows-up 6a73d06 by removing the hardcoded SITENAME regex.
* Follows-up 1b797b7f6a which introduced this regression in the first
place. This is exactly the reason why mw.msg() defaults to format
'text' instead of 'plain' without transformations.
Change-Id: I7f1b877710fb6baa45b83054d1e30a24979b37b4
Currently sections of the toolbar can be built deferred. This
is done for the help section and the special characters. The
disadvantage is, that you can't modify such sections before
they are really loaded.
This patch modifies the behavior by doing the following:
* Toolbars are always built directly. After all, deferring isn't
used there anyway in the standard configuration.
* When a booklet is requested to be built only when it's needed,
the index and all pages will be built immediately, only the
content of the pages is deferred and built only when it is
needed.
Even on slow machines building all pages immediately doesn't cause
noticeable pauses, in fact, opening a page with special characters
seems even faster because only the page you need is built, not all
pages.
Since all pages exist from beginning, you can remove and add pages
from user scripts. It is still not possible to modify an existing
page (add or remove a row to a help page, add or remove a character,
unless it is the page that was opened last time), but this is something
that shouldn't be needed very often, so it should be acceptable that
it still doesn't work.
Bug: T25479
Bug: T70791
Change-Id: I0e61b1fd4f6139a251e53a1fac28b3821bc6b860
Move the HTML for the dialogs to separate template files,
using the template mechanism from core.
It is still possible to specify the HTML directly as before,
to be used in gadgets etc.
Change-Id: Ia7ad5aaa9cac429d1c9d706bdf6760e3eda358bc
Per T42972, the current hidesig implementation is broken, and only
hides the signature button in namespace 0 regardless of the value of
$wgContentNamespaces.
Seeing as the old implementation of hidesig was broken, I don't really
think backward compatibility with old configurations is a useful
concern here. In particular, hiding of the signature button is no longer
able to be configured in Special:Preferences (why such a trivial pref was
ever able to be exposed to users, I don't know).
Bug: T59727
Change-Id: I596fd435bc9be8c37da43177c1bea90ebff0b2fe
The versions of Opera that this was targeting aren't really supported
anymore anyways. So let's just remove this hack.
Bug: T106574
Change-Id: I1b11fc8ec30f3c33b681daff7f676fa965fb78cb
* Internal links: Show simple example first
* References: Show use of unnamed references
* Discussion: Use --~~~~ for consistency with what the toolbar button inserts
Bug: T26128
Change-Id: I08de0ad416727447eccad914c2ade3a93e5a8ae2
When additional booklets are created, or existing removed, WikiEditor
currently stores one wrong cookie for each new booklet. This is because
twice a wrong id is passed as parameter, and because a cookie is set for
the default value. This patch fixes these issues.
Additionally I replaced in the function that needed to be edited a loose
comparison with a strict one ($.cookie will return null, never undefined),
and .size() by .length.
Bug: T27184
Change-Id: Iacc1c71a1e0fc2307a3a28d9c1bb00967ac9827a
* Some users have reported that they did not like the new colour for the wirting. New colour changed back to black.
Author is Roul P
Compressed using https://compressor.io/compress
Change-Id: Ieda03d57197bc6c2dd0361e942a819732876ac36
Replace $.escapeRE from 'jquery.mwExtension' by
mw.RegExp.escape from 'mediawiki.RegExp'.
This change requires MediaWiki 1.26+
Bug: T103993
Change-Id: I5fc19e1313fc6a06726981e0365cea6d00abb5f3
* Re adds svg images that were reverted earler for causing problems.
* Adds some missing rtl svg images.
* Fixes insert-ilink.svg that was causing it to not show in some browsers eg internet explorer.
User Perhelion Fixed the problem in insert-ilink.svg and insert-signature.svg. I just added it to button-sprite.svg.
Related less file adding svg to it is at https://gerrit.wikimedia.org/r/#/c/195529/
Bug: T37342
Change-Id: I14482c7b66901609689bf9ddb67b8d2add937612
Use mw.language.getFallbackLanguageChain() to get the
fallback language chain. This chain currently always contains 'en'
as last element. Remove the last element to prevent a fallback to 'en'.
Reimplement autoIconOrOffset to correctly prefer sprite before icon.
Bug: T87247
Change-Id: I452dd45d20ea4dd542d63274b7aad0272e20ea12
Using document.activeElement at the time of the unload
event as a proxy for whether the user is switching to VE.
Switching to VE is weighed more heavily than whether or not
the user made changes: switching to VE causes abort.type to be
'switchwithout' regardless of whether changes were made; only
if the user isn't switching to VE do we look at whether changes
were made and use 'abort' or 'nochange' as appropriate.
When wgAction === 'submit' (i.e. we're on a preview / show changes
view), it is assumed that the user has made changes.
Bug: T95938
Change-Id: Ic91b87c4fc5b601e1fd98b237100d808e97400bd
Needed because session IDs can be generated on the client
from the unload handler (when the back button is used).
Bug: T95919
Change-Id: Iac921bc36806205fc11ac76154ed8b3890f10d31
So that the ID isn't reused when the user uses the back button
to navigate back to an edit page.
It would be more natural to use pageshow for this, but that
event also fires on initial load. There is a .persisted property
that indicates whether the page was recycled, but that
property doesn't work in Chrome:
https://code.google.com/p/chromium/issues/detail?id=344507
Doing this from pagehide doesn't work either, because that
runs before unload (at least in Chrome) and causes the
abort event to be emitted with the new ID. So instead,
regenerate the ID in the unload handler after the
abort event has been sent.
Bug: T95919
Change-Id: I20a602a7896e75ffa116dcd2c137306ca84164b6