forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Embedded HTML apps
Goto page Previous  1, 2, 3  Next
 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Knowledge Base
View previous topic :: View next topic  
Author Message
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Wed Apr 14, 2004 6:49 pm    Post subject: Reply with quote

Nice mindpower Very Happy Thanks for that little list. Perhaps that should be
posted in a topic of its own in the Knowledge Base. Smile

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
SK
Newbie


Joined: 29 Dec 2003
Posts: 14

PostPosted: Mon Apr 19, 2004 7:30 pm    Post subject: Reply with quote

Thanks for this post! Seems to be VERY useful.
_________________
SK
Back to top
View user's profile Send private message Send e-mail
Boo
Valued Contributor
Valued Contributor


Joined: 31 Oct 2003
Posts: 599
Location: Gulf Breeze, Florida USA

PostPosted: Thu Aug 26, 2004 2:53 pm    Post subject: Reply with quote

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
View user's profile Send private message
jules
Professional Member
Professional Member


Joined: 14 Sep 2001
Posts: 1043
Location: Cumbria, UK

PostPosted: Thu Aug 26, 2004 4:03 pm    Post subject: Reply with quote

No, there isn't.
_________________
The Tech Pro
www.tech-pro.net
Back to top
View user's profile Send private message Visit poster's website
Boo
Valued Contributor
Valued Contributor


Joined: 31 Oct 2003
Posts: 599
Location: Gulf Breeze, Florida USA

PostPosted: Thu Aug 26, 2004 4:04 pm    Post subject: Reply with quote

Hi Jules,

Any chance of this ability being incorporated in a future update?

Thanks,

- Boo
Back to top
View user's profile Send private message
jules
Professional Member
Professional Member


Joined: 14 Sep 2001
Posts: 1043
Location: Cumbria, UK

PostPosted: Thu Aug 26, 2004 4:45 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Boo
Valued Contributor
Valued Contributor


Joined: 31 Oct 2003
Posts: 599
Location: Gulf Breeze, Florida USA

PostPosted: Thu Aug 26, 2004 4:49 pm    Post subject: Reply with quote

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
View user's profile Send private message
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Thu Aug 26, 2004 5:08 pm    Post subject: Reply with quote

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... Smile

_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
Boo
Valued Contributor
Valued Contributor


Joined: 31 Oct 2003
Posts: 599
Location: Gulf Breeze, Florida USA

PostPosted: Thu Aug 26, 2004 5:22 pm    Post subject: Reply with quote

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
View user's profile Send private message
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Thu Aug 26, 2004 5:36 pm    Post subject: Reply with quote

Try this... Smile

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... Smile

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
View user's profile Send private message
Boo
Valued Contributor
Valued Contributor


Joined: 31 Oct 2003
Posts: 599
Location: Gulf Breeze, Florida USA

PostPosted: Thu Aug 26, 2004 5:58 pm    Post subject: Reply with quote

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
View user's profile Send private message
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Thu Aug 26, 2004 6:09 pm    Post subject: Reply with quote

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");"... Smile

_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Thu Aug 26, 2004 6:29 pm    Post subject: Reply with quote

After some puzzling, here it is... Smile

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
View user's profile Send private message
Boo
Valued Contributor
Valued Contributor


Joined: 31 Oct 2003
Posts: 599
Location: Gulf Breeze, Florida USA

PostPosted: Thu Aug 26, 2004 9:58 pm    Post subject: Reply with quote

You da man, Skit3000! Awesome... This should suffice.

Thanks a million. Cool

Cheers,

- Boo
Back to top
View user's profile Send private message
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Mon Jan 17, 2005 10:42 am    Post subject: Reply with quote

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... Smile
_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Knowledge Base All times are GMT
Goto page Previous  1, 2, 3  Next
Page 2 of 3

 
Jump to:  
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

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group