mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-29 08:34:54 +00:00
a5aeca3ff5
Objective: Refactor UI widgets, improve usability and accessibility of menus, general cleanup and style improvements. Extras: Fixed documentation in a few other files to make descriptions of jQuery event arguments more consistent, classes inherit correctly, and made use of the @cfg functionality in jsduck. Changes: .docs/config.json * Added window, HTMLDocument, HTMLElement, DocumentFragment and XMLHttpRequest to externals, so jsduck doesn't throw warnings when they are used demos/ve/index.php, modules/ve/test/index.php, VisualEditor.php * Moved widgets above tools (since tools use widgets) demos/ve/index.php * Refactored widget initialization to use options * Renamed variables to match widget names ve.init.mw.ViewPageTarget.css * Adjusted text sizes to make widgets work normally * Added margins for buttons in toolbar (since button widgets don't have any) * Removed styles for init buttons (button widgets now) ve.init.mw.ViewPageTarget.js * Switched to using button widgets (involved moving things around a bit) ve.ui.LinkInspector.js, ve.ui.MWLinkInspector.js * Renamed static property "inputWidget" to "linkTargetInputWidget" to better reflect the required base class for the properties value icons.ai, check.png, check.svg * Added "check" icon, used in menu right now to show which item is selected ve.ui.Icons-raster.css, ve.ui.Icons-vector.css * Added check icon * Removed :before pseudo selectors from most of the icon classes (not need by button tool anymore, makes them more reusable now) ve.ui.Tool.css * Adjusted drop down tool styles so menu appears below, instead of on top, of the label * Adjusted paragraph font size to better match actual content * Updated class names to still work with menu widget changes (items are their own widgets now) * Updated selectors as per changes in the structure of button tools ve.ui.Widget.css * Added styles for buttons and menu items * Adjusted menu styles ve.ui.*ButtonTool.js * Added config options argument passthrough ve.ui.ButtonTool.js * Moved var statement to the top inside constructor * Switched to using "a" tag to get cross-browser :active support * Added icon to inside of button to make icon styles more reusable * Removed disabled support (now provided by widget parent class) ve.ui.FormatDropDownTool.js * Updated options initialization to construct menu item objects * Modified handling of items to account for changes in menu and item classes * Optimized onUpdateState method a bit, adding early exit to inner loop ve.ui.ButtonTool.js, ve.ui.DropdownTool.js, ve.ui.Context.js, ve.ui.Frame, ve.ui.Tool.js, ve.ui.Widget.js * Added chain ability to non-getter methods ve.ui.DropdownTool.js * Removed items argument to constructor * Updated code as per changes in menu class * Fixed inconsistent naming of event handler methods * Removed item event handling (now handled by items directly) * Made use of this.$$ to ensure tool works in other frames ve.ui.Tool.js * Made tools inherit from widget * Moved trigger registry event handler to a method ve.ui.Context.js * Switched from using menu to contain toolbar to a simple wrapper ve.ui.js * Added get$$ method, a convenience function for binding jQuery to a specific document context ve.ui.*Widget.js * Switched to using a config options object instead of individual arguments * Added options * Factored out flags and labels into their own classes * Refactored value setting methods for inputs ve.ui.MenuWidget.js, ve.ui.MenuItemWidget.js * Broke items out into their own classes * Redesigned API * Updated code that uses these classes * Added support for keyboard interaction * Made items flash when selected (delaying the hiding of the menu for 200ms) ve.ui.LinkTargetInputWidget.js, ve.ui.MWLinkTargetInputWidget * Refactored annotation setting methods Change-Id: I7769bd5a5b79f1ab36f258ef9f2be583ca503ce6
280 lines
5.6 KiB
CSS
280 lines
5.6 KiB
CSS
/*!
|
|
* VisualEditor MediaWiki Initialization ViewPageTarget styles.
|
|
*
|
|
* @copyright 2011-2013 VisualEditor Team and others; see AUTHORS.txt
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
*/
|
|
|
|
/* VisualEditor */
|
|
|
|
.ve-ui-menuWidget {
|
|
font-size: 0.9em;
|
|
}
|
|
|
|
.ve-init-mw-viewPageTarget-pageTitle {
|
|
-webkit-transition: opacity 200ms ease-out;
|
|
-moz-transition: opacity 200ms ease-out;
|
|
-ms-transition: opacity 200ms ease-out;
|
|
-o-transition: opacity 200ms ease-out;
|
|
transition: opacity 200ms ease-out;
|
|
cursor: default;
|
|
}
|
|
|
|
.ve-init-mw-viewPageTarget-loading {
|
|
width: 128px;
|
|
height: 15px;
|
|
float: right;
|
|
}
|
|
|
|
/* Toolbar */
|
|
|
|
.ve-ui-actions {
|
|
font-size: 0.8em;
|
|
}
|
|
|
|
.ve-ui-actions .ve-ui-buttonWidget {
|
|
margin-left: 0.25em;
|
|
margin-right: 0.25em;
|
|
margin-top: 0.2em;
|
|
}
|
|
|
|
/* Edit notices */
|
|
|
|
.ve-init-mw-viewPageTarget-toolbar-editNotices {
|
|
display: none;
|
|
position: absolute;
|
|
right: -0.5em;
|
|
top: 30px;
|
|
width: 29em;
|
|
font-family: sans-serif;
|
|
border: solid 1px #ccc;
|
|
padding: 0 0.75em 0 0.75em;
|
|
border-radius: 0.25em;
|
|
background-color: #fff;
|
|
box-shadow: 0 0.15em 0.5em 0 rgba(0, 0, 0, 0.2);
|
|
z-index: 3;
|
|
}
|
|
|
|
.ve-init-mw-viewPageTarget-toolbar-editNotices-notice {
|
|
padding: 0.5em 0;
|
|
line-height: 1.5em;
|
|
border-top: solid 1px #ccc;
|
|
margin-top: -1px;
|
|
}
|
|
|
|
/* Tools */
|
|
|
|
.ve-init-mw-viewPageTarget-tool {
|
|
position: relative;
|
|
display: inline-block;
|
|
vertical-align: top;
|
|
line-height: 2.8em;
|
|
margin-right: 1em;
|
|
padding-left: 30px;
|
|
cursor: pointer;
|
|
background-repeat: no-repeat;
|
|
background-position: left center;
|
|
}
|
|
|
|
.ve-init-mw-viewPageTarget-tool-label {
|
|
color: #555555;
|
|
}
|
|
|
|
.ve-init-mw-viewPageTarget-tool:hover .ve-init-mw-viewPageTarget-tool-label {
|
|
text-decoration: underline;
|
|
}
|
|
|
|
/* Save dialog styles */
|
|
|
|
.ve-init-mw-viewPageTarget-saveDialog .ve-ui-buttonWidget {
|
|
float: right;
|
|
margin-left: 0.5em;
|
|
font-size: 0.8em;
|
|
}
|
|
|
|
.ve-init-mw-viewPageTarget-saveDialog-working {
|
|
display: none;
|
|
float: right;
|
|
height: 2em;
|
|
width: 128px;
|
|
margin-right: 1em;
|
|
background-position: right center;
|
|
background-repeat: no-repeat;
|
|
}
|
|
|
|
.ve-init-mw-viewPageTarget-saveDialog {
|
|
display: none;
|
|
top: 0.25em;
|
|
right: 0.5em;
|
|
width: 29em;
|
|
min-width: 29em;
|
|
font-family: sans-serif;
|
|
position: absolute;
|
|
border: solid 1px #ccc;
|
|
border-radius: 0.25em;
|
|
background-color: #fff;
|
|
box-shadow: 0 0.15em 0.5em 0 rgba(0, 0, 0, 0.2);
|
|
padding: 2.5em 0.75em 0.75em 0.75em;
|
|
margin: 0 0 0 0.5em;
|
|
z-index: 3;
|
|
|
|
/* slide-diff can get quite long, handle overflow */
|
|
/* max-height set from javascript */
|
|
overflow-x: auto;
|
|
}
|
|
|
|
.ve-init-mw-viewPageTarget-saveDialog-head {
|
|
position: absolute;
|
|
top: 0.4em;
|
|
left: 0.5em;
|
|
right: 0.5em;
|
|
}
|
|
|
|
.ve-init-mw-viewPageTarget-saveDialog-title {
|
|
height: 2em;
|
|
line-height: 2em;
|
|
color: #333;
|
|
font-size: 0.9em;
|
|
float: left;
|
|
margin: 0 0.5em;
|
|
}
|
|
|
|
.ve-init-mw-viewPageTarget-saveDialog-prevButton {
|
|
float: left;
|
|
position: relative;
|
|
top: 0.1em;
|
|
width: 1.5em;
|
|
height: 1.5em;
|
|
cursor: pointer;
|
|
filter: alpha(opacity=8);
|
|
opacity: 0.8;
|
|
/* @see ve.init.mw.Icons */
|
|
background-position: left top;
|
|
background-repeat: no-repeat;
|
|
padding-right: 0.5em;
|
|
border-right: 1px solid #eee;
|
|
margin-right: 0.5em;
|
|
}
|
|
|
|
.ve-init-mw-viewPageTarget-saveDialog-closeButton {
|
|
float: right;
|
|
position: relative;
|
|
top: 0.1em;
|
|
width: 1.5em;
|
|
height: 1.5em;
|
|
cursor: pointer;
|
|
filter: alpha(opacity=8);
|
|
opacity: 0.8;
|
|
/* @see ve.init.mw.Icons */
|
|
background-position: right top;
|
|
background-repeat: no-repeat;
|
|
}
|
|
|
|
.ve-init-mw-viewPageTarget-saveDialog-body {
|
|
border-top: 1px solid #ddd;
|
|
padding-top: 1em;
|
|
}
|
|
|
|
.ve-init-mw-viewPageTarget-saveDialog-slide {
|
|
display: none;
|
|
}
|
|
|
|
.ve-init-mw-viewPageTarget-saveDialog-slide-review .ve-init-mw-viewPageTarget-saveDialog-viewer {
|
|
margin-bottom: 1em;
|
|
}
|
|
|
|
.ve-init-mw-viewPageTarget-saveDialog-slide-review .ve-init-mw-viewPageTarget-saveDialog-viewer pre {
|
|
margin: 0;
|
|
}
|
|
|
|
.ve-init-mw-viewPageTarget-saveDialog-slide-review .ve-init-mw-viewPageTarget-saveDialog-viewer .diff {
|
|
font-size: 0.8em;
|
|
}
|
|
|
|
.ve-init-mw-viewPageTarget-saveDialog-foot {
|
|
padding-top: 1em;
|
|
}
|
|
|
|
.ve-init-mw-viewPageTarget-saveDialog-license,
|
|
.ve-init-mw-viewPageTarget-saveDialog-report-notice {
|
|
font-size: 0.7em;
|
|
line-height: 1.25em;
|
|
padding: 0;
|
|
margin: 0;
|
|
color: #999;
|
|
}
|
|
|
|
.ve-init-mw-viewPageTarget-saveDialog-summary,
|
|
.ve-init-mw-viewPageTarget-saveDialog-report {
|
|
background-color: #fff;
|
|
border: solid 1px #cccccc;
|
|
padding: 0.5em;
|
|
border-radius: 0.25em 0.25em 0 0;
|
|
}
|
|
|
|
.ve-init-mw-viewPageTarget-saveDialog-report {
|
|
margin-bottom: 1em;
|
|
border-radius: 0.25em;
|
|
}
|
|
|
|
.ve-init-mw-viewPageTarget-saveDialog-summary-focused,
|
|
.ve-init-mw-viewPageTarget-saveDialog-report-focused {
|
|
border-color: #aaa;
|
|
}
|
|
|
|
.ve-init-mw-viewPageTarget-saveDialog-options {
|
|
position: relative;
|
|
background-color: #f7f7f7;
|
|
margin-bottom: 1em;
|
|
border: solid 1px #cccccc;
|
|
border-top: none;
|
|
border-radius: 0 0 0.25em 0.25em;
|
|
min-height: 2.25em;
|
|
}
|
|
|
|
.ve-init-mw-viewPageTarget-saveDialog-body label {
|
|
font-size: 0.8em;
|
|
line-height: 3em;
|
|
}
|
|
|
|
.ve-init-mw-viewPageTarget-saveDialog input[type="checkbox"] {
|
|
margin: 0 0.5em 0 1em;
|
|
line-height: 3em;
|
|
}
|
|
|
|
.ve-init-mw-viewPageTarget-saveDialog-editSummaryCount {
|
|
position: absolute;
|
|
right: 0;
|
|
top: 0;
|
|
bottom: 0;
|
|
border-left: solid 1px #eee;
|
|
line-height: 3em;
|
|
padding: 0 1em;
|
|
color: #aaa;
|
|
}
|
|
|
|
.ve-init-mw-viewPageTarget-saveDialog-editSummary,
|
|
.ve-init-mw-viewPageTarget-saveDialog-problem {
|
|
border: none;
|
|
background-color: transparent;
|
|
margin: 0;
|
|
padding: 0;
|
|
resize: none;
|
|
font-size: 0.8em;
|
|
font-family: sans-serif;
|
|
height: 5em;
|
|
}
|
|
|
|
.ve-init-mw-viewPageTarget-saveDialog-editSummary:focus,
|
|
.ve-init-mw-viewPageTarget-saveDialog-problem:focus {
|
|
outline: none;
|
|
}
|
|
|
|
/* Images */
|
|
|
|
.ve-init-mw-viewPageTarget-loading,
|
|
.ve-init-mw-viewPageTarget-saveDialog-working {
|
|
/* @embed */
|
|
background-image: url(images/loading.gif);
|
|
}
|