* Code clean up in preparation for enabling linting in the future
* Update code to use latest code conventions and best practices:
- Make use of jQuery.Event (e.g. no need to check both e.keyCode
and e.which)
- jQuery: .size() -> .length
- jQuery: (where appropiate) .attr() -> .prop()
Setting properties like 'checked' via attr() has been deprecated
in jQuery.
- Whitespace
- Single quotes instead of double quotes
- Use literal keys in object literals instead of strings
- Pass mediaWiki to closure, use mw. locally instead of "mediaWiki"
global directly.
- Fix indentation
- Brackets around if, else and for bodies
- Strict comparison to 0, null, false, true etc.
- Fix missing radix parameter in parseInt
- Use local $ instead of global $
- Use `foo || bar` instead of `foo ? foo : bar`
- Variable scope hoisting
- Double/redundant variable declarations
- ['foo'] is better written in dot notation
- New line at EOF
- Consistency in jQuery construction:
Tag name for element creation $( '<div>' )
Valid html for html parsing $( '<div foo="bar"></div>' )
- Fix regex escape warnings per JSLint/JSHint.
Do escape ][, don't escape ><
- ..
* Add .jshintrc / .jshintignore
* Updated most files, but not all. Too much at once.
Change-Id: I445639b25a9688b3cdf9e5449e3d31cbcfa9c7ae
The characters are detailed in the bug report.
Patch set 2:
* Amended commit message with bug number.
Patch set 3:
* Added comments to the Cyrillic section for readability.
* Added dotted circle to Palochka to differentiate from I.
* Moved the newly added Ѐ and Ѝ near Е and И.
Change-Id: I2d944926e2769f8691626190259d2466c0e2a8ec
To allow users navigating the text markup buttons by keyboard
the span tags have been replaced by anchor tags. Also a dummy
link target has been added to make sure screen readers recognize
these tags correctly.
Change-Id: I9ec1543f3a39b57452d72067cf85b11e9351f546
Added support Devanagari characters in the WikiEditor. This includes all
characters as per http://unicode.org/charts/PDF/U0900.pdf
Change-Id: Iecab40aaf024c4ee40db142373ee94d90507b9c2
Original support for RTL here was written before ResourceLoader, now
ResourceLoader handles it and this special code for RTL shouldn't exist
:)
Long time ago some css specific for RTL was added for supporting RTL with
body.rtl (before ResourceLoader). However now it is not needed as
ResourceLoader already flips right/left, and moreover it even causes wrong
direconality as ResourceLoader flipps the special handling for RTL.
Changes:
1. dialogs buttons were on right (in English buttons on the
right side too) => now on left side
2. Title of dialogs was in left, and close on right => now title is on
right and close on left
3. Link dialogs: the "Target Page" and the icon for "Broken/Good link" was
flipped
Change-Id: Ia85dfcfcea5945d088cffc4da6198fa506933f81
Instead of wiping the old toolbar out on the server side we now just wrap the old toolbar in a div that has an inline style that prevents it from being displayed. This is only done when the toolbar is enabled. When the toolbar code runs on the client, if the toolbar ends up being incompatible, the old toolbar's wrapping div is shown. This avoids the side-effect of the old toolbar showing up momentarily while the new toolbar loads. It's a dirty hack, but we explored this extensively and it's the least evil way we could come up with that worked consistently.
Change-Id: I6fefadea4dbd01b96a0b95c50bc9ef526144dc3c
This makes jquery.wikiEditor.toolbar.config.js pass jshint (the
command-line jshint from npm that is)
Change-Id: I74d353c956c2b9616a9f80e10d5309ae9ee544db
New characters are added and existing characters are reordered
according to comments received from the Gujarati Language support
team.
Change-Id: I769594ec1088d2c3326477a3f1065d576c6dcdf7
The diacritic is supposed to appear after the dotted circle. It is
already like this in other languages.
Change-Id: Id157ab58ae41bd6e8f78c26b35b65003abc7bf7a
Will now check if character is defined and will return empty string as result instead.
Added a mw.log to catch this situation for developers.
Based on patch by User:Lupo.
Bug 31673
Submitter's comment: "Replace next" now replaces the currently selected text instead of finding the next occurrence and replacing it. To keep the location of the current occurrence, i added matchIndex to $(this).data.
I added some comments renamed a couple of variable for readability:
* s to textRemainder
* replace to actualReplacement
This is my first significant jQuery-style patch so it may have embarrassing mistakes - constructive criticism is welcome.
Split the Arabic section in jquery.wikiEditor.toolbar.config.js into Arabic and Arabic extended. Arabic contains the core 28-letter alphabet, special letters for the Arabic language, vowels, punctuation and digits. "Arabic extended" contains most of the other letters and signs that are used by languages such as Arabic, Urdu, Balochi, etc.