Compare commits
No commits in common. "7a498393f8a70afe9ebca3fa366c0c8b841fce4b" and "8aa4f6882accef549e198b54be1cf579a522884c" have entirely different histories.
7a498393f8
...
8aa4f6882a
6250
package-lock.json
generated
6250
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
27
package.json
27
package.json
|
|
@ -8,29 +8,28 @@
|
||||||
"lint": "vue-cli-service lint"
|
"lint": "vue-cli-service lint"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@primer/css": "^14.4.0",
|
"@primer/css": "^14.1.0",
|
||||||
"bulma": "^0.7.5",
|
"bulma": "^0.7.5",
|
||||||
"event-source-polyfill": "0.0.16",
|
"event-source-polyfill": "0.0.16",
|
||||||
"isomorphic-fetch": "^2.2.1",
|
"isomorphic-fetch": "^2.2.1",
|
||||||
"lodash": "^4.17.20",
|
"lodash": "latest",
|
||||||
"micropub-helper": "^1.6.1",
|
"micropub-helper": "^1.4.0",
|
||||||
"moment": "^2.27.0",
|
"moment": "^2.22.2",
|
||||||
"node-sass": "^4.14.1",
|
"node-sass": "^4.14.1",
|
||||||
"rel-parser": "github:grantcodes/rel-scraper",
|
|
||||||
"rel-scraper": "github:grantcodes/rel-scraper",
|
"rel-scraper": "github:grantcodes/rel-scraper",
|
||||||
"sass-loader": "^7.3.1",
|
"sass-loader": "^7.2.0",
|
||||||
"tailwindcss": "1.1.4",
|
"tailwindcss": "1.1.4",
|
||||||
"vue": "^2.6.11",
|
"vue": "^2.5.17",
|
||||||
"vue-router": "^3.4.3",
|
"vue-router": "^3.0.1",
|
||||||
"vuex": "^3.5.1"
|
"vuex": "^3.0.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@vue/cli-plugin-babel": "^3.12.1",
|
"@vue/cli-plugin-babel": "^3.10.0",
|
||||||
"@vue/cli-plugin-eslint": "^3.12.1",
|
"@vue/cli-plugin-eslint": "^3.0.0-rc.10",
|
||||||
"@vue/cli-service": "^3.12.1",
|
"@vue/cli-service": "^3.10.0",
|
||||||
"postcss-node-sass": "^2.1.8",
|
"postcss-node-sass": "^2.1.8",
|
||||||
"postcss-scss": "^2.1.1",
|
"postcss-scss": "^2.0.0",
|
||||||
"vue-template-compiler": "^2.6.11"
|
"vue-template-compiler": "^2.5.17"
|
||||||
},
|
},
|
||||||
"eslintConfig": {
|
"eslintConfig": {
|
||||||
"root": true,
|
"root": true,
|
||||||
|
|
|
||||||
|
|
@ -1,43 +0,0 @@
|
||||||
<template>
|
|
||||||
<div>
|
|
||||||
<div v-for="(target, i) in targets" :key="i" style="display: inline-block; margin: 0 3px 3px 0">
|
|
||||||
<label>
|
|
||||||
<input type="checkbox" class="is-hidden cb-target" v-model="selected" :value="target.uid"/>
|
|
||||||
<span class="tag is-light" v-text="target.name"></span>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: 'destination-buttons',
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
selected: [],
|
|
||||||
}
|
|
||||||
},
|
|
||||||
props: {
|
|
||||||
value: [],
|
|
||||||
targets: {}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.selected = this.value
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
selected(newSelection) {
|
|
||||||
this.$emit('input', newSelection)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<style scoped>
|
|
||||||
|
|
||||||
.tag {
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
.cb-target:checked + .tag {
|
|
||||||
background-color: #23d160;
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
@ -79,13 +79,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="field">
|
<div class="field">
|
||||||
Categories: <entry-categories v-model="categories"/>
|
<syndication-buttons v-model="selected" :targets="targets"/>
|
||||||
</div>
|
|
||||||
<div class="field">
|
|
||||||
Syndication: <syndication-buttons v-model="selected" :targets="targets"/>
|
|
||||||
</div>
|
|
||||||
<div class="field">
|
|
||||||
Destination: <destination-buttons v-model="selectedDestinations" :targets="destinations"/>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<div class="control">
|
<div class="control">
|
||||||
|
|
@ -101,17 +95,11 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import moment from 'moment'
|
import moment from 'moment'
|
||||||
import DestinationButtons from "@/components/DestinationButtons";
|
|
||||||
import EntryCategories from "@/components/EntryCategories";
|
|
||||||
import SyndicationButtons from "@/components/SyndicationButtons";
|
import SyndicationButtons from "@/components/SyndicationButtons";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Entry",
|
name: "Entry",
|
||||||
components: {
|
components: {SyndicationButtons},
|
||||||
DestinationButtons,
|
|
||||||
EntryCategories,
|
|
||||||
SyndicationButtons
|
|
||||||
},
|
|
||||||
props: ['item'],
|
props: ['item'],
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
|
|
@ -123,10 +111,7 @@ export default {
|
||||||
bookmarkTitle: '',
|
bookmarkTitle: '',
|
||||||
bookmarkDescription: '',
|
bookmarkDescription: '',
|
||||||
targets: [],
|
targets: [],
|
||||||
selected: [],
|
selected: []
|
||||||
destinations: [],
|
|
||||||
selectedDestinations: [],
|
|
||||||
categories: []
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -175,8 +160,6 @@ export default {
|
||||||
this.selected = []
|
this.selected = []
|
||||||
this.$store.dispatch('fetchSyndicationTargets')
|
this.$store.dispatch('fetchSyndicationTargets')
|
||||||
.then(res => this.targets = res['syndicate-to'])
|
.then(res => this.targets = res['syndicate-to'])
|
||||||
this.$store.dispatch('fetchDestinations')
|
|
||||||
.then(res => this.destinations = res['destination'])
|
|
||||||
},
|
},
|
||||||
bookmark() {
|
bookmark() {
|
||||||
this.$store.dispatch('micropubPost', {
|
this.$store.dispatch('micropubPost', {
|
||||||
|
|
@ -185,17 +168,13 @@ export default {
|
||||||
'bookmark-of': [this.currentItem.url],
|
'bookmark-of': [this.currentItem.url],
|
||||||
'name': [this.bookmarkTitle],
|
'name': [this.bookmarkTitle],
|
||||||
'content': [this.bookmarkDescription ],
|
'content': [this.bookmarkDescription ],
|
||||||
'category': this.categories,
|
'mp-syndicate-to': this.selected
|
||||||
'mp-syndicate-to': this.selected,
|
|
||||||
'mp-destination': this.selectedDestinations
|
|
||||||
},
|
},
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.bookmarkTitle = '';
|
this.bookmarkTitle = '';
|
||||||
this.bookmarkDescription = '';
|
this.bookmarkDescription = '';
|
||||||
this.selected = []
|
this.selected = []
|
||||||
this.selectedDestinations = []
|
|
||||||
this.bookmarking = false
|
this.bookmarking = false
|
||||||
this.categories = []
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
hasRef(key) {
|
hasRef(key) {
|
||||||
|
|
|
||||||
|
|
@ -1,38 +0,0 @@
|
||||||
<template>
|
|
||||||
<div>
|
|
||||||
<input type="text" class="input" v-model="categories">
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: "EntryCategories",
|
|
||||||
props: {
|
|
||||||
'value': {
|
|
||||||
type: Array,
|
|
||||||
default: []
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
categories: ''
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
mounted() {
|
|
||||||
this.categories = this.value.join(" ")
|
|
||||||
},
|
|
||||||
|
|
||||||
watch: {
|
|
||||||
categories() {
|
|
||||||
let words = this.categories.split(/\s+/).filter(value => value.length !== 0)
|
|
||||||
this.$emit('input', words)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
|
|
||||||
</style>
|
|
||||||
|
|
@ -12,16 +12,8 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="field">
|
<div class="field">
|
||||||
Categories: <entry-categories v-model="categories" />
|
|
||||||
</div>
|
|
||||||
<div class="field">
|
|
||||||
Syndication:
|
|
||||||
<syndication-buttons v-model="selectedTargets" :targets="targets"/>
|
<syndication-buttons v-model="selectedTargets" :targets="targets"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="field">
|
|
||||||
Destinations:
|
|
||||||
<destination-buttons v-model="selectedDestinations" :targets="destinations"/>
|
|
||||||
</div>
|
|
||||||
<div class="level">
|
<div class="level">
|
||||||
<div class="level-left">
|
<div class="level-left">
|
||||||
<div class="level-item">
|
<div class="level-item">
|
||||||
|
|
@ -44,32 +36,22 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import DestinationButtons from "@/components/DestinationButtons";
|
|
||||||
import EntryCategories from "@/components/EntryCategories";
|
|
||||||
import SyndicationButtons from "@/components/SyndicationButtons";
|
import SyndicationButtons from "@/components/SyndicationButtons";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "NewPost",
|
name: "NewPost",
|
||||||
components:{
|
components:{
|
||||||
DestinationButtons,
|
SyndicationButtons
|
||||||
EntryCategories,
|
|
||||||
SyndicationButtons,
|
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
newPost: '',
|
newPost: '',
|
||||||
targets: [],
|
targets: [],
|
||||||
selectedTargets: [],
|
selectedTargets: []
|
||||||
destinations: [],
|
|
||||||
selectedDestinations: [],
|
|
||||||
categories: []
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.$store.dispatch('fetchSyndicationTargets')
|
this.$store.dispatch('fetchSyndicationTargets')
|
||||||
.then(res => this.targets = res['syndicate-to'])
|
.then(res => this.targets = res['syndicate-to'])
|
||||||
this.$store.dispatch('fetchDestinations')
|
|
||||||
.then(res => this.destinations = res['destination'])
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
post() {
|
post() {
|
||||||
|
|
@ -77,15 +59,10 @@
|
||||||
'type': ['h-entry'],
|
'type': ['h-entry'],
|
||||||
'properties': {
|
'properties': {
|
||||||
'content': [this.newPost],
|
'content': [this.newPost],
|
||||||
'category': this.categories,
|
|
||||||
'mp-syndicate-to': this.selectedTargets,
|
'mp-syndicate-to': this.selectedTargets,
|
||||||
'mp-destination': this.selectedDestinations,
|
|
||||||
},
|
},
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.newPost = ''
|
this.newPost = '';
|
||||||
this.categories = []
|
|
||||||
this.selectedTargets = []
|
|
||||||
this.selectedDestinations = []
|
|
||||||
this.$emit('close')
|
this.$emit('close')
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ export default {
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
selected(newSelection) {
|
selected(newSelection) {
|
||||||
this.$emit('input', newSelection)
|
this.$emit('update', newSelection)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
43
src/store.js
43
src/store.js
|
|
@ -108,39 +108,12 @@ export default new Vuex.Store({
|
||||||
state.eventSource.addEventListener('new item in channel', evt => {
|
state.eventSource.addEventListener('new item in channel', evt => {
|
||||||
// eslint-disable-next-line
|
// eslint-disable-next-line
|
||||||
console.log(evt)
|
console.log(evt)
|
||||||
let msg = JSON.parse(evt.data)
|
let d = JSON.parse(evt.data)
|
||||||
let channel = _.find(state.channels, item => item.uid === msg.uid)
|
let channel = _.find(state.channels, item => item.uid === d.uid)
|
||||||
if (channel) {
|
if (channel) {
|
||||||
channel.unread = msg.unread
|
channel.unread = d.unread
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
state.eventSource.addEventListener('new channel', evt => {
|
|
||||||
// eslint-disable-next-line
|
|
||||||
console.log(evt)
|
|
||||||
let msg = JSON.parse(evt.data)
|
|
||||||
let channel = _.find(state.channels, it => it.uid === msg.channel.uid)
|
|
||||||
if (!channel) {
|
|
||||||
state.channels.push(msg.channel)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
state.eventSource.addEventListener('update channel', evt => {
|
|
||||||
// eslint-disable-next-line
|
|
||||||
console.log(evt)
|
|
||||||
let msg = JSON.parse(evt.data)
|
|
||||||
let channel = _.find(state.channels, it => it.uid === msg.channel.uid)
|
|
||||||
if (channel) {
|
|
||||||
channel.name = msg.channel.name
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
state.eventSource.addEventListener('delete channel', evt => {
|
|
||||||
// eslint-disable-next-line
|
|
||||||
console.log(evt)
|
|
||||||
let msg = JSON.parse(evt.data)
|
|
||||||
state.channels = _.remove(state.channels, it => it.uid === msg.uid)
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -205,18 +178,12 @@ export default new Vuex.Store({
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
configQuery: function (key) {
|
fetchSyndicationTargets() {
|
||||||
let micropub = new Micropub({
|
let micropub = new Micropub({
|
||||||
token: this.state.access_token,
|
token: this.state.access_token,
|
||||||
micropubEndpoint: this.state.micropubEndpoint
|
micropubEndpoint: this.state.micropubEndpoint
|
||||||
})
|
})
|
||||||
return micropub.query(key)
|
return micropub.query('syndicate-to')
|
||||||
},
|
|
||||||
fetchSyndicationTargets() {
|
|
||||||
return this.configQuery('syndicate-to')
|
|
||||||
},
|
|
||||||
fetchDestinations() {
|
|
||||||
return this.configQuery('destination');
|
|
||||||
},
|
},
|
||||||
micropubPost(_, mf2post) {
|
micropubPost(_, mf2post) {
|
||||||
let micropub = new Micropub({
|
let micropub = new Micropub({
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user