[MediaWiki-commits] [Gerrit] fixed a problem with fractional percentages - change (mediawiki...AJAXPoll)
Wikinaut has uploaded a new change for review. https://gerrit.wikimedia.org/r/66229 Change subject: fixed a problem with fractional percentages .. fixed a problem with fractional percentages when rendering the result bar do not use localized percentage string width must contain a dot like 33.33% but must not come with a comma like 33,33% Change-Id: Id2dd68cb8df339358b274df08d713eee351adf42 --- M AJAXPoll.php M AJAXPoll_body.php 2 files changed, 5 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/AJAXPoll refs/changes/29/66229/1 diff --git a/AJAXPoll.php b/AJAXPoll.php index ac9918a..f84287d 100644 --- a/AJAXPoll.php +++ b/AJAXPoll.php @@ -31,7 +31,7 @@ $wgExtensionCredits['parserhook'][] = array( 'path' = __FILE__, 'name' = 'AJAX Poll', - 'version' = '1.81 20130526', + 'version' = '1.82 20130531', 'author' = array( 'Dariusz Siedlecki', 'Jack Phoenix', 'Thomas Gries' ), 'descriptionmsg' = 'ajaxpoll-desc', 'url' = 'https://www.mediawiki.org/wiki/Extension:AJAX_Poll', diff --git a/AJAXPoll_body.php b/AJAXPoll_body.php index d5ce3d7..07ef53e 100644 --- a/AJAXPoll_body.php +++ b/AJAXPoll_body.php @@ -402,7 +402,8 @@ if ( $amountOfVotes == 0 ) { $percent = 0; } else { - $percent = $wgLang-formatNum( round( ( isset( $poll_result[$i + 1] ) ? $poll_result[$i + 1] : 0 ) * 100 / $amountOfVotes, 2 ) ); + $percent = round( ( isset( $poll_result[$i + 1] ) ? $poll_result[$i + 1] : 0 ) * 100 / $amountOfVotes, 2 ); + $percentLocalized = $wgLang-formatNum( $percent ); } $our = ( isset( $row[0] ) ( $row[0] - 1 == $i ) ); @@ -414,8 +415,8 @@ if ( $wgUser-isAllowed( 'ajaxpoll-view-results' ) ( $showResultsBeforeVoting || ( !$showResultsBeforeVoting $userVoted ) ) ) { $resultBar = div class='ajaxpoll-answer-vote . ( $our ? ' ajaxpoll-our-vote' : '' ) .' -span title=' . wfMessage( 'ajaxpoll-percent-votes', sprintf( $percent ) )-escaped() . ' . ( ( isset( $poll_result ) !empty( $poll_result[$i + 1] ) ) ? $poll_result[$i + 1] : 0 ) . /span -div style='width: . $percent . %; . ( $percent == 0 ? ' border:0;' : '' ) . '/div +span title=' . wfMessage( 'ajaxpoll-percent-votes', sprintf( $percentLocalized ) )-escaped() . ' . ( ( isset( $poll_result ) !empty( $poll_result[$i + 1] ) ) ? $poll_result[$i + 1] : 0 ) . /span +div style='width: . $percent . %; . ( $percent == 0 ? ' border:0;' : '' ) . '/div /div; } else { $resultBar = ''; -- To view, visit https://gerrit.wikimedia.org/r/66229 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id2dd68cb8df339358b274df08d713eee351adf42 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/AJAXPoll Gerrit-Branch: master Gerrit-Owner: Wikinaut m...@tgries.de ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Merge branch 'master' of ssh://gerrit.wikimedia.org:29418/me... - change (mediawiki...ExternalArticles)
Samwilson has uploaded a new change for review. https://gerrit.wikimedia.org/r/66230 Change subject: Merge branch 'master' of ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ExternalArticles .. Merge branch 'master' of ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ExternalArticles --- 0 files changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ExternalArticles refs/changes/30/66230/1 [Octopus merge; cannot be formatted as a diff.] -- To view, visit https://gerrit.wikimedia.org/r/66230 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I73b15b459a452014031ec54df7d7708139d567fe Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/ExternalArticles Gerrit-Branch: master Gerrit-Owner: Samwilson s...@samwilson.id.au ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add a message to the edit form when external text is loaded.... - change (mediawiki...ExternalArticles)
Samwilson has uploaded a new change for review. https://gerrit.wikimedia.org/r/66231 Change subject: Add a message to the edit form when external text is loaded. Also, an i18n file for the messages. .. Add a message to the edit form when external text is loaded. Also, an i18n file for the messages. Change-Id: Ib2700ba24e055816ecd0809cb4d0a71d0d661326 --- A ExternalArticles.i18n.php M ExternalArticles.php 2 files changed, 26 insertions(+), 7 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ExternalArticles refs/changes/31/66231/1 diff --git a/ExternalArticles.i18n.php b/ExternalArticles.i18n.php new file mode 100644 index 000..0efd351 --- /dev/null +++ b/ExternalArticles.i18n.php @@ -0,0 +1,21 @@ +?php +/** + * Internationalisation for the ExternalArticles extension + * + * @file + * @ingroup Extensions + */ +$messages = array(); + +/** English */ +$messages['en'] = array( + 'externalarticles-desc' = 'Automatically fetch article text from external wikis', + 'externalarticles-article-loaded' = 'This article has been automatically loaded from $1.', +); + +/** Message documentation */ +$messages['qqq'] = array( + 'externalarticles-desc' = 'General description of this extension.', + 'externalarticles-article-loaded' = 'Parameters: +* $1: The URL of the external page.', +); diff --git a/ExternalArticles.php b/ExternalArticles.php index cb7ad89..edf442a 100644 --- a/ExternalArticles.php +++ b/ExternalArticles.php @@ -44,20 +44,18 @@ } /** - * Initialize variables + * Extension setup. */ -define( 'MEDIAWIKI_EXTERNALARTICLES', true ); -//define( 'EXTERNALARTICLES_DEBUG', true ); - $wgExtensionCredits['other'][] = array( 'path' = __FILE__, 'name' = 'External Articles', - 'description' = 'Preloads source from external articles.', - //'descriptionmsg' = 'externalarticles-description-msg', + 'descriptionmsg' = 'externalarticles-desc', 'version' = '0.1.4', // version date 2013-05-31 'author' = 'Nathan Perry, Alvinos, and Sam Wilson', 'url' = 'http://www.mediawiki.org/wiki/Extension:ExternalArticles' ); +$wgExtensionMessagesFiles['ExternalArticles'] = dirname( __FILE__ ) . '/ExternalArticles.i18n.php'; +$wgHooks['EditFormPreloadText'][] = 'ExternalArticles_EditFormPreloadText'; // todo: change this so each setting is set to it's default if it is not defined. // Currently, if anything is overridden, all must be defined. @@ -72,7 +70,6 @@ // todo: validate $eagRules URL's, etc... } -$wgHooks['EditFormPreloadText'][] = 'ExternalArticles_EditFormPreloadText'; /** * Preload text from a remote wiki into the edit form. Called when edit page for @@ -111,6 +108,7 @@ } return false; } + $wgOut-wrapWikiMsg('div class=success$1/div', array('externalarticles-article-loaded', $url)); $text = $httpRequest-getContent(); return true; -- To view, visit https://gerrit.wikimedia.org/r/66231 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib2700ba24e055816ecd0809cb4d0a71d0d661326 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/ExternalArticles Gerrit-Branch: master Gerrit-Owner: Samwilson s...@samwilson.id.au ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] removing myself from icinga for vacation - change (operations/puppet)
Pyoungmeister has uploaded a new change for review. https://gerrit.wikimedia.org/r/66232 Change subject: removing myself from icinga for vacation .. removing myself from icinga for vacation Change-Id: Ibffcdbe467a65b7582d5fd72fe382832b0752c00 --- M files/icinga/contactgroups.cfg 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/32/66232/1 diff --git a/files/icinga/contactgroups.cfg b/files/icinga/contactgroups.cfg index 13e4aa9..2fa3ce4 100644 --- a/files/icinga/contactgroups.cfg +++ b/files/icinga/contactgroups.cfg @@ -6,7 +6,8 @@ define contactgroup { contactgroup_name sms - members mark,atglenn,rlane,tstarling,ctwoo,py,afeldman,dzahn,jgreen,lcarr,faidon,robh + #members mark,atglenn,rlane,tstarling,ctwoo,py,afeldman,dzahn,jgreen,lcarr,faidon,robh + members mark,atglenn,rlane,tstarling,ctwoo,afeldman,dzahn,jgreen,lcarr,faidon,robh } define contactgroup { -- To view, visit https://gerrit.wikimedia.org/r/66232 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibffcdbe467a65b7582d5fd72fe382832b0752c00 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Pyoungmeister p...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] fixed a problem with fractional percentages - change (mediawiki...AJAXPoll)
Wikinaut has submitted this change and it was merged. Change subject: fixed a problem with fractional percentages .. fixed a problem with fractional percentages when rendering the result bar do not use localized percentage string width must contain a dot like 33.33% but must not come with a comma like 33,33% Change-Id: Id2dd68cb8df339358b274df08d713eee351adf42 --- M AJAXPoll.php M AJAXPoll_body.php 2 files changed, 5 insertions(+), 4 deletions(-) Approvals: Wikinaut: Verified; Looks good to me, approved diff --git a/AJAXPoll.php b/AJAXPoll.php index ac9918a..f84287d 100644 --- a/AJAXPoll.php +++ b/AJAXPoll.php @@ -31,7 +31,7 @@ $wgExtensionCredits['parserhook'][] = array( 'path' = __FILE__, 'name' = 'AJAX Poll', - 'version' = '1.81 20130526', + 'version' = '1.82 20130531', 'author' = array( 'Dariusz Siedlecki', 'Jack Phoenix', 'Thomas Gries' ), 'descriptionmsg' = 'ajaxpoll-desc', 'url' = 'https://www.mediawiki.org/wiki/Extension:AJAX_Poll', diff --git a/AJAXPoll_body.php b/AJAXPoll_body.php index d5ce3d7..07ef53e 100644 --- a/AJAXPoll_body.php +++ b/AJAXPoll_body.php @@ -402,7 +402,8 @@ if ( $amountOfVotes == 0 ) { $percent = 0; } else { - $percent = $wgLang-formatNum( round( ( isset( $poll_result[$i + 1] ) ? $poll_result[$i + 1] : 0 ) * 100 / $amountOfVotes, 2 ) ); + $percent = round( ( isset( $poll_result[$i + 1] ) ? $poll_result[$i + 1] : 0 ) * 100 / $amountOfVotes, 2 ); + $percentLocalized = $wgLang-formatNum( $percent ); } $our = ( isset( $row[0] ) ( $row[0] - 1 == $i ) ); @@ -414,8 +415,8 @@ if ( $wgUser-isAllowed( 'ajaxpoll-view-results' ) ( $showResultsBeforeVoting || ( !$showResultsBeforeVoting $userVoted ) ) ) { $resultBar = div class='ajaxpoll-answer-vote . ( $our ? ' ajaxpoll-our-vote' : '' ) .' -span title=' . wfMessage( 'ajaxpoll-percent-votes', sprintf( $percent ) )-escaped() . ' . ( ( isset( $poll_result ) !empty( $poll_result[$i + 1] ) ) ? $poll_result[$i + 1] : 0 ) . /span -div style='width: . $percent . %; . ( $percent == 0 ? ' border:0;' : '' ) . '/div +span title=' . wfMessage( 'ajaxpoll-percent-votes', sprintf( $percentLocalized ) )-escaped() . ' . ( ( isset( $poll_result ) !empty( $poll_result[$i + 1] ) ) ? $poll_result[$i + 1] : 0 ) . /span +div style='width: . $percent . %; . ( $percent == 0 ? ' border:0;' : '' ) . '/div /div; } else { $resultBar = ''; -- To view, visit https://gerrit.wikimedia.org/r/66229 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id2dd68cb8df339358b274df08d713eee351adf42 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/AJAXPoll Gerrit-Branch: master Gerrit-Owner: Wikinaut m...@tgries.de Gerrit-Reviewer: Wikinaut m...@tgries.de ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove lot of scroll to view related code - change (mediawiki...UniversalLanguageSelector)
Santhosh has uploaded a new change for review. https://gerrit.wikimedia.org/r/66233 Change subject: Remove lot of scroll to view related code .. Remove lot of scroll to view related code Just use javascript scrollIntoView to do that. Also remove duplication of code related to this Change-Id: Ied1235a85f4fe2d99afa127737979c24d3591118 --- M resources/js/ext.uls.displaysettings.js M resources/js/ext.uls.inputsettings.js M resources/js/ext.uls.languagesettings.js 3 files changed, 8 insertions(+), 89 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UniversalLanguageSelector refs/changes/33/66233/1 diff --git a/resources/js/ext.uls.displaysettings.js b/resources/js/ext.uls.displaysettings.js index f75fc72..e531325 100644 --- a/resources/js/ext.uls.displaysettings.js +++ b/resources/js/ext.uls.displaysettings.js @@ -485,14 +485,7 @@ } ); $tabButtons.on( 'click', function () { - var scrollPosition, - panelHeight, panelTop, panelBottom, - padding, - $window, - windowHeight, - windowScrollTop, - windowBottom, - $button = $( this ); + var $button = $( this ); if ( $button.hasClass( 'down' ) ) { return; @@ -508,35 +501,10 @@ } } ); + displaySettings.$parent.position(); $tabButtons.filter( '.down' ).removeClass( 'down'); $button.addClass( 'down' ); - padding = 10; - $window = $( window ); - windowHeight = $window.height(); - windowScrollTop = $window.scrollTop(); - windowBottom = windowScrollTop + windowHeight; - - panelHeight = displaySettings.$parent.$window.height(); - panelTop = displaySettings.$parent.$window.offset().top; - panelBottom = panelTop + panelHeight; - - // If the ULS panel is out of the viewport, - // scroll the window to show it - if ( ( panelTop windowScrollTop ) || ( panelBottom windowBottom ) ) { - if ( panelHeight windowHeight ) { - // Scroll to show as much of the upper - // part of ULS as possible - scrollPosition = panelTop - padding; - } else { - // Scroll just enough to show the ULS panel - scrollPosition = panelBottom - windowHeight + padding; - } - - $( 'html, body' ).stop().animate( { - scrollTop: scrollPosition - }, 500 ); - } } ); }, @@ -600,4 +568,3 @@ display: DisplaySettings } ); })( jQuery, mediaWiki ); - diff --git a/resources/js/ext.uls.inputsettings.js b/resources/js/ext.uls.inputsettings.js index 6125f35..685f437 100644 --- a/resources/js/ext.uls.inputsettings.js +++ b/resources/js/ext.uls.inputsettings.js @@ -502,4 +502,3 @@ } ); } ( jQuery, mediaWiki ) ); - diff --git a/resources/js/ext.uls.languagesettings.js b/resources/js/ext.uls.languagesettings.js index 9167dab..f934925 100644 --- a/resources/js/ext.uls.languagesettings.js +++ b/resources/js/ext.uls.languagesettings.js @@ -115,38 +115,11 @@ $settingsMenuItems.append( $settingsLink ); $settingsLink.on( 'click', function () { - var scrollPosition, - panelHeight, panelTop, panelBottom, - padding = 10, - $window = $( window ), - windowHeight = $window.height(), - windowScrollTop = $window.scrollTop(), - windowBottom = windowScrollTop + windowHeight, - module = $( this
[MediaWiki-commits] [Gerrit] Postition the language settings in RTL with interlanguage po... - change (mediawiki...UniversalLanguageSelector)
Santhosh has uploaded a new change for review. https://gerrit.wikimedia.org/r/66235 Change subject: Postition the language settings in RTL with interlanguage position .. Postition the language settings in RTL with interlanguage position The left position of the window was wrong. Change-Id: I3353d930cb8251021f206ed5f1a0821d17059fe8 --- M resources/js/ext.uls.interface.js 1 file changed, 12 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UniversalLanguageSelector refs/changes/35/66235/1 diff --git a/resources/js/ext.uls.interface.js b/resources/js/ext.uls.interface.js index 1ef7590..6070dc1 100644 --- a/resources/js/ext.uls.interface.js +++ b/resources/js/ext.uls.interface.js @@ -277,15 +277,24 @@ if ( ulsPosition === 'interlanguage' ) { $ulsSettingsTrigger.attr( 'title', $.i18n( 'ext-uls-select-language-settings-icon-tooltip' ) ); + $ulsSettingsTrigger.languagesettings( { onVisible: function () { - var ulsTriggerOffset = $ulsSettingsTrigger.offset(); - this.left = rtlPage ? ulsTriggerOffset.left - 30 - :ulsTriggerOffset.left + 30; + var left, + ulsTriggerOffset = $ulsSettingsTrigger.offset(); + + if ( rtlPage ) { + left = ulsTriggerOffset.left - this.$window.width() - 30 + } else { + left = ulsTriggerOffset.left + 30 + } + + this.left = left; this.top = ulsTriggerOffset.top - 50; this.position(); } } ); + $( '.uls-menu' ).each( function () { $( this ).prepend( $( 'span' ).addClass( 'caret-before' ), -- To view, visit https://gerrit.wikimedia.org/r/66235 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3353d930cb8251021f206ed5f1a0821d17059fe8 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/UniversalLanguageSelector Gerrit-Branch: master Gerrit-Owner: Santhosh santhosh.thottin...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] removing myself from icinga for vacation - change (operations/puppet)
Pyoungmeister has submitted this change and it was merged. Change subject: removing myself from icinga for vacation .. removing myself from icinga for vacation Change-Id: Ibffcdbe467a65b7582d5fd72fe382832b0752c00 --- M files/icinga/contactgroups.cfg 1 file changed, 2 insertions(+), 1 deletion(-) Approvals: Pyoungmeister: Verified; Looks good to me, approved diff --git a/files/icinga/contactgroups.cfg b/files/icinga/contactgroups.cfg index 13e4aa9..2fa3ce4 100644 --- a/files/icinga/contactgroups.cfg +++ b/files/icinga/contactgroups.cfg @@ -6,7 +6,8 @@ define contactgroup { contactgroup_name sms - members mark,atglenn,rlane,tstarling,ctwoo,py,afeldman,dzahn,jgreen,lcarr,faidon,robh + #members mark,atglenn,rlane,tstarling,ctwoo,py,afeldman,dzahn,jgreen,lcarr,faidon,robh + members mark,atglenn,rlane,tstarling,ctwoo,afeldman,dzahn,jgreen,lcarr,faidon,robh } define contactgroup { -- To view, visit https://gerrit.wikimedia.org/r/66232 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibffcdbe467a65b7582d5fd72fe382832b0752c00 Gerrit-PatchSet: 2 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Pyoungmeister p...@wikimedia.org Gerrit-Reviewer: Pyoungmeister p...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Awful hacks to make Puppet work are nothing new... - change (operations/puppet)
Mark Bergsma has submitted this change and it was merged. Change subject: Awful hacks to make Puppet work are nothing new... .. Awful hacks to make Puppet work are nothing new... Change-Id: Iffd21658576c77b731b53a9139a8de2fe541fe38 --- M manifests/varnish.pp 1 file changed, 14 insertions(+), 7 deletions(-) Approvals: Mark Bergsma: Verified; Looks good to me, approved diff --git a/manifests/varnish.pp b/manifests/varnish.pp index ff4961a..6c3fd69 100644 --- a/manifests/varnish.pp +++ b/manifests/varnish.pp @@ -53,11 +53,14 @@ } } - define extra-vcl($instancesuffix) { - file { /etc/varnish/${title}.inc.vcl: - content = template(varnish/${title}.inc.vcl.erb), - notify = Exec[load-new-vcl-file${instancesuffix}], - mode = 0444; + define extra-vcl { + $vcl = regsubst($title, '^([^/]+)/', '\1') + $filename = /etc/varnish/${vcl}.inc.vcl + if !defined(File[$filename]) { + file { $filename: + content = template(varnish/${vcl}.inc.vcl.erb), + mode = 0444; + } } } @@ -104,7 +107,8 @@ # Install VCL include files shared by all instances require varnish::common-vcl - extra-vcl { $extra_vcl: instancesuffix = $instancesuffix } + $extra_vcl_variable_to_make_puppet_parser_happy = suffix($extra_vcl, /${instancesuffix}) + extra-vcl{ $extra_vcl_variable_to_make_puppet_parser_happy: } file { /etc/init.d/varnish${instancesuffix}: @@ -141,7 +145,10 @@ exec { load-new-vcl-file${instancesuffix}: require = [ Service[varnish${instancesuffix}], File[/etc/varnish/wikimedia_${vcl}.vcl] ], - subscribe = [File[/etc/varnish/wikimedia_${vcl}.vcl], Class[varnish::common-vcl]], + subscribe = [File[/etc/varnish/wikimedia_${vcl}.vcl], + Class[varnish::common-vcl], + File[suffix(prefix($extra_vcl, /etc/varnish/), .inc.vcl)] + ], command = /usr/share/varnish/reload-vcl $extraopts, path = /bin:/usr/bin, refreshonly = true; -- To view, visit https://gerrit.wikimedia.org/r/66124 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iffd21658576c77b731b53a9139a8de2fe541fe38 Gerrit-PatchSet: 4 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Mark Bergsma m...@wikimedia.org Gerrit-Reviewer: Mark Bergsma m...@wikimedia.org Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Replace '/' separator with a space - change (operations/puppet)
Mark Bergsma has uploaded a new change for review. https://gerrit.wikimedia.org/r/66236 Change subject: Replace '/' separator with a space .. Replace '/' separator with a space Puppet seems to convert / for a resource identifier into a - Change-Id: If81bd6cb64c5a348bde84bdd2922cf0ce4ac8dbe --- M manifests/varnish.pp 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/36/66236/1 diff --git a/manifests/varnish.pp b/manifests/varnish.pp index 6c3fd69..f78bb4d 100644 --- a/manifests/varnish.pp +++ b/manifests/varnish.pp @@ -54,7 +54,7 @@ } define extra-vcl { - $vcl = regsubst($title, '^([^/]+)/', '\1') + $vcl = regsubst($title, '^[^ ]+ ', '\1') $filename = /etc/varnish/${vcl}.inc.vcl if !defined(File[$filename]) { file { $filename: @@ -107,7 +107,7 @@ # Install VCL include files shared by all instances require varnish::common-vcl - $extra_vcl_variable_to_make_puppet_parser_happy = suffix($extra_vcl, /${instancesuffix}) + $extra_vcl_variable_to_make_puppet_parser_happy = suffix($extra_vcl, ${instancesuffix}) extra-vcl{ $extra_vcl_variable_to_make_puppet_parser_happy: } file { -- To view, visit https://gerrit.wikimedia.org/r/66236 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If81bd6cb64c5a348bde84bdd2922cf0ce4ac8dbe Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Mark Bergsma m...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Replace '/' separator with a space - change (operations/puppet)
Mark Bergsma has submitted this change and it was merged. Change subject: Replace '/' separator with a space .. Replace '/' separator with a space Puppet seems to convert / for a resource identifier into a - Change-Id: If81bd6cb64c5a348bde84bdd2922cf0ce4ac8dbe --- M manifests/varnish.pp 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Mark Bergsma: Verified; Looks good to me, approved diff --git a/manifests/varnish.pp b/manifests/varnish.pp index 6c3fd69..f78bb4d 100644 --- a/manifests/varnish.pp +++ b/manifests/varnish.pp @@ -54,7 +54,7 @@ } define extra-vcl { - $vcl = regsubst($title, '^([^/]+)/', '\1') + $vcl = regsubst($title, '^[^ ]+ ', '\1') $filename = /etc/varnish/${vcl}.inc.vcl if !defined(File[$filename]) { file { $filename: @@ -107,7 +107,7 @@ # Install VCL include files shared by all instances require varnish::common-vcl - $extra_vcl_variable_to_make_puppet_parser_happy = suffix($extra_vcl, /${instancesuffix}) + $extra_vcl_variable_to_make_puppet_parser_happy = suffix($extra_vcl, ${instancesuffix}) extra-vcl{ $extra_vcl_variable_to_make_puppet_parser_happy: } file { -- To view, visit https://gerrit.wikimedia.org/r/66236 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: If81bd6cb64c5a348bde84bdd2922cf0ce4ac8dbe Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Mark Bergsma m...@wikimedia.org Gerrit-Reviewer: Mark Bergsma m...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Replace the entire string - change (operations/puppet)
Mark Bergsma has uploaded a new change for review. https://gerrit.wikimedia.org/r/66237 Change subject: Replace the entire string .. Replace the entire string Change-Id: I78ec76e81ecb808aed6fa835cbc9475bbd4975a8 --- M manifests/varnish.pp 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/37/66237/1 diff --git a/manifests/varnish.pp b/manifests/varnish.pp index f78bb4d..c05b06f 100644 --- a/manifests/varnish.pp +++ b/manifests/varnish.pp @@ -54,7 +54,7 @@ } define extra-vcl { - $vcl = regsubst($title, '^[^ ]+ ', '\1') + $vcl = regsubst($title, '^[^ ]+ .*$', '\1') $filename = /etc/varnish/${vcl}.inc.vcl if !defined(File[$filename]) { file { $filename: -- To view, visit https://gerrit.wikimedia.org/r/66237 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I78ec76e81ecb808aed6fa835cbc9475bbd4975a8 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Mark Bergsma m...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Replace the entire string - change (operations/puppet)
Mark Bergsma has submitted this change and it was merged. Change subject: Replace the entire string .. Replace the entire string Change-Id: I78ec76e81ecb808aed6fa835cbc9475bbd4975a8 --- M manifests/varnish.pp 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Mark Bergsma: Verified; Looks good to me, approved diff --git a/manifests/varnish.pp b/manifests/varnish.pp index f78bb4d..c05b06f 100644 --- a/manifests/varnish.pp +++ b/manifests/varnish.pp @@ -54,7 +54,7 @@ } define extra-vcl { - $vcl = regsubst($title, '^[^ ]+ ', '\1') + $vcl = regsubst($title, '^[^ ]+ .*$', '\1') $filename = /etc/varnish/${vcl}.inc.vcl if !defined(File[$filename]) { file { $filename: -- To view, visit https://gerrit.wikimedia.org/r/66237 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I78ec76e81ecb808aed6fa835cbc9475bbd4975a8 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Mark Bergsma m...@wikimedia.org Gerrit-Reviewer: Mark Bergsma m...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Using a correct regexp with match groups does help - change (operations/puppet)
Mark Bergsma has uploaded a new change for review. https://gerrit.wikimedia.org/r/66238 Change subject: Using a correct regexp with match groups does help .. Using a correct regexp with match groups does help Change-Id: I7e849aef712b0f8bfd09230b97b0597c86220078 --- M manifests/varnish.pp 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/38/66238/1 diff --git a/manifests/varnish.pp b/manifests/varnish.pp index c05b06f..0745ff9 100644 --- a/manifests/varnish.pp +++ b/manifests/varnish.pp @@ -54,7 +54,7 @@ } define extra-vcl { - $vcl = regsubst($title, '^[^ ]+ .*$', '\1') + $vcl = regsubst($title, '^([^ ]+) .*$', '\1') $filename = /etc/varnish/${vcl}.inc.vcl if !defined(File[$filename]) { file { $filename: -- To view, visit https://gerrit.wikimedia.org/r/66238 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7e849aef712b0f8bfd09230b97b0597c86220078 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Mark Bergsma m...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Using a correct regexp with match groups does help - change (operations/puppet)
Mark Bergsma has submitted this change and it was merged. Change subject: Using a correct regexp with match groups does help .. Using a correct regexp with match groups does help Change-Id: I7e849aef712b0f8bfd09230b97b0597c86220078 --- M manifests/varnish.pp 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Mark Bergsma: Verified; Looks good to me, approved diff --git a/manifests/varnish.pp b/manifests/varnish.pp index c05b06f..0745ff9 100644 --- a/manifests/varnish.pp +++ b/manifests/varnish.pp @@ -54,7 +54,7 @@ } define extra-vcl { - $vcl = regsubst($title, '^[^ ]+ .*$', '\1') + $vcl = regsubst($title, '^([^ ]+) .*$', '\1') $filename = /etc/varnish/${vcl}.inc.vcl if !defined(File[$filename]) { file { $filename: -- To view, visit https://gerrit.wikimedia.org/r/66238 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7e849aef712b0f8bfd09230b97b0597c86220078 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Mark Bergsma m...@wikimedia.org Gerrit-Reviewer: Mark Bergsma m...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add all mobile UAs currently listed in the Squid configuration - change (operations/puppet)
Mark Bergsma has submitted this change and it was merged. Change subject: Add all mobile UAs currently listed in the Squid configuration .. Add all mobile UAs currently listed in the Squid configuration Change-Id: I75481495b7f1bd8379426e44d3aad1da63527bac --- M templates/varnish/text-frontend.inc.vcl.erb 1 file changed, 3 insertions(+), 2 deletions(-) Approvals: Mark Bergsma: Verified; Looks good to me, approved diff --git a/templates/varnish/text-frontend.inc.vcl.erb b/templates/varnish/text-frontend.inc.vcl.erb index ab06f59..79e40f3 100644 --- a/templates/varnish/text-frontend.inc.vcl.erb +++ b/templates/varnish/text-frontend.inc.vcl.erb @@ -4,7 +4,8 @@ include text-common.inc.vcl; sub mobile_redirect { - if ((req.http.User-Agent ~ mobi || req.http.Accept ~ vnd.wap.wml) + if ((req.http.User-Agent ~ (?i)(mobi|240x240|240x320|320x320|alcatel|android|audiovox|bada|benq|blackberry|cdm-|compal-|docomo|ericsson|hiptop|htc[-_]|huawei|ipod|kddi-|kindle|meego|midp|mitsu|mmp\/|mot-|motor|ngm_|nintendo|opera.m|palm|panasonic|philips|phone|playstation|portalmmm|sagem-|samsung|sanyo|sec-|sendo|sharp|softbank|symbian|teleca|up.browser|webos) + || req.http.User-Agent ~ ^(lge?|sie|nec|sgh|pg)- || req.http.Accept ~ vnd.wap.wml) req.http.User-Agent !~ (iPad|Android.3|(?i)tablet|(?i)(?!google)bot|PlayBook|Wii) req.http.Cookie !~ (stopMobileRedirect=true|mf_useformat=desktop) req.url ~ ^/wiki/) { @@ -66,4 +67,4 @@ call errorpage; return(deliver); -} \ No newline at end of file +} -- To view, visit https://gerrit.wikimedia.org/r/65823 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I75481495b7f1bd8379426e44d3aad1da63527bac Gerrit-PatchSet: 3 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Mark Bergsma m...@wikimedia.org Gerrit-Reviewer: Mark Bergsma m...@wikimedia.org Gerrit-Reviewer: MaxSem maxsem.w...@gmail.com 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 comment as rawParam instead of param; it should _not_ be... - change (mediawiki...ArticleFeedbackv5)
Matthias Mullie has uploaded a new change for review. https://gerrit.wikimedia.org/r/66239 Change subject: Add comment as rawParam instead of param; it should _not_ be parsed .. Add comment as rawParam instead of param; it should _not_ be parsed https://en.wikipedia.org/wiki/Wikipedia:Village_pump_%28technical%29#User_contributions_oddity Example of why it shouldn't be parsed: https://en.wikipedia.org/wiki/Special:Contributions/176.42.16.120 Change-Id: I0c5c0231c767ff13d1c3c81038852ce6188a5c18 --- M ArticleFeedbackv5.hooks.php 1 file changed, 6 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ArticleFeedbackv5 refs/changes/39/66239/1 diff --git a/ArticleFeedbackv5.hooks.php b/ArticleFeedbackv5.hooks.php index 7a6c5d2..230f93d 100644 --- a/ArticleFeedbackv5.hooks.php +++ b/ArticleFeedbackv5.hooks.php @@ -477,9 +477,9 @@ if ( $record-aft_comment != '' ) { if ( $record-isHidden() || $record-isRequested() || $record-isOversighted() ) { // (probably) abusive comment that has been hidden/oversight-requested/oversighted - $feedback = Linker::commentBlock( wfMessage( 'articlefeedbackv5-contribs-hidden-feedback' )-escaped() ); + $feedback = wfMessage( 'articlefeedbackv5-contribs-hidden-feedback' )-escaped(); } else { - $feedback = Linker::commentBlock( $lang-truncate( $record-aft_comment, 75 ) ); + $feedback = $lang-truncate( $record-aft_comment, 75 ); } } @@ -527,11 +527,11 @@ $feedbackCentralPageTitle-getFullText(), // feedback link $pageTitle-getPrefixedText() // article title ) - -rawParams( $userlink ) // userlink (for newbies) - -params( - $feedback, // comment - $status // status + -rawParams( + $userlink, // userlink (for newbies) + Linker::commentBlock( $feedback ) // comment ) + -params( $status ) // status -parse(); $classes[] = 'mw-aft-contribution'; -- To view, visit https://gerrit.wikimedia.org/r/66239 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0c5c0231c767ff13d1c3c81038852ce6188a5c18 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/ArticleFeedbackv5 Gerrit-Branch: master Gerrit-Owner: Matthias Mullie mmul...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Update jquqery.uls from upstream - change (mediawiki...UniversalLanguageSelector)
Santhosh has uploaded a new change for review. https://gerrit.wikimedia.org/r/66240 Change subject: Update jquqery.uls from upstream .. Update jquqery.uls from upstream Change-Id: Iee1af1341accf8af5a0ec44d7ad8f07c331656ab --- M lib/jquery.uls/css/jquery.uls.lcd.css M lib/jquery.uls/i18n/id.json A lib/jquery.uls/i18n/mg.json A lib/jquery.uls/i18n/min.json M lib/jquery.uls/src/jquery.uls.core.js 5 files changed, 47 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UniversalLanguageSelector refs/changes/40/66240/1 diff --git a/lib/jquery.uls/css/jquery.uls.lcd.css b/lib/jquery.uls/css/jquery.uls.lcd.css index 28bd97b..0b928bb 100644 --- a/lib/jquery.uls/css/jquery.uls.lcd.css +++ b/lib/jquery.uls/css/jquery.uls.lcd.css @@ -8,7 +8,7 @@ /* Language list */ .uls-language-list { - height: 22em; + height: 17em; overflow: auto; width: auto; } diff --git a/lib/jquery.uls/i18n/id.json b/lib/jquery.uls/i18n/id.json index 6c8c7b0..0c0624c 100644 --- a/lib/jquery.uls/i18n/id.json +++ b/lib/jquery.uls/i18n/id.json @@ -1,11 +1,13 @@ { @metadata: { authors: [ -Farras +Farras, +Iwan Novirion ] }, uls-select-language: Pilih Bahasa, uls-region-WW: Seluruh dunia, +uls-region-SP: Khusus, uls-region-AM: Amerika, uls-region-AF: Afrika, uls-region-EU: Eropa, diff --git a/lib/jquery.uls/i18n/mg.json b/lib/jquery.uls/i18n/mg.json new file mode 100644 index 000..7bf683f --- /dev/null +++ b/lib/jquery.uls/i18n/mg.json @@ -0,0 +1,21 @@ +{ +uls-select-language: Hifidy tenim-pirenena, +uls-region-WW: Erak'izao tontolo izao, +uls-region-SP: Manokana, +uls-region-AM: Amerika, +uls-region-AF: Afrika, +uls-region-EU: Eoropa, +uls-region-AS: Azia, +uls-region-ME: Afovoany Atsinanana, +uls-region-PA: Pasifika, +uls-no-results-found: Tsy nahitana valiny, +uls-common-languages: Tenim-pirenena fampiasa matetika, +uls-no-results-suggestion-title: Mety ahitanao tombon-tsoa:, +uls-search-help: Afaka mikaroka araka ny anaran'ny tenim-pirena, anaran-tsoratra, kaody ISO-n'ny teny na afaka mifidy araky ny faritra:, +uls-search-placeholder: Fikarohana tenim-pirenena, +@metadata: { +authors: [ +Jagwar +] +} +} \ No newline at end of file diff --git a/lib/jquery.uls/i18n/min.json b/lib/jquery.uls/i18n/min.json new file mode 100644 index 000..afa0209 --- /dev/null +++ b/lib/jquery.uls/i18n/min.json @@ -0,0 +1,21 @@ +{ +uls-select-language: Piliah Bahaso, +uls-region-WW: Saluruah dunia, +uls-region-SP: Khusuih, +uls-region-AM: Amerika, +uls-region-AF: Afrika, +uls-region-EU: Eropa, +uls-region-AS: Asia, +uls-region-ME: Timua Tangah, +uls-region-PA: Pasifik, +uls-no-results-found: Hasil indak basobok, +uls-common-languages: Bahaso umum, +uls-no-results-suggestion-title: Sanak mungkin tatarik pado:, +uls-search-help: Sanak dapek mancari jo namo bahaso, namo skrip, kode ISO bahaso atau dapek pulo manalusuri manuruik wilayahnyo:, +uls-search-placeholder: Pancarian bahaso, +@metadata: { +authors: [ +Iwan Novirion +] +} +} \ No newline at end of file diff --git a/lib/jquery.uls/src/jquery.uls.core.js b/lib/jquery.uls/src/jquery.uls.core.js index 2f1f66d..4593f8d 100644 --- a/lib/jquery.uls/src/jquery.uls.core.js +++ b/lib/jquery.uls/src/jquery.uls.core.js @@ -181,6 +181,7 @@ $( '.uls-menu' ).hide(); this.$menu.show(); + this.$menu[0].scrollIntoView(); this.shown = true; if ( !this.isMobile() ) { -- To view, visit https://gerrit.wikimedia.org/r/66240 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iee1af1341accf8af5a0ec44d7ad8f07c331656ab Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/UniversalLanguageSelector Gerrit-Branch: master Gerrit-Owner: Santhosh santhosh.thottin...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] fix typos in Makefile, mwxml2sql.c, and sqlfilter.c; rename ... - change (operations/dumps)
ArielGlenn has submitted this change and it was merged. Change subject: fix typos in Makefile, mwxml2sql.c, and sqlfilter.c; rename dist .. fix typos in Makefile, mwxml2sql.c, and sqlfilter.c; rename dist Change-Id: Ia09ab6350612634cc1da2b47238d2b1376281280 --- M xmlfileutils/CHANGELOG M xmlfileutils/Makefile M xmlfileutils/mwxml2sql.c M xmlfileutils/sqlfilter.c 4 files changed, 6 insertions(+), 5 deletions(-) Approvals: ArielGlenn: Looks good to me, approved jenkins-bot: Verified diff --git a/xmlfileutils/CHANGELOG b/xmlfileutils/CHANGELOG index 817e516..1ac5c8a 100644 --- a/xmlfileutils/CHANGELOG +++ b/xmlfileutils/CHANGELOG @@ -1,4 +1,4 @@ -27 May 2013 Kent L. Miller wpmirror...@gmail.com +29 May 2013 Kent L. Miller wpmirror...@gmail.com Release 0.0.2-1 @@ -20,6 +20,7 @@ * Makefile: Debian: build and deinstall targets written; clean target improved Debian: install target rewritten to use: install $(DESTDIR)/... + Debian: dist renamed `mediawiki-mwxml2sql-0.0.2.tar.gz' Doc: man pages generated using `help2man' MWXML2SQLVERS for Makefile dist version and for VERSION in source * mwxml2sql.h: diff --git a/xmlfileutils/Makefile b/xmlfileutils/Makefile index 9dda84b..78dc755 100644 --- a/xmlfileutils/Makefile +++ b/xmlfileutils/Makefile @@ -4,7 +4,7 @@ # -- MWXML2SQLVERS = 0.0.2 -PROGRAM= mwxml2sql +PROGRAM= mediawiki-mwxml2sql DISTNAME = $(PROGRAM)-$(MWXML2SQLVERS) NAME_MWXML2SQL = convert MediaWiki XML dump file to MySQL INSERT commands NAME_SQL2TXT = convert MySQL INSERT commands to tab-separated data @@ -72,7 +72,7 @@ clean: rm -f *.o *.a mwxml2sql sql2txt sqlfilter *~ - rm -r mwxml2sql.1.gz sql2txt.1.gz sqlfilter.1.gz + rm -f mwxml2sql.1.gz sql2txt.1.gz sqlfilter.1.gz static: mwxml2sql_static sql2txt_static sqlfilter_static diff --git a/xmlfileutils/mwxml2sql.c b/xmlfileutils/mwxml2sql.c index 1fbc11e..729dc3d 100644 --- a/xmlfileutils/mwxml2sql.c +++ b/xmlfileutils/mwxml2sql.c @@ -151,7 +151,7 @@ */ void usage(char *whoami, char *message) { char * help = -Usage: mwxml2sql [OPTIONS] --mediawiki versionstring --stubs filename\n\n +Usage: mwxml2sql [OPTIONS] -m|--mediawiki versionstring -s|--stubs filename\n\n Mwxml2sql reads a possibily compressed stream of MediaWiki XML pages and\n writes possibly compressed SQL files containing INSERT statements for\n page, revision, and text tables.\n\n diff --git a/xmlfileutils/sqlfilter.c b/xmlfileutils/sqlfilter.c index a0477b3..5563220 100644 --- a/xmlfileutils/sqlfilter.c +++ b/xmlfileutils/sqlfilter.c @@ -737,7 +737,7 @@ -o, --outputfile filename\n Name of file to which output will be written. If none is\n specified, data will be written to stdout. If a filename is\n -specified that ends in .gz or .bz2, the file will be gzip or.\n +specified that ends in .gz or .bz2, the file will be gzip or\n bzip2 compressed.\n -r, --raw\n Write raw output without INSERT markup or parens, but with a \n -- To view, visit https://gerrit.wikimedia.org/r/65706 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia09ab6350612634cc1da2b47238d2b1376281280 Gerrit-PatchSet: 4 Gerrit-Project: operations/dumps Gerrit-Branch: ariel Gerrit-Owner: Wpmirrordev wpmirror...@gmail.com Gerrit-Reviewer: ArielGlenn ar...@wikimedia.org Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Basic toggler widget tests - change (mediawiki...DataValues)
Daniel Werner has submitted this change and it was merged. Change subject: Basic toggler widget tests .. Basic toggler widget tests Change-Id: I2e1281057fc537a9fe17c85c8eb9f631c473023b --- M ValueView/ValueView.tests.qunit.php M ValueView/resources/jquery.ui/jquery.ui.toggler.js A ValueView/tests/qunit/jquery.ui/jquery.ui.toggler.tests.js 3 files changed, 84 insertions(+), 5 deletions(-) Approvals: Daniel Werner: Verified; Looks good to me, approved jenkins-bot: Verified diff --git a/ValueView/ValueView.tests.qunit.php b/ValueView/ValueView.tests.qunit.php index f1c38f1..4df648e 100644 --- a/ValueView/ValueView.tests.qunit.php +++ b/ValueView/ValueView.tests.qunit.php @@ -99,6 +99,15 @@ ), ), + 'jquery.ui.toggler.tests' = array( + 'scripts' = array( + $bp/jquery.ui/jquery.ui.toggler.tests.js, + ), + 'dependencies' = array( + 'jquery.ui.toggler', + ), + ), + 'jquery.valueview.MockViewState.tests' = array( 'scripts' = array( $bp/jquery.valueview/valueview.MockViewState.tests.js, diff --git a/ValueView/resources/jquery.ui/jquery.ui.toggler.js b/ValueView/resources/jquery.ui/jquery.ui.toggler.js index 2dacdd4..88b5180 100644 --- a/ValueView/resources/jquery.ui/jquery.ui.toggler.js +++ b/ValueView/resources/jquery.ui/jquery.ui.toggler.js @@ -18,7 +18,7 @@ *(2) {number} now *(3) {jQuery.Tween} tween * - * @dependency jquery.ui.Widget + * @dependency jQuery.Widget */ ( function( $ ) { 'use strict'; @@ -51,7 +51,7 @@ } // Check for support of transformation (see https://gist.github.com/1031421) - var img = (new Image).style; + var img = (new Image()).style; browserSupportsTransform = 'transition' in img // general || 'msTransform' in img || 'webkitTransition' in img; // Webkit @@ -81,7 +81,7 @@ $toggleIcon: null, /** -* @see jQuery.ui.Widget._create +* @see jQuery.Widget._create */ _create: function() { var self = this; @@ -131,12 +131,12 @@ }, /** -* @see jQuery.ui.Widget +* @see jQuery.Widget.destroy */ destroy: function() { var label = this.element.children( this.widgetBaseClass + '-label' ).text(); this.element.empty().text( label ); - $.ui.Widget.prototype.destroy.call( this ); + $.Widget.prototype.destroy.call( this ); }, /** diff --git a/ValueView/tests/qunit/jquery.ui/jquery.ui.toggler.tests.js b/ValueView/tests/qunit/jquery.ui/jquery.ui.toggler.tests.js new file mode 100644 index 000..141d308 --- /dev/null +++ b/ValueView/tests/qunit/jquery.ui/jquery.ui.toggler.tests.js @@ -0,0 +1,70 @@ +/** + * @since 0.1 + * @ingroup ValueView + * + * @licence GNU GPL v2+ + * @author H. Snater mediaw...@snater.com + */ + +( function( $, QUnit ) { + 'use strict'; + + /** +* Factory for creating an toggler widget suitable for testing. +* +* @param {Object} options +* @return {jQuery.ui.toggler} +*/ + var newTestToggler = function( options ) { + var $defaultDiv = $( 'div/' ) + .addClass( 'test_toggler-subject' ) + .css( 'display', 'none' ) + .text( 'test' ) + .appendTo( 'body' ); + + options = $.extend( { $subject: $defaultDiv }, options ); + + var $div = $( 'div/' ) + .addClass( 'test_toggler' ) + .appendTo( $( 'body' ) ) + .toggler( options ); + + return $div.data( 'toggler' ); + }; + + QUnit.module( 'jquery.ui.toggler', QUnit.newMwEnvironment( { + teardown: function() { + $( '.test_toggler' ).each( function( i, node ) { + if( $( node ).data( 'toggler' ) ) { + $( node ).data( 'toggler' ).destroy(); + } + $( node ).remove(); + } ); + $( '.test_toggler-subject' ).remove(); + } + } ) ); + + QUnit.test( 'Initialization and destruction', 3, function( assert ) { + var toggler = newTestToggler(); + + assert.equal( +
[MediaWiki-commits] [Gerrit] Adding alerts for webrequest data loss in HDFS - change (operations/puppet)
Ottomata has uploaded a new change for review. https://gerrit.wikimedia.org/r/66241 Change subject: Adding alerts for webrequest data loss in HDFS .. Adding alerts for webrequest data loss in HDFS Change-Id: If91ce8badded15a2d15e8a0be42735ebe80f5968 --- M manifests/misc/analytics.pp M manifests/misc/monitoring.pp M templates/icinga/checkcommands.cfg.erb 3 files changed, 28 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/41/66241/1 diff --git a/manifests/misc/analytics.pp b/manifests/misc/analytics.pp index 66655da..bea13d8 100644 --- a/manifests/misc/analytics.pp +++ b/manifests/misc/analytics.pp @@ -35,4 +35,4 @@ check_command = check_kafka_broker_produce_requests!3!2, contact_group = analytics, } -} \ No newline at end of file +} diff --git a/manifests/misc/monitoring.pp b/manifests/misc/monitoring.pp index 5f6c6c1..a2ec64c 100644 --- a/manifests/misc/monitoring.pp +++ b/manifests/misc/monitoring.pp @@ -58,6 +58,20 @@ source = puppet:///files/ganglia/plugins/kraken_webrequest_loss.pyconf, notify = Service[gmond]; } + + # Set up icinga monitoring of Kraken HDFS data loss. + monitor_service { kraken_webrequest_loss_average_positive: + description = webrequest_loss_average_positive, + check_command = check_kraken_webrequest_loss_positive!2!8, + contact_group = analytics, + } + # It is possible to have negative data loss. This would mean that + # we are receiving duplicates log lines. We need alerts for this too. + monitor_service { kraken_webrequest_loss_average_negative: + description = webrequest_loss_average_negative, + check_command = check_kraken_webrequest_loss_negative!-2!-8, + contact_group = analytics, + } } # Ganglia views that should be diff --git a/templates/icinga/checkcommands.cfg.erb b/templates/icinga/checkcommands.cfg.erb index 830ba4a..b156f7e 100644 --- a/templates/icinga/checkcommands.cfg.erb +++ b/templates/icinga/checkcommands.cfg.erb @@ -621,4 +621,17 @@ command_line$USER1$/check_ganglios_generic_value -H $HOSTADDRESS$ -m kafka_network_SocketServerStats.ProduceRequestsPerSecond -w $ARG1$ -c $ARG2$ -o lt } +# Alerts for data loss in Kraken HDFS. +define command{ + command_namecheck_kraken_webrequest_loss_positive + command_line$USER1$/check_ganglios_generic_value -H $HOSTADDRESS$ -m webrequest_loss_average -w $ARG1$ -c $ARG2$ -o gt +} + +# Data loss percentage CAN be negative if we receive duplicate traffic +# (this has happened before). We need an extra alert if the percentages goes negative. +define command{ + command_namecheck_kraken_webrequest_loss_negative + command_line$USER1$/check_ganglios_generic_value -H $HOSTADDRESS$ -m webrequest_loss_average -w $ARG1$ -c $ARG2$ -o lt +} + -- To view, visit https://gerrit.wikimedia.org/r/66241 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If91ce8badded15a2d15e8a0be42735ebe80f5968 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Ottomata o...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Adding alerts for webrequest data loss in HDFS - change (operations/puppet)
Ottomata has submitted this change and it was merged. Change subject: Adding alerts for webrequest data loss in HDFS .. Adding alerts for webrequest data loss in HDFS Change-Id: If91ce8badded15a2d15e8a0be42735ebe80f5968 --- M manifests/misc/analytics.pp M manifests/misc/monitoring.pp M templates/icinga/checkcommands.cfg.erb 3 files changed, 28 insertions(+), 1 deletion(-) Approvals: Ottomata: Verified; Looks good to me, approved diff --git a/manifests/misc/analytics.pp b/manifests/misc/analytics.pp index 66655da..bea13d8 100644 --- a/manifests/misc/analytics.pp +++ b/manifests/misc/analytics.pp @@ -35,4 +35,4 @@ check_command = check_kafka_broker_produce_requests!3!2, contact_group = analytics, } -} \ No newline at end of file +} diff --git a/manifests/misc/monitoring.pp b/manifests/misc/monitoring.pp index 5f6c6c1..a2ec64c 100644 --- a/manifests/misc/monitoring.pp +++ b/manifests/misc/monitoring.pp @@ -58,6 +58,20 @@ source = puppet:///files/ganglia/plugins/kraken_webrequest_loss.pyconf, notify = Service[gmond]; } + + # Set up icinga monitoring of Kraken HDFS data loss. + monitor_service { kraken_webrequest_loss_average_positive: + description = webrequest_loss_average_positive, + check_command = check_kraken_webrequest_loss_positive!2!8, + contact_group = analytics, + } + # It is possible to have negative data loss. This would mean that + # we are receiving duplicates log lines. We need alerts for this too. + monitor_service { kraken_webrequest_loss_average_negative: + description = webrequest_loss_average_negative, + check_command = check_kraken_webrequest_loss_negative!-2!-8, + contact_group = analytics, + } } # Ganglia views that should be diff --git a/templates/icinga/checkcommands.cfg.erb b/templates/icinga/checkcommands.cfg.erb index 830ba4a..b156f7e 100644 --- a/templates/icinga/checkcommands.cfg.erb +++ b/templates/icinga/checkcommands.cfg.erb @@ -621,4 +621,17 @@ command_line$USER1$/check_ganglios_generic_value -H $HOSTADDRESS$ -m kafka_network_SocketServerStats.ProduceRequestsPerSecond -w $ARG1$ -c $ARG2$ -o lt } +# Alerts for data loss in Kraken HDFS. +define command{ + command_namecheck_kraken_webrequest_loss_positive + command_line$USER1$/check_ganglios_generic_value -H $HOSTADDRESS$ -m webrequest_loss_average -w $ARG1$ -c $ARG2$ -o gt +} + +# Data loss percentage CAN be negative if we receive duplicate traffic +# (this has happened before). We need an extra alert if the percentages goes negative. +define command{ + command_namecheck_kraken_webrequest_loss_negative + command_line$USER1$/check_ganglios_generic_value -H $HOSTADDRESS$ -m webrequest_loss_average -w $ARG1$ -c $ARG2$ -o lt +} + -- To view, visit https://gerrit.wikimedia.org/r/66241 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: If91ce8badded15a2d15e8a0be42735ebe80f5968 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Ottomata o...@wikimedia.org Gerrit-Reviewer: Ottomata o...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Update jquery.ime from upstream - change (mediawiki...UniversalLanguageSelector)
Santhosh has uploaded a new change for review. https://gerrit.wikimedia.org/r/66242 Change subject: Update jquery.ime from upstream .. Update jquery.ime from upstream Change-Id: Iac3c14f82c982396c4bcecfb3c5cc97df82c41cb Version: 0.1.0+20130531 --- M lib/jquery.ime/jquery.ime.js M lib/jquery.ime/rules/be/be-kbd.js D lib/jquery.ime/rules/bn/bn-nasir.js D lib/jquery.ime/rules/en/capitalize.js R lib/jquery.ime/rules/gom/gom-inscript2.js M lib/jquery.ime/rules/hr/hr-kbd.js M lib/jquery.ime/rules/lo/lo-kbd.js M lib/jquery.ime/rules/mh/mh.js D lib/jquery.ime/rules/ru/ru-transliteration.js D lib/jquery.ime/rules/ua/ua-kbd.js A lib/jquery.ime/rules/udm/udm-alt.js M lib/jquery.ime/rules/uk/uk-kbd.js M lib/jquery.ime/rules/uz/uz-kbd.js 13 files changed, 75 insertions(+), 294 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UniversalLanguageSelector refs/changes/42/66242/1 diff --git a/lib/jquery.ime/jquery.ime.js b/lib/jquery.ime/jquery.ime.js index f969fcb..437f916 100644 --- a/lib/jquery.ime/jquery.ime.js +++ b/lib/jquery.ime/jquery.ime.js @@ -1,4 +1,4 @@ -/*! jquery.ime - v0.1.0+20130522 +/*! jquery.ime - v0.1.0+20130531 * https://github.com/wikimedia/jquery.ime * Copyright (c) 2013 Santhosh Thottingal; Licensed GPL, MIT */ ( function ( $ ) { @@ -772,9 +772,8 @@ if ( ime.getLanguage() === languageCode ) { // Nothing to do. It is same as the current language, // but check whether the input method changed. - if ( ime.inputmethod - ime.inputmethod.id === imePref || - imePref === 'system' + if ( ime.inputmethod ime.inputmethod.id === imePref + || imePref === 'system' ) { return false; } @@ -823,6 +822,10 @@ var imeselector = this, ime; + if ( !inputmethodId ) { + return; + } + this.$menu.find( '.checked' ).removeClass( 'checked' ); this.$menu.find( 'li.ime-disable' ).removeClass( 'checked' ); this.$menu.find( 'li[data-ime-inputmethod=' + inputmethodId + ']' ) @@ -832,10 +835,6 @@ if ( inputmethodId === 'system' ) { this.disableIM(); - return; - } - - if ( !inputmethodId ) { return; } @@ -1136,7 +1135,9 @@ if ( !this.registry.imes ) { this.registry.imes = {}; } - return this.registry.imes[language] || $.ime.languages[language].inputmethods[0]; + return this.registry.imes[language] || + ( $.ime.languages[language] + $.ime.languages[language].inputmethods[0] ); }, save: function () { @@ -1435,9 +1436,9 @@ name: 'KGP/Nudi/KP Rao', source: 'rules/kn/kn-kgp.js' }, - 'kok-inscript2': { + 'gom-inscript2': { name: 'इनस्क्रिप्ट २', - source: 'rules/kok/kok-inscript2.js' + source: 'rules/gom/gom-inscript2.js' }, 'ks-inscript': { name: 'इनस्क्रिप्ट', @@ -1639,6 +1640,10 @@ name: 'International Phonetic Alphabet - SIL', source: 'rules/fonipa/ipa-sil.js' }, + 'udm-alt': { + name: 'Удмурт ALT', + source: 'rules/udm/udm-alt.js' + }, 'uk-kbd': { name: 'кбд', source: 'rules/uk/uk-kbd.js' @@ -1740,7 +1745,7 @@ }, 'gom': { autonym: 'कोंकणी', - inputmethods: [ 'hi-transliteration', 'hi-inscript' ] + inputmethods: [ 'hi-transliteration', 'hi-inscript', 'gom-inscript2' ] }, 'gu': { autonym: 'ગુજરાતી', @@ -1801,10 +1806,6 @@ 'kab': { autonym: 'ⵜⴰⵇⴱⴰⵢⵍⵉⵜ', inputmethods: [ 'ber-tfng' ] - }, - 'kok': { - autonym: 'कोंकणी', - inputmethods: [ 'kok-inscript2
[MediaWiki-commits] [Gerrit] Moves wgValueFormatters global definition in MW specific ini... - change (mediawiki...DataValues)
Daniel Werner has uploaded a new change for review. https://gerrit.wikimedia.org/r/66243 Change subject: Moves wgValueFormatters global definition in MW specific initialization file .. Moves wgValueFormatters global definition in MW specific initialization file This global is MW specific and should therefore not be defined or used in the ValueFormatter's own files. Change-Id: I3dac34c53fc8de7ac7185cec398ae3257da96b1b --- M ValueFormatters/ValueFormatters.mw.php M ValueFormatters/ValueFormatters.php 2 files changed, 6 insertions(+), 7 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DataValues refs/changes/43/66243/1 diff --git a/ValueFormatters/ValueFormatters.mw.php b/ValueFormatters/ValueFormatters.mw.php index 5c0d678..bf49728 100644 --- a/ValueFormatters/ValueFormatters.mw.php +++ b/ValueFormatters/ValueFormatters.mw.php @@ -31,7 +31,8 @@ die( 'Not an entry point.' ); } -global $wgExtensionCredits, $wgExtensionMessagesFiles, $wgAutoloadClasses, $wgHooks; +global $wgExtensionCredits, $wgExtensionMessagesFiles, $wgAutoloadClasses, $wgHooks, + $wgValueFormatters; $wgExtensionCredits['datavalues'][] = array( 'path' = __DIR__, @@ -44,6 +45,10 @@ $wgExtensionMessagesFiles['ValueFormatters'] = __DIR__ . '/ValueFormatters.i18n.php'; +$wgValueFormatters = array( + 'geocoordinate' = 'ValueFormatters\GeoCoordinateFormatter' +); + foreach (include(__DIR__ . '/ValueFormatters.classes.php') as $class = $file ) { if ( !array_key_exists( $class, $GLOBALS['wgAutoloadLocalClasses'] ) ) { $wgAutoloadClasses[$class] = __DIR__ . '/' . $file; diff --git a/ValueFormatters/ValueFormatters.php b/ValueFormatters/ValueFormatters.php index 9393962..35c3193 100644 --- a/ValueFormatters/ValueFormatters.php +++ b/ValueFormatters/ValueFormatters.php @@ -47,12 +47,6 @@ define( 'ValueFormatters_VERSION', '0.1 alpha' ); -global $wgValueFormatters; - -$wgValueFormatters = array(); - -$wgValueFormatters['geocoordinate'] = 'ValueFormatters\GeoCoordinateFormatter'; - if ( defined( 'MEDIAWIKI' ) ) { include __DIR__ . '/ValueFormatters.mw.php'; } -- To view, visit https://gerrit.wikimedia.org/r/66243 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3dac34c53fc8de7ac7185cec398ae3257da96b1b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/DataValues Gerrit-Branch: master Gerrit-Owner: Daniel Werner daniel.wer...@wikimedia.de ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] [coordinate.js] Optimized precision handling - change (mediawiki...DataValues)
Henning Snater has uploaded a new change for review. https://gerrit.wikimedia.org/r/66244 Change subject: [coordinate.js] Optimized precision handling .. [coordinate.js] Optimized precision handling GlobeCoordinate object only deals with valid precisions registered in the globeCoordinate settings now. Change-Id: Ib6ed7a98718a2b4f6bb9d8e9dfedb176cc359be4 --- M DataValues/resources/globeCoordinate.js/src/globeCoordinate.GlobeCoordinate.js M DataValues/resources/globeCoordinate.js/src/globeCoordinate.js M DataValues/resources/globeCoordinate.js/tests/globeCoordinate.tests.js M ValueView/resources/jquery.valueview/valueview.experts/experts.GlobeCoordinateInput.js 4 files changed, 55 insertions(+), 49 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DataValues refs/changes/44/66244/1 diff --git a/DataValues/resources/globeCoordinate.js/src/globeCoordinate.GlobeCoordinate.js b/DataValues/resources/globeCoordinate.js/src/globeCoordinate.GlobeCoordinate.js index 1c0cd87..0a697c4 100644 --- a/DataValues/resources/globeCoordinate.js/src/globeCoordinate.GlobeCoordinate.js +++ b/DataValues/resources/globeCoordinate.js/src/globeCoordinate.GlobeCoordinate.js @@ -12,7 +12,7 @@ * @dependency globeCoordinate * @dependency globeCoordinate.parser */ -globeCoordinate.GlobeCoordinate = ( function( globeCcoordinate, globeCoordinateParser ) { +globeCoordinate.GlobeCoordinate = ( function( globeCoordinate, globeCoordinateParser ) { 'use strict'; /** @@ -59,7 +59,18 @@ // TODO: Capture altitude and globe } - this._globe = 'http://wikidata.org/id/Q2'; // TODO: Support other globes + // Keep precision boundaries: + var precisions = globeCoordinate.settings.precisions, + minPrecision = precisions[0].level, + maxPrecision = precisions[precisions.length - 1].level; + + if( this._precision minPrecision ) { + this._precision = minPrecision; + } else if( this._precision maxPrecision ) { + this._precision = maxPrecision; + } + + this._globe = 'http://wikidata.org/wiki/Q2'; // TODO: Support other globes }; GlobeCoordinate.prototype = { diff --git a/DataValues/resources/globeCoordinate.js/src/globeCoordinate.js b/DataValues/resources/globeCoordinate.js/src/globeCoordinate.js index 4e237c2..43e85e6 100644 --- a/DataValues/resources/globeCoordinate.js/src/globeCoordinate.js +++ b/DataValues/resources/globeCoordinate.js/src/globeCoordinate.js @@ -58,16 +58,17 @@ for( var i in this.settings.precisions ) { if( this.settings.precisions.hasOwnProperty( i ) -this.settings.precisions[i].level === precision +Math.abs( precision - this.settings.precisions[i].level ) 0.001 ) { - return i; + return parseInt( i, 10 ); } } return -1; }, /** -* Returns the given precision increased by one step. +* Returns the given precision increased by one step or -1 if the current precision is +* invalid. * * @param {number} precision * @return {number} @@ -75,34 +76,34 @@ increasePrecision: function( precision ) { var index = this.getPrecisionIndex( precision ); - if( index === this.settings.precisions.length - 1 || index === -1 ) { - var newPrecision = precision / 10; - return ( newPrecision 1e-9 ) ? 1e-9 : newPrecision; + // Current precision is invalid: + if( index === -1 ) { + return -1; } - return this.settings.precisions[index + 1].level; + return ( index + 1 this.settings.precisions.length ) + ? this.settings.precisions[index + 1].level + : precision; // Highest precision is set already. }, /** -* Returns the given precision decreased by one step. +* Returns the given precision decreased by one step or -1 if the current precision is +* invalid. * * @param {number} precision * @return {number} */
[MediaWiki-commits] [Gerrit] Handle If-Modified-Since in Special:EntityData - change (mediawiki...Wikibase)
Daniel Kinzler has uploaded a new change for review. https://gerrit.wikimedia.org/r/66245 Change subject: Handle If-Modified-Since in Special:EntityData .. Handle If-Modified-Since in Special:EntityData Change-Id: I23fcd3996b858383e41d0bb67980334eb35ae820 --- M repo/includes/specials/EntityDataRequestHandler.php M repo/tests/phpunit/includes/specials/EntityDataRequestHandlerTest.php M repo/tests/phpunit/includes/specials/SpecialEntityDataTest.php 3 files changed, 49 insertions(+), 29 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/45/66245/1 diff --git a/repo/includes/specials/EntityDataRequestHandler.php b/repo/includes/specials/EntityDataRequestHandler.php index 46f5990..4b86b59 100644 --- a/repo/includes/specials/EntityDataRequestHandler.php +++ b/repo/includes/specials/EntityDataRequestHandler.php @@ -412,8 +412,6 @@ */ public function showData( WebRequest $request, OutputPage $output, $format, EntityId $id, $revision ) { - //TODO: handle IfModifiedSince! - $prefixedId = $this-entityIdFormatter-format( $id ); $entity = $this-entityContentFactory-getFromId( $id ); @@ -452,6 +450,18 @@ $rev = $page-getRevision(); } + // handle If-Modified-Since + $imsHeader = $request-getHeader( 'IF-MODIFIED-SINCE' ); + if ( $imsHeader !== false ) { + $ims = wfTimestamp( TS_MW, $imsHeader ); + + if ( $rev-getTimestamp() = $ims ) { + $response = $output-getRequest()-response(); + $response-header( 'Status: 304', true, 304 ); + return; + } + } + list( $data, $contentType ) = $this-serializationService-getSerializedData( $format, $entity-getEntity(), $rev ); diff --git a/repo/tests/phpunit/includes/specials/EntityDataRequestHandlerTest.php b/repo/tests/phpunit/includes/specials/EntityDataRequestHandlerTest.php index 431b534..6bf64e1 100644 --- a/repo/tests/phpunit/includes/specials/EntityDataRequestHandlerTest.php +++ b/repo/tests/phpunit/includes/specials/EntityDataRequestHandlerTest.php @@ -6,6 +6,7 @@ use Title; use ValueFormatters\FormatterOptions; use ValueParsers\ParserOptions; +use Wikibase\Entity; use Wikibase\EntityContentFactory; use Wikibase\EntityDataSerializationService; use \Wikibase\Item; @@ -491,10 +492,34 @@ ) ); + // If-Modified-Since handling + + // #35: IMS from the deep bast should return a 200 + $cases[] = array( + '{testitemid}.xml', // subpage + array(), // parameters + array( // headers + 'If-Modified-Since' = wfTimestamp( TS_RFC2822, '210100' ) + ), + '!!', // output regex + 200, // http code + ); + + // #36: IMS from now should return a 304 + $cases[] = array( + '{testitemid}.json', // subpage + array(), // parameters + array( // headers + 'If-Modified-Since' = '{testitemtimestamp}' + ), + '!!', // output regex + 304, // http code + ); + return $cases; } - protected static function injectIds( $data, \Wikibase\Entity $entity ) { + public static function injectIds( $data, Entity $entity ) { if ( is_array( $data ) ) { foreach ( $data as $k = $v ) { self::injectIds( $v, $entity ); @@ -503,10 +528,11 @@ $data = str_replace( '{testitemid}', strtoupper( $entity-getId()-getPrefixedId() ), $data ); $data = str_replace( '{lowertestitemid}', strtolower( $entity-getId()-getPrefixedId() ), $data ); - if ( strpos( $data, '{testitemrev}' ) = 0 ) { - $content = \Wikibase\EntityContentFactory::singleton()-getFromId( $entity-getId() ); - $data = str_replace( '{testitemrev}', $content-getWikiPage()-getLatest(), $data ); - } + $content = EntityContentFactory::singleton()-getFromId( $entity-getId() ); + $data = str_replace( '{testitemrev}', $content-getWikiPage()-getLatest(), $data ); + + $ts = wfTimestamp( TS_RFC2822, $content-getWikiPage()-getTimestamp() ); + $data =
[MediaWiki-commits] [Gerrit] Several image improvements - change (mediawiki...erudite)
Njw has uploaded a new change for review. https://gerrit.wikimedia.org/r/66246 Change subject: Several image improvements .. Several image improvements - Respect border - Make thumb neater - Work properly in IE 8 - Center works Change-Id: I94ab36a181df2786e91653073d6a7ca097e1a363 --- M assets/erudite.css 1 file changed, 18 insertions(+), 13 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/erudite refs/changes/46/66246/1 diff --git a/assets/erudite.css b/assets/erudite.css index 479fd8e..784de06 100644 --- a/assets/erudite.css +++ b/assets/erudite.css @@ -264,7 +264,8 @@ .entry-content p, .entry-content li, .entry-content dt, -.entry-content dd { +.entry-content dd, +.entry-content center { font-size: 1.6em; margin-bottom: 0.75em; } @@ -308,6 +309,16 @@ .entry-content li ol, .entry-content li ul { margin: 0.5em 0 0 0.5em; +} + +.center { + width: 100%; + text-align: center; +} + +.center * { + margin-left: auto; + margin-right: auto; } /* Main Links */ @@ -382,10 +393,8 @@ /* Images */ .entry-content img { - border: 1px solid #aa; padding: 4px; margin-bottom: 6px; - max-width: 100%; } .entry-content .gallery a { @@ -420,17 +429,15 @@ div.thumb { margin-bottom: 0.5em; - border-style: solid; - border-color: #fafafa; width: auto; - background-color: transparent; } div.thumbinner { border: 1px solid #cc; padding: 3px !important; background-color: #f9f9f9; - font-size: 94%; + font-size: 1.4em; + line-height: 1.4em; text-align: center; overflow: hidden; } @@ -438,6 +445,7 @@ img.thumbimage { border: none; padding: 0px; + margin: 0px; } .thumbinnera { @@ -447,9 +455,7 @@ .thumbcaption { border: none; text-align: left; - line-height: 1.4em; padding: 3px !important; - font-size: 94%; } div.magnify { @@ -468,18 +474,17 @@ div.tright { clear: right; float: right; - border-width: 0.5em 0 0.8em 1.4em; + margin-left: 1.4em; } div.tleft { float: left; clear: left; - margin-right: 0.5em; - border-width: 0.5em 1.4em 0.8em 0; + margin-right: 1.4em; } img.thumbborder { - border: 1px solid #dd; + border: 1px solid #aa; } .hiddenStructure { -- To view, visit https://gerrit.wikimedia.org/r/66246 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I94ab36a181df2786e91653073d6a7ca097e1a363 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/skins/erudite Gerrit-Branch: master Gerrit-Owner: Njw nick.wh...@durham.ac.uk ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Ceph: move monitors to separate rows - change (operations/puppet)
Faidon has uploaded a new change for review. https://gerrit.wikimedia.org/r/66247 Change subject: Ceph: move monitors to separate rows .. Ceph: move monitors to separate rows Finally take the time to do that: move the three monitors into boxes in separate rows, for greater resiliency. Change-Id: I0da66a25bbf064a476b3c2e2a2f95819eb4b449d --- M manifests/role/ceph.pp 1 file changed, 5 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/47/66247/1 diff --git a/manifests/role/ceph.pp b/manifests/role/ceph.pp index e19a26b..bae280e 100644 --- a/manifests/role/ceph.pp +++ b/manifests/role/ceph.pp @@ -17,13 +17,13 @@ fsid= 'c9da36e1-694a-4166-b346-9d8d4d1d1ac1', mon_initial_members = [ 'ms-fe1001', - 'ms-fe1002', - 'ms-be1003', + 'ms-fe1003', + 'ms-be1005', ], mon_addresses = [ -'10.64.0.167:6789', # ms-fe1001 -'10.64.0.168:6789', # ms-fe1002 -'10.64.0.175:6789', # ms-be1003 +'10.64.0.167:6789', # ms-fe1001 +'10.64.16.150:6789', # ms-fe1003 +'10.64.32.10:6789', # ms-be1005 ], 'global'= { # eqiad hardware has H710s which have a BBU -- To view, visit https://gerrit.wikimedia.org/r/66247 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0da66a25bbf064a476b3c2e2a2f95819eb4b449d Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Faidon fai...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Revert Disable the gmond apache_status module on ceph hosts - change (operations/puppet)
Faidon has submitted this change and it was merged. Change subject: Revert Disable the gmond apache_status module on ceph hosts .. Revert Disable the gmond apache_status module on ceph hosts This reverts commit 6df245c031f5906ae8723755920e5087f2616219. Change-Id: I7919f8a20b49b3c25d5d4085ce3769649b40bbcb --- M manifests/ganglia.pp M manifests/role/ceph.pp 2 files changed, 10 insertions(+), 10 deletions(-) Approvals: Faidon: Verified; Looks good to me, approved diff --git a/manifests/ganglia.pp b/manifests/ganglia.pp index e840f8c..fdf553a 100644 --- a/manifests/ganglia.pp +++ b/manifests/ganglia.pp @@ -307,7 +307,7 @@ Bits caches eqiad = arsenic.wikimedia.org niobium.wikimedia.org, Upload caches eqiad = cp1021.eqiad.wmnet cp1022.eqiad.wmnet, SSL cluster eqiad = ssl1001.wikimedia.org ssl1002.wikimedia.org, - Ceph eqiad = ms-fe1001.eqiad.wmnet ms-fe1002.eqiad.wmnet, + Swift eqiad = ms-fe1001.eqiad.wmnet ms-fe1002.eqiad.wmnet, Text squids eqiad = cp1001.eqiad.wmnet cp1002.eqiad.wmnet, Search eqiad = search1001.eqiad.wmnet search1002.eqiad.wmnet, Decommissioned servers esams = knsq1.esams.wikimedia.org, diff --git a/manifests/role/ceph.pp b/manifests/role/ceph.pp index bae280e..74ca2a1 100644 --- a/manifests/role/ceph.pp +++ b/manifests/role/ceph.pp @@ -100,14 +100,14 @@ check_command = 'check_http_url!ms-fe.eqiad.wmnet!/monitoring/backend', } -#file { '/usr/lib/ganglia/python_modules/apache_status.py': -#source = 'puppet:///files/ganglia/plugins/apache_status.py', -#notify = Service['gmond'], -#} -# -#file { '/etc/ganglia/conf.d/apache_status.pyconf': -#source = 'puppet:///files/ganglia/plugins/apache_status.pyconf', -#notify = Service['gmond'], -#} +file { '/usr/lib/ganglia/python_modules/apache_status.py': +source = 'puppet:///files/ganglia/plugins/apache_status.py', +notify = Service['gmond'], +} + +file { '/etc/ganglia/conf.d/apache_status.pyconf': +source = 'puppet:///files/ganglia/plugins/apache_status.pyconf', +notify = Service['gmond'], +} } } -- To view, visit https://gerrit.wikimedia.org/r/66248 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7919f8a20b49b3c25d5d4085ce3769649b40bbcb Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Faidon fai...@wikimedia.org Gerrit-Reviewer: Faidon fai...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Ceph: move monitors to separate rows - change (operations/puppet)
Faidon has submitted this change and it was merged. Change subject: Ceph: move monitors to separate rows .. Ceph: move monitors to separate rows Finally take the time to do that: move the three monitors into boxes in separate rows, for greater resiliency. Change-Id: I0da66a25bbf064a476b3c2e2a2f95819eb4b449d --- M manifests/role/ceph.pp 1 file changed, 5 insertions(+), 5 deletions(-) Approvals: Faidon: Verified; Looks good to me, approved diff --git a/manifests/role/ceph.pp b/manifests/role/ceph.pp index e19a26b..bae280e 100644 --- a/manifests/role/ceph.pp +++ b/manifests/role/ceph.pp @@ -17,13 +17,13 @@ fsid= 'c9da36e1-694a-4166-b346-9d8d4d1d1ac1', mon_initial_members = [ 'ms-fe1001', - 'ms-fe1002', - 'ms-be1003', + 'ms-fe1003', + 'ms-be1005', ], mon_addresses = [ -'10.64.0.167:6789', # ms-fe1001 -'10.64.0.168:6789', # ms-fe1002 -'10.64.0.175:6789', # ms-be1003 +'10.64.0.167:6789', # ms-fe1001 +'10.64.16.150:6789', # ms-fe1003 +'10.64.32.10:6789', # ms-be1005 ], 'global'= { # eqiad hardware has H710s which have a BBU -- To view, visit https://gerrit.wikimedia.org/r/66247 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0da66a25bbf064a476b3c2e2a2f95819eb4b449d Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Faidon fai...@wikimedia.org Gerrit-Reviewer: Faidon fai...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Revert Disable the gmond apache_status module on ceph hosts - change (operations/puppet)
Faidon has uploaded a new change for review. https://gerrit.wikimedia.org/r/66248 Change subject: Revert Disable the gmond apache_status module on ceph hosts .. Revert Disable the gmond apache_status module on ceph hosts This reverts commit 6df245c031f5906ae8723755920e5087f2616219. Change-Id: I7919f8a20b49b3c25d5d4085ce3769649b40bbcb --- M manifests/ganglia.pp M manifests/role/ceph.pp 2 files changed, 10 insertions(+), 10 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/48/66248/1 diff --git a/manifests/ganglia.pp b/manifests/ganglia.pp index e840f8c..fdf553a 100644 --- a/manifests/ganglia.pp +++ b/manifests/ganglia.pp @@ -307,7 +307,7 @@ Bits caches eqiad = arsenic.wikimedia.org niobium.wikimedia.org, Upload caches eqiad = cp1021.eqiad.wmnet cp1022.eqiad.wmnet, SSL cluster eqiad = ssl1001.wikimedia.org ssl1002.wikimedia.org, - Ceph eqiad = ms-fe1001.eqiad.wmnet ms-fe1002.eqiad.wmnet, + Swift eqiad = ms-fe1001.eqiad.wmnet ms-fe1002.eqiad.wmnet, Text squids eqiad = cp1001.eqiad.wmnet cp1002.eqiad.wmnet, Search eqiad = search1001.eqiad.wmnet search1002.eqiad.wmnet, Decommissioned servers esams = knsq1.esams.wikimedia.org, diff --git a/manifests/role/ceph.pp b/manifests/role/ceph.pp index bae280e..74ca2a1 100644 --- a/manifests/role/ceph.pp +++ b/manifests/role/ceph.pp @@ -100,14 +100,14 @@ check_command = 'check_http_url!ms-fe.eqiad.wmnet!/monitoring/backend', } -#file { '/usr/lib/ganglia/python_modules/apache_status.py': -#source = 'puppet:///files/ganglia/plugins/apache_status.py', -#notify = Service['gmond'], -#} -# -#file { '/etc/ganglia/conf.d/apache_status.pyconf': -#source = 'puppet:///files/ganglia/plugins/apache_status.pyconf', -#notify = Service['gmond'], -#} +file { '/usr/lib/ganglia/python_modules/apache_status.py': +source = 'puppet:///files/ganglia/plugins/apache_status.py', +notify = Service['gmond'], +} + +file { '/etc/ganglia/conf.d/apache_status.pyconf': +source = 'puppet:///files/ganglia/plugins/apache_status.pyconf', +notify = Service['gmond'], +} } } -- To view, visit https://gerrit.wikimedia.org/r/66248 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7919f8a20b49b3c25d5d4085ce3769649b40bbcb Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Faidon fai...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix p in warning being massive - change (mediawiki...erudite)
Njw has uploaded a new change for review. https://gerrit.wikimedia.org/r/66249 Change subject: Fix p in warning being massive .. Fix p in warning being massive Change-Id: I19d111fc5dba1bf8925d7d95178a508205d6a4ae --- M assets/erudite.css 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/erudite refs/changes/49/66249/1 diff --git a/assets/erudite.css b/assets/erudite.css index 479fd8e..19ec6fc 100644 --- a/assets/erudite.css +++ b/assets/erudite.css @@ -310,6 +310,11 @@ margin: 0.5em 0 0 0.5em; } +/* stop larger from .warning multiplying with 1.6em from p */ +.warning p { + font-size: 100%; +} + /* Main Links */ .entry-content a { border-bottom: 1px solid #aa; -- To view, visit https://gerrit.wikimedia.org/r/66249 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I19d111fc5dba1bf8925d7d95178a508205d6a4ae Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/skins/erudite Gerrit-Branch: master Gerrit-Owner: Njw nick.wh...@durham.ac.uk ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Several image improvements - change (mediawiki...erudite)
Njw has submitted this change and it was merged. Change subject: Several image improvements .. Several image improvements - Respect border - Make thumb neater - Work properly in IE 8 - Center works Change-Id: I94ab36a181df2786e91653073d6a7ca097e1a363 --- M assets/erudite.css 1 file changed, 18 insertions(+), 13 deletions(-) Approvals: Njw: Verified; Looks good to me, approved diff --git a/assets/erudite.css b/assets/erudite.css index 479fd8e..784de06 100644 --- a/assets/erudite.css +++ b/assets/erudite.css @@ -264,7 +264,8 @@ .entry-content p, .entry-content li, .entry-content dt, -.entry-content dd { +.entry-content dd, +.entry-content center { font-size: 1.6em; margin-bottom: 0.75em; } @@ -308,6 +309,16 @@ .entry-content li ol, .entry-content li ul { margin: 0.5em 0 0 0.5em; +} + +.center { + width: 100%; + text-align: center; +} + +.center * { + margin-left: auto; + margin-right: auto; } /* Main Links */ @@ -382,10 +393,8 @@ /* Images */ .entry-content img { - border: 1px solid #aa; padding: 4px; margin-bottom: 6px; - max-width: 100%; } .entry-content .gallery a { @@ -420,17 +429,15 @@ div.thumb { margin-bottom: 0.5em; - border-style: solid; - border-color: #fafafa; width: auto; - background-color: transparent; } div.thumbinner { border: 1px solid #cc; padding: 3px !important; background-color: #f9f9f9; - font-size: 94%; + font-size: 1.4em; + line-height: 1.4em; text-align: center; overflow: hidden; } @@ -438,6 +445,7 @@ img.thumbimage { border: none; padding: 0px; + margin: 0px; } .thumbinnera { @@ -447,9 +455,7 @@ .thumbcaption { border: none; text-align: left; - line-height: 1.4em; padding: 3px !important; - font-size: 94%; } div.magnify { @@ -468,18 +474,17 @@ div.tright { clear: right; float: right; - border-width: 0.5em 0 0.8em 1.4em; + margin-left: 1.4em; } div.tleft { float: left; clear: left; - margin-right: 0.5em; - border-width: 0.5em 1.4em 0.8em 0; + margin-right: 1.4em; } img.thumbborder { - border: 1px solid #dd; + border: 1px solid #aa; } .hiddenStructure { -- To view, visit https://gerrit.wikimedia.org/r/66246 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I94ab36a181df2786e91653073d6a7ca097e1a363 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/skins/erudite Gerrit-Branch: master Gerrit-Owner: Njw nick.wh...@durham.ac.uk Gerrit-Reviewer: Njw nick.wh...@durham.ac.uk ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix p in warning being massive - change (mediawiki...erudite)
Njw has submitted this change and it was merged. Change subject: Fix p in warning being massive .. Fix p in warning being massive Change-Id: I19d111fc5dba1bf8925d7d95178a508205d6a4ae --- M assets/erudite.css 1 file changed, 5 insertions(+), 0 deletions(-) Approvals: Njw: Verified; Looks good to me, approved diff --git a/assets/erudite.css b/assets/erudite.css index 479fd8e..19ec6fc 100644 --- a/assets/erudite.css +++ b/assets/erudite.css @@ -310,6 +310,11 @@ margin: 0.5em 0 0 0.5em; } +/* stop larger from .warning multiplying with 1.6em from p */ +.warning p { + font-size: 100%; +} + /* Main Links */ .entry-content a { border-bottom: 1px solid #aa; -- To view, visit https://gerrit.wikimedia.org/r/66249 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I19d111fc5dba1bf8925d7d95178a508205d6a4ae Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/skins/erudite Gerrit-Branch: master Gerrit-Owner: Njw nick.wh...@durham.ac.uk Gerrit-Reviewer: Njw nick.wh...@durham.ac.uk ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Ceph: use role::ceph::mon on the new mons - change (operations/puppet)
Faidon has uploaded a new change for review. https://gerrit.wikimedia.org/r/66250 Change subject: Ceph: use role::ceph::mon on the new mons .. Ceph: use role::ceph::mon on the new mons Change-Id: Idaf1d2b8edc2b40d33e96d7921980836a7e84773 --- M manifests/site.pp 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/50/66250/1 diff --git a/manifests/site.pp b/manifests/site.pp index 711a990..ede3ec6 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -1858,7 +1858,7 @@ include role::ceph::eqiad::radosgw - if $::hostname =~ /^ms-fe100[12]$/ { + if $::hostname =~ /^ms-fe100[13]$/ { include role::ceph::eqiad::mon } } @@ -1866,7 +1866,7 @@ node /^ms-be10[01][0-9]\.eqiad\.wmnet$/ { include role::ceph::eqiad::osd - if $::hostname == 'ms-be1003' { + if $::hostname == 'ms-be1005' { include role::ceph::eqiad::mon } } -- To view, visit https://gerrit.wikimedia.org/r/66250 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idaf1d2b8edc2b40d33e96d7921980836a7e84773 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Faidon fai...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Make headers in FauxRequest case insensitive - change (mediawiki/core)
Daniel Kinzler has uploaded a new change for review. https://gerrit.wikimedia.org/r/66251 Change subject: Make headers in FauxRequest case insensitive .. Make headers in FauxRequest case insensitive HTTP headers are case insensitive per spec, and WebRequest threats them like that, so FauxRequest should too. Change-Id: I4257af7a8de2792ac556c670dcc7f28e4af4cb44 --- M includes/WebRequest.php M includes/WebResponse.php 2 files changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/51/66251/1 diff --git a/includes/WebRequest.php b/includes/WebRequest.php index 20ee5e5..3981eed 100644 --- a/includes/WebRequest.php +++ b/includes/WebRequest.php @@ -1342,6 +1342,7 @@ * @return bool|string */ public function getHeader( $name ) { + $name = strtoupper( $name ); return isset( $this-headers[$name] ) ? $this-headers[$name] : false; } @@ -1350,6 +1351,7 @@ * @param $val string */ public function setHeader( $name, $val ) { + $name = strtoupper( $name ); $this-headers[$name] = $val; } diff --git a/includes/WebResponse.php b/includes/WebResponse.php index d1f645c..3e229d0 100644 --- a/includes/WebResponse.php +++ b/includes/WebResponse.php @@ -116,6 +116,8 @@ } else { list( $key, $val ) = array_map( 'trim', explode( :, $string, 2 ) ); + $key = strtoupper( $key ); + if ( $replace || !isset( $this-headers[$key] ) ) { $this-headers[$key] = $val; } @@ -131,6 +133,8 @@ * @return string */ public function getheader( $key ) { + $key = strtoupper( $key ); + if ( isset( $this-headers[$key] ) ) { return $this-headers[$key]; } -- To view, visit https://gerrit.wikimedia.org/r/66251 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4257af7a8de2792ac556c670dcc7f28e4af4cb44 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Daniel Kinzler daniel.kinz...@wikimedia.de ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Ceph: use role::ceph::mon on the new mons - change (operations/puppet)
Faidon has submitted this change and it was merged. Change subject: Ceph: use role::ceph::mon on the new mons .. Ceph: use role::ceph::mon on the new mons Change-Id: Idaf1d2b8edc2b40d33e96d7921980836a7e84773 --- M manifests/site.pp 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Faidon: Verified; Looks good to me, approved diff --git a/manifests/site.pp b/manifests/site.pp index 711a990..ede3ec6 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -1858,7 +1858,7 @@ include role::ceph::eqiad::radosgw - if $::hostname =~ /^ms-fe100[12]$/ { + if $::hostname =~ /^ms-fe100[13]$/ { include role::ceph::eqiad::mon } } @@ -1866,7 +1866,7 @@ node /^ms-be10[01][0-9]\.eqiad\.wmnet$/ { include role::ceph::eqiad::osd - if $::hostname == 'ms-be1003' { + if $::hostname == 'ms-be1005' { include role::ceph::eqiad::mon } } -- To view, visit https://gerrit.wikimedia.org/r/66250 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Idaf1d2b8edc2b40d33e96d7921980836a7e84773 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Faidon fai...@wikimedia.org Gerrit-Reviewer: Faidon fai...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Type hints. Fixup missing return values - change (mediawiki...SecurePoll)
Reedy has submitted this change and it was merged. Change subject: Type hints. Fixup missing return values .. Type hints. Fixup missing return values Fixes bug: 42462 Change-Id: I879feacba211ac3cfd1eb55629300b78ef2e4c0c --- M cli/convertVotes.php M cli/import.php R cli/voterList.php M includes/ballots/ApprovalBallot.php M includes/ballots/Ballot.php M includes/ballots/ChooseBallot.php M includes/ballots/PreferentialBallot.php M includes/ballots/RadioRangeBallot.php M includes/crypt/Crypt.php M includes/entities/Election.php M includes/entities/Entity.php M includes/entities/Option.php M includes/entities/Question.php M includes/main/Base.php M includes/main/Context.php M includes/talliers/SchulzeTallier.php M includes/talliers/Tallier.php M includes/user/Auth.php 18 files changed, 202 insertions(+), 38 deletions(-) Approvals: Reedy: Verified; Looks good to me, approved jenkins-bot: Checked diff --git a/cli/convertVotes.php b/cli/convertVotes.php index 4adf726..3e77daf 100644 --- a/cli/convertVotes.php +++ b/cli/convertVotes.php @@ -33,7 +33,7 @@ class SecurePoll_ConvertVotes { - var $context; + var $context, $election; function convertFile( $fileName ) { $this-context = SecurePoll_Context::newFromXmlFile( $fileName ); diff --git a/cli/import.php b/cli/import.php index 9314389..50e233e 100644 --- a/cli/import.php +++ b/cli/import.php @@ -38,6 +38,7 @@ exit( 1 ); } +$options = array(); foreach ( array( 'update-msgs', 'replace' ) as $optName ) { if ( !isset( $options[$optName] ) ) { $options[$optName] = false; @@ -47,6 +48,11 @@ $success = spImportDump( $args[0], $options ); exit( $success ? 0 : 1 ); +/** + * @param $fileName string + * @param $options + * @return bool + */ function spImportDump( $fileName, $options ) { $store = new SecurePoll_XMLStore( $fileName ); $success = $store-readFile(); @@ -96,13 +102,18 @@ } if ( !$success ) { $dbw-rollback(); + echo Faied!\n; return false; } } $dbw-commit(); + echo Finished!\n; return true; } +/** + * @param $electionId int|string + */ function spDeleteElection( $electionId ) { $dbw = wfGetDB( DB_MASTER ); @@ -136,6 +147,10 @@ $dbw-delete( 'securepoll_entity', array( 'en_id' = $entityIds ), __METHOD__ ); } +/** + * @param $type string + * @param $id string + */ function spInsertEntity( $type, $id ) { $dbw = wfGetDB( DB_MASTER ); $dbw-insert( 'securepoll_entity', @@ -147,6 +162,11 @@ ); } +/** + * @param $store SecurePoll_Store + * @param $electionInfo + * @return bool + */ function spImportConfiguration( $store, $electionInfo ) { $dbw = wfGetDB( DB_MASTER ); $sourceIds = array(); @@ -166,7 +186,6 @@ ), __METHOD__ ); $sourceIds[] = $electionInfo['id']; - # Questions $index = 1; @@ -216,6 +235,10 @@ return true; } +/** + * @param $store SecurePoll_Store + * @param $entityIds + */ function spInsertMessages( $store, $entityIds ) { $langs = $store-getLangList( $entityIds ); $insertBatch = array(); @@ -238,6 +261,11 @@ } } +/** + * @param $store SecurePoll_Store + * @param $electionInfo + * @return bool + */ function spUpdateMessages( $store, $electionInfo ) { $entityIds = array( $electionInfo['id'] ); foreach ( $electionInfo['questions'] as $questionInfo ) { @@ -253,5 +281,6 @@ # Insert new messages spInsertMessages( $store, $entityIds ); + return true; } diff --git a/voterList.php b/cli/voterList.php similarity index 100% rename from voterList.php rename to cli/voterList.php diff --git a/includes/ballots/ApprovalBallot.php b/includes/ballots/ApprovalBallot.php index 5fe2009..45225b4 100644 --- a/includes/ballots/ApprovalBallot.php +++ b/includes/ballots/ApprovalBallot.php @@ -7,7 +7,12 @@ function getTallyTypes() { return array( 'plurality' ); } - + + /** +* @param $question SecurePoll_Question +* @param $options array +* @return string +*/ function getQuestionForm( $question, $options ) { global $wgRequest; $name = 'securepoll_q' . $question-getId(); @@ -28,6 +33,11 @@ return $s; } + /** +* @param $question SecurePoll_Question +* @param $status Status +* @return string +*/ function submitQuestion( $question, $status ) { global $wgRequest; diff --git a/includes/ballots/Ballot.php b/includes/ballots/Ballot.php index f349a40..15cdf78 100644 --- a/includes/ballots/Ballot.php +++ b/includes/ballots/Ballot.php @@ -17,11 +17,10 @@
[MediaWiki-commits] [Gerrit] Subfolder specific scripts - change (mediawiki...SecurePoll)
Reedy has uploaded a new change for review. https://gerrit.wikimedia.org/r/66252 Change subject: Subfolder specific scripts .. Subfolder specific scripts Change-Id: Ief3f5b21cc22f656f50baf0d4822478799b178a6 --- R cli/wm-scripts/arbcom/makeArbcomList.php R cli/wm-scripts/bv2009/bv2009_tables.sql R cli/wm-scripts/bv2009/dumpMetaTranslations.php R cli/wm-scripts/bv2009/populateBv2009EditCount.php R cli/wm-scripts/bv2009/voterList-bv2009.php M cli/wm-scripts/dumpGlobalVoterList.php 6 files changed, 6 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SecurePoll refs/changes/52/66252/1 diff --git a/cli/wm-scripts/makeArbcomList.php b/cli/wm-scripts/arbcom/makeArbcomList.php similarity index 100% rename from cli/wm-scripts/makeArbcomList.php rename to cli/wm-scripts/arbcom/makeArbcomList.php diff --git a/cli/wm-scripts/bv2009_tables.sql b/cli/wm-scripts/bv2009/bv2009_tables.sql similarity index 100% rename from cli/wm-scripts/bv2009_tables.sql rename to cli/wm-scripts/bv2009/bv2009_tables.sql diff --git a/cli/wm-scripts/dumpMetaTranslations.php b/cli/wm-scripts/bv2009/dumpMetaTranslations.php similarity index 98% rename from cli/wm-scripts/dumpMetaTranslations.php rename to cli/wm-scripts/bv2009/dumpMetaTranslations.php index 9dc68f9..f6ad0f2 100644 --- a/cli/wm-scripts/dumpMetaTranslations.php +++ b/cli/wm-scripts/bv2009/dumpMetaTranslations.php @@ -154,7 +154,7 @@ $numMessages++; continue; } - + if ( $sectionName == 'candidate text' ) { $i = 1; $lines = explode( \n, $remainder ); @@ -187,11 +187,11 @@ foreach ( $langMsgs as $entity = $entityMsgs ) { if ( $entity === $targetEntity ) { foreach ( $entityMsgs as $key = $value ) { - $s .= Xml::element( - 'message', + $s .= Xml::element( + 'message', array( 'name' = $key, 'lang' = $lang ), - $value - ) . + $value + ) . \n; } } diff --git a/cli/wm-scripts/populateBv2009EditCount.php b/cli/wm-scripts/bv2009/populateBv2009EditCount.php similarity index 100% rename from cli/wm-scripts/populateBv2009EditCount.php rename to cli/wm-scripts/bv2009/populateBv2009EditCount.php diff --git a/cli/wm-scripts/voterList-bv2009.php b/cli/wm-scripts/bv2009/voterList-bv2009.php similarity index 100% rename from cli/wm-scripts/voterList-bv2009.php rename to cli/wm-scripts/bv2009/voterList-bv2009.php diff --git a/cli/wm-scripts/dumpGlobalVoterList.php b/cli/wm-scripts/dumpGlobalVoterList.php index f6a1578..0ef6433 100644 --- a/cli/wm-scripts/dumpGlobalVoterList.php +++ b/cli/wm-scripts/dumpGlobalVoterList.php @@ -21,7 +21,7 @@ $res = $db-select( array( 'securepoll_lists', 'user' ), array( 'user_id', 'user_name', 'user_email', 'user_email_authenticated' ), - array( + array( 'user_id=li_member', 'li_member ' . $db-addQuotes( $userId ) ), -- To view, visit https://gerrit.wikimedia.org/r/66252 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ief3f5b21cc22f656f50baf0d4822478799b178a6 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/SecurePoll Gerrit-Branch: master Gerrit-Owner: Reedy re...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Subfolder specific scripts - change (mediawiki...SecurePoll)
Reedy has submitted this change and it was merged. Change subject: Subfolder specific scripts .. Subfolder specific scripts Change-Id: Ief3f5b21cc22f656f50baf0d4822478799b178a6 --- R cli/wm-scripts/arbcom/makeArbcomList.php R cli/wm-scripts/bv2009/bv2009_tables.sql R cli/wm-scripts/bv2009/dumpMetaTranslations.php R cli/wm-scripts/bv2009/populateBv2009EditCount.php R cli/wm-scripts/bv2009/voterList-bv2009.php M cli/wm-scripts/dumpGlobalVoterList.php 6 files changed, 6 insertions(+), 6 deletions(-) Approvals: Reedy: Verified; Looks good to me, approved diff --git a/cli/wm-scripts/makeArbcomList.php b/cli/wm-scripts/arbcom/makeArbcomList.php similarity index 100% rename from cli/wm-scripts/makeArbcomList.php rename to cli/wm-scripts/arbcom/makeArbcomList.php diff --git a/cli/wm-scripts/bv2009_tables.sql b/cli/wm-scripts/bv2009/bv2009_tables.sql similarity index 100% rename from cli/wm-scripts/bv2009_tables.sql rename to cli/wm-scripts/bv2009/bv2009_tables.sql diff --git a/cli/wm-scripts/dumpMetaTranslations.php b/cli/wm-scripts/bv2009/dumpMetaTranslations.php similarity index 98% rename from cli/wm-scripts/dumpMetaTranslations.php rename to cli/wm-scripts/bv2009/dumpMetaTranslations.php index 9dc68f9..f6ad0f2 100644 --- a/cli/wm-scripts/dumpMetaTranslations.php +++ b/cli/wm-scripts/bv2009/dumpMetaTranslations.php @@ -154,7 +154,7 @@ $numMessages++; continue; } - + if ( $sectionName == 'candidate text' ) { $i = 1; $lines = explode( \n, $remainder ); @@ -187,11 +187,11 @@ foreach ( $langMsgs as $entity = $entityMsgs ) { if ( $entity === $targetEntity ) { foreach ( $entityMsgs as $key = $value ) { - $s .= Xml::element( - 'message', + $s .= Xml::element( + 'message', array( 'name' = $key, 'lang' = $lang ), - $value - ) . + $value + ) . \n; } } diff --git a/cli/wm-scripts/populateBv2009EditCount.php b/cli/wm-scripts/bv2009/populateBv2009EditCount.php similarity index 100% rename from cli/wm-scripts/populateBv2009EditCount.php rename to cli/wm-scripts/bv2009/populateBv2009EditCount.php diff --git a/cli/wm-scripts/voterList-bv2009.php b/cli/wm-scripts/bv2009/voterList-bv2009.php similarity index 100% rename from cli/wm-scripts/voterList-bv2009.php rename to cli/wm-scripts/bv2009/voterList-bv2009.php diff --git a/cli/wm-scripts/dumpGlobalVoterList.php b/cli/wm-scripts/dumpGlobalVoterList.php index f6a1578..0ef6433 100644 --- a/cli/wm-scripts/dumpGlobalVoterList.php +++ b/cli/wm-scripts/dumpGlobalVoterList.php @@ -21,7 +21,7 @@ $res = $db-select( array( 'securepoll_lists', 'user' ), array( 'user_id', 'user_name', 'user_email', 'user_email_authenticated' ), - array( + array( 'user_id=li_member', 'li_member ' . $db-addQuotes( $userId ) ), -- To view, visit https://gerrit.wikimedia.org/r/66252 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ief3f5b21cc22f656f50baf0d4822478799b178a6 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/SecurePoll Gerrit-Branch: master Gerrit-Owner: Reedy re...@wikimedia.org Gerrit-Reviewer: Reedy re...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] [coordinate.js] Removed GlobeCoordinate's isValid function - change (mediawiki...DataValues)
Henning Snater has uploaded a new change for review. https://gerrit.wikimedia.org/r/66253 Change subject: [coordinate.js] Removed GlobeCoordinate's isValid function .. [coordinate.js] Removed GlobeCoordinate's isValid function Since the GlobeCoordinate should always be valid, the constructor will throw an error when trying to instantiate a GlobeCoordinate object with invalid values. Change-Id: I5e57abeb937ed376c123dadf9586eafdb8ac5ebd --- M DataValues/resources/globeCoordinate.js/src/globeCoordinate.GlobeCoordinate.js M DataValues/resources/globeCoordinate.js/tests/globeCoordinate.GlobeCoordinate.tests.js M DataValues/resources/values/GlobeCoordinateValue.js M ValueParsers/resources/parsers/GlobeCoordinateParser.js M ValueView/resources/jquery.globecoordinate/jquery.globecoordinate.globecoordinateinput.js M ValueView/resources/jquery.valueview/valueview.experts/experts.GlobeCoordinateInput.js 6 files changed, 29 insertions(+), 55 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DataValues refs/changes/53/66253/1 diff --git a/DataValues/resources/globeCoordinate.js/src/globeCoordinate.GlobeCoordinate.js b/DataValues/resources/globeCoordinate.js/src/globeCoordinate.GlobeCoordinate.js index 0a697c4..d6802f3 100644 --- a/DataValues/resources/globeCoordinate.js/src/globeCoordinate.GlobeCoordinate.js +++ b/DataValues/resources/globeCoordinate.js/src/globeCoordinate.GlobeCoordinate.js @@ -59,6 +59,15 @@ // TODO: Capture altitude and globe } + // TODO: The following checks are earth specific. When implementing additional globes, + // either loosen the restrictions or implement globe specific restrictions. + if( Math.abs( this._latitude ) 90 ) { + throw new Error( 'Latitude (' + this._latitude + ') is out of bounds' ); + } + if( Math.abs( this._longitude ) 180 ) { + throw new Error( 'Longitude (' + this._longitude + ') is out of bounds' ); + } + // Keep precision boundaries: var precisions = globeCoordinate.settings.precisions, minPrecision = precisions[0].level, @@ -103,18 +112,6 @@ * @type {number} */ _precision: null, - - /** -* Returns whether the object is representing a valid globe coordinate. -* -* TODO: throw an error in constructor if invalid GlobeCoordinate, don't support invalid -* data objects and deprecate this function then. -* -* @return {boolean} -*/ - isValid: function() { - return ( Math.abs( this._latitude ) = 90 Math.abs( this._longitude ) = 180 ); - }, /** * Returns the coordinate's globe URI. @@ -278,8 +275,7 @@ return false; } - return this.isValid() otherGlobeCoordinate.isValid() // two invalid times are not equal -this.getPrecision() === otherGlobeCoordinate.getPrecision() + return this.getPrecision() === otherGlobeCoordinate.getPrecision() this.iso6709() === otherGlobeCoordinate.iso6709(); } diff --git a/DataValues/resources/globeCoordinate.js/tests/globeCoordinate.GlobeCoordinate.tests.js b/DataValues/resources/globeCoordinate.js/tests/globeCoordinate.GlobeCoordinate.tests.js index f8fe2ee..d71d0ff 100644 --- a/DataValues/resources/globeCoordinate.js/tests/globeCoordinate.GlobeCoordinate.tests.js +++ b/DataValues/resources/globeCoordinate.js/tests/globeCoordinate.GlobeCoordinate.tests.js @@ -22,7 +22,7 @@ '5\'S': '-05+000/', '1\' 1': '+010001+000/', '1\' 1.1': '+010001.1+000/', - '190° 30 1.123\'': '+19030+0010723/', + '89° 59 59\' 1.123\'': '+8959+0590001.123/', '5\'N 0\' 10.5W': '+05-0015949.5/' }; @@ -38,7 +38,12 @@ assert.throws( function() { c = new globeCoordinate.GlobeCoordinate( 'some string' ); }, - 'Trying to instantiate with an invalid value throws an error.' + 'Trying to instantiate with an invalid value (some string) throws an error.' + ); + + assert.throws( + function() { c = new globeCoordinate.GlobeCoordinate( '190° 30 1.123\'' ); }, + 'Trying to instantiate with an invalid value (190° 30 1.123\') throws an error.' ); c = new globeCoordinate.GlobeCoordinate( '1.5 1.5' ); @@ -119,23
[MediaWiki-commits] [Gerrit] ResourceLoader-ify SecurePoll - change (mediawiki...SecurePoll)
Reedy has submitted this change and it was merged. Change subject: ResourceLoader-ify SecurePoll .. ResourceLoader-ify SecurePoll Bug: 48976 Change-Id: I1631f6124d6b5da56418766442f7a4797bdaf91e --- M SecurePoll.php M includes/main/Base.php R resources/ext.securePoll.css R resources/ext.securePoll.js 4 files changed, 11 insertions(+), 8 deletions(-) Approvals: Reedy: Verified; Looks good to me, approved diff --git a/SecurePoll.php b/SecurePoll.php index 2e2e486..70d4d9a 100644 --- a/SecurePoll.php +++ b/SecurePoll.php @@ -144,3 +144,11 @@ } return true; } + +$wgResourceModules['ext.securePoll'] = array( + 'localBasePath' = __DIR__ . '/resources', + 'remoteExtPath' = 'SecurePoll/resources', + 'scripts' = 'ext.securePoll.js', + 'styles' = 'ext.securePoll.css', + 'position' = 'top', +); diff --git a/includes/main/Base.php b/includes/main/Base.php index 56c99a6..a5c0d86 100644 --- a/includes/main/Base.php +++ b/includes/main/Base.php @@ -1,7 +1,7 @@ ?php /** - * The page that's initially called by MediaWiki when navigating to + * The page that's initially called by MediaWiki when navigating to * Special:SecurePoll. The actual pages are not actually subclasses of * this or of SpecialPage, they're subclassed from SecurePoll_Page. */ @@ -34,15 +34,10 @@ * @param $paramString Mixed: parameter passed to the page or null */ public function execute( $paramString ) { - global $wgOut, $wgRequest, $wgScriptPath; + global $wgOut, $wgRequest; $this-setHeaders(); - $wgOut-addLink( array( - 'rel' = 'stylesheet', - 'href' = $wgScriptPath/extensions/SecurePoll/resources/SecurePoll.css, - 'type' = 'text/css' - ) ); - $wgOut-addScriptFile( $wgScriptPath/extensions/SecurePoll/resources/SecurePoll.js ); + $wgOut-addModules( 'ext.securePoll' ); $this-request = $wgRequest; diff --git a/resources/SecurePoll.css b/resources/ext.securePoll.css similarity index 100% rename from resources/SecurePoll.css rename to resources/ext.securePoll.css diff --git a/resources/SecurePoll.js b/resources/ext.securePoll.js similarity index 100% rename from resources/SecurePoll.js rename to resources/ext.securePoll.js -- To view, visit https://gerrit.wikimedia.org/r/66121 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1631f6124d6b5da56418766442f7a4797bdaf91e Gerrit-PatchSet: 4 Gerrit-Project: mediawiki/extensions/SecurePoll Gerrit-Branch: master Gerrit-Owner: Reedy re...@wikimedia.org Gerrit-Reviewer: Catrope roan.katt...@gmail.com Gerrit-Reviewer: Krinkle krinklem...@gmail.com Gerrit-Reviewer: Ori.livneh o...@wikimedia.org Gerrit-Reviewer: Reedy re...@wikimedia.org 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 initial copy of 2009 bv files to 2013 - change (mediawiki...SecurePoll)
Reedy has uploaded a new change for review. https://gerrit.wikimedia.org/r/66254 Change subject: Add initial copy of 2009 bv files to 2013 .. Add initial copy of 2009 bv files to 2013 Change-Id: Idf45ddbc4b06a34463418b6938ebf8d15f2c2f04 --- A cli/wm-scripts/bv2013/bv2013_tables.sql A cli/wm-scripts/bv2013/dumpMetaTranslations.php A cli/wm-scripts/bv2013/populateEditCount.php A cli/wm-scripts/bv2013/voterList.php 4 files changed, 398 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SecurePoll refs/changes/54/66254/1 diff --git a/cli/wm-scripts/bv2013/bv2013_tables.sql b/cli/wm-scripts/bv2013/bv2013_tables.sql new file mode 100644 index 000..c563e5c --- /dev/null +++ b/cli/wm-scripts/bv2013/bv2013_tables.sql @@ -0,0 +1,5 @@ +CREATE TABLE bv2013_edits ( + bv_user int not null primary key, + bv_long_edits int not null, + bv_short_edits int not null +); diff --git a/cli/wm-scripts/bv2013/dumpMetaTranslations.php b/cli/wm-scripts/bv2013/dumpMetaTranslations.php new file mode 100644 index 000..f6ad0f2 --- /dev/null +++ b/cli/wm-scripts/bv2013/dumpMetaTranslations.php @@ -0,0 +1,202 @@ +?php + +require( dirname( __FILE__ ) . '/../cli.inc' ); + +$spConf = array( + 'numCandidates' = 18, + 'baseId' = 17, + 'basePage' = 'Board elections/2009/Vote interface', + 'langs' = array( + 'ar', + 'bn', + 'ca', + 'cs', + 'da', + 'de', + 'el', + 'en', + 'eo', + 'es', + 'fi', + 'fr', + 'gl', + 'hi', + 'hr', + 'hu', + 'ia', + 'id', + 'it', + 'ja', + 'jv', + 'ko', + 'ksh', + 'ms', + 'nb', + 'nl', + 'oc', + 'pl', + 'pt', + 'pt-br', + 'ru', + 'sk', + 'sv', + 'tr', + 'uk', + 'vi', + 'zh-hans', + 'zh-hant', + ) +); + +$header = EOT +SecurePoll +election +configuration +titleWikimedia Board of Trustees Election, 2009/title +ballotpreferential/ballot +tallyschulze/tally +primaryLangen/primaryLang +startDate2009-07-28T12:00:00Z/startDate +endDate2009-08-10T23:59:59Z/endDate +authremote-mw/auth +id{$spConf['baseId']}/id +property name=adminsTim Starling|Philippe|Werdna|Daniel|Yann|Mardetanha/property +property name=not-blocked1/property +property name=not-bot1/property +property name=need-listboard-vote-2009/property +property name=encrypt-typegpg/property +property name=remote-mw-script-pathhttps://secure.wikimedia.org/\$site/\$lang/w/property +property name=shuffle-options1/property +property name=gpg-encrypt-key!-- insert key here --/property +property name=gpg-sign-key!-- insert key here --/property + + +EOT; + +$allMessages = array(); +foreach ( $spConf['langs'] as $lang ) { + $messages = spGetMetaTranslations( $lang ); + if ( $messages ) { + $allMessages[$lang] = $messages; + } else { + fwrite( STDERR, Messages not found for $lang\n ); + } +} + +$s = $header . + spFormatEntityMessages( $allMessages, 'election' ) . + question\n . + id . ($spConf['baseId'] + 1) . /id\n . + message name=\text\ lang=\en\/message\n; + +for ( $i = 1; $i = $spConf['numCandidates']; $i++ ) { + $s .= + option\n . + id . ( $i + $spConf['baseId'] + 1 ) . /id\n . + spFormatEntityMessages( $allMessages, option_$i ) . + /option\n; +} +$s .= /question +/configuration +/election +/SecurePoll +; + +echo $s; +exit( 0 ); +//-- + +function spGetMetaTranslations( $lang ) { + global $spConf, $wgParser; + $messages = array(); + $titleText = {$spConf['basePage']}/$lang; + $title = Title::newFromText( $titleText ); + $numMessages = 0; + if ( !$title ) { + fwrite( STDERR, Title invalid for lang $lang\n ); + return false; + } + $revision = Revision::newFromTitle( $title ); + if ( !$revision ) { + fwrite( STDERR, Revision not found for page [[$titleText]]\n ); + return false; + } + $text = $revision-getText(); + if ( $text === false ) { + fwrite( STDERR, Text not found for page [[$titleText]]\n ); + return false; + } + + for ( $sectionIndex = 1; $sectionIndex = 10; $sectionIndex++ ) { + $section = $wgParser-getSection( $text, $sectionIndex, false ); + if ( $section === false ) { +
[MediaWiki-commits] [Gerrit] Add initial copy of 2009 bv files to 2013 - change (mediawiki...SecurePoll)
Reedy has submitted this change and it was merged. Change subject: Add initial copy of 2009 bv files to 2013 .. Add initial copy of 2009 bv files to 2013 Change-Id: Idf45ddbc4b06a34463418b6938ebf8d15f2c2f04 --- A cli/wm-scripts/bv2013/bv2013_tables.sql A cli/wm-scripts/bv2013/dumpMetaTranslations.php A cli/wm-scripts/bv2013/populateEditCount.php A cli/wm-scripts/bv2013/voterList.php 4 files changed, 398 insertions(+), 0 deletions(-) Approvals: Reedy: Verified; Looks good to me, approved diff --git a/cli/wm-scripts/bv2013/bv2013_tables.sql b/cli/wm-scripts/bv2013/bv2013_tables.sql new file mode 100644 index 000..c563e5c --- /dev/null +++ b/cli/wm-scripts/bv2013/bv2013_tables.sql @@ -0,0 +1,5 @@ +CREATE TABLE bv2013_edits ( + bv_user int not null primary key, + bv_long_edits int not null, + bv_short_edits int not null +); diff --git a/cli/wm-scripts/bv2013/dumpMetaTranslations.php b/cli/wm-scripts/bv2013/dumpMetaTranslations.php new file mode 100644 index 000..f6ad0f2 --- /dev/null +++ b/cli/wm-scripts/bv2013/dumpMetaTranslations.php @@ -0,0 +1,202 @@ +?php + +require( dirname( __FILE__ ) . '/../cli.inc' ); + +$spConf = array( + 'numCandidates' = 18, + 'baseId' = 17, + 'basePage' = 'Board elections/2009/Vote interface', + 'langs' = array( + 'ar', + 'bn', + 'ca', + 'cs', + 'da', + 'de', + 'el', + 'en', + 'eo', + 'es', + 'fi', + 'fr', + 'gl', + 'hi', + 'hr', + 'hu', + 'ia', + 'id', + 'it', + 'ja', + 'jv', + 'ko', + 'ksh', + 'ms', + 'nb', + 'nl', + 'oc', + 'pl', + 'pt', + 'pt-br', + 'ru', + 'sk', + 'sv', + 'tr', + 'uk', + 'vi', + 'zh-hans', + 'zh-hant', + ) +); + +$header = EOT +SecurePoll +election +configuration +titleWikimedia Board of Trustees Election, 2009/title +ballotpreferential/ballot +tallyschulze/tally +primaryLangen/primaryLang +startDate2009-07-28T12:00:00Z/startDate +endDate2009-08-10T23:59:59Z/endDate +authremote-mw/auth +id{$spConf['baseId']}/id +property name=adminsTim Starling|Philippe|Werdna|Daniel|Yann|Mardetanha/property +property name=not-blocked1/property +property name=not-bot1/property +property name=need-listboard-vote-2009/property +property name=encrypt-typegpg/property +property name=remote-mw-script-pathhttps://secure.wikimedia.org/\$site/\$lang/w/property +property name=shuffle-options1/property +property name=gpg-encrypt-key!-- insert key here --/property +property name=gpg-sign-key!-- insert key here --/property + + +EOT; + +$allMessages = array(); +foreach ( $spConf['langs'] as $lang ) { + $messages = spGetMetaTranslations( $lang ); + if ( $messages ) { + $allMessages[$lang] = $messages; + } else { + fwrite( STDERR, Messages not found for $lang\n ); + } +} + +$s = $header . + spFormatEntityMessages( $allMessages, 'election' ) . + question\n . + id . ($spConf['baseId'] + 1) . /id\n . + message name=\text\ lang=\en\/message\n; + +for ( $i = 1; $i = $spConf['numCandidates']; $i++ ) { + $s .= + option\n . + id . ( $i + $spConf['baseId'] + 1 ) . /id\n . + spFormatEntityMessages( $allMessages, option_$i ) . + /option\n; +} +$s .= /question +/configuration +/election +/SecurePoll +; + +echo $s; +exit( 0 ); +//-- + +function spGetMetaTranslations( $lang ) { + global $spConf, $wgParser; + $messages = array(); + $titleText = {$spConf['basePage']}/$lang; + $title = Title::newFromText( $titleText ); + $numMessages = 0; + if ( !$title ) { + fwrite( STDERR, Title invalid for lang $lang\n ); + return false; + } + $revision = Revision::newFromTitle( $title ); + if ( !$revision ) { + fwrite( STDERR, Revision not found for page [[$titleText]]\n ); + return false; + } + $text = $revision-getText(); + if ( $text === false ) { + fwrite( STDERR, Text not found for page [[$titleText]]\n ); + return false; + } + + for ( $sectionIndex = 1; $sectionIndex = 10; $sectionIndex++ ) { + $section = $wgParser-getSection( $text, $sectionIndex, false ); + if ( $section === false ) { + break; + } + + if (
[MediaWiki-commits] [Gerrit] Start of update of scripts for 2013 - change (mediawiki...SecurePoll)
Reedy has uploaded a new change for review. https://gerrit.wikimedia.org/r/66255 Change subject: Start of update of scripts for 2013 .. Start of update of scripts for 2013 Change-Id: I6f0f551189f13467648373702a93a852324b052d --- M cli/wm-scripts/bv2013/dumpMetaTranslations.php M cli/wm-scripts/bv2013/populateEditCount.php M cli/wm-scripts/bv2013/voterList.php 3 files changed, 29 insertions(+), 14 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SecurePoll refs/changes/55/66255/1 diff --git a/cli/wm-scripts/bv2013/dumpMetaTranslations.php b/cli/wm-scripts/bv2013/dumpMetaTranslations.php index f6ad0f2..01e0753 100644 --- a/cli/wm-scripts/bv2013/dumpMetaTranslations.php +++ b/cli/wm-scripts/bv2013/dumpMetaTranslations.php @@ -5,7 +5,7 @@ $spConf = array( 'numCandidates' = 18, 'baseId' = 17, - 'basePage' = 'Board elections/2009/Vote interface', + 'basePage' = 'Board elections/2013/Vote interface', 'langs' = array( 'ar', 'bn', @@ -63,7 +63,7 @@ property name=adminsTim Starling|Philippe|Werdna|Daniel|Yann|Mardetanha/property property name=not-blocked1/property property name=not-bot1/property -property name=need-listboard-vote-2009/property +property name=need-listboard-vote-2013/property property name=encrypt-typegpg/property property name=remote-mw-script-pathhttps://secure.wikimedia.org/\$site/\$lang/w/property property name=shuffle-options1/property diff --git a/cli/wm-scripts/bv2013/populateEditCount.php b/cli/wm-scripts/bv2013/populateEditCount.php index 6546b88..7bd5abd 100644 --- a/cli/wm-scripts/bv2013/populateEditCount.php +++ b/cli/wm-scripts/bv2013/populateEditCount.php @@ -1,19 +1,22 @@ ?php /** - * have made at least 600 edits before 01 June 2009 across Wikimedia wikis (edits on several wikis can be combined if your accounts are unified into a global account); and - * have made at least 50 edits between 01 January and 01 July 2009. + * have made at least 300 edits before 15 April 2013 across Wikimedia wikis + * (edits on several wikis can be combined if your accounts are unified into a global account); and + * have made at least 20 edits between 15 December 2012 and 30 April 2013. */ require( dirname(__FILE__) . '/../cli.inc' ); + $dbr = wfGetDB( DB_SLAVE ); $dbw = wfGetDB( DB_MASTER ); - $maxUser = $dbr-selectField( 'user', 'MAX(user_id)', false ); -$beforeTime = '2009060100'; -$betweenTime = array( '2009010100', '2009070100' ); -$fname = 'populatebv2009EditCount'; +$beforeTime = '2013040150'; +$betweenTime = array( '2012121500', '2013043000' ); +$fname = 'populateEditCount'; + +$numUsers = 0; for ( $userId = 1; $userId = $maxUser; $userId++ ) { $exists = $dbr-selectField( 'user', '1', array( 'user_id' = $userId ) ); @@ -25,7 +28,8 @@ array( 'rev_user' = $userId, 'rev_timestamp ' . $dbr-addQuotes( $beforeTime ) - ), $fname ); + ), $fname + ); $shortEdits = $dbr-selectField( 'revision', 'COUNT(*)', array( @@ -37,7 +41,7 @@ ); if ( $longEdits !== 0 || $shortEdits !== 0 ) { - $dbw-insert( 'bv2009_edits', + $dbw-insert( 'bv2013_edits', array( 'bv_user' = $userId, 'bv_long_edits' = $longEdits, diff --git a/cli/wm-scripts/bv2013/voterList.php b/cli/wm-scripts/bv2013/voterList.php index a39417c..4b0112f 100644 --- a/cli/wm-scripts/bv2013/voterList.php +++ b/cli/wm-scripts/bv2013/voterList.php @@ -3,8 +3,8 @@ require( dirname( __FILE__ ) . '/../cli.inc' ); $dbr = wfGetDB( DB_SLAVE ); $dbw = wfGetDB( DB_MASTER ); -$fname = 'voterList-bv2009.php'; -$listName = 'board-vote-2009-amended'; +$fname = 'voterList.php'; +$listName = 'board-vote-2013-amended'; if ( !$wgCentralAuthDatabase ) { echo wfWikiID() . : CentralAuth not active, skipping\n; @@ -115,12 +115,18 @@ return $qualifiedUsers; } +/** + * @param $db DatabaseBase + * @param $userNames + * @return array + */ function spGetEditCounts( $db, $userNames ) { $res = $db-select( - array( 'user', 'bv2009_edits' ), + array( 'user', 'bv2013_edits' ), array( 'user_name', 'bv_long_edits', 'bv_short_edits' ), array( 'bv_user=user_id', 'user_name' = $userNames ), - __METHOD__ ); + __METHOD__ + ); $editCounts = array(); foreach ( $res as $row ) { $editCounts[$row-user_name] = array( $row-bv_short_edits, $row-bv_long_edits ); @@ -133,6 +139,11 @@ return $editCounts; } +/** + * @param $short + * @param $long + * @return bool + */ function spIsQualified( $short, $long ) { return $short = 50 $long =
[MediaWiki-commits] [Gerrit] Update SecurePoll to master - change (mediawiki/core)
Reedy has uploaded a new change for review. https://gerrit.wikimedia.org/r/66256 Change subject: Update SecurePoll to master .. Update SecurePoll to master Change-Id: I9bb6ee82a1f2f5906ef33febdf111084da3d29ad --- M extensions/SecurePoll 1 file changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/56/66256/1 diff --git a/extensions/SecurePoll b/extensions/SecurePoll index 3a0b209..5416088 16 --- a/extensions/SecurePoll +++ b/extensions/SecurePoll -Subproject commit 3a0b209a48627300d6f763383229fbe827e02a2c +Subproject commit 5416088ad6cb971661c093dddf58b155af54bf21 -- To view, visit https://gerrit.wikimedia.org/r/66256 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9bb6ee82a1f2f5906ef33febdf111084da3d29ad Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: wmf/1.22wmf4 Gerrit-Owner: Reedy re...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Update SecurePoll to master - change (mediawiki/core)
Reedy has submitted this change and it was merged. Change subject: Update SecurePoll to master .. Update SecurePoll to master Change-Id: I7f431431872903d06f257e0e7512891fd369ef7e --- M extensions/SecurePoll 1 file changed, 0 insertions(+), 0 deletions(-) Approvals: Reedy: Verified; Looks good to me, approved diff --git a/extensions/SecurePoll b/extensions/SecurePoll index 3a0b209..5416088 16 --- a/extensions/SecurePoll +++ b/extensions/SecurePoll -Subproject commit 3a0b209a48627300d6f763383229fbe827e02a2c +Subproject commit 5416088ad6cb971661c093dddf58b155af54bf21 -- To view, visit https://gerrit.wikimedia.org/r/66257 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7f431431872903d06f257e0e7512891fd369ef7e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: wmf/1.22wmf5 Gerrit-Owner: Reedy re...@wikimedia.org Gerrit-Reviewer: Reedy re...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Update SecurePoll to master - change (mediawiki/core)
Reedy has submitted this change and it was merged. Change subject: Update SecurePoll to master .. Update SecurePoll to master Change-Id: I9bb6ee82a1f2f5906ef33febdf111084da3d29ad --- M extensions/SecurePoll 1 file changed, 0 insertions(+), 0 deletions(-) Approvals: Reedy: Verified; Looks good to me, approved diff --git a/extensions/SecurePoll b/extensions/SecurePoll index 3a0b209..5416088 16 --- a/extensions/SecurePoll +++ b/extensions/SecurePoll -Subproject commit 3a0b209a48627300d6f763383229fbe827e02a2c +Subproject commit 5416088ad6cb971661c093dddf58b155af54bf21 -- To view, visit https://gerrit.wikimedia.org/r/66256 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9bb6ee82a1f2f5906ef33febdf111084da3d29ad Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: wmf/1.22wmf4 Gerrit-Owner: Reedy re...@wikimedia.org Gerrit-Reviewer: Reedy re...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix path to cli fail - change (mediawiki...SecurePoll)
Reedy has uploaded a new change for review. https://gerrit.wikimedia.org/r/66258 Change subject: Fix path to cli fail .. Fix path to cli fail Change-Id: I1b63f7025dab60b40b0fc719528a36c1a8f64878 --- M cli/wm-scripts/arbcom/makeArbcomList.php M cli/wm-scripts/bv2009/dumpMetaTranslations.php M cli/wm-scripts/bv2009/populateBv2009EditCount.php M cli/wm-scripts/bv2009/voterList-bv2009.php M cli/wm-scripts/bv2013/dumpMetaTranslations.php M cli/wm-scripts/bv2013/populateEditCount.php M cli/wm-scripts/bv2013/voterList.php 7 files changed, 29 insertions(+), 16 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SecurePoll refs/changes/58/66258/1 diff --git a/cli/wm-scripts/arbcom/makeArbcomList.php b/cli/wm-scripts/arbcom/makeArbcomList.php index 22d3eba..738e191 100644 --- a/cli/wm-scripts/arbcom/makeArbcomList.php +++ b/cli/wm-scripts/arbcom/makeArbcomList.php @@ -5,7 +5,7 @@ */ $optionsWithArgs = array( 'before', 'edits' ); -require( dirname(__FILE__).'/../cli.inc' ); +require( dirname(__FILE__).'/../../cli.inc' ); $dbr = wfGetDB( DB_SLAVE ); $dbw = wfGetDB( DB_MASTER ); diff --git a/cli/wm-scripts/bv2009/dumpMetaTranslations.php b/cli/wm-scripts/bv2009/dumpMetaTranslations.php index f6ad0f2..7e665ba 100644 --- a/cli/wm-scripts/bv2009/dumpMetaTranslations.php +++ b/cli/wm-scripts/bv2009/dumpMetaTranslations.php @@ -1,6 +1,6 @@ ?php -require( dirname( __FILE__ ) . '/../cli.inc' ); +require( dirname( __FILE__ ) . '/../../cli.inc' ); $spConf = array( 'numCandidates' = 18, diff --git a/cli/wm-scripts/bv2009/populateBv2009EditCount.php b/cli/wm-scripts/bv2009/populateBv2009EditCount.php index 6546b88..fa691f2 100644 --- a/cli/wm-scripts/bv2009/populateBv2009EditCount.php +++ b/cli/wm-scripts/bv2009/populateBv2009EditCount.php @@ -5,7 +5,7 @@ * have made at least 50 edits between 01 January and 01 July 2009. */ -require( dirname(__FILE__) . '/../cli.inc' ); +require( dirname(__FILE__) . '/../../cli.inc' ); $dbr = wfGetDB( DB_SLAVE ); $dbw = wfGetDB( DB_MASTER ); diff --git a/cli/wm-scripts/bv2009/voterList-bv2009.php b/cli/wm-scripts/bv2009/voterList-bv2009.php index a39417c..e2eb247 100644 --- a/cli/wm-scripts/bv2009/voterList-bv2009.php +++ b/cli/wm-scripts/bv2009/voterList-bv2009.php @@ -1,6 +1,6 @@ ?php -require( dirname( __FILE__ ) . '/../cli.inc' ); +require( dirname( __FILE__ ) . '/../../cli.inc' ); $dbr = wfGetDB( DB_SLAVE ); $dbw = wfGetDB( DB_MASTER ); $fname = 'voterList-bv2009.php'; diff --git a/cli/wm-scripts/bv2013/dumpMetaTranslations.php b/cli/wm-scripts/bv2013/dumpMetaTranslations.php index 01e0753..946ff82 100644 --- a/cli/wm-scripts/bv2013/dumpMetaTranslations.php +++ b/cli/wm-scripts/bv2013/dumpMetaTranslations.php @@ -1,6 +1,6 @@ ?php -require( dirname( __FILE__ ) . '/../cli.inc' ); +require( dirname( __FILE__ ) . '/../../cli.inc' ); $spConf = array( 'numCandidates' = 18, @@ -52,7 +52,7 @@ SecurePoll election configuration -titleWikimedia Board of Trustees Election, 2009/title +titleWikimedia Board of Trustees Election, 2013/title ballotpreferential/ballot tallyschulze/tally primaryLangen/primaryLang @@ -106,6 +106,10 @@ exit( 0 ); //-- +/** + * @param $lang string + * @return array|bool + */ function spGetMetaTranslations( $lang ) { global $spConf, $wgParser; $messages = array(); @@ -180,20 +184,25 @@ return $messages; } +/** + * @param $messages array + * @param $entity + * @return string + */ function spFormatEntityMessages( $messages, $entity ) { $s = ''; $targetEntity = $entity; foreach ( $messages as $lang = $langMsgs ) { foreach ( $langMsgs as $entity = $entityMsgs ) { if ( $entity === $targetEntity ) { - foreach ( $entityMsgs as $key = $value ) { - $s .= Xml::element( - 'message', - array( 'name' = $key, 'lang' = $lang ), - $value - ) . - \n; - } + continue; + } + foreach ( $entityMsgs as $key = $value ) { + $s .= Xml::element( + 'message', + array( 'name' = $key, 'lang' = $lang ), + $value + ) . \n; } } } diff --git a/cli/wm-scripts/bv2013/populateEditCount.php
[MediaWiki-commits] [Gerrit] Update Parsoid-only tests to reflect shortened typeof - change (mediawiki/core)
GWicke has uploaded a new change for review. https://gerrit.wikimedia.org/r/66259 Change subject: Update Parsoid-only tests to reflect shortened typeof .. Update Parsoid-only tests to reflect shortened typeof https://gerrit.wikimedia.org/r/#/c/64217/ cleans up the RDFa types by dropping the Object/ prefix and renaming mw:Object/Template to the more general mw:Object/Transclusion. This patch updates the Parsoid-only tests to reflect this change. Change-Id: I474c2cf672beb239d0ac482043ccdfd4681d64fb --- M tests/parser/parserTests.txt 1 file changed, 11 insertions(+), 11 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/59/66259/1 diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index 8995593..f7296bd 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -6290,7 +6290,7 @@ {{echo|Bar}} !!result !-- foo -- -p typeof=mw:Object/TemplateBar +p typeof=mw:TransclusionBar /p !!end @@ -6682,7 +6682,7 @@ !!input {{echo_with_span|''a}}{{echo_with_span|b''c''d}}{{echo_with_span|''e}} !!result -pspan typeof=mw:Object/Templateia/i/spani typeof=mw:Object/Templatespanb/span/ispanc/spanid/ispane/span/p +pspan typeof=mw:Transclusionia/i/spani typeof=mw:Transclusionspanb/span/ispanc/spanid/ispane/span/p !!end !!test @@ -6693,9 +6693,9 @@ !!input {{echo_with_div|''a}}{{echo_with_div|b''c''d}}{{echo_with_div|''e}} !!result -div typeof=mw:Object/Templateia/i/div -div typeof=mw:Object/Templateib/icid/i/div -div typeof=mw:Object/Templatee/div +div typeof=mw:Transclusionia/i/div +div typeof=mw:Transclusionib/icid/i/div +div typeof=mw:Transclusione/div !!end !!test @@ -6718,7 +6718,7 @@ |bar |} !!result -table typeof=mw:Object/Template +table typeof=mw:Transclusion tbody tr tdfoo/td/tr/tbody/tablespanbar/span @@ -6750,7 +6750,7 @@ /tr /table !!result -table about=#mwt1 typeof=mw:Object/Template +table about=#mwt1 typeof=mw:Transclusion tbodytr td table @@ -13978,11 +13978,11 @@ {{echo|#a}} {{echo|:a}} !!result -span about=#mwt1 typeof=mw:Object/Template +span about=#mwt1 typeof=mw:Transclusion /spanul about=#mwt1lia/li/ul -span about=#mwt2 typeof=mw:Object/Template +span about=#mwt2 typeof=mw:Transclusion /spanol about=#mwt2lia/li/ol -span about=#mwt3 typeof=mw:Object/Template +span about=#mwt3 typeof=mw:Transclusion /spandl about=#mwt3dda/dd/dl !!end @@ -15077,7 +15077,7 @@ table tbody tr/tr -tr typeof=mw:Object/Template +tr typeof=mw:Transclusion tdfoo/td/tr/tbody/table !!end -- To view, visit https://gerrit.wikimedia.org/r/66259 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I474c2cf672beb239d0ac482043ccdfd4681d64fb Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: GWicke gwi...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Start of update of scripts for 2013 - change (mediawiki...SecurePoll)
Reedy has submitted this change and it was merged. Change subject: Start of update of scripts for 2013 .. Start of update of scripts for 2013 Change-Id: I6f0f551189f13467648373702a93a852324b052d --- M cli/wm-scripts/bv2013/dumpMetaTranslations.php M cli/wm-scripts/bv2013/populateEditCount.php M cli/wm-scripts/bv2013/voterList.php 3 files changed, 29 insertions(+), 14 deletions(-) Approvals: Reedy: Verified; Looks good to me, approved diff --git a/cli/wm-scripts/bv2013/dumpMetaTranslations.php b/cli/wm-scripts/bv2013/dumpMetaTranslations.php index f6ad0f2..01e0753 100644 --- a/cli/wm-scripts/bv2013/dumpMetaTranslations.php +++ b/cli/wm-scripts/bv2013/dumpMetaTranslations.php @@ -5,7 +5,7 @@ $spConf = array( 'numCandidates' = 18, 'baseId' = 17, - 'basePage' = 'Board elections/2009/Vote interface', + 'basePage' = 'Board elections/2013/Vote interface', 'langs' = array( 'ar', 'bn', @@ -63,7 +63,7 @@ property name=adminsTim Starling|Philippe|Werdna|Daniel|Yann|Mardetanha/property property name=not-blocked1/property property name=not-bot1/property -property name=need-listboard-vote-2009/property +property name=need-listboard-vote-2013/property property name=encrypt-typegpg/property property name=remote-mw-script-pathhttps://secure.wikimedia.org/\$site/\$lang/w/property property name=shuffle-options1/property diff --git a/cli/wm-scripts/bv2013/populateEditCount.php b/cli/wm-scripts/bv2013/populateEditCount.php index 6546b88..7bd5abd 100644 --- a/cli/wm-scripts/bv2013/populateEditCount.php +++ b/cli/wm-scripts/bv2013/populateEditCount.php @@ -1,19 +1,22 @@ ?php /** - * have made at least 600 edits before 01 June 2009 across Wikimedia wikis (edits on several wikis can be combined if your accounts are unified into a global account); and - * have made at least 50 edits between 01 January and 01 July 2009. + * have made at least 300 edits before 15 April 2013 across Wikimedia wikis + * (edits on several wikis can be combined if your accounts are unified into a global account); and + * have made at least 20 edits between 15 December 2012 and 30 April 2013. */ require( dirname(__FILE__) . '/../cli.inc' ); + $dbr = wfGetDB( DB_SLAVE ); $dbw = wfGetDB( DB_MASTER ); - $maxUser = $dbr-selectField( 'user', 'MAX(user_id)', false ); -$beforeTime = '2009060100'; -$betweenTime = array( '2009010100', '2009070100' ); -$fname = 'populatebv2009EditCount'; +$beforeTime = '2013040150'; +$betweenTime = array( '2012121500', '2013043000' ); +$fname = 'populateEditCount'; + +$numUsers = 0; for ( $userId = 1; $userId = $maxUser; $userId++ ) { $exists = $dbr-selectField( 'user', '1', array( 'user_id' = $userId ) ); @@ -25,7 +28,8 @@ array( 'rev_user' = $userId, 'rev_timestamp ' . $dbr-addQuotes( $beforeTime ) - ), $fname ); + ), $fname + ); $shortEdits = $dbr-selectField( 'revision', 'COUNT(*)', array( @@ -37,7 +41,7 @@ ); if ( $longEdits !== 0 || $shortEdits !== 0 ) { - $dbw-insert( 'bv2009_edits', + $dbw-insert( 'bv2013_edits', array( 'bv_user' = $userId, 'bv_long_edits' = $longEdits, diff --git a/cli/wm-scripts/bv2013/voterList.php b/cli/wm-scripts/bv2013/voterList.php index a39417c..4b0112f 100644 --- a/cli/wm-scripts/bv2013/voterList.php +++ b/cli/wm-scripts/bv2013/voterList.php @@ -3,8 +3,8 @@ require( dirname( __FILE__ ) . '/../cli.inc' ); $dbr = wfGetDB( DB_SLAVE ); $dbw = wfGetDB( DB_MASTER ); -$fname = 'voterList-bv2009.php'; -$listName = 'board-vote-2009-amended'; +$fname = 'voterList.php'; +$listName = 'board-vote-2013-amended'; if ( !$wgCentralAuthDatabase ) { echo wfWikiID() . : CentralAuth not active, skipping\n; @@ -115,12 +115,18 @@ return $qualifiedUsers; } +/** + * @param $db DatabaseBase + * @param $userNames + * @return array + */ function spGetEditCounts( $db, $userNames ) { $res = $db-select( - array( 'user', 'bv2009_edits' ), + array( 'user', 'bv2013_edits' ), array( 'user_name', 'bv_long_edits', 'bv_short_edits' ), array( 'bv_user=user_id', 'user_name' = $userNames ), - __METHOD__ ); + __METHOD__ + ); $editCounts = array(); foreach ( $res as $row ) { $editCounts[$row-user_name] = array( $row-bv_short_edits, $row-bv_long_edits ); @@ -133,6 +139,11 @@ return $editCounts; } +/** + * @param $short + * @param $long + * @return bool + */ function spIsQualified( $short, $long ) { return $short = 50 $long = 600; } -- To view, visit https://gerrit.wikimedia.org/r/66255 To
[MediaWiki-commits] [Gerrit] Fix path to cli fail - change (mediawiki...SecurePoll)
Reedy has submitted this change and it was merged. Change subject: Fix path to cli fail .. Fix path to cli fail Change-Id: I1b63f7025dab60b40b0fc719528a36c1a8f64878 --- M cli/wm-scripts/arbcom/makeArbcomList.php M cli/wm-scripts/bv2009/dumpMetaTranslations.php M cli/wm-scripts/bv2009/populateBv2009EditCount.php M cli/wm-scripts/bv2009/voterList-bv2009.php M cli/wm-scripts/bv2013/dumpMetaTranslations.php M cli/wm-scripts/bv2013/populateEditCount.php M cli/wm-scripts/bv2013/voterList.php 7 files changed, 29 insertions(+), 16 deletions(-) Approvals: Reedy: Verified; Looks good to me, approved diff --git a/cli/wm-scripts/arbcom/makeArbcomList.php b/cli/wm-scripts/arbcom/makeArbcomList.php index 22d3eba..738e191 100644 --- a/cli/wm-scripts/arbcom/makeArbcomList.php +++ b/cli/wm-scripts/arbcom/makeArbcomList.php @@ -5,7 +5,7 @@ */ $optionsWithArgs = array( 'before', 'edits' ); -require( dirname(__FILE__).'/../cli.inc' ); +require( dirname(__FILE__).'/../../cli.inc' ); $dbr = wfGetDB( DB_SLAVE ); $dbw = wfGetDB( DB_MASTER ); diff --git a/cli/wm-scripts/bv2009/dumpMetaTranslations.php b/cli/wm-scripts/bv2009/dumpMetaTranslations.php index f6ad0f2..7e665ba 100644 --- a/cli/wm-scripts/bv2009/dumpMetaTranslations.php +++ b/cli/wm-scripts/bv2009/dumpMetaTranslations.php @@ -1,6 +1,6 @@ ?php -require( dirname( __FILE__ ) . '/../cli.inc' ); +require( dirname( __FILE__ ) . '/../../cli.inc' ); $spConf = array( 'numCandidates' = 18, diff --git a/cli/wm-scripts/bv2009/populateBv2009EditCount.php b/cli/wm-scripts/bv2009/populateBv2009EditCount.php index 6546b88..fa691f2 100644 --- a/cli/wm-scripts/bv2009/populateBv2009EditCount.php +++ b/cli/wm-scripts/bv2009/populateBv2009EditCount.php @@ -5,7 +5,7 @@ * have made at least 50 edits between 01 January and 01 July 2009. */ -require( dirname(__FILE__) . '/../cli.inc' ); +require( dirname(__FILE__) . '/../../cli.inc' ); $dbr = wfGetDB( DB_SLAVE ); $dbw = wfGetDB( DB_MASTER ); diff --git a/cli/wm-scripts/bv2009/voterList-bv2009.php b/cli/wm-scripts/bv2009/voterList-bv2009.php index a39417c..e2eb247 100644 --- a/cli/wm-scripts/bv2009/voterList-bv2009.php +++ b/cli/wm-scripts/bv2009/voterList-bv2009.php @@ -1,6 +1,6 @@ ?php -require( dirname( __FILE__ ) . '/../cli.inc' ); +require( dirname( __FILE__ ) . '/../../cli.inc' ); $dbr = wfGetDB( DB_SLAVE ); $dbw = wfGetDB( DB_MASTER ); $fname = 'voterList-bv2009.php'; diff --git a/cli/wm-scripts/bv2013/dumpMetaTranslations.php b/cli/wm-scripts/bv2013/dumpMetaTranslations.php index 01e0753..946ff82 100644 --- a/cli/wm-scripts/bv2013/dumpMetaTranslations.php +++ b/cli/wm-scripts/bv2013/dumpMetaTranslations.php @@ -1,6 +1,6 @@ ?php -require( dirname( __FILE__ ) . '/../cli.inc' ); +require( dirname( __FILE__ ) . '/../../cli.inc' ); $spConf = array( 'numCandidates' = 18, @@ -52,7 +52,7 @@ SecurePoll election configuration -titleWikimedia Board of Trustees Election, 2009/title +titleWikimedia Board of Trustees Election, 2013/title ballotpreferential/ballot tallyschulze/tally primaryLangen/primaryLang @@ -106,6 +106,10 @@ exit( 0 ); //-- +/** + * @param $lang string + * @return array|bool + */ function spGetMetaTranslations( $lang ) { global $spConf, $wgParser; $messages = array(); @@ -180,20 +184,25 @@ return $messages; } +/** + * @param $messages array + * @param $entity + * @return string + */ function spFormatEntityMessages( $messages, $entity ) { $s = ''; $targetEntity = $entity; foreach ( $messages as $lang = $langMsgs ) { foreach ( $langMsgs as $entity = $entityMsgs ) { if ( $entity === $targetEntity ) { - foreach ( $entityMsgs as $key = $value ) { - $s .= Xml::element( - 'message', - array( 'name' = $key, 'lang' = $lang ), - $value - ) . - \n; - } + continue; + } + foreach ( $entityMsgs as $key = $value ) { + $s .= Xml::element( + 'message', + array( 'name' = $key, 'lang' = $lang ), + $value + ) . \n; } } } diff --git a/cli/wm-scripts/bv2013/populateEditCount.php b/cli/wm-scripts/bv2013/populateEditCount.php index 7bd5abd..f1a74cb 100644 ---
[MediaWiki-commits] [Gerrit] Update SecurePoll to master - change (mediawiki/core)
Reedy has uploaded a new change for review. https://gerrit.wikimedia.org/r/66260 Change subject: Update SecurePoll to master .. Update SecurePoll to master Change-Id: Icc60c70c8d7adee8b14b92fef508afab06a17358 --- M extensions/SecurePoll 1 file changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/60/66260/1 diff --git a/extensions/SecurePoll b/extensions/SecurePoll index 5416088..5d8c136 16 --- a/extensions/SecurePoll +++ b/extensions/SecurePoll -Subproject commit 5416088ad6cb971661c093dddf58b155af54bf21 +Subproject commit 5d8c1367a812e651970e14131c47e63cb8cfadf5 -- To view, visit https://gerrit.wikimedia.org/r/66260 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icc60c70c8d7adee8b14b92fef508afab06a17358 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: wmf/1.22wmf5 Gerrit-Owner: Reedy re...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Update SecurePoll to master - change (mediawiki/core)
Reedy has uploaded a new change for review. https://gerrit.wikimedia.org/r/66261 Change subject: Update SecurePoll to master .. Update SecurePoll to master Change-Id: I688333a646e7f1c9d026a5d11f4faeb10053fbb7 --- M extensions/SecurePoll 1 file changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/61/66261/1 diff --git a/extensions/SecurePoll b/extensions/SecurePoll index 5416088..5d8c136 16 --- a/extensions/SecurePoll +++ b/extensions/SecurePoll -Subproject commit 5416088ad6cb971661c093dddf58b155af54bf21 +Subproject commit 5d8c1367a812e651970e14131c47e63cb8cfadf5 -- To view, visit https://gerrit.wikimedia.org/r/66261 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I688333a646e7f1c9d026a5d11f4faeb10053fbb7 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: wmf/1.22wmf4 Gerrit-Owner: Reedy re...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Update SecurePoll to master - change (mediawiki/core)
Reedy has submitted this change and it was merged. Change subject: Update SecurePoll to master .. Update SecurePoll to master Change-Id: Icc60c70c8d7adee8b14b92fef508afab06a17358 --- M extensions/SecurePoll 1 file changed, 0 insertions(+), 0 deletions(-) Approvals: Reedy: Verified; Looks good to me, approved diff --git a/extensions/SecurePoll b/extensions/SecurePoll index 5416088..5d8c136 16 --- a/extensions/SecurePoll +++ b/extensions/SecurePoll -Subproject commit 5416088ad6cb971661c093dddf58b155af54bf21 +Subproject commit 5d8c1367a812e651970e14131c47e63cb8cfadf5 -- To view, visit https://gerrit.wikimedia.org/r/66260 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icc60c70c8d7adee8b14b92fef508afab06a17358 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: wmf/1.22wmf5 Gerrit-Owner: Reedy re...@wikimedia.org Gerrit-Reviewer: Reedy re...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Update SecurePoll to master - change (mediawiki/core)
Reedy has submitted this change and it was merged. Change subject: Update SecurePoll to master .. Update SecurePoll to master Change-Id: I688333a646e7f1c9d026a5d11f4faeb10053fbb7 --- M extensions/SecurePoll 1 file changed, 0 insertions(+), 0 deletions(-) Approvals: Reedy: Verified; Looks good to me, approved diff --git a/extensions/SecurePoll b/extensions/SecurePoll index 5416088..5d8c136 16 --- a/extensions/SecurePoll +++ b/extensions/SecurePoll -Subproject commit 5416088ad6cb971661c093dddf58b155af54bf21 +Subproject commit 5d8c1367a812e651970e14131c47e63cb8cfadf5 -- To view, visit https://gerrit.wikimedia.org/r/66261 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I688333a646e7f1c9d026a5d11f4faeb10053fbb7 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: wmf/1.22wmf4 Gerrit-Owner: Reedy re...@wikimedia.org Gerrit-Reviewer: Reedy re...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Basic VE editing test for review and comment - change (qa/browsertests)
Zfilipin has submitted this change and it was merged. Change subject: Basic VE editing test for review and comment .. Basic VE editing test for review and comment Change-Id: Iedac0a68dfa2d6526d074bffb2539898befd5c0b --- A features/step_definitions/visual_editor_steps.rb A features/support/pages/visual_editor_page.rb A features/visual_editor.feature 3 files changed, 65 insertions(+), 0 deletions(-) Approvals: Rachel99: Looks good to me, but someone else must approve Zfilipin: Verified; Looks good to me, approved jenkins-bot: Verified diff --git a/features/step_definitions/visual_editor_steps.rb b/features/step_definitions/visual_editor_steps.rb new file mode 100644 index 000..efa0005 --- /dev/null +++ b/features/step_definitions/visual_editor_steps.rb @@ -0,0 +1,36 @@ +Given(/^I am at my user page$/) do + visit(UserPage) +end + +When /^I edit the page with a string$/ do + on(UserPage) do |page| +page.edit_ve +page.content_element.when_visible.send_keys(Editing with #{@does_not_exist_page_name}) + end +end + +When /^I click Review and Save$/ do + on(UserPage) do |page| +page.container_disabled_element.when_not_visible.should_not exist +page.review_and_save_element.when_visible.click + end +end + +When /^I click Looks good to me$/ do + on(UserPage) do |page| +page.diff_view_element.when_visible.should be_visible +page.looks_good_element.click + end +end + +When /^I click This is a minor edit$/ do + on(UserPage).check_minor_edit +end + +When /^I click Save page$/ do + on(UserPage).save_page_element.click +end + +Then /^Page text should contain the string$/ do + @browser.text.should match Regexp.escape(Editing with #{@does_not_exist_page_name}) +end diff --git a/features/support/pages/visual_editor_page.rb b/features/support/pages/visual_editor_page.rb new file mode 100644 index 000..8d3f2a0 --- /dev/null +++ b/features/support/pages/visual_editor_page.rb @@ -0,0 +1,15 @@ +class UserPage + include PageObject + + include URL + page_url URL.url('User:Selenium_user') + + div(:content, class: 've-ce-documentNode ve-ce-branchNode') + a(:edit_ve, text: 'Edit') + div(:container_disabled, class: 've-ui-widget ve-ui-widget-disabled ve-ui-flaggableElement-constructive ve-ui-buttonWidget') + span(:diff_view, class: 'diffchange diffchange-inline') + span(:review_and_save, class: 've-ui-labeledElement-label', text: 'Review and save') + span(:looks_good, class: 've-ui-labeledElement-label', text: 'Looks good to me') + checkbox(:minor_edit, id: 've-init-mw-viewPageTarget-saveDialog-minorEdit') + span(:save_page, class: 've-ui-labeledElement-label', text: 'Save page') +end diff --git a/features/visual_editor.feature b/features/visual_editor.feature new file mode 100644 index 000..d1415da --- /dev/null +++ b/features/visual_editor.feature @@ -0,0 +1,14 @@ +@test2.wikipedia.org @login +Feature: VisualEditor + + Background: +Given I am logged in + + Scenario: Basic edit +Given I am at my user page +When I edit the page with a string + And I click Review and Save + And I click Looks good to me + And I click This is a minor edit + And I click Save page +Then Page text should contain the string -- To view, visit https://gerrit.wikimedia.org/r/66050 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iedac0a68dfa2d6526d074bffb2539898befd5c0b Gerrit-PatchSet: 2 Gerrit-Project: qa/browsertests Gerrit-Branch: master Gerrit-Owner: Cmcmahon cmcma...@wikimedia.org Gerrit-Reviewer: Cmcmahon cmcma...@wikimedia.org Gerrit-Reviewer: Rachel99 rachelthomas...@yahoo.com Gerrit-Reviewer: Zfilipin zfili...@wikimedia.org Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] improved a help of sql command a bit - change (operations/puppet)
Petrb has uploaded a new change for review. https://gerrit.wikimedia.org/r/66262 Change subject: improved a help of sql command a bit .. improved a help of sql command a bit Change-Id: Idb74f2161647a7afcdc4e07f833f277c7d302542 --- M modules/toollabs/files/sql 1 file changed, 6 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/62/66262/1 diff --git a/modules/toollabs/files/sql b/modules/toollabs/files/sql index 79a2d03..99b9875 100755 --- a/modules/toollabs/files/sql +++ b/modules/toollabs/files/sql @@ -12,15 +12,20 @@ } if [ $# -lt 1 ];then -echo Usage: sql database name|wiki name [-v] +echo Usage: sql database name|wiki name [-vh] type sql --help for more help exit 0 fi if [ $1 = -h ] || [ $1 == --help ];then + echo Usage: sql database[_p] [-vh] + echo echo This tool allows you to easily open a connection to sql database without having to provide the credentials or a database host server echo Example: sql frwiki_p + echo echo Parameters: echo -v: verbose - produce various information about the resolution of db + echo + echo Report bugs to bugzilla exit 0 fi -- To view, visit https://gerrit.wikimedia.org/r/66262 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idb74f2161647a7afcdc4e07f833f277c7d302542 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Petrb benap...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Adding classes to install hive, pig and sqoop. (very simple!) - change (operations...cdh4)
Ottomata has submitted this change and it was merged. Change subject: Adding classes to install hive, pig and sqoop. (very simple!) .. Adding classes to install hive, pig and sqoop. (very simple!) Hive Server and Hive Metastore puppetiztaion will come in a separate commit. Adding and fixing some tests. Change-Id: Iaa7769ce39e7002edb2b2476df3f850c611b4e6b --- M TODO.md A manifests/hive.pp A manifests/pig.pp A manifests/sqoop.pp A templates/pig/pig.properties.erb M tests/Makefile M tests/historyserver.pp A tests/hive.pp M tests/jobtracker.pp A tests/pig.pp M tests/resourcemanager.pp A tests/sqoop.pp 12 files changed, 119 insertions(+), 3 deletions(-) Approvals: Ori.livneh: Looks good to me, but someone else must approve Akosiaris: Looks good to me, approved jenkins-bot: Verified diff --git a/TODO.md b/TODO.md index 2fb0842..9dac694 100644 --- a/TODO.md +++ b/TODO.md @@ -11,4 +11,16 @@ - Make log4j.properties more configurable. - Support Secondary NameNode. - Support High Availability NameNode. -- Make JMX ports configurable. \ No newline at end of file +- Make JMX ports configurable. + +## Hive +- Hive Server + Hive Metastore + +## Oozie + +## Hue + +## HBase + +## Zookeeper + diff --git a/manifests/hive.pp b/manifests/hive.pp new file mode 100644 index 000..5bac968 --- /dev/null +++ b/manifests/hive.pp @@ -0,0 +1,10 @@ +# == Class cdh4::hive +# +# Installs Hive packages (needed for Hive Client). +# Use cdh4::hive::server to install and set up a Hive server. +# +class cdh4::hive { + package { 'hive': +ensure = 'installed', + } +} \ No newline at end of file diff --git a/manifests/pig.pp b/manifests/pig.pp new file mode 100644 index 000..a78243d --- /dev/null +++ b/manifests/pig.pp @@ -0,0 +1,14 @@ +# == Class cdh4::pig +# +# Installs and configures Apache Pig. +# +class cdh4::pig { + package { 'pig': +ensure = 'installed', + } + + file { '/etc/pig/conf/pig.properties': +content = template('cdh4/pig/pig.properties.erb'), +require = Package['pig'], + } +} diff --git a/manifests/sqoop.pp b/manifests/sqoop.pp new file mode 100644 index 000..bb93f19 --- /dev/null +++ b/manifests/sqoop.pp @@ -0,0 +1,16 @@ +# == Class cdh4::sqoop +# Installs Sqoop +class cdh4::sqoop { + package { ['sqoop', 'libmysql-java']: +ensure = 'installed', + } + + # symlink the mysql-connector-java.jar that is installed by + # libmysql-java into /usr/lib/sqoop/lib + + file { '/usr/lib/sqoop/lib/mysql-connector-java.jar': +ensure = 'link', +target = '/usr/share/java/mysql-connector-java.jar', +require = [Package['sqoop'], Package['libmysql-java']], + } +} \ No newline at end of file diff --git a/templates/pig/pig.properties.erb b/templates/pig/pig.properties.erb new file mode 100644 index 000..ea1ff44 --- /dev/null +++ b/templates/pig/pig.properties.erb @@ -0,0 +1,54 @@ +# Pig configuration file. All values can be overwritten by command line arguments. +# see bin/pig -help + +# log4jconf log4j configuration file +# log4jconf=./conf/log4j.properties + +# brief logging (no timestamps) +brief=false + +# clustername, name of the hadoop jobtracker. If no port is defined port 50020 will be used. +#cluster + +#debug level, INFO is default +debug=INFO + +# a file that contains pig script +#file= + +# load jarfile, colon separated +#jar= + +#verbose print all log messages to screen (default to print only INFO and above to screen) +verbose=false + +#exectype local|mapreduce, mapreduce is default +#exectype=mapreduce +# hod realted properties +#ssh.gateway +#hod.expect.root +#hod.expect.useensure = installed +#hod.command +#hod.config.dir +#hod.param + + +#Do not spill temp files smaller than this size (bytes) +pig.spill.size.threshold=500 +#EXPERIMENT: Activate garbage collection when spilling a file bigger than this size (bytes) +#This should help reduce the number of files being spilled. +pig.spill.gc.activation.size=4000 + + +## +# Everything below this line is Yahoo specific. Note that I've made +# (almost) no changes to the lines above to make merging in from Apache +# easier. Any values I don't want from above I override below. +# +# This file is configured for use with HOD on the production clusters. If you +# want to run pig with a static cluster you will need to remove everything +# below this line and set the cluster value (above) to the +# hostname and port of your job tracker. + +exectype=mapreduce +log.file= diff --git a/tests/Makefile b/tests/Makefile index d3fa013..b1acb3b 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -1,4 +1,4 @@ -MANIFESTS=datanode.po defaults.po hadoop.po historyserver.po jobtracker.po Makefile master.po namenode.po nodemanager.po resourcemanager.po tasktracker.po worker.po +MANIFESTS=datanode.po defaults.po hadoop.po historyserver.po hive.po jobtracker.po Makefile master.po namenode.po nodemanager.po pig.po
[MediaWiki-commits] [Gerrit] Updating modules/cdh4 to latest ecosystem commit. - change (operations/puppet)
Ottomata has uploaded a new change for review. https://gerrit.wikimedia.org/r/66263 Change subject: Updating modules/cdh4 to latest ecosystem commit. .. Updating modules/cdh4 to latest ecosystem commit. This will allwo us to puppetize and reinstall the Kraken hadoop nodes. Change-Id: I6e0701c2de5f30d27f85c77e9c352e6bb5be6d49 --- M modules/cdh4 1 file changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/63/66263/1 diff --git a/modules/cdh4 b/modules/cdh4 index 79452a3..a9ce1b1 16 --- a/modules/cdh4 +++ b/modules/cdh4 -Subproject commit 79452a332dc23b8400686f96bb45a18c18241796 +Subproject commit a9ce1b1f5ac29392c6679dd7952dd0fd8db37bd3 -- To view, visit https://gerrit.wikimedia.org/r/66263 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6e0701c2de5f30d27f85c77e9c352e6bb5be6d49 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Ottomata o...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Updating modules/cdh4 to latest ecosystem commit. - change (operations/puppet)
Ottomata has submitted this change and it was merged. Change subject: Updating modules/cdh4 to latest ecosystem commit. .. Updating modules/cdh4 to latest ecosystem commit. This will allwo us to puppetize and reinstall the Kraken hadoop nodes. Change-Id: I6e0701c2de5f30d27f85c77e9c352e6bb5be6d49 --- M modules/cdh4 1 file changed, 0 insertions(+), 0 deletions(-) Approvals: Ottomata: Verified; Looks good to me, approved diff --git a/modules/cdh4 b/modules/cdh4 index 79452a3..a9ce1b1 16 --- a/modules/cdh4 +++ b/modules/cdh4 -Subproject commit 79452a332dc23b8400686f96bb45a18c18241796 +Subproject commit a9ce1b1f5ac29392c6679dd7952dd0fd8db37bd3 -- To view, visit https://gerrit.wikimedia.org/r/66263 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6e0701c2de5f30d27f85c77e9c352e6bb5be6d49 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Ottomata o...@wikimedia.org Gerrit-Reviewer: Ottomata o...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] inserted ksh and mysql client to exec nodes - change (operations/puppet)
Petrb has uploaded a new change for review. https://gerrit.wikimedia.org/r/66264 Change subject: inserted ksh and mysql client to exec nodes .. inserted ksh and mysql client to exec nodes Both could be used by some low level bots or tools written in shell script Change-Id: I467ed522d6919963524cccf42c78d0ed3fcfe38b --- M modules/toollabs/manifests/exec_environ.pp 1 file changed, 3 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/64/66264/1 diff --git a/modules/toollabs/manifests/exec_environ.pp b/modules/toollabs/manifests/exec_environ.pp index 47d9c2d..562d669 100644 --- a/modules/toollabs/manifests/exec_environ.pp +++ b/modules/toollabs/manifests/exec_environ.pp @@ -94,7 +94,9 @@ 'dc', 'p7zip', 'phpunit', - 'r-base' ]: + 'r-base', + 'ksh', + 'mysql-client' ]: ensure = present } -- To view, visit https://gerrit.wikimedia.org/r/66264 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I467ed522d6919963524cccf42c78d0ed3fcfe38b Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Petrb benap...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Mark sajax functions as deprecated - change (mediawiki/core)
Alex Monk has uploaded a new change for review. https://gerrit.wikimedia.org/r/66265 Change subject: Mark sajax functions as deprecated .. Mark sajax functions as deprecated Bug: 40785 Change-Id: I52f01e4e7d8a0ee595b4775068c8a3d630140092 --- M RELEASE-NOTES-1.22 M skins/common/ajax.js 2 files changed, 9 insertions(+), 8 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/65/66265/1 diff --git a/RELEASE-NOTES-1.22 b/RELEASE-NOTES-1.22 index 1591fa9..9cbed38 100644 --- a/RELEASE-NOTES-1.22 +++ b/RELEASE-NOTES-1.22 @@ -196,6 +196,7 @@ is_chrome, webkit_version, is_safari_win, is_safari, webkit_match, is_ff2, ff2_bugs, is_ff2_win, is_ff2_x11, opera95_bugs, opera7_bugs, opera6_bugs, is_opera_95, is_opera_preseven, is_opera, and ie6_bugs. +* (bug 40785) Sajax has marked as deprecated. == Compatibility == diff --git a/skins/common/ajax.js b/skins/common/ajax.js index 121f9d1..6e3a9a4 100644 --- a/skins/common/ajax.js +++ b/skins/common/ajax.js @@ -8,7 +8,7 @@ * the element with id = sajax_debug; if no such element exists in the document, * it is injected. */ -window.sajax_debug = function(text) { +mw.log.deprecate( window, 'sajax_debug', function(text) { if (!sajax_debug_mode) return false; var e = document.getElementById( 'sajax_debug' ); @@ -33,12 +33,12 @@ e.appendChild( m ); return true; -}; +}, 'Sajax is deprecated - please see https://bugzilla.wikimedia.org/40785.' ); /** * Compatibility wrapper for creating a new XMLHttpRequest object. */ -window.sajax_init_object = function() { +mw.log.deprecate( window, 'sajax_init_object', function() { sajax_debug( 'sajax_init_object() called..' ); var A; try { @@ -62,7 +62,7 @@ } return A; -}; +}, 'Sajax is deprecated - please see https://bugzilla.wikimedia.org/40785.' ); /** * Perform an AJAX call to MediaWiki. Calls are handled by AjaxDispatcher.php @@ -80,7 +80,7 @@ * (1, 2, 3) as the parameter list, and will show the result in the element * with id = showFoo */ -window.sajax_do_call = function(func_name, args, target) { +mw.log.deprecate( window, 'sajax_do_call', function(func_name, args, target) { var i, x, n; var uri; var post_data; @@ -160,14 +160,14 @@ delete x; return true; -}; +}, 'Sajax is deprecated - please see https://bugzilla.wikimedia.org/40785.' ); /** * @return boolean whether the browser supports XMLHttpRequest */ -window.wfSupportsAjax = function() { +mw.log.deprecate( window, 'wfSupportsAjax', function() { var request = sajax_init_object(); var supportsAjax = request ? true : false; delete request; return supportsAjax; -}; +}, 'Sajax is deprecated - please see https://bugzilla.wikimedia.org/40785.' ); -- To view, visit https://gerrit.wikimedia.org/r/66265 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I52f01e4e7d8a0ee595b4775068c8a3d630140092 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Alex Monk kren...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Made DataValue::getType static, added tests for both static/... - change (mediawiki...DataValues)
Daniel Werner has uploaded a new change for review. https://gerrit.wikimedia.org/r/66267 Change subject: Made DataValue::getType static, added tests for both static/instance usage .. Made DataValue::getType static, added tests for both static/instance usage Change-Id: I20db0907c96e4bd74eeeaa3019205f3d2af8a5ca --- M DataValues/includes/DataValue.php M DataValues/includes/values/BooleanValue.php M DataValues/includes/values/GeoCoordinateValue.php M DataValues/includes/values/IriValue.php M DataValues/includes/values/MonolingualTextValue.php M DataValues/includes/values/MultilingualTextValue.php M DataValues/includes/values/NumberValue.php M DataValues/includes/values/QuantityValue.php M DataValues/includes/values/StringValue.php M DataValues/includes/values/TimeValue.php M DataValues/includes/values/UnknownValue.php M DataValues/tests/phpunit/includes/DataValueTest.php M ValueFormatters/ValueFormatters.mw.php 13 files changed, 30 insertions(+), 15 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DataValues refs/changes/67/66267/1 diff --git a/DataValues/includes/DataValue.php b/DataValues/includes/DataValue.php index ce69a41..fc5d953 100644 --- a/DataValues/includes/DataValue.php +++ b/DataValues/includes/DataValue.php @@ -40,7 +40,7 @@ * * @return string */ - public function getType(); + public static function getType(); /** * Returns a key that can be used to sort the data value with. diff --git a/DataValues/includes/values/BooleanValue.php b/DataValues/includes/values/BooleanValue.php index caa1da8..91e1ddc 100644 --- a/DataValues/includes/values/BooleanValue.php +++ b/DataValues/includes/values/BooleanValue.php @@ -85,7 +85,7 @@ * * @return string */ - public function getType() { + public static function getType() { return 'boolean'; } diff --git a/DataValues/includes/values/GeoCoordinateValue.php b/DataValues/includes/values/GeoCoordinateValue.php index 8e75f43..38662fe 100644 --- a/DataValues/includes/values/GeoCoordinateValue.php +++ b/DataValues/includes/values/GeoCoordinateValue.php @@ -171,7 +171,7 @@ * * @return string */ - public function getType() { + public static function getType() { return 'geocoordinate'; } diff --git a/DataValues/includes/values/IriValue.php b/DataValues/includes/values/IriValue.php index 2c649bb..804a965 100644 --- a/DataValues/includes/values/IriValue.php +++ b/DataValues/includes/values/IriValue.php @@ -143,7 +143,7 @@ * * @return string */ - public function getType() { + public static function getType() { return 'iri'; } diff --git a/DataValues/includes/values/MonolingualTextValue.php b/DataValues/includes/values/MonolingualTextValue.php index 49287bd..2602021 100644 --- a/DataValues/includes/values/MonolingualTextValue.php +++ b/DataValues/includes/values/MonolingualTextValue.php @@ -106,7 +106,7 @@ * * @return string */ - public function getType() { + public static function getType() { return 'monolingualtext'; } diff --git a/DataValues/includes/values/MultilingualTextValue.php b/DataValues/includes/values/MultilingualTextValue.php index fa536ad..1b94748 100644 --- a/DataValues/includes/values/MultilingualTextValue.php +++ b/DataValues/includes/values/MultilingualTextValue.php @@ -95,7 +95,7 @@ * * @return string */ - public function getType() { + public static function getType() { return 'multilingualtext'; } diff --git a/DataValues/includes/values/NumberValue.php b/DataValues/includes/values/NumberValue.php index 77f8f11..6354ca0 100644 --- a/DataValues/includes/values/NumberValue.php +++ b/DataValues/includes/values/NumberValue.php @@ -88,7 +88,7 @@ * * @return string */ - public function getType() { + public static function getType() { return 'number'; } diff --git a/DataValues/includes/values/QuantityValue.php b/DataValues/includes/values/QuantityValue.php index 404ee78..bf6188d 100644 --- a/DataValues/includes/values/QuantityValue.php +++ b/DataValues/includes/values/QuantityValue.php @@ -129,7 +129,7 @@ * * @return string */ - public function getType() { + public static function getType() { return 'quantity'; } diff --git a/DataValues/includes/values/StringValue.php b/DataValues/includes/values/StringValue.php index a9164f8..e7eac45 100644 --- a/DataValues/includes/values/StringValue.php +++ b/DataValues/includes/values/StringValue.php @@ -85,7 +85,7 @@ * * @return string */ - public function getType() { +
[MediaWiki-commits] [Gerrit] inserted sql tool to execnodes - change (operations/puppet)
Petrb has uploaded a new change for review. https://gerrit.wikimedia.org/r/66266 Change subject: inserted sql tool to execnodes .. inserted sql tool to execnodes some scripts might want to use it and execute on grid instead of -login or -dev Change-Id: I9edf4f8a1610337c9ea1403c01f15095aca4252c --- M modules/toollabs/manifests/execnode.pp 1 file changed, 9 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/66/66266/1 diff --git a/modules/toollabs/manifests/execnode.pp b/modules/toollabs/manifests/execnode.pp index 1e5c785..f127017 100644 --- a/modules/toollabs/manifests/execnode.pp +++ b/modules/toollabs/manifests/execnode.pp @@ -49,6 +49,15 @@ source = puppet:///modules/toollabs/project-make-shosts, } + file { /usr/bin/sql: +ensure = file, +mode = 0755, +owner = root, +group = root, +source = puppet://modules/toollabs/sql, + } + + exec { make-shosts: command = /usr/local/sbin/project-make-shosts /etc/ssh/shosts.equiv~, require = File['/usr/local/sbin/project-make-shosts', $store], -- To view, visit https://gerrit.wikimedia.org/r/66266 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9edf4f8a1610337c9ea1403c01f15095aca4252c Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Petrb benap...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Change EntityId::getType to be static - change (mediawiki...Wikibase)
Daniel Werner has uploaded a new change for review. https://gerrit.wikimedia.org/r/66268 Change subject: Change EntityId::getType to be static .. Change EntityId::getType to be static Compatiblity to DataValues change in I20db0907c96e4bd74eeeaa3019205f3d2af8a5ca Change-Id: I78f67a4ed6750780eb70129b723c8aad04c84c61 --- M DataModel/DataModel/Entity/EntityId.php M lib/WikibaseLib.php 2 files changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/68/66268/1 diff --git a/DataModel/DataModel/Entity/EntityId.php b/DataModel/DataModel/Entity/EntityId.php index e51b855..d996780 100644 --- a/DataModel/DataModel/Entity/EntityId.php +++ b/DataModel/DataModel/Entity/EntityId.php @@ -232,7 +232,7 @@ * * @return string */ - public function getType() { + public static function getType() { return 'wikibase-entityid'; } diff --git a/lib/WikibaseLib.php b/lib/WikibaseLib.php index 1e99686..2f4ab62 100644 --- a/lib/WikibaseLib.php +++ b/lib/WikibaseLib.php @@ -167,7 +167,7 @@ // Resource Loader Modules: $wgResourceModules = array_merge( $wgResourceModules, include( __DIR__ . /resources/Resources.php ) ); -$wgValueFormatters['wikibase-entityid'] = 'Wikibase\Lib\EntityIdFormatter'; +$wgValueFormatters[ \Wikibase\EntityId::getType() ] = 'Wikibase\Lib\EntityIdFormatter'; if ( defined( 'WB_EXPERIMENTAL_FEATURES' ) WB_EXPERIMENTAL_FEATURES ) { include_once( __DIR__ . '/config/WikibaseLib.experimental.php' ); -- To view, visit https://gerrit.wikimedia.org/r/66268 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I78f67a4ed6750780eb70129b723c8aad04c84c61 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Daniel Werner daniel.wer...@wikimedia.de ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Inject value formatters into EntityView instead of using glo... - change (mediawiki...Wikibase)
Daniel Werner has uploaded a new change for review. https://gerrit.wikimedia.org/r/66270 Change subject: Inject value formatters into EntityView instead of using global in EntityView .. Inject value formatters into EntityView instead of using global in EntityView Change-Id: I579bb59b48251800a07aefa32d12753ff6117060 --- M repo/includes/EntityView.php M repo/includes/actions/ViewEntityAction.php M repo/includes/content/ItemContent.php M repo/includes/content/PropertyContent.php M repo/includes/specials/SpecialItemResolver.php M repo/tests/phpunit/includes/ItemViewTest.php 6 files changed, 46 insertions(+), 16 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/70/66270/1 diff --git a/repo/includes/EntityView.php b/repo/includes/EntityView.php index 654e559..169f5e0 100644 --- a/repo/includes/EntityView.php +++ b/repo/includes/EntityView.php @@ -4,6 +4,9 @@ use Html, ParserOptions, ParserOutput, Title, Language, IContextSource, OutputPage, MediaWikiSite; use MWException, FormatJson; use \Wikibase\Lib\Serializers\SerializerFactory; +use \ValueFormatters\ValueFormatterFactory, + \ValueFormatters\FormatterOptions, + \ValueFormatters\ValueFormatter; /** * Base class for creating views for all different kinds of Wikibase\Entity. @@ -38,6 +41,12 @@ * @author Daniel Werner */ abstract class EntityView extends \ContextSource { + /** +* @since 0.4 +* +* @var ValueFormatterFactory +*/ + protected $valueFormatters; /** * Maps entity types to the corresponding entity view. @@ -62,9 +71,12 @@ * * @since 0.1 * -* @param \IContextSource|null $context +* @param ValueFormatterFactory $valueFormatters +* @param IContextSource|null $context */ - public function __construct( IContextSource $context = null ) { + public function __construct( ValueFormatterFactory $valueFormatters, IContextSource $context = null ) { + $this-valueFormatters = $valueFormatters; + if ( !$context ) { $context = \RequestContext::getMain(); } @@ -486,11 +498,8 @@ ); } - // TODO: inject value formatters into constructor instead - $valueFormatters = new \ValueFormatters\ValueFormatterFactory( $wgValueFormatters ); - - $valueFormatterOptions = new \ValueFormatters\FormatterOptions( array( - \ValueFormatters\ValueFormatter::OPT_LANG = $languageCode + $valueFormatterOptions = new FormatterOptions( array( + ValueFormatter::OPT_LANG = $languageCode ) ); $i = 0; @@ -505,7 +514,7 @@ $value = $value-getTime() . ' (' . $value-getCalendarModel() . ')'; } else { // Proper way, use value formatter: - $valueFormatter = $valueFormatters-newFormatter( + $valueFormatter = $this-valueFormatters-newFormatter( $value-getType(), $valueFormatterOptions ); @@ -822,18 +831,24 @@ * @since 0.2 * * @param EntityContent $entity +* @param ValueFormatterFactory $valueFormatters +* @param IContextSource|null $context * * @return EntityView * @throws MWException */ - public static function newForEntityContent( EntityContent $entity ) { + public static function newForEntityContent( + EntityContent $entity, + ValueFormatterFactory $valueFormatters, + IContextSource $context = null + ) { $type = $entity-getEntity()-getType(); if ( !in_array( $type, array_keys( self::$typeMap ) ) ) { throw new MWException( No entity view known for handling entities of type '$type' ); } - $instance = new self::$typeMap[ $type ](); + $instance = new self::$typeMap[ $type ]( $valueFormatters, $context ); return $instance; } } diff --git a/repo/includes/actions/ViewEntityAction.php b/repo/includes/actions/ViewEntityAction.php index c10199c..fd82f78 100644 --- a/repo/includes/actions/ViewEntityAction.php +++ b/repo/includes/actions/ViewEntityAction.php @@ -1,7 +1,7 @@ ?php namespace Wikibase; -use Language, Article; +use Language, Article, \ValueFormatters\ValueFormatterFactory; /** * Handles the view
[MediaWiki-commits] [Gerrit] Implemented EntityContent::getParserOutput - change (mediawiki...Wikibase)
Daniel Werner has uploaded a new change for review. https://gerrit.wikimedia.org/r/66271 Change subject: Implemented EntityContent::getParserOutput .. Implemented EntityContent::getParserOutput Change-Id: If57e55bbadafdf4d81b0f815980929182520cdad --- M repo/includes/content/EntityContent.php M repo/includes/content/ItemContent.php M repo/includes/content/PropertyContent.php 3 files changed, 21 insertions(+), 42 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/71/66271/1 diff --git a/repo/includes/content/EntityContent.php b/repo/includes/content/EntityContent.php index da1d2df..e93fea9 100644 --- a/repo/includes/content/EntityContent.php +++ b/repo/includes/content/EntityContent.php @@ -2,7 +2,8 @@ namespace Wikibase; -use WikiPage, Title, User, Status; +use WikiPage, Title, User, Status, ParserOptions; +use \ValueFormatters\ValueFormatterFactory; /** * Abstract content object for articles representing Wikibase entities. @@ -125,6 +126,25 @@ public abstract function getEntity(); /** +* Returns a ParserOutput object containing the HTML. +* +* @since 0.1 +* +* @param Title $title +* @param null $revId +* @param null|ParserOptions $options +* @param bool $generateHtml +* +* @return ParserOutput +*/ + public function getParserOutput( Title $title, $revId = null, ParserOptions $options = null, $generateHtml = true ) { + $valueFormatters = new ValueFormatterFactory( $GLOBALS['wgValueFormatters'] ); + + $entityView = EntityView::newForEntityContent( $this, $valueFormatters );; + return $entityView-getParserOutput( $this, $options, $generateHtml ); + } + + /** * @return String a string representing the content in a way useful for building a full text * search index. */ diff --git a/repo/includes/content/ItemContent.php b/repo/includes/content/ItemContent.php index 8517337..b644401 100644 --- a/repo/includes/content/ItemContent.php +++ b/repo/includes/content/ItemContent.php @@ -2,7 +2,6 @@ namespace Wikibase; use Title, WikiPage, User, MWException, Content, Status, ParserOptions, ParserOutput, DataUpdate; -use \ValueFormatters\ValueFormatterFactory; /** * Content object for articles representing Wikibase items. @@ -266,24 +265,4 @@ array( new ItemModificationUpdate( $this ) ) ); } - - /** -* Returns a ParserOutput object containing the HTML. -* -* @since 0.1 -* -* @param Title $title -* @param null $revId -* @param null|ParserOptions $options -* @param bool $generateHtml -* -* @return \Title -*/ - public function getParserOutput( Title $title, $revId = null, ParserOptions $options = null, $generateHtml = true ) { - $valueFormatters = new ValueFormatterFactory( $GLOBALS['wgValueFormatters'] ); - - $itemView = new ItemView( $valueFormatters ); - return $itemView-getParserOutput( $this, $options, $generateHtml ); - } - } diff --git a/repo/includes/content/PropertyContent.php b/repo/includes/content/PropertyContent.php index 7113dee..88a 100644 --- a/repo/includes/content/PropertyContent.php +++ b/repo/includes/content/PropertyContent.php @@ -2,7 +2,6 @@ namespace Wikibase; use Title, Content, ParserOptions, ParserOutput, WikiPage, User, Status, DataUpdate; -use \ValueFormatters\ValueFormatterFactory; /** * Content object for articles representing Wikibase properties. @@ -163,25 +162,6 @@ parent::getDeletionUpdates( $page, $parserOutput ), array( new EntityDeletionUpdate( $this ) ) ); - } - - /** -* Returns a ParserOutput object containing the HTML. -* -* @since 0.1 -* -* @param Title $title -* @param null $revId -* @param null|ParserOptions $options -* @param bool $generateHtml -* -* @return ParserOutput -*/ - public function getParserOutput( Title $title, $revId = null, ParserOptions $options = null, $generateHtml = true ) { - $valueFormatters = new ValueFormatterFactory( $GLOBALS['wgValueFormatters'] ); - - $propertyView = new PropertyView( $valueFormatters ); - return $propertyView-getParserOutput( $this, $options, $generateHtml ); } /** -- To view, visit https://gerrit.wikimedia.org/r/66271 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If57e55bbadafdf4d81b0f815980929182520cdad Gerrit-PatchSet: 1 Gerrit-Project:
[MediaWiki-commits] [Gerrit] (bug 49014) Proper formatting of values in EntityView - change (mediawiki...Wikibase)
Daniel Werner has uploaded a new change for review. https://gerrit.wikimedia.org/r/66269 Change subject: (bug 49014) Proper formatting of values in EntityView .. (bug 49014) Proper formatting of values in EntityView Using the ValueFormatterFactory to build formatters for displaying certain values. This will allow for displaying the coordinates value. If there is no formatter implemented, the raw value will be displayed if it is represented as a plain string. If not, then an exception will be thrown. The formatters should probably be injected via the constructor, this will be done in a follow-up. Also the function is rather complex now (even more than before), this will also be addressed in a follow-up. Change-Id: Ief836131ac79f489090bd4a5e0f7fee84e13bd3e --- M repo/includes/EntityView.php 1 file changed, 32 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/69/66269/1 diff --git a/repo/includes/EntityView.php b/repo/includes/EntityView.php index 291f8d0..654e559 100644 --- a/repo/includes/EntityView.php +++ b/repo/includes/EntityView.php @@ -447,7 +447,7 @@ * @return string */ public function getHtmlForClaims( EntityContent $entity, Language $lang = null, $editable = true ) { - global $wgLang; + global $wgLang, $wgValueFormatters; wfProfileIn( __METHOD__ ); @@ -486,17 +486,43 @@ ); } + // TODO: inject value formatters into constructor instead + $valueFormatters = new \ValueFormatters\ValueFormatterFactory( $wgValueFormatters ); + + $valueFormatterOptions = new \ValueFormatters\FormatterOptions( array( + \ValueFormatters\ValueFormatter::OPT_LANG = $languageCode + ) ); + $i = 0; foreach( $claims as $claim ) { // TODO: display a placeholder message for novalue/somevalue snak $value = ''; if ( $claim-getMainSnak()-getType() === 'value' ) { - $value = $claim-getMainSnak()-getDataValue()-getValue(); - } + $value = $claim-getMainSnak()-getDataValue(); - // TODO: bad to have a switch for different data types here - if( $value instanceof \DataValues\TimeValue ) { - $value = $value-getTime() . ' (' . $value-getCalendarModel() . ')'; + // TODO: Bad to have a switch for different data types here, implement a formatter! + if( $value instanceof \DataValues\TimeValue ) { + $value = $value-getTime() . ' (' . $value-getCalendarModel() . ')'; + } else { + // Proper way, use value formatter: + $valueFormatter = $valueFormatters-newFormatter( + $value-getType(), $valueFormatterOptions + ); + + if( $valueFormatter !== null ) { + $value = $valueFormatter-format( $value ); + } else { + // If value representation is a string, just display that one as a + // fallback for values not having a formatter implemented yet. + $value = $value-getValue(); + + if( !is_string( $value ) ) { + // TODO: don't fail here, display a message in the UI instead + throw new MWException( 'Displaying of values of type ' + $value-getType() + + ' not supported yet' ); + } + } + } } $additionalCssClasses = ''; -- To view, visit https://gerrit.wikimedia.org/r/66269 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id:
[MediaWiki-commits] [Gerrit] EntityView::getHtmlForClaims separation into getHtmlForClaim - change (mediawiki...Wikibase)
Daniel Werner has uploaded a new change for review. https://gerrit.wikimedia.org/r/66272 Change subject: EntityView::getHtmlForClaims separation into getHtmlForClaim .. EntityView::getHtmlForClaims separation into getHtmlForClaim This makes the getHtmlForClaims a little more comprehensible. Also removed generating the wb-first and wb-last html classes since they are not really required anywhere. The new getHtmlForClaim is protected for now since it would not deliver the output expected when called on its own (no link to the used property). EntityView should still be refactored so rendering of one piece of the data model is done in a particularly dedicated class for that piece. Change-Id: Ic660921af5da2b8ae205f37af503596ae91ff28a --- M repo/includes/EntityView.php 1 file changed, 92 insertions(+), 60 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/72/66272/1 diff --git a/repo/includes/EntityView.php b/repo/includes/EntityView.php index 169f5e0..76dfe11 100644 --- a/repo/includes/EntityView.php +++ b/repo/includes/EntityView.php @@ -459,7 +459,7 @@ * @return string */ public function getHtmlForClaims( EntityContent $entity, Language $lang = null, $editable = true ) { - global $wgLang, $wgValueFormatters; + global $wgLang; wfProfileIn( __METHOD__ ); @@ -498,67 +498,9 @@ ); } - $valueFormatterOptions = new FormatterOptions( array( - ValueFormatter::OPT_LANG = $languageCode - ) ); - $i = 0; foreach( $claims as $claim ) { - // TODO: display a placeholder message for novalue/somevalue snak - $value = ''; - if ( $claim-getMainSnak()-getType() === 'value' ) { - $value = $claim-getMainSnak()-getDataValue(); - - // TODO: Bad to have a switch for different data types here, implement a formatter! - if( $value instanceof \DataValues\TimeValue ) { - $value = $value-getTime() . ' (' . $value-getCalendarModel() . ')'; - } else { - // Proper way, use value formatter: - $valueFormatter = $this-valueFormatters-newFormatter( - $value-getType(), $valueFormatterOptions - ); - - if( $valueFormatter !== null ) { - $value = $valueFormatter-format( $value ); - } else { - // If value representation is a string, just display that one as a - // fallback for values not having a formatter implemented yet. - $value = $value-getValue(); - - if( !is_string( $value ) ) { - // TODO: don't fail here, display a message in the UI instead - throw new MWException( 'Displaying of values of type ' + $value-getType() - + ' not supported yet' ); - } - } - } - } - - $additionalCssClasses = ''; - if ( $i++ === 0 ) { - $additionalCssClasses .= 'wb-first '; - } - if ( $i === count( $claims ) ) { - $additionalCssClasses .= 'wb-last '; - } - - $mainSnakHtml = wfTemplate( 'wb-snak', - 'wb-mainsnak', - $propertyLink, - '', // type selector, JS only - ( $value === '' ) ? 'nbsp;' : htmlspecialchars( $value ) - ); - - // TODO: Use 'wb-claim' or 'wb-statement' template accordingly -
[MediaWiki-commits] [Gerrit] subversion to all exec nodes - change (operations/puppet)
Petrb has uploaded a new change for review. https://gerrit.wikimedia.org/r/66273 Change subject: subversion to all exec nodes .. subversion to all exec nodes legoktm has some script which checks the pywikibot commits Change-Id: I8efa9a9d2ffc31bd817b94051b982ee5b9f8d499 --- M modules/toollabs/manifests/exec_environ.pp 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/73/66273/1 diff --git a/modules/toollabs/manifests/exec_environ.pp b/modules/toollabs/manifests/exec_environ.pp index 47d9c2d..5639ddb 100644 --- a/modules/toollabs/manifests/exec_environ.pp +++ b/modules/toollabs/manifests/exec_environ.pp @@ -94,7 +94,8 @@ 'dc', 'p7zip', 'phpunit', - 'r-base' ]: + 'r-base', + 'subversion' ]: ensure = present } -- To view, visit https://gerrit.wikimedia.org/r/66273 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8efa9a9d2ffc31bd817b94051b982ee5b9f8d499 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Petrb benap...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] EntityView::getHtmlForClaims separation into getHtmlForClaim - change (mediawiki...Wikibase)
Daniel Werner has uploaded a new change for review. https://gerrit.wikimedia.org/r/66274 Change subject: EntityView::getHtmlForClaims separation into getHtmlForClaim .. EntityView::getHtmlForClaims separation into getHtmlForClaim This makes the getHtmlForClaims a little more comprehensible. Also removed generating the wb-first and wb-last html classes since they are not really required anywhere. The new getHtmlForClaim is protected for now since it would not deliver the output expected when called on its own (no link to the used property). EntityView should still be refactored so rendering of one piece of the data model is done in a particularly dedicated class for that piece. Change-Id: I71b695ea720529bc88a9140984326231c9a4622c --- M repo/includes/EntityView.php 1 file changed, 92 insertions(+), 65 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/74/66274/1 diff --git a/repo/includes/EntityView.php b/repo/includes/EntityView.php index 3fbd2b4..983c3e4 100644 --- a/repo/includes/EntityView.php +++ b/repo/includes/EntityView.php @@ -459,7 +459,7 @@ * @return string */ public function getHtmlForClaims( EntityContent $entity, Language $lang = null, $editable = true ) { - global $wgLang, $wgValueFormatters; + global $wgLang; wfProfileIn( __METHOD__ ); @@ -497,73 +497,10 @@ htmlspecialchars( $property-getEntity()-getLabel( $languageCode ) ) ); } - - $entitiesPrefixMap = array(); - foreach ( Settings::get( 'entityPrefixes' ) as $prefix = $entityType ) { - $entitiesPrefixMap[ $entityType ] = $prefix; - } - $valueFormatterOptions = new FormatterOptions( array( - ValueFormatter::OPT_LANG = $languageCode, - Lib\EntityIdFormatter::OPT_PREFIX_MAP = $entitiesPrefixMap - ) ); $i = 0; foreach( $claims as $claim ) { - // TODO: display a placeholder message for novalue/somevalue snak - $value = ''; - if ( $claim-getMainSnak()-getType() === 'value' ) { - $value = $claim-getMainSnak()-getDataValue(); - - // TODO: Bad to have a switch for different data types here, implement a formatter! - if( $value instanceof \DataValues\TimeValue ) { - $value = $value-getTime() . ' (' . $value-getCalendarModel() . ')'; - } else { - // Proper way, use value formatter: - $valueFormatter = $this-valueFormatters-newFormatter( - $value-getType(), $valueFormatterOptions - ); - - if( $valueFormatter !== null ) { - $value = $valueFormatter-format( $value ); - } else { - // If value representation is a string, just display that one as a - // fallback for values not having a formatter implemented yet. - $value = $value-getValue(); - - if( !is_string( $value ) ) { - // TODO: don't fail here, display a message in the UI instead - throw new MWException( 'Displaying of values of type ' + $value-getType() - + ' not supported yet' ); - } - } - } - } - - $additionalCssClasses = ''; - if ( $i++ === 0 ) { - $additionalCssClasses .= 'wb-first '; - } - if ( $i === count( $claims ) ) { - $additionalCssClasses .= 'wb-last '; - } - -
[MediaWiki-commits] [Gerrit] This API action is wbcreateclaim but examples was saying act... - change (mediawiki...Wikibase)
Liangent has uploaded a new change for review. https://gerrit.wikimedia.org/r/66275 Change subject: This API action is wbcreateclaim but examples was saying action=createclaim .. This API action is wbcreateclaim but examples was saying action=createclaim Change-Id: I042c471b73bc6fec0cccff75eb84375f88f25863 --- M repo/includes/api/CreateClaim.php 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/75/66275/1 diff --git a/repo/includes/api/CreateClaim.php b/repo/includes/api/CreateClaim.php index ffb228e..0d79e5a 100644 --- a/repo/includes/api/CreateClaim.php +++ b/repo/includes/api/CreateClaim.php @@ -286,8 +286,8 @@ */ protected function getExamples() { return array( - 'api.php?action=createclaimentity=q42property=p9001snaktype=novaluetoken=foobarbaserevid=7201010', - 'api.php?action=createclaimentity=q42property=p9001snaktype=valuevalue={entity-type:item,numeric-id:1}token=foobarbaserevid=7201010', + 'api.php?action=wbcreateclaimentity=q42property=p9001snaktype=novaluetoken=foobarbaserevid=7201010', + 'api.php?action=wbcreateclaimentity=q42property=p9001snaktype=valuevalue={entity-type:item,numeric-id:1}token=foobarbaserevid=7201010', // 'ex' = 'desc' ); } -- To view, visit https://gerrit.wikimedia.org/r/66275 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I042c471b73bc6fec0cccff75eb84375f88f25863 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Liangent liang...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Properly set globeCoordinate.GlobeCoordinate.prototype.const... - change (mediawiki...DataValues)
Daniel Werner has uploaded a new change for review. https://gerrit.wikimedia.org/r/66276 Change subject: Properly set globeCoordinate.GlobeCoordinate.prototype.constructor .. Properly set globeCoordinate.GlobeCoordinate.prototype.constructor Since the whole constructor's prototype gets overwritten with a plain Object, the new prototype's constructor will be set to Object but we want it to be the actual constructor for having instanceof working properly. Change-Id: I3b2e870b8d2c3f5b0676b9535c2f89c641e11ad2 --- M DataValues/resources/globeCoordinate.js/src/globeCoordinate.GlobeCoordinate.js 1 file changed, 6 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DataValues refs/changes/76/66276/1 diff --git a/DataValues/resources/globeCoordinate.js/src/globeCoordinate.GlobeCoordinate.js b/DataValues/resources/globeCoordinate.js/src/globeCoordinate.GlobeCoordinate.js index 1c0cd87..2fe4c7d 100644 --- a/DataValues/resources/globeCoordinate.js/src/globeCoordinate.GlobeCoordinate.js +++ b/DataValues/resources/globeCoordinate.js/src/globeCoordinate.GlobeCoordinate.js @@ -12,7 +12,7 @@ * @dependency globeCoordinate * @dependency globeCoordinate.parser */ -globeCoordinate.GlobeCoordinate = ( function( globeCcoordinate, globeCoordinateParser ) { +globeCoordinate.GlobeCoordinate = ( function( globeCoordinate, globeCoordinateParser ) { 'use strict'; /** @@ -27,7 +27,7 @@ * * @constructor */ - var GlobeCoordinate = function GlobeCoordinate( globeCoordinateDefinition, options ) { + function GlobeCoordinate( globeCoordinateDefinition, options ) { var parsed; options = options || {}; @@ -60,9 +60,12 @@ } this._globe = 'http://wikidata.org/id/Q2'; // TODO: Support other globes - }; + } GlobeCoordinate.prototype = { + // Don't forget about constructor since we are overwriting the whole prototype here: + constructor: GlobeCoordinate, + /** * Globe URI * @type {string} -- To view, visit https://gerrit.wikimedia.org/r/66276 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3b2e870b8d2c3f5b0676b9535c2f89c641e11ad2 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/DataValues Gerrit-Branch: master Gerrit-Owner: Daniel Werner daniel.wer...@wikimedia.de ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Alpha: Introduce a page banner concept on tablets and deskto... - change (mediawiki...MobileFrontend)
Jdlrobson has uploaded a new change for review. https://gerrit.wikimedia.org/r/66277 Change subject: Alpha: Introduce a page banner concept on tablets and desktop Minerva skin .. Alpha: Introduce a page banner concept on tablets and desktop Minerva skin TODO: Currently the page banner is not configurable by editors. It's hoped that it can be with enough interest. This is being used on Wikivoyage - https://en.wikivoyage.org/wiki/Rotterdam Change-Id: Ib58e4818138f8611e4649d6453b6c83f0e4fa307 --- M MobileFrontend.php M includes/Resources.php M includes/skins/MinervaTemplate.php M includes/skins/SkinMinerva.php M includes/skins/SkinMobile.php M includes/skins/SkinMobileBase.php M less/common/pageactions.less A less/tablet/common.less M stylesheets/common/pageactions.css A stylesheets/tablet/common.css 10 files changed, 140 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/77/66277/1 diff --git a/MobileFrontend.php b/MobileFrontend.php index 423b241..18b542c 100644 --- a/MobileFrontend.php +++ b/MobileFrontend.php @@ -383,3 +383,14 @@ * @var bool */ $wgMFEnableCssAnimations = true; + +/** + * Minerva specific variables +**/ + +/** + * Defines a default page banner to be used when no other banner has been defined by an editor + * Currently mobile alpha mode only + * @var String + */ +$wgMinervaDefaultPageBanner = 'http://upload.wikimedia.org/wikipedia/commons/6/63/Wikipedia-logo.png'; diff --git a/includes/Resources.php b/includes/Resources.php index d136d08..f336aa8 100644 --- a/includes/Resources.php +++ b/includes/Resources.php @@ -135,6 +135,13 @@ 'position' = 'top', ), + 'minerva.tablet' = $wgMFMobileResourceBoilerplate + array( + 'position' = 'top', + 'styles' = array( + 'stylesheets/tablet/common.css', + ), + ), + 'mobile.styles.beta' = $wgMFMobileResourceBoilerplate + array( 'styles' = array( 'stylesheets/common/pageactions.css', diff --git a/includes/skins/MinervaTemplate.php b/includes/skins/MinervaTemplate.php index 94f90d2..23f9b24 100644 --- a/includes/skins/MinervaTemplate.php +++ b/includes/skins/MinervaTemplate.php @@ -83,6 +83,8 @@ } protected function render( $data ) { // FIXME: replace with template engines + $topBannerEnabled = $data['_enableTopBanner']; + $isSpecialPage = $this-getSkin()-getTitle()-isSpecialPage(); $languages = $this-getLanguages(); $variants = $this-getLanguageVariants(); @@ -147,11 +149,24 @@ ul id=mw-mf-menu-page/ul /div div class='show' id='content_wrapper' + ?php + if ( $topBannerEnabled ) { + echo Html::openElement( 'div', + array( 'class' = 'top-banner' ) + ); + echo Html::element( 'img', $data['topbanner'] ); + echo $data['prebodytext']; + $this-renderPageActions( $data ); + echo Html::closeElement( 'div' ); + } + ? div id=content class=content ?php if ( !$isSpecialPage ) { - echo $data['prebodytext']; - $this-renderPageActions( $data ); + if ( !$topBannerEnabled ) { + echo $data['prebodytext']; + $this-renderPageActions( $data ); + } } echo $data[ 'bodytext' ]; echo $this-renderLanguages( $languageData ); diff --git a/includes/skins/SkinMinerva.php b/includes/skins/SkinMinerva.php index f3830a0..7c572bc 100644 --- a/includes/skins/SkinMinerva.php +++ b/includes/skins/SkinMinerva.php @@ -78,6 +78,8 @@ } $tpl-set( 'banners', $banners ); $tpl-set( 'page_actions',
[MediaWiki-commits] [Gerrit] Update path for Okawix - change (translatewiki)
Siebrand has uploaded a new change for review. https://gerrit.wikimedia.org/r/66278 Change subject: Update path for Okawix .. Update path for Okawix Change-Id: I4765bb0d0f32c06483c0e3bd5758b6fb80b8e7fb --- M REPOCONF 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/translatewiki refs/changes/78/66278/1 diff --git a/REPOCONF b/REPOCONF index adf757d..8fd43db 100644 --- a/REPOCONF +++ b/REPOCONF @@ -27,7 +27,7 @@ REPO_MOZILLA_SUPPORTEDLANG=he gu-IN REPO_MWLIB=git://github.com/pediapress/mwlib.git REPO_MWLIBRL=git://github.com/pediapress/mwlib.rl.git -REPO_OKAWIX=https://okawix.svn.sourceforge.net/svnroot/okawix/trunk/okawix/chrome/locale +REPO_OKAWIX=svn://svn.code.sf.net/p/okawix/code/trunk/okawix/chrome/locale REPO_OPENIMAGES=https://scm.mmbase.org/openimages/trunk/src/main/native2ascii/eu/openimages REPO_OSM=git://git.openstreetmap.org/rails.git REPO_POTLATCH2=git://github.com/systemed/potlatch2.git -- To view, visit https://gerrit.wikimedia.org/r/66278 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4765bb0d0f32c06483c0e3bd5758b6fb80b8e7fb Gerrit-PatchSet: 1 Gerrit-Project: translatewiki Gerrit-Branch: master Gerrit-Owner: Siebrand siebr...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Updated instructions on how to run Selenium tests - change (mediawiki/vagrant)
Zfilipin has uploaded a new change for review. https://gerrit.wikimedia.org/r/66279 Change subject: Updated instructions on how to run Selenium tests .. Updated instructions on how to run Selenium tests Change-Id: I940b8ddc9b7b606a89b477b5c9b29bb8f4eecdce --- M puppet/modules/browsertests/README 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant refs/changes/79/66279/1 diff --git a/puppet/modules/browsertests/README b/puppet/modules/browsertests/README index 93483a3..203ab10 100644 --- a/puppet/modules/browsertests/README +++ b/puppet/modules/browsertests/README @@ -16,10 +16,10 @@ Before you can run the tests, however, you will need to enable this Puppet module and trigger a Puppet run. This is simple to do. Simply edit -puppet/manifests/extras.pp and uncomment the following line by removing the +puppet/manifests/site.pp and uncomment the following line by removing the hash symbol: - # class { 'browsertests': } + # include role::browsertests Once you've done that, save the file, and run 'vagrant provision'. (If you virtual machine is not running, you'll be prompted to run 'vagrant up' first; -- To view, visit https://gerrit.wikimedia.org/r/66279 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I940b8ddc9b7b606a89b477b5c9b29bb8f4eecdce Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/vagrant Gerrit-Branch: master Gerrit-Owner: Zfilipin zfili...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add EntityRevision functionality - change (mediawiki...Wikibase)
Daniel Kinzler has uploaded a new change for review. https://gerrit.wikimedia.org/r/66280 Change subject: Add EntityRevision functionality .. Add EntityRevision functionality Having a way to retrieve an entity along with revision meta info from a storage service will allow us to move away from using WikiPage and Revision for retrieving entities. This would provide a unified storage layer at least for retrieval, avoids global state and improves testability. It also paves the way for the introduction of sub-entities. Change-Id: I762535bda41eb0799ce3149c199bef613d426115 --- M DataModel/DataModel.classes.php A DataModel/DataModel/Entity/EntityRevision.php M lib/WikibaseLib.classes.php A lib/includes/store/EntityRevisionLookup.php M lib/includes/store/sql/WikiPageEntityLookup.php M lib/tests/phpunit/EntityLookupTest.php M lib/tests/phpunit/MockRepository.php M lib/tests/phpunit/MockRepositoryTest.php M lib/tests/phpunit/store/WikiPageEntityLookupTest.php 9 files changed, 399 insertions(+), 88 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/80/66280/1 diff --git a/DataModel/DataModel.classes.php b/DataModel/DataModel.classes.php index eb9ef89..e9d6271 100644 --- a/DataModel/DataModel.classes.php +++ b/DataModel/DataModel.classes.php @@ -37,6 +37,7 @@ 'Wikibase\StatementObject' = 'DataModel/Claim/Statement.php', // Deprecated 'Wikibase\Entity' = 'DataModel/Entity/Entity.php', + 'Wikibase\EntityRevision' = 'DataModel/Entity/EntityRevision.php', 'Wikibase\EntityId' = 'DataModel/Entity/EntityId.php', 'Wikibase\Item' = 'DataModel/Entity/Item.php', 'Wikibase\ItemObject' = 'DataModel/Entity/Item.php', diff --git a/DataModel/DataModel/Entity/EntityRevision.php b/DataModel/DataModel/Entity/EntityRevision.php new file mode 100644 index 000..f8d5999 --- /dev/null +++ b/DataModel/DataModel/Entity/EntityRevision.php @@ -0,0 +1,91 @@ +?php + +namespace Wikibase; + +use Diff\Comparer\CallbackComparer; +use Diff\Differ; +use Diff\MapPatcher; +use Diff\Patcher; +use MWException; +use Wikibase\Lib\GuidGenerator; + +/** + * Represents a revision of a Wikibase entity. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * http://www.gnu.org/copyleft/gpl.html + * + * @since 0.4 + * + * @file + * @ingroup WikibaseDataModel + * + * @licence GNU GPL v2+ + * @author Daniel Kinzler + */ +class EntityRevision { + + /** +* @since 0.4 +* @var array +*/ + protected $entity; + + /** +* @var int +*/ + protected $revision; + + /** +* @var string +*/ + protected $timestamp; + + /** +* @param Entity $entity +* @param int$revision +* @param string $timestamp +*/ + public function __construct( + Entity $entity, + $revision, + $timestamp + ) { + $this-entity = $entity; + $this-revision = (int)$revision; + $this-timestamp = wfTimestamp( TS_MW, $timestamp ); + } + + /** +* @return Entity +*/ + public function getEntity() { + return $this-entity; + } + + /** +* @return int +*/ + public function getRevision() { + return $this-revision; + } + + /** +* @return string +*/ + public function getTimestamp() { + return $this-timestamp; + } +} diff --git a/lib/WikibaseLib.classes.php b/lib/WikibaseLib.classes.php index 302096b..4e498c8 100644 --- a/lib/WikibaseLib.classes.php +++ b/lib/WikibaseLib.classes.php @@ -114,6 +114,7 @@ 'Wikibase\ChunkCache' = 'includes/store/ChunkCache.php', 'Wikibase\ChunkAccess' = 'includes/store/ChunkAccess.php', 'Wikibase\EntityLookup' = 'includes/store/EntityLookup.php', + 'Wikibase\EntityRevisionLookup' = 'includes/store/EntityRevisionLookup.php', 'Wikibase\PropertyLabelResolver' = 'includes/store/PropertyLabelResolver.php', 'Wikibase\EntityUsageIndex' =
[MediaWiki-commits] [Gerrit] Explicitly require json gem to avoid warning message on Linu... - change (qa/browsertests)
Zfilipin has uploaded a new change for review. https://gerrit.wikimedia.org/r/66281 Change subject: Explicitly require json gem to avoid warning message on Linux and Windows .. Explicitly require json gem to avoid warning message on Linux and Windows You are using an old or stdlib version of json gem Please upgrade to the recent version by adding this to your Gemfile: gem 'json', '~ 1.7.7' Change-Id: I5fa02eb841eabce5c52f669ef50d2676fbf64996 --- M Gemfile M Gemfile.lock 2 files changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/qa/browsertests refs/changes/81/66281/1 diff --git a/Gemfile b/Gemfile index 5400d13..3e7af91 100755 --- a/Gemfile +++ b/Gemfile @@ -2,6 +2,7 @@ gem 'chunky_png' gem 'cucumber' +gem 'json' gem 'net-http-persistent' gem 'page-object' gem 'parallel_tests' diff --git a/Gemfile.lock b/Gemfile.lock index b574877..7f26488 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -23,6 +23,7 @@ gherkin (2.12.0-x86-mingw32) multi_json (~ 1.3) i18n (0.6.4) +json (1.8.0) multi_json (1.7.4) net-http-persistent (2.8) page-object (0.8.10) @@ -56,6 +57,7 @@ DEPENDENCIES chunky_png cucumber + json net-http-persistent page-object parallel_tests -- To view, visit https://gerrit.wikimedia.org/r/66281 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5fa02eb841eabce5c52f669ef50d2676fbf64996 Gerrit-PatchSet: 1 Gerrit-Project: qa/browsertests Gerrit-Branch: master Gerrit-Owner: Zfilipin zfili...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Update repo for FUDforum - change (translatewiki)
Siebrand has uploaded a new change for review. https://gerrit.wikimedia.org/r/66282 Change subject: Update repo for FUDforum .. Update repo for FUDforum Change-Id: Ie57e585127fb944414b5d038771b23ce4b78356e --- M REPOCONF 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/translatewiki refs/changes/82/66282/1 diff --git a/REPOCONF b/REPOCONF index 8fd43db..8419e25 100644 --- a/REPOCONF +++ b/REPOCONF @@ -13,7 +13,7 @@ REPO_ETHERPADLITE_BRANCH=develop REPO_FREECOL=git://git.code.sf.net/p/freecol/git REPO_FRONTLINESMS=git://github.com/frontlinesms/frontlinesms.git -REPO_FUDFORUM=https://fudforum.svn.sourceforge.net/svnroot/fudforum/trunk/install/forum_data/thm/default/i18n +REPO_FUDFORUM=svn://svn.code.sf.net/p/fudforum/code/trunk/install/forum_data/thm/default/i18n REPO_FUEL=git://git.fedorahosted.org/fuel.git REPO_IHRIS=http://bazaar.launchpad.net/~intrahealth%2Binformatics REPO_IHRIS_BRANCH=4.1-dev -- To view, visit https://gerrit.wikimedia.org/r/66282 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie57e585127fb944414b5d038771b23ce4b78356e Gerrit-PatchSet: 1 Gerrit-Project: translatewiki Gerrit-Branch: master Gerrit-Owner: Siebrand siebr...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Update path for Okawix - change (translatewiki)
Siebrand has submitted this change and it was merged. Change subject: Update path for Okawix .. Update path for Okawix Change-Id: I4765bb0d0f32c06483c0e3bd5758b6fb80b8e7fb --- M REPOCONF 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Siebrand: Verified; Looks good to me, approved diff --git a/REPOCONF b/REPOCONF index adf757d..8fd43db 100644 --- a/REPOCONF +++ b/REPOCONF @@ -27,7 +27,7 @@ REPO_MOZILLA_SUPPORTEDLANG=he gu-IN REPO_MWLIB=git://github.com/pediapress/mwlib.git REPO_MWLIBRL=git://github.com/pediapress/mwlib.rl.git -REPO_OKAWIX=https://okawix.svn.sourceforge.net/svnroot/okawix/trunk/okawix/chrome/locale +REPO_OKAWIX=svn://svn.code.sf.net/p/okawix/code/trunk/okawix/chrome/locale REPO_OPENIMAGES=https://scm.mmbase.org/openimages/trunk/src/main/native2ascii/eu/openimages REPO_OSM=git://git.openstreetmap.org/rails.git REPO_POTLATCH2=git://github.com/systemed/potlatch2.git -- To view, visit https://gerrit.wikimedia.org/r/66278 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4765bb0d0f32c06483c0e3bd5758b6fb80b8e7fb Gerrit-PatchSet: 1 Gerrit-Project: translatewiki Gerrit-Branch: master Gerrit-Owner: Siebrand siebr...@wikimedia.org Gerrit-Reviewer: Siebrand siebr...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Update repo for FUDforum - change (translatewiki)
Siebrand has submitted this change and it was merged. Change subject: Update repo for FUDforum .. Update repo for FUDforum Change-Id: Ie57e585127fb944414b5d038771b23ce4b78356e --- M REPOCONF 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Siebrand: Verified; Looks good to me, approved diff --git a/REPOCONF b/REPOCONF index 8fd43db..8419e25 100644 --- a/REPOCONF +++ b/REPOCONF @@ -13,7 +13,7 @@ REPO_ETHERPADLITE_BRANCH=develop REPO_FREECOL=git://git.code.sf.net/p/freecol/git REPO_FRONTLINESMS=git://github.com/frontlinesms/frontlinesms.git -REPO_FUDFORUM=https://fudforum.svn.sourceforge.net/svnroot/fudforum/trunk/install/forum_data/thm/default/i18n +REPO_FUDFORUM=svn://svn.code.sf.net/p/fudforum/code/trunk/install/forum_data/thm/default/i18n REPO_FUEL=git://git.fedorahosted.org/fuel.git REPO_IHRIS=http://bazaar.launchpad.net/~intrahealth%2Binformatics REPO_IHRIS_BRANCH=4.1-dev -- To view, visit https://gerrit.wikimedia.org/r/66282 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie57e585127fb944414b5d038771b23ce4b78356e Gerrit-PatchSet: 1 Gerrit-Project: translatewiki Gerrit-Branch: master Gerrit-Owner: Siebrand siebr...@wikimedia.org Gerrit-Reviewer: Siebrand siebr...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fixed trailing slash removal code. - change (mediawiki/core)
Aaron Schulz has uploaded a new change for review. https://gerrit.wikimedia.org/r/66283 Change subject: Fixed trailing slash removal code. .. Fixed trailing slash removal code. Change-Id: I152dcec5cc8f4c417e3503f4b8fd3fdd8bc4fda5 --- M maintenance/copyFileBackend.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/83/66283/1 diff --git a/maintenance/copyFileBackend.php b/maintenance/copyFileBackend.php index 1ccd121..13301ed 100644 --- a/maintenance/copyFileBackend.php +++ b/maintenance/copyFileBackend.php @@ -56,7 +56,7 @@ $src = FileBackendGroup::singleton()-get( $this-getOption( 'src' ) ); $dst = FileBackendGroup::singleton()-get( $this-getOption( 'dst' ) ); $containers = explode( '|', $this-getOption( 'containers' ) ); - $subDir = $this-getOption( rtrim( 'subdir', '/' ), '' ); + $subDir = rtrim( $this-getOption( 'subdir', '' ), '/' ); $rateFile = $this-getOption( 'ratefile' ); -- To view, visit https://gerrit.wikimedia.org/r/66283 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I152dcec5cc8f4c417e3503f4b8fd3fdd8bc4fda5 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Aaron Schulz asch...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fixed trailing slash removal code. - change (mediawiki/core)
Aaron Schulz has submitted this change and it was merged. Change subject: Fixed trailing slash removal code. .. Fixed trailing slash removal code. Change-Id: I152dcec5cc8f4c417e3503f4b8fd3fdd8bc4fda5 --- M maintenance/copyFileBackend.php 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Hoo man: Verified; Looks good to me, approved diff --git a/maintenance/copyFileBackend.php b/maintenance/copyFileBackend.php index 1ccd121..13301ed 100644 --- a/maintenance/copyFileBackend.php +++ b/maintenance/copyFileBackend.php @@ -56,7 +56,7 @@ $src = FileBackendGroup::singleton()-get( $this-getOption( 'src' ) ); $dst = FileBackendGroup::singleton()-get( $this-getOption( 'dst' ) ); $containers = explode( '|', $this-getOption( 'containers' ) ); - $subDir = $this-getOption( rtrim( 'subdir', '/' ), '' ); + $subDir = rtrim( $this-getOption( 'subdir', '' ), '/' ); $rateFile = $this-getOption( 'ratefile' ); -- To view, visit https://gerrit.wikimedia.org/r/66283 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I152dcec5cc8f4c417e3503f4b8fd3fdd8bc4fda5 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Aaron Schulz asch...@wikimedia.org Gerrit-Reviewer: Aaron Schulz asch...@wikimedia.org Gerrit-Reviewer: Hoo man h...@online.de ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Adding ContentHandler example extension. - change (mediawiki...examples)
Hoo man has submitted this change and it was merged. Change subject: Adding ContentHandler example extension. .. Adding ContentHandler example extension. DataPages implements an XML content model. Change-Id: Ida506952089248aa283e3da5c367212b00fd6881 --- A DataPages/DataPages.example.php A DataPages/DataPages.php A DataPages/XmlContent.php A DataPages/XmlContentHandler.php 4 files changed, 333 insertions(+), 0 deletions(-) Approvals: Hoo man: Verified; Looks good to me, approved Yurik: Looks good to me, approved diff --git a/DataPages/DataPages.example.php b/DataPages/DataPages.example.php new file mode 100644 index 000..189b83e --- /dev/null +++ b/DataPages/DataPages.example.php @@ -0,0 +1,22 @@ +?php + +// +// Example settings for activating the DataPages extension +// + +// load the extension +require_once( $IP . '/extensions/examples/DataPages/DataPages.php' ); + +// Define a custom namespace for XML. +// If your extension is going to use an extra namespace, +// you should list the suggested default at +// http://www.mediawiki.org/wiki/Extension_default_namespaces. +define( 'NS_XML', 234 ); +define( 'NS_XML_TALK', NS_XML +1 ); + +$wgExtraNamespaces[ NS_XML ] = 'XML'; +$wgExtraNamespaces[ NS_XML_TALK ] = 'XML_Talk'; + +// Associate the XML namespace with the XML content model provided by the extension. +// CONTENT_MODEL_XML_DATA is a constant defined in DataPages.php. +$wgNamespaceContentModels[ NS_XML ] = CONTENT_MODEL_XML_DATA; \ No newline at end of file diff --git a/DataPages/DataPages.php b/DataPages/DataPages.php new file mode 100644 index 000..4371ef9 --- /dev/null +++ b/DataPages/DataPages.php @@ -0,0 +1,48 @@ +?php +/** + * Data pages extension, an example for how to use the ContentHandler + * facility to handle XML content in MediaWiki. + * + * See DataPages.example.php for information on what to put into + * your LocalSettings file. + * + * Note that this example represents XML as a string internally. + * More advanced implementation may want to use a DOM based approach. + * + * Please look at XmlContentHandler.php and XmlContent.php to see what + * can and should be done to support custom data types. + * + * @file + * @ingroup Extensions + * @author Daniel Kinzler, brightbyte.de + * + * @copyright Wikimedia Deutschland e.V., 2013 + * @license GNU General Public Licence 2.0 or later + */ + +if ( !defined( 'MEDIAWIKI' ) ) { + echo( This file is an extension to the MediaWiki software and cannot be used on its own.\n ); + die( 1 ); +} + +if ( version_compare( $wgVersion, '1.21', '' ) ) { + die( This extension requires MediaWiki 1.21+\n ); +} + +$wgExtensionCredits['other'][] = array( + 'path' = __FILE__, + 'name' = 'DataPages', + 'author' = 'Daniel Kinzler', +); + +$wgAutoloadClasses['XmlContentHandler'] = __DIR__ . '/XmlContentHandler.php'; +$wgAutoloadClasses['XmlContent'] = __DIR__ . '/XmlContent.php'; + +// Define a constant for the identifier of our custom content model... +define( 'CONTENT_MODEL_XML_DATA', 'XML_DATA' ); + +// ...and register a handler for that content model. +$wgContentHandlers[CONTENT_MODEL_XML_DATA] = 'XmlContentHandler'; + +// The content model is typically associated with a namespace later, +// see DataPages.example.php \ No newline at end of file diff --git a/DataPages/XmlContent.php b/DataPages/XmlContent.php new file mode 100644 index 000..532d605 --- /dev/null +++ b/DataPages/XmlContent.php @@ -0,0 +1,167 @@ +?php + /** + * + * Copyright © 25.05.13 by the authors listed below. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * http://www.gnu.org/copyleft/gpl.html + * + * @license GPL 2+ + * @file + * + * @author Daniel Kinzler + */ + + +/** + * Class XmlContent represents XML content. + * + * This is based on TextContent, and represents XML as a string. + * + * Using a text based content model is the simplest option, since it + * allows the use of the standard editor and diff code, and does not require + * serialization/unserialization. + * + * However, text based content is dumb. It means that your code can't make use + * of the XML structure,
[MediaWiki-commits] [Gerrit] Fixed trailing slash removal code. - change (mediawiki/core)
Aaron Schulz has uploaded a new change for review. https://gerrit.wikimedia.org/r/66284 Change subject: Fixed trailing slash removal code. .. Fixed trailing slash removal code. Change-Id: I152dcec5cc8f4c417e3503f4b8fd3fdd8bc4fda5 (cherry picked from commit f8ba6474788b5382de8211909ef61564fc5c63ca) --- M maintenance/copyFileBackend.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/84/66284/1 diff --git a/maintenance/copyFileBackend.php b/maintenance/copyFileBackend.php index 1ccd121..13301ed 100644 --- a/maintenance/copyFileBackend.php +++ b/maintenance/copyFileBackend.php @@ -56,7 +56,7 @@ $src = FileBackendGroup::singleton()-get( $this-getOption( 'src' ) ); $dst = FileBackendGroup::singleton()-get( $this-getOption( 'dst' ) ); $containers = explode( '|', $this-getOption( 'containers' ) ); - $subDir = $this-getOption( rtrim( 'subdir', '/' ), '' ); + $subDir = rtrim( $this-getOption( 'subdir', '' ), '/' ); $rateFile = $this-getOption( 'ratefile' ); -- To view, visit https://gerrit.wikimedia.org/r/66284 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I152dcec5cc8f4c417e3503f4b8fd3fdd8bc4fda5 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: wmf/1.22wmf5 Gerrit-Owner: Aaron Schulz asch...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fixed trailing slash removal code. - change (mediawiki/core)
Aaron Schulz has uploaded a new change for review. https://gerrit.wikimedia.org/r/66285 Change subject: Fixed trailing slash removal code. .. Fixed trailing slash removal code. Change-Id: I152dcec5cc8f4c417e3503f4b8fd3fdd8bc4fda5 (cherry picked from commit f8ba6474788b5382de8211909ef61564fc5c63ca) --- M maintenance/copyFileBackend.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/85/66285/1 diff --git a/maintenance/copyFileBackend.php b/maintenance/copyFileBackend.php index 685c868..25753e1 100644 --- a/maintenance/copyFileBackend.php +++ b/maintenance/copyFileBackend.php @@ -56,7 +56,7 @@ $src = FileBackendGroup::singleton()-get( $this-getOption( 'src' ) ); $dst = FileBackendGroup::singleton()-get( $this-getOption( 'dst' ) ); $containers = explode( '|', $this-getOption( 'containers' ) ); - $subDir = $this-getOption( rtrim( 'subdir', '/' ), '' ); + $subDir = rtrim( $this-getOption( 'subdir', '' ), '/' ); $rateFile = $this-getOption( 'ratefile' ); -- To view, visit https://gerrit.wikimedia.org/r/66285 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I152dcec5cc8f4c417e3503f4b8fd3fdd8bc4fda5 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: wmf/1.22wmf4 Gerrit-Owner: Aaron Schulz asch...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Device type rewrite - change (mediawiki...MobileFrontend)
Jdlrobson has submitted this change and it was merged. Change subject: Device type rewrite .. Device type rewrite * Use regexes only if necessary, in most cases strpos() is enough. * Since there's now no difference between 'capable' and 'html' (jQuery support is irrelevant), merge them into 'generic' * Order the checks approximately in the order of popularity per http://stats.wikimedia.org/wikimedia/squids/SquidReportClients.htm to reduce the average number of regexes run per request. * Simplify non-default iPhone browser handling. * Reduce the worst-case number of regexes. * Remove unused firefox.css, neither Fennec is supported nor it's a proper way to fix such problems. * Make 'ie' cover all IE Mobile versions. * Kill 'wap2', 'wii' and 'psp'. * Removed a couple of mobileness detection rules covered by MIDP. * Sort rules. Change-Id: I79401aee6ec91eeda19a2ff5f010c4406f568c9b --- M includes/DeviceDetection.php D stylesheets/devices/firefox.css M tests/DeviceDetectionTest.php 3 files changed, 123 insertions(+), 173 deletions(-) Approvals: Jdlrobson: Verified; Looks good to me, approved diff --git a/includes/DeviceDetection.php b/includes/DeviceDetection.php index 9a495fb..64b2c7c 100644 --- a/includes/DeviceDetection.php +++ b/includes/DeviceDetection.php @@ -108,53 +108,51 @@ $patterns = array( 'mobi', - 'phone', - 'android', - 'ipod', - 'webos', - 'palm', - 'opera.m', - 'semc-browser', - 'playstation', - 'nintendo', - 'blackberry', - 'bada', - 'meego', - 'vodafone', - 'docomo', - 'samsung', - 'alcatel', - 'motor', - 'huawei', - 'audiovox', - 'philips', - 'mot-', - 'cdm-', - 'sagem-', - 'htc[-_]', - 'ngm_', - 'mmp\/', - 'up.browser', - 'symbian', - 'midp', - 'kindle', - 'softbank', - 'sec-', '240x240', '240x320', '320x320', - 'ericsson', - 'panasonic', - 'hiptop', - 'portalmmm', - 'kddi-', + 'alcatel', + 'android', + 'audiovox', + 'bada', 'benq', + 'blackberry', + 'cdm-', 'compal-', - 'sanyo', - 'sharp', - 'teleca', + 'docomo', + 'ericsson', + 'hiptop', + 'htc[-_]', + 'huawei', + 'ipod', + 'kddi-', + 'kindle', + 'meego', + 'midp', 'mitsu', + 'mmp\/', + 'mot-', + 'motor', + 'ngm_', + 'nintendo', + 'opera.m', + 'palm', + 'panasonic', + 'philips', + 'phone', + 'playstation', + 'portalmmm', + 'sagem-', + 'samsung', + 'sanyo', + 'sec-', 'sendo', + 'sharp', + 'softbank', + 'symbian', + 'teleca', + 'up.browser', + 'webos', ); $patternsStart = array( 'lg-', @@ -204,6 +202,11 @@ class DeviceDetection implements IDeviceDetector { private static $formats = array ( + 'generic' = array ( + 'view_format' = 'html', + 'css_file_name' = '', + ), + 'android' = array ( 'view_format' = 'html', 'css_file_name' = '', @@ -211,18 +214,6 @@ 'blackberry' = array ( 'view_format' = 'html',
[MediaWiki-commits] [Gerrit] Allow inline code and pre tags - change (mediawiki...MobileFrontend)
Jdlrobson has uploaded a new change for review. https://gerrit.wikimedia.org/r/66287 Change subject: Allow inline code and pre tags .. Allow inline code and pre tags Example usage: In http://en.wikipedia.org/w/index.php?title=ggplot2oldid=551167896 Comparison with base graphics and other packages section Change-Id: I54f5dc25af05ed35ccdb5c2a2c44c8c27afd4e0f --- M less/common/mf-enwp.less M stylesheets/common/mf-enwp.css 2 files changed, 9 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/87/66287/1 diff --git a/less/common/mf-enwp.less b/less/common/mf-enwp.less index 0f7db97..258dfb1 100644 --- a/less/common/mf-enwp.less +++ b/less/common/mf-enwp.less @@ -12,6 +12,11 @@ padding: 1em; } +p pre, +p code { + padding: 0 1em; +} + .mobile #coordinates { display: none; /* TODO: style for mobile */ } diff --git a/stylesheets/common/mf-enwp.css b/stylesheets/common/mf-enwp.css index 4b2dc07..3009e30 100644 --- a/stylesheets/common/mf-enwp.css +++ b/stylesheets/common/mf-enwp.css @@ -10,6 +10,10 @@ border: solid 1px #CCC; padding: 1em; } +p pre, +p code { + padding: 0 1em; +} .mobile #coordinates { display: none; /* TODO: style for mobile */ -- To view, visit https://gerrit.wikimedia.org/r/66287 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I54f5dc25af05ed35ccdb5c2a2c44c8c27afd4e0f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: master Gerrit-Owner: Jdlrobson jrob...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] This API action is wbcreateclaim but examples were saying ac... - change (mediawiki...Wikibase)
Aude has submitted this change and it was merged. Change subject: This API action is wbcreateclaim but examples were saying action=createclaim .. This API action is wbcreateclaim but examples were saying action=createclaim Change-Id: I042c471b73bc6fec0cccff75eb84375f88f25863 --- M repo/includes/api/CreateClaim.php 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Aude: Verified; Looks good to me, approved diff --git a/repo/includes/api/CreateClaim.php b/repo/includes/api/CreateClaim.php index ffb228e..0d79e5a 100644 --- a/repo/includes/api/CreateClaim.php +++ b/repo/includes/api/CreateClaim.php @@ -286,8 +286,8 @@ */ protected function getExamples() { return array( - 'api.php?action=createclaimentity=q42property=p9001snaktype=novaluetoken=foobarbaserevid=7201010', - 'api.php?action=createclaimentity=q42property=p9001snaktype=valuevalue={entity-type:item,numeric-id:1}token=foobarbaserevid=7201010', + 'api.php?action=wbcreateclaimentity=q42property=p9001snaktype=novaluetoken=foobarbaserevid=7201010', + 'api.php?action=wbcreateclaimentity=q42property=p9001snaktype=valuevalue={entity-type:item,numeric-id:1}token=foobarbaserevid=7201010', // 'ex' = 'desc' ); } -- To view, visit https://gerrit.wikimedia.org/r/66275 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I042c471b73bc6fec0cccff75eb84375f88f25863 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Liangent liang...@gmail.com Gerrit-Reviewer: Aude aude.w...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Properly implemented JS GlobeCoordinateValue::toJSON and new... - change (mediawiki...DataValues)
Daniel Werner has uploaded a new change for review. https://gerrit.wikimedia.org/r/66289 Change subject: Properly implemented JS GlobeCoordinateValue::toJSON and newFromJSON .. Properly implemented JS GlobeCoordinateValue::toJSON and newFromJSON Allows round tripping with the backend implementation now. Precision is not yet implemented. Moved the problem of dealing with precision from globeCoordinate.js into GlobeCoordinateValue since globeCoordinate.js should not really know or care about the problems of the backend or anything else Wikibase related. Change-Id: I6b0e3584996a0709de81b37ac07659d6b5bd2c97 --- M DataValues/resources/globeCoordinate.js/src/globeCoordinate.GlobeCoordinate.js M DataValues/resources/values/GlobeCoordinateValue.js 2 files changed, 21 insertions(+), 19 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DataValues refs/changes/89/66289/1 diff --git a/DataValues/resources/globeCoordinate.js/src/globeCoordinate.GlobeCoordinate.js b/DataValues/resources/globeCoordinate.js/src/globeCoordinate.GlobeCoordinate.js index 1c0cd87..d4d3263 100644 --- a/DataValues/resources/globeCoordinate.js/src/globeCoordinate.GlobeCoordinate.js +++ b/DataValues/resources/globeCoordinate.js/src/globeCoordinate.GlobeCoordinate.js @@ -50,14 +50,9 @@ } else { this._latitude = globeCoordinateDefinition.latitude; this._longitude = globeCoordinateDefinition.longitude; - - // The backend does not return precision, so we need to parse the coordinate values: - // TODO: Have the backend support precision - parsed = globeCoordinateParser.parse( this._latitude + ', ' + this._longitude ); - this._precision = parsed[2]; - - // TODO: Capture altitude and globe + this._precision = globeCoordinateDefinition.precision; } + // TODO: Capture altitude and globe this._globe = 'http://wikidata.org/id/Q2'; // TODO: Support other globes }; diff --git a/DataValues/resources/values/GlobeCoordinateValue.js b/DataValues/resources/values/GlobeCoordinateValue.js index 71062a8..97447eb 100644 --- a/DataValues/resources/values/GlobeCoordinateValue.js +++ b/DataValues/resources/values/GlobeCoordinateValue.js @@ -6,7 +6,7 @@ * * @author H. Snater mediaw...@snater.com */ -( function( dv, $, GlobeCoordinate ) { +( function( dv, $, GlobeCoordinate, globeCoordinateParse ) { 'use strict'; var PARENT = dv.DataValue, @@ -75,26 +75,33 @@ toJSON: function() { var globeCoordinate = this.getValue(); - // TODO: Backend should interact with a proper JSON structure and have precision implemented. - return globeCoordinate.getLatitude() + '|' + globeCoordinate.getLongitude(); + return { + latitude: globeCoordinate.getLatitude(), + longitude: globeCoordinate.getLongitude(), + globe: globeCoordinate.getGlobe(), + precision: globeCoordinate.getPrecision() + // altitude: ... + }; } - } ); /** * @see dv.DataValue.newFromJSON */ SELF.newFromJSON = function( json ) { - var data = json.split( '|' ); + // The backend does not return precision, so we need to parse the coordinate values: + // TODO: Have the backend support precision + var precision = globeCoordinateParse( json.latitude + ', ' + json.longitude )[2]; - var c = new GlobeCoordinate( { - latitude: parseFloat( data[0] ), - longitude: parseFloat( data[1] ), - altitude: ( data[2] ) ? parseFloat( data[2] ) : null, - globe: ( data[3] ) ? data[3] : null + var gc = new GlobeCoordinate( { + latitude: json.latitude, + longitude: json.longitude, + globe: json.globe, + precision: precision + // altitude: json.altitude, // TODO: make globeCoordinate.js support altitude } ); - return new SELF( c ); + return new SELF( gc ); }; /** @@ -104,4 +111,4 @@ dv.registerDataValue( SELF ); -}( dataValues, jQuery, globeCoordinate.GlobeCoordinate ) ); +}( dataValues, jQuery, globeCoordinate.GlobeCoordinate, globeCoordinate.parser.parse ) ); -- To view, visit https://gerrit.wikimedia.org/r/66289 To unsubscribe, visit
[MediaWiki-commits] [Gerrit] Added some TODOs and cleanup to globeCoordinate.parser - change (mediawiki...DataValues)
Daniel Werner has uploaded a new change for review. https://gerrit.wikimedia.org/r/66288 Change subject: Added some TODOs and cleanup to globeCoordinate.parser .. Added some TODOs and cleanup to globeCoordinate.parser Change-Id: I584fcfcdc2b46723a5b18a27d90ada7e67aea4db --- M DataValues/resources/globeCoordinate.js/src/globeCoordinate.parser.js 1 file changed, 14 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DataValues refs/changes/88/66288/1 diff --git a/DataValues/resources/globeCoordinate.js/src/globeCoordinate.parser.js b/DataValues/resources/globeCoordinate.js/src/globeCoordinate.parser.js index 3bf105a..7054394 100644 --- a/DataValues/resources/globeCoordinate.js/src/globeCoordinate.parser.js +++ b/DataValues/resources/globeCoordinate.js/src/globeCoordinate.parser.js @@ -94,10 +94,21 @@ var result = { /* -* Parses the input with a generated parser. If the parsing is successfull, +* Parses the input with a generated parser. If the parsing is successful, * returns a value explicitly or implicitly specified by the grammar from -* which the parser was generated (see |PEG.buildParser|). If the parsing is -* unsuccessful, throws |PEG.parser.SyntaxError| describing the error. +* which the parser was generated (see |PEG.buildParser|). +* +* @return { [ latitude, longitude, precision ] } +* +* @throws {PEG.parser.SyntaxError|Error} If parsing has failed for some reason. +* +* TODO: Change the return value to be an object which can be passed into the +* GlobeCoordinate constructor. +* +* TODO: Make the parser a constructor which can take options, instances then have a parse +* function and we avoid global state for parser options. +* +* TODO: Make this parser more lightweight or properly use PEG.js rather than modifying it. */ parse: function(input, startRule) { var parseFunctions = { -- To view, visit https://gerrit.wikimedia.org/r/66288 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I584fcfcdc2b46723a5b18a27d90ada7e67aea4db Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/DataValues Gerrit-Branch: master Gerrit-Owner: Daniel Werner daniel.wer...@wikimedia.de ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Apply new watch star and talk assets - change (mediawiki...MobileFrontend)
Jdlrobson has uploaded a new change for review. https://gerrit.wikimedia.org/r/66290 Change subject: Apply new watch star and talk assets .. Apply new watch star and talk assets Tweak css on talk page so label aligns with center (accounts for bubble tail) Change-Id: Ia486cb163722fe594c55451a3b1d37bf9635f602 --- M less/modules/talk.less M stylesheets/common/images/pagemenu/talk.png M stylesheets/common/images/pagemenu/watched.png M stylesheets/modules/talk.css 4 files changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/90/66290/1 diff --git a/less/modules/talk.less b/less/modules/talk.less index 50ccf59..038b02c 100644 --- a/less/modules/talk.less +++ b/less/modules/talk.less @@ -4,7 +4,7 @@ .alpha #mw-mf-page-actions #ca-talk.count a { text-indent: 0; text-align: center; - line-height: 40px; + line-height: 36px; font-weight: bold; color: #FFF; font-size: 9px; // FIXME: use pixels for time being as the icon in pixels. diff --git a/stylesheets/common/images/pagemenu/talk.png b/stylesheets/common/images/pagemenu/talk.png index 9f1d1aa..3ca37cf 100644 --- a/stylesheets/common/images/pagemenu/talk.png +++ b/stylesheets/common/images/pagemenu/talk.png Binary files differ diff --git a/stylesheets/common/images/pagemenu/watched.png b/stylesheets/common/images/pagemenu/watched.png index afde853..ff61a52 100644 --- a/stylesheets/common/images/pagemenu/watched.png +++ b/stylesheets/common/images/pagemenu/watched.png Binary files differ diff --git a/stylesheets/modules/talk.css b/stylesheets/modules/talk.css index eb7e091..5eef968 100644 --- a/stylesheets/modules/talk.css +++ b/stylesheets/modules/talk.css @@ -1,7 +1,7 @@ .alpha #mw-mf-page-actions #ca-talk.count a { text-indent: 0; text-align: center; - line-height: 40px; + line-height: 36px; font-weight: bold; color: #FFF; font-size: 9px; -- To view, visit https://gerrit.wikimedia.org/r/66290 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia486cb163722fe594c55451a3b1d37bf9635f602 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: master Gerrit-Owner: Jdlrobson jrob...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fixed trailing slash removal code. - change (mediawiki/core)
Aaron Schulz has submitted this change and it was merged. Change subject: Fixed trailing slash removal code. .. Fixed trailing slash removal code. Change-Id: I152dcec5cc8f4c417e3503f4b8fd3fdd8bc4fda5 (cherry picked from commit f8ba6474788b5382de8211909ef61564fc5c63ca) --- M maintenance/copyFileBackend.php 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Aaron Schulz: Verified; Looks good to me, approved diff --git a/maintenance/copyFileBackend.php b/maintenance/copyFileBackend.php index 1ccd121..13301ed 100644 --- a/maintenance/copyFileBackend.php +++ b/maintenance/copyFileBackend.php @@ -56,7 +56,7 @@ $src = FileBackendGroup::singleton()-get( $this-getOption( 'src' ) ); $dst = FileBackendGroup::singleton()-get( $this-getOption( 'dst' ) ); $containers = explode( '|', $this-getOption( 'containers' ) ); - $subDir = $this-getOption( rtrim( 'subdir', '/' ), '' ); + $subDir = rtrim( $this-getOption( 'subdir', '' ), '/' ); $rateFile = $this-getOption( 'ratefile' ); -- To view, visit https://gerrit.wikimedia.org/r/66284 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I152dcec5cc8f4c417e3503f4b8fd3fdd8bc4fda5 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: wmf/1.22wmf5 Gerrit-Owner: Aaron Schulz asch...@wikimedia.org Gerrit-Reviewer: Aaron Schulz asch...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fixed trailing slash removal code. - change (mediawiki/core)
Aaron Schulz has submitted this change and it was merged. Change subject: Fixed trailing slash removal code. .. Fixed trailing slash removal code. Change-Id: I152dcec5cc8f4c417e3503f4b8fd3fdd8bc4fda5 (cherry picked from commit f8ba6474788b5382de8211909ef61564fc5c63ca) --- M maintenance/copyFileBackend.php 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Aaron Schulz: Verified; Looks good to me, approved diff --git a/maintenance/copyFileBackend.php b/maintenance/copyFileBackend.php index 685c868..25753e1 100644 --- a/maintenance/copyFileBackend.php +++ b/maintenance/copyFileBackend.php @@ -56,7 +56,7 @@ $src = FileBackendGroup::singleton()-get( $this-getOption( 'src' ) ); $dst = FileBackendGroup::singleton()-get( $this-getOption( 'dst' ) ); $containers = explode( '|', $this-getOption( 'containers' ) ); - $subDir = $this-getOption( rtrim( 'subdir', '/' ), '' ); + $subDir = rtrim( $this-getOption( 'subdir', '' ), '/' ); $rateFile = $this-getOption( 'ratefile' ); -- To view, visit https://gerrit.wikimedia.org/r/66285 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I152dcec5cc8f4c417e3503f4b8fd3fdd8bc4fda5 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: wmf/1.22wmf4 Gerrit-Owner: Aaron Schulz asch...@wikimedia.org Gerrit-Reviewer: Aaron Schulz asch...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] improved a help of sql command a bit - change (operations/puppet)
coren has submitted this change and it was merged. Change subject: improved a help of sql command a bit .. improved a help of sql command a bit Change-Id: Idb74f2161647a7afcdc4e07f833f277c7d302542 --- M modules/toollabs/files/sql 1 file changed, 7 insertions(+), 2 deletions(-) Approvals: coren: Verified; Looks good to me, approved diff --git a/modules/toollabs/files/sql b/modules/toollabs/files/sql index 79a2d03..6485f64 100755 --- a/modules/toollabs/files/sql +++ b/modules/toollabs/files/sql @@ -12,15 +12,20 @@ } if [ $# -lt 1 ];then -echo Usage: sql database name|wiki name [-v] +echo Usage: \sql database name|wiki name [-vh]\ type sql --help for more help exit 0 fi if [ $1 = -h ] || [ $1 == --help ];then + echo Usage: sql database[_p] [-vh] + echo echo This tool allows you to easily open a connection to sql database without having to provide the credentials or a database host server echo Example: sql frwiki_p + echo echo Parameters: echo -v: verbose - produce various information about the resolution of db + echo + echo Report bugs to bugzilla at http://bugzilla.wikimedia.org; exit 0 fi @@ -71,7 +76,7 @@ ;; local) server=tools-db -db=mysql +db= if [ -f ~/.my.cnf ];then param= fi -- To view, visit https://gerrit.wikimedia.org/r/66262 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Idb74f2161647a7afcdc4e07f833f277c7d302542 Gerrit-PatchSet: 3 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Petrb benap...@gmail.com Gerrit-Reviewer: coren mpellet...@wikimedia.org ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Do not show empty parenthesis on log entry when no block flags - change (mediawiki/core)
Umherirrender has uploaded a new change for review. https://gerrit.wikimedia.org/r/66291 Change subject: Do not show empty parenthesis on log entry when no block flags .. Do not show empty parenthesis on log entry when no block flags When nothing is stored in the database, the explode in LogPage::formatBlockFlags will explode a empty string to a array with a empty string as only value. Avoid this by checking first for a empty string. Bug: 47035 Change-Id: I879169599a2a24b35e26d4a23ab8202f267d8b00 --- M includes/logging/LogPage.php 1 file changed, 5 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/91/66291/1 diff --git a/includes/logging/LogPage.php b/includes/logging/LogPage.php index 9d6ab25..fa2b8b2 100644 --- a/includes/logging/LogPage.php +++ b/includes/logging/LogPage.php @@ -518,7 +518,11 @@ * @return String */ public static function formatBlockFlags( $flags, $lang ) { - $flags = explode( ',', trim( $flags ) ); + $flags = trim( $flags ); + if ( $flags === '' ) { + return ''; //nothing to do + } + $flags = explode( ',', $flags ); if ( count( $flags ) 0 ) { for ( $i = 0; $i count( $flags ); $i++ ) { -- To view, visit https://gerrit.wikimedia.org/r/66291 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I879169599a2a24b35e26d4a23ab8202f267d8b00 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Umherirrender umherirrender_de...@web.de ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Story 755: Add event logging to editing - change (mediawiki...MobileFrontend)
Jdlrobson has submitted this change and it was merged. Change subject: Story 755: Add event logging to editing .. Story 755: Add event logging to editing Dependency: https://gerrit.wikimedia.org/r/65843/ Change-Id: Id63c15675d33c0c7cf1072ea48060856ac1ebeeb --- M javascripts/modules/editor/EditorOverlay.js 1 file changed, 34 insertions(+), 0 deletions(-) Approvals: Ori.livneh: Looks good to me, approved Jdlrobson: Verified; Looks good to me, approved diff --git a/javascripts/modules/editor/EditorOverlay.js b/javascripts/modules/editor/EditorOverlay.js index 7130f67..936679b 100644 --- a/javascripts/modules/editor/EditorOverlay.js +++ b/javascripts/modules/editor/EditorOverlay.js @@ -19,6 +19,23 @@ template: M.template.get( 'overlays/editor' ), className: 'mw-mf-overlay editor-overlay', + log: function( action, errorText ) { + var + data = { + token: M.getSessionId(), + action: action, + section: this.sectionId, + pageId: mw.config.get( 'wgArticleId' ), + username: mw.config.get( 'wgUserName' ), + mobileMode: mw.config.get( 'wgMFMode' ), + userAgent: window.navigator.userAgent + }; + if ( errorText ) { + data.errorText = errorText; + } + M.log( 'MobileWebEditing', data ); + }, + initialize: function( options ) { var self = this; this._super( options ); @@ -38,17 +55,25 @@ this.$prev = this.$( '.prev-section' ). on( 'click', function() { self._loadSection( self.sectionId - 1 ); + self.log( 'sectionPrevious' ); } ); this.$next = this.$( '.next-section' ). on( 'click', function() { self._loadSection( self.sectionId + 1 ); + self.log( 'sectionNext' ); } ); this.$( '.save' ).on( 'click', function() { + // log save button click + self.log( 'save' ); self.$( '.count' ).text( mw.msg( 'mobile-frontend-editor-section-count', self.api.getStagedCount() ) ); self.$( '.initial-bar' ).hide(); self.$( '.confirm-bar' ).show(); } ); this.$( '.confirm-save' ).on( 'click', $.proxy( this, '_save' ) ); + this.$( '.cancel' ).on( 'click', function() { + // log cancel attempt + self.log( 'cancel' ); + } ); // This is used to avoid position: fixed weirdness in mobile Safari when // the keyboard is visible @@ -63,6 +88,8 @@ } this._loadSection( options.section ); + // log section edit attempt + self.log( 'attempt' ); }, hide: function() { @@ -110,17 +137,22 @@ } else { popup.show( mw.msg( 'mobile-frontend-editor-error-loading' ), 'toast error' ); } + // log error that occurred in retrieving section + self.log( 'error', error ); } ); }, _save: function() { var self = this; + self.log( 'submit' ); this.$( '.confirm-bar' ).hide(); this.$( '.saving-bar' ).show(); this.api.save(). done( function() { + // log success! + self.log( 'success' ); self.hide(); popup.show( mw.msg( 'mobile-frontend-editor-success' ) + ' ' + mw.msg( 'mobile-frontend-editor-refresh' ), @@ -139,6 +171,8 @@ popup.show( msg, 'toast error' );
[MediaWiki-commits] [Gerrit] updated rmtool to latest version - change (labs/toollabs)
Petrb has uploaded a new change for review. https://gerrit.wikimedia.org/r/66293 Change subject: updated rmtool to latest version .. updated rmtool to latest version Change-Id: I9e752512bc319b5ee8b5a8fd9c79a04112b8b10d --- M bin/rmtool 1 file changed, 60 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/labs/toollabs refs/changes/93/66293/1 diff --git a/bin/rmtool b/bin/rmtool index 7dada4a..e6849a1 100755 --- a/bin/rmtool +++ b/bin/rmtool @@ -10,8 +10,24 @@ exit 1 fi +echo Don't forget to remove the entry in ldap first!! Once the record is removed, continue +read p + tool=$1 +toolpath=/data/project/$tool dbuser=`echo $1 | sed 's/-//'` +original_dbuser=$dbuser +dbuser2=null +if [ -f $toolpath/replica.my.cnf ];then +dbuser2=$(sed -n -e /user='\(.*\)'/{;s//\1/;p;} $toolpath/replica.my.cnf) +fi +using_replica_only=0 + +if [ ! -f $toolpath/.my.cnf ] [ -f $toolpath/replica.my.cnf ];then + echo Warning: user replica user only! + using_replica_only=1 + dbuser=$dbuser2 +fi # get a number of users of this name in mysql uc=`echo select user from user; | mysql mysql | grep -cE ^$dbuser'$'` @@ -19,16 +35,48 @@ echo There is $uc user accounts of name $dbuser in database if [ $uc -gt 0 ];then +echo I will now remove the db access, this can\'t be reverted, hit enter to continue +read p echo Removing db access of $tool echo drop user $dbuser; | mysql mysql fi +if [ -f /var/spool/cron/crontabs/local-$tool ];then + echo Attempting to clear the cron + rm /var/spool/cron/crontabs/local-$tool +fi + # get the number of databases for this user -db=`echo show databases; | mysql mysql | grep -cE ^$dbuser'$'` +db=`echo show databases; | mysql mysql | grep -cE ^$tool'$'` + db2=`echo show databases; | mysql mysql | grep -cE ^$dbuser__` echo There is $db databases of name $tool in database +echo There is $db2 databases prefixed with $dbuser in database -if [ $db -gt 0 ];then +if [ $db2 -gt 0 ];then + # backup all databases + list=`echo show databases; | mysql mysql | grep -E ^$dbuser__` + for database in `echo $list` + do + echo Backing up database $database + if [ -f $toolpath/$database_backup.sql ];then + echo Error, there is already a backup file for this db, process with manual backup and hit enter + read p + else + mysqldump $database $toolpath/$database_backup.sql +echo Removing the database $database + echo drop database $database; | mysql mysql + fi + done +fi + + +if [ $db -gt 1 ];then + echo Warning there are more than 1 databases for this user, please proceed with manual backup and hit enter to continue + read p +else + + if [ $db -gt 0 ];then echo Creating a backup of database $tool if [ -f /data/project/$tool/database_backup.sql ];then echo Error there is already a backup file @@ -41,6 +89,7 @@ mysqldump $dbuser /data/project/$tool/database_backup.sql echo Removing db access of $tool echo drop database $dbuser; | mysql mysql + fi fi if [ ! -d /data/project/removed_tools ];then @@ -60,6 +109,11 @@ else cd /data/project/removed_tools tar -zcvf $tool.tar.gz $tool + chmod 600 $tool.tar.gz + if [ -f /data/project/removed_tools/$tool.tar.gz ];then + echo Deleting project folder + rm -rf /data/project/removed_tools/$tool + fi fi fi @@ -84,6 +138,8 @@ rm /data/project/.system/webservers.lock -echo All data for $tool were cleaned -exit 0 +if [ -f /data/project/.system/cache/localdb-$tool ];then + rm /data/project/.system/cache/localdb-$tool +fi +echo All data for $tool were cleaned -- To view, visit https://gerrit.wikimedia.org/r/66293 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9e752512bc319b5ee8b5a8fd9c79a04112b8b10d Gerrit-PatchSet: 1 Gerrit-Project: labs/toollabs Gerrit-Branch: master Gerrit-Owner: Petrb benap...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] inserted sql tool - change (labs/toollabs)
Petrb has uploaded a new change for review. https://gerrit.wikimedia.org/r/66292 Change subject: inserted sql tool .. inserted sql tool Change-Id: I24101234ab09693e66348ac6f29413ac9b1d4532 --- A bin/sql 1 file changed, 91 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/labs/toollabs refs/changes/92/66292/1 diff --git a/bin/sql b/bin/sql new file mode 100755 index 000..3c6b7be --- /dev/null +++ b/bin/sql @@ -0,0 +1,91 @@ +#!/bin/bash + +# this tool allow you to connect quickly to sql database +# it should work for all newbies + + +if [ $# -lt 1 ];then +echo Usage: sql database name|wiki name +exit 0 +fi + +if [ $1 = -h ] || [ $1 == --help ];then + echo This tool allows you to easily open a connection to sql database without having to provide the credentials or a database host server + echo Example: sql frwiki_p + exit 0 +fi + +if [ ! -f ~/replica.my.cnf ] [ ! -f ~/.my.cnf ] +then + echo WARNING: There is no configuration file for mysql to use, you will probably be unable to access the database +fi + +list=/usr/share/dblist + +param= +# check if the user has a replica file +if [ -f ~/replica.my.cnf ];then +param= --defaults-file=~/replica.my.cnf +else +if [ ! -f ~/.my.cnf ];then +param= -p +fi +fi + +server=enwiki.labsdb +db=enwiki_p + +case $1 in +en | enwiki_p) +server=enwiki.labsdb +db=enwiki_p +;; +de | dewiki_p) +server=dewiki.labsdb +db=dewiki_p +;; +fr | frwiki_p) +server=frwiki.labsdb +db=frwiki_p +;; +cs | cswiki_p) +server=cswiki.labsdb +db=cswiki_p +;; +local) +server=tools-db +db=mysql +if [ -f ~/.my.cnf ];then + param= +fi + ;; + commonswiki_p | commons) + server=commonswiki.labsdb + db=commonswiki_p + ;; + *) + # we don't know what the database is so we check if it exist first + echo This database name is not known by sql script, fallback to dblist resolution + # lookup from hosts + if [ `echo $1 | grep -cE '_p$'` -lt 1 ];then +echo Invalid database name, recursive attempt suffixing _p... +if (sql $1_p ${*:2});then +exit 0 +fi + echo Make sure to ask for a db in format of wiki_p +exit 1 + fi + db=$1 + server=`echo $1 | sed 's/_p//' | sed 's/$/.labsdb/'` + if [ `cat /etc/hosts | grep -cE \s$server` -gt 0 ] + then + echo Resolved to $server $db + else + echo This is unknown db to me, if you don't like, blame petan on freenode + exit 1 + fi + ;; +esac + +echo Connecting to $server +mysql $param -h $server $db ${*:2} -- To view, visit https://gerrit.wikimedia.org/r/66292 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I24101234ab09693e66348ac6f29413ac9b1d4532 Gerrit-PatchSet: 1 Gerrit-Project: labs/toollabs Gerrit-Branch: master Gerrit-Owner: Petrb benap...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits