-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add more settings and default values
- Loading branch information
Showing
5 changed files
with
57 additions
and
21 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
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,16 +1,27 @@ | ||
{% set disqus = __SELF__.disqus %} | ||
<div id="disqus_thread"></div> | ||
<script> | ||
var disqus_config = function () { | ||
this.page.url = '{{ disqus.page_url }}' || window.location.href; | ||
this.page.identifier = "{{ (disqus.page_id_prefix ? disqus.page_id_prefix ~ '_' : '') ~ disqus.page_id }}" || window.location.href; | ||
}; | ||
{% if disqus.enable %} | ||
{% if not disqus.sub_domain %} | ||
<div class="alert alert-warning" role="alert"> | ||
<strong>Warning!</strong> please config Disqus sub domain first! | ||
</div> | ||
{% else %} | ||
<div id="disqus_thread"></div> | ||
<script> | ||
var disqus_config = function () { | ||
this.page.url = '{{ disqus.page_url }}' || window.location.href; | ||
this.page.identifier = "{{ (disqus.page_id_prefix ? disqus.page_id_prefix ~ '_' : '') ~ disqus.page_id }}" || window.location.href; | ||
}; | ||
|
||
(function () { | ||
var d = document, s = d.createElement('script'); | ||
s.src = '//{{ disqus.sub_domain }}.disqus.com/embed.js'; | ||
s.setAttribute('data-timestamp', +new Date()); | ||
(d.head || d.body).appendChild(s); | ||
})(); | ||
</script> | ||
<noscript>{{ disqus.noscript_content | raw }}</noscript> | ||
{% endif %} | ||
{% else %} | ||
{{ disqus.disabled_content | raw }} | ||
{% endif %} | ||
|
||
(function () { | ||
var d = document, s = d.createElement('script'); | ||
s.src = '//{{ disqus.sub_domain }}.disqus.com/embed.js'; | ||
s.setAttribute('data-timestamp', +new Date()); | ||
(d.head || d.body).appendChild(s); | ||
})(); | ||
</script> | ||
<noscript>{{ disqus.noscript_content | raw }}</noscript> |
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
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,14 +1,28 @@ | ||
fields: | ||
enable: | ||
label: Enable | ||
span: auto | ||
default: '1' | ||
type: switch | ||
comment: 'Enable Disqus or not?' | ||
sub_domain: | ||
label: 'Disqus subdomain' | ||
oc.commentPosition: '' | ||
span: full | ||
cssClass: '' | ||
required: 1 | ||
type: text | ||
noscript_content: | ||
label: 'Message when JS is turn off' | ||
oc.commentPosition: '' | ||
size: giant | ||
size: huge | ||
language: html | ||
span: full | ||
span: left | ||
type: codeeditor | ||
disabled_content: | ||
label: 'Disabled content' | ||
oc.commentPosition: '' | ||
size: huge | ||
language: php | ||
span: right | ||
type: codeeditor |
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