unified export dialog, WIP

This commit is contained in:
azivner
2018-11-24 14:44:56 +01:00
parent 3e351bd8d3
commit ee23bcc783
12 changed files with 203 additions and 103 deletions

View File

@@ -0,0 +1,67 @@
<div id="export-dialog" class="modal fade mx-auto" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Export note</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<form id="export-form">
<div class="modal-body">
<div class="form-check">
<input class="form-check-input" type="radio" name="export-type" id="export-type-subtree" value="subtree">
<label class="form-check-label" for="export-type-subtree">this note and all of its descendants</label>
</div>
<div id="export-subtree-formats" class="format-choice">
<div class="form-check">
<input class="form-check-input" type="radio" name="export-subtree-format" id="export-subtree-format-html"
value="html">
<label class="form-check-label" for="export-subtree-format-html">HTML in TAR archiv - this is recommended since this preserves all the formatting.</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="export-subtree-format" id="export-subtree-format-markdown"
value="markdown-tar">
<label class="form-check-label" for="export-subtree-format-markdown">
Markdown - this preserves most of the formatting.
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="export-subtree-format" id="export-subtree-format-opml"
value="opml">
<label class="form-check-label" for="export-subtree-format-opml">
OPML - outliner interchange format for text only. Formatting, images and files are not included.
</label>
</div>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="export-type" id="export-type-single" value="single">
<label class="form-check-label" for="export-type-single">only this note without its descendants</label>
</div>
<div id="export-single-formats" class="format-choice">
<div class="form-check">
<input class="form-check-input" type="radio" name="export-single-format" id="export-single-format-html" value="html">
<label class="form-check-label" for="export-single-format-html">HTML - this is recommended since this preserves all the formatting.</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="export-single-format" id="export-single-format-markdown"
value="markdown-tar">
<label class="form-check-label" for="export-single-format-markdown">
Markdown - this preserves most of the formatting.
</label>
</div>
</div>
</div>
<div class="modal-footer">
<button class="btn btn-primary btn-sm">Export</button>
</div>
</form>
</div>
</div>
</div>

View File

@@ -1,46 +0,0 @@
<div id="export-subtree-dialog" class="modal fade mx-auto" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Export subtree</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<form id="export-subtree-form">
<div class="modal-body">
<div>Export note "<span class="note-title"></span>" and its subtree in the following format:</div>
<br/>
<div class="form-check">
<input class="form-check-input" type="radio" name="export-format" id="export-format-tar" value="native-tar" checked>
<label class="form-check-label" for="export-format-tar">Native TAR - this is Trilium's native format which preserves all notes' data & metadata.</label>
</div>
<br/>
<div class="form-check">
<input class="form-check-input" type="radio" name="export-format" id="export-format-opml" value="opml">
<label class="form-check-label" for="export-format-opml">
OPML - standard outliner interchange format for text only. Formatting, images, files are not included.
</label>
</div>
<br/>
<div class="form-check disabled">
<input class="form-check-input" type="radio" name="export-format" id="export-format-markdown"
value="markdown-tar">
<label class="form-check-label" for="export-format-markdown">
Markdown - TAR archive of Markdown formatted notes
</label>
</div>
</div>
<div class="modal-footer">
<button class="btn btn-primary btn-sm">Export</button>
</div>
</form>
</div>
</div>
</div>

View File

@@ -157,9 +157,9 @@
<div class="dropdown-menu dropdown-menu-right">
<a class="dropdown-item" id="show-note-revisions-button" data-bind="css: { disabled: type() == 'file' || type() == 'image' }">Revisions</a>
<a class="dropdown-item show-attributes-button"><kbd>Alt+A</kbd> Attributes</a>
<a class="dropdown-item" id="show-source-button" data-bind="css: { disabled: type() != 'text' }">HTML source</a>
<a class="dropdown-item" id="show-source-button" data-bind="css: { disabled: type() != 'text' && type() != 'code' && type() != 'relation-map' && type() != 'search' }">Note source</a>
<a class="dropdown-item" id="upload-file-button">Upload file</a>
<a class="dropdown-item" id="export-note-to-markdown-button" data-bind="css: { disabled: type() != 'text' && type() != 'code' }">Export as markdown</a>
<a class="dropdown-item" id="export-note-button" data-bind="css: { disabled: type() != 'text' }">Export note</a>
</div>
</div>
</div>
@@ -173,7 +173,7 @@
<% include dialogs/attributes.ejs %>
<% include dialogs/branch_prefix.ejs %>
<% include dialogs/event_log.ejs %>
<% include dialogs/export_subtree.ejs %>
<% include dialogs/export.ejs %>
<% include dialogs/jump_to_note.ejs %>
<% include dialogs/markdown_import.ejs %>
<% include dialogs/note_revisions.ejs %>