add load sample button
This commit is contained in:
parent
af4c6a6348
commit
d0ecf537d9
|
|
@ -23,6 +23,7 @@
|
|||
<button id="fn-new-data">New Data</button>
|
||||
<button id="fn-upload-data">Upload Data</button>
|
||||
<input type="file" name="upload-data" style="display: none;">
|
||||
<button id="fn-load-sample">Load Sample</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="middle column editor-container"></div>
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import objectPath from 'object-path';
|
|||
|
||||
import { JSONEditor } from '@json-editor/json-editor/dist/jsoneditor';
|
||||
|
||||
import * as sampleModule from '../../sample.resume.json';
|
||||
import { saveCVJSON } from '../lib/store';
|
||||
import {
|
||||
createElement,
|
||||
|
|
@ -150,6 +151,7 @@ const $btnUploadData = $('#fn-upload-data')
|
|||
const $inputUploadData = $('input[name=upload-data]')
|
||||
const $btnDownloadJSON = $('#fn-download-json')
|
||||
const $btnDownloadHTML = $('#fn-download-html')
|
||||
const $btnLoadSample = $('#fn-load-sample')
|
||||
|
||||
$btnShowPreview.on('click', () => {
|
||||
$outputJSON.hide()
|
||||
|
|
@ -227,3 +229,9 @@ $btnDownloadJSON.on('click', () => {
|
|||
$btnDownloadHTML.on('click', () => {
|
||||
downloadCV('html')
|
||||
})
|
||||
|
||||
$btnLoadSample.on('click', () => {
|
||||
if (!confirm('Are you sure to load sample data? Your current data will be covered.')) return
|
||||
|
||||
editor.setValue(sampleModule.default)
|
||||
})
|
||||
|
|
|
|||
|
|
@ -63,6 +63,7 @@ body {
|
|||
margin-bottom: var(--gap2);
|
||||
border-bottom: 1px solid var(--grey-2);
|
||||
font-weight: 700;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.editor-toc {
|
||||
|
|
|
|||
Loading…
Reference in New Issue