Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

WYSIWYG BBCode Editor


  • Please log in to reply
58 replies to this topic

Poll: Do you use it? (27 member(s) have cast votes)

Do you use it?

  1. I use this software. (12 votes [37.50%])

    Percentage of vote: 37.50%

  2. I plan to use this sometime. (15 votes [46.88%])

    Percentage of vote: 46.88%

  3. I do not use this nor plan to use it. (5 votes [15.62%])

    Percentage of vote: 15.62%

Vote Guests cannot vote
HotKeyIt
  • Moderators
  • 7439 posts
  • Last active: Jun 22 2016 09:14 PM
  • Joined: 18 Jun 2008
Nice work, well done. Thanks for sharing :)

One small bug in bbcode.ahk (line 127), missing closing quotation mark (") in quote when generating BBCode
[quote name="person[color=red]"[/color]]text[/quote]
Fix:
htmlStr := RegExReplace(htmlStr, "i)<blockquote\s?[^<>]*?(title=)?""?([^<>]+)?""?[^<>]*?>([^<>]*?)<\/blockquote>", "[quote name=""$2[color=red]""[/color]]$3[/quote]")

Also what Lexikos means is
#IfWinActive WYSIWYG BBCode Editor [color=red]ahk_class AutoHotkeyGUI[/color]
Otherwise hotkeys might work in a different window that is named same, for example internet explorer.

shajul
  • Members
  • 571 posts
  • Last active: Aug 01 2015 03:45 PM
  • Joined: 15 Sep 2006

One small bug,,


Thanks for looking into it. I already noticed it, but the fix you suggested causes an extra double-quote if the title has quotes in it eg <blockquote title="this user">
I have fixed it like this
htmlStr := RegExReplace(htmlStr, "i)<blockquote\s?[^<>]*?title=""?([^<>""]+)""?[^<>]*?>([^<>]*?)<\/blockquote>"    , "[quote name=""$1""]$2[/quote]")
  htmlStr := RegExReplace(htmlStr, "i)<blockquote\s?[^<>]*?>([^<>]*?)<\/blockquote>", "[quote]$1[/quote]")

Any better ideas?

Also what Lexikos means is
#IfWinActive WYSIWYG BBCode Editor ahk_class AutoHotkeyGUI Otherwise hotkeys might work in a different window that is named same, for example internet explorer.

Thanks, Fixed that.
If i've seen further it is by standing on the shoulders of giants

my site | ~shajul | WYSIWYG BBCode Editor

HotKeyIt
  • Moderators
  • 7439 posts
  • Last active: Jun 22 2016 09:14 PM
  • Joined: 18 Jun 2008
:?:
htmlStr := RegExReplace(htmlStr, "i)<blockquote\s?[^<>]*?(title=)?""?([^<>[color=red]""[/color]]+)?""?[^<>]*?>([^<>]*?)<\/blockquote>", "[quote name=""$2""]$3[/quote]")


shajul
  • Members
  • 571 posts
  • Last active: Aug 01 2015 03:45 PM
  • Joined: 15 Sep 2006
Yes, thats perfect :)
If i've seen further it is by standing on the shoulders of giants

my site | ~shajul | WYSIWYG BBCode Editor

MacroMan!
  • Members
  • 604 posts
  • Last active: Mar 20 2012 11:40 AM
  • Joined: 28 Aug 2009
First off, wow. Brilliant work shajul.

One suggestion (and it's a big one): Have a button to check if the new message/post a reply page is open in IE and post the code in the box using COM.

David
What ever happened, happened.

Frankie
  • Members
  • 2930 posts
  • Last active: Feb 05 2015 02:49 PM
  • Joined: 02 Nov 2008

I think you might need to add ahk_class AutoHotkeyGUI to your hotkeys so that it doesn't interfere with our browser hotkeys while we're viewing this thread.

Thanks for pointing that out - i missed that. I'll make changes and re-upload.
Edit:The hotkeys are not interfering here. I already have #IfWinActive WYSIWYG BBCode Editor for all the hotkeys.

Yes, the same as the title of the forum topic and the title of most web browsers on this page. :wink:
aboutscriptappsscripts
Request Video Tutorials Here or View Current Tutorials on YouTube
Any code ⇈ above ⇈ requires AutoHotkey_L to run

shajul
  • Members
  • 571 posts
  • Last active: Aug 01 2015 03:45 PM
  • Joined: 15 Sep 2006

One suggestion (and it's a big one)

Thanks David, i'll put that on my to-do list.

@Frankie: yes, i was a bit slow on that. i've already fixed that :)
If i've seen further it is by standing on the shoulders of giants

my site | ~shajul | WYSIWYG BBCode Editor

Lexikos
  • Administrators
  • 9844 posts
  • AutoHotkey Foundation
  • Last active:
  • Joined: 17 Oct 2006

The stylesheet is at .\res\style.css

I noticed. For some reason the ugly Times New Roman text didn't go away after I copy-pasted the css. ;)

shajul
  • Members
  • 571 posts
  • Last active: Aug 01 2015 03:45 PM
  • Joined: 15 Sep 2006

For some reason the ugly Times New Roman text didn't go away after I copy-pasted the css. ;)


Just copy-paste this into style.css to get rid of Times New Roman. 8)
/* Styles for subSilver PHPBB2 */
body {
/*	I personally hate dark backgrounds
  background-color: #E5E5E5; */ 
	font-family: Verdana, Arial, Helvetica, sans-serif;
	scrollbar-face-color: #DEE3E7;
	scrollbar-highlight-color: #FFFFFF;
	scrollbar-shadow-color: #DEE3E7;
	scrollbar-3dlight-color: #D1D7DC;
	scrollbar-arrow-color:  #006699;
	scrollbar-track-color: #EFEFEF;
	scrollbar-darkshadow-color: #98AAB1;
}

a:link,a:active,a:visited { color : #006699; }
a:hover		{ text-decoration: underline; color : #DD6900; }
/* End Styles for subSilver PHPBB2 */

If i've seen further it is by standing on the shoulders of giants

my site | ~shajul | WYSIWYG BBCode Editor

shajul
  • Members
  • 571 posts
  • Last active: Aug 01 2015 03:45 PM
  • Joined: 15 Sep 2006
Update to version 0.9.1:
[*:3u7lgd1y]Ctrl+Enter will now post your message and activate IE (IE only) [*:3u7lgd1y]86 new smileys, with possiblility of unlimited smileys Posted Image<- obviously, inserted with the new smiley feature Posted Image
Smileys courtesy freesmileys.org, I will consider moving it to AHK.net if we generate a lot of load Posted Image
For Ctrl+Enter to work, a Post a new topic or Post a reply page should be open in IE. Whatever is generated will be appended to the text already in the window.
If i've seen further it is by standing on the shoulders of giants

my site | ~shajul | WYSIWYG BBCode Editor

Frankie
  • Members
  • 2930 posts
  • Last active: Feb 05 2015 02:49 PM
  • Joined: 02 Nov 2008
Thank you!!! Posted Image

Edit: Sorry about tripple post, don't know why that happened. I don't think it was your software's fault, I posted in chrome...

Edit2: Fixed...and tried in IE. Thats pretty cool how it places the BBCode in the box. Nice job.
aboutscriptappsscripts
Request Video Tutorials Here or View Current Tutorials on YouTube
Any code ⇈ above ⇈ requires AutoHotkey_L to run

shajul
  • Members
  • 571 posts
  • Last active: Aug 01 2015 03:45 PM
  • Joined: 15 Sep 2006
Glad you like it.

Here is an update

Version 0.9.2 (2011-04-04) :
- Supports many more forums for Posting BBCode directly (Ctrl+Enter)
PHPBB2/3, SMF, vBulletin, PunBB, IPBoard, Proboards, Phorum, XMB and more..
That means you can use this on any other forum you are active on!!
- Installer/Uninstaller for easy updates and clean uninstalls
- Associates with file extension .bbs for easy opening of saved BBCode messages.
- Many more keyboard shortcuts.
- New documentation. Keyboard shortcuts documented in program itself.
- Improved regex performance with the "S" option and (?:.*) where applicable.
- Some bugfixes.
If i've seen further it is by standing on the shoulders of giants

my site | ~shajul | WYSIWYG BBCode Editor

sumon
  • Moderators
  • 1317 posts
  • Last active: Dec 05 2016 10:14 PM
  • Joined: 18 May 2010
I made a workaround to paste it into chrome (you can adjust it to Mozilla by changing the ahk_class), so now I'll start to use it. I fully understand that you don't wanna implement support for the major browsers, since that might bug out. The IE way is guaranteed to work. But on the other hand, Google Chrome & Mozilla are two more used readers.

Anyway, the code I changed was in inc/controls.ahk:

PostMessage:
^Enter::

; Original code above...

IfWinExist, ahk_class Chrome_WidgetWin_0
{
  ClipSaved := ClipboardAll
  Clipboard := BBCode(pwb.document.body.innerHTML)
  WinActivate
  Send ^v
  Clipboard := ClipboardSaved
  ClipboardSaved := 
  return
}

; ... Original code below

It's not working flawless, so if anyone has ideas on how to improve it, bring it on.

shajul
  • Members
  • 571 posts
  • Last active: Aug 01 2015 03:45 PM
  • Joined: 15 Sep 2006

It's not working flawless, so if anyone has ideas on how to improve it, bring it on.


Try the code below for a more reliable method. Uses javascript injection. I may add this to the project after some more testing.
PS: for this to work, Post a new topic/post a reply page has to be the active tab.

if ChromeGet()
  PostBBCodeChrome( BBCode(pwb.document.body.innerHTML) )

PostBBCodeChrome(bbcode) {
  StringReplace, postData, bbcode,`n,\n,All
  postData := "javascript:wysiwyg_bbc = document.getElementsByTagName('textarea').item(0).value; document.getElementsByTagName('textarea').item(0).value = wysiwyg_bbc + '\n" . postData . "'; void 0"
  ControlSetText, Chrome_AutocompleteEditView1, %postData%,- ahk_class Chrome_WidgetWin_0
  ControlSend, Chrome_AutocompleteEditView1,{End}{Enter},- ahk_class Chrome_WidgetWin_0
  WinActivate,- ahk_class Chrome_WidgetWin_0
  return 1  
}

ChromeGet() {
  IfWinNotExist, ahk_class Chrome_WidgetWin_0
    return 0 ;Cant find google chrome
  WinGetText, text,- ahk_class Chrome_WidgetWin_0
  WinGetTitle, title, - ahk_class Chrome_WidgetWin_0
  If RegExMatch(title,"i)(Post|Start)(ing)? (a )?new topic") 
  || RegExMatch(title,"i)Post(ing)? (a|new)? ?reply") ;phpBBv2, punBB, SMF, Invision
    Return 1
  Else If InStr( title , "Post New Thread" ) || InStr( title , "Reply to Topic" ) ;vBulletin
    Return 1
  Else If InStr( title , "New Thread in" ) || InStr( title , "Post Reply to" ) ;myBB
    Return 1
  Else If InStr( title , "Post message" ) ;ProBoards
    Return 1
  Else if InStr( text , "posting.php" ) || InStr( text , "action=newthread" ) || InStr( text , "action=reply" ) ;phorum, xmb
    return 1
  Else if InStr( text , "#newtopic" ) || InStr( text , "#reply" ) || InStr( text , "newreply.php" ) ;miniBB, phorum
    return 1
  /*
  Else If InStr( title , "Post new topic" ) || InStr( title , "Post new reply" ) ;punBB
    Return 1
  Else If InStr( title , "Start new topic" ) || InStr( title , "Post Reply" ) ;SMF
    Return 1
  */
  return 0 ;Cant find correct title or URL to post
}

If i've seen further it is by standing on the shoulders of giants

my site | ~shajul | WYSIWYG BBCode Editor

shajul
  • Members
  • 571 posts
  • Last active: Aug 01 2015 03:45 PM
  • Joined: 15 Sep 2006
Updated!
Version 0.9.3 (2011-04-07) :
- Post BBCode (Ctrl+Enter) now supports Google Chrome browser also. Relevant code can be seen in the previous post.

Firefox cannot be supported in any reliable way as its controls and text are not accessible directly.

Important:
Please take the poll of this topic so that I know if there is enough interest to continue developing this! Thanks a lot for your feedback.
If i've seen further it is by standing on the shoulders of giants

my site | ~shajul | WYSIWYG BBCode Editor