It is currently Sun May 19, 2013 8:07 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 25 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: UserScript • PB-SyntaxHighlighting for codes in the forum
PostPosted: Tue Oct 13, 2009 5:46 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Thu Jan 10, 2008 1:30 pm
Posts: 711
Location: Germany, Glienicke
To make the code easier to read here in the forum, without copying the code in PureBasic,
I put a user script available

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

Example code:
Code:
#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 Duch direct change in the user script in the range // == PureBasicPreference ==
or just to get this program:
Code:
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 Not 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"
  Data.s "OperatorColor", "SeparatorColor", ""
EndDataSection


The contents of the debugger then just copy in the user script, the place between:
Quote:
// ==PureBasicPreference==

// ==/PureBasicPreference==

_________________
Image


Last edited by STARGÅTE on Wed Feb 16, 2011 8:19 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: UserScript • PB-SyntaxHighlighting for codes in the forum
PostPosted: Mon Nov 09, 2009 11:27 pm 
Offline
User
User

Joined: Sun Sep 20, 2009 7:37 pm
Posts: 36
Location: Melbourne, Florida, USA
this looks great, anyone have a quick html code example for using this?


Top
 Profile  
 
 Post subject: Re: UserScript • PB-SyntaxHighlighting for codes in the forum
PostPosted: Mon Nov 09, 2009 11:33 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 24, 2004 2:44 pm
Posts: 4715
Location: Berlin - Germany
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


Top
 Profile  
 
 Post subject: Re: UserScript • PB-SyntaxHighlighting for codes in the forum
PostPosted: Mon Nov 09, 2009 11:40 pm 
Offline
User
User

Joined: Sun Sep 20, 2009 7:37 pm
Posts: 36
Location: Melbourne, Florida, USA
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


Top
 Profile  
 
 Post subject: Re: UserScript • PB-SyntaxHighlighting for codes in the forum
PostPosted: Tue Nov 10, 2009 12:24 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Tue Aug 11, 2009 1:56 pm
Posts: 517
Location: Essen (Germany)
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:
<!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&amp;id=4&amp;lang=en" type="text/css" />
<script type="text/javascript">
// <![CDATA[
   if (0)
   {
      popup('./ucp.php?i=pm&amp;mode=popup', 400, 225, '_phpbbprivmsg');
   }

function popup(url, width, height, name)
{
   if (!name)
   {
      name = '_popup';
   }
   window.open(url.replace(/&amp;/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(/&amp;/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&amp;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&amp;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&amp;t=39844&amp;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&amp;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&amp;f=12&amp;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&amp;f=12&amp;t=39844&amp;watch=topic&amp;start=0&amp;hash=85fae2e2" title="Subscribe topic">Subscribe topic</a> | <a href="./viewtopic.php?f=12&amp;t=39844&amp;start=0&amp;bookmark=1&amp;hash=85fae2e2" title="Bookmark topic">Bookmark topic</a> | <a href="./viewtopic.php?f=12&amp;t=39844&amp;start=0&amp;view=print" title="Print view">Print view</a> | <a href="./memberlist.php?mode=email&amp;t=39844" title="E-mail friend">E-mail friend</a>            </td>

            <td class="nav" align="right" nowrap="nowrap"><a href="./viewtopic.php?f=12&amp;t=39844&amp;view=previous">Previous topic</a> | <a href="#unread">First unread post</a> | <a href="./viewtopic.php?f=12&amp;t=39844&amp;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, &quot;ComboBoxGadget&quot;, #PB_Window_SystemMenu | #PB_Window_ScreenCentered)<br />&nbsp; ComboBoxGadget(0, 10, 10, 250, 21, #PB_ComboBox_Editable)<br />&nbsp; AddGadgetItem(0, -1, &quot;Adams&quot;)<br />&nbsp; AddGadgetItem(0, -1, &quot;Franklin&quot;)<br />&nbsp; AddGadgetItem(0, -1, &quot;Jefferson&quot;)<br />&nbsp; AddGadgetItem(0, -1, &quot;Walters&quot;)<br />&nbsp; AddGadgetItem(0, -1, &quot;Washington&quot;)<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&gt;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&lt;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&amp;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&amp;u=4480"><img src="./styles/subsilverPlus/imageset/en/icon_user_profile.gif" alt="Profile" title="Profile" /></a> <a href="./ucp.php?i=pm&amp;mode=compose&amp;action=quotepost&amp;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&amp;f=12&amp;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&amp;t=39844&amp;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&amp;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&amp;f=12&amp;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&amp;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 &amp; 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

_________________
Day is Done [Nick Drake] ~ Every Colour You Are [D.Sylvian & R.Fripp]


Top
 Profile  
 
 Post subject: Re: UserScript • PB-SyntaxHighlighting for codes in the foru
PostPosted: Wed Feb 16, 2011 8:22 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Thu Jan 10, 2008 1:30 pm
Posts: 711
Location: Germany, Glienicke
Update:

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

details in the first post

_________________
Image


Top
 Profile  
 
 Post subject: Re: UserScript • PB-SyntaxHighlighting for codes in the foru
PostPosted: Mon Feb 21, 2011 11:02 pm 
Offline
Addict
Addict

Joined: Sun Dec 12, 2010 12:36 am
Posts: 1284
Location: Waterloo, WI - USA
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


Top
 Profile  
 
 Post subject: Re: UserScript • PB-SyntaxHighlighting for codes in the foru
PostPosted: Tue Feb 22, 2011 11:19 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Mon Apr 25, 2005 9:28 pm
Posts: 550
Location: $300:20 58 FC 60 - Vietnam
Thanks for this great plugin :D

_________________
“Fear is a reaction. Courage is a decision.” - WC


Top
 Profile  
 
 Post subject: Re: UserScript • PB-SyntaxHighlighting for codes in the foru
PostPosted: Tue Feb 22, 2011 1:06 pm 
Offline
Addict
Addict

Joined: Fri Oct 23, 2009 2:33 am
Posts: 2852
Location: Wales, UK
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.


Top
 Profile  
 
 Post subject: Re: UserScript • PB-SyntaxHighlighting for codes in the foru
PostPosted: Tue Feb 22, 2011 1:25 pm 
Offline
Addict
Addict

Joined: Thu Nov 01, 2007 5:37 pm
Posts: 1561
Location: Germany
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).


Top
 Profile  
 
 Post subject: Re: UserScript • PB-SyntaxHighlighting for codes in the foru
PostPosted: Tue Feb 22, 2011 5:08 pm 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4231
Location: Strasbourg / France
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).


Top
 Profile  
 
 Post subject: Re: UserScript • PB-SyntaxHighlighting for codes in the foru
PostPosted: Tue Feb 22, 2011 5:10 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 24, 2004 2:44 pm
Posts: 4715
Location: Berlin - Germany
With Firefox, if you have installed Greasemonkey, simple download the file. Firefox will prompt for installation.

_________________
PureBasic 5.11 | Windows 7 SP1 (x64) | Linux Mint 14 (x64) | RealSource

The use of EnableExplicit is free of charge and avoids errors.


Top
 Profile  
 
 Post subject: Re: UserScript • PB-SyntaxHighlighting for codes in the foru
PostPosted: Tue Feb 22, 2011 6:38 pm 
Offline
Addict
Addict

Joined: Fri Oct 23, 2009 2:33 am
Posts: 2852
Location: Wales, UK
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.


Top
 Profile  
 
 Post subject: Re: UserScript • PB-SyntaxHighlighting for codes in the foru
PostPosted: Tue Feb 22, 2011 6:45 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Dec 23, 2009 10:14 pm
Posts: 1382
Location: Boston, MA
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?

_________________
To understand recursion, you must first understand recursion. ~ unknown
I never make stupid mistakes. Only very, very clever ones. ~ John Peel


Top
 Profile  
 
 Post subject: Re: UserScript • PB-SyntaxHighlighting for codes in the foru
PostPosted: Tue Feb 22, 2011 6:48 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Thu Jan 10, 2008 1:30 pm
Posts: 711
Location: Germany, Glienicke
triple click in the Code-Area (for IE)

_________________
Image


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 25 posts ]  Go to page 1, 2  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye