1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-08-02 20:15:26 +02:00

Enable PDF section editor

This commit is contained in:
Harvey Kandola 2019-04-18 15:42:18 +01:00
parent 61d0086337
commit 7fde947a52
6 changed files with 118 additions and 20 deletions

View file

@ -1,3 +1,37 @@
{{#section/base-editor-inline document=document folder=folder page=page tip="Select PDF to render" isDirty=(action "isDirty") onCancel=(action "onCancel") onAction=(action "onAction")}}
<div class="form-group">
<label for="new-space-name">PDF</label>
{{input type="text" class="form-control mousetrap" placeholder="click upload button below" value=pdfName readonly=true}}
<small class="form-text text-muted">First PDF uploaded will be used</small>
</div>
<div class="form-group">
<label for="new-space-name">Preview Height</label>
{{input type="number" class="form-control mousetrap" placeholder="e.g. 700" value=pdfOption.height}}
<small class="form-text text-muted">How tall is the PDF preview?</small>
</div>
<div class="form-group">
<label for="new-space-name">Start Page</label>
{{input type="number" class="form-control mousetrap" placeholder="e.g. 1" value=pdfOption.startPage}}
<small class="form-text text-muted">The first page to display</small>
</div>
<div class="form-group">
<label for="new-space-name">Sidebar</label>
<select onchange={{action "onSetSidebar" value="target.value"}} class="form-control">
<option value="none" selected={{is-equal pdfOption.sidebar 'none'}}>
None
</option>
<option value="bookmarks" selected={{is-equal pdfOption.sidebar 'bookmarks'}}>
Bookmarks
</option>
<option value="thumbs" selected={{is-equal pdfOption.sidebar 'thumbs'}}>
Thumbnails
</option>
</select>
<small class="form-text text-muted">Optionally, set sidebar content</small>
</div>
{{/section/base-editor-inline}}

View file

@ -1,7 +1,7 @@
<div class="non-printable">
<iframe frameborder="0" onmousewheel=""
width="100%"
height={{viewHeight}}
src="/pdfjs/web/viewer.html?file={{pdfUrl}}#zoom=page-width&page={{startPage}}&pagemode={{pageMode}}">
height={{pdfOption.height}}
src="/pdfjs/web/viewer.html?file={{pdfUrl}}#zoom=page-width&page={{pdfOption.startPage}}&pagemode={{pdfOption.sidebar}}">
</iframe>
</div>