Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion src/components/RichTextEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
History,
HorizontalRule,
Mention,
Image,
} from 'tiptap-extensions'

export default {
Expand Down Expand Up @@ -94,6 +95,7 @@
new ListItem(),
new TodoItem(),
new TodoList(),
new Image(),
new Bold(),
new Code(),
new Italic(),
Expand Down Expand Up @@ -186,6 +188,7 @@
{name: 'underline', icon: 'underline'},
{name: 'strike', icon: 'strikethrough'},
{name: 'link', icon: 'link'},
{name: 'image', icon: 'image'},
{name: 'heading', icon: 'heading'},
{name: 'horizontal_rule', icon: 'minus'},
],
Expand Down Expand Up @@ -219,6 +222,9 @@
case 'heading':
this.editor.commands.heading({level: 1});
break;
case 'image':
this.showImagePrompt();
break;
case 'link':
const {empty} = this.editor.state.tr.selection;
if (empty) {
Expand Down Expand Up @@ -266,11 +272,16 @@
return link;
}
},
showImagePrompt() {
const src = prompt('Enter the url of your image here')
if (src !== null) {
this.editor.commands.image({ src })
}
},
setLinkUrl(url) {
this.editor.commands.link({href: url});
this.editor.focus()
},

// navigate to the previous item
// if it's the first item, navigate to the last one
upHandler() {
Expand Down
46 changes: 35 additions & 11 deletions src/components/section/Layout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@
<div class="navbar">
<div class="brand">
<div>
<router-link :to="{ name: 'Index' }">
<span class="pointer" @click="$router.push({name: 'Index'})">
<img :src="brand_logo" style="height: 38px;">
</router-link>
</span>
</div>

<div class="flex">
Expand Down Expand Up @@ -183,21 +183,31 @@
<div class="row">
<div v-if="$root.mode === 'normal'" class="col-0 col-lg-3 col-xl-3 sidebarblock">
<div class="desktop block">
<router-link class="dropdown-item"
:to="{name: 'Index' }">
<router-link
class="dropdown-item sidebar-nav-item"
:to="{name: 'Index' }"
:exact="true">
<font-awesome-icon class="fas sidebar-nav-icon" :icon="['fas', 'home']" />
home
</router-link>
<router-link class="dropdown-item"
:to="{name: 'Feed' }">
<router-link
class="dropdown-item sidebar-nav-item"
:to="{name: 'Feed' }"
:exact="true">
<font-awesome-icon class="fas sidebar-nav-icon" :icon="['fas', 'newspaper']" />
feed
</router-link>
<router-link class="dropdown-item"
:to="{name: 'Sub', params: { sub: 'all' } }">
<router-link
class="dropdown-item sidebar-nav-item"
:to="{name: 'Sub', params: { sub: 'all' } }"
:exact="true">
<font-awesome-icon class="fas sidebar-nav-icon" :icon="['fas', 'globe']" />
all
</router-link>
<router-link v-if="eos_referendum"
class="dropdown-item"
class="dropdown-item sidebar-nav-item"
:to="{name: 'Sub', params: { sub: 'referendum' } }">
<font-awesome-icon class="fas sidebar-nav-icon" :icon="['fas', 'poll']" />
referendum
</router-link>
<div class="divline" />
Expand All @@ -206,7 +216,7 @@
:key="`userSub-${i}`"
class="dropdown-item"
:to="{ name: 'UserProfile', params: { account: user } }">
<font-awesome-icon class="fas follow-user-icon" :icon="['fas', 'user-circle']" />
<font-awesome-icon class="fas sidebar-nav-icon" :icon="['fas', 'user-circle']" />
<div>
{{ user }}
</div>
Expand Down Expand Up @@ -557,7 +567,7 @@ export default {
}
</style>
<style scoped>
.follow-user-icon {
.sidebar-nav-icon {
width: 20px;
height: 20px;
margin-right: 5px;
Expand Down Expand Up @@ -633,4 +643,18 @@ export default {
.buy-banner-modal .footer button {
margin-left: 10px;
}
.pointer {
cursor: pointer;
}
.router-link-active {
background: #e0e1e2;
}
.sidebar-nav-item {
display: flex;
align-items: center;
justify-content: flex-start;
}
.sidebar-nav-item svg {
margin-right: 5px;
}
</style>