Skip to content
This repository has been archived by the owner on Aug 5, 2018. It is now read-only.

Commit

Permalink
Removed unecessary code and dependencies and minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Johann Behr committed Aug 4, 2018
1 parent b84eb9b commit 04e198c
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 216 deletions.
54 changes: 10 additions & 44 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@
"animate.css": "^3.6.1",
"axios": "^0.18.0",
"file-saver": "^1.3.8",
"html2canvas": "^1.0.0-alpha.10",
"markdown-it": "^8.4.1",
"markdown-it-checkbox": "^1.1.0",
"moment": "^2.22.1",
"mousetrap": "^1.6.1",
"remark": "^9.0.0"
Expand Down
14 changes: 13 additions & 1 deletion src/components/TextOptions.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<template>
<q-popover>
<!-- TODO: Fix this, strings are pasted on buttons rather than document -->
<q-popover
@show="focusEditor()"
@hide="focusEditor()"
>
<q-list separator link>
<q-item v-close-overlay
@click.native="paste(val)"
Expand Down Expand Up @@ -46,6 +50,14 @@ export default {
quote: '> '
}
},
methods: {
focusEditor () {
let el = document.querySelector('div#editor')
el.focus()
}
}
}
</script>
Expand Down
6 changes: 0 additions & 6 deletions src/layouts/Main.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@
:content="tabs[activeTab].content"
:name="tabs[activeTab].name"
:active-tab="activeTab"
:preview-visible="panes.right"
></export>
</q-item>

Expand Down Expand Up @@ -230,7 +229,6 @@ import Debug from '../pages/Debug'
import EditInput from '../pages/EditInput'
import Essential from '../services/Essential'
import Export from '../pages/Export'
import ExportDialog from '../services/Export'
import Markdown from '../services/Markdown'
import MarkdownPreview from '../pages/MarkdownPreview'
import Mousetrap from 'mousetrap'
Expand Down Expand Up @@ -366,10 +364,6 @@ export default {
Storage.save('settings', settings)
},
exportDoc () {
ExportDialog.exportDialog(this.tabs[this.activeTab].content, this.tabs[this.activeTab].name, this.activeTab)
},
save () {
Storage.save('archived', this.archived)
Storage.save('tabs', this.tabs)
Expand Down
30 changes: 3 additions & 27 deletions src/pages/Export.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,6 @@
>
Html
</q-item>
<q-item v-close-overlay
@click.native="exportToPicture()"
:disabled="!previewVisible"
>
Picture

<q-tooltip :disable="previewVisible">
Open the preview
</q-tooltip>
</q-item>
<q-item v-close-overlay>
Cancel
</q-item>
Expand All @@ -30,11 +20,10 @@

<script>
import FileSaver from 'file-saver'
import Html2Canvas from 'html2canvas'
import Markdown from '../services/Markdown'
export default {
props: ['content', 'name', 'activeTab', 'previewVisible'],
props: ['content', 'name', 'activeTab'],
data () {
return {}
Expand All @@ -44,7 +33,7 @@ export default {
exportToTxt () {
FileSaver.saveAs(
new Blob(
[this.content],
[ this.content ],
{
type: 'text/plain;charset=utf-8'
}
Expand All @@ -56,26 +45,13 @@ export default {
exportToHtml () {
FileSaver.saveAs(
new Blob(
[Markdown.generateHtmlPage(this.content, this.name)],
[ Markdown.generateHtmlPage(this.content, this.name) ],
{
type: 'text/plain;charset=utf-8'
}
),
this.name + '.html'
)
},
exportToPicture () {
Html2Canvas(document.querySelector('#preview-' + this.activeTab))
.then(canvas => {
document.body.appendChild(canvas)
canvas.toBlob(canvas => {
FileSaver.saveAs(
canvas,
this.name + '.jpg'
)
}, 'image/jpeg', 1)
})
}
}
}
Expand Down
73 changes: 0 additions & 73 deletions src/services/Export/index.js

This file was deleted.

16 changes: 0 additions & 16 deletions src/services/Github/index.js

This file was deleted.

Loading

0 comments on commit 04e198c

Please sign in to comment.