Commit graph

3456 commits

Author SHA1 Message Date
Inez Korczyński 2f15cb0067 Support for inline images
Handles typeof mw:Image and mw:Image/Frameless

Change-Id: Ie2fbd4a3e12fb6faa4ab8e6dd0aa8d1334ff6498
2013-06-07 23:09:32 +00:00
jenkins-bot 8a614ae395 Merge "Use blacklist instead of whitelist for storeHtmlAttributes of MWBlockImageNode." 2013-06-07 23:09:17 +00:00
Timo Tijhof d5868a0f13 mw.ViewPageTarget: Make 'review' step optional in save flow
Summary:

Instead of having a button "Review and save" that opens with a
diff and leads the user to the "Report a bug" and "Save page"
slides respectively, make it more like the default EditPage.

There is now a "Save page" button that opens with the save
form with a button to "Review changes" (diff) or "Save page".

The "Report a bug" slide has been unlinked from the UI and is
no longer accessible for now.

As a result of the UI no longer requesting a diff upfront this
also means we will no longer detect "nochanges" event (when it
turns out the submittted revision matches the latest version).

This is unfortunate as it was a nice feature to detect it
before the user spends time writing the edit summary) but it
is the same as how the default EditPage works.

Changes:

Improved interface messages.

Adapted "nochanges" caption to the new context (it is no
longer shown when clicking "Save page", it is now shown as a
result of clicking "Show changes").

Now that the "save" slide is accessible from multiple paths
it is needed to keep track of slide changes in a history
array. Previously the slide tree was 1 level deep with
everything descending from "review". Now it starts at "save"
and can go in multiple directions including a loop from
save>review>save. We also need to toggle the "Prev" button
based on history instead of based on whether or not we are
on the "first" slide.

Hid the "saveDialogReviewWrongButton" from the review slide.
We're approaching wider launches and this will not scale to
a wider audience.

Bug: 49258
Change-Id: I90de95f6337eeddd794b75d56543d8d152421a6f
2013-06-08 01:05:05 +02:00
Inez Korczyński b6b4855434 Use blacklist instead of whitelist for storeHtmlAttributes of MWBlockImageNode.
Change-Id: Ief029005b3326a94a8432a3bd6de50669bd3a3b2
2013-06-07 16:04:45 -07:00
Catrope 10d415e63a Render block templates as <div>s and inline ones as <span>s
Right now block templates are rendered as <span>s

Change-Id: I4c941a03e0e34a435990f0392080a3a8bf3e2835
2013-06-07 20:04:01 +00:00
Trevor Parscal 5aac2f756c Block Image Resizing
Allow block images to be resized by mixing in ResizableNode.

Made transitioning optional, and disabled it for block image nodes.

Change-Id: If89948d285ffb5efb104c44cbc9553a3d56f52e7
2013-06-07 10:52:04 -07:00
Trevor Parscal 1fd7e85846 Image insertion
Objective:

* Allow inserting images from local wiki and commons

Changes:

ve.init.mw.ViewPageTarget.js
* Add media insert button to toolbar

ve.init.mw.Platform.js
* Add getMediaSources method - defaults to local wiki and commons

ve.ui.MWMediaInsertDialog.js
* New dialog for inserting media
* Uses a media select widget and inserts block images

ve.ui.Dialog.css
* Added styling for media select widget in media insert dialog

ve.ui.Widget.css
* Added styles for media select widget and media select item widget

ve.ui.MWMediaInsertButtonTool.js
* New tool for inserting media

ve.ui.MediaSelectItemWidget.js
* New item widget for media select widgets

ve.ui.MediaSelectWidget.js
* New widget for searching for and selecting media items

ve.ui.TextInputWidget.js
* Added isPending method

VisualEditor.i18n.php
* New messages for media insert dialog

VisualEditor.php
* Added links to new files and messages

PhantomJS--

Change-Id: Ia803ff3ef518782ce76802d2dab7559686a1bb0a
2013-06-06 17:36:55 -07:00
jenkins-bot 9fcdd0b513 Merge "HACK: Update template dialog for Parsoid's url -> href change" 2013-06-07 00:21:44 +00:00
jenkins-bot 9168795ec3 Merge "For performance reasons use classes collection instead of jQuery.hasClass" 2013-06-07 00:13:52 +00:00
jenkins-bot 089cebd8e1 Merge "Hack around exceptions thrown when closing the reference dialog" 2013-06-07 00:13:10 +00:00
jenkins-bot 06551322ea Merge "Let's not put slugs around lists because there is no such need." 2013-06-07 00:10:19 +00:00
Inez Korczyński c67c1f714d For performance reasons use classes collection instead of jQuery.hasClass
Change-Id: Id64a58d71c49ad74c55e3a24b86955ece668ebba
2013-06-07 00:09:15 +00:00
jenkins-bot baa2f22db9 Merge "Fix freaky disappearance of template nodes" 2013-06-07 00:09:05 +00:00
Catrope 13c9b117c1 HACK: Update template dialog for Parsoid's url -> href change
Also need to strip ./ and ../

This is a dirty hack, Timo to clean this up

Change-Id: I7f377d916b90f5cdecfcd77a6d5276747a543761
2013-06-07 00:09:04 +00:00
Catrope 778a74daf7 Hack around exceptions thrown when closing the reference dialog
ce.ProtectedNode doesn't like to be torn down when it's detached,
and this was happening to CE nodes created in the MWReferenceList.

Hack around this by attaching the CE nodes generated by the
MWReferenceList to the ce.MWReferenceListNode (so they have a
parent and a way of getting to the surface), and by guarding against
multiple successive setups/teardowns in ce.ProtectedNode.

Change-Id: If00e75b939ccbdbaf681bbb6609fec54805bf9a0
2013-06-07 00:08:54 +00:00
Inez Korczyński 42d32286c7 Let's not put slugs around lists because there is no such need.
It is easy to exit the list at any given point by using the toolbar
button or pressing enter twice while at the end of the list.

Change-Id: Ie34300fc13a4548e283348ef58c88ce420fbe0c1
2013-06-07 00:08:26 +00:00
Catrope 4ce69758cc Fix freaky disappearance of template nodes
ce.GeneratedContentNode had an interesting bug where it called .append()
directly on DOM elements stored in the store. They weren't cloned,
which meant the previous rendering of the same node would just disappear,
and they also weren't adopted into the correct document which would
probably have caused other issues as well.

Properly clone and transplant the nodes from the store before attaching
them to the DOM.

Change-Id: I423db85cb7c3851a9bf68de03c72aa22994d9474
2013-06-07 00:06:23 +00:00
jenkins-bot 3557083eb0 Merge "mw.ViewPageTarget: Clean up transform/restore logic" 2013-06-07 00:05:25 +00:00
jenkins-bot 991f61a451 Merge "Prevent scrolling in top-level window while dialog is open" 2013-06-06 23:55:35 +00:00
jenkins-bot bf05782972 Merge "Fix protectedness of MWReferenceList" 2013-06-06 23:48:22 +00:00
jenkins-bot 22796f925d Merge "Fixing resize handle size" 2013-06-06 23:46:52 +00:00
jenkins-bot 45b970c8dc Merge "Remove tests for OOJS methods" 2013-06-06 23:44:13 +00:00
Trevor Parscal f1d481ff64 Prevent scrolling in top-level window while dialog is open
Because scroll events cannot be canceled or prevented from bubbling
up, the only way to prevent the scrolling is to cancel the actual key
and mouse wheel events.

PhantomJs -= 2

Change-Id: I540738459181c37d11caf5db07345703e7000ef9
2013-06-06 23:43:19 +00:00
jenkins-bot 351af0f5fe Merge "oojs: Integrate with OOJS v1.0.0" 2013-06-06 23:42:47 +00:00
Timo Tijhof ce8133cca6 Remove tests for OOJS methods
Change-Id: I6443e773fd2baf7e186ab4be0e227e78dd05b4b7
2013-06-06 23:41:52 +00:00
Ed Sanders c86ff7529b Fix vewhitelist override.
This is mainly used for testing blacklisted browsers, so we just need
one parameter ('vewhitelist') which sets whitelist to true and
blacklist to false.

Change-Id: I38771ba7a49657d67c4d94ace1f30b5e41904df6
2013-06-06 23:39:43 +01:00
jenkins-bot 002e8d9095 Merge "Pending input refactor" 2013-06-06 21:47:09 +00:00
jenkins-bot 72f661dc69 Merge "ve.dm.MWBlockImageNode: Make toDomElements add more information to its output so round-tripping can work properly." 2013-06-06 21:46:21 +00:00
Trevor Parscal 8a8a337ce5 Pending input refactor
Objective:

* Make all text inputs have the ability to be "pending", not just ones
  with a special mixin

Changes:

* Delete pending input widget
* Move pending input widget implementation to text input widget
* Update all uses of pending input widget
* Make pending image a reusable "texture"
* Update styles of text input widget for pending state
* Get rid of checking for mixin since all text inputs can be pending now

Bonus:

* Get rid of unused images, including .psd and .ai files
* Add transparency texture
* Fix input widget not using documented config value
* Fix documentation in select widget (lies!)

Change-Id: Ib46ab01dc39d706e5c25fd473dee0edce51b7e44
2013-06-06 21:17:35 +00:00
Christian Williams eaba9833d2 Fixing resize handle size
Handles were missing vendor-specific box-sizing declarations.

Change-Id: I6f8e8a37df29cc351f4ca50b7dd02fadcc3bdda3
2013-06-06 11:18:57 -07:00
jenkins-bot 1bab467c61 Merge "Rename character to (grapheme) cluster when dealing with unicode." 2013-06-06 17:49:12 +00:00
jenkins-bot a3e5e9d76d Merge "Fix API request for language links" 2013-06-06 15:34:26 +00:00
Timo Tijhof 2732e09396 mw.ViewPageTarget: Implement veaction=edit history state
Browser history state:
* Listen for popstate, if veaction is different, act on it
  (by calling activate or deactivate).
* When switching to edit mode, push veaction=edit.
  When switching to view mode, push non-veaction.
  Except if the switch was made by the popstate listener in
  which case we don't want to push again.

Clean up:
* Use document.location.href instead of odd location.toString
  Don't pass it to mw.Uri from the original one since it
  takes the current url by default.

Bug: 43844
Change-Id: I5c345c1526852a84b04436955845bf1b56d94402
2013-06-06 15:31:14 +00:00
Timo Tijhof 908d1a8c19 oojs: Integrate with OOJS v1.0.0
To make integration and testing easier keeping references and
tests unchanged.

Change-Id: Ie808eaf0ffb754ba9c6be13810cfec2385d8de36
2013-06-06 17:29:55 +02:00
Timo Tijhof baba5b0323 mw.ViewPageTarget: Clean up transform/restore logic
Merge methods:
* transformPage: transformSkinTabs + hideSiteNotice
* restorePage: restoreSkinTabs + restoreSiteNotice

Callers now consistently do both (e.g. #tearDownSurface only
called #restoreSkinTabs). This is also in preparation for
bug 43844.

Removed call from #tearDownSurface as that method is only
called from #deactivate which already calls #restorePage.

Clean up support check:
* Rename supportsStrictMode to supportsES5. Though the feature
  test asserts strict mode, we use it to check support for
  ES5. VisualEditor doesn't particularily care about strict
  mode itself.
* Reverse support if-statemement to return early instead of
  wrapping everything that follows. This makes it easier to
  see that we intent to abort if the current environment is
  known to be problematic. Also easier for code later on
  by not accidentally falling outside this block
* Follows-up aaa5ad254b.

Change-Id: Ia4b949d9c066a3f7b07217aa3d51de9908734e85
2013-06-06 16:52:26 +02:00
Ed Sanders fc5ead9212 Code style fixes: 'function(' => 'function ('
Change-Id: I905f6bec5c12903775bf3bb1085d26c9ea001eca
2013-06-06 13:02:16 +01:00
Ed Sanders 6e70953a94 Fix API request for language links
Fixes placement of 'indexpageids' in ajax options from I5b8fdfb78a211783

Bug: 48814
Change-Id: I897da1cf06c79ee40e29fb632d09cddb57144ada
2013-06-06 12:36:53 +01:00
jenkins-bot 507a61bfd5 Merge "Proper support for frame images (do not display magnify icon)." 2013-06-06 03:26:49 +00:00
James D. Forrester 760470ab38 Give users a read-only view of language links
This makes the 'category' section of the meta-data panel less lonely, and
prompts us to actually do this at some point quite soon (or encourage others
so to do).

Bug: 48814

Change-Id: I5b8fdfb78a2117839277a683db47fe97107d87b0
2013-06-05 20:22:58 -07:00
Catrope 3aae3e80bd Fix protectedness of MWReferenceList
The update() method wiped out the entire contents of the node, including
the shield that makes ce.ProtectedNode work. Fixed by only wiping out and
reconstructing the contents of the <ol>

Change-Id: Ib2978a72939884be67964ce8a3d89a570f70bfa3
2013-06-05 18:10:04 -07:00
Trevor Parscal 4d65b6610b Fix deactivate
'detach'.split( '' ).join( 't' ) + 't';

Change-Id: Ic5ba376e2fa0afbbcdb3e8989433ce9dad973dd1
2013-06-05 16:53:38 -07:00
Trevor Parscal c0cd258045 Really fix notices sometimes not being an array
The previous fix didn't really work, because the notices are expected to
be an array elsewhere too. Better to just convert it to an array on the
spot. getObjectValues works with any kind of object (including an array)
so it's safe to use with either data type.

Change-Id: I03237b8624a0b980e5f70d54d55c662ffa460373
2013-06-05 23:39:57 +00:00
jenkins-bot 86cd5c6f57 Merge "Tolerate JSON stringify screwing up" 2013-06-05 23:25:38 +00:00
Trevor Parscal 9a4028c61f Tolerate JSON stringify screwing up
Sometimes the notices come through as an object with numeric keys. Go figure.

Change-Id: I3246006afe74a9c34a0cdd5294de61691bc37a43
2013-06-05 23:23:47 +00:00
jenkins-bot 8c20fb278f Merge "'typeof' for templates changed in Parsoid, it is 'Transclusion' now and used to be 'Object/Template'" 2013-06-05 23:06:15 +00:00
Timo Tijhof 52025855ae mw.ViewPageTarget: Make tabLayout configurable server-side
Bug: 46871
Change-Id: I3fcb0c2903ae62d61ff789b5504e0ea23932121b
2013-06-05 15:58:27 -07:00
Inez Korczyński 2f58dd3d40 'typeof' for templates changed in Parsoid, it is 'Transclusion' now and used to be 'Object/Template'
Change-Id: Ia5b826bc1a2a648a8e618642697484000b68bfc2
2013-06-05 15:31:51 -07:00
jenkins-bot 0730e4af6e Merge "Update reference lists and inline numberings automatically." 2013-06-05 22:13:31 +00:00
Ed Sanders 22d1908bd4 Update reference lists and inline numberings automatically.
The easy part is getting the correct numbers from the InternalList
and generating the ordered list HTML. The tricky part is connecting
up the events to make sure the renumberings/list generations are
triggered when required.

InternalList can emit an update event on document transaction, which
triggers the renumbering/relisting if any references have been
added or deleted during that transaction.

ve.ce.MWReferenceListNode also listens to changes on the
InternalListNode (i.e. changes to the contents of the references)
and always triggers a rebuild.

Change-Id: I1b48ef5240e433c3b314259aa68cde13841ea98b
2013-06-05 15:11:16 -07:00
jenkins-bot ebbcc86ecf Merge "Make the mwMeta dialog trigger a toolbar action, not a button" 2013-06-05 22:08:58 +00:00
James D. Forrester 96b007eb7b Make the mwMeta dialog trigger a toolbar action, not a button
This has the secondary impact of moving mwMeta dialog out of experimental mode.

Change-Id: I3bb61d536826c6ba139661861092cd63423d99a4
2013-06-05 15:02:19 -07:00
jenkins-bot 3e97d5e502 Merge "Fix double width border between toolbar and surface in dialog." 2013-06-05 21:56:48 +00:00
Inez Korczyński d14b2c514d ve.dm.MWBlockImageNode: Make toDomElements add more information to its output so round-tripping can work properly.
Change-Id: Ieacf9187371a1687869bcb4bb0244f1bc251a803
2013-06-05 14:37:28 -07:00
Inez Korczyński 5079bbae9a ve.dm.Converter: Fix too-much-ascending bug in Converter.
Change-Id: I748003d316614717c8eaf58dcf5735246951532a
2013-06-05 14:04:42 -07:00
Trevor Parscal d2e64c5905 Consistency
Quote JSON keys.

Change-Id: Id6cab25e0c755a8e505c384c8ce02094bd68652f
2013-06-05 12:50:47 -07:00
Ed Sanders 605fe147dc Rename character to (grapheme) cluster when dealing with unicode.
Change-Id: Ia72e19289ba7f15a921d22698ab5d8c354ef120d
2013-06-05 17:30:28 +01:00
Ed Sanders 0b14b0da66 Fixes to permaturely merged browser compatibility checks
See comments on Idc5f4a23a2709264d869a9

Bug: 38128
Change-Id: Ic38992e04b5f3932cf18f2dfc217cd733196efb8
2013-06-05 18:11:59 +02:00
jenkins-bot 03f56f7852 Merge "Implement Grunt support (grunt jshint,csslint,qunit,watch)" 2013-06-05 15:39:29 +00:00
jenkins-bot 4c6b02719d Merge "ve.ce.Document: Introduce getRelativeRange method" 2013-06-05 15:29:51 +00:00
Ed Sanders 7e94da8a3b Fix double width border between toolbar and surface in dialog.
Change-Id: I647a5f4c37d543e8a7c90eecf8cbe3a7a856cc47
2013-06-05 15:02:07 +01:00
jenkins-bot 453c627922 Merge "Unit tests for browser compatibility list" 2013-06-05 12:33:42 +00:00
jenkins-bot b67019e0c2 Merge "Implement new browser compatibility checks" 2013-06-05 12:32:56 +00:00
Ed Sanders 3b62ffe7c8 Unit tests for browser compatibility list
This test only runs in MW context.

Change-Id: I25315607d208a923aa28f8b34f099440ba311d9d
2013-06-05 14:30:13 +02:00
Ed Sanders aaa5ad254b Implement new browser compatibility checks
We now have three stages:
1. Browser feature tests. Dies silently if any fail.
2. Browser blacklist. Dies silently if match found.
3. Browser whitelist. Shows warning if no match found.

Previously we were treating the remotely generated
edit notices as if they were in an object when
in fact they were in an array - the code has been
fixed to reflect that fact.

As locally generated notices will typically require
parsed messages, we've also moved the notice rendering
to after onReady is fired.

Updated jquery.client to latest master from MediaWiki core
(needed for proper detection of Iceweasel, Android and Safari)

Bug: 38128
Change-Id: Idc5f4a23a2709264d869a91d00873c4e187bc470
2013-06-05 14:29:36 +02:00
Inez Korczyński 1cd93f11ca ve.ce.Document: Introduce getRelativeRange method
A new method to be used for cursor left and right movement.

Change-Id: I9b32ccf6800d34f94793fc9086ba2c7341e30c61
2013-06-05 13:10:38 +01:00
jenkins-bot e9a1acdebd Merge "makeStaticLoader: Incorporate hardcoded changes and re-sync" 2013-06-05 11:54:43 +00:00
Timo Tijhof 1b9637123f makeStaticLoader: Incorporate hardcoded changes and re-sync
Follows-up 2e76271 and 231a50f which made manual changes to
the static-loading files without updating makeStaticLoader
(thus causing the load order and if-statement to be out of
sync between different index.php files).

Updating makeStaticLoader to include those changes and applying
it to the other index.php file.

Change-Id: I9bbe97d85f663b1cffeb384d52b5cc54e2f6601b
2013-06-05 13:30:35 +02:00
Timo Tijhof bedbebd53c Implement Grunt support (grunt jshint,csslint,qunit,watch)
This has no influence on Jenkins but can be used locally to
easily run certain tools. Since we already had `.jshintrc` in
our repo it was already possible to easily run JSHint from
the command-line locally. Taking that as a base the following
are new features:
* `grunt csslint`: Runs CSSLint on all css files
* `grunt qunit`: Runs QUnit (standalone) tests in PhantomJS
* `grunt test`: Runs jshint/csslint/qunit
* `grunt watch`: Runs the "test" command automatically whenever
  a file is changed. You can keep this in the background so
  whenever you save a file in your editor (e.g. Sublime Text)
  it'll run the tests and if there is a failure, it'll throw a
  bash error code causing your Terminal application to beep you
  in whatever way your operating system does so (e.g. for
  Mac OS X a red badge + jumping icon in the Dock). It will
  continue to run in the background even after a failure so no
  need to re-start watch after a failure.
* `grunt`: Runs the default task, which is 'test'.

Previously to use `jshint .` you had to:
* One-time install:
  * install package -- nodejs npm
  * npm install -g jshint
* Usage:
  * cd VisualEditor; jshint .

Now, for grunt:
* One-time install:
  * install package -- nodejs npm
  * npm install -g grunt-cli
  * cd VisualEditor; npm install
* Usage:
  * cd VisualEditor; grunt

Change-Id: I7a4fdf4b6bf3f00cef15dc3e2c81eceb595aec7c
2013-06-05 11:10:23 +00:00
Timo Tijhof 57960a73bd Add .csslintrc file and fix remaining warnings
Adding a fairly loose .csslintrc file so that our code
passes it.

The following options cause warnings in our code and have been
disabled for now:

* adjoining-classes
  > Don't use adjoining classes.
  > .ve-ui-widget-disabled.ve-ui-textInputWidget textarea:focus {

* box-sizing
  > The box-sizing property isn't supported in IE6 and IE7.
  > box-sizing: border-box;

* box-model
  > Using width with border can sometimes make elements larger than you expect.
  > border: solid 1px #ccc;
  > Using width with padding can sometimes make elements larger than you expect.
  > padding: 0 0.75em 0 0.75em;
  > Using width with border-right can sometimes make elements larger than you expect.
  > border-right: 1px solid #eee;

* fallback-colors
  > Fallback background-color (hex or RGB) should precede RGBA background-color.
  > background-color: rgba(104,171,255,0.1);

* important
  > Use of !important
  > position: relative !important;

* outline-none
  > Outlines shouldn't be hidden unless other visual changes are made.
  > .ve-ce-documentNode[contenteditable="true"]:focus {

* qualified-headings
  > Heading (h1) should not be qualified.
  > .ve-ce-branchNode h1:empty:before,

* universal-selector
  > The universal selector (*) is known to be slow.
  > .ve-ce-protectedNode * {

* unqualified-attributes
  > Unqualified attribute selectors are known to be slow.
  > .ve-ce-documentNode[contenteditable="true"]:focus {

Fixes made:
* modules/ve/ce/styles/ve.ce.Surface.css:
 [L66:C2] margin can't be used with display: inline.
* modules/ve/ui/styles/ve.ui.css: Unknown @ rule: @-ms-keyframes
 Internet Explorer < 10 doesn't support keyframes. IE10+ supports
 the standard property. I don't think ms-keyframes ever existed
 http://caniuse.com/css-animation. ms-transform did exist
 http://caniuse.com/transform.

Change-Id: I728a48e489c079e1c94a506bb00c245de9551eb6
2013-06-05 11:07:00 +00:00
Timo Tijhof b463c5d377 jshint: Fix trailing comma
Due to the "es5: true" jshint option we enabled, these
warnings were surpressed. I've disabled the option since
we no longer require it. It was enabled in 07c86fc to fix
a bug with jshint. This bug has now been fixed.

Change-Id: I55b7d031eb5581af5f733f050cf2ea98dacb2af6
2013-06-05 13:00:49 +02:00
Inez Korczyński a9812ad4c6 Proper support for frame images (do not display magnify icon).
Change-Id: I94792760e6b1ff69ab13501939bf8d10e0558e5b
2013-06-04 17:41:35 -07:00
jenkins-bot 3dfc960576 Merge "Store DM nodes in InternalList" 2013-06-04 17:06:24 +00:00
Ed Sanders 2925966944 Store DM nodes in InternalList
Also keep items in the order they appear in the document
and grouped by group and key.

Additions and removals are triggered by the new root/unroot events.

Change-Id: Ia3e90ccfdab88f352b89992b90554e5f03ff9952
2013-06-03 22:10:07 +01:00
jenkins-bot 09ed510659 Merge "ve.ui.MWTemplateDialog: Implement inferring of template data" 2013-05-30 17:41:21 +00:00
Timo Tijhof 0560084393 ve.ui.MWTemplateDialog: Implement inferring of template data
Clean up of logic implemented during the template-sprint:

* Store spec inside the content model, directly associated
  with the content-part. This allowed fixing the bug where
  two spec-less template invocations overwrote each other's
  made-up template data due to it using "target.wt" as key.
  The opener now provides the fetcher with a "specId" which
  is set to "part/<id>" for wt-generated template targets.

* Batching is now implemented inside the fetcher instead
  of outside. This allows calling "getTemplateSpecs" inside
  the loop with a dedicated callback for each spec to store
  it in the content.parts[i] object passed by reference.

  It also makes it easier to use by different code paths.
  You call it as much as you like and it will queue up
  naturally through javascript yielding and then make a batch
  request. This is based on the pattern I used in MediaWiki core
  for mw.loader#addEmbeddedCSS.

Follows-up e7af635, da679b7.

Change-Id: I4d7121229d060a96d927585c987a1a81a474b922
2013-05-30 18:37:51 +01:00
jenkins-bot 722b193f45 Merge "Convert GeneratedContentNode into a mixing (instead of an abstract class)." 2013-05-30 16:50:53 +00:00
jenkins-bot e94d38fe31 Merge "Unwrap excess <p>s in inline template rendering" 2013-05-30 16:48:19 +00:00
Catrope 7a616429a0 Unwrap excess <p>s in inline template rendering
This is a hack, in the future Parsoid will have a template re-expansion
API that will produce the correct result.

Change-Id: I328c11330fb3db71c51882717d6b84099c9270d1
2013-05-30 17:41:20 +01:00
jenkins-bot a751f4ad67 Merge "Use grapheme clusters in unicodeJS.TextString" 2013-05-30 16:36:35 +00:00
David Chan 1c78d0a38c Use grapheme clusters in unicodeJS.TextString
unicodejs.js:
* add splitClusters(text) and splitCharacters(text) methods

unicodejs.textstring.js:
* change internal representation from a char string to a list of grapheme
  clusters

unicodejs.wordbreak.js:
* change getGroup to work on the first character of a grapheme cluster

ve.js:
* Use new unicodejs.splitClusters function

Bug: 48975
Change-Id: I202b98199d2780534d1e02519b72579ba796f08f
2013-05-30 17:34:10 +01:00
jenkins-bot 85ac84d7bf Merge "ve.debug: Document why we use global Function#apply+Function#call instead of method.apply" 2013-05-30 12:13:33 +00:00
Timo Tijhof 701ac40e69 ve.debug: Document why we use global Function#apply+Function#call instead of method.apply
Follows-up 2ad6577

Change-Id: I3e2cc39873bffd08b1404bd54dd392623092847d
2013-05-30 13:03:14 +01:00
jenkins-bot 052cdb1d99 Merge "Add icon option to ve.ui.TextInputWidget" 2013-05-30 11:56:54 +00:00
Ed Sanders 68b29a8859 JS and PHP code style fixes
if(	-> if (
for(	-> for (
else if	-> elseif

Lines greater than 120 chars chomped.

Change-Id: I909d4fe9785a656481878256830ae5965e48a416
2013-05-30 11:38:06 +01:00
Inez Korczyński 394a40f27c Convert GeneratedContentNode into a mixing (instead of an abstract class).
Change-Id: I280d2a59326bd83357c7a09c3a188a70fbc75335
2013-05-29 14:54:57 -07:00
Trevor Parscal eec6b99369 Add icon option to ve.ui.TextInputWidget
Changes:

ve.ui.Widget.css
* Add styles for decorated text input widgets and their icon elements

ve.ui.TextInputWidget.js
* Add icon option which adds an icon before input text

Change-Id: Ib48d795391cb5d110e7dc05658d51129792dfc33
2013-05-29 12:39:07 +01:00
Trevor Parscal 750ab24d31 Add search icons
Change-Id: Id5b74916502ea3f94c79968e2dd7f64a563896ce
2013-05-29 11:57:04 +01:00
Trevor Parscal da679b7a9c Template dialog cleanup
Objectives:

* Break template page creation into it's own method
* Get rid of styling being applied in JavaScript
* Fix styling issues

Changes:

ve.ui.MWTemplateDialog.js
* Add method for adding a template page
* Replace css calls with addition of classes for styling
* Cleanup of append calls

ve.ui.Dialog.css
* Make inputs in the template dialog full width and a reasonable height

ve.ui.Widget.css
* Swap margins with padding in labels to prevent layout issues
* Prevent textareas from being resized in safari/chrome

Change-Id: I4030d8605aad865251ecd0aeb8cc72d333bed6a4
2013-05-29 11:03:52 +01:00
Trevor Parscal b0f464ef0e Add support for editing multi-template nodes
Objectives:

* Refactor template dialog to support loading template data for, and
  editing multiple templates and interleaved content in a template node
* Update template node model to generate multi-template wikitext

Changes:

ve.dm.MWTemplateNode.js
* Rewrite getWikitext method to work with multi-template formats

ve.dm.MWTemplateDialog.js
* Retain information about the node and template calls
* Break AJAX handler into its own method
* Attach event handlers to inputs directly so template values are
  edited directly on the fly
* Refactor page building to support multiple templates
* Add multi-template support for template data API call
* Add support for editing plain text content

Change-Id: I92ff8a9e186701a3f8da88def92a5b7dcb607897
2013-05-29 01:10:57 +01:00
Trevor Parscal 4c5c18c241 Compare objects/arrays fix
Objectives:

* Fix compareObjects so it doesn't break when given arrays
* Remove compareArrays
* Rename compareObjects to compare and update callers of both methods

Changes:

ve.js
* Loosen check for whether to recurse so both arrays and objects qualify
* Remove compareArrays
* Rename compareObjects to compare

ve.dm.MWTemplateNode.js, ve.dm.AnnotationSet.js, ve.dm.Document.js,
ve.dm.Transaction.js
* Update uses of compare(Arrays|Objects) to use compare

Change-Id: I7d4f7ceb28c0389f0157b7598e291f21393b5b85
2013-05-29 00:39:04 +01:00
Inez Korczyński 0b46b44809 Add class mw-figcaption to figcaption tag inside mwimage
This is currently required by Parsoid in order to serialize
(HTMLDOM -> wikitext) correctly.

Change-Id: I827f63420d05c62d689902c9b348d234f20a5d19
2013-05-28 23:21:59 +00:00
jenkins-bot 57c75a5e41 Merge "Adjust coverter getDomSubtreeFromData method call inside ve.dm.MWBlockImageNode to pass correct arguments (there was an API change)." 2013-05-28 23:03:57 +00:00
Inez Korczyński 476d10b1c3 Adjust coverter getDomSubtreeFromData method call inside ve.dm.MWBlockImageNode to pass correct arguments (there was an API change).
Change-Id: I1918aee714363babf5182c699fd96ef9fd4fce55
2013-05-28 16:01:16 -07:00
Catrope 1365c4a5d5 Fix internal node weirdness
* In getDataElementOrSlice(), we were slicing one too far
* When encountering a closing for an internal node, don't traverse
  up. Doing this caused weird bugs, like inserting text where it didn't
  belong in some cases an exceptions in others, but these issues were
  parly masked by the off-by-one error in the data slice.

Change-Id: Ieda9afa95b7c1953d09e391774350a9b4148c2fe
2013-05-28 15:30:15 -07:00
jenkins-bot efb3f21b13 Merge "A fix for arrow movements in RTL wikis." 2013-05-28 21:50:58 +00:00
jenkins-bot 507b456893 Merge "Add tests for ve.dm.InternalLists" 2013-05-28 21:11:07 +00:00
Ed Sanders c1136ca8e2 Add tests for ve.dm.InternalLists
Also fix clone method when no document supplied.

Change-Id: I7b24e8622049c6293fa0ef813696d5d91a901e75
2013-05-28 22:08:52 +01:00
Trevor Parscal 6d8de30853 Use config object for ve.ui.PagedDialog.addPage optional args
Objectives;

* Cleanup the addPage API
* Add optional index param to addPage method

Changes:

ve.ui.MWMetaDialog.js, ve.ui.MWTemplateDialog.js
* Update uses of addPage

ve.ui.PagedDialog.js
* Bundle existing optional arguments into object
* Add index option for inserting a specific index

Change-Id: Idcef4d0a52fb817c7d888990920b2c12224a3392
2013-05-28 20:33:32 +01:00
Moriel Schottlender 5e9c9b9367 A fix for arrow movements in RTL wikis.
This will make sure the marker moves correctly (backwards/forward)
in RTL languages as well as LTR languages, judging from the wiki pageLanguage.
This can be a quickfix until the movement can be decided per the direction
of the specific element (span/paragraph/div) the marker is in.

Bug: 38546
Change-Id: Ic01e110a5e6094cd275327a2e8cea90c900f1bd1
2013-05-28 14:50:20 -04:00
Trevor Parscal 8eb0efab9b Fix resizable nodes
Making sure resize handle events are bound and unbound on focus, and that elements are created in the right window.

Change-Id: Ie90bb82aa6c81c372d76278dab3665bd49bf573c
2013-05-28 17:36:31 +01:00