mirror of
https://github.com/laurent22/joplin.git
synced 2025-04-11 11:12:03 +02:00
391 lines
19 KiB
HTML
391 lines
19 KiB
HTML
<!doctype html>
|
|
<html class="default no-js">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
<title>joplin.views.dialogs | Joplin Plugin API Documentation</title>
|
|
<meta name="description" content="Documentation for Joplin Plugin API Documentation">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<link rel="stylesheet" href="../assets/css/main.css">
|
|
</head>
|
|
<body>
|
|
<header>
|
|
<div class="tsd-page-toolbar">
|
|
<div class="container">
|
|
<div class="table-wrap">
|
|
<div class="table-cell" id="tsd-search" data-index="../assets/js/search.json" data-base="..">
|
|
<div class="field">
|
|
<label for="tsd-search-field" class="tsd-widget search no-caption">Search</label>
|
|
<input id="tsd-search-field" type="text" />
|
|
</div>
|
|
<ul class="results">
|
|
<li class="state loading">Preparing search index...</li>
|
|
<li class="state failure">The search index is not available</li>
|
|
</ul>
|
|
<a href="joplin.html" class="title">Joplin Plugin API Documentation</a>
|
|
</div>
|
|
<div class="table-cell" id="tsd-widgets">
|
|
<div id="tsd-filter">
|
|
<a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a>
|
|
<div class="tsd-filter-group">
|
|
<div class="tsd-select" id="tsd-filter-visibility">
|
|
<span class="tsd-select-label">All</span>
|
|
<ul class="tsd-select-list">
|
|
<li data-value="public">Public</li>
|
|
<li data-value="protected">Public/Protected</li>
|
|
<li data-value="private" class="selected">All</li>
|
|
</ul>
|
|
</div>
|
|
<input type="checkbox" id="tsd-filter-inherited" checked />
|
|
<label class="tsd-widget" for="tsd-filter-inherited">Inherited</label>
|
|
</div>
|
|
</div>
|
|
<a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="tsd-page-title">
|
|
<div class="container">
|
|
<ul class="tsd-breadcrumb">
|
|
<!--
|
|
<li>
|
|
<a href="../globals.html">Globals</a>
|
|
</li>
|
|
-->
|
|
<li>
|
|
<a href="joplinviewsdialogs.html">joplin.views.dialogs</a>
|
|
</li>
|
|
</ul>
|
|
<h1><!-- Class -->joplin.views.dialogs</h1>
|
|
</div>
|
|
</div>
|
|
</header>
|
|
<div class="container container-main">
|
|
<div class="row">
|
|
<div class="col-8 col-content">
|
|
<section class="tsd-panel tsd-comment">
|
|
<div class="tsd-comment tsd-typography">
|
|
<div class="lead">
|
|
<p>Allows creating and managing dialogs. A dialog is modal window that
|
|
contains a webview and a row of buttons. You can update the update the
|
|
webview using the <code>setHtml</code> method. Dialogs are hidden by default and
|
|
you need to call <code>open()</code> to open them. Once the user clicks on a
|
|
button, the <code>open</code> call will return an object indicating what button was
|
|
clicked on.</p>
|
|
</div>
|
|
<a href="#retrieving-form-values" id="retrieving-form-values" style="color: inherit; text-decoration: none;">
|
|
<h2>Retrieving form values</h2>
|
|
</a>
|
|
<p>If your HTML content included one or more forms, a <code>formData</code> object
|
|
will also be included with the key/value for each form.</p>
|
|
<a href="#special-button-ids" id="special-button-ids" style="color: inherit; text-decoration: none;">
|
|
<h2>Special button IDs</h2>
|
|
</a>
|
|
<p>The following buttons IDs have a special meaning:</p>
|
|
<ul>
|
|
<li><code>ok</code>, <code>yes</code>, <code>submit</code>, <code>confirm</code>: They are considered "submit" buttons</li>
|
|
<li><code>cancel</code>, <code>no</code>, <code>reject</code>: They are considered "dismiss" buttons</li>
|
|
</ul>
|
|
<p>This information is used by the application to determine what action
|
|
should be done when the user presses "Enter" or "Escape" within the
|
|
dialog. If they press "Enter", the first "submit" button will be
|
|
automatically clicked. If they press "Escape" the first "dismiss" button
|
|
will be automatically clicked.</p>
|
|
<p><a href="https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/dialog">View the demo
|
|
plugin</a></p>
|
|
</div>
|
|
</section>
|
|
<!--
|
|
<section class="tsd-panel tsd-hierarchy">
|
|
<h3>Hierarchy</h3>
|
|
<ul class="tsd-hierarchy">
|
|
<li>
|
|
<span class="target">JoplinViewsDialogs</span>
|
|
|
|
</li>
|
|
</ul>
|
|
|
|
</section>
|
|
-->
|
|
<section class="tsd-panel-group tsd-index-group">
|
|
<h2>Index</h2>
|
|
<section class="tsd-panel tsd-index-panel">
|
|
<div class="tsd-index-content">
|
|
<section class="tsd-index-section ">
|
|
</section>
|
|
<section class="tsd-index-section ">
|
|
<h3>Methods</h3>
|
|
<ul class="tsd-index-list">
|
|
<li class="tsd-kind-method tsd-parent-kind-class"><a href="joplinviewsdialogs.html#addscript" class="tsd-kind-icon">add<wbr>Script</a></li>
|
|
<li class="tsd-kind-method tsd-parent-kind-class"><a href="joplinviewsdialogs.html#create" class="tsd-kind-icon">create</a></li>
|
|
<li class="tsd-kind-method tsd-parent-kind-class"><a href="joplinviewsdialogs.html#open" class="tsd-kind-icon">open</a></li>
|
|
<li class="tsd-kind-method tsd-parent-kind-class"><a href="joplinviewsdialogs.html#setbuttons" class="tsd-kind-icon">set<wbr>Buttons</a></li>
|
|
<li class="tsd-kind-method tsd-parent-kind-class"><a href="joplinviewsdialogs.html#sethtml" class="tsd-kind-icon">set<wbr>Html</a></li>
|
|
<li class="tsd-kind-method tsd-parent-kind-class"><a href="joplinviewsdialogs.html#showmessagebox" class="tsd-kind-icon">show<wbr>Message<wbr>Box</a></li>
|
|
</ul>
|
|
</section>
|
|
</div>
|
|
</section>
|
|
</section>
|
|
<section class="tsd-panel-group tsd-member-group ">
|
|
</section>
|
|
<section class="tsd-panel-group tsd-member-group ">
|
|
<h2>Methods</h2>
|
|
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
|
|
<a name="addscript" class="tsd-anchor"></a>
|
|
<h3>add<wbr>Script</h3>
|
|
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
|
|
<li class="tsd-signature tsd-kind-icon">add<wbr>Script<span class="tsd-signature-symbol">(</span>handle<span class="tsd-signature-symbol">: </span><a href="../globals.html#viewhandle" class="tsd-signature-type">ViewHandle</a>, scriptPath<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></li>
|
|
</ul>
|
|
<ul class="tsd-descriptions">
|
|
<li class="tsd-description">
|
|
<aside class="tsd-sources">
|
|
</aside>
|
|
<div class="tsd-comment tsd-typography">
|
|
<div class="lead">
|
|
<p>Adds and loads a new JS or CSS files into the dialog.</p>
|
|
</div>
|
|
</div>
|
|
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
<ul class="tsd-parameters">
|
|
<li>
|
|
<h5>handle: <a href="../globals.html#viewhandle" class="tsd-signature-type">ViewHandle</a></h5>
|
|
</li>
|
|
<li>
|
|
<h5>scriptPath: <span class="tsd-signature-type">string</span></h5>
|
|
</li>
|
|
</ul>
|
|
<!-- JOPLINCHANGE
|
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">></span></h4>
|
|
|
|
|
|
-->
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
|
|
<a name="create" class="tsd-anchor"></a>
|
|
<h3>create</h3>
|
|
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
|
|
<li class="tsd-signature tsd-kind-icon">create<span class="tsd-signature-symbol">(</span>id<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../globals.html#viewhandle" class="tsd-signature-type">ViewHandle</a><span class="tsd-signature-symbol">></span></li>
|
|
</ul>
|
|
<ul class="tsd-descriptions">
|
|
<li class="tsd-description">
|
|
<aside class="tsd-sources">
|
|
</aside>
|
|
<div class="tsd-comment tsd-typography">
|
|
<div class="lead">
|
|
<p>Creates a new dialog</p>
|
|
</div>
|
|
</div>
|
|
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
<ul class="tsd-parameters">
|
|
<li>
|
|
<h5>id: <span class="tsd-signature-type">string</span></h5>
|
|
</li>
|
|
</ul>
|
|
<!-- JOPLINCHANGE
|
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../globals.html#viewhandle" class="tsd-signature-type">ViewHandle</a><span class="tsd-signature-symbol">></span></h4>
|
|
|
|
|
|
-->
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
|
|
<a name="open" class="tsd-anchor"></a>
|
|
<h3>open</h3>
|
|
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
|
|
<li class="tsd-signature tsd-kind-icon">open<span class="tsd-signature-symbol">(</span>handle<span class="tsd-signature-symbol">: </span><a href="../globals.html#viewhandle" class="tsd-signature-type">ViewHandle</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/dialogresult.html" class="tsd-signature-type">DialogResult</a><span class="tsd-signature-symbol">></span></li>
|
|
</ul>
|
|
<ul class="tsd-descriptions">
|
|
<li class="tsd-description">
|
|
<aside class="tsd-sources">
|
|
</aside>
|
|
<div class="tsd-comment tsd-typography">
|
|
<div class="lead">
|
|
<p>Opens the dialog</p>
|
|
</div>
|
|
</div>
|
|
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
<ul class="tsd-parameters">
|
|
<li>
|
|
<h5>handle: <a href="../globals.html#viewhandle" class="tsd-signature-type">ViewHandle</a></h5>
|
|
</li>
|
|
</ul>
|
|
<!-- JOPLINCHANGE
|
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/dialogresult.html" class="tsd-signature-type">DialogResult</a><span class="tsd-signature-symbol">></span></h4>
|
|
|
|
|
|
-->
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
|
|
<a name="setbuttons" class="tsd-anchor"></a>
|
|
<h3>set<wbr>Buttons</h3>
|
|
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
|
|
<li class="tsd-signature tsd-kind-icon">set<wbr>Buttons<span class="tsd-signature-symbol">(</span>handle<span class="tsd-signature-symbol">: </span><a href="../globals.html#viewhandle" class="tsd-signature-type">ViewHandle</a>, buttons<span class="tsd-signature-symbol">: </span><a href="../interfaces/buttonspec.html" class="tsd-signature-type">ButtonSpec</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/buttonspec.html" class="tsd-signature-type">ButtonSpec</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">></span></li>
|
|
</ul>
|
|
<ul class="tsd-descriptions">
|
|
<li class="tsd-description">
|
|
<aside class="tsd-sources">
|
|
</aside>
|
|
<div class="tsd-comment tsd-typography">
|
|
<div class="lead">
|
|
<p>Sets the dialog buttons.</p>
|
|
</div>
|
|
</div>
|
|
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
<ul class="tsd-parameters">
|
|
<li>
|
|
<h5>handle: <a href="../globals.html#viewhandle" class="tsd-signature-type">ViewHandle</a></h5>
|
|
</li>
|
|
<li>
|
|
<h5>buttons: <a href="../interfaces/buttonspec.html" class="tsd-signature-type">ButtonSpec</a><span class="tsd-signature-symbol">[]</span></h5>
|
|
</li>
|
|
</ul>
|
|
<!-- JOPLINCHANGE
|
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="../interfaces/buttonspec.html" class="tsd-signature-type">ButtonSpec</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">></span></h4>
|
|
|
|
|
|
-->
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
|
|
<a name="sethtml" class="tsd-anchor"></a>
|
|
<h3>set<wbr>Html</h3>
|
|
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
|
|
<li class="tsd-signature tsd-kind-icon">set<wbr>Html<span class="tsd-signature-symbol">(</span>handle<span class="tsd-signature-symbol">: </span><a href="../globals.html#viewhandle" class="tsd-signature-type">ViewHandle</a>, html<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">></span></li>
|
|
</ul>
|
|
<ul class="tsd-descriptions">
|
|
<li class="tsd-description">
|
|
<aside class="tsd-sources">
|
|
</aside>
|
|
<div class="tsd-comment tsd-typography">
|
|
<div class="lead">
|
|
<p>Sets the dialog HTML content</p>
|
|
</div>
|
|
</div>
|
|
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
<ul class="tsd-parameters">
|
|
<li>
|
|
<h5>handle: <a href="../globals.html#viewhandle" class="tsd-signature-type">ViewHandle</a></h5>
|
|
</li>
|
|
<li>
|
|
<h5>html: <span class="tsd-signature-type">string</span></h5>
|
|
</li>
|
|
</ul>
|
|
<!-- JOPLINCHANGE
|
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">></span></h4>
|
|
|
|
|
|
-->
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
|
|
<a name="showmessagebox" class="tsd-anchor"></a>
|
|
<h3>show<wbr>Message<wbr>Box</h3>
|
|
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
|
|
<li class="tsd-signature tsd-kind-icon">show<wbr>Message<wbr>Box<span class="tsd-signature-symbol">(</span>message<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">></span></li>
|
|
</ul>
|
|
<ul class="tsd-descriptions">
|
|
<li class="tsd-description">
|
|
<aside class="tsd-sources">
|
|
</aside>
|
|
<div class="tsd-comment tsd-typography">
|
|
<div class="lead">
|
|
<p>Displays a message box with OK/Cancel buttons. Returns the button index that was clicked - "0" for OK and "1" for "Cancel"</p>
|
|
</div>
|
|
</div>
|
|
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
<ul class="tsd-parameters">
|
|
<li>
|
|
<h5>message: <span class="tsd-signature-type">string</span></h5>
|
|
</li>
|
|
</ul>
|
|
<!-- JOPLINCHANGE
|
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">></span></h4>
|
|
|
|
|
|
-->
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
</section>
|
|
</div>
|
|
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
|
|
<!--
|
|
<nav class="tsd-navigation primary">
|
|
<ul>
|
|
<li class="globals ">
|
|
<a href="../globals.html"><em>Globals</em></a>
|
|
</li>
|
|
</ul>
|
|
</nav>
|
|
-->
|
|
<nav class="tsd-navigation secondary menu-sticky">
|
|
<ul class="before-current">
|
|
</ul>
|
|
<ul class="current">
|
|
<li class="current tsd-kind-class">
|
|
<a href="joplinviewsdialogs.html" class="tsd-kind-icon">joplin.views.dialogs</a>
|
|
<ul>
|
|
<li class=" tsd-kind-constructor tsd-parent-kind-class">
|
|
<a href="joplinviewsdialogs.html#constructor" class="tsd-kind-icon">constructor</a>
|
|
</li>
|
|
<li class=" tsd-kind-method tsd-parent-kind-class">
|
|
<a href="joplinviewsdialogs.html#addscript" class="tsd-kind-icon">add<wbr>Script</a>
|
|
</li>
|
|
<li class=" tsd-kind-method tsd-parent-kind-class">
|
|
<a href="joplinviewsdialogs.html#create" class="tsd-kind-icon">create</a>
|
|
</li>
|
|
<li class=" tsd-kind-method tsd-parent-kind-class">
|
|
<a href="joplinviewsdialogs.html#open" class="tsd-kind-icon">open</a>
|
|
</li>
|
|
<li class=" tsd-kind-method tsd-parent-kind-class">
|
|
<a href="joplinviewsdialogs.html#setbuttons" class="tsd-kind-icon">set<wbr>Buttons</a>
|
|
</li>
|
|
<li class=" tsd-kind-method tsd-parent-kind-class">
|
|
<a href="joplinviewsdialogs.html#sethtml" class="tsd-kind-icon">set<wbr>Html</a>
|
|
</li>
|
|
<li class=" tsd-kind-method tsd-parent-kind-class">
|
|
<a href="joplinviewsdialogs.html#showmessagebox" class="tsd-kind-icon">show<wbr>Message<wbr>Box</a>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<ul class="after-current">
|
|
</ul>
|
|
</nav>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- JOPLINCHANGE
|
|
<footer class="with-border-bottom">
|
|
<div class="container">
|
|
<h2>Legend</h2>
|
|
<div class="tsd-legend-group">
|
|
<ul class="tsd-legend">
|
|
<li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li>
|
|
<li class="tsd-kind-method tsd-parent-kind-interface"><span class="tsd-kind-icon">Method</span></li>
|
|
</ul>
|
|
<ul class="tsd-legend">
|
|
<li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li>
|
|
<li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</footer>
|
|
|
|
<div class="container tsd-generator">
|
|
<p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p>
|
|
</div>
|
|
-->
|
|
<div class="overlay"></div>
|
|
<script src="../assets/js/main.js"></script>
|
|
</body>
|
|
</html> |