LocalSettings.php
StartProfiler.php
+# Building & testing
+node_modules/
+
# Operating systems
## Mac OS X
.DS_Store
-# upstream libs
+# third-party libs
+extensions/
+node_modules/
resources/jquery/jquery.appear.js
resources/jquery/jquery.async.js
resources/jquery/jquery.cycle.all.js
resources/jquery/jquery.qunit.js
resources/jquery/jquery.validate.js
resources/jquery/jquery.xmldom.js
-resources/jquery.effects
-resources/jquery.tipsy
-resources/jquery.ui
-resources/mediawiki.libs
-tests/jasmine/lib/jasmine-1.0.1/jasmine-html.js
-tests/jasmine/lib/jasmine-1.0.1/jasmine.js
+resources/jquery.effects/
+resources/jquery.tipsy/
+resources/jquery.ui/
+resources/mediawiki.libs/
+
+# legacy scripts
+skins/common/
+
+# github.com/jshint/jshint/issues/729
+tests/qunit/suites/resources/mediawiki/mediawiki.jscompat.test.js
{
"predef": [
"mediaWiki",
+ "jQuery",
"QUnit"
],
"bitwise": true,
+ "camelcase": true,
"curly": true,
"eqeqeq": true,
+ "forin": false,
"immed": true,
"latedef": true,
"newcap": true,
"noarg": true,
"noempty": true,
"nonew": true,
+ "quotmark": "single",
"regexp": false,
"undef": true,
+ "unused": true,
"strict": false,
"trailing": true,
"multistr": true,
"browser": true,
- "jquery": true,
"nomen": true,
"onevar": true
$outputDone = true;
} else {
$content = $this->getContentObject();
- $rt = $content->getRedirectChain();
+ $rt = $content ? $content->getRedirectChain() : null;
if ( $rt ) {
wfDebug( __METHOD__ . ": showing redirect=no page\n" );
# Viewing a redirect page (e.g. with parameter redirect=no)
# Run the parse, protected by a pool counter
wfDebug( __METHOD__ . ": doing uncached parse\n" );
- // @todo: shouldn't we be passing $this->getPage() to PoolWorkArticleView instead of plain $this?
- $poolArticleView = new PoolWorkArticleView( $this, $parserOptions,
- $this->getRevIdFetched(), $useParserCache, $this->getContentObject(), $this->getContext() );
+ $poolArticleView = new PoolWorkArticleView( $this->getPage(), $parserOptions,
+ $this->getRevIdFetched(), $useParserCache, $this->getContentObject() );
if ( !$poolArticleView->execute() ) {
$error = $poolArticleView->getError();
'clearyourcache' );
}
- // Give hooks a chance to customise the output
- if ( ContentHandler::runLegacyHooks( 'ShowRawCssJs', array( $this->fetchContentObject(), $this->getTitle(), $outputPage ) ) ) {
- $po = $this->mContentObject->getParserOutput( $this->getTitle() );
- $outputPage->addHTML( $po->getText() );
+ $this->fetchContentObject();
+
+ if ( $this->mContentObject ) {
+ // Give hooks a chance to customise the output
+ if ( ContentHandler::runLegacyHooks( 'ShowRawCssJs', array( $this->mContentObject, $this->getTitle(), $outputPage ) ) ) {
+ $po = $this->mContentObject->getParserOutput( $this->getTitle() );
+ $outputPage->addHTML( $po->getText() );
+ }
}
}
'IndexPager' => 'includes/Pager.php',
'Interwiki' => 'includes/interwiki/Interwiki.php',
'IP' => 'includes/IP.php',
+ 'LCStore' => 'includes/LocalisationCache.php',
'LCStore_Accel' => 'includes/LocalisationCache.php',
'LCStore_CDB' => 'includes/LocalisationCache.php',
'LCStore_DB' => 'includes/LocalisationCache.php',
'RdfMetaData' => 'includes/Metadata.php',
'ReadOnlyError' => 'includes/Exception.php',
'RecentChange' => 'includes/RecentChange.php',
+ 'RedirectSpecialArticle' => 'includes/SpecialPage.php',
'RedirectSpecialPage' => 'includes/SpecialPage.php',
'RegexlikeReplacer' => 'includes/StringUtils.php',
'ReplacementArray' => 'includes/StringUtils.php',
'CopyFileOp' => 'includes/filebackend/FileOp.php',
'MoveFileOp' => 'includes/filebackend/FileOp.php',
'DeleteFileOp' => 'includes/filebackend/FileOp.php',
- 'ConcatenateFileOp' => 'includes/filebackend/FileOp.php',
'CreateFileOp' => 'includes/filebackend/FileOp.php',
'NullFileOp' => 'includes/filebackend/FileOp.php',
'Ibm_db2Updater' => 'includes/installer/Ibm_db2Updater.php',
'InstallDocFormatter' => 'includes/installer/InstallDocFormatter.php',
'Installer' => 'includes/installer/Installer.php',
- 'LBFactory_InstallerFake' => 'includes/installer/Installer.php',
'LocalSettingsGenerator' => 'includes/installer/LocalSettingsGenerator.php',
'MysqlInstaller' => 'includes/installer/MysqlInstaller.php',
'MysqlUpdater' => 'includes/installer/MysqlUpdater.php',
'RevDel_LogList' => 'includes/revisiondelete/RevisionDelete.php',
'RevDel_RevisionItem' => 'includes/revisiondelete/RevisionDelete.php',
'RevDel_RevisionList' => 'includes/revisiondelete/RevisionDelete.php',
- 'RevisionDelete' => 'includes/revisiondelete/RevisionDelete.php',
'RevisionDeleter' => 'includes/revisiondelete/RevisionDeleter.php',
'RevisionDeleteUser' => 'includes/revisiondelete/RevisionDeleteUser.php',
'BrokenRedirectsPage' => 'includes/specials/SpecialBrokenRedirects.php',
'CategoryPager' => 'includes/specials/SpecialCategories.php',
'ContribsPager' => 'includes/specials/SpecialContributions.php',
- 'DBLockForm' => 'includes/specials/SpecialLockdb.php',
- 'DBUnlockForm' => 'includes/specials/SpecialUnlockdb.php',
'DeadendPagesPage' => 'includes/specials/SpecialDeadendpages.php',
'DeletedContribsPager' => 'includes/specials/SpecialDeletedContributions.php',
'DeletedContributionsPage' => 'includes/specials/SpecialDeletedContributions.php',
'SpecialLockdb' => 'includes/specials/SpecialLockdb.php',
'SpecialLog' => 'includes/specials/SpecialLog.php',
'SpecialMergeHistory' => 'includes/specials/SpecialMergeHistory.php',
- 'SpecialMostlinkedtemplates' => 'includes/specials/SpecialMostlinkedtemplates.php',
'SpecialNewFiles' => 'includes/specials/SpecialNewimages.php',
'SpecialNewpages' => 'includes/specials/SpecialNewpages.php',
'SpecialPasswordReset' => 'includes/specials/SpecialPasswordReset.php',
'UploadFromUrl' => 'includes/upload/UploadFromUrl.php',
'UploadStash' => 'includes/upload/UploadStash.php',
'UploadStashBadPathException' => 'includes/upload/UploadStash.php',
- 'UploadStashBadVersionException' => 'includes/upload/UploadStash.php',
'UploadStashFile' => 'includes/upload/UploadStash.php',
'UploadStashFileException' => 'includes/upload/UploadStash.php',
'UploadStashFileNotFoundException' => 'includes/upload/UploadStash.php',
'CLDRPluralRuleError' => 'languages/utils/CLDRPluralRuleEvaluator.php',
# maintenance
+ 'BackupDumper' => 'maintenance/backup.inc',
'ConvertLinks' => 'maintenance/convertLinks.php',
'DeleteArchivedFilesImplementation' => 'maintenance/deleteArchivedFiles.inc',
'DeleteArchivedRevisionsImplementation' => 'maintenance/deleteArchivedRevisions.inc',
'DeleteDefaultMessages' => 'maintenance/deleteDefaultMessages.php',
+ 'DumpDBZip2Output' => 'maintenance/backup.inc',
+ 'ExportProgressFilter' => 'maintenance/backup.inc',
'FakeMaintenance' => 'maintenance/Maintenance.php',
+ 'FixExtLinksProtocolRelative' => 'maintenance/fixExtLinksProtocolRelative.php',
'LoggedUpdateMaintenance' => 'maintenance/Maintenance.php',
'Maintenance' => 'maintenance/Maintenance.php',
- 'FixExtLinksProtocolRelative' => 'maintenance/fixExtLinksProtocolRelative.php',
'PopulateCategory' => 'maintenance/populateCategory.php',
'PopulateImageSha1' => 'maintenance/populateImageSha1.php',
'PopulateFilearchiveSha1' => 'maintenance/populateFilearchiveSha1.php',
'InstallerOverrides' => 'mw-config/overrides.php',
'MyLocalSettingsGenerator' => 'mw-config/overrides.php',
- # tests
- 'DbTestPreviewer' => 'tests/testHelpers.inc',
- 'DbTestRecorder' => 'tests/testHelpers.inc',
- 'DelayedParserTest' => 'tests/testHelpers.inc',
- 'TestFileIterator' => 'tests/testHelpers.inc',
- 'TestRecorder' => 'tests/testHelpers.inc',
-
- # tests/phpunit
- 'RevisionStorageTest' => 'tests/phpunit/includes/RevisionStorageTest.php',
- 'WikiPageTest' => 'tests/phpunit/includes/WikiPageTest.php',
-
- # tests/phpunit/content
- 'DummyContentHandlerForTesting' => 'tests/phpunit/includes/content/ContentHandlerTest.php',
- 'DummyContentForTesting' => 'tests/phpunit/includes/content/ContentHandlerTest.php',
- 'JavascriptContentTest' => 'tests/phpunit/includes/content/JavascriptContentTest.php',
- 'TextContentTest' => 'tests/phpunit/includes/content/TextContentTest.php',
-
- # tests/phpunit/includes
- 'GenericArrayObjectTest' => 'tests/phpunit/includes/libs/GenericArrayObjectTest.php',
-
- # tests/phpunit/includes/db
- 'ORMRowTest' => 'tests/phpunit/includes/db/ORMRowTest.php',
-
- # tests/phpunit/includes/site
- 'SiteObjectTest' => 'tests/phpunit/includes/site/SiteObjectTest.php',
- 'TestSites' => 'tests/phpunit/includes/site/TestSites.php',
-
- # tests/parser
- 'ParserTest' => 'tests/parser/parserTest.inc',
- 'ParserTestParserHook' => 'tests/parser/parserTestsParserHook.php',
-
- # tests/selenium
- 'Selenium' => 'tests/selenium/Selenium.php',
- 'SeleniumLoader' => 'tests/selenium/SeleniumLoader.php',
- 'SeleniumTestCase' => 'tests/selenium/SeleniumTestCase.php',
- 'SeleniumTestConsoleLogger' => 'tests/selenium/SeleniumTestConsoleLogger.php',
- 'SeleniumTestHTMLLogger' => 'tests/selenium/SeleniumTestHTMLLogger.php',
- 'SeleniumTestListener' => 'tests/selenium/SeleniumTestListener.php',
- 'SeleniumTestSuite' => 'tests/selenium/SeleniumTestSuite.php',
- 'SeleniumConfig' => 'tests/selenium/SeleniumConfig.php',
-
# skins
'CologneBlueTemplate' => 'skins/CologneBlue.php',
'ModernTemplate' => 'skins/Modern.php',
*/
$wgUseCombinedLoginLink = false;
+/**
+ * Appearance of user page and talk page labels in personal tools.
+ * - true = combine links into a single label
+ * - false = keep links in separate labels
+ */
+$wgVectorCombineUserTalk = false;
+
/**
* Search form look for Vector skin only.
* - true = use an icon search button
$this->isConflict = true;
$content = $textbox_content; // do not try to merge here!
} elseif ( $this->isConflict ) {
- $contentObj = $content;
# Attempt merge
- if ( $this->mergeChangesInto( $content ) ) {
+ if ( $this->mergeChangesIntoContent( $content ) ) {
// Successful merge! Maybe we should tell the user the good news?
$this->isConflict = false;
- $content = $this->toEditContent( $content );
wfDebug( __METHOD__ . ": Suppressing edit conflict, successful merge.\n" );
} else {
$this->section = '';
- $this->textbox1 = ContentHandler::getContentText( $contentObj );
+ $this->textbox1 = ContentHandler::getContentText( $content );
wfDebug( __METHOD__ . ": Keeping edit conflict, failed merge.\n" );
}
}
function mergeChangesInto( &$editText ){
ContentHandler::deprecated( __METHOD__, "1.21" );
- wfProfileIn( __METHOD__ );
-
- $db = wfGetDB( DB_MASTER );
-
- // This is the revision the editor started from
- $baseRevision = $this->getBaseRevision();
- if ( is_null( $baseRevision ) ) {
- wfProfileOut( __METHOD__ );
- return false;
- }
- $baseText = $baseRevision->getText();
-
- // The current state, we want to merge updates into it
- $currentRevision = Revision::loadFromTitle( $db, $this->mTitle );
- if ( is_null( $currentRevision ) ) {
- wfProfileOut( __METHOD__ );
- return false;
- }
- $currentText = $currentRevision->getText();
+ $editContent = $this->toEditContent( $editText );
- $result = '';
- $editText = $this->toEditText( $editText );
+ $ok = $this->mergeChangesIntoContent( $editContent );
- if ( wfMerge( $baseText, $editText, $currentText, $result ) ) {
- $editText = $result;
- wfProfileOut( __METHOD__ );
+ if ( $ok ) {
+ $editText = $this->toEditText( $editContent );
return true;
- } else {
- wfProfileOut( __METHOD__ );
- return false;
}
+ return false;
}
/**
$mytextFile = fopen( $mytextName = tempnam( $td, 'merge-mine-' ), 'w' );
$yourtextFile = fopen( $yourtextName = tempnam( $td, 'merge-your-' ), 'w' );
- fwrite( $oldtextFile, $old );
+ # NOTE: diff3 issues a warning to stderr if any of the files does not end with
+ # a newline character. To avoid this, we normalize the trailing whitespace before
+ # creating the diff.
+
+ fwrite( $oldtextFile, rtrim( $old ) . "\n" );
fclose( $oldtextFile );
- fwrite( $mytextFile, $mine );
+ fwrite( $mytextFile, rtrim( $mine ) . "\n" );
fclose( $mytextFile );
- fwrite( $yourtextFile, $yours );
+ fwrite( $yourtextFile, rtrim( $yours ) . "\n" );
fclose( $yourtextFile );
# Check for a conflict
}
$deps = $this->store->get( $code, 'deps' );
- $keys = $this->store->get( $code, 'list', 'messages' );
+ $keys = $this->store->get( $code, 'list' );
$preload = $this->store->get( $code, 'preload' );
// Different keys may expire separately, at least in LCStore_Accel
if ( $deps === null || $keys === null || $preload === null ) {
protected $mContentFormat;
/**
- * @var Content
+ * @var Content|null|bool
*/
protected $mContent;
}
/**
- * Gets the content object for the revision
+ * Gets the content object for the revision (or null on failure).
+ *
+ * Note that for mutable Content objects, each call to this method will return a
+ * fresh clone.
*
* @since 1.21
- * @return Content
+ * @return Content|null the Revision's content, or null on failure.
*/
protected function getContentInternal() {
if( is_null( $this->mContent ) ) {
// Revision is immutable. Load on demand:
-
- $handler = $this->getContentHandler();
- $format = $this->getContentFormat();
-
if( is_null( $this->mText ) ) {
- // Load text on demand:
$this->mText = $this->loadText();
}
- $this->mContent = is_null( $this->mText ) ? null : $handler->unserializeContent( $this->mText, $format );
+ if ( $this->mText !== null && $this->mText !== false ) {
+ // Unserialize content
+ $handler = $this->getContentHandler();
+ $format = $this->getContentFormat();
+
+ $this->mContent = $handler->unserializeContent( $this->mText, $format );
+ } else {
+ $this->mContent = false; // negative caching!
+ }
}
- return $this->mContent->copy(); // NOTE: copy() will return $this for immutable content objects
+ // NOTE: copy() will return $this for immutable content objects
+ return $this->mContent ? $this->mContent->copy() : null;
}
/**
$content = $this->getContent( Revision::RAW );
- if ( !$content->isValid() ) {
+ if ( !$content || !$content->isValid() ) {
$t = $title->getPrefixedDBkey();
throw new MWException( "Content of $t is not valid! Content model is $model" );
* Lazy-load the revision's text.
* Currently hardcoded to the 'text' table storage engine.
*
- * @return String
+<<<<<<< HEAD
+ * @return String|boolean the revision text, or false on failure
+=======
+ * @return String|bool the revision's text, or false on failure
+>>>>>>> (Bug 41244) Gracefully handle failure to load text blob.
*/
protected function loadText() {
wfProfileIn( __METHOD__ );
return false;
}
+ /**
+ * Is this page cached?
+ * Expensive pages are cached or disabled in miser mode.
+ * Used by QueryPage and subclasses, moved here so that
+ * Special:SpecialPages can safely call it for all special pages.
+ *
+ * @return Boolean
+ * @since 1.21
+ */
+ public function isCached() {
+ return false;
+ }
+
/**
* Can be overridden by subclasses with more complicated permissions
* schemes.
$content = $rev->getContent();
# Does the redirect point to the source?
# Or is it a broken self-redirect, usually caused by namespace collisions?
- $redirTitle = $content->getRedirectTarget();
+ $redirTitle = $content ? $content->getRedirectTarget() : null;
if ( $redirTitle ) {
if ( $redirTitle->getPrefixedDBkey() != $this->getPrefixedDBkey() &&
}
if ( is_array( $data ) ) {
- if ( is_array( $data['user_groups'] ) ) {
+ if ( isset( $data['user_groups'] ) && is_array( $data['user_groups'] ) ) {
$this->mGroups = $data['user_groups'];
}
- if ( is_array( $data['user_properties'] ) ) {
+ if ( isset( $data['user_properties'] ) && is_array( $data['user_properties'] ) ) {
$this->loadOptions( $data['user_properties'] );
}
}
$this->mRights = self::getGroupPermissions( $this->getEffectiveGroups() );
wfRunHooks( 'UserGetRights', array( $this, &$this->mRights ) );
// Force reindexation of rights when a hook has unset one of them
- $this->mRights = array_values( $this->mRights );
+ $this->mRights = array_values( array_unique( $this->mRights ) );
}
return $this->mRights;
}
) );
# Hook for additional groups
wfRunHooks( 'UserEffectiveGroups', array( &$this, &$this->mEffectiveGroups ) );
+ // Force reindexation of groups when a hook has unset one of them
+ $this->mEffectiveGroups = array_values( array_unique( $this->mEffectiveGroups ) );
wfProfileOut( __METHOD__ );
}
return $this->mEffectiveGroups;
// Pull from a slave to be less cruel to servers
// Accuracy isn't the point anyway here
$dbr = wfGetDB( DB_SLAVE );
- $count = $dbr->selectField(
+ $count = (int) $dbr->selectField(
'revision',
'COUNT(rev_user)',
array( 'rev_user' => $this->getId() ),
wfProfileIn( __METHOD__ );
$content = $revision->getContent();
- $len = $content->getSize();
- $rt = $content->getUltimateRedirectTarget();
+ $len = $content ? $content->getSize() : 0;
+ $rt = $content ? $content->getUltimateRedirectTarget() : null;
$conditions = array( 'page_id' => $this->getId() );
// Bug 30711: always use current version when adding a new section
if ( is_null( $edittime ) || $section == 'new' ) {
$oldContent = $this->getContent();
- if ( ! $oldContent ) {
- wfDebug( __METHOD__ . ": no page text\n" );
- wfProfileOut( __METHOD__ );
- return null;
- }
} else {
$dbw = wfGetDB( DB_MASTER );
$rev = Revision::loadFromTimestamp( $dbw, $this->mTitle, $edittime );
$oldContent = $rev->getContent();
}
+ if ( ! $oldContent ) {
+ wfDebug( __METHOD__ . ": no page text\n" );
+ wfProfileOut( __METHOD__ );
+ return null;
+ }
+
+ //FIXME: $oldContent might be null?
$newContent = $oldContent->replaceSection( $section, $sectionContent, $sectionTitle );
}
# Bug 37225: use accessor to get the text as Revision may trim it
$content = $revision->getContent(); // sanity; get normalized version
+ if ( $content ) {
+ $newsize = $content->getSize();
+ }
+
# Update the page record with revision data
$this->updateRevisionOn( $dbw, $revision, 0 );
$this->mTitle->getUserPermissionsErrors( 'autopatrol', $user ) );
# Add RC row to the DB
$rc = RecentChange::notifyNew( $now, $this->mTitle, $isminor, $user, $summary, $bot,
- '', $content->getSize(), $revisionId, $patrolled );
+ '', $newsize, $revisionId, $patrolled );
# Log auto-patrolled edits
if ( $patrolled ) {
* @since 1.21
*/
public function prepareContentForEdit( Content $content, $revid = null, User $user = null, $serialization_format = null ) {
- global $wgParser, $wgContLang, $wgUser;
+ global $wgContLang, $wgUser;
$user = is_null( $user ) ? $wgUser : $user;
//XXX: check $user->getId() here???
$edit = (object)array();
$edit->revid = $revid;
- $edit->pstContent = $content->preSaveTransform( $this->mTitle, $user, $popts );
- $edit->pst = $edit->pstContent->serialize( $serialization_format ); #XXX: do we need this??
- $edit->format = $serialization_format;
+ $edit->pstContent = $content ? $content->preSaveTransform( $this->mTitle, $user, $popts ) : null;
+ $edit->format = $serialization_format;
$edit->popts = $this->makeParserOptions( 'canonical' );
-
- $edit->output = $edit->pstContent->getParserOutput( $this->mTitle, $revid, $edit->popts );
+ $edit->output = $edit->pstContent ? $edit->pstContent->getParserOutput( $this->mTitle, $revid, $edit->popts ) : null;
$edit->newContent = $content;
$edit->oldContent = $this->getContent( Revision::RAW );
#NOTE: B/C for hooks! don't use these fields!
- $edit->newText = ContentHandler::getContentText( $edit->newContent );
+ $edit->newText = $edit->newContent ? ContentHandler::getContentText( $edit->newContent ) : '';
$edit->oldText = $edit->oldContent ? ContentHandler::getContentText( $edit->oldContent ) : '';
+ $edit->pst = $edit->pstContent ? $edit->pstContent->serialize( $serialization_format ) : '';
$this->mPreparedEdit = $edit;
-
return $edit;
}
}
# Update the links tables and other secondary data
- $updates = $content->getSecondaryDataUpdates( $this->getTitle(), null, true, $editInfo->output );
- DataUpdate::runUpdates( $updates );
+ if ( $content ) {
+ $updates = $content->getSecondaryDataUpdates( $this->getTitle(), null, true, $editInfo->output );
+ DataUpdate::runUpdates( $updates );
+ }
wfRunHooks( 'ArticleEditUpdates', array( &$this, &$editInfo, $options['changed'] ) );
if ( $this->mTitle->getNamespace() == NS_MEDIAWIKI ) {
#XXX: could skip pseudo-messages like js/css here, based on content model.
- $msgtext = $content->getWikitextForTransclusion();
+ $msgtext = $content ? $content->getWikitextForTransclusion() : null;
if ( $msgtext === false || $msgtext === null ) $msgtext = '';
MessageCache::singleton()->replace( $shortTitle, $msgtext );
if ( !isset( $userGroups ) ) {
$user = User::newFromRow( $row );
} else {
- if ( !is_array( $userGroups[$row->user_name] ) ) {
+ if ( !isset( $userGroups[$row->user_name] ) || !is_array( $userGroups[$row->user_name] ) ) {
$userGroups[$row->user_name] = array();
}
$user = User::newFromRow( $row, array( 'user_groups' => $userGroups[$row->user_name] ) );
*/
public function setTitle( Title $t ) {
$this->title = $t;
+ // Erase the WikiPage so a new one with the new title gets created.
+ $this->wikipage = null;
}
/**
* @param $p WikiPage object
*/
public function setWikiPage( WikiPage $p ) {
+ $contextTitle = $this->getTitle();
+ $pageTitle = $p->getTitle();
+ if ( !$contextTitle || !$pageTitle->equals( $contextTitle ) ) {
+ $this->setTitle( $pageTitle );
+ }
+ // Defer this to the end since setTitle sets it to null.
$this->wikipage = $p;
}
if ( ContentHandler::runLegacyHooks( 'ShowRawCssJs', array( $this->mNewContent, $this->mNewPage, $out ) ) ) {
// NOTE: deprecated hook, B/C only
// use the content object's own rendering
- $po = $this->mNewRev->getContent()->getParserOutput( $this->mNewRev->getTitle(), $this->mNewRev->getId() );
- $out->addHTML( $po->getText() );
+ $cnt = $this->mNewRev->getContent();
+ $po = $cnt ? $cnt->getParserOutput( $this->mNewRev->getTitle(), $this->mNewRev->getId() ) : null;
+ $txt = $po ? $po->getText() : '';
+ $out->addHTML( $txt );
}
} elseif( !wfRunHooks( 'ArticleContentViewCustom', array( $this->mNewContent, $this->mNewPage, $out ) ) ) {
// Handled by extension
$parserOutput = $this->getParserOutput( $wikiPage, $this->mNewRev );
# Also try to load it as a redirect
- $rt = $this->mNewContent->getRedirectTarget();
+ $rt = $this->mNewContent ? $this->mNewContent->getRedirectTarget() : null;
if ( $rt ) {
$article = Article::newFromTitle( $this->mNewPage, $this->getContext() );
}
if ( $this->mOldRev ) {
$this->mOldContent = $this->mOldRev->getContent( Revision::FOR_THIS_USER, $this->getUser() );
- if ( $this->mOldContent === false ) {
+ if ( $this->mOldContent === null ) {
return false;
}
}
if ( $this->mNewRev ) {
$this->mNewContent = $this->mNewRev->getContent( Revision::FOR_THIS_USER, $this->getUser() );
- if ( $this->mNewContent === false ) {
+ if ( $this->mNewContent === null ) {
return false;
}
}
$dir = self::realpath( $dir );
$this->setVar( 'wgSQLiteDataDir', $dir );
}
+ # Table prefix is not used on SQLite, keep it empty
+ $this->setVar( 'wgDBprefix', '' );
return $result;
}
return true;
}
$content = $targetRev->getContent();
- $currentDest = $content->getRedirectTarget();
+ $currentDest = $content ? $content->getRedirectTarget() : null;
if ( !$currentDest || !$currentDest->equals( $this->redirTitle ) ) {
wfDebug( __METHOD__.": Redirect has changed since the job was queued\n" );
return true;
}
public static function runForTitleInternal( Title $title, Revision $revision, $fname ) {
- global $wgContLang;
+ wfProfileIn( $fname );
+ $content = $revision->getContent( Revision::RAW );
- wfProfileIn( $fname . '-parse' );
- $options = ParserOptions::newFromUserAndLang( new User, $wgContLang );
- $content = $revision->getContent();
- $parserOutput = $content->getParserOutput( $title, $revision->getId(), $options, false );
- wfProfileOut( $fname . '-parse' );
+ if ( !$content ) {
+ // if there is no content, pretend the content is empty
+ $content = $revision->getContentHandler()->makeEmptyContent();
+ }
- wfProfileIn( $fname . '-update' );
- $updates = $content->getSecondaryDataUpdates( $title, null, false, $parserOutput );
+ $updates = $content->getSecondaryDataUpdates( $title, null, false );
DataUpdate::runUpdates( $updates );
- wfProfileOut( $fname . '-update' );
+ wfProfileOut( $fname );
}
}
if ( $rev ) {
$content = $rev->getContent();
- $text = $content->getWikitextForTransclusion();
+ $text = $content ? $content->getWikitextForTransclusion() : null;
if ( $text === false || $text === null ) {
$text = false;
}
$content = $revision->getContent( Revision::RAW );
+
+ if ( !$content ) {
+ wfDebug( __METHOD__ . "failed to load content of JS/CSS page!\n" );
+ return null;
+ }
+
$model = $content->getModel();
if ( $model !== CONTENT_MODEL_CSS && $model !== CONTENT_MODEL_JAVASCRIPT ) {
- wfDebug( __METHOD__ . "bad content model #$model for JS/CSS page!\n" );
+ wfDebug( __METHOD__ . "bad content model $model for JS/CSS page!\n" );
return null;
}
//TODO: if we could plug in some code that knows about special content models *and* about
// special features of the search engine, the search could benefit.
$content = $this->mRevision->getContent();
- $this->mText = $content->getTextForSearchIndex();
+ $this->mText = $content ? $content->getTextForSearchIndex() : '';
} else { // TODO: can we fetch raw wikitext for commons images?
$this->mText = '';
}
* @ingroup SpecialPage
*/
class SpecialChangePassword extends UnlistedSpecialPage {
+
+ protected $mUserName, $mOldpass, $mNewpass, $mRetype, $mDomain;
+
public function __construct() {
parent::__construct( 'ChangePassword' );
}
$this->getOutput()->redirect( $titleObj->getFullURL() );
}
+ /**
+ * @param $msg string
+ */
function error( $msg ) {
$this->getOutput()->addHTML( Xml::element('p', array( 'class' => 'error' ), $msg ) );
}
);
}
+ /**
+ * @param $fields array
+ * @return string
+ */
function pretty( $fields ) {
$out = '';
foreach ( $fields as $list ) {
try {
$user->setPassword( $this->mNewpass );
wfRunHooks( 'PrefsPasswordAudit', array( $user, $newpass, 'success' ) );
- $this->mNewpass = $this->mOldpass = $this->mRetypePass = '';
+ $this->mNewpass = $this->mOldpass = $this->mRetype = '';
} catch( PasswordError $e ) {
wfRunHooks( 'PrefsPasswordAudit', array( $user, $newpass, 'error' ) );
throw new PasswordError( $e->getMessage() );
if( !isset( $groups[$group] ) ) {
$groups[$group] = array();
}
- $groups[$group][$page->getDescription()] = array( $page->getTitle(), $page->isRestricted(), $page->isExpensive() );
+ $groups[$group][$page->getDescription()] = array(
+ $page->getTitle(),
+ $page->isRestricted(),
+ $page->isCached()
+ );
}
}
}
private function outputPageList( $groups ) {
- global $wgMiserMode;
$out = $this->getOutput();
$includesRestrictedPages = false;
$includesCachedPages = false;
foreach ( $groups as $group => $sortedPages ) {
- $middle = ceil( count( $sortedPages )/2 );
$total = count( $sortedPages );
+ $middle = ceil( $total / 2 );
$count = 0;
$out->wrapWikiMsg( "<h2 class=\"mw-specialpagesgroup\" id=\"mw-specialpagesgroup-$group\">$1</h2>\n", "specialpages-group-$group" );
Html::openElement( 'ul' ) . "\n"
);
foreach( $sortedPages as $desc => $specialpage ) {
- list( $title, $restricted, $expensive) = $specialpage;
+ list( $title, $restricted, $cached ) = $specialpage;
$pageClasses = array();
- if ( $expensive && $wgMiserMode ){
+ if ( $cached ) {
$includesCachedPages = true;
$pageClasses[] = 'mw-specialpagecached';
}
switch ( $case ) {
case 'prefixed':
case 'תחילית':
- # Duplicate the "Waw" if prefixed
- if ( substr( $word, 0, 2 ) == "ו" && substr( $word, 0, 4 ) != "וו" ) {
+ # Duplicate the "Waw" if prefixed, but not if it is already double.
+ if ( substr( $word, 0, 2 ) === "ו" && substr( $word, 0, 4 ) !== "וו" ) {
$word = "ו" . $word;
}
- # Remove the "He" if prefixed
- if ( substr( $word, 0, 2 ) == "ה" ) {
+ # Remove the "He" article if prefixed.
+ if ( substr( $word, 0, 2 ) === "ה" ) {
$word = substr( $word, 2 );
}
- # Add a hyphen (maqaf) if non-Hebrew letters
+ # Add a hyphen (maqaf) before non-Hebrew letters.
if ( substr( $word, 0, 2 ) < "א" || substr( $word, 0, 2 ) > "ת" ) {
$word = "־" . $word;
}
return $word;
}
-
}
'duration-centuries' => '$1 {{PLURAL:$1|sieglu|sieglos}}',
'duration-millennia' => '$1 {{PLURAL:$1|mileniu|milenios}}',
+# Unknown messages
+'mytalk-parenthetical' => 'alderique',
);
'listgrouprights-group' => 'Gruppm',
'listgrouprights-rights' => 'Rechte',
'listgrouprights-helppage' => 'Help:Gruppmrechte',
-'listgrouprights-members' => '(Mitgliaderlisten)',
+'listgrouprights-members' => '(Mitgliedalistn)',
'listgrouprights-addgroup' => 'Benutzer zua {{PLURAL:$2|derer Gruppm|dé Gruppm}} dazuadoah: $1',
'listgrouprights-removegroup' => 'Benutzer aus {{PLURAL:$2|derer Gruppm|dé Gruppm}} entferner: $1',
'listgrouprights-addgroup-all' => 'Benutzer zua olle Gruppm dazuadoah',
'duration-centuries' => '$1 {{PLURAL:$1|стагодзьдзе|стагодзьдзі|стагодзьдзяў}}',
'duration-millennia' => '$1 {{PLURAL:$1|тысячагодзьдзе|тысячагодзьдзі|тысячагодзьдзяў}}',
+# Unknown messages
+'mytalk-parenthetical' => 'гутаркі',
);
'logentry-move-move_redir-noredirect' => '$1 přesunul stránku $3 na $4 místo přesměrování bez založení přesměrování',
'logentry-patrol-patrol' => '$1 označil revizi $4 stránky $3 jako prověřenou',
'logentry-patrol-patrol-auto' => '$1 automaticky označil revizi $4 stránky $3 jako prověřenou',
-'logentry-newusers-newusers' => '$1 založil uživatelský účet',
-'logentry-newusers-create' => '$1 založil uživatelský účet',
+'logentry-newusers-newusers' => '$1 si založil uživatelský účet',
+'logentry-newusers-create' => '$1 si založil uživatelský účet',
'logentry-newusers-create2' => '$1 založil uživatelský účet $3',
'logentry-newusers-autocreate' => 'Automaticky byl založen účet $1',
'newuserlog-byemail' => 'heslo zasláno e-mailem',
'newwindow' => '(åbner i et nyt vindue)',
'cancel' => 'Afbryd',
'moredotdotdot' => 'Mere...',
-'mypage' => 'Min side',
-'mytalk' => 'Min diskussion',
+'mypage' => 'Side',
+'mytalk' => 'Diskussion',
'anontalk' => 'Diskussionsside for denne IP-adresse',
'navigation' => 'Navigation',
'and' => ' og',
# Watchlist
'watchlist' => 'Overvågningsliste',
-'mywatchlist' => 'Min overvågningsliste',
+'mywatchlist' => 'Overvågningsliste',
'watchlistfor2' => 'For $1 $2',
'nowatchlist' => 'Du har ingenting i din overvågningsliste.',
'watchlistanontext' => 'Du skal $1, for at se din overvågningsliste eller ændre indholdet af den.',
# Contributions
'contributions' => 'Brugerbidrag',
'contributions-title' => 'Brugerbidrag for $1',
-'mycontris' => 'Mine bidrag',
+'mycontris' => 'Bidrag',
'contribsub2' => 'For $1 ($2)',
'nocontribs' => 'Ingen ændringer er fundet som opfylder disse kriterier.',
'uctop' => ' (seneste)',
'duration-centuries' => '$1 {{PLURAL:$1|århundrede|århundreder}}',
'duration-millennia' => '$1 {{PLURAL:$1|årtusind|årtusinder}}',
+# Unknown messages
+'mytalk-parenthetical' => 'diskussion',
);
'pageinfo-edits' => 'Gesamtzahl der Bearbeitungen',
'pageinfo-authors' => 'Gesamtzahl unterschiedlicher Autoren',
'pageinfo-recent-edits' => 'Anzahl der kürzlich erfolgten Bearbeitungen (innerhalb der letzten $1)',
-'pageinfo-recent-authors' => 'Anzahl der unterschiedlichen Autoren',
+'pageinfo-recent-authors' => 'Anzahl unterschiedlicher Autoren',
'pageinfo-magic-words' => '{{PLURAL:$1|Magisches Wort|Magische Wörter}} ($1)',
'pageinfo-hidden-categories' => 'Versteckte {{PLURAL:$1|Kategorie|Kategorien}} ($1)',
'pageinfo-templates' => 'Eingebundene {{PLURAL:$1|Vorlage|Vorlagen}} ($1)',
'duration-centuries' => '$1 {{PLURAL:$1|Jahrhundert|Jahrhunderte}}',
'duration-millennia' => '$1 {{PLURAL:$1|Jahrtausend|Jahrtausende}}',
+# Unknown messages
+'mytalk-parenthetical' => 'Diskussion',
);
'duration-centuries' => '$1 {{PLURAL:$1|seserre|seserri}}',
'duration-millennia' => '$1 {{PLURAL:$1|milenyum|milenyumi}}',
+# Unknown messages
+'mytalk-parenthetical' => 'behse',
);
'newwindow' => '(se wótcynijo w nowem woknje)',
'cancel' => 'Pśetergnuś',
'moredotdotdot' => 'Wěcej…',
-'mypage' => 'Mój bok',
-'mytalk' => 'mója diskusija',
+'mypage' => 'Bok',
+'mytalk' => 'Diskusija',
'anontalk' => 'Diskusija z toś teju IP',
'navigation' => 'Nawigacija',
'and' => ' a',
# Preferences page
'preferences' => 'Nastajenja',
-'mypreferences' => 'nastajenja',
+'mypreferences' => 'Nastajenja',
'prefs-edits' => 'Licba wobźěłanjow:',
'prefsnologin' => 'Njejsy pśizjawjony',
'prefsnologintext' => 'Musyš se <span class="plainlinks">[{{fullurl:{{#Special:UserLogin}}|returnto=$1}} pśizjawiś]</span>, aby mógał swóje nastajenja změniś.',
# Watchlist
'watchlist' => 'Wobglědowańka',
-'mywatchlist' => 'wobglědowańka',
+'mywatchlist' => 'Wobglědowańka',
'watchlistfor2' => 'Za wužywarja $1 $2',
'nowatchlist' => 'Žedne zapise w twójej wobglědowańce.',
'watchlistanontext' => 'Dejš $1, aby mógał swóju wobglědowańku wiźeś abo zapise w njej wobźěłaś.',
# Contributions
'contributions' => 'Wužywarske pśinoski',
'contributions-title' => 'Wužywarske pśinoski wót $1',
-'mycontris' => 'móje pśinoski',
+'mycontris' => 'Pśinoski',
'contribsub2' => 'Za $1 ($2)',
'nocontribs' => 'Za toś te kriterije njejsu žedne změny se namakali.',
'uctop' => '(aktualny)',
'duration-centuries' => '$1 {{PLURAL:$1|stolěśe|stolěśi|stolěśa|stolěśow}}',
'duration-millennia' => '$1 {{PLURAL:$1|lěttysac|lěttysaca|lěttysace|lěttysacow}}',
+# Unknown messages
+'mytalk-parenthetical' => 'diskusija',
);
'linkprefix' => '/^(.*?)([a-zA-Z\\x80-\\xff]+)$/sD', # only translate this message to other languages if you have to change it
-'about' => 'About',
-'article' => 'Content page',
-'newwindow' => '(opens in new window)',
-'cancel' => 'Cancel',
-'moredotdotdot' => 'More...',
-'mypage' => 'Page',
-'mytalk' => 'Talk',
-'anontalk' => 'Talk for this IP address',
-'navigation' => 'Navigation',
-'and' => ' and',
+'about' => 'About',
+'article' => 'Content page',
+'newwindow' => '(opens in new window)',
+'cancel' => 'Cancel',
+'moredotdotdot' => 'More...',
+'mypage' => 'Page',
+'mytalk' => 'Talk',
+'mytalk-parenthetical' => 'talk',
+'anontalk' => 'Talk for this IP address',
+'navigation' => 'Navigation',
+'and' => ' and',
# Cologne Blue skin
'qbfind' => 'Find',
* '''Opera:''' vacía la caché en ''Herramientas → Preferencias''",
'usercssyoucanpreview' => "'''Consejo:''' Usa el botón «{{int:showpreview}}» para probar el nuevo CSS antes de guardarlo.",
'userjsyoucanpreview' => "'''Consejo:''' Usa el botón «{{int:showpreview}}» para probar el nuevo JS antes de guardarlo.",
-'usercsspreview' => "'''Recuerda que solo estás previsualizando tu CSS de usuario.'''
+'usercsspreview' => "'''Recuerda que sólo estás previsualizando tu CSS de usuario.'''
'''¡Aún no se ha guardado!'''",
'userjspreview' => "'''¡Recuerda que solo estás previsualizando tu JavaScript de usuario.'''
'''¡Aún no se ha guardado!'''",
'''¡Aún no se ha guardado!'''",
'sitejspreview' => "'''Recuerda que sólo estás previsualizando este código JavaScript.'''
'''¡Aún no se ha guardado!'''",
-'userinvalidcssjstitle' => "'''Aviso:''' No existe la skin «$1». Recuerda que las páginas personalizadas ''.css'' y ''.js'' tienen un título en minúsculas. Por ejemplo, {{ns:user}}:Ejemplo/vector.css en vez de {{ns:user}}:Ejemplo/Vector.css.",
+'userinvalidcssjstitle' => "'''Aviso:''' No existe la piel «$1». Recuerda que las páginas personalizadas ''.css'' y ''.js'' tienen un título en minúsculas. Por ejemplo, {{ns:user}}:Ejemplo/vector.css en vez de {{ns:user}}:Ejemplo/Vector.css.",
'updated' => '(Actualizado)',
'note' => "'''Nota:'''",
'previewnote' => "'''Recuerda que esto es solo una previsualización.'''
'page_first' => 'primeras',
'page_last' => 'últimas',
'histlegend' => "Selección de diferencias: marca los selectores de las versiones a comparar y pulsa ''enter'' o el botón de abajo.<br />
-Leyenda: (act) = diferencias con la versión actual,
-(prev) = diferencias con la versión previa, M = edición menor",
+Leyenda: '''(act)''' = diferencias con la versión actual,
+'''(ant)''' = diferencias con la versión anterior, '''m''' = edición menor",
'history-fieldset-title' => 'Buscar en el historial',
'history-show-deleted' => 'Solo ediciones ocultadas',
'histfirst' => 'Primeras',
'revdelete-text' => "Las revisiones borradas aún aparecerán en el historial de la página y en los registros, pero sus contenidos no serán accesibles al público.'''
Otros administradores de {{SITENAME}} aún podrán acceder al contenido oculto y podrán deshacer el borrado a través de la misma interfaz, a menos que se establezcan restricciones adicionales.",
'revdelete-confirm' => 'Por favor confirma que deseas realizar la operación, que entiendes las consecuencias y que estás ejecutando dicha acción acorde con [[{{MediaWiki:Policy-url}}|las políticas]].',
-'revdelete-suppress-text' => "La herramienta de supresión '''sólo''' debería usarse en los siguientes casos:
+'revdelete-suppress-text' => "La herramienta de supresión '''solo''' debería usarse en los siguientes casos:
* Información potencialmente injuriosa o calumniante.
* Información personal inapropiada, tal como:
*: ''nombres, domicilios, números de teléfono, números de la seguridad social e información análoga.",
'statistics-articles' => 'Páginas de contenido',
'statistics-pages' => 'Páginas',
'statistics-pages-desc' => 'Todas las páginas en el wiki, incluyendo páginas de discusión, redirecciones, etc.',
-'statistics-files' => 'Ficheros subidos',
+'statistics-files' => 'Archivos subidos',
'statistics-edits' => 'Ediciones en páginas desde que {{SITENAME}} fue instalado',
'statistics-edits-average' => 'Media de ediciones por página',
'statistics-views-total' => 'Visitas totales',
# Special:NewFiles
'newimages' => 'Galería de imágenes nuevas',
'imagelisttext' => "Debajo hay una lista de '''$1''' {{PLURAL:$1|imagen|imágenes}} ordenadas $2.",
-'newimages-summary' => 'Esta página especial muestra una galería de los últimos ficheros subidos.',
+'newimages-summary' => 'Esta página especial muestra una galería de los últimos archivos subidos.',
'newimages-legend' => 'Nombre del fichero',
'newimages-label' => 'Nombre del fichero (o una parte):',
'showhidebots' => '($1 bots)',
'ipb-disableusertalk' => 'جلوگیری از ویرایشی صفحهً بحث توسط خود کاربر در زمانی که بسته است',
'ipb-change-block' => 'بستن دوبارهٔ کاربر با این تنظیمها',
'ipb-confirm' => 'تأیید بستن',
-'badipaddress' => 'نشانی آیی غیر مجاز',
+'badipaddress' => 'نشانی آیپی غیر مجاز',
'blockipsuccesssub' => 'بستن با موفقیت انجام شد',
'blockipsuccesstext' => '[[Special:Contributions/$1|$1]] بسته شد.<br />
برای بررسی بستهشدهها [[Special:BlockList|فهرست بستهشدهها]] را ببینید.',
'duration-centuries' => '$1 قرن',
'duration-millennia' => '{{PLURAL:$1|هزار سال |$1 هزار سال}}',
+# Unknown messages
+'mytalk-parenthetical' => 'بحث',
);
'duration-centuries' => '$1 {{PLURAL:$1|vuosisata|vuosisataa}}',
'duration-millennia' => '$1 {{PLURAL:$1|vuosituhat|vuosituhatta}}',
+# Unknown messages
+'mytalk-parenthetical' => 'keskustelu',
);
'sp-newimages-showfrom' => 'Afficher les nouveaux fichiers à partir du $1 à $2',
# Video information, used by Language::formatTimePeriod() to format lengths in the above messages
+'days-abbrev' => '$1 j',
'seconds' => '{{PLURAL:$1|$1 seconde|$1 secondes}}',
'minutes' => '{{PLURAL:$1|$1 minute|$1 minutes}}',
'hours' => '{{PLURAL:$1|$1 heure|$1 heures}}',
'duration-centuries' => '$1 {{PLURAL:$1|século|séculos}}',
'duration-millennia' => '$1 {{PLURAL:$1|milenio|milenios}}',
+# Unknown messages
+'mytalk-parenthetical' => 'conversa',
);
'duration-centuries' => '{{PLURAL:$1|מאה שנה|מאתיים שנה|$1 מאות שנים}}',
'duration-millennia' => '{{PLURAL:$1|אלף שנה|אלפיים שנה|$1 אלפי שנים}}',
+# Unknown messages
+'mytalk-parenthetical' => 'שיחה',
);
'newwindow' => '(wočinja so w nowym woknje)',
'cancel' => 'Přetorhnyć',
'moredotdotdot' => 'Wjace…',
-'mypage' => 'Moja strona',
-'mytalk' => 'moja diskusija',
+'mypage' => 'Strona',
+'mytalk' => 'Diskusija',
'anontalk' => 'Diskusijna strona tuteje IP.adresy',
'navigation' => 'Nawigacija',
'and' => ' a',
# Preferences page
'preferences' => 'Nastajenja',
-'mypreferences' => 'nastajenja',
+'mypreferences' => 'Nastajenja',
'prefs-edits' => 'Ličba změnow:',
'prefsnologin' => 'Njepřizjewjeny',
'prefsnologintext' => 'Dyrbiš <span class="plainlinks">[{{fullurl:{{#Special:UserLogin}}|returnto=$1}} přizjewjeny]</span> być, zo by móhł nastajenja postajić.',
# Watchlist
'watchlist' => 'wobkedźbowanki',
-'mywatchlist' => 'wobkedźbowanki',
+'mywatchlist' => 'Wobkedźbowanki',
'watchlistfor2' => 'Za wužiwarja $1 $2',
'nowatchlist' => 'Nimaš žane strony w swojich wobkedźbowankach.',
'watchlistanontext' => 'Dyrbiš so $1, zo by swoje wobkedźbowanki wobhladać abo wobdźěłać móhł.',
# Contributions
'contributions' => 'Přinoški wužiwarja',
'contributions-title' => 'Wužiwarske přinoški wot „$1“',
-'mycontris' => 'moje přinoški',
+'mycontris' => 'Přinoški',
'contribsub2' => 'za wužiwarja $1 ($2)',
'nocontribs' => 'Žane změny, kotrež podatym kriterijam wotpowěduja.',
'uctop' => '(aktualnje)',
'duration-centuries' => '$1 {{PLURAL:$1|lětstotk|lětstotkaj|lětstotki|lětstotkow}}',
'duration-millennia' => '$1 {{PLURAL:$1|lěttysac|lěttysacaj|lěttysacy|lěttysacow}}',
+# Unknown messages
+'mytalk-parenthetical' => 'diskusija',
);
Már létezik.',
'defaultmessagetext' => 'Alapértelmezett szöveg',
+# Content models
+'content-model-wikitext' => 'wikiszöveg',
+'content-model-text' => 'egyszerű szöveg',
+'content-model-javascript' => 'JavaScript',
+'content-model-css' => 'CSS',
+
# Parser/template warnings
'expensive-parserfunction-warning' => 'Figyelem: ezen a lapon túl sok erőforrásigényes elemzőfüggvény-hívás található.
# Preferences page
'preferences' => 'Beállítások',
-'mypreferences' => 'Beállításaim',
+'mypreferences' => 'Beállítások',
'prefs-edits' => 'Szerkesztéseid száma:',
'prefsnologin' => 'Nem jelentkeztél be',
'prefsnologintext' => 'Saját beállításaid elmentéséhez <span class="plainlinks">[{{fullurl:{{#Special:UserLogin}}|returnto=$1}} be kell jelentkezned.] </span>',
'linksearch-ns' => 'Névtér:',
'linksearch-ok' => 'keresés',
'linksearch-text' => 'Helyettesítő karaktereket is lehet használni, például "*.wikipedia.org". Legalább egy felső szintű tartománynak lennie kell, például "*.org"<br />
-Támogatott protokollok: <code>$1</code> (ezeket ne írd be a keresésbe).',
+Támogatott protokollok: <code>$1</code> (http:// az alapértelmezett, ha nincs protokoll megadva).',
'linksearch-line' => '$1 hivatkozva innen: $2',
'linksearch-error' => 'Helyettesítő karakterek csak a cím elején szerepelhetnek.',
'whatlinkshere-hideredirs' => 'átirányítások $1',
'whatlinkshere-hidetrans' => 'beillesztések $1',
'whatlinkshere-hidelinks' => 'linkek $1',
-'whatlinkshere-hideimages' => 'képhivatkozás $1',
+'whatlinkshere-hideimages' => 'fájlhivatkozások $1',
'whatlinkshere-filters' => 'Elemek szűrése',
# Block/unblock
'cascadeprotected' => 'Այս էջը պաշտպանված է խմբագրումից, քանի որ ընդգրկված է հետևյալ {{PLURAL:$1|էջի|էջերի}} տեքստում, {{PLURAL:$1|որը|որոնք}} պաշտպանվել {{PLURAL:$1|է|են}} կասկադային հնարավորությամբ.
$2',
'namespaceprotected' => 'Դուք չունեք «$1» անվանատարածքի էջերի խմբագրման իրավունք։',
+'customcssprotected' => 'Դուք չեք կարող խմբագրել այս CSS էջը, քանի որ այն պարունակում է այլ մասնակցի անձնական նախընտրանքներ։',
+'customjsprotected' => 'Դուք չեք կարող խմբագրել այս ՋավաՍկրիպտ էջը, քանի որ այն պարունակում է այլ մասնակցի անձնական նախընտրանքներ։',
'ns-specialprotected' => '«{{ns:special}}» անվանատարածքի էջերը չեն կարող խմբագրվել։',
'titleprotected' => "Այս անվանմամբ էջի ստեղծումը արգելվել է [[User:$1|$1]] մասնակցի կողմից։
Տրված պատճառն է՝ ''$2''։",
+'exception-nologin' => 'Չեք մտել համակարգ',
+'exception-nologin-text' => 'Այս էջը դիտելու կամ գործողություն կատարելու համար դուք պետք է մուտք գործեք այս վիքի։',
# Virus scanner
'virus-badscanner' => "Սխալ կարգավորւմ։ Անծանոթ վիրուսների զննիչ. ''$1''",
'yourpasswordagain' => 'Կրկնեք գաղտնաբառը.',
'remembermypassword' => 'Հիշել իմ մուտքագրված տվյալները այս համակարգչում ($1 {{PLURAL:$1|օրից|օրից}} ոչ ավել ժամկետով)',
'yourdomainname' => 'Ձեր դոմենը.',
+'password-change-forbidden' => 'Այս վիքիում չեք կարող փոխել գաղտնաբառ։',
'externaldberror' => 'Տեղի է ունեցել վավերացման արտաքին տվյալների բազայի սխալ, կամ դուք չունեք բավարար իրավունքներ ձեր արտաքին հաշվի փոփոխման համար։',
'login' => 'Մտնել',
'nav-login-createaccount' => 'Մտնել / Գրանցվել',
'createaccounterror' => 'Չհաջողվեց ստեղծել մասնակցային հաշիվ. $1',
'nocookiesnew' => 'Մասնակցային հաշիվը ստեղծված է, սակայն մուտքը համակարգ չհաջողվեց։ {{SITENAME}} կայքը օգտագործում է «քուքիներ» մասնակիցների վավերացման համար։ Ձեր մոտ «քուքիները» արգելված են։ Խնդրում ենք թույլատրել սրանք, ապա մտնել համակարգ ձեր նոր մասնակցի անունով և գաղտնաբառով։',
'nocookieslogin' => '{{SITENAME}} կայքը օգտագործում է «քուքիներ» մասնակիցների վավերացման համար։ Ձեր մոտ «քուքիները» արգելված են։ Խնդրում ենք թույլատրել սրանք և փորձել կրկին։',
+'nocookiesfornew' => 'Մասնակցային հաշիվը չհաջողվեց ստեղծվել, քանի որ հնարավոր չեր վավերացնել աղբյուրը։
+Ստուգեք, որ ձեզ մոտ թույլատրված են քուկիները, վերբեռնեք էջը և փորձեք կրկին։',
'noname' => 'Դուք չեք նշել թույլատրելի մասնակցային անուն։',
'loginsuccesstitle' => 'Բարեհաջող մուտք',
'loginsuccess' => "'''Դուք մուտք գործեցիք {{SITENAME}}, որպես \"\$1\"։'''",
'noemailprefs' => 'Այս հնարավորության գործածման համար անհրաժեշտ է նշել էլ-փոստի հասցե։',
'emailconfirmlink' => 'Վավերացնել ձեր էլ-փոստի հասցեն',
'invalidemailaddress' => 'Նշված էլ-փոստի հասցեն անընդունելի է, քանի որ այն ունի անթույլատրելի ֆորմատ։ Խնդրում ենք նշել ճշմարիտ հասցե կամ այս դաշտը թողնել դատարկ։',
+'emaildisabled' => 'Այս կայքը չի կարող ուղարկել էլ․ նամակներ։',
'accountcreated' => 'Հաշիվը ստեղծված է',
'accountcreatedtext' => '$1 մասնակցի հաշիվը ստեղծված է։',
'createaccount-title' => '{{SITENAME}}. մասնակցային հաշվի ստեղծում',
# E-mail sending
'php-mail-error-unknown' => 'Անհայտ սխալ PHP-ի mail() ֆունկցիայում',
+'user-mail-no-addy' => 'Փորձվեց ուղարկել էլ․ նամակ առանց էլ․ հասցեի։',
# Change password dialog
'resetpass' => 'Փոխել գաղտնաբառը',
'passwordreset-username' => 'Մասնակցի անուն.',
'passwordreset-emailelement' => 'Մասնակցային անուն. $1
Ժամանակավոր գաղտնաբառ. $2',
+'passwordreset-emailsent' => 'Ուղարկվեց հիշեցնող էլ․ նամակ։',
+'passwordreset-emailsent-capture' => 'Ուղարկվեց հիշեցնող էլ․ նամակ։ Այն ներկայացված է ստորև։',
+'passwordreset-emailerror-capture' => 'Ուղարկվեց հիշեցնող էլ․ նամակ։ Այն ներկայացված է ստորև։ Սակայն մասնակցին ուղարկելը չհաջողվեց․',
# Special:ChangeEmail
'changeemail' => 'Փոխել էլ. հասցեն',
+'changeemail-header' => 'Փոխել հաշվի էլ․ հասցեն',
+'changeemail-oldemail' => 'Ներկա էլ․ հասցե․',
+'changeemail-newemail' => 'Նոր էլ․ հասցե․',
+'changeemail-none' => '(ոչ մի)',
'changeemail-submit' => 'Խմբագրել էլ․ հասցեն',
'changeemail-cancel' => 'Չեղարկել',
'mailnologin' => 'Ուղարկման հասցե չկա',
'mailnologintext' => 'Անհրաժեշտ է [[Special:UserLogin|մտնել համակարգ]] և ունենալ գործող էլ-փոստի հասցե ձեր [[Special:Preferences|նախընտրություններում]]՝ ուրիշ մասնակիցներին էլեկտրոնային նամակներ ուղարկելու համար։',
'emailuser' => 'էլ-նամակ ուղարկել այս մասնակցին',
+'emailuser-title-target' => 'Ուղարկել էլ․ նամակ {{GENDER:$1|մասնակցին}}',
+'emailuser-title-notarget' => 'Ուղարկել էլ․ նամակ',
'emailpage' => 'Էլ-նամակ ուղարկել մասնակցին',
-'emailpagetext' => 'Եթե այս մասնակիցը նշել է գործող էլ-փոստի հասցե իր նախընտրություններում, ապա ստորև բերված ձևով հնարավոր է ուղարկել նրան էլ-նամակ։
-Այն էլ-հասցեն, որը դուք նշել եք ձեր նախընտրություններում, կերևա «Ումից» դաշտում, ուստի ստացողը հնարավորություն կունենա պատասխանել։',
+'emailpagetext' => 'Դուք կարող եք օգտագործել ներքևի ձևը այս {{GENDER:$1|մասնակցին}} էլ-նամաակ ուղարկելու համար։
+
+Ձեր նախընտրանքներում նշված էլ-հասցեն կերևա «Ումից» դաշտում և ստացողը կարող է անմիջապես պատասխանել ձեզ։',
'usermailererror' => 'Նամակն ուղարկելիս սխալ է վերադարձվել.',
-'defemailsubject' => '{{SITENAME}} e-mail',
+'defemailsubject' => '{{SITENAME}} էլ-նամակ',
+'usermaildisabled' => 'Էլ․ նամակ ուղարկելը թույլատրված չէ։',
+'usermaildisabledtext' => 'Այս վիքիում չեք կարղ էլ․ նամակ ուղարկել այլ մասնակիցների',
'noemailtitle' => 'Չկա էլ-փոստի հասցե',
'noemailtext' => 'Այս մասնակիցը չի նշել էլ-փոստի հասցե կամ նախընտրել է չստանալ էլ-նամակներ այլ մասնակիցներից։',
+'email-legend' => 'Ուղարկել էլ․ նամակ {{SITENAME}}յի այլ մասնակցի',
'emailfrom' => 'Ումից.',
'emailto' => 'Ում.',
'emailsubject' => 'Թեմա.',
'undelete-bad-store-key' => 'Չհաջողվեց վերականգնել նիշքի $1 ժամդրոշմով տարբերակը. նիշքը բացակայում էր ջնջումից առաջ։',
'undelete-cleanup-error' => 'Տեղի ունեցավ սխալ չօգտագործվող արխիվացված «$1» նիշքը ջնջելիս։',
'undelete-missing-filearchive' => 'Չհաջողվեց վերականգնել $1 արխիվային իդենտիֆիկատորով նիշքը, քանի որ այն բացակայում է տվյալների բազայից։ Հնարավոր է այն արդեն վերականգնվել է։',
+'undelete-error' => 'Սխալ էջը վերականգնելիս։',
'undelete-error-short' => 'Նայլի վերականգնման սխալ. $1',
'undelete-error-long' => 'Տեղի են ունեցել սխալներ նիշքը վերականգնելու ընթացքում.
$1',
+'undelete-show-file-submit' => 'Այո',
# Namespace form on various pages
'namespace' => 'Անվանատարածք.',
'sp-contributions-logs' => 'տեղեկամատյաններ',
'sp-contributions-talk' => 'քննարկում',
'sp-contributions-userrights' => 'մասնակիցների իրավունքների կառավարում',
+'sp-contributions-blocked-notice' => 'Այս մասնակիցը ներկա պահին արգելափակված է։
+Ստորև ներկայացված է արգելափակման տեղեկամատյանի վերջին գրառումը.',
+'sp-contributions-blocked-notice-anon' => 'Այս IP հասցեն ներկա պահին արգելափակված է։
+Ստորև ներկայացված է արգելափակման տեղեկամատյանի վերջին գրառումը.',
'sp-contributions-search' => 'Որոնել ներդրումները',
'sp-contributions-username' => 'IP-հասե կամ մասնակցի անուն.',
'sp-contributions-toponly' => 'Ցույց տալ միայն այն խմբագրումները, որոնք վերջին փոփոխություն են',
'whatlinkshere-hideredirs' => '$1 վերահղում',
'whatlinkshere-hidetrans' => '$1 ներառումները',
'whatlinkshere-hidelinks' => '$1 հղում',
+'whatlinkshere-hideimages' => '$1 նիշքային հղումներ',
'whatlinkshere-filters' => 'Զտիչներ',
# Block/unblock
+'autoblockid' => 'Ավտոմատ արգելափակում #$1',
+'block' => 'Արգելափակել մասնակցին',
+'unblock' => 'Արգելափակումից հանել',
'blockip' => 'Մասնակցի արգելափակում',
+'blockip-title' => 'Արգելափակել մասնակցին',
'blockip-legend' => 'Մասնակցի արգելափակում',
'blockiptext' => 'Օգտագործեք ստորև բերված ձևը որոշակի IP-հասցեից կամ մասնակցի անունից գրելու հնարավորությունը արգելափակելու համար։
Նման բան հարկավոր է անել միայն վանդալության կանխարգելման նպատակով և համաձայն [[{{MediaWiki:Policy-url}}|կանոնակարգի]]։
'ipusubmit' => 'Հանել արգելափակումը',
'unblocked' => '[[User:$1|$1]] մասնակիցը անարգելված է։',
'unblocked-id' => '$1 արգելափակումը հանված է',
+'blocklist' => 'Արգելափակված մասնակիցներ։',
'ipblocklist' => 'Արգելափակված IP-հասցեները և մասնակիցները',
'ipblocklist-legend' => 'Արգելափակված մասնակցի որոնում',
'ipblocklist-submit' => 'Որոնել',
'pagemovedsub' => 'Էջը վերանվանվեց',
'movepage-moved' => "'''«$1» էջը վերանվանվել է «$2»'''",
'movepage-moved-redirect' => 'Ստեղծվել է վերահղում։',
+'movepage-moved-noredirect' => 'Վերահղման ստեղծում թույլ չի տրվել',
'articleexists' => 'Այդ անվանմամբ էջ արդեն գոյություն ունի կամ ձեր ընտրած անվանումը անթույլատրելի է։
Խնդրում ենք ընտրել այլ անվանում։',
'talkexists' => "'''Էջը հաջողությամբ տեղափոխվեց, սակայն կցված քննարկման էջը հնարավոր չէր տեղափոխել, քանի որ նոր անվանմամբ էջ արդեն գոյություն ուներ։ Խնդրում ենք միաձուլել դրանք ձեռքով։'''",
# Special:ComparePages
'compare-page1' => 'Էջ 1',
'compare-page2' => 'Էջ 2',
+'compare-submit' => 'Համեմատել',
# Database error messages
'dberr-header' => 'Այս վիքիում խնդիրներ են առաջացել',
'logentry-newusers-newusers' => '$1 մասնակիցը ստեղծեց նոր հաշիվ',
'logentry-newusers-create' => '$1 մասնակիցը ստեղծեց նոր հաշիվ',
'logentry-newusers-create2' => '$1 Ստեղծեց նոր հաշիվ $3',
+'newuserlog-byemail' => 'Գաղտնաբառն ուղարկված է էլ․ փոստով',
+
+# Feedback
+'feedback-subject' => 'Թեմա.',
+'feedback-message' => 'Հաղորդագրություն․',
+'feedback-close' => 'Արված է',
# Search suggestions
'searchsuggest-search' => 'Որոնել',
* @author Malafaya
* @author McDutchie
* @author Reedy
+ * @author Yfdyh000
* @author לערי ריינהארט
*/
'statistics-mostpopular' => 'Le paginas plus visitate',
'disambiguations' => 'Paginas con ligamines a paginas de disambiguation',
-'disambiguationspage' => 'Template:Disambiguation',
+'disambiguationspage' => 'Template:Disambig
+Template:Disambiguation',
'disambiguations-text' => "Le sequente paginas contine al minus un ligamine a un '''pagina de disambiguation'''.
Istes debe forsan ligar directemente al articulo sur le thema in question.<br />
Un pagina se tracta como pagina de disambiguation si illo usa un patrono que es ligate ab [[MediaWiki:Disambiguationspage]].",
'underline-always' => 'Kanayon',
'underline-never' => 'Saan uray kaanoman',
-'underline-default' => 'Kasisigud a pagbasabasa',
+'underline-default' => 'Kasisigud a kudil wenno pagbasabasa',
# Font style option in Special:Preferences
'editfont-style' => 'Urnosen ti kita ti letra iti lugar:',
'newwindow' => '(aglukat iti sabali a tawa)',
'cancel' => 'Ukasen',
'moredotdotdot' => 'Adu pay...',
-'mypage' => 'Panidko',
-'mytalk' => 'Pakitungtungak',
+'mypage' => 'Panid',
+'mytalk' => 'Tungtungan',
'anontalk' => 'Tungtungan para iti daytoy a pagtaengan ti IP',
'navigation' => 'Pagdaliasatan',
'and' => ' ken',
'note' => "'''Paammo:'''",
'previewnote' => "'''Laglagipem a daytoy ket panagipadas laeng.'''
Dagiti sinukatam ket saan pay a naidulin!",
-'continue-editing' => 'Agtultuloy nga agurnos',
+'continue-editing' => 'Mapan idiay pagurnosan a lugar',
'previewconflict' => 'Daytoy a panagpadas ket agiparang ti testo dita ngato a panagurnos a lugar a kasla agparang no kayatmo nga idulin.',
'session_fail_preview' => "'''Pasensia! Saanmi a maaramid ti panag-urnos gapu ngamin ta naawanan ti gimong ti data.'''
Pangngaasi a padasem manen.
# Preferences page
'preferences' => 'Kaykayatan',
-'mypreferences' => 'Kaykayatko',
+'mypreferences' => 'Kaykayatan',
'prefs-edits' => 'Bilang dagiti inurnos:',
'prefsnologin' => 'Saan a nakastrek',
-'prefsnologintext' => 'Masapul a <span class="plainlinks">[{{fullurl:{{#Special:UserLogin}}|returnto=$1}} nakastrekka]</span> tapno makapili kadagiti kaykayatmo.',
+'prefsnologintext' => 'Masapul a <span class="plainlinks">[{{fullurl:{{#Special:UserLogin}}|returnto=$1}} nakastrekka]</span> tapno makapili kadagiti kakaykayatam.',
'changepassword' => 'Baliwan ti kontrasenias',
'prefs-skin' => 'Kudil',
'skin-preview' => 'Padasem',
-'datedefault' => 'Awan ti kaykayatan',
+'datedefault' => 'Awan ti kakaykayatan',
'prefs-beta' => 'Dagiti beta a langa',
'prefs-datetime' => 'Petsa ken oras',
'prefs-labs' => 'Dagiti subokan a langa',
'prefs-rc' => 'Kinaudi a binalbaliwan',
'prefs-watchlist' => 'Listaan ti bambantayan',
'prefs-watchlist-days' => 'Alaldaw nga iparang idiay listaan ti bambantayan:',
-'prefs-watchlist-days-max' => 'Kabayag nga $1 {{PLURAL:$1|nga aldaw|nga al-aldaw}}',
+'prefs-watchlist-days-max' => 'Kapaut nga $1 {{PLURAL:$1|nga aldaw|nga al-aldaw}}',
'prefs-watchlist-edits' => 'Kaadu a bilang ti ipakita kadagiti sinukatan iti napadakkel a bambantayan:',
'prefs-watchlist-edits-max' => 'Kaadu a bilang: 1000',
'prefs-watchlist-token' => 'Tandaan ti bambantayan:',
No adda makaammo daytoy a tulbek ditoy a pagikabilan ket mabalin da a basaen ti binambantayam, masapul nga agpilika ti pateg a seguridad.
Adda ditoy ti pugto a pateg a mausarmo: $1',
-'savedprefs' => 'Naidulin dagitoy kaykayatmon.',
+'savedprefs' => 'Naidulinen dagiti kakaykayatam.',
'timezonelegend' => 'Sona ti oras:',
'localtime' => 'Lokal nga oras:',
'timezoneuseserverdefault' => 'Usaren ti wiki a kasisigud ($1)',
'prefs-custom-css' => 'Naiduma a CSS',
'prefs-custom-js' => 'Naiduma a JavaScript',
'prefs-common-css-js' => 'Bingay a CSS/JavaScript dagiti amin a kudil:',
-'prefs-reset-intro' => 'Mabalinmo nga usaren daytoy a panid tapno maisublim dagita kaykayatmo iti kinasigud daytoy a wiki.
+'prefs-reset-intro' => 'Mabalinmo nga usaren daytoy a panid tapno maisublim dagita kakaykayatam iti kasisigud ti daytoy a wiki.
Ngem saanto a mabalinen nga ipasubli.',
'prefs-emailconfirm-label' => 'Pagsingkedan ti e-surat:',
'prefs-textboxsize' => 'Ti kadakkel ti pagurnosan a tawa',
'yourrealname' => 'Pudno a nagan:',
'yourlanguage' => 'Pagsasao:',
'yourvariant' => 'Linaon ti sabali a pagsasao:',
-'prefs-help-variant' => 'Ti kaykayatmo a sabsabali a panagsurat a maipakita kadagiti linaon ti panid daytoy a wiki.',
+'prefs-help-variant' => 'Ti kinaykayatmo a kita ti pagsasao wenno sabali a panagsurat a maipakita kadagiti linaon ti panid daytoy a wiki.',
'yournick' => 'Baro a pirma:',
'prefs-help-signature' => 'Komentario kadagiti pakipatangan a panid ket mapirmaan koma iti "<nowiki>~~~~</nowiki>" nga agpabalin ti pirmam ken ti petsa.',
'badsig' => 'Saan a pudno a kilaw a pirma.
'rightslogtext' => 'Listaan daytoy kadagiti sinukatan a karbengan ti agar-aramat.',
'rightslogentry' => 'sinukatan ti panagkameng iti bunggoy ti $1 manipud $2 iti $3',
'rightslogentry-autopromote' => 'naautomatiko a naipangato a naggapo iti $2 idiay $3',
+'logentry-rights-rights' => 'Ni $1 ket nangbaliw ti grupo a panakaikameng para kenni $3 manipud ti $4 iti $5',
+'logentry-rights-rights-legacy' => 'Ni $1 ket nangbaliw ti grupo a panakaikameng para kenni $3',
+'logentry-rights-autopromote' => 'Ni $1 ket automatiko idi a naipangato manipud ti $4 iti $5',
'rightsnone' => '(awan)',
# Associated actions - in the sentence "You do not have permission to X"
# Special:DeletedContributions
'deletedcontributions' => 'Dagiti naikkat nga inararamid ti agar-aramat',
'deletedcontributions-title' => 'Dagiti naikkat nga inararamid ti agar-aramat',
-'sp-deletedcontributions-contribs' => 'dagiti parawad',
+'sp-deletedcontributions-contribs' => 'naar-aramid',
# Special:LinkSearch
'linksearch' => 'Dagiti panagbiruk ti ruar a panilpo',
'linksearch-ok' => 'Biruken',
'linksearch-text' => 'Ti naataap a tarheta a kas "*.wikipedia.org" ket mabalin nga usaren.
Masapul ti kangatuan a pagturayan, a kaspagarigan "*.org".<br />
-Natapayaen a protokol: <code>$1</code> (saanmo nga inayon dagitoy iti panagbirukmo) .',
+Dagiti nasuportaran a protokol: <code>$1</code> (naipakasigud ti http:// no awan ti protokol a nainaganan).',
'linksearch-line' => 'Ti $1 ket nakasilpo idiay $2',
'linksearch-error' => 'Ti naatap a tarheta ket agparang laeng iti pinagrugi ti nagan ti agsangaili.',
'emailuser-title-target' => 'E-suratam daytoy nga {{GENDER:$1|agar-aramat}}',
'emailuser-title-notarget' => 'E-suratan ti agar-aramat',
'emailpage' => 'E-suratan ti agar-aramat',
-'emailpagetext' => 'Mabalinmo nga usaren ti kinabuklan dita baba nga agipatulod ti e-surat a mensahe daytoy nga agar-aramat.
+'emailpagetext' => 'Mabalinmo nga usaren ti kinabuklan dita baba nga agipatulod ti e-surat a mensahe ti daytoy nga {{GENDER:$1|agar-aramat}}.
Ti e-surat nga inkabilmo idiay [[Special:Preferences|kakaykayatam]] ket agparang a kas "Naggapu" a pagtaengan ti e-surat, tapno ti nagipatulodam ket makasungbat kenka.',
'usermailererror' => 'Kita ti surat ket nangisubli ti biddut:',
'defemailsubject' => '{{SITENAME}} e-surat naggapo ken ni "$1"',
# Watchlist
'watchlist' => 'Bambantayak',
-'mywatchlist' => 'Bambantayak',
+'mywatchlist' => 'Bambantayan',
'watchlistfor2' => 'Para iti $1 $2',
'nowatchlist' => 'Awan ti banag iti listaan dagiti bambantayam.',
'watchlistanontext' => 'Pangngaasim ti $1 tapno makitam dagiti inurnosmo dita bambantayam.',
# Contributions
'contributions' => 'Naaramidan dagiti agar-aramat',
'contributions-title' => 'Naaramidan ni $1',
-'mycontris' => 'Naaramidak',
+'mycontris' => 'Naar-aramid',
'contribsub2' => 'Para iti $1 ($2)',
'nocontribs' => 'Awan ti nasarakan a nasukatan a kapada daytoy a kita.',
'uctop' => '(rabaw)',
'whatlinkshere-hideredirs' => '$1 dagiti baw-ing',
'whatlinkshere-hidetrans' => '$1 dagiti mailaklak-am',
'whatlinkshere-hidelinks' => '$1 dagiti silpo',
-'whatlinkshere-hideimages' => '$1 dagiti silpo ti imahen',
+'whatlinkshere-hideimages' => '$1 a silsilpo ti papeles',
'whatlinkshere-filters' => 'Dagiti sagat',
# Block/unblock
'javascripttest-qunit-heading' => 'MediaWiki JavaScript QUnit test suite',
# Tooltip help for the actions
-'tooltip-pt-userpage' => 'Daytoy ti panid mo',
+'tooltip-pt-userpage' => 'Panidmo nga agar-aramat',
'tooltip-pt-anonuserpage' => 'Ti panid ti agar-aramat daytoy nga IP a pagtaengan nga urnosem a kasla',
'tooltip-pt-mytalk' => 'Pakitungtungam a panid',
'tooltip-pt-anontalk' => 'Pakitungtungan a maipapan ti panagurnos a naggapu ditoy nga IP a pagtaengan',
-'tooltip-pt-preferences' => 'Dagiti kaykayatmo',
-'tooltip-pt-watchlist' => 'Listaan dagiti panid a sipsiputem ti panagsuksutda',
-'tooltip-pt-mycontris' => 'Listaan dagiti naaramidmo',
-'tooltip-pt-login' => 'Maisingasing ti inka panag-serrek; nupay kasta, daytoy ket saan a maipapilit',
-'tooltip-pt-anonlogin' => 'Maisingasing ti inka panag-serrek; nupay kasta, daytoy ket saan a maipapilit',
+'tooltip-pt-preferences' => 'Dagiti kakaykayatam',
+'tooltip-pt-watchlist' => 'Listaan dagiti panid a sipsiputem para iti panakabalbaliw',
+'tooltip-pt-mycontris' => 'Listaan dagiti inaramidmo',
+'tooltip-pt-login' => 'Maisingasing a sumrekka; nupay kasta, daytoy ket saan a maipapilit',
+'tooltip-pt-anonlogin' => 'Maisingasing a sumrekka; nupay kasta, daytoy ket saan a maipapilit',
'tooltip-pt-logout' => 'Rummuar',
'tooltip-ca-talk' => 'Pagtungtungan a maipapan ti linaon ti panid',
'tooltip-ca-edit' => 'Mabalinmo nga urnosen daytoy a panid. Pangngaasi nga aramatem ti buton ti panagipadas sakbay nga agidulin',
'tooltip-upload' => 'Rugian ti agip-ipan',
'tooltip-rollback' => '"Baliktaden" isubli ti inurnos (dagiti inurnos) ti daytoy a panid ti kinaudi a nangaramid iti maysa a takla',
'tooltip-undo' => '"Ibabawi" ipasubli daytoy nga urnos ken lukatanna ti kinabuklan ti urnos iti panagpadas. Agpabalin daytoy a mangikabil ti rason idiay pinakabuklan.',
-'tooltip-preferences-save' => 'Idulin dagiti kaykayatmo',
+'tooltip-preferences-save' => 'Idulin dagiti kakaykayatam',
'tooltip-summary' => 'Ikabil ti bassit a pakabuklan',
# Metadata
# Info page
'pageinfo-title' => 'Pakaammo para iti "$1"',
-'pageinfo-not-current' => 'Ti pakaammo ket mabalin laeng a maiparang para iti agdama a panagbalbaliw.',
+'pageinfo-not-current' => 'Pasensia, saan a mabalin ti mangited ti pakaammo para kadagiti daan a panagbalbaliw.',
'pageinfo-header-basic' => 'Kangrunaan a pakaammuan',
'pageinfo-header-edits' => 'Pakasaritaan ti inurnos',
'pageinfo-header-restrictions' => 'Panagsalaknib ti panid',
'pageinfo-default-sort' => 'Kasisigud a kangrunaan a panagilasin',
'pageinfo-length' => 'Kaatiddog ti panid (kadagiti byte)',
'pageinfo-article-id' => 'ID ti panid',
+'pageinfo-language' => 'Pagsasao ti naglaon a panid',
'pageinfo-robot-policy' => 'Kasasaad ti panagbiruk a makina',
'pageinfo-robot-index' => 'Mabalin a maipasurotan',
'pageinfo-robot-noindex' => 'Saan a mabalin a maipasurotan',
'version-license' => 'Lisensia',
'version-poweredby-credits' => "Daytoy a wiki ket pinaandar ti '''[//www.mediawiki.org/ MediaWiki]''', karbengan a kopia © 2001-$1 $2.",
'version-poweredby-others' => 'dadduma pay',
+'version-credits-summary' => 'Kayat mi kuma a pammadayawan dagiti sumaganad a tao para kadagiti inparawadda ti [[Special:Version|MediaWiki]].',
'version-license-info' => 'Ti MediaWiki ket nawaya a software; maiwarasmo ken/wenno mabaliwam babaen ti banag iti GNU General Public License a naipablaak babaen ti Free Software Foundation; nupay iti bersion 2 iti Lisensia, wenno (ti panagpilim) ti ania man a bersion.
Ti MediaWiki ket naiwarwaras nga adda ti namnama a makatulong, ngem AWAN TI ANIA MAN A GARANTIA; nga awan pay ti naibagbaga a PANAKAILAKO wenno KALAINGAN NA ITI DAYTOY A PANGGEP. Kitaen ti GNU Sapasap a Publiko a Lisensia para kadagiti adu pay a salaysay.
'duration-centuries' => '$1 {{PLURAL:$1|siglo|sig-siglo}}',
'duration-millennia' => '$1 {{PLURAL:$1|milenio|mil-milenio}}',
+# Unknown messages
+'mytalk-parenthetical' => 'tungtungan',
);
'duration-centuries' => '$1 {{PLURAL:$1|secolo|secoli}}',
'duration-millennia' => '$1 {{PLURAL:$1|millennio|millenni}}',
+# Unknown messages
+'mytalk-parenthetical' => 'discussioni',
);
この情報は公開されます。',
'email' => 'メール',
'prefs-help-realname' => '本名は省略できます。
-入力すると、あなたの著作物の帰属表記に本名を使用します。',
+入力すると、あなたの著作物の帰属表示に使われます。',
'prefs-help-email' => 'メールアドレスは省略できますが、パスワードを忘れた際にパスワードをリセットするのに必要です。',
'prefs-help-email-others' => '利用者ページやトークページ上のリンクを通じて、他の利用者があなたにメールで連絡を取れるようにすることもできます。
他の利用者が連絡を取る際にあなたのメールアドレスが開示されることはありません。',
# MIME search
'mimesearch' => 'MIMEタイプ検索',
'mimesearch-summary' => 'このページでは、ファイルをMIMEタイプで絞り込みます。
-contenttype/subtypeの形式で入力してください(例:<code>image/jpeg</code>)。',
-'mimetype' => 'MIMEタイプ:',
+contenttype/subtypeの形式で入力してください (例: <code>image/jpeg</code>)。',
+'mimetype' => 'MIMEタイプ:',
'download' => 'ダウンロード',
# Unwatched pages
# Video information, used by Language::formatTimePeriod() to format lengths in the above messages
'video-dims' => '$1、 $2 × $3',
'seconds-abbrev' => '$1 s',
+'minutes-abbrev' => '$1 m',
'hours-abbrev' => '$1 h',
'days-abbrev' => '$1 d',
'seconds' => '{{PLURAL:$1|$1 秒}}',
'newwindow' => '(ახალ ფანჯარაში)',
'cancel' => 'გაუქმება',
'moredotdotdot' => 'ვრცლად...',
-'mypage' => 'á\83©á\83\94á\83\9bá\83\98 á\83\92á\83\95á\83\94á\83 á\83\93á\83\98',
+'mypage' => 'გვერდი',
'mytalk' => 'ჩემი განხილვა',
'anontalk' => 'ამ IP-ს განხილვა',
'navigation' => 'ნავიგაცია',
'duration-centuries' => '$1{{PLURAL:$1|세기}}',
'duration-millennia' => '$1{{PLURAL:$1|천년}}',
+# Unknown messages
+'mytalk-parenthetical' => '토론',
);
'youhavenewmessages' => '$1 yên te hene ($2).',
'newmessageslink' => 'Peyamên nû',
'newmessagesdifflink' => 'cudayî ji guhertoya berê',
+'youhavenewmessagesfromusers' => 'Ji {{PLURAL:$3|bikarhênereke/î din|$3 bikarhêneran}}, ji bo te $1 hene ($2).',
+'newmessageslinkplural' => '{{PLURAL:$1|peyameke nû|peyamên nû}}',
+'newmessagesdifflinkplural' => '{{PLURAL:$1|guherandin|guherandinên dawî}}',
'youhavenewmessagesmulti' => 'Peyamên nû li $1 ji te re hene.',
'editsection' => 'biguherîne',
'editold' => 'biguherîne',
* @author Aidabishkek
* @author Amire80
* @author Chorobek
+ * @author Growingup
* @author Muratjumashev
* @author Ztimur
*/
'tog-editondblclick' => 'Эки басып баракты оңдоо (JavaScript талап кылынат)',
'tog-editsection' => 'Ар бир секция үчүн «оңдоо» шилтемеси',
-'underline-always' => 'Дайым',
+'underline-always' => 'Дайыма',
'underline-never' => 'Эч качан',
# Font style option in Special:Preferences
'and' => ' жана',
# Cologne Blue skin
-'qbfind' => 'Ð\98зде',
+'qbfind' => 'ТабÑ\83Ñ\83',
'qbbrowse' => 'Сереп сал',
'qbedit' => 'Оңдоо',
'qbpageoptions' => 'Бул барак',
# Vector skin
'vector-action-addsection' => 'Тема кошумчала',
-'vector-action-delete' => 'Өчүр',
+'vector-action-delete' => 'Өчүрүү',
'vector-action-move' => 'Аталышын өзгөрт',
-'vector-action-protect' => 'Корго',
+'vector-action-protect' => 'Коргоо',
'vector-action-undelete' => 'Калыбына келтирүү',
'vector-action-unprotect' => 'Коргоону өзгөртүү',
-'vector-view-create' => 'Ð\91аÑ\88Ñ\82а',
-'vector-view-edit' => 'Оңдо',
+'vector-view-create' => 'Ð\96аÑ\80аÑ\82Ñ\83Ñ\83',
+'vector-view-edit' => 'Оңдоо',
'vector-view-history' => 'Тарыхын кара',
-'vector-view-view' => 'Оку',
+'vector-view-view' => 'Окуу',
'vector-view-viewsource' => 'Кайнарын кара',
'actions' => 'Аракеттер',
'namespaces' => 'Аталыш топтому',
'returnto' => '$1 барагына кайт.',
'tagline' => '{{SITENAME}} дан',
'help' => 'Жардам',
-'search' => 'Изде',
-'searchbutton' => 'Изде',
-'go' => 'Таап бер',
+'search' => 'Издөө',
+'searchbutton' => 'Издөө',
+'go' => 'Өтүү',
'searcharticle' => 'Алга',
'history' => 'Барактын тарыхы',
-'history_short' => 'Тарыхы',
+'history_short' => 'Тарых',
'printableversion' => 'Басма үлгүсү',
'permalink' => 'Туруктуу шилтеме',
'print' => 'Басып чыгаруу',
'view' => 'Кароо',
'edit' => 'Оңдоо',
-'create' => 'Ð\91аÑ\88Ñ\82а',
+'create' => 'Ð\96аÑ\80аÑ\82Ñ\83Ñ\83',
'editthispage' => 'Бул баракты оңдо',
'create-this-page' => 'Бул баракты түзүү',
'delete' => 'Өчүрүү',
-'deletethispage' => 'Бул баракты өчүрүп кой',
+'deletethispage' => 'Бул баракты өчүрүү',
'protect' => 'Коргоо',
-'protect_change' => 'өзгөрт',
+'protect_change' => 'өзгөртүү',
'protectthispage' => 'Бул баракты коргоо',
'unprotect' => 'Коргоону өзгөртүү',
'newpage' => 'Жаңы барак',
'articlepage' => 'Макаланы кароо',
'talk' => 'Талкуу',
'views' => 'Көрсөтүүлөр',
-'toolbox' => 'Аспап кутусу',
+'toolbox' => 'Аспаптар',
'userpage' => 'Катышуучунун барагын кароо',
'projectpage' => 'Долбоор барагын кароо',
'imagepage' => 'Файлдын барагын кароо',
'lastmodifiedat' => 'Бул барак соңку жолу $1, $2 өзгөртүлгөн.',
'viewcount' => 'Бул барак {{PLURAL:$1|$1|$1}} жолу ачылды.',
'protectedpage' => 'Корголгон барак',
-'jumpto' => 'Атта:',
+'jumpto' => 'Өтүү:',
'jumptonavigation' => 'багыттоо',
'jumptosearch' => 'издөө',
'disclaimerpage' => 'Project:Жалпы жоопкерчиликтен баш тартуу',
'edithelp' => 'Оңдоого жардам',
'edithelppage' => 'Help:Оңдоо',
-'helppage' => 'Help:Мазмуну',
+'helppage' => 'Help:Мазмун',
'mainpage' => 'Башбарак',
'mainpage-description' => 'Башбарак',
'portal' => 'Жамаат порталы',
'newmessageslink' => 'жаңы билдирүүлөр',
'newmessagesdifflink' => 'соңку өзгөрүү',
'youhavenewmessagesmulti' => 'Сизге $1 жаңы кат бар.',
-'editsection' => 'оңдо',
-'editold' => 'оңдо',
+'editsection' => 'оңдоо',
+'editold' => 'оңдоо',
'viewsourceold' => 'байкоо',
-'editlink' => 'оңдо',
+'editlink' => 'оңдоо',
'viewsourcelink' => 'Байкоо',
-'editsectionhint' => '$1 бөлүмүн оңдо',
-'toc' => 'Мазмуну',
-'showtoc' => 'Ð\9aÓ©Ñ\80Ñ\81Ó©Ñ\82',
-'hidetoc' => 'Жашыр',
+'editsectionhint' => '$1 бөлүмүн оңдоо',
+'toc' => 'Мазмун',
+'showtoc' => 'көÑ\80Ñ\81Ó©Ñ\82Ò¯Ò¯',
+'hidetoc' => 'Жашыруу',
'site-rss-feed' => '$1 RSS тилкеси',
'site-atom-feed' => '$1 Atom агымы',
'page-atom-feed' => '"$1" Atom агымы',
# Short words for each namespace, by default used in the namespace tab in monobook
'nstab-main' => 'Макала',
'nstab-user' => 'Колдонуучунун барагы',
+'nstab-media' => 'Мультимедиа',
'nstab-special' => 'Атайын барак',
'nstab-project' => 'Долбоордун барагы',
'nstab-image' => 'Файл',
-'nstab-mediawiki' => 'Билдирүү',
-'nstab-template' => 'Ð\9aалÑ\8bп',
+'nstab-mediawiki' => 'Билдирме',
+'nstab-template' => 'Шаблон',
'nstab-help' => 'Жардам',
'nstab-category' => 'Категория',
# General errors
-'error' => 'Ð\96аңÑ\8bлÑ\8bÑ\88',
+'error' => 'Ð\9aаÑ\82а',
'missing-article' => 'Табылууга тийиш «$1» $2 деп аталган баракта текст маалыматтар базасында табылган жок.
Бул сыяктуу абал өчүрүлгөн барактын өзгөрүүлөрдүн тарыхына эски шилтеме менен өткөндө учурайт.
'filecopyerror' => '"$1" файлы "$2" файлына көчүрүлбөдү.',
'filedeleteerror' => '"$1" файлын өчүрүүгө болбоду.',
'directorycreateerror' => '"$1" каталогун түзүүгө болбоду.',
-'filenotfound' => '"$1" файлы табылбады.',
+'filenotfound' => '"$1" файлын табууга мүмкүн эмес.',
'fileexistserror' => '"$1" файлына жазууга болбоду: Мурдатан бар.',
'unexpected' => 'Күтүлбөгөн маани: "$1"="$2".',
'formerror' => 'Ката: Форманы жөнөтүүгө болбоду.',
'badtitle' => 'Ыксыз аталыш',
'badtitletext' => 'Талап кылынган барак аталышы туура эмес, бош, же тилдер-аралык же уики-аралык аталышы туура эмес шилтемеленген.
Балким аталышта колдонулбай турган бир же андан көп белги камтылган.',
-'viewsource' => 'Кайнарын кара',
+'viewsource' => 'Кароо',
# Login and logout pages
'welcomecreation' => '== Кош келиңиз, $1! ==
'logout' => 'Чыгуу',
'userlogout' => 'Чыгуу',
'notloggedin' => 'Сиз системага кире элексиз',
-'nologin' => 'Ð\9aаÑ\82Ñ\82ала элексизби? $1.',
+'nologin' => 'Ð\9aаÑ\82Ñ\82ай элексизби? $1.',
'nologinlink' => 'Каттоону башта',
-'createaccount' => 'Ð\96аңÑ\8b колдонÑ\83Ñ\83Ñ\87Ñ\83нÑ\83 каÑ\82Ñ\82а',
+'createaccount' => 'ÐÑ\81еп жазÑ\83Ñ\83Ñ\81Ñ\83н жаÑ\80аÑ\82Ñ\83Ñ\83',
'gotaccount' => 'Катталгансызбы? $1.',
'gotaccountlink' => 'Кирүү',
'userlogin-resetlink' => 'Кирүүчү маалыматарыңызды унутуп калдыңызбы?',
'loginsuccesstitle' => 'Сиз ийгиликтүү кирдиңиз',
'wrongpassword' => 'Ката сырсөз киргизилди. Кайтадан аракет кылып көрүңүз.',
'wrongpasswordempty' => 'Сырсөз киргизилген жок. Кайтадан аракет кылып көрүңүз.',
-'mailmypassword' => 'Жаңы сырсөздү электрондук дарекке жибер',
+'mailmypassword' => 'Жаңы сырсөздү e-mail аркылуу жиберүү',
'emailconfirmlink' => 'Электрондук дарегиңизди ырастаңыз',
-'accountcreated' => 'Ð\9aаÑ\82Ñ\82алды',
+'accountcreated' => 'ÐÑ\81еп жазÑ\83Ñ\83Ñ\81Ñ\83 жаÑ\80аÑ\82Ñ\8bлды',
'loginlanguagelabel' => 'Тил: $1',
# Change password dialog
'oldpassword' => 'Эски сырсөз:',
'newpassword' => 'Жаңы сырсөз:',
+# Special:PasswordReset
+'passwordreset-emailelement' => 'Колдонуучу аты: $1
+Убактылуу сырсөз: $2',
+
+# Special:ChangeEmail
+'changeemail' => 'E-mail даректи өзгөртүү',
+'changeemail-oldemail' => 'Кезектеги e-mail дарек:',
+'changeemail-newemail' => 'Жаңы e-mail дарек:',
+'changeemail-none' => '(жок)',
+'changeemail-submit' => "E-mail'ди өзгөртүү",
+'changeemail-cancel' => 'Айнуу',
+
# Edit page toolbar
-'bold_sample' => 'Калың тамга',
-'bold_tip' => 'Калың тамга',
-'italic_sample' => 'Ð\96анÑ\82Ñ\8bк Ñ\82амга',
-'italic_tip' => 'Ð\96анÑ\82Ñ\8bк Ñ\82амга',
-'link_sample' => 'Шилтеменин аталышы',
+'bold_sample' => 'Кара текст',
+'bold_tip' => 'Кара текст',
+'italic_sample' => 'Ð\9aÑ\83Ñ\80Ñ\81ив Ñ\82екÑ\81Ñ\82',
+'italic_tip' => 'Ð\9aÑ\83Ñ\80Ñ\81ив Ñ\82екÑ\81Ñ\82',
+'link_sample' => 'Шилтеме аты',
'link_tip' => 'Ички шилтеме',
'extlink_sample' => 'http://www.example.com шилтеме аталышы',
'extlink_tip' => 'Сырткы шилтемелерге (http:// префиксин койгонду унутпаңыз)',
-'headline_sample' => 'Аталыштын тексти',
+'headline_sample' => 'Ат тексти',
'headline_tip' => '2-деңгээлдеги баш аты',
'nowiki_sample' => 'Форматталбаган текстти бул жерге киргизиңиз',
'nowiki_tip' => 'Уики-форматтоого көңүл бөлбө',
# Edit pages
'summary' => 'Кыска түшүндүрүү:',
'minoredit' => 'Майда оңдоо',
-'watchthis' => 'Бул баракты көзөмөлдө',
-'savearticle' => 'Ð\91аÑ\80акÑ\82Ñ\8b Ñ\81акÑ\82ап кой',
+'watchthis' => 'Бул баракты көзөмөлдөө',
+'savearticle' => 'Ð\91аÑ\80акÑ\82Ñ\8b Ñ\81акÑ\82оо',
'preview' => 'Алдын ала көрүү',
-'showpreview' => 'Алдын ала көрсөт',
+'showpreview' => 'Алдын ала көрсөтүү',
'showlivepreview' => 'Ылдам карап чыгуу',
-'showdiff' => 'Өзгөртүүлөрдү көрсөт',
+'showdiff' => 'Өзгөртүүлөрдү көрсөтүү',
'anoneditwarning' => "'''Эскертүү:''' Сиз каттоодон өткөн жоксуз.
IP дарегиңиз бул барактын оңдоо тарыхына жазылат.",
'blockedtext' => 'Сиздин колдонуучу атыңыз же IP дарегиңиз тосмолонгон',
-'blockednoreason' => 'себеби көрсөтүлгөн эмес',
+'blockednoreason' => 'себеби көрсөтүлгөн жок',
'loginreqtitle' => 'Колдонуучунун аты талап кылынат',
'loginreqlink' => 'Кирүү',
'accmailtitle' => 'Сырсөз жөнөтүлдү.',
Сиз башка барактардан [[Special:Search/{{PAGENAME}}|ушул аталыш менен баракты издөө]] салып,
же <span class="plainlinks">[{{fullurl:{{#Special:Log}}|page={{FULLPAGENAMEE}}}} тийиштүү жазууларды таба аласыз]</span>.',
'userpage-userdoesnotexist' => '"$1" Мындай колдонуучу катталган эмес. Ушул баракты түзүүнү же оңдогонду каалганыңыз анык болсун',
+'updated' => '(Жаңыртылды)',
'previewnote' => "'''Бул алдын ала көрүнүшү гана болгонун эсиңизге алыңыз.'''
Өзгөртүүлөрүңүз сактала элек!",
'continue-editing' => 'Өзгөртүүүлөрдү улантабыз',
'edit-conflict' => 'Өзгөртүүлөрдүн конфликти',
'edit-already-exists' => 'Жаңы барак түзүү мүмкүн эмес. Мындай барак бар',
+# Content models
+'content-model-javascript' => 'JavaScript',
+'content-model-css' => 'CSS',
+
# Parser/template warnings
'post-expand-template-inclusion-warning' => "'''Эскертүү:''' Камтылган калыптардын өлчөмү өтө чоң.
Кээ бир калыптар камтылбайт.",
'parser-template-loop-warning' => 'Калыптарда айланма бар:[[$1]]',
# History pages
-'viewpagelogs' => 'Бул барак үчүн тизмелерди кара',
+'viewpagelogs' => 'Бул барак үчүн журналды көрсөтүү',
'nohistory' => 'Бул барактын өзгөртүүлөр тарыхы жок',
'currentrev' => 'Акыркы версиясы',
'currentrev-asof' => '$1 -га соңку версиясы',
'page_last' => 'акыркы',
'histlegend' => "Айырмаларды тандоо: Салыштырыла турган версияларлын тушундагы тегеректерди белгилеп туруп \"Enter\"-ди же астындагы баскычты бас.<br />
Түшүндүрүү: '''({{int:cur}})''' = соңку версиясынан айырма, '''({{int:last}})''' = мурунку версиясынан айырма, '''{{int:minoreditletter}}''' = майда оңдоо.",
-'history-fieldset-title' => 'ТаÑ\80Ñ\8bÑ\85Ñ\8bн каÑ\80а',
+'history-fieldset-title' => 'ТаÑ\80Ñ\8bÑ\85Ñ\8bн каÑ\80оо',
'history-show-deleted' => 'Өчүрүлгөндөрдү гана',
'histfirst' => 'Эң эски',
'histlast' => 'Соңку',
'revdel-restore' => 'көрүнүшүн өзгөрт',
'revdel-restore-deleted' => 'өчүрүлгөн версиялар',
'revdel-restore-visible' => 'көрүнүүчү версиялары',
+'revdelete-reasonotherlist' => 'Башка себеп',
+'revdelete-offender' => 'Барак версиясынын автору:',
+
+# History merging
+'mergehistory-from' => 'Баштапкы барак:',
+'mergehistory-submit' => 'Версияларды бириктирүү',
+'mergehistory-reason' => 'Себеп',
# Merge log
-'revertmerge' => 'Бөл',
+'revertmerge' => 'Бөлүү',
# Diffs
'history-title' => '"$1" өзгөрүүлөр тарыхы',
'lineno' => '$1 -сап:',
-'compareselectedversions' => 'Тандалган версияларды салыштыр',
-'editundo' => 'жокко чыгар',
+'compareselectedversions' => 'Тандалган версияларды салыштыруу',
+'editundo' => 'жокко чыгаруу',
'diff-multi' => '({{PLURAL:$2|колдонуучу|$2 колдонуучу}} тарабынан жасалган {{PLURAL:$1|аралык версия|$1 аралык версия}} көрсөтүлгөн жок)',
# Search results
'searchresults-title' => '"$1" үчүн издөө жыйынтыктары',
'prevn' => 'мурунку {{PLURAL:$1|$1}}',
'nextn' => 'кийинки{{PLURAL:$1|$1}}',
-'prevn-title' => 'Мурунку $1 {{PLURAL:$1|жыйынтык|жыйынтык}}',
-'nextn-title' => 'Кийинки $1 {{PLURAL:$1|жыйынтык|жыйынтык}}',
-'shown-title' => 'Бир баракка $1 {{PLURAL:$1|жыйынтык|жыйынтык}} көрсөт',
-'viewprevnext' => '($1 {{int:pipe-separator}} $2) ($3) кара',
+'prevn-title' => 'Мурунку $1 {{PLURAL:$1|жыйынтык}}',
+'nextn-title' => 'Кийинки $1 {{PLURAL:$1|жыйынтык}}',
+'shown-title' => 'Барактан $1 {{PLURAL:$1|жыйынтыкты}} көрсөтүү',
+'viewprevnext' => '($1 {{int:pipe-separator}} $2) ($3) кароо',
+'searchmenu-legend' => 'Издөө опциялары',
'searchmenu-exists' => "'''Бул Уикиде \"[[:\$1]]\" деп аталган барак бар.'''",
'searchmenu-new' => "'''Бул Уикиде \"[[:\$1]]\" барагын түз!'''",
+'searchhelp-url' => 'Help:Мазмун',
'searchprofile-articles' => 'Негизги барактар',
-'searchprofile-project' => 'Ð\96аÑ\80дам жана Ð\94олбоор барактары',
+'searchprofile-project' => 'Ð\96аÑ\80дам жана долбоор барактары',
'searchprofile-images' => 'Мултимедиа',
'searchprofile-everything' => 'Баары',
'searchprofile-advanced' => 'Кеңейтилген',
-'searchprofile-articles-tooltip' => '$1 -де изде',
-'searchprofile-project-tooltip' => '$1 -де изде',
-'searchprofile-images-tooltip' => 'Файлдарды изде',
+'searchprofile-articles-tooltip' => '$1 -де издөө',
+'searchprofile-project-tooltip' => '$1 -де издөө',
+'searchprofile-images-tooltip' => 'Файлдарды издөө',
'searchprofile-everything-tooltip' => 'Бардык барактарда (талкуу барактарды кошо) изде',
'searchprofile-advanced-tooltip' => 'Белгиленген аталыш топтомдорунда изде',
'search-result-size' => '$1 ({{PLURAL:$2|1 сөз|$2 сөз}})',
'showingresultsheader' => "'''$4''' үчүн {{PLURAL:$5|'''$3''' жыйынтыктан '''$1'''-и|'''$1 - $2''' -дан '''$3''' жыйынтык}}",
'search-nonefound' => 'Талапка төп маалымат табылган жок.',
'powersearch' => 'Издөө',
-'powersearch-legend' => 'Кеңиртип изде',
+'powersearch-legend' => 'Кеңейтилген издөө',
+
+# Quickbar
+'qbsettings-none' => 'Көрсөтпөө',
# Preferences page
'preferences' => 'Ыңгайлаштыруу',
'changepassword' => 'Сырсөздү өзгөртүү',
'prefs-datetime' => 'Дата жана убакыт',
'prefs-rc' => 'Соңку өзгөрүүлөр',
-'prefs-watchlist' => 'Байкоо тизме',
-'saveprefs' => 'СакÑ\82ап кой',
+'prefs-watchlist' => 'Байкоо тизмеси',
+'saveprefs' => 'СакÑ\82оо',
'prefs-editing' => 'Оңдоо',
'searchresultshead' => 'Издөө',
'localtime' => 'Жергиликтүү убакыт',
+'servertime' => 'Сервер убагы:',
+'timezoneregion-africa' => 'Африка',
+'timezoneregion-america' => 'Америка',
+'timezoneregion-antarctica' => 'Антарктика',
+'timezoneregion-arctic' => 'Арктика',
+'timezoneregion-asia' => 'Азия',
+'timezoneregion-atlantic' => 'Атлантика океаны',
+'timezoneregion-australia' => 'Австралия',
+'timezoneregion-europe' => 'Европа',
+'timezoneregion-indian' => 'Индий океаны',
+'timezoneregion-pacific' => 'Тынч океаны',
+'prefs-searchoptions' => 'Издөө',
+'default' => 'жарыяланбасча',
'prefs-files' => 'Файлдар',
'youremail' => 'Электрондук дарек:',
'username' => 'Колдонуучунун аты:',
'yourlanguage' => 'Тил:',
'yourvariant' => 'Вариант:',
'yournick' => 'Такма атыңыз:',
+'yourgender' => 'Жыныс:',
+'gender-male' => 'Эркек',
+'gender-female' => 'Аял',
+'email' => 'Электрондук дарек',
'prefs-help-email' => 'Электрондук дарек милдетүү эмес, бирок сырсөздү унутуп калсаңыз ал сырсөздү жиберүүгө керек.',
'prefs-help-email-others' => 'Ошондой эле башкалар сиз менен колдонуучу же талкуу барактарыңыздагы шилтеме аркылуу байланыш түзүүгө уруксат берүүнү тандай аласыз.
Электрондук дарегиңиз башка кодонуучуларга байланыш түзгөндө көрүнбөйт.',
+'prefs-info' => 'Негизги маалыматтары',
'prefs-advancedediting' => 'Кеңейтилген',
'prefs-advancedrc' => 'Кеңейтилген',
'prefs-advancedrendering' => 'Кеңейтилген',
'prefs-advancedwatchlist' => 'Кеңейтилген',
'prefs-displayrc' => 'Көрсөтүүнү тууралоо',
+# User rights
+'userrights-reason' => 'Себеп:',
+
# Groups
'group' => 'Топ:',
+'group-user' => 'Катышуучулар',
+'group-sysop' => 'Администраторлор',
'group-bureaucrat' => 'Бюрократтар',
'group-bureaucrat-member' => 'Бюрократ',
# Associated actions - in the sentence "You do not have permission to X"
-'action-edit' => 'бул баракты оңдо',
+'action-edit' => 'бул баракты оңдоо',
# Recent changes
'nchanges' => '$1 {{PLURAL:$1|өзгөрүү|өзгөрүү}}',
'recentchanges-label-unpatrolled' => 'Бул оңдоо көзөмөлдөн өтө элек.',
'rcnote' => "Ылдый жакта $5, $4 карата соңку {{PLURAL:$2|күндө|'''$2''' күндө}} жасалган {{PLURAL:$1| '''1''' өзгөрүү| '''$1''' өзгөрүү}}.",
'rcnotefrom' => "'''$2''' -тан өзгөрүүлөр ылдый жакта ('''$1''' чейин көрсөтүлдү).",
-'rclistfrom' => '$1 күнүнөн баштап жаңы өзгөртүүлөрдү көрсөт',
+'rclistfrom' => '$1 күнүнөн баштап жаңы өзгөртүүлөрдү көрсөтүү',
'rcshowhideminor' => 'Майда оңдоолорду $1',
'rcshowhidebots' => 'ботторду $1',
'rcshowhideliu' => '$1 катталган колдонуучу',
'rcshowhideanons' => 'Жашыруун колдонуучулар $1',
'rcshowhidepatr' => 'Көзөмөл алдындагы оңдоолорду $1',
'rcshowhidemine' => 'Оңдоолорумду $1',
-'rclinks' => 'Соңку $2 кундө жасалган акыркы $1 өзгөртүүлөрдү көрсөт<br />$3',
+'rclinks' => 'Соңку $2 күндө жасалган акыркы $1 өзгөртүүлөрдү көрсөтүү<br />$3',
'diff' => 'айырма',
-'hist' => 'тарыхы',
-'hide' => 'Жашыр',
-'show' => 'Көрсөт',
+'hist' => 'тарых',
+'hide' => 'Жашыруу',
+'show' => 'Көрсөтүү',
'minoreditletter' => 'м',
'newpageletter' => 'Ж',
'boteditletter' => 'б',
-'rc-enhanced-expand' => 'Ð\91өлүкÑ\82Ó©Ñ\80үн көÑ\80Ñ\81Ó©Ñ\82 (JavaScript талап кылынат)',
-'rc-enhanced-hide' => 'Ð\91өлүкÑ\82Ó©Ñ\80үн жаÑ\88Ñ\8bÑ\80',
+'rc-enhanced-expand' => 'Ð\9aоÑ\88Ñ\83мÑ\87а маалÑ\8bмаÑ\82Ñ\82аÑ\80дÑ\8b көÑ\80Ñ\81Ó©Ñ\82Ò¯Ò¯ (JavaScript талап кылынат)',
+'rc-enhanced-hide' => 'Ð\9aоÑ\88Ñ\83мÑ\87а маалÑ\8bмаÑ\82Ñ\82аÑ\80дÑ\8b жаÑ\88Ñ\8bÑ\80Ñ\83Ñ\83',
# Recent changes linked
'recentchangeslinked' => 'Тиешелүү өзгөрүүлөр',
'recentchangeslinked-summary' => 'Бул көрсөтүлгөн (же көрсөтүлгөн категорияга кирген) барактан шилтемеленген барактардагы жакын арада жасалган өзгөрүүлөрдүн тизмеси.
[[Special:Watchlist|Байкоо тизмеңиз]]деги барактар калын арип менен белгиленген.',
'recentchangeslinked-page' => 'Барактын аталышы',
-'recentchangeslinked-to' => 'Белгиленген барактан шилтемеленген барактардын ордуна өзгөртүулөрдү көрсөт',
+'recentchangeslinked-to' => 'Белгиленген барактан шилтемеленген барактардын ордуна өзгөртүулөрдү көрсөтүү',
# Upload
-'upload' => 'Файл жүктөө',
-'uploadbtn' => 'Файл жүктөө',
+'upload' => 'Файлды жүктөө',
+'uploadbtn' => 'Файлды жүктөө',
+'uploaderror' => 'Жүктөө катасы',
'uploadlogpage' => 'Жүктөөлөрдүн тизмеси',
'filedesc' => 'Кыска түшүндүрмө',
'fileuploadsummary' => 'Кыска түшүндүрмө:',
'sharedupload-desc-here' => 'Бул файл $1 -дан жана башка долбоорлордо пайдаланылышы мүмкүн.
Төмөндө анын [$2 файлды сыпаттоо барагы]нан сыпаттамасы көрсөтүлгөн.',
+# File reversion
+'filerevert-comment' => 'Себеп:',
+
+# File deletion
+'filedelete-legend' => 'Файлды өчүрүү',
+'filedelete-comment' => 'Себеп:',
+'filedelete-submit' => 'Өчүрүү',
+
# Unused templates
'unusedtemplates' => 'Колдонулбаган нускалар',
'unusedtemplateswlh' => 'Башка шилтемелер',
# Statistics
'statistics' => 'Статистика',
'statistics-header-users' => 'Колдонуучулардын статистикасы',
+'statistics-pages' => 'Барак',
'disambiguationspage' => 'Template:көп маанилүү',
+'brokenredirects-delete' => 'өчүрүү',
+
+'withoutinterwiki-submit' => 'Көрсөтүү',
+
# Miscellaneous special pages
'nbytes' => '$1 {{PLURAL:$1|байт|байт}}',
'nmembers' => '$1{{PLURAL:$1|мүчө|мүчө}}',
'unusedcategories' => 'Колдонулбаган категориялар',
'unusedimages' => 'Колдонулбаган файлдар',
+'popularpages' => 'Популярдуу барактар',
'prefixindex' => 'Префикс менен бардык барактар',
'shortpages' => 'Кыска макалалар',
'listusers' => 'Колдонуучулар тизмеси',
'booksources-go' => 'Алга',
# Special:Log
-'specialloguserlabel' => 'Ð\9aолдонуучу:',
+'specialloguserlabel' => 'Ð\90Ñ\82каÑ\80уучу:',
'speciallogtitlelabel' => 'Аталышы:',
'log' => 'Тизмелер',
'allpages' => 'Бардык барактар',
'alphaindexline' => '$1 -дан $2 чейин',
'nextpage' => 'Кийинки барак ($1)',
-'allpagesfrom' => '-дан башталган барактарды көрсөт:',
+'allpagesfrom' => '-дан башталган барактарды көрсөтүү:',
'allarticles' => 'Бардык макалалар',
-'allpagesprev' => 'Ð\9cÑ\83Ñ\80Ñ\83нкÑ\83',
+'allpagesprev' => 'Ð\90балкÑ\8b',
'allpagesnext' => 'Кийинки',
'allpagessubmit' => 'Алга',
-'allpagesprefix' => '- префикси менен барактарды көрсөт',
+'allpagesprefix' => '- префикси менен барактарды көрсөтүү',
# Special:Categories
'categories' => 'Категориялар',
# Special:LinkSearch
+'linksearch-ok' => 'Издөө',
'linksearch-line' => '$1-га $2-дан шилтеме берилди',
+# Special:ListUsers
+'listusers-submit' => 'Көрсөтүү',
+
# Special:Log/newusers
'newuserlogpage' => 'Жаңы колдонуучулардын тизмеси',
'listgrouprights-members' => '(мүчөлөрдүн тизмеси)',
# E-mail user
-'emailuser' => 'Бул колдонуучуга кат жибер',
+'emailuser' => 'Бул колдонуучуга кат жиберүү',
'emailfrom' => '- дан',
-'emailmessage' => 'Кат',
+'emailto' => 'Кимге:',
+'emailsubject' => 'Тема:',
+'emailmessage' => 'Билдирме',
# Watchlist
'watchlist' => 'Көзөмөл тизмем',
'mywatchlist' => 'Көзөмөл тизмем',
'watchlistfor2' => '$1 үчүн $2',
'watchnologin' => 'Катталган жок',
-'watch' => 'Көзөмөлдө',
-'unwatch' => 'Көзөлдөбө',
+'watch' => 'Көзөмөлдөө',
+'unwatch' => 'Көзөлдөбөө',
'watchlist-details' => 'Талкуу барактарын эсепке албаганда көзөмөл тизмеңизде {{PLURAL:$1|$1 барак|$1 барак}} бар.',
'watchlistcontains' => 'Байкоо тизмеңизде $1 {{PLURAL:$1|барак бар|барак бар}}.',
-'wlshowlast' => 'Соңку $1 саат $2 күн $3 көрсөт.',
+'wlshowlast' => 'Соңку $1 саат $2 күн $3 көрсөтүү.',
'watchlist-options' => 'Көзөмөл тизменин ырастоолору',
'changed' => 'өзгөртүлдү',
'created' => 'түзүлдү',
# Delete
-'deletepage' => 'Баракты өчүрүп кой',
+'deletepage' => 'Баракты өчүрүү',
'confirm' => 'Ырастоо',
'actioncomplete' => 'Иш-аракет жыйынтыкталды',
'actionfailed' => 'Аракет натыйжасыз болду',
'deletecomment' => 'Себеп',
# Rollback
-'rollbacklink' => 'кайтар',
+'rollbacklink' => 'кайтаруу',
# Protect
'protectlogpage' => 'Коргоо тизмеси',
'protectedarticle' => '"[[$1]]" корголгон',
+'restriction-type' => 'Укуктар:',
# Restrictions (nouns)
'restriction-edit' => 'Оңдоо',
+'restriction-create' => 'Жаратуу',
+'restriction-upload' => 'Жүктөө',
# Undelete
-'undeletebtn' => 'Калыбына келтир',
-'undeletelink' => 'көрсөт/калыбына келтир',
-'undeleteviewlink' => 'көрсөт',
-'undeletecomment' => 'Түшүндүрмө:',
+'undeletebtn' => 'Калыбына келтирүү',
+'undeletelink' => 'кароо/калыбына келтирүү',
+'undeleteviewlink' => 'кароо',
+'undeletereset' => 'Түшүрүү',
+'undeletecomment' => 'Себеп:',
+'undelete-search-submit' => 'Издөө',
# Namespace form on various pages
'namespace' => 'Аталыштар мейкиндиги:',
-'invert' => 'Белгиленгенди кайтар',
+'invert' => 'Белгиленгенди текскерилетүү',
'blanknamespace' => '(Негизги)',
# Contributions
'sp-contributions-uploads' => 'жүктөөлөр',
'sp-contributions-logs' => 'тизме',
'sp-contributions-talk' => 'талкуу',
-'sp-contributions-search' => 'СалÑ\8bмдаÑ\80Ñ\8bн изде',
+'sp-contributions-search' => 'СалÑ\8bмдаÑ\80Ñ\8bмдÑ\8b издөө',
'sp-contributions-username' => 'IP дареги же колдонуучунун аты:',
'sp-contributions-toponly' => 'Соңку версиялары болгон оңдоолорду гана көрсөт',
-'sp-contributions-submit' => 'Изде',
+'sp-contributions-submit' => 'Издөө',
# What links here
'whatlinkshere' => 'Жетелеме шилтемелер',
'linkshere' => "'''[[:$1]]''' барагына шилтеме берген барактар:",
'nolinkshere' => "'''[[:$1]]''' барагына шилтеме берген барак жок.",
'isredirect' => 'кайра багыттоо барагы',
-'istemplate' => 'кошкуч',
+'istemplate' => 'кошуу',
'isimage' => 'файл шилтемеси',
'whatlinkshere-prev' => '{{PLURAL:$1|мурунку|мурунку $1}}',
'whatlinkshere-next' => '{{PLURAL:$1|кийинки|кийинки $1}}',
'whatlinkshere-links' => '← шилтемелер',
'whatlinkshere-hideredirs' => 'Багыттоолорду $1',
-'whatlinkshere-hidetrans' => 'Кошкучтарды $1',
+'whatlinkshere-hidetrans' => '$1 кошуулары',
'whatlinkshere-hidelinks' => 'Шилтемелерди $1',
'whatlinkshere-hideimages' => 'Сүрөт шилтемелерин $1',
'whatlinkshere-filters' => 'Чыпкалар',
'ipboptions' => '2 саат:2 hours,1 күн:1 day,3 күн:3 days,1 жума:1 week,2 жума:2 weeks,1 ай:1 month,3 ай:3 months,6 ай:6 months,1 жыл:1 year,мөөнөтсүз:infinite',
'ipbotheroption' => 'башка',
'ipblocklist' => 'Тосмолонгон колдонуучулар',
-'blocklink' => 'тосмоло',
-'unblocklink' => 'тосмолоону алып сал',
-'change-blocklink' => 'тосмолоону өзгөрт',
-'contribslink' => 'салымдары',
+'blocklist-reason' => 'Себеп',
+'ipblocklist-submit' => 'Издөө',
+'blocklink' => 'тосмолоо',
+'unblocklink' => 'тосмолоону алуу',
+'change-blocklink' => 'тосмолоону өзгөртүү',
+'contribslink' => 'салым',
+'emaillink' => 'кат жиберүү',
'blocklogpage' => 'Тосмоолордун тизмеси',
'blocklogentry' => '[[$1]] тосмолонду, тосмолоо мөөнөтү: $2 $3',
'block-log-flags-nocreate' => 'Каттоо мүмкүн эмес',
# Move page
'movelogpage' => 'Өзгөртүлгөн аталыштардын тизмеси',
'movereason' => 'Себеп',
-'revertmove' => 'кайÑ\82аÑ\80Ñ\8bп ал',
-'delete_and_move_confirm' => 'Ооба, бул баракты өчүр',
+'revertmove' => 'кайÑ\82аÑ\80Ñ\83Ñ\83',
+'delete_and_move_confirm' => 'Ооба, бул баракты өчүрөм',
# Export
-'export' => 'Барактарды чыгар',
+'export' => 'Барактарды экспорттоо',
+'export-addcat' => 'Кошуу',
+'export-addns' => 'Кошуу',
# Namespace 8 related
'allmessages' => 'Система билдирүүлөрү',
'allmessages-filter-submit' => 'Алга',
# Thumbnails
-'thumbnail-more' => 'Чоңойт',
+'thumbnail-more' => 'Чоңойтуу',
'thumbnail_error' => 'Кичирейтилген сүрөттү түзүүдө ката: $1',
+# Special:Import
+'import-interwiki-submit' => 'Импорттоо',
+
# Tooltip help for the actions
-'tooltip-pt-userpage' => 'Ð\9aолдонуучу барагыңыз',
-'tooltip-pt-mytalk' => 'Талкуу барагыңыз',
+'tooltip-pt-userpage' => 'Ð\9aаÑ\82Ñ\8bÑ\88уучу барагыңыз',
+'tooltip-pt-mytalk' => 'Талкуулоо барагыңыз',
'tooltip-pt-preferences' => 'Ырастоолоруңуз',
'tooltip-pt-watchlist' => 'Өзгөрүүлөрүн көзөмөлгө алган барактардын тизмеси',
'tooltip-pt-mycontris' => 'Салымдарыңыздын тизмеси',
'tooltip-pt-logout' => 'Чыгуу',
'tooltip-ca-talk' => 'Барактын мазмуну боюнча талкуу',
'tooltip-ca-edit' => 'Сиз бул баракты оңдой аласыз. Кичи пейилдикке, сактоодон мурда алдын ала көрсөтүү нукуурун колдонуңуз.',
-'tooltip-ca-addsection' => 'Жаңы бөлүм башта',
+'tooltip-ca-addsection' => 'Жаңы бөлүмдү баштөө',
'tooltip-ca-viewsource' => 'Бул барак корголгон.
Сиз анын кайнарын көрө аласыз',
'tooltip-ca-history' => 'Бул барактын мурунку оңдоолору',
-'tooltip-ca-protect' => 'Бул баракты корго',
-'tooltip-ca-delete' => 'Бул баракты өчүр',
-'tooltip-ca-move' => 'Барак аталышын өзгөрт',
+'tooltip-ca-protect' => 'Бул баракты коргоо',
+'tooltip-ca-delete' => 'Бул баракты өчүрүү',
+'tooltip-ca-move' => 'Баракты көчүрүү',
'tooltip-ca-watch' => 'Бул баракты көзөмөл тизмеңизге кошуңуз',
'tooltip-ca-unwatch' => 'Бул баракты көзөмөл тизмеңизден алып салыңыз',
-'tooltip-search' => '{{SITENAME}} изде',
-'tooltip-search-go' => 'Так ушундай аталыштагы баракты көрсөт',
-'tooltip-search-fulltext' => 'Ушул текст менен барактарды изде',
-'tooltip-p-logo' => 'Башбаракка кайрыл',
-'tooltip-n-mainpage' => 'Башбаракка кайрыл',
-'tooltip-n-mainpage-description' => 'Башбаракка кайрыл',
-'tooltip-n-portal' => 'Ð\94олбооÑ\80 Ñ\82Ñ\83Ñ\83Ñ\80алÑ\83Ñ\83, Ñ\8dмне жаÑ\81ай алаÑ\81Ñ\8bз, кайÑ\81Ñ\8b жеÑ\80де Ñ\82абÑ\8bлаÑ\82',
-'tooltip-n-currentevents' => 'УÑ\87Ñ\83Ñ\80дагÑ\8b окÑ\83Ñ\8fлаÑ\80 Ñ\82Ñ\83Ñ\83Ñ\80алÑ\83Ñ\83 коÑ\88Ñ\83мÑ\87а маалÑ\8bмаÑ\82 Ñ\82ап',
+'tooltip-search' => '{{SITENAME}} издөө',
+'tooltip-search-go' => 'Так ушундай аталыштагы баракты көрсөтүү',
+'tooltip-search-fulltext' => 'Ушул текст менен барактарды издөө',
+'tooltip-p-logo' => 'Башбаракка өтүү',
+'tooltip-n-mainpage' => 'Башбаракка өтүү',
+'tooltip-n-mainpage-description' => 'Башбаракка өтүү',
+'tooltip-n-portal' => 'Ð\94олбооÑ\80 Ñ\82Ñ\83Ñ\83Ñ\80алÑ\83Ñ\83, Ñ\8dмне жаÑ\81ай алаÑ\81Ñ\8bз, кайÑ\81Ñ\8b жеÑ\80де Ñ\8dмне баÑ\80 жөнүндө',
+'tooltip-n-currentevents' => 'УÑ\87Ñ\83Ñ\80дагÑ\8b окÑ\83Ñ\8fлаÑ\80 Ñ\82Ñ\83Ñ\83Ñ\80алÑ\83Ñ\83 коÑ\88Ñ\83мÑ\87а маалÑ\8bмаÑ\82 Ñ\82абÑ\83Ñ\83',
'tooltip-n-recentchanges' => 'Уикидеги соңку өзгөртүүлөрдүн тизмеси',
-'tooltip-n-randompage' => 'ТÑ\83Ñ\88 келди баÑ\80акÑ\82Ñ\8b жүкÑ\82Ó©',
+'tooltip-n-randompage' => 'Ð\98Ñ\80еÑ\82Ñ\81из Ñ\82Ò¯Ñ\80дө биÑ\80 баÑ\80акÑ\82Ñ\8b аÑ\87Ñ\83Ñ\83',
'tooltip-n-help' => 'Маалымат алуу үчүн',
'tooltip-t-whatlinkshere' => 'Ушул жерге шилтемеси бар бардык уики барактардын тизмеси',
'tooltip-t-recentchangeslinked' => 'Бул барактан шилтеме берилген барактардагы соңку өзгөрүүлөр',
'tooltip-feed-atom' => 'Бул барак үчүн Atom агымы',
'tooltip-t-contributions' => 'Бул колдонуучунун салымдарынын тизмеси',
-'tooltip-t-emailuser' => 'Бул колдонуучуга кат жибер',
-'tooltip-t-upload' => 'Файлдарды жүктө',
+'tooltip-t-emailuser' => 'Бул колдонуучуга кат жиберүү',
+'tooltip-t-upload' => 'Файлдарды жүктөө',
'tooltip-t-specialpages' => 'Бардык атайын барактардын тизмеси',
'tooltip-t-print' => 'Бул барактын басып чыгарууга ылайыктуу түрү',
'tooltip-t-permalink' => 'Барактын бул версиясына туруктуу шилтеме',
-'tooltip-ca-nstab-main' => 'Ð\91аÑ\80акÑ\82Ñ\8bн мазмÑ\83нÑ\83н каÑ\80а',
-'tooltip-ca-nstab-user' => 'Ð\9aолдонÑ\83Ñ\83Ñ\87Ñ\83нÑ\83н жеке баÑ\80агÑ\8bн көÑ\80Ñ\81Ó©Ñ\82',
+'tooltip-ca-nstab-main' => 'Ð\91аÑ\80акÑ\82Ñ\8bн мазмÑ\83нÑ\83н каÑ\80оо',
+'tooltip-ca-nstab-user' => 'Ð\9aаÑ\82Ñ\8bÑ\88Ñ\83Ñ\83Ñ\87Ñ\83нÑ\83н баÑ\80агÑ\8bн көÑ\80Ñ\81Ó©Ñ\82Ò¯Ò¯',
'tooltip-ca-nstab-special' => 'Бул атайын барак, аны оңдой албайсыз',
-'tooltip-ca-nstab-project' => 'Долбоор барагын кара',
-'tooltip-ca-nstab-image' => 'Файл барагын көрсөт',
-'tooltip-ca-nstab-template' => 'Ð\9aалÑ\8bпÑ\82Ñ\8b көÑ\80Ñ\81Ó©Ñ\82',
-'tooltip-ca-nstab-category' => 'Категория барагын көрсөт',
-'tooltip-minoredit' => 'Муну майда оңдоо деп белгиле',
-'tooltip-save' => 'ӨзгөÑ\80Ñ\82үүлөÑ\80дү Ñ\81акÑ\82ап кой',
+'tooltip-ca-nstab-project' => 'Долбоор барагын көрүү',
+'tooltip-ca-nstab-image' => 'Файл барагын көрүү',
+'tooltip-ca-nstab-template' => 'ШаблондÑ\83 көÑ\80Ò¯Ò¯',
+'tooltip-ca-nstab-category' => 'Категория барагын көрүү',
+'tooltip-minoredit' => 'Муну майда оңдоо деп белгилөө',
+'tooltip-save' => 'ӨзгөÑ\80Ñ\82үүлөÑ\80дү Ñ\81акÑ\82оо',
'tooltip-preview' => 'Кичи пейлдикке, өзгөртүүлөрдү алдын ала көрсөтүүнү сактоодон мурун колдонуңуз!',
-'tooltip-diff' => 'Тексттке киргизген өзгөртүүлөрдү көрсөт',
-'tooltip-compareselectedversions' => 'Ð\91Ñ\83л баÑ\80акÑ\82Ñ\8bн Ñ\82андалган Ñ\8dки веÑ\80Ñ\81иÑ\8fÑ\81Ñ\8bнÑ\8bн айÑ\8bÑ\80малаÑ\80Ñ\8bн каÑ\80а',
+'tooltip-diff' => 'Тексттке киргизген өзгөртүүлөрдү көрсөтүү',
+'tooltip-compareselectedversions' => 'Ð\91Ñ\83л баÑ\80акÑ\82Ñ\8bн Ñ\82андалган Ñ\8dки веÑ\80Ñ\81иÑ\8fÑ\81Ñ\8bнÑ\8bн айÑ\8bÑ\80малаÑ\80Ñ\8bн каÑ\80оо',
'tooltip-watch' => 'Бул баракты көзөмөл тизмеңизге кошуңуз',
'tooltip-rollback' => '"Кайтар" бир баскыч менен бул барактын соңку оңдоочусунун өзгөртүүлөрүн алып салат',
'tooltip-undo' => 'Киргизилген оңдоону алып салат жана жокко чыгаруунун себебин белгилөөгө мүмкүнчүлүк берип алдын ала көрсөтүүнү ачат',
-'tooltip-summary' => 'Ð\9aÑ\8bÑ\81ка коÑ\80Ñ\83Ñ\82Ñ\83ндÑ\83 киÑ\80гиз',
+'tooltip-summary' => 'Ð\9aÑ\8bÑ\81ка баÑ\8fндаманÑ\8b киÑ\80гизиңиз',
# Attribution
'others' => 'башкалар',
# Browsing diffs
-'previousdiff' => 'â\86\90 Ð\9cÑ\83Ñ\80Ñ\83нкÑ\83 оңдоо',
-'nextdiff' => 'Жаңы түзөтүү →',
+'previousdiff' => 'â\86\90 ÐÑ\81киÑ\81ин оңдоо',
+'nextdiff' => 'Жаңысын оңдоо →',
# Media information
-'file-info-size' => '$1 × $2 пиксел, файлдын көлөмү: $3, MIME тиби: $4',
+'file-info-size' => '$1 × $2 пиксель, файлдын көлөмү: $3, MIME түрү: $4',
'file-nohires' => 'Мындан дагы толук чечилиши жок.',
'svg-long-desc' => 'SVG файл, шарттуу түрдө $1 × $2 пиксел, файлдын көлөмү: $3',
-'show-big-image' => 'ТолÑ\83к Ñ\87еÑ\87илиÑ\88и',
+'show-big-image' => 'ТолÑ\83к Ñ\87еÑ\87ими',
# Special:NewFiles
'newimages' => 'Жаңы файлдардын галлереясы',
'exif-focalplaneresolutionunit-2' => 'дюйм',
# External editor support
-'edit-externally' => 'Бул файлды сырткы программа колдонуу аркылуу оңдо',
+'edit-externally' => 'Бул файлды сырткы программа колдонуу аркылуу оңдоо',
'edit-externally-help' => '(Толук маалымат алуу үчүн [//www.mediawiki.org/wiki/Manual:External_editors setup instructions] барагына кайрылсаңыз болот)',
# 'all' in various places, this might be different for inflected languages
'confirmemail_loggedin' => 'Электрондук дарегиңиз ырасталды.',
# Watchlist editing tools
-'watchlisttools-view' => 'Тийиштүү өзгөрүүлөрдү көрсөт',
-'watchlisttools-edit' => 'Көзөмөл тизмени кара жана оңдо',
-'watchlisttools-raw' => 'Жетиле элек көзөмөл тизмени оңдо',
+'watchlisttools-view' => 'Тийиштүү өзгөрүүлөрдү көрсөтүү',
+'watchlisttools-edit' => 'Көзөмөл тизмени кара жана оңдоо',
+'watchlisttools-raw' => 'Жетиле элек көзөмөл тизмени оңдоо',
# Core parser functions
'duplicate-defaultsort' => '\'\'\'Эскертүү:\'\'\' "$2" белгиленген ылгоочу ачкыч "$1" мурунку белгиленген ылгоочу ачкычты жокко чыгарат.',
'specialpages' => 'Атайын барактар',
# External image whitelist
-'external_image_whitelist' => ' #Бул сапты болгондой калтыр<pre>
-#Туруктуу айтылыштардын бөлүмдөрүн (// арасындагы бөлүмүн гана) астына жайгаштыр
+'external_image_whitelist' => ' #Бул сапты болгондой калтыруу<pre>
+#Туруктуу айтылыштардын бөлүмдөрүн (// арасындагы бөлүмүн гана) астына жайгаштыру
#Алар сырткы сүрөттөрдүн URL менен байланыштырылат
#Ылайыктуулары сүрөт болуп көрсөтүлөт, калгандары сүрөттөргө шилтеме болуп көрсөтүлөт
## менен башталган саптар, түшүндүрмө болуп эсептелет
#Баш же кичине тамга айырмасыз
-#Туруктуу айтылыштардын бөлүмдөрүн ушул саптын үстүнө жайгаштыр. Бул сапты болгондой калтыр.</pre>',
+#Туруктуу айтылыштардын бөлүмдөрүн ушул саптын үстүнө жайгаштыр. Бул сапты болгондой калтыруу.</pre>',
# Special:Tags
'tag-filter' => '[[Special:Tags|Энбелги]] чыпкасы:',
+# Feedback
+'feedback-subject' => 'Тема:',
+'feedback-message' => 'Билдирме:',
+'feedback-cancel' => 'Айнуу',
+'feedback-close' => 'Даяр',
+
+# Search suggestions
+'searchsuggest-search' => 'Издөө',
+
);
'newwindow' => '(geet an enger neier Fënster op)',
'cancel' => 'Zréck',
'moredotdotdot' => 'Méi …',
-'mypage' => 'Meng Säit',
-'mytalk' => 'Meng Diskussioun',
+'mypage' => 'Säit',
+'mytalk' => 'Diskussioun',
'anontalk' => 'Diskussioun fir dës IP Adress',
'navigation' => 'Navigatioun',
'and' => ' a(n)',
# Preferences page
'preferences' => 'Astellungen',
-'mypreferences' => 'Meng Astellungen',
+'mypreferences' => 'Astellungen',
'prefs-edits' => 'Zuel vun den Ännerungen:',
'prefsnologin' => 'Net ageloggt',
'prefsnologintext' => 'Dir musst <span class="plainlinks">[{{fullurl:{{#Special:UserLogin}}|returnto=$1}}ageloggt]</span> sinn, fir Är Astellungen änneren ze kënnen.',
'rightslogtext' => "Dëst ass d'Lëscht vun den Ännerunge vu Benotzerrechter.",
'rightslogentry' => "huet d'Benotzerrechter vum $1 vun $2 op $3 geännert.",
'rightslogentry-autopromote' => 'gouf automatesch aus dem Grupp $2 an de Grupp $3 gesat',
+'logentry-rights-autopromote' => "De Benotzer $1 huet d'Benotzerrechter automatesch vu(n) $4 op $5 geännert",
'rightsnone' => '(keen)',
# Associated actions - in the sentence "You do not have permission to X"
* '''<code><nowiki>[[</nowiki>{{ns:file}}<nowiki>:Fichier.jpg]]</nowiki></code>''' fir déi ganz Versioun vum Fichier ze benotzen
* '''<code><nowiki>[[</nowiki>{{ns:file}}<nowiki>:Fichier.png|200px|thumb|left|alt text]]</nowiki></code>''' fir eng 200 Pixel breet Versioun an enger Këscht am lénke Rand mat 'alt text' als Beschreiwung
* '''<code><nowiki>[[</nowiki>{{ns:media}}<nowiki>:Fichier.ogg]]</nowiki></code>''' fir e Fichier direkt ze verlinken ouni de Fichier ze weisen",
-'upload-permitted' => 'Erlaabte Formater vun de Fichieren: $1.',
+'upload-permitted' => 'Erlaabt Formater vun de Fichieren: $1.',
'upload-preferred' => 'Fichierszorten déi am beschte funktionéieren: $1.',
'upload-prohibited' => 'Verbuede Fichiers Formater: $1.',
'uploadlog' => 'Lëscht vun den eropgeluedene Fichieren',
# Watchlist
'watchlist' => 'Meng Iwwerwaachungslëscht',
-'mywatchlist' => 'Meng Iwwerwaachungslëscht',
+'mywatchlist' => 'Iwwerwaachungslëscht',
'watchlistfor2' => 'Vum $1 $2',
'nowatchlist' => 'Är Iwwerwaachungslëscht ass eidel.',
'watchlistanontext' => "Dir musst $1 fir Säiten op ärer Iwwerwaachungslëscht ze gesinn oder z'änneren.",
# Contributions
'contributions' => 'Kontributioune vum Benotzer',
'contributions-title' => 'Kontributioune vum $1',
-'mycontris' => 'Meng Kontributiounen',
+'mycontris' => 'Kontributiounen',
'contribsub2' => 'Fir $1 ($2)',
'nocontribs' => 'Et goufe keng Ännerunge fonnt, déi dëse Kritèren entspriechen.',
'uctop' => '(aktuell)',
'duration-centuries' => '$1 {{PLURAL:$1|Joerhonnert|Joerhonnerten}}',
'duration-millennia' => '$1 {{PLURAL:$1|Millenaire|Millenairen}}',
+# Unknown messages
+'mytalk-parenthetical' => 'Diskussioun',
);
'cancel' => 'Aoka ihany',
'moredotdotdot' => 'Tohiny...',
'mypage' => 'Pejiko',
-'mytalk' => 'Ny diniko',
+'mytalk' => 'Dinika',
'anontalk' => "Resaka ho an'io adiresy IP io",
'navigation' => 'Fikarohana',
'and' => ' sy',
# Preferences page
'preferences' => 'Ny momba anao',
-'mypreferences' => 'Ny safidiko',
+'mypreferences' => 'Safidy',
'prefs-edits' => 'isa ny fanovàna :',
'prefsnologin' => 'Tsy tafiditra',
'prefsnologintext' => 'Mila <span class="plainlinks">[{{fullurl:{{#Special:UserLogin}}|returnto=$1}} misoratra ary tafiditra]</span> amin\'ny kaontinao ianao vao afaka manova ny safidinao.',
'statistics-views-total' => 'Tsidika',
'statistics-views-peredit' => 'Tsidika isaky ny fanovana',
'statistics-users' => '[[Special:ListUsers|Mpikambana]] nisoratra anarana',
-'statistics-users-active' => 'Mpikambana manova matetika',
+'statistics-users-active' => 'Mpikambana mavitrika',
'statistics-users-active-desc' => "Mpikambana nanao zavatra teto tanatin'ny $1 andro{{PLURAL:}}.",
'statistics-mostpopular' => 'Pejy voatsidika',
# Watchlist
'watchlist' => 'Narahiko maso',
-'mywatchlist' => 'Pejy arahako',
+'mywatchlist' => 'Pejy arahana',
'watchlistfor2' => "Ho an'i $1 $2",
'nowatchlist' => 'Tsy manaraka pejy ianao.',
'watchlistanontext' => "Andana $1 hahafahanao mijery na manova zavatra ao amin'ny pejy arahanao.",
# Contributions
'contributions' => "Fandraisan'anjaran'ny mpikambana",
'contributions-title' => "Fandraisan'anjaran'i $1",
-'mycontris' => 'Ny nosoratako',
+'mycontris' => "Fandraisan'anjara",
'contribsub2' => "ho an'ny $1 ($2)",
'nocontribs' => "Tsy misy fanovana mifanaraka amin'ireo critères ireo.",
'uctop' => ' (loha)',
'duration-centuries' => '$1 {{PLURAL:$1|век|века}}',
'duration-millennia' => '$1 {{PLURAL:$1|милениум|милениуми}}',
+# Unknown messages
+'mytalk-parenthetical' => 'разговор',
);
'duration-centuries' => '$1 {{PLURAL:$1|eeuw|eeuwen}}',
'duration-millennia' => '$1 {{PLURAL:$1|millennium|millennia}}',
+# Unknown messages
+'mytalk-parenthetical' => 'overleg',
);
'recentchanges-summary' => 'På denne sida ser du dei sist endra sidene i {{SITENAME}}.',
'recentchanges-feed-description' => 'Fylg med på dei siste endringane på denne wikien med dette abonnementet.',
'recentchanges-label-newpage' => 'Endringa oppretta ei ny side',
-'recentchanges-label-minor' => 'Dette er ei mindre endring',
+'recentchanges-label-minor' => 'Endringa er småplukk',
'recentchanges-label-bot' => 'Denne endringa vart gjort av ein bot',
'recentchanges-label-unpatrolled' => 'Endringa er ikkje patruljert enno',
'rcnote' => "Nedanfor er {{PLURAL:$1|den siste endringa gjord|dei siste '''$1''' endringane gjorde}} {{PLURAL:$2|den siste dagen|dei siste '''$2''' dagane}}, for $4, kl. $5.",
'version-hook-subscribedby' => 'Brukt av',
'version-version' => '(versjon $1)',
'version-license' => 'Lisens',
-'version-poweredby-credits' => "Denne wikien er dreven av '''[//www.mediawiki.org/ MediaWiki]''', copyright © 2001-$1 $2.",
+'version-poweredby-credits' => "Denne wikien er driven av '''[//www.mediawiki.org/ MediaWiki]''', copyright © 2001-$1 $2.",
'version-poweredby-others' => 'andre',
'version-credits-summary' => 'Me ynskjer godskriva desse personane for tilskotet deira til [[Special:Version|MediaWiki]].',
+'version-license-info' => 'MediaWiki er fri programvare; du kan redistribuera det og/eller modifisera det under krava i GNU General Public License som publisert av Free Software Foundation; anten versjon 2 av lisensen, eller (om du ynskjer det) ein kvar seinare versjon.
+
+MediaWiki er distribuert i håp om at det vil vera nyttig, men UTAN NOKON GARANTI; ikkje eingong ein implisitt garanti for at det KAN SELJAST eller at det EIGNAR SEG TIL EIT VISST FØREMÅL. Sjå GNU General Public License for fleire detaljar.
+
+Du skal ha motteke [{{SERVER}}{{SCRIPTPATH}}/COPYING ein kopi av GNU General Public License] saman med dette programmet; om ikkje, skriv til Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA eller [//www.gnu.org/licenses/old-licenses/gpl-2.0.html les det på nettet].',
'version-software' => 'Installert programvare',
'version-software-product' => 'Produkt',
'version-software-version' => 'Versjon',
'duration-centuries' => '$1 {{PLURAL:$1|hundreår|hundreår}}',
'duration-millennia' => '$1 {{PLURAL:$1|tusenår|tusenår}}',
+# Unknown messages
+'mytalk-parenthetical' => 'diskusjon',
);
'category-file-count' => "{{PLURAL:$2|Chol catégorie o seulemint chol fichié-lo.|{{PLURAL:$1|Ech fichier-lo est|$1 Chés fichiés-lo sont}} din l'catégorie-lo, pou un total éd $2 fichiés.}}",
'category-file-count-limited' => "{{PLURAL:$1|Ech fichié d'apré est|Chés $1 fichiés d'apré sont}} dins l'catégorie-lo.",
'listingcontinuesabbrev' => 'cont.',
+'noindex-category' => 'Paches nin indécsées',
'broken-file-category' => "Paches aveuc des loïens d'fichiés bérzillés",
'about' => 'À pérpos',
'newwindow' => '(ouvrir din eune nouvèle fernéte)',
'cancel' => 'Canchler',
'moredotdotdot' => 'Plu...',
-'mypage' => 'Em pache',
+'mypage' => 'Pache',
'mytalk' => 'Min bavouér',
'anontalk' => "Bavouér pou chl'IP-lo",
'navigation' => 'Navigachon',
'virus-unknownscanner' => 'intivirus poin connu:',
# Login and logout pages
+'welcomecreation' => "== Binv'nute, $1 ! ==
+
+Vote compte o té créé.
+N'obliez poin d'parsonnaliser vos [[Special:Preferences|préférinches édseur {{SITENAME}}]].",
'yourname' => "nom d'uzeu:",
'yourpassword' => "Mot d'passe:",
'yourpasswordagain' => "Intrer à nouvieu ch'mot d'passe:",
'remembermypassword' => "Intrer oùtonmatiquemint l'prochaine fouos (pour un maximum éd $1 {{PLURAL:$1|jour|jours}})",
+'securelogin-stick-https' => "Réster connécté in HTTPS apré l'connécsion",
'yourdomainname' => 'Vote donmène:',
'login' => 'Intrer',
'nav-login-createaccount' => 'Intrer / créer vote conpte',
'createaccount' => 'Créer un conpte',
'gotaccount' => "Jou qu'os avez piécha un conpte? '''$1'''.",
'gotaccountlink' => 'Intrer',
+'userlogin-resetlink' => "Vos avez oblié vous détals d'connécsion ?",
'createaccountmail' => 'par imèle',
'badretype' => "Chés mots d'passe intrés, is sont poin bon.",
'userexists' => "Nom d’utilisateur entré déjà utilisé.
Os povez [[Special:Search/{{PAGENAME}}|foaire eune érchérche du tite del pache]] din chés eutes paches,
<span class="plainlinks">[{{fullurl:{{#Special:Log}}|page={{FULLPAGENAMEE}}}} érchércher din chés érliées opéracions]
ou [{{fullurl:{{FULLPAGENAME}}|action=edit}} créer chol pache]</span>.',
+'noarticletext-nopermission' => "Achteure i n’y o autchun teske dseur l'pache-lo.
+Os povez [[Special:Search/{{PAGENAME}}|foaire eune érchérche du tite del pache]] din chés eutes paches,
+o bin <span class=\"plainlinks\">[{{fullurl:{{#Special:Log}}|page={{FULLPAGENAMEE}}}} érchércher din chés érliées gazètes]</span>
+mais vos n'avez poin l'droué d'créer chol pache.",
'previewnote' => "'''Afute! ch'teske-lo ch'est seulemint eune prévue.'''
Vos cangemints, is sont poin coèr inrégistrés!",
'template-semiprotected' => '(semi-garanti)',
'hiddencategories' => '{{PLURAL:$1|Catégorie muchée|Catégories muchées}} pou chol pache:',
'permissionserrorstext-withaction' => "Vos n’avez poin l'pérmichon éd $2, pou {{PLURAL:$1|ch'motif suivant|chés motifs suivants}}:",
+'recreate-moveddeleted-warn' => "'''Afute ! : Os ètes in route à ércréer eune pache qu'o té abolie édvant.'''
+
+Controler qu'ch'est pértinint d' porsuire chés modificacions édseur chol pache. L'jornal des défacions pi des déplachemints l'est affiké chi-édsous :",
+'moveddeleted-notice' => "Chol pache ale o té abolie. L'jornal des défacions pi des déplachemints il est affiké chi-édsous pour référinche.",
# Parser/template warnings
'post-expand-template-inclusion-warning' => "Affute : Chèle pache ale a trop d’modèles. Des inclusions n'sront poin foaites.",
'post-expand-template-inclusion-category' => "Paches aveuc granmint d'modèles",
+'post-expand-template-argument-warning' => "Afute : Chol pache ale o au moins un paramète d'modèle dont l'inclusion est rindue impossibe. Apré éstinsion, chti-chi il éroait produit un résultat trop long, i n'a donc poin té inclus.",
+'post-expand-template-argument-category' => "Paches aveuc des paramètes d'modèle mie évalués",
# History pages
'viewpagelogs' => 'Vir chés gasètes del pache-lo',
'histlegend' => "Diff séléccion: buke chés boétes d'chés canjemints à comparète pi détriquer intrer ou ch'bouton édsou.<br />
Léginde : ({{MediaWiki:Cur}}) = différinches aveuc el vérchon à ch'momint-chi, ({{MediaWiki:Last}}) = différinches aveuc el vérchon édvant, <b>m</b> = tiot canjemint.",
'history-fieldset-title' => "S'déplacher din l'historique",
+'history-show-deleted' => 'Défacés seulemint',
'histfirst' => 'preumières paches',
'histlast' => 'Darin',
+# Revision feed
+'history-feed-item-nocomment' => '$1 à $2',
+
# Revision deletion
'rev-delundel' => 'montrer/mucher',
'revdel-restore' => 'cange écmint vir',
'revertmerge' => "N'poin mélinger",
# Diffs
-'history-title' => 'Histoère des cangemints éd "$1"',
+'history-title' => 'Historike des canjemints éd "$1"',
'lineno' => 'Line $1:',
'compareselectedversions' => 'Compérer chés couésies contérbuchons',
'editundo' => "n'poin foaire",
+'diff-multi' => '({{PLURAL:$1|Un canjemint intarmédiaire|$1 canjemints intarmédiaires}} par {{PLURAL:$2|un uzeu|$2 uzeus}} {{PLURAL:$1|est muché|sont muchées}})',
# Search results
'searchresults' => 'Tracher chés résultats',
'prevn' => 'dvant {{PLURAL:$1|$1}}',
'nextn' => 'apreu {{PLURAL:$1|$1}}',
'prevn-title' => 'Dvant $1 {{PLURAL:$1|résultat|résultats}}',
+'nextn-title' => "$1 {{PLURAL:$1|résultat d'apré|résultats d'apré}}",
+'shown-title' => 'Montrer $1 résultat{{PLURAL:$1||s}} pèr pache',
'viewprevnext' => 'Vir ($1 {{int:pipe-separator}} $2) ($3)',
+'searchmenu-exists' => "'''Il y o eune pache lonmée « [[:$1]] » édseur ch'wiki'''",
'searchmenu-new' => "'''Créer l'pache « [[:$1|$1]] » édseur ech wiki !'''",
'searchprofile-articles' => "Paches d'étnu",
'searchprofile-project' => "Paches d’aïude et pi d'prodjé",
'searchprofile-everything-tooltip' => "Tracher dins tout ch'wikipédia (et ochi dins chés paches éd distchucion)",
'searchprofile-advanced-tooltip' => "Couésir chés éspaches d'noms pour l'értrache",
'search-result-size' => '$1 ({{PLURAL:$2|1 mot|$2 mots}})',
+'search-result-category-size' => '$1 mimbe{{PLURAL:$1||s}} ($2 édsous-catégorie{{PLURAL:$2||s}}, $3 fichié{{PLURAL:$3||s}})',
'search-redirect' => '(érdirection $1)',
'search-section' => '(sekchon $1)',
'search-suggest' => 'Cha vo ti dire: $1',
'search-interwiki-caption' => 'Proujé analocq',
'search-interwiki-default' => '$1 résultats:',
'search-interwiki-more' => '(pus)',
+'searchrelated' => 'relaté',
'searchall' => 'tout',
+'showingresultsheader' => "{{PLURAL:$5|Résultat '''$1'''|Résultats '''$1–$2'''}} éd '''$3''' pour '''$4'''",
'nonefound' => "'''Note''': il y o tasseulemint quéques éspaces éd noms éq sont trachés pèr défeut. <br /> Pou tracher din tous chés contnus (paches éd pérlache, modéles, etc... comprins) insséyer in imploéyant ch'préfixe ''all:'' o bin imploéyer echl éspace éd noms édmindé conme préfixe.",
'search-nonefound' => 'Y a autchun résultat pour chol dmanne.',
'powersearch' => 'Érvue avanchée',
'gender-male' => 'Marle',
'gender-female' => 'Femelle',
'email' => 'Imèle',
+'prefs-help-email' => "L’adrèche du courrièl est facultative, mais ale est nécessaire pour artreuver vote mot d'passe, si vos vnoète à l’oblier.",
+'prefs-help-email-others' => "Os pouvez auchi couésir d'laicher les eutes vos contacter par imèle aveuc un loïen édseur vote pache éd distchussion d'uzeu sans qu'i soèche nécessaire ed révéler vote idintité.",
'prefs-help-email-required' => 'I feut eune iméle adérche',
# User rights
'recentchanges' => 'Darins canjemints',
'recentchanges-legend' => 'Opchons éd chés nouvieus canjemints',
'recentchanges-feed-description' => 'Tracher chés pus darins cangemints du wiki din chol alimintachon.',
+'recentchanges-label-newpage' => 'Chol modificacion ale o créé eune nouvèle pache',
+'recentchanges-label-minor' => "C'est un tiot canjemint",
+'recentchanges-label-bot' => 'Chol modificacion ale o té foaite pèr un robot.',
+'recentchanges-label-unpatrolled' => 'Chol modificacion ale n’o poin coèr té controlée.',
'rcnote' => "Vlo {{PLURAL:$1|ech darin canjemint foait|chés $1 darins canjemints foaits}} din {{PLURAL:$2|l'darinne jornèe|chés <b>$2</b> darins jours}} dusque l' $4 à $5.",
+'rcnotefrom' => "Vlo chés modificacions foaites édpuis l' '''$2''' (dousqu'à '''$1''' au plus).",
'rclistfrom' => "Montrer chés nouvieus cangemints d'puis $1",
'rcshowhideminor' => '$1 tiotes éditions',
'rcshowhidebots' => '$1 bots',
'rcshowhideliu' => '$1 lodjés uzeus',
'rcshowhideanons' => '$1 uzeus anonimes',
+'rcshowhidepatr' => '$1 chés modificacions wardées',
'rcshowhidemine' => '$1 ems éditions',
'rclinks' => 'Afiqher chés $1 darins canjemints din chés $2 darins jours<br />$3',
'diff' => 'dif',
# Recent changes linked
'recentchangeslinked' => 'Darins canjemints érliés',
+'recentchangeslinked-toolbox' => 'Suivi des paches loïées',
'recentchangeslinked-title' => 'Cangemints à pérpos éd "$1"',
+'recentchangeslinked-noresult' => "I n’y a poin d' modificacion des paches loïées pindant l'période couésie.",
'recentchangeslinked-summary' => "Ch'est eune lisse d'chés darins canjemints su chés paches qu'ont un loïen aveuc l'pache-lo. Chés paches din vote [[Special:Watchlist|''lisse à suire'']] il sont in '''cros'''.",
'recentchangeslinked-page' => 'Nom del pache:',
'recentchangeslinked-to' => "Vir putot chés canjemints d'chés paches aveuc un loïen su l'pache-lo",
# Upload
'upload' => 'Quértcher chés fichiés',
'uploadlogpage' => 'Jornal éd chés quértchémints',
+'filedesc' => 'Résumè',
'uploadedimage' => '"[[$1]]" quértchée',
+'license' => 'Licince',
+'license-header' => 'Licince',
+
# File description page
'file-anchor-link' => 'Fichié',
'filehist' => 'Histoère dech fichié',
'filehist-comment' => 'Fichié éd chés conmints',
'imagelinks' => 'Usage dech fichié',
'linkstoimage' => "{{PLURAL:$1|L'pache d'apreu est liée|Chés $1 paches d'apreu sont liées}} à ch'fichié-lo :",
+'nolinkstoimage' => "Autchune pache n'est loïée aveuc ch'fichié-lo",
'sharedupload' => "Cht'fichié vient éd $1 pi i put ète imploïé par d'eutes proujés.",
'sharedupload-desc-here' => "Ch'fichié i vient éd $1. I put ète uzer pèr d’eutes prodjés.
Vir apré ([$2 pache]).",
'uploadnewversion-linktext' => 'Quértcher eune novèle vérchion del pache-lo',
+# List redirects
+'listredirects' => 'Lisse des érdiréccions',
+
# Random page
'randompage' => "Pache à l'bérlure",
# Statistics
'statistics' => 'Éstatistikes',
+'disambiguationspage' => 'Template:Omonymie',
+
# Miscellaneous special pages
'nbytes' => '$1 {{PLURAL:$1|octé|octés}}',
'nmembers' => '$1 {{PLURAL:$1|mimbe|mimbes}}',
'allpagessubmit' => 'Aler',
'allpagesprefix' => "Foaire vir chés paches aveuc ch'préfix:",
+# Special:Categories
+'categories' => 'Lisse des catégories',
+
# Special:LinkSearch
'linksearch' => 'Loïens éstérieurs',
+'linksearch-line' => '$1 est loïé édpuis $2',
# Special:Log/newusers
'newuserlogpage' => "Jornal éd chés créachons d'comptes d'uzeu",
'deletepage' => "Défacer l'pache",
'confirmdeletetext' => "Vos alez défacer eune pache ou un fichié aveuc toutes chés antieusses vérchons.<br /> Confreumer éq ch'est cho éq vos voulez foaire, éq vos conprindez chés consécanches et pi éq ch'est bin s'lon el [[{{MediaWiki:Policy-url}}|politique éd MédiaWiki]].",
'actioncomplete' => 'Plònne acchon',
+'actionfailed' => "L’action n'a poin réussi",
'deletedtext' => "« $1 » o té défacé.
Vir $2 pou eune lisse d'chés darinnes défachons.",
'dellogpage' => 'jornal éd chés défacions',
'sp-contributions-newbies' => 'Montrer chés contérbuchons éd chés nouvieus conptes seulemint',
'sp-contributions-blocklog' => 'jornal éd chés blotcåjhes',
+'sp-contributions-uploads' => "téléquértch'mints",
'sp-contributions-logs' => 'Gasètes',
'sp-contributions-talk' => 'Dviser',
'sp-contributions-search' => 'Tracher pou chés contérbuchons',
'nolinkshere-ns' => "i n'y o poin d'pache aveuc un loïen vers '''[[:$1]]''' dins echl'éspace d'noms coési.",
'isredirect' => 'pache érdirigée',
'istemplate' => 'transclusion',
-'isimage' => "Loïen aveuc l'imache",
+'isimage' => "Loïen aveuc l'fichié",
'whatlinkshere-prev' => '{{PLURAL:$1|édvant|édvants $1}}',
'whatlinkshere-next' => "{{PLURAL:$1|d'apreu|d'apreu $1}}",
'whatlinkshere-links' => '← loïens',
# Namespace 8 related
'allmessagesname' => 'Nom',
+'allmessagesdefault' => 'Messache pèr défeut',
# Thumbnails
'thumbnail-more' => 'Pu grand',
+'thumbnail_error' => "Bérlurage tandir l'créachon éd la miniature : $1",
# Tooltip help for the actions
'tooltip-pt-userpage' => 'Vote pache éd uzeu',
'watchlisttools-edit' => "Vir pi éditer l'lisse à suire",
'watchlisttools-raw' => 'Éditer eune brute lisse à suire',
+# Core parser functions
+'duplicate-defaultsort' => "Afute : él cleu d'tri pèr défeut « $2 » écrase l'précédinte « $1 ».",
+
# Special:Version
'version-specialpages' => 'Paches éspéchiales',
# Special:BlankPage
'blankpage' => 'Blanke pache',
+# External image whitelist
+'external_image_whitelist' => " #Laicher chol line egzactemint telle quelle.<pre>
+#Dire chés bérlukes d’éspressions rationnelles (juste l'partie désignée inte chés //) chi-édsous.
+#I correspondront aveuc chés URL des images éstérnes.
+#Chelles qui corresponde'te s’affikeront conme des images, sinon seul un loïen vers l’image i s'ra affiké.
+#Les lines conmençant par un # s'ront considérées conme des conmintaires.
+#Chol lisse n’est mie sensibe à la casse.
+
+#Mettez tous chés bérlukes d’éspressions rationnelles au-d'sus éd chol line. Laichez chol darin.ne line telle quelle.</pre>",
+
+# Special:Tags
+'tag-filter' => 'Filtrer chés [[Special:Tags|balises]] :',
+
# Special:ComparePages
'compare-page1' => 'Pache 1',
'compare-page2' => 'Pache 2',
$5
Cost còdes ëd conferma a l'é bon fin-a al $4.",
-'confirmemail_body_changed' => "Cheidun, a l'é belfé ch'a sia chiel, da l'adrëssa IP \$1,
-a l'ha cangià l'adrëssa ëd pòsta eletrònica dël cont \"\$2\" con st'adrëssa-sì dzora a {{SITENAME}}.
+'confirmemail_body_changed' => "Cheidun, a l'é belfé ch'a sia chiel, da l'adrëssa IP $1,
+a l'ha cangià l'adrëssa ëd pòsta eletrònica dël cont «$2» con st'adrëssa-sì dzora a {{SITENAME}}.
Për confirmé che sto cont-sì a l'é pròpi sò e për riativé
-le possibilità ëd pòsta eletrònica dzora a {{SITENAME}}, ch'a deurba sto colegament-sì an sò navigador:
+le fonsion ëd pòsta eletrònica dzora a {{SITENAME}}, ch'a deurba costa liura-sì an sò navigador:
-\$3
+$3
-Se ël cont a l'é *nen* sò, ch'a vada andré a sto colegament-sì
+Se ël cont a l'é *nen* sò, ch'a-i vada dapress a costa liura-sì
për scancelé la conferma dl'adrëssa ëd pòsta eletrònica:
-\$5
+$5
-Ës còdes ëd conferma a scadrà a \$4.",
-'confirmemail_body_set' => "Quaidun, miraco chiel, da l'adrëssa IP \$1,
-a l'ha ampostà l'adrëssa ëd pòsta eletrònica dël cont \"\$2\" con costa adrëssa su {{SITENAME}}.
+Ës còdes ëd conferma a scadrà ël $4.",
+'confirmemail_body_set' => "Quaidun, miraco chiel, da l'adrëssa IP $1,
+a l'ha ampostà l'adrëssa ëd pòsta eletrònica dël cont «$2» con costa adrëssa su {{SITENAME}}.
Për confirmé che sto cont a l'é pròpi sò e ativé torna
le funsion ëd pòsta eletrònica su {{SITENAME}}, ch'a duverta cost'anliura an sò navigador:
-\$3
+$3
Se ël cont a l'é *pa* sò, ch'a-j vada dapress a st'anliura
për scancelé la conferma ëd l'adrëssa ëd pòsta eletrònica:
-\$5
+$5
-Cost còdes ëd conferma a scad ai \$4.",
+Cost còdes ëd conferma a scad ai $4.",
'confirmemail_invalidated' => "Conferma ëd l'adrëssa e-mail scanselà",
'invalidateemail' => "Scansela l'e-mail ëd conferma",
'duration-centuries' => '$1 {{PLURAL:$1|sécol|sécoj}}',
'duration-millennia' => '$1 {{PLURAL:$1|milenari|milenari}}',
+# Unknown messages
+'mytalk-parenthetical' => 'discussion',
);
'api-error-uploaddisabled' => 'API error message that can be used for client side localisation of API errors.',
'api-error-verification-error' => 'The word "extension" refers to the part behind the last dot in a file name, that by convention gives a hint about the kind of data format which a files contents are in.',
+# Unknown messages
+'mytalk-parenthetical' => 'When user page and talk combined into single label, link title for talk label',
);
'duration-centuries' => '$1 {{PLURAL:$1|secol|secole|de secole}}',
'duration-millennia' => '$1 {{PLURAL:$1|mileniu|milenii|de milenii}}',
+# Unknown messages
+'mytalk-parenthetical' => 'discuție',
);
'sort-ascending' => 'Упорядочить по возрастанию',
# Short words for each namespace, by default used in the namespace tab in monobook
-'nstab-main' => 'Страница',
+'nstab-main' => 'Статья',
'nstab-user' => 'Участник',
'nstab-media' => 'Мультимедиа',
'nstab-special' => 'Служебная страница',
'withoutinterwiki' => 'Страницы без интервики-ссылок',
'withoutinterwiki-summary' => 'Следующие страницы не имеют интервики-ссылок:',
-'withoutinterwiki-legend' => 'Ð\9fÑ\80иÑ\81Ñ\82авка',
+'withoutinterwiki-legend' => 'Ð\9fÑ\80еÑ\84икÑ\81',
'withoutinterwiki-submit' => 'Показать',
'fewestrevisions' => 'Страницы с наименьшим количеством версий',
'allmessages-filter-unmodified' => 'Неизменённые',
'allmessages-filter-all' => 'Все',
'allmessages-filter-modified' => 'Изменённые',
-'allmessages-prefix' => 'ФилÑ\8cÑ\82Ñ\80 по пÑ\80иÑ\81Ñ\82авке:',
+'allmessages-prefix' => 'ФилÑ\8cÑ\82Ñ\80 по пÑ\80еÑ\84икÑ\81Ñ\83:',
'allmessages-language' => 'Язык:',
'allmessages-filter-submit' => 'Перейти',
'cancel' => 'අත් හරින්න',
'moredotdotdot' => 'තවත්...',
'mypage' => 'මගේ පිටුව',
-'mytalk' => 'මà¶\9cà·\9a à·\83à·\8fà¶\9aචà·\8aඡà·\8f',
+'mytalk' => 'à·\83à·\8fà¶\9aචà·\8aඡà·\8fà·\80',
'anontalk' => 'මෙම අයිපී ලිපිනය සඳහා සාකච්ඡාව',
'navigation' => 'යාත්රණය',
'and' => ' සහ',
# Preferences page
'preferences' => 'අභිරුචි',
-'mypreferences' => 'මà¶\9cà·\9a à¶\85භà·\92රà·\94චà·\92',
+'mypreferences' => 'අභිරුචි',
'prefs-edits' => 'සංස්කරණයන් සංඛ්යාව:',
'prefsnologin' => 'පිවිසී නැත (Not logged in)',
'prefsnologintext' => 'පරිශීලක අභිරුචි සැකසීමට නම්, ඔබ <span class="plainlinks">[{{fullurl:Special:Userlogin|returnto=$1}} ප්රවිෂ්ටවී]</span> සිටිය යුතුය.',
# Watchlist
'watchlist' => 'මගේ මුර-ලැයිස්තුව',
-'mywatchlist' => 'මà¶\9cà·\9a මà·\94ර ලැයිස්තුව',
+'mywatchlist' => 'මà·\94ර-ලැයිස්තුව',
'watchlistfor2' => '$1 සඳහා ($2)',
'nowatchlist' => 'ඔබගේ මුර-ලැයිස්තුවේ කිසිදු අයිතමයක් නොමැත.',
'watchlistanontext' => 'ඔබගේ මුර-ලැයිස්තුවෙහි අයිතම නැරඹීමට හෝ සංස්කරණය කිරීමට හෝ කරුණාකර $1 සපුරන්න.',
# Contributions
'contributions' => 'මෙම පරිශීලකගේ දායකත්වයන්',
'contributions-title' => ' $1 සඳහා පරිශීලක දායකත්වයන්',
-'mycontris' => 'මà¶\9cà·\9a දà·\8fයà¶\9aà¶à·\8aà·\80',
+'mycontris' => 'දà·\8fයà¶\9aà¶à·\8aà·\80යනà·\8a',
'contribsub2' => '$1 සඳහා ($2)',
'nocontribs' => 'මෙම උපමානයන් හා ගැලපෙන වෙනස්වීම් හමුනොවිණි.',
'uctop' => '(ඉහලම)',
'whatlinkshere-hideredirs' => '$1 යළි-යොමුකරයි',
'whatlinkshere-hidetrans' => '$1 අන්තර්ගතයන්',
'whatlinkshere-hidelinks' => 'සබැඳියන් $1',
-'whatlinkshere-hideimages' => 'රà·\96ප සබැඳි $1',
+'whatlinkshere-hideimages' => 'à¶\9cà·\9cනà·\94 සබැඳි $1',
'whatlinkshere-filters' => 'පෙරහන්',
# Block/unblock
'linksearch-ns' => 'Namnrymd:',
'linksearch-ok' => 'Sök',
'linksearch-text' => 'Jokertecken (wildcards) som t.ex. "*.wikipedia.org" kan användas.
-Det krävs åtminstone en toppnivå-domän, t.ex. "*.org".<br />
-Protokoll som stöds: <code>$1</code> (lägg inte till något av dessa i din sökning).',
+Det krävs åtminstone en toppdomän, t.ex. "*.org".<br />
+Protokoll som stöds: <code>$1</code> (lägg inte till någon av dessa i din sökning).',
'linksearch-line' => '$1 länkas från $2',
'linksearch-error' => 'Jokertecken kan bara användas i början av domännamnet.',
'duration-centuries' => '$1 {{PLURAL:$1|sekel|sekel}}',
'duration-millennia' => '$1 {{PLURAL:$1|millennium|millennier}}',
+# Unknown messages
+'mytalk-parenthetical' => 'diskussion',
);
'cancel' => 'Batilisha',
'moredotdotdot' => 'Zaidi...',
'mypage' => 'Ukurasa wangu',
-'mytalk' => 'Majadiliano yangu',
+'mytalk' => 'Majadiliano',
'anontalk' => 'Majadiliano ya IP hii',
'navigation' => 'Urambazaji',
'and' => ' na',
'noarticletext' => 'Ukurasa huu haujaandikwa bado. [[Special:Search/{{PAGENAME}}|tafutia jina hili]] katika kurasa nyingine, <span class="plainlinks">[{{fullurl:{{#Special:Log}}|page={{FULLPAGENAMEE}}}} tafuta kumbukumbu zinazohusika], au [{{fullurl:{{FULLPAGENAME}}|action=edit}} hariri ukurasa huu]</span>.',
'noarticletext-nopermission' => 'Kwa sasa hakuna maandishi katika ukurasa huu.
Unaweza [[Special:Search/{{PAGENAME}}|kutafuta jina la ukurasa huu]] katika kurasa nyingine,
-au <span class="plainlinks">[{{fullurl:{{#Special:Log}}|page={{FULLPAGENAMEE}}}} tafuta ingizo linalofanana]</span>.',
+au <span class="plainlinks">[{{fullurl:{{#Special:Log}}|page={{FULLPAGENAMEE}}}} tafuta kumbukumbu zinazohusika]</span>, lakini huruhusiwi kuanzisha ukurasa huu.',
'userpage-userdoesnotexist' => 'Akaunti ya mtumiaji "<nowiki>$1</nowiki>" haijasajilishwa.
Ukitaka kuanzisha au kuhariri ukurasa huu tafadhali ucheki jina la akaunti.',
'userpage-userdoesnotexist-view' => 'Akaunti ya mtumiaji "$1" haijasajilishwa.',
# Preferences page
'preferences' => 'Mapendekezo',
-'mypreferences' => 'Mapendekezo yangu',
+'mypreferences' => 'Mapendekezo',
'prefs-edits' => 'Idadi ya marekebisho:',
'prefsnologin' => 'Hujaingia',
'prefsnologintext' => 'Inabidi <span class="plainlinks">[{{fullurl:{{#Special:UserLogin}}|returnto=$1}} uingie akaunti yako]</span> ili ubadilishe mapendekezo yako.',
# Watchlist
'watchlist' => 'Maangalizi yangu',
-'mywatchlist' => 'Maangalizi yangu',
+'mywatchlist' => 'Maangalizi',
'watchlistfor2' => 'Kwa ajili ya $1 $2',
'nowatchlist' => 'Hamna vitu katika maangalizi yako.',
'watchlistanontext' => 'Tafadhali $1 ili kutazama au kuhariri vitu vilivyopo katika orodha yako ya maangalizi.',
# Contributions
'contributions' => 'Michango ya mtumiaji',
'contributions-title' => 'Michango ya mtumiaji $1',
-'mycontris' => 'Michango yangu',
+'mycontris' => 'Michango',
'contribsub2' => 'Kwa $1 ($2)',
'nocontribs' => 'Mabadiliko yanayolingana na vigezo vilivyoulizwa hayakupatikana.',
'uctop' => '(juu)',
'underline-always' => 'எப்பொழுதும்',
'underline-never' => 'எப்போதுமில்லை',
-'underline-default' => 'உலாவி இயல்பிருப்பு',
+'underline-default' => 'தà¯\8bலà¯\8d à®\85லà¯\8dலதà¯\81 à®\89லாவி à®\87யலà¯\8dபிரà¯\81பà¯\8dபà¯\81',
# Font style option in Special:Preferences
'editfont-style' => 'தொகுத்தல் பெட்டி எழுத்துரு:',
'newwindow' => '(புதிய சாளரத்துள் திறக்கும்)',
'cancel' => 'சேமிக்காமல் திரும்பு',
'moredotdotdot' => 'மேலும்...',
-'mypage' => 'à®\8eனதà¯\81 பà®\95à¯\8dà®\95à®®à¯\8d',
-'mytalk' => 'à®\8eனà¯\8d பà¯\87à®\9aà¯\8dà®\9aà¯\81',
+'mypage' => 'பக்கம்',
+'mytalk' => 'பேச்சு',
'anontalk' => 'இந்த ஐ.பி. முகவரிக்கான பேச்சு',
'navigation' => 'வழிசெலுத்தல்',
'and' => ' மற்றும்',
'youhavenewmessages' => 'உங்களுக்குப் $1 உள்ளன ($2).',
'newmessageslink' => 'புதிய செய்திகள்',
'newmessagesdifflink' => 'கடைசி மாற்றம்',
+'youhavenewmessagesfromusers' => 'உங்களுக்கு $1 {{PLURAL:$3|வேறொரு பயனரிடம்|$3 பயனர்களிடம்}} இருந்து உள்ளது ($2).',
'newmessageslinkplural' => '{{PLURAL:$1|ஒரு புதிய செய்தி|புதிய செய்திகள்}}',
'newmessagesdifflinkplural' => 'கடைசி {{PLURAL:$1|மாற்றம்|மாற்றங்கள்}}',
'youhavenewmessagesmulti' => '$1 இல் உங்களுக்கு புதிய செய்திகள் காத்திருக்கின்றன',
* தடை செய்யப்பட்டவர்: $7
$1 பயனரையோ அல்லது வேறு [[{{MediaWiki:Grouppage-sysop}}|நிர்வாகி]] ஒருவரையோ அனுகி தடைப் பற்றி கலந்துரையாடலாம். 'இப் பயனருக்கு மின்னஞ்சல் செய்' என்ற வசதியை நீங்கள் பயன்படுத்துவதுலிருந்து தடைச் செய்யப்பட்டிருந்தாலோ அல்லது [[Special:Preferences|என் விருப்பத்தேர்வுகள்]] பக்கத்தில் இயங்குநிலையிலுள்ள மின்னஞ்சல் முகவரியை தராத போதோ பயனருக்கு மின்னஞ்சல் செய்ய முடியாது. உங்களது தற்போதைய ஐ.பி. முகவரி $3 மற்றும் தடை எண் #$5 என்பவற்றை கேள்விகள் கேட்கும் போது கட்டாயம் குறிப்பிடவும்.",
-'autoblockedtext' => '$1 ஆல் தடைச்செய்யப்பட்ட வேறு பயனரால் பயன்படுத்தபட்டதால், உங்கள் ஐ.பி. முகவரி தானியக்கமாக தடுக்கப்பட்டுள்ளது. அதற்கான காரணம் பின்வருமாறு:
+'autoblockedtext' => 'உங்கள் ஐ.பி. முகவரி தடை செய்யப்பட்டுள்ளது. அதே முகவரியைப் பயன்படுத்தித் தொக்குத்த யாரோ ஒரு பயனர் பின்வரும் காரணங்களுக்காகத் தடை செய்யப்பட்டுள்ளார். அதனால் உங்களால் தொகுக்க முடியவில்லை. அதற்கான காரணம் பின்வருமாறு:
:\'\'$2\'\'
* தடை முடிவு: $6
* தடை செய்யப்பட்டவர்: $7
-$1 பயனரà¯\88யà¯\8b à®\85லà¯\8dலதà¯\81 வà¯\87à®±à¯\81 [[{{MediaWiki:Grouppage-sysop}}|நிரà¯\8dவாà®\95ி]] à®\92à®°à¯\81வரà¯\88யà¯\8b à®\85னà¯\81à®\95ி தà®\9fைப் பற்றி கலந்துரையாடலாம்.
+$1 à®\8eனà¯\81à®®à¯\8d பயனரà¯\88யà¯\8b வà¯\87à®±à¯\81 [[{{MediaWiki:Grouppage-sysop}}|நிரà¯\8dவாà®\95ி]] à®\92à®°à¯\81வரà¯\88யà¯\8b à®\85னà¯\81à®\95ிதà¯\8d தà®\9fà¯\88யைப் பற்றி கலந்துரையாடலாம்.
-"à®\87பà¯\8d பயனரà¯\81à®\95à¯\8dà®\95à¯\81 மினà¯\8dனà®\9eà¯\8dà®\9aலà¯\8d à®\9aà¯\86யà¯\8d" à®\8eனà¯\8dà®± வà®\9aதியà¯\88 நà¯\80à®\99à¯\8dà®\95ளà¯\8d பயனà¯\8dபà®\9fà¯\81தà¯\81வதிலிரà¯\81நà¯\8dதà¯\81 தà®\9fà¯\88à®\9aà¯\8d à®\9aà¯\86யà¯\8dயபà¯\8dபà®\9fà¯\8dà®\9fிரà¯\81நà¯\8dதாலà¯\8b à®\85லà¯\8dலதà¯\81 [[Special:Preferences|à®\8eனà¯\8d விரà¯\81பà¯\8dபதà¯\8dதà¯\87à®°à¯\8dவà¯\81à®\95ளà¯\8d]] பà®\95à¯\8dà®\95தà¯\8dதிலà¯\8d à®\87யà®\99à¯\8dà®\95à¯\81நிலà¯\88யிலà¯\81ளà¯\8dள மினà¯\8dனà®\9eà¯\8dà®\9aலà¯\8d à®®à¯\81à®\95வரியà¯\88 தராத போதோ பயனருக்கு மின்னஞ்சல் செய்ய முடியாது.
+"à®\87பà¯\8d பயனரà¯\81à®\95à¯\8dà®\95à¯\81 மினà¯\8dனà®\9eà¯\8dà®\9aலà¯\8d à®\9aà¯\86யà¯\8d" à®\8eனà¯\8dà®± வà®\9aதியà¯\88 நà¯\80à®\99à¯\8dà®\95ளà¯\8d பயனà¯\8dபà®\9fà¯\81தà¯\8dதà¯\81வதிலிரà¯\81நà¯\8dதà¯\81 தà®\9fà¯\88à®\9aà¯\8d à®\9aà¯\86யà¯\8dயபà¯\8dபà®\9fà¯\8dà®\9fிரà¯\81நà¯\8dதாலà¯\8b à®\85லà¯\8dலதà¯\81 [[Special:Preferences|à®\8eனà¯\8d விரà¯\81பà¯\8dபதà¯\8dதà¯\87à®°à¯\8dவà¯\81à®\95ளà¯\8d]] பà®\95à¯\8dà®\95தà¯\8dதிலà¯\8d à®\87யà®\99à¯\8dà®\95à¯\81நிலà¯\88யிலà¯\81ளà¯\8dள மினà¯\8dனà®\9eà¯\8dà®\9aலà¯\8d à®®à¯\81à®\95வரியà¯\88தà¯\8d தராதபோதோ பயனருக்கு மின்னஞ்சல் செய்ய முடியாது.
-à®\89à®\99à¯\8dà®\95ளதà¯\81 தறà¯\8dபà¯\8bதà¯\88ய à®\90.பி. à®®à¯\81à®\95வரி $3 மறà¯\8dà®±à¯\81à®®à¯\8d தà®\9fà¯\88 à®\8eணà¯\8d #$5 à®\8eனà¯\8dபவறà¯\8dà®±à¯\88 à®\95à¯\87ளà¯\8dவிà®\95ளà¯\8d à®\95à¯\87à®\9fà¯\8dà®\95à¯\81à®®à¯\8d பà¯\8bதà¯\81 கட்டாயம் குறிப்பிடவும்.',
+à®\87தà¯\88பà¯\8d பறà¯\8dறிய à®\89à®\99à¯\8dà®\95ளà¯\8d à®\95à¯\87ளà¯\8dவிà®\95ளà¯\88à®\95à¯\8d à®\95à¯\87à®\9fà¯\8dà®\95à¯\81à®®à¯\8dபà¯\8bதà¯\81 à®\89à®\99à¯\8dà®\95ளதà¯\81 தறà¯\8dபà¯\8bதà¯\88ய à®\90.பி. à®®à¯\81à®\95வரி $3 மறà¯\8dà®±à¯\81à®®à¯\8d தà®\9fà¯\88 à®\8eணà¯\8d #$5 à®\86à®\95ியவறà¯\8dà®±à¯\88à®\95à¯\8d கட்டாயம் குறிப்பிடவும்.',
'blockednoreason' => 'காரணம் தரப்படவில்லை',
'whitelistedittext' => 'நீங்கள் பக்கங்களத் தொகுக்க $1 செய்யவேண்டும்.',
'confirmedittext' => 'நீங்கள் பக்கங்களைத் தொகுக்க முன்னர் மின்னஞ்சல் முகவரியை உறுதிப்படுத்த வேண்டும். உங்கள் [[Special:Preferences|விருப்பத்தேர்வுகள்]] பக்கத்தில் செல்லுபடியான மின்னஞ்சலைக் கொடுத்து அதனை உறுதிப்படுத்துங்கள்.',
'noarticletext' => 'இப் பக்கத்தில் தற்பொழுது உள்ளடக்கம் எதுவுமில்லை. நீங்கள் இப்பக்க [[Special:Search/{{PAGENAME}}|தலைப்பை வேறு பக்கங்களில் தேடவோ]] அல்லது [{{fullurl:{{FULLPAGENAME}}|action=edit}} இப்பக்கத்தை தொகுக்கவோ] முடியும்.',
'noarticletext-nopermission' => 'தற்பொழுது இப்பக்கத்தில் உரை எதுவும் இல்லை.
நீங்கள் [[Special:Search/{{PAGENAME}}|பக்கத் தலைப்பை வைத்து]] அல்லது மற்ற பக்கங்களில்,
-or <span class="plainlinks">[{{fullurl:{{#Special:Log}}|page={{FULLPAGENAMEE}}}} அல்லது தேடுதல் தொடர்பான பதிவுகளில் தேடவும்.]</span>.',
+அல்லது <span class="plainlinks">[{{fullurl:{{#Special:Log}}|page={{FULLPAGENAMEE}}}} அல்லது தேடுதல் தொடர்பான பதிவுகளில் தேடலாம்.]</span>, ஆனால் இந்தப் பக்கத்தை உருவாக்க அனுமதியில்லை.',
'missing-revision' => "இந்த பரிசீலனை # $1 '' {{PAGENAME}}' பெயருள்ள பக்கத்தின் இல்லை.!N வேடிக்கையானN!இது தான் வழக்கமாக ஏற்பட்டிருக்கலாம் நீக்கப்பட்டுள்ளது பக்கத்திற்கு outdated வரலாறு இணைப்பை தொடர்ந்து.
விவரங்கள் முடியும் கண்டறிய, [{{fullurl: {{# சிறப்பு: குறிப்பேடு}} / delete|page = {{FULLPAGENAMEE}}}} நீக்குதல் குறிப்பேடு].",
'userpage-userdoesnotexist' => '"<nowiki>$1</nowiki>" என்றக் கணக்கு இன்னமும் பதிவுச் செய்யப்படவில்லை. இதை உருவாக்க/தொகுக்க வேண்டுமா என்பதை உறுதிப்படுத்தவும்.',
இப்பக்கம் ஏற்கனவே உள்ளது.',
'defaultmessagetext' => 'இயல்பிருப்பு தகவல் உரை',
+# Content models
+'content-model-wikitext' => 'விக்கிஉரை',
+'content-model-javascript' => 'ஜாவா ஸ்கிரிப்ட்',
+
# Parser/template warnings
'expensive-parserfunction-warning' => 'எச்சரிக்கை: இப்பக்கம் அதிகளவு இலக்கணப் பாகுபடுத்திச் சார்புகளைக் கொண்டுள்ளது.
# Preferences page
'preferences' => 'விருப்பங்கள்',
-'mypreferences' => 'à®\8eனà¯\8d விரà¯\81பà¯\8dபதà¯\8dதà¯\87à®°à¯\8dவà¯\81à®\95ளà¯\8d',
+'mypreferences' => 'விருப்பத்தேர்வுகள்',
'prefs-edits' => 'தொகுப்புகளின் எண்ணிக்கை:',
'prefsnologin' => 'புகுபதிகை செய்யப்படவில்லை',
'prefsnologintext' => 'பயனர் விருப்பத்தேர்வுகளை அமைப்பதற்கு நீங்கள் <span class="plainlinks">[{{fullurl:{{#Special:UserLogin}}|returnto=$1}} புகுபதிகை ]</span> செய்திருக்க வேண்டும்.',
# Watchlist
'watchlist' => 'என் கவனிப்புப் பட்டியல்',
-'mywatchlist' => 'à®\8eனà¯\8d à®\95வனிபà¯\8dபà¯\81பà¯\8d பà®\9fà¯\8dà®\9fியலà¯\8d',
+'mywatchlist' => 'கவனிப்புப் பட்டியல்',
'watchlistfor2' => '$1 பயனரின் ($2)',
'nowatchlist' => 'உங்களுடைய கவனிப்புப் பட்டியலில் ஒரு விடயமும் இல்லை.',
'watchlistanontext' => 'உங்கள் கவனிப்புப் பட்டியலைப் பார்க்க அல்லது தொகுக்க அருள் கூர்ந்து $1 செய்யுங்கள்.',
# Contributions
'contributions' => 'பயனர் பங்களிப்புக்கள்',
'contributions-title' => '$1 இற்கான பயனர் பங்களிப்புகள்',
-'mycontris' => 'à®\8eனà¯\8d பà®\99à¯\8dà®\95ளிபà¯\8dபà¯\81à®\95à¯\8dà®\95ளà¯\8d',
+'mycontris' => 'பங்களிப்புக்கள்',
'contribsub2' => '$1 பயனரின் ($2)',
'nocontribs' => 'இந்த நிபந்தனையுடன் ஒத்துப்போகும் வகையில் மாற்றங்களெதுவும் காணப்படவில்லை.',
'uctop' => '(மேல்)',
'whatlinkshere-hideredirs' => 'வழிமாற்றுகளை $1',
'whatlinkshere-hidetrans' => 'உள்ளிடப்பட்டவைகளை $1',
'whatlinkshere-hidelinks' => 'இணைப்புகள் $1',
-'whatlinkshere-hideimages' => '$1உருவ இணைப்புகள்',
+'whatlinkshere-hideimages' => '$1 கோப்பிணைப்புக்கள்',
'whatlinkshere-filters' => 'வடிகட்டிகள்',
# Block/unblock
'pageinfo-display-title' => 'காட்சித் தலைப்பு',
'pageinfo-length' => 'பக்க நீளம் (எண்ணுண்மிகளில்)',
'pageinfo-article-id' => 'பக்க அடையாள இலக்கம்',
+'pageinfo-language' => 'பக்க உள்ளடக்க மொழி',
'pageinfo-robot-policy' => 'தேடற்பொறி நிலைமை',
'pageinfo-views' => 'காட்சிகள் எண்ணிக்கை',
'pageinfo-watchers' => 'பார்வையாளர்கள் எண்ணிக்கை',
'pageinfo-firstuser' => 'பக்க உருவாக்குநர்',
'pageinfo-firsttime' => 'பக்கம் உருவாக்கப்பட்ட காலம்',
-'pageinfo-lastuser' => 'பிநà¯\8dதிய தொகுப்பாளர்',
+'pageinfo-lastuser' => 'à®\85ணà¯\8dà®®à¯\88ய தொகுப்பாளர்',
'pageinfo-edits' => 'தொகுப்புகளின் எண்ணிக்கை:',
'pageinfo-authors' => 'சாதகமான அம்சங்களை பெற்றிருக்கும் எழுத்தாளர்கள் எண்ணிக்கை',
+'pageinfo-redirectsto-info' => 'தகவல்',
+'pageinfo-contentpage-yes' => 'ஆம்',
+'pageinfo-protect-cascading-yes' => 'ஆம்',
# Skin names
'skinname-standard' => 'இயல்பான',
'duration-centuries' => '$1 {{PLURAL:$1|நூற்றாண்டு|நூற்றாண்டுகள்}}',
'duration-millennia' => '$1 {{PLURAL:$1|ஆயிரம் ஆண்டு|ஆயிரம் ஆண்டுகள்}}',
+# Unknown messages
+'mytalk-parenthetical' => 'பேச்சு',
);
* @author Jprmvnvijay5
* @author Kaganer
* @author Kiranmayee
+ * @author Malkum
* @author Meno25
* @author Mpradeep
* @author Praveen Illa
'underline-always' => 'Palagi',
'underline-never' => 'Hindi magpakailanman',
-'underline-default' => 'Tinakda ng pambasa-basa',
+'underline-default' => 'Tinakda ng pambasa-basa o balat',
# Font style option in Special:Preferences
'editfont-style' => 'Baguhin ang estilong pantitik ng lugar:',
'cancel' => 'Kanselahin',
'moredotdotdot' => 'Damihan pa...',
'mypage' => 'Pahina ko',
-'mytalk' => 'Usapan ko',
+'mytalk' => 'Usapan',
'anontalk' => 'Usapan para sa IP na ito',
'navigation' => 'Paglilibot (nabigasyon)',
'and' => ', at',
'note' => "'''Paunawa:'''",
'previewnote' => "'''Tandaan na isa lamang itong paunang tingin.'''
Hindi pa nasasagip ang mga binago mo!",
-'continue-editing' => 'Ipagpatuloy ang pamamatnugot',
+'continue-editing' => 'Pumunta sa pook ng pamamatnugot',
'previewconflict' => 'Ipinamamalas ng paunang tinging ito ang teksto sa loob ng pangitaas na pook-patnugutan ng teksto ayon sa lilitaw na anyo nito kapag pinili mo ang pagsagip.',
'session_fail_preview' => "'''Paumanhin! Hindi namin maproseso ang iyong pagbabago hinggil sa pagkawala ng sesyon ng datos.
Paki ulit muli. Kung hindi ito gumana, subukang umalis sa pagkalagda at bumalik muli.'''",
# Preferences page
'preferences' => 'Mga kagustuhan',
-'mypreferences' => 'Mga nais ko',
+'mypreferences' => 'Mga nais',
'prefs-edits' => 'Bilang ng mga pagbabago:',
'prefsnologin' => 'Hindi nakalagda/nakatala',
'prefsnologintext' => 'Kailangan mong <span class="plainlinks">[{{fullurl:{{#Special:UserLogin}}|returnto=$1}} lumagda/tumala]</span> para makapagtakda ng mga kagustuhang ng tagagamit.',
'timezoneregion-indian' => 'Karagatang Indyano',
'timezoneregion-pacific' => 'Karagatang Pasipiko',
'allowemail' => 'Pahintulutan ang e-liham mula sa ibang mga tagagamit',
-'prefs-searchoptions' => 'Mga pagpipilian para sa paghahanap',
+'prefs-searchoptions' => 'Paghahanap',
'prefs-namespaces' => 'Mga espasyo ng pangalan',
'defaultns' => 'O kaya maghanap sa mga pangalan ng espasyong ito:',
'default' => 'Likas na pagtatakda',
# Contributions
'contributions' => 'Mga ambag ng tagagamit',
'contributions-title' => 'Mga ambag ng tagagamit na si $1',
-'mycontris' => 'Mga ambag ko',
+'mycontris' => 'Mga ambag',
'contribsub2' => 'Para kay $1 ($2)',
'nocontribs' => 'Walang pagbabagong nakita sa binigay na kondisyon.',
'uctop' => ' (itaas)',
# Info page
'pageinfo-title' => 'Kabatiran para sa "$1"',
+'pageinfo-not-current' => 'Maaari lamang ipakita ang impormasyon para sa kasalukuyang rebisyon.',
'pageinfo-header-basic' => 'Saligang kabatiran',
'pageinfo-header-edits' => 'Kasaysayan ng pamamatnugot',
'pageinfo-header-restrictions' => 'Pruteksiyon ng pahina',
'cancel' => 'İptal',
'moredotdotdot' => 'Daha...',
'mypage' => 'Sayfa',
-'mytalk' => 'Tartışma',
+'mytalk' => 'Mesaj',
'anontalk' => "Bu IP'nin iletileri",
'navigation' => 'Gezinti',
'and' => ' ve',
'underline-always' => 'Кезээде',
'underline-never' => 'Кажан-даа',
-'underline-default' => 'Ð\92еб-браузерниң ниити үнези',
+'underline-default' => 'Ð\9aеÑ\88Ñ\82иң азÑ\8b веб-браузерниң ниити үнези',
# Font style option in Special:Preferences
'editfont-default' => 'Веб-браузерниң ниити үнези',
'newwindow' => '(чаа көзенээ ажыытынар)',
'cancel' => 'Соксаары',
'moredotdotdot' => 'Артык...',
-'mypage' => 'Ð\9cÑ\8dÑ\8dÒ£ аÑ\80Ñ\8bнÑ\8bм',
-'mytalk' => 'Ð\9cÑ\8dÑ\8dÒ£ Ñ\87Ñ\83гаам',
+'mypage' => 'Ð\90Ñ\80Ñ\8bн',
+'mytalk' => 'ЧÑ\83гаа',
'anontalk' => 'Бо ИП-адрестиң чугаазы',
'navigation' => 'Навигация',
'and' => ' болгаш',
'create' => 'Чогаадыры',
'editthispage' => 'Бо арынны өскертири',
'create-this-page' => 'Бо арынны чогаадыры',
-'delete' => 'ЫÑ\80адÑ\8bры',
+'delete' => 'ЫÑ\80аары',
'deletethispage' => 'Бо арынны ырадыры',
'undelete_short' => '$1 {{PLURAL:$1|эдигни|эдиглерни}} катап үндүрери',
'viewdeleted_short' => '{{PLURAL:$1|Бир ыраткан өскерлиишкинни|$1 ыраткан өскерлиишкиннерни}} көөрү',
'viewsource' => 'Дөзүн көөрү',
'actionthrottled' => 'Шеглээн дүрген',
'sqlhidden' => '(SQL айтырыгны чажырган)',
+'exception-nologin' => 'Кирбес',
# Login and logout pages
'welcomecreation' => '== Кирип моорлаңар, $1! ==
'resetpass-temp-password' => 'Түр чажыт сөс:',
# Special:PasswordReset
+'passwordreset' => 'Чажыт сөстү дүжүрү',
'passwordreset-legend' => 'Чажыт атты дүжүр',
'passwordreset-username' => 'Aжыглакчының ады:',
'passwordreset-domain' => 'Домен:',
'searchprofile-everything-tooltip' => 'Шупту арыннардан дилээри (сумележиишкиннерден база)',
'searchprofile-advanced-tooltip' => 'Айыткан аттар делгемнеринден дилээри',
'search-result-size' => '$1 ({{PLURAL:$2|$2 сөс}})',
+'search-result-category-size' => '{{PLURAL:$1|1 кежигүн|$1 кежигүн}} ({{PLURAL:$2|1 aдаккы бөлүк|$2 aдаккы бөлүк}}, {{PLURAL:$3|1 файл|$3 файл}})',
'search-redirect' => '($1-н шиглелге)',
'search-section' => '(«$1» деп салбыр)',
'search-suggest' => 'Силер «$1» деп бодадыңар чадавас',
# Preferences page
'preferences' => 'Шилилгелер',
-'mypreferences' => 'Ð\9cÑ\8dÑ\8dÒ£ Ñ\88илилгелеÑ\80им',
+'mypreferences' => 'ШилилгелеÑ\80',
'prefs-edits' => 'Өскерлиишкиннериңерниң саны:',
'changepassword' => 'Чажыт сөстү өскертири',
'prefs-skin' => 'Кеш',
# Watchlist
'watchlist' => 'Мээң хайгаарал даңзым',
-'mywatchlist' => 'Ð\9cÑ\8dÑ\8dÒ£ Ñ\85айгааÑ\80ал даңзÑ\8bм',
+'mywatchlist' => 'ХайгааÑ\80ал даңзÑ\8b',
'watchlistfor2' => '$1, силерге $2',
'nowatchlist' => 'Силерниң хайгаарал даңзыңар куруг.',
'watchnologin' => 'Кирбес',
# Contributions
'contributions' => 'Ажыглакчыниң салыышкыннары',
'contributions-title' => '«$1» деп ажыглакчының салыышкыннары',
-'mycontris' => 'Ð\9cÑ\8dÑ\8dÒ£ Ñ\81алÑ\8bÑ\8bÑ\88кÑ\8bннаÑ\80Ñ\8bм',
+'mycontris' => 'СалÑ\8bÑ\8bÑ\88кÑ\8bннаÑ\80',
'contribsub2' => '$1 ($2)',
'uctop' => '(баш)',
'month' => 'Айдан:',
'whatlinkshere-hideredirs' => '$1-че шиглиглер',
'whatlinkshere-hidetrans' => '$1 даңзылааннар',
'whatlinkshere-hidelinks' => 'холбааларны $1',
-'whatlinkshere-hideimages' => 'Файлдың холбаалары $1',
+'whatlinkshere-hideimages' => 'Файлдың холбааларын $1',
'whatlinkshere-filters' => 'Шүүрлер',
# Block/unblock
'duration-decades' => '$1 {{PLURAL:$1|он хонук|он хонук}}',
'duration-centuries' => '$1 {{PLURAL:$1|чүс чыл|чүс чыл}}',
+# Unknown messages
+'mytalk-parenthetical' => 'чугаалажыры',
);
'duration-centuries' => '$1 thế kỷ',
'duration-millennia' => '$1 thiên niên kỷ',
+# Unknown messages
+'mytalk-parenthetical' => 'thảo luận',
);
* @author Kuailong
* @author Liangent
* @author Linforest
+ * @author Makecat
* @author Mark85296341
* @author MarkAHershberger
* @author Mys 721tx
'underline-always' => '总是使用',
'underline-never' => '从不使用',
-'underline-default' => '浏览器默认',
+'underline-default' => '浏览器默认设置',
# Font style option in Special:Preferences
'editfont-style' => '编辑区字体样式:',
'cancel' => '取消',
'moredotdotdot' => '更多',
'mypage' => '页面',
-'mytalk' => '讨论页',
+'mytalk' => '讨论',
'anontalk' => '该IP地址的讨论',
'navigation' => '导航',
'and' => '和',
'vector-action-protect' => '保护',
'vector-action-undelete' => '恢复',
'vector-action-unprotect' => '更改保护',
-'vector-simplesearch-preference' => '启用简化搜索栏(仅适用Vector皮肤)',
+'vector-simplesearch-preference' => '启用简化搜索栏(仅Vector皮肤)',
'vector-view-create' => '创建',
'vector-view-edit' => '编辑',
'vector-view-history' => '查看历史',
'searcharticle' => '提交',
'history' => '页面历史',
'history_short' => '历史',
-'updatedmarker' => 'æ\88\91ä¸\8a次访é\97®ä»¥æ\9d¥ç\9a\84ä¿®æ\94¹',
+'updatedmarker' => 'æ\88\91ä¸\8a次访é\97®ä¹\8bå\90\8eç\9a\84æ\9b´æ\96°',
'printableversion' => '打印版本',
'permalink' => '永久链接',
'print' => '打印',
# Preferences page
'preferences' => '系统设置',
-'mypreferences' => '参数设置',
+'mypreferences' => '系统设置',
'prefs-edits' => '编辑数量:',
'prefsnologin' => '尚未登录',
'prefsnologintext' => '您必须先<span class="plainlinks">[{{fullurl:{{#Special:UserLogin}}|returnto=$1}} 登录]</span>才能设置个人参数。',
'linksearch-ns' => '名字空间:',
'linksearch-ok' => '搜索',
'linksearch-text' => '制作可以使用类似“*.wikipedia.org”的通配符。必须至少是顶级域名,例如“*.org”。<br />
-支持的协议:<code>$1</code>(不要包含在搜索中)。',
+支持的协议:<code>$1</code>(如果没有设置协议则默认为<nowiki>http://</nowiki>)。',
'linksearch-line' => '$1 链自 $2',
'linksearch-error' => '通配符仅可在主机名称的开头使用。',
'pageinfo-subpages-value' => '$1 ($2个重定向;$3个非重定向)',
'pageinfo-firstuser' => '页面创建者',
'pageinfo-firsttime' => '页面创建日期',
-'pageinfo-lastuser' => '最近的编者',
+'pageinfo-lastuser' => '最后编辑',
'pageinfo-lasttime' => '最后编辑的日期',
'pageinfo-edits' => '总编辑次数',
'pageinfo-authors' => '不同编者总计',
'pageinfo-contentpage-yes' => '是',
'pageinfo-protect-cascading' => '从这里开始连锁保护',
'pageinfo-protect-cascading-yes' => '是',
+'pageinfo-protect-cascading-from' => '保护级联自',
# Skin names
'skinname-standard' => '标准',
'nextdiff' => '下一编辑→',
# Media information
-'mediawarning' => "'''警告''':该文件类型可能包含恶意代码。
-运行它可能对您的系统带来危险。",
+'mediawarning' => "'''警告''':该文件类型可能含有恶意代码。执行后你的系统可能受损。",
'imagemaxsize' => '图像大小限制:<br /><u>(文件描述页)</u>',
'thumbsize' => '缩略图大小:',
'widthheightpage' => '$1×$2,$3页',
'exif-worldregiondest' => '世界区域显示',
'exif-countrydest' => '所示的国家',
'exif-countrycodedest' => '国家代码',
-'exif-provinceorstatedest' => '省或状态显示',
+'exif-provinceorstatedest' => '省或州',
'exif-citydest' => '所示的城市',
'exif-sublocationdest' => '显示城市中的详细地点',
'exif-objectname' => '简称',
'api-error-unknown-error' => '内部错误:尝试上传文件时出错。',
'api-error-unknown-warning' => '未知的警告:$1',
'api-error-unknownerror' => '未知错误:$1。',
-'api-error-uploaddisabled' => '此wiki关闭了上传功能。',
-'api-error-verification-error' => '此文件可能已损坏,或有错误的扩展名。',
+'api-error-uploaddisabled' => '该wiki停用上传。',
+'api-error-verification-error' => '该文件可能损坏或扩展名错误。',
# Durations
'duration-seconds' => '$1秒',
# User preference toggles
'tog-underline' => '連結加底線:',
'tog-justify' => '段落對齊',
-'tog-hideminor' => '最近更改中隱藏小修改',
-'tog-hidepatrolled' => '最近更改中隱藏巡查過的編輯',
-'tog-newpageshidepatrolled' => '新頁面清單中隱藏巡查過的頁面',
+'tog-hideminor' => '隱藏最近更改中的小修改',
+'tog-hidepatrolled' => '隱藏最近更改中巡查過的編輯',
+'tog-newpageshidepatrolled' => '隱藏新頁面清單中巡查過的頁面',
'tog-extendwatchlist' => '展開監視清單以顯示所有更改,不只是最近的',
'tog-usenewrc' => '在最近更改和監視列表中整合同一頁的修改 (需要JavaScript)',
'tog-numberheadings' => '標題自動編號',
'tog-watchlisthideliu' => '監視列表中隱藏登入用戶',
'tog-watchlisthideanons' => '監視列表中隱藏匿名用戶',
'tog-watchlisthidepatrolled' => '監視清單中隱藏已巡查的編輯',
-'tog-ccmeonemails' => '當我寄電子郵件給其他用戶時,也寄一份複本到我的信箱',
+'tog-ccmeonemails' => '當我寄電子郵件給其他用戶時,也寄一份副本到我的信箱',
'tog-diffonly' => '比較版本差異時不顯示頁面內容',
'tog-showhiddencats' => '顯示隱藏分類',
'tog-noconvertlink' => '不轉換連結標題',
'duration-centuries' => '$1世紀',
'duration-millennia' => '$1千年',
+# Unknown messages
+'mytalk-parenthetical' => '對話頁',
);
+++ /dev/null
-<?php
-/**
- * Check the autoloader
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- * @file
- * @ingroup Maintenance
- */
-
-require_once( __DIR__ . '/Maintenance.php' );
-
-/**
- * Maintenance script to check classes definitions in the autoloader.
- *
- * @ingroup Maintenance
- */
-class CheckAutoLoader extends Maintenance {
- public function __construct() {
- parent::__construct();
- $this->mDescription = "AutoLoader sanity checks";
- }
- public function execute() {
- global $wgAutoloadLocalClasses, $IP;
- $files = array_unique( $wgAutoloadLocalClasses );
-
- foreach ( $files as $file ) {
- if ( function_exists( 'parsekit_compile_file' ) ) {
- $parseInfo = parsekit_compile_file( "$IP/$file" );
- $classes = array_keys( $parseInfo['class_table'] );
- } else {
- $contents = file_get_contents( "$IP/$file" );
- $m = array();
- preg_match_all( '/\n\s*class\s+([a-zA-Z0-9_]+)/', $contents, $m, PREG_PATTERN_ORDER );
- $classes = $m[1];
- }
- foreach ( $classes as $class ) {
- if ( !isset( $wgAutoloadLocalClasses[$class] ) ) {
- // printf( "%-50s Unlisted, in %s\n", $class, $file );
- $this->output( "\t'$class' => '$file',\n" );
- } elseif ( $wgAutoloadLocalClasses[$class] !== $file ) {
- $this->output( "$class: Wrong file: found in $file, listed in " . $wgAutoloadLocalClasses[$class] . "\n" );
- }
- }
- }
- }
-}
-
-$maintClass = "CheckAutoLoader";
-require_once( RUN_MAINTENANCE_IF_MAIN );
* if the badge should overlay the parent element (default is inline)
*/
$.fn.badge = function ( text, inline ) {
- var div, $badge = this.find( '.mw-badge' );
+ var $badge = this.find( '.mw-badge' );
if ( text ) {
// If a badge already exists, reuse it
$badge.find( '.mw-badge-content' ).text( text );
} else {
// Otherwise, create a new badge with the specified text and style
- div = document.createElement( 'div' );
- div.className = 'mw-badge mw-badge-' + ( inline ? 'inline' : 'overlay' );
- div.innerHTML = '<span class="mw-badge-content">' + text + '</span>';
- $( div ).appendTo( this );
+ $badge = $( '<div class="mw-badge mw-badge-' + ( inline ? 'inline' : 'overlay' ) + '"></div>' )
+ .append( $( '<span class="mw-badge-content"></span>' ).text ( text ) )
+ .appendTo( this );
}
} else {
$badge.remove();
/**
* jQuery checkboxShiftClick
*
- * This will enable checkboxes to be checked or unchecked in a row by clicking one, holding shift and clicking another one
+ * This will enable checkboxes to be checked or unchecked in a row by clicking one,
+ * holding shift and clicking another one.
*
- * @author Krinkle <krinklemail@gmail.com>
+ * @author Timo Tijhof, 2011 - 2012
* @license GPL v2
*/
( function ( $ ) {
- $.fn.checkboxShiftClick = function ( text ) {
- var prevCheckbox = null, $box = this;
+ $.fn.checkboxShiftClick = function () {
+ var prevCheckbox = null,
+ $box = this;
// When our boxes are clicked..
$box.click( function ( e ) {
// And one has been clicked before...
// Use the cached version if possible
if ( profileCache[nav.userAgent] === undefined ) {
- /* Configuration */
-
- // Name of browsers or layout engines we don't recognize
- var uk = 'unknown';
- // Generic version digit
- var x = 'x';
- // Strings found in user agent strings that need to be conformed
- var wildUserAgents = ['Opera', 'Navigator', 'Minefield', 'KHTML', 'Chrome', 'PLAYSTATION 3'];
- // Translations for conforming user agent strings
- var userAgentTranslations = [
- // Tons of browsers lie about being something they are not
- [/(Firefox|MSIE|KHTML,\slike\sGecko|Konqueror)/, ''],
- // Chrome lives in the shadow of Safari still
- ['Chrome Safari', 'Chrome'],
- // KHTML is the layout engine not the browser - LIES!
- ['KHTML', 'Konqueror'],
- // Firefox nightly builds
- ['Minefield', 'Firefox'],
- // This helps keep differnt versions consistent
- ['Navigator', 'Netscape'],
- // This prevents version extraction issues, otherwise translation would happen later
- ['PLAYSTATION 3', 'PS3']
- ];
- // Strings which precede a version number in a user agent string - combined and used as match 1 in
- // version detectection
- var versionPrefixes = [
- 'camino', 'chrome', 'firefox', 'netscape', 'netscape6', 'opera', 'version', 'konqueror',
- 'lynx', 'msie', 'safari', 'ps3'
- ];
- // Used as matches 2, 3 and 4 in version extraction - 3 is used as actual version number
- var versionSuffix = '(\\/|\\;?\\s|)([a-z0-9\\.\\+]*?)(\\;|dev|rel|\\)|\\s|$)';
- // Names of known browsers
- var names = [
- 'camino', 'chrome', 'firefox', 'netscape', 'konqueror', 'lynx', 'msie', 'opera',
- 'safari', 'ipod', 'iphone', 'blackberry', 'ps3', 'rekonq'
- ];
- // Tanslations for conforming browser names
- var nameTranslations = [];
- // Names of known layout engines
- var layouts = ['gecko', 'konqueror', 'msie', 'opera', 'webkit'];
- // Translations for conforming layout names
- var layoutTranslations = [['konqueror', 'khtml'], ['msie', 'trident'], ['opera', 'presto']];
- // Names of supported layout engines for version number
- var layoutVersions = ['applewebkit', 'gecko'];
- // Names of known operating systems
- var platforms = ['win', 'mac', 'linux', 'sunos', 'solaris', 'iphone'];
- // Translations for conforming operating system names
- var platformTranslations = [['sunos', 'solaris']];
-
- /* Methods */
-
- /**
- * Performs multiple replacements on a string
- */
- var translate = function ( source, translations ) {
- var i;
- for ( i = 0; i < translations.length; i++ ) {
- source = source.replace( translations[i][0], translations[i][1] );
- }
- return source;
- };
-
- /* Pre-processing */
-
- var ua = nav.userAgent,
+ var
+ versionNumber,
+
+ /* Configuration */
+
+ // Name of browsers or layout engines we don't recognize
+ uk = 'unknown',
+ // Generic version digit
+ x = 'x',
+ // Strings found in user agent strings that need to be conformed
+ wildUserAgents = ['Opera', 'Navigator', 'Minefield', 'KHTML', 'Chrome', 'PLAYSTATION 3'],
+ // Translations for conforming user agent strings
+ userAgentTranslations = [
+ // Tons of browsers lie about being something they are not
+ [/(Firefox|MSIE|KHTML,\slike\sGecko|Konqueror)/, ''],
+ // Chrome lives in the shadow of Safari still
+ ['Chrome Safari', 'Chrome'],
+ // KHTML is the layout engine not the browser - LIES!
+ ['KHTML', 'Konqueror'],
+ // Firefox nightly builds
+ ['Minefield', 'Firefox'],
+ // This helps keep differnt versions consistent
+ ['Navigator', 'Netscape'],
+ // This prevents version extraction issues, otherwise translation would happen later
+ ['PLAYSTATION 3', 'PS3']
+ ],
+ // Strings which precede a version number in a user agent string - combined and used as match 1 in
+ // version detectection
+ versionPrefixes = [
+ 'camino', 'chrome', 'firefox', 'netscape', 'netscape6', 'opera', 'version', 'konqueror',
+ 'lynx', 'msie', 'safari', 'ps3'
+ ],
+ // Used as matches 2, 3 and 4 in version extraction - 3 is used as actual version number
+ versionSuffix = '(\\/|\\;?\\s|)([a-z0-9\\.\\+]*?)(\\;|dev|rel|\\)|\\s|$)',
+ // Names of known browsers
+ names = [
+ 'camino', 'chrome', 'firefox', 'netscape', 'konqueror', 'lynx', 'msie', 'opera',
+ 'safari', 'ipod', 'iphone', 'blackberry', 'ps3', 'rekonq'
+ ],
+ // Tanslations for conforming browser names
+ nameTranslations = [],
+ // Names of known layout engines
+ layouts = ['gecko', 'konqueror', 'msie', 'opera', 'webkit'],
+ // Translations for conforming layout names
+ layoutTranslations = [ ['konqueror', 'khtml'], ['msie', 'trident'], ['opera', 'presto'] ],
+ // Names of supported layout engines for version number
+ layoutVersions = ['applewebkit', 'gecko'],
+ // Names of known operating systems
+ platforms = ['win', 'mac', 'linux', 'sunos', 'solaris', 'iphone'],
+ // Translations for conforming operating system names
+ platformTranslations = [ ['sunos', 'solaris'] ],
+
+ /* Methods */
+
+ /**
+ * Performs multiple replacements on a string
+ */
+ translate = function ( source, translations ) {
+ var i;
+ for ( i = 0; i < translations.length; i++ ) {
+ source = source.replace( translations[i][0], translations[i][1] );
+ }
+ return source;
+ },
+
+ /* Pre-processing */
+
+ ua = nav.userAgent,
match,
name = uk,
layout = uk,
if ( name === 'opera' && version >= 9.8) {
version = ua.match( /version\/([0-9\.]*)/i )[1] || 10;
}
- var versionNumber = parseFloat( version, 10 ) || 0.0;
+ versionNumber = parseFloat( version, 10 ) || 0.0;
/* Caching */
* @return Boolean true if browser known or assumed to be supported, false if blacklisted
*/
test: function ( map, profile ) {
- /*jshint evil:true */
+ /*jshint evil: true */
var conditions, dir, i, op, val;
profile = $.isPlainObject( profile ) ? profile : $.client.profile();
}
return $settings;
},
- handleResize: function ( e ) {
+ /**
+ * @param {jQuery.Event} e
+ */
+ handleResize: function () {
$.collapsibleTabs.instances.each( function () {
var $el = $( this ),
data = $.collapsibleTabs.getSettings( $el );
* @return Array The HSL representation
*/
rgbToHsl: function ( R, G, B ) {
- var r = R / 255,
+ var d,
+ r = R / 255,
g = G / 255,
- b = B / 255;
- var max = Math.max( r, g, b ), min = Math.min( r, g, b );
- var h, s, l = (max + min) / 2;
+ b = B / 255,
+ max = Math.max( r, g, b ), min = Math.min( r, g, b ),
+ h,
+ s,
+ l = (max + min) / 2;
if ( max === min ) {
// achromatic
h = s = 0;
} else {
- var d = max - min;
+ d = max - min;
s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
switch ( max ) {
case r:
* @return Array The RGB representation
*/
hslToRgb: function ( h, s, l ) {
- var r, g, b;
+ var r, g, b, hue2rgb, q, p;
if ( s === 0 ) {
r = g = b = l; // achromatic
} else {
- var hue2rgb = function ( p, q, t ) {
+ hue2rgb = function ( p, q, t ) {
if ( t < 0 ) {
t += 1;
}
return p;
};
- var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
- var p = 2 * l - q;
+ q = l < 0.5 ? l * (1 + s) : l + s - l * s;
+ p = 2 * l - q;
r = hue2rgb( p, q, h + 1/3 );
g = hue2rgb( p, q, h );
b = hue2rgb( p, q, h - 1/3 );
context = {
config: {
// callback function for before collapse
- beforeCondense: function ( context ) {},
+ beforeCondense: function () {},
// callback function for before expand
- beforeExpand: function ( context ) {},
+ beforeExpand: function () {},
// callback function for after collapse
- afterCondense: function ( context ) {},
+ afterCondense: function () {},
// callback function for after expand
- afterExpand: function ( context ) {},
+ afterExpand: function () {},
// Whether the field should expand to the left or the right -- defaults to left
expandToLeft: true
if ( bits.length > 1 && bits[1].charAt( bits[1].length - 1 ) === 'x' ) {
ratioStr = bits[1].substr( 0, bits[1].length - 1 );
ratio = parseFloat( ratioStr );
- if ( ratio > devicePixelRatio ) {
- // Too big, skip!
- } else if ( ratio > selectedRatio ) {
+ if ( ratio <= devicePixelRatio && ratio > selectedRatio ) {
selectedRatio = ratio;
selectedSrc = src;
}
// non latin characters can make regex think a new word has begun: do not use \b
// http://stackoverflow.com/questions/3787072/regex-wordwrap-with-utf8-characters-in-js
// look for an occurrence of our pattern and store the starting position
- match = node.data.match( new RegExp( "(^|\\s)" + $.escapeRE( pat ), "i" ) );
+ match = node.data.match( new RegExp( '(^|\\s)' + $.escapeRE( pat ), 'i' ) );
if ( match ) {
pos = match.index + match[1].length; // include length of any matched spaces
// create the span wrapper for the matched text
/**
* JavaScript to show jump links to motor-impaired users when they are focused.
*/
-jQuery( function( $ ) {
+jQuery( function ( $ ) {
- $('.mw-jump').delegate( 'a', 'focus blur', function( e ) {
- // Confusingly jQuery leaves e.type as "focusout" for delegated blur events
- if ( e.type === "blur" || e.type === "focusout" ) {
- $( this ).closest( '.mw-jump' ).css({ height: '0' });
+ $( '.mw-jump' ).on( 'focus blur', 'a', function ( e ) {
+ // Confusingly jQuery leaves e.type as focusout for delegated blur events
+ if ( e.type === 'blur' || e.type === 'focusout' ) {
+ $( this ).closest( '.mw-jump' ).css({ height: 0 });
} else {
$( this ).closest( '.mw-jump' ).css({ height: 'auto' });
}
return str.charAt( 0 ).toUpperCase() + str.substr( 1 );
},
escapeRE: function ( str ) {
- return str.replace ( /([\\{}()|.?*+\-\^$\[\]])/g, "\\$1" );
+ return str.replace ( /([\\{}()|.?*+\-\^$\[\]])/g, '\\$1' );
},
isDomElement: function ( el ) {
return !!el && !!el.nodeType;
},
isEmpty: function ( v ) {
+ var key;
if ( v === '' || v === 0 || v === '0' || v === null
|| v === false || v === undefined )
{
return true;
}
if ( typeof v === 'object' ) {
- for ( var key in v ) {
+ for ( key in v ) {
return false;
}
return true;
/*global jQuery, QUnit */
/*jshint eqeqeq:false, eqnull:false, forin:false */
( function ( $ ) {
- "use strict";
+ 'use strict';
var util,
hasOwn = Object.prototype.hasOwnProperty,
*
* Options:
*
- * fetch(query): Callback that should fetch suggestions and set the suggestions property. Executed in the context of the
- * textbox
+ * fetch(query): Callback that should fetch suggestions and set the suggestions property.
+ * Executed in the context of the textbox
* Type: Function
- * cancel: Callback function to call when any pending asynchronous suggestions fetches should be canceled.
- * Executed in the context of the textbox
+ * cancel: Callback function to call when any pending asynchronous suggestions fetches
+ * should be canceled. Executed in the context of the textbox
* Type: Function
* special: Set of callbacks for rendering and selecting
* Type: Object of Functions 'render' and 'select'
* Type: Number, Range: 0 - 1200, Default: 120
* submitOnClick: Whether to submit the form containing the textbox when a suggestion is clicked
* Type: Boolean, Default: false
- * maxExpandFactor: Maximum suggestions box width relative to the textbox width. If set to e.g. 2, the suggestions box
- * will never be grown beyond 2 times the width of the textbox.
+ * maxExpandFactor: Maximum suggestions box width relative to the textbox width. If set
+ * to e.g. 2, the suggestions box will never be grown beyond 2 times the width of the textbox.
* Type: Number, Range: 1 - infinity, Default: 3
* expandFrom: Which direction to offset the suggestion box from.
- * Values 'start' and 'end' translate to left and right respectively depending on the directionality
- * of the current document, according to $( 'html' ).css( 'direction' ).
+ * Values 'start' and 'end' translate to left and right respectively depending on the
+ * directionality of the current document, according to $( 'html' ).css( 'direction' ).
* Type: String, default: 'auto', options: 'left', 'right', 'start', 'end', 'auto'.
* positionFromLeft: Sets expandFrom=left, for backwards compatibility
* Type: Boolean, Default: true
context.config.cancel.call( context.data.$textbox );
}
},
+
/**
- * Restore the text the user originally typed in the textbox, before it was overwritten by highlight(). This
- * restores the value the currently displayed suggestions are based on, rather than the value just before
+ * Restore the text the user originally typed in the textbox, before it
+ * was overwritten by highlight(). This restores the value the currently
+ * displayed suggestions are based on, rather than the value just before
* highlight() overwrote it; the former is arguably slightly more sensible.
*/
restore: function ( context ) {
context.data.$textbox.val( context.data.prevText );
},
+
/**
- * Ask the user-specified callback for new suggestions. Any previous delayed call to this function still pending
- * will be canceled. If the value in the textbox is empty or hasn't changed since the last time suggestions were fetched, this
- * function does nothing.
+ * Ask the user-specified callback for new suggestions. Any previous delayed
+ * call to this function still pending will be canceled. If the value in the
+ * textbox is empty or hasn't changed since the last time suggestions were fetched,
+ * this function does nothing.
* @param {Boolean} delayed Whether or not to delay this by the currently configured amount of time
*/
update: function ( context, delayed ) {
}
$.suggestions.special( context );
},
+
special: function ( context ) {
// Allow custom rendering - but otherwise don't do any rendering
if ( typeof context.config.special.render === 'function' ) {
}, 1 );
}
},
+
/**
* Sets the value of a property, and updates the widget accordingly
* @param property String Name of property
* @param value Mixed Value to set property with
*/
configure: function ( context, property, value ) {
- var newCSS;
+ var newCSS,
+ $autoEllipseMe, $result, $results, $span,
+ i, expWidth, matchedText, maxWidth, text;
+
// Validate creation using fallback values
switch( property ) {
case 'fetch':
}
context.data.$container.css( newCSS );
- var $results = context.data.$container.children( '.suggestions-results' );
+ $results = context.data.$container.children( '.suggestions-results' );
$results.empty();
- var expWidth = -1;
- var $autoEllipseMe = $( [] );
- var matchedText = null;
- for ( var i = 0; i < context.config.suggestions.length; i++ ) {
+ expWidth = -1;
+ $autoEllipseMe = $( [] );
+ matchedText = null;
+ for ( i = 0; i < context.config.suggestions.length; i++ ) {
/*jshint loopfunc:true */
- var text = context.config.suggestions[i];
- var $result = $( '<div>' )
+ text = context.config.suggestions[i];
+ $result = $( '<div>' )
.addClass( 'suggestions-result' )
.attr( 'rel', i )
.data( 'text', context.config.suggestions[i] )
- .mousemove( function ( e ) {
+ .mousemove( function () {
context.data.selectedWithMouse = true;
$.suggestions.highlight(
- context, $(this).closest( '.suggestions-results div' ), false
+ context,
+ $(this).closest( '.suggestions-results div' ),
+ false
);
} )
.appendTo( $results );
// Widen results box if needed
// New width is only calculated here, applied later
- var $span = $result.children( 'span' );
+ $span = $result.children( 'span' );
if ( $span.outerWidth() > $result.width() && $span.outerWidth() > expWidth ) {
// factor in any padding, margin, or border space on the parent
expWidth = $span.outerWidth() + ( context.data.$container.width() - $span.parent().width());
}
// Apply new width for results box, if any
if ( expWidth > context.data.$container.width() ) {
- var maxWidth = context.config.maxExpandFactor*context.data.$textbox.width();
+ maxWidth = context.config.maxExpandFactor*context.data.$textbox.width();
context.data.$container.width( Math.min( expWidth, maxWidth ) );
}
// autoEllipse the results. Has to be done after changing the width
- $autoEllipseMe.autoEllipsis( { hasSpan: true, tooltip: true, matchText: matchedText } );
+ $autoEllipseMe.autoEllipsis( {
+ hasSpan: true,
+ tooltip: true,
+ matchText: matchedText
+ } );
}
}
break;
break;
}
},
+
/**
* Highlight a result in the results table
* @param result <tr> to highlight: jQuery object, or 'prev' or 'next'
context.data.$textbox.trigger( 'change' );
}
},
+
/**
* Respond to keypress event
* @param key Integer Code of key pressed
*/
keypress: function ( e, context, key ) {
- var wasVisible = context.data.$container.is( ':visible' ),
+ var selected,
+ wasVisible = context.data.$container.is( ':visible' ),
preventDefault = false;
+
switch ( key ) {
// Arrow down
case 40:
case 13:
context.data.$container.hide();
preventDefault = wasVisible;
- var selected = context.data.$container.find( '.suggestions-result-current' );
+ selected = context.data.$container.find( '.suggestions-result-current' );
if ( selected.length === 0 || context.data.selectedWithMouse ) {
// if nothing is selected OR if something was selected with the mouse,
// cancel any current requests and submit the form
if ( context === undefined || context === null ) {
context = {
config: {
- 'fetch' : function () {},
- 'cancel': function () {},
- 'special': {},
- 'result': {},
- '$region': $(this),
- 'suggestions': [],
- 'maxRows': 7,
- 'delay': 120,
- 'submitOnClick': false,
- 'maxExpandFactor': 3,
- 'expandFrom': 'auto',
- 'highlightInput': false
+ fetch: function () {},
+ cancel: function () {},
+ special: {},
+ result: {},
+ $region: $(this),
+ suggestions: [],
+ maxRows: 7,
+ delay: 120,
+ submitOnClick: false,
+ maxExpandFactor: 3,
+ expandFrom: 'auto',
+ highlightInput: false
}
};
}
.addClass( 'suggestions' )
.append(
$( '<div>' ).addClass( 'suggestions-results' )
- // Can't use click() because the container div is hidden when the textbox loses focus. Instead,
- // listen for a mousedown followed by a mouseup on the same div
+ // Can't use click() because the container div is hidden when the
+ // textbox loses focus. Instead, listen for a mousedown followed
+ // by a mouseup on the same div.
.mousedown( function ( e ) {
context.data.mouseDownOn = $( e.target ).closest( '.suggestions-results div' );
} )
.mouseup( function ( e ) {
- var $result = $( e.target ).closest( '.suggestions-results div' );
- var $other = context.data.mouseDownOn;
+ var $result = $( e.target ).closest( '.suggestions-results div' ),
+ $other = context.data.mouseDownOn;
+
context.data.mouseDownOn = $( [] );
if ( $result.get( 0 ) !== $other.get( 0 ) ) {
return;
)
.append(
$( '<div>' ).addClass( 'suggestions-special' )
- // Can't use click() because the container div is hidden when the textbox loses focus. Instead,
- // listen for a mousedown followed by a mouseup on the same div
+ // Can't use click() because the container div is hidden when the
+ // textbox loses focus. Instead, listen for a mousedown followed
+ // by a mouseup on the same div.
.mousedown( function ( e ) {
context.data.mouseDownOn = $( e.target ).closest( '.suggestions-special' );
} )
.mouseup( function ( e ) {
- var $special = $( e.target ).closest( '.suggestions-special' );
- var $other = context.data.mouseDownOn;
+ var $special = $( e.target ).closest( '.suggestions-special' ),
+ $other = context.data.mouseDownOn;
+
context.data.mouseDownOn = $( [] );
if ( $special.get( 0 ) !== $other.get( 0 ) ) {
return;
}
$.fn.textSelection = function ( command, options ) {
+ var fn,
+ context,
+ hasIframe,
+ needSave,
+ retval;
/**
* Helper function to get an IE TextRange object for an element
}
}
- var fn = {
+ fn = {
/**
* Get the contents of the textarea
*/
range2.collapse();
range2.moveStart( 'character', -1 );
// FIXME: Which check is correct?
- if ( range2.text !== "\r" && range2.text !== "\n" && range2.text !== "" ) {
- insertText = "\n" + insertText;
- pre += "\n";
+ if ( range2.text !== '\r' && range2.text !== '\n' && range2.text !== '' ) {
+ insertText = '\n' + insertText;
+ pre += '\n';
}
range3 = document.selection.createRange();
range3.collapse( false );
range3.moveEnd( 'character', 1 );
- if ( range3.text !== "\r" && range3.text !== "\n" && range3.text !== "" ) {
- insertText += "\n";
- post += "\n";
+ if ( range3.text !== '\r' && range3.text !== '\n' && range3.text !== '' ) {
+ insertText += '\n';
+ post += '\n';
}
}
insertText = doSplitLines( selText, pre, post );
}
if ( options.ownline ) {
- if ( startPos !== 0 && this.value.charAt( startPos - 1 ) !== "\n" && this.value.charAt( startPos - 1 ) !== "\r" ) {
- insertText = "\n" + insertText;
- pre += "\n";
+ if ( startPos !== 0 && this.value.charAt( startPos - 1 ) !== '\n' && this.value.charAt( startPos - 1 ) !== '\r' ) {
+ insertText = '\n' + insertText;
+ pre += '\n';
}
- if ( this.value.charAt( endPos ) !== "\n" && this.value.charAt( endPos ) !== "\r" ) {
- insertText += "\n";
- post += "\n";
+ if ( this.value.charAt( endPos ) !== '\n' && this.value.charAt( endPos ) !== '\r' ) {
+ insertText += '\n';
+ post += '\n';
}
}
this.value = this.value.substring( 0, startPos ) + insertText +
// Setting this.value scrolls the textarea to the top, restore the scroll position
this.scrollTop = scrollTop;
if ( window.opera ) {
- pre = pre.replace( /\r?\n/g, "\r\n" );
- selText = selText.replace( /\r?\n/g, "\r\n" );
- post = post.replace( /\r?\n/g, "\r\n" );
+ pre = pre.replace( /\r?\n/g, '\r\n' );
+ selText = selText.replace( /\r?\n/g, '\r\n' );
+ post = post.replace( /\r?\n/g, '\r\n' );
}
if ( isSample && options.selectPeri && !options.splitlines ) {
this.selectionStart = startPos + pre.length;
*/
getCaretPosition: function ( options ) {
function getCaret( e ) {
- var caretPos = 0, endPos = 0;
+ var caretPos = 0,
+ endPos = 0,
+ preText, rawPreText, periText,
+ rawPeriText, postText, rawPostText,
+ // IE Support
+ preFinished,
+ periFinished,
+ postFinished,
+ // Range containing text in the selection
+ periRange,
+ // Range containing text before the selection
+ preRange,
+ // Range containing text after the selection
+ postRange;
+
if ( document.selection && document.selection.createRange ) {
// IE doesn't properly report non-selected caret position through
// the selection ranges when textarea isn't focused. This can
// whatever we do later (bug 31847).
activateElementOnIE( e );
- var
- preText, rawPreText, periText,
- rawPeriText, postText, rawPostText,
-
- // IE Support
- preFinished = false,
- periFinished = false,
- postFinished = false,
- // Range containing text in the selection
- periRange = document.selection.createRange().duplicate(),
- // Range containing text before the selection
- preRange,
- // Range containing text after the selection
- postRange;
+ preFinished = false;
+ periFinished = false;
+ postFinished = false;
+ periRange = document.selection.createRange().duplicate();
preRange = rangeForElementIE( e ),
// Move the end where we need it
} else {
preRange.moveEnd( 'character', -1 );
if ( preRange.text === preText ) {
- rawPreText += "\r\n";
+ rawPreText += '\r\n';
} else {
preFinished = true;
}
} else {
periRange.moveEnd( 'character', -1 );
if ( periRange.text === periText ) {
- rawPeriText += "\r\n";
+ rawPeriText += '\r\n';
} else {
periFinished = true;
}
} else {
postRange.moveEnd( 'character', -1 );
if ( postRange.text === postText ) {
- rawPostText += "\r\n";
+ rawPostText += '\r\n';
} else {
postFinished = true;
}
}
}
} while ( ( !preFinished || !periFinished || !postFinished ) );
- caretPos = rawPreText.replace( /\r\n/g, "\n" ).length;
- endPos = caretPos + rawPeriText.replace( /\r\n/g, "\n" ).length;
+ caretPos = rawPreText.replace( /\r\n/g, '\n' ).length;
+ endPos = caretPos + rawPeriText.replace( /\r\n/g, '\n' ).length;
} else if ( e.selectionStart || e.selectionStart === 0 ) {
// Firefox support
caretPos = e.selectionStart;
return Math.floor( e.scrollWidth / ( $.client.profile().platform === 'linux' ? 7 : 8 ) );
}
function getCaretScrollPosition( e ) {
- var i, j;
// FIXME: This functions sucks and is off by a few lines most
// of the time. It should be replaced by something decent.
- var text = e.value.replace( /\r/g, '' );
- var caret = $( e ).textSelection( 'getCaretPosition' );
- var lineLength = getLineLength( e );
- var row = 0;
- var charInLine = 0;
- var lastSpaceInLine = 0;
+ var i, j,
+ nextSpace,
+ text = e.value.replace( /\r/g, '' ),
+ caret = $( e ).textSelection( 'getCaretPosition' ),
+ lineLength = getLineLength( e ),
+ row = 0,
+ charInLine = 0,
+ lastSpaceInLine = 0;
+
for ( i = 0; i < caret; i++ ) {
charInLine++;
if ( text.charAt( i ) === ' ' ) {
lastSpaceInLine = charInLine;
- } else if ( text.charAt( i ) === "\n" ) {
+ } else if ( text.charAt( i ) === '\n' ) {
lastSpaceInLine = 0;
charInLine = 0;
row++;
}
}
}
- var nextSpace = 0;
+ nextSpace = 0;
for ( j = caret; j < caret + lineLength; j++ ) {
if (
text.charAt( j ) === ' ' ||
- text.charAt( j ) === "\n" ||
+ text.charAt( j ) === '\n' ||
caret === text.length
) {
nextSpace = j;
break;
}
- var context = $(this).data( 'wikiEditor-context' );
- var hasIframe = typeof context !== 'undefined' && context && typeof context.$iframe !== 'undefined';
+ context = $(this).data( 'wikiEditor-context' );
+ hasIframe = context !== undefined && context && context.$iframe !== undefined;
// IE selection restore voodoo
- var needSave = false;
+ needSave = false;
if ( hasIframe && context.savedSelection !== null ) {
context.fn.restoreSelection();
needSave = true;
}
- var retval = ( hasIframe ? context.fn : fn )[command].call( this, options );
+ retval = ( hasIframe ? context.fn : fn )[command].call( this, options );
if ( hasIframe && needSave ) {
context.fn.saveSelection();
}
* Apply tagOpen/tagClose to selection in textarea,
* use sampleText instead of selection if there is none.
*/
- insertTags: function ( tagOpen, tagClose, sampleText, selectText ) {
+ insertTags: function ( tagOpen, tagClose, sampleText ) {
if ( currentFocused && currentFocused.length ) {
currentFocused.textSelection(
'encapsulateSelection', {
/*
** Diff rendering
*/
-table.diff, td.diff-otitle, td.diff-ntitle {
+table.diff {
background-color: white;
+ border: none;
+ border-spacing: 4px;
+ margin: 0;
+ width: 100%;
+ /* Ensure that colums are of equal width */
+ table-layout: fixed;
+}
+
+table.diff td {
+ padding: 0.33em 0.5em;
+}
+
+table.diff td.diff-marker {
+ /* Compensate padding for increased font-size */
+ padding: 0.25em;
+}
+
+table.diff col.diff-marker {
+ width: 2%;
+}
+
+table.diff col.diff-content {
+ width: 48%;
+}
+
+table.diff td div {
+ /* Force-wrap very long lines such as URLs or page-widening char strings */
+ word-wrap: break-word;
}
td.diff-otitle,
text-align: center;
}
-td.diff-marker {
- text-align: right;
+td.diff-lineno {
font-weight: bold;
- font-size: 1.25em;
}
-td.diff-lineno {
+td.diff-marker {
+ text-align: right;
font-weight: bold;
+ font-size: 1.25em;
}
td.diff-addedline,
vertical-align: top;
white-space: -moz-pre-wrap;
white-space: pre-wrap;
-}
-
-td.diff-addedline,
-td.diff-deletedline {
border-style: solid;
border-width: 1px 1px 1px 4px;
border-radius: 0.33em;
}
td.diff-context {
- background: #f3f3f3;
- color: #333333;
- border-style: solid;
- border-width: 1px 1px 1px 4px;
+ background: #f9f9f9;
border-color: #e6e6e6;
- border-radius: 0.33em;
+ color: #333333;
}
.diffchange {
text-decoration: none;
}
-table.diff {
- border: none;
- width: 98%;
- border-spacing: 4px;
-
- /* Ensure that colums are of equal width */
- table-layout: fixed;
-}
-
td.diff-addedline .diffchange,
td.diff-deletedline .diffchange {
border-radius: 0.33em;
td.diff-deletedline .diffchange {
background: #feeec8;
}
-
-table.diff td {
- padding: 0.33em 0.66em;
-}
-
-table.diff col.diff-marker {
- width: 2%;
-}
-
-table.diff col.diff-content {
- width: 48%;
-}
-
-table.diff td div {
- /* Force-wrap very long lines such as URLs or page-widening char strings.*/
- word-wrap: break-word;
-
- /* As fallback (FF<3.5, Opera <10.5), scrollbars will be added for very wide cells
- instead of text overflowing or widening
- */
- overflow: auto;
-}
/**
- * CLDR related utility methods
+ * CLDR related utility methods.
*/
-( function( mw ) {
- "use strict";
+( function ( mw ) {
+ 'use strict';
var cldr = {
/**
* In case none of the rules passed, we return pluralRules.length
* That means it is the "other" form.
* @param number
- * @param pluralRules
- * @return plural form index
+ * @param {Array} pluralRules
+ * @return {number} plural form index
*/
- getPluralForm: function( number, pluralRules ) {
- var pluralFormIndex = 0;
- for ( pluralFormIndex = 0; pluralFormIndex < pluralRules.length; pluralFormIndex++ ) {
- if ( mw.libs.pluralRuleParser( pluralRules[pluralFormIndex], number ) ) {
+ getPluralForm: function ( number, pluralRules ) {
+ var i;
+ for ( i = 0; i < pluralRules.length; i++ ) {
+ if ( mw.libs.pluralRuleParser( pluralRules[i], number ) ) {
break;
}
}
- return pluralFormIndex;
+ return i;
}
};
mw.cldr = cldr;
-} )( mediaWiki );
+
+}( mediaWiki ) );
* Base language object with methods for storing and getting
* language data.
*/
-( function ( mw, $ ) {
+( function ( mw ) {
var language = {
/**
mw.language = language;
-}( mediaWiki, jQuery ) );
+}( mediaWiki ) );
* @param forms array List of plural forms
* @return string Correct form for quantifier in this language
*/
- convertPlural: function( count, forms ) {
- var pluralFormIndex = 0;
+ convertPlural: function ( count, forms ) {
+ var pluralRules,
+ pluralFormIndex = 0;
+
if ( !forms || forms.length === 0 ) {
return '';
}
- var pluralRules = mw.language.getData( mw.config.get( 'wgUserLanguage' ), 'pluralRules' );
+ pluralRules = mw.language.getData( mw.config.get( 'wgUserLanguage' ), 'pluralRules' );
if ( !pluralRules ) {
// default fallback.
return ( count === 1 ) ? forms[0] : forms[1];
* @param {num} number Value to be converted
* @param {boolean} integer Convert the return value to an integer
*/
- convertNumber: function( num, integer ) {
- var i, tmp, transformTable;
+ convertNumber: function ( num, integer ) {
+ var i, tmp, transformTable, numberString, convertedNumber;
if ( !mw.language.digitTransformTable ) {
return num;
}
transformTable = tmp;
}
- var numberString = '' + num;
- var convertedNumber = '';
+ numberString = '' + num;
+ convertedNumber = '';
for ( i = 0; i < numberString.length; i++ ) {
if ( transformTable[ numberString[i] ] ) {
convertedNumber += transformTable[numberString[i]];
*
* @return string
*/
- gender: function( gender, forms ) {
+ gender: function ( gender, forms ) {
if ( !forms || forms.length === 0 ) {
return '';
}
-jQuery( document ).ready( function( $ ) {
+( function ( mw, $ ) {
+ $( function () {
+ var $sortableTables;
- /* Emulate placeholder if not supported by browser */
- if ( !( 'placeholder' in document.createElement( 'input' ) ) ) {
- $( 'input[placeholder]' ).placeholder();
- }
+ /* Emulate placeholder if not supported by browser */
+ if ( !( 'placeholder' in document.createElement( 'input' ) ) ) {
+ $( 'input[placeholder]' ).placeholder();
+ }
- /* Enable makeCollapsible */
- $( '.mw-collapsible' ).makeCollapsible();
+ /* Enable makeCollapsible */
+ $( '.mw-collapsible' ).makeCollapsible();
- /* Lazy load jquery.tablesorter */
- if ( $( 'table.sortable' ).length ) {
- mw.loader.using( 'jquery.tablesorter', function() {
- $( 'table.sortable' ).tablesorter();
- });
- }
+ /* Lazy load jquery.tablesorter */
+ $sortableTables = $( 'table.sortable' );
+ if ( $sortableTables.length ) {
+ mw.loader.using( 'jquery.tablesorter', function () {
+ $sortableTables.tablesorter();
+ });
+ }
- /* Enable CheckboxShiftClick */
- $( 'input[type=checkbox]:not(.noshiftselect)' ).checkboxShiftClick();
+ /* Enable CheckboxShiftClick */
+ $( 'input[type=checkbox]:not(.noshiftselect)' ).checkboxShiftClick();
- /* Add accesskey hints to the tooltips */
- mw.util.updateTooltipAccessKeys();
+ /* Add accesskey hints to the tooltips */
+ mw.util.updateTooltipAccessKeys();
-} );
+ } );
+}( mediaWiki, jQuery ) );
otherAction = action === 'watch' ? 'unwatch' : 'watch';
accesskeyTip = $link.attr( 'title' ).match( mw.util.tooltipAccessKeyRegexp );
$li = $link.closest( 'li' );
+
/**
* Trigger a 'watchpage' event for this List item.
* Announce the otherAction value as the first param.
* Used to monitor the state of watch link.
* TODO: Revise when system wide hooks are implemented
*/
- if( state === undefined ) {
+ if ( state === undefined ) {
$li.trigger( 'watchpage.mw', otherAction );
}
// Expose local methods
mw.page.watch = {
- 'updateWatchLink': updateWatchLink
+ updateWatchLink: updateWatchLink
};
$( document ).ready( function () {
otherAction = action === 'watch' ? 'unwatch' : 'watch';
$li = $link.closest( 'li' );
- mw.notify( $.parseHTML( watchResponse.message ), { tag: 'watch-self' } );
+ mw.notify( $.parseHTML( watchResponse.message ), {
+ tag: 'watch-self'
+ } );
// Set link to opposite
updateWatchLink( $link, otherAction );
if ( watchResponse.watched !== undefined ) {
$( '#wpWatchthis' ).prop( 'checked', true );
} else {
- $( '#wpWatchthis' ).removeProp( 'checked' );
+ $( '#wpWatchthis' ).prop( 'checked', false );
}
},
// Error
}
);
- });
- });
+ } );
+ } );
}( mediaWiki, jQuery ) );
-/* JavaScript for Special:Block */
+/**
+ * JavaScript for Special:Block
+ */
+( function ( mw, $ ) {
+ $( function ( $ ) {
-jQuery( function( $ ) {
+ var $blockTarget = $( '#mw-bi-target' ),
+ $anonOnlyRow = $( '#mw-input-wpHardBlock' ).closest( 'tr' ),
+ $enableAutoblockRow = $( '#mw-input-wpAutoBlock' ).closest( 'tr' ),
+ $hideUser = $( '#mw-input-wpHideUser' ).closest( 'tr' ),
+ $watchUser = $( '#mw-input-wpWatch' ).closest( 'tr' );
- var DO_INSTANT = true,
- $blockTarget = $( '#mw-bi-target' ),
- $anonOnlyRow = $( '#mw-input-wpHardBlock' ).closest( 'tr' ),
- $enableAutoblockRow = $( '#mw-input-wpAutoBlock' ).closest( 'tr' ),
- $hideUser = $( '#mw-input-wpHideUser' ).closest( 'tr' ),
- $watchUser = $( '#mw-input-wpWatch' ).closest( 'tr' );
+ function updateBlockOptions( instant ) {
+ if ( !$blockTarget.length ) {
+ return;
+ }
- var updateBlockOptions = function( instant ) {
- if ( !$blockTarget.length ) {
- return;
- }
-
- var blocktarget = $.trim( $blockTarget.val() );
- var isEmpty = ( blocktarget === '' );
- var isIp = mw.util.isIPv4Address( blocktarget, true ) || mw.util.isIPv6Address( blocktarget, true );
- var isIpRange = isIp && blocktarget.match( /\/\d+$/ );
+ var blocktarget = $.trim( $blockTarget.val() ),
+ isEmpty = blocktarget === '',
+ isIp = mw.util.isIPv4Address( blocktarget, true ) || mw.util.isIPv6Address( blocktarget, true ),
+ isIpRange = isIp && blocktarget.match( /\/\d+$/ );
- if ( isIp && !isEmpty ) {
- $enableAutoblockRow.goOut( instant );
- $hideUser.goOut( instant );
- } else {
- $enableAutoblockRow.goIn( instant );
- $hideUser.goIn( instant );
- }
- if ( !isIp && !isEmpty ) {
- $anonOnlyRow.goOut( instant );
- } else {
- $anonOnlyRow.goIn( instant );
+ if ( isIp && !isEmpty ) {
+ $enableAutoblockRow.goOut( instant );
+ $hideUser.goOut( instant );
+ } else {
+ $enableAutoblockRow.goIn( instant );
+ $hideUser.goIn( instant );
+ }
+ if ( !isIp && !isEmpty ) {
+ $anonOnlyRow.goOut( instant );
+ } else {
+ $anonOnlyRow.goIn( instant );
+ }
+ if ( isIpRange && !isEmpty ) {
+ $watchUser.goOut( instant );
+ } else {
+ $watchUser.goIn( instant );
+ }
}
- if ( isIpRange && !isEmpty ) {
- $watchUser.goOut( instant );
- } else {
- $watchUser.goIn( instant );
- }
- };
- // Bind functions so they're checked whenever stuff changes
- $blockTarget.keyup( updateBlockOptions );
+ // Bind functions so they're checked whenever stuff changes
+ $blockTarget.keyup( updateBlockOptions );
+
+ // Call them now to set initial state (ie. Special:Block/Foobar?wpBlockExpiry=2+hours)
+ updateBlockOptions( /* instant= */ true );
+ } );
+}( mediaWiki, jQuery ) );
- // Call them now to set initial state (ie. Special:Block/Foobar?wpBlockExpiry=2+hours)
- updateBlockOptions( DO_INSTANT );
-});
// (only if a framework was found, not on error pages).
$( '#mw-javascripttest-summary.mw-javascripttest-frameworkfound' ).append( function () {
- var $html = $( '<p><label for="useskin">'
+ var $html = $( '<p><label for="useskin">'
+ mw.message( 'javascripttest-pagetext-skins' ).escaped()
+ ' '
+ '</label></p>' ),
-mw.special = {};
+/*
+ * Namespace for mediawiki.special.* modules
+ */
+
+mediaWiki.special = {};
-/* JavaScript for Special:MovePage */
+/**
+ * JavaScript for Special:MovePage
+ */
jQuery( function( $ ) {
$( '#wpReason, #wpNewTitleMain' ).byteLimit();
-});
+} );
* JavaScript for Special:Preferences
*/
jQuery( document ).ready( function ( $ ) {
-$( '#prefsubmit' ).attr( 'id', 'prefcontrol' );
-var $preftoc = $('<ul id="preftoc"></ul>');
-var $preferences = $( '#preferences' )
- .addClass( 'jsprefs' )
- .before( $preftoc );
-
-var $fieldsets = $preferences.children( 'fieldset' )
- .hide()
- .addClass( 'prefsection' );
-
-var $legends = $fieldsets.children( 'legend' )
- .addClass( 'mainLegend' );
-
-/**
- * It uses document.getElementById for security reasons (html injections in
- * jQuery()).
- *
- * @param String name: the name of a tab without the prefix ("mw-prefsection-")
- * @param String mode: [optional] A hash will be set according to the current
- * open section. Set mode 'noHash' to surpress this.
- */
-function switchPrefTab( name, mode ) {
- var $tab, scrollTop;
- // Handle hash manually to prevent jumping,
- // therefore save and restore scrollTop to prevent jumping.
- scrollTop = $( window ).scrollTop();
- if ( mode !== 'noHash' ) {
- window.location.hash = '#mw-prefsection-' + name;
- }
- $( window ).scrollTop( scrollTop );
-
- $preftoc.find( 'li' ).removeClass( 'selected' );
- $tab = $( document.getElementById( 'preftab-' + name ) );
- if ( $tab.length ) {
- $tab.parent().addClass( 'selected' );
- $preferences.children( 'fieldset' ).hide();
- $( document.getElementById( 'mw-prefsection-' + name ) ).show();
+ var $preftoc, $preferences, $fieldsets, $legends,
+ hash,
+ $tzSelect, $tzTextbox, $localtimeHolder, servertime;
+
+ $( '#prefsubmit' ).attr( 'id', 'prefcontrol' );
+
+ $preftoc = $('<ul id="preftoc"></ul>'),
+ $preferences = $( '#preferences' )
+ .addClass( 'jsprefs' )
+ .before( $preftoc ),
+ $fieldsets = $preferences.children( 'fieldset' )
+ .hide()
+ .addClass( 'prefsection' ),
+ $legends = $fieldsets
+ .children( 'legend' )
+ .addClass( 'mainLegend' );
+
+ /**
+ * It uses document.getElementById for security reasons (html injections in
+ * jQuery()).
+ *
+ * @param String name: the name of a tab without the prefix ("mw-prefsection-")
+ * @param String mode: [optional] A hash will be set according to the current
+ * open section. Set mode 'noHash' to surpress this.
+ */
+ function switchPrefTab( name, mode ) {
+ var $tab, scrollTop;
+ // Handle hash manually to prevent jumping,
+ // therefore save and restore scrollTop to prevent jumping.
+ scrollTop = $( window ).scrollTop();
+ if ( mode !== 'noHash' ) {
+ window.location.hash = '#mw-prefsection-' + name;
+ }
+ $( window ).scrollTop( scrollTop );
+
+ $preftoc.find( 'li' ).removeClass( 'selected' );
+ $tab = $( document.getElementById( 'preftab-' + name ) );
+ if ( $tab.length ) {
+ $tab.parent().addClass( 'selected' );
+ $preferences.children( 'fieldset' ).hide();
+ $( document.getElementById( 'mw-prefsection-' + name ) ).show();
+ }
}
-}
-// Populate the prefToc
-$legends.each( function ( i, legend ) {
- var $legend = $(legend);
- if ( i === 0 ) {
- $legend.parent().show();
+ // Populate the prefToc
+ $legends.each( function ( i, legend ) {
+ var $legend = $(legend),
+ ident, $li, $a;
+ if ( i === 0 ) {
+ $legend.parent().show();
+ }
+ ident = $legend.parent().attr( 'id' );
+
+ $li = $( '<li>' )
+ .addClass( i === 0 ? 'selected' : '' );
+ $a = $( '<a>' )
+ .attr( {
+ id: ident.replace( 'mw-prefsection', 'preftab' ),
+ href: '#' + ident
+ } )
+ .text( $legend.text() );
+ $li.append( $a );
+ $preftoc.append( $li );
+ } );
+
+ // If we've reloaded the page or followed an open-in-new-window,
+ // make the selected tab visible.
+ hash = window.location.hash;
+ if ( hash.match( /^#mw-prefsection-[\w\-]+/ ) ) {
+ switchPrefTab( hash.replace( '#mw-prefsection-' , '' ) );
}
- var ident = $legend.parent().attr( 'id' );
-
- var $li = $( '<li/>', {
- 'class' : ( i === 0 ) ? 'selected' : null
- });
- var $a = $( '<a/>', {
- text : $legend.text(),
- id : ident.replace( 'mw-prefsection', 'preftab' ),
- href : '#' + ident
- });
- $li.append( $a );
- $preftoc.append( $li );
-} );
-// If we've reloaded the page or followed an open-in-new-window,
-// make the selected tab visible.
-var hash = window.location.hash;
-if ( hash.match( /^#mw-prefsection-[\w-]+/ ) ) {
- switchPrefTab( hash.replace( '#mw-prefsection-' , '' ) );
-}
-
-// In browsers that support the onhashchange event we will not bind click
-// handlers and instead let the browser do the default behavior (clicking the
-// <a href="#.."> will naturally set the hash, handled by onhashchange.
-// But other things that change the hash will also be catched (e.g. using
-// the Back and Forward browser navigation).
-if ( 'onhashchange' in window ) {
- $(window).on( 'hashchange' , function () {
- var hash = window.location.hash;
- if ( hash.match( /^#mw-prefsection-[\w-]+/ ) ) {
- switchPrefTab( hash.replace( '#mw-prefsection-', '' ) );
- } else if ( hash === '' ) {
- switchPrefTab( 'personal', 'noHash' );
- }
- });
-// In older browsers we'll bind a click handler as fallback.
-// We must not have onhashchange *and* the click handlers, other wise
-// the click handler calls switchPrefTab() which sets the hash value,
-// which triggers onhashcange and calls switchPrefTab() again.
-} else {
- $preftoc.on( 'click', 'li a', function ( e ) {
- switchPrefTab( $( this ).attr( 'href' ).replace( '#mw-prefsection-', '' ) );
- e.preventDefault();
- });
-}
-
-/**
-* Timezone functions.
-* Guesses Timezone from browser and updates fields onchange
-*/
-
-var $tzSelect = $( '#mw-input-wptimecorrection' );
-var $tzTextbox = $( '#mw-input-wptimecorrection-other' );
-
-var $localtimeHolder = $( '#wpLocalTime' );
-var servertime = parseInt( $( 'input[name=wpServerTime]' ).val(), 10 );
-var minuteDiff = 0;
-
-var minutesToHours = function ( min ) {
- var tzHour = Math.floor( Math.abs( min ) / 60 );
- var tzMin = Math.abs( min ) % 60;
- var tzString = ( ( min >= 0 ) ? '' : '-' ) + ( ( tzHour < 10 ) ? '0' : '' ) + tzHour +
- ':' + ( ( tzMin < 10 ) ? '0' : '' ) + tzMin;
- return tzString;
-};
-
-var hoursToMinutes = function ( hour ) {
- var arr = hour.split( ':' );
- arr[0] = parseInt( arr[0], 10 );
-
- var minutes;
- if ( arr.length == 1 ) {
- // Specification is of the form [-]XX
- minutes = arr[0] * 60;
+ // In browsers that support the onhashchange event we will not bind click
+ // handlers and instead let the browser do the default behavior (clicking the
+ // <a href="#.."> will naturally set the hash, handled by onhashchange.
+ // But other things that change the hash will also be catched (e.g. using
+ // the Back and Forward browser navigation).
+ if ( 'onhashchange' in window ) {
+ $(window).on( 'hashchange' , function () {
+ var hash = window.location.hash;
+ if ( hash.match( /^#mw-prefsection-[\w\-]+/ ) ) {
+ switchPrefTab( hash.replace( '#mw-prefsection-', '' ) );
+ } else if ( hash === '' ) {
+ switchPrefTab( 'personal', 'noHash' );
+ }
+ });
+ // In older browsers we'll bind a click handler as fallback.
+ // We must not have onhashchange *and* the click handlers, other wise
+ // the click handler calls switchPrefTab() which sets the hash value,
+ // which triggers onhashcange and calls switchPrefTab() again.
} else {
- // Specification is of the form [-]XX:XX
- minutes = Math.abs( arr[0] ) * 60 + parseInt( arr[1], 10 );
- if ( arr[0] < 0 ) {
- minutes *= -1;
- }
+ $preftoc.on( 'click', 'li a', function ( e ) {
+ switchPrefTab( $( this ).attr( 'href' ).replace( '#mw-prefsection-', '' ) );
+ e.preventDefault();
+ });
}
- // Gracefully handle non-numbers.
- if ( isNaN( minutes ) ) {
- return 0;
- } else {
- return minutes;
+
+ /**
+ * Timezone functions.
+ * Guesses Timezone from browser and updates fields onchange
+ */
+
+ $tzSelect = $( '#mw-input-wptimecorrection' );
+ $tzTextbox = $( '#mw-input-wptimecorrection-other' );
+ $localtimeHolder = $( '#wpLocalTime' );
+ servertime = parseInt( $( 'input[name="wpServerTime"]' ).val(), 10 );
+
+ function minutesToHours( min ) {
+ var tzHour = Math.floor( Math.abs( min ) / 60 ),
+ tzMin = Math.abs( min ) % 60,
+ tzString = ( ( min >= 0 ) ? '' : '-' ) + ( ( tzHour < 10 ) ? '0' : '' ) + tzHour +
+ ':' + ( ( tzMin < 10 ) ? '0' : '' ) + tzMin;
+ return tzString;
}
-};
-
-var updateTimezoneSelection = function () {
- var type = $tzSelect.val();
- if ( type == 'guess' ) {
- // Get browser timezone & fill it in
- minuteDiff = -new Date().getTimezoneOffset();
- $tzTextbox.val( minutesToHours( minuteDiff ) );
- $tzSelect.val( 'other' );
- $tzTextbox.get( 0 ).disabled = false;
- } else if ( type == 'other' ) {
- // Grab data from the textbox, parse it.
- minuteDiff = hoursToMinutes( $tzTextbox.val() );
- } else {
- // Grab data from the $tzSelect value
- minuteDiff = parseInt( type.split( '|' )[1], 10 ) || 0;
- $tzTextbox.val( minutesToHours( minuteDiff ) );
+
+ function hoursToMinutes( hour ) {
+ var minutes,
+ arr = hour.split( ':' );
+
+ arr[0] = parseInt( arr[0], 10 );
+
+ if ( arr.length === 1 ) {
+ // Specification is of the form [-]XX
+ minutes = arr[0] * 60;
+ } else {
+ // Specification is of the form [-]XX:XX
+ minutes = Math.abs( arr[0] ) * 60 + parseInt( arr[1], 10 );
+ if ( arr[0] < 0 ) {
+ minutes *= -1;
+ }
+ }
+ // Gracefully handle non-numbers.
+ if ( isNaN( minutes ) ) {
+ return 0;
+ } else {
+ return minutes;
+ }
}
- // Determine local time from server time and minutes difference, for display.
- var localTime = servertime + minuteDiff;
+ function updateTimezoneSelection () {
+ var minuteDiff, localTime,
+ type = $tzSelect.val();
+
+ if ( type === 'guess' ) {
+ // Get browser timezone & fill it in
+ minuteDiff = -( new Date().getTimezoneOffset() );
+ $tzTextbox.val( minutesToHours( minuteDiff ) );
+ $tzSelect.val( 'other' );
+ $tzTextbox.prop( 'disabled', false );
+ } else if ( type === 'other' ) {
+ // Grab data from the textbox, parse it.
+ minuteDiff = hoursToMinutes( $tzTextbox.val() );
+ } else {
+ // Grab data from the $tzSelect value
+ minuteDiff = parseInt( type.split( '|' )[1], 10 ) || 0;
+ $tzTextbox.val( minutesToHours( minuteDiff ) );
+ }
- // Bring time within the [0,1440) range.
- while ( localTime < 0 ) {
- localTime += 1440;
+ // Determine local time from server time and minutes difference, for display.
+ localTime = servertime + minuteDiff;
+
+ // Bring time within the [0,1440) range.
+ while ( localTime < 0 ) {
+ localTime += 1440;
+ }
+ while ( localTime >= 1440 ) {
+ localTime -= 1440;
+ }
+ $localtimeHolder.text( minutesToHours( localTime ) );
}
- while ( localTime >= 1440 ) {
- localTime -= 1440;
+
+ if ( $tzSelect.length && $tzTextbox.length ) {
+ $tzSelect.change( updateTimezoneSelection );
+ $tzTextbox.blur( updateTimezoneSelection );
+ updateTimezoneSelection();
}
- $localtimeHolder.text( minutesToHours( localTime ) );
-};
-
-if ( $tzSelect.length && $tzTextbox.length ) {
- $tzSelect.change( function () { updateTimezoneSelection(); } );
- $tzTextbox.blur( function () { updateTimezoneSelection(); } );
- updateTimezoneSelection();
-}
} );
-/* JavaScript for Special:RecentChanges */
+/**
+ * JavaScript for Special:RecentChanges
+ */
( function ( mw, $ ) {
+ var rc,
+ $checkboxes,
+ $select;
- var checkboxes = [ 'nsassociated', 'nsinvert' ];
-
- /**
- * @var select {jQuery}
- */
- var $select = null;
-
- var rc = mw.special.recentchanges = {
+ rc = {
/**
* Handler to disable/enable the namespace selector checkboxes when the
*/
updateCheckboxes: function () {
// The option element for the 'all' namespace has an empty value
- var isAllNS = $select.find('option:selected').val() === '';
+ var isAllNS = $select.find( 'option:selected' ).val() === '';
// Iterates over checkboxes and propagate the selected option
- $.each( checkboxes, function ( i, id ) {
- $( '#' + id ).prop( 'disabled', isAllNS );
- });
+ $checkboxes.prop( 'disabled', isAllNS );
},
init: function () {
- // Populate
$select = $( '#namespace' );
+ $checkboxes = $( '#nsassociated, #nsinvert' );
// Bind to change event, and trigger once to set the initial state of the checkboxes.
- $select.change( rc.updateCheckboxes ).change();
+ rc.updateCheckboxes();
+ $select.change( rc.updateCheckboxes );
}
};
- // Run when document is ready
$( rc.init );
+ mw.special.recentchanges = rc;
+
}( mediaWiki, jQuery ) );
/*
* JavaScript for Special:Search
*/
-( function( $, mw ) { $( function() {
+( function ( $, mw ) {
+ $( function () {
+ var $checkboxes, $headerLinks;
-// Emulate HTML5 autofocus behavior in non HTML5 compliant browsers
-if ( !( 'autofocus' in document.createElement( 'input' ) ) ) {
- $( 'input[autofocus]:first' ).focus();
-}
+ // Emulate HTML5 autofocus behavior in non HTML5 compliant browsers
+ if ( !( 'autofocus' in document.createElement( 'input' ) ) ) {
+ $( 'input[autofocus]' ).eq( 0 ).focus();
+ }
-// Create check all/none button
-var $checkboxes = $('#powersearch input[id^=mw-search-ns]');
-$('#mw-search-togglebox').append(
- $('<label />')
- .text(mw.msg('powersearch-togglelabel'))
-).append(
- $('<input type="button" />')
- .attr('id', 'mw-search-toggleall')
- .attr('value', mw.msg('powersearch-toggleall'))
- .click( function() {
- $checkboxes.prop('checked', true);
- } )
-).append(
- $('<input type="button" />')
- .attr('id', 'mw-search-togglenone')
- .attr('value', mw.msg('powersearch-togglenone'))
- .click( function() {
- $checkboxes.prop('checked', false);
- } )
-);
+ // Create check all/none button
+ $checkboxes = $('#powersearch input[id^=mw-search-ns]');
+ $('#mw-search-togglebox').append(
+ $('<label>')
+ .text(mw.msg('powersearch-togglelabel'))
+ ).append(
+ $('<input type="button" />')
+ .attr( 'id', 'mw-search-toggleall' )
+ .prop( 'value', mw.msg('powersearch-toggleall' ) )
+ .click( function () {
+ $checkboxes.prop('checked', true);
+ } )
+ ).append(
+ $('<input type="button" />')
+ .attr( 'id', 'mw-search-togglenone' )
+ .prop( 'value', mw.msg('powersearch-togglenone' ) )
+ .click( function() {
+ $checkboxes.prop( 'checked', false );
+ } )
+ );
-// Change the header search links to what user entered
-var headerLinks = $('.search-types a');
-$('#searchText, #powerSearchText').change(function() {
- var searchterm = $(this).val();
- headerLinks.each( function() {
- var parts = $(this).attr('href').split( 'search=' );
- var lastpart = '';
- var prefix = 'search=';
- if( parts.length > 1 && parts[1].indexOf('&') >= 0 ) {
- lastpart = parts[1].substring( parts[1].indexOf('&') );
- } else {
- prefix = '&search=';
- }
- this.href = parts[0] + prefix + encodeURIComponent( searchterm ) + lastpart;
- });
-}).trigger('change');
+ // Change the header search links to what user entered
+ $headerLinks = $( '.search-types a' );
+ $( '#searchText, #powerSearchText' ).change( function () {
+ var searchterm = $(this).val();
+ $headerLinks.each( function () {
+ var parts = $(this).attr('href').split( 'search=' ),
+ lastpart = '',
+ prefix = 'search=';
+ if ( parts.length > 1 && parts[1].indexOf('&') >= 0 ) {
+ lastpart = parts[1].substring( parts[1].indexOf('&') );
+ } else {
+ prefix = '&search=';
+ }
+ this.href = parts[0] + prefix + encodeURIComponent( searchterm ) + lastpart;
+ });
+ }).trigger( 'change' );
+
+ } );
-} ); } )( jQuery, mediaWiki );
+}( jQuery, mediaWiki ) );
/*
* JavaScript for Specical:Undelete
*/
-jQuery( document ).ready( function( $ ) {
- $( '#mw-undelete-invert' ).click( function( e ) {
+jQuery( document ).ready( function ( $ ) {
+ $( '#mw-undelete-invert' ).click( function ( e ) {
e.preventDefault();
- $( '#undelete' ).find( 'input:checkbox' )
- .prop( 'checked', function( i, val ) { return !val; } );
+ $( '#undelete input[type="checkbox"]' ).prop( 'checked', function ( i, val ) {
+ return !val;
+ } );
} );
} );
* Is the FileAPI available with sufficient functionality?
*/
function hasFileAPI() {
- return typeof window.FileReader !== 'undefined';
+ return window.FileReader !== undefined;
}
/**
* @param {File} file
*/
function showPreview( file ) {
- var previewSize = 180,
+ var $canvas,
+ ctx,
+ meta,
+ previewSize = 180,
thumb = $( '<div id="mw-upload-thumbnail" class="thumb tright">' +
'<div class="thumbinner">' +
'<div class="mw-small-spinner" style="width: 180px; height: 180px"></div>' +
'<div class="thumbcaption"><div class="filename"></div><div class="fileinfo"></div></div>' +
'</div>' +
'</div>' );
+
thumb.find( '.filename' ).text( file.name ).end()
.find( '.fileinfo' ).text( prettySize( file.size ) ).end();
- var $canvas = $('<canvas width="' + previewSize + '" height="' + previewSize + '" ></canvas>'),
- ctx = $canvas[0].getContext( '2d' );
+ $canvas = $('<canvas width="' + previewSize + '" height="' + previewSize + '" ></canvas>');
+ ctx = $canvas[0].getContext( '2d' );
$( '#mw-htmlform-source' ).parent().prepend( thumb );
- var meta;
- fetchPreview( file, function( dataURL ) {
+ fetchPreview( file, function ( dataURL ) {
var img = new Image(),
rotation = 0;
}
img.onload = function () {
- var width, height, x, y, dx, dy, logicalWidth, logicalHeight;
+ var info, width, height, x, y, dx, dy, logicalWidth, logicalHeight;
+
// Fit the image within the previewSizexpreviewSize box
if ( img.width > img.height ) {
width = previewSize;
thumb.find('.mw-small-spinner').replaceWith($canvas);
// Image size
- var info = mw.msg( 'widthheight', logicalWidth, logicalHeight ) +
+ info = mw.msg( 'widthheight', logicalWidth, logicalHeight ) +
', ' + prettySize( file.size );
+
$( '#mw-upload-thumbnail .fileinfo' ).text( info );
};
img.src = dataURL;
}, mw.config.get( 'wgFileCanRotate' ) ? function ( data ) {
+ /*jshint camelcase: false, nomen: false */
try {
meta = mw.libs.jpegmeta( data, file.fileName );
meta._binary_data = null;
// However, our JPEG metadata library wants a string.
// So, this is going to be an ugly conversion.
reader.onload = function() {
- var buffer = new Uint8Array( reader.result ),
+ var i,
+ buffer = new Uint8Array( reader.result ),
string = '';
- for ( var i = 0; i < buffer.byteLength; i++ ) {
+ for ( i = 0; i < buffer.byteLength; i++ ) {
string += String.fromCharCode( buffer[i] );
}
callbackBinary( string );
} else {
// This ends up decoding the file to base-64 and back again, which
// feels horribly inefficient.
- reader.onload = function() {
+ reader.onload = function () {
callback( reader.result );
};
reader.readAsDataURL( file );
* Check if the file does not exceed the maximum size
*/
function checkMaxUploadSize( file ) {
+ var maxSize, $error;
+
function getMaxUploadSize( type ) {
var sizes = mw.config.get( 'wgMaxUploadSize' );
+
if ( sizes[type] !== undefined ) {
return sizes[type];
}
return sizes['*'];
}
+
$( '.mw-upload-source-error' ).remove();
- var maxSize = getMaxUploadSize( 'file' );
+ maxSize = getMaxUploadSize( 'file' );
if ( file.size > maxSize ) {
- var error = $( '<p class="error mw-upload-source-error" id="wpSourceTypeFile-error">' +
- mw.message( 'largefileserver', file.size, maxSize ).escaped() + '</p>' );
- $( '#wpUploadFile' ).after( error );
+ $error = $( '<p class="error mw-upload-source-error" id="wpSourceTypeFile-error">' +
+ mw.message( 'largefileserver', file.size, maxSize ).escaped() + '</p>' );
+
+ $( '#wpUploadFile' ).after( $error );
+
return false;
}
+
return true;
}
* Disable all upload source fields except the selected one
*/
$( function ( $ ) {
- var i, row,
- rows = $( '.mw-htmlform-field-UploadSourceField' );
- for ( i = rows.length; i; i-- ) {
- row = rows[i - 1];
- $( 'input[name="wpSourceType"]', row ).change( ( function () {
- var currentRow = row; // Store current row in our own scope
- return function () {
- $( '.mw-upload-source-error' ).remove();
- if ( this.checked ) {
- // Disable all inputs
- $( 'input[name!="wpSourceType"]', rows ).prop( 'disabled', true );
- // Re-enable the current one
- $( 'input', currentRow ).prop( 'disabled', false );
- }
- };
- }() ) );
+ var i, $row,
+ $rows = $( '.mw-htmlform-field-UploadSourceField' );
+
+ function createHandler( $currentRow ) {
+ /**
+ * @param {jQuery.Event}
+ */
+ return function () {
+ $( '.mw-upload-source-error' ).remove();
+ if ( this.checked ) {
+ // Disable all inputs
+ $rows.find( 'input[name!="wpSourceType"]' ).prop( 'disabled', true );
+ // Re-enable the current one
+ $currentRow.find( 'input' ).prop( 'disabled', false );
+ }
+ };
+ }
+
+ for ( i = $rows.length; i; i-- ) {
+ $row = $rows.eq(i - 1);
+ $row
+ .find( 'input[name="wpSourceType"]' )
+ .change( createHandler( $row ) );
}
} );
// In normal browsers the match-array contains null/undefined if there's no match,
// IE returns an empty string.
var matches = s.match( /^(?:([^:]+):)?(.*?)(?:\.(\w+))?$/ ),
- ns_match = getNsIdByName( matches[1] );
+ nsMatch = getNsIdByName( matches[1] );
// Namespace must be valid, and title must be a non-empty string.
- if ( ns_match && typeof matches[2] === 'string' && matches[2] !== '' ) {
- title.ns = ns_match;
+ if ( nsMatch && typeof matches[2] === 'string' && matches[2] !== '' ) {
+ title.ns = nsMatch;
title.name = fixName( matches[2] );
if ( typeof matches[3] === 'string' && matches[3] !== '' ) {
title.ext = fixExt( matches[3] );
/**
- * mediawiki.Feedback
+ * mediawiki.feedback
*
* @author Ryan Kaldari, 2010
* @author Neil Kandalgaonkar, 2010-11
mw.Feedback.prototype = {
setup: function () {
- var fb = this;
+ var $feedbackPageLink,
+ $bugNoteLink,
+ $bugsListLink,
+ fb = this;
- var $feedbackPageLink = $( '<a>' )
- .attr( { 'href': fb.title.getUrl(), 'target': '_blank' } )
- .css( { 'white-space': 'nowrap' } );
+ $feedbackPageLink = $( '<a>' )
+ .attr( {
+ href: fb.title.getUrl(),
+ target: '_blank'
+ } )
+ .css( {
+ whiteSpace: 'nowrap'
+ } );
- var $bugNoteLink = $( '<a>' ).attr( { 'href': '#' } ).click( function () {
+ $bugNoteLink = $( '<a>' ).attr( { href: '#' } ).click( function () {
fb.displayBugs();
} );
- var $bugsListLink = $( '<a>' ).attr( { 'href': fb.bugsListLink, 'target': '_blank' } );
+ $bugsListLink = $( '<a>' ).attr( {
+ href: fb.bugsListLink,
+ target: '_blank'
+ } );
// TODO: Use a stylesheet instead of these inline styles
this.$dialog =
),
$( '<div class="feedback-mode feedback-submitting" style="text-align: center; margin: 3em 0;"></div>' ).append(
mw.msg( 'feedback-adding' ),
- $( '<br/>' ),
+ $( '<br>' ),
$( '<span class="feedback-spinner"></span>' )
),
$( '<div class="feedback-mode feedback-thanks" style="text-align: center; margin:1em"></div>' ).msg(
},
displayBugs: function () {
- var fb = this;
+ var fb = this,
+ bugsButtons = {};
this.display( 'bugs' );
- var bugsButtons = {};
bugsButtons[ mw.msg( 'feedback-bugnew' ) ] = function () {
window.open( fb.bugsLink, '_blank' );
};
},
displayThanks: function () {
- var fb = this;
+ var fb = this,
+ closeButton = {};
this.display( 'thanks' );
- var closeButton = {};
closeButton[ mw.msg( 'feedback-close' ) ] = function () {
fb.$dialog.dialog( 'close' );
};
* message: {String}
*/
displayForm: function ( contents ) {
- var fb = this;
+ var fb = this,
+ formButtons = {};
this.subjectInput.value = ( contents && contents.subject ) ? contents.subject : '';
this.messageInput.value = ( contents && contents.message ) ? contents.message : '';
this.display( 'form' );
// Set up buttons for dialog box. We have to do it the hard way since the json keys are localized
- var formButtons = {};
formButtons[ mw.msg( 'feedback-submit' ) ] = function () {
fb.submit();
};
},
displayError: function ( message ) {
- var fb = this;
+ var fb = this,
+ closeButton = {};
this.display( 'error' );
this.$dialog.find( '.feedback-error-msg' ).msg( message );
- var closeButton = {};
closeButton[ mw.msg( 'feedback-close' ) ] = function () {
fb.$dialog.dialog( 'close' );
};
}
}
- function err( code, info ) {
+ function err() {
// ajax request failed
fb.displayError( 'feedback-error3' );
}
-$( function() {
+jQuery( function ( $ ) {
// Apply hidpi images on DOM-ready
// Some may have already partly preloaded at low resolution.
$( 'body' ).hidpi();
-} );
\ No newline at end of file
+} );
/**
- * Utility functions for jazzing up HTMLForm elements
+ * Utility functions for jazzing up HTMLForm elements.
*/
( function ( $ ) {
-/**
- * jQuery plugin to fade or snap to visible state.
- *
- * @param boolean instantToggle (optional)
- * @return jQuery
- */
-$.fn.goIn = function ( instantToggle ) {
- if ( instantToggle === true ) {
- return $(this).show();
- }
- return $(this).stop( true, true ).fadeIn();
-};
-
-/**
- * jQuery plugin to fade or snap to hiding state.
- *
- * @param boolean instantToggle (optional)
- * @return jQuery
- */
-$.fn.goOut = function ( instantToggle ) {
- if ( instantToggle === true ) {
- return $(this).hide();
- }
- return $(this).stop( true, true ).fadeOut();
-};
-
-/**
- * Bind a function to the jQuery object via live(), and also immediately trigger
- * the function on the objects with an 'instant' parameter set to true
- * @param callback function taking one parameter, which is Bool true when the event
- * is called immediately, and the EventArgs object when triggered from an event
- */
-$.fn.liveAndTestAtStart = function ( callback ){
- $(this)
- .live( 'change', callback )
- .each( function ( index, element ){
- callback.call( this, true );
- } );
-};
-
-// Document ready:
-$( function () {
-
- // Animate the SelectOrOther fields, to only show the text field when
- // 'other' is selected.
- $( '.mw-htmlform-select-or-other' ).liveAndTestAtStart( function ( instant ) {
- var $other = $( '#' + $(this).attr( 'id' ) + '-other' );
- $other = $other.add( $other.siblings( 'br' ) );
- if ( $(this).val() === 'other' ) {
- $other.goIn( instant );
- } else {
- $other.goOut( instant );
+ /**
+ * jQuery plugin to fade or snap to visible state.
+ *
+ * @param {boolean} instantToggle [optional]
+ * @return {jQuery}
+ */
+ $.fn.goIn = function ( instantToggle ) {
+ if ( instantToggle === true ) {
+ return $(this).show();
}
- });
-
-});
-
+ return $(this).stop( true, true ).fadeIn();
+ };
+
+ /**
+ * jQuery plugin to fade or snap to hiding state.
+ *
+ * @param {boolean} instantToggle [optional]
+ * @return jQuery
+ */
+ $.fn.goOut = function ( instantToggle ) {
+ if ( instantToggle === true ) {
+ return $(this).hide();
+ }
+ return $(this).stop( true, true ).fadeOut();
+ };
+
+ /**
+ * Bind a function to the jQuery object via live(), and also immediately trigger
+ * the function on the objects with an 'instant' parameter set to true.
+ * @param {Function} callback Takes one parameter, which is {true} when the
+ * event is called immediately, and {jQuery.Event} when triggered from an event.
+ */
+ $.fn.liveAndTestAtStart = function ( callback ){
+ $(this)
+ .live( 'change', callback )
+ .each( function () {
+ callback.call( this, true );
+ } );
+ };
+
+ $( function () {
+
+ // Animate the SelectOrOther fields, to only show the text field when
+ // 'other' is selected.
+ $( '.mw-htmlform-select-or-other' ).liveAndTestAtStart( function ( instant ) {
+ var $other = $( '#' + $(this).attr( 'id' ) + '-other' );
+ $other = $other.add( $other.siblings( 'br' ) );
+ if ( $(this).val() === 'other' ) {
+ $other.goIn( instant );
+ } else {
+ $other.goOut( instant );
+ }
+ });
+
+ } );
}( jQuery ) );
* @author neilk@wikimedia.org
*/
( function ( mw, $ ) {
- var slice = Array.prototype.slice,
+ var oldParser,
+ slice = Array.prototype.slice,
parserDefaults = {
magic : {
'SITENAME' : mw.config.get( 'wgSiteName' )
* @return {jQuery}
*/
return function ( args ) {
- var key = args[0];
- var argsArray = $.isArray( args[1] ) ? args[1] : slice.call( args, 1 );
+ var key = args[0],
+ argsArray = $.isArray( args[1] ) ? args[1] : slice.call( args, 1 );
try {
return parser.parse( key, argsArray );
} catch ( e ) {
* is equivalent to
* somefunction(a, [b, c, d])
*
- * @param {String} message key
- * @param {Array} optional replacements (can also specify variadically)
- * @return {String} rendered HTML as string
+ * @param {string} key Message key.
+ * @param {Array|mixed} replacements Optional variable replacements (variadically or an array).
+ * @return {string} Rendered HTML.
*/
- return function ( /* key, replacements */ ) {
+ return function () {
return failableParserFn( arguments ).html();
};
};
* somefunction(a, [b, c, d])
*
* We append to 'this', which in a jQuery plugin context will be the selected elements.
- * @param {String} message key
- * @param {Array} optional replacements (can also specify variadically)
+ * @param {string} key Message key.
+ * @param {Array|mixed} replacements Optional variable replacements (variadically or an array).
* @return {jQuery} this
*/
- return function ( /* key, replacements */ ) {
+ return function () {
var $target = this.empty();
$.each( failableParserFn( arguments ).contents(), function ( i, node ) {
$target.append( node );
* Where the magic happens.
* Parses a message from the key, and swaps in replacements as necessary, wraps in jQuery
* If an error is thrown, returns original key, and logs the error
- * @param {String} message key
- * @param {Array} replacements for $1, $2... $n
+ * @param {String} key Message key.
+ * @param {Array} replacements Variable replacements for $1, $2... $n
* @return {jQuery}
*/
parse: function ( key, replacements ) {
if ( this.astCache[ key ] === undefined ) {
var wikiText = this.settings.messages.get( key );
if ( typeof wikiText !== 'string' ) {
- wikiText = "\\[" + key + "\\]";
+ wikiText = '\\[' + key + '\\]';
}
this.astCache[ key ] = this.wikiTextToAst( wikiText );
}
* @return {Mixed} abstract syntax tree
*/
wikiTextToAst: function ( input ) {
+ var pos,
+ regularLiteral, regularLiteralWithoutBar, regularLiteralWithoutSpace, backslash, anyCharacter,
+ escapedOrLiteralWithoutSpace, escapedOrLiteralWithoutBar, escapedOrRegularLiteral,
+ whitespace, dollar, digits,
+ openExtlink, closeExtlink, openLink, closeLink, templateName, pipe, colon,
+ templateContents, openTemplate, closeTemplate,
+ nonWhitespaceExpression, paramExpression, expression, result;
// Indicates current position in input as we parse through it.
// Shared among all parsing functions below.
- var pos = 0;
+ pos = 0;
+
// =========================================================
// parsing combinators - could be a library on its own
// =========================================================
// Try parsers until one works, if none work return null
function choice( ps ) {
return function () {
- for ( var i = 0; i < ps.length; i++ ) {
- var result = ps[i]();
+ var i, result;
+ for ( i = 0; i < ps.length; i++ ) {
+ result = ps[i]();
if ( result !== null ) {
return result;
}
// try several ps in a row, all must succeed or return null
// this is the only eager one
function sequence( ps ) {
- var originalPos = pos;
- var result = [];
- for ( var i = 0; i < ps.length; i++ ) {
- var res = ps[i]();
+ var i, res,
+ originalPos = pos,
+ result = [];
+ for ( i = 0; i < ps.length; i++ ) {
+ res = ps[i]();
if ( res === null ) {
pos = originalPos;
return null;
// must succeed a minimum of n times or return null
function nOrMore( n, p ) {
return function () {
- var originalPos = pos;
- var result = [];
- var parsed = p();
+ var originalPos = pos,
+ result = [],
+ parsed = p();
while ( parsed !== null ) {
result.push( parsed );
parsed = p();
// but some debuggers can't tell you exactly where they come from. Also the mutually
// recursive functions seem not to work in all browsers then. (Tested IE6-7, Opera, Safari, FF)
// This may be because, to save code, memoization was removed
- var regularLiteral = makeRegexParser( /^[^{}\[\]$\\]/ );
- var regularLiteralWithoutBar = makeRegexParser(/^[^{}\[\]$\\|]/);
- var regularLiteralWithoutSpace = makeRegexParser(/^[^{}\[\]$\s]/);
- var backslash = makeStringParser( "\\" );
- var anyCharacter = makeRegexParser( /^./ );
+ regularLiteral = makeRegexParser( /^[^{}\[\]$\\]/ );
+ regularLiteralWithoutBar = makeRegexParser(/^[^{}\[\]$\\|]/);
+ regularLiteralWithoutSpace = makeRegexParser(/^[^{}\[\]$\s]/);
+ backslash = makeStringParser( '\\' );
+ anyCharacter = makeRegexParser( /^./ );
function escapedLiteral() {
var result = sequence( [
backslash,
] );
return result === null ? null : result[1];
}
- var escapedOrLiteralWithoutSpace = choice( [
+ escapedOrLiteralWithoutSpace = choice( [
escapedLiteral,
regularLiteralWithoutSpace
] );
- var escapedOrLiteralWithoutBar = choice( [
+ escapedOrLiteralWithoutBar = choice( [
escapedLiteral,
regularLiteralWithoutBar
] );
- var escapedOrRegularLiteral = choice( [
+ escapedOrRegularLiteral = choice( [
escapedLiteral,
regularLiteral
] );
var result = nOrMore( 1, escapedOrRegularLiteral )();
return result === null ? null : result.join('');
}
- var whitespace = makeRegexParser( /^\s+/ );
- var dollar = makeStringParser( '$' );
- var digits = makeRegexParser( /^\d+/ );
+ whitespace = makeRegexParser( /^\s+/ );
+ dollar = makeStringParser( '$' );
+ digits = makeRegexParser( /^\d+/ );
function replacement() {
var result = sequence( [
}
return [ 'REPLACE', parseInt( result[1], 10 ) - 1 ];
}
- var openExtlink = makeStringParser( '[' );
- var closeExtlink = makeStringParser( ']' );
+ openExtlink = makeStringParser( '[' );
+ closeExtlink = makeStringParser( ']' );
// this extlink MUST have inner text, e.g. [foo] not allowed; [foo bar] is allowed
function extlink() {
- var result = null;
- var parsedResult = sequence( [
+ var result, parsedResult;
+ result = null;
+ parsedResult = sequence( [
openExtlink,
nonWhitespaceExpression,
whitespace,
}
return [ 'LINKPARAM', parseInt( result[2], 10 ) - 1, result[4] ];
}
- var openLink = makeStringParser( '[[' );
- var closeLink = makeStringParser( ']]' );
+ openLink = makeStringParser( '[[' );
+ closeLink = makeStringParser( ']]' );
function link() {
- var result = null;
- var parsedResult = sequence( [
+ var result, parsedResult;
+ result = null;
+ parsedResult = sequence( [
openLink,
expression,
closeLink
}
return result;
}
- var templateName = transform(
+ templateName = transform(
// see $wgLegalTitleChars
// not allowing : due to the need to catch "PLURAL:$1"
makeRegexParser( /^[ !"$&'()*,.\/0-9;=?@A-Z\^_`a-z~\x80-\xFF+\-]+/ ),
function ( result ) { return result.toString(); }
);
function templateParam() {
- var result = sequence( [
+ var expr, result;
+ result = sequence( [
pipe,
nOrMore( 0, paramExpression )
] );
if ( result === null ) {
return null;
}
- var expr = result[1];
- // use a "CONCAT" operator if there are multiple nodes, otherwise return the first node, raw.
- return expr.length > 1 ? [ "CONCAT" ].concat( expr ) : expr[0];
+ expr = result[1];
+ // use a CONCAT operator if there are multiple nodes, otherwise return the first node, raw.
+ return expr.length > 1 ? [ 'CONCAT' ].concat( expr ) : expr[0];
}
- var pipe = makeStringParser( '|' );
+ pipe = makeStringParser( '|' );
function templateWithReplacement() {
var result = sequence( [
templateName,
] );
return result === null ? null : [ result[0], result[2] ];
}
- var colon = makeStringParser(':');
- var templateContents = choice( [
+ colon = makeStringParser(':');
+ templateContents = choice( [
function () {
var res = sequence( [
// templates can have placeholders for dynamic replacement eg: {{PLURAL:$1|one car|$1 cars}}
return [ res[0] ].concat( res[1] );
}
] );
- var openTemplate = makeStringParser('{{');
- var closeTemplate = makeStringParser('}}');
+ openTemplate = makeStringParser('{{');
+ closeTemplate = makeStringParser('}}');
function template() {
var result = sequence( [
openTemplate,
] );
return result === null ? null : result[1];
}
- var nonWhitespaceExpression = choice( [
+ nonWhitespaceExpression = choice( [
template,
link,
extLinkParam,
replacement,
literalWithoutSpace
] );
- var paramExpression = choice( [
+ paramExpression = choice( [
template,
link,
extLinkParam,
replacement,
literalWithoutBar
] );
- var expression = choice( [
+ expression = choice( [
template,
link,
extLinkParam,
if ( result === null ) {
return null;
}
- return [ "CONCAT" ].concat( result );
+ return [ 'CONCAT' ].concat( result );
}
// everything above this point is supposed to be stateless/static, but
// I am deferring the work of turning it into prototypes & objects. It's quite fast enough
// finally let's do some actual work...
- var result = start();
+ result = start();
/*
* For success, the p must have gotten to the end of the input
* and returned a non-null.
* n.b. This is part of language infrastructure, so we do not throw an internationalizable message.
*/
- if (result === null || pos !== input.length) {
- throw new Error( "Parse error at position " + pos.toString() + " in input: " + input );
+ if ( result === null || pos !== input.length ) {
+ throw new Error( 'Parse error at position ' + pos.toString() + ' in input: ' + input );
}
return result;
}
* @return {Mixed} single-string node or array of nodes suitable for jQuery appending
*/
this.emit = function ( node, replacements ) {
- var ret = null;
- var jmsg = this;
+ var ret, subnodes, operation,
+ jmsg = this;
switch ( typeof node ) {
case 'string':
case 'number':
ret = node;
break;
- case 'object': // node is an array of nodes
- var subnodes = $.map( node.slice( 1 ), function ( n ) {
+ // typeof returns object for arrays
+ case 'object':
+ // node is an array of nodes
+ subnodes = $.map( node.slice( 1 ), function ( n ) {
return jmsg.emit( n, replacements );
} );
- var operation = node[0].toLowerCase();
+ operation = node[0].toLowerCase();
if ( typeof jmsg[operation] === 'function' ) {
ret = jmsg[ operation ]( subnodes, replacements );
} else {
/**
* Transform wiki-link
* TODO unimplemented
+ * @param nodes
*/
- wlink: function ( nodes ) {
+ wlink: function () {
return 'unimplemented';
},
* @return {jQuery}
*/
link: function ( nodes ) {
- var arg = nodes[0];
- var contents = nodes[1];
- var $el;
+ var $el,
+ arg = nodes[0],
+ contents = nodes[1];
if ( arg instanceof jQuery ) {
$el = arg;
} else {
* @return {String} selected pluralized form according to current language
*/
plural: function ( nodes ) {
- var count = parseFloat( this.language.convertNumber( nodes[0], true ) );
- var forms = nodes.slice(1);
+ var forms, count;
+ count = parseFloat( this.language.convertNumber( nodes[0], true ) );
+ forms = nodes.slice(1);
return forms.length ? this.language.convertPlural( count, forms ) : '';
},
* @return {String} selected grammatical form according to current language
*/
grammar: function ( nodes ) {
- var form = nodes[0];
- var word = nodes[1];
+ var form = nodes[0],
+ word = nodes[1];
return word && form && this.language.convertGrammar( word, form );
}
};
$.fn.msg = mw.jqueryMsg.getPlugin();
// Replace the default message parser with jqueryMsg
- var oldParser = mw.Message.prototype.parser;
+ oldParser = mw.Message.prototype.parser;
mw.Message.prototype.parser = function () {
// TODO: should we cache the message function so we don't create a new one every time? Benchmark this maybe?
// Caching is somewhat problematic, because we do need different message functions for different maps, so
*/
var mw = ( function ( $, undefined ) {
- "use strict";
+ 'use strict';
/* Private Members */
* Gets a message object, similar to wfMessage()
*
* @param key string Key of message to get
- * @param parameter_1 mixed First argument in a list of variadic arguments,
+ * @param parameter1 mixed First argument in a list of variadic arguments,
* each a parameter for $N replacement in messages.
* @return Message
*/
- message: function ( key, parameter_1 /* [, parameter_2] */ ) {
+ message: function ( key, parameter1 ) {
var parameters;
// Support variadic arguments
- if ( parameter_1 !== undefined ) {
+ if ( parameter1 !== undefined ) {
parameters = slice.call( arguments );
parameters.shift();
} else {
}
}
- function compare( a, b ) {
- var i;
- if ( a.length !== b.length ) {
- return false;
- }
- for ( i = 0; i < b.length; i += 1 ) {
- if ( $.isArray( a[i] ) ) {
- if ( !compare( a[i], b[i] ) ) {
- return false;
- }
- }
- if ( a[i] !== b[i] ) {
- return false;
- }
- }
- return true;
- }
-
/**
* Generates an ISO8601 "basic" string from a UNIX timestamp
*/
function formatVersionNumber( timestamp ) {
- var pad = function ( a, b, c ) {
- return [a < 10 ? '0' + a : a, b < 10 ? '0' + b : b, c < 10 ? '0' + c : c].join( '' );
- },
- d = new Date();
+ var d = new Date();
+ function pad( a, b, c ) {
+ return [a < 10 ? '0' + a : a, b < 10 ? '0' + b : b, c < 10 ? '0' + c : c].join( '' );
+ }
d.setTime( timestamp * 1000 );
return [
pad( d.getUTCFullYear(), d.getUTCMonth() + 1, d.getUTCDate() ), 'T',
j -= 1;
try {
if ( hasErrors ) {
- throw new Error ("Module " + module + " failed.");
+ throw new Error( 'Module ' + module + ' failed.');
} else {
if ( $.isFunction( job.ready ) ) {
job.ready();
* document ready has not yet occurred
*/
function request( dependencies, ready, error, async ) {
- var regItemDeps, regItemDepLen, n;
+ var n;
// Allow calling by single module name
if ( typeof dependencies === 'string' ) {
*/
function doRequest( moduleMap, currReqBase, sourceLoadScript, async ) {
var request = $.extend(
- { 'modules': buildModulesString( moduleMap ) },
+ { modules: buildModulesString( moduleMap ) },
currReqBase
);
request = sortQuery( request );
currReqBase = $.extend( { version: formatVersionNumber( maxVersion ) }, reqBase );
// For user modules append a user name to the request.
- if ( group === "user" && mw.config.get( 'wgUserName' ) !== null ) {
+ if ( group === 'user' && mw.config.get( 'wgUserName' ) !== null ) {
currReqBase.user = mw.config.get( 'wgUserName' );
}
currReqBaseLength = $.param( currReqBase ).length;
html: ( function () {
function escapeCallback( s ) {
switch ( s ) {
- case "'":
+ case '\'':
return ''';
case '"':
return '"';
( function ( mw, $ ) {
'use strict';
- var isPageReady = false,
+ var notification,
+ isPageReady = false,
isInitialized = false,
preReadyNotifQueue = [],
/**
// Other notification elements matching the same tag
$tagMatches,
outerHeight,
- placeholderHeight;
+ placeholderHeight,
+ autohideCount,
+ notif;
if ( this.isOpen ) {
return;
}
} );
+ notif = this;
+
// Create a clear placeholder we can use to make the notifications around the notification that is being
// replaced expand or contract gracefully to fit the height of the new notification.
- var self = this;
- self.$replacementPlaceholder = $( '<div>' )
+ notif.$replacementPlaceholder = $( '<div>' )
// Set the height to the space the previous notification or placeholder took
.css( 'height', outerHeight )
// Make sure that this placeholder is at the very end of this tagged notification group
// Reset the notification position after we've finished the space animation
// However do not do it if the placeholder was removed because another tagged
// notification went and closed this one.
- if ( self.$replacementPlaceholder ) {
+ if ( notif.$replacementPlaceholder ) {
$notification.css( 'position', '' );
}
// Finally, remove the placeholder from the DOM
// By default a notification is paused.
// If this notification is within the first {autoHideLimit} notifications then
// start the auto-hide timer as soon as it's created.
- var autohideCount = $area.find( '.mw-notification-autohide' ).length;
+ autohideCount = $area.find( '.mw-notification-autohide' ).length;
if ( autohideCount <= notification.autoHideLimit ) {
this.resume();
}
}
}
- var notification = {
+ notification = {
/**
* Pause auto-hide timers for all notifications.
* Notifications will not auto-hide until resume is called.
/* Fill $content var */
util.$content = ( function () {
- var $content, selectors = [
+ var i, l, $content, selectors;
+ selectors = [
// The preferred standard for setting $content (class="mw-body")
// You may also use (class="mw-body mw-body-primary") if you use
// mw-body in multiple locations.
// not inserted bodytext yet. But in any case <body> should always exist
'body'
];
- for ( var i = 0, l = selectors.length; i < l; i++ ) {
+ for ( i = 0, l = selectors.length; i < l; i++ ) {
$content = $( selectors[i] ).first();
if ( $content.length ) {
return $content;
// just add it to the bottom of their 'sidebar' element as a fallback
switch ( mw.config.get( 'skin' ) ) {
case 'standard':
- case 'cologneblue':
$( '#quickbar' ).append( $link.after( '<br/>' ) );
return $link[0];
case 'nostalgia':
* is determined by validation.
*/
validateEmail: function ( mailtxt ) {
- var rfc5322_atext, rfc1034_ldh_str, HTML5_email_regexp;
+ var rfc5322Atext, rfc1034LdhStr, html5EmailRegexp;
if ( mailtxt === '' ) {
return null;
"|" / "}" /
"~"
*/
- rfc5322_atext = "a-z0-9!#$%&'*+\\-/=?^_`{|}~";
+ rfc5322Atext = 'a-z0-9!#$%&\'*+\\-/=?^_`{|}~';
/**
* Next define the RFC 1034 'ldh-str'
* <let-dig-hyp> ::= <let-dig> | "-"
* <let-dig> ::= <letter> | <digit>
*/
- rfc1034_ldh_str = "a-z0-9\\-";
+ rfc1034LdhStr = 'a-z0-9\\-';
- HTML5_email_regexp = new RegExp(
+ html5EmailRegexp = new RegExp(
// start of string
'^'
+
// User part which is liberal :p
- '[' + rfc5322_atext + '\\.]+'
+ '[' + rfc5322Atext + '\\.]+'
+
// 'at'
'@'
+
// Domain first part
- '[' + rfc1034_ldh_str + ']+'
+ '[' + rfc1034LdhStr + ']+'
+
// Optional second part and following are separated by a dot
- '(?:\\.[' + rfc1034_ldh_str + ']+)*'
+ '(?:\\.[' + rfc1034LdhStr + ']+)*'
+
// End of string
'$',
// RegExp is case insensitive
'i'
);
- return (null !== mailtxt.match( HTML5_email_regexp ) );
+ return (null !== mailtxt.match( html5EmailRegexp ) );
},
/**
* continue loading the jquery and mediawiki modules. This code should work on
* even the most ancient of browsers, so be very careful when editing.
*/
+
/**
* Returns false when run in a black-listed browser
*
* This function will be deleted after it's used, so do not expand it to be
- * generally useful beyond startup
+ * generally useful beyond startup.
*
- * jQuery has minimum requirements of:
- * * Internet Explorer 6.0+
- * * Firefox 3.6+
- * * Safari 5.0+
- * * Opera 11+
- * * Chrome
+ * MediaWiki & jQuery compatibility:
+ * - Internet Explorer 6.0+
+ * - Firefox 10+
+ * - Safari 5.0+
+ * - Opera 11+
+ * - Chrome
*/
+
+/*jshint unused: false */
function isCompatible() {
// IE < 6.0
if ( navigator.appVersion.indexOf( 'MSIE' ) !== -1
{
return false;
}
- // @todo FIXME: Firefox < 3.6
- // @todo FIXME: Safari < 5.0
- // @todo FIXME: Opera < 11
return true;
}
+
/**
- * The startUp() function will be generated and added here (at the bottom)
+ * The startUp() function will be auto-generated and added below.
*/
?>
<div id="content">
<div id="topbar">
- <p id="sitetitle">
+ <p id="sitetitle" role="banner">
<a href="<?php echo htmlspecialchars( $this->data['nav_urls']['mainpage']['href'] ) ?>">
<?php echo wfMessage( 'sitetitle' )->escaped() ?>
</a>
</p>
<p id="sitesub"><?php echo wfMessage( 'sitesubtitle' )->escaped() ?></p>
- <div id="toplinks">
+ <div id="toplinks" role="navigation">
<p id="syslinks"><?php echo $this->sysLinks() ?></p>
<p id="variantlinks"><?php echo $this->variantLinks() ?></p>
</div>
- <div id="linkcollection">
+ <div id="linkcollection" role="navigation">
<div id="langlinks"><?php echo str_replace( '<br />', '', $this->otherLanguages() ) ?></div>
<?php echo $this->getSkin()->getCategories() ?>
<div id="titlelinks"><?php echo $this->pageTitleLinks() ?></div>
<?php } ?>
</div>
</div>
- <div id="article">
+ <div id="article" role="main">
<?php if ( $this->getSkin()->getSiteNotice() ) { ?>
<div id="siteNotice"><?php echo $this->getSkin()->getSiteNotice() ?></div>
<?php } ?>
ob_start();
?>
</div>
- <div id='footer'>
+ <div id="footer" role="contentinfo">
<?php
// Page-related links
echo $this->bottomLinks();
$qbmyoptions[$key] = null;
}
- $bar['qbedit'] = $qbedit;
- $bar['qbpageoptions'] = $qbpageoptions;
- $bar['qbmyoptions'] = $qbmyoptions;
+ // Use the closest reasonable name
+ $bar['cactions'] = $qbedit;
+ $bar['pageoptions'] = $qbpageoptions; // this is a non-standard portlet name, but nothing fits
+ $bar['personal'] = $qbmyoptions;
return $bar;
}
$bar = array();
foreach ( $orig_bar as $heading => $data ) {
if ( $heading == 'SEARCH' ) {
- $bar['qbfind'] = $this->searchForm( 'sidebar' );
+ $bar['search'] = $this->searchForm( 'sidebar' );
} elseif ( $heading == 'TOOLBOX' ) {
- $bar['toolbox'] = $this->getToolbox();
- } elseif ( $heading == 'navigation' ) {
- // Use the navigation heading from standard sidebar as the "browse" section
- $bar['qbbrowse'] = $data;
+ $bar['tb'] = $this->getToolbox();
} else {
$bar[$heading] = $data;
}
// Output the sidebar
+ // CologneBlue uses custom messages for some portlets, but we should keep the ids for consistency
+ $idToMessage = array(
+ 'search' => 'qbfind',
+ 'navigation' => 'qbbrowse',
+ 'tb' => 'toolbox',
+ 'cactions' => 'qbedit',
+ 'personal' => 'qbmyoptions',
+ 'pageoptions' => 'qbpageoptions',
+ );
+
$s = "<div id='quickbar'>\n";
foreach ( $bar as $heading => $data ) {
- $headingMsg = wfMessage( $heading );
- $headingHTML = "<h6>" . ( $headingMsg->exists() ? $headingMsg->escaped() : htmlspecialchars( $heading ) ) . "</h6>";
$portletId = Sanitizer::escapeId( "p-$heading" );
+ $headingMsg = wfMessage( $idToMessage[$heading] ? $idToMessage[$heading] : $heading );
+ $headingHTML = "<h6>" . ( $headingMsg->exists() ? $headingMsg->escaped() : htmlspecialchars( $heading ) ) . "</h6>";
$listHTML = "";
if ( is_array( $data ) ) {
}
if ( $listHTML ) {
- $s .= "<div class=\"portlet\" id=\"$portletId\">\n$headingHTML\n$listHTML\n</div>\n";
+ $role = ( $heading == 'search' ) ? 'search' : 'navigation';
+ $s .= "<div class=\"portlet\" id=\"$portletId\" role=\"$role\">\n$headingHTML\n$listHTML\n</div>\n";
}
}
<?php $this->cactions(); ?>
<!-- content -->
- <div id="mw_content">
+ <div id="mw_content" role="main">
<!-- contentholder does nothing by default, but it allows users to style the text inside
the content area without affecting the meaning of 'em' in #mw_content, which is used
for the margins -->
<div class="mw_clear"></div>
<!-- personal portlet -->
- <div class="portlet" id="p-personal">
+ <div class="portlet" id="p-personal" role="navigation">
<h5><?php $this->msg('personaltools') ?></h5>
<div class="pBody">
<ul>
<!-- footer -->
- <div id="footer"<?php $this->html('userlangattributes') ?>>
+ <div id="footer" role="contentinfo"<?php $this->html('userlangattributes') ?>>
<ul id="f-list">
<?php
foreach( $this->getFooterLinks("flat") as $aLink ) {
$this->html( 'headelement' );
?><div id="globalWrapper">
-<div id="column-content"><div id="content" class="mw-body-primary">
+<div id="column-content"><div id="content" class="mw-body-primary" role="main">
<a id="top"></a>
<?php if($this->data['sitenotice']) { ?><div id="siteNotice"><?php $this->html('sitenotice') ?></div><?php } ?>
</div></div>
<div id="column-one"<?php $this->html('userlangattributes') ?>>
<?php $this->cactions(); ?>
- <div class="portlet" id="p-personal">
+ <div class="portlet" id="p-personal" role="navigation">
<h5><?php $this->msg('personaltools') ?></h5>
<div class="pBody">
<ul<?php $this->html('userlangattributes') ?>>
</ul>
</div>
</div>
- <div class="portlet" id="p-logo">
+ <div class="portlet" id="p-logo" role="banner">
<?php
echo Html::element( 'a', array(
'href' => $this->data['nav_urls']['mainpage']['href'],
$validFooterLinks = $this->getFooterLinks( "flat" ); // Additional footer links
if ( count( $validFooterIcons ) + count( $validFooterLinks ) > 0 ) { ?>
-<div id="footer"<?php $this->html('userlangattributes') ?>>
+<div id="footer" role="contentinfo"<?php $this->html('userlangattributes') ?>>
<?php
$footerEnd = '</div>';
} else {
function searchBox() {
global $wgUseTwoButtonsSearchForm;
?>
- <div id="p-search" class="portlet">
+ <div id="p-search" class="portlet" role="search">
<h5><label for="searchInput"><?php $this->msg('search') ?></label></h5>
<div id="searchBody" class="pBody">
<form action="<?php $this->text('wgScript') ?>" id="searchform">
*/
function cactions() {
?>
- <div id="p-cactions" class="portlet">
+ <div id="p-cactions" class="portlet" role="navigation">
<h5><?php $this->msg('views') ?></h5>
<div class="pBody">
<ul><?php
/*************************************************************************************************/
function toolbox() {
?>
- <div class="portlet" id="p-tb">
+ <div class="portlet" id="p-tb" role="navigation">
<h5><?php $this->msg('toolbox') ?></h5>
<div class="pBody">
<ul>
function languageBox() {
if( $this->data['language_urls'] ) {
?>
- <div id="p-lang" class="portlet">
+ <div id="p-lang" class="portlet" role="navigation">
<h5<?php $this->html('userlangattributes') ?>><?php $this->msg('otherlanguages') ?></h5>
<div class="pBody">
<ul>
* @param $cont array|string
*/
function customBox( $bar, $cont ) {
- $portletAttribs = array( 'class' => 'generated-sidebar portlet', 'id' => Sanitizer::escapeId( "p-$bar" ) );
+ $portletAttribs = array( 'class' => 'generated-sidebar portlet', 'id' => Sanitizer::escapeId( "p-$bar" ), 'role' => 'navigation' );
$tooltip = Linker::titleAttrib( "p-$bar" );
if ( $tooltip !== false ) {
$portletAttribs['title'] = $tooltip;
<div id="mw-page-base" class="noprint"></div>
<div id="mw-head-base" class="noprint"></div>
<!-- content -->
- <div id="content" class="mw-body">
+ <div id="content" class="mw-body" role="main">
<a id="top"></a>
<div id="mw-js-message" style="display:none;"<?php $this->html( 'userlangattributes' ) ?>></div>
<?php if ( $this->data['sitenotice'] ): ?>
<!-- panel -->
<div id="mw-panel" class="noprint">
<!-- logo -->
- <div id="p-logo"><a style="background-image: url(<?php $this->text( 'logopath' ) ?>);" href="<?php echo htmlspecialchars( $this->data['nav_urls']['mainpage']['href'] ) ?>" <?php echo Xml::expandAttributes( Linker::tooltipAndAccesskeyAttribs( 'p-logo' ) ) ?>></a></div>
+ <div id="p-logo" role="banner"><a style="background-image: url(<?php $this->text( 'logopath' ) ?>);" href="<?php echo htmlspecialchars( $this->data['nav_urls']['mainpage']['href'] ) ?>" <?php echo Xml::expandAttributes( Linker::tooltipAndAccesskeyAttribs( 'p-logo' ) ) ?>></a></div>
<!-- /logo -->
<?php $this->renderPortals( $this->data['sidebar'] ); ?>
</div>
<!-- /panel -->
<!-- footer -->
- <div id="footer"<?php $this->html( 'userlangattributes' ) ?>>
+ <div id="footer" role="contentinfo"<?php $this->html( 'userlangattributes' ) ?>>
<?php foreach( $this->getFooterLinks() as $category => $links ): ?>
<ul id="footer-<?php echo $category ?>">
<?php foreach( $links as $link ): ?>
$msg = $name;
}
?>
-<div class="portal" id='<?php echo Sanitizer::escapeId( "p-$name" ) ?>'<?php echo Linker::tooltip( 'p-' . $name ) ?>>
+<div class="portal" role="navigation" id='<?php echo Sanitizer::escapeId( "p-$name" ) ?>'<?php echo Linker::tooltip( 'p-' . $name ) ?>>
<h5<?php $this->html( 'userlangattributes' ) ?>><?php $msgObj = wfMessage( $msg ); echo htmlspecialchars( $msgObj->exists() ? $msgObj->text() : $msg ); ?></h5>
<div class="body">
<?php
* @param $elements array
*/
protected function renderNavigation( $elements ) {
- global $wgVectorUseSimpleSearch;
+ global $wgVectorUseSimpleSearch, $wgVectorCombineUserTalk;
// If only one element was given, wrap it in an array, allowing more
// flexible arguments
switch ( $element ) {
case 'NAMESPACES':
?>
-<div id="p-namespaces" class="vectorTabs<?php if ( count( $this->data['namespace_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
+<div id="p-namespaces" role="navigation" class="vectorTabs<?php if ( count( $this->data['namespace_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
<h5><?php $this->msg( 'namespaces' ) ?></h5>
<ul<?php $this->html( 'userlangattributes' ) ?>>
<?php foreach ( $this->data['namespace_urls'] as $link ): ?>
break;
case 'VARIANTS':
?>
-<div id="p-variants" class="vectorMenu<?php if ( count( $this->data['variant_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
+<div id="p-variants" role="navigation" class="vectorMenu<?php if ( count( $this->data['variant_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
<h4>
<?php foreach ( $this->data['variant_urls'] as $link ): ?>
<?php if ( stripos( $link['attributes'], 'selected' ) !== false ): ?>
break;
case 'VIEWS':
?>
-<div id="p-views" class="vectorTabs<?php if ( count( $this->data['view_urls'] ) == 0 ) { echo ' emptyPortlet'; } ?>">
+<div id="p-views" role="navigation" class="vectorTabs<?php if ( count( $this->data['view_urls'] ) == 0 ) { echo ' emptyPortlet'; } ?>">
<h5><?php $this->msg('views') ?></h5>
<ul<?php $this->html('userlangattributes') ?>>
<?php foreach ( $this->data['view_urls'] as $link ): ?>
break;
case 'ACTIONS':
?>
-<div id="p-cactions" class="vectorMenu<?php if ( count( $this->data['action_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
+<div id="p-cactions" role="navigation" class="vectorMenu<?php if ( count( $this->data['action_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
<h5><span><?php $this->msg( 'actions' ) ?></span><a href="#"></a></h5>
<div class="menu">
<ul<?php $this->html( 'userlangattributes' ) ?>>
break;
case 'PERSONAL':
?>
-<div id="p-personal" class="<?php if ( count( $this->data['personal_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
+<div id="p-personal" role="navigation" class="<?php if ( count( $this->data['personal_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
<h5><?php $this->msg( 'personaltools' ) ?></h5>
<ul<?php $this->html( 'userlangattributes' ) ?>>
-<?php foreach( $this->getPersonalTools() as $key => $item ) { ?>
- <?php echo $this->makeListItem( $key, $item ); ?>
-
-<?php } ?>
+<?php
+ $personalTools = $this->getPersonalTools();
+ if ( $wgVectorCombineUserTalk && isset( $personalTools['userpage'] ) ) {
+?>
+ <li>
+<?php
+ echo $this->makeListItem( 'userpage', $personalTools['userpage'], array( 'tag' => 'span' ) );
+?> <?php
+ $personalTools['mytalk']['links'][0]['text'] = $this->getMsg( 'mytalk-parenthetical' )->text();
+ $talkItem = $this->makeListItem( 'mytalk', $personalTools['mytalk'], array( 'tag' => 'span' ) );
+ echo $this->getMsg( 'parentheses' )->rawParams( $talkItem )->escaped();
+ unset( $personalTools['userpage'], $personalTools['mytalk'] );
+?>
+ </li>
+<?php
+ }
+ foreach ( $personalTools as $key => $item ) {
+ echo $this->makeListItem( $key, $item );
+ }
+?>
</ul>
</div>
<?php
break;
case 'SEARCH':
?>
-<div id="p-search">
+<div id="p-search" role="search">
<h5<?php $this->html( 'userlangattributes' ) ?>><label for="searchInput"><?php $this->msg( 'search' ) ?></label></h5>
<form action="<?php $this->text( 'wgScript' ) ?>" id="searchform">
<?php if ( $wgVectorUseSimpleSearch && $this->getSkin()->getUser()->getOption( 'vector-simplesearch' ) ): ?>
*/
global $wgAutoloadClasses;
-$testFolder = __DIR__;
+$testDir = __DIR__;
$wgAutoloadClasses += array(
- //PHPUnit
- 'MediaWikiTestCase' => "$testFolder/phpunit/MediaWikiTestCase.php",
- 'MediaWikiPHPUnitCommand' => "$testFolder/phpunit/MediaWikiPHPUnitCommand.php",
- 'MediaWikiLangTestCase' => "$testFolder/phpunit/MediaWikiLangTestCase.php",
- 'NewParserTest' => "$testFolder/phpunit/includes/parser/NewParserTest.php",
+ # tests
+ 'DbTestPreviewer' => "$testDir/testHelpers.inc",
+ 'DbTestRecorder' => "$testDir/testHelpers.inc",
+ 'DelayedParserTest' => "$testDir/testHelpers.inc",
+ 'TestFileIterator' => "$testDir/testHelpers.inc",
+ 'TestRecorder' => "$testDir/testHelpers.inc",
- //includes
- 'BlockTest' => "$testFolder/phpunit/includes/BlockTest.php",
+ # tests/phpunit
+ 'MediaWikiTestCase' => "$testDir/phpunit/MediaWikiTestCase.php",
+ 'MediaWikiPHPUnitCommand' => "$testDir/phpunit/MediaWikiPHPUnitCommand.php",
+ 'MediaWikiLangTestCase' => "$testDir/phpunit/MediaWikiLangTestCase.php",
+ 'MediaWikiProvide' => "$testDir/phpunit/includes/Providers.php",
+ 'TestUser' => "$testDir/phpunit/includes/TestUser.php",
- //API
- 'ApiFormatTestBase' => "$testFolder/phpunit/includes/api/format/ApiFormatTestBase.php",
- 'ApiTestCase' => "$testFolder/phpunit/includes/api/ApiTestCase.php",
- 'TestUser' => "$testFolder/phpunit/includes/TestUser.php",
- 'MockApi' => "$testFolder/phpunit/includes/api/ApiTestCase.php",
- 'RandomImageGenerator' => "$testFolder/phpunit/includes/api/RandomImageGenerator.php",
- 'UserWrapper' => "$testFolder/phpunit/includes/api/ApiTestCase.php",
+ # tests/phpunit/includes
+ 'BlockTest' => "$testDir/phpunit/includes/BlockTest.php",
+ 'RevisionStorageTest' => "$testDir/phpunit/includes/RevisionStorageTest.php",
+ 'WikiPageTest' => "$testDir/phpunit/includes/WikiPageTest.php",
//db
- 'ORMTableTest' => "$testFolder/phpunit/includes/db/ORMTableTest.php",
+ 'ORMTableTest' => "$testDir/phpunit/includes/db/ORMTableTest.php",
//Selenium
- 'SeleniumTestConstants' => "$testFolder/selenium/SeleniumTestConstants.php",
+ 'SeleniumTestConstants' => "$testDir/selenium/SeleniumTestConstants.php",
- //maintenance
- 'DumpTestCase' => "$testFolder/phpunit/maintenance/DumpTestCase.php",
- 'BackupDumper' => "$testFolder/../maintenance/backup.inc",
+ # tests/phpunit/includes/api
+ 'ApiFormatTestBase' => "$testDir/phpunit/includes/api/format/ApiFormatTestBase.php",
+ 'ApiTestCase' => "$testDir/phpunit/includes/api/ApiTestCase.php",
+ 'ApiTestContext' => "$testDir/phpunit/includes/api/ApiTestCase.php",
+ 'MockApi' => "$testDir/phpunit/includes/api/ApiTestCase.php",
+ 'RandomImageGenerator' => "$testDir/phpunit/includes/api/RandomImageGenerator.php",
+ 'UserWrapper' => "$testDir/phpunit/includes/api/ApiTestCase.php",
- //language
- 'LanguageClassesTestCase' => "$testFolder/phpunit/languages/LanguageClassesTestCase.php",
+ # tests/phpunit/includes/content
+ 'DummyContentHandlerForTesting' => "$testDir/phpunit/includes/content/ContentHandlerTest.php",
+ 'DummyContentForTesting' => "$testDir/phpunit/includes/content/ContentHandlerTest.php",
+ 'ContentHandlerTest' => "$testDir/phpunit/includes/content/ContentHandlerTest.php",
+ 'JavascriptContentTest' => "$testDir/phpunit/includes/content/JavascriptContentTest.php",
+ 'TextContentTest' => "$testDir/phpunit/includes/content/TextContentTest.php",
- //Generic providers
- 'MediaWikiProvide' => "$testFolder/phpunit/includes/Providers.php",
+ # tests/phpunit/includes/db
+ 'ORMRowTest' => "$testDir/phpunit/includes/db/ORMRowTest.php",
+
+ # tests/phpunit/includes/parser
+ 'NewParserTest' => "$testDir/phpunit/includes/parser/NewParserTest.php",
+
+ # tests/phpunit/includes/libs
+ 'GenericArrayObjectTest' => "$testDir/phpunit/includes/libs/GenericArrayObjectTest.php",
+
+ # tests/phpunit/includes/site
+ 'SiteObjectTest' => "$testDir/phpunit/includes/site/SiteObjectTest.php",
+ 'TestSites' => "$testDir/phpunit/includes/site/TestSites.php",
+
+ # tests/phpunit/languages
+ 'LanguageClassesTestCase' => "$testDir/phpunit/languages/LanguageClassesTestCase.php",
+
+ # tests/phpunit/maintenance
+ 'DumpTestCase' => "$testDir/phpunit/maintenance/DumpTestCase.php",
+
+ # tests/parser
+ 'ParserTest' => "$testDir/parser/parserTest.inc",
+ 'ParserTestParserHook' => "$testDir/parser/parserTestsParserHook.php",
+
+ # tests/selenium
+ 'Selenium' => "$testDir/selenium/Selenium.php",
+ 'SeleniumLoader' => "$testDir/selenium/SeleniumLoader.php",
+ 'SeleniumTestCase' => "$testDir/selenium/SeleniumTestCase.php",
+ 'SeleniumTestConsoleLogger' => "$testDir/selenium/SeleniumTestConsoleLogger.php",
+ 'SeleniumTestConstants' => "$testDir/selenium/SeleniumTestConstants.php",
+ 'SeleniumTestHTMLLogger' => "$testDir/selenium/SeleniumTestHTMLLogger.php",
+ 'SeleniumTestListener' => "$testDir/selenium/SeleniumTestListener.php",
+ 'SeleniumTestSuite' => "$testDir/selenium/SeleniumTestSuite.php",
+ 'SeleniumConfig' => "$testDir/selenium/SeleniumConfig.php",
);
--- /dev/null
+<?php
+class AutoLoaderTest extends MediaWikiTestCase {
+
+ public function testAutoLoadConfig() {
+ $results = self::checkAutoLoadConf();
+
+ $this->assertEquals(
+ $results['expected'],
+ $results['actual']
+ );
+ }
+
+ protected static function checkAutoLoadConf() {
+ global $wgAutoloadLocalClasses, $wgAutoloadClasses, $IP;
+ static $supportsParsekit;
+ $supportsParsekit = function_exists( 'parsekit_compile_file' );
+
+ // wgAutoloadLocalClasses has precedence, just like in includes/AutoLoader.php
+ $expected = $wgAutoloadLocalClasses + $wgAutoloadClasses;
+ $actual = array();
+
+ $files = array_unique( $expected );
+
+ foreach ( $files as $file ) {
+ // Only prefix $IP if it doesn't have it already.
+ // Generally local classes don't have it, and those from extensions and test suites do.
+ if ( substr( $file, 0, 1 ) != '/' && substr( $file, 1, 1 ) != ':' ) {
+ $filePath = "$IP/$file";
+ } else {
+ $filePath = $file;
+ }
+ if ( $supportsParsekit ) {
+ $parseInfo = parsekit_compile_file( "$filePath" );
+ $classes = array_keys( $parseInfo['class_table'] );
+ } else {
+ $contents = file_get_contents( "$filePath" );
+ $m = array();
+ preg_match_all( '/\n\s*(?:final)?\s*(?:abstract)?\s*(?:class|interface)\s+([a-zA-Z0-9_]+)/', $contents, $m, PREG_PATTERN_ORDER );
+ $classes = $m[1];
+ }
+ foreach ( $classes as $class ) {
+ $actual[$class] = $file;
+ }
+ }
+
+ return array(
+ 'expected' => $expected,
+ 'actual' => $actual,
+ );
+ }
+}
<?php
/**
- * @group Editing
+ * @group Editing
+ *
+ * @group Database
+ * ^--- tell jenkins this test needs the database
+ *
+ * @group medium
+ * ^--- tell phpunit that these test cases may take longer than 2 seconds.
*/
class EditPageTest extends MediaWikiTestCase {
),
);
}
+
+ protected function forceRevisionDate( WikiPage $page, $timestamp ) {
+ $dbw = wfGetDB( DB_MASTER );
+
+ $dbw->update( 'revision',
+ array( 'rev_timestamp' => $timestamp ),
+ array( 'rev_id' => $page->getLatest() ) );
+
+ $page->clear();
+ }
+
+ /**
+ * User input text is passed to rtrim() by edit page. This is a simple
+ * wrapper around assertEquals() which calls rrtrim() to normalize the
+ * expected and actual texts.
+ */
+ function assertEditedTextEquals( $expected, $actual, $msg='' ) {
+ return $this->assertEquals( rtrim($expected), rtrim($actual), $msg );
+ }
+
+ /**
+ * Performs an edit and checks the result.
+ *
+ * @param String|Title $title The title of the page to edit
+ * @param String|null $baseText Some text to create the page with before attempting the edit.
+ * @param User|String|null $user The user to perform the edit as.
+ * @param array $edit An array of request parameters used to define the edit to perform.
+ * Some well known fields are:
+ * * wpTextbox1: the text to submit
+ * * wpSummary: the edit summary
+ * * wpEditToken: the edit token (will be inserted if not provided)
+ * * wpEdittime: timestamp of the edit's base revision (will be inserted if not provided)
+ * * wpStarttime: timestamp when the edit started (will be inserted if not provided)
+ * * wpSectionTitle: the section to edit
+ * * wpMinorEdit: mark as minor edit
+ * * wpWatchthis: whether to watch the page
+ * @param int|null $expectedCode The expected result code (EditPage::AS_XXX constants).
+ * Set to null to skip the check. Defaults to EditPage::AS_OK.
+ * @param String|null $expectedText The text expected to be on the page after the edit.
+ * Set to null to skip the check.
+ * @param String|null $message An optional message to show along with any error message.
+ *
+ * @return WikiPage The page that was just edited, useful for getting the edit's rev_id, etc.
+ */
+ protected function assertEdit( $title, $baseText, $user = null, array $edit,
+ $expectedCode = EditPage::AS_OK, $expectedText = null, $message = null
+ ) {
+ if ( is_string( $title ) ) {
+ $ns = $this->getDefaultWikitextNS();
+ $title = Title::newFromText( $title, $ns );
+ }
+
+ if ( is_string( $user ) ) {
+ $user = User::newFromName( $user );
+
+ if ( $user->getId() === 0 ) {
+ $user->addToDatabase();
+ }
+ }
+
+ $page = WikiPage::factory( $title );
+
+ if ( $baseText !== null ) {
+ $content = ContentHandler::makeContent( $baseText, $title );
+ $page->doEditContent( $content, "base text for test" );
+ $this->forceRevisionDate( $page, '20120101000000' );
+
+ //sanity check
+ $page->clear();
+ $currentText = ContentHandler::getContentText( $page->getContent() );
+
+ # EditPage rtrim() the user input, so we alter our expected text
+ # to reflect that.
+ $this->assertEditedTextEquals( $baseText, $currentText );
+ }
+
+ if ( $user == null ) {
+ $user = $GLOBALS['wgUser'];
+ } else {
+ $this->setMwGlobals( 'wgUser', $user );
+ }
+
+ if ( !isset( $edit['wpEditToken'] ) ) {
+ $edit['wpEditToken'] = $user->getEditToken();
+ }
+
+ if ( !isset( $edit['wpEdittime'] ) ) {
+ $edit['wpEdittime'] = $page->exists() ? $page->getTimestamp() : '';
+ }
+
+ if ( !isset( $edit['wpStarttime'] ) ) {
+ $edit['wpStarttime'] = wfTimestampNow();
+ }
+
+ $req = new FauxRequest( $edit, true ); // session ??
+
+ $ep = new EditPage( new Article( $title ) );
+ $ep->setContextTitle( $title );
+ $ep->importFormData( $req );
+
+ $bot = isset( $edit['bot'] ) ? (bool)$edit['bot'] : false;
+
+ // this is where the edit happens!
+ // Note: don't want to use EditPage::AttemptSave, because it messes with $wgOut
+ // and throws exceptions like PermissionsError
+ $status = $ep->internalAttemptSave( $result, $bot );
+
+ if ( $expectedCode !== null ) {
+ // check edit code
+ $this->assertEquals( $expectedCode, $status->value,
+ "Expected result code mismatch. $message" );
+ }
+
+ $page = WikiPage::factory( $title );
+
+ if ( $expectedText !== null ) {
+ // check resulting page text
+ $content = $page->getContent();
+ $text = ContentHandler::getContentText( $content );
+
+ # EditPage rtrim() the user input, so we alter our expected text
+ # to reflect that.
+ $this->assertEditedTextEquals( $expectedText, $text,
+ "Expected article text mismatch. $message" );
+ }
+
+ return $page;
+ }
+
+ public function testCreatePage() {
+ $text = "Hello World!";
+ $edit = array(
+ 'wpTextbox1' => $text,
+ 'wpSummary' => 'just testing',
+ );
+
+ $this->assertEdit( 'EditPageTest_testCreatePafe', null, null, $edit,
+ EditPage::AS_SUCCESS_NEW_ARTICLE, $text,
+ "expected successfull creation with given text" );
+ }
+
+ public function testUpdatePage() {
+ $text = "one";
+ $edit = array(
+ 'wpTextbox1' => $text,
+ 'wpSummary' => 'first update',
+ );
+
+ $page = $this->assertEdit( 'EditPageTest_testUpdatePage', "zero", null, $edit,
+ EditPage::AS_SUCCESS_UPDATE, $text,
+ "expected successfull update with given text" );
+
+ $this->forceRevisionDate( $page, '20120101000000' );
+
+ $text = "two";
+ $edit = array(
+ 'wpTextbox1' => $text,
+ 'wpSummary' => 'second update',
+ );
+
+ $this->assertEdit( 'EditPageTest_testUpdatePage', null, null, $edit,
+ EditPage::AS_SUCCESS_UPDATE, $text,
+ "expected successfull update with given text" );
+ }
+
+ public static function provideSectionEdit() {
+ $text =
+'Intro
+
+== one ==
+first section.
+
+== two ==
+second section.
+';
+
+ $sectionOne =
+'== one ==
+hello
+';
+
+ $newSection =
+'== new section ==
+
+hello
+';
+
+ $textWithNewSectionOne = preg_replace( '/== one ==.*== two ==/ms',
+ "$sectionOne\n== two ==", $text );
+
+ $textWithNewSectionAdded = "$text\n$newSection";
+
+ return array(
+ array( #0
+ $text,
+ '',
+ 'hello',
+ 'replace all',
+ 'hello'
+ ),
+
+ array( #1
+ $text,
+ '1',
+ $sectionOne,
+ 'replace first section',
+ $textWithNewSectionOne,
+ ),
+
+ array( #2
+ $text,
+ 'new',
+ 'hello',
+ 'new section',
+ $textWithNewSectionAdded,
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider provideSectionEdit
+ */
+ public function testSectionEdit( $base, $section, $text, $summary, $expected ) {
+ $edit = array(
+ 'wpTextbox1' => $text,
+ 'wpSummary' => $summary,
+ 'wpSection' => $section,
+ );
+
+ $this->assertEdit( 'EditPageTest_testSectionEdit', $base, null, $edit,
+ EditPage::AS_SUCCESS_UPDATE, $expected,
+ "expected successfull update of section" );
+ }
+
+ public static function provideAutoMerge() {
+ $tests = array();
+
+ $tests[] = array( #0: plain conflict
+ "Elmo", # base edit user
+ "one\n\ntwo\n\nthree\n",
+ array( #adam's edit
+ 'wpStarttime' => 1,
+ 'wpTextbox1' => "ONE\n\ntwo\n\nthree\n",
+ ),
+ array( #berta's edit
+ 'wpStarttime' => 2,
+ 'wpTextbox1' => "(one)\n\ntwo\n\nthree\n",
+ ),
+ EditPage::AS_CONFLICT_DETECTED, # expected code
+ "ONE\n\ntwo\n\nthree\n", # expected text
+ 'expected edit conflict', # message
+ );
+
+ $tests[] = array( #1: successful merge
+ "Elmo", # base edit user
+ "one\n\ntwo\n\nthree\n",
+ array( #adam's edit
+ 'wpStarttime' => 1,
+ 'wpTextbox1' => "ONE\n\ntwo\n\nthree\n",
+ ),
+ array( #berta's edit
+ 'wpStarttime' => 2,
+ 'wpTextbox1' => "one\n\ntwo\n\nTHREE\n",
+ ),
+ EditPage::AS_SUCCESS_UPDATE, # expected code
+ "ONE\n\ntwo\n\nTHREE\n", # expected text
+ 'expected automatic merge', # message
+ );
+
+ $text = "Intro\n\n";
+ $text .= "== first section ==\n\n";
+ $text .= "one\n\ntwo\n\nthree\n\n";
+ $text .= "== second section ==\n\n";
+ $text .= "four\n\nfive\n\nsix\n\n";
+
+ // extract the first section.
+ $section = preg_replace( '/.*(== first section ==.*)== second section ==.*/sm', '$1', $text );
+
+ // generate expected text after merge
+ $expected = str_replace( 'one', 'ONE', str_replace( 'three', 'THREE', $text ) );
+
+ $tests[] = array( #2: merge in section
+ "Elmo", # base edit user
+ $text,
+ array( #adam's edit
+ 'wpStarttime' => 1,
+ 'wpTextbox1' => str_replace( 'one', 'ONE', $section ),
+ 'wpSection' => '1'
+ ),
+ array( #berta's edit
+ 'wpStarttime' => 2,
+ 'wpTextbox1' => str_replace( 'three', 'THREE', $section ),
+ 'wpSection' => '1'
+ ),
+ EditPage::AS_SUCCESS_UPDATE, # expected code
+ $expected, # expected text
+ 'expected automatic section merge', # message
+ );
+
+ // see whether it makes a difference who did the base edit
+ $testsWithAdam = array_map( function( $test ) {
+ $test[0] = 'Adam'; // change base edit user
+ return $test;
+ }, $tests );
+
+ $testsWithBerta = array_map( function( $test ) {
+ $test[0] = 'Berta'; // change base edit user
+ return $test;
+ }, $tests );
+
+ return array_merge( $tests, $testsWithAdam, $testsWithBerta );
+ }
+
+ function testHasValidDiff3() {
+ global $wgDiff3;
+
+ if ( !$wgDiff3 ) {
+ $this->markTestSkipped( "Can't test conflict resolution because \$wgDiff3 is not configured" );
+ } elseif ( !file_exists( $wgDiff3 ) ) {
+ #XXX: this sucks, since it uses arcane internal knowledge about TextContentHandler::merge3 and wfMerge.
+ $this->markTestSkipped( "Can't test conflict resolution because \$wgDiff3 is misconfigured: can't find $wgDiff3" );
+ }
+ $this->assertTrue( true );
+ }
+
+ /**
+ * @depend testHasValidDiff3
+ * @dataProvider provideAutoMerge
+ */
+ public function testAutoMerge( $baseUser, $text, $adamsEdit, $bertasEdit,
+ $expectedCode, $expectedText, $message = null
+ ) {
+
+ //create page
+ $ns = $this->getDefaultWikitextNS();
+ $title = Title::newFromText( 'EditPageTest_testAutoMerge', $ns );
+ $page = WikiPage::factory( $title );
+
+ if ( $page->exists() ) {
+ $page->doDeleteArticle( "clean slate for testing" );
+ }
+
+ $baseEdit = array(
+ 'wpTextbox1' => $text,
+ );
+
+ $page = $this->assertEdit( 'EditPageTest_testAutoMerge', null,
+ $baseUser, $baseEdit, null, null, __METHOD__ );
+
+ $this->forceRevisionDate( $page, '20120101000000' );
+
+ $edittime = $page->getTimestamp();
+
+ // start timestamps for conflict detection
+ if ( !isset( $adamsEdit['wpStarttime'] ) ) {
+ $adamsEdit['wpStarttime'] = 1;
+ }
+
+ if ( !isset( $bertasEdit['wpStarttime'] ) ) {
+ $bertasEdit['wpStarttime'] = 2;
+ }
+
+ $starttime = wfTimestampNow();
+ $adamsTime = wfTimestamp( TS_MW, (int)wfTimestamp( TS_UNIX, $starttime ) + (int)$adamsEdit['wpStarttime'] );
+ $bertasTime = wfTimestamp( TS_MW, (int)wfTimestamp( TS_UNIX, $starttime ) + (int)$bertasEdit['wpStarttime'] );
+
+ $adamsEdit['wpStarttime'] = $adamsTime;
+ $bertasEdit['wpStarttime'] = $bertasTime;
+
+ $adamsEdit['wpSummary'] = 'Adam\'s edit';
+ $bertasEdit['wpSummary'] = 'Bertas\'s edit';
+
+ $adamsEdit['wpEdittime'] = $edittime;
+ $bertasEdit['wpEdittime'] = $edittime;
+
+ // first edit
+ $this->assertEdit( 'EditPageTest_testAutoMerge', null, 'Adam', $adamsEdit,
+ EditPage::AS_SUCCESS_UPDATE, null, "expected successfull update" );
+
+ // second edit
+ $this->assertEdit( 'EditPageTest_testAutoMerge', null, 'Berta', $bertasEdit,
+ $expectedCode, $expectedText, $message );
+ }
}
);
}
+ /**
+ * @param String $old: Text as it was in the database
+ * @param String $mine: Text submitted while user was editing
+ * @param String $yours: Text submitted by the user
+ * @param Boolean $expectedMergeResult Whether the merge should be a success
+ * @param String $expectedText: Text after merge has been completed
+ *
+ * @dataProvider provideMerge()
+ */
+ public function testMerge( $old, $mine, $yours, $expectedMergeResult, $expectedText ) {
+ $mergedText = null;
+ $isMerged = wfMerge( $old, $mine, $yours, $mergedText );
+
+ $msg = 'Merge should be a ';
+ $msg .= $expectedMergeResult ? 'success' : 'failure';
+ $this->assertEquals( $expectedMergeResult, $isMerged, $msg );
+
+ if( $isMerged ) {
+ // Verify the merged text
+ $this->assertEquals( $expectedText, $mergedText,
+ 'is merged text as expected?' );
+ }
+ }
+
+ public static function provideMerge() {
+ $EXPECT_MERGE_SUCCESS = true;
+ $EXPECT_MERGE_FAILURE = false;
+
+ return array(
+
+ // #0: clean merge
+ array(
+ // old:
+ "one one one\n" . // trimmed
+ "\n" .
+ "two two two",
+
+ // mine:
+ "one one one ONE ONE\n" .
+ "\n" .
+ "two two two\n", // with tailing whitespace
+
+ // yours:
+ "one one one\n" .
+ "\n" .
+ "two two TWO TWO", // trimmed
+
+ // ok:
+ $EXPECT_MERGE_SUCCESS,
+
+ // result:
+ "one one one ONE ONE\n" .
+ "\n" .
+ "two two TWO TWO\n", // note: will always end in a newline
+ ),
+
+ // #1: conflict, fail
+ array(
+ // old:
+ "one one one", // trimmed
+
+ // mine:
+ "one one one ONE ONE\n" .
+ "\n" .
+ "bla bla\n" .
+ "\n", // with tailing whitespace
+
+ // yours:
+ "one one one\n" .
+ "\n" .
+ "two two", // trimmed
+
+ $EXPECT_MERGE_FAILURE,
+
+ // result:
+ null,
+ ),
+ );
+ }
+
/**
* @dataProvider provideMakeUrlIndexes()
*/
--- /dev/null
+<?php
+
+class RequestContextTest extends MediaWikiTestCase {
+
+ /**
+ * Test the relationship between title and wikipage in RequestContext
+ */
+ public function testWikiPageTitle() {
+ $context = new RequestContext();
+
+ $curTitle = Title::newFromText( "A" );
+ $context->setTitle( $curTitle );
+ $this->assertTrue( $curTitle->equals( $context->getWikiPage()->getTitle() ),
+ "When a title is first set WikiPage should be created on-demand for that title." );
+
+ $curTitle = Title::newFromText( "B" );
+ $context->setWikiPage( WikiPage::factory( $curTitle ) );
+ $this->assertTrue( $curTitle->equals( $context->getTitle() ),
+ "Title must be updated when a new WikiPage is provided." );
+
+ $curTitle = Title::newFromText( "C" );
+ $context->setTitle( $curTitle );
+ $this->assertTrue( $curTitle->equals( $context->getWikiPage()->getTitle() ),
+ "When a title is updated the WikiPage should be purged and recreated on-demand with the new title." );
+
+ }
+
+}
$this->assertEquals( 'hello hello.', $rev->getText() );
}
+ /**
+ * @covers Revision::getContent
+ */
+ public function testGetContent_failure()
+ {
+ $rev = new Revision( array(
+ 'page' => $this->the_page->getId(),
+ 'content_model' => $this->the_page->getContentModel(),
+ 'text_id' => 123456789, // not in the test DB
+ ) );
+
+ $this->assertNull( $rev->getContent(),
+ "getContent() should return null if the revision's text blob could not be loaded." );
+
+ //NOTE: check this twice, once for lazy initialization, and once with the cached value.
+ $this->assertNull( $rev->getContent(),
+ "getContent() should return null if the revision's text blob could not be loaded." );
+ }
+
/**
* @covers Revision::getContent
*/
CONTENT_MODEL_WIKITEXT,
CONTENT_MODEL_CSS,
CONTENT_MODEL_JAVASCRIPT,
- )
+ ),
+ 'wgAlwaysUseTidy' => false,
) );
$this->context = new RequestContext( new FauxRequest() );
/**
* @dataProvider constructorTestProvider
- * @depends testSave()
+ * @depends testSave
*/
public function testRemove( array $data, $loadDefaults ) {
$item = $this->getRowInstance( $data, $loadDefaults );
public static function provideBadNames() {
return array( array( "foo<bar" ), array( "foo>bar" ), array( "foo\nbar" ), array( "foo\rbar" ) );
}
-
+
+ protected function setUp() {
+ parent::setUp();
+
+ $this->setMwGlobals( 'wgAlwaysUseTidy', false );
+ }
+
/**
* @dataProvider provideValidNames
*/
array( 'other', 3 ), // Plural
);
}
+
+ /** @dataProvider providerGrammar */
+ function testGrammar( $result, $word, $case ) {
+ $this->assertEquals( $result, $this->getLang()->convertGrammar( $word, $case ) );
+ }
+
+ // The comments in the beginning of the line help avoid RTL problems
+ // with text editors.
+ function providerGrammar() {
+ return array (
+ array(
+ /* result */ 'וויקיפדיה',
+ /* word */ 'ויקיפדיה',
+ /* case */ 'תחילית',
+ ),
+ array(
+ /* result */ 'וולפגנג',
+ /* word */ 'וולפגנג',
+ /* case */ 'prefixed',
+ ),
+ array(
+ /* result */ 'קובץ',
+ /* word */ 'הקובץ',
+ /* case */ 'תחילית',
+ ),
+ array(
+ /* result */ '־Wikipedia',
+ /* word */ 'Wikipedia',
+ /* case */ 'תחילית',
+ ),
+ array(
+ /* result */ '־1995',
+ /* word */ '1995',
+ /* case */ 'תחילית',
+ ),
+ );
+ }
}
protected function setUp() {
parent::setUp();
+ $this->setMwGlobals( array(
+ 'wgLanguageCode' => 'en',
+ 'wgContLang' => Language::factory( 'en' ),
+ ));
+
// Since we will restrict dumping by page ranges (to allow
// working tests, even if the db gets prepopulated by a base
// class), we have to assert, that the page id are consecutively
-mw.loader.testCallback();
+mediaWiki.loader.testCallback();
. "// languages, and parser modes. Intended for use by a unit test framework by looping\n"
. "// through the object and comparing its parser return value with the 'result' property.\n"
. '// Last generated with ' . basename( __FILE__ ) . ' at ' . gmdate( 'r' ) . "\n"
+ // This file will contain unquoted JSON strings as javascript native object literals,
+ // flip the quotemark convention for this file.
+ . "/*jshint quotmark: double */\n"
. "\n"
. 'mediaWiki.libs.phpParserData = ' . FormatJson::encode( $phpParserData, true ) . ";\n";
// This file stores the output from the PHP parser for various messages, arguments,
// languages, and parser modes. Intended for use by a unit test framework by looping
// through the object and comparing its parser return value with the 'result' property.
-// Last generated with generateJqueryMsgData.php at Sun, 07 Oct 2012 07:30:16 +0000
+// Last generated with generateJqueryMsgData.php at Sat, 03 Nov 2012 21:32:01 +0000
+/*jshint quotmark: double */
mediaWiki.libs.phpParserData = {
"messages": {
-( function ( $, mw, QUnit, undefined ) {
/*global CompletenessTest */
-/*jshint evil:true */
-'use strict';
-
-var mwTestIgnore, mwTester, addons;
-
-/**
- * Add bogus to url to prevent IE crazy caching
- *
- * @param value {String} a relative path (eg. 'data/foo.js'
- * or 'data/test.php?foo=bar').
- * @return {String} Such as 'data/foo.js?131031765087663960'
- */
-QUnit.fixurl = function ( value ) {
- return value + (/\?/.test( value ) ? '&' : '?')
- + String( new Date().getTime() )
- + String( parseInt( Math.random() * 100000, 10 ) );
-};
-
-/**
- * Configuration
- */
-
-// When a test() indicates asynchronicity with stop(),
-// allow 10 seconds to pass before killing the test(),
-// and assuming failure.
-QUnit.config.testTimeout = 10 * 1000;
-
-// Add a checkbox to QUnit header to toggle MediaWiki ResourceLoader debug mode.
-QUnit.config.urlConfig.push( {
- id: 'debug',
- label: 'Enable ResourceLoaderDebug',
- tooltip: 'Enable debug mode in ResourceLoader'
-} );
-
-/**
- * Load TestSwarm agent
- */
-// Only if the current url indicates that there is a TestSwarm instance watching us
-// (TestSwarm appends swarmURL to the test suites url it loads in iframes).
-// Otherwise this is just a simple view of Special:JavaScriptTest/qunit directly,
-// no point in loading inject.js in that case. Also, make sure that this instance
-// of MediaWiki has actually been configured with the required url to that inject.js
-// script. By default it is false.
-if ( QUnit.urlParams.swarmURL && mw.config.get( 'QUnitTestSwarmInjectJSPath' ) ) {
- document.write( "<scr" + "ipt src='" + QUnit.fixurl( mw.config.get( 'QUnitTestSwarmInjectJSPath' ) ) + "'></scr" + "ipt>" );
-}
-
-/**
- * CompletenessTest
- */
-// Adds toggle checkbox to header
-QUnit.config.urlConfig.push( {
- id: 'completenesstest',
- label: 'Run CompletenessTest',
- tooltip: 'Run the completeness test'
-} );
-
-// Initiate when enabled
-if ( QUnit.urlParams.completenesstest ) {
-
- // Return true to ignore
- mwTestIgnore = function ( val, tester, funcPath ) {
-
- // Don't record methods of the properties of constructors,
- // to avoid getting into a loop (prototype.constructor.prototype..).
- // Since we're therefor skipping any injection for
- // "new mw.Foo()", manually set it to true here.
- if ( val instanceof mw.Map ) {
- tester.methodCallTracker.Map = true;
- return true;
- }
- if ( val instanceof mw.Title ) {
- tester.methodCallTracker.Title = true;
- return true;
- }
-
- // Don't record methods of the properties of a jQuery object
- if ( val instanceof $ ) {
- return true;
- }
-
- return false;
+/*jshint evil: true */
+( function ( $, mw, QUnit, undefined ) {
+ 'use strict';
+
+ var mwTestIgnore, mwTester,
+ addons,
+ envExecCount;
+
+ /**
+ * Add bogus to url to prevent IE crazy caching
+ *
+ * @param value {String} a relative path (eg. 'data/foo.js'
+ * or 'data/test.php?foo=bar').
+ * @return {String} Such as 'data/foo.js?131031765087663960'
+ */
+ QUnit.fixurl = function ( value ) {
+ return value + (/\?/.test( value ) ? '&' : '?')
+ + String( new Date().getTime() )
+ + String( parseInt( Math.random() * 100000, 10 ) );
};
- mwTester = new CompletenessTest( mw, mwTestIgnore );
-}
-
-/**
- * Test environment recommended for all QUnit test modules
- */
-// Whether to log environment changes to the console
-QUnit.config.urlConfig.push( 'mwlogenv' );
-
-/**
- * Reset mw.config and others to a fresh copy of the live config for each test(),
- * and restore it back to the live one afterwards.
- * @param localEnv {Object} [optional]
- * @example (see test suite at the bottom of this file)
- * </code>
- */
-QUnit.newMwEnvironment = ( function () {
- var log, liveConfig, liveMessages;
-
- liveConfig = mw.config.values;
- liveMessages = mw.messages.values;
-
- function freshConfigCopy( custom ) {
- // "deep=true" is important here.
- // Otherwise we just create a new object with values referring to live config.
- // e.g. mw.config.set( 'wgFileExtensions', [] ) would not effect liveConfig,
- // but mw.config.get( 'wgFileExtensions' ).push( 'png' ) would as the array
- // was passed by reference in $.extend's loop.
- return $.extend( {}, liveConfig, custom, /*deep=*/true );
+ /**
+ * Configuration
+ */
+
+ // When a test() indicates asynchronicity with stop(),
+ // allow 10 seconds to pass before killing the test(),
+ // and assuming failure.
+ QUnit.config.testTimeout = 10 * 1000;
+
+ // Add a checkbox to QUnit header to toggle MediaWiki ResourceLoader debug mode.
+ QUnit.config.urlConfig.push( {
+ id: 'debug',
+ label: 'Enable ResourceLoaderDebug',
+ tooltip: 'Enable debug mode in ResourceLoader'
+ } );
+
+ /**
+ * Load TestSwarm agent
+ */
+ // Only if the current url indicates that there is a TestSwarm instance watching us
+ // (TestSwarm appends swarmURL to the test suites url it loads in iframes).
+ // Otherwise this is just a simple view of Special:JavaScriptTest/qunit directly,
+ // no point in loading inject.js in that case. Also, make sure that this instance
+ // of MediaWiki has actually been configured with the required url to that inject.js
+ // script. By default it is false.
+ if ( QUnit.urlParams.swarmURL && mw.config.get( 'QUnitTestSwarmInjectJSPath' ) ) {
+ document.write( '<scr' + 'ipt src="' + QUnit.fixurl( mw.config.get( 'QUnitTestSwarmInjectJSPath' ) ) + '"></scr' + 'ipt>' );
}
- function freshMessagesCopy( custom ) {
- return $.extend( {}, liveMessages, custom, /*deep=*/true );
+ /**
+ * CompletenessTest
+ */
+ // Adds toggle checkbox to header
+ QUnit.config.urlConfig.push( {
+ id: 'completenesstest',
+ label: 'Run CompletenessTest',
+ tooltip: 'Run the completeness test'
+ } );
+
+ // Initiate when enabled
+ if ( QUnit.urlParams.completenesstest ) {
+
+ // Return true to ignore
+ mwTestIgnore = function ( val, tester ) {
+
+ // Don't record methods of the properties of constructors,
+ // to avoid getting into a loop (prototype.constructor.prototype..).
+ // Since we're therefor skipping any injection for
+ // "new mw.Foo()", manually set it to true here.
+ if ( val instanceof mw.Map ) {
+ tester.methodCallTracker.Map = true;
+ return true;
+ }
+ if ( val instanceof mw.Title ) {
+ tester.methodCallTracker.Title = true;
+ return true;
+ }
+
+ // Don't record methods of the properties of a jQuery object
+ if ( val instanceof $ ) {
+ return true;
+ }
+
+ return false;
+ };
+
+ mwTester = new CompletenessTest( mw, mwTestIgnore );
}
- log = QUnit.urlParams.mwlogenv ? mw.log : function () {};
+ /**
+ * Test environment recommended for all QUnit test modules
+ */
+ // Whether to log environment changes to the console
+ QUnit.config.urlConfig.push( 'mwlogenv' );
+
+ /**
+ * Reset mw.config and others to a fresh copy of the live config for each test(),
+ * and restore it back to the live one afterwards.
+ * @param localEnv {Object} [optional]
+ * @example (see test suite at the bottom of this file)
+ * </code>
+ */
+ QUnit.newMwEnvironment = ( function () {
+ var log, liveConfig, liveMessages;
+
+ liveConfig = mw.config.values;
+ liveMessages = mw.messages.values;
+
+ function freshConfigCopy( custom ) {
+ // "deep=true" is important here.
+ // Otherwise we just create a new object with values referring to live config.
+ // e.g. mw.config.set( 'wgFileExtensions', [] ) would not effect liveConfig,
+ // but mw.config.get( 'wgFileExtensions' ).push( 'png' ) would as the array
+ // was passed by reference in $.extend's loop.
+ return $.extend( {}, liveConfig, custom, /*deep=*/true );
+ }
- return function ( localEnv ) {
- localEnv = $.extend( {
- // QUnit
- setup: $.noop,
- teardown: $.noop,
- // MediaWiki
- config: {},
- messages: {}
- }, localEnv );
+ function freshMessagesCopy( custom ) {
+ return $.extend( {}, liveMessages, custom, /*deep=*/true );
+ }
- return {
- setup: function () {
- log( 'MwEnvironment> SETUP for "' + QUnit.config.current.module
- + ': ' + QUnit.config.current.testName + '"' );
+ log = QUnit.urlParams.mwlogenv ? mw.log : function () {};
+
+ return function ( localEnv ) {
+ localEnv = $.extend( {
+ // QUnit
+ setup: $.noop,
+ teardown: $.noop,
+ // MediaWiki
+ config: {},
+ messages: {}
+ }, localEnv );
+
+ return {
+ setup: function () {
+ log( 'MwEnvironment> SETUP for "' + QUnit.config.current.module
+ + ': ' + QUnit.config.current.testName + '"' );
+
+ // Greetings, mock environment!
+ mw.config.values = freshConfigCopy( localEnv.config );
+ mw.messages.values = freshMessagesCopy( localEnv.messages );
+
+ localEnv.setup();
+ },
+
+ teardown: function () {
+ log( 'MwEnvironment> TEARDOWN for "' + QUnit.config.current.module
+ + ': ' + QUnit.config.current.testName + '"' );
+
+ localEnv.teardown();
+
+ // Farewell, mock environment!
+ mw.config.values = liveConfig;
+ mw.messages.values = liveMessages;
+ }
+ };
+ };
+ }() );
- // Greetings, mock environment!
- mw.config.values = freshConfigCopy( localEnv.config );
- mw.messages.values = freshMessagesCopy( localEnv.messages );
+ // $.when stops as soon as one fails, which makes sense in most
+ // practical scenarios, but not in a unit test where we really do
+ // need to wait until all of them are finished.
+ QUnit.whenPromisesComplete = function () {
+ var altPromises = [];
- localEnv.setup();
- },
+ $.each( arguments, function ( i, arg ) {
+ var alt = $.Deferred();
+ altPromises.push( alt );
- teardown: function () {
- log( 'MwEnvironment> TEARDOWN for "' + QUnit.config.current.module
- + ': ' + QUnit.config.current.testName + '"' );
+ // Whether this one fails or not, forwards it to
+ // the 'done' (resolve) callback of the alternative promise.
+ arg.always( alt.resolve );
+ });
- localEnv.teardown();
+ return $.when.apply( $, altPromises );
+ };
- // Farewell, mock environment!
- mw.config.values = liveConfig;
- mw.messages.values = liveMessages;
- }
- };
+ /**
+ * Add-on assertion helpers
+ */
+ // Define the add-ons
+ addons = {
+
+ // Expect boolean true
+ assertTrue: function ( actual, message ) {
+ QUnit.push( actual === true, actual, true, message );
+ },
+
+ // Expect boolean false
+ assertFalse: function ( actual, message ) {
+ QUnit.push( actual === false, actual, false, message );
+ },
+
+ // Expect numerical value less than X
+ lt: function ( actual, expected, message ) {
+ QUnit.push( actual < expected, actual, 'less than ' + expected, message );
+ },
+
+ // Expect numerical value less than or equal to X
+ ltOrEq: function ( actual, expected, message ) {
+ QUnit.push( actual <= expected, actual, 'less than or equal to ' + expected, message );
+ },
+
+ // Expect numerical value greater than X
+ gt: function ( actual, expected, message ) {
+ QUnit.push( actual > expected, actual, 'greater than ' + expected, message );
+ },
+
+ // Expect numerical value greater than or equal to X
+ gtOrEq: function ( actual, expected, message ) {
+ QUnit.push( actual >= expected, actual, 'greater than or equal to ' + expected, message );
+ }
};
-}() );
-// $.when stops as soon as one fails, which makes sense in most
-// practical scenarios, but not in a unit test where we really do
-// need to wait until all of them are finished.
-QUnit.whenPromisesComplete = function () {
- var altPromises = [];
+ $.extend( QUnit.assert, addons );
+
+ /**
+ * Small test suite to confirm proper functionality of the utilities and
+ * initializations defined above in this file.
+ */
+ envExecCount = 0;
+ QUnit.module( 'mediawiki.tests.qunit.testrunner', QUnit.newMwEnvironment({
+ setup: function () {
+ envExecCount += 1;
+ this.mwHtmlLive = mw.html;
+ mw.html = {
+ escape: function () {
+ return 'mocked-' + envExecCount;
+ }
+ };
+ },
+ teardown: function () {
+ mw.html = this.mwHtmlLive;
+ },
+ config: {
+ testVar: 'foo'
+ },
+ messages: {
+ testMsg: 'Foo.'
+ }
+ }) );
- $.each( arguments, function ( i, arg ) {
- var alt = $.Deferred();
- altPromises.push( alt );
+ QUnit.test( 'Setup', 3, function ( assert ) {
+ assert.equal( mw.html.escape( 'foo' ), 'mocked-1', 'extra setup() callback was ran.' );
+ assert.equal( mw.config.get( 'testVar' ), 'foo', 'config object applied' );
+ assert.equal( mw.messages.get( 'testMsg' ), 'Foo.', 'messages object applied' );
- // Whether this one fails or not, forwards it to
- // the 'done' (resolve) callback of the alternative promise.
- arg.always( alt.resolve );
+ mw.config.set( 'testVar', 'bar' );
+ mw.messages.set( 'testMsg', 'Bar.' );
});
- return $.when.apply( $, altPromises );
-};
-
-/**
- * Add-on assertion helpers
- */
-// Define the add-ons
-addons = {
-
- // Expect boolean true
- assertTrue: function ( actual, message ) {
- QUnit.push( actual === true, actual, true, message );
- },
-
- // Expect boolean false
- assertFalse: function ( actual, message ) {
- QUnit.push( actual === false, actual, false, message );
- },
-
- // Expect numerical value less than X
- lt: function ( actual, expected, message ) {
- QUnit.push( actual < expected, actual, 'less than ' + expected, message );
- },
-
- // Expect numerical value less than or equal to X
- ltOrEq: function ( actual, expected, message ) {
- QUnit.push( actual <= expected, actual, 'less than or equal to ' + expected, message );
- },
-
- // Expect numerical value greater than X
- gt: function ( actual, expected, message ) {
- QUnit.push( actual > expected, actual, 'greater than ' + expected, message );
- },
-
- // Expect numerical value greater than or equal to X
- gtOrEq: function ( actual, expected, message ) {
- QUnit.push( actual >= expected, actual, 'greater than or equal to ' + expected, message );
- }
-};
-
-$.extend( QUnit.assert, addons );
-
-/**
- * Small test suite to confirm proper functionality of the utilities and
- * initializations in this file.
- */
-var envExecCount = 0;
-QUnit.module( 'mediawiki.tests.qunit.testrunner', QUnit.newMwEnvironment({
- setup: function () {
- envExecCount += 1;
- this.mwHtmlLive = mw.html;
- mw.html = {
- escape: function () {
- return 'mocked-' + envExecCount;
- }
- };
- },
- teardown: function () {
- mw.html = this.mwHtmlLive;
- },
- config: {
- testVar: 'foo'
- },
- messages: {
- testMsg: 'Foo.'
- }
-}) );
-
-QUnit.test( 'Setup', 3, function ( assert ) {
- assert.equal( mw.html.escape( 'foo' ), 'mocked-1', 'extra setup() callback was ran.' );
- assert.equal( mw.config.get( 'testVar' ), 'foo', 'config object applied' );
- assert.equal( mw.messages.get( 'testMsg' ), 'Foo.', 'messages object applied' );
-
- mw.config.set( 'testVar', 'bar' );
- mw.messages.set( 'testMsg', 'Bar.' );
-});
-
-QUnit.test( 'Teardown', 3, function ( assert ) {
- assert.equal( mw.html.escape( 'foo' ), 'mocked-2', 'extra setup() callback was re-ran.' );
- assert.equal( mw.config.get( 'testVar' ), 'foo', 'config object restored and re-applied after test()' );
- assert.equal( mw.messages.get( 'testMsg' ), 'Foo.', 'messages object restored and re-applied after test()' );
-});
-
-QUnit.module( 'mediawiki.tests.qunit.testrunner-after', QUnit.newMwEnvironment() );
-
-QUnit.test( 'Teardown', 3, function ( assert ) {
- assert.equal( mw.html.escape( '<' ), '<', 'extra teardown() callback was ran.' );
- assert.equal( mw.config.get( 'testVar' ), null, 'config object restored to live in next module()' );
- assert.equal( mw.messages.get( 'testMsg' ), null, 'messages object restored to live in next module()' );
-});
+ QUnit.test( 'Teardown', 3, function ( assert ) {
+ assert.equal( mw.html.escape( 'foo' ), 'mocked-2', 'extra setup() callback was re-ran.' );
+ assert.equal( mw.config.get( 'testVar' ), 'foo', 'config object restored and re-applied after test()' );
+ assert.equal( mw.messages.get( 'testMsg' ), 'Foo.', 'messages object restored and re-applied after test()' );
+ });
+
+ QUnit.module( 'mediawiki.tests.qunit.testrunner-after', QUnit.newMwEnvironment() );
+
+ QUnit.test( 'Teardown', 3, function ( assert ) {
+ assert.equal( mw.html.escape( '<' ), '<', 'extra teardown() callback was ran.' );
+ assert.equal( mw.config.get( 'testVar' ), null, 'config object restored to live in next module()' );
+ assert.equal( mw.messages.get( 'testMsg' ), null, 'messages object restored to live in next module()' );
+ });
}( jQuery, mediaWiki, QUnit ) );
-( function ( mw, $ ) {
+( function ( $ ) {
-QUnit.module( 'jquery.autoEllipsis', QUnit.newMwEnvironment() );
+ QUnit.module( 'jquery.autoEllipsis', QUnit.newMwEnvironment() );
-function createWrappedDiv( text, width ) {
- var $wrapper = $( '<div>' ).css( 'width', width );
- var $div = $( '<div>' ).text( text );
- $wrapper.append( $div );
- return $wrapper;
-}
-
-function findDivergenceIndex( a, b ) {
- var i = 0;
- while ( i < a.length && i < b.length && a[i] === b[i] ) {
- i++;
+ function createWrappedDiv( text, width ) {
+ var $wrapper = $( '<div>' ).css( 'width', width ),
+ $div = $( '<div>' ).text( text );
+ $wrapper.append( $div );
+ return $wrapper;
}
- return i;
-}
-
-QUnit.test( 'Position right', 4, function ( assert ) {
- // We need this thing to be visible, so append it to the DOM
- var origText = 'This is a really long random string and there is no way it fits in 100 pixels.';
- var $wrapper = createWrappedDiv( origText, '100px' );
- $( '#qunit-fixture' ).append( $wrapper );
- $wrapper.autoEllipsis( { position: 'right' } );
-
- // Verify that, and only one, span element was created
- var $span = $wrapper.find( '> span' );
- assert.strictEqual( $span.length, 1, 'autoEllipsis wrapped the contents in a span element' );
-
- // Check that the text fits by turning on word wrapping
- $span.css( 'whiteSpace', 'nowrap' );
- assert.ltOrEq( $span.width(), $span.parent().width(), "Text fits (making the span 'white-space:nowrap' does not make it wider than its parent)" );
-
- // Add two characters using scary black magic
- var spanText = $span.text();
- var d = findDivergenceIndex( origText, spanText );
- var spanTextNew = spanText.substr( 0, d ) + origText[d] + origText[d] + '...';
-
- assert.gt( spanTextNew.length, spanText.length, 'Verify that the new span-length is indeed greater' );
-
- // Put this text in the span and verify it doesn't fit
- $span.text( spanTextNew );
- // In IE6 width works like min-width, allow IE6's width to be "equal to"
- if ( $.browser.msie && Number( $.browser.version ) === 6 ) {
- assert.gtOrEq( $span.width(), $span.parent().width(), 'Fit is maximal (adding two characters makes it not fit any more) - IE6: Maybe equal to as well due to width behaving like min-width in IE6' );
- } else {
- assert.gt( $span.width(), $span.parent().width(), 'Fit is maximal (adding two characters makes it not fit any more)' );
+
+ function findDivergenceIndex( a, b ) {
+ var i = 0;
+ while ( i < a.length && i < b.length && a[i] === b[i] ) {
+ i++;
+ }
+ return i;
}
-});
-}( mediaWiki, jQuery ) );
+ QUnit.test( 'Position right', 4, function ( assert ) {
+ // We need this thing to be visible, so append it to the DOM
+ var $span, spanText, d, spanTextNew,
+ origText = 'This is a really long random string and there is no way it fits in 100 pixels.',
+ $wrapper = createWrappedDiv( origText, '100px' );
+
+ $( '#qunit-fixture' ).append( $wrapper );
+ $wrapper.autoEllipsis( { position: 'right' } );
+
+ // Verify that, and only one, span element was created
+ $span = $wrapper.find( '> span' );
+ assert.strictEqual( $span.length, 1, 'autoEllipsis wrapped the contents in a span element' );
+
+ // Check that the text fits by turning on word wrapping
+ $span.css( 'whiteSpace', 'nowrap' );
+ assert.ltOrEq(
+ $span.width(),
+ $span.parent().width(),
+ 'Text fits (making the span "white-space: nowrap" does not make it wider than its parent)'
+ );
+
+ // Add two characters using scary black magic
+ spanText = $span.text();
+ d = findDivergenceIndex( origText, spanText );
+ spanTextNew = spanText.substr( 0, d ) + origText[d] + origText[d] + '...';
+
+ assert.gt( spanTextNew.length, spanText.length, 'Verify that the new span-length is indeed greater' );
+
+ // Put this text in the span and verify it doesn't fit
+ $span.text( spanTextNew );
+ // In IE6 width works like min-width, allow IE6's width to be "equal to"
+ if ( $.browser.msie && Number( $.browser.version ) === 6 ) {
+ assert.gtOrEq( $span.width(), $span.parent().width(), 'Fit is maximal (adding two characters makes it not fit any more) - IE6: Maybe equal to as well due to width behaving like min-width in IE6' );
+ } else {
+ assert.gt( $span.width(), $span.parent().width(), 'Fit is maximal (adding two characters makes it not fit any more)' );
+ }
+ });
+
+}( jQuery ) );
-QUnit.module( 'jquery.byteLength', QUnit.newMwEnvironment() );
+( function ( $ ) {
+ QUnit.module( 'jquery.byteLength', QUnit.newMwEnvironment() );
-QUnit.test( 'Simple text', 5, function ( assert ) {
- var azLc = 'abcdefghijklmnopqrstuvwxyz',
- azUc = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
- num = '0123456789',
- x = '*',
- space = ' ';
+ QUnit.test( 'Simple text', 5, function ( assert ) {
+ var azLc = 'abcdefghijklmnopqrstuvwxyz',
+ azUc = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
+ num = '0123456789',
+ x = '*',
+ space = ' ';
- assert.equal( $.byteLength( azLc ), 26, 'Lowercase a-z' );
- assert.equal( $.byteLength( azUc ), 26, 'Uppercase A-Z' );
- assert.equal( $.byteLength( num ), 10, 'Numbers 0-9' );
- assert.equal( $.byteLength( x ), 1, 'An asterisk' );
- assert.equal( $.byteLength( space ), 3, '3 spaces' );
+ assert.equal( $.byteLength( azLc ), 26, 'Lowercase a-z' );
+ assert.equal( $.byteLength( azUc ), 26, 'Uppercase A-Z' );
+ assert.equal( $.byteLength( num ), 10, 'Numbers 0-9' );
+ assert.equal( $.byteLength( x ), 1, 'An asterisk' );
+ assert.equal( $.byteLength( space ), 3, '3 spaces' );
-} );
+ } );
-QUnit.test( 'Special text', 5, function ( assert ) {
- // http://en.wikipedia.org/wiki/UTF-8
- var U_0024 = '\u0024',
- U_00A2 = '\u00A2',
- U_20AC = '\u20AC',
- U_024B62 = '\u024B62',
- // The normal one doesn't display properly, try the below which is the same
- // according to http://www.fileformat.info/info/unicode/char/24B62/index.htm
- U_024B62_alt = '\uD852\uDF62';
+ QUnit.test( 'Special text', 5, function ( assert ) {
+ // http://en.wikipedia.org/wiki/UTF-8
+ var u0024 = '$',
+ u00A2 = '\u00A2',
+ u20AC = '\u20AC',
+ u024B62 = '\u024B62',
+ // The normal one doesn't display properly, try the below which is the same
+ // according to http://www.fileformat.info/info/unicode/char/24B62/index.htm
+ u024B62alt = '\uD852\uDF62';
- assert.strictEqual( $.byteLength( U_0024 ), 1, 'U+0024: 1 byte. \u0024 (dollar sign)' );
- assert.strictEqual( $.byteLength( U_00A2 ), 2, 'U+00A2: 2 bytes. \u00A2 (cent sign)' );
- assert.strictEqual( $.byteLength( U_20AC ), 3, 'U+20AC: 3 bytes. \u20AC (euro sign)' );
- assert.strictEqual( $.byteLength( U_024B62 ), 4, 'U+024B62: 4 bytes. \uD852\uDF62 (a Han character)' );
- assert.strictEqual( $.byteLength( U_024B62_alt ), 4, 'U+024B62: 4 bytes. \uD852\uDF62 (a Han character) - alternative method' );
-} );
+ assert.strictEqual( $.byteLength( u0024 ), 1, 'U+0024: 1 byte. $ (dollar sign)' );
+ assert.strictEqual( $.byteLength( u00A2 ), 2, 'U+00A2: 2 bytes. \u00A2 (cent sign)' );
+ assert.strictEqual( $.byteLength( u20AC ), 3, 'U+20AC: 3 bytes. \u20AC (euro sign)' );
+ assert.strictEqual( $.byteLength( u024B62 ), 4, 'U+024B62: 4 bytes. \uD852\uDF62 (a Han character)' );
+ assert.strictEqual( $.byteLength( u024B62alt ), 4, 'U+024B62: 4 bytes. \uD852\uDF62 (a Han character) - alternative method' );
+ } );
+}( jQuery ) );
// Basic sendkey-implementation
function addChars( $input, charstr ) {
var c, len;
+ function x( $input, i ) {
+ // Add character to the value
+ return $input.val() + charstr.charAt( i );
+ }
for ( c = 0, len = charstr.length; c < len; c += 1 ) {
$input
- .val( function ( i, val ) {
- // Add character to the value
- return val + charstr.charAt( c );
- } )
+ .val( x( $input, c ) )
.trigger( 'change' );
}
}
-QUnit.module( 'jquery.client', QUnit.newMwEnvironment() );
+( function ( $ ) {
+ var uacount, uas, testMap;
-/** Number of user-agent defined */
-var uacount = 0;
+ QUnit.module( 'jquery.client', QUnit.newMwEnvironment() );
-var uas = (function () {
+ /** Number of user-agent defined */
+ uacount = 0;
- // Object keyed by userAgent. Value is an array (human-readable name, client-profile object, navigator.platform value)
- // Info based on results from http://toolserver.org/~krinkle/testswarm/job/174/
- var uas = {
- // Internet Explorer 6
- // Internet Explorer 7
- 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)': {
- title: 'Internet Explorer 7',
- platform: 'Win32',
- profile: {
- "name": "msie",
- "layout": "trident",
- "layoutVersion": "unknown",
- "platform": "win",
- "version": "7.0",
- "versionBase": "7",
- "versionNumber": 7
- },
- wikiEditor: {
- ltr: true,
- rtl: false
- }
- },
- // Internet Explorer 8
- // Internet Explorer 9
- // Internet Explorer 10
- 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)': {
- title: 'Internet Explorer 10',
- platform: 'Win32',
- profile: {
- "name": "msie",
- "layout": "trident",
- "layoutVersion": "unknown", // should be able to report 6?
- "platform": "win",
- "version": "10.0",
- "versionBase": "10",
- "versionNumber": 10
+ uas = ( function () {
+
+ // Object keyed by userAgent. Value is an array (human-readable name, client-profile object, navigator.platform value)
+ // Info based on results from http://toolserver.org/~krinkle/testswarm/job/174/
+ var uas = {
+ // Internet Explorer 6
+ // Internet Explorer 7
+ 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)': {
+ title: 'Internet Explorer 7',
+ platform: 'Win32',
+ profile: {
+ name: 'msie',
+ layout: 'trident',
+ layoutVersion: 'unknown',
+ platform: 'win',
+ version: '7.0',
+ versionBase: '7',
+ versionNumber: 7
+ },
+ wikiEditor: {
+ ltr: true,
+ rtl: false
+ }
},
- wikiEditor: {
- ltr: true,
- rtl: true
- }
- },
- // Firefox 2
- // Firefox 3.5
- 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.19) Gecko/20110420 Firefox/3.5.19': {
- title: 'Firefox 3.5',
- platform: 'MacIntel',
- profile: {
- "name": "firefox",
- "layout": "gecko",
- "layoutVersion": 20110420,
- "platform": "mac",
- "version": "3.5.19",
- "versionBase": "3",
- "versionNumber": 3.5
+ // Internet Explorer 8
+ // Internet Explorer 9
+ // Internet Explorer 10
+ 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)': {
+ title: 'Internet Explorer 10',
+ platform: 'Win32',
+ profile: {
+ name: 'msie',
+ layout: 'trident',
+ layoutVersion: 'unknown', // should be able to report 6?
+ platform: 'win',
+ version: '10.0',
+ versionBase: '10',
+ versionNumber: 10
+ },
+ wikiEditor: {
+ ltr: true,
+ rtl: true
+ }
},
- wikiEditor: {
- ltr: true,
- rtl: true
- }
- },
- // Firefox 3.6
- 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110422 Ubuntu/10.10 (maverick) Firefox/3.6.17': {
- title: 'Firefox 3.6',
- platform: 'Linux i686',
- profile: {
- "name": "firefox",
- "layout": "gecko",
- "layoutVersion": 20110422,
- "platform": "linux",
- "version": "3.6.17",
- "versionBase": "3",
- "versionNumber": 3.6
+ // Firefox 2
+ // Firefox 3.5
+ 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.19) Gecko/20110420 Firefox/3.5.19': {
+ title: 'Firefox 3.5',
+ platform: 'MacIntel',
+ profile: {
+ name: 'firefox',
+ layout: 'gecko',
+ layoutVersion: 20110420,
+ platform: 'mac',
+ version: '3.5.19',
+ versionBase: '3',
+ versionNumber: 3.5
+ },
+ wikiEditor: {
+ ltr: true,
+ rtl: true
+ }
},
- wikiEditor: {
- ltr: true,
- rtl: true
- }
- },
- // Firefox 4
- 'Mozilla/5.0 (Windows NT 6.0; rv:2.0.1) Gecko/20100101 Firefox/4.0.1': {
- title: 'Firefox 4',
- platform: 'Win32',
- profile: {
- "name": "firefox",
- "layout": "gecko",
- "layoutVersion": 20100101,
- "platform": "win",
- "version": "4.0.1",
- "versionBase": "4",
- "versionNumber": 4
+ // Firefox 3.6
+ 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110422 Ubuntu/10.10 (maverick) Firefox/3.6.17': {
+ title: 'Firefox 3.6',
+ platform: 'Linux i686',
+ profile: {
+ name: 'firefox',
+ layout: 'gecko',
+ layoutVersion: 20110422,
+ platform: 'linux',
+ version: '3.6.17',
+ versionBase: '3',
+ versionNumber: 3.6
+ },
+ wikiEditor: {
+ ltr: true,
+ rtl: true
+ }
},
- wikiEditor: {
- ltr: true,
- rtl: true
- }
- },
- // Firefox 10 nightly build
- 'Mozilla/5.0 (X11; Linux x86_64; rv:10.0a1) Gecko/20111103 Firefox/10.0a1': {
- title: 'Firefox 10 nightly',
- platform: 'Linux',
- profile: {
- "name": "firefox",
- "layout": "gecko",
- "layoutVersion": 20111103,
- "platform": "linux",
- "version": "10.0a1",
- "versionBase": "10",
- "versionNumber": 10
+ // Firefox 4
+ 'Mozilla/5.0 (Windows NT 6.0; rv:2.0.1) Gecko/20100101 Firefox/4.0.1': {
+ title: 'Firefox 4',
+ platform: 'Win32',
+ profile: {
+ name: 'firefox',
+ layout: 'gecko',
+ layoutVersion: 20100101,
+ platform: 'win',
+ version: '4.0.1',
+ versionBase: '4',
+ versionNumber: 4
+ },
+ wikiEditor: {
+ ltr: true,
+ rtl: true
+ }
},
- wikiEditor: {
- ltr: true,
- rtl: true
- }
- },
- // Firefox 5
- // Safari 3
- // Safari 4
- 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_7; nl-nl) AppleWebKit/531.22.7 (KHTML, like Gecko) Version/4.0.5 Safari/531.22.7': {
- title: 'Safari 4',
- platform: 'MacIntel',
- profile: {
- "name": "safari",
- "layout": "webkit",
- "layoutVersion": 531,
- "platform": "mac",
- "version": "4.0.5",
- "versionBase": "4",
- "versionNumber": 4
+ // Firefox 10 nightly build
+ 'Mozilla/5.0 (X11; Linux x86_64; rv:10.0a1) Gecko/20111103 Firefox/10.0a1': {
+ title: 'Firefox 10 nightly',
+ platform: 'Linux',
+ profile: {
+ name: 'firefox',
+ layout: 'gecko',
+ layoutVersion: 20111103,
+ platform: 'linux',
+ version: '10.0a1',
+ versionBase: '10',
+ versionNumber: 10
+ },
+ wikiEditor: {
+ ltr: true,
+ rtl: true
+ }
},
- wikiEditor: {
- ltr: true,
- rtl: true
- }
- },
- 'Mozilla/5.0 (Windows; U; Windows NT 6.0; cs-CZ) AppleWebKit/533.21.1 (KHTML, like Gecko) Version/4.0.5 Safari/531.22.7': {
- title: 'Safari 4',
- platform: 'Win32',
- profile: {
- "name": "safari",
- "layout": "webkit",
- "layoutVersion": 533,
- "platform": "win",
- "version": "4.0.5",
- "versionBase": "4",
- "versionNumber": 4
+ // Firefox 5
+ // Safari 3
+ // Safari 4
+ 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_7; nl-nl) AppleWebKit/531.22.7 (KHTML, like Gecko) Version/4.0.5 Safari/531.22.7': {
+ title: 'Safari 4',
+ platform: 'MacIntel',
+ profile: {
+ name: 'safari',
+ layout: 'webkit',
+ layoutVersion: 531,
+ platform: 'mac',
+ version: '4.0.5',
+ versionBase: '4',
+ versionNumber: 4
+ },
+ wikiEditor: {
+ ltr: true,
+ rtl: true
+ }
},
- wikiEditor: {
- ltr: true,
- rtl: true
- }
- },
- // Safari 5
- // Opera 10
- // Chrome 5
- // Chrome 6
- // Chrome 7
- // Chrome 8
- // Chrome 9
- // Chrome 10
- // Chrome 11
- // Chrome 12
- 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_5_8) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.112 Safari/534.30': {
- title: 'Chrome 12',
- platform: 'MacIntel',
- profile: {
- "name": "chrome",
- "layout": "webkit",
- "layoutVersion": 534,
- "platform": "mac",
- "version": "12.0.742.112",
- "versionBase": "12",
- "versionNumber": 12
+ 'Mozilla/5.0 (Windows; U; Windows NT 6.0; cs-CZ) AppleWebKit/533.21.1 (KHTML, like Gecko) Version/4.0.5 Safari/531.22.7': {
+ title: 'Safari 4',
+ platform: 'Win32',
+ profile: {
+ name: 'safari',
+ layout: 'webkit',
+ layoutVersion: 533,
+ platform: 'win',
+ version: '4.0.5',
+ versionBase: '4',
+ versionNumber: 4
+ },
+ wikiEditor: {
+ ltr: true,
+ rtl: true
+ }
},
- wikiEditor: {
- ltr: true,
- rtl: true
- }
- },
- 'Mozilla/5.0 (X11; Linux i686) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.68 Safari/534.30': {
- title: 'Chrome 12',
- platform: 'Linux i686',
- profile: {
- "name": "chrome",
- "layout": "webkit",
- "layoutVersion": 534,
- "platform": "linux",
- "version": "12.0.742.68",
- "versionBase": "12",
- "versionNumber": 12
+ // Safari 5
+ // Opera 10
+ // Chrome 5
+ // Chrome 6
+ // Chrome 7
+ // Chrome 8
+ // Chrome 9
+ // Chrome 10
+ // Chrome 11
+ // Chrome 12
+ 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_5_8) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.112 Safari/534.30': {
+ title: 'Chrome 12',
+ platform: 'MacIntel',
+ profile: {
+ name: 'chrome',
+ layout: 'webkit',
+ layoutVersion: 534,
+ platform: 'mac',
+ version: '12.0.742.112',
+ versionBase: '12',
+ versionNumber: 12
+ },
+ wikiEditor: {
+ ltr: true,
+ rtl: true
+ }
},
- wikiEditor: {
- ltr: true,
- rtl: true
- }
- },
- // Bug #34924
- 'Mozilla/5.0 (X11; Linux i686) AppleWebKit/534.34 (KHTML, like Gecko) rekonq Safari/534.34': {
- title: 'Rekonq',
- platform: 'Linux i686',
- profile: {
- "name": "rekonq",
- "layout": "webkit",
- "layoutVersion": 534,
- "platform": "linux",
- "version": "534.34",
- "versionBase": "534",
- "versionNumber": 534.34
+ 'Mozilla/5.0 (X11; Linux i686) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.68 Safari/534.30': {
+ title: 'Chrome 12',
+ platform: 'Linux i686',
+ profile: {
+ name: 'chrome',
+ layout: 'webkit',
+ layoutVersion: 534,
+ platform: 'linux',
+ version: '12.0.742.68',
+ versionBase: '12',
+ versionNumber: 12
+ },
+ wikiEditor: {
+ ltr: true,
+ rtl: true
+ }
},
- wikiEditor: {
- ltr: true,
- rtl: true
+ // Bug #34924
+ 'Mozilla/5.0 (X11; Linux i686) AppleWebKit/534.34 (KHTML, like Gecko) rekonq Safari/534.34': {
+ title: 'Rekonq',
+ platform: 'Linux i686',
+ profile: {
+ name: 'rekonq',
+ layout: 'webkit',
+ layoutVersion: 534,
+ platform: 'linux',
+ version: '534.34',
+ versionBase: '534',
+ versionNumber: 534.34
+ },
+ wikiEditor: {
+ ltr: true,
+ rtl: true
+ }
}
- }
- };
- $.each( uas, function () {
- uacount++;
- });
- return uas;
-}());
+ };
+ $.each( uas, function () {
+ uacount++;
+ });
+ return uas;
+ }() );
-QUnit.test( 'profile userAgent support', uacount, function ( assert ) {
- // Generate a client profile object and compare recursively
- var uaTest = function( rawUserAgent, data ) {
- var ret = $.client.profile( {
- userAgent: rawUserAgent,
- platform: data.platform
- } );
- assert.deepEqual( ret, data.profile, 'Client profile support check for ' + data.title + ' (' + data.platform + '): ' + rawUserAgent );
- };
+ QUnit.test( 'profile userAgent support', uacount, function ( assert ) {
+ // Generate a client profile object and compare recursively
+ var uaTest = function( rawUserAgent, data ) {
+ var ret = $.client.profile( {
+ userAgent: rawUserAgent,
+ platform: data.platform
+ } );
+ assert.deepEqual( ret, data.profile, 'Client profile support check for ' + data.title + ' (' + data.platform + '): ' + rawUserAgent );
+ };
- // Loop through and run tests
- $.each( uas, uaTest );
-} );
+ // Loop through and run tests
+ $.each( uas, uaTest );
+ } );
-QUnit.test( 'profile return validation for current user agent', 7, function ( assert ) {
- var p = $.client.profile();
- function unknownOrType( val, type, summary ) {
- assert.ok( typeof val === type || val === 'unknown', summary );
- }
+ QUnit.test( 'profile return validation for current user agent', 7, function ( assert ) {
+ var p = $.client.profile();
+ function unknownOrType( val, type, summary ) {
+ assert.ok( typeof val === type || val === 'unknown', summary );
+ }
- assert.equal( typeof p, 'object', 'profile returns an object' );
- unknownOrType( p.layout, 'string', 'p.layout is a string (or "unknown")' );
- unknownOrType( p.layoutVersion, 'number', 'p.layoutVersion is a number (or "unknown")' );
- unknownOrType( p.platform, 'string', 'p.platform is a string (or "unknown")' );
- unknownOrType( p.version, 'string', 'p.version is a string (or "unknown")' );
- unknownOrType( p.versionBase, 'string', 'p.versionBase is a string (or "unknown")' );
- assert.equal( typeof p.versionNumber, 'number', 'p.versionNumber is a number' );
-});
+ assert.equal( typeof p, 'object', 'profile returns an object' );
+ unknownOrType( p.layout, 'string', 'p.layout is a string (or "unknown")' );
+ unknownOrType( p.layoutVersion, 'number', 'p.layoutVersion is a number (or "unknown")' );
+ unknownOrType( p.platform, 'string', 'p.platform is a string (or "unknown")' );
+ unknownOrType( p.version, 'string', 'p.version is a string (or "unknown")' );
+ unknownOrType( p.versionBase, 'string', 'p.versionBase is a string (or "unknown")' );
+ assert.equal( typeof p.versionNumber, 'number', 'p.versionNumber is a number' );
+ });
-// Example from WikiEditor
-// Make sure to use raw numbers, a string like "7.0" would fail on a
-// version 10 browser since in string comparaison "10" is before "7.0" :)
-var testMap = {
- 'ltr': {
- 'msie': [['>=', 7.0]],
- 'firefox': [['>=', 2]],
- 'opera': [['>=', 9.6]],
- 'safari': [['>=', 3]],
- 'chrome': [['>=', 3]],
- 'netscape': [['>=', 9]],
- 'blackberry': false,
- 'ipod': false,
- 'iphone': false
- },
- 'rtl': {
- 'msie': [['>=', 8]],
- 'firefox': [['>=', 2]],
- 'opera': [['>=', 9.6]],
- 'safari': [['>=', 3]],
- 'chrome': [['>=', 3]],
- 'netscape': [['>=', 9]],
- 'blackberry': false,
- 'ipod': false,
- 'iphone': false
- }
-};
+ // Example from WikiEditor
+ // Make sure to use raw numbers, a string like "7.0" would fail on a
+ // version 10 browser since in string comparaison "10" is before "7.0" :)
+ testMap = {
+ 'ltr': {
+ 'msie': [['>=', 7.0]],
+ 'firefox': [['>=', 2]],
+ 'opera': [['>=', 9.6]],
+ 'safari': [['>=', 3]],
+ 'chrome': [['>=', 3]],
+ 'netscape': [['>=', 9]],
+ 'blackberry': false,
+ 'ipod': false,
+ 'iphone': false
+ },
+ 'rtl': {
+ 'msie': [['>=', 8]],
+ 'firefox': [['>=', 2]],
+ 'opera': [['>=', 9.6]],
+ 'safari': [['>=', 3]],
+ 'chrome': [['>=', 3]],
+ 'netscape': [['>=', 9]],
+ 'blackberry': false,
+ 'ipod': false,
+ 'iphone': false
+ }
+ };
-QUnit.test( 'test', 1, function ( assert ) {
- // .test() uses eval, make sure no exceptions are thrown
- // then do a basic return value type check
- var testMatch = $.client.test( testMap );
+ QUnit.test( 'test', 1, function ( assert ) {
+ // .test() uses eval, make sure no exceptions are thrown
+ // then do a basic return value type check
+ var testMatch = $.client.test( testMap );
- assert.equal( typeof testMatch, 'boolean', 'test returns a boolean value' );
+ assert.equal( typeof testMatch, 'boolean', 'test returns a boolean value' );
-});
+ });
-QUnit.test( 'User-agent matches against WikiEditor\'s compatibility map', uacount * 2, function ( assert ) {
- var $body = $( 'body' ),
- bodyClasses = $body.attr( 'class' );
+ QUnit.test( 'User-agent matches against WikiEditor\'s compatibility map', uacount * 2, function ( assert ) {
+ var $body = $( 'body' ),
+ bodyClasses = $body.attr( 'class' );
- // Loop through and run tests
- $.each( uas, function ( agent, data ) {
- $.each( ['ltr', 'rtl'], function ( i, dir ) {
- $body.removeClass( 'ltr rtl' ).addClass( dir );
- var profile = $.client.profile( {
- userAgent: agent,
- platform: data.platform
- } );
- var testMatch = $.client.test( testMap, profile );
- $body.removeClass( dir );
+ // Loop through and run tests
+ $.each( uas, function ( agent, data ) {
+ $.each( ['ltr', 'rtl'], function ( i, dir ) {
+ var profile, testMatch;
+ $body.removeClass( 'ltr rtl' ).addClass( dir );
+ profile = $.client.profile( {
+ userAgent: agent,
+ platform: data.platform
+ } );
+ testMatch = $.client.test( testMap, profile );
+ $body.removeClass( dir );
- assert.equal( testMatch, data.wikiEditor[dir], 'testing comparison based on ' + dir + ', ' + agent );
+ assert.equal( testMatch, data.wikiEditor[dir], 'testing comparison based on ' + dir + ', ' + agent );
+ });
});
- });
-
- // Restore body classes
- $body.attr( 'class', bodyClasses );
-});
+ // Restore body classes
+ $body.attr( 'class', bodyClasses );
+ });
+}( jQuery ) );
-QUnit.module( 'jquery.colorUtil', QUnit.newMwEnvironment() );
-
-QUnit.test( 'getRGB', 18, function ( assert ) {
- assert.strictEqual( $.colorUtil.getRGB(), undefined, 'No arguments' );
- assert.strictEqual( $.colorUtil.getRGB( '' ), undefined, 'Empty string' );
- assert.deepEqual( $.colorUtil.getRGB( [0, 100, 255] ), [0, 100, 255], 'Parse array of rgb values' );
- assert.deepEqual( $.colorUtil.getRGB( 'rgb(0,100,255)' ), [0, 100, 255], 'Parse simple rgb string' );
- assert.deepEqual( $.colorUtil.getRGB( 'rgb(0, 100, 255)' ), [0, 100, 255], 'Parse simple rgb string with spaces' );
- assert.deepEqual( $.colorUtil.getRGB( 'rgb(0%,20%,40%)' ), [0, 51, 102], 'Parse rgb string with percentages' );
- assert.deepEqual( $.colorUtil.getRGB( 'rgb(0%, 20%, 40%)' ), [0, 51, 102], 'Parse rgb string with percentages and spaces' );
- assert.deepEqual( $.colorUtil.getRGB( '#f2ddee' ), [242, 221, 238], 'Hex string: 6 char lowercase' );
- assert.deepEqual( $.colorUtil.getRGB( '#f2DDEE' ), [242, 221, 238], 'Hex string: 6 char uppercase' );
- assert.deepEqual( $.colorUtil.getRGB( '#f2DdEe' ), [242, 221, 238], 'Hex string: 6 char mixed' );
- assert.deepEqual( $.colorUtil.getRGB( '#eee' ), [238, 238, 238], 'Hex string: 3 char lowercase' );
- assert.deepEqual( $.colorUtil.getRGB( '#EEE' ), [238, 238, 238], 'Hex string: 3 char uppercase' );
- assert.deepEqual( $.colorUtil.getRGB( '#eEe' ), [238, 238, 238], 'Hex string: 3 char mixed' );
- assert.deepEqual( $.colorUtil.getRGB( 'rgba(0, 0, 0, 0)' ), [255, 255, 255], 'Zero rgba for Safari 3; Transparent (whitespace)' );
-
- // Perhaps this is a bug in colorUtil, but it is the current behaviour so, let's keep
- // track of it, so we will know in case it would ever change.
- assert.strictEqual( $.colorUtil.getRGB( 'rgba(0,0,0,0)' ), undefined, 'Zero rgba without whitespace' );
-
- assert.deepEqual( $.colorUtil.getRGB( 'lightGreen' ), [144, 238, 144], 'Color names (lightGreen)' );
- assert.deepEqual( $.colorUtil.getRGB( 'transparent' ), [255, 255, 255], 'Color names (transparent)' );
- assert.strictEqual( $.colorUtil.getRGB( 'mediaWiki' ), undefined, 'Inexisting color name' );
-});
-
-QUnit.test( 'rgbToHsl', 1, function ( assert ) {
- var hsl = $.colorUtil.rgbToHsl( 144, 238, 144 );
-
- // Cross-browser differences in decimals...
- // Round to two decimals so they can be more reliably checked.
- var dualDecimals = function(a,b){
- return Math.round(a*100)/100;
- };
- // Re-create the rgbToHsl return array items, limited to two decimals.
- var ret = [dualDecimals(hsl[0]), dualDecimals(hsl[1]), dualDecimals(hsl[2])];
-
- assert.deepEqual( ret, [0.33, 0.73, 0.75], 'rgb(144, 238, 144): hsl(0.33, 0.73, 0.75)' );
-});
-
-QUnit.test( 'hslToRgb', 1, function ( assert ) {
- var rgb = $.colorUtil.hslToRgb( 0.3, 0.7, 0.8 );
-
- // Cross-browser differences in decimals...
- // Re-create the hslToRgb return array items, rounded to whole numbers.
- var ret = [Math.round(rgb[0]), Math.round(rgb[1]), Math.round(rgb[2])];
-
- assert.deepEqual( ret ,[183, 240, 168], 'hsl(0.3, 0.7, 0.8): rgb(183, 240, 168)' );
-});
-
-QUnit.test( 'getColorBrightness', 2, function ( assert ) {
- var a = $.colorUtil.getColorBrightness( 'red', +0.1 );
- assert.equal( a, 'rgb(255,50,50)', 'Start with named color "red", brighten 10%' );
-
- var b = $.colorUtil.getColorBrightness( 'rgb(200,50,50)', -0.2 );
- assert.equal( b, 'rgb(118,29,29)', 'Start with rgb string "rgb(200,50,50)", darken 20%' );
-});
+( function ( $ ) {
+ QUnit.module( 'jquery.colorUtil', QUnit.newMwEnvironment() );
+
+ QUnit.test( 'getRGB', 18, function ( assert ) {
+ assert.strictEqual( $.colorUtil.getRGB(), undefined, 'No arguments' );
+ assert.strictEqual( $.colorUtil.getRGB( '' ), undefined, 'Empty string' );
+ assert.deepEqual( $.colorUtil.getRGB( [0, 100, 255] ), [0, 100, 255], 'Parse array of rgb values' );
+ assert.deepEqual( $.colorUtil.getRGB( 'rgb(0,100,255)' ), [0, 100, 255], 'Parse simple rgb string' );
+ assert.deepEqual( $.colorUtil.getRGB( 'rgb(0, 100, 255)' ), [0, 100, 255], 'Parse simple rgb string with spaces' );
+ assert.deepEqual( $.colorUtil.getRGB( 'rgb(0%,20%,40%)' ), [0, 51, 102], 'Parse rgb string with percentages' );
+ assert.deepEqual( $.colorUtil.getRGB( 'rgb(0%, 20%, 40%)' ), [0, 51, 102], 'Parse rgb string with percentages and spaces' );
+ assert.deepEqual( $.colorUtil.getRGB( '#f2ddee' ), [242, 221, 238], 'Hex string: 6 char lowercase' );
+ assert.deepEqual( $.colorUtil.getRGB( '#f2DDEE' ), [242, 221, 238], 'Hex string: 6 char uppercase' );
+ assert.deepEqual( $.colorUtil.getRGB( '#f2DdEe' ), [242, 221, 238], 'Hex string: 6 char mixed' );
+ assert.deepEqual( $.colorUtil.getRGB( '#eee' ), [238, 238, 238], 'Hex string: 3 char lowercase' );
+ assert.deepEqual( $.colorUtil.getRGB( '#EEE' ), [238, 238, 238], 'Hex string: 3 char uppercase' );
+ assert.deepEqual( $.colorUtil.getRGB( '#eEe' ), [238, 238, 238], 'Hex string: 3 char mixed' );
+ assert.deepEqual( $.colorUtil.getRGB( 'rgba(0, 0, 0, 0)' ), [255, 255, 255], 'Zero rgba for Safari 3; Transparent (whitespace)' );
+
+ // Perhaps this is a bug in colorUtil, but it is the current behaviour so, let's keep
+ // track of it, so we will know in case it would ever change.
+ assert.strictEqual( $.colorUtil.getRGB( 'rgba(0,0,0,0)' ), undefined, 'Zero rgba without whitespace' );
+
+ assert.deepEqual( $.colorUtil.getRGB( 'lightGreen' ), [144, 238, 144], 'Color names (lightGreen)' );
+ assert.deepEqual( $.colorUtil.getRGB( 'transparent' ), [255, 255, 255], 'Color names (transparent)' );
+ assert.strictEqual( $.colorUtil.getRGB( 'mediaWiki' ), undefined, 'Inexisting color name' );
+ });
+
+ QUnit.test( 'rgbToHsl', 1, function ( assert ) {
+ var hsl, ret;
+
+ // Cross-browser differences in decimals...
+ // Round to two decimals so they can be more reliably checked.
+ function dualDecimals( a ) {
+ return Math.round( a * 100 ) / 100;
+ }
+ // Re-create the rgbToHsl return array items, limited to two decimals.
+ hsl = $.colorUtil.rgbToHsl( 144, 238, 144 );
+ ret = [ dualDecimals( hsl[0] ), dualDecimals( hsl[1] ), dualDecimals( hsl[2] ) ];
+
+ assert.deepEqual( ret, [0.33, 0.73, 0.75], 'rgb(144, 238, 144): hsl(0.33, 0.73, 0.75)' );
+ });
+
+ QUnit.test( 'hslToRgb', 1, function ( assert ) {
+ var rgb, ret;
+ rgb = $.colorUtil.hslToRgb( 0.3, 0.7, 0.8 );
+
+ // Re-create the hslToRgb return array items, rounded to whole numbers.
+ ret = [ Math.round(rgb[0]), Math.round(rgb[1]), Math.round(rgb[2]) ];
+
+ assert.deepEqual( ret ,[183, 240, 168], 'hsl(0.3, 0.7, 0.8): rgb(183, 240, 168)' );
+ });
+
+ QUnit.test( 'getColorBrightness', 2, function ( assert ) {
+ var a, b;
+ a = $.colorUtil.getColorBrightness( 'red', +0.1 );
+ assert.equal( a, 'rgb(255,50,50)', 'Start with named color "red", brighten 10%' );
+
+ b = $.colorUtil.getColorBrightness( 'rgb(200,50,50)', -0.2 );
+ assert.equal( b, 'rgb(118,29,29)', 'Start with rgb string "rgb(200,50,50)", darken 20%' );
+ });
+}( jQuery ) );
-QUnit.asyncTest('jquery.delayedBind with data option', 2, function ( assert ) {
- var $fixture = $('<div>').appendTo('#qunit-fixture'),
- data = { magic: "beeswax" },
- delay = 50;
+( function ( $ ) {
+ QUnit.asyncTest('jquery.delayedBind with data option', 2, function ( assert ) {
+ var $fixture = $('<div>').appendTo('#qunit-fixture'),
+ data = {
+ magic: 'beeswax'
+ },
+ delay = 50;
- $fixture.delayedBind(delay, 'testevent', data, function ( e ) {
- QUnit.start(); // continue!
- assert.ok( true, 'testevent fired');
- assert.ok( e.data === data, 'data is passed through delayedBind');
+ $fixture.delayedBind(delay, 'testevent', data, function ( e ) {
+ assert.ok( true, 'testevent fired');
+ assert.ok( e.data === data, 'data is passed through delayedBind');
+ QUnit.start();
+ });
+
+ // We'll trigger it thrice, but it should only happen once.
+ $fixture.trigger( 'testevent', {} );
+ $fixture.trigger( 'testevent', {} );
+ $fixture.trigger( 'testevent', {} );
+ $fixture.trigger( 'testevent', {} );
});
- // We'll trigger it thrice, but it should only happen once.
- $fixture.trigger( 'testevent', {} );
- $fixture.trigger( 'testevent', {} );
- $fixture.trigger( 'testevent', {} );
- $fixture.trigger( 'testevent', {} );
-});
+ QUnit.asyncTest('jquery.delayedBind without data option', 1, function ( assert ) {
+ var $fixture = $('<div>').appendTo('#qunit-fixture'),
+ delay = 50;
-QUnit.asyncTest('jquery.delayedBind without data option', 1, function ( assert ) {
- var $fixture = $('<div>').appendTo('#qunit-fixture'),
- data = { magic: "beeswax" },
- delay = 50;
+ $fixture.delayedBind(delay, 'testevent', function () {
+ assert.ok(true, 'testevent fired');
+ QUnit.start();
+ });
- $fixture.delayedBind(delay, 'testevent', function ( e ) {
- QUnit.start(); // continue!
- assert.ok(true, 'testevent fired');
+ // We'll trigger it thrice, but it should only happen once.
+ $fixture.trigger( 'testevent', {} );
+ $fixture.trigger( 'testevent', {} );
+ $fixture.trigger( 'testevent', {} );
+ $fixture.trigger( 'testevent', {} );
});
-
- // We'll trigger it thrice, but it should only happen once.
- $fixture.trigger( 'testevent', {} );
- $fixture.trigger( 'testevent', {} );
- $fixture.trigger( 'testevent', {} );
- $fixture.trigger( 'testevent', {} );
-});
-
+}( jQuery ) );
-QUnit.module( 'jquery.getAttrs', QUnit.newMwEnvironment() );
+( function ( $ ) {
+ QUnit.module( 'jquery.getAttrs', QUnit.newMwEnvironment() );
-QUnit.test( 'Check', 1, function ( assert ) {
- var attrs = {
- foo: 'bar',
- 'class': 'lorem'
- },
- $el = jQuery( '<div>', attrs );
+ QUnit.test( 'Check', 1, function ( assert ) {
+ var attrs = {
+ foo: 'bar',
+ 'class': 'lorem'
+ },
+ $el = $( '<div>' ).attr( attrs );
- assert.deepEqual( $el.getAttrs(), attrs, 'getAttrs() return object should match the attributes set, no more, no less' );
-} );
+ assert.deepEqual( $el.getAttrs(), attrs, 'getAttrs() return object should match the attributes set, no more, no less' );
+ } );
+}( jQuery ) );
-QUnit.module( 'jquery.hidpi', QUnit.newMwEnvironment() );
+( function ( $ ) {
+ QUnit.module( 'jquery.hidpi', QUnit.newMwEnvironment() );
-QUnit.test( 'devicePixelRatio', function ( assert ) {
- var devicePixelRatio = $.devicePixelRatio();
- assert.equal( typeof devicePixelRatio, 'number', '$.devicePixelRatio() returns a number' );
-});
+ QUnit.test( 'devicePixelRatio', function ( assert ) {
+ var devicePixelRatio = $.devicePixelRatio();
+ assert.equal( typeof devicePixelRatio, 'number', '$.devicePixelRatio() returns a number' );
+ });
-QUnit.test( 'matchSrcSet', function ( assert ) {
- var srcset = 'onefive.png 1.5x, two.png 2x';
+ QUnit.test( 'matchSrcSet', function ( assert ) {
+ var srcset = 'onefive.png 1.5x, two.png 2x';
- // Nice exact matches
- assert.equal( $.matchSrcSet( 1, srcset ), null, '1.0 gives no match' );
- assert.equal( $.matchSrcSet( 1.5, srcset ), 'onefive.png', '1.5 gives match' );
- assert.equal( $.matchSrcSet( 2, srcset ), 'two.png', '2 gives match' );
+ // Nice exact matches
+ assert.equal( $.matchSrcSet( 1, srcset ), null, '1.0 gives no match' );
+ assert.equal( $.matchSrcSet( 1.5, srcset ), 'onefive.png', '1.5 gives match' );
+ assert.equal( $.matchSrcSet( 2, srcset ), 'two.png', '2 gives match' );
- // Non-exact matches; should return the next-biggest specified
- assert.equal( $.matchSrcSet( 1.25, srcset ), null, '1.25 gives no match' );
- assert.equal( $.matchSrcSet( 1.75, srcset ), 'onefive.png', '1.75 gives match to 1.5' );
- assert.equal( $.matchSrcSet( 2.25, srcset ), 'two.png', '2.25 gives match to 2' );
-});
+ // Non-exact matches; should return the next-biggest specified
+ assert.equal( $.matchSrcSet( 1.25, srcset ), null, '1.25 gives no match' );
+ assert.equal( $.matchSrcSet( 1.75, srcset ), 'onefive.png', '1.75 gives match to 1.5' );
+ assert.equal( $.matchSrcSet( 2.25, srcset ), 'two.png', '2.25 gives match to 2' );
+ });
+}( jQuery ) );
-QUnit.module( 'jquery.highlightText', QUnit.newMwEnvironment() );
+( function ( $ ) {
+ QUnit.module( 'jquery.highlightText', QUnit.newMwEnvironment() );
-QUnit.test( 'Check', function ( assert ) {
- var $fixture, cases = [
- {
- desc: 'Test 001',
- text: 'Blue Öyster Cult',
- highlight: 'Blue',
- expected: '<span class="highlight">Blue</span> Öyster Cult'
- },
- {
- desc: 'Test 002',
- text: 'Blue Öyster Cult',
- highlight: 'Blue ',
- expected: '<span class="highlight">Blue</span> Öyster Cult'
- },
- {
- desc: 'Test 003',
- text: 'Blue Öyster Cult',
- highlight: 'Blue Ö',
- expected: '<span class="highlight">Blue</span> <span class="highlight">Ö</span>yster Cult'
- },
- {
- desc: 'Test 004',
- text: 'Blue Öyster Cult',
- highlight: 'Blue Öy',
- expected: '<span class="highlight">Blue</span> <span class="highlight">Öy</span>ster Cult'
- },
- {
- desc: 'Test 005',
- text: 'Blue Öyster Cult',
- highlight: ' Blue',
- expected: '<span class="highlight">Blue</span> Öyster Cult'
- },
- {
- desc: 'Test 006',
- text: 'Blue Öyster Cult',
- highlight: ' Blue ',
- expected: '<span class="highlight">Blue</span> Öyster Cult'
- },
- {
- desc: 'Test 007',
- text: 'Blue Öyster Cult',
- highlight: ' Blue Ö',
- expected: '<span class="highlight">Blue</span> <span class="highlight">Ö</span>yster Cult'
- },
- {
- desc: 'Test 008',
- text: 'Blue Öyster Cult',
- highlight: ' Blue Öy',
- expected: '<span class="highlight">Blue</span> <span class="highlight">Öy</span>ster Cult'
- },
- {
- desc: 'Test 009: Highlighter broken on starting Umlaut?',
- text: 'Österreich',
- highlight: 'Österreich',
- expected: '<span class="highlight">Österreich</span>'
- },
- {
- desc: 'Test 010: Highlighter broken on starting Umlaut?',
- text: 'Österreich',
- highlight: 'Ö',
- expected: '<span class="highlight">Ö</span>sterreich'
- },
- {
- desc: 'Test 011: Highlighter broken on starting Umlaut?',
- text: 'Österreich',
- highlight: 'Öst',
- expected: '<span class="highlight">Öst</span>erreich'
- },
- {
- desc: 'Test 012: Highlighter broken on starting Umlaut?',
- text: 'Österreich',
- highlight: 'Oe',
- expected: 'Österreich'
- },
- {
- desc: 'Test 013: Highlighter broken on punctuation mark?',
- text: 'So good. To be there',
- highlight: 'good',
- expected: 'So <span class="highlight">good</span>. To be there'
- },
- {
- desc: 'Test 014: Highlighter broken on space?',
- text: 'So good. To be there',
- highlight: 'be',
- expected: 'So good. To <span class="highlight">be</span> there'
- },
- {
- desc: 'Test 015: Highlighter broken on space?',
- text: 'So good. To be there',
- highlight: ' be',
- expected: 'So good. To <span class="highlight">be</span> there'
- },
- {
- desc: 'Test 016: Highlighter broken on space?',
- text: 'So good. To be there',
- highlight: 'be ',
- expected: 'So good. To <span class="highlight">be</span> there'
- },
- {
- desc: 'Test 017: Highlighter broken on space?',
- text: 'So good. To be there',
- highlight: ' be ',
- expected: 'So good. To <span class="highlight">be</span> there'
- },
- {
- desc: 'Test 018: en de Highlighter broken on special character at the end?',
- text: 'So good. xbß',
- highlight: 'xbß',
- expected: 'So good. <span class="highlight">xbß</span>'
- },
- {
- desc: 'Test 019: en de Highlighter broken on special character at the end?',
- text: 'So good. xbß.',
- highlight: 'xbß.',
- expected: 'So good. <span class="highlight">xbß.</span>'
- },
- {
- desc: 'Test 020: RTL he Hebrew',
- text: 'חסיד אומות העולם',
- highlight: 'חסיד אומות העולם',
- expected: '<span class="highlight">חסיד</span> <span class="highlight">אומות</span> <span class="highlight">העולם</span>'
- },
- {
- desc: 'Test 021: RTL he Hebrew',
- text: 'חסיד אומות העולם',
- highlight: 'חסי',
- expected: '<span class="highlight">חסי</span>ד אומות העולם'
- },
- {
- desc: 'Test 022: ja Japanese',
- text: '諸国民の中の正義の人',
- highlight: '諸国民の中の正義の人',
- expected: '<span class="highlight">諸国民の中の正義の人</span>'
- },
- {
- desc: 'Test 023: ja Japanese',
- text: '諸国民の中の正義の人',
- highlight: '諸国',
- expected: '<span class="highlight">諸国</span>民の中の正義の人'
- },
- {
- desc: 'Test 024: fr French text and « french quotes » (guillemets)',
- text: "« L'oiseau est sur l’île »",
- highlight: "« L'oiseau est sur l’île »",
- expected: '<span class="highlight">«</span> <span class="highlight">L\'oiseau</span> <span class="highlight">est</span> <span class="highlight">sur</span> <span class="highlight">l’île</span> <span class="highlight">»</span>'
- },
- {
- desc: 'Test 025: fr French text and « french quotes » (guillemets)',
- text: "« L'oiseau est sur l’île »",
- highlight: "« L'oise",
- expected: '<span class="highlight">«</span> <span class="highlight">L\'oise</span>au est sur l’île »'
- },
- {
- desc: 'Test 025a: fr French text and « french quotes » (guillemets) - does it match the single strings "«" and "L" separately?',
- text: "« L'oiseau est sur l’île »",
- highlight: "« L",
- expected: '<span class="highlight">«</span> <span class="highlight">L</span>\'oiseau est sur <span class="highlight">l</span>’île »'
- },
- {
- desc: 'Test 026: ru Russian',
- text: 'Праведники мира',
- highlight: 'Праведники мира',
- expected: '<span class="highlight">Праведники</span> <span class="highlight">мира</span>'
- },
- {
- desc: 'Test 027: ru Russian',
- text: 'Праведники мира',
- highlight: 'Праве',
- expected: '<span class="highlight">Праве</span>дники мира'
- },
- {
- desc: 'Test 028 ka Georgian',
- text: 'მთავარი გვერდი',
- highlight: 'მთავარი გვერდი',
- expected: '<span class="highlight">მთავარი</span> <span class="highlight">გვერდი</span>'
- },
- {
- desc: 'Test 029 ka Georgian',
- text: 'მთავარი გვერდი',
- highlight: 'მთა',
- expected: '<span class="highlight">მთა</span>ვარი გვერდი'
- },
- {
- desc: 'Test 030 hy Armenian',
- text: 'Նոնա Գափրինդաշվիլի',
- highlight: 'Նոնա Գափրինդաշվիլի',
- expected: '<span class="highlight">Նոնա</span> <span class="highlight">Գափրինդաշվիլի</span>'
- },
- {
- desc: 'Test 031 hy Armenian',
- text: 'Նոնա Գափրինդաշվիլի',
- highlight: 'Նոն',
- expected: '<span class="highlight">Նոն</span>ա Գափրինդաշվիլի'
- },
- {
- desc: 'Test 032: th Thai',
- text: 'พอล แอร์ดิช',
- highlight: 'พอล แอร์ดิช',
- expected: '<span class="highlight">พอล</span> <span class="highlight">แอร์ดิช</span>'
- },
- {
- desc: 'Test 033: th Thai',
- text: 'พอล แอร์ดิช',
- highlight: 'พอ',
- expected: '<span class="highlight">พอ</span>ล แอร์ดิช'
- },
- {
- desc: 'Test 034: RTL ar Arabic',
- text: 'بول إيردوس',
- highlight: 'بول إيردوس',
- expected: '<span class="highlight">بول</span> <span class="highlight">إيردوس</span>'
- },
- {
- desc: 'Test 035: RTL ar Arabic',
- text: 'بول إيردوس',
- highlight: 'بو',
- expected: '<span class="highlight">بو</span>ل إيردوس'
- }
- ];
- QUnit.expect( cases.length );
+ QUnit.test( 'Check', function ( assert ) {
+ var $fixture, cases = [
+ {
+ desc: 'Test 001',
+ text: 'Blue Öyster Cult',
+ highlight: 'Blue',
+ expected: '<span class="highlight">Blue</span> Öyster Cult'
+ },
+ {
+ desc: 'Test 002',
+ text: 'Blue Öyster Cult',
+ highlight: 'Blue ',
+ expected: '<span class="highlight">Blue</span> Öyster Cult'
+ },
+ {
+ desc: 'Test 003',
+ text: 'Blue Öyster Cult',
+ highlight: 'Blue Ö',
+ expected: '<span class="highlight">Blue</span> <span class="highlight">Ö</span>yster Cult'
+ },
+ {
+ desc: 'Test 004',
+ text: 'Blue Öyster Cult',
+ highlight: 'Blue Öy',
+ expected: '<span class="highlight">Blue</span> <span class="highlight">Öy</span>ster Cult'
+ },
+ {
+ desc: 'Test 005',
+ text: 'Blue Öyster Cult',
+ highlight: ' Blue',
+ expected: '<span class="highlight">Blue</span> Öyster Cult'
+ },
+ {
+ desc: 'Test 006',
+ text: 'Blue Öyster Cult',
+ highlight: ' Blue ',
+ expected: '<span class="highlight">Blue</span> Öyster Cult'
+ },
+ {
+ desc: 'Test 007',
+ text: 'Blue Öyster Cult',
+ highlight: ' Blue Ö',
+ expected: '<span class="highlight">Blue</span> <span class="highlight">Ö</span>yster Cult'
+ },
+ {
+ desc: 'Test 008',
+ text: 'Blue Öyster Cult',
+ highlight: ' Blue Öy',
+ expected: '<span class="highlight">Blue</span> <span class="highlight">Öy</span>ster Cult'
+ },
+ {
+ desc: 'Test 009: Highlighter broken on starting Umlaut?',
+ text: 'Österreich',
+ highlight: 'Österreich',
+ expected: '<span class="highlight">Österreich</span>'
+ },
+ {
+ desc: 'Test 010: Highlighter broken on starting Umlaut?',
+ text: 'Österreich',
+ highlight: 'Ö',
+ expected: '<span class="highlight">Ö</span>sterreich'
+ },
+ {
+ desc: 'Test 011: Highlighter broken on starting Umlaut?',
+ text: 'Österreich',
+ highlight: 'Öst',
+ expected: '<span class="highlight">Öst</span>erreich'
+ },
+ {
+ desc: 'Test 012: Highlighter broken on starting Umlaut?',
+ text: 'Österreich',
+ highlight: 'Oe',
+ expected: 'Österreich'
+ },
+ {
+ desc: 'Test 013: Highlighter broken on punctuation mark?',
+ text: 'So good. To be there',
+ highlight: 'good',
+ expected: 'So <span class="highlight">good</span>. To be there'
+ },
+ {
+ desc: 'Test 014: Highlighter broken on space?',
+ text: 'So good. To be there',
+ highlight: 'be',
+ expected: 'So good. To <span class="highlight">be</span> there'
+ },
+ {
+ desc: 'Test 015: Highlighter broken on space?',
+ text: 'So good. To be there',
+ highlight: ' be',
+ expected: 'So good. To <span class="highlight">be</span> there'
+ },
+ {
+ desc: 'Test 016: Highlighter broken on space?',
+ text: 'So good. To be there',
+ highlight: 'be ',
+ expected: 'So good. To <span class="highlight">be</span> there'
+ },
+ {
+ desc: 'Test 017: Highlighter broken on space?',
+ text: 'So good. To be there',
+ highlight: ' be ',
+ expected: 'So good. To <span class="highlight">be</span> there'
+ },
+ {
+ desc: 'Test 018: en de Highlighter broken on special character at the end?',
+ text: 'So good. xbß',
+ highlight: 'xbß',
+ expected: 'So good. <span class="highlight">xbß</span>'
+ },
+ {
+ desc: 'Test 019: en de Highlighter broken on special character at the end?',
+ text: 'So good. xbß.',
+ highlight: 'xbß.',
+ expected: 'So good. <span class="highlight">xbß.</span>'
+ },
+ {
+ desc: 'Test 020: RTL he Hebrew',
+ text: 'חסיד אומות העולם',
+ highlight: 'חסיד אומות העולם',
+ expected: '<span class="highlight">חסיד</span> <span class="highlight">אומות</span> <span class="highlight">העולם</span>'
+ },
+ {
+ desc: 'Test 021: RTL he Hebrew',
+ text: 'חסיד אומות העולם',
+ highlight: 'חסי',
+ expected: '<span class="highlight">חסי</span>ד אומות העולם'
+ },
+ {
+ desc: 'Test 022: ja Japanese',
+ text: '諸国民の中の正義の人',
+ highlight: '諸国民の中の正義の人',
+ expected: '<span class="highlight">諸国民の中の正義の人</span>'
+ },
+ {
+ desc: 'Test 023: ja Japanese',
+ text: '諸国民の中の正義の人',
+ highlight: '諸国',
+ expected: '<span class="highlight">諸国</span>民の中の正義の人'
+ },
+ {
+ desc: 'Test 024: fr French text and « french quotes » (guillemets)',
+ text: '« L\'oiseau est sur l’île »',
+ highlight: '« L\'oiseau est sur l’île »',
+ expected: '<span class="highlight">«</span> <span class="highlight">L\'oiseau</span> <span class="highlight">est</span> <span class="highlight">sur</span> <span class="highlight">l’île</span> <span class="highlight">»</span>'
+ },
+ {
+ desc: 'Test 025: fr French text and « french quotes » (guillemets)',
+ text: '« L\'oiseau est sur l’île »',
+ highlight: '« L\'oise',
+ expected: '<span class="highlight">«</span> <span class="highlight">L\'oise</span>au est sur l’île »'
+ },
+ {
+ desc: 'Test 025a: fr French text and « french quotes » (guillemets) - does it match the single strings "«" and "L" separately?',
+ text: '« L\'oiseau est sur l’île »',
+ highlight: '« L',
+ expected: '<span class="highlight">«</span> <span class="highlight">L</span>\'oiseau est sur <span class="highlight">l</span>’île »'
+ },
+ {
+ desc: 'Test 026: ru Russian',
+ text: 'Праведники мира',
+ highlight: 'Праведники мира',
+ expected: '<span class="highlight">Праведники</span> <span class="highlight">мира</span>'
+ },
+ {
+ desc: 'Test 027: ru Russian',
+ text: 'Праведники мира',
+ highlight: 'Праве',
+ expected: '<span class="highlight">Праве</span>дники мира'
+ },
+ {
+ desc: 'Test 028 ka Georgian',
+ text: 'მთავარი გვერდი',
+ highlight: 'მთავარი გვერდი',
+ expected: '<span class="highlight">მთავარი</span> <span class="highlight">გვერდი</span>'
+ },
+ {
+ desc: 'Test 029 ka Georgian',
+ text: 'მთავარი გვერდი',
+ highlight: 'მთა',
+ expected: '<span class="highlight">მთა</span>ვარი გვერდი'
+ },
+ {
+ desc: 'Test 030 hy Armenian',
+ text: 'Նոնա Գափրինդաշվիլի',
+ highlight: 'Նոնա Գափրինդաշվիլի',
+ expected: '<span class="highlight">Նոնա</span> <span class="highlight">Գափրինդաշվիլի</span>'
+ },
+ {
+ desc: 'Test 031 hy Armenian',
+ text: 'Նոնա Գափրինդաշվիլի',
+ highlight: 'Նոն',
+ expected: '<span class="highlight">Նոն</span>ա Գափրինդաշվիլի'
+ },
+ {
+ desc: 'Test 032: th Thai',
+ text: 'พอล แอร์ดิช',
+ highlight: 'พอล แอร์ดิช',
+ expected: '<span class="highlight">พอล</span> <span class="highlight">แอร์ดิช</span>'
+ },
+ {
+ desc: 'Test 033: th Thai',
+ text: 'พอล แอร์ดิช',
+ highlight: 'พอ',
+ expected: '<span class="highlight">พอ</span>ล แอร์ดิช'
+ },
+ {
+ desc: 'Test 034: RTL ar Arabic',
+ text: 'بول إيردوس',
+ highlight: 'بول إيردوس',
+ expected: '<span class="highlight">بول</span> <span class="highlight">إيردوس</span>'
+ },
+ {
+ desc: 'Test 035: RTL ar Arabic',
+ text: 'بول إيردوس',
+ highlight: 'بو',
+ expected: '<span class="highlight">بو</span>ل إيردوس'
+ }
+ ];
+ QUnit.expect( cases.length );
- $.each( cases, function ( i, item ) {
- $fixture = $( '<p>' ).text( item.text ).highlightText( item.highlight );
- assert.equal(
- $fixture.html(),
- $( '<p>' ).html( item.expected ).html(), // re-parse to normalize!
- item.desc || undefined
- );
+ $.each( cases, function ( i, item ) {
+ $fixture = $( '<p>' ).text( item.text ).highlightText( item.highlight );
+ assert.equal(
+ $fixture.html(),
+ // Re-parse to normalize
+ $( '<p>' ).html( item.expected ).html(),
+ item.desc || undefined
+ );
+ } );
} );
-} );
+}( jQuery ) );
-QUnit.module( 'jquery.localize', QUnit.newMwEnvironment() );
+( function ( $, mw ) {
+ QUnit.module( 'jquery.localize', QUnit.newMwEnvironment() );
-QUnit.test( 'Handle basic replacements', 4, function ( assert ) {
- var html, $lc;
- mw.messages.set( 'basic', 'Basic stuff' );
+ QUnit.test( 'Handle basic replacements', 4, function ( assert ) {
+ var html, $lc;
+ mw.messages.set( 'basic', 'Basic stuff' );
- // Tag: html:msg
- html = '<div><span><html:msg key="basic" /></span></div>';
- $lc = $( html ).localize().find( 'span' );
+ // Tag: html:msg
+ html = '<div><span><html:msg key="basic" /></span></div>';
+ $lc = $( html ).localize().find( 'span' );
- assert.strictEqual( $lc.text(), 'Basic stuff', 'Tag: html:msg' );
+ assert.strictEqual( $lc.text(), 'Basic stuff', 'Tag: html:msg' );
- // Attribute: title-msg
- html = '<div><span title-msg="basic"></span></div>';
- $lc = $( html ).localize().find( 'span' );
+ // Attribute: title-msg
+ html = '<div><span title-msg="basic"></span></div>';
+ $lc = $( html ).localize().find( 'span' );
- assert.strictEqual( $lc.attr( 'title' ), 'Basic stuff', 'Attribute: title-msg' );
+ assert.strictEqual( $lc.attr( 'title' ), 'Basic stuff', 'Attribute: title-msg' );
- // Attribute: alt-msg
- html = '<div><span alt-msg="basic"></span></div>';
- $lc = $( html ).localize().find( 'span' );
+ // Attribute: alt-msg
+ html = '<div><span alt-msg="basic"></span></div>';
+ $lc = $( html ).localize().find( 'span' );
- assert.strictEqual( $lc.attr( 'alt' ), 'Basic stuff', 'Attribute: alt-msg' );
+ assert.strictEqual( $lc.attr( 'alt' ), 'Basic stuff', 'Attribute: alt-msg' );
- // Attribute: placeholder-msg
- html = '<div><input placeholder-msg="basic" /></div>';
- $lc = $( html ).localize().find( 'input' );
+ // Attribute: placeholder-msg
+ html = '<div><input placeholder-msg="basic" /></div>';
+ $lc = $( html ).localize().find( 'input' );
- assert.strictEqual( $lc.attr( 'placeholder' ), 'Basic stuff', 'Attribute: placeholder-msg' );
-} );
+ assert.strictEqual( $lc.attr( 'placeholder' ), 'Basic stuff', 'Attribute: placeholder-msg' );
+ } );
+
+ QUnit.test( 'Proper escaping', 2, function ( assert ) {
+ var html, $lc;
+ mw.messages.set( 'properfoo', '<proper esc="test">' );
+
+ // This is handled by jQuery inside $.fn.localize, just a simple sanity checked
+ // making sure it is actually using text() and attr() (or something with the same effect)
-QUnit.test( 'Proper escaping', 2, function ( assert ) {
- var html, $lc;
- mw.messages.set( 'properfoo', '<proper esc="test">' );
+ // Text escaping
+ html = '<div><span><html:msg key="properfoo"></span></div>';
+ $lc = $( html ).localize().find( 'span' );
- // This is handled by jQuery inside $.fn.localize, just a simple sanity checked
- // making sure it is actually using text() and attr() (or something with the same effect)
+ assert.strictEqual( $lc.text(), mw.msg( 'properfoo' ), 'Content is inserted as text, not as html.' );
- // Text escaping
- html = '<div><span><html:msg key="properfoo"></span></div>';
- $lc = $( html ).localize().find( 'span' );
+ // Attribute escaping
+ html = '<div><span title-msg="properfoo"></span></div>';
+ $lc = $( html ).localize().find( 'span' );
- assert.strictEqual( $lc.text(), mw.msg( 'properfoo' ), 'Content is inserted as text, not as html.' );
+ assert.strictEqual( $lc.attr( 'title' ), mw.msg( 'properfoo' ), 'Attributes are not inserted raw.' );
+ } );
- // Attribute escaping
- html = '<div><span title-msg="properfoo"></span></div>';
- $lc = $( html ).localize().find( 'span' );
+ QUnit.test( 'Options', 7, function ( assert ) {
+ mw.messages.set( {
+ 'foo-lorem': 'Lorem',
+ 'foo-ipsum': 'Ipsum',
+ 'foo-bar-title': 'Read more about bars',
+ 'foo-bar-label': 'The Bars',
+ 'foo-bazz-title': 'Read more about bazz at $1 (last modified: $2)',
+ 'foo-bazz-label': 'The Bazz ($1)',
+ 'foo-welcome': 'Welcome to $1! (last visit: $2)'
+ } );
+ var html, $lc, x, sitename = 'Wikipedia';
+
+ // Message key prefix
+ html = '<div><span title-msg="lorem"><html:msg key="ipsum"></span></div>';
+ $lc = $( html ).localize( {
+ prefix: 'foo-'
+ } ).find( 'span' );
+
+ assert.strictEqual( $lc.attr( 'title' ), 'Lorem', 'Message key prefix - attr' );
+ assert.strictEqual( $lc.text(), 'Ipsum', 'Message key prefix - text' );
+
+ // Variable keys mapping
+ x = 'bar';
+ html = '<div><span title-msg="title"><html:msg key="label"></span></div>';
+ $lc = $( html ).localize( {
+ keys: {
+ 'title': 'foo-' + x + '-title',
+ 'label': 'foo-' + x + '-label'
+ }
+ } ).find( 'span' );
+
+ assert.strictEqual( $lc.attr( 'title' ), 'Read more about bars', 'Variable keys mapping - attr' );
+ assert.strictEqual( $lc.text(), 'The Bars', 'Variable keys mapping - text' );
+
+ // Passing parameteters to mw.msg
+ html = '<div><span><html:msg key="foo-welcome"></span></div>';
+ $lc = $( html ).localize( {
+ params: {
+ 'foo-welcome': [sitename, 'yesterday']
+ }
+ } ).find( 'span' );
+
+ assert.strictEqual( $lc.text(), 'Welcome to Wikipedia! (last visit: yesterday)', 'Passing parameteters to mw.msg' );
+
+ // Combination of options prefix, params and keys
+ x = 'bazz';
+ html = '<div><span title-msg="title"><html:msg key="label"></span></div>';
+ $lc = $( html ).localize( {
+ prefix: 'foo-',
+ keys: {
+ 'title': x + '-title',
+ 'label': x + '-label'
+ },
+ params: {
+ 'title': [sitename, '3 minutes ago'],
+ 'label': [sitename, '3 minutes ago']
+
+ }
+ } ).find( 'span' );
+
+ assert.strictEqual( $lc.text(), 'The Bazz (Wikipedia)', 'Combination of options prefix, params and keys - text' );
+ assert.strictEqual( $lc.attr( 'title' ), 'Read more about bazz at Wikipedia (last modified: 3 minutes ago)', 'Combination of options prefix, params and keys - attr' );
+ } );
- assert.strictEqual( $lc.attr( 'title' ), mw.msg( 'properfoo' ), 'Attributes are not inserted raw.' );
-} );
+ QUnit.test( 'Handle data text', 2, function ( assert ) {
+ var html, $lc;
+ mw.messages.set( 'option-one', 'Item 1' );
+ mw.messages.set( 'option-two', 'Item 2' );
+ html = '<select><option data-msg-text="option-one"></option><option data-msg-text="option-two"></option></select>';
+ $lc = $( html ).localize().find( 'option' );
+ assert.strictEqual( $lc.eq( 0 ).text(), mw.msg( 'option-one' ), 'data-msg-text becomes text of options' );
+ assert.strictEqual( $lc.eq( 1 ).text(), mw.msg( 'option-two' ), 'data-msg-text becomes text of options' );
+ } );
-QUnit.test( 'Options', 7, function ( assert ) {
- mw.messages.set( {
- 'foo-lorem': 'Lorem',
- 'foo-ipsum': 'Ipsum',
- 'foo-bar-title': 'Read more about bars',
- 'foo-bar-label': 'The Bars',
- 'foo-bazz-title': 'Read more about bazz at $1 (last modified: $2)',
- 'foo-bazz-label': 'The Bazz ($1)',
- 'foo-welcome': 'Welcome to $1! (last visit: $2)'
+ QUnit.test( 'Handle data html', 2, function ( assert ) {
+ var html, $lc;
+ mw.messages.set( 'html', 'behold... there is a <a>link</a> here!!' );
+ html = '<div><div data-msg-html="html"></div></div>';
+ $lc = $( html ).localize().find( 'a' );
+ assert.strictEqual( $lc.length, 1, 'link is created' );
+ assert.strictEqual( $lc.text(), 'link', 'the link text got added' );
} );
- var html, $lc, attrs, x, sitename = 'Wikipedia';
-
- // Message key prefix
- html = '<div><span title-msg="lorem"><html:msg key="ipsum"></span></div>';
- $lc = $( html ).localize( {
- prefix: 'foo-'
- } ).find( 'span' );
-
- assert.strictEqual( $lc.attr( 'title' ), 'Lorem', 'Message key prefix - attr' );
- assert.strictEqual( $lc.text(), 'Ipsum', 'Message key prefix - text' );
-
- // Variable keys mapping
- x = 'bar';
- html = '<div><span title-msg="title"><html:msg key="label"></span></div>';
- $lc = $( html ).localize( {
- keys: {
- 'title': 'foo-' + x + '-title',
- 'label': 'foo-' + x + '-label'
- }
- } ).find( 'span' );
-
- assert.strictEqual( $lc.attr( 'title' ), 'Read more about bars', 'Variable keys mapping - attr' );
- assert.strictEqual( $lc.text(), 'The Bars', 'Variable keys mapping - text' );
-
- // Passing parameteters to mw.msg
- html = '<div><span><html:msg key="foo-welcome"></span></div>';
- $lc = $( html ).localize( {
- params: {
- 'foo-welcome': [sitename, 'yesterday']
- }
- } ).find( 'span' );
-
- assert.strictEqual( $lc.text(), 'Welcome to Wikipedia! (last visit: yesterday)', 'Passing parameteters to mw.msg' );
-
- // Combination of options prefix, params and keys
- x = 'bazz';
- html = '<div><span title-msg="title"><html:msg key="label"></span></div>';
- $lc = $( html ).localize( {
- prefix: 'foo-',
- keys: {
- 'title': x + '-title',
- 'label': x + '-label'
- },
- params: {
- 'title': [sitename, '3 minutes ago'],
- 'label': [sitename, '3 minutes ago']
-
- }
- } ).find( 'span' );
-
- assert.strictEqual( $lc.text(), 'The Bazz (Wikipedia)', 'Combination of options prefix, params and keys - text' );
- assert.strictEqual( $lc.attr( 'title' ), 'Read more about bazz at Wikipedia (last modified: 3 minutes ago)', 'Combination of options prefix, params and keys - attr' );
-} );
-
-QUnit.test( 'Handle data text', 2, function ( assert ) {
- var html, $lc;
- mw.messages.set( 'option-one', 'Item 1' );
- mw.messages.set( 'option-two', 'Item 2' );
- html = '<select><option data-msg-text="option-one"></option><option data-msg-text="option-two"></option></select>';
- $lc = $( html ).localize().find( 'option' );
- assert.strictEqual( $lc.eq( 0 ).text(), mw.msg( 'option-one' ), 'data-msg-text becomes text of options' );
- assert.strictEqual( $lc.eq( 1 ).text(), mw.msg( 'option-two' ), 'data-msg-text becomes text of options' );
-} );
-
-QUnit.test( 'Handle data html', 2, function ( assert ) {
- var html, $lc;
- mw.messages.set( 'html', 'behold... there is a <a>link</a> here!!' );
- html = '<div><div data-msg-html="html"></div></div>';
- $lc = $( html ).localize().find( 'a' );
- assert.strictEqual( $lc.length, 1, 'link is created' );
- assert.strictEqual( $lc.text(), 'link', 'the link text got added' );
-} );
+}( jQuery, mediaWiki ) ) ;
-QUnit.module( 'jquery.mwExtension', QUnit.newMwEnvironment() );
-
-QUnit.test( 'String functions', function ( assert ) {
-
- assert.equal( $.trimLeft( ' foo bar ' ), 'foo bar ', 'trimLeft' );
- assert.equal( $.trimRight( ' foo bar ' ), ' foo bar', 'trimRight' );
- assert.equal( $.ucFirst( 'foo' ), 'Foo', 'ucFirst' );
-
- assert.equal( $.escapeRE( '<!-- ([{+mW+}]) $^|?>' ),
- '<!\\-\\- \\(\\[\\{\\+mW\\+\\}\\]\\) \\$\\^\\|\\?>', 'escapeRE - Escape specials' );
- assert.equal( $.escapeRE( 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' ),
- 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'escapeRE - Leave uppercase alone' );
- assert.equal( $.escapeRE( 'abcdefghijklmnopqrstuvwxyz' ),
- 'abcdefghijklmnopqrstuvwxyz', 'escapeRE - Leave lowercase alone' );
- assert.equal( $.escapeRE( '0123456789' ), '0123456789', 'escapeRE - Leave numbers alone' );
-});
-
-QUnit.test( 'Is functions', function ( assert ) {
-
- assert.strictEqual( $.isDomElement( document.getElementById( 'qunit-header' ) ), true,
- 'isDomElement: #qunit-header Node' );
- assert.strictEqual( $.isDomElement( document.getElementById( 'random-name' ) ), false,
- 'isDomElement: #random-name (null)' );
- assert.strictEqual( $.isDomElement( document.getElementsByTagName( 'div' ) ), false,
- 'isDomElement: getElementsByTagName Array' );
- assert.strictEqual( $.isDomElement( document.getElementsByTagName( 'div' )[0] ), true,
- 'isDomElement: getElementsByTagName(..)[0] Node' );
- assert.strictEqual( $.isDomElement( $( 'div' ) ), false,
- 'isDomElement: jQuery object' );
- assert.strictEqual( $.isDomElement( $( 'div' ).get(0) ), true,
- 'isDomElement: jQuery object > Get node' );
- assert.strictEqual( $.isDomElement( document.createElement( 'div' ) ), true,
- 'isDomElement: createElement' );
- assert.strictEqual( $.isDomElement( { foo: 1 } ), false,
- 'isDomElement: Object' );
-
- assert.strictEqual( $.isEmpty( 'string' ), false, 'isEmptry: "string"' );
- assert.strictEqual( $.isEmpty( '0' ), true, 'isEmptry: "0"' );
- assert.strictEqual( $.isEmpty( '' ), true, 'isEmptry: ""' );
- assert.strictEqual( $.isEmpty( 1 ), false, 'isEmptry: 1' );
- assert.strictEqual( $.isEmpty( [] ), true, 'isEmptry: []' );
- assert.strictEqual( $.isEmpty( {} ), true, 'isEmptry: {}' );
-
- // Documented behaviour
- assert.strictEqual( $.isEmpty( { length: 0 } ), true, 'isEmptry: { length: 0 }' );
-});
-
-QUnit.test( 'Comparison functions', function ( assert ) {
-
- assert.ok( $.compareArray( [0, 'a', [], [2, 'b'] ], [0, "a", [], [2, "b"] ] ),
- 'compareArray: Two deep arrays that are excactly the same' );
- assert.ok( !$.compareArray( [1], [2] ), 'compareArray: Two different arrays (false)' );
-
- assert.ok( $.compareObject( {}, {} ), 'compareObject: Two empty objects' );
- assert.ok( $.compareObject( { foo: 1 }, { foo: 1 } ), 'compareObject: Two the same objects' );
- assert.ok( !$.compareObject( { bar: true }, { baz: false } ),
- 'compareObject: Two different objects (false)' );
-});
+( function ( $ ) {
+ QUnit.module( 'jquery.mwExtension', QUnit.newMwEnvironment() );
+
+ QUnit.test( 'String functions', function ( assert ) {
+
+ assert.equal( $.trimLeft( ' foo bar ' ), 'foo bar ', 'trimLeft' );
+ assert.equal( $.trimRight( ' foo bar ' ), ' foo bar', 'trimRight' );
+ assert.equal( $.ucFirst( 'foo' ), 'Foo', 'ucFirst' );
+
+ assert.equal( $.escapeRE( '<!-- ([{+mW+}]) $^|?>' ),
+ '<!\\-\\- \\(\\[\\{\\+mW\\+\\}\\]\\) \\$\\^\\|\\?>', 'escapeRE - Escape specials' );
+ assert.equal( $.escapeRE( 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' ),
+ 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'escapeRE - Leave uppercase alone' );
+ assert.equal( $.escapeRE( 'abcdefghijklmnopqrstuvwxyz' ),
+ 'abcdefghijklmnopqrstuvwxyz', 'escapeRE - Leave lowercase alone' );
+ assert.equal( $.escapeRE( '0123456789' ), '0123456789', 'escapeRE - Leave numbers alone' );
+ });
+
+ QUnit.test( 'Is functions', function ( assert ) {
+
+ assert.strictEqual( $.isDomElement( document.getElementById( 'qunit-header' ) ), true,
+ 'isDomElement: #qunit-header Node' );
+ assert.strictEqual( $.isDomElement( document.getElementById( 'random-name' ) ), false,
+ 'isDomElement: #random-name (null)' );
+ assert.strictEqual( $.isDomElement( document.getElementsByTagName( 'div' ) ), false,
+ 'isDomElement: getElementsByTagName Array' );
+ assert.strictEqual( $.isDomElement( document.getElementsByTagName( 'div' )[0] ), true,
+ 'isDomElement: getElementsByTagName(..)[0] Node' );
+ assert.strictEqual( $.isDomElement( $( 'div' ) ), false,
+ 'isDomElement: jQuery object' );
+ assert.strictEqual( $.isDomElement( $( 'div' ).get(0) ), true,
+ 'isDomElement: jQuery object > Get node' );
+ assert.strictEqual( $.isDomElement( document.createElement( 'div' ) ), true,
+ 'isDomElement: createElement' );
+ assert.strictEqual( $.isDomElement( { foo: 1 } ), false,
+ 'isDomElement: Object' );
+
+ assert.strictEqual( $.isEmpty( 'string' ), false, 'isEmptry: "string"' );
+ assert.strictEqual( $.isEmpty( '0' ), true, 'isEmptry: "0"' );
+ assert.strictEqual( $.isEmpty( '' ), true, 'isEmptry: ""' );
+ assert.strictEqual( $.isEmpty( 1 ), false, 'isEmptry: 1' );
+ assert.strictEqual( $.isEmpty( [] ), true, 'isEmptry: []' );
+ assert.strictEqual( $.isEmpty( {} ), true, 'isEmptry: {}' );
+
+ // Documented behaviour
+ assert.strictEqual( $.isEmpty( { length: 0 } ), true, 'isEmptry: { length: 0 }' );
+ });
+
+ QUnit.test( 'Comparison functions', function ( assert ) {
+
+ assert.ok( $.compareArray( [0, 'a', [], [2, 'b'] ], [0, 'a', [], [2, 'b'] ] ),
+ 'compareArray: Two deep arrays that are excactly the same' );
+ assert.ok( !$.compareArray( [1], [2] ), 'compareArray: Two different arrays (false)' );
+
+ assert.ok( $.compareObject( {}, {} ), 'compareObject: Two empty objects' );
+ assert.ok( $.compareObject( { foo: 1 }, { foo: 1 } ), 'compareObject: Two the same objects' );
+ assert.ok( !$.compareObject( { bar: true }, { baz: false } ),
+ 'compareObject: Two different objects (false)' );
+ });
+}( jQuery ) );
-QUnit.module( 'jquery.tabIndex', QUnit.newMwEnvironment() );
+( function ( $ ) {
+ QUnit.module( 'jquery.tabIndex', QUnit.newMwEnvironment() );
-QUnit.test( 'firstTabIndex', 2, function ( assert ) {
- var testEnvironment =
-'<form>' +
- '<input tabindex="7" />' +
- '<input tabindex="9" />' +
- '<textarea tabindex="2">Foobar</textarea>' +
- '<textarea tabindex="5">Foobar</textarea>' +
-'</form>';
+ QUnit.test( 'firstTabIndex', 2, function ( assert ) {
+ var html, $testA, $testB;
+ html =
+ '<form>' +
+ '<input tabindex="7" />' +
+ '<input tabindex="9" />' +
+ '<textarea tabindex="2">Foobar</textarea>' +
+ '<textarea tabindex="5">Foobar</textarea>' +
+ '</form>';
- var $testA = $( '<div>' ).html( testEnvironment ).appendTo( '#qunit-fixture' );
- assert.strictEqual( $testA.firstTabIndex(), 2, 'First tabindex should be 2 within this context.' );
+ $testA = $( '<div>' ).html( html ).appendTo( '#qunit-fixture' );
+ assert.strictEqual( $testA.firstTabIndex(), 2, 'First tabindex should be 2 within this context.' );
- var $testB = $( '<div>' );
- assert.strictEqual( $testB.firstTabIndex(), null, 'Return null if none available.' );
-});
+ $testB = $( '<div>' );
+ assert.strictEqual( $testB.firstTabIndex(), null, 'Return null if none available.' );
+ });
-QUnit.test( 'lastTabIndex', 2, function ( assert ) {
- var testEnvironment =
-'<form>' +
- '<input tabindex="7" />' +
- '<input tabindex="9" />' +
- '<textarea tabindex="2">Foobar</textarea>' +
- '<textarea tabindex="5">Foobar</textarea>' +
-'</form>';
+ QUnit.test( 'lastTabIndex', 2, function ( assert ) {
+ var html, $testA, $testB;
+ html =
+ '<form>' +
+ '<input tabindex="7" />' +
+ '<input tabindex="9" />' +
+ '<textarea tabindex="2">Foobar</textarea>' +
+ '<textarea tabindex="5">Foobar</textarea>' +
+ '</form>';
- var $testA = $( '<div>' ).html( testEnvironment ).appendTo( '#qunit-fixture' );
- assert.strictEqual( $testA.lastTabIndex(), 9, 'Last tabindex should be 9 within this context.' );
+ $testA = $( '<div>' ).html( html ).appendTo( '#qunit-fixture' );
+ assert.strictEqual( $testA.lastTabIndex(), 9, 'Last tabindex should be 9 within this context.' );
- var $testB = $( '<div>' );
- assert.strictEqual( $testB.lastTabIndex(), null, 'Return null if none available.' );
-});
+ $testB = $( '<div>' );
+ assert.strictEqual( $testB.lastTabIndex(), null, 'Return null if none available.' );
+ });
+}( jQuery ) );
( function ( $, mw ) {
-
-var config = {
- wgMonthNames: ['', 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
- wgMonthNamesShort: ['', 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
- wgDefaultDateFormat: 'dmy',
- wgContentLanguage: 'en'
-};
-
-QUnit.module( 'jquery.tablesorter', QUnit.newMwEnvironment({ config: config }) );
-
-/**
- * Create an HTML table from an array of row arrays containing text strings.
- * First row will be header row. No fancy rowspan/colspan stuff.
- *
- * @param {String[]} header
- * @param {String[][]} data
- * @return jQuery
- */
-function tableCreate( header, data ) {
- var i,
- $table = $( '<table class="sortable"><thead></thead><tbody></tbody></table>' ),
- $thead = $table.find( 'thead' ),
- $tbody = $table.find( 'tbody' ),
- $tr = $( '<tr>' );
-
- $.each( header, function ( i, str ) {
- var $th = $( '<th>' );
- $th.text( str ).appendTo( $tr );
- });
- $tr.appendTo( $thead );
-
- for ( i = 0; i < data.length; i++ ) {
- $tr = $( '<tr>' );
- $.each( data[i], function ( j, str ) {
- var $td = $( '<td>' );
- $td.text( str ).appendTo( $tr );
+ /*jshint onevar: false */
+
+ var config = {
+ wgMonthNames: ['', 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
+ wgMonthNamesShort: ['', 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
+ wgDefaultDateFormat: 'dmy',
+ wgContentLanguage: 'en'
+ };
+
+ QUnit.module( 'jquery.tablesorter', QUnit.newMwEnvironment({ config: config }) );
+
+ /**
+ * Create an HTML table from an array of row arrays containing text strings.
+ * First row will be header row. No fancy rowspan/colspan stuff.
+ *
+ * @param {String[]} header
+ * @param {String[][]} data
+ * @return jQuery
+ */
+ function tableCreate( header, data ) {
+ var i,
+ $table = $( '<table class="sortable"><thead></thead><tbody></tbody></table>' ),
+ $thead = $table.find( 'thead' ),
+ $tbody = $table.find( 'tbody' ),
+ $tr = $( '<tr>' );
+
+ $.each( header, function ( i, str ) {
+ var $th = $( '<th>' );
+ $th.text( str ).appendTo( $tr );
});
- $tr.appendTo( $tbody );
+ $tr.appendTo( $thead );
+
+ for ( i = 0; i < data.length; i++ ) {
+ /*jshint loopfunc: true */
+ $tr = $( '<tr>' );
+ $.each( data[i], function ( j, str ) {
+ var $td = $( '<td>' );
+ $td.text( str ).appendTo( $tr );
+ });
+ $tr.appendTo( $tbody );
+ }
+ return $table;
}
- return $table;
-}
-
-/**
- * Extract text from table.
- *
- * @param {jQuery} $table
- * @return String[][]
- */
-function tableExtract( $table ) {
- var data = [];
-
- $table.find( 'tbody' ).find( 'tr' ).each( function( i, tr ) {
- var row = [];
- $( tr ).find( 'td,th' ).each( function( i, td ) {
- row.push( $( td ).text() );
+
+ /**
+ * Extract text from table.
+ *
+ * @param {jQuery} $table
+ * @return String[][]
+ */
+ function tableExtract( $table ) {
+ var data = [];
+
+ $table.find( 'tbody' ).find( 'tr' ).each( function( i, tr ) {
+ var row = [];
+ $( tr ).find( 'td,th' ).each( function( i, td ) {
+ row.push( $( td ).text() );
+ });
+ data.push( row );
});
- data.push( row );
- });
- return data;
-}
-
-/**
- * Run a table test by building a table with the given data,
- * running some callback on it, then checking the results.
- *
- * @param {String} msg text to pass on to qunit for the comparison
- * @param {String[]} header cols to make the table
- * @param {String[][]} data rows/cols to make the table
- * @param {String[][]} expected rows/cols to compare against at end
- * @param {function($table)} callback something to do with the table before we compare
- */
-function tableTest( msg, header, data, expected, callback ) {
- QUnit.test( msg, 1, function ( assert ) {
- var $table = tableCreate( header, data );
-
- // Give caller a chance to set up sorting and manipulate the table.
- callback( $table );
-
- // Table sorting is done synchronously; if it ever needs to change back
- // to asynchronous, we'll need a timeout or a callback here.
- var extracted = tableExtract( $table );
- assert.deepEqual( extracted, expected, msg );
- });
-}
-
-function reversed(arr) {
- // Clone array
- var arr2 = arr.slice(0);
-
- arr2.reverse();
-
- return arr2;
-}
-
-// Sample data set using planets named and their radius
-var header = [ 'Planet' , 'Radius (km)'],
- mercury = [ 'Mercury', '2439.7' ],
- venus = [ 'Venus' , '6051.8' ],
- earth = [ 'Earth' , '6371.0' ],
- mars = [ 'Mars' , '3390.0' ],
- jupiter = [ 'Jupiter', '69911' ],
- saturn = [ 'Saturn' , '58232' ];
-
-// Initial data set
-var planets = [mercury, venus, earth, mars, jupiter, saturn];
-var ascendingName = [earth, jupiter, mars, mercury, saturn, venus];
-var ascendingRadius = [mercury, mars, venus, earth, saturn, jupiter];
-
-tableTest(
- 'Basic planet table: sorting initially - ascending by name',
- header,
- planets,
- ascendingName,
- function ( $table ) {
- $table.tablesorter( { sortList: [ { 0: 'asc' } ] } );
- }
-);
-tableTest(
- 'Basic planet table: sorting initially - descending by radius',
- header,
- planets,
- reversed(ascendingRadius),
- function ( $table ) {
- $table.tablesorter( { sortList: [ { 1: 'desc' } ] } );
- }
-);
-tableTest(
- 'Basic planet table: ascending by name',
- header,
- planets,
- ascendingName,
- function ( $table ) {
- $table.tablesorter();
- $table.find( '.headerSort:eq(0)' ).click();
- }
-);
-tableTest(
- 'Basic planet table: ascending by name a second time',
- header,
- planets,
- ascendingName,
- function ( $table ) {
- $table.tablesorter();
- $table.find( '.headerSort:eq(0)' ).click();
- }
-);
-tableTest(
- 'Basic planet table: descending by name',
- header,
- planets,
- reversed(ascendingName),
- function ( $table ) {
- $table.tablesorter();
- $table.find( '.headerSort:eq(0)' ).click().click();
+ return data;
}
-);
-tableTest(
- 'Basic planet table: ascending radius',
- header,
- planets,
- ascendingRadius,
- function ( $table ) {
- $table.tablesorter();
- $table.find( '.headerSort:eq(1)' ).click();
+
+ /**
+ * Run a table test by building a table with the given data,
+ * running some callback on it, then checking the results.
+ *
+ * @param {String} msg text to pass on to qunit for the comparison
+ * @param {String[]} header cols to make the table
+ * @param {String[][]} data rows/cols to make the table
+ * @param {String[][]} expected rows/cols to compare against at end
+ * @param {function($table)} callback something to do with the table before we compare
+ */
+ function tableTest( msg, header, data, expected, callback ) {
+ QUnit.test( msg, 1, function ( assert ) {
+ var $table = tableCreate( header, data );
+
+ // Give caller a chance to set up sorting and manipulate the table.
+ callback( $table );
+
+ // Table sorting is done synchronously; if it ever needs to change back
+ // to asynchronous, we'll need a timeout or a callback here.
+ var extracted = tableExtract( $table );
+ assert.deepEqual( extracted, expected, msg );
+ });
}
-);
-tableTest(
- 'Basic planet table: descending radius',
- header,
- planets,
- reversed(ascendingRadius),
- function ( $table ) {
- $table.tablesorter();
- $table.find( '.headerSort:eq(1)' ).click().click();
+
+ function reversed(arr) {
+ // Clone array
+ var arr2 = arr.slice(0);
+
+ arr2.reverse();
+
+ return arr2;
}
-);
-
-// Sample data set to test multiple column sorting
-var header = [ 'column1' , 'column2'],
- a1 = [ 'A', '1' ],
- a2 = [ 'A', '2' ],
- a3 = [ 'A', '3' ],
- b1 = [ 'B', '1' ],
- b2 = [ 'B', '2' ],
- b3 = [ 'B', '3' ];
-var initial = [a2, b3, a1, a3, b2, b1];
-var asc = [a1, a2, a3, b1, b2, b3];
-var descasc = [b1, b2, b3, a1, a2, a3];
-
-tableTest(
- 'Sorting multiple columns by passing sort list',
- header,
- initial,
- asc,
- function ( $table ) {
+
+ // Sample data set using planets named and their radius
+ var header = [ 'Planet' , 'Radius (km)'],
+ mercury = [ 'Mercury', '2439.7' ],
+ venus = [ 'Venus' , '6051.8' ],
+ earth = [ 'Earth' , '6371.0' ],
+ mars = [ 'Mars' , '3390.0' ],
+ jupiter = [ 'Jupiter', '69911' ],
+ saturn = [ 'Saturn' , '58232' ];
+
+ // Initial data set
+ var planets = [mercury, venus, earth, mars, jupiter, saturn];
+ var ascendingName = [earth, jupiter, mars, mercury, saturn, venus];
+ var ascendingRadius = [mercury, mars, venus, earth, saturn, jupiter];
+
+ tableTest(
+ 'Basic planet table: sorting initially - ascending by name',
+ header,
+ planets,
+ ascendingName,
+ function ( $table ) {
+ $table.tablesorter( { sortList: [ { 0: 'asc' } ] } );
+ }
+ );
+ tableTest(
+ 'Basic planet table: sorting initially - descending by radius',
+ header,
+ planets,
+ reversed(ascendingRadius),
+ function ( $table ) {
+ $table.tablesorter( { sortList: [ { 1: 'desc' } ] } );
+ }
+ );
+ tableTest(
+ 'Basic planet table: ascending by name',
+ header,
+ planets,
+ ascendingName,
+ function ( $table ) {
+ $table.tablesorter();
+ $table.find( '.headerSort:eq(0)' ).click();
+ }
+ );
+ tableTest(
+ 'Basic planet table: ascending by name a second time',
+ header,
+ planets,
+ ascendingName,
+ function ( $table ) {
+ $table.tablesorter();
+ $table.find( '.headerSort:eq(0)' ).click();
+ }
+ );
+ tableTest(
+ 'Basic planet table: descending by name',
+ header,
+ planets,
+ reversed(ascendingName),
+ function ( $table ) {
+ $table.tablesorter();
+ $table.find( '.headerSort:eq(0)' ).click().click();
+ }
+ );
+ tableTest(
+ 'Basic planet table: ascending radius',
+ header,
+ planets,
+ ascendingRadius,
+ function ( $table ) {
+ $table.tablesorter();
+ $table.find( '.headerSort:eq(1)' ).click();
+ }
+ );
+ tableTest(
+ 'Basic planet table: descending radius',
+ header,
+ planets,
+ reversed(ascendingRadius),
+ function ( $table ) {
+ $table.tablesorter();
+ $table.find( '.headerSort:eq(1)' ).click().click();
+ }
+ );
+
+ // Sample data set to test multiple column sorting
+ header = [ 'column1' , 'column2'];
+ var
+ a1 = [ 'A', '1' ],
+ a2 = [ 'A', '2' ],
+ a3 = [ 'A', '3' ],
+ b1 = [ 'B', '1' ],
+ b2 = [ 'B', '2' ],
+ b3 = [ 'B', '3' ];
+ var initial = [a2, b3, a1, a3, b2, b1];
+ var asc = [a1, a2, a3, b1, b2, b3];
+ var descasc = [b1, b2, b3, a1, a2, a3];
+
+ tableTest(
+ 'Sorting multiple columns by passing sort list',
+ header,
+ initial,
+ asc,
+ function ( $table ) {
+ $table.tablesorter(
+ { sortList: [ { 0: 'asc' }, { 1: 'asc' } ] }
+ );
+ }
+ );
+ tableTest(
+ 'Sorting multiple columns by programmatically triggering sort()',
+ header,
+ initial,
+ descasc,
+ function ( $table ) {
+ $table.tablesorter();
+ $table.data( 'tablesorter' ).sort(
+ [ { 0: 'desc' }, { 1: 'asc' } ]
+ );
+ }
+ );
+ tableTest(
+ 'Reset to initial sorting by triggering sort() without any parameters',
+ header,
+ initial,
+ asc,
+ function ( $table ) {
+ $table.tablesorter(
+ { sortList: [ { 0: 'asc' }, { 1: 'asc' } ] }
+ );
+ $table.data( 'tablesorter' ).sort(
+ [ { 0: 'desc' }, { 1: 'asc' } ]
+ );
+ $table.data( 'tablesorter' ).sort();
+ }
+ );
+ QUnit.test( 'Reset sorting making table appear unsorted', 3, function ( assert ) {
+ var $table = tableCreate( header, initial );
$table.tablesorter(
- { sortList: [ { 0: 'asc' }, { 1: 'asc' } ] }
+ { sortList: [ { 0: 'desc' }, { 1: 'asc' } ] }
);
- }
-);
-tableTest(
- 'Sorting multiple columns by programmatically triggering sort()',
- header,
- initial,
- descasc,
- function ( $table ) {
- $table.tablesorter();
- $table.data( 'tablesorter' ).sort(
- [ { 0: 'desc' }, { 1: 'asc' } ]
+ $table.data( 'tablesorter' ).sort( [] );
+
+ assert.equal(
+ $table.find( 'th.headerSortUp' ).length + $table.find( 'th.headerSortDown' ).length,
+ 0,
+ 'No sort specific sort classes addign to header cells'
);
- }
-);
-tableTest(
- 'Reset to initial sorting by triggering sort() without any parameters',
- header,
- initial,
- asc,
- function ( $table ) {
- $table.tablesorter(
- { sortList: [ { 0: 'asc' }, { 1: 'asc' } ] }
+
+ assert.equal(
+ $table.find( 'th' ).first().attr( 'title' ),
+ mw.msg( 'sort-ascending' ),
+ 'First header cell has default title'
);
- $table.data( 'tablesorter' ).sort(
- [ { 0: 'desc' }, { 1: 'asc' } ]
+
+ assert.equal(
+ $table.find( 'th' ).first().attr( 'title' ),
+ $table.find( 'th' ).last().attr( 'title' ),
+ 'Both header cells\' titles match'
);
- $table.data( 'tablesorter' ).sort();
- }
-);
-QUnit.test( 'Reset sorting making table appear unsorted', 3, function ( assert ) {
- var $table = tableCreate( header, initial );
- $table.tablesorter(
- { sortList: [ { 0: 'desc' }, { 1: 'asc' } ] }
+ } );
+
+ // Regression tests!
+ tableTest(
+ 'Bug 28775: German-style (dmy) short numeric dates',
+ ['Date'],
+ [ // German-style dates are day-month-year
+ ['11.11.2011'],
+ ['01.11.2011'],
+ ['02.10.2011'],
+ ['03.08.2011'],
+ ['09.11.2011']
+ ],
+ [ // Sorted by ascending date
+ ['03.08.2011'],
+ ['02.10.2011'],
+ ['01.11.2011'],
+ ['09.11.2011'],
+ ['11.11.2011']
+ ],
+ function ( $table ) {
+ mw.config.set( 'wgDefaultDateFormat', 'dmy' );
+ mw.config.set( 'wgContentLanguage', 'de' );
+
+ $table.tablesorter();
+ $table.find( '.headerSort:eq(0)' ).click();
+ }
);
- $table.data( 'tablesorter' ).sort( [] );
- assert.equal(
- $table.find( 'th.headerSortUp' ).length + $table.find( 'th.headerSortDown' ).length,
- 0,
- 'No sort specific sort classes addign to header cells'
+ tableTest(
+ 'Bug 28775: American-style (mdy) short numeric dates',
+ ['Date'],
+ [ // American-style dates are month-day-year
+ ['11.11.2011'],
+ ['01.11.2011'],
+ ['02.10.2011'],
+ ['03.08.2011'],
+ ['09.11.2011']
+ ],
+ [ // Sorted by ascending date
+ ['01.11.2011'],
+ ['02.10.2011'],
+ ['03.08.2011'],
+ ['09.11.2011'],
+ ['11.11.2011']
+ ],
+ function ( $table ) {
+ mw.config.set( 'wgDefaultDateFormat', 'mdy' );
+
+ $table.tablesorter();
+ $table.find( '.headerSort:eq(0)' ).click();
+ }
);
- assert.equal(
- $table.find( 'th' ).first().attr( 'title' ),
- mw.msg( 'sort-ascending' ),
- 'First header cell has default title'
+ var ipv4 = [
+ // Some randomly generated fake IPs
+ ['45.238.27.109'],
+ ['44.172.9.22'],
+ ['247.240.82.209'],
+ ['204.204.132.158'],
+ ['170.38.91.162'],
+ ['197.219.164.9'],
+ ['45.68.154.72'],
+ ['182.195.149.80']
+ ];
+ var ipv4Sorted = [
+ // Sort order should go octet by octet
+ ['44.172.9.22'],
+ ['45.68.154.72'],
+ ['45.238.27.109'],
+ ['170.38.91.162'],
+ ['182.195.149.80'],
+ ['197.219.164.9'],
+ ['204.204.132.158'],
+ ['247.240.82.209']
+ ];
+
+ tableTest(
+ 'Bug 17141: IPv4 address sorting',
+ ['IP'],
+ ipv4,
+ ipv4Sorted,
+ function ( $table ) {
+ $table.tablesorter();
+ $table.find( '.headerSort:eq(0)' ).click();
+ }
);
-
- assert.equal(
- $table.find( 'th' ).first().attr( 'title' ),
- $table.find( 'th' ).last().attr( 'title' ),
- 'Both header cells\' titles match'
+ tableTest(
+ 'Bug 17141: IPv4 address sorting (reverse)',
+ ['IP'],
+ ipv4,
+ reversed(ipv4Sorted),
+ function ( $table ) {
+ $table.tablesorter();
+ $table.find( '.headerSort:eq(0)' ).click().click();
+ }
);
-} );
-
-// Regression tests!
-tableTest(
- 'Bug 28775: German-style (dmy) short numeric dates',
- ['Date'],
- [ // German-style dates are day-month-year
- ['11.11.2011'],
- ['01.11.2011'],
- ['02.10.2011'],
- ['03.08.2011'],
- ['09.11.2011']
- ],
- [ // Sorted by ascending date
- ['03.08.2011'],
- ['02.10.2011'],
- ['01.11.2011'],
- ['09.11.2011'],
- ['11.11.2011']
- ],
- function ( $table ) {
- mw.config.set( 'wgDefaultDateFormat', 'dmy' );
- mw.config.set( 'wgContentLanguage', 'de' );
- $table.tablesorter();
- $table.find( '.headerSort:eq(0)' ).click();
- }
-);
-
-tableTest(
- 'Bug 28775: American-style (mdy) short numeric dates',
- ['Date'],
- [ // American-style dates are month-day-year
- ['11.11.2011'],
- ['01.11.2011'],
- ['02.10.2011'],
- ['03.08.2011'],
- ['09.11.2011']
- ],
- [ // Sorted by ascending date
- ['01.11.2011'],
- ['02.10.2011'],
- ['03.08.2011'],
- ['09.11.2011'],
- ['11.11.2011']
- ],
- function ( $table ) {
- mw.config.set( 'wgDefaultDateFormat', 'mdy' );
-
- $table.tablesorter();
- $table.find( '.headerSort:eq(0)' ).click();
- }
-);
-
-var ipv4 = [
- // Some randomly generated fake IPs
- ['45.238.27.109'],
- ['44.172.9.22'],
- ['247.240.82.209'],
- ['204.204.132.158'],
- ['170.38.91.162'],
- ['197.219.164.9'],
- ['45.68.154.72'],
- ['182.195.149.80']
-];
-var ipv4Sorted = [
- // Sort order should go octet by octet
- ['44.172.9.22'],
- ['45.68.154.72'],
- ['45.238.27.109'],
- ['170.38.91.162'],
- ['182.195.149.80'],
- ['197.219.164.9'],
- ['204.204.132.158'],
- ['247.240.82.209']
-];
-
-tableTest(
- 'Bug 17141: IPv4 address sorting',
- ['IP'],
- ipv4,
- ipv4Sorted,
- function ( $table ) {
- $table.tablesorter();
- $table.find( '.headerSort:eq(0)' ).click();
- }
-);
-tableTest(
- 'Bug 17141: IPv4 address sorting (reverse)',
- ['IP'],
- ipv4,
- reversed(ipv4Sorted),
- function ( $table ) {
- $table.tablesorter();
- $table.find( '.headerSort:eq(0)' ).click().click();
- }
-);
-
-var umlautWords = [
- // Some words with Umlauts
- ['Günther'],
- ['Peter'],
- ['Björn'],
- ['Bjorn'],
- ['Apfel'],
- ['Äpfel'],
- ['Strasse'],
- ['Sträßschen']
-];
-
-var umlautWordsSorted = [
- // Some words with Umlauts
- ['Äpfel'],
- ['Apfel'],
- ['Björn'],
- ['Bjorn'],
- ['Günther'],
- ['Peter'],
- ['Sträßschen'],
- ['Strasse']
-];
-
-tableTest(
- 'Accented Characters with custom collation',
- ['Name'],
- umlautWords,
- umlautWordsSorted,
- function ( $table ) {
- mw.config.set( 'tableSorterCollation', {
- 'ä': 'ae',
- 'ö': 'oe',
- 'ß': 'ss',
- 'ü':'ue'
- } );
-
- $table.tablesorter();
- $table.find( '.headerSort:eq(0)' ).click();
- }
-);
-
-var planetsRowspan = [["Earth","6051.8"], jupiter, ["Mars","6051.8"], mercury, saturn, venus];
-var planetsRowspanII = [jupiter, mercury, saturn, venus, ['Venus', '6371.0'], ['Venus', '3390.0']];
-
-tableTest(
- 'Basic planet table: same value for multiple rows via rowspan',
- header,
- planets,
- planetsRowspan,
- function ( $table ) {
- // Modify the table to have a multiple-row-spanning cell:
- // - Remove 2nd cell of 4th row, and, 2nd cell or 5th row.
- $table.find( 'tr:eq(3) td:eq(1), tr:eq(4) td:eq(1)' ).remove();
- // - Set rowspan for 2nd cell of 3rd row to 3.
- // This covers the removed cell in the 4th and 5th row.
- $table.find( 'tr:eq(2) td:eq(1)' ).prop( 'rowspan', '3' );
-
- $table.tablesorter();
- $table.find( '.headerSort:eq(0)' ).click();
- }
-);
-tableTest(
- 'Basic planet table: same value for multiple rows via rowspan (sorting initially)',
- header,
- planets,
- planetsRowspan,
- function ( $table ) {
- // Modify the table to have a multiple-row-spanning cell:
- // - Remove 2nd cell of 4th row, and, 2nd cell or 5th row.
- $table.find( 'tr:eq(3) td:eq(1), tr:eq(4) td:eq(1)' ).remove();
- // - Set rowspan for 2nd cell of 3rd row to 3.
- // This covers the removed cell in the 4th and 5th row.
- $table.find( 'tr:eq(2) td:eq(1)' ).prop( 'rowspan', '3' );
-
- $table.tablesorter( { sortList: [ { 0: 'asc' } ] } );
- }
-);
-tableTest(
- 'Basic planet table: Same value for multiple rows via rowspan II',
- header,
- planets,
- planetsRowspanII,
- function ( $table ) {
- // Modify the table to have a multiple-row-spanning cell:
- // - Remove 1st cell of 4th row, and, 1st cell or 5th row.
- $table.find( 'tr:eq(3) td:eq(0), tr:eq(4) td:eq(0)' ).remove();
- // - Set rowspan for 1st cell of 3rd row to 3.
- // This covers the removed cell in the 4th and 5th row.
- $table.find( 'tr:eq(2) td:eq(0)' ).prop( 'rowspan', '3' );
-
- $table.tablesorter();
- $table.find( '.headerSort:eq(0)' ).click();
- }
-);
-
-var complexMDYDates = [
- // Some words with Umlauts
- ['January, 19 2010'],
- ['April 21 1991'],
- ['04 22 1991'],
- ['5.12.1990'],
- ['December 12 \'10']
-];
-
-var complexMDYSorted = [
- ['5.12.1990'],
- ['April 21 1991'],
- ['04 22 1991'],
- ['January, 19 2010'],
- ['December 12 \'10']
-];
-
-tableTest(
- 'Complex date parsing I',
- ['date'],
- complexMDYDates,
- complexMDYSorted,
- function ( $table ) {
- mw.config.set( 'wgDefaultDateFormat', 'mdy' );
+ var umlautWords = [
+ // Some words with Umlauts
+ ['Günther'],
+ ['Peter'],
+ ['Björn'],
+ ['Bjorn'],
+ ['Apfel'],
+ ['Äpfel'],
+ ['Strasse'],
+ ['Sträßschen']
+ ];
+
+ var umlautWordsSorted = [
+ // Some words with Umlauts
+ ['Äpfel'],
+ ['Apfel'],
+ ['Björn'],
+ ['Bjorn'],
+ ['Günther'],
+ ['Peter'],
+ ['Sträßschen'],
+ ['Strasse']
+ ];
+
+ tableTest(
+ 'Accented Characters with custom collation',
+ ['Name'],
+ umlautWords,
+ umlautWordsSorted,
+ function ( $table ) {
+ mw.config.set( 'tableSorterCollation', {
+ 'ä': 'ae',
+ 'ö': 'oe',
+ 'ß': 'ss',
+ 'ü':'ue'
+ } );
- $table.tablesorter();
- $table.find( '.headerSort:eq(0)' ).click();
- }
-);
-
-var currencyUnsorted = [
- ['1.02 $'],
- ['$ 3.00'],
- ['€ 2,99'],
- ['$ 1.00'],
- ['$3.50'],
- ['$ 1.50'],
- ['€ 0.99']
-];
-
-var currencySorted = [
- ['€ 0.99'],
- ['$ 1.00'],
- ['1.02 $'],
- ['$ 1.50'],
- ['$ 3.00'],
- ['$3.50'],
- // Comma's sort after dots
- // Not intentional but test to detect changes
- ['€ 2,99']
-];
-
-tableTest(
- 'Currency parsing I',
- ['currency'],
- currencyUnsorted,
- currencySorted,
- function ( $table ) {
- $table.tablesorter();
- $table.find( '.headerSort:eq(0)' ).click();
- }
-);
-
-var ascendingNameLegacy = ascendingName.slice(0);
-ascendingNameLegacy[4] = ascendingNameLegacy[5];
-ascendingNameLegacy.pop();
-
-tableTest(
- 'Legacy compat with .sortbottom',
- header,
- planets,
- ascendingNameLegacy,
- function( $table ) {
- $table.find( 'tr:last' ).addClass( 'sortbottom' );
- $table.tablesorter();
- $table.find( '.headerSort:eq(0)' ).click();
- }
-);
-
-QUnit.test( 'Test detection routine', function ( assert ) {
- var $table;
- $table = $(
- '<table class="sortable">' +
- '<caption>CAPTION</caption>' +
- '<tr><th>THEAD</th></tr>' +
- '<tr><td>1</td></tr>' +
- '<tr class="sortbottom"><td>text</td></tr>' +
- '</table>'
+ $table.tablesorter();
+ $table.find( '.headerSort:eq(0)' ).click();
+ }
);
- $table.tablesorter();
- assert.equal(
- $table.data( 'tablesorter' ).config.parsers[0].id,
- 'number',
- 'Correctly detected column content skipping sortbottom'
+ var planetsRowspan = [ [ 'Earth', '6051.8' ], jupiter, [ 'Mars', '6051.8' ], mercury, saturn, venus ];
+ var planetsRowspanII = [ jupiter, mercury, saturn, venus, [ 'Venus', '6371.0' ], [ 'Venus', '3390.0' ] ];
+
+ tableTest(
+ 'Basic planet table: same value for multiple rows via rowspan',
+ header,
+ planets,
+ planetsRowspan,
+ function ( $table ) {
+ // Modify the table to have a multiple-row-spanning cell:
+ // - Remove 2nd cell of 4th row, and, 2nd cell or 5th row.
+ $table.find( 'tr:eq(3) td:eq(1), tr:eq(4) td:eq(1)' ).remove();
+ // - Set rowspan for 2nd cell of 3rd row to 3.
+ // This covers the removed cell in the 4th and 5th row.
+ $table.find( 'tr:eq(2) td:eq(1)' ).prop( 'rowspan', '3' );
+
+ $table.tablesorter();
+ $table.find( '.headerSort:eq(0)' ).click();
+ }
);
-} );
-
-/** FIXME: the diff output is not very readeable. */
-QUnit.test( 'bug 32047 - caption must be before thead', function ( assert ) {
- var $table;
- $table = $(
- '<table class="sortable">' +
- '<caption>CAPTION</caption>' +
- '<tr><th>THEAD</th></tr>' +
- '<tr><td>A</td></tr>' +
- '<tr><td>B</td></tr>' +
- '<tr class="sortbottom"><td>TFOOT</td></tr>' +
- '</table>'
- );
- $table.tablesorter();
-
- assert.equal(
- $table.children( ).get( 0 ).nodeName,
- 'CAPTION',
- 'First element after <thead> must be <caption> (bug 32047)'
+ tableTest(
+ 'Basic planet table: same value for multiple rows via rowspan (sorting initially)',
+ header,
+ planets,
+ planetsRowspan,
+ function ( $table ) {
+ // Modify the table to have a multiple-row-spanning cell:
+ // - Remove 2nd cell of 4th row, and, 2nd cell or 5th row.
+ $table.find( 'tr:eq(3) td:eq(1), tr:eq(4) td:eq(1)' ).remove();
+ // - Set rowspan for 2nd cell of 3rd row to 3.
+ // This covers the removed cell in the 4th and 5th row.
+ $table.find( 'tr:eq(2) td:eq(1)' ).prop( 'rowspan', '3' );
+
+ $table.tablesorter( { sortList: [ { 0: 'asc' } ] } );
+ }
);
-});
-
-QUnit.test( 'data-sort-value attribute, when available, should override sorting position', function ( assert ) {
- var $table, data;
-
- // Example 1: All cells except one cell without data-sort-value,
- // which should be sorted at it's text content value.
- $table = $(
- '<table class="sortable"><thead><tr><th>Data</th></tr></thead>' +
- '<tbody>' +
- '<tr><td>Cheetah</td></tr>' +
- '<tr><td data-sort-value="Apple">Bird</td></tr>' +
- '<tr><td data-sort-value="Bananna">Ferret</td></tr>' +
- '<tr><td data-sort-value="Drupe">Elephant</td></tr>' +
- '<tr><td data-sort-value="Cherry">Dolphin</td></tr>' +
- '</tbody></table>'
+ tableTest(
+ 'Basic planet table: Same value for multiple rows via rowspan II',
+ header,
+ planets,
+ planetsRowspanII,
+ function ( $table ) {
+ // Modify the table to have a multiple-row-spanning cell:
+ // - Remove 1st cell of 4th row, and, 1st cell or 5th row.
+ $table.find( 'tr:eq(3) td:eq(0), tr:eq(4) td:eq(0)' ).remove();
+ // - Set rowspan for 1st cell of 3rd row to 3.
+ // This covers the removed cell in the 4th and 5th row.
+ $table.find( 'tr:eq(2) td:eq(0)' ).prop( 'rowspan', '3' );
+
+ $table.tablesorter();
+ $table.find( '.headerSort:eq(0)' ).click();
+ }
);
- $table.tablesorter().find( '.headerSort:eq(0)' ).click();
-
- data = [];
- $table.find( 'tbody > tr' ).each( function( i, tr ) {
- $( tr ).find( 'td' ).each( function( i, td ) {
- data.push( {
- data: $( td ).data( 'sortValue' ),
- text: $( td ).text()
- } );
- });
- });
- assert.deepEqual( data, [
- {
- data: 'Apple',
- text: 'Bird'
- }, {
- data: 'Bananna',
- text: 'Ferret'
- }, {
- data: undefined,
- text: 'Cheetah'
- }, {
- data: 'Cherry',
- text: 'Dolphin'
- }, {
- data: 'Drupe',
- text: 'Elephant'
+ var complexMDYDates = [
+ // Some words with Umlauts
+ ['January, 19 2010'],
+ ['April 21 1991'],
+ ['04 22 1991'],
+ ['5.12.1990'],
+ ['December 12 \'10']
+ ];
+
+ var complexMDYSorted = [
+ ['5.12.1990'],
+ ['April 21 1991'],
+ ['04 22 1991'],
+ ['January, 19 2010'],
+ ['December 12 \'10']
+ ];
+
+ tableTest(
+ 'Complex date parsing I',
+ ['date'],
+ complexMDYDates,
+ complexMDYSorted,
+ function ( $table ) {
+ mw.config.set( 'wgDefaultDateFormat', 'mdy' );
+
+ $table.tablesorter();
+ $table.find( '.headerSort:eq(0)' ).click();
}
- ], 'Order matches expected order (based on data-sort-value attribute values)' );
-
- // Example 2
- $table = $(
- '<table class="sortable"><thead><tr><th>Data</th></tr></thead>' +
- '<tbody>' +
- '<tr><td>D</td></tr>' +
- '<tr><td data-sort-value="E">A</td></tr>' +
- '<tr><td>B</td></tr>' +
- '<tr><td>G</td></tr>' +
- '<tr><td data-sort-value="F">C</td></tr>' +
- '</tbody></table>'
);
- $table.tablesorter().find( '.headerSort:eq(0)' ).click();
-
- data = [];
- $table.find( 'tbody > tr' ).each( function ( i, tr ) {
- $( tr ).find( 'td' ).each( function ( i, td ) {
- data.push( {
- data: $( td ).data( 'sortValue' ),
- text: $( td ).text()
- } );
- });
- });
- assert.deepEqual( data, [
- {
- data: undefined,
- text: 'B'
- }, {
- data: undefined,
- text: 'D'
- }, {
- data: 'E',
- text: 'A'
- }, {
- data: 'F',
- text: 'C'
- }, {
- data: undefined,
- text: 'G'
+ var currencyUnsorted = [
+ ['1.02 $'],
+ ['$ 3.00'],
+ ['€ 2,99'],
+ ['$ 1.00'],
+ ['$3.50'],
+ ['$ 1.50'],
+ ['€ 0.99']
+ ];
+
+ var currencySorted = [
+ ['€ 0.99'],
+ ['$ 1.00'],
+ ['1.02 $'],
+ ['$ 1.50'],
+ ['$ 3.00'],
+ ['$3.50'],
+ // Comma's sort after dots
+ // Not intentional but test to detect changes
+ ['€ 2,99']
+ ];
+
+ tableTest(
+ 'Currency parsing I',
+ ['currency'],
+ currencyUnsorted,
+ currencySorted,
+ function ( $table ) {
+ $table.tablesorter();
+ $table.find( '.headerSort:eq(0)' ).click();
}
- ], 'Order matches expected order (based on data-sort-value attribute values)' );
-
- // Example 3: Test that live changes are used from data-sort-value,
- // even if they change after the tablesorter is constructed (bug 38152).
- $table = $(
- '<table class="sortable"><thead><tr><th>Data</th></tr></thead>' +
- '<tbody>' +
- '<tr><td>D</td></tr>' +
- '<tr><td data-sort-value="1">A</td></tr>' +
- '<tr><td>B</td></tr>' +
- '<tr><td data-sort-value="2">G</td></tr>' +
- '<tr><td>C</td></tr>' +
- '</tbody></table>'
);
- // initialize table sorter and sort once
- $table
- .tablesorter()
- .find( '.headerSort:eq(0)' ).click();
-
- // Change the sortValue data properties (bug 38152)
- // - change data
- $table.find( 'td:contains(A)' ).data( 'sortValue', 3 );
- // - add data
- $table.find( 'td:contains(B)' ).data( 'sortValue', 1 );
- // - remove data, bring back attribute: 2
- $table.find( 'td:contains(G)' ).removeData( 'sortValue' );
-
- // Now sort again (twice, so it is back at Ascending)
- $table.find( '.headerSort:eq(0)' ).click();
- $table.find( '.headerSort:eq(0)' ).click();
-
- data = [];
- $table.find( 'tbody > tr' ).each( function( i, tr ) {
- $( tr ).find( 'td' ).each( function( i, td ) {
- data.push( {
- data: $( td ).data( 'sortValue' ),
- text: $( td ).text()
- } );
- });
- });
- assert.deepEqual( data, [
- {
- data: 1,
- text: "B"
- }, {
- data: 2,
- text: "G"
- }, {
- data: 3,
- text: "A"
- }, {
- data: undefined,
- text: "C"
- }, {
- data: undefined,
- text: "D"
+ var ascendingNameLegacy = ascendingName.slice(0);
+ ascendingNameLegacy[4] = ascendingNameLegacy[5];
+ ascendingNameLegacy.pop();
+
+ tableTest(
+ 'Legacy compat with .sortbottom',
+ header,
+ planets,
+ ascendingNameLegacy,
+ function( $table ) {
+ $table.find( 'tr:last' ).addClass( 'sortbottom' );
+ $table.tablesorter();
+ $table.find( '.headerSort:eq(0)' ).click();
}
- ], 'Order matches expected order, using the current sortValue in $.data()' );
-
-});
-
-var numbers = [
- [ '12' ],
- [ '7' ],
- [ '13,000'],
- [ '9' ],
- [ '14' ],
- [ '8.0' ]
-];
-var numbersAsc = [
- [ '7' ],
- [ '8.0' ],
- [ '9' ],
- [ '12' ],
- [ '14' ],
- [ '13,000']
-];
-
-tableTest( 'bug 8115: sort numbers with commas (ascending)',
- ['Numbers'], numbers, numbersAsc,
- function( $table ) {
+ );
+
+ QUnit.test( 'Test detection routine', function ( assert ) {
+ var $table;
+ $table = $(
+ '<table class="sortable">' +
+ '<caption>CAPTION</caption>' +
+ '<tr><th>THEAD</th></tr>' +
+ '<tr><td>1</td></tr>' +
+ '<tr class="sortbottom"><td>text</td></tr>' +
+ '</table>'
+ );
$table.tablesorter();
- $table.find( '.headerSort:eq(0)' ).click();
- }
-);
-tableTest( 'bug 8115: sort numbers with commas (descending)',
- ['Numbers'], numbers, reversed(numbersAsc),
- function( $table ) {
+ assert.equal(
+ $table.data( 'tablesorter' ).config.parsers[0].id,
+ 'number',
+ 'Correctly detected column content skipping sortbottom'
+ );
+ } );
+
+ /** FIXME: the diff output is not very readeable. */
+ QUnit.test( 'bug 32047 - caption must be before thead', function ( assert ) {
+ var $table;
+ $table = $(
+ '<table class="sortable">' +
+ '<caption>CAPTION</caption>' +
+ '<tr><th>THEAD</th></tr>' +
+ '<tr><td>A</td></tr>' +
+ '<tr><td>B</td></tr>' +
+ '<tr class="sortbottom"><td>TFOOT</td></tr>' +
+ '</table>'
+ );
$table.tablesorter();
- $table.find( '.headerSort:eq(0)' ).click().click();
- }
-);
-// TODO add numbers sorting tests for bug 8115 with a different language
-
-QUnit.test( 'bug 32888 - Tables inside a tableheader cell', 2, function ( assert ) {
- var $table;
- $table = $(
- '<table class="sortable" id="mw-bug-32888">' +
- '<tr><th>header<table id="mw-bug-32888-2">'+
- '<tr><th>1</th><th>2</th></tr>' +
- '</table></th></tr>' +
- '<tr><td>A</td></tr>' +
- '<tr><td>B</td></tr>' +
- '</table>'
+
+ assert.equal(
+ $table.children( ).get( 0 ).nodeName,
+ 'CAPTION',
+ 'First element after <thead> must be <caption> (bug 32047)'
);
- $table.tablesorter();
+ });
- assert.equal(
- $table.find('> thead:eq(0) > tr > th.headerSort').length,
- 1,
- 'Child tables inside a headercell should not interfere with sortable headers (bug 32888)'
- );
- assert.equal(
- $( '#mw-bug-32888-2' ).find('th.headerSort').length,
- 0,
- 'The headers of child tables inside a headercell should not be sortable themselves (bug 32888)'
- );
-});
+ QUnit.test( 'data-sort-value attribute, when available, should override sorting position', function ( assert ) {
+ var $table, data;
+
+ // Example 1: All cells except one cell without data-sort-value,
+ // which should be sorted at it's text content value.
+ $table = $(
+ '<table class="sortable"><thead><tr><th>Data</th></tr></thead>' +
+ '<tbody>' +
+ '<tr><td>Cheetah</td></tr>' +
+ '<tr><td data-sort-value="Apple">Bird</td></tr>' +
+ '<tr><td data-sort-value="Bananna">Ferret</td></tr>' +
+ '<tr><td data-sort-value="Drupe">Elephant</td></tr>' +
+ '<tr><td data-sort-value="Cherry">Dolphin</td></tr>' +
+ '</tbody></table>'
+ );
+ $table.tablesorter().find( '.headerSort:eq(0)' ).click();
+
+ data = [];
+ $table.find( 'tbody > tr' ).each( function( i, tr ) {
+ $( tr ).find( 'td' ).each( function( i, td ) {
+ data.push( {
+ data: $( td ).data( 'sortValue' ),
+ text: $( td ).text()
+ } );
+ });
+ });
+ assert.deepEqual( data, [
+ {
+ data: 'Apple',
+ text: 'Bird'
+ }, {
+ data: 'Bananna',
+ text: 'Ferret'
+ }, {
+ data: undefined,
+ text: 'Cheetah'
+ }, {
+ data: 'Cherry',
+ text: 'Dolphin'
+ }, {
+ data: 'Drupe',
+ text: 'Elephant'
+ }
+ ], 'Order matches expected order (based on data-sort-value attribute values)' );
+
+ // Example 2
+ $table = $(
+ '<table class="sortable"><thead><tr><th>Data</th></tr></thead>' +
+ '<tbody>' +
+ '<tr><td>D</td></tr>' +
+ '<tr><td data-sort-value="E">A</td></tr>' +
+ '<tr><td>B</td></tr>' +
+ '<tr><td>G</td></tr>' +
+ '<tr><td data-sort-value="F">C</td></tr>' +
+ '</tbody></table>'
+ );
+ $table.tablesorter().find( '.headerSort:eq(0)' ).click();
+
+ data = [];
+ $table.find( 'tbody > tr' ).each( function ( i, tr ) {
+ $( tr ).find( 'td' ).each( function ( i, td ) {
+ data.push( {
+ data: $( td ).data( 'sortValue' ),
+ text: $( td ).text()
+ } );
+ });
+ });
-var correctDateSorting1 = [
- ['01 January 2010'],
- ['05 February 2010'],
- ['16 January 2010']
-];
+ assert.deepEqual( data, [
+ {
+ data: undefined,
+ text: 'B'
+ }, {
+ data: undefined,
+ text: 'D'
+ }, {
+ data: 'E',
+ text: 'A'
+ }, {
+ data: 'F',
+ text: 'C'
+ }, {
+ data: undefined,
+ text: 'G'
+ }
+ ], 'Order matches expected order (based on data-sort-value attribute values)' );
+
+ // Example 3: Test that live changes are used from data-sort-value,
+ // even if they change after the tablesorter is constructed (bug 38152).
+ $table = $(
+ '<table class="sortable"><thead><tr><th>Data</th></tr></thead>' +
+ '<tbody>' +
+ '<tr><td>D</td></tr>' +
+ '<tr><td data-sort-value="1">A</td></tr>' +
+ '<tr><td>B</td></tr>' +
+ '<tr><td data-sort-value="2">G</td></tr>' +
+ '<tr><td>C</td></tr>' +
+ '</tbody></table>'
+ );
+ // initialize table sorter and sort once
+ $table
+ .tablesorter()
+ .find( '.headerSort:eq(0)' ).click();
+
+ // Change the sortValue data properties (bug 38152)
+ // - change data
+ $table.find( 'td:contains(A)' ).data( 'sortValue', 3 );
+ // - add data
+ $table.find( 'td:contains(B)' ).data( 'sortValue', 1 );
+ // - remove data, bring back attribute: 2
+ $table.find( 'td:contains(G)' ).removeData( 'sortValue' );
+
+ // Now sort again (twice, so it is back at Ascending)
+ $table.find( '.headerSort:eq(0)' ).click();
+ $table.find( '.headerSort:eq(0)' ).click();
-var correctDateSortingSorted1 = [
- ['01 January 2010'],
- ['16 January 2010'],
- ['05 February 2010']
-];
+ data = [];
+ $table.find( 'tbody > tr' ).each( function( i, tr ) {
+ $( tr ).find( 'td' ).each( function( i, td ) {
+ data.push( {
+ data: $( td ).data( 'sortValue' ),
+ text: $( td ).text()
+ } );
+ });
+ });
-tableTest(
- 'Correct date sorting I',
- ['date'],
- correctDateSorting1,
- correctDateSortingSorted1,
- function ( $table ) {
- mw.config.set( 'wgDefaultDateFormat', 'mdy' );
+ assert.deepEqual( data, [
+ {
+ data: 1,
+ text: 'B'
+ }, {
+ data: 2,
+ text: 'G'
+ }, {
+ data: 3,
+ text: 'A'
+ }, {
+ data: undefined,
+ text: 'C'
+ }, {
+ data: undefined,
+ text: 'D'
+ }
+ ], 'Order matches expected order, using the current sortValue in $.data()' );
- $table.tablesorter();
- $table.find( '.headerSort:eq(0)' ).click();
- }
-);
-
-var correctDateSorting2 = [
- ['January 01 2010'],
- ['February 05 2010'],
- ['January 16 2010']
-];
-
-var correctDateSortingSorted2 = [
- ['January 01 2010'],
- ['January 16 2010'],
- ['February 05 2010']
-];
-
-tableTest(
- 'Correct date sorting II',
- ['date'],
- correctDateSorting2,
- correctDateSortingSorted2,
- function ( $table ) {
- mw.config.set( 'wgDefaultDateFormat', 'dmy' );
+ });
+ var numbers = [
+ [ '12' ],
+ [ '7' ],
+ [ '13,000'],
+ [ '9' ],
+ [ '14' ],
+ [ '8.0' ]
+ ];
+ var numbersAsc = [
+ [ '7' ],
+ [ '8.0' ],
+ [ '9' ],
+ [ '12' ],
+ [ '14' ],
+ [ '13,000']
+ ];
+
+ tableTest( 'bug 8115: sort numbers with commas (ascending)',
+ ['Numbers'], numbers, numbersAsc,
+ function( $table ) {
+ $table.tablesorter();
+ $table.find( '.headerSort:eq(0)' ).click();
+ }
+ );
+
+ tableTest( 'bug 8115: sort numbers with commas (descending)',
+ ['Numbers'], numbers, reversed(numbersAsc),
+ function( $table ) {
+ $table.tablesorter();
+ $table.find( '.headerSort:eq(0)' ).click().click();
+ }
+ );
+ // TODO add numbers sorting tests for bug 8115 with a different language
+
+ QUnit.test( 'bug 32888 - Tables inside a tableheader cell', 2, function ( assert ) {
+ var $table;
+ $table = $(
+ '<table class="sortable" id="mw-bug-32888">' +
+ '<tr><th>header<table id="mw-bug-32888-2">'+
+ '<tr><th>1</th><th>2</th></tr>' +
+ '</table></th></tr>' +
+ '<tr><td>A</td></tr>' +
+ '<tr><td>B</td></tr>' +
+ '</table>'
+ );
$table.tablesorter();
- $table.find( '.headerSort:eq(0)' ).click();
- }
-);
+
+ assert.equal(
+ $table.find('> thead:eq(0) > tr > th.headerSort').length,
+ 1,
+ 'Child tables inside a headercell should not interfere with sortable headers (bug 32888)'
+ );
+ assert.equal(
+ $( '#mw-bug-32888-2' ).find('th.headerSort').length,
+ 0,
+ 'The headers of child tables inside a headercell should not be sortable themselves (bug 32888)'
+ );
+ });
+
+
+ var correctDateSorting1 = [
+ ['01 January 2010'],
+ ['05 February 2010'],
+ ['16 January 2010']
+ ];
+
+ var correctDateSortingSorted1 = [
+ ['01 January 2010'],
+ ['16 January 2010'],
+ ['05 February 2010']
+ ];
+
+ tableTest(
+ 'Correct date sorting I',
+ ['date'],
+ correctDateSorting1,
+ correctDateSortingSorted1,
+ function ( $table ) {
+ mw.config.set( 'wgDefaultDateFormat', 'mdy' );
+
+ $table.tablesorter();
+ $table.find( '.headerSort:eq(0)' ).click();
+ }
+ );
+
+ var correctDateSorting2 = [
+ ['January 01 2010'],
+ ['February 05 2010'],
+ ['January 16 2010']
+ ];
+
+ var correctDateSortingSorted2 = [
+ ['January 01 2010'],
+ ['January 16 2010'],
+ ['February 05 2010']
+ ];
+
+ tableTest(
+ 'Correct date sorting II',
+ ['date'],
+ correctDateSorting2,
+ correctDateSortingSorted2,
+ function ( $table ) {
+ mw.config.set( 'wgDefaultDateFormat', 'dmy' );
+
+ $table.tablesorter();
+ $table.find( '.headerSort:eq(0)' ).click();
+ }
+ );
}( jQuery, mediaWiki ) );
-QUnit.module( 'jquery.textSelection', QUnit.newMwEnvironment() );
-
-/**
- * Test factory for $.fn.textSelection( 'encapsulateText' )
- *
- * @param options {object} associative array containing:
- * description {string}
- * input {string}
- * output {string}
- * start {int} starting char for selection
- * end {int} ending char for selection
- * params {object} add'l parameters for $().textSelection( 'encapsulateText' )
- */
-function encapsulateTest( options ) {
- var opt = $.extend({
- description: '',
- before: {},
- after: {},
- replace: {}
- }, options);
-
- opt.before = $.extend({
- text: '',
- start: 0,
- end: 0
- }, opt.before);
- opt.after = $.extend({
- text: '',
- selected: null
- }, opt.after);
-
- QUnit.test( opt.description, function ( assert ) {
- var tests = 1;
- if ( opt.after.selected !== null ) {
- tests++;
- }
- QUnit.expect( tests );
-
- var $textarea = $( '<textarea>' );
-
- $( '#qunit-fixture' ).append( $textarea );
-
- //$textarea.textSelection( 'setContents', opt.before.text); // this method is actually missing atm...
- $textarea.val( opt.before.text ); // won't work with the WikiEditor iframe?
-
- var start = opt.before.start,
- end = opt.before.end;
- if ( window.opera ) {
- // Compensate for Opera's craziness converting "\n" to "\r\n" and counting that as two chars
- var newLinesBefore = opt.before.text.substring( 0, start ).split( "\n" ).length - 1,
- newLinesInside = opt.before.text.substring( start, end ).split( "\n" ).length - 1;
- start += newLinesBefore;
- end += newLinesBefore + newLinesInside;
- }
-
- var options = $.extend( {}, opt.replace ); // Clone opt.replace
- options.selectionStart = start;
- options.selectionEnd = end;
- $textarea.textSelection( 'encapsulateSelection', options );
-
- var text = $textarea.textSelection( 'getContents' ).replace( /\r\n/g, "\n" );
-
- assert.equal( text, opt.after.text, 'Checking full text after encapsulation' );
-
- if (opt.after.selected !== null) {
- var selected = $textarea.textSelection( 'getSelection' );
- assert.equal( selected, opt.after.selected, 'Checking selected text after encapsulation.' );
- }
-
- } );
-}
-
-var sig = {
- 'pre': "--~~~~"
-}, bold = {
- pre: "'''",
- peri: 'Bold text',
- post: "'''"
-}, h2 = {
- 'pre': '== ',
- 'peri': 'Heading 2',
- 'post': ' ==',
- 'regex': /^(\s*)(={1,6})(.*?)\2(\s*)$/,
- 'regexReplace': "$1==$3==$4",
- 'ownline': true
-}, ulist = {
- 'pre': "* ",
- 'peri': 'Bulleted list item',
- 'post': "",
- 'ownline': true,
- 'splitlines': true
-};
-
-encapsulateTest({
- description: "Adding sig to end of text",
- before: {
- text: "Wikilove dude! ",
- start: 15,
- end: 15
- },
- after: {
- text: "Wikilove dude! --~~~~",
- selected: ""
- },
- replace: sig
-});
-
-encapsulateTest({
- description: "Adding bold to empty",
- before: {
- text: "",
- start: 0,
- end: 0
- },
- after: {
- text: "'''Bold text'''",
- selected: "Bold text" // selected because it's the default
- },
- replace: bold
-});
-
-encapsulateTest({
- description: "Adding bold to existing text",
- before: {
- text: "Now is the time for all good men to come to the aid of their country",
- start: 20,
- end: 32
- },
- after: {
- text: "Now is the time for '''all good men''' to come to the aid of their country",
- selected: "" // empty because it's not the default'
- },
- replace: bold
-});
-
-encapsulateTest({
- description: "ownline option: adding new h2",
- before: {
- text:"Before\nAfter",
- start: 7,
- end: 7
- },
- after: {
- text: "Before\n== Heading 2 ==\nAfter",
- selected: "Heading 2"
- },
- replace: h2
-});
-
-encapsulateTest({
- description: "ownline option: turn a whole line into new h2",
- before: {
- text:"Before\nMy heading\nAfter",
- start: 7,
- end: 17
- },
- after: {
- text: "Before\n== My heading ==\nAfter",
- selected: ""
- },
- replace: h2
-});
-
-
-encapsulateTest({
- description: "ownline option: turn a partial line into new h2",
- before: {
- text:"BeforeMy headingAfter",
- start: 6,
- end: 16
- },
- after: {
- text: "Before\n== My heading ==\nAfter",
- selected: ""
- },
- replace: h2
-});
-
-
-encapsulateTest({
- description: "splitlines option: no selection, insert new list item",
- before: {
- text: "Before\nAfter",
- start: 7,
- end: 7
- },
- after: {
- text: "Before\n* Bulleted list item\nAfter"
- },
- replace: ulist
-});
-
-encapsulateTest({
- description: "splitlines option: single partial line selection, insert new list item",
- before: {
- text: "BeforeMy List ItemAfter",
- start: 6,
- end: 18
- },
- after: {
- text: "Before\n* My List Item\nAfter"
- },
- replace: ulist
-});
-
-encapsulateTest({
- description: "splitlines option: multiple lines",
- before: {
- text: "Before\nFirst\nSecond\nThird\nAfter",
- start: 7,
- end: 25
- },
- after: {
- text: "Before\n* First\n* Second\n* Third\nAfter"
- },
- replace: ulist
-});
-
-
-function caretTest( options ) {
- QUnit.test( options.description, 2, function ( assert ) {
- var $textarea = $( '<textarea>' ).text( options.text );
-
- $( '#qunit-fixture' ).append( $textarea );
-
- if ( options.mode === 'set' ) {
- $textarea.textSelection('setSelection', {
- start: options.start,
- end: options.end
- });
- }
-
- function among( actual, expected, message ) {
- if ( $.isArray( expected ) ) {
- assert.ok( $.inArray( actual, expected ) !== -1 , message + ' (got ' + actual + '; expected one of ' + expected.join(', ') + ')' );
- } else {
- assert.equal( actual, expected, message );
+( function ( $ ) {
+
+ QUnit.module( 'jquery.textSelection', QUnit.newMwEnvironment() );
+
+ /**
+ * Test factory for $.fn.textSelection( 'encapsulateText' )
+ *
+ * @param options {object} associative array containing:
+ * description {string}
+ * input {string}
+ * output {string}
+ * start {int} starting char for selection
+ * end {int} ending char for selection
+ * params {object} add'l parameters for $().textSelection( 'encapsulateText' )
+ */
+ function encapsulateTest( options ) {
+ var opt = $.extend({
+ description: '',
+ before: {},
+ after: {},
+ replace: {}
+ }, options);
+
+ opt.before = $.extend({
+ text: '',
+ start: 0,
+ end: 0
+ }, opt.before);
+ opt.after = $.extend({
+ text: '',
+ selected: null
+ }, opt.after);
+
+ QUnit.test( opt.description, function ( assert ) {
+ /*jshint onevar: false */
+ var tests = 1;
+ if ( opt.after.selected !== null ) {
+ tests++;
+ }
+ QUnit.expect( tests );
+
+ var $textarea = $( '<textarea>' );
+
+ $( '#qunit-fixture' ).append( $textarea );
+
+ //$textarea.textSelection( 'setContents', opt.before.text); // this method is actually missing atm...
+ $textarea.val( opt.before.text ); // won't work with the WikiEditor iframe?
+
+ var start = opt.before.start,
+ end = opt.before.end;
+ if ( window.opera ) {
+ // Compensate for Opera's craziness converting \n to \r\n and counting that as two chars
+ var newLinesBefore = opt.before.text.substring( 0, start ).split( '\n' ).length - 1,
+ newLinesInside = opt.before.text.substring( start, end ).split( '\n' ).length - 1;
+ start += newLinesBefore;
+ end += newLinesBefore + newLinesInside;
+ }
+
+ var options = $.extend( {}, opt.replace ); // Clone opt.replace
+ options.selectionStart = start;
+ options.selectionEnd = end;
+ $textarea.textSelection( 'encapsulateSelection', options );
+
+ var text = $textarea.textSelection( 'getContents' ).replace( /\r\n/g, '\n' );
+
+ assert.equal( text, opt.after.text, 'Checking full text after encapsulation' );
+
+ if ( opt.after.selected !== null ) {
+ var selected = $textarea.textSelection( 'getSelection' );
+ assert.equal( selected, opt.after.selected, 'Checking selected text after encapsulation.' );
+ }
+
+ } );
+ }
+
+ var caretSample,
+ sig = {
+ pre: '--~~~~'
+ },
+ bold = {
+ pre: '\'\'\'',
+ peri: 'Bold text',
+ post: '\'\'\''
+ },
+ h2 = {
+ pre: '== ',
+ peri: 'Heading 2',
+ post: ' ==',
+ regex: /^(\s*)(={1,6})(.*?)\2(\s*)$/,
+ regexReplace: '$1==$3==$4',
+ ownline: true
+ },
+ ulist = {
+ pre: '* ',
+ peri: 'Bulleted list item',
+ post: '',
+ ownline: true,
+ splitlines: true
+ };
+
+ encapsulateTest({
+ description: 'Adding sig to end of text',
+ before: {
+ text: 'Wikilove dude! ',
+ start: 15,
+ end: 15
+ },
+ after: {
+ text: 'Wikilove dude! --~~~~',
+ selected: ''
+ },
+ replace: sig
+ });
+
+ encapsulateTest({
+ description: 'Adding bold to empty',
+ before: {
+ text: '',
+ start: 0,
+ end: 0
+ },
+ after: {
+ text: '\'\'\'Bold text\'\'\'',
+ selected: 'Bold text' // selected because it's the default
+ },
+ replace: bold
+ });
+
+ encapsulateTest({
+ description: 'Adding bold to existing text',
+ before: {
+ text: 'Now is the time for all good men to come to the aid of their country',
+ start: 20,
+ end: 32
+ },
+ after: {
+ text: 'Now is the time for \'\'\'all good men\'\'\' to come to the aid of their country',
+ selected: '' // empty because it's not the default'
+ },
+ replace: bold
+ });
+
+ encapsulateTest({
+ description: 'ownline option: adding new h2',
+ before: {
+ text:'Before\nAfter',
+ start: 7,
+ end: 7
+ },
+ after: {
+ text: 'Before\n== Heading 2 ==\nAfter',
+ selected: 'Heading 2'
+ },
+ replace: h2
+ });
+
+ encapsulateTest({
+ description: 'ownline option: turn a whole line into new h2',
+ before: {
+ text:'Before\nMy heading\nAfter',
+ start: 7,
+ end: 17
+ },
+ after: {
+ text: 'Before\n== My heading ==\nAfter',
+ selected: ''
+ },
+ replace: h2
+ });
+
+
+ encapsulateTest({
+ description: 'ownline option: turn a partial line into new h2',
+ before: {
+ text:'BeforeMy headingAfter',
+ start: 6,
+ end: 16
+ },
+ after: {
+ text: 'Before\n== My heading ==\nAfter',
+ selected: ''
+ },
+ replace: h2
+ });
+
+
+ encapsulateTest({
+ description: 'splitlines option: no selection, insert new list item',
+ before: {
+ text: 'Before\nAfter',
+ start: 7,
+ end: 7
+ },
+ after: {
+ text: 'Before\n* Bulleted list item\nAfter'
+ },
+ replace: ulist
+ });
+
+ encapsulateTest({
+ description: 'splitlines option: single partial line selection, insert new list item',
+ before: {
+ text: 'BeforeMy List ItemAfter',
+ start: 6,
+ end: 18
+ },
+ after: {
+ text: 'Before\n* My List Item\nAfter'
+ },
+ replace: ulist
+ });
+
+ encapsulateTest({
+ description: 'splitlines option: multiple lines',
+ before: {
+ text: 'Before\nFirst\nSecond\nThird\nAfter',
+ start: 7,
+ end: 25
+ },
+ after: {
+ text: 'Before\n* First\n* Second\n* Third\nAfter'
+ },
+ replace: ulist
+ });
+
+
+ function caretTest( options ) {
+ QUnit.test( options.description, 2, function ( assert ) {
+ var pos, $textarea = $( '<textarea>' ).text( options.text );
+
+ $( '#qunit-fixture' ).append( $textarea );
+
+ if ( options.mode === 'set' ) {
+ $textarea.textSelection('setSelection', {
+ start: options.start,
+ end: options.end
+ });
+ }
+
+ function among( actual, expected, message ) {
+ if ( $.isArray( expected ) ) {
+ assert.ok( $.inArray( actual, expected ) !== -1 , message + ' (got ' + actual + '; expected one of ' + expected.join(', ') + ')' );
+ } else {
+ assert.equal( actual, expected, message );
+ }
}
- }
- var pos = $textarea.textSelection('getCaretPosition', {startAndEnd: true});
- among(pos[0], options.start, 'Caret start should be where we set it.');
- among(pos[1], options.end, 'Caret end should be where we set it.');
+ pos = $textarea.textSelection( 'getCaretPosition', { startAndEnd: true });
+ among(pos[0], options.start, 'Caret start should be where we set it.');
+ among(pos[1], options.end, 'Caret end should be where we set it.');
+ });
+ }
+
+ caretSample = 'Some big text that we like to work with. Nothing fancy... you know what I mean?';
+
+ /*
+ // @broken: Disabled per bug 34820
+ caretTest({
+ description: 'getCaretPosition with original/empty selection - bug 31847 with IE 6/7/8',
+ text: caretSample,
+ start: [0, caretSample.length], // Opera and Firefox (prior to FF 6.0) default caret to the end of the box (caretSample.length)
+ end: [0, caretSample.length], // Other browsers default it to the beginning (0), so check both.
+ mode: 'get'
+ });
+ */
+
+ caretTest({
+ description: 'set/getCaretPosition with forced empty selection',
+ text: caretSample,
+ start: 7,
+ end: 7,
+ mode: 'set'
});
-}
-
-var caretSample = "Some big text that we like to work with. Nothing fancy... you know what I mean?";
-
-/*
- // @broken: Disabled per bug 34820
-caretTest({
- description: 'getCaretPosition with original/empty selection - bug 31847 with IE 6/7/8',
- text: caretSample,
- start: [0, caretSample.length], // Opera and Firefox (prior to FF 6.0) default caret to the end of the box (caretSample.length)
- end: [0, caretSample.length], // Other browsers default it to the beginning (0), so check both.
- mode: 'get'
-});
-*/
-
-caretTest({
- description: 'set/getCaretPosition with forced empty selection',
- text: caretSample,
- start: 7,
- end: 7,
- mode: 'set'
-});
-
-caretTest({
- description: 'set/getCaretPosition with small selection',
- text: caretSample,
- start: 6,
- end: 11,
- mode: 'set'
-});
+ caretTest({
+ description: 'set/getCaretPosition with small selection',
+ text: caretSample,
+ start: 6,
+ end: 11,
+ mode: 'set'
+ });
+}( jQuery ) );
-QUnit.module( 'mediawiki.api.parse', QUnit.newMwEnvironment() );
+( function ( mw, $ ) {
+ QUnit.module( 'mediawiki.api.parse', QUnit.newMwEnvironment() );
-QUnit.asyncTest( 'Hello world', function ( assert ) {
- var api;
- QUnit.expect( 6 );
+ QUnit.asyncTest( 'Hello world', function ( assert ) {
+ var api;
+ QUnit.expect( 6 );
- api = new mw.Api();
+ api = new mw.Api();
- api.parse( "'''Hello world'''" )
- .done( function ( html ) {
- // Parse into a document fragment instead of comparing HTML, due to
- // presence of Tidy influencing whitespace.
- // Html also contains "NewPP report" comment.
- var $res = $( '<div>' ).html( html ).children(),
- res = $res.get( 0 );
- assert.equal( $res.length, 1, 'Response contains 1 element' );
- assert.equal( res.nodeName.toLowerCase(), 'p', 'Response is a paragraph' );
- assert.equal( $res.children().length, 1, 'Response has 1 child element' );
- assert.equal( $res.children().get( 0 ).nodeName.toLowerCase(), 'b', 'Child element is a bold tag' );
- // Trim since Tidy may or may not mess with the spacing here
- assert.equal( $.trim( $res.text() ), 'Hello world', 'Response contains given text' );
- assert.equal( $res.find( 'b' ).text(), 'Hello world', 'Bold tag wraps the entire, same, text' );
+ api.parse( '\'\'\'Hello world\'\'\'' )
+ .done( function ( html ) {
+ // Parse into a document fragment instead of comparing HTML, due to
+ // presence of Tidy influencing whitespace.
+ // Html also contains "NewPP report" comment.
+ var $res = $( '<div>' ).html( html ).children(),
+ res = $res.get( 0 );
+ assert.equal( $res.length, 1, 'Response contains 1 element' );
+ assert.equal( res.nodeName.toLowerCase(), 'p', 'Response is a paragraph' );
+ assert.equal( $res.children().length, 1, 'Response has 1 child element' );
+ assert.equal( $res.children().get( 0 ).nodeName.toLowerCase(), 'b', 'Child element is a bold tag' );
+ // Trim since Tidy may or may not mess with the spacing here
+ assert.equal( $.trim( $res.text() ), 'Hello world', 'Response contains given text' );
+ assert.equal( $res.find( 'b' ).text(), 'Hello world', 'Bold tag wraps the entire, same, text' );
- QUnit.start();
- });
-});
+ QUnit.start();
+ });
+ });
+}( mediaWiki, jQuery ) );
-QUnit.module( 'mediawiki.api', QUnit.newMwEnvironment() );
+( function ( mw ) {
+ QUnit.module( 'mediawiki.api', QUnit.newMwEnvironment() );
+
+ QUnit.asyncTest( 'Basic functionality', function ( assert ) {
+ var api, d1, d2, d3;
+ QUnit.expect( 3 );
+
+ api = new mw.Api();
+
+ d1 = api.get( {} )
+ .done( function ( data ) {
+ assert.deepEqual( data, [], 'If request succeeds without errors, resolve deferred' );
+ });
+
+ d2 = api.get({
+ action: 'doesntexist'
+ })
+ .fail( function ( errorCode ) {
+ assert.equal( errorCode, 'unknown_action', 'API error (e.g. "unknown_action") should reject the deferred' );
+ });
+
+ d3 = api.post( {} )
+ .done( function ( data ) {
+ assert.deepEqual( data, [], 'Simple POST request' );
+ });
+
+ // After all are completed, continue the test suite.
+ QUnit.whenPromisesComplete( d1, d2, d3 ).always( function () {
+ QUnit.start();
+ });
+ });
-QUnit.asyncTest( 'Basic functionality', function ( assert ) {
- var api, d1, d2, d3;
- QUnit.expect( 3 );
+ QUnit.asyncTest( 'Deprecated callback methods', function ( assert ) {
+ var api, d1, d2, d3;
+ QUnit.expect( 3 );
- api = new mw.Api();
+ api = new mw.Api();
- d1 = api.get( {} )
- .done( function ( data ) {
- assert.deepEqual( data, [], 'If request succeeds without errors, resolve deferred' );
+ d1 = api.get( {}, function () {
+ assert.ok( true, 'Function argument treated as success callback.' );
});
- d2 = api.get({
- action: 'doesntexist'
- })
- .fail( function ( errorCode, details ) {
- assert.equal( errorCode, 'unknown_action', 'API error (e.g. "unknown_action") should reject the deferred' );
+ d2 = api.get( {}, {
+ ok: function () {
+ assert.ok( true, '"ok" property treated as success callback.' );
+ }
});
- d3 = api.post( {} )
- .done( function ( data ) {
- assert.deepEqual( data, [], 'Simple POST request' );
+ d3 = api.get({
+ action: 'doesntexist'
+ }, {
+ err: function () {
+ assert.ok( true, '"err" property treated as error callback.' );
+ }
});
- // After all are completed, continue the test suite.
- QUnit.whenPromisesComplete( d1, d2, d3 ).always( function () {
- QUnit.start();
- });
-});
-
-QUnit.asyncTest( 'Deprecated callback methods', function ( assert ) {
- var api, d1, d2, d3;
- QUnit.expect( 3 );
-
- api = new mw.Api();
-
- d1 = api.get( {}, function () {
- assert.ok( true, 'Function argument treated as success callback.' );
- });
-
- d2 = api.get( {}, {
- ok: function ( data ) {
- assert.ok( true, '"ok" property treated as success callback.' );
- }
- });
-
- d3 = api.get({
- action: 'doesntexist'
- }, {
- err: function ( data ) {
- assert.ok( true, '"err" property treated as error callback.' );
- }
- });
-
- QUnit.whenPromisesComplete( d1, d2, d3 ).always( function () {
- QUnit.start();
+ QUnit.whenPromisesComplete( d1, d2, d3 ).always( function () {
+ QUnit.start();
+ });
});
-});
+}( mediaWiki ) );
-QUnit.module( 'mediawiki.special.recentchanges', QUnit.newMwEnvironment() );
-
-// TODO: verify checkboxes == [ 'nsassociated', 'nsinvert' ]
-
-QUnit.test( '"all" namespace disable checkboxes', function ( assert ) {
-
- // from Special:Recentchanges
- var select =
- '<select id="namespace" name="namespace" class="namespaceselector">'
- + '<option value="" selected="selected">all</option>'
- + '<option value="0">(Main)</option>'
- + '<option value="1">Talk</option>'
- + '<option value="2">User</option>'
- + '<option value="3">User talk</option>'
- + '<option value="4">ProjectName</option>'
- + '<option value="5">ProjectName talk</option>'
- + '</select>'
- + '<input name="invert" type="checkbox" value="1" id="nsinvert" title="no title" />'
- + '<label for="nsinvert" title="no title">Invert selection</label>'
- + '<input name="associated" type="checkbox" value="1" id="nsassociated" title="no title" />'
- + '<label for="nsassociated" title="no title">Associated namespace</label>'
- + '<input type="submit" value="Go" />'
- + '<input type="hidden" value="Special:RecentChanges" name="title" />'
- ;
-
- var $env = $( '<div>' ).html( select ).appendTo( 'body' );
-
- // TODO abstract the double strictEquals
-
- // At first checkboxes are enabled
- assert.strictEqual( $( '#nsinvert' ).prop( 'disabled' ), false );
- assert.strictEqual( $( '#nsassociated' ).prop( 'disabled' ), false );
-
- // Initiate the recentchanges module
- mw.special.recentchanges.init();
-
- // By default
- assert.strictEqual( $( '#nsinvert' ).prop( 'disabled' ), true );
- assert.strictEqual( $( '#nsassociated' ).prop( 'disabled' ), true );
-
- // select second option...
- var $options = $( '#namespace' ).find( 'option' );
- $options.eq(0).removeProp( 'selected' );
- $options.eq(1).prop( 'selected', true );
- $( '#namespace' ).change();
-
- // ... and checkboxes should be enabled again
- assert.strictEqual( $( '#nsinvert' ).prop( 'disabled' ), false );
- assert.strictEqual( $( '#nsassociated' ).prop( 'disabled' ), false );
-
- // select first option ( 'all' namespace)...
- $options.eq(1).removeProp( 'selected' );
- $options.eq(0).prop( 'selected', true );
- $( '#namespace' ).change();
-
- // ... and checkboxes should now be disabled
- assert.strictEqual( $( '#nsinvert' ).prop( 'disabled' ), true );
- assert.strictEqual( $( '#nsassociated' ).prop( 'disabled' ), true );
-
- // DOM cleanup
- $env.remove();
-});
+( function ( mw, $ ) {
+ QUnit.module( 'mediawiki.special.recentchanges', QUnit.newMwEnvironment() );
+
+ // TODO: verify checkboxes == [ 'nsassociated', 'nsinvert' ]
+
+ QUnit.test( '"all" namespace disable checkboxes', function ( assert ) {
+ var selectHtml, $env, $options;
+
+ // from Special:Recentchanges
+ selectHtml =
+ '<select id="namespace" name="namespace" class="namespaceselector">'
+ + '<option value="" selected="selected">all</option>'
+ + '<option value="0">(Main)</option>'
+ + '<option value="1">Talk</option>'
+ + '<option value="2">User</option>'
+ + '<option value="3">User talk</option>'
+ + '<option value="4">ProjectName</option>'
+ + '<option value="5">ProjectName talk</option>'
+ + '</select>'
+ + '<input name="invert" type="checkbox" value="1" id="nsinvert" title="no title" />'
+ + '<label for="nsinvert" title="no title">Invert selection</label>'
+ + '<input name="associated" type="checkbox" value="1" id="nsassociated" title="no title" />'
+ + '<label for="nsassociated" title="no title">Associated namespace</label>'
+ + '<input type="submit" value="Go" />'
+ + '<input type="hidden" value="Special:RecentChanges" name="title" />'
+ ;
+
+ $env = $( '<div>' ).html( selectHtml ).appendTo( 'body' );
+
+ // TODO abstract the double strictEquals
+
+ // At first checkboxes are enabled
+ assert.strictEqual( $( '#nsinvert' ).prop( 'disabled' ), false );
+ assert.strictEqual( $( '#nsassociated' ).prop( 'disabled' ), false );
+
+ // Initiate the recentchanges module
+ mw.special.recentchanges.init();
+
+ // By default
+ assert.strictEqual( $( '#nsinvert' ).prop( 'disabled' ), true );
+ assert.strictEqual( $( '#nsassociated' ).prop( 'disabled' ), true );
+
+ // select second option...
+ $options = $( '#namespace' ).find( 'option' );
+ $options.eq(0).removeProp( 'selected' );
+ $options.eq(1).prop( 'selected', true );
+ $( '#namespace' ).change();
+
+ // ... and checkboxes should be enabled again
+ assert.strictEqual( $( '#nsinvert' ).prop( 'disabled' ), false );
+ assert.strictEqual( $( '#nsassociated' ).prop( 'disabled' ), false );
+
+ // select first option ( 'all' namespace)...
+ $options.eq(1).removeProp( 'selected' );
+ $options.eq(0).prop( 'selected', true );
+ $( '#namespace' ).change();
+
+ // ... and checkboxes should now be disabled
+ assert.strictEqual( $( '#nsinvert' ).prop( 'disabled' ), true );
+ assert.strictEqual( $( '#nsassociated' ).prop( 'disabled' ), true );
+
+ // DOM cleanup
+ $env.remove();
+ });
+}( mediaWiki, jQuery ) );
-( function () {
+( function ( mw ) {
// mw.Title relies on these three config vars
// Restore them after each test run
var config = {
- "wgFormattedNamespaces": {
- "-2": "Media",
- "-1": "Special",
- "0": "",
- "1": "Talk",
- "2": "User",
- "3": "User talk",
- "4": "Wikipedia",
- "5": "Wikipedia talk",
- "6": "File",
- "7": "File talk",
- "8": "MediaWiki",
- "9": "MediaWiki talk",
- "10": "Template",
- "11": "Template talk",
- "12": "Help",
- "13": "Help talk",
- "14": "Category",
- "15": "Category talk",
+ wgFormattedNamespaces: {
+ '-2': 'Media',
+ '-1': 'Special',
+ 0: '',
+ 1: 'Talk',
+ 2: 'User',
+ 3: 'User talk',
+ 4: 'Wikipedia',
+ 5: 'Wikipedia talk',
+ 6: 'File',
+ 7: 'File talk',
+ 8: 'MediaWiki',
+ 9: 'MediaWiki talk',
+ 10: 'Template',
+ 11: 'Template talk',
+ 12: 'Help',
+ 13: 'Help talk',
+ 14: 'Category',
+ 15: 'Category talk',
// testing custom / localized namespace
- "100": "Penguins"
+ 100: 'Penguins'
},
- "wgNamespaceIds": {
- "media": -2,
- "special": -1,
- "": 0,
- "talk": 1,
- "user": 2,
- "user_talk": 3,
- "wikipedia": 4,
- "wikipedia_talk": 5,
- "file": 6,
- "file_talk": 7,
- "mediawiki": 8,
- "mediawiki_talk": 9,
- "template": 10,
- "template_talk": 11,
- "help": 12,
- "help_talk": 13,
- "category": 14,
- "category_talk": 15,
- "image": 6,
- "image_talk": 7,
- "project": 4,
- "project_talk": 5,
+ wgNamespaceIds: {
+ /*jshint camelcase: false */
+ media: -2,
+ special: -1,
+ '': 0,
+ talk: 1,
+ user: 2,
+ user_talk: 3,
+ wikipedia: 4,
+ wikipedia_talk: 5,
+ file: 6,
+ file_talk: 7,
+ mediawiki: 8,
+ mediawiki_talk: 9,
+ template: 10,
+ template_talk: 11,
+ help: 12,
+ help_talk: 13,
+ category: 14,
+ category_talk: 15,
+ image: 6,
+ image_talk: 7,
+ project: 4,
+ project_talk: 5,
/* testing custom / alias */
- "penguins": 100,
- "antarctic_waterfowl": 100
+ penguins: 100,
+ antarctic_waterfowl: 100
},
- "wgCaseSensitiveNamespaces": []
+ wgCaseSensitiveNamespaces: []
};
QUnit.module( 'mediawiki.Title', QUnit.newMwEnvironment({ config: config }) );
title = new mw.Title( ' MediaWiki: Foo bar .js ' );
// Don't ask why, it's the way the backend works. One space is kept of each set
- assert.equal( title.getName(), 'Foo_bar_.js', "Merge multiple spaces to a single space." );
+ assert.equal( title.getName(), 'Foo_bar_.js', 'Merge multiple spaces to a single space.' );
});
QUnit.test( 'Main text for filename', 8, function ( assert ) {
QUnit.test( 'Throw error on invalid title', 1, function ( assert ) {
assert.throws(function () {
- var title = new mw.Title( '' );
+ return new mw.Title( '' );
}, 'Throw error on empty string' );
});
assert.equal( title.getUrl(), '/wiki/User_talk:John_Doe', 'Escaping in title and namespace for urls' );
});
-}() );
\ No newline at end of file
+}( mediaWiki ) );
\ No newline at end of file
-QUnit.module( 'mediawiki.Uri', QUnit.newMwEnvironment({
- setup: function () {
- this.mwUriOrg = mw.Uri;
- mw.Uri = mw.UriRelative( 'http://example.org/w/index.php' );
- },
- teardown: function () {
- mw.Uri = this.mwUriOrg;
- delete this.mwUriOrg;
- }
-}) );
-
-$.each( [true, false], function ( i, strictMode ) {
- QUnit.test( 'Basic mw.Uri object test in ' + ( strictMode ? '' : 'non-' ) + 'strict mode for a simple HTTP URI', 2, function ( assert ) {
- var uriString, uri;
- uriString = 'http://www.ietf.org/rfc/rfc2396.txt';
- uri = new mw.Uri( uriString, {
- strictMode: strictMode
+( function ( mw, $ ) {
+ QUnit.module( 'mediawiki.Uri', QUnit.newMwEnvironment({
+ setup: function () {
+ this.mwUriOrg = mw.Uri;
+ mw.Uri = mw.UriRelative( 'http://example.org/w/index.php' );
+ },
+ teardown: function () {
+ mw.Uri = this.mwUriOrg;
+ delete this.mwUriOrg;
+ }
+ }) );
+
+ $.each( [true, false], function ( i, strictMode ) {
+ QUnit.test( 'Basic mw.Uri object test in ' + ( strictMode ? '' : 'non-' ) + 'strict mode for a simple HTTP URI', 2, function ( assert ) {
+ var uriString, uri;
+ uriString = 'http://www.ietf.org/rfc/rfc2396.txt';
+ uri = new mw.Uri( uriString, {
+ strictMode: strictMode
+ });
+
+ assert.deepEqual(
+ {
+ protocol: uri.protocol,
+ host: uri.host,
+ port: uri.port,
+ path: uri.path,
+ query: uri.query,
+ fragment: uri.fragment
+ }, {
+ protocol: 'http',
+ host: 'www.ietf.org',
+ port: undefined,
+ path: '/rfc/rfc2396.txt',
+ query: {},
+ fragment: undefined
+ },
+ 'basic object properties'
+ );
+
+ assert.deepEqual(
+ {
+ userInfo: uri.getUserInfo(),
+ authority: uri.getAuthority(),
+ hostPort: uri.getHostPort(),
+ queryString: uri.getQueryString(),
+ relativePath: uri.getRelativePath(),
+ toString: uri.toString()
+ },
+ {
+ userInfo: '',
+ authority: 'www.ietf.org',
+ hostPort: 'www.ietf.org',
+ queryString: '',
+ relativePath: '/rfc/rfc2396.txt',
+ toString: uriString
+ },
+ 'construct composite components of URI on request'
+ );
+
});
+ });
+
+ QUnit.test( 'Parse an ftp URI correctly with user and password', 1, function ( assert ) {
+ var uri = new mw.Uri( 'ftp://usr:pwd@192.0.2.16/' );
assert.deepEqual(
{
protocol: uri.protocol,
+ user: uri.user,
+ password: uri.password,
host: uri.host,
port: uri.port,
path: uri.path,
query: uri.query,
fragment: uri.fragment
- }, {
- protocol: 'http',
- host: 'www.ietf.org',
+ },
+ {
+ protocol: 'ftp',
+ user: 'usr',
+ password: 'pwd',
+ host: '192.0.2.16',
port: undefined,
- path: '/rfc/rfc2396.txt',
+ path: '/',
query: {},
fragment: undefined
},
'basic object properties'
);
+ } );
+
+ QUnit.test( 'Parse a uri with simple querystring', 1, function ( assert ) {
+ var uri = new mw.Uri( 'http://www.google.com/?q=uri' );
assert.deepEqual(
{
- userInfo: uri.getUserInfo(),
- authority: uri.getAuthority(),
- hostPort: uri.getHostPort(),
- queryString: uri.getQueryString(),
- relativePath: uri.getRelativePath(),
- toString: uri.toString()
+ protocol: uri.protocol,
+ host: uri.host,
+ port: uri.port,
+ path: uri.path,
+ query: uri.query,
+ fragment: uri.fragment,
+ queryString: uri.getQueryString()
},
{
- userInfo: '',
- authority: 'www.ietf.org',
- hostPort: 'www.ietf.org',
- queryString: '',
- relativePath: '/rfc/rfc2396.txt',
- toString: uriString
+ protocol: 'http',
+ host: 'www.google.com',
+ port: undefined,
+ path: '/',
+ query: { q: 'uri' },
+ fragment: undefined,
+ queryString: 'q=uri'
},
- 'construct composite components of URI on request'
+ 'basic object properties'
);
+ } );
- });
-});
-
-QUnit.test( 'Parse an ftp URI correctly with user and password', 1, function ( assert ) {
- var uri = new mw.Uri( 'ftp://usr:pwd@192.0.2.16/' );
-
- assert.deepEqual(
- {
- protocol: uri.protocol,
- user: uri.user,
- password: uri.password,
- host: uri.host,
- port: uri.port,
- path: uri.path,
- query: uri.query,
- fragment: uri.fragment
- },
- {
- protocol: 'ftp',
- user: 'usr',
- password: 'pwd',
- host: '192.0.2.16',
- port: undefined,
- path: '/',
- query: {},
- fragment: undefined
- },
- 'basic object properties'
- );
-} );
-
-QUnit.test( 'Parse a uri with simple querystring', 1, function ( assert ) {
- var uri = new mw.Uri( 'http://www.google.com/?q=uri' );
-
- assert.deepEqual(
- {
- protocol: uri.protocol,
- host: uri.host,
- port: uri.port,
- path: uri.path,
- query: uri.query,
- fragment: uri.fragment,
- queryString: uri.getQueryString()
- },
- {
- protocol: 'http',
- host: 'www.google.com',
- port: undefined,
- path: '/',
- query: { q: 'uri' },
- fragment: undefined,
- queryString: 'q=uri'
- },
- 'basic object properties'
- );
-} );
+ QUnit.test( 'Handle multiple query parameter (overrideKeys on)', 5, function ( assert ) {
+ var uri = new mw.Uri( 'http://www.example.com/dir/?m=foo&m=bar&n=1', {
+ overrideKeys: true
+ });
-QUnit.test( 'Handle multiple query parameter (overrideKeys on)', 5, function ( assert ) {
- var uri = new mw.Uri( 'http://www.example.com/dir/?m=foo&m=bar&n=1', {
- overrideKeys: true
- });
+ assert.equal( uri.query.n, '1', 'multiple parameters are parsed' );
+ assert.equal( uri.query.m, 'bar', 'last key overrides earlier keys' );
- assert.equal( uri.query.n, '1', 'multiple parameters are parsed' );
- assert.equal( uri.query.m, 'bar', 'last key overrides earlier keys' );
+ uri.query.n = [ 'x', 'y', 'z' ];
- uri.query.n = [ 'x', 'y', 'z' ];
+ // Verify parts and total length instead of entire string because order
+ // of iteration can vary.
+ assert.ok( uri.toString().indexOf( 'm=bar' ), 'toString preserves other values' );
+ assert.ok( uri.toString().indexOf( 'n=x&n=y&n=z' ), 'toString parameter includes all values of an array query parameter' );
+ assert.equal( uri.toString().length, 'http://www.example.com/dir/?m=bar&n=x&n=y&n=z'.length, 'toString matches expected string' );
+ } );
- // Verify parts and total length instead of entire string because order
- // of iteration can vary.
- assert.ok( uri.toString().indexOf( 'm=bar' ), 'toString preserves other values' );
- assert.ok( uri.toString().indexOf( 'n=x&n=y&n=z' ), 'toString parameter includes all values of an array query parameter' );
- assert.equal( uri.toString().length, 'http://www.example.com/dir/?m=bar&n=x&n=y&n=z'.length, 'toString matches expected string' );
-} );
+ QUnit.test( 'Handle multiple query parameter (overrideKeys off)', 9, function ( assert ) {
+ var uri = new mw.Uri( 'http://www.example.com/dir/?m=foo&m=bar&n=1', {
+ overrideKeys: false
+ });
-QUnit.test( 'Handle multiple query parameter (overrideKeys off)', 9, function ( assert ) {
- var uri = new mw.Uri( 'http://www.example.com/dir/?m=foo&m=bar&n=1', {
- overrideKeys: false
- });
+ // Strict comparison so that types are also verified (n should be string '1')
+ assert.strictEqual( uri.query.m.length, 2, 'multi-value query should be an array with 2 items' );
+ assert.strictEqual( uri.query.m[0], 'foo', 'order and value is correct' );
+ assert.strictEqual( uri.query.m[1], 'bar', 'order and value is correct' );
+ assert.strictEqual( uri.query.n, '1', 'n=1 is parsed with the correct value of the expected type' );
- // Strict comparison so that types are also verified (n should be string '1')
- assert.strictEqual( uri.query.m.length, 2, 'multi-value query should be an array with 2 items' );
- assert.strictEqual( uri.query.m[0], 'foo', 'order and value is correct' );
- assert.strictEqual( uri.query.m[1], 'bar', 'order and value is correct' );
- assert.strictEqual( uri.query.n, '1', 'n=1 is parsed with the correct value of the expected type' );
-
- // Change query values
- uri.query.n = [ 'x', 'y', 'z' ];
-
- // Verify parts and total length instead of entire string because order
- // of iteration can vary.
- assert.ok( uri.toString().indexOf( 'm=foo&m=bar' ) >= 0, 'toString preserves other values' );
- assert.ok( uri.toString().indexOf( 'n=x&n=y&n=z' ) >= 0, 'toString parameter includes all values of an array query parameter' );
- assert.equal( uri.toString().length, 'http://www.example.com/dir/?m=foo&m=bar&n=x&n=y&n=z'.length, 'toString matches expected string' );
-
- // Remove query values
- uri.query.m.splice( 0, 1 );
- delete uri.query.n;
-
- assert.equal( uri.toString(), 'http://www.example.com/dir/?m=bar', 'deletion properties' );
-
- // Remove more query values, leaving an empty array
- uri.query.m.splice( 0, 1 );
- assert.equal( uri.toString(), 'http://www.example.com/dir/', 'empty array value is ommitted' );
-} );
-
-QUnit.test( 'All-dressed URI with everything', 11, function ( assert ) {
- var uri, queryString, relativePath;
-
- uri = new mw.Uri( 'http://auth@www.example.com:81/dir/dir.2/index.htm?q1=0&&test1&test2=value+%28escaped%29#top' );
-
- assert.deepEqual(
- {
- protocol: uri.protocol,
- user: uri.user,
- password: uri.password,
- host: uri.host,
- port: uri.port,
- path: uri.path,
- query: uri.query,
- fragment: uri.fragment
- },
- {
- protocol: 'http',
- user: 'auth',
- password: undefined,
- host: 'www.example.com',
- port: '81',
- path: '/dir/dir.2/index.htm',
- query: { q1: '0', test1: null, test2: 'value (escaped)' },
- fragment: 'top'
- },
- 'basic object properties'
- );
+ // Change query values
+ uri.query.n = [ 'x', 'y', 'z' ];
- assert.equal( uri.getUserInfo(), 'auth', 'user info' );
+ // Verify parts and total length instead of entire string because order
+ // of iteration can vary.
+ assert.ok( uri.toString().indexOf( 'm=foo&m=bar' ) >= 0, 'toString preserves other values' );
+ assert.ok( uri.toString().indexOf( 'n=x&n=y&n=z' ) >= 0, 'toString parameter includes all values of an array query parameter' );
+ assert.equal( uri.toString().length, 'http://www.example.com/dir/?m=foo&m=bar&n=x&n=y&n=z'.length, 'toString matches expected string' );
- assert.equal( uri.getAuthority(), 'auth@www.example.com:81', 'authority equal to auth@hostport' );
+ // Remove query values
+ uri.query.m.splice( 0, 1 );
+ delete uri.query.n;
- assert.equal( uri.getHostPort(), 'www.example.com:81', 'hostport equal to host:port' );
+ assert.equal( uri.toString(), 'http://www.example.com/dir/?m=bar', 'deletion properties' );
- queryString = uri.getQueryString();
- assert.ok( queryString.indexOf( 'q1=0' ) >= 0, 'query param with numbers' );
- assert.ok( queryString.indexOf( 'test1' ) >= 0, 'query param with null value is included' );
- assert.ok( queryString.indexOf( 'test1=' ) === -1, 'query param with null value does not generate equals sign' );
- assert.ok( queryString.indexOf( 'test2=value+%28escaped%29' ) >= 0, 'query param is url escaped' );
+ // Remove more query values, leaving an empty array
+ uri.query.m.splice( 0, 1 );
+ assert.equal( uri.toString(), 'http://www.example.com/dir/', 'empty array value is ommitted' );
+ } );
- relativePath = uri.getRelativePath();
- assert.ok( relativePath.indexOf( uri.path ) >= 0, 'path in relative path' );
- assert.ok( relativePath.indexOf( uri.getQueryString() ) >= 0, 'query string in relative path' );
- assert.ok( relativePath.indexOf( uri.fragment ) >= 0, 'fragement in relative path' );
-} );
+ QUnit.test( 'All-dressed URI with everything', 11, function ( assert ) {
+ var uri, queryString, relativePath;
-QUnit.test( 'Cloning', 6, function ( assert ) {
- var original, clone;
+ uri = new mw.Uri( 'http://auth@www.example.com:81/dir/dir.2/index.htm?q1=0&&test1&test2=value+%28escaped%29#top' );
- original = new mw.Uri( 'http://foo.example.org/index.php?one=1&two=2' );
- clone = original.clone();
+ assert.deepEqual(
+ {
+ protocol: uri.protocol,
+ user: uri.user,
+ password: uri.password,
+ host: uri.host,
+ port: uri.port,
+ path: uri.path,
+ query: uri.query,
+ fragment: uri.fragment
+ },
+ {
+ protocol: 'http',
+ user: 'auth',
+ password: undefined,
+ host: 'www.example.com',
+ port: '81',
+ path: '/dir/dir.2/index.htm',
+ query: { q1: '0', test1: null, test2: 'value (escaped)' },
+ fragment: 'top'
+ },
+ 'basic object properties'
+ );
- assert.deepEqual( clone, original, 'clone has equivalent properties' );
- assert.equal( original.toString(), clone.toString(), 'toString matches original' );
+ assert.equal( uri.getUserInfo(), 'auth', 'user info' );
- assert.notStrictEqual( clone, original, 'clone is a different object when compared by reference' );
+ assert.equal( uri.getAuthority(), 'auth@www.example.com:81', 'authority equal to auth@hostport' );
- clone.host = 'bar.example.org';
- assert.notEqual( original.host, clone.host, 'manipulating clone did not effect original' );
- assert.notEqual( original.toString(), clone.toString(), 'Stringified url no longer matches original' );
+ assert.equal( uri.getHostPort(), 'www.example.com:81', 'hostport equal to host:port' );
- clone.query.three = 3;
+ queryString = uri.getQueryString();
+ assert.ok( queryString.indexOf( 'q1=0' ) >= 0, 'query param with numbers' );
+ assert.ok( queryString.indexOf( 'test1' ) >= 0, 'query param with null value is included' );
+ assert.ok( queryString.indexOf( 'test1=' ) === -1, 'query param with null value does not generate equals sign' );
+ assert.ok( queryString.indexOf( 'test2=value+%28escaped%29' ) >= 0, 'query param is url escaped' );
- assert.deepEqual(
- original.query,
- { 'one': '1', 'two': '2' },
- 'Properties is deep cloned (bug 37708)'
- );
-} );
+ relativePath = uri.getRelativePath();
+ assert.ok( relativePath.indexOf( uri.path ) >= 0, 'path in relative path' );
+ assert.ok( relativePath.indexOf( uri.getQueryString() ) >= 0, 'query string in relative path' );
+ assert.ok( relativePath.indexOf( uri.fragment ) >= 0, 'fragement in relative path' );
+ } );
-QUnit.test( 'Constructing mw.Uri from plain object', 3, function ( assert ) {
- var uri = new mw.Uri({
- protocol: 'http',
- host: 'www.foo.local',
- path: '/this'
- });
- assert.equal( uri.toString(), 'http://www.foo.local/this', 'Basic properties' );
-
- uri = new mw.Uri({
- protocol: 'http',
- host: 'www.foo.local',
- path: '/this',
- query: { hi: 'there' },
- fragment: 'blah'
- });
- assert.equal( uri.toString(), 'http://www.foo.local/this?hi=there#blah', 'More complex properties' );
+ QUnit.test( 'Cloning', 6, function ( assert ) {
+ var original, clone;
- assert.throws(
- function () {
- var uri = new mw.Uri({
- protocol: 'http',
- host: 'www.foo.local'
- });
- },
- function ( e ) {
- return e.message === 'Bad constructor arguments';
- },
- 'Construction failed when missing required properties'
- );
-} );
+ original = new mw.Uri( 'http://foo.example.org/index.php?one=1&two=2' );
+ clone = original.clone();
-QUnit.test( 'Manipulate properties', 8, function ( assert ) {
- var uriBase, uri;
+ assert.deepEqual( clone, original, 'clone has equivalent properties' );
+ assert.equal( original.toString(), clone.toString(), 'toString matches original' );
- uriBase = new mw.Uri( 'http://en.wiki.local/w/api.php' );
+ assert.notStrictEqual( clone, original, 'clone is a different object when compared by reference' );
- uri = uriBase.clone();
- uri.fragment = 'frag';
- assert.equal( uri.toString(), 'http://en.wiki.local/w/api.php#frag', 'add a fragment' );
+ clone.host = 'bar.example.org';
+ assert.notEqual( original.host, clone.host, 'manipulating clone did not effect original' );
+ assert.notEqual( original.toString(), clone.toString(), 'Stringified url no longer matches original' );
- uri = uriBase.clone();
- uri.host = 'fr.wiki.local';
- uri.port = '8080';
- assert.equal( uri.toString(), 'http://fr.wiki.local:8080/w/api.php', 'change host and port' );
+ clone.query.three = 3;
- uri = uriBase.clone();
- uri.query.foo = 'bar';
- assert.equal( uri.toString(), 'http://en.wiki.local/w/api.php?foo=bar', 'add query arguments' );
+ assert.deepEqual(
+ original.query,
+ { 'one': '1', 'two': '2' },
+ 'Properties is deep cloned (bug 37708)'
+ );
+ } );
- delete uri.query.foo;
- assert.equal( uri.toString(), 'http://en.wiki.local/w/api.php', 'delete query arguments' );
+ QUnit.test( 'Constructing mw.Uri from plain object', 3, function ( assert ) {
+ var uri = new mw.Uri({
+ protocol: 'http',
+ host: 'www.foo.local',
+ path: '/this'
+ });
+ assert.equal( uri.toString(), 'http://www.foo.local/this', 'Basic properties' );
- uri = uriBase.clone();
- uri.query.foo = 'bar';
- assert.equal( uri.toString(), 'http://en.wiki.local/w/api.php?foo=bar', 'extend query arguments' );
- uri.extend({
- foo: 'quux',
- pif: 'paf'
- });
- assert.ok( uri.toString().indexOf( 'foo=quux' ) >= 0, 'extend query arguments' );
- assert.ok( uri.toString().indexOf( 'foo=bar' ) === -1, 'extend query arguments' );
- assert.ok( uri.toString().indexOf( 'pif=paf' ) >= 0 , 'extend query arguments' );
-} );
+ uri = new mw.Uri({
+ protocol: 'http',
+ host: 'www.foo.local',
+ path: '/this',
+ query: { hi: 'there' },
+ fragment: 'blah'
+ });
+ assert.equal( uri.toString(), 'http://www.foo.local/this?hi=there#blah', 'More complex properties' );
+
+ assert.throws(
+ function () {
+ return new mw.Uri({
+ protocol: 'http',
+ host: 'www.foo.local'
+ });
+ },
+ function ( e ) {
+ return e.message === 'Bad constructor arguments';
+ },
+ 'Construction failed when missing required properties'
+ );
+ } );
-QUnit.test( 'Handle protocol-relative URLs', 5, function ( assert ) {
- var UriRel, uri;
+ QUnit.test( 'Manipulate properties', 8, function ( assert ) {
+ var uriBase, uri;
- UriRel = mw.UriRelative( 'glork://en.wiki.local/foo.php' );
+ uriBase = new mw.Uri( 'http://en.wiki.local/w/api.php' );
- uri = new UriRel( '//en.wiki.local/w/api.php' );
- assert.equal( uri.protocol, 'glork', 'create protocol-relative URLs with same protocol as document' );
+ uri = uriBase.clone();
+ uri.fragment = 'frag';
+ assert.equal( uri.toString(), 'http://en.wiki.local/w/api.php#frag', 'add a fragment' );
- uri = new UriRel( '/foo.com' );
- assert.equal( uri.toString(), 'glork://en.wiki.local/foo.com', 'handle absolute paths by supplying protocol and host from document in loose mode' );
+ uri = uriBase.clone();
+ uri.host = 'fr.wiki.local';
+ uri.port = '8080';
+ assert.equal( uri.toString(), 'http://fr.wiki.local:8080/w/api.php', 'change host and port' );
- uri = new UriRel( 'http:/foo.com' );
- assert.equal( uri.toString(), 'http://en.wiki.local/foo.com', 'handle absolute paths by supplying host from document in loose mode' );
+ uri = uriBase.clone();
+ uri.query.foo = 'bar';
+ assert.equal( uri.toString(), 'http://en.wiki.local/w/api.php?foo=bar', 'add query arguments' );
- uri = new UriRel( '/foo.com', true );
- assert.equal( uri.toString(), 'glork://en.wiki.local/foo.com', 'handle absolute paths by supplying protocol and host from document in strict mode' );
+ delete uri.query.foo;
+ assert.equal( uri.toString(), 'http://en.wiki.local/w/api.php', 'delete query arguments' );
- uri = new UriRel( 'http:/foo.com', true );
- assert.equal( uri.toString(), 'http://en.wiki.local/foo.com', 'handle absolute paths by supplying host from document in strict mode' );
-} );
+ uri = uriBase.clone();
+ uri.query.foo = 'bar';
+ assert.equal( uri.toString(), 'http://en.wiki.local/w/api.php?foo=bar', 'extend query arguments' );
+ uri.extend({
+ foo: 'quux',
+ pif: 'paf'
+ });
+ assert.ok( uri.toString().indexOf( 'foo=quux' ) >= 0, 'extend query arguments' );
+ assert.ok( uri.toString().indexOf( 'foo=bar' ) === -1, 'extend query arguments' );
+ assert.ok( uri.toString().indexOf( 'pif=paf' ) >= 0 , 'extend query arguments' );
+ } );
-QUnit.test( 'Bad calls', 3, function ( assert ) {
- var uri;
+ QUnit.test( 'Handle protocol-relative URLs', 5, function ( assert ) {
+ var UriRel, uri;
- assert.throws(
- function () {
- new mw.Uri( 'glaswegian penguins' );
- },
- function ( e ) {
- return e.message === 'Bad constructor arguments';
- },
- 'throw error on non-URI as argument to constructor'
- );
+ UriRel = mw.UriRelative( 'glork://en.wiki.local/foo.php' );
- assert.throws(
- function () {
- new mw.Uri( 'foo.com/bar/baz', {
- strictMode: true
- });
- },
- function ( e ) {
- return e.message === 'Bad constructor arguments';
- },
- 'throw error on URI without protocol or // or leading / in strict mode'
- );
+ uri = new UriRel( '//en.wiki.local/w/api.php' );
+ assert.equal( uri.protocol, 'glork', 'create protocol-relative URLs with same protocol as document' );
+
+ uri = new UriRel( '/foo.com' );
+ assert.equal( uri.toString(), 'glork://en.wiki.local/foo.com', 'handle absolute paths by supplying protocol and host from document in loose mode' );
+
+ uri = new UriRel( 'http:/foo.com' );
+ assert.equal( uri.toString(), 'http://en.wiki.local/foo.com', 'handle absolute paths by supplying host from document in loose mode' );
+
+ uri = new UriRel( '/foo.com', true );
+ assert.equal( uri.toString(), 'glork://en.wiki.local/foo.com', 'handle absolute paths by supplying protocol and host from document in strict mode' );
+
+ uri = new UriRel( 'http:/foo.com', true );
+ assert.equal( uri.toString(), 'http://en.wiki.local/foo.com', 'handle absolute paths by supplying host from document in strict mode' );
+ } );
- uri = new mw.Uri( 'foo.com/bar/baz', {
- strictMode: false
+ QUnit.test( 'Bad calls', 3, function ( assert ) {
+ var uri;
+
+ assert.throws(
+ function () {
+ return new mw.Uri( 'glaswegian penguins' );
+ },
+ function ( e ) {
+ return e.message === 'Bad constructor arguments';
+ },
+ 'throw error on non-URI as argument to constructor'
+ );
+
+ assert.throws(
+ function () {
+ return new mw.Uri( 'foo.com/bar/baz', {
+ strictMode: true
+ });
+ },
+ function ( e ) {
+ return e.message === 'Bad constructor arguments';
+ },
+ 'throw error on URI without protocol or // or leading / in strict mode'
+ );
+
+ uri = new mw.Uri( 'foo.com/bar/baz', {
+ strictMode: false
+ });
+ assert.equal( uri.toString(), 'http://foo.com/bar/baz', 'normalize URI without protocol or // in loose mode' );
});
- assert.equal( uri.toString(), 'http://foo.com/bar/baz', 'normalize URI without protocol or // in loose mode' );
-});
-QUnit.test( 'bug 35658', 2, function ( assert ) {
- var testProtocol, testServer, testPort, testPath, UriClass, uri, href;
+ QUnit.test( 'bug 35658', 2, function ( assert ) {
+ var testProtocol, testServer, testPort, testPath, UriClass, uri, href;
- testProtocol = 'https://';
- testServer = 'foo.example.org';
- testPort = '3004';
- testPath = '/!1qy';
+ testProtocol = 'https://';
+ testServer = 'foo.example.org';
+ testPort = '3004';
+ testPath = '/!1qy';
- UriClass = mw.UriRelative( testProtocol + testServer + '/some/path/index.html' );
- uri = new UriClass( testPath );
- href = uri.toString();
- assert.equal( href, testProtocol + testServer + testPath, 'Root-relative URL gets host & protocol supplied' );
+ UriClass = mw.UriRelative( testProtocol + testServer + '/some/path/index.html' );
+ uri = new UriClass( testPath );
+ href = uri.toString();
+ assert.equal( href, testProtocol + testServer + testPath, 'Root-relative URL gets host & protocol supplied' );
- UriClass = mw.UriRelative( testProtocol + testServer + ':' + testPort + '/some/path.php' );
- uri = new UriClass( testPath );
- href = uri.toString();
- assert.equal( href, testProtocol + testServer + ':' + testPort + testPath, 'Root-relative URL gets host, protocol, and port supplied' );
+ UriClass = mw.UriRelative( testProtocol + testServer + ':' + testPort + '/some/path.php' );
+ uri = new UriClass( testPath );
+ href = uri.toString();
+ assert.equal( href, testProtocol + testServer + ':' + testPort + testPath, 'Root-relative URL gets host, protocol, and port supplied' );
-} );
+ } );
-QUnit.test( 'Constructor falls back to default location', 4, function ( assert ) {
- var testuri, MyUri, uri;
+ QUnit.test( 'Constructor falls back to default location', 4, function ( assert ) {
+ var testuri, MyUri, uri;
- testuri = 'http://example.org/w/index.php';
- MyUri = mw.UriRelative( testuri );
+ testuri = 'http://example.org/w/index.php';
+ MyUri = mw.UriRelative( testuri );
- uri = new MyUri();
- assert.equal( uri.toString(), testuri, 'no arguments' );
+ uri = new MyUri();
+ assert.equal( uri.toString(), testuri, 'no arguments' );
- uri = new MyUri( undefined );
- assert.equal( uri.toString(), testuri, 'undefined' );
+ uri = new MyUri( undefined );
+ assert.equal( uri.toString(), testuri, 'undefined' );
- uri = new MyUri( null );
- assert.equal( uri.toString(), testuri, 'null' );
+ uri = new MyUri( null );
+ assert.equal( uri.toString(), testuri, 'null' );
- uri = new MyUri( '' );
- assert.equal( uri.toString(), testuri, 'empty string' );
-} );
+ uri = new MyUri( '' );
+ assert.equal( uri.toString(), testuri, 'empty string' );
+ } );
+}( mediaWiki, jQuery ) );
-QUnit.module( 'mediawiki.cldr', QUnit.newMwEnvironment() );
+( function ( mw, $ ) {
+ QUnit.module( 'mediawiki.cldr', QUnit.newMwEnvironment() );
-var pluralTestcases = {
- /*
- * Sample:
- * "languagecode" : [
- * [ number, [ "form1", "form2", ... ], "expected", "description" ]
- * ];
- */
- "en": [
- [ 0, [ "one", "other" ], "other", "English plural test- 0 is other" ],
- [ 1, [ "one", "other" ], "one", "English plural test- 1 is one" ]
- ],
- "fa": [
- [ 0, [ "one", "other" ], "other", "Persian plural test- 0 is other" ],
- [ 1, [ "one", "other" ], "one", "Persian plural test- 1 is one" ],
- [ 2, [ "one", "other" ], "other", "Persian plural test- 2 is other" ]
- ],
- "fr": [
- [ 0, [ "one", "other" ], "other", "French plural test- 0 is other" ],
- [ 1, [ "one", "other" ], "one", "French plural test- 1 is one" ]
- ],
- "hi": [
- [ 0, [ "one", "other" ], "one", "Hindi plural test- 0 is one" ],
- [ 1, [ "one", "other" ], "one", "Hindi plural test- 1 is one" ],
- [ 2, [ "one", "other" ], "other", "Hindi plural test- 2 is other" ]
- ],
- "he": [
- [ 0, [ "one", "other" ], "other", "Hebrew plural test- 0 is other" ],
- [ 1, [ "one", "other" ], "one", "Hebrew plural test- 1 is one" ],
- [ 2, [ "one", "other" ], "other", "Hebrew plural test- 2 is other with 2 forms" ],
- [ 2, [ "one", "dual", "other" ], "dual", "Hebrew plural test- 2 is dual with 3 forms" ]
- ],
- "hu": [
- [ 0, [ "one", "other" ], "other", "Hungarian plural test- 0 is other" ],
- [ 1, [ "one", "other" ], "one", "Hungarian plural test- 1 is one" ],
- [ 2, [ "one", "other" ], "other", "Hungarian plural test- 2 is other" ]
- ],
- "ar": [
- [ 0, [ "zero", "one", "two", "few", "many", "other" ], "zero", "Arabic plural test - 0 is zero" ],
- [ 1, [ "zero", "one", "two", "few", "many", "other" ], "one", "Arabic plural test - 1 is one" ],
- [ 2, [ "zero", "one", "two", "few", "many", "other" ], "two", "Arabic plural test - 2 is two" ],
- [ 3, [ "zero", "one", "two", "few", "many", "other" ], "few", "Arabic plural test - 3 is few" ],
- [ 9, [ "zero", "one", "two", "few", "many", "other" ], "few", "Arabic plural test - 9 is few" ],
- [ "9", [ "zero", "one", "two", "few", "many", "other" ], "few", "Arabic plural test - 9 is few" ],
- [ 110, [ "zero", "one", "two", "few", "many", "other" ], "few", "Arabic plural test - 110 is few" ],
- [ 11, [ "zero", "one", "two", "few", "many", "other" ], "many", "Arabic plural test - 11 is many" ],
- [ 15, [ "zero", "one", "two", "few", "many", "other" ], "many", "Arabic plural test - 15 is many" ],
- [ 99, [ "zero", "one", "two", "few", "many", "other" ], "many", "Arabic plural test - 99 is many" ],
- [ 9999, [ "zero", "one", "two", "few", "many", "other" ], "many", "Arabic plural test - 9999 is many" ],
- [ 100, [ "zero", "one", "two", "few", "many", "other" ], "other", "Arabic plural test - 100 is other" ],
- [ 102, [ "zero", "one", "two", "few", "many", "other" ], "other", "Arabic plural test - 102 is other" ],
- [ 1000, [ "zero", "one", "two", "few", "many", "other" ], "other", "Arabic plural test - 1000 is other" ],
- [ 1.7, [ "zero", "one", "two", "few", "many", "other" ], "other", "Arabic plural test - 1.7 is other" ]
- ]
-};
+ var pluralTestcases = {
+ /*
+ * Sample:
+ * languagecode : [
+ * [ number, [ 'form1', 'form2', ... ], 'expected', 'description' ]
+ * ];
+ */
+ en: [
+ [ 0, [ 'one', 'other' ], 'other', 'English plural test- 0 is other' ],
+ [ 1, [ 'one', 'other' ], 'one', 'English plural test- 1 is one' ]
+ ],
+ fa: [
+ [ 0, [ 'one', 'other' ], 'other', 'Persian plural test- 0 is other' ],
+ [ 1, [ 'one', 'other' ], 'one', 'Persian plural test- 1 is one' ],
+ [ 2, [ 'one', 'other' ], 'other', 'Persian plural test- 2 is other' ]
+ ],
+ fr: [
+ [ 0, [ 'one', 'other' ], 'other', 'French plural test- 0 is other' ],
+ [ 1, [ 'one', 'other' ], 'one', 'French plural test- 1 is one' ]
+ ],
+ hi: [
+ [ 0, [ 'one', 'other' ], 'one', 'Hindi plural test- 0 is one' ],
+ [ 1, [ 'one', 'other' ], 'one', 'Hindi plural test- 1 is one' ],
+ [ 2, [ 'one', 'other' ], 'other', 'Hindi plural test- 2 is other' ]
+ ],
+ he: [
+ [ 0, [ 'one', 'other' ], 'other', 'Hebrew plural test- 0 is other' ],
+ [ 1, [ 'one', 'other' ], 'one', 'Hebrew plural test- 1 is one' ],
+ [ 2, [ 'one', 'other' ], 'other', 'Hebrew plural test- 2 is other with 2 forms' ],
+ [ 2, [ 'one', 'dual', 'other' ], 'dual', 'Hebrew plural test- 2 is dual with 3 forms' ]
+ ],
+ hu: [
+ [ 0, [ 'one', 'other' ], 'other', 'Hungarian plural test- 0 is other' ],
+ [ 1, [ 'one', 'other' ], 'one', 'Hungarian plural test- 1 is one' ],
+ [ 2, [ 'one', 'other' ], 'other', 'Hungarian plural test- 2 is other' ]
+ ],
+ ar: [
+ [ 0, [ 'zero', 'one', 'two', 'few', 'many', 'other' ], 'zero', 'Arabic plural test - 0 is zero' ],
+ [ 1, [ 'zero', 'one', 'two', 'few', 'many', 'other' ], 'one', 'Arabic plural test - 1 is one' ],
+ [ 2, [ 'zero', 'one', 'two', 'few', 'many', 'other' ], 'two', 'Arabic plural test - 2 is two' ],
+ [ 3, [ 'zero', 'one', 'two', 'few', 'many', 'other' ], 'few', 'Arabic plural test - 3 is few' ],
+ [ 9, [ 'zero', 'one', 'two', 'few', 'many', 'other' ], 'few', 'Arabic plural test - 9 is few' ],
+ [ '9', [ 'zero', 'one', 'two', 'few', 'many', 'other' ], 'few', 'Arabic plural test - 9 is few' ],
+ [ 110, [ 'zero', 'one', 'two', 'few', 'many', 'other' ], 'few', 'Arabic plural test - 110 is few' ],
+ [ 11, [ 'zero', 'one', 'two', 'few', 'many', 'other' ], 'many', 'Arabic plural test - 11 is many' ],
+ [ 15, [ 'zero', 'one', 'two', 'few', 'many', 'other' ], 'many', 'Arabic plural test - 15 is many' ],
+ [ 99, [ 'zero', 'one', 'two', 'few', 'many', 'other' ], 'many', 'Arabic plural test - 99 is many' ],
+ [ 9999, [ 'zero', 'one', 'two', 'few', 'many', 'other' ], 'many', 'Arabic plural test - 9999 is many' ],
+ [ 100, [ 'zero', 'one', 'two', 'few', 'many', 'other' ], 'other', 'Arabic plural test - 100 is other' ],
+ [ 102, [ 'zero', 'one', 'two', 'few', 'many', 'other' ], 'other', 'Arabic plural test - 102 is other' ],
+ [ 1000, [ 'zero', 'one', 'two', 'few', 'many', 'other' ], 'other', 'Arabic plural test - 1000 is other' ],
+ [ 1.7, [ 'zero', 'one', 'two', 'few', 'many', 'other' ], 'other', 'Arabic plural test - 1.7 is other' ]
+ ]
+ };
-function pluralTest( langCode, tests ) {
- QUnit.test( 'Plural Test for ' + langCode, tests.length, function ( assert ) {
- for ( var i = 0; i < tests.length; i++ ) {
- assert.equal(
- mw.language.convertPlural( tests[i][0], tests[i][1] ),
- tests[i][2],
- tests[i][3]
- );
+ function pluralTest( langCode, tests ) {
+ QUnit.test( 'Plural Test for ' + langCode, tests.length, function ( assert ) {
+ for ( var i = 0; i < tests.length; i++ ) {
+ assert.equal(
+ mw.language.convertPlural( tests[i][0], tests[i][1] ),
+ tests[i][2],
+ tests[i][3]
+ );
+ }
+ } );
+ }
+
+ $.each( pluralTestcases, function ( langCode, tests ) {
+ if ( langCode === mw.config.get( 'wgUserLanguage' ) ) {
+ pluralTest( langCode, tests );
}
} );
-}
-
-$.each( pluralTestcases, function ( langCode, tests ) {
- if ( langCode === mw.config.get( 'wgUserLanguage' ) ) {
- pluralTest( langCode, tests );
- }
-} );
+}( mediaWiki, jQuery ) );
-/* Some misc JavaScript compatibility tests, just to make sure the environments we run in are consistent */
-
-QUnit.module( 'mediawiki.jscompat', QUnit.newMwEnvironment() );
-
-QUnit.test( 'Variable with Unicode letter in name', 3, function ( assert ) {
- var orig = "some token";
- var ŝablono = orig;
-
- assert.deepEqual( ŝablono, orig, 'ŝablono' );
- assert.deepEqual( \u015dablono, orig, '\\u015dablono' );
- assert.deepEqual( \u015Dablono, orig, '\\u015Dablono' );
-});
-
-/*
-// Not that we need this. ;)
-// This fails on IE 6-8
-// Works on IE 9, Firefox 6, Chrome 14
-QUnit.test( 'Keyword workaround: "if" as variable name using Unicode escapes', function ( assert ) {
- var orig = "another token";
- \u0069\u0066 = orig;
- assert.deepEqual( \u0069\u0066, orig, '\\u0069\\u0066' );
-});
-*/
-
-/*
-// Not that we need this. ;)
-// This fails on IE 6-9
-// Works on Firefox 6, Chrome 14
-QUnit.test( 'Keyword workaround: "if" as member variable name using Unicode escapes', function ( assert ) {
- var orig = "another token";
- var foo = {};
- foo.\u0069\u0066 = orig;
- assert.deepEqual( foo.\u0069\u0066, orig, 'foo.\\u0069\\u0066' );
-});
-*/
-
-QUnit.test( 'Stripping of single initial newline from textarea\'s literal contents (bug 12130)', function ( assert ) {
- var maxn = 4;
- QUnit.expect( maxn * 2 );
-
- function repeat( str, n ) {
- if ( n <= 0 ) {
- return '';
- } else {
- var out = new Array(n);
- for ( var i = 0; i < n; i++ ) {
- out[i] = str;
+/**
+ * Some misc JavaScript compatibility tests,
+ * just to make sure the environments we run in are consistent.
+ */
+( function ( $ ) {
+ QUnit.module( 'mediawiki.jscompat', QUnit.newMwEnvironment() );
+
+ QUnit.test( 'Variable with Unicode letter in name', 3, function ( assert ) {
+ var orig, ŝablono;
+
+ orig = 'some token';
+ ŝablono = orig;
+
+ assert.deepEqual( ŝablono, orig, 'ŝablono' );
+ assert.deepEqual( \u015dablono, orig, '\\u015dablono' );
+ assert.deepEqual( \u015Dablono, orig, '\\u015Dablono' );
+ });
+
+ /*
+ // Not that we need this. ;)
+ // This fails on IE 6-8
+ // Works on IE 9, Firefox 6, Chrome 14
+ QUnit.test( 'Keyword workaround: "if" as variable name using Unicode escapes', function ( assert ) {
+ var orig = "another token";
+ \u0069\u0066 = orig;
+ assert.deepEqual( \u0069\u0066, orig, '\\u0069\\u0066' );
+ });
+ */
+
+ /*
+ // Not that we need this. ;)
+ // This fails on IE 6-9
+ // Works on Firefox 6, Chrome 14
+ QUnit.test( 'Keyword workaround: "if" as member variable name using Unicode escapes', function ( assert ) {
+ var orig = "another token";
+ var foo = {};
+ foo.\u0069\u0066 = orig;
+ assert.deepEqual( foo.\u0069\u0066, orig, 'foo.\\u0069\\u0066' );
+ });
+ */
+
+ QUnit.test( 'Stripping of single initial newline from textarea\'s literal contents (bug 12130)', function ( assert ) {
+ var maxn, n,
+ expected, $textarea;
+
+ maxn = 4;
+ QUnit.expect( maxn * 2 );
+
+ function repeat( str, n ) {
+ var out;
+ if ( n <= 0 ) {
+ return '';
+ } else {
+ out = [];
+ out.length = n + 1;
+ return out.join( str );
}
- return out.join('');
}
- }
- for ( var n = 0; n < maxn; n++ ) {
- var expected = repeat('\n', n) + 'some text';
+ for ( n = 0; n < maxn; n++ ) {
+ expected = repeat('\n', n) + 'some text';
- var $textarea = $('<textarea>\n' + expected + '</textarea>');
- assert.equal( $textarea.val(), expected, 'Expecting ' + n + ' newlines (HTML contained ' + (n + 1) + ')' );
+ $textarea = $('<textarea>\n' + expected + '</textarea>');
+ assert.equal( $textarea.val(), expected, 'Expecting ' + n + ' newlines (HTML contained ' + (n + 1) + ')' );
- var $textarea2 = $('<textarea>').val(expected);
- assert.equal( $textarea2.val(), expected, 'Expecting ' + n + ' newlines (from DOM set with ' + n + ')' );
- }
-});
+ $textarea = $('<textarea>').val( expected );
+ assert.equal( $textarea.val(), expected, 'Expecting ' + n + ' newlines (from DOM set with ' + n + ')' );
+ }
+ });
+}( jQuery ) );
-QUnit.module( 'mediawiki.language', QUnit.newMwEnvironment({
- setup: function () {
- this.liveLangData = mw.language.data.values;
- mw.language.data.values = $.extend( true, {}, this.liveLangData );
- },
- teardown: function () {
- // Restore
- mw.language.data.values = this.liveLangData;
- }
-}) );
+( function ( mw, $ ) {
-QUnit.test( 'mw.language getData and setData', function ( assert ) {
- QUnit.expect( 2 );
+ QUnit.module( 'mediawiki.language', QUnit.newMwEnvironment({
+ setup: function () {
+ this.liveLangData = mw.language.data.values;
+ mw.language.data.values = $.extend( true, {}, this.liveLangData );
+ },
+ teardown: function () {
+ mw.language.data.values = this.liveLangData;
+ }
+ }) );
- mw.language.setData( 'en', 'testkey', 'testvalue' );
- assert.equal( mw.language.getData( 'en', 'testkey' ), 'testvalue', 'Getter setter test for mw.language' );
- assert.equal( mw.language.getData( 'en', 'invalidkey' ), undefined, 'Getter setter test for mw.language with invalid key' );
-} );
+ QUnit.test( 'mw.language getData and setData', 2, function ( assert ) {
+ mw.language.setData( 'en', 'testkey', 'testvalue' );
+ assert.equal( mw.language.getData( 'en', 'testkey' ), 'testvalue', 'Getter setter test for mw.language' );
+ assert.equal( mw.language.getData( 'en', 'invalidkey' ), undefined, 'Getter setter test for mw.language with invalid key' );
+ } );
-function grammarTest( langCode, test ) {
- // The test works only if the content language is opt.language
- // because it requires [lang].js to be loaded.
- QUnit.test( 'Grammar test for lang=' + langCode, function ( assert ) {
- QUnit.expect( test.length );
+ function grammarTest( langCode, test ) {
+ // The test works only if the content language is opt.language
+ // because it requires [lang].js to be loaded.
+ QUnit.test( 'Grammar test for lang=' + langCode, function ( assert ) {
+ QUnit.expect( test.length );
- for ( var i = 0 ; i < test.length; i++ ) {
- assert.equal(
- mw.language.convertGrammar( test[i].word, test[i].grammarForm ),
- test[i].expected,
- test[i].description
- );
- }
- });
-}
+ for ( var i = 0 ; i < test.length; i++ ) {
+ assert.equal(
+ mw.language.convertGrammar( test[i].word, test[i].grammarForm ),
+ test[i].expected,
+ test[i].description
+ );
+ }
+ });
+ }
-var grammarTests = {
- bs: [
- {
- word: 'word',
- grammarForm: 'instrumental',
- expected: 's word',
- description: 'Grammar test for instrumental case'
- },
- {
- word: 'word',
- grammarForm: 'lokativ',
- expected: 'o word',
- description: 'Grammar test for lokativ case'
- }
- ],
+ var grammarTests = {
+ bs: [
+ {
+ word: 'word',
+ grammarForm: 'instrumental',
+ expected: 's word',
+ description: 'Grammar test for instrumental case'
+ },
+ {
+ word: 'word',
+ grammarForm: 'lokativ',
+ expected: 'o word',
+ description: 'Grammar test for lokativ case'
+ }
+ ],
- he: [
- {
- word: "ויקיפדיה",
- grammarForm: 'prefixed',
- expected: "וויקיפדיה",
- description: 'Duplicate the "Waw" if prefixed'
- },
- {
- word: "וולפגנג",
- grammarForm: 'prefixed',
- expected: "וולפגנג",
- description: 'Duplicate the "Waw" if prefixed, but not if it is already duplicated.'
- },
- {
- word: "הקובץ",
- grammarForm: 'prefixed',
- expected: "קובץ",
- description: 'Remove the "He" if prefixed'
- },
- {
- word: 'Wikipedia',
- grammarForm: 'תחילית',
- expected: '־Wikipedia',
- description: 'GAdd a hyphen (maqaf) before non-Hebrew letters'
- },
- {
- word: '1995',
- grammarForm: 'תחילית',
- expected: '־1995',
- description: 'Add a hyphen (maqaf) before numbers'
- }
- ],
+ he: [
+ {
+ word: 'ויקיפדיה',
+ grammarForm: 'prefixed',
+ expected: 'וויקיפדיה',
+ description: 'Duplicate the "Waw" if prefixed'
+ },
+ {
+ word: 'וולפגנג',
+ grammarForm: 'prefixed',
+ expected: 'וולפגנג',
+ description: 'Duplicate the "Waw" if prefixed, but not if it is already duplicated.'
+ },
+ {
+ word: 'הקובץ',
+ grammarForm: 'prefixed',
+ expected: 'קובץ',
+ description: 'Remove the "He" if prefixed'
+ },
+ {
+ word: 'Wikipedia',
+ grammarForm: 'תחילית',
+ expected: '־Wikipedia',
+ description: 'GAdd a hyphen (maqaf) before non-Hebrew letters'
+ },
+ {
+ word: '1995',
+ grammarForm: 'תחילית',
+ expected: '־1995',
+ description: 'Add a hyphen (maqaf) before numbers'
+ }
+ ],
- hsb: [
- {
- word: 'word',
- grammarForm: 'instrumental',
- expected: 'z word',
- description: 'Grammar test for instrumental case'
- },
- {
- word: 'word',
- grammarForm: 'lokatiw',
- expected: 'wo word',
- description: 'Grammar test for lokatiw case'
- }
- ],
+ hsb: [
+ {
+ word: 'word',
+ grammarForm: 'instrumental',
+ expected: 'z word',
+ description: 'Grammar test for instrumental case'
+ },
+ {
+ word: 'word',
+ grammarForm: 'lokatiw',
+ expected: 'wo word',
+ description: 'Grammar test for lokatiw case'
+ }
+ ],
- dsb: [
- {
- word: 'word',
- grammarForm: 'instrumental',
- expected: 'z word',
- description: 'Grammar test for instrumental case'
- },
- {
- word: 'word',
- grammarForm: 'lokatiw',
- expected: 'wo word',
- description: 'Grammar test for lokatiw case'
- }
- ],
+ dsb: [
+ {
+ word: 'word',
+ grammarForm: 'instrumental',
+ expected: 'z word',
+ description: 'Grammar test for instrumental case'
+ },
+ {
+ word: 'word',
+ grammarForm: 'lokatiw',
+ expected: 'wo word',
+ description: 'Grammar test for lokatiw case'
+ }
+ ],
- hy: [
- {
- word: 'Մաունա',
- grammarForm: 'genitive',
- expected: 'Մաունայի',
- description: 'Grammar test for genitive case'
- },
- {
- word: 'հետո',
- grammarForm: 'genitive',
- expected: 'հետոյի',
- description: 'Grammar test for genitive case'
- },
- {
- word: 'գիրք',
- grammarForm: 'genitive',
- expected: 'գրքի',
- description: 'Grammar test for genitive case'
- },
- {
- word: 'ժամանակի',
- grammarForm: 'genitive',
- expected: 'ժամանակիի',
- description: 'Grammar test for genitive case'
- }
- ],
+ hy: [
+ {
+ word: 'Մաունա',
+ grammarForm: 'genitive',
+ expected: 'Մաունայի',
+ description: 'Grammar test for genitive case'
+ },
+ {
+ word: 'հետո',
+ grammarForm: 'genitive',
+ expected: 'հետոյի',
+ description: 'Grammar test for genitive case'
+ },
+ {
+ word: 'գիրք',
+ grammarForm: 'genitive',
+ expected: 'գրքի',
+ description: 'Grammar test for genitive case'
+ },
+ {
+ word: 'ժամանակի',
+ grammarForm: 'genitive',
+ expected: 'ժամանակիի',
+ description: 'Grammar test for genitive case'
+ }
+ ],
- fi: [
- {
- word: 'talo',
- grammarForm: 'genitive',
- expected: 'talon',
- description: 'Grammar test for genitive case'
- },
- {
- word: 'linux',
- grammarForm: 'genitive',
- expected: 'linuxin',
- description: 'Grammar test for genitive case'
- },
- {
- word: 'talo',
- grammarForm: 'elative',
- expected: 'talosta',
- description: 'Grammar test for elative case'
- },
- {
- word: 'pastöroitu',
- grammarForm: 'partitive',
- expected: 'pastöroitua',
- description: 'Grammar test for partitive case'
- },
- {
- word: 'talo',
- grammarForm: 'partitive',
- expected: 'taloa',
- description: 'Grammar test for partitive case'
- },
- {
- word: 'talo',
- grammarForm: 'illative',
- expected: 'taloon',
- description: 'Grammar test for illative case'
- },
- {
- word: 'linux',
- grammarForm: 'inessive',
- expected: 'linuxissa',
- description: 'Grammar test for inessive case'
- }
- ],
+ fi: [
+ {
+ word: 'talo',
+ grammarForm: 'genitive',
+ expected: 'talon',
+ description: 'Grammar test for genitive case'
+ },
+ {
+ word: 'linux',
+ grammarForm: 'genitive',
+ expected: 'linuxin',
+ description: 'Grammar test for genitive case'
+ },
+ {
+ word: 'talo',
+ grammarForm: 'elative',
+ expected: 'talosta',
+ description: 'Grammar test for elative case'
+ },
+ {
+ word: 'pastöroitu',
+ grammarForm: 'partitive',
+ expected: 'pastöroitua',
+ description: 'Grammar test for partitive case'
+ },
+ {
+ word: 'talo',
+ grammarForm: 'partitive',
+ expected: 'taloa',
+ description: 'Grammar test for partitive case'
+ },
+ {
+ word: 'talo',
+ grammarForm: 'illative',
+ expected: 'taloon',
+ description: 'Grammar test for illative case'
+ },
+ {
+ word: 'linux',
+ grammarForm: 'inessive',
+ expected: 'linuxissa',
+ description: 'Grammar test for inessive case'
+ }
+ ],
- ru: [
- {
- word: 'тесть',
- grammarForm: 'genitive',
- expected: 'тестя',
- description: 'Grammar test for genitive case'
- },
- {
- word: 'привилегия',
- grammarForm: 'genitive',
- expected: 'привилегии',
- description: 'Grammar test for genitive case'
- },
- {
- word: 'установка',
- grammarForm: 'genitive',
- expected: 'установки',
- description: 'Grammar test for genitive case'
- },
- {
- word: 'похоти',
- grammarForm: 'genitive',
- expected: 'похотей',
- description: 'Grammar test for genitive case'
- },
- {
- word: 'доводы',
- grammarForm: 'genitive',
- expected: 'доводов',
- description: 'Grammar test for genitive case'
- },
- {
- word: 'песчаник',
- grammarForm: 'genitive',
- expected: 'песчаника',
- description: 'Grammar test for genitive case'
- }
- ],
+ ru: [
+ {
+ word: 'тесть',
+ grammarForm: 'genitive',
+ expected: 'тестя',
+ description: 'Grammar test for genitive case'
+ },
+ {
+ word: 'привилегия',
+ grammarForm: 'genitive',
+ expected: 'привилегии',
+ description: 'Grammar test for genitive case'
+ },
+ {
+ word: 'установка',
+ grammarForm: 'genitive',
+ expected: 'установки',
+ description: 'Grammar test for genitive case'
+ },
+ {
+ word: 'похоти',
+ grammarForm: 'genitive',
+ expected: 'похотей',
+ description: 'Grammar test for genitive case'
+ },
+ {
+ word: 'доводы',
+ grammarForm: 'genitive',
+ expected: 'доводов',
+ description: 'Grammar test for genitive case'
+ },
+ {
+ word: 'песчаник',
+ grammarForm: 'genitive',
+ expected: 'песчаника',
+ description: 'Grammar test for genitive case'
+ }
+ ],
- hu: [
- {
- word: 'Wikipédiá',
- grammarForm: 'rol',
- expected: 'Wikipédiáról',
- description: 'Grammar test for rol case'
- },
- {
- word: 'Wikipédiá',
- grammarForm: 'ba',
- expected: 'Wikipédiába',
- description: 'Grammar test for ba case'
- },
- {
- word: 'Wikipédiá',
- grammarForm: 'k',
- expected: 'Wikipédiák',
- description: 'Grammar test for k case'
- }
- ],
+ hu: [
+ {
+ word: 'Wikipédiá',
+ grammarForm: 'rol',
+ expected: 'Wikipédiáról',
+ description: 'Grammar test for rol case'
+ },
+ {
+ word: 'Wikipédiá',
+ grammarForm: 'ba',
+ expected: 'Wikipédiába',
+ description: 'Grammar test for ba case'
+ },
+ {
+ word: 'Wikipédiá',
+ grammarForm: 'k',
+ expected: 'Wikipédiák',
+ description: 'Grammar test for k case'
+ }
+ ],
- ga: [
- {
- word: 'an Domhnach',
- grammarForm: 'ainmlae',
- expected: 'Dé Domhnaigh',
- description: 'Grammar test for ainmlae case'
- },
- {
- word: 'an Luan',
- grammarForm: 'ainmlae',
- expected: 'Dé Luain',
- description: 'Grammar test for ainmlae case'
- },
- {
- word: 'an Satharn',
- grammarForm: 'ainmlae',
- expected: 'Dé Sathairn',
- description: 'Grammar test for ainmlae case'
- }
- ],
+ ga: [
+ {
+ word: 'an Domhnach',
+ grammarForm: 'ainmlae',
+ expected: 'Dé Domhnaigh',
+ description: 'Grammar test for ainmlae case'
+ },
+ {
+ word: 'an Luan',
+ grammarForm: 'ainmlae',
+ expected: 'Dé Luain',
+ description: 'Grammar test for ainmlae case'
+ },
+ {
+ word: 'an Satharn',
+ grammarForm: 'ainmlae',
+ expected: 'Dé Sathairn',
+ description: 'Grammar test for ainmlae case'
+ }
+ ],
- uk: [
- {
- word: 'тесть',
- grammarForm: 'genitive',
- expected: 'тестя',
- description: 'Grammar test for genitive case'
- },
- {
- word: 'Вікіпедія',
- grammarForm: 'genitive',
- expected: 'Вікіпедії',
- description: 'Grammar test for genitive case'
- },
- {
- word: 'установка',
- grammarForm: 'genitive',
- expected: 'установки',
- description: 'Grammar test for genitive case'
- },
- {
- word: 'похоти',
- grammarForm: 'genitive',
- expected: 'похотей',
- description: 'Grammar test for genitive case'
- },
- {
- word: 'доводы',
- grammarForm: 'genitive',
- expected: 'доводов',
- description: 'Grammar test for genitive case'
- },
- {
- word: 'песчаник',
- grammarForm: 'genitive',
- expected: 'песчаника',
- description: 'Grammar test for genitive case'
- },
- {
- word: 'Вікіпедія',
- grammarForm: 'accusative',
- expected: 'Вікіпедію',
- description: 'Grammar test for accusative case'
- }
- ],
+ uk: [
+ {
+ word: 'тесть',
+ grammarForm: 'genitive',
+ expected: 'тестя',
+ description: 'Grammar test for genitive case'
+ },
+ {
+ word: 'Вікіпедія',
+ grammarForm: 'genitive',
+ expected: 'Вікіпедії',
+ description: 'Grammar test for genitive case'
+ },
+ {
+ word: 'установка',
+ grammarForm: 'genitive',
+ expected: 'установки',
+ description: 'Grammar test for genitive case'
+ },
+ {
+ word: 'похоти',
+ grammarForm: 'genitive',
+ expected: 'похотей',
+ description: 'Grammar test for genitive case'
+ },
+ {
+ word: 'доводы',
+ grammarForm: 'genitive',
+ expected: 'доводов',
+ description: 'Grammar test for genitive case'
+ },
+ {
+ word: 'песчаник',
+ grammarForm: 'genitive',
+ expected: 'песчаника',
+ description: 'Grammar test for genitive case'
+ },
+ {
+ word: 'Вікіпедія',
+ grammarForm: 'accusative',
+ expected: 'Вікіпедію',
+ description: 'Grammar test for accusative case'
+ }
+ ],
- sl: [
- {
- word: 'word',
- grammarForm: 'orodnik',
- expected: 'z word',
- description: 'Grammar test for orodnik case'
- },
- {
- word: 'word',
- grammarForm: 'mestnik',
- expected: 'o word',
- description: 'Grammar test for mestnik case'
- }
- ],
+ sl: [
+ {
+ word: 'word',
+ grammarForm: 'orodnik',
+ expected: 'z word',
+ description: 'Grammar test for orodnik case'
+ },
+ {
+ word: 'word',
+ grammarForm: 'mestnik',
+ expected: 'o word',
+ description: 'Grammar test for mestnik case'
+ }
+ ],
- os: [
- {
- word: 'бæстæ',
- grammarForm: 'genitive',
- expected: 'бæсты',
- description: 'Grammar test for genitive case'
- },
- {
- word: 'бæстæ',
- grammarForm: 'allative',
- expected: 'бæстæм',
- description: 'Grammar test for allative case'
- },
- {
- word: 'Тигр',
- grammarForm: 'dative',
- expected: 'Тигрæн',
- description: 'Grammar test for dative case'
- },
- {
- word: 'цъити',
- grammarForm: 'dative',
- expected: 'цъитийæн',
- description: 'Grammar test for dative case'
- },
- {
- word: 'лæппу',
- grammarForm: 'genitive',
- expected: 'лæппуйы',
- description: 'Grammar test for genitive case'
- },
- {
- word: '2011',
- grammarForm: 'equative',
- expected: '2011-ау',
- description: 'Grammar test for equative case'
- }
- ],
+ os: [
+ {
+ word: 'бæстæ',
+ grammarForm: 'genitive',
+ expected: 'бæсты',
+ description: 'Grammar test for genitive case'
+ },
+ {
+ word: 'бæстæ',
+ grammarForm: 'allative',
+ expected: 'бæстæм',
+ description: 'Grammar test for allative case'
+ },
+ {
+ word: 'Тигр',
+ grammarForm: 'dative',
+ expected: 'Тигрæн',
+ description: 'Grammar test for dative case'
+ },
+ {
+ word: 'цъити',
+ grammarForm: 'dative',
+ expected: 'цъитийæн',
+ description: 'Grammar test for dative case'
+ },
+ {
+ word: 'лæппу',
+ grammarForm: 'genitive',
+ expected: 'лæппуйы',
+ description: 'Grammar test for genitive case'
+ },
+ {
+ word: '2011',
+ grammarForm: 'equative',
+ expected: '2011-ау',
+ description: 'Grammar test for equative case'
+ }
+ ],
- la: [
- {
- word: 'Translatio',
- grammarForm: 'genitive',
- expected: 'Translationis',
- description: 'Grammar test for genitive case'
- },
- {
- word: 'Translatio',
- grammarForm: 'accusative',
- expected: 'Translationem',
- description: 'Grammar test for accusative case'
- },
- {
- word: 'Translatio',
- grammarForm: 'ablative',
- expected: 'Translatione',
- description: 'Grammar test for ablative case'
- }
- ]
-};
+ la: [
+ {
+ word: 'Translatio',
+ grammarForm: 'genitive',
+ expected: 'Translationis',
+ description: 'Grammar test for genitive case'
+ },
+ {
+ word: 'Translatio',
+ grammarForm: 'accusative',
+ expected: 'Translationem',
+ description: 'Grammar test for accusative case'
+ },
+ {
+ word: 'Translatio',
+ grammarForm: 'ablative',
+ expected: 'Translatione',
+ description: 'Grammar test for ablative case'
+ }
+ ]
+ };
-$.each( grammarTests, function ( langCode, test ) {
- if ( langCode === mw.config.get( 'wgUserLanguage' ) ) {
- grammarTest( langCode, test );
- }
-});
+ $.each( grammarTests, function ( langCode, test ) {
+ if ( langCode === mw.config.get( 'wgUserLanguage' ) ) {
+ grammarTest( langCode, test );
+ }
+ });
+}( mediaWiki, jQuery ) );
-( function ( mw ) {
+( function ( mw, $ ) {
QUnit.module( 'mediawiki', QUnit.newMwEnvironment() );
// /sample/awesome.js declares the "mw.loader.testCallback" function
// which contains a call to start() and ok()
- assert.strictEqual( isAwesomeDone, true, "test.callback module should've caused isAwesomeDone to be true" );
+ assert.strictEqual( isAwesomeDone, true, 'test.callback module should\'ve caused isAwesomeDone to be true' );
delete mw.loader.testCallback;
}, function () {
mw.loader.using(
['test.module7'],
function () {
- assert.ok( false, "Success fired despite missing dependency" );
- assert.ok( true , "QUnit expected() count dummy" );
+ assert.ok( false, 'Success fired despite missing dependency' );
+ assert.ok( true , 'QUnit expected() count dummy' );
},
function ( e, dependencies ) {
assert.strictEqual( $.isArray( dependencies ), true, 'Expected array of dependencies' );
mw.loader.using(
['test.module9'],
function () {
- assert.ok( false, "Success fired despite missing dependency" );
- assert.ok( true , "QUnit expected() count dummy" );
+ assert.ok( false, 'Success fired despite missing dependency' );
+ assert.ok( true , 'QUnit expected() count dummy' );
},
function ( e, dependencies ) {
assert.strictEqual( $.isArray( dependencies ), true, 'Expected array of dependencies' );
});
-}( mediaWiki ) );
+}( mediaWiki, jQuery ) );
-( function ( mw ) {
+( function ( mw, $ ) {
QUnit.module( 'mediawiki.user', QUnit.newMwEnvironment() );
QUnit.asyncTest( 'getRights', 1, function ( assert ) {
mw.user.getRights( function ( rights ) {
- // First group should always be '*'
assert.equal( $.type( rights ), 'array', 'Callback gets an array' );
QUnit.start();
});
});
-}( mediaWiki ) );
+}( mediaWiki, jQuery ) );
-QUnit.module( 'mediawiki.util', QUnit.newMwEnvironment() );
-
-QUnit.test( 'rawurlencode', 1, function ( assert ) {
- assert.equal( mw.util.rawurlencode( 'Test:A & B/Here' ), 'Test%3AA%20%26%20B%2FHere' );
-});
-
-QUnit.test( 'wikiUrlencode', 1, function ( assert ) {
- assert.equal( mw.util.wikiUrlencode( 'Test:A & B/Here' ), 'Test:A_%26_B/Here' );
-});
-
-QUnit.test( 'wikiGetlink', 3, function ( assert ) {
- // Not part of startUp module
- mw.config.set( 'wgArticlePath', '/wiki/$1' );
- mw.config.set( 'wgPageName', 'Foobar' );
-
- var hrefA = mw.util.wikiGetlink( 'Sandbox' );
- assert.equal( hrefA, '/wiki/Sandbox', 'Simple title; Get link for "Sandbox"' );
-
- var hrefB = mw.util.wikiGetlink( 'Foo:Sandbox ? 5+5=10 ! (test)/subpage' );
- assert.equal( hrefB, '/wiki/Foo:Sandbox_%3F_5%2B5%3D10_%21_%28test%29/subpage',
- 'Advanced title; Get link for "Foo:Sandbox ? 5+5=10 ! (test)/subpage"' );
-
- var hrefC = mw.util.wikiGetlink();
- assert.equal( hrefC, '/wiki/Foobar', 'Default title; Get link for current page ("Foobar")' );
-});
-
-QUnit.test( 'wikiScript', 4, function ( assert ) {
- mw.config.set({
- 'wgScript': '/w/i.php', // customized wgScript for bug 39103
- 'wgLoadScript': '/w/l.php', // customized wgLoadScript for bug 39103
- 'wgScriptPath': '/w',
- 'wgScriptExtension': '.php'
+( function ( mw, $ ) {
+ QUnit.module( 'mediawiki.util', QUnit.newMwEnvironment() );
+
+ QUnit.test( 'rawurlencode', 1, function ( assert ) {
+ assert.equal( mw.util.rawurlencode( 'Test:A & B/Here' ), 'Test%3AA%20%26%20B%2FHere' );
+ });
+
+ QUnit.test( 'wikiUrlencode', 1, function ( assert ) {
+ assert.equal( mw.util.wikiUrlencode( 'Test:A & B/Here' ), 'Test:A_%26_B/Here' );
});
- assert.equal( mw.util.wikiScript(), mw.config.get( 'wgScript' ), 'wikiScript() returns wgScript' );
- assert.equal( mw.util.wikiScript( 'index' ), mw.config.get( 'wgScript' ), "wikiScript( 'index' ) returns wgScript" );
- assert.equal( mw.util.wikiScript( 'load' ), mw.config.get( 'wgLoadScript' ), "wikiScript( 'load' ) returns wgLoadScript" );
- assert.equal( mw.util.wikiScript( 'api' ), '/w/api.php', 'API path' );
-});
-
-QUnit.test( 'addCSS', 3, function ( assert ) {
- var $testEl = $( '<div>' ).attr( 'id', 'mw-addcsstest' ).appendTo( '#qunit-fixture' );
-
- var style = mw.util.addCSS( '#mw-addcsstest { visibility: hidden; }' );
- assert.equal( typeof style, 'object', 'addCSS returned an object' );
- assert.strictEqual( style.disabled, false, 'property "disabled" is available and set to false' );
-
- assert.equal( $testEl.css( 'visibility' ), 'hidden', 'Added style properties are in effect' );
-
- // Clean up
- $( style.ownerNode ).remove();
-});
-
-QUnit.asyncTest( 'toggleToc', 4, function ( assert ) {
- assert.strictEqual( mw.util.toggleToc(), null, 'Return null if there is no table of contents on the page.' );
-
- var tocHtml =
- '<table id="toc" class="toc"><tr><td>' +
- '<div id="toctitle">' +
- '<h2>Contents</h2>' +
- '<span class="toctoggle"> [<a href="#" class="internal" id="togglelink">Hide</a> ]</span>' +
- '</div>' +
- '<ul><li></li></ul>' +
- '</td></tr></table>',
- $toc = $(tocHtml).appendTo( '#qunit-fixture' ),
+ QUnit.test( 'wikiGetlink', 3, function ( assert ) {
+ // Not part of startUp module
+ mw.config.set( 'wgArticlePath', '/wiki/$1' );
+ mw.config.set( 'wgPageName', 'Foobar' );
+
+ var href = mw.util.wikiGetlink( 'Sandbox' );
+ assert.equal( href, '/wiki/Sandbox', 'Simple title; Get link for "Sandbox"' );
+
+ href = mw.util.wikiGetlink( 'Foo:Sandbox ? 5+5=10 ! (test)/subpage' );
+ assert.equal( href, '/wiki/Foo:Sandbox_%3F_5%2B5%3D10_%21_%28test%29/subpage',
+ 'Advanced title; Get link for "Foo:Sandbox ? 5+5=10 ! (test)/subpage"' );
+
+ href = mw.util.wikiGetlink();
+ assert.equal( href, '/wiki/Foobar', 'Default title; Get link for current page ("Foobar")' );
+ });
+
+ QUnit.test( 'wikiScript', 4, function ( assert ) {
+ mw.config.set({
+ 'wgScript': '/w/i.php', // customized wgScript for bug 39103
+ 'wgLoadScript': '/w/l.php', // customized wgLoadScript for bug 39103
+ 'wgScriptPath': '/w',
+ 'wgScriptExtension': '.php'
+ });
+
+ assert.equal( mw.util.wikiScript(), mw.config.get( 'wgScript' ),
+ 'wikiScript() returns wgScript'
+ );
+ assert.equal( mw.util.wikiScript( 'index' ), mw.config.get( 'wgScript' ),
+ 'wikiScript( index ) returns wgScript'
+ );
+ assert.equal( mw.util.wikiScript( 'load' ), mw.config.get( 'wgLoadScript' ),
+ 'wikiScript( load ) returns wgLoadScript'
+ );
+ assert.equal( mw.util.wikiScript( 'api' ), '/w/api.php', 'API path' );
+ });
+
+ QUnit.test( 'addCSS', 3, function ( assert ) {
+ var $el, style;
+ $el = $( '<div>' ).attr( 'id', 'mw-addcsstest' ).appendTo( '#qunit-fixture' );
+
+ style = mw.util.addCSS( '#mw-addcsstest { visibility: hidden; }' );
+ assert.equal( typeof style, 'object', 'addCSS returned an object' );
+ assert.strictEqual( style.disabled, false, 'property "disabled" is available and set to false' );
+
+ assert.equal( $el.css( 'visibility' ), 'hidden', 'Added style properties are in effect' );
+
+ // Clean up
+ $( style.ownerNode ).remove();
+ });
+
+ QUnit.asyncTest( 'toggleToc', 4, function ( assert ) {
+ var tocHtml, $toggleLink;
+
+ function actionC() {
+ QUnit.start();
+ }
+
+ function actionB() {
+ assert.strictEqual( mw.util.toggleToc( $toggleLink, actionC ), true, 'Return boolean true if the TOC is now visible.' );
+ }
+
+ function actionA() {
+ assert.strictEqual( mw.util.toggleToc( $toggleLink, actionB ), false, 'Return boolean false if the TOC is now hidden.' );
+ }
+
+ assert.strictEqual( mw.util.toggleToc(), null, 'Return null if there is no table of contents on the page.' );
+
+ tocHtml =
+ '<table id="toc" class="toc"><tr><td>' +
+ '<div id="toctitle">' +
+ '<h2>Contents</h2>' +
+ '<span class="toctoggle"> [<a href="#" class="internal" id="togglelink">Hide</a> ]</span>' +
+ '</div>' +
+ '<ul><li></li></ul>' +
+ '</td></tr></table>';
+ $(tocHtml).appendTo( '#qunit-fixture' ),
$toggleLink = $( '#togglelink' );
- assert.strictEqual( $toggleLink.length, 1, 'Toggle link is appended to the page.' );
-
- var actionC = function() {
- QUnit.start();
- };
- var actionB = function() {
- assert.strictEqual( mw.util.toggleToc( $toggleLink, actionC ), true, 'Return boolean true if the TOC is now visible.' );
- };
- var actionA = function() {
- assert.strictEqual( mw.util.toggleToc( $toggleLink, actionB ), false, 'Return boolean false if the TOC is now hidden.' );
- };
-
- actionA();
-});
-
-QUnit.test( 'getParamValue', 5, function ( assert ) {
- var url1 = 'http://example.org/?foo=wrong&foo=right#&foo=bad';
-
- assert.equal( mw.util.getParamValue( 'foo', url1 ), 'right', 'Use latest one, ignore hash' );
- assert.strictEqual( mw.util.getParamValue( 'bar', url1 ), null, 'Return null when not found' );
-
- var url2 = 'http://example.org/#&foo=bad';
- assert.strictEqual( mw.util.getParamValue( 'foo', url2 ), null, 'Ignore hash if param is not in querystring but in hash (bug 27427)' );
-
- var url3 = 'example.org?' + $.param({ 'TEST': 'a b+c' });
- assert.strictEqual( mw.util.getParamValue( 'TEST', url3 ), 'a b+c', 'Bug 30441: getParamValue must understand "+" encoding of space' );
-
- var url4 = 'example.org?' + $.param({ 'TEST': 'a b+c d' }); // check for sloppy code from r95332 :)
- assert.strictEqual( mw.util.getParamValue( 'TEST', url4 ), 'a b+c d', 'Bug 30441: getParamValue must understand "+" encoding of space (multiple spaces)' );
-});
-
-QUnit.test( 'tooltipAccessKey', 3, function ( assert ) {
- assert.equal( typeof mw.util.tooltipAccessKeyPrefix, 'string', 'mw.util.tooltipAccessKeyPrefix must be a string' );
- assert.ok( mw.util.tooltipAccessKeyRegexp instanceof RegExp, 'mw.util.tooltipAccessKeyRegexp instance of RegExp' );
- assert.ok( mw.util.updateTooltipAccessKeys, 'mw.util.updateTooltipAccessKeys' );
-});
-
-QUnit.test( '$content', 2, function ( assert ) {
- assert.ok( mw.util.$content instanceof jQuery, 'mw.util.$content instance of jQuery' );
- assert.strictEqual( mw.util.$content.length, 1, 'mw.util.$content must have length of 1' );
-});
-
-
-/**
- * Portlet names are prefixed with 'p-test' to avoid conflict with core
- * when running the test suite under a wiki page.
- * Previously, test elements where invisible to the selector since only
- * one element can have a given id.
- */
-QUnit.test( 'addPortletLink', 8, function ( assert ) {
- var pTestTb, pCustom, vectorTabs, tbRL, cuQuux, $cuQuux, tbMW, $tbMW, tbRLDM, caFoo;
- pTestTb = '\
- <div class="portlet" id="p-test-tb">\
- <h5>Toolbox</h5>\
- <ul class="body"></ul>\
- </div>';
- pCustom = '\
- <div class="portlet" id="p-test-custom">\
- <h5>Views</h5>\
- <ul class="body">\
- <li id="c-foo"><a href="#">Foo</a></li>\
- <li id="c-barmenu">\
- <ul>\
- <li id="c-bar-baz"><a href="#">Baz</a></a>\
- </ul>\
- </li>\
- </ul>\
- </div>';
- vectorTabs = '\
- <div id="p-test-views" class="vectorTabs">\
- <h5>Views</h5>\
- <ul></ul>\
- </div>';
-
- $( '#qunit-fixture' ).append( pTestTb, pCustom, vectorTabs );
-
- tbRL = mw.util.addPortletLink( 'p-test-tb', '//mediawiki.org/wiki/ResourceLoader',
- 'ResourceLoader', 't-rl', 'More info about ResourceLoader on MediaWiki.org ', 'l' );
-
- assert.ok( $.isDomElement( tbRL ), 'addPortletLink returns a valid DOM Element according to $.isDomElement' );
-
- tbMW = mw.util.addPortletLink( 'p-test-tb', '//mediawiki.org/',
- 'MediaWiki.org', 't-mworg', 'Go to MediaWiki.org ', 'm', tbRL );
- $tbMW = $( tbMW );
-
-
- assert.equal( $tbMW.attr( 'id' ), 't-mworg', 'Link has correct ID set' );
- assert.equal( $tbMW.closest( '.portlet' ).attr( 'id' ), 'p-test-tb', 'Link was inserted within correct portlet' );
- assert.equal( $tbMW.next().attr( 'id' ), 't-rl', 'Link is in the correct position (by passing nextnode)' );
-
- cuQuux = mw.util.addPortletLink( 'p-test-custom', '#', 'Quux' );
- $cuQuux = $(cuQuux);
-
- assert.equal(
- $( '#p-test-custom #c-barmenu ul li' ).length,
- 1,
- 'addPortletLink did not add the item to all <ul> elements in the portlet (bug 35082)'
- );
-
- tbRLDM = mw.util.addPortletLink( 'p-test-tb', '//mediawiki.org/wiki/RL/DM',
- 'Default modules', 't-rldm', 'List of all default modules ', 'd', '#t-rl' );
-
- assert.equal( $( tbRLDM ).next().attr( 'id' ), 't-rl', 'Link is in the correct position (by passing CSS selector)' );
-
- caFoo = mw.util.addPortletLink( 'p-test-views', '#', 'Foo' );
-
- assert.strictEqual( $tbMW.find( 'span').length, 0, 'No <span> element should be added for porlets without vectorTabs class.' );
- assert.strictEqual( $( caFoo ).find( 'span').length, 1, 'A <span> element should be added for porlets with vectorTabs class.' );
-});
-
-QUnit.test( 'jsMessage', 1, function ( assert ) {
- var a = mw.util.jsMessage( "MediaWiki is <b>Awesome</b>." );
- assert.ok( a, 'Basic checking of return value' );
-
- // Clean up
- $( '#mw-js-message' ).remove();
-});
-
-QUnit.test( 'validateEmail', 6, function ( assert ) {
- assert.strictEqual( mw.util.validateEmail( "" ), null, 'Should return null for empty string ' );
- assert.strictEqual( mw.util.validateEmail( "user@localhost" ), true, 'Return true for a valid e-mail address' );
-
- // testEmailWithCommasAreInvalids
- assert.strictEqual( mw.util.validateEmail( "user,foo@example.org" ), false, 'Emails with commas are invalid' );
- assert.strictEqual( mw.util.validateEmail( "userfoo@ex,ample.org" ), false, 'Emails with commas are invalid' );
-
- // testEmailWithHyphens
- assert.strictEqual( mw.util.validateEmail( "user-foo@example.org" ), true, 'Emails may contain a hyphen' );
- assert.strictEqual( mw.util.validateEmail( "userfoo@ex-ample.org" ), true, 'Emails may contain a hyphen' );
-});
-
-QUnit.test( 'isIPv6Address', 40, function ( assert ) {
- // Shortcuts
- function assertFalseIPv6( addy, summary ) {
- return assert.strictEqual( mw.util.isIPv6Address( addy ), false, summary );
- }
- function assertTrueIPv6( addy, summary ) {
- return assert.strictEqual( mw.util.isIPv6Address( addy ), true, summary );
- }
-
- // Based on IPTest.php > testisIPv6
- assertFalseIPv6( ':fc:100::', 'IPv6 starting with lone ":"' );
- assertFalseIPv6( 'fc:100:::', 'IPv6 ending with a ":::"' );
- assertFalseIPv6( 'fc:300', 'IPv6 with only 2 words' );
- assertFalseIPv6( 'fc:100:300', 'IPv6 with only 3 words' );
-
- $.each(
- ['fc:100::',
- 'fc:100:a::',
- 'fc:100:a:d::',
- 'fc:100:a:d:1::',
- 'fc:100:a:d:1:e::',
- 'fc:100:a:d:1:e:ac::'], function ( i, addy ){
- assertTrueIPv6( addy, addy + ' is a valid IP' );
+ assert.strictEqual( $toggleLink.length, 1, 'Toggle link is appended to the page.' );
+
+ actionA();
});
- assertFalseIPv6( 'fc:100:a:d:1:e:ac:0::', 'IPv6 with 8 words ending with "::"' );
- assertFalseIPv6( 'fc:100:a:d:1:e:ac:0:1::', 'IPv6 with 9 words ending with "::"' );
-
- assertFalseIPv6( ':::' );
- assertFalseIPv6( '::0:', 'IPv6 ending in a lone ":"' );
-
- assertTrueIPv6( '::', 'IPv6 zero address' );
- $.each(
- ['::0',
- '::fc',
- '::fc:100',
- '::fc:100:a',
- '::fc:100:a:d',
- '::fc:100:a:d:1',
- '::fc:100:a:d:1:e',
- '::fc:100:a:d:1:e:ac',
-
- 'fc:100:a:d:1:e:ac:0'], function ( i, addy ){
- assertTrueIPv6( addy, addy + ' is a valid IP' );
+ QUnit.test( 'getParamValue', 5, function ( assert ) {
+ var url;
+
+ url = 'http://example.org/?foo=wrong&foo=right#&foo=bad';
+ assert.equal( mw.util.getParamValue( 'foo', url ), 'right', 'Use latest one, ignore hash' );
+ assert.strictEqual( mw.util.getParamValue( 'bar', url ), null, 'Return null when not found' );
+
+ url = 'http://example.org/#&foo=bad';
+ assert.strictEqual( mw.util.getParamValue( 'foo', url ), null, 'Ignore hash if param is not in querystring but in hash (bug 27427)' );
+
+ url = 'example.org?' + $.param({ 'TEST': 'a b+c' });
+ assert.strictEqual( mw.util.getParamValue( 'TEST', url ), 'a b+c', 'Bug 30441: getParamValue must understand "+" encoding of space' );
+
+ url = 'example.org?' + $.param({ 'TEST': 'a b+c d' }); // check for sloppy code from r95332 :)
+ assert.strictEqual( mw.util.getParamValue( 'TEST', url ), 'a b+c d', 'Bug 30441: getParamValue must understand "+" encoding of space (multiple spaces)' );
+ });
+
+ QUnit.test( 'tooltipAccessKey', 3, function ( assert ) {
+ assert.equal( typeof mw.util.tooltipAccessKeyPrefix, 'string', 'mw.util.tooltipAccessKeyPrefix must be a string' );
+ assert.ok( mw.util.tooltipAccessKeyRegexp instanceof RegExp, 'mw.util.tooltipAccessKeyRegexp instance of RegExp' );
+ assert.ok( mw.util.updateTooltipAccessKeys, 'mw.util.updateTooltipAccessKeys' );
+ });
+
+ QUnit.test( '$content', 2, function ( assert ) {
+ assert.ok( mw.util.$content instanceof jQuery, 'mw.util.$content instance of jQuery' );
+ assert.strictEqual( mw.util.$content.length, 1, 'mw.util.$content must have length of 1' );
+ });
+
+
+ /**
+ * Portlet names are prefixed with 'p-test' to avoid conflict with core
+ * when running the test suite under a wiki page.
+ * Previously, test elements where invisible to the selector since only
+ * one element can have a given id.
+ */
+ QUnit.test( 'addPortletLink', 8, function ( assert ) {
+ var pTestTb, pCustom, vectorTabs, tbRL, cuQuux, $cuQuux, tbMW, $tbMW, tbRLDM, caFoo;
+
+ pTestTb = '\
+ <div class="portlet" id="p-test-tb">\
+ <h5>Toolbox</h5>\
+ <ul class="body"></ul>\
+ </div>';
+ pCustom = '\
+ <div class="portlet" id="p-test-custom">\
+ <h5>Views</h5>\
+ <ul class="body">\
+ <li id="c-foo"><a href="#">Foo</a></li>\
+ <li id="c-barmenu">\
+ <ul>\
+ <li id="c-bar-baz"><a href="#">Baz</a></a>\
+ </ul>\
+ </li>\
+ </ul>\
+ </div>';
+ vectorTabs = '\
+ <div id="p-test-views" class="vectorTabs">\
+ <h5>Views</h5>\
+ <ul></ul>\
+ </div>';
+
+ $( '#qunit-fixture' ).append( pTestTb, pCustom, vectorTabs );
+
+ tbRL = mw.util.addPortletLink( 'p-test-tb', '//mediawiki.org/wiki/ResourceLoader',
+ 'ResourceLoader', 't-rl', 'More info about ResourceLoader on MediaWiki.org ', 'l' );
+
+ assert.ok( $.isDomElement( tbRL ), 'addPortletLink returns a valid DOM Element according to $.isDomElement' );
+
+ tbMW = mw.util.addPortletLink( 'p-test-tb', '//mediawiki.org/',
+ 'MediaWiki.org', 't-mworg', 'Go to MediaWiki.org ', 'm', tbRL );
+ $tbMW = $( tbMW );
+
+
+ assert.equal( $tbMW.attr( 'id' ), 't-mworg', 'Link has correct ID set' );
+ assert.equal( $tbMW.closest( '.portlet' ).attr( 'id' ), 'p-test-tb', 'Link was inserted within correct portlet' );
+ assert.equal( $tbMW.next().attr( 'id' ), 't-rl', 'Link is in the correct position (by passing nextnode)' );
+
+ cuQuux = mw.util.addPortletLink( 'p-test-custom', '#', 'Quux' );
+ $cuQuux = $(cuQuux);
+
+ assert.equal(
+ $( '#p-test-custom #c-barmenu ul li' ).length,
+ 1,
+ 'addPortletLink did not add the item to all <ul> elements in the portlet (bug 35082)'
+ );
+
+ tbRLDM = mw.util.addPortletLink( 'p-test-tb', '//mediawiki.org/wiki/RL/DM',
+ 'Default modules', 't-rldm', 'List of all default modules ', 'd', '#t-rl' );
+
+ assert.equal( $( tbRLDM ).next().attr( 'id' ), 't-rl', 'Link is in the correct position (by passing CSS selector)' );
+
+ caFoo = mw.util.addPortletLink( 'p-test-views', '#', 'Foo' );
+
+ assert.strictEqual( $tbMW.find( 'span').length, 0, 'No <span> element should be added for porlets without vectorTabs class.' );
+ assert.strictEqual( $( caFoo ).find( 'span').length, 1, 'A <span> element should be added for porlets with vectorTabs class.' );
});
- assertFalseIPv6( '::fc:100:a:d:1:e:ac:0', 'IPv6 with "::" and 8 words' );
- assertFalseIPv6( '::fc:100:a:d:1:e:ac:0:1', 'IPv6 with 9 words' );
-
- assertFalseIPv6( ':fc::100', 'IPv6 starting with lone ":"' );
- assertFalseIPv6( 'fc::100:', 'IPv6 ending with lone ":"' );
- assertFalseIPv6( 'fc:::100', 'IPv6 with ":::" in the middle' );
-
- assertTrueIPv6( 'fc::100', 'IPv6 with "::" and 2 words' );
- assertTrueIPv6( 'fc::100:a', 'IPv6 with "::" and 3 words' );
- assertTrueIPv6( 'fc::100:a:d', 'IPv6 with "::" and 4 words' );
- assertTrueIPv6( 'fc::100:a:d:1', 'IPv6 with "::" and 5 words' );
- assertTrueIPv6( 'fc::100:a:d:1:e', 'IPv6 with "::" and 6 words' );
- assertTrueIPv6( 'fc::100:a:d:1:e:ac', 'IPv6 with "::" and 7 words' );
- assertTrueIPv6( '2001::df', 'IPv6 with "::" and 2 words' );
- assertTrueIPv6( '2001:5c0:1400:a::df', 'IPv6 with "::" and 5 words' );
- assertTrueIPv6( '2001:5c0:1400:a::df:2', 'IPv6 with "::" and 6 words' );
-
- assertFalseIPv6( 'fc::100:a:d:1:e:ac:0', 'IPv6 with "::" and 8 words' );
- assertFalseIPv6( 'fc::100:a:d:1:e:ac:0:1', 'IPv6 with 9 words' );
-});
-
-QUnit.test( 'isIPv4Address', 11, function ( assert ) {
- // Shortcuts
- function assertFalseIPv4( addy, summary ) {
- assert.strictEqual( mw.util.isIPv4Address( addy ), false, summary );
- }
- function assertTrueIPv4( addy, summary ) {
- assert.strictEqual( mw.util.isIPv4Address( addy ), true, summary );
- }
-
- // Based on IPTest.php > testisIPv4
- assertFalseIPv4( false, 'Boolean false is not an IP' );
- assertFalseIPv4( true, 'Boolean true is not an IP' );
- assertFalseIPv4( '', 'Empty string is not an IP' );
- assertFalseIPv4( 'abc', '"abc" is not an IP' );
- assertFalseIPv4( ':', 'Colon is not an IP' );
- assertFalseIPv4( '124.24.52', 'IPv4 not enough quads' );
- assertFalseIPv4( '24.324.52.13', 'IPv4 out of range' );
- assertFalseIPv4( '.24.52.13', 'IPv4 starts with period' );
-
- assertTrueIPv4( '124.24.52.13', '124.24.52.134 is a valid IP' );
- assertTrueIPv4( '1.24.52.13', '1.24.52.13 is a valid IP' );
- assertFalseIPv4( '74.24.52.13/20', 'IPv4 ranges are not recogzized as valid IPs' );
-});
+ QUnit.test( 'jsMessage', 1, function ( assert ) {
+ var a = mw.util.jsMessage( 'MediaWiki is <b>Awesome</b>.' );
+ assert.ok( a, 'Basic checking of return value' );
+
+ // Clean up
+ $( '#mw-js-message' ).remove();
+ });
+
+ QUnit.test( 'validateEmail', 6, function ( assert ) {
+ assert.strictEqual( mw.util.validateEmail( '' ), null, 'Should return null for empty string ' );
+ assert.strictEqual( mw.util.validateEmail( 'user@localhost' ), true, 'Return true for a valid e-mail address' );
+
+ // testEmailWithCommasAreInvalids
+ assert.strictEqual( mw.util.validateEmail( 'user,foo@example.org' ), false, 'Emails with commas are invalid' );
+ assert.strictEqual( mw.util.validateEmail( 'userfoo@ex,ample.org' ), false, 'Emails with commas are invalid' );
+
+ // testEmailWithHyphens
+ assert.strictEqual( mw.util.validateEmail( 'user-foo@example.org' ), true, 'Emails may contain a hyphen' );
+ assert.strictEqual( mw.util.validateEmail( 'userfoo@ex-ample.org' ), true, 'Emails may contain a hyphen' );
+ });
+
+ QUnit.test( 'isIPv6Address', 40, function ( assert ) {
+ // Shortcuts
+ function assertFalseIPv6( addy, summary ) {
+ return assert.strictEqual( mw.util.isIPv6Address( addy ), false, summary );
+ }
+ function assertTrueIPv6( addy, summary ) {
+ return assert.strictEqual( mw.util.isIPv6Address( addy ), true, summary );
+ }
+
+ // Based on IPTest.php > testisIPv6
+ assertFalseIPv6( ':fc:100::', 'IPv6 starting with lone ":"' );
+ assertFalseIPv6( 'fc:100:::', 'IPv6 ending with a ":::"' );
+ assertFalseIPv6( 'fc:300', 'IPv6 with only 2 words' );
+ assertFalseIPv6( 'fc:100:300', 'IPv6 with only 3 words' );
+
+ $.each(
+ ['fc:100::',
+ 'fc:100:a::',
+ 'fc:100:a:d::',
+ 'fc:100:a:d:1::',
+ 'fc:100:a:d:1:e::',
+ 'fc:100:a:d:1:e:ac::'], function ( i, addy ){
+ assertTrueIPv6( addy, addy + ' is a valid IP' );
+ });
+
+ assertFalseIPv6( 'fc:100:a:d:1:e:ac:0::', 'IPv6 with 8 words ending with "::"' );
+ assertFalseIPv6( 'fc:100:a:d:1:e:ac:0:1::', 'IPv6 with 9 words ending with "::"' );
+
+ assertFalseIPv6( ':::' );
+ assertFalseIPv6( '::0:', 'IPv6 ending in a lone ":"' );
+
+ assertTrueIPv6( '::', 'IPv6 zero address' );
+ $.each(
+ ['::0',
+ '::fc',
+ '::fc:100',
+ '::fc:100:a',
+ '::fc:100:a:d',
+ '::fc:100:a:d:1',
+ '::fc:100:a:d:1:e',
+ '::fc:100:a:d:1:e:ac',
+
+ 'fc:100:a:d:1:e:ac:0'], function ( i, addy ){
+ assertTrueIPv6( addy, addy + ' is a valid IP' );
+ });
+
+ assertFalseIPv6( '::fc:100:a:d:1:e:ac:0', 'IPv6 with "::" and 8 words' );
+ assertFalseIPv6( '::fc:100:a:d:1:e:ac:0:1', 'IPv6 with 9 words' );
+
+ assertFalseIPv6( ':fc::100', 'IPv6 starting with lone ":"' );
+ assertFalseIPv6( 'fc::100:', 'IPv6 ending with lone ":"' );
+ assertFalseIPv6( 'fc:::100', 'IPv6 with ":::" in the middle' );
+
+ assertTrueIPv6( 'fc::100', 'IPv6 with "::" and 2 words' );
+ assertTrueIPv6( 'fc::100:a', 'IPv6 with "::" and 3 words' );
+ assertTrueIPv6( 'fc::100:a:d', 'IPv6 with "::" and 4 words' );
+ assertTrueIPv6( 'fc::100:a:d:1', 'IPv6 with "::" and 5 words' );
+ assertTrueIPv6( 'fc::100:a:d:1:e', 'IPv6 with "::" and 6 words' );
+ assertTrueIPv6( 'fc::100:a:d:1:e:ac', 'IPv6 with "::" and 7 words' );
+ assertTrueIPv6( '2001::df', 'IPv6 with "::" and 2 words' );
+ assertTrueIPv6( '2001:5c0:1400:a::df', 'IPv6 with "::" and 5 words' );
+ assertTrueIPv6( '2001:5c0:1400:a::df:2', 'IPv6 with "::" and 6 words' );
+
+ assertFalseIPv6( 'fc::100:a:d:1:e:ac:0', 'IPv6 with "::" and 8 words' );
+ assertFalseIPv6( 'fc::100:a:d:1:e:ac:0:1', 'IPv6 with 9 words' );
+ });
+
+ QUnit.test( 'isIPv4Address', 11, function ( assert ) {
+ // Shortcuts
+ function assertFalseIPv4( addy, summary ) {
+ assert.strictEqual( mw.util.isIPv4Address( addy ), false, summary );
+ }
+ function assertTrueIPv4( addy, summary ) {
+ assert.strictEqual( mw.util.isIPv4Address( addy ), true, summary );
+ }
+
+ // Based on IPTest.php > testisIPv4
+ assertFalseIPv4( false, 'Boolean false is not an IP' );
+ assertFalseIPv4( true, 'Boolean true is not an IP' );
+ assertFalseIPv4( '', 'Empty string is not an IP' );
+ assertFalseIPv4( 'abc', '"abc" is not an IP' );
+ assertFalseIPv4( ':', 'Colon is not an IP' );
+ assertFalseIPv4( '124.24.52', 'IPv4 not enough quads' );
+ assertFalseIPv4( '24.324.52.13', 'IPv4 out of range' );
+ assertFalseIPv4( '.24.52.13', 'IPv4 starts with period' );
+
+ assertTrueIPv4( '124.24.52.13', '124.24.52.134 is a valid IP' );
+ assertTrueIPv4( '1.24.52.13', '1.24.52.13 is a valid IP' );
+ assertFalseIPv4( '74.24.52.13/20', 'IPv4 ranges are not recogzized as valid IPs' );
+ });
+}( mediaWiki, jQuery ) );