Commit graph

75 commits

Author SHA1 Message Date
Ed Sanders 0c82889ac5 Update built html files
Change-Id: Iae32c35aca7cbdcce83b424763318a2609c3e9f1
2014-04-22 17:01:00 -07:00
James D. Forrester 7cc2190e68 Update .docs/eg-iframe.html to current
Change-Id: I323265e303258929eac5d85a96a412315c6780a5
2014-04-21 09:06:39 -07:00
Roan Kattouw 9312501824 Update VE core submodule to master (2d96306)
Add reference to DimensionsWidget.css

New changes:
2d96306 [BREAKING CHANGE] Separate Widget styles properly

Change-Id: I84c1a3576b8eca74d483e26a4affd21f790040ad
2014-04-16 16:02:51 -07:00
Roan Kattouw f2422d916c Update VE core submodule to master (c150259) for scalable changes
ve.dm.Scalable is now a computational model for image scaling and
size manipulation. This commit adjusts the nodes and the edit and
insertion dialog to handle the new scalable model, and by that
use a centralized computational engine for all scaling and size
changes.

New changes:
3ec19fb8 Refactor Scalable functionality

Change-Id: I017a017924f544cc8bc9b7d8245335759ae0e890
2014-04-09 17:29:49 -07:00
Trevor Parscal 793fbb0e24 Correctly insert or update citations based on template option
When using a tool that opens a citation or citation transclusion dialog,
the dialog shouldn't use edit mode unless the template in the node and the
template the tool would insert match.

Bug: 63452
Change-Id: I34a5a2da576247f4046da45f742bccc3cec22c5a
2014-04-02 16:38:34 -07:00
Roan Kattouw 39f8019c47 Update VE core submodule to master (9484b81)
New changes:
b045c0c Localisation updates from https://translatewiki.net.
3221c45 Introduce ve.ui.Tool
c3a2a85 Detect document focus properly and allow null selection in model
03fed20 Localisation updates from https://translatewiki.net.
07dfc7d Actually use getRelative[Content|Structural]Offset wrappers
8fced5f Show VE demo error in VE
547e3d2 Localisation updates from https://translatewiki.net.
d6316f5 Fix handlesOwnChildren check in getRelativeOffset
e23f1ab Style link inspector on mobile
5968559 Localisation updates from https://translatewiki.net.
4bce90c Bump jscs to 0.4.1
7e39f49 Disable certain tools when surface has no range
edde8ca Emit event when insertion annotations change
2a89173 Update OOjs UI to v0.1.0-pre (8986c46d35)
103c4b9 Support null ranges in the demo debug bar
9eb3810 Adjust loop counters in word break detection when removing item
914e002 Skip over handlesOwnChildren nodes in newFromAnnotation
ef6096a Improve hasFocus check to compare the anchorNode to the parent
18171bf Revert "Improve hasFocus check to compare the anchorNode to the parent"
3950cef Revert "Detect document focus properly and allow null selection in model"
1c4cac4 Revert "Fix handlesOwnChildren check in getRelativeOffset"

Change-Id: Ic3054c668866307a5cfbb74f23efd82ceb2f0ee3
2014-04-02 16:15:01 -07:00
James D. Forrester 66d8fc9d9f Add missing VE core themes/apex/ve.ui.Inspector.css to .docs/eg-iframe.html
Follows-up I4af6c0341.

Change-Id: Ia0d2c22aa647ea1ee6cca8a38d99a8eb14aa3c87
2014-04-01 23:23:32 +00:00
Trevor Parscal 46e7f55ba5 Update VE core submodule to master (1adc9f5)
New changes:
e02cb87 Fix left-over autoAdd property that didn't get fixed with Idaf3041
74037b0 Split up omnibus CSS files into per-item ones
1adc9f5 Localisation updates from https://translatewiki.net.

Change-Id: I71498cd0b990aebd85dabb68afb3485350b8ac36
2014-03-21 16:42:33 -07:00
James D. Forrester f8720326b0 Split out omnibus CSS files
Change-Id: I195a0e4091cf2d003c325e9c653dd634e7096779
2014-03-21 20:14:52 +00:00
James D. Forrester 6322ec3afb Add missing ve.ce.ClickableNode.js to .docs/eg-iframe.html
Change-Id: Ibaf3a11116b43acc4d150c2950432229a3109acf
2014-03-19 19:35:41 -07:00
Roan Kattouw 6b22f272e9 Rerun grunt to regenerate eg-iframe.html
Change-Id: I5f0d03407eadcdb811281b1406fe664d280504c3
2014-03-14 15:28:29 -07:00
Trevor Parscal 42ba981e27 Update VE core submodule to master (520299e)
New changes:
dd15f23 Split ve.ui.Surface into DesktopSurface and MobileSurface
16283f4 Add OOjs UI's sco.json i18n file
ef94038 Split ve.ui.Context into DesktopContext and MobileContext

Minor adjustments to point to desktop and mobile Surface or Context.

Change-Id: I7cf6f99a5a1216a28a7146afcd4deb68c7eac38e
2014-03-14 13:13:02 -07:00
James D. Forrester ba71dadd26 Add new ve.dm.CommentMetaItem.js to .docs/eg-iframe.html
Change-Id: I31906c45356820591cbedf1ab0111706dd109575
2014-03-13 15:49:20 -07:00
Roan Kattouw 561927627e Rebuild eg-iframe.html for e1d8ebd in VE core
Change-Id: Ie6b708e19f970611320ae86dec47e97ce7133ba3
2014-03-10 14:00:13 -07:00
Roan Kattouw 19f7afb70e Update VE core submodule to master (165594b)
Remove GroupButtonWidget since it was removed in VE core.

New changes:
22edcd9 Special character inspector styling

Change-Id: I385d6b655686c753262258714dec06f8b1e5fc10
2014-03-05 15:39:10 -08:00
Roan Kattouw d2df039af2 Rebuild .docs/eg-iframe.html
Change-Id: I010eb7fc1d043494c34cb9f6d1c17af501bf8a68
2014-02-06 00:58:51 +00:00
Timo Tijhof dd9ff827b5 Follow-up 7994eae8c2: Fix uncommitted loader change causing 404
That commit added jquery.uls to the ve-mw repo, and updated
lib/ve to a commit after we removed it from the ve repo and from
modules.json. These changes are being made by grunt-build every
run and should've been comitted to the repo.

See also 1e92abe028.

Change-Id: Ie318643d080e9f5a63793ef60153ef4d82a13d8c
2014-01-29 06:23:50 +00:00
Timo Tijhof 1944b0c6f0 jsduck: Fix script loading issues with eg-iframe in production
It works locally because it can just nagivate to ../lib/ve.

In production however we need docs/ to be standalone so that we
can publish it without needing a subdirectory at:
https://docs.wikimedia.org/VisualEditor/master/.

For local usage this will be a symlink that still points to
the sibling directory (but using a symlink instead of a ../ path).
In production we can then instruct jenkins to replace that symlink
with an actual copy of lib/. As long as the generated path
references in the HTML remain the same.

Follows-up 88c4888872, which broke the publication of the docs in
Jenkins as it changed references from modules/ to ../modules/ for
the eg-iframe. This works locally, but broke in Jenkins as it was relying
on the copying of modules/ to docs/modules/ being enough to make it work).

Change-Id: I10eaa5424d172932b29774a0f03d511d555fd121
2014-01-16 20:41:20 +00:00
Ed Sanders a703086e61 Keyboard shortcuts MW integration
Also adds a button to the utilities menu.

Depends on I806343b42c5fc63d.

Bug: 52844
Change-Id: Ia488362f4b8c9b99b615c84a7341d97e28bdb295
2014-01-15 14:04:06 -08:00
Roan Kattouw ee743f869d Use submodule for VisualEditor core
* Add lib/ve.
* Remove modules provided by VisualEditor core.
* Update paths.
* Remove VisualEditor core specific things from Gruntfile.
* Remove entries from external.js already in lib/ve/.docs/external.js.
* Implement build script to compose a jsduck index that includes
  all of VisualEditor core. Right now it includes VisualEditor's
  index as-is, and because those patterns (e.g. ve.dm.*Node) will
  also MW subclasses this means our category page will include
  MW classes under "VisualEditor (core)" (before the repo split,
  this was intentional).
  This is inevitable unless we list every class individually, or
  (the plan) until we move the MW subclasses out of the ve.*
  namespace and into mw.* somewhere.

Bug: 45342
Change-Id: Iff45cd555430634c9fc341fd3b177c1e0625300b
2013-12-20 09:18:41 +00:00
Roan Kattouw c41b60021d Move libraries to the lib/ directory
Didn't move unicodejs because it doesn't have its own repo
and is currently mastered in this repo

Change-Id: I14ab4bd641077d993ac235d8bcdcf8e50a1a72a7
2013-12-19 23:02:52 +01:00
Timo Tijhof 3e9b227a6a Clean up HTML files, Gruntfile and remove index-phantomjs-tmp hack
Consistently:
* Use <!DOCTYPE html>.
* Use lowercase element tags.
* Indent <head> from <html>.
* Use <meta charset="utf-8">.
* Indent <script> and <style> content from open/close tag.
* Put <link> before <script> when in <head> (in ve/test).
* Use .html instead of .php for indexes where PHP is no
  longer used.
* Use the same license header as we use elsewhere (/*! instead
  of /** and no @file)

Gruntfile:
* Include the new .js files in jshint (demos/**/*.js).
* Order buildloader keys in the same order as the directories
  they go to (alphabetically).
* Add missing jshint patterns:
  - .docs/**/*.js
  - build/**/*.js
  - modules/ve-wmf/**/*.js
* Add missing qunit test:
  - qunit.unicodejs
* Add missing watch patterns:
  - .jscs.json
  - qunit.unicodejs

Also:
* Moved relatively large pieces of script into separate files
  so that they are less repeated (though .template) and also
  able to be linted properly.
* Fixed jshint warnings in newly-created trigger.js and demo.js.
* Moved <script> elements already in <body> to bottom of <body>
  (in ve/test and eg-iframe).
* Moved <script> in eg-iframe from <head> to <body>.
* Fixed buildloader grunt task to use a non-\n whitespace match.
  for the start as well, the newline before the placeholder was
  being stripped.
* Removed the (now obsolete) index-phantomjs-tmp hack.

Change-Id: I7c5a371b82f69f367a8e1c11673d2f37868bc931
2013-12-18 07:00:23 +00:00
Roan Kattouw 88c4888872 Replace makeStaticLoader with a grunt task
'grunt build' builds modules/ve/test/index.php, demos/ve/index.php
and .docs/eg-iframe.html from the associated *.template files.

Got rid of the JS-based SVG/PNG switching logic. Instead, we now
just use SVG unconditionally. We'd already dropped browser support
for browsers that don't support SVG anyway.

Change-Id: Iba2e68f17904687cb13e793a410e095f28f1b13c
2013-12-17 22:03:01 +01:00
Timo Tijhof 62aeb254d9 Implement inline documentation examples.
Refactored the (previously unused) eg-iframe file to be a
template with 2 placeholders for script and styles.

The previous version was just the basic version to execute
javascript code, but that's not good enough since we need a
whole bunch of classes to be loaded.

A bash file processes the template into proper html, with the
help of the makeStaticLoader maintenance script we already had.

Updated demo.css, cleaned up redundant properties restyled
slightly to be more like the Vector skin and less "raw".

Fixed default $IP path in makeStaticLoader.php to work with simple mediawiki core installs having the extension in the
regular extensions directory, and prefixed __DIR__ so it
doesn't rely on the directory you call it from.

Change-Id: Ic789121dfeca08d9db69564d2ad2e52b3fa45de9
2013-02-08 17:47:10 -08:00
Timo Tijhof b11bbed7a6 JSDuck: Generated code documentation!
See CODING.md for how to run it.

Mistakes fixed:
* Warning: Unknown type function
  -> Function
* Warning: Unknown type DOMElement
  -> HTMLElement
* Warning: Unknown type DOM Node
  -> HTMLElement
* Warning: Unknown type Integer
  -> Mixed
* Warning: Unknown type Command
  -> ve.Command
* Warning: Unknown type any
  -> number
* Warning: Unknown type ve.Transaction
  -> ve.dm.Transaction
* Warning: Unknown type ve.dm.AnnotationSet
  -> ve.AnnotationSet
* Warning: Unknown type false
  -> boolean
* Warning: Unknown type ve.dm.AlienNode
  ve.dm doesn't have a generic AlienNode like ve.ce
  -> Unknown type ve.dm.AlienInlineNode|ve.dm.AlienBlockNode
* Warning: Unknown type ve.ve.Surface
  -> ve.ce.Surface
* ve.example.lookupNode:
  -> Last @param should be @return
* ve.dm.Transaction.prototype.pushReplace:
  -> @param {Array] should be @param {Array}
* Warning: ve.BranchNode.js:27: {@link ve.Node#hasChildren} links to non-existing member
  -> (removed)
* Warning: ve.LeafNode.js:21: {@link ve.Node#hasChildren} links to non-existing member
  -> (removed)

Differences fixed:
* Variadic arguments are like @param {Type...} [name]
  instead of @param {Type} [name...]
* Convert all file headers from /** to /*! because JSDuck tries
  to parse all /** blocks and fails to parse with all sorts of
   errors for "Global property", "Unnamed property", and
  "Duplicate property".
  Find: \/\*\*([^@]+)(@copyright)
  Replace: /*!$1$2
* Indented blocks are considered code examples.
  A few methods had documentation with numbered lists that were
  indented, which have now been updated to not be intended.
* The free-form text descriptions are parsed with Markdown,
  which requires lists to be separated from paragraphs by an
  empty line.
  And we should use `backticks` instead of {braces} for inline
  code in text paragraphs.
* Doc blocks for classes and their constructor have to be
  in the correct order (@constructor, @param, @return must be
  before @class, @abstract, @extends etc.)
* `@extends Class` must not have Class {wrapped}
* @throws must start with a {Type}
* @example means something else. It is used for an  inline demo
  iframe, not code block. For that simply indent with spaces.
* @member means something else.
  Non-function properties are marked with @property, not @member.
* To create a link to a class or member, in most cases the name
  is enough to create a link. E.g. Foo, Foo.bar, Foo.bar#quux,
  where a hash stands for "instance member", so Foo.bar#quux,
  links to Foo.bar.prototype.quux (the is not supported, as
  "prototype" is considered an implementation detail, it only
  indexes class name and method name).
  If the magic linker doesn't work for some case, the
  verbose syntax is {@link #target label}.
* @property can't have sub-properties (nested @param and @return
  values are supported, only @static @property can't be nested).
  We only have one case of this, which can be worked around by
  moving those in a new virtual class. The code is unaltered
  (only moved down so that it isn't with the scope of the main
  @class block). ve.dm.TransactionProcessor.processors.

New:
* @mixins: Classes mixed into the current class.
* @event: Events that can be emitted by a class. These are also
  inherited by subclasses. (+ @param, @return and @preventable).
  So ve.Node#event-attach is inherited to ve.dm.BreakNode,
  just like @method is.
* @singleton: Plain objects such as ve, ve.dm, ve.ce were missing
  documentation causing a tree error. Documented those as a
  JSDuck singleton, which they but just weren't documented yet.
  NB: Members of @singleton don't need @static (if present,
  triggers a compiler warning).
* @chainable: Shorthand for "@return this". We were using
  "@return {classname}" which is ambiguous (returns the same
  instance or another instance?), @chainable is specifically
  for "@return this". Creates proper labels in the generated
  HTML pages.

Removed:
* @mixin: (not to be confused with @mixins). Not supported by
  JSDuck. Every class is standalone anyway. Where needed marked
  them @class + @abstract instead.

Change-Id: I6a7c9e8ee8f995731bc205d666167874eb2ebe23
2013-01-05 01:16:32 +01:00