Page MenuHomePhabricator

VisualEditor: Build out support for Monobook
Closed, ResolvedPublic

Description

The VisualEditor extension currently only works with the Vector skin. It should work with other skins such as Monobook.

From [mediawiki/extensions/VisualEditor.git] / VisualEditor.hooks.php (https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/extensions/VisualEditor.git;a=blob;f=VisualEditor.hooks.php;h=e43fef59dd678ba5309f2335829dd6fe1e041a2d;hb=4fea35acd451c939a522ab7a4d7bd13e4ac95e76):


class VisualEditorHooks {
/**

  • Adds VisualEditor JS to the output if in the correct namespace. *
  • This is attached to the MediaWiki 'BeforePageDisplay' hook. *
  • @param $output OutputPage
  • @param $skin Skin
	 */

public static function onBeforePageDisplay( &$output, &$skin ) {

		global $wgTitle;
		if (
			// Vector skin supported for now.
			$skin->getSkinName() === 'vector' &&
			(
				// Article in the VisualEditor namespace
				$wgTitle->getNamespace() === NS_VISUALEDITOR ||
				// Special page action for an article in the VisualEditor namespace
				$skin->getRelevantTitle()->getNamespace() === NS_VISUALEDITOR
			)
		) {
			$output->addModules( array( 'ext.visualEditor.editPageInit' ) );
		}
		return true;

}


Version: unspecified
Severity: enhancement

Details

Reference
bz38154

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 12:54 AM
bzimport set Reference to bz38154.

Bumping the importance of this as it's annoying the shit out of me when trying to play with the extension.

Enhancement, not bug. Resource issues are non-trivial. To discuss as part of the product strategy.

(In reply to comment #2)

Enhancement, not bug. Resource issues are non-trivial. To discuss as part of
the product strategy.

I've found the cost of all the noise switching back and forth between bug and enhancement to far outweigh any benefit. I don't care what you call this ticket and neither does nearly any other ticket filer.

The VisualEditor extension should work with non-Vector skins. (And the fact that it doesn't is getting in the way of power-users, a good number of whom use Monobook.)

You can classify the request as whatever you'd like or just disable the stupid categorization altogether. Nobody cares.

I've added support for Monobook in Ia39e034229204ae5f1f70dce5d74c6c4db42277b

This doesn't mean "all" skins are supported, so I am not sure I should close the bug, but for most purposes this is sufficient.

The primary request here was monobook support - I've renamed the bug and am now closing it.

(In reply to comment #4)

I've added support for Monobook in Ia39e034229204ae5f1f70dce5d74c6c4db42277b

Awesome. Thank you, Trevor!