CodeHighlight CSModule for CS v2007 RC1

Αρχειοθήκη / Modules No Comments

In order to install the CodeHilight CSModule under Community Server - this CSModule works only with CS v2007 RC1 - in order to download a CS v2007 RTM version of the component get "CodeHighlight CSModule for CS v2007 RTM": :

Step 1:
In communityserver.config, replace the line


	<add name="ForumSourceCode" type="CommunityServer.Discussions.Components.SourceCodeModule, CommunityServer.Discussions" />

with the lines


  <add name="ForumSourceCode" type="CommunityServer.Discussions.Components.SourceCodeModule, CommunityServer.Discussions" enabled="false" />
  <add name="SourceCode" type="CommunityServer.CodeHighlight.CodeHighlighter, CommunityServer.CodeHighlight" />

Step 2:
Add in web.config, just under the <configuration> tag on the top of the file:


    <configSections>
        <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
            <section name="CommunityServer.CodeHighlight.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
        </sectionGroup>
    </configSections>
    <applicationSettings>
        <CommunityServer.CodeHighlight.Properties.Settings>
            <setting name="CodeWrapperHTML" serializeAs="String">
                <value>&lt;pre style="overflow: scroll; background-color: #f2f2f2;"&gt;{0}&lt;/pre&gt;</value>
            </setting>
            <setting name="UseLineNumbers" serializeAs="String">
                <value>False</value>
            </setting>
            <setting name="NumberWrapperHTML" serializeAs="String">
                <value>&lt;table border="0" cellpadding="0" cellspacing="0" style="background-color: #f2f2f2; border: solid 1px #e5e5e5; width: 100%;"&gt;
    &lt;tr style="vertical-align: top; line-height: normal;"&gt;
        &lt;td style="width: 40px; text-align: right;"&gt;
            &lt;pre style="font-family: courier new; font-size: 11px; color: gray; margin: 0px; padding: 2px; border-right: solid 1px #e7e7e7;"&gt;{0}&lt;/pre&gt;&lt;/td&gt;
        &lt;td&gt;
            &lt;pre style="overflow: scroll; margin:0px; padding: 2px; padding-left: 8px;"&gt;{1}&lt;/pre&gt;&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;</value>
            </setting>
        </CommunityServer.CodeHighlight.Properties.Settings>
    </applicationSettings>

Customize your installation:
The HTML code produced is surrounded with the HTML code in CodeWrapperHTML setting, and if the option to include line numbers is included - setting UseLineNumbers - then the HTML code in NumberWrapperHTML is used.

Use of [code][/code] tags:
In order to use the code highlighting in your posts use the tags [code language="C#"][/code] in a post's body. Languages supported: ASPX, C, C++, C#, COBOL, Eiffel, Fortan, Haskell, HTML, Java, Javascript, Mercury, MSIL, Pascal, Perl, PHP, Python, Ruby, SQL, Visual Basic, VBScript, VB.NET, XML. Make sure that the code pasted in your post, has no previous formating - copy the code to notepad first and then to the post's body in order to remove formating.

In order to make the HTML rendering, the CSModule uses the Highlight library of Thomas Johansen and Christian Nordbakk.

You are welcome to feedback,
George J.
george@capnias.org

Διαβάστε περισσότερα →

FreeTextBoxWrapper for Community Server v2.1 series

Αρχειοθήκη / Addins No Comments

First, I would like to thank everyone used this control, during the last six months, their feedback and their suggestions.

This version of the control works under Community Server v2.1 series. The release provides assemblies for both .NET Framework v1.1 and .NET Framework v2.0 versions of Community Server.

I must say there are new features in the control, in order to satisfy the requests I had. The installation is easier now, as except copying the provided files, one should only change CommunityServer.config file in order to get the editor working.

Some screenshots:

  • The new editor layout:

     
  • Inserting code in a post:

     
  • Inserting existing content with Content Selector:

     
  • Inserting an emotion icon in a post:

     
  • Working with the new editor:

     

Where to download:
I do not know the exact link the file will be available, but the file should be available to download in CommunityServer.org Downloads in the Add-ons section.

How to install:
Inside the archive there are folders named with the CS v2.1 release numbers (B1, B2, RC1, RTM, SP1, SP2) as well as a "FreeTextBox3" folder and a "Themes" folder. Inside every release folder there is a .NET Framework v1.1 and a .NET Framework v2.0 folder.

Copy their contents on the corresponding "Bin" folder on community server web site. Also copy the "FreeTextBox3" folder and the "Themes" folder in the root folder of the site. All the files are not replacing any older ones, except the Skin-ContentSelectorModal.ascx in "Themes/Default/Skins" folder.

There is also a CommunityServer.txt file. Copy the 2 lines inside the "editors" section in the "editors" section in CommunityServer.config. There should be only one default editor.

That's It! You're done.

Caution: If you have installed the pre-release version of this control, have in mind that the namespace and the name of the assembly have changed from Telligent.FreeTextBoxWraper to CommunityServer.FreeTextBoxWrapper.

Advanced Installation:
The new control can be further set-up using the control's properties:

  • By default the control is displaying 5 toolbars, but there are 2 more hidden; in order to use them, use the properties showToolbarGeneral="true" and showToolbarTables="true". The second toolbar will be blank, except you are a FreeTextBox Pro user.
  • By default the control enters the emotion icons as bbCode; it uses brackets to surround the smiles. If you wish to enter the images instead of bbCode, you can uncomment the line below in insertemoticons.aspx in FreeTextBox3 folder and comment out the line following it.
    var content = "<img src='"+img.src+"' alt='" + img.alt + "'/>"';
  • In case someone does not like the new Emotion Icon picker menu, he can change back to the old dropdown menu using the property useOldSmilies="true".
  • When using the "insert code snippet" feature, with the "numbered lines" feature, there is a default template in order to produce the output layout. If one needs to change this layout, it can be done be changing the string numberedOutputPattern variable in insertcode.aspx file in FreeTextBox3 folder.
  • By default the control uses a modal dialog to insert code snippets to posts. In case somebody wants to use the functionality provided with the previous version of the control - use a toolbar with the available languages for highlight that instead of highlighting the code, it surrounds it with the [ code ] tags - he can use the property useLanguageToolbar="true". Also in order for this option to work properly, one needs a change in CommunityServer.config; replace the "ForumSourceCode" in "CSModulles" section with:
    <add name="ForumSourceCode" type="CommunityServer.FreeTextBoxWrapper.CodeHighlightingModule, CommunityServer.FreeTextBoxWrapper" />
  • In case someone needs to insert Media Player, Real Player or Flash Movie objects in posts, he can enable the functionality of the FreeTextBxWrapper with the property allowObjectTags="true"; three new buttons will be displayed in the last toolbar. This feature is not tested thoroughly. Don't forget to enable also the object tag in CommunityServer.config file.
  • In case someone needs to modify the existing toolbars - in case there are too many buttons for him - there are the properties toolbarLayout, toolbarEdit, toolbarFormating, toolbarParagraph, toolbarTables, toolbarGeneral - string variables - that can receive the configuration for the toolbars just like described in FreeTextBox Help file for the ToolbarGenerator.ToolbarItemFromString function. An example would be:
    toolbarLayout = "ParagraphMenu,FontFacesMenu,FontSizesMenu,FontForeColorsMenu,FontBackColorsMenu"
    No spaces between the commas are allowed.

There is a tutorial, how to use FreeTextBoxWrapper control to upload images to your site, directly from the FreeTextBoxEditor in my blog entry "Uploading images with FreeTextBoxWrapper control". 

You are welcome to feedback.

 

George J.
 

Διαβάστε περισσότερα →

Code Hightlight plug-in for Windows Live Writer

Αρχειοθήκη / Projects No Comments

Τελευταία ανανέωση: Κυριακή 15 Απριλίου 2007 

Ανάμεσα στα plug-in του Windows Live Writer που υπάρχουν στο Windows Live Gallery, μπορείτε να βρείτε 2-3 plug-ins που προσφέρουν παρόμοια λειτουργικότητα - η διαφορά τους με το Code Hightlight plugin for Windows Live Writer, είναι ότι το δεύτερο μπορεί να προσθέτει τα cascading styles μέσα στα tags σαν style attributes και δεν χρειάζεται να υπάρχει υποστήριξη των style tags μέσα από τον HTML editor για να μπορέσει να χρωματιστεί ο κώδικας.

Το plug για να κάνει το HTML rendering, χρησιμοποιεί την βιβλιοθήκη Highlight των Thomas Johansen και Christian Nordbakk.

Έκδοση 1.2

  • Υποστήριξη νέων γλωσσών. Η έκδοση αυτή υποστηρίζει της γλώσσες: ASPX, C, C++, C#, COBOL, Eiffel, Fortan, Haskell, HTML, Java, Javascript, Mercury, MSIL, Pascal, Perl, PHP, Python, Ruby, SQL, Visual Basic, VBScript, VB.NET, XML.

Έκδοση 1.1

  • Αλλαγές για την σταθεροποίηση του plug-in

Έκδοση 1.0

  • Αρχική έκδοση

Latest refresh: Sunday, April 15, 2007

Among Windows Live Writer  plug-ins in Windows Live Gallery, there are 2-3 plug-ins that offer the same function. Although Code Hightlight plugin for Windows Live Writer obly can add cascading styles in-line with the HTML code as style attributes, in order to support any HTML editor.

In order to make the HTML rendering, the plug-in uses the Highlight library of Thomas Johansen and Christian Nordbakk.

Version 1.2 

  • Added languages to support. Now the following languages are supported: ASPX, C, C++, C#, COBOL, Eiffel, Fortan, Haskell, HTML, Java, Javascript, Mercury, MSIL, Pascal, Perl, PHP, Python, Ruby, SQL, Visual Basic, VBScript, VB.NET, XML.

Version 1.1

  • Minor changes in order to offer better perfomance

Version 1.0

  • Initial release

Διαβάστε περισσότερα →