17.10
This commit is contained in:
1 parent
d1584c1332
commit
dfaa1c3581
20 files changed
+217
-274
No files matched your search
@@ -85,61 +85,25 @@
|
||||
|
||||
<div id="waline"></div>
|
||||
</div>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$(document).ready(function () {
|
||||
|
||||
var currentPath = "\/post\/my-second-post\/";
|
||||
|
||||
|
||||
|
||||
$.ajaxSettings.async = true;
|
||||
$.getJSON('https://waline.usj.cc/api/comment?path=' + encodeURIComponent(currentPath), function(response) {
|
||||
var data = response.data.data;
|
||||
console.log(data);
|
||||
|
||||
var looper_time = 3 * 1000;
|
||||
var items = data;
|
||||
|
||||
var total = items.length;
|
||||
|
||||
var run_once = true;
|
||||
|
||||
var index = 0;
|
||||
|
||||
barrager();
|
||||
|
||||
function barrager() {
|
||||
if (run_once) {
|
||||
|
||||
looper = setInterval(barrager, looper_time);
|
||||
run_once = false;
|
||||
}
|
||||
|
||||
|
||||
var item = {
|
||||
img: items[index].avatar || 'static/default-avatar.png',
|
||||
info: items[index].orig || 'No comment',
|
||||
href: items[index].link || '#',
|
||||
close: true,
|
||||
speed: 6,
|
||||
color: '#fff',
|
||||
old_ie_color: '#000000'
|
||||
};
|
||||
|
||||
|
||||
$('body').barrager(item);
|
||||
|
||||
index++;
|
||||
|
||||
if (index == total) {
|
||||
clearInterval(looper);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
fetchCommentsAndCreateBarrager(currentPath, {
|
||||
looper_time: 3000,
|
||||
defaultAvatar: 'static/default-avatar.png',
|
||||
defaultInfo: 'No comment',
|
||||
defaultLink: '#',
|
||||
close: true,
|
||||
speed: 6,
|
||||
color: '#fff',
|
||||
old_ie_color: '#000000'
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -162,13 +126,14 @@
|
||||
<script src="/js/main.js"></script>
|
||||
<script src="/js/mypjax.js"></script>
|
||||
<script src="/js/nprogress.js"></script>
|
||||
<script>var currentPath = "\/post\/my-second-post\/";</script>
|
||||
|
||||
<script type="module">
|
||||
import { init as walineInit } from 'https://unpkg.com/@waline/client@v3/dist/waline.js';
|
||||
|
||||
|
||||
window.walineInit = walineInit;
|
||||
|
||||
|
||||
|
||||
window.initWaline = function() {
|
||||
walineInit({
|
||||
|
||||
Reference in new issue
Block a user