Notes/docs/frontend_api/RightPanelWidget.html
2024-12-15 10:44:40 +02:00

1796 lines
21 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Class: RightPanelWidget</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: RightPanelWidget</h1>
<section>
<header>
<h2><span class="attribs"><span class="type-signature"></span></span>RightPanelWidget<span class="signature">()</span><span class="type-signature"></span></h2>
<div class="class-description">This widget manages rendering panels in the right-hand pane.</div>
</header>
<article>
<div class="container-overview">
<h2>Constructor</h2>
<h4 class="name" id="RightPanelWidget"><span class="type-signature"></span>new RightPanelWidget<span class="signature">()</span><span class="type-signature"></span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="widgets_right_panel_widget.js.html">widgets/right_panel_widget.js</a>, <a href="widgets_right_panel_widget.js.html#line21">line 21</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Extends</h3>
<ul>
<li><a href="NoteContextAwareWidget.html">NoteContextAwareWidget</a></li>
</ul>
<h3 class="subsection-title">Members</h3>
<h4 class="name" id="hoistedNoteId"><span class="type-signature"></span>hoistedNoteId<span class="type-signature"></span></h4>
<dl class="details">
<dt class="tag-overrides">Overrides:</dt>
<dd class="tag-overrides"><ul class="dummy"><li>
<a href="NoteContextAwareWidget.html#hoistedNoteId">NoteContextAwareWidget#hoistedNoteId</a>
</li></ul></dd>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="widgets_note_context_aware_widget.js.html">widgets/note_context_aware_widget.js</a>, <a href="widgets_note_context_aware_widget.js.html#line42">line 42</a>
</li></ul></dd>
</dl>
<h4 class="name" id="note"><span class="type-signature"></span>note<span class="type-signature"></span></h4>
<dl class="details">
<dt class="tag-overrides">Overrides:</dt>
<dd class="tag-overrides"><ul class="dummy"><li>
<a href="NoteContextAwareWidget.html#note">NoteContextAwareWidget#note</a>
</li></ul></dd>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="widgets_note_context_aware_widget.js.html">widgets/note_context_aware_widget.js</a>, <a href="widgets_note_context_aware_widget.js.html#line27">line 27</a>
</li></ul></dd>
</dl>
<h4 class="name" id="noteContext"><span class="type-signature"></span>noteContext<span class="type-signature"> :NoteContext</span></h4>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">NoteContext</span>
</li>
</ul>
<dl class="details">
<dt class="tag-overrides">Overrides:</dt>
<dd class="tag-overrides"><ul class="dummy"><li>
<a href="NoteContextAwareWidget.html#noteContext">NoteContextAwareWidget#noteContext</a>
</li></ul></dd>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="widgets_note_context_aware_widget.js.html">widgets/note_context_aware_widget.js</a>, <a href="widgets_note_context_aware_widget.js.html#line123">line 123</a>
</li></ul></dd>
</dl>
<h4 class="name" id="noteId"><span class="type-signature"></span>noteId<span class="type-signature"></span></h4>
<dl class="details">
<dt class="tag-overrides">Overrides:</dt>
<dd class="tag-overrides"><ul class="dummy"><li>
<a href="NoteContextAwareWidget.html#noteId">NoteContextAwareWidget#noteId</a>
</li></ul></dd>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="widgets_note_context_aware_widget.js.html">widgets/note_context_aware_widget.js</a>, <a href="widgets_note_context_aware_widget.js.html#line32">line 32</a>
</li></ul></dd>
</dl>
<h4 class="name" id="notePath"><span class="type-signature"></span>notePath<span class="type-signature"></span></h4>
<dl class="details">
<dt class="tag-overrides">Overrides:</dt>
<dd class="tag-overrides"><ul class="dummy"><li>
<a href="NoteContextAwareWidget.html#notePath">NoteContextAwareWidget#notePath</a>
</li></ul></dd>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="widgets_note_context_aware_widget.js.html">widgets/note_context_aware_widget.js</a>, <a href="widgets_note_context_aware_widget.js.html#line37">line 37</a>
</li></ul></dd>
</dl>
<h4 class="name" id="widgetTitle"><span class="type-signature"></span>widgetTitle<span class="type-signature"></span></h4>
<div class="description">
Title to show in the panel.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="widgets_right_panel_widget.js.html">widgets/right_panel_widget.js</a>, <a href="widgets_right_panel_widget.js.html#line23">line 23</a>
</li></ul></dd>
</dl>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id="css"><span class="type-signature"></span>css<span class="signature">(name, value)</span><span class="type-signature"></span></h4>
<div class="description">
Sets the CSS attribute of the given name to the given value.
</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>name</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">the name of the CSS attribute to set (e.g. `padding-left`).</td>
</tr>
<tr>
<td class="name"><code>value</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">the value of the CSS attribute to set (e.g. `12px`).</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-overrides">Overrides:</dt>
<dd class="tag-overrides"><ul class="dummy"><li>
<a href="NoteContextAwareWidget.html#css">NoteContextAwareWidget#css</a>
</li></ul></dd>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="widgets_basic_widget.js.html">widgets/basic_widget.js</a>, <a href="widgets_basic_widget.js.html#line75">line 75</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
self for chaining.
</div>
<h4 class="name" id="cssBlock"><span class="type-signature"></span>cssBlock<span class="signature">(block)</span><span class="type-signature"> &rarr; {this}</span></h4>
<div class="description">
Accepts a string of CSS to add with the widget.
</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>block</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-overrides">Overrides:</dt>
<dd class="tag-overrides"><ul class="dummy"><li>
<a href="NoteContextAwareWidget.html#cssBlock">NoteContextAwareWidget#cssBlock</a>
</li></ul></dd>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="widgets_basic_widget.js.html">widgets/basic_widget.js</a>, <a href="widgets_basic_widget.js.html#line118">line 118</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
for chaining
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">this</span>
</dd>
</dl>
<h4 class="name" id="doRender"><span class="type-signature"></span>doRender<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
Do not override this method unless you know what you're doing.
Do not override this method unless you know what you're doing.
</div>
<dl class="details">
<dt class="tag-overrides">Overrides:</dt>
<dd class="tag-overrides"><ul class="dummy"><li>
<a href="NoteContextAwareWidget.html#doRender">NoteContextAwareWidget#doRender</a>
</li></ul></dd>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="widgets_right_panel_widget.js.html">widgets/right_panel_widget.js</a>, <a href="widgets_right_panel_widget.js.html#line39">line 39</a>
</li></ul></dd>
</dl>
<h4 class="name" id="doRenderBody"><span class="type-signature">(async) </span>doRenderBody<span class="signature">()</span><span class="type-signature"> &rarr; {Promise|undefined}</span></h4>
<div class="description">
Method used for rendering the body of the widget (via existing this.$body)
Your class should override this method.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="widgets_right_panel_widget.js.html">widgets/right_panel_widget.js</a>, <a href="widgets_right_panel_widget.js.html#line70">line 70</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
if widget needs async operation to initialize, it can return a Promise
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise</span>
|
<span class="param-type">undefined</span>
</dd>
</dl>
<h4 class="name" id="isEnabled"><span class="type-signature"></span>isEnabled<span class="signature">()</span><span class="type-signature"> &rarr; {boolean}</span></h4>
<div class="description">
Indicates if the widget is enabled. Widgets are enabled by default. Generally setting this to `false` will cause the widget not to be displayed, however it will still be available on the DOM but hidden.
<p>
If the widget is not enabled, it will not receive `refreshWithNote` updates.
</div>
<dl class="details">
<dt class="tag-overrides">Overrides:</dt>
<dd class="tag-overrides"><ul class="dummy"><li>
<a href="NoteContextAwareWidget.html#isEnabled">NoteContextAwareWidget#isEnabled</a>
</li></ul></dd>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="widgets_note_context_aware_widget.js.html">widgets/note_context_aware_widget.js</a>, <a href="widgets_note_context_aware_widget.js.html#line58">line 58</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
true when an active note exists
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">boolean</span>
</dd>
</dl>
<h4 class="name" id="optChild"><span class="type-signature"></span>optChild<span class="signature">(condition, &hellip;components)</span><span class="type-signature"></span></h4>
<div class="description">
Conditionally adds the given components as children to this component.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>condition</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
</td>
<td class="description last">whether to add the components.</td>
</tr>
<tr>
<td class="name"><code>components</code></td>
<td class="type">
<span class="param-type">any</span>
</td>
<td class="attributes">
&lt;repeatable><br>
</td>
<td class="description last">the components to be added as children to this component provided the condition is truthy.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-overrides">Overrides:</dt>
<dd class="tag-overrides"><ul class="dummy"><li>
<a href="NoteContextAwareWidget.html#optChild">NoteContextAwareWidget#optChild</a>
</li></ul></dd>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="widgets_basic_widget.js.html">widgets/basic_widget.js</a>, <a href="widgets_basic_widget.js.html#line50">line 50</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
self for chaining.
</div>
<h4 class="name" id="optCss"><span class="type-signature"></span>optCss<span class="signature">(condition, name, value)</span><span class="type-signature"></span></h4>
<div class="description">
Sets the CSS attribute of the given name to the given value, but only if the condition provided is truthy.
</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>condition</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="description last">`true` in order to apply the CSS, `false` to ignore it.</td>
</tr>
<tr>
<td class="name"><code>name</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">the name of the CSS attribute to set (e.g. `padding-left`).</td>
</tr>
<tr>
<td class="name"><code>value</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">the value of the CSS attribute to set (e.g. `12px`).</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-overrides">Overrides:</dt>
<dd class="tag-overrides"><ul class="dummy"><li>
<a href="NoteContextAwareWidget.html#optCss">NoteContextAwareWidget#optCss</a>
</li></ul></dd>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="widgets_basic_widget.js.html">widgets/basic_widget.js</a>, <a href="widgets_basic_widget.js.html#line88">line 88</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
self for chaining.
</div>
<h4 class="name" id="refreshWithNote"><span class="type-signature">(async) </span>refreshWithNote<span class="signature">(note)</span><span class="type-signature"> &rarr; {Promise.&lt;void>}</span></h4>
<div class="description">
Override this method to be able to refresh your
widget with each note.
</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>note</code></td>
<td class="type">
<span class="param-type"><a href="FNote.html">FNote</a></span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-overrides">Overrides:</dt>
<dd class="tag-overrides"><ul class="dummy"><li>
<a href="NoteContextAwareWidget.html#refreshWithNote">NoteContextAwareWidget#refreshWithNote</a>
</li></ul></dd>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="widgets_note_context_aware_widget.js.html">widgets/note_context_aware_widget.js</a>, <a href="widgets_note_context_aware_widget.js.html#line88">line 88</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise.&lt;void></span>
</dd>
</dl>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="BasicWidget.html">BasicWidget</a></li><li><a href="FAttachment.html">FAttachment</a></li><li><a href="FAttribute.html">FAttribute</a></li><li><a href="FBranch.html">FBranch</a></li><li><a href="FNote.html">FNote</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteContextAwareWidget.html">NoteContextAwareWidget</a></li><li><a href="RightPanelWidget.html">RightPanelWidget</a></li></ul><h3>Global</h3><ul><li><a href="global.html#api">api</a></li><li><a href="global.html#getJsonContent">getJsonContent</a></li><li><a href="global.html#getJsonContentSafely">getJsonContentSafely</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a>
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>