http://www.mediawiki.org/wiki/Special:Code/MediaWiki/83875
Revision: 83875 Author: janpaul123 Date: 2011-03-14 09:33:38 +0000 (Mon, 14 Mar 2011) Log Message: ----------- Slightly changed the behaviour of marking collapsing. Modified Paths: -------------- trunk/extensions/InlineEditor/InlineEditorMarking.class.php trunk/extensions/InlineEditor/InlineEditorText.class.php trunk/extensions/InlineEditor/MediaEditor/MediaEditor.class.php trunk/extensions/InlineEditor/TemplateEditor/TemplateEditor.class.php Modified: trunk/extensions/InlineEditor/InlineEditorMarking.class.php =================================================================== --- trunk/extensions/InlineEditor/InlineEditorMarking.class.php 2011-03-14 09:30:56 UTC (rev 83874) +++ trunk/extensions/InlineEditor/InlineEditorMarking.class.php 2011-03-14 09:33:38 UTC (rev 83875) @@ -15,7 +15,7 @@ protected $block; /// < whether the tag should be added as a block or inline protected $bar; /// < whether the text should carry a bar at the left, or be fully selectable protected $level; /// < nesting level, which is used to sort consistently when two markings are of same length - protected $collapsible; /// < whether or not the marking can be collapsed when only containing one nested element + protected $collapsible; /// < whether or not the marking can be collapsed by removing parent elements of the same size protected $id; /// < id in the original text; this will be unique even when calculating new ids! protected $matched; /// < bool whether or not this marking has been matched with a previous marking (default: true) @@ -27,7 +27,7 @@ * @param $block bool Whether the tag should be added as a block or inline * @param $bar bool Whether the text should carry a bar at the left, or be fully selectable * @param $level int Nesting level, which is used to sort consistently when two markings are of same length, default: 0 - * @param $collapsible bool Whether or not the marking can be collapsed when only containing one nested element, default: true + * @param $collapsible bool Whether or not the marking can be collapsed by removing parent elements of the same size */ function __construct( $start, $end, $classes, $block, $bar, $level = 0, $collapsible = true ) { $this->start = $start; @@ -187,7 +187,7 @@ } /** - * Get whether or not the marking can be collapsed when only containing one nested element. + * Get whether or not the marking can be collapsed by removing parent elements of the same size * @param $value int */ public function getCollapsible() { Modified: trunk/extensions/InlineEditor/InlineEditorText.class.php =================================================================== --- trunk/extensions/InlineEditor/InlineEditorText.class.php 2011-03-14 09:30:56 UTC (rev 83874) +++ trunk/extensions/InlineEditor/InlineEditorText.class.php 2011-03-14 09:33:38 UTC (rev 83875) @@ -260,7 +260,7 @@ protected function collapseMarkings() { foreach( $this->markings as $id => $marking ) { if( isset( $previous ) ) { - if( $previous->getCollapsible() && $marking->samePositionAs( $previous ) ) { + if( $marking->getCollapsible() && $marking->samePositionAs( $previous ) ) { unset( $this->markings[$previousID] ); } } Modified: trunk/extensions/InlineEditor/MediaEditor/MediaEditor.class.php =================================================================== --- trunk/extensions/InlineEditor/MediaEditor/MediaEditor.class.php 2011-03-14 09:30:56 UTC (rev 83874) +++ trunk/extensions/InlineEditor/MediaEditor/MediaEditor.class.php 2011-03-14 09:33:38 UTC (rev 83875) @@ -31,7 +31,7 @@ if ( $namespace == NS_FILE ) { $start = $match[1]; $end = $start + strlen( $match[0] ); - $inlineEditorText->addMarking( new InlineEditorMarking( $start, $end, 'mediaEditorElement inlineEditorBasic', true, false ) ); + $inlineEditorText->addMarking( new InlineEditorMarking( $start, $end, 'mediaEditorElement inlineEditorBasic', true, false, 0, false ) ); } } Modified: trunk/extensions/InlineEditor/TemplateEditor/TemplateEditor.class.php =================================================================== --- trunk/extensions/InlineEditor/TemplateEditor/TemplateEditor.class.php 2011-03-14 09:30:56 UTC (rev 83874) +++ trunk/extensions/InlineEditor/TemplateEditor/TemplateEditor.class.php 2011-03-14 09:33:38 UTC (rev 83875) @@ -18,7 +18,7 @@ foreach ( $matches[0] as $match ) { $start = $match[1]; $end = $start + strlen( $match[0] ); - $inlineEditorText->addMarking( new InlineEditorMarking( $start, $end, 'templateEditorElement inlineEditorBasic', true, false ) ); + $inlineEditorText->addMarking( new InlineEditorMarking( $start, $end, 'templateEditorElement inlineEditorBasic', true, false, 0, false ) ); } return true; _______________________________________________ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs