Skip to content
This repository was archived by the owner on Apr 11, 2022. It is now read-only.

Commit 529d79c

Browse files
authored
0.0.5
1 parent 5d24694 commit 529d79c

8 files changed

+407
-160
lines changed

Diff for: assets/favicon_128.png

4.06 KB
Loading

Diff for: assets/favicon_16.png

501 Bytes
Loading

Diff for: assets/favicon_48.png

1.56 KB
Loading

Diff for: assets/integr.js

+241-109
Large diffs are not rendered by default.

Diff for: assets/sett.tmp

+22-13
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<top>Редактор смайлов <close class='fa fa-times' onclick="adoor('smiles')"></close></top>
55
<middle>
66
<finder>
7+
<input type='text' mode='withoutfone' name='tab' placeholder='Категория' value='Без категории'>
78
<input type='text' name='name' placeholder='Имя'>
89
<input type='text' name='src' placeholder='Ссылка'>
910
<fing onclick='add()'>Добавить</fing>
@@ -70,55 +71,58 @@
7071
<top>Настройки <close class='fa fa-times' onclick="adoor('asett')"></close></top>
7172
<middle>
7273
<top>Видимые разделы</top>
73-
<pages>
74+
<pages name='pagesetting'>
7475
Для изменения отображения используется чекбокс (галочка рядом с пунктом), для изменения
7576
названия используется нажатие на название (изменяется как текстовое поле)<br>
7677

7778
<page class='check'>
7879
<input type="checkbox" value="-1">
79-
<input type='text' name="withoutfone" value=''>
80+
<input type='text' mode="withoutfone" value=''>
8081
</page>
8182
<page class='check'>
8283
<input type="checkbox" value="1">
83-
<input type='text' name="withoutfone" value=''>
84+
<input type='text' mode="withoutfone" value=''>
8485
</page>
8586
<page class='check'>
8687
<input type="checkbox" value="5">
87-
<input type='text' name="withoutfone" value=''>
88+
<input type='text' mode="withoutfone" value=''>
8889
</page>
8990
<page class='check'>
9091
<input type="checkbox" value="6">
91-
<input type='text' name="withoutfone" value=''>
92+
<input type='text' mode="withoutfone" value=''>
9293
</page>
9394
<page class='check'>
9495
<input type="checkbox" value="7">
95-
<input type='text' name="withoutfone" value=''>
96+
<input type='text' mode="withoutfone" value=''>
9697
</page>
9798
<page class='check'>
9899
<input type="checkbox" value="9">
99-
<input type='text' name="withoutfone" value=''>
100+
<input type='text' mode="withoutfone" value=''>
100101
</page>
101102
<page class='check'>
102103
<input type="checkbox" value="11">
103-
<input type='text' name="withoutfone" value=''>
104+
<input type='text' mode="withoutfone" value=''>
104105
</page>
105106
<page class='check'>
106107
<input type="checkbox" value="14">
107-
<input type='text' name="withoutfone" value=''>
108+
<input type='text' mode="withoutfone" value=''>
108109
</page>
109110
<page class='check'>
110111
<input type="checkbox" value="16">
111-
<input type='text' name="withoutfone" value=''>
112+
<input type='text' mode="withoutfone" value=''>
112113
</page>
113114
<page class='check'>
114115
<input type="checkbox" value="17">
115-
<input type='text' name="withoutfone" value=''>
116+
<input type='text' mode="withoutfone" value=''>
116117
</page>
117118
<page class='check'>
118119
<input type="checkbox" value="18">
119-
<input type='text' name="withoutfone" value=''>
120+
<input type='text' mode="withoutfone" value=''>
120121
</page>
121122
</pages>
123+
124+
<top>Настройка порядка категорий</top>
125+
<pages name='tabsetting'></cate>
122126
</middle>
123127

124128
<bottom>
@@ -132,10 +136,15 @@
132136
<middle>
133137
<helper>Включенный режим - управление размером<br>Выключенный режим - фиксированный размер</helper>
134138
<canEdit onclick="CEtoggle()"></canEdit>
135-
<finder>
139+
<finder name='hiddly'>
136140
<input type='text' name='width' placeholder='Ширина'>
137141
<input type='text' name='height' placeholder='Высота'>
138142
</finder>
143+
144+
<helper>Укажите категорию смайла</helper>
145+
<finder style='justify-content: center'>
146+
<input type='text' name='tab' placeholder='Категория'>
147+
</finder>
139148
</middle>
140149

141150
<bottom>

Diff for: extension.css

+128-21
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,13 @@ fullpage input[name='name']
210210
width: 100px!important;
211211
}
212212

213+
fullpage input[name="tab"]
214+
{
215+
width: 125px!important;
216+
}
217+
213218
/* Перекрываем стили как можем ей богу */
214-
fullpage input:not([name="withoutfone"]), fullpage textarea
219+
fullpage input:not([mode="withoutfone"]), fullpage textarea
215220
{
216221
margin: 0 5px 0 0!important; /* Особенно это */
217222
height: 29px!important;
@@ -222,25 +227,6 @@ fullpage input:not([name="withoutfone"]), fullpage textarea
222227
color: #989899!important;
223228
}
224229

225-
fullpage input[name="withoutfone"]
226-
{
227-
margin: 5px!important;
228-
border: none!important;
229-
outline: none!important;
230-
color: #eee!important;
231-
background: none!important;
232-
height: 29px!important;
233-
border-radius: 3px;
234-
235-
transition: all .3s;
236-
}
237-
238-
239-
fullpage input[name="withoutfone"]:focus
240-
{
241-
background: #121215!important;
242-
}
243-
244230
fullpage textarea
245231
{
246232
height: 200px!important;
@@ -318,6 +304,91 @@ smile-list
318304
overflow: auto;
319305
}
320306

307+
::-webkit-scrollbar {
308+
width: 6px;
309+
}
310+
311+
::-webkit-scrollbar-track {
312+
background: rgba(100,100,100,0);
313+
border-radius: 10px;
314+
}
315+
316+
::-webkit-scrollbar-thumb {
317+
border-radius: 10px;
318+
background: #2b2c32;
319+
}
320+
321+
smile-list tab
322+
{
323+
flex-direction: column;
324+
margin-bottom: 5px;
325+
}
326+
327+
smile-list tab.minimized list
328+
{
329+
display: none;
330+
}
331+
332+
smile-list tab list
333+
{
334+
margin-left: 20px;
335+
position: relative;
336+
}
337+
338+
smile-list tab list:before
339+
{
340+
content: '';
341+
342+
left: -10px;
343+
bottom: 0;
344+
345+
width: 1px;
346+
height: 41px;
347+
348+
background: #2b2c32;
349+
position: absolute;
350+
}
351+
352+
smile-list tab list:last-child:before
353+
{
354+
content: '';
355+
356+
top: -6px;
357+
left: -10px;
358+
359+
width: 1px;
360+
height: 23px;
361+
362+
background: #2b2c32;
363+
position: absolute;
364+
}
365+
366+
smile-list tab list:after
367+
{
368+
content: '';
369+
370+
bottom: 0;
371+
top: 16px;
372+
left: -10px;
373+
374+
width: 10px;
375+
height: 1px;
376+
377+
background: #2b2c32;
378+
position: absolute;
379+
}
380+
381+
smile-list hit
382+
{
383+
font-size: 14px;
384+
justify-content: space-between;
385+
align-items: center;
386+
background: rgb(43, 44, 50);
387+
border-radius: 3px;
388+
margin: 0 3px 3px 0;
389+
padding: 2px 10px;
390+
}
391+
321392
smile-list list
322393
{
323394
margin: 3px 0;
@@ -414,7 +485,7 @@ chan helper
414485
text-align: center;
415486
}
416487

417-
chan canedit.false ~ finder
488+
chan canedit.false ~ finder[name='hiddly']
418489
{ max-height: 0px }
419490

420491
chan finder
@@ -440,6 +511,7 @@ chan finder input:first-child
440511

441512
chan finder input:last-child
442513
{
514+
text-align: left;
443515
margin: 0!important;
444516
background: linear-gradient(90deg, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 100%)!important;
445517
}
@@ -453,4 +525,39 @@ quotebutton
453525
border: 1px solid #343434;
454526

455527
cursor: pointer;
528+
}
529+
530+
asett page[tab] input[name="index"]
531+
{
532+
width: 45px;
533+
}
534+
535+
asett middle
536+
{
537+
overflow: auto;
538+
}
539+
540+
fullpage input[mode="withoutfone"]
541+
{
542+
margin: 5px!important;
543+
margin-left: 0px!important;
544+
border: none!important;
545+
outline: none!important;
546+
color: #eee!important;
547+
background: none!important;
548+
height: 29px!important;
549+
border-radius: 3px;
550+
551+
transition: all .3s;
552+
}
553+
554+
555+
fullpage input[mode="withoutfone"]:focus
556+
{
557+
background: #121215!important;
558+
}
559+
560+
smiles finder input[mode="withoutfone"]:focus
561+
{
562+
background: #0e0e0e!important;
456563
}

Diff for: extension.js

+12-13
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,6 @@ fetch(getURL('/assets/sett.tmp'))
9191
<i class="fa fa-wrench"></i>
9292
</a>
9393
`), el.querySelector('a[title="Настройки"]'));
94-
95-
/**
96-
* Да-да, только теперь можно подгружать динамический JS на страницу, и только отдельным файлом
97-
* Тегом script браузер просто проигнорирует)0
98-
*/
9994

10095
fetch(getURL('/assets/integr.js'))
10196
.then(function(response){
@@ -149,7 +144,7 @@ function createPanel ()
149144
( function (b, index) {
150145
var index = a.dataset.cat.toString();
151146

152-
a.innerHTML = page[index].name;
147+
a.textContent = page[index].name;
153148

154149
if (page[index].is == false)
155150
a.style = 'display: none';
@@ -159,13 +154,13 @@ function createPanel ()
159154

160155
el.insertBefore( dom(`
161156
<li class='tab-title'>
162-
<a href="#smile-cat-`+ index +`" data-cat="`+ index +`">`+ name +`</a>
157+
<a href="#smile-cat-${index}" data-cat="${index}">${name}</a>
163158
</li>
164159
`), el.firstChild);
165160

166161
// Приступаем к созданию контента
167162
var content = document.querySelector('div.smiles-panel div.tabs-content'),
168-
div = dom(`<div id='smile-cat-`+ index + `' class='content'></div>`);
163+
div = dom(`<div id='smile-cat-${index}' class='content'></div>`);
169164

170165
// Перебираем все смайлы
171166
for (var i = 0; i < list.length; i++)
@@ -180,9 +175,8 @@ function createPanel ()
180175

181176
div.appendChild( dom(`
182177
<div class='smile-content'>
183-
<a href="#" data-shortcut="`+ shortcut +`" data-mce-url="`+ v.src +`" tabindex="`
184-
+ index +`" title=":`+ v.name +`:">
185-
<img src="`+ v.src +`" role="presentation">
178+
<a href="#" data-shortcut="${shortcut}" data-mce-url="${v.src}" tabindex="${index}" title=":${v.name}:">
179+
<img src="${v.src}" role="presentation">
186180
</a>
187181
</div>
188182
`));
@@ -198,10 +192,15 @@ function createPanel ()
198192
*
199193
* @param string html
200194
*
201-
* @return object
195+
* @return HTMLElement
202196
*/
203197
function dom (html)
204-
{ return new DOMParser().parseFromString(html, 'text/html').querySelector('body').childNodes[0] }
198+
{
199+
return new DOMParser()
200+
.parseFromString(html, 'text/html')
201+
.querySelector('body')
202+
.childNodes[0];
203+
}
205204

206205
/**
207206
* Следит за появлением объекта в DOM сайта

Diff for: manifest.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"manifest_version": 2,
3-
"version": "0.0.4.5",
3+
"version": "0.0.5",
44

55
"name": "Dota2Ru",
66
"description": "Использование сторонних смайлов для форума",
@@ -10,9 +10,9 @@
1010
"matches": [ "*://dota2.ru/forum*" ]
1111
} ],
1212
"icons": {
13-
"128": "/assets/favicon.ico",
14-
"16": "/assets/favicon.ico",
15-
"48": "/assets/favicon.ico"
13+
"128": "/assets/favicon_128.png",
14+
"16": "/assets/favicon_16.png",
15+
"48": "/assets/favicon_48.png"
1616
},
1717
"web_accessible_resources": [ "/assets/*" ]
1818
}

0 commit comments

Comments
 (0)