Commit graph

141 commits

Author SHA1 Message Date
C. Scott Ananian 236fad19b6 Ensure magic link nodes inherit the annotations of their text
If you create an autolink in the middle of bolded text, the magic link
should also be bolded.  Similarly, if you convert a bolded simple link
to a magic link, the magic link should stay bolded.

Change-Id: I38c7f3c0c275851049088a37f3b37d815ed38e4e
2015-11-13 13:48:18 -08:00
Thalia 7731508134 Make new error element
Bug: T114754
Change-Id: I5839ba62fe4b4708ff51dc549c5294189d7f8843
2015-10-29 22:32:42 +00:00
Ed Sanders a6c4c3b3e1 Follow-up Id473b45: Call getResults on input widget
Bug: T115448
Change-Id: I8bfbb3092aa49750930c6437b0526a8b900722f1
2015-10-14 11:34:36 +00:00
Ed Sanders f1f75bf511 MWLinkAnnotationInspector: Close inspector when a search result is clicked
Change-Id: Id473b45a222d53f6bca0168dad4adf536ccdf97a
2015-10-10 15:49:45 +01:00
Ed Sanders fff96cdc8f MWLinkAnnotationInspector: Use IndexLayout for internal/external
As originally intended, but avoided because of since-fixed CSS issues.

Change-Id: I60186c8f8a13eb9a7708716329dc959e1913665d
2015-10-10 13:02:16 +01:00
jenkins-bot cd29e0376d Merge "Add error element to MWLiveExtensionInspector" 2015-10-05 22:53:20 +00:00
Ed Sanders 3f2a885e3e Ensure full error message is shown when inspector is closed
Applying staging doesn't emit an update event on the node, so
forcefully emit one with 'staged' equal to false, so the full
error is rendered (if present).

Logically depends on I8ebb26d4bc in core.

Bug: T114480
Change-Id: I7ba54b67982fc5b10839426cdc216e14c0e33c01
2015-10-05 17:15:40 +00:00
Thalia 9307fa7095 Add error element to MWLiveExtensionInspector
As part of the plan to render extension errors in the
inspector instead of the view, append an element to
contain the error. More specifically, the element is
a div that contains a LabelWidget (in which the error
message is displayed) and a ButtonWidget (to expand
and collapse the error).

Initially the error element is hidden, but if Parsoid
returns an error, the element will be shown. If the
error is longer than 1 line, it is truncated but can
be expanded. On closing the inspector, any remaining
error is collapsed and hidden.

Depends on I6002d9870d2b to work

Bug: T113172
Change-Id: Ie84130d4ac0da9a738bf98ad0a3677d47566d585
2015-10-05 00:22:22 +01:00
Thalia 34f6e11a19 Call updatePreview when closing the LiveExtensionInspector
Call updatePreview in insertOrUpdate node, when closing the
inspector. If edits have only been made to attributes that
don't affect the rendering, updatePreview will not have been
called, so the model won't have changed. Therefore
updatePreview should be called every time the inspector is
closed to make sure such edits are applied.

Bug: T113078
Change-Id: I48fb291487f76fc515f122646d205366a60dca62
2015-10-01 15:58:20 +01:00
Ed Sanders f814ea719b MWLinkAnnotationInspector: Use TitleSearchWidget instead of TitleInputWidget
Depends on I335bd912d in MediaWiki core.

Bug: T101169
Change-Id: I2932c9df5444d1363af5af9b438bb905ed298148
2015-09-27 14:03:52 +01:00
Ed Sanders a04d2ff52b MWLinkAnnotationInspector: Update actions when changing tabs
Change-Id: I825531683eeb8b7e21b741f1dc5d338abc9d347a
2015-09-27 14:03:29 +01:00
Ed Sanders 6ed5877c69 Update VE core submodule to master (27fc244)
New changes:
18e46b6 [BREAKING CHANGE] LinkAnnotationWidget: Abstract .text property to getTextInputWidget

Local channges:
* MWLinkAnnotationInspector: Use new getTextInputWidget method

Change-Id: Ia33797d612be7b4521e7212047a38480ee2520df
2015-09-26 12:27:56 +01:00
Ed Sanders 8815d1397f Abstract mwExtension behaviour into MWExtensionWindow
Allows us to create an MWExtensionDialog base class that shares
the logic.

Change-Id: I53c8f1713a3513d2635cfd736ec8fc3f9616d864
2015-09-05 18:18:24 +01:00
Alex Monk 7c2f6e1f5f Don't break when you cancel the link inspector
Bug: T111241
Change-Id: Iff96aa4d97fe64a2472a58b3bf782085313899c6
2015-09-02 21:30:51 +01:00
Alex Monk a02d8573b4 Fix cancelling of extension inspectors
* Don't insert/update/remove nodes on cancel in MWExtensionInspector
* Don't forget to popStaging on cancel in MWLiveExtensionInspector

Bug: T110992
Change-Id: I1e30206595e304eb502c7e745bf5e00d145d12d7
2015-09-02 02:32:11 +01:00
C. Scott Ananian 7cc23367f6 Specialized inspector for ISBN magic links
Implement a special node type, context item, and inspector for
ISBN/PMID/RFC magic links.  Add buttons to the link inspectors
to convert back and forth between "simple" links, and magic links.

Depends on I5d000d8b63dafdfe0a2753069d3f0ac5b03b8829 in Parsoid
for clean round-tripping of localized ISBN magic links.

Bug: T63558
Change-Id: Id5b7a2ae3c80b0e5eed598f0bd024d3e94f7e9aa
2015-09-01 14:25:59 -04:00
jenkins-bot a2060f57c1 Merge "MWLinkNodeInspector: Remove 'Open' button" 2015-08-21 19:30:40 +00:00
James D. Forrester 55f78fcbf6 MWLinkNodeInspector: Remove 'Open' button
You can now do this from the context menu. No need to have extra buttons, and
this makes it consistent with the MWInternal/MWExternal link inspector.

Bug: T109646
Change-Id: Ifd4b3645c66ba2f32ccee7e2848967cf5e7ec82e
2015-08-19 15:58:13 -07:00
C. Scott Ananian 2852f6368f Builder for ve.dm.MWInternalLinkAnnotation
Add ve.dm.MWInternalLinkAnnotation.static.newFromTitle to build an
appropriate internal link annotation from a mw.Title.  Tweaked some
method signatures to avoid repeated reparsing of the title text.

Also refactor ve.dm.MWInternalLinkAnnotation.static.getTargetDataFromHref
to explicitly return a boolean indicating whether the result was determined
to be an internal link.

Bug: T64816
Change-Id: I74385d7b3ede1794398dabb749185f4080509b99
2015-08-19 16:57:06 -04:00
James D. Forrester 945242a55a build: Enable jscs jsDoc rule 'checkAnnotations' and make pass
Change-Id: I76abb1eb1f3e1a2e8a4c03f577a080f4889b3a6d
2015-08-19 11:09:34 -07:00
James D. Forrester 19df1d4c8a build: Enable jscs rule 'requireVarDeclFirst' and make pass
Change-Id: Ia2f765d12bde001c329c2ff4c080a36b71de9803
2015-08-19 11:05:01 -07:00
James D. Forrester f5c6f61163 build: Enable jscs rule 'requireSpacesInsideBrackets' and make pass
Change-Id: I846d36c15e1b1f810d2ef7fd422f8412790bcb0f
2015-08-19 10:33:02 -07:00
Vikas S Yaligar d42e10cacb [BrowserTest] Added screenshots scenarios for links and categories
Also minor cleanup of rspec old "should" syntax, changed all occurences to
"expect" syntax.

Change-Id: I0c2dfc18d06812ed9da2f6c0056c95b7755e5afd
2015-07-18 15:39:28 +00:00
Alex Monk b8c39de8ef Bypass ve.ui.MWInternalLinkAnnotationWidget.prototype.getHref when determining text
Bug: T104838
Change-Id: I0f754c949e494744adab5f191b5e8acce0c5d0fe
2015-07-09 02:03:04 +01:00
Alex Monk a5281d01c7 Populate the internal target lookup menu when the user opens the link inspector
Instead of only having it be populated upon setup.

Bug: T97723
Change-Id: I5ead32625efa79289b38955546a5843adef13101
2015-07-02 20:37:13 +00:00
Roan Kattouw 6aac8eed78 Follow-up 8112c3ba30: fix JS error on link inspector teardown
LinkAnnotationInspector in VE core calls
this.setAnnotation( null ); on teardown, which causes
MWLinkAnnotationInspector#onInternalLinkChange to be invoked
with a null fragment.

Bug: T103176
Bug: T104231
Change-Id: Ibb50ba1696609bebdfc2857ea292ee30b6b5126a
2015-06-29 23:53:49 +00:00
Matthew Flaschen 8112c3ba30 MWLinkAnnotationInspector: Get HtmlDocument in a different way
Get the HtmlDocument in a different way that doesn't involve
ve.init.target.

For page (non-Flow) MW VE, I checked that it yields the same result.

Bug: T103176
Change-Id: I54bdf4f29f6acf4359be45b5b2ddfd23b5835c34
2015-06-25 11:08:54 -07:00
Ed Sanders 5ac580e18b Empty all inputs on link inspector teardown
The parent class only nullifies the active input, but for completeness
we should nullify both.

Change-Id: I3017ef0ca61753fefde1c23b43178d46c6308e9f
2015-06-05 16:17:29 +01:00
Ed Sanders 325c9cb521 Move cursor to end when changing link mode
Allows you to keep typing after 'http://' in Firefox

Bug: T98895
Change-Id: I785863e9a3bd3c0d548bee13ae2810eccc739a8f
2015-06-04 18:23:34 +01:00
Ed Sanders d3718edb4d Add in required calls to updateActions
Change-Id: I8c584d7bd48c957b5b07ff1bf6b52748165c18dc
2015-06-02 22:57:12 +01:00
Ed Sanders e8149e2588 Always preserve input when switch between internal/external links
Although an internal link is unlikely to be a valid external link, this
prevents an annoying experience when the user switches to external and
then back to internal while exploring features.

Change-Id: I178cf3f641db683f5dd0a49c246c204ded89760c
2015-06-02 22:03:08 +01:00
Ed Sanders 20d3526ae6 Use updateMwData when doing a live preview
Change-Id: Iadca47339c7d16034c5715677e0789de286f3ecf
2015-05-27 15:47:48 +01:00
Ed Sanders 431f2abcfd Use new selectItemByData method where possible
Change-Id: I32f213bf2977623a0bde83fb9119fda42a1e9848
2015-05-08 16:15:51 +01:00
Ed Sanders ec8a813dce Use new TabSelectWidget in link inspector
Don't use the full IndexLayout for now as it doesn't
work easily in variable height situations.

Depends on this feature being preset in MW core.

Bug: T97878
Change-Id: I5d949bf69b0721b288c37c1f12210b0265658eb5
2015-05-08 09:03:24 +00:00
Ed Sanders ff9bf1fcb3 Update VE core submodule to master (2c0224d)
New changes:
68959f2 Localisation updates from https://translatewiki.net.
2c0224d [BREAKING CHANGE] Link widget refactor
f81eefa [BREAKING CHANGE] Rename LinkInspector to LinkAnnotationInspector

Local changes:
Adjust for link inspector refactor

Create separate widgets for internal and external link
annotations. Remove annotation specific logic from link
target input widget.

Change-Id: I054c3fe7ac9c61fbc3302471abd58cab89fed5a4
2015-05-08 09:56:11 +01:00
jenkins-bot 17b160b125 Merge "Remove obsolete comment; this functionality is now in place" 2015-04-15 00:52:31 +00:00
Roan Kattouw 95bffa22a0 Stop using this.$
Has been a backwards-compatibility alias since OOjs UI 0.7.0.

Change-Id: I17d7c03e9d1b9fa991d88444d22abfd403269ee0
2015-04-14 02:54:01 +01:00
Matthew Flaschen fee6681049 Remove obsolete comment; this functionality is now in place
Change-Id: I2752c69e871965ac408aaa70eb268e129b587013
2015-04-13 19:11:34 -04:00
Ed Sanders fdcd42f73a Split AlienExtensionNode into inline and block
MWExtensionNode:
* Inherit from LeafNode at the top level. Inline and block only
  differ in CE where inline has isContent set.

MWAlienExtensionNode:
* Inhert from MW(Inline|Block)ExtensionNode respectively. Both
  mixin MWAlienExtensionNode.

Bonus:
* Bring in paragraph unwrapping on inline nodes from MWMathNode

Bug: T93712
Change-Id: Ib04234f740cf1f27c861d8b3cfeea5e323b94678
2015-04-09 16:32:02 +01:00
Ed Sanders ed4278912c [BREAKING CHANGE] Make MWExtensionInspector inherit from NodeInspector
Also fix up logic duplicated between ExtensionInspector
and LiveExtensionInspector.

BREAKING CHANGE:
* nodeModel property no longer exists, use NodeInspector's modelClasses
  property, which is an array.

Bug: T93592
Change-Id: Ib0131c9485a903d73b770090bf8a938056782ba3
2015-04-08 20:51:20 +00:00
Ed Sanders 06ad00bf71 Simplify context item for MWAlienExtensionNodes
Just show the name of extension. 'MediaWiki extension' is meaningless
to most people.

Change-Id: I64dc4914874b3fb3f807d7e0155ad31f2a8e703e
2015-03-27 19:05:26 +00:00
Ed Sanders 2e654c01f0 Parent constructor simplification
Change-Id: I93be028cb76d7586c5bb56eb0b63c87d99413683
2015-03-27 18:56:16 +00:00
Bartosz Dziewoński e75774f667 Remove unused ve.ui.*Inspector.static.removable = false;
Nothing seems to refer to this anywhere.

Change-Id: I3c1c5f16a897377a2d2f8345758fb6e67ba69ccb
2015-03-12 19:31:46 +01:00
Bartosz Dziewoński 345879b277 ve.ui.MWLinkNodeInspector: Restore action buttons
Bug: T92525
Change-Id: Id305268b76cce4e56f0e98a9d7ac4e6c571470d2
2015-03-12 19:31:01 +01:00
James D. Forrester 2f8b3e0d96 build: Bump copyright notices to 2015
Change-Id: Ie92dab7411116d3410195c3fb0a3513c664c0c30
2015-01-12 20:34:19 -08:00
Ed Sanders 9a3c03b553 Fix teardown order of MWAlienExtensionsInspector
Local teardown process was jumping to the front of the queue
resulting in the attributeInputs being emptied before they
were read in updateMwData.

Bug: T85818
Change-Id: I24cb490996048e514895c359dedf5945acdecb0a
2015-01-05 17:58:31 +00:00
Ed Sanders 06bccbe986 MWLiveExtensionInspector: Move event unbinding to teardown process
Change-Id: I6fae2ca3e1bc02b8edb707b4248b884a9f022c3f
2014-11-12 19:33:24 +00:00
James D. Forrester 7149cc5279 MWLinkNodeInspector: Provide an open button here too
Also add validation now that we need it for the open button.

Bug: 71904
Change-Id: I50515671bb3ff08da8dc6c247c9959c27957c867
2014-10-21 20:00:27 -07:00
suchetag 0bb6d3b333 Getting rid of ve.splitClusters in ve-mw
Bug: 57628
Change-Id: I28cb52bd2af564f208b9414154977c351f5c3fcb
2014-10-08 08:09:19 +00:00
Ed Sanders 1af18c3c12 Update VE core submodule to master (984b57a)
New changes:
6bbcd6a Localisation updates from https://translatewiki.net.
b8d8a5b [BREAKING CHANGE] The Great Selection Rewrite of 2014

Local changes:
Update to use new selection/range API

Change-Id: I5480d5c77d599c93c2d374fac88bb2fdb68b0024
2014-10-07 21:39:33 +02:00