Removed Special:VisualEditorSandbox and refactored demo

Also renamed ext.visualEditor.editPageInit to
ext.visualEditor.viewPageTarget

Change-Id: I8bdd04b3442067e87bccbc60dd4947aae1c7dfd2
This commit is contained in:
Trevor Parscal 2012-06-28 02:52:03 -07:00 committed by Catrope
parent f995fc025a
commit 9a0380c67d
14 changed files with 142 additions and 1233 deletions

View file

@ -1,36 +0,0 @@
<?php
/**
* Sandbox SpecialPage for VisualEditor extension
*
* @file
* @ingroup Extensions
*/
class SpecialVisualEditorSandbox extends SpecialPage {
/* Methods */
public function __construct() {
parent::__construct( 'VisualEditorSandbox' );
}
public function execute( $par ) {
global $wgOut;
$wgOut->addModules( 'ext.visualEditor.special.sandbox' );
$this->setHeaders();
$wgOut->setPageTitle( wfMsg( 'visualeditor-sandbox-title' ) );
$modeWikitext = wfMsgHtml( 'visualeditor-tooltip-wikitext' );
$modeJson = wfMsgHtml( 'visualeditor-tooltip-json' );
$modeHtml = wfMsgHtml( 'visualeditor-tooltip-html' );
$modeRender = wfMsgHtml( 'visualeditor-tooltip-render' );
$modeHistory = wfMsgHtml( 'visualeditor-tooltip-history' );
$modeHelp = wfMsgHtml( 'visualeditor-tooltip-help' );
$dir = dirname( __FILE__ );
ob_start();
include( 'modules/sandbox/base.php' );
$out = ob_get_clean();
$wgOut->addHtml( $out );
}
}

View file

@ -1,49 +0,0 @@
<?php
/**
* Aliases for special pages for extension VisualEditor
*
* @file
* @ingroup Extensions
*/
$specialPageAliases = array();
/** English (English) */
$specialPageAliases['en'] = array(
'VisualEditorSandbox' => array( 'VisualEditorSandbox' ),
);
/** Arabic (العربية) */
$specialPageAliases['ar'] = array(
'VisualEditorSandbox' => array( 'ملعب_المحرر_المرئي' ),
);
/** German (Deutsch) */
$specialPageAliases['de'] = array(
'VisualEditorSandbox' => array( 'WYSIWYG-Editor-Spielwiese' ),
);
/** Zazaki (Zazaki) */
$specialPageAliases['diq'] = array(
'VisualEditorSandbox' => array( 'AsengiyaDorakumdêVurneri' ),
);
/** Swiss German (Alemannisch) */
$specialPageAliases['gsw'] = array(
'VisualEditorSandbox' => array( 'WYSIWYG-Editor-Sandchaschte' ),
);
/** Interlingua (interlingua) */
$specialPageAliases['ia'] = array(
'VisualEditorSandbox' => array( 'Cassa_a_sablo_visual' ),
);
/** Korean (한국어) */
$specialPageAliases['ko'] = array(
'VisualEditorSandbox' => array( '시각편집실험실' ),
);
/** Macedonian (македонски) */
$specialPageAliases['mk'] = array(
'VisualEditorSandbox' => array( 'ПесокЛиковенУредник' ),
);

View file

@ -21,7 +21,7 @@ class VisualEditorHooks {
$skin->getRelevantTitle()->getNamespace() === NS_VISUALEDITOR $skin->getRelevantTitle()->getNamespace() === NS_VISUALEDITOR
) )
) { ) {
$output->addModules( array( 'ext.visualEditor.editPageInit' ) ); $output->addModules( array( 'ext.visualEditor.viewPageTarget' ) );
} }
return true; return true;
} }

View file

@ -6,15 +6,7 @@ $messages = array();
*/ */
$messages['en'] = array( $messages['en'] = array(
'visualeditor' => 'VisualEditor', 'visualeditor' => 'VisualEditor',
'visualeditorsandbox' => 'Visual editor sandbox',
'visualeditor-desc' => 'Visual editor for MediaWiki', 'visualeditor-desc' => 'Visual editor for MediaWiki',
'visualeditor-sandbox-title' => 'Visual editor sandbox',
'visualeditor-tooltip-wikitext' => 'Toggle wikitext view',
'visualeditor-tooltip-json' => 'Toggle JSON view',
'visualeditor-tooltip-html' => 'Toggle HTML view',
'visualeditor-tooltip-render' => 'Toggle preview',
'visualeditor-tooltip-history' => 'Toggle transaction history view',
'visualeditor-tooltip-help' => 'Toggle help view',
'visualeditor-feedback-prompt' => 'Leave feedback', 'visualeditor-feedback-prompt' => 'Leave feedback',
'visualeditor-feedback-dialog-title' => 'Leave feedback about VisualEditor Sandbox', 'visualeditor-feedback-dialog-title' => 'Leave feedback about VisualEditor Sandbox',
'visualeditor-ca-editsource' => 'Edit source', 'visualeditor-ca-editsource' => 'Edit source',

View file

@ -39,10 +39,6 @@ $wgExtensionCredits['other'][] = array(
); );
$dir = dirname( __FILE__ ) . '/'; $dir = dirname( __FILE__ ) . '/';
$wgExtensionMessagesFiles['VisualEditor'] = $dir . 'VisualEditor.i18n.php'; $wgExtensionMessagesFiles['VisualEditor'] = $dir . 'VisualEditor.i18n.php';
$wgExtensionMessagesFiles['VisualEditorAliases'] = $dir . 'VisualEditor.alias.php';
$wgAutoloadClasses['SpecialVisualEditorSandbox'] = $dir . 'SpecialVisualEditorSandbox.php';
$wgSpecialPages['VisualEditorSandbox'] = 'SpecialVisualEditorSandbox';
$wgSpecialPageGroups['VisualEditorSandbox'] = 'other';
$wgVisualEditorResourceTemplate = array( $wgVisualEditorResourceTemplate = array(
'localBasePath' => dirname( __FILE__ ) . '/modules', 'localBasePath' => dirname( __FILE__ ) . '/modules',
@ -57,34 +53,13 @@ $wgResourceModules += array(
'rangy/rangy-position.js', 'rangy/rangy-position.js',
), ),
), ),
'ext.visualEditor.special.sandbox' => $wgVisualEditorResourceTemplate + array( // Alias for backwards compat, safe to remove after
'scripts' => array( 'ext.visualEditor.editPageInit' => $wgVisualEditorResourceTemplate + array(
'sandbox/special.js', 'dependencies' => array(
), 'ext.visualEditor.viewPageTarget',
'messages' => array(
'visualeditor-feedback-prompt',
'visualeditor-feedback-dialog-title',
'visualeditor-sandbox-title',
),
'dependencies' => array(
'ext.visualEditor.sandbox',
'mediawiki.feedback',
'mediawiki.Uri',
) )
), ),
'ext.visualEditor.sandbox' => $wgVisualEditorResourceTemplate + array( 'ext.visualEditor.viewPageTarget' => $wgVisualEditorResourceTemplate + array(
'scripts' => array(
'sandbox/sandbox.js',
),
'messages' => array(
'visualeditorsandbox',
),
'styles' => 'sandbox/sandbox.css',
'dependencies' => array(
'ext.visualEditor.core',
),
),
'ext.visualEditor.editPageInit' => $wgVisualEditorResourceTemplate + array(
'scripts' => array( 'scripts' => array(
've/init/targets/ve.init.ViewPageTarget.js', 've/init/targets/ve.init.ViewPageTarget.js',
), ),
@ -249,12 +224,6 @@ $wgResourceModules += array(
'ext.visualEditor.base' 'ext.visualEditor.base'
), ),
'messages' => array( 'messages' => array(
'visualeditor-tooltip-wikitext',
'visualeditor-tooltip-json',
'visualeditor-tooltip-html',
'visualeditor-tooltip-render',
'visualeditor-tooltip-history',
'visualeditor-tooltip-help',
'visualeditor', 'visualeditor',
'visualeditor-linkinspector-title', 'visualeditor-linkinspector-title',
'visualeditor-linkinspector-tooltip', 'visualeditor-linkinspector-tooltip',

101
demos/ve/demo.css Normal file
View file

@ -0,0 +1,101 @@
body {
font-family: "Arial";
font-size: 1em;
width: 100%;
margin: 1em 0;
padding: 0;
overflow-y: scroll;
background-color: white;
}
/* Demo */
.ve-demo-docs {
list-style: none;
margin: 0 0 1em 0;
display: inline-block;
}
.ve-demo-docs li {
list-style: none;
margin: 0 0.75em 0 0;
padding: 0;
display: inline-block;
}
/* Editor */
.es-base {
margin: 2em;
margin-top: 0;
-webkit-box-shadow: 0 0.25em 1.5em 0 #dddddd;
-moz-box-shadow: 0 0.25em 1.5em 0 #dddddd;
box-shadow: 0 0.25em 1.5em 0 #dddddd;
-webkit-border-radius: 0.5em;
-moz-border-radius: 0.5em;
-o-border-radius: 0.5em;
border-radius: 0.5em;
}
.ve-ce-documentNode {
border: solid 1px #cccccc;
border-top: none;
padding: 0.75em 1.5em;
}
.es-toolbar {
border: solid 1px #cccccc;
position: relative;
-webkit-border-radius: 0;
-moz-border-radius: 0;
-o-border-radius: 0;
border-radius: 0;
-webkit-border-top-right-radius: 0.25em;
-moz-border-top-right-radius: 0.25em;
-o-border-top-right-radius: 0.25em;
border-top-right-radius: 0.25em;
-webkit-border-top-left-radius: 0.25em;
-moz-border-top-left-radius: 0.25em;
-o-border-top-left-radius: 0.25em;
border-top-left-radius: 0.25em;
background-image: url(../../modules/ve/ui/styles/images/fade-up.png);
background-position: left bottom;
background-repeat: repeat-x;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
-o-user-select: none;
user-select: none;
}
.es-toolbar-wrapper.float .es-toolbar {
top: 0;
position: fixed;
-webkit-border-radius: 0;
-moz-border-radius: 0;
-o-border-radius: 0;
border-radius: 0;
z-index: 100;
border-top: none;
}
.es-toolbar-shadow {
background-image: url(../../modules/ve/ui/styles/images/toolbar-shadow.png);
background-position: left top;
background-repeat: repeat-x;
position: absolute;
bottom: -9px;
height: 9px;
width: 100%;
pointer-events: none;
-ms-transition: opacity 500ms ease-in-out;
-webkit-transition: opacity 500ms ease-in-out;
-moz-transition: opacity 500ms ease-in-out;
-o-transition: opacity 500ms ease-in-out;
transition: opacity 500ms ease-in-out;
opacity: 0.125;
}
.es-toolbar-wrapper.float .es-toolbar-shadow {
opacity: 0.5;
}

View file

@ -1,9 +1,18 @@
<?php
$path = dirname( __FILE__ ) . '/pages';
$pages = glob( $path . '/*.html' );
$page = current( $pages );
if ( isset( $_GET['page'] ) && in_array( $path . '/' . $_GET['page'] . '.html', $pages ) ) {
$page = $path . '/' . $_GET['page'] . '.html';
}
$html = '<div>' . file_get_contents( $page ) . '</div>';
?>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<title>VisualEditor Demo</title> <title>VisualEditor Standalone Demo</title>
<!-- ce --> <!-- ce -->
<link rel="stylesheet" href="../../modules/ve/ce/styles/ve.ce.Document.css"> <link rel="stylesheet" href="../../modules/ve/ce/styles/ve.ce.Document.css">
<link rel="stylesheet" href="../../modules/ve/ce/styles/ve.ce.Node.css"> <link rel="stylesheet" href="../../modules/ve/ce/styles/ve.ce.Node.css">
@ -14,73 +23,21 @@
<link rel="stylesheet" href="../../modules/ve/ui/styles/ve.ui.Menu.css"> <link rel="stylesheet" href="../../modules/ve/ui/styles/ve.ui.Menu.css">
<link rel="stylesheet" href="../../modules/ve/ui/styles/ve.ui.Surface.css"> <link rel="stylesheet" href="../../modules/ve/ui/styles/ve.ui.Surface.css">
<link rel="stylesheet" href="../../modules/ve/ui/styles/ve.ui.Toolbar.css"> <link rel="stylesheet" href="../../modules/ve/ui/styles/ve.ui.Toolbar.css">
<!-- sandbox --> <!-- demo -->
<link rel="stylesheet" href="../../modules/sandbox/sandbox.css"> <link rel="stylesheet" href="demo.css">
<style>
body {
font-family: "Arial";
font-size: 1em;
width: 100%;
margin: 1em 0;
padding: 0;
overflow-y: scroll;
background-color: white;
}
#es-warning {
margin: 2em 2em 1em 2em;
}
#es-docs {
margin: 0 2em 1em 2em;
}
.es-base {
margin: 2em;
margin-top: 0em;
-webkit-box-shadow: 0 0.25em 1.5em 0 #dddddd;
-moz-box-shadow: 0 0.25em 1.5em 0 #dddddd;
box-shadow: 0 0.25em 1.5em 0 #dddddd;
-webkit-border-radius: 0.5em;
-moz-border-radius: 0.5em;
-o-border-radius: 0.5em;
border-radius: 0.5em;
}
.es-panes {
border: solid 1px #cccccc;
border-top: none;
}
.es-editor, .es-showData .es-editor {
padding-left: 1em;
padding-right: 1em;
}
.es-toolbar {
-webkit-border-radius: 0;
-moz-border-radius: 0;
-o-border-radius: 0;
border-radius: 0;
-webkit-border-top-right-radius: 0.25em;
-moz-border-top-right-radius: 0.25em;
-o-border-top-right-radius: 0.25em;
border-top-right-radius: 0.25em;
-webkit-border-top-left-radius: 0.25em;
-moz-border-top-left-radius: 0.25em;
-o-border-top-left-radius: 0.25em;
border-top-left-radius: 0.25em;
}
.es-toolbar.float {
left: 2em;
right: 2em;
top: 0;
}
.es-docs {
margin-left: 2.5em;
}
</style>
</head> </head>
<body> <body>
<?php <ul class="ve-demo-docs">
<?php foreach( $pages as $page ): ?>
<li>
<a href="./?page=<?php echo basename( $page, '.html' ); ?>">
<?php echo basename( $page, '.html' ); ?>
</a>
</li>
<?php endforeach; ?>
</ul>
<div class="ve-demo-content"></div>
include( '../../modules/sandbox/base.php' );
?>
<!-- Rangy --> <!-- Rangy -->
<script src="../../modules/rangy/rangy-core.js"></script> <script src="../../modules/rangy/rangy-core.js"></script>
<script src="../../modules/rangy/rangy-position.js"></script> <script src="../../modules/rangy/rangy-position.js"></script>
@ -143,13 +100,6 @@ include( '../../modules/sandbox/base.php' );
<script src="../../modules/ve/dm/annotations/ve.dm.LinkAnnotation.js"></script> <script src="../../modules/ve/dm/annotations/ve.dm.LinkAnnotation.js"></script>
<script src="../../modules/ve/dm/annotations/ve.dm.TextStyleAnnotation.js"></script> <script src="../../modules/ve/dm/annotations/ve.dm.TextStyleAnnotation.js"></script>
<!--
<script src="../../modules/ve/dm/serializers/ve.dm.AnnotationSerializer.js"></script>
<script src="../../modules/ve/dm/serializers/ve.dm.HtmlSerializer.js"></script>
<script src="../../modules/ve/dm/serializers/ve.dm.JsonSerializer.js"></script>
<script src="../../modules/ve/dm/serializers/ve.dm.WikitextSerializer.js"></script>
-->
<!-- ce --> <!-- ce -->
<script src="../../modules/ve/ce/ve.ce.js"></script> <script src="../../modules/ve/ce/ve.ce.js"></script>
<script src="../../modules/ve/ce/ve.ce.NodeFactory.js"></script> <script src="../../modules/ve/ce/ve.ce.NodeFactory.js"></script>
@ -197,8 +147,16 @@ include( '../../modules/sandbox/base.php' );
<script src="../../modules/ve/ui/tools/ve.ui.IndentationButtonTool.js"></script> <script src="../../modules/ve/ui/tools/ve.ui.IndentationButtonTool.js"></script>
<script src="../../modules/ve/ui/tools/ve.ui.DropdownTool.js"></script> <script src="../../modules/ve/ui/tools/ve.ui.DropdownTool.js"></script>
<script src="../../modules/ve/ui/tools/ve.ui.FormatDropdownTool.js"></script> <script src="../../modules/ve/ui/tools/ve.ui.FormatDropdownTool.js"></script>
<!-- sandbox --> <!-- demo -->
<script src="../../modules/sandbox/sandbox.js"></script> <script>
$(document).ready( function() {
new ve.Surface(
$( '.ve-demo-content' ),
$( <?php echo json_encode( $html ) ?> )[0]
);
$( '.ve-ce-documentNode' ).focus();
} );
</script>
</body> </body>
</html> </html>

View file

@ -0,0 +1 @@
<p>123<b>456</b> is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p><h2><b>W<i>ha</i>t</b> is <i>Lorem<b> Ips<u>um?</u></b></i></h2><p>Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source.</p><table><tbody><tr><td><p>Lorem Ipsum is simply dummy text...</p></td><td><p>The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested.</p></td><td><p>Nullam aliquam ligula nec metus pretium in lobortis urna pellentesque.</p></td></tr><tr><td><p>Nullam nulla neque, luctus et cursus eu, sollicitudin sollicitudin massa.</p></td><td><p>Sed consectetur nunc blandit urna pulvinar eu porttitor lorem rutrum. Maecenas vel justo id felis consectetur euismod.</p></td><td><p>Suspendisse vulputate sagittis iaculis. Suspendisse potenti.</p></td></tr></tbody></table><p>Lorem ipsum is simply dummy text of the printing and typesetting industry.</p><h2><b>Where</b> can <i>I get some?</i></h2><ul><li><p><b>here</b></p></li><li><p>or <i>here</i></p></li><li><p>or <u>there</u></p></li></ul><ul><li><p><b>1</b></p></li><li><p><i>2</i></p></li><li><p><u>3</u></p></li></ul><h2>Why do we use it?</h2><table><tbody><tr><td><p>Tabel level 1</p><p>Hi Hi Ho Ho</p><table><tbody><tr><td><p>Tabel level 2</p><p>And list:</p><ul><li><p><b>here</b></p></li><li><p>or <i>here</i></p></li><li><p>or <u>there</u></p></li></ul><table><tbody><tr><td><p>Tabel level 3</p><p>Ha Ha Hi Hi</p></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table>

View file

@ -0,0 +1 @@
<p><b>Lorem Ipsum</b> is simpply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p><h2><b>What</b> is <i>Lorem Ipsum?</i></h2><p>Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source.</p><h3><b>Look</b> at <i>this headline</i></h3><p>Lorem ipsum is simply dummy text of the printing and typesetting industry.</p><h2><b>Where</b> can <i>I get some?</i></h2><ul><li><p><b>here</b></p></li><li><p>or <i>here</i></p></li><li><p>or <u>there</u></p></li></ul><h2>Why do we use it?</h2><p>Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source.</p>

View file

@ -1,4 +0,0 @@
<!-- VisualEditor Sandbox -->
<div id="es-warning" class="es-warning">WARNING: This an experimental deployment of the current visual editor codebase. It is still highly unstable and should be expected to break at any time.
<a href="#" id="es-warning-dismiss">Dismiss</a></div>
<!-- /VisualEditor Sandbox -->

View file

@ -1,280 +0,0 @@
.es-toolbar {
border: solid 1px #cccccc;
position: relative;
-webkit-border-radius: 0.25em;
-moz-border-radius: 0.25em;
-o-border-radius: 0.25em;
border-radius: 0.25em;
background-image: url(../ve/ui/styles/images/fade-up.png);
background-position: bottom left;
background-repeat: repeat-x;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
-o-user-select;
user-select: none;
}
.es-toolbar-wrapper.float .es-toolbar {
top: 0;
position: fixed;
-webkit-border-radius: 0;
-moz-border-radius: 0;
-o-border-radius: 0;
border-radius: 0;
z-index: 100;
border-top: none;
}
.es-toolbar-shadow {
background-image: url(../ve/ui/styles/images/toolbar-shadow.png);
background-position: top left;
background-repeat: repeat-x;
position: absolute;
bottom: -9px;
height: 9px;
width: 100%;
pointer-events: none;
-webkit-transition: opacity 500ms ease-in-out;
-moz-transition: opacity 500ms ease-in-out;
-o-transition: opacity 500ms ease-in-out;
transition: opacity 500ms ease-in-out;
opacity: 0.125;
}
.es-toolbar.float .es-toolbar-shadow {
opacity: 0.5;
}
.es-showData .es-editor {
border-right: solid 1px #cccccc;
margin: 0;
padding: 0;
}
.es-showData .es-visual {
margin: 0;
padding: 0;
float: left;
width: 50%;
overflow: hidden;
margin-left: -1px;
}
.es-panels {
display: none;
}
.es-showData .es-panels {
display: block;
float: right;
width: 50%;
overflow: hidden;
}
.es-panel {
margin: 0;
padding: 1em;
display: none;
}
.es-code {
white-space: pre-wrap;
font-family: monospace, "Courier New";
font-size: 0.8em;
}
.mediawiki .es-code {
font-size: 1em;
}
.es-render {
padding: 1em;
}
.es-history {
line-height: 1.5em;
padding: 0;
}
/* General MediaWiki Styles */
.es-render ul {
line-height: 1.5em;
list-style-type: square;
margin: .3em 0 0 1.5em;
padding: 0;
list-style-image: url(../ve/es/styles/images/bullet-icon.png);
}
.es-render ol {
line-height: 1.5em;
margin: .3em 0 0 3.2em;
padding: 0;
list-style-image: none;
}
.es-render li {
margin-bottom: .1em;
}
.mediawiki .es-menuView {
font-size: 0.9em;
}
.es-toolbar .es-toolbarGroups {
float: left;
}
.es-modes {
float: right;
padding: 0.25em;
}
.es-modes-button {
display: inline-block;
border: solid 1px transparent;
border-radius: 0.125em;
-webkit-border-radius: 0.125em;
-moz-border-radius: 0.125em;
-o-border-radius: 0.125em;
cursor: pointer;
vertical-align: top;
padding: 0.25em;
width: 22px;
height: 22px;
margin-right: 0.125em;
}
.es-modes-button:before {
content: " ";
position: absolute;
display: block;
height: 22px;
width: 22px;
}
.es-modes-button:hover {
border-color: #eeeeee;
}
.es-modes-button:active,
.es-modes-button-down {
border-color: #dddddd;
background-image: url(../ve/ui/styles/images/fade-down.png);
background-position: top left;
background-repeat: repeat-x;
-webkit-box-shadow: inset 0px 1px 4px 0px rgba(0, 0, 0, 0.07);
-moz-box-shadow: inset 0px 1px 4px 0px rgba(0, 0, 0, 0.07);
box-shadow: inset 0px 1px 4px 0px rgba(0, 0, 0, 0.07);
}
.es-mode-wikitext:before {
background-image: url(../ve/ui/styles/images/wikitext.png);
}
.es-mode-json:before {
background-image: url(../ve/ui/styles/images/json.png);
}
.es-mode-html:before {
background-image: url(../ve/ui/styles/images/html.png);
}
.es-mode-render:before {
background-image: url(../ve/ui/styles/images/render.png);
}
.es-mode-history:before {
background-image: url(../ve/ui/styles/images/history.png);
}
.es-mode-help:before {
background-image: url(../ve/ui/styles/images/help.png);
}
.es-panel-history div {
border-bottom: solid 1px #dddddd;
padding: 0.5em 0;
color: #666666;
background-color: #f9f9f9;
}
.es-panel-history div.es-panel-history-active {
color: #000000;
background-color: white;
}
#es-docs {
margin: 0 2em 1em 2em;
}
#es-docs-label {
display: inline-block;
}
#es-docs-list {
list-style: none;
margin: 0;
padding: 0;
display: inline-block;
}
.es-docs-listItem {
list-style: none;
margin: 0 0.75em 0 0;
padding: 0;
display: inline-block;
}
.es-help-title {
font-size: 1.5em;
}
.es-help-shortcuts-title {
margin: 1em 0 0.5em 0;
padding: 0;
font-size: 1.25em;
}
.es-help-shortcut {
margin-bottom: 1em;
font-size: 0.8em;
}
.es-help-keys {
display: inline-block;
margin-right: 0.5em;
}
.es-help-key {
display: inline-block;
padding: 0.33em 0.5em;
min-width: 1em;
text-align: center;
cursor: default;
border: solid 1px #333333;
border-top-color: #666666;
border-bottom-color: #000000;
background-color: #333333;
color: #ffffff;
-webkit-border-radius: 0.25em;
-moz-border-radius: 0.25em;
-o-border-radius: 0.25em;
border-radius: 0.25em;
-webkit-box-shadow: 0px 1px 4px 0px rgba(0, 0, 0, 0.5);
-moz-box-shadow: 0px 1px 4px 0px rgba(0, 0, 0, 0.5);
box-shadow: 0px 1px 4px 0px rgba(0, 0, 0, 0.5);
}
.es-help-key-or {
color: #999999;
}
.es-warning {
color: red;
text-align: center;
margin-bottom: 1em;
display: none;
border: solid 1px #ffbbbb;
padding: 0.5em 0.75em;
-webkit-border-radius: 0.25em;
-moz-border-radius: 0.25em;
-o-border-radius: 0.25em;
border-radius: 0.25em;
}
#es-warning-dismiss {
float: right;
color: white;
}
#es-warning-dismiss:hover {
text-decoration: none;
color: silver;
}
#es-warning-dismiss:after {
content: ' x';
color: black;
}

View file

@ -1,690 +0,0 @@
$(document).ready( function() {
/* var wikidoms = {
'Wikipedia article': {
'type': 'document',
'children': [
{
'type': 'paragraph',
'content': {
'text': 'In computer science, direct manipulation is a human-computer interaction style which involves continuous representation of objects of interest, and rapid, reversible, incremental actions and feedback. The intention is to allow a user to directly manipulate objects presented to them, using actions that correspond at least loosely to the physical world. An example of direct-manipulation is resizing a graphical shape, such as a rectangle, by dragging its corners or edges with a mouse.',
'annotations': [
{
'type': 'link/internal',
'range': {
'start': 3,
'end': 19
},
'data': {
'title': 'Computer_science'
}
},
{
'type': 'link/internal',
'range': {
'start': 46,
'end': 72
},
'data': {
'title': 'Human-computer interaction'
}
},
{
'type': 'textStyle/bold',
'range': {
'start': 21,
'end': 40
}
},
{
'type': 'textStyle/italic',
'range': {
'start': 28,
'end': 40
}
}
]
}
},
{
'type': 'table',
'attributes': { 'html/style': 'width: 300px; float: left; margin: 0 1em 1em 0; border: solid 1px;' },
'children': [
{
'type': 'tableRow',
'children': [
{
'type': 'tableCell',
'attributes': { 'html/style': 'border: solid 1px;' },
'children': [
{
'type': 'paragraph',
'content': { 'text': 'row 1 & cell 1' }
}
]
},
{
'type': 'tableCell',
'attributes': { 'html/style': 'border: solid 1px;' },
'children': [
{
'type': 'paragraph',
'content': { 'text': 'row 1 & cell 2' }
}
]
}
]
},
{
'type': 'tableRow',
'children': [
{
'type': 'tableCell',
'attributes': { 'html/style': 'border: solid 1px;' },
'children': [
{
'type': 'paragraph',
'content': { 'text': 'row 2 & cell 1' }
}
]
},
{
'type': 'tableCell',
'attributes': { 'html/style': 'border: solid 1px;' },
'children': [
{
'type': 'paragraph',
'content': { 'text': 'row 2 & cell 2' }
}
]
}
]
}
]
},
{
'type': 'paragraph',
'content': { 'text': 'Test 1' }
},
{
'type': 'paragraph',
'content': { 'text': 'Test 2' }
},
{
'type': 'paragraph',
'content': {
'text': 'The ViewTouch graphic touchscreen POS (point of sale) GUI developed by Gene Mosher on the Atari ST computer and first installed in restaurants in 1986 is an early example of an application specific GUI that manifests all of the characteristics of direct manipulation.',
'annotations': [
{
'type': 'textStyle/bold',
'range': {
'start': 0,
'end': 13
}
},
{
'type': 'textStyle/italic',
'range': {
'start': 34,
'end': 37
}
}
]
}
}
]
},
'Formatting': {
'type': 'document',
'children': [
{
'type': 'heading',
'attributes': { 'level': 1 },
'content': {
'text': 'This is a heading (level 1)',
'annotations': [
{
'type': 'textStyle/italic',
'range': {
'start': 10,
'end': 17
}
}
]
}
},
{
'type': 'paragraph',
'content': { 'text': 'Paragraph' }
},
{
'type': 'heading',
'attributes': { 'level': 2 },
'content': {
'text': 'This is a heading (level 2)',
'annotations': [
{
'type': 'textStyle/italic',
'range': {
'start': 10,
'end': 17
}
}
]
}
},
{
'type': 'paragraph',
'content': { 'text': 'Paragraph' }
},
{
'type': 'heading',
'attributes': { 'level': 3 },
'content': {
'text': 'This is a heading (level 3)',
'annotations': [
{
'type': 'textStyle/italic',
'range': {
'start': 10,
'end': 17
}
}
]
}
},
{
'type': 'paragraph',
'content': { 'text': 'Paragraph' }
},
{
'type': 'heading',
'attributes': { 'level': 4 },
'content': {
'text': 'This is a heading (level 4)',
'annotations': [
{
'type': 'textStyle/italic',
'range': {
'start': 10,
'end': 17
}
}
]
}
},
{
'type': 'paragraph',
'content': { 'text': 'Paragraph' }
},
{
'type': 'heading',
'attributes': { 'level': 5 },
'content': {
'text': 'This is a heading (level 5)',
'annotations': [
{
'type': 'textStyle/italic',
'range': {
'start': 10,
'end': 17
}
}
]
}
},
{
'type': 'paragraph',
'content': { 'text': 'Paragraph' }
},
{
'type': 'heading',
'attributes': { 'level': 6 },
'content': {
'text': 'This is a heading (level 6)',
'annotations': [
{
'type': 'textStyle/italic',
'range': {
'start': 10,
'end': 17
}
}
]
}
},
{
'type': 'paragraph',
'content': { 'text': 'Paragraph' }
},
{
'type': 'pre',
'content': { 'text': 'A lot of text goes here... and at some point it wraps.. A lot of text goes here... and at some point it wraps.. A lot of text goes here... and at some point it wraps.. A lot of text goes here... and at some point it wraps.. A lot of text goes here... and at some point it wraps..' }
},
{
'type': 'heading',
'attributes': { 'level': 1 },
'content': { 'text': 'Lists' }
},
{
'type': 'list',
'attributes': { 'style': 'bullet' },
'children': [
{
'type': 'listItem',
'attributes': { 'style': 'item' },
'children' : [
{
'type': 'paragraph',
'content': { 'text': 'Bullet' }
}
]
}
]
},
{
'type': 'paragraph',
'content': { 'text': 'Paragraph' }
},
{
'type': 'list',
'attributes': { 'style': 'bullet' },
'children': [
{
'type': 'listItem',
'attributes': { 'style': 'item' },
'children' : [
{
'type': 'paragraph',
'content': { 'text': 'Bullet' }
},
{
'type': 'list',
'attributes': { 'style': 'bullet' },
'children': [
{
'type': 'listItem',
'attributes': { 'style': 'item' },
'children' : [
{
'type': 'paragraph',
'content': { 'text': 'Bullet bullet' }
}
]
},
{
'type': 'list',
'attributes': { 'style': 'bullet' },
'children' : [
{
'type': 'listItem',
'attributes': { 'style': 'item' },
'children' : [
{
'type': 'paragraph',
'content': { 'text': 'Bullet bullet bullet' }
}
]
}
]
}
]
}
]
}
]
},
{
'type': 'list',
'attributes': { 'style': 'number' },
'children': [
{
'type': 'listItem',
'attributes': { 'style': 'item' },
'children' : [
{
'type': 'paragraph',
'content': { 'text': 'Number' }
},
{
'type': 'list',
'attributes': { 'style': 'number' },
'children': [
{
'type': 'listItem',
'attributes': { 'style': 'item' },
'children' : [
{
'type': 'paragraph',
'content': { 'text': 'Number number' }
}
]
},
{
'type': 'list',
'attributes': { 'style': 'number' },
'children' : [
{
'type': 'listItem',
'attributes': { 'style': 'item' },
'children' : [
{
'type': 'paragraph',
'content': { 'text': 'Number number number' }
}
]
}
]
}
]
}
]
}
]
},
{
'type': 'list',
'attributes': { 'style': 'definition' },
'children': [
{
'type': 'listItem',
'attributes': { 'style': 'term' },
'children' : [
{
'type': 'paragraph',
'content': { 'text': 'Term' }
}
]
},
{
'type': 'listItem',
'attributes': { 'style': 'definition' },
'children' : [
{
'type': 'paragraph',
'content': { 'text': 'Definition' }
}
]
}
]
}
]
}, */
/*
'Tables': {
'type': 'document',
'children': [
{
'type': 'heading',
'attributes': { 'level': 1 },
'content': { 'text': 'Tables' }
},
{
'type': 'table',
'attributes': { 'html/style': 'width: 600px; border: solid 1px;' },
'children': [
{
'type': 'tableRow',
'children': [
{
'type': 'tableCell',
'attributes': { 'html/style': 'border: solid 1px;' },
'children': [
{
'type': 'paragraph',
'content': { 'text': 'row 1 & cell 1' }
},
{
'type': 'list',
'children': [
{
'type': 'listItem',
'attributes': {
'styles': ['bullet']
},
'children' : [
{
'type': 'paragraph',
'content': { 'text': 'Test 4444' }
}
]
},
{
'type': 'listItem',
'attributes': {
'styles': ['bullet', 'bullet']
},
'children' : [
{
'type': 'paragraph',
'content': { 'text': 'Test 55555' }
}
]
},
{
'type': 'listItem',
'attributes': {
'styles': ['number']
},
'children' : [
{
'type': 'paragraph',
'content': { 'text': 'Test 666666' }
}
]
}
]
}
]
},
{
'type': 'tableCell',
'attributes': { 'html/style': 'border: solid 1px;' },
'children': [
{
'type': 'paragraph',
'content': { 'text': 'row 1 & cell 2' }
}
]
}
]
}
]
}
]
},*/
/* 'New document': {
'type': 'document',
'children': [
{
'type': 'paragraph',
'content': { 'text': '' }
}
]
}
}; */
/* Sandbox integration hack. Allows both MW integration and demo pages to work */
if ( $('#content').length === 0 ) {
$( 'body' ).append(
$( '<div />' ).attr( 'id', 'content' )
);
}
// Overwrite input data with example data
/*
data = [
{ 'type': 'heading', 'attributes': { 'level': 1 } },
'a',
'b',
'c',
{ 'type': '/heading' },
{ 'type': 'paragraph' },
'a',
['b', { '{"type":"textStyle/bold"}': { 'type': 'textStyle/bold' } }],
['c', { '{"type":"textStyle/italic"}': { 'type': 'textStyle/italic' } }],
{ 'type': '/paragraph' },
{ 'type': 'paragraph' },
{ 'type': 'image', 'attributes': { 'html/src': 'http://placekitten.com/g/120/120' } },
{ 'type': '/image' },
'L',
'o',
'r',
'e',
'm',
' ',
'i',
'p',
's',
'u',
'm',
' ',
{ 'type': 'image', 'attributes': { 'html/src': 'http://placekitten.com/g/100/100' } },
{ 'type': '/image' },
' ',
'a',
'n',
'd',
{ 'type': '/paragraph' },
{ 'type': 'table' },
{ 'type': 'tableRow' },
{ 'type': 'tableCell' },
{ 'type': 'paragraph' },
['a', {
'{"type":"textStyle/italic"}': { 'type': 'textStyle/italic' },
'{"type":"textStyle/bold"}': { 'type': 'textStyle/bold' }
}],
{ 'type': '/paragraph' },
{ 'type': '/tableCell' },
{ 'type': '/tableRow' },
{ 'type': '/table' },
{ 'type': 'list', 'attributes': { 'style': 'bullet' } },
{ 'type': 'listItem', 'attributes': { 'style': 'item' } },
{ 'type': 'paragraph' },
'a',
{ 'type': '/paragraph' },
{ 'type': '/listItem' },
{ 'type': '/list' },
{ 'type': 'image', 'attributes': { 'html/src': 'http://dl.dropbox.com/u/1026938/wikia.jpeg' } },
{ 'type': '/image' },
];
*/
// Define HTML5 DOM
var HTML = $(
'<div>' +
'<p>123<b>456</b> is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>' +
'<h2><b>W<i>ha</i>t</b> is <i>Lorem<b> Ips<u>um?</u></b></i></h2>' +
'<p>Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source.</p>' +
'<table><tbody>' +
'<tr>' +
'<td><p>Lorem Ipsum is simply dummy text...</p></td>' +
'<td><p>The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested.</p></td>' +
'<td><p>Nullam aliquam ligula nec metus pretium in lobortis urna pellentesque.</p></td>' +
'</tr>' +
'<tr>' +
'<td><p>Nullam nulla neque, luctus et cursus eu, sollicitudin sollicitudin massa.</p></td>' +
'<td><p>Sed consectetur nunc blandit urna pulvinar eu porttitor lorem rutrum. Maecenas vel justo id felis consectetur euismod.</p></td>' +
'<td><p>Suspendisse vulputate sagittis iaculis. Suspendisse potenti.</p></td>' +
'</tr>' +
'</tbody></table>' +
'<p>Lorem ipsum is simply dummy text of the printing and typesetting industry.</p>' +
'<h2><b>Where</b> can <i>I get some?</i></h2>' +
'<ul>' +
'<li><p><b>here</b></p></li>' +
'<li><p>or <i>here</i></p></li>' +
'<li><p>or <u>there</u></p></li>' +
'</ul>' +
'<ul>' +
'<li><p><b>1</b></p></li>' +
'<li><p><i>2</i></p></li>' +
'<li><p><u>3</u></p></li>' +
'</ul>' +
'<h2>Why do we use it?</h2>' +
'<table><tbody>' +
'<tr>' +
'<td>' +
'<p>Tabel level 1</p>' +
'<p>Hi Hi Ho Ho</p>' +
'<table><tbody>' +
'<tr>' +
'<td>' +
'<p>Tabel level 2</p>' +
'<p>And list:</p>' +
'<ul>' +
'<li><p><b>here</b></p></li>' +
'<li><p>or <i>here</i></p></li>' +
'<li><p>or <u>there</u></p></li>' +
'</ul>' +
'<table><tbody>' +
'<tr>' +
'<td>' +
'<p>Tabel level 3</p>' +
'<p>Ha Ha Hi Hi</p>' +
'</td>' +
'</tr>' +
'</tbody></table>' +
'</td>' +
'</tr>' +
'</tbody></table>' +
'</td>' +
'</tr>' +
'</tbody></table>' +
'</div>' );
// HTML without images and aliens
HTML = $(
'<div>' +
'<p><b>Lorem Ipsum</b> is simpply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>' +
'<h2><b>What</b> is <i>Lorem Ipsum?</i></h2>' +
'<p>Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source.</p>' +
'<h3><b>Look</b> at <i>this headline</i></h3>' +
'<p>Lorem ipsum is simply dummy text of the printing and typesetting industry.</p>' +
'<h2><b>Where</b> can <i>I get some?</i></h2>' +
'<ul>' +
'<li><p><b>here</b></p></li>' +
'<li><p>or <i>here</i></p></li>' +
'<li><p>or <u>there</u></p></li>' +
'</ul>' +
'<h2>Why do we use it?</h2>' +
'<p>Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source.</p>' +
'</div>' );
/* Sandbox config object. */
var options = {
toolbars: {
top: {
/* What modes this toolbar will have */
modes: ['wikitext', 'json', 'html', 'render', 'history', 'help']
}
}
};
/*
Create Sandbox instance of VE
Attach to #content element
*/
var sandboxEditor = new ve.Surface( '#content', HTML[0], options ),
surfaceModel = sandboxEditor.getModel(),
documentModel = sandboxEditor.getDocumentModel(),
parent = sandboxEditor.getParent(),
view = sandboxEditor.view;
window.sandboxEditor = sandboxEditor;
/* Rob's test selection stuff */
//surfaceModel.setSelection( new ve.Range(0, documentModel.getData().length ) );
//surfaceModel.setSelection( new ve.Range( 178, 185 ) );
//view.showSelection ( surfaceModel.getSelection() );
/* Sandbox Warning Message */
$( '#es-docs' ).css( { 'visibility': 'visible' } );
// Show the warning that this software is experimental
// TODO: Use a cookie to remember the warning has been dismissed
$( '#es-warning' ).show();
$( '#es-warning-dismiss' ).click( function() {
$(this).parent().slideUp();
return false;
} );
//$( '.es-mode-wikitext' ).click();
} );

View file

@ -1,26 +0,0 @@
( function( $, mw, undefined ) {
$(document).ready( setupSpecial );
function setupSpecial() {
var feedback = new mw.Feedback( {
'title': new mw.Title( 'Visual editor/Feedback' ),
'dialogTitleMessageKey': 'visualeditor-feedback-dialog-title',
'bugsLink': new mw.Uri( 'https://bugzilla.wikimedia.org/enter_bug.cgi?product=MediaWiki%20extensions&component=VisualEditor' ),
'bugsListLink': new mw.Uri( 'https://bugzilla.wikimedia.org/buglist.cgi?query_format=advanced&component=VisualEditor&resolution=---&resolution=LATER&resolution=DUPLICATE&product=MediaWiki%20extensions' )
} );
var $feedbackLink = $( '<a></a>' )
.attr( { 'href': '#' } )
.text( mw.msg( 'visualeditor-feedback-prompt' ) )
.click( function() { feedback.launch(); } );
// Right before the line with the test "documents" we prepend a float-right
// div, which puts it on the same line as the documents at right.
$( '#es-docs' ).before(
$( '<div></div>' ).css( { 'float': 'right' } ).append( $feedbackLink )
);
}
} )( jQuery, window.mediaWiki );

View file

@ -250,31 +250,3 @@
.es-help-key-or { .es-help-key-or {
color: #999999; color: #999999;
} }
.es-warning {
color: red;
text-align: center;
margin-bottom: 1em;
display: none;
border: solid 1px #ffbbbb;
padding: 0.5em 0.75em;
-webkit-border-radius: 0.25em;
-moz-border-radius: 0.25em;
-o-border-radius: 0.25em;
border-radius: 0.25em;
}
#es-warning-dismiss {
float: right;
color: white;
}
#es-warning-dismiss:hover {
text-decoration: none;
color: silver;
}
#es-warning-dismiss:after {
content: ' x';
color: black;
}