GenoPro Home
GenoPro Home  |  Get Started With My Genealogy Tree  |  Buy  |  Login  |  Privacy  |  Search  |  Site Map
 

GenoPro Support Forum




Author for URL in GenoPro reports.
Posted Thursday, January 31, 2008 - Post #20653
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Customers
GenoPro version: 2.0.1.4

Last Login: Saturday, September 21, 2019
Posts: 16, Visits: 89
I was happy to learn about the <?html?> tag that can be used in reports. But it's a little hard for me to use for URLs. By the time I type the address twice, add quotes, etc. for a url (<a href="http://GenoPro.com">GenoPro.com</a>Wink, I am liable to have some errors. And then, in order to test it, I have to generate a report, go to a browser, and try to remember who all those people are I added URLs to.

So I added the <?url processing instruction. You can add this case to "Select Case LCase(strParams(0))" in the function StrFormatText(obj, strText) in Util.vbs.

------------------
Case "url"
  if ubound(strParams) >= 1 and lcase(strMode) = "<?text?>" then
    strTemp = strParams(1)
    if instr(strTemp, "://") = 0 then strTemp = "http://" & strTemp
    strResult = strResult & "<a target=""_top"" href=""" & strTemp & """>" & strParams(1) & "</a>" & Util.HtmlEncode(strSubParts(1))
  else
    Report.LogError Util.FormatString(Dic("ErrorTextFormat"), obj, strSubParts(0))
  end if
------------------

Now I can just type
  <?url GenoPro.com?>
in a note, instead of
  <?html?><a href="http://GenoPro.com">GenoPro.com</a><?text?>


Edited: Thursday, January 31, 2008 by BobWebster
Posted Thursday, January 31, 2008 - Post #20657
Legendary Master

Legendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary Master

Administrators
Customers
Important Contributors
FamilyTrees.GenoPro.com
GenoPro version: 3.1.0.1

Last Login: 2 days ago @ 9:23 PM
Posts: 3,464, Visits: 26,854
Thanks for that contribution Bob, a good idea.

I'll add it to the next release, but also allow optional link text where the user wants something different from the URL. e.g. <?url genopro.com\great genealogy software?>. for <a href='http://genopro.com' target='....'>great genealogy software</a> I also wonder whether target should be '_blank' and not '_top'. Any thoughts?


'lego audio video erro ergo disco' or "I read, I listen, I watch, I make mistakes, therefore I learn"
Posted Thursday, January 31, 2008 - Post #20658
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Customers
GenoPro version: 2.0.1.4

Last Login: Saturday, September 21, 2019
Posts: 16, Visits: 89
I think either a target of _blank or _top would be fine. I prefer _top, but I suspect most GenoPro users would prefer _blank.

I really like the idea of having link text for the URL. I tried it by putting a second parameter in quotes, but the parser seemed to recognize spaces inside quotes as multiple parameters. Your way looks easier to use anyway.
Posted Thursday, January 31, 2008 - Post #20661
Junior Member

Junior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior MemberJunior Member

Customers
GenoPro version: 2.0.1.4

Last Login: Saturday, September 21, 2019
Posts: 16, Visits: 89
I noticed that in an html report, when I click on a link that was added as an "external hyperlink" for an individual, it opens two idential browser windows containing that web page.

I added a preventDefault after window.open in the file script.js (below the "untested" comment). I don't know much about JavaScript events, so there's a fair chance that this may have broke something else, or it's not the best solution. But now it opens only one browser window when I click on a hyperlink. (This is a builtin external hyperlink, NOT a "<?url" or "<?html?>" link.)

case '_blank':
window.open(href);
evt.preventDefault(); // by bob
break;

This happened with Firefox and IE, locally and on the web. Original script.js date is 8/29/07. GenoPro version 2.0.1.4. Does this happen to everybody or just me? (It's possible I messed up a GenoPro file.)
Posted Sunday, February 3, 2008 - Post #20680
Legendary Master

Legendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary MasterLegendary Master

Administrators
Customers
Important Contributors
FamilyTrees.GenoPro.com
GenoPro version: 3.1.0.1

Last Login: 2 days ago @ 9:23 PM
Posts: 3,464, Visits: 26,854
Thanks again for this one Bob. Following your post I checked back on the original author's site (Andrew Gregory) and noticed he had released a version 1.8 of his 'Explorer Tree' and this uses preventDefault similar to your amendment. The one used in the Narrative Report is based on 1.6. However I found that 1.8 did not take into account any Base HTML element used. The Narrative Report uses 'base' to set the default target. I also found stopPropagation was still required even though Andrew had removed it. Anyway version 2.0.1.5RC1 of the Narrative Report posted elsewhere has the fix.


'lego audio video erro ergo disco' or "I read, I listen, I watch, I make mistakes, therefore I learn"


Similar Topics

Click to view RSS...
Expand / Collapse

Reading This Topic

Expand / Collapse