mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-09-26 19:56:49 +00:00
Cleanup Sanxbox.js
Change-Id: Id8ba1aacecdbb5d31888e289d23ab03a16346c60
This commit is contained in:
parent
95e06e96bf
commit
0b9411c531
|
@ -1,9 +1,4 @@
|
||||||
<!-- VisualEditor Sandbox -->
|
<!-- 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.
|
<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>
|
<a href="#" id="es-warning-dismiss">Dismiss</a></div>
|
||||||
<div id="es-docs" style="visibility: hidden">
|
|
||||||
|
|
||||||
<div id="es-docs-label">Example documents:</div>
|
|
||||||
<ul id="es-docs-list" ></ul>
|
|
||||||
</div>
|
|
||||||
<!-- /VisualEditor Sandbox -->
|
<!-- /VisualEditor Sandbox -->
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
$(document).ready( function() {
|
$(document).ready( function() {
|
||||||
var wikidoms = {
|
/* var wikidoms = {
|
||||||
'Wikipedia article': {
|
'Wikipedia article': {
|
||||||
'type': 'document',
|
'type': 'document',
|
||||||
'children': [
|
'children': [
|
||||||
|
@ -408,7 +408,7 @@ $(document).ready( function() {
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
}, */
|
||||||
/*
|
/*
|
||||||
'Tables': {
|
'Tables': {
|
||||||
'type': 'document',
|
'type': 'document',
|
||||||
|
@ -492,7 +492,7 @@ $(document).ready( function() {
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},*/
|
},*/
|
||||||
'New document': {
|
/* 'New document': {
|
||||||
'type': 'document',
|
'type': 'document',
|
||||||
'children': [
|
'children': [
|
||||||
{
|
{
|
||||||
|
@ -501,7 +501,7 @@ $(document).ready( function() {
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
};
|
}; */
|
||||||
|
|
||||||
/* Sandbox integration hack. Allows both MW integration and demo pages to work */
|
/* Sandbox integration hack. Allows both MW integration and demo pages to work */
|
||||||
if ( $('#content').length === 0 ) {
|
if ( $('#content').length === 0 ) {
|
||||||
|
@ -590,36 +590,6 @@ $(document).ready( function() {
|
||||||
documentModel = sandboxEditor.getDocumentModel(),
|
documentModel = sandboxEditor.getDocumentModel(),
|
||||||
parent = sandboxEditor.getParent();
|
parent = sandboxEditor.getParent();
|
||||||
|
|
||||||
/* Sandbox links above the editor */
|
|
||||||
var $docsList = $( '#es-docs-list' );
|
|
||||||
$.each( wikidoms, function( title, wikidom ) {
|
|
||||||
$docsList.append(
|
|
||||||
$( '<li class="es-docs-listItem"></li>' )
|
|
||||||
.append(
|
|
||||||
$( '<a href="#"></a>' )
|
|
||||||
.text( title )
|
|
||||||
.click( function() {
|
|
||||||
var newDocumentModel = new ve.dm.Document( [{ 'type': 'paragraph' }, '', { 'type': '/paragraph' }] );
|
|
||||||
documentModel.data.splice( 0, documentModel.data.length );
|
|
||||||
ve.insertIntoArray( documentModel.data, 0, newDocumentModel.data );
|
|
||||||
surfaceModel.select( new ve.Range( 1, 1 ) );
|
|
||||||
// FIXME: this should be using ve.batchedSplice(), otherwise things
|
|
||||||
// could explode if newDocumentModel.getChildren() is very long
|
|
||||||
documentModel.splice.apply(
|
|
||||||
documentModel,
|
|
||||||
[0, documentModel.getChildren().length]
|
|
||||||
.concat( newDocumentModel.getChildren() )
|
|
||||||
);
|
|
||||||
surfaceModel.purgeHistory();
|
|
||||||
|
|
||||||
if ( sandboxEditor.currentMode ) {
|
|
||||||
sandboxEditor.currentMode.update.call( sandboxEditor.currentMode );
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
} )
|
|
||||||
)
|
|
||||||
);
|
|
||||||
} );
|
|
||||||
|
|
||||||
/* Sandbox Warning Message */
|
/* Sandbox Warning Message */
|
||||||
$( '#es-docs' ).css( { 'visibility': 'visible' } );
|
$( '#es-docs' ).css( { 'visibility': 'visible' } );
|
||||||
|
@ -630,5 +600,5 @@ $(document).ready( function() {
|
||||||
$(this).parent().slideUp();
|
$(this).parent().slideUp();
|
||||||
return false;
|
return false;
|
||||||
} );
|
} );
|
||||||
$( '.es-mode-wikitext' ).click();
|
//$( '.es-mode-wikitext' ).click();
|
||||||
} );
|
} );
|
||||||
|
|
|
@ -13,7 +13,6 @@ ve.ui.Context = function( surfaceView, $overlay ) {
|
||||||
|
|
||||||
// Properties
|
// Properties
|
||||||
this.surfaceView = surfaceView;
|
this.surfaceView = surfaceView;
|
||||||
//this.surfaceView.attachContextView( this );
|
|
||||||
this.inspectors = {};
|
this.inspectors = {};
|
||||||
this.inspector = null;
|
this.inspector = null;
|
||||||
this.position = null;
|
this.position = null;
|
||||||
|
|
Loading…
Reference in a new issue