Commit graph

24 commits

Author SHA1 Message Date
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 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 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
Matthew Flaschen fee6681049 Remove obsolete comment; this functionality is now in place
Change-Id: I2752c69e871965ac408aaa70eb268e129b587013
2015-04-13 19:11:34 -04:00
James D. Forrester 2f8b3e0d96 build: Bump copyright notices to 2015
Change-Id: Ie92dab7411116d3410195c3fb0a3513c664c0c30
2015-01-12 20:34:19 -08:00
Bartosz Dziewoński 8e84d75383 Make it possible to create autonumbered external links from link inspector
Inserting a new external link from the link inspector when nothing is
selected (collapsed selection) will now produce an autonumbered external
link ('link/mwNumberedExternal' node, corresponding to wikitext
"[http://example.com]"). It used to produce annotated link text
('link/mwExternal' annotation, corresponding to wikitext
"[http://example.com http://example.com]" or "http://example.com").

Depends on two commits in VisualEditor/VisualEditor:
* Icc2e368a to insert unannotated content from the inspector.
* I40cd4d5a to insert non-text content from the inspector.

Bug: 51309
Change-Id: Ie4a633ed42907551337a62d96d0abd59e208d49d
2014-09-05 16:48:55 -07:00
James D. Forrester a232147b11 Switch 'disallowQuotedKeysInObjects' jscs rule on and fix up
Change-Id: I75ac4b378ef485feead9d0eff34ed7877b94b5d0
2014-08-22 13:50:48 -07:00
James D. Forrester 67f304a414 Update VE core submodule to master (c4ce5ee)
New changes:
c4ce5ee Update OOjs UI to v0.1.0-pre (466a8762ac)

Update changes:
* Remove manager arugment from window constructors
* Use this.$content instead of this.frame.$content
* Use this.getDir() instead of this.frame.getDir()
* this.loading is now a promise, not a boolean

Change-Id: Ia83449a60078dd24ea4f976221c0859e5a121279
2014-08-20 18:42:52 -07:00
Bartosz Dziewoński ede9dfcbb1 Rename MWLinkInspector → MWLinkAnnotationInspector to match file name
There is a MWLinkNodeInspector too, renaming the class instead of the
file to avoid name confusion.

Change-Id: Idaa26503ecd9b0fd0903937bb209397672138054
2014-08-13 16:20:15 +00:00
James D. Forrester c2f37a0450 test: Move mw into the global list of globals for VE-MW
Silly to have 38 MW-specific files needing to declare that they're using mw.

Change-Id: I97891ed922fe0c37d8c96425a4d23bd15098438b
2014-07-19 17:42:45 +00:00
James D. Forrester fbdff76263 Update VE core submodule to master (f2277ea)
New changes:
56de6f5 Localisation updates from https://translatewiki.net.
f8bda64 Widgetise demo menu
6ac48d8 Localisation updates from https://translatewiki.net.
365e131 builderloader: Omit value for boolean "disabled" attribute per HTML5
706e4b3 Prevent double counting of DM nodes in getNodeAndOffset
b141a7d Update OOjs UI to v0.1.0-pre (d2451ac748)
c5b3921 Localisation updates from https://translatewiki.net.
1606983 Update reference to ConfirmationDialog to use MessageDialog

Deletions:
* Styles for ve.ui.MWBetaWelcomeDialog - not needed anymore because
  OO.ui.MessageDialog provides them
* Styles for ve.ui.MWGalleryInspector - not needed anymore because
  ve.ui.MWExtensionInspector provides part of them and the rest are being
  replaced by programatic sizing

Modifications:
* ve.ui.MWLinkTargetInputWidget - Added support for validation and href
  getter
* Split message between tool and dialog title for ve.ui.MWEditModeTool
  and ve.ui.MWWikitextSwitchConfirmDialog

General changes:
* Updated inheritance.
* Added manager param to constructors of dialogs and inspectors.
* Updated use of show/hide with toggle.
* Added meaningful descriptions of dialog and inspector classes.
* Configured dialog and inspector sizes statically.
* Configured dialog action buttons statically.
* Interfaced with OO.ui.ActionSet to control action buttons.
* Moved applyChanges code into getActionProcess methods.
* Always using .next in setup/ready process getters and .first in
  hold/teardown process getters.

Change-Id: Ia74732e6e32c0808eee021f0a26225b9e6c3f971
2014-07-14 23:24:45 +00:00
Trevor Parscal f65c3c6ef1 [BREAKING CHANGE] Update VE core submodule to master (88fe25f)
Switch to processes for windows (dialogs/inspectors)

This conversion also required the splitting of MWLinkInspector into
MWLinkNodeInspector and MWLinkAnnotationInspector.

New changes:
88fe25f [BREAKING CHANGE] Update OOjs UI to v0.1.0-pre (dd888aba5c)

Change-Id: I662d8985463c9fc881775f70aef87ebeb454a73f
2014-05-30 22:03:45 -07:00
Renamed from modules/ve-mw/ui/inspectors/ve.ui.MWLinkInspector.js (Browse further)