Welcome to mirror list, hosted at ThFree Co, Russian Federation.

AppHelp.vue « components « src - github.com/nextcloud/notes.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 114c4421473ecc8b2b0696632090132b0c3fab07 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
<template>
	<div>
		<NcAppSettingsDialog :open.sync="settingsOpen" :showNavigation="true">
			<h2>{{ t('notes', 'Notes Application') }}</h2>
			<NcAppSettingsSection :title="t('notes', 'Basics')" id="help-basics">
				<div class="feature icon-add">
					{{ t('notes', 'Start writing a note by clicking on “{newnote}” in the app navigation.', { newnote: t('notes', 'New note') }) }}
				</div>
				<div class="feature icon-fullscreen">
					{{ t('notes', 'Write down your thoughts without any distractions.') }}
				</div>
				<div class="feature icon-files-dark">
					{{ t('notes', 'Organize your notes in categories.') }}
				</div>
				<NcButton @click="onNewNote" type="secondary">
					<PlusIcon slot="icon" :size="20" />
					{{ t('notes', 'Create a sample note with markdown') }}
				</NcButton>
			</NcAppSettingsSection>
			<NcAppSettingsSection :title="t('notes', 'Markdown')" id="help-markdown">
				<div class="feature icon-toggle-filelist">
					{{ t('notes', 'Use Markdown markups to style your text.') }}
				</div>
				<table>
					<tr>
						<th>
							{{ t('notes', 'Sequence') }}
						</th>
						<th>
							{{ t('notes', 'Result') }}
						</th>
						<th>
							{{ t('notes', 'Visualized') }}
						</th>
					</tr>
					<tr v-for="item in getMarkdown">
						<td v-html="item.sequence">
							{{ item.sequence }}
						</td>
						<td>
							{{ item.result }}
						</td>
						<td v-html="item.visualized">
							{{ item.visualized }}
						</td>
					</tr>
				</table>
			</NcAppSettingsSection>
			<NcAppSettingsSection :title="t('notes', 'Shortcuts')" id="help-shortcuts">
				<div class="feature icon-toggle-filelist">
					{{ t('notes', 'Use shortcuts to quickly navigate this app.') }}
				</div>
				<table>
					<tr>
						<th>{{ t('notes', 'Shortcut') }}</th>
						<th>{{ t('notes', 'Action') }}</th>
					</tr>
					<tr v-for="item in getShortcuts">
						<td>{{ item.shortcut }}</td>
						<td>{{ item.action }}</td>
					</tr>
				</table>
			</NcAppSettingsSection>
			<NcAppSettingsSection :title="t('notes', 'Apps')" id="help-apps">
				<div class="feature icon-phone">
					{{ t('notes', 'Install the app for your mobile phone in order to access your notes from everywhere.') }}
				</div>
				<div class="badge-wrapper">
					<a target="_blank" href="https://github.com/stefan-niedermann/nextcloud-notes">
						{{ t('notes', 'Android app: {notes} by {company}', {notes: 'Nextcloud Notes', company: 'Niedermann IT-Dienstleistungen'}) }}
					</a>
					<div>
						<div class="badge">
							<a target="_blank" href="https://play.google.com/store/apps/details?id=it.niedermann.owncloud.notes">
								<img :src="getRoute('badge_playstore.svg')" class="appstore-badge badge-playstore-fix">
							</a>
						</div>
						<div class="badge">
							<a target="_blank" href="https://f-droid.org/repository/browse/?fdid=it.niedermann.owncloud.notes">
								<img :src="getRoute('badge_fdroid.svg')" class="appstore-badge">
							</a>
						</div>
					</div>
				</div>
				<div class="badge-wrapper">
					<a target="_blank" href="https://github.com/phedlund/CloudNotes">
						{{ t('notes', 'iOS app: {notes} by {company}', {notes: 'CloudNotes - Nextcloud Notes', company: 'Peter Hedlund'}) }}
					</a>
					<div>
						<div class="badge">
							<a target="_blank" href="https://apps.apple.com/app/cloudnotes-owncloud-notes/id813973264">
								<img :src="getRoute('badge_applestore.svg')" class="appstore-badge badge-playstore-fix">
							</a>
						</div>
					</div>
				</div>
			</NcAppSettingsSection>
		</NcAppSettingsDialog>
	</div>
</template>

<script>

import {
	NcAppSettingsDialog,
	NcAppSettingsSection,
	NcButton,
} from '@nextcloud/vue'
import { createNote } from '../NotesService'
import { getDefaultSampleNote } from '../Util'
import { generateFilePath } from '@nextcloud/router'
import PlusIcon from 'vue-material-design-icons/Plus.vue'

export default {
	name: 'AppHelp',

	components: {
		NcAppSettingsDialog,
		NcAppSettingsSection,
		NcButton,
		PlusIcon,
	},

	props: {
		settingsOpen: Boolean,
	},

	data() {
		return {}
	},

	computed: {
		getShortcuts() {
			return [
				{ shortcut: t('notes', 'CTRL+\''), action: t('notes', 'Wrap the selection in Quotes') },
				{ shortcut: t('notes', 'CTRL+B'), action: t('notes', 'Make the selection bold') },
				{ shortcut: t('notes', 'CTRL+E'), action: t('notes', 'Remove any styles from the selected text') },
				{ shortcut: t('notes', 'CTRL+H'), action: t('notes', 'Toggle heading for current line') },
				{ shortcut: t('notes', 'CTRL+ALT+C'), action: t('notes', 'The selection will be turned into monospace') },
				{ shortcut: t('notes', 'CTRL+ALT+I'), action: t('notes', 'Insert image at the cursor') },
				{ shortcut: t('notes', 'CTRL+ALT+L'), action: t('notes', 'Makes the current line a list element with a number') },
				{ shortcut: t('notes', 'SHIFT+CTRL+H'), action: t('notes', 'Set the current line as a big Heading') },
				{ shortcut: t('notes', 'CTRL+I'), action: t('notes', 'Make the selection italic') },
				{ shortcut: t('notes', 'CTRL+K'), action: t('notes', 'Insert link at cursor') },
				{ shortcut: t('notes', 'CTRL+L'), action: t('notes', 'Makes the current line a list element') },
				{ shortcut: t('notes', 'F11'), action: t('notes', 'Make the note fullscreen') },
				{ shortcut: t('notes', 'CTRL+/'), action: t('notes', 'Switch between Editor and Viewer') },
			]
		},
		getMarkdown() {
			return [
				{ sequence: '**' + t('notes', 'bolding') + '**', result: 'Bolding', visualized: '<b>' + t('notes', 'bolding') + '</b>' },
				{ sequence: '*' + t('notes', 'italic') + '*', result: 'Italicising', visualized: '<em>' + t('notes', 'italic') + '</em>' },
				{ sequence: '~~' + t('notes', 'strikethrough') + '~~', result: 'strikethrough', visualized: '<s>' + t('notes', 'strikethrough') + '</s>' },

				{ sequence: '# ' + t('notes', 'Big header'), result: t('notes', 'Big header'), visualized: '<h2>' + t('notes', 'Big header') + '</h2>' },
				{ sequence: '## ' + t('notes', 'Medium header'), result: t('notes', 'Medium header'), visualized: '<b><h3>' + t('notes', 'Medium header') + '</h3></b>' },
				{ sequence: '### ' + t('notes', 'Small header'), result: t('notes', 'Small header'), visualized: '<h3>' + t('notes', 'Small header') + '</h3>' },
				{ sequence: '#### ' + t('notes', 'Tiny header'), result: t('notes', 'Tiny header'), visualized: '<h4>' + t('notes', 'Tiny header') + '</h4>' },

				{ sequence: '* ' + t('notes', 'Generic list item'), result: t('notes', 'Generic list'), visualized: '<li>' + t('notes', 'Generic list item') + '</li>' },
				{ sequence: '- ' + t('notes', 'Generic list item'), result: t('notes', 'Generic list'), visualized: '<li>' + t('notes', 'Generic list item') + '</li>' },

				{
					sequence: '1. William Riker<br>2. Deanna Troi<br>3. Beverly Crusher<br>',
					result: t('notes', 'Numbered list'),
					visualized: '<ol><li>William Riker</li><li>Deanna Troi</li><li>Beverly Crusher</li></ol>',
				},

				{ sequence: '[Text to display](http://www.example.com)', result: "'link'", visualized: "<a href='http://www.example.com'>Text to display</a>" },
				{ sequence: '![Alt Title](http://www.example.com/image.jpg)', result: 'link', visualized: "<img src='http://www.example.com' alt='Alt Title'></img>" },
				{ sequence: '> This is a quote.<br>> It can span multiple lines!', result: 'Quote', visualized: '' },

				{ sequence: '`code`', result: 'code', visualized: '' },
				{ sequence: '```<br>Multi Line Blockcode<br>```', result: 'mlb', visualized: '' },
			]
		},
	},
	watch: {
		settingsOpen: {
			handler: function() {
				this.$emit('popupClosed')
			},
			deep: true,
		},
	},

	methods: {
		onNewNote() {
			createNote('')
				.then(note => {
					const query = { new: getDefaultSampleNote() }
					this.$router.push({
						name: 'note',
						params: { noteId: note.id.toString() },
						query,
					})
				})
				.catch(() => {
				})
			this.settingsOpen = false
		},

		getRoute(file) {
			return generateFilePath('notes', 'img', file)
		},
	},
}
</script>

<style scoped>

.exit {
	width: 15px;
	float: right;
}

table {
	width: 70%;
	border: 1px lightgray solid;
	border-spacing: 0;

	border-collapse:separate;
	border-radius:6px;
}

th {
	font-style: oblique;
	font-weight: bold;
	border-top: none;
}

th , td {
	padding: 5px;
	border-left: 1px lightgray solid;
}

td:first-child, th:first-child {
	border-left: none;
}

tr:nth-child(even) {
	background-color: #eeeeee;
}

.badge-playstore-fix {
	height: 48px;
	padding: 12px;
}

</style>