[MediaWiki-commits] [Gerrit] mediawiki...MsUpload[master]: Fix Spanish-style question marks
Sophivorus has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/404278 ) Change subject: Fix Spanish-style question marks .. Fix Spanish-style question marks Change-Id: I3f08d7e99326d9b191ee52db35d851453023f12e --- M i18n/en.json 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Sophivorus: Looks good to me, approved jenkins-bot: Verified diff --git a/i18n/en.json b/i18n/en.json index 0c2d2cc..90b3ca5 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -15,7 +15,7 @@ "msu-insert-image": "Insert as image", "msu-insert-video": "Insert video", "msu-cancel-upload": "Cancel upload", - "msu-continue": "¿Continue anyway?", + "msu-continue": "Continue anyway?", "msu-clean-all": "Clear list", "msu-ext-not-allowed": "Only the following file {{PLURAL:$1|type is|types are}} allowed:", "msu-upload-this": "Upload this file", -- To view, visit https://gerrit.wikimedia.org/r/404278 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3f08d7e99326d9b191ee52db35d851453023f12e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MsUpload Gerrit-Branch: master Gerrit-Owner: Sophivorus Gerrit-Reviewer: Siebrand Gerrit-Reviewer: Sophivorus Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MsUpload[master]: Fix Spanish-style question marks
Sophivorus has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/404278 ) Change subject: Fix Spanish-style question marks .. Fix Spanish-style question marks Change-Id: I3f08d7e99326d9b191ee52db35d851453023f12e --- M i18n/en.json 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MsUpload refs/changes/78/404278/1 diff --git a/i18n/en.json b/i18n/en.json index 0c2d2cc..90b3ca5 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -15,7 +15,7 @@ "msu-insert-image": "Insert as image", "msu-insert-video": "Insert video", "msu-cancel-upload": "Cancel upload", - "msu-continue": "¿Continue anyway?", + "msu-continue": "Continue anyway?", "msu-clean-all": "Clear list", "msu-ext-not-allowed": "Only the following file {{PLURAL:$1|type is|types are}} allowed:", "msu-upload-this": "Upload this file", -- To view, visit https://gerrit.wikimedia.org/r/404278 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3f08d7e99326d9b191ee52db35d851453023f12e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MsUpload Gerrit-Branch: master Gerrit-Owner: Sophivorus ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MsUpload[master]: Fix UX when uploading a file with same name but different ex...
Sophivorus has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/404157 ) Change subject: Fix UX when uploading a file with same name but different extension .. Fix UX when uploading a file with same name but different extension Replace "msu-confirm-replace" message for a more generic "msu-continue" message to avoid confusing the user. Change-Id: Ic6f7831aa79338285b25d7837f8207807ba52b7e --- M MsUpload.js M extension.json M i18n/bn.json M i18n/de.json M i18n/en.json M i18n/es.json M i18n/fr.json M i18n/gl.json M i18n/ja.json M i18n/ko.json M i18n/lb.json M i18n/mk.json M i18n/nl.json M i18n/pl.json M i18n/pt-br.json M i18n/pt.json M i18n/qqq.json M i18n/ru.json M i18n/sv.json M i18n/uk.json M i18n/zh-hans.json M i18n/zh-hant.json 22 files changed, 10 insertions(+), 23 deletions(-) Approvals: Sophivorus: Verified; Looks good to me, approved jenkins-bot: Verified diff --git a/MsUpload.js b/MsUpload.js index c0aca22..8da7a87 100644 --- a/MsUpload.js +++ b/MsUpload.js @@ -69,7 +69,11 @@ $( fileItem.warning ).find( 'div.thumb' ).hide(); } ); - // If a file with the same name already exists, add a checkbox to confirm the replacement + /** +* If a file with the same name already exists, add a checkbox to confirm the replacement +* This checkbox will also appear when the file name differs only in the file extension +* so the confirmation message must be kept generic enough +*/ if ( msuVars.confirmReplace ) { MsUpload.unconfirmedReplacements++; @@ -86,7 +90,7 @@ } uploader.trigger( 'CheckFiles' ); } ); - $( '' ).append( checkbox ).append( mw.msg( 'msu-replace-file' ) ).appendTo( fileItem.warning ); + $( '' ).append( checkbox ).append( mw.msg( 'msu-continue' ) ).appendTo( fileItem.warning ); } break; } diff --git a/extension.json b/extension.json index 5c9fe63..6bae05b 100644 --- a/extension.json +++ b/extension.json @@ -35,7 +35,7 @@ "msu-insert-image", "msu-insert-video", "msu-cancel-upload", - "msu-replace-file", + "msu-continue", "msu-clean-all", "msu-ext-not-allowed", "msu-upload-this", diff --git a/i18n/bn.json b/i18n/bn.json index 4a908ce..ecca2bb 100644 --- a/i18n/bn.json +++ b/i18n/bn.json @@ -13,7 +13,6 @@ "msu-insert-image": "চিত্র হিসেবে সন্নিবেশ করুন", "msu-insert-video": "ভিডিও সন্নিবেশ করুন", "msu-cancel-upload": "আপলোড বাতিল করুন", - "msu-replace-file": "ফাইল প্রতিস্থাপন করবেন?", "msu-clean-all": "তালিকা পরিষ্কার করুন", "msu-ext-not-allowed": "কেবলমাত্র নিচের ফাইলের {{PLURAL:$1|ধরন|ধরনসমূহ}} অনুমোদিত:", "msu-upload-this": "এই ফাইল ডাউনলোড করুন", diff --git a/i18n/de.json b/i18n/de.json index e85d7f4..df0fabf 100644 --- a/i18n/de.json +++ b/i18n/de.json @@ -14,7 +14,6 @@ "msu-insert-image": "als Bild einfügen", "msu-insert-video": "Video einfügen", "msu-cancel-upload": "Upload abbrechen", - "msu-replace-file": "Datei ersetzen?", "msu-clean-all": "Liste leeren", "msu-ext-not-allowed": "Es {{PLURAL:$1|ist nur folgender Dateityp|sind nur folgende Dateitypen}} erlaubt:", "msu-upload-this": "Diese Datei hochladen", diff --git a/i18n/en.json b/i18n/en.json index 4daa2d7..0c2d2cc 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -15,7 +15,7 @@ "msu-insert-image": "Insert as image", "msu-insert-video": "Insert video", "msu-cancel-upload": "Cancel upload", - "msu-replace-file": "Replace file?", + "msu-continue": "¿Continue anyway?", "msu-clean-all": "Clear list", "msu-ext-not-allowed": "Only the following file {{PLURAL:$1|type is|types are}} allowed:", "msu-upload-this": "Upload this file", diff --git a/i18n/es.json b/i18n/es.json index 76e16ad..7f9a4ed 100644 --- a/i18n/es.json +++ b/i18n/es.json @@ -14,7 +14,7 @@ "msu-insert-image": "Insertar como imagen", "msu-insert-video": "Insertar vídeo", "msu-ca
[MediaWiki-commits] [Gerrit] mediawiki...MsUpload[master]: Fix UX when uploading a file with same name but different ex...
Sophivorus has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/404157 ) Change subject: Fix UX when uploading a file with same name but different extension .. Fix UX when uploading a file with same name but different extension Replace "msu-confirm-replace" message for a more generic "msu-continue" message to avoid confusing the user. Change-Id: Ic6f7831aa79338285b25d7837f8207807ba52b7e --- M MsUpload.js M extension.json M i18n/bn.json M i18n/de.json M i18n/en.json M i18n/es.json M i18n/fr.json M i18n/gl.json M i18n/ja.json M i18n/ko.json M i18n/lb.json M i18n/mk.json M i18n/nl.json M i18n/pl.json M i18n/pt-br.json M i18n/pt.json M i18n/qqq.json M i18n/ru.json M i18n/sv.json M i18n/uk.json M i18n/zh-hans.json M i18n/zh-hant.json 22 files changed, 10 insertions(+), 23 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MsUpload refs/changes/57/404157/1 diff --git a/MsUpload.js b/MsUpload.js index c0aca22..8da7a87 100644 --- a/MsUpload.js +++ b/MsUpload.js @@ -69,7 +69,11 @@ $( fileItem.warning ).find( 'div.thumb' ).hide(); } ); - // If a file with the same name already exists, add a checkbox to confirm the replacement + /** +* If a file with the same name already exists, add a checkbox to confirm the replacement +* This checkbox will also appear when the file name differs only in the file extension +* so the confirmation message must be kept generic enough +*/ if ( msuVars.confirmReplace ) { MsUpload.unconfirmedReplacements++; @@ -86,7 +90,7 @@ } uploader.trigger( 'CheckFiles' ); } ); - $( '' ).append( checkbox ).append( mw.msg( 'msu-replace-file' ) ).appendTo( fileItem.warning ); + $( '' ).append( checkbox ).append( mw.msg( 'msu-continue' ) ).appendTo( fileItem.warning ); } break; } diff --git a/extension.json b/extension.json index 5c9fe63..6bae05b 100644 --- a/extension.json +++ b/extension.json @@ -35,7 +35,7 @@ "msu-insert-image", "msu-insert-video", "msu-cancel-upload", - "msu-replace-file", + "msu-continue", "msu-clean-all", "msu-ext-not-allowed", "msu-upload-this", diff --git a/i18n/bn.json b/i18n/bn.json index 4a908ce..ecca2bb 100644 --- a/i18n/bn.json +++ b/i18n/bn.json @@ -13,7 +13,6 @@ "msu-insert-image": "চিত্র হিসেবে সন্নিবেশ করুন", "msu-insert-video": "ভিডিও সন্নিবেশ করুন", "msu-cancel-upload": "আপলোড বাতিল করুন", - "msu-replace-file": "ফাইল প্রতিস্থাপন করবেন?", "msu-clean-all": "তালিকা পরিষ্কার করুন", "msu-ext-not-allowed": "কেবলমাত্র নিচের ফাইলের {{PLURAL:$1|ধরন|ধরনসমূহ}} অনুমোদিত:", "msu-upload-this": "এই ফাইল ডাউনলোড করুন", diff --git a/i18n/de.json b/i18n/de.json index e85d7f4..df0fabf 100644 --- a/i18n/de.json +++ b/i18n/de.json @@ -14,7 +14,6 @@ "msu-insert-image": "als Bild einfügen", "msu-insert-video": "Video einfügen", "msu-cancel-upload": "Upload abbrechen", - "msu-replace-file": "Datei ersetzen?", "msu-clean-all": "Liste leeren", "msu-ext-not-allowed": "Es {{PLURAL:$1|ist nur folgender Dateityp|sind nur folgende Dateitypen}} erlaubt:", "msu-upload-this": "Diese Datei hochladen", diff --git a/i18n/en.json b/i18n/en.json index 4daa2d7..0c2d2cc 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -15,7 +15,7 @@ "msu-insert-image": "Insert as image", "msu-insert-video": "Insert video", "msu-cancel-upload": "Cancel upload", - "msu-replace-file": "Replace file?", + "msu-continue": "¿Continue anyway?", "msu-clean-all": "Clear list", "msu-ext-not-allowed": "Only the following file {{PLURAL:$1|type is|types are}} allowed:", "msu-upload-this": "Upload this file", diff --git a/i18n/es.json b/i18n/es.json index 76e16ad..7f9a4ed 100644 --- a/i18n/es.json +++ b/i18n/es.json @@ -14,7 +14,7 @@ "msu-insert-image": "Insertar como imagen", "msu-insert-video": "Insertar vídeo", "m
[MediaWiki-commits] [Gerrit] mediawiki...WikipediaExtracts[master]: Respond to second code review by Reedy
Sophivorus has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/39 ) Change subject: Respond to second code review by Reedy .. Respond to second code review by Reedy - Remove URL parsing, per unnecessary and potential trouble-maker - Remove "title" parameter, per unnecessary - getWikipediaTitle() was no longer necessary - Fix some errors in the error handler - Rename $wikipediaTitle to $title Bug: T149766 Change-Id: I1d0d44a81d625033f0fbd418409b9a0fef162885 --- M WikipediaExtracts.php M WikipediaExtractsError.php M extension.json 3 files changed, 8 insertions(+), 33 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikipediaExtracts refs/changes/99/39/1 diff --git a/WikipediaExtracts.php b/WikipediaExtracts.php index 2427873..f66d00f 100644 --- a/WikipediaExtracts.php +++ b/WikipediaExtracts.php @@ -6,7 +6,7 @@ * @var string $userAgent User agent for querying the API */ private static $userAgent = - 'Extension:WikipediaExtracts/3.0 (https://www.mediawiki.org/wiki/Extension:WikipediaExtracts)'; + 'Extension:WikipediaExtracts/3.1 (https://www.mediawiki.org/wiki/Extension:WikipediaExtracts)'; /** * @var Parser $parser Parser object @@ -19,9 +19,9 @@ private static $params; /** -* @var string $wikipediaTitle Title of the Wikipedia article to extract +* @var string $title Title of the article to extract */ - private static $wikipediaTitle; + private static $title; /** * Main hook @@ -44,36 +44,13 @@ try { self::$parser = $parser; self::$params = self::parseParams( array_slice( func_get_args(), 2 ) ); - self::$wikipediaTitle = self::getWikipediaTitle( $input ); + self::$title = $input ? $input : self::$parser->getTitle()->getRootText(); $html = self::getExtract(); } catch ( WikipediaExtractsError $error ) { $html = $error->getHtmlMessage(); } return $html; - } - - /** -* Get the title of the Wikipedia article to extract -* -* @param string|null $input A title string or an article path from which to extract -* the title string -* @return string The title of the Wikipedia article -*/ - private static function getWikipediaTitle( $input = null ) { - if ( !$input ) { - return self::getParam( 'title', self::$parser->getTitle()->getRootText() ); - } - - if ( filter_var( $input, FILTER_VALIDATE_URL ) ) { - MediaWiki\suppressWarnings(); - // Example path "/wiki/Article_title" - $path = parse_url( $input, PHP_URL_PATH ); - MediaWiki\restoreWarnings(); - $path = explode( '/', $path ); - return urldecode( $path[2] ); - } - return $input; } /** @@ -120,7 +97,7 @@ private static function getExtract() { $data = [ 'action' => 'query', - 'titles' => self::$wikipediaTitle, + 'titles' => self::$title, 'prop' => 'extracts', 'exchars' => self::getParam( 'chars' ), 'exsentences' => self::getParam( 'sentences' ), @@ -152,7 +129,7 @@ } foreach ( $content->query->pages as $page ) { if ( property_exists( $page, 'missing' ) ) { - throw new WikipediaExtractsError( '404', self::$wikipediaTitle ); + throw new WikipediaExtractsError( '404', self::$title ); } return $page->extract; } diff --git a/WikipediaExtractsError.php b/WikipediaExtractsError.php index e321346..eb835e4 100644 --- a/WikipediaExtractsError.php +++ b/WikipediaExtractsError.php @@ -34,9 +34,7 @@ public function getHtmlMessage() { return Html::rawElement( 'span', [ - 'class' => 'error mw-ext-cite-error', - 'lang' => WikipediaExtracts::$contentLanguage->getHtmlCode(), - 'dir' => WikipediaExtracts::$contentLanguage->getDir() + 'class' => 'error' ], wfMessage( 'wikipediaextracts-' . $this->messageKey, $this->messageParam ) ); diff --git a/extension.json b/extension.json index a0cd60c..03f5ec3 100644 --- a/extension.json +++
[MediaWiki-commits] [Gerrit] mediawiki...WikipediaExtracts[master]: Respond to Reedy's code review
Sophivorus has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/394825 ) Change subject: Respond to Reedy's code review .. Respond to Reedy's code review - Add README with install, config and usage instructions - Improve parseParams method - Clean API requests in the getExtract method - Replace language guessing for config option set to target wiki - Remove span crediting Wikipedia, see docs - Remove obsolete messages Bug: T149766 Change-Id: Ie139099bbcdca924520858d4c1dde1c87d4d217e --- A README M WikipediaExtracts.php M WikipediaExtractsError.php M extension.json M i18n/ast.json M i18n/be-tarask.json M i18n/bn.json M i18n/de.json M i18n/en.json M i18n/es.json M i18n/fa.json M i18n/fr.json M i18n/gl.json M i18n/it.json M i18n/kab.json M i18n/ko.json M i18n/lb.json M i18n/lt.json M i18n/lv.json M i18n/mk.json M i18n/nb.json M i18n/nl.json M i18n/oc.json M i18n/pl.json M i18n/pt-br.json M i18n/pt.json M i18n/qqq.json M i18n/roa-tara.json M i18n/ru.json M i18n/sr-ec.json M i18n/sv.json M i18n/uk.json M i18n/vi.json M i18n/zh-hans.json 34 files changed, 80 insertions(+), 162 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikipediaExtracts refs/changes/25/394825/1 diff --git a/README b/README new file mode 100644 index 000..763fb5c --- /dev/null +++ b/README @@ -0,0 +1,35 @@ +# WikipediaExtracts + +MediaWiki extension that enables the inserting of content extracted directly from Wikipedia. + +## Installation + +Simply add the following code to the bottom of your LocalSettings.php: + +wfLoadExtension( 'WikipediaExtracts' ); + +## Configuration + +By default, WikipediaExtracts will extract content from the English Wikipedia. +To extract content from other Wikipedias, or other MediaWiki wikis altogether, +set $WikipediaExtractsAPI to the URL of the API of the target wiki. For example, +to extract content from the Spanish Wikipedia: + +$wgWikipediaExtractsAPI = "https://es.wikipedia.org/w/api.php";; + +Warning! The target wiki has to have the Extension:TextExtracts enabled! +All Wikimedia Foundation wikis have it enabled by default, but other wikis may not. + +## Usage + +Basic usage to extract a full article: + +{{#WikipediaExtract:Title of the article}} + +To extract just the introduction of the article: + +{{#WikipediaExtract:Title of the article +|intro = true +}} + +See more options at https://www.mediawiki.org/wiki/Extension:WikipediaExtracts \ No newline at end of file diff --git a/WikipediaExtracts.php b/WikipediaExtracts.php index 682dc76..2427873 100644 --- a/WikipediaExtracts.php +++ b/WikipediaExtracts.php @@ -6,17 +6,12 @@ * @var string $userAgent User agent for querying the API */ private static $userAgent = - 'Extension:WikipediaExtracts/2.1 (https://www.mediawiki.org/wiki/Extension:WikipediaExtracts)'; + 'Extension:WikipediaExtracts/3.0 (https://www.mediawiki.org/wiki/Extension:WikipediaExtracts)'; /** * @var Parser $parser Parser object */ private static $parser; - - /** -* @var Language $contentLanguage Language object of the content language of the local wiki -*/ - public static $contentLanguage; /** * @var array $params Associative array of the parameters passed to the parser function @@ -27,11 +22,6 @@ * @var string $wikipediaTitle Title of the Wikipedia article to extract */ private static $wikipediaTitle; - - /** -* @var string $wikipediaLanguage Language code of the Wikipedia to query -*/ - private static $wikipediaLanguage; /** * Main hook @@ -53,17 +43,10 @@ public static function onFunctionHook( Parser $parser, $input = null ) { try { self::$parser = $parser; - self::$contentLanguage = $parser->getTargetLanguage(); self::$params = self::parseParams( array_slice( func_get_args(), 2 ) ); self::$wikipediaTitle = self::getWikipediaTitle( $input ); - self::$wikipediaLanguage = self::getWikipediaLanguage( $input ); $html = self::getExtract(); - - global $wgWikipediaExtractsAddCredits; - if ( $wgWikipediaExtractsAddCredits ) { - $html .= self::getCredits(); - } } catch ( WikipediaExtractsError $error ) { $html = $error->getHtmlMessage(); } @@ -94,29 +77,6 @@ } /** -* Get the language code of the Wikipedia to query -* -* @param string $input A language code or a URL from which to extract the language code -* @return string $wikipediaLanguage The language code of the Wikipedia to query -
[MediaWiki-commits] [Gerrit] mediawiki...WikipediaExtracts[master]: Respond to Reedy's code review
Sophivorus has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/393440 ) Change subject: Respond to Reedy's code review .. Respond to Reedy's code review - Add README with install, config and usage instructions - Improve parseParams method - Clean API requests in the getExtract method - Remove language guessing for config option to set target wiki - Add config option to customize user-agent - Remove span crediting Wikipedia, see docs - Remove obsolete messages Bug: T149766 Change-Id: I3eabcd6dd4d089441a8397d09dce6d45bfb74e6d --- A README M WikipediaExtracts.php M WikipediaExtractsError.php M extension.json M i18n/ast.json M i18n/be-tarask.json M i18n/bn.json M i18n/de.json M i18n/en.json M i18n/es.json M i18n/fa.json M i18n/fr.json M i18n/gl.json M i18n/it.json M i18n/kab.json M i18n/ko.json M i18n/lb.json M i18n/lt.json M i18n/mk.json M i18n/nb.json M i18n/nl.json M i18n/oc.json M i18n/pl.json M i18n/pt-br.json M i18n/pt.json M i18n/qqq.json M i18n/roa-tara.json M i18n/ru.json M i18n/sr-ec.json M i18n/sv.json M i18n/uk.json M i18n/vi.json M i18n/zh-hans.json 33 files changed, 77 insertions(+), 136 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikipediaExtracts refs/changes/40/393440/1 diff --git a/README b/README new file mode 100644 index 000..40df729 --- /dev/null +++ b/README @@ -0,0 +1,34 @@ +# WikipediaExtracts + +MediaWiki extension that enables users to insert content extracted directly from Wikipedia. + +## Installation + +Simply add the following code to the bottom of your LocalSettings.php: + +wfLoadExtension( 'WikipediaExtracts' ); + +## Configuration + +By default, WikipediaExtracts will extract content from the English Wikipedia. +To extract content from other Wikipedias, or other MediaWiki wikis altogether, +set $WikipediaExtractsAPI to the URL of the API of the target wiki in your +LocalSettings.php. For example, to extract content from the Spanish Wikipedia: + +$WikipediaExtractsAPI = "https://es.wikipedia.org/w/api.php";; + +Warning! The target wiki has to have the Extension:TextExtracts enabled! + +## Usage + +Basic usage to extract a full article: + +{{#WikipediaExtract:Title of the article}} + +To extract just the introduction of the article: + +{{#WikipediaExtract:Title of the article +|intro = true +}} + +See more options at https://www.mediawiki.org/wiki/Extension:WikipediaExtracts \ No newline at end of file diff --git a/WikipediaExtracts.php b/WikipediaExtracts.php index 7795fad..1bf84e2 100644 --- a/WikipediaExtracts.php +++ b/WikipediaExtracts.php @@ -3,20 +3,9 @@ class WikipediaExtracts { /** -* @var string $userAgent User agent for querying the API -*/ - private static $userAgent = - 'Extension:WikipediaExtracts/2.1 (https://www.mediawiki.org/wiki/Extension:WikipediaExtracts)'; - - /** * @var Parser $parser Parser object */ private static $parser; - - /** -* @var Language $contentLanguage Language object of the content language of the local wiki -*/ - public static $contentLanguage; /** * @var array $params Associative array of the parameters passed to the parser function @@ -27,11 +16,6 @@ * @var string $wikipediaTitle Title of the Wikipedia article to extract */ private static $wikipediaTitle; - - /** -* @var string $wikipediaLanguage Language code of the Wikipedia to query -*/ - private static $wikipediaLanguage; /** * Main hook @@ -51,18 +35,9 @@ */ public static function onFunctionHook( Parser $parser, $input = null ) { try { - self::$parser = $parser; - self::$contentLanguage = $parser->getTargetLanguage(); self::$params = self::parseParams( array_slice( func_get_args(), 2 ) ); self::$wikipediaTitle = self::getWikipediaTitle( $input ); - self::$wikipediaLanguage = self::getWikipediaLanguage( $input ); - $html = self::getExtract(); - - global $wgWikipediaExtractsAddCredits; - if ( $wgWikipediaExtractsAddCredits ) { - $html .= self::getCredits(); - } } catch ( WikipediaExtractsError $error ) { $html = $error->getHtmlMessage(); } @@ -92,27 +67,6 @@ } /** -* Get the language code of the Wikipedia to query -* -* @param string $input A language code or a URL from which to extract the language code -* @return string $wikipediaLanguage The language code of the Wikipedia to query -*/ - private static function getWikipediaLanguage( $input ) { - if ( $in
[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Add dropdown arrow icon for 'select' menu
Sophivorus has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/389520 ) Change subject: Add dropdown arrow icon for 'select' menu .. Add dropdown arrow icon for 'select' menu Change-Id: I0e9f83c06203c3a44dae932bcd6a055850608354 --- M proveit.css 1 file changed, 6 insertions(+), 0 deletions(-) Approvals: Sophivorus: Verified; Looks good to me, approved diff --git a/proveit.css b/proveit.css index e1fda4f..ac71cb7 100755 --- a/proveit.css +++ b/proveit.css @@ -144,6 +144,12 @@ width: 100%; } +#proveit-reference-form select { + -moz-appearance: menulist; + -webkit-appearance: menulist; + padding: .4em .1em; +} + #proveit-reference-form textarea { height: 60px; resize: vertical; -- To view, visit https://gerrit.wikimedia.org/r/389520 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0e9f83c06203c3a44dae932bcd6a055850608354 Gerrit-PatchSet: 2 Gerrit-Project: wikipedia/gadgets/ProveIt Gerrit-Branch: master Gerrit-Owner: Iniquity Gerrit-Reviewer: Sophivorus ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Minor comment changes
Sophivorus has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/388814 ) Change subject: Minor comment changes .. Minor comment changes Change-Id: Ie0ff7dcead444c35e76e66b835ac976b54c94f22 --- M README.md M proveit.js 2 files changed, 2 insertions(+), 2 deletions(-) Approvals: Sophivorus: Verified; Looks good to me, approved diff --git a/README.md b/README.md index 1814a7e..eab1bd6 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # ProveIt -ProveIt is powerful reference manager for MediaWiki +ProveIt is a powerful reference manager for Wikipedia (and any other MediaWiki wiki) Documentation at https://commons.wikimedia.org/wiki/Help:Gadget-ProveIt \ No newline at end of file diff --git a/proveit.js b/proveit.js index 15bfd3e..41c233b 100755 --- a/proveit.js +++ b/proveit.js @@ -1,5 +1,5 @@ /** - * ProveIt is a powerful reference manager for MediaWiki + * ProveIt is a powerful reference manager for Wikipedia (and any other MediaWiki wiki) * Documentation at https://commons.wikimedia.org/wiki/Help:Gadget-ProveIt * * Copyright 2008-2011 Georgia Tech Research Corporation, Atlanta, GA 30332-0415, ALL RIGHTS RESERVED -- To view, visit https://gerrit.wikimedia.org/r/388814 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie0ff7dcead444c35e76e66b835ac976b54c94f22 Gerrit-PatchSet: 1 Gerrit-Project: wikipedia/gadgets/ProveIt Gerrit-Branch: master Gerrit-Owner: Sophivorus Gerrit-Reviewer: Sophivorus ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Minor comment changes
Sophivorus has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/388814 ) Change subject: Minor comment changes .. Minor comment changes Change-Id: Ie0ff7dcead444c35e76e66b835ac976b54c94f22 --- M README.md M proveit.js 2 files changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikipedia/gadgets/ProveIt refs/changes/14/388814/1 diff --git a/README.md b/README.md index 1814a7e..eab1bd6 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # ProveIt -ProveIt is powerful reference manager for MediaWiki +ProveIt is a powerful reference manager for Wikipedia (and any other MediaWiki wiki) Documentation at https://commons.wikimedia.org/wiki/Help:Gadget-ProveIt \ No newline at end of file diff --git a/proveit.js b/proveit.js index 15bfd3e..41c233b 100755 --- a/proveit.js +++ b/proveit.js @@ -1,5 +1,5 @@ /** - * ProveIt is a powerful reference manager for MediaWiki + * ProveIt is a powerful reference manager for Wikipedia (and any other MediaWiki wiki) * Documentation at https://commons.wikimedia.org/wiki/Help:Gadget-ProveIt * * Copyright 2008-2011 Georgia Tech Research Corporation, Atlanta, GA 30332-0415, ALL RIGHTS RESERVED -- To view, visit https://gerrit.wikimedia.org/r/388814 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie0ff7dcead444c35e76e66b835ac976b54c94f22 Gerrit-PatchSet: 1 Gerrit-Project: wikipedia/gadgets/ProveIt Gerrit-Branch: master Gerrit-Owner: Sophivorus ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Poncho[master]: Modif
Sophivorus has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/383110 ) Change subject: Modif .. Modif Change-Id: I82793d7d1bf66910902f55d22cd8f113f839493e --- M Poncho.php M images/lens.png M skin.json 3 files changed, 6 insertions(+), 4 deletions(-) Approvals: Sophivorus: Verified; Looks good to me, approved diff --git a/Poncho.php b/Poncho.php index ee7a5e3..65a4efe 100644 --- a/Poncho.php +++ b/Poncho.php @@ -9,8 +9,8 @@ static function onBeforePageDisplay( OutputPage &$out, Skin &$skin ) { global $wgDefaultSkin; if ( $wgDefaultSkin === 'poncho' ) { - $out->addModuleStyles( 'skins.poncho' ); - $out->addModuleScripts( 'skins.poncho' ); + $out->addModuleStyles( 'skins.poncho.styles' ); + $out->addModuleScripts( 'skins.poncho.scripts' ); $out->addMeta( 'viewport', 'width=device-width' ); } } diff --git a/images/lens.png b/images/lens.png index 4a59104..328cf0e 100644 --- a/images/lens.png +++ b/images/lens.png Binary files differ diff --git a/skin.json b/skin.json index b56fcda..075a2b4 100644 --- a/skin.json +++ b/skin.json @@ -19,9 +19,11 @@ "PonchoTemplate": "Poncho.php" }, "ResourceModules": { - "skins.poncho": { - "scripts": "Poncho.js", + "skins.poncho.styles": { "styles": "Poncho.css" + }, + "skins.poncho.scripts": { + "scripts": "Poncho.js" } }, "ResourceFileModulePaths": { -- To view, visit https://gerrit.wikimedia.org/r/383110 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I82793d7d1bf66910902f55d22cd8f113f839493e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/skins/Poncho Gerrit-Branch: master Gerrit-Owner: Sophivorus Gerrit-Reviewer: Sophivorus ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Poncho[master]: Modif
Sophivorus has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/383110 ) Change subject: Modif .. Modif Change-Id: I82793d7d1bf66910902f55d22cd8f113f839493e --- M Poncho.php M images/lens.png M skin.json 3 files changed, 6 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/Poncho refs/changes/10/383110/1 diff --git a/Poncho.php b/Poncho.php index ee7a5e3..65a4efe 100644 --- a/Poncho.php +++ b/Poncho.php @@ -9,8 +9,8 @@ static function onBeforePageDisplay( OutputPage &$out, Skin &$skin ) { global $wgDefaultSkin; if ( $wgDefaultSkin === 'poncho' ) { - $out->addModuleStyles( 'skins.poncho' ); - $out->addModuleScripts( 'skins.poncho' ); + $out->addModuleStyles( 'skins.poncho.styles' ); + $out->addModuleScripts( 'skins.poncho.scripts' ); $out->addMeta( 'viewport', 'width=device-width' ); } } diff --git a/images/lens.png b/images/lens.png index 4a59104..328cf0e 100644 --- a/images/lens.png +++ b/images/lens.png Binary files differ diff --git a/skin.json b/skin.json index b56fcda..075a2b4 100644 --- a/skin.json +++ b/skin.json @@ -19,9 +19,11 @@ "PonchoTemplate": "Poncho.php" }, "ResourceModules": { - "skins.poncho": { - "scripts": "Poncho.js", + "skins.poncho.styles": { "styles": "Poncho.css" + }, + "skins.poncho.scripts": { + "scripts": "Poncho.js" } }, "ResourceFileModulePaths": { -- To view, visit https://gerrit.wikimedia.org/r/383110 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I82793d7d1bf66910902f55d22cd8f113f839493e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/skins/Poncho Gerrit-Branch: master Gerrit-Owner: Sophivorus ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...TitleKey[master]: Further normalise keys to find titles with special characters
Sophivorus has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/382968 ) Change subject: Further normalise keys to find titles with special characters .. Further normalise keys to find titles with special characters Using iconv, all special characters are translitered to ASCII. Then, all non-alphanumerical, non-whitespace characters are removed. This allows for many new kinds of relevant matches in languages such as Spanish where diacritics are common. For example, searching "avion" now matches "Avión". Bug: T22097 Change-Id: I668d3243c57da09a805cf2542a7ea98e6b0e7627 --- M TitleKey_body.php 1 file changed, 6 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TitleKey refs/changes/68/382968/1 diff --git a/TitleKey_body.php b/TitleKey_body.php index 5c50089..07282e2 100644 --- a/TitleKey_body.php +++ b/TitleKey_body.php @@ -39,10 +39,13 @@ static function setBatchKeys( $titles ) { $rows = []; foreach ( $titles as $id => $title ) { + $key = $title->getText(); + $key = iconv( 'UTF-8', 'ASCII//TRANSLIT', $key ); + $key = preg_replace( '#[^-\w\s]+#', '', $key ); // Remove unwanted chars $rows[] = [ 'tk_page' => $id, 'tk_namespace' => $title->getNamespace(), - 'tk_key' => self::normalize( $title->getText() ), + 'tk_key' => self::normalize( $key ), ]; } $dbw = wfGetDB( DB_MASTER ); @@ -57,6 +60,8 @@ // Normalization... static function normalize( $text ) { global $wgContLang; + $text = iconv( 'UTF-8', 'ASCII//TRANSLIT', $text ); + $text = preg_replace( '#[^-\w\s]+#', '', $text ); // Remove unwanted chars return $wgContLang->caseFold( $text ); } -- To view, visit https://gerrit.wikimedia.org/r/382968 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I668d3243c57da09a805cf2542a7ea98e6b0e7627 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/TitleKey Gerrit-Branch: master Gerrit-Owner: Sophivorus ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MsCalendar[master]: Updated translation from riverbees
Sophivorus has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/381069 ) Change subject: Updated translation from riverbees .. Updated translation from riverbees Change-Id: I6f23f2ce0c043b49b25f4f00f9da4e01f3108fd5 --- M i18n/fr.json 1 file changed, 3 insertions(+), 2 deletions(-) Approvals: Sophivorus: Looks good to me, approved jenkins-bot: Verified diff --git a/i18n/fr.json b/i18n/fr.json index b3dcf58..85d6f8d 100644 --- a/i18n/fr.json +++ b/i18n/fr.json @@ -1,10 +1,11 @@ { "@metadata": { "authors": [ - "mberthault" + "mberthault", +"riverbees" ] }, - "msc-desc": "Adds thetag to insert calendars into wiki pages", + "msc-desc": "Ajouter pour insérer un calendrier dans une page dans le wiki.", "msc-notfirstday": "Pas le premier jour... ", "msc-change": "Confirmer", "msc-remove": "Supprimer", -- To view, visit https://gerrit.wikimedia.org/r/381069 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6f23f2ce0c043b49b25f4f00f9da4e01f3108fd5 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MsCalendar Gerrit-Branch: master Gerrit-Owner: MarkAHershberger Gerrit-Reviewer: Felipeschenone Gerrit-Reviewer: Siebrand Gerrit-Reviewer: Sophivorus Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...WikipediaExtracts[master]: Requested minor fixes
Sophivorus has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/382507 ) Change subject: Requested minor fixes .. Requested minor fixes - Add PHP CodeSniffer - Move WikipediaExtractsError class to its own file - Change "and" for "&&" - Change "else if" for "elseif" - Document type hints for member variables and function variables - Update my username - Update extension version to 2.1 Bug: T149766 Change-Id: I11b958f6c5641f134c7bf78352a1f2e2e439505f --- M WikipediaExtracts.magic.php M WikipediaExtracts.php A WikipediaExtractsError.php A composer.json A composer.lock M extension.json M i18n/en.json M i18n/es.json M i18n/fr.json A phpcs.xml 10 files changed, 208 insertions(+), 53 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikipediaExtracts refs/changes/07/382507/1 diff --git a/WikipediaExtracts.magic.php b/WikipediaExtracts.magic.php index 1abecdf..eb21d5e 100644 --- a/WikipediaExtracts.magic.php +++ b/WikipediaExtracts.magic.php @@ -1,15 +1,15 @@ array( 0, 'WikipediaExtract' ), -); +$magicWords['en'] = [ + 'WikipediaExtract' => [ 0, 'WikipediaExtract' ], +]; -$magicWords['es'] = array( - 'WikipediaExtract' => array( 0, 'ExtractoWikipedia' ), -); +$magicWords['es'] = [ + 'WikipediaExtract' => [ 0, 'ExtractoWikipedia' ], +]; -$magicWords['fr'] = array( - 'WikipediaExtract' => array( 0, 'ExtraitWikipédia' ), -); \ No newline at end of file +$magicWords['fr'] = [ + 'WikipediaExtract' => [ 0, 'ExtraitWikipédia' ], +]; diff --git a/WikipediaExtracts.php b/WikipediaExtracts.php index 4f4a9c5..d1a0153 100644 --- a/WikipediaExtracts.php +++ b/WikipediaExtracts.php @@ -3,37 +3,39 @@ class WikipediaExtracts { /** -* User agent for querying the API +* @var string $userAgent User agent for querying the API */ - private static $userAgent = 'User-Agent: Extension:WikipediaExtracts/2.0 (https://www.mediawiki.org/wiki/Extension:WikipediaExtracts)'; + private static $userAgent = 'User-Agent: Extension:WikipediaExtracts/2.1 (https://www.mediawiki.org/wiki/Extension:WikipediaExtracts)'; /** -* Parser object +* @var Parser $parser Parser object */ private static $parser; /** -* Language object of the content language of the local wiki +* @var Language $contentLanguage Language object of the content language of the local wiki */ public static $contentLanguage; /** -* Associative array of the parameters passed to the parser function +* @var array $params Associative array of the parameters passed to the parser function */ private static $params; /** -* Title of the Wikipedia article to extract +* @var string $wikipediaTitle Title of the Wikipedia article to extract */ private static $wikipediaTitle; /** -* Language code of the Wikipedia to query +* @var string $wikipediaLanguage Language code of the Wikipedia to query */ private static $wikipediaLanguage; /** * Main hook +* +* @param Parser &$parser Parser object */ public static function onParserFirstCallInit( Parser &$parser ) { $parser->setFunctionHook( 'WikipediaExtract', 'WikipediaExtracts::onFunctionHook' ); @@ -41,6 +43,10 @@ /** * Parser function hook +* +* @param Parser $parser Parser object +* @param string $input Content of the parser function call +* @return string $html The Wikipedia extract, or an error message in case of error */ public static function onFunctionHook( Parser $parser, $input = null ) { try { @@ -64,8 +70,11 @@ /** * Get the title of the Wikipedia article to extract +* +* @param string $input A title string or a URL from which to extract the title string +* @return string $wikipediaTitle The title of the Wikipedia article to extract */ - private static function getWikipediaTitle( $input ) { + private static function getWikipediaTitle( $input = null ) { if ( $input ) { if ( filter_var( $input, FILTER_VALIDATE_URL ) ) { $path = parse_url( $input, PHP_URL_PATH ); // Example path "/wiki/Article_title" @@ -82,9 +91,12 @@ /** * Get the language code of the Wikipedia to query +* +* @param string $input A language code or a URL from which to extract the language code +* @return string $wikipediaLanguage The language code of the Wikipedia to query */ private static function getWikipediaLanguage( $input ) { - if ( $input and filter_var( $input, FILTER_VALIDATE_URL ) ) { + if (
[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Firefox display bugfix
Sophivorus has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/381447 ) Change subject: Firefox display bugfix .. Firefox display bugfix https://en.wikipedia.org/wiki/Wikipedia_talk:ProveIt Change-Id: I62c0c1bc2a769a53d83109fef8cfa68c1a1ee0db --- M proveit.css 1 file changed, 6 insertions(+), 0 deletions(-) Approvals: Sophivorus: Verified; Looks good to me, approved diff --git a/proveit.css b/proveit.css index 9e05e65..e1fda4f 100755 --- a/proveit.css +++ b/proveit.css @@ -56,6 +56,12 @@ resize: both; } +@-moz-document url-prefix() { + #proveit-reference-form { + margin-bottom: 50px; + } +} + #proveit-reference-list { margin: 0; padding: 0; -- To view, visit https://gerrit.wikimedia.org/r/381447 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I62c0c1bc2a769a53d83109fef8cfa68c1a1ee0db Gerrit-PatchSet: 1 Gerrit-Project: wikipedia/gadgets/ProveIt Gerrit-Branch: master Gerrit-Owner: Sophivorus Gerrit-Reviewer: Sophivorus ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Firefox display bugfix
Sophivorus has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/381447 ) Change subject: Firefox display bugfix .. Firefox display bugfix https://en.wikipedia.org/wiki/Wikipedia_talk:ProveIt Change-Id: I62c0c1bc2a769a53d83109fef8cfa68c1a1ee0db --- M proveit.css 1 file changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikipedia/gadgets/ProveIt refs/changes/47/381447/1 diff --git a/proveit.css b/proveit.css index 9e05e65..e1fda4f 100755 --- a/proveit.css +++ b/proveit.css @@ -56,6 +56,12 @@ resize: both; } +@-moz-document url-prefix() { + #proveit-reference-form { + margin-bottom: 50px; + } +} + #proveit-reference-list { margin: 0; padding: 0; -- To view, visit https://gerrit.wikimedia.org/r/381447 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I62c0c1bc2a769a53d83109fef8cfa68c1a1ee0db Gerrit-PatchSet: 1 Gerrit-Project: wikipedia/gadgets/ProveIt Gerrit-Branch: master Gerrit-Owner: Sophivorus ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MsCalendar[master]: Replace insert_id for insertId() to fix bug
Sophivorus has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/381247 ) Change subject: Replace insert_id for insertId() to fix bug .. Replace insert_id for insertId() to fix bug Change-Id: I54d526ab5a80534d0c1aaa52ed286814d6b6e63f --- M MsCalendar.body.php 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Sophivorus: Verified; Looks good to me, approved diff --git a/MsCalendar.body.php b/MsCalendar.body.php index 386f188..6a13c20 100644 --- a/MsCalendar.body.php +++ b/MsCalendar.body.php @@ -46,7 +46,7 @@ 'Cal_Name' => $name, ) ); - $id = $dbw->insert_id; + $id = $dbw->insertId(); } $parser->disableCache(); -- To view, visit https://gerrit.wikimedia.org/r/381247 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I54d526ab5a80534d0c1aaa52ed286814d6b6e63f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MsCalendar Gerrit-Branch: master Gerrit-Owner: Sophivorus Gerrit-Reviewer: Sophivorus ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MsCalendar[master]: Replace insert_id for insertId() to fix bug
Sophivorus has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/381247 ) Change subject: Replace insert_id for insertId() to fix bug .. Replace insert_id for insertId() to fix bug Change-Id: I54d526ab5a80534d0c1aaa52ed286814d6b6e63f --- M MsCalendar.body.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MsCalendar refs/changes/47/381247/1 diff --git a/MsCalendar.body.php b/MsCalendar.body.php index 386f188..6a13c20 100644 --- a/MsCalendar.body.php +++ b/MsCalendar.body.php @@ -46,7 +46,7 @@ 'Cal_Name' => $name, ) ); - $id = $dbw->insert_id; + $id = $dbw->insertId(); } $parser->disableCache(); -- To view, visit https://gerrit.wikimedia.org/r/381247 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I54d526ab5a80534d0c1aaa52ed286814d6b6e63f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MsCalendar Gerrit-Branch: master Gerrit-Owner: Sophivorus ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...LabeledSectionTransclusion[master]: Ignore tags and their content
Sophivorus has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/378817 ) Change subject: Ignore tags and their content .. Ignore tags and their content Bug T159465 Change-Id: Iee5be97ecf6a6d2ba182d3236dbeda749397e59e --- M LabeledSectionTransclusion.class.php 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/LabeledSectionTransclusion refs/changes/17/378817/1 diff --git a/LabeledSectionTransclusion.class.php b/LabeledSectionTransclusion.class.php index 7a8e4ae..1f5a87f 100644 --- a/LabeledSectionTransclusion.class.php +++ b/LabeledSectionTransclusion.class.php @@ -557,6 +557,9 @@ $result = substr( $text, $begin_off ); } + // Remove tags and their content + $result = preg_replace( '#(.*)#sim', '', $result ); + if ( method_exists( $parser, 'getPreprocessor' ) ) { $frame = $parser->getPreprocessor()->newFrame(); $dom = $parser->preprocessToDom( $result ); -- To view, visit https://gerrit.wikimedia.org/r/378817 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iee5be97ecf6a6d2ba182d3236dbeda749397e59e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/LabeledSectionTransclusion Gerrit-Branch: master Gerrit-Owner: Sophivorus ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MsLinks[master]: Update installation to registration
Sophivorus has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/375758 ) Change subject: Update installation to registration .. Update installation to registration Also add licence Change-Id: Ic280df5fb16baf9bc0ed4a58196fec111e6d2017 --- A COPYING M MsLinks.body.php D MsLinks.i18n.php M MsLinks.php A extension.json 5 files changed, 438 insertions(+), 47 deletions(-) Approvals: Sophivorus: Looks good to me, approved jenkins-bot: Verified diff --git a/COPYING b/COPYING new file mode 100644 index 000..ecbc059 --- /dev/null +++ b/COPYING @@ -0,0 +1,339 @@ +GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + +GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer o
[MediaWiki-commits] [Gerrit] mediawiki...MsLinks[master]: Update installation to registration
Sophivorus has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/375758 ) Change subject: Update installation to registration .. Update installation to registration Also add licence Change-Id: Ic280df5fb16baf9bc0ed4a58196fec111e6d2017 --- A COPYING M MsLinks.body.php D MsLinks.i18n.php M MsLinks.php A extension.json 5 files changed, 438 insertions(+), 47 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MsLinks refs/changes/58/375758/1 diff --git a/COPYING b/COPYING new file mode 100644 index 000..ecbc059 --- /dev/null +++ b/COPYING @@ -0,0 +1,339 @@ +GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + +GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice an
[MediaWiki-commits] [Gerrit] mediawiki...MsCatSelect[master]: Remove unused i18n shim
Sophivorus has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/367460 ) Change subject: Remove unused i18n shim .. Remove unused i18n shim When extension.json is created the shim is not loaded, so it should be removed instead Change-Id: I64b0984c7862a96b4647018060ddc7fbe6345498 --- D MsCatSelect.i18n.php M MsCatSelect.php 2 files changed, 0 insertions(+), 36 deletions(-) Approvals: Sophivorus: Looks good to me, approved jenkins-bot: Verified diff --git a/MsCatSelect.i18n.php b/MsCatSelect.i18n.php deleted file mode 100755 index 54b6441..000 --- a/MsCatSelect.i18n.php +++ /dev/null @@ -1,35 +0,0 @@ -https://git.wikimedia.org/blob/mediawiki%2Fcore.git/HEAD/maintenance%2FgenerateJsonI18n.php - * - * Beginning with MediaWiki 1.23, translation strings are stored in json files, - * and the EXTENSION.i18n.php file only exists to provide compatibility with - * older releases of MediaWiki. For more information about this migration, see: - * https://www.mediawiki.org/wiki/Requests_for_comment/Localisation_format - * - * This shim maintains compatibility back to MediaWiki 1.17. - */ -$messages = array(); -if ( !function_exists( 'wfJsonI18nShim9fab6f3c40c10f09' ) ) { - function wfJsonI18nShim9fab6f3c40c10f09( $cache, $code, &$cachedData ) { - $codeSequence = array_merge( array( $code ), $cachedData['fallbackSequence'] ); - foreach ( $codeSequence as $csCode ) { - $fileName = dirname( __FILE__ ) . "/extensions/MsCatSelect/i18n/$csCode.json"; - if ( is_readable( $fileName ) ) { - $data = FormatJson::decode( file_get_contents( $fileName ), true ); - foreach ( array_keys( $data ) as $key ) { - if ( $key === '' || $key[0] === '@' ) { - unset( $data[$key] ); - } - } - $cachedData['messages'] = array_merge( $data, $cachedData['messages'] ); - } - - $cachedData['deps'][] = new FileDependency( $fileName ); - } - return true; - } - - $GLOBALS['wgHooks']['LocalisationCacheRecache'][] = 'wfJsonI18nShim9fab6f3c40c10f09'; -} \ No newline at end of file diff --git a/MsCatSelect.php b/MsCatSelect.php index 06a1fb1..12add84 100755 --- a/MsCatSelect.php +++ b/MsCatSelect.php @@ -32,7 +32,6 @@ 'remoteExtPath' => 'MsCatSelect' ]; -$wgExtensionMessagesFiles['MsCatSelect'] = __DIR__ . '/MsCatSelect.i18n.php'; $wgMessagesDirs['MsCatSelect'] = __DIR__ . '/i18n'; $wgAutoloadClasses['MsCatSelect'] = __DIR__ . '/MsCatSelect.body.php'; -- To view, visit https://gerrit.wikimedia.org/r/367460 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I64b0984c7862a96b4647018060ddc7fbe6345498 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MsCatSelect Gerrit-Branch: master Gerrit-Owner: Umherirrender Gerrit-Reviewer: Siebrand Gerrit-Reviewer: Sophivorus Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MsCatSelect[master]: Improve sort key handling
Sophivorus has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/366855 ) Change subject: Improve sort key handling .. Improve sort key handling Now the extension leaves the sort key empty rather than defaulting to the current title, which avoids having to update the keys when renaming a page. Also add extension registration Change-Id: Icd2e0e5f6c28543b9cbe37466b7a83b463c82d3c --- M MsCatSelect.body.php M MsCatSelect.js M MsCatSelect.php A extension.json 4 files changed, 119 insertions(+), 61 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MsCatSelect refs/changes/55/366855/1 diff --git a/MsCatSelect.body.php b/MsCatSelect.body.php index 940cf4b..ded8a97 100755 --- a/MsCatSelect.body.php +++ b/MsCatSelect.body.php @@ -9,12 +9,12 @@ $wgOut->addModules( 'ext.MsCatSelect' ); // Make the configuration variables available to JavaScript - $mscsVars = array( + $mscsVars = [ 'MainCategories' => $wgMSCS_MainCategories, 'UseNiceDropdown' => $wgMSCS_UseNiceDropdown, 'WarnNoCategories' => $wgMSCS_WarnNoCategories, 'WarnNoCategoriesException' => str_replace( ' ', '_', $wgMSCS_WarnNoCategoriesException ), - ); + ]; $mscsVars = json_encode( $mscsVars, true ); $wgOut->addScript( "var mscsVars = $mscsVars;" ); return true; @@ -33,17 +33,11 @@ // Get localised namespace string $categoryNamespace = $wgContLang->getNsText( NS_CATEGORY ); - // Default sort key is page name with stripped namespace name, otherwise sorting is ugly - if ( $editPage->getContextTitle()->getNamespace() == NS_MAIN ) { - $default_sortkey = ""; - } else { - $default_sortkey = "|{{PAGENAME}}"; - } - // Iterate through all selected category entries: $text = "\n"; if ( array_key_exists( 'SelectCategoryList', $_POST ) ) { foreach ( $_POST['SelectCategoryList'] as $category ) { + $category = rtrim( $category, '|' ); // If the sort key is empty, remove it $text .= "\n[[" . $categoryNamespace . ":" . $category . "]]"; } } diff --git a/MsCatSelect.js b/MsCatSelect.js index 7230404..4a525de 100755 --- a/MsCatSelect.js +++ b/MsCatSelect.js @@ -15,7 +15,7 @@ if ( data && data.query && data.query.querypage ) { // Success! jQuery.each( data.query.querypage.results, function( index, val ) { - jQuery( '', { value: index + 1, text: val.value.replace( /_/g, ' ' ) } ).appendTo( dd ); + jQuery( '', { value: index + 1, text: val.value.replace( /_/g, ' ' ) } ).appendTo( dd ); }); if ( chosenDropDown ) { dd.chosen( { disableSearchThreshold: 6 } ); @@ -42,20 +42,20 @@ if ( data && data.query && data.query.categorymembers ) { // Success! if ( data.query.categorymembers.length > 0 ) { - jQuery( '' ).attr( 'class', 'node' ).prependTo( container ); + jQuery( '' ).attr( 'class', 'node' ).prependTo( container ); var dd = mscsCreateDropDown( selectedCat, ebene + 1 ).appendTo( container ); - jQuery( '' ).attr( 'id', 'mscs_subcat_' + ( ebene + 1 ) ).attr( 'class', 'subcat' ).appendTo( container ); + jQuery( '' ).attr( 'id', 'mscs_subcat_' + ( ebene + 1 ) ).attr( 'class', 'subcat' ).appendTo( container ); jQuery.each( data.query.categorymembers, function( index, val ) { var listElement = val.title.split( ':', 2 ); - jQuery( '', { value: index + 1, text: listElement[1] } ).appendTo( dd ); + jQuery( '', { value: index + 1, text: listElement[1] } ).appendTo( dd ); }); if ( chosenDropDown ) { dd.chosen({ disableSearchThreshold: 6 }); jQuery( '#mscs_dd_' + ( ebene + 1 ) + '_chzn' ).width( dd.width() + 20 ); } } else { //no subcats - jQuery( '' ).attr( 'class', 'no-node' ).prependTo( jQuery( '#mscs_subcat_' + ebene ) ); +
[MediaWiki-commits] [Gerrit] mediawiki...MsCatSelect[master]: Improve sort key handling
Sophivorus has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/366855 ) Change subject: Improve sort key handling .. Improve sort key handling Now the extension leaves the sort key empty rather than defaulting to the current title, which avoids having to update the keys when renaming a page. Also add extension registration Change-Id: Icd2e0e5f6c28543b9cbe37466b7a83b463c82d3c --- M MsCatSelect.body.php M MsCatSelect.js M MsCatSelect.php A extension.json 4 files changed, 119 insertions(+), 61 deletions(-) Approvals: Sophivorus: Verified; Looks good to me, approved diff --git a/MsCatSelect.body.php b/MsCatSelect.body.php index 940cf4b..ded8a97 100755 --- a/MsCatSelect.body.php +++ b/MsCatSelect.body.php @@ -9,12 +9,12 @@ $wgOut->addModules( 'ext.MsCatSelect' ); // Make the configuration variables available to JavaScript - $mscsVars = array( + $mscsVars = [ 'MainCategories' => $wgMSCS_MainCategories, 'UseNiceDropdown' => $wgMSCS_UseNiceDropdown, 'WarnNoCategories' => $wgMSCS_WarnNoCategories, 'WarnNoCategoriesException' => str_replace( ' ', '_', $wgMSCS_WarnNoCategoriesException ), - ); + ]; $mscsVars = json_encode( $mscsVars, true ); $wgOut->addScript( "var mscsVars = $mscsVars;" ); return true; @@ -33,17 +33,11 @@ // Get localised namespace string $categoryNamespace = $wgContLang->getNsText( NS_CATEGORY ); - // Default sort key is page name with stripped namespace name, otherwise sorting is ugly - if ( $editPage->getContextTitle()->getNamespace() == NS_MAIN ) { - $default_sortkey = ""; - } else { - $default_sortkey = "|{{PAGENAME}}"; - } - // Iterate through all selected category entries: $text = "\n"; if ( array_key_exists( 'SelectCategoryList', $_POST ) ) { foreach ( $_POST['SelectCategoryList'] as $category ) { + $category = rtrim( $category, '|' ); // If the sort key is empty, remove it $text .= "\n[[" . $categoryNamespace . ":" . $category . "]]"; } } diff --git a/MsCatSelect.js b/MsCatSelect.js index 7230404..4a525de 100755 --- a/MsCatSelect.js +++ b/MsCatSelect.js @@ -15,7 +15,7 @@ if ( data && data.query && data.query.querypage ) { // Success! jQuery.each( data.query.querypage.results, function( index, val ) { - jQuery( '', { value: index + 1, text: val.value.replace( /_/g, ' ' ) } ).appendTo( dd ); + jQuery( '', { value: index + 1, text: val.value.replace( /_/g, ' ' ) } ).appendTo( dd ); }); if ( chosenDropDown ) { dd.chosen( { disableSearchThreshold: 6 } ); @@ -42,20 +42,20 @@ if ( data && data.query && data.query.categorymembers ) { // Success! if ( data.query.categorymembers.length > 0 ) { - jQuery( '' ).attr( 'class', 'node' ).prependTo( container ); + jQuery( '' ).attr( 'class', 'node' ).prependTo( container ); var dd = mscsCreateDropDown( selectedCat, ebene + 1 ).appendTo( container ); - jQuery( '' ).attr( 'id', 'mscs_subcat_' + ( ebene + 1 ) ).attr( 'class', 'subcat' ).appendTo( container ); + jQuery( '' ).attr( 'id', 'mscs_subcat_' + ( ebene + 1 ) ).attr( 'class', 'subcat' ).appendTo( container ); jQuery.each( data.query.categorymembers, function( index, val ) { var listElement = val.title.split( ':', 2 ); - jQuery( '', { value: index + 1, text: listElement[1] } ).appendTo( dd ); + jQuery( '', { value: index + 1, text: listElement[1] } ).appendTo( dd ); }); if ( chosenDropDown ) { dd.chosen({ disableSearchThreshold: 6 }); jQuery( '#mscs_dd_' + ( ebene + 1 ) + '_chzn' ).width( dd.width() + 20 ); } } else { //no subcats - jQuery( '' ).attr( 'class', 'no-node' ).prependTo( jQuery( '#mscs_subcat_' + ebene ) ); + jQuery( '' ).
[MediaWiki-commits] [Gerrit] mediawiki...DebateTree[master]: General update for a cleaner syntax compatible with VisualEd...
Sophivorus has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/363739 ) Change subject: General update for a cleaner syntax compatible with VisualEditor .. General update for a cleaner syntax compatible with VisualEditor Change-Id: I5afebd177c1a1c0ccaf21fe3bec94c80f9ae9bb5 --- M DebateTree.css M DebateTree.js M DebateTree.php M extension.json M i18n/en.json M i18n/es.json M i18n/qqq.json 7 files changed, 56 insertions(+), 63 deletions(-) Approvals: Sophivorus: Verified; Looks good to me, approved diff --git a/DebateTree.css b/DebateTree.css index ed1bad1..b6588a1 100644 --- a/DebateTree.css +++ b/DebateTree.css @@ -1,23 +1,20 @@ -.debatetree-argument, -.debatetree-dummy { - background: #f9f9f9; - border: 1px solid #aaa; - border-radius: 10px; - box-shadow: 5px 5px 10px #aaa; +.debatetree ul { + list-style: none; + margin: 0 !important; +} + +.debatetree ul li { + background: #f8f9fa; + border: 1px solid #a2a9b1; cursor: pointer; - margin: 1em 0; + margin: 1em 0 0 0 !important; padding: 1em; - overflow: hidden; } .debatetree-status { float: right; - margin-left: 10px; - padding: 0 5px; -} - -.debatetree-counts { - color: #aaa; + margin-left: 1em; + padding: 0 .5em; } .debatetree-sustained { @@ -26,4 +23,9 @@ .debatetree-refuted { background: #f55; +} + +.debatetree-counts { + color: #a2a9b1; + font-size: small; } \ No newline at end of file diff --git a/DebateTree.js b/DebateTree.js index 3ad6bfc..d22 100644 --- a/DebateTree.js +++ b/DebateTree.js @@ -1,30 +1,39 @@ var DebateTree = { - // GETTERS - + /** +* Get all the arguments in the page +*/ getArguments: function () { - return $( '.debatetree-argument' ); + return $( '.debatetree ul li' ); }, + /** +* Get the objections to the given argument +*/ getObjections: function ( argument ) { - return $( argument ).children( '.debatetree-argument' ); + return $( argument ).children( 'ul' ).children( 'li' ); }, - getDescendants: function ( argument ) { - return $( '.debatetree-argument', argument ); - }, - + /** +* Get the sustained objections to the given argument +*/ getSustainedObjections: function ( argument ) { return DebateTree.getObjections( argument ).filter( DebateTree.isSustained ); }, - // FILTERS + /** +* Get the nested objections of the given argument +*/ + getNestedObjections: function ( argument ) { + return $( 'li', argument ); + }, + /** +* Return true if the given argument is sustained +*/ isSustained: function ( index, argument ) { return DebateTree.getSustainedObjections( argument ).length ? false : true; }, - - // DOM MODIFIERS /** * Prepend the status to the argument @@ -38,49 +47,38 @@ }, /** -* Append the stats to the argument +* Append the counts to the argument */ addCounts: function ( index, argument ) { var objectionCount = DebateTree.getObjections( argument ).length, sustainedObjectionCount = DebateTree.getSustainedObjections( argument ).length, - descendantCount = DebateTree.getDescendants( argument ).length, - text = mw.message( 'debatetree-counts', objectionCount, sustainedObjectionCount, descendantCount ), + nestedObjectionCount = DebateTree.getNestedObjections( argument ).length, + text = mw.message( 'debatetree-counts', objectionCount, sustainedObjectionCount, nestedObjectionCount ), span = $( '' ).addClass( 'debatetree-counts' ).text( text ); if ( objectionCount ) { - DebateTree.getObjections( argument ).first().before( span ); + $( argument ).children( 'ul' ).first().before( span ); } else { $( argument ).append( ' ', span ); } }, /** -* Add a dummy objection to the argument +* Toggle the objections of the clicked argument */ - addDummyObjection: function ( index, argument ) { - var editLink = $( '#ca-edit a' ).attr( 'href' ), - dummyContent = mw.message( 'debatetree-dummy', editLink ).parse(), - dummyObjection = $( '' ).addClass( 'debatetree-argument' ).html( dummyContent ); - - $( argument ).append( dummyObjection ); - }, - - // EVENT HANDLERS -
[MediaWiki-commits] [Gerrit] mediawiki...DebateTree[master]: General update for a cleaner syntax compatible with VisualEd...
Sophivorus has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/363739 ) Change subject: General update for a cleaner syntax compatible with VisualEditor .. General update for a cleaner syntax compatible with VisualEditor Change-Id: I5afebd177c1a1c0ccaf21fe3bec94c80f9ae9bb5 --- M DebateTree.css M DebateTree.js M DebateTree.php M extension.json M i18n/en.json M i18n/es.json M i18n/qqq.json 7 files changed, 56 insertions(+), 63 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DebateTree refs/changes/39/363739/1 diff --git a/DebateTree.css b/DebateTree.css index ed1bad1..b6588a1 100644 --- a/DebateTree.css +++ b/DebateTree.css @@ -1,23 +1,20 @@ -.debatetree-argument, -.debatetree-dummy { - background: #f9f9f9; - border: 1px solid #aaa; - border-radius: 10px; - box-shadow: 5px 5px 10px #aaa; +.debatetree ul { + list-style: none; + margin: 0 !important; +} + +.debatetree ul li { + background: #f8f9fa; + border: 1px solid #a2a9b1; cursor: pointer; - margin: 1em 0; + margin: 1em 0 0 0 !important; padding: 1em; - overflow: hidden; } .debatetree-status { float: right; - margin-left: 10px; - padding: 0 5px; -} - -.debatetree-counts { - color: #aaa; + margin-left: 1em; + padding: 0 .5em; } .debatetree-sustained { @@ -26,4 +23,9 @@ .debatetree-refuted { background: #f55; +} + +.debatetree-counts { + color: #a2a9b1; + font-size: small; } \ No newline at end of file diff --git a/DebateTree.js b/DebateTree.js index 3ad6bfc..d22 100644 --- a/DebateTree.js +++ b/DebateTree.js @@ -1,30 +1,39 @@ var DebateTree = { - // GETTERS - + /** +* Get all the arguments in the page +*/ getArguments: function () { - return $( '.debatetree-argument' ); + return $( '.debatetree ul li' ); }, + /** +* Get the objections to the given argument +*/ getObjections: function ( argument ) { - return $( argument ).children( '.debatetree-argument' ); + return $( argument ).children( 'ul' ).children( 'li' ); }, - getDescendants: function ( argument ) { - return $( '.debatetree-argument', argument ); - }, - + /** +* Get the sustained objections to the given argument +*/ getSustainedObjections: function ( argument ) { return DebateTree.getObjections( argument ).filter( DebateTree.isSustained ); }, - // FILTERS + /** +* Get the nested objections of the given argument +*/ + getNestedObjections: function ( argument ) { + return $( 'li', argument ); + }, + /** +* Return true if the given argument is sustained +*/ isSustained: function ( index, argument ) { return DebateTree.getSustainedObjections( argument ).length ? false : true; }, - - // DOM MODIFIERS /** * Prepend the status to the argument @@ -38,49 +47,38 @@ }, /** -* Append the stats to the argument +* Append the counts to the argument */ addCounts: function ( index, argument ) { var objectionCount = DebateTree.getObjections( argument ).length, sustainedObjectionCount = DebateTree.getSustainedObjections( argument ).length, - descendantCount = DebateTree.getDescendants( argument ).length, - text = mw.message( 'debatetree-counts', objectionCount, sustainedObjectionCount, descendantCount ), + nestedObjectionCount = DebateTree.getNestedObjections( argument ).length, + text = mw.message( 'debatetree-counts', objectionCount, sustainedObjectionCount, nestedObjectionCount ), span = $( '' ).addClass( 'debatetree-counts' ).text( text ); if ( objectionCount ) { - DebateTree.getObjections( argument ).first().before( span ); + $( argument ).children( 'ul' ).first().before( span ); } else { $( argument ).append( ' ', span ); } }, /** -* Add a dummy objection to the argument +* Toggle the objections of the clicked argument */ - addDummyObjection: function ( index, argument ) { - var editLink = $( '#ca-edit a' ).attr( 'href' ), - dummyContent = mw.message( 'debatetree-dummy', editLink ).parse(), - dummyObjection = $( '' ).addClass( 'debatetree-argument' ).html( dummyContent ); - - $( argument ).append( dummyObjection ); - }, - -
[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Add Bihari localization
Sophivorus has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/361858 ) Change subject: Add Bihari localization .. Add Bihari localization Change-Id: Ic5e623c3f16b32b64d6360b4960c9c3cd54425a9 --- A i18n/bh.json 1 file changed, 20 insertions(+), 0 deletions(-) Approvals: Sophivorus: Verified; Looks good to me, approved diff --git a/i18n/bh.json b/i18n/bh.json new file mode 100644 index 000..ff2d957 --- /dev/null +++ b/i18n/bh.json @@ -0,0 +1,20 @@ +{ +"@metadata": { +"authors": [ +"SM7" +] +}, +"proveit-list-tab": "लिस्ट ($1)", +"proveit-add-tab": "जोड़ीं", +"proveit-reference-name-label": "संदर्भ नाँव", +"proveit-reference-content-label": "संदर्भ सामग्री", +"proveit-reference-template-label": "मुख्य टेम्पलेट", +"proveit-cite-button": "हवाला दीं", +"proveit-remove-button": "हटाईं", +"proveit-insert-button": "जोड़ीं", +"proveit-update-button": "अपडेट", +"proveit-prompt-name": "हवाला देवे खातिर एह संदर्भ के नाँव होखे चाहीं:", +"proveit-confirm-remove": "एह संदर्भ आ एकर सभ जगह से हवाला के हटा दी, आप निश्चित बानी?", +"proveit-no-template": "कौनों टेम्पलेट ना बा", +"proveit-no-references": "कौनों संदर्भ ना मिलल" +} -- To view, visit https://gerrit.wikimedia.org/r/361858 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic5e623c3f16b32b64d6360b4960c9c3cd54425a9 Gerrit-PatchSet: 1 Gerrit-Project: wikipedia/gadgets/ProveIt Gerrit-Branch: master Gerrit-Owner: Sophivorus Gerrit-Reviewer: Sophivorus ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Add Bihari localization
Sophivorus has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/361858 ) Change subject: Add Bihari localization .. Add Bihari localization Change-Id: Ic5e623c3f16b32b64d6360b4960c9c3cd54425a9 --- A i18n/bh.json 1 file changed, 20 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikipedia/gadgets/ProveIt refs/changes/58/361858/1 diff --git a/i18n/bh.json b/i18n/bh.json new file mode 100644 index 000..ff2d957 --- /dev/null +++ b/i18n/bh.json @@ -0,0 +1,20 @@ +{ +"@metadata": { +"authors": [ +"SM7" +] +}, +"proveit-list-tab": "लिस्ट ($1)", +"proveit-add-tab": "जोड़ीं", +"proveit-reference-name-label": "संदर्भ नाँव", +"proveit-reference-content-label": "संदर्भ सामग्री", +"proveit-reference-template-label": "मुख्य टेम्पलेट", +"proveit-cite-button": "हवाला दीं", +"proveit-remove-button": "हटाईं", +"proveit-insert-button": "जोड़ीं", +"proveit-update-button": "अपडेट", +"proveit-prompt-name": "हवाला देवे खातिर एह संदर्भ के नाँव होखे चाहीं:", +"proveit-confirm-remove": "एह संदर्भ आ एकर सभ जगह से हवाला के हटा दी, आप निश्चित बानी?", +"proveit-no-template": "कौनों टेम्पलेट ना बा", +"proveit-no-references": "कौनों संदर्भ ना मिलल" +} -- To view, visit https://gerrit.wikimedia.org/r/361858 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic5e623c3f16b32b64d6360b4960c9c3cd54425a9 Gerrit-PatchSet: 1 Gerrit-Project: wikipedia/gadgets/ProveIt Gerrit-Branch: master Gerrit-Owner: Sophivorus ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Add Finnish translations by Zache
Sophivorus has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/361794 ) Change subject: Add Finnish translations by Zache .. Add Finnish translations by Zache Change-Id: I5a15c1b1fcb18baa2c7e13652e365140153963d9 --- M i18n/fi.json 1 file changed, 11 insertions(+), 1 deletion(-) Approvals: Sophivorus: Verified; Looks good to me, approved diff --git a/i18n/fi.json b/i18n/fi.json index f1a1fa0..227c0de 100644 --- a/i18n/fi.json +++ b/i18n/fi.json @@ -16,5 +16,15 @@ "proveit-prompt-name": "Viite tarvitsee nimen toimiakseen:", "proveit-confirm-remove": "Oletko varma, että haluat poistaa viitteen?", "proveit-no-template": "Ilman viitemallinetta", - "proveit-no-references": "Artikkelissa ei ole viitteitä." + "proveit-no-references": "Artikkelissa ei ole viitteitä.", + "proveit-filter-fields": "Suodata kenttiä", + "proveit-filter-references": "Suodata viitteitä", + "proveit-show-all-button": "Näytä kaikki", + "proveit-today-button": "Tänään", + "proveit-citoid-label": "Automaattinen viite", + "proveit-citoid-tooltip": "Hae viitteen tietoja URL, DOI, ISBN or PMC/PMID tunnisteella", + "proveit-citoid-placeholder": "URL, DOI, ISBN or PMC/PMID", + "proveit-citoid-load": "Lataa", + "proveit-citoid-loading": "Ladataan...", + "proveit-citoid-error": "Virhe" } -- To view, visit https://gerrit.wikimedia.org/r/361794 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5a15c1b1fcb18baa2c7e13652e365140153963d9 Gerrit-PatchSet: 2 Gerrit-Project: wikipedia/gadgets/ProveIt Gerrit-Branch: master Gerrit-Owner: Sophivorus Gerrit-Reviewer: Sophivorus ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Add Finnish translations by Zache
Sophivorus has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/361794 ) Change subject: Add Finnish translations by Zache .. Add Finnish translations by Zache Change-Id: I5a15c1b1fcb18baa2c7e13652e365140153963d9 --- M i18n/fi.json 1 file changed, 10 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikipedia/gadgets/ProveIt refs/changes/94/361794/1 diff --git a/i18n/fi.json b/i18n/fi.json index f1a1fa0..2a1603b 100644 --- a/i18n/fi.json +++ b/i18n/fi.json @@ -17,4 +17,14 @@ "proveit-confirm-remove": "Oletko varma, että haluat poistaa viitteen?", "proveit-no-template": "Ilman viitemallinetta", "proveit-no-references": "Artikkelissa ei ole viitteitä." + "proveit-filter-fields": "Suodata kenttiä", + "proveit-filter-references": "Suodata viitteitä", + "proveit-show-all-button": "Näytä kaikki", + "proveit-today-button": "Tänään", + "proveit-citoid-label": "Automaattinen viite", + "proveit-citoid-tooltip": "Hae viitteen tietoja URL, DOI, ISBN or PMC/PMID tunnisteella", + "proveit-citoid-placeholder": "URL, DOI, ISBN or PMC/PMID", + "proveit-citoid-load": "Lataa", + "proveit-citoid-loading": "Ladataan...", + "proveit-citoid-error": "Virhe" } -- To view, visit https://gerrit.wikimedia.org/r/361794 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5a15c1b1fcb18baa2c7e13652e365140153963d9 Gerrit-PatchSet: 1 Gerrit-Project: wikipedia/gadgets/ProveIt Gerrit-Branch: master Gerrit-Owner: Sophivorus ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Minor CSS fix
Sophivorus has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/361793 ) Change subject: Minor CSS fix .. Minor CSS fix Change-Id: If121e5c370244376cc7b26de69e67f7236d6cea5 --- M proveit.css 1 file changed, 0 insertions(+), 2 deletions(-) Approvals: Sophivorus: Verified; Looks good to me, approved diff --git a/proveit.css b/proveit.css index d68e7b2..9e05e65 100755 --- a/proveit.css +++ b/proveit.css @@ -38,8 +38,6 @@ margin-left: 5px; position: relative; top: 5px; - border-top-left-radius: 10px; - border-top-right-radius: 10px; } #proveit-list-tab.active, -- To view, visit https://gerrit.wikimedia.org/r/361793 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: If121e5c370244376cc7b26de69e67f7236d6cea5 Gerrit-PatchSet: 1 Gerrit-Project: wikipedia/gadgets/ProveIt Gerrit-Branch: master Gerrit-Owner: Sophivorus Gerrit-Reviewer: Sophivorus ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Minor CSS fix
Sophivorus has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/361793 ) Change subject: Minor CSS fix .. Minor CSS fix Change-Id: If121e5c370244376cc7b26de69e67f7236d6cea5 --- M proveit.css 1 file changed, 0 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikipedia/gadgets/ProveIt refs/changes/93/361793/1 diff --git a/proveit.css b/proveit.css index d68e7b2..9e05e65 100755 --- a/proveit.css +++ b/proveit.css @@ -38,8 +38,6 @@ margin-left: 5px; position: relative; top: 5px; - border-top-left-radius: 10px; - border-top-right-radius: 10px; } #proveit-list-tab.active, -- To view, visit https://gerrit.wikimedia.org/r/361793 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If121e5c370244376cc7b26de69e67f7236d6cea5 Gerrit-PatchSet: 1 Gerrit-Project: wikipedia/gadgets/ProveIt Gerrit-Branch: master Gerrit-Owner: Sophivorus ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Add button for running the Citoid script
Sophivorus has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/361694 ) Change subject: Add button for running the Citoid script .. Add button for running the Citoid script Also various CSS changes Change-Id: Ia76f29a79fb83c633eac9aa37d7fe03935d1dca0 --- M i18n/en.json M i18n/es.json M i18n/qqq.json M proveit.css M proveit.js 5 files changed, 66 insertions(+), 61 deletions(-) Approvals: Sophivorus: Verified; Looks good to me, approved diff --git a/i18n/en.json b/i18n/en.json index 85804a7..8e06286 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -21,9 +21,10 @@ "proveit-filter-references": "Filter references", "proveit-show-all-button": "Show all fields", "proveit-today-button": "Today", - "proveit-citoid-label": "Reference identifier", + "proveit-citoid-label": "Automatic reference", "proveit-citoid-tooltip": "Enter a URL, DOI, ISBN or PMC/PMID to try to extract the details automatically through the Citoid service", "proveit-citoid-placeholder": "URL, DOI, ISBN or PMC/PMID", + "proveit-citoid-load": "Load", "proveit-citoid-loading": "Loading...", "proveit-citoid-error": "Error" } \ No newline at end of file diff --git a/i18n/es.json b/i18n/es.json index 132b2e2..7606ebb 100644 --- a/i18n/es.json +++ b/i18n/es.json @@ -23,9 +23,10 @@ "proveit-filter-references": "Filtrar referencias", "proveit-show-all-button": "Mostrar todos los campos", "proveit-today-button": "Hoy", - "proveit-citoid-label": "Identificador de la referencia", + "proveit-citoid-label": "Referencia automática", "proveit-citoid-tooltip": "Ingresa una URL, DOI, ISBN or PMC/PMID para intentar extraer los detalles automáticamente a través del servicio Citoid", "proveit-citoid-placeholder": "URL, DOI, ISBN o PMC/PMID", + "proveit-citoid-load": "Cargar", "proveit-citoid-loading": "Cargando…", "proveit-citoid-error": "Error" } diff --git a/i18n/qqq.json b/i18n/qqq.json index 54def56..cd37a24 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -24,9 +24,10 @@ "proveit-filter-references": "Placeholder for the input field to filter references", "proveit-show-all-button": "Text for the button that shows all parameter fields", "proveit-today-button": "Text for the button that inserts the current date\n{{Identical|Today}}", - "proveit-citoid-label": "Reference identifier", + "proveit-citoid-label": "Label for the Citoid field", "proveit-citoid-tooltip": "Tooltip for the field that when filled with a reference identifier, triggers the Citoid service to automatically fill in the reference details", "proveit-citoid-placeholder": "Placeholder for the field that triggers the Citoid service", + "proveit-citoid-load": "Default text for the button that loads a reference out of a URI through the Citoid service", "proveit-citoid-loading": "Status text while Citoid service is loading the reference details", "proveit-citoid-error": "Generic error message when something went wrong with the Citoid service\n{{Identical|Error}}" } diff --git a/proveit.css b/proveit.css index acf6e5a..d68e7b2 100755 --- a/proveit.css +++ b/proveit.css @@ -31,22 +31,21 @@ #proveit-list-tab, #proveit-add-tab { - color: black; cursor: pointer; display: inline-block; - outline: none; - padding: 15px; + border: 1px solid #ddd; + padding: 12px 30px; + margin-left: 5px; + position: relative; + top: 5px; + border-top-left-radius: 10px; + border-top-right-radius: 10px; } #proveit-list-tab.active, #proveit-add-tab.active { - background: #ccc; -} - -#proveit-list-tab:not(.active):hover, -#proveit-add-tab:not(.active):hover { - display: inline-block; - background: #eee; + background: #f4f4f4; + border-bottom-color: #f4f4f4; } #proveit-content { @@ -146,24 +145,12 @@ resize: vertical; } -#proveit-reference-form .today-button { - background: none; - border: none; +#proveit-reference-table button { cursor: pointer; font: inherit; - padding: .4em; position: absolute; - right: 0; -} - -#proveit-reference-form .today-button:hover { - text-decoration: underline; -} - -#proveit-reference-form .citoid-message { - padding: .4em; - position: absolute; - right: 0; + top: 4px; + right: 4px; } #proveit-footer { @@ -222,12 +209,12 @@ * http://www.webdesignerdepot.com/2012/11/how-to-create-a-simple-css3-tooltip/ */ -label[data-tooltip] { +#proveit [data-tooltip] { display: inline; position: relative; } -label[data-tooltip]:hover:after { +#proveit [data-tooltip]:hover:after { background: #333; background: rgba( 0, 0, 0, .8 ); border-r
[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Add button for running the Citoid script
Sophivorus has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/361694 ) Change subject: Add button for running the Citoid script .. Add button for running the Citoid script Also various CSS changes Change-Id: Ia76f29a79fb83c633eac9aa37d7fe03935d1dca0 --- M i18n/en.json M i18n/es.json M i18n/qqq.json M proveit.css M proveit.js 5 files changed, 66 insertions(+), 61 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikipedia/gadgets/ProveIt refs/changes/94/361694/1 diff --git a/i18n/en.json b/i18n/en.json index 85804a7..8e06286 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -21,9 +21,10 @@ "proveit-filter-references": "Filter references", "proveit-show-all-button": "Show all fields", "proveit-today-button": "Today", - "proveit-citoid-label": "Reference identifier", + "proveit-citoid-label": "Automatic reference", "proveit-citoid-tooltip": "Enter a URL, DOI, ISBN or PMC/PMID to try to extract the details automatically through the Citoid service", "proveit-citoid-placeholder": "URL, DOI, ISBN or PMC/PMID", + "proveit-citoid-load": "Load", "proveit-citoid-loading": "Loading...", "proveit-citoid-error": "Error" } \ No newline at end of file diff --git a/i18n/es.json b/i18n/es.json index 132b2e2..7606ebb 100644 --- a/i18n/es.json +++ b/i18n/es.json @@ -23,9 +23,10 @@ "proveit-filter-references": "Filtrar referencias", "proveit-show-all-button": "Mostrar todos los campos", "proveit-today-button": "Hoy", - "proveit-citoid-label": "Identificador de la referencia", + "proveit-citoid-label": "Referencia automática", "proveit-citoid-tooltip": "Ingresa una URL, DOI, ISBN or PMC/PMID para intentar extraer los detalles automáticamente a través del servicio Citoid", "proveit-citoid-placeholder": "URL, DOI, ISBN o PMC/PMID", + "proveit-citoid-load": "Cargar", "proveit-citoid-loading": "Cargando…", "proveit-citoid-error": "Error" } diff --git a/i18n/qqq.json b/i18n/qqq.json index 54def56..cd37a24 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -24,9 +24,10 @@ "proveit-filter-references": "Placeholder for the input field to filter references", "proveit-show-all-button": "Text for the button that shows all parameter fields", "proveit-today-button": "Text for the button that inserts the current date\n{{Identical|Today}}", - "proveit-citoid-label": "Reference identifier", + "proveit-citoid-label": "Label for the Citoid field", "proveit-citoid-tooltip": "Tooltip for the field that when filled with a reference identifier, triggers the Citoid service to automatically fill in the reference details", "proveit-citoid-placeholder": "Placeholder for the field that triggers the Citoid service", + "proveit-citoid-load": "Default text for the button that loads a reference out of a URI through the Citoid service", "proveit-citoid-loading": "Status text while Citoid service is loading the reference details", "proveit-citoid-error": "Generic error message when something went wrong with the Citoid service\n{{Identical|Error}}" } diff --git a/proveit.css b/proveit.css index acf6e5a..d68e7b2 100755 --- a/proveit.css +++ b/proveit.css @@ -31,22 +31,21 @@ #proveit-list-tab, #proveit-add-tab { - color: black; cursor: pointer; display: inline-block; - outline: none; - padding: 15px; + border: 1px solid #ddd; + padding: 12px 30px; + margin-left: 5px; + position: relative; + top: 5px; + border-top-left-radius: 10px; + border-top-right-radius: 10px; } #proveit-list-tab.active, #proveit-add-tab.active { - background: #ccc; -} - -#proveit-list-tab:not(.active):hover, -#proveit-add-tab:not(.active):hover { - display: inline-block; - background: #eee; + background: #f4f4f4; + border-bottom-color: #f4f4f4; } #proveit-content { @@ -146,24 +145,12 @@ resize: vertical; } -#proveit-reference-form .today-button { - background: none; - border: none; +#proveit-reference-table button { cursor: pointer; font: inherit; - padding: .4em; position: absolute; - right: 0; -} - -#proveit-reference-form .today-button:hover { - text-decoration: underline; -} - -#proveit-reference-form .citoid-message { - padding: .4em; - position: absolute; - right: 0; + top: 4px; + right: 4px; } #proveit-footer { @@ -222,12 +209,12 @@ * http://www.webdesignerdepot.com/2012/11/how-to-create-a-simple-css3-tooltip/ */ -label[data-tooltip] { +#proveit [data-tooltip] { display: inline; position: relative; } -label[data-tooltip]:hover:after { +#proveit [data-tooltip]:hover:after { background: #333; background: rgba( 0,
[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Add first implementation of the Citoid service
Sophivorus has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/357676 ) Change subject: Add first implementation of the Citoid service .. Add first implementation of the Citoid service Also: * Hide all non-filled, optional and deprecated parameters by default * Fix fallback to English when messages on the preferred language aren't available * Minor style fixes Bug T148226 Change-Id: I599bb765c3df222e9912b4d4aca2a23d35e80130 --- M i18n/en.json M i18n/es.json M i18n/qqq.json M proveit.css M proveit.js 5 files changed, 158 insertions(+), 34 deletions(-) Approvals: Sophivorus: Verified; Looks good to me, approved diff --git a/i18n/en.json b/i18n/en.json index 2d86961..85804a7 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -19,5 +19,11 @@ "proveit-no-references": "No references found", "proveit-filter-fields": "Filter fields", "proveit-filter-references": "Filter references", - "proveit-today-button": "Today" + "proveit-show-all-button": "Show all fields", + "proveit-today-button": "Today", + "proveit-citoid-label": "Reference identifier", + "proveit-citoid-tooltip": "Enter a URL, DOI, ISBN or PMC/PMID to try to extract the details automatically through the Citoid service", + "proveit-citoid-placeholder": "URL, DOI, ISBN or PMC/PMID", + "proveit-citoid-loading": "Loading...", + "proveit-citoid-error": "Error" } \ No newline at end of file diff --git a/i18n/es.json b/i18n/es.json index 732a87e..53e1ecc 100644 --- a/i18n/es.json +++ b/i18n/es.json @@ -20,5 +20,11 @@ "proveit-no-references": "No se encontraron referencias", "proveit-filter-fields": "Filtrar campos", "proveit-filter-references": "Filtrar referencias", - "proveit-today-button": "Hoy" + "proveit-show-all-button": "Mostrar todos los campos", + "proveit-today-button": "Hoy", + "proveit-citoid-label": "Identificador de la referencia", + "proveit-citoid-tooltip": "Ingresa una URL, DOI, ISBN or PMC/PMID para intentar extraer los detalles automáticamente a través del servicio Citoid", + "proveit-citoid-placeholder": "URL, DOI, ISBN o PMC/PMID", + "proveit-citoid-loading": "Cargando...", + "proveit-citoid-error": "Error" } diff --git a/i18n/qqq.json b/i18n/qqq.json index bc7cf7b..3631389 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -22,5 +22,11 @@ "proveit-no-references": "Text for when no references are found", "proveit-filter-fields": "Placeholder for the input field to filter parameters", "proveit-filter-references": "Placeholder for the input field to filter references", - "proveit-today-button": "Text for the button that inserts the current date\n{{Identical|Today}}" + "proveit-show-all-button": "Text for the button that shows all parameter fields", + "proveit-today-button": "Text for the button that inserts the current date\n{{Identical|Today}}", + "proveit-citoid-label": "Reference identifier", + "proveit-citoid-tooltip": "Tooltip for the field that when filled with a reference identifier, triggers the Citoid service to automatically fill in the reference details", + "proveit-citoid-placeholder": "Placeholder for the field that triggers the Citoid service", + "proveit-citoid-loading": "Status text while Citoid service is loading the reference details", + "proveit-citoid-error": "Generic error message when something went wrong with the Citoid service" } diff --git a/proveit.css b/proveit.css index 9b8e338..acf6e5a 100755 --- a/proveit.css +++ b/proveit.css @@ -134,6 +134,7 @@ border: 1px solid #ddd; border-radius: 0; box-sizing: border-box; + display: block; font: inherit; outline: none; padding: .4em; @@ -145,7 +146,7 @@ resize: vertical; } -#proveit-reference-form button { +#proveit-reference-form .today-button { background: none; border: none; cursor: pointer; @@ -155,8 +156,14 @@ right: 0; } -#proveit-reference-form button:hover { +#proveit-reference-form .today-button:hover { text-decoration: underline; +} + +#proveit-reference-form .citoid-message { + padding: .4em; + position: absolute; + right: 0; } #proveit-footer { @@ -174,24 +181,40 @@ } #proveit-footer input { + border: 1px solid #ddd; + box-sizing: border-box; + float: left; font: inherit; - padding: .6em; + padding: 9px; pointer-events: all; width: 150px; - float: left; } #proveit-footer button { - border: 1px solid #ccc; + background: #ddd; + border: none; cursor: pointer; font: inherit; - margin: 0 .2em; - padding: .6em; + margin-right: 5px; + padding: 10px; pointer-events: all; } #pr
[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Add first implementation of the Citoid service
Sophivorus has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/357676 ) Change subject: Add first implementation of the Citoid service .. Add first implementation of the Citoid service Also: * Hide all non-filled, optional and deprecated parameters by default * Fix fallback to English when messages on the preferred language aren't available * Minor style fixes Bug T148226 Change-Id: I599bb765c3df222e9912b4d4aca2a23d35e80130 --- M i18n/en.json M i18n/es.json M i18n/qqq.json M proveit.css M proveit.js 5 files changed, 158 insertions(+), 34 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikipedia/gadgets/ProveIt refs/changes/76/357676/1 diff --git a/i18n/en.json b/i18n/en.json index 2d86961..85804a7 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -19,5 +19,11 @@ "proveit-no-references": "No references found", "proveit-filter-fields": "Filter fields", "proveit-filter-references": "Filter references", - "proveit-today-button": "Today" + "proveit-show-all-button": "Show all fields", + "proveit-today-button": "Today", + "proveit-citoid-label": "Reference identifier", + "proveit-citoid-tooltip": "Enter a URL, DOI, ISBN or PMC/PMID to try to extract the details automatically through the Citoid service", + "proveit-citoid-placeholder": "URL, DOI, ISBN or PMC/PMID", + "proveit-citoid-loading": "Loading...", + "proveit-citoid-error": "Error" } \ No newline at end of file diff --git a/i18n/es.json b/i18n/es.json index 732a87e..53e1ecc 100644 --- a/i18n/es.json +++ b/i18n/es.json @@ -20,5 +20,11 @@ "proveit-no-references": "No se encontraron referencias", "proveit-filter-fields": "Filtrar campos", "proveit-filter-references": "Filtrar referencias", - "proveit-today-button": "Hoy" + "proveit-show-all-button": "Mostrar todos los campos", + "proveit-today-button": "Hoy", + "proveit-citoid-label": "Identificador de la referencia", + "proveit-citoid-tooltip": "Ingresa una URL, DOI, ISBN or PMC/PMID para intentar extraer los detalles automáticamente a través del servicio Citoid", + "proveit-citoid-placeholder": "URL, DOI, ISBN o PMC/PMID", + "proveit-citoid-loading": "Cargando...", + "proveit-citoid-error": "Error" } diff --git a/i18n/qqq.json b/i18n/qqq.json index bc7cf7b..3631389 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -22,5 +22,11 @@ "proveit-no-references": "Text for when no references are found", "proveit-filter-fields": "Placeholder for the input field to filter parameters", "proveit-filter-references": "Placeholder for the input field to filter references", - "proveit-today-button": "Text for the button that inserts the current date\n{{Identical|Today}}" + "proveit-show-all-button": "Text for the button that shows all parameter fields", + "proveit-today-button": "Text for the button that inserts the current date\n{{Identical|Today}}", + "proveit-citoid-label": "Reference identifier", + "proveit-citoid-tooltip": "Tooltip for the field that when filled with a reference identifier, triggers the Citoid service to automatically fill in the reference details", + "proveit-citoid-placeholder": "Placeholder for the field that triggers the Citoid service", + "proveit-citoid-loading": "Status text while Citoid service is loading the reference details", + "proveit-citoid-error": "Generic error message when something went wrong with the Citoid service" } diff --git a/proveit.css b/proveit.css index 9b8e338..acf6e5a 100755 --- a/proveit.css +++ b/proveit.css @@ -134,6 +134,7 @@ border: 1px solid #ddd; border-radius: 0; box-sizing: border-box; + display: block; font: inherit; outline: none; padding: .4em; @@ -145,7 +146,7 @@ resize: vertical; } -#proveit-reference-form button { +#proveit-reference-form .today-button { background: none; border: none; cursor: pointer; @@ -155,8 +156,14 @@ right: 0; } -#proveit-reference-form button:hover { +#proveit-reference-form .today-button:hover { text-decoration: underline; +} + +#proveit-reference-form .citoid-message { + padding: .4em; + position: absolute; + right: 0; } #proveit-footer { @@ -174,24 +181,40 @@ } #proveit-footer input { + border: 1px solid #ddd; + box-sizing: border-box; + float: left; font: inherit; - padding: .6em; + padding: 9px; pointer-events: all; width: 150px; - float: left; } #proveit-footer button { - border: 1px solid #ccc; + background: #ddd; + border: none; cursor: pointer; font: inherit; - margin: 0 .2em; - padding: .6em; + margin-right: 5px; + padding: 10px; point
[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Add Today button on date fields to insert the current date
Sophivorus has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/355907 ) Change subject: Add Today button on date fields to insert the current date .. Add Today button on date fields to insert the current date Bug: T148233 Change-Id: Id2804594693750895dda6f6324517638fe6c4c79 --- M i18n/en.json M i18n/es.json M i18n/qqq.json M proveit.css M proveit.js 5 files changed, 37 insertions(+), 13 deletions(-) Approvals: Sophivorus: Verified; Looks good to me, approved diff --git a/i18n/en.json b/i18n/en.json index 0c68e55..2d86961 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -18,5 +18,6 @@ "proveit-no-template": "No template", "proveit-no-references": "No references found", "proveit-filter-fields": "Filter fields", - "proveit-filter-references": "Filter references" + "proveit-filter-references": "Filter references", + "proveit-today-button": "Today" } \ No newline at end of file diff --git a/i18n/es.json b/i18n/es.json index 5c7de16..732a87e 100644 --- a/i18n/es.json +++ b/i18n/es.json @@ -19,5 +19,6 @@ "proveit-no-template": "Sin plantilla", "proveit-no-references": "No se encontraron referencias", "proveit-filter-fields": "Filtrar campos", - "proveit-filter-references": "Filtrar referencias" + "proveit-filter-references": "Filtrar referencias", + "proveit-today-button": "Hoy" } diff --git a/i18n/qqq.json b/i18n/qqq.json index 0c626b6..2314d91 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -21,5 +21,6 @@ "proveit-no-template": "Text for the dropdown option corresponding to the references without a template", "proveit-no-references": "Text for when no references are found", "proveit-filter-fields": "Placeholder for the input field to filter parameters", - "proveit-filter-references": "Placeholder for the input field to filter references" + "proveit-filter-references": "Placeholder for the input field to filter references", + "proveit-today-button": "Text for the button that inserts the current date" } diff --git a/proveit.css b/proveit.css index 535f071..9b8e338 100755 --- a/proveit.css +++ b/proveit.css @@ -108,6 +108,10 @@ width: 100%; } +#proveit-reference-form td { + position: relative; +} + #proveit-reference-form td:first-child { width: 150px; padding-left: 5px; @@ -141,6 +145,20 @@ resize: vertical; } +#proveit-reference-form button { + background: none; + border: none; + cursor: pointer; + font: inherit; + padding: .4em; + position: absolute; + right: 0; +} + +#proveit-reference-form button:hover { + text-decoration: underline; +} + #proveit-footer { background: #f0f0f0; border-spacing: 0; diff --git a/proveit.js b/proveit.js index 98a63a9..3319fd0 100755 --- a/proveit.js +++ b/proveit.js @@ -1051,16 +1051,6 @@ paramLabel = paramData.label[ proveit.contentLanguage ]; } - // If the parameter is a date, put the current date as a placeholder - // @todo find a better solution - if ( paramData.type === 'date' ) { - var date = new Date(), - = date.getFullYear(), - mm = ( '0' + ( date.getMonth() + 1 ) ).slice( -2 ), - dd = ( '0' + date.getDate() ).slice( -2 ); - paramPlaceholder = + '-' + mm + '-' + dd; - } - if ( paramData.description ) { paramDescription = paramData.description[ proveit.contentLanguage ]; } @@ -1094,6 +1084,19 @@ paramValueColumn = $( '' ).append( paramValueInput ); row = $( '' ).addClass( 'proveit-param-pair' ).append( paramNameColumn, paramValueColumn ); + // If the parameter is a date, add the Today button + if ( paramData.type === 'date' ) { + todayButton = $( '' ).text( 'Today' ).click( paramValueInput, function ( event ) { + var paramValueInput = event.data, + date = new Date(), + = date.getFullYear(), + mm = ( '0' + ( date.getMonth() + 1 ) ).slice( -2 ), + dd = ( '0' + date.getDate() ).slice(
[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Add Today button on date fields to insert the current date
Sophivorus has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/355907 ) Change subject: Add Today button on date fields to insert the current date .. Add Today button on date fields to insert the current date Bug: T148233 Change-Id: Id2804594693750895dda6f6324517638fe6c4c79 --- M i18n/en.json M i18n/es.json M i18n/qqq.json M proveit.css M proveit.js 5 files changed, 37 insertions(+), 13 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikipedia/gadgets/ProveIt refs/changes/07/355907/1 diff --git a/i18n/en.json b/i18n/en.json index 0c68e55..2d86961 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -18,5 +18,6 @@ "proveit-no-template": "No template", "proveit-no-references": "No references found", "proveit-filter-fields": "Filter fields", - "proveit-filter-references": "Filter references" + "proveit-filter-references": "Filter references", + "proveit-today-button": "Today" } \ No newline at end of file diff --git a/i18n/es.json b/i18n/es.json index 5c7de16..732a87e 100644 --- a/i18n/es.json +++ b/i18n/es.json @@ -19,5 +19,6 @@ "proveit-no-template": "Sin plantilla", "proveit-no-references": "No se encontraron referencias", "proveit-filter-fields": "Filtrar campos", - "proveit-filter-references": "Filtrar referencias" + "proveit-filter-references": "Filtrar referencias", + "proveit-today-button": "Hoy" } diff --git a/i18n/qqq.json b/i18n/qqq.json index 0c626b6..2314d91 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -21,5 +21,6 @@ "proveit-no-template": "Text for the dropdown option corresponding to the references without a template", "proveit-no-references": "Text for when no references are found", "proveit-filter-fields": "Placeholder for the input field to filter parameters", - "proveit-filter-references": "Placeholder for the input field to filter references" + "proveit-filter-references": "Placeholder for the input field to filter references", + "proveit-today-button": "Text for the button that inserts the current date" } diff --git a/proveit.css b/proveit.css index 535f071..9b8e338 100755 --- a/proveit.css +++ b/proveit.css @@ -108,6 +108,10 @@ width: 100%; } +#proveit-reference-form td { + position: relative; +} + #proveit-reference-form td:first-child { width: 150px; padding-left: 5px; @@ -141,6 +145,20 @@ resize: vertical; } +#proveit-reference-form button { + background: none; + border: none; + cursor: pointer; + font: inherit; + padding: .4em; + position: absolute; + right: 0; +} + +#proveit-reference-form button:hover { + text-decoration: underline; +} + #proveit-footer { background: #f0f0f0; border-spacing: 0; diff --git a/proveit.js b/proveit.js index 98a63a9..3319fd0 100755 --- a/proveit.js +++ b/proveit.js @@ -1051,16 +1051,6 @@ paramLabel = paramData.label[ proveit.contentLanguage ]; } - // If the parameter is a date, put the current date as a placeholder - // @todo find a better solution - if ( paramData.type === 'date' ) { - var date = new Date(), - = date.getFullYear(), - mm = ( '0' + ( date.getMonth() + 1 ) ).slice( -2 ), - dd = ( '0' + date.getDate() ).slice( -2 ); - paramPlaceholder = + '-' + mm + '-' + dd; - } - if ( paramData.description ) { paramDescription = paramData.description[ proveit.contentLanguage ]; } @@ -1094,6 +1084,19 @@ paramValueColumn = $( '' ).append( paramValueInput ); row = $( '' ).addClass( 'proveit-param-pair' ).append( paramNameColumn, paramValueColumn ); + // If the parameter is a date, add the Today button + if ( paramData.type === 'date' ) { + todayButton = $( '' ).text( 'Today' ).click( paramValueInput, function ( event ) { + var paramValueInput = event.data, + date = new Date(), + = date.getFullYear(), + mm = ( '0' + ( date.getMonth() + 1 ) ).slice( -2 ), + dd = ( '0' +
[MediaWiki-commits] [Gerrit] mediawiki...LabeledSectionTransclusion[master]: Properly transclude sections inside extension tags
Sophivorus has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/355772 ) Change subject: Properly transclude sections inside extension tags .. Properly transclude sections inside extension tags And add the corresponding parser tests Bug: T163411 Change-Id: I83086ca955f24c1e204fb29f410f90f4c1627afd --- M .gitignore M LabeledSectionTransclusion.class.php M lstParserTests.txt 3 files changed, 85 insertions(+), 10 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/LabeledSectionTransclusion refs/changes/72/355772/1 diff --git a/.gitignore b/.gitignore index e65c3c5..4b6be4a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +.DS_Store .svn *~ *.kate-swp diff --git a/LabeledSectionTransclusion.class.php b/LabeledSectionTransclusion.class.php index 13265c1..9e21847 100644 --- a/LabeledSectionTransclusion.class.php +++ b/LabeledSectionTransclusion.class.php @@ -377,18 +377,30 @@ if ( $begin != '' ) { // Find the begin node $found = false; - for ( ; $node; $node = $node->getNextSibling() ) { - if ( $node->getName() != 'ext' ) { - continue; - } - $parts = $node->splitExt(); - $parts = array_map( [ $newFrame, 'expand' ], $parts ); - if ( self::isSection( $parts['name'] ) ) { - if ( preg_match( $beginRegex, $parts['attr'] ) ) { - $found = true; - break; + $queue = [ $node ]; + while ( $queue ) { + $node = array_shift( $queue ); + if ( $node->getName() === 'ext' ) { + $parts = $node->splitExt(); + $parts = array_map( [ $newFrame, 'expand' ], $parts ); + if ( self::isSection( $parts['name'] ) ) { + if ( preg_match( $beginRegex, $parts['attr'] ) ) { + $found = true; + break; + } + } else { + // If we're in an extension tag (such as or ), add the 'ext' nodes inside to the queue + $dom = $parser->preprocessToDom( $parts['inner'] ); + foreach ( $dom->getChildrenOfType( 'ext' )->node as $child ) { + $child = new PPNode_DOM( $child ); + $queue[] = $child; + } } } + $next = $node->getNextSibling(); + if ( $next ) { + $queue[] = $next; + } } if ( !$found || !$node ) { break; diff --git a/lstParserTests.txt b/lstParserTests.txt index 0df6aaf..313da5b 100644 --- a/lstParserTests.txt +++ b/lstParserTests.txt @@ -536,3 +536,65 @@ sec a !!end + +# Article with an extension tag +!! article +Tag +!! text +tag +!! endarticle + +!! test +LST: Transclude an extension tag +!! input +{{#lst:Tag|tag}} +!! result + +'tag' +array ( +) + + +!! end + +!! test +LST: Transclude only the content of an extension tag +!! input +{{#lst:Tag|content}} +!! result +tag + +!! end + +# Article with a nested extension tag +!! article +Nested +!! text +a + + tag + + +!! endarticle + +!! test +LST: Transclude a nested tag +!! input +{{#lst:Nested|tag}} +!! result + +'tag' +array ( +) + + +!! end + +!! test +LST: Transclude only the content of a nested extension tag +!! input +{{#lst:Nested|content}} +!! result +tag + +!! end \ No newline at end of file -- To view, visit https://gerrit.wikimedia.org/r/355772 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I83086ca955f24c1e204fb29f410f90f4c1627afd Gerrit
[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Add field to filter references
Sophivorus has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/353180 ) Change subject: Add field to filter references .. Add field to filter references Bug: T148227 Change-Id: I1eba4d8a8cd213c9d5abf5a78dd105248e35a9a7 --- M README.md M i18n/ast.json M i18n/be-tarask.json M i18n/bg.json M i18n/bn.json M i18n/br.json M i18n/bs.json M i18n/de.json M i18n/en.json M i18n/es.json M i18n/et.json M i18n/eu.json M i18n/fr.json M i18n/gl.json M i18n/it.json M i18n/ja.json M i18n/ko.json M i18n/lb.json M i18n/mg.json M i18n/mk.json M i18n/pa.json M i18n/qqq.json M i18n/ru.json M i18n/sr-ec.json M i18n/sv.json M i18n/zh-hans.json M i18n/zh-hant.json M proveit.css M proveit.js 29 files changed, 65 insertions(+), 43 deletions(-) Approvals: Sophivorus: Verified; Looks good to me, approved diff --git a/README.md b/README.md index fb1c206..1814a7e 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # ProveIt -ProveIt is powerful reference manager for Wikipedia +ProveIt is powerful reference manager for MediaWiki Documentation at https://commons.wikimedia.org/wiki/Help:Gadget-ProveIt \ No newline at end of file diff --git a/i18n/ast.json b/i18n/ast.json index e4e7a8e..e0abc07 100644 --- a/i18n/ast.json +++ b/i18n/ast.json @@ -17,5 +17,5 @@ "proveit-confirm-remove": "Esto desaniciará la referencia y toles cites que tenga. ¿Tas seguru?", "proveit-no-template": "Sin plantía", "proveit-no-references": "Nun s'alcontraron referencies", - "proveit-filter-field": "Filtrar campos" + "proveit-filter-fields": "Filtrar campos" } diff --git a/i18n/be-tarask.json b/i18n/be-tarask.json index e912c63..ea1fcc7 100644 --- a/i18n/be-tarask.json +++ b/i18n/be-tarask.json @@ -17,5 +17,5 @@ "proveit-confirm-remove": "Гэта выдаліць крыніцу і ўсе яе цытаты. Вы ўпэўненыя?", "proveit-no-template": "Няма шаблёну", "proveit-no-references": "Крыніцы ня знойдзеныя", - "proveit-filter-field": "Фільтар палёў" + "proveit-filter-fields": "Фільтар палёў" } diff --git a/i18n/bg.json b/i18n/bg.json index 13cd37e..eab111b 100644 --- a/i18n/bg.json +++ b/i18n/bg.json @@ -18,5 +18,5 @@ "proveit-confirm-remove": "Това ще премахне източникът и всички негови цитирания. Сигурни ли сте?", "proveit-no-template": "Няма шаблон", "proveit-no-references": "Не са намерени източници", - "proveit-filter-field": "Филтър на полета" + "proveit-filter-fields": "Филтър на полета" } diff --git a/i18n/bn.json b/i18n/bn.json index ba7f874..90a9418 100644 --- a/i18n/bn.json +++ b/i18n/bn.json @@ -17,5 +17,5 @@ "proveit-confirm-remove": "এটি এই তথ্যসূত্রটি এবং এর থেকে দেয়া সব উদ্ধৃতিদান সরিয়ে ফেলবে। আপনি কি নিশ্চিত?", "proveit-no-template": "কোন টেমপ্লেট নেই", "proveit-no-references": "কোন তথ্যসূত্র পাওয়া যায়নি", - "proveit-filter-field": "ক্ষেত্র ছাঁকুন" + "proveit-filter-fields": "ক্ষেত্র ছাঁকুন" } diff --git a/i18n/br.json b/i18n/br.json index 988a11b..0ebfc2e 100644 --- a/i18n/br.json +++ b/i18n/br.json @@ -17,5 +17,5 @@ "proveit-confirm-remove": "Dilemel a raio an daveenn hag an holl arroudennoù. Sur oc'h ?", "proveit-no-template": "Patrom ebet", "proveit-no-references": "N'eus bet kavet daveenn ebet", - "proveit-filter-field": "Maeziennoù ar sil" + "proveit-filter-fields": "Maeziennoù ar sil" } diff --git a/i18n/bs.json b/i18n/bs.json index f97f950..2d2dd66 100644 --- a/i18n/bs.json +++ b/i18n/bs.json @@ -17,5 +17,5 @@ "proveit-confirm-remove": "Ovim će se ukloniti referenca i svi njene navodi. Jeste li sigurni?", "proveit-no-template": "Nema šablona", "proveit-no-references": "Nisu pronađene reference", - "proveit-filter-field": "Filtriraj polja" + "proveit-filter-fields": "Filtriraj polja" } diff --git a/i18n/de.json b/i18n/de.json index 68c29dd..bab3f18 100644 --- a/i18n/de.json +++ b/i18n/de.json @@ -18,5 +18,5 @@ "proveit-confirm-remove": "Dies wird den Einzelnachweis und all seine Zitate entfernen. Bist du sicher?", "proveit-no-template": "Keine Vorlage", "proveit-no-references": "Keine Einzelnachweise gefunden", - "proveit-filter-field": "Felder filtern" + "proveit-filter-fields": "Felder filtern" } diff --git a/i18n/en.json b/i18n/en.json index f2903c8..0c68e55 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -17,5 +17,6 @@ "proveit-confirm-remove": "This will remove the reference and all of its citations. Are you sure?", "proveit-no-template": "No template", "proveit-no-references": "No references found", - "proveit-filter-field": "Filter fields" + "proveit-filter-fields": "Filter fields", + "proveit-filter-references": "Filter references" } \ No newline at end of file diff --git a/i18n/es.json b/i18n/es.json index 8823f73..5c7de16 100644 --- a/i18n/e
[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Add field to filter references
Sophivorus has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/353180 ) Change subject: Add field to filter references .. Add field to filter references Bug: T148227 Change-Id: I1eba4d8a8cd213c9d5abf5a78dd105248e35a9a7 --- M README.md M i18n/ast.json M i18n/be-tarask.json M i18n/bg.json M i18n/bn.json M i18n/br.json M i18n/bs.json M i18n/de.json M i18n/en.json M i18n/es.json M i18n/et.json M i18n/eu.json M i18n/fr.json M i18n/gl.json M i18n/it.json M i18n/ja.json M i18n/ko.json M i18n/lb.json M i18n/mg.json M i18n/mk.json M i18n/pa.json M i18n/qqq.json M i18n/ru.json M i18n/sr-ec.json M i18n/sv.json M i18n/zh-hans.json M i18n/zh-hant.json M proveit.css M proveit.js 29 files changed, 65 insertions(+), 43 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikipedia/gadgets/ProveIt refs/changes/80/353180/1 diff --git a/README.md b/README.md index fb1c206..1814a7e 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # ProveIt -ProveIt is powerful reference manager for Wikipedia +ProveIt is powerful reference manager for MediaWiki Documentation at https://commons.wikimedia.org/wiki/Help:Gadget-ProveIt \ No newline at end of file diff --git a/i18n/ast.json b/i18n/ast.json index e4e7a8e..e0abc07 100644 --- a/i18n/ast.json +++ b/i18n/ast.json @@ -17,5 +17,5 @@ "proveit-confirm-remove": "Esto desaniciará la referencia y toles cites que tenga. ¿Tas seguru?", "proveit-no-template": "Sin plantía", "proveit-no-references": "Nun s'alcontraron referencies", - "proveit-filter-field": "Filtrar campos" + "proveit-filter-fields": "Filtrar campos" } diff --git a/i18n/be-tarask.json b/i18n/be-tarask.json index e912c63..ea1fcc7 100644 --- a/i18n/be-tarask.json +++ b/i18n/be-tarask.json @@ -17,5 +17,5 @@ "proveit-confirm-remove": "Гэта выдаліць крыніцу і ўсе яе цытаты. Вы ўпэўненыя?", "proveit-no-template": "Няма шаблёну", "proveit-no-references": "Крыніцы ня знойдзеныя", - "proveit-filter-field": "Фільтар палёў" + "proveit-filter-fields": "Фільтар палёў" } diff --git a/i18n/bg.json b/i18n/bg.json index 13cd37e..eab111b 100644 --- a/i18n/bg.json +++ b/i18n/bg.json @@ -18,5 +18,5 @@ "proveit-confirm-remove": "Това ще премахне източникът и всички негови цитирания. Сигурни ли сте?", "proveit-no-template": "Няма шаблон", "proveit-no-references": "Не са намерени източници", - "proveit-filter-field": "Филтър на полета" + "proveit-filter-fields": "Филтър на полета" } diff --git a/i18n/bn.json b/i18n/bn.json index ba7f874..90a9418 100644 --- a/i18n/bn.json +++ b/i18n/bn.json @@ -17,5 +17,5 @@ "proveit-confirm-remove": "এটি এই তথ্যসূত্রটি এবং এর থেকে দেয়া সব উদ্ধৃতিদান সরিয়ে ফেলবে। আপনি কি নিশ্চিত?", "proveit-no-template": "কোন টেমপ্লেট নেই", "proveit-no-references": "কোন তথ্যসূত্র পাওয়া যায়নি", - "proveit-filter-field": "ক্ষেত্র ছাঁকুন" + "proveit-filter-fields": "ক্ষেত্র ছাঁকুন" } diff --git a/i18n/br.json b/i18n/br.json index 988a11b..0ebfc2e 100644 --- a/i18n/br.json +++ b/i18n/br.json @@ -17,5 +17,5 @@ "proveit-confirm-remove": "Dilemel a raio an daveenn hag an holl arroudennoù. Sur oc'h ?", "proveit-no-template": "Patrom ebet", "proveit-no-references": "N'eus bet kavet daveenn ebet", - "proveit-filter-field": "Maeziennoù ar sil" + "proveit-filter-fields": "Maeziennoù ar sil" } diff --git a/i18n/bs.json b/i18n/bs.json index f97f950..2d2dd66 100644 --- a/i18n/bs.json +++ b/i18n/bs.json @@ -17,5 +17,5 @@ "proveit-confirm-remove": "Ovim će se ukloniti referenca i svi njene navodi. Jeste li sigurni?", "proveit-no-template": "Nema šablona", "proveit-no-references": "Nisu pronađene reference", - "proveit-filter-field": "Filtriraj polja" + "proveit-filter-fields": "Filtriraj polja" } diff --git a/i18n/de.json b/i18n/de.json index 68c29dd..bab3f18 100644 --- a/i18n/de.json +++ b/i18n/de.json @@ -18,5 +18,5 @@ "proveit-confirm-remove": "Dies wird den Einzelnachweis und all seine Zitate entfernen. Bist du sicher?", "proveit-no-template": "Keine Vorlage", "proveit-no-references": "Keine Einzelnachweise gefunden", - "proveit-filter-field": "Felder filtern" + "proveit-filter-fields": "Felder filtern" } diff --git a/i18n/en.json b/i18n/en.json index f2903c8..0c68e55 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -17,5 +17,6 @@ "proveit-confirm-remove": "This will remove the reference and all of its citations. Are you sure?", "proveit-no-template": "No template", "proveit-no-references": "No references found", - "proveit-filter-field": "Filter fields" + "proveit-filter-fields": "Filter fields", + "proveit-filter-references": "Filter references" } \ No newline at end of file diff --git a/i18n/es.json b/i18n/es.json index 8823f73..5c
[MediaWiki-commits] [Gerrit] mediawiki...MsWikiEditor[master]: Replace email icon for the right one
Sophivorus has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/352065 ) Change subject: Replace email icon for the right one .. Replace email icon for the right one Change-Id: If13188ba1270c792a1df79f53513280671d9470e --- M images/email.png 1 file changed, 0 insertions(+), 0 deletions(-) Approvals: Sophivorus: Verified; Looks good to me, approved diff --git a/images/email.png b/images/email.png index 3e9b843..b188a4c 100644 --- a/images/email.png +++ b/images/email.png Binary files differ -- To view, visit https://gerrit.wikimedia.org/r/352065 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: If13188ba1270c792a1df79f53513280671d9470e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MsWikiEditor Gerrit-Branch: master Gerrit-Owner: Sophivorus Gerrit-Reviewer: Sophivorus ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...MsWikiEditor[master]: Replace email icon for the right one
Sophivorus has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/352065 ) Change subject: Replace email icon for the right one .. Replace email icon for the right one Change-Id: If13188ba1270c792a1df79f53513280671d9470e --- M images/email.png 1 file changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MsWikiEditor refs/changes/65/352065/1 diff --git a/images/email.png b/images/email.png index 3e9b843..b188a4c 100644 --- a/images/email.png +++ b/images/email.png Binary files differ -- To view, visit https://gerrit.wikimedia.org/r/352065 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If13188ba1270c792a1df79f53513280671d9470e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MsWikiEditor Gerrit-Branch: master Gerrit-Owner: Sophivorus ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Make sure the dependencies are loaded
Sophivorus has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/351117 ) Change subject: Make sure the dependencies are loaded .. Make sure the dependencies are loaded Don't init ProveIt until all the dependencies are loaded Also minor comment update And update of my username Change-Id: Ib0ce8079c62ddc327c2ec19195081429837202e7 --- M README.md M i18n/de.json M i18n/en.json M i18n/es.json M i18n/it.json M i18n/pt.json M i18n/qqq.json M proveit.js 8 files changed, 31 insertions(+), 26 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikipedia/gadgets/ProveIt refs/changes/17/351117/1 diff --git a/README.md b/README.md index d615074..fb1c206 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # ProveIt -ProveIt is a Wikipedia gadget that makes it easy to find, edit, add and delete references when editing articles. +ProveIt is powerful reference manager for Wikipedia Documentation at https://commons.wikimedia.org/wiki/Help:Gadget-ProveIt \ No newline at end of file diff --git a/i18n/de.json b/i18n/de.json index 0c2d9a3..68c29dd 100644 --- a/i18n/de.json +++ b/i18n/de.json @@ -1,7 +1,7 @@ { "@metadata": { "authors": [ - "Felipe Schenone", + "Sophivorus", "Metalhead64" ] }, diff --git a/i18n/en.json b/i18n/en.json index 9680617..f2903c8 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -1,7 +1,7 @@ { "@metadata": { "authors": [ - "Felipe Schenone" + "Sophivorus" ] }, "proveit-list-tab": "List ($1)", diff --git a/i18n/es.json b/i18n/es.json index c076ed1..8823f73 100644 --- a/i18n/es.json +++ b/i18n/es.json @@ -1,7 +1,7 @@ { "@metadata": { "authors": [ - "Felipe Schenone", + "Sophivorus", "Macofe" ] }, diff --git a/i18n/it.json b/i18n/it.json index 44b4867..ca6c868 100644 --- a/i18n/it.json +++ b/i18n/it.json @@ -1,7 +1,7 @@ { "@metadata": { "authors": [ - "Felipe Schenone", + "Sophivorus", "Beta16" ] }, diff --git a/i18n/pt.json b/i18n/pt.json index c3531df..efc86f1 100644 --- a/i18n/pt.json +++ b/i18n/pt.json @@ -1,7 +1,7 @@ { "@metadata": { "authors": [ - "Felipe Schenone", + "Sophivorus", "He7d3r" ] }, diff --git a/i18n/qqq.json b/i18n/qqq.json index 87a0a46..dc0dae2 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -1,7 +1,7 @@ { "@metadata": { "authors": [ - "Felipe Schenone", + "Sophivorus", "Liuxinyu970226", "Robby" ] diff --git a/proveit.js b/proveit.js index fe3818a..d845724 100755 --- a/proveit.js +++ b/proveit.js @@ -1,10 +1,10 @@ /** - * ProveIt is a Wikipedia gadget that makes it easy to find, edit, add and delete references when editing articles. + * ProveIt is a powerful reference manager for Wikipedia * Documentation at https://commons.wikimedia.org/wiki/Help:Gadget-ProveIt * * Copyright 2008-2011 Georgia Tech Research Corporation, Atlanta, GA 30332-0415, ALL RIGHTS RESERVED * Copyright 2011- Matthew Flaschen - * Rewritten, internationalized, enhanced and maintained by Felipe Schenone since 2014 + * Rewritten, internationalized, enhanced and maintained by Sophivorus since 2014 * * ProveIt is available under the GNU Free Documentation License (http://www.gnu.org/copyleft/fdl.html), * the Creative Commons Attribution/Share-Alike License 3.0 (http://creativecommons.org/licenses/by-sa/3.0/), @@ -204,20 +204,18 @@ // Make the GUI draggable var dragged = false; - mw.loader.using( 'jquery.ui.draggable' ).then( function () { - gui.draggable({ - handle: header, - containment: 'window', - start: function ( event ) { - if ( event.originalEvent.target.id !== 'proveit-header' ) { - dragged = true; - } - gui.css({ - 'right': 'auto', - 'bottom': 'auto' - }); + gui.draggable({ + handle: header, + containment: 'window', + start: function ( event ) { +
[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Make sure the dependencies are loaded
Sophivorus has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/351117 ) Change subject: Make sure the dependencies are loaded .. Make sure the dependencies are loaded Don't init ProveIt until all the dependencies are loaded Also minor comment update And update of my username Change-Id: Ib0ce8079c62ddc327c2ec19195081429837202e7 --- M README.md M i18n/de.json M i18n/en.json M i18n/es.json M i18n/it.json M i18n/pt.json M i18n/qqq.json M proveit.js 8 files changed, 31 insertions(+), 26 deletions(-) Approvals: Sophivorus: Verified; Looks good to me, approved diff --git a/README.md b/README.md index d615074..fb1c206 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # ProveIt -ProveIt is a Wikipedia gadget that makes it easy to find, edit, add and delete references when editing articles. +ProveIt is powerful reference manager for Wikipedia Documentation at https://commons.wikimedia.org/wiki/Help:Gadget-ProveIt \ No newline at end of file diff --git a/i18n/de.json b/i18n/de.json index 0c2d9a3..68c29dd 100644 --- a/i18n/de.json +++ b/i18n/de.json @@ -1,7 +1,7 @@ { "@metadata": { "authors": [ - "Felipe Schenone", + "Sophivorus", "Metalhead64" ] }, diff --git a/i18n/en.json b/i18n/en.json index 9680617..f2903c8 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -1,7 +1,7 @@ { "@metadata": { "authors": [ - "Felipe Schenone" + "Sophivorus" ] }, "proveit-list-tab": "List ($1)", diff --git a/i18n/es.json b/i18n/es.json index c076ed1..8823f73 100644 --- a/i18n/es.json +++ b/i18n/es.json @@ -1,7 +1,7 @@ { "@metadata": { "authors": [ - "Felipe Schenone", + "Sophivorus", "Macofe" ] }, diff --git a/i18n/it.json b/i18n/it.json index 44b4867..ca6c868 100644 --- a/i18n/it.json +++ b/i18n/it.json @@ -1,7 +1,7 @@ { "@metadata": { "authors": [ - "Felipe Schenone", + "Sophivorus", "Beta16" ] }, diff --git a/i18n/pt.json b/i18n/pt.json index c3531df..efc86f1 100644 --- a/i18n/pt.json +++ b/i18n/pt.json @@ -1,7 +1,7 @@ { "@metadata": { "authors": [ - "Felipe Schenone", + "Sophivorus", "He7d3r" ] }, diff --git a/i18n/qqq.json b/i18n/qqq.json index 87a0a46..dc0dae2 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -1,7 +1,7 @@ { "@metadata": { "authors": [ - "Felipe Schenone", + "Sophivorus", "Liuxinyu970226", "Robby" ] diff --git a/proveit.js b/proveit.js index fe3818a..d845724 100755 --- a/proveit.js +++ b/proveit.js @@ -1,10 +1,10 @@ /** - * ProveIt is a Wikipedia gadget that makes it easy to find, edit, add and delete references when editing articles. + * ProveIt is a powerful reference manager for Wikipedia * Documentation at https://commons.wikimedia.org/wiki/Help:Gadget-ProveIt * * Copyright 2008-2011 Georgia Tech Research Corporation, Atlanta, GA 30332-0415, ALL RIGHTS RESERVED * Copyright 2011- Matthew Flaschen - * Rewritten, internationalized, enhanced and maintained by Felipe Schenone since 2014 + * Rewritten, internationalized, enhanced and maintained by Sophivorus since 2014 * * ProveIt is available under the GNU Free Documentation License (http://www.gnu.org/copyleft/fdl.html), * the Creative Commons Attribution/Share-Alike License 3.0 (http://creativecommons.org/licenses/by-sa/3.0/), @@ -204,20 +204,18 @@ // Make the GUI draggable var dragged = false; - mw.loader.using( 'jquery.ui.draggable' ).then( function () { - gui.draggable({ - handle: header, - containment: 'window', - start: function ( event ) { - if ( event.originalEvent.target.id !== 'proveit-header' ) { - dragged = true; - } - gui.css({ - 'right': 'auto', - 'bottom': 'auto' - }); + gui.draggable({ + handle: header, + containment: 'window', + start: function ( event ) { + if ( event.original
[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Make sure wikiEditor is loaded
Sophivorus has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/351116 ) Change subject: Make sure wikiEditor is loaded .. Make sure wikiEditor is loaded Per a bug reported by a user on my talk page Change-Id: If284169888ebdcede94c0f356692cc7382fb2feb --- M proveit.js 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/wikipedia/gadgets/ProveIt refs/changes/16/351116/1 diff --git a/proveit.js b/proveit.js index 510d22c..fe3818a 100755 --- a/proveit.js +++ b/proveit.js @@ -127,7 +127,7 @@ // Replace the Reference button for the ProveIt button in the new toolbar if ( mw.user.options.get( 'usebetatoolbar' ) === 1 ) { - proveit.getTextbox().on( 'wikiEditor-toolbar-doneInitialSections', function () { + mw.loader.using( 'ext.wikiEditor.toolbar', function () { proveit.getTextbox().wikiEditor( 'removeFromToolbar', { 'section': 'main', 'group': 'insert', -- To view, visit https://gerrit.wikimedia.org/r/351116 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If284169888ebdcede94c0f356692cc7382fb2feb Gerrit-PatchSet: 1 Gerrit-Project: wikipedia/gadgets/ProveIt Gerrit-Branch: master Gerrit-Owner: Sophivorus ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Make sure wikiEditor is loaded
Sophivorus has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/351116 ) Change subject: Make sure wikiEditor is loaded .. Make sure wikiEditor is loaded Per a bug reported by a user on my talk page Change-Id: If284169888ebdcede94c0f356692cc7382fb2feb --- M proveit.js 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Sophivorus: Verified; Looks good to me, approved diff --git a/proveit.js b/proveit.js index 510d22c..fe3818a 100755 --- a/proveit.js +++ b/proveit.js @@ -127,7 +127,7 @@ // Replace the Reference button for the ProveIt button in the new toolbar if ( mw.user.options.get( 'usebetatoolbar' ) === 1 ) { - proveit.getTextbox().on( 'wikiEditor-toolbar-doneInitialSections', function () { + mw.loader.using( 'ext.wikiEditor.toolbar', function () { proveit.getTextbox().wikiEditor( 'removeFromToolbar', { 'section': 'main', 'group': 'insert', -- To view, visit https://gerrit.wikimedia.org/r/351116 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: If284169888ebdcede94c0f356692cc7382fb2feb Gerrit-PatchSet: 1 Gerrit-Project: wikipedia/gadgets/ProveIt Gerrit-Branch: master Gerrit-Owner: Sophivorus Gerrit-Reviewer: Sophivorus ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Put a couple of checks in place
Sophivorus has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/351115 ) Change subject: Put a couple of checks in place .. Put a couple of checks in place Bug: T163563 Change-Id: I29d18d2fd565cd1a861d3a65c1d31a2b33e0ead2 --- M proveit.js 1 file changed, 33 insertions(+), 29 deletions(-) Approvals: Sophivorus: Verified; Looks good to me, approved diff --git a/proveit.js b/proveit.js index ac2c768..510d22c 100755 --- a/proveit.js +++ b/proveit.js @@ -127,27 +127,29 @@ // Replace the Reference button for the ProveIt button in the new toolbar if ( mw.user.options.get( 'usebetatoolbar' ) === 1 ) { - proveit.getTextbox().wikiEditor( 'removeFromToolbar', { - 'section': 'main', - 'group': 'insert', - 'tool': 'reference' - }); - proveit.getTextbox().wikiEditor( 'addToToolbar', { - 'section': 'main', - 'group': 'insert', - 'tools': { - 'proveit': { - 'label': 'ProveIt', - 'type': 'button', - 'icon': proveit.ICON, - 'action': { - 'type': 'callback', - 'execute': function () { - $( '#proveit' ).toggle(); + proveit.getTextbox().on( 'wikiEditor-toolbar-doneInitialSections', function () { + proveit.getTextbox().wikiEditor( 'removeFromToolbar', { + 'section': 'main', + 'group': 'insert', + 'tool': 'reference' + }); + proveit.getTextbox().wikiEditor( 'addToToolbar', { + 'section': 'main', + 'group': 'insert', + 'tools': { + 'proveit': { + 'label': 'ProveIt', + 'type': 'button', + 'icon': proveit.ICON, + 'action': { + 'type': 'callback', + 'execute': function () { + $( '#proveit' ).toggle(); + } } } } - } + }); }); // Add the ProveIt button in the old toolbar } else if ( mw.user.options.get( 'showtoolbar' ) === 1 ) { @@ -202,18 +204,20 @@ // Make the GUI draggable var dragged = false; - gui.draggable({ - handle: header, - containment: 'window', - start: function ( event ) { - if ( event.originalEvent.target.id !== 'proveit-header' ) { - dragged = true; + mw.loader.using( 'jquery.ui.draggable' ).then( function () { + gui.draggable({ + handle: header, + containment: 'window', + start: function ( event ) { + if ( event.originalEvent.target.id !== 'proveit-header' ) { + dragged = true; + } + gui.css({ + 'right': 'auto', + 'bottom': 'auto' + }); } - gui.css({ - 'right': 'auto', - 'bottom': 'auto' - }); - } + }); }); // Lastly, bind e
[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Put a couple of checks in place
Sophivorus has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/351115 ) Change subject: Put a couple of checks in place .. Put a couple of checks in place Bug: T163563 Change-Id: I29d18d2fd565cd1a861d3a65c1d31a2b33e0ead2 --- M proveit.js 1 file changed, 33 insertions(+), 29 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikipedia/gadgets/ProveIt refs/changes/15/351115/1 diff --git a/proveit.js b/proveit.js index ac2c768..510d22c 100755 --- a/proveit.js +++ b/proveit.js @@ -127,27 +127,29 @@ // Replace the Reference button for the ProveIt button in the new toolbar if ( mw.user.options.get( 'usebetatoolbar' ) === 1 ) { - proveit.getTextbox().wikiEditor( 'removeFromToolbar', { - 'section': 'main', - 'group': 'insert', - 'tool': 'reference' - }); - proveit.getTextbox().wikiEditor( 'addToToolbar', { - 'section': 'main', - 'group': 'insert', - 'tools': { - 'proveit': { - 'label': 'ProveIt', - 'type': 'button', - 'icon': proveit.ICON, - 'action': { - 'type': 'callback', - 'execute': function () { - $( '#proveit' ).toggle(); + proveit.getTextbox().on( 'wikiEditor-toolbar-doneInitialSections', function () { + proveit.getTextbox().wikiEditor( 'removeFromToolbar', { + 'section': 'main', + 'group': 'insert', + 'tool': 'reference' + }); + proveit.getTextbox().wikiEditor( 'addToToolbar', { + 'section': 'main', + 'group': 'insert', + 'tools': { + 'proveit': { + 'label': 'ProveIt', + 'type': 'button', + 'icon': proveit.ICON, + 'action': { + 'type': 'callback', + 'execute': function () { + $( '#proveit' ).toggle(); + } } } } - } + }); }); // Add the ProveIt button in the old toolbar } else if ( mw.user.options.get( 'showtoolbar' ) === 1 ) { @@ -202,18 +204,20 @@ // Make the GUI draggable var dragged = false; - gui.draggable({ - handle: header, - containment: 'window', - start: function ( event ) { - if ( event.originalEvent.target.id !== 'proveit-header' ) { - dragged = true; + mw.loader.using( 'jquery.ui.draggable' ).then( function () { + gui.draggable({ + handle: header, + containment: 'window', + start: function ( event ) { + if ( event.originalEvent.target.id !== 'proveit-header' ) { + dragged = true; + } + gui.css({ + 'right': 'auto', + 'bottom': 'auto' + }); } - gui.css({ - 'right': 'auto', - 'bottom': 'auto' - }); - } + }); });
[MediaWiki-commits] [Gerrit] mediawiki...Poncho[master]: Fix test and add missing test entry point
Sophivorus has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/350905 ) Change subject: Fix test and add missing test entry point .. Fix test and add missing test entry point Fix unit test by adding one class to autoloader Also add npm entry point for tests with jsonlint and banana to test for valid language files Change-Id: Ide29d19ae13a08b8e1045e1dfdc3d3c45302bf1f --- M .gitignore A Gruntfile.js A package.json M skin.json 4 files changed, 37 insertions(+), 2 deletions(-) Approvals: Sophivorus: Verified; Looks good to me, approved diff --git a/.gitignore b/.gitignore index 496ee2c..bbaaf56 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ +node_modules/ +vendor/ + .DS_Store \ No newline at end of file diff --git a/Gruntfile.js b/Gruntfile.js new file mode 100644 index 000..472f993 --- /dev/null +++ b/Gruntfile.js @@ -0,0 +1,20 @@ +/*jshint node:true */ +module.exports = function ( grunt ) { + grunt.loadNpmTasks( 'grunt-jsonlint' ); + grunt.loadNpmTasks( 'grunt-banana-checker' ); + + var conf = grunt.file.readJSON( 'skin.json' ); + grunt.initConfig( { + banana: conf.MessagesDirs, + jsonlint: { + all: [ + '**/*.json', + '!node_modules/**', + '!vendor/**' + ] + } + } ); + + grunt.registerTask( 'test', [ 'jsonlint', 'banana' ] ); + grunt.registerTask( 'default', 'test' ); +}; diff --git a/package.json b/package.json new file mode 100644 index 000..bcf5b13 --- /dev/null +++ b/package.json @@ -0,0 +1,11 @@ +{ + "private": true, + "scripts": { + "test": "grunt test" + }, + "devDependencies": { + "grunt": "1.0.1", + "grunt-banana-checker": "0.5.0", + "grunt-jsonlint": "1.1.0" + } +} diff --git a/skin.json b/skin.json index f7f9028..b56fcda 100644 --- a/skin.json +++ b/skin.json @@ -2,7 +2,7 @@ "manifest_version": 1, "name": "Poncho", "version": "1.1", - "author": "[http://mediawiki.org/wiki/User:Sophivorus Sophivorus]", + "author": "[https://mediawiki.org/wiki/User:Sophivorus Sophivorus]", "descriptionmsg": "poncho-desc", "type": "skin", "license-name": "GPL-3.0", @@ -15,7 +15,8 @@ "poncho": "Poncho" }, "AutoloadClasses": { - "SkinPoncho": "Poncho.php" + "SkinPoncho": "Poncho.php", + "PonchoTemplate": "Poncho.php" }, "ResourceModules": { "skins.poncho": { -- To view, visit https://gerrit.wikimedia.org/r/350905 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ide29d19ae13a08b8e1045e1dfdc3d3c45302bf1f Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/skins/Poncho Gerrit-Branch: master Gerrit-Owner: Umherirrender Gerrit-Reviewer: Hashar Gerrit-Reviewer: Sophivorus Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Poncho[master]: Minor updates
Sophivorus has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/350194 ) Change subject: Minor updates .. Minor updates Change-Id: I46c0393b60e0039ba01496624cc9ba480e499c45 --- M Poncho.php M i18n/en.json M i18n/es.json 3 files changed, 11 insertions(+), 9 deletions(-) Approvals: Sophivorus: Verified; Looks good to me, approved jenkins-bot: Checked diff --git a/Poncho.php b/Poncho.php index ae66002..ee7a5e3 100644 --- a/Poncho.php +++ b/Poncho.php @@ -2,13 +2,17 @@ class SkinPoncho extends SkinTemplate { - var $skinname = 'poncho', - $template = 'PonchoTemplate'; + public $skinname = 'poncho'; + + public $template = 'PonchoTemplate'; static function onBeforePageDisplay( OutputPage &$out, Skin &$skin ) { - $out->addModuleStyles( 'skins.poncho' ); - $out->addModuleScripts( 'skins.poncho' ); - $out->addMeta( 'viewport', 'width=device-width' ); + global $wgDefaultSkin; + if ( $wgDefaultSkin === 'poncho' ) { + $out->addModuleStyles( 'skins.poncho' ); + $out->addModuleScripts( 'skins.poncho' ); + $out->addMeta( 'viewport', 'width=device-width' ); + } } } @@ -34,8 +38,6 @@ * Output the page */ function execute() { - $Title = $this->getSkin()->getTitle(); - $Request = $this->getSkin()->getRequest(); include 'Poncho.phtml'; } } \ No newline at end of file diff --git a/i18n/en.json b/i18n/en.json index 34e2f50..3c71792 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -4,7 +4,7 @@ "Sophivorus" ] }, - "poncho-desc": "Simple, clean, responsive, mobile-friendly skin.", + "poncho-desc": "Simple, responsive and mobile-friendly skin.", "poncho-wiki": "Wiki", "poncho-tools": "Tools", "poncho-actions": "Actions", diff --git a/i18n/es.json b/i18n/es.json index 7fd8b2b..60ddd4a 100644 --- a/i18n/es.json +++ b/i18n/es.json @@ -4,7 +4,7 @@ "Sophivorus" ] }, - "poncho-desc": "Skin simple, limpia, adaptable y amigable con dispositivos móbiles.", + "poncho-desc": "Skin simple, adaptable y amigable con dispositivos móbiles.", "poncho-wiki": "Wiki", "poncho-tools": "Herramientas", "poncho-actions": "Acciones", -- To view, visit https://gerrit.wikimedia.org/r/350194 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I46c0393b60e0039ba01496624cc9ba480e499c45 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/skins/Poncho Gerrit-Branch: master Gerrit-Owner: Sophivorus Gerrit-Reviewer: Sophivorus Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Poncho[master]: Minor updates
Sophivorus has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/350194 ) Change subject: Minor updates .. Minor updates Change-Id: I46c0393b60e0039ba01496624cc9ba480e499c45 --- M Poncho.php M i18n/en.json M i18n/es.json 3 files changed, 11 insertions(+), 9 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/Poncho refs/changes/94/350194/1 diff --git a/Poncho.php b/Poncho.php index ae66002..ee7a5e3 100644 --- a/Poncho.php +++ b/Poncho.php @@ -2,13 +2,17 @@ class SkinPoncho extends SkinTemplate { - var $skinname = 'poncho', - $template = 'PonchoTemplate'; + public $skinname = 'poncho'; + + public $template = 'PonchoTemplate'; static function onBeforePageDisplay( OutputPage &$out, Skin &$skin ) { - $out->addModuleStyles( 'skins.poncho' ); - $out->addModuleScripts( 'skins.poncho' ); - $out->addMeta( 'viewport', 'width=device-width' ); + global $wgDefaultSkin; + if ( $wgDefaultSkin === 'poncho' ) { + $out->addModuleStyles( 'skins.poncho' ); + $out->addModuleScripts( 'skins.poncho' ); + $out->addMeta( 'viewport', 'width=device-width' ); + } } } @@ -34,8 +38,6 @@ * Output the page */ function execute() { - $Title = $this->getSkin()->getTitle(); - $Request = $this->getSkin()->getRequest(); include 'Poncho.phtml'; } } \ No newline at end of file diff --git a/i18n/en.json b/i18n/en.json index 34e2f50..3c71792 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -4,7 +4,7 @@ "Sophivorus" ] }, - "poncho-desc": "Simple, clean, responsive, mobile-friendly skin.", + "poncho-desc": "Simple, responsive and mobile-friendly skin.", "poncho-wiki": "Wiki", "poncho-tools": "Tools", "poncho-actions": "Actions", diff --git a/i18n/es.json b/i18n/es.json index 7fd8b2b..60ddd4a 100644 --- a/i18n/es.json +++ b/i18n/es.json @@ -4,7 +4,7 @@ "Sophivorus" ] }, - "poncho-desc": "Skin simple, limpia, adaptable y amigable con dispositivos móbiles.", + "poncho-desc": "Skin simple, adaptable y amigable con dispositivos móbiles.", "poncho-wiki": "Wiki", "poncho-tools": "Herramientas", "poncho-actions": "Acciones", -- To view, visit https://gerrit.wikimedia.org/r/350194 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I46c0393b60e0039ba01496624cc9ba480e499c45 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/skins/Poncho Gerrit-Branch: master Gerrit-Owner: Sophivorus ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...LabeledSectionTransclusion[master]: Properly transclude sections inside extension tags
Sophivorus has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/350013 ) Change subject: Properly transclude sections inside extension tags .. Properly transclude sections inside extension tags Bug: T163411 Change-Id: I92fdfdc83f5e4a93220c65981491825b3818bf8f --- M LabeledSectionTransclusion.class.php A lstParserTestsExt.txt 2 files changed, 97 insertions(+), 10 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/LabeledSectionTransclusion refs/changes/13/350013/1 diff --git a/LabeledSectionTransclusion.class.php b/LabeledSectionTransclusion.class.php index f4ae2c6..dc00141 100644 --- a/LabeledSectionTransclusion.class.php +++ b/LabeledSectionTransclusion.class.php @@ -375,18 +375,30 @@ if ( $begin != '' ) { // Find the begin node $found = false; - for ( ; $node; $node = $node->getNextSibling() ) { - if ( $node->getName() != 'ext' ) { - continue; - } - $parts = $node->splitExt(); - $parts = array_map( array( $newFrame, 'expand' ), $parts ); - if ( self::isSection( $parts['name'] ) ) { - if ( preg_match( $beginRegex, $parts['attr'] ) ) { - $found = true; - break; + $queue = array( $node ); + while ( $queue ) { + $node = array_shift( $queue ); + if ( $node->getName() === 'ext' ) { + $parts = $node->splitExt(); + $parts = array_map( array( $newFrame, 'expand' ), $parts ); + if ( self::isSection( $parts['name'] ) ) { + if ( preg_match( $beginRegex, $parts['attr'] ) ) { + $found = true; + break; + } + } else { + // If we're in an extension tag (such as or ), add the 'ext' nodes inside to the queue + $dom = $parser->preprocessToDom( $parts['inner'] ); + foreach ( $dom->getChildrenOfType( 'ext' )->node as $child ) { + $child = new PPNode_DOM( $child ); + $queue[] = $child; + } } } + $next = $node->getNextSibling(); + if ( $next ) { + $queue[] = $next; + } } if ( !$found || !$node ) { break; diff --git a/lstParserTestsExt.txt b/lstParserTestsExt.txt new file mode 100644 index 000..1f9ecb0 --- /dev/null +++ b/lstParserTestsExt.txt @@ -0,0 +1,75 @@ +# Many MediaWiki extensions introduce their own tags, and extracting marked sections from within them requires special DOM traversal. +# These parser tests are designed to test proper transclusion of sections within extension tags. +# In order to run them, first install the Poem extension, that introduces the tag. + +# Force the test runner to ensure LST and Poem are loaded +!! hooks +section +poem +!! endhooks + +!! functionhooks +lst +!! endfunctionhooks + +# Article with a poem +!! article +Poem +!! text +poem +!! endarticle + +!! test +LST: Transclude a poem with #lst +!! input +{{#lst:Poem|poem}} +!! result + +poem + + + +!! end + +!! test +LST: Transclude only the content of a poem with #lst +!! input +{{#lst:Poem|content}} +!! result +poem + +!! end + +# Article with a nested poem +# Nested poems never happen IRL, but some other extensions (like DebateTree) do use nested tags +# so it's important to ensure that transclusion from inside nested tags works properly +!! article +Nested +!! text +a + + poem + + +!! endarticle + +!! test +LST: Transclude a nested poem with #lst +!!
[MediaWiki-commits] [Gerrit] mediawiki...Poncho[master]: Update messages
Sophivorus has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/349972 ) Change subject: Update messages .. Update messages Change-Id: Id16b1fad18f821427e98d9dcce07e32635f3cdf1 --- M i18n/en.json M i18n/es.json 2 files changed, 2 insertions(+), 2 deletions(-) Approvals: Sophivorus: Verified; Looks good to me, approved jenkins-bot: Checked diff --git a/i18n/en.json b/i18n/en.json index 939d216..34e2f50 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -4,7 +4,7 @@ "Sophivorus" ] }, - "poncho-desc": "Responsive skin, compatible with mobile devices.", + "poncho-desc": "Simple, clean, responsive, mobile-friendly skin.", "poncho-wiki": "Wiki", "poncho-tools": "Tools", "poncho-actions": "Actions", diff --git a/i18n/es.json b/i18n/es.json index 283707a..7fd8b2b 100644 --- a/i18n/es.json +++ b/i18n/es.json @@ -4,7 +4,7 @@ "Sophivorus" ] }, - "poncho-desc": "Skin adaptable, compatible con dispositivos móbiles.", + "poncho-desc": "Skin simple, limpia, adaptable y amigable con dispositivos móbiles.", "poncho-wiki": "Wiki", "poncho-tools": "Herramientas", "poncho-actions": "Acciones", -- To view, visit https://gerrit.wikimedia.org/r/349972 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id16b1fad18f821427e98d9dcce07e32635f3cdf1 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/skins/Poncho Gerrit-Branch: master Gerrit-Owner: Sophivorus Gerrit-Reviewer: Sophivorus Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Poncho[master]: Update messages
Sophivorus has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/349972 ) Change subject: Update messages .. Update messages Change-Id: Id16b1fad18f821427e98d9dcce07e32635f3cdf1 --- M i18n/en.json M i18n/es.json 2 files changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/Poncho refs/changes/72/349972/1 diff --git a/i18n/en.json b/i18n/en.json index 939d216..34e2f50 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -4,7 +4,7 @@ "Sophivorus" ] }, - "poncho-desc": "Responsive skin, compatible with mobile devices.", + "poncho-desc": "Simple, clean, responsive, mobile-friendly skin.", "poncho-wiki": "Wiki", "poncho-tools": "Tools", "poncho-actions": "Actions", diff --git a/i18n/es.json b/i18n/es.json index 283707a..7fd8b2b 100644 --- a/i18n/es.json +++ b/i18n/es.json @@ -4,7 +4,7 @@ "Sophivorus" ] }, - "poncho-desc": "Skin adaptable, compatible con dispositivos móbiles.", + "poncho-desc": "Skin simple, limpia, adaptable y amigable con dispositivos móbiles.", "poncho-wiki": "Wiki", "poncho-tools": "Herramientas", "poncho-actions": "Acciones", -- To view, visit https://gerrit.wikimedia.org/r/349972 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id16b1fad18f821427e98d9dcce07e32635f3cdf1 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/skins/Poncho Gerrit-Branch: master Gerrit-Owner: Sophivorus ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...Poncho[master]: Update to latest MediaWiki
Sophivorus has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/349964 ) Change subject: Update to latest MediaWiki .. Update to latest MediaWiki Also several minor improvements and fixes Change-Id: Iaeb268fa878db9ce5c133c6249667b30af5ac5d2 --- M Poncho.css M Poncho.js M Poncho.php M Poncho.phtml D README.md M i18n/en.json M i18n/es.json A i18n/qqq.json M skin.json 9 files changed, 100 insertions(+), 136 deletions(-) Approvals: Sophivorus: Verified; Looks good to me, approved jenkins-bot: Checked diff --git a/Poncho.css b/Poncho.css index 6d73166..888a56d 100644 --- a/Poncho.css +++ b/Poncho.css @@ -1,3 +1,6 @@ +/** + * Site-wide elements + */ body { font-family: Arial; font-size: 14px; @@ -5,61 +8,50 @@ margin: 0; padding: 0; } - a { color: blue; text-decoration: none; } - a:hover { text-decoration: underline; } - h2 { margin: 1em 0 0.5em 0; } - img { max-width: 100%; height: auto; } - pre { white-space: pre-wrap; } - fieldset { border: 1px solid #aaa; margin: 1em 0; } +/** + * Specific elements + */ #mw-js-message { display: none; } - .mw-indicator { float: right; } -/* Main */ - -#main { - margin-left: 10em; -} - -/* Sidebar */ - +/** + * Header and main menu + */ #header-wrapper { background: #f9f9f9; border-bottom: 1px solid #aaa; } - #header { margin: auto; max-width: 1000px; padding: 0 1em; } - #logo { background-size: contain; display: inline-block; @@ -68,30 +60,25 @@ width: 32px; height: 32px; } - #menu { display: inline; list-style: none; margin: 0; padding: 0; } - #menu li { display: inline; position: relative; } - #menu span { display: inline-block; padding: 15px 10px; text-decoration: none; } - #menu li:hover span { background: #aaa; cursor: default; } - #menu .submenu { background: #f9f9f9; border: 1px solid #aaa; @@ -104,11 +91,9 @@ word-spacing: nowrap; z-index: 1; } - #menu .submenu li { display: block; } - #menu .submenu a { color: inherit; cursor: pointer; @@ -119,14 +104,14 @@ width: 100%; } -/* Search form */ - +/** + * Search form + */ #search-form { float: right; padding: 7px 0; position: relative; } - #search-form button { background: url( 'images/lens.png' ); background-size: contain; @@ -138,12 +123,10 @@ width: 32px; height: 32px; } - #search-form button.active { background-color: white; border-color: #aaa; } - #search-form input { border: 1px solid #aaa; border-right: none; @@ -157,43 +140,19 @@ z-index: 1; } -/* Actions */ - -#actions { - display: block; - font-size: small; - font-weight: normal; - list-style: none; - margin: 50px 0; - padding: 0; -} - -#actions li { - display: inline; - margin: 0 5px; - padding: 0; -} - -#actions a { - text-decoration: none; -} - -#actions a:hover { - text-decoration: underline; -} - -/* Title */ - +/** + * Title + */ #title { } - #subtitle { margin: 1em 0; } -/* Content */ - +/** + * Content + */ #content { line-height: 1.5; margin: 0 auto; @@ -201,24 +160,23 @@ overflow: hidden; padding: 1em; } - #mw-content-text ol { margin: 0 0 0 20px; padding: 0; } - #mw-content-text ul { margin: 0 0 0 20px; padding: 0; } - #mw-content-text pre { background: #f9f9f9; border: 1px solid #aaa; padding: 20px; } -/* Table of contents */ +/** + * Table of contents + */ #mw-content-text #toc { background: #f9f9f9; border: 1px solid #aaa; @@ -242,7 +200,9 @@ padding: 1em; } -/* Thumbs */ +/** + * Thumbnails + */ .thumb { background: #f9f9f9; border: 1px solid #aaa; @@ -274,7 +234,9 @@ margin: 0; } -/* Edit section button */ +/** + * Edit section button + */ .mw-editsection { font-size: small; font-weight: normal; @@ -284,8 +246,9 @@ display: none; } -/* Edit page */ - +/** + * Edit page + */ #wpTextbox1 { box-sizing: border-box; width: 100%; @@ -308,8 +271,9 @@ display: none; } -/* Categories */ - +/** + * Categories + */ #catlinks { background: #f9f9f9; border: 1px solid #aaa; @@ -317,38 +281,29 @@ margin: 50px 0; padding: 1em; } - #catlinks ul { margin: 0; } -/* Footer */ - -#facebook-image { - display: none; -} - -#footer-wrapper { - background: black; -} - +/** + * Footer + */ #footer { + border-top: 1px so
[MediaWiki-commits] [Gerrit] mediawiki...Poncho[master]: Update to latest MediaWiki
Sophivorus has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/349964 ) Change subject: Update to latest MediaWiki .. Update to latest MediaWiki Also several minor improvements and fixes Change-Id: Iaeb268fa878db9ce5c133c6249667b30af5ac5d2 --- M Poncho.css M Poncho.js M Poncho.php M Poncho.phtml D README.md M i18n/en.json M i18n/es.json A i18n/qqq.json M skin.json 9 files changed, 100 insertions(+), 136 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/Poncho refs/changes/64/349964/1 diff --git a/Poncho.css b/Poncho.css index 6d73166..888a56d 100644 --- a/Poncho.css +++ b/Poncho.css @@ -1,3 +1,6 @@ +/** + * Site-wide elements + */ body { font-family: Arial; font-size: 14px; @@ -5,61 +8,50 @@ margin: 0; padding: 0; } - a { color: blue; text-decoration: none; } - a:hover { text-decoration: underline; } - h2 { margin: 1em 0 0.5em 0; } - img { max-width: 100%; height: auto; } - pre { white-space: pre-wrap; } - fieldset { border: 1px solid #aaa; margin: 1em 0; } +/** + * Specific elements + */ #mw-js-message { display: none; } - .mw-indicator { float: right; } -/* Main */ - -#main { - margin-left: 10em; -} - -/* Sidebar */ - +/** + * Header and main menu + */ #header-wrapper { background: #f9f9f9; border-bottom: 1px solid #aaa; } - #header { margin: auto; max-width: 1000px; padding: 0 1em; } - #logo { background-size: contain; display: inline-block; @@ -68,30 +60,25 @@ width: 32px; height: 32px; } - #menu { display: inline; list-style: none; margin: 0; padding: 0; } - #menu li { display: inline; position: relative; } - #menu span { display: inline-block; padding: 15px 10px; text-decoration: none; } - #menu li:hover span { background: #aaa; cursor: default; } - #menu .submenu { background: #f9f9f9; border: 1px solid #aaa; @@ -104,11 +91,9 @@ word-spacing: nowrap; z-index: 1; } - #menu .submenu li { display: block; } - #menu .submenu a { color: inherit; cursor: pointer; @@ -119,14 +104,14 @@ width: 100%; } -/* Search form */ - +/** + * Search form + */ #search-form { float: right; padding: 7px 0; position: relative; } - #search-form button { background: url( 'images/lens.png' ); background-size: contain; @@ -138,12 +123,10 @@ width: 32px; height: 32px; } - #search-form button.active { background-color: white; border-color: #aaa; } - #search-form input { border: 1px solid #aaa; border-right: none; @@ -157,43 +140,19 @@ z-index: 1; } -/* Actions */ - -#actions { - display: block; - font-size: small; - font-weight: normal; - list-style: none; - margin: 50px 0; - padding: 0; -} - -#actions li { - display: inline; - margin: 0 5px; - padding: 0; -} - -#actions a { - text-decoration: none; -} - -#actions a:hover { - text-decoration: underline; -} - -/* Title */ - +/** + * Title + */ #title { } - #subtitle { margin: 1em 0; } -/* Content */ - +/** + * Content + */ #content { line-height: 1.5; margin: 0 auto; @@ -201,24 +160,23 @@ overflow: hidden; padding: 1em; } - #mw-content-text ol { margin: 0 0 0 20px; padding: 0; } - #mw-content-text ul { margin: 0 0 0 20px; padding: 0; } - #mw-content-text pre { background: #f9f9f9; border: 1px solid #aaa; padding: 20px; } -/* Table of contents */ +/** + * Table of contents + */ #mw-content-text #toc { background: #f9f9f9; border: 1px solid #aaa; @@ -242,7 +200,9 @@ padding: 1em; } -/* Thumbs */ +/** + * Thumbnails + */ .thumb { background: #f9f9f9; border: 1px solid #aaa; @@ -274,7 +234,9 @@ margin: 0; } -/* Edit section button */ +/** + * Edit section button + */ .mw-editsection { font-size: small; font-weight: normal; @@ -284,8 +246,9 @@ display: none; } -/* Edit page */ - +/** + * Edit page + */ #wpTextbox1 { box-sizing: border-box; width: 100%; @@ -308,8 +271,9 @@ display: none; } -/* Categories */ - +/** + * Categories + */ #catlinks { background: #f9f9f9; border: 1px solid #aaa; @@ -317,38 +281,29 @@ margin: 50px 0; padding: 1em; } - #catlinks ul { margin: 0; } -/* Footer */ - -#facebook-image { - display: none; -} - -#footer-wrapper { - background: black; -} - +/** + * Footer + */ #footer { + border-top: 1px sol
[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Delete obsolete website files
Sophivorus has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/347212 ) Change subject: Delete obsolete website files .. Delete obsolete website files Files are accessible via version control if they are ever needed (unlikely), so I delete them to keep the repo clean and avoid confusion for potential new developers. Bug T148228 Change-Id: I395c9ed037a19e9e6e9038996133e7b3d45a6a58 --- D website/about.php D website/credits.php D website/demo.php D website/developers.php D website/features.php D website/footer.php D website/header.php D website/img/about_leadIn.jpg D website/img/citationPopo.jpg D website/img/credits.jpg D website/img/credits_image_link.jpg D website/img/demo_image_link.jpg D website/img/developers_leadIn.jpg D website/img/documentation.jpg D website/img/documentation_image_link.jpg D website/img/documentation_leadIn.jpg D website/img/favicon.ico D website/img/features.jpg D website/img/features_image_link.jpg D website/img/features_leadIn.jpg D website/img/gCode.jpg D website/img/gCode_image_link.jpg D website/img/gCode_leadIn.jpg D website/img/get.jpg D website/img/get_rollover.jpg D website/img/index.jpg D website/img/install.jpg D website/img/notfound.jpg D website/img/proveIt_logo-02.jpg D website/img/proveIt_logo_small-04.png D website/img/proveIt_logo_small.jpg D website/img/proveit_logo-02.png D website/img/proveit_logo.png D website/img/proveit_logo_small.png D website/img/reportabug.jpg D website/img/reportabug_image_link.jpg D website/img/reportabug_leadIn.jpg D website/img/research.jpg D website/img/research_image_link.jpg D website/img/research_leadIn.jpg D website/img/screenshots.jpg D website/img/screenshots/proveit-add.png D website/img/screenshots/proveit-basic.png D website/img/screenshots/proveit-edit.png D website/img/screenshots/proveit-minimized.png D website/img/screenshots_image_link.jpg D website/img/screenshots_leadIn.jpg D website/img/tempLogo.jpg D website/img/test_link.jpg D website/img/theTeam_leadIn.jpg D website/img/theteam.jpg D website/img/theteam_image_link.jpg D website/img/tutorials.jpg D website/img/tutorials_image_link.jpg D website/img/tutorials_leadIn.jpg D website/img/userguide.jpg D website/img/userguide_image_link.jpg D website/img/users_leadIn.jpg D website/img/wiki.jpg D website/img/wiki_image_link.jpg D website/img/wiki_leadIn.jpg D website/img/wikipedia_referencing_simplified.jpg D website/index.php D website/install.php D website/jquery.ba-hashchange.min.js D website/notfound.php D website/pdf/a43-luther.pdf D website/reportabug.php D website/research.php D website/screenshots.php D website/scripts.js D website/theteam.php D website/tutorials.php D website/userguide.php D website/users.php D website/website_styles.css D website/wikibits.js D website_configuration/proveit 78 files changed, 0 insertions(+), 1,866 deletions(-) Approvals: Sophivorus: Verified; Looks good to me, approved diff --git a/website/about.php b/website/about.php deleted file mode 100644 index f883a77..000 --- a/website/about.php +++ /dev/null @@ -1,16 +0,0 @@ - - - Research - The Team - Credits - - - - - \ No newline at end of file diff --git a/website/credits.php b/website/credits.php deleted file mode 100644 index 9b9e642..000 --- a/website/credits.php +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - Credits - - - - Besides core team members, ProveIt depends on the efforts of issue reporters and others providing feedback. It also relies on the following code and resources: - - - MediaWiki, including http://bits.wikimedia.org/skins-1.5/common/wikibits.js";>wikibits.js. - Wikipedia http://bits.wikimedia.org/skins-1.5/common/jquery.min.js";>version of http://jquery.com/";>jQuery, which must already be loaded. - Icons from the http://www.famfamfam.com/lab/icons/silk/";>Silk icon set, by Mark James, used under Creative Commons Attribution 3.0 License. - http://jqueryui.com";>jQueryUI, via MediaWiki core. - Public domain code from QuirksMode, by Peter
[MediaWiki-commits] [Gerrit] mediawiki...LabeledSectionTransclusion[master]: Properly transclude sections inside extension tags
Sophivorus has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/349256 ) Change subject: Properly transclude sections inside extension tags .. Properly transclude sections inside extension tags Bug: T163411 Change-Id: I16dc9e1a63c7dab4f57bc6e6481e15ea037896b5 --- M LabeledSectionTransclusion.class.php 1 file changed, 15 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/LabeledSectionTransclusion refs/changes/56/349256/1 diff --git a/LabeledSectionTransclusion.class.php b/LabeledSectionTransclusion.class.php index f4ae2c6..08486f7 100644 --- a/LabeledSectionTransclusion.class.php +++ b/LabeledSectionTransclusion.class.php @@ -386,6 +386,21 @@ $found = true; break; } + } else { + // If we're inside another extension tag (such as or ), look inside (bug T163411) + $dom = $parser->preprocessToDom( $parts['inner'] ); + $child = $dom->getFirstChild(); + if ( $child->getName() === 'ext' ) { + $childParts = $child->splitExt(); + $childParts = array_map( array( $newFrame, 'expand' ), $childParts ); + if ( self::isSection( $childParts['name'] ) ) { + if ( preg_match( $beginRegex, $childParts['attr'] ) ) { + $found = true; + $node = $child; + break; + } + } + } } } if ( !$found || !$node ) { -- To view, visit https://gerrit.wikimedia.org/r/349256 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I16dc9e1a63c7dab4f57bc6e6481e15ea037896b5 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/LabeledSectionTransclusion Gerrit-Branch: master Gerrit-Owner: Sophivorus ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...LabeledSectionTransclusion[master]: Properly transclude sections within extension tags
Sophivorus has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/349223 ) Change subject: Properly transclude sections within extension tags .. Properly transclude sections within extension tags Bug: T163411 Change-Id: I303c94b739780849ae4894c999848d9ffcf09f95 --- M LabeledSectionTransclusion.class.php 1 file changed, 11 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/LabeledSectionTransclusion refs/changes/23/349223/1 diff --git a/LabeledSectionTransclusion.class.php b/LabeledSectionTransclusion.class.php index f4ae2c6..25452c3 100644 --- a/LabeledSectionTransclusion.class.php +++ b/LabeledSectionTransclusion.class.php @@ -369,14 +369,16 @@ $text = ''; $node = $root->getFirstChild(); + while ( $node ) { // If the name of the begin node was specified, find it. // Otherwise transclude everything from the beginning of the page. if ( $begin != '' ) { // Find the begin node $found = false; - for ( ; $node; $node = $node->getNextSibling() ) { + while ( $node ) { if ( $node->getName() != 'ext' ) { + $node = $node->getNextSibling(); continue; } $parts = $node->splitExt(); @@ -384,8 +386,15 @@ if ( self::isSection( $parts['name'] ) ) { if ( preg_match( $beginRegex, $parts['attr'] ) ) { $found = true; - break; + } else { + $found = false; } + break; + } else { + // If we're inside another extension tag (such as or ), look into the content + $dom = $parser->preprocessToDom( $parts['inner'] ); + $node = $dom->getFirstChild(); + continue; } } if ( !$found || !$node ) { -- To view, visit https://gerrit.wikimedia.org/r/349223 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I303c94b739780849ae4894c999848d9ffcf09f95 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/LabeledSectionTransclusion Gerrit-Branch: master Gerrit-Owner: Sophivorus ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Add support for nested tags in extensions
Sophivorus has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/349016 ) Change subject: Add support for nested tags in extensions .. Add support for nested tags in extensions Bug: T3310 Change-Id: I262f9813c58c43c93655f2fb03c1d8155e3ba19f --- A includes/parser/NestingTest.php M includes/parser/Preprocessor_DOM.php 2 files changed, 98 insertions(+), 14 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/16/349016/1 diff --git a/includes/parser/NestingTest.php b/includes/parser/NestingTest.php new file mode 100644 index 000..c063ce3 --- /dev/null +++ b/includes/parser/NestingTest.php @@ -0,0 +1,58 @@ +123", "foo", "123", [] ], + [ "foo", "foo", "foo", [] ], + [ "AfooB", "foo", "foo", [] ], + [ "A123456789B", "foo", "123456789", [ "a" => "1", "b" => "foo" ] ], + [ "" . + "" . +"" . +"", +"ref", "", [ "name" => "citation:1" ] + ], + [ "", "ref", "", [ "name" => "x", "foo" => "foo" ] ] + ]; + } + + function provideNotWorkingCases() { + return [ + [ "123", "foo", null, null ], + [ "123456", "foo", "123456", [ "foo" => "123" ] ], + ); + } + + var $mInnerText; + var $mParams; + + /** +* @dataProvider provideCases +*/ + function testCases( $wikiText, $tag, $expectedInnerText, $expectedParams ) { + global $wgParserConf; + $parser = new Parser( $wgParserConf ); + + $parser->setHook( $tag, [ $this, 'tagCallback' ] ); + $parserOutput = $parser->parse( $wikiText, Title::newFromText( 'Test' ), new ParserOptions ); + + $this->assertEquals( $expectedInnerText, $this->mInnerText ); + $this->assertEquals( $expectedParams, $this->mParams ); + + $parser->mPreprocessor = null; # Break the Parser <-> Preprocessor cycle + } + + function tagCallback( $innerText, $params, $parser ) { + $this->mInnerText = $innerText; + $this->mParams = $params; + + return "dummy"; + } +} \ No newline at end of file diff --git a/includes/parser/Preprocessor_DOM.php b/includes/parser/Preprocessor_DOM.php index b93c617..1aba80d 100644 --- a/includes/parser/Preprocessor_DOM.php +++ b/includes/parser/Preprocessor_DOM.php @@ -478,30 +478,56 @@ $close = ''; } else { $attrEnd = $tagEndPos; - // Find closing tag - if ( - !isset( $noMoreClosingTag[$name] ) && - preg_match( "/<\/" . preg_quote( $name, '/' ) . "\s*>/i", - $text, $matches, PREG_OFFSET_CAPTURE, $tagEndPos + 1 ) - ) { - $inner = substr( $text, $tagEndPos + 1, $matches[0][1] - $tagEndPos - 1 ); - $i = $matches[0][1] + strlen( $matches[0][0] ); - $close = '' . htmlspecialchars( $matches[0][0] ) . ''; - } else { - // No end tag + + // We know that one start tag was already found + $numOfStartTags = 1; + $numOfEndTags = 0; + $offset = $tagEndPos; + $pattern = "/<" . preg_quote( $name, '/' ) . "[^>]*>" . "|" . "<\/" . preg_quote( $name, '/' ) . "\s*>/i"; + + while ( $numOfStartTags != $numOfEndTags ) { + // match start tag or end tag + if ( preg_match( $pattern, $text, $matches, PREG_OFFSET_CAPTURE, $offset + 1 ) === 0 ) { + break; // Nothing found + } + + // what is it, start or end tag? + if ( substr( $matches[ 0 ][ 0 ], 0, 2 ) === "... - $noMoreClosingTag[$name] = true; + $noMoreClosingTag[ $name ] = true; continue; } + } else { + if ( $numOfStartTags === $numOfEndTags ) { +
[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Fix bug when adding citations to references without name
Sophivorus has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/348836 ) Change subject: Fix bug when adding citations to references without name .. Fix bug when adding citations to references without name Bug: T150101 Change-Id: I3acc28f611c409d34b06b830bba83fab98d00ab6 --- M proveit.js 1 file changed, 11 insertions(+), 6 deletions(-) Approvals: Sophivorus: Verified; Looks good to me, approved diff --git a/proveit.js b/proveit.js index 875e68f..ac2c768 100755 --- a/proveit.js +++ b/proveit.js @@ -537,9 +537,14 @@ this.cite = function ( event ) { var reference = event.data; - // If the reference has no name, ask the user for one + if ( reference.name ) { + // Add the citation + var citation = new proveit.Citation({ 'name': reference.name }); + citation.insert(); + + // If there's no reference name, ask the user for one // @todo check if the name is unique - if ( !reference.name ) { + } else { reference.name = prompt( proveit.getMessage( 'prompt-name' ) ); if ( !reference.name ) { return; @@ -551,15 +556,15 @@ reference.loadFromForm(); var newString = reference.string; + // Add the citation + var citation = new proveit.Citation({ 'name': reference.name }); + citation.insert(); + // Replace the old reference var textbox = proveit.getTextbox(), text = textbox.val().replace( oldString, newString ); textbox.val( text ); } - - // Add the citation - var citation = new proveit.Citation({ 'name': reference.name }); - citation.insert(); }; /** -- To view, visit https://gerrit.wikimedia.org/r/348836 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3acc28f611c409d34b06b830bba83fab98d00ab6 Gerrit-PatchSet: 1 Gerrit-Project: wikipedia/gadgets/ProveIt Gerrit-Branch: master Gerrit-Owner: Sophivorus Gerrit-Reviewer: Sophivorus ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Fix bug when adding citations to references without name
Sophivorus has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/348836 ) Change subject: Fix bug when adding citations to references without name .. Fix bug when adding citations to references without name Bug: T150101 Change-Id: I3acc28f611c409d34b06b830bba83fab98d00ab6 --- M proveit.js 1 file changed, 11 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikipedia/gadgets/ProveIt refs/changes/36/348836/1 diff --git a/proveit.js b/proveit.js index 875e68f..ac2c768 100755 --- a/proveit.js +++ b/proveit.js @@ -537,9 +537,14 @@ this.cite = function ( event ) { var reference = event.data; - // If the reference has no name, ask the user for one + if ( reference.name ) { + // Add the citation + var citation = new proveit.Citation({ 'name': reference.name }); + citation.insert(); + + // If there's no reference name, ask the user for one // @todo check if the name is unique - if ( !reference.name ) { + } else { reference.name = prompt( proveit.getMessage( 'prompt-name' ) ); if ( !reference.name ) { return; @@ -551,15 +556,15 @@ reference.loadFromForm(); var newString = reference.string; + // Add the citation + var citation = new proveit.Citation({ 'name': reference.name }); + citation.insert(); + // Replace the old reference var textbox = proveit.getTextbox(), text = textbox.val().replace( oldString, newString ); textbox.val( text ); } - - // Add the citation - var citation = new proveit.Citation({ 'name': reference.name }); - citation.insert(); }; /** -- To view, visit https://gerrit.wikimedia.org/r/348836 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3acc28f611c409d34b06b830bba83fab98d00ab6 Gerrit-PatchSet: 1 Gerrit-Project: wikipedia/gadgets/ProveIt Gerrit-Branch: master Gerrit-Owner: Sophivorus ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Remove unnecessary mw.loader.using call
Sophivorus has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/348792 ) Change subject: Remove unnecessary mw.loader.using call .. Remove unnecessary mw.loader.using call Bug: T148221 Change-Id: Ie05d069c988ff3c63446973c1c51c4f7b1ae35d2 --- M proveit.js 1 file changed, 11 insertions(+), 13 deletions(-) Approvals: Sophivorus: Verified; Looks good to me, approved diff --git a/proveit.js b/proveit.js index a0abbc2..875e68f 100755 --- a/proveit.js +++ b/proveit.js @@ -202,20 +202,18 @@ // Make the GUI draggable var dragged = false; - mw.loader.using( 'jquery.ui.draggable' ).then( function () { - gui.draggable({ - handle: header, - containment: 'window', - start: function ( event ) { - if ( event.originalEvent.target.id !== 'proveit-header' ) { - dragged = true; - } - gui.css({ - 'right': 'auto', - 'bottom': 'auto' - }); + gui.draggable({ + handle: header, + containment: 'window', + start: function ( event ) { + if ( event.originalEvent.target.id !== 'proveit-header' ) { + dragged = true; } - }); + gui.css({ + 'right': 'auto', + 'bottom': 'auto' + }); + } }); // Lastly, bind events -- To view, visit https://gerrit.wikimedia.org/r/348792 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie05d069c988ff3c63446973c1c51c4f7b1ae35d2 Gerrit-PatchSet: 1 Gerrit-Project: wikipedia/gadgets/ProveIt Gerrit-Branch: master Gerrit-Owner: Sophivorus Gerrit-Reviewer: Sophivorus ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Remove unnecessary mw.loader.using call
Sophivorus has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/348792 ) Change subject: Remove unnecessary mw.loader.using call .. Remove unnecessary mw.loader.using call Bug: T148221 Change-Id: Ie05d069c988ff3c63446973c1c51c4f7b1ae35d2 --- M proveit.js 1 file changed, 11 insertions(+), 13 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikipedia/gadgets/ProveIt refs/changes/92/348792/1 diff --git a/proveit.js b/proveit.js index a0abbc2..875e68f 100755 --- a/proveit.js +++ b/proveit.js @@ -202,20 +202,18 @@ // Make the GUI draggable var dragged = false; - mw.loader.using( 'jquery.ui.draggable' ).then( function () { - gui.draggable({ - handle: header, - containment: 'window', - start: function ( event ) { - if ( event.originalEvent.target.id !== 'proveit-header' ) { - dragged = true; - } - gui.css({ - 'right': 'auto', - 'bottom': 'auto' - }); + gui.draggable({ + handle: header, + containment: 'window', + start: function ( event ) { + if ( event.originalEvent.target.id !== 'proveit-header' ) { + dragged = true; } - }); + gui.css({ + 'right': 'auto', + 'bottom': 'auto' + }); + } }); // Lastly, bind events -- To view, visit https://gerrit.wikimedia.org/r/348792 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie05d069c988ff3c63446973c1c51c4f7b1ae35d2 Gerrit-PatchSet: 1 Gerrit-Project: wikipedia/gadgets/ProveIt Gerrit-Branch: master Gerrit-Owner: Sophivorus ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Make filter more flexible
Sophivorus has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/348785 ) Change subject: Make filter more flexible .. Make filter more flexible Match text anywhere in the labels, not just the beginning Change-Id: I70522ad7cb28e42b5cf68e36dfe219a04ca090dd --- M proveit.js 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Sophivorus: Verified; Looks good to me, approved diff --git a/proveit.js b/proveit.js index a1342b2..a0abbc2 100755 --- a/proveit.js +++ b/proveit.js @@ -1135,7 +1135,7 @@ form = event.data; $( 'tr', form ).show().filter( function () { - return $( 'label', this ).text().toLowerCase().startsWith( filter ) ? false : true; + return $( this ).text().toLowerCase().indexOf( filter ) > -1 ? false : true; }).hide(); }; -- To view, visit https://gerrit.wikimedia.org/r/348785 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I70522ad7cb28e42b5cf68e36dfe219a04ca090dd Gerrit-PatchSet: 1 Gerrit-Project: wikipedia/gadgets/ProveIt Gerrit-Branch: master Gerrit-Owner: Sophivorus Gerrit-Reviewer: Sophivorus ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Make filter more flexible
Sophivorus has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/348785 ) Change subject: Make filter more flexible .. Make filter more flexible Match text anywhere in the labels, not just the beginning Change-Id: I70522ad7cb28e42b5cf68e36dfe219a04ca090dd --- M proveit.js 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/wikipedia/gadgets/ProveIt refs/changes/85/348785/1 diff --git a/proveit.js b/proveit.js index a1342b2..a0abbc2 100755 --- a/proveit.js +++ b/proveit.js @@ -1135,7 +1135,7 @@ form = event.data; $( 'tr', form ).show().filter( function () { - return $( 'label', this ).text().toLowerCase().startsWith( filter ) ? false : true; + return $( this ).text().toLowerCase().indexOf( filter ) > -1 ? false : true; }).hide(); }; -- To view, visit https://gerrit.wikimedia.org/r/348785 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I70522ad7cb28e42b5cf68e36dfe219a04ca090dd Gerrit-PatchSet: 1 Gerrit-Project: wikipedia/gadgets/ProveIt Gerrit-Branch: master Gerrit-Owner: Sophivorus ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Add support for 'block' format
Sophivorus has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/348784 ) Change subject: Add support for 'block' format .. Add support for 'block' format Also minor CSS change Bug: T157431 Change-Id: I95cd3dd25565d0c41989256863b9061e65da191b --- M proveit.css M proveit.js 2 files changed, 16 insertions(+), 5 deletions(-) Approvals: Sophivorus: Verified; Looks good to me, approved diff --git a/proveit.css b/proveit.css index 549a4f9..2d15908 100755 --- a/proveit.css +++ b/proveit.css @@ -43,7 +43,8 @@ background: #ccc; } -#proveit-header span:not(.active):not(#proveit-logo):hover { +#proveit-list-tab:not(.active):hover, +#proveit-add-tab:not(.active):hover { display: inline-block; background: #eee; } diff --git a/proveit.js b/proveit.js index c8960d8..a1342b2 100755 --- a/proveit.js +++ b/proveit.js @@ -866,13 +866,23 @@ // Build the template string if ( this.template ) { - var templateString = '{{' + this.template; + var templateData = this.getTemplateData(), + format = templateData.format, + templateString = '{{' + this.template; for ( var name in this.paramPairs ) { - templateString += ' |' + name + '=' + this.paramPairs[ name ]; + if ( format === 'block' ) { + templateString += '\r\n| ' + name + ' = ' + this.paramPairs[ name ]; + } else { + templateString += ' |' + name + '=' + this.paramPairs[ name ]; + } } - templateString += '}}'; + if ( format === 'block' ) { + templateString += '\r\n}}'; + } else { + templateString += '}}'; + } // Build the content string by replacing the old template string with the new - // By doing this we keep any content that before or after the template string + // By doing this we keep any content that was before or after the template string this.content = this.content.replace( this.templateString, templateString ); this.templateString = templateString; } -- To view, visit https://gerrit.wikimedia.org/r/348784 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I95cd3dd25565d0c41989256863b9061e65da191b Gerrit-PatchSet: 1 Gerrit-Project: wikipedia/gadgets/ProveIt Gerrit-Branch: master Gerrit-Owner: Sophivorus Gerrit-Reviewer: Sophivorus ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Add support for 'block' format
Sophivorus has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/348784 ) Change subject: Add support for 'block' format .. Add support for 'block' format Also minor CSS change Bug: T157431 Change-Id: I95cd3dd25565d0c41989256863b9061e65da191b --- M proveit.css M proveit.js 2 files changed, 16 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikipedia/gadgets/ProveIt refs/changes/84/348784/1 diff --git a/proveit.css b/proveit.css index 549a4f9..2d15908 100755 --- a/proveit.css +++ b/proveit.css @@ -43,7 +43,8 @@ background: #ccc; } -#proveit-header span:not(.active):not(#proveit-logo):hover { +#proveit-list-tab:not(.active):hover, +#proveit-add-tab:not(.active):hover { display: inline-block; background: #eee; } diff --git a/proveit.js b/proveit.js index c8960d8..a1342b2 100755 --- a/proveit.js +++ b/proveit.js @@ -866,13 +866,23 @@ // Build the template string if ( this.template ) { - var templateString = '{{' + this.template; + var templateData = this.getTemplateData(), + format = templateData.format, + templateString = '{{' + this.template; for ( var name in this.paramPairs ) { - templateString += ' |' + name + '=' + this.paramPairs[ name ]; + if ( format === 'block' ) { + templateString += '\r\n| ' + name + ' = ' + this.paramPairs[ name ]; + } else { + templateString += ' |' + name + '=' + this.paramPairs[ name ]; + } } - templateString += '}}'; + if ( format === 'block' ) { + templateString += '\r\n}}'; + } else { + templateString += '}}'; + } // Build the content string by replacing the old template string with the new - // By doing this we keep any content that before or after the template string + // By doing this we keep any content that was before or after the template string this.content = this.content.replace( this.templateString, templateString ); this.templateString = templateString; } -- To view, visit https://gerrit.wikimedia.org/r/348784 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I95cd3dd25565d0c41989256863b9061e65da191b Gerrit-PatchSet: 1 Gerrit-Project: wikipedia/gadgets/ProveIt Gerrit-Branch: master Gerrit-Owner: Sophivorus ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Add field filtering
Sophivorus has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/348739 ) Change subject: Add field filtering .. Add field filtering Bug: T160560 Change-Id: I6e4ce8a6037d0e734ec6d3b0112640fa0a69ff62 --- M i18n/en.json M i18n/es.json M i18n/qqq.json M proveit.css M proveit.js 5 files changed, 39 insertions(+), 13 deletions(-) Approvals: Sophivorus: Verified; Looks good to me, approved diff --git a/i18n/en.json b/i18n/en.json index 24b9ae5..9680617 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -16,5 +16,6 @@ "proveit-prompt-name": "The reference needs a name in order to be cited:", "proveit-confirm-remove": "This will remove the reference and all of its citations. Are you sure?", "proveit-no-template": "No template", - "proveit-no-references": "No references found" + "proveit-no-references": "No references found", + "proveit-filter-field": "Filter fields" } \ No newline at end of file diff --git a/i18n/es.json b/i18n/es.json index 2c95aee..c076ed1 100644 --- a/i18n/es.json +++ b/i18n/es.json @@ -17,5 +17,6 @@ "proveit-prompt-name": "La referencia necesita un nombre para ser citada:", "proveit-confirm-remove": "Esto borra la referencia y todas sus citas. ¿Estás seguro?", "proveit-no-template": "Sin plantilla", - "proveit-no-references": "No se encontraron referencias" + "proveit-no-references": "No se encontraron referencias", + "proveit-filter-field": "Filtrar campos" } diff --git a/i18n/qqq.json b/i18n/qqq.json index 6b4ae56..87a0a46 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -18,5 +18,6 @@ "proveit-prompt-name": "Text for the dialog prompted when a user tries to add a citation for a reference without a name", "proveit-confirm-remove": "Text for the alert prompted when a user tries to remove a reference with or without citations", "proveit-no-template": "Text for the dropdown option corresponding to the references without a template", - "proveit-no-references": "Text for when no references are found" + "proveit-no-references": "Text for when no references are found", + "proveit-filter-field": "Placeholder for the input field to filter parameters" } diff --git a/proveit.css b/proveit.css index fb57beb..549a4f9 100755 --- a/proveit.css +++ b/proveit.css @@ -111,7 +111,7 @@ } #proveit-reference-form td:first-child { - width: 20%; + width: 150px; padding-left: 5px; } @@ -143,7 +143,7 @@ resize: vertical; } -#proveit-buttons { +#proveit-footer { background: #f0f0f0; border-spacing: 0; border-top: 1px solid #ddd; @@ -157,7 +157,14 @@ width: 100%; } -#proveit-buttons button { +#proveit-footer input { + padding: .6em; + pointer-events: all; + width: 150px; + float: left; +} + +#proveit-footer button { border: 1px solid #ccc; cursor: pointer; font: inherit; @@ -166,7 +173,7 @@ pointer-events: all; } -#proveit-buttons button:hover { +#proveit-footer button:hover { background: #eee; } diff --git a/proveit.js b/proveit.js index dcb4de5..c8960d8 100755 --- a/proveit.js +++ b/proveit.js @@ -662,7 +662,7 @@ // Switch to edit mode $( '#proveit-list-tab' ).addClass( 'active' ).siblings().removeClass( 'active' ); $( '#proveit-reference-table' ).replaceWith( reference.toTable() ); - $( '#proveit-insert-button' ).hide().siblings().show(); + $( '#proveit-insert-button' ).hide().siblings( 'button' ).show(); // Add the tag and summary proveit.addTag(); @@ -915,7 +915,7 @@ form = reference.toForm(); reference.highlight(); $( '#proveit-content' ).html( form ); - $( '#proveit-insert-button' ).hide().siblings().show(); + $( '#proveit-insert-button' ).hide().siblings( 'button' ).show(); }); $( '.proveit-citation', item ).click( this, function ( event ) { @@ -1094,17 +1094,19 @@ var form = $( '' ).attr( 'id', 'proveit-reference-form' ), table = this.toTable(); - // Add the buttons - var buttons = $( '' ).attr( 'id', 'proveit-buttons' ), + // Add the footer + var footer = $( '' ).attr( 'id', 'proveit-footer' ), + filterField = $( '' ).attr({ 'id': 'proveit-filter-field', 'placeholder': proveit.getMessage( 'filter-field' ) }), citeButton = $( '' ).attr( 'id', 'prove
[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Add field filtering
Sophivorus has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/348739 ) Change subject: Add field filtering .. Add field filtering Bug: T160560 Change-Id: I6e4ce8a6037d0e734ec6d3b0112640fa0a69ff62 --- M i18n/en.json M i18n/es.json M i18n/qqq.json M proveit.css M proveit.js 5 files changed, 39 insertions(+), 13 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikipedia/gadgets/ProveIt refs/changes/39/348739/1 diff --git a/i18n/en.json b/i18n/en.json index 24b9ae5..9680617 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -16,5 +16,6 @@ "proveit-prompt-name": "The reference needs a name in order to be cited:", "proveit-confirm-remove": "This will remove the reference and all of its citations. Are you sure?", "proveit-no-template": "No template", - "proveit-no-references": "No references found" + "proveit-no-references": "No references found", + "proveit-filter-field": "Filter fields" } \ No newline at end of file diff --git a/i18n/es.json b/i18n/es.json index 2c95aee..c076ed1 100644 --- a/i18n/es.json +++ b/i18n/es.json @@ -17,5 +17,6 @@ "proveit-prompt-name": "La referencia necesita un nombre para ser citada:", "proveit-confirm-remove": "Esto borra la referencia y todas sus citas. ¿Estás seguro?", "proveit-no-template": "Sin plantilla", - "proveit-no-references": "No se encontraron referencias" + "proveit-no-references": "No se encontraron referencias", + "proveit-filter-field": "Filtrar campos" } diff --git a/i18n/qqq.json b/i18n/qqq.json index 6b4ae56..87a0a46 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -18,5 +18,6 @@ "proveit-prompt-name": "Text for the dialog prompted when a user tries to add a citation for a reference without a name", "proveit-confirm-remove": "Text for the alert prompted when a user tries to remove a reference with or without citations", "proveit-no-template": "Text for the dropdown option corresponding to the references without a template", - "proveit-no-references": "Text for when no references are found" + "proveit-no-references": "Text for when no references are found", + "proveit-filter-field": "Placeholder for the input field to filter parameters" } diff --git a/proveit.css b/proveit.css index fb57beb..549a4f9 100755 --- a/proveit.css +++ b/proveit.css @@ -111,7 +111,7 @@ } #proveit-reference-form td:first-child { - width: 20%; + width: 150px; padding-left: 5px; } @@ -143,7 +143,7 @@ resize: vertical; } -#proveit-buttons { +#proveit-footer { background: #f0f0f0; border-spacing: 0; border-top: 1px solid #ddd; @@ -157,7 +157,14 @@ width: 100%; } -#proveit-buttons button { +#proveit-footer input { + padding: .6em; + pointer-events: all; + width: 150px; + float: left; +} + +#proveit-footer button { border: 1px solid #ccc; cursor: pointer; font: inherit; @@ -166,7 +173,7 @@ pointer-events: all; } -#proveit-buttons button:hover { +#proveit-footer button:hover { background: #eee; } diff --git a/proveit.js b/proveit.js index dcb4de5..c8960d8 100755 --- a/proveit.js +++ b/proveit.js @@ -662,7 +662,7 @@ // Switch to edit mode $( '#proveit-list-tab' ).addClass( 'active' ).siblings().removeClass( 'active' ); $( '#proveit-reference-table' ).replaceWith( reference.toTable() ); - $( '#proveit-insert-button' ).hide().siblings().show(); + $( '#proveit-insert-button' ).hide().siblings( 'button' ).show(); // Add the tag and summary proveit.addTag(); @@ -915,7 +915,7 @@ form = reference.toForm(); reference.highlight(); $( '#proveit-content' ).html( form ); - $( '#proveit-insert-button' ).hide().siblings().show(); + $( '#proveit-insert-button' ).hide().siblings( 'button' ).show(); }); $( '.proveit-citation', item ).click( this, function ( event ) { @@ -1094,17 +1094,19 @@ var form = $( '' ).attr( 'id', 'proveit-reference-form' ), table = this.toTable(); - // Add the buttons - var buttons = $( '' ).attr( 'id', 'proveit-buttons' ), + // Add the footer + var footer = $( '' ).attr( 'id', 'proveit-footer' ), + filterField = $( '' ).attr({ 'id': 'proveit-filter-field', 'placeholder': proveit.getMessage( 'filter-field' ) }), citeButton = $(
[MediaWiki-commits] [Gerrit] translatewiki[master]: Add ProveIt gadget
Sophivorus has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/347791 ) Change subject: Add ProveIt gadget .. Add ProveIt gadget * https://phabricator.wikimedia.org/T149177 * https://translatewiki.net/wiki/Thread:Support/New_project Change-Id: Ic586881868cd20a386a5dee8e0b625f43c92cd2a --- M TranslateSettings.php M bin/EXTERNAL-PROJECTS M bin/REPONG-PROJECTS A groups/Wikimedia/ProveIt.yaml M repoconfig.commit.json M repoconfig.json 6 files changed, 47 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/translatewiki refs/changes/91/347791/1 diff --git a/TranslateSettings.php b/TranslateSettings.php index 238b0cc..08803cc 100644 --- a/TranslateSettings.php +++ b/TranslateSettings.php @@ -245,6 +245,7 @@ $wgTranslateGroupFiles[] = "$GROUPS/Wikimedia/ia-upload.yaml"; $wgTranslateGroupAliases['out-jquery-uls'] = 'jquery-uls'; $wgTranslateGroupFiles[] = "$GROUPS/Wikimedia/Pageviews.yaml"; +$wgTranslateGroupFiles[] = "$GROUPS/Wikimedia/ProveIt.yaml"; $wgTranslateGroupFiles[] = "$GROUPS/Wikimedia/video2commons.yaml"; $wgTranslateGroupFiles[] = "$GROUPS/Wikimedia/wiki-ai.yaml"; $wgTranslateGroupFiles[] = "$GROUPS/Wikimedia/WikiBlame.yaml"; diff --git a/bin/EXTERNAL-PROJECTS b/bin/EXTERNAL-PROJECTS index 333c1e2..fd7c3f9 100644 --- a/bin/EXTERNAL-PROJECTS +++ b/bin/EXTERNAL-PROJECTS @@ -32,6 +32,7 @@ oppia osm pageviews +proveit pywikibot vicuna video2commons diff --git a/bin/REPONG-PROJECTS b/bin/REPONG-PROJECTS index 2253437..4af13be 100644 --- a/bin/REPONG-PROJECTS +++ b/bin/REPONG-PROJECTS @@ -30,6 +30,7 @@ oppia osm pageviews +proveit pywikibot vicuna video2commons diff --git a/groups/Wikimedia/ProveIt.yaml b/groups/Wikimedia/ProveIt.yaml new file mode 100644 index 000..3e39ec2 --- /dev/null +++ b/groups/Wikimedia/ProveIt.yaml @@ -0,0 +1,26 @@ +BASIC: + id: proveit + label: ProveIt + icon: wiki://ProveIt logo for user boxes.svg + description: "{{Special:MyLanguage/Translations:Group descriptions/proveit/en}}" + class: FileBasedMessageGroup + namespace: NS_WIKIMEDIA + +MANGLER: + class: StringMatcher + prefix: proveit- + patterns: +- "*" + +FILES: + class: JsonFFS + sourcePattern: "%GROUPROOT%/proveit/i18n/%CODE%.json" + +CHECKER: + class: MediaWikiMessageChecker + checks: +- wikiParameterCheck +- pluralCheck + +INSERTABLES: + class: MediaWikiInsertablesSuggester diff --git a/repoconfig.commit.json b/repoconfig.commit.json index 0d2fe5d..048f944 100644 --- a/repoconfig.commit.json +++ b/repoconfig.commit.json @@ -340,6 +340,15 @@ } } }, + "proveit": { + "group": "proveit", + "repos": { + "proveit": { + "type": "wmgerrit", + "url": "https://gerrit.wikimedia.org/r/p/wikipedia/gadgets/ProveIt"; + } + } + }, "pywikibot": { "group": "out-pywikipedia-*", "export-threshold": 1, diff --git a/repoconfig.json b/repoconfig.json index 7c5a920..9972bd2 100644 --- a/repoconfig.json +++ b/repoconfig.json @@ -340,6 +340,15 @@ } } }, + "proveit": { + "group": "proveit", + "repos": { + "proveit": { + "type": "wmgerrit", + "url": "https://gerrit.wikimedia.org/r/p/wikipedia/gadgets/ProveIt"; + } + } + }, "pywikibot": { "group": "out-pywikipedia-*", "export-threshold": 1, -- To view, visit https://gerrit.wikimedia.org/r/347791 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic586881868cd20a386a5dee8e0b625f43c92cd2a Gerrit-PatchSet: 1 Gerrit-Project: translatewiki Gerrit-Branch: master Gerrit-Owner: Sophivorus ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: UI can now be dragged in Firefox
Sophivorus has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/347717 ) Change subject: UI can now be dragged in Firefox .. UI can now be dragged in Firefox Thanks Uglemat! Bug T150407 Change-Id: I01cec3e17a3373d79dc11440d7451ec074360ba0 --- M proveit.js 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Sophivorus: Verified; Looks good to me, approved diff --git a/proveit.js b/proveit.js index 27220ab..dcb4de5 100755 --- a/proveit.js +++ b/proveit.js @@ -207,7 +207,7 @@ handle: header, containment: 'window', start: function ( event ) { - if ( event.toElement.id !== 'proveit-header' ) { + if ( event.originalEvent.target.id !== 'proveit-header' ) { dragged = true; } gui.css({ -- To view, visit https://gerrit.wikimedia.org/r/347717 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I01cec3e17a3373d79dc11440d7451ec074360ba0 Gerrit-PatchSet: 2 Gerrit-Project: wikipedia/gadgets/ProveIt Gerrit-Branch: master Gerrit-Owner: Sophivorus Gerrit-Reviewer: Sophivorus ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: UI can now be dragged in Firefox
Sophivorus has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/347717 ) Change subject: UI can now be dragged in Firefox .. UI can now be dragged in Firefox Thanks Uglemat! Bug T150407 Change-Id: I01cec3e17a3373d79dc11440d7451ec074360ba0 --- M proveit.js 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/wikipedia/gadgets/ProveIt refs/changes/17/347717/1 diff --git a/proveit.js b/proveit.js index 27220ab..dcb4de5 100755 --- a/proveit.js +++ b/proveit.js @@ -207,7 +207,7 @@ handle: header, containment: 'window', start: function ( event ) { - if ( event.toElement.id !== 'proveit-header' ) { + if ( event.originalEvent.target.id !== 'proveit-header' ) { dragged = true; } gui.css({ -- To view, visit https://gerrit.wikimedia.org/r/347717 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I01cec3e17a3373d79dc11440d7451ec074360ba0 Gerrit-PatchSet: 1 Gerrit-Project: wikipedia/gadgets/ProveIt Gerrit-Branch: master Gerrit-Owner: Sophivorus ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Delete obsolete deploy script
Sophivorus has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/347213 ) Change subject: Delete obsolete deploy script .. Delete obsolete deploy script Change-Id: I60c6cae9b8065ab3ad23f5bc8900167f8cc3ca4d --- D deploy.php 1 file changed, 0 insertions(+), 298 deletions(-) Approvals: Sophivorus: Verified; Looks good to me, approved diff --git a/deploy.php b/deploy.php deleted file mode 100755 index 495be5d..000 --- a/deploy.php +++ /dev/null @@ -1,298 +0,0 @@ -#!/usr/bin/php -https://github.com/proveit-js/proveit'); -define('IMPORT_HEADER', <<<'EOH' -/* - * Imported from Git commit %s as of %s from https://github.com/proveit-js/proveit - * Changes should be made through that GitHub project. - */ -EOH -); -define('USER_AGENT', 'ProveIt deploy script (https://github.com/proveit-js/proveit)'); -define('REV_SHORT', 'r'); -define('REV_LONG', 'rev'); -define('TYPE_SHORT', 't'); -define('TYPE_LONG', 'type'); -define('SSH_DEFAULT_PORT', 22); -$options = getopt(REV_SHORT . ':' . TYPE_SHORT . ':', array(REV_LONG . ':', TYPE_LONG . ':')); - -function get_option_value($options, $short, $long, $meaning, $err_code) -{ - if(isset($options[$short])) { - return $options[$short]; - } - else if(isset($options[$long])) { - return $options[$long]; - } - else { - fwrite(STDERR, "You must specify the $meaning. Use -$short or --$long.\n"); - exit($err_code); - } -} - -function sftp_walk($con, $sftp, $local_dir, $remote_dir) -{ - $dir = opendir($local_dir); - ssh2_sftp_mkdir($sftp, $remote_dir, 0755, true); - while (($file = readdir($dir)) !== false) { - $local_file = $local_dir . '/' . $file; - $remote_file = $remote_dir . '/' . $file; - if(!is_dir($local_file)) { - echo "Transferring $local_file to $remote_file\n"; - $scp_ret = ssh2_scp_send($con, $local_file, $remote_file, 0755); - if(!$scp_ret) { - fwrite(STDERR, "Failed to transfer $local_file.\n"); - exit(8); - } - } - else if($file != "." && $file != "..") { - sftp_walk($con, $sftp, $local_file, $remote_file); - } - } -} - -function sync_yui($configuration) { - system('./yuidoc.sh', $yui_exit); - if($yui_exit != 0) { - fwrite(STDERR, "Failed to run yuidoc. Please check that it and its dependencies are installed.\n"); - exit(11); - } - $port = isset($configuration->ssh->port) ? $configuration->ssh->port : DEFAULT_SSH_PORT; - echo "Connecting to {$configuration->ssh->host} on port $port\n"; - - $con = ssh2_connect($configuration->ssh->host, $port); - if(!$con) { - fwrite(STDERR, "Failed to connect to {$configuration->ssh->host}\n"); - exit(10); - } - - if(isset($configuration->ssh->password)) { - $auth_ret = ssh2_auth_password($con, $configuration->ssh->username, $configuration->ssh->password); - if(!$auth_ret) { - fwrite(STDERR, 'SSH password authentication failed.\n'); - exit(6); - } - } - else { - $passphrase = isset($configuration->ssh->passphrase) ? $configuration->ssh->passphrase : NULL; - $auth_ret = ssh2_auth_pubkey_file($con, $configuration->ssh->username, $configuration->ssh->publicKeyFileName, $configuration->ssh->privateKeyFileName, $passphrase); - if(!$auth_ret) { - fwrite(STDERR, 'SSH public/private key authentication failed.\n'); - exit(15); - } - - } - - $sftp = ssh2_sftp($con); - if(!$sftp) { - fwrite(STDERR, "Failed to open SFTP subsystem.\n"); - exit(7); - } - - sftp_walk($con, $sftp, 'yui_docs/html', $configuration->ssh->path); - chdir(dirname(__FILE__)); - echo "You have succesfully deployed the ProveIt API documentation.\n"; -} - -$opt_deploy_type = get_option_value($options, TYPE_SHORT, TYPE_LONG, 'deployment type (proveitgt, prod, etc.)', 12); -$configuration_filename = "./deploy_configuration.{$opt_deploy_type}.json"; -if(!file_exists($configuration_filename)) { - fwrite(STDERR, "$configuration_filename does not exist. Ensure that '$opt_deploy_type' is the correct type and the file exists.\n"); - exit(13); -} - -$configuration = json_decode(file_get_contents($configuration_filename)); -# Must have at least one wiki page. -if(!isset($configuration->users[0]->username, $configuration->users[0]->password)) { - fwrite(STDERR, <<< 'EOM' - You must provide a JSON file,
[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Delete obsolete deploy script
Sophivorus has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/347213 ) Change subject: Delete obsolete deploy script .. Delete obsolete deploy script Change-Id: I60c6cae9b8065ab3ad23f5bc8900167f8cc3ca4d --- D deploy.php 1 file changed, 0 insertions(+), 298 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikipedia/gadgets/ProveIt refs/changes/13/347213/1 diff --git a/deploy.php b/deploy.php deleted file mode 100755 index 495be5d..000 --- a/deploy.php +++ /dev/null @@ -1,298 +0,0 @@ -#!/usr/bin/php -https://github.com/proveit-js/proveit'); -define('IMPORT_HEADER', <<<'EOH' -/* - * Imported from Git commit %s as of %s from https://github.com/proveit-js/proveit - * Changes should be made through that GitHub project. - */ -EOH -); -define('USER_AGENT', 'ProveIt deploy script (https://github.com/proveit-js/proveit)'); -define('REV_SHORT', 'r'); -define('REV_LONG', 'rev'); -define('TYPE_SHORT', 't'); -define('TYPE_LONG', 'type'); -define('SSH_DEFAULT_PORT', 22); -$options = getopt(REV_SHORT . ':' . TYPE_SHORT . ':', array(REV_LONG . ':', TYPE_LONG . ':')); - -function get_option_value($options, $short, $long, $meaning, $err_code) -{ - if(isset($options[$short])) { - return $options[$short]; - } - else if(isset($options[$long])) { - return $options[$long]; - } - else { - fwrite(STDERR, "You must specify the $meaning. Use -$short or --$long.\n"); - exit($err_code); - } -} - -function sftp_walk($con, $sftp, $local_dir, $remote_dir) -{ - $dir = opendir($local_dir); - ssh2_sftp_mkdir($sftp, $remote_dir, 0755, true); - while (($file = readdir($dir)) !== false) { - $local_file = $local_dir . '/' . $file; - $remote_file = $remote_dir . '/' . $file; - if(!is_dir($local_file)) { - echo "Transferring $local_file to $remote_file\n"; - $scp_ret = ssh2_scp_send($con, $local_file, $remote_file, 0755); - if(!$scp_ret) { - fwrite(STDERR, "Failed to transfer $local_file.\n"); - exit(8); - } - } - else if($file != "." && $file != "..") { - sftp_walk($con, $sftp, $local_file, $remote_file); - } - } -} - -function sync_yui($configuration) { - system('./yuidoc.sh', $yui_exit); - if($yui_exit != 0) { - fwrite(STDERR, "Failed to run yuidoc. Please check that it and its dependencies are installed.\n"); - exit(11); - } - $port = isset($configuration->ssh->port) ? $configuration->ssh->port : DEFAULT_SSH_PORT; - echo "Connecting to {$configuration->ssh->host} on port $port\n"; - - $con = ssh2_connect($configuration->ssh->host, $port); - if(!$con) { - fwrite(STDERR, "Failed to connect to {$configuration->ssh->host}\n"); - exit(10); - } - - if(isset($configuration->ssh->password)) { - $auth_ret = ssh2_auth_password($con, $configuration->ssh->username, $configuration->ssh->password); - if(!$auth_ret) { - fwrite(STDERR, 'SSH password authentication failed.\n'); - exit(6); - } - } - else { - $passphrase = isset($configuration->ssh->passphrase) ? $configuration->ssh->passphrase : NULL; - $auth_ret = ssh2_auth_pubkey_file($con, $configuration->ssh->username, $configuration->ssh->publicKeyFileName, $configuration->ssh->privateKeyFileName, $passphrase); - if(!$auth_ret) { - fwrite(STDERR, 'SSH public/private key authentication failed.\n'); - exit(15); - } - - } - - $sftp = ssh2_sftp($con); - if(!$sftp) { - fwrite(STDERR, "Failed to open SFTP subsystem.\n"); - exit(7); - } - - sftp_walk($con, $sftp, 'yui_docs/html', $configuration->ssh->path); - chdir(dirname(__FILE__)); - echo "You have succesfully deployed the ProveIt API documentation.\n"; -} - -$opt_deploy_type = get_option_value($options, TYPE_SHORT, TYPE_LONG, 'deployment type (proveitgt, prod, etc.)', 12); -$configuration_filename = "./deploy_configuration.{$opt_deploy_type}.json"; -if(!file_exists($configuration_filename)) { - fwrite(STDERR, "$configuration_filename does not exist. Ensure that '$opt_deploy_type' is the correct type and the file exists.\n"); - exit(13); -} - -$configuration = json_decode(file_get_contents($configuration_filename)); -# Must have at least one wiki page. -if(!isset($configuration->users[0]->username, $configuration->users[0]->password)) { - fwrite(STDERR, <<< 'EOM' - You
[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Delete obsolete website files
Sophivorus has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/347212 ) Change subject: Delete obsolete website files .. Delete obsolete website files Files are accessible via version control if they are ever needed (unlikely), so I delete them to keep the repo clean and avoid confusion for potential new developers. Bug T148228 Change-Id: I395c9ed037a19e9e6e9038996133e7b3d45a6a58 --- D website/about.php D website/credits.php D website/demo.php D website/developers.php D website/features.php D website/footer.php D website/header.php D website/img/about_leadIn.jpg D website/img/citationPopo.jpg D website/img/credits.jpg D website/img/credits_image_link.jpg D website/img/demo_image_link.jpg D website/img/developers_leadIn.jpg D website/img/documentation.jpg D website/img/documentation_image_link.jpg D website/img/documentation_leadIn.jpg D website/img/favicon.ico D website/img/features.jpg D website/img/features_image_link.jpg D website/img/features_leadIn.jpg D website/img/gCode.jpg D website/img/gCode_image_link.jpg D website/img/gCode_leadIn.jpg D website/img/get.jpg D website/img/get_rollover.jpg D website/img/index.jpg D website/img/install.jpg D website/img/notfound.jpg D website/img/proveIt_logo-02.jpg D website/img/proveIt_logo_small-04.png D website/img/proveIt_logo_small.jpg D website/img/proveit_logo-02.png D website/img/proveit_logo.png D website/img/proveit_logo_small.png D website/img/reportabug.jpg D website/img/reportabug_image_link.jpg D website/img/reportabug_leadIn.jpg D website/img/research.jpg D website/img/research_image_link.jpg D website/img/research_leadIn.jpg D website/img/screenshots.jpg D website/img/screenshots/proveit-add.png D website/img/screenshots/proveit-basic.png D website/img/screenshots/proveit-edit.png D website/img/screenshots/proveit-minimized.png D website/img/screenshots_image_link.jpg D website/img/screenshots_leadIn.jpg D website/img/tempLogo.jpg D website/img/test_link.jpg D website/img/theTeam_leadIn.jpg D website/img/theteam.jpg D website/img/theteam_image_link.jpg D website/img/tutorials.jpg D website/img/tutorials_image_link.jpg D website/img/tutorials_leadIn.jpg D website/img/userguide.jpg D website/img/userguide_image_link.jpg D website/img/users_leadIn.jpg D website/img/wiki.jpg D website/img/wiki_image_link.jpg D website/img/wiki_leadIn.jpg D website/img/wikipedia_referencing_simplified.jpg D website/index.php D website/install.php D website/jquery.ba-hashchange.min.js D website/notfound.php D website/pdf/a43-luther.pdf D website/reportabug.php D website/research.php D website/screenshots.php D website/scripts.js D website/theteam.php D website/tutorials.php D website/userguide.php D website/users.php D website/website_styles.css D website/wikibits.js D website_configuration/proveit 78 files changed, 0 insertions(+), 1,866 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikipedia/gadgets/ProveIt refs/changes/12/347212/1 diff --git a/website/about.php b/website/about.php deleted file mode 100644 index f883a77..000 --- a/website/about.php +++ /dev/null @@ -1,16 +0,0 @@ - - - Research - The Team - Credits - - - - - \ No newline at end of file diff --git a/website/credits.php b/website/credits.php deleted file mode 100644 index 9b9e642..000 --- a/website/credits.php +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - Credits - - - - Besides core team members, ProveIt depends on the efforts of issue reporters and others providing feedback. It also relies on the following code and resources: - - - MediaWiki, including http://bits.wikimedia.org/skins-1.5/common/wikibits.js";>wikibits.js. - Wikipedia http://bits.wikimedia.org/skins-1.5/common/jquery.min.js";>version of http://jquery.com/";>jQuery, which must already be loaded. - Icons from the http://www.famfamfam.com/lab/icons/silk/";>Silk icon set, by Mark James, used under Creative Commons Attribution 3.0 License. - http://jqueryui.com";>jQueryUI, via MediaWiki core. - Public domain code
[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Fix buggy regex to match names with spaces
Sophivorus has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/347210 ) Change subject: Fix buggy regex to match names with spaces .. Fix buggy regex to match names with spaces Patch by Uglemat, thanks! Bug T162488 Change-Id: Iefd4ba03751f6cd7d88975580198bf1f34a6143d --- M proveit.js 1 file changed, 5 insertions(+), 5 deletions(-) Approvals: Sophivorus: Verified; Looks good to me, approved diff --git a/proveit.js b/proveit.js index 551b9d5..27220ab 100755 --- a/proveit.js +++ b/proveit.js @@ -274,12 +274,12 @@ // First look for all the citations and store them in an array for later var wikitext = proveit.getTextbox().val(), citations = [], - citationsRegExp = /<\s*ref\s+name\s*=\s*["|']?\s*([^"'\s]+)\s*["|']?\s*\/\s*>/ig, // Three patterns: , and + citationsRegExp = /<\s*ref\s+name\s*=\s*((["'])(((?!\2).)+)\2|([^\s'">\/]+))\s*\/\s*>/ig, // Three patterns: , and match, citation; - while ( ( match = citationsRegExp.exec( wikitext ) ) ) { - citation = new proveit.Citation({ 'name': match[1], 'index': match.index, 'string': match[0] }); + while ( ( match = citationsRegExp.exec( wikitext ) ) ) { + citation = new proveit.Citation({ 'name': match[3] || match[5], 'index': match.index, 'string': match[0] }); citations.push( citation ); } @@ -330,9 +330,9 @@ // Extract the reference name, if any // Three patterns: , and var referenceName = null, - match = referenceString.match( /<[\s]*ref[\s]*name[\s]*=[\s]*(?:(?:\"(.*?)\")|(?:\'(.*?)\')|(?:(.*?)))[\s]*>/i ); + match = referenceString.match( /<\s*ref\s+name\s*=\s*((["'])(((?!\2).)+)\2|([^\s'">]+))\s*\s*>/i ); if ( match ) { - referenceName = match[1] || match[2] || match[3]; + referenceName = match[3] || match[5]; } // Get the index -- To view, visit https://gerrit.wikimedia.org/r/347210 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iefd4ba03751f6cd7d88975580198bf1f34a6143d Gerrit-PatchSet: 1 Gerrit-Project: wikipedia/gadgets/ProveIt Gerrit-Branch: master Gerrit-Owner: Sophivorus Gerrit-Reviewer: Sophivorus ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Fix buggy regex to match names with spaces
Sophivorus has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/347210 ) Change subject: Fix buggy regex to match names with spaces .. Fix buggy regex to match names with spaces Patch by Uglemat, thanks! Bug T162488 Change-Id: Iefd4ba03751f6cd7d88975580198bf1f34a6143d --- M proveit.js 1 file changed, 5 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikipedia/gadgets/ProveIt refs/changes/10/347210/1 diff --git a/proveit.js b/proveit.js index 551b9d5..27220ab 100755 --- a/proveit.js +++ b/proveit.js @@ -274,12 +274,12 @@ // First look for all the citations and store them in an array for later var wikitext = proveit.getTextbox().val(), citations = [], - citationsRegExp = /<\s*ref\s+name\s*=\s*["|']?\s*([^"'\s]+)\s*["|']?\s*\/\s*>/ig, // Three patterns: , and + citationsRegExp = /<\s*ref\s+name\s*=\s*((["'])(((?!\2).)+)\2|([^\s'">\/]+))\s*\/\s*>/ig, // Three patterns: , and match, citation; - while ( ( match = citationsRegExp.exec( wikitext ) ) ) { - citation = new proveit.Citation({ 'name': match[1], 'index': match.index, 'string': match[0] }); + while ( ( match = citationsRegExp.exec( wikitext ) ) ) { + citation = new proveit.Citation({ 'name': match[3] || match[5], 'index': match.index, 'string': match[0] }); citations.push( citation ); } @@ -330,9 +330,9 @@ // Extract the reference name, if any // Three patterns: , and var referenceName = null, - match = referenceString.match( /<[\s]*ref[\s]*name[\s]*=[\s]*(?:(?:\"(.*?)\")|(?:\'(.*?)\')|(?:(.*?)))[\s]*>/i ); + match = referenceString.match( /<\s*ref\s+name\s*=\s*((["'])(((?!\2).)+)\2|([^\s'">]+))\s*\s*>/i ); if ( match ) { - referenceName = match[1] || match[2] || match[3]; + referenceName = match[3] || match[5]; } // Get the index -- To view, visit https://gerrit.wikimedia.org/r/347210 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iefd4ba03751f6cd7d88975580198bf1f34a6143d Gerrit-PatchSet: 1 Gerrit-Project: wikipedia/gadgets/ProveIt Gerrit-Branch: master Gerrit-Owner: Sophivorus ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...InputBox[master]: Fix useve param by removing unused get params
Sophivorus has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/347208 ) Change subject: Fix useve param by removing unused get params .. Fix useve param by removing unused get params Also, cleaner URLs Bug T147048 Change-Id: I84b3da54a4cfb54891090a171acff565c618ff9c --- M InputBox.classes.php 1 file changed, 18 insertions(+), 6 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/InputBox refs/changes/08/347208/1 diff --git a/InputBox.classes.php b/InputBox.classes.php index b03ccd4..ccb1bb7 100644 --- a/InputBox.classes.php +++ b/InputBox.classes.php @@ -390,15 +390,27 @@ $htmlOut .= Xml::openElement( 'form', $createBoxParams ); $editArgs = $this->getEditActionArgs(); $htmlOut .= Html::hidden( $editArgs['name'], $editArgs['value'] ); - $htmlOut .= Html::hidden( 'preload', $this->mPreload ); + if ( $this->mPreload ) { + $htmlOut .= Html::hidden( 'preload', $this->mPreload ); + } foreach ( $this->mPreloadparams as $preloadparams ) { $htmlOut .= Html::hidden( 'preloadparams[]', $preloadparams ); } - $htmlOut .= Html::hidden( 'editintro', $this->mEditIntro ); - $htmlOut .= Html::hidden( 'summary', $this->mSummary ); - $htmlOut .= Html::hidden( 'nosummary', $this->mNosummary ); - $htmlOut .= Html::hidden( 'prefix', $this->mPrefix ); - $htmlOut .= Html::hidden( 'minor', $this->mMinor ); + if ( $this->mEditIntro ) { + $htmlOut .= Html::hidden( 'editintro', $this->mEditIntro ); + } + if ( $this->mSummary ) { + $htmlOut .= Html::hidden( 'summary', $this->mSummary ); + } + if ( $this->mNosummary ) { + $htmlOut .= Html::hidden( 'nosummary', $this->mNosummary ); + } + if ( $this->mPrefix ) { + $htmlOut .= Html::hidden( 'prefix', $this->mPrefix ); + } + if ( $this->mMinor ) { + $htmlOut .= Html::hidden( 'minor', $this->mMinor ); + } if ( $this->mType == 'comment' ) { $htmlOut .= Html::hidden( 'section', 'new' ); } -- To view, visit https://gerrit.wikimedia.org/r/347208 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I84b3da54a4cfb54891090a171acff565c618ff9c Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/InputBox Gerrit-Branch: master Gerrit-Owner: Sophivorus ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Revert "Cosmetic changes"
Sophivorus has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/347002 ) Change subject: Revert "Cosmetic changes" .. Revert "Cosmetic changes" This reverts commit d6d4f0c88a12e049f42dd7475f45c3484bb5f2b3. Change-Id: I98280aa8910438c07dc366090a41a63daa2c3c7f --- M proveit.css M proveit.js 2 files changed, 16 insertions(+), 12 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikipedia/gadgets/ProveIt refs/changes/02/347002/1 diff --git a/proveit.css b/proveit.css index fb57beb..b35f107 100755 --- a/proveit.css +++ b/proveit.css @@ -175,12 +175,12 @@ * http://www.webdesignerdepot.com/2012/11/how-to-create-a-simple-css3-tooltip/ */ -label[data-tooltip] { +[data-tooltip] { display: inline; position: relative; } -label[data-tooltip]:hover:after { +[data-tooltip]:hover:after { background: #333; background: rgba( 0, 0, 0, .8 ); border-radius: 5px; @@ -195,7 +195,7 @@ width: 220px; } -label[data-tooltip]:hover:before { +[data-tooltip]:hover:before { border: solid; border-color: #333 transparent; border-width: 6px 6px 0 6px; diff --git a/proveit.js b/proveit.js index 551b9d5..8b03da2 100755 --- a/proveit.js +++ b/proveit.js @@ -76,7 +76,7 @@ // Set the content language proveit.contentLanguage = mw.config.get( 'wgContentLanguage' ); - // Set the interface language by getting the messages from Commons + // Get the interface messages from Commons var userLanguage = mw.config.get( 'wgUserLanguage' ); $.get( '//commons.wikimedia.org/w/api.php', { 'titles': 'MediaWiki:Gadget-ProveIt-' + userLanguage + '.json|MediaWiki:Gadget-ProveIt-en.json', // Get the English messages as fallback @@ -86,17 +86,21 @@ 'format': 'json', 'origin': '*' // Allow requests from any origin so that ProveIt can be used on localhost and non-Wikimedia sites }).done( function ( data ) { - // The Commons page for English messages was created first, so it will always be first in the loop //console.log( data ); - var messages; + var englishMessages, userLanguageMessages; for ( var page in data.query.pages ) { - if ( page > -1 ) { - page = data.query.pages[ page ]; - messages = page.revisions[0]['*']; + page = data.query.pages[ page ]; + if ( page.title === 'MediaWiki:Gadget-ProveIt-en.json' ) { + englishMessages = JSON.parse( page.revisions[0]['*'] ); + } else if ( 'revisions' in page ) { + userLanguageMessages = JSON.parse( page.revisions[0]['*'] ); } } - messages = JSON.parse( messages ); - mw.messages.set( messages ); + if ( userLanguageMessages ) { + mw.messages.set( userLanguageMessages ); + } else { + mw.messages.set( englishMessages ); // Fallback to English + } // Build the interface proveit.build(); @@ -171,7 +175,7 @@ if ( mw.config.get( 'wgAction' ) === 'submit' ) { var currentSummary = $( '#wpSummary' ).val(), proveitSummary = proveit.getOption( 'summary' ); - if ( proveitSummary && currentSummary.indexOf( proveitSummary ) > -1 ) { + if ( currentSummary.indexOf( proveitSummary ) > -1 ) { proveit.addTag(); } } -- To view, visit https://gerrit.wikimedia.org/r/347002 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I98280aa8910438c07dc366090a41a63daa2c3c7f Gerrit-PatchSet: 1 Gerrit-Project: wikipedia/gadgets/ProveIt Gerrit-Branch: master Gerrit-Owner: Sophivorus ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Cosmetic changes
Sophivorus has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/347001 ) Change subject: Cosmetic changes .. Cosmetic changes Change-Id: I45f5d2db05a57b3e743e658e1702dc0c571503f4 --- M proveit.css M proveit.js 2 files changed, 12 insertions(+), 16 deletions(-) Approvals: Sophivorus: Verified; Looks good to me, approved diff --git a/proveit.css b/proveit.css index b35f107..fb57beb 100755 --- a/proveit.css +++ b/proveit.css @@ -175,12 +175,12 @@ * http://www.webdesignerdepot.com/2012/11/how-to-create-a-simple-css3-tooltip/ */ -[data-tooltip] { +label[data-tooltip] { display: inline; position: relative; } -[data-tooltip]:hover:after { +label[data-tooltip]:hover:after { background: #333; background: rgba( 0, 0, 0, .8 ); border-radius: 5px; @@ -195,7 +195,7 @@ width: 220px; } -[data-tooltip]:hover:before { +label[data-tooltip]:hover:before { border: solid; border-color: #333 transparent; border-width: 6px 6px 0 6px; diff --git a/proveit.js b/proveit.js index 8b03da2..551b9d5 100755 --- a/proveit.js +++ b/proveit.js @@ -76,7 +76,7 @@ // Set the content language proveit.contentLanguage = mw.config.get( 'wgContentLanguage' ); - // Get the interface messages from Commons + // Set the interface language by getting the messages from Commons var userLanguage = mw.config.get( 'wgUserLanguage' ); $.get( '//commons.wikimedia.org/w/api.php', { 'titles': 'MediaWiki:Gadget-ProveIt-' + userLanguage + '.json|MediaWiki:Gadget-ProveIt-en.json', // Get the English messages as fallback @@ -86,21 +86,17 @@ 'format': 'json', 'origin': '*' // Allow requests from any origin so that ProveIt can be used on localhost and non-Wikimedia sites }).done( function ( data ) { + // The Commons page for English messages was created first, so it will always be first in the loop //console.log( data ); - var englishMessages, userLanguageMessages; + var messages; for ( var page in data.query.pages ) { - page = data.query.pages[ page ]; - if ( page.title === 'MediaWiki:Gadget-ProveIt-en.json' ) { - englishMessages = JSON.parse( page.revisions[0]['*'] ); - } else if ( 'revisions' in page ) { - userLanguageMessages = JSON.parse( page.revisions[0]['*'] ); + if ( page > -1 ) { + page = data.query.pages[ page ]; + messages = page.revisions[0]['*']; } } - if ( userLanguageMessages ) { - mw.messages.set( userLanguageMessages ); - } else { - mw.messages.set( englishMessages ); // Fallback to English - } + messages = JSON.parse( messages ); + mw.messages.set( messages ); // Build the interface proveit.build(); @@ -175,7 +171,7 @@ if ( mw.config.get( 'wgAction' ) === 'submit' ) { var currentSummary = $( '#wpSummary' ).val(), proveitSummary = proveit.getOption( 'summary' ); - if ( currentSummary.indexOf( proveitSummary ) > -1 ) { + if ( proveitSummary && currentSummary.indexOf( proveitSummary ) > -1 ) { proveit.addTag(); } } -- To view, visit https://gerrit.wikimedia.org/r/347001 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I45f5d2db05a57b3e743e658e1702dc0c571503f4 Gerrit-PatchSet: 1 Gerrit-Project: wikipedia/gadgets/ProveIt Gerrit-Branch: master Gerrit-Owner: Sophivorus Gerrit-Reviewer: Sophivorus ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Cosmetic changes
Sophivorus has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/347001 ) Change subject: Cosmetic changes .. Cosmetic changes Change-Id: I45f5d2db05a57b3e743e658e1702dc0c571503f4 --- M proveit.css M proveit.js 2 files changed, 12 insertions(+), 16 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikipedia/gadgets/ProveIt refs/changes/01/347001/1 diff --git a/proveit.css b/proveit.css index b35f107..fb57beb 100755 --- a/proveit.css +++ b/proveit.css @@ -175,12 +175,12 @@ * http://www.webdesignerdepot.com/2012/11/how-to-create-a-simple-css3-tooltip/ */ -[data-tooltip] { +label[data-tooltip] { display: inline; position: relative; } -[data-tooltip]:hover:after { +label[data-tooltip]:hover:after { background: #333; background: rgba( 0, 0, 0, .8 ); border-radius: 5px; @@ -195,7 +195,7 @@ width: 220px; } -[data-tooltip]:hover:before { +label[data-tooltip]:hover:before { border: solid; border-color: #333 transparent; border-width: 6px 6px 0 6px; diff --git a/proveit.js b/proveit.js index 8b03da2..551b9d5 100755 --- a/proveit.js +++ b/proveit.js @@ -76,7 +76,7 @@ // Set the content language proveit.contentLanguage = mw.config.get( 'wgContentLanguage' ); - // Get the interface messages from Commons + // Set the interface language by getting the messages from Commons var userLanguage = mw.config.get( 'wgUserLanguage' ); $.get( '//commons.wikimedia.org/w/api.php', { 'titles': 'MediaWiki:Gadget-ProveIt-' + userLanguage + '.json|MediaWiki:Gadget-ProveIt-en.json', // Get the English messages as fallback @@ -86,21 +86,17 @@ 'format': 'json', 'origin': '*' // Allow requests from any origin so that ProveIt can be used on localhost and non-Wikimedia sites }).done( function ( data ) { + // The Commons page for English messages was created first, so it will always be first in the loop //console.log( data ); - var englishMessages, userLanguageMessages; + var messages; for ( var page in data.query.pages ) { - page = data.query.pages[ page ]; - if ( page.title === 'MediaWiki:Gadget-ProveIt-en.json' ) { - englishMessages = JSON.parse( page.revisions[0]['*'] ); - } else if ( 'revisions' in page ) { - userLanguageMessages = JSON.parse( page.revisions[0]['*'] ); + if ( page > -1 ) { + page = data.query.pages[ page ]; + messages = page.revisions[0]['*']; } } - if ( userLanguageMessages ) { - mw.messages.set( userLanguageMessages ); - } else { - mw.messages.set( englishMessages ); // Fallback to English - } + messages = JSON.parse( messages ); + mw.messages.set( messages ); // Build the interface proveit.build(); @@ -175,7 +171,7 @@ if ( mw.config.get( 'wgAction' ) === 'submit' ) { var currentSummary = $( '#wpSummary' ).val(), proveitSummary = proveit.getOption( 'summary' ); - if ( currentSummary.indexOf( proveitSummary ) > -1 ) { + if ( proveitSummary && currentSummary.indexOf( proveitSummary ) > -1 ) { proveit.addTag(); } } -- To view, visit https://gerrit.wikimedia.org/r/347001 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I45f5d2db05a57b3e743e658e1702dc0c571503f4 Gerrit-PatchSet: 1 Gerrit-Project: wikipedia/gadgets/ProveIt Gerrit-Branch: master Gerrit-Owner: Sophivorus ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Add tooltips for each parameter
Sophivorus has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/345777 ) Change subject: Add tooltips for each parameter .. Add tooltips for each parameter Bug: T154586 Change-Id: I61a18489c751ee002553c8f2cc85565396a64149 --- M proveit.css M proveit.js 2 files changed, 38 insertions(+), 3 deletions(-) Approvals: Sophivorus: Verified; Looks good to me, approved diff --git a/proveit.css b/proveit.css index 8a63e1d..b35f107 100755 --- a/proveit.css +++ b/proveit.css @@ -3,7 +3,7 @@ border: 1px solid #ddd; font-size: .8em; position: fixed; - z-index: 2147483647; /* Max value */ + z-index: 4; } .skin-monobook #proveit { @@ -52,7 +52,6 @@ background: #f4f4f4; border-top: 1px solid #ddd; overflow-y: scroll; - overflow-x: hidden; width: 700px; height: 300px; resize: both; @@ -169,4 +168,40 @@ #proveit-buttons button:hover { background: #eee; +} + +/** + * Simple CSS tooltip by Keenan Payne + * http://www.webdesignerdepot.com/2012/11/how-to-create-a-simple-css3-tooltip/ + */ + +[data-tooltip] { +display: inline; +position: relative; +} + +[data-tooltip]:hover:after { +background: #333; +background: rgba( 0, 0, 0, .8 ); +border-radius: 5px; +bottom: 26px; +color: #fff; +content: attr(data-tooltip); +font-weight: normal; +left: 20%; +padding: 5px 15px; +position: absolute; +z-index: 98; +width: 220px; +} + +[data-tooltip]:hover:before { +border: solid; +border-color: #333 transparent; +border-width: 6px 6px 0 6px; +bottom: 20px; +content: ""; +left: 50%; +position: absolute; +z-index: 99; } \ No newline at end of file diff --git a/proveit.js b/proveit.js index 5c088a9..8b03da2 100755 --- a/proveit.js +++ b/proveit.js @@ -1045,7 +1045,7 @@ } // Start building the table row - label = $( '' ).attr( 'title', paramDescription ).text( paramLabel ); + label = $( '' ).attr( 'data-tooltip', paramDescription ).text( paramLabel ); paramNameInput = $( '' ).addClass( 'proveit-param-name' ).val( paramName ).attr( 'type', 'hidden' ); paramValueInput = $( '' ).addClass( 'proveit-param-value' ).val( paramValue ).attr( 'placeholder', paramPlaceholder ); -- To view, visit https://gerrit.wikimedia.org/r/345777 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I61a18489c751ee002553c8f2cc85565396a64149 Gerrit-PatchSet: 1 Gerrit-Project: wikipedia/gadgets/ProveIt Gerrit-Branch: master Gerrit-Owner: Sophivorus Gerrit-Reviewer: Sophivorus ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Add tooltips for each parameter
Sophivorus has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/345777 ) Change subject: Add tooltips for each parameter .. Add tooltips for each parameter Bug: T154586 Change-Id: I61a18489c751ee002553c8f2cc85565396a64149 --- M proveit.css M proveit.js 2 files changed, 38 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikipedia/gadgets/ProveIt refs/changes/77/345777/1 diff --git a/proveit.css b/proveit.css index 8a63e1d..b35f107 100755 --- a/proveit.css +++ b/proveit.css @@ -3,7 +3,7 @@ border: 1px solid #ddd; font-size: .8em; position: fixed; - z-index: 2147483647; /* Max value */ + z-index: 4; } .skin-monobook #proveit { @@ -52,7 +52,6 @@ background: #f4f4f4; border-top: 1px solid #ddd; overflow-y: scroll; - overflow-x: hidden; width: 700px; height: 300px; resize: both; @@ -169,4 +168,40 @@ #proveit-buttons button:hover { background: #eee; +} + +/** + * Simple CSS tooltip by Keenan Payne + * http://www.webdesignerdepot.com/2012/11/how-to-create-a-simple-css3-tooltip/ + */ + +[data-tooltip] { +display: inline; +position: relative; +} + +[data-tooltip]:hover:after { +background: #333; +background: rgba( 0, 0, 0, .8 ); +border-radius: 5px; +bottom: 26px; +color: #fff; +content: attr(data-tooltip); +font-weight: normal; +left: 20%; +padding: 5px 15px; +position: absolute; +z-index: 98; +width: 220px; +} + +[data-tooltip]:hover:before { +border: solid; +border-color: #333 transparent; +border-width: 6px 6px 0 6px; +bottom: 20px; +content: ""; +left: 50%; +position: absolute; +z-index: 99; } \ No newline at end of file diff --git a/proveit.js b/proveit.js index 5c088a9..8b03da2 100755 --- a/proveit.js +++ b/proveit.js @@ -1045,7 +1045,7 @@ } // Start building the table row - label = $( '' ).attr( 'title', paramDescription ).text( paramLabel ); + label = $( '' ).attr( 'data-tooltip', paramDescription ).text( paramLabel ); paramNameInput = $( '' ).addClass( 'proveit-param-name' ).val( paramName ).attr( 'type', 'hidden' ); paramValueInput = $( '' ).addClass( 'proveit-param-value' ).val( paramValue ).attr( 'placeholder', paramPlaceholder ); -- To view, visit https://gerrit.wikimedia.org/r/345777 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I61a18489c751ee002553c8f2cc85565396a64149 Gerrit-PatchSet: 1 Gerrit-Project: wikipedia/gadgets/ProveIt Gerrit-Branch: master Gerrit-Owner: Sophivorus ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Keep data when switching templates on a new reference
Sophivorus has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/345739 ) Change subject: Keep data when switching templates on a new reference .. Keep data when switching templates on a new reference Bug: T148924 Change-Id: Ieb145dc09cdb4fd401db3d78ca63c8545a960468 --- M proveit.js 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Sophivorus: Verified; Looks good to me, approved diff --git a/proveit.js b/proveit.js index 4c03730..5c088a9 100755 --- a/proveit.js +++ b/proveit.js @@ -990,6 +990,7 @@ var reference = event.data; reference.template = $( this ).val(); $.cookie( 'proveit-last-template', reference.template ); // Remember the user choice + reference.loadFromForm(); table.replaceWith( reference.toTable() ); }); -- To view, visit https://gerrit.wikimedia.org/r/345739 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ieb145dc09cdb4fd401db3d78ca63c8545a960468 Gerrit-PatchSet: 1 Gerrit-Project: wikipedia/gadgets/ProveIt Gerrit-Branch: master Gerrit-Owner: Sophivorus Gerrit-Reviewer: Sophivorus ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Keep data when switching templates on a new reference
Sophivorus has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/345739 ) Change subject: Keep data when switching templates on a new reference .. Keep data when switching templates on a new reference Bug: T148924 Change-Id: Ieb145dc09cdb4fd401db3d78ca63c8545a960468 --- M proveit.js 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikipedia/gadgets/ProveIt refs/changes/39/345739/1 diff --git a/proveit.js b/proveit.js index 4c03730..5c088a9 100755 --- a/proveit.js +++ b/proveit.js @@ -990,6 +990,7 @@ var reference = event.data; reference.template = $( this ).val(); $.cookie( 'proveit-last-template', reference.template ); // Remember the user choice + reference.loadFromForm(); table.replaceWith( reference.toTable() ); }); -- To view, visit https://gerrit.wikimedia.org/r/345739 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ieb145dc09cdb4fd401db3d78ca63c8545a960468 Gerrit-PatchSet: 1 Gerrit-Project: wikipedia/gadgets/ProveIt Gerrit-Branch: master Gerrit-Owner: Sophivorus ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Add method citation.remove()
Sophivorus has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/345713 ) Change subject: Add method citation.remove() .. Add method citation.remove() Change-Id: I904c8724d4913e75762650a8d5b90d806ea2d126 --- M proveit.js 1 file changed, 12 insertions(+), 5 deletions(-) Approvals: Sophivorus: Verified; Looks good to me, approved diff --git a/proveit.js b/proveit.js index 7930272..4c03730 100755 --- a/proveit.js +++ b/proveit.js @@ -453,6 +453,16 @@ }; /** +* Remove this citation from the textbox +*/ + this.remove = function () { + var textbox = proveit.getTextbox(), + text = textbox.val(); + text = text.replace( this.string, '' ); + textbox.val( text ); + }; + + /** * Highlight this citation in the textbox and scroll it to view * * @return {void} @@ -574,15 +584,12 @@ var textbox = proveit.getTextbox(), text = textbox.val(); text = text.replace( reference.string, '' ); + textbox.val( text ); // Remove all the citations - // @todo citation.remove() reference.citations.forEach( function ( citation ) { - text = text.replace( citation.string, '' ); + citation.remove(); }); - - // Update the textbox - textbox.val( text ); // Add the tag and summary proveit.addTag(); -- To view, visit https://gerrit.wikimedia.org/r/345713 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I904c8724d4913e75762650a8d5b90d806ea2d126 Gerrit-PatchSet: 1 Gerrit-Project: wikipedia/gadgets/ProveIt Gerrit-Branch: master Gerrit-Owner: Sophivorus Gerrit-Reviewer: Sophivorus ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Minor fixes after a check with jshint.com
Sophivorus has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/345711 ) Change subject: Minor fixes after a check with jshint.com .. Minor fixes after a check with jshint.com Change-Id: Ic237f6dda147403db7b96157bdfcdf94b87e46ee --- M proveit.js 1 file changed, 9 insertions(+), 11 deletions(-) Approvals: Sophivorus: Verified; Looks good to me, approved diff --git a/proveit.js b/proveit.js index 1c2e381..7930272 100755 --- a/proveit.js +++ b/proveit.js @@ -87,8 +87,8 @@ 'origin': '*' // Allow requests from any origin so that ProveIt can be used on localhost and non-Wikimedia sites }).done( function ( data ) { //console.log( data ); - var page, englishMessages, userLanguageMessages; - for ( page in data.query.pages ) { + var englishMessages, userLanguageMessages; + for ( var page in data.query.pages ) { page = data.query.pages[ page ]; if ( page.title === 'MediaWiki:Gadget-ProveIt-en.json' ) { englishMessages = JSON.parse( page.revisions[0]['*'] ); @@ -604,11 +604,9 @@ this.update = function ( event ) { var reference = event.data; - var oldName = reference.name, - oldString = reference.string; + var oldString = reference.string; reference.loadFromForm(); - var newName = reference.name, - newString = reference.string; + var newString = reference.string; // Update the textbox var textbox = proveit.getTextbox(), @@ -618,7 +616,7 @@ // Update the citations reference.citations.forEach( function ( citation ) { - citation.name = newName; + citation.name = reference.name; citation.update(); }); @@ -771,7 +769,7 @@ // knowing there may be subtemplates and other templates after the main template var indexEnd = this.content.length, templateLevel = 0; - for ( i = indexStart; i < indexEnd; i++ ) { + for ( var i = indexStart; i < indexEnd; i++ ) { if ( this.content[ i ] + this.content[ i + 1 ] === '{{' ) { templateLevel++; i++; // We speed up the loop to avoid multiple matches when two or more templates are found together @@ -810,7 +808,7 @@ paramArray.shift(); // Get rid of the template name var paramString, linkLevel = 0, subtemplateLevel = 0, indexOfEqual, paramNumber = 0, paramName, paramValue; - for ( i = 0; i < paramArray.length; i++ ) { + for ( var i = 0; i < paramArray.length; i++ ) { paramString = paramArray[ i ].trim(); @@ -848,7 +846,7 @@ this.paramPairs[ paramName ] = paramValue; } - } + }; /** * Convert this reference to wikitext @@ -993,7 +991,7 @@ templateMap = this.getTemplateMap(), paramOrder = this.getParamOrder(), paramPairs = JSON.parse( JSON.stringify( this.paramPairs ) ), // Clone the data - paramName, paramData, paramLabel, paramPlaceholder, paramDescription, paramAlias, paramValue, row, label, paramNameInput, paramValueInput, dataList; + paramName, paramData, paramLabel, paramPlaceholder, paramDescription, paramAlias, paramValue, row, label, paramNameInput, paramValueInput, paramNameColumn, paramValueColumn; for ( var i = 0; i < paramOrder.length; i++ ) { paramName = paramOrder[ i ]; -- To view, visit https://gerrit.wikimedia.org/r/345711 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic237f6dda147403db7b96157bdfcdf94b87e46ee Gerrit-PatchSet: 1 Gerrit-Project: wikipedia/gadgets/ProveIt Gerrit-Branch: master Gerrit-Owner: Sophivorus Gerrit-Reviewer: Sophivorus ___ MediaWiki-commits mailin
[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Add method citation.remove()
Sophivorus has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/345713 ) Change subject: Add method citation.remove() .. Add method citation.remove() Change-Id: I904c8724d4913e75762650a8d5b90d806ea2d126 --- M proveit.js 1 file changed, 12 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikipedia/gadgets/ProveIt refs/changes/13/345713/1 diff --git a/proveit.js b/proveit.js index 7930272..4c03730 100755 --- a/proveit.js +++ b/proveit.js @@ -453,6 +453,16 @@ }; /** +* Remove this citation from the textbox +*/ + this.remove = function () { + var textbox = proveit.getTextbox(), + text = textbox.val(); + text = text.replace( this.string, '' ); + textbox.val( text ); + }; + + /** * Highlight this citation in the textbox and scroll it to view * * @return {void} @@ -574,15 +584,12 @@ var textbox = proveit.getTextbox(), text = textbox.val(); text = text.replace( reference.string, '' ); + textbox.val( text ); // Remove all the citations - // @todo citation.remove() reference.citations.forEach( function ( citation ) { - text = text.replace( citation.string, '' ); + citation.remove(); }); - - // Update the textbox - textbox.val( text ); // Add the tag and summary proveit.addTag(); -- To view, visit https://gerrit.wikimedia.org/r/345713 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I904c8724d4913e75762650a8d5b90d806ea2d126 Gerrit-PatchSet: 1 Gerrit-Project: wikipedia/gadgets/ProveIt Gerrit-Branch: master Gerrit-Owner: Sophivorus ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Minor fixes after a check with jshint.com
Sophivorus has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/345711 ) Change subject: Minor fixes after a check with jshint.com .. Minor fixes after a check with jshint.com Change-Id: Ic237f6dda147403db7b96157bdfcdf94b87e46ee --- M proveit.js 1 file changed, 9 insertions(+), 11 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikipedia/gadgets/ProveIt refs/changes/11/345711/1 diff --git a/proveit.js b/proveit.js index 1c2e381..7930272 100755 --- a/proveit.js +++ b/proveit.js @@ -87,8 +87,8 @@ 'origin': '*' // Allow requests from any origin so that ProveIt can be used on localhost and non-Wikimedia sites }).done( function ( data ) { //console.log( data ); - var page, englishMessages, userLanguageMessages; - for ( page in data.query.pages ) { + var englishMessages, userLanguageMessages; + for ( var page in data.query.pages ) { page = data.query.pages[ page ]; if ( page.title === 'MediaWiki:Gadget-ProveIt-en.json' ) { englishMessages = JSON.parse( page.revisions[0]['*'] ); @@ -604,11 +604,9 @@ this.update = function ( event ) { var reference = event.data; - var oldName = reference.name, - oldString = reference.string; + var oldString = reference.string; reference.loadFromForm(); - var newName = reference.name, - newString = reference.string; + var newString = reference.string; // Update the textbox var textbox = proveit.getTextbox(), @@ -618,7 +616,7 @@ // Update the citations reference.citations.forEach( function ( citation ) { - citation.name = newName; + citation.name = reference.name; citation.update(); }); @@ -771,7 +769,7 @@ // knowing there may be subtemplates and other templates after the main template var indexEnd = this.content.length, templateLevel = 0; - for ( i = indexStart; i < indexEnd; i++ ) { + for ( var i = indexStart; i < indexEnd; i++ ) { if ( this.content[ i ] + this.content[ i + 1 ] === '{{' ) { templateLevel++; i++; // We speed up the loop to avoid multiple matches when two or more templates are found together @@ -810,7 +808,7 @@ paramArray.shift(); // Get rid of the template name var paramString, linkLevel = 0, subtemplateLevel = 0, indexOfEqual, paramNumber = 0, paramName, paramValue; - for ( i = 0; i < paramArray.length; i++ ) { + for ( var i = 0; i < paramArray.length; i++ ) { paramString = paramArray[ i ].trim(); @@ -848,7 +846,7 @@ this.paramPairs[ paramName ] = paramValue; } - } + }; /** * Convert this reference to wikitext @@ -993,7 +991,7 @@ templateMap = this.getTemplateMap(), paramOrder = this.getParamOrder(), paramPairs = JSON.parse( JSON.stringify( this.paramPairs ) ), // Clone the data - paramName, paramData, paramLabel, paramPlaceholder, paramDescription, paramAlias, paramValue, row, label, paramNameInput, paramValueInput, dataList; + paramName, paramData, paramLabel, paramPlaceholder, paramDescription, paramAlias, paramValue, row, label, paramNameInput, paramValueInput, paramNameColumn, paramValueColumn; for ( var i = 0; i < paramOrder.length; i++ ) { paramName = paramOrder[ i ]; -- To view, visit https://gerrit.wikimedia.org/r/345711 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic237f6dda147403db7b96157bdfcdf94b87e46ee Gerrit-PatchSet: 1 Gerrit-Project: wikipedia/gadgets/ProveIt Gerrit-Branch: master Gerrit-Owner: Sophivorus ___ MediaWiki-commits mailing
[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Update citations when a reference name changes
Sophivorus has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/345655 ) Change subject: Update citations when a reference name changes .. Update citations when a reference name changes Bug: T154258 Change-Id: Ic71a580c64ffbe2c980be8d207b76db0132ef157 --- M proveit.js 1 file changed, 24 insertions(+), 20 deletions(-) Approvals: Sophivorus: Verified; Looks good to me, approved diff --git a/proveit.js b/proveit.js index 9ed454e..1c2e381 100755 --- a/proveit.js +++ b/proveit.js @@ -440,7 +440,20 @@ }; /** -* Highlight the citation in the textbox and scroll it to view +* Update this citation in the textbox +*/ + this.update = function () { + var oldString = this.string; + this.string = this.toString(); + var newString = this.string, + textbox = proveit.getTextbox(), + text = textbox.val(); + text = text.replace( oldString, newString ); + textbox.val( text ); + }; + + /** +* Highlight this citation in the textbox and scroll it to view * * @return {void} */ @@ -521,15 +534,14 @@ var reference = event.data; // If the reference has no name, ask the user for one - // @todo check if the name is unique? - // @todo autogenerate names? + // @todo check if the name is unique if ( !reference.name ) { reference.name = prompt( proveit.getMessage( 'prompt-name' ) ); if ( !reference.name ) { return; } - var table = reference.toTable(); - $( '#proveit-reference-table' ).replaceWith( table ); + + $( '#proveit-reference-table' ).replaceWith( reference.toTable() ); var oldString = reference.string; reference.loadFromForm(); @@ -598,26 +610,18 @@ var newName = reference.name, newString = reference.string; - // Replace the old reference + // Update the textbox var textbox = proveit.getTextbox(), text = textbox.val(); text = text.replace( oldString, newString ); - - // If the name changed, update the citations - // @todo citation.update() - if ( oldName !== newName && reference.citations ) { - var oldCitationString, newCitationString; - reference.citations.forEach( function ( citation ) { - oldCitationString = citation.toString(); - citation.name = newName; - newCitationString = citation.toString(); - text = text.replace( oldCitationString, newCitationString ); - }); - } - - // Update the textbox textbox.val( text ); + // Update the citations + reference.citations.forEach( function ( citation ) { + citation.name = newName; + citation.update(); + }); + // Update the index and highlight the reference text = textbox.val(); reference.index = text.indexOf( newString ); -- To view, visit https://gerrit.wikimedia.org/r/345655 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic71a580c64ffbe2c980be8d207b76db0132ef157 Gerrit-PatchSet: 1 Gerrit-Project: wikipedia/gadgets/ProveIt Gerrit-Branch: master Gerrit-Owner: Sophivorus Gerrit-Reviewer: Sophivorus ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Update citations when a reference name changes
Sophivorus has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/345655 ) Change subject: Update citations when a reference name changes .. Update citations when a reference name changes Bug: T154258 Change-Id: Ic71a580c64ffbe2c980be8d207b76db0132ef157 --- M proveit.js 1 file changed, 24 insertions(+), 20 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikipedia/gadgets/ProveIt refs/changes/55/345655/1 diff --git a/proveit.js b/proveit.js index 9ed454e..1c2e381 100755 --- a/proveit.js +++ b/proveit.js @@ -440,7 +440,20 @@ }; /** -* Highlight the citation in the textbox and scroll it to view +* Update this citation in the textbox +*/ + this.update = function () { + var oldString = this.string; + this.string = this.toString(); + var newString = this.string, + textbox = proveit.getTextbox(), + text = textbox.val(); + text = text.replace( oldString, newString ); + textbox.val( text ); + }; + + /** +* Highlight this citation in the textbox and scroll it to view * * @return {void} */ @@ -521,15 +534,14 @@ var reference = event.data; // If the reference has no name, ask the user for one - // @todo check if the name is unique? - // @todo autogenerate names? + // @todo check if the name is unique if ( !reference.name ) { reference.name = prompt( proveit.getMessage( 'prompt-name' ) ); if ( !reference.name ) { return; } - var table = reference.toTable(); - $( '#proveit-reference-table' ).replaceWith( table ); + + $( '#proveit-reference-table' ).replaceWith( reference.toTable() ); var oldString = reference.string; reference.loadFromForm(); @@ -598,26 +610,18 @@ var newName = reference.name, newString = reference.string; - // Replace the old reference + // Update the textbox var textbox = proveit.getTextbox(), text = textbox.val(); text = text.replace( oldString, newString ); - - // If the name changed, update the citations - // @todo citation.update() - if ( oldName !== newName && reference.citations ) { - var oldCitationString, newCitationString; - reference.citations.forEach( function ( citation ) { - oldCitationString = citation.toString(); - citation.name = newName; - newCitationString = citation.toString(); - text = text.replace( oldCitationString, newCitationString ); - }); - } - - // Update the textbox textbox.val( text ); + // Update the citations + reference.citations.forEach( function ( citation ) { + citation.name = newName; + citation.update(); + }); + // Update the index and highlight the reference text = textbox.val(); reference.index = text.indexOf( newString ); -- To view, visit https://gerrit.wikimedia.org/r/345655 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic71a580c64ffbe2c980be8d207b76db0132ef157 Gerrit-PatchSet: 1 Gerrit-Project: wikipedia/gadgets/ProveIt Gerrit-Branch: master Gerrit-Owner: Sophivorus ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Manual changes to the reference content now update the table
Sophivorus has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/345640 ) Change subject: Manual changes to the reference content now update the table .. Manual changes to the reference content now update the table Bug: T154405 Change-Id: I364f128f823ac40be0caf8a98560109038a85ec0 --- M proveit.js 1 file changed, 107 insertions(+), 93 deletions(-) Approvals: Sophivorus: Verified; Looks good to me, approved diff --git a/proveit.js b/proveit.js index 9d0d4f9..9ed454e 100755 --- a/proveit.js +++ b/proveit.js @@ -353,97 +353,7 @@ 'content': referenceContent }); - // Search for the main template of the reference - var templateName, - templateRegex, - indexStart; - for ( var templateTitle in proveit.templateData ) { - templateName = templateTitle.substring( templateTitle.indexOf( ':' ) + 1 ); // Remove the namespace - templateRegex = new RegExp( '{{\\s*' + templateName + '[\\s|]', 'i' ); - indexStart = referenceContent.search( templateRegex ); - if ( indexStart > -1 ) { - reference.template = templateName; - break; - } - } - - // The rest of the code is for when a main template was found - if ( reference.template ) { - - // Figure out the indexEnd by searching for the closing "}}" - // knowing there may be subtemplates and other templates after the main template - var indexEnd = referenceContent.length, - templateLevel = 0; - for ( i = indexStart; i < indexEnd; i++ ) { - if ( referenceContent[ i ] + referenceContent[ i + 1 ] === '{{' ) { - templateLevel++; - i++; // We speed up the loop to avoid multiple matches when two or more templates are found together - } else if ( referenceContent[ i ] + referenceContent[ i + 1 ] === '}}' ) { - templateLevel--; - i++; - } - if ( templateLevel === 0 ) { - indexEnd = i + 1; - break; - } - } - reference.templateString = referenceContent.substring( indexStart, indexEnd ); - - /** -* Parse the parameters inside the main template. A complex example may be: -* {{Cite book -* |anonymous parameter -* |param1 = value1 -* |param2 = http://example.com?query=string -* |param3 = [[Some|link]] -* |param4 = {{Subtemplate |anon |param=value}} -* }} -*/ - - // Remove the outer braces and split by pipe, knowing that we may match pipes inside links and subtemplates - var paramArray = reference.templateString.substring( 2, reference.templateString.length - 2 ).split( '|' ); - paramArray.shift(); // Get rid of the template name - - var paramString, linkLevel = 0, subtemplateLevel = 0, indexOfEqual, paramNumber = 0, paramName, paramValue; - for ( i = 0; i < paramArray.length; i++ ) { - - paramString = paramArray[ i ].trim(); - - // If we're inside a link or subtemplate, don't disturb it - if ( linkLevel || subtemplateLevel ) { - reference.paramPairs[ paramName ] += '|' + paramString; - if ( paramString.indexOf( ']]' ) > -1 ) { - linkLevel--; - } - if ( paramString.indexOf( '}}' ) > -1 ) { - subtemplateLevel--; - } - continue; - } - - // If we reach this point and there's no equal sign, it's an anonymous parameter - indexOfEqual = paramString.indexOf( '=' ); - if ( indexOfEqual === -1 ) { - paramNumber++; -
[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Manual changes to the reference content now update the table
Sophivorus has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/345640 ) Change subject: Manual changes to the reference content now update the table .. Manual changes to the reference content now update the table Bug: T154405 Change-Id: I364f128f823ac40be0caf8a98560109038a85ec0 --- M proveit.js 1 file changed, 107 insertions(+), 93 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikipedia/gadgets/ProveIt refs/changes/40/345640/1 diff --git a/proveit.js b/proveit.js index 9d0d4f9..9ed454e 100755 --- a/proveit.js +++ b/proveit.js @@ -353,97 +353,7 @@ 'content': referenceContent }); - // Search for the main template of the reference - var templateName, - templateRegex, - indexStart; - for ( var templateTitle in proveit.templateData ) { - templateName = templateTitle.substring( templateTitle.indexOf( ':' ) + 1 ); // Remove the namespace - templateRegex = new RegExp( '{{\\s*' + templateName + '[\\s|]', 'i' ); - indexStart = referenceContent.search( templateRegex ); - if ( indexStart > -1 ) { - reference.template = templateName; - break; - } - } - - // The rest of the code is for when a main template was found - if ( reference.template ) { - - // Figure out the indexEnd by searching for the closing "}}" - // knowing there may be subtemplates and other templates after the main template - var indexEnd = referenceContent.length, - templateLevel = 0; - for ( i = indexStart; i < indexEnd; i++ ) { - if ( referenceContent[ i ] + referenceContent[ i + 1 ] === '{{' ) { - templateLevel++; - i++; // We speed up the loop to avoid multiple matches when two or more templates are found together - } else if ( referenceContent[ i ] + referenceContent[ i + 1 ] === '}}' ) { - templateLevel--; - i++; - } - if ( templateLevel === 0 ) { - indexEnd = i + 1; - break; - } - } - reference.templateString = referenceContent.substring( indexStart, indexEnd ); - - /** -* Parse the parameters inside the main template. A complex example may be: -* {{Cite book -* |anonymous parameter -* |param1 = value1 -* |param2 = http://example.com?query=string -* |param3 = [[Some|link]] -* |param4 = {{Subtemplate |anon |param=value}} -* }} -*/ - - // Remove the outer braces and split by pipe, knowing that we may match pipes inside links and subtemplates - var paramArray = reference.templateString.substring( 2, reference.templateString.length - 2 ).split( '|' ); - paramArray.shift(); // Get rid of the template name - - var paramString, linkLevel = 0, subtemplateLevel = 0, indexOfEqual, paramNumber = 0, paramName, paramValue; - for ( i = 0; i < paramArray.length; i++ ) { - - paramString = paramArray[ i ].trim(); - - // If we're inside a link or subtemplate, don't disturb it - if ( linkLevel || subtemplateLevel ) { - reference.paramPairs[ paramName ] += '|' + paramString; - if ( paramString.indexOf( ']]' ) > -1 ) { - linkLevel--; - } - if ( paramString.indexOf( '}}' ) > -1 ) { - subtemplateLevel--; - } - continue; - } - - // If we reach this point and there's no equal sign, it's an anonymous parameter - indexOfEqual = paramString.indexOf( '=' ); - if ( indexOfEqual === -1 ) { - pa
[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Re-add revision tag when previewing
Sophivorus has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/345354 ) Change subject: Re-add revision tag when previewing .. Re-add revision tag when previewing Bug: T154357 Change-Id: I72a2673442ae30f5fc012cd4cb21c38a46458592 --- M proveit.js 1 file changed, 11 insertions(+), 2 deletions(-) Approvals: Sophivorus: Verified; Looks good to me, approved diff --git a/proveit.js b/proveit.js index 282190d..9d0d4f9 100755 --- a/proveit.js +++ b/proveit.js @@ -113,7 +113,7 @@ 'format': 'json', 'redirects': true }).done( function ( data ) { - console.log( data ); + //console.log( data ); for ( var page in data.pages ) { page = data.pages[ page ]; proveit.templateData[ page.title ] = page; @@ -124,7 +124,7 @@ proveit.templateData[ redirect.from ] = proveit.templateData[ redirect.to ]; } } - console.log( proveit.templateData ); + //console.log( proveit.templateData ); proveit.parse(); }); }); @@ -170,6 +170,15 @@ mw.hook( 've.activate' ).add( function () { $( '#proveit' ).remove(); }); + + // When previewing, re-add the ProveIt tag (bug T154357) + if ( mw.config.get( 'wgAction' ) === 'submit' ) { + var currentSummary = $( '#wpSummary' ).val(), + proveitSummary = proveit.getOption( 'summary' ); + if ( currentSummary.indexOf( proveitSummary ) > -1 ) { + proveit.addTag(); + } + } }, /** -- To view, visit https://gerrit.wikimedia.org/r/345354 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I72a2673442ae30f5fc012cd4cb21c38a46458592 Gerrit-PatchSet: 1 Gerrit-Project: wikipedia/gadgets/ProveIt Gerrit-Branch: master Gerrit-Owner: Sophivorus Gerrit-Reviewer: Sophivorus ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] wikipedia...ProveIt[master]: Re-add revision tag when previewing
Sophivorus has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/345354 ) Change subject: Re-add revision tag when previewing .. Re-add revision tag when previewing Bug: T154357 Change-Id: I72a2673442ae30f5fc012cd4cb21c38a46458592 --- M proveit.js 1 file changed, 11 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikipedia/gadgets/ProveIt refs/changes/54/345354/1 diff --git a/proveit.js b/proveit.js index 282190d..9d0d4f9 100755 --- a/proveit.js +++ b/proveit.js @@ -113,7 +113,7 @@ 'format': 'json', 'redirects': true }).done( function ( data ) { - console.log( data ); + //console.log( data ); for ( var page in data.pages ) { page = data.pages[ page ]; proveit.templateData[ page.title ] = page; @@ -124,7 +124,7 @@ proveit.templateData[ redirect.from ] = proveit.templateData[ redirect.to ]; } } - console.log( proveit.templateData ); + //console.log( proveit.templateData ); proveit.parse(); }); }); @@ -170,6 +170,15 @@ mw.hook( 've.activate' ).add( function () { $( '#proveit' ).remove(); }); + + // When previewing, re-add the ProveIt tag (bug T154357) + if ( mw.config.get( 'wgAction' ) === 'submit' ) { + var currentSummary = $( '#wpSummary' ).val(), + proveitSummary = proveit.getOption( 'summary' ); + if ( currentSummary.indexOf( proveitSummary ) > -1 ) { + proveit.addTag(); + } + } }, /** -- To view, visit https://gerrit.wikimedia.org/r/345354 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I72a2673442ae30f5fc012cd4cb21c38a46458592 Gerrit-PatchSet: 1 Gerrit-Project: wikipedia/gadgets/ProveIt Gerrit-Branch: master Gerrit-Owner: Sophivorus ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...WikipediaExtracts[master]: Show the credits in the content language
Sophivorus has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/344640 ) Change subject: Show the credits in the content language .. Show the credits in the content language Change-Id: I469156830687699f2142b3c9eb7eb90a0796f068 --- M WikipediaExtracts.php 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikipediaExtracts refs/changes/40/344640/1 diff --git a/WikipediaExtracts.php b/WikipediaExtracts.php index bfc36b3..b804169 100644 --- a/WikipediaExtracts.php +++ b/WikipediaExtracts.php @@ -191,7 +191,7 @@ 'lang' => self::$contentLanguage->getHtmlCode(), 'dir' => self::$contentLanguage->getDir() ], - wfMessage( 'wikipediaextracts-credits', $url )->plain() + wfMessage( 'wikipediaextracts-credits', $url )->inContentLanguage()->plain() ); } } -- To view, visit https://gerrit.wikimedia.org/r/344640 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I469156830687699f2142b3c9eb7eb90a0796f068 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikipediaExtracts Gerrit-Branch: master Gerrit-Owner: Sophivorus ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki...WikipediaExtracts[master]: Show the credits in the content language
Sophivorus has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/344640 ) Change subject: Show the credits in the content language .. Show the credits in the content language Change-Id: I469156830687699f2142b3c9eb7eb90a0796f068 --- M WikipediaExtracts.php 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Sophivorus: Verified; Looks good to me, approved diff --git a/WikipediaExtracts.php b/WikipediaExtracts.php index bfc36b3..b804169 100644 --- a/WikipediaExtracts.php +++ b/WikipediaExtracts.php @@ -191,7 +191,7 @@ 'lang' => self::$contentLanguage->getHtmlCode(), 'dir' => self::$contentLanguage->getDir() ], - wfMessage( 'wikipediaextracts-credits', $url )->plain() + wfMessage( 'wikipediaextracts-credits', $url )->inContentLanguage()->plain() ); } } -- To view, visit https://gerrit.wikimedia.org/r/344640 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I469156830687699f2142b3c9eb7eb90a0796f068 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikipediaExtracts Gerrit-Branch: master Gerrit-Owner: Sophivorus Gerrit-Reviewer: Sophivorus Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits