Commit graph

274 commits

Author SHA1 Message Date
jenkins-bot 03e93d626d Merge "Reduce 'Edit' EventLogging schema sampling rate to 6.25% (1/16th)" 2015-06-22 15:00:07 +00:00
Fomafix edbee613fc Support fallback languages for icons
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
2015-06-21 15:42:18 +00:00
James D. Forrester ab9dbac995 Reduce 'Edit' EventLogging schema sampling rate to 6.25% (1/16th)
Bug: T103036
Change-Id: Ib437c2542f9f6ed4d333047383ff66e637b5065e
2015-06-18 16:39:29 -07:00
Roan Kattouw d1270ed4b6 Populate abort.type in Schema:Edit logging
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
2015-05-04 18:15:18 -07:00
Roan Kattouw cc5ca3a2f6 Perform 25% sampling on the client side as well
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
2015-04-28 14:55:54 -07:00
Roan Kattouw 418baf1efa Regenerate editingStatsId on unload
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
2015-04-21 01:01:41 +00:00
Roan Kattouw 1a96528f69 Remove extraneous comma
Change-Id: Ica0bb9f5a266e265647ade4a13e1e1d368c928d2
2015-04-19 15:35:39 -07:00
Fomafix 465d411536 Rework color definitions in LESS
* Use #rgb instead of #rrggbb where possible.
* Use lower case letters.

Change-Id: I390bf23d44bc2d78eb1d2185fd89b94297d1f05f
2015-04-14 21:39:04 +00:00
Alex Monk 596a790d00 Try to unbreak WikiEditor modules
Some very weird issues going on involving multiple wikiEditor instances being
set up on the same textarea element. It's probably a race condition of some
sort and I'm hoping that restoring the modules like this will fix it.

Bug: T93384
Change-Id: I44c9c013993220ab709893d239614552d7b25d46
2015-04-07 19:51:58 +01:00
Fomafix 539dabeeed Escape messages
* Use .text() instead of .append() to add a text.
* Integrate only once used variables.

Change-Id: I62cd1a402fc44d90e746ec79e96a13aa49e7f926
2015-03-28 23:42:47 +00:00
Alex Monk fb4f71a46b Move WikiEditor's special character data and messages out to core
Core part done in If9c5cdbe

Bug: T91608
Change-Id: Ifd0ed245ca9d1209b3dad5334f3fcfca428ceeec
2015-03-27 22:46:24 +00:00
Alex Monk 2b914eeddf Don't try to do event logging if we don't have a stats ID
I found that pages like:
https://pl.wikipedia.org/w/index.php?title=Wikipedia:Strona_g%C5%82%C3%B3wna&action=edit
which load WE dynamically don't have this.

Change-Id: Ib3952f4efbf265dbb0d1e25b2059e1be934565a7
2015-03-20 01:26:31 +00:00
Alex Monk bf15f72dc7 Try to prevent crazy EventLogging entries with no session ID etc.
Seems to be causing errors on view (!) on plwiki, and I would not expect this
to work on non-wikitext pages.

Bug: T93242
Change-Id: I0336a85a2ab4bef1d20086382012047688ffa909
2015-03-19 21:29:57 +00:00
Alex Monk 4d54fa4471 Only do client-side instrumentation on action=edit/action=submit
So we don't break the tests

Bug: T93119
Change-Id: Ib0545f581fd2a845b893a046ab7aa7161e27180e
2015-03-18 23:59:24 +00:00
Derk-Jan Hartman 1514d166e0 Insert link: trim whitespace from the external link
Bug: T25499
Change-Id: I2392ade17d3d4428784c40dabf9ae5e216fbab47
2015-03-16 00:16:13 +01:00
Fomafix 5c36a20623 Move hardcoded parsed thumbnail html from i18n to config
Also update the actual HTML with what the current parser outputs:
* width:104px -> width:102px (2px in addition to 100px image width)
* No more "title" attribute on the outer <a>.

And reduce duplication in the message:
* Re-use "thumbnail-more" message.
* Re-use "wikieditor-toolbar-help-content-file-caption" message.

Change-Id: I25f0763b2274ebdcf681c78af277a9be302350a1
2015-03-14 20:41:11 +01:00
Tiziano Müller 51f3d145bc Reformat the license warning only if available
If the WikiEditor is enabled for Semantic Forms Text Area Input there is
no license warning div around.

Change-Id: I8d39f8d47a73cdc2d4be198061e8f68f22c0c308
2015-03-14 18:10:52 +00:00
Fomafix 83c079ceb6 Reuse variable profile instead of $.client.profile()
Change-Id: I66543bd0838b062bea08ca4b5f4fded41ff835cc
2015-03-14 18:01:58 +00:00
Fomafix d16dfb0ad5 Style code
* Fix errors and warnings from phpcs.
* Add commas at end of lines for arrays in PHP.
* Add space between // and comment.
* Add space between ) and {.
* Use tabs instead of spaces for indenting.
* Break lines in PHP with more than 100 characters.
* Remove double spaces and spaces at end of line.
* Remove spaces before comma.
* Fix some typos.

Change-Id: I9c014bdfa9832fa6a20d0190fe2fc668983d0fb9
2015-03-14 15:49:04 +00:00
Alex Monk ef7c4ce2be Don't try to load edit schema if it's not installed
It would only be installed by the WikimediaEvents extension.

Change-Id: I0a1841ad7639765cedf6294d62104f9aedb36d83
2015-03-12 16:49:50 +00:00
Alex Monk 74da530f2d Schema:Edit instrumentation
Depends on Ib8612626

Bug: T88027
Change-Id: I67f1000d23cb257df29d5d4be8ae85764458e6c1
2015-03-10 14:56:45 +01:00
paladox 3f692d9e15 Convert .css to .less
* This patch convert .css to .less
* Semantic changes are avoided, but there are minor
  tweaks such as capitalization and ordering.

Change-Id: Iebff0f8e3d87bb792093a10d87f33540aca301d5
2015-03-09 21:24:23 -04:00
jenkins-bot 82a290b452 Merge "Skip an old IE 8 bug workaround in WikiEditor on IE 11/Spartan" 2015-02-21 22:36:26 +00:00
Brion Vibber ab2c7e3ce6 Skip an old IE 8 bug workaround in WikiEditor on IE 11/Spartan
An early version of WikiEditor added a workaround for a reported
bug with IE 8 where textarea scroll and selection state was lost
when the contents were modified.

This doesn't seem to be needed on modern versions of IE such as 11
and above and the newer 'Edge' HTML engine mode in Windows 10.

Actually, I can't reproduce it in Windows 7 or XP with IE 8 either
from the original bugs, but just in case it's needed on some particular
version that we don't know about I've only added a check for modern
IEs, which is already in use on other old-IE workarounds in the
module.

Bug: T88875
Change-Id: I25b667a8d8378c417441adee5d97571c71a1c8c7
2015-02-19 21:01:21 +00:00
Brion Vibber 4f8ad57aaf Enable search-replace dialog on IE 11+
The search-replace box in WikiEditor was blacklisted entirely from
MSIE, although it appears to work fine in IE 11 on Windows 8.1
and Windows 10 Tech Preview.

IE/Spartan team specifically requested a fix for this bug; looks like
it's an easy case of adjusting the blacklist with a version component...

(Note that in RTL the dialog positioning is bad, but that affects
other WikiEditor dialogs too.)

Bug: T88875
Change-Id: I4cf1eb76cc8a788cab233fe9ed04aaeba4af5725
2015-02-19 12:55:29 -08:00
Fomafix d67b50eeb5 Remove color overwrite for dialog header border bottom
This changes the color of the line under the hader of the dialog boxes
from #6bc8f3 to the default #aed0ea.
This difference is nearly not recognizable and it is not worth to overwrite
the default color.

Change-Id: I88580ab74fc158ec1a498fc489fbdd9cd5ba897a
2015-02-18 21:27:37 +00:00
Fomafix 6986f8dba8 Remove CSS definition for tables in dialogs
The only dialog with a table is the table creator dialog.
For this table a more specific definition exist in
jquery.wikiEditor.dialogs.config.css
These rules overwrite all here removed definitions except of
  wikiEditor-toolbar-dialog table { margin-top: 0.75em; }
Without this definition the margin-top slightly increase to the
definition from .wikitable with margin-top: 1em.

Change-Id: I0aab246db05cb4330287666f6a71b56d6b88b0af
2015-02-18 20:09:21 +00:00
Matthew Flaschen 736b94f827 Update autoMsg doc for plain call
* Reflect that we're now calling mw.message( ... ).plain()
* Remove vague statement about "may eventually become a wrapper for
  some kind of core MW functionality."

Change-Id: Ibe743162c1f72bb3977ec16e2ba4b023a66e3907
2015-02-14 22:32:35 -05:00
jenkins-bot 51cc8a3d21 Merge "Move style from JavaScript to CSS" 2015-02-08 19:55:44 +00:00
jenkins-bot de5f3932b9 Merge "Allow a resizeable toolbar index" 2015-02-05 12:44:02 +00:00
Fomafix 78bdeffcc6 Use "obj.hasOwnProperty( prop )" instead of "prop in obj"
'constructor' in {}; // true
Object.prototype.hasOwnProperty( {}, 'constructor' ); // false

Bug: T86643
Change-Id: I4356608956d722dc086e6876a53fdd93435c6f0a
2015-02-05 13:34:03 +01:00
jenkins-bot d70fe376eb Merge "Use sprite as button icon where possible" 2015-02-05 12:25:11 +00:00
Fomafix da5c8abe9e Allow a resizeable toolbar index
Change-Id: I329a143e2ee0a21bee4a9b146c28e6e8df58d570
2015-01-29 08:45:08 +00:00
jenkins-bot bca8c3cf69 Merge "Prevent line wrapping for link syntax help column" 2015-01-24 08:01:57 +00:00
jenkins-bot 6433e68160 Merge "Remove style for wpSummary and wpSummaryLabel" 2015-01-24 08:01:03 +00:00
jenkins-bot c9b6a851b4 Merge "Use font-family: monospace, Courier" 2015-01-24 07:59:52 +00:00
Fomafix 17cb22e4f3 Use sprite as button icon where possible
The icon for italic in language 'os' exists in the sprite like for 'ru'.

Change-Id: I126b3fbc2246b485c2b7e8572037447498821e35
2015-01-21 18:31:33 +00:00
Fomafix 342cebaba6 Use font-family: monospace, Courier
Use
   font-family: monospace, Courier
instead of
   font-family: monospace, "Courier New"
like in resources/src/mediawiki.skinning/elements.css from core.

Change-Id: I87145f8254d34b6d00d76f22c3d0819b9ea5839f
2015-01-14 10:26:55 +00:00
Fomafix 5186f34fd3 Prevent line wrapping for link syntax help column
Bug: T33649
Change-Id: Ia814105aaac986e4ba216d68b1a8afaf38ddfdc1
2015-01-14 09:45:55 +00:00
Fomafix 000031fd48 Move style from JavaScript to CSS
Change-Id: I1bf4b886e3b9b789df377dbdd2df94eb80dd61d1
2015-01-14 07:51:24 +00:00
Fomafix 790a1af231 Fix whitespaces in JavaScript
* Use a singe space as whitespace.
* Remove space before colon when not used as ternary operator

Change-Id: I6391bbcf10d26fadf82686d7ff226b773868415c
2015-01-14 07:14:44 +00:00
Fomafix 216a271213 jquery.wikiEditor.toolbar.css: Remove selectors without prefix "cell-"
The selectors
.wikiEditor-ui-toolbar .section-help .page-table td.description
.wikiEditor-ui-toolbar .section-help .page-table td.syntax
.wikiEditor-ui-toolbar .section-help .page-table td.result
are not used. The used selectors have the prefix "cell-":
.wikiEditor-ui-toolbar .section-help .page-table td.cell-description
.wikiEditor-ui-toolbar .section-help .page-table td.cell-syntax
.wikiEditor-ui-toolbar .section-help .page-table td.cell-result

Also add the missing selector
.wikiEditor-ui-toolbar .section-help .page-table td.cell-description

Change-Id: I26a131f269c6d0ee11015e388224dae79de4494f
2015-01-14 00:16:38 +00:00
Fomafix 169c4bfb7d Fix whitespaces for JavaScript and CSS
Change-Id: I3f6bf0d9e788cdca19b2b699fcb0a7b5ceab2a93
2015-01-13 09:14:53 +00:00
Fomafix 90592de211 Remove style for wpSummary and wpSummaryLabel
WikiEditor should not responsible for the style of the summary.

Change-Id: I8a6f3d3b6212a105fa3fa3326eb35c3e7e1e5c0b
2015-01-12 06:57:41 +00:00
jenkins-bot ebb75b8815 Merge "Toolbar: Reset lineheight for character cells" 2015-01-09 23:14:13 +00:00
Fomafix 77fca50876 Use mw.Api() instead of $.ajax()
Add dependency to the already used module 'mediawiki.api'.

Change-Id: I236b3be5f64ac92f6710e5c690b0cc1800ceb1c5
2015-01-07 18:25:47 +00:00
Derk-Jan Hartman 2946fcd56d Remove reference to magnify-clip.png
magnify-clip.png was recently removed from the core styles directory,
but the Help panel of the WikiEditor still references it by way of i18n
message: wikieditor-toolbar-help-content-file-result

Also remove unused local copy

Bug: T85920
Change-Id: Icc17092c0f854360b2f2999b8f153827bf194c0c
2015-01-07 10:19:35 +01:00
Derk-Jan Hartman 4e65f2b204 Toolbar: Reset lineheight for character cells
Bug: T78354
Change-Id: I2f004a29b19d5629ba78a94b4cd26bb91d5a8747
2015-01-06 17:41:16 +01:00
Derk-Jan Hartman 3e04196b79 Toolbar help: Make magic word from help string a param
Instead of having this magic word in the translation message, make it a
parameter of the translation message and retrieve it from
wgWikiEditorMagicWords.

Bug: T40831
Change-Id: Id3155221aa61bc86da2d90000dedab36cbe9dd96
2014-12-08 12:22:49 +01:00
Fomafix bfe2fc6c4e Workaround for a scrolling bug in IE8 on resize
Bug: T63910
Change-Id: I6dacc1ed2f2fdf4ea615a477b711dc78667bae68
2014-12-06 12:40:50 +00:00