Author Topic: Open in new window code for file system.  (Read 4248 times)

0 Members and 1 Guest are viewing this topic.

Offline fPortal

  • Occasional poster
  • *
  • Posts: 14
    • View Profile
Open in new window code for file system.
« on: February 09, 2009, 02:07:41 AM »
I have been looking and cannot find this.
On my file system, I have my lists of folders and files, but I have a link as well.  Is there a way to make that link open in a new window like with a target command?

Offline fPortal

  • Occasional poster
  • *
  • Posts: 14
    • View Profile
Re: Open in new window code for file system.
« Reply #1 on: February 09, 2009, 02:08:55 AM »
Nevermind, I found a way in the template file.

Thank you anyway.

Offline chthonic

  • Tireless poster
  • ****
  • Posts: 121
  • I own the copyright to this image... "Back Off!"
    • View Profile
Re: Open in new window code for file system.
« Reply #2 on: March 05, 2009, 02:16:56 PM »
I was trying to locate the code I was given before for the same thing and I cant find my original post anywhere!.. would you mind sharing how you did it?

it would be greatly appreciated

Offline rejetto

  • Administrator
  • Tireless poster
  • *
  • Posts: 12949
    • View Profile
Re: Open in new window code for file system.
« Reply #3 on: March 06, 2009, 02:05:59 PM »
mmm, i think this behavior should be included in the default template.

if no one disagrees with this, i will just go this way.

Offline chthonic

  • Tireless poster
  • ****
  • Posts: 121
  • I own the copyright to this image... "Back Off!"
    • View Profile
Re: Open in new window code for file system.
« Reply #4 on: March 06, 2009, 02:10:10 PM »
LOL hi rejetto!


it would be a very useful thing.... even tho I searched the template code and made manual changes... it was still a bit of a task.. to make sure I didnt mess anything else up.

this would also prevent users from accidentally navigating away from the host site

Offline r][m

  • Tireless poster
  • ****
  • Posts: 347
    • View Profile
Re: Open in new window code for file system.
« Reply #5 on: March 06, 2009, 03:43:25 PM »
Quote
mmm, i think this behavior should be included in the default template
Would be OK, but it can be done when setting url for link in vfs like:
Code: [Select]
http://www.google.com/"target=blank"

Offline rejetto

  • Administrator
  • Tireless poster
  • *
  • Posts: 12949
    • View Profile
Re: Open in new window code for file system.
« Reply #6 on: March 06, 2009, 07:58:35 PM »
this test should be ok to detect URLs outside hfs

check url for "://" and not (%host% or %ip%)

in template macros translates to

{.and| {.pos|://|%item-url%.} | {.not|{.pos|%host%|%item-url%.}{.pos|%ip%|%item-url%.}.}

Offline chthonic

  • Tireless poster
  • ****
  • Posts: 121
  • I own the copyright to this image... "Back Off!"
    • View Profile
Re: Open in new window code for file system.
« Reply #7 on: March 06, 2009, 10:17:53 PM »
I just added the target=_blank to the two sections in terayon 1.3.2 that handle URL's

as I said.. had to be very careful and make sure I wasnt messing up other links

having this be a default function is less hassle

Offline bacter

  • Operator
  • Tireless poster
  • *****
  • Posts: 682
    • View Profile
Re: Open in new window code for file system.
« Reply #8 on: March 07, 2009, 12:04:18 AM »
There are also many cases where we dont want that a link opens a new browserwindow. If the user want's to open the link in a new window or tab, he can already do so rightclicking on the link.
your computer has no brain - use your own !

Offline chthonic

  • Tireless poster
  • ****
  • Posts: 121
  • I own the copyright to this image... "Back Off!"
    • View Profile
Re: Open in new window code for file system.
« Reply #9 on: March 07, 2009, 12:15:19 AM »
that's why they are called "options"

one could be to open in a new window.. another could be to force it to open in a frame and keep it on the same site with navigation.. that way you can view the external and still not leave the HFS server.

I use picture galleries because 250+ images load faster than if I used the thumbnail generator for the template... as a result.. its less hassle for those to open as a new window.

it's a simple matter regarding "ease of use"

I have several people asking me how to setup HFS and stunnel etc... more than willing to show them how.. but they aren't as computer technical as I am.. so they need easier options.

Offline rejetto

  • Administrator
  • Tireless poster
  • *
  • Posts: 12949
    • View Profile
Re: Open in new window code for file system.
« Reply #10 on: March 09, 2009, 11:58:09 PM »
There are also many cases where we dont want that a link opens a new browserwindow. If the user want's to open the link in a new window or tab, he can already do so rightclicking on the link.

ok. you suggest it is not good that we do it always (by default) ?

i will delay this thing so that we can decide for the better.
maybe an option in the gui is the correct solution.
a global option, or inside the link itself.
unsure.
« Last Edit: March 10, 2009, 12:00:58 AM by rejetto »

Offline rejetto

  • Administrator
  • Tireless poster
  • *
  • Posts: 12949
    • View Profile
Re: Open in new window code for file system.
« Reply #11 on: March 10, 2009, 02:15:27 AM »
Would be OK, but it can be done when setting url for link in vfs like:
Code: [Select]
http://www.google.com/"target=blank"

very nice workaround!

Offline chthonic

  • Tireless poster
  • ****
  • Posts: 121
  • I own the copyright to this image... "Back Off!"
    • View Profile
Re: Open in new window code for file system.
« Reply #12 on: March 10, 2009, 12:24:13 PM »
make it an option in the gui.. that way we can decide on a per link basis.. something like...

option1: default = open in same window
option2: open in new tab
option3: open in new window

with additional option to make it the default behavior ... which can be over-ridden by custom link settings such as...

LINK OPTIONS: then can choose how that particular link works

« Last Edit: March 10, 2009, 12:30:28 PM by chthonic »

Offline Kremlin

  • Tireless poster
  • ****
  • Posts: 137
    • View Profile
Re: Open in new window code for file system.
« Reply #13 on: March 11, 2009, 12:14:41 AM »
Found r][m solution very good, simple and effective.

Offline rejetto

  • Administrator
  • Tireless poster
  • *
  • Posts: 12949
    • View Profile
Re: Open in new window code for file system.
« Reply #14 on: March 12, 2009, 06:31:32 PM »
there's nothing i can do to decide to open in tab or window.
this depends on the browser.
i guess a flag "open in new window" in the link properties is a good solution.

r][m solution is good, but cannot be thought as general solution for the masses.