This is a major refactor of user interface context, frame, dialog
and inspector classes, including adding several new classes which
generalize managing inspectors/dialogs (which are now subclasses
of window).
New classes:
* ve.ui.Window.js - base class for inspector and dialog classes
* ve.ui.WindowSet.js - manages mutually exclusive windows, used
by surface and context for dialogs and inspectors respectively
* ve.ui.DialogFactory - generates dialogs
* ve.ui.IconButtonWidget - used in inspector for buttons in the head
Refactored classes:
* ve.ui.Context - moved inspector management to window set
* ve.ui.Frame - made iframes initialize asynchronously
* ve.ui.Dialog and ve.ui.Inspector - moved initialization to async
initialize method
Other interesting bits:
ve.ui.*Icons*.css, *.svg, *.png, *.ai
* Merged icon stylesheets so all icons are available inside windows
* Renamed inspector icon to window
ve.ui.*.css
* Reorganized styles so that different windows can include only
what they need
* Moved things to where they belonged (some things were in strange places)
ve.init.Target.js, ve.init.mw.ViewPageTarget.js, ve.init.sa.Target.js
* Removed dialog management - dialogs are managed by the surface now
ve.ui.*Dialog.js
* Renamed title message static property
* Added registration
ve.ui.*Inspector.js
* Switch to accept surface object rather than context, which conforms
to the more general window class without losing any functionality
(in fact, most of the time the surface was what we actually wanted)
ve.ui.MenuWidget.js, ve.ui.MWLinkTargetInputWidget.js
* Using surface overly rather than passing an overlay around
through constructors
Change-Id: Ifd16a1003ff44c48ee7b2c66928cf9cc858b2564
Changes include:
VisualEditor.i18n.php, VisualEditor.php
* i18n labels for dialogs
ve.init.mw.ViewPageTarget.js
* Initial go at onOpenDialog and onCloseDialog methods
ve.init.Target.js
* Change calls to dialog hide & show to close & open
ve.ui.MetaDialog.js, ve.ui.ContentDialog.js
* Pass surface when constructing
* Add static title message property
ve.ui.Surface.css
* Set high z-index for toolbar for shadow to overlap dialog.
ve.ui.Dialog.js
* Extends EventEmitter class.
* Changed hide/show method names to open/close.
* Create base ui elements.
ve.Surface.js
* Create instance of meta dialog.
Change-Id: I867ca0546606eeb5e2ab7f612bb5af700ab877ec
Objective: Simplify the registration and use of triggers
Changes:
* Renamed ve.Command to ve.Trigger
* Renamed command demo to trigger demo
* Removed language prefixing of triggers
* Generating trigger tooltips rather than hard-coding them in i18n
* Added documentation to clarify that only 'mac' and 'pc' are supported platforms, and how the default is chosen
* Simplified trigger registry's register command
* Updated trigger registrations
Change-Id: Ibab6ad5b5c86f24707f064967dc2119a81125392
Objective:
* Put command shortcuts in button title attributes. (Bug 42919)
* Provide a registry for platform specific command triggers and their
corresponding i18n messages. (Bug 44012)
* Enable loading of triggers after ve.Surface is created. (lazy load)
Changes:
VisualEditor.i18n.php
* Add default trigger i18n messags for mac and pc system platforms
VisusalEditor.php, demos/ve/index.php
* Add links to files
ve.init.mw.Platform.js
* Define getUserLanguage and getSystemPlatform methods.
ve.init.sa.Platform.js
* Define getUserLanguage and getSystemPlatform methods.
ve.init.Platform.js
* Define abstract methods: getUserLangauge, getSystemPlatform
ve.ui.BoldBUttonTool.js, ve.ui.IndentButtonTool.js, ve.ui.ItalicButtonTool.js,
ve.ui.LinkButtonTool.js, ve.ui.OutdentButtonTool.js, ve.ui.RedoButtonTool.js,
ve.ui.UndoButtonTool.js
* Add registration for command triggers.
ve.Surface.js
* Methodize loading of triggers.
* Bind register event to ve.triggerRegistry to allow lazy loading of triggers.
ve.ui.Tool.js
* Init pre-registered tooltip messages.
* Update tool titles when new triggers are loaded.
ve.CommandRegistry.js
* Remove command registration ( moved to buttons themselves )
ve.TriggerRegistry.js
* New class for registering triggers.
ve.init.mw.ViewPageTarget.js
* Changed instance of unindent command to outdent.
Change-Id: Id8580a3f81aac751db0b7482422a73912648dfed
In our rush to get the code out of the door, we skipped the qqq strings for some
of these strings, and we left a ghastly i18n hole in the middle. Now fixed.
Change-Id: I88319cdc2d10f99a631989047a571a7a3e7122da
Basically saveDialog-body now has three slides:
* review
* report
* save
There is a viewPage.swapSaveDialog method that is called like this
viewPage.swapSaveDialog( 'review' );
initially called from showSaveDialog.
Misc:
* Replaced more reused core message with a ve ones:
savearticle => visualeditor-savedialog-label-save
showdiff => (removed)
* Removed min-height from saveDialog. When slide-review is
load, it is very short and there shouldn't be 10em's of
whitespace below the loader + buttons.
To avoid problems with diff cache being cleared while looking
at the save dialog, we lock and unlock the surface.
We could later remove this as and optimise it as feature, but for
now this fixes a bug.
Change-Id: I5f59482f4db16264014720b199d7652843c36108
icons, comment.*, ve.ui.Icons-*
* Added comment icon
ve.init.mw.ViewPageTarget
* Refactored editNoticeButton into being just a tool
* Added feedback tool, which shares the editNoticeButton code
* Added feedback object construction in init constructor
* Added launching code to feedback tool
VisualEditor.i18n
* Renamed editnotices-button message to editnotices-tool to match changes in code
* Added feedback tool message
VisualEditor
* Added dependency on mediawiki.feedback
* Updated changed message key
* Added reference to new message
Change-Id: I813c89a505386a9b3206bfbcb176016e28a592cb
Turned saveDialog-body into slide-based swapper.
Moved footer into saveDiaog-body so that the license text doesn't
stay under the diff-slide (and move body bottom padding to foot
top)
Wrapped buttons and title in a saveDialog-header and converted
closeButton from absolutely positioned to a floated layout.
This way the title doesn't need to be repositioned but will scooch
over if the prevButton gets shown/hidden.
Update API "diff" action to include table wrapper and table
header. Without it the mediawiki CSS for diff doesn't work
properly (needs colgroups for proper width of the "-" and "+" column etc)
Renamed -saving class to -disabled for consistency.
Set prop.disabled to really lock/unlock buttons, not just visual
(otherwise the click handlers are still triggered on click, can
potentially cause actions to be triggered when not expected)
Using a ve message for "Show your changes" title instead of
re-using core tooltip-savepage in a different context.
Diff slide triggers "auto width" on dialog (inline undo of width: 29em), keeping min-width, to allow it to expand as wide as needed.
Functions that I copied as base for onShowChanges and
onShowChangeError had some incorrect argument descriptions. Fixed
in both.
Note:
* Pass function to .off(), so that only that one is unbound
instead of any "resize" handler on the page (by other extensions
or gadgets or core)
* NB: ve.bind ($.proxy) preserves internal guid, so that $.Event
can find the bound function by the original reference.
* keydown has an anonymous function, should either moved to
prototype or namespaced, did latter for now, save enough and
better than destructive .off('keydown')
Change-Id: I9d05ef6e3e2461bdcf363232f7b0fbad5e24f506
ApiVisualEditor
* Reverted some of I223235a6ea8b4178c50beeaaedb709b2de7cf0b5 turned out to be full of problems - the race condition is only relevant to getting the HTML
* Fixed check for $content to be false before it was defined
ve.init.mw.ViewPageTarget
* Reverted some more of I223235a6ea8b4178c50beeaaedb709b2de7cf0b5 - wgCurRevisionId is not equal to oldid, it's equal to $title->getLatestRevId() - this was causing lots of oldid problems
* Added use of restored message
* Made save button not locked when using oldid
* Customized save buttons depending on oldid
ve.init.mw.Target
* Reverted even more of I223235a6ea8b4178c50beeaaedb709b2de7cf0b5 - we don't want to keep a copy of the wgCurRevisionId at all, we just want the oldid if it was given
VisualEditor.i18n, VisualEditor
* Added restored notification and restore save button label messages
Change-Id: I8b30c2a153911f44643e369b7c6a9b89c0fb2c5b
ApiVisualEditor
* Including notices in response to parse actions
ve.init.mw.ViewPageTarget
* Added styles for editNoticeButton and editNotices
ve.init.mw.ViewPageTarget
* Added toolbarEditNoticeButton and toolbarEditNotices
* Combined toolbarEditNoticeButton and toolbarSaveButton setup
* Moved toolbar buttons setup to onLoad (it could vary per-parse now)
* Added tearDownToolbarButtons which fires on deactivate
* Renamed some instances of teardown to tearDown
* Added click handler for toolbarEditNoticeButton
* Added toolbarEditNotices setup method, called on load
* Made notices fade in and out, in by default on load if any
* Made notices hide when save dialog is opened
ve.init.mw.Target
* Added storing of notices on parse
icons, alert, ve.ui-Icons
* Added alert icon
VisualEditor.i18n, VisualEditor
* Added notices button message
Change-Id: I581bf5a005a9c18422f952d71064d17d0ba9b540
ApiVisualEditor
* Added basetimestamp and starttimestamp to all methods where appropriate
* Added new serialize method which converts HTML to Wikitext
ve.init.mw.ViewPageTarget
* Added edit conflict handling
* Moved form value reading code into getSaveOptions method
* Prevented edit warning from appearing while submitting
ve.init.mw.Target
* Added serialize and submit methods
* Fixed some documentation
* Added support for baseTimeStamp and startTimeStamp
VisualEditor.i18n
* Added edit conflict confirmation box message
VisualEditor
* Included new edit conflict message to resource loader module
Change-Id: I002c5aa23704c1c46ef46fa1970a4254614b9eb1
* Remove the logic where we create a ve-edit button even though
we know there is no native ca-edit button (bug 42142).
This was previously in place to allow ve-editing a page while
restricting source editing, but this is no longer wanted.
* Implement new tabLayout mode "add", which adds a VE tab.
Previous default is now the "replace" mode, which replaces the
native "Edit" tab and creates a "Edit source" link.
Change-Id: I3fe29c52b743837c2e1d66f25ccdca6115b8bd25
Uses MW's built-in change tagging. Made this configurable so it can be
turned off if it looks like we're blowing up the tags system with the
volume of VE edits.
Change-Id: I63052d90772906e34021035de496a65fea7945f7
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
We do not want to use the Feedback tool for the December release, as it does not
work cleanly with LiquidThreads and would strand most users in an unfamiliar
wiki and expect them to have more complex/technical responses than they are
likely to be able to give; instead, have just purged it entirely from the code
(except for i15d strings, per Roan).
Change-Id: Ieebdca3d365943d901e2df37228120fdcff50afd
* Remove VisualEditor namespace, and restrictions on it
** For MW.org these will be moved to mediawiki-config
* Add $wgVisualEditorNamespaces
* Add visualeditor-enable preference and respect it
* Use $skin->getTitle() rather than $wgTitle
* Remove "Sandbox" from i18n message
* Remove duplicate enforcement of VE namespace from JS
Change-Id: I956f68c2dde55e4063530fcc7c90eda048e0d78b
* Only show the inspector if the selected text has an inspectable annotation
* Replace the inline menu with a toolbar containing inspectable annotations
* Change the appearance of the inspector to match new mockups
* Add the trash can icon for removing annotations
* Move iframe handling code into a class that manages all that nonsense
Change-Id: I840f72426f9a9e50054a28de950393f0e9913153
* Added oldid param to the API
* Added oldId argument to ve.init.mw.ViewPageTarget
* Added redirect when saving an oldid page (which adds a new revision)
* Added venotify param to allow notifications even when redirected
* Added creation notification
* Added page title to saved/created notification
Change-Id: I9e957e6f5bc7920093481ffe3c33e299f87ce50a
Created jQuery plugin MultiSuggest which builds a categorized dropdown
under specified input box.
Revised inspector to no longer be an iframe but to contain an Iframe.
This reduces xbrowser issues with positioning and toggling inspector
container.
Added Inspector overlay element for positioning arbitrary elements
over the iFrame. This prevents growing the iframe to arbitrary lenghts.
Change-Id: I8efbbd091b0b24a19a4b73aa122d21a329cf97e4
* Summary label is now placeholder text
* Edit summary and options are visually connected
* Added summary length count-down label
* Removed check-mark icons from toolbar and dialog save buttons
* Made toolbar and dialog save buttons the same size
* Reduced line-height and margins of license information
* Changed from X icon for close (which might be confused with cancel) to ^ icon for collapse
Change-Id: Ib1711f49af8929be12796aecdea49467b726856e