Commit graph

3120 commits

Author SHA1 Message Date
Trevor Parscal f8061a97eb Improve truncate and truncateRange to allow negative values
Positive values will move the end, negative values will move the start

Change-Id: I566653664bf2a8a74781f1059a51873ab72560f9
2012-12-11 11:10:22 -08:00
Trevor Parscal abdcacd68a Move the cursor to the end of newly inserted links
Inserted links happen when the cursor is not near a word, so we insert the target as text

Change-Id: I06c2c425d28db7ca61f13c438e25cc9c75f391f4
2012-12-11 11:09:26 -08:00
Timo Tijhof 3a2453b1b2 mw.ViewPageTarget: Move diff button logic, min-height for dialog.
Follows-up Ic77c5ce4 and I9d05ef6e.

Change-Id: I077172d590e53737691020c1265203134eea3c9c
2012-12-11 18:33:16 +01:00
jenkins-bot 64abfff53c Merge "Enable change makers by default" 2012-12-11 07:05:48 +00:00
Catrope 0d5db4eb4e Enable change makers by default
Change-Id: I7b5af42abe81cc5f41dd80692ac5d5ff007f99ed
2012-12-10 22:55:00 -08:00
Catrope 1a195b33e1 And also use a 100s timeout for show changes
Change-Id: I437d125cd1944299991d80f22fdaedd490bcb45f
2012-12-10 21:16:21 -08:00
Catrope 2e6425a16b Set the save timeout to 100s as well
Change-Id: Ic01ffaae2a0c4bbe91bee7705c60f26b7b34d0f9
2012-12-10 20:33:34 -08:00
Trevor Parscal 5db88a3140 Added VisualEditor specific edit notices
Default message used is visualeditor-alphawarning

Configure in $wgVisualEditorEditNotices

Change-Id: Ie56dac47aa825dd7a2eb9f74be486ae4228672c6
2012-12-10 19:41:23 -08:00
jenkins-bot a90f79178a Merge "Hide the show changes button when we are creating a page" 2012-12-11 03:25:50 +00:00
Trevor Parscal 1edd9ad504 Hide the show changes button when we are creating a page
Change-Id: Ic77c5ce4757fd0cf6d7cdd9a991206b649fc2e5a
2012-12-10 19:24:26 -08:00
jenkins-bot dff8570850 Merge "Check if there's a document before we try and set focus on it" 2012-12-11 03:24:05 +00:00
Trevor Parscal c59e6b1638 Check if there's a document before we try and set focus on it
Change-Id: Ia7776c70c2593e4524adab3a347230ee3cccad29
2012-12-10 19:14:43 -08:00
Trevor Parscal c91ef9306c Add left margin to save dialog, visible with show changes
Change-Id: Iaadbfd30f7270fa90dc4adefc9855a55d087ce0c
2012-12-10 19:04:01 -08:00
jenkins-bot 220d07ac43 Merge "Prevent Inspector frame from reloading on close." 2012-12-11 02:56:00 +00:00
jenkins-bot 8d04dd20ad Merge "Fix typo'ed documentation issue with gerrit change 38009" 2012-12-11 02:55:45 +00:00
jenkins-bot 6bb6f6b790 Merge "Throw edit warning on cancel." 2012-12-11 02:55:32 +00:00
Trevor Parscal 99ccfab9f0 (bug 42920) Add the feedback tool
icons, comment.*, ve.ui.Icons-*
* Added comment icon

ve.init.mw.ViewPageTarget
* Refactored editNoticeButton into being just a tool
* Added feedback tool, which shares the editNoticeButton code
* Added feedback object construction in init constructor
* Added launching code to feedback tool

VisualEditor.i18n
* Renamed editnotices-button message to editnotices-tool to match changes in code
* Added feedback tool message

VisualEditor
* Added dependency on mediawiki.feedback
* Updated changed message key
* Added reference to new message

Change-Id: I813c89a505386a9b3206bfbcb176016e28a592cb
2012-12-10 18:47:53 -08:00
Trevor Parscal 1789545284 Adjustments and fixes for styles
* Made buttons use shared CSS code
* Stopped using <button> elements and got all browsers looking the same
* Fixed focus on text area issue - had to let the stack clear first

Change-Id: I6781916822b4173ba906b9bc4c341219fbf10d82
2012-12-10 18:34:58 -08:00
James D. Forrester 00d86d69cb Fix typo'ed documentation issue with gerrit change 38009
Change-Id: I1238001949bae519d49428f98dcdd1428388aa0d
2012-12-10 18:34:37 -08:00
jenkins-bot fafd3c53c4 Merge "(bug 42937) Removing copy/pasted link annotations removes the original as well" 2012-12-11 02:22:22 +00:00
jenkins-bot 9622f24d67 Merge "Create first VE Technical Debt bug entry for tracking, resolution" 2012-12-11 02:14:00 +00:00
Trevor Parscal 29cdbe0ea5 (bug 42937) Removing copy/pasted link annotations removes the original as well
Basically a copy should be a deep copy, so this was a blatant mistake.

Change-Id: I702fb425783293c4ddde8b9ac568dfe6abc8f782
2012-12-10 18:12:55 -08:00
Catrope e5883ac201 Remove FIXMEs resolved in 15c5495255
Change-Id: I03dcf9040bb40e5550e9ff56609d479715904a65
2012-12-10 18:09:49 -08:00
Trevor Parscal 50f89a675e Add recursion guard back in
This was removed in I0873d906c058203b83b8d4bbe5a4b274f05a26fd because I had fixed another cause of the recursion - this is still needed however because the following still happens:

1. Link inspector is opened away from a word, so it goes into a mode that will insert text based on the chosen target
2. The link inspector is closed, causing a context change when the new annotated text is inserted
3. The context change event triggers the link inspector to close, leading us back to step 2
4. Browser dies in infinite loop hell

We may be able to fix this in a different way, like performing the document changes after the inspector has already closed by running it in a timeout. In any case, this works for now, and we can improve the design of this area of the code later on.

Change-Id: I7f3c17dad08521bb1ae7c2a1e8a4e21e2c4ba210
2012-12-10 18:01:10 -08:00
James D. Forrester a7157d0c62 Create first VE Technical Debt bug entry for tracking, resolution
Change-Id: I47690b97c19ecc25b0f235036142fef9a2514e96
2012-12-10 17:49:11 -08:00
Rob Moen 1953f12fd8 Prevent Inspector frame from reloading on close.
In the event the page explodes from a huge js error, prevent
the iframe from reloading to slightly reduce the confusion of the
user.

Change-Id: I0c88678437f0bad994fa97f4df63d8b288f69e7a
2012-12-10 17:43:40 -08:00
jenkins-bot b3e2ebe6ee Merge "Fix tests for bug 42806 patch" 2012-12-11 01:03:53 +00:00
jenkins-bot 294962092c Merge "Alien support for IE" 2012-12-11 01:03:09 +00:00
jenkins-bot bbf92208d4 Merge "Alter messages to pull in the links for messages from other messages" 2012-12-11 01:02:42 +00:00
Rob Moen f4cbfa5d87 Throw edit warning on cancel.
-Added reset and hide calls to deactivate to prevent problems
with the save dialog if the user exits to the view.
-Remove unneeded teardown routines from cancel.
-Calling deactivate without override.

Change-Id: I888019146186fb7cbc1ee2b8efee9a0c45286c23
2012-12-11 00:50:05 +00:00
Trevor Parscal 353297e5b5 (bug 42925) Inspector doesn't open properly
ve.Range
* Rewrote truncate so that it works as expected, truncation should always reduce the length using the start/end values, not the from/to values

ve.ui.Inspector
* Added a comment about where the name argument to onBeforeInspectorOpen comes from, since it's a little bit confusing on first read (and I wrote it!)
* Calling onInitialize, onOpen and onClose methods directly, since we need to control the before or after-ness of listeners getting in there and doing their stuff - plus it's more direct
* Removed onRemove stub, which is never actually called
* Added before/after versions of initialize, open and close events
* Got rid of recursion guard since we don't need it anymore thanks to changes made in ve.dm.Surface (see below)

ve.ui.Context
* Updated event names to deal with new before/after naming of initialize, open and close events
* Removed fade-in logic since fading in doesn't even work anymore - since now we now annotate first, then open the inspector, the menu will actually exist and be open when we open the inspector even though you don't see it because it's quickly obscured

ve.ui.LinkInspector
* Made fragments non-auto selecting, in the case of onInitialize we actually call select(), which is silly since we were using an auto-selecting fragment - it's clear that this was a mistake

ve.dm.Surface
* Moved locking (polling stop and start) to the far outside edges of the change method
* I need a lot of eyes and testing on this change, it seems OK to me, but I'm suspicious that it may have side effects
* What was happening is that selection changes were being applied and then the poll was picking them up, and then the selection was coming in again as a change, but it wasn't a change at all, it was just feedback - this change event was then closing the inspector the instant it was opened - the odd part was that this only occurred when you selected backwards, which seems to be caused by the range being normalized, so it looked like a new selection even though it wasn't

ve.dm.Document
* trimOuterSpace from Range didn't consider annotated spaces to be spaces, by using the [0] trick (first character of a plain text character string or first element in an annotated character's array both are the character's value - but elements don't have a property named '0' so it skips those safely as well) we can always get the right value for comparison

Change-Id: I0873d906c058203b83b8d4bbe5a4b274f05a26fd
2012-12-10 16:48:13 -08:00
Trevor Parscal 15c5495255 Fix tests for bug 42806 patch
Repairs what 619043f8d1 breaks

Change-Id: I2f98ca0dbb292d98dddc86b39c8916e76a5e9d8b
2012-12-10 16:45:46 -08:00
James D. Forrester fb3d9d1657 Alter messages to pull in the links for messages from other messages
Thanks to Siebrand for explaining what he wanted done.

PS2: Altered capitalisation.

Change-Id: If34045989f5d9fdfec7d8170828cdf5de8f25e46
2012-12-10 16:07:20 -08:00
jenkins-bot b6d0cebe59 Merge "(bug 42654) Implement Show changes in Save dialog." 2012-12-10 21:49:38 +00:00
Translation updater bot 1fdfc69a48 Localisation updates from http://translatewiki.net.
Change-Id: I83f5a64f5e8742ca2b733d6c7a8c07af600594d8
2012-12-10 20:33:27 +00:00
jenkins-bot 3618e9846b Merge "Focus on document when notices are clicked" 2012-12-10 19:12:28 +00:00
jenkins-bot 4bd26cb24b Merge "(bug 42842) Do not call update (temporary solution to prevent error" 2012-12-10 18:41:39 +00:00
Inez Korczyński f93fd9ffe3 (bug 42842) Do not call update (temporary solution to prevent error
Solution: do not call update (temporary solution to prevent error - however content will never be at offset 0 - so it should never hurt)

Change-Id: I9ed6f9fbea23d5e2e55c56f8483321442049bd51
2012-12-10 10:41:01 -08:00
Translation updater bot 98c079ee8f Localisation updates from http://translatewiki.net.
Change-Id: Ief397cfb05a3b19c472e63a63a03fce426db7674
2012-12-09 20:32:01 +00:00
Timo Tijhof f79f6055e3 (bug 42848) Notifications should not use db-variant of page titles
Change-Id: Ie84168cd2509a17c180c6143a87a18ae8bbb3d0a
2012-12-08 02:38:05 +01:00
Timo Tijhof 97fa232c8f (bug 42654) Implement Show changes in Save dialog.
Turned saveDialog-body into slide-based swapper.

Moved footer into saveDiaog-body so that the license text doesn't
stay under the diff-slide (and move body bottom padding to foot
top)

Wrapped buttons and title in a saveDialog-header and converted
closeButton from absolutely positioned to a floated layout.
This way the title doesn't need to be repositioned but will scooch
over if the prevButton gets shown/hidden.

Update API "diff" action to include table wrapper and table
header. Without it the mediawiki CSS for diff doesn't work
properly (needs colgroups for proper width of the "-" and "+" column etc)

Renamed -saving class to -disabled for consistency.

Set prop.disabled to really lock/unlock buttons, not just visual
(otherwise the click handlers are still triggered on click, can
potentially cause actions to be triggered when not expected)

Using a ve message for "Show your changes" title instead of
re-using core tooltip-savepage in a different context.

Diff slide triggers "auto width" on dialog (inline undo of width: 29em), keeping min-width, to allow it to expand as wide as needed.

Functions that I copied as base for onShowChanges and
onShowChangeError had some incorrect argument descriptions. Fixed
in both.

Note:
* Pass function to .off(), so that only that one is unbound
  instead of any "resize" handler on the page (by other extensions
  or gadgets or core)
* NB: ve.bind ($.proxy) preserves internal guid, so that $.Event
  can find the bound function by the original reference.
* keydown has an anonymous function, should either moved to
  prototype or namespaced, did latter for now, save enough and
  better than destructive .off('keydown')

Change-Id: I9d05ef6e3e2461bdcf363232f7b0fbad5e24f506
2012-12-08 02:26:24 +01:00
Trevor Parscal 6bfb42639f Focus on document when notices are clicked
Change-Id: I55e4eb74e12ded79d998d155d4688ce6a1b6ce66
2012-12-07 16:42:47 -08:00
Christian Williams 61de058d08 Alien support for IE
We got lucky - the fact that our alien styling choice required phantom overlays had the nice side-effect of preventing the ability to focus the aliens. Therefore, as soon as we started ignoring IE to deliver nice alien handling for standards-compliant browsers, we inadvertently solved(?) the IE alien problem. I've touched up the styling to look nice in IE 9 (solid green phantoms) and IE 10 (stripes). Shield GIF switched to PNG because IE 10 renders the transparent GIF as solid red. Yeah, red.

Change-Id: I3bc69acba9ed883a823cdf722117b90966bc332b
2012-12-07 15:51:15 -08:00
jenkins-bot 41f7b97ca4 Merge changes I75bcf984,If7bae5e2
* changes:
  (bug 37875) Scroll changes on paste
  Pasting a DocumentSlice sets the selection incorrectly
2012-12-07 23:31:30 +00:00
jenkins-bot c6a69c4ddd Merge "(bug 42839) Whitespace links" 2012-12-07 23:05:38 +00:00
Rob Moen 3ef8a62aa7 (bug 42839) Whitespace links
* Collapse the new range returned by trimRange if it only contains whitespace

Change-Id: Id8461d435b22b745371a3a33caa3ea5b016c5b90
2012-12-07 15:04:49 -08:00
Trevor Parscal cdec86fb48 (bug 37875) Scroll changes on paste
This solves 2 issues:

1. Paste scrolls to the top of the editable box because we temporarily moved the focus to the paste container, and then moved it back. We solve this by saving/restoring the scroll position.
2. Scroll position adjusts vertically when pasting (using key repeat) because we handle pastes with a setTimeout and multiple paste jobs will pile up before they can be finished. We solve this by disallowing paste until we are done handling the previous one. In the case of key repeat this only is observable as slowing the repeat rate.

Thank you Christian for helping me solve this the old fashioned way - by sacrificing features you don't really need!

Change-Id: I75bcf9843b57cdff0db9b6dea62d66d4d76ac011
2012-12-07 14:58:29 -08:00
Trevor Parscal cf3b2a6765 Pasting a DocumentSlice sets the selection incorrectly
ve.dm.Document
* 2 of the 3 paths of getSlice still returned arrays instead of ve.dm.DocumentSlice objects

ve.ce.Surface
* Translate the range using the insertion transaction and truncate it, so the cursor ends up just after the pasted content

Change-Id: If7bae5e254ec84a847c1d3527f74d9c09c2d82b4
2012-12-07 14:49:11 -08:00
Translation updater bot 532bf0af05 Localisation updates from http://translatewiki.net.
Change-Id: Ie2ffad47f93de2a1b4093f297f9a7e76ccb523d0
2012-12-07 21:59:02 +00:00
jenkins-bot 8a29eab7c6 Merge "Static composition of 'can' and 'not', may improve performance slightly" 2012-12-07 21:40:50 +00:00