| Index: branches/REL1_17/extensions/CodeReview/CodeReview.i18n.php |
| — | — | @@ -162,8 +162,10 @@ |
| 163 | 163 | 'codereview-email-body3' => 'User "$1" changed the status of $2. |
| 164 | 164 | |
| 165 | 165 | Old Status: $3 |
| 166 | | -New Status: $4', |
| | 166 | +New Status: $4 |
| 167 | 167 | |
| | 168 | +Full URL: $5', |
| | 169 | + |
| 168 | 170 | 'codereview-email-subj4' => '[$1 $2]: New comment added, and revision status changed', |
| 169 | 171 | 'codereview-email-body4' => 'User "$1" changed the status of $2. |
| 170 | 172 | |
| — | — | @@ -205,6 +207,7 @@ |
| 206 | 208 | 'right-codereview-set-status' => 'Change revisions status', |
| 207 | 209 | 'right-codereview-signoff' => 'Sign off on revisions', |
| 208 | 210 | 'right-codereview-link-user' => 'Link authors to wiki users', |
| | 211 | + 'right-codereview-associate' => 'Manage revision associations', |
| 209 | 212 | |
| 210 | 213 | 'specialpages-group-developer' => 'Developer tools', |
| 211 | 214 | ); |
| Index: branches/REL1_17/extensions/CodeReview/backend/CodeRevision.php |
| — | — | @@ -444,14 +444,14 @@ |
| 445 | 445 | } |
| 446 | 446 | |
| 447 | 447 | /** |
| 448 | | - * @param $subject |
| 449 | | - * @param $body |
| | 448 | + * @param $subject String |
| | 449 | + * @param $body String |
| 450 | 450 | * @return void |
| 451 | 451 | */ |
| 452 | 452 | public function emailNotifyUsersOfChanges( $subject, $body ) { |
| 453 | 453 | // Give email notices to committer and commenters |
| 454 | 454 | global $wgCodeReviewENotif, $wgEnableEmail, $wgCodeReviewCommentWatcherEmail, |
| 455 | | - $wgCodeReviewCommentWatcherName, $wgUser; |
| | 455 | + $wgCodeReviewCommentWatcherName; |
| 456 | 456 | if ( !$wgCodeReviewENotif || !$wgEnableEmail ) { |
| 457 | 457 | return; |
| 458 | 458 | } |
| — | — | @@ -487,7 +487,7 @@ |
| 488 | 488 | $lang = array( 'language' => $user->getOption( 'language' ) ); |
| 489 | 489 | |
| 490 | 490 | $localSubject = wfMsgExt( $subject, $lang, $this->mRepo->getName(), $this->getIdString() ); |
| 491 | | - $localBody = call_user_func_array( 'wfMsgExt', array_merge( array( $body, $lang, $wgUser->getName() ), $args ) ); |
| | 491 | + $localBody = call_user_func_array( 'wfMsgExt', array_merge( array( $body, $lang ), $args ) ); |
| 492 | 492 | |
| 493 | 493 | $user->sendMail( $localSubject, $localBody ); |
| 494 | 494 | } |
| Index: branches/REL1_17/extensions/CodeReview/ui/CodeCommentsListView.php |
| — | — | @@ -67,7 +67,7 @@ |
| 68 | 68 | switch( $name ) { |
| 69 | 69 | case 'cc_rev_id': |
| 70 | 70 | return $this->mView->skin->link( |
| 71 | | - SpecialPage::getTitleFor( 'Code', $this->mRepo->getName() . '/' . $value . '#code-comments' ), |
| | 71 | + SpecialPage::getSafeTitleFor( 'Code', $this->mRepo->getName() . '/' . $value . '#code-comments' ), |
| 72 | 72 | htmlspecialchars( $value ) ); |
| 73 | 73 | case 'cr_status': |
| 74 | 74 | return $this->mView->skin->link( |
| Index: branches/REL1_17/extensions/CodeReview/ui/CodeRevisionCommitter.php |
| — | — | @@ -117,18 +117,18 @@ |
| 118 | 118 | $dbw->commit(); |
| 119 | 119 | |
| 120 | 120 | if ( $statusChanged || $commentAdded ) { |
| | 121 | + $url = $this->mRev->getFullUrl( $commentId ); |
| 121 | 122 | if ( $statusChanged && $commentAdded ) { |
| 122 | | - $url = $this->mRev->getFullUrl( $commentId ); |
| 123 | 123 | $this->mRev->emailNotifyUsersOfChanges( 'codereview-email-subj4', 'codereview-email-body4', |
| 124 | | - $wgUser->getName(), $this->mRev->getIdStringUnique(), $this->mRev->mOldStatus, $this->mRev->mStatus, |
| 125 | | - $url, $this->text |
| | 124 | + $wgUser->getName(), $this->mRev->getIdStringUnique(), $this->mRev->getOldStatus(), |
| | 125 | + $this->mRev->getStatus(), $url, $this->text |
| 126 | 126 | ); |
| 127 | 127 | } else if ( $statusChanged ) { |
| 128 | 128 | $this->mRev->emailNotifyUsersOfChanges( 'codereview-email-subj3', 'codereview-email-body3', |
| 129 | | - $wgUser->getName(), $this->mRev->getIdStringUnique(), $this->mRev->mOldStatus, $this->mRev->mStatus |
| | 129 | + $wgUser->getName(), $this->mRev->getIdStringUnique(), $this->mRev->getOldStatus(), |
| | 130 | + $this->mRev->getStatus(), $url |
| 130 | 131 | ); |
| 131 | 132 | } else if ( $commentAdded ) { |
| 132 | | - $url = $this->mRev->getFullUrl( $commentId ); |
| 133 | 133 | $this->mRev->emailNotifyUsersOfChanges( 'codereview-email-subj', 'codereview-email-body', |
| 134 | 134 | $wgUser->getName(), $url, $this->mRev->getIdStringUnique(), $this->text |
| 135 | 135 | ); |
| Index: branches/REL1_17/extensions/CodeReview/ui/CodeRevisionView.php |
| — | — | @@ -136,12 +136,23 @@ |
| 137 | 137 | "<div class='mw-codereview-diff' id='mw-codereview-diff'>" . $diffHtml . "</div>\n"; |
| 138 | 138 | $html .= $this->formatImgDiff(); |
| 139 | 139 | } |
| | 140 | + |
| 140 | 141 | # Show sign-offs |
| 141 | | - $html .= "<h2 id='code-signoffs'>" . wfMsgHtml( 'code-signoffs' ) . |
| 142 | | - "</h2>\n" . $this->formatSignoffs( $this->canSignoff() ); |
| | 142 | + $userCanSignoff = $this->canSignoff(); |
| | 143 | + $signOffs = $this->mRev->getSignoffs(); |
| | 144 | + if ( count( $signOffs ) || $userCanSignoff ) { |
| | 145 | + $html .= "<h2 id='code-signoffs'>" . wfMsgHtml( 'code-signoffs' ) . |
| | 146 | + "</h2>\n" . $this->formatSignoffs( $signOffs, $userCanSignoff ); |
| | 147 | + } |
| | 148 | + |
| 143 | 149 | # Show code relations |
| 144 | | - $html .= "<h2 id='code-references'>" . wfMsgHtml( 'code-references' ) . |
| 145 | | - "</h2>\n" . $this->formatReferences( $this->canAssociate() ); |
| | 150 | + $userCanAssociate = $this->canAssociate(); |
| | 151 | + $references = $this->mRev->getReferences(); |
| | 152 | + if ( count( $references ) || $userCanAssociate ) { |
| | 153 | + $html .= "<h2 id='code-references'>" . wfMsgHtml( 'code-references' ) . |
| | 154 | + "</h2>\n" . $this->formatReferences( $references, $userCanAssociate ); |
| | 155 | + } |
| | 156 | + |
| 146 | 157 | # Add revision comments |
| 147 | 158 | if ( $comments ) { |
| 148 | 159 | $html .= "<h2 id='code-comments'>" . wfMsgHtml( 'code-comments' ) . |
| — | — | @@ -446,9 +457,9 @@ |
| 447 | 458 | * @param $showButtons bool Whether the buttons to strike and submit sign-offs should be shown |
| 448 | 459 | * @return string HTML |
| 449 | 460 | */ |
| 450 | | - protected function formatSignoffs( $showButtons ) { |
| | 461 | + protected function formatSignoffs( $signOffs, $showButtons ) { |
| 451 | 462 | $signoffs = implode( "\n", |
| 452 | | - array_map( array( $this, 'formatSignoffInline' ), $this->mRev->getSignoffs() ) |
| | 463 | + array_map( array( $this, 'formatSignoffInline' ), $signOffs ) |
| 453 | 464 | ); |
| 454 | 465 | $header = '<th></th>'; |
| 455 | 466 | $header .= '<th>' . wfMsgHtml( 'code-signoff-field-user' ) . '</th>'; |
| — | — | @@ -481,9 +492,9 @@ |
| 482 | 493 | return "<ul class='mw-codereview-changes'>$changes</ul>"; |
| 483 | 494 | } |
| 484 | 495 | |
| 485 | | - protected function formatReferences( $showButtons ) { |
| | 496 | + protected function formatReferences( $references, $showButtons ) { |
| 486 | 497 | $refs = implode( "\n", |
| 487 | | - array_map( array( $this, 'formatReferenceInline' ), $this->mRev->getReferences() ) |
| | 498 | + array_map( array( $this, 'formatReferenceInline' ), $references ) |
| 488 | 499 | ); |
| 489 | 500 | $header = '<th></th>'; |
| 490 | 501 | $header .= '<th>' . wfMsgHtml( 'code-field-id' ) . '</th>'; |
| Property changes on: branches/REL1_17/extensions/CodeReview |
| ___________________________________________________________________ |
| Added: svn:mergeinfo |
| 491 | 502 | Merged /trunk/extensions/CodeReview:r82114,82128,82131-82132,82146,82574 |
| Index: branches/REL1_17/extensions/NewUserMessage/NewUserMessage.i18n.php |
| — | — | @@ -15,6 +15,7 @@ |
| 16 | 16 | $messages['en'] = array( |
| 17 | 17 | 'newusermessage-desc' => "Adds a message to newly created user's talk pages", |
| 18 | 18 | 'newuseredit-summary' => 'Adding [[{{int:newusermessage-template}}|welcome message]] to new user\'s talk page', |
| | 19 | + 'newusermessage-template' => 'Template:Welcome', # The title of the message template |
| 19 | 20 | 'newusermessage-template-subject' => 'Template:Welcome-subject', # Always substituted. Used if LiquidThreads is enabled in the User_talk namespace. Do not translate or duplicate this message to other languages |
| 20 | 21 | 'newusermessage-template-body' => 'Template:Welcome-body', # Used if LiquidThreads is enabled in the User_talk namespace. Do not translate or duplicate this message to other languages |
| 21 | 22 | 'newusermessage-editor' => 'New user message', # The username used for the edit |
| Index: branches/REL1_17/extensions/NewUserMessage/NewUserMessage.class.php |
| — | — | @@ -79,11 +79,16 @@ |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | /** |
| 83 | | - * Produce the text of the message. |
| | 83 | + * Produce the template that contains the text of the message. |
| 84 | 84 | * @returns String |
| 85 | 85 | */ |
| 86 | 86 | static function fetchText() { |
| 87 | | - return self::fetchTemplateIfExists( wfMsg( 'newusermessage-template-body' ) ); |
| | 87 | + $template = wfMsg( 'newusermessage-template-body' ); |
| | 88 | + // Fall back if necessary to the old template |
| | 89 | + if ( !$template ) { |
| | 90 | + $template = wfMsg( 'newusermessage-template' ); |
| | 91 | + } |
| | 92 | + return $template; |
| 88 | 93 | } |
| 89 | 94 | |
| 90 | 95 | /** |
| — | — | @@ -118,9 +123,9 @@ |
| 119 | 124 | $substitute = wfMsgForContent( 'newusermessage-substitute' ); |
| 120 | 125 | |
| 121 | 126 | if ( $substitute ) { |
| 122 | | - $str = "{{subst:{{$str}}}|realName=$realName|name=$name}}"; |
| | 127 | + $str = '{{subst:' . "$str|realName=$realName|name=$name}}"; |
| 123 | 128 | } else { |
| 124 | | - $str = "{{{$str}|realName=$realName|name=$name}}"; |
| | 129 | + $str = '{{' . "$str|realName=$realName|name=$name}}"; |
| 125 | 130 | } |
| 126 | 131 | |
| 127 | 132 | if ( $preparse ) { |
| — | — | @@ -147,11 +152,17 @@ |
| 148 | 153 | $editor = self::fetchEditor(); |
| 149 | 154 | $flags = self::fetchFlags(); |
| 150 | 155 | |
| 151 | | - $subject = self::substString( $subject, $user, $editor, $talk, "preparse" ); |
| 152 | | - $text = self::substString( $text, $user, $editor, $talk ); |
| | 156 | + if ( $subject ) { |
| | 157 | + $subject = self::substString( $subject, $user, $editor, $talk, "preparse" ); |
| | 158 | + } |
| | 159 | + if ( $text ) { |
| | 160 | + $text = self::substString( $text, $user, $editor, $talk ); |
| | 161 | + } |
| 153 | 162 | |
| 154 | | - return $user->leaveUserMessage( $subject, $text, $signature, $editSummary, |
| 155 | | - $editor, $flags ); |
| | 163 | + self::leaveUserMessage( $user, $article, $subject, $text, |
| | 164 | + $signature, $editSummary, $editor, $flags ); |
| | 165 | + |
| | 166 | + return true; |
| 156 | 167 | } |
| 157 | 168 | } |
| 158 | 169 | |
| — | — | @@ -178,4 +189,66 @@ |
| 179 | 190 | $names[] = 'msg:newusermessage-editor'; |
| 180 | 191 | return true; |
| 181 | 192 | } |
| | 193 | + |
| | 194 | + /** |
| | 195 | + * Leave a user a message |
| | 196 | + * @param $subject String the subject of the message |
| | 197 | + * @param $text String the message to leave |
| | 198 | + * @param $signature String Text to leave in the signature |
| | 199 | + * @param $summary String the summary for this change, defaults to |
| | 200 | + * "Leave system message." |
| | 201 | + * @param $editor User The user leaving the message, defaults to |
| | 202 | + * "{{MediaWiki:usermessage-editor}}" |
| | 203 | + * @param $flags Int default edit flags |
| | 204 | + * |
| | 205 | + * @return boolean true if it was successful |
| | 206 | + */ |
| | 207 | + public static function leaveUserMessage( $user, $article, $subject, $text, $signature, |
| | 208 | + $summary, $editor, $flags ) { |
| | 209 | + $text = self::formatUserMessage( $subject, $text, $signature ); |
| | 210 | + $flags = $article->checkFlags( $flags ); |
| | 211 | + |
| | 212 | + if ( $flags & EDIT_UPDATE ) { |
| | 213 | + $text = $article->getContent() . $text; |
| | 214 | + } |
| | 215 | + |
| | 216 | + $dbw = wfGetDB( DB_MASTER ); |
| | 217 | + $dbw->begin(); |
| | 218 | + |
| | 219 | + try { |
| | 220 | + $status = $article->doEdit( $text, $summary, $flags, false, $editor ); |
| | 221 | + } catch ( DBQueryError $e ) { |
| | 222 | + $status = Status::newFatal( 'DB Error' ); |
| | 223 | + } |
| | 224 | + |
| | 225 | + if ( $status->isGood() ) { |
| | 226 | + // Set newtalk with the right user ID |
| | 227 | + $user->setNewtalk( true ); |
| | 228 | + $dbw->commit(); |
| | 229 | + } else { |
| | 230 | + // The article was concurrently created |
| | 231 | + wfDebug( __METHOD__ . ": Error ".$status->getWikiText() ); |
| | 232 | + $dbw->rollback(); |
| | 233 | + } |
| | 234 | + |
| | 235 | + return $status->isGood(); |
| | 236 | + } |
| | 237 | + |
| | 238 | + /** |
| | 239 | + * Format the user message using a hook, a template, or, failing these, a static format. |
| | 240 | + * @param $subject String the subject of the message |
| | 241 | + * @param $text String the content of the message |
| | 242 | + * @param $signature String the signature, if provided. |
| | 243 | + */ |
| | 244 | + static protected function formatUserMessage( $subject, $text, $signature ) { |
| | 245 | + $contents = "\n"; |
| | 246 | + $signature = empty( $signature ) ? "~~~~~" : "{$signature} ~~~~~"; |
| | 247 | + |
| | 248 | + if ( $subject ) { |
| | 249 | + $contents .= "== $subject ==\n"; |
| | 250 | + } |
| | 251 | + $contents .= "\n$text\n\n-- $signature\n"; |
| | 252 | + |
| | 253 | + return $contents; |
| | 254 | + } |
| 182 | 255 | } |
| Property changes on: branches/REL1_17/extensions/NewUserMessage |
| ___________________________________________________________________ |
| Added: svn:mergeinfo |
| 183 | 256 | Merged /trunk/extensions/NewUserMessage:r81966,81969,82088 |
| Index: branches/REL1_17/extensions/LiquidThreads/classes/View.php |
| — | — | @@ -2223,9 +2223,9 @@ |
| 2224 | 2224 | } |
| 2225 | 2225 | |
| 2226 | 2226 | // Parser gets antsy about parser options here if it hasn't parsed anything before. |
| | 2227 | + $wgParser->mOptions = new ParserOptions; |
| 2227 | 2228 | $wgParser->clearState(); |
| 2228 | 2229 | $wgParser->setTitle( $wgTitle ); |
| 2229 | | - $wgParser->mOptions = new ParserOptions; |
| 2230 | 2230 | |
| 2231 | 2231 | $sig = $wgOut->parseInline( $sig ); |
| 2232 | 2232 | |
| — | — | @@ -2240,9 +2240,9 @@ |
| 2241 | 2241 | $title = $wgTitle ? $wgTitle : $user->getUserPage(); |
| 2242 | 2242 | |
| 2243 | 2243 | // Parser gets antsy about parser options here if it hasn't parsed anything before. |
| | 2244 | + $wgParser->mOptions = new ParserOptions; |
| 2244 | 2245 | $wgParser->clearState(); |
| 2245 | 2246 | $wgParser->setTitle( $title ); |
| 2246 | | - $wgParser->mOptions = new ParserOptions; |
| 2247 | 2247 | |
| 2248 | 2248 | $sig = $wgParser->preSaveTransform( |
| 2249 | 2249 | $sig, |
| Property changes on: branches/REL1_17/extensions/LiquidThreads/classes/View.php |
| ___________________________________________________________________ |
| Added: svn:mergeinfo |
| 2250 | 2250 | Merged /trunk/extensions/LiquidThreads/classes/View.php:r57390,81742 |
| Index: branches/REL1_17/extensions/WikiEditor/modules/jquery.wikiEditor.toolbar.css |
| — | — | @@ -241,7 +241,7 @@ |
| 242 | 242 | } |
| 243 | 243 | .wikiEditor-ui-toolbar .section-help .page-table td.cell-syntax, |
| 244 | 244 | .wikiEditor-ui-toolbar .section-help .page-table td.syntax { |
| 245 | | - font-family: monospace; |
| | 245 | + font-family: monospace, "Courier New"; |
| 246 | 246 | } |
| 247 | 247 | .wikiEditor-ui-toolbar .section-help .page-table td.syntax, |
| 248 | 248 | .wikiEditor-ui-toolbar .section-help .page-table td.cell-syntax, |
| — | — | @@ -267,7 +267,7 @@ |
| 268 | 268 | color: black; |
| 269 | 269 | text-decoration: none; |
| 270 | 270 | cursor: pointer; |
| 271 | | - font-family: monospace; |
| | 271 | + font-family: monospace, "Courier New"; |
| 272 | 272 | font-size: 1.25em; |
| 273 | 273 | } |
| 274 | 274 | .wikiEditor-ui-toolbar .page-characters div[dir=rtl] span { |
| Index: branches/REL1_17/extensions/WikiEditor/modules/ext.wikiEditor.toolbar.js |
| — | — | @@ -647,9 +647,7 @@ |
| 648 | 648 | "\u05d0", "\u05d1", "\u05d2", "\u05d3", "\u05d4", "\u05d5", "\u05d6", "\u05d7", "\u05d8", |
| 649 | 649 | "\u05d9", "\u05db", "\u05da", "\u05dc", "\u05de", "\u05dd", "\u05e0", "\u05df", "\u05e1", |
| 650 | 650 | "\u05e2", "\u05e4", "\u05e3", "\u05e6", "\u05e5", "\u05e7", "\u05e8", "\u05e9", "\u05ea", |
| 651 | | - "\u05f3", "\u05f4", "\u05f0", "\u05f1", "\u05f2", "\u05d0", "\u05d3", "\u05d4", "\u05d5", |
| 652 | | - "\u05d6", "\u05d7", "\u05d8", "\u05d9", "\u05da", "\u05db", "\u05dc", "\u05dd", "\u05de", |
| 653 | | - "\u05df", "\u05e0", "\u05e1", "\u05e2", "\u05e3", "\u05e4", "\u05be", "\u05f3", "\u05f4", |
| | 651 | + "\u05f3", "\u05f4", "\u05f0", "\u05f1", "\u05f2", "\u05be", |
| 654 | 652 | [ "\u05b0\u25cc", "\u05b0" ], [ "\u05b1\u25cc", "\u05b1" ], [ "\u05b2\u25cc", "\u05b2" ], |
| 655 | 653 | [ "\u05b3\u25cc", "\u05b3" ], [ "\u05b4\u25cc", "\u05b4" ], [ "\u05b5\u25cc", "\u05b5" ], |
| 656 | 654 | [ "\u05b6\u25cc", "\u05b6" ], [ "\u05b7\u25cc", "\u05b7" ], [ "\u05b8\u25cc", "\u05b8" ], |
| Property changes on: branches/REL1_17/extensions/WikiEditor |
| ___________________________________________________________________ |
| Added: svn:mergeinfo |
| 657 | 655 | Merged /trunk/extensions/WikiEditor:r82458,82554 |
| Index: branches/REL1_17/extensions/Vector/modules/ext.vector.simpleSearch.js |
| — | — | @@ -1,11 +1,5 @@ |
| 2 | 2 | /* JavaScript for SimpleSearch extension */ |
| 3 | 3 | |
| 4 | | -// XXX: Disable mwsuggest.js's effect on searchInput |
| 5 | | -if ( typeof os_autoload_inputs !== 'undefined' && os_autoload_forms !== 'undefined' ) { |
| 6 | | - os_autoload_inputs = []; |
| 7 | | - os_autoload_forms = []; |
| 8 | | -} |
| 9 | | - |
| 10 | 4 | $( document ).ready( function() { |
| 11 | 5 | |
| 12 | 6 | // Compatibility map |
| — | — | @@ -34,6 +28,11 @@ |
| 35 | 29 | return true; |
| 36 | 30 | } |
| 37 | 31 | |
| | 32 | + // Disable MWSuggest if loaded |
| | 33 | + if ( window.os_MWSuggestDisable ) { |
| | 34 | + window.os_MWSuggestDisable(); |
| | 35 | + } |
| | 36 | + |
| 38 | 37 | // Placeholder text for SimpleSearch box |
| 39 | 38 | $( 'div#simpleSearch > input#searchInput' ) |
| 40 | 39 | .attr( 'placeholder', mediaWiki.msg( 'vector-simplesearch-search' ) ) |
| Property changes on: branches/REL1_17/extensions/Vector/modules/ext.vector.simpleSearch.js |
| ___________________________________________________________________ |
| Modified: svn:mergeinfo |
| 41 | 40 | Merged /trunk/extensions/Vector/modules/ext.vector.simpleSearch.js:r82130 |
| Property changes on: branches/REL1_17/extensions/Vector/modules/ext.vector.collapsibleTabs.js |
| ___________________________________________________________________ |
| Modified: svn:mergeinfo |
| 42 | 41 | Merged /trunk/extensions/Vector/modules/ext.vector.collapsibleTabs.js:r82130 |
| Property changes on: branches/REL1_17/extensions/Vector |
| ___________________________________________________________________ |
| Added: svn:mergeinfo |
| 43 | 42 | Merged /trunk/extensions/Vector:r82130 |
| Index: branches/REL1_17/extensions/ProofreadPage/ProofreadPage_body.php |
| — | — | @@ -357,19 +357,24 @@ |
| 358 | 358 | $height = $image->getHeight(); |
| 359 | 359 | if ( $m[2] ) { |
| 360 | 360 | $thumbName = $image->thumbName( array( 'width' => '##WIDTH##', 'page' => $m[3] ) ); |
| | 361 | + $thumbURL = $image->getThumbUrl( $thumbName ); |
| | 362 | + $thumbURL = str_replace( '%23', '#', $thumbURL ); |
| | 363 | + $fullURL = str_replace( '##WIDTH##', "$width", $thumbURL ); |
| 361 | 364 | } else { |
| 362 | 365 | $thumbName = $image->thumbName( array( 'width' => '##WIDTH##' ) ); |
| | 366 | + $thumbURL = $image->getThumbUrl( $thumbName ); |
| | 367 | + $thumbURL = str_replace( '%23', '#', $thumbURL ); |
| | 368 | + $fullURL = $image->getURL(); |
| 363 | 369 | } |
| 364 | | - $thumbURL = $image->getThumbUrl( $thumbName ); |
| 365 | | - $thumbURL = str_replace( '%23', '#', $thumbURL ); |
| 366 | 370 | $scan_link = Html::element( 'a', |
| 367 | | - array( 'href' => str_replace( '##WIDTH##', "$width", $thumbURL ), |
| | 371 | + array( 'href' => $fullURL, |
| 368 | 372 | 'title' => wfMsg( 'proofreadpage_image' ) ), |
| 369 | 373 | wfMsg( 'proofreadpage_image' ) ); |
| 370 | 374 | } else { |
| 371 | 375 | $width = 0; |
| 372 | 376 | $height = 0; |
| 373 | 377 | $thumbURL = ''; |
| | 378 | + $fullURL = ''; |
| 374 | 379 | $scan_link = ''; |
| 375 | 380 | } |
| 376 | 381 | |
| — | — | @@ -388,6 +393,7 @@ |
| 389 | 394 | 'proofreadPageHeight' => intval( $height ), |
| 390 | 395 | 'proofreadPageEditWidth' => $edit_width, |
| 391 | 396 | 'proofreadPageThumbURL' => $thumbURL, |
| | 397 | + 'proofreadPageURL' => $fullURL, |
| 392 | 398 | 'proofreadPageIsEdit' => intval( $isEdit ), |
| 393 | 399 | 'proofreadPageIndexLink' => $index_link, |
| 394 | 400 | 'proofreadPageNextLink' => $next_link, |
| — | — | @@ -601,10 +607,10 @@ |
| 602 | 608 | $view = ( $i - $offset ); |
| 603 | 609 | switch( $mode ) { |
| 604 | 610 | case 'highroman': |
| 605 | | - $view = toRoman( $view ); |
| | 611 | + $view = $this->toRoman( $view ); |
| 606 | 612 | break; |
| 607 | 613 | case 'roman': |
| 608 | | - $view = strtolower( toRoman( $view ) ); |
| | 614 | + $view = strtolower( $this->toRoman( $view ) ); |
| 609 | 615 | break; |
| 610 | 616 | case 'normal': |
| 611 | 617 | $view = '' . $view; |
| — | — | @@ -857,11 +863,9 @@ |
| 858 | 864 | if( !$is_q0 ) { |
| 859 | 865 | $out .= '<span>{{:MediaWiki:Proofreadpage_pagenum_template|page=' . $text . "|num=$pagenum}}</span>"; |
| 860 | 866 | } |
| 861 | | - if( $args["$i"] != null ) { |
| 862 | | - $out .= '{{#lst:' . $text . '|' . $args["$i"] . '}}'; |
| 863 | | - } elseif( $page == $from && $args['fromsection'] ) { |
| | 867 | + if( $page == $from_page && $args['fromsection'] ) { |
| 864 | 868 | $out .= '{{#lst:' . $text . '|' . $args['fromsection'] . '}}'; |
| 865 | | - } elseif( $page == $to && $args['tosection'] ) { |
| | 869 | + } elseif( $page == $to_page && $args['tosection'] ) { |
| 866 | 870 | $out .= '{{#lst:' . $text . '|' . $args['tosection'] . '}}'; |
| 867 | 871 | } else { |
| 868 | 872 | $out .= '{{:' . $text . '}}'; |
| — | — | @@ -941,7 +945,7 @@ |
| 942 | 946 | } |
| 943 | 947 | |
| 944 | 948 | // wrap the output in a div, to prevent the parser from inserting pararaphs |
| 945 | | - $out = "<div>$out</div>"; |
| | 949 | + $out = "<div>\n$out\n</div>"; |
| 946 | 950 | $out = $parser->recursiveTagParse( $out ); |
| 947 | 951 | return $out; |
| 948 | 952 | } |
| Index: branches/REL1_17/extensions/ProofreadPage/proofread.js |
| — | — | @@ -16,10 +16,15 @@ |
| 17 | 17 | // enforce quantization: width must be multiple of 100px |
| 18 | 18 | var width = 100 * Math.round( requested_width / 100 ); |
| 19 | 19 | // compare to the width of the image |
| 20 | | - width = Math.min( width, proofreadPageWidth ); |
| 21 | | - self.DisplayWidth = width; |
| 22 | | - self.DisplayHeight = width * proofreadPageHeight / proofreadPageWidth; |
| 23 | | - return proofreadPageThumbURL.replace( '##WIDTH##', '' + width ); |
| | 20 | + if( width < proofreadPageWidth ) { |
| | 21 | + self.DisplayWidth = width; |
| | 22 | + self.DisplayHeight = width * proofreadPageHeight / proofreadPageWidth; |
| | 23 | + return proofreadPageThumbURL.replace( '##WIDTH##', '' + width ); |
| | 24 | + } else { |
| | 25 | + self.DisplayWidth = proofreadPageWidth; |
| | 26 | + self.DisplayHeight = proofreadPageHeight; |
| | 27 | + return proofreadPageURL; |
| | 28 | + } |
| 24 | 29 | } |
| 25 | 30 | } |
| 26 | 31 | |
| — | — | @@ -893,12 +898,8 @@ |
| 894 | 899 | } |
| 895 | 900 | |
| 896 | 901 | // add CSS classes to the container div |
| 897 | | - var c = document.getElementById( 'pagequality' ); |
| 898 | | - if( c ) { |
| 899 | | - c = c.nextSibling; |
| 900 | | - if( c.className == 'pagetext' ) { |
| 901 | | - c.className += ' ' + self.proofreadPageCss; |
| 902 | | - } |
| | 902 | + if( self.proofreadPageCss) { |
| | 903 | + $( 'div.pagetext' ).addClass( self.proofreadPageCss ); |
| 903 | 904 | } |
| 904 | 905 | } |
| 905 | 906 | |
| — | — | @@ -947,7 +948,7 @@ |
| 948 | 949 | if( !proofreadPageAddButtons ) { |
| 949 | 950 | f.innerHTML = |
| 950 | 951 | ' <input type="hidden" name="wpProofreader" value="' + escapeQuotesHTML( self.proofreadpage_username ) + '">' + |
| 951 | | - '<input type="hidden" name="quality" value="' + escapeQuotesHTML( self.proofreadpage_quality ) + '" >'; |
| | 952 | + '<input type="hidden" name="quality" value="' + escapeQuotesHTML( self.proofreadpage_quality +'' ) + '" >'; |
| 952 | 953 | return; |
| 953 | 954 | } |
| 954 | 955 | |
| Property changes on: branches/REL1_17/extensions/ProofreadPage |
| ___________________________________________________________________ |
| Added: svn:mergeinfo |
| 955 | 956 | Merged /trunk/extensions/ProofreadPage:r82404,82408-82409,82453,82460,82555 |
| Index: branches/REL1_17/extensions/Gadgets/Gadgets_body.php |
| — | — | @@ -318,11 +318,11 @@ |
| 319 | 319 | public function getModule() { |
| 320 | 320 | $pages = array(); |
| 321 | 321 | foreach( $this->styles as $style ) { |
| 322 | | - $pages[$style] = array( 'ns' => NS_MEDIAWIKI, 'type' => 'style' ); |
| | 322 | + $pages['MediaWiki:' . $style] = array( 'type' => 'style' ); |
| 323 | 323 | } |
| 324 | 324 | if ( $this->supportsResourceLoader() ) { |
| 325 | 325 | foreach ( $this->scripts as $script ) { |
| 326 | | - $pages[$script] = array( 'ns' => NS_MEDIAWIKI, 'type' => 'script' ); |
| | 326 | + $pages['MediaWiki:' . $script] = array( 'type' => 'script' ); |
| 327 | 327 | } |
| 328 | 328 | } |
| 329 | 329 | if ( !count( $pages ) ) { |
| — | — | @@ -363,6 +363,7 @@ |
| 364 | 364 | $struct = self::loadStructuredList(); |
| 365 | 365 | if ( !$struct ) { |
| 366 | 366 | $gadgets = $struct; |
| | 367 | + wfProfileOut( __METHOD__ ); |
| 367 | 368 | return $gadgets; |
| 368 | 369 | } |
| 369 | 370 | |
| — | — | @@ -469,8 +470,8 @@ |
| 470 | 471 | * @param $pages Array: Associative array of pages in ResourceLoaderWikiModule-compatible |
| 471 | 472 | * format, for example: |
| 472 | 473 | * array( |
| 473 | | - * 'Gadget-foo.js' => array( 'ns' => NS_MEDIAWIKI, 'type' => 'script' ), |
| 474 | | - * 'Gadget-foo.css' => array( 'ns' => NS_MEDIAWIKI, 'type' => 'style' ), |
| | 474 | + * 'MediaWiki:Gadget-foo.js' => array( 'type' => 'script' ), |
| | 475 | + * 'MediaWiki:Gadget-foo.css' => array( 'type' => 'style' ), |
| 475 | 476 | * ) |
| 476 | 477 | * @param $dependencies Array: Names of resources this module depends on |
| 477 | 478 | */ |
| — | — | @@ -494,4 +495,4 @@ |
| 495 | 496 | public function getDependencies() { |
| 496 | 497 | return $this->dependencies; |
| 497 | 498 | } |
| 498 | | -} |
| \ No newline at end of file |
| | 499 | +} |
| Property changes on: branches/REL1_17/extensions/Gadgets/Gadgets_body.php |
| ___________________________________________________________________ |
| Added: svn:mergeinfo |
| 499 | 500 | Merged /trunk/extensions/Gadgets/Gadgets_body.php:r81908,82524 |
| 500 | 501 | Merged /branches/Gadgets-work/Gadgets_body.php:r73145-76526 |
| 501 | 502 | Merged /branches/wmf/1.17wmf1/extensions/Gadgets/Gadgets_body.php:r81884 |
| Property changes on: branches/REL1_17/extensions/Gadgets |
| ___________________________________________________________________ |
| Modified: svn:mergeinfo |
| 502 | 503 | Merged /trunk/extensions/Gadgets:r81908 |
| Index: branches/REL1_17/extensions/OpenSearchXml/ApiOpenSearchXml.php |
| — | — | @@ -261,8 +261,8 @@ |
| 262 | 262 | // First, we use the system preprocessor to break down the text |
| 263 | 263 | // into text, templates, extensions, and comments: |
| 264 | 264 | global $wgParser; |
| | 265 | + $wgParser->mOptions = new ParserOptions(); |
| 265 | 266 | $wgParser->clearState(); |
| 266 | | - $wgParser->mOptions = new ParserOptions(); |
| 267 | 267 | $frame = $wgParser->getPreprocessor()->newFrame(); |
| 268 | 268 | $dom = $wgParser->preprocessToDom( $text ); |
| 269 | 269 | |
| Property changes on: branches/REL1_17/extensions/OpenSearchXml/ApiOpenSearchXml.php |
| ___________________________________________________________________ |
| Added: svn:mergeinfo |
| 270 | 270 | Merged /trunk/extensions/OpenSearchXml/ApiOpenSearchXml.php:r81743 |
| Index: branches/REL1_17/extensions/PagedTiffHandler/PagedTiffHandler.i18n.php |
| — | — | @@ -28,7 +28,7 @@ |
| 29 | 29 | 'tiff_size_error' => 'The reported file size does not match the actual file size.', |
| 30 | 30 | 'tiff_script_detected' => 'The uploaded file contains scripts.', |
| 31 | 31 | 'tiff_bad_file' => 'The uploaded file contains errors: $1', |
| 32 | | - 'tiff-file-info-size' => 'page $5, $1 × $2 pixel, file size: $3, MIME type: $4', |
| | 32 | + 'tiff-file-info-size' => 'page $5, $1 × $2 pixels, file size: $3, MIME type: $4', |
| 33 | 33 | ); |
| 34 | 34 | |
| 35 | 35 | /** Message documentation (Message documentation) |
| Property changes on: branches/REL1_17/extensions/PagedTiffHandler/PagedTiffHandler.i18n.php |
| ___________________________________________________________________ |
| Added: svn:mergeinfo |
| 36 | 36 | Merged /trunk/extensions/PagedTiffHandler/PagedTiffHandler.i18n.php:r82073 |
| Index: branches/REL1_17/extensions/CategoryTree/CategoryTreeFunctions.php |
| — | — | @@ -767,7 +767,9 @@ |
| 768 | 768 | # The title must be in the category namespace |
| 769 | 769 | # Ignore a leading Category: if there is one |
| 770 | 770 | $t = Title::newFromText( $title, NS_CATEGORY ); |
| 771 | | - if ( $t && ( $t->getNamespace() != NS_CATEGORY || $t->getInterWiki() != '' ) ) { |
| | 771 | + if ( !$t || $t->getNamespace() != NS_CATEGORY || $t->getInterWiki() != '' ) { |
| | 772 | + // If we were given something like "Wikipedia:Foo" or "Template:", |
| | 773 | + // try it again but forced. |
| 772 | 774 | $title = "Category:$title"; |
| 773 | 775 | $t = Title::newFromText( $title ); |
| 774 | 776 | } |
| Property changes on: branches/REL1_17/extensions/CategoryTree/CategoryTreeFunctions.php |
| ___________________________________________________________________ |
| Modified: svn:mergeinfo |
| 775 | 777 | Merged /trunk/extensions/CategoryTree/CategoryTreeFunctions.php:r82085 |
| Property changes on: branches/REL1_17/extensions/CategoryTree |
| ___________________________________________________________________ |
| Added: svn:mergeinfo |
| 776 | 778 | Merged /trunk/extensions/CategoryTree:r82085 |
| Index: branches/REL1_17/extensions/CentralAuth/centralauth.js |
| — | — | @@ -21,7 +21,9 @@ |
| 22 | 22 | methodHint.style.left = wgCursorPosition.x + 'px'; |
| 23 | 23 | methodHint.style.top = wgCursorPosition.y + 'px'; |
| 24 | 24 | methodHint.setAttribute( 'onclick', 'hideMethodHint()' ); |
| 25 | | - document.getElementById( 'globalWrapper' ).appendChild( methodHint ); |
| | 25 | + |
| | 26 | + var content = document.getElementById('content') || document.getElementById('mw_content') || document.body; |
| | 27 | + content.appendChild( methodHint ); |
| 26 | 28 | } |
| 27 | 29 | |
| 28 | 30 | function hideMethodHint() { |
| Property changes on: branches/REL1_17/extensions/CentralAuth/SpecialWikiSets.php |
| ___________________________________________________________________ |
| Modified: svn:mergeinfo |
| 29 | 31 | Merged /trunk/extensions/CentralAuth/SpecialWikiSets.php:r82101 |
| Index: branches/REL1_17/extensions/CentralAuth/SpecialCentralAuth.php |
| — | — | @@ -258,9 +258,9 @@ |
| 259 | 259 | if ( $span < 2 * $chunk ) { |
| 260 | 260 | return wfMsgExt( "centralauth-$unit-ago", 'parsemag', $wgLang->formatNum( $span ) ); |
| 261 | 261 | } |
| 262 | | - $span = $wgLang->formatNum( intval( $span / $chunk ) ); |
| | 262 | + $span = intval( $span / $chunk ); |
| 263 | 263 | } |
| 264 | | - return wfMsgExt( "centralauth-$unit-ago", 'parsemag', $span ); |
| | 264 | + return wfMsgExt( "centralauth-$unit-ago", 'parsemag', $wgLang->formatNum( $span ) ); |
| 265 | 265 | } |
| 266 | 266 | |
| 267 | 267 | function showInfo() { |
| Property changes on: branches/REL1_17/extensions/CentralAuth/SpecialCentralAuth.php |
| ___________________________________________________________________ |
| Added: svn:mergeinfo |
| 268 | 268 | Merged /trunk/extensions/CentralAuth/SpecialCentralAuth.php:r82101,82386 |
| Property changes on: branches/REL1_17/extensions/CentralAuth |
| ___________________________________________________________________ |
| Added: svn:mergeinfo |
| 269 | 269 | Merged /trunk/extensions/CentralAuth:r82101 |
| Property changes on: branches/REL1_17/extensions/FlaggedRevs/specialpages/ProblemChanges_body.php |
| ___________________________________________________________________ |
| Modified: svn:mergeinfo |
| 270 | 270 | Merged /trunk/extensions/FlaggedRevs/specialpages/ProblemChanges_body.php:r82226,82537 |
| Property changes on: branches/REL1_17/extensions/FlaggedRevs/FlaggedRevs.hooks.php |
| ___________________________________________________________________ |
| Modified: svn:mergeinfo |
| 271 | 271 | Merged /trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php:r82226,82537 |
| Index: branches/REL1_17/extensions/FlaggedRevs/client/flaggedrevs.js |
| — | — | @@ -20,12 +20,13 @@ |
| 21 | 21 | // Rating detail box |
| 22 | 22 | var toggle = document.getElementById('mw-fr-revisiontoggle'); |
| 23 | 23 | if( toggle ) { |
| 24 | | - toggle.style.display = 'inline'; |
| | 24 | + toggle.style.display = 'inline'; /* show toggle control */ |
| | 25 | + this.hideBoxDetails(); /* hide the initially displayed ratings */ |
| 25 | 26 | } |
| 26 | 27 | // Diff detail box |
| 27 | 28 | toggle = document.getElementById('mw-fr-difftoggle'); |
| 28 | 29 | if( toggle ) { |
| 29 | | - toggle.style.display = 'inline'; |
| | 30 | + toggle.style.display = 'inline'; /* show toggle control */ |
| 30 | 31 | var diff = document.getElementById('mw-fr-stablediff'); |
| 31 | 32 | if( diff ) { |
| 32 | 33 | diff.style.display = 'none'; |
| — | — | @@ -34,7 +35,7 @@ |
| 35 | 36 | // Log detail box |
| 36 | 37 | toggle = document.getElementById('mw-fr-logtoggle'); |
| 37 | 38 | if( toggle ) { |
| 38 | | - toggle.style.display = 'inline'; |
| | 39 | + toggle.style.display = 'inline'; /* show toggle control */ |
| 39 | 40 | var log = document.getElementById('mw-fr-logexcerpt'); |
| 40 | 41 | if( log ) { |
| 41 | 42 | log.style.display = 'none'; |
| Property changes on: branches/REL1_17/extensions/FlaggedRevs |
| ___________________________________________________________________ |
| Modified: svn:mergeinfo |
| 42 | 43 | Merged /trunk/extensions/FlaggedRevs:r82226,82537 |
| Index: branches/REL1_17/extensions/DoubleWiki/DoubleWiki_body.php |
| — | — | @@ -35,11 +35,15 @@ |
| 36 | 36 | /* |
| 37 | 37 | * Read the list of matched phrases and add tags to the html output. |
| 38 | 38 | */ |
| 39 | | - function addMatchingTags ( &$text, $lang ) { |
| 40 | | - $pattern = "/<div id=\"align-$lang\" style=\"display:none;\">\n<p>([^<]*?)<\/p>\n<\/div>/is"; |
| 41 | | - if( ! preg_match( $pattern, $text, $m ) ) return ; |
| | 39 | + function addMatchingTags ( &$text, $lang ) { |
| | 40 | + $pattern = "/<div id=\"align-$lang\" style=\"display:none;\">\n*<pre>(.*?)<\/pre>\n*<\/div>/is"; |
| | 41 | + $m = array(); |
| | 42 | + if ( ! preg_match( $pattern, $text, $m ) ) { |
| | 43 | + return; |
| | 44 | + } |
| 42 | 45 | $text = str_replace( $m[1], '', $text ); |
| 43 | | - $line_pattern = "/\s*([^:\n]*?)\s*:\s*([^:\n]*?)\s*\n/i"; |
| | 46 | + $line_pattern = '/\s*([^:\n]*?)\s*=\s*([^:\n]*?)\s*\n/i'; |
| | 47 | + $items = array(); |
| 44 | 48 | preg_match_all( $line_pattern, $m[1], $items, PREG_SET_ORDER ); |
| 45 | 49 | foreach( $items as $n => $i ) { |
| 46 | 50 | $text = str_replace( $i[1], "<span id=\"dw-$n\" title=\"{$i[2]}\"/>".$i[1], $text ); |
| — | — | @@ -121,7 +125,8 @@ |
| 122 | 126 | $left_chunk = ''; |
| 123 | 127 | $right_chunk = ''; |
| 124 | 128 | |
| 125 | | - for ( $i=0 ; $i < count($left_slices) ; $i++ ) { |
| | 129 | + $leftSliceCount = count( $left_slices ); |
| | 130 | + for ( $i=0 ; $i < $leftSliceCount; $i++ ) { |
| 126 | 131 | |
| 127 | 132 | // some slices might be empty |
| 128 | 133 | if( $left_slices[$i] == '' ) { |
| — | — | @@ -167,7 +172,8 @@ |
| 168 | 173 | |
| 169 | 174 | $left_chunk = ''; |
| 170 | 175 | $right_chunk = ''; |
| 171 | | - for($l=0; $l < count( $left_bits ) ; $l++ ) { |
| | 176 | + $leftBitCount = count( $left_bits ); |
| | 177 | + for($l=0; $l < $leftBitCount ; $l++ ) { |
| 172 | 178 | $body .= |
| 173 | 179 | "<tr><td valign=\"top\" style=\"vertical-align:100%;padding-right: 0.5em\" lang=\"{$left_lang}\">" |
| 174 | 180 | ."<div style=\"width:35em; margin:0px auto\">\n".$left_bits[$l]."</div>" |
| — | — | @@ -201,7 +207,8 @@ |
| 202 | 208 | preg_match_all( $this->tags, $text, $m, PREG_SET_ORDER); |
| 203 | 209 | $counter = 0; |
| 204 | 210 | $out = ''; |
| 205 | | - for($i=0; $i < count($m); $i++){ |
| | 211 | + $matchCount = count( $m ); |
| | 212 | + for( $i = 0; $i < $matchCount; $i++ ){ |
| 206 | 213 | $t = $m[$i][0]; |
| 207 | 214 | if( substr( $t, 0, 2) != "</" ) { |
| 208 | 215 | $counter++; |
| — | — | @@ -251,7 +258,8 @@ |
| 252 | 259 | for( $i=0 ; $i < $n ; $i++) { |
| 253 | 260 | preg_match_all( $this->tags, $left_slices[$i], $m, PREG_SET_ORDER); |
| 254 | 261 | $counter = 0; |
| 255 | | - for($k=0 ; $k < count($m) ; $k++) { |
| | 262 | + $matchCount = count( $m ); |
| | 263 | + for($k=0 ; $k < $matchCount ; $k++) { |
| 256 | 264 | $t = $m[$k]; |
| 257 | 265 | if( substr( $t[0], 0, 2) != "</" ) { |
| 258 | 266 | $counter++; |
| Property changes on: branches/REL1_17/extensions/DoubleWiki/DoubleWiki_body.php |
| ___________________________________________________________________ |
| Added: svn:mergeinfo |
| 259 | 267 | Merged /trunk/extensions/DoubleWiki/DoubleWiki_body.php:r81672,82100,82513,82552 |
| Property changes on: branches/REL1_17/extensions/DoubleWiki |
| ___________________________________________________________________ |
| Modified: svn:mergeinfo |
| 260 | 268 | Merged /trunk/extensions/DoubleWiki:r82100 |
| Index: branches/REL1_17/extensions/ReaderFeedback/ReaderFeedback.hooks.php |
| — | — | @@ -24,8 +24,7 @@ |
| 25 | 25 | // Add CSS |
| 26 | 26 | $wgOut->addExtensionStyle( $encCssFile ); |
| 27 | 27 | // Add JS |
| 28 | | - $head = "<script type=\"$wgJsMimeType\" src=\"$encJsFile\"></script>\n"; |
| 29 | | - $wgOut->addHeadItem( 'ReaderFeedback', $head ); |
| | 28 | + $wgOut->addScriptFile( "$stylepath/readerfeedback.js?$wgFeedbackStyleVersion" ); |
| 30 | 29 | |
| 31 | 30 | return true; |
| 32 | 31 | } |
| Property changes on: branches/REL1_17/extensions/ReaderFeedback/ReaderFeedback.hooks.php |
| ___________________________________________________________________ |
| Added: svn:mergeinfo |
| 33 | 32 | Merged /trunk/extensions/ReaderFeedback/ReaderFeedback.hooks.php:r81713 |