Skip to content

Commit ed319fb

Browse files
author
hikki
committed
v5.0
1 parent f379b3c commit ed319fb

File tree

4 files changed

+122
-44
lines changed

4 files changed

+122
-44
lines changed

resources/assets/component.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@
325325
.dlp-table .dlp-input{height: 24px!important;}
326326
.dlp-table .dlp-tbody{display:block;height:100%;overflow-y:scroll!important;background: rgb(50 50 50 / 80%);}
327327
.dlp-table .dlp-tr{display:table;width:100%;table-layout:fixed;position: relative;}
328-
.dlp-tr>th,.dlp-tr>td{padding: 7px 3px 7px 3px;text-align: left}
328+
.dlp-tr>th,.dlp-tr>td{padding: 3px;text-align: left;height: 38px;}
329329
.dlp-table .dlp-thead>.dlp-tr{height: 45px;border-bottom: 1px solid #060606;}
330330
.dlp-table .dlp-tbody>.dlp-tr{background:#1e1e1e}
331331
.dlp-table .dlp-tbody>.dlp-tr:nth-child(even){background:#2a2a2a}

resources/assets/component.js

Lines changed: 79 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,43 @@ window._component = {
197197
}
198198
dimension++;
199199
_component.dimensional(output, data.nodes, dimension, parentNodes);
200+
},
201+
imgDelay(name,time=200,zoom= false) {
202+
let list = document.getElementsByClassName(name);
203+
let i = 0;
204+
for(let dom of list){
205+
setTimeout(()=>{
206+
let src = dom.getAttribute('data-src');
207+
dom.setAttribute('src',src);
208+
dom.onload = function(){
209+
if(!zoom)return;
210+
let img = document.createElement('img');
211+
dom.setAttribute('data-zoom','0');
212+
dom.addEventListener('mouseover', function(e) {
213+
if(dom.getAttribute('data-zoom') === '1')return;
214+
setTimeout(()=>{
215+
dom.setAttribute('data-zoom','1');
216+
document.body.append(img);
217+
img.style.position = 'absolute';
218+
img.style.top = `${e.pageY - 3}px`;
219+
img.style.left = `${e.pageX - 3}px`;
220+
img.style.zIndex = '1000000';
221+
img.style.width = '300px';
222+
img.style.borderRadius = '3px';
223+
img.setAttribute('src', src);
224+
},100);
225+
});
226+
dom.addEventListener('mouseout', function(e) {
227+
e.stopPropagation();
228+
setTimeout(()=>{
229+
dom.setAttribute('data-zoom','0');
230+
img.remove();
231+
},100);
232+
});
233+
};
234+
},i*time);
235+
i++;
236+
}
200237
}
201238
};
202239

@@ -899,6 +936,7 @@ window.ComponentLine = class {
899936
let style = val.style ? `style="${val.style}"` : '';
900937
head += `<th class="dlp-text text-white" ${style}>${val.name}</th>`;
901938
let insert_type = val.insert_type ? val.insert_type : val.type;
939+
902940
switch (insert_type) {
903941
case 'input':
904942
foot.insertAdjacentHTML('beforeend', `<th ${style}><input class="dlp dlp-input" data-column="${column}" placeholder=":${val.name}"/></th>`);
@@ -934,6 +972,12 @@ window.ComponentLine = class {
934972
foot.insertAdjacentHTML('beforeend', `<th ${style}><input class="dlp dlp-input" data-column="${column}" placeholder=":${val.name}"/></th>`);
935973
break;
936974
}
975+
/*delay image loading*/
976+
if(val.type === 'image'){
977+
setTimeout(()=>{
978+
_component.imgDelay(`${this.NAME}-${column}-img`,200,true);
979+
});
980+
}
937981
}
938982
head += '<th class="operate-column" style="width: 48px;"></th></tr>';
939983
foot.insertAdjacentHTML('beforeend', '<th class="insert_handel operate-column" style="width: 48px;"><div></div></th></tr>');
@@ -991,8 +1035,8 @@ window.ComponentLine = class {
9911035
makeFoot(foot) {
9921036
let tfoot = document.createElement('tfoot');
9931037
tfoot.className = 'dlp-tfoot';
994-
tfoot.insertAdjacentHTML('afterbegin', `<tr class="dlp-tr"></tr>`);
9951038
if (!this.OPTIONS.insert) {
1039+
tfoot.insertAdjacentHTML('afterbegin', `<tr class="dlp-tr"></tr>`);
9961040
this.TABLE_DOM.appendChild(tfoot);
9971041
return;
9981042
}
@@ -1025,6 +1069,37 @@ window.ComponentLine = class {
10251069
insert[column] = value;
10261070
this.makeTd(td, column, this.COLUMNS[column], value);
10271071
tr.appendChild(td);
1072+
1073+
if(this.COLUMNS[column].type === 'image'){
1074+
let dom = td.firstChild;
1075+
setTimeout(()=>{
1076+
let src = dom.getAttribute('data-src');
1077+
dom.setAttribute('src',src);
1078+
let img = document.createElement('img');
1079+
dom.setAttribute('data-zoom','0');
1080+
dom.addEventListener('mouseover', function(e) {
1081+
if(dom.getAttribute('data-zoom') === '1')return;
1082+
setTimeout(()=>{
1083+
dom.setAttribute('data-zoom','1');
1084+
document.body.append(img);
1085+
img.style.position = 'absolute';
1086+
img.style.top = `${e.pageY - 3}px`;
1087+
img.style.left = `${e.pageX - 3}px`;
1088+
img.style.zIndex = '1000000';
1089+
img.style.width = '300px';
1090+
img.style.borderRadius = '3px';
1091+
img.setAttribute('src', src);
1092+
},100);
1093+
});
1094+
dom.addEventListener('mouseout', function(e) {
1095+
e.stopPropagation();
1096+
setTimeout(()=>{
1097+
dom.setAttribute('data-zoom','0');
1098+
img.remove();
1099+
},100);
1100+
});
1101+
},200);
1102+
}
10281103
}
10291104

10301105
let td = document.createElement('td');
@@ -1095,6 +1170,9 @@ window.ComponentLine = class {
10951170
case 'select':
10961171
td.append(this.menuMake(column, value, settings.options, settings.options_limit, settings.name));
10971172
break;
1173+
case 'image':
1174+
td.insertAdjacentHTML('afterbegin',`<img class="${this.NAME}-${column}-img" style="max-width: 100%;max-height: 100%;border-radius: 2px" data-src="${value}" />`);
1175+
break;
10981176
default:
10991177
td.insertAdjacentHTML('afterbegin', `<p style="display: block;" class="dlp text-white dlp-text" title="${value}">${value}</p>`);
11001178
break;

src/DLPServiceProvider.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ public function boot(DLP $extension)
2929
}
3030

3131
Admin::booting(function () {
32-
Admin::css('vendor/dlp/component.min.css?v4.7');
33-
Admin::headerJs('vendor/dlp/component.min.js?v4.7');
32+
Admin::css('vendor/dlp/component.min.css?v5.0');
33+
Admin::headerJs('vendor/dlp/component.min.js?v5.0');
3434
Form::extend('Dot', Dot::class);
3535
Form::extend('CascadeDot', CascadeDot::class);
3636
Form::extend('Linear', Linear::class);

test/index.html

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -234,66 +234,66 @@
234234

235235
new ComponentLine("test2", {
236236
"name": {"name": "名称", "type": "input"},
237-
"meta": {"name": "信息", "type": "text","insert_type":"input"},
238-
"url": {"name": "链接", "type": "image"},
237+
"meta": {"name": "番号", "type": "text","insert_type":"input"},
238+
"url": {"name": "图片", "type": "image"},
239239
"time": {"name": "更新时间", "type": "datetime","insert_type":"datetime"},
240240
"is-small": {"name": "高清", "type": "select","options":{1:'是',2:'否'},"options_limit":1, "style": "width:60px"}
241-
}
242-
, [{
243-
"name": "TushyRaw.21.04.28.Penelope.Kay.XXX.SD.MP4-KLEENEX",
244-
"url": "magnet?xt=urnbtih1b771980c465052d1c96eade30be1297e1f73cff&dn=HDouban.comTushyRaw.21.04.28.Penelope.Kay.XXX.SD.MP4-KLEENEX",
245-
"meta": "(246MB,3\u500b\u6587\u4ef6)",
241+
}, [{
242+
"name": "ごめんなさい、もう別れたいの…別れを拒む彼氏と結んだ《愛人》と言う名の従順契約 美乃すずめ",
243+
"url": "https://img.9618599.com/resources/javdb.com/6180fad2d93894236f287bb2/small_cover.jpg",
244+
"meta": "DLDSS-035",
246245
"time": "2021-05-14 00:00:00",
247246
"is-small": 1
248247
}, {
249-
"name": "T1080",
250-
"url": "magnet?xt=urnbtih20244eea8bafa94c27699ada817638f0a01fdbea&dn=HDouban.comTushyRaw.21.04.28.Penelope.Kay.XXX.1080p.MP4-NBQrarbg",
251-
"meta": "",
252-
"time": "2021-05-15 00:00:00",
253-
"is-small": 1
254-
}, {
255-
"name": "TushyRaw.21.04.28.Penelope.Kay.XXX.720p.HEVC.x265.PRT",
256-
"url": "magnet?xt=urnbtih0c647fd1acb9e6c3bf617c117e60c86b29fa233c&dn=HDouban.comTushyRaw.21.04.28.Penelope.Kay.XXX.720p.HEVC.x265.PRT",
257-
"meta": "(236MB,2\u500b\u6587\u4ef6)",
248+
"name": "母姉W相姦 木下あずみ 沖田杏梨",
249+
"url": "https://img.9618599.com/resources//d41d8cd98f00b204e9800998ecf8427e/1eeef553b3a975f5.jpg",
250+
"meta": "MIMK-020",
258251
"time": "2021-05-14 00:00:00",
259252
"is-small": 2
260253
}, {
261-
"name": "TushyRaw.21.04.28.Penelope.Kay.XXX.480p.MP4-XXX",
262-
"url": "magnet?xt=urnbtih7DE13EF7EE22D9780F7DE6C459D6DD33F64D126C",
263-
"meta": "251.82M",
254+
"name": "ヌードモデルNTR監督『ながえ』作品!!×『新作』寝取られドラマ!!武藤あやか",
255+
"url": "https://img.9618599.com/resources//d41d8cd98f00b204e9800998ecf8427e/07737929ec75781e.jpeg",
256+
"meta": "JUL-401",
264257
"time": "2021-12-14 13:24:46",
265-
"is-small": 2
258+
"is-small": 1
266259
}, {
267-
"name": "TushyRaw.21.04.28.Penelope.Kay.XXX.1080p.MP4-NBQrarbg",
268-
"url": "magnet?xt=urnbtih20244EEA8BAFA94C27699ADA817638F0A01FDBEA",
269-
"meta": "2.65G",
260+
"name": "妻晒し 表の顔は貞淑妻、裏の顔は変態妻の公開記録―。 木下凛々子",
261+
"url": "https://img.9618599.com/resources//d41d8cd98f00b204e9800998ecf8427e/b1a3cffd40eca68c.jpg",
262+
"meta": "JUL-953",
270263
"time": "2021-12-14 13:24:46",
271264
"is-small": 2
272265
}, {
273-
"name": "TushyRaw.21.04.28.Penelope.Kay.XXX.SD.MP4-KLEENEX",
274-
"url": "magnet?xt=urnbtih1B771980C465052D1C96EADE30BE1297E1F73CFF",
275-
"meta": "246.64M",
266+
"name": "担任教師に3年分の妄想・愛・性欲をぶち撒けた卒業式前夜 miru (ブルーレイディスク)",
267+
"url": "https://img.9618599.com/resources/javdb.com/61e1171d16a76b11f7375cde/small_cover.jpg",
268+
"meta": "SSIS-317",
276269
"time": "2021-12-14 13:24:46",
277-
"is-small": 2
270+
"is-small": 1
278271
}, {
279-
"name": "TushyRaw.21.04.28.Penelope.Kay.XXX.720p.HEVC.x265.PRT",
280-
"url": "magnet?xt=urnbtih0C647FD1ACB9E6C3BF617C117E60C86B29FA233C",
281-
"meta": "236.12M",
272+
"name": "地元へ帰省した三日間、人妻になっていた幼馴染のお姉さんと時を忘れて愛し合った記録―。 水野朝陽",
273+
"url": "https://img.9618599.com/resources//javdb/small_cover/2c1e135328f487754667b1c348321f32.jpg",
274+
"meta": "JUL-619",
282275
"time": "2021-12-14 13:24:46",
283-
"is-small": 2
276+
"is-small": 1
284277
}, {
285-
"name": "TushyRaw.21.04.28.Penelope.Kay.XXX.1080p.HEVC.x265.PRT",
286-
"url": "magnet?xt=urnbtihA4B92AFFB6A39E2B3F69064EF174598CA2D6C630",
287-
"meta": "412.77M",
278+
"name": "解禁 はじめての真正中出しSEX 天川そら",
279+
"url": "https://img.9618599.com/resources/javbus.com/62fbe933bc6b9a601a46e2e5/small_cover.jpg",
280+
"meta": "HMN-247",
288281
"time": "2021-12-14 13:24:46",
289-
"is-small": 2
282+
"is-small": 1
290283
}, {
291-
"name": "TushyRaw.21.04.28.Penelope.Kay.XXX.1080p.MP4-NBQrarbg",
292-
"url": "magnet?xt=urnbtih20244eea8bafa94c27699ada817638f0a01fdbea&dn=TushyRaw.21.04.28.Penelope.Kay.XXX.1080p.MP4-NBQrarbg",
293-
"meta": "",
284+
"name": "アナル舐めさせ小悪魔痴女 肛門クンニでむせるほど匂いと味を染みつかせケツ穴ヒクヒク丸出しSEXでイキ狂うプリ尻ビッチちゃん",
285+
"url": "https://img.9618599.com/resources//javdb/small_cover/20138589b4d86fc23bc08c414baa5fd6.jpg",
286+
"meta": "DVDMS-705",
294287
"time": "2022-02-08 10:22:37",
295-
"is-small": 2
296-
}]);
288+
"is-small": 1
289+
}, {
290+
"name": "The Room 「W」 羨望のM男ハーレムへようこそ 有村千佳 波多野結衣",
291+
"url": "https://img.9618599.com/resources//javdb/small_cover/807d6aef9a4e6366a28578ac362d7a1d.jpg",
292+
"meta": "DMBL-001",
293+
"time": "2022-02-08 10:22:37",
294+
"is-small": 1
295+
},
296+
]);
297297

298298
document.getElementById('test3').addEventListener('click', function () {
299299
new ComponentPlane();

0 commit comments

Comments
 (0)