vForums Support > System Improvements :: Suggestions :: Implemented Suggestions :: > Code Tag

Code Tag - Posted By Marc (cr0w) on 10th Dec 07 at 12:00am
Perhaps have a "Select All" link on the very right, beside "Code:"...if a code scrolls horizontally and vertically it's hard to select all manually. {Tongue Out}

Re: Code Tag - Posted By Nick (nickb) on 10th Dec 07 at 12:02am
{Tongue Out} I was going to suggest that sooner or later. lol. {Grin}

Re: Code Tag - Posted By Marc (cr0w) on 10th Dec 07 at 12:03am
 
{Tongue Out} I was going to suggest that sooner or later. lol. {Grin}


Haha, I win. {Tongue Out}

Re: Code Tag - Posted By BizzD (0wnzer) on 10th Dec 07 at 12:03am
Yes that would be nice.

Re: Code Tag - Posted By Nick (nickb) on 10th Dec 07 at 12:04am
lol {Cheesy}

Re: Code Tag - Posted By Luke (Zero) on 10th Dec 07 at 3:06am
Simple fix... Just double-click on any text in the code... {Wink}


Try it
Code:
 
  1. Test
  2. Test
  3. Test
  4. Test
  5. Test
  6. Test
  7. Test
  8. Test
  9. Test
  10.  
 



Re: Code Tag - Posted By Marc (cr0w) on 10th Dec 07 at 3:08am
 
Simple fix... Just double-click on any text in the code... {Wink}

Code:
 
  1. Test
  2. Test
  3. Test
  4. Test
  5. Test
  6. Test
  7. Test
  8. Test
  9. Test
  10.  
 


Doesn't work in FF; just selects the current word.

Re: Code Tag - Posted By Tyson (Fithad) on 10th Dec 07 at 3:09am
You could ctrl+click on a word, and it select all.

Re: Code Tag - Posted By Marc (cr0w) on 10th Dec 07 at 3:12am
 
You could ctrl+click on a word, and it select all.


Remember, not everyone knows shortcuts. People are lazy, and would much rather have everything put in front of them. {Unsure}

Re: Code Tag - Posted By Tyson (Fithad) on 10th Dec 07 at 3:14am
True... unfortunately {Rolleyes}
I guess a simple (Select All) link would fit nicely anyways.

Re: Code Tag - Posted By Marc (cr0w) on 10th Dec 07 at 3:15am
 
True... unfortunately {Rolleyes}
I guess a simple (Select All) link would fit nicely anyways.


We'll see what Ross says tomorrow. {Smile} (Well, today for him.)

Re: Code Tag - Posted By Tyson (Fithad) on 10th Dec 07 at 3:19am
Is there any other UK people on here{Confused}

For being hosted in the UK (presumably), this is quite a quick loading service.

Re: Code Tag - Posted By Marc (cr0w) on 10th Dec 07 at 3:23am
 
Is there any other UK people on here{Confused}

For being hosted in the UK (presumably), this is quite a quick loading service.


I'm not sure the location matters that much. After all, when doing speed tests, a speed test run from a New York server is slower for me than a speed test run in Africa. It's the server speed moreover than the server location.

Re: Code Tag - Posted By Tyson (Fithad) on 10th Dec 07 at 3:25am
Oh ok... could also be that this place may not be as busy as some other sites I visit.

Re: Code Tag - Posted By Marc (cr0w) on 10th Dec 07 at 3:53am
 
Oh ok... could also be that this place may not be as busy as some other sites I visit.


Maybe...I'm sure Ross will eventually be getting numbered servers, like Proboards has, once the service gets popular enough. {Smile}

Re: Code Tag - Posted By Nick (nickb) on 10th Dec 07 at 3:26pm
 
Oh ok... could also be that this place may not be as busy as some other sites I visit.


I live in Wisconsin, US. and the server loads up fast for me, It depends on the service you have, DSL = Fast, LAN = Fast, Cable = Fast, Dial up = Slow.

~Darkmage

Re: Code Tag - Posted By Graham (amusedtodeath) on 10th Dec 07 at 4:03pm
 
Is there any other UK people on here{Confused}


*Raises hand aloft*

Re: Code Tag - Posted By BizzD (0wnzer) on 12th Dec 07 at 1:02am
 
 
Oh ok... could also be that this place may not be as busy as some other sites I visit.


Maybe...I'm sure Ross will eventually be getting numbered servers, like Proboards has, once the service gets popular enough. {Smile}


VF will probably get more popular faster than PB did. Though it would be nice if not all of the members are from PB. Then it wouldn't be much of a difference. {Unsure}

Re: Code Tag - Posted By Marc (cr0w) on 12th Dec 07 at 1:47am
 
 
 
Oh ok... could also be that this place may not be as busy as some other sites I visit.


Maybe...I'm sure Ross will eventually be getting numbered servers, like Proboards has, once the service gets popular enough. {Smile}


VF will probably get more popular faster than PB did. Though it would be nice if not all of the members are from PB. Then it wouldn't be much of a difference. {Unsure}


Once people get established forums, then members of those forums will come here. {Wink}

Re: Code Tag - Posted By Ross (admin) on 13th Dec 07 at 12:19am
How does this look?

Code:
 
  1. Any
  2. Plain
  3. Text
  4. Or
  5. [b]UBBC[/b]
  6. Tags
 


Code: CSS
 
  1. <style type="text/css">
  2. <!--
  3. .clasname { width: 100px; background-color: #ff6600;
  4. }
  5. #id { display: none;
  6. }
  7. //-->
  8. </style>
 


It still needs some work on the height, of each code box and some of the syntax highlighting isn't working properly, but is that looking better?

Re: Code Tag - Posted By Marc (cr0w) on 13th Dec 07 at 3:37am
 
How does this look?

Code:
 
  1. Any
  2. Plain
  3. Text
  4. Or
  5. [b]UBBC[/b]
  6. Tags
 


Code: CSS
 
  1. <style type="text/css">
  2. <!--
  3. .clasname { width: 100px; background-color: #ff6600;
  4. }
  5. #id { display: none;
  6. }
  7. //-->
  8. </style>
 


It still needs some work on the height, of each code box and some of the syntax highlighting isn't working properly, but is that looking better?


Ross, you are officially teh sex. {Grin}

EDIT: Uh-oh, quotes don't work when there are code tags enclosed in them. {Sad}

Re: Code Tag - Posted By Ross (admin) on 13th Dec 07 at 9:44am
Fixed. I've also added some automatic height calculation.

Re: Code Tag - Posted By Graham (amusedtodeath) on 13th Dec 07 at 10:29am
Still seems to be misaligned {Unsure}

Image

Re: Code Tag - Posted By Ross (admin) on 13th Dec 07 at 10:54am
What browser is that in? I've only checked it in IE7 and Firefox2 at the moment.

Re: Code Tag - Posted By Graham (amusedtodeath) on 13th Dec 07 at 10:58am
Tis in FF2, which makes it all the more confusing {Unsure}

Re: Code Tag - Posted By Ross (admin) on 13th Dec 07 at 11:40am
When in doubt, revert to tables {Tongue Out}

Re: Code Tag - Posted By Graham (amusedtodeath) on 13th Dec 07 at 11:41am
There we go, much better {Cheesy}

Re: Code Tag - Posted By Marc (cr0w) on 13th Dec 07 at 3:47pm
 
When in doubt, revert to tables {Tongue Out}


Thanks Ross, looks even sexier. {Wink} {Smile}

Re: Code Tag - Posted By Ross (admin) on 13th Dec 07 at 11:48pm
There's a couple of options in regards to the syntax highlighting. As shown in the two samples above there's plain (no highlight) and CSS. But there's also php, js and html


Code: PHP
 
  1. <?php
  2. include "../includes.php";
  3. echo "Hello World";
  4. do_my_function();
  5. ?>
 


Code: HTML
 
  1. <table class="border" cellpadding="3" cellspacing="1">
  2. <tr>
  3. <td class="window1">
  4. <span style="font-size: 15px; font-weight: bold;">Contents of my table</span>
  5. </td>
  6. </tr>
  7. </table>
 


Code: JavaScript
 
  1. <script type="text/javascript">
  2. <!--
  3. var td = document.getElementsByTagName('td');
  4. for(i=0; i<td.length; i++) {
  5. if(td.item(i).width == "20%") {
  6. td.item(i).innerHTML += "my string";
  7. }
  8. }
  9. //-->
  10. </script>
 


The highlighting engines for the CSS, HTML and JS were all custom built so I wouldn't be surprised if it conflicts with some codes and doesn't highlight them 100% accurately. But overall I'm pretty happy with the result. {Smile}

Re: Code Tag - Posted By Graham (amusedtodeath) on 13th Dec 07 at 11:51pm
Looking good mate, good darts {Smile}

Re: Code Tag - Posted By Marc (cr0w) on 14th Dec 07 at 4:34am
That looks really cool, should make it much easier when helping someone with code errors. {Smile}

Thanks Ross. {Smile}