r83875 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r83874‎ | r83875 | r83876 >
Date:09:33, 14 March 2011
Author:janpaul123
Status:deferred
Tags:
Comment:
Slightly changed the behaviour of marking collapsing.
Modified paths:
  • /trunk/extensions/InlineEditor/InlineEditorMarking.class.php (modified) (history)
  • /trunk/extensions/InlineEditor/InlineEditorText.class.php (modified) (history)
  • /trunk/extensions/InlineEditor/MediaEditor/MediaEditor.class.php (modified) (history)
  • /trunk/extensions/InlineEditor/TemplateEditor/TemplateEditor.class.php (modified) (history)

Diff [purge]

Index: trunk/extensions/InlineEditor/TemplateEditor/TemplateEditor.class.php
@@ -18,7 +18,7 @@
1919 foreach ( $matches[0] as $match ) {
2020 $start = $match[1];
2121 $end = $start + strlen( $match[0] );
22 - $inlineEditorText->addMarking( new InlineEditorMarking( $start, $end, 'templateEditorElement inlineEditorBasic', true, false ) );
 22+ $inlineEditorText->addMarking( new InlineEditorMarking( $start, $end, 'templateEditorElement inlineEditorBasic', true, false, 0, false ) );
2323 }
2424
2525 return true;
Index: trunk/extensions/InlineEditor/InlineEditorText.class.php
@@ -260,7 +260,7 @@
261261 protected function collapseMarkings() {
262262 foreach( $this->markings as $id => $marking ) {
263263 if( isset( $previous ) ) {
264 - if( $previous->getCollapsible() && $marking->samePositionAs( $previous ) ) {
 264+ if( $marking->getCollapsible() && $marking->samePositionAs( $previous ) ) {
265265 unset( $this->markings[$previousID] );
266266 }
267267 }
Index: trunk/extensions/InlineEditor/MediaEditor/MediaEditor.class.php
@@ -31,7 +31,7 @@
3232 if ( $namespace == NS_FILE ) {
3333 $start = $match[1];
3434 $end = $start + strlen( $match[0] );
35 - $inlineEditorText->addMarking( new InlineEditorMarking( $start, $end, 'mediaEditorElement inlineEditorBasic', true, false ) );
 35+ $inlineEditorText->addMarking( new InlineEditorMarking( $start, $end, 'mediaEditorElement inlineEditorBasic', true, false, 0, false ) );
3636 }
3737 }
3838
Index: trunk/extensions/InlineEditor/InlineEditorMarking.class.php
@@ -15,7 +15,7 @@
1616 protected $block; /// < whether the tag should be added as a block or inline
1717 protected $bar; /// < whether the text should carry a bar at the left, or be fully selectable
1818 protected $level; /// < nesting level, which is used to sort consistently when two markings are of same length
19 - protected $collapsible; /// < whether or not the marking can be collapsed when only containing one nested element
 19+ protected $collapsible; /// < whether or not the marking can be collapsed by removing parent elements of the same size
2020
2121 protected $id; /// < id in the original text; this will be unique even when calculating new ids!
2222 protected $matched; /// < bool whether or not this marking has been matched with a previous marking (default: true)
@@ -27,7 +27,7 @@
2828 * @param $block bool Whether the tag should be added as a block or inline
2929 * @param $bar bool Whether the text should carry a bar at the left, or be fully selectable
3030 * @param $level int Nesting level, which is used to sort consistently when two markings are of same length, default: 0
31 - * @param $collapsible bool Whether or not the marking can be collapsed when only containing one nested element, default: true
 31+ * @param $collapsible bool Whether or not the marking can be collapsed by removing parent elements of the same size
3232 */
3333 function __construct( $start, $end, $classes, $block, $bar, $level = 0, $collapsible = true ) {
3434 $this->start = $start;
@@ -187,7 +187,7 @@
188188 }
189189
190190 /**
191 - * Get whether or not the marking can be collapsed when only containing one nested element.
 191+ * Get whether or not the marking can be collapsed by removing parent elements of the same size
192192 * @param $value int
193193 */
194194 public function getCollapsible() {

Status & tagging log