// ==UserScript==
// @name Javlibrary - 首页一站式影片预览
// @version 0.3.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
// @grant GM_xmlhttpRequest
// ==/UserScript==
(function (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;
}
Vue = Vue && Vue.hasOwnProperty('default') ? Vue['default'] : Vue;
//
//
//
//
//
//
//
//
//
//
//
var script = {
props: {
zIndex: {
default: 1
}
},
data () {
return {
show: true
}
}
};
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",
on: {
click: function($event) {
_vm.show = !_vm.show;
}
}
},
[
_c("i", {
staticClass: "ti-toggle",
class: _vm.show ? "to-hide" : "to-show"
})
]
),
_vm._v(" "),
_c(
"div",
{
directives: [
{
name: "show",
rawName: "v-show",
value: _vm.show,
expression: "show"
}
],
staticClass: "main"
},
[_vm._t("default")],
2
)
]
)
};
var __vue_staticRenderFns__ = [];
__vue_render__._withStripped = true;
/* style */
const __vue_inject_styles__ = function (inject) {
if (!inject) return
inject("data-v-241e8504_0", { source: ".ti-container[data-v-241e8504] {\n position: fixed;\n left: 0;\n top: 0;\n}\n.ti-container .toggle[data-v-241e8504] {\n position: absolute;\n left: -15px;\n top: -15px;\n width: 30px;\n height: 30px;\n border-bottom-right-radius: 15px;\n background-color: #adadad;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.ti-container .toggle[data-v-241e8504]:hover {\n left: 0;\n top: 0;\n}\n.ti-container .main[data-v-241e8504] {\n background-color: #000000cb;\n}\n.ti-toggle[data-v-241e8504] {\n font-size: 13px;\n width: 1em;\n height: 1em;\n border: 2px solid #fff;\n display: inline-block;\n}\n.ti-toggle.to-hide[data-v-241e8504] {\n border-right: 0;\n border-bottom: 0;\n}\n.ti-toggle.to-show[data-v-241e8504] {\n border-left: 0;\n border-top: 0;\n}\n", map: {"version":3,"sources":["container.vue","C:\\Users\\Ti\\code\\_tampermonkey\\javlib-preview-userscript\\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;AACrB;AACA;EACE,OAAO;EACP,MAAM;AACR;AACA;EACE,2BAA2B;AAC7B;AACA;EACE,eAAe;EACf,UAAU;ECCZ,WAAA;EACA,sBAAA;EACA,qBAAA;AACA;AACA;EACA,eAAA;EACA,gBAAA;AACA;AACA;EACA,cAAA;EACA,aAAA;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: -15px;\n top: -15px;\n width: 30px;\n height: 30px;\n border-bottom-right-radius: 15px;\n background-color: #adadad;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.ti-container .toggle:hover {\n left: 0;\n top: 0;\n}\n.ti-container .main {\n background-color: #000000cb;\n}\n.ti-toggle {\n font-size: 13px;\n width: 1em;\n height: 1em;\n border: 2px solid #fff;\n display: inline-block;\n}\n.ti-toggle.to-hide {\n border-right: 0;\n border-bottom: 0;\n}\n.ti-toggle.to-show {\n border-left: 0;\n border-top: 0;\n}\n","<template>\r\n <div class=\"ti-container\" :style=\"{zIndex}\">\r\n <div class=\"toggle\" @click=\"show = !show\">\r\n <i class=\"ti-toggle\" :class=\"show ? 'to-hide' : 'to-show'\"></i>\r\n </div>\r\n <div class=\"main\" v-show=\"show\">\r\n <slot></slot>\r\n </div>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nexport default {\r\n props: {\r\n zIndex: {\r\n default: 1\r\n }\r\n },\r\n data () {\r\n return {\r\n show: true\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style scoped lang=\"less\">\r\n.ti-container\r\n{\r\n position: fixed;\r\n left: 0;\r\n top: 0;\r\n}\r\n.ti-container .toggle\r\n{\r\n position: absolute;\r\n left: -15px;\r\n top: -15px;\r\n width: 30px;\r\n height: 30px; \r\n border-bottom-right-radius: 15px;\r\n background-color: #adadad;\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n}\r\n.ti-container .toggle:hover\r\n{\r\n left: 0;\r\n top: 0;\r\n}\r\n.ti-container .main\r\n{\r\n background-color: #000000cb;\r\n}\r\n.ti-toggle {\r\n font-size: 13px;\r\n width: 1em;\r\n height: 1em;\r\n border: 2px solid #fff;\r\n display: inline-block;\r\n &.to-hide {\r\n border-right: 0;\r\n border-bottom: 0;\r\n }\r\n &.to-show {\r\n border-left: 0;\r\n border-top: 0;\r\n }\r\n}\r\n</style>\r\n"]}, media: undefined });
};
/* scoped */
const __vue_scope_id__ = "data-v-241e8504";
/* 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: {
video: {
type: Object,
default: null
}
},
methods: {
showPreview () {
this.$emit('show-preview');
}
}
};
/* 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",
{ staticClass: "tm-jav-item", on: { click: _vm.showPreview } },
[
_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" }),
_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__$1 = [];
__vue_render__$1._withStripped = true;
/* style */
const __vue_inject_styles__$1 = function (inject) {
if (!inject) return
inject("data-v-7f6d78d4_0", { source: ".tm-jav-item[data-v-7f6d78d4] {\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-7f6d78d4] {\n max-height: 200px;\n max-height: 300px;\n object-fit: cover;\n}\n.tm-jav-item--inner[data-v-7f6d78d4] {\n width: 100%;\n height: 100%;\n position: relative;\n}\n.tm-jav-item--info[data-v-7f6d78d4] {\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-7f6d78d4] {\n color: #fff;\n}\n.tm-jav-item .play-btn[data-v-7f6d78d4] {\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-7f6d78d4]::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-7f6d78d4]::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-7f6d78d4]:hover::before {\n border-color: #ffa04c;\n}\n.tm-jav-item .play-btn[data-v-7f6d78d4]:hover::after {\n border-color: transparent #ffa04c;\n}\n.tm-jav-item:hover .play-btn[data-v-7f6d78d4] {\n bottom: 4px;\n}\n.tm-jav-item:hover .tm-jav-item[data-v-7f6d78d4] {\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-7f6d78d4] {\n transform: scale(1.08);\n transform-origin: center center;\n}\n.tm-jav-item:hover .tm-jav-item--cover[data-v-7f6d78d4] {\n filter: blur(2px);\n}\n.tm-jav-item:hover .tm-jav-item--info[data-v-7f6d78d4] {\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n}\n", map: {"version":3,"sources":["item.vue","C:\\Users\\Ti\\code\\_tampermonkey\\javlib-preview-userscript\\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>\r\n <div class=\"tm-jav-item\" @click=\"showPreview\">\r\n <div class=\"tm-jav-item--inner\">\r\n <img class=\"tm-jav-item--cover\" :src=\"video.image\" :alt=\"video.title\" width=\"100%\">\r\n <div class=\"play-btn\"></div>\r\n <div class=\"tm-jav-item--info\">\r\n <span class=\"tm-jav-item--avid\">{{video.avid}}</span>\r\n <a class=\"tm-jav-item--title\" target=\"_blank\" :href=\"video.href\" :title=\"video.title\">{{video.title}}</a>\r\n </div>\r\n </div>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nexport default {\r\n props: {\r\n video: {\r\n type: Object,\r\n default: null\r\n }\r\n },\r\n methods: {\r\n showPreview () {\r\n this.$emit('show-preview')\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style scoped lang=\"less\">\r\n.tm-jav-item {\r\n min-height: 200px;\r\n min-width: 147px;\r\n padding: 8px;\r\n display: inline-block;\r\n overflow: hidden;\r\n position: relative;\r\n\r\n &--cover {\r\n max-height: 200px;\r\n max-height: 300px;\r\n object-fit: cover;\r\n }\r\n\r\n &--inner {\r\n width: 100%;\r\n height: 100%;\r\n position: relative;\r\n }\r\n\r\n &--info {\r\n color: #fff;\r\n text-shadow: 1px 1px 2px black;\r\n transition: all 0.5s;\r\n position: absolute;\r\n z-index: 1;\r\n left: 0;\r\n top: 70%;\r\n height: 30%;\r\n display: block;\r\n background-color: rgba(32, 32, 32, 0.3);\r\n width: 100%;\r\n overflow: hidden;\r\n }\r\n\r\n &--title {\r\n color: #fff;\r\n }\r\n .play-btn {\r\n transition: all 0.5s;\r\n position: absolute;\r\n bottom: 30%;\r\n left: 0px;\r\n width: 1em;\r\n height: 1em;\r\n border-radius: 1em;\r\n font-size: 30px;\r\n cursor: pointer;\r\n z-index: 2;\r\n background-color: rgba(32, 32, 32, 0.3);\r\n\r\n &::before {\r\n content: '';\r\n position: absolute;\r\n left: 0.1em;\r\n top: 0.1em;\r\n width: 0.8em;\r\n height: .8em;\r\n border-radius: 0.8em;\r\n border-width: 2px;\r\n border-style: solid;\r\n border-color: white;\r\n border-image: initial;\r\n box-sizing: border-box;\r\n }\r\n &::after {\r\n border-width: .3em 0 .3em .4em;\r\n top: .2em;\r\n left: .35em;\r\n content: \"\";\r\n position: absolute;\r\n border-style: solid;\r\n border-color: transparent white;\r\n border-image: initial;\r\n }\r\n &:hover{\r\n &::before {\r\n border-color: #ffa04c;\r\n }\r\n &::after {\r\n border-color: transparent #ffa04c;\r\n }\r\n }\r\n }\r\n\r\n &:hover .play-btn {\r\n bottom: 4px;\r\n }\r\n\r\n &:hover & {\r\n box-shadow: rgba(45, 45, 45, 0.05) 0px 2px 2px 0px\r\n rgba(42, 42, 42, 0.05) 0px 8px 8px 0px, \r\n rgba(32, 32, 32, 0.05) 0px 16px 16px 0px,\r\n rgba(49, 49, 49, 0.05) 0px 32px 32px 0px,\r\n rgba(35, 35, 35, 0.05) 0px 64px 64px 0px;\r\n\r\n &--inner {\r\n transform: scale(1.08);\r\n transform-origin: center center;\r\n }\r\n &--cover {\r\n filter: blur(2px);\r\n }\r\n &--info { \r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n height: 100%;\r\n }\r\n }\r\n\r\n}\r\n</style>"]}, media: undefined });
};
/* scoped */
const __vue_scope_id__$1 = "data-v-7f6d78d4";
/* 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
);
/**
* 确保 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)
}
}
}
const LRU = {
keys: [],
cache: {},
max: 10
};
function LRUCache (key, content = null) {
const {keys, cache, max} = LRU;
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]'
}
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, name);
},
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 : 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 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();
resolve(true);
}
requestAnimationFrame(check);
});
};
iframe.onerror = () => {
remove();
reject(false);
};
setTimeout(iframe.onerror, timeout);
iframe.style="width:600px;height:400px;position:fixed;left: -99999990px;top: 0";
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 parseHtml (html) {
const parser = new DOMParser();
const doc = parser.parseFromString(html, "text/html");
return doc
}
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;
}
};
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},
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) {
return runTask(
'解析 AV 相关信息',
['加载 HTML', loadHTML(video.href)],
['解析基本信息', parseAvInfo],
['解析投票信息', parseFavorite],
).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
}
const PREVIEW_CODE = {
NONE: 0,
TEMPLATE: 1,
TEMPLATE_ZERO: 2,
GOOGLE: 3,
GOOGLE_ZERO: 4,
SNAPSHOT: 5,
SNAPSHOT_ZERO: 6,
};
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}`);
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) {
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'],
];
}
return runTask(
'解析预览ID',
...templateStep,
['谷歌搜索', 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 => {
if (d.id && this.dataIdMap[d.id]) {
d = {...this.dataIdMap[d.id], ...d};
}
return d
});
const idb = await getDBInstance();
await idb.table(this.name).put(datas);
for (const data of datas) {
this.dataIdMap[data.id] = 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) {
const {infos, favorite} = 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};
await idb.table(Details.NAME).put(putData);
details = {infos, favorite};
} 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};
}
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) {
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);
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$2 = {
components: {
TmItem: __vue_component__$1
},
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 () {
this.ddos.status = document.title === 'Just a moment...';
if (this.ddos.status) {
this.ddos.currTime = this.ddos.maxTime;
console.log('ddos ... ');
this.ddos.timer = setInterval(() => {
this.ddos.currTime--;
if (!this.ddos.currTime) {
clearInterval(this.ddos.timer);
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 = LRUCache(tab.href);
if (cached) {
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) {
const scroll = this.$refs['scroll-wrapper'];
LRUCache(tab.href, {
list: this.list,
pages: this.pages,
scrollTop: scroll && scroll.scrollTop,
});
},
getContent (href, pageStatus = false) {
this.loading = true;
queryVideoList(href)
.then(({list, pages}) => {
this.list = list;
this.pages = pages;
this.pages.show = pageStatus;
this.fillList();
}).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 s = getVideoPreview(video).then((previewId) => {
if (previewId) {
video.previewId = previewId;
video.loaded.preview = true;
this.$emit('select', video);
video.error = '';
} else {
video.error = '加载失败,请查看日志';
}
}).catch((e) => {
console.log('加载失败:', e);
video.error = '加载失败,请查看日志';
});
const i = getVideoDetail(video).then(({infos, favorite}) => {
video.infos = infos;
video.favorite = favorite;
video.loaded.detail = true;
this.$emit('select', video);
});
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__$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-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__$2 = [
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__$2._withStripped = true;
/* style */
const __vue_inject_styles__$2 = function (inject) {
if (!inject) return
inject("data-v-58142457_0", { source: ".tm-jav-list[data-v-58142457] {\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-58142457] {\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-58142457] {\n display: inline-block;\n}\n.tm-jav-list--switch-hover[data-v-58142457] {\n display: none;\n}\n.tm-jav-list--switch:hover .tm-jav-list--switch-hover[data-v-58142457] {\n display: inline-block;\n cursor: pointer;\n}\n.tm-jav-list--switch:hover .tm-jav-list--switch-default[data-v-58142457] {\n display: none;\n}\n.tm-jav-list--pages[data-v-58142457] {\n position: absolute;\n left: 0;\n top: 0;\n}\n.tm-jav-list--ddos[data-v-58142457] {\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-58142457] {\n padding: 0 4px;\n width: 100%;\n height: 100%;\n overflow: hidden;\n}\n.tm-jav-list--wrapper[data-v-58142457]:hover {\n overflow: auto;\n padding-right: 0;\n}\n.tm-jav-list--scroll[data-v-58142457] {\n display: flex;\n flex-wrap: wrap;\n align-content: flex-start;\n}\n.tm-jav-list--scroll[data-v-58142457]::after {\n content: '';\n flex: 9999999;\n}\n.tm-jav-list--scroll .tm-jav-item[data-v-58142457] {\n flex-grow: 1;\n}\n.tm-jav-list--loading-pages[data-v-58142457] {\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__$2 = "data-v-58142457";
/* 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
);
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
}
//
function g (o, k) {
return o && o[k] || ''
}
var script$3 = {
props: {
video: {
type: Object,
default: null,
largeImage: true
}
},
computed: {
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__$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-preview" }, [
_c("div", { staticClass: "tm-jav-player" }, [
_c(
"video",
{
key: _vm.avid,
ref: "video",
attrs: {
controls: "",
autoplay: "true",
preload: "true",
onloadstart: "this.volume=0.2"
}
},
_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(" "),
_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__$3 = [];
__vue_render__$3._withStripped = true;
/* style */
const __vue_inject_styles__$3 = function (inject) {
if (!inject) return
inject("data-v-2425afc8_0", { source: ".tm-jav-preview[data-v-2425afc8] {\n display: flex;\n flex-direction: column;\n width: 100%;\n padding: 0 10px;\n}\n.tm-jav-preview .tm-jav--close[data-v-2425afc8] {\n position: absolute;\n right: 3px;\n top: 3px;\n z-index: 4;\n font-size: 30px;\n}\n.tm-jav-preview .tm-jav-player[data-v-2425afc8] {\n width: 100%;\n position: relative;\n}\n.tm-jav-preview .tm-jav-player video[data-v-2425afc8] {\n width: 100%;\n}\n.tm-jav-preview .tm-jav-information[data-v-2425afc8] {\n padding: 10px;\n flex: 1;\n display: flex;\n position: relative;\n}\n.tm-jav-preview .tm-jav-information img[data-v-2425afc8] {\n width: 225px;\n margin-right: 10px;\n transition: transform 0.5s;\n transform-origin: bottom left;\n}\n.tm-jav-preview .tm-jav-information img[data-v-2425afc8]:hover {\n position: relative;\n bottom: 0;\n left: 0;\n z-index: 5;\n transform-origin: bottom left;\n transform: scale(3);\n}\n.tm-jav-preview .tm-jav-information .tm-jav-infos[data-v-2425afc8] {\n flex: 1;\n position: relative;\n}\n.tm-jav-preview .tm-jav-information .tm-jav-infos--row[data-v-2425afc8] {\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-2425afc8] {\n color: rgba(0, 0, 0, 0.65);\n}\n", map: {"version":3,"sources":["preview.vue"],"names":[],"mappings":"AAAA;EACE,aAAa;EACb,sBAAsB;EACtB,WAAW;EACX,eAAe;AACjB;AACA;EACE,kBAAkB;EAClB,UAAU;EACV,QAAQ;EACR,UAAU;EACV,eAAe;AACjB;AACA;EACE,WAAW;EACX,kBAAkB;AACpB;AACA;EACE,WAAW;AACb;AACA;EACE,aAAa;EACb,OAAO;EACP,aAAa;EACb,kBAAkB;AACpB;AACA;EACE,YAAY;EACZ,kBAAkB;EAClB,0BAA0B;EAC1B,6BAA6B;AAC/B;AACA;EACE,kBAAkB;EAClB,SAAS;EACT,OAAO;EACP,UAAU;EACV,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 display: flex;\n flex-direction: column;\n width: 100%;\n padding: 0 10px;\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}\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 img {\n width: 225px;\n margin-right: 10px;\n transition: transform 0.5s;\n transform-origin: bottom left;\n}\n.tm-jav-preview .tm-jav-information img:hover {\n position: relative;\n bottom: 0;\n left: 0;\n z-index: 5;\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__$3 = "data-v-2425afc8";
/* 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
);
//
//
//
//
//
//
//
//
//
//
var script$4 = {
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__$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-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__$4 = [];
__vue_render__$4._withStripped = true;
/* style */
const __vue_inject_styles__$4 = function (inject) {
if (!inject) return
inject("data-v-2bfdfb2a_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: 100%;\n min-width: 70px;\n color: #fff;\n background-color: #f282ce;\n padding: 0 4px;\n margin-right: 1px;\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}\n", map: {"version":3,"sources":["tabs.vue","C:\\Users\\Ti\\code\\_tampermonkey\\javlib-preview-userscript\\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,eAAe;AACjB;AACA;EACE,yBAAyB;AAC3B;AACA;EACE,yBAAyB;EACzB,cAAc;AAChB;AACA;EACE,uBAAuB;EACvB,gBAAgB;EAChB,WAAW;EACX,qBAAqB;EACrB,mBAAmB;ACCrB;AACA;EACA,WAAA;EACA,YAAA;EACA,sBAAA;AACA;AACA;EDCE,eAAe;ECCjB,6BAAA;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: 100%;\n min-width: 70px;\n color: #fff;\n background-color: #f282ce;\n padding: 0 4px;\n margin-right: 1px;\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}\n","<template>\r\n <div class=\"tm-jav-tabs\" @mousewheel=\"scroll\">\r\n <div class=\"tm-jav-tabs--item\" :class=\"{curr: currIndex === index}\" v-for=\"(tab, index) in tabs\" :key=\"tab.href\">\r\n <span class=\"tm-jav-tabs--name\" @click=\"$emit('active', index)\">{{tab.name}}</span>\r\n <!-- <span class=\"tm-jav-tabs--window\" @click=\"$emit('float-tab', tab)\"></span> -->\r\n <span class=\"tm-jav--close\" v-if=\"!tab.fixed\" @click=\"$emit('remove', index)\"></span>\r\n </div>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nexport default {\r\n data () {\r\n return {\r\n scrollLeft: 0\r\n }\r\n },\r\n props: {\r\n tabs: {\r\n default () {return []}\r\n },\r\n currIndex: {\r\n default: 0\r\n }\r\n },\r\n methods: {\r\n scroll (e) {\r\n this.scrollLeft += e.deltaY / 10\r\n this.$el.scrollLeft = this.scrollLeft\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style lang=\"less\">\r\n.tm-jav-tabs {\r\n width: 100%;\r\n height: 20px;\r\n background-color: #fff;\r\n overflow-x: auto;\r\n white-space: nowrap;\r\n overflow-y: hidden;\r\n\r\n &::-webkit-scrollbar {\r\n display: none;\r\n }\r\n &--item {\r\n display: inline-block;\r\n align-items: center;\r\n height: 100%;\r\n min-width: 70px;\r\n color: #fff;\r\n background-color: #f282ce;\r\n padding: 0 4px;\r\n margin-right: 1px;\r\n cursor: pointer;\r\n\r\n &:hover {\r\n background-color: darken(#ffc4ec, 10%);\r\n } \r\n &.curr {\r\n background-color: #ffc4ec;\r\n color: #ff60cc;\r\n }\r\n }\r\n\r\n &--name {\r\n text-overflow: ellipsis;\r\n overflow: hidden;\r\n width: 50px;\r\n display: inline-block;\r\n white-space: nowrap;\r\n }\r\n\r\n &--window {\r\n width: 16px;\r\n height: 16px;\r\n background: aquamarine;\r\n }\r\n\r\n .tm-jav--close {\r\n font-size: 14px;\r\n background-color: transparent;\r\n }\r\n}\r\n</style>"]}, media: undefined });
};
/* scoped */
const __vue_scope_id__$4 = undefined;
/* 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 {
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__$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-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__$5 = [];
__vue_render__$5._withStripped = true;
/* style */
const __vue_inject_styles__$5 = function (inject) {
if (!inject) return
inject("data-v-2027e374_0", { source: ".tm-jav-log[data-v-2027e374] {\n width: 100%;\n height: 28px;\n position: fixed;\n bottom: 0;\n background: #fff;\n z-index: 2;\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-2027e374] {\n margin: 10px 90px;\n}\n.tm-jav-log h4[data-v-2027e374] {\n margin-top: 0;\n}\n.tm-jav-log[data-v-2027e374]:hover {\n overflow: auto;\n overflow-x: hidden;\n height: 30vh;\n}\n.tm-jav-log--task[data-v-2027e374] {\n margin-top: 4px;\n}\n.tm-jav-log--row[data-v-2027e374] {\n text-align: left;\n margin: 0 0 4px;\n}\n.tm-jav-log--row > span[data-v-2027e374] {\n margin-right: 4px;\n}\n.tm-jav-log--time[data-v-2027e374] {\n width: 60px;\n text-align: right;\n display: inline-block;\n}\n.tm-jav--status[data-v-2027e374] {\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-2027e374] {\n background-color: #0dba42;\n}\n.tm-jav--status-fail[data-v-2027e374] {\n background-color: #ff6666;\n}\n.tm-jav--status-finished[data-v-2027e374] {\n background-color: #2dceff;\n}\n.tm-jav--status-finished.tm-jav--task-success[data-v-2027e374] {\n background-color: #0dba42;\n}\n.tm-jav--status-finished.tm-jav--task-fail[data-v-2027e374] {\n background-color: #ff6666;\n}\n", map: {"version":3,"sources":["log.vue","C:\\Users\\Ti\\code\\_tampermonkey\\javlib-preview-userscript\\src\\components\\log.vue"],"names":[],"mappings":"AAAA;EACE,WAAW;EACX,YAAY;EACZ,eAAe;EACf,SAAS;EACT,gBAAgB;EAChB,UAAU;EACV,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;EACZ,kBAAkB;ECCpB,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 background: #fff;\n z-index: 2;\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>\r\n <div class=\"tm-jav-log\">\r\n <h4>解析日志</h4>\r\n <div class=\"tm-jav-log--task\" v-for=\"task in logs\">\r\n <h4>{{task.name}}</h4>\r\n <div class=\"tm-jav-log--content\">\r\n <p class=\"tm-jav-log--row\" v-for=\"log in task.logs\">\r\n <span class=\"tm-jav-log--time\">{{log.after}}ms</span>\r\n <span :class=\"['tm-jav--status', 'tm-jav--status-' + log.status, 'tm-jav--task-' + task.status]\">{{log.status}}</span>\r\n <span class=\"tm-jav-log--name\">{{log.name}}</span>\r\n <span class=\"tm-jav-log--msg\">{{log.msg}}</span>\r\n </p>\r\n </div>\r\n <span class=\"tm-jav--loading\" v-if=\"!task.finished\"></span>\r\n </div>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport { logVue } from '@/utils/log' \r\nexport default {\r\n data () {\r\n return {\r\n logs: []\r\n }\r\n },\r\n mounted () {\r\n this.logs = [...logVue.logs]\r\n logVue.$on('log-task', this.pushLog)\r\n },\r\n beforeDestroy () {\r\n logVue.$off('log-task', this.pushLog)\r\n },\r\n methods: {\r\n pushLog (taskLog) {\r\n this.logs.unshift(taskLog)\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style scoped lang=\"less\">\r\n.tm-jav-log {\r\n width: 100%;\r\n height: 28px;\r\n position: fixed;\r\n bottom: 0;\r\n background: #fff;\r\n z-index: 2;\r\n padding: 10px;\r\n box-shadow: 0px -1px 6px 3px rgba(142, 142, 142, 0.71);\r\n transition: height .5s;\r\n overflow: hidden;\r\n\r\n .tm-jav--loading {\r\n margin: 10px 90px;\r\n }\r\n\r\n h4 {\r\n margin-top: 0;\r\n }\r\n &:hover {\r\n overflow: auto;\r\n overflow-x: hidden;\r\n height: 30vh;\r\n }\r\n\r\n &--task {\r\n margin-top: 4px;\r\n }\r\n\r\n &--row {\r\n text-align: left;\r\n margin: 0 0 4px;\r\n & > span {\r\n margin-right: 4px;\r\n }\r\n }\r\n\r\n &--time {\r\n width: 60px;\r\n text-align: right;\r\n display: inline-block;\r\n }\r\n}\r\n.tm-jav--status {\r\n display: inline-block;\r\n padding: 2px;\r\n border-radius: 4px;\r\n color: #fff;\r\n line-height: 1;\r\n text-align: center;\r\n width: 60px;\r\n background-color: #ccc;\r\n \r\n &-success {\r\n background-color: #0dba42;\r\n }\r\n &-fail {\r\n background-color: #ff6666\r\n }\r\n &-finished {\r\n background-color: rgb(45, 206, 255);\r\n &.tm-jav--task-success {\r\n background-color: #0dba42;\r\n }\r\n &.tm-jav--task-fail {\r\n background-color: #ff6666\r\n }\r\n }\r\n}\r\n</style>"]}, media: undefined });
};
/* scoped */
const __vue_scope_id__$5 = "data-v-2027e374";
/* 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 {
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__$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-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__$6 = [];
__vue_render__$6._withStripped = true;
/* style */
const __vue_inject_styles__$6 = function (inject) {
if (!inject) return
inject("data-v-695f4f9a_0", { source: ".tm-jav-genres[data-v-695f4f9a] {\n position: fixed;\n right: 0;\n width: 300px;\n height: 100vh;\n transition: transform 0.5s;\n background-color: #fff;\n z-index: 5;\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-695f4f9a]:hover {\n transform: translateX(0);\n overflow: auto;\n}\n.tm-jav-genres--category[data-v-695f4f9a] {\n border-top: 1px solid #333;\n margin-top: 20px;\n}\n.tm-jav-genres--category-name[data-v-695f4f9a] {\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-695f4f9a] {\n padding: 0 12px;\n display: flex;\n flex-wrap: wrap;\n}\n.tm-jav-genres--item[data-v-695f4f9a] {\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-695f4f9a]:hover {\n background-color: #b1b1b1ab;\n}\n", map: {"version":3,"sources":["genres.vue","C:\\Users\\Ti\\code\\_tampermonkey\\javlib-preview-userscript\\src\\components\\genres.vue"],"names":[],"mappings":"AAAA;EACE,eAAe;EACf,QAAQ;EACR,YAAY;EACZ,aAAa;EACb,0BAA0B;EAC1B,sBAAsB;EACtB,UAAU;EACV,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: 5;\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>\r\n <div class=\"tm-jav-genres\">\r\n <div class=\"tm-jav-genres--category\" v-for=\"category in genres\">\r\n <h3 class=\"tm-jav-genres--category-name\">{{category.type}}</h3>\r\n <div class=\"tm-jav-genres--list\">\r\n <div class=\"tm-jav-genres--item\" v-for=\"genre in category.genres\" @click=\"showGenre(genre)\">\r\n {{genre.name}}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport genresModel from '@/api/genres'\r\nexport default {\r\n data () {\r\n return {\r\n genres: []\r\n }\r\n },\r\n mounted () {\r\n this.init()\r\n },\r\n methods: {\r\n init () {\r\n genresModel.getAll().then((result) => {\r\n this.genres = result\r\n })\r\n },\r\n showGenre ({id, name}) {\r\n this.$root.pushTab({\r\n href: 'vl_genre.php?g=' + id,\r\n name,\r\n })\r\n }\r\n }\r\n}\r\n</script>\r\n\r\n<style scoped lang=\"less\">\r\n.tm-jav-genres {\r\n position: fixed;\r\n right: 0;\r\n width: 300px;\r\n height: 100vh;\r\n transition: transform .5s;\r\n background-color: #fff;\r\n z-index: 5;\r\n box-shadow: -2px 0px 10px 1px #6b6b6b78;\r\n overflow: hidden;\r\n font-size: 14px;\r\n transform: translateX(290px);\r\n &:hover {\r\n transform: translateX(0);\r\n overflow: auto;\r\n }\r\n \r\n &--category {\r\n border-top: 1px solid #333;\r\n margin-top: 20px;\r\n &-name {\r\n background-color: #fff;\r\n display: inline-block;\r\n margin: -10px 12px 0px;\r\n height: 20px;\r\n padding: 0 10px;\r\n overflow: hidden;\r\n }\r\n }\r\n &--list {\r\n padding: 0 12px;\r\n display: flex;\r\n flex-wrap: wrap;\r\n }\r\n &--item {\r\n margin: 0 4px;\r\n padding: 2px;\r\n white-space: nowrap;\r\n cursor: pointer;\r\n border-radius: 2px;\r\n\r\n &:hover {\r\n background-color: #b1b1b1ab;\r\n }\r\n }\r\n}\r\n</style>"]}, media: undefined });
};
/* scoped */
const __vue_scope_id__$6 = "data-v-695f4f9a";
/* 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 = {
name: 'tm-app',
components: {
TmContainer: __vue_component__,
TmPreview: __vue_component__$3,
TmList: __vue_component__$2,
TmTabs: __vue_component__$4,
TmLog: __vue_component__$5,
TmGenres: __vue_component__$6,
},
data () {
return {
currVideo: null,
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},
]
}
},
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) {
this.tabIndex = 0;
}
},
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);
}
}
}
};
/* 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("tm-container", [
_c(
"div",
{ staticClass: "tm-jav" },
[
_c("header", { staticClass: "tm-jav-header" }),
_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")
],
1
)
])
};
var __vue_staticRenderFns__$7 = [];
__vue_render__$7._withStripped = true;
/* style */
const __vue_inject_styles__$7 = function (inject) {
if (!inject) return
inject("data-v-5f32fbe8_0", { source: "\n.tm-jav[data-v-5f32fbe8]\r\n{\r\n font-size: 12px;\r\n background-color: #f5f5f5;\r\n width: 100vw;\r\n height: 100vh;\r\n min-width: 1200px;\r\n overflow-x: auto;\r\n display: flex;\r\n flex-direction: column;\n}\n.tm-jav-header[data-v-5f32fbe8], .tm-jav-footer[data-v-5f32fbe8] {\r\n height: 28px;\n}\n.tm-jav-body[data-v-5f32fbe8] {\r\n flex: 1;\r\n overflow: hidden;\r\n display: flex;\r\n margin: 0 16px;\r\n width: 100%;\n}\n.tm-jav-main-list[data-v-5f32fbe8] {\r\n width: 35vw;\n}\r\n", map: {"version":3,"sources":["C:\\Users\\Ti\\code\\_tampermonkey\\javlib-preview-userscript\\src\\app.vue"],"names":[],"mappings":";AAyFA;;EAEA,eAAA;EACA,yBAAA;EACA,YAAA;EACA,aAAA;EACA,iBAAA;EACA,gBAAA;EACA,aAAA;EACA,sBAAA;AACA;AACA;EACA,YAAA;AACA;AACA;EACA,OAAA;EACA,gBAAA;EACA,aAAA;EACA,cAAA;EACA,WAAA;AACA;AACA;EACA,WAAA;AACA","file":"app.vue","sourcesContent":["<template>\r\n<tm-container>\r\n <div class=\"tm-jav\">\r\n <header class=\"tm-jav-header\"></header>\r\n <div class=\"tm-jav-body\">\r\n <tm-preview style=\"flex: 1\" :video=\"currVideo\" v-show=\"currVideo\" @close=\"currVideo = null\"></tm-preview>\r\n <div class=\"tm-jav-main-list\" :style=\"{width: currVideo ? '35%' : '100%'}\">\r\n <tm-tabs \r\n :currIndex=\"tabIndex\" :tabs=\"tabs\"\r\n @active=\"(index) => tabIndex = index\"\r\n @remove=\"removeTab\"\r\n ></tm-tabs>\r\n <tm-list :tab=\"currTab\" @select=\"(v) => currVideo = v\"></tm-list>\r\n </div>\r\n </div>\r\n <footer class=\"tm-jav-footer\">\r\n <tm-log></tm-log>\r\n </footer>\r\n <tm-genres></tm-genres>\r\n </div>\r\n</tm-container>\r\n</template>\r\n\r\n<script>\r\nimport TmContainer from '@/components/container.vue'\r\nimport TmList from '@/components/list.vue'\r\nimport TmPreview from '@/components/preview.vue'\r\nimport TmTabs from '@/components/tabs.vue'\r\nimport TmLog from '@/components/log.vue'\r\nimport TmGenres from '@/components/genres.vue'\r\nexport default {\r\n name: 'tm-app',\r\n components: {\r\n TmContainer,\r\n TmPreview,\r\n TmList,\r\n TmTabs,\r\n TmLog,\r\n TmGenres,\r\n },\r\n data () {\r\n return {\r\n currVideo: null,\r\n tabIndex: 0,\r\n tabs: [\r\n {name: '最热门', href: '/cn/', next: false, fixed: true},\r\n {name: '新发行', href: 'vl_newrelease.php', fixed: true},\r\n {name: '新加入', href: 'vl_newentries.php', fixed: true},\r\n {name: '最想要', href: 'vl_mostwanted.php', fixed: true},\r\n {name: '高评价', href: 'vl_bestrated.php', fixed: true},\r\n ]\r\n }\r\n },\r\n computed: {\r\n currTab () {\r\n return this.tabs[this.tabIndex] || null\r\n }\r\n },\r\n methods: {\r\n removeTab (index) {\r\n const tab = this.tabs[index]\r\n if (tab.fixed) { return }\r\n\r\n this.tabs.splice(index, 1)\r\n\r\n if (index === this.tabIndex) {\r\n this.tabIndex = 0\r\n }\r\n },\r\n pushTab (tab) {\r\n try {\r\n const {name, href} = tab\r\n const index = this.tabs.findIndex((tab) => tab.href === href)\r\n if (index > -1) {\r\n this.tabIndex = index\r\n } else {\r\n const len = this.tabs.push({name, href})\r\n this.tabIndex = len - 1\r\n }\r\n } catch (e) {\r\n console.error(e)\r\n }\r\n }\r\n }\r\n}\r\n\r\n</script>\r\n\r\n<style scoped>\r\n.tm-jav\r\n{\r\n font-size: 12px;\r\n background-color: #f5f5f5;\r\n width: 100vw;\r\n height: 100vh;\r\n min-width: 1200px;\r\n overflow-x: auto;\r\n display: flex;\r\n flex-direction: column;\r\n}\r\n.tm-jav-header, .tm-jav-footer {\r\n height: 28px;\r\n}\r\n.tm-jav-body {\r\n flex: 1;\r\n overflow: hidden;\r\n display: flex;\r\n margin: 0 16px;\r\n width: 100%;\r\n}\r\n.tm-jav-main-list {\r\n width: 35vw;\r\n}\r\n</style>\r\n"]}, media: undefined });
};
/* scoped */
const __vue_scope_id__$7 = "data-v-5f32fbe8";
/* 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
);
__$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.3;\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__$7);
}(Vue));
//# sourceMappingURL=javlib-preview-userscript.user.js.map