whyis-fediverse 0.1.4__py3-none-any.whl → 0.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- whyis_fediverse/static/js/#new_post.js# +237 -0
- whyis_fediverse/static/js/comment.js +22 -8
- whyis_fediverse/static/js/discussion.js +8 -7
- whyis_fediverse/static/js/new_post.js +59 -8
- whyis_fediverse/static/js/post.js +11 -4
- whyis_fediverse/static/js/post_view.js +4 -4
- whyis_fediverse/static/js/selectable.js +41 -0
- whyis_fediverse/static/js/selectable.js~ +27 -0
- whyis_fediverse/static/js/selections.js +32 -0
- whyis_fediverse/static/js/selections.js~ +87 -0
- whyis_fediverse/templates/all_discussion.html +73 -0
- whyis_fediverse/templates/all_discussion.html~ +73 -0
- whyis_fediverse/templates/discussion.html +10 -0
- whyis_fediverse/templates/embed_image.html +1 -0
- whyis_fediverse/templates/embed_image.html~ +1 -0
- whyis_fediverse/templates/embed_object.html +1 -0
- whyis_fediverse/templates/embed_object.html~ +6 -0
- whyis_fediverse/templates/embed_resource.html +5 -0
- whyis_fediverse/templates/embed_resource.html~ +5 -0
- whyis_fediverse/templates/embed_video.html +6 -0
- whyis_fediverse/templates/embed_video.html~ +6 -0
- whyis_fediverse/templates/image_embed.html +3 -0
- whyis_fediverse/templates/image_embed.svg +3 -0
- whyis_fediverse/templates/object_data.json +9 -3
- whyis_fediverse/templates/object_view.html +10 -0
- whyis_fediverse/vocab.ttl +10 -0
- {whyis_fediverse-0.1.4.dist-info → whyis_fediverse-0.2.0.dist-info}/METADATA +1 -1
- whyis_fediverse-0.2.0.dist-info/RECORD +44 -0
- {whyis_fediverse-0.1.4.dist-info → whyis_fediverse-0.2.0.dist-info}/WHEEL +1 -1
- whyis_fediverse-0.1.4.dist-info/RECORD +0 -27
- {whyis_fediverse-0.1.4.dist-info → whyis_fediverse-0.2.0.dist-info}/LICENSE +0 -0
- {whyis_fediverse-0.1.4.dist-info → whyis_fediverse-0.2.0.dist-info}/entry_points.txt +0 -0
- {whyis_fediverse-0.1.4.dist-info → whyis_fediverse-0.2.0.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import {Vue, axios, createApp} from '../../../dist/whyis.js';
|
|
2
|
+
|
|
3
|
+
import post from './selections.js';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
function randomID() {
|
|
7
|
+
var result = Math.random().toString().replace('0.','');
|
|
8
|
+
console.log(result);
|
|
9
|
+
return result;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function newPost(uri) {
|
|
13
|
+
return {
|
|
14
|
+
"@context" : [
|
|
15
|
+
"https://www.w3.org/ns/activitystreams",
|
|
16
|
+
{
|
|
17
|
+
"np" : "http://www.nanopub.org/nschema#",
|
|
18
|
+
"schema" : "http://schema.org/"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"id" : uri,
|
|
22
|
+
"type" : "Note",
|
|
23
|
+
"attributedTo" : {
|
|
24
|
+
"id" : USER.uri,
|
|
25
|
+
"name" : USER.name
|
|
26
|
+
},
|
|
27
|
+
"to" : [],
|
|
28
|
+
"attachment" : [],
|
|
29
|
+
"content" : "",
|
|
30
|
+
"inReplyTo" : null,
|
|
31
|
+
"summary" : null,
|
|
32
|
+
"context" : null,
|
|
33
|
+
"published" : null,
|
|
34
|
+
"name" : null
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
async function uploadFiles(fileList, uri){
|
|
39
|
+
let distrData = new FormData();
|
|
40
|
+
let distrLDs = Array(fileList.length);
|
|
41
|
+
distrData.append('upload_type', 'http://purl.org/dc/dcmitype/Collection')
|
|
42
|
+
|
|
43
|
+
// append the files to FormData
|
|
44
|
+
Array
|
|
45
|
+
.from(Array(fileList.length).keys())
|
|
46
|
+
.map(function(x, idx) {
|
|
47
|
+
let new_file_name = (idx+1).toString();
|
|
48
|
+
let upload_name = fileList[x].name;
|
|
49
|
+
distrData.append(new_file_name, fileList[x], new_file_name);
|
|
50
|
+
distrLDs[x] = {
|
|
51
|
+
'id': `${uri}/${new_file_name}`,
|
|
52
|
+
"type": [],
|
|
53
|
+
'url': `${uri}/${new_file_name}`,
|
|
54
|
+
"mediaType": fileList[x].type,
|
|
55
|
+
'http://www.w3.org/2000/01/rdf-schema#label': fileList[x].name,
|
|
56
|
+
}
|
|
57
|
+
if (fileList[x].type.indexOf("image") > -1) {
|
|
58
|
+
distrLDs[x].type.push("Image");
|
|
59
|
+
distrLDs[x].type.push("schema:ImageObject");
|
|
60
|
+
} else if (fileList[x].type.indexOf("video") > -1) {
|
|
61
|
+
distrLDs[x].type.push("Video");
|
|
62
|
+
distrLDs[x].type.push("schema:VideoObject");
|
|
63
|
+
} else {
|
|
64
|
+
distrLDs[x].type.push("Document");
|
|
65
|
+
distrLDs[x].type.push("schema:DigitalDocument");
|
|
66
|
+
}
|
|
67
|
+
console.log(distrLDs[x]);
|
|
68
|
+
});
|
|
69
|
+
console.log(distrLDs);
|
|
70
|
+
|
|
71
|
+
const baseUrl = `${window.location.origin}/about?uri=${uri}`;
|
|
72
|
+
await axios.post( baseUrl,
|
|
73
|
+
distrData,
|
|
74
|
+
{
|
|
75
|
+
headers: {
|
|
76
|
+
'Content-Type': 'multipart/form-data',
|
|
77
|
+
},
|
|
78
|
+
}
|
|
79
|
+
)
|
|
80
|
+
return distrLDs;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export default Vue.component('fedi-new-post', {
|
|
84
|
+
name: "fedi-new-post",
|
|
85
|
+
props:{
|
|
86
|
+
entity: {
|
|
87
|
+
type: String,
|
|
88
|
+
require: false
|
|
89
|
+
},
|
|
90
|
+
inReplyTo: {
|
|
91
|
+
type: String,
|
|
92
|
+
require: false
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
inject : ['selection'],
|
|
96
|
+
data() {
|
|
97
|
+
let id = randomID();
|
|
98
|
+
let uri = `${LOD_PREFIX}/note/${id}`;
|
|
99
|
+
console.log(uri, id);
|
|
100
|
+
return {
|
|
101
|
+
user: USER,
|
|
102
|
+
otherArgs: null,
|
|
103
|
+
attachments: [],
|
|
104
|
+
embeds: {},
|
|
105
|
+
hovers: {},
|
|
106
|
+
id : id,
|
|
107
|
+
uri : uri,
|
|
108
|
+
post: newPost(uri),
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
template: `
|
|
112
|
+
<md-card>
|
|
113
|
+
<md-card-content>
|
|
114
|
+
<md-field>
|
|
115
|
+
<label>What's on your mind?</label>
|
|
116
|
+
<md-textarea v-on:keyup.enter.exact="sendPost()"
|
|
117
|
+
v-model="post.content"
|
|
118
|
+
md-autogrow>
|
|
119
|
+
</md-textarea>
|
|
120
|
+
<md-button class="md-icon-button" @click="sendPost()">
|
|
121
|
+
<md-icon md-size="small">send</md-icon>
|
|
122
|
+
</md-button>
|
|
123
|
+
</md-field>
|
|
124
|
+
<div style="position:relative"
|
|
125
|
+
v-for="item in selection"
|
|
126
|
+
v-bind:key="item"
|
|
127
|
+
v-on:mouseenter="hovers[item] = true"
|
|
128
|
+
v-on:mouseleave="hovers[item] = false" >
|
|
129
|
+
<div v-html="embeds[item]"></div>
|
|
130
|
+
<md-button style="position: absolute; right: 0; top: 0; "
|
|
131
|
+
class="md-icon-button md-raised md-mini"
|
|
132
|
+
v-on:click="unselect(item)">
|
|
133
|
+
<md-icon>delete</md-icon>
|
|
134
|
+
</md-button>
|
|
135
|
+
</div>
|
|
136
|
+
<md-field id="media_upload">
|
|
137
|
+
<label>Add media</label>
|
|
138
|
+
<md-file name="media_upload" ref="attachments" v-model="attachments" multiple />
|
|
139
|
+
</md-field>
|
|
140
|
+
</md-card-content>
|
|
141
|
+
</md-card>
|
|
142
|
+
`,
|
|
143
|
+
watch: {
|
|
144
|
+
selection: {
|
|
145
|
+
handler: function (val, oldVal) {
|
|
146
|
+
this.selection.forEach(this.getEmbed)
|
|
147
|
+
},
|
|
148
|
+
deep: true
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
components: {
|
|
152
|
+
},
|
|
153
|
+
methods: {
|
|
154
|
+
unselect : function (uri) {
|
|
155
|
+
if (this.selection.includes(uri)) {
|
|
156
|
+
var index = this.selection.indexOf(uri)
|
|
157
|
+
this.selection.splice(index, 1)
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
select : function (uri) {
|
|
161
|
+
if (!this.selection.includes(uri)) {
|
|
162
|
+
this.selection.push(uri)
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
async getEmbed(uri) {
|
|
166
|
+
console.log(uri)
|
|
167
|
+
if (this.embeds[uri] == null) {
|
|
168
|
+
this.embeds[uri] = "embeds_loading"
|
|
169
|
+
const result = await axios.get(`${ROOT_URL}about`,
|
|
170
|
+
{ params: {
|
|
171
|
+
view: "embed",
|
|
172
|
+
uri: uri,
|
|
173
|
+
}
|
|
174
|
+
})
|
|
175
|
+
this.embeds[uri] = result.data
|
|
176
|
+
this.$forceUpdate()
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
|
|
180
|
+
async loadPage() {
|
|
181
|
+
},
|
|
182
|
+
async scrollBottom () {
|
|
183
|
+
if (Math.ceil(window.innerHeight + window.scrollY) >= document.body.offsetHeight) {
|
|
184
|
+
console.log(this.post);
|
|
185
|
+
}
|
|
186
|
+
},
|
|
187
|
+
async sendPost() {
|
|
188
|
+
console.log(this.post);
|
|
189
|
+
console.log(this)
|
|
190
|
+
if (this.inReplyTo != null) {
|
|
191
|
+
this.post.inReplyTo = this.inReplyTo;
|
|
192
|
+
}
|
|
193
|
+
let now = new Date();
|
|
194
|
+
this.post.published = now.toISOString();
|
|
195
|
+
this.post.context = this.selection;
|
|
196
|
+
|
|
197
|
+
let attachments = this.$refs.attachments.$refs.inputFile.files;
|
|
198
|
+
let old_id = this.id;
|
|
199
|
+
let post = this.post;
|
|
200
|
+
|
|
201
|
+
this.id = randomID();
|
|
202
|
+
this.uri = `${LOD_PREFIX}/note/${this.id}`;
|
|
203
|
+
this.post = newPost(this.uri);
|
|
204
|
+
this.attachments = null;
|
|
205
|
+
|
|
206
|
+
if (attachments.length >0) {
|
|
207
|
+
const collectionURI = `${LOD_PREFIX}/media/${old_id}`;
|
|
208
|
+
console.log(collectionURI);
|
|
209
|
+
post.attachment = await uploadFiles(attachments,
|
|
210
|
+
collectionURI);
|
|
211
|
+
}
|
|
212
|
+
console.log(post);
|
|
213
|
+
let metadata = JSON.stringify(post);
|
|
214
|
+
const baseUrl = `${window.location.origin}/pub`;
|
|
215
|
+
|
|
216
|
+
await axios.post( baseUrl, metadata, {
|
|
217
|
+
headers: {
|
|
218
|
+
'Content-Type': 'application/ld+json'
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
this.selection.length = 0;
|
|
222
|
+
if (this.inReplyTo == null) {
|
|
223
|
+
window.location.href = `${window.location.origin}/about?uri=${post.id}`;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
},
|
|
227
|
+
async mounted (){
|
|
228
|
+
if (this.entity != null && this.inReplyTo == null) {
|
|
229
|
+
this.select(this.entity)
|
|
230
|
+
}
|
|
231
|
+
this.selection.forEach(this.getEmbed)
|
|
232
|
+
},
|
|
233
|
+
async unmounted() {
|
|
234
|
+
},
|
|
235
|
+
created(){
|
|
236
|
+
}
|
|
237
|
+
})
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import dayjs from '//unpkg.com/dayjs@1.11.13/esm';
|
|
2
2
|
import relativeTime from '//unpkg.com/dayjs@1.11.13/esm/plugin/relativeTime';
|
|
3
3
|
dayjs.extend(relativeTime);
|
|
4
|
+
|
|
5
|
+
import selectable from './selectable.js';
|
|
6
|
+
|
|
4
7
|
import {Vue, axios, createApp} from '../../../dist/whyis.js';
|
|
8
|
+
|
|
5
9
|
export default Vue.component('fedi-comment', {
|
|
6
10
|
name: "fedi-comment",
|
|
7
11
|
props:{
|
|
@@ -25,16 +29,26 @@ export default Vue.component('fedi-comment', {
|
|
|
25
29
|
},
|
|
26
30
|
template: `
|
|
27
31
|
<md-content style="margin-top:1.5em">
|
|
28
|
-
<div
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
<strong>{{value.attributedTo.name}}</strong>
|
|
32
|
-
</small>
|
|
33
|
-
</a>
|
|
34
|
-
<div v-html="value.content"></div>
|
|
32
|
+
<div v-if="value.attachment != null && value.attachment.length != 0">
|
|
33
|
+
<fedi-selectable v-bind:uri="a.id" v-for="a in value.attachment" v-bind:key="a.id" v-html="a.embed">
|
|
34
|
+
</fedi-selectable>
|
|
35
35
|
</div>
|
|
36
36
|
<div v-if="value.attachment != null && value.attachment.length != 0">
|
|
37
|
-
<
|
|
37
|
+
<fedi-selectable v-bind:uri="a.id" v-for="a in value.context" v-bind:key="a.id" v-html="a.embed">
|
|
38
|
+
</fedi-selectable>
|
|
39
|
+
</div>
|
|
40
|
+
<div v-if="value.context != null && value.context.length != 0">
|
|
41
|
+
<img style="" v-for="image in value.context" :src="image.url" :alt="image.url">
|
|
42
|
+
</div>
|
|
43
|
+
<div style="width:fit-content; margin-top:0.5em; border-radius:1em; padding-left:0.75em; padding-right:0.75em; background-color:lightgray">
|
|
44
|
+
<small>
|
|
45
|
+
<a :href="value.attributedTo.view">
|
|
46
|
+
<strong>{{value.attributedTo.name}}</strong>
|
|
47
|
+
(@{{value.attributedTo.id.split('/').pop()}})
|
|
48
|
+
{{published}}
|
|
49
|
+
</a>
|
|
50
|
+
</small>
|
|
51
|
+
<div v-html="value.content"></div>
|
|
38
52
|
</div>
|
|
39
53
|
</md-content>
|
|
40
54
|
`,
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import {Vue, axios, createApp} from '../../../dist/whyis.js';
|
|
2
2
|
import post from './post.js';
|
|
3
3
|
import newPost from './new_post.js';
|
|
4
|
+
import selections from './selections.js';
|
|
4
5
|
|
|
5
6
|
export default Vue.component('fedi-discussion', {
|
|
6
7
|
name: "fedi-discussion",
|
|
7
8
|
props:{
|
|
8
9
|
entity: {
|
|
9
10
|
type: String,
|
|
10
|
-
require:
|
|
11
|
+
require: false
|
|
11
12
|
}
|
|
12
13
|
},
|
|
13
14
|
data() {
|
|
@@ -16,24 +17,24 @@ export default Vue.component('fedi-discussion', {
|
|
|
16
17
|
loading: false,
|
|
17
18
|
loadError: false,
|
|
18
19
|
otherArgs: null,
|
|
19
|
-
pageSize: 20
|
|
20
|
+
pageSize: 20
|
|
20
21
|
}
|
|
21
22
|
},
|
|
22
23
|
template: `
|
|
23
|
-
<
|
|
24
|
+
<fedi-selection >
|
|
24
25
|
<spinner :loading="loading" text='Loading...' v-if="loading"/>
|
|
25
|
-
<div v-else>
|
|
26
|
-
<fedi-new-post style="margin-top:0.5em; border-radius:0.5em"
|
|
26
|
+
<div v-else class="mgcontainer">
|
|
27
|
+
<fedi-new-post style="width:40em; margin-top:0.5em; border-radius:0.5em"
|
|
27
28
|
:entity="entity">
|
|
28
29
|
</fedi-new-post>
|
|
29
|
-
<fedi-post
|
|
30
|
+
<fedi-post style="width:40em; margin-top:0.5em; border-radius:0.5em"
|
|
30
31
|
v-for="(post, index) in results"
|
|
31
32
|
:key="post.id"
|
|
32
33
|
:entity="entity"
|
|
33
34
|
v-bind:value="post">
|
|
34
35
|
</fedi-post>
|
|
35
36
|
</div>
|
|
36
|
-
</
|
|
37
|
+
</fedi-selection>`,
|
|
37
38
|
watch: {
|
|
38
39
|
},
|
|
39
40
|
components: {
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import {Vue, axios, createApp} from '../../../dist/whyis.js';
|
|
2
2
|
|
|
3
|
+
import post from './selections.js';
|
|
4
|
+
|
|
5
|
+
|
|
3
6
|
function randomID() {
|
|
4
7
|
var result = Math.random().toString().replace('0.','');
|
|
5
8
|
console.log(result);
|
|
@@ -40,8 +43,8 @@ async function uploadFiles(fileList, uri){
|
|
|
40
43
|
// append the files to FormData
|
|
41
44
|
Array
|
|
42
45
|
.from(Array(fileList.length).keys())
|
|
43
|
-
.map(x
|
|
44
|
-
let new_file_name =
|
|
46
|
+
.map(function(x, idx) {
|
|
47
|
+
let new_file_name = (idx+1).toString();
|
|
45
48
|
let upload_name = fileList[x].name;
|
|
46
49
|
distrData.append(new_file_name, fileList[x], new_file_name);
|
|
47
50
|
distrLDs[x] = {
|
|
@@ -89,6 +92,7 @@ export default Vue.component('fedi-new-post', {
|
|
|
89
92
|
require: false
|
|
90
93
|
}
|
|
91
94
|
},
|
|
95
|
+
inject : ['selection'],
|
|
92
96
|
data() {
|
|
93
97
|
let id = randomID();
|
|
94
98
|
let uri = `${LOD_PREFIX}/note/${id}`;
|
|
@@ -97,6 +101,8 @@ export default Vue.component('fedi-new-post', {
|
|
|
97
101
|
user: USER,
|
|
98
102
|
otherArgs: null,
|
|
99
103
|
attachments: [],
|
|
104
|
+
embeds: {},
|
|
105
|
+
hovers: {},
|
|
100
106
|
id : id,
|
|
101
107
|
uri : uri,
|
|
102
108
|
post: newPost(uri),
|
|
@@ -115,18 +121,62 @@ export default Vue.component('fedi-new-post', {
|
|
|
115
121
|
<md-icon md-size="small">send</md-icon>
|
|
116
122
|
</md-button>
|
|
117
123
|
</md-field>
|
|
124
|
+
<div style="position:relative"
|
|
125
|
+
v-for="item in selection"
|
|
126
|
+
v-bind:key="item"
|
|
127
|
+
v-on:mouseenter="hovers[item] = true"
|
|
128
|
+
v-on:mouseleave="hovers[item] = false" >
|
|
129
|
+
<div v-html="embeds[item]"></div>
|
|
130
|
+
<md-button style="position: absolute; right: 0; top: 0; "
|
|
131
|
+
class="md-icon-button md-raised md-mini"
|
|
132
|
+
v-on:click="unselect(item)">
|
|
133
|
+
<md-icon>delete</md-icon>
|
|
134
|
+
</md-button>
|
|
135
|
+
</div>
|
|
118
136
|
<md-field id="media_upload">
|
|
119
137
|
<label>Add media</label>
|
|
120
|
-
<md-file ref="attachments" v-model="attachments" multiple />
|
|
138
|
+
<md-file name="media_upload" ref="attachments" v-model="attachments" multiple />
|
|
121
139
|
</md-field>
|
|
122
140
|
</md-card-content>
|
|
123
141
|
</md-card>
|
|
124
142
|
`,
|
|
125
143
|
watch: {
|
|
144
|
+
selection: {
|
|
145
|
+
handler: function (val, oldVal) {
|
|
146
|
+
this.selection.forEach(this.getEmbed)
|
|
147
|
+
},
|
|
148
|
+
deep: true
|
|
149
|
+
}
|
|
126
150
|
},
|
|
127
151
|
components: {
|
|
128
152
|
},
|
|
129
153
|
methods: {
|
|
154
|
+
unselect : function (uri) {
|
|
155
|
+
if (this.selection.includes(uri)) {
|
|
156
|
+
var index = this.selection.indexOf(uri)
|
|
157
|
+
this.selection.splice(index, 1)
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
select : function (uri) {
|
|
161
|
+
if (!this.selection.includes(uri)) {
|
|
162
|
+
this.selection.push(uri)
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
async getEmbed(uri) {
|
|
166
|
+
console.log(uri)
|
|
167
|
+
if (this.embeds[uri] == null) {
|
|
168
|
+
this.embeds[uri] = "embeds_loading"
|
|
169
|
+
const result = await axios.get(`${ROOT_URL}about`,
|
|
170
|
+
{ params: {
|
|
171
|
+
view: "embed",
|
|
172
|
+
uri: uri,
|
|
173
|
+
}
|
|
174
|
+
})
|
|
175
|
+
this.embeds[uri] = result.data
|
|
176
|
+
this.$forceUpdate()
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
|
|
130
180
|
async loadPage() {
|
|
131
181
|
},
|
|
132
182
|
async scrollBottom () {
|
|
@@ -140,11 +190,9 @@ export default Vue.component('fedi-new-post', {
|
|
|
140
190
|
if (this.inReplyTo != null) {
|
|
141
191
|
this.post.inReplyTo = this.inReplyTo;
|
|
142
192
|
}
|
|
143
|
-
if (this.entity != null) {
|
|
144
|
-
this.post.context = this.entity;
|
|
145
|
-
}
|
|
146
193
|
let now = new Date();
|
|
147
194
|
this.post.published = now.toISOString();
|
|
195
|
+
this.post.context = this.selection;
|
|
148
196
|
|
|
149
197
|
let attachments = this.$refs.attachments.$refs.inputFile.files;
|
|
150
198
|
let old_id = this.id;
|
|
@@ -170,14 +218,17 @@ export default Vue.component('fedi-new-post', {
|
|
|
170
218
|
'Content-Type': 'application/ld+json'
|
|
171
219
|
}
|
|
172
220
|
});
|
|
173
|
-
|
|
221
|
+
//this.selection.length = 0;
|
|
174
222
|
if (this.inReplyTo == null) {
|
|
175
223
|
window.location.href = `${window.location.origin}/about?uri=${post.id}`;
|
|
176
224
|
}
|
|
177
225
|
}
|
|
178
226
|
},
|
|
179
227
|
async mounted (){
|
|
180
|
-
|
|
228
|
+
if (this.entity != null && this.inReplyTo == null) {
|
|
229
|
+
this.select(this.entity)
|
|
230
|
+
}
|
|
231
|
+
this.selection.forEach(this.getEmbed)
|
|
181
232
|
},
|
|
182
233
|
async unmounted() {
|
|
183
234
|
},
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import dayjs from '//unpkg.com/dayjs@1.11.13/esm';
|
|
2
2
|
import relativeTime from '//unpkg.com/dayjs@1.11.13/esm/plugin/relativeTime';
|
|
3
3
|
dayjs.extend(relativeTime);
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
import selectable from './selectable.js';
|
|
7
|
+
|
|
4
8
|
import {Vue, axios, createApp} from '../../../dist/whyis.js';
|
|
5
9
|
export default Vue.component('fedi-post', {
|
|
6
10
|
name: "fedi-post",
|
|
@@ -28,19 +32,22 @@ export default Vue.component('fedi-post', {
|
|
|
28
32
|
<md-card-header>
|
|
29
33
|
<md-card-header-text>
|
|
30
34
|
<div class="md-subhead">
|
|
31
|
-
<a :href="value.attributedTo.
|
|
35
|
+
<a :href="value.attributedTo.view">
|
|
32
36
|
<md-avatar class="md-avatar-icon">{{value.attributedTo.name[0]}}</md-avatar>
|
|
33
37
|
<strong>{{value.attributedTo.name}}</strong> <small>(@{{value.attributedTo.id.split('/').pop()}})</small>
|
|
34
38
|
</a>
|
|
35
39
|
<br/>
|
|
36
|
-
<small><a :href="value.
|
|
40
|
+
<small><a :href="value.view">{{published}}</a></small>
|
|
37
41
|
</div>
|
|
38
42
|
<div class="md-title" v-if="value.name"><a :href="value.id">{{value.name}}</a></div>
|
|
39
43
|
</md-card-header-text>
|
|
40
44
|
</md-card-header>
|
|
41
45
|
<md-card-content v-html="value.content"></md-card-content>
|
|
42
|
-
<md-card-media v-if="value.attachment != null && value.attachment.length != 0">
|
|
43
|
-
<
|
|
46
|
+
<md-card-media v-if="(value.attachment != null && value.attachment.length != 0) || (value.context != null && value.context.length != 0)">
|
|
47
|
+
<fedi-selectable v-bind:uri="a.id" v-for="a in value.attachment" v-bind:key="a.id" v-html="a.embed">
|
|
48
|
+
</fedi-selectable>
|
|
49
|
+
<fedi-selectable v-bind:uri="a.id" v-for="a in value.context" v-bind:key="a.id" v-html="a.embed">
|
|
50
|
+
</fedi-selectable>
|
|
44
51
|
</md-card-media>
|
|
45
52
|
</md-card>
|
|
46
53
|
`,
|
|
@@ -2,6 +2,7 @@ import {Vue, axios, createApp} from '../../../dist/whyis.js';
|
|
|
2
2
|
import post from './post.js';
|
|
3
3
|
import comment from './comment.js';
|
|
4
4
|
import newPost from './new_post.js';
|
|
5
|
+
import selections from './selections.js';
|
|
5
6
|
|
|
6
7
|
export default Vue.component('fedi-post-view', {
|
|
7
8
|
name: "fedi-post-view",
|
|
@@ -21,7 +22,7 @@ export default Vue.component('fedi-post-view', {
|
|
|
21
22
|
}
|
|
22
23
|
},
|
|
23
24
|
template: `
|
|
24
|
-
<
|
|
25
|
+
<fedi-selection>
|
|
25
26
|
<spinner :loading="loading" text='Loading...' v-if="loading"/>
|
|
26
27
|
<div v-else class="md-layout md-gutter">
|
|
27
28
|
<div class="md-layout-item md-scrollbar">
|
|
@@ -44,12 +45,11 @@ export default Vue.component('fedi-post-view', {
|
|
|
44
45
|
</fedi-comment>
|
|
45
46
|
</div>
|
|
46
47
|
<fedi-new-post v-if="post != null"
|
|
47
|
-
:inReplyTo="post.id"
|
|
48
|
-
:entity="post.context">
|
|
48
|
+
:inReplyTo="post.id">
|
|
49
49
|
</fedi-new-post>
|
|
50
50
|
</div>
|
|
51
51
|
</div>
|
|
52
|
-
</
|
|
52
|
+
</fedi-selection>`,
|
|
53
53
|
watch: {
|
|
54
54
|
},
|
|
55
55
|
components: {
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import {Vue, axios, createApp} from '../../../dist/whyis.js';
|
|
2
|
+
|
|
3
|
+
export default Vue.component('fedi-selectable', {
|
|
4
|
+
name: "fedi-selectable",
|
|
5
|
+
props : {
|
|
6
|
+
"uri": String
|
|
7
|
+
},
|
|
8
|
+
inject : ['selection'],
|
|
9
|
+
data : function() {
|
|
10
|
+
return {
|
|
11
|
+
"hover" : false,
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
template : `
|
|
15
|
+
<div style="margin: 0.5rem"
|
|
16
|
+
v-on:click="toggle()"
|
|
17
|
+
v-on:mouseenter="hover=true"
|
|
18
|
+
v-on:mouseleave="hover=false"
|
|
19
|
+
v-bind:class="{ selected: selected, hover: hover }" >
|
|
20
|
+
<slot></slot>
|
|
21
|
+
</div>
|
|
22
|
+
`,
|
|
23
|
+
computed : {
|
|
24
|
+
selected : function() {
|
|
25
|
+
return this.selection.includes(this.uri)
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
methods: {
|
|
29
|
+
toggle: function () {
|
|
30
|
+
console.log("toggle",this.uri);
|
|
31
|
+
console.log(this.selection)
|
|
32
|
+
console.log(this.selection.includes(this.uri))
|
|
33
|
+
if (this.selection.includes(this.uri)) {
|
|
34
|
+
var index = this.selection.indexOf(this.uri)
|
|
35
|
+
this.selection.splice(index, 1)
|
|
36
|
+
} else {
|
|
37
|
+
this.selection.push(this.uri)
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
})
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import {Vue, axios, createApp} from '../../../dist/whyis.js';
|
|
2
|
+
export default Vue.component('selector', {
|
|
3
|
+
name: "selector",
|
|
4
|
+
props:{
|
|
5
|
+
},
|
|
6
|
+
data: {
|
|
7
|
+
selection: {
|
|
8
|
+
"selected" : []
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
provide() {
|
|
12
|
+
return {
|
|
13
|
+
selection: this.selection ,
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
template: `
|
|
17
|
+
<div><slot></slot></div>
|
|
18
|
+
`,
|
|
19
|
+
watch: {
|
|
20
|
+
},
|
|
21
|
+
components: {
|
|
22
|
+
},
|
|
23
|
+
computed: {
|
|
24
|
+
},
|
|
25
|
+
methods: {
|
|
26
|
+
},
|
|
27
|
+
})
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import dayjs from '//unpkg.com/dayjs@1.11.13/esm';
|
|
2
|
+
import {Vue, axios, createApp} from '../../../dist/whyis.js';
|
|
3
|
+
|
|
4
|
+
export default Vue.component('fedi-selection', {
|
|
5
|
+
name: "fedi-selection",
|
|
6
|
+
data() {
|
|
7
|
+
return {
|
|
8
|
+
selected: []
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
template: `
|
|
12
|
+
<div>
|
|
13
|
+
<slot></slot>
|
|
14
|
+
</div>
|
|
15
|
+
`,
|
|
16
|
+
provide () {
|
|
17
|
+
return { selection : this.selected }
|
|
18
|
+
},
|
|
19
|
+
methods: {
|
|
20
|
+
add(item) {
|
|
21
|
+
if (!this.selected.includes(item))
|
|
22
|
+
this.selected.push(item);
|
|
23
|
+
},
|
|
24
|
+
remove(item) {
|
|
25
|
+
var idx = myArray.indexOf(item)
|
|
26
|
+
if (idx >= 0) this.selected.splice(idx, 1)
|
|
27
|
+
},
|
|
28
|
+
reset() {
|
|
29
|
+
this.selected.length = 0
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
})
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import dayjs from '//unpkg.com/dayjs@1.11.13/esm';
|
|
2
|
+
import relativeTime from '//unpkg.com/dayjs@1.11.13/esm/plugin/relativeTime';
|
|
3
|
+
dayjs.extend(relativeTime);
|
|
4
|
+
import {Vue, axios, createApp} from '../../../dist/whyis.js';
|
|
5
|
+
export default Vue.component('fedi-comment', {
|
|
6
|
+
name: "fedi-comment",
|
|
7
|
+
props:{
|
|
8
|
+
value: {
|
|
9
|
+
type: Object,
|
|
10
|
+
require: true
|
|
11
|
+
},
|
|
12
|
+
expanded: {
|
|
13
|
+
type: Boolean,
|
|
14
|
+
default: false
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
data() {
|
|
18
|
+
return {
|
|
19
|
+
replies: [],
|
|
20
|
+
loading: false,
|
|
21
|
+
loadError: false,
|
|
22
|
+
otherArgs: null,
|
|
23
|
+
pageSize: 20,
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
template: `
|
|
27
|
+
<md-content style="margin-top:1.5em">
|
|
28
|
+
<div v-if="value.attachment != null && value.attachment.length != 0">
|
|
29
|
+
<img style="" v-for="image in value.attachment" :src="image.url" :alt="image.url">
|
|
30
|
+
</div>
|
|
31
|
+
<div style="width:fit-content; margin-top:0.5em; border-radius:1em; padding-left:0.75em; padding-right:0.75em; background-color:lightgray">
|
|
32
|
+
<small>
|
|
33
|
+
<a :href="value.attributedTo.view">
|
|
34
|
+
<strong>{{value.attributedTo.name}}</strong>
|
|
35
|
+
(@{{value.attributedTo.id.split('/').pop()}})
|
|
36
|
+
{{published}}
|
|
37
|
+
</a>
|
|
38
|
+
</small>
|
|
39
|
+
<div v-html="value.content"></div>
|
|
40
|
+
</div>
|
|
41
|
+
</md-content>
|
|
42
|
+
`,
|
|
43
|
+
watch: {
|
|
44
|
+
},
|
|
45
|
+
components: {
|
|
46
|
+
},
|
|
47
|
+
computed: {
|
|
48
|
+
published: function() {
|
|
49
|
+
return dayjs(this.value.published).fromNow();
|
|
50
|
+
},
|
|
51
|
+
// a computed getter
|
|
52
|
+
images: function () {
|
|
53
|
+
console.log(this.value.attachment);
|
|
54
|
+
// `this` points to the vm instance
|
|
55
|
+
let result = this.value.attachment.filter(function(x) {x.type.indexOf('Image') >= 0});
|
|
56
|
+
console.log(result);
|
|
57
|
+
return result;
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
methods: {
|
|
61
|
+
async loadPage() {
|
|
62
|
+
// non-page sized results means we've reached the end.
|
|
63
|
+
if (this.results.length % this.pageSize > 0)
|
|
64
|
+
return
|
|
65
|
+
const result = await axios.get(`${ROOT_URL}about`,
|
|
66
|
+
{ params: {
|
|
67
|
+
view: "comments",
|
|
68
|
+
uri: this.entity,
|
|
69
|
+
limit: this.pageSize,
|
|
70
|
+
offset: this.results.length
|
|
71
|
+
}
|
|
72
|
+
})
|
|
73
|
+
this.results.push(...result.data)
|
|
74
|
+
},
|
|
75
|
+
async scrollBottom () {
|
|
76
|
+
if (Math.ceil(window.innerHeight + window.scrollY) >= document.body.offsetHeight) {
|
|
77
|
+
await this.loadPage()
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
async mounted (){
|
|
82
|
+
},
|
|
83
|
+
async unmounted() {
|
|
84
|
+
},
|
|
85
|
+
created(){
|
|
86
|
+
}
|
|
87
|
+
})
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
{% extends "base_vue.html" %}
|
|
2
|
+
{% from "elements/upload.html" import vue_upload_button_tab_modal %}
|
|
3
|
+
{% from "_macros.html" import render_resource_link, render_rdfa_resource_link, get_label, facts_panel, summary_panel, content %}
|
|
4
|
+
{% block title %}{{get_label(this.description())}}{% endblock %}
|
|
5
|
+
{% block styles %}
|
|
6
|
+
<style>
|
|
7
|
+
.hover {
|
|
8
|
+
filter: drop-shadow(gray 0 0 0.5rem);
|
|
9
|
+
}
|
|
10
|
+
.selected {
|
|
11
|
+
filter: drop-shadow(blue 0 0 0.5rem);
|
|
12
|
+
}
|
|
13
|
+
</style>
|
|
14
|
+
{% endblock %}
|
|
15
|
+
{% block scripts %}
|
|
16
|
+
<script type="module" src="{{ url_for('static',filename='plugins/fediverse/js/discussion.js')}}"></script>
|
|
17
|
+
|
|
18
|
+
{% endblock %}
|
|
19
|
+
{% block content %}
|
|
20
|
+
{% set attributes = this | include("attributes") | fromjson %}
|
|
21
|
+
|
|
22
|
+
<md-card-header>
|
|
23
|
+
<md-card-header-text>
|
|
24
|
+
<ul class="nav nav-tabs">
|
|
25
|
+
{% for v in this | get_views_list -%}
|
|
26
|
+
<li class="nav-item {% if v['view'].value == view %}active{% endif %}">
|
|
27
|
+
<a class="nav-link {% if v['view'].value == view %}active{% endif %}"
|
|
28
|
+
href="{{url_for('entity.view', uri=this.identifier, view=v['view'])}}">
|
|
29
|
+
{{v['label']}}
|
|
30
|
+
</a>
|
|
31
|
+
</li>
|
|
32
|
+
{%- endfor %}
|
|
33
|
+
{% if this.description().value(ns.whyis.hasFileID) %}
|
|
34
|
+
<li class="nav-item">
|
|
35
|
+
<a class="nav-link"
|
|
36
|
+
href="{{url_for('entity.view',uri=this.identifier)}}">
|
|
37
|
+
Download
|
|
38
|
+
</a>
|
|
39
|
+
</li>
|
|
40
|
+
{% endif %}
|
|
41
|
+
<li class="nav-item">
|
|
42
|
+
{{ vue_upload_button_tab_modal(this) }}
|
|
43
|
+
</li>
|
|
44
|
+
{% if not this.identifier.startswith(ns.local) %}
|
|
45
|
+
<li class="nav-item">
|
|
46
|
+
<a class="nav-link" href="{{this.identifier}}"
|
|
47
|
+
aria-label="Visit Page" title="Visit Page">
|
|
48
|
+
Visit
|
|
49
|
+
</a>
|
|
50
|
+
</li>
|
|
51
|
+
{% endif %}
|
|
52
|
+
</ul>
|
|
53
|
+
<div class="md-layout md-gutter md-alignment-center-left" style = "margin-top: 6px;">
|
|
54
|
+
<div class = "md-layout-item">
|
|
55
|
+
<div class="md-title">{{attributes.label}}</div>
|
|
56
|
+
{% if attributes.type | length > 0 %}<div class="md-subhead" style="max-width: fit-content;">
|
|
57
|
+
{% for type in attributes.type %}{{type.label}}{% if not loop.last %}, {% endif %} {% endfor %}
|
|
58
|
+
</div>{% endif %}
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
</md-card-header-text>
|
|
62
|
+
{% if attributes.thumbnail %}<md-card-media md-big >
|
|
63
|
+
<img src="{{url_for('entity.view', uri=attributes.thumbnail)}}" alt="{{attributes.label}}"/>
|
|
64
|
+
</md-card-media>{% endif %}
|
|
65
|
+
</md-card-header>
|
|
66
|
+
<md-card-content>
|
|
67
|
+
<div class="md-layout md-gutter">
|
|
68
|
+
<div class="md-layout-item">
|
|
69
|
+
<fedi-discussion></fedi-discussion>
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
72
|
+
</md-card-content>
|
|
73
|
+
{% endblock %}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
{% extends "base_vue.html" %}
|
|
2
|
+
{% from "elements/upload.html" import vue_upload_button_tab_modal %}
|
|
3
|
+
{% from "_macros.html" import render_resource_link, render_rdfa_resource_link, get_label, facts_panel, summary_panel, content %}
|
|
4
|
+
{% block title %}{{get_label(this.description())}}{% endblock %}
|
|
5
|
+
{% block styles %}
|
|
6
|
+
<style>
|
|
7
|
+
.hover {
|
|
8
|
+
filter: drop-shadow(gray 0 0 0.5rem);
|
|
9
|
+
}
|
|
10
|
+
.selected {
|
|
11
|
+
filter: drop-shadow(blue 0 0 0.5rem);
|
|
12
|
+
}
|
|
13
|
+
</style>
|
|
14
|
+
{% endblock %}
|
|
15
|
+
{% block scripts %}
|
|
16
|
+
<script type="module" src="{{ url_for('static',filename='plugins/fediverse/js/discussion.js')}}"></script>
|
|
17
|
+
|
|
18
|
+
{% endblock %}
|
|
19
|
+
{% block content %}
|
|
20
|
+
{% set attributes = this | include("attributes") | fromjson %}
|
|
21
|
+
|
|
22
|
+
<md-card-header>
|
|
23
|
+
<md-card-header-text>
|
|
24
|
+
<ul class="nav nav-tabs">
|
|
25
|
+
{% for v in this | get_views_list -%}
|
|
26
|
+
<li class="nav-item {% if v['view'].value == view %}active{% endif %}">
|
|
27
|
+
<a class="nav-link {% if v['view'].value == view %}active{% endif %}"
|
|
28
|
+
href="{{url_for('entity.view', uri=this.identifier, view=v['view'])}}">
|
|
29
|
+
{{v['label']}}
|
|
30
|
+
</a>
|
|
31
|
+
</li>
|
|
32
|
+
{%- endfor %}
|
|
33
|
+
{% if this.description().value(ns.whyis.hasFileID) %}
|
|
34
|
+
<li class="nav-item">
|
|
35
|
+
<a class="nav-link"
|
|
36
|
+
href="{{url_for('entity.view',uri=this.identifier)}}">
|
|
37
|
+
Download
|
|
38
|
+
</a>
|
|
39
|
+
</li>
|
|
40
|
+
{% endif %}
|
|
41
|
+
<li class="nav-item">
|
|
42
|
+
{{ vue_upload_button_tab_modal(this) }}
|
|
43
|
+
</li>
|
|
44
|
+
{% if not this.identifier.startswith(ns.local) %}
|
|
45
|
+
<li class="nav-item">
|
|
46
|
+
<a class="nav-link" href="{{this.identifier}}"
|
|
47
|
+
aria-label="Visit Page" title="Visit Page">
|
|
48
|
+
Visit
|
|
49
|
+
</a>
|
|
50
|
+
</li>
|
|
51
|
+
{% endif %}
|
|
52
|
+
</ul>
|
|
53
|
+
<div class="md-layout md-gutter md-alignment-center-left" style = "margin-top: 6px;">
|
|
54
|
+
<div class = "md-layout-item">
|
|
55
|
+
<div class="md-title">{{attributes.label}}</div>
|
|
56
|
+
{% if attributes.type | length > 0 %}<div class="md-subhead" style="max-width: fit-content;">
|
|
57
|
+
{% for type in attributes.type %}{{type.label}}{% if not loop.last %}, {% endif %} {% endfor %}
|
|
58
|
+
</div>{% endif %}
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
</md-card-header-text>
|
|
62
|
+
{% if attributes.thumbnail %}<md-card-media md-big >
|
|
63
|
+
<img src="{{url_for('entity.view', uri=attributes.thumbnail)}}" alt="{{attributes.label}}"/>
|
|
64
|
+
</md-card-media>{% endif %}
|
|
65
|
+
</md-card-header>
|
|
66
|
+
<md-card-content>
|
|
67
|
+
<div class="md-layout md-gutter">
|
|
68
|
+
<div class="md-layout-item">
|
|
69
|
+
<fedi-discussion entity="{{this.identifier}}"></fedi-discussion>
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
72
|
+
</md-card-content>
|
|
73
|
+
{% endblock %}
|
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
{% from "elements/upload.html" import vue_upload_button_tab_modal %}
|
|
3
3
|
{% from "_macros.html" import render_resource_link, render_rdfa_resource_link, get_label, facts_panel, summary_panel, content %}
|
|
4
4
|
{% block title %}{{get_label(this.description())}}{% endblock %}
|
|
5
|
+
{% block styles %}
|
|
6
|
+
<style>
|
|
7
|
+
.hover {
|
|
8
|
+
filter: drop-shadow(gray 0 0 0.5rem);
|
|
9
|
+
}
|
|
10
|
+
.selected {
|
|
11
|
+
filter: drop-shadow(blue 0 0 0.5rem);
|
|
12
|
+
}
|
|
13
|
+
</style>
|
|
14
|
+
{% endblock %}
|
|
5
15
|
{% block scripts %}
|
|
6
16
|
<script type="module" src="{{ url_for('static',filename='plugins/fediverse/js/discussion.js')}}"></script>
|
|
7
17
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<img src="{{url_for('entity.view', uri=this.identifier)}}", alt="{{g.get_label(this)}}">
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<img src="{{url_for('this.view', uri=this.identifier)}}", alt="{{g.get_label(this.identifier)}}">
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{{this.value(app.NS.astr.content).value|markdown|safe}}
|
|
@@ -23,6 +23,13 @@
|
|
|
23
23
|
{%- endfor %}
|
|
24
24
|
],
|
|
25
25
|
{%- endif %}
|
|
26
|
+
{%- if element.value(app.NS.astr.context) %}
|
|
27
|
+
"context" : [
|
|
28
|
+
{% for o in element[app.NS.astr.context] -%}
|
|
29
|
+
{{object(o)}}{% if not loop.last %}, {% endif %}
|
|
30
|
+
{%- endfor %}
|
|
31
|
+
],
|
|
32
|
+
{%- endif %}
|
|
26
33
|
"replies" : [
|
|
27
34
|
{% for o in app.db.subjects(app.NS.astr.inReplyTo, element.identifier) -%}
|
|
28
35
|
"{{o}}"{% if not loop.last %}, {% endif %}
|
|
@@ -44,15 +51,14 @@
|
|
|
44
51
|
{%- else %}
|
|
45
52
|
"url" : "{{element.identifier }}",
|
|
46
53
|
{%- endif %}
|
|
54
|
+
"view" : "{{url_for('entity.view', view='view', uri=element.identifier)}}",
|
|
55
|
+
"embed" : {{ element.identifier | include('embed') |tojson| safe }},
|
|
47
56
|
{%- if element.value(app.NS.astr.actor) %}
|
|
48
57
|
"actor" : "{{element.value(app.NS.astr.actor).identifier }}",
|
|
49
58
|
{%- endif %}
|
|
50
59
|
{%- if element.value(app.NS.astr.object) %}
|
|
51
60
|
"object" : "{{element.value(app.NS.astr.object).identifier }}",
|
|
52
61
|
{%- endif %}
|
|
53
|
-
{%- if element.value(app.NS.astr.context) %}
|
|
54
|
-
"context" : "{{element.value(app.NS.astr.context).identifier }}",
|
|
55
|
-
{%- endif %}
|
|
56
62
|
{%- if element.value(app.NS.astr.inReplyTo) %}
|
|
57
63
|
"inReplyTo" : "{{element.value(app.NS.astr.inReplyTo).identifier }}",
|
|
58
64
|
{%- endif %}
|
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
{% from "elements/upload.html" import vue_upload_button_tab_modal %}
|
|
3
3
|
{% from "_macros.html" import render_resource_link, render_rdfa_resource_link, get_label, facts_panel, summary_panel, content %}
|
|
4
4
|
{% block title %}{% endblock %}
|
|
5
|
+
{% block styles %}
|
|
6
|
+
<style>
|
|
7
|
+
.hover {
|
|
8
|
+
filter: drop-shadow(gray 0 0 0.5rem);
|
|
9
|
+
}
|
|
10
|
+
.selected {
|
|
11
|
+
filter: drop-shadow(blue 0 0 0.5rem);
|
|
12
|
+
}
|
|
13
|
+
</style>
|
|
14
|
+
{% endblock %}
|
|
5
15
|
{% block scripts %}
|
|
6
16
|
<script type="module" src="{{url_for('static',filename='plugins/fediverse/js/post_view.js')}}"></script>
|
|
7
17
|
{% endblock %}
|
whyis_fediverse/vocab.ttl
CHANGED
|
@@ -34,16 +34,24 @@ whyis:hasReplies dc:identifier "replies";
|
|
|
34
34
|
rdfs:subPropertyOf whyis:hasView.
|
|
35
35
|
|
|
36
36
|
rdfs:Resource
|
|
37
|
+
whyis:hasEmbed "whyis_fediverse:embed_resource.html";
|
|
37
38
|
whyis:comments "whyis_fediverse:discussion.json";
|
|
38
39
|
whyis:discussion "whyis_fediverse:discussion.html".
|
|
39
40
|
|
|
40
41
|
whyis:HomePage
|
|
42
|
+
whyis:discussion "whyis_fediverse:all_discussion.html";
|
|
41
43
|
whyis:comments "whyis_fediverse:all_discussion.json".
|
|
42
44
|
|
|
45
|
+
whyis:hasEmbed dc:identifier "embed";
|
|
46
|
+
rdfs:subPropertyOf whyis:hasView.
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
43
50
|
as:Object a owl:Class;
|
|
44
51
|
whyis:hasView "whyis_fediverse:object_view.html";
|
|
45
52
|
whyis:hasData "whyis_fediverse:object_data.json";
|
|
46
53
|
whyis:hasReplies "whyis_fediverse:object_replies.json";
|
|
54
|
+
whyis:hasEmbed "whyis_fediverse:embed_object.html";
|
|
47
55
|
rdfs:subClassOf rdfs:Resource.
|
|
48
56
|
|
|
49
57
|
as:Article a owl:Class;
|
|
@@ -59,6 +67,7 @@ as:Event a owl:Class;
|
|
|
59
67
|
rdfs:subClassOf as:Object.
|
|
60
68
|
|
|
61
69
|
as:Image a owl:Class;
|
|
70
|
+
whyis:hasEmbed "whyis_fediverse:embed_image.html";
|
|
62
71
|
rdfs:subClassOf as:Object.
|
|
63
72
|
|
|
64
73
|
as:Note a owl:Class;
|
|
@@ -80,4 +89,5 @@ as:Tombstone a owl:Class;
|
|
|
80
89
|
rdfs:subClassOf as:Object.
|
|
81
90
|
|
|
82
91
|
as:Video a owl:Class;
|
|
92
|
+
whyis:hasEmbed "whyis_fediverse:embed_video.html";
|
|
83
93
|
rdfs:subClassOf as:Object.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
whyis_fediverse/__init__.py,sha256=7sTTb0R55ywo-a3UnNWtrudKGhznV_bOM9XFwzOhH6M,22
|
|
2
|
+
whyis_fediverse/plugin.py,sha256=IFepgUVTRhhKNEm4-uiTJqYrEZ5HCkJ1vkc74O2mM8s,545
|
|
3
|
+
whyis_fediverse/test_example.trig,sha256=kcTQ0hmnt8bjsTBrRN58yvzTEtNT5ryrDBWoeReaUKw,3486
|
|
4
|
+
whyis_fediverse/test_example.ttl,sha256=sD79vPJcFacKMyt9rvLSBZxSRGe5Q06qeoXdHzn3XOQ,3496
|
|
5
|
+
whyis_fediverse/vocab.ttl,sha256=ZcN5pWzoxBNxeOTfVjs0vVgBnWDvVNCMics_JC8WRWs,2778
|
|
6
|
+
whyis_fediverse/static/js/#new_post.js#,sha256=7SJRF5yYO9YvWffs77uWKawJPUjXPaxiRwPyWT0-2ww,6749
|
|
7
|
+
whyis_fediverse/static/js/comment.js,sha256=lcAVewttPAOcu8gveCLiXRNGecrTP6YFs9hTKbp6HKI,3241
|
|
8
|
+
whyis_fediverse/static/js/discussion.js,sha256=KrW8h9pUaheJjqhgkmK9PZargoTJoGJun5n91rEk2Jc,2418
|
|
9
|
+
whyis_fediverse/static/js/new_post.js,sha256=0Ap-bl5qxixtuhmZwppjFWP-MaaLvdb0MHfoiSA7_gw,6751
|
|
10
|
+
whyis_fediverse/static/js/post.js,sha256=xmLicaDBnejcbr4vH1cLmVoy-Cplz7PuCKE_mNHjBzk,3266
|
|
11
|
+
whyis_fediverse/static/js/post_view.js,sha256=0Wpjht9BU3MGS1VtkRhHHqPLFkMlUOOn6-Y-boNdDVs,2686
|
|
12
|
+
whyis_fediverse/static/js/selectable.js,sha256=QH4ZYAj-Y6-YAA1l0ylNXXUhU2r5yqBmZ07Sn-3CKME,1129
|
|
13
|
+
whyis_fediverse/static/js/selectable.js~,sha256=p17cbCcv26I68zyIl71KOA-Y0zT0AYP1LjOOaof-2JY,459
|
|
14
|
+
whyis_fediverse/static/js/selections.js,sha256=RKzDvV5qvCIk1QTAgXoLD4GwKbVRxCfTvEhgAT77QRE,737
|
|
15
|
+
whyis_fediverse/static/js/selections.js~,sha256=0R8arrYGwFwic5N4oV-YDVT-V0OCr918VzMN-ReIhm4,2758
|
|
16
|
+
whyis_fediverse/templates/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
17
|
+
whyis_fediverse/templates/all_discussion.html,sha256=SMqV8aHS3c_fYjVZEcx0wT_3q2PpXmkkvBeTMce4Fvs,3043
|
|
18
|
+
whyis_fediverse/templates/all_discussion.html~,sha256=rt07C6wEg17gidDae_a6ZfmcN_W_dkL6fJ6quvOA7Q8,3072
|
|
19
|
+
whyis_fediverse/templates/all_discussion.json,sha256=FxZyAvGN8Lgjuda0kszhy5q0Z9U-jqgiPgpfTTlIs3U,750
|
|
20
|
+
whyis_fediverse/templates/discussion.html,sha256=rt07C6wEg17gidDae_a6ZfmcN_W_dkL6fJ6quvOA7Q8,3072
|
|
21
|
+
whyis_fediverse/templates/discussion.json,sha256=6BE9ENbur_eiScePyk8_6Xs4RYIDQNenpMInMiry1ww,821
|
|
22
|
+
whyis_fediverse/templates/embed_image.html,sha256=7Qh-8WaDusMIqWnzRTTI2AHrW1hIvOr6Zsn13dUMk-g,89
|
|
23
|
+
whyis_fediverse/templates/embed_image.html~,sha256=6S_FPdMVROGBUpy8YznYbsozajC5rm0eo1YR4cYGTf8,98
|
|
24
|
+
whyis_fediverse/templates/embed_object.html,sha256=NNnGYxA3-EcZSmVsUGrBj5XcoFpj4xYKp1-ayMumvRk,56
|
|
25
|
+
whyis_fediverse/templates/embed_object.html~,sha256=Y3T_8SHco3Yiau9E68AeiyXHHtfZPV4hzVqgJP0cwCA,259
|
|
26
|
+
whyis_fediverse/templates/embed_resource.html,sha256=0doDpaSAE7T-BXo8cTciM9h2-6wJGVadTS3BQ6XMwNc,226
|
|
27
|
+
whyis_fediverse/templates/embed_resource.html~,sha256=XB0NLhfH7KIZ8GU3vXdO8hMKhzoMuM0P6aYG3SBwyWE,258
|
|
28
|
+
whyis_fediverse/templates/embed_video.html,sha256=HBATiS9qYaefzAIAZjRp0fbJaOUYs6gKQwHjz88-qco,234
|
|
29
|
+
whyis_fediverse/templates/embed_video.html~,sha256=Y3T_8SHco3Yiau9E68AeiyXHHtfZPV4hzVqgJP0cwCA,259
|
|
30
|
+
whyis_fediverse/templates/image_embed.html,sha256=ovmUMO-ZSTCIMEmtvXX9sC-mr6wTJrKzA_jsBYvJIF0,116
|
|
31
|
+
whyis_fediverse/templates/image_embed.svg,sha256=ovmUMO-ZSTCIMEmtvXX9sC-mr6wTJrKzA_jsBYvJIF0,116
|
|
32
|
+
whyis_fediverse/templates/object_data.json,sha256=6CXzBs87LMpjvtBjV24BWFC5iqvtkjCugr8jExLEh-o,2967
|
|
33
|
+
whyis_fediverse/templates/object_replies.json,sha256=W2Ch-s6Lh-yjw3tBY9KtzCMGSlezTHSuJxCLxZcx1Q0,392
|
|
34
|
+
whyis_fediverse/templates/object_view.html,sha256=ZhEAD3kvLoBrDT7CtmJd27n70vMZ4pcqsaTxjUq3raA,796
|
|
35
|
+
whyis_fediverse/templates/resource_get.json,sha256=qgKrV5c2IQGWfnv6EIXL_B3xte4UC7PQ1uv1VOO5v38,131
|
|
36
|
+
whyis_fediverse/templates/resource_search.json,sha256=BXOsOdM7rJ2MV1_7tMthXLuc_aye6Ig9_3jYXXSxiP0,230
|
|
37
|
+
whyis_fediverse/templates/space_get.json,sha256=QYxOUQjW7Asyvla-C0-Dv9mj0Tww1MdecxqUMuOH1mg,132
|
|
38
|
+
whyis_fediverse/templates/space_search.json,sha256=PMzIraMldZrb7jrCsBhJRbQ_vB76nxz24cS9Bcgx-gk,193
|
|
39
|
+
whyis_fediverse-0.2.0.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
40
|
+
whyis_fediverse-0.2.0.dist-info/METADATA,sha256=nvhn6gZL4qUnumFQ_egjStmhdSK63Bqt-aYU0GNggRg,103
|
|
41
|
+
whyis_fediverse-0.2.0.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
|
|
42
|
+
whyis_fediverse-0.2.0.dist-info/entry_points.txt,sha256=e4XLi7wxdcBNLXdbeukTWuVWuprOpYUpFUkOJe4vPdY,58
|
|
43
|
+
whyis_fediverse-0.2.0.dist-info/top_level.txt,sha256=s0dGyAZlCNhS-O-Zoqlui3FKCkMAc8VqfK3o6DLsC10,16
|
|
44
|
+
whyis_fediverse-0.2.0.dist-info/RECORD,,
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
whyis_fediverse/__init__.py,sha256=7sTTb0R55ywo-a3UnNWtrudKGhznV_bOM9XFwzOhH6M,22
|
|
2
|
-
whyis_fediverse/plugin.py,sha256=IFepgUVTRhhKNEm4-uiTJqYrEZ5HCkJ1vkc74O2mM8s,545
|
|
3
|
-
whyis_fediverse/test_example.trig,sha256=kcTQ0hmnt8bjsTBrRN58yvzTEtNT5ryrDBWoeReaUKw,3486
|
|
4
|
-
whyis_fediverse/test_example.ttl,sha256=sD79vPJcFacKMyt9rvLSBZxSRGe5Q06qeoXdHzn3XOQ,3496
|
|
5
|
-
whyis_fediverse/vocab.ttl,sha256=_QVPdPfth7cpiog2ruQRcEsWKyftvi4jyUdGTGq2lDU,2427
|
|
6
|
-
whyis_fediverse/static/js/comment.js,sha256=-Eh0cl0_eVefMX3bSSWFB39flMlRm12V4GW1i_hzTcQ,2694
|
|
7
|
-
whyis_fediverse/static/js/discussion.js,sha256=xwRPsOlTBVSjbvNOQ_3D0Xh3axY61VLZgIC2czo4KMs,2332
|
|
8
|
-
whyis_fediverse/static/js/new_post.js,sha256=yu6I5BCLxu9wI_jnhkFx0WHYooUBq3fGlhxohc998IA,4710
|
|
9
|
-
whyis_fediverse/static/js/post.js,sha256=vRy4iNhR0wwzx69zEcrZuP17W5F_fm75pE2YPhk7w94,2973
|
|
10
|
-
whyis_fediverse/static/js/post_view.js,sha256=J8j9mmuZnvBEc4VcL2W6Lzf18B43QAdkLsKycJmJ5L4,2674
|
|
11
|
-
whyis_fediverse/templates/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
|
-
whyis_fediverse/templates/all_discussion.json,sha256=FxZyAvGN8Lgjuda0kszhy5q0Z9U-jqgiPgpfTTlIs3U,750
|
|
13
|
-
whyis_fediverse/templates/discussion.html,sha256=8aT47Z5a667JGees1TOOq5c2cCZqam5ZsDoop2Yo1VI,2912
|
|
14
|
-
whyis_fediverse/templates/discussion.json,sha256=6BE9ENbur_eiScePyk8_6Xs4RYIDQNenpMInMiry1ww,821
|
|
15
|
-
whyis_fediverse/templates/object_data.json,sha256=BF1LwtZ6CfYyfAwI9RTy7ZDrZnRmoMYp2qrhodD5njc,2746
|
|
16
|
-
whyis_fediverse/templates/object_replies.json,sha256=W2Ch-s6Lh-yjw3tBY9KtzCMGSlezTHSuJxCLxZcx1Q0,392
|
|
17
|
-
whyis_fediverse/templates/object_view.html,sha256=9hauvUiGFmId4Y7fJRiNk7M3PhPEQGaK_IxeP7qhOcs,636
|
|
18
|
-
whyis_fediverse/templates/resource_get.json,sha256=qgKrV5c2IQGWfnv6EIXL_B3xte4UC7PQ1uv1VOO5v38,131
|
|
19
|
-
whyis_fediverse/templates/resource_search.json,sha256=BXOsOdM7rJ2MV1_7tMthXLuc_aye6Ig9_3jYXXSxiP0,230
|
|
20
|
-
whyis_fediverse/templates/space_get.json,sha256=QYxOUQjW7Asyvla-C0-Dv9mj0Tww1MdecxqUMuOH1mg,132
|
|
21
|
-
whyis_fediverse/templates/space_search.json,sha256=PMzIraMldZrb7jrCsBhJRbQ_vB76nxz24cS9Bcgx-gk,193
|
|
22
|
-
whyis_fediverse-0.1.4.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
23
|
-
whyis_fediverse-0.1.4.dist-info/METADATA,sha256=KraxUGJcE40exxmThaqFAn8xwidtADQ3ecEaZVaNcxM,103
|
|
24
|
-
whyis_fediverse-0.1.4.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
|
25
|
-
whyis_fediverse-0.1.4.dist-info/entry_points.txt,sha256=e4XLi7wxdcBNLXdbeukTWuVWuprOpYUpFUkOJe4vPdY,58
|
|
26
|
-
whyis_fediverse-0.1.4.dist-info/top_level.txt,sha256=s0dGyAZlCNhS-O-Zoqlui3FKCkMAc8VqfK3o6DLsC10,16
|
|
27
|
-
whyis_fediverse-0.1.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|