AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

AHK BBCodeWriter v7.0.2 - An offline BBCode Editor
Goto page Previous  1, 2, 3, 4 ... 17, 18, 19  Next
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
AGermanUser



Joined: 12 Feb 2005
Posts: 82

PostPosted: Sun Nov 13, 2005 4:41 pm    Post subject: Reply with quote

toralf wrote:
Code:
SetBBCodeTags("[b]","[/b]", BoldPressed)

Oh man, I'm so stupid.
thx toralf. Didn't see the mistake despite looking over this passage a hundred times.

Made another update where I added your code simplification.

Added also a "hidden" credits gui. Wink Tell me what you think about it, in case you find it. Laughing
It's not too hard to find it. Mr. Green
_________________
Cheers
BBCodeWriterToDo-ListCopyPassage
Back to top
View user's profile Send private message
Titan



Joined: 11 Aug 2004
Posts: 5043
Location: /b/

PostPosted: Sun Nov 13, 2005 6:35 pm    Post subject: Reply with quote

Another feature could be an automatic popup for your BBCodeWriter, e.g.
Code:
SetTitleMatchMode, 2
SetTimer, PostingReplyCheck
;...
Return

PostingReplyCheck:
IfWinExist, Post a reply - Microsoft Internet Explorer
   Gui, Show
Return
Back to top
View user's profile Send private message Send e-mail Visit poster's website
AGU
Guest





PostPosted: Mon Nov 14, 2005 12:37 am    Post subject: Reply with quote

I'm not sure if I understand what you mean. Does your code mean that the BBCodeWriter window get activated if it looses focus after pressing "Preview"?

That's the reason why I added this "Pin" button on the upper right corner. It makes the main window of BBCodeWriter "AlwaysOnTop". Therefore the browser window can't hide it.
Back to top
Titan



Joined: 11 Aug 2004
Posts: 5043
Location: /b/

PostPosted: Mon Nov 14, 2005 2:04 am    Post subject: Reply with quote

Thats the thing, instead of the window being always on top or having to manually activate the window when you need it, it would be a good addition if the window automatically popped up when it detected that a forum was being used (e.g. by IfWinExist, Post a reply).
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Titan



Joined: 11 Aug 2004
Posts: 5043
Location: /b/

PostPosted: Fri Nov 18, 2005 4:53 pm    Post subject: Reply with quote

Another useful option would be automatic url reference to ahk command names. Run the following script to get a list of hotstrings:

Code:
RegRead, inst, HKLM, SOFTWARE\AutoHotkey, InstallDir
dest = %temp%\AHK-docref.txt
FileDelete, %dest%

FileRead, f, %inst%\Extras\Editors\Syntax\CommandNames.txt
StringReplace, f, f, `r, , 1
Loop, Parse, f, `n
   If A_LoopField
      FileAppend, :*:%A_LoopField%`::[url=http://www.autohotkey.com/docs/commands/%A_LoopField%.htm]%A_LoopField%[/url]`r`n, %dest%
Run, notepad %dest%
Back to top
View user's profile Send private message Send e-mail Visit poster's website
AGU
Guest





PostPosted: Sun Nov 20, 2005 1:49 am    Post subject: Reply with quote

Sorry for my late answer. Embarassed

After readling your lines again I finally understood what you meant with that "automatic popup" feature. You mean BBCodeWriter is running all the time, and when a user tries to post a message or create a new thread, BBCodeWriter should popup to let the user write his posting, right?

Hmm, does it affect system performance when the script is running all the time with the timer checking for a new browser window?
Does the window title always contain "Post a reply - ..." in a standard installation of phpbb? And since BBCodeWriter has no tray icon how would you hide the BBCodeWriter window so that it's not bothering the user. I know some users that get bothered by minimized windows in the taskbar. Or should there be a tray icon?
And what about other languages e.g. german? A german forum won't have "Post a reply -" in the window title , will it? How would you solve that language issue?

Apart from this it's a great idea. I'm thinking about making the "window title recognition" in some way configurable. Any idea? There's plenty of room in the "Preferences" Gui. Wink Mr. Green


Concerning "automatic url reference": That would be a very special thing for AHK users. How do you think this should work? A user enters an AHK command and it is converted to an url linking to the website of that command?
I think AHK commands are mainly noted inside the code tags. But inside code tags URLs don't work. I checked that. So how would you use this feature? Tell me more Mr. Green
Back to top
PhiLho



Joined: 27 Dec 2005
Posts: 6723
Location: France (near Paris)

PostPosted: Fri Jan 06, 2006 4:15 pm    Post subject: Reply with quote

Great script! I was looking for some code to ease inputing BBCode in these little textareas, since stupid phpBB script always append the codes at the end of the area instead of inserting them where the caret is.
Your program is even better! I like the preview.
And this is an impressive example of GUI by AHK.

I wanted to test with a post I was writting, and the preview was awful, with font becoming suddently big and overlaid.

I found it was because I wrote some raw HTML codes: "<p> ends when meeting <h1>, <ul>".

So I added three lines before the bold formatting:
Code:

  ; Convert HTML sensitive chars ###############################################
  StringReplace, bbcode, bbcode, &, &amp`;, All
  StringReplace, bbcode, bbcode, <, &lt`;, All
  StringReplace, bbcode, bbcode, >, &gt`;, All


I also added a `n after <br> so view source is nicer.

I might prefer to insert starting and ending tag at once, and put the caret between. I will see that.
Also I can exit after doing changes, perhaps it should ask to save before, if possible. Not if text has been changed or copied with the button.

Excellent work!
Back to top
View user's profile Send private message Visit poster's website
AGU
Guest





PostPosted: Sun Jan 08, 2006 12:31 pm    Post subject: Reply with quote

Thx for your nice compliments. Very Happy
Quote:
So I added three lines before the bold formatting:

Makes sense. I'll add these in a next version 5.6

Quote:
I also added a `n after <br> so view source is nicer
I consider adding these too. I just have to check in different browsers if empty lines within HTML code affect the correct displaying of the preview page.

Quote:
I might prefer to insert starting and ending tag at once, and put the caret between.
Hmm, I see what you mean. That's rather hard to add within the script. But of course you can edit the source ahk files to accompolish this.
Just have a look at the "SetBBCodeTags" function. You just have to replace
Code:
        If (In_BtnVariable = 0)
          {
            In_BtnVariable++
            Return, %In_StartTag%
          }
        If (In_BtnVariable = 1)
          {
            In_BtnVariable--
            Return, %In_EndTag%

to s.th that fits your needs. E.g.

Code:
        Return, %In_StartTag%%In_EndTag%

Of course you have to do a StringLen on the In_EndTag to get the number of characters because the length can vary between the different tags.
In the end just Send, {Left %LengthOfEndTag%} and you're done I think.

Quote:

Also I can exit after doing changes, perhaps it should ask to save before, if possible.
Good idea. I'll think about it and will have a look how to accomplish this. Very Happy

Cheers
AGU
Back to top
AGermanUser



Joined: 12 Feb 2005
Posts: 82

PostPosted: Mon Jan 09, 2006 10:00 pm    Post subject: Reply with quote

So, after some hours of work I added all your proposed features. Mr. Green

I changed the entering of BBcode Tags to your proposed system (pasting both tags and moving caret) cause I found it much better than before. In this way I can do it without all this xxxxPressed variables.

Further details can be found in the updated first posting.

Cheers
AGermanUser a.k.a AGU

EDIT
btw:
I'm still looking for a better icon instead of this little smiley in the title bar. I made this smiley in a rush. I'm looking for a better icon that looks good at 16x16pixel as well as with 32x32pixel and goes in line with AHK BBcodeWriter. Any suggestions?
_________________
Cheers
BBCodeWriterToDo-ListCopyPassage
Back to top
View user's profile Send private message
brian32
Guest





PostPosted: Tue Jan 10, 2006 12:53 am    Post subject: Reply with quote

This is one of the best and most useful AHK scripts I've seen. Thanks very much for sharing it and updating it!

I have run into one problem though. Html and xml statements within bbcode's code tags do not display properly when previewed. I presume that the '<' characters are the culprit. It has not been a hinderance but it would be nice if that worked properly. Maybe this could go onto the list of improvements for a future version.

Thanks once again.

brian32
Back to top
AGermanUser



Joined: 12 Feb 2005
Posts: 82

PostPosted: Tue Jan 10, 2006 12:20 pm    Post subject: Reply with quote

thx brian32. Very Happy
Quote:
I have run into one problem though. Html and xml statements within bbcode's code tags do not display properly when previewed. I presume that the '<' characters are the culprit.
I updated the script to version 5.6.1 and hopefully fixed that issue. See updated first posting.

Could you give it one more try and report back if it's okay now? Maybe there are more HTML/XML sensitive chars that need to be taken care of.
_________________
Cheers
BBCodeWriterToDo-ListCopyPassage
Back to top
View user's profile Send private message
brian32
Guest





PostPosted: Tue Jan 10, 2006 3:35 pm    Post subject: Reply with quote

AGU that was a fast response! It looks like it is working fine now previewing XML and HTML code.

Thanks again for a great script.
brian32
Back to top
twhyman



Joined: 07 Dec 2005
Posts: 310

PostPosted: Wed Jan 18, 2006 5:11 pm    Post subject: Reply with quote

hi,

when i try to run the script i get and error on line 125 " call to non existent function"

btw the directoy of the icons is the root dir not in phpbb if that makes any differnce.

iam trying to learn how to make buttons with graphics Smile

i have found the graphic buttons script from corrupt

but i really wanna use that editor Very Happy

thanks
Twhyman
Back to top
View user's profile Send private message
AGU
Guest





PostPosted: Wed Jan 18, 2006 8:39 pm    Post subject: Reply with quote

Hello, twhyman

I think you tried to run "BBCodeEditor.ahk". But this is wrong. As the instruction in the first posting states out:
Quote:
Simply extract the zip file to a folder and run "main.ahk".

You just have to extract the downloaded zip file to a directory of your choice and run "main.ahk" inside of this directory.

main.ahk includes all files with the help of the #Include directive. It includes for example the "functions.ahk" which holds the function used inside BBCodeEditor.ahk.
So when you run BBCodeEditor.ahk on its own it can't find that function and reports the error "Call to non existent function"

btw. when you extract the zip file you have to tell your zip program to obey the included paths within the zip file. Normally you won't have to pay attention to this. Your zip program should do that automatically. I wrote it just in case you're still having problems after this posting.

The directory has to look like this after unzipping:

Code:
Your folder
  + phpbb
    + ico             (icons for main gui)
      + smileys       (icons for smiley gui)
    + images          (images for html preview page)
    + smileys         (smiley images for preview page)
      BBCodeEditor.ahk
      BBCodePreview.ahk
      color.gif
      style.css
  + postings          (folder will be created at first script start)
  + text              (text files for help menu in menu bar - main gui)
    BBCodeWriter.ini  (config file - holds displayed number of lines in main.gui)
    functions.ahk     (used functions)
    hotkeys.ahk       (used hotkeys)
    main.ahk          (this is the start script - this has to be executed to run BBCodeWriter)
    preview.html      (file will be created when pushing "preview" button within main gui)


Hope that helps Mr. Green

Cheers
AGU
Back to top
Ace_NoOne



Joined: 10 Oct 2005
Posts: 299
Location: Germany

PostPosted: Thu Feb 02, 2006 7:08 pm    Post subject: Reply with quote

Wow, pretty elaborate work there - thanks for sharing!

Just a minor suggestion to avoid losing the clipboard content (this might have come up already, I haven't read all replies here):
Code:
OnExit, quit

clipboardOld := clipboard ; backup clipboard contents (using ClipboardAll here might result in excessive memory use)
clipboard = ; flush clipboard

[...]

quit:
   clipboard := clipboardOld ; restore clipboard contents
   ExitApp
Return
(I just noticed there's an example in the documentation that's pretty much exactly the same as my suggestion here - d'oh!)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Goto page Previous  1, 2, 3, 4 ... 17, 18, 19  Next
Page 3 of 19

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group