| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897 | 
							- Namespace.register("U.MD.R");
 
- /**
 
- * 评论控件全局变量
 
- * PID // 项目id,请查看api文档说明,找到你所在项目的id。
 
- * AID // 对应的文章id,获取url网址的主机,加上url网址的目录,形成的文章id。
 
- * URL // 文章对应的url地址。
 
- * PageIndex // 当前页数
 
- * PageSize // 一页请求数
 
- * AllCount // 此文章对应的有多少数据
 
- * */
 
- U.MD.R.data = {
 
-     PID: "",
 
-     AID: "",
 
-     URL: "",
 
-     PageIndex: 1,
 
-     PageSize: 20,
 
-     AllCount: "",
 
-     CB: null
 
- }
 
- /**
 
- * 评论控件初始化函数,调用函数
 
- * @param  {object} 参数。
 
- * obj={
 
- *      pid // 项目id,请查看api文档说明,找到你所在项目的id。
 
- *      type //引用方式为弹窗还是嵌入式,true 为嵌入式方式,false 为窗体。
 
- *      el // 评论控件追加的元素。注意:当控件为嵌入式时,才需要填写此参数,如果为弹窗时,不需要填写此参数。
 
- * }
 
- */
 
- U.MD.R.reply = function (obj) {
 
-     //alert();
 
-     //定义变量,获取调用方式、控件追加的元素、以及项目id。
 
-     var _type = obj.type,
 
-         _el = obj.el,
 
-         _cb = obj.cb;
 
-     U.MD.R.data.PID = obj.pid; //项目id全局设置
 
-     U.MD.R.data.AID = U.MD.R.reply.getUrlHash(); //文章id全局设置
 
-     U.MD.R.data.URL = U.MD.R.reply.getUrl(); //文章url全局设置
 
-     U.MD.R.data.CB = _cb;
 
-     //调用类型判断
 
-     if (!_type) {//如果调用方式是窗体,那么先创建一个窗体,并且重新更新变量_el的值。
 
-         _el = new U.UF.UI.form('', $$("div"), {
 
-             "style": {
 
-                 "width": "800px",
 
-                 "height": "800px"
 
-             }
 
-         }).content;
 
-     }
 
-     U.MD.R.reply.init(_el); //控件初始化
 
-     U.MD.R.login.cookieLogin();   //cookie自动登录
 
-     U.UF.DL.asynLoadCss({
 
-         "href": "/css/Controls/Basic/Picture.css",
 
-         type: "text/css",
 
-         rel: "stylesheet"
 
-     }); //动态添加css文件
 
-     U.UF.DL.asynLoadJs({ type: "text/javascript", src: "/js/Controls/Basic/Picture.js" });
 
- }
 
- /**
 
- * 评论控件初始化函数,调用函数
 
- * @param  {element} 追加元素
 
- */
 
- 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); //创建基础html
 
-     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) : ""; //取数完成之后进行将页数全局赋值给id。
 
-         U.MD.R.printComment($("#U_MD_R_content_user_comment")[0], 1, data, false, false, false); //打印数据
 
-         U.MD.R.initLoadMoreBtn(data[0]); //创建
 
-     });
 
- }
 
- /**
 
- * 获取url地址
 
- */
 
- U.MD.R.reply.getUrl = function () {
 
-     return window.location.href;
 
- }
 
- /**
 
- * 获取url网址的主机,加上url网址的目录
 
- */
 
- U.MD.R.reply.getUrlHash = function () {
 
-     return U.UF.EC.SparkMD5.hash(window.location.href);
 
- }
 
- /**
 
- * 获取评论数据
 
- * @param  {number} 页码数
 
- * @param  {number} 一页的请求量
 
- * @param  {function} 回调函数
 
- */
 
- 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); //执行回调函数,并且返回数据。
 
-     });
 
- }
 
- /**
 
- * 初始化创建回复元素
 
- * @param  {element} 追加元素
 
- */
 
- 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", {//创建头像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); //创建内容框架div
 
-     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]);
 
-             //$(this)[0].append($("#U_MD_UI_face")[0]);
 
-             //$(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); //上传
 
-     _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 {
 
-         // _btn.innerHTML = "还没有人评论";
 
-     }
 
- }
 
- /**
 
- * 打印一级评论
 
- * @param  {object} 评论数据
 
- * @param  {element} 追加元素
 
- * @param  {number} 用于判断层级而显示指定内容
 
- * @param  {boolean}元素插入类型
 
- * @param  {boolean} 是否需要回复功能,默认为false
 
- * @param  {boolean} 是否需要查看更多,用于区分设置查看更多类型
 
- */
 
- 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,     //评论id
 
-                 rpid: _data[0][i].ReplyParentID, //评论父级id
 
-                 deep: _data[0][i].ReplyDeep, //评论深度
 
-                 topid: _data[0][i].ReplyID, //评论顶级id
 
-                 uid: _data[0][i].UserID,    //评论用户id
 
-                 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 = '';
 
-     }
 
- }
 
- /**
 
- * 打印二级评论,用于区分用户点击回复或者查看更多。
 
- * @param  {sring} 评论id
 
- * @param  {boolean} 是否需要查看更多,用于区分设置查看更多类型
 
- */
 
- U.MD.R.viewComment = function (rid, type) {
 
-     if (US.userInfo.userid) {
 
-         var
 
-             _rid = rid, //父级id
 
-             _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) {//根据评论id,获取此评论,此评论点赞数,以及子目录下所有的评论还有点赞数
 
-             _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, //评论的用户id
 
-                                 un: _data[2][j].un, //评论的用户名
 
-                                 tx: _data[2][j].tx//评论的头像
 
-                             }
 
-                         }, false, true, true);
 
-                     }
 
-                 }
 
-             }
 
-         });
 
-     }
 
-     else {
 
-         U.Alert("请先登录");
 
-     }
 
- }
 
- /**
 
- * 打印评论数据内容
 
- * @param  {object} 评论数据
 
- * @param  {element} 追加元素
 
- * @param  {object} 用于判断层级而显示指定内容
 
- * object={
 
- *  rid,//评论id
 
- *  rpid,//评论父级id
 
- *  deep,//评论深度
 
- *  topid,//评论顶级id
 
- *  uid,//评论用户id
 
- *  un,//评论用户名
 
- *  tx,//评论用户头像
 
- *  time,//评论时间
 
- *  content,//评论内容
 
- *  likesnum,//评论点赞数
 
- *  shownum,//评论子集(所有子集)的评论数
 
- * }
 
- * @param  {boolean} 元素插入类型
 
- * @param  {boolean} 是否需要回复功能,默认为false
 
- * @param  {boolean} 是否需要查看更多,用于区分设置查看更多类型
 
- */
 
- U.MD.R.printCommentHtml = function (el, type, data, appendtype, isreply, readmore) {
 
-     var _data = data,
 
-         _el = el,
 
-         _type = type,
 
-         // _eltype = obj.eltype ? obj.eltype : false,
 
-         // _showmore = obj.showmore,
 
-         _rid = _data.rid, //评论id
 
-         _rpid = _data.rpid, //评论父级id
 
-         _deep = _data.deep,  //评论顶级id
 
-         _topid = _data.topid, //评论顶级id
 
-         _uid = _data.uid, //评论用户id
 
-         _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 : "", //评论的用户id
 
-         _replyinfo_un = _data.replyinfo ? _data.replyinfo.un : "", //评论的用户名
 
-         _replyinfo_tx = _data.replyinfo ? _data.replyinfo.tx : "", //评论的头像
 
-         _appendtype = appendtype, //评论插入的方式,如果为true,那么就插入到所有评论的第一个(用于以及评论和二级评论),如果为false,那么就插入到最后一个
 
-         _isreply = isreply, //点击回复按钮,是否是弹出回复框,还是弹出查看更多,默认为false,
 
-         _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, //创建子集评论-评论操作区域-上传input
 
-         _button, //创建子集评论-评论操作区域-发布按钮
 
-         _img_warp, //创建子集评论-评论操作区域-图片显示区域
 
-         _childrenbox; //用于存放子集评论
 
-     _box = $$("div", { "className": "U_MD_R_content_box" }); //创建内容盒子
 
-     if (_appendtype) { //判断插入类型是否为true,如果为true,那么就插入到所有评论的第一个(用于以及评论和二级评论),如果为false,那么就插入到最后一个
 
-         U.selectEl(_el).append(_box, 0, U.selectEl(_el)[0].firstChild);
 
-     }
 
-     else {//如果为false,那么就插入到最后一个
 
-         U.selectEl(_el).append(_box);
 
-     }
 
-     _info = $$("div", { "className": "U_MD_R_content_box_warp" }, _box); //创建信息div
 
-     U.selectEl(_info).attr({//给评论内层设置评论id、评论父级id、评论深度、评论顶级id、评论用户id。用于回复时获取信息。
 
-         "data-rid": _rid, //评论id
 
-         "data-RPID": _rpid, //评论父级id
 
-         "data-RD": _deep, //评论深度
 
-         "data-RBID": _topid, //评论顶级id
 
-         "data-RPUID": _uid//评论用户id
 
-     });
 
-     _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); //创建右侧div
 
-     _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, this.src, this.src], 2);
 
-             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) {//点击回复按钮,是否是弹出回复框,还是弹出查看更多,默认为false。如果为true,在元素下方显示出评论操作元素。
 
-         _replywarp.onclick = function () {
 
-             U.MD.R.subsetReply(this);
 
-         }
 
-     }
 
-     else {
 
-         _replywarp.onclick = function () {//如果为false,弹出一个窗体。
 
-             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) {//如果类型为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)) {//如果是2级和3级以下,那么就创建操作区域。
 
-         _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
 
-         _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; //返回元素
 
-     }
 
- }
 
- /**
 
- * 图片上传函数
 
- * @param  {element} input 元素
 
- * @param  {element} 上传成功后,图片插入的位置。
 
- */
 
- 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", {//创建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); //创建img
 
-             $$("div", { "className": "closebtn", "onclick": "U.MD.R.uploadImages.close(this)" }, _imgwarp);
 
-             U.alert("上传成功");
 
-         } else {//否则提醒用户选择上传图片文件
 
-             U.alert("请上传图片文件");
 
-             return;
 
-         }
 
-     }, []);
 
- }
 
- /**
 
- * 图片关闭函数
 
- * @param  {element} 事件源
 
- */
 
- U.MD.R.uploadImages.close = function (el) {
 
-     U.selectEl(el).Parent().remove();
 
- }
 
- /**
 
- * 二级以下(包括二级、三级等等)评论点击回复后显示隐藏操作区域
 
- * @param  {element} 事件源
 
- */
 
- U.MD.R.subsetReply = function (el) {
 
-     // U.selectEl(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]);
 
-                             //$(_el).attr({"data-replyid": _data[1][i].ReplyID});
 
-                         }
 
-                         _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, //评论的用户id
 
-                         un: _data.un, //评论的用户名
 
-                         tx: _data.tx//评论的头像
 
-                     }
 
-                 }, _appendtype, _isreply, _readmore);
 
-                 // if (_position == 3) {
 
-                 //     var _box1 = $$("div", {"className": "U_MD_R_content_warp_box"}, _box);
 
-                 //     U.selectEl(_box1).attr({"data-replyid": _data[1][i].ReplyID});
 
-                 // }
 
-                 U.alert("评论成功");
 
-             }
 
-             );
 
-         }
 
-         else {
 
-             U.alert("请输入评论内容");
 
-         }
 
-     }
 
-     else {
 
-         U.Alert("请先登录");
 
-     }
 
- }
 
- /**
 
- * 点赞函数
 
- * @param  {element} 事件源
 
- * @param  {string} 评论id
 
- * @param  {string} 用户id
 
- */
 
- 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("请先登录");
 
-     }
 
- }
 
- /**
 
- * 图片错误所执行的函数
 
- * @param  {element} 事件源
 
- */
 
- 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();
 
-         });
 
-     }
 
- }
 
- /**
 
- * cookie登录,如果登录成功,则修改头像以及用户名
 
- */
 
- 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;
 
- }
 
 
  |