mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-12-01 17:36:35 +00:00
06c86b3881
Firefox: * Doesn't fire events without a selection, so when all we have is a focusable node, create a dummy selection in the paste target so the browser triggers an event on command+C. Clipboard keys: * Instead of just creating a text hash which may or may not match up with the plain text in the clipboard data, just convert the clipboard store into an array and use the index as the key. Also prepend a random number (clipboardId) so on paste we can verify the copy came from the same CE document. The text hash is now used for validation if only HTML is written to the clipboard. HTML: * Instead letting the browser grab CE HTML, always get DM HTML from the converter as it is cleaner (no phantoms, linefeed markers, extra class names etc.), and will make cross-ve-instance pasting easier in the future. Clipboard overriding: * Always override the clipboard with the above HTML, either using clipboardData.setData if it is available (webkit) or by throwing the HTML into the pasteTarget and selecting it during pre-copy. Bug: 53375 Bug: 49396 Bug: 52096 Change-Id: Id0f39c10818047bb4b8922e97cead153a770757f
81 lines
1.4 KiB
CSS
81 lines
1.4 KiB
CSS
/*!
|
|
* VisualEditor ContentEditable Surface styles.
|
|
*
|
|
* @copyright 2011-2013 VisualEditor Team and others; see AUTHORS.txt
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
*/
|
|
|
|
.ve-ce-surface {
|
|
overflow: hidden;
|
|
font-size: 1em; /* to look more like MediaWiki use: 0.8em */;
|
|
}
|
|
|
|
.ve-ce-surface-textarea {
|
|
position: absolute;
|
|
z-index: -1;
|
|
opacity: 0;
|
|
color: white;
|
|
background-color: #fff;
|
|
border: none;
|
|
padding: 0;
|
|
margin: 0;
|
|
width: 1px;
|
|
}
|
|
|
|
.ve-ce-surface-textarea:focus {
|
|
outline: none;
|
|
}
|
|
|
|
.ve-ce-surface-cursor {
|
|
position: absolute;
|
|
background-color: #000;
|
|
width: 1px;
|
|
display: none;
|
|
}
|
|
|
|
/* @noflip */
|
|
.ve-ce-surface-phantoms {
|
|
left: 0;
|
|
opacity: 0.75;
|
|
position: absolute;
|
|
top: 0;
|
|
}
|
|
|
|
/* @noflip */
|
|
.ve-ce-surface-highlights {
|
|
left: 0;
|
|
opacity: 0.5;
|
|
pointer-events: none;
|
|
position: absolute;
|
|
top: 0;
|
|
}
|
|
|
|
.ve-ce-surface-paste {
|
|
height: 1px;
|
|
left: 0;
|
|
opacity: 0;
|
|
overflow: hidden;
|
|
position: fixed;
|
|
top: 0;
|
|
width: 1px;
|
|
}
|
|
|
|
.ve-ce-surface-paste * {
|
|
height: 1px !important;
|
|
width: 1px !important;
|
|
}
|
|
|
|
/* MediaWiki PHP Parser does not wrap text inside image captions in <p> but we do (cause we have to).
|
|
* Let's make those <p> looks like they are not there by proper CSS styling.
|
|
*/
|
|
/*csslint overqualified-elements:false */
|
|
.ve-ce-surface .thumbcaption p.ve-ce-generated-wrapper {
|
|
display: inline;
|
|
padding: 0;
|
|
line-height: inherit;
|
|
}
|
|
|
|
.ve-ce-surface .thumbcaption .ve-ce-branchNode-slug {
|
|
display: none;
|
|
}
|