1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
-
- //移除
- del = function (t) {
- var a = $("#U_MD_O_W")[0];
- if (a) {
- if (!t && (a["__isplay__"] == "true")) { a["__isplay__"] = "false"; }
- else { $(a).remove(); }
- }
- }
- //导航切换
- switchcon = function (b) {
- if (b.tagName.toLowerCase() !== "ul") {
- var i, c = $("#navg").Child(), a = $("#container").childs();
- for (i = 0; i < a.length; i++) {
- a.css("display", c[i] === b ? (b.className = "active return_key", "block") : (c[i].className = "navgo return_key", "none"), i);
- }
- }
- }
- //判断是否添加导航
- isNavg = function () {
- if (event.button == 2) {
- if (U.OU.R) { //处于模板模式
- var i, b, c, d, a = event.srcElement; $("#U_MD_O_W").remove();
- if ((a = (a.tagName.toLowerCase() == "LI" ? a : $(a).Parent({ tagName: "LI" }))).tagName == "LI") {
- c = $(a).parentElement({ id: "navg" }).Child(); for (i = 0; i < c.length; i++) { if (a === c[i]) { break; } }
- }
- b = $$("div", { "className": "U_MD_O_W", "__isplay__": "true", id: "U_MD_O_W" }, document.body);
- $$("div", {
- title: "点击添加导航",
- innerHTML: i ? "前面插入" : "插入最前",
- style: { "U_MD_O_E_borderLeft": "0" },
- "onclick": function () { addNavg(0, i); }
- }, b);
- $$("div", {
- title: "点击添加导航",
- innerHTML: i ? "后面插入" : "插入最后",
- "onclick": function () { addNavg(1, i); }
- }, b);
- if (i != null) { $$("div", { title: "点击删除导航", innerHTML: "删除导航", onclick: function () { delNavg(i); } }, b); } U.UF.C.rightClickMenuLocation(b);
- }
- }
- }
- //添加导航
- addNavg = function (j, k) {
- var c, d, a = $("#navg"), b = $("#container"), g = a.Child(), m = b.Child(), i = b.Child().length - a.Child().length; $("#U_MD_O_W").remove();
- if (!a[0] || !b[0]) {
- U.UF.UI.confirm("导航网页损坏,是否修复", repair);
- }
- else {
- while (i) { if (i < 0) { c = g; i++; } else { c = m; i--; } $(c[c.length - 1]).remove(); }
- d = $$("li", { "innerHTML": "新增导航" }, a[0], (k == null ? j ? null : g[0] : g[k + j])); c = $$("div", { "className": "new" }, b[0], k == null ? j ? null : m[0] : m[k + j]); $$("div", { "innerHTML": "请在此处添加内容" }, c); switchcon(d);
- }
- }
- //修复网页
- repair = function () {
- U.MD.O.W.GSTemp("US_O_Website");
- }
- //删除导航
- delNavg = function (i) {
- var a = $("#navg").childs(), b = $("#container").childs(); $("#U_MD_O_W").remove();
- if (b[i].innerText) {
- U.UF.UI.confirm("已编辑该板块是否删除", function () {
- delENavg(a[i], b[i]);
- });
- }
- else {
- delENavg(a[i], b[i]);
- }
- }
- //确定删除导航
- delENavg = function (a, b) {
- $[a, b].remove();
- }
- //中间内容设置样式分栏
- constyle = function (i) {
- var e, a = $("#container").Child()[i]; if (a.innerText) { e = a.innerText; } a.innerHTML = "";
- }
- del(true);
|