summaryrefslogtreecommitdiff
path: root/extensions/WikiEditor/WikiEditor.hooks.php
diff options
context:
space:
mode:
Diffstat (limited to 'extensions/WikiEditor/WikiEditor.hooks.php')
-rw-r--r--extensions/WikiEditor/WikiEditor.hooks.php43
1 files changed, 8 insertions, 35 deletions
diff --git a/extensions/WikiEditor/WikiEditor.hooks.php b/extensions/WikiEditor/WikiEditor.hooks.php
index 6dfdb691..ccb54480 100644
--- a/extensions/WikiEditor/WikiEditor.hooks.php
+++ b/extensions/WikiEditor/WikiEditor.hooks.php
@@ -53,22 +53,6 @@ class WikiEditorHooks {
'ext.wikiEditor.dialogs',
),
),
- 'hidesig' => array(
- 'preferences' => array(
- 'wikieditor-toolbar-hidesig' => array(
- 'type' => 'toggle',
- 'label-message' => 'wikieditor-toolbar-hidesig',
- 'section' => 'editing/editor',
- ),
- ),
- 'requirements' => array(
- 'wikieditor-toolbar-hidesig' => true,
- 'usebetatoolbar' => true,
- ),
- 'modules' => array(
- 'ext.wikiEditor.toolbar.hideSig',
- ),
- ),
/* Labs Features */
@@ -118,8 +102,6 @@ class WikiEditorHooks {
'toolbar' => array( 'global' => false, 'user' => true ),
// Provides interactive tools
'dialogs' => array( 'global' => false, 'user' => true ),
- // Hide signature button from main namespace
- 'hidesig' => array( 'global' => true, 'user' => false ),
/* Textarea / i-frame compatible, but still experimental and unstable (do not deploy!) */
@@ -193,6 +175,10 @@ class WikiEditorHooks {
if ( !class_exists( 'EventLogging' ) ) {
return false;
}
+ // Sample 6.25% (via hex digit)
+ if ( $data['editingSessionId'][0] > '0' ) {
+ return false;
+ }
$user = $article->getContext()->getUser();
$page = $article->getPage();
@@ -204,7 +190,6 @@ class WikiEditorHooks {
'editor' => 'wikitext',
'platform' => 'desktop', // FIXME
'integration' => 'page',
- 'page.length' => -1, // FIXME
'page.id' => $page->getId(),
'page.title' => $title->getPrefixedText(),
'page.ns' => $title->getNamespace(),
@@ -218,7 +203,7 @@ class WikiEditorHooks {
$data['user.class'] = 'IP';
}
- return EventLogging::logEvent( 'Edit', 11448630, $data );
+ return EventLogging::logEvent( 'Edit', 13457736, $data );
}
/**
@@ -293,9 +278,10 @@ class WikiEditorHooks {
$req = $outputPage->getContext()->getRequest();
$editingStatsId = $req->getVal( 'editingStatsId' );
- if ( !$editingStatsId ) {
+ if ( !$editingStatsId || !$req->wasPosted() ) {
$editingStatsId = self::getEditingStatsId();
}
+
$outputPage->addHTML(
Xml::element(
'input',
@@ -362,6 +348,7 @@ class WikiEditorHooks {
public static function resourceLoaderGetConfigVars( &$vars ) {
// expose magic words for use by the wikieditor toolbar
WikiEditorHooks::getMagicWords( $vars );
+
return true;
}
@@ -428,20 +415,6 @@ class WikiEditorHooks {
/**
- * Adds WikiEditor JS to the output.
- *
- * This is attached to the MediaWiki 'BeforePageDisplay' hook.
- *
- * @param OutputPage $output
- * @param Skin $skin
- * @return boolean
- */
- public static function onBeforePageDisplay( OutputPage &$output, Skin &$skin ) {
- $output->addModules( array( 'ext.wikiEditor.init' ) );
- return true;
- }
-
- /**
* Gets a 32 character alphanumeric random string to be used for stats.
* @return string
*/