Page 1 of 1

about external links, when they are photos ...

Posted: Tue Dec 30, 2008 5:13 pm
by Pierre-Olivier
Hello,

As I'm stil in "learning" phase. I experiment a lot.

I accidentally discover the possibility of adding external links to records. I was drag & dropping my own covers to my books, and I released the mouse's button before being in the cover area. So the picture "fall", in the blue-grey area where are shown the infos.

I was surprised to see the name of the photo appearing in this area. More surpised was I, since I clic on it and see the whole photo on the screen. It took a certain amount of time to understand how I can get rid of this photo.

This feature could be very practical, since I'm accustomed to scan the 2 sides of the cover (the summary is in the back of the book. But there's one default to the way it functions now : If you move the photo elsewhere on the hard drive, the link is broken. I would be possible of course to move a folder in the same folder that contains the Pedia files, but I like having my files in definite places, that could change.

So would'nt it be possible in future release that the links shoud be placed really, in a folder of the Pedia. I Know it's equal to double an existing file ... but now the Hard drive are far from being so expensive as in the past, and they are really big. Even better, it would be great if certain links (such as .jpg or other photos) could be always dispayed in the info area.

Re: about external links, when they are photos ...

Posted: Wed Dec 31, 2008 5:07 am
by Conor
Glad you discovered the linking feature. It's quite useful due to it 's flexibility. We are looking at using aliases instead of file paths in the future that allow the file to be moved and still be found. However we are not 100% behind aliases as aliases are more complicated and also work inconsistently when changing machines. In the edit window under links you can select a link and then use the "move" button, this will have Bookpedia take over the file and move it in with the database folder of the pedias. You no longer would have to worry about the location of the file, just like you don't worry about the main cover file. Remember to backup your entire data folder, so that the moved files are also backed up.

We have considered an inline browser for images so that they can be seen in the info view, but we haven't quite figured how it would work yet. If all your links are images you could modify the info view template to display all links as images, instead of the link name. You add the following img tag somewhere inside the [linksBegin] and [linksEnd] tags.

Code: Select all

<img src="[link:url]" title="[link:name]" />

Re: about external links, when they are photos ...

Posted: Wed Dec 31, 2008 5:40 am
by Jonas
I only use the links for images (back cover, poster and screenshot), and I think it would be fantastic to display them in the info-view.
But I can't get the code <img src="[link:url]" title="[link:name]" /> to work. I put it inside the [linksBegin] and [linksEnd], but I only get the "little blue square with the ?"-image for every link. Does anyone else get this to work?

Re: about external links, when they are photos ...

Posted: Sat Jan 03, 2009 6:27 am
by Conor
I forgot that the URL is treated differently inside the info view. It gets prefixed with "pedia://bruji.com/loadLink=" so that when clicked Bookpedia gets a chance to do anything special it needs to do. For this reason when [link:url] is used in the src attribute of the img tag it makes no sense, and a blue question mark appears. Sorry about misleading you.

Since you seem to know your way around an HTML page, try a little javascript to remove the prefix. At the top near the CSS style add the function:

Code: Select all

<script type="text/javascript">
function removeUnwantedPrefix() {
// pedia://bruji.com/loadLink= is the prefix that we want to remove from img tags
	links = document.getElementsByTagName('img');
	
        for (indexX in links) {
		nextLink = links[indexX];
		if (nextLink.src.indexOf('pedia://bruji.com/loadLink=') !=-1) {
			nextLink.src = nextLink.src.substring(27, nextLink.src.length);
		}
	}
}
</script>
Then the <body> tag change for

Code: Select all

<body onload="removeUnwantedPrefix();">

Re: about external links, when they are photos ...

Posted: Sat Jan 03, 2009 9:56 am
by Pierre-Olivier
Conor wrote:Glad you discovered the linking feature. It's quite useful due to it 's flexibility. We are looking at using aliases instead of file paths in the future that allow the file to be moved and still be found. However we are not 100% behind aliases as aliases are more complicated and also work inconsistently when changing machines. In the edit window under links you can select a link and then use the "move" button, this will have Bookpedia take over the file and move it in with the database folder of the pedias. You no longer would have to worry about the location of the file, just like you don't worry about the main cover file. Remember to backup your entire data folder, so that the moved files are also backed up.
Thank you for your Answer Conor. I've just tried it. I will Use it. But, from my point of view, there's one default : It moves the original file. I would have prefered it to be just copied, since I prefer having my original Files remaining in a safe place. I will just make a copy of all my back cover files before using the move function. In htis case, I don't mind if the copies are moved. But, if you could add a "copy" button, I think it will be nearly perfect ... :D
Conor wrote:We have considered an inline browser for images so that they can be seen in the info view, but we haven't quite figured how it would work yet. If all your links are images you could modify the info view template to display all links as images, instead of the link name. You add the following img tag somewhere inside the [linksBegin] and [linksEnd] tags.

Code: Select all

<img src="[link:url]" title="[link:name]" />
I must acknowledge that I don't understand what you say here, sorry.

Re: about external links, when they are photos ...

Posted: Sat Jan 03, 2009 11:02 am
by Conor
The view that display the information for the movie is based on HTML and can be customized. Although without HTML knowledge that can be complicated. Click on [url=bookpedia://www.bruji.com/download?temp/linkImages.zip]this link[/url] and it will install a version of the default view that displays all links as images instead of the name link. To try it out after installing, restart Bookpedia and look in the preference under the style tab, the info view style pop up should have an option "CollectionImages". Select that style to show links as images.

Re: about external links, when they are photos ...

Posted: Sat Jan 03, 2009 2:11 pm
by Jonas
I added the code to my info view-template and it works fine. When I add a new image to the links the image is visible in the info-view.

But when I then select the image/link inside the "Links"-window and click on "download" or "move" to get the image inside the pedia-folder, the image will no longer be displayed in the info-view. I just get the blue square again.

Re: about external links, when they are photos ...

Posted: Sun Jan 04, 2009 6:00 am
by Conor
I was hoping that you would not move them into the data folder. DVDpedia does not resolve the link to the data folder unless the link is clicked. The link is relative so that the data folder can be moved and the link still works. I will look at resolving it for a future version but in the meantime address that in the Javascript. Have it change "[Data Folder]" for the path to your database, the inside of the Javascript for loop would be:

Code: Select all

if (nextLink.src.indexOf('pedia://bruji.com/loadLink=') !=-1) {
    nextLink.src = nextLink.src.substring(27, nextLink.src.length);
    var indexStart;
    if ((indexStart = nextLink.src.indexOf('%5BData%20Folder%5D')) !=-1) {
         nextLink.src = 'file:///Users/username/Library/Application%20Support/DVDpedia' +  nextLink.src.substring(indexStart + 19, nextLink.src.length);
    }
}
Update the username part of the path to reflect your username, this also assumes the default location for the data folder.

Re: about external links, when they are photos ...

Posted: Sun Jan 04, 2009 7:38 am
by Jonas
That works just great! Thank you very much for the help.