[MediaWiki-commits] [Gerrit] Remove unused messages 'edit-externally' and 'edit-externall... - change (mediawiki/core)
PleaseStand has uploaded a new change for review. https://gerrit.wikimedia.org/r/99039 Change subject: Remove unused messages 'edit-externally' and 'edit-externally-help' .. Remove unused messages 'edit-externally' and 'edit-externally-help' Follows-up 4be62363520d. Change-Id: Id178a79da5f72f3fae21072c91a49ae9a89f8a38 --- M languages/messages/MessagesEn.php M maintenance/language/messages.inc 2 files changed, 0 insertions(+), 9 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/39/99039/1 diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index e6ecc78..6ccaad9 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -4537,10 +4537,6 @@ 'exif-urgency-high' => 'High ($1)', 'exif-urgency-other' => 'User-defined priority ($1)', -# External editor support -'edit-externally' => 'Edit this file using an external application', -'edit-externally-help' => '(See the [https://www.mediawiki.org/wiki/Manual:External_editors setup instructions] for more information)', - # 'all' in various places, this might be different for inflected languages 'watchlistall2' => 'all', 'namespacesall' => 'all', diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index f0160cc..bb0f26d 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -3453,10 +3453,6 @@ 'exif-urgency-high', 'exif-urgency-other', ), - 'edit-externally' => array( - 'edit-externally', - 'edit-externally-help', - ), 'all' => array( 'watchlistall2', 'namespacesall', @@ -4191,7 +4187,6 @@ 'exif-maxaperturevalue' => '', 'exif-iimcategory' => '', 'exif-urgency' => '', - 'edit-externally' => 'External editor support', 'all' => "'all' in various places, this might be different for inflected languages", 'confirmemail' => 'Email address confirmation', 'scarytransclusion' => 'Scary transclusion', -- To view, visit https://gerrit.wikimedia.org/r/99039 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id178a79da5f72f3fae21072c91a49ae9a89f8a38 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: PleaseStand ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove unused message 'wrong_wfQuery_params' - change (mediawiki/core)
PleaseStand has uploaded a new change for review. https://gerrit.wikimedia.org/r/99040 Change subject: Remove unused message 'wrong_wfQuery_params' .. Remove unused message 'wrong_wfQuery_params' Follows-up r63241 (7220add43edf). Change-Id: I76738264971fed87fe4bedd2854c2a8f801acff2 --- M languages/messages/MessagesEn.php M maintenance/language/messages.inc 2 files changed, 0 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/40/99040/1 diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index e6ecc78..5566cae 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -1051,9 +1051,6 @@ 'perfcachedts' => 'The following data is cached, and was last updated $1. A maximum of {{PLURAL:$4|one result is|$4 results are}} available in the cache.', 'querypage-no-updates' => 'Updates for this page are currently disabled. Data here will not presently be refreshed.', -'wrong_wfQuery_params' => 'Incorrect parameters to wfQuery() -Function: $1 -Query: $2', 'viewsource'=> 'View source', 'viewsource-title' => 'View source for $1', 'actionthrottled' => 'Action throttled', diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index f0160cc..096530c 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -406,7 +406,6 @@ 'perfcached', 'perfcachedts', 'querypage-no-updates', - 'wrong_wfQuery_params', 'viewsource', 'viewsource-title', 'actionthrottled', -- To view, visit https://gerrit.wikimedia.org/r/99040 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I76738264971fed87fe4bedd2854c2a8f801acff2 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: PleaseStand ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove unused message 'qbspecialpages' - change (mediawiki/core)
PleaseStand has uploaded a new change for review. https://gerrit.wikimedia.org/r/99041 Change subject: Remove unused message 'qbspecialpages' .. Remove unused message 'qbspecialpages' Follows-up d445cb730123. Change-Id: I49a80fd1dcdbe393d47307fd3a199d76c305fff5 --- M languages/messages/MessagesEn.php M maintenance/language/messages.inc 2 files changed, 0 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/41/99041/1 diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index e6ecc78..a6dd979 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -815,7 +815,6 @@ 'qbedit' => 'Edit', 'qbpageoptions' => 'This page', 'qbmyoptions'=> 'My pages', -'qbspecialpages' => 'Special pages', 'faq'=> 'FAQ', 'faqpage'=> 'Project:FAQ', 'sitetitle' => '{{SITENAME}}', # do not translate or duplicate this message to other languages diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index f0160cc..c7c1e52 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -188,7 +188,6 @@ 'qbedit', 'qbpageoptions', 'qbmyoptions', - 'qbspecialpages', 'faq', 'faqpage', 'sitetitle', -- To view, visit https://gerrit.wikimedia.org/r/99041 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I49a80fd1dcdbe393d47307fd3a199d76c305fff5 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: PleaseStand ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Merge branch 'gerrit/98995/3' into 2013/flow/db-storage-abst... - change (mediawiki...Flow)
Werdna has uploaded a new change for review. https://gerrit.wikimedia.org/r/99036 Change subject: Merge branch 'gerrit/98995/3' into 2013/flow/db-storage-abstraction .. Merge branch 'gerrit/98995/3' into 2013/flow/db-storage-abstraction Change-Id: I83b1fc25e3094abb6f4197f7c4d0bb84d85f3e9c --- 0 files changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow refs/changes/36/99036/1 -- To view, visit https://gerrit.wikimedia.org/r/99036 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I83b1fc25e3094abb6f4197f7c4d0bb84d85f3e9c Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Flow Gerrit-Branch: master Gerrit-Owner: Werdna ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] [WIP] Add Flow events to Special:Contributions. - change (mediawiki...Flow)
Werdna has uploaded a new change for review. https://gerrit.wikimedia.org/r/99038 Change subject: [WIP] Add Flow events to Special:Contributions. .. [WIP] Add Flow events to Special:Contributions. Still needs formatting. Change-Id: Ibfed9fe1e0e0ec4b185046a0035eb601808130f6 --- M Flow.php M Hooks.php 2 files changed, 62 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow refs/changes/38/99038/1 diff --git a/Flow.php b/Flow.php index a39f6e7..2d3c3f1 100755 --- a/Flow.php +++ b/Flow.php @@ -162,6 +162,7 @@ $wgHooks['SpecialWatchlistGetNonRevisionTypes'][] = 'FlowHooks::onSpecialWatchlistGetNonRevisionTypes'; $wgHooks['UserGetReservedNames'][] = 'FlowHooks::onUserGetReservedNames'; $wgHooks['ResourceLoaderGetConfigVars'][] = 'FlowHooks::onResourceLoaderGetConfigVars'; +$wgHooks['ContribsPager::reallyDoQuery'][] = 'FlowHooks::onContributionsQuery'; // Extension initialization $wgExtensionFunctions[] = 'FlowHooks::initFlowExtension'; diff --git a/Hooks.php b/Hooks.php index 6972255..254f878 100644 --- a/Hooks.php +++ b/Hooks.php @@ -289,4 +289,65 @@ return true; } + + public static function onContributionsQuery( &$data, $pager, $offset, $limit, $descending ) { + $storage = Flow\Container::get( 'storage' ); + $treeRepo = Flow\Container::get( 'repository.tree' ); + + $target = $pager->target; + $conditions = array(); + + // Work out user condition + if ( $pager->contribs == 'newbie' ) { + // Not supported yet + return true; + } else { + $uid = User::idFromName( $target ); + if ( $uid ) { + $conditions['rev_user_id'] = $uid; + } else { + $conditions['rev_user_name'] = $target; + } + } + + // Make offset parameter. + if ( $offset ) { + $offsetUUID = UUID::getComparisonUUID( $offset ); + $direction = $descending ? '<' : '>'; + $offsetCondition = "rev_id $direction " . quote( $offsetUUID->getBinary() ); + $conditions[] = new Flow\Data\RawSql( $offsetCondition ); + } + + $results = $storage->find( 'PostRevision', $conditions, array( + 'LIMIT' => $limit, + ) ); + + $output = array(); + + foreach( $results as $result ) { + $uuid = $result->getRevisionId(); + $postId = $result->getPostId(); + $uuidHex = $uuid->getHex(); + $timestamp = $uuid->getTimestamp(); + $fakeRow = array(); + + // FIXME this sucks, we should really be able to batch this query. + if ( ! $result->isTopicTitle() ) { + $rootPost = $treeRepo->findRoot( $postId ); + } else { + $rootPost = $result->getPostId(); + } + $workflow = $storage->get( 'Workflow', $rootPost ); + + $fakeRow['rev_timestamp'] = $timestamp; + $fakeRow['page_namespace'] = $workflow->getArticleTitle()->getNamespace(); + $fakeRow['page_title'] = $workflow->getArticleTitle()->getDBkey(); + $fakeRow['revision'] = $result; + $output[] = (object)$fakeRow; + } + + $data[] = $output; + + return true; + } } -- To view, visit https://gerrit.wikimedia.org/r/99038 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibfed9fe1e0e0ec4b185046a0035eb601808130f6 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Flow Gerrit-Branch: master Gerrit-Owner: Werdna ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Allow ObjectManager to fall back to querying backend storage... - change (mediawiki...Flow)
Werdna has uploaded a new change for review. https://gerrit.wikimedia.org/r/99037 Change subject: Allow ObjectManager to fall back to querying backend storage when no index is available .. Allow ObjectManager to fall back to querying backend storage when no index is available Change-Id: I83f590e501e27e3c6ade14c160011cdb05c8dcd5 --- M includes/Data/ObjectManager.php 1 file changed, 13 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow refs/changes/37/99037/1 diff --git a/includes/Data/ObjectManager.php b/includes/Data/ObjectManager.php index cb43ca6..73d4514 100644 --- a/includes/Data/ObjectManager.php +++ b/includes/Data/ObjectManager.php @@ -233,8 +233,19 @@ $options['sort'] = ObjectManager::makeArray( $options['sort'] ); } - $index = $this->getIndexFor( $keys, $options ); - $res = $index->findMulti( $queries ); + try { + $index = $this->getIndexFor( $keys, $options ); + $res = $index->findMulti( $queries ); + } catch ( \MWException $excep ) { + $res = $this->storage->findMulti( $queries, $options ); + $output = array(); + + foreach( $res as $index => $queryOutput ) { + $output[$index] = array_map( array( $this, 'load' ), $queryOutput ); + } + + return $output; + } if ( $res === null ) { return null; -- To view, visit https://gerrit.wikimedia.org/r/99037 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I83f590e501e27e3c6ade14c160011cdb05c8dcd5 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Flow Gerrit-Branch: master Gerrit-Owner: Werdna ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Refine paranoid SQL handling - change (mediawiki...Flow)
Werdna has uploaded a new change for review. https://gerrit.wikimedia.org/r/99034 Change subject: Refine paranoid SQL handling .. Refine paranoid SQL handling Add a RawSql class that can be used to pass through SQL. As a bonus, it accepts closures which take the DB as a parameter, so you can pass a closure that uses the passed DB object to escape whatever needs escaping. Change-Id: Ic88739b665d20fadbf3cc80185770661bef18658 --- M includes/Data/ObjectManager.php 1 file changed, 55 insertions(+), 20 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow refs/changes/34/99034/1 diff --git a/includes/Data/ObjectManager.php b/includes/Data/ObjectManager.php index 4d41792..d42360d 100644 --- a/includes/Data/ObjectManager.php +++ b/includes/Data/ObjectManager.php @@ -622,9 +622,7 @@ public function insert( array $row ) { // Only allow the row to include key/value pairs. // No raw SQL. - if ( $this->hasRawSQL( $row ) ) { - throw new \MWException( "Raw SQL found in row" ); - } + $row = $this->preprocessSqlArray( $row ); // insert returns boolean true/false $res = $this->dbFactory->getDB( DB_MASTER )->insert( @@ -652,13 +650,12 @@ // Only allow the row to include key/value pairs. // No raw SQL. - if ( $this->hasRawSQL( $updates ) || $this->hasRawSQL( $pk ) ) { - throw new \MWException( "Raw SQL found in input" ); - } + $updates = $this->preprocessSqlArray( $updates ); + $pk = $this->preprocessSqlArray( $pk ); $dbw = $this->dbFactory->getDB( DB_MASTER ); // update returns boolean true/false as $res - $res = $dbw->update( $this->table, $updates, UUID::convertUUIDs( $pk ), __METHOD__ . " ({$this->table})" ); + $res = $dbw->update( $this->table, $updates, $pk, __METHOD__ . " ({$this->table})" ); // $dbw->update returns boolean true/false as $res // we also want to check that $pk actually selected a row to update return $res && $dbw->affectedRows(); @@ -674,14 +671,10 @@ throw new PersistenceException( 'Row has null primary key: ' . implode( $missing ) ); } - // Only allow the row to include key/value pairs. - // No raw SQL. - if ( $this->hasRawSQL( $pk ) ) { - throw new \MWException( "Raw SQL found in PK" ); - } + $pk = $this->preprocessSqlArray( $pk ); $dbw = $this->dbFactory->getDB( DB_MASTER ); - $res = $dbw->delete( $this->table, UUID::convertUUIDs( $pk ), __METHOD__ . " ({$this->table})" ); + $res = $dbw->delete( $this->table, $pk, __METHOD__ . " ({$this->table})" ); return $res && $dbw->affectedRows(); } @@ -699,16 +692,12 @@ wfDebug( " -- $key = $value\n" ); } - // Only allow the row to include key/value pairs. - // No raw SQL. - if ( $this->hasRawSQL( $attributes ) ) { - throw new \MWException( "Raw SQL found in select condition" ); - } + $attributes = $this->preprocessSqlArray( $attributes ); $res = $this->dbFactory->getDB( DB_MASTER )->select( $this->table, '*', - UUID::convertUUIDs( $attributes ), + $attributes, __METHOD__ . " ({$this->table})", $options ); @@ -753,6 +742,33 @@ } /** +* At the moment, does three things: +* 1. Finds UUID objects and returns their database representation. +* 2. Checks for unarmoured raw SQL and errors out if it exists. +* 3. Finds armoured raw SQL and expands it out. +* @param [type] $data [description] +* @return [type] [description] +*/ + protected function preprocessSqlArray( $data ) { + // Assuming that all databases have the same escaping settings. + $db = $this->dbFactory->getDB( DB_SLAVE ); + + $data = UUID::convertUUIDs( $data ); + + foreach( $data as $key => $value ) { + if ( $value instanceof RawSql ) { + $data[$key] = $value->getSql( $db ); + } elseif ( is_numeric( $key ) ) { + throw new \MWException( "Unescaped raw SQL found in " . __METHOD__ ); + } elseif ( ! preg_match( '/^[A-Za-z0-9\._]+$/', $key ) ) { +
[MediaWiki-commits] [Gerrit] [WIP] Converted jobs to use BacklinkJobUtils - change (mediawiki...Parsoid)
Aaron Schulz has uploaded a new change for review. https://gerrit.wikimedia.org/r/99033 Change subject: [WIP] Converted jobs to use BacklinkJobUtils .. [WIP] Converted jobs to use BacklinkJobUtils Change-Id: I5d5af179c342c7246055a114718eed29abc07ee0 --- M php/Parsoid.hooks.php M php/ParsoidCacheUpdateJob.php 2 files changed, 81 insertions(+), 203 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Parsoid refs/changes/33/99033/1 diff --git a/php/Parsoid.hooks.php b/php/Parsoid.hooks.php index 5ddadbb..1d5bba7 100644 --- a/php/Parsoid.hooks.php +++ b/php/Parsoid.hooks.php @@ -18,6 +18,7 @@ $params = array( 'type' => $type ); if ( $type == 'OnDependencyChange' ) { $params['table'] = $table; + $params['recursive'] = true; return $params + Job::newRootJobParams( "ParsoidCacheUpdateJob{$type}:{$title->getPrefixedText()}"); } else { diff --git a/php/ParsoidCacheUpdateJob.php b/php/ParsoidCacheUpdateJob.php index 7d7c73c..bce144c 100644 --- a/php/ParsoidCacheUpdateJob.php +++ b/php/ParsoidCacheUpdateJob.php @@ -2,37 +2,25 @@ /** * HTML cache refreshing and -invalidation job for the Parsoid varnish caches. + * + * This job comes in a few variants: + * - a) Recursive jobs to purge caches for backlink pages for a given title. + *They have have (type:OnDependencyChange,recursive:true,table:) set. + * - b) Jobs to purge caches for a set of titles (the job title is ignored). + * They have have (type:OnDependencyChange,pages:(:(,),...) set. + * - c) Jobs to purge caches for a single page (the job title) + *They have (type:OnEdit) set. + * * See * http://www.mediawiki.org/wiki/Parsoid/Minimal_performance_strategy_for_July_release - * @TODO: This is mostly a copy of the HTMLCacheUpdate code. Eventually extend - * some generic backlink job base class in core */ class ParsoidCacheUpdateJob extends Job { - /** @var BacklinkCache */ - protected $blCache; - - protected $rowsPerJob; - - /** -* Construct a job -* @param $title Title: the title linked to -* @param array $params job parameters (table, start and end page_ids) -* @param $id Integer: job id -*/ function __construct( $title, $params, $id = 0 ) { - wfDebug( "ParsoidCacheUpdateJob.__construct " . $title . "\n" ); - global $wgParsoidCacheUpdateTitlesPerJob; - // Map old jobs to new 'OnEdit' jobs - if ( ! isset( $params['type'] ) ) { - $params['type'] = 'OnEdit'; + if ( !isset( $params['type'] ) ) { + $params['type'] = 'OnEdit'; // b/c } - parent::__construct( 'ParsoidCacheUpdateJob' . $params['type'], - $title, $params, $id ); - - $this->rowsPerJob = $wgParsoidCacheUpdateTitlesPerJob; - - $this->blCache = $title->getBacklinkCache(); + parent::__construct( 'ParsoidCacheUpdateJob' . $params['type'], $title, $params, $id ); if ( $params['type'] == 'OnEdit' ) { // Simple duplicate removal for single-title jobs. Other jobs are @@ -41,162 +29,74 @@ } } - public function run() { - if ( isset( $this->params['table'] ) ) { - if ( isset( $this->params['start'] ) && isset( $this->params['end'] ) ) { - # This is a child job working on a sub-range of a large number of - # titles. - return $this->doPartialUpdate(); - } else { - # Update all pages depending on this resource (transclusion or - # file) - return $this->doFullUpdate(); + function run() { + global $wgParsoidCacheUpdateTitlesPerJob, $wgUpdateRowsPerJob, $wgMaxBacklinksInvalidate; + + if ( $this->params['type'] === 'OnEdit' ) { + $this->invalidateTitle( $this->title ); + } elseif ( $this->params['type'] === 'OnDependencyChange' ) { + static $expected = array( 'recursive', 'pages' ); // new jobs have one of these + + $oldRangeJob = false; + if ( !array_intersect( array_keys( $this->params ), $expected ) ) { + // B/C for older job params formats that lack these fields: + // a) base jobs with just ("table") and b) range jobs with ("table","start","end") + if ( isset( $this->params['start'] ) && isset( $this->params['
[MediaWiki-commits] [Gerrit] Abstract out DbStorage superclass from BasicDbStorage and Re... - change (mediawiki...Flow)
Werdna has uploaded a new change for review. https://gerrit.wikimedia.org/r/99035 Change subject: Abstract out DbStorage superclass from BasicDbStorage and RevisionStorage. .. Abstract out DbStorage superclass from BasicDbStorage and RevisionStorage. Also make sure that RevisionStorage has the security improvements from 64bf13a Change-Id: Ia00a6f96f3ac23085f43b5f6bfc8bae88b8e21b0 --- M Flow.php M includes/Data/ObjectManager.php M includes/Data/RevisionStorage.php 3 files changed, 81 insertions(+), 65 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow refs/changes/35/99035/1 diff --git a/Flow.php b/Flow.php index 20d349c..a39f6e7 100755 --- a/Flow.php +++ b/Flow.php @@ -104,6 +104,7 @@ $wgAutoloadClasses['Flow\Data\BoardHistoryStorage'] = $dir . 'includes/Data/BoardHistoryStorage.php'; $wgAutoloadClasses['Flow\Data\BoardHistoryIndex'] = $dir . 'includes/Data/BoardHistoryStorage.php'; $wgAutoloadClasses['Flow\Data\ObjectStorage'] = $dir . 'includes/Data/ObjectManager.php'; +$wgAutoloadClasses['Flow\Data\DbStorage'] = $dir . 'includes/Data/ObjectManager.php'; $wgAutoloadClasses['Flow\Data\BasicDbStorage'] = $dir . 'includes/Data/ObjectManager.php'; $wgAutoloadClasses['Flow\Data\ObjectMapper'] = $dir . 'includes/Data/ObjectManager.php'; $wgAutoloadClasses['Flow\Data\BasicObjectMapper'] = $dir . 'includes/Data/ObjectManager.php'; @@ -119,6 +120,7 @@ $wgAutoloadClasses['Flow\Data\PostRevisionRecentChanges'] = $dir . 'includes/Data/RecentChanges.php'; $wgAutoloadClasses['Flow\Data\HeaderRecentChanges'] = $dir . 'includes/Data/RecentChanges.php'; $wgAutoloadClasses['Flow\Data\Merger'] = $dir . 'includes/Data/RevisionStorage.php'; +$wgAutoloadClasses['Flow\Data\RawSql'] = $dir . 'includes/Data/ObjectManager.php'; $wgAutoloadClasses['Flow\RecentChanges\Formatter'] = $dir . 'includes/RecentChanges/Formatter.php'; $wgAutoloadClasses['Flow\Log\Logger'] = $dir . 'includes/Log/Logger.php'; $wgAutoloadClasses['Flow\Log\Formatter'] = $dir . 'includes/Log/Formatter.php'; diff --git a/includes/Data/ObjectManager.php b/includes/Data/ObjectManager.php index d42360d..f38ab68 100644 --- a/includes/Data/ObjectManager.php +++ b/includes/Data/ObjectManager.php @@ -602,18 +602,87 @@ } /** + * Base class for all WritableObjectStorage implementers + * which use a database as the backing store. + * + * Includes some utility methods for database management and + * SQL security. + */ +abstract class DbStorage implements WritableObjectStorage { + protected $dbFactory; + + public function __construct( DbFactory $dbFactory ) { + $this->dbFactory = $dbFactory; + } + + /** +* At the moment, does three things: +* 1. Finds UUID objects and returns their database representation. +* 2. Checks for unarmoured raw SQL and errors out if it exists. +* 3. Finds armoured raw SQL and expands it out. +* @param [type] $data [description] +* @return [type] [description] +*/ + protected function preprocessSqlArray( $data ) { + // Assuming that all databases have the same escaping settings. + $db = $this->dbFactory->getDB( DB_SLAVE ); + + $data = UUID::convertUUIDs( $data ); + + foreach( $data as $key => $value ) { + if ( $value instanceof RawSql ) { + $data[$key] = $value->getSql( $db ); + } elseif ( is_numeric( $key ) ) { + throw new \MWException( "Unescaped raw SQL found in " . __METHOD__ ); + } elseif ( ! preg_match( '/^[A-Za-z0-9\._]+$/', $key ) ) { + throw new \MWException( "Dangerous SQL field name '$key' found in " . __METHOD__ ); + } + } + + return $data; + } + + /** +* Internal security function which checks a row object +* (for inclusion as a condition or a row for insert/update) +* for any numeric keys (= raw SQL), or field names with +* potentially unsafe characters. +* @param array $row The row to check. +* @return boolean True if raw SQL is found +*/ + protected function hasUnescapedSQL( array $row ) { + foreach( $row as $key => $value ) { + if ( $value instanceof RawSql ) { + // Specifically allowed SQL + continue; + } + + if ( is_numeric( $key ) ) { + return true; + } + + if ( ! preg_match( '/^[A-Za-z0-9\._]+$/', $key ) ) { + return true; + } + } + + return false; +
[MediaWiki-commits] [Gerrit] Graphite: use package's default storage dir - change (operations/puppet)
Ori.livneh has submitted this change and it was merged. Change subject: Graphite: use package's default storage dir .. Graphite: use package's default storage dir I was trying to mirror the directory structure used by the debian package in If563923aa but mistakenly set the storage dir to /var/lib/graphite rather than /var/lib/carbon. Change-Id: I0a777bda1fb4baca23315ceada0adb600267fb69 --- M modules/graphite/manifests/init.pp 1 file changed, 4 insertions(+), 4 deletions(-) Approvals: Ori.livneh: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/graphite/manifests/init.pp b/modules/graphite/manifests/init.pp index a4b28f5..ca93a99 100644 --- a/modules/graphite/manifests/init.pp +++ b/modules/graphite/manifests/init.pp @@ -21,9 +21,9 @@ conf_dir => '/etc/carbon', log_dir=> '/var/log/carbon', pid_dir=> '/var/run/carbon', -storage_dir=> '/var/lib/graphite', -whitelists_dir => '/var/lib/graphite/lists', -local_data_dir => '/var/lib/graphite/whisper', +storage_dir=> '/var/lib/carbon', +whitelists_dir => '/var/lib/carbon/lists', +local_data_dir => '/var/lib/carbon/whisper', } $carbon_defaults = { @@ -35,7 +35,7 @@ source => 'puppet:///modules/graphite/graphite.limits.conf', } -file { '/var/lib/graphite': +file { '/var/lib/carbon': ensure => directory, owner => '_graphite', group => '_graphite', -- To view, visit https://gerrit.wikimedia.org/r/99032 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0a777bda1fb4baca23315ceada0adb600267fb69 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Ori.livneh Gerrit-Reviewer: Ori.livneh Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Graphite: use package's default storage dir - change (operations/puppet)
Ori.livneh has uploaded a new change for review. https://gerrit.wikimedia.org/r/99032 Change subject: Graphite: use package's default storage dir .. Graphite: use package's default storage dir I was trying to mirror the directory structure used by the debian package in If563923aa but mistakenly set the storage dir to /var/lib/graphite rather than /var/lib/carbon. Change-Id: I0a777bda1fb4baca23315ceada0adb600267fb69 --- M modules/graphite/manifests/init.pp 1 file changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/32/99032/1 diff --git a/modules/graphite/manifests/init.pp b/modules/graphite/manifests/init.pp index a4b28f5..ca93a99 100644 --- a/modules/graphite/manifests/init.pp +++ b/modules/graphite/manifests/init.pp @@ -21,9 +21,9 @@ conf_dir => '/etc/carbon', log_dir=> '/var/log/carbon', pid_dir=> '/var/run/carbon', -storage_dir=> '/var/lib/graphite', -whitelists_dir => '/var/lib/graphite/lists', -local_data_dir => '/var/lib/graphite/whisper', +storage_dir=> '/var/lib/carbon', +whitelists_dir => '/var/lib/carbon/lists', +local_data_dir => '/var/lib/carbon/whisper', } $carbon_defaults = { @@ -35,7 +35,7 @@ source => 'puppet:///modules/graphite/graphite.limits.conf', } -file { '/var/lib/graphite': +file { '/var/lib/carbon': ensure => directory, owner => '_graphite', group => '_graphite', -- To view, visit https://gerrit.wikimedia.org/r/99032 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0a777bda1fb4baca23315ceada0adb600267fb69 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Ori.livneh ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Make explicit plural forms work for Russian - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: Make explicit plural forms work for Russian .. Make explicit plural forms work for Russian Russian has overridden convertPlural method, that was not taking care of explicit plural forms. Follow up: I2a9f93567087babb896999f1214d3c56afc67c96 Bug: 54514 Change-Id: Ia977fa544b1d0e40222c7296b7145dcd6f93ecc2 --- M languages/classes/LanguageRu.php M tests/phpunit/languages/LanguageRuTest.php 2 files changed, 15 insertions(+), 0 deletions(-) Approvals: Nikerabbit: Looks good to me, approved jenkins-bot: Verified diff --git a/languages/classes/LanguageRu.php b/languages/classes/LanguageRu.php index 11b42cf..243a876 100644 --- a/languages/classes/LanguageRu.php +++ b/languages/classes/LanguageRu.php @@ -122,6 +122,10 @@ * @return string */ function convertPlural( $count, $forms ) { + $forms = $this->handleExplicitPluralForms( $count, $forms ); + if ( is_string( $forms ) ) { + return $forms; + } if ( !count( $forms ) ) { return ''; } diff --git a/tests/phpunit/languages/LanguageRuTest.php b/tests/phpunit/languages/LanguageRuTest.php index e938be7..56f8490 100644 --- a/tests/phpunit/languages/LanguageRuTest.php +++ b/tests/phpunit/languages/LanguageRuTest.php @@ -18,6 +18,17 @@ } /** +* Test explicit plural forms - n=FormN forms +* @covers Language::convertPlural +*/ + public function testExplicitPlural() { + $forms = array( 'one', 'few', 'many', 'other', '12=dozen' ); + $this->assertEquals( 'dozen', $this->getLang()->convertPlural( 12, $forms ) ); + $forms = array( 'one', 'few', 'many', '100=hundred', 'other', '12=dozen' ); + $this->assertEquals( 'hundred', $this->getLang()->convertPlural( 100, $forms ) ); + } + + /** * @dataProvider providePlural * @covers Language::getPluralRuleType */ -- To view, visit https://gerrit.wikimedia.org/r/99029 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia977fa544b1d0e40222c7296b7145dcd6f93ecc2 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Santhosh Gerrit-Reviewer: Amire80 Gerrit-Reviewer: Nikerabbit Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Added "git-update" command - change (mediawiki/vagrant)
jenkins-bot has submitted this change and it was merged. Change subject: Added "git-update" command .. Added "git-update" command Change-Id: I120f940cb282a4ad37c75b6025a5527a5be9d332 --- M lib/mediawiki-vagrant.rb A lib/mediawiki-vagrant/git-update.rb A puppet/modules/mediawiki/files/run-git-update M puppet/modules/mediawiki/manifests/init.pp 4 files changed, 57 insertions(+), 0 deletions(-) Approvals: Ori.livneh: Looks good to me, approved jenkins-bot: Verified diff --git a/lib/mediawiki-vagrant.rb b/lib/mediawiki-vagrant.rb index c205cde..b986da6 100644 --- a/lib/mediawiki-vagrant.rb +++ b/lib/mediawiki-vagrant.rb @@ -14,6 +14,11 @@ RunTests end +command 'git-update' do +require 'mediawiki-vagrant/git-update' +GitUpdates +end + command 'list-roles' do require 'mediawiki-vagrant/roles' ListRoles diff --git a/lib/mediawiki-vagrant/git-update.rb b/lib/mediawiki-vagrant/git-update.rb new file mode 100644 index 000..78443ca --- /dev/null +++ b/lib/mediawiki-vagrant/git-update.rb @@ -0,0 +1,13 @@ +class GitUpdates < Vagrant.plugin(2, :command) +def execute +if %w(-h --help).include? @argv.first +@env.ui.info 'Usage: vagrant git-update [-h]' +return 0 +end + +with_target_vms(nil, :single_target => true) do |vm| +opts = { :extra_args => @argv.unshift('run-git-update') } +vm.action :ssh, :ssh_opts => opts +end +end +end diff --git a/puppet/modules/mediawiki/files/run-git-update b/puppet/modules/mediawiki/files/run-git-update new file mode 100644 index 000..e916f9f --- /dev/null +++ b/puppet/modules/mediawiki/files/run-git-update @@ -0,0 +1,34 @@ +#!/bin/bash +. /etc/profile.d/puppet-managed/set_mw_install_path.sh + +function pull { + echo + branch=$(expr $(git symbolic-ref HEAD) : 'refs/heads/\(.*\)') + if [ -n "$branch" ]; then +remote=$(git config branch.$branch.remote) +if [ -n "$remote" ]; then +# Convert remote git url from ssh:// to anonymous https:// +url=$(git config --get remote.$remote.url | sed -e 's!ssh://[^@]\+@!https://!g' -e 's!:29418!/r!g') +git pull $url +else +echo -e "\e[1;31m * Remote not found for branch '$branch' in $(pwd)\e[0m" +fi + else +echo -e "\e[1;31m * Unable to get current branch in $(pwd)\e[0m" + fi +} + + +cd "$MW_INSTALL_PATH" +pull + +for f in extensions/* +do + if [[ -d $f ]]; then + pushd $f > /dev/null + pull + popd > /dev/null + fi +done + +php maintenance/update.php --quick diff --git a/puppet/modules/mediawiki/manifests/init.pp b/puppet/modules/mediawiki/manifests/init.pp index f272b4e..2274965 100644 --- a/puppet/modules/mediawiki/manifests/init.pp +++ b/puppet/modules/mediawiki/manifests/init.pp @@ -146,6 +146,11 @@ require => Exec['configure phpunit'], } +file { '/usr/local/bin/run-git-update': +source => 'puppet:///modules/mediawiki/run-git-update', +mode=> '0755', +} + exec { 'update database': command => "php ${dir}/maintenance/update.php --quick", refreshonly => true, -- To view, visit https://gerrit.wikimedia.org/r/98033 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I120f940cb282a4ad37c75b6025a5527a5be9d332 Gerrit-PatchSet: 3 Gerrit-Project: mediawiki/vagrant Gerrit-Branch: master Gerrit-Owner: Yurik Gerrit-Reviewer: Ori.livneh Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Use __name__ instead of func_name - change (pywikibot/core)
jenkins-bot has submitted this change and it was merged. Change subject: Use __name__ instead of func_name .. Use __name__ instead of func_name Change-Id: If27e0997a1bdfe5d7fc16b77875927acd0839437 --- M pywikibot/__init__.py 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified diff --git a/pywikibot/__init__.py b/pywikibot/__init__.py index a348be5..6bcf4ac 100644 --- a/pywikibot/__init__.py +++ b/pywikibot/__init__.py @@ -310,7 +310,7 @@ else: warning(u"%s.%s is DEPRECATED." % (classname, funcname)) return method(*args, **kwargs) -wrapper.func_name = method.func_name +wrapper.__name__ = method.__name__ return wrapper return decorator -- To view, visit https://gerrit.wikimedia.org/r/98386 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: If27e0997a1bdfe5d7fc16b77875927acd0839437 Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: Merlijn van Deen Gerrit-Reviewer: Ladsgroup Gerrit-Reviewer: Xqt Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] (Bug 57726) add variant unicode string, not a list - change (pywikibot/compat)
Xqt has submitted this change and it was merged. Change subject: (Bug 57726) add variant unicode string, not a list .. (Bug 57726) add variant unicode string, not a list Synchronize with core Change-Id: I18336f11bae2537634b9392ce79936af797d9492 --- M pywikibot/textlib.py 1 file changed, 12 insertions(+), 12 deletions(-) Approvals: Xqt: Looks good to me, approved diff --git a/pywikibot/textlib.py b/pywikibot/textlib.py index ee84235..66b3cf9 100644 --- a/pywikibot/textlib.py +++ b/pywikibot/textlib.py @@ -92,9 +92,9 @@ # Module invocations (currently only Lua) 'invoke': re.compile(r'(?i)\{\{\s*#invoke:.*?}\}'), # categories -'category': re.compile(ur'\[\[ *(?:%s)\s*:.*?\]\]' % ur'|'.join(site.namespace(14, all=True))), +'category': re.compile(u'\[\[ *(?:%s)\s*:.*?\]\]' % u'|'.join(site.namespace(14, all=True))), #files -'file': re.compile(ur'\[\[ *(?:%s)\s*:.*?\]\]' % ur'|'.join(site.namespace(6, all=True))), +'file': re.compile(u'\[\[ *(?:%s)\s*:.*?\]\]' % u'|'.join(site.namespace(6, all=True))), } @@ -227,8 +227,8 @@ match.group(groupID) + \ replacement[groupMatch.end():]) except IndexError: -print '\nInvalid group reference:', groupID -print 'Groups found:\n', match.groups() +pywikibot.output('\nInvalid group reference: %s' % groupID) +pywikibot.output('Groups found:\n%s' % match.groups()) raise IndexError text = text[:match.start()] + replacement + text[match.end():] @@ -516,9 +516,9 @@ u'' in oldtext: #do not add separator if interwiki links are on one line newtext = (s + - [u'' -if site.language() in site.family.interwiki_on_one_line -else separator] + + u'' + if site.language() in site.family.interwiki_on_one_line + else separator + s2.replace(marker, '').strip()) else: # calculate what was after the language links on the page @@ -928,12 +928,12 @@ marker4 = findmarker(thistxt, u'§§', u'§') result = [] -Rmath = re.compile(ur'[^<]+') +Rmath = re.compile(r'[^<]+') Rvalue = re.compile(r'{{{.+?}}}') -Rmarker1 = re.compile(ur'%s(\d+)%s' % (marker1, marker1)) -Rmarker2 = re.compile(ur'%s(\d+)%s' % (marker2, marker2)) -Rmarker3 = re.compile(ur'%s(\d+)%s' % (marker3, marker3)) -Rmarker4 = re.compile(ur'%s(\d+)%s' % (marker4, marker4)) +Rmarker1 = re.compile(r'%s(\d+)%s' % (marker1, marker1)) +Rmarker2 = re.compile(r'%s(\d+)%s' % (marker2, marker2)) +Rmarker3 = re.compile(r'%s(\d+)%s' % (marker3, marker3)) +Rmarker4 = re.compile(r'%s(\d+)%s' % (marker4, marker4)) # Replace math with markers maths = {} -- To view, visit https://gerrit.wikimedia.org/r/98374 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I18336f11bae2537634b9392ce79936af797d9492 Gerrit-PatchSet: 2 Gerrit-Project: pywikibot/compat Gerrit-Branch: master Gerrit-Owner: Xqt Gerrit-Reviewer: Ladsgroup Gerrit-Reviewer: Xqt Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Attributes, if present, should be preceded by a space - change (mediawiki...Parsoid)
Arlolra has uploaded a new change for review. https://gerrit.wikimedia.org/r/99031 Change subject: Attributes, if present, should be preceded by a space .. Attributes, if present, should be preceded by a space Introduced in 070efb2f96e8a4a1424f9cbf07188b049327b735. Bug: 57650 Change-Id: Ic2601249b55db448a421436ec59da23cd60fbaf3 --- M js/lib/pegTokenizer.pegjs.txt M js/tests/parserTests.txt 2 files changed, 9 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Parsoid refs/changes/31/99031/1 diff --git a/js/lib/pegTokenizer.pegjs.txt b/js/lib/pegTokenizer.pegjs.txt index e2cb604..759bd82 100644 --- a/js/lib/pegTokenizer.pegjs.txt +++ b/js/lib/pegTokenizer.pegjs.txt @@ -683,7 +683,7 @@ return null !== pegArgs.pegTokenizer.inline_breaks( input, pos, stops ); } -pre_start = "<" pre_tag_name (' '* [^>]*)? ">" +pre_start = "<" pre_tag_name (' '+ [^>]*)? ">" inline = c:(urltext / (! inline_breaks !pre_start (inline_element / . )))+ { diff --git a/js/tests/parserTests.txt b/js/tests/parserTests.txt index fa06361..0acf4b5 100644 --- a/js/tests/parserTests.txt +++ b/js/tests/parserTests.txt @@ -1764,6 +1764,14 @@ !!end +!! test +Things that look like tags aren't treated as such +!! input +Barack Obama of the United States +!! result +Barack Obamaof the United States +!! end + # TODO / maybe: fix wt2wt for this !! test Parsoid: Don't paragraph-wrap fosterable content -- To view, visit https://gerrit.wikimedia.org/r/99031 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic2601249b55db448a421436ec59da23cd60fbaf3 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Parsoid Gerrit-Branch: master Gerrit-Owner: Arlolra ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] nomcom is dead. - change (operations/mediawiki-config)
MZMcBride has uploaded a new change for review. https://gerrit.wikimedia.org/r/99030 Change subject: nomcom is dead. .. nomcom is dead. Change-Id: I53d80afe6000994577e4d192815d534690371cce --- M wmf-config/InitialiseSettings.php 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/30/99030/1 diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index 70ca14f..c538114 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -1256,7 +1256,6 @@ 'movementroleswiki' => 'https://movementroles.wikimedia.org', 'mxwikimedia' => 'http://mx.wikimedia.org', 'noboard_chapterswikimedia' => 'http://noboard.chapters.wikimedia.org', - 'nomcomwiki' => 'https://nomcom.wikimedia.org', 'nycwikimedia' => 'http://nyc.wikimedia.org', // bug 29273 'officewiki' => 'https://office.wikimedia.org', 'ombudsmenwiki' => 'https://ombudsmen.wikimedia.org', -- To view, visit https://gerrit.wikimedia.org/r/99030 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I53d80afe6000994577e4d192815d534690371cce Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: MZMcBride ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add a bit of output to makeSimpleList.php - change (mediawiki...SecurePoll)
jenkins-bot has submitted this change and it was merged. Change subject: Add a bit of output to makeSimpleList.php .. Add a bit of output to makeSimpleList.php Change-Id: I8c0df54129fd57effeedb01dc4dd31fc2325414a --- M cli/makeSimpleList.php 1 file changed, 8 insertions(+), 1 deletion(-) Approvals: Tim Starling: Looks good to me, approved jenkins-bot: Verified diff --git a/cli/makeSimpleList.php b/cli/makeSimpleList.php index c40cd73..5f66c26 100644 --- a/cli/makeSimpleList.php +++ b/cli/makeSimpleList.php @@ -35,11 +35,13 @@ } } +$total = 0; while ( true ) { $res = $dbr->select( 'user', 'user_id', array( 'user_id > ' . $dbr->addQuotes( $startBatch ) ), $fname, - array( 'LIMIT' => $batchSize ) ); + array( 'LIMIT' => $batchSize ) + ); if ( !$res->numRows() ) { break; @@ -65,6 +67,11 @@ } } if ( $insertBatch ) { + $count = count( $insertBatch ); + $total += $count; + echo "$count rows inserted, total $total rows"; $dbw->insert( 'securepoll_lists', $insertBatch, $fname ); } } + +echo "Done!\n"; -- To view, visit https://gerrit.wikimedia.org/r/96374 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8c0df54129fd57effeedb01dc4dd31fc2325414a Gerrit-PatchSet: 3 Gerrit-Project: mediawiki/extensions/SecurePoll Gerrit-Branch: master Gerrit-Owner: Reedy Gerrit-Reviewer: Hoo man Gerrit-Reviewer: Tim Starling Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Make explicit plural forms work for Russian - change (mediawiki/core)
Santhosh has uploaded a new change for review. https://gerrit.wikimedia.org/r/99029 Change subject: Make explicit plural forms work for Russian .. Make explicit plural forms work for Russian Russian has overridden convertPlural method, that was not taking care of explicit plural forms. Follow up: I2a9f93567087babb896999f1214d3c56afc67c96 Bug: 54514 Change-Id: Ia977fa544b1d0e40222c7296b7145dcd6f93ecc2 --- M languages/classes/LanguageRu.php M tests/phpunit/languages/LanguageRuTest.php 2 files changed, 15 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/29/99029/1 diff --git a/languages/classes/LanguageRu.php b/languages/classes/LanguageRu.php index 11b42cf..243a876 100644 --- a/languages/classes/LanguageRu.php +++ b/languages/classes/LanguageRu.php @@ -122,6 +122,10 @@ * @return string */ function convertPlural( $count, $forms ) { + $forms = $this->handleExplicitPluralForms( $count, $forms ); + if ( is_string( $forms ) ) { + return $forms; + } if ( !count( $forms ) ) { return ''; } diff --git a/tests/phpunit/languages/LanguageRuTest.php b/tests/phpunit/languages/LanguageRuTest.php index e938be7..56f8490 100644 --- a/tests/phpunit/languages/LanguageRuTest.php +++ b/tests/phpunit/languages/LanguageRuTest.php @@ -18,6 +18,17 @@ } /** +* Test explicit plural forms - n=FormN forms +* @covers Language::convertPlural +*/ + public function testExplicitPlural() { + $forms = array( 'one', 'few', 'many', 'other', '12=dozen' ); + $this->assertEquals( 'dozen', $this->getLang()->convertPlural( 12, $forms ) ); + $forms = array( 'one', 'few', 'many', '100=hundred', 'other', '12=dozen' ); + $this->assertEquals( 'hundred', $this->getLang()->convertPlural( 100, $forms ) ); + } + + /** * @dataProvider providePlural * @covers Language::getPluralRuleType */ -- To view, visit https://gerrit.wikimedia.org/r/99029 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia977fa544b1d0e40222c7296b7145dcd6f93ecc2 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Santhosh ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Corrected comment for FlaggedRevs deployment - change (operations/mediawiki-config)
Yurik has uploaded a new change for review. https://gerrit.wikimedia.org/r/99028 Change subject: Corrected comment for FlaggedRevs deployment .. Corrected comment for FlaggedRevs deployment Per Aaron's comments on IRC Change-Id: I93e696fabf43ba4f2bf101e60d45719fc5c61261 --- M wmf-config/InitialiseSettings.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/28/99028/1 diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index 70ca14f..e3a2aba 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -10135,7 +10135,7 @@ 'default' => false, # To update this dblist: # * ADD THE TABLES TO THE DATABASE - # e.g.mwscript sql.php ruwikinews php-1.18/extensions/FlaggedRevs/schema/mysql/FlaggedRevs.sql + # mwscript sql.php ruwikinews extensions/FlaggedRevs/schema/mysql/FlaggedRevs.sql # * edit flaggedrevs.dblist (or the corresponding file for the current realm) # * touch InitialiseSettings.php to invalidate the cache # * sync-common-all -- To view, visit https://gerrit.wikimedia.org/r/99028 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I93e696fabf43ba4f2bf101e60d45719fc5c61261 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Yurik ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Switch www portals to using one docroot - change (operations/apache-config)
Tim Starling has submitted this change and it was merged. Change subject: Switch www portals to using one docroot .. Switch www portals to using one docroot Change-Id: I730ec0bf8c388cada17b46497d87146f1e4ded1a --- M wikimedia.conf M wwwportals.conf 2 files changed, 10 insertions(+), 14 deletions(-) Approvals: Tim Starling: Looks good to me, approved jenkins-bot: Verified diff --git a/wikimedia.conf b/wikimedia.conf index fe89091..5c5ea5f 100644 --- a/wikimedia.conf +++ b/wikimedia.conf @@ -212,10 +212,9 @@ # wikimedia.org -#DocumentRoot "/usr/local/apache/htdocs/wikimedia" -DocumentRoot "/usr/local/apache/common/docroot/www.wikimedia.org" +DocumentRoot "/usr/local/apache/common/docroot/wwwportal" ServerName www.wikimedia.org -ServerAlias *.wikimedia.org +ServerAlias *.wikimedia.org # FIXME: Should this still be here? # Main page portal RewriteRule ^/$ /w/extract2.php?title=Www.wikimedia.org_portal&template=Www.wikimedia.org_template [L] @@ -232,7 +231,7 @@ RewriteEngine On RewriteRule ^/wiki/(.*)$ http://wikimediafoundation.org/wiki/$1 [R=301,L] - + php_admin_flag engine on diff --git a/wwwportals.conf b/wwwportals.conf index 61c97a7..c75e0ba 100644 --- a/wwwportals.conf +++ b/wwwportals.conf @@ -8,7 +8,7 @@ -DocumentRoot "/usr/local/apache/common/docroot/www.wikipedia.org" +DocumentRoot /usr/local/apache/common/docroot/wwwportal ServerName www.wikipedia.org RewriteEngine On @@ -27,7 +27,6 @@ RewriteRule ^/(upload|wiki|stats|w)/(.*)$ http://en.wikipedia.org/$1/$2 [R=301,L] RewriteRule ^/wiki$ http://en.wikipedia.org/ [R=301,L] - # Mailing lists... RewriteRule ^/(mailman|pipermail)(.*)$ http://mail.wikipedia.org/$1$2 [R=301,L] @@ -40,7 +39,6 @@ RewriteRule ^(.*)$ http://en.wikipedia.org$1 [R=301,L] php_admin_flag engine on - @@ -64,7 +62,7 @@ ServerName www.wiktionary.org -DocumentRoot /usr/local/apache/common/docroot/www.wiktionary.org +DocumentRoot /usr/local/apache/common/docroot/wwwportal php_admin_flag engine on RewriteEngine On @@ -87,7 +85,7 @@ ServerName www.wikinews.org -DocumentRoot /usr/local/apache/common/docroot/www.wikinews.org +DocumentRoot /usr/local/apache/common/docroot/wwwportal php_admin_flag engine on RewriteEngine On @@ -110,7 +108,7 @@ ServerName www.wikiquote.org -DocumentRoot /usr/local/apache/common/docroot/www.wikiquote.org +DocumentRoot /usr/local/apache/common/docroot/wwwportal php_admin_flag engine on RewriteEngine On @@ -129,7 +127,7 @@ ServerName www.wikiversity.org ServerAlias wikiversity.org -DocumentRoot /usr/local/apache/common/docroot/www.wikiversity.org +DocumentRoot /usr/local/apache/common/docroot/wwwportal php_admin_flag engine on RewriteEngine On @@ -144,7 +142,6 @@ RewriteRule ^(.*)$ http://en.wikiversity.org$1 [R=301,L] - ServerName wikibooks.org Redirect permanent / http://www.wikibooks.org/ @@ -153,7 +150,7 @@ ServerName www.wikibooks.org -DocumentRoot /usr/local/apache/common/docroot/www.wikibooks.org +DocumentRoot /usr/local/apache/common/docroot/wwwportal php_admin_flag engine on RewriteEngine On @@ -176,7 +173,7 @@ ServerName www.wikivoyage.org -DocumentRoot /usr/local/apache/common/docroot/www.wikivoyage.org +DocumentRoot /usr/local/apache/common/docroot/wwwportal php_admin_flag engine on RewriteEngine On -- To view, visit https://gerrit.wikimedia.org/r/91209 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I730ec0bf8c388cada17b46497d87146f1e4ded1a Gerrit-PatchSet: 3 Gerrit-Project: operations/apache-config Gerrit-Branch: master Gerrit-Owner: Reedy Gerrit-Reviewer: ArielGlenn Gerrit-Reviewer: Dzahn Gerrit-Reviewer: Faidon Liambotis Gerrit-Reviewer: Reedy Gerrit-Reviewer: Tim Starling Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Bug 57624: proper js resource loading in zero - change (mediawiki...ZeroRatedMobileAccess)
Yurik has uploaded a new change for review. https://gerrit.wikimedia.org/r/99027 Change subject: Bug 57624: proper js resource loading in zero .. Bug 57624: proper js resource loading in zero * Merged mobile.zero.templates & mobile.zero.scripts into mobile.zero * Added dependency on mobile.templates TBD: should mobile.zero.styles be merged into it as well? Or do we still require $out->addModuleStyles() call for styles-only, followed by addModules() for the rest. Change-Id: Ia880e778467e4b7277ed8564dfd37add56137ff6 --- M ZeroRatedMobileAccess.php M includes/PageRenderingHooks.php 2 files changed, 4 insertions(+), 8 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ZeroRatedMobileAccess refs/changes/27/99027/1 diff --git a/ZeroRatedMobileAccess.php b/ZeroRatedMobileAccess.php index f0f95a5..e4646dc 100644 --- a/ZeroRatedMobileAccess.php +++ b/ZeroRatedMobileAccess.php @@ -63,17 +63,13 @@ 'styles' => array( 'modules/banner.css', 'modules/redux.less' ), ); -$wgResourceModules['mobile.zero.templates'] = array( +$wgResourceModules['mobile.zero'] = array( + 'dependencies' => array( 'mobile.stable', 'mobile.templates', 'mobile.zero.styles' ), 'localBasePath' => $localBasePath, + 'remoteExtPath' => $remoteExtPath, 'localTemplateBasePath' => $localBasePath . '/templates', 'templates' => array( 'interstitial' ), 'class' => 'MFResourceLoaderModule', -); - -$wgResourceModules['mobile.zero.scripts'] = array( - 'dependencies' => array( 'mobile.stable', 'mobile.zero.styles', 'mobile.zero.templates' ), - 'localBasePath' => $localBasePath, - 'remoteExtPath' => $remoteExtPath, 'targets' => array( 'mobile' ), 'scripts' => array( 'modules/ZeroOverlay.js', 'modules/banner.js', 'modules/interstitial.js' ), 'messages' => array( diff --git a/includes/PageRenderingHooks.php b/includes/PageRenderingHooks.php index e00bbed..6802595 100644 --- a/includes/PageRenderingHooks.php +++ b/includes/PageRenderingHooks.php @@ -357,7 +357,7 @@ if ( $this->getConfig() !== null || $this->isZeroSubdomain ) { $out->addModuleStyles( 'mobile.zero.styles' ); - $out->addModules( 'mobile.zero.scripts' ); + $out->addModules( 'mobile.zero' ); } $out->addVaryHeader( 'X-CS' ); -- To view, visit https://gerrit.wikimedia.org/r/99027 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia880e778467e4b7277ed8564dfd37add56137ff6 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/ZeroRatedMobileAccess Gerrit-Branch: master Gerrit-Owner: Yurik Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] secure.wikimedia.org ErrorDocument - change (operations/apache-config)
Tim Starling has uploaded a new change for review. https://gerrit.wikimedia.org/r/99026 Change subject: secure.wikimedia.org ErrorDocument .. secure.wikimedia.org ErrorDocument Its DocumentRoot does not have a /w, so the default ErrorDocument of /w/404.php does not work. I added 404.html in Id5b4f431. Change-Id: Ib5749e1fa33de38592fc2f6edeed24cf05f7749c --- M secure.wikimedia.conf 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/apache-config refs/changes/26/99026/1 diff --git a/secure.wikimedia.conf b/secure.wikimedia.conf index a549d59..3cc6c5e 100644 --- a/secure.wikimedia.conf +++ b/secure.wikimedia.conf @@ -24,4 +24,6 @@ RewriteRule ^/wikipedia/wikidata/(.*)$ https://www.wikidata.org/$1 [R=301,L,NE] RewriteRule ^/(wikipedia|wikinews|wikisource|wikibooks|wikiquote|wikiversity|wiktionary|wikimedia)/([^@:/]+)/(.*)$ https://$2.$1.org/$3 [R=301,L,NE] + ErrorDocument 404 /404.html + -- To view, visit https://gerrit.wikimedia.org/r/99026 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib5749e1fa33de38592fc2f6edeed24cf05f7749c Gerrit-PatchSet: 1 Gerrit-Project: operations/apache-config Gerrit-Branch: master Gerrit-Owner: Tim Starling ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Titles can end with ? mark and should be serialized as wikil... - change (mediawiki...Parsoid)
Subramanya Sastry has uploaded a new change for review. https://gerrit.wikimedia.org/r/99025 Change subject: Titles can end with ? mark and should be serialized as wikilinks .. Titles can end with ? mark and should be serialized as wikilinks * Tweaked fix from f6386c8d and updated parser test as well. * Found through RT regression. Change-Id: I7d3c0da537c00ea92ec27ba19ae66c7f7446eb79 --- M js/lib/mediawiki.WikitextSerializer.js M js/tests/parserTests.txt 2 files changed, 3 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Parsoid refs/changes/25/99025/1 diff --git a/js/lib/mediawiki.WikitextSerializer.js b/js/lib/mediawiki.WikitextSerializer.js index 70530d9..8e3c33c 100644 --- a/js/lib/mediawiki.WikitextSerializer.js +++ b/js/lib/mediawiki.WikitextSerializer.js @@ -1833,7 +1833,7 @@ // 1) is not just a fragment id (#foo), and // 2) does not contain a query string. // Both are not supported by wikitext syntax. - !/^#|\?/.test(interWikiMatch[1]) && + !/^#|\?./.test(interWikiMatch[1]) && (dp.isIW || target.modified || linkData.contentModified)) { //console.log(interWikiMatch); // External link that is really an interwiki link. Convert it. diff --git a/js/tests/parserTests.txt b/js/tests/parserTests.txt index fa06361..e642daf 100644 --- a/js/tests/parserTests.txt +++ b/js/tests/parserTests.txt @@ -5525,12 +5525,14 @@ !! input [[meatball:ok]] [[meatball:ok#foo|ok with fragment]] +[[meatball:ok_as_well?|ok ending with ? mark]] [http://de.wikipedia.org/wiki/Foo?action=history has query] [http://de.wikipedia.org/wiki/#foo is just fragment] !! result http://www.usemod.com/cgi-bin/mb.pl?ok";>meatball:ok http://www.usemod.com/cgi-bin/mb.pl?ok#foo";>ok with fragment +http://www.usemod.com/cgi-bin/mb.pl?ok_as_well%3F";>ok ending with ? mark http://de.wikipedia.org/wiki/Foo?action=history";>has query http://de.wikipedia.org/wiki/#foo";>is just fragment !! end -- To view, visit https://gerrit.wikimedia.org/r/99025 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7d3c0da537c00ea92ec27ba19ae66c7f7446eb79 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Parsoid Gerrit-Branch: master Gerrit-Owner: Subramanya Sastry ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Re-add the docroot/secure directory - change (operations/mediawiki-config)
Tim Starling has uploaded a new change for review. https://gerrit.wikimedia.org/r/99024 Change subject: Re-add the docroot/secure directory .. Re-add the docroot/secure directory It is still used by the secure.wikimedia.org vhost. It was apparently deleted accidentally in I3e12805cb, when the last file in the directory was removed. Git does not preserve empty directories. I added a 404.html file which I will reference in a subsequent commit to the apache configuration. Currently, missing files give a 301 redirect to https://meta.wikimedia.org/w/404.php Change-Id: Id5b4f431da2ff6d1ecf6279be44820f2e0781227 --- A docroot/secure/404.html 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/24/99024/1 diff --git a/docroot/secure/404.html b/docroot/secure/404.html new file mode 12 index 000..c18423d --- /dev/null +++ b/docroot/secure/404.html @@ -0,0 +1 @@ +../../404.html \ No newline at end of file -- To view, visit https://gerrit.wikimedia.org/r/99024 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id5b4f431da2ff6d1ecf6279be44820f2e0781227 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Tim Starling ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fixed handling of uppercase chars in var names for #display_... - change (mediawiki...ExternalData)
Yaron Koren has submitted this change and it was merged. Change subject: Fixed handling of uppercase chars in var names for #display_external_table .. Fixed handling of uppercase chars in var names for #display_external_table Change-Id: Ie5c77793a938c539fc37453be2b8003e590f3908 --- M ED_ParserFunctions.php 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Yaron Koren: Verified; Looks good to me, approved diff --git a/ED_ParserFunctions.php b/ED_ParserFunctions.php index adfde92..d482f48 100644 --- a/ED_ParserFunctions.php +++ b/ED_ParserFunctions.php @@ -336,7 +336,7 @@ if ( array_key_exists( 'data', $args ) ) { // parse the 'data' arg into mappings - $mappings = EDUtils::paramToArray( $args['data'], false, true ); + $mappings = EDUtils::paramToArray( $args['data'], false, false ); } else { // or just use keys from edgValues foreach ( $edgValues as $local_variable => $values ) { -- To view, visit https://gerrit.wikimedia.org/r/99023 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie5c77793a938c539fc37453be2b8003e590f3908 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/ExternalData Gerrit-Branch: master Gerrit-Owner: Yaron Koren Gerrit-Reviewer: Yaron Koren ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fixed handling of uppercase chars in var names for #display_... - change (mediawiki...ExternalData)
Yaron Koren has uploaded a new change for review. https://gerrit.wikimedia.org/r/99023 Change subject: Fixed handling of uppercase chars in var names for #display_external_table .. Fixed handling of uppercase chars in var names for #display_external_table Change-Id: Ie5c77793a938c539fc37453be2b8003e590f3908 --- M ED_ParserFunctions.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ExternalData refs/changes/23/99023/1 diff --git a/ED_ParserFunctions.php b/ED_ParserFunctions.php index adfde92..d482f48 100644 --- a/ED_ParserFunctions.php +++ b/ED_ParserFunctions.php @@ -336,7 +336,7 @@ if ( array_key_exists( 'data', $args ) ) { // parse the 'data' arg into mappings - $mappings = EDUtils::paramToArray( $args['data'], false, true ); + $mappings = EDUtils::paramToArray( $args['data'], false, false ); } else { // or just use keys from edgValues foreach ( $edgValues as $local_variable => $values ) { -- To view, visit https://gerrit.wikimedia.org/r/99023 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie5c77793a938c539fc37453be2b8003e590f3908 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/ExternalData Gerrit-Branch: master Gerrit-Owner: Yaron Koren ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Update OOJS UI to v0.1.0-pre (d047752ccc) - change (mediawiki...VisualEditor)
jenkins-bot has submitted this change and it was merged. Change subject: Update OOJS UI to v0.1.0-pre (d047752ccc) .. Update OOJS UI to v0.1.0-pre (d047752ccc) Change-Id: Ic8e5e8176b35be702ad7a995918fc746f8b1176d --- M modules/oojs-ui/oojs-ui.js M modules/oojs-ui/oojs-ui.svg.css 2 files changed, 551 insertions(+), 327 deletions(-) Approvals: Jforrester: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/oojs-ui/oojs-ui.js b/modules/oojs-ui/oojs-ui.js index f952bd3..884a14c 100644 --- a/modules/oojs-ui/oojs-ui.js +++ b/modules/oojs-ui/oojs-ui.js @@ -1,12 +1,12 @@ /*! - * OOJS UI v0.1.0-pre (e5ef1e5b28) + * OOJS UI v0.1.0-pre (d047752ccc) * https://www.mediawiki.org/wiki/OOJS * * Copyright 2011-2013 OOJS Team and other contributors. * Released under the MIT license * http://oojs.mit-license.org * - * Date: Mon Nov 25 2013 10:40:32 GMT+ (GMT) + * Date: Wed Dec 04 2013 04:03:24 GMT+0100 (CET) */ ( function () { @@ -83,10 +83,6 @@ var messages = { // Label text for button to exit from dialog 'ooui-dialog-action-close': 'Close', - // TODO remove me - 'ooui-inspector-close-tooltip': 'Close', - // TODO remove me - 'ooui-inspector-remove-tooltip': 'Remove', // Tool tip for a button that moves items in a list down one place 'ooui-outline-control-move-down': 'Move item down', // Tool tip for a button that moves items in a list up one place @@ -615,6 +611,10 @@ * frame's document. It then polls the document to see when all styles have loaded, and once they * have, invokes the callback. * + * If the styles still haven't loaded after a long time (5 seconds by default), we give up waiting + * and invoke the callback anyway. This protects against cases like a display: none; iframe in + * Firefox, where the styles won't load until the iframe becomes visible. + * * For details of how we arrived at the strategy used in this function, see #load. * * @static @@ -623,9 +623,10 @@ * @param {HTMLDocument} parentDoc Document to transplant styles from * @param {HTMLDocument} frameDoc Document to transplant styles to * @param {Function} [callback] Callback to execute once styles have loaded + * @param {number} [timeout=5000] How long to wait before giving up (in ms). If 0, never give up. */ -OO.ui.Frame.static.transplantStyles = function ( parentDoc, frameDoc, callback ) { - var i, numSheets, styleNode, newNode, timeout, pollNodeId, $pendingPollNodes, +OO.ui.Frame.static.transplantStyles = function ( parentDoc, frameDoc, callback, timeout ) { + var i, numSheets, styleNode, newNode, timeoutID, pollNodeId, $pendingPollNodes, $pollNodes = $( [] ), // Fake font-family value fontFamily = 'oo-ui-frame-transplantStyles-loaded'; @@ -657,7 +658,7 @@ if ( callback ) { // Poll every 100ms until all external stylesheets have loaded $pendingPollNodes = $pollNodes; - timeout = setTimeout( function pollExternalStylesheets() { + timeoutID = setTimeout( function pollExternalStylesheets() { while ( $pendingPollNodes.length > 0 && $pendingPollNodes.eq( 0 ).css( 'font-family' ) === fontFamily @@ -667,12 +668,26 @@ if ( $pendingPollNodes.length === 0 ) { // We're done! - $pollNodes.remove(); - callback(); + if ( timeoutID !== null ) { + timeoutID = null; + $pollNodes.remove(); + callback(); + } } else { - timeout = setTimeout( pollExternalStylesheets, 100 ); + timeoutID = setTimeout( pollExternalStylesheets, 100 ); } }, 100 ); + // ...but give up after a while + if ( timeout !== 0 ) { + setTimeout( function () { + if ( timeoutID ) { + clearTimeout( timeoutID ); + timeoutID = null; + $pollNodes.remove(); + callback(); + } + }, timeout || 5000 ); + } } }; @@ -3109,10 +3124,12 @@ * * @constructor * @param {Object} [config] Configuration options - * @param {boolean} [config.attachPagesPanel] Whether or not to attach pagesPanel to this.$element on - * initialization. + * @cfg {boolean} [autoFocus=false] Focus on t
[MediaWiki-commits] [Gerrit] Bug 57707: Hotfix, don't push undefined onto wikitext array - change (mediawiki...Parsoid)
jenkins-bot has submitted this change and it was merged. Change subject: Bug 57707: Hotfix, don't push undefined onto wikitext array .. Bug 57707: Hotfix, don't push undefined onto wikitext array This might have been broken in 283bfd55, but this patch just works around the breakage for now by not pushing undefined onto the wikitext array. Proper investigation and fix to be done. Change-Id: Ic1706c8da69c0046b1acd39f1e8b3de55a3fee92 --- M js/lib/ext.core.AttributeExpander.js 1 file changed, 4 insertions(+), 2 deletions(-) Approvals: Subramanya Sastry: Looks good to me, approved jenkins-bot: Verified diff --git a/js/lib/ext.core.AttributeExpander.js b/js/lib/ext.core.AttributeExpander.js index 6fe2322..2f5aa82 100644 --- a/js/lib/ext.core.AttributeExpander.js +++ b/js/lib/ext.core.AttributeExpander.js @@ -34,7 +34,7 @@ if ([TagTk, SelfclosingTagTk].indexOf(token.constructor) !== -1) { // Strip all meta tags. if (wrapTemplates) { - if (inInclude) { + if (inInclude && token.dataAttribs.src) { wikitext.push(token.dataAttribs.src); } @@ -46,7 +46,9 @@ inTpl = typeMatch[1].match(/Transclusion|Param|Extension/); inInclude = !inTpl; hasGeneratedContent = true; - wikitext.push(token.dataAttribs.src); + if (token.dataAttribs.src) { + wikitext.push(token.dataAttribs.src); + } } else { inTpl = false; inInclude = false; -- To view, visit https://gerrit.wikimedia.org/r/99022 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic1706c8da69c0046b1acd39f1e8b3de55a3fee92 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/Parsoid Gerrit-Branch: master Gerrit-Owner: GWicke Gerrit-Reviewer: Subramanya Sastry Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Implement new CheckboxWidget class - change (oojs/ui)
jenkins-bot has submitted this change and it was merged. Change subject: Implement new CheckboxWidget class .. Implement new CheckboxWidget class This also provides a CheckboxInputWidget, which is unlabelled. Additionally, fix TextInputWidget to not try to set the type on the input as that won't work in IE. Change-Id: I84bd5e46753d3627b2e26820082c2aeca15b0772 --- M build/modules.json M src/styles/OO.ui.Widget.css A src/widgets/OO.ui.CheckboxInputWidget.js A src/widgets/OO.ui.CheckboxWidget.js M src/widgets/OO.ui.TextInputWidget.js 5 files changed, 110 insertions(+), 1 deletion(-) Approvals: Krinkle: Looks good to me, approved jenkins-bot: Verified diff --git a/build/modules.json b/build/modules.json index 81fd212..c41f6f2 100644 --- a/build/modules.json +++ b/build/modules.json @@ -34,6 +34,8 @@ "src/widgets/OO.ui.ButtonWidget.js", "src/widgets/OO.ui.IconButtonWidget.js", "src/widgets/OO.ui.InputWidget.js", + "src/widgets/OO.ui.CheckboxInputWidget.js", + "src/widgets/OO.ui.CheckboxWidget.js", "src/widgets/OO.ui.InputLabelWidget.js", "src/widgets/OO.ui.LookupInputWidget.js", "src/widgets/OO.ui.OptionWidget.js", diff --git a/src/styles/OO.ui.Widget.css b/src/styles/OO.ui.Widget.css index 1af4771..41ac97c 100644 --- a/src/styles/OO.ui.Widget.css +++ b/src/styles/OO.ui.Widget.css @@ -404,6 +404,16 @@ background-repeat: no-repeat; } +/* OO.ui.CheckboxWidget */ +.oo-ui-checkboxWidget .oo-ui-labeledElement-label { + display: inline-block; + vertical-align: middle; +} + +.oo-ui-checkboxWidget input { + vertical-align: middle; +} + /* OO.ui.MenuWidget */ .oo-ui-menuWidget { diff --git a/src/widgets/OO.ui.CheckboxInputWidget.js b/src/widgets/OO.ui.CheckboxInputWidget.js new file mode 100644 index 000..c2648c3 --- /dev/null +++ b/src/widgets/OO.ui.CheckboxInputWidget.js @@ -0,0 +1,69 @@ +/** + * Creates an OO.ui.CheckboxInputWidget object. + * + * @class + * @extends OO.ui.InputWidget + * + * @constructor + * @param {Object} [config] Configuration options + */ +OO.ui.CheckboxInputWidget = function OoUiCheckboxInputWidget( config ) { + config = config || {}; + + // Parent constructor + OO.ui.InputWidget.call( this, config ); + + this.value = false; + + // Initialization + this.$element.addClass( 'oo-ui-checkboxInputWidget' ); +}; + +/* Inheritance */ + +OO.inheritClass( OO.ui.CheckboxInputWidget, OO.ui.InputWidget ); + +/* Events */ + +/* Methods */ + +/** + * Get input element. + * + * @returns {jQuery} Input element + */ +OO.ui.CheckboxInputWidget.prototype.getInputElement = function () { + return this.$( '' ); +}; + +/** + * Get checked state of the checkbox + * + * @returns {boolean} If the checkbox is checked + */ +OO.ui.CheckboxInputWidget.prototype.getValue = function () { + return this.value; +}; + +/** + * Set value + */ +OO.ui.CheckboxInputWidget.prototype.setValue = function ( value ) { + if ( this.value !== value ) { + this.value = !!value; + this.$element.attr( 'checked', this.value ); + this.emit( 'change', this.value ); + } +}; + +/** + * @inheritdoc + */ +OO.ui.CheckboxInputWidget.prototype.onEdit = function () { + if ( !this.disabled ) { + // Allow the stack to clear so the value will be updated + setTimeout( OO.ui.bind( function () { + this.setValue( this.$input.attr( 'checked' ) ); + }, this ) ); + } +}; \ No newline at end of file diff --git a/src/widgets/OO.ui.CheckboxWidget.js b/src/widgets/OO.ui.CheckboxWidget.js new file mode 100644 index 000..d18c353 --- /dev/null +++ b/src/widgets/OO.ui.CheckboxWidget.js @@ -0,0 +1,28 @@ +/** + * Creates an OO.ui.CheckboxWidget object. + * + * @class + * @extends OO.ui.CheckboxInputWidget + * @mixins OO.ui.LabeledElement + * + * @constructor + * @param {Object} [config] Configuration options + * @cfg {string} [label=''] Label + */ +OO.ui.CheckboxWidget = function OoUiCheckboxWidget( config ) { + config = config || {}; + + // Parent constructors + OO.ui.CheckboxInputWidget.call( this, config ); + OO.ui.LabeledElement.call( this, this.$( '' ) , config ); + + this.$( '' ).append( this.$input, this.$label ).appendTo( this.$element ); + + // Initialization + this.$element.addClass( 'oo-ui-checkboxWidget' ); +}; + +/* Inheritance */ + +OO.inheritClass( OO.ui.CheckboxWidget, OO.ui.CheckboxInputWidget ); +OO.mixinClass( OO.ui.CheckboxWidget, OO.ui.LabeledElement ); diff --git a/src/widgets/OO.ui.TextInputWidget.js b/src/widgets/OO.ui.TextInputWidget.js index 082a4c1..ec2ec3e 100644 --- a/src/widgets/OO.ui.TextInputWidget.js +++ b/src/widgets/
[MediaWiki-commits] [Gerrit] Bug 57707: Hotfix, don't push undefined onto wikitext array - change (mediawiki...Parsoid)
GWicke has uploaded a new change for review. https://gerrit.wikimedia.org/r/99022 Change subject: Bug 57707: Hotfix, don't push undefined onto wikitext array .. Bug 57707: Hotfix, don't push undefined onto wikitext array This might have been broken in 283bfd55, but this patch just works around the breakage for now by not pushing undefined onto the wikitext array. Proper investigation and fix to be done. Change-Id: Ic1706c8da69c0046b1acd39f1e8b3de55a3fee92 --- M js/lib/ext.core.AttributeExpander.js 1 file changed, 3 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Parsoid refs/changes/22/99022/1 diff --git a/js/lib/ext.core.AttributeExpander.js b/js/lib/ext.core.AttributeExpander.js index 6fe2322..4870705 100644 --- a/js/lib/ext.core.AttributeExpander.js +++ b/js/lib/ext.core.AttributeExpander.js @@ -46,7 +46,9 @@ inTpl = typeMatch[1].match(/Transclusion|Param|Extension/); inInclude = !inTpl; hasGeneratedContent = true; - wikitext.push(token.dataAttribs.src); + if (token.dataAttribs.src) { + wikitext.push(token.dataAttribs.src); + } } else { inTpl = false; inInclude = false; -- To view, visit https://gerrit.wikimedia.org/r/99022 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic1706c8da69c0046b1acd39f1e8b3de55a3fee92 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Parsoid Gerrit-Branch: master Gerrit-Owner: GWicke ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Bug 57251: Lowercase attributes before sanitization - change (mediawiki...Parsoid)
jenkins-bot has submitted this change and it was merged. Change subject: Bug 57251: Lowercase attributes before sanitization .. Bug 57251: Lowercase attributes before sanitization This avoids dropping them on the floor completely. We still don't preserve the case of these attributes, but arguably that should be covered well enough by selser. Change-Id: Id07eccd94cfe38936e36be7aad8be042fdff7e62 --- M js/lib/ext.core.Sanitizer.js M js/tests/parserTests-blacklist.js 2 files changed, 15 insertions(+), 14 deletions(-) Approvals: Subramanya Sastry: Looks good to me, approved jenkins-bot: Verified diff --git a/js/lib/ext.core.Sanitizer.js b/js/lib/ext.core.Sanitizer.js index c8fd3d9..2267abc 100644 --- a/js/lib/ext.core.Sanitizer.js +++ b/js/lib/ext.core.Sanitizer.js @@ -949,8 +949,8 @@ var n = attrs.length; for (var i = 0; i < n; i++) { var a = attrs[i], - k = a.k, - origK = a.ksrc || k, + origK = a.ksrc || a.k, + k = a.k.toLowerCase(), v = a.v, origV = a.vsrc || v, psdAttr = this.isParsoidAttr(k, v, attrs); diff --git a/js/tests/parserTests-blacklist.js b/js/tests/parserTests-blacklist.js index a721375..6006e1a 100644 --- a/js/tests/parserTests-blacklist.js +++ b/js/tests/parserTests-blacklist.js @@ -278,7 +278,6 @@ add("wt2html", "BUG 1219 URL next to image (broken)"); add("wt2html", "Namespaced link must have a title"); add("wt2html", "Namespaced link must have a title (bad fragment version)"); -add("wt2html", "DIV IN UPPERCASE"); add("wt2html", "Media link"); add("wt2html", "Media link with text"); add("wt2html", "Media link with nasty text\nfixme: doBlockLevels won't wrap this in a paragraph because it contains a div"); @@ -614,6 +613,7 @@ add("wt2wt", "div with empty attribute value, no space before equals"); add("wt2wt", "HTML multiple attributes correction"); add("wt2wt", "Table multiple attributes correction"); +add("wt2wt", "DIV IN UPPERCASE"); add("wt2wt", "Media link with nasty text\nfixme: doBlockLevels won't wrap this in a paragraph because it contains a div"); add("wt2wt", "Empty attribute crash test single-quotes (bug 2067)"); add("wt2wt", "Attribute test: equals, then nothing"); @@ -2992,6 +2992,7 @@ add("selser", "Table multiple attributes correction [[4,1]]", "{|\n!+ class=\"error\" class=\"awesome\"| status\n|}"); add("selser", "Table multiple attributes correction [[3,2]]", "{|\n!+ class=\"error\" class=\"awesome\"| status\n|}"); add("selser", "Table multiple attributes correction [[0,[2,0]]]", "{|\n!+ class=\"error\" class=\"awesome\"| status\n|}"); +add("selser", "DIV IN UPPERCASE [2]", "qcqx475zv4c2fbt9HTML ROCKS"); add("selser", "Media link with nasty text\nfixme: doBlockLevels won't wrap this in a paragraph because it contains a div [[0,2]]", "[[Media:Foobar.jpg|Safe Link9pzzuxvaz3bx1or\" onmouseover=\"alert(document.cookie)\" onfoo=\"]]"); add("selser", "Media link with nasty text\nfixme: doBlockLevels won't wrap this in a paragraph because it contains a div [2]", "ql7zctd0dv1v2t9[[Media:Foobar.jpg|Safe Link\" onmouseover=\"alert(document.cookie)\" onfoo=\"]]"); add("selser", "Media link with nasty text\nfixme: doBlockLevels won't wrap this in a paragraph because it contains a div [1]", "[[Media:Foobar.jpg|Safe Link\" onmouseover=\"alert(document.cookie)\" onfoo=\"]]"); @@ -3094,20 +3095,20 @@ add("selser", "Fuzz testing: Parser22 [[1],4,2]", "http://===r:::https://bptlivvbl2mg3nmioxiqusjba1wqm2t9\n{|"); add("selser", "Fuzz testing: Parser22 [3,0,0]", "\n{|"); add("selser", "Fuzz testing: Parser22 [1,0,2]", "http://===r:::https://b\n\n3ql477um4peyu8fr\n{|"); -add("selser", "Fuzz testing: Parser24 [[0,2,0],3,2]", "{{{g6r38jevgd37hkt9|\n>\n7yitay7jtsjdcxr\n{|\n{{{|\n >\n\n\nMOVE YOUR MOUSE CURSOR OVER THIS TEXT\n|"); -add("selser", "Fuzz testing: Parser24 [[[4],3,0],0,[0,3,4,[2]]]", "aosym28xh3ibpgb9>\n{|\n||}"); -add("selser", "Fuzz testing: Parser24 [[4,0,0],0,[4,0,2,4]]", "11sr1z4igrvpwrk9|\n>\n{|\n|}"); +add("selser", "Fuzz testing: Parser24 [[0,2,0],3,2]", "{{{g6r38jevgd37hkt9|\n>\n7yitay7jtsjdcxr\n{|\n{{{|\n >\n\n\nMOVE YOUR MOUSE CURSOR OVER THIS TEXT\n|"); +add("selser", "Fuzz testing: Parser24 [[[4],3,0],0,[0,3,4,[2]]]", "aosym28xh3ibpgb9>\n{|\n||}"); +add("selser", "Fuzz testing: Parser24 [[4,0,0],0,[4,0,2,4]]", "11sr1z4igrvpwrk9|\n>\n{|\n|}"); add("selser", "Fuzz testing: Parser24 [3,2,4]", "u39lbr4wb5ptlnmi\n\nng2zinxre265hfr"); -add("selser", "Fuzz testing: Parser24 [[[3],0,0],2,3]", "|\n>\naruqvd6sv8bvgqfr\n\n"); -add("selser", "Fuzz testing: Parser24 [[3,0,0],0,1]", "|\n>\n{| data-foobar=\"gvuyg42a70y3c8fr\"\n\n||}"); +add("selser", "Fuzz testing: Parser24 [[[3],0,0],2,3]", "|\n>\naruqvd6sv8bvgqfr\n\n"); +add(
[MediaWiki-commits] [Gerrit] Add a sqldump script wrapper around mysqldump - change (operations/puppet)
Tim Starling has submitted this change and it was merged. Change subject: Add a sqldump script wrapper around mysqldump .. Add a sqldump script wrapper around mysqldump Same as what the sql script is to mysql Change-Id: I6e9dd1dfee7435f201a42f6c1a2e92e475a073b6 --- A files/misc/scripts/sqldump M manifests/misc/deployment.pp 2 files changed, 23 insertions(+), 0 deletions(-) Approvals: Tim Starling: Looks good to me, approved jenkins-bot: Verified diff --git a/files/misc/scripts/sqldump b/files/misc/scripts/sqldump new file mode 100755 index 000..10b6171 --- /dev/null +++ b/files/misc/scripts/sqldump @@ -0,0 +1,18 @@ +#!/bin/bash + +db=$1 +. /usr/local/lib/mw-deployment-vars.sh + +MWMULTIDIR=$MW_COMMON/multiversion + +if [ -z $db ];then + db=enwiki +elif [ "$db" == centralauth ]; then + db=fawiki +fi + +host=`echo 'echo wfGetLB()->getServerName(0);' | /usr/local/bin/mwscript eval.php --wiki="$db"` + +MU=wikiadmin +MP=`wikiadmin_pass` +mysqldump -u $MU -p$MP -h $host "$@" diff --git a/manifests/misc/deployment.pp b/manifests/misc/deployment.pp index 15f125a..2cf7bdc 100644 --- a/manifests/misc/deployment.pp +++ b/manifests/misc/deployment.pp @@ -114,6 +114,11 @@ group => root, mode => 0555, source => "puppet:///files/misc/scripts/sql"; + "${scriptpath}/sqldump": + owner => root, + group => root, + mode => 0555, + source => "puppet:///files/misc/scripts/sqldump"; "${scriptpath}/sync-apache": owner => root, group => root, -- To view, visit https://gerrit.wikimedia.org/r/43844 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6e9dd1dfee7435f201a42f6c1a2e92e475a073b6 Gerrit-PatchSet: 10 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Reedy Gerrit-Reviewer: Asher Gerrit-Reviewer: Reedy Gerrit-Reviewer: Tim Starling Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] [WIP] Create jquery.fullscreen - change (mediawiki/core)
Theopolisme has uploaded a new change for review. https://gerrit.wikimedia.org/r/99021 Change subject: [WIP] Create jquery.fullscreen .. [WIP] Create jquery.fullscreen New plugin for making elements go fullscreen. Incorporates some code from MultimediaViewer. Bug: 56477 Change-Id: I58138afa05c43f5a24e74fa3a30a658428c39ce0 --- M resources/Resources.php A resources/jquery/jquery.fullscreen.js 2 files changed, 105 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/21/99021/1 diff --git a/resources/Resources.php b/resources/Resources.php index a022c6d..f8a17d1 100644 --- a/resources/Resources.php +++ b/resources/Resources.php @@ -216,6 +216,9 @@ 'jquery.form' => array( 'scripts' => 'resources/jquery/jquery.form.js', ), + 'jquery.fullscreen' => array( + 'scripts' => 'resources/jquery/jquery.fullscreen.js', + ), 'jquery.getAttrs' => array( 'scripts' => 'resources/jquery/jquery.getAttrs.js', 'targets' => array( 'desktop', 'mobile' ), diff --git a/resources/jquery/jquery.fullscreen.js b/resources/jquery/jquery.fullscreen.js new file mode 100644 index 000..602d8e3 --- /dev/null +++ b/resources/jquery/jquery.fullscreen.js @@ -0,0 +1,102 @@ +/** + * jQuery fullscreen plugin + * + * Events you can listen for: + * - fullscreen, triggered when the page goes fullscreen + * - defullscreen, triggered when the page goes back to normal + * + * The element that is made fullscreen will have the 'fullscreened' + * class while it is fullscreen. + * + * == Usage == + * + * Initialize the fullscreen plugin: + * $.fullscreenSetup(); + * + * Make an element go fullscreen: + * $element.fullscreen(); + * + * Then take it out of fullscreen: + * $element.fullscreen(); + * + * == Important note == + * + * Elements can only be made fullscreen based on user interaction + * (for example, clicking a button), to protect against malicious uses + * of the fullscreen functionality. + * + * @author Theopolisme 2013 + */ +( function ( $ ) { + // Set up fullscreen handling and install necessary event handlers. + // Return false if fullscreen is not supported. + $.fullscreenSetup = function () { + if ( document.fullscreenEnabled || + document.mozFullScreenEnabled || + document.webkitFullscreenEnabled || + document.msFullscreenEnabled ) { + // When the fullscreen mode is changed, trigger the + // defullscreen or fullscreen events (and when exiting, + // also remove the `fullscreened` class) + $( document ).on( 'webkitfullscreenchange mozfullscreenchange fullscreenchange msfullscreenchange', function () { + if ( !document.fullscreenElement && + !document.mozFullScreenElement && + !document.webkitFullscreenElement && + !document.msFullscreenElement ) { + $( '.fullscreened' ).removeClass( 'fullscreened' ); + $( document ).trigger( $.Event( 'defullscreen' ) ); + } else { + // We don't mess with styling here because we don't know if we + // induced the fullscreening or if it was something else + $( document ).trigger( $.Event( 'fullscreen' ) ); + } + } ); + } else { + return false; + } + }; + + // Change an element's fullscreen state. Turn non-fullscreen elements fullscreen and + // fullscreen elements non-fullscreen. + $.fn.fullscreen = function () { + var element; + + // Cancel fullscreen mode if it is enabled + if ( document.fullscreenElement || + document.mozFullScreenElement || + document.webkitFullscreenElement || + document.msFullscreenElement ) { + if ( document.exitFullscreen ) { + document.exitFullscreen(); + } else if ( document.mozCancelFullScreen ) { + document.mozCancelFullScreen(); + } else if ( document.webkitCancelFullScreen ) { + document.webkitCancelFullScreen(); + }
[MediaWiki-commits] [Gerrit] Don't try to save if the form is empty and the page doesn't ... - change (mediawiki...MobileFrontend)
Kaldari has uploaded a new change for review. https://gerrit.wikimedia.org/r/99020 Change subject: Don't try to save if the form is empty and the page doesn't exist. .. Don't try to save if the form is empty and the page doesn't exist. If the user enters nothing for their user description and their user description page doesn't already exist, just switch the User Profile back to view mode instead of trying to save the user description page with no content. Bug 57931 Change-Id: I54f51476833d400db3a4276f8db35870f18a898e --- M includes/specials/SpecialUserProfile.php M javascripts/specials/userprofile.js 2 files changed, 32 insertions(+), 19 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/20/99020/1 diff --git a/includes/specials/SpecialUserProfile.php b/includes/specials/SpecialUserProfile.php index ac07175..7351fa7 100644 --- a/includes/specials/SpecialUserProfile.php +++ b/includes/specials/SpecialUserProfile.php @@ -272,10 +272,19 @@ $activityHtml = $this->getLastEditHtml() . $this->getLastUploadHtml() . $this->getLastThanksHtml(); + // Get the User Profile introduction text // FIXME: There's probably a cleaner way to do this. $userDescPageName = $this->targetUser->getUserPage()->getPrefixedText() . '/UserProfileIntro'; - $this->userDescription = $this->getLang()->truncate( $this->getWikiPageText( $userDescPageName ), - self::MAX_DESCRIPTION_CHARS ); + $userDescPageTitle = Title::newFromText( $userDescPageName ); + if ( $userDescPageTitle && $userDescPageTitle->exists() ) { + $out->addJsConfigVars( array( 'wgMFUserDescPageExists' => true ) ); + $this->userDescription = $this->getLang()->truncate( $this->getWikiPageText( $userDescPageTitle ), + self::MAX_DESCRIPTION_CHARS ); + } else { + $out->addJsConfigVars( array( 'wgMFUserDescPageExists' => false ) ); + $this->userDescription = ''; + } + var_dump($this->userDescription); $summary = $this->getUserSummary(); $talkLink = $this->getTalkLink(); @@ -316,19 +325,16 @@ /** * Retrieve the text of a WikiPage -* @param string $wikiPageTitle The title of the WikiPage +* @param Title $wikiPageTitle The title object of the WikiPage * @return string The text of the page */ - protected function getWikiPageText( $wikiPageTitle ) { + protected function getWikiPageText( Title $title ) { $text = ''; - $title = Title::newFromText( $wikiPageTitle ); - if ( $title ) { - $wikiPage = WikiPage::newFromID( $title->getArticleID() ); - if ( $wikiPage ) { - $content = $wikiPage->getContent(); - if ( $content ) { - $text = ContentHandler::getContentText( $content ); - } + $wikiPage = WikiPage::newFromID( $title->getArticleID() ); + if ( $wikiPage ) { + $content = $wikiPage->getContent(); + if ( $content ) { + $text = ContentHandler::getContentText( $content ); } } return $text; diff --git a/javascripts/specials/userprofile.js b/javascripts/specials/userprofile.js index 7677ba4..6e6aec7 100644 --- a/javascripts/specials/userprofile.js +++ b/javascripts/specials/userprofile.js @@ -38,14 +38,21 @@ this.$( '.edit-button' ).on( 'click', $.proxy( self, 'switchToEditMode' ) ); this.$( '.editor button' ).on( 'click', function() { var val = self.$( 'textarea' ).val(); - $loader.show(); - $form.hide(); - self.api.setContent( val ); - self.api.save( { summary: mw.msg( 'mobile-frontend-profile-edit-summary' ) } ).done( function() { - $loader.hide(); - self.$( '.user-description' ).text( val || options.placeholder ); + // If the form is empty and the user description page
[MediaWiki-commits] [Gerrit] Escape $action in hook - change (mediawiki...Flow)
Bsitu has uploaded a new change for review. https://gerrit.wikimedia.org/r/99019 Change subject: Escape $action in hook .. Escape $action in hook Change-Id: I9953520c4fcc37ff26c0c1d2e7cb16c5fb82d39d --- M Hooks.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow refs/changes/19/99019/1 diff --git a/Hooks.php b/Hooks.php index 1dbaacc..5bc51c3 100644 --- a/Hooks.php +++ b/Hooks.php @@ -242,7 +242,7 @@ // Check if Flow actions are defined for the requested log types // and make sure they're ignored. if ( isset( $wgLogActionsHandlers["$logType/flow-$action"] ) ) { - $conds[] = "log_action != 'flow-$action'"; + $conds[] = "log_action != " . wfGetDB( DB_SLAVE )->addQuotes( "flow-$action" ); } } } -- To view, visit https://gerrit.wikimedia.org/r/99019 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9953520c4fcc37ff26c0c1d2e7cb16c5fb82d39d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Flow Gerrit-Branch: master Gerrit-Owner: Bsitu ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Zero Config cleanup - change (mediawiki...ZeroRatedMobileAccess)
jenkins-bot has submitted this change and it was merged. Change subject: Zero Config cleanup .. Zero Config cleanup * renamed thorough to isSaving * removed duplicate objectTable param * fixed calling convention for CarrierConfig::getValue() Change-Id: I2ad0e79cedf45df8e21bfd5ac03e7c4f590106c1 --- M includes/CarrierConfig.php M includes/ZeroConfigContent.php 2 files changed, 18 insertions(+), 15 deletions(-) Approvals: Dr0ptp4kt: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/CarrierConfig.php b/includes/CarrierConfig.php index 5588da8..04d0c3f 100644 --- a/includes/CarrierConfig.php +++ b/includes/CarrierConfig.php @@ -24,15 +24,15 @@ private $defaultUsed = array(); private $sameAsDefault = array(); private $unknownFields; - private $thorough; + private $isSaving; /** * @param $rawText -* @param bool $thorough if true, performs extra validation checks the ZeroConfig page editing +* @param bool $isSaving if true, performs extra validation checks the ZeroConfig page editing */ - function __construct( $rawText, $thorough = false ) { + function __construct( $rawText, $isSaving = false ) { $this->rawText = $rawText; - $this->thorough = $thorough; + $this->isSaving = $isSaving; $this->validate(); } @@ -139,7 +139,7 @@ $json = FormatJson::decode( $this->rawText, true ) ?: false; if ( !is_array( $json ) ) { - if ( $this->thorough ) { + if ( $this->isSaving ) { // The most common error is the trailing comma in a list. Attempt to remove it. $json = preg_replace( '/,[ \t]*([\r\n]*[ \t]*[\]}])/', '$1', $this->rawText ); $json = FormatJson::decode( $json, true ) ?: false; @@ -166,7 +166,7 @@ $this->check( 'enabled', true, $validateBool ); // List of additional partner admins for this entry - if ( $this->thorough ) { + if ( $this->isSaving ) { $this->check( 'admins', array(), function( $v ) { if ( is_string( $v ) ) { @@ -338,7 +338,7 @@ $this->check( 'enableHttps', false, $validateBool ); // List of IP CIDR blocks for this provider - if ( $this->thorough ) { + if ( $this->isSaving ) { $this->check( 'ips', '', function( $v ) { if ( is_string( $v ) ) { @@ -394,7 +394,7 @@ } private function check( $field, $default, $validator ) { - $res = self::getValue( $field ); + $res = $this->getValue( $field ); if ( $res === null ) { $res = $default; $this->defaultUsed[$field] = true; @@ -417,11 +417,15 @@ } } + /** +* Get field value from the json object +* This function may return an error message in case there are keys that only differ in their casing +* @param string $field field name +* @return Message|null +*/ private function getValue( $field ) { $value = null; $duplicates = array(); - - // @TODO: Change from array results/exceptions to Message objects in case of an error // check for exact field name match if ( array_key_exists( $field, $this->json ) ) { diff --git a/includes/ZeroConfigContent.php b/includes/ZeroConfigContent.php index 198330f..99eca35 100644 --- a/includes/ZeroConfigContent.php +++ b/includes/ZeroConfigContent.php @@ -90,10 +90,9 @@ * @param Array $config * @param int $level Tree level * @param string $parentKey The name of the parent key -* @param array $parentValues The values of the current container * @return string: HTML. */ - private function objectTable( $config, $level = 0, $parentKey = null, $parentValues = null ) { + private function objectTable( $config, $level = 0, $parentKey = null ) { wfProfileIn( __METHOD__ ); $rows = array(); @@ -122,7 +121,7 @@ } $td = Xml::tags( 'td', $tdAttributes, implode( ', ', $vals ) ); } else { - $td = Xml::tags( 'td', null, $this->objectTable( $val, $level + 1, $key, $val ) ); + $td = Xml::tags( 'td', null, $this->objectTable( $val, $level + 1, $key ) );
[MediaWiki-commits] [Gerrit] Bug 57251: Lowercase attributes before sanitization - change (mediawiki...Parsoid)
GWicke has uploaded a new change for review. https://gerrit.wikimedia.org/r/99018 Change subject: Bug 57251: Lowercase attributes before sanitization .. Bug 57251: Lowercase attributes before sanitization This avoids dropping them on the floor completely. We still don't preserve the case of these attributes, but arguably that should be covered well enough by selser. Change-Id: Id07eccd94cfe38936e36be7aad8be042fdff7e62 --- M js/lib/ext.core.Sanitizer.js M js/tests/parserTests-blacklist.js 2 files changed, 15 insertions(+), 14 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Parsoid refs/changes/18/99018/1 diff --git a/js/lib/ext.core.Sanitizer.js b/js/lib/ext.core.Sanitizer.js index c8fd3d9..2267abc 100644 --- a/js/lib/ext.core.Sanitizer.js +++ b/js/lib/ext.core.Sanitizer.js @@ -949,8 +949,8 @@ var n = attrs.length; for (var i = 0; i < n; i++) { var a = attrs[i], - k = a.k, - origK = a.ksrc || k, + origK = a.ksrc || a.k, + k = a.k.toLowerCase(), v = a.v, origV = a.vsrc || v, psdAttr = this.isParsoidAttr(k, v, attrs); diff --git a/js/tests/parserTests-blacklist.js b/js/tests/parserTests-blacklist.js index a721375..6006e1a 100644 --- a/js/tests/parserTests-blacklist.js +++ b/js/tests/parserTests-blacklist.js @@ -278,7 +278,6 @@ add("wt2html", "BUG 1219 URL next to image (broken)"); add("wt2html", "Namespaced link must have a title"); add("wt2html", "Namespaced link must have a title (bad fragment version)"); -add("wt2html", "DIV IN UPPERCASE"); add("wt2html", "Media link"); add("wt2html", "Media link with text"); add("wt2html", "Media link with nasty text\nfixme: doBlockLevels won't wrap this in a paragraph because it contains a div"); @@ -614,6 +613,7 @@ add("wt2wt", "div with empty attribute value, no space before equals"); add("wt2wt", "HTML multiple attributes correction"); add("wt2wt", "Table multiple attributes correction"); +add("wt2wt", "DIV IN UPPERCASE"); add("wt2wt", "Media link with nasty text\nfixme: doBlockLevels won't wrap this in a paragraph because it contains a div"); add("wt2wt", "Empty attribute crash test single-quotes (bug 2067)"); add("wt2wt", "Attribute test: equals, then nothing"); @@ -2992,6 +2992,7 @@ add("selser", "Table multiple attributes correction [[4,1]]", "{|\n!+ class=\"error\" class=\"awesome\"| status\n|}"); add("selser", "Table multiple attributes correction [[3,2]]", "{|\n!+ class=\"error\" class=\"awesome\"| status\n|}"); add("selser", "Table multiple attributes correction [[0,[2,0]]]", "{|\n!+ class=\"error\" class=\"awesome\"| status\n|}"); +add("selser", "DIV IN UPPERCASE [2]", "qcqx475zv4c2fbt9HTML ROCKS"); add("selser", "Media link with nasty text\nfixme: doBlockLevels won't wrap this in a paragraph because it contains a div [[0,2]]", "[[Media:Foobar.jpg|Safe Link9pzzuxvaz3bx1or\" onmouseover=\"alert(document.cookie)\" onfoo=\"]]"); add("selser", "Media link with nasty text\nfixme: doBlockLevels won't wrap this in a paragraph because it contains a div [2]", "ql7zctd0dv1v2t9[[Media:Foobar.jpg|Safe Link\" onmouseover=\"alert(document.cookie)\" onfoo=\"]]"); add("selser", "Media link with nasty text\nfixme: doBlockLevels won't wrap this in a paragraph because it contains a div [1]", "[[Media:Foobar.jpg|Safe Link\" onmouseover=\"alert(document.cookie)\" onfoo=\"]]"); @@ -3094,20 +3095,20 @@ add("selser", "Fuzz testing: Parser22 [[1],4,2]", "http://===r:::https://bptlivvbl2mg3nmioxiqusjba1wqm2t9\n{|"); add("selser", "Fuzz testing: Parser22 [3,0,0]", "\n{|"); add("selser", "Fuzz testing: Parser22 [1,0,2]", "http://===r:::https://b\n\n3ql477um4peyu8fr\n{|"); -add("selser", "Fuzz testing: Parser24 [[0,2,0],3,2]", "{{{g6r38jevgd37hkt9|\n>\n7yitay7jtsjdcxr\n{|\n{{{|\n >\n\n\nMOVE YOUR MOUSE CURSOR OVER THIS TEXT\n|"); -add("selser", "Fuzz testing: Parser24 [[[4],3,0],0,[0,3,4,[2]]]", "aosym28xh3ibpgb9>\n{|\n||}"); -add("selser", "Fuzz testing: Parser24 [[4,0,0],0,[4,0,2,4]]", "11sr1z4igrvpwrk9|\n>\n{|\n|}"); +add("selser", "Fuzz testing: Parser24 [[0,2,0],3,2]", "{{{g6r38jevgd37hkt9|\n>\n7yitay7jtsjdcxr\n{|\n{{{|\n >\n\n\nMOVE YOUR MOUSE CURSOR OVER THIS TEXT\n|"); +add("selser", "Fuzz testing: Parser24 [[[4],3,0],0,[0,3,4,[2]]]", "aosym28xh3ibpgb9>\n{|\n||}"); +add("selser", "Fuzz testing: Parser24 [[4,0,0],0,[4,0,2,4]]", "11sr1z4igrvpwrk9|\n>\n{|\n|}"); add("selser", "Fuzz testing: Parser24 [3,2,4]", "u39lbr4wb5ptlnmi\n\nng2zinxre265hfr"); -add("selser", "Fuzz testing: Parser24 [[[3],0,0],2,3]", "|\n>\naruqvd6sv8bvgqfr\n\n"); -add("selser", "Fuzz testing: Parser24 [[3,0,0],0,1]", "|\n>\n{| data-foobar=\"gvuyg42a70y3c8fr\"\n\n||}"); +add("selser", "Fuzz testing: Parser24 [[[3],0,0],2,3]",
[MediaWiki-commits] [Gerrit] Improved zero subdomain detection - change (mediawiki...ZeroRatedMobileAccess)
jenkins-bot has submitted this change and it was merged. Change subject: Improved zero subdomain detection .. Improved zero subdomain detection In some cases X-Subdomain might not be set. Improves that. Change-Id: I2700ac2d2cefd8f52c6843dc3c0afc1fd4089499 --- M includes/PageRenderingHooks.php 1 file changed, 14 insertions(+), 1 deletion(-) Approvals: Dr0ptp4kt: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/PageRenderingHooks.php b/includes/PageRenderingHooks.php index d0a3a45..e00bbed 100644 --- a/includes/PageRenderingHooks.php +++ b/includes/PageRenderingHooks.php @@ -151,7 +151,20 @@ if ( $sd === null ) { $sd = $this->request->getHeader( 'X-SUBDOMAIN' ); } - $this->isZeroSubdomain = strcasecmp( $sd, 'ZERO' ) === 0; + if ( $sd ) { + $this->isZeroSubdomain = strcasecmp( $sd, 'ZERO' ) === 0; + } else { + // Either running from root redirector or from shell + $this->isZeroSubdomain = false; + $urlParts = wfParseUrl( $this->request->detectServer() ); + if ( isset( $urlParts['host'] ) ) { + $urlParts = explode( '.', $urlParts['host'], 3 ); + if ( count( $urlParts ) >= 2 ) { + $this->isZeroSubdomain = strcasecmp( $urlParts[0], 'ZERO' ) === 0 || + strcasecmp( $urlParts[1], 'ZERO' ) === 0; + }; + } + } } // TODO: Clean up HTML concatenation. Review for any non-escaped user input. -- To view, visit https://gerrit.wikimedia.org/r/98998 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2700ac2d2cefd8f52c6843dc3c0afc1fd4089499 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/ZeroRatedMobileAccess Gerrit-Branch: master Gerrit-Owner: Yurik Gerrit-Reviewer: Dr0ptp4kt Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Additional domains for Icdbfb2e74a - change (operations/dns)
Tim Starling has submitted this change and it was merged. Change subject: Additional domains for Icdbfb2e74a .. Additional domains for Icdbfb2e74a Change-Id: I0bb76a9f4ffaf51f3d9373caa1e303a81e695b73 --- M templates/wikimedia.org M templates/wikipedia.org 2 files changed, 14 insertions(+), 5 deletions(-) Approvals: Tim Starling: Looks good to me, approved jenkins-bot: Verified diff --git a/templates/wikimedia.org b/templates/wikimedia.org index 4819f02..d02cfb6 100644 --- a/templates/wikimedia.org +++ b/templates/wikimedia.org @@ -599,6 +599,7 @@ nl 1H IN CNAMEwikimedia-lb www.nl 1H IN CNAMEwikimedia-lb noboard.chapters 1H IN CNAMEwikimedia-lb +noboard-chapters 1H IN CNAMEwikimedia-lb no 1H IN CNAMEwikimedia-lb nz 1H IN CNAMEwikimedia-lb nostalgia 1H IN CNAMEwikimedia-lb diff --git a/templates/wikipedia.org b/templates/wikipedia.org index f7995f1..84c042b 100644 --- a/templates/wikipedia.org +++ b/templates/wikipedia.org @@ -34,10 +34,10 @@ ; Wikis (alphabetic order) -arbcom.de 1H IN CNAMEwikipedia-lb.wikimedia.org. -arbcom.en 1H IN CNAMEwikipedia-lb.wikimedia.org. -arbcom.fi 1H IN CNAMEwikipedia-lb.wikimedia.org. -arbcom.nl 1H IN CNAMEwikipedia-lb.wikimedia.org. +arbcom-de 1H IN CNAMEwikipedia-lb.wikimedia.org. +arbcom-en 1H IN CNAMEwikipedia-lb.wikimedia.org. +arbcom-fi 1H IN CNAMEwikipedia-lb.wikimedia.org. +arbcom-nl 1H IN CNAMEwikipedia-lb.wikimedia.org. commons 1H IN CNAMEwikipedia-lb.wikimedia.org. en2 1H IN CNAMEwikipedia-lb.wikimedia.org. meta 1H IN CNAMEwikipedia-lb.wikimedia.org. @@ -53,10 +53,18 @@ test.m 1H IN CNAMEmobile-lb.eqiad.wikimedia.org. test2.m 1H IN CNAMEmobile-lb.eqiad.wikimedia.org. textbook 1H IN CNAMEwikipedia-lb.wikimedia.org. -wg.en 1H IN CNAMEwikipedia-lb.wikimedia.org. +wg-en 1H IN CNAMEwikipedia-lb.wikimedia.org. www1H IN CNAMEwikipedia-lb.wikimedia.org. zh-tw 1H IN CNAMEwikipedia-lb.wikimedia.org. +; Old double-subdomain aliases (bug 31335) +arbcom.de 1H IN CNAMEwikipedia-lb.wikimedia.org. +arbcom.en 1H IN CNAMEwikipedia-lb.wikimedia.org. +arbcom.fi 1H IN CNAMEwikipedia-lb.wikimedia.org. +arbcom.nl 1H IN CNAMEwikipedia-lb.wikimedia.org. +wg.en 1H IN CNAMEwikipedia-lb.wikimedia.org. + + ; All languages will automatically be included here {{ langlist('wikipedia-lb.wikimedia.org.') }} -- To view, visit https://gerrit.wikimedia.org/r/99017 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0bb76a9f4ffaf51f3d9373caa1e303a81e695b73 Gerrit-PatchSet: 1 Gerrit-Project: operations/dns Gerrit-Branch: master Gerrit-Owner: Tim Starling Gerrit-Reviewer: Reedy Gerrit-Reviewer: Tim Starling Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Additional domains for Icdbfb2e74a - change (operations/dns)
Tim Starling has uploaded a new change for review. https://gerrit.wikimedia.org/r/99017 Change subject: Additional domains for Icdbfb2e74a .. Additional domains for Icdbfb2e74a Change-Id: I0bb76a9f4ffaf51f3d9373caa1e303a81e695b73 --- M templates/wikimedia.org M templates/wikipedia.org 2 files changed, 14 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/dns refs/changes/17/99017/1 diff --git a/templates/wikimedia.org b/templates/wikimedia.org index 4819f02..d02cfb6 100644 --- a/templates/wikimedia.org +++ b/templates/wikimedia.org @@ -599,6 +599,7 @@ nl 1H IN CNAMEwikimedia-lb www.nl 1H IN CNAMEwikimedia-lb noboard.chapters 1H IN CNAMEwikimedia-lb +noboard-chapters 1H IN CNAMEwikimedia-lb no 1H IN CNAMEwikimedia-lb nz 1H IN CNAMEwikimedia-lb nostalgia 1H IN CNAMEwikimedia-lb diff --git a/templates/wikipedia.org b/templates/wikipedia.org index f7995f1..84c042b 100644 --- a/templates/wikipedia.org +++ b/templates/wikipedia.org @@ -34,10 +34,10 @@ ; Wikis (alphabetic order) -arbcom.de 1H IN CNAMEwikipedia-lb.wikimedia.org. -arbcom.en 1H IN CNAMEwikipedia-lb.wikimedia.org. -arbcom.fi 1H IN CNAMEwikipedia-lb.wikimedia.org. -arbcom.nl 1H IN CNAMEwikipedia-lb.wikimedia.org. +arbcom-de 1H IN CNAMEwikipedia-lb.wikimedia.org. +arbcom-en 1H IN CNAMEwikipedia-lb.wikimedia.org. +arbcom-fi 1H IN CNAMEwikipedia-lb.wikimedia.org. +arbcom-nl 1H IN CNAMEwikipedia-lb.wikimedia.org. commons 1H IN CNAMEwikipedia-lb.wikimedia.org. en2 1H IN CNAMEwikipedia-lb.wikimedia.org. meta 1H IN CNAMEwikipedia-lb.wikimedia.org. @@ -53,10 +53,18 @@ test.m 1H IN CNAMEmobile-lb.eqiad.wikimedia.org. test2.m 1H IN CNAMEmobile-lb.eqiad.wikimedia.org. textbook 1H IN CNAMEwikipedia-lb.wikimedia.org. -wg.en 1H IN CNAMEwikipedia-lb.wikimedia.org. +wg-en 1H IN CNAMEwikipedia-lb.wikimedia.org. www1H IN CNAMEwikipedia-lb.wikimedia.org. zh-tw 1H IN CNAMEwikipedia-lb.wikimedia.org. +; Old double-subdomain aliases (bug 31335) +arbcom.de 1H IN CNAMEwikipedia-lb.wikimedia.org. +arbcom.en 1H IN CNAMEwikipedia-lb.wikimedia.org. +arbcom.fi 1H IN CNAMEwikipedia-lb.wikimedia.org. +arbcom.nl 1H IN CNAMEwikipedia-lb.wikimedia.org. +wg.en 1H IN CNAMEwikipedia-lb.wikimedia.org. + + ; All languages will automatically be included here {{ langlist('wikipedia-lb.wikimedia.org.') }} -- To view, visit https://gerrit.wikimedia.org/r/99017 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0bb76a9f4ffaf51f3d9373caa1e303a81e695b73 Gerrit-PatchSet: 1 Gerrit-Project: operations/dns Gerrit-Branch: master Gerrit-Owner: Tim Starling ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Removed a few strange or obsolete i18n message strings - change (mediawiki...ZeroRatedMobileAccess)
jenkins-bot has submitted this change and it was merged. Change subject: Removed a few strange or obsolete i18n message strings .. Removed a few strange or obsolete i18n message strings Note for the i18n team: * For some reason *-banner-text-data-charges-yes and *-banner-text-data-charges-no are used by one translation in the includes/ZeroConfig.i18n.php -- no idea why. * The folowing 3 messages were suprceeded by newer ones of similar meaning: -charge-auth => -charge-auth -charge-auth-yes => -accept -charge-auth-no => -go-back In case the language is not translated, for the new ones, please put the old one in with a "fuzy" mark. Thanks! Change-Id: Ib2e432f0cf9c012699401c081abfd5235ac7f821 --- M ZeroRatedMobileAccess.i18n.php 1 file changed, 1 insertion(+), 7 deletions(-) Approvals: Dr0ptp4kt: Looks good to me, approved jenkins-bot: Verified diff --git a/ZeroRatedMobileAccess.i18n.php b/ZeroRatedMobileAccess.i18n.php index 62268c2..fa3dfd2 100644 --- a/ZeroRatedMobileAccess.i18n.php +++ b/ZeroRatedMobileAccess.i18n.php @@ -13,6 +13,7 @@ /** English * @author Patrick Reilly + * @author Yuri Astrakhan (yurik) */ $messages['en'] = array ( 'zero-rated-mobile-access-sorry' => 'Sorry, zero.wikipedia.org is only supported by select mobile carriers and is not available from your mobile carrier.', @@ -20,20 +21,13 @@ 'zero-rated-mobile-access-sorry-goto' => 'Go to $1 (standard data charges may apply)', 'zeroratedmobileaccess' => 'Zero Rated Mobile Access', 'zero-rated-mobile-access-desc' => 'Provides features for mobile providers that provide free access', - 'zero-rated-mobile-access-search' => 'Search', - 'zero-rated-mobile-access-language-options-wiki-page-for-carrier' => 'zero-rated-mobile-access-language-options-for-carrier', - 'zero-rated-mobile-access-carrier-options-wiki-page' => 'zero-rated-mobile-access-carrier-options', - 'zero-rated-mobile-access-carrier-options-supported-wikis-wiki-page' => 'zero-rated-mobile-access-carrier-options-supported-wikis', 'zero-rated-mobile-access-language-selection' => 'All languages', 'zero-rated-mobile-access-home-page-selection' => '$1 home page', 'zero-rated-mobile-access-home-page-selection-text' => 'Or go to the home page in the following language:', 'zero-rated-mobile-access-banner-text' => 'Free {{SITENAME}} from $1', - 'zero-rated-mobile-access-banner-text-data-charges' => 'Standard data charges may apply. Do you want to continue? $1 / $2', 'zero-rated-mobile-access-charge-auth' => 'You are about to leave Zero-rated (free) {{SITENAME}}. Standard data charges may apply.', 'zero-rated-mobile-access-file-auth' => 'Images for {{SITENAME}} are not offered for free by your mobile carrier. Standard data charges may apply.', 'zero-rated-mobile-access-dont-ask' => 'Do not ask me again', - 'zero-rated-mobile-access-banner-text-data-charges-yes' => 'Yes', - 'zero-rated-mobile-access-banner-text-data-charges-no' => 'No', 'zero-rated-mobile-access-go-back' => 'Go back', 'zero-rated-mobile-access-accept' => 'Accept', 'zero-rated-mobile-access-click-to-view-image' => 'Click to view image of "$1"...', -- To view, visit https://gerrit.wikimedia.org/r/98481 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib2e432f0cf9c012699401c081abfd5235ac7f821 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/ZeroRatedMobileAccess Gerrit-Branch: master Gerrit-Owner: Yurik Gerrit-Reviewer: Dr0ptp4kt Gerrit-Reviewer: MaxSem Gerrit-Reviewer: Siebrand Gerrit-Reviewer: Yurik Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Follow up to getErrorMessage() fix - change (mediawiki...ZeroRatedMobileAccess)
jenkins-bot has submitted this change and it was merged. Change subject: Follow up to getErrorMessage() fix .. Follow up to getErrorMessage() fix Should have looked closer at Ifea6bdce023edc36e1e810f46eca08e201cb3950 - errorMessage is a wfMessage() itself, so should prepend line break, plus make bulletpoints with an astrtix. Change-Id: Ie21e87497924fc095e84fd1dd49e41012a4eb188 --- M includes/CarrierConfig.php 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Dr0ptp4kt: Looks good to me, approved Shirayuki: Looks good to me, but someone else must approve jenkins-bot: Verified diff --git a/includes/CarrierConfig.php b/includes/CarrierConfig.php index 109ceea..ceef838 100644 --- a/includes/CarrierConfig.php +++ b/includes/CarrierConfig.php @@ -60,7 +60,7 @@ $err = $this->errorMessage; if ( $err !== null ) { foreach ( $this->errors as $f => $e ) { - $err .= wfMessage( 'zeroconfig-field_error', $f, $e ) . ""; + $err .= ' *' . wfMessage( 'zeroconfig-field_error', $f, $e ); } } return $err; -- To view, visit https://gerrit.wikimedia.org/r/98880 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie21e87497924fc095e84fd1dd49e41012a4eb188 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/ZeroRatedMobileAccess Gerrit-Branch: master Gerrit-Owner: Yurik Gerrit-Reviewer: Dr0ptp4kt Gerrit-Reviewer: Shirayuki Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Bug 54438: First part of core change 97caae596: support time... - change (mediawiki...Parsoid)
jenkins-bot has submitted this change and it was merged. Change subject: Bug 54438: First part of core change 97caae596: support time/data/mark elements .. Bug 54438: First part of core change 97caae596: support time/data/mark elements These are now allowed by default in the core sanitizer, so allow them in Parsoid too. Other parts of 97caae596 are not done yet. Will leave the bug open until the other changes are ported too. Change-Id: I668ad89aad9f6c798645d081b5971719175b7ea5 --- M js/lib/ext.core.Sanitizer.js M js/lib/mediawiki.wikitext.constants.js M js/tests/parserTests.txt 3 files changed, 23 insertions(+), 3 deletions(-) Approvals: Arlolra: Looks good to me, approved jenkins-bot: Verified diff --git a/js/lib/ext.core.Sanitizer.js b/js/lib/ext.core.Sanitizer.js index c8fd3d9..ce9b161 100644 --- a/js/lib/ext.core.Sanitizer.js +++ b/js/lib/ext.core.Sanitizer.js @@ -551,7 +551,12 @@ // HTML 5 section 4.6 'bdi' : common, - 'wbr' : [ 'id', 'class', 'title', 'style' ] + 'wbr' : [ 'id', 'class', 'title', 'style' ], + + // HTML5 elements, defined by http://www.whatwg.org/html/ + 'data': common.concat(['value']), + 'time': common.concat(['datetime']), + 'mark': common }; } diff --git a/js/lib/mediawiki.wikitext.constants.js b/js/lib/mediawiki.wikitext.constants.js index 7fea8c1..0a1cd1f 100644 --- a/js/lib/mediawiki.wikitext.constants.js +++ b/js/lib/mediawiki.wikitext.constants.js @@ -71,19 +71,20 @@ 'ABBR', 'B', 'BDI', 'BDO', 'BIG', 'BLOCKQUOTE', 'BR', 'CAPTION', 'CENTER', 'CITE', 'CODE', - 'DD', 'DEL', 'DFN', 'DIV', 'DL', 'DT', + 'DATA', 'DD', 'DEL', 'DFN', 'DIV', 'DL', 'DT', 'EM', 'FONT', 'H1', 'H2', 'H3', 'H4', 'H5', 'H6', 'HR', 'I', 'INS', 'KBD', 'LI', + 'MARK', 'OL', 'P', 'PRE', 'Q', 'RB', 'RP', 'RT', 'RUBY', 'S', 'SAMP', 'SMALL', 'SPAN', 'STRIKE', 'STRONG', 'SUB', 'SUP', - 'TABLE', 'TD', 'TH', 'TR', 'TT', + 'TABLE', 'TD', 'TH', 'TIME', 'TR', 'TT', 'U', 'UL', 'WBR' ]) }, diff --git a/js/tests/parserTests.txt b/js/tests/parserTests.txt index 634cc80..fa06361 100644 --- a/js/tests/parserTests.txt +++ b/js/tests/parserTests.txt @@ -11365,6 +11365,20 @@ !! end +# TODO: generalize to PHP parser? +!! test +HTML5 tags +!! options +parsoid +!! input +five +The new millenium started +This highlighted text +!! result +five +The new millenium started +This highlighted text +!! end ### ### Nesting tests (see bug 41545, 50604, 51081) -- To view, visit https://gerrit.wikimedia.org/r/99011 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I668ad89aad9f6c798645d081b5971719175b7ea5 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Parsoid Gerrit-Branch: master Gerrit-Owner: GWicke Gerrit-Reviewer: Arlolra Gerrit-Reviewer: Marcoil Gerrit-Reviewer: Subramanya Sastry Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add "touch.php" for $wgAppleTouchIcon... - change (operations/mediawiki-config)
jenkins-bot has submitted this change and it was merged. Change subject: Add "touch.php" for $wgAppleTouchIcon... .. Add "touch.php" for $wgAppleTouchIcon... Change-Id: I6f83e6edfade9ed8669ed9c1cc5734dee18ebf59 --- A w/touch.php 1 file changed, 49 insertions(+), 0 deletions(-) Approvals: Tim Starling: Looks good to me, approved jenkins-bot: Verified diff --git a/w/touch.php b/w/touch.php new file mode 100644 index 000..8cb58e0 --- /dev/null +++ b/w/touch.php @@ -0,0 +1,49 @@ +$html\n"; +} + +function streamAppleTouch() { + global $wgAppleTouchIcon; + wfResetOutputBuffers(); + if ( $wgAppleTouchIcon === false ) { + # That's not very helpful, that's where we are already + header( 'HTTP/1.1 404 Not Found' ); + faviconShowError( "\$wgAppleTouchIcon is configured incorrectly, " . + "it must be set to something other than false \n" ); + return; + } + + $req = RequestContext::getMain()->getRequest(); + if ( $req->getHeader( 'X-Favicon-Loop' ) !== false ) { + header( 'HTTP/1.1 500 Internal Server Error' ); + faviconShowError( "Proxy forwarding loop detected" ); + return; + } + + $url = wfExpandUrl( $wgAppleTouchIcon, PROTO_INTERNAL ); + $client = MWHttpRequest::factory( $url ); + $client->setHeader( 'X-Favicon-Loop', '1' ); + + $status = $client->execute(); + if ( !$status->isOK() ) { + header( 'HTTP/1.1 500 Internal Server Error' ); + faviconShowError( htmlspecialchars( "Failed to fetch URL \"$url\"" ) ); + return; + } + + $content = $client->getContent(); + header( 'Content-Length: ' . strlen( $content ) ); + header( 'Content-Type: ' . $client->getResponseHeader( 'Content-Type' ) ); + header( 'Cache-Control: public' ); + header( 'Expires: ' . gmdate( 'r', time() + 86400 ) ); + echo $content; +} + +streamAppleTouch(); -- To view, visit https://gerrit.wikimedia.org/r/90886 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6f83e6edfade9ed8669ed9c1cc5734dee18ebf59 Gerrit-PatchSet: 2 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Reedy Gerrit-Reviewer: Tim Starling Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] [Browser test] Restoring a missing page element - change (mediawiki...VisualEditor)
Jhall has uploaded a new change for review. https://gerrit.wikimedia.org/r/99016 Change subject: [Browser test] Restoring a missing page element .. [Browser test] Restoring a missing page element Earlier check-in for a VE media interface test inadvertently re-named a page element that should not have changed. Change-Id: Iac1ef365e9cb3912977c8a89f3158ad9d122c93d --- M modules/ve-mw/test/browser/features/support/pages/visual_editor_page.rb 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor refs/changes/16/99016/1 diff --git a/modules/ve-mw/test/browser/features/support/pages/visual_editor_page.rb b/modules/ve-mw/test/browser/features/support/pages/visual_editor_page.rb index d2ae5d5..b488835 100644 --- a/modules/ve-mw/test/browser/features/support/pages/visual_editor_page.rb +++ b/modules/ve-mw/test/browser/features/support/pages/visual_editor_page.rb @@ -62,7 +62,7 @@ text_area(:describe_change, index: 0, frame: frame) a(:ex, title: 'Close', frame: frame) span(:insert_reference, text: 'Insert reference', frame: frame) -div(:media_diff_view, class: 've-ui-mwSaveDialog-viewer', frame: frame) +div(:diff_view, class: 've-ui-mwSaveDialog-viewer', frame: frame) text_field(:media_search, placeholder: 'Search for media', frame: frame) div(:media_select, class: 've-ui-mwMediaResultWidget-overlay', frame: frame) checkbox(:minor_edit, id: 'wpMinoredit', frame: frame) -- To view, visit https://gerrit.wikimedia.org/r/99016 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iac1ef365e9cb3912977c8a89f3158ad9d122c93d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/VisualEditor Gerrit-Branch: master Gerrit-Owner: Jhall ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] resourceloader: Make sure hashmtime cache key is different b... - change (mediawiki/core)
Ori.livneh has submitted this change and it was merged. Change subject: resourceloader: Make sure hashmtime cache key is different by language .. resourceloader: Make sure hashmtime cache key is different by language We were continuously invalidating the cache for the ResourceLoaderLanguageDataModule every time a request for a langauge other than the previous request came in as they all resulted in the same cache key. This could be resolved by adding $context->getLang() to the key (which would be enough for langdata module, but not enough for other uses of hashmtime), or by adding $context->getHash() (which will fragment it for all possible context factor combinations, slightly overkill for most cases, but would work). Instead resolving it the same way we did in d3bdda3 for a similar issue in #getDefinitionMtime: by adding the hash itself to the key. That way it will solve the problem, including two nice things: * Not fragment anymore than necessary (if it doesn't vary by skin, it won't vary by skin, and same for language etc.). * Always separate keys when the value is different (if something can very based on other factors, e.g. LocalSettings globals or whatever untracked method may exist for influencing anything, it will all work as expected). * Don't keep alternating and incrementing the timestamp while a multi-server infrastructure is syncing code (e.g. old code and new code for the same request context will not result in the same key and each old/new server alternatingly increasing the timestamp, instead the first new server will make the new key and the other servers will gradually start finding the new key with the timestamp of when it was first seen). Change-Id: Ifa9088c11c388ca6c912e62efc43494e91702603 (cherry picked from commit 044713c4dc089d956ac0894d54d41406ccc3be15) --- M includes/resourceloader/ResourceLoaderModule.php 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Ori.livneh: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/resourceloader/ResourceLoaderModule.php b/includes/resourceloader/ResourceLoaderModule.php index 11264fc..161c00a 100644 --- a/includes/resourceloader/ResourceLoaderModule.php +++ b/includes/resourceloader/ResourceLoaderModule.php @@ -407,7 +407,7 @@ } $cache = wfGetCache( CACHE_ANYTHING ); - $key = wfMemcKey( 'resourceloader', 'modulemodifiedhash', $this->getName() ); + $key = wfMemcKey( 'resourceloader', 'modulemodifiedhash', $this->getName(), $hash ); $data = $cache->get( $key ); if ( is_array( $data ) && $data['hash'] === $hash ) { -- To view, visit https://gerrit.wikimedia.org/r/99015 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ifa9088c11c388ca6c912e62efc43494e91702603 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: wmf/1.23wmf5 Gerrit-Owner: Ori.livneh Gerrit-Reviewer: Krinkle Gerrit-Reviewer: Ori.livneh Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] resourceloader: Make sure hashmtime cache key is different b... - change (mediawiki/core)
Ori.livneh has submitted this change and it was merged. Change subject: resourceloader: Make sure hashmtime cache key is different by language .. resourceloader: Make sure hashmtime cache key is different by language We were continuously invalidating the cache for the ResourceLoaderLanguageDataModule every time a request for a langauge other than the previous request came in as they all resulted in the same cache key. This could be resolved by adding $context->getLang() to the key (which would be enough for langdata module, but not enough for other uses of hashmtime), or by adding $context->getHash() (which will fragment it for all possible context factor combinations, slightly overkill for most cases, but would work). Instead resolving it the same way we did in d3bdda3 for a similar issue in #getDefinitionMtime: by adding the hash itself to the key. That way it will solve the problem, including two nice things: * Not fragment anymore than necessary (if it doesn't vary by skin, it won't vary by skin, and same for language etc.). * Always separate keys when the value is different (if something can very based on other factors, e.g. LocalSettings globals or whatever untracked method may exist for influencing anything, it will all work as expected). * Don't keep alternating and incrementing the timestamp while a multi-server infrastructure is syncing code (e.g. old code and new code for the same request context will not result in the same key and each old/new server alternatingly increasing the timestamp, instead the first new server will make the new key and the other servers will gradually start finding the new key with the timestamp of when it was first seen). Change-Id: Ifa9088c11c388ca6c912e62efc43494e91702603 (cherry picked from commit 044713c4dc089d956ac0894d54d41406ccc3be15) --- M includes/resourceloader/ResourceLoaderModule.php 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Ori.livneh: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/resourceloader/ResourceLoaderModule.php b/includes/resourceloader/ResourceLoaderModule.php index 11264fc..161c00a 100644 --- a/includes/resourceloader/ResourceLoaderModule.php +++ b/includes/resourceloader/ResourceLoaderModule.php @@ -407,7 +407,7 @@ } $cache = wfGetCache( CACHE_ANYTHING ); - $key = wfMemcKey( 'resourceloader', 'modulemodifiedhash', $this->getName() ); + $key = wfMemcKey( 'resourceloader', 'modulemodifiedhash', $this->getName(), $hash ); $data = $cache->get( $key ); if ( is_array( $data ) && $data['hash'] === $hash ) { -- To view, visit https://gerrit.wikimedia.org/r/99014 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ifa9088c11c388ca6c912e62efc43494e91702603 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: wmf/1.23wmf4 Gerrit-Owner: Ori.livneh Gerrit-Reviewer: Krinkle Gerrit-Reviewer: Ori.livneh Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] resourceloader: Make sure hashmtime cache key is different b... - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: resourceloader: Make sure hashmtime cache key is different by language .. resourceloader: Make sure hashmtime cache key is different by language We were continuously invalidating the cache for the ResourceLoaderLanguageDataModule every time a request for a langauge other than the previous request came in as they all resulted in the same cache key. This could be resolved by adding $context->getLang() to the key (which would be enough for langdata module, but not enough for other uses of hashmtime), or by adding $context->getHash() (which will fragment it for all possible context factor combinations, slightly overkill for most cases, but would work). Instead resolving it the same way we did in d3bdda3 for a similar issue in #getDefinitionMtime: by adding the hash itself to the key. That way it will solve the problem, including two nice things: * Not fragment anymore than necessary (if it doesn't vary by skin, it won't vary by skin, and same for language etc.). * Always separate keys when the value is different (if something can very based on other factors, e.g. LocalSettings globals or whatever untracked method may exist for influencing anything, it will all work as expected). * Don't keep alternating and incrementing the timestamp while a multi-server infrastructure is syncing code (e.g. old code and new code for the same request context will not result in the same key and each old/new server alternatingly increasing the timestamp, instead the first new server will make the new key and the other servers will gradually start finding the new key with the timestamp of when it was first seen). Change-Id: Ifa9088c11c388ca6c912e62efc43494e91702603 --- M includes/resourceloader/ResourceLoaderModule.php 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Catrope: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/resourceloader/ResourceLoaderModule.php b/includes/resourceloader/ResourceLoaderModule.php index db84dcf..429bcec 100644 --- a/includes/resourceloader/ResourceLoaderModule.php +++ b/includes/resourceloader/ResourceLoaderModule.php @@ -408,7 +408,7 @@ } $cache = wfGetCache( CACHE_ANYTHING ); - $key = wfMemcKey( 'resourceloader', 'modulemodifiedhash', $this->getName() ); + $key = wfMemcKey( 'resourceloader', 'modulemodifiedhash', $this->getName(), $hash ); $data = $cache->get( $key ); if ( is_array( $data ) && $data['hash'] === $hash ) { -- To view, visit https://gerrit.wikimedia.org/r/99010 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ifa9088c11c388ca6c912e62efc43494e91702603 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Krinkle Gerrit-Reviewer: Catrope Gerrit-Reviewer: Nikerabbit Gerrit-Reviewer: Ori.livneh Gerrit-Reviewer: Santhosh Gerrit-Reviewer: Siebrand Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Added support to img_auth.php for non-repo containers - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: Added support to img_auth.php for non-repo containers .. Added support to img_auth.php for non-repo containers * This adds a new $wgImgAuthUrlPathMap config variable * Also fixed ImgAuthBeforeStream hook msg formatting bug: 51136 Change-Id: I77528f92b20670e3b09adc79c49e62060f1614f3 --- M img_auth.php M includes/DefaultSettings.php 2 files changed, 39 insertions(+), 4 deletions(-) Approvals: Tim Starling: Looks good to me, approved jenkins-bot: Verified diff --git a/img_auth.php b/img_auth.php index c8759ec..2d2db9a 100644 --- a/img_auth.php +++ b/img_auth.php @@ -52,7 +52,7 @@ wfLogProfilingData(); function wfImageAuthMain() { - global $wgImgAuthPublicTest, $wgRequest; + global $wgImgAuthPublicTest, $wgImgAuthUrlPathMap, $wgRequest; // See if this is a public Wiki (no protections). if ( $wgImgAuthPublicTest @@ -77,12 +77,30 @@ // Check for bug 28235: QUERY_STRING overriding the correct extension $whitelist = array(); - $dotPos = strrpos( $path, '.' ); - if ( $dotPos !== false ) { - $whitelist[] = substr( $path, $dotPos + 1 ); + $extension = FileBackend::extensionFromPath( $path ); + if ( $extension != '' ) { + $whitelist[] = $extension; } if ( !$wgRequest->checkUrlExtension( $whitelist ) ) { return; + } + + // Various extensions may have their own backends that need access. + // Check if there is a special backend and storage base path for this file. + foreach ( $wgImgAuthUrlPathMap as $prefix => $storageDir ) { + $prefix = rtrim( $prefix, '/' ) . '/'; // implicit trailing slash + if ( strpos( $path, $prefix ) === 0 ) { + $be = FileBackendGroup::singleton()->backendFromPath( $storageDir ); + $filename = $storageDir . substr( $path, strlen( $prefix ) ); // strip prefix + if ( $be->fileExists( array( 'src' => $filename ) ) ) { + wfDebugLog( 'img_auth', "Streaming `" . $filename . "`." ); + $be->streamFile( array( 'src' => $filename ), + array( 'Cache-Control: private', 'Vary: Cookie' ) ); + } else { + wfForbidden( 'img-auth-accessdenied', 'img-auth-nofile', $filename ); + } + return; + } } // Get the local file repository @@ -145,6 +163,7 @@ $args = func_get_args(); array_shift( $args ); array_shift( $args ); + $args = ( isset( $args[0] ) && is_array( $args[0] ) ) ? $args[0] : $args; $msgHdr = wfMessage( $msg1 )->escaped(); $detailMsgKey = $wgImgAuthDetails ? $msg2 : 'badaccess-group0'; diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 3102384..e9e4545 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -362,6 +362,22 @@ $wgImgAuthPublicTest = true; /** + * Map of relative URL directories to match to internal mwstore:// base storage paths. + * For img_auth.php requests, everything after "img_auth.php/" is checked to see + * if starts with any of the prefixes defined here. The prefixes should not overlap. + * The prefix that matches has a corresponding storage path, which the rest of the URL + * is assumed to be relative to. The file at that path (or a 404) is send to the client. + * + * Example: + * $wgImgAuthUrlPathMap['/timeline/'] = 'mwstore://local-fs/timeline-render/'; + * The above maps ".../img_auth.php/timeline/X" to "mwstore://local-fs/timeline-render/". + * The name "local-fs" should correspond by name to an entry in $wgFileBackends. + * + * @see $wgFileBackends + */ +$wgImgAuthUrlPathMap = array(); + +/** * File repository structures * * $wgLocalFileRepo is a single repository structure, and $wgForeignFileRepos is -- To view, visit https://gerrit.wikimedia.org/r/95304 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I77528f92b20670e3b09adc79c49e62060f1614f3 Gerrit-PatchSet: 4 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Aaron Schulz Gerrit-Reviewer: Reedy Gerrit-Reviewer: Tim Starling Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Mobile redirect - changed cache Vary header - change (operations/mediawiki-config)
jenkins-bot has submitted this change and it was merged. Change subject: Mobile redirect - changed cache Vary header .. Mobile redirect - changed cache Vary header Change-Id: I759e9cbef62f2d491bcc89c276af469469cbdf51 --- M mobilelanding.php 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Faidon Liambotis: Looks good to me, approved jenkins-bot: Verified diff --git a/mobilelanding.php b/mobilelanding.php index 912c7f5..978e958 100644 --- a/mobilelanding.php +++ b/mobilelanding.php @@ -21,5 +21,5 @@ if ( $redirect !== false ) { header( 'Location: ' . $redirect ); } -header( 'Vary: X-Subdomain,X-CS,Cookie' ); +header( 'Vary: X-Forwarded-Proto,X-CS' ); header( 'Content-Type: text/html; charset=utf-8' ); -- To view, visit https://gerrit.wikimedia.org/r/97130 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I759e9cbef62f2d491bcc89c276af469469cbdf51 Gerrit-PatchSet: 2 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Yurik Gerrit-Reviewer: Dr0ptp4kt Gerrit-Reviewer: Faidon Liambotis Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix removal of title coordinates from extracts - change (operations/mediawiki-config)
jenkins-bot has submitted this change and it was merged. Change subject: Fix removal of title coordinates from extracts .. Fix removal of title coordinates from extracts Bug: 57668 Change-Id: I86315ebe39a155763011f5c6b52343c716485360 --- M wmf-config/InitialiseSettings.php 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: MaxSem: Looks good to me, approved jenkins-bot: Verified diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index cc22d72..d108d57 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -11241,7 +11241,7 @@ ), 'extracts' => array( '.metadata', - 'span.coordinates', + '#coordinates', 'span.geo-multi-punct', 'span.geo-nondefault', ), -- To view, visit https://gerrit.wikimedia.org/r/98848 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I86315ebe39a155763011f5c6b52343c716485360 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: MaxSem Gerrit-Reviewer: MaxSem Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Do not call API unless needed - change (mediawiki...ZeroRatedMobileAccess)
jenkins-bot has submitted this change and it was merged. Change subject: Do not call API unless needed .. Do not call API unless needed * Made calling the server on-demand, only if the client really needs it * Merged redux.js into interstitial.js * Show different message in case of an image warning Change-Id: I2143e652549a282e555b01646144cd9cc3c9703f --- M ZeroRatedMobileAccess.php M modules/ZeroOverlay.js D modules/carrierConfig.js M modules/interstitial.js D modules/redux.js 5 files changed, 169 insertions(+), 127 deletions(-) Approvals: Dr0ptp4kt: Looks good to me, approved jenkins-bot: Verified diff --git a/ZeroRatedMobileAccess.php b/ZeroRatedMobileAccess.php index 8f7ff21..f0f95a5 100644 --- a/ZeroRatedMobileAccess.php +++ b/ZeroRatedMobileAccess.php @@ -75,9 +75,10 @@ 'localBasePath' => $localBasePath, 'remoteExtPath' => $remoteExtPath, 'targets' => array( 'mobile' ), - 'scripts' => array( 'modules/ZeroOverlay.js', 'modules/carrierConfig.js', 'modules/banner.js', 'modules/interstitial.js', 'modules/redux.js' ), + 'scripts' => array( 'modules/ZeroOverlay.js', 'modules/banner.js', 'modules/interstitial.js' ), 'messages' => array( 'zero-rated-mobile-access-charge-auth', + 'zero-rated-mobile-access-file-auth', 'zero-rated-mobile-access-accept', 'zero-rated-mobile-access-go-back', 'zero-rated-mobile-access-dont-ask', diff --git a/modules/ZeroOverlay.js b/modules/ZeroOverlay.js index 04c45db..cc36926 100644 --- a/modules/ZeroOverlay.js +++ b/modules/ZeroOverlay.js @@ -1,14 +1,18 @@ /* global mw */ ( function( M ) { -var Overlay = M.require( 'Overlay' ), -ZeroOverlay = Overlay.extend( { +'use strict'; +var ZeroOverlay = M.require( 'Overlay' ).extend( { template: M.template.get( 'interstitial' ), closeOnBack: true, defaults: { yes: mw.msg( 'zero-rated-mobile-access-accept' ), no: mw.msg( 'zero-rated-mobile-access-go-back' ), -dontask: mw.msg( 'zero-rated-mobile-access-dont-ask' ), -warning: mw.msg( 'zero-rated-mobile-access-charge-auth' ), +dontask: mw.msg( 'zero-rated-mobile-access-dont-ask' ) +}, +initialize: function( options ) { +this.defaults.warning = mw.msg( +options.image ? 'zero-rated-mobile-access-file-auth' : 'zero-rated-mobile-access-charge-auth' ); +this._super( options ); }, postRender: function( options ) { this._super( options ); @@ -19,8 +23,11 @@ } } ); -M.router.route( /^interstitial\/(.*)/, function( url ) { -new ZeroOverlay( { url: url } ).show(); +M.router.route( /^zerosite\/(.*)/, function( url ) { +new ZeroOverlay( { url: url, image: false } ).show(); +} ); +M.router.route( /^zerofile\/(.*)/, function( url ) { +new ZeroOverlay( { url: url, image: true } ).show(); } ); M.define( 'ZeroOverlay', ZeroOverlay ); diff --git a/modules/carrierConfig.js b/modules/carrierConfig.js deleted file mode 100644 index 0b3cc59..000 --- a/modules/carrierConfig.js +++ /dev/null @@ -1,4 +0,0 @@ -( function( M ) { -var api = M.require( 'api' ); -M.define( 'carrierConfig', api.get( { action: 'zeroconfig', type: 'config' } ) ); -}( mw.mobileFrontend ) ); \ No newline at end of file diff --git a/modules/interstitial.js b/modules/interstitial.js index 20783b8..550ba07 100644 --- a/modules/interstitial.js +++ b/modules/interstitial.js @@ -1,80 +1,171 @@ /* global mw, jQuery */ ( function ( M, $ ) { 'use strict'; -var ZeroOverlay = M.require( 'ZeroOverlay' ), -carrierConf = M.require( 'carrierConfig' ); - $( function () { -carrierConf.done( function( conf ) { -$( 'a' ).on( 'click', function ( ev ) { -var httpsProxyingEnhanced = false, // whether Varnish handles HTTPS nicely -$target = $( this ), // onclick element -search = $target.prop( 'search' ), // query part of the link target URL -showWarning, // true if a warning page should be shown -toUrl, // target URL of the link -toAsAnchor, // target URL as a DOM object -toHost, // hostname part of the URL -currentHost; // hostname of the current page +var httpsProxyingEnhanced = false, // whether Varnish handles HTTPS nicely +hostname = document.location.hostname.toLowerCase(), // hostname of the current page +isMdot = hostname.indexOf( '.m.' ) !== -1, +isFromHttp = window.location.protocol.toLowerCase().indexOf( 'https' ) !== 0, +getConfig = ( function () {
[MediaWiki-commits] [Gerrit] Update VisualEditor to wmf4 branch for cherry-pick - change (mediawiki/core)
Catrope has submitted this change and it was merged. Change subject: Update VisualEditor to wmf4 branch for cherry-pick .. Update VisualEditor to wmf4 branch for cherry-pick Change-Id: I876e6f81be852c69a0f73851af637c6f57881674 --- M extensions/VisualEditor 1 file changed, 0 insertions(+), 0 deletions(-) Approvals: Catrope: Verified; Looks good to me, approved diff --git a/extensions/VisualEditor b/extensions/VisualEditor index 676130d..db15367 16 --- a/extensions/VisualEditor +++ b/extensions/VisualEditor -Subproject commit 676130da4d46ae2a1bdd2293002b7a1ff176c459 +Subproject commit db153676d30ab47a1b8a2e75873591070c9873b3 -- To view, visit https://gerrit.wikimedia.org/r/99013 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I876e6f81be852c69a0f73851af637c6f57881674 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: wmf/1.23wmf4 Gerrit-Owner: Catrope Gerrit-Reviewer: Catrope ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Update VisualEditor to 1.23wmf5 branch for cherry-pick - change (mediawiki/core)
Catrope has submitted this change and it was merged. Change subject: Update VisualEditor to 1.23wmf5 branch for cherry-pick .. Update VisualEditor to 1.23wmf5 branch for cherry-pick Change-Id: I758bf4f4ca1605120ad643cc987d21dc7a54c8c2 --- M extensions/VisualEditor 1 file changed, 0 insertions(+), 0 deletions(-) Approvals: Catrope: Verified; Looks good to me, approved diff --git a/extensions/VisualEditor b/extensions/VisualEditor index cff5f38..7b28e23 16 --- a/extensions/VisualEditor +++ b/extensions/VisualEditor -Subproject commit cff5f38b78bd1518013519359ea94878e4560c87 +Subproject commit 7b28e238ab5125dcac51e5a564e6ecec5e7fa786 -- To view, visit https://gerrit.wikimedia.org/r/99012 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I758bf4f4ca1605120ad643cc987d21dc7a54c8c2 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: wmf/1.23wmf5 Gerrit-Owner: Catrope Gerrit-Reviewer: Catrope ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Update VisualEditor to wmf4 branch for cherry-pick - change (mediawiki/core)
Catrope has uploaded a new change for review. https://gerrit.wikimedia.org/r/99013 Change subject: Update VisualEditor to wmf4 branch for cherry-pick .. Update VisualEditor to wmf4 branch for cherry-pick Change-Id: I876e6f81be852c69a0f73851af637c6f57881674 --- M extensions/VisualEditor 1 file changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/13/99013/1 diff --git a/extensions/VisualEditor b/extensions/VisualEditor index 676130d..db15367 16 --- a/extensions/VisualEditor +++ b/extensions/VisualEditor -Subproject commit 676130da4d46ae2a1bdd2293002b7a1ff176c459 +Subproject commit db153676d30ab47a1b8a2e75873591070c9873b3 -- To view, visit https://gerrit.wikimedia.org/r/99013 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I876e6f81be852c69a0f73851af637c6f57881674 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: wmf/1.23wmf4 Gerrit-Owner: Catrope ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Update VisualEditor to 1.23wmf5 branch for cherry-pick - change (mediawiki/core)
Catrope has uploaded a new change for review. https://gerrit.wikimedia.org/r/99012 Change subject: Update VisualEditor to 1.23wmf5 branch for cherry-pick .. Update VisualEditor to 1.23wmf5 branch for cherry-pick Change-Id: I758bf4f4ca1605120ad643cc987d21dc7a54c8c2 --- M extensions/VisualEditor 1 file changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/12/99012/1 diff --git a/extensions/VisualEditor b/extensions/VisualEditor index cff5f38..7b28e23 16 --- a/extensions/VisualEditor +++ b/extensions/VisualEditor -Subproject commit cff5f38b78bd1518013519359ea94878e4560c87 +Subproject commit 7b28e238ab5125dcac51e5a564e6ecec5e7fa786 -- To view, visit https://gerrit.wikimedia.org/r/99012 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I758bf4f4ca1605120ad643cc987d21dc7a54c8c2 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: wmf/1.23wmf5 Gerrit-Owner: Catrope ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Bug 54438: First part of core change 97caae596: support time... - change (mediawiki...Parsoid)
GWicke has uploaded a new change for review. https://gerrit.wikimedia.org/r/99011 Change subject: Bug 54438: First part of core change 97caae596: support time/data/mark elements .. Bug 54438: First part of core change 97caae596: support time/data/mark elements These are now allowed by default in the core sanitizer, so allow them in Parsoid too. Other parts of 97caae596 are not done yet. Will leave the bug open until the other changes are ported too. Change-Id: I668ad89aad9f6c798645d081b5971719175b7ea5 --- M js/lib/ext.core.Sanitizer.js M js/lib/mediawiki.wikitext.constants.js M js/tests/parserTests.txt 3 files changed, 23 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Parsoid refs/changes/11/99011/1 diff --git a/js/lib/ext.core.Sanitizer.js b/js/lib/ext.core.Sanitizer.js index c8fd3d9..ce9b161 100644 --- a/js/lib/ext.core.Sanitizer.js +++ b/js/lib/ext.core.Sanitizer.js @@ -551,7 +551,12 @@ // HTML 5 section 4.6 'bdi' : common, - 'wbr' : [ 'id', 'class', 'title', 'style' ] + 'wbr' : [ 'id', 'class', 'title', 'style' ], + + // HTML5 elements, defined by http://www.whatwg.org/html/ + 'data': common.concat(['value']), + 'time': common.concat(['datetime']), + 'mark': common }; } diff --git a/js/lib/mediawiki.wikitext.constants.js b/js/lib/mediawiki.wikitext.constants.js index 7fea8c1..0a1cd1f 100644 --- a/js/lib/mediawiki.wikitext.constants.js +++ b/js/lib/mediawiki.wikitext.constants.js @@ -71,19 +71,20 @@ 'ABBR', 'B', 'BDI', 'BDO', 'BIG', 'BLOCKQUOTE', 'BR', 'CAPTION', 'CENTER', 'CITE', 'CODE', - 'DD', 'DEL', 'DFN', 'DIV', 'DL', 'DT', + 'DATA', 'DD', 'DEL', 'DFN', 'DIV', 'DL', 'DT', 'EM', 'FONT', 'H1', 'H2', 'H3', 'H4', 'H5', 'H6', 'HR', 'I', 'INS', 'KBD', 'LI', + 'MARK', 'OL', 'P', 'PRE', 'Q', 'RB', 'RP', 'RT', 'RUBY', 'S', 'SAMP', 'SMALL', 'SPAN', 'STRIKE', 'STRONG', 'SUB', 'SUP', - 'TABLE', 'TD', 'TH', 'TR', 'TT', + 'TABLE', 'TD', 'TH', 'TIME', 'TR', 'TT', 'U', 'UL', 'WBR' ]) }, diff --git a/js/tests/parserTests.txt b/js/tests/parserTests.txt index 634cc80..fa06361 100644 --- a/js/tests/parserTests.txt +++ b/js/tests/parserTests.txt @@ -11365,6 +11365,20 @@ !! end +# TODO: generalize to PHP parser? +!! test +HTML5 tags +!! options +parsoid +!! input +five +The new millenium started +This highlighted text +!! result +five +The new millenium started +This highlighted text +!! end ### ### Nesting tests (see bug 41545, 50604, 51081) -- To view, visit https://gerrit.wikimedia.org/r/99011 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I668ad89aad9f6c798645d081b5971719175b7ea5 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Parsoid Gerrit-Branch: master Gerrit-Owner: GWicke ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] resourceloader: Make sure hashmtime cache key is different b... - change (mediawiki/core)
Krinkle has uploaded a new change for review. https://gerrit.wikimedia.org/r/99010 Change subject: resourceloader: Make sure hashmtime cache key is different by language .. resourceloader: Make sure hashmtime cache key is different by language We were infinitely invalidating the cache for the ResourceLoaderLanguageDataModule everytime a request for langauge other than the previous request came in as they all resulted in the same cache key. This could be resolved by adding $context->getLang() to the key (which would be enough for langdata module, but not enough for other uses of hashmtime), or by adding $context->getHash() (which will fragment it for all possible context factor combinations, slightly overkill for most cases, but would work). Instead resolving it the same way we did in d3bdda3 for a similar issue in #getDefinitionMtime: by adding the hash itself to the key. That way it will solve the problem, including two nice things: * Not fragment anymore than neccecary (if it doesn't vary by skin, it won't vary by skin, and same for language etc.). * Always separate keys when the value is different (if something can very based on other factors, e.g. LocalSettings globals or whatever untracked method may exist for influencing anything, it will all work as expected). * Don't keep alternating and incrementing the timestamp while a multi-server infrastructure is syncing code (e.g. old code and new code for the same request context will not result in the same key and each old/new server alternatingly increasing the timestamp, instead the first new server will make the new key and the other servers will gradually start finding the new key with the timestamp of when it was first seen). Change-Id: Ifa9088c11c388ca6c912e62efc43494e91702603 --- M includes/resourceloader/ResourceLoaderModule.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/10/99010/1 diff --git a/includes/resourceloader/ResourceLoaderModule.php b/includes/resourceloader/ResourceLoaderModule.php index db84dcf..429bcec 100644 --- a/includes/resourceloader/ResourceLoaderModule.php +++ b/includes/resourceloader/ResourceLoaderModule.php @@ -408,7 +408,7 @@ } $cache = wfGetCache( CACHE_ANYTHING ); - $key = wfMemcKey( 'resourceloader', 'modulemodifiedhash', $this->getName() ); + $key = wfMemcKey( 'resourceloader', 'modulemodifiedhash', $this->getName(), $hash ); $data = $cache->get( $key ); if ( is_array( $data ) && $data['hash'] === $hash ) { -- To view, visit https://gerrit.wikimedia.org/r/99010 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifa9088c11c388ca6c912e62efc43494e91702603 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Krinkle ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Disable VisualEditor in content namespaces on svwiktionary - change (operations/mediawiki-config)
jenkins-bot has submitted this change and it was merged. Change subject: Disable VisualEditor in content namespaces on svwiktionary .. Disable VisualEditor in content namespaces on svwiktionary We tried to only enable it in the User namespace, but the way the config was rigged up, the main namespace was added because it's a content namespace. Adding a flag to disable adding content namespaces, and only setting it for svwiktionary. Bug: 57356 Change-Id: Ie190a5853d5e17760cb6616dbaf9f3b2da4fa182 --- M wmf-config/CommonSettings.php M wmf-config/InitialiseSettings.php 2 files changed, 9 insertions(+), 0 deletions(-) Approvals: Catrope: Looks good to me, approved Jforrester: Looks good to me, but someone else must approve jenkins-bot: Verified diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php index e89e8b6..5f4bc32 100644 --- a/wmf-config/CommonSettings.php +++ b/wmf-config/CommonSettings.php @@ -1861,6 +1861,9 @@ $wgVisualEditorParsoidURL = 'http://10.2.2.29'; // parsoidcache.svc.eqiad.wmnet $wgVisualEditorParsoidPrefix = $wgDBname; $wgVisualEditorParsoidProblemReportURL = 'http://parsoid.wmflabs.org/_bugs/'; + if ( !$wmgVisualEditorInContentNamespaces ) { + $wgVisualEditorNamespaces = array(); // Wipe out default set by VisualEditor.php + } $wgVisualEditorNamespaces = array_merge( $wgVisualEditorNamespaces, $wmgVisualEditorNamespaces ); // VisualEditor namespace diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index cc22d72..e156c47 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -10597,6 +10597,12 @@ 'svwiktionary' => array( NS_USER ), // Bug 57356 ), +// Whether to add $wgContentNamespaces to $wmgVisualEditorNamespaces above +'wmgVisualEditorInContentNamespaces' => array( + 'default' => true, + 'svwiktionary' => false, +), + // Should a namespace in which VisualEditor is enabled by default for all users (including anons) 'wmgUseVisualEditorNamespace' => array( 'default' => false, -- To view, visit https://gerrit.wikimedia.org/r/98871 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie190a5853d5e17760cb6616dbaf9f3b2da4fa182 Gerrit-PatchSet: 3 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Catrope Gerrit-Reviewer: Catrope Gerrit-Reviewer: Jforrester Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Blacklist all versions of IE, as IE11 is now out - change (mediawiki...VisualEditor)
Catrope has submitted this change and it was merged. Change subject: Blacklist all versions of IE, as IE11 is now out .. Blacklist all versions of IE, as IE11 is now out … and is completely broken still. Change-Id: Ib8ddd40892688bd919ccc9d690e7bd3f2de6645e (cherry picked from commit 769f3ef0dbbc4fae43058bc84d25ba33fe056b15) --- M VisualEditor.php 1 file changed, 2 insertions(+), 1 deletion(-) Approvals: Catrope: Verified; Looks good to me, approved jenkins-bot: Verified diff --git a/VisualEditor.php b/VisualEditor.php index 5c112b8..fda0c63 100644 --- a/VisualEditor.php +++ b/VisualEditor.php @@ -845,7 +845,8 @@ // IE9 and IE10 generally work but fail in ajax handling when making POST // requests to the VisualEditor/Parsoid API which is causing silent failures // when trying to save a page (bug 49187) - 'msie' => array( array( '<=', 10 ) ), + // Also, IE11 doesn't work either right now + 'msie' => null, // Android 2.x and below "support" CE but don't trigger keyboard input 'android' => array( array( '<', 3 ) ), // Firefox issues in versions 12 and below (bug 50780) -- To view, visit https://gerrit.wikimedia.org/r/98882 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib8ddd40892688bd919ccc9d690e7bd3f2de6645e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/VisualEditor Gerrit-Branch: wmf/1.23wmf5 Gerrit-Owner: Jforrester Gerrit-Reviewer: Catrope Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Blacklist all versions of IE, as IE11 is now out - change (mediawiki...VisualEditor)
Catrope has submitted this change and it was merged. Change subject: Blacklist all versions of IE, as IE11 is now out .. Blacklist all versions of IE, as IE11 is now out … and is completely broken still. Change-Id: Ib8ddd40892688bd919ccc9d690e7bd3f2de6645e (cherry picked from commit 769f3ef0dbbc4fae43058bc84d25ba33fe056b15) --- M VisualEditor.php 1 file changed, 2 insertions(+), 1 deletion(-) Approvals: Catrope: Verified; Looks good to me, approved jenkins-bot: Verified diff --git a/VisualEditor.php b/VisualEditor.php index 04e7705..467a60d 100644 --- a/VisualEditor.php +++ b/VisualEditor.php @@ -909,7 +909,8 @@ // IE9 and IE10 generally work but fail in ajax handling when making POST // requests to the VisualEditor/Parsoid API which is causing silent failures // when trying to save a page (bug 49187) - 'msie' => array( array( '<=', 10 ) ), + // Also, IE11 doesn't work either right now + 'msie' => null, // Android 2.x and below "support" CE but don't trigger keyboard input 'android' => array( array( '<', 3 ) ), // Firefox issues in versions 12 and below (bug 50780) -- To view, visit https://gerrit.wikimedia.org/r/98883 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib8ddd40892688bd919ccc9d690e7bd3f2de6645e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/VisualEditor Gerrit-Branch: wmf/1.23wmf4 Gerrit-Owner: Jforrester Gerrit-Reviewer: Catrope Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix to post history link - change (mediawiki...Flow)
jenkins-bot has submitted this change and it was merged. Change subject: Fix to post history link .. Fix to post history link Change-Id: I9c459ae6db1c08c562c05db806bc27c5fa2f2d4b --- M includes/View/Post.php M templates/post.html.php 2 files changed, 4 insertions(+), 3 deletions(-) Approvals: EBernhardson: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/View/Post.php b/includes/View/Post.php index 557ced4..30cbe24 100644 --- a/includes/View/Post.php +++ b/includes/View/Post.php @@ -80,9 +80,10 @@ ); } - public function postHistoryLink( ) { + public function postHistoryLink( $blockName ) { return $this->actions->actionUrl( - 'post-history' + 'post-history', + array( $blockName . '[postId]' => $this->post->getPostId()->getHex() ) ); } diff --git a/templates/post.html.php b/templates/post.html.php index 8c71867..c047cf6 100644 --- a/templates/post.html.php +++ b/templates/post.html.php @@ -104,7 +104,7 @@ postHistoryLink(); + $historyLink = $postView->postHistoryLink( $block->getName() ); echo $this->render( 'flow:timestamp.html.php', array( 'historicalLink' => $historyLink, -- To view, visit https://gerrit.wikimedia.org/r/98987 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9c459ae6db1c08c562c05db806bc27c5fa2f2d4b Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/Flow Gerrit-Branch: master Gerrit-Owner: Bsitu Gerrit-Reviewer: EBernhardson Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Improve edit-post form - change (mediawiki...Flow)
Matthias Mullie has uploaded a new change for review. https://gerrit.wikimedia.org/r/99009 Change subject: Improve edit-post form .. Improve edit-post form Change-Id: I91d9669fb094902c3b0da534beb8712b528a8df1 --- M modules/base/ui-functions.js 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow refs/changes/09/99009/1 diff --git a/modules/base/ui-functions.js b/modules/base/ui-functions.js index 38d9ecd..22e297e 100644 --- a/modules/base/ui-functions.js +++ b/modules/base/ui-functions.js @@ -104,10 +104,12 @@ $postForm .append( $( '' ) + .addClass( 'mw-ui-input' ) .addClass( 'flow-edit-'+type+'-content' ) ) .append( $( '' ) + .addClass( 'flow-'+type+'-form-controls' ) .addClass( 'flow-edit-'+type+'-controls' ) .append( $( '' ) @@ -151,6 +153,7 @@ mw.flow.editor.load( $postForm.find( 'textarea' ), initialContent.content, initialContent.format ); $contentContainer.hide(); + $contentContainer.siblings( '.flow-datestamp' ).hide(); $postForm.flow( 'setupFormHandler', '.flow-edit-'+type+'-submit', -- To view, visit https://gerrit.wikimedia.org/r/99009 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I91d9669fb094902c3b0da534beb8712b528a8df1 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Flow Gerrit-Branch: master Gerrit-Owner: Matthias Mullie ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Update to latest bundler, latexer, and node_modules. - change (mediawiki...OfflineContentGenerator)
Cscott has uploaded a new change for review. https://gerrit.wikimedia.org/r/99008 Change subject: Update to latest bundler, latexer, and node_modules. .. Update to latest bundler, latexer, and node_modules. Change-Id: I2d7047ef9d4125522fca460b0ea4a92ffeacb574 --- M bundler M defaults.json M latex_renderer M node_modules 4 files changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Collection/OfflineContentGenerator refs/changes/08/99008/1 diff --git a/bundler b/bundler index edeb84d..428dbba 16 --- a/bundler +++ b/bundler -Subproject commit edeb84d91e8da02ddb6a62d0241d594c016d71da +Subproject commit 428dbba44250266c6e162a2e1b0de48d3e539b78 diff --git a/defaults.json b/defaults.json index 86c5121..f9629e5 100644 --- a/defaults.json +++ b/defaults.json @@ -22,17 +22,17 @@ }, "backend": { "bundler": { - "bin": "./bundler/bin/mw-bundler", + "bin": "./bundler/bin/mw-ocg-bundler", "parsoid_api": "http://localhost/";, "parsoid_prefix": "localhost" }, "writers": { "rdf2latex": { - "bin": "./latex_renderer/bin/mw-latexer", + "bin": "./latex_renderer/bin/mw-ocg-latexer", "extension": ".pdf" } }, "temp_dir": null } -} \ No newline at end of file +} diff --git a/latex_renderer b/latex_renderer index d45073d..dc980ee 16 --- a/latex_renderer +++ b/latex_renderer -Subproject commit d45073d248832812f1fd9a127264906a44f73bc0 +Subproject commit dc980eec11ac06963e3b94e1a7e3651e7c8d4621 diff --git a/node_modules b/node_modules index 7a62ca9..c61d8c5 16 --- a/node_modules +++ b/node_modules -Subproject commit 7a62ca925d0c7a09264242ec1055b0e13cdc4561 +Subproject commit c61d8c5924c3805022e95cb50b187f053191eb01 -- To view, visit https://gerrit.wikimedia.org/r/99008 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2d7047ef9d4125522fca460b0ea4a92ffeacb574 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Collection/OfflineContentGenerator Gerrit-Branch: master Gerrit-Owner: Cscott ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix test2wiki to only have Cirrus as primary, not both - change (operations/mediawiki-config)
Chad has uploaded a new change for review. https://gerrit.wikimedia.org/r/99007 Change subject: Fix test2wiki to only have Cirrus as primary, not both .. Fix test2wiki to only have Cirrus as primary, not both When we move the 'cirrus' group back to default, we can add it back to the dblist then. Change-Id: Ia9e06bb67cd8ee9dfd003e6eed87ba3bcf475fff --- M cirrus.dblist 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/07/99007/1 diff --git a/cirrus.dblist b/cirrus.dblist index 6bdad35..911b45f 100644 --- a/cirrus.dblist +++ b/cirrus.dblist @@ -99,7 +99,6 @@ suwikibooks swwikibooks tenwiki -test2wiki testwiki testwikidatawiki thwikinews -- To view, visit https://gerrit.wikimedia.org/r/99007 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia9e06bb67cd8ee9dfd003e6eed87ba3bcf475fff Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Chad ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix test2wiki to only have Cirrus as primary, not both - change (operations/mediawiki-config)
Chad has submitted this change and it was merged. Change subject: Fix test2wiki to only have Cirrus as primary, not both .. Fix test2wiki to only have Cirrus as primary, not both When we move the 'cirrus' group back to default, we can add it back to the dblist then. Change-Id: Ia9e06bb67cd8ee9dfd003e6eed87ba3bcf475fff --- M cirrus.dblist 1 file changed, 0 insertions(+), 1 deletion(-) Approvals: Chad: Verified; Looks good to me, approved diff --git a/cirrus.dblist b/cirrus.dblist index 6bdad35..911b45f 100644 --- a/cirrus.dblist +++ b/cirrus.dblist @@ -99,7 +99,6 @@ suwikibooks swwikibooks tenwiki -test2wiki testwiki testwikidatawiki thwikinews -- To view, visit https://gerrit.wikimedia.org/r/99007 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia9e06bb67cd8ee9dfd003e6eed87ba3bcf475fff Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Chad Gerrit-Reviewer: Chad ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Update OOJS UI to v0.1.0-pre (45888b3aff30) - change (mediawiki...VisualEditor)
Jforrester has uploaded a new change for review. https://gerrit.wikimedia.org/r/99005 Change subject: Update OOJS UI to v0.1.0-pre (45888b3aff30) .. Update OOJS UI to v0.1.0-pre (45888b3aff30) Change-Id: I6ee131ec79af31e04507318f19fe8ae56af6404d --- M modules/oojs-ui/oojs-ui.js M modules/oojs-ui/oojs-ui.svg.css 2 files changed, 444 insertions(+), 326 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor refs/changes/05/99005/1 diff --git a/modules/oojs-ui/oojs-ui.js b/modules/oojs-ui/oojs-ui.js index f952bd3..c3c969e 100644 --- a/modules/oojs-ui/oojs-ui.js +++ b/modules/oojs-ui/oojs-ui.js @@ -1,12 +1,12 @@ /*! - * OOJS UI v0.1.0-pre (e5ef1e5b28) + * OOJS UI v0.1.0-pre (45888b3aff) * https://www.mediawiki.org/wiki/OOJS * * Copyright 2011-2013 OOJS Team and other contributors. * Released under the MIT license * http://oojs.mit-license.org * - * Date: Mon Nov 25 2013 10:40:32 GMT+ (GMT) + * Date: Tue Dec 03 2013 16:04:16 GMT-0800 (PST) */ ( function () { @@ -83,10 +83,6 @@ var messages = { // Label text for button to exit from dialog 'ooui-dialog-action-close': 'Close', - // TODO remove me - 'ooui-inspector-close-tooltip': 'Close', - // TODO remove me - 'ooui-inspector-remove-tooltip': 'Remove', // Tool tip for a button that moves items in a list down one place 'ooui-outline-control-move-down': 'Move item down', // Tool tip for a button that moves items in a list up one place @@ -615,6 +611,10 @@ * frame's document. It then polls the document to see when all styles have loaded, and once they * have, invokes the callback. * + * If the styles still haven't loaded after a long time (5 seconds by default), we give up waiting + * and invoke the callback anyway. This protects against cases like a display: none; iframe in + * Firefox, where the styles won't load until the iframe becomes visible. + * * For details of how we arrived at the strategy used in this function, see #load. * * @static @@ -623,9 +623,10 @@ * @param {HTMLDocument} parentDoc Document to transplant styles from * @param {HTMLDocument} frameDoc Document to transplant styles to * @param {Function} [callback] Callback to execute once styles have loaded + * @param {number} [timeout=5000] How long to wait before giving up (in ms). If 0, never give up. */ -OO.ui.Frame.static.transplantStyles = function ( parentDoc, frameDoc, callback ) { - var i, numSheets, styleNode, newNode, timeout, pollNodeId, $pendingPollNodes, +OO.ui.Frame.static.transplantStyles = function ( parentDoc, frameDoc, callback, timeout ) { + var i, numSheets, styleNode, newNode, timeoutID, pollNodeId, $pendingPollNodes, $pollNodes = $( [] ), // Fake font-family value fontFamily = 'oo-ui-frame-transplantStyles-loaded'; @@ -657,7 +658,7 @@ if ( callback ) { // Poll every 100ms until all external stylesheets have loaded $pendingPollNodes = $pollNodes; - timeout = setTimeout( function pollExternalStylesheets() { + timeoutID = setTimeout( function pollExternalStylesheets() { while ( $pendingPollNodes.length > 0 && $pendingPollNodes.eq( 0 ).css( 'font-family' ) === fontFamily @@ -667,12 +668,26 @@ if ( $pendingPollNodes.length === 0 ) { // We're done! - $pollNodes.remove(); - callback(); + if ( timeoutID !== null ) { + timeoutID = null; + $pollNodes.remove(); + callback(); + } } else { - timeout = setTimeout( pollExternalStylesheets, 100 ); + timeoutID = setTimeout( pollExternalStylesheets, 100 ); } }, 100 ); + // ...but give up after a while + if ( timeout !== 0 ) { + setTimeout( function () { + if ( timeoutID ) { + clearTimeout( timeoutID ); + timeoutID = null; + $pollNodes.remove(); + callback(); + } + }, timeout || 5000 ); + } } }; @@ -3109,10 +3124,12 @@ * * @constructor * @param {Object} [config] Configuration options - * @param {boolean} [config.attachPagesPanel] Whether or not to attach pagesPanel to this.$element on - * i
[MediaWiki-commits] [Gerrit] [Experimental] div contenteditable editor - change (mediawiki...Flow)
Matthias Mullie has uploaded a new change for review. https://gerrit.wikimedia.org/r/99004 Change subject: [Experimental] div contenteditable editor .. [Experimental] div contenteditable editor One "drawback" of using plain old textareas is that there's quite a visual difference between the content being edited, and the final parsed content. Obviously, all wikitext magic that needs to be parsed can't be "fixed"; there'll always be a difference between wikitext & final output. There's another significant difference that we can tackly relatively easily, though: paragraph spacing. A newline in the wikitext textarea will be just some meaningless whitespace in the end. 2 newlines will be a new paragraph. There's no way to "style" the textarea so it somewhat resembles final html output. However, using a contenteditable div, we can simply use p elements where we write out text in! This is a wikitext-editor where the paragraphs will actually look like they will in the final output. Change-Id: I978942567a55367b882c7d252a02617b50835ad4 --- M Flow.php M Resources.php A modules/editor/editors/ext.flow.editors.contenteditable.js 3 files changed, 142 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow refs/changes/04/99004/1 diff --git a/Flow.php b/Flow.php index 20d349c..77e57d3 100755 --- a/Flow.php +++ b/Flow.php @@ -245,7 +245,7 @@ $wgFlowMaxThreadingDepth = 2; // A list of editors to use, in priority order -$wgFlowEditorList = array( 'visualeditor', 'none' ); +$wgFlowEditorList = array( 'visualeditor', 'contenteditable', 'none' ); // Action details config file require $dir . 'FlowActions.php'; diff --git a/Resources.php b/Resources.php index ca12260..35ba642 100644 --- a/Resources.php +++ b/Resources.php @@ -151,6 +151,9 @@ // ve dependencies will be loaded via JS ), ), + 'ext.flow.editors.contenteditable' => $flowResourceTemplate + array( + 'scripts' => 'editor/editors/ext.flow.editors.contenteditable.js', + ), 'ext.flow.editors.none' => $flowResourceTemplate + array( 'scripts' => 'editor/editors/ext.flow.editors.none.js', ), diff --git a/modules/editor/editors/ext.flow.editors.contenteditable.js b/modules/editor/editors/ext.flow.editors.contenteditable.js new file mode 100644 index 000..63abdeb --- /dev/null +++ b/modules/editor/editors/ext.flow.editors.contenteditable.js @@ -0,0 +1,138 @@ +( function ( $, mw ) { + 'use strict'; + + /** +* @param {jQuery} $node +* @param {string} [content=''] +*/ + mw.flow.editors.contenteditable = function ( $node, content ) { + this.$node = $node; + $node.hide(); + + // create contenteditable node + this.$target = $( '' ) + .addClass( $node.get( 0 ).className ) + .insertAfter( $node ); + + this.$target.focus(); + + /* +* Now make sure there's enough starting space for at least 1 line. +* If there's no content, the empty paragraph's height will be 0, so +* let's just add some dummy content and use it to set the +* contenteditable's min height. +*/ + this.setRawContent( 'temp' ); + this.$target.css( 'min-height', this.$target.height() ); + this.setRawContent( content || '' ); + + // let's never get into a situation where the cursor is outside a p + this.$target.on( 'focus keydown mousedown', this.resetCursor.bind( this ) ); + + // simulate a keyup event on the original node, so the validation code + // will pick up changes in the new node + this.$target.keyup( function () { + this.$node.keyup(); + }.bind( this ) ); + }; + + /** +* Type of content to use (html or wikitext) +* +* @var string +*/ + mw.flow.editors.contenteditable.format = 'wikitext'; + + mw.flow.editors.contenteditable.isSupported = function() { + return 'contentEditable' in document.documentElement; + }; + + mw.flow.editors.contenteditable.prototype.destroy = function () { + this.$target.remove(); + + // re-display original node + this.$node.show(); + }; + + /** +* @return {string} +*/ + mw.flow.editors.contenteditable.prototype.getRawContent = function () { + var $content = this.$target.clone(); + + // transform paragraphs into double newlines, breaks into single newline + $content.find( 'p' ).before( "\n\n" ); + $content.find( 'br' ).before( "\n" ); + +
[MediaWiki-commits] [Gerrit] Fetch PDFs when used as images, and thumbnails for embedded ... - change (mediawiki...bundler)
jenkins-bot has submitted this change and it was merged. Change subject: Fetch PDFs when used as images, and thumbnails for embedded video. .. Fetch PDFs when used as images, and thumbnails for embedded video. Change-Id: Ie44bac0f6579796d4fb943ee4d8419aaea25e7f0 --- M lib/image.js M lib/index.js 2 files changed, 23 insertions(+), 13 deletions(-) Approvals: Cscott: Looks good to me, approved jenkins-bot: Verified diff --git a/lib/image.js b/lib/image.js index 8b8f1e0..2bfb4d8 100644 --- a/lib/image.js +++ b/lib/image.js @@ -64,9 +64,28 @@ status.report(null, img.short); } + var realURL = img.imageinfo.url || // link to actual image + img.resource.replace(/\/File:/, '/Special:Redirect/file/'); + + // use thumbnail if resolution is too high or filetype is wrong + var suffix = img.short.replace(/^.*([.][^.]+)$/, '$1'); + var isVector = (img.imageinfo.mediatype === 'DRAWING' || + img.imageinfo.mime === 'application/pdf'); + var isVideo = (img.imageinfo.mediatype === 'VIDEO'); + var isTooBig = (img.imageinfo.width > img.imagesize); + var proposedName = img.short; + if ((!isVector) && (isTooBig || isVideo) && + /\/\d+(px-[^\/]+)$/.test(img.src)) { + realURL = img.src.replace(/\/\d+(px-[^\/]+)$/, '/'+maxRes+'$1'); + if (!img.src.endsWith(suffix)) { + // fix up the suffix if we need to (thumbnail for video, etc) + proposedName += img.src.replace(/^.*([.][^.]+)$/, '$1'); + } + } + // return a promise for a uniq & cleaned name, and an output stream. var outStream = function() { - var name = cleanFilename(img.short); + var name = cleanFilename(proposedName); return when.resolve().then(function() { return P.call(fs.open, fs, path.join(imagedir, name), 'w+'); }).then(function(fd) { @@ -90,17 +109,6 @@ return fs.createWriteStream(name, { fd: fd }); }); }; - - var realURL = img.imageinfo.url || // link to actual image - img.resource.replace(/\/File:/, '/Special:Redirect/file/'); - - // use thumbnail if resolution is too high - var suffix = img.short.replace(/^.*([.][^.]+)$/, '$1'); - if ((img.imageinfo.width > img.imagesize) && - /\/\d+(px-[^\/]+)$/.test(img.src) && - img.src.endsWith(suffix)) { - realURL = img.src.replace(/\/\d+(px-[^\/]+)$/, '/'+maxRes+'$1'); - } var req = request({ url: realURL, encoding: null }). on('end', function() { diff --git a/lib/index.js b/lib/index.js index dae7765..0d86e2a 100644 --- a/lib/index.js +++ b/lib/index.js @@ -159,7 +159,9 @@ imageMap.forEach(function(img) { var p = imageloader.fetchMetadata(img, status).then(function() { if (img.imageinfo.mediatype === 'BITMAP' || - img.imageinfo.mediatype === 'DRAWING') { + img.imageinfo.mediatype === 'DRAWING' || + img.imageinfo.mediatype === 'VIDEO' || + img.imageinfo.mime === 'application/pdf') { return imageloader.fetch(img, imagedir, status); } else { status.report(); -- To view, visit https://gerrit.wikimedia.org/r/99002 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie44bac0f6579796d4fb943ee4d8419aaea25e7f0 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Collection/OfflineContentGenerator/bundler Gerrit-Branch: master Gerrit-Owner: Cscott Gerrit-Reviewer: Cscott Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add disabled handling to InputWidget - change (oojs/ui)
jenkins-bot has submitted this change and it was merged. Change subject: Add disabled handling to InputWidget .. Add disabled handling to InputWidget Currently InputWidget has a readonly state, but not a disabled state; this adds the latter for cases where the former are not appropriate. Change-Id: I0afea069b4e0913a656c8ac713a9cee2a47cfa87 --- M src/widgets/OO.ui.InputWidget.js 1 file changed, 15 insertions(+), 2 deletions(-) Approvals: Robmoen: Looks good to me, approved jenkins-bot: Verified diff --git a/src/widgets/OO.ui.InputWidget.js b/src/widgets/OO.ui.InputWidget.js index e95a87b..72e22ac 100644 --- a/src/widgets/OO.ui.InputWidget.js +++ b/src/widgets/OO.ui.InputWidget.js @@ -22,14 +22,16 @@ // Properties this.$input = this.getInputElement( config ); this.value = ''; - this.readonly = false; + this.readOnly = false; this.inputFilter = config.inputFilter; // Events this.$input.on( 'keydown mouseup cut paste change input select', OO.ui.bind( this.onEdit, this ) ); // Initialization - this.$input.attr( 'name', config.name ); + this.$input + .attr( 'name', config.name ) + .prop( 'disabled', this.disabled ); this.setReadOnly( config.readOnly ); this.$element.addClass( 'oo-ui-inputWidget' ).append( this.$input ); this.setValue( config.value ); @@ -165,3 +167,14 @@ this.$input.prop( 'readonly', this.readOnly ); return this; }; + +/** + * @inheritdoc + */ +OO.ui.InputWidget.prototype.setDisabled = function ( state ) { + OO.ui.Widget.prototype.setDisabled.call( this, state ); + if ( this.$input ) { + this.$input.prop( 'disabled', this.disabled ); + } + return this; +}; \ No newline at end of file -- To view, visit https://gerrit.wikimedia.org/r/98042 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0afea069b4e0913a656c8ac713a9cee2a47cfa87 Gerrit-PatchSet: 3 Gerrit-Project: oojs/ui Gerrit-Branch: master Gerrit-Owner: Jforrester Gerrit-Reviewer: Catrope Gerrit-Reviewer: Mattflaschen Gerrit-Reviewer: Robmoen Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add non-enwiki test case. - change (mediawiki...bundler)
jenkins-bot has submitted this change and it was merged. Change subject: Add non-enwiki test case. .. Add non-enwiki test case. Change-Id: Ib5abe69801bf04087766b3d1ebdcead47f54a791 --- A samples/papier.json M test/samples.js 2 files changed, 84 insertions(+), 1 deletion(-) Approvals: Cscott: Looks good to me, approved jenkins-bot: Verified diff --git a/samples/papier.json b/samples/papier.json new file mode 100644 index 000..de19f98 --- /dev/null +++ b/samples/papier.json @@ -0,0 +1,83 @@ +{ + "type": "collection", + "title": "", + "subtitle": "", + "summary": "", + "version": 1, + "items": [ +{ + "type": "article", + "title": "Papier", + "content_type": "text/x-wiki", + "url": "http://de.wikipedia.org/wiki/Papier";, + "wiki": 0, + "revision": "124970893" +} + ], + "licenses": [ +{ + "mw_rights_icon": "", + "mw_rights_page": "", + "mw_rights_text": "", + "mw_rights_url": "", + "name": "License", + "type": "license" +} + ], + "wikis": [ +{ + "type": "wikiconf", + "baseurl": "http://de.wikipedia.org/w";, + "imagesize": 1200, + "keep_tmpfiles": false, + "script_extension": ".php", + "format": "nuwiki", + "parsoid": "http://parsoid-lb.eqiad.wikimedia.org/";, + "prefix": "dewiki", + "filerepos": [ +{ + "name": "shared", + "displayname": "Wikimedia Commons", + "rootUrl": "//upload.wikimedia.org/wikipedia/commons", + "local": false, + "type": "filerepo", + "scriptDirUrl": "http://commons.wikimedia.org/w";, + "wiki": 1 +}, +{ + "name": "local", + "displayname": null, + "rootUrl": "//upload.wikimedia.org/wikipedia/de", + "local": true, + "type": "filerepo", + "wiki": 0 +} + ] +}, +{ + "type": "wikiconf", + "baseurl": "http://commons.wikimedia.org/w";, + "imagesize": 1200, + "keep_tmpfiles": false, + "script_extension": ".php", + "format": "nuwiki", + "prefix": "commonswiki", + "parsoid": "http://parsoid-lb.eqiad.wikimedia.org/";, + "filerepos": [ +{ + "name": "local", + "displayname": null, + "rootUrl": "//upload.wikimedia.org/wikipedia/commons", + "local": true, + "url": "//upload.wikimedia.org/wikipedia/commons", + "thumbUrl": "//upload.wikimedia.org/wikipedia/commons/thumb", + "initialCapital": true, + "scriptDirUrl": "/w", + "type": "filerepo", + "wiki": 1 +} + ] +} + ], + "lang": "de" +} \ No newline at end of file diff --git a/test/samples.js b/test/samples.js index dace614..e3ffd3d 100644 --- a/test/samples.js +++ b/test/samples.js @@ -8,7 +8,7 @@ // ensure that we don't crash on any of our sample inputs describe("Basic crash test", function() { - ['taoism.json', 'hurricanes.json' /*, 'us.json'*/].forEach(function(name) { + ['taoism.json', 'hurricanes.json', 'papier.json'].forEach(function(name) { describe(name, function() { it('should bundle', function(done) { this.timeout(0); -- To view, visit https://gerrit.wikimedia.org/r/99001 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib5abe69801bf04087766b3d1ebdcead47f54a791 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Collection/OfflineContentGenerator/bundler Gerrit-Branch: master Gerrit-Owner: Cscott Gerrit-Reviewer: Cscott Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] "Use this file" does not contain license information Bug: 56588 - change (mediawiki...MultimediaViewer)
Yamelnychuk has uploaded a new change for review. https://gerrit.wikimedia.org/r/99003 Change subject: "Use this file" does not contain license information Bug: 56588 .. "Use this file" does not contain license information Bug: 56588 Change-Id: I7699219d039336b42ecb8fcfbdc4c82ca21409f7 --- M resources/ext.multimediaViewer/ext.multimediaViewer.lightboxinterface.js 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MultimediaViewer refs/changes/03/99003/1 diff --git a/resources/ext.multimediaViewer/ext.multimediaViewer.lightboxinterface.js b/resources/ext.multimediaViewer/ext.multimediaViewer.lightboxinterface.js index 361ea64..d26c487 100644 --- a/resources/ext.multimediaViewer/ext.multimediaViewer.lightboxinterface.js +++ b/resources/ext.multimediaViewer/ext.multimediaViewer.lightboxinterface.js @@ -294,7 +294,7 @@ .prop( 'id', owId ) .prop( 'readonly', true ) .click( selectAllOnEvent ) - .val( '' ), + .val( '' ), $offWiki = $( '' ) .append( -- To view, visit https://gerrit.wikimedia.org/r/99003 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7699219d039336b42ecb8fcfbdc4c82ca21409f7 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MultimediaViewer Gerrit-Branch: master Gerrit-Owner: Yamelnychuk ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add non-enwiki test case. - change (mediawiki...bundler)
Cscott has uploaded a new change for review. https://gerrit.wikimedia.org/r/99001 Change subject: Add non-enwiki test case. .. Add non-enwiki test case. Change-Id: Ib5abe69801bf04087766b3d1ebdcead47f54a791 --- A samples/papier.json M test/samples.js 2 files changed, 84 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Collection/OfflineContentGenerator/bundler refs/changes/01/99001/1 diff --git a/samples/papier.json b/samples/papier.json new file mode 100644 index 000..de19f98 --- /dev/null +++ b/samples/papier.json @@ -0,0 +1,83 @@ +{ + "type": "collection", + "title": "", + "subtitle": "", + "summary": "", + "version": 1, + "items": [ +{ + "type": "article", + "title": "Papier", + "content_type": "text/x-wiki", + "url": "http://de.wikipedia.org/wiki/Papier";, + "wiki": 0, + "revision": "124970893" +} + ], + "licenses": [ +{ + "mw_rights_icon": "", + "mw_rights_page": "", + "mw_rights_text": "", + "mw_rights_url": "", + "name": "License", + "type": "license" +} + ], + "wikis": [ +{ + "type": "wikiconf", + "baseurl": "http://de.wikipedia.org/w";, + "imagesize": 1200, + "keep_tmpfiles": false, + "script_extension": ".php", + "format": "nuwiki", + "parsoid": "http://parsoid-lb.eqiad.wikimedia.org/";, + "prefix": "dewiki", + "filerepos": [ +{ + "name": "shared", + "displayname": "Wikimedia Commons", + "rootUrl": "//upload.wikimedia.org/wikipedia/commons", + "local": false, + "type": "filerepo", + "scriptDirUrl": "http://commons.wikimedia.org/w";, + "wiki": 1 +}, +{ + "name": "local", + "displayname": null, + "rootUrl": "//upload.wikimedia.org/wikipedia/de", + "local": true, + "type": "filerepo", + "wiki": 0 +} + ] +}, +{ + "type": "wikiconf", + "baseurl": "http://commons.wikimedia.org/w";, + "imagesize": 1200, + "keep_tmpfiles": false, + "script_extension": ".php", + "format": "nuwiki", + "prefix": "commonswiki", + "parsoid": "http://parsoid-lb.eqiad.wikimedia.org/";, + "filerepos": [ +{ + "name": "local", + "displayname": null, + "rootUrl": "//upload.wikimedia.org/wikipedia/commons", + "local": true, + "url": "//upload.wikimedia.org/wikipedia/commons", + "thumbUrl": "//upload.wikimedia.org/wikipedia/commons/thumb", + "initialCapital": true, + "scriptDirUrl": "/w", + "type": "filerepo", + "wiki": 1 +} + ] +} + ], + "lang": "de" +} \ No newline at end of file diff --git a/test/samples.js b/test/samples.js index dace614..e3ffd3d 100644 --- a/test/samples.js +++ b/test/samples.js @@ -8,7 +8,7 @@ // ensure that we don't crash on any of our sample inputs describe("Basic crash test", function() { - ['taoism.json', 'hurricanes.json' /*, 'us.json'*/].forEach(function(name) { + ['taoism.json', 'hurricanes.json', 'papier.json'].forEach(function(name) { describe(name, function() { it('should bundle', function(done) { this.timeout(0); -- To view, visit https://gerrit.wikimedia.org/r/99001 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib5abe69801bf04087766b3d1ebdcead47f54a791 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Collection/OfflineContentGenerator/bundler Gerrit-Branch: master Gerrit-Owner: Cscott ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fetch PDFs when used as images, and thumbnails for embedded ... - change (mediawiki...bundler)
Cscott has uploaded a new change for review. https://gerrit.wikimedia.org/r/99002 Change subject: Fetch PDFs when used as images, and thumbnails for embedded video. .. Fetch PDFs when used as images, and thumbnails for embedded video. Change-Id: Ie44bac0f6579796d4fb943ee4d8419aaea25e7f0 --- M lib/image.js M lib/index.js 2 files changed, 23 insertions(+), 13 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Collection/OfflineContentGenerator/bundler refs/changes/02/99002/1 diff --git a/lib/image.js b/lib/image.js index 8b8f1e0..2bfb4d8 100644 --- a/lib/image.js +++ b/lib/image.js @@ -64,9 +64,28 @@ status.report(null, img.short); } + var realURL = img.imageinfo.url || // link to actual image + img.resource.replace(/\/File:/, '/Special:Redirect/file/'); + + // use thumbnail if resolution is too high or filetype is wrong + var suffix = img.short.replace(/^.*([.][^.]+)$/, '$1'); + var isVector = (img.imageinfo.mediatype === 'DRAWING' || + img.imageinfo.mime === 'application/pdf'); + var isVideo = (img.imageinfo.mediatype === 'VIDEO'); + var isTooBig = (img.imageinfo.width > img.imagesize); + var proposedName = img.short; + if ((!isVector) && (isTooBig || isVideo) && + /\/\d+(px-[^\/]+)$/.test(img.src)) { + realURL = img.src.replace(/\/\d+(px-[^\/]+)$/, '/'+maxRes+'$1'); + if (!img.src.endsWith(suffix)) { + // fix up the suffix if we need to (thumbnail for video, etc) + proposedName += img.src.replace(/^.*([.][^.]+)$/, '$1'); + } + } + // return a promise for a uniq & cleaned name, and an output stream. var outStream = function() { - var name = cleanFilename(img.short); + var name = cleanFilename(proposedName); return when.resolve().then(function() { return P.call(fs.open, fs, path.join(imagedir, name), 'w+'); }).then(function(fd) { @@ -90,17 +109,6 @@ return fs.createWriteStream(name, { fd: fd }); }); }; - - var realURL = img.imageinfo.url || // link to actual image - img.resource.replace(/\/File:/, '/Special:Redirect/file/'); - - // use thumbnail if resolution is too high - var suffix = img.short.replace(/^.*([.][^.]+)$/, '$1'); - if ((img.imageinfo.width > img.imagesize) && - /\/\d+(px-[^\/]+)$/.test(img.src) && - img.src.endsWith(suffix)) { - realURL = img.src.replace(/\/\d+(px-[^\/]+)$/, '/'+maxRes+'$1'); - } var req = request({ url: realURL, encoding: null }). on('end', function() { diff --git a/lib/index.js b/lib/index.js index dae7765..0d86e2a 100644 --- a/lib/index.js +++ b/lib/index.js @@ -159,7 +159,9 @@ imageMap.forEach(function(img) { var p = imageloader.fetchMetadata(img, status).then(function() { if (img.imageinfo.mediatype === 'BITMAP' || - img.imageinfo.mediatype === 'DRAWING') { + img.imageinfo.mediatype === 'DRAWING' || + img.imageinfo.mediatype === 'VIDEO' || + img.imageinfo.mime === 'application/pdf') { return imageloader.fetch(img, imagedir, status); } else { status.report(); -- To view, visit https://gerrit.wikimedia.org/r/99002 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie44bac0f6579796d4fb943ee4d8419aaea25e7f0 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Collection/OfflineContentGenerator/bundler Gerrit-Branch: master Gerrit-Owner: Cscott ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Always escape moderation reason when included in history mes... - change (mediawiki...Flow)
jenkins-bot has submitted this change and it was merged. Change subject: Always escape moderation reason when included in history messages .. Always escape moderation reason when included in history messages Change-Id: I7406c1405c9eef87193ac879e9186cda81fc3fdd --- M FlowActions.php 1 file changed, 8 insertions(+), 8 deletions(-) Approvals: Bsitu: Looks good to me, approved jenkins-bot: Verified diff --git a/FlowActions.php b/FlowActions.php index c0ddbd3..30413d3 100644 --- a/FlowActions.php +++ b/FlowActions.php @@ -202,7 +202,7 @@ return $templating->getUrlGenerator()->generateUrl( $block->getWorkflowId(), 'view', array(), $fragment ); }, function ( PostRevision $revision, Templating $templating, User $user, Block $block ) { - return $revision->getModeratedReason(); + return array( 'raw' => htmlspecialchars( $revision->getModeratedReason() ) ); }, ), 'class' => 'flow-history-hid-post', @@ -232,7 +232,7 @@ return $templating->getUrlGenerator()->generateUrl( $block->getWorkflowId(), 'view', array() ); }, function ( PostRevision $revision, Templating $templating, User $user, Block $block ) { - return $revision->getModeratedReason(); + return array( 'raw' => htmlspecialchars( $revision->getModeratedReason() ) ); }, ), 'class' => 'flow-history-hid-topic', @@ -267,7 +267,7 @@ return $templating->getUrlGenerator()->generateUrl( $block->getWorkflowId(), 'view', array(), $fragment ); }, function ( PostRevision $revision, Templating $templating, User $user, Block $block ) { - return $revision->getModeratedReason(); + return array( 'raw' => htmlspecialchars( $revision->getModeratedReason() ) ); }, ), 'class' => 'flow-history-deleted-post', @@ -298,7 +298,7 @@ return $templating->getUrlGenerator()->generateUrl( $block->getWorkflowId(), 'view', array() ); }, function ( PostRevision $revision, Templating $templating, User $user, Block $block ) { - return $revision->getModeratedReason(); + return array( 'raw' => htmlspecialchars( $revision->getModeratedReason() ) ); }, ), 'class' => 'flow-history-deleted-topic', @@ -334,7 +334,7 @@ return $templating->getUrlGenerator()->generateUrl( $block->getWorkflowId(), 'view', array(), $fragment ); }, function ( PostRevision $revision, Templating $templating, User $user, Block $block ) { - return $revision->getModeratedReason(); + return array( 'raw' => htmlspecialchars( $revision->getModeratedReason() ) ); }, ), 'class' => 'flow-history-suppressed-post', @@ -366,7 +366,7 @@ return $templating->getUrlGenerator()->generateUrl( $block->getWorkflowId(), 'view', array() ); }, function ( PostRevision $revision, Templating $templating, User $user, Block $block ) { - return $revision->getModeratedReason(); + return array( 'raw' => htmlspecialchars( $revision->getModeratedReason() ) ); }, ), 'class' => 'flow-history-suppressed-topic', @@ -404,7 +404,7 @@ return $templating->getUrlGenerator()->generateUrl( $block->getWorkflowId(), 'view', array(), 'flow-post-' . $revision->getPostId()->getHex() ); }, function ( PostRevision $revision, Templating $templating, User $user, Block $block ) { - return $revision->getModeratedReason(); + return array( 'raw' => htmlspecialchars( $revis
[MediaWiki-commits] [Gerrit] (Bug 51744) Add space around = chars in new headings - change (mediawiki...Parsoid)
jenkins-bot has submitted this change and it was merged. Change subject: (Bug 51744) Add space around = chars in new headings .. (Bug 51744) Add space around = chars in new headings * Add new html2wt parser test that explicit tests this (although might be unnecessary given the various other tests that accidentally test this). * To eliminate a lot of spurious failures, marked a bunch of wt-escaping tests for headings html2wt only. * Updated wt-escaping for headings to test for new headings since the space around '=' chars prevents any '=' char in text from being interpreted as a heading char. Ex: =a= would serialize to "= =a= =" and hence the "=a=" does not need nowiki escapes anymore. Updated existing wt-escaping tests to differentiate between old/new headings. * A bunch of failing tests are now off the blacklist because of marking those tests html2wt only. Change-Id: Id81cad75e79df899b98d2f0d3d451196233b22a3 --- M js/lib/mediawiki.WikitextSerializer.js M js/tests/parserTests-blacklist.js M js/tests/parserTests.txt 3 files changed, 81 insertions(+), 35 deletions(-) Approvals: Marcoil: Looks good to me, but someone else must approve GWicke: Looks good to me, approved jenkins-bot: Verified diff --git a/js/lib/mediawiki.WikitextSerializer.js b/js/lib/mediawiki.WikitextSerializer.js index e1bd6f8..cfff499 100644 --- a/js/lib/mediawiki.WikitextSerializer.js +++ b/js/lib/mediawiki.WikitextSerializer.js @@ -152,6 +152,12 @@ }; WEHP.headingHandler = function(headingNode, state, text, opts) { + // Since we are now adding space around '=' chars in new headings + // there is no need to escape '=' chars in text. + if (DU.isNewElt(headingNode)) { + return false; + } + // Only "=" at the extremities trigger escaping if (opts.isLastChild && DU.isText(headingNode.firstChild)) { var line = state.currLine.text; @@ -2138,7 +2144,17 @@ function buildHeadingHandler(headingWT) { return { handle: function(node, state, cb) { - cb(headingWT, node); + // For new elements, for prettier wikitext serialization, + // emit a space after the last '=' char. + var space = ''; + if (DU.isNewElt(node)) { + var fc = node.firstChild; + if (fc && (!DU.isText(fc) || !fc.nodeValue.match(/^\s/))) { + space = ' '; + } + } + + cb(headingWT + space, node); if (node.childNodes.length) { var headingHandler = state.serializer .wteHandlers.headingHandler.bind(state.serializer.wteHandlers, node); @@ -2147,7 +2163,17 @@ // Deal with empty headings cb('', node); } - cb(headingWT, node); + + // For new elements, for prettier wikitext serialization, + // emit a space before the first '=' char. + space = ''; + if (DU.isNewElt(node)) { + var lc = node.lastChild; + if (lc && (!DU.isText(lc) || !lc.nodeValue.match(/\s$/))) { + space = ' '; + } + } + cb(space + headingWT, node); }, sepnls: { before: function (node, otherNode) { diff --git a/js/tests/parserTests-blacklist.js b/js/tests/parserTests-blacklist.js index f1ec959..c282b9e 100644 --- a/js/tests/parserTests-blacklist.js +++ b/js/tests/parserTests-blacklist.js @@ -490,7 +490,6 @@ add("wt2html", "Bug 34939 - Case insensitive link parsing ([HttP://])"); add("wt2html", "Disable TOC"); add("wt2html", "1. SOL-sensitive wikitext tokens as template-args"); -add("wt2html", "Headings: 2. Outside heading nest on a single line foo*bar"); add("wt2html", "Headings: 6a. Heading chars in SOL context (with trailing spaces)"); add("wt2html", "Headings: 6b. Heading chars in SOL context (with trailing newlines)"); add("wt2html", "Headings: 6c. Heading chars in SOL context (leading newline break)"); @@ -1168,7 +1167,6 @@ add("html2html", "Ref: 8. transclusion wikitext has lower precedence"); add("html2html", "Ref: 10. Unclosed HTML tags should not leak out of ref-body"); add("html2html", "References: 5. ref tags in references should be processed while ignoring all other content"); -add("html2html", "Headings: 2. Outside heading nest on a single line foo*bar"); add("html2html", "Headings: 6a. Heading chars in SOL
[MediaWiki-commits] [Gerrit] Add {{PLURAL: support for youhavenewmessagesfromusers and yo... - change (mediawiki/core)
MegaAlex has uploaded a new change for review. https://gerrit.wikimedia.org/r/99000 Change subject: Add {{PLURAL: support for youhavenewmessagesfromusers and youhavenewmessages .. Add {{PLURAL: support for youhavenewmessagesfromusers and youhavenewmessages Add {{PLURAL: support for the $1 parameter for youhavenewmessagesfromusers and youhavenewmessages. Bug: 53897 Change-Id: Ic08c51f651fe4101ed0b6fcdaea4b4ae74331f70 --- M includes/Skin.php M languages/messages/MessagesEn.php M languages/messages/MessagesQqq.php 3 files changed, 18 insertions(+), 10 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/00/99000/1 diff --git a/includes/Skin.php b/includes/Skin.php index 750f319..9486d03 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -1414,19 +1414,19 @@ : array( 'diff' => 'cur' ) ); - if ( $nofAuthors >= 1 && $nofAuthors <= 10 ) { + if ( $nofAuthors >= 1 ) { $newMessagesAlert = $this->msg( - 'youhavenewmessagesfromusers', + // $nofAuthors === 10 signifies "10 or less" ("less than 11") + $nofAuthors <= 10 ? 'youhavenewmessagesfromusers' : 'youhavenewmessagesmanyusers', $newMessagesLink, $newMessagesDiffLink - )->numParams( $nofAuthors ); + )->numParams( $nofAuthors, $plural ); } else { - // $nofAuthors === 11 signifies "11 or more" ("more than 10") $newMessagesAlert = $this->msg( - $nofAuthors > 10 ? 'youhavenewmessagesmanyusers' : 'youhavenewmessages', + 'youhavenewmessages', $newMessagesLink, $newMessagesDiffLink - ); + )->numParams( $plural ); } $newMessagesAlert = $newMessagesAlert->text(); # Disable Squid cache diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index e6ecc78..648aa18 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -939,8 +939,8 @@ 'pagetitle-view-mainpage' => '{{SITENAME}}', # only translate this message to other languages if you have to change it 'backlinksubtitle' => '← $1', # only translate this message to other languages if you have to change it 'retrievedfrom'=> 'Retrieved from "$1"', -'youhavenewmessages' => 'You have $1 ($2).', -'youhavenewmessagesfromusers' => 'You have $1 from {{PLURAL:$3|another user|$3 users}} ($2).', +'youhavenewmessages' => '{{PLURAL:$3|You have}} $1 ($2).', +'youhavenewmessagesfromusers' => '{{PLURAL:$4|You have}} $1 from {{PLURAL:$3|another user|$3 users}} ($2).', 'youhavenewmessagesmanyusers' => 'You have $1 from many users ($2).', 'newmessageslinkplural'=> '{{PLURAL:$1|a new message|999=new messages}}', 'newmessagesdifflinkplural'=> 'last {{PLURAL:$1|change|999=changes}}', diff --git a/languages/messages/MessagesQqq.php b/languages/messages/MessagesQqq.php index 4d84a95..98b8baa 100644 --- a/languages/messages/MessagesQqq.php +++ b/languages/messages/MessagesQqq.php @@ -827,12 +827,20 @@ Parameters: * $1 - a link points to new messages. Its text is {{msg-mw|Newmessageslinkplural}} * $2 - a link points to new messages diff. Its text is {{msg-mw|Newmessagesdifflinkplural}} +* $3 - 1 or 999: +** 1 if there was '''one''' new edit since the last time the user has seen their talk page +** 999 - if there was '''more than one''' new edit since the last time the user has seen their talk page See also: * {{msg-mw|Youhavenewmessagesmanyusers}}', -'youhavenewmessagesfromusers' => 'New talk indicator message: the message appearing when someone edited your user talk page. Parameters: +'youhavenewmessagesfromusers' => 'New talk indicator message: the message appearing when someone edited your user talk page. + +Parameters: * $1 - defined as {{msg-mw|newmessageslinkplural}} * $2 - defined as {{msg-mw|newmessagesdifflinkplural}} -* $3 - the number of authors who have edited the talk page since the owning user last viewed it', +* $3 - the number of authors who have edited the talk page since the owning user last viewed it +* $4 - 1 or 999: +** 1 if there was '''one''' new edit since the last time the user has seen their talk page +** 999 - if there was '''more than one''' new edit since the last time the user has seen thei
[MediaWiki-commits] [Gerrit] Add relatively paranoid input sanitisation to BasicDbStorage. - change (mediawiki...Flow)
jenkins-bot has submitted this change and it was merged. Change subject: Add relatively paranoid input sanitisation to BasicDbStorage. .. Add relatively paranoid input sanitisation to BasicDbStorage. In particular, you cannot use any SQL conditions for BasicDbStorage::find. But I grepped through the code and this does not ever seem to be used. Change-Id: Id2ee63d876d6641b0590b7b37c9ef7f24dd497e7 --- M includes/Data/ObjectManager.php 1 file changed, 48 insertions(+), 0 deletions(-) Approvals: CSteipp: Looks good to me, but someone else must approve Bsitu: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/Data/ObjectManager.php b/includes/Data/ObjectManager.php index 2dc8b88..1dca585 100644 --- a/includes/Data/ObjectManager.php +++ b/includes/Data/ObjectManager.php @@ -620,6 +620,12 @@ // Does not support auto-increment id yet public function insert( array $row ) { + // Only allow the row to include key/value pairs. + // No raw SQL. + if ( $this->hasRawSQL( $row ) ) { + throw new \MWException( "Raw SQL found in row" ); + } + // insert returns boolean true/false $res = $this->dbFactory->getDB( DB_MASTER )->insert( $this->table, @@ -643,6 +649,13 @@ if ( !$updates ) { return true; // nothing to change, success } + + // Only allow the row to include key/value pairs. + // No raw SQL. + if ( $this->hasRawSQL( $updates ) || $this->hasRawSQL( $pk ) ) { + throw new \MWException( "Raw SQL found in input" ); + } + $dbw = $this->dbFactory->getDB( DB_MASTER ); // update returns boolean true/false as $res $res = $dbw->update( $this->table, $updates, UUID::convertUUIDs( $pk ), __METHOD__ . " ({$this->table})" ); @@ -660,6 +673,13 @@ $missing = array_diff( $this->primaryKey, array_keys( $row ) ); throw new PersistenceException( 'Row has null primary key: ' . implode( $missing ) ); } + + // Only allow the row to include key/value pairs. + // No raw SQL. + if ( $this->hasRawSQL( $pk ) ) { + throw new \MWException( "Raw SQL found in PK" ); + } + $dbw = $this->dbFactory->getDB( DB_MASTER ); $res = $dbw->delete( $this->table, UUID::convertUUIDs( $pk ), __METHOD__ . " ({$this->table})" ); return $res && $dbw->affectedRows(); @@ -677,6 +697,12 @@ $value = $value->getHex(); } wfDebug( " -- $key = $value\n" ); + } + + // Only allow the row to include key/value pairs. + // No raw SQL. + if ( $this->hasRawSQL( $attributes ) ) { + throw new \MWException( "Raw SQL found in select condition" ); } $res = $this->dbFactory->getDB( DB_MASTER )->select( @@ -725,6 +751,28 @@ public function getPrimaryKeyColumns() { return $this->primaryKey; } + + /** +* Internal security function which checks a row object +* (for inclusion as a condition or a row for insert/update) +* for any numeric keys (= raw SQL), or field names with +* potentially unsafe characters. +* @param array $row The row to check. +* @return boolean True if raw SQL is found +*/ + protected function hasRawSQL( array $row ) { + foreach( $row as $key => $value ) { + if ( is_numeric( $key ) ) { + return true; + } + + if ( ! preg_match( '/^[A-Za-z0-9\._]+$/', $key ) ) { + return true; + } + } + + return false; + } } /** -- To view, visit https://gerrit.wikimedia.org/r/98759 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id2ee63d876d6641b0590b7b37c9ef7f24dd497e7 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/Flow Gerrit-Branch: master Gerrit-Owner: Werdna Gerrit-Reviewer: Bsitu Gerrit-Reviewer: CSteipp Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Always escape moderation reason when included in history mes... - change (mediawiki...Flow)
EBernhardson has uploaded a new change for review. https://gerrit.wikimedia.org/r/98999 Change subject: Always escape moderation reason when included in history messages .. Always escape moderation reason when included in history messages Change-Id: I7406c1405c9eef87193ac879e9186cda81fc3fdd --- M FlowActions.php 1 file changed, 8 insertions(+), 8 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow refs/changes/99/98999/1 diff --git a/FlowActions.php b/FlowActions.php index c0ddbd3..30413d3 100644 --- a/FlowActions.php +++ b/FlowActions.php @@ -202,7 +202,7 @@ return $templating->getUrlGenerator()->generateUrl( $block->getWorkflowId(), 'view', array(), $fragment ); }, function ( PostRevision $revision, Templating $templating, User $user, Block $block ) { - return $revision->getModeratedReason(); + return array( 'raw' => htmlspecialchars( $revision->getModeratedReason() ) ); }, ), 'class' => 'flow-history-hid-post', @@ -232,7 +232,7 @@ return $templating->getUrlGenerator()->generateUrl( $block->getWorkflowId(), 'view', array() ); }, function ( PostRevision $revision, Templating $templating, User $user, Block $block ) { - return $revision->getModeratedReason(); + return array( 'raw' => htmlspecialchars( $revision->getModeratedReason() ) ); }, ), 'class' => 'flow-history-hid-topic', @@ -267,7 +267,7 @@ return $templating->getUrlGenerator()->generateUrl( $block->getWorkflowId(), 'view', array(), $fragment ); }, function ( PostRevision $revision, Templating $templating, User $user, Block $block ) { - return $revision->getModeratedReason(); + return array( 'raw' => htmlspecialchars( $revision->getModeratedReason() ) ); }, ), 'class' => 'flow-history-deleted-post', @@ -298,7 +298,7 @@ return $templating->getUrlGenerator()->generateUrl( $block->getWorkflowId(), 'view', array() ); }, function ( PostRevision $revision, Templating $templating, User $user, Block $block ) { - return $revision->getModeratedReason(); + return array( 'raw' => htmlspecialchars( $revision->getModeratedReason() ) ); }, ), 'class' => 'flow-history-deleted-topic', @@ -334,7 +334,7 @@ return $templating->getUrlGenerator()->generateUrl( $block->getWorkflowId(), 'view', array(), $fragment ); }, function ( PostRevision $revision, Templating $templating, User $user, Block $block ) { - return $revision->getModeratedReason(); + return array( 'raw' => htmlspecialchars( $revision->getModeratedReason() ) ); }, ), 'class' => 'flow-history-suppressed-post', @@ -366,7 +366,7 @@ return $templating->getUrlGenerator()->generateUrl( $block->getWorkflowId(), 'view', array() ); }, function ( PostRevision $revision, Templating $templating, User $user, Block $block ) { - return $revision->getModeratedReason(); + return array( 'raw' => htmlspecialchars( $revision->getModeratedReason() ) ); }, ), 'class' => 'flow-history-suppressed-topic', @@ -404,7 +404,7 @@ return $templating->getUrlGenerator()->generateUrl( $block->getWorkflowId(), 'view', array(), 'flow-post-' . $revision->getPostId()->getHex() ); }, function ( PostRevision $revision, Templating $templating, User $user, Block $block ) { - return $revision->getModeratedReason(); +
[MediaWiki-commits] [Gerrit] Improved zero subdomain detection - change (mediawiki...ZeroRatedMobileAccess)
Yurik has uploaded a new change for review. https://gerrit.wikimedia.org/r/98998 Change subject: Improved zero subdomain detection .. Improved zero subdomain detection In some cases X-Subdomain might not be set. Improves that. Change-Id: I2700ac2d2cefd8f52c6843dc3c0afc1fd4089499 --- M includes/PageRenderingHooks.php 1 file changed, 14 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ZeroRatedMobileAccess refs/changes/98/98998/1 diff --git a/includes/PageRenderingHooks.php b/includes/PageRenderingHooks.php index d0a3a45..e00bbed 100644 --- a/includes/PageRenderingHooks.php +++ b/includes/PageRenderingHooks.php @@ -151,7 +151,20 @@ if ( $sd === null ) { $sd = $this->request->getHeader( 'X-SUBDOMAIN' ); } - $this->isZeroSubdomain = strcasecmp( $sd, 'ZERO' ) === 0; + if ( $sd ) { + $this->isZeroSubdomain = strcasecmp( $sd, 'ZERO' ) === 0; + } else { + // Either running from root redirector or from shell + $this->isZeroSubdomain = false; + $urlParts = wfParseUrl( $this->request->detectServer() ); + if ( isset( $urlParts['host'] ) ) { + $urlParts = explode( '.', $urlParts['host'], 3 ); + if ( count( $urlParts ) >= 2 ) { + $this->isZeroSubdomain = strcasecmp( $urlParts[0], 'ZERO' ) === 0 || + strcasecmp( $urlParts[1], 'ZERO' ) === 0; + }; + } + } } // TODO: Clean up HTML concatenation. Review for any non-escaped user input. -- To view, visit https://gerrit.wikimedia.org/r/98998 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2700ac2d2cefd8f52c6843dc3c0afc1fd4089499 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/ZeroRatedMobileAccess Gerrit-Branch: master Gerrit-Owner: Yurik ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Do not reload first page everytime onStart is called - change (apps...wikipedia)
Brion VIBBER has submitted this change and it was merged. Change subject: Do not reload first page everytime onStart is called .. Do not reload first page everytime onStart is called Intent actions should always be on onCreate. This also modifies the bus behavior to have it init on onCreate, then on onStop but only if it is null - which is set if onStop has run. This ensures that we do not double register. Change-Id: I2e5c1385ff01a1514ec4772203f297f43295c727 --- M wikipedia/src/main/java/org/wikimedia/wikipedia/PageActivity.java 1 file changed, 19 insertions(+), 13 deletions(-) Approvals: Brion VIBBER: Verified; Looks good to me, approved diff --git a/wikipedia/src/main/java/org/wikimedia/wikipedia/PageActivity.java b/wikipedia/src/main/java/org/wikimedia/wikipedia/PageActivity.java index 8e451b0..be04228 100644 --- a/wikipedia/src/main/java/org/wikimedia/wikipedia/PageActivity.java +++ b/wikipedia/src/main/java/org/wikimedia/wikipedia/PageActivity.java @@ -28,6 +28,21 @@ app = ((WikipediaApp)getApplicationContext()); searchAriclesFragment = (SearchArticlesFragment) getSupportFragmentManager().findFragmentById(R.id.search_fragment); + +bus = app.getBus(); +bus.register(this); + +Intent intent = getIntent(); +if (Intent.ACTION_VIEW.equals(intent.getAction())) { +Site site = new Site(intent.getData().getAuthority()); +PageTitle title = site.titleForInternalLink(intent.getData().getPath()); +HistoryEntry historyEntry = new HistoryEntry(title, HistoryEntry.SOURCE_EXTERNAL_LINK); +bus.post(new NewWikiPageNavigationEvent(title, historyEntry)); +} else if (ACTION_PAGE_FOR_TITLE.equals(intent.getAction())) { +PageTitle title = intent.getParcelableExtra(EXTRA_PAGETITLE); +HistoryEntry historyEntry = intent.getParcelableExtra(EXTRA_HISTORYENTRY); +bus.post(new NewWikiPageNavigationEvent(title, historyEntry)); +} } private void displayNewPage(PageTitle title) { @@ -64,19 +79,9 @@ @Override protected void onStart() { super.onStart(); -bus = app.getBus(); -bus.register(this); - -Intent intent = getIntent(); -if (Intent.ACTION_VIEW.equals(intent.getAction())) { -Site site = new Site(intent.getData().getAuthority()); -PageTitle title = site.titleForInternalLink(intent.getData().getPath()); -HistoryEntry historyEntry = new HistoryEntry(title, HistoryEntry.SOURCE_EXTERNAL_LINK); -bus.post(new NewWikiPageNavigationEvent(title, historyEntry)); -} else if (ACTION_PAGE_FOR_TITLE.equals(intent.getAction())) { -PageTitle title = intent.getParcelableExtra(EXTRA_PAGETITLE); -HistoryEntry historyEntry = intent.getParcelableExtra(EXTRA_HISTORYENTRY); -bus.post(new NewWikiPageNavigationEvent(title, historyEntry)); +if (bus == null) { +bus = app.getBus(); +bus.register(this); } } @@ -84,6 +89,7 @@ protected void onStop() { super.onStop(); bus.unregister(this); +bus = null; if (historyEntryPersister != null) { historyEntryPersister.cleanup(); historyEntryPersister = null; -- To view, visit https://gerrit.wikimedia.org/r/98997 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2e5c1385ff01a1514ec4772203f297f43295c727 Gerrit-PatchSet: 1 Gerrit-Project: apps/android/wikipedia Gerrit-Branch: master Gerrit-Owner: Yuvipanda Gerrit-Reviewer: Brion VIBBER ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Rename package from mw-latexer to mw-ocg-latexer. - change (mediawiki...latex_renderer)
jenkins-bot has submitted this change and it was merged. Change subject: Rename package from mw-latexer to mw-ocg-latexer. .. Rename package from mw-latexer to mw-ocg-latexer. The mw-bundler package has also been renamed. This brings the name more in line with (a concise version of) the gerrit repo name. Change-Id: Iea6db245c1ba22ea1fedd2b4f8fcd0cc10d3060e --- M AUTHORS.md M README.md R bin/mw-ocg-latexer M package.json 4 files changed, 13 insertions(+), 12 deletions(-) Approvals: Cscott: Looks good to me, approved jenkins-bot: Verified diff --git a/AUTHORS.md b/AUTHORS.md index 8fc9aaa..aa53c88 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -1,3 +1,3 @@ -`mw-latexer` was originally written by C. Scott Ananian. +`mw-ocg-latexer` was originally written by C. Scott Ananian. It is now maintained by the Wikimedia Foundation and volunteers everywhere. diff --git a/README.md b/README.md index bb32d61..0f4a139 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,11 @@ -# mw-latexer +# mw-ocg-latexer [![Build Status][1]][2] [![dependency status][3]][4] [![dev dependency status][5]][6] -Converts mediawiki collection bundles (as generated by mw-bundler) to +Converts mediawiki collection bundles (as generated by [mw-ocg-bundler]) to beautiful PDFs (via [XeLaTeX][]). +[mw-ocg-bundler]: https://github.com/wikimedia/mediawiki-extensions-Collection-OfflineContentGenerator-bundler [XeLaTeX]: https://en.wikipedia.org/wiki/XeTeX ## Installation @@ -32,9 +33,9 @@ ## Generating bundles -You may wish to install the `mw-bundler` package to create bundles +You may wish to install the `mw-ocg-bundler` npm package to create bundles from wikipedia articles. The below text assumes that you have done -so; ignore the `mw-bundler` references if you have bundles from +so; ignore the `mw-ocg-bundler` references if you have bundles from some other source. ## Running @@ -42,18 +43,18 @@ To generate a PDF named `out.pdf` from the `en` wikipedia article "United States": ``` -mw-bundler -o us.zip --prefix en "United States" -bin/mw-latexer -o out.pdf us.zip +mw-ocg-bundler -o us.zip --prefix en "United States" +bin/mw-ocg-latexer -o out.pdf us.zip ``` For debugging, preserving the XeTeX output is often useful: ``` -bin/mw-latexer -o out.tex us.zip && xelatex out.tex +bin/mw-ocg-latexer -o out.tex us.zip && xelatex out.tex ``` For other options, see: ``` -bin/mw-latexer --help +bin/mw-ocg-latexer --help ``` ## License diff --git a/bin/mw-latexer b/bin/mw-ocg-latexer similarity index 100% rename from bin/mw-latexer rename to bin/mw-ocg-latexer diff --git a/package.json b/package.json index bb9f464..fe5a948 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { - "name": "mw-latexer", + "name": "mw-ocg-latexer", "version": "0.0.2", - "description": "Converts mediawiki collection bundles (as generated by mw-bundler) to beautiful PDFs (via XeLaTeX)", + "description": "Converts mediawiki collection bundles (as generated by mw-ocg-bundler) to beautiful PDFs (via XeLaTeX)", "main": "lib/index.js", "scripts": { "test": "mocha" @@ -32,6 +32,6 @@ "mocha": "~1.15.1" }, "bin": { -"mw-latexer": "./bin/mw-latexer" +"mw-ocg-latexer": "./bin/mw-ocg-latexer" } } -- To view, visit https://gerrit.wikimedia.org/r/98841 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iea6db245c1ba22ea1fedd2b4f8fcd0cc10d3060e Gerrit-PatchSet: 6 Gerrit-Project: mediawiki/extensions/Collection/OfflineContentGenerator/latex_renderer Gerrit-Branch: master Gerrit-Owner: Cscott Gerrit-Reviewer: Cscott Gerrit-Reviewer: Mwalker Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Point all github urls to official wikimedia mirrors. - change (mediawiki...latex_renderer)
jenkins-bot has submitted this change and it was merged. Change subject: Point all github urls to official wikimedia mirrors. .. Point all github urls to official wikimedia mirrors. Change-Id: I163323ef55759f4de77086dfb2228470e8b94175 --- M README.md M package.json 2 files changed, 7 insertions(+), 7 deletions(-) Approvals: Cscott: Looks good to me, approved jenkins-bot: Verified diff --git a/README.md b/README.md index 4db4fb6..bb32d61 100644 --- a/README.md +++ b/README.md @@ -62,9 +62,9 @@ (c) 2013 by C. Scott Ananian -[1]: https://travis-ci.org/cscott/mw-latexer.png -[2]: https://travis-ci.org/cscott/mw-latexer -[3]: https://david-dm.org/cscott/mw-latexer.png -[4]: https://david-dm.org/cscott/mw-latexer -[5]: https://david-dm.org/cscott/mw-latexer/dev-status.png -[6]: https://david-dm.org/cscott/mw-latexer#info=devDependencies +[1]: https://travis-ci.org/wikimedia/mediawiki-extensions-Collection-OfflineContentGenerator-latex_renderer.png +[2]: https://travis-ci.org/wikimedia/mediawiki-extensions-Collection-OfflineContentGenerator-latex_renderer +[3]: https://david-dm.org/wikimedia/mediawiki-extensions-Collection-OfflineContentGenerator-latex_renderer.png +[4]: https://david-dm.org/wikimedia/mediawiki-extensions-Collection-OfflineContentGenerator-latex_renderer +[5]: https://david-dm.org/wikimedia/mediawiki-extensions-Collection-OfflineContentGenerator-latex_renderer/dev-status.png +[6]: https://david-dm.org/wikimedia/mediawiki-extensions-Collection-OfflineContentGenerator-latex_renderer#info=devDependencies diff --git a/package.json b/package.json index 7157c60..bb9f464 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ }, "repository": { "type": "git", -"url": "https://gerrit.wikimedia.org/r/p/mediawiki/extensions/Collection/OfflineContentGenerator/latex_renderer.git"; +"url": "wikimedia/mediawiki-extensions-Collection-OfflineContentGenerator-latex_renderer" }, "keywords": [ "pdf", -- To view, visit https://gerrit.wikimedia.org/r/98831 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I163323ef55759f4de77086dfb2228470e8b94175 Gerrit-PatchSet: 5 Gerrit-Project: mediawiki/extensions/Collection/OfflineContentGenerator/latex_renderer Gerrit-Branch: master Gerrit-Owner: Cscott Gerrit-Reviewer: Chad Gerrit-Reviewer: Cscott Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Update commander/gammalatex/mocha/when deps. - change (mediawiki...latex_renderer)
jenkins-bot has submitted this change and it was merged. Change subject: Update commander/gammalatex/mocha/when deps. .. Update commander/gammalatex/mocha/when deps. Change-Id: Ia49e0c479ddb76050ef63a148f5df62ccf5b4187 --- M package.json 1 file changed, 4 insertions(+), 4 deletions(-) Approvals: Cscott: Looks good to me, approved jenkins-bot: Verified diff --git a/package.json b/package.json index 29e472d..7157c60 100644 --- a/package.json +++ b/package.json @@ -17,19 +17,19 @@ ], "license": "GPLv2", "dependencies": { -"commander": "~2.0.0", +"commander": "~2.1.0", "domino": "~1.0.13", "easyimage": "~0.1.3", "es6-shim": "~0.9.1", -"gammalatex": "git+https://github.com/gammasoft/latex#66a075a82e3b1473404f652ea956a8e4841f3c66";, +"gammalatex": "gammasoft/latex#0a16ea053e456062129f30e2a021485383001caa", "readable-stream": "~1.1.9", "request": "~2.27.0", "sqlite3": "~2.1.19", "tmp": "~0.0.21", -"when": "~2.6.0" +"when": "~2.7.0" }, "devDependencies": { -"mocha": "~1.14.0" +"mocha": "~1.15.1" }, "bin": { "mw-latexer": "./bin/mw-latexer" -- To view, visit https://gerrit.wikimedia.org/r/98830 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia49e0c479ddb76050ef63a148f5df62ccf5b4187 Gerrit-PatchSet: 5 Gerrit-Project: mediawiki/extensions/Collection/OfflineContentGenerator/latex_renderer Gerrit-Branch: master Gerrit-Owner: Cscott Gerrit-Reviewer: Cscott Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Do not reload first page everytime onStart is called - change (apps...wikipedia)
Yuvipanda has uploaded a new change for review. https://gerrit.wikimedia.org/r/98997 Change subject: Do not reload first page everytime onStart is called .. Do not reload first page everytime onStart is called Intent actions should always be on onCreate. This also modifies the bus behavior to have it init on onCreate, then on onStop but only if it is null - which is set if onStop has run. This ensures that we do not double register. Change-Id: I2e5c1385ff01a1514ec4772203f297f43295c727 --- M wikipedia/src/main/java/org/wikimedia/wikipedia/PageActivity.java 1 file changed, 19 insertions(+), 13 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia refs/changes/97/98997/1 diff --git a/wikipedia/src/main/java/org/wikimedia/wikipedia/PageActivity.java b/wikipedia/src/main/java/org/wikimedia/wikipedia/PageActivity.java index 8e451b0..be04228 100644 --- a/wikipedia/src/main/java/org/wikimedia/wikipedia/PageActivity.java +++ b/wikipedia/src/main/java/org/wikimedia/wikipedia/PageActivity.java @@ -28,6 +28,21 @@ app = ((WikipediaApp)getApplicationContext()); searchAriclesFragment = (SearchArticlesFragment) getSupportFragmentManager().findFragmentById(R.id.search_fragment); + +bus = app.getBus(); +bus.register(this); + +Intent intent = getIntent(); +if (Intent.ACTION_VIEW.equals(intent.getAction())) { +Site site = new Site(intent.getData().getAuthority()); +PageTitle title = site.titleForInternalLink(intent.getData().getPath()); +HistoryEntry historyEntry = new HistoryEntry(title, HistoryEntry.SOURCE_EXTERNAL_LINK); +bus.post(new NewWikiPageNavigationEvent(title, historyEntry)); +} else if (ACTION_PAGE_FOR_TITLE.equals(intent.getAction())) { +PageTitle title = intent.getParcelableExtra(EXTRA_PAGETITLE); +HistoryEntry historyEntry = intent.getParcelableExtra(EXTRA_HISTORYENTRY); +bus.post(new NewWikiPageNavigationEvent(title, historyEntry)); +} } private void displayNewPage(PageTitle title) { @@ -64,19 +79,9 @@ @Override protected void onStart() { super.onStart(); -bus = app.getBus(); -bus.register(this); - -Intent intent = getIntent(); -if (Intent.ACTION_VIEW.equals(intent.getAction())) { -Site site = new Site(intent.getData().getAuthority()); -PageTitle title = site.titleForInternalLink(intent.getData().getPath()); -HistoryEntry historyEntry = new HistoryEntry(title, HistoryEntry.SOURCE_EXTERNAL_LINK); -bus.post(new NewWikiPageNavigationEvent(title, historyEntry)); -} else if (ACTION_PAGE_FOR_TITLE.equals(intent.getAction())) { -PageTitle title = intent.getParcelableExtra(EXTRA_PAGETITLE); -HistoryEntry historyEntry = intent.getParcelableExtra(EXTRA_HISTORYENTRY); -bus.post(new NewWikiPageNavigationEvent(title, historyEntry)); +if (bus == null) { +bus = app.getBus(); +bus.register(this); } } @@ -84,6 +89,7 @@ protected void onStop() { super.onStop(); bus.unregister(this); +bus = null; if (historyEntryPersister != null) { historyEntryPersister.cleanup(); historyEntryPersister = null; -- To view, visit https://gerrit.wikimedia.org/r/98997 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2e5c1385ff01a1514ec4772203f297f43295c727 Gerrit-PatchSet: 1 Gerrit-Project: apps/android/wikipedia Gerrit-Branch: master Gerrit-Owner: Yuvipanda ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add direction classes to Toolbar based on context - change (mediawiki...VisualEditor)
jenkins-bot has submitted this change and it was merged. Change subject: Add direction classes to Toolbar based on context .. Add direction classes to Toolbar based on context Add rtl/ltr-related classes to the toolbar based on cursor context, so certain icons can change based on inline and block directions. Change-Id: I1b6e450226bf8da820fb622f28c1c3062c534bb0 --- M modules/ve/ui/styles/ve.ui.Icons-raster.css M modules/ve/ui/styles/ve.ui.Icons-vector.css M modules/ve/ui/ve.ui.Toolbar.js 3 files changed, 143 insertions(+), 2 deletions(-) Approvals: Catrope: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/ve/ui/styles/ve.ui.Icons-raster.css b/modules/ve/ui/styles/ve.ui.Icons-raster.css index 2194f7c..e39b96d 100644 --- a/modules/ve/ui/styles/ve.ui.Icons-raster.css +++ b/modules/ve/ui/styles/ve.ui.Icons-raster.css @@ -4,6 +4,7 @@ * @copyright 2011-2013 VisualEditor Team and others; see AUTHORS.txt * @license The MIT License (MIT); see LICENSE.txt */ +/*csslint duplicate-background-images:false */ .oo-ui-icon-bold-a { /* @embed */ @@ -65,7 +66,31 @@ background-image: url(images/icons/bullet-list-ltr.png); } +/* @noflip */ +.ve-ui-dir-block-rtl .oo-ui-icon-bullet-list { + /* @embed */ + background-image: url(images/icons/bullet-list-rtl.png); +} + +/* @noflip */ +.ve-ui-dir-block-ltr .oo-ui-icon-bullet-list { + /* @embed */ + background-image: url(images/icons/bullet-list-ltr.png); +} + .oo-ui-icon-indent-list { + /* @embed */ + background-image: url(images/icons/indent-list-ltr.png); +} + +/* @noflip */ +.ve-ui-dir-block-rtl .oo-ui-icon-indent-list { + /* @embed */ + background-image: url(images/icons/indent-list-rtl.png); +} + +/* @noflip */ +.ve-ui-dir-block-ltr .oo-ui-icon-indent-list { /* @embed */ background-image: url(images/icons/indent-list-ltr.png); } @@ -116,11 +141,35 @@ background-image: url(images/icons/number-list-ltr.png); } +/* @noflip */ +.ve-ui-dir-block-rtl .oo-ui-icon-number-list { + /* @embed */ + background-image: url(images/icons/number-list-rtl.png); +} + +/* @noflip */ +.ve-ui-dir-block-ltr .oo-ui-icon-number-list { + /* @embed */ + background-image: url(images/icons/number-list-ltr.png); +} + .oo-ui-icon-outdent-list { /* @embed */ background-image: url(images/icons/outdent-list-ltr.png); } +/* @noflip */ +.ve-ui-dir-block-rtl .oo-ui-icon-outdent-list { + /* @embed */ + background-image: url(images/icons/outdent-list-rtl.png); +} + +/* @noflip */ +.ve-ui-dir-block-ltr .oo-ui-icon-outdent-list { + /* @embed */ + background-image: url(images/icons/outdent-list-ltr.png); +} + .oo-ui-icon-strikethrough-a { /* @embed */ background-image: url(images/icons/strikethrough-a.png); diff --git a/modules/ve/ui/styles/ve.ui.Icons-vector.css b/modules/ve/ui/styles/ve.ui.Icons-vector.css index 9913456..512d7ce 100644 --- a/modules/ve/ui/styles/ve.ui.Icons-vector.css +++ b/modules/ve/ui/styles/ve.ui.Icons-vector.css @@ -4,6 +4,7 @@ * @copyright 2011-2013 VisualEditor Team and others; see AUTHORS.txt * @license The MIT License (MIT); see LICENSE.txt */ +/*csslint duplicate-background-images:false */ .oo-ui-icon-bold-a { /* @embed */ @@ -65,7 +66,31 @@ background-image: url(images/icons/bullet-list-ltr.svg); } +/* @noflip */ +.ve-ui-dir-block-rtl .oo-ui-icon-bullet-list { + /* @embed */ + background-image: url(images/icons/bullet-list-rtl.svg); +} + +/* @noflip */ +.ve-ui-dir-block-ltr .oo-ui-icon-bullet-list { + /* @embed */ + background-image: url(images/icons/bullet-list-ltr.svg); +} + .oo-ui-icon-indent-list { + /* @embed */ + background-image: url(images/icons/indent-list-ltr.svg); +} + +/* @noflip */ +.ve-ui-dir-block-rtl .oo-ui-icon-indent-list { + /* @embed */ + background-image: url(images/icons/indent-list-rtl.svg); +} + +/* @noflip */ +.ve-ui-dir-block-ltr .oo-ui-icon-indent-list { /* @embed */ background-image: url(images/icons/indent-list-ltr.svg); } @@ -116,11 +141,35 @@ background-image: url(images/icons/number-list-ltr.svg); } +/* @noflip */ +.ve-ui-dir-block-rtl .oo-ui-icon-number-list { + /* @embed */ + background-image: url(images/icons/number-list-rtl.svg); +} + +/* @noflip */ +.ve-ui-dir-block-ltr .oo-ui-icon-number-list { + /* @embed */ + background-image: url(images/icons/number-list-ltr.svg); +} + .oo-ui-icon-outdent-list { /* @embed */ background-image: url(images/icons/outdent-list-ltr.svg); } +/* @noflip */ +.ve-ui-dir-block-rtl .oo-ui-icon-outdent-list { + /* @embed */ + background-image: url(images/icons/outdent-list-rtl.svg); +} + +/* @noflip */ +.ve-ui-dir-block-ltr .oo-ui-icon-outdent-list { + /* @embed */ + back
[MediaWiki-commits] [Gerrit] Avoid deferred floats caused by float size/quantity restrict... - change (mediawiki...latex_renderer)
jenkins-bot has submitted this change and it was merged. Change subject: Avoid deferred floats caused by float size/quantity restrictions. .. Avoid deferred floats caused by float size/quantity restrictions. Change-Id: I60bc2fdfaa0a99dbc3be14f9445769174d931d4d --- M lib/index.js 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Cscott: Looks good to me, approved jenkins-bot: Verified diff --git a/lib/index.js b/lib/index.js index 4409a51..53349c0 100644 --- a/lib/index.js +++ b/lib/index.js @@ -539,7 +539,7 @@ if (/[.](svg|gif|ogg|ogv)$/i.test(filename)) { return; } // skip some fmts if (this.inFloat) { return; } // xxx work around issues with inline images this.inFloat = true; - this.output.push('\\begin{figure}[tbh]'); + this.output.push('\\begin{figure}[tbh!]'); this.output.push('\\begin{center}'); filename = filename.replace(/[%\\_]/g, '\\$&'); // escape TeX specials this.output.push('\\includegraphics[width=0.95\\columnwidth]{'+filename+'}'); -- To view, visit https://gerrit.wikimedia.org/r/98984 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I60bc2fdfaa0a99dbc3be14f9445769174d931d4d Gerrit-PatchSet: 4 Gerrit-Project: mediawiki/extensions/Collection/OfflineContentGenerator/latex_renderer Gerrit-Branch: master Gerrit-Owner: Cscott Gerrit-Reviewer: Cscott Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Don't render icons smaller than 16x16 as floating figures. - change (mediawiki...latex_renderer)
jenkins-bot has submitted this change and it was merged. Change subject: Don't render icons smaller than 16x16 as floating figures. .. Don't render icons smaller than 16x16 as floating figures. Change-Id: Ib4485772f39f4c40e599153cf138deff90ab6ccb --- M lib/index.js 1 file changed, 8 insertions(+), 0 deletions(-) Approvals: Cscott: Looks good to me, approved jenkins-bot: Verified diff --git a/lib/index.js b/lib/index.js index 53349c0..756db66 100644 --- a/lib/index.js +++ b/lib/index.js @@ -621,6 +621,14 @@ Visitor.prototype['visitTYPEOF=mw:Image'] = Visitor.prototype['visitTYPEOF=mw:Image/Thumb'] = function(node) { + var img = node.querySelector('img[resource]'); + var h = +img.getAttribute('height') || 0; + var w = +img.getAttribute('width') || 0; + if ((h !== 0 || w !== 0) && (h<=16 && w<=16)) { + // skip small (inline) icons + // xxx render them inline? + return; + } return this.visitFIGURE(node); }; -- To view, visit https://gerrit.wikimedia.org/r/98985 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib4485772f39f4c40e599153cf138deff90ab6ccb Gerrit-PatchSet: 4 Gerrit-Project: mediawiki/extensions/Collection/OfflineContentGenerator/latex_renderer Gerrit-Branch: master Gerrit-Owner: Cscott Gerrit-Reviewer: Cscott Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Use proper line-breaking algorithm for URLs (or things which... - change (mediawiki...latex_renderer)
jenkins-bot has submitted this change and it was merged. Change subject: Use proper line-breaking algorithm for URLs (or things which look like them). .. Use proper line-breaking algorithm for URLs (or things which look like them). Change-Id: Ia781bdea1db04a7ba9a4ea71856630b08eb25cca --- M lib/index.js 1 file changed, 15 insertions(+), 2 deletions(-) Approvals: Cscott: Looks good to me, approved jenkins-bot: Verified diff --git a/lib/index.js b/lib/index.js index 185af4b..4409a51 100644 --- a/lib/index.js +++ b/lib/index.js @@ -37,7 +37,8 @@ "\\usepackage[usenames]{xcolor}", "\\definecolor{linkcolor}{rgb}{.27,0,0}", "\\definecolor{citecolor}{rgb}{0,0,.27}", - "\\usepackage[colorlinks,breaklinks,allcolors=linkcolor,linkcolor=citecolor]{hyperref}", + "\\usepackage[unicode,colorlinks,breaklinks,allcolors=linkcolor,linkcolor=citecolor]{hyperref}", + "\\urlstyle{same}", // This is a documented workaround for including SVGs with RGB colors and/or // transparency; see: // http://tex.stackexchange.com/questions/29523/inkscape-pdf-includegraphics-xelatex-changed-colors @@ -71,9 +72,21 @@ "\\end{document}" ].join("\n"); +// John Gruber's "Improved Liberal, Accurate Regex Pattern for Matching URLs" +var URL_REGEXP = /\b((?:[a-z][\w\-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\((?:[^\s()<>]+|(?:\([^\s()<>]+\)))*\))+(?:\((?:[^\s()<>]+|(?:\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/i; + // Convert plain text (with HTML whitespace semantics) to an appropriately // escaped string for TeX to process. -var texEscape = function(str) { +var texEscape = function(str, nourls) { + if (!nourls) { + // pull out URLs and flag them specially + return str.split(URL_REGEXP).map(function(s) { + return texEscape(s, "nourls"); + }).map(function(s, i) { + /* jshint bitwise: false */ + return (s && (i&1)) ? ('\\nolinkurl{' + s + '}') : s; + }).join(''); + } // protect TeX special characters str = str.replace(/[#$&_%{}\\]/g, function(c) { return '\\' + c; }); // twiddle and carat are special -- To view, visit https://gerrit.wikimedia.org/r/98739 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia781bdea1db04a7ba9a4ea71856630b08eb25cca Gerrit-PatchSet: 6 Gerrit-Project: mediawiki/extensions/Collection/OfflineContentGenerator/latex_renderer Gerrit-Branch: master Gerrit-Owner: Cscott Gerrit-Reviewer: Cscott Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Suppress 'toplink' on hewiki. - change (mediawiki...latex_renderer)
jenkins-bot has submitted this change and it was merged. Change subject: Suppress 'toplink' on hewiki. .. Suppress 'toplink' on hewiki. For example: https://he.wikipedia.org/wiki/הפארק הלאומי יוסמיטי Change-Id: Ie20b058e843bfc76b79c5ffc1c811807647d665a --- M lib/index.js 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Cscott: Looks good to me, approved jenkins-bot: Verified diff --git a/lib/index.js b/lib/index.js index 8cc9232..c1035d9 100644 --- a/lib/index.js +++ b/lib/index.js @@ -132,7 +132,7 @@ } // bit of a hack: hide infobox / navbox / rellink / dablink / metadata // XXX restrict to enwiki or localize? - if (['infobox', 'navbox', 'rellink', 'dablink', 'metadata'].some(function(c) { + if (['infobox', 'navbox', 'rellink', 'dablink', 'toplink', 'metadata'].some(function(c) { return node.classList.contains(c); })) { return true; -- To view, visit https://gerrit.wikimedia.org/r/98666 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie20b058e843bfc76b79c5ffc1c811807647d665a Gerrit-PatchSet: 7 Gerrit-Project: mediawiki/extensions/Collection/OfflineContentGenerator/latex_renderer Gerrit-Branch: master Gerrit-Owner: Cscott Gerrit-Reviewer: Cscott Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Suppress hyperlinks in indexed section titles. - change (mediawiki...latex_renderer)
jenkins-bot has submitted this change and it was merged. Change subject: Suppress hyperlinks in indexed section titles. .. Suppress hyperlinks in indexed section titles. Fix bug in itwiki and hiwiki samples caused by a \hyperlink embedded within a \section heading. Strip hyperlinks from the "short title" used in the index, etc. Change-Id: I7ab35494de6f1208d034985a3ad00c1b5a65ec16 --- M lib/index.js 1 file changed, 12 insertions(+), 3 deletions(-) Approvals: Cscott: Looks good to me, approved jenkins-bot: Verified diff --git a/lib/index.js b/lib/index.js index c1035d9..185af4b 100644 --- a/lib/index.js +++ b/lib/index.js @@ -279,7 +279,7 @@ Visitor.prototype.visitA = function(node) { var href = node.getAttribute('href'); - if (href && !node.querySelector('img')) { + if (href && !this.inHeading && !node.querySelector('img')) { if (/^#/.test(href)) { href = href.substring(1); return this.collect(node, function(contents) { @@ -360,8 +360,17 @@ return; } var level = LATEX_LEVELS[n]; - return this.collect(node, function(contents) { - this.output.push('\\' + level + '{' + contents + '}'); + var wasInHeading = this.inHeading; + this.inHeading = true; + return this.collect(node, function(shortContents) { + this.inHeading = wasInHeading; + return this.collect(node, function(longContents) { + this.output.push( + '\\' + level + + '[' + shortContents + ']' + + '{' + longContents + '}' + ); + }); }); }; -- To view, visit https://gerrit.wikimedia.org/r/98715 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7ab35494de6f1208d034985a3ad00c1b5a65ec16 Gerrit-PatchSet: 6 Gerrit-Project: mediawiki/extensions/Collection/OfflineContentGenerator/latex_renderer Gerrit-Branch: master Gerrit-Owner: Cscott Gerrit-Reviewer: Cscott Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Support explicit DIR attributes on HTML elements. - change (mediawiki...latex_renderer)
jenkins-bot has submitted this change and it was merged. Change subject: Support explicit DIR attributes on HTML elements. .. Support explicit DIR attributes on HTML elements. Change-Id: I47a80f153de18242ded0553c73afc160f972285f --- M lib/index.js M lib/polyglossia.js 2 files changed, 67 insertions(+), 15 deletions(-) Approvals: Cscott: Looks good to me, approved jenkins-bot: Verified diff --git a/lib/index.js b/lib/index.js index 1e691f6..27fe1a1 100644 --- a/lib/index.js +++ b/lib/index.js @@ -32,6 +32,7 @@ "\\documentclass[10pt,twocolumn,twoside]{article}", "\\pagestyle{headings}", "\\usepackage{fontspec, xunicode, polyglossia, graphicx}", + //"\\usepackage{xltxtra}", // xxx "real" superscript doesn't render [] "\\usepackage{amsmath,amsthm,amstext,amssymb}", "\\usepackage[usenames]{xcolor}", "\\definecolor{linkcolor}{rgb}{.27,0,0}", @@ -95,6 +96,12 @@ return str; }; +// Predicate to determine whether the given element will be a +// paragraph context in LaTeX. +var isParagraph = function(node) { + return (/^(BLOCKQUOTE|BODY|CENTER|DIV|DL|FIGURE|H[1-6]|OL|P|TABLE|UL)$/).test(node.nodeName); // xxx others? +}; + // Special predicate for some image templates used on enwiki // XXX restrict to enwiki content? var isMultipleImageTemplate = function(node) { @@ -149,6 +156,7 @@ this.templates = Object.create(null); this.base = options.base || ''; this.currentLanguage = options.lang || 'en'; + this.currentDirectionality = options.dir || 'ltr'; this.usedLanguages = new Set(); }; @@ -184,13 +192,16 @@ // in addition to eliminating no-ops, this condition allows us // to recursively invoke visit() inside the LANG handler. if (lang !== this.currentLanguage) { - var savedLanguage = this.currentLanguage; - this.currentLanguage = lang; this.usedLanguages.add(lang); - var r = this['visitLANG='].apply(this, arguments); - this.currentLanguage = savedLanguage; - return r; + return this['visitLANG='].apply(this, arguments); } + // directionality should be set by language handling. if it isn't... + var dir = node.getAttribute('dir') || this.currentDirectionality; + if (dir==='auto') { dir = this.currentDirectionality; /* hack */ } + if (dir !== this.currentDirectionality) { + return this['visitDIR='].apply(this, arguments); + } + // xxx look at lang and dir from css styling xxx // use typeof property if possible if (node.hasAttribute('typeof')) { var typeo = node.getAttribute('typeof'); @@ -517,20 +528,49 @@ }; Visitor.prototype['visitLANG='] = function(node) { + var r; + var savedLanguage = this.currentLanguage; + var savedDirectionality = this.currentDirectionality; + var lang = node.getAttribute('lang'); + var poly = Polyglossia.lookup(lang); + this.currentLanguage = lang; + this.currentDirectionality = poly.dir; // is this a block or a span context? - var isBlock = /^(BLOCKQUOTE|BODY|CENTER|DIV|DL|FIGURE|H[1-6]|OL|P|TABLE|UL)$/.test(node.nodeName); // XXX others? - var poly = Polyglossia.lookup(this.currentLanguage); - if (isBlock) { + if (isParagraph(node)) { this.output.push('\\begin{'+poly.env+'}['+poly.options+']%'); - var r = this.visit(node); + r = this.visit(node); this.output.push('\\end{'+poly.env+'}%'); - return r; } else { - return this.collect(node, function(contents) { + r = this.collect(node, function(contents) { this.output.push('\\text'+poly.lang+'['+poly.options+']' + '{' + contents + '}%'); }); } + this.currentLanguage = savedLanguage; + this.currentDirectionality = savedDirectionality; + return r; +}; + +Visitor.prototype['visitDIR='] = function(node) { + var r; + var savedDirectionality = this.currentDirectionality; + var dir = node.getAttribute('dir'); + console.warn("Using non-standard DIR", this.currentLanguage, this.currentDirectionality, '->', dir); + this.currentDirectionality = dir; + if (isParagraph(node)) { + var envname = dir.toUpperCase(); + this.output.push('\\begin{' + envname + '}%'); + r = this.visit(node); + this.output.push('\\end{' + envname + '}%'); + } else { + var cmdname = (dir === 'rtl') ?
[MediaWiki-commits] [Gerrit] Improve BR/DIV linebreak handling. - change (mediawiki...latex_renderer)
jenkins-bot has submitted this change and it was merged. Change subject: Improve BR/DIV linebreak handling. .. Improve BR/DIV linebreak handling. Don't try to terminate a line if we haven't started one yet. LaTeX doesn't like that. Change-Id: I064512165b93a37b5f33834b5cc3016314ec91b7 --- M lib/index.js 1 file changed, 31 insertions(+), 5 deletions(-) Approvals: Cscott: Looks good to me, approved jenkins-bot: Verified diff --git a/lib/index.js b/lib/index.js index 27fe1a1..8cc9232 100644 --- a/lib/index.js +++ b/lib/index.js @@ -158,14 +158,16 @@ this.currentLanguage = options.lang || 'en'; this.currentDirectionality = options.dir || 'ltr'; this.usedLanguages = new Set(); + this.insideParagraph = false; }; // Helper function -- collect all text from the children of `node` as // HTML non-block/TeX non-paragraph content. Invoke `f` with the result, // suitable for inclusion in a TeX non-paragraph context. Visitor.prototype.collect = function(node, f) { - var o = this.output; + var o = this.output, inside = this.insideParagraph; this.output = []; + this.insideParagraph = false; this.visitChildren(node); // combine lines, compress paragraphs var text = this.output.join('\n'). @@ -175,6 +177,7 @@ replace(/^\{\}/, ''). // remove escape for start of line whitespace replace(/\n\n+/g, '\n'); // remove paragraphs this.output = o; + this.insideParagraph = inside; return f.call(this, text); }; @@ -186,6 +189,15 @@ case node.ELEMENT_NODE: if (isHidden(node)) { return; + } + if (isParagraph(node) && node !== this.insideParagraphGuard) { + var guard = this.insideParagraphGuard; + this.insideParagraph = false; + this.insideParagraphGuard = node; + var r = this.visit.apply(this, arguments); // recurse! + this.insideParagraph = false; + this.insideParagraphGuard = guard; + return r; } // handle LANG attributes (which override everything else) var lang = node.getAttribute('lang') || this.currentLanguage; @@ -228,7 +240,12 @@ var text = texEscape(node.data); // protect leading space; escape the trailing newline text = text.replace(/^\s+/, '{} ') + '%'; - this.output.push(text); + if (text !== '%') { + this.output.push(text); + if (text !== '{} %') { + this.insideParagraph = true; + } + } break; //case node.PROCESSING_INSTRUCTION_NODE: @@ -329,7 +346,7 @@ Visitor.prototype.visitBR = function(node) { /* jshint unused: vars */ - if (this.output.length === 0) { return; } // xxx no line to end + if (!this.insideParagraph) { return; } this.output.push(''); }; @@ -375,6 +392,7 @@ Visitor.prototype.visitLI = function(node) { this.output.push('\\item %'); + this.insideParagraph = true; this.visitChildren(node); }; @@ -424,6 +442,7 @@ Visitor.prototype.visitDT = function(node) { return this.collect(node, function(contents) { this.output.push('\\item[' + contents + '] %'); + this.insideParagraph = true; }); }; @@ -435,12 +454,14 @@ var prev = DomUtil.node_before(node); if (!(prev === null || prev.nodeName === 'DT')) { this.output.push('\\item'); + this.insideParagraph = true; } this.visitChildren(node); }; Visitor.prototype.visitLI = function(node) { this.output.push('\\item %'); + this.insideParagraph = true; this.visitChildren(node); }; @@ -457,6 +478,7 @@ Visitor.prototype['visitTYPEOF=mw:Extension/references'] = function(node) { if (!node.childNodes.length) { return; /* no items */ } + this.insideParagraph = false; this.output.push('\\begin{enumerate}\\small'); for (var i = 0, n = node.childNodes.length; i < n; i++) { var ref = node.childNodes[i]; @@ -468,6 +490,7 @@ this.visitChildren(ref); } this.output.push('\\end{enumerate}'); + this.insideParagraph = false; }; // tables @@ -504,6 +527,7 @@ // also, \caption fights with \begin{center} ... \end{center} //this.output.push('\\caption{%'); this.output.push('\\small\\it'); + this.insideParagraph = false; this.visitChildren(caption); //this.output.push('}'); } @@ -597,8 +621,10 @@
[MediaWiki-commits] [Gerrit] Show tags on deleted edits through the API - change (mediawiki/core)
Jackmcbarn has uploaded a new change for review. https://gerrit.wikimedia.org/r/98996 Change subject: Show tags on deleted edits through the API .. Show tags on deleted edits through the API Add support for viewing and filtering by tags in list=deletedrevs in the API. This code is mostly copied from the prop=revisions code. Change-Id: I53a1e0479bc6bafe2a1115de875548519e5b3b59 --- M includes/api/ApiQueryDeletedrevs.php 1 file changed, 33 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/96/98996/1 diff --git a/includes/api/ApiQueryDeletedrevs.php b/includes/api/ApiQueryDeletedrevs.php index 35e78ac..7755041 100644 --- a/includes/api/ApiQueryDeletedrevs.php +++ b/includes/api/ApiQueryDeletedrevs.php @@ -59,6 +59,7 @@ $fld_sha1 = isset( $prop['sha1'] ); $fld_content = isset( $prop['content'] ); $fld_token = isset( $prop['token'] ); + $fld_tags = isset( $prop['tags'] ); // If we're in JSON callback mode, no tokens can be obtained if ( !is_null( $this->getMain()->getRequest()->getVal( 'callback' ) ) ) { @@ -111,6 +112,23 @@ $this->addFieldsIf( 'ar_minor_edit', $fld_minor ); $this->addFieldsIf( 'ar_len', $fld_len ); $this->addFieldsIf( 'ar_sha1', $fld_sha1 ); + + if ( $fld_tags ) { + $this->addTables( 'tag_summary' ); + $this->addJoinConds( + array( 'tag_summary' => array( 'LEFT JOIN', array( 'ar_rev_id=ts_rev_id' ) ) ) + ); + $this->addFields( 'ts_tags' ); + } + + if ( !is_null( $params['tag'] ) ) { + $this->addTables( 'change_tag' ); + $this->addJoinConds( + array( 'change_tag' => array( 'INNER JOIN', array( 'ar_rev_id=ct_rev_id' ) ) ) + ); + $this->addWhereFld( 'ct_tag', $params['tag'] ); + $this->addOption( 'USE INDEX', 'change_tag_tag_id' ); + } if ( $fld_content ) { $this->addTables( 'text' ); @@ -264,6 +282,16 @@ ApiResult::setContent( $rev, Revision::getRevisionText( $row ) ); } + if ( $fld_tags ) { + if ( $row->ts_tags ) { + $tags = explode( ',', $row->ts_tags ); + $this->getResult()->setIndexedTagName( $tags, 'tag' ); + $rev['tags'] = $tags; + } else { + $rev['tags'] = array(); + } + } + if ( !isset( $pageMap[$row->ar_namespace][$row->ar_title] ) ) { $pageID = $newPageID++; $pageMap[$row->ar_namespace][$row->ar_title] = $pageID; @@ -313,6 +341,7 @@ 'prefix' => null, 'continue' => null, 'unique' => false, + 'tag' => null, 'user' => array( ApiBase::PARAM_TYPE => 'user' ), @@ -343,7 +372,8 @@ 'len', 'sha1', 'content', - 'token' + 'token', + 'tags' ), ApiBase::PARAM_ISMULTI => true ), @@ -372,12 +402,14 @@ ' sha1 - Adds the SHA-1 (base 16) of the revision', ' content- Adds the content of the revision', ' token - Gives the edit token', + ' tags - Tags for the revision', ), 'namespace' => 'Only list pages in this namespace (3)', 'user' => 'Only list revisions by this user', 'excludeuser' => 'Don\'t list revisions by this user', 'continue' => 'When more results are available, use this to continue (1, 3)', 'unique' => 'List only one revision for each page (3)', + 'tag' => 'Only list revisions tagged with this tag', ); } -- To view, visit https://gerrit.wikimedia.org/r/98996 To unsubscribe, visit https://gerrit.wikimedia.
[MediaWiki-commits] [Gerrit] Add UI to see history - change (apps...wikipedia)
Brion VIBBER has submitted this change and it was merged. Change subject: Add UI to see history .. Add UI to see history Also adds: - Start a PageActivity with a PageTitle & HistoryEntry - New Source ID for coming to a page from History - Fragment that handles the NavDrawer - New NoTitle theme for pages that don't need ActionBar - Swipe from left to open navigation drawer Change-Id: If53f7e0a3e5b46a6687fb40d59a671061c29fec9 --- M wikipedia/AndroidManifest.xml A wikipedia/res/layout/activity_history.xml M wikipedia/res/layout/activity_main.xml A wikipedia/res/layout/fragment_navdrawer.xml A wikipedia/res/layout/item_history_entry.xml M wikipedia/res/values/strings.xml M wikipedia/res/values/styles.xml A wikipedia/src/main/java/org/wikimedia/wikipedia/NavDrawerFragment.java M wikipedia/src/main/java/org/wikimedia/wikipedia/PageActivity.java M wikipedia/src/main/java/org/wikimedia/wikipedia/PageTitle.java M wikipedia/src/main/java/org/wikimedia/wikipedia/data/PersistanceHelper.java A wikipedia/src/main/java/org/wikimedia/wikipedia/history/HistoryActivity.java M wikipedia/src/main/java/org/wikimedia/wikipedia/history/HistoryEntry.java 13 files changed, 280 insertions(+), 22 deletions(-) Approvals: Brion VIBBER: Verified; Looks good to me, approved diff --git a/wikipedia/AndroidManifest.xml b/wikipedia/AndroidManifest.xml index 3f104bb..9f69e85 100644 --- a/wikipedia/AndroidManifest.xml +++ b/wikipedia/AndroidManifest.xml @@ -15,12 +15,14 @@ android:label="@string/app_name" android:name=".WikipediaApp" android:theme="@style/AppTheme"> - + + - @@ -29,6 +31,11 @@ + + + + +http://schemas.android.com/apk/res/android"; + android:orientation="vertical" + android:layout_width="match_parent" + android:layout_height="match_parent"> + + + \ No newline at end of file diff --git a/wikipedia/res/layout/activity_main.xml b/wikipedia/res/layout/activity_main.xml index 735badb..7e79bea 100644 --- a/wikipedia/res/layout/activity_main.xml +++ b/wikipedia/res/layout/activity_main.xml @@ -2,6 +2,7 @@ xmlns:android="http://schemas.android.com/apk/res/android"; android:id="@+id/drawer_layout" android:layout_width="match_parent" +android:saveEnabled="false" android:layout_height="match_parent"> - - - - - +/> diff --git a/wikipedia/res/layout/fragment_navdrawer.xml b/wikipedia/res/layout/fragment_navdrawer.xml new file mode 100644 index 000..f298c17 --- /dev/null +++ b/wikipedia/res/layout/fragment_navdrawer.xml @@ -0,0 +1,14 @@ + + +http://schemas.android.com/apk/res/android"; + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical" + android:background="#111"> + + \ No newline at end of file diff --git a/wikipedia/res/layout/item_history_entry.xml b/wikipedia/res/layout/item_history_entry.xml new file mode 100644 index 000..b23d3ad --- /dev/null +++ b/wikipedia/res/layout/item_history_entry.xml @@ -0,0 +1,36 @@ + + +http://schemas.android.com/apk/res/android"; + android:orientation="vertical" + android:layout_width="match_parent" + android:layout_height="match_parent"> + + + + + + + + \ No newline at end of file diff --git a/wikipedia/res/values/strings.xml b/wikipedia/res/values/strings.xml index 4472dd6..828db58 100644 --- a/wikipedia/res/values/strings.xml +++ b/wikipedia/res/values/strings.xml @@ -3,4 +3,6 @@ Wikipedia Search Wikipedia +History +History \ No newline at end of file diff --git a/wikipedia/res/values/styles.xml b/wikipedia/res/values/styles.xml index a76c90e..d21427a 100644 --- a/wikipedia/res/values/styles.xml +++ b/wikipedia/res/values/styles.xml @@ -1,22 +1,14 @@ - - - + + +- false
- 0dp
- \ No newline at end of file diff --git a/wikipedia/src/main/java/org/wikimedia/wikipedia/NavDrawerFragment.java b/wikipedia/src/main/java/org/wikimedia/wikipedia/NavDrawerFragment.java new file mode 100644 index 000..10e2c03 --- /dev/null +++ b/wikipedia/src/main/java/org/wikimedia/wikipedia/NavDrawerFragment.java @@ -0,0 +1,
[MediaWiki-commits] [Gerrit] [WIP] Shorten uuids to 88 bits - change (mediawiki...Flow)
EBernhardson has uploaded a new change for review. https://gerrit.wikimedia.org/r/98995 Change subject: [WIP] Shorten uuids to 88 bits .. [WIP] Shorten uuids to 88 bits Change-Id: I453d9bfdda8b4cd8903939b87bddb4fea339356e --- M Hooks.php A db_patches/patch-88bit_uuids.sql A db_patches/patch-88bit_uuids.sqlite.sql M flow.sql M includes/Data/ObjectManager.php M includes/Model/UUID.php 6 files changed, 97 insertions(+), 31 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow refs/changes/95/98995/1 diff --git a/Hooks.php b/Hooks.php index 1dbaacc..6972255 100644 --- a/Hooks.php +++ b/Hooks.php @@ -31,6 +31,8 @@ if ( $updater->getDB()->getType() === 'sqlite' ) { $updater->modifyExtensionField( 'flow_summary_revision', 'summary_workflow_id', "$dir/db_patches/patch-summary2header.sqlite.sql" ); $updater->modifyExtensionField( 'flow_revision', 'rev_comment', "$dir/db_patches/patch-rev_change_type.sqlite.sql" ); + // sqlite ignores field types, this just substr's uuid's to 88 bits + $updater->modifyExtensionField( 'flow_definition', 'definition_id', "$dir/db_patches/patch-88bit_uuids.sqlite.sql" ); } else { // sqlite doesn't support alter table change, it also considers all types the same so // this patch doesn't matter to it. @@ -39,6 +41,8 @@ $updater->modifyExtensionField( 'flow_summary_revision', 'summary_workflow_id', "$dir/db_patches/patch-summary2header.sql" ); // rename rev_change_type -> rev_comment, alternate patch is above for sqlite $updater->modifyExtensionField( 'flow_revision', 'rev_comment', "$dir/db_patches/patch-rev_change_type.sql" ); + // convert 128 bit uuid's into 88bit + $updater->modifyExtensionField( 'flow_definition', 'definition_id', "$dir/db_patches/patch-88bit_uuids.sql" ); } $updater->addExtensionIndex( 'flow_workflow', 'flow_workflow_lookup', "$dir/db_patches/patch-workflow_lookup_idx.sql" ); diff --git a/db_patches/patch-88bit_uuids.sql b/db_patches/patch-88bit_uuids.sql new file mode 100644 index 000..37b97ee --- /dev/null +++ b/db_patches/patch-88bit_uuids.sql @@ -0,0 +1,29 @@ + +ALTER TABLE flow_definition + CHANGE definition_id definition_id binary(11) not null; + +ALTER TABLE flow_workflow + CHANGE workflow_id workflow_id binary(11) not null, + CHANGE workflow_definition_id workflow_definition_id binary(11) not null; + +ALTER TABLE flow_topic_list + CHANGE topic_list_id topic_list_id binary(11) not null, + CHANGE topic_id topic_id binary(11) default null; + +ALTER TABLE flow_tree_revision + CHANGE tree_rev_descendant_id tree_rev_descendant_id binary(11) not null, + CHANGE tree_rev_id tree_rev_id binary(11) not null, + CHANGE tree_parent_id tree_parent_id binary(11) default null; + +ALTER TABLE flow_header_revision + CHANGE header_workflow_id header_workflow_id binary(11) not null, + CHANGE header_rev_id header_rev_id binary(11) not null; + +ALTER TABLE flow_revision + CHANGE rev_id rev_id binary(11) not null, + CHANGE rev_parent_id rev_parent_id binary(11) default null, + CHANGE rev_last_edit_id rev_last_edit_id binary(11) default null; + +ALTER TABLE flow_tree_node + CHANGE tree_ancestor_id tree_ancestor_id binary(11) not null, + CHANGE tree_descendant_id tree_descendant_id binary(11) not null; diff --git a/db_patches/patch-88bit_uuids.sqlite.sql b/db_patches/patch-88bit_uuids.sqlite.sql new file mode 100644 index 000..fe83499 --- /dev/null +++ b/db_patches/patch-88bit_uuids.sqlite.sql @@ -0,0 +1,29 @@ + +UPDATE flow_definition + SET definition_id = substr( definition_id, 1, 11 ); + +UPDATE flow_workflow + SET workflow_id = substr( workflow_id, 1, 11 ), + workflow_definition_id = substr( workflow_definition_id, 1, 11 ); + +UPDATE flow_topic_list + SET topic_list_id = substr( topic_list_id, 1, 11 ), + topic_id = substr( topic_id, 1, 11 ) + +UPDATE flow_tree_revision + SET tree_rev_descendant_id = substr( tree_rev_descendant_id, 1, 11 ), + tree_rev_id = substr( tree_rev_id, 1, 11 ), + tree_parent_id = substr( tree_parent_id, 1, 11 ); + +UPDATE flow_header_revision + SET header_workflow_id = substr( header_workflow_id, 1, 11 ), + header_rev_id = substr( header_rev_id, 1, 11 ); + +UPDATE flow_revision + SET rev_id = substr( rev_id, 1, 11 ), + rev_parent_id = substr( rev_parent_id, 1, 11 ), + rev_last_edit_id = substr( rev_last_edit_id, 1, 11 ); + +UPDATE flow_tree_node + SET tree_ancestor_id = substr( tree_ancestor_id, 1, 11 ), + tree_descendant_id = substr( tree_d
[MediaWiki-commits] [Gerrit] Ensure non-binary cache keys - change (mediawiki...Flow)
EBernhardson has uploaded a new change for review. https://gerrit.wikimedia.org/r/98993 Change subject: Ensure non-binary cache keys .. Ensure non-binary cache keys The only source of binary data within flow cache keys is the uuids. We always want uuid's within cache keys to be the hex equivilent(so we can support talking to memcache via the text protocol). This adds an additional check which will warn developers if they somehow have binary data inside a cache key. Change-Id: I920ead7e205d00c9b08f57c47c65d1c7f73af44d --- M includes/Data/ObjectManager.php 1 file changed, 17 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow refs/changes/93/98993/1 diff --git a/includes/Data/ObjectManager.php b/includes/Data/ObjectManager.php index 2dc8b88..d78323b 100644 --- a/includes/Data/ObjectManager.php +++ b/includes/Data/ObjectManager.php @@ -1326,6 +1326,8 @@ } public function getMulti( array $keys ) { + array_map( array( $this, 'ensureNotBinary' ), $keys ); + $found = array(); foreach ( $keys as $idx => $key ) { if ( array_key_exists( $key, $this->internal ) ) { @@ -1356,6 +1358,8 @@ } public function add( $key, $value, $exptime = 0 ) { + $this->ensureNotBinary( $key ); + if ( $this->buffer === null ) { if ( $this->cache->add( $key, $value, $exptime ) ) { $this->internal[$key] = $value; @@ -1400,14 +1404,18 @@ } public function get( $key ) { + $this->ensureNotBinary( $key ); + return $this->cache->get( $key ); } public function getMulti( array $keys ) { + array_map( array( $this, 'ensureNotBinary' ), $keys ); return $this->cache->getMulti( $keys ); } public function add( $key, $value, $exptime = 0 ) { + $this->ensureNotBinary( $key ); if ( $this->buffer === null ) { $this->cache->add( $key, $value, $exptime ); } else { @@ -1419,6 +1427,7 @@ } public function set( $key, $value, $exptime = 0 ) { + $this->ensureNotBinary( $key ); if ( $this->buffer === null ) { $this->cache->set( $key, $value, $exptime ); } else { @@ -1430,6 +1439,7 @@ } public function delete( $key, $time = 0 ) { + $this->ensureNotBinary( $key ); if ( $this->buffer === null ) { $this->cache->delete( $key, $time ); } else { @@ -1441,6 +1451,7 @@ } public function merge( $key, \Closure $callback, $exptime = 0, $attempts = 10 ) { + $this->ensureNotBinary( $key ); if ( $this->buffer === null ) { $this->cache->merge( $key, $callback, $exptime, $attempts ); } else { @@ -1471,4 +1482,10 @@ } $this->buffer = null; } + + protected function ensureNotBinary( $key ) { + if ( !ctype_print( $key ) ) { + throw new \MWException( "Cache keys must be plain strings, provided: $key" ); + } + } } -- To view, visit https://gerrit.wikimedia.org/r/98993 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I920ead7e205d00c9b08f57c47c65d1c7f73af44d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Flow Gerrit-Branch: master Gerrit-Owner: EBernhardson ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Always use UUID objects when querying storage - change (mediawiki...Flow)
EBernhardson has uploaded a new change for review. https://gerrit.wikimedia.org/r/98994 Change subject: Always use UUID objects when querying storage .. Always use UUID objects when querying storage The shallow compactor was passing through binary uuid's directly from the storage layer back into the storage layer, which results in some data being queried with binary memcache keys rather than hex. This converts those into UUID objects so that we can appropriatly generate hex uuid's for cache and binary for the db. We have to have this split because memcache may be using the text protocol, in which case binary uuid's could result in invalid memcache requests. Change-Id: I7d3703b2c291baccb6104e92cc299cff9b43cdd8 --- M includes/Data/ObjectManager.php M includes/Model/UUID.php 2 files changed, 23 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow refs/changes/94/98994/1 diff --git a/includes/Data/ObjectManager.php b/includes/Data/ObjectManager.php index d78323b..9c4f930 100644 --- a/includes/Data/ObjectManager.php +++ b/includes/Data/ObjectManager.php @@ -1268,7 +1268,8 @@ } } - $innerResult = $this->shallow->findMulti( $duplicator->getUniqueQueries() ); + // binary uuid's need to be converted to UUID objects to use them in a query + $innerResult = $this->shallow->findMulti( $this->convertUUIDs( $duplicator->getUniqueQueries() ) ); foreach ( $innerResult as $rows ) { // __construct guaranteed the shallow backing index is a unique, so $first is only result $first = reset( $rows ); @@ -1277,6 +1278,22 @@ return $duplicator->getResult( /* strict = */ true ); } + + /** +* The cache result, as received in self::expandCacheResult, contains binary +* UUID's. For the $this->shallow->findMulti call we must provide it UUID objects +* so that it can use hex in the cache keys, and binary in the db calls. +*/ + protected function convertUUIDs( array $rows ) { + foreach ( $rows as $key => $row ) { + foreach ( $row as $k => $v ) { + if ( substr( $k, -3 ) == '_id' && is_string( $v ) && strlen( $v ) === UUID::BIN_LEN ) { + $rows[$key][$k] = UUID::create( $v ); + } + } + } + return $rows; + } } /** diff --git a/includes/Model/UUID.php b/includes/Model/UUID.php index 2799dfc..0bd83c4 100644 --- a/includes/Model/UUID.php +++ b/includes/Model/UUID.php @@ -12,6 +12,11 @@ protected $hexValue; protected $timestamp; + // UUID length in hex + const HEX_LEN = 32; + // UUID length in binary + const BIN_LEN = 16; + function __construct( $binaryValue ) { if ( strlen( $binaryValue ) !== 16 ) { throw new \InvalidArgumentException( 'Expected 16 char binary string, got: ' . $binaryValue ); -- To view, visit https://gerrit.wikimedia.org/r/98994 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7d3703b2c291baccb6104e92cc299cff9b43cdd8 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Flow Gerrit-Branch: master Gerrit-Owner: EBernhardson ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] [Browser test] New test for VE media interface - change (mediawiki...VisualEditor)
jenkins-bot has submitted this change and it was merged. Change subject: [Browser test] New test for VE media interface .. [Browser test] New test for VE media interface Updated to capture changed iframe positioning of some page controls. Change-Id: I3864e04935eca1ae7c9d70df42fd34ce58e90d66 --- A modules/ve-mw/test/browser/features/media_interface.feature A modules/ve-mw/test/browser/features/step_definitions/media_interface_steps.rb M modules/ve-mw/test/browser/features/support/pages/visual_editor_page.rb 3 files changed, 57 insertions(+), 1 deletion(-) Approvals: Cmcmahon: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/ve-mw/test/browser/features/media_interface.feature b/modules/ve-mw/test/browser/features/media_interface.feature new file mode 100644 index 000..82b6f0e --- /dev/null +++ b/modules/ve-mw/test/browser/features/media_interface.feature @@ -0,0 +1,20 @@ +@ie6-bug @ie7-bug @ie8-bug @ie9-bug @ie10-bug @en.wikipedia.beta.wmflabs.org @test2.wikipedia.org @login +Feature: VisualEditor Media Interface + + Scenario Outline: VisualEditor insert new media +Given I am logged in + And I am at my user page +When I click Edit for VisualEditor + And I click Media + And I enter into media Search box + And I select an Image + And I click Save page + And I click Links Review your changes +Then should appear in the media diff view + And I can click the X on the media save box + Examples: + | search_term | expected_markup_text | + | San Francisco | [[File:California county map (San Francisco County highlighted).svg\|thumb\|150x150px]] | + | Flash video | [[File:Flash video file icon.png\|thumb\|32x32px]] | + | cunfrunti | [[File:Cunfrunti.mpg.OGG\|thumb\|183x183px]] | + diff --git a/modules/ve-mw/test/browser/features/step_definitions/media_interface_steps.rb b/modules/ve-mw/test/browser/features/step_definitions/media_interface_steps.rb new file mode 100644 index 000..be61421 --- /dev/null +++ b/modules/ve-mw/test/browser/features/step_definitions/media_interface_steps.rb @@ -0,0 +1,31 @@ +When(/^I click Media$/) do + on(VisualEditorPage) do |page| +page.more_menu_element.when_present.click +page.ve_media_menu_element.when_present.click + end +end + +When(/^I enter (.+) into media Search box$/) do |content| + on(VisualEditorPage).media_search_element.when_present.send_keys(content) +end + +When(/^I select an Image$/) do + on(VisualEditorPage).media_select_element.when_present.click +end + +Then(/^(.+) should appear in the media diff view$/) do |headings_string| + on(VisualEditorPage) do |page| +# Contents pulled from the Cucumber tables in the .feature are escaped regexes. +# In this case we want unescaped regexes (and in one case a leading space) +# So we put single quotes around the entries in the .feature file and strip them here to get unescaped regexes. +headings_string = headings_string.gsub(/'/, '') +page.wait_until(10) do + page.media_diff_view.include? "Your text" +end +page.media_diff_view.should match Regexp.new(headings_string) + end +end + +Then(/^I can click the X on the media save box$/) do + on(VisualEditorPage).media_exit_element.when_present.click +end \ No newline at end of file diff --git a/modules/ve-mw/test/browser/features/support/pages/visual_editor_page.rb b/modules/ve-mw/test/browser/features/support/pages/visual_editor_page.rb index cab5015..d2ae5d5 100644 --- a/modules/ve-mw/test/browser/features/support/pages/visual_editor_page.rb +++ b/modules/ve-mw/test/browser/features/support/pages/visual_editor_page.rb @@ -35,6 +35,7 @@ span(:ve_computer_code, class: 'oo-ui-iconedElement-icon oo-ui-icon-code') div(:ve_heading_menu, class: 'oo-ui-iconedElement-icon oo-ui-icon-down') span(:ve_link_icon, class: 'oo-ui-iconedElement-icon oo-ui-icon-link') + span(:ve_media_menu, class: 'oo-ui-iconedElement-icon oo-ui-icon-picture') span(:ve_references, class: 'oo-ui-iconedElement-icon oo-ui-icon-reference') span(:ve_numbering, class: 'oo-ui-iconedElement-icon oo-ui-icon-number-list') span(:ve_strikethrough, class: 'oo-ui-iconedElement-icon oo-ui-icon-strikethrough-s') @@ -59,9 +60,11 @@ span(:apply_changes, text: 'Apply changes', frame: frame) div(:content_box, class: 've-ce-documentNode ve-ce-branchNode', frame: frame) text_area(:describe_change, index: 0, frame: frame) -div(:diff_view, class: 've-ui-mwSaveDialog-viewer', frame: frame) a(:ex, title: 'Close', frame: frame) span(:insert_reference, text: 'Insert reference', frame: frame) +div(:media_diff_view, class: 've-ui-mwSaveDialog-viewer', frame: frame) +text_field(:media_search