Php photo gallery TWG | JFUploader | TWG Flash upload | WFU | Forum

Get help for TinyWebGallery, the best image gallery. The forum is also home for the Joomla JFUploader, TWG Flash Uploader and the Wordpress flash uploader.
It is currently 29. Mar 2024, 00:58

This forum is readonly now. Please use the new forum if you don't find the answer to your question here. The new forum is at https://www.tinywebgallery.com/blog/forum/


All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Opening files directly
PostPosted: 10. Jan 2014, 14:06 
Offline

Joined: 10. Jan 2014, 11:10
Posts: 7
Location: Hungary, 47.531169,21.600793
Hi,

First of all, thank you for that great component. I would like to know whether there is a way opening the files directly from the flash by doubleclick on the name of the file?I have read something similar in the „How I open PDF file ones I upload in a new window” topic, and already watched all the demos, but I couldn't set up that. I have a Standart Edition License, which runs on a Joomla 1.5.


Top
 Profile  
 
PostPosted: 10. Jan 2014, 17:16 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
No - This is not supported directly by the list component.
But you can set $show_full_url_for_selected_file=true. than you get a direct link in the status bar which you can click and which opens the file directly.

The other option is that if you select a file a direct link is generated below the flash where you can than open it in anything you like (new window, lighbox..). Se the pro demo for an example.

Best, Michael


Top
 Profile  
 
PostPosted: 13. Jan 2014, 22:16 
Offline

Joined: 10. Jan 2014, 11:10
Posts: 7
Location: Hungary, 47.531169,21.600793
Thanks for your reply. I've already switch on the 'Show full url' option on the 'Registered Flash Uploader setting' tab, and the direct link appeared, but I don't want to show the full path, and it doesn't work on FireFox and Opera, because of the UTF-8 encoding characters.
So the second option would be interested for me, but I can't find its way exactly. I think you mean this demo: http://www.tinywebgallery.com/en/tfu/web_demo2.php as pro demo, and I've downloaded the tfu_demo_reg.zip as well, but unfortunetly it couldn't help for me.
However I've set to 'something' the 'Enable Javascript preview call' on the 'Registered Flash Uploader settings' and on the 'Joomla Settings' tab set the 'Text after the flash' to the following:
<script type="text/javascript">
function previewSelect(loc,id,fullname) {
window.open(fullname,'_blank');
}
</script>

It works, opens the selected file, but at least twice. How can I avoid the multiply opening?

Regards, Róbert


Top
 Profile  
 
PostPosted: 14. Jan 2014, 00:05 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
preview select is than called twice by the flash. I have to check why this happens.

Meanwhile you can simply catch the 2nd call. use a global counter variable which only return the file if the counter is even.

So something like this (untested):
<script type="text/javascript">
var counter = 0
function previewSelect(loc,id,fullname) {
if (counter++ % 0) {
window.open(fullname,'_blank');
}
}
</script>

Best, Michael


Top
 Profile  
 
PostPosted: 14. Jan 2014, 22:26 
Offline

Joined: 10. Jan 2014, 11:10
Posts: 7
Location: Hungary, 47.531169,21.600793
Well, I tried your suggestion, but unfortunately it didn't work. I think it should be used a well known variable from outside the script, which remain after the script, such as the identity of the new window, so I was looking for a while, and wrote this:
<script type="text/javascript">
function previewSelect(loc,id,fullname)
{
if (typeof(MyWin)== 'undefined')
{
MyWin = {};
}

if (typeof(MyWin[id])== 'undefined' || MyWin[id].closed)
{
MyWin[id]=window.open(fullname,id,'titlebar=no');
MyWin[id].moveTo(0,0);
}
else
{
// MyWin[id].location.href= fullname;
MyWin[id].focus();
}
}
</script>

This script opens only ones those files, which have as extension as the browser opens in a new window, these files are typically images. But, if you click on a file which has an unknown extension (for the browser), you will get many dialog forms (to choose between the opening and downloading). The number of the dialog boxes is 2+n, where n is the number of the calling the previewSelect function, that equal the click on the file names after the last load the whole site/flash.
So, is there a reason why calls the flash more and more that same script, and if it is, how can I bypass it?

Best, Róbert


Top
 Profile  
 
PostPosted: 14. Jan 2014, 22:53 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
As I said. I have to check why it is called twiche.
counter is outside the function so it should work fine.

Above in my script are the == missing.

Best, Michael


Top
 Profile  
 
PostPosted: 14. Jan 2014, 23:24 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
I just checked the code. for images the Javascript is called twice. Once before it it loaded and once after it is loaded.
I'll change this in the next build that it is only called one after it is loaded.

Best, Michael


Top
 Profile  
 
PostPosted: 15. Jan 2014, 12:08 
Offline

Joined: 10. Jan 2014, 11:10
Posts: 7
Location: Hungary, 47.531169,21.600793
Ok, this is the final solution:
<script type="text/javascript">
var n= 0;
var m= 0;
var i= 0;
function previewSelect(loc,id,fullname)
{
n++;
i= 0;
m= 0;
while (m< n)
{
m= m+ i;
i++;
}

if (n== m)
{
window.open(fullname,'_blank');
}
}
</script>

Thank you for your advices!

Best, Róbert


Top
 Profile  
 
PostPosted: 15. Jan 2014, 12:43 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
And I have found why it is called twice. I will update this in the next minor upate of the flash.
And I still think a simple modulo calcualation should have worked as well ;).

Best, Michael


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 19 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
cron
powered by phpbb | Datenschutz/ Privacy policy