2011-11-28 20:28:28 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* VisualEditor extension
|
2012-07-19 21:25:16 +00:00
|
|
|
*
|
2011-11-28 20:28:28 +00:00
|
|
|
* @file
|
|
|
|
* @ingroup Extensions
|
2012-07-19 00:11:26 +00:00
|
|
|
* @copyright 2011-2012 VisualEditor Team and others; see AUTHORS.txt
|
|
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
2011-11-28 20:28:28 +00:00
|
|
|
*/
|
|
|
|
|
2012-06-06 23:11:29 +00:00
|
|
|
/* Configuration */
|
|
|
|
|
2012-08-01 06:50:19 +00:00
|
|
|
// URL to the Parsoid instance
|
2012-08-14 00:56:30 +00:00
|
|
|
// MUST NOT end in a slash due to Parsoid bug
|
Kranitor #1: On-boarding
'''Kranitor commits''' are commits by Krinkle with his janitor hat on.
Must never contain functional changes mixed with miscellaneous changes.
.gitignore:
* Add .DS_Store to the ignore list so that browsing the directories
on Mac OS X, will not add these files to the list of untracked
files.
* Fix missing newline at end of file
.jshintrc
* raises -> throws
* +module (QUnit.module)
* remove 'Node' (as of node-jshint 1.7.2 this is now part of
'browser:true', as it should be)
Authors:
* Adding myself
MWExtension/VisualEditor.php
* Fix default value of wgVisualEditorParsoidURL to not
point to the experimental instance in WMF Labs.
Issues:
* ve.ce.TextNode:
- Fix TODO: Don't perform a useless clone of an already-jQuerified object.
- Use .html() to set html content instead of encapsulating between
two strings. This is slightly faster but more importantly safer,
and prevents situations where the resulting jQuery collection
actually contains 2 elements instead of 1, thus messing up
what .contents() is iterating over.
* ve.ce.Document.test.js
- Fix: ReferenceError: assert is not defined
* ve.dm.Document.test.js
- Fix: ReferenceError: assert is not defined
* ve.dm.Transaction.test.js
- Fix: ReferenceError: assert is not defined
* ve.dm.TransactionProcessor.test.js
- Fix: ReferenceError: assert is not defined
* ext.visualEditor.viewPageTarget
- Missing dependency on 'mediawiki.Title'
Code conventions / Misc cleanup
* Various JSHint warnings.
* Whitespace
* jQuery(): Use '<tag>' for element creation,
use '<valid><xml/></valid>' for parsing
* Use the default operator instead of ternary when the condition and
first value are the same.
x = foo ? foo : bar; -> x = foo || bar;
Because contrary to some programming language (PHP...), in JS the
default operator does not enforce a boolean result but returns the
original value, hence it being called the 'default' operator, as
opposed to the 'or' operator.
* No need to call addClass() twice, it takes a space-separated list
(jQuery splits by space and adds if needed)
* Use .on( event[, selector], fn ) instead of the deprecated
routers to it such as .bind(), .delegate() and .live().
All these three are now built-in and fully compatible with .on()
* Add 'XXX:' comments for suspicious code that I don't want to change
as part of a clean up commit.
* Remove unused variables (several var x = this; where x was not
used anywhere, possibly from boilerplate copy/paste)
* Follows-up Trevor's commit that converts test suites to the new
QUnit format. Also removed the globals since we no longer use those
any more.
Change-Id: I7e37c9bff812e371c7f65a6fd85d9e2af3e0a22f
2012-07-27 08:43:33 +00:00
|
|
|
$wgVisualEditorParsoidURL = 'http://localhost:8000';
|
2012-08-01 06:50:19 +00:00
|
|
|
// Interwiki prefix to pass to the Parsoid instance
|
2012-08-14 00:56:30 +00:00
|
|
|
// Parsoid will be called as $url/$prefix/$pagename
|
|
|
|
$wgVisualEditorParsoidPrefix = 'localhost';
|
2012-11-15 01:16:13 +00:00
|
|
|
// Timeout for HTTP requests to Parsoid in seconds
|
|
|
|
$wgVisualEditorParsoidTimeout = 100;
|
2012-11-05 20:46:14 +00:00
|
|
|
// Namespaces to enable VisualEditor in
|
|
|
|
$wgVisualEditorNamespaces = array( NS_MAIN );
|
2012-11-22 02:26:29 +00:00
|
|
|
// Whether to use change tagging for VisualEditor edits
|
|
|
|
$wgVisualEditorUseChangeTagging = true;
|
2012-06-06 23:11:29 +00:00
|
|
|
|
2011-11-28 20:28:28 +00:00
|
|
|
/* Setup */
|
|
|
|
|
|
|
|
$wgExtensionCredits['other'][] = array(
|
|
|
|
'path' => __FILE__,
|
|
|
|
'name' => 'VisualEditor',
|
|
|
|
'author' => array(
|
|
|
|
'Trevor Parscal',
|
|
|
|
'Inez Korczyński',
|
|
|
|
'Roan Kattouw',
|
|
|
|
'Neil Kandalgaonkar',
|
|
|
|
'Gabriel Wicke',
|
|
|
|
'Brion Vibber',
|
2012-06-25 23:26:48 +00:00
|
|
|
'Christian Williams',
|
|
|
|
'Rob Moen',
|
|
|
|
'Subramanya Sastry',
|
2012-07-27 23:43:27 +00:00
|
|
|
'Timo Tijhof',
|
2011-11-28 20:28:28 +00:00
|
|
|
),
|
|
|
|
'version' => '0.1.0',
|
2011-12-13 23:49:33 +00:00
|
|
|
'url' => 'https://www.mediawiki.org/wiki/Extension:VisualEditor',
|
2011-11-28 20:28:28 +00:00
|
|
|
'descriptionmsg' => 'visualeditor-desc',
|
|
|
|
);
|
|
|
|
$dir = dirname( __FILE__ ) . '/';
|
|
|
|
$wgExtensionMessagesFiles['VisualEditor'] = $dir . 'VisualEditor.i18n.php';
|
|
|
|
|
|
|
|
$wgVisualEditorResourceTemplate = array(
|
|
|
|
'localBasePath' => dirname( __FILE__ ) . '/modules',
|
|
|
|
'remoteExtPath' => 'VisualEditor/modules',
|
|
|
|
'group' => 'ext.visualEditor',
|
|
|
|
);
|
|
|
|
|
2012-12-11 03:40:09 +00:00
|
|
|
$wgVisualEditorEditNotices = array( 'visualeditor-alphawarning' );
|
|
|
|
|
2011-11-28 20:28:28 +00:00
|
|
|
$wgResourceModules += array(
|
2012-03-29 21:05:25 +00:00
|
|
|
'rangy' => $wgVisualEditorResourceTemplate + array(
|
|
|
|
'scripts' => array(
|
|
|
|
'rangy/rangy-core.js',
|
|
|
|
'rangy/rangy-position.js',
|
|
|
|
),
|
|
|
|
),
|
2012-11-06 18:56:03 +00:00
|
|
|
'jquery.multiSuggest' => $wgVisualEditorResourceTemplate + array(
|
|
|
|
'scripts' => array(
|
|
|
|
'jquery/jquery.multiSuggest.js'
|
|
|
|
),
|
|
|
|
),
|
2012-06-28 09:52:03 +00:00
|
|
|
// Alias for backwards compat, safe to remove after
|
|
|
|
'ext.visualEditor.editPageInit' => $wgVisualEditorResourceTemplate + array(
|
2011-11-28 20:28:28 +00:00
|
|
|
'dependencies' => array(
|
2012-06-28 09:52:03 +00:00
|
|
|
'ext.visualEditor.viewPageTarget',
|
|
|
|
)
|
2011-11-28 20:28:28 +00:00
|
|
|
),
|
2012-08-30 20:04:22 +00:00
|
|
|
'ext.visualEditor.viewPageTarget.icons-raster' => $wgVisualEditorResourceTemplate + array(
|
|
|
|
'styles' => array(
|
|
|
|
've/init/mw/styles/ve.init.mw.ViewPageTarget.Icons-raster.css',
|
|
|
|
),
|
|
|
|
),
|
|
|
|
'ext.visualEditor.viewPageTarget.icons-vector' => $wgVisualEditorResourceTemplate + array(
|
|
|
|
'styles' => array(
|
|
|
|
've/init/mw/styles/ve.init.mw.ViewPageTarget.Icons-vector.css',
|
|
|
|
),
|
|
|
|
),
|
2012-06-28 09:52:03 +00:00
|
|
|
'ext.visualEditor.viewPageTarget' => $wgVisualEditorResourceTemplate + array(
|
2012-05-25 19:50:48 +00:00
|
|
|
'scripts' => array(
|
2012-07-20 23:59:59 +00:00
|
|
|
've/init/mw/ve.init.mw.js',
|
|
|
|
've/init/mw/ve.init.mw.Platform.js',
|
|
|
|
've/init/mw/ve.init.mw.Target.js',
|
|
|
|
've/init/mw/targets/ve.init.mw.ViewPageTarget.js',
|
2012-06-11 06:54:41 +00:00
|
|
|
),
|
|
|
|
'styles' => array(
|
2012-07-20 23:59:59 +00:00
|
|
|
've/init/mw/styles/ve.init.mw.ViewPageTarget.css',
|
2012-08-17 20:16:25 +00:00
|
|
|
),
|
|
|
|
'skinStyles' => array(
|
|
|
|
'vector' => array(
|
|
|
|
've/init/mw/styles/ve.init.mw.ViewPageTarget-vector.css',
|
|
|
|
've/init/mw/styles/ve.init.mw.ViewPageTarget-vector-hd.css' => array(
|
|
|
|
'media' => 'screen and (min-width: 982px)'
|
|
|
|
),
|
2012-06-14 01:26:21 +00:00
|
|
|
),
|
2012-08-17 20:16:25 +00:00
|
|
|
'apex' => array(
|
|
|
|
've/init/mw/styles/ve.init.mw.ViewPageTarget-apex.css',
|
2012-08-23 18:01:20 +00:00
|
|
|
),
|
|
|
|
'monobook' => array(
|
|
|
|
've/init/mw/styles/ve.init.mw.ViewPageTarget-monobook.css',
|
2012-08-17 20:16:25 +00:00
|
|
|
)
|
2012-06-11 06:54:41 +00:00
|
|
|
),
|
|
|
|
'dependencies' => array(
|
2012-07-20 23:59:59 +00:00
|
|
|
'ext.visualEditor.base',
|
2012-11-14 18:33:57 +00:00
|
|
|
'jquery.byteLength',
|
2012-12-02 03:44:07 +00:00
|
|
|
'jquery.byteLimit',
|
|
|
|
'jquery.client',
|
|
|
|
'jquery.placeholder',
|
2012-12-05 22:45:20 +00:00
|
|
|
'mediawiki.jqueryMsg',
|
2012-12-02 03:44:07 +00:00
|
|
|
'mediawiki.Title',
|
|
|
|
'mediawiki.Uri',
|
|
|
|
'mediawiki.user',
|
|
|
|
'mediawiki.util',
|
2012-12-11 22:13:54 +00:00
|
|
|
'mediawiki.notify',
|
2012-12-11 01:44:44 +00:00
|
|
|
'mediawiki.feedback',
|
2012-12-02 03:44:07 +00:00
|
|
|
'user.options',
|
|
|
|
'user.tokens',
|
2012-05-25 19:50:48 +00:00
|
|
|
),
|
|
|
|
'messages' => array(
|
2012-06-01 23:26:03 +00:00
|
|
|
'minoredit',
|
2012-12-05 00:33:58 +00:00
|
|
|
'cancel',
|
2012-06-01 23:26:03 +00:00
|
|
|
'watchthis',
|
|
|
|
'copyrightwarning',
|
|
|
|
'copyrightpage',
|
|
|
|
'edit',
|
2012-06-18 23:53:03 +00:00
|
|
|
'create',
|
2012-06-01 23:26:03 +00:00
|
|
|
'accesskey-ca-edit',
|
2012-11-28 18:11:11 +00:00
|
|
|
'accesskey-ca-ve-edit',
|
2012-06-04 21:29:27 +00:00
|
|
|
'tooltip-ca-edit',
|
2012-11-28 18:11:11 +00:00
|
|
|
'tooltip-ca-ve-edit',
|
2012-06-19 08:30:30 +00:00
|
|
|
'viewsource',
|
2012-11-28 18:11:11 +00:00
|
|
|
'visualeditor-ca-ve-edit',
|
|
|
|
'visualeditor-ca-ve-create',
|
2012-08-17 19:41:33 +00:00
|
|
|
'visualeditor-notification-saved',
|
2012-08-23 19:01:07 +00:00
|
|
|
'visualeditor-notification-created',
|
2012-12-04 21:04:19 +00:00
|
|
|
'visualeditor-notification-restored',
|
2012-12-11 23:19:21 +00:00
|
|
|
'visualeditor-notification-reported',
|
2012-06-21 19:15:31 +00:00
|
|
|
'visualeditor-ca-editsource',
|
|
|
|
'visualeditor-loadwarning',
|
2012-08-17 19:30:33 +00:00
|
|
|
'visualeditor-editsummary',
|
2012-12-11 23:19:21 +00:00
|
|
|
'visualeditor-problem',
|
2012-12-11 01:44:44 +00:00
|
|
|
'visualeditor-editnotices-tool',
|
|
|
|
'visualeditor-feedback-tool',
|
2012-12-05 00:33:58 +00:00
|
|
|
'visualeditor-restore-page',
|
2012-12-05 23:13:07 +00:00
|
|
|
'visualeditor-create-page',
|
2012-12-07 16:23:23 +00:00
|
|
|
'visualeditor-save-title',
|
2012-12-11 23:19:21 +00:00
|
|
|
'visualeditor-report-notice',
|
|
|
|
'visualeditor-toolbar-savedialog',
|
|
|
|
'visualeditor-savedialog-title-review',
|
|
|
|
'visualeditor-savedialog-title-report',
|
|
|
|
'visualeditor-savedialog-title-save',
|
|
|
|
'visualeditor-savedialog-label-review-wrong',
|
|
|
|
'visualeditor-savedialog-label-review-good',
|
|
|
|
'visualeditor-savedialog-label-report',
|
|
|
|
'visualeditor-savedialog-label-create',
|
|
|
|
'visualeditor-savedialog-label-save',
|
|
|
|
'visualeditor-savedialog-label-restore',
|
|
|
|
'visualeditor-savedialog-label-report',
|
2012-05-25 19:50:48 +00:00
|
|
|
),
|
2012-06-11 06:54:41 +00:00
|
|
|
),
|
|
|
|
'ext.visualEditor.base' => $wgVisualEditorResourceTemplate + array(
|
2011-11-28 20:28:28 +00:00
|
|
|
'scripts' => array(
|
2012-05-24 22:15:11 +00:00
|
|
|
// ve
|
2012-06-20 17:57:23 +00:00
|
|
|
've/ve.js',
|
|
|
|
've/ve.EventEmitter.js',
|
2012-07-27 23:08:45 +00:00
|
|
|
've/init/ve.init.js',
|
|
|
|
've/init/ve.init.Platform.js',
|
2012-06-18 20:30:14 +00:00
|
|
|
),
|
2012-07-27 23:43:27 +00:00
|
|
|
'dependencies' => array(
|
|
|
|
'jquery.json',
|
|
|
|
),
|
2012-06-18 20:30:14 +00:00
|
|
|
'debugScripts' => array(
|
2012-06-20 17:57:23 +00:00
|
|
|
've/ve.debug.js',
|
2012-06-18 20:30:14 +00:00
|
|
|
),
|
2012-06-11 06:54:41 +00:00
|
|
|
),
|
2012-06-21 20:39:27 +00:00
|
|
|
'ext.visualEditor.specialMessages' => $wgVisualEditorResourceTemplate + array(
|
|
|
|
'class' => 'VisualEditorMessagesModule'
|
|
|
|
),
|
2012-06-11 06:54:41 +00:00
|
|
|
'ext.visualEditor.core' => $wgVisualEditorResourceTemplate + array(
|
|
|
|
'scripts' => array(
|
|
|
|
// ve
|
2012-11-07 20:09:18 +00:00
|
|
|
've/ve.Registry.js',
|
2012-06-20 17:57:23 +00:00
|
|
|
've/ve.Factory.js',
|
|
|
|
've/ve.Position.js',
|
2012-11-07 00:09:38 +00:00
|
|
|
've/ve.Command.js',
|
2012-11-07 20:09:18 +00:00
|
|
|
've/ve.CommandRegistry.js',
|
2012-06-20 17:57:23 +00:00
|
|
|
've/ve.Range.js',
|
|
|
|
've/ve.Node.js',
|
|
|
|
've/ve.BranchNode.js',
|
|
|
|
've/ve.LeafNode.js',
|
|
|
|
've/ve.Surface.js',
|
|
|
|
've/ve.Document.js',
|
2012-08-24 02:06:36 +00:00
|
|
|
've/ve.OrderedHashSet.js',
|
|
|
|
've/ve.AnnotationSet.js',
|
2012-10-24 21:34:01 +00:00
|
|
|
've/ve.Action.js',
|
|
|
|
've/ve.ActionFactory.js',
|
|
|
|
|
|
|
|
// actions
|
|
|
|
've/actions/ve.AnnotationAction.js',
|
2012-11-16 23:31:36 +00:00
|
|
|
've/actions/ve.ContentAction.js',
|
2012-10-24 21:34:01 +00:00
|
|
|
've/actions/ve.FormatAction.js',
|
|
|
|
've/actions/ve.HistoryAction.js',
|
|
|
|
've/actions/ve.IndentationAction.js',
|
|
|
|
've/actions/ve.InspectorAction.js',
|
|
|
|
've/actions/ve.ListAction.js',
|
2012-05-21 19:37:30 +00:00
|
|
|
|
2012-02-06 23:50:56 +00:00
|
|
|
// dm
|
2012-06-20 17:57:23 +00:00
|
|
|
've/dm/ve.dm.js',
|
|
|
|
've/dm/ve.dm.NodeFactory.js',
|
|
|
|
've/dm/ve.dm.AnnotationFactory.js',
|
|
|
|
've/dm/ve.dm.Node.js',
|
|
|
|
've/dm/ve.dm.BranchNode.js',
|
|
|
|
've/dm/ve.dm.LeafNode.js',
|
|
|
|
've/dm/ve.dm.Annotation.js',
|
|
|
|
've/dm/ve.dm.TransactionProcessor.js',
|
|
|
|
've/dm/ve.dm.Transaction.js',
|
|
|
|
've/dm/ve.dm.Surface.js',
|
2012-08-24 22:25:37 +00:00
|
|
|
've/dm/ve.dm.SurfaceFragment.js',
|
2012-06-20 17:57:23 +00:00
|
|
|
've/dm/ve.dm.Document.js',
|
2012-12-07 01:23:03 +00:00
|
|
|
've/dm/ve.dm.DocumentSlice.js',
|
2012-06-20 17:57:23 +00:00
|
|
|
've/dm/ve.dm.DocumentSynchronizer.js',
|
|
|
|
've/dm/ve.dm.Converter.js',
|
2012-05-21 19:37:30 +00:00
|
|
|
|
2012-06-20 17:57:23 +00:00
|
|
|
've/dm/nodes/ve.dm.AlienInlineNode.js',
|
|
|
|
've/dm/nodes/ve.dm.AlienBlockNode.js',
|
2012-08-08 23:06:20 +00:00
|
|
|
've/dm/nodes/ve.dm.BreakNode.js',
|
2012-10-16 14:03:26 +00:00
|
|
|
've/dm/nodes/ve.dm.CenterNode.js',
|
2012-06-20 17:57:23 +00:00
|
|
|
've/dm/nodes/ve.dm.DefinitionListItemNode.js',
|
|
|
|
've/dm/nodes/ve.dm.DefinitionListNode.js',
|
|
|
|
've/dm/nodes/ve.dm.DocumentNode.js',
|
|
|
|
've/dm/nodes/ve.dm.HeadingNode.js',
|
|
|
|
've/dm/nodes/ve.dm.ImageNode.js',
|
|
|
|
've/dm/nodes/ve.dm.ListItemNode.js',
|
|
|
|
've/dm/nodes/ve.dm.ListNode.js',
|
2012-09-06 21:07:39 +00:00
|
|
|
've/dm/nodes/ve.dm.MetaBlockNode.js',
|
|
|
|
've/dm/nodes/ve.dm.MetaInlineNode.js',
|
2012-11-20 23:37:06 +00:00
|
|
|
've/dm/nodes/ve.dm.MWEntityNode.js',
|
2012-06-20 17:57:23 +00:00
|
|
|
've/dm/nodes/ve.dm.ParagraphNode.js',
|
|
|
|
've/dm/nodes/ve.dm.PreformattedNode.js',
|
|
|
|
've/dm/nodes/ve.dm.TableCellNode.js',
|
|
|
|
've/dm/nodes/ve.dm.TableNode.js',
|
|
|
|
've/dm/nodes/ve.dm.TableRowNode.js',
|
|
|
|
've/dm/nodes/ve.dm.TableSectionNode.js',
|
|
|
|
've/dm/nodes/ve.dm.TextNode.js',
|
2012-05-21 19:37:30 +00:00
|
|
|
|
2012-06-20 17:57:23 +00:00
|
|
|
've/dm/annotations/ve.dm.LinkAnnotation.js',
|
2012-10-01 21:11:41 +00:00
|
|
|
've/dm/annotations/ve.dm.MWExternalLinkAnnotation.js',
|
|
|
|
've/dm/annotations/ve.dm.MWInternalLinkAnnotation.js',
|
2012-06-20 17:57:23 +00:00
|
|
|
've/dm/annotations/ve.dm.TextStyleAnnotation.js',
|
2012-05-21 19:37:30 +00:00
|
|
|
|
2012-03-29 21:05:25 +00:00
|
|
|
// ce
|
2012-06-20 17:57:23 +00:00
|
|
|
've/ce/ve.ce.js',
|
|
|
|
've/ce/ve.ce.NodeFactory.js',
|
|
|
|
've/ce/ve.ce.Document.js',
|
|
|
|
've/ce/ve.ce.Node.js',
|
|
|
|
've/ce/ve.ce.BranchNode.js',
|
2012-11-27 00:35:12 +00:00
|
|
|
've/ce/ve.ce.ContentBranchNode.js',
|
2012-06-20 17:57:23 +00:00
|
|
|
've/ce/ve.ce.LeafNode.js',
|
|
|
|
've/ce/ve.ce.Surface.js',
|
2012-10-11 19:45:21 +00:00
|
|
|
've/ce/ve.ce.SurfaceObserver.js',
|
2012-05-21 19:37:30 +00:00
|
|
|
|
2012-11-15 23:33:09 +00:00
|
|
|
've/ce/nodes/ve.ce.AlienNode.js',
|
2012-06-20 17:57:23 +00:00
|
|
|
've/ce/nodes/ve.ce.AlienInlineNode.js',
|
|
|
|
've/ce/nodes/ve.ce.AlienBlockNode.js',
|
2012-08-08 23:06:20 +00:00
|
|
|
've/ce/nodes/ve.ce.BreakNode.js',
|
2012-10-17 20:12:37 +00:00
|
|
|
've/ce/nodes/ve.ce.CenterNode.js',
|
2012-06-20 17:57:23 +00:00
|
|
|
've/ce/nodes/ve.ce.DefinitionListItemNode.js',
|
|
|
|
've/ce/nodes/ve.ce.DefinitionListNode.js',
|
|
|
|
've/ce/nodes/ve.ce.DocumentNode.js',
|
|
|
|
've/ce/nodes/ve.ce.HeadingNode.js',
|
|
|
|
've/ce/nodes/ve.ce.ImageNode.js',
|
|
|
|
've/ce/nodes/ve.ce.ListItemNode.js',
|
|
|
|
've/ce/nodes/ve.ce.ListNode.js',
|
2012-09-06 21:07:39 +00:00
|
|
|
've/ce/nodes/ve.ce.MetaBlockNode.js',
|
|
|
|
've/ce/nodes/ve.ce.MetaInlineNode.js',
|
2012-11-20 23:37:06 +00:00
|
|
|
've/ce/nodes/ve.ce.MWEntityNode.js',
|
2012-06-20 17:57:23 +00:00
|
|
|
've/ce/nodes/ve.ce.ParagraphNode.js',
|
|
|
|
've/ce/nodes/ve.ce.PreformattedNode.js',
|
|
|
|
've/ce/nodes/ve.ce.TableCellNode.js',
|
|
|
|
've/ce/nodes/ve.ce.TableNode.js',
|
|
|
|
've/ce/nodes/ve.ce.TableRowNode.js',
|
|
|
|
've/ce/nodes/ve.ce.TableSectionNode.js',
|
|
|
|
've/ce/nodes/ve.ce.TextNode.js',
|
2012-05-21 19:37:30 +00:00
|
|
|
|
2012-02-06 23:50:56 +00:00
|
|
|
// ui
|
2012-06-20 17:57:23 +00:00
|
|
|
've/ui/ve.ui.js',
|
2012-10-24 22:20:41 +00:00
|
|
|
've/ui/ve.ui.Context.js',
|
|
|
|
've/ui/ve.ui.Frame.js',
|
2012-06-20 17:57:23 +00:00
|
|
|
've/ui/ve.ui.Inspector.js',
|
2012-10-24 22:20:41 +00:00
|
|
|
've/ui/ve.ui.InspectorFactory.js',
|
|
|
|
've/ui/ve.ui.Menu.js',
|
2012-06-20 17:57:23 +00:00
|
|
|
've/ui/ve.ui.Tool.js',
|
|
|
|
've/ui/ve.ui.Toolbar.js',
|
2012-10-24 21:49:08 +00:00
|
|
|
've/ui/ve.ui.ToolFactory.js',
|
2012-05-21 19:37:30 +00:00
|
|
|
|
2012-06-20 17:57:23 +00:00
|
|
|
've/ui/inspectors/ve.ui.LinkInspector.js',
|
2012-05-21 19:37:30 +00:00
|
|
|
|
2012-06-20 17:57:23 +00:00
|
|
|
've/ui/tools/ve.ui.ButtonTool.js',
|
|
|
|
've/ui/tools/ve.ui.AnnotationButtonTool.js',
|
2012-10-24 21:49:08 +00:00
|
|
|
've/ui/tools/ve.ui.InspectorButtonTool.js',
|
2012-06-20 17:57:23 +00:00
|
|
|
've/ui/tools/ve.ui.IndentationButtonTool.js',
|
2012-10-24 21:49:08 +00:00
|
|
|
've/ui/tools/ve.ui.ListButtonTool.js',
|
2012-06-20 17:57:23 +00:00
|
|
|
've/ui/tools/ve.ui.DropdownTool.js',
|
2012-10-24 21:49:08 +00:00
|
|
|
|
|
|
|
've/ui/tools/buttons/ve.ui.BoldButtonTool.js',
|
|
|
|
've/ui/tools/buttons/ve.ui.ItalicButtonTool.js',
|
|
|
|
've/ui/tools/buttons/ve.ui.ClearButtonTool.js',
|
|
|
|
've/ui/tools/buttons/ve.ui.LinkButtonTool.js',
|
|
|
|
've/ui/tools/buttons/ve.ui.BulletButtonTool.js',
|
|
|
|
've/ui/tools/buttons/ve.ui.NumberButtonTool.js',
|
|
|
|
've/ui/tools/buttons/ve.ui.IndentButtonTool.js',
|
|
|
|
've/ui/tools/buttons/ve.ui.OutdentButtonTool.js',
|
|
|
|
've/ui/tools/buttons/ve.ui.RedoButtonTool.js',
|
|
|
|
've/ui/tools/buttons/ve.ui.UndoButtonTool.js',
|
|
|
|
|
|
|
|
've/ui/tools/dropdowns/ve.ui.FormatDropdownTool.js',
|
2011-11-28 20:28:28 +00:00
|
|
|
),
|
2011-11-30 20:45:24 +00:00
|
|
|
'styles' => array(
|
2012-05-24 22:15:11 +00:00
|
|
|
// ce
|
2012-07-19 01:23:11 +00:00
|
|
|
've/ce/styles/ve.ce.DocumentNode.css',
|
2012-06-20 17:57:23 +00:00
|
|
|
've/ce/styles/ve.ce.Node.css',
|
|
|
|
've/ce/styles/ve.ce.Surface.css',
|
2012-02-06 23:50:56 +00:00
|
|
|
// ui
|
2012-06-20 17:57:23 +00:00
|
|
|
've/ui/styles/ve.ui.Context.css',
|
|
|
|
've/ui/styles/ve.ui.Inspector.css',
|
|
|
|
've/ui/styles/ve.ui.Menu.css',
|
|
|
|
've/ui/styles/ve.ui.Surface.css',
|
|
|
|
've/ui/styles/ve.ui.Toolbar.css',
|
2012-10-24 21:49:08 +00:00
|
|
|
've/ui/styles/ve.ui.Tool.css',
|
2011-11-30 20:45:24 +00:00
|
|
|
),
|
2011-11-28 20:28:28 +00:00
|
|
|
'dependencies' => array(
|
|
|
|
'jquery',
|
2012-03-29 21:05:25 +00:00
|
|
|
'rangy',
|
2012-06-25 23:25:09 +00:00
|
|
|
'ext.visualEditor.base',
|
|
|
|
'mediawiki.Title',
|
2012-11-06 18:56:03 +00:00
|
|
|
'jquery.autoEllipsis',
|
|
|
|
'jquery.multiSuggest'
|
2011-11-28 20:28:28 +00:00
|
|
|
),
|
2012-02-07 16:37:08 +00:00
|
|
|
'messages' => array(
|
|
|
|
'visualeditor',
|
The great inspector and context rewrite of 2012
ve.AnnotationAction
* Added filter to the clearAll method to allow clearing all matching annotations only
ve.dm.Document
* Some variable renaming for consistency
ve.dm.SurfaceFragment
* Added truncateRange method
* Added annotation scope to expandRange method
* Added support for passing an annotation object into annotateContent method
* Switched to using name instead of type in annotateContent method to match the ve.dm.Annotation class
* Fixed logic in annotation mode of expandSelection so that expansion only takes place if the annotation is found
ve.ui.LinkInspector
* Moved most of the functionality elsewhere
* General reorganization
* Changed setOverlayPosition to accept 2 arguments instead of an object with 2 properties and renamed it to positionOverlayBelow
* Check for annotation object before extracting target information from it
* Initialize default target as empty string to avoid undefined being cast to a string and the default target becoming 'undefined'
icons.ai, inspector.png, inspector.svg
* Added generic inspector icon which will be used when a custom icon is not specified in future inspector subclasses
ve.ui.Inspector.Icons
* Added inspector icon
* Renamed clear icon to remove to match it's actual image
ve.ui.Context
* Greatly simplified the interface, reducing the number of methods by inlining a few things and combining others
* Now always listening to resize events on the window rather than only while document is focused
* Not listening to scroll events anymore, they used to affect the top/bottom positioning of the menu which we don't do anymore
* Lots of cleanup and reorganization
* No need to fallback to empty array since getInspectorsForAnnotations does so already
* Only consider fully-covered annotations for inspectors
ve.ui.Frame
* Simplified the constructor by introducing the createFrame method
* General cleanup
* Typo fixes
ve.ui.Inspector
* Generalized lots of functionality previously located in the link inspector class which will be useful to all inspectors (such as title, clear button, saving changes, etc.)
* Added setDisabled and isDisabled methods to manage CSS changes and avoid needing to check the CSS to determine the state of the inspector (storing state in the view is evil)
* Added getMatchingAnnotations method for convenience
* Added prepareSelection stub
* Lots of cleanup and documentation
* Type pattern is now defined in base class
* Added stubs for onOpen and onClose with documentation so that subclass authors know what these methods do
* Removed checks for onOpen or onClose methods since they are now noop stubs and are always there
* Added stub and removed checks for onRemove
* Made esc key close and accept - the illusion is supposed to be that the link changes are applied instantly, even though they are only updated when you close, so all closing except for when removing should apply changes - i.e. esc is now equal to back rather than being a special function that doesn't have an associated affordance
* Only consider fully-covered annotations when getting matching annotations
ve.ui.InspectorFactory
* Depending on type pattern now since it's always there
* Added getInspectorsForAnnotations method
* Return empty array if annotation set is empty
VisualEditor, VisualEditor.i18n
* Added default inspector message
Change-Id: I1cc008445bcbc8cba6754ca4b6ac0397575980d5
2012-11-16 20:40:05 +00:00
|
|
|
'visualeditor-inspector-title',
|
2012-06-19 18:11:01 +00:00
|
|
|
'visualeditor-linkinspector-title',
|
2012-06-19 08:30:30 +00:00
|
|
|
'visualeditor-linkinspector-label-pagetitle',
|
2012-08-15 18:26:11 +00:00
|
|
|
'visualeditor-linkinspector-suggest-existing-page',
|
|
|
|
'visualeditor-linkinspector-suggest-new-page',
|
|
|
|
'visualeditor-linkinspector-suggest-external-link',
|
2012-07-06 23:28:16 +00:00
|
|
|
'visualeditor-formatdropdown-title',
|
2012-06-19 08:30:30 +00:00
|
|
|
'visualeditor-formatdropdown-format-paragraph',
|
|
|
|
'visualeditor-formatdropdown-format-heading1',
|
|
|
|
'visualeditor-formatdropdown-format-heading2',
|
|
|
|
'visualeditor-formatdropdown-format-heading3',
|
|
|
|
'visualeditor-formatdropdown-format-heading4',
|
|
|
|
'visualeditor-formatdropdown-format-heading5',
|
|
|
|
'visualeditor-formatdropdown-format-heading6',
|
|
|
|
'visualeditor-formatdropdown-format-preformatted',
|
|
|
|
'visualeditor-annotationbutton-bold-tooltip',
|
|
|
|
'visualeditor-annotationbutton-italic-tooltip',
|
|
|
|
'visualeditor-annotationbutton-link-tooltip',
|
|
|
|
'visualeditor-indentationbutton-indent-tooltip',
|
|
|
|
'visualeditor-indentationbutton-outdent-tooltip',
|
|
|
|
'visualeditor-listbutton-number-tooltip',
|
|
|
|
'visualeditor-listbutton-bullet-tooltip',
|
|
|
|
'visualeditor-clearbutton-tooltip',
|
|
|
|
'visualeditor-historybutton-undo-tooltip',
|
|
|
|
'visualeditor-historybutton-redo-tooltip',
|
2012-12-06 01:18:36 +00:00
|
|
|
'visualeditor-inspector-close-tooltip',
|
|
|
|
'visualeditor-inspector-remove-tooltip',
|
2012-06-19 08:30:30 +00:00
|
|
|
'visualeditor-viewpage-savewarning',
|
2012-12-07 16:23:23 +00:00
|
|
|
'visualeditor-differror',
|
2012-06-21 02:14:04 +00:00
|
|
|
'visualeditor-saveerror',
|
2012-11-28 23:57:00 +00:00
|
|
|
'visualeditor-editconflict',
|
2012-11-17 00:52:22 +00:00
|
|
|
'visualeditor-aliennode-tooltip',
|
2012-02-07 16:37:08 +00:00
|
|
|
),
|
2012-08-30 20:04:22 +00:00
|
|
|
),
|
|
|
|
'ext.visualEditor.icons-raster' => $wgVisualEditorResourceTemplate + array(
|
|
|
|
'styles' => array(
|
|
|
|
've/ui/styles/ve.ui.Icons-raster.css',
|
|
|
|
),
|
|
|
|
),
|
|
|
|
'ext.visualEditor.icons-vector' => $wgVisualEditorResourceTemplate + array(
|
|
|
|
'styles' => array(
|
|
|
|
've/ui/styles/ve.ui.Icons-vector.css',
|
|
|
|
),
|
|
|
|
),
|
2011-11-28 20:28:28 +00:00
|
|
|
);
|
2012-01-31 00:02:48 +00:00
|
|
|
|
2012-05-25 22:23:40 +00:00
|
|
|
// Parsoid Wrapper API
|
2012-05-25 19:50:48 +00:00
|
|
|
$wgAutoloadClasses['ApiVisualEditor'] = $dir . 'ApiVisualEditor.php';
|
2012-11-30 23:00:04 +00:00
|
|
|
$wgAPIModules['visualeditor'] = 'ApiVisualEditor';
|
2012-05-25 19:50:48 +00:00
|
|
|
|
|
|
|
// Integration Hooks
|
|
|
|
$wgAutoloadClasses['VisualEditorHooks'] = $dir . 'VisualEditor.hooks.php';
|
2012-06-11 06:54:41 +00:00
|
|
|
$wgHooks['BeforePageDisplay'][] = 'VisualEditorHooks::onBeforePageDisplay';
|
2012-11-05 20:46:14 +00:00
|
|
|
$wgHooks['GetPreferences'][] = 'VisualEditorHooks::onGetPreferences';
|
2012-11-22 02:26:29 +00:00
|
|
|
$wgHooks['ListDefinedTags'][] = 'VisualEditorHooks::onListDefinedTags';
|
2012-06-11 06:54:41 +00:00
|
|
|
$wgHooks['MakeGlobalVariablesScript'][] = 'VisualEditorHooks::onMakeGlobalVariablesScript';
|
2012-07-27 23:43:27 +00:00
|
|
|
$wgHooks['ResourceLoaderTestModules'][] = 'VisualEditorHooks::onResourceLoaderTestModules';
|
2012-06-21 20:39:27 +00:00
|
|
|
|
|
|
|
$wgAutoloadClasses['VisualEditorMessagesModule'] = $dir . 'VisualEditorMessagesModule.php';
|