assets

Wenku8++ used assets

This script should not be not be installed directly. It is a library for other scripts to include with the meta directive // @require https://update.greasyfork.org/scripts/449712/1094329/assets.js

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

You will need to install an extension such as Tampermonkey to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

/* eslint-disable no-multi-spaces */
/* eslint-disable userscripts/no-invalid-headers */
/* eslint-disable userscripts/no-invalid-grant */
/* eslint-disable no-implicit-globals */

// ==UserScript==
// @name               assets
// @namespace          Wenku8++
// @version            0.1.4
// @description        Wenku8++ basic assets support
// @author             PY-DNG
// @license            GPL-v3
// @regurl             https?://www\.wenku8\.net/.*
// @protect
// ==/UserScript==

(function() {
	const FLAG = {
		SYSTEM: 1,
		NO_UNINSTALL: 2,
		NO_DISABLE: 4
	};
	const ClassName = {
		Button: 'plus_btn',
		Text: 'plus_text',
		Disabled: 'plus_disabled'
	};
	const URL = {};
	const Color = {
		Text: 'rgb(30, 100, 220)',
		Button: 'rgb(0, 160, 0)',
		ButtonHover: 'color: rgb(0, 100, 0)',
		ButtonFocus: 'color: rgb(0, 100, 0)',
		ButtonDisabled: 'rgba(150, 150, 150)',
	};
	const CSS = {
		Button_Text_Disabled: `.${ClassName.Text} {color: ${Color.Text} !important;} .${ClassName.Button} {color: ${Color.Button} !important; cursor: pointer !important; user-select: none;} .${ClassName.Button}:hover {${Color.ButtonHover} !important;} .${ClassName.Button}:focus {${Color.ButtonFocus} !important;} .${ClassName.Button}.${ClassName.Disabled} {color: ${Color.ButtonDisabled} !important; cursor: not-allowed !important;}`
	};
	const Number = {
		Interval: 500
	};
	const Text = {
		'zh-CN': {}
	};

	// Init language
	let i18n = navigator.language;
	let i18n_default = 'zh-CN';
	if (!Object.keys(Text).includes(i18n)) {i18n = i18n_default;}

	// Common css
	addStyle(CSS.Button_Text_Disabled);

	// Export
	exports = {
		FLAG: FLAG,
		ClassName: ClassName,
		URL: URL,
		Color: Color,
		CSS: CSS,
		Number: Number,
		Text: Text[i18n],
		Text_Full: Text
	}

	// Append a style text to document(<head>) with a <style> element
	function addStyle(css, id) {
		const style = document.createElement("style");
		id && (style.id = id);
		style.textContent = css;
		for (const elm of document.querySelectorAll('#' + id)) {
			elm.parentElement && elm.parentElement.removeChild(elm);
		}
		document.head.appendChild(style);
	}
}) ();