<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>code UI Component</title><link>https://community.telligent.com/community/12/w/api-documentation/71732/code-ui-component</link><description>Developing on Verint Community? Use the API documentation as a reference for all supported interactions with Verint Community.</description><dc:language>en-US</dc:language><generator>14.0.0.586 14</generator><item><title>code UI Component</title><link>https://community.telligent.com/community/12/w/api-documentation/71732/code-ui-component</link><pubDate>Fri, 15 Jan 2021 21:44:57 GMT</pubDate><guid isPermaLink="false">014f3ab7-6169-4856-853c-80331e9fed0d</guid><dc:creator>Ben Tiedt</dc:creator><comments>https://community.telligent.com/community/12/w/api-documentation/71732/code-ui-component#comments</comments><description>Current Revision posted to API Documentation by Ben Tiedt on 01/15/2021 21:44:57&lt;br /&gt;
&lt;hr class="generated-documentation-start" style="border-width:0;" /&gt;&lt;h3&gt;jQuery.telligent.evolution.ui.components.code&lt;/h3&gt;
&lt;p&gt;[[ui JavaScript API Module|UI Component]] which enables a body of text to be rendered and optionally editable with syntax highlighting supporting a variety of programming languages using [[evolutionCodeEditor jQuery Plugin|evolutionCodeEditor]]. The default implementation uses the [[evolutionCodeEditor jQuery Plugin|evolutionCodeEditor plugin]]. [[ui JavaScript API Module|Overrides can be provided]] at the theme level. When the element is a &lt;code&gt;textarea&lt;/code&gt;, it is automatically made editable, and throttled &lt;code&gt;change&lt;/code&gt; events are raised on the &lt;code&gt;textarea&lt;/code&gt; element, after which its value contains updated content from the syntax highlighter.&lt;/p&gt;
&lt;h3&gt;Options&lt;/h3&gt;
&lt;p&gt;Data made available to instances of the component:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;mode&lt;/code&gt;: Syntax highlighting mode. Options include actionscript, applescript, batchfile, clojure, cobol, coffee, coldfusion, csharp, css, curly, d, dart, diff, dockerfile, erlang, golang, html, java, javascript, json, jsp, latex, less, lisp, lua, makefile, markdown, nix, objectivec, ocaml, pascal, perl, pgsql, php, powershell, praat, python, rhtml, ruby, rust, sass, scala, sql, sqlserver, text, typescript, velocity, xml, xquery, yaml
&lt;ul&gt;
&lt;li&gt;default: &lt;code&gt;text&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;theme&lt;/code&gt;: Highlighting theme. Options include &lt;code&gt;light&lt;/code&gt; and &lt;code&gt;dark&lt;/code&gt;
&lt;ul&gt;
&lt;li&gt;default: &lt;code&gt;light&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;minlines&lt;/code&gt;: When provided, the editor will have a minimum line height
&lt;ul&gt;
&lt;li&gt;default: &lt;code&gt;null&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;maxlines&lt;/code&gt;: When provided, the editor will have a maximum line height. This also triggers auto-resizing, up to maxLines. Scrolling is used beyond maxLines.
&lt;ul&gt;
&lt;li&gt;default: &lt;code&gt;null&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;readonly&lt;/code&gt;: Whether or not the text is made editable.
&lt;ul&gt;
&lt;li&gt;default: &lt;code&gt;false&lt;/code&gt; when the container is a &lt;code&gt;textarea&lt;/code&gt;, &lt;code&gt;true&lt;/code&gt; when it is not (&lt;code&gt;pre&lt;/code&gt; or &lt;code&gt;div&lt;/code&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;gutter&lt;/code&gt;: Whether or not to show line numbers and other left-aligned elements
&lt;ul&gt;
&lt;li&gt;default: &lt;code&gt;true&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;wordwrap&lt;/code&gt;: Whether or not to wrap long lines
&lt;ul&gt;
&lt;li&gt;default: &lt;code&gt;false&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;enablefullscreen&lt;/code&gt;: Whether or not to enable full screen
&lt;ul&gt;
&lt;li&gt;default: &lt;code&gt;true&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;sourcecomparison&lt;/code&gt;: When provided, uses a diff view
&lt;ul&gt;
&lt;li&gt;default: &lt;code&gt;null&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;See also&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;[[evolutionCodeEditor jQuery Plugin|evolutionCodeEditor jQuery Plugin]]&lt;/li&gt;
&lt;li&gt;[[evolutionCodeEditorChange jQuery Event|evolutionCodeEditorChange jQuery Event]]&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Example&lt;/h3&gt;
&lt;h4&gt;Non-editable example using ui-code.&lt;/h4&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;pre class=&amp;quot;ui-code&amp;quot; data-maxlines=&amp;quot;20&amp;quot; data-mode=&amp;quot;javascript&amp;quot; data-theme=&amp;quot;dark&amp;quot;&amp;gt;
function sayHello(name) {
    alert(&amp;#39;Hello, &amp;#39; + name + &amp;#39;!&amp;#39;);
}

sayHello(&amp;#39;Alice&amp;#39;);
&amp;lt;/pre&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;h4&gt;Editable example using ui-code. The &lt;code&gt;textarea&lt;/code&gt; is automatically updated on changes to the editor, and &lt;code&gt;change&lt;/code&gt; events are triggered on the &lt;code&gt;textarea&lt;/code&gt;.&lt;/h4&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;textarea class=&amp;quot;ui-code&amp;quot; data-maxlines=&amp;quot;20&amp;quot; data-mode=&amp;quot;javascript&amp;quot; data-theme=&amp;quot;dark&amp;quot;&amp;gt;
function sayHello(name) {
    alert(&amp;#39;Hello, &amp;#39; + name + &amp;#39;!&amp;#39;);
}

sayHello(&amp;#39;Alice&amp;#39;);
&amp;lt;/textarea&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;h3&gt;Default Implementation&lt;/h3&gt;
&lt;p&gt;For reference purposes or as the basis for an override:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$.telligent.evolution.ui.components.code = {
    setup: function() { },
    add: function(elm, options) {
        var codeOptions = {};

        if(options.mode) {
            codeOptions.mode = options.mode;
        }

        if(options.theme !== undef) {
            codeOptions.theme = options.theme;
        }

        if(options.minlines !== undef) {
            codeOptions.minLines = parseInt(options.minlines, 10)
        }

        if(options.maxlines !== undef) {
            codeOptions.maxLines = parseInt(options.maxlines, 10)
        }

        if(options.readonly) {
            codeOptions.readOnly = options.readonly === &amp;#39;true&amp;#39; ? true : false;
        }

        if(options.gutter) {
            codeOptions.gutter = options.gutter === &amp;#39;true&amp;#39; ? true : false;
        }

        if(options.wordwrap) {
            codeOptions.wordWrap = options.wordwrap === &amp;#39;true&amp;#39; ? true : false;
        }

        if(options.sourcecomparison) {
            codeOptions.sourceComparison = sourceComparison;
        }

        $(elm).evolutionCodeEditor(codeOptions);
    }
};
&lt;/code&gt;&lt;/pre&gt;

&lt;hr class="generated-documentation-end" style="border-width:0;" /&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;
</description></item></channel></rss>