topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Monday March 18, 2024, 10:41 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Last post Author Topic: Tip: Htmlviewurl works for local files too! :)  (Read 31026 times)

kartal

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 1,529
    • View Profile
    • Donate to Member
Tip: Htmlviewurl works for local files too! :)
« on: June 11, 2008, 10:38 PM »
This is good news, this way we can view simple txt, images etc  ;D

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Tip: Htmlviewurl works for local files too! :)
« Reply #1 on: June 12, 2008, 01:15 AM »
With the new version you can also put links like this in the html you show:
farr://LAUNCHLINEHERE

for example:
farr://restartsearch blondie

or:
farr://notepad.exe

NOTE:
the farr:// links will ONLY work when found in local files or showhtml text, they will be ignored for security reasons if found on an internet file.

kartal

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 1,529
    • View Profile
    • Donate to Member
Re: Tip: Htmlviewurl works for local files too! :)
« Reply #2 on: June 12, 2008, 01:30 AM »
Mouser would you mind explaning this stuff little more? I am little puzzled about what to achieve with these new stuff? Also what are the purposes of showfile and showhtml? SOrry help file is very limited and I did some preliminary tests and could not get anything spectacular :)

In my first post I was referring using htmlviewurl to show image and text files inside farr html viewer.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Tip: Htmlviewurl works for local files too! :)
« Reply #3 on: June 12, 2008, 01:35 AM »
the far:// links mean you could make an html file which acts as a farr menu,
in the same way you would use an alias to act like a menu.

why would you use an html file as a farr menu?  Well maybe for example if you made a nice html page using javascript or css to show a tree menu or image menu, etc.

showfile is used to show stuff either in html view or rtf memo view depending on file extension.

showhtml lets you set html contents directly from an alias without having to tell farr to load it from an external file.

kartal

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 1,529
    • View Profile
    • Donate to Member
Re: Tip: Htmlviewurl works for local files too! :)
« Reply #4 on: June 12, 2008, 01:44 AM »
I was hoping to look at my todo txt files with htmlviewurl inside Farr without opening any other application.

I will investigate the options you have mentioned here. Maybe they are more suitable for me.
« Last Edit: June 12, 2008, 01:50 AM by kartal »

nitrix-ud

  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 560
    • View Profile
    • Donate to Member
Re: Tip: Htmlviewurl works for local files too! :)
« Reply #5 on: June 12, 2008, 03:08 AM »
the farr:// links will ONLY work when found in local files or showhtml text, they will be ignored for security reasons if found on an internet file.

the use of the internet for collaborative work is quite frequent, i have some tools i've developped which are on the internet
there is no way to use farr:// links ?? maybe have a white list in FARR settings saying you want to add such and such urls ... ?

when tools are run locally : http://localhost .... does farr:// links will work ?

Nod5

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,169
    • View Profile
    • Donate to Member
Re: Tip: Htmlviewurl works for local files too! :)
« Reply #6 on: June 12, 2008, 05:51 AM »
kartal and others, here is an example alias that uses farr:// links:
1000>>>test>->test | showhtml <a href='farr://htmlviewurl exacttimenow.com'><img src='%FARRDIR%\AliasGroups\Installed\Core_Aliases\icons\farr\core-internet_www.ico'></a><br>click the image to Internal Surf to exacttimenow.com<br><br><a href='farr://restartsearch gowebpage'>use internal command to launch FARR webpage in external browser</a>>+>^test$

test.png
« Last Edit: June 12, 2008, 05:56 AM by Nod5 »

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: Tip: Htmlviewurl works for local files too! :)
« Reply #7 on: June 12, 2008, 06:15 AM »
nod5: now that's interesting!

For some strange reason, though, the second link isn't correct on my computer, it gets an extra forward slash '/'.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Tip: Htmlviewurl works for local files too! :)
« Reply #8 on: June 12, 2008, 06:33 AM »
Thanks for posting a sample nod5.. I can see the new farr:// style links aren't working perfectly yet.  I'll fix and update.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Tip: Htmlviewurl works for local files too! :)
« Reply #9 on: June 12, 2008, 04:30 PM »
I have fixed the farr:// links sometimes not working.. will be working in next release.
« Last Edit: June 12, 2008, 04:56 PM by mouser »

herojoker

  • Participant
  • Joined in 2008
  • *
  • Posts: 124
    • View Profile
    • Donate to Member
Re: Tip: Htmlviewurl works for local files too! :)
« Reply #10 on: June 12, 2008, 04:52 PM »
Is it farr:// or far://?

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Tip: Htmlviewurl works for local files too! :)
« Reply #11 on: June 12, 2008, 04:57 PM »
sorry it's "farr://" (two Rs)
« Last Edit: June 12, 2008, 05:29 PM by mouser »

herojoker

  • Participant
  • Joined in 2008
  • *
  • Posts: 124
    • View Profile
    • Donate to Member
Re: Tip: Htmlviewurl works for local files too! :)
« Reply #12 on: June 13, 2008, 02:01 AM »
In the changelog delivered with the app you wrote "far://".

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Tip: Htmlviewurl works for local files too! :)
« Reply #13 on: June 13, 2008, 05:33 AM »
thanks, i'll fix it.

Nod5

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,169
    • View Profile
    • Donate to Member
Re: Tip: Htmlviewurl works for local files too! :)
« Reply #14 on: June 13, 2008, 06:18 PM »
I just played some more with the new Html View Mode. :) I made a local .html file containing an ultracompact version of the Compact Calendar (  http://davidseah.com...age/compact-calendar ) and added some javascript to make it highlight the current date (= cell with light blue background in screencap) and scroll to the current week on launch. Needs some more work but so far it offers very quick date and week number lookup. Screencap (the red stuff in swedish are names of national holidays):
kal.png

With the farr:// functionality I think dynamically adding tasks to such a html calendar (or any other local html for that matter...) could be possible roughly like this: For each table cell, add a farr:// link that runs some command with the cell id as a parameter. That command (tied to an autohotkey script or some plugin) edits the basic html file by changing the contents of the cell with the matching id and then refreshes the the displayed html. Not a real replacement for google calendar or other full features calendars of course, but it could still be useful for some things.
« Last Edit: June 13, 2008, 06:27 PM by Nod5 »

kartal

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 1,529
    • View Profile
    • Donate to Member
Re: Tip: Htmlviewurl works for local files too! :)
« Reply #15 on: June 13, 2008, 06:23 PM »
This one will be very useful once javascript is enabled in Farr. A local file based html wiki can be invoked by using htmlviewurl

http://www.tiddlywiki.com/


btw I am trying to use showhtml instead of htmlviewurl and it does not show anything. How is it supposed to work ?

Here is my string in an alias
showhtml c:\showme.html
« Last Edit: June 13, 2008, 06:29 PM by kartal »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Tip: Htmlviewurl works for local files too! :)
« Reply #16 on: June 13, 2008, 06:27 PM »
this gave me another thought..
perhaps one way we could give people to write a different kind of farr "plugin"
is to let an alias load an html/javascript page, and automatically set some javascript variables corresponding to the search string.

this is very similar to the dqsd idea but even simpler. FARR would simply load an html page and preset some variables so the javascript on the page could know what was typed into search string, and proceed to handle it the way it wants.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Tip: Htmlviewurl works for local files too! :)
« Reply #17 on: June 13, 2008, 06:28 PM »
This one will be very useful once javascript is enabled in Farr.

isn't it already?

kartal

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 1,529
    • View Profile
    • Donate to Member
Re: Tip: Htmlviewurl works for local files too! :)
« Reply #18 on: June 13, 2008, 06:29 PM »
Mouse I just tried this one
http://www.checketts...w/gtd_tiddlywiki.htm

it works (javascript) however all the fonts and page is very small. Would you mind trying?


Nod5

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,169
    • View Profile
    • Donate to Member
Re: Tip: Htmlviewurl works for local files too! :)
« Reply #19 on: June 13, 2008, 06:41 PM »
The basic tiddlywiki.com runs in FARR but I can't save:
tiddly.pngTip: Htmlviewurl works for local files too! :)
Edit: but I get the same error in my regular browser so FARR isn't the problem. It's pretty obvious that I don't know much about tiddlywiki ;D
« Last Edit: June 13, 2008, 06:46 PM by Nod5 »

Nod5

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,169
    • View Profile
    • Donate to Member
Re: Tip: Htmlviewurl works for local files too! :)
« Reply #20 on: June 13, 2008, 06:56 PM »
this gave me another thought..
perhaps one way we could give people to write a different kind of farr "plugin"
is to let an alias load an html/javascript page, and automatically set some javascript variables corresponding to the search string.

this is very similar to the dqsd idea but even simpler. FARR would simply load an html page and preset some variables so the javascript on the page could know what was typed into search string, and proceed to handle it the way it wants.
Isn't it possible to just make an alias that passes the search string as a parameter to the .html file? Without any plugin needed? (but maybe that was just what what you meant when you added quotes around the term plugin?)

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Tip: Htmlviewurl works for local files too! :)
« Reply #21 on: June 13, 2008, 07:37 PM »
The basic tiddlywiki.com runs in FARR but I can't save:
actually there is a farr-related problem here, im trying to fix it now.  believe it or not it's related to skin system.

Isn't it possible to just make an alias that passes the search string as a parameter to the .html file?
well you are quite right that the search string could be passed as a simple html get parameter, without anything being added to the system by me.  clever.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Tip: Htmlviewurl works for local files too! :)
« Reply #22 on: June 13, 2008, 09:22 PM »
i'm going to start a new thread on gtd tiddlwikiplus.

Nod5

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,169
    • View Profile
    • Donate to Member
Re: Tip: Htmlviewurl works for local files too! :)
« Reply #23 on: June 14, 2008, 04:33 AM »
I just tested and it indeed works!
alb.pngTip: Htmlviewurl works for local files too! :)
I made an alias "alb" that passes the search string to a the file "album.html" as a parameter. So doing "alb beatl" passes "beatl". Album.html loops over a list of foldernames and displays an image if the foldername matches the passed string. Each displayed image links to a .m3u file that when run plays the tracks on the album.

So the plugin I requested here seems more and more doable: https://www.donation....msg116150#msg116150
A drawback with the current test is that you in advance must index the folders and make the .html. A script can do that if the folders are well structured but it is still not ideal. It's also not as easy select and run a displayed match as in FARR's default mode. It would definitely be better if FARR's default mode could show a list of linked images like that. I think such a feature could be useful for other stuff too, like displaying thumbnails when searching for images. Or searching anything else for which a thumbnail can be useful really.

Here's "album.html" (to be placed in helpers folder):
Code: Javascript [Select]
  1. <HTML>
  2. <HEAD>
  3. </HEAD>
  4. <BODY>
  5.  
  6. <FORM NAME="a">
  7. <INPUT TYPE="hidden" NAME="b">
  8. </FORM>
  9.  
  10. <SCRIPT LANGUAGE="javascript">
  11.  
  12. var loc = window.location
  13. document.a.b.value = loc
  14.  
  15. var text = document.a.b.value
  16.  
  17. function delineate(str)
  18. {
  19. left = str.indexOf("?") + 1;
  20. return(str.substring(left));
  21. }
  22. xx = delineate(text);
  23.  
  24. document.write(xx+"<br><br>");
  25.  
  26. function albummatch(zz)
  27. {
  28. var pos=zz.indexOf(xx)
  29. if (pos>=0)
  30.  document.write("<a href='" +zz+ "/test.m3u'><img BORDER=0 src='" +zz+ "/folder.jpg' width=200 height=200></a><br>")
  31. }
  32.  
  33. xarr = new Array("beatles - yellow submarine", "rolling stones - exile on main street", "beatles - abbey road")
  34.  
  35. for (var i = 0; i < xarr.length; i++) {
  36. albummatch(xarr[i])
  37. }
  38. </script>
And the alias:
1000>>>album>->test param pass to album search .html | htmlviewurl %FARRDIR%\Helpers\album.html?$$1>+>^alb (.*)$
It also needs some folders and files of course. edit: See the array "xarr" above for details.


« Last Edit: June 14, 2008, 09:19 AM by Nod5 »

Nod5

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,169
    • View Profile
    • Donate to Member
Re: Tip: Htmlviewurl works for local files too! :)
« Reply #24 on: June 14, 2008, 09:16 AM »
Here's an updated version of my test file "album.html" that now also can handle two search phrases (both must match) separated by a space:
Code: Javascript [Select]
  1. <HTML>
  2. <HEAD>
  3. </HEAD>
  4. <BODY>
  5.  
  6. <FORM NAME="a">
  7. <INPUT TYPE="hidden" NAME="b">
  8. </FORM>
  9.  
  10. <SCRIPT LANGUAGE="javascript">
  11.  
  12. var loc = window.location
  13. document.a.b.value = loc
  14.  
  15. var text = document.a.b.value
  16.  
  17. function delineate(str)
  18. {
  19. left = str.indexOf("?") + 1;
  20. return(str.substring(left));
  21. }
  22. xx = delineate(text);
  23. xx = xx.toLowerCase()
  24.  
  25. var ww = [];
  26. var pos=xx.indexOf(" ")
  27. if (pos>=0)
  28.  var ww = xx.split(" ")
  29. else
  30. {      
  31.  pos=xx.indexOf("%20")          //firefox compatibility mode, since javascript debugging is handy in FF
  32.  if (pos>=0)
  33.   var ww = xx.split("%20")
  34. }
  35.  
  36. // document.write(xx+ "  " + ww[0] + "  " + ww[1] + "<br><br>");
  37.  
  38. function albummatch(zz)
  39. {
  40. var zz1 = zz.toLowerCase()
  41. var pos=zz1.indexOf(xx)
  42. if (pos>=0)
  43.  document.write("<a href='" +zz+ "/test.m3u'><img BORDER=0 src='" +zz+ "/folder.jpg' width=200 height=200></a>")
  44.  }
  45.  
  46. function albummatch2(zz)
  47. {
  48. var zz1 = zz.toLowerCase()
  49. var pos=zz1.indexOf(ww[0])
  50. var pos2=zz1.indexOf(ww[1])
  51. if (pos>=0 && pos2>=0)
  52.  document.write("<a href='" +zz+ "/test.m3u'><img BORDER=0 src='" +zz+ "/folder.jpg' width=200 height=200></a>")
  53.  }
  54.  
  55. xarr = new Array("beatles - yellow submarine", "rolling stones - exile on main street", "beatles - abbey road")
  56.  
  57. if (ww[1])
  58. for (var i = 0; i < xarr.length; i++) {
  59. albummatch2(xarr[i])
  60. }
  61. else
  62. for (var i = 0; i < xarr.length; i++) {
  63. albummatch(xarr[i])
  64. }
  65.  
  66.  
  67. </script>

I tried it with a much larger number of folders and it works fine. Promising!

Mouser, is it possible to use a special farr:// link to silently do a command line action? When clicking a specific image I want to send it's related folder to an external audio player through such a link. If possible then that sidesteps the use of .m3u playlist files.
« Last Edit: June 14, 2008, 09:19 AM by Nod5 »