Skip to content

Commit d537c5e

Browse files
committed
img and swiper
1 parent 746d601 commit d537c5e

7 files changed

Lines changed: 144 additions & 30 deletions

File tree

websitebackup/phpbb/ext/ejpoox/ij/README.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,51 @@ Copy the extension to phpBB/ext/ejpoox/ij
66

77
Go to "ACP" > "Customise" > "Extensions" and enable the "ejsoon ij" extension.
88

9+
There are three BBCode should be add by hands: ij, ijp, ijr.
10+
11+
ij:
12+
bbcode:
13+
```
14+
[ij]{TEXT}[/ij]
15+
```
16+
html:
17+
```
18+
<span class="font_ij">{TEXT}</span>
19+
```
20+
tips:
21+
```
22+
ij倉頡小字型
23+
```
24+
25+
ijp:
26+
bbcode:
27+
```
28+
[ijp]{TEXT}[/ijp]
29+
```
30+
html:
31+
```
32+
<span class="ijp_outer"><div class="ijp_main"><span class="font_ij">{TEXT}</span></div><div class="ijp_bottom"> {TEXT} </div></span>
33+
```
34+
tips:
35+
```
36+
ij plus
37+
```
38+
39+
ijr:
40+
bbcode:
41+
```
42+
[ijr]{TEXT}[/ijr]
43+
```
44+
html:
45+
```
46+
<span class="ijp_outer"><div class="ijr_main"><span class="font_ij">{TEXT}</span></div><div class="ijr_bottom"> {TEXT} </div></span>
47+
```
48+
tips:
49+
```
50+
ij font has a region
51+
```
52+
53+
954
## License
1055

1156
[GNU General Public License v2](license.txt)

websitebackup/phpbb/ext/ejpoox/image/README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ Go to "ACP" > "Customise" > "Extensions" and enable the "ejsoon image" extension
99
Add 3 bbcode in the ACP: imgid, svgid, svg.
1010

1111

12-
13-
14-
15-
1612
bbcode:
1713
```
1814
[imgid]{NUMBER}[/imgid]

websitebackup/phpbb/ext/ejpoox/image/composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"type": "phpbb-extension",
44
"description": "ejsoon image extension",
55
"homepage": "http://ejsoon.win/ejpoox",
6-
"version": "1.0.0-dev",
7-
"time": "2020-12-15",
6+
"version": "1.0.1",
7+
"time": "2021-02-14",
88
"license": "GPL-2.0-only",
99
"authors": [
1010
{

websitebackup/phpbb/ext/ejpoox/image/styles/prosilver/template/the_ejsoon_image.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// ejsoon image extension start -->
22
// html string to element
33
function htmlToElems(html) {
4-
let temp = document.createElement('template');
5-
temp.innerHTML = html;
6-
return temp.content;
4+
let temp = document.createElement('template');
5+
temp.innerHTML = html;
6+
return temp.content;
77
}
88
// get image by ajax
99
function ajximg(type, img, postid) {
@@ -16,14 +16,15 @@ function ajximg(type, img, postid) {
1616
var aacccimg = aaccc.getElementsByTagName("img");
1717
if (aacccimg.length > 0) {
1818
img.src = aacccimg[0].src;
19-
img.classList.add("postimage");
19+
img.className = "postimage";
2020
}
2121
} else if ('svg' == type) {
2222
var aacccsvg = aaccc.getElementsByTagName("svg");
2323
if (aacccsvg.length > 0) {
2424
img.outerHTML = converSVG(aacccsvg[0].outerHTML);
2525
}
2626
}
27+
if (typeof goswiper === 'function') goswiper();
2728
}
2829
}
2930
xmlhttp.open("GET","viewtopic.php?p=" + postid,true);
Lines changed: 62 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,71 @@
1-
# phpbb swiper
1+
# ejsoon swiper
22

33
## Installation
44

55
Copy the extension to phpBB/ext/ejpoox/swiper
66

7-
Go to "ACP" > "Customise" > "Extensions" and enable the "phpbb swiper" extension.
7+
Go to "ACP" > "Customise" > "Extensions" and enable the "ejsoon swiper" extension.
8+
9+
And then add the bbcode [swiper], [ss], [st]:
10+
11+
bbcode:
12+
```
13+
[swiper]{TEXT}[/swiper]
14+
```
15+
16+
html:
17+
```
18+
<div class="swiper-container"><!-- Additional required wrapper -->
19+
<div class="swiper-wrapper"><!-- Slides -->
20+
{TEXT}
21+
</div>
22+
<!-- Add Pagination -->
23+
<div class="swiper-pagination-ejsoon"></div>
24+
<!-- If we need navigation buttons -->
25+
<div class="swiper-button-prev"></div>
26+
<div class="swiper-button-next"></div>
27+
</div>
28+
```
29+
30+
tips:
31+
```
32+
swiper-container
33+
```
34+
35+
36+
bbcode:
37+
```
38+
[ss]{TEXT}[/ss]
39+
```
40+
41+
html:
42+
```
43+
<div class="swiper-slide">{TEXT}</div>
44+
```
45+
46+
tips:
47+
```
48+
swiper-slide
49+
```
50+
51+
52+
bbcode:
53+
```
54+
[st]{TEXT}[/st]
55+
```
56+
57+
html:
58+
```
59+
<div style="position: absolute; bottom: 0; background-color: rgba(0,0,0,0.5); color: white; padding: 12px; width: 100%;">{TEXT}</div>
60+
```
61+
62+
tips:
63+
```
64+
swiper text below
65+
```
866

967
## License
1068

1169
[GNU General Public License v2](license.txt)
70+
71+

websitebackup/phpbb/ext/ejpoox/swiper/composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"type": "phpbb-extension",
44
"description": "ejsoon swiper function",
55
"homepage": "http://ejsoon.win/ejpoox",
6-
"version": "1.0.0-dev",
7-
"time": "2020-09-30",
6+
"version": "1.0.1",
7+
"time": "2021-02-14",
88
"license": "GPL-2.0-only",
99
"authors": [
1010
{
Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,33 @@
11
// swiper start -->
2-
var mySwiper = new Swiper ('.swiper-container', {
3-
loop: true,
4-
autoHeight: true, //enable auto height
5-
pagination: {
6-
el: '.swiper-pagination-ejsoon',
7-
clickable: true,
8-
renderBullet: function (index, className) {
9-
return '<span class="' + className + '">' + (index + 1) + '</span>';
2+
goswiper();
3+
function goswiper() {
4+
// if img, after img loading
5+
var isImg = document.querySelector(".imgid");
6+
var isSvg = document.querySelector(".svgid");
7+
if (isImg || isSvg) {
8+
return;
9+
}
10+
var ifswiper = document.querySelector(".swiper-container");
11+
if (ifswiper) {
12+
var mySwiper = new Swiper ('.swiper-container', {
13+
loop: true,
14+
autoHeight: true, //enable auto height
15+
pagination: {
16+
el: '.swiper-pagination-ejsoon',
17+
clickable: true,
18+
renderBullet: function (index, className) {
19+
return '<span class="' + className + '">' + (index + 1) + '</span>';
20+
},
21+
dynamicBullets: true,
22+
dynamicMainBullets: 3,
1023
},
11-
dynamicBullets: true,
12-
dynamicMainBullets: 3,
13-
},
14-
navigation: {
15-
nextEl: '.swiper-button-next',
16-
prevEl: '.swiper-button-prev',
17-
},
18-
})
24+
navigation: {
25+
nextEl: '.swiper-button-next',
26+
prevEl: '.swiper-button-prev',
27+
},
28+
})
29+
}
30+
}
1931
// swiper end -->
2032

2133

0 commit comments

Comments
 (0)