MediaWiki talk:Gadget-search-new-tab.js
This script, Search results in new tab, is a JavaScript gadget which can be enabled or disabled in your Preferences. |
i18n | Gadget translations:
no internationalisation required: |
In all search forms this makes the search result list or search suggestion open in a new tab via Ctrl-click (PC) and Command-click (Mac). Ctrl (PC) or ⌘ Command (Mac). Users can import the JavaScript (JS) into other wikis outside the Commons. In English Wikipedia it can be enabled in "my preferences" here: en:Special:Preferences#mw-prefsection-gadgets in the browsing section at the top.
|
Notes: Here are the component parts and what they effect:
- #searchform - embedded search form at top right of every page.
- #searchbox - embedded archive search forms. For example; Template:Village pump archives, Commons:Village pump/Proposals/Header, and Commons:Village pump/Header.
- #search, .search-types, #search-types - Special:Search.
- #powersearch - advanced search at Special:Search. This is after one clicks the advanced search link at Special:Search to get the dropdown of search choices. Then when one clicks the search button #powersearch applies to it.
- Most browsers open (or can be set to open) any normal link in a new tab via ctrl-click (PC) and command-click (Mac). So this JavaScript (JS) import does the same thing for search submit buttons.
- On any empty search form you can now ctrl-click or command-click the submit button to get to Special:Search, or a variation of it, in a new tab.
- There is also a JS import that automatically opens search in a new tab. See: MediaWiki talk:Search-results-new-tab.js
Discussion elsewhere
[edit]- Note. Feel free to add more links.
Commons
[edit]- Commons:Village pump/Proposals/Archive/2012/08#Support or oppose adding gadget to open search in new tab - Discussion showed good support for adding gadget.
- Commons:Village pump/Proposals/Archive/2012/08#Ctrl-click to open search in new tab
- Commons:Village pump/Proposals/Archive/2012/08#Revised version that also works for Mac users
- MediaWiki talk:Gadgets-definition/Archive/2012#Gadget to open search in new tab
Bugzilla
[edit]- See en:WP:Bugzilla for more info.
- Bugzilla:35974. Preference or default setting to open search result lists in new tab via Ctrl-click
- Bugzilla:17808. Have search suggest results open in a new tab on middle click.
- Bugzilla:34756. SimpleSearch should use native event handling (open link in or submit form to a new tab).
- Bugzilla:29448. Add "advanced search" link in the search drop down.
English Wikipedia
[edit]- en:MediaWiki talk:Gadget-search-new-tab.js
- en:MediaWiki talk:Gadgets-definition#Open search result list and search suggestions in new tab
- en:Wikipedia:Village pump (technical)/Archive 102#Support or oppose adding gadget to open search in new tab - Village pump discussion showed good support for adding gadget.
- en:Wikipedia:Gadget/proposals/Archive 4#Open search result list or search suggestion in a new tab.
- en:Wikipedia:Gadget/proposals#Wikimedia Bugzilla wiki has advanced search link in sidebar. Why not Wikipedia?
- en:MediaWiki talk:Sidebar#Please put a search link in the sidebar
Browsers
[edit]Testing browsers. Here is a page outside Wikimedia with a search form at the top:
Chrome allows one to Ctrl-click the form submit button to open the results list in a new tab. Shift-click to open the results list in a new window.
Firefox and Internet Explorer do not allow one to send the form results list to a new tab or window by ctrl-click, shift-click, middle click, right click, etc.. The Firefox developers are not going to add this ability. See comments 124 and 151 in this thread:
- Bugzilla@Mozilla – Bug 17754: Ability to submit form in a new window / tab (when button is middle or right clicked).
So this gadget preference is needed for Firefox and Internet Explorer. --Timeshifter (talk) 14:33, 29 January 2013 (UTC)