2012-04-17 02:38:13 +00:00
|
|
|
/**
|
|
|
|
* Creates an ve.Surface object.
|
2012-05-03 20:23:21 +00:00
|
|
|
*
|
2012-04-17 02:38:13 +00:00
|
|
|
* A surface is a top-level object which contains both a surface model and a surface view.
|
2012-05-03 20:23:21 +00:00
|
|
|
*
|
2012-04-17 02:38:13 +00:00
|
|
|
* @class
|
|
|
|
* @constructor
|
2012-05-03 20:23:21 +00:00
|
|
|
* @param {String} parent Selector of element to attach to
|
2012-06-08 19:40:43 +00:00
|
|
|
* @param {HTMLElement} html Document html
|
2012-04-17 02:38:13 +00:00
|
|
|
* @param {Object} options Configuration options
|
|
|
|
*/
|
2012-06-08 19:40:43 +00:00
|
|
|
ve.Surface = function( parent, dom, options ) {
|
2012-05-21 23:06:30 +00:00
|
|
|
// Create linear model from HTML5 DOM
|
2012-06-08 19:40:43 +00:00
|
|
|
var data = ve.dm.converter.getDataFromDom( dom );
|
2012-04-17 02:38:13 +00:00
|
|
|
// Properties
|
2012-05-03 20:23:21 +00:00
|
|
|
this.parent = parent;
|
|
|
|
this.modes = {};
|
|
|
|
this.currentMode = null;
|
|
|
|
/* Extend VE configuration recursively */
|
|
|
|
this.options = ve.extendObject( true, {
|
2012-04-17 02:38:13 +00:00
|
|
|
// Default options
|
2012-05-03 20:23:21 +00:00
|
|
|
toolbars: {
|
|
|
|
top: {
|
|
|
|
tools: [{ 'name': 'history', 'items' : ['undo', 'redo'] },
|
|
|
|
{ 'name': 'textStyle', 'items' : ['format'] },
|
|
|
|
{ 'name': 'textStyle', 'items' : ['bold', 'italic', 'link', 'clear'] },
|
|
|
|
{ 'name': 'list', 'items' : ['number', 'bullet', 'outdent', 'indent'] }]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
//TODO: i18n
|
|
|
|
modes: {
|
|
|
|
wikitext: 'Toggle wikitext view',
|
|
|
|
json: 'Toggle JSON view',
|
|
|
|
html: 'Toggle HTML view',
|
|
|
|
render: 'Toggle preview',
|
|
|
|
history: 'Toggle transaction history view',
|
|
|
|
help: 'Toggle help view'
|
|
|
|
}
|
|
|
|
|
|
|
|
}, options );
|
|
|
|
|
|
|
|
// A place to store element references
|
|
|
|
this.$base = null;
|
|
|
|
this.$surface = null;
|
|
|
|
this.toolbarWrapper = {};
|
2012-05-17 03:25:43 +00:00
|
|
|
|
2012-05-03 20:23:21 +00:00
|
|
|
/* Create document model object with the linear model */
|
2012-05-03 20:32:23 +00:00
|
|
|
this.documentModel = new ve.dm.Document ( data );
|
2012-06-12 17:31:34 +00:00
|
|
|
this.model = new ve.dm.Surface( this.documentModel );
|
2012-04-17 02:38:13 +00:00
|
|
|
|
2012-05-03 20:23:21 +00:00
|
|
|
// Setup VE DOM Skeleton
|
|
|
|
this.setupBaseElements();
|
|
|
|
|
2012-06-12 17:31:34 +00:00
|
|
|
this.$surface = $( '<div></div>' ).attr( 'class', 'es-editor' );
|
|
|
|
this.$base.find( '.es-visual' ).append( this.$surface );
|
2012-05-03 21:02:35 +00:00
|
|
|
|
|
|
|
/* Instantiate surface layer */
|
2012-06-12 17:31:34 +00:00
|
|
|
this.view = new ve.ce.Surface( $( '.es-editor' ), this.model );
|
2012-05-03 20:23:21 +00:00
|
|
|
|
|
|
|
// Setup toolbars based on this.options
|
2012-05-03 23:02:21 +00:00
|
|
|
this.setupToolbars();
|
2012-05-03 20:23:21 +00:00
|
|
|
|
|
|
|
// Setup various toolbar modes and panels
|
2012-05-03 21:02:35 +00:00
|
|
|
//this.setupModes();
|
2012-05-03 20:23:21 +00:00
|
|
|
|
2012-04-17 02:38:13 +00:00
|
|
|
// Registration
|
|
|
|
ve.instances.push( this );
|
2012-05-03 20:23:21 +00:00
|
|
|
};
|
|
|
|
|
2012-06-12 17:31:34 +00:00
|
|
|
/* Methods */
|
|
|
|
|
|
|
|
ve.Surface.prototype.getModel = function() {
|
|
|
|
return this.model;
|
|
|
|
};
|
|
|
|
|
|
|
|
ve.Surface.prototype.getDocumentModel = function() {
|
|
|
|
return this.documentModel;
|
|
|
|
};
|
|
|
|
|
|
|
|
ve.Surface.prototype.getView = function() {
|
|
|
|
return this.view;
|
|
|
|
};
|
|
|
|
|
|
|
|
ve.Surface.prototype.getContext = function() {
|
|
|
|
return this.context;
|
|
|
|
};
|
|
|
|
|
|
|
|
ve.Surface.prototype.getParent = function() {
|
|
|
|
return this.parent;
|
|
|
|
};
|
2012-05-03 20:23:21 +00:00
|
|
|
|
|
|
|
ve.Surface.prototype.setupBaseElements = function() {
|
|
|
|
// Make new base element
|
2012-06-12 17:31:34 +00:00
|
|
|
this.$base = $( '<div></div>' )
|
|
|
|
.attr( 'class', 'es-base' )
|
|
|
|
.append(
|
|
|
|
$( '<div></div>' ).attr( 'class', 'es-panes' )
|
|
|
|
.append( $( '<div></div>' ).attr( 'class', 'es-visual' ) )
|
|
|
|
.append( $( '<div></div>' ).attr( 'class', 'es-panels' ) )
|
|
|
|
.append( $( '<div></div>' ).attr( 'style', 'clear:both' ) )
|
|
|
|
)
|
|
|
|
.append(
|
|
|
|
$( '<div></div>' ).attr( {
|
|
|
|
// TODO: make 'paste' in surface stateful and remove this attrib
|
|
|
|
'id': 'paste',
|
|
|
|
'class': 'paste',
|
|
|
|
'contenteditable': 'true'
|
|
|
|
} )
|
|
|
|
);
|
2012-05-03 20:23:21 +00:00
|
|
|
// Attach the base the the parent
|
|
|
|
$( this.getParent() ).append( this.$base );
|
|
|
|
};
|
|
|
|
|
|
|
|
ve.Surface.prototype.setupToolbars = function() {
|
|
|
|
var _this = this;
|
|
|
|
|
|
|
|
// Build each toolbar
|
2012-06-12 17:31:34 +00:00
|
|
|
$.each( this.options.toolbars, function( name, config ) {
|
2012-05-03 20:23:21 +00:00
|
|
|
if ( config !== null ) {
|
2012-06-12 17:31:34 +00:00
|
|
|
if( name === 'top' ) {
|
2012-05-03 20:23:21 +00:00
|
|
|
// Append toolbar wrapper at the top, just above .es-panes
|
2012-06-12 17:31:34 +00:00
|
|
|
_this.toolbarWrapper[name] = $( '<div></div>' )
|
|
|
|
.attr( 'class', 'es-toolbar-wrapper' )
|
2012-05-03 20:23:21 +00:00
|
|
|
.append(
|
2012-06-12 17:31:34 +00:00
|
|
|
$( '<div></div>' ).attr( 'class', 'es-toolbar' )
|
2012-05-03 20:23:21 +00:00
|
|
|
.append(
|
2012-06-12 17:31:34 +00:00
|
|
|
$( '<div></div>' ).attr( 'class', 'es-modes' )
|
2012-05-03 20:23:21 +00:00
|
|
|
).append(
|
2012-06-12 17:31:34 +00:00
|
|
|
$( '<div></div>' ).attr( 'style', 'clear:both' )
|
2012-05-03 20:23:21 +00:00
|
|
|
).append(
|
2012-06-12 17:31:34 +00:00
|
|
|
$( '<div></div>' ).attr( 'class', 'es-toolbar-shadow' )
|
2012-05-03 20:23:21 +00:00
|
|
|
)
|
|
|
|
);
|
|
|
|
|
2012-06-12 17:31:34 +00:00
|
|
|
_this.$base.find( '.es-panes' ).before( _this.toolbarWrapper[name] );
|
2012-05-03 20:23:21 +00:00
|
|
|
}
|
|
|
|
// Instantiate the toolbar
|
2012-06-12 17:31:34 +00:00
|
|
|
_this['toolbar-' + name] = new ve.ui.Toolbar(
|
|
|
|
_this.$base.find( '.es-toolbar' ), _this.view, config.tools
|
|
|
|
);
|
2012-05-03 20:23:21 +00:00
|
|
|
}
|
2012-06-12 17:31:34 +00:00
|
|
|
} );
|
2012-05-03 20:23:21 +00:00
|
|
|
|
|
|
|
// Setup sticky toolbar
|
|
|
|
this.makeMainEditorToolbarFloat();
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
2012-06-12 17:31:34 +00:00
|
|
|
* This code is responsible for switching toolbar into floating mode when scrolling ( with
|
|
|
|
* keyboard or mouse ).
|
2012-05-03 20:23:21 +00:00
|
|
|
* TODO: Determine if this would be better in ui.toolbar vs here.
|
|
|
|
* TODO: This needs to be refactored so that it only works on the main editor top tool bar.
|
|
|
|
*/
|
|
|
|
ve.Surface.prototype.makeMainEditorToolbarFloat = function() {
|
|
|
|
if ( !this.toolbarWrapper.top ) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
var $toolbarWrapper = this.toolbarWrapper.top,
|
2012-06-12 17:31:34 +00:00
|
|
|
$toolbar = $toolbarWrapper.find( '.es-toolbar' );
|
2012-05-03 20:23:21 +00:00
|
|
|
$window = $( window );
|
|
|
|
|
|
|
|
$window.scroll( function() {
|
|
|
|
var toolbarWrapperOffset = $toolbarWrapper.offset();
|
|
|
|
if ( $window.scrollTop() > toolbarWrapperOffset.top ) {
|
|
|
|
if ( !$toolbarWrapper.hasClass( 'float' ) ) {
|
|
|
|
var left = toolbarWrapperOffset.left,
|
|
|
|
right = $window.width() - $toolbarWrapper.outerWidth() - left;
|
|
|
|
$toolbarWrapper.css( 'height', $toolbarWrapper.height() ).addClass( 'float' );
|
|
|
|
$toolbar.css( { 'left': left, 'right': right } );
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if ( $toolbarWrapper.hasClass( 'float' ) ) {
|
|
|
|
$toolbarWrapper.css( 'height', 'auto' ).removeClass( 'float' );
|
|
|
|
$toolbar.css( { 'left': 0, 'right': 0 } );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} );
|
|
|
|
};
|
|
|
|
|
|
|
|
ve.Surface.prototype.setupModes = function(){
|
|
|
|
var _this = this;
|
|
|
|
var activeModes = [];
|
|
|
|
|
|
|
|
// Loop through toolbar config to build modes
|
2012-06-12 17:31:34 +00:00
|
|
|
$.each( _this.options.toolbars, function( name, toolbar ){
|
2012-05-03 20:23:21 +00:00
|
|
|
//if toolbar has modes
|
|
|
|
if( toolbar.modes && toolbar.modes.length > 0 ) {
|
2012-06-12 17:31:34 +00:00
|
|
|
for( var i=0;i<=toolbar.modes.length -1;i++ ) {
|
2012-05-03 20:23:21 +00:00
|
|
|
$( _this.toolbarWrapper[name] )
|
2012-06-12 17:31:34 +00:00
|
|
|
.find( '.es-modes' )
|
2012-05-03 20:23:21 +00:00
|
|
|
.append(
|
2012-06-12 17:31:34 +00:00
|
|
|
$( '<div></div>' ).attr( {
|
2012-05-03 20:23:21 +00:00
|
|
|
'class': 'es-modes-button es-mode-' + toolbar.modes[i],
|
|
|
|
'title': _this.options.modes[toolbar.modes[i]]
|
2012-06-12 17:31:34 +00:00
|
|
|
} )
|
2012-05-03 20:23:21 +00:00
|
|
|
);
|
|
|
|
if( !activeModes[mode] ) {
|
|
|
|
activeModes.push( toolbar.modes[i] );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2012-06-12 17:31:34 +00:00
|
|
|
} );
|
2012-05-03 20:23:21 +00:00
|
|
|
|
|
|
|
// Build elements in #es-panels for each activeMode
|
|
|
|
if ( activeModes.length > 0 ) {
|
2012-06-12 17:31:34 +00:00
|
|
|
for ( var mode in activeModes ) {
|
2012-05-03 20:23:21 +00:00
|
|
|
var renderType = '';
|
|
|
|
switch( activeModes[mode] ) {
|
|
|
|
case 'render':
|
|
|
|
renderType = 'es-render';
|
|
|
|
break;
|
|
|
|
case 'help':
|
|
|
|
renderType = '';
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
renderType = 'es-code';
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
_this.$base
|
2012-06-12 17:31:34 +00:00
|
|
|
.find( '.es-panels' )
|
2012-05-03 20:23:21 +00:00
|
|
|
.append(
|
2012-06-12 17:31:34 +00:00
|
|
|
$( '<div></div>' ).attr(
|
|
|
|
'class', 'es-panel es-panel-' + activeModes[mode] + ' ' + renderType
|
|
|
|
)
|
2012-05-03 20:23:21 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/*
|
|
|
|
Define this.modes
|
|
|
|
Called after bulding elements.
|
|
|
|
*/
|
|
|
|
this.defineModes();
|
|
|
|
|
|
|
|
//Bind Mode events
|
|
|
|
$.each( this.modes, function( name, mode ) {
|
|
|
|
mode.$.click( function() {
|
2012-06-12 17:31:34 +00:00
|
|
|
var disable = $( this ).hasClass( 'es-modes-button-down' );
|
2012-05-03 20:23:21 +00:00
|
|
|
var visible = _this.$base.hasClass( 'es-showData' );
|
2012-06-12 17:31:34 +00:00
|
|
|
$( '.es-modes-button' ).removeClass( 'es-modes-button-down' );
|
|
|
|
$( '.es-panel' ).hide();
|
2012-05-03 20:23:21 +00:00
|
|
|
if ( disable ) {
|
|
|
|
if ( visible ) {
|
|
|
|
_this.$base.removeClass( 'es-showData' );
|
|
|
|
$( window ).resize();
|
|
|
|
}
|
|
|
|
_this.currentMode = null;
|
|
|
|
} else {
|
2012-06-12 17:31:34 +00:00
|
|
|
$( this ).addClass( 'es-modes-button-down' );
|
2012-05-03 20:23:21 +00:00
|
|
|
mode.$panel.show();
|
|
|
|
if ( !visible ) {
|
|
|
|
_this.$base.addClass( 'es-showData' );
|
|
|
|
$( window ).resize();
|
|
|
|
}
|
|
|
|
mode.update.call( mode );
|
|
|
|
_this.currentMode = mode;
|
|
|
|
}
|
|
|
|
} );
|
|
|
|
} );
|
|
|
|
|
|
|
|
/* Bind some surface events for modes */
|
2012-06-12 17:31:34 +00:00
|
|
|
this.model.on( 'transact', function() {
|
2012-05-03 20:23:21 +00:00
|
|
|
if ( _this.currentMode ) {
|
|
|
|
_this.currentMode.update.call( _this.currentMode );
|
|
|
|
}
|
|
|
|
} );
|
2012-06-12 17:31:34 +00:00
|
|
|
this.model.on( 'select', function() {
|
2012-05-03 20:23:21 +00:00
|
|
|
if ( _this.currentMode === _this.modes.history ) {
|
|
|
|
_this.currentMode.update.call( _this.currentMode );
|
|
|
|
}
|
|
|
|
} );
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
Define modes
|
|
|
|
TODO: possibly extend this object via the config
|
|
|
|
*/
|
|
|
|
ve.Surface.prototype.defineModes = function() {
|
|
|
|
var _this = this;
|
|
|
|
this.modes = {
|
|
|
|
'wikitext': {
|
|
|
|
'$': _this.$base.find( '.es-mode-wikitext' ),
|
|
|
|
'$panel': _this.$base.find( '.es-panel-wikitext' ),
|
|
|
|
'update': function() {
|
|
|
|
this.$panel.text(
|
|
|
|
ve.dm.WikitextSerializer.stringify( _this.getDocumentModel().getPlainObject() )
|
|
|
|
);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
'json': {
|
|
|
|
'$': _this.$base.find( '.es-mode-json' ),
|
|
|
|
'$panel': _this.$base.find( '.es-panel-json' ),
|
|
|
|
'update': function() {
|
|
|
|
this.$panel.text( ve.dm.JsonSerializer.stringify( _this.getDocumentModel().getPlainObject(), {
|
|
|
|
'indentWith': ' '
|
|
|
|
} ) );
|
|
|
|
}
|
|
|
|
},
|
|
|
|
'html': {
|
|
|
|
'$': _this.$base.find( '.es-mode-html' ),
|
|
|
|
'$panel': _this.$base.find( '.es-panel-html' ),
|
|
|
|
'update': function() {
|
|
|
|
this.$panel.text(
|
|
|
|
ve.dm.HtmlSerializer.stringify( _this.getDocumentModel().getPlainObject() )
|
|
|
|
);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
'render': {
|
|
|
|
'$': _this.$base.find( '.es-mode-render' ),
|
|
|
|
'$panel': _this.$base.find( '.es-panel-render' ),
|
|
|
|
'update': function() {
|
|
|
|
this.$panel.html(
|
|
|
|
ve.dm.HtmlSerializer.stringify( _this.getDocumentModel().getPlainObject() )
|
|
|
|
);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
'history': {
|
|
|
|
'$': _this.$base.find( '.es-mode-history' ),
|
|
|
|
'$panel': _this.$base.find( '.es-panel-history' ),
|
|
|
|
'update': function() {
|
2012-06-12 17:31:34 +00:00
|
|
|
var history = _this.model.getHistory(),
|
2012-05-03 20:23:21 +00:00
|
|
|
i = history.length,
|
|
|
|
end = Math.max( 0, i - 25 ),
|
|
|
|
j,
|
|
|
|
k,
|
|
|
|
ops,
|
|
|
|
events = '',
|
|
|
|
z = 0,
|
|
|
|
operations,
|
|
|
|
data;
|
|
|
|
|
|
|
|
while ( --i >= end ) {
|
|
|
|
z++;
|
|
|
|
operations = [];
|
2012-06-12 17:31:34 +00:00
|
|
|
for ( j = 0; j < history[i].stack.length; j++ ) {
|
|
|
|
ops = history[i].stack[j].getOperations().slice( 0 );
|
2012-05-03 20:23:21 +00:00
|
|
|
for ( k = 0; k < ops.length; k++ ) {
|
|
|
|
data = ops[k].data || ops[k].length;
|
|
|
|
if ( ve.isArray( data ) ) {
|
|
|
|
data = data[0];
|
|
|
|
if ( ve.isArray( data ) ) {
|
|
|
|
data = data[0];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ( typeof data !== 'string' && typeof data !== 'number' ) {
|
|
|
|
data = '-';
|
|
|
|
}
|
2012-06-12 17:31:34 +00:00
|
|
|
ops[k] = ops[k].type.substr( 0, 3 ) + '( ' + data + ' )';
|
2012-05-03 20:23:21 +00:00
|
|
|
}
|
2012-06-12 17:31:34 +00:00
|
|
|
operations.push( '[' + ops.join( ', ' ) + ']' );
|
2012-05-03 20:23:21 +00:00
|
|
|
}
|
2012-06-12 17:31:34 +00:00
|
|
|
events += '<div' + ( z === _this.model.undoIndex ? ' class="es-panel-history-active"' : '' ) + '>' + operations.join( ', ' ) + '</div>';
|
2012-05-03 20:23:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
this.$panel.html( events );
|
|
|
|
}
|
|
|
|
},
|
|
|
|
'help': {
|
|
|
|
'$': _this.$base.find( '.es-mode-help' ),
|
|
|
|
'$panel': _this.$base.find( '.es-panel-help' ),
|
|
|
|
'update': function() {
|
|
|
|
//TODO: Make this less ugly,
|
|
|
|
//HOW?: Create api to register help items so that they may be generated here.
|
|
|
|
/*jshint multistr:true */
|
2012-06-12 17:31:34 +00:00
|
|
|
this.$panel.html( '\
|
2012-05-03 20:23:21 +00:00
|
|
|
<div class="es-help-title">Keyboard Shortcuts</div>\
|
|
|
|
<div class="es-help-shortcuts-title">Clipboard</div>\
|
|
|
|
<div class="es-help-shortcut">\
|
|
|
|
<span class="es-help-keys">\
|
|
|
|
<span class="es-help-key">Ctrl <span class="es-help-key-or">or</span> ⌘</span> +\
|
|
|
|
<span class="es-help-key">C</span>\
|
|
|
|
</span>\
|
|
|
|
Copy selected text\
|
|
|
|
</div>\
|
|
|
|
<div class="es-help-shortcut">\
|
|
|
|
<span class="es-help-keys">\
|
|
|
|
<span class="es-help-key">Ctrl <span class="es-help-key-or">or</span> ⌘</span> +\
|
|
|
|
<span class="es-help-key">X</span>\
|
|
|
|
</span>\
|
|
|
|
Cut selected text\
|
|
|
|
</div>\
|
|
|
|
<div class="es-help-shortcut">\
|
|
|
|
<span class="es-help-keys">\
|
|
|
|
<span class="es-help-key">Ctrl <span class="es-help-key-or">or</span> ⌘</span> +\
|
|
|
|
<span class="es-help-key">V</span>\
|
|
|
|
</span>\
|
|
|
|
Paste text at the cursor\
|
|
|
|
</div>\
|
|
|
|
<div class="es-help-shortcuts-title">History navigation</div>\
|
|
|
|
<div class="es-help-shortcut">\
|
|
|
|
<span class="es-help-keys">\
|
|
|
|
<span class="es-help-key">Ctrl <span class="es-help-key-or">or</span> ⌘</span> +\
|
|
|
|
<span class="es-help-key">Z</span>\
|
|
|
|
</span>\
|
|
|
|
Undo\
|
|
|
|
</div>\
|
|
|
|
<div class="es-help-shortcut">\
|
|
|
|
<span class="es-help-keys">\
|
|
|
|
<span class="es-help-key">Ctrl <span class="es-help-key-or">or</span> ⌘</span> +\
|
|
|
|
<span class="es-help-key">Y</span>\
|
|
|
|
</span>\
|
|
|
|
Redo\
|
|
|
|
</div>\
|
|
|
|
<div class="es-help-shortcut">\
|
|
|
|
<span class="es-help-keys">\
|
|
|
|
<span class="es-help-key">Ctrl <span class="es-help-key-or">or</span> ⌘</span> +\
|
|
|
|
<span class="es-help-key">⇧</span> +\
|
|
|
|
<span class="es-help-key">Z</span>\
|
|
|
|
</span>\
|
|
|
|
Redo\
|
|
|
|
</div>\
|
|
|
|
<div class="es-help-shortcuts-title">Formatting</div>\
|
|
|
|
<div class="es-help-shortcut">\
|
|
|
|
<span class="es-help-keys">\
|
|
|
|
<span class="es-help-key">Ctrl <span class="es-help-key-or">or</span> ⌘</span> +\
|
|
|
|
<span class="es-help-key">B</span>\
|
|
|
|
</span>\
|
|
|
|
Make selected text bold\
|
|
|
|
</div>\
|
|
|
|
<div class="es-help-shortcut">\
|
|
|
|
<span class="es-help-keys">\
|
|
|
|
<span class="es-help-key">Ctrl <span class="es-help-key-or">or</span> ⌘</span> +\
|
|
|
|
<span class="es-help-key">I</span>\
|
|
|
|
</span>\
|
|
|
|
Make selected text italic\
|
|
|
|
</div>\
|
|
|
|
<div class="es-help-shortcut">\
|
|
|
|
<span class="es-help-keys">\
|
|
|
|
<span class="es-help-key">Ctrl <span class="es-help-key-or">or</span> ⌘</span> +\
|
|
|
|
<span class="es-help-key">K</span>\
|
|
|
|
</span>\
|
|
|
|
Make selected text a link\
|
|
|
|
</div>\
|
|
|
|
<div class="es-help-shortcuts-title">Selection</div>\
|
|
|
|
<div class="es-help-shortcut">\
|
|
|
|
<span class="es-help-keys">\
|
|
|
|
<span class="es-help-key">⇧</span> +\
|
|
|
|
<span class="es-help-key">Arrow</span>\
|
|
|
|
</span>\
|
|
|
|
Adjust selection\
|
|
|
|
</div>\
|
|
|
|
<div class="es-help-shortcut">\
|
|
|
|
<span class="es-help-keys">\
|
|
|
|
<span class="es-help-key">Ctrl <span class="es-help-key-or">or</span> ⌥</span> +\
|
|
|
|
<span class="es-help-key">Arrow</span>\
|
|
|
|
</span>\
|
|
|
|
Move cursor by words or blocks\
|
|
|
|
</div>\
|
|
|
|
<div class="es-help-shortcut">\
|
|
|
|
<span class="es-help-keys">\
|
|
|
|
<span class="es-help-key">Ctrl <span class="es-help-key-or">or</span> ⌥</span> +\
|
|
|
|
<span class="es-help-key">⇧</span> +\
|
|
|
|
<span class="es-help-key">Arrow</span>\
|
|
|
|
</span>\
|
|
|
|
Adjust selection by words or blocks\
|
2012-06-12 17:31:34 +00:00
|
|
|
</div>' );
|
2012-05-03 20:23:21 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
2012-04-17 02:38:13 +00:00
|
|
|
};
|