Commit graph

44 commits

Author SHA1 Message Date
Fomafix 169c4bfb7d Fix whitespaces for JavaScript and CSS
Change-Id: I3f6bf0d9e788cdca19b2b699fcb0a7b5ceab2a93
2015-01-13 09:14:53 +00:00
Alexander Jones 55c6e1271f Add QUnit test for ext.wikiEditor.toolbar
This patch replaces the manually operated test module for ext.wikiEditor.toolbar
with one based on QUnit. The new test suite uncovered a bug with the removeFromToolbar
API function in jquery.wikiEditor.toolbar, which prevented the removal of select buttons
from the toolbar. This issue has also been fixed in this commit. .jshintrc was updated
to ignore the new QUnit global.

Bug: T39485
Change-Id: Icef3debcffa484a8d78628bcd9da0892b750bb40
2014-11-29 14:12:26 -06:00
Derk-Jan Hartman 44c56d482c Convert from show()/hide() to using classes
jQuery's show/hide/fadeIn/fadeOut methods makes changes to the
style attributes of elements. That makes them rather hard to override
their visibility, without adding an entire API to the module to do so.

This replaces the default animations with one using classes to control
visibility and only animates the animatable properties using
the style attributes.

Follow-up to: Iadaae3fb9ae1899e12605d653b2688616b8f7c40

Change-Id: I4652ade66c6de864ee3e74b3817ed9b93967ce3d
2014-05-23 16:06:16 +02:00
Timo Tijhof b965e0af4f jquery.wikiEditor.toolbar: Clean up target variable
Follows-up 5667dfcd54.

Change-Id: Ib2365aa6ab626717d346ab2e299c174bebfff506
2014-05-09 12:26:15 +02:00
Derk-Jan Hartman 5667dfcd54 Repair removeFromToolbar() to handle image buttons
Bug: 29440
Change-Id: Ic30af1a1d5842a8f330344eb4a10ecbdc2606fc5
2014-05-05 09:06:57 +00:00
Fomafix cfcfa69fe4 Apply coding conventions for JavaScript
Change-Id: Ibae64ca7aa52c2283ff81bd942be80c83a4089f7
2014-04-30 10:59:01 +00:00
jenkins-bot 4ccd57d34c Merge "Fix broken span of label in WikiEditor toolbar" 2014-04-07 22:08:02 +00:00
Derk-Jan Hartman 6c6c92444d Fix broken span of label in WikiEditor toolbar
Bug: 47506
Change-Id: If2146b20319c76fcd0081d4e5e0beb6016a681ed
2014-04-08 00:01:03 +02:00
Derk-Jan Hartman eb74ecddcd Toolbar: use CSS instead of valign on toolbar table
Bug: 39726
Change-Id: I31f1e685052f8f9eef9061564a75fd022c95281a
2014-04-07 17:39:48 +02:00
Derk-Jan Hartman 952d6b9d8f WikiEditor: Remove unmaintained beta iframe mode
Change-Id: I2d7369116b92d674d791e420750a906a17a46bac
2014-04-03 17:20:49 +02:00
Derk-Jan Hartman 9bb94e8319 WikiEditor: Remove old unmaintained ToC module
Change-Id: I0f53a68e50fc950d7f407ee81b2bf0d81ef4948d
2014-04-03 17:02:32 +02:00
Derk-Jan Hartman 39e3676b35 Revert "Remove unneeded show() in WikiEditor toolbar"
because apparently we do have empty tools boxes. Alternative
implementation in I4652ade66c6de864ee3e74b3817ed9b93967ce3d

This reverts commit dd46fc383b.

Change-Id: I358c34d63261989d49b0a4156cbc05b544727d5c
2014-03-24 22:30:55 +01:00
jenkins-bot 4291b563c2 Merge "Remove unneeded show() in WikiEditor toolbar" 2014-03-22 01:55:19 +00:00
Thiemo Mättig 772e39caf2 Unify coding style of jQuery( '<element>' ) calls
According to the jQuery documentation (and code) all kinds of
$( '<element>' )
$( '<element/>' )
$( '<element />' )
$( '<element></element>' )
are identical. So yes, this patch does not change anything. All it
does is removing characters that are ignored anyway. Using the same
style everywhere makes the code easier to read and understand and
may save a few bytes when it is gzipped.

The current WikiEditor code contains 67 usages of that jQuery call.
Only very few of them are not in the most simple <element> style.

Personally I consider the style <div/> confusing since a <div> can
not be a void element.

Change-Id: I816b4cccc9ee329e9bcdd9bd2353e5653fd10c36
2014-03-17 22:11:12 +01:00
Derk-Jan Hartman dd46fc383b Remove unneeded show() in WikiEditor toolbar
This line forces sections to be visible after you edit the toolbar.
There is no apparent reason why this should be necessary. It has been
in there almost from the start, but doesn't seem to be used

Change-Id: Iadaae3fb9ae1899e12605d653b2688616b8f7c40
2014-03-16 23:48:14 +01:00
Timo Tijhof 1a2daca06a Kranitor: Make JSHint pass
eqeqeq:
* Change loose comparisons to strict comparisons where
  it seems safe to use a strict comparision instead.
  Mostly comparisons to strings or objects, and comparisons to
  numbers where the other value is known to be a number, too.
  E.g. foo == 'string', bar == node, indexOf() != -1.
* Add eqeqeq:false to files where there are non-obvious usages
  left.

onevar, quotmark:
* Disabled in files with lots of style violations.

unused:
* Remove unused variables that have no side-effects in their
  assigned expression.

Coding style cleanups on affected lines where trivial.

Change-Id: I5db155a632740e24cb52dba2177c7fc35d5aebd5
2013-11-10 07:36:03 +00:00
Marius Hoch 8679bfab53 Make edit toolbar accessible to screen readers
Removed redundant attributes, added aria-* attributes and properly
declared the links with role=button.
Tested with JAWS 14 and NVDA.

Bug: 24592
Change-Id: I27e18798d18b63655ea716eee2be1c7ab5303759
2013-08-19 12:18:22 +02:00
Trevor Parscal 17a90bc74e Make toolbar group labels spans instead of divs
The mix of <div> and <a> tags, being floated left inside a floated left
group seems to cause a flow error in some browsers, which ends up
wrapping the last item in the group. The give-away to what was going on
was that this only happened for groups with labels.

While diagnosing it, I notice that the bug did not occur if the labels
were hidden (suggesting is has something to do with the label being
included in the flow of the group, not the build-out), and converting
them to spans fixed the problem.

Bug: 27698
Change-Id: I2a842a86ef77a8934095c04408b7fabbcfbb2476
2013-04-08 10:55:07 -07:00
jenkins-bot d33ec49f0c Merge "Remove ClickTracking calls" 2013-03-27 20:57:18 +00:00
Ori Livneh 61205be62a Remove ClickTracking calls
ClickTracking is deprecated; the config var gating this behavior is set
to false; the data is going to /dev/null; no one is interested in
analyzing it. I think it's dead, Jim.

Change-Id: I71ea8c174e5e38b28f128ccd380ed2a25ad50606
2013-03-27 13:41:05 -07:00
Matthew Flaschen ede8d1d8f1 Add jQuery event trigger for when the initial sections are done
* This is similar to wikiEditor-toolbar-buildSection-*, but for when
all of the initial sections are done.
* It allows other code to render after this vertical shift is done.

Change-Id: I4705d09b9ef90c1ab8dad93db3f91e70c5fd4d5b
2013-01-28 23:05:48 -05:00
Kaldari 27013f26e5 (bug 40735) Enabling editors to distinguish dashes in the WikiEditor
Right now, the Special Characters interface in WikiEditor shows all
characters in a monospace font which makes it especially difficult to
distinguish the different dash characters. The solution implemented
in this change is to add title tooltips to the following characters:
en dash, em dash, minus sign. The title tooltips are localizable and
can be added to any other characters as needed. If we eventually want
to add title tooltips to all the characters, we should come up with a
config shortcut like we're using for Hebrew vowels.

Change-Id: I7eb207acda045a868ec4c625c39bfd3d1f78ea17
2012-10-16 16:26:04 -07:00
Eranroz e63ef419f0 (bug 37484) Update removeFromToolbar to select <a> instead of <span>.
* Follows-up fbd5ef001b.

Change-Id: I95eb21ca29a2520b092d6f75ccea98f6f0d1bc32
2012-06-25 20:42:25 +02:00
Kai_Nissen_(WMDE) fbd5ef001b (bug 34847) Changing span tags of buttons to anchor tags
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
2012-06-02 13:50:43 +02:00
Amir E. Aharoni 80067e8620 Making ltr default for characters.
Without this some conjoined ltr characters look weird in rtl wikis.

Change-Id: I7f38a18fd0d9728f69c63abd77b095a34cffbcb2
2012-05-20 23:27:06 +03:00
Roan Kattouw f26acc15c7 Add a configuration variable for disabling tracking clicks on the toolbar buttons 2012-02-23 22:29:37 +00:00
Roan Kattouw 9061f480db (bug 32451) Clicking on a special characters section loses the selection in IE8. Patch by Lupo 2011-11-20 15:02:20 +00:00
Derk-Jan Hartman 6325d5ea3b Harden the toolbar builder for character insertion a bit against incorrect configurations.
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
2011-11-14 21:55:46 +00:00
Derk-Jan Hartman 2c9bbffca7 Make sure a row is closed in the toolbar.
Patch by User:Lupo
Bug 31673
2011-11-14 21:21:15 +00:00
Roan Kattouw a1cec03598 (bug 32374) Heading dropdown disappears behind textarea after closing and re-opening the Advanced section. This seems to be caused by the collapsing animation that sets position:absolute on the section, does the fadeOut animation, then after the animation sets the position 'back' to relative. However, the position was never relative to begin with, so now the absolutely positioned header dropdown has a different closest positioned anchestor and it appears things go wrong from there and cause the bug. So instead of setting the position to relative after the animation, set it back to what it actually was before, which is static (implicitly). 2011-11-12 09:08:00 +00:00
Siebrand Mazeland cc71ec5354 * bump version to 0.3.1
* stylize.php
2011-09-13 08:56:32 +00:00
Derk-Jan Hartman e2f796c8d9 One more fix for the for in loops.
Follow up to r91347
2011-07-07 20:54:24 +00:00
Derk-Jan Hartman f83bb24864 Follow up to r91349
Missed adding quotes to two of the [rel=]
2011-07-03 22:42:28 +00:00
Derk-Jan Hartman 6f6e7d0565 Adding quotes for the [rel=] stuff, since this broke one test.
Reported in bug 29106. Patch by Michael M.
2011-07-02 09:17:01 +00:00
Derk-Jan Hartman 3cae03cef5 Correct for in loops on arrays.
Reported in bug 29106. Patch by Michael M.
2011-07-02 09:09:05 +00:00
Derk-Jan Hartman c1edd49986 Clean up some global var leaking in WikiEditor toolbar
Reported in bug 29106. Patch by Michael M.
2011-07-02 08:54:01 +00:00
Krinkle 40bb0c72b5 Extension:WikiEditor Code quality, JSHint validation and JSPERF
- Leaked globals
- Strict comparison to 0, false and ''
- Missing semicolon
- Variable name collision
- Minor improvements in caching (in a few places "var $that" cached $(this), but wasn't actually used)
- Replace calls to deprecated $j with $
- Checking undefined by strictly comparing references instead of a string comparison and typeof (speed)

(see bug 29106)
2011-06-06 23:18:13 +00:00
Roan Kattouw 63e9d0ff85 WikiEditor: (bug 27698) Toolbar height isn't updated in all code paths of addToToolbar(), causes toolbar to overlap part of the edit box if certain race conditions happen. Patch by Salvatore Ingala 2011-05-13 14:34:43 +00:00
Trevor Parscal ada78c1546 Fixed annoying bug where the index would not highlight the current page the first time you open the booklet. 2011-01-10 23:45:03 +00:00
Trevor Parscal 49eb154f2c * Fixed mistake made in r74271 where some functions were moved from core jquery.wikiEditor into jquery.wikiEditor.iframe, causing errors for textarea mode. These changes properly split the functions, allowing the iframe to override the textarea functions, and using $.client to only execute them on IE. (tested in IE7)
* Also fixed IE bug, where "delete window.myThing;" fails but "delete myThing;" succeeds.
2010-10-05 20:54:38 +00:00
Trevor Parscal cb6ff96431 Got more dialogs working again 2010-10-04 21:08:41 +00:00
Trevor Parscal 0a0f6f6e8e * Fixed the toolbar, where sprited buttons weren't receiving the correct classes.
* Changed the way dialogs toolbar buttons were being added
* Made dialog code load on the fly
2010-10-01 21:58:04 +00:00
Trevor Parscal 8be53e71af Merged in changes from r73123 2010-09-16 17:22:23 +00:00
Trevor Parscal 9d278e8dee Copied over all the resources needed to make WikiEditor stand on it's own two feet. Lots more to do as far as organizing and fleshing out the extensions's PHP bits. 2010-09-15 03:08:35 +00:00