123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655 |
- Namespace.register("U.MD.O.E.TL");
- U.MD.O.E.setStyle = false;
- U.MD.O.E.clearStyle = false;
- U.MD.O.E.TL.setStyle = function (attr, cellArr, req) {
- var _attr = attr,
- _sname,
- _scontent,
- _eiditorBox = $("#U_MD_O_E_editorBox")[0],
- _cellCheckd = cellArr || $(".U_MD_O_E_cellCheckd"),
- _dataArr = [],
- _firstAttr = "";
- for (var key in _attr) {
- _sname = key;
- _scontent = _attr[key];
- }
- for (var i = 0; i < _cellCheckd.length; i++) {
- _cellCheckd[i].setAttribute("name", "seted");
- if (_cellCheckd[i].style.fontWeight == "" && _sname == "fontWeight") {
- _eiditorBox.style[_sname] = _scontent;
- _cellCheckd[i].style[_sname] = _eiditorBox.style[_sname];
- }
- else if (_cellCheckd[i].style.fontStyle == "" && _sname == "fontStyle") {
- _eiditorBox.style[_sname] = _scontent;
- _cellCheckd[i].style[_sname] = _eiditorBox.style[_sname];
- }
- else if (_cellCheckd[i].style.textDecoration == "" && _sname == "textDecoration") {
- _eiditorBox.style[_sname] = _scontent;
- _cellCheckd[i].style[_sname] = _eiditorBox.style[_sname];
- }
- else if (_cellCheckd[i].style.textDecoration == "underline" && _sname == "textDecoration" && _scontent == "line-through") {
- _eiditorBox.style[_sname] = _scontent;
- _cellCheckd[i].style[_sname] = _eiditorBox.style[_sname];
- }
- else if (_cellCheckd[i].style.textDecoration == "line-through" && _sname == "textDecoration" && _scontent == "underline") {
- _eiditorBox.style[_sname] = _scontent;
- _cellCheckd[i].style[_sname] = _eiditorBox.style[_sname];
- }
- else if ((_cellCheckd[i].style.textAlign == "" || _cellCheckd[i].style.textAlign == "left" || _cellCheckd[i].style.textAlign == "center" || _cellCheckd[i].style.textAlign == "right") && _sname == "textAlign") {
- _eiditorBox.style[_sname] = _scontent;
- _cellCheckd[i].style[_sname] = _eiditorBox.style[_sname];
- }
- else if (_sname == "textAlign" && _cellCheckd[i].style.textAlign == _scontent) {
- _eiditorBox.style[_sname] = "";
- _cellCheckd[i].style[_sname] = "";
- }
- else if (_sname == "backgroundColor") {
- _cellCheckd[i].style[_sname] = _scontent;
- }
- else if (_sname == "color") {
- _cellCheckd[i].style[_sname] = _scontent;
- }
- else if (_sname == "fontFamily") {
- _eiditorBox.style[_sname] = _scontent;
- _cellCheckd[i].style[_sname] = _eiditorBox.style[_sname];
- }
- else if (_sname == "fontSize") {
- _eiditorBox.style[_sname] = _scontent;
- _cellCheckd[i].style[_sname] = _eiditorBox.style[_sname];
- }
- else {
- _eiditorBox.style[_sname] = "";
- _cellCheckd[i].style[_sname] = _eiditorBox.style[_sname];
- attr = "";
- _scontent = "";
- }
- if (i == 0) {
- _firstAttr = attr;
- }
- var _info = {
- col: _cellCheckd[i].col,
- row: _cellCheckd[i].row,
- innerText: _cellCheckd[i].innerText,
- attr: _sname,
- value: _scontent
- };
- _dataArr.push(_info);
- }
- U.MD.O.E.dataChange(U.MD.O.E.excelInfo("blur", _dataArr), req);
- }
- U.MD.O.E.TL.clearStyle = function (cellArr, req) {
- var _eiditorBox = $("#U_MD_O_E_editorBox")[0],
- _cellCheckd = cellArr || $(".U_MD_O_E_cellCheckd"),
- _dataArr = [];
- for (var i = 0; i < _cellCheckd.length; i++) {
- U.MD.O.E.TL.cellClearStyle(_cellCheckd[i]);
- var _info = {
- col: _cellCheckd[i].col,
- row: _cellCheckd[i].row,
- innerText: _cellCheckd[i].innerText,
- clearStyle: true
- };
- _dataArr.push(_info);
- }
- U.MD.O.E.dataChange(U.MD.O.E.excelInfo("blur", _dataArr), req);
- _eiditorBox.style.fontWeight = "";
- _eiditorBox.style.fontStyle = "";
- _eiditorBox.style.textDecoration = "";
- _eiditorBox.style.textAlign = "";
- _eiditorBox.style.verticalAlign = "";
- _eiditorBox.style.color = "";
- _eiditorBox.style.fontFamily = "";
- _eiditorBox.style.fontSize = "";
- }
- U.MD.O.E.TL.cellClearStyle = function (cell) {
- cell.style.fontWeight = "";
- cell.style.fontStyle = "";
- cell.style.textDecoration = "";
- cell.style.textAlign = "";
- cell.style.verticalAlign = "";
- cell.endRow ? _cellCheckd[i].style.display = "" : '';
- if (cell.children[0])
- cell.children[0].style.verticalAlign = "";
- cell.style.color = "";
- cell.style.backgroundColor = "";
- cell.style.fontFamily = "";
- cell.style.fontSize = "";
- }
- U.MD.O.E.TL.setTextStyle = function (attr, cellArr) {
- var _attr = attr,
- _sname,
- _scontent,
- _eiditorBox = $("#U_MD_O_E_editorBox")[0],
- _cellCheckd = cellArr||$(".U_MD_O_E_cellCheckd"),
- _cellArr = [];
- for (var key in _attr) {
- _sname = key;
- _scontent = _attr[key];
- for (var i = 0; i < _cellCheckd.length; i++) {
- _eiditorBox.style[_sname] = _scontent;
- _cellCheckd[i].style.display = 'table';
- if (_cellCheckd[i].children[0])
- _cellCheckd[i].children[0].style[_sname] = _scontent;
- _cellArr.push(_cellCheckd[i].id);
- }
- }
- console.log(_cellArr);
- console.log(attr);
- }
- U.MD.O.E.TL.colorPicker = function (el, event) {
- U.MD.O.E.TL.colorPicker.clickEl = el;
-
- if (!U.MD.O.E.TL.colorPicker.ColorPickerEl) {
- U.MD.O.E.TL.colorPicker.ColorPickerEl = U.MD.UI.ColorPicker(U.MD.O.E.TL.colorPicker.ColorPickerEl, U.MD.O.E.TL.changeColor);
- document.body.appendChild(U.MD.O.E.TL.colorPicker.ColorPickerEl)
- U.MD.O.E.TL.colorPicker.ColorPickerEl.style.position = 'absolute';
- U.MD.O.E.TL.colorPicker.ColorPickerEl.style.zIndex = '9999'
- }
- if (el.parentNode.className == "BD_BorderPicker") {
- U.MD.O.E.TL.colorPicker.ColorPickerEl.style.left = el.parentNode.offsetLeft + 'px';
- } else {
- U.MD.O.E.TL.colorPicker.ColorPickerEl.style.left = event.target.getBoundingClientRect().left + 'px';
- }
- U.MD.O.E.TL.colorPicker.ColorPickerEl.style.top = event.target.getBoundingClientRect().top + 30 + (document.documentElement.scrollTop || document.body.scrollTop) + 'px';
- U.MD.O.E.TL.colorPicker.ColorPickerEl.style.display = "block";
- U.UF.EV.stopBubble(event);
- }
- U.MD.O.E.TL.colorPicker.clickEl = null;
- U.MD.O.E.TL.colorPicker.ColorPickerEl = null;
- U.MD.O.E.TL.changeColor = function (r) {
- var _changeEl = U.MD.O.E.TL.colorPicker.clickEl.querySelector('div[changecolor]');
- _changeEl.style.background = r;
- console.log(_changeEl);
- if (_changeEl && _changeEl.getAttribute('changecolor') == 'font')
- U.MD.O.E.TL.setStyle({ 'color': U.UF.C.getColorByRGB(r) });
- else if (_changeEl && _changeEl.getAttribute('changecolor') == 'bdcolor')
- ;
- else
- U.MD.O.E.TL.setStyle({ 'backgroundColor': U.UF.C.getColorByRGB(r) });
- U.MD.O.E.TL.colorPicker.ColorPickerEl.style.display = "none";
- }
- U.MD.O.E.TL.jsonSetStyle = function (cell, attr) {
- for (var i in attr) {
- cell.style[i] = attr[i]
- }
- }
- U.MD.O.E.TL.setBorderStyle = function (el, attr, cellArr, req) {
- $(".BD_BorderPicker")[0].style.display = "none";
- var _el = el,
- _type;
- if (typeof (_el) == "string") {
- _type = _el;
- } else {
- _type = _el.title;
- }
- var _color = U.UF.C.getColorByRGB($("#bdcolor")[0].style.background),
- _attr = attr,
- _sname,
- _scontent,
- _eiditorBox = $("#U_MD_O_E_editorBox")[0],
- _cellCheckd = cellArr || $(".U_MD_O_E_cellCheckd"),
- _cellLeft,
- _cellTop,
- _cellRight,
- _cellBottom,
- _row = $(".U_MD_O_E_row"),
- _col = $(".U_MD_O_E_column"),
- _left,
- _top,
- _right,
- _bottom,
- _data
- _dataArr = [];
- console.log(_cellCheckd.length);
- console.log(_cellCheckd);
- for (var key in _attr) {
- _sname = key;
- _scontent = _attr[key];
- }
- if (_type != "无框线" && typeof (_el) == "string") {
- } else if (_type != "无框线") {
- _scontent = _scontent + " " + _color;
- }
- for (var i = 0; i < _cellCheckd.length; i++) {
- if (i == 0) {
- _left = _cellCheckd[i].col;
- _top = _cellCheckd[i].row;
- }
- if (i == _cellCheckd.length - 1) {
- _right = _cellCheckd[i].col;
- _bottom = _cellCheckd[i].row;
- }
- }
- if (_type == "所有边框" || _type == "无框线") {
- for (var i = 0; i < _cellCheckd.length; i++) {
- _cellCheckd[i].setAttribute("name", "seted");
- _cellCheckd[i].style.borderRight = _scontent;
- _cellCheckd[i].style.borderBottom = _scontent;
- if (_cellCheckd[i].col == 1) {
- if (_type == "无框线")
- _cellCheckd[i].style.borderLeft = "none";
- else
- _cellCheckd[i].style.borderLeft = _scontent;
- _data = {
- col: _cellCheckd[i].col,
- row: _cellCheckd[i].row,
- innerText: _cellCheckd[i].innerText,
- attr: _sname,
- br: "border-left",
- value: _type == "无框线" ? "none" : _scontent,
- bordertype: _type
- };
- _dataArr.push(_data);
- } else if (_cellCheckd[i].col == _left) {
- _cellLeft = $("#POS_" + (_cellCheckd[i].col - 1) + "_" + (_cellCheckd[i].row) + "")[0];
- _cellLeft.style.borderRight = _scontent;
- _data = {
- col: _cellCheckd[i].col - 1,
- row: _cellCheckd[i].row,
- innerText: _cellCheckd[i].innerText,
- attr: _sname,
- br: "border-right",
- value: _scontent,
- bordertype: _type
- };
- _dataArr.push(_data);
- }
- if (_cellCheckd[i].row == 1) {
- if (_type == "无框线")
- _cellCheckd[i].style.borderTop = "none";
- else
- _cellCheckd[i].style.borderTop = _scontent;
- _data = {
- col: _cellCheckd[i].col,
- row: _cellCheckd[i].row,
- innerText: _cellCheckd[i].innerText,
- attr: _sname,
- bb: "border-top",
- value: _type == "无框线" ? "none" : _scontent,
- bordertype: _type
- };
- _dataArr.push(_data);
- } else if (_cellCheckd[i].row == _top) {
- _cellTop = $("#POS_" + (_cellCheckd[i].col) + "_" + (_cellCheckd[i].row - 1) + "")[0];
- _cellTop.style.borderBottom = _scontent;
- _data = {
- col: _cellCheckd[i].col,
- row: _cellCheckd[i].row - 1,
- innerText: _cellCheckd[i].innerText,
- attr: _sname,
- bb: "border-bottom",
- value: _scontent,
- bordertype: _type
- };
- _dataArr.push(_data);
- }
- _data = {
- col: _cellCheckd[i].col,
- row: _cellCheckd[i].row,
- innerText: _cellCheckd[i].innerText,
- attr: _sname,
- br: "border-right",
- bb: "border-bottom",
- value: _scontent,
- bordertype: _type
- };
- _dataArr.push(_data);
- }
- }
- else if (_type == "外侧框线") {
- for (var i = 0; i < _cellCheckd.length; i++) {
- if (_cellCheckd[i].col == 1) {
- _cellCheckd[i].style.borderLeft = _scontent;
- _data = {
- col: _cellCheckd[i].col,
- row: _cellCheckd[i].row,
- innerText: _cellCheckd[i].innerText,
- attr: _sname,
- br: "border-left",
- value: _scontent,
- bordertype: _type
- };
- _dataArr.push(_data);
- } else if (_cellCheckd[i].col == _left) {
- _cellLeft = $("#POS_" + (_cellCheckd[i].col - 1) + "_" + (_cellCheckd[i].row) + "")[0];
- _cellLeft.style.borderRight = _scontent;
- _data = {
- col: _cellCheckd[i].col - 1,
- row: _cellCheckd[i].row,
- innerText: _cellCheckd[i].innerText,
- attr: _sname,
- br: "border-right",
- value: _scontent,
- bordertype: _type
- };
- _dataArr.push(_data);
- }
- if (_cellCheckd[i].row == 1) {
- _cellCheckd[i].style.borderTop = _scontent;
- _data = {
- col: _cellCheckd[i].col,
- row: _cellCheckd[i].row,
- innerText: _cellCheckd[i].innerText,
- attr: _sname,
- bb: "border-top",
- value: _scontent,
- bordertype: _type
- };
- _dataArr.push(_data);
- } else if (_cellCheckd[i].row == _top) {
- _cellTop = $("#POS_" + (_cellCheckd[i].col) + "_" + (_cellCheckd[i].row - 1) + "")[0];
- _cellTop.style.borderBottom = _scontent;
- _data = {
- col: _cellCheckd[i].col,
- row: _cellCheckd[i].row - 1,
- innerText: _cellCheckd[i].innerText,
- attr: _sname,
- bb: "border-bottom",
- value: _scontent,
- bordertype: _type
- };
- _dataArr.push(_data);
- }
- if (_cellCheckd[i].col == _right) {
- _cellRight = $("#POS_" + (_cellCheckd[i].col) + "_" + (_cellCheckd[i].row) + "")[0];
- _cellRight.style.borderRight = _scontent;
- _data = { col: _cellRight.col, row: _cellRight.row, innerText: _cellRight.innerText, attr: _sname, br: "border-right", value: _scontent, bordertype: _type };
- _dataArr.push(_data);
- }
- if (_cellCheckd[i].row == _bottom) {
- _cellBottom = $("#POS_" + (_cellCheckd[i].col) + "_" + (_cellCheckd[i].row) + "")[0];
- _cellBottom.style.borderBottom = _scontent;
- _data = { col: _cellBottom.col, row: _cellBottom.row, innerText: _cellBottom.innerText, attr: _sname, bb: "border-bottom", value: _scontent, bordertype: _type };
- _dataArr.push(_data);
- }
- }
- }
- else if (_type == "上框线") {
- for (var i = 0; i < _cellCheckd.length; i++) {
- if (_cellCheckd[i].row == 1) {
- _cellCheckd[i].style.borderTop = _scontent;
- _data = {
- col: _cellCheckd[i].col,
- row: _cellCheckd[i].row,
- innerText: _cellCheckd[i].innerText,
- attr: _sname,
- bb: "border-top",
- value: _scontent,
- bordertype: _type
- };
- _dataArr.push(_data);
- } else if (_cellCheckd[i].row == _top) {
- _cellTop = $("#POS_" + (_cellCheckd[i].col) + "_" + (_cellCheckd[i].row - 1) + "")[0];
- _cellTop.style.borderBottom = _scontent;
- _data = {
- col: _cellCheckd[i].col,
- row: _cellCheckd[i].row - 1,
- innerText: _cellCheckd[i].innerText,
- attr: _sname,
- bb: "border-bottom",
- value: _scontent,
- bordertype: _type
- };
- _dataArr.push(_data);
- }
- }
- }
- else if (_type == "下框线" || _type == "双底框线") {
- for (var i = 0; i < _cellCheckd.length; i++) {
- if (_cellCheckd[i].row == _bottom) {
- _cellBottom = $("#POS_" + (_cellCheckd[i].col) + "_" + (_cellCheckd[i].row) + "")[0];
- _cellBottom.style.borderBottom = _scontent;
- _data = { col: _cellBottom.col, row: _cellBottom.row, innerText: _cellBottom.innerText, attr: _sname, bb: "border-bottom", value: _scontent, bordertype: _type };
- _dataArr.push(_data);
- }
- }
- }
- else if (_type == "左框线") {
- for (var i = 0; i < _cellCheckd.length; i++) {
- if (_cellCheckd[i].col == 1) {
- _cellCheckd[i].style.borderLeft = _scontent;
- _data = {
- col: _cellCheckd[i].col,
- row: _cellCheckd[i].row,
- innerText: _cellCheckd[i].innerText,
- attr: _sname,
- br: "border-left",
- value: _scontent,
- bordertype: _type
- };
- _dataArr.push(_data);
- } else if (_cellCheckd[i].col == _left) {
- _cellLeft = $("#POS_" + (_cellCheckd[i].col - 1) + "_" + (_cellCheckd[i].row) + "")[0];
- _cellLeft.style.borderRight = _scontent;
- _data = {
- col: _cellCheckd[i].col - 1,
- row: _cellCheckd[i].row,
- innerText: _cellCheckd[i].innerText,
- attr: _sname,
- br: "border-right",
- value: _scontent,
- bordertype: _type
- };
- _dataArr.push(_data);
- }
- }
- }
- else if (_type == "右框线") {
- for (var i = 0; i < _cellCheckd.length; i++) {
- if (_cellCheckd[i].col == _right) {
- _cellRight = $("#POS_" + (_cellCheckd[i].col) + "_" + (_cellCheckd[i].row) + "")[0];
- _cellRight.style.borderRight = _scontent;
- _data = { col: _cellRight.col, row: _cellRight.row, innerText: _cellRight.innerText, attr: _sname, br: "border-right", value: _scontent, bordertype: _type };
- _dataArr.push(_data);
- }
- }
- }
- else if (_type == "上下框线") {
- for (var i = 0; i < _cellCheckd.length; i++) {
- if (_cellCheckd[i].row == 1) {
- _cellCheckd[i].style.borderTop = _scontent;
- _data = {
- col: _cellCheckd[i].col,
- row: _cellCheckd[i].row,
- innerText: _cellCheckd[i].innerText,
- attr: _sname,
- bb: "border-top",
- value: _scontent,
- bordertype: _type
- };
- _dataArr.push(_data);
- } else if (_cellCheckd[i].row == _top) {
- _cellTop = $("#POS_" + (_cellCheckd[i].col) + "_" + (_cellCheckd[i].row - 1) + "")[0];
- _cellTop.style.borderBottom = _scontent;
- _data = {
- col: _cellCheckd[i].col,
- row: _cellCheckd[i].row - 1,
- innerText: _cellCheckd[i].innerText,
- attr: _sname,
- bb: "border-bottom",
- value: _scontent,
- bordertype: _type
- };
- _dataArr.push(_data);
- }
- if (_cellCheckd[i].row == _bottom) {
- _cellBottom = $("#POS_" + (_cellCheckd[i].col) + "_" + (_cellCheckd[i].row) + "")[0];
- _cellBottom.style.borderBottom = _scontent;
- _data = { col: _cellBottom.col, row: _cellBottom.row, innerText: _cellBottom.innerText, attr: _sname, bb: "border-bottom", value: _scontent, bordertype: _type };
- _dataArr.push(_data);
- }
- }
- }
- console.log(_dataArr);
- U.MD.O.E.dataChange(U.MD.O.E.excelInfo("setBorder", _dataArr), req);
- U.UF.EV.stopBubble(window.event);
- }
- U.MD.O.E.TL.borderPicker = function () {
- var barelement = $("#bd_Pick")[0];
- var div = $$("div", {
- datacontent: '',
- style: {
- width: "120px",
- height: "80px",
- border: "1px solid #CDCDCD",
- backgroundColor: " #FFF",
- padding: "10px 10px 10px 5px",
- position: "absolute",
- left: $(".U_MD_O_E_Editor_head_features_ul_ibtmore")[0].offsetLeft + "px",
- display: "none",
- zIndex: 1
- }
- , "className": "BD_BorderPicker"
- }, barelement);
- $(barelement).bind('click', function (e) {
- U.UF.EV.stopBubble(e);
-
- });
- div.innerHTML = "<div class='U_MD_O_E_Editor_head_features_ul_ibt' style='background-position: 5px 1px;width: 24px; height: 18px' title='所有边框' onmousedown='U.MD.O.E.TL.setBorderStyle(this,{ \"border\": \"1px solid\" });'></div><div class='U_MD_O_E_Editor_head_features_ul_ibt' style='background-position: 5px -28px;width: 24px; height: 18px' title='外侧框线' onmousedown='U.MD.O.E.TL.setBorderStyle(this,{ \"border\": \"1px solid\" });'></div><div class='U_MD_O_E_Editor_head_features_ul_ibt' style='background-position: 5px -57px;width: 24px; height: 18px' title='无框线' onmousedown='U.MD.O.E.TL.setBorderStyle(this,{ \"border\": \"1px solid #bebebe\" });'></div><div class='U_MD_O_E_Editor_head_features_ul_ibt' style='background-position: 5px -85px;width: 24px; height: 18px' title='上框线' onmousedown='U.MD.O.E.TL.setBorderStyle(this,{ \"border\": \"1px solid\" });'></div><div class='U_MD_O_E_Editor_head_features_ul_ibt' style='background-position: 5px -113px;width: 24px; height: 18px' title='下框线' onmousedown='U.MD.O.E.TL.setBorderStyle(this,{ \"border\": \"1px solid\" });'></div><div class='U_MD_O_E_Editor_head_features_ul_ibt' style='background-position: 5px -143px;width: 24px; height: 18px' title='左框线' onmousedown='U.MD.O.E.TL.setBorderStyle(this,{ \"border\": \"1px solid\" });'></div><div class='U_MD_O_E_Editor_head_features_ul_ibt' style='background-position: 5px -171px;width: 24px; height: 18px' title='右框线' onmousedown='U.MD.O.E.TL.setBorderStyle(this,{ \"border\": \"1px solid\" });'></div><div class='U_MD_O_E_Editor_head_features_ul_ibt' style='background-position: 5px -199px;width: 24px; height: 18px' title='上下框线' onmousedown='U.MD.O.E.TL.setBorderStyle(this,{ \"border\": \"1px solid\" });'></div><div class='U_MD_O_E_Editor_head_features_ul_ibt' style='background-position: 5px -228px;width: 24px; height: 18px' title='双底框线' onmousedown='U.MD.O.E.TL.setBorderStyle(this,{ \"border\": \"3px double\" });'></div><div class='U_MD_O_E_Editor_head_features_ul_ibtcolor' title='边框颜色' onclick = 'U.MD.O.E.TL.colorPicker(this, event)'><div style='float:left;padding-top: 5px;margin-left:6px'><div class='' style='background: url(/img/bordercolor.png) no-repeat;width: 14px; height: 14px;float: none;margin: 2px'></div><div style='width:18px;height: 4px; background: #000;' changecolor='bdcolor' id='bdcolor'></div></div><div class='U_MD_O_E_Editor_head_features_ul_bctext' style='padding-top: 7px;width:96px;height:22px;text-align:left;line-height:22px;float:right'>边框颜色</div>";
- }
- U.MD.O.E.TL.borderPickerShow = function () {
- var _el = $(".BD_BorderPicker")[0];
- if (_el.style.display == "none")
- _el.style.display = "block";
- }
- U.MD.O.E.TL.hideChange = function (el) {
- if (!el.children.length)
- return;
- el.style.display === 'table-row' ? el.style.display = 'none' : el.style.display = 'table-row';
- }
- U.MD.O.E.TL.toolsbind = function (moreareael) {
- var _toolsEl = $('#tools')[0];
- _toolsEl.onresize = function () {
- U.MD.O.E.TL.toolbarCheck(_toolsEl, moreareael);
- };
- U.MD.O.E.TL.toolbarCheck(_toolsEl, moreareael);
- }
- U.MD.O.E.TL.toolbarCheck = function (forms, moreareael) {
- var _winW = forms.clientWidth;
- var _morealattice = $(".U_MD_O_H_head_mo")[0];
- var _partition1 = $('div[partition="1"]')[0];
- console.log(_winW);
- if (_winW > 1189) {
- $('#moreButton')[0].style.display = 'none'
- } else {
- $('#moreButton')[0].style.display = 'block'
- }
- if (!(_winW > 750)) {
- moreareael.querySelector('div[partition="1"]').style.float = "";
- } else if (_winW > 750) {
- _partition1.style.float = "left";
- }
- if (!(_winW > 849) && !moreareael.querySelector('div[partition="4"]')) {
- moreareael.insertBefore($('div[partition="4"]')[0], moreareael.firstElementChild)
- } else {
- if (_winW > 849 && moreareael.querySelector('div[partition="4"]'))
- moreareael.parentNode.insertBefore($('div[partition="4"]')[0], moreareael.previousElementSibling)
- }
- if (!(_winW > 922) && !moreareael.querySelector('div[partition="3"]')) {
- moreareael.insertBefore($('div[partition="3"]')[0], moreareael.firstElementChild)
- _morealattice.style.right = "";
- _morealattice.style.left = "0px";
- } else {
- if (_winW > 922 && moreareael.querySelector('div[partition="3"]'))
- moreareael.parentNode.insertBefore($('div[partition="3"]')[0], moreareael.previousElementSibling)
- if (_winW > 922) {
- _morealattice.style.right = "0px";
- _morealattice.style.left = "";
- }
- }
- if (!(_winW > 1186) && !moreareael.querySelector('div[partition="2"]')) {
- moreareael.insertBefore($('div[partition="2"]')[0], moreareael.firstElementChild)
- } else {
- if (_winW > 1186 && moreareael.querySelector('div[partition="2"]'))
- moreareael.parentNode.insertBefore($('div[partition="2"]')[0], moreareael.previousElementSibling)
- }
- if (!(_winW > 1189) && !moreareael.querySelector('div[partition="1"]')) {
- moreareael.appendChild($('div[partition="1"]')[0]);
- } else {
- if (_winW > 1189 && moreareael.querySelector('div[partition="1"]'))
- moreareael.parentNode.insertBefore($('div[partition="1"]')[0], moreareael.previousElementSibling)
- if (_winW > 1189) {
- _morealattice.style.display = "none";
- }
- }
- }
|