12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024 |
-
- Namespace.register("U.MD.UI.BTree");
- U.MD.UI.BTree = function (arr, bookfun, dateDeleteFun, dateUpdateFun, dateInsertFun, tree, directory, list, listimg, deteimg, upimg) {
- U.MD.UI.BTree.jsonStartLeft(arr, tree[0], bookfun);
- U.MD.UI.BTree.jsonStartRight(tree[1], bookfun, dateDeleteFun, dateUpdateFun, dateInsertFun, directory, list, listimg, deteimg, upimg);
- }
- U.MD.UI.BTree.treeCreate = function (json, tree, onclickfun) {
- for (var _i = 0; _i < json.length; _i++) {
- var _ul = $$("ul", { className: "U_MD_UI_Tree_a " + json[_i].parentID }, tree);
- var _li = $$("li", { id: json[_i].id, parentid: json[_i].parentid, className: "U_MD_UI_Tree_listyle", parentid: json[_i].id, deep: json[_i].deep }, _ul);
- var _img = $$("img", { "onerror": U.MD.C.imgError, src: json[_i].img_url, className: "U_MD_UI_Tree_imgstyle" }, _li);
- var _span = $$("span", { innerHTML: json[_i].name, className: "spanstyle" }, _li);
- _ul.style.display = "none";
- if (json[_i].deep == "1") { _ul.style.display = "block" }
- _img.aa = false;
- var _liobj = document.getElementsByClassName("U_MD_UI_Tree_a " + json[_i].parentID)[0];
- _ul.style.display = _liobj.style.display;
- _li.onclick = function () {
- onclickfun(this);
- _liobj = document.getElementsByClassName("U_MD_UI_Tree_a " + this.parentid);
- if (_img.aa === true) {
- _img.aa = false;
- for (var _ii = 0; _ii < _liobj.length; _ii++) {
- _liobj[_ii].style.display = "none";
- }
- } else {
- _img.aa = true;
- for (var _ii = 0; _ii < _liobj.length; _ii++) {
- _liobj[_ii].style.display = "block";
- }
- }
- }
- if (json[_i].child) {
- U.MD.UI.BTree.treeCreate(json[_i].child, _ul, onclickfun);
- }
- }
- }
- U.MD.UI.BTree.JsonSelect = function (json, parentID) {
- var _json = [];
- for (var _i = 0; _i < json.length; _i++) {
- if (parentID == 0) {
- return json;
- }
- if (json[_i].id == parentID) {
- _json = json[_i].child;
- return _json;
- }
- if (json[_i].child) {
- var _return = U.MD.UI.BTree.JsonSelect(json[_i].child, parentID);
- }
- }
- return _return;
- }
- U.MD.UI.BTree.DirectoryCreate = function (json, tree, list, jsonpid, jsondelete, jsonupdate, jsonadd, deteurl, upurl, i, j) {
- if (i == 0) {
- list[1].style.display = "none";
- list[2].style.display = "none";
- } else {
- list[2].style.display = "none";
- list[i].style.display = "block";
- }
- var _buttonText = "修改";
- var _button1Text = "删除";
- if (deteurl && upurl) {
- _buttonText = "";
- _button1Text = "";
- }
- tree[i].innerHTML = "";
- list[i].parentID = jsonpid;
- list[i].deep = i + 1;
- if (j) {
- tree[j].innerHTML = "";
- }
- if (json) {
- for (var _i = 0; _i < json.length; _i++) {
- var _ul = $$("ul", { className: "U_MD_UI_Tree_styleul", parentid: json[_i].parentID, deep: json[_i].deep }, tree[i]);
- var _li = $$("li", { className: "U_MD_UI_Tree_styleli", innerHTML: json[_i].name, parentid: json[_i].id }, _ul);
- var _button = $$("input", { type: "button", pid: json[_i].id, parentid: json[_i].parentID, innerHTML: _buttonText, className: "U_MD_UI_Tree_button" }, _ul);
- var _button1 = $$("input", { type: "button", pid: json[_i].id, parentid: json[_i].parentID, innerHTML: _button1Text, className: "U_MD_UI_Tree_button1" }, _ul);
-
- _button.onclick = function () {
- jsonupdate(this, tree, list, jsonpid, jsondelete, jsonupdate, jsonadd, deteurl, upurl, i);
- }
- _button1.onclick = function () {
- jsondelete(this, tree, list, jsonpid, jsondelete, jsonupdate, jsonadd, deteurl, upurl, i);
- }
- _li.onclick = function () {
- if (j) {
- U.MD.UI.BTree.DirectoryCreate(U.MD.UI.BTree.JsonSelect(json, this.parentid), tree, list, this.parentid, jsondelete, jsonupdate, jsonadd, deteurl, upurl, j);
- } else {
- if (i == 2) {
- } else {
- U.MD.UI.BTree.DirectoryCreate(U.MD.UI.BTree.JsonSelect(json, this.parentid), tree, list, this.parentid, jsondelete, jsonupdate, jsonadd, deteurl, upurl, 1, 2);
- }
- }
- }
- }
- }
- var add = U.selectEl(".U_MD_UI_Tree_add");
- if (add[i]) {
- list[i].removeChild(add[i]);
- }
- var _div = $$("div", { className: "U_MD_UI_Tree_add", innerHTML: "添加新分类" }, list[i]);
- _div.onclick = function () {
- jsonadd(this, tree, list, jsonpid, jsondelete, jsonupdate, jsonadd, deteurl, upurl, i);
- }
- }
- U.MD.UI.BTree.jsonAdd = function (json, addjson) {
- var _addid = addjson.parentID;
- if (_addid == "0") {
- json[json.length] = addjson;
- return json;
- }
- for (var _i = 0; _i < json.length; _i++) {
- if (json[_i].id == _addid) {
- if (json[_i].child) {
- json[_i].child[json[_i].child.length] = addjson;
- return json;
- } else {
- json[_i].child = [];
- json[_i].child[json[_i].child.length] = addjson;
- return json;
- }
- }
- if (json[_i].child) {
- var _return = U.MD.UI.BTree.jsonAdd(json[_i].child, addjson);
- json[_i].child = _return;
- }
- }
- return json;
- }
- U.MD.UI.BTree.jsonStartA = function (arr, bookfun, jsonDeleteFun, jsonUpdateFun, jsonInsertFun, tree, directory, mulu, muluimg, deteimg, upimg) {
- json = [];
- var _json = arr;
- for (var _i = 0; _i < _json.length; _i++) {
- U.MD.UI.BTree.jsonAdd(json, _json[_i]);
- }
- tree.innerHTML = "";
- U.MD.UI.BTree.jsonStartRight(tree, bookfun, jsonDeleteFun, jsonUpdateFun, jsonInsertFun, directory, mulu, muluimg, deteimg, upimg);
- }
- U.MD.UI.BTree.jsonStartRight = function (tree, bookfun, jsonDeleteFun, jsonUpdateFun, jsonInsertFun, directory, mulu, muluimg, deteimg, upimg) {
- var _ul = $$("ul", { className: "U_MD_UI_Tree_a " }, tree);
- var _li = $$("li", { className: "U_MD_UI_Tree_listyle", yid: "1" }, _ul);
- var _img = $$("img", { "onerror": U.MD.C.imgError, src: muluimg, className: "U_MD_UI_Tree_imgstyle" }, _li);
- var _span = $$("span", { innerHTML: "目录管理", className: "U_MD_UI_Tree_spanstyle" }, _li);
- _li.onclick = function () {
- bookfun(this);
- U.MD.UI.BTree.DirectoryCreate(json, directory, mulu, 0,
- function (objects, tree, mulu, jsonpid, jsondelete, jsonupdate, jsonadd, deteurl, upurl, i) {
- var _ret = jsonDeleteFun(objects.pid);
- if (_ret) {
- json = U.MD.UI.BTree.jsonDelete(json, objects.pid);
- var _id = U.selectEl("#" + objects.pid)[0];
- if (_id) { _id.parentNode.remove(); }
- if (i == 1) {
- U.MD.UI.BTree.DirectoryCreate(U.MD.UI.BTree.JsonSelect(json, objects.parentid), tree, mulu, jsonpid, jsondelete, jsonupdate, jsonadd, deteurl, upurl, 1, 2);
- }
- if (i == 2) {
- U.MD.UI.BTree.DirectoryCreate(U.MD.UI.BTree.JsonSelect(json, objects.parentid), tree, mulu, jsonpid, jsondelete, jsonupdate, jsonadd, deteurl, upurl, 2);
- }
- if (i == 0) {
- U.MD.UI.BTree.DirectoryCreate(json, tree, mulu, jsonpid, jsondelete, jsonupdate, jsonadd, deteurl, upurl, 0);
- }
- }
- },
- function (objects, tree, mulu, jsonpid, jsondelete, jsonupdate, jsonadd, deteurl, upurl, i) {
- var _ret = jsonUpdateFun(U.MD.UI.BTree.jsonSelectA(json, objects.pid));
- json = U.MD.UI.BTree.jsonUpdate(json, _ret);
- var _id = U.selectEl("#" + objects.pid)[0];
- if (_id) {
- _id.childNodes[0].src = _ret.img_url;
- _id.childNodes[1].innerHTML = _ret.name;
- }
- if (i == 1) {
- U.MD.UI.BTree.DirectoryCreate(U.MD.UI.BTree.JsonSelect(json, objects.parentid), tree, mulu, jsonpid, jsondelete, jsonupdate, jsonadd, deteurl, upurl, 1, 2);
- }
- if (i == 2) {
- U.MD.UI.BTree.DirectoryCreate(U.MD.UI.BTree.JsonSelect(json, objects.parentid), tree, mulu, jsonpid, jsondelete, jsonupdate, jsonadd, deteurl, upurl, 2);
- }
- if (i == 0) {
- U.MD.UI.BTree.DirectoryCreate(json, tree, mulu, jsonpid, jsondelete, jsonupdate, jsonadd, deteurl, upurl, 0);
- }
- },
- function (objects, tree, mulu, jsonpid, jsondelete, jsonupdate, jsonadd, deteurl, upurl, i) {
- var _json = {};
- _json.parentID = objects.parentNode.parentID;
- _json.deep = objects.parentNode.deep;
- var _ret = jsonInsertFun(_json);
- var _post;
- if (_ret) {
- _post = U.selectEl(".U_MD_UI_Tree_a")[1];
- if (_post) {
- if (_ret.parentID == 0) {
- _post = U.selectEl(".U_MD_UI_Tree_a")[0].parentNode;
- } else {
- _post = U.selectEl("#" + _ret.parentID)[0].parentNode;
- }
- _js = [];
- _js[0] = _ret;
- U.MD.UI.BTree.treeCreate(_js, _post, bookfun);
- }
- json = U.MD.UI.BTree.jsonAdd(json, _ret);
- if (i == 1) {
- U.MD.UI.BTree.DirectoryCreate(U.MD.UI.BTree.JsonSelect(json, _json.parentID), tree, mulu, jsonpid, jsondelete, jsonupdate, jsonadd, deteurl, upurl, 1, 2);
- }
- if (i == 2) {
- U.MD.UI.BTree.DirectoryCreate(U.MD.UI.BTree.JsonSelect(json, _json.parentID), tree, mulu, jsonpid, jsondelete, jsonupdate, jsonadd, deteurl, upurl, 2);
- }
- if (i == 0) {
- U.MD.UI.BTree.DirectoryCreate(json, tree, mulu, jsonpid, jsondelete, jsonupdate, jsonadd, deteurl, upurl, 0);
- }
- }
- }, deteimg, upimg, 0);
- }
- }
- U.MD.UI.BTree.jsonStartLeft = function (arr, tree, bookfun) {
- json = [];
- var _json = arr;
- for (var _i = 0; _i < _json.length; _i++) {
- U.MD.UI.BTree.jsonAdd(json, _json[_i]);
- }
- tree.innerHTML = "";
- U.MD.UI.BTree.treeCreate(json, tree, bookfun);
- }
- U.MD.UI.BTree.jsonDelete = function (json, pid) {
- for (var _i = 0; _i < json.length; _i++) {
- if (json[_i].id == pid) {
- json.splice(_i, 1);
- return json;
- } else {
- if (json[_i].child) {
- json[_i].child = U.MD.UI.BTree.jsonDelete(json[_i].child, pid);
- }
- }
- }
- return json;
- }
- U.MD.UI.BTree.jsonSelectA = function (json, id) {
- for (var _i = 0; _i < json.length; _i++) {
- if (json[_i].id == id) {
- return json[_i];
- }
- if (json[_i].child) {
- var _return = U.MD.UI.BTree.jsonSelectA(json[_i].child, id);
- if (_return) {
- return _return;
- }
- }
- }
- return false;
- }
- U.MD.UI.BTree.jsonUpdate = function (json, upjson) {
- for (var _i = 0; _i < json.length; _i++) {
- if (json[_i].id == upjson.id) {
- json[_i] = upjson;
- return json;
- }
- if (json[_i].child) {
- var _return = U.MD.UI.BTree.jsonUpdate(json[_i].child, upjson);
- if (_return) {
- json[_i].child = _return;
- return json;
- }
- }
- }
- return false;
- }
- U.MD.UI.BTree.createID = function (arr) {
- var _return = 0;
- for (var _i = 0; _i < arr.length; _i++) {
- if (parseInt(arr[_i].id) > _return) {
- _return = parseInt(arr[_i].id);
- }
- }
- return _return;
- };
- Namespace.register("U.MD.UI.editor");
- U.MD.UI.Editor = U.MD.UI.editor = function (parent, callback) {
- U.UF.DL.asynLoadCss({ "rel": "stylesheet", "type": "text/css", "href": "/css/Controls/Complex/Editor.css" });
-
-
-
-
- U.MD.UI.editor.createEditor(parent);
-
- U.UF.E.initEditor($('.editor', parent)[0], callback);
-
- U.MD.UI.editor.EditorEventBind(parent);
-
- U.MD.UI.editor.operateJson.editor = U.selectEl('.editor', parent)[0];
-
- return U.MD.UI.editor.operateJson;
-
- }
- U.MD.UI.editor.operateJson = {
-
- loadContent: function (text) {
- this.editor.focus();
- U.UF.E.onpaste(null, this.editor, text);
-
-
-
-
-
-
-
-
-
- },
-
- getContent: function () {
- return this.editor.innerHTML;
-
- }
- };
- U.MD.UI.editor.createEditor = function (parent) {
- parent.innerHTML =
- "<div class='toolbar' style=\"width: 788px;background-color: #f5f5f5;border: 1px solid #c7d3e1;line-height: 0;padding: 6px;height: 25px;\">\n" +
- " <button class=\"last\" style=\"float: left;margin: 0 3px;position: relative;outline: none;cursor: pointer;border: 1px solid transparent;height: 25px;width: 25px;background: url('/EditorImage/left.png') no-repeat center;\">\n" +
- " </button>\n" +
- " <button class=\"future\" style=\"float: left;margin: 0 3px;position: relative;outline: none;cursor: pointer;border: 1px solid transparent;height: 25px;width: 25px;background: url('/EditorImage/right.png') no-repeat center;\">\n" +
- " </button>\n" +
- " <i style=\"display: inline-block;width: 1px;height: 22px;background-color: #bcbcbc;float: left;margin: 0 3px;position: relative;\">\n" +
- "\n" +
- " </i>\n" +
- "<div class='setFont' style='float: left;margin: 0 3px;position: relative;padding:0px'></div>" +
- " <i style=\"display: inline-block;width: 1px;height: 22px;background-color: #bcbcbc;float: left;margin: 0 3px;position: relative;\">\n" +
- "\n" +
- " </i>\n" +
- "<div class='setSize' style='float: left;margin: 0 3px;position: relative;padding:0px'></div>" +
- " <i style=\"display: inline-block;width: 1px;height: 22px;background-color: #bcbcbc;float: left;margin: 0 3px;position: relative;\">\n" +
- "\n" +
- " </i>\n" +
- " <label style=\"float: left;margin: 0 3px;position: relative;\">\n" +
- " <button class=\"pic\" style=\"outline: none;cursor: pointer;border: 1px solid transparent;height: 25px;width: 25px;background: url('/EditorImage/pic.png') no-repeat center;\">\n" +
- " </button>\n" +
- " <input multiple accept='image/*' type='file' class='picUpload' style='display: none;' />\n" +
- " </label>\n" +
- " <label style=\"float: left;margin: 0 3px;position: relative;\">\n" +
- " <button class=\"attachment\" style=\"outline: none;cursor: pointer;border: 1px solid transparent;width: 25px;height: 25px;background: url(/img/YS2017.png) no-repeat;background-position: -1054px -593.5px;\"></button>\n" +
- " <input multiple=\"\" type=\"file\" class=\"attachmentUpload\" style=\"display: none;\">\n" +
- " </label>\n" +
- " <i style=\"display: inline-block;width: 1px;height: 22px;background-color: #bcbcbc;float: left;margin: 0 3px;position: relative;\">\n" +
- "\n" +
- " </i>\n" +
- " <div style=\"float: left;margin: 0 3px;position: relative;padding:0px\">\n" +
- " <button class=\"fontColor\" style=\"outline: none;cursor: pointer;border: 1px solid transparent;height: 25px;width: 25px;background: url('/EditorImage/fontColor.png') no-repeat center;\">\n" +
- " </button>\n" +
- " <div class='fontColorBar colorBar' style='display:none;position: absolute;'>\n" +
- " </div>\n" +
- " </div>\n" +
- " <i style=\"display: inline-block;width: 1px;height: 22px;background-color: #bcbcbc;float: left;margin: 0 3px;position: relative;\">\n" +
- "\n" +
- " </i>\n" +
- " <div style=\"float: left;margin: 0 3px;position: relative;padding:0px\">\n" +
- " <button class=\"backgroundColor\" style=\"outline: none;cursor: pointer;border: 1px solid transparent;height: 25px;width: 25px;background: url('/EditorImage/blockColor.png') no-repeat center;\">\n" +
- " </button>\n" +
- " <div class='backgroundColorBar colorBar' style='display:none;position: absolute;'>\n" +
- " </div>\n" +
- " </div>\n" +
- " <i style=\"display: inline-block;width: 1px;height: 22px;background-color: #bcbcbc;float: left;margin: 0 3px;position: relative;\">\n" +
- "\n" +
- " </i>\n" +
- " <button class=\"bIcon\" style=\"float: left;margin: 0 3px;position: relative;outline: none;cursor: pointer;border: 1px solid transparent;height: 25px;width: 25px;background: url('/EditorImage/strong.png') no-repeat center;\">\n" +
- " </button>\n" +
- " <button class=\"iIcon\" style=\"float: left;margin: 0 3px;position: relative;outline: none;cursor: pointer;border: 1px solid transparent;height: 25px;width: 25px;background: url('/EditorImage/i.png') no-repeat center;\">\n" +
- " </button>\n" +
- " <button class=\"UIcon\" style=\"float: left;margin: 0 3px;position: relative;outline: none;cursor: pointer;border: 1px solid transparent;height: 25px;width: 25px;background: url('/EditorImage/x.png') no-repeat center;\">\n" +
- " </button>\n" +
- " <button class=\"SIcon\" style=\"float: left;margin: 0 3px;position: relative;outline: none;cursor: pointer;border: 1px solid transparent;height: 25px;width: 25px;background: url('/EditorImage/-S-.png') no-repeat center;\">\n" +
- " </button>\n" +
- " <i style=\"display: inline-block;width: 1px;height: 22px;background-color: #bcbcbc;float: left;margin: 0 3px;position: relative;\">\n" +
- "\n" +
- " </i>\n" +
- " <button class=\"textLeft\" style=\"float: left;margin: 0 3px;position: relative;outline: none;cursor: pointer;border: 1px solid transparent;height: 25px;width: 25px;background: url('/EditorImage/textLeft.png') no-repeat center;\">\n" +
- " </button>\n" +
- " <button class=\"textCenter\" style=\"float: left;margin: 0 3px;position: relative;outline: none;cursor: pointer;border: 1px solid transparent;height: 25px;width: 25px;background: url('/EditorImage/textCenter.png') no-repeat center;\">\n" +
- " </button>\n" +
- " <button class=\"textRight\" style=\"float: left;margin: 0 3px;position: relative;outline: none;cursor: pointer;border: 1px solid transparent;height: 25px;width: 25px;background: url('/EditorImage/textRight.png') no-repeat center;\">\n" +
- " </button>\n" +
- " <i style=\"display: inline-block;width: 1px;height: 22px;background-color: #bcbcbc;float: left;margin: 0 3px;position: relative;\" >\n" +
- "\n" +
- " </i>\n" +
- " <button class=\"a\" style=\"float: left;margin: 0 3px;position: relative;outline: none;cursor: pointer;border: 1px solid transparent;height: 25px;width: 25px;background: url('/EditorImage/a.png') no-repeat center;\">\n" +
- " </button>\n" +
- " <button class=\"b\" style=\"float: left;margin: 0 3px;position: relative;outline: none;cursor: pointer;border: 1px solid transparent;height: 25px;width: 25px;background: url('/EditorImage/b.png') no-repeat center;\">\n" +
- " </button>\n" +
- " <button class=\"c\" style=\"float: left;margin: 0 3px;position: relative;outline: none;cursor: pointer;border: 1px solid transparent;height: 25px;width: 25px;background: url('/EditorImage/c.png') no-repeat center;\">\n" +
- " </button>\n" +
- " </div>\n" +
- " <div class=\"editor\" contenteditable=\"true\" style=\"width: 800px;min-height: 300px;border: 1px solid #E6E5E5;overflow: auto;\">\n" +
- " </div>";
- U.selectEl('input.picUpload[type="file"]', parent)[0].onchange = function () {
- U.UF.E.picture(this, U.selectEl('.editor', parent)[0])
- }
- U.selectEl('input.attachmentUpload[type="file"]', parent)[0].onchange = function () {
- U.UF.E.attachment(this, U.selectEl('.editor', parent)[0])
- }
- };
- U.MD.UI.editor.EditorEventBind = function (parent) {
-
-
-
- var _font = U.MD.UI.Font();
-
- _font.style.cssText += "vertical-align: super;";
- var _size = U.MD.UI.WordSize();
-
- _size.style.cssText += "vertical-align: super;";
- U.selectEl('.setFont', parent).append(_font);
- _font.onchange = function () {
- U.UF.E.setRangeStyle({ 'font-family': _font.value });
- };
-
- U.selectEl('.setSize', parent).append(_size);
- _size.onchange = function () {
- U.UF.E.setRangeStyle({ 'font-size': _size.value });
- };
-
- U.selectEl('.pic', parent)[0].onclick = function () {
- U.selectEl('.picUpload', parent)[0].click();
- };
-
- U.selectEl('.attachment', parent)[0].onclick = function () {
- U.selectEl('.attachmentUpload', parent)[0].click();
- };
-
- U.selectEl('.bIcon', parent)[0].onclick = function () {
- U.UF.E.setRangeStyle({ 'font-weight': 'bold' });
- };
-
- U.selectEl('.iIcon', parent)[0].onclick = function () {
- U.UF.E.setRangeStyle({ 'font-style': 'italic' });
- };
-
- U.selectEl('.UIcon', parent)[0].onclick = function () {
- U.UF.E.setRangeStyle({ 'text-decoration': 'underline' });
- };
-
- U.selectEl('.SIcon', parent)[0].onclick = function () {
- U.UF.E.setRangeStyle({ 'text-decoration': 'line-through' });
- };
-
- U.selectEl('.fontColor', parent).bind('click', function () {
-
- if ($('.fontColorBar', parent).css('display') == "none") {
- U.MD.UI.colorPicker($('.fontColorBar', parent)[0], function (r) {
- U.selectEl('.MD_ColorPicker', U.selectEl('.fontColorBar', parent)[0]).remove();
- U.selectEl('.fontColorBar', parent).hide();
- U.UF.E.setRangeStyle({ 'color': r });
- });
- U.selectEl('.fontColorBar', parent).show();
- }
- });
- U.selectEl('.backgroundColor', parent).bind('click', function () {
-
- if ($('.backgroundColorBar', parent).css('display') == "none") {
- U.MD.UI.colorPicker($('.backgroundColorBar', parent)[0], function (r) {
- U.selectEl('.MD_ColorPicker', U.selectEl('.backgroundColorBar', parent)[0]).remove();
- U.selectEl('.backgroundColorBar', parent).hide();
- U.UF.E.setRangeStyle({ 'backgroundColor': r });
- });
- U.selectEl('.backgroundColorBar', parent).show();
- }
- });
-
-
-
-
-
-
-
-
-
-
-
- U.selectEl('.a', parent).bind('click', function () {
- U.UF.E.addHref();
- });
-
- U.selectEl('.c', parent).bind('click', function () {
- U.UF.E.clearStyle(U.UF.E.getRangeAt());
- });
-
- U.selectEl('.textLeft', parent).bind('click', function () {
- U.UF.E.setLineStyle({ 'text-align': 'left' });
- });
-
- U.selectEl('.textCenter', parent).bind('click', function () {
- U.UF.E.setLineStyle({ 'text-align': 'center' });
- });
-
- U.selectEl('.textRight', parent).bind('click', function () {
- U.UF.E.setLineStyle({ 'text-align': 'right' });
- });
-
- };
- U.MD.UI.editor.Select = function (choosecon, selattr, optionevent, parentnode) {
- var _id = "";
- selattr.id && (_id = selattr.id) && (delete selattr.id);
- var _selectEl = $$('div', { id: _id }, parentnode || null),
- _value = $$('div', selattr, _selectEl),
- _textarea = $$('div', {}, _value);
- $$('div', { style: { cssText: 'border-width: 6px 4px; border-style: solid; border-color: rgb(166, 178, 192) transparent transparent; width: 0; position: absolute; right: 4px; top: 50%; margin-top: -3px' } }, _value);
-
- var _con = $$('div', {
- datacontent: '',
- style: { cssText: 'display: none;position: absolute; margin-top:-1px; min-width: 100%; max-width: 280px; max-height: 200px ;border: 1px solid silver; overflow-x: hidden; cursor: pointer;' }
- }, _selectEl),
- _range;
-
-
-
-
-
- (selattr.style && !selattr.style.position) ? _selectEl.style.position = 'relative' : '';
- (selattr.style && !selattr.style.textIndent) ? _textarea.style.textIndent = '6px' : '';
-
- _textarea.style.whiteSpace = 'pre';
- _textarea.style.overflow = 'hidden'
- _textarea.style.width = _selectEl.offsetWidth - 15 + "px";
- for (var i in choosecon) {
- $$('div', {
- value: i, innerText: choosecon[i],
- style: { cssText: 'padding: 4px 6px; background: #fff' },
- onmouseover: function () {
- this.style.background = '#ccc'
- },
- onmouseout: function () {
- this.style.background = '#fff'
- }, onclick: function () {
- _textarea.innerText = this.innerText;
- U.UF.E.reSelectRange(_range)
- optionevent(this.value || this.innerText);
- }
- }, _con);
- }
- for (var i in choosecon) {
- _textarea.innerText = choosecon[i];
- break;
- }
- _textarea.style.lineHeight = parseInt(_textarea.style.height) + 'px';
- _selectEl.onclick = function () {
- var _el = this.querySelector('div[datacontent]');
- U.UF.E.reSelectRange(_range)
- _el.style.display === 'block' ? _el.style.display = 'none' : _el.style.display = 'block';
- };
- U.selectEl(document).bind('click', function () {
- if (_con.style.display != 'none')
- _con.style.display = 'none'
- if ($(".BD_BorderPicker")[0]) {
- if ($(".BD_BorderPicker")[0].style.display != 'none')
- U.selectEl(".BD_BorderPicker")[0].style.display = 'none'
- }
- }, false);
- U.selectEl(_selectEl).bind('click', function (e) {
- U.UF.EV.stopBubble(e);
-
- });
- _selectEl.onmousedown = function () {
- _range = U.UF.E.getRangeAt()
- }
- return _selectEl;
- };
- ;
- Namespace.register("U.MD.UI.excel");;
- Namespace.register("U.MD.R");
- U.MD.R.data = {
- PID: "",
- AID: "",
- URL: "",
- PageIndex: 1,
- PageSize: 20,
- AllCount: "",
- CB: null
- }
- U.MD.R.reply = function (obj) {
-
-
- U.MD.R.login.cookieLogin(function () {
- var _type = obj.type,
- _el = obj.el,
- _cb = obj.cb;
- U.MD.R.data.PID = obj.pid;
- U.MD.R.data.AID = U.MD.R.reply.getUrlHash();
- U.MD.R.data.URL = U.MD.R.reply.getUrl();
- U.MD.R.data.CB = _cb;
-
- if (!_type) {
- _el = new U.UF.UI.form('', $$("div"), {
- "style": {
- "width": "800px",
- "height": "800px"
- }
- }).content;
- }
- U.MD.R.reply.init(_el);
- U.UF.DL.asynLoadCss({
- "href": "/css/Controls/Basic/Picture.css",
- type: "text/css",
- rel: "stylesheet"
- });
- U.UF.DL.asynLoadJs({ type: "text/javascript", src: "/js/Controls/Basic/Picture.js" });
- });
- }
- U.MD.R.reply.init = function (el) {
- var _pageindex = U.MD.R.data.PageIndex,
- _pagesize = U.MD.R.data.PageSize;
- U.MD.R.initPrintHtml(el);
- U.MD.R.getReplyData(_pageindex, _pagesize, function (data) {
- U.MD.R.data.AllCount = data[0][0] ? Math.ceil(data[0][0].allcount / U.MD.R.data.PageSize) : "";
- U.MD.R.printComment($("#U_MD_R_content_user_comment")[0], 1, data, false, false, false);
- U.MD.R.initLoadMoreBtn(data[0]);
- });
- }
- U.MD.R.reply.getUrl = function () {
- return window.location.href;
- }
- U.MD.R.reply.getUrlHash = function () {
- return U.UF.EC.SparkMD5.hash(window.location.href);
- }
- U.MD.R.getReplyData = function (pageindex, pagesize, cb) {
- U.A.Request("http://cd.1473.cn/php", ["db.1473.cn", "UseStudio_Reply", "test", U.MD.R.data.AID, "1", "", pageindex, pagesize], function (r) {
- cb && cb(r.value);
- });
- }
- U.MD.R.initPrintHtml = function (el) {
- var _el = el,
- _comment,
- _content,
- _content_operation,
- _userhead,
- _headimg,
- _operation,
- _username,
- _editorbox,
- _bottom,
- _picturewarp,
- _picture,
- _clear,
- _emoji_frame,
- _input,
- _button,
- _img_warp,
- _box;
- _comment = $$("div", { "className": "U_MD_R_comment" }, _el);
- _content = $$("div", { "className": "U_MD_R_content" }, _comment);
- _content_operation = $$("div", { "className": "U_MD_R_content_operation" }, _content);
- _userhead = $$("div", { className: "U_MD_R_content_operation_userhead U_MD_R_Reply_Header" }, _content_operation);
- _headimg = $$("img", {
- "className": "img",
- "src": "/img/UserHead/UseHead.jpg",
- "onerror": function () { this.src = '/img/UserHead/UseHead.jpg' }
- }, _userhead);
- _operation = $$("div", {
- "className": "U_MD_R_content_operation_right",
- style: { width: "calc(100% - 40px - 20px )" }
- }, _content_operation);
- U.selectEl(_operation).attr({
- "data-RPID": null,
- "data-RD": 1,
- "data-RPUID": null
- });
- _username = $$("div", {
- "innerHTML": "登录/注册",
- "className": "U_MD_R_content_operation_userlogin U_MD_R_Reply_Name"
- }, _operation);
-
- if (US.userInfo.userid) {
- _username.innerHTML = US.userInfo.username;
- _headimg.src = 'http://fs.1473.cn/' + US.userInfo.UserThumbnailImageHead;
- }
- else {
- _username.onclick = function () {
- U.MD.R.login();
- }
- }
- _editorbox = $$("div", {
- "id": "editorbox",
- "className": "U_MD_R_Reply_Content",
- "contenteditable": "true",
- "style": { "min-height": "100px", "background": "#fff", "border": "1px solid black" }
- }, _operation)
- var _scrolltop = document.documentElement.scrollTop;
- U.UF.E.initEditor(_editorbox);
- document.documentElement.scrollTop = _scrolltop;
- _bottom = $$("div", { "className": "U_MD_R_content_operation_right_bottom" }, _operation);
- $$("div", {
- "className": "U_MD_R_content_operation_right_bottom_emoji",
- "onclick": function () {
- U.UF.EV.stopBubble();
- U.MD.UI.face(this, U.selectEl('#editorbox')[0]);
-
-
- U.selectEl("#U_MD_UI_face").css({ "position": "relative", "height": "140px", "overflow-y": "scroll", "top": "-150px", "width": "450px", "display": "block" });
- }
- }, _bottom);
- _picturewarp = $$("div", { "className": "U_MD_R_content_operation_right_bottom_picturewarp" }, _bottom);
- _picture = $$("img", { src: "/img/reply/img.png" }, _picturewarp);
- _input = $$("input", { "type": "file" }, _picturewarp);
- _button = $$("div", {
- "className": "U_MD_R_content_operation_right_bottom_release",
- "innerHTML": "发表评论"
- }, _bottom);
- _button.onclick = function () {
- if ($(".U_MD_R_Reply_Content")[0].textContent != '' || U.selectEl(".U_MD_R_Reply_Content")[0].innerHTML != '') {
- U.MD.R.release(_operation, 1, false, 1);
- } else {
- U.alert("评论不能为空!");
- }
- }
- _img_warp = $$("div", { "className": "U_MD_R_content_operation_right_bottom_imgloadbox U_MD_R_Reply_Image" }, _operation);
- _box = $$("div", { "className": "U_MD_R_content_comment", "id": "U_MD_R_content_user_comment" }, _content);
- _input.onchange = function () {
- U.MD.R.uploadImages(this, _img_warp);
- }
- U.MD.R.data.CB && U.MD.R.data.CB();
- }
- U.MD.R.initLoadMoreBtn = function (data) {
- var _btn = $$("div", { "className": "U_MD_R_content_loading" }, U.selectEl(".U_MD_R_comment")[0]);
- if (data.length > 0) {
- if (U.MD.R.data.PageIndex < U.MD.R.data.AllCount) {
- _btn.innerHTML = "点击加载更多评论";
- _btn.onclick = function () {
- var _pageindex = ++U.MD.R.data.PageIndex,
- _pagesize = U.MD.R.data.PageSize;
- if (U.MD.R.data.PageIndex <= U.MD.R.data.AllCount) {
- U.MD.R.getReplyData(_pageindex, _pagesize, function (data) {
- U.MD.R.data.AllCount = Math.ceil(data[0][0].allcount / U.MD.R.data.PageSize);
- U.MD.R.printComment($("#U_MD_R_content_user_comment")[0], 1, data, false, false, false);
- });
- }
- else {
- U.selectEl(_btn).hide();
- }
- }
- }
- }
- else {
-
- }
- }
- U.MD.R.printComment = function (el, type, data, appendtype, isreply, readmore) {
- var _count = U.A.Request("http://cd.1473.cn/php", ["db.1473.cn", "UseStudio_Reply", "Reply_SelectTypeReplyEnable", U.MD.R.data.PID]);
- if (_count.value[0].ProjectReplyEnable == 1) {
- var _el = el,
- _type = type,
- _data = data,
- _appendtype = appendtype,
- _isreply = isreply,
- _readmore = readmore,
- _shownum;
- for (var i = 0; i < data[0].length; i++) {
- if (readmore) {
- _shownum = data[0][i].TopReplyNum;
- }
- else {
- _shownum = U.Json.select(_data[2], { ReplyID: _data[0][i].ReplyID }).length > 0 ? U.Json.select(_data[2], { ReplyID: _data[0][i].ReplyID })[0].AllReplyNum : "0";
- }
- U.MD.R.printCommentHtml(_el, _type, {
- rid: _data[0][i].ReplyID,
- rpid: _data[0][i].ReplyParentID,
- deep: _data[0][i].ReplyDeep,
- topid: _data[0][i].ReplyID,
- uid: _data[0][i].UserID,
- un: _data[0][i].UserName,
- tx: _data[0][i].ReplyUserThumbnailImageHead,
- time: _data[0][i].ReplyAddTime,
- content: _data[0][i].ReplyContent,
- shownum: _shownum,
- likesnum: _type == 2 ? U.Json.select(_data[4], { ReplyID: _data[0][i].ReplyID })[0] : U.Json.select(_data[1], { ReplyID: _data[0][i].ReplyID })[0]
- }, _appendtype, _isreply, _readmore);
- }
- } else {
- var _btn = $$("div", { "className": "U_MD_R_content_loading" }, U.selectEl(".U_MD_R_comment")[0]);
- _btn.innerHTML = "该评论系统已关闭";
- U.selectEl("#U_MD_R_content_loading")[0].innerHTML = '';
- }
- }
- U.MD.R.viewComment = function (rid, type) {
- if (US.userInfo.userid) {
- var
- _rid = rid,
- _form,
- _data,
- _firstbox,
- _secondbox,
- _thirdbox,
- _type = type;
- _form = new U.UF.UI.form('', $$("div", { "style": { "padding": "20px" } }), {
- "style": {
- "width": "800px",
- "height": "600px"
- }
- });
- U.A.Request("http://cd.1473.cn/php", ["db.1473.cn", "UseStudio_Reply", "Reply_SelectThisReply", _rid], function (r) {
- _data = r.value;
- U.MD.R.printComment(_form.content, 2, _data, true, true, true);
- if (_type) {
- U.selectEl(_form.content).find(".U_MD_R_content_box_content_edit").show();
- }
- _firstbox = $$("div", { "className": "U_MD_R_content_warp_box" }, _form.content);
-
- for (var i = 0; i < _data[1].length; i++) {
- _secondbox = U.MD.R.printCommentHtml(_firstbox, 2, {
- rid: _data[1][i].ReplyID,
- rpid: _data[1][i].ReplyParentID,
- deep: _data[1][i].ReplyDeep,
- topid: _data[1][i].ReplyTopID,
- uid: _data[1][i].UserID,
- tx: _data[1][i].ReplyUserThumbnailImageHead,
- un: _data[1][i].UserName,
- time: _data[1][i].ReplyAddTime,
- content: _data[1][i].ReplyContent,
- likesnum: U.Json.select(_data[3], { ReplyID: _data[1][i].ReplyID })[0]
- }, false, true, true);
-
- _thirdbox = $$("div", { "className": "U_MD_R_content_warp_box" }, _secondbox);
- U.selectEl(_thirdbox).attr({ "data-replyid": _data[1][i].ReplyID });
- for (var j = 0; j < _data[2].length; j++) {
- if (_data[1][i].ReplyID == _data[2][j].ReplyParentID) {
- U.MD.R.printCommentHtml(_thirdbox, 3, {
- rid: _data[2][j].ReplyID,
- rpid: _data[2][j].ReplyParentID,
- deep: _data[2][j].ReplyDeep,
- topid: _data[2][j].ReplyTopID,
- uid: _data[2][j].UserID,
- tx: _data[2][j].ReplyUserThumbnailImageHead,
- un: _data[2][j].UserName,
- time: _data[2][j].ReplyAddTime,
- content: _data[2][j].ReplyContent,
- likesnum: U.Json.select(_data[3], { ReplyID: _data[2][j].ReplyID })[0],
- replyinfo: {
- uid: _data[2][j].uid,
- un: _data[2][j].un,
- tx: _data[2][j].tx
- }
- }, false, true, true);
- }
- }
- }
- });
- }
- else {
- U.Alert("请先登录");
- }
- }
- U.MD.R.printCommentHtml = function (el, type, data, appendtype, isreply, readmore) {
- var _data = data,
- _el = el,
- _type = type,
-
-
- _rid = _data.rid,
- _rpid = _data.rpid,
- _deep = _data.deep,
- _topid = _data.topid,
- _uid = _data.uid,
- _tx = _data.tx,
- _un = _data.un,
- _time = _data.time,
- _datacontent = _data.content,
- _likesnumjson = _data.likesnum,
- _showmoretxtjson = _data.shownum,
- _replyinfo_uid = _data.replyinfo ? _data.replyinfo.uid : "",
- _replyinfo_un = _data.replyinfo ? _data.replyinfo.un : "",
- _replyinfo_tx = _data.replyinfo ? _data.replyinfo.tx : "",
- _appendtype = appendtype,
- _isreply = isreply,
- _readmore = readmore,
- _box,
- _info,
- _head,
- _headimg,
- _content,
- _content_top,
- _username,
- _commenttime,
- _text,
- _content_bottom,
- _likeswarp,
- _likesimg,
- _likesnum,
- _replywarp,
- _showmorewarp,
- _showmoretext,
- _position,
- _contenteditable,
- _bottom,
- _picturewarp,
- _picture,
- _input,
- _button,
- _img_warp,
- _childrenbox;
- _box = $$("div", { "className": "U_MD_R_content_box" });
- if (_appendtype) {
- U.selectEl(_el).append(_box, 0, U.selectEl(_el)[0].firstChild);
- }
- else {
- U.selectEl(_el).append(_box);
- }
- _info = $$("div", { "className": "U_MD_R_content_box_warp" }, _box);
- U.selectEl(_info).attr({
- "data-rid": _rid,
- "data-RPID": _rpid,
- "data-RD": _deep,
- "data-RBID": _topid,
- "data-RPUID": _uid
- });
- _head = $$("div", { "className": "U_MD_R_content_box_userhead" }, _info);
- _headimg = $$("img", {
- "src": _tx,
- onerror: "U.MD.R.imgError(this)"
- }, _head);
- _content = $$("div", {
- "className": "U_MD_R_content_box_content",
- style: { width: "calc(100% - 40px - 20px )" }
- }, _info);
- _content_top = $$("div", { "className": "U_MD_R_content_box_content_top" }, _content);
- _username = $$("div", {
- "className": "U_MD_R_content_box_content_top_name",
- "innerHTML": _un
- }, _content_top);
- if (_type == 3) {
- _username.innerHTML = _un + '回复@' + _replyinfo_un;
- }
- _commenttime = $$("div", {
- "className": "U_MD_R_content_box_content_top_time",
- "innerHTML": _time
- }, _content_top);
- _text = $$("div", { "className": "U_MD_R_content_box_content_text", "innerHTML": _datacontent }, _content);
- if ($(_text).find("img").length > 0) {
- U.selectEl(_text).find("img")[0].onclick = function () {
-
- U.MD.UI.picture([this.src], 0);
- U.selectEl("#U_MD_UI_PictureForm").css("position", "fixed");
- U.UF.F.topWindow($('#U_MD_UI_PictureForm')[0], true);
- }
- }
- _content_bottom = $$("div", { "className": "U_MD_R_content_box_content_bottom" }, _content);
- _likeswarp = $$("div", { "className": "U_MD_R_content_box_content_bottom_likeswarp" }, _content_bottom);
- _likeswarp.onclick = function () {
- U.MD.R.like(this, _rid, US.userInfo.userid);
- }
- _likesimg = $$("img", { "src": "/img/reply/NOFabulous.png" }, _likeswarp);
- _likesnum = $$("div", {
- "className": "U_MD_R_content_box_content_bottom_likeswarp_text",
- "innerHTML": 0
- }, _likeswarp);
- if (_likesnumjson) {
- _likesnum.innerHTML = _likesnumjson.ReplyNum;
- U.A.Request("http://cd.1473.cn/net", ["db.1473.cn", "UseStudio_Reply", "Reply_SelectRepeatLikes_Moblie", _rid, US.userInfo.userid], function (r) {
- if (r.value[0].mode == 1) {
- _likesimg.src = "/img/reply/NOFabulous.png";
- } else if (r.value[0].mode == 0) {
- _likesimg.src = "/img/reply/Fabulous.png";
- } else {
- _likesimg.src = "/img/reply/NOFabulous.png";
- }
- })
-
- }
- _replywarp = $$("div", { "className": "U_MD_R_content_box_content_bottom_replywarp" }, _content_bottom);
- if (_readmore) {
- _replywarp.onclick = function () {
- U.MD.R.subsetReply(this);
- }
- }
- else {
- _replywarp.onclick = function () {
- U.MD.R.viewComment(_rid, true);
- }
- }
- $$("img", {
- "src": "/img/reply/reply.png"
- }, _replywarp);
- $$("div", {
- "innerHTML": "回复",
- "className": "U_MD_R_content_box_content_bottom_replywarp_text"
- }, _replywarp);
- if (_type == 1) {
- _showmorewarp = $$("div", { "className": "U_MD_R_content_box_content_bottom_showmorewarp" }, _content_bottom);
- $$("img", {
- "src": "/img/reply/list.png"
- }, _showmorewarp);
- _showmoretext = $$("div", {
- "className": "U_MD_R_content_box_content_bottom_showmore_text"
- }, _showmorewarp);
- if (_readmore) {
- _showmoretext.className = "U_MD_R_content_box_content_bottom_showmore_text U_MD_R_content_box_content_bottom_showmore_text_secondary"
- _showmoretext.innerHTML = _showmoretxtjson ? "共有(" + "<span>" + _showmoretxtjson + "</span>" + ")条评论" : "没有评论(" + "<span>0</span>" + ")";
- }
- else {
- _showmoretext.className = "U_MD_R_content_box_content_bottom_showmore_text U_MD_R_content_box_content_bottom_showmore_text_important"
- _showmoretext.innerHTML = _showmoretxtjson ? "查看更多(" + "<span>" + _showmoretxtjson + "</span>" + ")" : "查看更多(" + "<span>" + 0 + "</span>" + ")";
- _showmorewarp.onclick = function () {
- U.MD.R.viewComment(_rid, false);
- }
- }
- }
- if (_type == 1 && !readmore && U.selectEl(".U_MD_R_content_loading")[0]) {
- if (U.MD.R.data.PageIndex < U.MD.R.data.AllCount) {
- U.selectEl(".U_MD_R_content_loading")[0].innerHTML = "点击加载更多评论";
- }
- else {
- U.selectEl(".U_MD_R_content_loading").hide();
- }
- }
- if (_type == 2 || _type == 3 || (_type == 1 && readmore)) {
- _contenteditable = $$("div", {
- "className": "U_MD_R_content_box_content_edit",
- "style": { "display": "none" }
- }, _content);
- _replyinput = $$("div", { "className": "U_MD_R_Reply_Content", "contenteditable": "true" }, _contenteditable);
- _bottom = $$("div", { "className": "U_MD_R_content_operation_right_bottom" }, _contenteditable);
- $$("div", {
- "className": "U_MD_R_content_operation_right_bottom_emoji",
- "onclick": function () {
- U.UF.EV.stopBubble();
- U.MD.UI.face(this, _replyinput);
- U.selectEl(this)[0].append($("#U_MD_UI_face")[0]);
- U.selectEl("#U_MD_UI_face").css({ "position": "relative", "height": "140px", "overflow-y": "scroll", "top": "-150px", "width": "450px", "display": "block" });
- }
- }, _bottom);
- _picturewarp = $$("div", { "className": "U_MD_R_content_operation_right_bottom_picturewarp" }, _bottom);
- _picture = $$("img", { src: "/img/reply/img.png" }, _picturewarp);
- _input = $$("input", { "type": "file" }, _picturewarp);
- _input.onchange = function () {
- U.MD.R.uploadImages(this, _img_warp);
- }
- _button = $$("div", {
- "className": "U_MD_R_content_operation_right_bottom_release",
- "innerHTML": "发表评论"
- }, _bottom);
- _button.onclick = function () {
- if (_type == 1) {
- _position = 2;
- }
- else if (_type == 2) {
- _position = 3;
- }
- else if (_type == 3) {
- _position = 4;
- }
- U.MD.R.release(_info, _type, false, _position);
- }
- _img_warp = $$("div", { "className": "U_MD_R_content_operation_right_bottom_imgloadbox U_MD_R_Reply_Image" }, _contenteditable);
- if (_type != 3) {
- _childrenbox = $$("div", { "className": "U_MD_R_content_comment" }, _box);
- }
- return _childrenbox;
- }
- }
- U.MD.R.uploadImages = function (input, el) {
- var _el = el, _imgwarp, _img, _filetype, _imgtype = /.*(jpg|png|gif|jpeg|JPG|PNG|GIF|JPEG)$/;
- U.selectEl(_el)[0].innerHTML = "";
- _imgwarp = $$("div", {}, _el);
- _img = $$("img", {
- "src": "/img/Reply/loading.gif",
- "style": { "width": "100px", "height": "100px", "margin-right": "10px" }
- }, _imgwarp);
- U.UF.UP.inputUpload([input], "http://disk.1473.cn/USUpfile.ashx?typename=UseStudioEditor&UserId=FA92AAC5-4134-449F-9659-0DC12F4F68E9", function (r) {
- _filetype = r.value[0].split(".")[1];
- if (_filetype.match(_imgtype)) {
- U.selectEl(_imgwarp).remove();
- _imgwarp = $$("div", { "className": "U_MD_R_content_operation_right_bottom_imgloadbox_warp" }, _el);
- $$("img", { "src": "http://fs.1473.cn/" + r.value[0] }, _imgwarp);
- $$("div", { "className": "closebtn", "onclick": "U.MD.R.uploadImages.close(this)" }, _imgwarp);
- U.alert("上传成功");
- } else {
- U.alert("请上传图片文件");
- return;
- }
- }, []);
- }
- U.MD.R.uploadImages.close = function (el) {
- U.selectEl(el).Parent().remove();
- }
- U.MD.R.subsetReply = function (el) {
-
- var _el = U.selectEl($(el).Parent(2)).find(".U_MD_R_content_box_content_edit");
- if (_el[0].style.display == "block") {
- _el.hide();
- }
- else {
- _el.show();
- }
- }
- U.MD.R.release = function (el, type, isreply, position) {
- if (US.userInfo.userid) {
- var _el = el,
- _type = type,
- _isreply = isreply,
- _position = position,
- _content = U.selectEl(_el).find(".U_MD_R_Reply_Content")[0],
- _imgwarp = U.selectEl(_el).find(".U_MD_R_Reply_Image"),
- _uid = US.userInfo.userid,
- _un = US.userInfo.username,
- _utx = "http://fs.1473.cn/" + US.userInfo.UserImageHead,
- _box;
- if (_content.innerHTML.trim() != "" || _imgwarp.find("img").length > 0) {
- var _rid = Guid.newGuid(),
- _rpid = U.selectEl(el).attr("data-rid"),
- _pid = U.MD.R.data.PID,
- _aid = U.MD.R.data.AID,
- _rc = "",
- _rip = US.userInfo.RegisterIP,
- _url = U.MD.R.data.URL,
- _ra = null,
- _rd = U.selectEl(el).attr("data-rd"),
- _rbid = U.selectEl(el).attr("data-rbid"),
- _rpuid = U.selectEl(el).attr("data-rpuid"),
- _re = 1;
- if (position == 1) {
- _rd = 1;
- }
- else if (position == 2 || position == 3) {
- _rd = parseInt($(el).attr("data-rd")) + 1;
- }
- else {
- _rd = 3;
- _rpid = U.selectEl(el).attr("data-rpid");
- }
- if ($(_imgwarp).find("img").length > 0) {
- _rc = _content.innerHTML.trim() + _imgwarp.find("img")[0].outerHTML;
- }
- else {
- _rc = _content.innerHTML;
- }
- U.A.Request("http://cd.1473.cn/net", ["db.1473.cn", "UseStudio_Reply", "Reply_InsertReply", _rid, _rpid, _pid, _aid, _uid, _un, _utx, _rc, _rip, _url, _ra, _rd, _rpuid, _re, U.MD.R.getNowFormatDate()], function (r) {
- var _data = r.value[0], _appendtype, _readmore,
- _more = U.selectEl("div[data-rid='" + _data.ReplyParentID + "']").find(".U_MD_R_content_box_content_bottom_showmore_text_important span")[0],
- _more1 = U.selectEl("div[data-rid='" + _data.ReplyParentID + "']").find(".U_MD_R_content_box_content_bottom_showmore_text_secondary span")[0];
- U.selectEl(_el).find(".U_MD_R_Reply_Content")[0].innerHTML = "";
- U.UF.E.initEditor($(_el).find(".U_MD_R_Reply_Content")[0]);
- U.selectEl(_el).find(".U_MD_R_Reply_Image")[0].innerHTML = "";
- if (_position == 1) {
- _readmore = false;
- _appendtype = true;
- _el = U.selectEl("#U_MD_R_content_user_comment")[0];
- }
- else {
- _readmore = true;
- _val = _more.innerText;
-
- if (_position == 2) {
- _el = U.selectEl(_el).Parent().nextSibling;
- _type = 2;
- _appendtype = true;
- }
- if (_position == 3) {
- if ($($(_el)[0].nextSibling).find(".U_MD_R_content_warp_box").length > 0) {
- _el = U.selectEl($(_el)[0].nextSibling).find(".U_MD_R_content_warp_box");
- }
- else {
- _el = $$("div", { "className": "U_MD_R_content_warp_box" }, U.selectEl($(_el)[0].nextSibling)[0]);
-
- }
- _type = 2;
- }
- if (_position == 4) {
- _el = U.selectEl($(_el).Parent()).Parent();
- _type = 3;
- }
- _more.innerText = ++_val;
-
- U.selectEl($(_content).Parent()).hide();
- }
- var _box = U.MD.R.printCommentHtml(_el, _type, {
- rid: _data.ReplyID,
- rpid: _data.ReplyParentID,
- deep: _data.ReplyDeep,
- topid: _data.ReplyTopID,
- uid: _data.UserID,
- tx: _data.ReplyUserThumbnailImageHead,
- un: _data.UserName,
- time: U.MD.R.getNowFormatDate() + '.0',
- content: _data.ReplyContent,
- replyinfo: {
- uid: _data.uid,
- un: _data.un,
- tx: _data.tx
- }
- }, _appendtype, _isreply, _readmore);
-
-
-
-
- U.alert("评论成功");
- }
- );
- }
- else {
- U.alert("请输入评论内容");
- }
- }
- else {
- U.Alert("请先登录");
- }
- }
- U.MD.R.like = function (e, rid, uid) {
- if (US.userInfo.userid) {
- var _el = e, _rid = rid, _uid = uid;
- U.A.Request("http://cd.1473.cn/net", ["db.1473.cn", "UseStudio_Reply", "Reply_SelectRepeatLikes", _rid, _uid], function (r) {
- var _img = U.selectEl(_el).find("img")[0],
- _text = U.selectEl(_el).find(".U_MD_R_content_box_content_bottom_likeswarp_text")[0],
- _val = parseInt(_text.innerHTML);
- if (r.value[0].mode == 0) {
- _img.src = "/img/reply/NOFabulous.png";
- _text.innerHTML = --_val;
- }
- else {
- _img.src = "/img/reply/Fabulous.png";
- _text.innerHTML = ++_val;
- }
- });
- }
- else {
- U.Alert("请先登录");
- }
- }
- U.MD.R.imgError = function (el) {
- U.selectEl(el)[0].src = "/img/UserHead/UseHead.jpg";
- }
- U.MD.R.login = function () {
- if ($("#U_MD_HomeC_Pop")[0]) {
- U.UF.F.windowTopCenter($("#U_MD_HomeC_Pop")[0]);
- }
- else {
- U.UF.CD.loadPageCrossDomain(function () { });
- U.MD.U.L.setLoginCallBack(function () {
- U.MD.R.login.cb();
- });
- }
- }
- U.MD.R.login.cookieLogin = function (cb) {
- if (U.UF.Cookie.get("usestudiosso") && U.UF.Cookie.get("usestudiosso", "userid")[0]) {
- U.UF.CD.loadPageCrossDomain(function () {
- U.MD.U.L.loginCallBack = function () {
- cb && cb();
- U.selectEl(".U_MD_R_content_operation_userhead img")[0].src = 'http://fs.1473.cn/' + US.userInfo.UserThumbnailImageHead;
- U.selectEl(".U_MD_R_content_operation_userlogin")[0].innerHTML = US.userInfo.username;
- }
- });
- } else {
- cb && cb();
- }
- }
- U.MD.R.login.cb = function () {
- U.selectEl(".U_MD_R_content_operation_userhead img")[0].src = 'http://fs.1473.cn/' + US.userInfo.UserThumbnailImageHead;
- U.selectEl(".U_MD_R_content_operation_userlogin")[0].innerHTML = US.userInfo.username;
- }
- U.MD.R.getNowFormatDate = function () {
- var date = new Date();
- var seperator1 = "-";
- var seperator2 = ":";
- var month = date.getMonth() + 1;
- var strDate = date.getDate();
- if (month >= 1 && month <= 9) {
- month = "0" + month;
- }
- if (strDate >= 0 && strDate <= 9) {
- strDate = "0" + strDate;
- }
- var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate
- + " " + date.getHours() + seperator2 + date.getMinutes()
- + seperator2 + date.getSeconds();
- return currentdate;
- }
- ;
- Namespace.register("U.MD.UI.table");
- U.MD.UI.table = function (datasource, titles, css, parent) {
- U.MD.UI.table.thead(datasource, titles, css, parent);
-
- }
- U.MD.UI.table.thead = function (datasource, titles, css, parent, index, prows) {
- if (!index) {
-
- index = 1;
-
- prows = datasource.length;
- }
- var _table, _thead, _tr, _tbody;
-
- _table = $$("table", {
- style: {
- "text-align": "center",
- "position": "relative",
- "width": " 100%",
- "border-collapse": " collapse",
- "border-width": " 1px",
- "border-style": " solid",
- "border-color": " rgb(213, 213, 213)",
- "border-image": " initial",
- "display": "table"
- }
- }, parent);
-
- _thead = $$("thead", {}, _table);
-
- _tr = $$("tr", {}, _thead);
-
- for (var num in titles) {
-
- if (typeof titles[num] === "object") {
-
- $$("th", {
- innerHTML: titles[num].name, style: {
- "cssText": css[num],
- "padding": "10px 0",
- "font-weight": "normal",
- "border": "1px solid #d5d5d5"
- }, id: "th"
- }, _tr);
-
- } else {
- $$("th", {
- innerHTML: titles[num], style: {
- "cssText": css[num],
- "padding": "10px 0",
- "font-weight": "normal",
- "border": "1px solid #d5d5d5"
- }, id: "th"
- }, _tr);
-
- }
- }
- _tbody = $$("tbody", { style: { cssText: "width:100%;" }, id: "tbody" }, _table);
-
- U.MD.UI.table.tbody(_tbody, datasource, titles, css, index, prows);
-
- return _tbody;
-
- }
- U.MD.UI.table.tbody = function (parent, datasource, titles, css, index, prows) {
- var _tr, _td, _div, _neirong;
-
- for (var num = (index - 1) * prows; num < index * prows && num < datasource.length; num++) {
-
- if (num % 2 != 0) {
-
- _tr = $$("tr", { style: { cssText: "background-color: #FFF;" }, id: "tr" }, parent);
-
- } else {
- _tr = $$("tr", { style: { cssText: "background-color: #dde4ee;" }, id: "tr" }, parent);
-
- }
- for (var name in titles) {
-
- _td = $$("td", { id: "td" }, _tr);
-
- if (titles[name].content) {
- for (var k = 0; k < titles[name].content.length; k++) {
-
- _div = U.MD.UI.table.printDiv(_td, titles[name].content[k]);
-
- if (titles[name].content[k].onclick) {
- U.MD.UI.table.onclick(_div, datasource[num], titles[name].content[k].onclick);
- }
-
- }
- } else {
- _div = $$("div", { innerHTML: datasource[num][name], style: { "overflow": "hidden", "cssText": css[name] } }, _td);
- if (titles[name].id) {
- _div.id = datasource[num][titles[name].id];
- }
- }
- }
- }
- }
- U.MD.UI.table.pageTable = function (datasource, titles, css, prows, index, parent) {
- var _div = $$("div", {
- "style": {
- "left": "0px",
- "right": "0px",
- "width": "100%",
- "margin": "0 auto",
- "top": "200px"
- }
- }, parent);
-
- var _tdiv = $$("div", {}, _div);
-
- var _tbody = U.MD.UI.table.thead(datasource, titles, css, _tdiv, index, prows);
-
- var _pdiv = $$("div", { "style": { "width": "650px", "margin": "20px auto 0 auto" } }, _div);
- new U.UF.P.page(_pdiv, datasource.length, prows, index, function (page) {
-
- U.MD.UI.table.delChild(_tbody);
-
- U.MD.UI.table.tbody(_tbody, datasource, titles, css, page, prows);
-
- });
- }
- U.MD.UI.table.delChild = function (obj) {
- for (var num = obj.children.length - 1; num >= 0; num--) {
-
- obj.removeChild(obj.children[num])
-
- }
- }
- U.MD.UI.table.onclick = function (obj, datasource, fun) {
- obj.onclick = function () {
-
- fun(datasource);
- }
- }
- U.MD.UI.table.printDiv = function (parent, content) {
- var _div;
-
- if (typeof content.name == "string") {
-
- _div = $$("div", { "innerHTML": content.name }, parent);
- }
-
- if (typeof content.name == "object") {
-
- var _dd = content.name.cloneNode(true);
- parent.appendChild(_dd);
- _div = _dd;
- }
- return _div;
- };
- Namespace.register("U.MD.UI.Tree");
- U.MD.UI.Tree = function (arr, treeaction, bookfun, leftfun) {
- json = [];
- var _json = arr;
- for (var _i = 0; _i < _json.length; _i++) {
- U.MD.UI.Tree.jsonAdd(json, _json[_i]);
- }
- treeaction.innerHTML = "";
- U.MD.UI.Tree.treeCreate(json, treeaction, bookfun);
- treeaction.oncontextmenu = function (e) {
- e.preventDefault();
- };
- treeaction.onmousedown = function (e) {
- if (e.button == 2) {
- leftfun(e, bookfun);
- }
- }
- }
- U.MD.UI.Tree.treeCreate = function (json, tree, onclickfun) {
- for (var _i = 0; _i < json.length; _i++) {
- var _ul = $$("ul", { className: "U_MD_UI_Tree_a " + json[_i].parentID }, tree);
- var _li = $$("li", { id: json[_i].id, parentid: json[_i].parentid, className: "U_MD_UI_Tree_listyle", parentid: json[_i].id, deep: json[_i].deep }, _ul);
- var _img = $$("img", { "onerror": U.MD.C.imgError, src: json[_i].img_url, className: "U_MD_UI_Tree_imgstyle" }, _li);
- var _span = $$("span", { innerHTML: json[_i].name, className: "spanstyle" }, _li);
- _ul.style.display = "none";
- if (json[_i].deep == "1") { _ul.style.display = "block" }
- _img.aa = false;
- var _liobj = document.getElementsByClassName("U_MD_UI_Tree_a " + json[_i].parentID)[0];
- _ul.style.display = _liobj.style.display;
- _li.onclick = function () {
- onclickfun(this);
- _liobj = document.getElementsByClassName("U_MD_UI_Tree_a " + this.parentid);
- if (_img.aa === true) {
- _img.aa = false;
- for (var _ii = 0; _ii < _liobj.length; _ii++) {
- _liobj[_ii].style.display = "none";
- }
- } else {
- _img.aa = true;
- for (var _ii = 0; _ii < _liobj.length; _ii++) {
- _liobj[_ii].style.display = "block";
- }
- }
- }
- if (json[_i].child) {
- U.MD.UI.Tree.treeCreate(json[_i].child, _ul, onclickfun);
- }
- }
- }
- U.MD.UI.Tree.jsonAdd = function (json, addjson) {
- var _addid = addjson.parentID;
- if (_addid == "0") {
- json[json.length] = addjson;
- return json;
- }
- for (var _i = 0; _i < json.length; _i++) {
- if (json[_i].id == _addid) {
- if (json[_i].child) {
- json[_i].child[json[_i].child.length] = addjson;
- return json;
- } else {
- json[_i].child = [];
- json[_i].child[json[_i].child.length] = addjson;
- return json;
- }
- }
- if (json[_i].child) {
- var _return = U.MD.UI.Tree.jsonAdd(json[_i].child, addjson);
- json[_i].child = _return;
- }
- }
- return json;
- }
- U.MD.UI.Tree.rightOnclick = function (rightButton, e) {
- var _li = $$("li", { className: "U_MD_UI_Tree_rightli", innerHTML: "新建文件夹", parentid: e.path[1].parentid, deep: parseInt(e.path[1].deep) + 1 }, rightButton);
- var _li1 = $$("li", { className: "U_MD_UI_Tree_rightli", innerHTML: "重命名", parentid: e.path[1].parentid, deep: parseInt(e.path[1].deep) + 1 }, rightButton);
- var _li2 = $$("li", { className: "U_MD_UI_Tree_rightli", innerHTML: "删除", parentid: e.path[1].parentid, deep: parseInt(e.path[1].deep + 1) }, rightButton);
- var _return = [];
- _return[0] = _li;
- _return[1] = _li1;
- _return[2] = _li2;
- return _return;
- }
- U.MD.UI.Tree.createID = function (arr) {
- var _return = 0;
- for (var _i = 0; _i < arr.length; _i++) {
- if (parseInt(arr[_i].id) > _return) {
- _return = parseInt(arr[_i].id);
- }
- }
- return _return;
- }
- ;
- Namespace.register("U.MD.UI.txt");;
- ;
|