AHK HTML Editor test (W.I.P.)

Post your working scripts, libraries and tools
burque505
Posts: 1372
Joined: 22 Jan 2017, 19:37

AHK HTML Editor test (W.I.P.)

15 Dec 2018, 18:01

I got off on this tangent after a post elsewhere regarding RTF <-> HTML. I believe this is the start of an HTML Editor, impoverished though it may be at this time. I think the rest is just digging into MSDN for the proper editing commands.
EDIT: From now on I'll put the latest version in this post. I'm leaving the rest of the versions where they are for now.
EDIT: (20181223). IE-based variant with design-mode toggle in my last post below.
LATEST (Edited 20181222 - 1755 MST, some updates, in ZIP, NOT in spoiler. Needed image files now included.):
  • Bullets
  • Numbering
  • Indent
  • Outdent
  • Undo
  • TextArea
  • iFrame
  • Marquee
  • InsertImage
  • Improved InsertLink
  • Insert <BR>
  • Insert Button
  • Improved Insert txt/HTML/js (at current position)
Many bugs and missing features still. Still very much W.I.P. For example:
  • No .ini yet, no settings dialog.
  • Still need to be able to set properties from GUI, not source, and not by just inserting HTML
EDIT: Removing 20181219 code.

Regards,
burque505
EDIT: Forgot the HTML! Don't think it's needed anymore. It isn't.
(GIF is a little corrupted at the end. The file itself displays correctly.) New GIF 20181222
122218.gif
122218.gif (223.04 KiB) Viewed 3139 times
Attachments
HTML Editor 0.0.2.zip
(13.69 KiB) Downloaded 80 times
121918.gif
121918.gif (625.25 KiB) Viewed 3253 times
Last edited by burque505 on 23 Dec 2018, 17:58, edited 8 times in total.
User avatar
adegard
Posts: 90
Joined: 24 Nov 2017, 05:58
GitHub: adegard

Re: AHK HTML Editor test (W.I.P.)

16 Dec 2018, 04:33

Great @burque505!
good idea... It's a good start, I subscribe!
Note: I personally use bootstrap templates... is'it a way to make an editor for it? There'is a lot of commercial solution, but few are adapt ot boostrap in open source...
r2997790
Posts: 59
Joined: 02 Feb 2017, 02:46

Re: AHK HTML Editor test (W.I.P.)

16 Dec 2018, 05:10

Nice job. I can see this having a lot of potential. Particularly if you want say 'intelligent' HTML formatting of content you could dump it something like this and parse the text and call the HTML tag functions.
burque505
Posts: 1372
Joined: 22 Jan 2017, 19:37

Re: AHK HTML Editor test (W.I.P.)

16 Dec 2018, 13:13

@adegard, @r2997790, thanks for the encouragement. Here's another iteration, same HTML file. There are still bugs and missing features galore. It needs a menu bar, toolbar, so it looks like it was designed by a human. Baby steps ...
Spoiler
HTML Edit 3.gif
HTML Edit 3.gif (206.64 KiB) Viewed 3520 times
burque505
Posts: 1372
Joined: 22 Jan 2017, 19:37

Re: AHK HTML Editor test (W.I.P.)

16 Dec 2018, 17:02

A few steps forward ... much to do still. No HTML for this one, it navigates to "about:blank". You can save it, though. More on that later.
Spoiler
HTML Edit 4.gif
HTML Edit 4.gif (156.15 KiB) Viewed 3485 times
burque505
Posts: 1372
Joined: 22 Jan 2017, 19:37

Re: AHK HTML Editor test (W.I.P.)

16 Dec 2018, 17:13

Hmmm ... editing MS Word content in the browser. Sort of ...
HTML Edit 5.gif
HTML Edit 5.gif (190.3 KiB) Viewed 3481 times
User avatar
kczx3
Posts: 1163
Joined: 06 Oct 2015, 21:39

Re: AHK HTML Editor test (W.I.P.)

16 Dec 2018, 20:56

Check this out if you haven’t already - https://msdn.microsoft.com/en-us/window ... 0(v=vs.71)
burque505
Posts: 1372
Joined: 22 Jan 2017, 19:37

Re: AHK HTML Editor test (W.I.P.)

16 Dec 2018, 21:07

Thanks for the tip. I had seen this one but yours looks more on point for sure.
Regards,
burque505
User avatar
Delta Pythagorean
Posts: 567
Joined: 13 Feb 2017, 13:44
GitHub: DelPyth
Location: Somewhere in the US

Re: AHK HTML Editor test (W.I.P.)

16 Dec 2018, 21:17

So far, I love the idea and the work you put into it, but I think you could definitely work on getting this to be a lot easier to not only use, but read in your code. As of right now, I'm currently working on that.
I'd love to see anyone else chipping in and getting this to fully be functional and working.

- [AHK].......: 1.1.33.02 Unicode 64-bit
- [OS].........: Windows 10.0.18362
- [GITHUB]...: github.com/DeltaPyth
- [PAYPAL]....: paypal.me/DelPyth
- [DISCORD]..: Delta#3324

Remember to use [code]CODE[/code] for your multi-line scripts.
Stay safe, stay inside, and remember to wash your hands for 20 seconds!
tmplinshi
Posts: 1598
Joined: 01 Oct 2013, 14:57

Re: AHK HTML Editor test (W.I.P.)

17 Dec 2018, 00:22

Nice!

BTW, this also works:

Code: Select all

Gui, Add, Button, Default w80, Bold
Gui, Add, ActiveX, w980 h640 vWB, about:Bold Me
Gui, Show

doc := WB.Document
doc.DesignMode := "On"
return

ButtonBold:
	doc.execCommand("Bold")
return

GuiClose:
ExitApp
DRocks
Posts: 559
Joined: 08 May 2018, 10:20

Re: AHK HTML Editor test (W.I.P.)

17 Dec 2018, 08:10

Very cool
Last edited by DRocks on 17 Dec 2018, 08:13, edited 1 time in total.
burque505
Posts: 1372
Joined: 22 Jan 2017, 19:37

Re: AHK HTML Editor test (W.I.P.)

17 Dec 2018, 08:11

@tmplinshi, @Delta Pythagorean, thank you for your help and comments. As always, I am grateful for any help. I know the code is uncommented as of yet, sorry.
Latest version is in OP from now on. Bugs to be squashed and features glaringly missing:
  • Links "self-activate" on "Refresh", which for now is the only way to save.
  • Opening and saving are cumbersome and not intuitive.
  • Need to be able to change background color easily.
  • Need to add font color, customizeable font size
  • Need color picker.
  • Need table support.
  • Javascript support desperately needed.
At the end of the animated GIF, the last link activates after refresh. Epic fail ... next candidate for squashing. I think I need to disable navigation.
HTML Edit 6.gif
burque505
Posts: 1372
Joined: 22 Jan 2017, 19:37

Re: AHK HTML Editor test (W.I.P.)

18 Dec 2018, 15:32

Teaser. Progress with JS and active content. More soon.
EDIT: See OP for 20181219 version. Thanks. GIF removed from this post.
burque505
Posts: 1372
Joined: 22 Jan 2017, 19:37

Re: AHK HTML Editor test (W.I.P.)

21 Dec 2018, 08:40

(December 21, 2018) Latest version in ZIP in OP.
DRocks
Posts: 559
Joined: 08 May 2018, 10:20

Re: AHK HTML Editor test (W.I.P.)

22 Dec 2018, 16:33

this is getting good pretty quickly! good job
burque505
Posts: 1372
Joined: 22 Jan 2017, 19:37

Re: AHK HTML Editor test (W.I.P.)

22 Dec 2018, 16:38

Thanks, DRocks, I appreciate the encouragement. I hope to have buttons, textareas, marquees, and iFrames by the end of the day, although they will all still need a lot of work, especially in setting properties.
Regards,
burque505
burque505
Posts: 1372
Joined: 22 Jan 2017, 19:37

Re: AHK HTML Editor test (W.I.P.)

23 Dec 2018, 18:01

IE version, design mode, proof of concept only. First try.
122318-3.gif
122318-3.gif (806.01 KiB) Viewed 3106 times
Browser HTML Editor.zip
(13.9 KiB) Downloaded 55 times
User avatar
Delta Pythagorean
Posts: 567
Joined: 13 Feb 2017, 13:44
GitHub: DelPyth
Location: Somewhere in the US

Re: AHK HTML Editor test (W.I.P.)

23 Dec 2018, 21:08

I think it'd be better to attach the AHK gui to the IE window and then have the IE window be its own thing.

Also, I highly suggest putting most of these actions into menus instead of having everything be button-based.

- [AHK].......: 1.1.33.02 Unicode 64-bit
- [OS].........: Windows 10.0.18362
- [GITHUB]...: github.com/DeltaPyth
- [PAYPAL]....: paypal.me/DelPyth
- [DISCORD]..: Delta#3324

Remember to use [code]CODE[/code] for your multi-line scripts.
Stay safe, stay inside, and remember to wash your hands for 20 seconds!
burque505
Posts: 1372
Joined: 22 Jan 2017, 19:37

Re: AHK HTML Editor test (W.I.P.)

24 Dec 2018, 10:17

DP, thanks for your suggestions.
At some point, hopefully, there will be menus, a floating toolbar, .ini file, settings dialog, template chooser, form builder, a selector inspector, and a help file.
And bells. And whistles :)
Regards, and happy holidays,
burque505 :xmas:
User avatar
kczx3
Posts: 1163
Joined: 06 Oct 2015, 21:39

Re: AHK HTML Editor test (W.I.P.)

24 Dec 2018, 11:01

And a one horse, open sleigh?

Return to “Scripts and Functions”

Who is online

Users browsing this forum: No registered users and 21 guests