-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
eccbfba
commit 6c3f57f
Showing
61 changed files
with
9,511 additions
and
2,807 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,3 +28,5 @@ | |
/vendor/symfony | ||
/vendor/theseer | ||
/vendor/webmozart | ||
/.cache | ||
/node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,68 @@ | ||
function replyToComment(self) { | ||
document.querySelector('.komment-reply-indicator .komment-gravatar').innerHTML = '<img src="https://www.gravatar.com/avatar/' + self.dataset.gravatar + '?s=100" alt="gravatar">'; | ||
document.querySelector('.komment-reply-indicator .komment-author').innerHTML = '@' + self.dataset.author; | ||
document.querySelector('#replyTo').value = self.dataset.slug; | ||
} | ||
|
||
window.onload = function () { | ||
[...document.querySelectorAll('.komment-reply')] | ||
.forEach(a => { a.onclick = function() { replyToComment(this) }; }); | ||
|
||
const komment = document.querySelector('#kommentform #komment') | ||
const kommentEmail = document.querySelector('#kommentform #email') | ||
const kommentAuthor = document.querySelector('#kommentform #author') | ||
const kommentUrl = document.querySelector('#kommentform #author_url') | ||
const timeField = document.querySelector('#kommentform .cts') | ||
const submitField = document.querySelector('#kommentform input[type=submit]') | ||
const spamIndicatorProgress = document.querySelector('#kommentform .spam-indicator .progress') | ||
|
||
let duration = { | ||
start: 0, | ||
end: 0, | ||
indicator: 0, | ||
timer: null | ||
} | ||
|
||
const setIndicator = () => { | ||
|
||
if (duration.indicator > 0) { | ||
return | ||
} | ||
|
||
submitField.disabled = true; | ||
|
||
duration.timer = window.setInterval(() => { | ||
duration.indicator += 10; | ||
spamIndicatorProgress.style.width = `${duration.indicator}%` | ||
|
||
// TODO | ||
if (duration.indicator > 25) { | ||
spamIndicatorProgress.style.background = 'orange' | ||
} | ||
|
||
if (duration.indicator > 50) { | ||
spamIndicatorProgress.style.background = 'yellowgreen' | ||
} | ||
|
||
if (duration.indicator > 75) { | ||
spamIndicatorProgress.style.background = 'green' | ||
} | ||
|
||
if (duration.indicator >= 100) { | ||
spamIndicatorProgress.style.background = 'green' | ||
spamIndicatorProgress.style.height = '0'; | ||
submitField.disabled = false; | ||
|
||
duration.end = Math.round(Date.now() / 1000); | ||
timeField.value = duration.end - duration.start | ||
|
||
window.clearInterval(duration.timer) | ||
} | ||
}, 1000) | ||
} | ||
|
||
kommentEmail.style.display = 'none'; | ||
kommentAuthor.style.display = 'none'; | ||
kommentUrl.style.display = 'none'; | ||
|
||
komment.addEventListener('focus', () => { | ||
duration.start = Math.round(Date.now() / 1000); | ||
setIndicator(); | ||
kommentEmail.style.display = 'block'; | ||
kommentAuthor.style.display = 'block'; | ||
kommentUrl.style.display = 'block'; | ||
}); | ||
|
||
}; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,57 @@ | ||
label: Komments | ||
icon: quote | ||
columns: | ||
- width: 1/2 | ||
sections: | ||
published: | ||
type: pages | ||
headline: Veröffentlicht | ||
status: published | ||
info: " {{ page.date.toDate('Y-m-d') }}" | ||
size: small | ||
sortBy: date desc | ||
parent: page.find("komments") | ||
text: "{{ page.author }}: {{ page.title }}" | ||
empty: No public komments | ||
- width: 1/2 | ||
sections: | ||
drafts: | ||
type: pages | ||
headline: Awaiting moderation | ||
status: draft | ||
parent: page.find("komments") | ||
sortBy: date desc | ||
text: "{{ page.author }}: {{ page.title }}" | ||
empty: No waiting komments | ||
info: " {{ page.date.toDate('Y-m-d') }}" | ||
- width: 1/1 | ||
sections: | ||
kommentsWebmentions: | ||
type: fields | ||
fields: | ||
kommentsInbox: | ||
type: structure | ||
label: Inbox | ||
fields: | ||
avatar: | ||
type: url | ||
label: Avatar | ||
author: | ||
type: text | ||
label: Author | ||
authorUrl: | ||
type: url | ||
label: Author Url | ||
wmSource: | ||
type: url | ||
label: Source | ||
wmTarget: | ||
type: url | ||
label: Target | ||
mentionOf: | ||
type: url | ||
label: Mentioned | ||
wmProperty: | ||
type: text | ||
label: Type | ||
published: | ||
type: date | ||
label: Published | ||
time: true | ||
komment: | ||
type: textarea | ||
label: Komment | ||
quote: | ||
type: textarea | ||
label: Quote | ||
status: | ||
type: toggle | ||
label: Status | ||
honey: | ||
type: text | ||
label: Honeypot | ||
columns: | ||
author: | ||
width: 1/4 | ||
wmSource: | ||
width: 1/4 | ||
komment: | ||
width: 1/4 | ||
status: | ||
width: 1/4 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
{ | ||
"name": "mauricerenck/komments", | ||
"description": "A comment plugin for Kirby 3", | ||
"version": "0.0.2", | ||
"description": "A webmention and comments plugin for Kirby 3", | ||
"type": "kirby-plugin", | ||
"license": "MIT", | ||
"authors": [ | ||
|
@@ -9,17 +10,18 @@ | |
"email": "[email protected]" | ||
} | ||
], | ||
"version": "0.0.1", | ||
"autoload": { | ||
"files": [ | ||
"utils/readKomments.php", | ||
"utils/writeKomments.php" | ||
"utils/sendMastodon.php", | ||
"utils/sendWebmention.php", | ||
"utils/receiveWebmention.php" | ||
] | ||
}, | ||
"require": { | ||
"getkirby/composer-installer": "^1.1" | ||
"getkirby/composer-installer": "^1.1", | ||
"indieweb/mention-client": "^1.2" | ||
}, | ||
"require-dev": { | ||
"phpunit/phpunit": "^7.2" | ||
"config": { | ||
"optimize-autoloader": true | ||
} | ||
} |
Oops, something went wrong.