[MediaWiki-commits] [Gerrit] Encode URL parameter - change (mediawiki...UniversalLanguageSelector)
Gerrit Patch Uploader has uploaded a new change for review. https://gerrit.wikimedia.org/r/108660 Change subject: Encode URL parameter .. Encode URL parameter Change-Id: I2eaf564b35624c8441cb8f54f6ab166f5d1762a2 --- M resources/js/ext.uls.i18n.js 1 file changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UniversalLanguageSelector refs/changes/60/108660/1 diff --git a/resources/js/ext.uls.i18n.js b/resources/js/ext.uls.i18n.js index 50f7f9f..27f082e 100644 --- a/resources/js/ext.uls.i18n.js +++ b/resources/js/ext.uls.i18n.js @@ -53,7 +53,10 @@ return $.Deferred().resolve(); } return i18n.load( - mw.util.wikiScript( 'api' ) + '?action=ulslocalization&language=' + locale, + mw.util.wikiScript( 'api' ) + '?' + $.param( { + action: 'ulslocalization', + language: locale + } ), locale ); }; -- To view, visit https://gerrit.wikimedia.org/r/108660 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2eaf564b35624c8441cb8f54f6ab166f5d1762a2 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/UniversalLanguageSelector Gerrit-Branch: master Gerrit-Owner: Gerrit Patch Uploader ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Update to submodules and make script - change (mediawiki...ocg-collection)
Mwalker has submitted this change and it was merged. Change subject: Update to submodules and make script .. Update to submodules and make script Change-Id: I650c0d8b23d67b22cfb5b5b49ac3f9171b754ed0 --- M make.sh M mw-ocg-bundler M mw-ocg-latexer 3 files changed, 1 insertion(+), 1 deletion(-) Approvals: Mwalker: Verified; Looks good to me, approved diff --git a/make.sh b/make.sh index 8556bc9..5462176 100755 --- a/make.sh +++ b/make.sh @@ -4,7 +4,7 @@ SCRIPTPATH=`dirname $(readlink -f ./make.sh)` mkdir -p node_modules -for f in ./mw-ocg* +for f in ./mw-ocg*/ do ln -s $SCRIPTPATH/node_modules $f/node_modules cd $f diff --git a/mw-ocg-bundler b/mw-ocg-bundler index af1f702..63a704a 16 --- a/mw-ocg-bundler +++ b/mw-ocg-bundler -Subproject commit af1f702aa134b00e4bbd5f46f703d2fb0e384163 +Subproject commit 63a704a34e7ca2fc31ec436bc6bff90a99b4cb43 diff --git a/mw-ocg-latexer b/mw-ocg-latexer index 36189d8..bc6e6cb 16 --- a/mw-ocg-latexer +++ b/mw-ocg-latexer -Subproject commit 36189d857853e6400209618bafd62d4fda0ebd3e +Subproject commit bc6e6cb136cc788cdb1f11a0a7991a496ab6ceac -- To view, visit https://gerrit.wikimedia.org/r/108659 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I650c0d8b23d67b22cfb5b5b49ac3f9171b754ed0 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/services/ocg-collection Gerrit-Branch: master Gerrit-Owner: Mwalker Gerrit-Reviewer: Mwalker ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Update to submodules and make script - change (mediawiki...ocg-collection)
Mwalker has uploaded a new change for review. https://gerrit.wikimedia.org/r/108659 Change subject: Update to submodules and make script .. Update to submodules and make script Change-Id: I650c0d8b23d67b22cfb5b5b49ac3f9171b754ed0 --- M make.sh M mw-ocg-bundler M mw-ocg-latexer 3 files changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/ocg-collection refs/changes/59/108659/1 diff --git a/make.sh b/make.sh index 8556bc9..5462176 100755 --- a/make.sh +++ b/make.sh @@ -4,7 +4,7 @@ SCRIPTPATH=`dirname $(readlink -f ./make.sh)` mkdir -p node_modules -for f in ./mw-ocg* +for f in ./mw-ocg*/ do ln -s $SCRIPTPATH/node_modules $f/node_modules cd $f diff --git a/mw-ocg-bundler b/mw-ocg-bundler index af1f702..63a704a 16 --- a/mw-ocg-bundler +++ b/mw-ocg-bundler -Subproject commit af1f702aa134b00e4bbd5f46f703d2fb0e384163 +Subproject commit 63a704a34e7ca2fc31ec436bc6bff90a99b4cb43 diff --git a/mw-ocg-latexer b/mw-ocg-latexer index 36189d8..bc6e6cb 16 --- a/mw-ocg-latexer +++ b/mw-ocg-latexer -Subproject commit 36189d857853e6400209618bafd62d4fda0ebd3e +Subproject commit bc6e6cb136cc788cdb1f11a0a7991a496ab6ceac -- To view, visit https://gerrit.wikimedia.org/r/108659 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I650c0d8b23d67b22cfb5b5b49ac3f9171b754ed0 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/services/ocg-collection Gerrit-Branch: master Gerrit-Owner: Mwalker ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Adding owner and group parameters to git::clone - change (mediawiki/vagrant)
Ori.livneh has submitted this change and it was merged. Change subject: Adding owner and group parameters to git::clone .. Adding owner and group parameters to git::clone Change-Id: I67c5f8e924c615e7d0308e08c003b3e42bccd4c9 --- M puppet/modules/git/manifests/clone.pp 1 file changed, 4 insertions(+), 1 deletion(-) Approvals: Ori.livneh: Looks good to me, approved jenkins-bot: Verified diff --git a/puppet/modules/git/manifests/clone.pp b/puppet/modules/git/manifests/clone.pp index e1d5036..8f3e97f 100644 --- a/puppet/modules/git/manifests/clone.pp +++ b/puppet/modules/git/manifests/clone.pp @@ -27,6 +27,8 @@ $directory, $branch = 'master', $remote = undef, +$owner = 'vagrant', +$group = 'vagrant', ) { include git @@ -39,7 +41,8 @@ command => "git clone --recursive --branch ${branch} ${url} ${directory}", creates => "${directory}/.git", require => Package['git'], -user=> 'vagrant', +user=> $owner, +group => $group, environment => 'HOME=/home/vagrant', timeout => 0, } -- To view, visit https://gerrit.wikimedia.org/r/108538 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I67c5f8e924c615e7d0308e08c003b3e42bccd4c9 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/vagrant Gerrit-Branch: master Gerrit-Owner: Ottomata Gerrit-Reviewer: Ori.livneh Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Have TMH load MwEmbedSupport modules when needed - change (mediawiki...TimedMediaHandler)
Ori.livneh has uploaded a new change for review. https://gerrit.wikimedia.org/r/108658 Change subject: Have TMH load MwEmbedSupport modules when needed .. Have TMH load MwEmbedSupport modules when needed - Factor out check for pages that should include TMH modules to a standalone method, TimedMediaHandlerHooks::modulesRequired. - Move MwEmbedSupport's ResourceLoaderGetStartupModules handler to TMH. - MwEmbedSupport still declares the modules, but it is up to dependent extensions to inject them into the page. Change-Id: I94c3c9b53a50a3c53bf3763e26809fe0e56a60ee --- M TimedMediaHandler.hooks.php 1 file changed, 49 insertions(+), 18 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TimedMediaHandler refs/changes/58/108658/1 diff --git a/TimedMediaHandler.hooks.php b/TimedMediaHandler.hooks.php index 20ee06d..13408d7 100644 --- a/TimedMediaHandler.hooks.php +++ b/TimedMediaHandler.hooks.php @@ -108,6 +108,9 @@ // (Special:Upload, for example, when there is an "existing file" warning.) $wgHooks['BeforePageDisplay'][] = 'TimedMediaHandlerHooks::pageOutputHook'; + // Add MwEmbedSupport modules to startup + $wgHooks['ResourceLoaderGetStartupModules'][] = 'TimedMediaHandlerHooks::onResourceLoaderGetStartupModules'; + // Make sure modules are loaded on image pages that don't have a media file in the wikitext. $wgHooks['ImageOpenShowImageInlineBefore'][] = 'TimedMediaHandlerHooks::onImageOpenShowImageInlineBefore'; @@ -358,6 +361,32 @@ } /** +* Check if TimedMediaHandler CSS and JS support are needed for the +* current page. +* +* @return bool +*/ + static function modulesRequired() { + global $wgTitle; + + $namespace = $wgTitle->getNamespace(); + + if ( $namespace === NS_CATEGORY || $namespace === NS_TIMEDTEXT ) { + return true; + } + + if ( $wgTitle->isSpecialPage() ) { + list( $name, /* subpage */ ) = SpecialPageFactory::resolveAlias( $wgTitle->getDBkey() ); + if ( stripos( $name, 'file' ) !== false || stripos( $name, 'image' ) !== false + || $name === 'Search' || $name === 'GlobalUsage' ) { + return true; + } + } + + return false; + } + + /** * Add JavaScript and CSS for special pages that may include timed media * but which will not fire the parser hook. * @@ -369,30 +398,32 @@ * @return bool */ static function pageOutputHook( &$out, &$sk ){ - $title = $out->getTitle(); - $namespace = $title->getNamespace(); - $addModules = false; - - if ( $namespace === NS_CATEGORY || $namespace === NS_TIMEDTEXT ) { - $addModules = true; - } - - if ( $title->isSpecialPage() ) { - list( $name, /* subpage */ ) = SpecialPageFactory::resolveAlias( $title->getDBkey() ); - if ( stripos( $name, 'file' ) !== false || stripos( $name, 'image' ) !== false - || $name === 'Search' || $name === 'GlobalUsage' ) { - $addModules = true; - } - } - - if ( $addModules ) { - $out->addModules( 'mw.PopUpMediaTransform' ); + if ( self::modulesRequired() ) { + $out->addModules( array( 'mw.MwEmbedSupport.style', 'mw.PopUpMediaTransform' ) ); $out->addModuleStyles( 'mw.PopUpMediaTransform' ); } return true; } + /** +* Add MwEmbedSupport modules to startup, if needed. +* @param $modules +* @return bool +*/ + static function onResourceLoaderGetStartupModules( &$modules ) { + if ( self::modulesRequired() ) { + $modules += array( + 'jquery.triggerQueueCallback', + 'Spinner', + 'jquery.loadingSpinner', + 'jquery.mwEmbedUtil', + 'mw.MwEmbedSupport', + ); + } + return true; + } + public static function checkSchemaUpdates( DatabaseUpdater $updater ) { $base = __DIR__ ; -- To view, visit https://gerrit.wikimedia.org/r/108658 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I94c3c9b53a50a3c53bf3763e26809fe0e56a60e
[MediaWiki-commits] [Gerrit] maintenance folder for helper scripts (comming soon...) - change (pywikibot/core)
Alex S.H. Lin has submitted this change and it was merged. Change subject: maintenance folder for helper scripts (comming soon...) .. maintenance folder for helper scripts (comming soon...) Change-Id: I21a2d2d44978986c1dd8886a557fa04a46053ce8 --- A scripts/maintenance/README 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Alex S.H. Lin: Verified; Looks good to me, approved diff --git a/scripts/maintenance/README b/scripts/maintenance/README new file mode 100644 index 000..09c332f --- /dev/null +++ b/scripts/maintenance/README @@ -0,0 +1,2 @@ +This directory/folder is reserved for maintaining scripts and helper scripts +only. -- To view, visit https://gerrit.wikimedia.org/r/108212 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I21a2d2d44978986c1dd8886a557fa04a46053ce8 Gerrit-PatchSet: 4 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: Xqt Gerrit-Reviewer: Alex S.H. Lin Gerrit-Reviewer: Ladsgroup Gerrit-Reviewer: Merlijn van Deen Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] remove unused local list, self.alphabetic from family.py doe... - change (pywikibot/compat)
Alex S.H. Lin has submitted this change and it was merged. Change subject: remove unused local list, self.alphabetic from family.py does the job .. remove unused local list, self.alphabetic from family.py does the job Change-Id: Id92e2c0e894efaf7dbdf33cf19238e1f81339aac --- M families/battlestarwiki_family.py 1 file changed, 0 insertions(+), 7 deletions(-) Approvals: Alex S.H. Lin: Verified; Looks good to me, approved diff --git a/families/battlestarwiki_family.py b/families/battlestarwiki_family.py index 46f601d..229dfff 100644 --- a/families/battlestarwiki_family.py +++ b/families/battlestarwiki_family.py @@ -57,13 +57,6 @@ '_default': u'Podcast talk', } -# A few selected big languages for things that we do not want to loop over -# all languages. This is only needed by the titletranslate.py module, so -# if you carefully avoid the options, you could get away without these -# for another wiki family. - -alphabetic = ['de', 'en', 'es', 'fr', 'tr', 'zh'] - def hostname(self, code): return '%s.battlestarwiki.org' % code -- To view, visit https://gerrit.wikimedia.org/r/108657 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id92e2c0e894efaf7dbdf33cf19238e1f81339aac Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/compat Gerrit-Branch: master Gerrit-Owner: Xqt Gerrit-Reviewer: Alex S.H. Lin Gerrit-Reviewer: Ladsgroup Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] remove unused local list, self.alphabetic from family.py doe... - change (pywikibot/compat)
Xqt has uploaded a new change for review. https://gerrit.wikimedia.org/r/108657 Change subject: remove unused local list, self.alphabetic from family.py does the job .. remove unused local list, self.alphabetic from family.py does the job Change-Id: Id92e2c0e894efaf7dbdf33cf19238e1f81339aac --- M families/battlestarwiki_family.py 1 file changed, 0 insertions(+), 7 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/compat refs/changes/57/108657/1 diff --git a/families/battlestarwiki_family.py b/families/battlestarwiki_family.py index 46f601d..229dfff 100644 --- a/families/battlestarwiki_family.py +++ b/families/battlestarwiki_family.py @@ -57,13 +57,6 @@ '_default': u'Podcast talk', } -# A few selected big languages for things that we do not want to loop over -# all languages. This is only needed by the titletranslate.py module, so -# if you carefully avoid the options, you could get away without these -# for another wiki family. - -alphabetic = ['de', 'en', 'es', 'fr', 'tr', 'zh'] - def hostname(self, code): return '%s.battlestarwiki.org' % code -- To view, visit https://gerrit.wikimedia.org/r/108657 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id92e2c0e894efaf7dbdf33cf19238e1f81339aac Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/compat Gerrit-Branch: master Gerrit-Owner: Xqt ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] remove unused local list, self.alphabetic from family.py doe... - change (pywikibot/core)
Xqt has uploaded a new change for review. https://gerrit.wikimedia.org/r/108656 Change subject: remove unused local list, self.alphabetic from family.py does the job .. remove unused local list, self.alphabetic from family.py does the job Change-Id: Ia2bfa2fdaaab49efe8827f623b9b23aad59603ff --- M pywikibot/families/battlestarwiki_family.py 1 file changed, 0 insertions(+), 7 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/56/108656/1 diff --git a/pywikibot/families/battlestarwiki_family.py b/pywikibot/families/battlestarwiki_family.py index c77dc47..3935367 100644 --- a/pywikibot/families/battlestarwiki_family.py +++ b/pywikibot/families/battlestarwiki_family.py @@ -16,13 +16,6 @@ for lang in self.languages_by_size: self.langs[lang] = '%s.battlestarwiki.org' % lang -# A few selected big languages for things that we do not want to loop over -# all languages. This is only needed by the titletranslate.py module, so -# if you carefully avoid the options, you could get away without these -# for another wiki family. - -alphabetic = ['de', 'en', 'es', 'fr', 'tr', 'zh'] - def hostname(self, code): return '%s.battlestarwiki.org' % code -- To view, visit https://gerrit.wikimedia.org/r/108656 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia2bfa2fdaaab49efe8827f623b9b23aad59603ff Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: Xqt ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] When complaining about mount failures, include hostname! - change (operations/puppet)
Andrew Bogott has uploaded a new change for review. https://gerrit.wikimedia.org/r/108655 Change subject: When complaining about mount failures, include hostname! .. When complaining about mount failures, include hostname! Change-Id: Ia9ff39ad4e4355fffa340b790d4bb49b8efc --- M modules/ldap/files/scripts/manage-exports M modules/ldap/files/scripts/manage-keys 2 files changed, 6 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/55/108655/1 diff --git a/modules/ldap/files/scripts/manage-exports b/modules/ldap/files/scripts/manage-exports index 381bfe9..eb54f87 100755 --- a/modules/ldap/files/scripts/manage-exports +++ b/modules/ldap/files/scripts/manage-exports @@ -10,6 +10,7 @@ import traceback import ldapsupportlib import os +import socket import homedirectorymanager import datetime from optparse import OptionParser @@ -30,6 +31,7 @@ self.keysdir = "/mnt/keys/" self.loglevel = INFO self.logfile = None +self.hostname = socket.gethostname() def run(self): parser = OptionParser(conflict_handler="resolve") @@ -66,7 +68,7 @@ if not os.path.ismount(self.keysdir): os.system("mount -t glusterfs labstore2.pmtpa.wmnet:/keys %s" % self.keysdir) if not os.path.ismount(self.keysdir): -self.log("Failed to mount the key volume %s" % self.keysdir) +self.log("%s failed to mount the key volume %s" % (self.hostname, self.keysdir)) raise Exception('mount failure') if not os.path.exists(self.keysdir + '/autofs_check'): os.mkdir(self.keysdir + '/autofs_check', 0755) diff --git a/modules/ldap/files/scripts/manage-keys b/modules/ldap/files/scripts/manage-keys index a2eac46..8135133 100755 --- a/modules/ldap/files/scripts/manage-keys +++ b/modules/ldap/files/scripts/manage-keys @@ -10,6 +10,7 @@ import traceback import ldapsupportlib import os +import socket import homedirectorymanager import datetime from optparse import OptionParser @@ -30,6 +31,7 @@ self.keysdir = "/mnt/keys/" self.loglevel = INFO self.logfile = None +self.hostname = socket.gethostname() def run(self): parser = OptionParser(conflict_handler="resolve") @@ -66,7 +68,7 @@ if not os.path.ismount(self.keysdir): os.system("mount -t glusterfs labstore2.pmtpa.wmnet:/keys %s" % self.keysdir) if not os.path.ismount(self.keysdir): -self.log("Failed to mount the key volume %s" % self.keysdir) +self.log("%s failed to mount the key volume %s" % (self.hostname, self.keysdir)) raise Exception('mount failure') if not os.path.exists(self.keysdir + '/autofs_check'): os.mkdir(self.keysdir + '/autofs_check', 0755) -- To view, visit https://gerrit.wikimedia.org/r/108655 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia9ff39ad4e4355fffa340b790d4bb49b8efc Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Andrew Bogott ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Point the managehome chatbot to #wikimedia-labs-icinga - change (operations/puppet)
Andrew Bogott has uploaded a new change for review. https://gerrit.wikimedia.org/r/108654 Change subject: Point the managehome chatbot to #wikimedia-labs-icinga .. Point the managehome chatbot to #wikimedia-labs-icinga Change-Id: I257a682f287516fd43ecedc842bf4a39fe824b69 --- M modules/ldap/manifests/client.pp 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/54/108654/1 diff --git a/modules/ldap/manifests/client.pp b/modules/ldap/manifests/client.pp index 5afe9bb..e365c92 100644 --- a/modules/ldap/manifests/client.pp +++ b/modules/ldap/manifests/client.pp @@ -355,7 +355,7 @@ if $realm == 'labs' { if $managehome { -$ircecho_logs = { "/var/log/manage-exports.log" => "#wikimedia-labs" } +$ircecho_logs = { "/var/log/manage-exports.log" => "#wikimedia-labs-nagios" } $ircecho_nick = "labs-home-wm" $ircecho_server = "chat.freenode.net" include role::echoirc -- To view, visit https://gerrit.wikimedia.org/r/108654 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I257a682f287516fd43ecedc842bf4a39fe824b69 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Andrew Bogott ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] logstash: Updates for udp2log filtering - change (operations/puppet)
Ori.livneh has submitted this change and it was merged. Change subject: logstash: Updates for udp2log filtering .. logstash: Updates for udp2log filtering * Add Bug58676 * Add CirrusSearch-failed * Add CirrusSearch-slow * Remove CirrusSearch * Clean up apache2 logs ** Strip leading whitespace from message ** Discard "last message repeated" lines ** Extract message severity from message * Fix scholarships parsing ** Tag for indexing by elasticsearch ** Parse the timestamp provided in the json data Change-Id: I6d3b6305aeea3a5590595ea44dadac8bb5357fb6 --- M files/logstash/filter-mw-via-udp2log.conf 1 file changed, 29 insertions(+), 4 deletions(-) Approvals: Ori.livneh: Verified; Looks good to me, approved diff --git a/files/logstash/filter-mw-via-udp2log.conf b/files/logstash/filter-mw-via-udp2log.conf index c351ce2..6e94268 100644 --- a/files/logstash/filter-mw-via-udp2log.conf +++ b/files/logstash/filter-mw-via-udp2log.conf @@ -46,9 +46,11 @@ "badpass", "bug46577", "Bug54847", + "Bug58676", "captcha", "centralauth", - "CirrusSearch", + "CirrusSearch-failed", + "CirrusSearch-slow", "dbperformance", "dnsblacklist", "exception", @@ -113,19 +115,37 @@ grok { match => [ "message", - "^(?%{MONTH} %{MONTHDAY} %{TIME}) %{NOTSPACE:host}: %{GREEDYDATA:message}$" + "^(?%{MONTH} %{MONTHDAY} %{TIME}) %{NOTSPACE:host}:%{SPACE}%{GREEDYDATA:message}$" ] overwrite => [ "host", "message" ] named_captures_only => true add_tag => [ "es" ] } - + # Discard last message repeated messages + grep { +match => [ + "message", + "last message repeated \d+ times$" +] +negate => true + } if !("_grokparsefailure" in [tags]) { # Use the parsed timestamp as canonical for the event date { match => [ "logdate", "MMM dd HH:mm:ss" ] remove_field => [ "logdate" ] add_tag => [ "logdate" ] +} +# Capture message severity +grok { + match => [ +"message", +"^\[%{WORD:level}\] \[%{WORD} %{IP:clientip}\] " + ] + match => [ +"message", +"^PHP %{WORD:level}: " + ] } } } # end [type] == "apache2" @@ -239,7 +259,12 @@ # Parse message as json and put elements in event json { source => "message" -add_tag => [ "json" ] +add_tag => [ "json", "es" ] + } + # Use the parsed timestamp as canonical for the event + date { +match => [ "@timestamp", "-MM-dd'T'HH:mm:ss.SSZZ" ] +add_tag => [ "logdate" ] } } # end [type] == "scholarships" -- To view, visit https://gerrit.wikimedia.org/r/108533 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6d3b6305aeea3a5590595ea44dadac8bb5357fb6 Gerrit-PatchSet: 2 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: BryanDavis Gerrit-Reviewer: Aaron Schulz Gerrit-Reviewer: Ori.livneh Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove unnecessary debug logging - change (mediawiki...TranslationNotifications)
jenkins-bot has submitted this change and it was merged. Change subject: Remove unnecessary debug logging .. Remove unnecessary debug logging This was useful while developing, but not any more. Change-Id: Id144cc44b9e517bae56fd30db63d96b522d2cb1e --- M TranslationNotificationJob.php 1 file changed, 0 insertions(+), 8 deletions(-) Approvals: KartikMistry: Looks good to me, approved jenkins-bot: Verified diff --git a/TranslationNotificationJob.php b/TranslationNotificationJob.php index b2d42e7..82352f9 100644 --- a/TranslationNotificationJob.php +++ b/TranslationNotificationJob.php @@ -87,8 +87,6 @@ // API: Get login token - wfDebug( "publishInOtherWiki API: Get login token\n" ); - $loginUrl = wfAppendQuery( $otherWikiBaseUrl, array( 'action' => 'login', 'format' => 'json', @@ -121,8 +119,6 @@ // API: Do the login - wfDebug( "publishInOtherWiki API: Do the login\n" ); - $loginRequest = MWHttpRequest::factory( $loginUrl, array( @@ -146,8 +142,6 @@ } // API: Get an edit token - - wfDebug( "publishInOtherWiki API: Get an edit token\n" ); $userTalkPage = $this->title->getFullText(); $editTokenUrl = wfAppendQuery( $otherWikiBaseUrl, array( @@ -180,8 +174,6 @@ } // API: Edit the talk page - - wfDebug( "publishInOtherWiki API: Edit the talk page\n" ); $editUrl = wfAppendQuery( $otherWikiBaseUrl, array( 'action' => 'edit', -- To view, visit https://gerrit.wikimedia.org/r/108540 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id144cc44b9e517bae56fd30db63d96b522d2cb1e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/TranslationNotifications Gerrit-Branch: master Gerrit-Owner: Amire80 Gerrit-Reviewer: KartikMistry Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Use RecentChanges::save to add RC rows - change (mediawiki...Flow)
Legoktm has uploaded a new change for review. https://gerrit.wikimedia.org/r/108653 Change subject: Use RecentChanges::save to add RC rows .. Use RecentChanges::save to add RC rows Will send Flow actions to RC feeds and extensions like CheckUser Bug: 60275 Change-Id: Ie248485ed28538e01e898afc62395ed9a2b8aed3 --- M includes/Data/RecentChanges.php 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow refs/changes/53/108653/1 diff --git a/includes/Data/RecentChanges.php b/includes/Data/RecentChanges.php index 5c43ee2..021b764 100644 --- a/includes/Data/RecentChanges.php +++ b/includes/Data/RecentChanges.php @@ -7,6 +7,7 @@ use Flow\Model\Workflow; use Flow\Repository\TreeRepository; use Language; +use RecentChange; abstract class RecentChanges implements LifecycleHandler { @@ -51,7 +52,6 @@ * @param Workflow $workflow * @param $timestamp * @param array $changes -* @return bool */ protected function insert( $action, $block, $revisionType, $revisionId, array $row, Workflow $workflow, $timestamp, array $changes ) { if ( $timestamp instanceof UUID ) { @@ -89,8 +89,8 @@ 'rc_cur_time' => $timestamp, ); - $dbw = wfGetDB( DB_MASTER ); - return $dbw->insert( 'recentchanges', $attribs, __METHOD__ ); + $rc = RecentChange::newFromRow( (object)$attribs ); + $rc->save(); // Insert into db and send to RC feeds } } -- To view, visit https://gerrit.wikimedia.org/r/108653 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie248485ed28538e01e898afc62395ed9a2b8aed3 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Flow Gerrit-Branch: master Gerrit-Owner: Legoktm ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Update TimedMediaHandler for I7a6da6c62 - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: Update TimedMediaHandler for I7a6da6c62 .. Update TimedMediaHandler for I7a6da6c62 Change-Id: Ic9102976d50fbc84dd0f4151551ec96d0e331a34 --- M extensions/TimedMediaHandler 1 file changed, 0 insertions(+), 0 deletions(-) Approvals: Ori.livneh: Looks good to me, approved jenkins-bot: Verified diff --git a/extensions/TimedMediaHandler b/extensions/TimedMediaHandler index 1378723..c672d43 16 --- a/extensions/TimedMediaHandler +++ b/extensions/TimedMediaHandler -Subproject commit 13787238b5bfa11b3ea1ddf698a2c642eae6b241 +Subproject commit c672d432d9700d22cb0d785d5b69ab065fb5289b -- To view, visit https://gerrit.wikimedia.org/r/108652 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic9102976d50fbc84dd0f4151551ec96d0e331a34 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: wmf/1.23wmf10 Gerrit-Owner: Ori.livneh Gerrit-Reviewer: Ori.livneh Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Update TimedMediaHandler for I7a6da6c62 - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: Update TimedMediaHandler for I7a6da6c62 .. Update TimedMediaHandler for I7a6da6c62 Change-Id: I0380c743928d8a89097f06caf402c039429bcfa1 --- M extensions/TimedMediaHandler 1 file changed, 0 insertions(+), 0 deletions(-) Approvals: Ori.livneh: Looks good to me, approved jenkins-bot: Verified diff --git a/extensions/TimedMediaHandler b/extensions/TimedMediaHandler index 317d5b6..8d7e633 16 --- a/extensions/TimedMediaHandler +++ b/extensions/TimedMediaHandler -Subproject commit 317d5b608943a61586ad4a921eba798d7f40e3f7 +Subproject commit 8d7e6331962be28c1ee11c22fbd15d2471431686 -- To view, visit https://gerrit.wikimedia.org/r/108651 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0380c743928d8a89097f06caf402c039429bcfa1 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/core Gerrit-Branch: wmf/1.23wmf11 Gerrit-Owner: Ori.livneh Gerrit-Reviewer: Ori.livneh Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Update TimedMediaHandler for I7a6da6c62 - change (mediawiki/core)
Ori.livneh has uploaded a new change for review. https://gerrit.wikimedia.org/r/108652 Change subject: Update TimedMediaHandler for I7a6da6c62 .. Update TimedMediaHandler for I7a6da6c62 Change-Id: Ic9102976d50fbc84dd0f4151551ec96d0e331a34 --- M extensions/TimedMediaHandler 1 file changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/52/108652/1 diff --git a/extensions/TimedMediaHandler b/extensions/TimedMediaHandler index 1378723..c672d43 16 --- a/extensions/TimedMediaHandler +++ b/extensions/TimedMediaHandler -Subproject commit 13787238b5bfa11b3ea1ddf698a2c642eae6b241 +Subproject commit c672d432d9700d22cb0d785d5b69ab065fb5289b -- To view, visit https://gerrit.wikimedia.org/r/108652 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic9102976d50fbc84dd0f4151551ec96d0e331a34 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: wmf/1.23wmf10 Gerrit-Owner: Ori.livneh ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Update TimedMediaHandler for I7a6da6c62 - change (mediawiki/core)
Ori.livneh has uploaded a new change for review. https://gerrit.wikimedia.org/r/108651 Change subject: Update TimedMediaHandler for I7a6da6c62 .. Update TimedMediaHandler for I7a6da6c62 Change-Id: I0380c743928d8a89097f06caf402c039429bcfa1 --- M extensions/TimedMediaHandler 1 file changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/51/108651/1 diff --git a/extensions/TimedMediaHandler b/extensions/TimedMediaHandler index 317d5b6..8d7e633 16 --- a/extensions/TimedMediaHandler +++ b/extensions/TimedMediaHandler -Subproject commit 317d5b608943a61586ad4a921eba798d7f40e3f7 +Subproject commit 8d7e6331962be28c1ee11c22fbd15d2471431686 -- To view, visit https://gerrit.wikimedia.org/r/108651 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0380c743928d8a89097f06caf402c039429bcfa1 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: wmf/1.23wmf11 Gerrit-Owner: Ori.livneh ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Only load mw.PopUpMediaTransform on pages that plausibly nee... - change (mediawiki...TimedMediaHandler)
jenkins-bot has submitted this change and it was merged. Change subject: Only load mw.PopUpMediaTransform on pages that plausibly need it .. Only load mw.PopUpMediaTransform on pages that plausibly need it Rather than load mw.PopUpMediaTransform unconditionally, rely on the parser hook to cover most cases, and use TimedMediaHandlerHooks::pageOutputHook to cover the rest: namely, special pages that are liable to include timed media. Bug: 0 Change-Id: I7a6da6c62ceae1dae2feb05b57b2df91b482ad8b --- M TimedMediaHandler.hooks.php 1 file changed, 45 insertions(+), 4 deletions(-) Approvals: Ori.livneh: Looks good to me, approved jenkins-bot: Verified diff --git a/TimedMediaHandler.hooks.php b/TimedMediaHandler.hooks.php index b43f1ce..0ac3070 100644 --- a/TimedMediaHandler.hooks.php +++ b/TimedMediaHandler.hooks.php @@ -104,9 +104,12 @@ // Add parser hook $wgParserOutputHooks['TimedMediaHandler'] = array( 'TimedMediaHandler', 'outputHook' ); - // We should probably move this script output to a parser function but not working correctly in - // dynamic contexts ( for example in special upload, when there is an "existing file" warning. ) + // Use a BeforePageDisplay hook to load the styles in pages that pull in media dynamically. + // (Special:Upload, for example, when there is an "existing file" warning.) $wgHooks['BeforePageDisplay'][] = 'TimedMediaHandlerHooks::pageOutputHook'; + + // Make sure modules are loaded on image pages that don't have a media file in the wikitext. + $wgHooks['ImageOpenShowImageInlineBefore'][] = 'TimedMediaHandlerHooks::onImageOpenShowImageInlineBefore'; // Exclude transcoded assets from normal thumbnail purging // ( a maintenance script could handle transcode asset purging) @@ -146,6 +149,19 @@ $wgHooks[ 'NewRevisionFromEditComplete' ][] = 'TimedMediaHandlerHooks::onNewRevisionFromEditComplete'; $wgHooks['LoadExtensionSchemaUpdates'][] = 'TimedMediaHandlerHooks::checkSchemaUpdates'; + return true; + } + + /** +* @param $imagePage ImagePage +* @param $wgOut OutputPage +* @return bool +*/ + public static function onImageOpenShowImageInlineBefore( $imagePage, $out ) { + $handler = $imagePage->getDisplayedFile()->getHandler(); + if ( $handler !== false && $handler instanceof TimedMediaHandler ) { + TimedMediaHandler::outputHook( $out, null, null ); + } return true; } @@ -342,13 +358,38 @@ } /** +* Add JavaScript and CSS for special pages that may include timed media +* but which will not fire the parser hook. +* +* FIXME: There ought to be a better interface for determining whether the +* page is liable to contain timed media. +* * @param $out OutputPage * @param $sk * @return bool */ static function pageOutputHook( &$out, &$sk ){ - $out->addModules( 'mw.PopUpMediaTransform' ); - $out->addModuleStyles( 'mw.PopUpMediaTransform' ); + $title = $out->getTitle(); + $namespace = $title->getNamespace(); + $addModules = false; + + if ( $namespace === NS_CATEGORY || $namespace === NS_TIMEDTEXT ) { + $addModules = true; + } + + if ( $title->isSpecialPage() ) { + list( $name, /* subpage */ ) = SpecialPageFactory::resolveAlias( $title->getDBkey() ); + if ( stripos( $name, 'file' ) !== false || stripos( $name, 'image' ) !== false + || $name === 'Search' || $name === 'GlobalUsage' ) { + $addModules = true; + } + } + + if ( $addModules ) { + $out->addModules( 'mw.PopUpMediaTransform' ); + $out->addModuleStyles( 'mw.PopUpMediaTransform' ); + } + return true; } -- To view, visit https://gerrit.wikimedia.org/r/108650 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7a6da6c62ceae1dae2feb05b57b2df91b482ad8b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/TimedMediaHandler Gerrit-Branch: wmf/1.23wmf11 Gerrit-Owner: Ori.livneh Gerrit-Reviewer: Ori.livneh Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Only load mw.PopUpMediaTransform on pages that plausibly nee... - change (mediawiki...TimedMediaHandler)
Ori.livneh has uploaded a new change for review. https://gerrit.wikimedia.org/r/108650 Change subject: Only load mw.PopUpMediaTransform on pages that plausibly need it .. Only load mw.PopUpMediaTransform on pages that plausibly need it Rather than load mw.PopUpMediaTransform unconditionally, rely on the parser hook to cover most cases, and use TimedMediaHandlerHooks::pageOutputHook to cover the rest: namely, special pages that are liable to include timed media. Bug: 0 Change-Id: I7a6da6c62ceae1dae2feb05b57b2df91b482ad8b --- M TimedMediaHandler.hooks.php 1 file changed, 45 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TimedMediaHandler refs/changes/50/108650/1 diff --git a/TimedMediaHandler.hooks.php b/TimedMediaHandler.hooks.php index b43f1ce..0ac3070 100644 --- a/TimedMediaHandler.hooks.php +++ b/TimedMediaHandler.hooks.php @@ -104,9 +104,12 @@ // Add parser hook $wgParserOutputHooks['TimedMediaHandler'] = array( 'TimedMediaHandler', 'outputHook' ); - // We should probably move this script output to a parser function but not working correctly in - // dynamic contexts ( for example in special upload, when there is an "existing file" warning. ) + // Use a BeforePageDisplay hook to load the styles in pages that pull in media dynamically. + // (Special:Upload, for example, when there is an "existing file" warning.) $wgHooks['BeforePageDisplay'][] = 'TimedMediaHandlerHooks::pageOutputHook'; + + // Make sure modules are loaded on image pages that don't have a media file in the wikitext. + $wgHooks['ImageOpenShowImageInlineBefore'][] = 'TimedMediaHandlerHooks::onImageOpenShowImageInlineBefore'; // Exclude transcoded assets from normal thumbnail purging // ( a maintenance script could handle transcode asset purging) @@ -146,6 +149,19 @@ $wgHooks[ 'NewRevisionFromEditComplete' ][] = 'TimedMediaHandlerHooks::onNewRevisionFromEditComplete'; $wgHooks['LoadExtensionSchemaUpdates'][] = 'TimedMediaHandlerHooks::checkSchemaUpdates'; + return true; + } + + /** +* @param $imagePage ImagePage +* @param $wgOut OutputPage +* @return bool +*/ + public static function onImageOpenShowImageInlineBefore( $imagePage, $out ) { + $handler = $imagePage->getDisplayedFile()->getHandler(); + if ( $handler !== false && $handler instanceof TimedMediaHandler ) { + TimedMediaHandler::outputHook( $out, null, null ); + } return true; } @@ -342,13 +358,38 @@ } /** +* Add JavaScript and CSS for special pages that may include timed media +* but which will not fire the parser hook. +* +* FIXME: There ought to be a better interface for determining whether the +* page is liable to contain timed media. +* * @param $out OutputPage * @param $sk * @return bool */ static function pageOutputHook( &$out, &$sk ){ - $out->addModules( 'mw.PopUpMediaTransform' ); - $out->addModuleStyles( 'mw.PopUpMediaTransform' ); + $title = $out->getTitle(); + $namespace = $title->getNamespace(); + $addModules = false; + + if ( $namespace === NS_CATEGORY || $namespace === NS_TIMEDTEXT ) { + $addModules = true; + } + + if ( $title->isSpecialPage() ) { + list( $name, /* subpage */ ) = SpecialPageFactory::resolveAlias( $title->getDBkey() ); + if ( stripos( $name, 'file' ) !== false || stripos( $name, 'image' ) !== false + || $name === 'Search' || $name === 'GlobalUsage' ) { + $addModules = true; + } + } + + if ( $addModules ) { + $out->addModules( 'mw.PopUpMediaTransform' ); + $out->addModuleStyles( 'mw.PopUpMediaTransform' ); + } + return true; } -- To view, visit https://gerrit.wikimedia.org/r/108650 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7a6da6c62ceae1dae2feb05b57b2df91b482ad8b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/TimedMediaHandler Gerrit-Branch: wmf/1.23wmf11 Gerrit-Owner: Ori.livneh Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Only load mw.PopUpMediaTransform on pages that plausibly nee... - change (mediawiki...TimedMediaHandler)
jenkins-bot has submitted this change and it was merged. Change subject: Only load mw.PopUpMediaTransform on pages that plausibly need it .. Only load mw.PopUpMediaTransform on pages that plausibly need it Rather than load mw.PopUpMediaTransform unconditionally, rely on the parser hook to cover most cases, and use TimedMediaHandlerHooks::pageOutputHook to cover the rest: namely, special pages that are liable to include timed media. Bug: 0 Change-Id: I7a6da6c62ceae1dae2feb05b57b2df91b482ad8b --- M TimedMediaHandler.hooks.php 1 file changed, 45 insertions(+), 4 deletions(-) Approvals: Ori.livneh: Looks good to me, approved jenkins-bot: Verified diff --git a/TimedMediaHandler.hooks.php b/TimedMediaHandler.hooks.php index 47a7f6e..064 100644 --- a/TimedMediaHandler.hooks.php +++ b/TimedMediaHandler.hooks.php @@ -104,9 +104,12 @@ // Add parser hook $wgParserOutputHooks['TimedMediaHandler'] = array( 'TimedMediaHandler', 'outputHook' ); - // We should probably move this script output to a parser function but not working correctly in - // dynamic contexts ( for example in special upload, when there is an "existing file" warning. ) + // Use a BeforePageDisplay hook to load the styles in pages that pull in media dynamically. + // (Special:Upload, for example, when there is an "existing file" warning.) $wgHooks['BeforePageDisplay'][] = 'TimedMediaHandlerHooks::pageOutputHook'; + + // Make sure modules are loaded on image pages that don't have a media file in the wikitext. + $wgHooks['ImageOpenShowImageInlineBefore'][] = 'TimedMediaHandlerHooks::onImageOpenShowImageInlineBefore'; // Exclude transcoded assets from normal thumbnail purging // ( a maintenance script could handle transcode asset purging) @@ -146,6 +149,19 @@ $wgHooks[ 'NewRevisionFromEditComplete' ][] = 'TimedMediaHandlerHooks::onNewRevisionFromEditComplete'; $wgHooks['LoadExtensionSchemaUpdates'][] = 'TimedMediaHandlerHooks::checkSchemaUpdates'; + return true; + } + + /** +* @param $imagePage ImagePage +* @param $wgOut OutputPage +* @return bool +*/ + public static function onImageOpenShowImageInlineBefore( $imagePage, $out ) { + $handler = $imagePage->getDisplayedFile()->getHandler(); + if ( $handler !== false && $handler instanceof TimedMediaHandler ) { + TimedMediaHandler::outputHook( $out, null, null ); + } return true; } @@ -342,13 +358,38 @@ } /** +* Add JavaScript and CSS for special pages that may include timed media +* but which will not fire the parser hook. +* +* FIXME: There ought to be a better interface for determining whether the +* page is liable to contain timed media. +* * @param $out OutputPage * @param $sk * @return bool */ static function pageOutputHook( &$out, &$sk ){ - $out->addModules( 'mw.PopUpMediaTransform' ); - $out->addModuleStyles( 'mw.PopUpMediaTransform' ); + $title = $out->getTitle(); + $namespace = $title->getNamespace(); + $addModules = false; + + if ( $namespace === NS_CATEGORY || $namespace === NS_TIMEDTEXT ) { + $addModules = true; + } + + if ( $title->isSpecialPage() ) { + list( $name, /* subpage */ ) = SpecialPageFactory::resolveAlias( $title->getDBkey() ); + if ( stripos( $name, 'file' ) !== false || stripos( $name, 'image' ) !== false + || $name === 'Search' || $name === 'GlobalUsage' ) { + $addModules = true; + } + } + + if ( $addModules ) { + $out->addModules( 'mw.PopUpMediaTransform' ); + $out->addModuleStyles( 'mw.PopUpMediaTransform' ); + } + return true; } -- To view, visit https://gerrit.wikimedia.org/r/108649 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7a6da6c62ceae1dae2feb05b57b2df91b482ad8b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/TimedMediaHandler Gerrit-Branch: wmf/1.23wmf10 Gerrit-Owner: Ori.livneh Gerrit-Reviewer: Ori.livneh Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Only load mw.PopUpMediaTransform on pages that plausibly nee... - change (mediawiki...TimedMediaHandler)
Ori.livneh has uploaded a new change for review. https://gerrit.wikimedia.org/r/108649 Change subject: Only load mw.PopUpMediaTransform on pages that plausibly need it .. Only load mw.PopUpMediaTransform on pages that plausibly need it Rather than load mw.PopUpMediaTransform unconditionally, rely on the parser hook to cover most cases, and use TimedMediaHandlerHooks::pageOutputHook to cover the rest: namely, special pages that are liable to include timed media. Bug: 0 Change-Id: I7a6da6c62ceae1dae2feb05b57b2df91b482ad8b --- M TimedMediaHandler.hooks.php 1 file changed, 45 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TimedMediaHandler refs/changes/49/108649/1 diff --git a/TimedMediaHandler.hooks.php b/TimedMediaHandler.hooks.php index 47a7f6e..064 100644 --- a/TimedMediaHandler.hooks.php +++ b/TimedMediaHandler.hooks.php @@ -104,9 +104,12 @@ // Add parser hook $wgParserOutputHooks['TimedMediaHandler'] = array( 'TimedMediaHandler', 'outputHook' ); - // We should probably move this script output to a parser function but not working correctly in - // dynamic contexts ( for example in special upload, when there is an "existing file" warning. ) + // Use a BeforePageDisplay hook to load the styles in pages that pull in media dynamically. + // (Special:Upload, for example, when there is an "existing file" warning.) $wgHooks['BeforePageDisplay'][] = 'TimedMediaHandlerHooks::pageOutputHook'; + + // Make sure modules are loaded on image pages that don't have a media file in the wikitext. + $wgHooks['ImageOpenShowImageInlineBefore'][] = 'TimedMediaHandlerHooks::onImageOpenShowImageInlineBefore'; // Exclude transcoded assets from normal thumbnail purging // ( a maintenance script could handle transcode asset purging) @@ -146,6 +149,19 @@ $wgHooks[ 'NewRevisionFromEditComplete' ][] = 'TimedMediaHandlerHooks::onNewRevisionFromEditComplete'; $wgHooks['LoadExtensionSchemaUpdates'][] = 'TimedMediaHandlerHooks::checkSchemaUpdates'; + return true; + } + + /** +* @param $imagePage ImagePage +* @param $wgOut OutputPage +* @return bool +*/ + public static function onImageOpenShowImageInlineBefore( $imagePage, $out ) { + $handler = $imagePage->getDisplayedFile()->getHandler(); + if ( $handler !== false && $handler instanceof TimedMediaHandler ) { + TimedMediaHandler::outputHook( $out, null, null ); + } return true; } @@ -342,13 +358,38 @@ } /** +* Add JavaScript and CSS for special pages that may include timed media +* but which will not fire the parser hook. +* +* FIXME: There ought to be a better interface for determining whether the +* page is liable to contain timed media. +* * @param $out OutputPage * @param $sk * @return bool */ static function pageOutputHook( &$out, &$sk ){ - $out->addModules( 'mw.PopUpMediaTransform' ); - $out->addModuleStyles( 'mw.PopUpMediaTransform' ); + $title = $out->getTitle(); + $namespace = $title->getNamespace(); + $addModules = false; + + if ( $namespace === NS_CATEGORY || $namespace === NS_TIMEDTEXT ) { + $addModules = true; + } + + if ( $title->isSpecialPage() ) { + list( $name, /* subpage */ ) = SpecialPageFactory::resolveAlias( $title->getDBkey() ); + if ( stripos( $name, 'file' ) !== false || stripos( $name, 'image' ) !== false + || $name === 'Search' || $name === 'GlobalUsage' ) { + $addModules = true; + } + } + + if ( $addModules ) { + $out->addModules( 'mw.PopUpMediaTransform' ); + $out->addModuleStyles( 'mw.PopUpMediaTransform' ); + } + return true; } -- To view, visit https://gerrit.wikimedia.org/r/108649 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7a6da6c62ceae1dae2feb05b57b2df91b482ad8b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/TimedMediaHandler Gerrit-Branch: wmf/1.23wmf10 Gerrit-Owner: Ori.livneh Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Only load mw.PopUpMediaTransform on pages that plausibly nee... - change (mediawiki...TimedMediaHandler)
jenkins-bot has submitted this change and it was merged. Change subject: Only load mw.PopUpMediaTransform on pages that plausibly need it .. Only load mw.PopUpMediaTransform on pages that plausibly need it Rather than load mw.PopUpMediaTransform unconditionally, rely on the parser hook to cover most cases, and use TimedMediaHandlerHooks::pageOutputHook to cover the rest: namely, special pages that are liable to include timed media. Bug: 0 Change-Id: I7a6da6c62ceae1dae2feb05b57b2df91b482ad8b --- M TimedMediaHandler.hooks.php 1 file changed, 45 insertions(+), 3 deletions(-) Approvals: Brian Wolff: Looks good to me, approved jenkins-bot: Verified diff --git a/TimedMediaHandler.hooks.php b/TimedMediaHandler.hooks.php index 2fac670..20ee06d 100644 --- a/TimedMediaHandler.hooks.php +++ b/TimedMediaHandler.hooks.php @@ -104,9 +104,12 @@ // Add parser hook $wgParserOutputHooks['TimedMediaHandler'] = array( 'TimedMediaHandler', 'outputHook' ); - // We should probably move this script output to a parser function but not working correctly in - // dynamic contexts ( for example in special upload, when there is an "existing file" warning. ) + // Use a BeforePageDisplay hook to load the styles in pages that pull in media dynamically. + // (Special:Upload, for example, when there is an "existing file" warning.) $wgHooks['BeforePageDisplay'][] = 'TimedMediaHandlerHooks::pageOutputHook'; + + // Make sure modules are loaded on image pages that don't have a media file in the wikitext. + $wgHooks['ImageOpenShowImageInlineBefore'][] = 'TimedMediaHandlerHooks::onImageOpenShowImageInlineBefore'; // Exclude transcoded assets from normal thumbnail purging // ( a maintenance script could handle transcode asset purging) @@ -146,6 +149,19 @@ $wgHooks[ 'NewRevisionFromEditComplete' ][] = 'TimedMediaHandlerHooks::onNewRevisionFromEditComplete'; $wgHooks['LoadExtensionSchemaUpdates'][] = 'TimedMediaHandlerHooks::checkSchemaUpdates'; + return true; + } + + /** +* @param $imagePage ImagePage +* @param $wgOut OutputPage +* @return bool +*/ + public static function onImageOpenShowImageInlineBefore( $imagePage, $out ) { + $handler = $imagePage->getDisplayedFile()->getHandler(); + if ( $handler !== false && $handler instanceof TimedMediaHandler ) { + TimedMediaHandler::outputHook( $out, null, null ); + } return true; } @@ -342,12 +358,38 @@ } /** +* Add JavaScript and CSS for special pages that may include timed media +* but which will not fire the parser hook. +* +* FIXME: There ought to be a better interface for determining whether the +* page is liable to contain timed media. +* * @param $out OutputPage * @param $sk * @return bool */ static function pageOutputHook( &$out, &$sk ){ - $out->addModules( 'mw.PopUpMediaTransform' ); + $title = $out->getTitle(); + $namespace = $title->getNamespace(); + $addModules = false; + + if ( $namespace === NS_CATEGORY || $namespace === NS_TIMEDTEXT ) { + $addModules = true; + } + + if ( $title->isSpecialPage() ) { + list( $name, /* subpage */ ) = SpecialPageFactory::resolveAlias( $title->getDBkey() ); + if ( stripos( $name, 'file' ) !== false || stripos( $name, 'image' ) !== false + || $name === 'Search' || $name === 'GlobalUsage' ) { + $addModules = true; + } + } + + if ( $addModules ) { + $out->addModules( 'mw.PopUpMediaTransform' ); + $out->addModuleStyles( 'mw.PopUpMediaTransform' ); + } + return true; } -- To view, visit https://gerrit.wikimedia.org/r/99597 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7a6da6c62ceae1dae2feb05b57b2df91b482ad8b Gerrit-PatchSet: 7 Gerrit-Project: mediawiki/extensions/TimedMediaHandler Gerrit-Branch: master Gerrit-Owner: Ori.livneh Gerrit-Reviewer: Brian Wolff Gerrit-Reviewer: Legoktm Gerrit-Reviewer: Mdale Gerrit-Reviewer: Ori.livneh Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Increase z-index on cannot play file warning - change (mediawiki...TimedMediaHandler)
Mdale has submitted this change and it was merged. Change subject: Increase z-index on cannot play file warning .. Increase z-index on cannot play file warning This was causing the text in the warning to be unselectable, and unclickable. Given that commons has links in that message, this is a pretty severe usability issue. See also Ifbe20df984 and bug 60243. Change-Id: Ibd95d533b91f1f8b6bb9c983486e849c95005e8b --- M MwEmbedModules/EmbedPlayer/resources/skins/mw.PlayerControlBuilder.js 1 file changed, 3 insertions(+), 1 deletion(-) Approvals: Mdale: Verified; Looks good to me, approved diff --git a/MwEmbedModules/EmbedPlayer/resources/skins/mw.PlayerControlBuilder.js b/MwEmbedModules/EmbedPlayer/resources/skins/mw.PlayerControlBuilder.js index 0fabaeb..4ed2f81 100644 --- a/MwEmbedModules/EmbedPlayer/resources/skins/mw.PlayerControlBuilder.js +++ b/MwEmbedModules/EmbedPlayer/resources/skins/mw.PlayerControlBuilder.js @@ -1429,7 +1429,9 @@ 'left' : '10px', 'right' : '10px', 'padding' : '4px', - 'z-index' : 2 + // z-index should be > than play button, as well as greater + // than the dialog box (in pop up video), or link won't work. + 'z-index' : '1502', }) .html( warningMsg ); -- To view, visit https://gerrit.wikimedia.org/r/108631 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibd95d533b91f1f8b6bb9c983486e849c95005e8b Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/TimedMediaHandler Gerrit-Branch: master Gerrit-Owner: Brian Wolff Gerrit-Reviewer: Brian Wolff Gerrit-Reviewer: MarkTraceur Gerrit-Reviewer: Mdale 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 upstart job definition file for Gitblit - change (operations/puppet)
Ori.livneh has submitted this change and it was merged. Change subject: Add upstart job definition file for Gitblit .. Add upstart job definition file for Gitblit The init.d script does not implement the 'status' sub-command, causing log churn on antimony. So replace it with a modern and concise upstart job definition. /etc/init.d/gitblit should be stopped and removed manually. Change-Id: I3f32dedf15ce4c7cc96f6ed16d03dcfadce1d453 --- D modules/gitblit/files/gitblit-ubuntu A modules/gitblit/files/gitblit.conf M modules/gitblit/manifests/init.pp 3 files changed, 24 insertions(+), 54 deletions(-) Approvals: Ori.livneh: Verified; Looks good to me, approved diff --git a/modules/gitblit/files/gitblit-ubuntu b/modules/gitblit/files/gitblit-ubuntu deleted file mode 100644 index e6cd3f0..000 --- a/modules/gitblit/files/gitblit-ubuntu +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash -# chkconfig: 3 21 91 -# Source function library. -. /lib/init/vars.sh -. /lib/lsb/init-functions - -PATH=/sbin:/bin:/usr/bin:/usr/sbin - -# change theses values (default values) -GITBLIT_PATH=/var/lib/gitblit -GITBLIT_BASE_FOLDER=/var/lib/gitblit/data -GITBLIT_USER="gitblit" -source ${GITBLIT_PATH}/java-proxy-config.sh -ARGS="-server -Xmx4096M ${JAVA_PROXY_CONFIG} -Djava.awt.headless=true -jar gitblit.jar --baseFolder $GITBLIT_BASE_FOLDER" - -RETVAL=0 - -case "$1" in - start) -if [ -f $GITBLIT_PATH/gitblit.jar ]; - then - echo $"Starting gitblit server" - start-stop-daemon --start --quiet --background --oknodo --make-pidfile --pidfile /var/run/gitblit.pid --exec /usr/bin/java --chuid $GITBLIT_USER --chdir $GITBLIT_PATH -- $ARGS - exit $RETVAL -fi - ;; - - stop) -if [ -f $GITBLIT_PATH/gitblit.jar ]; - then - echo $"Stopping gitblit server" - start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/gitblit.pid - exit $RETVAL -fi - ;; - - force-reload|restart) - $0 stop - $0 start - ;; - - *) -echo $"Usage: /etc/init.d/gitblit {start|stop|restart|force-reload}" -exit 1 - ;; -esac - -exit $RETVAL diff --git a/modules/gitblit/files/gitblit.conf b/modules/gitblit/files/gitblit.conf new file mode 100644 index 000..6fec024 --- /dev/null +++ b/modules/gitblit/files/gitblit.conf @@ -0,0 +1,20 @@ +# gitblit - Web interface for Git +# +# Gitblit is an open-source, pure Java stack for managing, viewing, and +# serving Git repositories. +# +description "Web interface for Git" + +start on runlevel [2345] +stop on runlevel [!2345] + +setuid gitblit +setgid gitblit + +chdir /var/lib/gitblit + +exec /usr/bin/java -server -Xmx4096M -Djava.awt.headless=true \ +-jar gitblit.jar --baseFolder /var/lib/gitblit/data + +respawn +respawn limit 10 5 diff --git a/modules/gitblit/manifests/init.pp b/modules/gitblit/manifests/init.pp index 9853ea5..a01662e 100644 --- a/modules/gitblit/manifests/init.pp +++ b/modules/gitblit/manifests/init.pp @@ -51,11 +51,8 @@ source => 'puppet:///modules/gitblit/header.md', } -file { '/etc/init.d/gitblit': -mode=> '0554', -owner => 'gitblit', -group => 'gitblit', -source => 'puppet:///modules/gitblit/gitblit-ubuntu', +file { '/etc/init/gitblit.conf': +source => 'puppet:///modules/gitblit/gitblit.conf', } file { '/var/www/robots.txt': @@ -67,8 +64,9 @@ service { 'gitblit': ensure=> running, +provider => 'upstart', subscribe => File['/var/lib/gitblit/data/gitblit.properties'], -enable=> true, +require => File['/etc/init/gitblit.conf'], } apache_site { 'git': -- To view, visit https://gerrit.wikimedia.org/r/108492 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3f32dedf15ce4c7cc96f6ed16d03dcfadce1d453 Gerrit-PatchSet: 2 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Ori.livneh Gerrit-Reviewer: Matanya Gerrit-Reviewer: Ori.livneh Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Revert "Clean up error for claim index out of bounds" - change (mediawiki...Wikibase)
Jeroen De Dauw has submitted this change and it was merged. Change subject: Revert "Clean up error for claim index out of bounds" .. Revert "Clean up error for claim index out of bounds" This reverts commit 213745d86d5ba3a18c3232df111c88f47760d17c. Change-Id: Ia6a9db094c2fc5f624fb32c3cf20180125081ce8 --- M repo/includes/ChangeOp/ChangeOpClaim.php M repo/includes/api/SetClaim.php M repo/tests/phpunit/includes/api/SetClaimTest.php 3 files changed, 13 insertions(+), 65 deletions(-) Approvals: Jeroen De Dauw: Verified; Looks good to me, approved diff --git a/repo/includes/ChangeOp/ChangeOpClaim.php b/repo/includes/ChangeOp/ChangeOpClaim.php index 2a310bf..fbaf937 100644 --- a/repo/includes/ChangeOp/ChangeOpClaim.php +++ b/repo/includes/ChangeOp/ChangeOpClaim.php @@ -3,7 +3,6 @@ namespace Wikibase\ChangeOp; use InvalidArgumentException; -use OutOfBoundsException; use Wikibase\DataModel\ByPropertyIdArray; use Wikibase\DataModel\Claim\Claim; use Wikibase\DataModel\Claim\Claims; @@ -98,12 +97,7 @@ $indexedClaimList = new ByPropertyIdArray( $entityClaims ); $indexedClaimList->buildIndex(); - try{ - $indexedClaimList->addObjectAtIndex( $this->claim, $this->index ); - } - catch( OutOfBoundsException $e ){ - throw new ChangeOpException( "Can not add claim at given index : ". $this->index ); - } + $indexedClaimList->addObjectAtIndex( $this->claim, $this->index ); } else { // Altering an existing claim. diff --git a/repo/includes/api/SetClaim.php b/repo/includes/api/SetClaim.php index 15dcb02..bb2b100 100644 --- a/repo/includes/api/SetClaim.php +++ b/repo/includes/api/SetClaim.php @@ -63,7 +63,7 @@ try{ $changeop->apply( $entity ); } catch( ChangeOpException $exception ){ - $this->dieUsage( 'Failed to apply changeOp: ' . $exception->getMessage(), 'save-failed' ); + $this->dieUsage( 'Failed to apply changeOp:' . $exception->getMessage(), 'save-failed' ); } $this->saveChanges( $entityContent, $summary ); diff --git a/repo/tests/phpunit/includes/api/SetClaimTest.php b/repo/tests/phpunit/includes/api/SetClaimTest.php index 897b81f..6c66290 100644 --- a/repo/tests/phpunit/includes/api/SetClaimTest.php +++ b/repo/tests/phpunit/includes/api/SetClaimTest.php @@ -4,22 +4,20 @@ use DataValues\StringValue; use FormatJson; -use Revision; -use UsageException; -use Wikibase\DataModel\Claim\Claim; -use Wikibase\DataModel\Claim\Claims; -use Wikibase\DataModel\Claim\Statement; +use Wikibase\Claim; +use Wikibase\Claims; use Wikibase\DataModel\Entity\EntityId; -use Wikibase\DataModel\Entity\Item; -use Wikibase\DataModel\Reference; -use Wikibase\DataModel\Snak\PropertyNoValueSnak; -use Wikibase\DataModel\Snak\PropertySomeValueSnak; -use Wikibase\DataModel\Snak\PropertyValueSnak; -use Wikibase\DataModel\Snak\Snak; -use Wikibase\DataModel\Snak\SnakList; use Wikibase\PropertyContent; use Wikibase\Lib\Serializers\SerializerFactory; use Wikibase\Repo\WikibaseRepo; +use Wikibase\Statement; +use Wikibase\Reference; +use Wikibase\Snak; +use Wikibase\SnakList; +use Wikibase\PropertyValueSnak; +use Wikibase\PropertyNoValueSnak; +use Wikibase\PropertySomeValueSnak; +use Wikibase\Item; use Wikibase\ItemContent; use Wikibase\Lib\ClaimGuidGenerator; @@ -122,7 +120,6 @@ public function testAddClaim() { $claims = $this->getClaims(); - /** @var Claim[] $claims */ foreach( $claims as $claim ) { $item = Item::newEmpty(); $content = new ItemContent( $item ); @@ -184,7 +181,6 @@ // Add new claim at index 2: $guid = $guidGenerator->newGuid(); - /** @var Claim $claim */ foreach( $this->getClaims() as $claim ) { $claim->setGuid( $guid ); @@ -198,15 +194,13 @@ * @param $claimCount * @param $requestLabel string a label to identify requests that are made in errors * @param int|null $index -* @param int|null $baserevid */ protected function makeRequest( $claim, EntityId $entityId, $claimCount, $requestLabel, - $index = null, - $baserevid = null + $index = null ) { $serializerFactory = new SerializerFactory(); @@ -226,10 +220,6 @@ if( !is_null( $index ) ) { $params['index'] = $index; - } - - if( !is_null( $baserevid ) ) { -
[MediaWiki-commits] [Gerrit] Transition to a new servicegroup schema - change (mediawiki...OpenStackManager)
Andrew Bogott has uploaded a new change for review. https://gerrit.wikimedia.org/r/108647 Change subject: Transition to a new servicegroup schema .. Transition to a new servicegroup schema Previously a service groups was dn: cn=local-morebots,ou=groups,cn=tools,ou=projects,dc=wikimedia,dc=org In the future it will be dn: cn=tools.morebots,ou=servicegroups,dc=wikimedia,dc=org This patch implement the latter schema but leaves in place the former. This should let us transition ldap consumers gradually... once all the related components are switched over we'll remove support for the older schema. After this patch we continue to read from the old schema, but when writing write to both. (Note that a version of this patch was already merged and reverted; having a second try.) Change-Id: I5709b9056d77dcaaf1ab9145522cbd635ddfc0a3 --- M OpenStackManager.php A maintenance/transitionServiceGroupSchema.php M nova/OpenStackNovaServiceGroup.php M special/SpecialNovaServiceGroup.php 4 files changed, 463 insertions(+), 21 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/OpenStackManager refs/changes/47/108647/1 diff --git a/OpenStackManager.php b/OpenStackManager.php index 3077643..1d27855 100644 --- a/OpenStackManager.php +++ b/OpenStackManager.php @@ -56,7 +56,9 @@ // DN location of projects $wgOpenStackManagerLDAPProjectBaseDN = ''; // DN location of hosts/instances -$wgOpenStackManagerLDAPInstanceBaseDN = ''; +$wgOpenStackManagerLDAPProjectBaseDN = ''; +// DN location of service groups +$wgOpenStackManagerLDAPServiceGroupBaseDN = ''; // Service groups will be automatically prefaced with this; // e.g. if the user asks for 'fancytool' the group will be called // 'local-fancytool'. diff --git a/maintenance/transitionServiceGroupSchema.php b/maintenance/transitionServiceGroupSchema.php new file mode 100644 index 000..5454aea --- /dev/null +++ b/maintenance/transitionServiceGroupSchema.php @@ -0,0 +1,98 @@ +mDescription = "Copy each cn=local-,ou=groups,cn=,ou=projects,dc=wikimedia,dc=org to cn=.,ou=groups,cn=,ou=projects,dc=wikimedia,dc=org"; + } + + public function updateMemberName( $member, $project ) { + global $wgOpenStackManagerServiceGroupPrefix; + + if ( strpos( $member, $wgOpenStackManagerServiceGroupPrefix, 0 ) === 0 ) { + # This is a service-group member! + $simpleMemberName = substr( $member, strlen( $wgOpenStackManagerServiceGroupPrefix ) ); + $newMemberName = $project->getProjectName() . '.' . $simpleMemberName; + } else { + $newMemberName = $member; + } + return $newMemberName; + } + + public function execute() { + global $wgOpenStackManagerLDAPUsername; + global $wgOpenStackManagerServiceGroupPrefix; + + $user = new OpenStackNovaUser( $wgOpenStackManagerLDAPUsername ); + $projects = OpenStackNovaProject::getAllProjects(); + + $failedSync = false; + + $attempt_count = 0; + $synced_count = 0; + $failed_count = 0; + + /** +* @var $project OpenStackNovaProject +*/ + foreach ( $projects as $project ) { + // actually load the project info from ldap + // (getAllProjects() doesn't do this) + $project->fetchProjectInfo(); + $projectName = $project->getProjectName(); + $serviceGroups = $project->getServiceGroups(); + + foreach ( $serviceGroups as $serviceGroup) { + $fullGroupName = $serviceGroup->getGroupName(); + + if ( strpos( $fullGroupName, $wgOpenStackManagerServiceGroupPrefix, 0 ) === 0 ) { + $groupName = substr( $fullGroupName, strlen( $wgOpenStackManagerServiceGroupPrefix ) ); + } else { + $groupName = $fullGroupName; + } + + + $groupMembers = $serviceGroup->getMembers(); + + if ( empty( $groupMembers ) ) { + continue; + } + + $originalMember = $groupMembers[0]; + $retval = OpenStackNovaServiceGroup::createServiceGroup( $groupName, $project, $this->updateMemberName( $originalMember, $project ) ); + $attempt_count++; + + if ( $retval ) { + $this->output( "Succeeded copying service group $groupName in $projectName\n" ); +
[MediaWiki-commits] [Gerrit] Start using LESS instead of CSS directly - change (apps...wikipedia)
Brion VIBBER has submitted this change and it was merged. Change subject: Start using LESS instead of CSS directly .. Start using LESS instead of CSS directly - No LESS features being used... yet! - grunt by default now does LESS compilation too Change-Id: I4fb8ba8e4cba90f0f8e04c883c19b127deac23c1 --- M .gitignore M wikipedia/assets/index.html A wikipedia/assets/styles.css M www/Gruntfile.js M www/index.html R www/less/pagestyles.less R www/less/ui.less M www/package.json 8 files changed, 134 insertions(+), 7 deletions(-) Approvals: Brion VIBBER: Verified; Looks good to me, approved diff --git a/.gitignore b/.gitignore index 488209c..d758f28 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,4 @@ # Node modules for the js www/node_modules www/bundle*.js +www/styles.css diff --git a/wikipedia/assets/index.html b/wikipedia/assets/index.html index 5f07156..d3d5ff3 100644 --- a/wikipedia/assets/index.html +++ b/wikipedia/assets/index.html @@ -4,8 +4,7 @@ https://wikipedia.org"; /> - - + diff --git a/wikipedia/assets/styles.css b/wikipedia/assets/styles.css new file mode 100644 index 000..d073bf7 --- /dev/null +++ b/wikipedia/assets/styles.css @@ -0,0 +1,119 @@ +/* Should be moved out to the MobileApp extension at some point */ +body { + background-color: #F2F2F2; + color: #333; + font-family: sans-serif; + font-size: 16px; + line-height: 24px; + margin: 0; + padding: 0; + margin-top: 48px; +} +#content { + padding: 8px 24px; +} +a { + color: #347BFF; + text-decoration: none; +} +/* Headers */ +h1 { + font-family: serif; + color: #064AAD; + font-size: 26px; + line-height: 36px; + margin-bottom: 24px; + font-weight: bold; +} +h2, +h3, +h4, +h5, +h6 { + font-family: sans-serif; +} +h2 { + font-size: 22px; +} +h3 { + font-size: 20px; +} +h4 { + font-size: 18px; +} +h5, +h6 { + font-size: 16px; +} +/* Basic Thumbnails */ +.thumb { + /* Don't stick thumbnails to the text above and below it */ + margin: 8px 0px; + /* Align everything inside a thumbnail to be centered */ + text-align: center; +} +.thumb .thumbinner { + /* Make sure that thumb takes up full width */ + width: 100% !important; +} +.thumb .magnify { + display: none; + /* Our parser is STUPID */ +} +.thumb .noresize { + overflow-x: auto; + /* Scrollbars for images that shouldn't be squished */ +} +/* Makes sure that we don't have horizontal scrollbars for the entire page because + an image is too wide to fit in to the current viewport */ +img { + max-width: 100% !important; + height: auto !important; +} +/* Basic tables */ +table { + width: 100% !important; + overflow-x: auto; + display: block; + border: 1px solid #ccc; + margin-top: 4px; + margin-bottom: 4px; +} +/* Last updated info */ +#attribution { + border-top: 1px solid #ccc; + padding: 8px; + text-align: center; + color: #888; + font-size: 80%; +} + +a.edit_section_button { + height: 32px; + width: 32px; + background-image: url("images/edit.png"); + background-size: 32px 32px; + float: right; + display: inline-float; +} +/* Loading animation in pure CSS + Thanks to http://dabblet.com/gist/7708654 */ +.loading { + border: 4px solid rgba(0, 0, 0, 0.1); + border-top: 4px solid rgba(0, 0, 0, 0.4); + border-radius: 100%; + animation: rot .6s infinite linear; +} +@keyframes rot { + from { +transform: rotate(0deg); + } + to { +transform: rotate(359deg); + } +} +#loading_sections { + margin: 8px auto; + height: 24px; + width: 24px; +} diff --git a/www/Gruntfile.js b/www/Gruntfile.js index 388f757..b359975 100644 --- a/www/Gruntfile.js +++ b/www/Gruntfile.js @@ -25,6 +25,13 @@ } } }, +less: { +all: { +files: [ +{ src: ["less/*.less"], dest: "styles.css"} +] +} +}, jshint: { allFiles: allScriptFiles, options: { @@ -35,7 +42,7 @@ main: { files: [ // App files -{src: ["bundle.js", "index.html", "pagestyles.css", "ui.css"], dest: "../wikipedia/assets/"}, +{src: ["bundle.js", "index.html", "styles.css"], dest: "../wikipedia/assets/"}, // Test files {src: ["bundle-test.js", "tests/index.html"], dest: "../wikipedia/assets/"}, @@ -57,6 +64,7 @@ grunt.loadNpmTasks( 'grunt-contrib-jshint' ); grunt.loadNpmTasks( 'grunt-contrib-copy' ); grunt.loadNpmTasks( 'grunt-contrib-watch' ); +grunt.loadNpmTasks( 'grunt-contrib-less' ); -grunt.registerTask( 'default', [ 'browserify', 'copy' ] ); +grunt.registerTask( 'default', [ 'browserify', 'less', 'copy' ] ); }; \ No newline at end of file diff --git a/www/index.html b/www/index.html index 5f07156..d3d5ff3 100644 --- a/www/index.html +++ b/www/index.h
[MediaWiki-commits] [Gerrit] Moved section display JS code to its own file - change (apps...wikipedia)
Brion VIBBER has submitted this change and it was merged. Change subject: Moved section display JS code to its own file .. Moved section display JS code to its own file Change-Id: I820bb1a94378ff5181ae9cbb5a60718dc4e0ba35 --- M wikipedia/assets/bundle-test.js M wikipedia/assets/bundle.js M www/Gruntfile.js M www/js/main.js A www/js/sections.js 5 files changed, 91 insertions(+), 272 deletions(-) Approvals: Brion VIBBER: Verified; Looks good to me, approved diff --git a/wikipedia/assets/bundle-test.js b/wikipedia/assets/bundle-test.js index a06cd5c..01bacac 100644 --- a/wikipedia/assets/bundle-test.js +++ b/wikipedia/assets/bundle-test.js @@ -38,63 +38,6 @@ }; },{}],2:[function(require,module,exports){ var bridge = require("./bridge"); -var transforms = require("./transforms"); - -bridge.registerListener( "displayLeadSection", function( payload ) { -// This might be a refresh! Clear out all contents! -document.getElementById( "content" ).innerHTML = ""; - -var title = document.createElement( "h1" ); -title.textContent = payload.title; -title.id = "heading_" + payload.section.id; -document.getElementById( "content" ).appendChild( title ); - -var content = document.createElement( "div" ); -content.innerHTML = payload.section.text; -content.id = "#content_block_0"; -content = transforms.transform( "lead", content ); -document.getElementById( "content" ).appendChild( content ); - -document.getElementById( "loading_sections").className = "loading"; -}); - -function elementsForSection( section ) { -var heading = document.createElement( "h" + ( section.toclevel + 1 ) ); -heading.textContent = section.line; -heading.id = "heading_" + section.id; -heading.setAttribute( 'data-id', section.id ); - -var editButton = document.createElement( "a" ); -editButton.setAttribute( 'data-id', section.id ); -editButton.setAttribute( 'data-action', "edit_section" ); -editButton.className = "edit_section_button"; -heading.appendChild( editButton ); - -var content = document.createElement( "div" ); -content.innerHTML = section.text; -content.id = "content_block_" + section.id; -content = transforms.transform( "body", content ); - -return [ heading, content ]; -} - -bridge.registerListener( "displaySection", function ( payload ) { -var contentWrapper = document.getElementById( "content" ); - -elementsForSection( payload.section ).forEach( function( element ) { -contentWrapper.appendChild( element ); -}); -if ( !payload.isLast ) { -bridge.sendMessage( "requestSection", { index: payload.index + 1 } ); -} else { -document.getElementById( "loading_sections").className = ""; -} -}); - -bridge.registerListener( "startSectionsDisplay", function() { -bridge.sendMessage( "requestSection", { index: 1 } ); -}); - bridge.registerListener( "displayAttribution", function( payload ) { var lastUpdatedA = document.getElementById( "lastupdated" ); lastUpdatedA.innerText = payload.historyText; @@ -111,103 +54,16 @@ } bridge.sendMessage( "imagesListResponse", { "images": imageURLs }); } ); - -bridge.registerListener( "scrollToSection", function ( payload ) { -var el = document.getElementById( "heading_" + payload.sectionID); -// Make sure there's exactly as much space on the left as on the top. -// The 48 accounts for the search bar -var scrollY = el.offsetTop - 48 - el.offsetLeft; -window.scrollTo(0, scrollY); -}); - - -var actionHandlers = { -"edit_section": function( el, event ) { -bridge.sendMessage( 'editSectionClicked', { sectionID: el.getAttribute( 'data-id' ) } ); -event.preventDefault(); -} -}; - -document.onclick = function() { -if ( event.target.tagName === "A" ) { -if ( event.target.hasAttribute( "data-action" ) ) { -var action = event.target.getAttribute( "data-action" ); -actionHandlers[ action ]( event.target, event ); -} else { -bridge.sendMessage( 'linkClicked', { href: event.target.getAttribute( "href" ) }); -event.preventDefault(); -} -} -}; -},{"./bridge":1,"./transforms":3}],3:[function(require,module,exports){ -var bridge = require("./bridge"); -var Transforms = function () {}; - -function moveInfobox( leadContent ) { -// Move infobox to the bottom of the lead section -var infobox = leadContent.querySelector( "table.infobox" ); -if ( infobox ) { -infobox.parentNode.removeChild( infobox ); -var pTags = leadContent.getElementsByTagName( "p" ); -if ( pTags.length ) { -pTags[0].appendChild( infobox ); -} else { -leadContent.appendChild( infobox ); -} -} -return leadContent; -} - -function useLocalImagesForSavedPages( content ) { -var images = content.querySelectorAll( "img
[MediaWiki-commits] [Gerrit] Organize files into js and css directories - change (apps...wikipedia)
Brion VIBBER has submitted this change and it was merged. Change subject: Organize files into js and css directories .. Organize files into js and css directories Change-Id: If47f793acd9e2ded3cdd027c24aab561d9931523 --- M wikipedia-it/src/main/java/org/wikipedia/test/BridgeTests.java M wikipedia/assets/bundle-test.js C wikipedia/assets/tests/index.html M www/Gruntfile.js R www/css/pagestyles.css R www/css/ui.css R www/js/bridge.js R www/js/linkactions.js R www/js/main.js R www/js/transforms.js R www/tests/index.html M www/tests/inject.js M www/tests/pingback.js 13 files changed, 26 insertions(+), 26 deletions(-) Approvals: Brion VIBBER: Verified; Looks good to me, approved diff --git a/wikipedia-it/src/main/java/org/wikipedia/test/BridgeTests.java b/wikipedia-it/src/main/java/org/wikipedia/test/BridgeTests.java index 05d41c9..02ff0cd 100644 --- a/wikipedia-it/src/main/java/org/wikipedia/test/BridgeTests.java +++ b/wikipedia-it/src/main/java/org/wikipedia/test/BridgeTests.java @@ -26,7 +26,7 @@ public void run() { startActivity(new Intent(), null, null); WebView webView = new WebView(getActivity()); -bridge = new CommunicationBridge(webView, "file:///android_asset/tests.html"); +bridge = new CommunicationBridge(webView, "file:///android_asset/tests/index.html"); bridge.addListener("DOMLoaded", new CommunicationBridge.JSEventListener() { @Override public JSONObject onMessage(String messageType, JSONObject messagePayload) { @@ -47,7 +47,7 @@ public void run() { startActivity(new Intent(), null, null); WebView webView = new WebView(getActivity()); -bridge = new CommunicationBridge(webView, "file:///android_asset/tests.html"); +bridge = new CommunicationBridge(webView, "file:///android_asset/tests/index.html"); final JSONObject payload = new JSONObject(); try { payload.put("src", "./pingback"); diff --git a/wikipedia/assets/bundle-test.js b/wikipedia/assets/bundle-test.js index 03d6c37..a06cd5c 100644 --- a/wikipedia/assets/bundle-test.js +++ b/wikipedia/assets/bundle-test.js @@ -139,19 +139,7 @@ } } }; -},{"./bridge":1,"./transforms":5}],3:[function(require,module,exports){ -var bridge = require("../bridge"); -bridge.registerListener( "injectScript", function( payload ) { -require(payload.src); -}); -},{"../bridge":1}],4:[function(require,module,exports){ -var bridge = require("../bridge"); -console.log("Something!"); -bridge.registerListener( "ping", function( payload ) { -bridge.sendMessage( "pong", payload ); -}); - -},{"../bridge":1}],5:[function(require,module,exports){ +},{"./bridge":1,"./transforms":3}],3:[function(require,module,exports){ var bridge = require("./bridge"); var Transforms = function () {}; @@ -210,4 +198,16 @@ }; module.exports = new Transforms(); -},{"./bridge":1}]},{},[2,1,3,4]) \ No newline at end of file +},{"./bridge":1}],4:[function(require,module,exports){ +var bridge = require("../js/bridge"); +bridge.registerListener( "injectScript", function( payload ) { +require(payload.src); +}); +},{"../js/bridge":1}],5:[function(require,module,exports){ +var bridge = require("../js/bridge"); +console.log("Something!"); +bridge.registerListener( "ping", function( payload ) { +bridge.sendMessage( "pong", payload ); +}); + +},{"../js/bridge":1}]},{},[2,1,4,5]) \ No newline at end of file diff --git a/www/tests.html b/wikipedia/assets/tests/index.html similarity index 100% copy from www/tests.html copy to wikipedia/assets/tests/index.html diff --git a/www/Gruntfile.js b/www/Gruntfile.js index e85e8b4..ae90fb0 100644 --- a/www/Gruntfile.js +++ b/www/Gruntfile.js @@ -1,9 +1,9 @@ module.exports = function( grunt ) { var allScriptFiles = [ -"main.js", -"transforms.js", -"bridge.js", -"linkactions.js", +"js/main.js", +"js/transforms.js", +"js/bridge.js", +"js/linkactions.js", "tests/*.js" ]; var allStyleFiles = [ @@ -12,15 +12,15 @@ ]; var allHTMLFiles = [ "index.html", -"tests.html" +"tests/index.html" ]; grunt.initConfig( { pkg: grunt.file.readJSON( "package.json" ), browserify: { dist: { files: { -"bundle.js": [ "main.js", "transforms.js", "bridge.js", "linkactions.js"], -"bundle-test.js": [ "main.js", "bridge.js", "tests/*.js" ] +"bundle.js": [ "js/main.js", "js/transforms.js", "js/bridge.js", "js/linkactions.js"], +"bundle-test.js": [ "js/main.js", "js/bridge.js", "tests/*.js" ] } } }, @@ -37,7 +37,7 @@
[MediaWiki-commits] [Gerrit] First release. - change (labs/migration-assistant)
Diederik has submitted this change and it was merged. Change subject: First release. .. First release. - Added check for Mediawiki - Added check for MySQL - Update pip to at least version 1.2 - Puppet outdated if last run was older than 24 hours - Only check pmtpa instances - Use warning for use of local storage instead of error - Added decorator to check if host is reachable Change-Id: I859fcff0d72c284c107c4183c697a82195fc8680 --- M README.md M labs-migration-assistant/fabfile.py M requirements.txt 3 files changed, 260 insertions(+), 173 deletions(-) Approvals: Diederik: Looks good to me, approved diff --git a/README.md b/README.md index 96a21bc..77d486f 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ ``` shell cd labs-migration-assistant -fab migrate_ready --set wiki_username=YOUR_WIKI_USERNAME +fab test --set wiki_username=YOUR_WIKI_USERNAME # use your username for Wikitech ``` @@ -31,7 +31,18 @@ on Python 2.5 and 2.6 as well and I do not foresee problems with Linux either. Butbug reports are always welcome and pull requests even more! -Use a recent version of pip. +Use a recent version of pip (1.2 or higher) + +## Troubleshooting + +Sometimes a lab instance might be totally unresponsive and SSH will not time-out. If that happens then +abort the script using CTRL+Z or CTRL+C and then invoke the labs migration assistant as follows + +``` shell +fab test --set wiki_username=YOUR_WIKI_USERNAME --exclude_hosts=host1,host2 +``` +You should only use the name of the instance, not the FQDN. + ## Contributing 1. Fork it diff --git a/labs-migration-assistant/fabfile.py b/labs-migration-assistant/fabfile.py index ff29abb..51d0536 100644 --- a/labs-migration-assistant/fabfile.py +++ b/labs-migration-assistant/fabfile.py @@ -50,12 +50,14 @@ # fabric settings env.timeout = 10 env.forward_agent = True +env.skip_bad_hosts = True env.colorize_errors = True env.abort_on_prompts = True env.connection_attempts = 3 env.disable_known_hosts = True env.reject_unknown_hosts = False env.gateway = 'bastion.wmflabs.org' +env.ignored_hosts = env.ignored_hosts.split(';') env.key_filename = os.path.join(os.path.expanduser('~'), '.ssh/id_rsa') @@ -63,13 +65,14 @@ def __init__(self, name, project, datacenter): self.tasks = ['detect_self_puppetmaster', 'detect_last_puppet_run', - 'detect_shared_storage_for_projects', 'detect_shared_storage_for_home'] + 'detect_shared_storage_for_projects', 'detect_shared_storage_for_home', + 'detect_databases', 'detect_mediawiki'] self.name = name self.project = project self.datacenter = datacenter self.connect = None for task in self.tasks: -setattr(self, task, True) +setattr(self, task, 'FAIL') def __str__(self): return '%s.%s.wmflabs' % (self.name, self.datacenter) @@ -78,32 +81,26 @@ return str(self) def count_errors(self): -return sum([1 for task in self.tasks if getattr(self, task) is False]) +return sum([1 for task in self.tasks if getattr(self, task) == 'FAIL' or getattr(self, task) == 'WARNING']) -def check_connection(func, *args, **kwargs): -'''Check connection decorator''' -@functools.wraps(func) -def wrapper(*args, **kwargs): -print kwargs -print args -output = func(*args, **kwargs) -print output -# if not labinstances[env.host_string].connect: -# logging.info('Skipping task because during first task was not able to connect to labsinstance.') -return output -return wrapper +def load_lab_instances(): +''' +Entry point for collecting all lab instances of specified user +TODO: maybe filter for those instances where the user is admin? +''' +if 'debug' in env and env.debug is True: +test_instance = LabInstance('limn0', 'analytics', 'pmtpa') +labinstances = {'limn0.pmtpa.wmflabs': test_instance} +else: +labinstances = fetch_lab_instances() +labinstances = parse_lab_instances(labinstances) +if len(labinstances) == 0: +logging.error( +'I was either not able to parse the Wikitech page containing your lab instances or you are not the administrator for any lab instance.') -def logged(func): -'''Logging decorator.''' -@functools.wraps(func) -def wrapper(*args, **kwargs): -with hide('output'): -output = func(*args, **kwargs) -logging.info(output) -return output -return wrapper +return labinstances def parse_lab_instances(labinstances): @@ -113,18 +110,21 @@ names = labinstance.get('printouts', {}).get('Instance Name', None) project = labinstance.get('printouts', {}).get('Project', None) dc = resource.split('.')[1] -for nam
[MediaWiki-commits] [Gerrit] Add a 'watch' command to grunt to simplify development - change (apps...wikipedia)
Brion VIBBER has submitted this change and it was merged. Change subject: Add a 'watch' command to grunt to simplify development .. Add a 'watch' command to grunt to simplify development This runs the grunt build tasks whenever the master files are modified, while the 'grunt watch' command is running. Change-Id: Ibd530dc12008bfeb010e986cdc3d92e611fe7a5d --- M README.md M www/Gruntfile.js M www/package.json 3 files changed, 33 insertions(+), 8 deletions(-) Approvals: Brion VIBBER: Verified; Looks good to me, approved diff --git a/README.md b/README.md index 1afc1d7..6212118 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,14 @@ This will produce output files under wikipedia/assets which will be included in the .apk. +You can also have grunt run continuously, watching the effected files for updates and running the build tasks automatically. +This might be useful. + +* cd www +* grunt watch +* ... update files ... + + == Updating icons from SVG == Many of our icons are maintained as SVG originals, rasterized to PNG at the diff --git a/www/Gruntfile.js b/www/Gruntfile.js index 7158aeb..e85e8b4 100644 --- a/www/Gruntfile.js +++ b/www/Gruntfile.js @@ -1,4 +1,19 @@ module.exports = function( grunt ) { +var allScriptFiles = [ +"main.js", +"transforms.js", +"bridge.js", +"linkactions.js", +"tests/*.js" +]; +var allStyleFiles = [ +"pagestyles.css", +"ui.css" +]; +var allHTMLFiles = [ +"index.html", +"tests.html" +]; grunt.initConfig( { pkg: grunt.file.readJSON( "package.json" ), browserify: { @@ -10,13 +25,7 @@ } }, jshint: { -allFiles: [ -"main.js", -"transforms.js", -"bridge.js", -"linkactions.js", -"tests/*.js" -], +allFiles: allScriptFiles, options: { jshintrc: ".jshintrc" } @@ -34,12 +43,19 @@ {src: ["images/*"], dest:"../wikipedia/assets/"} ] } +}, +watch: { +scripts: { +files: allScriptFiles.concat( allStyleFiles ).concat( allHTMLFiles ), +tasks: ["default"] +} } } ); grunt.loadNpmTasks( 'grunt-browserify' ); grunt.loadNpmTasks( 'grunt-contrib-jshint' ); grunt.loadNpmTasks( 'grunt-contrib-copy' ); +grunt.loadNpmTasks( 'grunt-contrib-watch' ); grunt.registerTask( 'default', [ 'browserify', 'copy' ] ); }; \ No newline at end of file diff --git a/www/package.json b/www/package.json index 7be16c6..94c644f 100644 --- a/www/package.json +++ b/www/package.json @@ -7,6 +7,7 @@ "grunt": "~0.4.2", "grunt-contrib-jshint": "~0.8.0", "grunt-browserify": "~1.3.0", -"grunt-contrib-copy": "~0.5.0" +"grunt-contrib-copy": "~0.5.0", +"grunt-contrib-watch": "~0.5.3" } } -- To view, visit https://gerrit.wikimedia.org/r/108511 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibd530dc12008bfeb010e986cdc3d92e611fe7a5d Gerrit-PatchSet: 3 Gerrit-Project: apps/android/wikipedia Gerrit-Branch: master Gerrit-Owner: Yuvipanda Gerrit-Reviewer: Brion VIBBER ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Move js files to separate directory - change (apps...wikipedia)
Brion VIBBER has submitted this change and it was merged. Change subject: Move js files to separate directory .. Move js files to separate directory Everything in assets/ is included by default. This makes sure that only the files that are actually needed are in the assets/ folder. A grunt copy task is defined to do that. README.md is updated with new directions for updating these files. Change-Id: I00dc36aa09c8245950d2533ff7bed34011fa35e8 --- M .gitignore M README.md D wikipedia/assets/Gruntfile.js R wikipedia/assets/images/edit.png C wikipedia/assets/images/images/edit.png D wikipedia/assets/package.json M wikipedia/assets/ui.css R www/.jshintrc A www/Gruntfile.js R www/bridge.js C www/images/edit.png A www/index.html R www/linkactions.js R www/main.js A www/package.json A www/pagestyles.css R www/tests.html R www/tests/inject.js R www/tests/pingback.js R www/transforms.js A www/ui.css 21 files changed, 213 insertions(+), 44 deletions(-) Approvals: Brion VIBBER: Verified; Looks good to me, approved diff --git a/.gitignore b/.gitignore index d3b8119..488209c 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,7 @@ # Data pulled out of device with scripts/pullfiles.bash scripts/apps scripts/backup.ab + +# Node modules for the js +www/node_modules +www/bundle*.js diff --git a/README.md b/README.md index 220396f..1afc1d7 100644 --- a/README.md +++ b/README.md @@ -12,14 +12,16 @@ * npm install -g grunt-cli Install dependencies for packaging: -* cd wikipedia/assets +* cd www * npm install Building: -* cd wikipedia/assets +* cd www * grunt +This will produce output files under wikipedia/assets which will be included in the .apk. + == Updating icons from SVG == diff --git a/wikipedia/assets/Gruntfile.js b/wikipedia/assets/Gruntfile.js deleted file mode 100644 index eec9811..000 --- a/wikipedia/assets/Gruntfile.js +++ /dev/null @@ -1,30 +0,0 @@ -module.exports = function( grunt ) { -grunt.initConfig( { -pkg: grunt.file.readJSON( "package.json" ), -browserify: { -dist: { -files: { -"bundle.js": [ "main.js", "transforms.js", "bridge.js", "linkactions.js"], -"bundle-test.js": [ "main.js", "bridge.js", "tests/*.js" ] -} -} -}, -jshint: { -allFiles: [ -"main.js", -"transforms.js", -"bridge.js", -"linkactions.js", -"tests/*.js" -], -options: { -jshintrc: ".jshintrc" -} -} -} ); - -grunt.loadNpmTasks( 'grunt-browserify' ); -grunt.loadNpmTasks( 'grunt-contrib-jshint' ); - -grunt.registerTask( 'default', [ 'browserify' ] ); -}; \ No newline at end of file diff --git a/wikipedia/assets/edit.png b/wikipedia/assets/images/edit.png similarity index 100% rename from wikipedia/assets/edit.png rename to wikipedia/assets/images/edit.png Binary files differ diff --git a/wikipedia/assets/edit.png b/wikipedia/assets/images/images/edit.png similarity index 100% copy from wikipedia/assets/edit.png copy to wikipedia/assets/images/images/edit.png Binary files differ diff --git a/wikipedia/assets/package.json b/wikipedia/assets/package.json deleted file mode 100644 index 2111c68..000 --- a/wikipedia/assets/package.json +++ /dev/null @@ -1,11 +0,0 @@ -{ -"name": "wikipedia-android", -"description": "JS files required for the Wikipedia Android app", -"repository": "https://gerrit.wikimedia.org/r/apps/android/wikipedia";, -"version": "0.1.0", -"devDependencies": { -"grunt": "~0.4.2", -"grunt-contrib-jshint": "~0.8.0", -"grunt-browserify": "~1.3.0" -} -} \ No newline at end of file diff --git a/wikipedia/assets/ui.css b/wikipedia/assets/ui.css index 5f156d2..2edab9c 100644 --- a/wikipedia/assets/ui.css +++ b/wikipedia/assets/ui.css @@ -1,7 +1,7 @@ a.edit_section_button { height: 32px; width: 32px; -background-image: url("edit.png"); +background-image: url("images/edit.png"); background-size: 32px 32px; float: right; display: inline-float; diff --git a/wikipedia/assets/.jshintrc b/www/.jshintrc similarity index 100% rename from wikipedia/assets/.jshintrc rename to www/.jshintrc diff --git a/www/Gruntfile.js b/www/Gruntfile.js new file mode 100644 index 000..7158aeb --- /dev/null +++ b/www/Gruntfile.js @@ -0,0 +1,45 @@ +module.exports = function( grunt ) { +grunt.initConfig( { +pkg: grunt.file.readJSON( "package.json" ), +browserify: { +dist: { +files: { +"bundle.js": [ "main.js", "transforms.js", "bridge.js", "linkactions.js"], +"bundle-test.js": [ "main.js", "bridge.js", "tests/*.js" ] +} +} +}, +jshint: { +al
[MediaWiki-commits] [Gerrit] Moved link related actions to a separate file - change (apps...wikipedia)
Brion VIBBER has submitted this change and it was merged. Change subject: Moved link related actions to a separate file .. Moved link related actions to a separate file Change-Id: I595bdd5011de1f4ebe25faea16f68afcc8012767 --- M wikipedia/assets/Gruntfile.js M wikipedia/assets/bundle.js A wikipedia/assets/linkactions.js 3 files changed, 45 insertions(+), 3 deletions(-) Approvals: Brion VIBBER: Verified; Looks good to me, approved diff --git a/wikipedia/assets/Gruntfile.js b/wikipedia/assets/Gruntfile.js index 7393171..eec9811 100644 --- a/wikipedia/assets/Gruntfile.js +++ b/wikipedia/assets/Gruntfile.js @@ -4,7 +4,7 @@ browserify: { dist: { files: { -"bundle.js": [ "main.js", "transforms.js", "bridge.js"], +"bundle.js": [ "main.js", "transforms.js", "bridge.js", "linkactions.js"], "bundle-test.js": [ "main.js", "bridge.js", "tests/*.js" ] } } @@ -14,6 +14,7 @@ "main.js", "transforms.js", "bridge.js", +"linkactions.js", "tests/*.js" ], options: { diff --git a/wikipedia/assets/bundle.js b/wikipedia/assets/bundle.js index f584039..db7e5af 100644 --- a/wikipedia/assets/bundle.js +++ b/wikipedia/assets/bundle.js @@ -37,6 +37,27 @@ module.exports.sendMessage( "DOMLoaded", {} ); }; },{}],2:[function(require,module,exports){ +var bridge = require('./bridge'); + +var actionHandlers = { +"edit_section": function( el, event ) { +bridge.sendMessage( 'editSectionClicked', { sectionID: el.getAttribute( 'data-id' ) } ); +event.preventDefault(); +} +}; + +document.onclick = function() { +if ( event.target.tagName === "A" ) { +if ( event.target.hasAttribute( "data-action" ) ) { +var action = event.target.getAttribute( "data-action" ); +actionHandlers[ action ]( event.target, event ); +} else { +bridge.sendMessage( 'linkClicked', { href: event.target.getAttribute( "href" ) }); +event.preventDefault(); +} +} +}; +},{"./bridge":1}],3:[function(require,module,exports){ var bridge = require("./bridge"); var transforms = require("./transforms"); @@ -139,7 +160,7 @@ } } }; -},{"./bridge":1,"./transforms":3}],3:[function(require,module,exports){ +},{"./bridge":1,"./transforms":4}],4:[function(require,module,exports){ var bridge = require("./bridge"); var Transforms = function () {}; @@ -198,4 +219,4 @@ }; module.exports = new Transforms(); -},{"./bridge":1}]},{},[2,3,1]) \ No newline at end of file +},{"./bridge":1}]},{},[3,4,1,2]) \ No newline at end of file diff --git a/wikipedia/assets/linkactions.js b/wikipedia/assets/linkactions.js new file mode 100644 index 000..73feb09 --- /dev/null +++ b/wikipedia/assets/linkactions.js @@ -0,0 +1,20 @@ +var bridge = require('./bridge'); + +var actionHandlers = { +"edit_section": function( el, event ) { +bridge.sendMessage( 'editSectionClicked', { sectionID: el.getAttribute( 'data-id' ) } ); +event.preventDefault(); +} +}; + +document.onclick = function() { +if ( event.target.tagName === "A" ) { +if ( event.target.hasAttribute( "data-action" ) ) { +var action = event.target.getAttribute( "data-action" ); +actionHandlers[ action ]( event.target, event ); +} else { +bridge.sendMessage( 'linkClicked', { href: event.target.getAttribute( "href" ) }); +event.preventDefault(); +} +} +}; \ No newline at end of file -- To view, visit https://gerrit.wikimedia.org/r/108509 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I595bdd5011de1f4ebe25faea16f68afcc8012767 Gerrit-PatchSet: 2 Gerrit-Project: apps/android/wikipedia Gerrit-Branch: master Gerrit-Owner: Yuvipanda Gerrit-Reviewer: Brion VIBBER ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Move handleMessage out of bridge into global namespace - change (apps...wikipedia)
Brion VIBBER has submitted this change and it was merged. Change subject: Move handleMessage out of bridge into global namespace .. Move handleMessage out of bridge into global namespace Since handleMessage shouldn't be called from JS, having it be part of the bridge interface in JS is confusing Change-Id: I560957d89c1927320c6ad57639cc0dbcdc90531f --- M wikipedia/assets/bridge.js M wikipedia/assets/bundle-test.js M wikipedia/assets/bundle.js M wikipedia/assets/main.js M wikipedia/src/main/java/org/wikipedia/CommunicationBridge.java 5 files changed, 28 insertions(+), 31 deletions(-) Approvals: Brion VIBBER: Verified; Looks good to me, approved diff --git a/wikipedia/assets/bridge.js b/wikipedia/assets/bridge.js index 6fb2e1d..4e9f520 100644 --- a/wikipedia/assets/bridge.js +++ b/wikipedia/assets/bridge.js @@ -1,23 +1,24 @@ function Bridge() { -this.eventHandlers = {}; } -// This is called directly from Java, and hence needs to be available -Bridge.prototype.handleMessage = function( type, msgPointer ) { +var eventHandlers = {}; + +// This is called directly from Java +window.handleMessage = function( type, msgPointer ) { var that = this; var payload = JSON.parse( marshaller.getPayload( msgPointer ) ); -if ( this.eventHandlers.hasOwnProperty( type ) ) { -this.eventHandlers[type].forEach( function( callback ) { +if ( eventHandlers.hasOwnProperty( type ) ) { +eventHandlers[type].forEach( function( callback ) { callback.call( that, payload ); } ); } }; Bridge.prototype.registerListener = function( messageType, callback ) { -if ( this.eventHandlers.hasOwnProperty( messageType ) ) { -this.eventHandlers[messageType].push( callback ); +if ( eventHandlers.hasOwnProperty( messageType ) ) { +eventHandlers[messageType].push( callback ); } else { -this.eventHandlers[messageType] = [ callback ]; +eventHandlers[messageType] = [ callback ]; } }; diff --git a/wikipedia/assets/bundle-test.js b/wikipedia/assets/bundle-test.js index e4f9db8..03d6c37 100644 --- a/wikipedia/assets/bundle-test.js +++ b/wikipedia/assets/bundle-test.js @@ -1,24 +1,25 @@ (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;ohttps://gerrit.wikimedia.org/r/108501 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I560957d89c1927320c6ad57639cc0dbcdc90531f Gerrit-PatchSet: 3 Gerrit-Project: apps/android/wikipedia Gerrit-Branch: master Gerrit-Owner: Yuvipanda Gerrit-Reviewer: Brion VIBBER ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add jshint support & fix jshint errors - change (apps...wikipedia)
Brion VIBBER has submitted this change and it was merged. Change subject: Add jshint support & fix jshint errors .. Add jshint support & fix jshint errors Slightly modified version of the .jshintrc file from mediawiki/core.git Change-Id: I18a1aa803e556be33813c32f711c467aeead0a38 --- A wikipedia/assets/.jshintrc M wikipedia/assets/Gruntfile.js M wikipedia/assets/bridge.js M wikipedia/assets/bundle-test.js M wikipedia/assets/bundle.js M wikipedia/assets/main.js M wikipedia/assets/package.json M wikipedia/assets/transforms.js 8 files changed, 110 insertions(+), 72 deletions(-) Approvals: Brion VIBBER: Verified; Looks good to me, approved diff --git a/wikipedia/assets/.jshintrc b/wikipedia/assets/.jshintrc new file mode 100644 index 000..2af4189 --- /dev/null +++ b/wikipedia/assets/.jshintrc @@ -0,0 +1,40 @@ +{ + /* Common */ + + // Enforcing + "camelcase": true, + "curly": true, + "eqeqeq": true, + "immed": true, + "latedef": true, + "newcap": true, + "noarg": true, + "noempty": true, + "nonew": true, + "trailing": true, + "undef": true, + "unused": true, + + /* Local */ + + // Enforcing + "bitwise": true, + "forin": false, + "regexp": false, + "strict": false, + // Relaxing + "laxbreak": true, + "smarttabs": true, + "multistr": true, + // Environment + "browser": true, + // Legacy + "nomen": true, + + "predef": [ + "marshaller", +"require", +"console", +"module" + ] +} diff --git a/wikipedia/assets/Gruntfile.js b/wikipedia/assets/Gruntfile.js index 418f61c..7393171 100644 --- a/wikipedia/assets/Gruntfile.js +++ b/wikipedia/assets/Gruntfile.js @@ -8,10 +8,22 @@ "bundle-test.js": [ "main.js", "bridge.js", "tests/*.js" ] } } +}, +jshint: { +allFiles: [ +"main.js", +"transforms.js", +"bridge.js", +"tests/*.js" +], +options: { +jshintrc: ".jshintrc" +} } } ); grunt.loadNpmTasks( 'grunt-browserify' ); +grunt.loadNpmTasks( 'grunt-contrib-jshint' ); grunt.registerTask( 'default', [ 'browserify' ] ); -} \ No newline at end of file +}; \ No newline at end of file diff --git a/wikipedia/assets/bridge.js b/wikipedia/assets/bridge.js index c7a2fa8..6fb2e1d 100644 --- a/wikipedia/assets/bridge.js +++ b/wikipedia/assets/bridge.js @@ -23,7 +23,7 @@ Bridge.prototype.sendMessage = function( messageType, payload ) { var messagePack = { type: messageType, payload: payload }; -var ret = prompt( JSON.stringify( messagePack) ); +var ret = window.prompt( JSON.stringify( messagePack) ); if ( ret ) { return JSON.parse( ret ); } @@ -33,4 +33,4 @@ // FIXME: Move this to somwehere else, eh? window.onload = function() { module.exports.sendMessage( "DOMLoaded", {} ); -} \ No newline at end of file +}; \ No newline at end of file diff --git a/wikipedia/assets/bundle-test.js b/wikipedia/assets/bundle-test.js index 0f0e85b..e4f9db8 100644 --- a/wikipedia/assets/bundle-test.js +++ b/wikipedia/assets/bundle-test.js @@ -24,7 +24,7 @@ Bridge.prototype.sendMessage = function( messageType, payload ) { var messagePack = { type: messageType, payload: payload }; -var ret = prompt( JSON.stringify( messagePack) ); +var ret = window.prompt( JSON.stringify( messagePack) ); if ( ret ) { return JSON.parse( ret ); } @@ -34,18 +34,12 @@ // FIXME: Move this to somwehere else, eh? window.onload = function() { module.exports.sendMessage( "DOMLoaded", {} ); -} +}; },{}],2:[function(require,module,exports){ var bridge = require("./bridge"); var transforms = require("./transforms"); window.bridge = bridge; - -function forEach( list, fun ) { -// Hack from https://developer.mozilla.org/en-US/docs/Web/API/NodeList#Workarounds -// To let me use forEach on things like NodeList objects -Array.prototype.forEach.call( list, fun ); -} bridge.registerListener( "displayLeadSection", function( payload ) { // This might be a refresh! Clear out all contents! @@ -86,10 +80,10 @@ } bridge.registerListener( "displaySection", function ( payload ) { -var content_wrapper = document.getElementById( "content" ); +var contentWrapper = document.getElementById( "content" ); elementsForSection( payload.section ).forEach( function( element ) { -content_wrapper.appendChild( element ); +contentWrapper.appendChild( element ); }); if ( !payload.isLast ) { bridge.sendMessage( "requestSection", { index: payload.index + 1 } ); @@ -98,7 +92,7 @@ } }); -bridge.registerListener( "startSectionsDisplay", function(
[MediaWiki-commits] [Gerrit] Start using browserify for the JavaScript - change (apps...wikipedia)
Brion VIBBER has submitted this change and it was merged. Change subject: Start using browserify for the JavaScript .. Start using browserify for the JavaScript - Contains gruntfile to do the compilation steps - Unit tests have been separated out into bundle-test.js - Adds package.json to help people get setup easily - Adds directions to README.md on how to run this Change-Id: Ibec6889e7a549d9107e21cf4cf77caa940702fc6 --- M README.md M wikipedia-it/src/main/java/org/wikipedia/test/BridgeTests.java A wikipedia/assets/Gruntfile.js M wikipedia/assets/bridge.js A wikipedia/assets/bundle-test.js A wikipedia/assets/bundle.js M wikipedia/assets/index.html M wikipedia/assets/main.js A wikipedia/assets/package.json A wikipedia/assets/tests.html A wikipedia/assets/tests/inject.js M wikipedia/assets/tests/pingback.js M wikipedia/assets/transforms.js 13 files changed, 677 insertions(+), 213 deletions(-) Approvals: Brion VIBBER: Verified; Looks good to me, approved diff --git a/README.md b/README.md index 87d6710..220396f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,26 @@ See also https://git.wikimedia.org/summary/apps%2Fandroid%2Fjava-mwapi.git +== Updating bundled JavaScript == + +Portions of JavaScript code run inside the WebView component that displays articles. +This code is prepackaged using a [Grunt-js task](http://gruntjs.com/getting-started), which must be re-run every time the master .js files are edited before building. + +Preparing: + +First, install the Grunt CLI tool: +* npm install -g grunt-cli + +Install dependencies for packaging: +* cd wikipedia/assets +* npm install + +Building: + +* cd wikipedia/assets +* grunt + + == Updating icons from SVG == Many of our icons are maintained as SVG originals, rasterized to PNG at the diff --git a/wikipedia-it/src/main/java/org/wikipedia/test/BridgeTests.java b/wikipedia-it/src/main/java/org/wikipedia/test/BridgeTests.java index e84381f..05d41c9 100644 --- a/wikipedia-it/src/main/java/org/wikipedia/test/BridgeTests.java +++ b/wikipedia-it/src/main/java/org/wikipedia/test/BridgeTests.java @@ -26,7 +26,7 @@ public void run() { startActivity(new Intent(), null, null); WebView webView = new WebView(getActivity()); -bridge = new CommunicationBridge(webView, "file:///android_asset/index.html"); +bridge = new CommunicationBridge(webView, "file:///android_asset/tests.html"); bridge.addListener("DOMLoaded", new CommunicationBridge.JSEventListener() { @Override public JSONObject onMessage(String messageType, JSONObject messagePayload) { @@ -47,27 +47,20 @@ public void run() { startActivity(new Intent(), null, null); WebView webView = new WebView(getActivity()); -bridge = new CommunicationBridge(webView, "file:///android_asset/index.html"); +bridge = new CommunicationBridge(webView, "file:///android_asset/tests.html"); final JSONObject payload = new JSONObject(); try { -payload.put("src", "file:///android_asset/tests/pingback.js"); +payload.put("src", "./pingback"); } catch (JSONException e) { throw new RuntimeException(e); // JESUS CHRIST, JAVA! } -bridge.addListener("pingBackLoaded", new CommunicationBridge.JSEventListener() { +bridge.sendMessage("ping", payload); +bridge.addListener("pong", new CommunicationBridge.JSEventListener() { @Override public JSONObject onMessage(String messageType, JSONObject messagePayload) { -assertEquals(messageType, "pingBackLoaded"); -bridge.sendMessage("ping", payload); -bridge.addListener("pong", new CommunicationBridge.JSEventListener() { -@Override -public JSONObject onMessage(String messageType, JSONObject messagePayload) { -assertEquals(messageType, "pong"); -assertEquals(messagePayload.toString(), payload.toString()); -completionLatch.countDown(); -return null; -} -}); +assertEquals(messageType, "pong"); +assertEquals(messagePayload.toString(), payload.toString()); +completionLatch.countDown(); return null; } }); diff --git a/wikipedia/assets/Gruntfile.js b/wikipedia/assets/Gruntfile.js new file mode 100644 index 000..418f61c --- /dev/null +++ b/wikipedia/asset
[MediaWiki-commits] [Gerrit] Changed Mp4Handler class call from wfMsgto wfMessage - change (mediawiki...TimedMediaHandler)
jenkins-bot has submitted this change and it was merged. Change subject: Changed Mp4Handler class call from wfMsgto wfMessage .. Changed Mp4Handler class call from wfMsgto wfMessage wfMsg is deprecated. Changed wgLang to bitrateParams and timeperiodParam Fixed whitespace issue Change-Id: Icbf8bcee7f788bdc707ec0258c53bc8f6bd178c9 --- M handlers/Mp4Handler/Mp4Handler.php 1 file changed, 14 insertions(+), 12 deletions(-) Approvals: Brian Wolff: Looks good to me, approved jenkins-bot: Verified diff --git a/handlers/Mp4Handler/Mp4Handler.php b/handlers/Mp4Handler/Mp4Handler.php index de1958c..897e101 100644 --- a/handlers/Mp4Handler/Mp4Handler.php +++ b/handlers/Mp4Handler/Mp4Handler.php @@ -104,14 +104,14 @@ * @return String */ function getShortDesc( $file ) { - global $wgLang; - $streamTypes = $this->getStreamTypes( $file ); if ( !$streamTypes ) { return parent::getShortDesc( $file ); } - return wfMsg( 'timedmedia-mp4-short-video', implode( '/', $streamTypes ), - $wgLang->formatTimePeriod( $this->getLength( $file ) ) ); + return wfMessage( 'timedmedia-mp4-short-video', implode( '/', $streamTypes ) + )->timeperiodParams( + $this->getLength( $file ) + )->text(); } /** @@ -119,18 +119,20 @@ * @return String */ function getLongDesc( $file ) { - global $wgLang; $streamTypes = $this->getStreamTypes( $file ); if ( !$streamTypes ) { return parent::getLongDesc( $file ); } - return wfMsg('timedmedia-mp4-long-video', - implode( '/', $streamTypes ), - $wgLang->formatTimePeriod( $this->getLength($file) ), - $wgLang->formatBitrate( $this->getBitRate( $file ) ), - $wgLang->formatNum( $file->getWidth() ), - $wgLang->formatNum( $file->getHeight() ) - ); + return wfMessage('timedmedia-mp4-long-video', + implode( '/', $streamTypes ) + )->timeperiodParams( + $this->getLength( $file ) + )->bitrateParams( + $this->getBitRate( $file ) + )->numParams( + $file->getWidth(), + $file->getHeight() + )->text(); } -- To view, visit https://gerrit.wikimedia.org/r/108200 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icbf8bcee7f788bdc707ec0258c53bc8f6bd178c9 Gerrit-PatchSet: 7 Gerrit-Project: mediawiki/extensions/TimedMediaHandler Gerrit-Branch: master Gerrit-Owner: 01tonythomas <01tonytho...@gmail.com> Gerrit-Reviewer: Brian Wolff Gerrit-Reviewer: PleaseStand Gerrit-Reviewer: Siebrand Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix java fallback support on browsers that don't natively do... - change (mediawiki...TimedMediaHandler)
Brian Wolff has uploaded a new change for review. https://gerrit.wikimedia.org/r/108646 Change subject: Fix java fallback support on browsers that don't natively do ogg. .. Fix java fallback support on browsers that don't natively do ogg. TMH was comparing the mime type 'video/ogg; codec="theora, vorbis"' to 'video/ogg; codec="theora,vorbis"' when checking if cortado could play the video. The mime checking code is not very robust and doing string equality comparisions. As a result in the different spacing, TMH determined that the java cortado applet could not play theora videos. This should significantly improve the number of desktop MSIE and Safari users who can play our videos. A future todo would be to make TMH more robust about how it checks mime types. Bug: 60259 Change-Id: I4072ebc592f791be9c3ed898ebb46217e6351cb9 --- M MwEmbedModules/EmbedPlayer/resources/mw.EmbedTypes.js 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TimedMediaHandler refs/changes/46/108646/1 diff --git a/MwEmbedModules/EmbedPlayer/resources/mw.EmbedTypes.js b/MwEmbedModules/EmbedPlayer/resources/mw.EmbedTypes.js index 5f1a6fc..80960a4 100644 --- a/MwEmbedModules/EmbedPlayer/resources/mw.EmbedTypes.js +++ b/MwEmbedModules/EmbedPlayer/resources/mw.EmbedTypes.js @@ -25,7 +25,7 @@ var cortadoPlayer = new mw.MediaPlayer( 'cortado', [ 'video/ogg', 'video/ogg; codecs="theora"', - 'video/ogg; codecs="theora,vorbis"', + 'video/ogg; codecs="theora, vorbis"', 'audio/ogg', 'audio/ogg; codecs="vorbis"', 'application/ogg' @@ -230,7 +230,7 @@ } // Test for ogg - if ( dummyvid.canPlayType( 'video/ogg; codecs="theora,vorbis"' ) ) { + if ( dummyvid.canPlayType( 'video/ogg; codecs="theora, vorbis"' ) ) { this.mediaPlayers.addPlayer( oggNativePlayer ); // older versions of safari do not support canPlayType, // but xiph qt registers mimetype via quicktime plugin -- To view, visit https://gerrit.wikimedia.org/r/108646 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4072ebc592f791be9c3ed898ebb46217e6351cb9 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/TimedMediaHandler Gerrit-Branch: master Gerrit-Owner: Brian Wolff Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Display message when no search results are found - change (apps...wikipedia)
Brion VIBBER has submitted this change and it was merged. Change subject: Display message when no search results are found .. Display message when no search results are found Change-Id: I02ae65f4101ac578c48ae9f3be0060f313f17c72 --- M wikipedia/res/layout/fragment_search.xml M wikipedia/res/values-qq/strings.xml M wikipedia/res/values/strings.xml M wikipedia/src/main/java/org/wikipedia/search/SearchArticlesFragment.java 4 files changed, 18 insertions(+), 8 deletions(-) Approvals: Brion VIBBER: Verified; Looks good to me, approved diff --git a/wikipedia/res/layout/fragment_search.xml b/wikipedia/res/layout/fragment_search.xml index 8de05ca..6337636 100644 --- a/wikipedia/res/layout/fragment_search.xml +++ b/wikipedia/res/layout/fragment_search.xml @@ -76,6 +76,15 @@ + Button text to retry a failed edit save Button text to cancel retrying a failed edit save Menu item text for showing the Table of Contents for the current article +Message shown to user when no search results are found for a string \ No newline at end of file diff --git a/wikipedia/res/values/strings.xml b/wikipedia/res/values/strings.xml index 994991f..e4acfdc 100644 --- a/wikipedia/res/values/strings.xml +++ b/wikipedia/res/values/strings.xml @@ -52,4 +52,5 @@ Retry Cancel Table of Contents +No results found \ No newline at end of file diff --git a/wikipedia/src/main/java/org/wikipedia/search/SearchArticlesFragment.java b/wikipedia/src/main/java/org/wikipedia/search/SearchArticlesFragment.java index 68f8744..a204749 100644 --- a/wikipedia/src/main/java/org/wikipedia/search/SearchArticlesFragment.java +++ b/wikipedia/src/main/java/org/wikipedia/search/SearchArticlesFragment.java @@ -34,6 +34,7 @@ private ListView searchResultsList; private ProgressBar searchProgress; private View searchNetworkError; +private View searchNoResults; private View searchBarMenuButton; private View drawerIndicator; @@ -59,15 +60,11 @@ private void displayResults(List results) { adapter.setResults(results); ((BaseAdapter)searchResultsList.getAdapter()).notifyDataSetInvalidated(); -if (adapter.getCount() == 0) { +if (results == null) { searchResultsList.setVisibility(View.GONE); isSearchActive = false; -// Stupid android, making me hide the keyboard manually -InputMethodManager inputManager = (InputMethodManager) - getActivity().getSystemService(Context.INPUT_METHOD_SERVICE); - inputManager.hideSoftInputFromWindow(getActivity().getCurrentFocus().getWindowToken(), -InputMethodManager.HIDE_NOT_ALWAYS); -getActivity().getCurrentFocus().clearFocus(); +} else if (results.size() == 0) { +searchNoResults.setVisibility(View.VISIBLE); } else { searchResultsList.setVisibility(View.VISIBLE); PageImagesTask imagesTask = new PageImagesTask( @@ -115,6 +112,7 @@ searchNetworkError = parentLayout.findViewById(R.id.search_network_error); searchBarMenuButton = parentLayout.findViewById(R.id.search_bar_show_menu); drawerIndicator = parentLayout.findViewById(R.id.search_drawer_indicator); +searchNoResults = parentLayout.findViewById(R.id.search_results_empty); PopupMenu pageActionsMenu = new PopupMenu(getActivity(), searchBarMenuButton); PageActionsHandler pageActionsHandler = new PageActionsHandler(app.getBus(), pageActionsMenu, searchBarMenuButton); @@ -129,7 +127,7 @@ searchProgress.setVisibility(View.GONE); searchNetworkError.setVisibility(View.GONE); displayResults(result); - searchResultsCache.put(app.getPrimaryLanguage() + "-" + searchTerm, result); +searchResultsCache.put(app.getPrimaryLanguage() + "-" + searchTerm, result); lastSearchedText = searchTerm; curSearchTask = null; } @@ -193,6 +191,7 @@ @Override public void afterTextChanged(final Editable s) { +searchNoResults.setVisibility(View.GONE); startSearch(s.toString()); } }); -- To view, visit https://gerrit.wikimedia.org/r/108148 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I02ae65f4101ac578c48ae9f3be0060f313f17c72 Gerrit-PatchSet: 3 Gerrit-Project: apps/android/wikipedia Gerrit-Branch: master Gerrit-Owner: Yuvipanda Gerrit-Reviewer: Brion VIBBER ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Minor tweaks to scrolling to a section from ToC - change (apps...wikipedia)
Brion VIBBER has submitted this change and it was merged. Change subject: Minor tweaks to scrolling to a section from ToC .. Minor tweaks to scrolling to a section from ToC Make sure that the space from the search bar to the heading is the same as space from left of screen to heading Change-Id: I4d95564b12be6a39a83627fed596bb77479be33a --- M wikipedia/assets/main.js 1 file changed, 4 insertions(+), 2 deletions(-) Approvals: Brion VIBBER: Verified; Looks good to me, approved diff --git a/wikipedia/assets/main.js b/wikipedia/assets/main.js index c8b3ffd..202fda6 100644 --- a/wikipedia/assets/main.js +++ b/wikipedia/assets/main.js @@ -78,8 +78,10 @@ } ); bridge.registerListener( "scrollToSection", function ( payload ) { -// The 52 is for dealing with the search header -var scrollY = document.getElementById( "heading_" + payload.sectionID).offsetTop - 52; +var el = document.getElementById( "heading_" + payload.sectionID); +// Make sure there's exactly as much space on the left as on the top. +// The 48 accounts for the search bar +var scrollY = el.offsetTop - 48 - el.offsetLeft; window.scrollTo(0, scrollY); }); -- To view, visit https://gerrit.wikimedia.org/r/108083 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4d95564b12be6a39a83627fed596bb77479be33a Gerrit-PatchSet: 2 Gerrit-Project: apps/android/wikipedia Gerrit-Branch: master Gerrit-Owner: Yuvipanda Gerrit-Reviewer: Brion VIBBER ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Minor modification to body background - change (apps...wikipedia)
Brion VIBBER has submitted this change and it was merged. Change subject: Minor modification to body background .. Minor modification to body background Based on feedback from designers Change-Id: I245439153fc27a5cfec85bef37a4165a25c98b02 --- M wikipedia/assets/pagestyles.css 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Brion VIBBER: Verified; Looks good to me, approved diff --git a/wikipedia/assets/pagestyles.css b/wikipedia/assets/pagestyles.css index 2462d74..1a7b586 100644 --- a/wikipedia/assets/pagestyles.css +++ b/wikipedia/assets/pagestyles.css @@ -1,6 +1,6 @@ /* Should be moved out to the MobileApp extension at some point */ body { -background-color: #FAFAFA; +background-color: #F2F2F2; color: #333; font-family: sans-serif; font-size: 16px; -- To view, visit https://gerrit.wikimedia.org/r/108081 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I245439153fc27a5cfec85bef37a4165a25c98b02 Gerrit-PatchSet: 2 Gerrit-Project: apps/android/wikipedia Gerrit-Branch: master Gerrit-Owner: Yuvipanda Gerrit-Reviewer: Brion VIBBER ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Switch section headers to sans-serif. Also specify sizes - change (apps...wikipedia)
Brion VIBBER has submitted this change and it was merged. Change subject: Switch section headers to sans-serif. Also specify sizes .. Switch section headers to sans-serif. Also specify sizes Change-Id: I7a4142ce060f036e70c51d831a6d4c9ef19b0152 --- M wikipedia/assets/pagestyles.css 1 file changed, 18 insertions(+), 2 deletions(-) Approvals: Brion VIBBER: Verified; Looks good to me, approved diff --git a/wikipedia/assets/pagestyles.css b/wikipedia/assets/pagestyles.css index 25f8a38..2462d74 100644 --- a/wikipedia/assets/pagestyles.css +++ b/wikipedia/assets/pagestyles.css @@ -23,14 +23,30 @@ h1 { font-family: serif; color: #064AAD; -font-size: 24px; +font-size: 26px; line-height: 36px; margin-bottom: 24px; font-weight: bold; } h2, h3, h4, h5, h6 { -font-family: serif; +font-family: sans-serif; +} + +h2 { +font-size: 22px; +} + +h3 { +font-size: 20px; +} + +h4 { +font-size: 18px; +} + +h5, h6 { +font-size: 16px; } /* Basic Thumbnails */ -- To view, visit https://gerrit.wikimedia.org/r/108080 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7a4142ce060f036e70c51d831a6d4c9ef19b0152 Gerrit-PatchSet: 2 Gerrit-Project: apps/android/wikipedia Gerrit-Branch: master Gerrit-Owner: Yuvipanda Gerrit-Reviewer: Brion VIBBER ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove use of deprecated datamodel classes in \api - change (mediawiki...Wikibase)
Jeroen De Dauw has submitted this change and it was merged. Change subject: Remove use of deprecated datamodel classes in \api .. Remove use of deprecated datamodel classes in \api Change-Id: I56d92ec8d51eac7ebd24b1f48ef550042a216677 --- M repo/tests/phpunit/includes/api/ClaimModificationHelperTest.php M repo/tests/phpunit/includes/api/CreateClaimTest.php M repo/tests/phpunit/includes/api/GetClaimsTest.php M repo/tests/phpunit/includes/api/MergeItemsTest.php M repo/tests/phpunit/includes/api/RemoveClaimsTest.php M repo/tests/phpunit/includes/api/RemoveQualifiersTest.php M repo/tests/phpunit/includes/api/RemoveReferencesTest.php M repo/tests/phpunit/includes/api/ResultBuilderTest.php M repo/tests/phpunit/includes/api/SetClaimValueTest.php M repo/tests/phpunit/includes/api/SetQualifierTest.php M repo/tests/phpunit/includes/api/SetReferenceTest.php M repo/tests/phpunit/includes/api/SnakValidationHelperTest.php 12 files changed, 74 insertions(+), 74 deletions(-) Approvals: Jeroen De Dauw: Verified; Looks good to me, approved diff --git a/repo/tests/phpunit/includes/api/ClaimModificationHelperTest.php b/repo/tests/phpunit/includes/api/ClaimModificationHelperTest.php index bec4e43..62056d6 100644 --- a/repo/tests/phpunit/includes/api/ClaimModificationHelperTest.php +++ b/repo/tests/phpunit/includes/api/ClaimModificationHelperTest.php @@ -8,10 +8,10 @@ use ApiMain; use Wikibase\Api\ClaimModificationHelper; use Wikibase\Api\SnakValidationHelper; -use Wikibase\PropertyValueSnak; +use Wikibase\DataModel\Claim\Claims; +use Wikibase\DataModel\Snak\PropertyValueSnak; use Wikibase\Repo\WikibaseRepo; use Wikibase\ItemContent; -use Wikibase\Claims; use Wikibase\Validators\ValidatorErrorLocalizer; /** diff --git a/repo/tests/phpunit/includes/api/CreateClaimTest.php b/repo/tests/phpunit/includes/api/CreateClaimTest.php index 69b24e3..12de8ea 100644 --- a/repo/tests/phpunit/includes/api/CreateClaimTest.php +++ b/repo/tests/phpunit/includes/api/CreateClaimTest.php @@ -3,11 +3,11 @@ namespace Wikibase\Test\Api; use UsageException; -use Wikibase\Claims; -use Wikibase\Entity; -use Wikibase\Item; +use Wikibase\DataModel\Claim\Claims; +use Wikibase\DataModel\Entity\Property; +use Wikibase\DataModel\Entity\Entity; +use Wikibase\DataModel\Entity\Item; use Wikibase\ItemContent; -use Wikibase\Property; use Wikibase\PropertyContent; use Wikibase\Repo\WikibaseRepo; diff --git a/repo/tests/phpunit/includes/api/GetClaimsTest.php b/repo/tests/phpunit/includes/api/GetClaimsTest.php index 7d41698..9ca633d 100644 --- a/repo/tests/phpunit/includes/api/GetClaimsTest.php +++ b/repo/tests/phpunit/includes/api/GetClaimsTest.php @@ -4,19 +4,19 @@ use DataValues\StringValue; use UsageException; -use Wikibase\Entity; -use Wikibase\Claim; -use Wikibase\Claims; -use Wikibase\Item; +use Wikibase\DataModel\Claim\Statement; +use Wikibase\DataModel\Entity\Entity; +use Wikibase\DataModel\Claim\Claim; +use Wikibase\DataModel\Claim\Claims; +use Wikibase\DataModel\Entity\Item; use Wikibase\Lib\Serializers\ClaimSerializer; use Wikibase\Lib\Serializers\SerializationOptions; use Wikibase\Lib\Serializers\SerializerFactory; -use Wikibase\Property; -use Wikibase\PropertyNoValueSnak; -use Wikibase\PropertySomeValueSnak; -use Wikibase\PropertyValueSnak; +use Wikibase\DataModel\Entity\Property; +use Wikibase\DataModel\Snak\PropertyNoValueSnak; +use Wikibase\DataModel\Snak\PropertySomeValueSnak; +use Wikibase\DataModel\Snak\PropertyValueSnak; use Wikibase\Repo\WikibaseRepo; -use Wikibase\Statement; /** * @covers Wikibase\Api\GetClaims diff --git a/repo/tests/phpunit/includes/api/MergeItemsTest.php b/repo/tests/phpunit/includes/api/MergeItemsTest.php index e759abf..91fa1dc 100644 --- a/repo/tests/phpunit/includes/api/MergeItemsTest.php +++ b/repo/tests/phpunit/includes/api/MergeItemsTest.php @@ -183,7 +183,7 @@ 'value' => 'imastring', 'type' => 'string' ) - ) ) ) ) ) ) ) ) ), + ) ) ) ) ) ) ) ) ), array( 'claims' => array( '{Prop}' => array( array( 'mainsnak' => @@ -191,7 +191,7 @@ array( 'value' => 'imastring', 'type' => 'string' ) ), 'type' => 'statement', 'rank' => 'normal' - ) ) ) ), + ) ) ) ), array(), //empty array( 'claims' => array( '{Prop}' => @@ -209,7 +209
[MediaWiki-commits] [Gerrit] Increase default search count to 12 - change (apps...wikipedia)
Brion VIBBER has submitted this change and it was merged. Change subject: Increase default search count to 12 .. Increase default search count to 12 Based off designer feedback Change-Id: Icbccadb089a2ce650fdcfe4f0560aa5ef0087441 --- M wikipedia/src/main/java/org/wikipedia/search/SearchArticlesTask.java 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Brion VIBBER: Verified; Looks good to me, approved diff --git a/wikipedia/src/main/java/org/wikipedia/search/SearchArticlesTask.java b/wikipedia/src/main/java/org/wikipedia/search/SearchArticlesTask.java index 68bec2a..d788ba6 100644 --- a/wikipedia/src/main/java/org/wikipedia/search/SearchArticlesTask.java +++ b/wikipedia/src/main/java/org/wikipedia/search/SearchArticlesTask.java @@ -24,7 +24,7 @@ @Override public RequestBuilder buildRequest(Api api) { -return api.action("opensearch").param("search", prefix).param("limit", "5"); +return api.action("opensearch").param("search", prefix).param("limit", "12"); } @Override -- To view, visit https://gerrit.wikimedia.org/r/108077 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icbccadb089a2ce650fdcfe4f0560aa5ef0087441 Gerrit-PatchSet: 4 Gerrit-Project: apps/android/wikipedia Gerrit-Branch: master Gerrit-Owner: Yuvipanda Gerrit-Reviewer: Brion VIBBER ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Cleanup global injections - change (mediawiki...Wikibase)
jenkins-bot has submitted this change and it was merged. Change subject: Cleanup global injections .. Cleanup global injections Change-Id: I85377bf5f000ba2234f7f357792d287d7b7c21ef --- M lib/resources/formatters/ApiBasedValueFormatter.js M lib/resources/formatters/wikibase.formatters.register.js M lib/resources/jquery.ui/jquery.ui.TemplatedWidget.js M lib/resources/jquery.valueview.experts.wikibase/experts.wikibase.EntityIdInput.js M lib/resources/jquery.valueview.experts.wikibase/experts.wikibase.EntityIdValue.js M lib/resources/jquery.valueview.experts.wikibase/experts.wikibase.js M lib/resources/jquery.wikibase/jquery.wikibase.claimlistview.js M lib/resources/jquery.wikibase/jquery.wikibase.listview.ListItemAdapter.js M lib/resources/jquery.wikibase/jquery.wikibase.listview.js M lib/resources/jquery.wikibase/jquery.wikibase.snakview/snakview.ViewState.js M lib/resources/jquery.wikibase/jquery.wikibase.snakview/snakview.js M lib/resources/jquery.wikibase/jquery.wikibase.snakview/snakview.variations.Value.js M lib/resources/jquery.wikibase/jquery.wikibase.snakview/snakview.variations.Variation.js M lib/resources/jquery.wikibase/jquery.wikibase.snakview/snakview.variations.js M lib/resources/jquery.wikibase/jquery.wikibase.wbtooltip.js M lib/resources/jquery.wikibase/toolbar/movetoolbar.js M lib/resources/jquery.wikibase/toolbar/removetoolbar.js M lib/resources/jquery.wikibase/toolbar/toolbar.js M lib/resources/jquery.wikibase/toolbar/toolbarbase.js M lib/resources/jquery.wikibase/toolbar/toolbarbutton.js M lib/resources/jquery.wikibase/toolbar/toolbarcontroller.js M lib/resources/jquery.wikibase/toolbar/toolbareditgroup.js M lib/resources/wikibase.RepoApi/wikibase.AbstractedRepoApi.js M lib/resources/wikibase.RevisionStore.js M lib/resources/wikibase.ui.Base.js M lib/resources/wikibase.utilities/wikibase.utilities.ClaimGuidGenerator.js M lib/resources/wikibase.utilities/wikibase.utilities.GuidGenerator.js M lib/resources/wikibase.utilities/wikibase.utilities.jQuery.js M lib/resources/wikibase.utilities/wikibase.utilities.ui.StatableObject.js M lib/tests/qunit/jquery.wikibase/jquery.wikibase.claimview.tests.js M lib/tests/qunit/jquery.wikibase/jquery.wikibase.listview.tests.js M lib/tests/qunit/jquery.wikibase/jquery.wikibase.siteselector.tests.js M lib/tests/qunit/jquery.wikibase/jquery.wikibase.snaklistview.tests.js M lib/tests/qunit/jquery.wikibase/jquery.wikibase.statementview.RankSelector.tests.js M lib/tests/qunit/jquery.wikibase/jquery.wikibase.wbtooltip.tests.js M lib/tests/qunit/jquery.wikibase/toolbar/movetoolbar.tests.js M lib/tests/qunit/jquery.wikibase/toolbar/toolbar.tests.js M lib/tests/qunit/jquery.wikibase/toolbar/toolbarbutton.tests.js M lib/tests/qunit/jquery.wikibase/toolbar/toolbareditgroup.tests.js M lib/tests/qunit/jquery.wikibase/toolbar/toolbarlabel.tests.js M lib/tests/qunit/wikibase.ui.SiteLinksEditTool.tests.js 41 files changed, 83 insertions(+), 89 deletions(-) Approvals: Jeroen De Dauw: Looks good to me, approved jenkins-bot: Verified diff --git a/lib/resources/formatters/ApiBasedValueFormatter.js b/lib/resources/formatters/ApiBasedValueFormatter.js index 1e018a2..ae4c81d 100644 --- a/lib/resources/formatters/ApiBasedValueFormatter.js +++ b/lib/resources/formatters/ApiBasedValueFormatter.js @@ -2,7 +2,7 @@ * @licence GNU GPL v2+ * @author H. Snater < mediaw...@snater.com > */ -( function( mw, $, wb, vf ) { +( function( $, wb, vf ) { 'use strict'; var PARENT = vf.ValueFormatter; @@ -38,4 +38,4 @@ } ); -}( mediaWiki, jQuery, wikibase, valueFormatters ) ); +}( jQuery, wikibase, valueFormatters ) ); diff --git a/lib/resources/formatters/wikibase.formatters.register.js b/lib/resources/formatters/wikibase.formatters.register.js index 6b08e86..9e2efca 100644 --- a/lib/resources/formatters/wikibase.formatters.register.js +++ b/lib/resources/formatters/wikibase.formatters.register.js @@ -2,7 +2,7 @@ * @licence GNU GPL v2+ * @author H. Snater < mediaw...@snater.com > */ -( function( mw, wb, vf, dv ) { +( function( mw, wb, dv ) { 'use strict'; // Register Wikibase specific formatter: @@ -12,4 +12,4 @@ wb.formatters.QuantityFormatter ); -}( mediaWiki, wikibase, valueFormatters, dataValues ) ); +}( mediaWiki, wikibase, dataValues ) ); diff --git a/lib/resources/jquery.ui/jquery.ui.TemplatedWidget.js b/lib/resources/jquery.ui/jquery.ui.TemplatedWidget.js index 3fe8978..b71d822 100644 --- a/lib/resources/jquery.ui/jquery.ui.TemplatedWidget.js +++ b/lib/resources/jquery.ui/jquery.ui.TemplatedWidget.js @@ -3,7 +3,7 @@ * @licence GNU GPL v2+ * @author Daniel Werner < daniel.wer...@wikimedia.de > */ -( function( mw, wb, $ ) { +( function( wb, $ ) { 'use strict'; var PARENT = $.Widget; @@ -134,4 +134,4 @@ } } ); -}( mediaWiki, wikibase, jQuery ) ); +}( wikibase, jQuery ) ); d
[MediaWiki-commits] [Gerrit] Ignore selenium test vendor modules in jshint - change (mediawiki...Wikibase)
Jeroen De Dauw has submitted this change and it was merged. Change subject: Ignore selenium test vendor modules in jshint .. Ignore selenium test vendor modules in jshint Change-Id: Iaca6385c154be1bb077920af888d6a8d6099109a --- M .jshintignore 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Jeroen De Dauw: Verified; Looks good to me, approved diff --git a/.jshintignore b/.jshintignore index eea9c1c..509464d 100644 --- a/.jshintignore +++ b/.jshintignore @@ -37,3 +37,4 @@ ./lib/tests/qunit/wikibase.utilities/wikibase.utilities.newExtension.tests.js ./lib/tests/qunit/wikibase.utilities/wikibase.utilities.ObservableObject.tests.js ./lib/tests/qunit/wikibase.utilities/wikibase.utilities.ui.StatableObject.tests.js +./tests/browser/vendor/ -- To view, visit https://gerrit.wikimedia.org/r/108496 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iaca6385c154be1bb077920af888d6a8d6099109a Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Adrian Lang Gerrit-Reviewer: Henning Snater Gerrit-Reviewer: Jeroen De Dauw Gerrit-Reviewer: Tobias Gritschacher Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Adding MultimediaViewer repo to list of repos with browser t... - change (mediawiki/selenium)
Jhall has uploaded a new change for review. https://gerrit.wikimedia.org/r/108645 Change subject: Adding MultimediaViewer repo to list of repos with browser tests. .. Adding MultimediaViewer repo to list of repos with browser tests. Change-Id: I31bac0dd86b83ee629266d9925c3b9cb8446f797 See: https://gerrit.wikimedia.org/r/#/c/107517/ --- M README.md 1 file changed, 7 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/selenium refs/changes/45/108645/1 diff --git a/README.md b/README.md index 33f26ce..55c1ed7 100644 --- a/README.md +++ b/README.md @@ -57,12 +57,13 @@ 2. ContentTranslation: [Gerrit](https://gerrit.wikimedia.org/r/#/admin/projects/mediawiki/extensions/ContentTranslation), [GitHub](https://github.com/wikimedia/mediawiki-extensions-ContentTranslation), [Code Climate](https://codeclimate.com/github/wikimedia/mediawiki-extensions-ContentTranslation), `/tests/browser` folder 3. Flow: [Gerrit](https://gerrit.wikimedia.org/r/#/admin/projects/mediawiki/extensions/Flow), [GitHub](https://github.com/wikimedia/mediawiki-extensions-Flow), [Jenkins](https://wmf.ci.cloudbees.com/view/r-fl/), [Code Climate](https://codeclimate.com/github/wikimedia/mediawiki-extensions-Flow), `/tests/browser` folder 4. MobileFrontend: [Gerrit](https://gerrit.wikimedia.org/r/#/admin/projects/mediawiki/extensions/MobileFrontend), [GitHub](https://github.com/wikimedia/mediawiki-extensions-MobileFrontend), [Jenkins](https://wmf.ci.cloudbees.com/view/r-mf/), [Code Climate](https://codeclimate.com/github/wikimedia/mediawiki-extensions-MobileFrontend), `/tests/browser` folder -5. Translate: [Gerrit](https://gerrit.wikimedia.org/r/#/admin/projects/mediawiki/extensions/Translate), [GitHub](https://github.com/wikimedia/mediawiki-extensions-Translate), [Jenkins](https://wmf.ci.cloudbees.com/view/r-tr/), [Code Climate](https://codeclimate.com/github/wikimedia/mediawiki-extensions-Translate), `/tests/browser` folder -6. TwnMainPage: [Gerrit](https://gerrit.wikimedia.org/r/#/admin/projects/mediawiki/extensions/TwnMainPage), [GitHub](https://github.com/wikimedia/mediawiki-extensions-TwnMainPage), [Jenkins](https://wmf.ci.cloudbees.com/view/r-tw/), [Code Climate](https://codeclimate.com/github/wikimedia/mediawiki-extensions-TwnMainPage), `/tests/browser` folder -7. UniversalLanguageSelector: [Gerrit](https://gerrit.wikimedia.org/r/#/admin/projects/mediawiki/extensions/UniversalLanguageSelector), [GitHub](https://github.com/wikimedia/mediawiki-extensions-UniversalLanguageSelector), [Jenkins](https://wmf.ci.cloudbees.com/view/r-uls/), [Code Climate](https://codeclimate.com/github/wikimedia/mediawiki-extensions-UniversalLanguageSelector), `/tests/browser` folder -8. VisualEditor: [Gerrit](https://gerrit.wikimedia.org/r/#/admin/projects/mediawiki/extensions/VisualEditor), [GitHub](https://github.com/wikimedia/mediawiki-extensions-VisualEditor), [Jenkins](https://wmf.ci.cloudbees.com/view/r-ve/), [Code Climate](https://codeclimate.com/github/wikimedia/mediawiki-extensions-VisualEditor), `/modules/ve-mw/test/browser` folder -9. Wikibase: [Gerrit](https://gerrit.wikimedia.org/r/#/admin/projects/mediawiki/extensions/Wikibase), [GitHub](https://github.com/wikimedia/mediawiki-extensions-Wikibase), [Jenkins](https://wikidata-cloudbees.ci.cloudbees.com/), [Code Climate](https://codeclimate.com/github/wikimedia/mediawiki-extensions-Wikibase), `/tests/browser` folder -10. browsertests: [Gerrit](https://gerrit.wikimedia.org/r/#/admin/projects/qa/browsertests), [GitHub](https://github.com/wikimedia/qa-browsertests), [Jenkins](https://wmf.ci.cloudbees.com/view/r-bt/), [Code Climate](https://codeclimate.com/github/wikimedia/qa-browsertests), `/` folder +5. MultimediaViewer: [Gerrit](https://gerrit.wikimedia.org/r/#/admin/projects/mediawiki/extensions/MultimediaViewer), [GitHub](https://github.com/wikimedia/mediawiki-extensions-MultimediaViewer), [Jenkins](pending), [Code Climate](https://codeclimate.com/github/wikimedia/mediawiki-extensions-MultimediaViewer), `/tests/browser` folder +6. Translate: [Gerrit](https://gerrit.wikimedia.org/r/#/admin/projects/mediawiki/extensions/Translate), [GitHub](https://github.com/wikimedia/mediawiki-extensions-Translate), [Jenkins](https://wmf.ci.cloudbees.com/view/r-tr/), [Code Climate](https://codeclimate.com/github/wikimedia/mediawiki-extensions-Translate), `/tests/browser` folder +7. TwnMainPage: [Gerrit](https://gerrit.wikimedia.org/r/#/admin/projects/mediawiki/extensions/TwnMainPage), [GitHub](https://github.com/wikimedia/mediawiki-extensions-TwnMainPage), [Jenkins](https://wmf.ci.cloudbees.com/view/r-tw/), [Code Climate](https://codeclimate.com/github/wikimedia/mediawiki-extensions-TwnMainPage), `/tests/browser` folder +8. UniversalLanguageSelector: [Gerrit](https://gerrit.wikimedia.org/r/#/admin/projects/mediawiki/extensions/UniversalLanguageSel
[MediaWiki-commits] [Gerrit] Initial setup for Multimedia Viewer browser tests and first ... - change (mediawiki...MultimediaViewer)
jenkins-bot has submitted this change and it was merged. Change subject: Initial setup for Multimedia Viewer browser tests and first basic e2e test. .. Initial setup for Multimedia Viewer browser tests and first basic e2e test. Did some clean-up for Cucumber tags and code conventions. Change-Id: Ifc954f60a50c41211043493fd64c2dcfa64848ff Mingle: Multimedia card #100 Bug: 60049 --- A tests/browser/Gemfile A tests/browser/Gemfile.lock A tests/browser/config/config.yml A tests/browser/config/cucumber.yml A tests/browser/features/basic_mmv_navigation.feature A tests/browser/features/step_definitions/basic_mmv_navigation_steps.rb A tests/browser/features/support/env.rb A tests/browser/features/support/modules/url_module.rb A tests/browser/features/support/pages/lightbox_demo_page.rb A tests/browser/features/support/pages/login_page.rb 10 files changed, 295 insertions(+), 0 deletions(-) Approvals: Jhall: Looks good to me, approved jenkins-bot: Verified diff --git a/tests/browser/Gemfile b/tests/browser/Gemfile new file mode 100755 index 000..cfb6071 --- /dev/null +++ b/tests/browser/Gemfile @@ -0,0 +1,6 @@ +#ruby=ruby-2.1.0 +#ruby-gemset=MultimediaViewer + +source "https://rubygems.org"; + +gem "mediawiki-selenium" diff --git a/tests/browser/Gemfile.lock b/tests/browser/Gemfile.lock new file mode 100644 index 000..d031985 --- /dev/null +++ b/tests/browser/Gemfile.lock @@ -0,0 +1,63 @@ +GEM + remote: https://rubygems.org/ + specs: +builder (3.2.2) +childprocess (0.3.9) + ffi (~> 1.0, >= 1.0.11) +chunky_png (1.2.9) +cucumber (1.3.10) + builder (>= 2.1.2) + diff-lcs (>= 1.1.3) + gherkin (~> 2.12) + multi_json (>= 1.7.5, < 2.0) + multi_test (>= 0.0.2) +data_magic (0.16.1) + faker (>= 1.1.2) + yml_reader (>= 0.2) +diff-lcs (1.2.5) +faker (1.2.0) + i18n (~> 0.5) +ffi (1.9.3) +gherkin (2.12.2) + multi_json (~> 1.3) +i18n (0.6.9) +json (1.8.1) +mediawiki-selenium (0.1.15) + cucumber + json + net-http-persistent + page-object + rest-client + rspec-expectations + syntax +mime-types (2.0) +multi_json (1.8.2) +multi_test (0.0.3) +net-http-persistent (2.9) +page-object (0.9.4) + page_navigation (>= 0.8) + selenium-webdriver (>= 2.37.0) + watir-webdriver (>= 0.6.4) +page_navigation (0.9) + data_magic (>= 0.14) +rest-client (1.6.7) + mime-types (>= 1.16) +rspec-expectations (2.14.4) + diff-lcs (>= 1.1.3, < 2.0) +rubyzip (1.1.0) +selenium-webdriver (2.39.0) + childprocess (>= 0.2.5) + multi_json (~> 1.0) + rubyzip (~> 1.0) + websocket (~> 1.0.4) +syntax (1.2.0) +watir-webdriver (0.6.4) + selenium-webdriver (>= 2.18.0) +websocket (1.0.7) +yml_reader (0.2) + +PLATFORMS + ruby + +DEPENDENCIES + mediawiki-selenium diff --git a/tests/browser/config/config.yml b/tests/browser/config/config.yml new file mode 100644 index 000..4db3853 --- /dev/null +++ b/tests/browser/config/config.yml @@ -0,0 +1,36 @@ +mediawiki_username: Selenium_user + +chrome: + name: chrome + platform: Linux + version: + +firefox: + name: firefox + platform: Linux + version: 25 + +internet_explorer_6: + name: internet_explorer + platform: Windows XP + version: 6 + +internet_explorer_7: + name: internet_explorer + platform: Windows XP + version: 7 + +internet_explorer_8: + name: internet_explorer + platform: Windows XP + version: 8 + +internet_explorer_9: + name: internet_explorer + platform: Windows 7 + version: 9 + +internet_explorer_10: + name: internet_explorer + platform: Windows 8 + version: 10 \ No newline at end of file diff --git a/tests/browser/config/cucumber.yml b/tests/browser/config/cucumber.yml new file mode 100644 index 000..150c284 --- /dev/null +++ b/tests/browser/config/cucumber.yml @@ -0,0 +1,2 @@ +ci: --format Cucumber::Formatter::Sauce --out reports/junit +default: --format progress diff --git a/tests/browser/features/basic_mmv_navigation.feature b/tests/browser/features/basic_mmv_navigation.feature new file mode 100644 index 000..c24a33c --- /dev/null +++ b/tests/browser/features/basic_mmv_navigation.feature @@ -0,0 +1,25 @@ +@en.wikipedia.beta.wmflabs.org +Feature: Basic Multimedia Viewer navigation + + NOTE: This test should be run against '/Lightbox_demo' to work correctly + + Original acceptance criteria: + 1) Open MMV + 2) Check metadata and picture are there + 3) Move to next image + 4) Check corresponding metadata and picture are there + 5) Move to the previous image + 6) Check corresponding metadata and picture are there + 7) Close MV and make sure we go back to article. + + Scenario: Multimedia Viewer (MMV) +Given I am logged in +And I am at a wiki article with at least two embedded pictures +When I click on the first image in the article +The
[MediaWiki-commits] [Gerrit] Use automatically generated classmap rather than a manual on... - change (mediawiki...Wikibase)
Jeroen De Dauw has uploaded a new change for review. https://gerrit.wikimedia.org/r/108644 Change subject: Use automatically generated classmap rather than a manual one for Wikibase Lib .. Use automatically generated classmap rather than a manual one for Wikibase Lib Change-Id: Id07dbe1f46b0e3fd165426a198be856fa83ab6b1 --- M composer.json D lib/WikibaseLib.classes.php M lib/WikibaseLib.php 3 files changed, 8 insertions(+), 241 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/44/108644/1 diff --git a/composer.json b/composer.json index 577bc3c..4a613eb 100644 --- a/composer.json +++ b/composer.json @@ -42,9 +42,13 @@ "Wikibase.composer.php" ], "classmap": [ - "client/includes", + "client/includes/", "client/WikibaseClient.hooks.php", - "client/tests/phpunit/MockPageUpdater.php" + "client/tests/phpunit/MockPageUpdater.php", + + "lib/includes/", + "lib/WikibaseLib.hooks.php", + "lib/tests/phpunit/" ] } } diff --git a/lib/WikibaseLib.classes.php b/lib/WikibaseLib.classes.php deleted file mode 100644 index a5f78e3..000 --- a/lib/WikibaseLib.classes.php +++ /dev/null @@ -1,233 +0,0 @@ - - */ -return call_user_func( function() { - - $classes = array( - // Autoloading - 'Wikibase\LibHooks' => 'WikibaseLib.hooks.php', - - // generic things that could be factored out - 'Disposable' => 'includes/Disposable.php', - - // includes - 'Wikibase\ChangeNotifier' => 'includes/ChangeNotifier.php', - 'Wikibase\ChangeNotificationJob' => 'includes/ChangeNotificationJob.php', - 'Wikibase\UpdateRepoOnMoveJob' => 'includes/UpdateRepoOnMoveJob.php', - 'Wikibase\ChangesTable' => 'includes/ChangesTable.php', - 'Wikibase\DiffOpValueFormatter' => 'includes/DiffOpValueFormatter.php', - 'Wikibase\DiffView' => 'includes/DiffView.php', - 'Wikibase\LanguageFallbackChain' => 'includes/LanguageFallbackChain.php', - 'Wikibase\LanguageFallbackChainFactory' => 'includes/LanguageFallbackChainFactory.php', - 'Wikibase\LanguageWithConversion' => 'includes/LanguageWithConversion.php', - 'Wikibase\Lib\GuidGenerator' => 'includes/GuidGenerator.php', - 'Wikibase\Lib\V4GuidGenerator' => 'includes/V4GuidGenerator.php', - 'Wikibase\Lib\EntityRetrievingDataTypeLookup' => 'includes/EntityRetrievingDataTypeLookup.php', - 'Wikibase\Lib\PropertyInfoDataTypeLookup' => 'includes/PropertyInfoDataTypeLookup.php', - 'Wikibase\Lib\ClaimGuidGenerator' => 'includes/ClaimGuidGenerator.php', - 'Wikibase\Lib\ClaimGuidValidator' => 'includes/ClaimGuidValidator.php', - 'Wikibase\Lib\InMemoryDataTypeLookup' => 'includes/InMemoryDataTypeLookup.php', - 'Wikibase\LibRegistry' => 'includes/LibRegistry.php', - 'Wikibase\Template' => 'includes/TemplateRegistry.php', - 'Wikibase\TemplateRegistry' => 'includes/TemplateRegistry.php', - 'Wikibase\ReferencedEntitiesFinder' => 'includes/ReferencedEntitiesFinder.php', - 'Wikibase\ReferencedUrlFinder' => 'includes/ReferencedUrlFinder.php', - 'Wikibase\Lib\PropertyDataTypeLookup' => 'includes/PropertyDataTypeLookup.php', - 'Wikibase\Lib\PropertyLabelNotResolvedException' => 'includes/PropertyLabelNotResolvedException.php', - 'Wikibase\Lib\PropertyNotFoundException' => 'includes/PropertyNotFoundException.php', - 'Wikibase\Settings' => 'includes/Settings.php', - 'Wikibase\SettingsArray' => 'includes/SettingsArray.php', - 'Wikibase\SiteLink' => 'includes/SiteLink.php', - 'Wikibase\Lib\SnakConstructionService' => 'includes/SnakConstructionService.php', - 'Wikibase\SnakFactory' => 'includes/SnakFactory.php', - 'Wikibase\Summary' => 'includes/Summary.php', - 'Wikibase\Term' => 'includes/Term.php', - 'Wikibase\Lib\TermsToClaimsTranslator' => 'includes/TermsToClaimsTranslator.php', - 'Wikibase\Lib\TypedValueFormatter' => 'includes/TypedValueFormatter.php', - 'Wikibase\StringNormalizer' => 'includes/StringNormalizer.php', - 'Wikibase\Utils' => 'includes/Utils.php', - 'Wikibase\WikibaseDiffOpFactory' => 'includes/WikibaseDiffOpFactory.php', - 'Wikibase\Lib\WikibaseDataTypeBuilders' => 'includes/WikibaseDataTypeBuilders.php', - 'DataValues\DataVa
[MediaWiki-commits] [Gerrit] Puppetizing wikimetrics - change (operations...wikimetrics)
Ottomata has uploaded a new change for review. https://gerrit.wikimedia.org/r/108643 Change subject: Puppetizing wikimetrics .. Puppetizing wikimetrics Still WIP Change-Id: I5e06c12ac442fd889da701a7f9adbfed030130d8 --- A manifests/database.pp A manifests/init.pp A manifests/queue.pp A manifests/web.pp A templates/db_config.yaml.erb A templates/queue_config.yaml.erb A templates/upstart.wikimetrics-queue.conf.erb A templates/web_config.yaml.erb A templates/wikimetrics.vhost.erb 9 files changed, 331 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet/wikimetrics refs/changes/43/108643/1 diff --git a/manifests/database.pp b/manifests/database.pp new file mode 100644 index 000..a480f60 --- /dev/null +++ b/manifests/database.pp @@ -0,0 +1,50 @@ +# == Class wikimetrics::database +# +# Note that this class does not support running +# the Wikimetrics datbase on a different host than where your +# queue and web services will run. Permissions will only be granted +# for localhost MySQL users. You will have to grant permissions +# for remote hosts to connect to MySQL and the wikimetrics database manually. +# +class wikimetrics::database( +$db_pass = 'wikimetrics', # you should really change this one +$db_name = 'wikimetrics', +$db_user = 'wikimetrics', +$db_root_user = 'root', +$db_root_pass = undef, +) +{ +if !defined(Package['mysql-server']) { +package { 'mysql-server': +ensure => 'installed', +} +} + +# Only use -u or -p flag to mysql commands if +# root username or root password are set. +$username_option = $db_root_user ? { +undef => '', +default => "-u'${db_root_user}'", +} +$password_option = $db_root_pass ? { +undef => '', +default => "-p'${db_root_pass}'", +} + +# wikimetrics is going to need a wikimetrics database and user. +exec { 'wikimetrics_mysql_create_database': +command => "/usr/bin/mysql ${username_option} ${password_option} -e \"CREATE DATABASE ${db_name}; USE ${db_name};\"", +unless => "/usr/bin/mysql ${username_option} ${password_option} -e 'SHOW DATABASES' | /bin/grep -q ${db_name}", +user=> 'root', +} +exec { 'wikimetrics_mysql_create_user': +command => "/usr/bin/mysql ${username_option} ${password_option} -e \" +CREATE USER '${db_user}'@'localhost' IDENTIFIED BY '${db_pass}'; +CREATE USER '${db_user}'@'127.0.0.1' IDENTIFIED BY '${db_pass}'; +GRANT ALL PRIVILEGES ON ${db_name}.* TO '${db_user}'@'localhost' WITH GRANT OPTION; +GRANT ALL PRIVILEGES ON ${db_name}.* TO '${db_user}'@'127.0.0.1' WITH GRANT OPTION; +FLUSH PRIVILEGES;\"", +unless => "/usr/bin/mysql ${username_option} ${password_option} -e \"SHOW GRANTS FOR '${db_user}'@'127.0.0.1'\" | grep -q \"TO '${db_user}'\"", +user=> 'root', +} +} diff --git a/manifests/init.pp b/manifests/init.pp new file mode 100644 index 000..d097706 --- /dev/null +++ b/manifests/init.pp @@ -0,0 +1,107 @@ +# == Class wikimetrics +# +class wikimetrics( +# path in which to install wikimetrics +$path = '/srv/wikimetrics', + +$user = 'wikimetrics', +$group = 'wikimetrics', + +# celery broker and result urls. Should be redis server URLs +$celery_broker_url = 'redis://localhost:6379/0', +$celery_result_url = 'redis://localhost:6379/0', + +# VirtualHost ServerName of wikimetrics webserver +$server_name = 'localhost', #"wikimetrics.${::domain}", +$server_port = 5000, +# if true, site is expected to be served via HTTPS. +$ssl_redirect = false, +# VirtualHost ServerAliases. +$server_aliases= [], + +# Flask login secret key +$flask_secret_key = 'flask_secret_key', # this is arbitrary + +# Mediawiki OAuth +$meta_mw_consumer_key = 'bad4e459823278bdffb5ecf0a206112d', +$meta_mw_client_secret = 'e312699be56f1d157657727a87ce3776e172501a', + +# Google Auth +$google_client_secret = 'zKv0Qg7Zr6L3Q3CaWnIuVX4B', +$google_client_email = '133082872...@developer.gserviceaccount.com', +$google_client_id = '133082872359.apps.googleusercontent.com', + +# Wikimetrics Database Creds +$db_user_wikimetrics = 'wikimetrics', +$db_pass_wikimetrics = 'wikimetrics', +$db_name_wikimetrics = 'wikimetrics', +$db_host_wikimetrics = 'localhost', + +# LabsDB Database Creds +$db_user_labsdb= 'wikimetrics', +$db_pass_labsdb= 'wikimetrics', +$db_host_labsdb= '{0}.labsdb', +$db_name_labsdb= '{0}_p', + +$config_directory = '/etc/wikimetrics', +) +{ +if !defined(Group[$group]) { +group { $group: + ensure => present, + system => true, +} +} + +
[MediaWiki-commits] [Gerrit] DNM - run composer update in test bootstrap to rebuild classmap - change (mediawiki...Wikibase)
Jeroen De Dauw has uploaded a new change for review. https://gerrit.wikimedia.org/r/108642 Change subject: DNM - run composer update in test bootstrap to rebuild classmap .. DNM - run composer update in test bootstrap to rebuild classmap Change-Id: If9ec55856d9837b1c8c38299d045b6635b71a01c --- A phpunit.xml.dist A tests/bootstrap.php 2 files changed, 27 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/42/108642/1 diff --git a/phpunit.xml.dist b/phpunit.xml.dist new file mode 100644 index 000..1ce83fa --- /dev/null +++ b/phpunit.xml.dist @@ -0,0 +1,15 @@ + + + +repo/tests/phpunit +lib/tests/phpunit +client/tests/phpunit + + + diff --git a/tests/bootstrap.php b/tests/bootstrap.php new file mode 100644 index 000..11777b7 --- /dev/null +++ b/tests/bootstrap.php @@ -0,0 +1,12 @@ +https://gerrit.wikimedia.org/r/108642 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If9ec55856d9837b1c8c38299d045b6635b71a01c Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Jeroen De Dauw ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add namespace aliases for NS_PROJECT on zhwikivoyage - change (operations/mediawiki-config)
Odder has uploaded a new change for review. https://gerrit.wikimedia.org/r/108641 Change subject: Add namespace aliases for NS_PROJECT on zhwikivoyage .. Add namespace aliases for NS_PROJECT on zhwikivoyage This patch adds two localized namespace aliases for NS_PROJECT ('Wikivoyage') on the newly created Chinese Wikivoyage project per community request. Bug: 60122 Change-Id: If381357556fccca0986a8a74842ee3532746f141 --- M wmf-config/InitialiseSettings.php 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config refs/changes/41/108641/1 diff --git a/wmf-config/InitialiseSettings.php b/wmf-config/InitialiseSettings.php index 8ca1c6a..699ebba 100644 --- a/wmf-config/InitialiseSettings.php +++ b/wmf-config/InitialiseSettings.php @@ -3378,6 +3378,10 @@ '作者讨论' => 103, // Author talk '作者討論' => 103, ), + '+zhwikivoyage' => array( // bug 60122 + '维基导游' => NS_PROJECT, + '維基導遊' => NS_PROJECT, + ), '+zh_yuewiki' => array( 'WP' => NS_PROJECT, 'WT' => NS_PROJECT_TALK, -- To view, visit https://gerrit.wikimedia.org/r/108641 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If381357556fccca0986a8a74842ee3532746f141 Gerrit-PatchSet: 1 Gerrit-Project: operations/mediawiki-config Gerrit-Branch: master Gerrit-Owner: Odder ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Add further tests for ChangeOpClaimRemove - change (mediawiki...Wikibase)
jenkins-bot has submitted this change and it was merged. Change subject: Add further tests for ChangeOpClaimRemove .. Add further tests for ChangeOpClaimRemove Change-Id: If7aa688843934a5a0411656aec236d7a79e7eb78 --- M repo/tests/phpunit/includes/ChangeOp/ChangeOpClaimRemoveTest.php 1 file changed, 22 insertions(+), 0 deletions(-) Approvals: Jeroen De Dauw: Verified; Looks good to me, approved jenkins-bot: Verified diff --git a/repo/tests/phpunit/includes/ChangeOp/ChangeOpClaimRemoveTest.php b/repo/tests/phpunit/includes/ChangeOp/ChangeOpClaimRemoveTest.php index 00a8ef4..8d3aa22 100644 --- a/repo/tests/phpunit/includes/ChangeOp/ChangeOpClaimRemoveTest.php +++ b/repo/tests/phpunit/includes/ChangeOp/ChangeOpClaimRemoveTest.php @@ -4,6 +4,7 @@ use DataValues\DataValue; use DataValues\StringValue; +use InvalidArgumentException; use Wikibase\ChangeOp\ChangeOpClaimRemove; use Wikibase\DataModel\Claim\Claims; use Wikibase\DataModel\Entity\Entity; @@ -23,6 +24,27 @@ class ChangeOpClaimRemoveTest extends \PHPUnit_Framework_TestCase { + public function invalidConstructorProvider() { + $args = array(); + $args[] = array( array( 'foo' ) ); + $args[] = array( '' ); + return $args; + } + + /** +* @dataProvider invalidConstructorProvider +* @expectedException InvalidArgumentException +*/ + public function testInvalidConstruct( $claimGuid ) { + new ChangeOpClaimRemove( $claimGuid ); + } + + public function testGetClaimGuid() { + $claimguid = 'foobar'; + $changeop = new ChangeOpClaimRemove( $claimguid ); + $this->assertEquals( $claimguid, $changeop->getClaimGuid() ); + } + public function changeOpProvider() { $snak = new PropertyValueSnak( 2754236, new StringValue( 'test' ) ); $args = array(); -- To view, visit https://gerrit.wikimedia.org/r/108494 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: If7aa688843934a5a0411656aec236d7a79e7eb78 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Addshore Gerrit-Reviewer: Addshore Gerrit-Reviewer: Jeroen De Dauw Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Create ChangeOpClaimRemove class - change (mediawiki...Wikibase)
Jeroen De Dauw has submitted this change and it was merged. Change subject: Create ChangeOpClaimRemove class .. Create ChangeOpClaimRemove class Change-Id: I16eb8a26d0cb292dd7f969d2736c54970bffc986 --- M repo/Wikibase.classes.php A repo/includes/ChangeOp/ChangeOpClaimRemove.php M repo/includes/ChangeOp/ChangeOpMainSnak.php M repo/includes/ChangeOp/ChangeOpsMerge.php M repo/includes/api/EditEntity.php M repo/includes/api/RemoveClaims.php A repo/tests/phpunit/includes/ChangeOp/ChangeOpClaimRemoveTest.php M repo/tests/phpunit/includes/ChangeOp/ChangeOpMainSnakTest.php 8 files changed, 174 insertions(+), 44 deletions(-) Approvals: Jeroen De Dauw: Verified; Looks good to me, approved diff --git a/repo/Wikibase.classes.php b/repo/Wikibase.classes.php index f88f0d4..95f2893 100644 --- a/repo/Wikibase.classes.php +++ b/repo/Wikibase.classes.php @@ -52,6 +52,7 @@ 'Wikibase\ChangeOp\ChangeOpSiteLink' => 'includes/ChangeOp/ChangeOpSiteLink.php', 'Wikibase\ChangeOp\ChangeOpMainSnak' => 'includes/ChangeOp/ChangeOpMainSnak.php', 'Wikibase\ChangeOp\ChangeOpClaim' => 'includes/ChangeOp/ChangeOpClaim.php', + 'Wikibase\ChangeOp\ChangeOpClaimRemove' => 'includes/ChangeOp/ChangeOpClaimRemove.php', 'Wikibase\ChangeOp\ChangeOpQualifier' => 'includes/ChangeOp/ChangeOpQualifier.php', 'Wikibase\ChangeOp\ChangeOpReference' => 'includes/ChangeOp/ChangeOpReference.php', 'Wikibase\ChangeOp\ChangeOpReferenceRemove' => 'includes/ChangeOp/ChangeOpReferenceRemove.php', diff --git a/repo/includes/ChangeOp/ChangeOpClaimRemove.php b/repo/includes/ChangeOp/ChangeOpClaimRemove.php new file mode 100644 index 000..7ca2b3d --- /dev/null +++ b/repo/includes/ChangeOp/ChangeOpClaimRemove.php @@ -0,0 +1,93 @@ +claimGuid; + } + + /** +* Constructs a new mainsnak change operation +* +* @since 0.5 +* +* @param string $claimGuid +* +* @throws InvalidArgumentException +*/ + public function __construct( $claimGuid ) { + if ( !is_string( $claimGuid ) || $claimGuid === '' ) { + throw new InvalidArgumentException( '$claimGuid needs to be a string and must not be empty' ); + } + + $this->claimGuid = $claimGuid; + } + + /** +* @see ChangeOp::apply() +*/ + public function apply( Entity $entity, Summary $summary = null ) { + $claims = new Claims( $entity->getClaims() ); + + $this->removeClaim( $claims, $summary ); + + $entity->setClaims( $claims ); + + return true; + } + + /** +* @since 0.4 +* +* @param Claims $claims +* @param Summary $summary +* +* @throws ChangeOpException +*/ + protected function removeClaim( Claims $claims, Summary $summary = null ) { + if( !$claims->hasClaimWithGuid( $this->claimGuid ) ) { + throw new ChangeOpException( "Entity does not have claim with GUID $this->claimGuid" ); + } + $removedSnak = $claims->getClaimWithGuid( $this->claimGuid )->getMainSnak(); + $claims->removeClaimWithGuid( $this->claimGuid ); + $this->updateSummary( $summary, 'remove', '', $this->getClaimSummaryArgs( $removedSnak ) ); + } + + /** +* @since 0.4 +* +* @param Snak $mainSnak +* +* @return array +*/ + protected function getClaimSummaryArgs( Snak $mainSnak ) { + $propertyId = $mainSnak->getPropertyId(); + return array( array( $propertyId->getPrefixedId() => $mainSnak ) ); + } + +} \ No newline at end of file diff --git a/repo/includes/ChangeOp/ChangeOpMainSnak.php b/repo/includes/ChangeOp/ChangeOpMainSnak.php index 3e9eabc..35ec45b 100644 --- a/repo/includes/ChangeOp/ChangeOpMainSnak.php +++ b/repo/includes/ChangeOp/ChangeOpMainSnak.php @@ -48,12 +48,8 @@ throw new InvalidArgumentException( '$claimGuid needs to be a string' ); } - if ( !( $snak instanceof Snak ) && !is_null( $snak ) ) { - throw new InvalidArgumentException( '$snak needs to be an instance of Snak or null' ); - } - - if ( $claimGuid === '' && $snak === null ) { - throw new InvalidArgumentException( 'Either $claimGuid or $snak needs to be set' ); + if ( !( $snak instanceof Snak ) ) { + throw new InvalidArgumentException( '$snak needs to be an instance of Snak' ); } $this->claimGuid = $claimGuid; @@ -70,7 +66,6 @@ /** * @see ChangeOp::apply() -* - the claim gets removed when $cla
[MediaWiki-commits] [Gerrit] Fix broken link in mwe-embedplayer-for_best_experience message - change (mediawiki...TimedMediaHandler)
Brian Wolff has uploaded a new change for review. https://gerrit.wikimedia.org/r/108639 Change subject: Fix broken link in mwe-embedplayer-for_best_experience message .. Fix broken link in mwe-embedplayer-for_best_experience message I'm not sure if this previously worked. If it did, the js message api is weird. In any case it definitely doesn't work now. It seemed like the easiest work around would be to put the link tag directly in the message. Change-Id: Ic98cb213082b431177b9d5ad40fbe7861e50f00d --- M MwEmbedModules/EmbedPlayer/EmbedPlayer.i18n.php 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TimedMediaHandler refs/changes/39/108639/1 diff --git a/MwEmbedModules/EmbedPlayer/EmbedPlayer.i18n.php b/MwEmbedModules/EmbedPlayer/EmbedPlayer.i18n.php index 37fd360..613c947 100644 --- a/MwEmbedModules/EmbedPlayer/EmbedPlayer.i18n.php +++ b/MwEmbedModules/EmbedPlayer/EmbedPlayer.i18n.php @@ -65,7 +65,7 @@ 'mwe-embedplayer-ogg-player-kplayer' => 'Kaltura player', 'mwe-embedplayer-ogg-player-selected' => '(selected)', 'mwe-embedplayer-ogg-player-omtkplayer' => 'OMTK Flash Vorbis', - 'mwe-embedplayer-for_best_experience' => 'For a better video playback experience we recommend a [$1 HTML5 video browser].', + 'mwe-embedplayer-for_best_experience' => 'For a better video playback experience we recommend an HTML5 video browser.', 'mwe-embedplayer-download-warn' => 'No compatible in-browser player was detected: for in-browser playback, please download the [$1 latest Firefox]', 'mwe-embedplayer-fullscreen-tip' => 'Press F11 toggle web browser fullscreen', 'mwe-embedplayer-fullscreen-tip-osx' => 'Press shift ⌘ F to toggle fullscreen', @@ -125,8 +125,8 @@ 'mwe-embedplayer-ogg-player-aacNative' => 'name of AAC player in configuration screen', 'mwe-embedplayer-ogg-player-cortado' => '{{optional}}', 'mwe-embedplayer-ogg-player-selected' => '{{Identical|Selected}}', - 'mwe-embedplayer-for_best_experience' => 'Parameters: -* $1 - URL', + 'mwe-embedplayer-for_best_experience' => 'Shown when user\'s browser doesn\'t support playing videos. Parameters: +* $1 - An empty tag. Don\'t use this parameter.', 'mwe-embedplayer-download-warn' => 'Parameters: * $1 - URL', 'mwe-embedplayer-do_not_warn_again' => 'Standard message for disabling -- To view, visit https://gerrit.wikimedia.org/r/108639 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic98cb213082b431177b9d5ad40fbe7861e50f00d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/TimedMediaHandler Gerrit-Branch: master Gerrit-Owner: Brian Wolff ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Making default apache vhost listen be *:80 - change (mediawiki/vagrant)
Ottomata has uploaded a new change for review. https://gerrit.wikimedia.org/r/108640 Change subject: Making default apache vhost listen be *:80 .. Making default apache vhost listen be *:80 Change-Id: I2671eceb873ec394bed84e73fada4162772e43d6 --- M puppet/modules/apache/manifests/site.pp 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant refs/changes/40/108640/1 diff --git a/puppet/modules/apache/manifests/site.pp b/puppet/modules/apache/manifests/site.pp index 9747a64..649dcd7 100644 --- a/puppet/modules/apache/manifests/site.pp +++ b/puppet/modules/apache/manifests/site.pp @@ -32,7 +32,7 @@ # } # define apache::site( -$listen = '*', +$listen = '*:80', $ensure = 'present', $site= $title, $content = undef, -- To view, visit https://gerrit.wikimedia.org/r/108640 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2671eceb873ec394bed84e73fada4162772e43d6 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/vagrant Gerrit-Branch: master Gerrit-Owner: Ottomata ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Stop marking PermissionsTests as incomplete - change (mediawiki...Wikibase)
Jeroen De Dauw has submitted this change and it was merged. Change subject: Stop marking PermissionsTests as incomplete .. Stop marking PermissionsTests as incomplete Change-Id: I1d4e685f6bc20b01d154f0a0ae88c9997443db88 --- M repo/tests/phpunit/includes/api/PermissionsTestCase.php 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Addshore: Verified Jeroen De Dauw: Looks good to me, approved diff --git a/repo/tests/phpunit/includes/api/PermissionsTestCase.php b/repo/tests/phpunit/includes/api/PermissionsTestCase.php index e773e39..20b0f2a 100644 --- a/repo/tests/phpunit/includes/api/PermissionsTestCase.php +++ b/repo/tests/phpunit/includes/api/PermissionsTestCase.php @@ -70,6 +70,9 @@ if ( $expectedError !== null ) { $this->fail( 'API call should have failed with a permission error!' ); + } else { + // the below is to avoid the tests being marked incomplete + $this->assertTrue( true ); } } catch ( UsageException $ex ) { if ( $expectedError !== true ) { -- To view, visit https://gerrit.wikimedia.org/r/108508 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1d4e685f6bc20b01d154f0a0ae88c9997443db88 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Addshore Gerrit-Reviewer: Addshore Gerrit-Reviewer: Jeroen De Dauw 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 further tests for ChangeOpQualifierRemove - change (mediawiki...Wikibase)
Jeroen De Dauw has submitted this change and it was merged. Change subject: Add further tests for ChangeOpQualifierRemove .. Add further tests for ChangeOpQualifierRemove Change-Id: I7c591ee554478010c2f6d3d29cc7c5d429b9d336 --- M repo/tests/phpunit/includes/ChangeOp/ChangeOpQualifierRemoveTest.php 1 file changed, 17 insertions(+), 0 deletions(-) Approvals: Jeroen De Dauw: Verified; Looks good to me, approved diff --git a/repo/tests/phpunit/includes/ChangeOp/ChangeOpQualifierRemoveTest.php b/repo/tests/phpunit/includes/ChangeOp/ChangeOpQualifierRemoveTest.php index 099fce4..9ceba89 100644 --- a/repo/tests/phpunit/includes/ChangeOp/ChangeOpQualifierRemoveTest.php +++ b/repo/tests/phpunit/includes/ChangeOp/ChangeOpQualifierRemoveTest.php @@ -3,6 +3,7 @@ namespace Wikibase\Test; use DataValues\StringValue; +use InvalidArgumentException; use Wikibase\ChangeOp\ChangeOpQualifierRemove; use Wikibase\DataModel\Claim\Claim; use Wikibase\DataModel\Claim\Claims; @@ -24,6 +25,22 @@ */ class ChangeOpQualifierRemoveTest extends \PHPUnit_Framework_TestCase { + public function invalidConstructorProvider() { + $args = array(); + $args[] = array( '', '' ); + $args[] = array( 'foo', '' ); + $args[] = array( '', 'foo' ); + return $args; + } + + /** +* @dataProvider invalidConstructorProvider +* @expectedException InvalidArgumentException +*/ + public function testInvalidConstruct( $claimGuid, $snakHash ) { + new ChangeOpQualifierRemove( $claimGuid, $snakHash ); + } + public function changeOpRemoveProvider() { $snak = new PropertyValueSnak( 2754236, new StringValue( 'test' ) ); $args = array(); -- To view, visit https://gerrit.wikimedia.org/r/108497 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7c591ee554478010c2f6d3d29cc7c5d429b9d336 Gerrit-PatchSet: 3 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Addshore Gerrit-Reviewer: Addshore Gerrit-Reviewer: Jeroen De Dauw Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Create ChangeOpQualifierRemove class - change (mediawiki...Wikibase)
Jeroen De Dauw has submitted this change and it was merged. Change subject: Create ChangeOpQualifierRemove class .. Create ChangeOpQualifierRemove class Change-Id: I9660f0c4975fbdbcf3cec1d60a9eb3fffc637ae3 --- M repo/Wikibase.classes.php M repo/includes/ChangeOp/ChangeOpQualifier.php A repo/includes/ChangeOp/ChangeOpQualifierRemove.php M repo/includes/api/RemoveQualifiers.php A repo/tests/phpunit/includes/ChangeOp/ChangeOpQualifierRemoveTest.php M repo/tests/phpunit/includes/ChangeOp/ChangeOpQualifierTest.php 6 files changed, 190 insertions(+), 68 deletions(-) Approvals: Jeroen De Dauw: Verified; Looks good to me, approved diff --git a/repo/Wikibase.classes.php b/repo/Wikibase.classes.php index f88f0d4..f006399 100644 --- a/repo/Wikibase.classes.php +++ b/repo/Wikibase.classes.php @@ -53,6 +53,7 @@ 'Wikibase\ChangeOp\ChangeOpMainSnak' => 'includes/ChangeOp/ChangeOpMainSnak.php', 'Wikibase\ChangeOp\ChangeOpClaim' => 'includes/ChangeOp/ChangeOpClaim.php', 'Wikibase\ChangeOp\ChangeOpQualifier' => 'includes/ChangeOp/ChangeOpQualifier.php', + 'Wikibase\ChangeOp\ChangeOpQualifierRemove' => 'includes/ChangeOp/ChangeOpQualifierRemove.php', 'Wikibase\ChangeOp\ChangeOpReference' => 'includes/ChangeOp/ChangeOpReference.php', 'Wikibase\ChangeOp\ChangeOpReferenceRemove' => 'includes/ChangeOp/ChangeOpReferenceRemove.php', 'Wikibase\ChangeOp\ChangeOpStatementRank' => 'includes/ChangeOp/ChangeOpStatementRank.php', diff --git a/repo/includes/ChangeOp/ChangeOpQualifier.php b/repo/includes/ChangeOp/ChangeOpQualifier.php index 12df5a0..9b8fb98 100644 --- a/repo/includes/ChangeOp/ChangeOpQualifier.php +++ b/repo/includes/ChangeOp/ChangeOpQualifier.php @@ -59,12 +59,8 @@ throw new InvalidArgumentException( '$snakHash needs to be a string' ); } - if ( !( $snak instanceof Snak ) && !is_null( $snak ) ) { - throw new InvalidArgumentException( '$snak needs to be an instance of Snak or null' ); - } - - if ( $snakHash === '' && $snak === null ) { - throw new InvalidArgumentException( 'Either $snakHash or $snak needs to be set' ); + if ( !( $snak instanceof Snak ) ) { + throw new InvalidArgumentException( '$snak needs to be an instance of Snak' ); } $this->claimGuid = $claimGuid; @@ -74,7 +70,6 @@ /** * @see ChangeOp::apply() -* - the qualifier gets removed when $snakHash is set and $snak is not set * - a new qualifier gets added when $snakHash is empty and $snak is set * - the qualifier gets set to $snak when $snakHash and $snak are set */ @@ -91,11 +86,7 @@ if ( $this->snakHash === '' ) { $this->addQualifier( $qualifiers, $summary ); } else { - if ( $this->snak != null ) { - $this->setQualifier( $qualifiers, $summary ); - } else { - $this->removeQualifier( $qualifiers, $summary ); - } + $this->setQualifier( $qualifiers, $summary ); } $claim->setQualifiers( $qualifiers ); @@ -139,23 +130,6 @@ $qualifiers->removeSnakHash( $this->snakHash ); $qualifiers->addSnak( $this->snak ); $this->updateSummary( $summary, 'update', '', $this->getSnakSummaryArgs( $this->snak ) ); - } - - /** -* @since 0.4 -* -* @param Snaks $qualifiers -* @param Summary $summary -* -* @throws ChangeOpException -*/ - protected function removeQualifier( Snaks $qualifiers, Summary $summary = null ) { - if ( !$qualifiers->hasSnakHash( $this->snakHash ) ) { - throw new ChangeOpException( "Qualifier with hash $this->snakHash does not exist" ); - } - $removedQualifier = $qualifiers->getSnak( $this->snakHash ); - $qualifiers->removeSnakHash( $this->snakHash ); - $this->updateSummary( $summary, 'remove', '', $this->getSnakSummaryArgs( $removedQualifier ) ); } /** diff --git a/repo/includes/ChangeOp/ChangeOpQualifierRemove.php b/repo/includes/ChangeOp/ChangeOpQualifierRemove.php new file mode 100644 index 000..ff9b31d --- /dev/null +++ b/repo/includes/ChangeOp/ChangeOpQualifierRemove.php @@ -0,0 +1,104 @@ +claimGuid = $claimGuid; + $this->snakHash = $snakHash; + } + + /** +* @see ChangeOp::apply() +*/ + public function apply( Entity $entity, Summary $summary = null ) { + $claims = new Claims( $entity->
[MediaWiki-commits] [Gerrit] Use automatically generated classmap rather than a manual on... - change (mediawiki...Wikibase)
Jeroen De Dauw has uploaded a new change for review. https://gerrit.wikimedia.org/r/108638 Change subject: Use automatically generated classmap rather than a manual one for Wikibase Client .. Use automatically generated classmap rather than a manual one for Wikibase Client Change-Id: I4b48b73af521904bedb35a6be2e97b0767e00d98 --- D client/WikibaseClient.classes.php M client/WikibaseClient.php M composer.json 3 files changed, 7 insertions(+), 80 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/38/108638/1 diff --git a/client/WikibaseClient.classes.php b/client/WikibaseClient.classes.php deleted file mode 100644 index e554ee4..000 --- a/client/WikibaseClient.classes.php +++ /dev/null @@ -1,74 +0,0 @@ - - */ -return call_user_func( function() { - - $classes = array( - // Autoloading - 'Wikibase\ClientHooks' => 'WikibaseClient.hooks.php', - - 'Wikibase\EntityIdPropertyUpdater' => 'includes/EntityIdPropertyUpdater.php', - 'Wikibase\InterwikiSorter' => 'includes/InterwikiSorter.php', - 'Wikibase\LangLinkHandler' => 'includes/LangLinkHandler.php', - 'Wikibase\ChangeHandler' => 'includes/ChangeHandler.php', - 'Wikibase\NamespaceChecker' => 'includes/NamespaceChecker.php', - 'Wikibase\ReferencedPagesFinder' => 'includes/ReferencedPagesFinder.php', - 'Wikibase\RepoItemLinkGenerator' => 'includes/RepoItemLinkGenerator.php', - 'Wikibase\RepoLinker' => 'includes/RepoLinker.php', - 'Wikibase\Client\WikibaseClient' => 'includes/WikibaseClient.php', - 'Wikibase\PageUpdater' => 'includes/PageUpdater.php', - 'Wikibase\SiteLinkCommentCreator' => 'includes/SiteLinkCommentCreator.php', - 'Wikibase\WikiPageUpdater' => 'includes/WikiPageUpdater.php', - 'Wikibase\UpdateRepo' => 'includes/UpdateRepo.php', - 'Wikibase\UpdateRepoOnMove' => 'includes/UpdateRepoOnMove.php', - - // includes/api - 'Wikibase\ApiClientInfo' => 'includes/api/ApiClientInfo.php', - - // includes/hooks - 'Wikibase\Client\Hooks\InfoActionHookHandler' => 'includes/hooks/InfoActionHookHandler.php', - 'Wikibase\Client\MovePageNotice' => 'includes/hooks/MovePageNotice.php', - - // includes/modules - 'Wikibase\SiteModule' => 'includes/modules/SiteModule.php', - - // include/parserhooks - 'Wikibase\NoLangLinkHandler' => 'includes/parserhooks/NoLangLinkHandler.php', - 'Wikibase\ParserErrorMessageFormatter' => 'includes/parserhooks/ParserErrorMessageFormatter.php', - 'Wikibase\PropertyParserFunction' => 'includes/parserhooks/PropertyParserFunction.php', - 'Wikibase\PropertyParserFunctionRenderer' => 'includes/parserhooks/PropertyParserFunctionRenderer.php', - - // includes/recentchanges - 'Wikibase\ChangeLineFormatter' => 'includes/recentchanges/ChangeLineFormatter.php', - 'Wikibase\ExternalChange' => 'includes/recentchanges/ExternalChange.php', - 'Wikibase\ExternalChangeFactory' => 'includes/recentchanges/ExternalChangeFactory.php', - 'Wikibase\ExternalRecentChange' => 'includes/recentchanges/ExternalRecentChange.php', - 'Wikibase\RecentChangesFilterOptions' => 'includes/recentchanges/RecentChangesFilterOptions.php', - 'Wikibase\RevisionData' => 'includes/recentchanges/RevisionData.php', - - // includes/specials - 'Wikibase\Client\Specials\SpecialUnconnectedPages' => 'includes/specials/SpecialUnconnectedPages.php', - - // includes/store - 'Wikibase\ClientStore' => 'includes/store/ClientStore.php', - - // includes/store/sql - 'Wikibase\DirectSqlStore' => 'includes/store/sql/DirectSqlStore.php', - - // includes/scribunto - 'Scribunto_LuaWikibaseLibrary' => 'includes/scribunto/Scribunto_LuaWikibaseLibrary.php', - 'Scribunto_LuaWikibaseLibraryImplementation' => 'includes/scribunto/Scribunto_LuaWikibaseLibraryImplementation.php', - - // test - 'Wikibase\Test\MockPageUpdater' => 'tests/phpunit/MockPageUpdater.php' - - ); - - return $classes; - -} ); diff --git a/client/WikibaseClient.php b/client/WikibaseClient.php index d089b60..b009543 100644 --- a/client/WikibaseClient.php +++ b/client/WikibaseClient.php @@ -20,7 +20,7 @@ } if ( defined( 'WBC_VERSION' ) ) { - // Do not initialize more then once. + // Do not initialize more than once. return; } @@ -43,7 +43,7 @@ } call_user_func( function() { - global $wgExtensionCredits, $wgExte
[MediaWiki-commits] [Gerrit] Running an ULS job on IE8 - change (mediawiki/selenium)
jenkins-bot has submitted this change and it was merged. Change subject: Running an ULS job on IE8 .. Running an ULS job on IE8 https://wmf.ci.cloudbees.com/view/r-uls/job/UniversalLanguageSelector-en .wikipedia.beta.wmflabs.org-windows-internet_explorer_8/ Change-Id: I929336a41b4f13b284818e77e75ae75a01c9ec4f --- M docs/jobs.md 1 file changed, 7 insertions(+), 0 deletions(-) Approvals: Jhall: Looks good to me, approved jenkins-bot: Verified diff --git a/docs/jobs.md b/docs/jobs.md index 1a36acd..45c2fd3 100644 --- a/docs/jobs.md +++ b/docs/jobs.md @@ -202,6 +202,13 @@ - MediaWiki user: Uls - MediaWiki password variable: MEDIAWIKI_PASSWORD_ULS_WMFLABS_ORG +## UniversalLanguageSelector-en.wikipedia.beta.wmflabs.org-windows-internet_explorer_8 +- Browser Label: internet_explorer_8 +- bundle exec cucumber: --tags @en.wikipedia.beta.wmflabs.org +- MediaWiki URL: en.wikipedia.beta.wmflabs.org +- MediaWiki user: Uls +- MediaWiki password variable: MEDIAWIKI_PASSWORD_ULS_WMFLABS_ORG + ## UniversalLanguageSelector-sandbox.translatewiki.net-linux-firefox - bundle exec cucumber: --tags @sandbox.translatewiki.net - MediaWiki URL: sandbox.translatewiki.net -- To view, visit https://gerrit.wikimedia.org/r/107822 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I929336a41b4f13b284818e77e75ae75a01c9ec4f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/selenium Gerrit-Branch: master Gerrit-Owner: Zfilipin Gerrit-Reviewer: Amire80 Gerrit-Reviewer: Cmcmahon Gerrit-Reviewer: Jhall Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] removed debugging code from Jenkins jobs - change (mediawiki/selenium)
jenkins-bot has submitted this change and it was merged. Change subject: removed debugging code from Jenkins jobs .. removed debugging code from Jenkins jobs Bug: 60037 Change-Id: I53f8d4483755f0c5c22539b67a15af2a89c4f91d --- M docs/jobs.md M docs/template.md 2 files changed, 1 insertion(+), 17 deletions(-) Approvals: Jhall: Looks good to me, approved jenkins-bot: Verified diff --git a/docs/jobs.md b/docs/jobs.md index 6bb3de6..544f07b 100644 --- a/docs/jobs.md +++ b/docs/jobs.md @@ -1,6 +1,6 @@ # all jobs - Browser Label: -- bundle exec cucumber: || echo "Failure in cucumber" +- bundle exec cucumber: - Recipients: - MediaWiki URL: - Folder: diff --git a/docs/template.md b/docs/template.md index 61f3cb0..9a47958 100644 --- a/docs/template.md +++ b/docs/template.md @@ -255,22 +255,6 @@ project - - - -$PROJECT_DEFAULT_SUBJECT -$PROJECT_DEFAULT_CONTENT -false -false -false -true - -false -false -$PROJECT_DEFAULT_REPLYTO -project - - text/html $DEFAULT_SUBJECT -- To view, visit https://gerrit.wikimedia.org/r/108493 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I53f8d4483755f0c5c22539b67a15af2a89c4f91d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/selenium Gerrit-Branch: master Gerrit-Owner: Zfilipin Gerrit-Reviewer: Cmcmahon Gerrit-Reviewer: Jhall Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Rename hooks to lower case - change (mediawiki...ContentTranslation)
jenkins-bot has submitted this change and it was merged. Change subject: Rename hooks to lower case .. Rename hooks to lower case Change-Id: I48fba3c4d1e5ac8603e165f08570cdc2f3059250 --- M modules/header/ext.cx.header.js M modules/translation/ext.cx.translation.js 2 files changed, 4 insertions(+), 4 deletions(-) Approvals: Santhosh: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/header/ext.cx.header.js b/modules/header/ext.cx.header.js index 78709e6..38d0c59 100644 --- a/modules/header/ext.cx.header.js +++ b/modules/header/ext.cx.header.js @@ -77,7 +77,7 @@ mw.hook( 'mw.cx.publish' ).fire(); } ); - mw.hook( 'mw.cx.changeTranslation' ).add( $.proxy( this.setPublishButtonState, this ) ); + mw.hook( 'mw.cx.translation.change' ).add( $.proxy( this.setPublishButtonState, this ) ); }; $.fn.cxHeader = function ( options ) { diff --git a/modules/translation/ext.cx.translation.js b/modules/translation/ext.cx.translation.js index 39dfecf..f35ec37 100644 --- a/modules/translation/ext.cx.translation.js +++ b/modules/translation/ext.cx.translation.js @@ -71,7 +71,7 @@ .html( '\n' ); // Make sure that it's visible to the tests this.$container.append( $content ); - mw.hook( 'mw.cx.changeTranslation' ).fire(); + mw.hook( 'mw.cx.translation.change' ).fire(); this.$title = this.$container.find( '.cx-column__title' ); this.$content = this.$container.find( '.cx-column__content' ); }; @@ -79,14 +79,14 @@ ContentTranslationEditor.prototype.listen = function () { mw.hook( 'mw.cx.translation.add' ).add( $.proxy( this.update, this ) ); this.$container.find( '.cx-column__content' ).on( 'input', function () { - mw.hook( 'mw.cx.changeTranslation' ).fire(); + mw.hook( 'mw.cx.translation.change' ).fire(); } ); }; ContentTranslationEditor.prototype.update = function ( data ) { this.$content.html( data ); mw.hook( 'mw.cx.progress' ).fire( 100 ); - mw.hook( 'mw.cx.changeTranslation' ).fire(); + mw.hook( 'mw.cx.translation.change' ).fire(); }; $.fn.cxTranslation = function ( options ) { -- To view, visit https://gerrit.wikimedia.org/r/108632 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I48fba3c4d1e5ac8603e165f08570cdc2f3059250 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/ContentTranslation Gerrit-Branch: master Gerrit-Owner: Amire80 Gerrit-Reviewer: Santhosh 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 basic EventLogging support - change (mediawiki...ContentTranslation)
jenkins-bot has submitted this change and it was merged. Change subject: Add basic EventLogging support .. Add basic EventLogging support Change-Id: I3e2bab216edca9d6f56fde18c1f1d7044c2fae58 --- A ContentTranslation.hooks.php M ContentTranslation.php M Resources.php A modules/eventlogging/ext.cx.eventlogging.js M modules/translation/ext.cx.publish.js 5 files changed, 164 insertions(+), 0 deletions(-) Approvals: Santhosh: Looks good to me, approved jenkins-bot: Verified diff --git a/ContentTranslation.hooks.php b/ContentTranslation.hooks.php new file mode 100644 index 000..63682ef --- /dev/null +++ b/ContentTranslation.hooks.php @@ -0,0 +1,32 @@ +addModules( array( + 'schema.ContentTranslation', + 'ext.cx.eventlogging', + ) ); + } + + return true; + } +} diff --git a/ContentTranslation.php b/ContentTranslation.php index 0099f12..47ba0db 100644 --- a/ContentTranslation.php +++ b/ContentTranslation.php @@ -52,3 +52,40 @@ // API modules $GLOBALS['wgAPIModules']['cxpublish'] = 'ApiContentTranslationPublish'; + +// Hooks +$GLOBALS['wgHooks']['BeforePageDisplay'][] = 'ContentTranslationHooks::addModules'; + +$GLOBALS['wgExtensionFunctions'][] = function () { + global $wgResourceModules, $wgContentTranslationEventLogging; + + // If EventLogging integration is enabled, first ensure that the + // EventLogging extension is present, then declare the schema module. + // If it is not present, emit a warning and disable logging. + if ( $wgContentTranslationEventLogging ) { + if ( class_exists( 'ResourceLoaderSchemaModule' ) ) { + /// @see https://meta.wikimedia.org/wiki/Schema:ContentTranslation + $wgResourceModules[ 'schema.ContentTranslation' ] = array( + 'class' => 'ResourceLoaderSchemaModule', + 'schema' => 'ContentTranslation', + 'revision' => 7146627, + ); + } else { + wfWarn( + 'ContentTranslation is configured to use EventLogging, ' . + 'but the extension is is not available. ' . + 'Disabling $wgContentTranslationEventLogging.' + ); + $wgContentTranslationEventLogging = false; + } + } + + return true; +}; + +// Globals for this extension +/** + * Whether to use EventLogging. + * The EventLogging extension must be installed if this option is enabled. + */ +$GLOBALS['wgContentTranslationEventLogging'] = false; diff --git a/Resources.php b/Resources.php index c10a664..ce99bd5 100644 --- a/Resources.php +++ b/Resources.php @@ -101,3 +101,8 @@ 'cx-publish-page-error' ), ) + $resourcePaths; + +$wgResourceModules['ext.cx.eventlogging'] = array( + 'scripts' => 'eventlogging/ext.cx.eventlogging.js', + 'dependencies' => 'schema.ContentTranslation', +) + $resourcePaths; diff --git a/modules/eventlogging/ext.cx.eventlogging.js b/modules/eventlogging/ext.cx.eventlogging.js new file mode 100644 index 000..5895765 --- /dev/null +++ b/modules/eventlogging/ext.cx.eventlogging.js @@ -0,0 +1,85 @@ +/** + * ContentTranslation event logging. + * Uses the EventLogging extension, if it's available, to log events. + * + * @file + * @ingroup Extensions + * @copyright See AUTHORS.txt + * @license GPL-2.0+ + */ + +( function ( $, mw ) { + 'use strict'; + + /** +* ContentTranslation event logger +*/ + function ContentTranslationEventLogging() { + this.logEventQueue = $.Callbacks( 'memory once' ); + this.init(); + this.listen(); + } + + ContentTranslationEventLogging.prototype = { + init: function () { + var eventLogging = this; + + // Set event defaults and make the + mw.eventLog.setDefaults( 'ContentTranslation', { + version: 1, + token: mw.user.id() + } ); + + eventLogging.logEventQueue.fire(); + }, + + /** +* Local wrapper for 'mw.eventLog.logEvent' +* +* @param {Object} event Event action and optional fields +* @return {jQuery.Promise} jQuery Promise object for the logging call +*/ + log: function ( event ) { + // We need to create our own deferred for two reasons: + // - logEvent might not be executed immediately + // - we cannot reject a promise
[MediaWiki-commits] [Gerrit] Improve tests for ChangeOpReferenceRemove - change (mediawiki...Wikibase)
Jeroen De Dauw has submitted this change and it was merged. Change subject: Improve tests for ChangeOpReferenceRemove .. Improve tests for ChangeOpReferenceRemove Change-Id: Id2485bf07d6d7b320a1906a626e9489cd3780b42 --- M repo/tests/phpunit/includes/ChangeOp/ChangeOpReferenceRemoveTest.php 1 file changed, 36 insertions(+), 1 deletion(-) Approvals: Addshore: Verified Jeroen De Dauw: Looks good to me, approved diff --git a/repo/tests/phpunit/includes/ChangeOp/ChangeOpReferenceRemoveTest.php b/repo/tests/phpunit/includes/ChangeOp/ChangeOpReferenceRemoveTest.php index 2d73314..4a6b655 100644 --- a/repo/tests/phpunit/includes/ChangeOp/ChangeOpReferenceRemoveTest.php +++ b/repo/tests/phpunit/includes/ChangeOp/ChangeOpReferenceRemoveTest.php @@ -3,6 +3,7 @@ namespace Wikibase\Test; use DataValues\StringValue; +use InvalidArgumentException; use Wikibase\ChangeOp\ChangeOpReferenceRemove; use Wikibase\DataModel\Claim\Claims; use Wikibase\DataModel\Claim\Statement; @@ -26,6 +27,22 @@ */ class ChangeOpReferenceRemoveTest extends \PHPUnit_Framework_TestCase { + public function invalidConstructorProvider() { + $args = array(); + $args[] = array( '', '' ); + $args[] = array( '', 'foo' ); + $args[] = array( 'foo', '' ); + return $args; + } + + /** +* @dataProvider invalidConstructorProvider +* @expectedException InvalidArgumentException +*/ + public function testInvalidConstruct( $claimGuid, $referenceHash ) { + new ChangeOpReferenceRemove( $claimGuid, $referenceHash ); + } + public function changeOpRemoveProvider() { $snak = new PropertyValueSnak( 2754236, new StringValue( 'test' ) ); $args = array(); @@ -44,7 +61,24 @@ $item->setClaims( new Claims( $claims ) ); $referenceHash = $newReference->getHash(); $changeOp = new ChangeOpReferenceRemove( $claimGuid, $referenceHash ); - $args[] = array ( $item, $changeOp, $referenceHash ); + $args[ 'Removing a single reference' ] = array ( $item, $changeOp, $referenceHash ); + + $item = $this->provideNewItemWithClaim( 'q346', $snak ); + $claims = $item->getClaims(); + /** @var Statement $claim */ + $claim = reset( $claims ); + $claimGuid = $claim->getGuid(); + $snaks = new SnakList(); + $snaks[] = new PropertyValueSnak( 78462378, new StringValue( 'newQualifier' ) ); + $newReference = new Reference( $snaks ); + $references = $claim->getReferences(); + $references->addReference( $newReference ); + $references->addReference( $newReference ); + $claim->setReferences( $references ); + $item->setClaims( new Claims( $claims ) ); + $referenceHash = $newReference->getHash(); + $changeOp = new ChangeOpReferenceRemove( $claimGuid, $referenceHash ); + $args[ 'Removing references that have the same hash' ] = array ( $item, $changeOp, $referenceHash ); return $args; } @@ -59,6 +93,7 @@ public function testApplyRemoveReference( $item, $changeOp, $referenceHash ) { $this->assertTrue( $changeOp->apply( $item ), "Applying the ChangeOp did not return true" ); $claims = $item->getClaims(); + $this->assertCount( 1, $claims, 'More than one claim returned on item...' ); /** @var Statement $claim */ $claim = reset( $claims ); $references = $claim->getReferences(); -- To view, visit https://gerrit.wikimedia.org/r/108495 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id2485bf07d6d7b320a1906a626e9489cd3780b42 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Addshore Gerrit-Reviewer: Addshore Gerrit-Reviewer: Jeroen De Dauw Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Clean up error for claim index out of bounds - change (mediawiki...Wikibase)
Jeroen De Dauw has submitted this change and it was merged. Change subject: Clean up error for claim index out of bounds .. Clean up error for claim index out of bounds This changes the uncaught exception to an actual api UsageException to be provided to users This change also adds a test for the bug into the wbsetclaim tests Bug: 58394 Change-Id: I177ac29de9d2ec0f4a355ec847f6f2075650fe2a --- M repo/includes/ChangeOp/ChangeOpClaim.php M repo/includes/api/SetClaim.php M repo/tests/phpunit/includes/api/SetClaimTest.php 3 files changed, 65 insertions(+), 13 deletions(-) Approvals: Addshore: Verified Jeroen De Dauw: Looks good to me, approved diff --git a/repo/includes/ChangeOp/ChangeOpClaim.php b/repo/includes/ChangeOp/ChangeOpClaim.php index fbaf937..2a310bf 100644 --- a/repo/includes/ChangeOp/ChangeOpClaim.php +++ b/repo/includes/ChangeOp/ChangeOpClaim.php @@ -3,6 +3,7 @@ namespace Wikibase\ChangeOp; use InvalidArgumentException; +use OutOfBoundsException; use Wikibase\DataModel\ByPropertyIdArray; use Wikibase\DataModel\Claim\Claim; use Wikibase\DataModel\Claim\Claims; @@ -97,7 +98,12 @@ $indexedClaimList = new ByPropertyIdArray( $entityClaims ); $indexedClaimList->buildIndex(); - $indexedClaimList->addObjectAtIndex( $this->claim, $this->index ); + try{ + $indexedClaimList->addObjectAtIndex( $this->claim, $this->index ); + } + catch( OutOfBoundsException $e ){ + throw new ChangeOpException( "Can not add claim at given index : ". $this->index ); + } } else { // Altering an existing claim. diff --git a/repo/includes/api/SetClaim.php b/repo/includes/api/SetClaim.php index bb2b100..15dcb02 100644 --- a/repo/includes/api/SetClaim.php +++ b/repo/includes/api/SetClaim.php @@ -63,7 +63,7 @@ try{ $changeop->apply( $entity ); } catch( ChangeOpException $exception ){ - $this->dieUsage( 'Failed to apply changeOp:' . $exception->getMessage(), 'save-failed' ); + $this->dieUsage( 'Failed to apply changeOp: ' . $exception->getMessage(), 'save-failed' ); } $this->saveChanges( $entityContent, $summary ); diff --git a/repo/tests/phpunit/includes/api/SetClaimTest.php b/repo/tests/phpunit/includes/api/SetClaimTest.php index 6c66290..897b81f 100644 --- a/repo/tests/phpunit/includes/api/SetClaimTest.php +++ b/repo/tests/phpunit/includes/api/SetClaimTest.php @@ -4,20 +4,22 @@ use DataValues\StringValue; use FormatJson; -use Wikibase\Claim; -use Wikibase\Claims; +use Revision; +use UsageException; +use Wikibase\DataModel\Claim\Claim; +use Wikibase\DataModel\Claim\Claims; +use Wikibase\DataModel\Claim\Statement; use Wikibase\DataModel\Entity\EntityId; +use Wikibase\DataModel\Entity\Item; +use Wikibase\DataModel\Reference; +use Wikibase\DataModel\Snak\PropertyNoValueSnak; +use Wikibase\DataModel\Snak\PropertySomeValueSnak; +use Wikibase\DataModel\Snak\PropertyValueSnak; +use Wikibase\DataModel\Snak\Snak; +use Wikibase\DataModel\Snak\SnakList; use Wikibase\PropertyContent; use Wikibase\Lib\Serializers\SerializerFactory; use Wikibase\Repo\WikibaseRepo; -use Wikibase\Statement; -use Wikibase\Reference; -use Wikibase\Snak; -use Wikibase\SnakList; -use Wikibase\PropertyValueSnak; -use Wikibase\PropertyNoValueSnak; -use Wikibase\PropertySomeValueSnak; -use Wikibase\Item; use Wikibase\ItemContent; use Wikibase\Lib\ClaimGuidGenerator; @@ -120,6 +122,7 @@ public function testAddClaim() { $claims = $this->getClaims(); + /** @var Claim[] $claims */ foreach( $claims as $claim ) { $item = Item::newEmpty(); $content = new ItemContent( $item ); @@ -181,6 +184,7 @@ // Add new claim at index 2: $guid = $guidGenerator->newGuid(); + /** @var Claim $claim */ foreach( $this->getClaims() as $claim ) { $claim->setGuid( $guid ); @@ -194,13 +198,15 @@ * @param $claimCount * @param $requestLabel string a label to identify requests that are made in errors * @param int|null $index +* @param int|null $baserevid */ protected function makeRequest( $claim, EntityId $entityId, $claimCount, $requestLabel, - $index = null + $index = null, + $baserevid = null ) { $serializerFactory = new SerializerFactory(); @@ -220,6 +226,10 @@ if( !is_null( $index ) ) { $para
[MediaWiki-commits] [Gerrit] Updated .gitignore - change (mediawiki...Wikibase)
Addshore has submitted this change and it was merged. Change subject: Updated .gitignore .. Updated .gitignore Change-Id: If1742834f205b336f82e637cdef20cb506bd4cab --- M .gitignore 1 file changed, 3 insertions(+), 1 deletion(-) Approvals: Addshore: Verified; Looks good to me, approved diff --git a/.gitignore b/.gitignore index 5f2c219..9c31647 100644 --- a/.gitignore +++ b/.gitignore @@ -13,4 +13,6 @@ .idea/ selenium/configuration.yml -tests/browser/.idea \ No newline at end of file +tests/browser/.idea +tests/browser/.bundle/* +tests/browser/config/config.yml \ No newline at end of file -- To view, visit https://gerrit.wikimedia.org/r/108507 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: If1742834f205b336f82e637cdef20cb506bd4cab Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Tobias Gritschacher Gerrit-Reviewer: Addshore Gerrit-Reviewer: Adrian Lang Gerrit-Reviewer: Daniel Kinzler Gerrit-Reviewer: Zfilipin Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Merge References for Statements in wbmergeitems - change (mediawiki...Wikibase)
Jeroen De Dauw has submitted this change and it was merged. Change subject: Merge References for Statements in wbmergeitems .. Merge References for Statements in wbmergeitems If statements have the same main snak and qualifier hashs when merging then rather than create a new statement we should just merge the references accross! Bug: 58850 Change-Id: I256c3e757f7bed8f2e3b731e9ad5f26d507690d3 --- M repo/includes/ChangeOp/ChangeOpReference.php M repo/includes/ChangeOp/ChangeOpsMerge.php M repo/tests/phpunit/includes/api/MergeItemsTest.php 3 files changed, 116 insertions(+), 24 deletions(-) Approvals: Addshore: Verified Jeroen De Dauw: Looks good to me, approved diff --git a/repo/includes/ChangeOp/ChangeOpReference.php b/repo/includes/ChangeOp/ChangeOpReference.php index d82d13f..1c2edf5 100644 --- a/repo/includes/ChangeOp/ChangeOpReference.php +++ b/repo/includes/ChangeOp/ChangeOpReference.php @@ -55,7 +55,7 @@ * * @param string $claimGuid * @param Reference|null $reference -* @param string $referenceHash +* @param string $referenceHash (if empty '' a new reference will be created) * @param int|null $index * * @throws InvalidArgumentException diff --git a/repo/includes/ChangeOp/ChangeOpsMerge.php b/repo/includes/ChangeOp/ChangeOpsMerge.php index 2e5bef9..6448c7b 100644 --- a/repo/includes/ChangeOp/ChangeOpsMerge.php +++ b/repo/includes/ChangeOp/ChangeOpsMerge.php @@ -3,6 +3,9 @@ namespace Wikibase\ChangeOp; use InvalidArgumentException; +use Wikibase\DataModel\Claim\Claim; +use Wikibase\DataModel\Claim\Statement; +use Wikibase\DataModel\Reference; use Wikibase\ItemContent; use Wikibase\Lib\ClaimGuidGenerator; @@ -120,7 +123,7 @@ } private function generateClaimsChangeOps() { - foreach( $this->fromItemContent->getItem()->getClaims() as $fromClaim ){ + foreach( $this->fromItemContent->getItem()->getClaims() as $fromClaim ) { $this->fromChangeOps->add( new ChangeOpMainSnak( $fromClaim->getGuid(), null, @@ -129,10 +132,62 @@ $toClaim = clone $fromClaim; $toClaim->setGuid( null ); + $toMergeToClaim = false; - $this->toChangeOps->add( new ChangeOpClaim( - $toClaim , - new ClaimGuidGenerator( $this->toItemContent->getItem()->getId() ) + if( $toClaim instanceof Statement ) { + $toMergeToClaim = $this->findEquivalentClaim( $toClaim ); + } + + if( $toMergeToClaim ) { + $this->generateReferencesChangeOps( $toClaim, $toMergeToClaim->getGuid() ); + } else { + $this->toChangeOps->add( new ChangeOpClaim( + $toClaim, + new ClaimGuidGenerator( $this->toItemContent->getItem()->getId() ) + ) ); + } + } + } + + /** +* Finds a claim in the target entity with the same main snak and qualifiers as the given $fromStatement +* +* @param Statement $fromStatement +* +* @return Claim|bool Claim to merge reference into or false +*/ + private function findEquivalentClaim( $fromStatement ) { + /** @var $claim Claim */ + foreach( $this->toItemContent->getItem()->getClaims() as $claim ) { + $fromHash = $this->getClaimHash( $fromStatement ); + $toHash = $this->getClaimHash( $claim ); + if( $toHash === $fromHash ) { + return $claim; + } + } + return false; + } + + /** +* @param Statement $statement +* +* @return string combined hash of the Mainsnak and Qualifiers +*/ + private function getClaimHash( Statement $statement ) { + return $statement->getMainSnak()->getHash() . $statement->getQualifiers()->getHash(); + } + + /** +* @param Statement $statement statement to take references from +* @param string $claimGuid claim guid to add the references to +*/ + private function generateReferencesChangeOps( Statement $statement, $claimGuid ) { + /** @var $reference Reference */ + foreach ( $statement->getReferences() as $reference ) { + $this->toChangeOps->add( new ChangeOpReference( + $claimGuid, + $reference, +
[MediaWiki-commits] [Gerrit] Make play button have higher z-index so its clickable. - change (mediawiki...MwEmbedSupport)
Brian Wolff has uploaded a new change for review. https://gerrit.wikimedia.org/r/108637 Change subject: Make play button have higher z-index so its clickable. .. Make play button have higher z-index so its clickable. If the z-index is < the pop up dialog, button cannot be clicked which is very confusing to the user. See also Ibd95d533b9 and bug 60243. Change-Id: Ifbe20df984efd8323e8736cb03680534500f6841 --- M MwEmbedModules/MwEmbedSupport/skins/common/MwEmbedCommonStyle.css 1 file changed, 3 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MwEmbedSupport refs/changes/37/108637/1 diff --git a/MwEmbedModules/MwEmbedSupport/skins/common/MwEmbedCommonStyle.css b/MwEmbedModules/MwEmbedSupport/skins/common/MwEmbedCommonStyle.css index b9602f7..5736017 100644 --- a/MwEmbedModules/MwEmbedSupport/skins/common/MwEmbedCommonStyle.css +++ b/MwEmbedModules/MwEmbedSupport/skins/common/MwEmbedCommonStyle.css @@ -78,7 +78,8 @@ position : absolute; cursor : pointer; border : none !important; - z-index : 1; + /* Needs to have a higher z-index than dialog in pop up mode or can't click */ + z-index : 1501; } .play-btn-large:hover { @@ -215,4 +216,4 @@ .alert-text { color : black !important; -} \ No newline at end of file +} -- To view, visit https://gerrit.wikimedia.org/r/108637 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifbe20df984efd8323e8736cb03680534500f6841 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MwEmbedSupport Gerrit-Branch: master Gerrit-Owner: Brian Wolff ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Create ChangeOpReferenceRemove class. - change (mediawiki...Wikibase)
Jeroen De Dauw has submitted this change and it was merged. Change subject: Create ChangeOpReferenceRemove class. .. Create ChangeOpReferenceRemove class. This simplifies ChangeOpReference by removing the remove function and putting it in a seperate class as suggested on... https://gerrit.wikimedia.org/r/#/c/106897/3/repo/includes/ChangeOp/ChangeOpReference.php Tests are also included in this changeset as well as switching all usage of the old changeop to remove references to use the new changeop Change-Id: I79304c6235a28dda13bdfc5ba0a6908eec683cea --- M repo/Wikibase.classes.php M repo/includes/ChangeOp/ChangeOpReference.php A repo/includes/ChangeOp/ChangeOpReferenceRemove.php M repo/includes/api/RemoveReferences.php A repo/tests/phpunit/includes/ChangeOp/ChangeOpReferenceRemoveTest.php M repo/tests/phpunit/includes/ChangeOp/ChangeOpReferenceTest.php 6 files changed, 201 insertions(+), 72 deletions(-) Approvals: Daniel Kinzler: Verified; Looks good to me, but someone else must approve Addshore: Checked Jeroen De Dauw: Looks good to me, approved jenkins-bot: Checked diff --git a/repo/Wikibase.classes.php b/repo/Wikibase.classes.php index 3db9c65..f88f0d4 100644 --- a/repo/Wikibase.classes.php +++ b/repo/Wikibase.classes.php @@ -54,6 +54,7 @@ 'Wikibase\ChangeOp\ChangeOpClaim' => 'includes/ChangeOp/ChangeOpClaim.php', 'Wikibase\ChangeOp\ChangeOpQualifier' => 'includes/ChangeOp/ChangeOpQualifier.php', 'Wikibase\ChangeOp\ChangeOpReference' => 'includes/ChangeOp/ChangeOpReference.php', + 'Wikibase\ChangeOp\ChangeOpReferenceRemove' => 'includes/ChangeOp/ChangeOpReferenceRemove.php', 'Wikibase\ChangeOp\ChangeOpStatementRank' => 'includes/ChangeOp/ChangeOpStatementRank.php', 'Wikibase\ChangeOp\ChangeOpException' => 'includes/ChangeOp/ChangeOpException.php', diff --git a/repo/includes/ChangeOp/ChangeOpReference.php b/repo/includes/ChangeOp/ChangeOpReference.php index 21144e8..d82d13f 100644 --- a/repo/includes/ChangeOp/ChangeOpReference.php +++ b/repo/includes/ChangeOp/ChangeOpReference.php @@ -69,12 +69,8 @@ throw new InvalidArgumentException( '$referenceHash needs to be a string' ); } - if ( !( $reference instanceof Reference ) && !is_null( $reference ) ) { - throw new InvalidArgumentException( '$reference needs to be an instance of Reference or null' ); - } - - if ( $referenceHash === '' && $reference === null ) { - throw new InvalidArgumentException( 'Either $referenceHash or $reference needs to be set' ); + if ( !( $reference instanceof Reference ) ) { + throw new InvalidArgumentException( '$reference needs to be an instance of Reference' ); } if( !is_null( $index ) && !is_integer( $index ) ) { @@ -89,7 +85,6 @@ /** * @see ChangeOp::apply() -* - the reference gets removed when $referenceHash is set and $reference is not set * - a new reference gets added when $referenceHash is empty and $reference is set * - the reference gets set to $reference when $referenceHash and $reference are set */ @@ -111,11 +106,7 @@ if ( $this->referenceHash === '' ) { $this->addReference( $references, $summary ); } else { - if ( $this->reference != null ) { - $this->setReference( $references, $summary ); - } else { - $this->removeReference( $references, $summary ); - } + $this->setReference( $references, $summary ); } if ( $summary !== null ) { @@ -173,25 +164,6 @@ $references->removeReferenceHash( $this->referenceHash ); $references->addReference( $this->reference, $this->index ); $this->updateSummary( $summary, 'set' ); - } - - /** -* @since 0.4 -* -* @param References $references -* @param Summary $summary -* -* @throws ChangeOpException -*/ - protected function removeReference( References $references, Summary $summary = null ) { - if ( !$references->hasReferenceHash( $this->referenceHash ) ) { - throw new ChangeOpException( "Reference with hash $this->referenceHash does not exist" ); - } - $references->removeReferenceHash( $this->referenceHash ); - $this->updateSummary( $summary, 'remove' ); - if ( $summary !== null ) { - $summary->addAutoCommentArgs( 1 ); //atomic edit, only one reference changed - }
[MediaWiki-commits] [Gerrit] Move flow( 'loadReplyForm' ) to base/action.js - change (mediawiki...Flow)
Matthias Mullie has uploaded a new change for review. https://gerrit.wikimedia.org/r/108634 Change subject: Move flow( 'loadReplyForm' ) to base/action.js .. Move flow( 'loadReplyForm' ) to base/action.js Change-Id: Iee67765d60851deb62e4ce6b87b7869eedae224b --- M modules/base/action.js M modules/base/ui-functions.js M modules/discussion/post.js M modules/discussion/styles/nojs.less M modules/discussion/styles/post.less M modules/discussion/styles/topic.less M modules/discussion/topic.js M templates/post.html.php M templates/topic.html.php 9 files changed, 203 insertions(+), 192 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow refs/changes/34/108634/1 diff --git a/modules/base/action.js b/modules/base/action.js index e1cd551..57bd5fa 100644 --- a/modules/base/action.js +++ b/modules/base/action.js @@ -23,26 +23,43 @@ }; /** +* HTML of the cancel link (well, jQuery node with the html of the link) +* +* @returns {jQuery} +*/ + mw.flow.action.prototype.cancelLink = function () { + return $( + '' + + mw.msg( 'flow-cancel' ) + + '' + + // add some whitespace to separate from what's next ;) + ' ' + ); + }; + + /** * HTML of the edit form (well, jQuery node with the html of the edit form) * * @returns {jQuery} */ mw.flow.action.prototype.editForm = function () { - return $( + var $form = $( '' + '' + '' + - '' + - mw.msg( 'flow-cancel' ) + - '' + + // cancel link will be added here '' + '' + '' ); + + this.cancelLink().prependTo( $form.find( '.flow-form-controls' ) ); + + return $form; }; /** -* Builds the edit form, using flow( setupEditForm ). +* Creates an edit form. * * @param {object} data this.prepareResult return value * @param {function} [loadFunction] callback to be executed when form is loaded @@ -53,32 +70,34 @@ } // build form DOM & attach to content - var $postForm = this.editForm(); - $postForm.appendTo( this.object.$container ); + var $form = this.editForm(); + $form.appendTo( this.object.$container ); // add class to identify this form as being active this.object.$container.addClass( 'flow-edit-form-active' ); // bind click on cancel, which should destroy this form - $postForm.find( '.flow-cancel-link' ).click( function ( event ) { + $form.find( '.flow-cancel-link' ).click( function ( event ) { event.preventDefault(); - $postForm.slideUp( 'fast', this.destroyEditForm.bind( this ) ); + $form.slideUp( 'fast', this.destroyEditForm.bind( this ) ); }.bind( this ) ); // setup preview - $postForm.flow( 'setupPreview' ); + $form.flow( 'setupPreview' ); // setup submission callback - $postForm.flow( 'setupFormHandler', + $form.flow( 'setupFormHandler', '.flow-edit-submit', this.submitFunction.bind( this, data ), - this.loadParametersCallback.bind( this ), + this.loadParametersCallback.bind( this, $form ), this.validateCallback.bind( this ), - this.promiseCallback.bind( this ) + function ( deferred ) { + deferred.done( this.destroyEditForm.bind( this ) ); + }.bind( this ) ); // setup disabler (disables submit button until content is entered) - $postForm.flow( 'setupEmptyDisabler', + $form.flow( 'setupEmptyDisabler', ['.flow-edit-content'], '.flow-edit-submit' ); @@ -87,21 +106,21 @@ * Setting focus inside an event that grants focus (like * clicking the edit icon), is tricky. This is a workaround. */ - setTimeout( function( $postForm, data, loadFunction ) { - var $textarea = $postForm.find( 'textarea' ), +
[MediaWiki-commits] [Gerrit] Alternative way of dealing with edit conflicts - change (mediawiki...Flow)
Matthias Mullie has uploaded a new change for review. https://gerrit.wikimedia.org/r/108635 Change subject: Alternative way of dealing with edit conflicts .. Alternative way of dealing with edit conflicts getFormHandler adds a done & fail path for the submission's deferred. Edit conflicts will trigger a fail, so an error message will be displayed. Prior to this patch, we stacked another fail-callback from withing a fail- callback that was executed prior to getFormHandler's fail, to the end of the stack. This made it possible to "undo" the effects caused by getFormHandler. This patch changes this: using .then, a deferred can be returned, which will be used for the follow-up callbacks. We're now returning a new unresolved/rejected deferred, so getFormHandler's done & fail callbacks will never be executed. Change-Id: I2870e66f98e0bb2f98bb77024cc32e202b9dfa53 --- M modules/base/ui-functions.js M modules/discussion/post.js M modules/header/forms.js 3 files changed, 61 insertions(+), 59 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow refs/changes/35/108635/1 diff --git a/modules/base/ui-functions.js b/modules/base/ui-functions.js index 095fda9..24a33f3 100644 --- a/modules/base/ui-functions.js +++ b/modules/base/ui-functions.js @@ -141,19 +141,15 @@ } submitFunction.apply( this, params ) - .done( function ( output ) { + .always( function () { $spinner.remove(); $button.show(); - $form.find( '.flow-cancel-link' ) - .click(); - + } ) + .done( function ( output ) { deferredObject.resolve.apply( $button, arguments ); } ) .fail( function () { var $errorDiv = $( '' ).flow( 'showError', arguments ); - - $spinner.remove(); - $button.show(); if ( $form ) { $form.append( $errorDiv ); diff --git a/modules/discussion/post.js b/modules/discussion/post.js index 016f329..9634133 100644 --- a/modules/discussion/post.js +++ b/modules/discussion/post.js @@ -163,7 +163,8 @@ ); deferred.done( this.render.bind( this ) ); - deferred.fail( this.conflict.bind( this, deferred, data ) ); + // allow hijacking the fail-stack to gracefully recover from errors + deferred = deferred.then( null, this.conflict.bind( this, deferred, data ) ); return deferred; }; @@ -189,6 +190,7 @@ * @param {object} data Old (invalid) this.prepareResult return value * @param {string} error * @param {object} errorData +* @return {jQuery.Deferred} */ mw.flow.action.post.edit.prototype.conflict = function ( deferred, data, error, errorData ) { if ( @@ -208,37 +210,38 @@ data.revision = errorData.topic.prev_revision.extra.revision_id; /* -* At this point, we're still in the deferred's reject callbacks. -* Only after these are completed, is the spinner removed and the -* error message added. -* I'm adding another fail-callback, which will be executed after -* the fail has been handled. Only then, we can properly clean up. +* Tipsy will be positioned at the element where it's bound +* to, at the time it's asked to show. It won't reposition +* if the element moves. Since we re-launch the form, there +* may be some movement, so let's have this as callback when +* the form has completed loading before doing these changes. */ - deferred.fail( function ( data, error, errorData ) { + var formLoaded = function () { + var $button = this.object.$container.find( '.flow-edit-submit' ); + $button.val( mw.msg( 'flow-edit-post-submit-overwrite' ) ); +
[MediaWiki-commits] [Gerrit] Add r-base to Hadoop worker machines - change (operations/puppet)
OliverKeyes has uploaded a new change for review. https://gerrit.wikimedia.org/r/108633 Change subject: Add r-base to Hadoop worker machines .. Add r-base to Hadoop worker machines One of the deficiencies in the current hadoop/kafka setup is the lack of any ability for post-processing on analytics1011 (unless you want base python, and only base python). A larger explanation can be found in https://www.mediawiki.org/wiki/Analytics/Kraken/Researcher_analysis This commit adds r-base to the analytics workers, allowing for the use of R on analytics1011, broadening the post-processing options. Further R packages can be installed as- and when- they're needed, on a per-user basis if necessary. This also allows for experimentation with distributing post-processing over the workers themselves. Change-Id: I7a3fd3c1813fd6301d87abb51835d9fb6a8a6d17 --- M manifests/role/analytics/hadoop.pp 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/33/108633/1 diff --git a/manifests/role/analytics/hadoop.pp b/manifests/role/analytics/hadoop.pp index 74732ed..54192a0 100644 --- a/manifests/role/analytics/hadoop.pp +++ b/manifests/role/analytics/hadoop.pp @@ -111,6 +111,10 @@ class { 'cdh4::hadoop::jmxtrans::worker': ganglia => "${ganglia_host}:${ganglia_port}", } + +# Require r-base on hadoop worker nodes. +# A highlighted issue with analytics1011 is the inability to do any post-processing (except through base python) +package { "r-base": ensure => "present" } } # == Class role::analytics::hadoop::standby -- To view, visit https://gerrit.wikimedia.org/r/108633 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7a3fd3c1813fd6301d87abb51835d9fb6a8a6d17 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: OliverKeyes ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Rename hooks to lower case - change (mediawiki...ContentTranslation)
Amire80 has uploaded a new change for review. https://gerrit.wikimedia.org/r/108632 Change subject: Rename hooks to lower case .. Rename hooks to lower case Change-Id: I48fba3c4d1e5ac8603e165f08570cdc2f3059250 --- M modules/header/ext.cx.header.js M modules/translation/ext.cx.translation.js 2 files changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContentTranslation refs/changes/32/108632/1 diff --git a/modules/header/ext.cx.header.js b/modules/header/ext.cx.header.js index 78709e6..38d0c59 100644 --- a/modules/header/ext.cx.header.js +++ b/modules/header/ext.cx.header.js @@ -77,7 +77,7 @@ mw.hook( 'mw.cx.publish' ).fire(); } ); - mw.hook( 'mw.cx.changeTranslation' ).add( $.proxy( this.setPublishButtonState, this ) ); + mw.hook( 'mw.cx.translation.change' ).add( $.proxy( this.setPublishButtonState, this ) ); }; $.fn.cxHeader = function ( options ) { diff --git a/modules/translation/ext.cx.translation.js b/modules/translation/ext.cx.translation.js index 39dfecf..f35ec37 100644 --- a/modules/translation/ext.cx.translation.js +++ b/modules/translation/ext.cx.translation.js @@ -71,7 +71,7 @@ .html( '\n' ); // Make sure that it's visible to the tests this.$container.append( $content ); - mw.hook( 'mw.cx.changeTranslation' ).fire(); + mw.hook( 'mw.cx.translation.change' ).fire(); this.$title = this.$container.find( '.cx-column__title' ); this.$content = this.$container.find( '.cx-column__content' ); }; @@ -79,14 +79,14 @@ ContentTranslationEditor.prototype.listen = function () { mw.hook( 'mw.cx.translation.add' ).add( $.proxy( this.update, this ) ); this.$container.find( '.cx-column__content' ).on( 'input', function () { - mw.hook( 'mw.cx.changeTranslation' ).fire(); + mw.hook( 'mw.cx.translation.change' ).fire(); } ); }; ContentTranslationEditor.prototype.update = function ( data ) { this.$content.html( data ); mw.hook( 'mw.cx.progress' ).fire( 100 ); - mw.hook( 'mw.cx.changeTranslation' ).fire(); + mw.hook( 'mw.cx.translation.change' ).fire(); }; $.fn.cxTranslation = function ( options ) { -- To view, visit https://gerrit.wikimedia.org/r/108632 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I48fba3c4d1e5ac8603e165f08570cdc2f3059250 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/ContentTranslation Gerrit-Branch: master Gerrit-Owner: Amire80 ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Remove z-index on cannot play file warning - change (mediawiki...TimedMediaHandler)
Brian Wolff has uploaded a new change for review. https://gerrit.wikimedia.org/r/108631 Change subject: Remove z-index on cannot play file warning .. Remove z-index on cannot play file warning This was causing the text in the warning to be unselectable, and unclickable. Given that commons has links in that message, this is a pretty severe usability issue. I don't know why the z-index was set on this element. If it was important, giving it a higher z-index (It was 2, would need to be > 1002 to be above the containing div) would also fix the issue. Change-Id: Ibd95d533b91f1f8b6bb9c983486e849c95005e8b --- M MwEmbedModules/EmbedPlayer/resources/skins/mw.PlayerControlBuilder.js 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TimedMediaHandler refs/changes/31/108631/1 diff --git a/MwEmbedModules/EmbedPlayer/resources/skins/mw.PlayerControlBuilder.js b/MwEmbedModules/EmbedPlayer/resources/skins/mw.PlayerControlBuilder.js index 0fabaeb..d5d2b46 100644 --- a/MwEmbedModules/EmbedPlayer/resources/skins/mw.PlayerControlBuilder.js +++ b/MwEmbedModules/EmbedPlayer/resources/skins/mw.PlayerControlBuilder.js @@ -1429,7 +1429,6 @@ 'left' : '10px', 'right' : '10px', 'padding' : '4px', - 'z-index' : 2 }) .html( warningMsg ); -- To view, visit https://gerrit.wikimedia.org/r/108631 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibd95d533b91f1f8b6bb9c983486e849c95005e8b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/TimedMediaHandler Gerrit-Branch: master Gerrit-Owner: Brian Wolff ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] move date.test() to testsuite - change (pywikibot/core)
Xqt has uploaded a new change for review. https://gerrit.wikimedia.org/r/108630 Change subject: move date.test() to testsuite .. move date.test() to testsuite testMapEntry and test procedures are removed from date library and its content moved to date_tests.py. We have only one test method which runs through the whole date.format. If the test failes there it reports the current format keys. Change-Id: I596cb53339bbe43e39b37331a41ff937f7a1161c --- M pywikibot/date.py A tests/date_tests.py 2 files changed, 49 insertions(+), 85 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/30/108630/1 diff --git a/pywikibot/date.py b/pywikibot/date.py index ad57e2c..a1b85ad 100644 --- a/pywikibot/date.py +++ b/pywikibot/date.py @@ -10,7 +10,7 @@ # (C) Andre Engels, 2004-2005 # (C) Yuri Astrakhan, 2005-2006 firstnamelastn...@gmail.com # (years/decades/centuries/millenniums str <=> int conversions) -# (C) Pywikibot team, 2004-2013 +# (C) Pywikibot team, 2004-2014 # # Distributed under the terms of the MIT license. # @@ -2324,89 +2324,6 @@ else: return formats['YearAD'][lang](year) -# -# Map testing methods -# - - -def printMonthArray(lang, pattern, capitalize): -""" -""" -for s in makeMonthNamedList(lang, pattern, capitalize): -pywikibot.output(s) - - -def testMapEntry(formatName, showAll=True, value=None): -"""This is a test function, to be used interactivelly to test the validity -of the above maps. To test, run this function with the map name, value to -be tested, and the final value expected. -Usage example: -run python interpreter ->>> import date ->>> date.testMapEntry('DecadeAD', 1992, 1990) ->>> date.testMapEntry('CenturyAD', 20, 20) - -""" - -step = 1 -if formatName in decadeFormats: -step = 10 -predicate, start, stop = formatLimits[formatName] -if value is not None: -start, stop = value, value + 1 -if showAll: -pywikibot.output(u"Processing %s with limits from %d to %d and step %d" - % (formatName, start, stop - 1, step)) - -for code, convFunc in formats[formatName].items(): -##import time -##startClock = time.clock() -for value in range(start, stop, step): -try: -if not predicate(value): -raise AssertionError( -" Not a valid value for this format.") -newValue = convFunc(convFunc(value)) -if newValue != value: -raise AssertionError( -" %s != %s: assert failed, values didn't match" -% (newValue, value)) -if showAll: -pywikibot.output(u"date.formats['%s']['%s'](%d): '%s' -> %d" - % (formatName, code, value, convFunc(value), -newValue)) -except: -pywikibot.output(u"** Error in date.formats['%s']['%s'](%d)" - % (formatName, code, value)) -raise -##print(u"%s\t%s\t%f" % (formatName, code, time.clock() - startClock)) - - -def test(quick=False, showAll=False): -"""This is a test function, to be used interactively to test entire -format conversion map at once - -Usage example: -run python interpreter ->>> import date ->>> date.test() - -""" -for formatName in formats: -if quick: -# Only test the first value in the test range -testMapEntry(formatName, showAll, formatLimits[formatName][1]) -else: -# Extensive test! Test decade rounding -testMapEntry(formatName, showAll) -pywikibot.output(u"'%s' complete." % formatName) -if quick: -##print(u'Date module quick consistency test passed') -pass -else: -print(u'Date module has been fully tested') - if __name__ == "__main__": -# Test the date file -test(quick=False) +print(__doc__) diff --git a/tests/date_tests.py b/tests/date_tests.py new file mode 100644 index 000..8b1a911 --- /dev/null +++ b/tests/date_tests.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +# +# (C) Pywikipedia bot team, 2014 +# +# Distributed under the terms of the MIT license. +# +__version__ = '$Id$' + +from utils import unittest + +import pywikibot +import pywikibot.date as date + + +class TestDate(unittest.TestCase): +"""Test cases for date library""" + +def testMapEntry(self): +"""Tests the validity of the pywikibot.date format maps.""" +for formatName in date.formats: + +step = 1 +predicate, start, stop = date.formatLimits[formatName] + +for code, convFunc in date.formats[formatName].items():
[MediaWiki-commits] [Gerrit] Upgrading setuptools with scripts/install - change (analytics/wikimetrics)
Ottomata has submitted this change and it was merged. Change subject: Upgrading setuptools with scripts/install .. Upgrading setuptools with scripts/install Change-Id: Icaef0a0590045aa101509f07ef68aa7fe53aec91 --- M scripts/install 1 file changed, 8 insertions(+), 6 deletions(-) Approvals: Ottomata: Verified; Looks good to me, approved diff --git a/scripts/install b/scripts/install index 96d57e9..04970fe 100755 --- a/scripts/install +++ b/scripts/install @@ -1,11 +1,14 @@ # installs dependencies -set -e - # Need newer pip than comes with debian/ubuntu sudo pip install --upgrade pip -(pip freeze | grep -P httplib2==[0-9.]+) && sudo pip uninstall -y httplib2 && echo "*** uninstalled httplib2" +# find newly installed pip +pip=$(which pip) + +$pip install --upgrade --no-use-wheel setuptools + +($pip freeze | grep -P httplib2==[0-9.]+) && sudo $pip uninstall -y httplib2 && echo "*** uninstalled httplib2" # is it wikimetrics_dir=${$1:-$(pwd)}? wikimetrics_dir=${1:-$(pwd)} @@ -14,14 +17,13 @@ if [ -z "${good_httplib}" ] then tmpdir=$(mktemp -d /tmp/wikimetrics_httplib2.X) -cd $tmpdir +cd "${tmpdir}" git clone --depth=1 https://github.com/wikimedia/pywikibot-externals-httplib2 cd pywikibot-externals-httplib2 sudo python setup.py install -rm -rf $tmpdir echo "*** installed pywikibot's httplib2" fi cd $wikimetrics_dir -sudo pip install -e . +sudo $pip install -e . echo "*** installed dependencies" -- To view, visit https://gerrit.wikimedia.org/r/108629 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icaef0a0590045aa101509f07ef68aa7fe53aec91 Gerrit-PatchSet: 1 Gerrit-Project: analytics/wikimetrics Gerrit-Branch: master Gerrit-Owner: Ottomata Gerrit-Reviewer: Ottomata ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Upgrading setuptools with scripts/install - change (analytics/wikimetrics)
Ottomata has uploaded a new change for review. https://gerrit.wikimedia.org/r/108629 Change subject: Upgrading setuptools with scripts/install .. Upgrading setuptools with scripts/install Change-Id: Icaef0a0590045aa101509f07ef68aa7fe53aec91 --- M scripts/install 1 file changed, 8 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/analytics/wikimetrics refs/changes/29/108629/1 diff --git a/scripts/install b/scripts/install index 96d57e9..04970fe 100755 --- a/scripts/install +++ b/scripts/install @@ -1,11 +1,14 @@ # installs dependencies -set -e - # Need newer pip than comes with debian/ubuntu sudo pip install --upgrade pip -(pip freeze | grep -P httplib2==[0-9.]+) && sudo pip uninstall -y httplib2 && echo "*** uninstalled httplib2" +# find newly installed pip +pip=$(which pip) + +$pip install --upgrade --no-use-wheel setuptools + +($pip freeze | grep -P httplib2==[0-9.]+) && sudo $pip uninstall -y httplib2 && echo "*** uninstalled httplib2" # is it wikimetrics_dir=${$1:-$(pwd)}? wikimetrics_dir=${1:-$(pwd)} @@ -14,14 +17,13 @@ if [ -z "${good_httplib}" ] then tmpdir=$(mktemp -d /tmp/wikimetrics_httplib2.X) -cd $tmpdir +cd "${tmpdir}" git clone --depth=1 https://github.com/wikimedia/pywikibot-externals-httplib2 cd pywikibot-externals-httplib2 sudo python setup.py install -rm -rf $tmpdir echo "*** installed pywikibot's httplib2" fi cd $wikimetrics_dir -sudo pip install -e . +sudo $pip install -e . echo "*** installed dependencies" -- To view, visit https://gerrit.wikimedia.org/r/108629 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icaef0a0590045aa101509f07ef68aa7fe53aec91 Gerrit-PatchSet: 1 Gerrit-Project: analytics/wikimetrics Gerrit-Branch: master Gerrit-Owner: Ottomata ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] WIP: Add the ability to delete a page via WebAPI in tests - change (mediawiki...ContentTranslation)
Amire80 has uploaded a new change for review. https://gerrit.wikimedia.org/r/108628 Change subject: WIP: Add the ability to delete a page via WebAPI in tests .. WIP: Add the ability to delete a page via WebAPI in tests WIP, not tested, committing just for saving. Change-Id: Id0839cf1bdd9f8a26c83322b977d9497ce71d3b9 --- M tests/browser/features/support/env.rb A tests/browser/features/support/hooks.rb 2 files changed, 33 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContentTranslation refs/changes/28/108628/1 diff --git a/tests/browser/features/support/env.rb b/tests/browser/features/support/env.rb index 24feda0..ef74513 100644 --- a/tests/browser/features/support/env.rb +++ b/tests/browser/features/support/env.rb @@ -1 +1,31 @@ require "mediawiki/selenium" +require "rest-client" + +def delete_wiki_page(title) + unless (ENV["API_URL"]) + puts "API_URL is not defined - make sure to export a value for that variable before running this test." + end + + delete_token_response = RestClient.post ENV["API_URL"], { + action: "query", + prop: "info", + intoken: "delete", + titles: title, + } + + delete_token_data = JSON.parse(delete_token_response.body) + delete_token = delete_token_data["query"]["pages"].values[0].deletetoken + + if delete_token.length < 4 + puts 'delete token too short' + end + + # title=User%3ATranslatorToDa%2FBratislava&token=d92f7980c914985773d05e514be44980%2B%5C&reason=Deleting%20for%20testing%20ContentTranslation + + delete_response = RestClient.post ENV["API_URL"], { + action: "delete", + token: delete_token, + title: title, + reason: "Deleting the page for browser testing", + } +end diff --git a/tests/browser/features/support/hooks.rb b/tests/browser/features/support/hooks.rb new file mode 100644 index 000..33e43cb --- /dev/null +++ b/tests/browser/features/support/hooks.rb @@ -0,0 +1,3 @@ +Before("@delete_translated_page") do + delete_wiki_page("User:TranslatorToDa/Bratislava") +end -- To view, visit https://gerrit.wikimedia.org/r/108628 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id0839cf1bdd9f8a26c83322b977d9497ce71d3b9 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/ContentTranslation Gerrit-Branch: master Gerrit-Owner: Amire80 ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix tags breaking line-flow - change (apps...wikipedia)
Yuvipanda has uploaded a new change for review. https://gerrit.wikimedia.org/r/108627 Change subject: Fix tags breaking line-flow .. Fix tags breaking line-flow Change-Id: Ibdd78b2308d77981efba72cd51168ebfc622dd76 --- M wikipedia/assets/styles.css M www/less/pagestyles.less 2 files changed, 13 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia refs/changes/27/108627/1 diff --git a/wikipedia/assets/styles.css b/wikipedia/assets/styles.css index d489102..25f6068 100644 --- a/wikipedia/assets/styles.css +++ b/wikipedia/assets/styles.css @@ -104,6 +104,12 @@ margin-top: 4px; margin-bottom: 4px; } +/* Fix line height things! */ +sup { + vertical-align: super; + font-size: 60%; + line-height: 0; +} /* Last updated info */ #attribution { border-top: 1px solid #ccc; diff --git a/www/less/pagestyles.less b/www/less/pagestyles.less index 1664573..753d23d 100644 --- a/www/less/pagestyles.less +++ b/www/less/pagestyles.less @@ -87,6 +87,13 @@ margin-bottom: 4px; } +/* Fix line height things! */ +sup { +vertical-align: super; +font-size: 60%; +line-height: 0; +} + /* Last updated info */ #attribution { border-top: 1px solid #ccc; -- To view, visit https://gerrit.wikimedia.org/r/108627 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibdd78b2308d77981efba72cd51168ebfc622dd76 Gerrit-PatchSet: 1 Gerrit-Project: apps/android/wikipedia Gerrit-Branch: master Gerrit-Owner: Yuvipanda ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Use OpenSans WebFont for primary content - change (apps...wikipedia)
Yuvipanda has uploaded a new change for review. https://gerrit.wikimedia.org/r/108626 Change subject: Use OpenSans WebFont for primary content .. Use OpenSans WebFont for primary content This does not adversely affect performance, since we are loading the font locally Change-Id: I003c70c7dcaa31069998965f5a21af6ade6eba4e --- A wikipedia/assets/fonts/OpenSans-Bold.ttf A wikipedia/assets/fonts/OpenSans-BoldItalic.ttf A wikipedia/assets/fonts/OpenSans-Italic.ttf A wikipedia/assets/fonts/OpenSans.ttf M wikipedia/assets/styles.css M www/Gruntfile.js A www/fonts/OpenSans-Bold.ttf A www/fonts/OpenSans-BoldItalic.ttf A www/fonts/OpenSans-Italic.ttf A www/fonts/OpenSans.ttf A www/less/fonts.less M www/less/pagestyles.less 12 files changed, 60 insertions(+), 9 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia refs/changes/26/108626/1 diff --git a/wikipedia/assets/fonts/OpenSans-Bold.ttf b/wikipedia/assets/fonts/OpenSans-Bold.ttf new file mode 100644 index 000..fd79d43 --- /dev/null +++ b/wikipedia/assets/fonts/OpenSans-Bold.ttf Binary files differ diff --git a/wikipedia/assets/fonts/OpenSans-BoldItalic.ttf b/wikipedia/assets/fonts/OpenSans-BoldItalic.ttf new file mode 100644 index 000..9bc8009 --- /dev/null +++ b/wikipedia/assets/fonts/OpenSans-BoldItalic.ttf Binary files differ diff --git a/wikipedia/assets/fonts/OpenSans-Italic.ttf b/wikipedia/assets/fonts/OpenSans-Italic.ttf new file mode 100644 index 000..c90da48 --- /dev/null +++ b/wikipedia/assets/fonts/OpenSans-Italic.ttf Binary files differ diff --git a/wikipedia/assets/fonts/OpenSans.ttf b/wikipedia/assets/fonts/OpenSans.ttf new file mode 100644 index 000..db43334 --- /dev/null +++ b/wikipedia/assets/fonts/OpenSans.ttf Binary files differ diff --git a/wikipedia/assets/styles.css b/wikipedia/assets/styles.css index d073bf7..d489102 100644 --- a/wikipedia/assets/styles.css +++ b/wikipedia/assets/styles.css @@ -1,10 +1,35 @@ +@font-face { + font-family: 'Open Sans'; + font-style: normal; + font-weight: 400; + src: local('Open Sans'), local('OpenSans'), url(fonts/OpenSans.ttf) format('truetype'); +} +@font-face { + font-family: 'Open Sans'; + font-style: normal; + font-weight: 700; + src: local('Open Sans Bold'), local('OpenSans-Bold'), url(fonts/OpenSans-Bold.ttf) format('truetype'); +} +@font-face { + font-family: 'Open Sans'; + font-style: italic; + font-weight: 400; + src: local('Open Sans Italic'), local('OpenSans-Italic'), url(fonts/OpenSans-Italic.ttf) format('truetype'); +} +@font-face { + font-family: 'Open Sans'; + font-style: italic; + font-weight: 700; + src: local('Open Sans Bold Italic'), local('OpenSans-BoldItalic'), url(fonts/OpenSans-BoldItalic.ttf) format('truetype'); +} + /* Should be moved out to the MobileApp extension at some point */ body { background-color: #F2F2F2; color: #333; - font-family: sans-serif; + font-family: "Open Sans", sans-serif; font-size: 16px; - line-height: 24px; + line-height: 160%; margin: 0; padding: 0; margin-top: 48px; @@ -30,7 +55,7 @@ h4, h5, h6 { - font-family: sans-serif; + font-family: "Open Sans", sans-serif; } h2 { font-size: 22px; diff --git a/www/Gruntfile.js b/www/Gruntfile.js index b359975..65b554c 100644 --- a/www/Gruntfile.js +++ b/www/Gruntfile.js @@ -8,8 +8,7 @@ "tests/*.js" ]; var allStyleFiles = [ -"pagestyles.css", -"ui.css" +"less/*.less" ]; var allHTMLFiles = [ "index.html", @@ -48,7 +47,10 @@ {src: ["bundle-test.js", "tests/index.html"], dest: "../wikipedia/assets/"}, // Images -{src: ["images/*"], dest:"../wikipedia/assets/"} +{src: ["images/*"], dest:"../wikipedia/assets/"}, + +// Fonts +{src: ["fonts/*"], dest:"../wikipedia/assets/"} ] } }, diff --git a/www/fonts/OpenSans-Bold.ttf b/www/fonts/OpenSans-Bold.ttf new file mode 100644 index 000..fd79d43 --- /dev/null +++ b/www/fonts/OpenSans-Bold.ttf Binary files differ diff --git a/www/fonts/OpenSans-BoldItalic.ttf b/www/fonts/OpenSans-BoldItalic.ttf new file mode 100644 index 000..9bc8009 --- /dev/null +++ b/www/fonts/OpenSans-BoldItalic.ttf Binary files differ diff --git a/www/fonts/OpenSans-Italic.ttf b/www/fonts/OpenSans-Italic.ttf new file mode 100644 index 000..c90da48 --- /dev/null +++ b/www/fonts/OpenSans-Italic.ttf Binary files differ diff --git a/www/fonts/OpenSans.ttf b/www/fonts/OpenSans.ttf new file mode 100644 index 000..db43334 --- /dev/null +++ b/www/fonts/OpenSans.ttf Binary files differ diff --git a/www/less/fonts.less b/www/less/fonts.less new file mode 100644 index 000..2dcf564 --- /dev/null +++ b/www/less/fonts.less @@ -0,0 +1,24 @@ +@font-face { + font-family: 'Open Sans'; + font-style: normal; +
[MediaWiki-commits] [Gerrit] Upgrading pip to install wikimetrics dependencies in scripts... - change (analytics/wikimetrics)
Ottomata has submitted this change and it was merged. Change subject: Upgrading pip to install wikimetrics dependencies in scripts/install .. Upgrading pip to install wikimetrics dependencies in scripts/install Change-Id: I8cbc2dd79d0982fbe452ba64a9067684541aa2f2 --- M scripts/install 1 file changed, 7 insertions(+), 2 deletions(-) Approvals: Ottomata: Verified; Looks good to me, approved diff --git a/scripts/install b/scripts/install index c6be8a3..96d57e9 100755 --- a/scripts/install +++ b/scripts/install @@ -1,12 +1,17 @@ # installs dependencies -(pip freeze | grep -P httplib2==[0-9.]+) && pip uninstall httplib2 && echo "*** uninstalled httplib2" +set -e + +# Need newer pip than comes with debian/ubuntu +sudo pip install --upgrade pip + +(pip freeze | grep -P httplib2==[0-9.]+) && sudo pip uninstall -y httplib2 && echo "*** uninstalled httplib2" # is it wikimetrics_dir=${$1:-$(pwd)}? wikimetrics_dir=${1:-$(pwd)} good_httplib=$(pip freeze | grep 'httplib2.*pywikibot') -if [[ -z "${good_httplib}" ]] +if [ -z "${good_httplib}" ] then tmpdir=$(mktemp -d /tmp/wikimetrics_httplib2.X) cd $tmpdir -- To view, visit https://gerrit.wikimedia.org/r/108625 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8cbc2dd79d0982fbe452ba64a9067684541aa2f2 Gerrit-PatchSet: 1 Gerrit-Project: analytics/wikimetrics Gerrit-Branch: master Gerrit-Owner: Ottomata Gerrit-Reviewer: Ottomata ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Upgrading pip to install wikimetrics dependencies in scripts... - change (analytics/wikimetrics)
Ottomata has uploaded a new change for review. https://gerrit.wikimedia.org/r/108625 Change subject: Upgrading pip to install wikimetrics dependencies in scripts/install .. Upgrading pip to install wikimetrics dependencies in scripts/install Change-Id: I8cbc2dd79d0982fbe452ba64a9067684541aa2f2 --- M scripts/install 1 file changed, 7 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/analytics/wikimetrics refs/changes/25/108625/1 diff --git a/scripts/install b/scripts/install index c6be8a3..96d57e9 100755 --- a/scripts/install +++ b/scripts/install @@ -1,12 +1,17 @@ # installs dependencies -(pip freeze | grep -P httplib2==[0-9.]+) && pip uninstall httplib2 && echo "*** uninstalled httplib2" +set -e + +# Need newer pip than comes with debian/ubuntu +sudo pip install --upgrade pip + +(pip freeze | grep -P httplib2==[0-9.]+) && sudo pip uninstall -y httplib2 && echo "*** uninstalled httplib2" # is it wikimetrics_dir=${$1:-$(pwd)}? wikimetrics_dir=${1:-$(pwd)} good_httplib=$(pip freeze | grep 'httplib2.*pywikibot') -if [[ -z "${good_httplib}" ]] +if [ -z "${good_httplib}" ] then tmpdir=$(mktemp -d /tmp/wikimetrics_httplib2.X) cd $tmpdir -- To view, visit https://gerrit.wikimedia.org/r/108625 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8cbc2dd79d0982fbe452ba64a9067684541aa2f2 Gerrit-PatchSet: 1 Gerrit-Project: analytics/wikimetrics Gerrit-Branch: master Gerrit-Owner: Ottomata ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] (Bug 60120) Reset pipeline state before parsing original wik... - change (mediawiki...parsoid)
jenkins-bot has submitted this change and it was merged. Change subject: (Bug 60120) Reset pipeline state before parsing original wikitext .. (Bug 60120) Reset pipeline state before parsing original wikitext * This bug was exposed by commit 8a7a5cb1 (since the _rtselser diff is not present before 8a7a5cb1). * SelectiveSerializer needs to reset parser pipeline state before using it to parse original wikitext since it would change cite ids assigned to references which then shows up as dom-diffs in the /_rtselser/ endpoint. Change-Id: I01a3c3d0bda578cfbc5489290b3cd52e3ecd1826 --- M lib/mediawiki.SelectiveSerializer.js 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Arlolra: Looks good to me, approved jenkins-bot: Verified diff --git a/lib/mediawiki.SelectiveSerializer.js b/lib/mediawiki.SelectiveSerializer.js index 20a9df4..ed773b5 100644 --- a/lib/mediawiki.SelectiveSerializer.js +++ b/lib/mediawiki.SelectiveSerializer.js @@ -143,7 +143,7 @@ //console.log(body.outerHTML); self.doSerializeDOM(null, doc, cb, finalcb); } ); - parserPipeline.process(this.env.page.src); + parserPipeline.processToplevelDoc(this.env.page.src); }; -- To view, visit https://gerrit.wikimedia.org/r/108171 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I01a3c3d0bda578cfbc5489290b3cd52e3ecd1826 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/services/parsoid Gerrit-Branch: master Gerrit-Owner: Subramanya Sastry Gerrit-Reviewer: Arlolra Gerrit-Reviewer: GWicke Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Make CommunicationBridge fully asynchronous - change (apps...wikipedia)
Yuvipanda has uploaded a new change for review. https://gerrit.wikimedia.org/r/108541 Change subject: Make CommunicationBridge fully asynchronous .. Make CommunicationBridge fully asynchronous - Removes ability to return JSON from messages - This is because we use prompt to communicate from JS -> Java, but prompt blocks! - This still breaks saved pages, because they use Java to calculate MD5. Fixed in later commit Change-Id: I19edfba3f872047f274fbde75dfaf2c9f92e06bf --- M wikipedia-it/src/main/java/org/wikipedia/test/BridgeTests.java M wikipedia/src/main/java/org/wikipedia/CommunicationBridge.java M wikipedia/src/main/java/org/wikipedia/Utils.java M wikipedia/src/main/java/org/wikipedia/editing/EditHandler.java M wikipedia/src/main/java/org/wikipedia/page/LinkHandler.java M wikipedia/src/main/java/org/wikipedia/page/PageViewFragment.java M wikipedia/src/main/java/org/wikipedia/savedpages/SavePageTask.java 7 files changed, 34 insertions(+), 47 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia refs/changes/41/108541/1 diff --git a/wikipedia-it/src/main/java/org/wikipedia/test/BridgeTests.java b/wikipedia-it/src/main/java/org/wikipedia/test/BridgeTests.java index 02ff0cd..228fc1e 100644 --- a/wikipedia-it/src/main/java/org/wikipedia/test/BridgeTests.java +++ b/wikipedia-it/src/main/java/org/wikipedia/test/BridgeTests.java @@ -29,10 +29,9 @@ bridge = new CommunicationBridge(webView, "file:///android_asset/tests/index.html"); bridge.addListener("DOMLoaded", new CommunicationBridge.JSEventListener() { @Override -public JSONObject onMessage(String messageType, JSONObject messagePayload) { +public void onMessage(String messageType, JSONObject messagePayload) { assertEquals(messageType, "DOMLoaded"); completionLatch.countDown(); -return null; } }); } @@ -57,11 +56,10 @@ bridge.sendMessage("ping", payload); bridge.addListener("pong", new CommunicationBridge.JSEventListener() { @Override -public JSONObject onMessage(String messageType, JSONObject messagePayload) { +public void onMessage(String messageType, JSONObject messagePayload) { assertEquals(messageType, "pong"); assertEquals(messagePayload.toString(), payload.toString()); completionLatch.countDown(); -return null; } }); bridge.sendMessage("injectScript", payload); diff --git a/wikipedia/src/main/java/org/wikipedia/CommunicationBridge.java b/wikipedia/src/main/java/org/wikipedia/CommunicationBridge.java index 84e0581..ba468cf 100644 --- a/wikipedia/src/main/java/org/wikipedia/CommunicationBridge.java +++ b/wikipedia/src/main/java/org/wikipedia/CommunicationBridge.java @@ -1,5 +1,8 @@ package org.wikipedia; +import android.os.Handler; +import android.os.Looper; +import android.os.Message; import android.util.Log; import android.webkit.*; import org.json.JSONArray; @@ -23,7 +26,7 @@ private final ArrayList pendingJSMessages = new ArrayList(); public interface JSEventListener { -public JSONObject onMessage(String messageType, JSONObject messagePayload); +public void onMessage(String messageType, JSONObject messagePayload); } public CommunicationBridge(final WebView webView, final String baseURL) { @@ -40,12 +43,11 @@ eventListeners = new HashMap>(); this.addListener("DOMLoaded", new JSEventListener() { @Override -public JSONObject onMessage(String messageType, JSONObject messagePayload) { +public void onMessage(String messageType, JSONObject messagePayload) { isDOMReady = true; for(String jsString : pendingJSMessages) { CommunicationBridge.this.webView.loadUrl(jsString); } -return null; } }); } @@ -79,34 +81,31 @@ } } +private static final int MESSAGE_HANDLE_MESSAGE_FROM_JS = 1; +private Handler incomingMessageHandler = new Handler(Looper.getMainLooper(), new Handler.Callback() { +@Override +public boolean handleMessage(Message msg) { +JSONObject messagePack = (JSONObject) msg.obj; +String type = messagePack.optString("type"); +if (!eventListeners.containsKey(type)) { +throw new RuntimeException("No such message type registered: " + type); +} +ArrayList listeners = eventListeners.get(type); +for (JSEventListener listener : listeners) { +
[MediaWiki-commits] [Gerrit] Remove unnecessary debug logging - change (mediawiki...TranslationNotifications)
Amire80 has uploaded a new change for review. https://gerrit.wikimedia.org/r/108540 Change subject: Remove unnecessary debug logging .. Remove unnecessary debug logging This was useful while developing, but not any more. Change-Id: Id144cc44b9e517bae56fd30db63d96b522d2cb1e --- M TranslationNotificationJob.php 1 file changed, 0 insertions(+), 8 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TranslationNotifications refs/changes/40/108540/1 diff --git a/TranslationNotificationJob.php b/TranslationNotificationJob.php index b2d42e7..82352f9 100644 --- a/TranslationNotificationJob.php +++ b/TranslationNotificationJob.php @@ -87,8 +87,6 @@ // API: Get login token - wfDebug( "publishInOtherWiki API: Get login token\n" ); - $loginUrl = wfAppendQuery( $otherWikiBaseUrl, array( 'action' => 'login', 'format' => 'json', @@ -121,8 +119,6 @@ // API: Do the login - wfDebug( "publishInOtherWiki API: Do the login\n" ); - $loginRequest = MWHttpRequest::factory( $loginUrl, array( @@ -146,8 +142,6 @@ } // API: Get an edit token - - wfDebug( "publishInOtherWiki API: Get an edit token\n" ); $userTalkPage = $this->title->getFullText(); $editTokenUrl = wfAppendQuery( $otherWikiBaseUrl, array( @@ -180,8 +174,6 @@ } // API: Edit the talk page - - wfDebug( "publishInOtherWiki API: Edit the talk page\n" ); $editUrl = wfAppendQuery( $otherWikiBaseUrl, array( 'action' => 'edit', -- To view, visit https://gerrit.wikimedia.org/r/108540 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id144cc44b9e517bae56fd30db63d96b522d2cb1e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/TranslationNotifications Gerrit-Branch: master Gerrit-Owner: Amire80 ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] udp2log: puppet 3 compatibility fix: fully qualify variable - change (operations/puppet)
Ottomata has submitted this change and it was merged. Change subject: udp2log: puppet 3 compatibility fix: fully qualify variable .. udp2log: puppet 3 compatibility fix: fully qualify variable Change-Id: I33b0d76d8b599a1e80fd7ac8ec2bcd19e8aa42cf --- M manifests/role/logging.pp M templates/udp2log/filters.oxygen.erb 2 files changed, 4 insertions(+), 4 deletions(-) Approvals: Ottomata: Verified; Looks good to me, approved diff --git a/manifests/role/logging.pp b/manifests/role/logging.pp index 52873f7..6b01655 100644 --- a/manifests/role/logging.pp +++ b/manifests/role/logging.pp @@ -284,6 +284,7 @@ multicast => true, packet_loss_log => '/var/log/udp2log/packet-loss.log', log_directory => $webrequest_log_directory, +template_variables => { 'webrequest_filter_directory' => $webrequest_filter_directory }, } } @@ -298,7 +299,6 @@ monitor_packet_loss => false, } } - # == Class role::logging::udp2log::erbium # Erbium udp2log instance: # - Fundraising: This requires write permissions on the netapp mount. diff --git a/templates/udp2log/filters.oxygen.erb b/templates/udp2log/filters.oxygen.erb index 66f5327..69f0eda 100644 --- a/templates/udp2log/filters.oxygen.erb +++ b/templates/udp2log/filters.oxygen.erb @@ -24,17 +24,17 @@ pipe 100 /bin/grep -P '<%= mobile_hosts_regex %>' >> <%= log_directory %>/mobile-sampled-100.tsv.log ### All 5xx error responses -- domas (now using udp-filter instead of 5xx-filter). -# pipe 1 <%= webrequest_filter_directory %>/5xx-filter | awk -W interactive '$9 !~ "upload.wikimedia.org|query.php"' >> <%= log_directory %>/5xx.tsv.log +# pipe 1 <%= @template_variables['webrequest_filter_directory'] %>/5xx-filter | awk -W interactive '$9 !~ "upload.wikimedia.org|query.php"' >> <%= log_directory %>/5xx.tsv.log pipe 1 /usr/bin/udp-filter -F '\t' -r -s '^5' | awk -W interactive '$9 !~ "upload.wikimedia.org|query.php"' >> <%= log_directory %>/5xx.tsv.log ### Vrije Universiteit # Contact: <%= scope.lookupvar('contacts::udp2log::vrije_universiteit_contact') %> -pipe 10 awk -f <%= webrequest_filter_directory %>/vu.awk | log2udp -h 130.37.198.252 -p +pipe 10 awk -f <%= @template_variables['webrequest_filter_directory'] %>/vu.awk | log2udp -h 130.37.198.252 -p ### University of Minnesota # Contact: <%= scope.lookupvar('contacts::udp2log::university_minnesota_contact') %> # Former Contact: <%= scope.lookupvar('contacts::udp2log::university_minnesota_contact_former') %> # Former contact: <%= scope.lookupvar('contacts::udp2log::university_minnesota_contact_former2') %> -pipe 10 awk -f <%= webrequest_filter_directory %>/minnesota.awk | log2udp -h bento.cs.umn.edu -p +pipe 10 awk -f <%= @template_variables['webrequest_filter_directory'] %>/minnesota.awk | log2udp -h bento.cs.umn.edu -p -- To view, visit https://gerrit.wikimedia.org/r/107828 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I33b0d76d8b599a1e80fd7ac8ec2bcd19e8aa42cf Gerrit-PatchSet: 13 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Matanya Gerrit-Reviewer: Alexandros Kosiaris Gerrit-Reviewer: Faidon Liambotis Gerrit-Reviewer: Ottomata Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Use DISPLAYTITLE when rendering pages - change (mediawiki...MobileFrontend)
Theopolisme has uploaded a new change for review. https://gerrit.wikimedia.org/r/108539 Change subject: Use DISPLAYTITLE when rendering pages .. Use DISPLAYTITLE when rendering pages Bug: 60251 Change-Id: I21d7a66fa8b632555fa745ddb1c1ab975cfeb8ed --- M includes/api/ApiMobileView.php M javascripts/common/Page.js M javascripts/common/PageApi.js M javascripts/common/application.js M templates/page.html 5 files changed, 25 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/39/108539/1 diff --git a/includes/api/ApiMobileView.php b/includes/api/ApiMobileView.php index caaff54..ec44f10 100644 --- a/includes/api/ApiMobileView.php +++ b/includes/api/ApiMobileView.php @@ -86,6 +86,11 @@ array( 'hasvariants' => $data['hasvariants'] ) ); } + if ( isset( $prop['displaytitle'] ) ) { + $this->getResult()->addValue( null, $this->getModuleName(), + array( 'displaytitle' => $data['displaytitle'] ) + ); + } if ( $this->usePageImages ) { $this->addPageImage( $data, $prop, $params['thumbsize'] ); } @@ -420,6 +425,12 @@ $data['hasvariants'] = true; } + if ( $parserOutput ) { + $data['displaytitle'] = $parserOutput->getDisplayTitle(); + } else { + $data['displaytitle'] = $title->getPrefixedText(); + } + // Don't store small pages to decrease cache size requirements if ( strlen( $html ) >= $wgMFMinCachedPageSize ) { // store for the same time as original parser output @@ -529,6 +540,7 @@ 'protection', 'languagecount', 'hasvariants', + 'displaytitle', ) ), 'sectionprop' => array( @@ -594,6 +606,7 @@ ' protection - information about protection level', ' languagecount - number of languages that the page is available in', ' hasvariants - whether or not the page is available in other language variants', + ' displaytitle- the rendered title of the page, with {{DISPLAYTITLE}} and such applied' ), 'sectionprop' => 'What information about sections to get', 'variant' => "Convert content into this language variant", diff --git a/javascripts/common/Page.js b/javascripts/common/Page.js index 3e6c594..5e941e5 100644 --- a/javascripts/common/Page.js +++ b/javascripts/common/Page.js @@ -41,6 +41,7 @@ defaults: { // For titles from other namespaces use a prefix e.g. Talk:Foo title: '', + displayTitle: '', lead: '', inBetaOrAlpha: M.isBetaGroupMember(), isMainPage: false, @@ -148,6 +149,11 @@ } ); }, + postRender: function( options ) { + // Set the display title + this.displayTitle = options.displayTitle; + }, + /** * @name Page.prototype.getReferenceSection * @function diff --git a/javascripts/common/PageApi.js b/javascripts/common/PageApi.js index b8f5547..24902e1 100644 --- a/javascripts/common/PageApi.js +++ b/javascripts/common/PageApi.js @@ -77,7 +77,7 @@ page: title, variant: mw.config.get( 'wgPreferredVariant' ), redirect: 'yes', - prop: 'id|sections|text|lastmodified|lastmodifiedby|languagecount|hasvariants', + prop: 'id|sections|text|lastmodified|lastmodifiedby|languagecount|hasvariants|displaytitle', noheadings: 'yes', noimages: mw.config.get( 'wgImagesDisabled', false ) ? 1 : undefined, sectionprop: 'level|line|anchor', @@ -105,7 +105,8 @@ historyUrl: mw.util.getUrl( title, { action: 'history' } ), lastModifiedTimestamp: timestamp, l
[MediaWiki-commits] [Gerrit] Adding owner and group parameters to git::clone - change (mediawiki/vagrant)
Ottomata has uploaded a new change for review. https://gerrit.wikimedia.org/r/108538 Change subject: Adding owner and group parameters to git::clone .. Adding owner and group parameters to git::clone Change-Id: I67c5f8e924c615e7d0308e08c003b3e42bccd4c9 --- M puppet/modules/git/manifests/clone.pp 1 file changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant refs/changes/38/108538/1 diff --git a/puppet/modules/git/manifests/clone.pp b/puppet/modules/git/manifests/clone.pp index e1d5036..8f3e97f 100644 --- a/puppet/modules/git/manifests/clone.pp +++ b/puppet/modules/git/manifests/clone.pp @@ -27,6 +27,8 @@ $directory, $branch = 'master', $remote = undef, +$owner = 'vagrant', +$group = 'vagrant', ) { include git @@ -39,7 +41,8 @@ command => "git clone --recursive --branch ${branch} ${url} ${directory}", creates => "${directory}/.git", require => Package['git'], -user=> 'vagrant', +user=> $owner, +group => $group, environment => 'HOME=/home/vagrant', timeout => 0, } -- To view, visit https://gerrit.wikimedia.org/r/108538 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I67c5f8e924c615e7d0308e08c003b3e42bccd4c9 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/vagrant Gerrit-Branch: master Gerrit-Owner: Ottomata ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix protocol-relative URL for enrolling students - change (mediawiki...EducationProgram)
AndyRussG has uploaded a new change for review. https://gerrit.wikimedia.org/r/108290 Change subject: Fix protocol-relative URL for enrolling students .. Fix protocol-relative URL for enrolling students Change-Id: I3f53a511a6c7639f6275e6ec278fe3112fa4afe5 --- M includes/actions/ViewCourseAction.php 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/EducationProgram refs/changes/90/108290/1 diff --git a/includes/actions/ViewCourseAction.php b/includes/actions/ViewCourseAction.php index 84ad239..1c5e5ab 100644 --- a/includes/actions/ViewCourseAction.php +++ b/includes/actions/ViewCourseAction.php @@ -422,7 +422,8 @@ // URL for enroll link (not a live link, but rather text for pasting) $enrollLink = SpecialPage::getTitleFor( 'Enroll', $course->getField( 'title' ) . '/' . - $course->getField( 'token' ) )->getFullUrl(); + $course->getField( 'token' ) ) + ->getFullUrl( '', false, PROTO_CANONICAL ); $html .= Html::element( 'p', -- To view, visit https://gerrit.wikimedia.org/r/108290 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3f53a511a6c7639f6275e6ec278fe3112fa4afe5 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/EducationProgram Gerrit-Branch: master Gerrit-Owner: AndyRussG Gerrit-Reviewer: Ragesoss Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Updating git::clone so that gerrit urls can be assumed by de... - change (operations/puppet)
Ottomata has uploaded a new change for review. https://gerrit.wikimedia.org/r/108537 Change subject: Updating git::clone so that gerrit urls can be assumed by default .. Updating git::clone so that gerrit urls can be assumed by default e.g. git::clone { 'analytics/wikimetrics': directory => '/srv/wikimetrics' } This will clone analytics/wikimetrics from gerrit. This is also for compatibility with the mediawiki-vagrant git::clone define, so that submodules shared between mediawiki-vagrant and operations/puppet and that use git::clone will work in both. Change-Id: Id76ff8bd9896d188d0a2c65d19e9d456be01d22f --- M modules/git/manifests/clone.pp 1 file changed, 19 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/37/108537/1 diff --git a/modules/git/manifests/clone.pp b/modules/git/manifests/clone.pp index c6be77a..654fc2b 100644 --- a/modules/git/manifests/clone.pp +++ b/modules/git/manifests/clone.pp @@ -5,10 +5,12 @@ # === Required parameters # # $+directory+:: path to clone the repository into. -# $+origin+:: Origin repository URL. # # === Optional parameters # +# $+origin+:: If this is not specified, the the $title repository will be +# checked out from gerrit using a default gerrit url. +# If you set this, please specify the full repository url. # $+branch+:: Branch you would like to check out. # $+ensure+:: _absent_, _present_, or _latest_. Defaults to _present_. # - _present_ (default) will just clone once. @@ -23,7 +25,7 @@ # # === Example usage # -# git::clone{ 'my_clone_name': +# git::clone { 'my_clone_name': # directory => '/path/to/clone/container', # origin=> 'http://blabla.org/core.git', # branch=> 'the_best_branch' @@ -31,9 +33,15 @@ # # Will clone +http://blabla.org/core.git+ branch +the_best_branch+ at # +/path/to/clone/container/core+ +# +# # Example: check out from gerrit: +# git::clone { 'analytics/wikimetrics': +# directory = '/srv/wikimetrics', +# } +# define git::clone( $directory, -$origin, +$origin=undef, $branch='', $ssh='', $ensure='present', @@ -42,6 +50,13 @@ $timeout='300', $depth='full', $mode=0755) { + +$gerrit_url_format = 'https://gerrit.wikimedia.org/r/p/%s.git' + +$remote = $origin ? { +undef => sprintf($gerrit_url_format, $title), +default => $origin, +} case $ensure { 'absent': { @@ -76,7 +91,7 @@ Exec { path => '/usr/bin:/bin' } # clone the repository exec { "git_clone_${title}": -command => "git clone ${brancharg}${origin}${deptharg} $directory", +command => "git clone ${brancharg}${remote}${deptharg} $directory", logoutput => on_failure, cwd => '/tmp', environment => $env, -- To view, visit https://gerrit.wikimedia.org/r/108537 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id76ff8bd9896d188d0a2c65d19e9d456be01d22f Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Ottomata ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Start using LESS instead of CSS directly - change (apps...wikipedia)
Yuvipanda has uploaded a new change for review. https://gerrit.wikimedia.org/r/108536 Change subject: Start using LESS instead of CSS directly .. Start using LESS instead of CSS directly - No LESS features being used... yet! - grunt by default now does LESS compilation too Change-Id: I4fb8ba8e4cba90f0f8e04c883c19b127deac23c1 --- M .gitignore M wikipedia/assets/index.html A wikipedia/assets/styles.css M www/Gruntfile.js M www/index.html R www/less/pagestyles.less R www/less/ui.less M www/package.json 8 files changed, 134 insertions(+), 7 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia refs/changes/36/108536/1 diff --git a/.gitignore b/.gitignore index 488209c..d758f28 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,4 @@ # Node modules for the js www/node_modules www/bundle*.js +www/styles.css diff --git a/wikipedia/assets/index.html b/wikipedia/assets/index.html index 5f07156..d3d5ff3 100644 --- a/wikipedia/assets/index.html +++ b/wikipedia/assets/index.html @@ -4,8 +4,7 @@ https://wikipedia.org"; /> - - + diff --git a/wikipedia/assets/styles.css b/wikipedia/assets/styles.css new file mode 100644 index 000..d073bf7 --- /dev/null +++ b/wikipedia/assets/styles.css @@ -0,0 +1,119 @@ +/* Should be moved out to the MobileApp extension at some point */ +body { + background-color: #F2F2F2; + color: #333; + font-family: sans-serif; + font-size: 16px; + line-height: 24px; + margin: 0; + padding: 0; + margin-top: 48px; +} +#content { + padding: 8px 24px; +} +a { + color: #347BFF; + text-decoration: none; +} +/* Headers */ +h1 { + font-family: serif; + color: #064AAD; + font-size: 26px; + line-height: 36px; + margin-bottom: 24px; + font-weight: bold; +} +h2, +h3, +h4, +h5, +h6 { + font-family: sans-serif; +} +h2 { + font-size: 22px; +} +h3 { + font-size: 20px; +} +h4 { + font-size: 18px; +} +h5, +h6 { + font-size: 16px; +} +/* Basic Thumbnails */ +.thumb { + /* Don't stick thumbnails to the text above and below it */ + margin: 8px 0px; + /* Align everything inside a thumbnail to be centered */ + text-align: center; +} +.thumb .thumbinner { + /* Make sure that thumb takes up full width */ + width: 100% !important; +} +.thumb .magnify { + display: none; + /* Our parser is STUPID */ +} +.thumb .noresize { + overflow-x: auto; + /* Scrollbars for images that shouldn't be squished */ +} +/* Makes sure that we don't have horizontal scrollbars for the entire page because + an image is too wide to fit in to the current viewport */ +img { + max-width: 100% !important; + height: auto !important; +} +/* Basic tables */ +table { + width: 100% !important; + overflow-x: auto; + display: block; + border: 1px solid #ccc; + margin-top: 4px; + margin-bottom: 4px; +} +/* Last updated info */ +#attribution { + border-top: 1px solid #ccc; + padding: 8px; + text-align: center; + color: #888; + font-size: 80%; +} + +a.edit_section_button { + height: 32px; + width: 32px; + background-image: url("images/edit.png"); + background-size: 32px 32px; + float: right; + display: inline-float; +} +/* Loading animation in pure CSS + Thanks to http://dabblet.com/gist/7708654 */ +.loading { + border: 4px solid rgba(0, 0, 0, 0.1); + border-top: 4px solid rgba(0, 0, 0, 0.4); + border-radius: 100%; + animation: rot .6s infinite linear; +} +@keyframes rot { + from { +transform: rotate(0deg); + } + to { +transform: rotate(359deg); + } +} +#loading_sections { + margin: 8px auto; + height: 24px; + width: 24px; +} diff --git a/www/Gruntfile.js b/www/Gruntfile.js index 388f757..b359975 100644 --- a/www/Gruntfile.js +++ b/www/Gruntfile.js @@ -25,6 +25,13 @@ } } }, +less: { +all: { +files: [ +{ src: ["less/*.less"], dest: "styles.css"} +] +} +}, jshint: { allFiles: allScriptFiles, options: { @@ -35,7 +42,7 @@ main: { files: [ // App files -{src: ["bundle.js", "index.html", "pagestyles.css", "ui.css"], dest: "../wikipedia/assets/"}, +{src: ["bundle.js", "index.html", "styles.css"], dest: "../wikipedia/assets/"}, // Test files {src: ["bundle-test.js", "tests/index.html"], dest: "../wikipedia/assets/"}, @@ -57,6 +64,7 @@ grunt.loadNpmTasks( 'grunt-contrib-jshint' ); grunt.loadNpmTasks( 'grunt-contrib-copy' ); grunt.loadNpmTasks( 'grunt-contrib-watch' ); +grunt.loadNpmTasks( 'grunt-contrib-less' ); -grunt.registerTask( 'default', [ 'browserify', 'copy' ] ); +grunt.registerTask( 'default', [ 'browserify', 'less', 'copy' ] ); }; \ No newline at end of file diff --git a/www/index.html b/www/index.html index 5f0
[MediaWiki-commits] [Gerrit] For IE, do not use salt for tofu detection - change (mediawiki...UniversalLanguageSelector)
jenkins-bot has submitted this change and it was merged. Change subject: For IE, do not use salt for tofu detection .. For IE, do not use salt for tofu detection Adding salt won't work for IE since it uses a tofu with small width for unassigned code points. From tests, algorithm without salt should be enough for IE. Change-Id: If39e6c49d272fa67f60c19f1af64f1fb71856bcd --- M resources/js/ext.uls.webfonts.js 1 file changed, 4 insertions(+), 1 deletion(-) Approvals: Amire80: Looks good to me, approved jenkins-bot: Verified diff --git a/resources/js/ext.uls.webfonts.js b/resources/js/ext.uls.webfonts.js index 30a41ec..d2a14f4 100644 --- a/resources/js/ext.uls.webfonts.js +++ b/resources/js/ext.uls.webfonts.js @@ -73,7 +73,10 @@ length = Math.min( 4, text.length ), detected = false; - text = tofuSalt + text; + if ( $.client.test( { msie: false } ) ) { + // IE shows a different tofu for unassigned code points! + text = tofuSalt + text; + } $fixture = $( '' ) .css( { fontSize: '72px', -- To view, visit https://gerrit.wikimedia.org/r/108534 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: If39e6c49d272fa67f60c19f1af64f1fb71856bcd Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/UniversalLanguageSelector Gerrit-Branch: master Gerrit-Owner: Santhosh Gerrit-Reviewer: Amire80 Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Move flow( 'setupEditForm' ) to base/action.js - change (mediawiki...Flow)
Matthias Mullie has uploaded a new change for review. https://gerrit.wikimedia.org/r/108535 Change subject: Move flow( 'setupEditForm' ) to base/action.js .. Move flow( 'setupEditForm' ) to base/action.js * Renamed all this.(post|topic|header) vars to this.object (more generic, for easier inheritance) * Moved chaining-based flow( 'setupEditForm' ) to base/action.js, where code has been split up in different functions, allowing for inheritance & easier overriding * Instead of usins lots of jQuery functionality to build HTML, it's now a string of HTML (similar to PHP templating) * There was some duplicate code in setupEditForm; now removed * Made setupPreview & hidePreview return this, to allow chaining * Showing/hiding of form/content is now done in CSS, based on new .flow-edit-form-active class on container * Renamed html node classes to more generic name (not including type) * Instead of passing initialContent literals everywhere, generalized that into 1 function That's probably about it Change-Id: I1adfcd9bc6e1c48e07cf223b7ce63e03fc4668bc --- M modules/base/action.js M modules/base/ui-functions.js M modules/discussion/post.js M modules/discussion/styles/nojs.less M modules/discussion/styles/post.less M modules/discussion/styles/topic.less M modules/discussion/topic.js M modules/header/forms.js M modules/header/styles/base.less M templates/edit-post.html.php M templates/post.html.php M templates/topic.html.php M templates/topiclist.html.php 13 files changed, 293 insertions(+), 234 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow refs/changes/35/108535/1 diff --git a/modules/base/action.js b/modules/base/action.js index 8c29ed8..e1cd551 100644 --- a/modules/base/action.js +++ b/modules/base/action.js @@ -7,13 +7,152 @@ mw.flow.action = function () {}; /** +* Returns the initial content, to be served to setupEditForm/loadReplyForm. +* +* @param {object} [data] this.prepareResult return value (or null) +* @return {object} +*/ + mw.flow.action.prototype.initialContent = function ( data ) { + // let's make sure data exists, before trying to look up values + data = data || {}; + + return { + content: data.content || '', + format: data.format || 'wikitext' + }; + }; + + /** +* HTML of the edit form (well, jQuery node with the html of the edit form) +* +* @returns {jQuery} +*/ + mw.flow.action.prototype.editForm = function () { + return $( + '' + + '' + + '' + + '' + + mw.msg( 'flow-cancel' ) + + '' + + '' + + '' + + '' + ); + }; + + /** +* Builds the edit form, using flow( setupEditForm ). +* +* @param {object} data this.prepareResult return value +* @param {function} [loadFunction] callback to be executed when form is loaded +*/ + mw.flow.action.prototype.setupEditForm = function ( data, loadFunction ) { + if ( this.object.$container.hasClass( 'flow-edit-form-active' ) ) { + return; + } + + // build form DOM & attach to content + var $postForm = this.editForm(); + $postForm.appendTo( this.object.$container ); + + // add class to identify this form as being active + this.object.$container.addClass( 'flow-edit-form-active' ); + + // bind click on cancel, which should destroy this form + $postForm.find( '.flow-cancel-link' ).click( function ( event ) { + event.preventDefault(); + $postForm.slideUp( 'fast', this.destroyEditForm.bind( this ) ); + }.bind( this ) ); + + // setup preview + $postForm.flow( 'setupPreview' ); + + // setup submission callback + $postForm.flow( 'setupFormHandler', + '.flow-edit-submit', + this.submitFunction.bind( this, data ), + this.loadParametersCallback.bind( this ), + this.validateCallback.bind( this ), + this.promiseCallback.bind( this ) + ); + + // setup disabler (disables submit button until content is entered) + $postForm.flow( 'setupEmptyDisabler', + ['.flow-edit-content'], + '.flow-edit-submit' + ); +
[MediaWiki-commits] [Gerrit] For IE, do not use salt for tofu detection - change (mediawiki...UniversalLanguageSelector)
Santhosh has uploaded a new change for review. https://gerrit.wikimedia.org/r/108534 Change subject: For IE, do not use salt for tofu detection .. For IE, do not use salt for tofu detection Adding salt wont work for IE since it uses a tofu with small width for unassigned code points. From tests, Algortithm without salt should be enough for IE. Change-Id: If39e6c49d272fa67f60c19f1af64f1fb71856bcd --- M resources/js/ext.uls.webfonts.js 1 file changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UniversalLanguageSelector refs/changes/34/108534/1 diff --git a/resources/js/ext.uls.webfonts.js b/resources/js/ext.uls.webfonts.js index 30a41ec..d2a14f4 100644 --- a/resources/js/ext.uls.webfonts.js +++ b/resources/js/ext.uls.webfonts.js @@ -73,7 +73,10 @@ length = Math.min( 4, text.length ), detected = false; - text = tofuSalt + text; + if ( $.client.test( { msie: false } ) ) { + // IE shows a different tofu for unassigned code points! + text = tofuSalt + text; + } $fixture = $( '' ) .css( { fontSize: '72px', -- To view, visit https://gerrit.wikimedia.org/r/108534 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If39e6c49d272fa67f60c19f1af64f1fb71856bcd Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/UniversalLanguageSelector Gerrit-Branch: master Gerrit-Owner: Santhosh ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] logstash: Updates for udp2log filtering - change (operations/puppet)
BryanDavis has uploaded a new change for review. https://gerrit.wikimedia.org/r/108533 Change subject: logstash: Updates for udp2log filtering .. logstash: Updates for udp2log filtering * Add Bug58676 * Add CirrusSearch-failed * Add CirrusSearch-slow * Remove CirrusSearch * Clean up apache2 logs ** Strip leading whitespace from message ** Discard "last message repeated" lines ** Extract message severity from message * Fix scholarships parsing ** Tag for indexing by elasticsearch ** Parse the timestamp provided in the json data Change-Id: I6d3b6305aeea3a5590595ea44dadac8bb5357fb6 --- M files/logstash/filter-mw-via-udp2log.conf 1 file changed, 29 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/33/108533/1 diff --git a/files/logstash/filter-mw-via-udp2log.conf b/files/logstash/filter-mw-via-udp2log.conf index c351ce2..6e94268 100644 --- a/files/logstash/filter-mw-via-udp2log.conf +++ b/files/logstash/filter-mw-via-udp2log.conf @@ -46,9 +46,11 @@ "badpass", "bug46577", "Bug54847", + "Bug58676", "captcha", "centralauth", - "CirrusSearch", + "CirrusSearch-failed", + "CirrusSearch-slow", "dbperformance", "dnsblacklist", "exception", @@ -113,19 +115,37 @@ grok { match => [ "message", - "^(?%{MONTH} %{MONTHDAY} %{TIME}) %{NOTSPACE:host}: %{GREEDYDATA:message}$" + "^(?%{MONTH} %{MONTHDAY} %{TIME}) %{NOTSPACE:host}:%{SPACE}%{GREEDYDATA:message}$" ] overwrite => [ "host", "message" ] named_captures_only => true add_tag => [ "es" ] } - + # Discard last message repeated messages + grep { +match => [ + "message", + "last message repeated \d+ times$" +] +negate => true + } if !("_grokparsefailure" in [tags]) { # Use the parsed timestamp as canonical for the event date { match => [ "logdate", "MMM dd HH:mm:ss" ] remove_field => [ "logdate" ] add_tag => [ "logdate" ] +} +# Capture message severity +grok { + match => [ +"message", +"^\[%{WORD:level}\] \[%{WORD} %{IP:clientip}\] " + ] + match => [ +"message", +"^PHP %{WORD:level}: " + ] } } } # end [type] == "apache2" @@ -239,7 +259,12 @@ # Parse message as json and put elements in event json { source => "message" -add_tag => [ "json" ] +add_tag => [ "json", "es" ] + } + # Use the parsed timestamp as canonical for the event + date { +match => [ "@timestamp", "-MM-dd'T'HH:mm:ss.SSZZ" ] +add_tag => [ "logdate" ] } } # end [type] == "scholarships" -- To view, visit https://gerrit.wikimedia.org/r/108533 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6d3b6305aeea3a5590595ea44dadac8bb5357fb6 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: BryanDavis ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Make all tests pass - change (mediawiki...ContentTranslation)
jenkins-bot has submitted this change and it was merged. Change subject: Make all tests pass .. Make all tests pass Change-Id: I49ea430c5d7cd7694d7937ffe7298c8fcd2462f4 --- M modules/translation/ext.cx.translation.js M tests/browser/features/special_content_translation.feature M tests/browser/features/step_definitions/special_content_translation_steps.rb A tests/browser/features/support/pages/anon_error_page.rb M tests/browser/features/support/pages/content_translation_page.rb M tests/browser/features/support/pages/translated_page.rb A tests/browser/features/support/pages/translated_page_history.rb 7 files changed, 50 insertions(+), 13 deletions(-) Approvals: Divec: Looks good to me, approved Amire80: Looks good to me, but someone else must approve jenkins-bot: Verified diff --git a/modules/translation/ext.cx.translation.js b/modules/translation/ext.cx.translation.js index 39c8551..39dfecf 100644 --- a/modules/translation/ext.cx.translation.js +++ b/modules/translation/ext.cx.translation.js @@ -67,7 +67,8 @@ $content = $( '' ) .attr( 'contenteditable', true ) - .addClass( 'cx-column__content' ); + .addClass( 'cx-column__content' ) + .html( '\n' ); // Make sure that it's visible to the tests this.$container.append( $content ); mw.hook( 'mw.cx.changeTranslation' ).fire(); diff --git a/tests/browser/features/special_content_translation.feature b/tests/browser/features/special_content_translation.feature index 7df2d21..a4d7537 100644 --- a/tests/browser/features/special_content_translation.feature +++ b/tests/browser/features/special_content_translation.feature @@ -58,6 +58,14 @@ And I am on the content translation page in a wiki in English, translating the page "Bratislava" to Danish When I write "Bratislava er hovedstad og største by i Slovakiet." in the editing area in the translation column And I press the "Publish Translation" button +Then I see a notification bubble that begins with the words "Page published at" + + Scenario: Writing some translation text and saving it +Given I am logged in + And I am on the content translation page in a wiki in English, translating the page "Bratislava" to Danish +When I write "Bratislava er hovedstad og største by i Slovakiet." in the editing area in the translation column + And I press the "Publish Translation" button + And I click the link in the notification bubble Then the page "User:TranslatorToDa/Bratislava" is displayed And the content of the page is "Bratislava er hovedstad og største by i Slovakiet." And the first version in the history of the page "User:TranslatorToDa/Bratislava" should have the tag "ContentTranslation" diff --git a/tests/browser/features/step_definitions/special_content_translation_steps.rb b/tests/browser/features/step_definitions/special_content_translation_steps.rb index 4913f81..30013a9 100644 --- a/tests/browser/features/step_definitions/special_content_translation_steps.rb +++ b/tests/browser/features/step_definitions/special_content_translation_steps.rb @@ -7,6 +7,10 @@ visit(ContentTranslationPage, :using_params => {:extra => "page=#{page_name}&lang=#{language_code[target_language]}"}) end +When(/^I click the link in the notification bubble$/) do + on(ContentTranslationPage).notification_link_element.click +end + When(/^I empty the editing area in the translation column$/) do on(ContentTranslationPage).empty_translation_editor end @@ -16,20 +20,20 @@ end When(/^I write "(.*?)" in the editing area in the translation column$/) do |translation| - on(ContentTranslationPage).translation_editor.send_keys(translation) + on(ContentTranslationPage).translation_editor_element.send_keys(translation) end Then(/^I don't see a "Publish Translation" button$/) do - on(ContentTranslationPage).publish_translation_element.should_not be_visible + on(ContentTranslationPage).publish_translation_element.should_not exist end Then(/^I don't see the (.+?) column$/) do |column_type| - on(ContentTranslationPage).column(column_type).should_not be_visible + on(ContentTranslationPage).column(column_type).should_not exist end Then(/^I see a "(.*?)" link that points to the page "(.*?)" on the same wiki$/) do |link_name, page_title| page_title_in_url = page_title.gsub(" ", "_") - on(ContentTranslationPage).view_page.attribute_value("href").should match(/#{page_title_in_url}$/) + on(ContentTranslationPage).view_page.attribute_value("href").should end_with(page_title_in_url) end Then(/^I see a "Publish Translation" button$/) do @@ -48,12 +52,16 @@ on(ContentTranslationPage).title("translation").text.should == text end +Then(/^I see a notification bubbl
[MediaWiki-commits] [Gerrit] Change travis IRC template - change (mediawiki...Wikibase)
Jeroen De Dauw has submitted this change and it was merged. Change subject: Change travis IRC template .. Change travis IRC template Travis takes up 3 lines after every message. I propose using only a single line in this change! Change-Id: I8ca6375d2c7cfcbec3c6fb0af26a3e002c3452f2 --- M .travis.yml 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Jeroen De Dauw: Verified; Looks good to me, approved diff --git a/.travis.yml b/.travis.yml index 2d24697..ecb1e49 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,3 +36,5 @@ - "chat.freenode.net#wikidata" on_success: change on_failure: always +template: + - "%{repository}/%{branch}/%{commit} : %{author} %{message} %{build_url}" -- To view, visit https://gerrit.wikimedia.org/r/108532 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8ca6375d2c7cfcbec3c6fb0af26a3e002c3452f2 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Addshore Gerrit-Reviewer: Jeroen De Dauw Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Detect tofu before applying any default fonts - change (mediawiki...UniversalLanguageSelector)
jenkins-bot has submitted this change and it was merged. Change subject: Detect tofu before applying any default fonts .. Detect tofu before applying any default fonts To detect whether the client can render a given string, use a tofu detection algorithm. If the user has an explicit font preference, do not override it. If the user has no preference and there is a default font for a language, see if that language can be rendered at the user's browser using tofu detection. If tofu is detected, apply the font. If the element has 'autonym' class, apply Autonym font only when that language has tofu. Change-Id: Ib9ee9497e6bcfa7eb86f7d264e0980d8880d6b70 --- M Resources.php M UniversalLanguageSelector.php M lib/jquery.webfonts.js D resources/css/ext.uls.webfonts.css M resources/js/ext.uls.webfonts.js 5 files changed, 110 insertions(+), 21 deletions(-) Approvals: Amire80: Looks good to me, approved jenkins-bot: Verified diff --git a/Resources.php b/Resources.php index 4642721..2b5b70b 100644 --- a/Resources.php +++ b/Resources.php @@ -143,10 +143,10 @@ $wgResourceModules['ext.uls.webfonts'] = array( 'scripts' => 'resources/js/ext.uls.webfonts.js', - 'styles' => 'resources/css/ext.uls.webfonts.css', 'dependencies' => array( 'jquery.webfonts', 'ext.uls.init', + 'jquery.uls.data', 'ext.uls.webfonts.repository', 'ext.uls.preferences', ), diff --git a/UniversalLanguageSelector.php b/UniversalLanguageSelector.php index b98d920..94ce4e2 100644 --- a/UniversalLanguageSelector.php +++ b/UniversalLanguageSelector.php @@ -155,7 +155,7 @@ * Autonym * @since 2013.09 */ -$GLOBALS['wgULSNoWebfontsSelectors'] = array( '.autonym' ); +$GLOBALS['wgULSNoWebfontsSelectors'] = array( '#p-lang li.interlanguage-link > a' ); /** * Base path of ULS font repository. diff --git a/lib/jquery.webfonts.js b/lib/jquery.webfonts.js index 63c34f6..e7ce234 100644 --- a/lib/jquery.webfonts.js +++ b/lib/jquery.webfonts.js @@ -58,13 +58,14 @@ /** * Get the default font family for given language. * @param {String} language Language code. +* @param {array} classes * @return {String} Font family name */ - getFont: function( language ) { + getFont: function( language, classes ) { language = ( language || this.language ).toLowerCase(); if ( this.options.fontSelector ) { - return this.options.fontSelector( this.repository, language ); + return this.options.fontSelector( this.repository, language, classes ); } else { return this.repository.defaultFont( language ); } @@ -199,7 +200,6 @@ // Note: it depends on the browser whether this returns font names // which don't exist. In Chrome it does, while in Opera it doesn't. fontFamilyStyle = $element.css( 'fontFamily' ); - // Note: It is unclear whether this can ever be falsy. Maybe also // browser specific. if ( fontFamilyStyle ) { @@ -220,7 +220,7 @@ // browser settings. return; } else { - fontFamily = webfonts.getFont( element.lang ); + fontFamily = webfonts.getFont( element.lang, element.className.split(/\s+/) ); } if ( !fontFamily ) { @@ -269,8 +269,8 @@ // whether the font is inherited from top element to which plugin applied return this.$element.css( 'fontFamily' ) !== elementFontFamily - // whether the element has generic font family - && ( $.inArray( elementFontFamily, + // whether the element has generic font family + && ( $.inArray( elementFontFamily, ['monospace', 'serif', 'cursive','fantasy', 'sans-serif'] ) < 0 ); }, diff --git a/resources/css/ext.uls.webfonts.css b/resources/css/ext.uls.webfonts.css deleted file mode 100644 index eb348f9..000 --- a/resources/css/ext.uls.webfonts.css +++ /dev/null @@ -1,4 +0,0 @@ -#p-lang li.interlanguage-link, -.autonym { /* provide autonym class for simplifying the Autonym font usage */ - font-fam