forked from chitosai/bilimini
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathselectP.html
63 lines (60 loc) · 1.86 KB
/
selectP.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<!DOCTYPE html>
<html lang="cn">
<head>
<meta charset="UTF-8">
<title>Bilibili v.mini</title>
<link rel="stylesheet" href="css/child-window.css">
</head>
<body>
<div id="wrapper">
<span id="close" @click="closeWindow">x</span>
<div id="select-part" class="list">
<p class="list-title">视频分Part</p>
<div class="item part" :class="{'current-ep': index === currentPartId}" v-for="(title, index) in partList" :title="title" @click="selectPart(index)"><span v-show="index == currentPartId">● </span>{{ index + 1 }}) {{ title }}</div>
<div class="item part" :class="{'current-ep': part.epid === currentPartId}" v-for="part in bangumiPartList" :title="part.title" @click="selectBangumiPart(part)"><span v-show="part.epid == currentPartId">● </span>{{ part.epid + 1 }}) {{ part.title }}</div>
</div>
</div>
<script src="js/vue.min.js"></script>
<script>
const ipc = require('electron').ipcRenderer;
const remote = require('electron').remote;
const v = new Vue({
el: '#wrapper',
data: {
partList: null,
bangumiPartList: null,
currentPartId: 0
},
methods: {
selectPart(index) {
this.currentPartId = index;
ipc.send('select-part', index + 1);
},
selectBangumiPart(part) {
this.currentPartId = part.epid;
ipc.send('select-bangumi-part', part);
},
closeWindow() {
remote.getCurrentWindow().hide();
}
}
});
// 更新分p列表
ipc.on('update-part', (ev, partList) => {
v.currentPartId = 0;
v.partList = partList;
v.bangumiPartList = null;
});
// 番剧分p
ipc.on('update-bangumi-part', (ev, data) => {
v.currentPartId = data.currentPartId;
v.partList = null;
v.bangumiPartList = data.parts;
});
window.onerror = function(err, f, line) {
var id = f.split('/');
utils.error(`${id[id.length-1]} : Line ${line}\n> ${err}`);
}
</script>
</body>
</html>