diff --git a/src/editor/index.html b/src/editor/index.html index 275ec52..2f0e472 100644 --- a/src/editor/index.html +++ b/src/editor/index.html @@ -23,6 +23,7 @@ +
diff --git a/src/editor/main.js b/src/editor/main.js index b78bc83..9027534 100644 --- a/src/editor/main.js +++ b/src/editor/main.js @@ -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) +}) diff --git a/src/editor/styles.scss b/src/editor/styles.scss index a8a225b..35e869e 100644 --- a/src/editor/styles.scss +++ b/src/editor/styles.scss @@ -63,6 +63,7 @@ body { margin-bottom: var(--gap2); border-bottom: 1px solid var(--grey-2); font-weight: 700; + user-select: none; } .editor-toc {