owncloud-archive / news

:newspaper: News app for ownCloud
GNU Affero General Public License v3.0
290 stars 106 forks source link

Open article in background tab #849

Closed stormsh closed 9 years ago

stormsh commented 9 years ago

Hello there, since a function to open articles in tabs is already there, I would like to suggest a shortcut to open an article in a background tab. I don't know which key would be the best for such a shortcut, but the "B" is still available. Also I don't know if it's hard to implement for different browsers. Just let me know what you think.

st.

cosenal commented 9 years ago

I am ok with this. @BernhardPosselt Since it's an easy task, why don't we leave it open and encourage potential new contributors to take it?

BernhardPosselt commented 9 years ago

Background Tab?

cosenal commented 9 years ago

@BernhardPosselt AFAIU the OP is asking for a keyboard shortcut that opens the web page of the article in a new tab without moving the focus on that tab.

BernhardPosselt commented 9 years ago

I see, great idea if its easy to do :)

BernhardPosselt commented 9 years ago

The file that needs to be edited is this one, simple jQuery basically: https://github.com/owncloud/news/blob/master/js/gui/KeyboardShortcuts.js

Don't forget to compile the JS and CSS afterwards like described here https://github.com/owncloud/news/tree/master/js#javascript--css-development

stormsh commented 9 years ago

Thanks, I should use the speelcheka moore offden ;)

tgrosinger commented 9 years ago

Hmm, I gave this a shot. Even got the new keyboard shortcut working.

Sadly from what I have been reading it doesn't look like you can reliably (at all?) open new tabs in the background. It's a per-browser setting and if the user has new tabs set to open in the foreground then I don't think you can do anything about it from Javascript.

BernhardPosselt commented 9 years ago

@tgrosinger let's close the issue then?

tgrosinger commented 9 years ago

Yes, unfortunately.

stormsh commented 9 years ago

@tgrosinger Ok, what a pitty. But to open all in tabs would work? So that the last tab opened by the news app would be in focus?

tgrosinger commented 9 years ago

Yes, I think that is how it would work. What's interesting though is on mobile (at least Chrome on Android) when you open a link in a new tab it automatically opens it in the background. Curious that it isn't allowed on desktop.

stormsh commented 9 years ago

@tgrosinger On desktop you can use addons like tab mix plus to define tab behavior. That addon for instance is not available for the mobile browser. It could be that the tab behavior options in the mobile browser are limited to simplify user experience. Could you have a look at #850? I would appreciate it :) since you basically got it working ;)