Last modified: 2014-11-18 18:07:24 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T19808, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 17808 - Have search suggest results open in a new tab on middle click
Have search suggest results open in a new tab on middle click
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Interface (Other open bugs)
unspecified
All All
: Low enhancement with 2 votes (vote)
: ---
Assigned To: Bartosz Dziewoński
:
: 28351 (view as bug list)
Depends on: 21167
Blocks: 27411
  Show dependency treegraph
 
Reported: 2009-03-05 20:16 UTC by Tisza Gergő
Modified: 2014-11-18 18:07 UTC (History)
9 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Suggestion Dropdown (1.37 KB, text/html)
2012-08-04 16:17 UTC, [no longer active user]
Details
Suggestion Dropdown (1.37 KB, text/html)
2012-08-04 16:19 UTC, [no longer active user]
Details

Description Tisza Gergő 2009-03-05 20:16:36 UTC
The search suggest feature is by far the most comfortable search method in MediaWiki, unfortunately there is no way to browse the suggestion list beyond clicking on the first, waiting for the page to load, typing the word in again (or pressing back and waiting for the old page to load) etc. It would be even more comfortable if middle click (or ctrl-click or whatever combination that specific browser uses) would open the page in a new tab.
Comment 1 Splarka 2009-03-05 20:21:52 UTC
There is no such thing as "open in new tab" that could be done server side (there are some CSS3 draft specs, but nothing useable).

The only thing that could be done automatically is to "open in new window", which /some/ browsers can send to a new tab, but not all.

One possible solution, though, would be to have the search suggest create <a> anchors linking to the results of the search for that word, that would allow the browser context menu on right click, which often includes 'open in new tab'.
Comment 2 Tisza Gergő 2009-03-05 20:24:23 UTC
(In reply to comment #1)
That would be my take too: change the <span>s to <a>s, and pass on the click event when it's not a left click.
Comment 3 Tisza Gergő 2009-03-05 20:26:51 UTC
(In reply to comment #2)
You can also check the event object for pressed modifier keys, though I'm not sure how cross-browser that is.
Comment 4 Robert Stojnic 2009-03-05 23:23:32 UTC
Makes sense, just need to make sure the links point to exactly the same url as form submit.
Comment 5 Rd232 2011-11-26 22:32:56 UTC
*** Bug 28351 has been marked as a duplicate of this bug. ***
Comment 6 [no longer active user] 2012-08-04 16:17:31 UTC
Created attachment 10933 [details]
Suggestion Dropdown

"It would be even more comfortable if middle click (or ctrl-click or whatever combination that specific browser uses) would open the page in a new tab.", I very like this idea.

I think this could be done with wrapping every item with <a> tag as you can see on my attachment.
Comment 7 [no longer active user] 2012-08-04 16:19:35 UTC
Created attachment 10934 [details]
Suggestion Dropdown
Comment 8 Krinkle 2012-08-04 19:52:38 UTC
Just wrapping them in <a> doesn't work (if so, that would've been done in the first place). The primary use case is selecting an item from the list and submitting the search form.

If they are wrapped in a link, then clicking would go to that article instead of submitting the form. Right not it wouldn't make much difference though, since the search system usually redirects to the first result anyway.

Either way, the click handler would preventDefault() and submit the form, whilst still allowing non-default clicks (such as middle-click or context-menu > Open in new Tab)
Comment 9 Timeshifter 2012-08-08 20:06:11 UTC
The original poster wrote: "It would be even more comfortable if middle click (or ctrl-click or whatever combination that specific browser uses) would open the page in a new tab.

If you are interested, there is a JavaScript import to open search in a new tab
via Ctrl-click (PC) and Command-click (Mac). The Command key is the Apple key
on Apple keyboards. See: 
http://commons.wikimedia.org/wiki/User_talk:Timeshifter/Open_search_in_new_tab.js

A related feature request is bug 35974. Preference or default setting to open
search result lists and suggestions in new tab.
Comment 10 [no longer active user] 2012-08-14 17:39:18 UTC
@Krinkle: I think it is possible to delete that JS modifications and let viewer select what they want to do with results. If viewer want to open search result on the same tab, they click on that result and if they want to see that result on new tab, they middle-click or ctrl+click on that result. Please let me know if this is  not possible.
Comment 11 [no longer active user] 2012-09-12 20:50:45 UTC
@Krinkle: "Just wrapping them in <a> doesn't work (if so, that would've been done in the first place)." they didn't do that because they used /resource/query/jquery.suggestion.js for making suggestion menu. 
Fixing Bug 35974 is easy by using this trick: http://css-tricks.com/snippets/html/form-submission-new-window/ but this is not a right way I guess.

But for fixing this bug I have a question, can I propose a modification on  https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/core.git;a=blob;f=resources/jquery/jquery.suggestions.js ? And can I don't use form.submit() on my solution?
Comment 12 Bartosz Dziewoński 2012-09-13 17:57:20 UTC
In gerrit: https://gerrit.wikimedia.org/r/#/c/23674/ (based on patch by Ebrahim Byagowi).
Comment 13 Bartosz Dziewoński 2013-01-26 18:44:36 UTC
Change I87940ca8 (linked in previous comment) merged.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links