View previous topic :: View next topic |
Author |
Message |
FreezingFire Admin Team
Joined: 23 Jun 2002 Posts: 3508
|
Posted: Wed Apr 14, 2004 6:49 pm Post subject: |
|
|
Nice mindpower Thanks for that little list. Perhaps that should be
posted in a topic of its own in the Knowledge Base. _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
Back to top |
|
|
SK Newbie
Joined: 29 Dec 2003 Posts: 14
|
Posted: Mon Apr 19, 2004 7:30 pm Post subject: |
|
|
Thanks for this post! Seems to be VERY useful. _________________ SK |
|
Back to top |
|
|
Boo Valued Contributor
Joined: 31 Oct 2003 Posts: 599 Location: Gulf Breeze, Florida USA
|
Posted: Thu Aug 26, 2004 2:53 pm Post subject: |
|
|
Hi Guys,
When using the VDS Browser element on a VDS dialog, is there a command for implementing a search within the loaded page? That is, after loading a page, is it possible to search for a certain word within the page? I know there are "Copy" and "Select All" commands, but what about Find?
Thanks,
- Boo |
|
Back to top |
|
|
jules Professional Member
Joined: 14 Sep 2001 Posts: 1043 Location: Cumbria, UK
|
Posted: Thu Aug 26, 2004 4:03 pm Post subject: |
|
|
No, there isn't. _________________ The Tech Pro
www.tech-pro.net |
|
Back to top |
|
|
Boo Valued Contributor
Joined: 31 Oct 2003 Posts: 599 Location: Gulf Breeze, Florida USA
|
Posted: Thu Aug 26, 2004 4:04 pm Post subject: |
|
|
Hi Jules,
Any chance of this ability being incorporated in a future update?
Thanks,
- Boo |
|
Back to top |
|
|
jules Professional Member
Joined: 14 Sep 2001 Posts: 1043 Location: Cumbria, UK
|
Posted: Thu Aug 26, 2004 4:45 pm Post subject: |
|
|
I have no idea. I have no knowledge of what Commercial Research's future plans for VDS are. Technically, it looks easy to implement a Find, as the web browser component used by the DLL has a Find method. I suppose that it would pop up a Find dialog box, just as if you do Edit, Find in IE. _________________ The Tech Pro
www.tech-pro.net |
|
Back to top |
|
|
Boo Valued Contributor
Joined: 31 Oct 2003 Posts: 599 Location: Gulf Breeze, Florida USA
|
Posted: Thu Aug 26, 2004 4:49 pm Post subject: |
|
|
Hi Jules,
Thanks again. Any idea on how to accomplish this? (Examples welcome.)
FYI: I can search and find the word in the source (obviously), but I cannot find the word AND highlight it on the screen within the browser element.
Thanks,
- Boo |
|
Back to top |
|
|
Skit3000 Admin Team
Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
Posted: Thu Aug 26, 2004 5:08 pm Post subject: |
|
|
Boo, if you have some knowledge of javascript you might be able to create something by using that. You can send Javascript code to the browser element by simply calling something like this:
Code: | dialog set,browser1,javascript:window.alert("Hello world!") |
I know it is possible to let javascript search for text inside a HTML page, since I once made a little script to put in I.E.'s toolbar so that I had a fast "search" button available... _________________ [ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial! |
|
Back to top |
|
|
Boo Valued Contributor
Joined: 31 Oct 2003 Posts: 599 Location: Gulf Breeze, Florida USA
|
Posted: Thu Aug 26, 2004 5:22 pm Post subject: |
|
|
Hi Skit3000,
Unfortunately, I am not much of a Java man. 8-(
However, your idea sounds like a valid solution. Would you happen to be able to determine and post some sample code for this? I am sure all readers on the board could benefit from your knowledge. When using a browser element, it really is important that the user be able to search through the text.
Thanks,
- Boo |
|
Back to top |
|
|
Skit3000 Admin Team
Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
Posted: Thu Aug 26, 2004 5:36 pm Post subject: |
|
|
Try this...
Code: | %%string = "string to search for"
dialog set,browser1,"javascript:var str='"%%string"';var txt=window.document.body.createTextRange();var found=txt.findText(str);if (found==true){txt.select();txt.scrollIntoView();}" |
Btw. I have not tested the above code, but I think it will work since it does work when I manually paste the "javascript:...." line into the Internet Explorer address bar...
Edit 1: Changed the code above so that it will not highlight the whole page if the string isn't found. _________________ [ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial! |
|
Back to top |
|
|
Boo Valued Contributor
Joined: 31 Oct 2003 Posts: 599 Location: Gulf Breeze, Florida USA
|
Posted: Thu Aug 26, 2004 5:58 pm Post subject: |
|
|
Hi Skit3000,
Sweet! Thanks.
By the way... Anyway to "Find Next," and indicate a message in VDS for "Sorry, no match found" ???
Thanks so much,
- Boo |
|
Back to top |
|
|
Skit3000 Admin Team
Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
Posted: Thu Aug 26, 2004 6:09 pm Post subject: |
|
|
Boo, I'm afraid it is unable to let a javascript notify the VDS script that no matches are found, since javascript can only change local variables and things like that. But it is possible to show a javascript message when nothing is found, which can be done like below:
Code: | %%string = "string to search for"
dialog set,browser1,"javascript:var str='"%%string"';var txt=window.document.body.createTextRange();var found=txt.findText(str);if (found==true){txt.select();txt.scrollIntoView();}else{window.alert('Nothing is found');" |
For your second question: it should be able to make a "search next" command, but for now I don't know how. The code I used came from [ this ] website, so maybe you can try some things yourself? You basicly only have to remove the enters and spaces and put everything in one long row. After that, call the "findinpage()" function with "dialog set,browser1,javascript:findinpage("%%string");"... _________________ [ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial! |
|
Back to top |
|
|
Skit3000 Admin Team
Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
Posted: Thu Aug 26, 2004 6:29 pm Post subject: |
|
|
After some puzzling, here it is...
Code: | #define command,Browsersearch
external vdsbrw50.dll
DIALOG CREATE,SearchMe,-1,0,399,328
DIALOG ADD,BROWSER,BROWSER1,40,10,375,275,http://www.javascript-page.com/pgsearch.html
DIALOG ADD,BUTTON,BUTTON1,10,250,65,25,Find
DIALOG ADD,EDIT,EDIT1,10,10,235,25,to
DIALOG SHOW
:Evloop
wait event
goto @event()
:Button1button
Browsersearch browser1,@dlgtext(edit1),NOWARNING
goto Evloop
:Close
exit
:Browsersearch
if @unequal(%2,%%Browsersearch_Oldstring)
if @equal(%3,"NOWARNING")
# This one will display NO warning message when the text is not found.
dialog set,%1,"javascript:var str='"%2"';var txt=window.document.body.createTextRange();var found=txt.findText(str);if (found==true){txt.select();txt.scrollIntoView();}"
else
# While this one does
dialog set,%1,"javascript:var str='"%2"';var txt=window.document.body.createTextRange();var found=txt.findText(str);if (found==true){txt.select();txt.scrollIntoView();}else{window.alert('String not found')}"
end
%%Browsersearch_Oldstring = %2
else
# This will find the next occurance.
dialog set,%1,"javascript:var temp=txt.moveStart('character',1);var found=txt.findText(str);if (found==true){txt.select();txt.scrollIntoView();}"
end
exit |
_________________ [ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial! |
|
Back to top |
|
|
Boo Valued Contributor
Joined: 31 Oct 2003 Posts: 599 Location: Gulf Breeze, Florida USA
|
Posted: Thu Aug 26, 2004 9:58 pm Post subject: |
|
|
You da man, Skit3000! Awesome... This should suffice.
Thanks a million.
Cheers,
- Boo |
|
Back to top |
|
|
Skit3000 Admin Team
Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
Posted: Mon Jan 17, 2005 10:42 am Post subject: |
|
|
I have a question. Is it possible to fire an event when a new window is trying to be opened while the NONEWWINDOWS style is used with the browser element, just like the <browsername>NAVIGATE event which is fired when people try to navigate while the browser element has the NONAVIGATE style? I would like to "trap" new windows so that I can create a tabbed-browser... _________________ [ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial! |
|
Back to top |
|
|
|
|
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 vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|