Index: trunk/phase3/maintenance/language/messages.inc |
— | — | @@ -2198,6 +2198,7 @@ |
2199 | 2199 | 'searchnamed', |
2200 | 2200 | 'articletitles', |
2201 | 2201 | 'hideresults', |
| 2202 | + 'useajaxsearch', |
2202 | 2203 | ), |
2203 | 2204 | 'separators' => array( |
2204 | 2205 | 'catseparator', |
Index: trunk/phase3/skins/common/ajaxsearch.js |
— | — | @@ -23,7 +23,6 @@ |
24 | 24 | function Search_Typing() { |
25 | 25 | started=true; |
26 | 26 | typing=true; |
27 | | - window.status = "Waiting until you're done typing..."; |
28 | 27 | setTimeout("Search_doneTyping()", 500); |
29 | 28 | |
30 | 29 | // I believe these are needed by IE for when the users press return? |
Index: trunk/phase3/includes/OutputPage.php |
— | — | @@ -599,7 +599,7 @@ |
600 | 600 | |
601 | 601 | wfRunHooks( 'AjaxAddScript', array( &$this ) ); |
602 | 602 | |
603 | | - if( $wgAjaxSearch ) { |
| 603 | + if( $wgAjaxSearch && $wgUser->getBoolOption( 'ajaxsearch' ) ) { |
604 | 604 | $this->addScript( "<script type=\"{$wgJsMimeType}\" src=\"{$wgStylePath}/common/ajaxsearch.js?$wgStyleVersion\"></script>\n" ); |
605 | 605 | $this->addScript( "<script type=\"{$wgJsMimeType}\">hookEvent(\"load\", sajax_onload);</script>\n" ); |
606 | 606 | } |
Index: trunk/phase3/includes/SpecialPreferences.php |
— | — | @@ -24,7 +24,7 @@ |
25 | 25 | var $mRows, $mCols, $mSkin, $mMath, $mDate, $mUserEmail, $mEmailFlag, $mNick; |
26 | 26 | var $mUserLanguage, $mUserVariant; |
27 | 27 | var $mSearch, $mRecent, $mRecentDays, $mHourDiff, $mSearchLines, $mSearchChars, $mAction; |
28 | | - var $mReset, $mPosted, $mToggles, $mSearchNs, $mRealName, $mImageSize; |
| 28 | + var $mReset, $mPosted, $mToggles, $mUseAjaxSearch, $mSearchNs, $mRealName, $mImageSize; |
29 | 29 | var $mUnderline, $mWatchlistEdits; |
30 | 30 | |
31 | 31 | /** |
— | — | @@ -65,6 +65,7 @@ |
66 | 66 | $this->mSuccess = $request->getCheck( 'success' ); |
67 | 67 | $this->mWatchlistDays = $request->getVal( 'wpWatchlistDays' ); |
68 | 68 | $this->mWatchlistEdits = $request->getVal( 'wpWatchlistEdits' ); |
| 69 | + $this->mUseAjaxSearch = $request->getCheck( 'wpUseAjaxSearch' ); |
69 | 70 | |
70 | 71 | $this->mSaveprefs = $request->getCheck( 'wpSaveprefs' ) && |
71 | 72 | $this->mPosted && |
— | — | @@ -285,6 +286,7 @@ |
286 | 287 | $wgUser->setOption( 'thumbsize', $this->mThumbSize ); |
287 | 288 | $wgUser->setOption( 'underline', $this->validateInt($this->mUnderline, 0, 2) ); |
288 | 289 | $wgUser->setOption( 'watchlistdays', $this->validateFloat( $this->mWatchlistDays, 0, 7 ) ); |
| 290 | + $wgUser->setOption( 'ajaxsearch', $this->mUseAjaxSearch ); |
289 | 291 | |
290 | 292 | # Set search namespace options |
291 | 293 | foreach( $this->mSearchNs as $i => $value ) { |
— | — | @@ -395,6 +397,7 @@ |
396 | 398 | $this->mWatchlistEdits = $wgUser->getOption( 'wllimit' ); |
397 | 399 | $this->mUnderline = $wgUser->getOption( 'underline' ); |
398 | 400 | $this->mWatchlistDays = $wgUser->getOption( 'watchlistdays' ); |
| 401 | + $this->mUseAjaxSearch = $wgUser->getBoolOption( 'ajaxsearch' ); |
399 | 402 | |
400 | 403 | $togs = User::getToggles(); |
401 | 404 | foreach ( $togs as $tname ) { |
— | — | @@ -512,7 +515,7 @@ |
513 | 516 | global $wgRCShowWatchingUsers, $wgEnotifRevealEditorAddress; |
514 | 517 | global $wgEnableEmail, $wgEnableUserEmail, $wgEmailAuthentication; |
515 | 518 | global $wgContLanguageCode, $wgDefaultSkin, $wgSkipSkins, $wgAuth; |
516 | | - global $wgEmailConfirmToEdit; |
| 519 | + global $wgEmailConfirmToEdit, $wgAjaxSearch; |
517 | 520 | |
518 | 521 | $wgOut->setPageTitle( wfMsg( 'preferences' ) ); |
519 | 522 | $wgOut->setArticleRelated( false ); |
— | — | @@ -970,7 +973,13 @@ |
971 | 974 | $wgOut->addHtml( '</fieldset>' ); |
972 | 975 | |
973 | 976 | # Search |
| 977 | + $ajaxsearch = $wgAjaxSearch ? |
| 978 | + $this->addRow( |
| 979 | + wfLabel( wfMsg( 'useajaxsearch' ), 'wpUseAjaxSearch' ), |
| 980 | + wfCheck( 'wpUseAjaxSearch', $this->mUseAjaxSearch, array( 'id' => 'wpUseAjaxSearch' ) ) |
| 981 | + ) : ''; |
974 | 982 | $wgOut->addHTML( '<fieldset><legend>' . wfMsg( 'searchresultshead' ) . '</legend><table>' . |
| 983 | + $ajaxsearch . |
975 | 984 | $this->addRow( |
976 | 985 | wfLabel( wfMsg( 'resultsperpage' ), 'wpSearch' ), |
977 | 986 | wfInput( 'wpSearch', 4, $this->mSearch, array( 'id' => 'wpSearch' ) ) |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -2965,6 +2965,7 @@ |
2966 | 2966 | 'searchnamed' => "Search for pages named ''$1''.", |
2967 | 2967 | 'articletitles' => "Pages starting with ''$1''", |
2968 | 2968 | 'hideresults' => 'Hide results', |
| 2969 | +'useajaxsearch' => 'Use AJAX search', |
2969 | 2970 | |
2970 | 2971 | # Separators for various lists |
2971 | 2972 | 'catseparator' => '|', # don't translate or duplicate this message to other languages |
Index: trunk/phase3/languages/messages/MessagesRu.php |
— | — | @@ -2358,6 +2358,7 @@ |
2359 | 2359 | 'searchnamed' => 'Поиск статей с названием $1.', |
2360 | 2360 | 'articletitles' => 'Статьи, начинающиеся с «$1»', |
2361 | 2361 | 'hideresults' => 'Скрыть результаты', |
| 2362 | +'useajaxsearch' => 'Использовать AJAX-поиск', |
2362 | 2363 | |
2363 | 2364 | # Multipage image navigation |
2364 | 2365 | 'imgmultipageprev' => '← предыдущая страница', |