// ==UserScript==
// @name Javlibrary - 首页一站式影片预览
// @version 0.7.1
// @description 不需要跳转,在 javlibrary 首页就能直接预览影片。
// @author thinker
// @namespace https://greasyfork.org/users/440616
// @include http*://www.javlibrary.com/cn/
// @include http*://www.javlibrary.com/cn/?__cf_chl_jschl_tk__*
// @require https://cdn.bootcss.com/vue/2.6.10/vue.runtime.min.js
// @require https://unpkg.com/rectangle-transform@0.4.0/lib/rectangle-transform.min.js
// @grant GM_xmlhttpRequest
// ==/UserScript==
(function (RTListener, Vue) {
'use strict';
function __$styleInject(css) {
if (!css) return;
if (typeof window == 'undefined') return;
var style = document.createElement('style');
style.setAttribute('media', 'screen');
style.innerHTML = css;
document.head.appendChild(style);
return css;
}
RTListener = RTListener && RTListener.hasOwnProperty('default') ? RTListener['default'] : RTListener;
Vue = Vue && Vue.hasOwnProperty('default') ? Vue['default'] : Vue;
//
//
//
//
//
//
//
//
//
//
//
var script = {
props: {
zIndex: {
default: 1
}
},
data () {
return {
show: true
}
},
mounted () {
this.show = this.optionShow;
},
computed: {
optionShow () {
return this.$root.options.showApp
}
}
};
function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier /* server only */, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) {
if (typeof shadowMode !== 'boolean') {
createInjectorSSR = createInjector;
createInjector = shadowMode;
shadowMode = false;
}
// Vue.extend constructor export interop.
const options = typeof script === 'function' ? script.options : script;
// render functions
if (template && template.render) {
options.render = template.render;
options.staticRenderFns = template.staticRenderFns;
options._compiled = true;
// functional template
if (isFunctionalTemplate) {
options.functional = true;
}
}
// scopedId
if (scopeId) {
options._scopeId = scopeId;
}
let hook;
if (moduleIdentifier) {
// server build
hook = function (context) {
// 2.3 injection
context =
context || // cached call
(this.$vnode && this.$vnode.ssrContext) || // stateful
(this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext); // functional
// 2.2 with runInNewContext: true
if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
context = __VUE_SSR_CONTEXT__;
}
// inject component styles
if (style) {
style.call(this, createInjectorSSR(context));
}
// register component module identifier for async chunk inference
if (context && context._registeredComponents) {
context._registeredComponents.add(moduleIdentifier);
}
};
// used by ssr in case component is cached and beforeCreate
// never gets called
options._ssrRegister = hook;
}
else if (style) {
hook = shadowMode
? function (context) {
style.call(this, createInjectorShadow(context, this.$root.$options.shadowRoot));
}
: function (context) {
style.call(this, createInjector(context));
};
}
if (hook) {
if (options.functional) {
// register for functional component in vue file
const originalRender = options.render;
options.render = function renderWithStyleInjection(h, context) {
hook.call(context);
return originalRender(h, context);
};
}
else {
// inject component registration as beforeCreate hook
const existing = options.beforeCreate;
options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
}
}
return script;
}
const isOldIE = typeof navigator !== 'undefined' &&
/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());
function createInjector(context) {
return (id, style) => addStyle(id, style);
}
let HEAD;
const styles = {};
function addStyle(id, css) {
const group = isOldIE ? css.media || 'default' : id;
const style = styles[group] || (styles[group] = { ids: new Set(), styles: [] });
if (!style.ids.has(id)) {
style.ids.add(id);
let code = css.source;
if (css.map) {
// https://developer.chrome.com/devtools/docs/javascript-debugging
// this makes source maps inside style tags work properly in Chrome
code += '\n/*# sourceURL=' + css.map.sources[0] + ' */';
// http://stackoverflow.com/a/26603875
code +=
'\n/*# sourceMappingURL=data:application/json;base64,' +
btoa(unescape(encodeURIComponent(JSON.stringify(css.map)))) +
' */';
}
if (!style.element) {
style.element = document.createElement('style');
style.element.type = 'text/css';
if (css.media)
style.element.setAttribute('media', css.media);
if (HEAD === undefined) {
HEAD = document.head || document.getElementsByTagName('head')[0];
}
HEAD.appendChild(style.element);
}
if ('styleSheet' in style.element) {
style.styles.push(code);
style.element.styleSheet.cssText = style.styles
.filter(Boolean)
.join('\n');
}
else {
const index = style.ids.size - 1;
const textNode = document.createTextNode(code);
const nodes = style.element.childNodes;
if (nodes[index])
style.element.removeChild(nodes[index]);
if (nodes.length)
style.element.insertBefore(textNode, nodes[index]);
else
style.element.appendChild(textNode);
}
}
}
/* script */
const __vue_script__ = script;
/* template */
var __vue_render__ = function() {
var _vm = this;
var _h = _vm.$createElement;
var _c = _vm._self._c || _h;
return _c(
"div",
{ staticClass: "ti-container", style: { zIndex: _vm.zIndex } },
[
_c(
"div",
{
staticClass: "toggle",
class: _vm.show ? "to-hide" : "to-show",
on: {
click: function($event) {
_vm.show = !_vm.show;
}
}
},
[_c("i", { staticClass: "ti-toggle" })]
),
_vm._v(" "),
_vm.show
? _c("div", { staticClass: "main" }, [_vm._t("default")], 2)
: _vm._e()
]
)
};
var __vue_staticRenderFns__ = [];
__vue_render__._withStripped = true;
/* style */
const __vue_inject_styles__ = function (inject) {
if (!inject) return
inject("data-v-31bce63c_0", { source: ".ti-container[data-v-31bce63c] {\n position: fixed;\n left: 0;\n top: 0;\n}\n.ti-container .toggle[data-v-31bce63c] {\n position: absolute;\n left: -20px;\n top: -20px;\n width: 40px;\n height: 40px;\n border-bottom-right-radius: 20px;\n background-color: #ee4dba;\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: 10;\n}\n.ti-container .toggle.to-show[data-v-31bce63c] {\n animation: 1.5s A-data-v-31bce63c infinite;\n}\n.ti-container .toggle .ti-toggle[data-v-31bce63c] {\n font-size: 13px;\n width: 1em;\n height: 1em;\n border: 2px solid #fff;\n display: inline-block;\n transition: 0.5s all;\n border-right: 0;\n border-bottom: 0;\n}\n.ti-container .toggle.to-show .ti-toggle[data-v-31bce63c] {\n transform: rotate(180deg);\n}\n@keyframes A-data-v-31bce63c {\n50% {\n transform: scale(1.4, 1.4);\n}\n}\n.ti-container .toggle[data-v-31bce63c]:hover {\n left: 0;\n top: 0;\n}\n.ti-container .main[data-v-31bce63c] {\n background-color: #000000cb;\n}\n", map: {"version":3,"sources":["container.vue","/home/ti/_code/_tm/javlib-preview/src/components/container.vue"],"names":[],"mappings":"AAAA;EACE,eAAe;EACf,OAAO;EACP,MAAM;AACR;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,UAAU;EACV,WAAW;EACX,YAAY;EACZ,gCAAgC;EAChC,yBAAyB;EACzB,aAAa;EACb,uBAAuB;EACvB,mBAAmB;EACnB,WAAW;AACb;AACA;EACE,0CAA0B;AAC5B;AACA;EACE,eAAe;EACf,UAAU;EACV,WAAW;EACX,sBAAsB;EACtB,qBAAqB;EACrB,oBAAoB;EACpB,eAAe;EACf,gBAAgB;AAClB;AACA;EACE,yBAAyB;AAC3B;AACA;ACCA;IACA,0BAAA;AACA;AACA;AACA;EACA,OAAA;EACA,MAAA;AACA;AACA;EACA,2BAAA;AACA","file":"container.vue","sourcesContent":[".ti-container {\n position: fixed;\n left: 0;\n top: 0;\n}\n.ti-container .toggle {\n position: absolute;\n left: -20px;\n top: -20px;\n width: 40px;\n height: 40px;\n border-bottom-right-radius: 20px;\n background-color: #ee4dba;\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: 10;\n}\n.ti-container .toggle.to-show {\n animation: 1.5s A infinite;\n}\n.ti-container .toggle .ti-toggle {\n font-size: 13px;\n width: 1em;\n height: 1em;\n border: 2px solid #fff;\n display: inline-block;\n transition: 0.5s all;\n border-right: 0;\n border-bottom: 0;\n}\n.ti-container .toggle.to-show .ti-toggle {\n transform: rotate(180deg);\n}\n@keyframes A {\n 50% {\n transform: scale(1.4, 1.4);\n }\n}\n.ti-container .toggle:hover {\n left: 0;\n top: 0;\n}\n.ti-container .main {\n background-color: #000000cb;\n}\n","<template>\n <div class=\"ti-container\" :style=\"{zIndex}\">\n <div class=\"toggle\" :class=\"show ? 'to-hide' : 'to-show'\" @click=\"show = !show\">\n <i class=\"ti-toggle\"></i>\n </div>\n <div class=\"main\" v-if=\"show\">\n <slot></slot>\n </div>\n </div>\n</template>\n\n<script>\nexport default {\n props: {\n zIndex: {\n default: 1\n }\n },\n data () {\n return {\n show: true\n }\n },\n mounted () {\n this.show = this.optionShow\n },\n computed: {\n optionShow () {\n return this.$root.options.showApp\n }\n }\n}\n</script>\n\n<style scoped lang=\"less\">\n.ti-container\n{\n position: fixed;\n left: 0;\n top: 0;\n}\n.ti-container .toggle\n{\n @size: 40px;\n @half: @size / 2;\n position: absolute;\n left: -@half;\n top: -@half;\n width: @size;\n height: @size; \n border-bottom-right-radius: @half;\n background-color: #ee4dba;\n display: flex;\n justify-content: center;\n align-items: center;\n z-index: 10;\n &.to-show {\n animation: 1.5s A infinite;\n }\n\n .ti-toggle {\n font-size: 13px;\n width: 1em;\n height: 1em;\n border: 2px solid #fff;\n display: inline-block;\n transition: .5s all;\n border-right: 0;\n border-bottom: 0;\n }\n &.to-show .ti-toggle {\n transform: rotate(180deg);\n }\n}\n\n@keyframes A {\n 50% {\n transform: scale(1.4, 1.4);\n }\n}\n\n.ti-container .toggle:hover\n{\n left: 0;\n top: 0;\n}\n.ti-container .main\n{\n background-color: #000000cb;\n}\n\n</style>\n"]}, media: undefined });
};
/* scoped */
const __vue_scope_id__ = "data-v-31bce63c";
/* module identifier */
const __vue_module_identifier__ = undefined;
/* functional template */
const __vue_is_functional_template__ = false;
/* style inject SSR */
/* style inject shadow dom */
const __vue_component__ = normalizeComponent(
{ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
__vue_inject_styles__,
__vue_script__,
__vue_scope_id__,
__vue_is_functional_template__,
__vue_module_identifier__,
false,
createInjector,
undefined,
undefined
);
//
var script$1 = {
props: {
src: {
default: ''
}
},
data () {
return {
bounding: {
left: window.screen.availWidth - 838,
top: window.screen.availHeight - 550,
width: 838,
height: 550,
}
}
},
computed: {
styles () {
return Object.keys(this.bounding).reduce((s, k) => {
s[k] = this.bounding[k] + 'px';
return s
}, {})
}
},
methods: {
onload (ev) {
console.log('load');
const doc = ev.target.contentDocument;
const devStyle = doc.createElement('style');
devStyle.innerHTML = `
/*# .vue */
#video_jacket_img {
width: 100%;
height: 100%;
}
#leftmenu, #toplogo, #topmenu {
display: none;
}
#rightcolumn {
margin: 0px 10px 10px 0px;
}
`;
doc.head.appendChild(devStyle);
},
transform (ev, control) {
RTListener(ev, {
control,
target: this.bounding,
animationFrameUpdate: true
}, ({target}) => {
this.bounding = target;
});
},
}
};
/* script */
const __vue_script__$1 = script$1;
/* template */
var __vue_render__$1 = function() {
var _vm = this;
var _h = _vm.$createElement;
var _c = _vm._self._c || _h;
return _c(
"div",
{
directives: [
{ name: "show", rawName: "v-show", value: _vm.src, expression: "src" }
],
staticClass: "tm-jav-window",
style: _vm.styles
},
[
_c(
"div",
{
staticClass: "tm-jav-window--header",
on: {
mousedown: function($event) {
return _vm.transform($event, "xy")
}
}
},
[
_c("span", [_vm._v("可拖拽,右下可缩放")]),
_vm._v(" "),
_c("i", {
staticClass: "tm-jav--close",
on: {
click: function($event) {
return _vm.$emit("close")
}
}
})
]
),
_vm._v(" "),
_vm.src
? _c("iframe", {
ref: "iframe",
attrs: { src: _vm.src, frameborder: "0" },
on: { load: _vm.onload }
})
: _vm._e(),
_vm._v(" "),
_c("i", {
staticClass: "tm-jav-window--resize",
on: {
mousedown: function($event) {
return _vm.transform($event, "rb")
}
}
})
]
)
};
var __vue_staticRenderFns__$1 = [];
__vue_render__$1._withStripped = true;
/* style */
const __vue_inject_styles__$1 = function (inject) {
if (!inject) return
inject("data-v-28c49dac_0", { source: ".tm-jav-window[data-v-28c49dac] {\n position: fixed;\n z-index: 100;\n background: #fff;\n box-shadow: 0px -2px 9px 4px rgba(0, 0, 0, 0.35);\n}\n.tm-jav-window iframe[data-v-28c49dac] {\n width: 100%;\n height: 100%;\n}\n.tm-jav-window--header[data-v-28c49dac] {\n position: relative;\n height: 20px;\n background-color: #ddd;\n cursor: move;\n padding-left: 10px;\n color: #888;\n}\n.tm-jav-window--header .tm-jav--close[data-v-28c49dac] {\n position: absolute;\n right: 10px;\n font-size: 18px;\n background: transparent;\n cursor: pointer;\n}\n.tm-jav-window--resize[data-v-28c49dac] {\n position: absolute;\n right: 0;\n bottom: -20px;\n border: 8px solid #888;\n cursor: nw-resize;\n border-top-color: transparent;\n border-left-color: transparent;\n}\n.tm-jav-window--resize[data-v-28c49dac]:hover {\n border-right-color: #ccc;\n border-bottom-color: #ccc;\n}\n", map: {"version":3,"sources":["window.vue"],"names":[],"mappings":"AAAA;EACE,eAAe;EACf,YAAY;EACZ,gBAAgB;EAChB,gDAAgD;AAClD;AACA;EACE,WAAW;EACX,YAAY;AACd;AACA;EACE,kBAAkB;EAClB,YAAY;EACZ,sBAAsB;EACtB,YAAY;EACZ,kBAAkB;EAClB,WAAW;AACb;AACA;EACE,kBAAkB;EAClB,WAAW;EACX,eAAe;EACf,uBAAuB;EACvB,eAAe;AACjB;AACA;EACE,kBAAkB;EAClB,QAAQ;EACR,aAAa;EACb,sBAAsB;EACtB,iBAAiB;EACjB,6BAA6B;EAC7B,8BAA8B;AAChC;AACA;EACE,wBAAwB;EACxB,yBAAyB;AAC3B","file":"window.vue","sourcesContent":[".tm-jav-window {\n position: fixed;\n z-index: 100;\n background: #fff;\n box-shadow: 0px -2px 9px 4px rgba(0, 0, 0, 0.35);\n}\n.tm-jav-window iframe {\n width: 100%;\n height: 100%;\n}\n.tm-jav-window--header {\n position: relative;\n height: 20px;\n background-color: #ddd;\n cursor: move;\n padding-left: 10px;\n color: #888;\n}\n.tm-jav-window--header .tm-jav--close {\n position: absolute;\n right: 10px;\n font-size: 18px;\n background: transparent;\n cursor: pointer;\n}\n.tm-jav-window--resize {\n position: absolute;\n right: 0;\n bottom: -20px;\n border: 8px solid #888;\n cursor: nw-resize;\n border-top-color: transparent;\n border-left-color: transparent;\n}\n.tm-jav-window--resize:hover {\n border-right-color: #ccc;\n border-bottom-color: #ccc;\n}\n"]}, media: undefined });
};
/* scoped */
const __vue_scope_id__$1 = "data-v-28c49dac";
/* module identifier */
const __vue_module_identifier__$1 = undefined;
/* functional template */
const __vue_is_functional_template__$1 = false;
/* style inject SSR */
/* style inject shadow dom */
const __vue_component__$1 = normalizeComponent(
{ render: __vue_render__$1, staticRenderFns: __vue_staticRenderFns__$1 },
__vue_inject_styles__$1,
__vue_script__$1,
__vue_scope_id__$1,
__vue_is_functional_template__$1,
__vue_module_identifier__$1,
false,
createInjector,
undefined,
undefined
);
//
//
//
//
//
//
//
//
//
//
//
//
//
var script$2 = {
props: {
video: {
type: Object,
default: null
}
},
methods: {
showPreview () {
this.$emit('show-preview');
}
}
};
/* script */
const __vue_script__$2 = script$2;
/* template */
var __vue_render__$2 = function() {
var _vm = this;
var _h = _vm.$createElement;
var _c = _vm._self._c || _h;
return _c("div", { staticClass: "tm-jav-item" }, [
_c("div", { staticClass: "tm-jav-item--inner" }, [
_c("img", {
staticClass: "tm-jav-item--cover",
attrs: { src: _vm.video.image, alt: _vm.video.title, width: "100%" }
}),
_vm._v(" "),
_c("div", { staticClass: "play-btn", on: { click: _vm.showPreview } }),
_vm._v(" "),
_c("div", { staticClass: "tm-jav-item--info" }, [
_c("span", { staticClass: "tm-jav-item--avid" }, [
_vm._v(_vm._s(_vm.video.avid))
]),
_vm._v(" "),
_c(
"a",
{
staticClass: "tm-jav-item--title",
attrs: {
target: "_blank",
href: _vm.video.href,
title: _vm.video.title
}
},
[_vm._v(_vm._s(_vm.video.title))]
)
])
])
])
};
var __vue_staticRenderFns__$2 = [];
__vue_render__$2._withStripped = true;
/* style */
const __vue_inject_styles__$2 = function (inject) {
if (!inject) return
inject("data-v-c72cc496_0", { source: ".tm-jav-item[data-v-c72cc496] {\n min-height: 200px;\n min-width: 147px;\n padding: 8px;\n display: inline-block;\n overflow: hidden;\n position: relative;\n}\n.tm-jav-item--cover[data-v-c72cc496] {\n max-height: 200px;\n max-height: 300px;\n object-fit: cover;\n}\n.tm-jav-item--inner[data-v-c72cc496] {\n width: 100%;\n height: 100%;\n position: relative;\n}\n.tm-jav-item--info[data-v-c72cc496] {\n color: #fff;\n text-shadow: 1px 1px 2px black;\n transition: all 0.5s;\n position: absolute;\n z-index: 1;\n left: 0;\n top: 70%;\n height: 30%;\n display: block;\n background-color: rgba(32, 32, 32, 0.3);\n width: 100%;\n overflow: hidden;\n}\n.tm-jav-item--title[data-v-c72cc496] {\n color: #fff;\n}\n.tm-jav-item .play-btn[data-v-c72cc496] {\n transition: all 0.5s;\n position: absolute;\n bottom: 30%;\n left: 0px;\n width: 1em;\n height: 1em;\n border-radius: 1em;\n font-size: 30px;\n cursor: pointer;\n z-index: 2;\n background-color: rgba(32, 32, 32, 0.3);\n}\n.tm-jav-item .play-btn[data-v-c72cc496]::before {\n content: '';\n position: absolute;\n left: 0.1em;\n top: 0.1em;\n width: 0.8em;\n height: 0.8em;\n border-radius: 0.8em;\n border-width: 2px;\n border-style: solid;\n border-color: white;\n border-image: initial;\n box-sizing: border-box;\n}\n.tm-jav-item .play-btn[data-v-c72cc496]::after {\n border-width: 0.3em 0 0.3em 0.4em;\n top: 0.2em;\n left: 0.35em;\n content: \"\";\n position: absolute;\n border-style: solid;\n border-color: transparent white;\n border-image: initial;\n}\n.tm-jav-item .play-btn[data-v-c72cc496]:hover::before {\n border-color: #ffa04c;\n}\n.tm-jav-item .play-btn[data-v-c72cc496]:hover::after {\n border-color: transparent #ffa04c;\n}\n.tm-jav-item:hover .play-btn[data-v-c72cc496] {\n bottom: 4px;\n}\n.tm-jav-item:hover .tm-jav-item[data-v-c72cc496] {\n box-shadow: rgba(45, 45, 45, 0.05) 0px 2px 2px 0px rgba(42, 42, 42, 0.05) 0px 8px 8px 0px, rgba(32, 32, 32, 0.05) 0px 16px 16px 0px, rgba(49, 49, 49, 0.05) 0px 32px 32px 0px, rgba(35, 35, 35, 0.05) 0px 64px 64px 0px;\n}\n.tm-jav-item:hover .tm-jav-item--inner[data-v-c72cc496] {\n transform: scale(1.08);\n transform-origin: center center;\n}\n.tm-jav-item:hover .tm-jav-item--cover[data-v-c72cc496] {\n filter: blur(2px);\n}\n.tm-jav-item:hover .tm-jav-item--info[data-v-c72cc496] {\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n}\n", map: {"version":3,"sources":["item.vue","/home/ti/_code/_tm/javlib-preview/src/components/item.vue"],"names":[],"mappings":"AAAA;EACE,iBAAiB;EACjB,gBAAgB;EAChB,YAAY;EACZ,qBAAqB;EACrB,gBAAgB;EAChB,kBAAkB;AACpB;AACA;EACE,iBAAiB;EACjB,iBAAiB;EACjB,iBAAiB;AACnB;AACA;EACE,WAAW;EACX,YAAY;EACZ,kBAAkB;AACpB;AACA;EACE,WAAW;EACX,8BAA8B;EAC9B,oBAAoB;EACpB,kBAAkB;EAClB,UAAU;EACV,OAAO;EACP,QAAQ;EACR,WAAW;EACX,cAAc;EACd,uCAAuC;EACvC,WAAW;ECCb,gBAAA;AACA;AACA;EACA,WAAA;AACA;AACA;EACA,oBAAA;EDCE,kBAAkB;ECCpB,WAAA;EACA,SAAA;EACA,UAAA;EACA,WAAA;EACA,kBAAA;EDCE,eAAe;ECCjB,eAAA;EACA,UAAA;EACA,uCAAA;AACA;AACA;EDCE,WAAW;ECCb,kBAAA;EACA,WAAA;EACA,UAAA;EACA,YAAA;EACA,aAAA;EACA,oBAAA;EACA,iBAAA;EACA,mBAAA;EACA,mBAAA;EACA,qBAAA;EACA,sBAAA;AACA;AACA;EACA,iCAAA;EDCE,UAAU;ECCZ,YAAA;EACA,WAAA;EACA,kBAAA;EACA,mBAAA;EACA,+BAAA;EACA,qBAAA;AACA;AACA;EACA,qBAAA;AACA;AACA;EACA,iCAAA;AACA;AACA;EACA,WAAA;ADCA;ACCA;EACA,uNAAA;AACA;AACA;EACA,sBAAA;EACA,+BAAA;AACA;AACA;EACA,iBAAA;AACA;AACA;EACA,kBAAA;EACA,MAAA;EACA,OAAA;EACA,YAAA;AACA","file":"item.vue","sourcesContent":[".tm-jav-item {\n min-height: 200px;\n min-width: 147px;\n padding: 8px;\n display: inline-block;\n overflow: hidden;\n position: relative;\n}\n.tm-jav-item--cover {\n max-height: 200px;\n max-height: 300px;\n object-fit: cover;\n}\n.tm-jav-item--inner {\n width: 100%;\n height: 100%;\n position: relative;\n}\n.tm-jav-item--info {\n color: #fff;\n text-shadow: 1px 1px 2px black;\n transition: all 0.5s;\n position: absolute;\n z-index: 1;\n left: 0;\n top: 70%;\n height: 30%;\n display: block;\n background-color: rgba(32, 32, 32, 0.3);\n width: 100%;\n overflow: hidden;\n}\n.tm-jav-item--title {\n color: #fff;\n}\n.tm-jav-item .play-btn {\n transition: all 0.5s;\n position: absolute;\n bottom: 30%;\n left: 0px;\n width: 1em;\n height: 1em;\n border-radius: 1em;\n font-size: 30px;\n cursor: pointer;\n z-index: 2;\n background-color: rgba(32, 32, 32, 0.3);\n}\n.tm-jav-item .play-btn::before {\n content: '';\n position: absolute;\n left: 0.1em;\n top: 0.1em;\n width: 0.8em;\n height: 0.8em;\n border-radius: 0.8em;\n border-width: 2px;\n border-style: solid;\n border-color: white;\n border-image: initial;\n box-sizing: border-box;\n}\n.tm-jav-item .play-btn::after {\n border-width: 0.3em 0 0.3em 0.4em;\n top: 0.2em;\n left: 0.35em;\n content: \"\";\n position: absolute;\n border-style: solid;\n border-color: transparent white;\n border-image: initial;\n}\n.tm-jav-item .play-btn:hover::before {\n border-color: #ffa04c;\n}\n.tm-jav-item .play-btn:hover::after {\n border-color: transparent #ffa04c;\n}\n.tm-jav-item:hover .play-btn {\n bottom: 4px;\n}\n.tm-jav-item:hover .tm-jav-item {\n box-shadow: rgba(45, 45, 45, 0.05) 0px 2px 2px 0px rgba(42, 42, 42, 0.05) 0px 8px 8px 0px, rgba(32, 32, 32, 0.05) 0px 16px 16px 0px, rgba(49, 49, 49, 0.05) 0px 32px 32px 0px, rgba(35, 35, 35, 0.05) 0px 64px 64px 0px;\n}\n.tm-jav-item:hover .tm-jav-item--inner {\n transform: scale(1.08);\n transform-origin: center center;\n}\n.tm-jav-item:hover .tm-jav-item--cover {\n filter: blur(2px);\n}\n.tm-jav-item:hover .tm-jav-item--info {\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n}\n","<template>\n <div class=\"tm-jav-item\">\n <div class=\"tm-jav-item--inner\">\n <img class=\"tm-jav-item--cover\" :src=\"video.image\" :alt=\"video.title\" width=\"100%\">\n <div class=\"play-btn\" @click=\"showPreview\"></div>\n <div class=\"tm-jav-item--info\">\n <span class=\"tm-jav-item--avid\">{{video.avid}}</span>\n <a class=\"tm-jav-item--title\" target=\"_blank\" :href=\"video.href\" :title=\"video.title\">{{video.title}}</a>\n </div>\n </div>\n </div>\n</template>\n\n<script>\nexport default {\n props: {\n video: {\n type: Object,\n default: null\n }\n },\n methods: {\n showPreview () {\n this.$emit('show-preview')\n }\n }\n}\n</script>\n\n<style scoped lang=\"less\">\n.tm-jav-item {\n min-height: 200px;\n min-width: 147px;\n padding: 8px;\n display: inline-block;\n overflow: hidden;\n position: relative;\n\n &--cover {\n max-height: 200px;\n max-height: 300px;\n object-fit: cover;\n }\n\n &--inner {\n width: 100%;\n height: 100%;\n position: relative;\n }\n\n &--info {\n color: #fff;\n text-shadow: 1px 1px 2px black;\n transition: all 0.5s;\n position: absolute;\n z-index: 1;\n left: 0;\n top: 70%;\n height: 30%;\n display: block;\n background-color: rgba(32, 32, 32, 0.3);\n width: 100%;\n overflow: hidden;\n }\n\n &--title {\n color: #fff;\n }\n .play-btn {\n transition: all 0.5s;\n position: absolute;\n bottom: 30%;\n left: 0px;\n width: 1em;\n height: 1em;\n border-radius: 1em;\n font-size: 30px;\n cursor: pointer;\n z-index: 2;\n background-color: rgba(32, 32, 32, 0.3);\n\n &::before {\n content: '';\n position: absolute;\n left: 0.1em;\n top: 0.1em;\n width: 0.8em;\n height: .8em;\n border-radius: 0.8em;\n border-width: 2px;\n border-style: solid;\n border-color: white;\n border-image: initial;\n box-sizing: border-box;\n }\n &::after {\n border-width: .3em 0 .3em .4em;\n top: .2em;\n left: .35em;\n content: \"\";\n position: absolute;\n border-style: solid;\n border-color: transparent white;\n border-image: initial;\n }\n &:hover{\n &::before {\n border-color: #ffa04c;\n }\n &::after {\n border-color: transparent #ffa04c;\n }\n }\n }\n\n &:hover .play-btn {\n bottom: 4px;\n }\n\n &:hover & {\n box-shadow: rgba(45, 45, 45, 0.05) 0px 2px 2px 0px\n rgba(42, 42, 42, 0.05) 0px 8px 8px 0px, \n rgba(32, 32, 32, 0.05) 0px 16px 16px 0px,\n rgba(49, 49, 49, 0.05) 0px 32px 32px 0px,\n rgba(35, 35, 35, 0.05) 0px 64px 64px 0px;\n\n &--inner {\n transform: scale(1.08);\n transform-origin: center center;\n }\n &--cover {\n filter: blur(2px);\n }\n &--info { \n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n }\n }\n\n}\n</style>"]}, media: undefined });
};
/* scoped */
const __vue_scope_id__$2 = "data-v-c72cc496";
/* module identifier */
const __vue_module_identifier__$2 = undefined;
/* functional template */
const __vue_is_functional_template__$2 = false;
/* style inject SSR */
/* style inject shadow dom */
const __vue_component__$2 = normalizeComponent(
{ render: __vue_render__$2, staticRenderFns: __vue_staticRenderFns__$2 },
__vue_inject_styles__$2,
__vue_script__$2,
__vue_scope_id__$2,
__vue_is_functional_template__$2,
__vue_module_identifier__$2,
false,
createInjector,
undefined,
undefined
);
/**
* 确保 ref 元素已经挂载
*
* @param {Vue} vm
* @param {string} ref
* @param {number} timeout
*/
function throttle (func, wait, immediate) {
let timeout;
return function () {
const context = this;
const args = arguments;
const later = function () {
timeout = null;
if (!immediate) {
func.apply(context, args);
}
};
const callNow = immediate && !timeout;
clearTimeout(timeout);
timeout = setTimeout(later, wait);
if (callNow) {
func.apply(context, args);
}
}
}
function remove (arr, item) {
if (arr.length) {
const index = arr.indexOf(item);
if (index > -1) {
return arr.splice(index, 1)
}
}
}
function createLRUCache (LRUStore) {
return function LRUCache (key, content = null) {
const {keys, cache, max} = LRUStore;
function pushKey () {
remove(keys, key);
keys.push(key);
}
if (content) {
cache[key] = content;
pushKey();
if (max && keys.length > parseInt(max)) {
const first = keys[0];
cache[first] = null;
remove(keys, first);
}
} else {
pushKey();
return cache[key]
}
}
}
function similarity(s1, s2, split = false) {
function editDistance (s1, s2) {
s1 = s1.toLowerCase();
s2 = s2.toLowerCase();
const costs = new Array();
for (let i = 0; i <= s1.length; i++) {
let lastValue = i;
for (let j = 0; j <= s2.length; j++) {
if (i === 0) {
costs[j] = j;
} else {
if (j > 0) {
var newValue = costs[j - 1];
if (s1.charAt(i - 1) != s2.charAt(j - 1)) {
newValue = Math.min(Math.min(newValue, lastValue), costs[j]) + 1;
}
costs[j - 1] = lastValue;
lastValue = newValue;
}
}
}
if (i > 0) {
costs[s2.length] = lastValue;
}
}
return costs[s2.length];
}
function doSplitMode (s1, s2){
let split1 = s1.split(' ');
let split2 = s2.split(' ');
let sum = 0; let max = 0; let temp = 0;
for(let i=0; i < split1.length;i++) {
max = 0;
for(let j=0; j < split2.length;j++) {
temp = genSimilarity(split1[i], split2[j]);
if(max < temp) {
max = temp;
} }
sum += max / split1.length;
}
return sum;
}
function genSimilarity (s1, s2) {
let longer = s1;
let shorter = s2;
if (s1.length < s2.length) {
longer = s2;
shorter = s1;
}
const longerLength = longer.length;
if (longerLength == 0) {
return 1.0;
}
return (longerLength - editDistance(longer, shorter)) / parseFloat(longerLength);
}
if (split) {
return doSplitMode(s1, s2)
} else {
return genSimilarity(s1, s2)
}
}
function toMap (arr, key = 'id') {
return arr.reduce((r, c) => {
if (c[key]) {
r[c[key]] = c;
}
return r
}, {})
}
function isPlainObject (val) {
return Object.prototype.toString.call(val) === '[object Object]'
}
function parseHtml (html) {
const parser = new DOMParser();
const doc = parser.parseFromString(html, "text/html");
return doc
}
function fix503 (src) {
let iframe = document.createElement('iframe');
const timeout = 6000;
const now = Date.now();
return new Promise(function (resolve, reject) {
function remove () {
if (iframe) {
document.body.removeChild(iframe);
iframe = null;
}
}
iframe.onload = (e) => {
requestAnimationFrame(function check () {
if (Date.now() - now > timeout ||
(iframe && iframe.contentWindow.document.querySelector('#toplogo'))
) {
remove();
console.log('iframe:loaded');
resolve(true);
} else {
requestAnimationFrame(check);
}
});
};
iframe.onerror = (e) => {
remove();
console.log('iframe:onerror', e);
reject(false);
};
setTimeout(iframe.onerror, timeout, 'timeout');
iframe.style="width:600px;height:400px;position:fixed;left: -999999999px;top: 0;z-index: 100";
document.body.insertBefore(iframe, document.body.firstChild);
iframe.src = src;
})
}
function get (url, options = {}) {
return new Promise(function (resolve, reject) {
GM_xmlhttpRequest({
url,
method: 'GET',
...options,
onload: (e) => {
if (e.status === 200) {
resolve(e);
} else {
console.log('reject', e.status);
reject(e);
}
},
onerror: (e) => {
reject(e);
}
});
}).catch((e) => {
if (e.status === 503) {
return fix503(url).then(() => get(url, options))
}
return Promise.reject(e)
})
}
function getHTML (url, options = {parse: true}) {
const {parse} = options;
let request = get(url, {responseType: 'text'}).then((r) => r.responseText, (e) => Promise.reject(e));
if (parse) {
return request.then((html) => {
return parseHtml(html)
}, (e) => {
return Promise.reject(e)
})
}
return request
}
function post (url, data = {}, options = {}) {
return new Promise(function (resolve, reject) {
GM_xmlhttpRequest({
url,
method: 'POST',
data,
responseType: 'json',
...options,
onload: (e) => {
if (e.status === 200) {
resolve(e);
} else {
reject(e);
}
},
onerror: (e) => {
reject(e);
}
});
})
}
var Http = {
install (Vue) {
Vue.prototype.$getHTML = getHTML;
Vue.prototype.$get = get;
}
};
const map = {
star: {
url: '/ajax/ajax_favoriteadd_star.php',
type: 4
}
};
function addFav (id, _type) {
const {url, type} = map[_type];
return post(url, {id, type}).then((res) => {
console.log(res.response);
if (res.response.ERROR === -1) {
return Promise.reject('already fav')
}
return res.response
})
}
function fillListUrl (id, type) {
const fChar = type[0];
const url = `vl_${type}.php?${fChar}=${id}`;
return url
}
const ListCacheStore = {
keys: [],
cache: {},
max: 10
};
const ListLRUCache = createLRUCache(ListCacheStore);
const logVue = new Vue({
data: {
logs: []
}
});
function log (task) {
let startTime = Date.now();
function getPassTime () {
const currTime = Date.now();
const pass = currTime - startTime;
return pass
}
const logTask = {
name: task,
logs: [],
finished: false,
status: '',
};
logVue.logs.push(logTask);
logVue.$emit('log-task', logTask);
function logStep (status, msg, name) {
logTask.logs.push({name, msg, status, after: getPassTime()});
}
return {
msg (msg) {
logStep('default', msg);
},
success (...args) {
logStep('success', ...args);
},
fail (...args) {
logStep('fail', ...args);
},
end (status) {
logTask.finished = true;
logTask.status = status;
logStep('finished', '任务' + (status === 'success' ? '成功' : '失败'), task);
}
}
}
function parseStep (step) {
const fns = [];
const objs = [];
const strs = [];
for (const item of step) {
if (typeof item === 'function' || item instanceof Promise) {
fns.push(item);
}
if (typeof item === 'string') {
strs.push(item);
}
if (isPlainObject(item)) {
objs.push(item);
}
}
const [exec] = fns;
const [options] = objs;
const [name = '操作', resolve = 'next', reject = 'exit'] = strs;
return {
name, exec, options,
resolve, reject
}
}
async function runTask (taskName, ...steps) {
const logTask = log(taskName);
let finishedStatus = 'fail';
let result;
if (isPlainObject(steps[0])) {
result = steps[0];
steps.shift();
}
while (steps.length) {
const step = steps.shift();
const { name, exec, resolve, reject } = parseStep(step);
try {
logTask.msg(`开始执行步骤: ${name}`);
const promise = exec instanceof Promise ? exec : ( isPlainObject(exec) ? Promise.resolve(exec) : exec(result, logTask) );
result = await promise;
logTask.success('执行成功!');
if (resolve === 'pass') {
logTask.end('success');
return Promise.resolve(result)
}
// next
finishedStatus = 'success';
} catch (e) {
logTask.fail(e.status || e.message || '执行失败! ', name);
if (reject === 'exit') {
logTask.end('fail');
return Promise.reject(e)
}
result = e;
finishedStatus = 'fail';
// next
}
}
logTask.end(finishedStatus);
return finishedStatus === 'success' ? Promise.resolve(result) : Promise.reject(result)
}
function queryVideoList (href) {
function firstStep () {
const requestPromise = location.pathname === href ?
Promise.resolve(document) :
getHTML(href);
return requestPromise
}
return runTask(
'查询列表信息',
['加载 HTML', firstStep],
['解析切页信息', parseNextPage],
['解析列表信息', parseList],
).catch((e) => {
return Promise.reject(e)
})
}
function genDefaultPages () {
return {
show: false,
inLast: false,
length: 0,
curr: 1,
list: [],
last: 0,
next: 0,
}
}
function parseNextPage (doc) {
const pageSelector = doc.querySelector('.page_selector');
let defaultPages = genDefaultPages();
if (pageSelector && pageSelector.children) {
defaultPages = [...pageSelector.children].reduce((pages, page) => {
const {className, innerHTML: p} = page;
if (/^page(\scurrent|$)/.test(className)) {
pages.list.push(p);
if (className === 'page current') {
pages.curr = p;
}
pages.length++;
}
if (className === 'page last') {
pages.last = page.href && page.href.replace(/.*?page=/, '');
}
if (className === 'page next') {
pages.next = page.href && page.href.replace(/.*?page=/, '');
}
return pages
}, defaultPages);
}
defaultPages.inLast = defaultPages.curr === defaultPages.last;
return {doc, pages: defaultPages}
}
const videoReg = /<div class="video".*?<a\shref="(.*?)".*?<div\sclass="id">(.*?)<.*?src="(.*?)".*?class="title.*?>(.*?)<\/div/;
function parseList (payload) {
const {doc} = payload;
const list = [...(doc.querySelectorAll('.video'))]
.map((vEl) => {
const video = vEl.outerHTML.match(videoReg);
const [, href, avid, image, title] = video;
const [prefix, number] = avid.split('-');
const id = href.replace('./?v=javli', '');
return {
id, href, avid, image, title, prefix, number,
infos: null, favorite: null, previewId: null,
loaded: {preview: false, detail: false},
images: null,
error: ''}
});
return {...payload, list}
}
const VERSION = 2;
const DB_NAME = 'tm-jav';
const TABLE_DEF = [
[/** empty version 0 */],
[ // version 1
{ name: 'genres', key: 'id', cols: ['name', 'type'] }
],
[ // version 2
{ name: 'genres', key: 'id', cols: ['name', 'type'] },
{ name: 'stars', key: 'id', cols: ['name']},
{ name: 'templates', key: 'prefix', cols: ['template']},
{ name: 'details', key: 'id', cols: [
'genres', 'stars',
'date', 'duration', 'director', 'maker', 'label',
'score', 'subscribed', 'watched', 'owned',
'updatedTime'
]},
{ name: 'previews', key: 'id', cols: ['previewId', 'previewCode']} // 0: none match, 1: google match, 2: snapshot match, 4: add zero match, 8: remove zero match
]
];
var config = {
VERSION,
DB_NAME,
TABLE_DEF,
};
function DB () {
this.errorCode = '';
this.db = null;
}
const proto = DB.prototype;
proto.setup = function (dbName, version, ...tableDefs) {
this.dbName = dbName;
const request = window.indexedDB.open(dbName, version);
return new Promise((resolve, reject) => {
request.onerror = (ev) => {
this.errorCode = ev.errorCode;
reject(this);
};
request.onsuccess = (ev) => {
this.db = ev.target.result;
resolve(this);
};
request.onupgradeneeded = (ev) => {
this.db = ev.target.result;
this._defTable(tableDefs).then(() => {
resolve(this);
}, (ev) => {
this.errorCode = ev.errorCode;
reject(this);
});
};
})
};
proto.transaction = function (tables, mode = 'readonly') {
const transaction = this.db.transaction(tables, mode);
const gTable = (table) => new Table(table, this.db, transaction);
return function runTransaction (handler) {
return handler(gTable)
}
};
proto._defTable = function (tables) {
const existTables = [...this.db.objectStoreNames].reduce((r, c) => { r[c] = true; return r; }, {});
const allTableTransaction = [];
for (const table of tables) {
const {name, key: keyPath, indexes} = table;
if (existTables[name]) {
continue
}
const objectStore = this.db.createObjectStore(name, { keyPath });
for (const index of (indexes || [])) {
objectStore.createIndex(index, index, { unique: false });
}
allTableTransaction.push(
new Promise((resolve, reject) => {
objectStore.transaction.onsuccess = resolve;
objectStore.transaction.onerror = reject;
})
);
}
return Promise.all(allTableTransaction)
};
proto._removeTable = function (name, existTables) {
if (!existTables[name]) {
return
}
this.db.deleteObjectStore(name);
};
proto.table = function (name) {
return new Table(name, this.db)
};
// ------------ Table ------------
function Table (name, db, transaction = null) {
this.name = name;
this.db = db;
this._transaction = transaction;
}
Table.prototype.get = function (id) {
return this._asyncExec(id ? 'get' : 'getAll', id)
};
Table.prototype.getAll = function () {
return this.get()
};
Table.prototype.add = function (records) {
return this._batchExec(records, 'add')
};
Table.prototype.put = function (records) {
return this._batchExec(records, 'put')
};
Table.prototype.delete = function (records) {
return this._batchExec(records, 'delete')
};
Table.prototype._batchExec = function (records, method = 'add') {
if (!Array.isArray(records)) {
records = [records];
}
const allRecord = [];
for (let record of records) {
allRecord.push(
this._asyncExec(method, record)
);
}
return Promise.all(allRecord)
};
Table.prototype._transactionFn = function (method) {
let objectStore;
if (this._transaction) {
objectStore = this._transaction.objectStore(this.name);
} else {
const mode = method.startsWith('get') ? 'readonly' : 'readwrite';
objectStore = this.db.transaction(this.name, mode).objectStore(this.name);
}
return objectStore[method].bind(objectStore)
};
Table.prototype._asyncExec = function (method, ...args) {
return new Promise ((resolve, reject) => {
const requestFn = this._transactionFn(method);
if (typeof requestFn !== 'function') {
reject(`method ${method} is Illegal invocation`);
} else {
const request = requestFn(...args);
request.onsuccess = function (event) {
resolve(event.target.result);
};
request.onerror = function (event) {
reject(event);
};
}
})
};
let dbInstance = null;
async function getDBInstance () {
if (dbInstance) {
return dbInstance
}
const {VERSION, DB_NAME, TABLE_DEF} = config;
const table = TABLE_DEF[VERSION];
dbInstance = new DB();
try {
await dbInstance.setup(DB_NAME, VERSION, ...table);
return dbInstance
} catch (e) {
console.error(e);
}
}
function avDetailResolution (video) {
const firstArg = video instanceof Document ? {htmlDom: video} : ['加载 HTML', loadHTML(video.href)];
return runTask(
'解析 AV 相关信息',
firstArg,
['解析基本信息', parseAvInfo],
['解析投票信息', parseFavorite],
['解析图片预览信息', parseImagePreview],
).catch((e) => {
return Promise.reject(e)
})
}
function loadHTML (href) {
return getHTML(href)
.then((htmlDom) => {
return {htmlDom}
})
}
function parseFavorite (payload) {
const el = payload.htmlDom.querySelector('#video_favorite_edit');
if (!el) {return payload}
const subscribed = (el.querySelector('#subscribed a') || {}).textContent; // 我想要
const watched = (el.querySelector('#watched a') || {}).textContent; // 我看过
const owned = (el.querySelector('#owned a') || {}).textContent; // 我拥有
return {...payload, favorite: {subscribed, watched, owned}}
}
function parseAvInfo (payload) {
const el = payload.htmlDom.querySelector('#video_info');
if (!el) {return payload}
const dateEl = el.querySelector('#video_date .text') || {};
const date = dateEl.textContent || '';
const durationEl = el.querySelector('#video_length .text') || {};
const duration = durationEl.textContent || ''; // 分钟
const director = genObjInfo(el, 'director');
const maker = genObjInfo(el, 'maker');
const label = genObjInfo(el, 'label');
const scoreEl = el.querySelector('#video_review .text .score') || {};
const score = scoreEl.textContent || '';
const genres = genObjInfo(el, 'genre', true);
const stars = genObjInfo(el, 'star', true, 'cast');
return {...payload, infos: {date, duration, director, maker, label, score, genres, stars}}
}
function genObjInfo (wrapper, type, array = false, idSlt = '') {
const fChar = type[0];
const pageReg = new RegExp(`.*vl_${type}\\.php\\?${fChar}=`);
if (!idSlt) { idSlt = type + (array ? 's' : ''); }
const selector = `#video_${idSlt} .text a`;
const els = wrapper.querySelectorAll(selector);
const result = [...els].map(el => {
return {
id: el.href.replace(pageReg, ''),
name: el.textContent,
}
});
return !array && result.length === 1 ? result[0] : result
}
function parseImagePreview (payload) {
const el = payload.htmlDom.querySelectorAll('.previewthumbs > img');
if (!el || !el.length) {
payload = {...payload, images: null};
}
const result = el[0].src.match(/\/([^\/]+?)-(\d+)\.(.*)$/);
if (result) {
payload = {...payload, images: {previewId: result[1], ext: result[3], count: el.length}};
}
return payload
}
const PREVIEW_CODE = {
NONE: 0,
TEMPLATE: 1,
TEMPLATE_ZERO: 2,
GOOGLE: 3,
GOOGLE_ZERO: 4,
SNAPSHOT: 5,
SNAPSHOT_ZERO: 6,
INFO_IMAGE: 7,
};
const urlPrefix = location.protocol + '//cc3001.dmm.co.jp/litevideo/freepv/';
const urlPostfix = ['_dmb_w', '_dm_w', '_sm_w'];
function genSources (previewId) {
previewId = previewId.replace(/(((\w)\w\w).*)/, '$3/$2/$1/$1');
return urlPostfix.map(pf => urlPrefix + previewId + pf + '.mp4')
}
function getCid (str) {
return str.replace(/([\s\S]+cid=)(\w+)(\/)/, '$2')
}
function getGoogleSearchUrl (avid) {
const url = `https://www.google.com/search?hl=zh-CN&q=site:https://www.dmm.co.jp+${avid}`;
return url
}
function prepareGoogleSearch (video) {
const {avid} = video;
const searchUrl = getGoogleSearchUrl(avid);
return getHTML(searchUrl).then((dom) => {
return {dom, searchUrl, video}
})
}
function getSimilarity (s1, s2) {
const front = s1.slice(0, 15) === s2.slice(0, 15);
if (front) {
return 1
}
let titleSimilarity = similarity(s1, s2);
if (titleSimilarity < 0.5) {
titleSimilarity = similarity(s1, s2, true /* split mode */);
}
return titleSimilarity
}
function parseGoogleResult (payload, log) {
const {dom, searchUrl, video} = payload;
const searched = dom.querySelector('#search');
let snapshotLink = null;
if (!searched || !searched.children.length) {
return Promise.reject(new Error(`not found 'Element #search' in result of '${searchUrl}'`))
}
const firstALinks = searched.querySelectorAll('#rso .g .r > a:first-child');
const avTitle = video.title;
log.msg(`开始匹配标题 '${avTitle}', URL: '${searchUrl}'`);
let previewId = null;
for (const firstALink of [...firstALinks]) {
const link = firstALink.pathname;
const titleEl = firstALink.querySelector('h3');
const resultTitle = (titleEl ? titleEl.innerText : '').replace('アダルトDVD・ブルーレイ', '');
const titleSimilarity = getSimilarity(avTitle, resultTitle);
if (titleSimilarity < 0.5) {
log.msg(`标题【不】匹配: '${resultTitle}', 相似度: ${titleSimilarity}`);
continue
}
log.msg(`标题【匹配】: '${resultTitle}', 相似度: ${titleSimilarity}`);
snapshotLink = firstALink.nextElementSibling.querySelector('.action-menu-item.ab_dropdownitem a');
snapshotLink = snapshotLink && snapshotLink.href;
previewId = getCid(link);
break
}
if (previewId) {
return {previewId, video, snapshotLink}
}
return Promise.reject(new Error(`解析失败, URL: '${searchUrl}'`))
}
function genPreloadTest (previewCode, video) {
function genZeroId (prevId) {
let nextId = '';
const reg = new RegExp(`.*${video.prefix}(0+?)${video.number}`, 'i');
const zero = prevId.replace(reg, (m, m1) => m1);
if (zero !== prevId) {
nextId = prevId.replace(zero, '');
} else {
const addZero = `00000${video.number}`.slice(-5);
nextId = prevId.replace(video.number, addZero);
}
return nextId
}
return function preloadTest (payload, log) {
let {previewId} = payload || {};
if (!previewId) {
return Promise.reject({...payload, error: new Error(`EMPTY previewId`)})
}
if (previewCode === PREVIEW_CODE.GOOGLE_ZERO || previewCode === PREVIEW_CODE.SNAPSHOT_ZERO) {
previewId = genZeroId(previewId);
}
const path = previewId.replace(/(((\w)\w\w).*)/, '$3/$2/$1/$1');
const url = urlPrefix + path + '_sm_w.mp4';
log.msg(`尝试加载 url ... : ${url}`);
return get(url).then(() => {
return {previewId, previewCode}
}, (error) => {
return Promise.reject({...payload, error})
})
}
}
function parseFromSnapshot (payload) {
const { snapshotLink } = payload;
return getHTML(snapshotLink).then((dom) => {
const link = dom.body.querySelector('.area-edition .edition:not(.limited)');
const previewId = link ? getCid(link.pathname) : '';
return {...payload, previewId}
})
}
function preivewResolution (video, infoPromise) {
if (video.previewId) {
return Promise.resolve(video.previewId)
}
let templateStep = [];
if (video.template) {
templateStep = [
{previewId: video.template},
['测试TEMPLATE预览ID', genPreloadTest(PREVIEW_CODE.TEMPLATE, video), 'pass', 'next'],
['测试TEMPLATE_ZERO预览ID', genPreloadTest(PREVIEW_CODE.TEMPLATE_ZERO, video), 'pass', 'next'],
];
}
const infoStep = [
['from information1', infoPromise],
['from information2', (video) => Promise.resolve(video.images)],
['测试information image ID', genPreloadTest(PREVIEW_CODE.INFO_IMAGE, video), 'pass', 'next'],
];
return runTask(
'解析预览ID',
...templateStep,
...infoStep,
['谷歌搜索', prepareGoogleSearch(video)],
['解析HTML', parseGoogleResult],
['测试GOOGLE预览ID', genPreloadTest(PREVIEW_CODE.GOOGLE, video), 'pass', 'next'],
['测试GOOGLE_ZERO预览ID', genPreloadTest(PREVIEW_CODE.GOOGLE_ZERO, video), 'pass', 'next'],
['快照查找', parseFromSnapshot],
['测试SNAPSHOT预览ID', genPreloadTest(PREVIEW_CODE.SNAPSHOT, video), 'pass', 'next'],
['测试SNAPSHOT_ZERO预览ID', genPreloadTest(PREVIEW_CODE.SNAPSHOT_ZERO, video), 'pass', 'next'],
).catch((e) => {
return Promise.reject(e)
})
}
class Model {
constructor (name, keyPath = 'id') {
this.name = name;
this.init = false;
this.keyPath = keyPath;
this.dataIdMap = {};
}
async put (datas) {
if (!Array.isArray(datas)) {
datas = [datas];
}
datas = datas.map(d => {
const keyValue = d[this.keyPath];
if (keyValue && this.dataIdMap[keyValue]) {
d = {...this.dataIdMap[keyValue], ...d};
}
return d
});
const idb = await getDBInstance();
await idb.table(this.name).put(datas);
for (const data of datas) {
this.dataIdMap[data[this.keyPath]] = data;
}
}
async getAll () {
const idb = await getDBInstance();
let datas = await idb.table(this.name).get();
if (datas && datas.length) {
this.dataIdMap = toMap(datas, this.keyPath);
} else {
datas = await this.getFromRemote();
await this.put(datas);
}
this.init = true;
return this.processData(datas)
}
async getFromRemote () {
return []
}
processData (d) {
return d
}
async getMap () {
if (!this.init) {
await this.getAll();
}
return this.dataIdMap
}
}
class StarsModel extends Model {
constructor () {
super('stars');
}
}
var starsModel = new StarsModel();
const Config = {
NAME: 'genres',
URL: 'genres.php',
};
function parseGenres (dom) {
const nodes = [...dom.querySelectorAll('.textbox')];
return nodes.reduce((list, node) => {
const type = node.firstElementChild.innerText;
const genres = [...node.querySelectorAll('.genreitem a')]
.map((a) => {
return {
id: a.href.replace(location.origin + '/cn/vl_genre.php?g=', ''),
name: a.innerText,
type,
}
});
list = list.concat(genres);
return list
}, [])
}
class GenresModel extends Model {
constructor () {
super('genres');
}
async getFromRemote () {
return getHTML(Config.URL)
.then((dom) => {
const genres = parseGenres(dom.body);
return genres
})
}
processData (genres) {
const treeObj = genres.reduce((tree, genre) => {
const {id, name, type = 'TM-JAV-NEW'} = genre;
if (!tree[type]) {
tree[type] = {type, genres: []};
}
tree[type].genres.push({id, name});
return tree
}, {});
return Object.keys(treeObj).map(k => treeObj[k])
}
}
var genresModel = new GenresModel();
class TemplatesModel extends Model {
constructor () {
super('templates', 'prefix');
}
}
var templatesModel = new TemplatesModel();
const Details = {
NAME: 'details',
};
async function getVideoDetail (video) {
const idb = await getDBInstance();
let details = await idb.table(Details.NAME).get(video.id);
if (!details || !details.images) {
const {infos, favorite, images} = await avDetailResolution(video);
starsModel.put(infos.stars);
genresModel.put(infos.genres);
const genres = infos.genres.map(g => g.id);
const stars = infos.stars.map(s => s.id);
const putData = {...infos, ...favorite, genres, stars, id: video.id, images};
await idb.table(Details.NAME).put(putData);
details = {infos, favorite, images};
} else {
const genresMap = await genresModel.getMap();
const genres = details.genres.map(g => genresMap[g]);
const starsMap = await starsModel.getMap();
const stars = details.stars.map(s => starsMap[s]);
const favorite = genObjectFromKeys(details, ['score', 'subscribed', 'watched', 'owned', 'updatedTime']);
const infos = {
stars,
genres,
...genObjectFromKeys(details, ['date', 'duration', 'director', 'maker', 'label'])
};
details = {infos, favorite, images: details.images};
}
return details
}
function genObjectFromKeys (obj, keys) {
return keys.reduce((result, k) => {
result[k] = obj[k];
return result
}, {})
}
const Previews = {
NAME: 'previews',
};
async function getVideoPreview (video, infoPromise) {
const idb = await getDBInstance();
let preview = await idb.table(Previews.NAME).get(video.id);
if (preview && preview.previewId) {
return preview.previewId
}
const templatesMap = await templatesModel.getMap();
const template = (templatesMap[video.prefix] && templatesMap[video.prefix].template) || '';
video.template = template.replace('{}', video.number);
const payload = await preivewResolution(video, infoPromise);
const {previewCode, previewId} = payload;
if (previewId) {
const newTemplate = previewId.replace(video.number, '{}');
templatesModel.put({prefix: video.prefix, template: newTemplate});
await idb.table(Previews.NAME).put({id: video.id, previewCode, previewId});
}
return previewId
}
//
var script$3 = {
components: {
TmItem: __vue_component__$2
},
data () {
return {
list: [],
loading: false,
fillError: false,
ddos: {
status: false,
currTime: 5,
maxTime: 5,
timer: null
},
pages: genDefaultPages()
}
},
props: {
tab: {
default: null
},
},
computed: {
hasNext () {
return this.tab && this.tab.next !== false && !this.pages.show && this.pages.next
}
},
watch: {
tab: {
immediate: true,
handler (val, old) {
if (old) {
this.cacheTab(old);
}
if (val) {
this.onTabChange(val, old);
}
}
}
},
methods: {
inDDoS () {
if (this.ddos.timer) {
return true
}
this.ddos.status = document.title === 'Just a moment...';
if (this.ddos.status) {
this.ddos.currTime = this.ddos.maxTime;
this.ddos.timer = setInterval(() => {
this.ddos.currTime--;
if (!this.ddos.currTime) {
clearInterval(this.ddos.timer);
this.ddos.timer = null;
location.reload();
}
}, 1000);
}
return this.ddos.status // cf_clearance
},
switchLoadMode () {
const status = !this.pages.show;
if (status) {
const url = this.genPageUrl(this.pages.curr);
this.getContent(url, status);
} else {
this.pages.curr = 1;
this.getContent(this.tab.href);
}
this.pages.show = status;
},
onTabChange (tab, old) {
const cached = ListLRUCache(tab.href);
if (cached && cached.list.length) {
this.list = cached.list;
this.pages = cached.pages;
} else if (!this.inDDoS()) {
this.getContent(tab.href);
this.pages.curr = 1;
}
if (this.$refs['scroll-wrapper']) {
this.$refs['scroll-wrapper'].scrollTop = cached ? cached.scrollTop : 0;
}
},
cacheTab (tab) {
if (!this.list.length) {return}
const scroll = this.$refs['scroll-wrapper'];
ListLRUCache(tab.href, {
list: this.list,
pages: this.pages,
scrollTop: scroll && scroll.scrollTop,
});
},
getContent (href, pageStatus = false) {
this.loading = true;
this.list = [];
queryVideoList(href)
.then(({list, pages}) => {
this.list = list;
this.pages = pages;
this.pages.show = pageStatus;
this.fillList();
}, () => {
this.list = [];
}).finally(() => {
this.loading = false;
});
},
genPageUrl (page = 0) {
if (!page) {page = ++this.pages.curr;}
const hasQ = /\?/.test(this.tab.href);
const url = this.tab.href + `${hasQ ? '&' : '?'}page=${page}`;
return url
},
toPage (p) {
const url = this.genPageUrl(p);
this.getContent(url, true);
},
queryNext () {
const url = this.genPageUrl();
return queryVideoList(url)
.then(({list, pages}) => {
this.pages = pages;
this.list = this.list.concat(list);
this.fillList();
}).finally(() => {
this.loading = false;
})
},
fillList () {
if (!this.hasNext) {
return
}
this.$nextTick()
.then(() => {
if (!this.fillError && this.isScrollEnd()) {
this.queryNext().catch(() => {
this.fillError = true;
});
}
});
},
showPreview (video) {
const i = getVideoDetail(video);
i.then(({infos, favorite, images}) => {
video.infos = infos;
video.favorite = favorite;
video.images = images;
video.loaded.detail = true;
this.$emit('select', video);
return video
}).catch((e) => {
console.log('加载失败:', e);
video.loaded.detail = false;
});
video.error = '';
const s = getVideoPreview(video, i).then((previewId) => {
if (previewId) {
video.previewId = previewId;
video.loaded.preview = true;
this.$emit('select', video);
} else {
video.error = '加载失败,请查看日志';
}
}).catch((e) => {
console.log('加载失败:', e);
video.error = '加载失败,请查看日志';
});
this.$emit('select', video);
Promise.all([s, i]).then(() => {
console.log(video);
});
},
isScrollEnd () {
const t = this.$refs['scroll-wrapper'];
if (!t) {return false}
return t.scrollHeight - t.clientHeight - 20 < t.scrollTop
},
onScroll: throttle(function (e) {
if (!this.hasNext || e.deltaY < 0) {
return false
}
if (this.isScrollEnd() && !this.loading) {
this.loading = true;
this.queryNext();
}
}, 16)
}
};
/* script */
const __vue_script__$3 = script$3;
/* template */
var __vue_render__$3 = function() {
var _vm = this;
var _h = _vm.$createElement;
var _c = _vm._self._c || _h;
return _c("div", { staticClass: "tm-jav-list" }, [
_vm.ddos.status
? _c("div", { staticClass: "tm-jav-list--ddos" }, [
_vm._m(0),
_vm._v(" "),
_c("h1", [_vm._v(_vm._s(_vm.ddos.currTime) + "秒 ... ")]),
_vm._v(" "),
_c("h1", [_vm._v("javlibrary.com 正在进行 DDoS 防护")]),
_vm._v(" "),
_c("h4", [
_vm._v(
"此为自运行程序,最长不超过5秒,你的浏览器会自动加载 javlibrary.com 内容"
)
]),
_vm._v(" "),
_c("h4", [_vm._v("如果没有跳转,请自行刷新")])
])
: _c(
"div",
{
ref: "scroll-wrapper",
staticClass: "tm-jav-list--wrapper",
on: {
scroll: function($event) {
$event.stopPropagation();
},
mousewheel: _vm.onScroll
}
},
[
_c(
"div",
{ staticClass: "tm-jav-list--scroll" },
_vm._l(_vm.list, function(video) {
return _c("tm-item", {
key: video.href,
attrs: { video: video },
on: {
"show-preview": function($event) {
return _vm.showPreview(video)
}
}
})
}),
1
),
_vm._v(" "),
_c(
"div",
{
directives: [
{
name: "show",
rawName: "v-show",
value: _vm.loading,
expression: "loading"
}
],
staticClass: "tm-jav-list--loading",
class: { "tm-jav-list--loading-pages": _vm.pages.show }
},
[_vm._m(1)]
)
]
),
_vm._v(" "),
_c(
"div",
{
directives: [
{
name: "show",
rawName: "v-show",
value: _vm.pages.length,
expression: "pages.length"
}
],
staticClass: "tm-jav-list--switch"
},
[
_c("span", { staticClass: "tm-jav-list--switch-default" }, [
_vm._v("当前为" + _vm._s(_vm.pages.show ? "切页" : "滚动") + "模式")
]),
_vm._v(" "),
_c(
"span",
{
staticClass: "tm-jav-list--switch-hover",
on: { click: _vm.switchLoadMode }
},
[
_vm._v(
"点击切换为" + _vm._s(_vm.pages.show ? "滚动" : "切页") + "模式"
)
]
)
]
),
_vm._v(" "),
_vm.pages.length && _vm.pages.show
? _c(
"div",
{ staticClass: "tm-jav-list--pages" },
[
_vm.pages.list[0] != 1
? _c(
"i",
{
staticClass: "tm-jav--tag",
on: {
click: function($event) {
return _vm.toPage(1)
}
}
},
[_vm._v("第一页")]
)
: _vm._e(),
_vm._v(" "),
_vm._l(_vm.pages.list, function(p) {
return _c(
"i",
{
staticClass: "tm-jav--tag",
class: { "tm-jav--current": p == _vm.pages.curr },
on: {
click: function($event) {
return _vm.toPage(p)
}
}
},
[_vm._v(_vm._s(p))]
)
}),
_vm._v(" "),
_vm.pages.last
? _c(
"i",
{
staticClass: "tm-jav--tag",
on: {
click: function($event) {
return _vm.toPage(_vm.pages.last)
}
}
},
[_vm._v("最后一页")]
)
: _vm._e()
],
2
)
: _vm._e()
])
};
var __vue_staticRenderFns__$3 = [
function() {
var _vm = this;
var _h = _vm.$createElement;
var _c = _vm._self._c || _h;
return _c("div", { staticClass: "tm-jav--loading-wrapper" }, [
_c("i", { staticClass: "tm-jav--loading" })
])
},
function() {
var _vm = this;
var _h = _vm.$createElement;
var _c = _vm._self._c || _h;
return _c("div", { staticClass: "tm-jav--loading-wrapper" }, [
_c("div", { staticClass: "tm-jav--loading" })
])
}
];
__vue_render__$3._withStripped = true;
/* style */
const __vue_inject_styles__$3 = function (inject) {
if (!inject) return
inject("data-v-5bb942be_0", { source: ".tm-jav-list[data-v-5bb942be] {\n background-color: #ffc4ec;\n border-radius: 4px;\n padding: 15px 4px;\n height: 100%;\n font-size: 12px;\n position: relative;\n}\n.tm-jav-list--switch[data-v-5bb942be] {\n display: inline-block;\n position: absolute;\n right: 30px;\n top: 0px;\n height: 20px;\n background-color: rgba(0, 0, 0, 0.3);\n color: #fff;\n padding: 2px;\n}\n.tm-jav-list--switch-default[data-v-5bb942be] {\n display: inline-block;\n}\n.tm-jav-list--switch-hover[data-v-5bb942be] {\n display: none;\n}\n.tm-jav-list--switch:hover .tm-jav-list--switch-hover[data-v-5bb942be] {\n display: inline-block;\n cursor: pointer;\n}\n.tm-jav-list--switch:hover .tm-jav-list--switch-default[data-v-5bb942be] {\n display: none;\n}\n.tm-jav-list--pages[data-v-5bb942be] {\n position: absolute;\n left: 0;\n top: 0;\n}\n.tm-jav-list--ddos[data-v-5bb942be] {\n width: 100%;\n height: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n}\n.tm-jav-list--wrapper[data-v-5bb942be] {\n padding: 0 4px;\n width: 100%;\n height: 100%;\n overflow: hidden;\n}\n.tm-jav-list--wrapper[data-v-5bb942be]:hover {\n overflow: auto;\n padding-right: 0;\n}\n.tm-jav-list--scroll[data-v-5bb942be] {\n display: flex;\n flex-wrap: wrap;\n align-content: flex-start;\n}\n.tm-jav-list--scroll[data-v-5bb942be]::after {\n content: '';\n flex: 9999999;\n}\n.tm-jav-list--scroll .tm-jav-item[data-v-5bb942be] {\n flex-grow: 1;\n}\n.tm-jav-list--loading-pages[data-v-5bb942be] {\n width: 100%;\n height: 100%;\n position: absolute;\n left: 0;\n top: 0;\n z-index: 5;\n background-color: rgba(0, 0, 0, 0.1);\n}\n", map: {"version":3,"sources":["list.vue"],"names":[],"mappings":"AAAA;EACE,yBAAyB;EACzB,kBAAkB;EAClB,iBAAiB;EACjB,YAAY;EACZ,eAAe;EACf,kBAAkB;AACpB;AACA;EACE,qBAAqB;EACrB,kBAAkB;EAClB,WAAW;EACX,QAAQ;EACR,YAAY;EACZ,oCAAoC;EACpC,WAAW;EACX,YAAY;AACd;AACA;EACE,qBAAqB;AACvB;AACA;EACE,aAAa;AACf;AACA;EACE,qBAAqB;EACrB,eAAe;AACjB;AACA;EACE,aAAa;AACf;AACA;EACE,kBAAkB;EAClB,OAAO;EACP,MAAM;AACR;AACA;EACE,WAAW;EACX,YAAY;EACZ,aAAa;EACb,uBAAuB;EACvB,mBAAmB;EACnB,sBAAsB;AACxB;AACA;EACE,cAAc;EACd,WAAW;EACX,YAAY;EACZ,gBAAgB;AAClB;AACA;EACE,cAAc;EACd,gBAAgB;AAClB;AACA;EACE,aAAa;EACb,eAAe;EACf,yBAAyB;AAC3B;AACA;EACE,WAAW;EACX,aAAa;AACf;AACA;EACE,YAAY;AACd;AACA;EACE,WAAW;EACX,YAAY;EACZ,kBAAkB;EAClB,OAAO;EACP,MAAM;EACN,UAAU;EACV,oCAAoC;AACtC","file":"list.vue","sourcesContent":[".tm-jav-list {\n background-color: #ffc4ec;\n border-radius: 4px;\n padding: 15px 4px;\n height: 100%;\n font-size: 12px;\n position: relative;\n}\n.tm-jav-list--switch {\n display: inline-block;\n position: absolute;\n right: 30px;\n top: 0px;\n height: 20px;\n background-color: rgba(0, 0, 0, 0.3);\n color: #fff;\n padding: 2px;\n}\n.tm-jav-list--switch-default {\n display: inline-block;\n}\n.tm-jav-list--switch-hover {\n display: none;\n}\n.tm-jav-list--switch:hover .tm-jav-list--switch-hover {\n display: inline-block;\n cursor: pointer;\n}\n.tm-jav-list--switch:hover .tm-jav-list--switch-default {\n display: none;\n}\n.tm-jav-list--pages {\n position: absolute;\n left: 0;\n top: 0;\n}\n.tm-jav-list--ddos {\n width: 100%;\n height: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n}\n.tm-jav-list--wrapper {\n padding: 0 4px;\n width: 100%;\n height: 100%;\n overflow: hidden;\n}\n.tm-jav-list--wrapper:hover {\n overflow: auto;\n padding-right: 0;\n}\n.tm-jav-list--scroll {\n display: flex;\n flex-wrap: wrap;\n align-content: flex-start;\n}\n.tm-jav-list--scroll::after {\n content: '';\n flex: 9999999;\n}\n.tm-jav-list--scroll .tm-jav-item {\n flex-grow: 1;\n}\n.tm-jav-list--loading-pages {\n width: 100%;\n height: 100%;\n position: absolute;\n left: 0;\n top: 0;\n z-index: 5;\n background-color: rgba(0, 0, 0, 0.1);\n}\n"]}, media: undefined });
};
/* scoped */
const __vue_scope_id__$3 = "data-v-5bb942be";
/* module identifier */
const __vue_module_identifier__$3 = undefined;
/* functional template */
const __vue_is_functional_template__$3 = false;
/* style inject SSR */
/* style inject shadow dom */
const __vue_component__$3 = normalizeComponent(
{ render: __vue_render__$3, staticRenderFns: __vue_staticRenderFns__$3 },
__vue_inject_styles__$3,
__vue_script__$3,
__vue_scope_id__$3,
__vue_is_functional_template__$3,
__vue_module_identifier__$3,
false,
createInjector,
undefined,
undefined
);
//
function g (o, k) {
return o && o[k] || ''
}
var script$4 = {
props: {
video: {
type: Object,
default: null,
largeImage: true
}
},
data () {
return {
showImages: false
}
},
computed: {
inDDos: {
cache: false,
get () {
return document.title === 'Just a moment...'
}
},
autoplay () {
return !this.inDDos && this.$root.options.autoplay
},
muted () {
return this.$root.options.muted
},
images () {
const imgs = this.video && this.video.images || {};
const count = imgs.count || 0;
const id = imgs.previewId;
return Array(count).fill(1).map((v, i) => `//pics.dmm.co.jp/digital/video/${id}/${id}-${i + 1}.jpg`)
},
sources () {
return !this.video || !this.video.previewId ? [] : genSources(this.video.previewId)
},
loading () {
return !this.video || !this.video.loaded.preview
},
loadingDetail () {
return !this.video || !this.video.loaded.detail
},
infos () {
return g(this.video, 'infos')
},
favorite () {
return g(this.video, 'favorite')
},
title () {
return g(this.video, 'title')
},
image () {
// const id = (this.avid || '').replace('-', '').toLowerCase()
// return `//pics.dmm.co.jp/mono/movie/adult/${id}/${id}p${this.largeImage ? 'l' : 's'}.jpg`
return g(this.video, 'image').replace('ps', 'pl')
},
avid () {
return g(this.video, 'avid')
}
},
methods: {
onVideoError (e) {
console.log(e);
},
favStar (id) {
addFav(id, 'star');
},
showAvList (target, type) {
this.$root.pushTab({
href: fillListUrl(target.id, type),
name: target.name
});
},
searchSamePrefix () {
const {prefix} = this.video;
this.$root.pushTab({
href: `vl_searchbyid.php?keyword=${prefix}`,
name: prefix.toUpperCase()
});
}
}
};
/* script */
const __vue_script__$4 = script$4;
/* template */
var __vue_render__$4 = function() {
var _vm = this;
var _h = _vm.$createElement;
var _c = _vm._self._c || _h;
return _c("div", { staticClass: "tm-jav-preview" }, [
_vm.images.length
? _c(
"span",
{
staticClass: "tm-jav-preview--images-trigger",
on: {
click: function($event) {
_vm.showImages = !_vm.showImages;
}
}
},
[_vm._v("图")]
)
: _vm._e(),
_vm._v(" "),
_vm.showImages
? _c(
"div",
{ staticClass: "tm-jav-preview--images" },
_vm._l(_vm.images, function(src) {
return _c("img", { key: src, attrs: { src: src, alt: "" } })
}),
0
)
: _vm._e(),
_vm._v(" "),
_c("div", { staticClass: "tm-jav-player" }, [
_c(
"video",
{
key: _vm.avid,
ref: "video",
attrs: { controls: "", autoplay: _vm.autoplay, preload: "true" },
domProps: { muted: _vm.muted }
},
_vm._l(_vm.sources, function(source, index) {
return _c("source", {
key: source,
attrs: { src: source },
on: {
error: function($event) {
return _vm.onVideoError($event, index)
}
}
})
}),
0
),
_vm._v(" "),
_vm.video && _vm.video.error
? _c("div", { staticClass: "tm-jav--loading-wrapper" }, [
_vm._v("\n " + _vm._s(_vm.video.error) + "\n ")
])
: _vm.loading
? _c("div", { staticClass: "tm-jav--loading-wrapper" }, [
_c("i", { staticClass: "tm-jav--loading" })
])
: _vm._e()
]),
_vm._v(" "),
_c("div", { staticClass: "tm-jav-information" }, [
_c(
"div",
{
directives: [
{
name: "show",
rawName: "v-show",
value: _vm.loadingDetail,
expression: "loadingDetail"
}
],
staticClass: "tm-jav--loading-wrapper"
},
[_c("i", { staticClass: "tm-jav--loading" })]
),
_vm._v(" "),
_c("i", {
staticClass: "tm-jav--close",
on: {
click: function($event) {
return _vm.$emit("close")
}
}
}),
_vm._v(" "),
_c("div", { staticClass: "tm-jav-information--cover" }, [
_vm.image
? _c("img", { attrs: { src: _vm.image, alt: "cover" } })
: _vm._e()
]),
_vm._v(" "),
_vm.infos
? _c("div", { staticClass: "tm-jav-infos" }, [
_c("div", { staticClass: "tm-jav-infos--row" }, [
_c(
"span",
{
staticClass: "tm-jav--tag",
on: { click: _vm.searchSamePrefix }
},
[_vm._v(_vm._s(_vm.avid))]
),
_vm._v(" "),
_c(
"a",
{
staticClass: "tm-jav-infos--title",
attrs: { target: "_blank", href: _vm.video && _vm.video.href }
},
[_vm._v(_vm._s(_vm.title))]
)
]),
_vm._v(" "),
_c(
"div",
{ staticClass: "tm-jav-infos--row" },
_vm._l(_vm.infos.stars, function(star) {
return _c(
"span",
{
staticClass: "tm-jav--tag",
on: {
click: function($event) {
return _vm.showAvList(star, "star")
}
}
},
[_c("span", [_vm._v(_vm._s(star.name))])]
)
}),
0
),
_vm._v(" "),
_c(
"div",
{ staticClass: "tm-jav-infos--row" },
_vm._l(_vm.infos.genres, function(genre) {
return _c(
"span",
{
staticClass: "tm-jav--tag",
on: {
click: function($event) {
return _vm.showAvList(genre, "genre")
}
}
},
[_vm._v(_vm._s(genre.name))]
)
}),
0
),
_vm._v(" "),
_c("div", { staticClass: "tm-jav-infos--row" }, [
_c("span", { staticClass: "tm-jav--tag" }, [
_vm._v(_vm._s(_vm.infos.date))
]),
_vm._v(" "),
_c(
"span",
{ staticClass: "tm-jav--tag", attrs: { title: "评分" } },
[_vm._v(_vm._s(_vm.favorite.score || "--") + "分")]
),
_vm._v(" "),
_c(
"span",
{ staticClass: "tm-jav--tag", attrs: { title: "想看的" } },
[_vm._v(_vm._s(_vm.favorite.subscribed))]
),
_vm._v(" "),
_c(
"span",
{ staticClass: "tm-jav--tag", attrs: { title: "看过的" } },
[_vm._v(_vm._s(_vm.favorite.watched))]
),
_vm._v(" "),
_c(
"span",
{ staticClass: "tm-jav--tag", attrs: { title: "拥有的" } },
[_vm._v(_vm._s(_vm.favorite.owned))]
),
_vm._v(" "),
_c(
"span",
{ staticClass: "tm-jav--tag", attrs: { title: "导演" } },
[_vm._v(_vm._s(_vm.infos.director.name || "--"))]
),
_vm._v(" "),
_c(
"span",
{ staticClass: "tm-jav--tag", attrs: { title: "制作商" } },
[_vm._v(_vm._s(_vm.infos.maker.name || "--"))]
),
_vm._v(" "),
_c(
"span",
{ staticClass: "tm-jav--tag", attrs: { title: "发行商" } },
[_vm._v(_vm._s(_vm.infos.label.name || "--"))]
)
])
])
: _vm._e()
])
])
};
var __vue_staticRenderFns__$4 = [];
__vue_render__$4._withStripped = true;
/* style */
const __vue_inject_styles__$4 = function (inject) {
if (!inject) return
inject("data-v-91159106_0", { source: ".tm-jav-preview[data-v-91159106] {\n overflow: auto;\n display: flex;\n flex-direction: column;\n width: 100%;\n margin-right: 10px;\n padding-right: 10px;\n position: relative;\n}\n.tm-jav-preview--images-trigger[data-v-91159106] {\n z-index: 10;\n position: absolute;\n left: 0px;\n top: 0;\n padding: 3px 4px;\n border-radius: 50%;\n cursor: pointer;\n color: #fff;\n background-color: #ee4dba;\n}\n.tm-jav-preview--images[data-v-91159106] {\n z-index: 10;\n position: absolute;\n right: 0px;\n top: 30px;\n}\n.tm-jav-preview .tm-jav--close[data-v-91159106] {\n position: absolute;\n right: 3px;\n top: 3px;\n z-index: 4;\n font-size: 30px;\n background-color: #ee4dba;\n}\n.tm-jav-preview .tm-jav-player[data-v-91159106] {\n width: 100%;\n position: relative;\n}\n.tm-jav-preview .tm-jav-player video[data-v-91159106] {\n width: 100%;\n}\n.tm-jav-preview .tm-jav-information[data-v-91159106] {\n padding: 10px;\n flex: 1;\n display: flex;\n position: relative;\n}\n.tm-jav-preview .tm-jav-information--cover[data-v-91159106] {\n width: 225px;\n}\n.tm-jav-preview .tm-jav-information--cover img[data-v-91159106] {\n width: 225px;\n margin-right: 10px;\n transition: transform 0.5s;\n transform-origin: bottom left;\n z-index: 5;\n}\n.tm-jav-preview .tm-jav-information--cover img[data-v-91159106]:hover {\n position: relative;\n bottom: 0;\n left: 0;\n transform-origin: bottom left;\n transform: scale(3);\n}\n.tm-jav-preview .tm-jav-information .tm-jav-infos[data-v-91159106] {\n flex: 1;\n position: relative;\n}\n.tm-jav-preview .tm-jav-information .tm-jav-infos--row[data-v-91159106] {\n margin-bottom: 4px;\n border-bottom: 1px solid rgba(119, 119, 119, 0.3);\n padding-bottom: 4px;\n}\n.tm-jav-preview .tm-jav-information .tm-jav-infos--title[data-v-91159106] {\n color: rgba(0, 0, 0, 0.65);\n}\n", map: {"version":3,"sources":["preview.vue"],"names":[],"mappings":"AAAA;EACE,cAAc;EACd,aAAa;EACb,sBAAsB;EACtB,WAAW;EACX,kBAAkB;EAClB,mBAAmB;EACnB,kBAAkB;AACpB;AACA;EACE,WAAW;EACX,kBAAkB;EAClB,SAAS;EACT,MAAM;EACN,gBAAgB;EAChB,kBAAkB;EAClB,eAAe;EACf,WAAW;EACX,yBAAyB;AAC3B;AACA;EACE,WAAW;EACX,kBAAkB;EAClB,UAAU;EACV,SAAS;AACX;AACA;EACE,kBAAkB;EAClB,UAAU;EACV,QAAQ;EACR,UAAU;EACV,eAAe;EACf,yBAAyB;AAC3B;AACA;EACE,WAAW;EACX,kBAAkB;AACpB;AACA;EACE,WAAW;AACb;AACA;EACE,aAAa;EACb,OAAO;EACP,aAAa;EACb,kBAAkB;AACpB;AACA;EACE,YAAY;AACd;AACA;EACE,YAAY;EACZ,kBAAkB;EAClB,0BAA0B;EAC1B,6BAA6B;EAC7B,UAAU;AACZ;AACA;EACE,kBAAkB;EAClB,SAAS;EACT,OAAO;EACP,6BAA6B;EAC7B,mBAAmB;AACrB;AACA;EACE,OAAO;EACP,kBAAkB;AACpB;AACA;EACE,kBAAkB;EAClB,iDAAiD;EACjD,mBAAmB;AACrB;AACA;EACE,0BAA0B;AAC5B","file":"preview.vue","sourcesContent":[".tm-jav-preview {\n overflow: auto;\n display: flex;\n flex-direction: column;\n width: 100%;\n margin-right: 10px;\n padding-right: 10px;\n position: relative;\n}\n.tm-jav-preview--images-trigger {\n z-index: 10;\n position: absolute;\n left: 0px;\n top: 0;\n padding: 3px 4px;\n border-radius: 50%;\n cursor: pointer;\n color: #fff;\n background-color: #ee4dba;\n}\n.tm-jav-preview--images {\n z-index: 10;\n position: absolute;\n right: 0px;\n top: 30px;\n}\n.tm-jav-preview .tm-jav--close {\n position: absolute;\n right: 3px;\n top: 3px;\n z-index: 4;\n font-size: 30px;\n background-color: #ee4dba;\n}\n.tm-jav-preview .tm-jav-player {\n width: 100%;\n position: relative;\n}\n.tm-jav-preview .tm-jav-player video {\n width: 100%;\n}\n.tm-jav-preview .tm-jav-information {\n padding: 10px;\n flex: 1;\n display: flex;\n position: relative;\n}\n.tm-jav-preview .tm-jav-information--cover {\n width: 225px;\n}\n.tm-jav-preview .tm-jav-information--cover img {\n width: 225px;\n margin-right: 10px;\n transition: transform 0.5s;\n transform-origin: bottom left;\n z-index: 5;\n}\n.tm-jav-preview .tm-jav-information--cover img:hover {\n position: relative;\n bottom: 0;\n left: 0;\n transform-origin: bottom left;\n transform: scale(3);\n}\n.tm-jav-preview .tm-jav-information .tm-jav-infos {\n flex: 1;\n position: relative;\n}\n.tm-jav-preview .tm-jav-information .tm-jav-infos--row {\n margin-bottom: 4px;\n border-bottom: 1px solid rgba(119, 119, 119, 0.3);\n padding-bottom: 4px;\n}\n.tm-jav-preview .tm-jav-information .tm-jav-infos--title {\n color: rgba(0, 0, 0, 0.65);\n}\n"]}, media: undefined });
};
/* scoped */
const __vue_scope_id__$4 = "data-v-91159106";
/* module identifier */
const __vue_module_identifier__$4 = undefined;
/* functional template */
const __vue_is_functional_template__$4 = false;
/* style inject SSR */
/* style inject shadow dom */
const __vue_component__$4 = normalizeComponent(
{ render: __vue_render__$4, staticRenderFns: __vue_staticRenderFns__$4 },
__vue_inject_styles__$4,
__vue_script__$4,
__vue_scope_id__$4,
__vue_is_functional_template__$4,
__vue_module_identifier__$4,
false,
createInjector,
undefined,
undefined
);
//
//
//
//
//
//
//
//
//
//
var script$5 = {
data () {
return {
scrollLeft: 0
}
},
props: {
tabs: {
default () {return []}
},
currIndex: {
default: 0
}
},
methods: {
scroll (e) {
this.scrollLeft += e.deltaY / 10;
this.$el.scrollLeft = this.scrollLeft;
}
}
};
/* script */
const __vue_script__$5 = script$5;
/* template */
var __vue_render__$5 = function() {
var _vm = this;
var _h = _vm.$createElement;
var _c = _vm._self._c || _h;
return _c(
"div",
{ staticClass: "tm-jav-tabs", on: { mousewheel: _vm.scroll } },
_vm._l(_vm.tabs, function(tab, index) {
return _c(
"div",
{
key: tab.href,
staticClass: "tm-jav-tabs--item",
class: { curr: _vm.currIndex === index }
},
[
_c(
"span",
{
staticClass: "tm-jav-tabs--name",
on: {
click: function($event) {
return _vm.$emit("active", index)
}
}
},
[_vm._v(_vm._s(tab.name))]
),
_vm._v(" "),
!tab.fixed
? _c("span", {
staticClass: "tm-jav--close",
on: {
click: function($event) {
return _vm.$emit("remove", index)
}
}
})
: _vm._e()
]
)
}),
0
)
};
var __vue_staticRenderFns__$5 = [];
__vue_render__$5._withStripped = true;
/* style */
const __vue_inject_styles__$5 = function (inject) {
if (!inject) return
inject("data-v-553f6612_0", { source: ".tm-jav-tabs {\n width: 100%;\n height: 20px;\n background-color: #fff;\n overflow-x: auto;\n white-space: nowrap;\n overflow-y: hidden;\n}\n.tm-jav-tabs::-webkit-scrollbar {\n display: none;\n}\n.tm-jav-tabs--item {\n display: inline-block;\n align-items: center;\n height: 20px;\n min-width: 70px;\n color: #fff;\n background-color: #f282ce;\n padding: 0 4px;\n margin-right: 1px;\n line-height: 20px;\n cursor: pointer;\n}\n.tm-jav-tabs--item:hover {\n background-color: #ff91dc;\n}\n.tm-jav-tabs--item.curr {\n background-color: #ffc4ec;\n color: #ff60cc;\n}\n.tm-jav-tabs--name {\n text-overflow: ellipsis;\n overflow: hidden;\n width: 50px;\n display: inline-block;\n white-space: nowrap;\n}\n.tm-jav-tabs--window {\n width: 16px;\n height: 16px;\n background: aquamarine;\n}\n.tm-jav-tabs .tm-jav--close {\n font-size: 14px;\n background-color: transparent;\n top: -7px;\n}\n", map: {"version":3,"sources":["tabs.vue","/home/ti/_code/_tm/javlib-preview/src/components/tabs.vue"],"names":[],"mappings":"AAAA;EACE,WAAW;EACX,YAAY;EACZ,sBAAsB;EACtB,gBAAgB;EAChB,mBAAmB;EACnB,kBAAkB;AACpB;AACA;EACE,aAAa;AACf;AACA;EACE,qBAAqB;EACrB,mBAAmB;EACnB,YAAY;EACZ,eAAe;EACf,WAAW;EACX,yBAAyB;EACzB,cAAc;EACd,iBAAiB;EACjB,iBAAiB;EACjB,eAAe;AACjB;AACA;EACE,yBAAyB;AAC3B;AACA;EACE,yBAAyB;EACzB,cAAc;AAChB;AACA;EACE,uBAAuB;EACvB,gBAAgB;EAChB,WAAW;EACX,qBAAqB;ECCvB,mBAAA;AACA;AACA;EACA,WAAA;EACA,YAAA;EACA,sBAAA;AACA;ADCA;ECCA,eAAA;EACA,6BAAA;EACA,SAAA;AACA","file":"tabs.vue","sourcesContent":[".tm-jav-tabs {\n width: 100%;\n height: 20px;\n background-color: #fff;\n overflow-x: auto;\n white-space: nowrap;\n overflow-y: hidden;\n}\n.tm-jav-tabs::-webkit-scrollbar {\n display: none;\n}\n.tm-jav-tabs--item {\n display: inline-block;\n align-items: center;\n height: 20px;\n min-width: 70px;\n color: #fff;\n background-color: #f282ce;\n padding: 0 4px;\n margin-right: 1px;\n line-height: 20px;\n cursor: pointer;\n}\n.tm-jav-tabs--item:hover {\n background-color: #ff91dc;\n}\n.tm-jav-tabs--item.curr {\n background-color: #ffc4ec;\n color: #ff60cc;\n}\n.tm-jav-tabs--name {\n text-overflow: ellipsis;\n overflow: hidden;\n width: 50px;\n display: inline-block;\n white-space: nowrap;\n}\n.tm-jav-tabs--window {\n width: 16px;\n height: 16px;\n background: aquamarine;\n}\n.tm-jav-tabs .tm-jav--close {\n font-size: 14px;\n background-color: transparent;\n top: -7px;\n}\n","<template>\n <div class=\"tm-jav-tabs\" @mousewheel=\"scroll\">\n <div class=\"tm-jav-tabs--item\" :class=\"{curr: currIndex === index}\" v-for=\"(tab, index) in tabs\" :key=\"tab.href\">\n <span class=\"tm-jav-tabs--name\" @click=\"$emit('active', index)\">{{tab.name}}</span>\n <!-- <span class=\"tm-jav-tabs--window\" @click=\"$emit('float-tab', tab)\"></span> -->\n <span class=\"tm-jav--close\" v-if=\"!tab.fixed\" @click=\"$emit('remove', index)\"></span>\n </div>\n </div>\n</template>\n\n<script>\nexport default {\n data () {\n return {\n scrollLeft: 0\n }\n },\n props: {\n tabs: {\n default () {return []}\n },\n currIndex: {\n default: 0\n }\n },\n methods: {\n scroll (e) {\n this.scrollLeft += e.deltaY / 10\n this.$el.scrollLeft = this.scrollLeft\n }\n }\n}\n</script>\n\n<style lang=\"less\">\n.tm-jav-tabs {\n width: 100%;\n height: 20px;\n background-color: #fff;\n overflow-x: auto;\n white-space: nowrap;\n overflow-y: hidden;\n\n &::-webkit-scrollbar {\n display: none;\n }\n &--item {\n display: inline-block;\n align-items: center;\n height: 20px;\n min-width: 70px;\n color: #fff;\n background-color: #f282ce;\n padding: 0 4px;\n margin-right: 1px;\n line-height: 20px;\n cursor: pointer;\n\n &:hover {\n background-color: darken(#ffc4ec, 10%);\n } \n &.curr {\n background-color: #ffc4ec;\n color: #ff60cc;\n }\n }\n\n &--name {\n text-overflow: ellipsis;\n overflow: hidden;\n width: 50px;\n display: inline-block;\n white-space: nowrap;\n }\n\n &--window {\n width: 16px;\n height: 16px;\n background: aquamarine;\n }\n\n .tm-jav--close {\n font-size: 14px;\n background-color: transparent;\n top: -7px;\n }\n}\n</style>"]}, media: undefined });
};
/* scoped */
const __vue_scope_id__$5 = undefined;
/* module identifier */
const __vue_module_identifier__$5 = undefined;
/* functional template */
const __vue_is_functional_template__$5 = false;
/* style inject SSR */
/* style inject shadow dom */
const __vue_component__$5 = normalizeComponent(
{ render: __vue_render__$5, staticRenderFns: __vue_staticRenderFns__$5 },
__vue_inject_styles__$5,
__vue_script__$5,
__vue_scope_id__$5,
__vue_is_functional_template__$5,
__vue_module_identifier__$5,
false,
createInjector,
undefined,
undefined
);
//
var script$6 = {
data () {
return {
logs: []
}
},
mounted () {
this.logs = [...logVue.logs];
logVue.$on('log-task', this.pushLog);
},
beforeDestroy () {
logVue.$off('log-task', this.pushLog);
},
methods: {
pushLog (taskLog) {
this.logs.unshift(taskLog);
}
}
};
/* script */
const __vue_script__$6 = script$6;
/* template */
var __vue_render__$6 = function() {
var _vm = this;
var _h = _vm.$createElement;
var _c = _vm._self._c || _h;
return _c(
"div",
{ staticClass: "tm-jav-log" },
[
_c("h4", [_vm._v("解析日志")]),
_vm._v(" "),
_vm._l(_vm.logs, function(task) {
return _c("div", { staticClass: "tm-jav-log--task" }, [
_c("h4", [_vm._v(_vm._s(task.name))]),
_vm._v(" "),
_c(
"div",
{ staticClass: "tm-jav-log--content" },
_vm._l(task.logs, function(log) {
return _c("p", { staticClass: "tm-jav-log--row" }, [
_c("span", { staticClass: "tm-jav-log--time" }, [
_vm._v(_vm._s(log.after) + "ms")
]),
_vm._v(" "),
_c(
"span",
{
class: [
"tm-jav--status",
"tm-jav--status-" + log.status,
"tm-jav--task-" + task.status
]
},
[_vm._v(_vm._s(log.status))]
),
_vm._v(" "),
_c("span", { staticClass: "tm-jav-log--name" }, [
_vm._v(_vm._s(log.name))
]),
_vm._v(" "),
_c("span", { staticClass: "tm-jav-log--msg" }, [
_vm._v(_vm._s(log.msg))
])
])
}),
0
),
_vm._v(" "),
!task.finished
? _c("span", { staticClass: "tm-jav--loading" })
: _vm._e()
])
})
],
2
)
};
var __vue_staticRenderFns__$6 = [];
__vue_render__$6._withStripped = true;
/* style */
const __vue_inject_styles__$6 = function (inject) {
if (!inject) return
inject("data-v-05228aec_0", { source: ".tm-jav-log[data-v-05228aec] {\n width: 100%;\n height: 28px;\n position: fixed;\n bottom: 0;\n left: 0;\n background: #fff;\n z-index: 20;\n padding: 10px;\n box-shadow: 0px -1px 6px 3px rgba(142, 142, 142, 0.71);\n transition: height 0.5s;\n overflow: hidden;\n}\n.tm-jav-log .tm-jav--loading[data-v-05228aec] {\n margin: 10px 90px;\n}\n.tm-jav-log h4[data-v-05228aec] {\n margin-top: 0;\n}\n.tm-jav-log[data-v-05228aec]:hover {\n overflow: auto;\n overflow-x: hidden;\n height: 30vh;\n}\n.tm-jav-log--task[data-v-05228aec] {\n margin-top: 4px;\n}\n.tm-jav-log--row[data-v-05228aec] {\n text-align: left;\n margin: 0 0 4px;\n}\n.tm-jav-log--row > span[data-v-05228aec] {\n margin-right: 4px;\n}\n.tm-jav-log--time[data-v-05228aec] {\n width: 60px;\n text-align: right;\n display: inline-block;\n}\n.tm-jav--status[data-v-05228aec] {\n display: inline-block;\n padding: 2px;\n border-radius: 4px;\n color: #fff;\n line-height: 1;\n text-align: center;\n width: 60px;\n background-color: #ccc;\n}\n.tm-jav--status-success[data-v-05228aec] {\n background-color: #0dba42;\n}\n.tm-jav--status-fail[data-v-05228aec] {\n background-color: #ff6666;\n}\n.tm-jav--status-finished[data-v-05228aec] {\n background-color: #2dceff;\n}\n.tm-jav--status-finished.tm-jav--task-success[data-v-05228aec] {\n background-color: #0dba42;\n}\n.tm-jav--status-finished.tm-jav--task-fail[data-v-05228aec] {\n background-color: #ff6666;\n}\n", map: {"version":3,"sources":["log.vue","/home/ti/_code/_tm/javlib-preview/src/components/log.vue"],"names":[],"mappings":"AAAA;EACE,WAAW;EACX,YAAY;EACZ,eAAe;EACf,SAAS;EACT,OAAO;EACP,gBAAgB;EAChB,WAAW;EACX,aAAa;EACb,sDAAsD;EACtD,uBAAuB;EACvB,gBAAgB;AAClB;AACA;EACE,iBAAiB;AACnB;AACA;EACE,aAAa;AACf;AACA;EACE,cAAc;EACd,kBAAkB;EAClB,YAAY;AACd;AACA;EACE,eAAe;AACjB;AACA;EACE,gBAAgB;EAChB,eAAe;AACjB;AACA;EACE,iBAAiB;AACnB;AACA;EACE,WAAW;EACX,iBAAiB;EACjB,qBAAqB;AACvB;AACA;EACE,qBAAqB;EACrB,YAAY;ECCd,kBAAA;EACA,WAAA;EACA,cAAA;EACA,kBAAA;EACA,WAAA;EACA,sBAAA;AACA;AACA;EACA,yBAAA;AACA;AACA;EACA,yBAAA;ADCA;ACCA;EACA,yBAAA;AACA;ADCA;ECCA,yBAAA;AACA;AACA;EACA,yBAAA;AACA","file":"log.vue","sourcesContent":[".tm-jav-log {\n width: 100%;\n height: 28px;\n position: fixed;\n bottom: 0;\n left: 0;\n background: #fff;\n z-index: 20;\n padding: 10px;\n box-shadow: 0px -1px 6px 3px rgba(142, 142, 142, 0.71);\n transition: height 0.5s;\n overflow: hidden;\n}\n.tm-jav-log .tm-jav--loading {\n margin: 10px 90px;\n}\n.tm-jav-log h4 {\n margin-top: 0;\n}\n.tm-jav-log:hover {\n overflow: auto;\n overflow-x: hidden;\n height: 30vh;\n}\n.tm-jav-log--task {\n margin-top: 4px;\n}\n.tm-jav-log--row {\n text-align: left;\n margin: 0 0 4px;\n}\n.tm-jav-log--row > span {\n margin-right: 4px;\n}\n.tm-jav-log--time {\n width: 60px;\n text-align: right;\n display: inline-block;\n}\n.tm-jav--status {\n display: inline-block;\n padding: 2px;\n border-radius: 4px;\n color: #fff;\n line-height: 1;\n text-align: center;\n width: 60px;\n background-color: #ccc;\n}\n.tm-jav--status-success {\n background-color: #0dba42;\n}\n.tm-jav--status-fail {\n background-color: #ff6666;\n}\n.tm-jav--status-finished {\n background-color: #2dceff;\n}\n.tm-jav--status-finished.tm-jav--task-success {\n background-color: #0dba42;\n}\n.tm-jav--status-finished.tm-jav--task-fail {\n background-color: #ff6666;\n}\n","<template>\n <div class=\"tm-jav-log\">\n <h4>解析日志</h4>\n <div class=\"tm-jav-log--task\" v-for=\"task in logs\">\n <h4>{{task.name}}</h4>\n <div class=\"tm-jav-log--content\">\n <p class=\"tm-jav-log--row\" v-for=\"log in task.logs\">\n <span class=\"tm-jav-log--time\">{{log.after}}ms</span>\n <span :class=\"['tm-jav--status', 'tm-jav--status-' + log.status, 'tm-jav--task-' + task.status]\">{{log.status}}</span>\n <span class=\"tm-jav-log--name\">{{log.name}}</span>\n <span class=\"tm-jav-log--msg\">{{log.msg}}</span>\n </p>\n </div>\n <span class=\"tm-jav--loading\" v-if=\"!task.finished\"></span>\n </div>\n </div>\n</template>\n\n<script>\nimport { logVue } from '@/utils/log' \nexport default {\n data () {\n return {\n logs: []\n }\n },\n mounted () {\n this.logs = [...logVue.logs]\n logVue.$on('log-task', this.pushLog)\n },\n beforeDestroy () {\n logVue.$off('log-task', this.pushLog)\n },\n methods: {\n pushLog (taskLog) {\n this.logs.unshift(taskLog)\n }\n }\n}\n</script>\n\n<style scoped lang=\"less\">\n.tm-jav-log {\n width: 100%;\n height: 28px;\n position: fixed;\n bottom: 0;\n left: 0;\n background: #fff;\n z-index: 20;\n padding: 10px;\n box-shadow: 0px -1px 6px 3px rgba(142, 142, 142, 0.71);\n transition: height .5s;\n overflow: hidden;\n\n .tm-jav--loading {\n margin: 10px 90px;\n }\n\n h4 {\n margin-top: 0;\n }\n &:hover {\n overflow: auto;\n overflow-x: hidden;\n height: 30vh;\n }\n\n &--task {\n margin-top: 4px;\n }\n\n &--row {\n text-align: left;\n margin: 0 0 4px;\n & > span {\n margin-right: 4px;\n }\n }\n\n &--time {\n width: 60px;\n text-align: right;\n display: inline-block;\n }\n}\n.tm-jav--status {\n display: inline-block;\n padding: 2px;\n border-radius: 4px;\n color: #fff;\n line-height: 1;\n text-align: center;\n width: 60px;\n background-color: #ccc;\n \n &-success {\n background-color: #0dba42;\n }\n &-fail {\n background-color: #ff6666\n }\n &-finished {\n background-color: rgb(45, 206, 255);\n &.tm-jav--task-success {\n background-color: #0dba42;\n }\n &.tm-jav--task-fail {\n background-color: #ff6666\n }\n }\n}\n</style>"]}, media: undefined });
};
/* scoped */
const __vue_scope_id__$6 = "data-v-05228aec";
/* module identifier */
const __vue_module_identifier__$6 = undefined;
/* functional template */
const __vue_is_functional_template__$6 = false;
/* style inject SSR */
/* style inject shadow dom */
const __vue_component__$6 = normalizeComponent(
{ render: __vue_render__$6, staticRenderFns: __vue_staticRenderFns__$6 },
__vue_inject_styles__$6,
__vue_script__$6,
__vue_scope_id__$6,
__vue_is_functional_template__$6,
__vue_module_identifier__$6,
false,
createInjector,
undefined,
undefined
);
//
var script$7 = {
data () {
return {
genres: []
}
},
mounted () {
this.init();
},
methods: {
init () {
genresModel.getAll().then((result) => {
this.genres = result;
});
},
showGenre ({id, name}) {
this.$root.pushTab({
href: 'vl_genre.php?g=' + id,
name,
});
}
}
};
/* script */
const __vue_script__$7 = script$7;
/* template */
var __vue_render__$7 = function() {
var _vm = this;
var _h = _vm.$createElement;
var _c = _vm._self._c || _h;
return _c(
"div",
{ staticClass: "tm-jav-genres" },
_vm._l(_vm.genres, function(category) {
return _c("div", { staticClass: "tm-jav-genres--category" }, [
_c("h3", { staticClass: "tm-jav-genres--category-name" }, [
_vm._v(_vm._s(category.type))
]),
_vm._v(" "),
_c(
"div",
{ staticClass: "tm-jav-genres--list" },
_vm._l(category.genres, function(genre) {
return _c(
"div",
{
staticClass: "tm-jav-genres--item",
on: {
click: function($event) {
return _vm.showGenre(genre)
}
}
},
[_vm._v("\n " + _vm._s(genre.name) + "\n ")]
)
}),
0
)
])
}),
0
)
};
var __vue_staticRenderFns__$7 = [];
__vue_render__$7._withStripped = true;
/* style */
const __vue_inject_styles__$7 = function (inject) {
if (!inject) return
inject("data-v-442b25a4_0", { source: ".tm-jav-genres[data-v-442b25a4] {\n position: fixed;\n right: 0;\n width: 300px;\n height: 100vh;\n transition: transform 0.5s;\n background-color: #fff;\n z-index: 50;\n box-shadow: -2px 0px 10px 1px #6b6b6b78;\n overflow: hidden;\n font-size: 14px;\n transform: translateX(290px);\n}\n.tm-jav-genres[data-v-442b25a4]:hover {\n transform: translateX(0);\n overflow: auto;\n}\n.tm-jav-genres--category[data-v-442b25a4] {\n border-top: 1px solid #333;\n margin-top: 20px;\n}\n.tm-jav-genres--category-name[data-v-442b25a4] {\n background-color: #fff;\n display: inline-block;\n margin: -10px 12px 0px;\n height: 20px;\n padding: 0 10px;\n overflow: hidden;\n}\n.tm-jav-genres--list[data-v-442b25a4] {\n padding: 0 12px;\n display: flex;\n flex-wrap: wrap;\n}\n.tm-jav-genres--item[data-v-442b25a4] {\n margin: 0 4px;\n padding: 2px;\n white-space: nowrap;\n cursor: pointer;\n border-radius: 2px;\n}\n.tm-jav-genres--item[data-v-442b25a4]:hover {\n background-color: #b1b1b1ab;\n}\n", map: {"version":3,"sources":["genres.vue","/home/ti/_code/_tm/javlib-preview/src/components/genres.vue"],"names":[],"mappings":"AAAA;EACE,eAAe;EACf,QAAQ;EACR,YAAY;EACZ,aAAa;EACb,0BAA0B;EAC1B,sBAAsB;EACtB,WAAW;EACX,uCAAuC;EACvC,gBAAgB;EAChB,eAAe;EACf,4BAA4B;AAC9B;AACA;EACE,wBAAwB;EACxB,cAAc;AAChB;AACA;EACE,0BAA0B;EAC1B,gBAAgB;AAClB;AACA;EACE,sBAAsB;EACtB,qBAAqB;EACrB,sBAAsB;EACtB,YAAY;EACZ,eAAe;EACf,gBAAgB;AAClB;AACA;EACE,eAAe;EACf,aAAa;EACb,eAAe;AACjB;AACA;EACE,aAAa;EACb,YAAY;EACZ,mBAAmB;EACnB,eAAe;EACf,kBAAkB;AACpB;ACCA;EACA,2BAAA;AACA","file":"genres.vue","sourcesContent":[".tm-jav-genres {\n position: fixed;\n right: 0;\n width: 300px;\n height: 100vh;\n transition: transform 0.5s;\n background-color: #fff;\n z-index: 50;\n box-shadow: -2px 0px 10px 1px #6b6b6b78;\n overflow: hidden;\n font-size: 14px;\n transform: translateX(290px);\n}\n.tm-jav-genres:hover {\n transform: translateX(0);\n overflow: auto;\n}\n.tm-jav-genres--category {\n border-top: 1px solid #333;\n margin-top: 20px;\n}\n.tm-jav-genres--category-name {\n background-color: #fff;\n display: inline-block;\n margin: -10px 12px 0px;\n height: 20px;\n padding: 0 10px;\n overflow: hidden;\n}\n.tm-jav-genres--list {\n padding: 0 12px;\n display: flex;\n flex-wrap: wrap;\n}\n.tm-jav-genres--item {\n margin: 0 4px;\n padding: 2px;\n white-space: nowrap;\n cursor: pointer;\n border-radius: 2px;\n}\n.tm-jav-genres--item:hover {\n background-color: #b1b1b1ab;\n}\n","<template>\n <div class=\"tm-jav-genres\">\n <div class=\"tm-jav-genres--category\" v-for=\"category in genres\">\n <h3 class=\"tm-jav-genres--category-name\">{{category.type}}</h3>\n <div class=\"tm-jav-genres--list\">\n <div class=\"tm-jav-genres--item\" v-for=\"genre in category.genres\" @click=\"showGenre(genre)\">\n {{genre.name}}\n </div>\n </div>\n </div>\n </div>\n</template>\n\n<script>\nimport genresModel from '@/api/genres'\nexport default {\n data () {\n return {\n genres: []\n }\n },\n mounted () {\n this.init()\n },\n methods: {\n init () {\n genresModel.getAll().then((result) => {\n this.genres = result\n })\n },\n showGenre ({id, name}) {\n this.$root.pushTab({\n href: 'vl_genre.php?g=' + id,\n name,\n })\n }\n }\n}\n</script>\n\n<style scoped lang=\"less\">\n.tm-jav-genres {\n position: fixed;\n right: 0;\n width: 300px;\n height: 100vh;\n transition: transform .5s;\n background-color: #fff;\n z-index: 50;\n box-shadow: -2px 0px 10px 1px #6b6b6b78;\n overflow: hidden;\n font-size: 14px;\n transform: translateX(290px);\n &:hover {\n transform: translateX(0);\n overflow: auto;\n }\n \n &--category {\n border-top: 1px solid #333;\n margin-top: 20px;\n &-name {\n background-color: #fff;\n display: inline-block;\n margin: -10px 12px 0px;\n height: 20px;\n padding: 0 10px;\n overflow: hidden;\n }\n }\n &--list {\n padding: 0 12px;\n display: flex;\n flex-wrap: wrap;\n }\n &--item {\n margin: 0 4px;\n padding: 2px;\n white-space: nowrap;\n cursor: pointer;\n border-radius: 2px;\n\n &:hover {\n background-color: #b1b1b1ab;\n }\n }\n}\n</style>"]}, media: undefined });
};
/* scoped */
const __vue_scope_id__$7 = "data-v-442b25a4";
/* module identifier */
const __vue_module_identifier__$7 = undefined;
/* functional template */
const __vue_is_functional_template__$7 = false;
/* style inject SSR */
/* style inject shadow dom */
const __vue_component__$7 = normalizeComponent(
{ render: __vue_render__$7, staticRenderFns: __vue_staticRenderFns__$7 },
__vue_inject_styles__$7,
__vue_script__$7,
__vue_scope_id__$7,
__vue_is_functional_template__$7,
__vue_module_identifier__$7,
false,
createInjector,
undefined,
undefined
);
const STORAGE_KEY = 'tm-jav-prev-status';
var prevStatus = {
set (value, key = STORAGE_KEY) {
if (typeof value !== 'string') {
value = JSON.stringify(value);
}
localStorage.setItem(key, value);
},
get (key = STORAGE_KEY) {
const value = localStorage.getItem(key);
return JSON.parse(value)
}
};
//
var script$8 = {
name: 'tm-app',
components: {
TmContainer: __vue_component__,
TmWindow: __vue_component__$1,
TmPreview: __vue_component__$4,
TmList: __vue_component__$3,
TmTabs: __vue_component__$5,
TmLog: __vue_component__$6,
TmGenres: __vue_component__$7,
},
data () {
return {
currVideo: null,
currWindowSrc: '',
tabIndex: 0,
tabs: [
{name: '最热门', href: '/cn/', next: false, fixed: true},
{name: '新发行', href: 'vl_newrelease.php', fixed: true},
{name: '新加入', href: 'vl_newentries.php', fixed: true},
{name: '最想要', href: 'vl_mostwanted.php', fixed: true},
{name: '高评价', href: 'vl_bestrated.php', fixed: true},
],
options: {
autoplay: true,
muted: false,
loadPrevStatus: true,
useWindow: true,
showApp: true
}
}
},
created () {
this.init();
window.addEventListener('beforeunload', this.onClose);
},
beforeDestroy () {
window.removeEventListener('beforeunload', this.onClose);
},
computed: {
currTab () {
return this.tabs[this.tabIndex] || null
}
},
methods: {
removeTab (index) {
const tab = this.tabs[index];
if (tab.fixed) { return }
this.tabs.splice(index, 1);
if (index === this.tabIndex) {
const prevIndex = ListCacheStore.keys.length - 2;
if (prevIndex > -1) {
index = this.tabs.findIndex(tab => tab.href === ListCacheStore.keys[prevIndex]);
}
this.tabIndex = Math.max(index, 0);
} else if (this.tabIndex >= this.tabs.length) {
this.tabIndex = this.tabs.length - 1;
}
},
pushTab (tab) {
try {
const {name, href} = tab;
const index = this.tabs.findIndex((tab) => tab.href === href);
if (index > -1) {
this.tabIndex = index;
} else {
const len = this.tabs.push({name, href});
this.tabIndex = len - 1;
}
} catch (e) {
console.error(e);
}
},
onClose () {
prevStatus.set(this._data);
},
init () {
const prev = prevStatus.get();
if (!prev) {
return
}
const loadPrevStatus = prev.options && prev.options.loadPrevStatus;
prev.options && (this.options = {...this.options, ...prev.options});
if (prev && loadPrevStatus !== false) {
for (let key in prev) {
if (key !== 'options') {
this[key] = prev[key];
}
}
}
},
handleGlobalClick (ev) {
if (!this.options.useWindow) {
return
}
// A tm-jav-infos--title A tm-jav-item--title
const target = ev.target;
if (target.tagName === 'A' && target.className.endsWith('--title')) {
ev.preventDefault();
ev.stopPropagation();
this.currWindowSrc = target.href;
}
}
}
};
/* script */
const __vue_script__$8 = script$8;
/* template */
var __vue_render__$8 = function() {
var _vm = this;
var _h = _vm.$createElement;
var _c = _vm._self._c || _h;
return _c("tm-container", [
_c(
"div",
{ staticClass: "tm-jav", on: { click: _vm.handleGlobalClick } },
[
_c("header", { staticClass: "tm-jav-header" }, [
_c("input", {
directives: [
{
name: "model",
rawName: "v-model",
value: _vm.options.showApp,
expression: "options.showApp"
}
],
attrs: { type: "checkbox" },
domProps: {
checked: Array.isArray(_vm.options.showApp)
? _vm._i(_vm.options.showApp, null) > -1
: _vm.options.showApp
},
on: {
change: function($event) {
var $$a = _vm.options.showApp,
$$el = $event.target,
$$c = $$el.checked ? true : false;
if (Array.isArray($$a)) {
var $$v = null,
$$i = _vm._i($$a, $$v);
if ($$el.checked) {
$$i < 0 &&
_vm.$set(_vm.options, "showApp", $$a.concat([$$v]));
} else {
$$i > -1 &&
_vm.$set(
_vm.options,
"showApp",
$$a.slice(0, $$i).concat($$a.slice($$i + 1))
);
}
} else {
_vm.$set(_vm.options, "showApp", $$c);
}
}
}
}),
_vm._v(" 进入网站自动加载本脚本\n "),
_c("input", {
directives: [
{
name: "model",
rawName: "v-model",
value: _vm.options.autoplay,
expression: "options.autoplay"
}
],
attrs: { type: "checkbox" },
domProps: {
checked: Array.isArray(_vm.options.autoplay)
? _vm._i(_vm.options.autoplay, null) > -1
: _vm.options.autoplay
},
on: {
change: function($event) {
var $$a = _vm.options.autoplay,
$$el = $event.target,
$$c = $$el.checked ? true : false;
if (Array.isArray($$a)) {
var $$v = null,
$$i = _vm._i($$a, $$v);
if ($$el.checked) {
$$i < 0 &&
_vm.$set(_vm.options, "autoplay", $$a.concat([$$v]));
} else {
$$i > -1 &&
_vm.$set(
_vm.options,
"autoplay",
$$a.slice(0, $$i).concat($$a.slice($$i + 1))
);
}
} else {
_vm.$set(_vm.options, "autoplay", $$c);
}
}
}
}),
_vm._v(" 自动播放\n "),
_c("input", {
directives: [
{
name: "model",
rawName: "v-model",
value: _vm.options.muted,
expression: "options.muted"
}
],
attrs: { type: "checkbox" },
domProps: {
checked: Array.isArray(_vm.options.muted)
? _vm._i(_vm.options.muted, null) > -1
: _vm.options.muted
},
on: {
change: function($event) {
var $$a = _vm.options.muted,
$$el = $event.target,
$$c = $$el.checked ? true : false;
if (Array.isArray($$a)) {
var $$v = null,
$$i = _vm._i($$a, $$v);
if ($$el.checked) {
$$i < 0 && _vm.$set(_vm.options, "muted", $$a.concat([$$v]));
} else {
$$i > -1 &&
_vm.$set(
_vm.options,
"muted",
$$a.slice(0, $$i).concat($$a.slice($$i + 1))
);
}
} else {
_vm.$set(_vm.options, "muted", $$c);
}
}
}
}),
_vm._v(" 静音播放\n "),
_c("input", {
directives: [
{
name: "model",
rawName: "v-model",
value: _vm.options.loadPrevStatus,
expression: "options.loadPrevStatus"
}
],
attrs: { type: "checkbox" },
domProps: {
checked: Array.isArray(_vm.options.loadPrevStatus)
? _vm._i(_vm.options.loadPrevStatus, null) > -1
: _vm.options.loadPrevStatus
},
on: {
change: function($event) {
var $$a = _vm.options.loadPrevStatus,
$$el = $event.target,
$$c = $$el.checked ? true : false;
if (Array.isArray($$a)) {
var $$v = null,
$$i = _vm._i($$a, $$v);
if ($$el.checked) {
$$i < 0 &&
_vm.$set(_vm.options, "loadPrevStatus", $$a.concat([$$v]));
} else {
$$i > -1 &&
_vm.$set(
_vm.options,
"loadPrevStatus",
$$a.slice(0, $$i).concat($$a.slice($$i + 1))
);
}
} else {
_vm.$set(_vm.options, "loadPrevStatus", $$c);
}
}
}
}),
_vm._v(" 自动加载上一次浏览状态\n "),
_c("input", {
directives: [
{
name: "model",
rawName: "v-model",
value: _vm.options.useWindow,
expression: "options.useWindow"
}
],
attrs: { type: "checkbox" },
domProps: {
checked: Array.isArray(_vm.options.useWindow)
? _vm._i(_vm.options.useWindow, null) > -1
: _vm.options.useWindow
},
on: {
change: function($event) {
var $$a = _vm.options.useWindow,
$$el = $event.target,
$$c = $$el.checked ? true : false;
if (Array.isArray($$a)) {
var $$v = null,
$$i = _vm._i($$a, $$v);
if ($$el.checked) {
$$i < 0 &&
_vm.$set(_vm.options, "useWindow", $$a.concat([$$v]));
} else {
$$i > -1 &&
_vm.$set(
_vm.options,
"useWindow",
$$a.slice(0, $$i).concat($$a.slice($$i + 1))
);
}
} else {
_vm.$set(_vm.options, "useWindow", $$c);
}
}
}
}),
_vm._v(" 点击标题在小窗口打开\n ")
]),
_vm._v(" "),
_c(
"div",
{ staticClass: "tm-jav-body" },
[
_c("tm-preview", {
directives: [
{
name: "show",
rawName: "v-show",
value: _vm.currVideo,
expression: "currVideo"
}
],
staticStyle: { flex: "1" },
attrs: { video: _vm.currVideo },
on: {
close: function($event) {
_vm.currVideo = null;
}
}
}),
_vm._v(" "),
_c(
"div",
{
staticClass: "tm-jav-main-list",
style: { width: _vm.currVideo ? "35%" : "100%" }
},
[
_c("tm-tabs", {
attrs: { currIndex: _vm.tabIndex, tabs: _vm.tabs },
on: {
active: function(index) {
return (_vm.tabIndex = index)
},
remove: _vm.removeTab
}
}),
_vm._v(" "),
_c("tm-list", {
attrs: { tab: _vm.currTab },
on: {
select: function(v) {
return (_vm.currVideo = v)
}
}
})
],
1
)
],
1
),
_vm._v(" "),
_c("footer", { staticClass: "tm-jav-footer" }, [_c("tm-log")], 1),
_vm._v(" "),
_c("tm-genres"),
_vm._v(" "),
_c("tm-window", {
attrs: { src: _vm.currWindowSrc },
on: {
close: function($event) {
_vm.currWindowSrc = "";
}
}
})
],
1
)
])
};
var __vue_staticRenderFns__$8 = [];
__vue_render__$8._withStripped = true;
/* style */
const __vue_inject_styles__$8 = function (inject) {
if (!inject) return
inject("data-v-906a773a_0", { source: "\n.tm-jav[data-v-906a773a]\n{\n font-size: 12px;\n background-color: #f5f5f5;\n width: 100vw;\n height: 100vh;\n min-width: 1200px;\n overflow-x: auto;\n display: flex;\n flex-direction: column;\n}\n.tm-jav-header[data-v-906a773a], .tm-jav-footer[data-v-906a773a] {\n height: 28px;\n padding: 0 16px;\n}\n.tm-jav-body[data-v-906a773a] {\n flex: 1;\n overflow: hidden;\n display: flex;\n margin: 0 16px;\n width: 100%;\n}\n.tm-jav-main-list[data-v-906a773a] {\n width: 35vw;\n}\n", map: {"version":3,"sources":["/home/ti/_code/_tm/javlib-preview/src/app.vue"],"names":[],"mappings":";AAyJA;;EAEA,eAAA;EACA,yBAAA;EACA,YAAA;EACA,aAAA;EACA,iBAAA;EACA,gBAAA;EACA,aAAA;EACA,sBAAA;AACA;AACA;EACA,YAAA;EACA,eAAA;AACA;AACA;EACA,OAAA;EACA,gBAAA;EACA,aAAA;EACA,cAAA;EACA,WAAA;AACA;AACA;EACA,WAAA;AACA","file":"app.vue","sourcesContent":["<template>\n<tm-container>\n <div class=\"tm-jav\" @click=\"handleGlobalClick\">\n <header class=\"tm-jav-header\">\n <input type=\"checkbox\" v-model=\"options.showApp\"> 进入网站自动加载本脚本\n <input type=\"checkbox\" v-model=\"options.autoplay\"> 自动播放\n <input type=\"checkbox\" v-model=\"options.muted\"> 静音播放\n <input type=\"checkbox\" v-model=\"options.loadPrevStatus\"> 自动加载上一次浏览状态\n <input type=\"checkbox\" v-model=\"options.useWindow\"> 点击标题在小窗口打开\n </header>\n <div class=\"tm-jav-body\">\n <tm-preview style=\"flex: 1\" :video=\"currVideo\" v-show=\"currVideo\" @close=\"currVideo = null\"></tm-preview>\n <div class=\"tm-jav-main-list\" :style=\"{width: currVideo ? '35%' : '100%'}\">\n <tm-tabs \n :currIndex=\"tabIndex\" :tabs=\"tabs\"\n @active=\"(index) => tabIndex = index\"\n @remove=\"removeTab\"\n ></tm-tabs>\n <tm-list :tab=\"currTab\" @select=\"(v) => currVideo = v\"></tm-list>\n </div>\n </div>\n <footer class=\"tm-jav-footer\">\n <tm-log></tm-log>\n </footer>\n <tm-genres></tm-genres>\n <tm-window :src=\"currWindowSrc\" @close=\"currWindowSrc = ''\"></tm-window>\n </div>\n</tm-container>\n</template>\n\n<script>\nimport TmContainer from '@/components/container.vue'\nimport TmWindow from '@/components/window.vue'\nimport TmList from '@/components/list.vue'\nimport TmPreview from '@/components/preview.vue'\nimport TmTabs from '@/components/tabs.vue'\nimport TmLog from '@/components/log.vue'\nimport TmGenres from '@/components/genres.vue'\nimport prevStatus from '@/utils/prev-status'\nimport { ListCacheStore } from '@/utils/javlibrary'\n\nexport default {\n name: 'tm-app',\n components: {\n TmContainer,\n TmWindow,\n TmPreview,\n TmList,\n TmTabs,\n TmLog,\n TmGenres,\n },\n data () {\n return {\n currVideo: null,\n currWindowSrc: '',\n tabIndex: 0,\n tabs: [\n {name: '最热门', href: '/cn/', next: false, fixed: true},\n {name: '新发行', href: 'vl_newrelease.php', fixed: true},\n {name: '新加入', href: 'vl_newentries.php', fixed: true},\n {name: '最想要', href: 'vl_mostwanted.php', fixed: true},\n {name: '高评价', href: 'vl_bestrated.php', fixed: true},\n ],\n options: {\n autoplay: true,\n muted: false,\n loadPrevStatus: true,\n useWindow: true,\n showApp: true\n }\n }\n },\n created () {\n this.init()\n window.addEventListener('beforeunload', this.onClose)\n },\n beforeDestroy () {\n window.removeEventListener('beforeunload', this.onClose)\n },\n computed: {\n currTab () {\n return this.tabs[this.tabIndex] || null\n }\n },\n methods: {\n removeTab (index) {\n const tab = this.tabs[index]\n if (tab.fixed) { return }\n\n this.tabs.splice(index, 1)\n\n if (index === this.tabIndex) {\n const prevIndex = ListCacheStore.keys.length - 2\n if (prevIndex > -1) {\n index = this.tabs.findIndex(tab => tab.href === ListCacheStore.keys[prevIndex])\n }\n \n this.tabIndex = Math.max(index, 0)\n } else if (this.tabIndex >= this.tabs.length) {\n this.tabIndex = this.tabs.length - 1\n }\n },\n pushTab (tab) {\n try {\n const {name, href} = tab\n const index = this.tabs.findIndex((tab) => tab.href === href)\n if (index > -1) {\n this.tabIndex = index\n } else {\n const len = this.tabs.push({name, href})\n this.tabIndex = len - 1\n }\n } catch (e) {\n console.error(e)\n }\n },\n onClose () {\n prevStatus.set(this._data)\n },\n init () {\n const prev = prevStatus.get()\n if (!prev) {\n return\n }\n const loadPrevStatus = prev.options && prev.options.loadPrevStatus\n prev.options && (this.options = {...this.options, ...prev.options})\n if (prev && loadPrevStatus !== false) {\n for (let key in prev) {\n if (key !== 'options') {\n this[key] = prev[key]\n }\n }\n }\n },\n handleGlobalClick (ev) {\n if (!this.options.useWindow) {\n return\n }\n // A tm-jav-infos--title A tm-jav-item--title\n const target = ev.target\n if (target.tagName === 'A' && target.className.endsWith('--title')) {\n ev.preventDefault()\n ev.stopPropagation()\n this.currWindowSrc = target.href\n }\n }\n }\n}\n\n</script>\n\n<style scoped>\n.tm-jav\n{\n font-size: 12px;\n background-color: #f5f5f5;\n width: 100vw;\n height: 100vh;\n min-width: 1200px;\n overflow-x: auto;\n display: flex;\n flex-direction: column;\n}\n.tm-jav-header, .tm-jav-footer {\n height: 28px;\n padding: 0 16px;\n}\n.tm-jav-body {\n flex: 1;\n overflow: hidden;\n display: flex;\n margin: 0 16px;\n width: 100%;\n}\n.tm-jav-main-list {\n width: 35vw;\n}\n</style>\n"]}, media: undefined });
};
/* scoped */
const __vue_scope_id__$8 = "data-v-906a773a";
/* module identifier */
const __vue_module_identifier__$8 = undefined;
/* functional template */
const __vue_is_functional_template__$8 = false;
/* style inject SSR */
/* style inject shadow dom */
const __vue_component__$8 = normalizeComponent(
{ render: __vue_render__$8, staticRenderFns: __vue_staticRenderFns__$8 },
__vue_inject_styles__$8,
__vue_script__$8,
__vue_scope_id__$8,
__vue_is_functional_template__$8,
__vue_module_identifier__$8,
false,
createInjector,
undefined,
undefined
);
__$styleInject("/* .vue */\n* {\n box-sizing: border-box;\n}\n#adultwarningmask {\n display: none;\n}\nbody::-webkit-scrollbar {\n display: none;\n}\n::-webkit-scrollbar-thumb {\n height: 56px;\n background: #ff60cc;\n}\n::-webkit-scrollbar {\n width: 4px;\n}\n.tm-jav--close {\n position: relative;\n width: 1em;\n height: 1em;\n opacity: 0.7;\n font-size: 20px;\n display: inline-block;\n background-color: rgba(0, 0, 0, 0.5);\n border-radius: 50%;\n vertical-align: middle;\n}\n.tm-jav--close:hover {\n opacity: 1;\n}\n.tm-jav--close:before,\n.tm-jav--close:after {\n position: absolute;\n left: calc(0.5em - 1px);\n content: ' ';\n height: 1em;\n width: 2px;\n background-color: #fff;\n}\n.tm-jav--close:before {\n transform: rotate(45deg);\n}\n.tm-jav--close:after {\n transform: rotate(-45deg);\n}\n.tm-jav--loading-wrapper {\n position: absolute;\n left: 50%;\n top: 50%;\n z-index: 4;\n color: #fff;\n transform: translate(-50%, -50%);\n}\n.tm-jav--loading {\n font-size: 10px;\n width: 1em;\n height: 1em;\n display: inline-block;\n margin: 10px 15px;\n position: relative;\n left: -9999px;\n border-radius: 5px;\n background-color: #f282ce;\n color: #f282ce;\n box-shadow: 9999px 0 0 -5px #f282ce;\n animation: dotPulse 1.5s infinite linear;\n animation-delay: 0.25s;\n}\n.tm-jav--loading::before,\n.tm-jav--loading::after {\n content: '';\n display: inline-block;\n position: absolute;\n top: 0;\n width: 10px;\n height: 10px;\n border-radius: 5px;\n background-color: #f282ce;\n color: #f282ce;\n}\n.tm-jav--loading::before {\n box-shadow: 9984px 0 0 -5px #f282ce;\n animation: dotPulseBefore 1.5s infinite linear;\n animation-delay: 0s;\n}\n.tm-jav--loading::after {\n box-shadow: 10014px 0 0 -5px #f282ce;\n animation: dotPulseAfter 1.5s infinite linear;\n animation-delay: 0.5s;\n}\n@keyframes dotPulseBefore {\n 0% {\n box-shadow: 9984px 0 0 -5px #f282ce;\n }\n 30% {\n box-shadow: 9984px 0 0 2px #f282ce;\n }\n 60%,\n 100% {\n box-shadow: 9984px 0 0 -5px #f282ce;\n }\n}\n@keyframes dotPulse {\n 0% {\n box-shadow: 9999px 0 0 -5px #f282ce;\n }\n 30% {\n box-shadow: 9999px 0 0 2px #f282ce;\n }\n 60%,\n 100% {\n box-shadow: 9999px 0 0 -5px #f282ce;\n }\n}\n@keyframes dotPulseAfter {\n 0% {\n box-shadow: 10014px 0 0 -5px #f282ce;\n }\n 30% {\n box-shadow: 10014px 0 0 2px #f282ce;\n }\n 60%,\n 100% {\n box-shadow: 10014px 0 0 -5px #f282ce;\n }\n}\n.tm-jav--tag {\n margin: 0;\n padding: 0;\n color: rgba(0, 0, 0, 0.65);\n font-size: 14px;\n font-variant: tabular-nums;\n line-height: 1.5;\n list-style: none;\n font-feature-settings: 'tnum';\n display: inline-block;\n height: auto;\n margin-right: 4px;\n padding: 0 7px;\n font-size: 12px;\n line-height: 20px;\n white-space: nowrap;\n background: #fafafa;\n border: 1px solid #d9d9d9;\n border-radius: 4px;\n cursor: default;\n opacity: 1;\n transition: all 0.3s cubic-bezier(0.78, 0.14, 0.15, 0.86);\n}\n.tm-jav--tag.tm-jav--current {\n background-color: rgba(0, 0, 0, 0.65);\n color: #fff;\n}\n.tm-jav--heart {\n font-size: 8px;\n background-color: red;\n display: inline-block;\n height: 1em;\n width: 1em;\n position: relative;\n top: 0;\n transform: rotate(-45deg);\n}\n.tm-jav--heart:before,\n.tm-jav--heart:after {\n content: \"\";\n background-color: red;\n border-radius: 50%;\n height: 1em;\n position: absolute;\n width: 1em;\n}\n.tm-jav--heart:before {\n top: -0.5em;\n left: 0;\n}\n.tm-jav--heart:after {\n left: 0.5em;\n top: 0;\n}\n");
Vue.use(Http);
const container = (parent) => {
const appContainer = document.createElement('div');
parent.insertBefore(appContainer, parent.firstChild);
return appContainer
};
const vuefactory = (option, parent = document.body) => {
const vm = new Vue({
...option,
el: container(parent),
});
if (!window.__TAMPERMONKEY_VUE__) window.__TAMPERMONKEY_VUE__ = [];
window.__TAMPERMONKEY_VUE__.push(vm);
};
vuefactory(__vue_component__$8);
}(RectangleTransform, Vue));
//# sourceMappingURL=javlib-preview-userscript.user.js.map