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 


VDSBrw and contentEditable
Goto page Previous  1, 2, 3  Next
 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1751
Location: Space and Time

PostPosted: Tue Jul 08, 2014 7:46 pm    Post subject: Reply with quote

Looks like it might work, but I am not able to save the page right to a file (w/o using the file dialog) or get the text of a page.
_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
cnodnarb
Professional Member
Professional Member


Joined: 11 Sep 2002
Posts: 762
Location: Rockeledge, GA

PostPosted: Wed Jul 09, 2014 5:24 pm    Post subject: Reply with quote

Try again without tinkering with design mode

Or alternately, put the commands on different lines and check for browser busy between


Last edited by cnodnarb on Wed Jul 09, 2014 5:29 pm; edited 1 time in total
Back to top
View user's profile Send private message AIM Address
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1751
Location: Space and Time

PostPosted: Wed Jul 09, 2014 5:25 pm    Post subject: Reply with quote

You mean the design style on a dialog? I am not using that.
_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
cnodnarb
Professional Member
Professional Member


Joined: 11 Sep 2002
Posts: 762
Location: Rockeledge, GA

PostPosted: Wed Jul 09, 2014 5:30 pm    Post subject: Reply with quote

nope, your javascript is actually executing two commands on one line without checking for browser busy state
Back to top
View user's profile Send private message AIM Address
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1751
Location: Space and Time

PostPosted: Wed Jul 09, 2014 5:37 pm    Post subject: Reply with quote

Nope that doesn't work either. Still locks up when trying to save. Here is the code I just tried;

Code:

  EXTERNAL VDSBRW60.DLL
  #DEFINE COMMAND,BROWSER
  #DEFINE FUNCTION,BROWSER,richedit
  DIALOG CREATE,New Dialog,-1,0,761,478,RESIZABLE
  DIALOG ADD,BROWSER,E1,0,0,@dlgpos(,w),@dlgpos(,h),<html><body contenteditable=true><font face=arial></body></html>,,nonavigate,offline
  DIALOG ADD,MENU,&File,&Make Editable|&Make Read-only|Save Test|-|E&xit
  dialog add,menu,format,Bold|Link
  DIALOG SHOW

  #dialog set,E1,<html><body contenteditable=true>this is a test<font face=arial></body></html>
 
:evloop
:EVENTLOOP
  WAIT EVENT
  GOTO @event()

:EXITMENU
:CLOSE
  EXIT

:RESIZE
  DIALOG SETPOS,E1,,,@dlgpos(,w),@dlgpos(,h)
  GOTO EVENTLOOP

:BoldMenu
dialog set,E1,javascript:document.execCommand('Bold');void(0);
goto evloop

:LinkMenu
dialog set,E1,"javascript:document.execCommand('CreateLink',true);void(0);"
goto evloop
 
:Make EditableMENU
dialog set,E1,javascript:document.body.contentEditable='true'; void 0
GOTO EVENTLOOP

:Make Read-onlyMENU
dialog set,E1,"javascript:document.body.contentEditable='false'; void 0"
GOTO EVENTLOOP

:Save TestMenu
dialog set,E1,"javascript:document.body.contentEditable='false'; void 0"
browser savefile,E1,@path(%0)test.html
dialog set,E1,javascript:document.body.contentEditable='true'; void 0
goto evloop
 
:Browser1Navigate
%l = @browser(E1,navurl)
shell open,%l
goto eventloop

_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
cnodnarb
Professional Member
Professional Member


Joined: 11 Sep 2002
Posts: 762
Location: Rockeledge, GA

PostPosted: Wed Jul 09, 2014 6:50 pm    Post subject: Reply with quote

repeat
wait 0
until @not(@browser(browser%%a1,busy))

Wait for the browser to not be busy after each command

http://www.vdsworld.com/forum/viewtopic.php?t=5220
Back to top
View user's profile Send private message AIM Address
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1751
Location: Space and Time

PostPosted: Wed Jul 09, 2014 7:08 pm    Post subject: Reply with quote

Nope still doesn't work Sad

Code:

  EXTERNAL VDSBRW60.DLL
  #DEFINE COMMAND,BROWSER
  #DEFINE FUNCTION,BROWSER,richedit
  DIALOG CREATE,New Dialog,-1,0,761,478,RESIZABLE
  DIALOG ADD,BROWSER,E1,0,0,@dlgpos(,w),@dlgpos(,h),<html><body contenteditable=true><font face=arial></body></html>,,nonavigate,offline
  DIALOG ADD,MENU,&File,&Make Editable|&Make Read-only|Save Test|-|E&xit
  dialog add,menu,format,Bold|Link
  DIALOG SHOW
 
:evloop
:EVENTLOOP
  WAIT EVENT
  GOTO @event()

:EXITMENU
:CLOSE
  EXIT

:RESIZE
  DIALOG SETPOS,E1,,,@dlgpos(,w),@dlgpos(,h)
  GOTO EVENTLOOP

:BoldMenu
dialog set,E1,javascript:document.execCommand('Bold');void(0);
repeat
  wait 0.1
until @not(@browser(e1,busy))
goto evloop

:LinkMenu
dialog set,E1,"javascript:document.execCommand('CreateLink',true);void(0);"
repeat
  wait 0.1
until @not(@browser(e1,busy))
goto evloop
 
:Make EditableMENU
dialog set,E1,javascript:document.body.contentEditable='true'; void 0
repeat
  wait 0.1
until @not(@browser(e1,busy))
GOTO EVENTLOOP

:Make Read-onlyMENU
dialog set,E1,"javascript:document.body.contentEditable='false'; void 0"
repeat
  wait 0.1
until @not(@browser(e1,busy))
GOTO EVENTLOOP

:Save TestMenu
dialog set,E1,javascript:document.body.contentEditable='false'; void 0
repeat
  wait 0.1
until @not(@browser(e1,busy))
browser savefile,E1,@path(%0)test.html
repeat
  wait 0.1
until @not(@browser(e1,busy))
dialog set,E1,javascript:document.body.contentEditable='true'; void 0
repeat
  wait 0.1
until @not(@browser(e1,busy))
goto evloop
 
:Browser1Navigate
%l = @browser(E1,navurl)
shell open,%l
goto eventloop

_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
cnodnarb
Professional Member
Professional Member


Joined: 11 Sep 2002
Posts: 762
Location: Rockeledge, GA

PostPosted: Wed Jul 09, 2014 7:14 pm    Post subject: Reply with quote

I'm noticing syntax differences in your code after void 0 and quotation mark inclusions...

some void 0 aren't followed by semicolons...
Back to top
View user's profile Send private message AIM Address
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1751
Location: Space and Time

PostPosted: Wed Jul 09, 2014 7:16 pm    Post subject: Reply with quote

Nope, even adding a ; to the end of void 0 doesn't make a difference.
_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1751
Location: Space and Time

PostPosted: Wed Jul 09, 2014 7:18 pm    Post subject: Reply with quote

Revised code with ; and "s. Still no luck

Code:

  EXTERNAL VDSBRW60.DLL
  #DEFINE COMMAND,BROWSER
  #DEFINE FUNCTION,BROWSER,richedit
  DIALOG CREATE,New Dialog,-1,0,761,478,RESIZABLE
  DIALOG ADD,BROWSER,E1,0,0,@dlgpos(,w),@dlgpos(,h),<html><body contenteditable=true><font face=arial></body></html>,,nonavigate,offline
  DIALOG ADD,MENU,&File,&Make Editable|&Make Read-only|Save Test|-|E&xit
  dialog add,menu,format,Bold|Link
  DIALOG SHOW
 
:evloop
:EVENTLOOP
  WAIT EVENT
  GOTO @event()

:EXITMENU
:CLOSE
  EXIT

:RESIZE
  DIALOG SETPOS,E1,,,@dlgpos(,w),@dlgpos(,h)
  GOTO EVENTLOOP

:BoldMenu
dialog set,E1,"javascript:document.execCommand('Bold');void(0);"
repeat
  wait 0.1
until @not(@browser(e1,busy))
goto evloop

:LinkMenu
dialog set,E1,"javascript:document.execCommand('CreateLink',true);void(0);"
repeat
  wait 0.1
until @not(@browser(e1,busy))
goto evloop
 
:Make EditableMENU
dialog set,E1,"javascript:document.body.contentEditable='true'; void 0;"
repeat
  wait 0.1
until @not(@browser(e1,busy))
GOTO EVENTLOOP

:Make Read-onlyMENU
dialog set,E1,"javascript:document.body.contentEditable='false'; void 0;"
repeat
  wait 0.1
until @not(@browser(e1,busy))
GOTO EVENTLOOP

:Save TestMenu
dialog set,E1,"javascript:document.body.contentEditable='false'; void 0;"
repeat
  wait 0.1
until @not(@browser(e1,busy))
browser savefile,E1,@path(%0)test.html
repeat
  wait 0.1
until @not(@browser(e1,busy))
dialog set,E1,"javascript:document.body.contentEditable='true'; void 0;"
repeat
  wait 0.1
until @not(@browser(e1,busy))
goto evloop
 
:Browser1Navigate
%l = @browser(E1,navurl)
shell open,%l
goto eventloop

_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
cnodnarb
Professional Member
Professional Member


Joined: 11 Sep 2002
Posts: 762
Location: Rockeledge, GA

PostPosted: Wed Jul 09, 2014 7:25 pm    Post subject: Reply with quote

try replacing colons with @chr(5Cool

try doing the same with '

consider @chr(34) instead of ' as well

er...
Code:
@chr(58)
Back to top
View user's profile Send private message AIM Address
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1751
Location: Space and Time

PostPosted: Wed Jul 09, 2014 7:32 pm    Post subject: Reply with quote

None worked, same result.
_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
cnodnarb
Professional Member
Professional Member


Joined: 11 Sep 2002
Posts: 762
Location: Rockeledge, GA

PostPosted: Wed Jul 09, 2014 7:37 pm    Post subject: Reply with quote

Embarassed I'm stumped!!
Back to top
View user's profile Send private message AIM Address
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1751
Location: Space and Time

PostPosted: Wed Jul 09, 2014 7:40 pm    Post subject: Reply with quote

Nooo!! Very Happy

Well, thanks for helping. It's crazy, because the one you made works fine w/o locking up. I cannot find out what the issue is. I have even copied right from your script and it still locks up. Sad

I would really love to get this working, it would be a great addition.

_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
cnodnarb
Professional Member
Professional Member


Joined: 11 Sep 2002
Posts: 762
Location: Rockeledge, GA

PostPosted: Thu Jul 10, 2014 2:22 am    Post subject: Reply with quote

Code:

%8 = @clipbrd()
%3 = html
%4 = outerHTML
%5 = 0
rem %5 = first occurrence of html counting from 0
dialog set,@dlgtext(browserctl),javascript:window.clipboardData.setData('Text'", "document.getElementsByTagName('%3').item(%5).%4); void(0);
%9 = @clipbrd()
rem %9 is the CODE to save to text
clipboard set,%8
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help 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