OwO表情
`;
49 |
50 | for (let i = 0; i < this.packages.length; i++) {
51 |
52 | html += `
53 |
`;
54 |
55 | let opackage = this.odata[this.packages[i]].container;
56 | for (let i = 0; i < opackage.length; i++) {
57 |
58 | html += `
59 | - ${opackage[i].icon}
`;
60 |
61 | }
62 |
63 | html += `
64 |
`;
65 | }
66 |
67 | html += `
68 |
69 |
`;
70 |
71 | for (let i = 0; i < this.packages.length; i++) {
72 |
73 | html += `
74 | - ${this.packages[i]}
`
75 |
76 | }
77 |
78 | html += `
79 |
80 |
81 |
82 | `;
83 | this.container.innerHTML = html;
84 |
85 | // bind event
86 | this.logo = this.container.getElementsByClassName('OwO-logo')[0];
87 | this.logo.addEventListener('click', () => {
88 | this.toggle();
89 | });
90 |
91 | this.container.getElementsByClassName('OwO-body')[0].addEventListener('click', (e)=> {
92 | let target = null;
93 | if (e.target.classList.contains('OwO-item')) {
94 | target = e.target;
95 | }
96 | else if (e.target.parentNode.classList.contains('OwO-item')) {
97 | target = e.target.parentNode;
98 | }
99 | if (target) {
100 | const cursorPos = this.area.selectionEnd;
101 | let areaValue = this.area.value;
102 | this.area.value = areaValue.slice(0, cursorPos) + target.innerHTML + areaValue.slice(cursorPos);
103 | this.area.focus();
104 | this.toggle();
105 | }
106 | });
107 |
108 | this.packagesEle = this.container.getElementsByClassName('OwO-packages')[0];
109 | for (let i = 0; i < this.packagesEle.children.length; i++) {
110 | ((index) =>{
111 | this.packagesEle.children[i].addEventListener('click', () => {
112 | this.tab(index);
113 | });
114 | })(i);
115 | }
116 |
117 | this.tab(0);
118 | }
119 |
120 | toggle() {
121 | if (this.container.classList.contains('OwO-open')) {
122 | this.container.classList.remove('OwO-open');
123 | }
124 | else {
125 | this.container.classList.add('OwO-open');
126 | }
127 | }
128 |
129 | tab(index) {
130 | const itemsShow = this.container.getElementsByClassName('OwO-items-show')[0];
131 | if (itemsShow) {
132 | itemsShow.classList.remove('OwO-items-show');
133 | }
134 | this.container.getElementsByClassName('OwO-items')[index].classList.add('OwO-items-show');
135 |
136 | const packageActive = this.container.getElementsByClassName('OwO-package-active')[0];
137 | if (packageActive) {
138 | packageActive.classList.remove('OwO-package-active');
139 | }
140 | this.packagesEle.getElementsByTagName('li')[index].classList.add('OwO-package-active');
141 | }
142 | }
143 | if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') {
144 | module.exports = OwO;
145 | }
146 | else {
147 | window.OwO = OwO;
148 | }
149 | })();
--------------------------------------------------------------------------------
/say.php:
--------------------------------------------------------------------------------
1 | options->CDNURL;
3 | $GLOBALS['timechoice'] = $this->options->langis;
4 | function threadedComments($comments, $options) {
5 | $commentClass = '';
6 | if ($comments->authorId) {
7 | if ($comments->authorId == $comments->ownerId) {
8 | $commentClass .= ' comment-by-author'; //如果是文章作者的评论添加 .comment-by-author 样式
9 | } else {
10 | $commentClass .= ' comment-by-user'; //如果是评论作者的添加 .comment-by-user 样式
11 | }
12 | }
13 | $commentLevelClass = $comments->_levels > 0 ? ' comment-child' : ' comment-parent'; //评论层数大于0为子级,否则是父级
14 | ?>
15 |
16 |
17 |
欢迎你来到「时光机」栏目。在这里你可以记录你的日常和心情。而且,首页的“闲言碎语”栏目会显示最新的三条动态哦!这是默认的第一条说说,当你发布第一条说说的时候,该条动态会自动消失。