UNPKG

maiaeditor

Version:

MaiaEditor (The MaiaStudio Editor) MaiaScript is a programming language aimed at developing adaptable and intelligent applications.

4,655 lines (1,039 loc) 44.4 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JSDoc: Class: MaiaEditor</title> <script src="scripts/prettify/prettify.js"> </script> <script src="scripts/prettify/lang-css.js"> </script> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css"> <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css"> </head> <body> <div id="main"> <h1 class="page-title">Class: MaiaEditor</h1> <section> <header> <h2><span class="attribs"><span class="type-signature"></span></span>MaiaEditor<span class="signature">(container, language, options)</span><span class="type-signature"> &rarr; {object}</span></h2> </header> <article> <div class="container-overview"> <h4 class="name" id="MaiaEditor"><span class="type-signature"></span>new MaiaEditor<span class="signature">(container, language, options)</span><span class="type-signature"> &rarr; {object}</span></h4> <div class="description"> MaiaScript code editor. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>container</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">HTML element to setup as an editor.</td> </tr> <tr> <td class="name"><code>language</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">Programming language to highlight the syntax.</td> </tr> <tr> <td class="name"><code>options</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="description last">Object containing options for configuring the editor.</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="MaiaEditor.js.html">MaiaEditor.js</a>, <a href="MaiaEditor.js.html#line34">line 34</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> Element configured as source code editor. </div> <dl> <dt> Type </dt> <dd> <span class="param-type">object</span> </dd> </dl> </div> <h3 class="subsection-title">Methods</h3> <h4 class="name" id="appendText"><span class="type-signature"></span>appendText<span class="signature">(text)</span><span class="type-signature"></span></h4> <div class="description"> Appends text in terminal. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>text</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">Text to be set in the terminal.</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="MaiaEditor.js.html">MaiaEditor.js</a>, <a href="MaiaEditor.js.html#line237">line 237</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> The text is appended to terminal. </div> <h4 class="name" id="commentSelection"><span class="type-signature"></span>commentSelection<span class="signature">(element)</span><span class="type-signature"></span></h4> <div class="description"> Comments the selected text. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>element</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="description last">Element where the selection is.</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="MaiaEditor.js.html">MaiaEditor.js</a>, <a href="MaiaEditor.js.html#line609">line 609</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> The selected text commented. </div> <h4 class="name" id="copySelection"><span class="type-signature"></span>copySelection<span class="signature">()</span><span class="type-signature"></span></h4> <div class="description"> Copy the selected text to clipboard. </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="MaiaEditor.js.html">MaiaEditor.js</a>, <a href="MaiaEditor.js.html#line656">line 656</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> The selected text copied to clipboard. </div> <h4 class="name" id="cutSelection"><span class="type-signature"></span>cutSelection<span class="signature">()</span><span class="type-signature"></span></h4> <div class="description"> Cut the selected text from clipboard. </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="MaiaEditor.js.html">MaiaEditor.js</a>, <a href="MaiaEditor.js.html#line669">line 669</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> The selected text cuted from clipboard. </div> <h4 class="name" id="getCursorPosition"><span class="type-signature"></span>getCursorPosition<span class="signature">()</span><span class="type-signature"> &rarr; {number}</span></h4> <div class="description"> Gets the current position of the cursor. </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="MaiaEditor.js.html">MaiaEditor.js</a>, <a href="MaiaEditor.js.html#line357">line 357</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> The current position of the cursor. </div> <dl> <dt> Type </dt> <dd> <span class="param-type">number</span> </dd> </dl> <h4 class="name" id="getEditorHistoryLength"><span class="type-signature"></span>getEditorHistoryLength<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4> <div class="description"> Gets the editor's text. </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="MaiaEditor.js.html">MaiaEditor.js</a>, <a href="MaiaEditor.js.html#line105">line 105</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> The text in the editor. </div> <dl> <dt> Type </dt> <dd> <span class="param-type">string</span> </dd> </dl> <h4 class="name" id="getHtml"><span class="type-signature"></span>getHtml<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4> <div class="description"> Gets the editor's text. </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="MaiaEditor.js.html">MaiaEditor.js</a>, <a href="MaiaEditor.js.html#line130">line 130</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> The text in the editor. </div> <dl> <dt> Type </dt> <dd> <span class="param-type">string</span> </dd> </dl> <h4 class="name" id="getIndicesOf"><span class="type-signature"></span>getIndicesOf<span class="signature">(pattern, text, caseSensitive)</span><span class="type-signature"> &rarr; {object}</span></h4> <div class="description"> Gets the indexes of all occurrences of a pattern in text. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>pattern</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">Search pattern.</td> </tr> <tr> <td class="name"><code>text</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">Text where to look for the pattern.</td> </tr> <tr> <td class="name"><code>caseSensitive</code></td> <td class="type"> <span class="param-type">boolear</span> </td> <td class="description last">True if case sensitive. False, otherwise.</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="MaiaEditor.js.html">MaiaEditor.js</a>, <a href="MaiaEditor.js.html#line281">line 281</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> All occurrences of a pattern in text. </div> <dl> <dt> Type </dt> <dd> <span class="param-type">object</span> </dd> </dl> <h4 class="name" id="getSelectedText"><span class="type-signature"></span>getSelectedText<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4> <div class="description"> Returns the selected text. </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="MaiaEditor.js.html">MaiaEditor.js</a>, <a href="MaiaEditor.js.html#line539">line 539</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> The selected text. </div> <dl> <dt> Type </dt> <dd> <span class="param-type">string</span> </dd> </dl> <h4 class="name" id="getText"><span class="type-signature"></span>getText<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4> <div class="description"> Gets the editor's text. </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="MaiaEditor.js.html">MaiaEditor.js</a>, <a href="MaiaEditor.js.html#line122">line 122</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> The text in the editor. </div> <dl> <dt> Type </dt> <dd> <span class="param-type">string</span> </dd> </dl> <h4 class="name" id="getTextAfterCursor"><span class="type-signature"></span>getTextAfterCursor<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4> <div class="description"> Gets the text of the line after the cursor. </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="MaiaEditor.js.html">MaiaEditor.js</a>, <a href="MaiaEditor.js.html#line189">line 189</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> The text of the line where the cursor is. </div> <dl> <dt> Type </dt> <dd> <span class="param-type">string</span> </dd> </dl> <h4 class="name" id="getTextAtCursor"><span class="type-signature"></span>getTextAtCursor<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4> <div class="description"> Gets the text of the line where the cursor is. </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="MaiaEditor.js.html">MaiaEditor.js</a>, <a href="MaiaEditor.js.html#line216">line 216</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> The text of the line where the cursor is. </div> <dl> <dt> Type </dt> <dd> <span class="param-type">string</span> </dd> </dl> <h4 class="name" id="getTextBeforeCursor"><span class="type-signature"></span>getTextBeforeCursor<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4> <div class="description"> Gets the text of the line before the cursor. </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="MaiaEditor.js.html">MaiaEditor.js</a>, <a href="MaiaEditor.js.html#line157">line 157</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> The text of the line where the cursor is. </div> <dl> <dt> Type </dt> <dd> <span class="param-type">string</span> </dd> </dl> <h4 class="name" id="highlightCode"><span class="type-signature"></span>highlightCode<span class="signature">(element)</span><span class="type-signature"></span></h4> <div class="description"> Highlights the code syntax in the editor. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>element</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="description last">Element to do code syntax highlighte.</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="MaiaEditor.js.html">MaiaEditor.js</a>, <a href="MaiaEditor.js.html#line456">line 456</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> The content of the editor is Highlighted. </div> <h4 class="name" id="indentSelection"><span class="type-signature"></span>indentSelection<span class="signature">(element)</span><span class="type-signature"></span></h4> <div class="description"> Indents the selected text. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>element</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="description last">Element where the selection is.</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="MaiaEditor.js.html">MaiaEditor.js</a>, <a href="MaiaEditor.js.html#line563">line 563</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> The selected text indented. </div> <h4 class="name" id="insertText"><span class="type-signature"></span>insertText<span class="signature">(text)</span><span class="type-signature"></span></h4> <div class="description"> Inserts text in terminal at cursor position. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>text</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">Text to be inserted at cursor position</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="MaiaEditor.js.html">MaiaEditor.js</a>, <a href="MaiaEditor.js.html#line250">line 250</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> The text is inserted at cursor position. </div> <h4 class="name" id="moveCursorToEndOfSelection"><span class="type-signature"></span>moveCursorToEndOfSelection<span class="signature">(editor)</span><span class="type-signature"></span></h4> <div class="description"> Place the cursor after the selected text. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>editor</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="description last">Editor object.</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="MaiaEditor.js.html">MaiaEditor.js</a>, <a href="MaiaEditor.js.html#line226">line 226</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> Place the cursor after the selected text. </div> <h4 class="name" id="pasteSelection"><span class="type-signature"></span>pasteSelection<span class="signature">()</span><span class="type-signature"></span></h4> <div class="description"> Paste the selected text to clipboard. </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="MaiaEditor.js.html">MaiaEditor.js</a>, <a href="MaiaEditor.js.html#line682">line 682</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> The selected text pasted to clipboard. </div> <h4 class="name" id="regSub"><span class="type-signature"></span>regSub<span class="signature">(pattern, text, flags)</span><span class="type-signature"></span></h4> <div class="description"> Replaces text in the editor, based on a regular expression. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>pattern</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">Search pattern (regular expression).</td> </tr> <tr> <td class="name"><code>text</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">Substitute text.</td> </tr> <tr> <td class="name"><code>flags</code></td> <td class="type"> <span class="param-type">boolear</span> </td> <td class="description last">Regular expression flags (g, i, m, u, y).</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="MaiaEditor.js.html">MaiaEditor.js</a>, <a href="MaiaEditor.js.html#line263">line 263</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> Pattern occurrences replaced. </div> <h4 class="name" id="replaceSelectedText"><span class="type-signature"></span>replaceSelectedText<span class="signature">(text)</span><span class="type-signature"></span></h4> <div class="description"> Replaces the selected text with one provided as a parameter. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>text</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">Text provided.</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="MaiaEditor.js.html">MaiaEditor.js</a>, <a href="MaiaEditor.js.html#line549">line 549</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> The selected text replaced. </div> <h4 class="name" id="restoreEditorContent"><span class="type-signature"></span>restoreEditorContent<span class="signature">(element)</span><span class="type-signature"></span></h4> <div class="description"> Restores the editor's previous content. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>element</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="description last">Element where to restore content.</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="MaiaEditor.js.html">MaiaEditor.js</a>, <a href="MaiaEditor.js.html#line502">line 502</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> The editor's previous content is restored. </div> <h4 class="name" id="saveEditorContent"><span class="type-signature"></span>saveEditorContent<span class="signature">(element)</span><span class="type-signature"></span></h4> <div class="description"> Saves the current content of the editor. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>element</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="description last">Element where to save content.</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="MaiaEditor.js.html">MaiaEditor.js</a>, <a href="MaiaEditor.js.html#line485">line 485</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> The current content of the editor is saved. </div> <h4 class="name" id="search"><span class="type-signature"></span>search<span class="signature">(text, caseSensitive)</span><span class="type-signature"></span></h4> <div class="description"> Search and highlight text in the editor. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>text</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">Search pattern.</td> </tr> <tr> <td class="name"><code>caseSensitive</code></td> <td class="type"> <span class="param-type">boolear</span> </td> <td class="description last">True if case sensitive. False, otherwise.</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="MaiaEditor.js.html">MaiaEditor.js</a>, <a href="MaiaEditor.js.html#line309">line 309</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> Pattern occurrence highlighted. </div> <h4 class="name" id="setCursorPosition"><span class="type-signature"></span>setCursorPosition<span class="signature">(position)</span><span class="type-signature"></span></h4> <div class="description"> Sets the cursor position. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>position</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="description last">The cursor position.</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="MaiaEditor.js.html">MaiaEditor.js</a>, <a href="MaiaEditor.js.html#line401">line 401</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> The current position of the cursor is set. </div> <h4 class="name" id="setEditorHistoryLength"><span class="type-signature"></span>setEditorHistoryLength<span class="signature">(length)</span><span class="type-signature"></span></h4> <div class="description"> Sets the editor history length. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>length</code></td> <td class="type"> <span class="param-type">number</span> </td> <td class="description last">Editor history length.</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="MaiaEditor.js.html">MaiaEditor.js</a>, <a href="MaiaEditor.js.html#line114">line 114</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> Sets the editor history length. </div> <h4 class="name" id="setHtml"><span class="type-signature"></span>setHtml<span class="signature">(html)</span><span class="type-signature"></span></h4> <div class="description"> Sets the editor inner HTML. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>html</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">Editor inner HTML.</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="MaiaEditor.js.html">MaiaEditor.js</a>, <a href="MaiaEditor.js.html#line139">line 139</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> Sets the editor inner HTML. </div> <h4 class="name" id="setText"><span class="type-signature"></span>setText<span class="signature">(text)</span><span class="type-signature"></span></h4> <div class="description"> Sets the editor's text. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>text</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">Text to be set in the editor.</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="MaiaEditor.js.html">MaiaEditor.js</a>, <a href="MaiaEditor.js.html#line148">line 148</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> The text in the editor is set. </div> <h4 class="name" id="uncommentSelection"><span class="type-signature"></span>uncommentSelection<span class="signature">(element)</span><span class="type-signature"></span></h4> <div class="description"> Uncomments the selected text. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>element</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="description last">Element where the selection is.</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="MaiaEditor.js.html">MaiaEditor.js</a>, <a href="MaiaEditor.js.html#line633">line 633</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> The selected text uncommented. </div> <h4 class="name" id="undoRestoreEditorContent"><span class="type-signature"></span>undoRestoreEditorContent<span class="signature">(element)</span><span class="type-signature"></span></h4> <div class="description"> Undo previous restores command. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>element</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="description last">Element where to restore content.</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="MaiaEditor.js.html">MaiaEditor.js</a>, <a href="MaiaEditor.js.html#line521">line 521</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> The editor's previous content is restored. </div> <h4 class="name" id="unindentSelection"><span class="type-signature"></span>unindentSelection<span class="signature">(element)</span><span class="type-signature"></span></h4> <div class="description"> Unindents the selected text. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>element</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="description last">Element where the selection is.</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="MaiaEditor.js.html">MaiaEditor.js</a>, <a href="MaiaEditor.js.html#line586">line 586</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> The selected text unindented. </div> <h4 class="name" id="~init"><span class="type-signature">(inner) </span>init<span class="signature">()</span><span class="type-signature"></span></h4> <div class="description"> Creates the attributes of the class. </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="MaiaEditor.js.html">MaiaEditor.js</a>, <a href="MaiaEditor.js.html#line40">line 40</a> </li></ul></dd> </dl> <h4 class="name" id="~visitElement"><span class="type-signature">(inner) </span>visitElement<span class="signature">(editor, visitor)</span><span class="type-signature"> &rarr; {number}</span></h4> <div class="description"> Visits each of the text nodes in an object. </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>editor</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="description last">Editor object.</td> </tr> <tr> <td class="name"><code>visitor</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="description last">Visiting object.</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="MaiaEditor.js.html">MaiaEditor.js</a>, <a href="MaiaEditor.js.html#line333">line 333</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> The current position of the cursor. </div> <dl> <dt> Type </dt> <dd> <span class="param-type">number</span> </dd> </dl> </article> </section> </div> <nav> <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="MaiaEditor.html">MaiaEditor</a></li></ul> </nav> <br class="clear"> <footer> Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.10</a> on Tue Mar 22 2022 12:39:03 GMT+0000 (Coordinated Universal Time) </footer> <script> prettyPrint(); </script> <script src="scripts/linenumber.js"> </script> </body> </html>