View previous topic :: View next topic |
Author |
Message |
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1751 Location: Space and Time
|
Posted: Tue Jul 08, 2014 7:46 pm Post subject: |
|
|
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 |
|
|
cnodnarb Professional Member
Joined: 11 Sep 2002 Posts: 762 Location: Rockeledge, GA
|
Posted: Wed Jul 09, 2014 5:24 pm Post subject: |
|
|
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 |
|
|
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1751 Location: Space and Time
|
Posted: Wed Jul 09, 2014 5:25 pm Post subject: |
|
|
You mean the design style on a dialog? I am not using that. _________________ Chris
Http://theblindhouse.com |
|
Back to top |
|
|
cnodnarb Professional Member
Joined: 11 Sep 2002 Posts: 762 Location: Rockeledge, GA
|
Posted: Wed Jul 09, 2014 5:30 pm Post subject: |
|
|
nope, your javascript is actually executing two commands on one line without checking for browser busy state |
|
Back to top |
|
|
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1751 Location: Space and Time
|
Posted: Wed Jul 09, 2014 5:37 pm Post subject: |
|
|
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 |
|
|
cnodnarb Professional Member
Joined: 11 Sep 2002 Posts: 762 Location: Rockeledge, GA
|
|
Back to top |
|
|
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1751 Location: Space and Time
|
Posted: Wed Jul 09, 2014 7:08 pm Post subject: |
|
|
Nope still doesn't work
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 |
|
|
cnodnarb Professional Member
Joined: 11 Sep 2002 Posts: 762 Location: Rockeledge, GA
|
Posted: Wed Jul 09, 2014 7:14 pm Post subject: |
|
|
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 |
|
|
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1751 Location: Space and Time
|
Posted: Wed Jul 09, 2014 7:16 pm Post subject: |
|
|
Nope, even adding a ; to the end of void 0 doesn't make a difference. _________________ Chris
Http://theblindhouse.com |
|
Back to top |
|
|
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1751 Location: Space and Time
|
Posted: Wed Jul 09, 2014 7:18 pm Post subject: |
|
|
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 |
|
|
cnodnarb Professional Member
Joined: 11 Sep 2002 Posts: 762 Location: Rockeledge, GA
|
Posted: Wed Jul 09, 2014 7:25 pm Post subject: |
|
|
try replacing colons with @chr(5
try doing the same with '
consider @chr(34) instead of ' as well
er... |
|
Back to top |
|
|
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1751 Location: Space and Time
|
|
Back to top |
|
|
cnodnarb Professional Member
Joined: 11 Sep 2002 Posts: 762 Location: Rockeledge, GA
|
Posted: Wed Jul 09, 2014 7:37 pm Post subject: |
|
|
I'm stumped!! |
|
Back to top |
|
|
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1751 Location: Space and Time
|
Posted: Wed Jul 09, 2014 7:40 pm Post subject: |
|
|
Nooo!!
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.
I would really love to get this working, it would be a great addition. _________________ Chris
Http://theblindhouse.com |
|
Back to top |
|
|
cnodnarb Professional Member
Joined: 11 Sep 2002 Posts: 762 Location: Rockeledge, GA
|
Posted: Thu Jul 10, 2014 2:22 am Post subject: |
|
|
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 |
|
|
|
|
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
|
|