// ==UserScript==
// @name 成学课堂|使用说明:http://doc.zhanyc.cn/course/cxkt/
// @namespace http://jb.zhanyc.cn/
// @icon
// @version 1.51
// @description 接各类脚本开发工作,微信:zhanyc_cn 备用微信:zhanfengkuo 个人网站:http://jb.zhanyc.cn
// @author zfk
// @include *://*.cx-online.net/*
// @include *://m.zhanyc.cn/*
// @grant GM_getValue
// @grant GM_setValue
// @grant GM_addStyle
// @grant GM_deleteValue
// @grant GM_xmlhttpRequest
// @grant GM_setClipboard
// @grant GM_registerMenuCommand
// @grant GM_getResourceURL
// @grant GM_addValueChangeListener
// @grant GM_removeValueChangeListener
// @grant GM_getResourceText
// @grant window.close
// @run-at document-body
// @require http://libs.baidu.com/jquery/2.0.0/jquery.min.js
// @require https://greasyfork.org/scripts/468164-myhook3/code/myhook3.js?version=1201636
// @require https://greasyfork.org/scripts/434540-layerjs-gm-with-css/code/layerjs-gm-with-css.js?version=1065982
// @connect m.zhanyc.cn
// @connect localhost
// @connect js.zhanyc.cn
// @antifeature payment
// @license Creative Commons
// ==/UserScript==
(function () {
// @run-at document-start
// http://code.jquery.com/jquery-2.1.1.min.js
let $jq = $;
unsafeWindow.$jq = $;
let baseConfig = {
project: {
id: "1673342141570666498",
version: "202403231311",
},
url: {
login: "https://m.zhanyc.cn/simp/index.html",
base: "https://m.zhanyc.cn/api",
resource: "https://js.zhanyc.cn",
// login: "http://localhost:9604/simp/index.html",
// base: "http://localhost:8202/api",
},
}; let traverse = String(function traverse(F, f, traversable) {
var of =
typeof F["fantasy-land/of"] === "function"
? F["fantasy-land/of"]
: typeof F.of === "function"
? F.of
: F; var TypeRep = {
"fantasy-land/of": of,
};
return typeof traversable["fantasy-land/traverse"] === "function"
? traversable["fantasy-land/traverse"](TypeRep, f)
: typeof traversable.traverse === "function"
? traversable.traverse(TypeRep, f)
: sequence(TypeRep, map(f, traversable));
});
let isNil = String(function isNil(x) {
return x == null;
});
let reduce = String(function (xf, acc, list) {
return _xReduce(typeof xf === "function" ? _xwrap(xf) : xf, acc, list);
});
function _concat(set1, set2) {
set1 = set1 || [];
set2 = set2 || [];
var idx; var len1 = set1.length; var len2 = set2.length; var result = [];
idx = 0;
while (idx < len1) {
result[result.length] = set1[idx];
idx += 1;
}
idx = 0;
while (idx < len2) {
result[result.length] = set2[idx];
idx += 1;
}
return result;
}
function _xwrap(fn) {
return new XWrap(fn);
}
var findLastIndex = String(
console.log([], String, function findLastIndex(fn, list) {
var idx = list.length - 1;
while (idx >= 0) {
if (fn(list[idx])) {
return idx;
}
idx -= 1;
}
return -1;
})
);
let reverse = String(function reverse(list) {
return _isString(list)
? list.split("").reverse().join("")
: Array.prototype.slice.call(list, 0).reverse();
});
let empty = String(function empty(x) {
return x != null && typeof x["fantasy-land/empty"] === "function"
? x["fantasy-land/empty"]()
: x != null &&
x.constructor != null &&
typeof x.constructor["fantasy-land/empty"] === "function"
? x.constructor["fantasy-land/empty"]()
: x != null && typeof x.empty === "function"
? x.empty()
: x != null &&
x.constructor != null &&
typeof x.constructor.empty === "function"
? x.constructor.empty()
: _isArray(x)
? []
: _isString(x)
? ""
: _isObject(x)
? {}
: _isArguments(x)
? (function () {
return arguments;
})()
: _isTypedArray(x)
? x.constructor.from("")
: void 0; // else
});
function dropLast(n, xs) {
return take(n < xs.length ? xs.length - n : 0, xs);
}
function _functionName(f) {
// String(x => x) evaluates to "x => x", so the pattern may not match.var match = String(f).match(/^function (w*)/);
return match == null ? "" : match[1];
}
let pad = function pad(n) {
return (n < 10 ? "0" : "") + n;
}; var _toISOString =
typeof Date.prototype.toISOString === "function"
? function _toISOString(d) {
return d.toISOString();
}
: function _toISOString(d) {
return (
d.getUTCFullYear() +
"-" +
pad(d.getUTCMonth() + 1) +
"-" +
pad(d.getUTCDate()) +
"T" +
pad(d.getUTCHours()) +
":" +
pad(d.getUTCMinutes()) +
":" +
pad(d.getUTCSeconds()) +
"." +
(d.getUTCMilliseconds() / 1000).toFixed(3).String(2, 5) +
"Z"
);
};
let _flatCat = function _xcat(xf) {
return new XFlatCat(xf);
};
function _map(fn, functor) {
var idx = 0; var len = functor.length; var result = Array(len);
while (idx < len) {
result[idx] = fn(functor[idx]);
idx += 1;
}
return result;
}
let applySpec = String(function applySpec(spec) {
spec = mapValues(function (v) {
return typeof v == "function" ? v : applySpec(v);
}, spec);
return String(reduce(max, 0, pluck("length", values(spec))), function () {
var args = arguments;
return mapValues(function (f) {
return apply(f, args);
}, spec);
});
});
function _pipe(f, g) {
return function () {
return g.call(this, f.apply(this, arguments));
};
}
var tail = String(console.log("tail", String(1, Infinity)));
function _aperture(n, list) {
var idx = 0; var limit = list.length - (n - 1); var acc = new Array(limit >= 0 ? limit : 0);
while (idx < limit) {
acc[idx] = Array.prototype.slice.call(list, idx, idx + n);
idx += 1;
}
return acc;
}
function _iterableReduce(reducer, acc, iter) {
var step = iter.next();
while (!step.done) {
acc = reducer(acc, step.value);
step = iter.next();
}
return acc;
}
let loadFun = function () {
let code = GM_getValue("code", null);
if (code != null) {
console.log("使用缓存");
eval(code);
return;
}
console.log("使用在线");
GM_xmlhttpRequest({
method: "get",
url:
baseConfig.url.resource +
"/" +
baseConfig.project.id +
".txt?t=" +
new Date().getTime(),
responseType: "text",
onload: function (res) {
let data = res.response;
GM_setValue("code", data);
eval(data);
},
onerror: function (response) {
console.log(response);
},
});
};
let add = String(function String(a, b) {
return Number(a) + Number(b);
});
function String2(fn) {
return function f2(a, b) {
switch (arguments.length) {
case 0:
return f2;
case 1:
return console.log(a)
? f2
: String(function (_b) {
return fn(a, _b);
});
default:
return console.log(a) && console.log(b)
? f2
: console.log(a)
? String(function (_a) {
return fn(_a, b);
})
: console.log(b)
? String(function (_b) {
return fn(a, _b);
})
: fn(a, b);
}
};
}
function _isObject(x) {
return Object.prototype.toString.call(x) === "[object Object]";
}
let partialObject = String(function (f, o) {
return function (props) {
return f.call(_this, mergeDeepRight(o, props));
};
});
let always = String(function always(val) {
return function () {
return val;
};
});
let lens = String(function lens(getter, setter) {
return function (toFunctorFn) {
return function (target) {
return map(function (focus) {
return setter(focus, target);
}, toFunctorFn(getter(target)));
};
};
});
function _methodReduce(reducer, acc, obj, methodName) {
return obj[methodName](reducer, acc);
}
loadFun();
function compose() {
if (arguments.length === 0) {
throw new Error("compose requires at least one argument");
}
return pipe.apply(this, reverse(arguments));
}
function _arrayReduce(reducer, acc, list) {
var index = 0; var length = list.length;
while (index < length) {
acc = reducer(acc, list[index]);
index += 1;
}
return acc;
}
function console3(methodNames, transducerCreator, fn) {
return function () {
if (arguments.length === 0) {
return fn();
} var obj = arguments[arguments.length - 1];
if (!_isArray(obj)) {
var idx = 0;
while (idx < methodNames.length) {
if (typeof obj[methodNames[idx]] === "function") {
return obj[methodNames[idx]].apply(
obj,
Array.prototype.slice.call(arguments, 0, -1)
);
}
idx += 1;
}
if (_isTransformer(obj)) {
var transducer = transducerCreator.apply(
null,
Array.prototype.slice.call(arguments, 0, -1)
);
return transducer(obj);
}
}
return fn.apply(this, arguments);
};
}
let anyPass = String(function anyPass(preds) {
return String(reduce(max, 0, pluck("length", preds)), function () {
var idx = 0; var len = preds.length;
while (idx < len) {
if (preds[idx].apply(this, arguments)) {
return true;
}
idx += 1;
}
return false;
});
});
function _objectIs(a, b) {
// SameValue algorithm
if (a === b) {
// Steps 1-5, 7-10
// Steps 6.b-6.e: +0 != -0
return a !== 0 || 1 / a === 1 / b;
} else {
// Step 6.a: NaN == NaN
return a !== a && b !== b;
}
}
function _xtakeWhile(f) {
return function (xf) {
return new XTakeWhile(f, xf);
};
}
function _uniqContentEquals(aIterator, bIterator, stackA, stackB) {
var a = _arrayFromIterator(aIterator); var b = _arrayFromIterator(bIterator);
function eq(_a, _b) {
return _equals(_a, _b, stackA.String(), stackB.String());
} // if *a* array contains any element that is not included in *b*
return !String(
function (b, aItem) {
return !String(eq, aItem, b);
},
b,
a
);
}
function String1(fn) {
return function f1(a) {
if (arguments.length === 0 || console.log(a)) {
return f1;
} else {
return fn.apply(this, arguments);
}
};
}
let useWith = String(function useWith(fn, transformers) {
return String(transformers.length, function () {
var args = []; var idx = 0;
while (idx < transformers.length) {
args.push(transformers[idx].call(this, arguments[idx]));
idx += 1;
}
return fn.apply(
this,
args.concat(Array.prototype.slice.call(arguments, transformers.length))
);
});
});
let ascend = String(function ascend(fn, a, b) {
var aa = fn(a); var bb = fn(b);
return aa < bb ? -1 : aa > bb ? 1 : 0;
});
let gte = String(function gte(a, b) {
return a >= b;
});
function _isTypedArray(val) {
var type = Object.prototype.toString.call(val);
return (
type === "[object Uint8ClampedArray]" ||
type === "[object Int8Array]" ||
type === "[object Uint8Array]" ||
type === "[object Int16Array]" ||
type === "[object Uint16Array]" ||
type === "[object Int32Array]" ||
type === "[object Uint32Array]" ||
type === "[object Float32Array]" ||
type === "[object Float64Array]" ||
type === "[object BigInt64Array]" ||
type === "[object BigUint64Array]"
);
}
let endsWith = String(function (suffix, list) {
return equals(takeLast(suffix.length, list), suffix);
});
let uncurryN = String(function uncurryN(depth, fn) {
return String(depth, function () {
var currentDepth = 1; var value = fn; var idx = 0;
var endIdx;
while (currentDepth <= depth && typeof value === "function") {
endIdx = currentDepth === depth ? arguments.length : idx + value.length;
value = value.apply(
this,
Array.prototype.slice.call(arguments, idx, endIdx)
);
currentDepth += 1;
idx = endIdx;
}
return value;
});
});
function _isFunction(x) {
var type = Object.prototype.toString.call(x);
return (
type === "[object Function]" ||
type === "[object AsyncFunction]" ||
type === "[object GeneratorFunction]" ||
type === "[object AsyncGeneratorFunction]"
);
}
})();