// ==UserScript== // @name uooc/优课/智慧树 查题小组手 // @namespace http://tampermonkey.net/ // @version 0.7 // @description 进入做题界面自动查询答案并且填充内容 // @author shulan // @match *://www.uooc.net.cn/exam/* // @match *://*.zhihuishu.com/* // @match *://*.chaoxing.com/* // @grant unsafeWindow // @grant GM_xmlhttpRequest // @grant window.onload // @grant window.console // @license MIT // @downloadURL none // ==/UserScript== (() => { 'use strict'; var t = { 312: t => { var e = Object.prototype.hasOwnProperty, n = '~'; function o() {} function r(t, e, n) { (this.fn = t), (this.context = e), (this.once = n || !1); } function i(t, e, o, i, a) { if ('function' != typeof o) throw new TypeError('The listener must be a function'); var s = new r(o, i || t, a), u = n ? n + e : e; return ( t._events[u] ? t._events[u].fn ? (t._events[u] = [t._events[u], s]) : t._events[u].push(s) : ((t._events[u] = s), t._eventsCount++), t ); } function a(t, e) { 0 == --t._eventsCount ? (t._events = new o()) : delete t._events[e]; } function s() { (this._events = new o()), (this._eventsCount = 0); } Object.create && ((o.prototype = Object.create(null)), new o().__proto__ || (n = !1)), (s.prototype.eventNames = function () { var t, o, r = []; if (0 === this._eventsCount) return r; for (o in (t = this._events)) e.call(t, o) && r.push(n ? o.slice(1) : o); return Object.getOwnPropertySymbols ? r.concat(Object.getOwnPropertySymbols(t)) : r; }), (s.prototype.listeners = function (t) { var e = n ? n + t : t, o = this._events[e]; if (!o) return []; if (o.fn) return [o.fn]; for (var r = 0, i = o.length, a = new Array(i); r < i; r++) a[r] = o[r].fn; return a; }), (s.prototype.listenerCount = function (t) { var e = n ? n + t : t, o = this._events[e]; return o ? (o.fn ? 1 : o.length) : 0; }), (s.prototype.emit = function (t, e, o, r, i, a) { var s = n ? n + t : t; if (!this._events[s]) return !1; var u, c, p = this._events[s], l = arguments.length; if (p.fn) { switch ((p.once && this.removeListener(t, p.fn, void 0, !0), l)) { case 1: return p.fn.call(p.context), !0; case 2: return p.fn.call(p.context, e), !0; case 3: return p.fn.call(p.context, e, o), !0; case 4: return p.fn.call(p.context, e, o, r), !0; case 5: return p.fn.call(p.context, e, o, r, i), !0; case 6: return p.fn.call(p.context, e, o, r, i, a), !0; } for (c = 1, u = new Array(l - 1); c < l; c++) u[c - 1] = arguments[c]; p.fn.apply(p.context, u); } else { var f, h = p.length; for (c = 0; c < h; c++) switch ((p[c].once && this.removeListener(t, p[c].fn, void 0, !0), l)) { case 1: p[c].fn.call(p[c].context); break; case 2: p[c].fn.call(p[c].context, e); break; case 3: p[c].fn.call(p[c].context, e, o); break; case 4: p[c].fn.call(p[c].context, e, o, r); break; default: if (!u) for (f = 1, u = new Array(l - 1); f < l; f++) u[f - 1] = arguments[f]; p[c].fn.apply(p[c].context, u); } } return !0; }), (s.prototype.on = function (t, e, n) { return i(this, t, e, n, !1); }), (s.prototype.once = function (t, e, n) { return i(this, t, e, n, !0); }), (s.prototype.removeListener = function (t, e, o, r) { var i = n ? n + t : t; if (!this._events[i]) return this; if (!e) return a(this, i), this; var s = this._events[i]; if (s.fn) s.fn !== e || (r && !s.once) || (o && s.context !== o) || a(this, i); else { for (var u = 0, c = [], p = s.length; u < p; u++) (s[u].fn !== e || (r && !s[u].once) || (o && s[u].context !== o)) && c.push(s[u]); c.length ? (this._events[i] = 1 === c.length ? c[0] : c) : a(this, i); } return this; }), (s.prototype.removeAllListeners = function (t) { var e; return t ? ((e = n ? n + t : t), this._events[e] && a(this, e)) : ((this._events = new o()), (this._eventsCount = 0)), this; }), (s.prototype.off = s.prototype.removeListener), (s.prototype.addListener = s.prototype.on), (s.prefixed = n), (s.EventEmitter = s), (t.exports = s); }, 938: (t, e) => { Object.defineProperty(e, '__esModule', { value: !0 }), (e.default = function () { var t = function () {}; (t.toString = function () { return 'function () { [native code] }'; }), ((unsafeWindow || window).Element.prototype.attachShadow = t); }); }, 330: (t, e) => { Object.defineProperty(e, '__esModule', { value: !0 }), (e.default = function () { for (var t = 0, e = Array.from(document.querySelectorAll('.subject_describe > div')); t < e.length; t++) { var n = e[t]; n.__vue__.$el.innerHTML = n.__vue__._data.shadowDom.textContent; } }); }, 6: function (t, e, n) { var o, r = (this && this.__extends) || ((o = function (t, e) { return ( (o = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (t, e) { t.__proto__ = e; }) || function (t, e) { for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); }), o(t, e) ); }), function (t, e) { if ('function' != typeof e && null !== e) throw new TypeError('Class extends value ' + String(e) + ' is not a constructor or null'); function n() { this.constructor = t; } o(t, e), (t.prototype = null === e ? Object.create(e) : ((n.prototype = e.prototype), new n())); }), i = (this && this.__importDefault) || function (t) { return t && t.__esModule ? t : { default: t }; }; Object.defineProperty(e, '__esModule', { value: !0 }), (e.AdapaterManager = e.AdapterManagerEventEmitType = void 0); var a, s = i(n(671)); !(function (t) { t.ADAPTER_CHANGE = 'ADAPTER_CHANGE'; })((a = e.AdapterManagerEventEmitType || (e.AdapterManagerEventEmitType = {}))); var u = (function (t) { function e() { var e = (null !== t && t.apply(this, arguments)) || this; return (e.adapters = []), e; } return ( r(e, t), (e.prototype.register = function (t) { this.test(t) && (this.adapter || (this.adapter = t), this.adapters.push(t)); }), (e.prototype.use = function () { for (var t = [], n = 0; n < arguments.length; n++) t[n] = arguments[n]; this.emit(e.EVENT_EMIT_TYPE.ADAPTER_CHANGE); }), (e.prototype.getAdapters = function () { return this.adapters; }), (e.prototype.getAdapter = function () { return this.adapter; }), (e.prototype.test = function (t) { return !0; }), (e.ERROR = { ADAPTER_NOT_FOUND: (function (t) { function e() { return t.call(this, '[adapter manager]: ADAPTER_NOT_FOUND') || this; } return r(e, t), e; })(Error), }), (e.EVENT_EMIT_TYPE = a), e ); })(s.default); e.AdapaterManager = u; }, 671: (t, e) => { Object.defineProperty(e, '__esModule', { value: !0 }); var n = (function () { function t() { this.events = new Map(); } return ( (t.prototype.on = function (t, e) { this.events.has(t) || this.events.set(t, []), this.events.get(t).push(e); }), (t.prototype.emit = function (t) { for (var e = this, n = [], o = 1; o < arguments.length; o++) n[o - 1] = arguments[o]; if (this.events.has(t)) { var r = this.events.get(t); r.forEach(function (t) { return t.apply(e, n); }); } }), (t.prototype.once = function (t, e) { var n = this, o = function () { for (var t = [], o = 0; o < arguments.length; o++) t[o] = arguments[o]; e.apply(n, t); }; return ( this.on(t, o), function () { n.events.set( t, n.events.get(t).filter(function (t) { return t !== o; }) ); } ); }), t ); })(); e.default = n; }, 794: function (t, e, n) { var o, r = (this && this.__extends) || ((o = function (t, e) { return ( (o = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (t, e) { t.__proto__ = e; }) || function (t, e) { for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); }), o(t, e) ); }), function (t, e) { if ('function' != typeof e && null !== e) throw new TypeError('Class extends value ' + String(e) + ' is not a constructor or null'); function n() { this.constructor = t; } o(t, e), (t.prototype = null === e ? Object.create(e) : ((n.prototype = e.prototype), new n())); }); Object.defineProperty(e, '__esModule', { value: !0 }), (e.QuestionMatchStatus = e.QuestionType = e.QuestionAdapter = e.Question = void 0); var i = n(202), a = (function () { function t(t, e, n) { void 0 === t && (t = ''), void 0 === e && (e = []), void 0 === n && (n = s.Radio), (this.question = t), (this.options = e), (this.type = n); } return ( (t.prototype.set_answer = function (t) { this.answer = t; }), (t.prototype.match_answer = function (t, e) { var n = this; return this.options .map(function (t, o) { return [e(n.type, t.body), o]; }) .filter(function (e) { var n = e[0]; return t.some(function (t) { return n.includes(t) || n === t; }); }) .map(function (t) { return t[0], t[1]; }); }), t ); })(); e.Question = a; var s, u, c = (function (t) { function e() { return (null !== t && t.apply(this, arguments)) || this; } return r(e, t), e; })(i.LifeCycleEvents); (e.QuestionAdapter = c), (function (t) { (t[(t.Radio = 0)] = 'Radio'), (t[(t.Checkbox = 1)] = 'Checkbox'), (t[(t.Judge = 3)] = 'Judge'), (t[(t.InBlank = 2)] = 'InBlank'); })((s = e.QuestionType || (e.QuestionType = {}))), ((u = e.QuestionMatchStatus || (e.QuestionMatchStatus = {}))[(u.NOTFOUND = 0)] = 'NOTFOUND'), (u[(u.NOTMATCH = 1)] = 'NOTMATCH'), (u[(u.MATCHED = 2)] = 'MATCHED'); }, 524: function (t, e) { var n = (this && this.__assign) || function () { return ( (n = Object.assign || function (t) { for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in (e = arguments[n])) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]); return t; }), n.apply(this, arguments) ); }; Object.defineProperty(e, '__esModule', { value: !0 }), (e.Service = void 0); var o = (function () { function t() {} return ( (t.fetch = function (t) { return new Promise(function (e, o) { GM_xmlhttpRequest( n(n({}, t), { onload: function (t) { e(t); }, onerror: function (t) { o(t); }, }) ); }); }), t ); })(); e.Service = o; }, 386: function (t, e, n) { var o = (this && this.__assign) || function () { return ( (o = Object.assign || function (t) { for (var e, n = 1, o = arguments.length; n < o; n++) for (var r in (e = arguments[n])) Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]); return t; }), o.apply(this, arguments) ); }, r = (this && this.__awaiter) || function (t, e, n, o) { return new (n || (n = Promise))(function (r, i) { function a(t) { try { u(o.next(t)); } catch (t) { i(t); } } function s(t) { try { u(o.throw(t)); } catch (t) { i(t); } } function u(t) { var e; t.done ? r(t.value) : ((e = t.value), e instanceof n ? e : new n(function (t) { t(e); })).then(a, s); } u((o = o.apply(t, e || [])).next()); }); }, i = (this && this.__generator) || function (t, e) { var n, o, r, i, a = { label: 0, sent: function () { if (1 & r[0]) throw r[1]; return r[1]; }, trys: [], ops: [], }; return ( (i = { next: s(0), throw: s(1), return: s(2) }), 'function' == typeof Symbol && (i[Symbol.iterator] = function () { return this; }), i ); function s(i) { return function (s) { return (function (i) { if (n) throw new TypeError('Generator is already executing.'); for (; a; ) try { if ( ((n = 1), o && (r = 2 & i[0] ? o.return : i[0] ? o.throw || ((r = o.return) && r.call(o), 0) : o.next) && !(r = r.call(o, i[1])).done) ) return r; switch (((o = 0), r && (i = [2 & i[0], r.value]), i[0])) { case 0: case 1: r = i; break; case 4: return a.label++, { value: i[1], done: !1 }; case 5: a.label++, (o = i[1]), (i = [0]); continue; case 7: (i = a.ops.pop()), a.trys.pop(); continue; default: if (!((r = (r = a.trys).length > 0 && r[r.length - 1]) || (6 !== i[0] && 2 !== i[0]))) { a = 0; continue; } if (3 === i[0] && (!r || (i[1] > r[0] && i[1] < r[3]))) { a.label = i[1]; break; } if (6 === i[0] && a.label < r[1]) { (a.label = r[1]), (r = i); break; } if (r && a.label < r[2]) { (a.label = r[2]), a.ops.push(i); break; } r[2] && a.ops.pop(), a.trys.pop(); continue; } i = e.call(t, a); } catch (t) { (i = [6, t]), (o = 0); } finally { n = r = 0; } if (5 & i[0]) throw i[1]; return { value: i[0] ? i[1] : void 0, done: !0 }; })([i, s]); }; } }; Object.defineProperty(e, '__esModule', { value: !0 }), (e.EventEmitType = e.QuestionIterable = void 0); var a = n(110), s = n(685), u = n(363), c = n(712), p = n(6), l = n(551), f = n(821), h = n(941), d = n(94), y = n(282), v = n(34), _ = n(411), w = (function () { function t(t) { this.quetions = t; } return ( (t.from = function (e) { return new t(e.parse()); }), (t.registerAdapter = function (t) { var e = new t(); e.match() && this.questionAdapter.push(e); }), (t.questionAdapter = []), t ); })(); w.registerAdapter(a.QuestionItemFromMooc), w.registerAdapter(s.QuestionItemFromZHIHUISHU), w.registerAdapter(u.QuestionItemFromChaoxing); var g, b = (function () { function t(t) { var e = this; (this.adapter = t), this.adapter.on(p.AdapaterManager.EVENT_EMIT_TYPE.ADAPTER_CHANGE, function () { e.resetContext(); }), this.resetContext(); } return ( (t.prototype.syncContextWithAdapter = function () { var t = this.adapter.getAdapter(); t.emit('before_match_questions'), Object.assign(this.runningContext, { data: t.parse() }), t.emit('after_match_questions'); }), (t.prototype.next = function (t) { return r(this, void 0, void 0, function () { var e, n, r, a, s; return i(this, function (i) { switch (i.label) { case 0: return ( console.log(o({}, this.runningContext)), (e = this.runningContext), (n = e.data), (r = e.index), (a = e.status), (s = e.running), 'done' === a || 'pause' === a || s ? [2] : ('running' !== a && this.setStatus('running'), (this.runningContext.running = !0), r >= n.length ? [2] : [4, t(n[r], r)]) ); case 1: return ( i.sent(), (r += 1) >= n.length && this.setStatus('done'), Object.assign(this.runningContext, { running: !1, index: r }), this.next(t), [2] ); } }); }); }), (t.prototype.pause = function () { this.setStatus('pause'); }), (t.prototype.resetContext = function () { (this.runningContext = { index: 0, status: 'canplay', data: [], running: !1 }), this.syncContextWithAdapter(); }), (t.prototype.setStatus = function (t) { this.runningContext.status = t; }), t ); })(); (e.QuestionIterable = b), ((g = e.EventEmitType || (e.EventEmitType = {})).USER_SEARCH = 'USERSEARCH'), (g.USER_SEARCH_RESULT = 'USER_SEARCH_RESULT'), (g.AUTO_FIND_PAUSE = 'AUTO_FIND_PAUSE'), (g.AUTO_FIND_PLAY = 'AUTO_FIND_PLAY'), (g.REFIND_QUESTION = 'REFIND_QUETION'), window.addEventListener('load', function () { var t = new c.View(); y.ServiceAdapterManager.getInstance().register(new v.ICodef()), t.register(new l.WindowController()), t.register(new d.ServiceAdapterChange()), t.register(new f.SearchController()), t.register(new _.Message()), t.register(new h.AnswerView()), t.start(), $(document.body).append(t.container); }); }, 202: function (t, e, n) { var o, r = (this && this.__extends) || ((o = function (t, e) { return ( (o = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (t, e) { t.__proto__ = e; }) || function (t, e) { for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); }), o(t, e) ); }), function (t, e) { if ('function' != typeof e && null !== e) throw new TypeError('Class extends value ' + String(e) + ' is not a constructor or null'); function n() { this.constructor = t; } o(t, e), (t.prototype = null === e ? Object.create(e) : ((n.prototype = e.prototype), new n())); }), i = (this && this.__importDefault) || function (t) { return t && t.__esModule ? t : { default: t }; }; Object.defineProperty(e, '__esModule', { value: !0 }), (e.LifeCycleEvents = void 0); var a = (function (t) { function e() { return (null !== t && t.apply(this, arguments)) || this; } return r(e, t), e; })(i(n(671)).default); e.LifeCycleEvents = a; }, 363: function (t, e, n) { var o, r = (this && this.__extends) || ((o = function (t, e) { return ( (o = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (t, e) { t.__proto__ = e; }) || function (t, e) { for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); }), o(t, e) ); }), function (t, e) { if ('function' != typeof e && null !== e) throw new TypeError('Class extends value ' + String(e) + ' is not a constructor or null'); function n() { this.constructor = t; } o(t, e), (t.prototype = null === e ? Object.create(e) : ((n.prototype = e.prototype), new n())); }), i = (this && this.__importDefault) || function (t) { return t && t.__esModule ? t : { default: t }; }; Object.defineProperty(e, '__esModule', { value: !0 }), (e.QuestionOfChaoxing = e.QuestionItemFromChaoxing = void 0); var a = n(794), s = i(n(938)), u = (function (t) { function e() { var e = t.call(this) || this; return ( e.on('before_match_questions', function () { (0, s.default)(); }), e ); } return ( r(e, t), (e.prototype.parse = function () { var t = $('.questionLi') .map(function (t, e) { return { type: a.QuestionType.Radio, question: ((r = null === (n = $(e).find('.mark_name').get(0)) || void 0 === n ? void 0 : n.childNodes), (r && r.length && (null === (o = r[r.length - 1]) || void 0 === o ? void 0 : o.textContent)) || ''), options: $(e) .find('.mark_letter') .map(function (t, e) { var n = $(e).text(), o = n.indexOf('.'), r = n.slice(0, o), i = n.slice(o); return { prefix: r.slice(0), body: i }; }) .toArray(), }; var n, o, r; }) .toArray(); return ( console.log(t), t.map(function (t, e) { return new c(e, { question: t.question, options: t.options, type: t.type }); }) ); }), (e.prototype.match = function () { return /^(.)*:\/\/(.)*\.chaoxing\.com\/mooc2\/work/.test(location.href); }), e ); })(a.QuestionAdapter); e.QuestionItemFromChaoxing = u; var c = (function (t) { function e(e, n) { var o = t.call(this, n.question, n.options, n.type) || this; return (o.position = e), o; } return ( r(e, t), (e.prototype.select = function () { var t, e = this; 'number' == typeof this.position && (null === (t = this.answer) || void 0 === t || t.map(function (t) { $('.queBox .ti-alist:eq('.concat(e.position, ') .ti-a .ti-a-i [type=radio]:eq(').concat(t, ')')).click(); })); }), e ); })(a.Question); e.QuestionOfChaoxing = c; }, 23: function (t, e, n) { var o, r = (this && this.__extends) || ((o = function (t, e) { return ( (o = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (t, e) { t.__proto__ = e; }) || function (t, e) { for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); }), o(t, e) ); }), function (t, e) { if ('function' != typeof e && null !== e) throw new TypeError('Class extends value ' + String(e) + ' is not a constructor or null'); function n() { this.constructor = t; } o(t, e), (t.prototype = null === e ? Object.create(e) : ((n.prototype = e.prototype), new n())); }); Object.defineProperty(e, '__esModule', { value: !0 }), (e.QuestionAdapterManager = void 0); var i = (function (t) { function e() { var e = (null !== t && t.apply(this, arguments)) || this; return (e.index = 0), e; } return ( r(e, t), (e.prototype.use = function () { (this.adapter = this.adapters[this.index]), t.prototype.use.call(this); }), (e.prototype.test = function (t) { return t.match(); }), e ); })(n(6).AdapaterManager); e.QuestionAdapterManager = i; }, 110: function (t, e, n) { var o, r = (this && this.__extends) || ((o = function (t, e) { return ( (o = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (t, e) { t.__proto__ = e; }) || function (t, e) { for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); }), o(t, e) ); }), function (t, e) { if ('function' != typeof e && null !== e) throw new TypeError('Class extends value ' + String(e) + ' is not a constructor or null'); function n() { this.constructor = t; } o(t, e), (t.prototype = null === e ? Object.create(e) : ((n.prototype = e.prototype), new n())); }), i = (this && this.__importDefault) || function (t) { return t && t.__esModule ? t : { default: t }; }; Object.defineProperty(e, '__esModule', { value: !0 }), (e.QuestionOfMooc = e.QuestionItemFromMooc = void 0); var a = n(794), s = i(n(938)), u = (function (t) { function e() { var e = t.call(this) || this; return ( e.on('before_match_questions', function () { (0, s.default)(); }), e ); } return ( r(e, t), (e.prototype.parse = function () { return $('.queBox') .map(function (t, e) { return { type: a.QuestionType.Radio, question: $(e).find('.ti-q-c').text(), options: $(e) .find('.ti-alist .ti-a') .map(function (t, e) { var n = $(e), o = n.find('.ti-a-i').text().trim(), r = n.find('.ti-a-c').text().trim(); return { prefix: o.slice(0, o.indexOf('.')), body: r }; }) .toArray(), }; }) .toArray() .map(function (t, e) { return new c(e, { question: t.question, options: t.options, type: t.type }); }); }), (e.prototype.match = function () { return /^(.)*:\/\/(.)*\.uooc\.net\.cn\/exam/.test(location.href); }), e ); })(a.QuestionAdapter); e.QuestionItemFromMooc = u; var c = (function (t) { function e(e, n) { var o = t.call(this, n.question, n.options, n.type) || this; return (o.position = e), o; } return ( r(e, t), (e.prototype.select = function () { var t, e = this; 'number' == typeof this.position && (null === (t = this.answer) || void 0 === t || t.map(function (t) { $('.queBox .ti-alist:eq('.concat(e.position, ') .ti-a .ti-a-i [type=radio]:eq(').concat(t, ')')).click(); })); }), e ); })(a.Question); e.QuestionOfMooc = c; }, 685: function (t, e, n) { var o, r = (this && this.__extends) || ((o = function (t, e) { return ( (o = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (t, e) { t.__proto__ = e; }) || function (t, e) { for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); }), o(t, e) ); }), function (t, e) { if ('function' != typeof e && null !== e) throw new TypeError('Class extends value ' + String(e) + ' is not a constructor or null'); function n() { this.constructor = t; } o(t, e), (t.prototype = null === e ? Object.create(e) : ((n.prototype = e.prototype), new n())); }), i = (this && this.__awaiter) || function (t, e, n, o) { return new (n || (n = Promise))(function (r, i) { function a(t) { try { u(o.next(t)); } catch (t) { i(t); } } function s(t) { try { u(o.throw(t)); } catch (t) { i(t); } } function u(t) { var e; t.done ? r(t.value) : ((e = t.value), e instanceof n ? e : new n(function (t) { t(e); })).then(a, s); } u((o = o.apply(t, e || [])).next()); }); }, a = (this && this.__generator) || function (t, e) { var n, o, r, i, a = { label: 0, sent: function () { if (1 & r[0]) throw r[1]; return r[1]; }, trys: [], ops: [], }; return ( (i = { next: s(0), throw: s(1), return: s(2) }), 'function' == typeof Symbol && (i[Symbol.iterator] = function () { return this; }), i ); function s(i) { return function (s) { return (function (i) { if (n) throw new TypeError('Generator is already executing.'); for (; a; ) try { if ( ((n = 1), o && (r = 2 & i[0] ? o.return : i[0] ? o.throw || ((r = o.return) && r.call(o), 0) : o.next) && !(r = r.call(o, i[1])).done) ) return r; switch (((o = 0), r && (i = [2 & i[0], r.value]), i[0])) { case 0: case 1: r = i; break; case 4: return a.label++, { value: i[1], done: !1 }; case 5: a.label++, (o = i[1]), (i = [0]); continue; case 7: (i = a.ops.pop()), a.trys.pop(); continue; default: if (!((r = (r = a.trys).length > 0 && r[r.length - 1]) || (6 !== i[0] && 2 !== i[0]))) { a = 0; continue; } if (3 === i[0] && (!r || (i[1] > r[0] && i[1] < r[3]))) { a.label = i[1]; break; } if (6 === i[0] && a.label < r[1]) { (a.label = r[1]), (r = i); break; } if (r && a.label < r[2]) { (a.label = r[2]), a.ops.push(i); break; } r[2] && a.ops.pop(), a.trys.pop(); continue; } i = e.call(t, a); } catch (t) { (i = [6, t]), (o = 0); } finally { n = r = 0; } if (5 & i[0]) throw i[1]; return { value: i[0] ? i[1] : void 0, done: !0 }; })([i, s]); }; } }, s = (this && this.__importDefault) || function (t) { return t && t.__esModule ? t : { default: t }; }; Object.defineProperty(e, '__esModule', { value: !0 }), (e.QuestionItemFromZHIHUISHU = e.QuestionOfZHIHUISHU = void 0); var u = n(794), c = s(n(99)), p = s(n(330)), l = [ [u.QuestionType.Radio, /单选题/], [u.QuestionType.Checkbox, /多选题/], ], f = (function (t) { function e(e, n) { var o = t.call(this, n.question, n.options, n.type) || this; return (o.position = e), o; } return ( r(e, t), (e.prototype.select = function () { var t; return i(this, void 0, void 0, function () { var e, n, o, r, i, s, p, l; return a(this, function (a) { switch (a.label) { case 0: if ('number' != typeof this.position) return [2]; switch (((e = this.answer || []), this.type)) { case u.QuestionType.Checkbox: return [3, 1]; case u.QuestionType.Radio: return [3, 6]; } return [3, 6]; case 1: for (o in ((n = []), this.options)) n.push(o); (r = 0), (a.label = 2); case 2: return r < n.length ? ((l = n[r]), (i = $( '.examPaper_subject:eq(' .concat(this.position, ') .subject_node .nodeLab input[type]:eq(') .concat(l, ')') )), (null === (t = i.get(0)) || void 0 === t ? void 0 : t.checked) ? (i.click(), [4, (0, c.default)(1e3)]) : [3, 4]) : [3, 5]; case 3: a.sent(), (a.label = 4); case 4: return r++, [3, 2]; case 5: return [3, 6]; case 6: (s = 0), (p = e), (a.label = 7); case 7: return s < p.length ? ((l = p[s]), $( '.examPaper_subject:eq(' .concat(this.position, ') .subject_node .nodeLab input[type]:eq(') .concat(l, ')') ).click(), [4, (0, c.default)(1e3)]) : [3, 10]; case 8: a.sent(), (a.label = 9); case 9: return s++, [3, 7]; case 10: return [2]; } }); }); }), e ); })(u.Question); e.QuestionOfZHIHUISHU = f; var h = (function (t) { function e() { var e = t.call(this) || this; return ( e.on('before_match_questions', function () { (0, p.default)(); }), e ); } return ( r(e, t), (e.prototype.parse = function () { return $('.examPaper_subject') .map(function (t, e) { var n = $(e).find('.subject_type').text(); return { type: l.reduce(function (t, e) { return e[1].test(n) ? e[0] : t; }, u.QuestionType.Radio), question: $(e).find('.subject_stem .subject_describe').text(), options: $(e) .find('.subject_node .nodeLab') .map(function (t, e) { var n = $(e), o = n.find('.ABCase').text().trim(), r = n.find('.node_detail').text().trim(); return { prefix: o.slice(0, o.indexOf('.')), body: r }; }) .toArray(), }; }) .toArray() .map(function (t, e) { return new f(e, { question: t.question, options: t.options, type: t.type }); }); }), (e.prototype.match = function () { return /^(.)*:\/\/onlineexamh5new\.zhihuishu\.com\/stuExamWeb\.html.*/.test(location.href); }), e ); })(u.QuestionAdapter); e.QuestionItemFromZHIHUISHU = h; }, 34: function (t, e, n) { var o, r = (this && this.__extends) || ((o = function (t, e) { return ( (o = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (t, e) { t.__proto__ = e; }) || function (t, e) { for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); }), o(t, e) ); }), function (t, e) { if ('function' != typeof e && null !== e) throw new TypeError('Class extends value ' + String(e) + ' is not a constructor or null'); function n() { this.constructor = t; } o(t, e), (t.prototype = null === e ? Object.create(e) : ((n.prototype = e.prototype), new n())); }), i = (this && this.__awaiter) || function (t, e, n, o) { return new (n || (n = Promise))(function (r, i) { function a(t) { try { u(o.next(t)); } catch (t) { i(t); } } function s(t) { try { u(o.throw(t)); } catch (t) { i(t); } } function u(t) { var e; t.done ? r(t.value) : ((e = t.value), e instanceof n ? e : new n(function (t) { t(e); })).then(a, s); } u((o = o.apply(t, e || [])).next()); }); }, a = (this && this.__generator) || function (t, e) { var n, o, r, i, a = { label: 0, sent: function () { if (1 & r[0]) throw r[1]; return r[1]; }, trys: [], ops: [], }; return ( (i = { next: s(0), throw: s(1), return: s(2) }), 'function' == typeof Symbol && (i[Symbol.iterator] = function () { return this; }), i ); function s(i) { return function (s) { return (function (i) { if (n) throw new TypeError('Generator is already executing.'); for (; a; ) try { if ( ((n = 1), o && (r = 2 & i[0] ? o.return : i[0] ? o.throw || ((r = o.return) && r.call(o), 0) : o.next) && !(r = r.call(o, i[1])).done) ) return r; switch (((o = 0), r && (i = [2 & i[0], r.value]), i[0])) { case 0: case 1: r = i; break; case 4: return a.label++, { value: i[1], done: !1 }; case 5: a.label++, (o = i[1]), (i = [0]); continue; case 7: (i = a.ops.pop()), a.trys.pop(); continue; default: if (!((r = (r = a.trys).length > 0 && r[r.length - 1]) || (6 !== i[0] && 2 !== i[0]))) { a = 0; continue; } if (3 === i[0] && (!r || (i[1] > r[0] && i[1] < r[3]))) { a.label = i[1]; break; } if (6 === i[0] && a.label < r[1]) { (a.label = r[1]), (r = i); break; } if (r && a.label < r[2]) { (a.label = r[2]), a.ops.push(i); break; } r[2] && a.ops.pop(), a.trys.pop(); continue; } i = e.call(t, a); } catch (t) { (i = [6, t]), (o = 0); } finally { n = r = 0; } if (5 & i[0]) throw i[1]; return { value: i[0] ? i[1] : void 0, done: !0 }; })([i, s]); }; } }; Object.defineProperty(e, '__esModule', { value: !0 }), (e.ICodef = void 0); var s = n(794), u = n(524), c = (function (t) { function e() { var e = (null !== t && t.apply(this, arguments)) || this; return (e.name = 'icodef'), e; } return ( r(e, t), (e.prototype.fetch = function (t) { var e = this; return new Promise(function (n) { return i(e, void 0, void 0, function () { var e, o; return a(this, function (r) { switch (r.label) { case 0: return [ 4, u.Service.fetch({ method: 'POST', url: 'http://cx.icodef.com/wyn-nb', headers: { 'Content-Type': 'application/x-www-form-urlencoded', Authorization: '' }, data: 'question='.concat(encodeURIComponent(t.question), '&type=').concat(t.type), }), ]; case 1: return (e = r.sent()), (o = JSON.parse(e.responseText)), n(o), [2]; } }); }); }); }), (e.prototype.format_answer = function (t, e) { var n = []; switch (t) { case s.QuestionType.Checkbox: var o = e.split('#'); n.push.apply( n, o.map(function (t) { return t.trim(); }) ); break; case s.QuestionType.Radio: n.push(e.trim()); } return { answers: n }; }), (e.prototype.format_option = function (t, e) { return e .trim() .replace(/,/g, ',') .replace(/。/g, '.') .replace(/(/g, '(') .replace(/)/g, ')') .replace(/(“|”)/g, '"'); }), e ); })(u.Service); e.ICodef = c; }, 282: function (t, e, n) { var o, r = (this && this.__extends) || ((o = function (t, e) { return ( (o = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (t, e) { t.__proto__ = e; }) || function (t, e) { for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); }), o(t, e) ); }), function (t, e) { if ('function' != typeof e && null !== e) throw new TypeError('Class extends value ' + String(e) + ' is not a constructor or null'); function n() { this.constructor = t; } o(t, e), (t.prototype = null === e ? Object.create(e) : ((n.prototype = e.prototype), new n())); }); Object.defineProperty(e, '__esModule', { value: !0 }), (e.ServiceAdapterManager = void 0); var i = n(6), a = (function (t) { function e() { return (null !== t && t.apply(this, arguments)) || this; } return ( r(e, t), (e.prototype.use = function (t) { if (!this.adapters.length) throw new i.AdapaterManager.ERROR.ADAPTER_NOT_FOUND(); this.adapter = this.adapters[t]; }), (e.getInstance = function () { return this.__SIMPLE__ ? this.__SIMPLE__ : (this.__SIMPLE__ = new e()); }), e ); })(i.AdapaterManager); e.ServiceAdapterManager = a; }, 99: (t, e) => { Object.defineProperty(e, '__esModule', { value: !0 }), (e.default = function (t) { return new Promise(function (e) { return setTimeout(function () { return e(void 0); }, t); }); }); }, 941: function (t, e, n) { var o, r, i = (this && this.__extends) || ((o = function (t, e) { return ( (o = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (t, e) { t.__proto__ = e; }) || function (t, e) { for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); }), o(t, e) ); }), function (t, e) { if ('function' != typeof e && null !== e) throw new TypeError('Class extends value ' + String(e) + ' is not a constructor or null'); function n() { this.constructor = t; } o(t, e), (t.prototype = null === e ? Object.create(e) : ((n.prototype = e.prototype), new n())); }), a = (this && this.__awaiter) || function (t, e, n, o) { return new (n || (n = Promise))(function (r, i) { function a(t) { try { u(o.next(t)); } catch (t) { i(t); } } function s(t) { try { u(o.throw(t)); } catch (t) { i(t); } } function u(t) { var e; t.done ? r(t.value) : ((e = t.value), e instanceof n ? e : new n(function (t) { t(e); })).then(a, s); } u((o = o.apply(t, e || [])).next()); }); }, s = (this && this.__generator) || function (t, e) { var n, o, r, i, a = { label: 0, sent: function () { if (1 & r[0]) throw r[1]; return r[1]; }, trys: [], ops: [], }; return ( (i = { next: s(0), throw: s(1), return: s(2) }), 'function' == typeof Symbol && (i[Symbol.iterator] = function () { return this; }), i ); function s(i) { return function (s) { return (function (i) { if (n) throw new TypeError('Generator is already executing.'); for (; a; ) try { if ( ((n = 1), o && (r = 2 & i[0] ? o.return : i[0] ? o.throw || ((r = o.return) && r.call(o), 0) : o.next) && !(r = r.call(o, i[1])).done) ) return r; switch (((o = 0), r && (i = [2 & i[0], r.value]), i[0])) { case 0: case 1: r = i; break; case 4: return a.label++, { value: i[1], done: !1 }; case 5: a.label++, (o = i[1]), (i = [0]); continue; case 7: (i = a.ops.pop()), a.trys.pop(); continue; default: if (!((r = (r = a.trys).length > 0 && r[r.length - 1]) || (6 !== i[0] && 2 !== i[0]))) { a = 0; continue; } if (3 === i[0] && (!r || (i[1] > r[0] && i[1] < r[3]))) { a.label = i[1]; break; } if (6 === i[0] && a.label < r[1]) { (a.label = r[1]), (r = i); break; } if (r && a.label < r[2]) { (a.label = r[2]), a.ops.push(i); break; } r[2] && a.ops.pop(), a.trys.pop(); continue; } i = e.call(t, a); } catch (t) { (i = [6, t]), (o = 0); } finally { n = r = 0; } if (5 & i[0]) throw i[1]; return { value: i[0] ? i[1] : void 0, done: !0 }; })([i, s]); }; } }, u = (this && this.__importDefault) || function (t) { return t && t.__esModule ? t : { default: t }; }; Object.defineProperty(e, '__esModule', { value: !0 }), (e.AnswerView = e.ANSWER_EVENT_TYPE = void 0); var c, p = n(386), l = n(794), f = n(23), h = n(363), d = n(110), y = n(685), v = u(n(99)), _ = n(712), w = n(282), g = (((r = {})[l.QuestionMatchStatus.NOTFOUND] = 'rgba(255, 0, 0, 0.3)'), (r[l.QuestionMatchStatus.NOTMATCH] = 'rgba(0, 255, 0, 0.3)'), (r[l.QuestionMatchStatus.MATCHED] = 'rgba(0, 0, 255, 0.3)'), r); !(function (t) { t.FOLD = 'FOLD'; })((c = e.ANSWER_EVENT_TYPE || (e.ANSWER_EVENT_TYPE = {}))); var b = (function (t) { function e() { var e = (null !== t && t.apply(this, arguments)) || this; return (e.name = 'answer-view'), e; } return ( i(e, t), (e.prototype.apply = function (t) { var e = (this.container = this.createElement()); (this.view = t), this.register(e, t), t.common.append(e), this.autoFind(); }), (e.prototype.createElement = function () { return $( '\n
\n
\n 未完全匹配答案
\n 未找到答案
\n 匹配到答案
\n
\n
\n \n \n \n
\n \n \n \n \n \n \n
序号问题答案
\n
\n
\n
\n
\n ' ) ); }), (e.prototype.register = function (t, n) { var o = this; this.container.find('.pause').on('click', function () { n.emit(p.EventEmitType.AUTO_FIND_PAUSE); }), this.container.find('.play').on('click', function () { n.emit(p.EventEmitType.AUTO_FIND_PLAY); }), this.container.find('.reset').on('click', function () { o.resetQuestions(), n.emit(p.EventEmitType.REFIND_QUESTION); }), n.on(e.event.FOLD, function () { o.container.toggle(); }); }), (e.prototype.autoFind = function () { var t = this, e = this.view, n = new f.QuestionAdapterManager(); n.register(new d.QuestionItemFromMooc()), n.register(new h.QuestionItemFromChaoxing()), n.register(new y.QuestionItemFromZHIHUISHU()); var o = new p.QuestionIterable(n); function r(e, n) { return a(this, void 0, void 0, function () { var o, r, i, a, u; return s(this, function (s) { switch (s.label) { case 0: (r = w.ServiceAdapterManager.getInstance().getAdapter()), (s.label = 1); case 1: return ( s.trys.push([1, , 4, 6]), console.group(''.concat(Number(n) + 1, ': ').concat(e.question)), [4, r.fetch({ question: e.question, type: e.type, options: e.options })] ); case 2: return ( (i = s.sent()), console.log(i.data), (o = l.QuestionMatchStatus.NOTFOUND), 1 !== i.code ? (0 === i.code ? console.log('发生错误') : -1 === i.code && console.log('未找到答案'), [2]) : ((a = r.format_answer(e.type, i.data)), console.log(a.answers), (e.rawAnswer = a.answers), (u = e.match_answer(a.answers, r.format_option)), console.log(u), (o = l.QuestionMatchStatus.NOTMATCH), u.length ? ((o = l.QuestionMatchStatus.MATCHED), e.set_answer(u), [4, e.select()]) : (console.log('没匹配到答案'), [2])) ); case 3: return s.sent(), [3, 6]; case 4: return console.groupEnd(), t.appendQuestion(e, o), [4, (0, v.default)(3e3)]; case 5: return s.sent(), [7]; case 6: return [2]; } }); }); } o.next(r), e.on(p.EventEmitType.AUTO_FIND_PAUSE, function () { o.pause(); }), e.on(p.EventEmitType.AUTO_FIND_PLAY, function () { o.setStatus('canplay'), o.next(r); }), e.on(p.EventEmitType.REFIND_QUESTION, function () { t.resetQuestions(), o.resetContext(), o.next(r); }); }), (e.prototype.appendQuestion = function (t, e) { var n = t.position, o = t.question, r = t.rawAnswer; this.container.find('.listarea').append( $( '\n \n ') .concat(n + 1, '\n ') .concat(o, '\n ') .concat( (null == r ? void 0 : r.length) ? r.join('

') : '未找到答案', '\n \n ' ) ) ), this.container.find('.list-body').scrollTop(Number.MAX_SAFE_INTEGER); }), (e.prototype.resetQuestions = function () { this.container.find('.listarea').html(''); }), (e.event = c), e ); })(_.ViewPlugin); e.AnswerView = b; }, 411: function (t, e, n) { var o, r = (this && this.__extends) || ((o = function (t, e) { return ( (o = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (t, e) { t.__proto__ = e; }) || function (t, e) { for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); }), o(t, e) ); }), function (t, e) { if ('function' != typeof e && null !== e) throw new TypeError('Class extends value ' + String(e) + ' is not a constructor or null'); function n() { this.constructor = t; } o(t, e), (t.prototype = null === e ? Object.create(e) : ((n.prototype = e.prototype), new n())); }); Object.defineProperty(e, '__esModule', { value: !0 }), (e.Message = void 0); var i, a = n(712); !(function (t) { t.MESSAGE = 'MESSAGE'; })(i || (i = {})); var s = (function (t) { function e() { var e = (null !== t && t.apply(this, arguments)) || this; return (e.name = 'message-view'), e; } return ( r(e, t), (e.prototype.apply = function (t) { var e = (this.container = this.createElement()); this.register(e, t), t.common.append(e); }), (e.prototype.createElement = function () { return $('\n
结果:
\n '); }), (e.prototype.register = function (t, e) { e.on(i.MESSAGE, function (e) { t.find('.message-view').text(e); }); }), (e.show = function (t, e) { t.emit(i.MESSAGE, e); }), e ); })(a.ViewPlugin); e.Message = s; }, 821: function (t, e, n) { var o, r = (this && this.__extends) || ((o = function (t, e) { return ( (o = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (t, e) { t.__proto__ = e; }) || function (t, e) { for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); }), o(t, e) ); }), function (t, e) { if ('function' != typeof e && null !== e) throw new TypeError('Class extends value ' + String(e) + ' is not a constructor or null'); function n() { this.constructor = t; } o(t, e), (t.prototype = null === e ? Object.create(e) : ((n.prototype = e.prototype), new n())); }), i = (this && this.__awaiter) || function (t, e, n, o) { return new (n || (n = Promise))(function (r, i) { function a(t) { try { u(o.next(t)); } catch (t) { i(t); } } function s(t) { try { u(o.throw(t)); } catch (t) { i(t); } } function u(t) { var e; t.done ? r(t.value) : ((e = t.value), e instanceof n ? e : new n(function (t) { t(e); })).then(a, s); } u((o = o.apply(t, e || [])).next()); }); }, a = (this && this.__generator) || function (t, e) { var n, o, r, i, a = { label: 0, sent: function () { if (1 & r[0]) throw r[1]; return r[1]; }, trys: [], ops: [], }; return ( (i = { next: s(0), throw: s(1), return: s(2) }), 'function' == typeof Symbol && (i[Symbol.iterator] = function () { return this; }), i ); function s(i) { return function (s) { return (function (i) { if (n) throw new TypeError('Generator is already executing.'); for (; a; ) try { if ( ((n = 1), o && (r = 2 & i[0] ? o.return : i[0] ? o.throw || ((r = o.return) && r.call(o), 0) : o.next) && !(r = r.call(o, i[1])).done) ) return r; switch (((o = 0), r && (i = [2 & i[0], r.value]), i[0])) { case 0: case 1: r = i; break; case 4: return a.label++, { value: i[1], done: !1 }; case 5: a.label++, (o = i[1]), (i = [0]); continue; case 7: (i = a.ops.pop()), a.trys.pop(); continue; default: if (!((r = (r = a.trys).length > 0 && r[r.length - 1]) || (6 !== i[0] && 2 !== i[0]))) { a = 0; continue; } if (3 === i[0] && (!r || (i[1] > r[0] && i[1] < r[3]))) { a.label = i[1]; break; } if (6 === i[0] && a.label < r[1]) { (a.label = r[1]), (r = i); break; } if (r && a.label < r[2]) { (a.label = r[2]), a.ops.push(i); break; } r[2] && a.ops.pop(), a.trys.pop(); continue; } i = e.call(t, a); } catch (t) { (i = [6, t]), (o = 0); } finally { n = r = 0; } if (5 & i[0]) throw i[1]; return { value: i[0] ? i[1] : void 0, done: !0 }; })([i, s]); }; } }; Object.defineProperty(e, '__esModule', { value: !0 }), (e.SearchController = void 0); var s = n(712), u = n(282), c = n(794), p = n(411), l = (function (t) { function e() { var e = (null !== t && t.apply(this, arguments)) || this; return (e.name = 'search-controller'), e; } return ( r(e, t), (e.prototype.apply = function (t) { var e = this.createElement(); this.register(e, t), t.common.append(e); }), (e.prototype.createElement = function () { return $( '\n
\n \n \n
\n ' ); }), (e.prototype.register = function (t, e) { var n = this, o = t.find('.search-input'); t.find('.search-btn').on('click', function () { return i(n, void 0, void 0, function () { var t, n, r, i; return a(this, function (a) { switch (a.label) { case 0: return (t = o.val()) ? [ 4, (n = u.ServiceAdapterManager.getInstance().getAdapter()).fetch({ question: t, type: c.QuestionType.Radio, options: [], }), ] : (p.Message.show(e, '请输入内容'), [2]); case 1: return 1 !== (r = a.sent()).code ? (0 === r.code ? p.Message.show(e, '发生错误') : -1 === r.code && p.Message.show(e, '未找到答案'), [2]) : ((i = n.format_answer(c.QuestionType.Checkbox, r.data).answers), p.Message.show(e, i.join('\n')), [2]); } }); }); }); }), e ); })(s.ViewPlugin); e.SearchController = l; }, 94: function (t, e, n) { var o, r = (this && this.__extends) || ((o = function (t, e) { return ( (o = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (t, e) { t.__proto__ = e; }) || function (t, e) { for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); }), o(t, e) ); }), function (t, e) { if ('function' != typeof e && null !== e) throw new TypeError('Class extends value ' + String(e) + ' is not a constructor or null'); function n() { this.constructor = t; } o(t, e), (t.prototype = null === e ? Object.create(e) : ((n.prototype = e.prototype), new n())); }); Object.defineProperty(e, '__esModule', { value: !0 }), (e.ServiceAdapterChange = void 0); var i = n(712), a = n(282), s = (function (t) { function e() { var e = (null !== t && t.apply(this, arguments)) || this; return (e.name = 'service-adapter-change'), e; } return ( r(e, t), (e.prototype.apply = function (t) { var e = this.createElement(); this.register(e, t), t.common.append(e); }), (e.prototype.createElement = function () { var t = a.ServiceAdapterManager.getInstance() .getAdapters() .map(function (t) { return t.name; }); return $( '\n
\n \n
\n ' ) ); }), (e.prototype.register = function (t, e) { t.find('.service-adapter-select').on('input', function () { var e = Number(t.find('.service-adapter-select').val()); a.ServiceAdapterManager.getInstance().use(e); }); }), e ); })(i.ViewPlugin); e.ServiceAdapterChange = s; }, 551: function (t, e, n) { var o, r = (this && this.__extends) || ((o = function (t, e) { return ( (o = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (t, e) { t.__proto__ = e; }) || function (t, e) { for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); }), o(t, e) ); }), function (t, e) { if ('function' != typeof e && null !== e) throw new TypeError('Class extends value ' + String(e) + ' is not a constructor or null'); function n() { this.constructor = t; } o(t, e), (t.prototype = null === e ? Object.create(e) : ((n.prototype = e.prototype), new n())); }); Object.defineProperty(e, '__esModule', { value: !0 }), (e.WindowController = void 0); var i = n(712), a = n(941), s = (function (t) { function e() { var e = (null !== t && t.apply(this, arguments)) || this; return (e.name = 'window-controller'), e; } return ( r(e, t), (e.prototype.apply = function (t) { var e = this.createElement(); this.register(e, t), t.controller.append(e), console.log(t, e, 'window - controller register'); }), (e.prototype.createElement = function () { return $( '\n
\n
折叠答案区域
\n
-
\n
x
\n
\n ' ); }), (e.prototype.register = function (t, e) { var n = $( '
' ), o = e.container; $(document.body).append(n), n.hide(), n.on('click', function () { o.show(); }), t.find('.windowClose').on('click', function () { o.hide(); }), t.find('.windowToMin').on('click', function () { o.hide(), n.show(); }), t.find('.fold').on('click', function () { e.emit(a.AnswerView.event.FOLD); }); }), e ); })(i.ViewPlugin); e.WindowController = s; }, 712: function (t, e, n) { var o, r = (this && this.__extends) || ((o = function (t, e) { return ( (o = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (t, e) { t.__proto__ = e; }) || function (t, e) { for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]); }), o(t, e) ); }), function (t, e) { if ('function' != typeof e && null !== e) throw new TypeError('Class extends value ' + String(e) + ' is not a constructor or null'); function n() { this.constructor = t; } o(t, e), (t.prototype = null === e ? Object.create(e) : ((n.prototype = e.prototype), new n())); }), i = (this && this.__importDefault) || function (t) { return t && t.__esModule ? t : { default: t }; }; Object.defineProperty(e, '__esModule', { value: !0 }), (e.View = e.ViewPlugin = void 0); var a = i(n(312)); e.ViewPlugin = function () {}; var s = (function (t) { function e() { var e = t.call(this) || this; return ( (e.plugins = []), (e.container = e.creatElement()), (e.controller = e.container.find('.top-container')), (e.common = e.container.find('.common')), e ); } return ( r(e, t), (e.prototype.register = function (t) { this.plugins.push(t); }), (e.prototype.creatElement = function () { return $( '\n
\n
\n
\n
\n ' ); }), (e.prototype.start = function () { var t = this; this.plugins.forEach(function (e) { console.log(e.name, 'will register'), e.apply(t), console.log(e.name, 'did register'); }); }), e ); })(a.default); e.View = s; }, }, e = {}; !(function n(o) { var r = e[o]; if (void 0 !== r) return r.exports; var i = (e[o] = { exports: {} }); return t[o].call(i.exports, i, i.exports, n), i.exports; })(386); })();