2013-04-25 00:47:17 +00:00
|
|
|
/*!
|
|
|
|
* VisualEditor ContentEditable MWBlockImageNode class.
|
|
|
|
*
|
2014-01-05 12:05:05 +00:00
|
|
|
* @copyright 2011-2014 VisualEditor Team and others; see AUTHORS.txt
|
2013-04-25 00:47:17 +00:00
|
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* ContentEditable MediaWiki image node.
|
|
|
|
*
|
|
|
|
* @class
|
|
|
|
* @extends ve.ce.BranchNode
|
2013-10-15 12:18:11 +00:00
|
|
|
* @mixins ve.ce.MWImageNode
|
2013-05-15 17:01:19 +00:00
|
|
|
*
|
2013-04-25 00:47:17 +00:00
|
|
|
* @constructor
|
|
|
|
* @param {ve.dm.MWBlockImageNode} model Model to observe
|
2013-09-25 10:21:09 +00:00
|
|
|
* @param {Object} [config] Configuration options
|
2013-04-25 00:47:17 +00:00
|
|
|
*/
|
ve.Element refactor
Objectives:
* Move ve.ui.Element to ve.Element
* Make CE nodes inherit from ve.Element
Changes:
ve.ui.Element.js, ve.Element.js
* Move and rename
* Move ve.ui.get$$ to ve.Element.static.get$$
* Add static getDocument and getWindow methods
* Add instance getElementDocument and getElementWindow methods
* Add getTagName method, which by default reads the static tagName property, but when overridden can return a tag name based on other factors
*.php
* Updated file link
ve.ce.*Annotation.js, ve.ce.*Node.js, ve.ce.View.js, ve.ce.Document
* Added config options pass through
* Replaced passing elements through constructor with defining static tag names
* Added getTagName overrides where needed that derive tag name from model
* Refactore dom wrapper methods, now consistently using getTagName
ve.ce.Surface.js
* Removed static initialization (not needed)
ve.dm.Model.js, ve.ui.Window.js
* Added missing docs
ve.ui.GroupElement.js, ve.ui.Layout.js, ve.ui.Widget.js,
* Updated class name for elements
ve.ui.Frame.js, ve.ui.LookupInputWidget.js
* Updated location of get$$
ve.ui.js
* Move get$$ to ve.Element
ve.js
* Add auto-init of static properties to mixinClass
Change-Id: I39ae14966456903728e4d9e53f806ddce9ca2b70
2013-05-13 20:52:59 +00:00
|
|
|
ve.ce.MWBlockImageNode = function VeCeMWBlockImageNode( model, config ) {
|
2013-12-18 21:22:41 +00:00
|
|
|
var type, align;
|
2013-05-17 19:40:12 +00:00
|
|
|
|
2013-04-25 00:47:17 +00:00
|
|
|
// Parent constructor
|
ve.Element refactor
Objectives:
* Move ve.ui.Element to ve.Element
* Make CE nodes inherit from ve.Element
Changes:
ve.ui.Element.js, ve.Element.js
* Move and rename
* Move ve.ui.get$$ to ve.Element.static.get$$
* Add static getDocument and getWindow methods
* Add instance getElementDocument and getElementWindow methods
* Add getTagName method, which by default reads the static tagName property, but when overridden can return a tag name based on other factors
*.php
* Updated file link
ve.ce.*Annotation.js, ve.ce.*Node.js, ve.ce.View.js, ve.ce.Document
* Added config options pass through
* Replaced passing elements through constructor with defining static tag names
* Added getTagName overrides where needed that derive tag name from model
* Refactore dom wrapper methods, now consistently using getTagName
ve.ce.Surface.js
* Removed static initialization (not needed)
ve.dm.Model.js, ve.ui.Window.js
* Added missing docs
ve.ui.GroupElement.js, ve.ui.Layout.js, ve.ui.Widget.js,
* Updated class name for elements
ve.ui.Frame.js, ve.ui.LookupInputWidget.js
* Updated location of get$$
ve.ui.js
* Move get$$ to ve.Element
ve.js
* Add auto-init of static properties to mixinClass
Change-Id: I39ae14966456903728e4d9e53f806ddce9ca2b70
2013-05-13 20:52:59 +00:00
|
|
|
ve.ce.BranchNode.call( this, model, config );
|
2013-04-25 00:47:17 +00:00
|
|
|
|
2013-12-18 21:22:41 +00:00
|
|
|
type = this.model.getAttribute( 'type' );
|
|
|
|
align = this.model.getAttribute( 'align' );
|
2013-06-19 22:58:13 +00:00
|
|
|
|
2013-11-01 06:13:09 +00:00
|
|
|
// Properties
|
2013-12-18 21:22:41 +00:00
|
|
|
this.captionVisible = false;
|
2013-11-01 06:13:09 +00:00
|
|
|
this.typeToRdfa = this.getTypeToRdfa();
|
2013-05-14 23:39:13 +00:00
|
|
|
|
2013-11-01 06:13:09 +00:00
|
|
|
// DOM Hierarchy for BlockImageNode:
|
|
|
|
// <div> this.$element
|
2014-02-25 23:55:33 +00:00
|
|
|
// <figure> this.$figure (ve-ce-mwBlockImageNode-{type})
|
2013-12-18 21:22:41 +00:00
|
|
|
// <a> this.$a
|
2014-02-25 23:55:33 +00:00
|
|
|
// <img> this.$image
|
|
|
|
// <figcaption> this.caption.view.$element
|
2013-11-01 06:13:09 +00:00
|
|
|
|
|
|
|
// Build DOM:
|
2013-11-01 19:45:59 +00:00
|
|
|
this.$a = this.$( '<a>' )
|
2013-05-17 18:42:27 +00:00
|
|
|
.addClass( 'image' )
|
2013-10-21 15:12:54 +00:00
|
|
|
.attr( 'href', this.getResolvedAttribute( 'href' ) );
|
2013-05-17 18:42:27 +00:00
|
|
|
|
2013-11-01 19:45:59 +00:00
|
|
|
this.$image = this.$( '<img>' )
|
2013-10-21 15:12:54 +00:00
|
|
|
.attr( 'src', this.getResolvedAttribute( 'src' ) )
|
2013-05-17 18:42:27 +00:00
|
|
|
.appendTo( this.$a );
|
2013-05-17 19:40:12 +00:00
|
|
|
|
2013-11-01 06:13:09 +00:00
|
|
|
this.$figure = this.$( '<figure>' )
|
|
|
|
.appendTo( this.$element )
|
|
|
|
.append( this.$a )
|
2014-07-28 12:07:49 +00:00
|
|
|
// The following classes can be used here:
|
|
|
|
// ve-ce-mwBlockImageNode-type-thumb
|
|
|
|
// ve-ce-mwBlockImageNode-type-frame
|
|
|
|
// ve-ce-mwBlockImageNode-type-frameless
|
|
|
|
// ve-ce-mwBlockImageNode-type-border
|
|
|
|
// ve-ce-mwBlockImageNode-type-none
|
2014-05-29 01:35:07 +00:00
|
|
|
.addClass( 've-ce-mwBlockImageNode ve-ce-mwBlockImageNode-type-' + type )
|
2013-11-01 06:13:09 +00:00
|
|
|
// 'typeof' should appear with the proper Parsoid-generated
|
|
|
|
// type. The model deals with converting it
|
2013-12-18 21:22:41 +00:00
|
|
|
.attr( 'typeof', this.typeToRdfa[ type ] );
|
2013-08-30 21:04:29 +00:00
|
|
|
|
2013-12-18 21:22:41 +00:00
|
|
|
this.updateCaption();
|
2013-08-30 21:04:29 +00:00
|
|
|
|
2013-12-18 21:22:41 +00:00
|
|
|
this.updateSize();
|
2013-06-19 22:58:13 +00:00
|
|
|
|
2013-08-30 21:04:29 +00:00
|
|
|
// Mixin constructors
|
2013-11-01 06:13:09 +00:00
|
|
|
ve.ce.MWImageNode.call( this, this.$figure, this.$image );
|
2013-04-25 00:47:17 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Inheritance */
|
|
|
|
|
2013-10-11 21:44:09 +00:00
|
|
|
OO.inheritClass( ve.ce.MWBlockImageNode, ve.ce.BranchNode );
|
2013-04-25 00:47:17 +00:00
|
|
|
|
2013-07-16 14:06:47 +00:00
|
|
|
// Need to mixin base class as well
|
2013-10-11 21:44:09 +00:00
|
|
|
OO.mixinClass( ve.ce.MWBlockImageNode, ve.ce.GeneratedContentNode );
|
2013-06-27 18:24:26 +00:00
|
|
|
|
2013-10-11 21:44:09 +00:00
|
|
|
OO.mixinClass( ve.ce.MWBlockImageNode, ve.ce.MWImageNode );
|
2013-07-16 14:06:47 +00:00
|
|
|
|
2013-04-25 00:47:17 +00:00
|
|
|
/* Static Properties */
|
|
|
|
|
2013-05-28 11:31:41 +00:00
|
|
|
ve.ce.MWBlockImageNode.static.name = 'mwBlockImage';
|
2013-04-25 00:47:17 +00:00
|
|
|
|
2013-05-14 23:39:13 +00:00
|
|
|
ve.ce.MWBlockImageNode.static.tagName = 'div';
|
|
|
|
|
|
|
|
ve.ce.MWBlockImageNode.static.renderHtmlAttributes = false;
|
|
|
|
|
2013-06-07 00:51:00 +00:00
|
|
|
ve.ce.MWBlockImageNode.static.transition = false;
|
|
|
|
|
2013-06-19 22:58:13 +00:00
|
|
|
ve.ce.MWBlockImageNode.static.cssClasses = {
|
|
|
|
'default': {
|
2013-11-01 06:13:09 +00:00
|
|
|
'left': 'mw-halign-left',
|
|
|
|
'right': 'mw-halign-right',
|
|
|
|
'center': 'mw-halign-center',
|
|
|
|
'none': 'mw-halign-none'
|
2013-06-19 22:58:13 +00:00
|
|
|
},
|
|
|
|
'none': {
|
2013-11-01 06:13:09 +00:00
|
|
|
'left': 'mw-halign-left',
|
|
|
|
'right': 'mw-halign-right',
|
|
|
|
'center': 'mw-halign-center',
|
|
|
|
'none': 'mw-halign-none'
|
2013-06-19 22:58:13 +00:00
|
|
|
}
|
2013-05-14 23:39:13 +00:00
|
|
|
};
|
ve.Element refactor
Objectives:
* Move ve.ui.Element to ve.Element
* Make CE nodes inherit from ve.Element
Changes:
ve.ui.Element.js, ve.Element.js
* Move and rename
* Move ve.ui.get$$ to ve.Element.static.get$$
* Add static getDocument and getWindow methods
* Add instance getElementDocument and getElementWindow methods
* Add getTagName method, which by default reads the static tagName property, but when overridden can return a tag name based on other factors
*.php
* Updated file link
ve.ce.*Annotation.js, ve.ce.*Node.js, ve.ce.View.js, ve.ce.Document
* Added config options pass through
* Replaced passing elements through constructor with defining static tag names
* Added getTagName overrides where needed that derive tag name from model
* Refactore dom wrapper methods, now consistently using getTagName
ve.ce.Surface.js
* Removed static initialization (not needed)
ve.dm.Model.js, ve.ui.Window.js
* Added missing docs
ve.ui.GroupElement.js, ve.ui.Layout.js, ve.ui.Widget.js,
* Updated class name for elements
ve.ui.Frame.js, ve.ui.LookupInputWidget.js
* Updated location of get$$
ve.ui.js
* Move get$$ to ve.Element
ve.js
* Add auto-init of static properties to mixinClass
Change-Id: I39ae14966456903728e4d9e53f806ddce9ca2b70
2013-05-13 20:52:59 +00:00
|
|
|
|
2013-04-25 00:47:17 +00:00
|
|
|
/* Methods */
|
|
|
|
|
2013-11-01 06:13:09 +00:00
|
|
|
/**
|
|
|
|
* Set up an object that converts from the type to rdfa, based
|
|
|
|
* on the rdfaToType object in the model.
|
|
|
|
* @returns {Object.<string,string>} A type to Rdfa conversion object
|
|
|
|
*/
|
2013-12-13 18:05:21 +00:00
|
|
|
ve.ce.MWBlockImageNode.prototype.getTypeToRdfa = function () {
|
2013-11-01 06:13:09 +00:00
|
|
|
var rdfa, obj = {};
|
|
|
|
|
|
|
|
for ( rdfa in this.model.constructor.static.rdfaToType ) {
|
|
|
|
obj[ this.model.constructor.static.rdfaToType[rdfa] ] = rdfa;
|
|
|
|
}
|
|
|
|
return obj;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2013-12-18 21:22:41 +00:00
|
|
|
* Update the caption based on the current model state
|
2013-11-01 06:13:09 +00:00
|
|
|
*/
|
2013-12-18 21:22:41 +00:00
|
|
|
ve.ce.MWBlockImageNode.prototype.updateCaption = function () {
|
|
|
|
var model, view,
|
|
|
|
type = this.model.getAttribute( 'type' );
|
|
|
|
|
2013-12-29 05:49:56 +00:00
|
|
|
this.captionVisible = type !== 'none' &&
|
|
|
|
type !== 'frameless' &&
|
|
|
|
type !== 'border' &&
|
|
|
|
this.model.children.length === 1;
|
2013-12-18 21:22:41 +00:00
|
|
|
|
|
|
|
if ( this.captionVisible ) {
|
|
|
|
// Only create a caption if we need it
|
|
|
|
if ( !this.$caption ) {
|
|
|
|
model = this.model.children[0];
|
|
|
|
view = ve.ce.nodeFactory.create( model.getType(), model );
|
|
|
|
model.connect( this, { 'update': 'onModelUpdate' } );
|
|
|
|
this.children.push( view );
|
|
|
|
view.attach( this );
|
|
|
|
if ( this.live !== view.isLive() ) {
|
|
|
|
view.setLive( this.live );
|
|
|
|
}
|
|
|
|
this.$caption = view.$element;
|
|
|
|
this.$figure.append( this.$caption );
|
2013-11-01 06:13:09 +00:00
|
|
|
}
|
|
|
|
}
|
2013-12-18 21:22:41 +00:00
|
|
|
if ( this.$caption ) {
|
2014-06-13 16:37:14 +00:00
|
|
|
// Don't use show() as it sets display to block, overriding the stylesheet.
|
|
|
|
this.$caption.css( 'display', this.captionVisible ? '' : 'none' );
|
2013-11-01 06:13:09 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2013-12-18 21:22:41 +00:00
|
|
|
* Update CSS classes based on alignment and type
|
2013-11-01 06:13:09 +00:00
|
|
|
*
|
2013-12-18 21:22:41 +00:00
|
|
|
* @param {string} [oldAlign] The old alignment, for removing classes
|
2013-11-01 06:13:09 +00:00
|
|
|
*/
|
2013-12-18 21:22:41 +00:00
|
|
|
ve.ce.MWBlockImageNode.prototype.updateClasses = function ( oldAlign ) {
|
2014-01-15 22:26:15 +00:00
|
|
|
var alignClass,
|
|
|
|
align = this.model.getAttribute( 'align' ),
|
2013-12-18 21:22:41 +00:00
|
|
|
type = this.model.getAttribute( 'type' );
|
|
|
|
|
|
|
|
if ( oldAlign && oldAlign !== align ) {
|
|
|
|
// Remove previous alignment
|
2013-11-01 06:13:09 +00:00
|
|
|
this.$figure
|
2013-12-18 21:22:41 +00:00
|
|
|
.removeClass( this.getCssClass( 'none', oldAlign ) )
|
|
|
|
.removeClass( this.getCssClass( 'default', oldAlign ) );
|
2013-11-01 06:13:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if ( type !== 'none' && type !== 'frameless' ) {
|
2014-01-15 22:26:15 +00:00
|
|
|
alignClass = this.getCssClass( 'default', align );
|
2013-12-18 21:22:41 +00:00
|
|
|
this.$image.addClass( 've-ce-mwBlockImageNode-thumbimage' );
|
2014-01-15 22:26:15 +00:00
|
|
|
this.$figure.addClass( 've-ce-mwBlockImageNode-borderwrap' );
|
2013-11-01 06:13:09 +00:00
|
|
|
} else {
|
2014-01-15 22:26:15 +00:00
|
|
|
alignClass = this.getCssClass( 'none', align );
|
2013-12-18 21:22:41 +00:00
|
|
|
this.$image.removeClass( 've-ce-mwBlockImageNode-thumbimage' );
|
2014-01-15 22:26:15 +00:00
|
|
|
this.$figure.removeClass( 've-ce-mwBlockImageNode-borderwrap' );
|
|
|
|
}
|
|
|
|
this.$figure.addClass( alignClass );
|
|
|
|
|
2014-02-27 17:39:19 +00:00
|
|
|
// Border
|
|
|
|
this.$figure.toggleClass( 'mw-image-border', !!this.model.getAttribute( 'borderImage' ) );
|
|
|
|
|
2014-01-15 22:26:15 +00:00
|
|
|
switch ( alignClass ) {
|
|
|
|
case 'mw-halign-right':
|
|
|
|
this.showHandles( ['sw'] );
|
|
|
|
break;
|
|
|
|
case 'mw-halign-left':
|
|
|
|
this.showHandles( ['se'] );
|
|
|
|
break;
|
|
|
|
case 'mw-halign-center':
|
|
|
|
this.showHandles( ['sw', 'se'] );
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
this.showHandles();
|
|
|
|
break;
|
2013-11-01 06:13:09 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2013-12-18 21:22:41 +00:00
|
|
|
* Redraw the image and its wrappers at the specified dimensions
|
2013-11-01 06:13:09 +00:00
|
|
|
*
|
2013-12-19 11:38:33 +00:00
|
|
|
* The current dimensions from the model are used if none are specified.
|
|
|
|
*
|
|
|
|
* @param {Object} [dimensions] Dimension object containing width & height
|
2013-11-01 06:13:09 +00:00
|
|
|
*/
|
2013-12-18 21:22:41 +00:00
|
|
|
ve.ce.MWBlockImageNode.prototype.updateSize = function ( dimensions ) {
|
|
|
|
if ( !dimensions ) {
|
|
|
|
dimensions = {
|
|
|
|
'width': this.model.getAttribute( 'width' ),
|
|
|
|
'height': this.model.getAttribute( 'height' )
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2014-01-26 20:09:40 +00:00
|
|
|
this.$image.css( dimensions );
|
2014-05-28 01:44:58 +00:00
|
|
|
|
|
|
|
// Make sure $figure is sharing the dimensions, otherwise 'middle' and 'none'
|
|
|
|
// positions don't work properly
|
|
|
|
this.$figure.css( {
|
|
|
|
'width': dimensions.width + ( this.captionVisible ? 2 : 0 ),
|
|
|
|
'height': this.captionVisible ? 'auto' : dimensions.height
|
|
|
|
} );
|
2014-02-20 05:11:04 +00:00
|
|
|
this.$figure.toggleClass( 'mw-default-size', !!this.model.getAttribute( 'defaultSize' ) );
|
2013-11-01 06:13:09 +00:00
|
|
|
};
|
2013-12-18 21:22:41 +00:00
|
|
|
|
2013-07-24 22:31:46 +00:00
|
|
|
/**
|
|
|
|
* Get the right CSS class to use for alignment
|
2013-11-01 06:13:09 +00:00
|
|
|
*
|
2013-07-24 22:31:46 +00:00
|
|
|
* @param {string} type 'none' or 'default'
|
|
|
|
* @param {string} alignment 'left', 'right', 'center', 'none' or 'default'
|
|
|
|
*/
|
|
|
|
ve.ce.MWBlockImageNode.prototype.getCssClass = function ( type, alignment ) {
|
|
|
|
// TODO use this.model.getAttribute( 'type' ) etc., see bug 52065
|
|
|
|
// Default is different between RTL and LTR wikis:
|
|
|
|
if ( type === 'default' && alignment === 'default' ) {
|
2014-07-21 16:44:09 +00:00
|
|
|
if ( this.getModel().getDocument().getDir() === 'rtl' ) {
|
2013-12-12 02:32:35 +00:00
|
|
|
return 'mw-halign-left';
|
2013-07-24 22:31:46 +00:00
|
|
|
} else {
|
2013-12-12 02:32:35 +00:00
|
|
|
return 'mw-halign-right';
|
2013-07-24 22:31:46 +00:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
return this.constructor.static.cssClasses[type][alignment];
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2013-07-23 23:13:28 +00:00
|
|
|
/**
|
|
|
|
* Override the default onSetup to add direction-dependent
|
|
|
|
* classes to the image thumbnail.
|
|
|
|
*
|
|
|
|
* @method
|
|
|
|
*/
|
2013-10-17 22:09:48 +00:00
|
|
|
ve.ce.MWBlockImageNode.prototype.onSetup = function () {
|
2013-12-18 21:22:41 +00:00
|
|
|
// Parent method
|
2013-07-24 21:02:08 +00:00
|
|
|
ve.ce.BranchNode.prototype.onSetup.call( this );
|
|
|
|
|
2013-12-18 21:22:41 +00:00
|
|
|
this.updateClasses();
|
2013-07-23 23:13:28 +00:00
|
|
|
};
|
|
|
|
|
2013-10-11 12:33:53 +00:00
|
|
|
/**
|
2014-04-10 00:26:48 +00:00
|
|
|
* @inheritdoc
|
2013-10-11 12:33:53 +00:00
|
|
|
*/
|
2013-05-14 23:39:13 +00:00
|
|
|
ve.ce.MWBlockImageNode.prototype.onAttributeChange = function ( key, from, to ) {
|
2013-07-01 20:23:51 +00:00
|
|
|
if ( key === 'height' || key === 'width' ) {
|
|
|
|
to = parseInt( to, 10 );
|
|
|
|
}
|
|
|
|
|
2013-06-07 00:51:00 +00:00
|
|
|
if ( from !== to ) {
|
2013-06-19 02:31:01 +00:00
|
|
|
switch ( key ) {
|
|
|
|
case 'align':
|
2013-12-18 21:22:41 +00:00
|
|
|
this.updateClasses( from );
|
2013-06-19 02:31:01 +00:00
|
|
|
break;
|
|
|
|
case 'src':
|
2013-10-21 15:12:54 +00:00
|
|
|
this.$image.attr( 'src', this.getResolvedAttribute( 'src' ) );
|
2013-06-19 02:31:01 +00:00
|
|
|
break;
|
|
|
|
case 'width':
|
2013-12-21 22:37:54 +00:00
|
|
|
this.updateSize( {
|
|
|
|
'width': to,
|
|
|
|
'height': this.model.getAttribute( 'height' )
|
|
|
|
} );
|
|
|
|
break;
|
2013-06-30 04:53:50 +00:00
|
|
|
case 'height':
|
2013-12-21 22:37:54 +00:00
|
|
|
this.updateSize( {
|
|
|
|
'width': this.model.getAttribute( 'width' ),
|
|
|
|
'height': to
|
|
|
|
} );
|
2013-11-01 06:13:09 +00:00
|
|
|
break;
|
|
|
|
case 'type':
|
2013-12-18 21:22:41 +00:00
|
|
|
this.$figure
|
|
|
|
.removeClass( 've-ce-mwBlockImageNode-type-' + from )
|
|
|
|
.addClass( 've-ce-mwBlockImageNode-type-' + to )
|
|
|
|
.attr( 'typeof', this.typeToRdfa[ to ] );
|
|
|
|
|
|
|
|
this.updateClasses();
|
|
|
|
this.updateCaption();
|
2013-11-01 06:13:09 +00:00
|
|
|
break;
|
2013-12-18 21:22:41 +00:00
|
|
|
// Other image attributes if they exist
|
2013-11-01 06:13:09 +00:00
|
|
|
case 'alt':
|
2013-12-28 10:29:35 +00:00
|
|
|
if ( !to ) {
|
|
|
|
this.$image.removeAttr( key );
|
|
|
|
} else {
|
|
|
|
this.$image.attr( key, to );
|
|
|
|
}
|
2013-06-19 02:31:01 +00:00
|
|
|
break;
|
2014-02-20 05:11:04 +00:00
|
|
|
case 'defaultSize':
|
|
|
|
this.$figure.toggleClass( 'mw-default-size', to );
|
|
|
|
break;
|
2013-06-07 00:51:00 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2013-10-14 11:44:26 +00:00
|
|
|
/** */
|
|
|
|
ve.ce.MWBlockImageNode.prototype.onResizableResizing = function ( dimensions ) {
|
|
|
|
if ( !this.outline ) {
|
|
|
|
ve.ce.ResizableNode.prototype.onResizableResizing.call( this, dimensions );
|
2013-11-01 06:13:09 +00:00
|
|
|
|
2013-12-18 21:22:41 +00:00
|
|
|
this.updateSize( dimensions );
|
2013-10-14 11:44:26 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2013-07-31 22:53:29 +00:00
|
|
|
/** */
|
2013-04-25 00:47:17 +00:00
|
|
|
ve.ce.MWBlockImageNode.prototype.setupSlugs = function () {
|
2013-05-14 23:39:13 +00:00
|
|
|
// Intentionally empty
|
|
|
|
};
|
|
|
|
|
2013-07-31 22:53:29 +00:00
|
|
|
/** */
|
2013-05-14 23:39:13 +00:00
|
|
|
ve.ce.MWBlockImageNode.prototype.onSplice = function () {
|
|
|
|
// Intentionally empty
|
2013-04-25 00:47:17 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Registration */
|
|
|
|
|
|
|
|
ve.ce.nodeFactory.register( ve.ce.MWBlockImageNode );
|