diff --git a/SpecialVisualEditorSandbox.php b/SpecialVisualEditorSandbox.php deleted file mode 100644 index e9e7dc1acd..0000000000 --- a/SpecialVisualEditorSandbox.php +++ /dev/null @@ -1,36 +0,0 @@ -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 ); - } -} diff --git a/VisualEditor.alias.php b/VisualEditor.alias.php deleted file mode 100644 index b2657d8ea9..0000000000 --- a/VisualEditor.alias.php +++ /dev/null @@ -1,49 +0,0 @@ - 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( 'ПесокЛиковенУредник' ), -); \ No newline at end of file diff --git a/VisualEditor.hooks.php b/VisualEditor.hooks.php index e43fef59dd..62cb4ae428 100644 --- a/VisualEditor.hooks.php +++ b/VisualEditor.hooks.php @@ -21,7 +21,7 @@ class VisualEditorHooks { $skin->getRelevantTitle()->getNamespace() === NS_VISUALEDITOR ) ) { - $output->addModules( array( 'ext.visualEditor.editPageInit' ) ); + $output->addModules( array( 'ext.visualEditor.viewPageTarget' ) ); } return true; } diff --git a/VisualEditor.i18n.php b/VisualEditor.i18n.php index c310a7e8a7..612f27afa3 100644 --- a/VisualEditor.i18n.php +++ b/VisualEditor.i18n.php @@ -6,15 +6,7 @@ $messages = array(); */ $messages['en'] = array( 'visualeditor' => 'VisualEditor', - 'visualeditorsandbox' => 'Visual editor sandbox', '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-dialog-title' => 'Leave feedback about VisualEditor Sandbox', 'visualeditor-ca-editsource' => 'Edit source', diff --git a/VisualEditor.php b/VisualEditor.php index a236636778..96b031c264 100644 --- a/VisualEditor.php +++ b/VisualEditor.php @@ -39,10 +39,6 @@ $wgExtensionCredits['other'][] = array( ); $dir = dirname( __FILE__ ) . '/'; $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( 'localBasePath' => dirname( __FILE__ ) . '/modules', @@ -57,34 +53,13 @@ $wgResourceModules += array( 'rangy/rangy-position.js', ), ), - 'ext.visualEditor.special.sandbox' => $wgVisualEditorResourceTemplate + array( - 'scripts' => array( - 'sandbox/special.js', - ), - 'messages' => array( - 'visualeditor-feedback-prompt', - 'visualeditor-feedback-dialog-title', - 'visualeditor-sandbox-title', - ), - 'dependencies' => array( - 'ext.visualEditor.sandbox', - 'mediawiki.feedback', - 'mediawiki.Uri', + // Alias for backwards compat, safe to remove after + 'ext.visualEditor.editPageInit' => $wgVisualEditorResourceTemplate + array( + 'dependencies' => array( + 'ext.visualEditor.viewPageTarget', ) ), - 'ext.visualEditor.sandbox' => $wgVisualEditorResourceTemplate + array( - 'scripts' => array( - 'sandbox/sandbox.js', - ), - 'messages' => array( - 'visualeditorsandbox', - ), - 'styles' => 'sandbox/sandbox.css', - 'dependencies' => array( - 'ext.visualEditor.core', - ), - ), - 'ext.visualEditor.editPageInit' => $wgVisualEditorResourceTemplate + array( + 'ext.visualEditor.viewPageTarget' => $wgVisualEditorResourceTemplate + array( 'scripts' => array( 've/init/targets/ve.init.ViewPageTarget.js', ), @@ -249,12 +224,6 @@ $wgResourceModules += array( 'ext.visualEditor.base' ), 'messages' => array( - 'visualeditor-tooltip-wikitext', - 'visualeditor-tooltip-json', - 'visualeditor-tooltip-html', - 'visualeditor-tooltip-render', - 'visualeditor-tooltip-history', - 'visualeditor-tooltip-help', 'visualeditor', 'visualeditor-linkinspector-title', 'visualeditor-linkinspector-tooltip', diff --git a/demos/ve/demo.css b/demos/ve/demo.css new file mode 100644 index 0000000000..9256c1206c --- /dev/null +++ b/demos/ve/demo.css @@ -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; +} diff --git a/demos/ve/index.php b/demos/ve/index.php index dd3ac427cd..3e9f54704e 100644 --- a/demos/ve/index.php +++ b/demos/ve/index.php @@ -1,9 +1,18 @@ +' . file_get_contents( $page ) . ''; +?> - VisualEditor Demo + VisualEditor Standalone Demo @@ -14,73 +23,21 @@ - - - + + - + +
  • + + + +
  • + + +
    -include( '../../modules/sandbox/base.php' ); - -?> @@ -143,13 +100,6 @@ include( '../../modules/sandbox/base.php' ); - - @@ -197,8 +147,16 @@ include( '../../modules/sandbox/base.php' ); - - - + + + diff --git a/demos/ve/pages/complex.html b/demos/ve/pages/complex.html new file mode 100644 index 0000000000..17e96d8ec4 --- /dev/null +++ b/demos/ve/pages/complex.html @@ -0,0 +1 @@ +

    123456 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.

    What is Lorem Ipsum?

    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.

    Lorem Ipsum is simply dummy text...

    The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested.

    Nullam aliquam ligula nec metus pretium in lobortis urna pellentesque.

    Nullam nulla neque, luctus et cursus eu, sollicitudin sollicitudin massa.

    Sed consectetur nunc blandit urna pulvinar eu porttitor lorem rutrum. Maecenas vel justo id felis consectetur euismod.

    Suspendisse vulputate sagittis iaculis. Suspendisse potenti.

    Lorem ipsum is simply dummy text of the printing and typesetting industry.

    Where can I get some?

    Why do we use it?

    Tabel level 1

    Hi Hi Ho Ho

    Tabel level 2

    And list:

    • here

    • or here

    • or there

    Tabel level 3

    Ha Ha Hi Hi

    \ No newline at end of file diff --git a/demos/ve/pages/simple.html b/demos/ve/pages/simple.html new file mode 100644 index 0000000000..df75652577 --- /dev/null +++ b/demos/ve/pages/simple.html @@ -0,0 +1 @@ +

    Lorem Ipsum 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.

    What is Lorem Ipsum?

    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.

    Look at this headline

    Lorem ipsum is simply dummy text of the printing and typesetting industry.

    Where can I get some?

    Why do we use it?

    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.

    \ No newline at end of file diff --git a/modules/sandbox/base.php b/modules/sandbox/base.php deleted file mode 100644 index 17fb9e742b..0000000000 --- a/modules/sandbox/base.php +++ /dev/null @@ -1,4 +0,0 @@ - -
    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. -Dismiss
    - diff --git a/modules/sandbox/sandbox.css b/modules/sandbox/sandbox.css deleted file mode 100644 index 7af8d6ee7b..0000000000 --- a/modules/sandbox/sandbox.css +++ /dev/null @@ -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; -} diff --git a/modules/sandbox/sandbox.js b/modules/sandbox/sandbox.js deleted file mode 100644 index cf8d2f397a..0000000000 --- a/modules/sandbox/sandbox.js +++ /dev/null @@ -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( - $( '
    ' ).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 = $( - '
    ' + - '

    123456 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.

    ' + - '

    What is Lorem Ipsum?

    ' + - '

    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.

    ' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '' + - '

    Lorem Ipsum is simply dummy text...

    The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested.

    Nullam aliquam ligula nec metus pretium in lobortis urna pellentesque.

    Nullam nulla neque, luctus et cursus eu, sollicitudin sollicitudin massa.

    Sed consectetur nunc blandit urna pulvinar eu porttitor lorem rutrum. Maecenas vel justo id felis consectetur euismod.

    Suspendisse vulputate sagittis iaculis. Suspendisse potenti.

    ' + - '

    Lorem ipsum is simply dummy text of the printing and typesetting industry.

    ' + - '

    Where can I get some?

    ' + - '' + - '' + - '

    Why do we use it?

    ' + - '' + - '' + - '' + - '' + - '
    ' + - '

    Tabel level 1

    ' + - '

    Hi Hi Ho Ho

    ' + - '' + - '' + - '' + - '' + - '
    ' + - '

    Tabel level 2

    ' + - '

    And list:

    ' + - '
      ' + - '
    • here

    • ' + - '
    • or here

    • ' + - '
    • or there

    • ' + - '
    ' + - '' + - '' + - '' + - '' + - '
    ' + - '

    Tabel level 3

    ' + - '

    Ha Ha Hi Hi

    ' + - '
    ' + - '
    ' + - '
    ' + - '
    ' ); - - // HTML without images and aliens - HTML = $( - '
    ' + - '

    Lorem Ipsum 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.

    ' + - '

    What is Lorem Ipsum?

    ' + - '

    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.

    ' + - '

    Look at this headline

    ' + - - '

    Lorem ipsum is simply dummy text of the printing and typesetting industry.

    ' + - '

    Where can I get some?

    ' + - '' + - '

    Why do we use it?

    ' + - '

    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.

    ' + - '
    ' ); - - - /* 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(); -} ); diff --git a/modules/sandbox/special.js b/modules/sandbox/special.js deleted file mode 100644 index 1c09151601..0000000000 --- a/modules/sandbox/special.js +++ /dev/null @@ -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 = $( '' ) - .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( - $( '
    ' ).css( { 'float': 'right' } ).append( $feedbackLink ) - ); - } - -} )( jQuery, window.mediaWiki ); diff --git a/modules/ve/ui/styles/ve.ui.Surface.css b/modules/ve/ui/styles/ve.ui.Surface.css index 62b3720be1..60b6526783 100644 --- a/modules/ve/ui/styles/ve.ui.Surface.css +++ b/modules/ve/ui/styles/ve.ui.Surface.css @@ -250,31 +250,3 @@ .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; -}