Page 1 of 1 1
Topic Options
#76920 - 2003-09-30 09:43 AM 2 different bbCodeParser Lite versions
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
as some remember, we had a tool before that ripped the code from posts that gave it in proper format instead of the screwed way IE it presents.

well, now I have got 2 new chapters to this story.
as we know, still not everyone uses PostPrep.
what the heck, so many does not still after 10 times of saying still can't post with code-tags.

so, here are they.
1st is a "plugin" for checker.
version independent.
if you know just about something...
well, if you know how to make button on form and make the onclick event, this one will fire with it:
;converts code copied from korg to normal text. 
function bbCodeParserLite()
dim $,$!,$_,$2
$=$m.controls.richtextbox(,$m.width,0,0,0)
$2=$m.controls.textbox(,$m.width,0,0,0)
$.hide
$2.hide
$2.multiline=1
$.paste
$!=split($.text,chr(13))
for $_=1 to ubound($!)
$![$_]=split($![$_],chr(10))
$![$_][0]=""
$![$_]=join($![$_],"")
next
$2.text=join($!,@crlf)
$2.selstart=0
$2.sellength=-1
$2.copy
endfunction


simple explanation of how it works.
you select text on topic and click copy.
then go to checker and fire this udf with the button you needed to create.
after that (yes, immediately) you can open your favorite editor (which most likely is notepad) and vóila, it's there, with correct layout.

then the second one.
it's not even kix so not sure should I post it, but anyways.
you need to save this scriptlet as html on your HD:
<SCRIPT LANGUAGE="JavaScript" defer>
var parentwin = external.menuArguments;
var doc = parentwin.document;
var sel = doc.selection;
var rng = sel.createRange();
var str = new String(rng.text);
var a = str.split('\n');
str = a.join('<br>\n');
var codeparser=open("","CodeParser","toolbar=no,menubar=yes,scrollbars=yes",true);
codeparser.document.write('<html><head><title>CodeParser Lite by Lonkero</title></head><body>');
codeparser.document.write(str);
codeparser.document.write("</body></html>");
<!-- rng.execCommand("Copy")-->
</SCRIPT>

the commented out line will most likely make your browser ask do you want to let my scriptlet destroy your government.
if you don't mind it, you can just remove it and enjoy the clipboard copy.
otherwise you need to copy it from the window script opens.
then, for this script to fire...
write into (yes, you can feel smart by writing different keyname):
HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\CodeParser Lite 
(string) default-value=file://C:\\the_path\\thefileyoujustsaved.html
(dword) Contexts = 10


the first will make the menuitem.
second will make it show only when text-selected.
if you leave it out, you might know why I added it there.
so, use just as you wish.

was not gonna post these but wasted about 12 hours of sleeping time, so think I need to.
hope someone will find these usefull.
I bet that at least some requlars will.

[ 30. September 2003, 09:49: Message edited by: Lonkero ]
_________________________
!

download KiXnet

Top
#76921 - 2003-09-30 09:51 AM Re: 2 different bbCodeParser Lite versions
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
oh and mods.
placed this here as general does not allow postprep [Frown]
so, if this is placed there, it's like downloading unzip in zipped package.
_________________________
!

download KiXnet

Top
#76922 - 2003-09-30 04:06 PM Re: 2 different bbCodeParser Lite versions
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
There's nothing wrong in placing it here as it does contain script code and you did start a discussion of it.

Discussion: Cool features ;-)

[ 30. September 2003, 16:10: Message edited by: sealeopard ]
_________________________
There are two types of vessels, submarines and targets.

Top
#76923 - 2004-02-11 01:47 PM Re: 2 different bbCodeParser Lite versions
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
k, new update.
the layout was screwed (just like when you copy-paste to wordpad) so needed to fix it.
the html file for codeparser-menuItem with correct layout is as follows:

<SCRIPT LANGUAGE="JavaScript" defer>
var parentwin = external.menuArguments;
var doc = parentwin.document;
var sel = doc.selection;
var rng = sel.createRange();
var str = new String(rng.text);
str = str.split('\n');
str = str.join('');
str = str.split('<br />');
str = str.join('&#13;');
var codeparser=open("","CodeParser","toolbar=no,menubar=yes,scrollbars=yes",true);
codeparser.document.write('<html><head><title>CodeParser Lite by Lonkero</title></head><body><pre>');
codeparser.document.write(str);
codeparser.document.write("</pre></body></html>");
<!-- rng.execCommand("Copy")-->
</SCRIPT>


ps, didn't need before but copy&paste of new UDF's do require me to build the lib again and doh, that's a pain.
_________________________
!

download KiXnet

Top
#76924 - 2004-02-11 04:50 PM Re: 2 different bbCodeParser Lite versions
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
I cant get the checker plug-in version to work. Copied code of the first post from Using udfSqueeze to remove and split

This code of cousre is all screwed when I try to copy it into notepad. So I ran the function you posted above and re-pasted and it is still all screwed. It didnt seem to change it at all. I know the function is running cause I put a messagebox inside to tell me when it runs.

Top
#76925 - 2004-02-11 04:55 PM Re: 2 different bbCodeParser Lite versions
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
the above code has nothing to do with the checker-plugin.
and the checker plugin is for bbchecker 3.0 alpha.
_________________________
!

download KiXnet

Top
#76926 - 2004-02-11 04:58 PM Re: 2 different bbCodeParser Lite versions
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
I thought you said the checker version didnt matter?

Quote:

1st is a "plugin" for checker.
version independent.





I know the link I posted has nothing to do with your code. I just used it as an example. I should be able to copy the code form the link and the parser should fix it so I can paste it into notepad right? If not then what is the point of the parser. Im obviously missing something.

Top
#76927 - 2004-02-11 05:06 PM Re: 2 different bbCodeParser Lite versions
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
Added this to the menu of BBChecker - Adain 0.2.2...

Code:
 $.SmenuPL=$.Smenu.menuitems.add("Parse Code From Clipboard")
$.SmenuPL.onclick="bbCodeParserLite()"



Added this to the bottom of the code...

Code:
function bbCodeParserLite()
dim $,$!,$_,$2
$=$m.controls.richtextbox(,$m.width,0,0,0)
$2=$m.controls.textbox(,$m.width,0,0,0)
$.hide
$2.hide
$2.multiline=1
$.paste
$!=split($.text,chr(13))
for $_=1 to ubound($!)
$![$_]=split($![$_],chr(10))
$![$_][0]=""
$![$_]=join($![$_],"")
next
$2.text=join($!,@crlf)
$2.selstart=0
$2.sellength=-1
$2.copy
endfunction


Top
#76928 - 2004-02-11 06:38 PM Re: 2 different bbCodeParser Lite versions
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
k, said version independent.
obviously, you need to mod adain as the plugin is old and not included in there.

but the latter code pasted is what I use and it works just fine.
just like the korg-printer
_________________________
!

download KiXnet

Top
#76929 - 2004-02-11 08:10 PM Re: 2 different bbCodeParser Lite versions
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
Yea...The new javascript you posted doesnt seem to work for me either...

Just opens another blank browser window.

Top
#76930 - 2004-02-11 08:40 PM Re: 2 different bbCodeParser Lite versions
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
and what text did you select?
if not blank?
_________________________
!

download KiXnet

Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 2220 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.067 seconds in which 0.033 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org