rejetto forum

Generate download/mailto link on hover

Miggi03 · 11 · 9330

0 Members and 1 Guest are viewing this topic.

Offline Miggi03

  • Occasional poster
  • *
    • Posts: 4
    • View Profile
Dear all.

Firstly I would like to say thanks for this great software and apologize if this has been asked.

I am looking for a way to add the option of generating a mailto link for each file.

I have done some digging through the template and realise this maybe more of a JQuery question but I thought I would ask here in case I am missing a simpler method.

What I have so far is

$(function() {
   // Item Info
   var itemFader = 0;   
   $('.item').hover(function() {
      clearTimeout(itemFader);
      $('.preview', this).stop(true,true).fadeIn('fast');
      $('#item-info').css({'top':$(this).position().top + 54, 'left':$(this).position().left});      
      $('#item-access').html($(this).attr('item-access'));
      $('#item-added').html($(this).attr('item-added'));
      $('#item-dl-count').html($(this).attr('item-dl-count'));
      $('#item-comment').html($(this).attr('item-comment') ? $(this).attr('item-comment') : 'No information available!');

I guess this is calling functions from within HFS so even with JQuery additions this may be a waste of time?

The long term goal is to call to function a mailto link which populates the subject field in Outlook "You have a new file" etc and the body to populate with the Hyperlink to the file.

Please forgive my ignorance on the matter. I am keen to learn and any advice is appreciated.

Regards,

Michael.


Offline bmartino1

  • Tireless poster
  • ****
    • Posts: 910
  • I'm only trying to help i mean no offense.
    • View Profile
    • My HFS Google Drive Shared Link
unknown why you want it on hover...

Your template code needs the actual html information...
http://www.w3schools.com/html/tryit.asp?filename=tryhtml_mailto


Html code:
<p>
This is an email link:
<a href="mailto:someone@example.com?Subject=Hello%20again" target="_top">
Send Mail</a>
</p>
Files I have snagged and share can be found on my google drive:

https://drive.google.com/drive/folders/1qb4INX2pzsjmMT06YEIQk9Nv5jMu33tC?usp=sharing


Offline bmartino1

  • Tireless poster
  • ****
    • Posts: 910
  • I'm only trying to help i mean no offense.
    • View Profile
    • My HFS Google Drive Shared Link
also take a quick look at this forum:
http://www.rejetto.com/forum/html-templates/hfs-templates-vars-and-section-help/

AS it contains some of hfs basic scripting "constant" variables...
Files I have snagged and share can be found on my google drive:

https://drive.google.com/drive/folders/1qb4INX2pzsjmMT06YEIQk9Nv5jMu33tC?usp=sharing


Offline Miggi03

  • Occasional poster
  • *
    • Posts: 4
    • View Profile
unknown why you want it on hover...

Your template code needs the actual html information...
http://www.w3schools.com/html/tryit.asp?filename=tryhtml_mailto


Html code:
<p>
This is an email link:
<a href="mailto:someone@example.com?Subject=Hello%20again" target="_top">
Send Mail</a>
</p>

I supposes hover is not relevant. I might have phrased my question badly, what I am looking for is a method to be able to tick box 2 or more files, add them in the form of a download link in the contents of an email through the use of a template.

Thanks.



Offline bmartino1

  • Tireless poster
  • ****
    • Posts: 910
  • I'm only trying to help i mean no offense.
    • View Profile
    • My HFS Google Drive Shared Link
(i'm at a cross as i think this post should be in html and templates...)

Okay, to clarify, you are wanting an hfs template script that will allow you to select files on the html side, that will then "zip" the files and add them to an attachment to be emailed out???

---
hmmm,

To do this, you either have to have all the possible combination of the files "zipped" (which will take up space)
Or
have a separate batch that will run to get the "files ready to be emailed"
---

Then only way i logical see this working (at least to me, there are plenty of other ways...) is to have a snpt client(email program) on your hfs machine. In which the hfs machine will be sending emails out...


The hfs machine (in a template) would run a script (suchas 7 zip which would zip the files selected in the html via string variables...) and put the zipped files in a real folder on your hfs

(then you can add passwords to the zipped folders/ or have them go to that link and setup a deletion period / or setup a script that would open an email client using you snmpt and send the zip via a program.)

once you have successfully have a template that will zip files and place them in a location (with a deletion period) it then comes down how you want the client users to obtain a zipped file...
----

I will not give you the code, nor help you program it, but i will give you a tool that might help.

Download 7zip portable program:
http://sourceforge.net/projects/sevenzip/files/7-Zip/4.42/7za442.zip/download?use_mirror=softlayer-dal&download=

You will need these files in your "c:\windows\system32\"


So you will be able to call a directory with a zip command such as
http://www.dotnetperls.com/7-zip-examples

batch---
7z (info from switches form above link...)
---

Form there you should be able to put something together...

And/or a more experienced user on the rarw side can help...
« Last Edit: June 19, 2014, 03:02:01 PM by bmartino1 »
Files I have snagged and share can be found on my google drive:

https://drive.google.com/drive/folders/1qb4INX2pzsjmMT06YEIQk9Nv5jMu33tC?usp=sharing


Offline bmartino1

  • Tireless poster
  • ****
    • Posts: 910
  • I'm only trying to help i mean no offense.
    • View Profile
    • My HFS Google Drive Shared Link

7-Zip (A) 4.42  Copyright (c) 1999-2006 Igor Pavlov  2006-05-14

Usage: 7za <command> [<switches>...] <archive_name> [<file_names>...]
       [<@listfiles...>]

<Commands>
  a: Add files to archive
  d: Delete files from archive
  e: Extract files from archive (without using directory names)
  l: List contents of archive
  t: Test integrity of archive
  u: Update files to archive
  x: eXtract files with full paths
<Switches>
  -ai[r[-|0]]{@listfile|!wildcard}: Include archives
  -ax[r[-|0]]{@listfile|!wildcard}: eXclude archives
  -bd: Disable percentage indicator
  -i[r[-|0]]{@listfile|!wildcard}: Include filenames
  -m{Parameters}: set compression Method
  -o{Directory}: set Output directory
  -p{Password}: set Password
  -r[-|0]: Recurse subdirectories
  -scs{UTF-8 | WIN | DOS}: set charset for list files
  -sfx[{name}]: Create SFX archive
  -si[{name}]: read data from stdin
  -slt: show technical information for l (List) command
  -so: write data to stdout
  -t{Type}: Set type of archive
  -v{Size}[b|k|m|g]: Create volumes
  -u[-][p#][q#][r#][x#][y#][z#][!newArchiveName]: Update options
  -w[{path}]: assign Work directory. Empty path means a temporary directory
  -x[r[-|0]]]{@listfile|!wildcard}: eXclude filenames
  -y: assume Yes on all queries
Files I have snagged and share can be found on my google drive:

https://drive.google.com/drive/folders/1qb4INX2pzsjmMT06YEIQk9Nv5jMu33tC?usp=sharing


Offline Miggi03

  • Occasional poster
  • *
    • Posts: 4
    • View Profile
Hi, thank you for your replies however I seem to no be getting my requirment across properly.

I do not wish to zip multiple files.

If I wrote an example of the email I wish to send perhaps that would clarify things.

*EXAMPLE*

Dear whoever. <- The user would populate this field.

Attached are files for you to download <-- The user would write this as well.

HFS Would programmatically add these links to the body of the email.

https://miggi03isadickhead.co.uk/PICTURE001.jpg
https://miggi03isadickhead.co.uk/PICTURE002.jpg
https://miggi03isadickhead.co.uk/INSTRUCTIONS.PDF

*END EXAMPLE*

So to clarify I wish to add multiple download links, not files to the email.

Thanks for your patience,


Offline bmartino1

  • Tireless poster
  • ****
    • Posts: 910
  • I'm only trying to help i mean no offense.
    • View Profile
    • My HFS Google Drive Shared Link
Okay,

So we want to revers this project...
Some how, you want the hfs machine or hfs program itself to receive and read an email

in which hfs would auto setup download links to the (attachments or files requested somewhere in hfs itself)???
an email out to the user with a reply for the download links?

---
Which would be possible by adding and empty folder (a constant path and adding the files to that folder)
Which would create the download links...
---

or are you wanting a list of files on you hfs server in which a user would receive the sample email you have written?
---

More information is required and i don't have any solutions nor steps to help you any further... A more experienced user in rarw would be of better help...
Sorry :/

Good luck!
Files I have snagged and share can be found on my google drive:

https://drive.google.com/drive/folders/1qb4INX2pzsjmMT06YEIQk9Nv5jMu33tC?usp=sharing


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
welcome miggi!
So, your code is popping up a panel with more features about the file. You then want to offer the mailto link.
What is stopping you at the moment?

Quote
I guess this is calling functions from within HFS so even with JQuery additions this may be a waste of time?

i don't understand what you mean. I think jquery is a good solution for your task.


Offline Miggi03

  • Occasional poster
  • *
    • Posts: 4
    • View Profile
welcome miggi!
So, your code is popping up a panel with more features about the file. You then want to offer the mailto link.
What is stopping you at the moment?

i don't understand what you mean. I think jquery is a good solution for your task.

Hello and thanks for the welcome.

My lack of knowledge is what is stopping me from implementing this. I can make the mailto link appear on the page but I don't know how to add the specific file that I hover over.

Please see the example mock up attached.
« Last Edit: June 30, 2014, 01:56:15 PM by Miggi03 »


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
you can use jquery commands to read the URL of the file.
how to do this depends on the template you are using.
since that seems like a table, this is probably close to what you need, but it may needs some adaptation

$(this).closest('tr').find('a:first').attr('href')

You'd better have a programmer friend and ask for help :)