inherit
Proboards Legend
212
0
May 11, 2006 12:32:55 GMT -8
california
21,035
December 1999
california
|
Post by california on Feb 8, 2006 1:19:23 GMT -8
I've implemented a new code tag at SoCal with some nifty features: - spacing is saved (with some help from the censored words list) - overflow so that there is a horizontal scrollbar and lines don't wrap or stretch the board - click to select content - click again to edit content (think IE address bar) - no vertical scrollbar - the textarea updates the number of rows whenever the number of rows changes - a "click to copy all" button (only appears in IE) - a "revert changes" button that replaces the editted content of the textarea with the code tag's original content. When posting it's still the standard [co de], not [supercode] or anything like that. Example here: socal.proboards26.com/index.cgi?board=PBCODES&action=display&thread=1115625261It's not the actual code you should be concerned with but that box it's in. The "About this feature" link to this page isn't in the codes below. I cannot post it here because of all the amp codes the code uses, but you can see it here: www.iycatacombs.com/socal/resources/scripts/supercode.txtIf you get a blank page, view the source code or download it and open it in notepad. CSS to go along with it: <style type="text/css">
.code { width: 465px; overflow-x: auto; }
.codearea { overflow-y: hidden; border: 1px dashed #404040; }
--> </style> In order for the spacing part to work you need to censor two spaces with "&nb sp; " Various widths, colors and things will need to be editted to suit individual forums. It could stand to be made a little more user-friendly I would think. If you don't understand certain things in this post you'd probably be best off not using the code.
|
|
MBME
New Member
woo
Posts: 1
inherit
72735
0
Oct 21, 2007 19:50:42 GMT -8
MBME
woo
1
February 2006
mbme23
|
Post by MBME on Feb 8, 2006 1:32:12 GMT -8
yet again he creates something far better than i could but i love the idea of the censored words list never would have thought of it.
|
|
DDL
Full Member
Posts: 730
inherit
63237
0
Jun 12, 2010 19:40:34 GMT -8
DDL
730
November 2005
ddl
|
Post by DDL on Feb 8, 2006 6:27:22 GMT -8
California, this is one of your greatest codes I've ever seen! I would have never thought of editing the code box...again, great job!
|
|
inherit
61034
hotdog20072003 yjacket_2007
0
Oct 2, 2008 13:49:22 GMT -8
Cow Pie
My Favorite Bands
4,088
October 2005
deadpoeticstar
|
Post by Cow Pie on Feb 8, 2006 6:39:14 GMT -8
cali where should i send the check?...lol
|
|
Guide
New Member
Posts: 0
inherit
181056
0
Jul 6, 2012 10:43:44 GMT -8
Guide
0
July 2012
11823
|
Post by Guide on Feb 8, 2006 8:03:19 GMT -8
Nice one cali! Very useful
|
|
acoolie530
inherit
-153886
0
May 17, 2024 0:38:45 GMT -8
acoolie530
0
January 1970
GUEST
|
Post by acoolie530 on Feb 8, 2006 16:15:03 GMT -8
Why didn't you just use CSS for spacing? white-space: pre would do the trick.
|
|
inherit
Proboards Legend
212
0
May 11, 2006 12:32:55 GMT -8
california
21,035
December 1999
california
|
Post by california on Feb 8, 2006 17:22:56 GMT -8
Because when you post anything PB strips out consecutive spaces before you even have a chance to do that. It's in a textarea now, so the CSS isn't needed. But there's no way to do it without the censored words list.
|
|
inherit
22517
0
Apr 30, 2009 18:49:13 GMT -8
Bradley
Has a new webhost. :) Needs to transfer a lot of stuff. :-/
5,246
April 2004
ccworldwebmaster
|
Post by Bradley on Feb 8, 2006 17:34:55 GMT -8
Nice code. Firefox still has the vertical scollbar. The last line is partially covered by the horizontal scrollbar. The code hasn't actually been tested in FF yet. I have a new computer and I'm not downloading it until they remove CSS errors from the JavaScript Console Why? That's seems like a pretty sad reason not to download it.
|
|
inherit
Proboards Legend
212
0
May 11, 2006 12:32:55 GMT -8
california
21,035
December 1999
california
|
Post by california on Feb 8, 2006 18:32:22 GMT -8
Because it renders it unusable. The thing gets filled with CSS errors from the google ads among other things in seconds. The only reason I really ever used FireFox was for its JavaScript console because IE's error reporting sucks so much, but no matter, I've found an extension that seperates the different types of errors. I still think it makes absolutely no sense that they call it the JavaScript console and put CSS errors in it though.
What you initially noticed I think is caused by the fact that FireFox doesn't consider the horizontal scrollbar when determining the number of rows in a textarea and IE does. FireFox just slaps the scrollbar over the last row instead of adding it below the last row. The row count function has been improved for FireFox/Opera now. Of course to determine the number of rows you need to use split(/\n/).length and IE and FireFox do that differently if there's more than one consecutive break, but I figured something out. In Opera the vertical scrollbar appears anyway even though there's enough rows and nothing to scroll. Apparently "overflow-y: auto;" doesn't fly with it. And in IE tabs aren't kept for some reason -- they're supposed to be converted to four spaces. Not a big deal though.
Haven't updated the downloads yet, just the ones for SoCal.
|
|
inherit
2671
0
May 14, 2013 14:40:03 GMT -8
Peter
🐺
10,615
February 2002
peter3
|
Post by Peter on Feb 9, 2006 5:28:59 GMT -8
|
|
inherit
13333
0
Mar 19, 2012 20:30:58 GMT -8
hey
4,271
September 2003
hey
|
Post by hey on Feb 9, 2006 15:25:34 GMT -8
Awesome. ;D I hope they include something like this in Proboards V5.
|
|
inherit
Proboards Legend
212
0
May 11, 2006 12:32:55 GMT -8
california
21,035
December 1999
california
|
Post by california on Feb 9, 2006 18:07:49 GMT -8
Yep, that's the extension I was talking about
|
|
inherit
2671
0
May 14, 2013 14:40:03 GMT -8
Peter
🐺
10,615
February 2002
peter3
|
Post by Peter on Feb 10, 2006 1:42:27 GMT -8
Yep, that's the extension I was talking about Ah Also, about the focus (hasFocus() you mentioned about). You could just check for both onfocus and onbur, then you would know if it had focus?
|
|
inherit
Don't click here.
23409
0
Jul 19, 2016 11:37:12 GMT -8
Ðravu
✖ ✖ ✖ ✖ ✖ ✖ ✖ ✖ ✖ ✖ ✖
3,309
April 2004
dravu2000
|
Post by Ðravu on Feb 10, 2006 5:07:10 GMT -8
You should do what I did. Download Mozilla Suite and choose the option during installation to just install the browser. I've always used it. It's like a better and more secure version of the netscape browser. And doesn't generate any CSS errors unless they are actually errors. *shrug* I hated that in FF. Especially the scrollbar colors CSS errors. x.x oh yeah. Nice code cali. >.>
|
|
inherit
Proboards Legend
212
0
May 11, 2006 12:32:55 GMT -8
california
21,035
December 1999
california
|
Post by california on Feb 10, 2006 16:55:18 GMT -8
Updated the calcRows function again, and this time I've included the update in the text file. Also, about the focus (hasFocus() you mentioned about). You could just check for both onfocus and onbur, then you would know if it had focus? It was for the click once to select, click again to edit feature. Originally I was using onclick but I figured it's a textarea and if someone tabs into it, it should still highlight, and onfocus would be the better way to go. But I added in a check to the onfocus to make sure that it wouldn't just keep selecting everything like it would with onclick, what I was trying to do was: if(!this.hasFocus()){this.select();} Since there is no hasFocus() (and why not, anyway?), I ended up using a global recordFocus string that held the statuses of all the code textareas on the page. Onfocus would add them to the list, onblur would remove them from it. I think that's basically what you meant, right? Well I realized that none of that was really necessary, because if the textarea already had the focus then the onfocus event wouldn't even fire anyway when the textarea was clicked on, and all I ever really needed was onfocus="this.select();" and no onblur event at all. Silly me
|
|