UNPKG

siesta-lite

Version:

Stress-free JavaScript unit testing and functional testing tool, works in NodeJS and browsers

74 lines (60 loc) 2.19 kB
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>The source code</title> <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" /> <script type="text/javascript" src="../resources/prettify/prettify.js"></script> <style type="text/css"> .highlight { display: block; background-color: #ddd; } </style> <script type="text/javascript"> function highlight() { document.getElementById(location.hash.replace(/#/, "")).className = "highlight"; } </script> </head> <body onload="prettyPrint(); highlight();"> <pre class="prettyprint lang-js">/* Siesta 5.6.1 Copyright(c) 2009-2022 Bryntum AB https://bryntum.com/contact https://bryntum.com/products/siesta/license */ Ext.define(&#39;Siesta.Project.Browser.UI.SourcePanel&#39;, { extend : &#39;Ext.Panel&#39;, alias : &#39;widget.sourcepanel&#39;, __filled__ : false, autoScroll : true, cls : &#39;test-source-ct&#39;, layout : &#39;absolute&#39;, border : false, bodyBorder : false, setSource : function (source, linesToHighlight) { var sourceCtEl = this.el; if (!this.__filled__) { this.__filled__ = true; this.update( Ext.String.format(&#39;&lt;pre class=&quot;brush: javascript;&quot;&gt;{0}&lt;/pre&gt;&#39;, source) ); // Disable the double click handling, which removes the code coloring SyntaxHighlighter.defaults[&#39;quick-code&#39;] = false; SyntaxHighlighter.highlight(sourceCtEl); } sourceCtEl.select(&#39;.highlighted&#39;).removeCls(&#39;highlighted&#39;); // Highlight rows Ext.Array.each(linesToHighlight, function (line) { sourceCtEl.select(&#39;.line.number&#39; + line).addCls(&#39;highlighted&#39;); }); if (linesToHighlight.length &gt; 0) { var el = sourceCtEl.down(&#39;.highlighted&#39;); el &amp;&amp; el.scrollIntoView(sourceCtEl); } }, clear : function () { this.__filled__ = false; } }); </pre> </body> </html>