Commit graph

3995 commits

Author SHA1 Message Date
jenkins-bot e57d8709cf Merge "Array.prototype.splice polyfill for Opera" 2013-07-22 18:40:01 +00:00
jenkins-bot 47fec91adb Merge "Set Malayam to use B/I rather than A/A for toolbar icons" 2013-07-19 20:27:28 +00:00
James D. Forrester 7c477d3021 Set Malayam to use B/I rather than A/A for toolbar icons
This is how it is configured in WikiEditor; presuming that this is not
incorrect. :-)

Bug: 51314
Change-Id: If285c14d8a798c57924af04c1dabfe6cf53e018b
2013-07-19 13:19:07 -07:00
jenkins-bot 21e47c5a33 Merge changes I2edc46b6,Iea905f2b,Ia572fd06,Id81da87b,I98a7d3eb
* changes:
  Add a node class for mw:Nowiki
  Move getHashObject() from dm.Node up into dm.Model
  Allow annotations to render nothing
  Pass child DOM elements to annotations' toDomElements()
  Process annotations bottom-up rather than top-down in data->DOM
2013-07-19 19:11:38 +00:00
jenkins-bot 97bb435a1c Merge "mw.ViewPageTarget.init: Expose support.visualEditor" 2013-07-19 18:52:12 +00:00
jenkins-bot 41ff03c98a Merge "Math Node UI (Bug Fix)" 2013-07-19 17:14:58 +00:00
jiabao 8eadcb0a26 Math Node UI (Bug Fix)
Fixed two bugs found after merging:

1. Opened the Math node inspector without editing
anything, then clicked somewhere else on the page,
it crashed.

2. Similarly, opened the Math node inspector
without editing anything, then clicked the
"Cancel" button to cancel the edit, it crashed.

Both of these problems are fixed by this patch.
The issue was with using the getFocusedNode() in
the inspector onClose function to save changes.

Also, I included some minor changes relating to
the last code review. =D

Change-Id: I6e200f2a228b71dc5af5aa9843c461f43b926f8d
2013-07-20 01:42:08 +10:00
Timo Tijhof 61a1e8c738 mw.ViewPageTarget.init: Expose support.visualEditor
Refactor a few things to make it easier for scripts to see
not just whether mw.libs.ve is present but also whether it
allows the user to activate VisualEditor.

Change-Id: I50da8d9a260207d4ec1c43254dfe738f91386a9e
2013-07-19 03:56:25 +02:00
jenkins-bot 0edd857dfd Merge "De-alienate <code>foo</code> blocks (code element)" 2013-07-19 00:51:19 +00:00
James D. Forrester 79aff53400 De-alienate <code>foo</code> blocks (code element)
Adding the <code> element as a matched text style annotation, plus some
tests (for all the other un-tested text styles as well, whilst I'm at
it).

We'll need an icon, a button and a way of the buttons not forever
extending the length of the toolbar to properly edit <code> spans, but
this is a start.

Bonus: unit test coverage for all TextStyleAnnotations

Bug: 51590
Change-Id: I5438bcf2ec6eeb2e50400f8013964f91c33ce455
2013-07-19 00:48:46 +00:00
James D. Forrester 8c88e84be3 Maths icon for inspector menu as well as inspector itself
As not done by 992cb43de5 (whoops).

Change-Id: I29e9452e8bc85ec256f46ddfa4f5000f5fcd2ba4
2013-07-18 17:28:39 -07:00
jenkins-bot 13f2450e18 Merge "Now we have a maths icon, let's use it" 2013-07-18 23:21:35 +00:00
James D. Forrester 992cb43de5 Now we have a maths icon, let's use it
Change-Id: I057f74975c0cb61bee54733fd4153ab0f75416d5
2013-07-18 15:48:21 -07:00
jenkins-bot a2ea33fb95 Merge "Handle backspace correctly when in a slugs" 2013-07-18 22:20:05 +00:00
jenkins-bot f37e0c7359 Merge "Use ve.ui.SurfaceWidget for image captions" 2013-07-18 21:41:18 +00:00
jenkins-bot 9feb71ff4b Merge "Reference dialog commingling" 2013-07-18 21:39:20 +00:00
Trevor Parscal dc606823e2 Use ve.ui.SurfaceWidget for image captions
Objectives:

* Make use of the new ve.ui.SurfaceWidget.js for image caption editing

Changes:

ve.ui.MWDialog.css
* Remove styles that are no longer needed
** -body class isn't needed if you contain the content in a layout and
   configure it to be padded
** Toolbar styles are now part of surface widget

ve.ui.MWMediaEditDialog.js
* Wrap caption fieldset in an editPanel (also nice because we may merge
  this dialog with MediaInsert and use a stack panel layout in the future
* Replace surface and toolbar with surface widget which manages both

Change-Id: I1b7e0e2ec1cfa30879360a7ebde2b0f35d26aca5
2013-07-18 21:35:22 +00:00
Trevor Parscal 61ba07d409 Reference dialog commingling
Objectives:

* Merge reference insert and edit dialogs
* Change workflow to put editing/creating a new reference first
* Add secondary page in dialog for selecting an existing reference

Changes:

*.php
* Cleanup unused files/messages

ve.ui.Dialog.css
* In the footer; make primary, constructive and destructive buttons
  appear on the right; all others on the left

ve.ui.MWReferenceSearchWidget.js
* Fix documentation
* Remove create option and reuse section header items

ve.ui.MWReferenceInsertButtonTool.js,
ve.ui.MWReferenceEditButtonTool.js,
ve.ui.MWReferenceButtonTool.js
* Merge reference button tools

ve.ui.MWDialog.css
* Remove body styles, use padded option of layout instead
* Update selectors as per merging of dialogs

ve.ui.MWReferenceInsertDialog.js
ve.ui.MWReferenceEditDialog.js
ve.ui.MWReferenceDialog.js
* Merge reference dialogs
* Add buttons to switch between edit and select mode

ve.init.mw.ViewPageTarget.js
* Update reference button name as per merging of tools

ve.ui.SurfaceWidget.js
* New widget!
* Encapsulates a "sub-surface"

Bug: 51152
Bug: 50458
Change-Id: I8265febf4fd8f64d2ac40470ff033bac68b24d99
2013-07-18 14:14:14 -07:00
jenkins-bot af16cbab52 Merge "Math(s) icon" 2013-07-18 19:01:00 +00:00
Ed Sanders 9c8409a987 Math(s) icon
Change-Id: Iaf5766d2d7751fdaf34161276b7ecf4f73456d91
2013-07-18 11:58:58 -07:00
jenkins-bot 565cb99e23 Merge "Update static loaders" 2013-07-18 16:40:10 +00:00
jenkins-bot 458c8757db Merge "Fix ordering of store items in converter tests" 2013-07-18 16:38:55 +00:00
Ed Sanders c414147b5a Handle backspace correctly when in a slugs
We need to detect if the endNode we are trying to move is
inside our original delete selection, and not perform the
move if it is.

Bug: 50076
Change-Id: Ib89706c8717d13829bf89e44c4fb39e16a00821e
2013-07-18 12:33:42 +01:00
Timo Tijhof 1c97668377 Update static loaders
Ran makeStaticLoader.php:
- Synced mis-match of css in demos.
- Added missing experimental.
  We originally had experimental in static. They were removed
  because the section became empty (not because we no longer
  wanted them in static loader). If we don't want them here, we
  should remove the entry from makeStaticLoader.php.

Change-Id: I275133d1cfebf174e54bf1b8f44465495949991a
2013-07-18 04:19:42 +02:00
Trevor Parscal 51ecf6d096 Fix for scrollable panels
Fixes mistake made in I50e996b9d2fde361238cde75e09baa5872e12223 which made scrollable panels not be, well scrollable.

Change-Id: I0ec59a1b76acf047b1a4d6de426a0ddb554a3e42
2013-07-17 17:17:01 -07:00
Trevor Parscal ef262dc241 Add padded option to layouts
Objectives:

* Add option to layouts to control whether it's padded or not
* Rename "scroll" option to "scrollable" to better fit with it's boolean value

Changes:

ve.ui.Layout.css
* Add styles for scrollable and padded options

ve.ui.StackPanelLayout.js, ve.ui.PagedDialog.js, ve.ui.ReferenceListDialog.js
* Update use of scroll option

ve.ui.PanelLayout.js
* Add padded option
* Rename scroll option to scrollable
* Switch to using a class for scrollable option, rather than hardcoding CSS properties

Change-Id: I50e996b9d2fde361238cde75e09baa5872e12223
2013-07-17 19:10:44 +00:00
Trevor Parscal 3da34d7107 Fix getAnnotationIndexesFromOffset for last offset in doc
If the element is undefined, it would stand to reason that there are no annotations there.

Just sayin'.

Change-Id: I2b66e7adc2b3af19df1a3f490ab479627807636e
2013-07-17 19:10:38 +00:00
Timo Tijhof 553102644f mw.ViewPageTarget: Show AbuseFilter warning in save dialog
Misc:
* Updated signature of #showMessage to include allowing
  an array of nodes to be passed. We pass this to jQuery#append
  so we're just extending the explicitly documented subset of
  things it could already do due to passing to jQuery#append.

Bug: 50472
Change-Id: I3f56820a4f14b0684bfa265e3eb5e3820f2a3513
2013-07-17 17:20:29 +00:00
Roan Kattouw 7294c65a2e Add a node class for mw:Nowiki
These represent <nowiki> tags. If the user doesn't edit the text inside
the nowiki, we round-trip the <span typeof="mw:Nowiki"> wrapper cleanly,
but if they do edit it, we unwrap it. This then triggers re-escaping
in Parsoid, and prevents cases where the user edits the text to no
longer need escaping but Parsoid still wraps it in <nowiki> because
of the <span typeof="mw:Nowiki"> wrapper.

In order to detect whether the contents have changed, the nowiki
annotation stores a copy of its contents. To avoid infinite recursion,
we have to exclude this attribute for hash generation.

Bug: 47678
Change-Id: I2edc46b6d87d2f91e952efcb09c0edae5166958f
2013-07-16 19:35:24 -07:00
Roan Kattouw 779099e660 Fix ordering of store items in converter tests
In the DomFromData tests, we put the provided storeItems in the store
first, then run preprocessAnnotations (which puts annotations in the
store). However, in DataFromDom we ran preprocessAnnotations first
(which puts annotations in the store), then ran getDataFromDom (which
is expected to put the asserted store items in the store). Because the
order was reversed between these two tests, it was impossible to write
a test for an annotation whose toDataElement function adds to the store.

Fix this by reordering the operations in the DataFromDom test, doing the
conversion first and only then running preprocessAnnotations on the
expected data. This preprocessAnnotations call will not write to the store
if the test passes, because all annotations in the expected data should
already have been put in the store by the conversion.

Change-Id: I8f741d96fe12590fd711542794570fb95b1132d0
2013-07-16 19:06:48 -07:00
Roan Kattouw 4098e47b8b Move getHashObject() from dm.Node up into dm.Model
This way annotations inherit it too.

Also add htmlAttributes to the hash, and implement getComparableObject()
in terms of getHashObject().

Change-Id: Iea905f2b430f8e51c6026065be17b89b9a03cfab
2013-07-16 19:04:53 -07:00
Eloquence c5de7696a7 Make beta notice more informative and increase CSS width.
Point out that the software may have issues, and point users to the "Edit source"
link explicitly.

Change-Id: Id84d76887038a3a6a9e11a203f19dc3db7703e6a
2013-07-16 18:49:39 -07:00
jenkins-bot ee5c90f8b0 Merge changes Icdc2730e,I9e4264a7
* changes:
  mw.ViewPageTarget: Add support for spam blacklist
  mw.ViewPageTarget: Swap captcha and badtoken logic in onSaveError
2013-07-16 22:52:06 +00:00
jenkins-bot 3675ca4cc8 Merge "Create MWResizeableNode mixin to control defaultSize flag" 2013-07-16 22:51:24 +00:00
Timo Tijhof fd0f4ff5cf Run UnicodeJS tests from Special:JavaScriptTest/qunit
Previously they were only run from the dedicated standalone test
which meant they weren't being run from Jenkins.

Change-Id: If22456f0031c68b0c1e7621b35b1e79c0664da15
2013-07-17 00:45:11 +02:00
Ed Sanders 56ef8cb5b5 Create MWResizeableNode mixin to control defaultSize flag
Previously wasn't being updated to 'false' after a width/height
attribute change.

Bug: 50645
Change-Id: Id5dcd6998e0125757238426f8052505d131d712d
2013-07-16 23:13:40 +01:00
Roan Kattouw 46c5192477 Allow annotations to render nothing
This effectively unwraps the annotation. Annotations can do this by
returning an empty array from their toDomElements() function.

Right now this is only supported for annotations, but once the converter
is rewritten to be entirely bottom-up, this is trivial to support for
other model types, and could even be used to implement unwrapping of
wrapper paragraph.

Change-Id: Ia572fd0610afccccfe795c257c0de9d003330f13
2013-07-16 15:09:08 -07:00
Roan Kattouw 2942fa8fa0 Pass child DOM elements to annotations' toDomElements()
This is special-cased for annotations but should be supported for
all model types once the converter is rewritten to be bottom-up
entirely.

Add a toDomElements() stub to ve.dm.Annotation overriding the stub
in ve.dm.Model so there's a place for the new parameter to be documented.

Change-Id: Id81da87b8b83d556a3618cc6187b22443a1e37e6
2013-07-16 15:09:08 -07:00
Roan Kattouw 15a7822df1 Process annotations bottom-up rather than top-down in data->DOM
This means that instead of creating a DOM element for an annotation,
then appending stuff to that DOM element, we queue up the things to
append and only create the DOM element after we've built everything
that's going to be in it.

Most significantly, this moves the toDomElements() call to the close
function, which paves the way for passing in the annotation's contents.

Change-Id: I98a7d3ebb0f3eb8627c22348b48596906db2646e
2013-07-16 15:09:05 -07:00
Timo Tijhof 16831b16d1 mw.ViewPageTarget: Add support for spam blacklist
Bug: 50826
Change-Id: Icdc2730e5fc644c9030a6648702e071934f5ad62
2013-07-16 23:39:27 +02:00
Ed Sanders bdbae42b3e Fake superscript style for references generated as spans
This is a hack because Parsoid should just generate <sup>s.

Bug: 50978
Change-Id: I0c418b4f70640b8212d4a58a6f33a0821f7338c4
2013-07-16 16:41:16 +00:00
Timo Tijhof bc7836d1ab mw.ViewPageTarget: Swap captcha and badtoken logic in onSaveError
This way if both are the case, the user (or VE, if possible)
will deal with badtoken first instead of potentially having to
solve the captcha twice (as each handling of the error does - and
should - end with an early return).

Change-Id: I9e4264a7001ffa9654bfab02cc955aa36ff5b6aa
2013-07-16 16:02:27 +02:00
Roan Kattouw ce3014c768 Remove superfluous clear() when pawning
We already call clear() 4 other times in this code path, including
one right at the end of change(), which is called right before this
clear() call.

Change-Id: I6d5ba5075e1b24a981546243977c6a8501748c5f
2013-07-16 00:37:51 +00:00
jenkins-bot a4558108b8 Merge "Adjust padding for surfaces inside dialogs" 2013-07-16 00:37:22 +00:00
jenkins-bot c4b05b893d Merge "Use template icon on template placeholder pages" 2013-07-16 00:35:08 +00:00
jenkins-bot 55493f7f9e Merge "Reset context menu on selection change while inspector is open" 2013-07-16 00:34:16 +00:00
Roan Kattouw f9864e9288 Continue links
This isn't as simple as just dropping applyToAppendedContent = false
on LinkAnnotation, because browsers differ in their continuation
behavior. Firefox continues links, but Chrome doesn't.

To work around this, add a property indicating that the annotation
needs its continuation behavior to be forced.

Rename areAnnotationsCorrect() to needsPawn() accordingly.

Bug: 49931
Change-Id: Id6424af89c92bba2be87736e8a937e0f2067c007
2013-07-16 00:29:55 +00:00
jenkins-bot 0ffc4d15ca Merge "Remove field set label on reference edit dialog" 2013-07-15 23:56:16 +00:00
jenkins-bot 78d58e637c Merge "Make the clear button clear insertion annotations too" 2013-07-15 23:54:45 +00:00
Trevor Parscal 0ba331afdc Reset context menu on selection change while inspector is open
Objective:

* Make the inspector close and context menu reset when the selection is
  changed while an inspector is open

Changes:

ve.ui.PopupWidget.js
* Add isVisible method

ve.ui.Context.js
* Check if popup is visible when the selection changes and close the
  inspector and reset the context if it is

ve.ui.AnnotationInspector.js
* Don't update the selection when closing if the selection has changed
  since opening

Bug: 50895
Change-Id: Ie7f0b7ac76b0460b39ec002705172376e4e602dc
2013-07-15 23:51:40 +00:00