ueditor.parse.min.js 28KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885
  1. /*!
  2. * UEditor
  3. * version: ueditor
  4. * build: Wed Aug 10 2016 11:06:19 GMT+0800 (CST)
  5. */
  6. !(function() {
  7. !(function() {
  8. UE = window.UE || {};
  9. var a = !!window.ActiveXObject,
  10. b = {
  11. removeLastbs: function(a) {
  12. return a.replace(/\/$/, "");
  13. },
  14. extend: function(a, b) {
  15. for (
  16. var c = arguments,
  17. d = !!this.isBoolean(c[c.length - 1]) && c[c.length - 1],
  18. e = this.isBoolean(c[c.length - 1]) ? c.length - 1 : c.length,
  19. f = 1;
  20. f < e;
  21. f++
  22. ) {
  23. var g = c[f];
  24. for (var h in g) (d && a.hasOwnProperty(h)) || (a[h] = g[h]);
  25. }
  26. return a;
  27. },
  28. isIE: a,
  29. cssRule: a
  30. ? function(a, b, c) {
  31. var d, e;
  32. (c = c || document),
  33. (d = c.indexList ? c.indexList : (c.indexList = {}));
  34. var f;
  35. if (d[a]) f = c.styleSheets[d[a]];
  36. else {
  37. if (void 0 === b) return "";
  38. (f = c.createStyleSheet("", (e = c.styleSheets.length))),
  39. (d[a] = e);
  40. }
  41. return void 0 === b
  42. ? f.cssText
  43. : void (f.cssText = f.cssText + "\n" + (b || ""));
  44. }
  45. : function(a, b, c) {
  46. c = c || document;
  47. var d,
  48. e = c.getElementsByTagName("head")[0];
  49. if (!(d = c.getElementById(a))) {
  50. if (void 0 === b) return "";
  51. (d = c.createElement("style")), (d.id = a), e.appendChild(d);
  52. }
  53. return void 0 === b
  54. ? d.innerHTML
  55. : void ("" !== b
  56. ? (d.innerHTML = d.innerHTML + "\n" + b)
  57. : e.removeChild(d));
  58. },
  59. domReady: function(b) {
  60. var c = window.document;
  61. "complete" === c.readyState
  62. ? b()
  63. : a
  64. ? (!(function() {
  65. if (!c.isReady) {
  66. try {
  67. c.documentElement.doScroll("left");
  68. } catch (a) {
  69. return void setTimeout(arguments.callee, 0);
  70. }
  71. b();
  72. }
  73. })(),
  74. window.attachEvent("onload", function() {
  75. b();
  76. }))
  77. : (c.addEventListener(
  78. "DOMContentLoaded",
  79. function() {
  80. c.removeEventListener(
  81. "DOMContentLoaded",
  82. arguments.callee,
  83. !1
  84. ),
  85. b();
  86. },
  87. !1
  88. ),
  89. window.addEventListener(
  90. "load",
  91. function() {
  92. b();
  93. },
  94. !1
  95. ));
  96. },
  97. each: function(a, b, c) {
  98. if (null != a)
  99. if (a.length === +a.length) {
  100. for (var d = 0, e = a.length; d < e; d++)
  101. if (b.call(c, a[d], d, a) === !1) return !1;
  102. } else
  103. for (var f in a)
  104. if (a.hasOwnProperty(f) && b.call(c, a[f], f, a) === !1)
  105. return !1;
  106. },
  107. inArray: function(a, b) {
  108. var c = -1;
  109. return (
  110. this.each(a, function(a, d) {
  111. if (a === b) return (c = d), !1;
  112. }),
  113. c
  114. );
  115. },
  116. pushItem: function(a, b) {
  117. this.inArray(a, b) == -1 && a.push(b);
  118. },
  119. trim: function(a) {
  120. return a.replace(/(^[ \t\n\r]+)|([ \t\n\r]+$)/g, "");
  121. },
  122. indexOf: function(a, b, c) {
  123. var d = -1;
  124. return (
  125. (c = this.isNumber(c) ? c : 0),
  126. this.each(a, function(a, e) {
  127. if (e >= c && a === b) return (d = e), !1;
  128. }),
  129. d
  130. );
  131. },
  132. hasClass: function(a, b) {
  133. b = b
  134. .replace(/(^[ ]+)|([ ]+$)/g, "")
  135. .replace(/[ ]{2,}/g, " ")
  136. .split(" ");
  137. for (var c, d = 0, e = a.className; (c = b[d++]); )
  138. if (!new RegExp("\\b" + c + "\\b", "i").test(e)) return !1;
  139. return d - 1 == b.length;
  140. },
  141. addClass: function(a, c) {
  142. if (a) {
  143. c = this.trim(c)
  144. .replace(/[ ]{2,}/g, " ")
  145. .split(" ");
  146. for (var d, e = 0, f = a.className; (d = c[e++]); )
  147. new RegExp("\\b" + d + "\\b").test(f) || (f += " " + d);
  148. a.className = b.trim(f);
  149. }
  150. },
  151. removeClass: function(a, b) {
  152. b = this.isArray(b)
  153. ? b
  154. : this.trim(b)
  155. .replace(/[ ]{2,}/g, " ")
  156. .split(" ");
  157. for (var c, d = 0, e = a.className; (c = b[d++]); )
  158. e = e.replace(new RegExp("\\b" + c + "\\b"), "");
  159. (e = this.trim(e).replace(/[ ]{2,}/g, " ")),
  160. (a.className = e),
  161. !e && a.removeAttribute("className");
  162. },
  163. on: function(a, c, d) {
  164. var e = this.isArray(c) ? c : c.split(/\s+/),
  165. f = e.length;
  166. if (f)
  167. for (; f--; )
  168. if (((c = e[f]), a.addEventListener))
  169. a.addEventListener(c, d, !1);
  170. else {
  171. d._d || (d._d = { els: [] });
  172. var g = c + d.toString(),
  173. h = b.indexOf(d._d.els, a);
  174. (d._d[g] && h != -1) ||
  175. (h == -1 && d._d.els.push(a),
  176. d._d[g] ||
  177. (d._d[g] = function(a) {
  178. return d.call(a.srcElement, a || window.event);
  179. }),
  180. a.attachEvent("on" + c, d._d[g]));
  181. }
  182. a = null;
  183. },
  184. off: function(a, c, d) {
  185. var e = this.isArray(c) ? c : c.split(/\s+/),
  186. f = e.length;
  187. if (f)
  188. for (; f--; )
  189. if (((c = e[f]), a.removeEventListener))
  190. a.removeEventListener(c, d, !1);
  191. else {
  192. var g = c + d.toString();
  193. try {
  194. a.detachEvent("on" + c, d._d ? d._d[g] : d);
  195. } catch (h) {}
  196. if (d._d && d._d[g]) {
  197. var i = b.indexOf(d._d.els, a);
  198. i != -1 && d._d.els.splice(i, 1),
  199. 0 == d._d.els.length && delete d._d[g];
  200. }
  201. }
  202. },
  203. loadFile: (function() {
  204. function a(a, c) {
  205. try {
  206. for (var d, e = 0; (d = b[e++]); )
  207. if (d.doc === a && d.url == (c.src || c.href)) return d;
  208. } catch (f) {
  209. return null;
  210. }
  211. }
  212. var b = [];
  213. return function(c, d, e) {
  214. var f = a(c, d);
  215. if (f) return void (f.ready ? e && e() : f.funs.push(e));
  216. if (
  217. (b.push({ doc: c, url: d.src || d.href, funs: [e] }), !c.body)
  218. ) {
  219. var g = [];
  220. for (var h in d) "tag" != h && g.push(h + '="' + d[h] + '"');
  221. return void c.write(
  222. "<" + d.tag + " " + g.join(" ") + " ></" + d.tag + ">"
  223. );
  224. }
  225. if (!d.id || !c.getElementById(d.id)) {
  226. var i = c.createElement(d.tag);
  227. delete d.tag;
  228. for (var h in d) i.setAttribute(h, d[h]);
  229. (i.onload = i.onreadystatechange = function() {
  230. if (
  231. !this.readyState ||
  232. /loaded|complete/.test(this.readyState)
  233. ) {
  234. if (((f = a(c, d)), f.funs.length > 0)) {
  235. f.ready = 1;
  236. for (var b; (b = f.funs.pop()); ) b();
  237. }
  238. i.onload = i.onreadystatechange = null;
  239. }
  240. }),
  241. (i.onerror = function() {
  242. throw Error(
  243. "The load " + (d.href || d.src) + " fails,check the url"
  244. );
  245. }),
  246. c.getElementsByTagName("head")[0].appendChild(i);
  247. }
  248. };
  249. })()
  250. };
  251. b.each(
  252. ["String", "Function", "Array", "Number", "RegExp", "Object", "Boolean"],
  253. function(a) {
  254. b["is" + a] = function(b) {
  255. return Object.prototype.toString.apply(b) == "[object " + a + "]";
  256. };
  257. }
  258. );
  259. var c = {};
  260. (UE.parse = {
  261. register: function(a, b) {
  262. c[a] = b;
  263. },
  264. load: function(a) {
  265. b.each(c, function(c) {
  266. c.call(a, b);
  267. });
  268. }
  269. }),
  270. (uParse = function(a, c) {
  271. b.domReady(function() {
  272. var d;
  273. if (document.querySelectorAll) d = document.querySelectorAll(a);
  274. else if (/^#/.test(a))
  275. d = [document.getElementById(a.replace(/^#/, ""))];
  276. else if (/^\./.test(a)) {
  277. var d = [];
  278. b.each(document.getElementsByTagName("*"), function(b) {
  279. b.className &&
  280. new RegExp("\\b" + a.replace(/^\./, "") + "\\b", "i").test(
  281. b.className
  282. ) &&
  283. d.push(b);
  284. });
  285. } else d = document.getElementsByTagName(a);
  286. b.each(d, function(d) {
  287. UE.parse.load(b.extend({ root: d, selector: a }, c));
  288. });
  289. });
  290. });
  291. })(),
  292. UE.parse.register("insertcode", function(a) {
  293. var b = this.root.getElementsByTagName("pre");
  294. if (b.length)
  295. if ("undefined" == typeof XRegExp) {
  296. var c, d;
  297. void 0 !== this.rootPath
  298. ? ((c =
  299. a.removeLastbs(this.rootPath) +
  300. "/third-party/SyntaxHighlighter/shCore.js"),
  301. (d =
  302. a.removeLastbs(this.rootPath) +
  303. "/third-party/SyntaxHighlighter/shCoreDefault.css"))
  304. : ((c = this.highlightJsUrl), (d = this.highlightCssUrl)),
  305. a.loadFile(document, {
  306. id: "syntaxhighlighter_css",
  307. tag: "link",
  308. rel: "stylesheet",
  309. type: "text/css",
  310. href: d
  311. }),
  312. a.loadFile(
  313. document,
  314. {
  315. id: "syntaxhighlighter_js",
  316. src: c,
  317. tag: "script",
  318. type: "text/javascript",
  319. defer: "defer"
  320. },
  321. function() {
  322. a.each(b, function(a) {
  323. a &&
  324. /brush/i.test(a.className) &&
  325. SyntaxHighlighter.highlight(a);
  326. });
  327. }
  328. );
  329. } else
  330. a.each(b, function(a) {
  331. a && /brush/i.test(a.className) && SyntaxHighlighter.highlight(a);
  332. });
  333. }),
  334. UE.parse.register("table", function(a) {
  335. function b(b, c) {
  336. var d,
  337. e = b;
  338. for (c = a.isArray(c) ? c : [c]; e; ) {
  339. for (d = 0; d < c.length; d++)
  340. if (e.tagName == c[d].toUpperCase()) return e;
  341. e = e.parentNode;
  342. }
  343. return null;
  344. }
  345. function c(b, c, e) {
  346. for (
  347. var f = b.rows,
  348. g = [],
  349. h = "TH" === f[0].cells[0].tagName,
  350. i = 0,
  351. j = 0,
  352. k = f.length;
  353. j < k;
  354. j++
  355. )
  356. g[j] = f[j];
  357. var l = {
  358. reversecurrent: function(a, b) {
  359. return 1;
  360. },
  361. orderbyasc: function(a, b) {
  362. var c = a.innerText || a.textContent,
  363. d = b.innerText || b.textContent;
  364. return c.localeCompare(d);
  365. },
  366. reversebyasc: function(a, b) {
  367. var c = a.innerHTML,
  368. d = b.innerHTML;
  369. return d.localeCompare(c);
  370. },
  371. orderbynum: function(b, c) {
  372. var d = b[a.isIE ? "innerText" : "textContent"].match(/\d+/),
  373. e = c[a.isIE ? "innerText" : "textContent"].match(/\d+/);
  374. return d && (d = +d[0]), e && (e = +e[0]), (d || 0) - (e || 0);
  375. },
  376. reversebynum: function(b, c) {
  377. var d = b[a.isIE ? "innerText" : "textContent"].match(/\d+/),
  378. e = c[a.isIE ? "innerText" : "textContent"].match(/\d+/);
  379. return d && (d = +d[0]), e && (e = +e[0]), (e || 0) - (d || 0);
  380. }
  381. };
  382. b.setAttribute(
  383. "data-sort-type",
  384. e && "string" == typeof e && l[e] ? e : ""
  385. ),
  386. h && g.splice(0, 1),
  387. (g = d(g, function(a, b) {
  388. var d;
  389. return (d =
  390. e && "function" == typeof e
  391. ? e.call(this, a.cells[c], b.cells[c])
  392. : e && "number" == typeof e
  393. ? 1
  394. : e && "string" == typeof e && l[e]
  395. ? l[e].call(this, a.cells[c], b.cells[c])
  396. : l.orderbyasc.call(this, a.cells[c], b.cells[c]));
  397. }));
  398. for (
  399. var m = b.ownerDocument.createDocumentFragment(), n = 0, k = g.length;
  400. n < k;
  401. n++
  402. )
  403. m.appendChild(g[n]);
  404. var o = b.getElementsByTagName("tbody")[0];
  405. i
  406. ? o.insertBefore(
  407. m,
  408. f[i - range.endRowIndex + range.beginRowIndex - 1]
  409. )
  410. : o.appendChild(m);
  411. }
  412. function d(a, b) {
  413. b =
  414. b ||
  415. function(a, b) {
  416. return a.localeCompare(b);
  417. };
  418. for (var c = 0, d = a.length; c < d; c++)
  419. for (var e = c, f = a.length; e < f; e++)
  420. if (b(a[c], a[e]) > 0) {
  421. var g = a[c];
  422. (a[c] = a[e]), (a[e] = g);
  423. }
  424. return a;
  425. }
  426. function e(b) {
  427. if (!a.hasClass(b.rows[0], "firstRow")) {
  428. for (var c = 1; c < b.rows.length; c++)
  429. a.removeClass(b.rows[c], "firstRow");
  430. a.addClass(b.rows[0], "firstRow");
  431. }
  432. }
  433. var f = this,
  434. g = this.root,
  435. h = g.getElementsByTagName("table");
  436. if (h.length) {
  437. var i = this.selector;
  438. a.cssRule(
  439. "table",
  440. i +
  441. " table.noBorderTable td," +
  442. i +
  443. " table.noBorderTable th," +
  444. i +
  445. " table.noBorderTable caption{border:1px dashed #ddd !important}" +
  446. i +
  447. " table.sortEnabled tr.firstRow th," +
  448. i +
  449. " table.sortEnabled tr.firstRow td{padding-right:20px; background-repeat: no-repeat;background-position: center right; background-image:url(" +
  450. this.rootPath +
  451. "themes/default/images/sortable.png);}" +
  452. i +
  453. " table.sortEnabled tr.firstRow th:hover," +
  454. i +
  455. " table.sortEnabled tr.firstRow td:hover{background-color: #EEE;}" +
  456. i +
  457. " table{margin-bottom:10px;border-collapse:collapse;display:table;}" +
  458. i +
  459. " td," +
  460. i +
  461. " th{ background:white; padding: 5px 10px;border: 1px solid #DDD;}" +
  462. i +
  463. " caption{border:1px dashed #DDD;border-bottom:0;padding:3px;text-align:center;}" +
  464. i +
  465. " th{border-top:1px solid #BBB;background:#F7F7F7;}" +
  466. i +
  467. " table tr.firstRow th{border-top:2px solid #BBB;background:#F7F7F7;}" +
  468. i +
  469. " tr.ue-table-interlace-color-single td{ background: #fcfcfc; }" +
  470. i +
  471. " tr.ue-table-interlace-color-double td{ background: #f7faff; }" +
  472. i +
  473. " td p{margin:0;padding:0;}",
  474. document
  475. ),
  476. a.each("td th caption".split(" "), function(b) {
  477. var c = g.getElementsByTagName(b);
  478. c.length &&
  479. a.each(c, function(a) {
  480. a.firstChild || (a.innerHTML = "&nbsp;");
  481. });
  482. });
  483. var h = g.getElementsByTagName("table");
  484. a.each(h, function(d) {
  485. /\bsortEnabled\b/.test(d.className) &&
  486. a.on(d, "click", function(d) {
  487. var g = d.target || d.srcElement,
  488. h = b(g, ["td", "th"]),
  489. i = b(g, "table"),
  490. j = a.indexOf(i.rows[0].cells, h),
  491. k = i.getAttribute("data-sort-type");
  492. j != -1 && (c(i, j, f.tableSortCompareFn || k), e(i));
  493. });
  494. });
  495. }
  496. }),
  497. UE.parse.register("charts", function(a) {
  498. function b() {
  499. return n ? c(n) : null;
  500. }
  501. function c(a) {
  502. for (
  503. var b, c = [], e = a.getElementsByTagName("table"), f = 0;
  504. (b = e[f]);
  505. f++
  506. )
  507. null !== b.getAttribute("data-chart") && c.push(d(b));
  508. return c.length ? c : null;
  509. }
  510. function d(a) {
  511. for (
  512. var b, c = a.getAttribute("data-chart"), d = {}, e = [], f = 0;
  513. (b = a.rows[f]);
  514. f++
  515. ) {
  516. for (var g, h = [], i = 0; (g = b.cells[i]); i++) {
  517. var j = g.innerText || g.textContent || "";
  518. h.push("TH" == g.tagName ? j : 0 | j);
  519. }
  520. e.push(h);
  521. }
  522. c = c.split(";");
  523. for (var k, f = 0; (k = c[f]); f++)
  524. (k = k.split(":")), (d[k[0]] = k[1]);
  525. return { table: a, meta: d, data: e };
  526. }
  527. function e() {
  528. f();
  529. }
  530. function f() {
  531. window.jQuery
  532. ? g()
  533. : a.loadFile(
  534. document,
  535. {
  536. src: m + "/third-party/jquery-1.10.2.min.js",
  537. tag: "script",
  538. type: "text/javascript",
  539. defer: "defer"
  540. },
  541. function() {
  542. g();
  543. }
  544. );
  545. }
  546. function g() {
  547. window.Highcharts
  548. ? h()
  549. : a.loadFile(
  550. document,
  551. {
  552. src: m + "/third-party/highcharts/highcharts.js",
  553. tag: "script",
  554. type: "text/javascript",
  555. defer: "defer"
  556. },
  557. function() {
  558. h();
  559. }
  560. );
  561. }
  562. function h() {
  563. a.loadFile(
  564. document,
  565. {
  566. src: m + "/dialogs/charts/chart.config.js",
  567. tag: "script",
  568. type: "text/javascript",
  569. defer: "defer"
  570. },
  571. function() {
  572. i();
  573. }
  574. );
  575. }
  576. function i() {
  577. for (var a = null, b = null, c = null, d = 0, e = o.length; d < e; d++)
  578. (a = o[d]),
  579. (b = l(a)),
  580. (c = k(a.table)),
  581. j(c, typeConfig[a.meta.chartType], b);
  582. }
  583. function j(a, b, c) {
  584. $(a).highcharts(
  585. $.extend({}, b, {
  586. credits: { enabled: !1 },
  587. exporting: { enabled: !1 },
  588. title: { text: c.title, x: -20 },
  589. subtitle: { text: c.subTitle, x: -20 },
  590. xAxis: { title: { text: c.xTitle }, categories: c.categories },
  591. yAxis: {
  592. title: { text: c.yTitle },
  593. plotLines: [{ value: 0, width: 1, color: "#808080" }]
  594. },
  595. tooltip: { enabled: !0, valueSuffix: c.suffix },
  596. legend: {
  597. layout: "vertical",
  598. align: "right",
  599. verticalAlign: "middle",
  600. borderWidth: 1
  601. },
  602. series: c.series
  603. })
  604. );
  605. }
  606. function k(a) {
  607. var b = document.createElement("div");
  608. return (
  609. (b.className = "edui-chart-container"),
  610. a.parentNode.replaceChild(b, a),
  611. b
  612. );
  613. }
  614. function l(a) {
  615. var b = [],
  616. c = [],
  617. d = [],
  618. e = a.data,
  619. f = a.meta;
  620. if ("1" != f.dataFormat) {
  621. for (var g = 0, h = e.length; g < h; g++)
  622. for (var i = 0, j = e[g].length; i < j; i++)
  623. d[i] || (d[i] = []), (d[i][g] = e[g][i]);
  624. e = d;
  625. }
  626. if (((d = {}), f.chartType != typeConfig.length - 1)) {
  627. c = e[0].slice(1);
  628. for (var k, g = 1; (k = e[g]); g++)
  629. b.push({ name: k[0], data: k.slice(1) });
  630. (d.series = b),
  631. (d.categories = c),
  632. (d.title = f.title),
  633. (d.subTitle = f.subTitle),
  634. (d.xTitle = f.xTitle),
  635. (d.yTitle = f.yTitle),
  636. (d.suffix = f.suffix);
  637. } else {
  638. for (var k = [], g = 1, h = e[0].length; g < h; g++)
  639. k.push([e[0][g], 0 | e[1][g]]);
  640. (b[0] = { type: "pie", name: f.tip, data: k }),
  641. (d.series = b),
  642. (d.title = f.title),
  643. (d.suffix = f.suffix);
  644. }
  645. return d;
  646. }
  647. a.cssRule(
  648. "chartsContainerHeight",
  649. ".edui-chart-container { height:" +
  650. (this.chartContainerHeight || 300) +
  651. "px}"
  652. );
  653. var m = this.rootPath,
  654. n = this.root,
  655. o = null;
  656. m && (o = b()) && e();
  657. }),
  658. UE.parse.register("background", function(a) {
  659. for (
  660. var b, c, d = this, e = d.root, f = e.getElementsByTagName("p"), g = 0;
  661. (c = f[g++]);
  662. )
  663. (b = c.getAttribute("data-background")),
  664. b && c.parentNode.removeChild(c);
  665. b &&
  666. a.cssRule("ueditor_background", d.selector + "{" + b + "}", document);
  667. }),
  668. UE.parse.register("list", function(a) {
  669. function b(b) {
  670. var e = this;
  671. a.each(b, function(b) {
  672. if (b.className && /custom_/i.test(b.className)) {
  673. var f = b.className.match(/custom_(\w+)/)[1];
  674. if ("dash" == f || "dot" == f)
  675. a.pushItem(
  676. c,
  677. h +
  678. " li.list-" +
  679. d[f] +
  680. "{background-image:url(" +
  681. e.liiconpath +
  682. d[f] +
  683. ".gif)}"
  684. ),
  685. a.pushItem(
  686. c,
  687. h +
  688. " ul.custom_" +
  689. f +
  690. "{list-style:none;} " +
  691. h +
  692. " ul.custom_" +
  693. f +
  694. " li{background-position:0 3px;background-repeat:no-repeat}"
  695. );
  696. else {
  697. var g = 1;
  698. a.each(b.childNodes, function(b) {
  699. "LI" == b.tagName &&
  700. (a.pushItem(
  701. c,
  702. h +
  703. " li.list-" +
  704. d[f] +
  705. g +
  706. "{background-image:url(" +
  707. e.liiconpath +
  708. "list-" +
  709. d[f] +
  710. g +
  711. ".gif)}"
  712. ),
  713. g++);
  714. }),
  715. a.pushItem(
  716. c,
  717. h +
  718. " ol.custom_" +
  719. f +
  720. "{list-style:none;}" +
  721. h +
  722. " ol.custom_" +
  723. f +
  724. " li{background-position:0 3px;background-repeat:no-repeat}"
  725. );
  726. }
  727. switch (f) {
  728. case "cn":
  729. a.pushItem(
  730. c,
  731. h + " li.list-" + f + "-paddingleft-1{padding-left:25px}"
  732. ),
  733. a.pushItem(
  734. c,
  735. h + " li.list-" + f + "-paddingleft-2{padding-left:40px}"
  736. ),
  737. a.pushItem(
  738. c,
  739. h + " li.list-" + f + "-paddingleft-3{padding-left:55px}"
  740. );
  741. break;
  742. case "cn1":
  743. a.pushItem(
  744. c,
  745. h + " li.list-" + f + "-paddingleft-1{padding-left:30px}"
  746. ),
  747. a.pushItem(
  748. c,
  749. h + " li.list-" + f + "-paddingleft-2{padding-left:40px}"
  750. ),
  751. a.pushItem(
  752. c,
  753. h + " li.list-" + f + "-paddingleft-3{padding-left:55px}"
  754. );
  755. break;
  756. case "cn2":
  757. a.pushItem(
  758. c,
  759. h + " li.list-" + f + "-paddingleft-1{padding-left:40px}"
  760. ),
  761. a.pushItem(
  762. c,
  763. h + " li.list-" + f + "-paddingleft-2{padding-left:55px}"
  764. ),
  765. a.pushItem(
  766. c,
  767. h + " li.list-" + f + "-paddingleft-3{padding-left:68px}"
  768. );
  769. break;
  770. case "num":
  771. case "num1":
  772. a.pushItem(
  773. c,
  774. h + " li.list-" + f + "-paddingleft-1{padding-left:25px}"
  775. );
  776. break;
  777. case "num2":
  778. a.pushItem(
  779. c,
  780. h + " li.list-" + f + "-paddingleft-1{padding-left:35px}"
  781. ),
  782. a.pushItem(
  783. c,
  784. h + " li.list-" + f + "-paddingleft-2{padding-left:40px}"
  785. );
  786. break;
  787. case "dash":
  788. a.pushItem(
  789. c,
  790. h + " li.list-" + f + "-paddingleft{padding-left:35px}"
  791. );
  792. break;
  793. case "dot":
  794. a.pushItem(
  795. c,
  796. h + " li.list-" + f + "-paddingleft{padding-left:20px}"
  797. );
  798. }
  799. }
  800. });
  801. }
  802. var c = [],
  803. d = {
  804. cn: "cn-1-",
  805. cn1: "cn-2-",
  806. cn2: "cn-3-",
  807. num: "num-1-",
  808. num1: "num-2-",
  809. num2: "num-3-",
  810. dash: "dash",
  811. dot: "dot"
  812. };
  813. a.extend(this, {
  814. liiconpath: "http://bs.baidu.com/listicon/",
  815. listDefaultPaddingLeft: "20"
  816. });
  817. var e = this.root,
  818. f = e.getElementsByTagName("ol"),
  819. g = e.getElementsByTagName("ul"),
  820. h = this.selector;
  821. f.length && b.call(this, f),
  822. g.length && b.call(this, g),
  823. (f.length || g.length) &&
  824. (c.push(h + " .list-paddingleft-1{padding-left:0}"),
  825. c.push(
  826. h +
  827. " .list-paddingleft-2{padding-left:" +
  828. this.listDefaultPaddingLeft +
  829. "px}"
  830. ),
  831. c.push(
  832. h +
  833. " .list-paddingleft-3{padding-left:" +
  834. 2 * this.listDefaultPaddingLeft +
  835. "px}"
  836. ),
  837. a.cssRule(
  838. "list",
  839. h +
  840. " ol," +
  841. h +
  842. " ul{margin:0;padding:0;}li{clear:both;}" +
  843. c.join("\n"),
  844. document
  845. ));
  846. }),
  847. UE.parse.register("vedio", function(a) {
  848. var b = this.root.getElementsByTagName("video"),
  849. c = this.root.getElementsByTagName("audio");
  850. if (
  851. (document.createElement("video"),
  852. document.createElement("audio"),
  853. b.length || c.length)
  854. ) {
  855. var d = a.removeLastbs(this.rootPath),
  856. e = d + "/third-party/video-js/video.js",
  857. f = d + "/third-party/video-js/video-js.min.css",
  858. g = d + "/third-party/video-js/video-js.swf";
  859. window.videojs
  860. ? videojs.autoSetup()
  861. : (a.loadFile(document, {
  862. id: "video_css",
  863. tag: "link",
  864. rel: "stylesheet",
  865. type: "text/css",
  866. href: f
  867. }),
  868. a.loadFile(
  869. document,
  870. {
  871. id: "video_js",
  872. src: e,
  873. tag: "script",
  874. type: "text/javascript"
  875. },
  876. function() {
  877. (videojs.options.flash.swf = g), videojs.autoSetup();
  878. }
  879. ));
  880. }
  881. });
  882. })();