diff options
Diffstat (limited to 'extensions/InputBox')
35 files changed, 280 insertions, 143 deletions
diff --git a/extensions/InputBox/InputBox.classes.php b/extensions/InputBox/InputBox.classes.php index a9a920f9..4cdcbe9c 100644 --- a/extensions/InputBox/InputBox.classes.php +++ b/extensions/InputBox/InputBox.classes.php @@ -15,6 +15,7 @@ class InputBox { private $mType = ''; private $mWidth = 50; private $mPreload = ''; + private $mPreloadparams = array(); private $mEditIntro = ''; private $mSummary = ''; private $mNosummary = ''; @@ -44,7 +45,11 @@ class InputBox { // Split caches by language, to make sure visitors do not see a cached // version in a random language (since labels are in the user language) $this->mParser->getOptions()->getUserLangObj(); - $this->mParser->getOutput()->addModuleStyles( 'ext.inputBox.styles' ); + $this->mParser->getOutput()->addModuleStyles( array( + 'ext.inputBox.styles', + 'mediawiki.ui.input', + 'mediawiki.ui.checkbox', + ) ); } public function render() { @@ -52,6 +57,7 @@ class InputBox { switch ( $this->mType ) { case 'create': case 'comment': + $this->mParser->getOutput()->addModules( 'ext.inputBox' ); return $this->getCreateForm(); case 'move': return $this->getMoveForm(); @@ -117,7 +123,7 @@ class InputBox { ); $htmlOut .= Xml::element( 'input', array( - 'class' => 'searchboxInput', + 'class' => 'searchboxInput mw-ui-input mw-ui-input-inline', 'name' => 'search', 'type' => $this->mHidden ? 'hidden' : 'text', 'value' => $this->mDefaultText, @@ -192,7 +198,7 @@ class InputBox { ); } else { // Checkbox - $htmlOut .= ' <div class="inputbox-element">'; + $htmlOut .= ' <div class="mw-inputbox-element mw-ui-checkbox">'; $htmlOut .= Xml::element( 'input', array( 'type' => 'checkbox', @@ -202,7 +208,7 @@ class InputBox { ) + $checked ); // Label - $htmlOut .= ' ' . Xml::label( $name, 'mw-inputbox-ns' . $i . $idRandStr ); + $htmlOut .= Xml::label( $name, 'mw-inputbox-ns' . $i . $idRandStr ); $htmlOut .= '</div> '; } } @@ -215,7 +221,7 @@ class InputBox { array( 'type' => 'submit', 'name' => 'go', - 'class' => 'searchboxGoButton', + 'class' => 'mw-ui-button', 'value' => $this->mButtonLabel ) ); @@ -227,7 +233,7 @@ class InputBox { array( 'type' => 'submit', 'name' => 'fulltext', - 'class' => 'searchboxSearchButton', + 'class' => 'mw-ui-button', 'value' => $this->mSearchButtonLabel ) ); @@ -288,17 +294,18 @@ class InputBox { array( 'type' => $this->mHidden ? 'hidden' : 'text', 'name' => 'search', + 'class' => 'mw-ui-input mw-ui-input-inline', 'size' => $this->mWidth, 'id' => 'bodySearchInput' . $id, 'dir' => $this->mDir, ) ); - $htmlOut .= Xml::element( 'input', + $htmlOut .= ' ' . Xml::element( 'input', array( 'type' => 'submit', 'name' => 'go', 'value' => $this->mButtonLabel, - 'class' => 'bodySearchBtnGo', + 'class' => 'mw-ui-button', ) ); @@ -308,7 +315,7 @@ class InputBox { array( 'type' => 'submit', 'name' => 'fulltext', - 'class' => 'bodySearchBtnSearch', + 'class' => 'mw-ui-button', 'value' => $this->mSearchButtonLabel ) ); @@ -367,6 +374,15 @@ class InputBox { 'value' => $this->mPreload, ) ); + foreach ( $this->mPreloadparams as $preloadparams ) { + $htmlOut .= Xml::openElement( 'input', + array( + 'type' => 'hidden', + 'name' => 'preloadparams[]', + 'value' => $preloadparams, + ) + ); + } $htmlOut .= Xml::openElement( 'input', array( 'type' => 'hidden', @@ -415,7 +431,7 @@ class InputBox { array( 'type' => $this->mHidden ? 'hidden' : 'text', 'name' => 'title', - 'class' => 'createboxInput', + 'class' => 'mw-ui-input mw-ui-input-inline createboxInput', 'value' => $this->mDefaultText, 'placeholder' => $this->mPlaceholderText, 'size' => $this->mWidth, @@ -427,7 +443,7 @@ class InputBox { array( 'type' => 'submit', 'name' => 'create', - 'class' => 'createboxButton', + 'class' => 'mw-ui-button mw-ui-progressive createboxButton', 'value' => $this->mButtonLabel ) ); @@ -489,7 +505,7 @@ class InputBox { array( 'type' => $this->mHidden ? 'hidden' : 'text', 'name' => 'wpNewTitle', - 'class' => 'mw-moveboxInput', + 'class' => 'mw-moveboxInput mw-ui-input mw-ui-input-inline', 'value' => $this->mDefaultText, 'placeholder' => $this->mPlaceholderText, 'size' => $this->mWidth, @@ -500,7 +516,7 @@ class InputBox { $htmlOut .= Xml::openElement( 'input', array( 'type' => 'submit', - 'class' => 'mw-moveboxButton', + 'class' => 'mw-ui-button mw-ui-progressive', 'value' => $this->mButtonLabel ) ); @@ -551,6 +567,15 @@ class InputBox { 'value' => $this->mPreload, ) ); + foreach ( $this->mPreloadparams as $preloadparams ) { + $htmlOut .= Xml::openElement( 'input', + array( + 'type' => 'hidden', + 'name' => 'preloadparams[]', + 'value' => $preloadparams, + ) + ); + } $htmlOut .= Xml::openElement( 'input', array( 'type' => 'hidden', @@ -562,7 +587,7 @@ class InputBox { array( 'type' => $this->mHidden ? 'hidden' : 'text', 'name' => 'preloadtitle', - 'class' => 'commentboxInput', + 'class' => 'commentboxInput mw-ui-input mw-ui-input-inline', 'value' => $this->mDefaultText, 'placeholder' => $this->mPlaceholderText, 'size' => $this->mWidth, @@ -588,7 +613,7 @@ class InputBox { array( 'type' => 'submit', 'name' => 'create', - 'class' => 'commentboxButton', + 'class' => 'mw-ui-button mw-ui-progressive', 'value' => $this->mButtonLabel ) ); @@ -605,15 +630,20 @@ class InputBox { * @param string $text Tag contents */ public function extractOptions( $text ) { - wfProfileIn( __METHOD__ ); - // Parse all possible options $values = array(); foreach ( explode( "\n", $text ) as $line ) { if ( strpos( $line, '=' ) === false ) continue; list( $name, $value ) = explode( '=', $line, 2 ); - $values[ strtolower( trim( $name ) ) ] = Sanitizer::decodeCharReferences( trim( $value ) ); + $name = strtolower( trim( $name ) ); + $value = Sanitizer::decodeCharReferences( trim( $value ) ); + if ( $name == 'preloadparams[]' ) { + // We have to special-case this one because it's valid for it to appear more than once. + $this->mPreloadparams[] = $value; + } else { + $values[ $name ] = $value; + } } // Validate the dir value. @@ -662,7 +692,6 @@ class InputBox { if ( !$this->isValidColor( $this->mBGColor ) ) { $this->mBGColor = 'transparent'; } - wfProfileOut( __METHOD__ ); } /** diff --git a/extensions/InputBox/InputBox.i18n.php b/extensions/InputBox/InputBox.i18n.php deleted file mode 100644 index 73bf23c4..00000000 --- a/extensions/InputBox/InputBox.i18n.php +++ /dev/null @@ -1,35 +0,0 @@ -<?php -/** - * This is a backwards-compatibility shim, generated by: - * 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( 'wfJsonI18nShim5f0a0d9bac62c1be' ) ) { - function wfJsonI18nShim5f0a0d9bac62c1be( $cache, $code, &$cachedData ) { - $codeSequence = array_merge( array( $code ), $cachedData['fallbackSequence'] ); - foreach ( $codeSequence as $csCode ) { - $fileName = dirname( __FILE__ ) . "/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'][] = 'wfJsonI18nShim5f0a0d9bac62c1be'; -} diff --git a/extensions/InputBox/InputBox.php b/extensions/InputBox/InputBox.php index d5215efa..3f8b9eb4 100644 --- a/extensions/InputBox/InputBox.php +++ b/extensions/InputBox/InputBox.php @@ -1,62 +1,13 @@ <?php -/** - * InputBox extension - * - * @file - * @ingroup Extensions - * - * This file contains the main include file for the Inputbox extension of - * MediaWiki. - * - * Usage: Add the following line in LocalSettings.php: - * require_once( "$IP/extensions/InputBox/InputBox.php" ); - * - * @author Erik Moeller <moeller@scireview.de> - * namespaces search improvements partially by - * Leonardo Pimenta <leo.lns@gmail.com> - * Cleaned up by Trevor Parscal <tparscal@wikimedia.org> - * @copyright Public domain - * @license Public domain - * @version 0.1.4 - */ - -// Check environment -if ( !defined( 'MEDIAWIKI' ) ) { - echo "This is an extension to the MediaWiki package and cannot be run standalone.\n"; - die( -1 ); +if ( function_exists( 'wfLoadExtension' ) ) { + wfLoadExtension( 'InputBox' ); + // Keep i18n globals so mergeMessageFileList.php doesn't break + $wgMessagesDirs['InputBox'] = __DIR__ . '/i18n'; + /* wfWarn( + 'Deprecated PHP entry point used for InputBox extension. Please use wfLoadExtension instead, ' . + 'see https://www.mediawiki.org/wiki/Extension_registration for more details.' + ); */ + return; +} else { + die( 'This version of the InputBox extension requires MediaWiki 1.25+' ); } - -/* Configuration */ - -// Credits -$wgExtensionCredits['parserhook'][] = array( - 'path' => __FILE__, - 'name' => 'InputBox', - 'author' => array( 'Erik Moeller', 'Leonardo Pimenta', 'Rob Church', 'Trevor Parscal', 'DaSch' ), - 'version' => '0.2.0', - 'url' => 'https://www.mediawiki.org/wiki/Extension:InputBox', - 'description' => 'Allow inclusion of predefined HTML forms.', - 'descriptionmsg' => 'inputbox-desc', -); - -// Shortcut to this extension directory -$dir = __DIR__ . '/'; - -// Internationalization -$wgMessagesDirs['InputBox'] = __DIR__ . '/i18n'; -$wgExtensionMessagesFiles['InputBox'] = $dir . 'InputBox.i18n.php'; - -// Register auto load for the special page class -$wgAutoloadClasses['InputBoxHooks'] = $dir . 'InputBox.hooks.php'; -$wgAutoloadClasses['InputBox'] = $dir . 'InputBox.classes.php'; - -// Register parser hook -$wgHooks['ParserFirstCallInit'][] = 'InputBoxHooks::register'; -$wgHooks['MediaWikiPerformAction'][] = 'InputBoxHooks::onMediaWikiPerformAction'; -$wgHooks['SpecialPageBeforeExecute'][] = 'InputBoxHooks::onSpecialPageBeforeExecute'; - -$wgResourceModules['ext.inputBox.styles'] = array( - 'localBasePath' => dirname( __FILE__ ) . '/resources', - 'remoteExtPath' => 'InputBox/resources', - 'styles' => 'ext.inputBox.styles.css', -); diff --git a/extensions/InputBox/extension.json b/extensions/InputBox/extension.json new file mode 100644 index 00000000..6d786754 --- /dev/null +++ b/extensions/InputBox/extension.json @@ -0,0 +1,50 @@ +{ + "name": "InputBox", + "version": "0.3.0", + "author": [ + "Erik Moeller", + "Leonardo Pimenta", + "Rob Church", + "Trevor Parscal", + "DaSch" + ], + "url": "https://www.mediawiki.org/wiki/Extension:InputBox", + "description": "Allow inclusion of predefined HTML forms.", + "descriptionmsg": "inputbox-desc", + "type": "parserhook", + "MessagesDirs": { + "InputBox": [ + "i18n" + ] + }, + "AutoloadClasses": { + "InputBoxHooks": "InputBox.hooks.php", + "InputBox": "InputBox.classes.php" + }, + "ResourceModules": { + "ext.inputBox.styles": { + "styles": "ext.inputBox.styles.css" + }, + "ext.inputBox": { + "scripts": "ext.inputBox.js", + "dependencies": [ + "jquery.throttle-debounce" + ] + } + }, + "ResourceFileModulePaths": { + "localBasePath": "resources", + "remoteExtPath": "InputBox/resources" + }, + "Hooks": { + "ParserFirstCallInit": [ + "InputBoxHooks::register" + ], + "MediaWikiPerformAction": [ + "InputBoxHooks::onMediaWikiPerformAction" + ], + "SpecialPageBeforeExecute": [ + "InputBoxHooks::onSpecialPageBeforeExecute" + ] + } +} diff --git a/extensions/InputBox/i18n/ang.json b/extensions/InputBox/i18n/ang.json new file mode 100644 index 00000000..dd10aa41 --- /dev/null +++ b/extensions/InputBox/i18n/ang.json @@ -0,0 +1,9 @@ +{ + "@metadata": { + "authors": [ + "Espreon" + ] + }, + "inputbox-createarticle": "Scieppan tramet", + "inputbox-movearticle": "Wegan tramet" +} diff --git a/extensions/InputBox/i18n/ar.json b/extensions/InputBox/i18n/ar.json index 96cf6ad7..0c2fcef3 100644 --- a/extensions/InputBox/i18n/ar.json +++ b/extensions/InputBox/i18n/ar.json @@ -2,7 +2,9 @@ "@metadata": { "authors": [ "Meno25", - "زكريا" + "زكريا", + "Omda4wady", + "Abanima" ] }, "inputbox-desc": "يسمح بتضمين أشكال HTML معرفة مسبقا.", @@ -11,5 +13,8 @@ "inputbox-tryexact": "ابحث عن عنوان مطابق", "inputbox-searchfulltext": "ابحث في النص الكامل", "inputbox-createarticle": "إنشاء صفحة", + "inputbox-movearticle": "انقل الصفحة", + "inputbox-postcomment": "قسم جديد", + "inputbox-postcommenttitle": "مقطع جديد", "inputbox-ns-main": "رئيسي" } diff --git a/extensions/InputBox/i18n/arq.json b/extensions/InputBox/i18n/arq.json new file mode 100644 index 00000000..2449d692 --- /dev/null +++ b/extensions/InputBox/i18n/arq.json @@ -0,0 +1,8 @@ +{ + "@metadata": { + "authors": [ + "Oldstoneage" + ] + }, + "inputbox-tryexact": "فتّش على مطابقة سواسوا" +} diff --git a/extensions/InputBox/i18n/bcc.json b/extensions/InputBox/i18n/bcc.json index 61a5e4a1..f56dc696 100644 --- a/extensions/InputBox/i18n/bcc.json +++ b/extensions/InputBox/i18n/bcc.json @@ -1,7 +1,8 @@ { "@metadata": { "authors": [ - "Mostafadaneshvar" + "Mostafadaneshvar", + "Baloch Afghanistan" ] }, "inputbox-desc": "اجازه داتن په هور بیگ فرم های HTML چه پیش تعریف بوتگین", @@ -9,5 +10,5 @@ "inputbox-error-bad-type": "نوع جعبه ورودی \"$1\" جاه آرگ نه بیت.\nلطفا مشخص کنیت \"شرکتن\", \"نظر\", \"گردگ\" یا \"گردگ2\".", "inputbox-tryexact": "تطبیق کامل آزمایش کن", "inputbox-searchfulltext": "متن کامل گرد", - "inputbox-createarticle": "شرکتن صفحه" + "inputbox-createarticle": "تاکدیمِ جوڑ کورتین" } diff --git a/extensions/InputBox/i18n/bgn.json b/extensions/InputBox/i18n/bgn.json new file mode 100644 index 00000000..258775a0 --- /dev/null +++ b/extensions/InputBox/i18n/bgn.json @@ -0,0 +1,9 @@ +{ + "@metadata": { + "authors": [ + "Baloch Afghanistan" + ] + }, + "inputbox-tryexact": "نزیز به نزیز ئی متابکت ئا آزمایش بکن", + "inputbox-movearticle": "تاکدیمی انتقال" +} diff --git a/extensions/InputBox/i18n/fi.json b/extensions/InputBox/i18n/fi.json index ae16b96b..b6025a7d 100644 --- a/extensions/InputBox/i18n/fi.json +++ b/extensions/InputBox/i18n/fi.json @@ -3,7 +3,8 @@ "authors": [ "Crt", "Nike", - "Olli" + "Olli", + "Stryn" ] }, "inputbox-desc": "Mahdollistaa ennalta määriteltyjen lomakkeiden sisällyttämisen sivuille.", @@ -12,5 +13,7 @@ "inputbox-tryexact": "Yritä tarkkaa osumaa", "inputbox-searchfulltext": "Etsi koko tekstiä", "inputbox-createarticle": "Luo sivu", + "inputbox-postcomment": "Uusi osio", + "inputbox-postcommenttitle": "Uusi osio", "inputbox-ns-main": "(sivut)" } diff --git a/extensions/InputBox/i18n/gl.json b/extensions/InputBox/i18n/gl.json index a3c80681..75a394f4 100644 --- a/extensions/InputBox/i18n/gl.json +++ b/extensions/InputBox/i18n/gl.json @@ -2,7 +2,8 @@ "@metadata": { "authors": [ "Alma", - "Toliño" + "Toliño", + "Banjo" ] }, "inputbox-desc": "Permitir a inclusión de formularios predefinidos de HTML", @@ -11,5 +12,8 @@ "inputbox-tryexact": "Buscar coincidencias exactas", "inputbox-searchfulltext": "Buscar o texto completo", "inputbox-createarticle": "Crear a páxina", + "inputbox-movearticle": "Mover páxina", + "inputbox-postcomment": "Nova sección", + "inputbox-postcommenttitle": "Nova sección", "inputbox-ns-main": "Principal" } diff --git a/extensions/InputBox/i18n/gom-deva.json b/extensions/InputBox/i18n/gom-deva.json new file mode 100644 index 00000000..8710f59a --- /dev/null +++ b/extensions/InputBox/i18n/gom-deva.json @@ -0,0 +1,8 @@ +{ + "@metadata": { + "authors": [ + "Supriya kankumbikar" + ] + }, + "inputbox-tryexact": "दिल्लेच उतर सोदात" +} diff --git a/extensions/InputBox/i18n/hu.json b/extensions/InputBox/i18n/hu.json index bffd36dd..440728bf 100644 --- a/extensions/InputBox/i18n/hu.json +++ b/extensions/InputBox/i18n/hu.json @@ -5,7 +5,8 @@ "Dj", "Glanthor Reviol", "KossuthRad", - "Tgr" + "Tgr", + "Tacsipacsi" ] }, "inputbox-desc": "Lehetővé teszi előre megadott HTML-űrlapok beillesztését", @@ -14,5 +15,8 @@ "inputbox-tryexact": "Ugrás a szócikkre", "inputbox-searchfulltext": "Keresés a teljes szövegben", "inputbox-createarticle": "Szócikk létrehozása", + "inputbox-movearticle": "Lap átnevezése", + "inputbox-postcomment": "Új szakasz", + "inputbox-postcommenttitle": "Új szakasz", "inputbox-ns-main": "Fő" } diff --git a/extensions/InputBox/i18n/ia.json b/extensions/InputBox/i18n/ia.json index 0d6837b3..23fb4508 100644 --- a/extensions/InputBox/i18n/ia.json +++ b/extensions/InputBox/i18n/ia.json @@ -7,7 +7,7 @@ "inputbox-desc": "Permitter le inclusion de formularios HTML predefinite", "inputbox-error-no-type": "Tu non ha specificate le typo de quadro de entrata a crear.", "inputbox-error-bad-type": "Le typo de quadro de entrata \"$1\" non es recognoscite.\nPer favor specifica \"create\", \"comment\", \"search\", \"search2\" o \"fulltext\".", - "inputbox-tryexact": "Provar correspondentia exacte", + "inputbox-tryexact": "Cercar le titulo exacte", "inputbox-searchfulltext": "Cercar in texto integre", "inputbox-createarticle": "Crear pagina", "inputbox-ns-main": "Principal" diff --git a/extensions/InputBox/i18n/is.json b/extensions/InputBox/i18n/is.json index 88e04bd0..6f8e09d7 100644 --- a/extensions/InputBox/i18n/is.json +++ b/extensions/InputBox/i18n/is.json @@ -7,6 +7,7 @@ }, "inputbox-error-no-type": "Þú hefur ekki tilgreint hverskonar kassa þú villt búa til.", "inputbox-error-bad-type": "\"$1\" gerð innsetningarkassa þekkist ekki.\nVinsamlegast tilgreindu \"create\", \"comment\", \"search\", \"search2\" eða \"fulltext\".", + "inputbox-tryexact": "Prófa nákvæma samsvörun.", "inputbox-createarticle": "Búa til síðu", "inputbox-ns-main": "Aðalsíða" } diff --git a/extensions/InputBox/i18n/kn.json b/extensions/InputBox/i18n/kn.json index a7f0dcb4..8420ad7f 100644 --- a/extensions/InputBox/i18n/kn.json +++ b/extensions/InputBox/i18n/kn.json @@ -1,9 +1,11 @@ { "@metadata": { "authors": [ - "VASANTH S.N." + "VASANTH S.N.", + "Omshivaprakash" ] }, + "inputbox-tryexact": "ಇದೇ ಹೊಂದಾಣಿಕೆ ಪ್ರಯತ್ನಿಸಿ", "inputbox-createarticle": "ಪುಟಗಳನ್ನು ಸೃಷ್ಟಿಸು", "inputbox-movearticle": "ಪುಟವನ್ನು ಸ್ಥಳಾಂತರಿಸಿ", "inputbox-postcomment": "ಹೊಸ ವಿಭಾಗ", diff --git a/extensions/InputBox/i18n/ksh.json b/extensions/InputBox/i18n/ksh.json index 0da2b7c4..969c38a2 100644 --- a/extensions/InputBox/i18n/ksh.json +++ b/extensions/InputBox/i18n/ksh.json @@ -10,5 +10,8 @@ "inputbox-tryexact": "Versök en akkurate Üvvereinstimmung:", "inputbox-searchfulltext": "Sök durch dä janze Tex", "inputbox-createarticle": "Sigg aanlääje", + "inputbox-movearticle": "Sigg Ömbenänne", + "inputbox-postcomment": "Neue Avschnedd onge draan", + "inputbox-postcommenttitle": "Neue Avschnedd", "inputbox-ns-main": "{{int:blanknamespace}}" } diff --git a/extensions/InputBox/i18n/lrc.json b/extensions/InputBox/i18n/lrc.json index 3e1ff8e8..f8e11681 100644 --- a/extensions/InputBox/i18n/lrc.json +++ b/extensions/InputBox/i18n/lrc.json @@ -5,6 +5,7 @@ "Mogoeilor" ] }, + "inputbox-tryexact": "تلاش سی یکی کردن راستکی", "inputbox-searchfulltext": "پی جوری متنی", "inputbox-createarticle": "راس كردن بلگه", "inputbox-movearticle": "بلگه نه جا وه جا کو", diff --git a/extensions/InputBox/i18n/mai.json b/extensions/InputBox/i18n/mai.json new file mode 100644 index 00000000..7b7fa037 --- /dev/null +++ b/extensions/InputBox/i18n/mai.json @@ -0,0 +1,8 @@ +{ + "@metadata": { + "authors": [ + "बिप्लब आनन्द" + ] + }, + "inputbox-tryexact": "देल गेल शब्द मात्र ताकी" +} diff --git a/extensions/InputBox/i18n/nap.json b/extensions/InputBox/i18n/nap.json index 97fe4480..7c99645a 100644 --- a/extensions/InputBox/i18n/nap.json +++ b/extensions/InputBox/i18n/nap.json @@ -2,9 +2,11 @@ "@metadata": { "authors": [ "Chelin", - "SabineCretella" + "SabineCretella", + "C.R." ] }, + "inputbox-tryexact": "Pròva cu nu cunfronto eguale-eguale", "inputbox-searchfulltext": "Ascià dint''o testo", "inputbox-createarticle": "Cria paggena" } diff --git a/extensions/InputBox/i18n/pfl.json b/extensions/InputBox/i18n/pfl.json new file mode 100644 index 00000000..f2524b60 --- /dev/null +++ b/extensions/InputBox/i18n/pfl.json @@ -0,0 +1,8 @@ +{ + "@metadata": { + "authors": [ + "Manuae" + ] + }, + "inputbox-tryexact": "Vasugs midda gnaue Iwwaoischdimmung" +} diff --git a/extensions/InputBox/i18n/pt.json b/extensions/InputBox/i18n/pt.json index 99fca2e3..fb62118f 100644 --- a/extensions/InputBox/i18n/pt.json +++ b/extensions/InputBox/i18n/pt.json @@ -4,13 +4,14 @@ "Hamilton Abreu", "Malafaya", "Imperadeiro98", - "Vitorvicentevalente" + "Vitorvicentevalente", + "He7d3r" ] }, "inputbox-desc": "Permite a inclusão de formulários HTML pré-definidos.", "inputbox-error-no-type": "Não especificou o tipo de caixa de edição a ser criado.", "inputbox-error-bad-type": "O tipo de caixa de introdução de dados \"$1\" não foi reconhecido.\nPor favor, especifique \"create\", \"comment\", \"search\", \"search2\" ou \"fulltext\".", - "inputbox-tryexact": "Tentar a exata expressão", + "inputbox-tryexact": "Tentar a expressão exata", "inputbox-searchfulltext": "Pesquisar no texto completo", "inputbox-createarticle": "Criar página", "inputbox-movearticle": "Mover página", diff --git a/extensions/InputBox/i18n/qqq.json b/extensions/InputBox/i18n/qqq.json index cb10c9cb..aada0de5 100644 --- a/extensions/InputBox/i18n/qqq.json +++ b/extensions/InputBox/i18n/qqq.json @@ -7,10 +7,11 @@ "Shirayuki", "Siebrand", "The Evil IP address", - "Raymond" + "Raymond", + "Umherirrender" ] }, - "inputbox-desc": "{{desc|name=Input Box|url=http://www.mediawiki.org/wiki/Extension:InputBox}}", + "inputbox-desc": "{{desc|name=Input Box|url=https://www.mediawiki.org/wiki/Extension:InputBox}}", "inputbox-error-no-type": "Used as error message.\n\nSee also:\n* {{msg-mw|Inputbox-error-bad-type}}", "inputbox-error-bad-type": "{{doc-important|\"create\", \"comment\", \"search\", \"search2\" and \"fulltext\" should not be translated.}}\nUsed as error message. Parameters:\n* $1 - invalid type. Valid types are: \"create\", \"comment\", \"commenttitle\", \"search\", \"fulltext\", and \"search2\"\nSee also:\n* {{msg-mw|Inputbox-error-no-type}}", "inputbox-tryexact": "Part of the \"Inputbox\" extension. This message is the text of the button to search the page you typed in the inputbox. If the page with the exact name exists, you will go directly to that page.", diff --git a/extensions/InputBox/i18n/roa-tara.json b/extensions/InputBox/i18n/roa-tara.json index fa650227..bdc9a094 100644 --- a/extensions/InputBox/i18n/roa-tara.json +++ b/extensions/InputBox/i18n/roa-tara.json @@ -10,5 +10,8 @@ "inputbox-tryexact": "Pruève cu 'u combronde satte-satte", "inputbox-searchfulltext": "Cirche jndr'à tutte 'u teste", "inputbox-createarticle": "Ccreje 'a vôsce", + "inputbox-movearticle": "Spuèste 'a pàgene", + "inputbox-postcomment": "Seziona nove", + "inputbox-postcommenttitle": "Seziona nove", "inputbox-ns-main": "Prengepàle" } diff --git a/extensions/InputBox/i18n/shn.json b/extensions/InputBox/i18n/shn.json new file mode 100644 index 00000000..d8d79de4 --- /dev/null +++ b/extensions/InputBox/i18n/shn.json @@ -0,0 +1,8 @@ +{ + "@metadata": { + "authors": [ + "Saimawnkham" + ] + }, + "inputbox-tryexact": "သွၵ်ႉႁႃ ႁႂ်ႈၼႄႉၼွၼ်းလီလီ" +} diff --git a/extensions/InputBox/i18n/sr-ec.json b/extensions/InputBox/i18n/sr-ec.json index 7a96a954..22334dce 100644 --- a/extensions/InputBox/i18n/sr-ec.json +++ b/extensions/InputBox/i18n/sr-ec.json @@ -8,11 +8,11 @@ ] }, "inputbox-desc": "Омогући укључивање претходно дефинисаних HTML форми.", - "inputbox-error-no-type": "Ниси одредио тип уносне кутије да би је направио.", - "inputbox-error-bad-type": "Тип \"$1\" кутијице за унос података је непознат.\nМолимо вас да га промените на \"create\", \"comment\", \"search\", \"search2\" или \"fulltext\".", + "inputbox-error-no-type": "Нисте одредили тип кутије за унос коју правите.", + "inputbox-error-bad-type": "Тип „$1“ кутијице за унос података је непознат.\nМолимо вас да га промените на „create“, „comment“, „search“, „search2“ или „fulltext“.", "inputbox-tryexact": "Покушај тачно", "inputbox-searchfulltext": "Претражи цео текст", - "inputbox-createarticle": "Направи чланак", + "inputbox-createarticle": "Направи страницу", "inputbox-postcomment": "Нови одељак", "inputbox-postcommenttitle": "Нови одељак", "inputbox-ns-main": "Главни" diff --git a/extensions/InputBox/i18n/sr-el.json b/extensions/InputBox/i18n/sr-el.json index c34d35ee..aa3b3c74 100644 --- a/extensions/InputBox/i18n/sr-el.json +++ b/extensions/InputBox/i18n/sr-el.json @@ -6,11 +6,11 @@ ] }, "inputbox-desc": "Omogući uključivanje prethodno definisanih HTML formi.", - "inputbox-error-no-type": "Nisi odredio tip unosne kutije da bi je napravio.", - "inputbox-error-bad-type": "Tip \"$1\" kutijice za unos podataka je nepoznat.\nMolimo vas da ga promenite na \"create\", \"comment\", \"search\", \"search2\" ili \"fulltext\".", + "inputbox-error-no-type": "Niste odredili tip kutije za unos koju pravite.", + "inputbox-error-bad-type": "Tip „$1“ kutijice za unos podataka je nepoznat.\nMolimo vas da ga promenite na „create“, „comment“, „search“, „search2“ ili „fulltext“.", "inputbox-tryexact": "Pokušaj tačno", "inputbox-searchfulltext": "Pretraži ceo tekst", - "inputbox-createarticle": "Napravi članak", + "inputbox-createarticle": "Napravi stranicu", "inputbox-postcomment": "Novi odeljak", "inputbox-postcommenttitle": "Novi odeljak", "inputbox-ns-main": "Glavni" diff --git a/extensions/InputBox/i18n/th.json b/extensions/InputBox/i18n/th.json index 66d3514e..fde89e7d 100644 --- a/extensions/InputBox/i18n/th.json +++ b/extensions/InputBox/i18n/th.json @@ -1,6 +1,10 @@ { - "@metadata": [], - "inputbox-tryexact": "ค้นหาตรงทุกตัวอักษร", + "@metadata": { + "authors": [ + "Horus" + ] + }, + "inputbox-tryexact": "ลองตรงทุกตัวอักษร", "inputbox-searchfulltext": "ค้นหาข้อมูล", "inputbox-createarticle": "สร้างเนื้อหา" } diff --git a/extensions/InputBox/i18n/tt-cyrl.json b/extensions/InputBox/i18n/tt-cyrl.json new file mode 100644 index 00000000..69893e44 --- /dev/null +++ b/extensions/InputBox/i18n/tt-cyrl.json @@ -0,0 +1,8 @@ +{ + "@metadata": { + "authors": [ + "Derslek" + ] + }, + "inputbox-tryexact": "Төгәл эзләү" +} diff --git a/extensions/InputBox/i18n/ur.json b/extensions/InputBox/i18n/ur.json index 64e1e671..78f689a0 100644 --- a/extensions/InputBox/i18n/ur.json +++ b/extensions/InputBox/i18n/ur.json @@ -1,9 +1,11 @@ { "@metadata": { "authors": [ - "පසිඳු කාවින්ද" + "පසිඳු කාවින්ද", + "عثمان خان شاہ" ] }, + "inputbox-tryexact": "خو بخو ٹیکسٹ کو ملانے کی کوشش کریں", "inputbox-searchfulltext": "تلاش ِکل متن", "inputbox-createarticle": "نیا مضمون", "inputbox-ns-main": "مین" diff --git a/extensions/InputBox/i18n/vi.json b/extensions/InputBox/i18n/vi.json index 44513a10..735c877d 100644 --- a/extensions/InputBox/i18n/vi.json +++ b/extensions/InputBox/i18n/vi.json @@ -7,7 +7,7 @@ "inputbox-desc": "Thêm những biểu mẫu HTML đơn giản", "inputbox-error-no-type": "Bạn chưa định rõ loại biểu mẫu để tạo ra.", "inputbox-error-bad-type": "Loại biểu mẫu “$1” không hợp lệ. Xin hãy chọn “create”, “comment”, “search”, “search2”, hay “fulltext”.", - "inputbox-tryexact": "Thử tìm đoạn văn khớp chính xác với từ khóa", + "inputbox-tryexact": "Thử khớp chính xác", "inputbox-searchfulltext": "Tìm toàn văn", "inputbox-createarticle": "Tạo trang", "inputbox-movearticle": "Di chuyển trang", diff --git a/extensions/InputBox/i18n/yi.json b/extensions/InputBox/i18n/yi.json index def43b29..c6684637 100644 --- a/extensions/InputBox/i18n/yi.json +++ b/extensions/InputBox/i18n/yi.json @@ -5,6 +5,7 @@ "פוילישער" ] }, + "inputbox-tryexact": "פרובירן גענויעם זוך", "inputbox-searchfulltext": "זוך אין אלע בלעטער", "inputbox-createarticle": "באשאפט ארטיקל", "inputbox-ns-main": "הויפט" diff --git a/extensions/InputBox/i18n/yue.json b/extensions/InputBox/i18n/yue.json index c91097ad..d1a42766 100644 --- a/extensions/InputBox/i18n/yue.json +++ b/extensions/InputBox/i18n/yue.json @@ -1,9 +1,17 @@ { - "@metadata": [], + "@metadata": { + "authors": [ + "Yueman" + ] + }, "inputbox-desc": "容許包含預先設定嘅HTML表格", "inputbox-error-no-type": "你重未指定開輸入盒嘅指定類型。", - "inputbox-error-bad-type": "輸入盒類型\"$1\"認唔到。請指定\"create\"、\"comment\"、\"search\"或\"search2\"。", + "inputbox-error-bad-type": "輸入盒類型\"$1\"認唔到。\n請指定\"create\"、\"comment\"、\"search\"、\"search2\"或者\"fulltext\"。", "inputbox-tryexact": "試吓精確嘅比較", "inputbox-searchfulltext": "搵全文", - "inputbox-createarticle": "建立文章" + "inputbox-createarticle": "建立文章", + "inputbox-movearticle": "搬頁", + "inputbox-postcomment": "新小節", + "inputbox-postcommenttitle": "新小節", + "inputbox-ns-main": "主要" } diff --git a/extensions/InputBox/resources/ext.inputBox.js b/extensions/InputBox/resources/ext.inputBox.js new file mode 100644 index 00000000..2469fd13 --- /dev/null +++ b/extensions/InputBox/resources/ext.inputBox.js @@ -0,0 +1,29 @@ +/** + * Disable InputBox submit button when the corresponding text input field is empty. + * + * @author Tony Thomas + * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later + */ +( function ( $, mw ) { + 'use strict'; + mw.hook( 'wikipage.content' ).add( function( $content ) { + var $input = $content.find( '.createboxInput:not([type=hidden])' ), + onChange = function() { + var $textbox = $( this ), + $submit = $textbox.data( 'form-submit' ); + + if ( !$submit ) { + $submit = $textbox.nextAll( 'input.createboxButton' ).first(); + $textbox.data( 'form-submit', $submit ); + } + + $submit.prop( 'disabled', $textbox.val().length < 1 ); + }, i; + + for ( i = 0; i < $input.length; i++ ) { + onChange.call( $input.get( i ) ); + } + + $input.on( 'keyup input change', $.debounce( 50, onChange ) ); + } ); +}( jQuery, mediaWiki ) ); diff --git a/extensions/InputBox/resources/ext.inputBox.styles.css b/extensions/InputBox/resources/ext.inputBox.styles.css index 30916f57..9a996a4a 100644 --- a/extensions/InputBox/resources/ext.inputBox.styles.css +++ b/extensions/InputBox/resources/ext.inputBox.styles.css @@ -8,7 +8,8 @@ display: inline; } -.inputbox-element { - display: inline; +.mw-inputbox-element { + /* important is needed to overwrite display:table from mw-ui checkbox */ + display: inline-table !important; white-space: nowrap; -}
\ No newline at end of file +} |