UserScript • PB-SyntaxHighlighting for codes in the forum

For everything that's not in any way related to PureBasic. General chat etc...
User avatar
STARGÅTE
Addict
Addict
Posts: 2063
Joined: Thu Jan 10, 2008 1:30 pm
Location: Germany, Glienicke
Contact:

UserScript • PB-SyntaxHighlighting for codes in the forum

Post by STARGÅTE »

To make the code easier to read here in the forum, without copying the code in PureBasic,
here is a user script which enables syntax highlighting:

Latest version here: viewtopic.php?p=571104#p571104

UserScript - Pure Basic Syntax Highlighting (V 1.6) (16. Feb 2011)

Example code:

Code: Select all

#Constant = "String, #Constants and ; Comments are ignored"

; One Comment, #Constants and "Strings" are ignored

Structure AnyStructure
  Long.l
  *Pointer.AnyStructure
  String$
EndStructure

Procedure AnyProcedure(Parameter1, *Parameter2, Parameter3)

  ! MOV eax, 1
  ProcedureReturn 
EndProcedure

AnyStructureVarible.AnyStructure
AnyStructureVarible\Long = $FF00CC

AnyProcedure(3.14, @AnyProcedure(), 'Abc')
Example result::
Image


Settings:
The syntax color can set yourself.
Either direct or by change the user script in the range // == PureBasicPreference ==
or just use this program:

Code: Select all

Procedure.s HTMLColor(Color)
  ProcedureReturn "#"+RSet(Hex(Red(Color)),2,"0")+RSet(Hex(Green(Color)),2,"0")+RSet(Hex(Blue(Color)),2,"0")
EndProcedure

Procedure Export(PreferencesFileName$)
  If OpenPreferences(PreferencesFileName$)
    PreferenceGroup("Global")
    Debug "  PBSH_Highlight['EnableKeywordBolding'] = "+ReadPreferenceString("EnableKeywordBolding", "1")+";"
    PreferenceGroup("Editor")
    Restore PreferenceKeys
    Repeat
      Read.s Keyword$
      If Keyword$
        String$ = ReplaceString(ReadPreferenceString(Keyword$, ""), ",", " ")
        If Right(Keyword$, 5) = "Color" : String$ = HTMLColor(Val(String$)) : EndIf
        If ReadPreferenceInteger(Keyword$+"_Disabled", 0)
          Debug "  //PBSH_Highlight['"+Keyword$+"'] = '"+String$+"';"
        Else
          Debug "  PBSH_Highlight['"+Keyword$+"'] = '"+String$+"';"
        EndIf
      EndIf  
    Until Keyword$ = ""
    ProcedureReturn #True
  EndIf
EndProcedure

If Not Export(GetEnvironmentVariable("APPDATA")+"\PureBasic\PureBasic.prefs")
  PreferencesFileName$ = OpenFileRequester("Preference File", GetHomeDirectory(), "PureBasic.prefs", 0)
  Export(PreferencesFileName$)
EndIf

DataSection
  PreferenceKeys:
  Data.s "EditorFontName", "EditorFontSize", "EditorFontStyle", "BackgroundColor", "NormalTextColor"
  Data.s "BasicKeywordColor", "CommentColor", "ConstantColor", "StringColor", "PureKeywordColor"
  Data.s "ASMKeywordColor", "PointerColor", "NumberColor", "StructureColor", "LabelColor", "ModuleColor"
  Data.s "OperatorColor", "SeparatorColor", "CustomKeywordColor", ""
EndDataSection
The contents of the debugger then just copy in the user script, the place between:
// ==PureBasicPreference==

// ==/PureBasicPreference==
Last edited by STARGÅTE on Thu Jun 03, 2021 5:38 pm, edited 4 times in total.
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and moreTypeface - Sprite-based font include/module
Suirad
User
User
Posts: 42
Joined: Sun Sep 20, 2009 7:37 pm
Location: Melbourne, Florida, USA

Re: UserScript • PB-SyntaxHighlighting for codes in the forum

Post by Suirad »

this looks great, anyone have a quick html code example for using this?
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: UserScript • PB-SyntaxHighlighting for codes in the forum

Post by ts-soft »

Suirad wrote:this looks great, anyone have a quick html code example for using this?
You can use this script for example with greasemonkey-plugin for firefox.
https://addons.mozilla.org/firefox/addon/748
Suirad
User
User
Posts: 42
Joined: Sun Sep 20, 2009 7:37 pm
Location: Melbourne, Florida, USA

Re: UserScript • PB-SyntaxHighlighting for codes in the forum

Post by Suirad »

ts-soft wrote:
Suirad wrote:this looks great, anyone have a quick html code example for using this?
You can use this script for example with greasemonkey-plugin for firefox.
https://addons.mozilla.org/firefox/addon/748
i was looking for more of an example html page that uses it
User avatar
Vera
Addict
Addict
Posts: 858
Joined: Tue Aug 11, 2009 1:56 pm
Location: Essen (Germany)

Re: UserScript • PB-SyntaxHighlighting for codes in the forum

Post by Vera »

Suirad wrote:i was looking for more of an example html page that uses it
Your wish is command :wink:

Save code as any.html and have a look (but don't get irritated by my RetroStyle)

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-gb" xml:lang="en-gb">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta http-equiv="content-language" content="en-gb" />
<meta http-equiv="content-style-type" content="text/css" />
<meta http-equiv="imagetoolbar" content="no" />
<meta name="resource-type" content="document" />
<meta name="distribution" content="global" />
<meta name="copyright" content="2000, 2002, 2005, 2007 phpBB Group" />
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<title>PureBasic Forum &bull; View topic - Autocomplete for Comboboxgadget - Simple version</title>
<link rel="stylesheet" href="./style.php?sid=00510aa568832e6ef7e067ada84996fd&id=4&lang=en" type="text/css" />
<script type="text/javascript">
// <![CDATA[
	if (0)
	{
		popup('./ucp.php?i=pm&mode=popup', 400, 225, '_phpbbprivmsg');
	}

function popup(url, width, height, name)
{
	if (!name)
	{
		name = '_popup';
	}
	window.open(url.replace(/&/g, '&'), name, 'height=' + height + ',resizable=yes,scrollbars=yes,width=' + width);
	return false;
}

function jumpto()
{
	var page = prompt('Enter the page number you wish to go to:', '1');
	var per_page = '';
	var base_url = '';

	if (page !== null && !isNaN(page) && page == Math.floor(page) && page > 0)
	{
		if (base_url.indexOf('?') == -1)
		{
			document.location.href = base_url + '?start=' + ((page - 1) * per_page);
		}
		else
		{
			document.location.href = base_url.replace(/&/g, '&') + '&start=' + ((page - 1) * per_page);
		}
	}
}

/**
* Find a member
*/
function find_username(url)
{
	popup(url, 760, 570, '_usersearch');
	return false;
}

/**
* Mark/unmark checklist
* id = ID of parent container, name = name prefix, state = state [true/false]
*/
function marklist(id, name, state)
{
	var parent = document.getElementById(id);
	if (!parent)
	{
		eval('parent = document.' + id);
	}

	if (!parent)
	{
		return;
	}

	var rb = parent.getElementsByTagName('input');
	
	for (var r = 0; r < rb.length; r++)
	{
		if (rb[r].name.substr(0, name.length) == name)
		{
			rb[r].checked = state;
		}
	}
}


// ]]>

</script>
</head>
<body class="ltr">
<a name="top"></a>

<div id="wrapmain">

	<div id="wrapheader">

		<div id="logodesc">
			<table width="100%" cellspacing="0">
			<tr>
				<td><a href="./index.php"><img src="./styles/subsilverPlus/imageset/purebasic_logo.png" alt="" title="" /></a></td>

				<td width="100%" align="center"><h1>PureBasic Forum</h1><span class="gen"><a href="http://www.purebasic.com">PureBasic web site</a><br><a href="http://blog.purebasic.com">PureBasic blog page</a></span></td>
			</tr>
			</table>
		</div><!-- / logodesc -->

		<div id="menubar">
			<table width="100%" cellspacing="0">
			<tr>

				<td class="genmed">
					<a href="./faq.php"><img src="./styles/subsilverPlus/theme/images/icon_mini_faq.gif" width="12" height="13" alt="*" /> FAQ</a>
					 &nbsp;<a href="./search.php"><img src="./styles/subsilverPlus/theme/images/icon_mini_search.gif" width="12" height="13" alt="*" /> Search</a> &nbsp;<a href="./memberlist.php"><img src="./styles/subsilverPlus/theme/images/icon_mini_members.gif" width="12" height="13" alt="*" /> Members</a> &nbsp;<a href="./ucp.php"><img src="./styles/subsilverPlus/theme/images/icon_mini_profile.gif" width="12" height="13" alt="*" /> User Control Panel</a>				</td>

				<td class="genmed" align="right">
					 &nbsp;<a href="./ucp.php?i=pm&folder=inbox"><img src="./styles/subsilverPlus/theme/images/icon_mini_message.gif" width="12" height="13" alt="*" /> <strong>0</strong> new messages</a> &nbsp;<a href="./ucp.php?mode=logout&sid=00510aa568832e6ef7e067ada84996fd"><img src="./styles/subsilverPlus/theme/images/icon_mini_login.gif" width="12" height="13" alt="*" /> Logout [ Vera ]</a>&nbsp;				</td>
			</tr>
			</table>
		</div><!-- / menubar -->

		<div id="datebar">
			<table width="100%" cellspacing="0">
			<tr>
				<td class="gensmall">Last visit was: 02.11.09  18h39</td>
				<td class="gensmall" align="right">It is currently 10.11.09  1h20<br /></td>
			</tr>
			</table>

		</div>

	</div><!-- / wrapheader -->

	<div id="wrapcentre">
				<p class="searchbar">
			<span style="float: left;"><a href="./search.php?search_id=unanswered">View unanswered posts</a> | <a href="./search.php?search_id=active_topics">View active topics</a></span>
						<span style="float: right;"><a href="./search.php?search_id=newposts">View new posts</a> | <a href="./search.php?search_id=egosearch">View your posts</a></span>

					</p>
		
		<br style="clear: both;" />
		<table class="tablebg" width="100%" cellspacing="1" cellpadding="0" style="margin-top: 5px;">
	<tr>
		<td class="row1">
			<p class="breadcrumbs"><a href="./index.php">Board index</a> &#187; <a href="./viewforum.php?f=29">PureBasic</a> &#187; <a href="./viewforum.php?f=12">Tricks 'n' Tips</a></p>

			<p class="datetime">All times are UTC + 1 hour [ <abbr title="Daylight Saving Time">DST</abbr> ]</p>
		</td>
	</tr>
	</table>		<br />
<div id="pageheader">
	<h2><a class="titles" href="./viewtopic.php?f=12&t=39844&start=0">Autocomplete for Comboboxgadget - Simple version</a></h2>

</div>

<br clear="all" /><br />

<div id="pagecontent">

	<table width="100%" cellspacing="1">
	<tr>
		<td align="left" valign="middle" nowrap="nowrap">
		<a href="./posting.php?mode=post&f=12"><img src="./styles/subsilverPlus/imageset/en/button_topic_new.gif" alt="Post new topic" title="Post new topic" /></a>&nbsp;<a href="./posting.php?mode=reply&f=12&t=39844"><img src="./styles/subsilverPlus/imageset/en/button_topic_reply.gif" alt="Reply to topic" title="Reply to topic" /></a>		</td>
					<td class="nav" valign="middle" nowrap="nowrap">&nbsp;Page <strong>1</strong> of <strong>1</strong><br /></td>

			<td class="gensmall" nowrap="nowrap">&nbsp;[ 1 post ]&nbsp;</td>
			<td class="gensmall" width="100%" align="right" nowrap="nowrap"></td>
			</tr>
	</table>

	<table class="tablebg" width="100%" cellspacing="1">
	<tr>
		<td class="cat">
			<table width="100%" cellspacing="0">

			<tr>
				<td class="nav" nowrap="nowrap">&nbsp;
				<a href="./viewtopic.php?uid=4751&f=12&t=39844&watch=topic&start=0&hash=85fae2e2" title="Subscribe topic">Subscribe topic</a> | <a href="./viewtopic.php?f=12&t=39844&start=0&bookmark=1&hash=85fae2e2" title="Bookmark topic">Bookmark topic</a> | <a href="./viewtopic.php?f=12&t=39844&start=0&view=print" title="Print view">Print view</a> | <a href="./memberlist.php?mode=email&t=39844" title="E-mail friend">E-mail friend</a>				</td>

				<td class="nav" align="right" nowrap="nowrap"><a href="./viewtopic.php?f=12&t=39844&view=previous">Previous topic</a> | <a href="#unread">First unread post</a> | <a href="./viewtopic.php?f=12&t=39844&view=next">Next topic</a>&nbsp;</td>
			</tr>
			</table>
		</td>
	</tr>

	</table>

	<table class="tablebg" width="100%" cellspacing="1">
			<tr>
			<th>Author</th>
			<th>Message</th>
		</tr>
	<tr class="row1">

			<td align="center" valign="middle">
				<a name="unread"></a><a name="p305406"></a>
				<b class="postauthor">mesozorn</b>
			</td>
			<td width="100%" height="25">
				<table width="100%" cellspacing="0">
				<tr>
									<td class="gensmall" width="100%"><div style="float: left;">&nbsp;<b>Post subject:</b> Autocomplete for Comboboxgadget - Simple version</div><div style="float: right;"><a href="./viewtopic.php?p=305406#p305406"><img src="./styles/subsilverPlus/imageset/icon_post_target_unread.gif" width="12" height="9" alt="New post" title="New post" /></a><b>Posted:</b> 08.11.09  4h24&nbsp;</div></td>

				</tr>
				</table>
			</td>
		</tr>
		
		<tr class="row1">
			<td valign="top" class="profile">
				<table cellspacing="4" align="center" width="150">
							<tr>
					<td><img src="./styles/subsilverPlus/imageset/en/icon_user_offline.gif" alt="Offline" title="Offline" /></td>

				</tr>
							<tr>
					<td class="postdetails">User</td>
				</tr>
							<tr>
					<td><img src="./images/ranks/chip_ranks_1.gif" alt="User" title="User" /></td>
				</tr>
							</table>

				<span class="postdetails">
					<br /><b>Joined:</b> 20.02.09  3h23<br /><b>Posts:</b> 65				</span>

			</td>
			<td valign="top">
				<table width="100%" cellspacing="5">

				<tr>
					<td>
					
						<div class="postbody">I have seen other autocomplete routines posted which are very good indeed. This is mine which is very short and very simple:<br /><br /><div class="codetitle"><b>Code:</b></div><div class="codecontent">Structure comboboxinfo<br />&nbsp; cbSize.l<br />&nbsp; rcItem.RECT<br />&nbsp; rcButton.RECT<br />&nbsp; stateButton.l<br />&nbsp; hwndCombo.l<br />&nbsp; hwndEdit.l<br />&nbsp; hwndList.l<br />EndStructure<br /><br />cbinfo.comboboxinfo<br /><br /><br />OpenWindow(0, 0, 0, 270, 140, "ComboBoxGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)<br />&nbsp; ComboBoxGadget(0, 10, 10, 250, 21, #PB_ComboBox_Editable)<br />&nbsp; AddGadgetItem(0, -1, "Adams")<br />&nbsp; AddGadgetItem(0, -1, "Franklin")<br />&nbsp; AddGadgetItem(0, -1, "Jefferson")<br />&nbsp; AddGadgetItem(0, -1, "Walters")<br />&nbsp; AddGadgetItem(0, -1, "Washington")<br /> SetActiveGadget(0)<br /><br /><br />Repeat<br />&nbsp; W=WaitWindowEvent()<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; <br />&nbsp; If W=#WM_KEYDOWN And&nbsp; GetActiveGadget()=0<br />&nbsp; &nbsp; acg=GetActiveGadget()<br />&nbsp; &nbsp; cbinfo\cbsize=SizeOf(comboboxinfo)<br />&nbsp; &nbsp; GetComboBoxInfo_(GadgetID(acg),@cbinfo)<br />&nbsp; &nbsp; tb=cbinfo.comboboxinfo\hwndedit<br />&nbsp; &nbsp; SendMessage_(tb, #EM_GETSEL, @spos.l, @epos.l) <br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; matchesfound=0&nbsp; <br />&nbsp; &nbsp; &nbsp; For x=0 To CountGadgetItems(acg)-1<br />&nbsp; &nbsp; &nbsp; &nbsp; If LCase(Left(GetGadgetText(acg),spos)+LCase(Chr(EventwParam())))=LCase(Left(GetGadgetItemText(acg,x),spos+1)) And epos=Len(GetGadgetText(acg))<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; matchesfound+1:match=x<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; If matchesfound>1:Break:EndIf<br />&nbsp; &nbsp; &nbsp; &nbsp; EndIf<br />&nbsp; &nbsp; &nbsp; Next x<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; If matchesfound=1&nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ks=GetKeyState_(#VK_SHIFT)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; If ks<2:addchar$=LCase(Chr(EventwParam())):Else:addchar$=UCase(Chr(EventwParam())):EndIf<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SetGadgetText(acg,Left(GetGadgetText(acg),spos)+addchar$+Mid(GetGadgetItemText(acg,match),spos+2))<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SendMessage_(tb, #EM_SETSEL, spos+1, epos+999) <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; PeekMessage_(@msg.MSG, hWnd, #WM_KEYFIRST, #WM_KEYLAST, #PM_REMOVE)<br />&nbsp; &nbsp; &nbsp; EndIf<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; EndIf<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; <br />Until W = #PB_Event_CloseWindow<br /></div><br /><br />It is of course very easy to enhance this so as to be able to add autocomplete functionality to any comboboxgadget created on the fly, without having to go back and edit this source to include each new gadget. I have not added these extra lines to the example above only because it is a fairly obvious enhancement.</div>

					<br clear="all" /><br />
						<table width="100%" cellspacing="0">
						<tr valign="middle">
							<td class="gensmall" align="right">
							<a href="./report.php?f=12&p=305406"><img src="./styles/subsilverPlus/imageset/en/icon_post_report.gif" alt="Report this post" title="Report this post" /></a> 							</td>
						</tr>
						</table>
					</td>

				</tr>
				</table>
			</td>
		</tr>

		<tr class="row1">
			<td class="profile"><strong><a href="#wrapheader" class="back_top">Top</a></strong></td>
			<td><div class="gensmall" style="float: left;">&nbsp;<a href="./memberlist.php?mode=viewprofile&u=4480"><img src="./styles/subsilverPlus/imageset/en/icon_user_profile.gif" alt="Profile" title="Profile" /></a> <a href="./ucp.php?i=pm&mode=compose&action=quotepost&p=305406"><img src="./styles/subsilverPlus/imageset/en/icon_contact_pm.gif" alt="Send private message" title="Send private message" /></a> &nbsp;</div> <div class="gensmall" style="float: right;"><a href="./posting.php?mode=quote&f=12&p=305406"><img src="./styles/subsilverPlus/imageset/en/icon_post_quote.gif" alt="Reply with quote" title="Reply with quote" /></a> &nbsp;</div></td>

			</tr>

	<tr>
		<td class="spacer" colspan="2" height="1"><img src="images/spacer.gif" alt="" width="1" height="1" /></td>
	</tr>
	</table>
	<table width="100%" cellspacing="1" class="tablebg">
	<tr align="center">
		<td class="cat"><form name="viewtopic" method="post" action="./viewtopic.php?f=12&t=39844&start=0"><span class="gensmall">Display posts from previous:</span> <select name="st" id="st"><option value="0" selected="selected">All posts</option><option value="1">1 day</option><option value="7">7 days</option><option value="14">2 weeks</option><option value="30">1 month</option><option value="90">3 months</option><option value="180">6 months</option><option value="365">1 year</option></select>&nbsp;<span class="gensmall">Sort by</span> <select name="sk" id="sk"><option value="a">Author</option><option value="t" selected="selected">Post time</option><option value="s">Subject</option></select> <select name="sd" id="sd"><option value="a" selected="selected">Ascending</option><option value="d">Descending</option></select>&nbsp;<input class="btnlite" type="submit" value="Go" name="sort" /></form></td>

	</tr>
	</table>
	
	<table width="100%" cellspacing="1">
	<tr>
		<td align="left" valign="middle" nowrap="nowrap">
		<a href="./posting.php?mode=post&f=12"><img src="./styles/subsilverPlus/imageset/en/button_topic_new.gif" alt="Post new topic" title="Post new topic" /></a>&nbsp;<a href="./posting.php?mode=reply&f=12&t=39844"><img src="./styles/subsilverPlus/imageset/en/button_topic_reply.gif" alt="Reply to topic" title="Reply to topic" /></a>		</td>
					<td class="nav" valign="middle" nowrap="nowrap">&nbsp;Page <strong>1</strong> of <strong>1</strong><br /></td>

			<td class="gensmall" nowrap="nowrap">&nbsp;[ 1 post ]&nbsp;</td>
			<td class="gensmall" width="100%" align="right" nowrap="nowrap"></td>
			</tr>
	</table>

</div>

<div id="pagefooter"></div>

<br clear="all" />

<table class="tablebg" width="100%" cellspacing="1" cellpadding="0" style="margin-top: 5px;">

	<tr>
		<td class="row1">
			<p class="breadcrumbs"><a href="./index.php">Board index</a> &#187; <a href="./viewforum.php?f=29">PureBasic</a> &#187; <a href="./viewforum.php?f=12">Tricks 'n' Tips</a></p>
			<p class="datetime">All times are UTC + 1 hour [ <abbr title="Daylight Saving Time">DST</abbr> ]</p>

		</td>
	</tr>
	</table>	<br clear="all" />

	<table class="tablebg" width="100%" cellspacing="1">
	<tr>
		<td class="cat"><h4>Who is online</h4></td>
	</tr>

	<tr>
		<td class="row1"><p class="gensmall">Users browsing this forum: <a href="./memberlist.php?mode=viewprofile&u=4751">Vera</a> and 0 guests</p></td>
	</tr>
	</table>

<br clear="all" />

<table width="100%" cellspacing="1">
<tr>

	<td width="40%" valign="top" nowrap="nowrap" align="left"></td>
	<td align="right" valign="top" nowrap="nowrap"><span class="gensmall">You <strong>can</strong> post new topics in this forum<br />You <strong>can</strong> reply to topics in this forum<br />You <strong>can</strong> edit your posts in this forum<br />You <strong>can</strong> delete your posts in this forum<br /></span></td>

</tr>
</table>

<br clear="all" />

<table width="100%" cellspacing="0">
<tr>
	<td><form method="post" name="search" action="./search.php?t=39844"><span class="gensmall">Search for:</span> <input class="post" type="text" name="keywords" size="20" /> <input class="btnlite" type="submit" value="Go" /></form></td>
	<td align="right">	<form method="post" name="jumpbox" action="./viewforum.php" onsubmit="if(document.jumpbox.f.value == -1){return false;}">

	<table cellspacing="0" cellpadding="0" border="0">

	<tr>
		<td nowrap="nowrap"><span class="gensmall">Jump to:</span>&nbsp;<select name="f" onchange="if(this.options[this.selectedIndex].value != -1){ document.forms['jumpbox'].submit() }">

					<option value="-1">Select a forum</option>
		<option value="-1">------------------</option>			<option value="29">PureBasic</option>
					<option value="13">&nbsp; &nbsp;Coding Questions</option>

					<option value="16">&nbsp; &nbsp;Game Programming</option>
					<option value="18">&nbsp; &nbsp;The PureBasic Editor</option>
					<option value="22">&nbsp; &nbsp;The Visual Designer</option>
					<option value="7">&nbsp; &nbsp;General Discussion</option>
					<option value="3">&nbsp; &nbsp;Feature Requests and Wishlists</option>

					<option value="12" selected="selected">&nbsp; &nbsp;Tricks 'n' Tips</option>
					<option value="30">Bug Reports</option>
					<option value="4">&nbsp; &nbsp;Bugs - Windows</option>
					<option value="23">&nbsp; &nbsp;Bugs - Linux</option>
					<option value="24">&nbsp; &nbsp;Bugs - Mac OSX</option>

					<option value="31">OS Specific</option>
					<option value="10">&nbsp; &nbsp;AmigaOS</option>
					<option value="15">&nbsp; &nbsp;Linux</option>
					<option value="5">&nbsp; &nbsp;Windows</option>
					<option value="19">&nbsp; &nbsp;Mac OSX</option>

					<option value="32">Miscellaneous</option>
					<option value="14">&nbsp; &nbsp;Announcement</option>
					<option value="17">&nbsp; &nbsp;Off Topic</option>
					<option value="33">Showcase</option>
					<option value="27">&nbsp; &nbsp;Applications - Feedback and Discussion</option>

					<option value="25">&nbsp; &nbsp;PureFORM & JaPBe</option>
					<option value="26">&nbsp; &nbsp;TailBite </option>
		
		</select>&nbsp;<input class="btnlite" type="submit" value="Go" /></td>
	</tr>
	</table>

	</form>
</td>
</tr>
</table>

	</div><!-- / wrapcentre -->
	<!--
		We request you retain the full copyright notice below including the link to www.phpbb.com.
		This not only gives respect to the large amount of time given freely by the developers
		but also helps build interest, traffic and use of phpBB3. If you (honestly) cannot retain
		the full copyright we ask you at least leave in place the "Powered by phpBB" line, with
		"phpBB" linked to www.phpbb.com. If you refuse to include even this then support on our
		forums may be affected.

		The phpBB Group : 2006
	//-->
	
	<!--
		phpBB style name: subsilver+
		Based on style: subsilver2 (this is the default phpBB3 style)
		Author:  Sevdin Filiz ( http://www.canversoft.net/ )
	//-->

<div align=center>
<script type="text/javascript"><!--
google_ad_client = "pub-9400838095205149";
/* 728x90, forum anglais */
google_ad_slot = "3681155193";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">

</script>
<br>&nbsp;<br>
</div>
	
	<div id="wrapfooter">
		<br /><br />		<span class="copyright">Powered by <a href="http://www.phpbb.com/">phpBB</a> &copy; 2008 phpBB Group		<br />subSilver+ theme by <a href="http://www.canversoft.net/" title="kurumsal ve bireysel web çözümleri" target="_blank">Canver Software</a>, sponsor <a href="http://www.sanalmodifiye.com/" title="Sanal Modifiye" target="_blank">Sanal Modifiye</a>

		</span>
	</div>
</div><!-- / wrapmain -->

</body>
</html>
regards ~ Vera
User avatar
STARGÅTE
Addict
Addict
Posts: 2063
Joined: Thu Jan 10, 2008 1:30 pm
Location: Germany, Glienicke
Contact:

Re: UserScript • PB-SyntaxHighlighting for codes in the foru

Post by STARGÅTE »

PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and moreTypeface - Sprite-based font include/module
Zach
Addict
Addict
Posts: 1654
Joined: Sun Dec 12, 2010 12:36 am
Location: Somewhere in the midwest
Contact:

Re: UserScript • PB-SyntaxHighlighting for codes in the foru

Post by Zach »

Definitely a nice/cool idea..

But surely it would have been easier to just write a add-on/hack/plugin for the phpbb software and then everyone can benefit regardless :?:
It's a feature I've seen on many boards before, and removes the burden from the end-user, after all..
Image
User avatar
flaith
Enthusiast
Enthusiast
Posts: 704
Joined: Mon Apr 25, 2005 9:28 pm
Location: $300:20 58 FC 60 - Rennes
Contact:

Re: UserScript • PB-SyntaxHighlighting for codes in the foru

Post by flaith »

Thanks for this great plugin :D
“Fear is a reaction. Courage is a decision.” - WC
IdeasVacuum
Always Here
Always Here
Posts: 6425
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: UserScript • PB-SyntaxHighlighting for codes in the foru

Post by IdeasVacuum »

My tiny brain needs a step-by-step list on how to use this....... :|
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
c4s
Addict
Addict
Posts: 1981
Joined: Thu Nov 01, 2007 5:37 pm
Location: Germany

Re: UserScript • PB-SyntaxHighlighting for codes in the foru

Post by c4s »

IdeasVacuum wrote:My tiny brain needs a step-by-step list on how to use this....... :|
You need e.g. the AddOn GreaseMonkey for Firefox and then just load this as a custom script. See the first post if you want your own color scheme (as it's in your IDE).
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Re: UserScript • PB-SyntaxHighlighting for codes in the foru

Post by gnozal »

c4s wrote:
IdeasVacuum wrote:My tiny brain needs a step-by-step list on how to use this....... :|
You need e.g. the AddOn GreaseMonkey for Firefox and then just load this as a custom script. See the first post if you want your own color scheme (as it's in your IDE).
If you are using Opera, you need nothing.
- Go to : Opera menu > Settings > Preferences > Advanced > Content > JavaScript options
- Select the directory where you will put your User JavaScript files.
  Opera will load all files in the specified directory whose names end with .js and will use them as User JavaScript files.
  If a file name ends with .user.js it will be assumed to use Greasemonkey notation.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: UserScript • PB-SyntaxHighlighting for codes in the foru

Post by ts-soft »

With Firefox, if you have installed Greasemonkey, simple download the file. Firefox will prompt for installation.
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
IdeasVacuum
Always Here
Always Here
Posts: 6425
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: UserScript • PB-SyntaxHighlighting for codes in the foru

Post by IdeasVacuum »

Thanks ts-soft. See, I was confused in the beginning because it sounded like a plugin for the PB IDE, such that one could paste decorated code into a forum post - could not have been further away than that! :mrgreen:

Certainly works well in Firefox.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
skywalk
Addict
Addict
Posts: 3960
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: UserScript • PB-SyntaxHighlighting for codes in the foru

Post by skywalk »

Hey, I have a dumb question...
Is there a way to select the Code portion of a post without having to manually select everything?
I see buttons for this in other forums, just curious why it is not available on a coder's forum?
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
User avatar
STARGÅTE
Addict
Addict
Posts: 2063
Joined: Thu Jan 10, 2008 1:30 pm
Location: Germany, Glienicke
Contact:

Re: UserScript • PB-SyntaxHighlighting for codes in the foru

Post by STARGÅTE »

triple click in the Code-Area (for IE)
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and moreTypeface - Sprite-based font include/module
Post Reply