[19. April 2013] A-400 Advanced Network Setup now available | [11 Jan. 2013] Customize your A-400 Home Screen

Firmware: A-400 [13 May 2013] | C-300 [30 Nov. 2012] | A-300 [30 Nov. 2012] | C-200 [21 Jan. 2013] | A-200/A-210 [10 Aug. 2012]

Just got your NMT | WIKI has the answers | Search the forum | Forum Rules/Policy | Firmware & Official NMT News | Popcornhour manuals



User(s) browsing this thread: 1 Guest(s)
Thread Closed 
help with onfocusset or similar
06-23-2010, 12:02 AM
Post: #1
help with onfocusset or similar
Hi,

I have always been a big fan of ExtendedGayaExtended and i have tweaked my version quite a bit.

While i managed to do stuff like starting my NAS by hitting the red button and mounting it with the green button, i have had another idea that i haven't been able to implement yet:

I wanted to add a bookmark functionality, that allows to add either files or directories to the bookmarks while browsing. I wanted to do this by just creating a folder in which i will create or delete symlinks to the desired objects. So when i am browsing through a folder i want to focus one of the files or folders and hit for example the "info"-button which leads to a cgi-script being executed that will create a symlink in the bookmark folder.
Probably with one of the other colored buttons i would then switch to this bookmark folder where i could access all the bookmarks and also remove bookmarks (same or different button).

I thought this wouldn't be very complicated, but i am having trouble passing the correct parameter to my cgi-script that will create the symlink. i somehow need to know which entry is currently selected. I tried adding invisible href's and added the "onfocusset" attribute to the visible links, having it refer to a inivisible link by using the filename and having the tvid attribute in that invisible link.
For each actual link i would have an invisible link, each with a different call of the cgi script, each using its own filename as a parameter, but for some reason it will always call my cgi-script with the filename of the first entry.

I realize that i am having a hard time explaining this. Maybe the problem can be simplified: I have a webpage with several links on it, and i want to use a particular button of the remote (like the info button) to call a certain cgi-script and pass the name of the current link on to that script. How can this be done?

Thanks very much for any help!
Obviously i would be willing to share my results in case anyone is interested...

Cheers

The Dude
Find all posts by this user
06-23-2010, 07:01 PM
Post: #2
RE: help with onfocusset or similar
i'm not possitive its exactly like you're looking for... but check out the "Additional notes" section in this...

http://www.networkedmediatank.com/wiki/i...umentation

Pannasonic Plasma 50" -->HK254-->Emotiva xpa-5 & upa-2
A100 w/ 500gb HDD, A200 w/ mn100, c200 w/ 2.5" 250gb
Calm 2.1, YAMJ - Redefined 1.8a skin, Music Jukebox 8
WHS ex490 w/ 2.5tb's
Find all posts by this user
06-23-2010, 08:53 PM
Post: #3
RE: help with onfocusset or similar
Thanks for the reply.
I have actually read this, though i was unable to make it work. I will try again, harder Smile
I will let you know if it works.
thanks again
Find all posts by this user
06-23-2010, 09:08 PM (This post was last modified: 06-23-2010 09:10 PM by excal.)
Post: #4
RE: help with onfocusset or similar
actually re-reading it, i think you may wanna do something a bit different.


So for example say you have 5 links.

you'd need two scripts


Code:
function setTVID(x)
{
document.getElementByID('id'+x).setattribute('tvid','info');

return false
}

function turnOffTVID(x)
{
document.getElementById('id'+x).setattribute('tvid',' ');
}

function goToCgi(x)
{
script to pass on the file name to your cgi file.
}


Code:
<a href="blah blah" onclick="goToCgi('yourFileNameHere')" id="link1" onfocus="setTVID(1)" onblur="turnOffTVID(1)" tvid=" ">link1</a>


<a href="blah blah" onclick="goToCgi('yourFileNameHere')" id="link2" onfocus="setTVID(2)" onblur="turnOffTVID(2)" tvid=" ">link1</a>


<a href="blah blah" onclick="goToCgi('yourFileNameHere')" id="link3" onfocus="setTVID(3)" onblur="turnOffTVID(3)" tvid=" ">link1</a>


<a href="blah blah" onclick="goToCgi('yourFileNameHere')" id="link4" onfocus="setTVID(4)" onblur="turnOffTVID(4)" tvid=" ">link1</a>


<a href="blah blah" onclick="goToCgi('yourFileNameHere')" id="link5" onfocus="setTVID(5)" onblur="turnOffTVID(5)" tvid=" ">link5</a>

actually instead of onfocus= and onblur= you might need to use onmouseover= and onmouseout= instead...

You could always just use both to be safe.

Pannasonic Plasma 50" -->HK254-->Emotiva xpa-5 & upa-2
A100 w/ 500gb HDD, A200 w/ mn100, c200 w/ 2.5" 250gb
Calm 2.1, YAMJ - Redefined 1.8a skin, Music Jukebox 8
WHS ex490 w/ 2.5tb's
Find all posts by this user
[+] 1 user says Thank You to excal for this post
06-23-2010, 11:17 PM
Post: #5
RE: help with onfocusset or similar
Thanks again for helping me out.

I did actually just manage to do it with the underscore thing. At first it seemed to me that the whole underscore thing wasn't working, but the actual problem was something, i already learned but forgot again.
When i am trying to call a php script i have to refer to it with http://127.0.0.1:8088/stream/file=/share...okmark.php
if i don't use the odd looking whole 127.0.0.1 link it just isn't working.

After i did that, i was able to do everything i wanted. So now i can add Bookmarks by clicking the "info" button and also remove them.
I like it..


alot Smile

Thanks again for your tips!!
Find all posts by this user
06-30-2010, 08:02 AM
Post: #6
RE: help with onfocusset or similar
Even though very few might be interested in this, i am posting my changes here as i was asked by one fellow board member and this way it might help others as well.
I am not attaching my complete set of files, as i have made many changes to it over time, most of which are probably only aprreciated by me Smile

First of all i added just one line to the files.dat (in the delhy theme folder) around line 187 (behind the ENDLISTING comment):

Code:
<a  href="http://127.0.0.1:8088/stream/file=/share/Apps/bookmark.php?focus=" tvid="_info">

Then i created a file called bookmark.php in my APPS folder and made it executable.
This file contains the following;
PHP Code:
<?php

$link 
$_GET['focus'];
$pathpos strpos($link,"path=") + 5;
$path substr$link$pathposstrlen($link) );

if ( 
substr$path, -) == "/" 

    
$slashpos strrpos(substr ($path0,strlen($path)-1),"/")+1;
    
$link substr($path$slashpos);
    
$link substr$link0,-);
} else
{
    
$slashpos strrpos$path,"/")+1;
    
$link substr($path$slashpos);
}

$current_path substr $path0$slashpos );

if (
substr $current_path, -17) == "/Bookmarks/")
{
    
unlink "/share/Bookmarks/" $link );
    echo 
"<h2> <a href='javascript:history.back()'>" $link " remove from bookmars</a></h2>"
}
else
{
    
symlink $path"/share/Bookmarks/" $link );
    echo 
"<h2> <a href='javascript:history.back()'>" $link " added to bookmarks</a></h2>"
}

?>

This code is certainly far from being perfect, but it works Smile
If you browse to the Bookmarks folder you will see the symlinks. I also created a shortcut (blue button) to quickly navigate to it. Another thing i encountered was that displaying the Bookmarks folder was particularly slow, when it contained links to my NAS and the NAS was turned off. I had to manipulate the sorting mechanism as it will alway try to get a timestamp for each link, which will timeout after some time and thus lead to a significant delay. But this will not affect you if you don't have any "dead" links.

@michael1t: if you have any questions about it, probably best to ask them in this thread

have fun
Find all posts by this user
07-02-2010, 07:57 PM (This post was last modified: 07-02-2010 08:00 PM by michael1t.)
Post: #7
RE: help with onfocusset or similar
Hello El_Duderino,

Thanks for the Post ...

I am sorry I wasted your time ...
I was looking a Mono book mark function ...
Do You have Any Mono Php code ?

Audio playback ...
video playback ...

but thanks for the post ....

Michael T.

A100 & C200 Movie Flow, Music Video Flow, Media Menu Flow, Music Flow, Photo Flow
Click Here Media Flow Forum
The Complete Media Flow Suite ...
Visit this user's website Find all posts by this user
Thread Closed 


Forum Jump: