123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897 |
- 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) {
-
-
- 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.MD.R.login.cookieLogin();
- 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,
- likesnum: U.Json.select(_data[1], { ReplyID: _data[0][i].ReplyID })[0],
- shownum: _shownum
- }, _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/net", ["db.1473.cn", "UseStudio_Reply", "Reply_SelectThisReply", _rid], function (r) {
- _data = r.value;
- U.MD.R.printComment(_form.content, 1, _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;
- _likesimg.src = "/img/reply/Fabulous.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/php", ["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.ReplyTopID + "']").find(".U_MD_R_content_box_content_bottom_showmore_text_important span")[0],
- _more1 = U.selectEl("div[data-rid='" + _data.ReplyTopID + "']").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;
- _val1 = _more1.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 = 3;
- }
- if (_position == 4) {
- _el = U.selectEl($(_el).Parent()).Parent();
- _type = 3;
- }
- _more.innerText = ++_val;
- _more1.innerText = ++_val1;
- 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: _data.ReplyAddTime,
- 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 () {
- if (U.UF.Cookie.get("usestudiosso") && U.UF.Cookie.get("usestudiosso", "userid")[0]) {
- U.UF.CD.loadPageCrossDomain(function () {
- U.MD.U.L.loginCallBack = function () {
- U.MD.R.login.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;
- }
|