Commit graph

1518 commits

Author SHA1 Message Date
Trevor Parscal a62e011d68 Reduced selecting on the documentNode
Change-Id: I6f90e931eedad518d6716cb965606b8fb9387f1e
2012-06-19 10:50:41 -07:00
Trevor Parscal fed9915ba5 Reset the save dialog between uses
Also fixed the watchList binding for loading the right state

Change-Id: I25822ba9dfb25d5f8ade765baf6ae69adc9d40ae
2012-06-19 10:50:41 -07:00
Rob Moen d3cb2ccb26 write update and unlist method for list button tool
Change-Id: Ie1f0f8755aac7058d93890e13efefb3c63ee9710
2012-06-19 10:08:05 -07:00
Catrope 97a1edfd72 Crusade against hardcoded English, i18n for everything
Change-Id: Ibc658e5f67a373394a4ba149e9b9003f3803023a
2012-06-19 01:30:30 -07:00
Catrope 6a48f2b829 Fix inconsistent parameter lists for loadError and saveError events
Change-Id: I7d195793f05f98ff3218f494ef78f9981f6b716f
2012-06-19 01:24:40 -07:00
Catrope c15b9d04a0 Fix typos in license text
Change-Id: I0777955b976c2a5d11e5cde78d12b403b8ec7828
2012-06-19 01:24:40 -07:00
Catrope 5db6504cd3 Fix method docs for change(), you can't actually pass multiple transactions
Change-Id: I24dd0bd009cd2a7588d8bd45c4580460d49271c7
2012-06-19 01:24:40 -07:00
Inez Korczynski 3ac2c8e494 Improve handling for enter key - and support typing "on the selection" by removing selection first. 2012-06-18 22:25:16 -07:00
Inez Korczynski 4cef63538f Replace every second space with   and do the same for the first space and last space. 2012-06-18 22:24:18 -07:00
Inez Korczynski 5e845979b8 Merge branch 'dmrewrite' of ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor into dmrewrite 2012-06-18 22:23:15 -07:00
Trevor Parscal ca4f19c726 Fixed remaining uses of transact to change
Change-Id: I63c8fb183be8b37db85ed386d7bf33633e821f80
2012-06-18 22:05:05 -07:00
Trevor Parscal d6dd113d8d Adjusted fades and cleaned up URI objects
Change-Id: I2c6d5758c958ddc222293152707f13d7ae560343
2012-06-18 21:47:43 -07:00
Trevor Parscal 26dee2c8ea Switched to using "pageName" instead of "title" since page names include the namespace prefix, so it's more correct
Change-Id: Icd1a76ad317fc88f7895654ec1c41144c2695648
2012-06-18 21:47:43 -07:00
Trevor Parscal ea81d217b5 Work around broken .clone in mw.Uri
Change-Id: I5e3605c626fc3429c332feab839f555d279e11f7
2012-06-18 21:47:43 -07:00
Catrope 675bd284c5 Make the converter not return an empty document
Various parts of DM and CE choke on completely empty documents, so
return an empty paragraph instead.

Change-Id: I67062b66a44efe53a1bdaf60907653f0cc55dd25
2012-06-18 17:42:12 -07:00
Catrope 0e95b20cda If the page doesn't exist, create a "Create" tab, not an "Edit" tab
Change-Id: Ic9fa936ac96539ca65e2d570a2c5419dc19334df
2012-06-18 17:42:11 -07:00
Trevor Parscal 44d297f8ff Fixed post-save behavior
Change-Id: Ib9bb5d725b1cba2f3e8eb9aa9cf4f2dd2fc87229
2012-06-18 17:39:31 -07:00
Trevor Parscal 4ffc6fff60 Was checking the wrong thing for undefined
Change-Id: I11b813fe8708ef03db2f8b884b3766d8cbe887ce
2012-06-18 17:37:12 -07:00
Trevor Parscal cf1c033bff Added section edit link functionality from diff pages
Change-Id: I2dce543d352f4e086b96c65e53f1a90ef58072fb
2012-06-18 16:52:37 -07:00
Inez Korczynski f97ef02370 Early version of support for typing in "slug" (turning it into paragraph) 2012-06-18 15:50:20 -07:00
Inez Korczynski 6276938d21 Fix problem with turning elements of one type into elements of another type. 2012-06-18 15:30:23 -07:00
Inez Korczynski 6d5e524817 Cleanup in ve.ce.Surface - no significant changes 2012-06-18 15:11:54 -07:00
Inez Korczynski 52aaabd499 Fix ListButtonTool to use method "change" instead of old "transact" 2012-06-18 15:04:30 -07:00
Inez Korczynski 79b1726b70 Merge branch 'dmrewrite' of ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor into dmrewrite 2012-06-18 15:04:00 -07:00
Inez Korczynski 78028ff588 Ported method debounce from underscore.js to ve. 2012-06-18 15:03:38 -07:00
Trevor Parscal f49aa141aa Redirect through the view page when coming from a diff page
Also added URL mixup using window.history.replaceState

Change-Id: If84998b0fe945d82fdfa9a8c88391db30286e972
2012-06-18 14:53:28 -07:00
Inez Korczynski 81375698a2 Fix minor bug in ve.log 2012-06-18 14:48:42 -07:00
Trevor Parscal 70b8c92660 Converted more uses of console.log to ve.log
Change-Id: Id41130de088e56dbe8774689317002baa66f5950
2012-06-18 14:19:07 -07:00
Trevor Parscal 76bca4f520 Added veaction param which auto-initializes the editor
Made edit tabs rendered on non view pages work correctly by routing them to the view page with an extra param that auto-initializes the editor

Change-Id: I4fd9106c8b45c6fc79af9ccb44e18944e9b9d8b9
2012-06-18 14:13:26 -07:00
Trevor Parscal 11a3d883f2 Using resource loader debug scripts to unstub ve.log
Also added ve.dir and converted use of console.log to ve.log

Change-Id: Ibbfd78b6ece163f54f40e997c79a01de6609c2b4
2012-06-18 13:30:39 -07:00
Inez Korczynski 1fa1908402 Merge branch 'dmrewrite' of ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor into dmrewrite 2012-06-18 13:19:24 -07:00
Inez Korczynski 8b823a7dc6 Introduce new method in Surface model called "change" and get rid of "setSelection" and "transact". Start using new method in Surface view - which right away fixes two bugs - typing at the and of the document, and typing in newly created paragraph/heading. 2012-06-18 13:19:07 -07:00
Trevor Parscal 005721cb81 Major cleanup, fixes and refactoring of ve.init
This solves lots of issues in the integration work, and also makes it much easier to extend this class to integrate it into other skins

Change-Id: I3b3c5b22a5664e6cf37e429cc0ac3be2e75b630f
2012-06-18 13:12:47 -07:00
Trevor Parscal debef5671c Made the first paragraph in a list item have no margins or padding to simulate raw text
Change-Id: I7e0aeb9a15db4a56f2a3552430c0da0202f97a97
2012-06-18 13:12:47 -07:00
Christian Williams ad1e4947d7 Fixing ve.log for IE9
Change-Id: Idfcb68abcdae606a4fd78bfec51cb18a8fb495a2
2012-06-18 12:21:22 -07:00
Subramanya Sastry 18541f0286 Couple minor bug fixes in serializer
Change-Id: I961e2f4e7609cc6b264eaf494b39497401cdc55c
2012-06-18 11:25:21 -07:00
Gabriel Wicke de47a68aaa Emit SpaceCharacters token for HTML5 'space' chars
HTML5 defines space characters as [ \r\n\t\f] in
http://www.whatwg.org/specs/web-apps/current-work/multipage/common-microsyntaxes.html#space-character.
It treats these specially in a few contexts. As an example, the foster
parenting algorithm does not apply to space characters.

As a result, this change fixes the round-tripping of spaces between table
tags, which were previously moved before the table.

Change-Id: I32ab29275a9f824fc66d8286638eb42748cfc9a5
2012-06-18 11:25:21 -07:00
Subramanya Sastry 9b5404e288 First pass redoing serialization code to handle newline requirements
from Parsoid HTML output as well as VE HTML output.  There are still
some newline related failures from parser tests that needs fixing, but
this is getting close.  So committing for now so other eyes can make the
bugs shallow :).

Change-Id: Ia6a218ee9fb3e18fe0573c89ff3a4236779e1e64
2012-06-18 11:25:21 -07:00
Subramanya Sastry 2271f19ecf Removed newline normalization between paragraphs.
Change-Id: Ifd55db73c8fe2b3e952066a75cba2f8e13c58430
2012-06-18 11:25:21 -07:00
Subramanya Sastry 8fd901850c Fix for href handling.
- Check if href for links has the wgScriptPath prefix before
  attempting to strip it from the href.

Change-Id: I844151ef7317476668d1306b96a2aec5a56fd0f1
2012-06-18 11:25:21 -07:00
Subramanya Sastry 18de05ba7f Updated newline handling around lists and nested lists.
- Something like this:
    <ul><li>1</li><li>2<ul><li>2.1</li><li>2.2<ul><li>2.2.1</li><li>2.2.2</li></ul></li><li>2.3</li></ul></li><li>3</li></ul>
  now serializes properly to:

    *1
    *2
    **2.1
    **2.2
    ***2.2.1
    ***2.2.2
    **2.3
    *3

  So does this form which is what the above wikitext parses to:
    <ul><li>1
    </li><li>2
    <ul><li>2.1
    </li><li>2.2
    <ul><li>2.2.1
    </li><li>2.2.2
    </li></ul></li><li>2.3
    </li></ul></li><li>3
    </li></ul>

- Lists (and nested lists) are not entirely newline-insensitive.
  They still depend on newlines *between* lists.  The opening
  <ul> tag for non-nested lists should always start on a new line.
  So, for example,
    <ul><li>foo</li></ul><ul><li>bar</li></ul>
  will serialize to:
    *foo
    *bar
  which is incorrect.  But,
    <ul><li>foo</li></ul>
    <ul><li>bar</li></ul>
  will correctly serialize to:
    *foo

    *bar

Change-Id: I13a0290368574865957bcf57aebab488fbbb7026
2012-06-18 11:25:21 -07:00
Subramanya Sastry 9e5ed592fc Minor code refactoring
Change-Id: Ib7f70a3ac42e3d5a5985e9a9bcffa313bdac289b
2012-06-18 11:25:21 -07:00
Subramanya Sastry 031602f525 Fixed/updated newline handling for <p> tags
- More pieces are now simplified and all(?) newline handling
  is now centralized in the serializeToken function.

- This commit fixes bugs in rt-ing some code snippets
    ----------
    Ex 1: foo<p>bar</p>baz
    ----------

- This commit fixes bugs serializing VE generated html
    ----------
    Ex 2: <p>foo</p><pre>bar</pre> ==> foo\n bar
    ----------

- But, this round of fixes introduces RT failures for certain
  code examples in parserTests.txt.  In all these failing cases,
  inline text/html is embedded within a generated <p> tag during
  parsing.  If these generated <p> tags can have a "gc:1" attribute
  added to them, we can properly serialize them to the original
  form.
    ----------
    Ex 3: foo<pre>bar</pre>
          Parsed HTML: <p>foo</p><pre>bar</pre>
    ----------
  Note how this parsed HTML is identical to what the VE outputs
  in Example 2 above.  So, without the gc:1 attribute, we now
  have conflicting requirements on the example same HTML.
  This increases confidence in the correctness of my commit here.

Change-Id: I86beadec91c445a7f8a6d36a639b406697daa0a2
2012-06-18 11:25:21 -07:00
Subramanya Sastry 7c5a0f680f Refix <pre> serialization.
- Effectively reverted fix from f882a65153
  and added a new fix.

Change-Id: I8b81e26525a5f1a22acaf2c7067f2dcd9b962818
2012-06-18 11:25:21 -07:00
Subramanya Sastry f745633797 Improved, simplified newline handling in wikitext serializer.
- Eliminated newline handling from several places in code and
  mostly isolated it to serializeToken thus simplifying newline
  handling logic.
- Fixing some bugs in the process: # of green roundtrip tests
  went up by 5 (294 --> 299) but actually introduced failures on
  a few originally succeeding tests (additional leading/trailing
  newlines on the entire test output).
- Added bonus: made list serializing (mostly) insensitive to
  newlines between tags.  So, all the following DOM serialize
  identically to the following wikitext:

  *foo
  *bar

  ----------
  <ul><li>foo</li><li>bar</li></ul>

  ----------
  <ul>
  <li>foo</li>
  <li>bar</li>
  </ul>
  ----------
  <ul>

  <li>
  foo

  </li>

  <li>
  bar</li>

  </ul>
  ----------

Change-Id: I76be56c4b2789039dff5f47de4659746882e45d6
2012-06-18 11:25:20 -07:00
Catrope b74f24851a Actually fix getRange() this time. Hopefully.
Change-Id: I583a9c2c1ae01370988b4a34ddbf7d3d231e0a74
2012-06-15 16:09:08 -07:00
Christian Williams 3885eb766d Using empty pseudo selector and blank image dataURI to battle IE's ridiculous hasLayout bug.
Change-Id: I2acec8ff4d7444726b94c46fc53c0085457c959e
2012-06-15 15:14:13 -07:00
Christian Williams 8805cebc6e Start/stop poll handling for cut and paste
Change-Id: I8a9dcad6f320bdc90b79bfeaad10622543483ffa
2012-06-15 11:47:05 -07:00
Rob Moen d1eba674b1 Write a better debounced onSelect method for showing the context
view icon after select events are finished being fired.

Change-Id: I4e1307b90eed14b1c9167830018e50b9c7832ae6
2012-06-15 10:46:45 -07:00
Catrope 0be0ebf4a8 Forgot to add dl as a sublist type
Change-Id: Ie04904ffdaf20402dbb22ebe96bcaf2db9ea8b8a
2012-06-15 00:07:09 -07:00