// remote scripting library // (c) copyright 2005 modernmethod, inc // v2 modified by Tony poco.cn var sajax_debug_mode_19914929581751403385 = false; var sajax_request_type_19914929581751403385 = "POST"; function sajax_debug_19914929581751403385(text) { if (sajax_debug_mode_19914929581751403385) alert("RSD: " + text) } function sajax_init_object() { sajax_debug_19914929581751403385("sajax_init_object() called..") var A; try { A=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { A=new ActiveXObject("Microsoft.XMLHTTP"); } catch (oc) { A=null; } } if(!A && typeof XMLHttpRequest != "undefined") A = new XMLHttpRequest(); if (!A) sajax_debug_19914929581751403385("Could not create connection object."); return A; } function sajax_do_call_19914929581751403385(func_name, args) { var i, x, n; var uri; var post_data; uri = "/url_proxy.php?_t=0.42410900 15112317725a13911c678b53.41207094&__decoder=base64_decode&__url=aHR0cDovL2JqLmZvb2QucG9jby5jbi9jbXQvP3VybD1odHRwJTI1M0ElMjUyRiUyNTJGZm9vZC5wb2NvLmNuJTI1MkZjb21tZW5kRGV0YWlsLmh0eCUyNTI2aWQlMjUzRDkwMDc5MSZ0aXRsZT0tJUQ1JUY0JUIwJUQ3JUY2JUQ5JUQzJUUzJUJBJUNEJUMxJUY4JUNDJUY1JUQxJUYyJUM4JUUyJUI0JUFFLS0tJUM4JUU3JUNGJUM5JUI5JUM1JUMwJUY2JUI1JUM0JUQwJUMyJUJEJUFFJUMzJUMwJUNFJUI2JmF1dGhvcl9pZD01NTI5MTU5NCZhdXRob3JfbmFtZT1kYWdhaXh1ZXh1ZSZhbm9ueW1vdXM9MSZsaW1pdD0wLDgmdHBsX25hbWU9Y2hhbm5lbF92Mg=="; if (sajax_request_type_19914929581751403385 == "GET") { if (uri.indexOf("?") == -1) uri = uri + "?rs=" + escape(func_name); else uri = uri + "&rs=" + escape(func_name); for (i = 0; i < args.length-1; i++) uri = uri + "&rsargs[]=" + escape(args[i]); uri = uri + "&rsrnd=" + new Date().getTime(); post_data = null; } else { post_data = "rs=" + escape(func_name); for (i = 0; i < args.length-1; i++) post_data = post_data + "&rsargs[]=" + escape(args[i]); } if (sajax_request_type_19914929581751403385 == 'GET') { uri = uri + '&__cookie==EmO1ozezpTMyojIn91clN3cp9mbflGZiszc6MjM6ISNhZ2YxkjMidTOhljM2czM1gDO3MWZ4UDNxIjZ5ETYlJyOzpTMwojIzV2czl2bu9VakJyOOtzc6kjOi0WZtJWZy9VakJyOOtzc6kjOiAXYzN3XoF2coJyOOtzc6kjOiEmbv5GbvdWauJyOOtTf'; } else { post_data = post_data + '&__cookie==EmO1ozezpTMyojIn91clN3cp9mbflGZiszc6MjM6ISNhZ2YxkjMidTOhljM2czM1gDO3MWZ4UDNxIjZ5ETYlJyOzpTMwojIzV2czl2bu9VakJyOOtzc6kjOi0WZtJWZy9VakJyOOtzc6kjOiAXYzN3XoF2coJyOOtzc6kjOiEmbv5GbvdWauJyOOtTf'; } x = sajax_init_object(); x.open(sajax_request_type_19914929581751403385, uri, true); if (sajax_request_type_19914929581751403385 == "POST") { x.setRequestHeader("Method", "POST " + uri + " HTTP/1.1"); x.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); } x.onreadystatechange = function() { if (x.readyState != 4) return; sajax_debug_19914929581751403385("received " + x.responseText); var status; var data; status = x.responseText.charAt(0); data = x.responseText.substring(2); if (status == "-") alert("Error: " + data); else args[args.length-1](data); } x.send(post_data); sajax_debug_19914929581751403385(func_name + " uri = " + uri + "/post = " + post_data); sajax_debug_19914929581751403385(func_name + " waiting.."); delete x; } // wrapper for ajax_get_topic_id function x_ajax_get_topic_id() { sajax_do_call_19914929581751403385("ajax_get_topic_id", x_ajax_get_topic_id.arguments); } // wrapper for ajax_load_cmt function x_ajax_load_cmt() { sajax_do_call_19914929581751403385("ajax_load_cmt", x_ajax_load_cmt.arguments); } // wrapper for ajax_topic_post_cmt function x_ajax_topic_post_cmt() { sajax_do_call_19914929581751403385("ajax_topic_post_cmt", x_ajax_topic_post_cmt.arguments); } // wrapper for ajax_delete_cmt function x_ajax_delete_cmt() { sajax_do_call_19914929581751403385("ajax_delete_cmt", x_ajax_delete_cmt.arguments); } // wrapper for ajax_get_user_img_by_label_id function x_ajax_get_user_img_by_label_id() { sajax_do_call_19914929581751403385("ajax_get_user_img_by_label_id", x_ajax_get_user_img_by_label_id.arguments); } // wrapper for ajax_cmt_act_vote function x_ajax_cmt_act_vote() { sajax_do_call_19914929581751403385("ajax_cmt_act_vote", x_ajax_cmt_act_vote.arguments); } // wrapper for ajax_get_cmt_user_last_act function x_ajax_get_cmt_user_last_act() { sajax_do_call_19914929581751403385("ajax_get_cmt_user_last_act", x_ajax_get_cmt_user_last_act.arguments); } var obj_css = document.createElement('link'); obj_css.rel = "stylesheet"; obj_css.type='text/css'; obj_css.href='http://www.poco.cn/module_common/cmt/css/cmt_list.css?ver=201403061423'; document.body.insertBefore(obj_css,document.body.lastChild); var obj_script = document.createElement('script'); obj_script.type='text/javascript'; obj_script.defer=false; obj_script.src='http://www.poco.cn/module_common/cmt/js/convert_ubb.v2.js'; document.body.insertBefore(obj_script,document.body.lastChild); var obj_script = document.createElement('script'); obj_script.type='text/javascript'; obj_script.defer=false; obj_script.src='http://www.poco.cn/module_common/cmt/js/convert_ibf_emoticons.js'; document.body.insertBefore(obj_script,document.body.lastChild); // 撤广告时注释掉 BEGIN var obj_script = document.createElement('script'); obj_script.type='text/javascript'; obj_script.defer=true; obj_script.src='http://my.poco.cn/cmt/cmt_shading.js.php'; document.body.insertBefore(obj_script,document.body.lastChild); // 撤广告时注释掉 END if( !__getCookie('cmt_hash') ) { var __expdate = new Date(); var __root_domain=document.domain; var ii=__root_domain.lastIndexOf('.'); if(ii>0) { if(!isNaN(__root_domain.substr(ii+1)*1)) __root_domain = ''; ii=__root_domain.lastIndexOf('.',ii-1); if(ii>0) __root_domain = __root_domain.substr(ii+1); } __expdate.setTime(__expdate.getTime() + ( 3600*24*365 * 1000 )); __cookie_str = 'cmt_hash='+escape('916379247')+'; expires='+__expdate.toGMTString()+' ;path=/'; if(__root_domain){ __cookie_str += '; domain=.'+__root_domain; } document.cookie = __cookie_str; } function __getCookieVal(offset){ var endstr = document.cookie.indexOf(';', offset); if(endstr == -1){ endstr = document.cookie.length; } return unescape(document.cookie.substring(offset, endstr)); } function __getCookie(name){ var arg = name + '='; var alen = arg.length; var clen = document.cookie.length; var i = 0; while(i < clen){ var j = i + alen; if(document.cookie.substring(i, j) == arg){ return __getCookieVal(j); } i = document.cookie.indexOf(' ', i) + 1; if(i == 0){ break; } } return ''; } var __cmt_tag_2f320303a9b0fa82f3514169e427ca89 = document.getElementById('_cmt_tag_'); __cmt_tag_2f320303a9b0fa82f3514169e427ca89.innerHTML= '
正在加载评论系统...
'; function __alert_topic_id() { alert(__cmt_topic_id_2f320303a9b0fa82f3514169e427ca89); } function __copy_topic_id() { window.clipboardData.setData('Text','http://my.poco.cn/cmt-cmt_topic-htx-topic_id-'+__cmt_topic_id_2f320303a9b0fa82f3514169e427ca89+'-mypoco_style-0-tpl_name-.shtml'); alert('已复制链接:http://my.poco.cn/cmt-cmt_topic-htx-topic_id-'+__cmt_topic_id_2f320303a9b0fa82f3514169e427ca89+'-mypoco_style-0-tpl_name-.shtml'); } var __cmt_topic_id_2f320303a9b0fa82f3514169e427ca89 = 0; function __cmt_indexOf(arr, item) { return Array.prototype.indexOf ? arr.indexOf(item) : (function(){ var len = arr.length; while(len--) { if (arr[len] === item) { return len; } } return -1; })(); } function __cmt_hasClass(target, className) { if (target.nodeType !== 1) { return false; } var rclass = /[\t\r\n]/g; if (__cmt_indexOf(target.className.replace(rclass, ' ').split(' '), className) > -1) { return true; } return false; } function __cmt_addClass(elem, value) { if (elem.nodeType !== 1 || !value || typeof value !== 'string') { return false; } var core_rspace = /\s+/, classNames = value.split(core_rspace); if (!elem.className && classNames.length === 1) { elem.className = value; } else { var setClass = elem.className.split(' '), c = 0, cl = classNames.length; for (; c < cl; c++) { !~elem.className.indexOf(classNames[c]) && setClass.push(classNames[c]); } elem.className = setClass.join(' '); } } function __cmt_removeClass(elem, value) { if (elem.nodeType !== 1 || !value || typeof value !== 'string') { return false; } var setClass = [], core_rspace = /\s+/, classNames = elem.className.split(core_rspace), c = 0, cl = classNames.length; for (; c < cl; c++) { classNames[c] !== value && setClass.push(classNames[c]); } elem.className = setClass.join(' '); } function __cmt_toggleClass(elem, value) { return __cmt_hasClass(elem, value) ? __cmt_addClass(elem, value) : __cmt_removeClass(elem, value); } function __cmt_contains(parentNode, childNode) { if (parentNode.contains) { return parentNode != childNode && parentNode.contains(childNode); } else { return !!(parentNode.compareDocumentPosition(childNode) & 16); } } function __cmt_parentNode(node, className) { while(node) { if (node.nodeType === 1 && __cmt_hasClass(node, className)) { return node; } node = node.parentNode; } return null; } var g_lastRelatedTarget; function __cmt_commentMouseEvent(event) { var target = event.target || event.srcElement, type =event.type, relatedTarget = event.relatedTarget ? event.relatedTarget : ((event.type == 'mouseover') ? event.fromElement : event.toElement), isMouseEnter = false, commentContent = this; if (commentContent == target || __cmt_contains(commentContent, target)) { while (relatedTarget && relatedTarget !== commentContent) { if (__cmt_hasClass(relatedTarget, 'reply_list_item') && (__cmt_hasClass(target, 'reply_list_item') || __cmt_parentNode(target, 'reply_list_item'))) { isMouseEnter = true; break; } if (__cmt_hasClass(relatedTarget, 'cmt_list')) { isMouseEnter = true; break; } relatedTarget = relatedTarget.parentNode; } if (isMouseEnter) { __cmt_addClass(relatedTarget, 'hover'); g_lastRelatedTarget && g_lastRelatedTarget != relatedTarget && __cmt_removeClass(g_lastRelatedTarget, 'hover'); g_lastRelatedTarget = relatedTarget; } else { g_lastRelatedTarget && __cmt_removeClass(g_lastRelatedTarget, 'hover'); } } } function __cmt_bindCommentEvent() { var commentEl = document.getElementById('comment'); if (commentEl.addEventListener) { commentEl.addEventListener('mouseover', __cmt_commentMouseEvent, false); commentEl.addEventListener('mouseout', __cmt_commentMouseEvent, false); } else if (commentEl.attachEvent) { commentEl.attachEvent('onmouseover', __cmt_commentMouseEvent); commentEl.attachEvent('onmouseout', __cmt_commentMouseEvent); } } function __cmt_setup_seajs_config() { seajs.config({ paths: { utility: 'http://cb.poco.cn/utility', matcha: 'http://cb.poco.cn/matcha', poco: 'http://cb.poco.cn/poco' }, alias: { '$': 'utility/jquery/1.11.0/jquery', '$-debug': 'utility/jquery/1.11.0/jquery-debug', 'jquery': 'utility/jquery/1.11.0/jquery', 'jquery-debug': 'utility/jquery/1.11.0/jquery-debug' }, charset: 'utf-8' }); } function __cmt_setup_usercard() { seajs.use('poco/user/usercard/1.1.8/usercard', function(UserCard) { if(UserCard) { UserCard.setup({ trigger: 'a[role="usercard"]', delegateNode: '#comment' }); } }); } function __load_cmt_on_load_2f320303a9b0fa82f3514169e427ca89(data) { if (__cmt_tag_2f320303a9b0fa82f3514169e427ca89) { var str = data; if (str.indexOf('')!=0) { str='网络错误,加载失败!'; } __cmt_tag_2f320303a9b0fa82f3514169e427ca89.innerHTML = str; if(typeof(cmt_shading_gb_if_use_cmt_showMsgBox)=='number') { cmt_shading_onload(); } if(typeof(__load_cmt_on_load_callback)=='function') { __load_cmt_on_load_callback(); } __cmt_bindCommentEvent(); window.clearTimeout(__cmt_init_timeout); cmt_contents_original = new Array(); setTimeout("_CmtPaserUBB();", 500); setTimeout("_CmtPaserUBB();", 2000); setTimeout("_CmtPaserUBB();", 5000); // var isIE = (window.navigator.userAgent || '').toLowerCase().indexOf('msie') !== -1; // if (!isIE || readCookie('member_id') == 52118133 || !!window.___usercard) { if (!window.seajs) { __cmt_getScript('http://cb.poco.cn/seajs/??2.1.1/sea.js,plugins/seajs-text/1.0.2/seajs-text.js,plugins/seajs-style/1.0.2/seajs-style.js,plugins/seajs-combo/1.0.1/seajs-combo.js', { callback:function() { __cmt_setup_seajs_config(); __cmt_setup_usercard(); } }); } else { __cmt_setup_usercard(); } //} if (typeof verifiedUserObj != 'undefined') { setTimeout("verifiedUserObj.bindElementEvent('#_cmt_tag_ em');", 500); setTimeout("verifiedUserObj.bindElementEvent('#_cmt_tag_ em');", 2000); setTimeout("verifiedUserObj.bindElementEvent('#_cmt_tag_ em');", 5000); } else if (typeof verifiedUserObj == 'undefined' && typeof verifiedUserClass != 'undefined') { var verifiedUserObj = new verifiedUserClass({ showTime:300, selectTagName:['#_cmt_tag_ em'] }); } else if (typeof verifiedUserObj == 'undefined' && typeof verifiedUserClass == 'undefined') { __cmt_getScript('http://www.poco.cn/js_common/??common/pocoVerifiedUse.js&201204111213', { callback:function(){ window.verifiedUserObj = new verifiedUserClass({ showTime:300, selectTagName:['#_cmt_tag_ em'] }); } }); } //if(typeof MooTools!=='undefined') if (typeof MooTools != 'undefined' && typeof pocoClass != 'undefined' && typeof cmt_athow_hidden == 'undefined') { if($('__cmt_post_btn') && !$('cmt_icon_athow') && login_id!=="0") { var cmt_athow_icon=new Element('div'); cmt_athow_icon.id='cmt_icon_athow'; //alert($('cmt_face_icon_onclick')) cmt_athow_icon.injectAfter($('__cmt_post_btn').parentNode) if(typeof iconAthow==='undefined'){ __cmt_getScript('http://www.poco.cn/js_common/mootools/mt_more/iconAthow.js', { callback:function(){ window.newIconAthow=new iconAthow(); if($('new_cmt_content')){ $('cmt_icon_athow').textarea=$('new_cmt_content'); window.newIconAthow.addBind($('cmt_icon_athow')); } } }) } else { if(typeof window.newIconAthow==='undefined'){ window.newIconAthow=new iconAthow();} $('cmt_icon_athow').textarea=$('new_cmt_content') window.newIconAthow.addBind($('cmt_icon_athow')) } $('__cmt_post_btn').addEvent('click', function(){ if($('athow_friend_list')){ $('athow_friend_list').style.display='none';} }) } if(typeof textareaTips==='undefined'){ __cmt_getScript('http://www.poco.cn/js_common/mootools/mt_more/athow.js', { callback:function(){ if(!window.athow) { window.athow=new textareaTips({containers:'#new_cmt_content'}); } else { window.athow.add_container('#new_cmt_content') } } }) } else { if(!window.athow) { window.athow=new textareaTips({containers:'#new_cmt_content'}); } else { window.athow.add_container('#new_cmt_content') } } } if($('anonymousName') && $('anonymousName').value!='') { document.getElementById('anonymous').checked = true; use_anonymous(0); } } else { alert('找不到cmt_tag: _cmt_tag_'); } } /** * 无阻塞加载 JavaScript 文件 * * getScript(url, { * charset:string * callback:fn * }); * */ function __cmt_getScript(url, cfg, isRetain) { cfg = cfg || {}; isRetain = isRetain || false; var doc = document, FALSE = false; if (!url) return FALSE; var head = doc.getElementsByTagName('head')[0], callback = cfg.callback || FALSE, // 载入成功回调 charset = cfg.charset || FALSE, // 文件字符编码 node = doc.createElement('script'); node.type = 'text/javascript'; // 脚本类型 node.async = true; // 是否异步执行 if (charset) // 字符编码 { node.charset = charset; } // 捆绑成功后的回调 if (doc.addEventListener) // IE { node.addEventListener('load', function(){ (typeof callback == 'function') && callback.call(node); !isRetain && node.parentNode && head.removeChild(node); }, false); } else // 非IE { var oldCallback = node.onreadystatechange; node.onreadystatechange = function(){ if (node.readyState == 'loaded' || node.readyState == 'complete') { node.onreadystatechange = null; oldCallback && oldCallback(); (typeof callback == 'function') && callback.call(node); !isRetain && node.parentNode && head.removeChild(node); } }; } node.src = url; head.insertBefore(node, head.firstChild); return node; } function __load_cmt_2f320303a9b0fa82f3514169e427ca89(limit) { var topic_id = __cmt_topic_id_2f320303a9b0fa82f3514169e427ca89; x_ajax_load_cmt(topic_id, limit, __load_cmt_on_load_2f320303a9b0fa82f3514169e427ca89); } function __load_cmt(page,varstr) { var limitstr = '0,8'; x_ajax_load_cmt(__cmt_topic_id_2f320303a9b0fa82f3514169e427ca89, limitstr,page, __load_cmt_on_load_2f320303a9b0fa82f3514169e427ca89); document.location.hash='cmt_start'; } function __reload_cmt(ignore_is_top) { var ignore_is_top = arguments[0] ? arguments[0] : false; var limitstr = '0,8'; x_ajax_load_cmt(__cmt_topic_id_2f320303a9b0fa82f3514169e427ca89, limitstr, 1, 1, ignore_is_top, __load_cmt_on_load_2f320303a9b0fa82f3514169e427ca89); } /* /////////------------->和tag系统的相互接口 __topic_tags_str变量在tag load完生成 function __cmt_topic_on_apply_tags(data) { } function __cmt_topic_apply_tags() { try { if (__topic_tags_str!='' && __cmt_topic_id_2f320303a9b0fa82f3514169e427ca89>0) { x_ajax_topic_apply_tags(__cmt_topic_id_2f320303a9b0fa82f3514169e427ca89,__topic_tags_str,__cmt_topic_on_apply_tags); } else { window.setTimeout('__cmt_topic_apply_tags()',3000); } } catch (err) { window.setTimeout('__cmt_topic_apply_tags()',3000); } } window.setTimeout('__cmt_topic_apply_tags()',3000); ////////<------------- */ ///////////////////////////////////提交接口 function __cmt_topic_on_post_cmt(data) { try { if (typeof(login_id)!='undefined') { login_id = readCookie('member_id'); } }catch (err){ } var post_ok = false; var errmsg = ''; var tip = ''; var str= data; var p = /^cmt_id=(\d+)&err=0&topic_id=(\d+)&tip=(.*)$/; if (p.test(str)) { __cmt_topic_id_2f320303a9b0fa82f3514169e427ca89 = RegExp.$2 ; var topic_id = __cmt_topic_id_2f320303a9b0fa82f3514169e427ca89; __cmt_id_2f320303a9b0fa82f3514169e427ca89 = RegExp.$1 ; var cmt_id = __cmt_id_2f320303a9b0fa82f3514169e427ca89; post_ok = true; tip = str.substr(str.lastIndexOf('tip=')+4); } else if (str=='') { errmsg='网络错误,服务器超时或缺少url_proxy'; } else { post_ok = false; errmsg = str.substr(str.lastIndexOf('err=')+4); } if (typeof(__callback_post_cmt_complete)!='undefined') { try { if (errmsg.length>200) { errmsg='网络错误,加载失败'; } __callback_post_cmt_complete(post_ok,errmsg,tip); } catch (err) { } } } function __cmt_topic_post_cmt_2f320303a9b0fa82f3514169e427ca89(title,content,custom_data,_login_type,_login_user,_login_user_pwd, _anonymous, _anonymous_user_url, regid, reg_code) { if (typeof(_login_user)=='undefined') { _login_user=''; } if (content!='') { content = content.replace(/\r/ig,''); content = content.replace(/\n/ig,'
'); x_ajax_topic_post_cmt('http://food.poco.cn/commendDetail.htx&id=900791','-%D5%F4%B0%D7%F6%D9%D3%E3%BA%CD%C1%F8%CC%F5%D1%F2%C8%E2%B4%AE---%C8%E7%CF%C9%B9%C5%C0%F6%B5%C4%D0%C2%BD%AE%C3%C0%CE%B6',title,content,custom_data,_login_type,_login_user,_login_user_pwd, _anonymous, _anonymous_user_url, regid, reg_code, __cmt_topic_on_post_cmt); } if (typeof(__pcrs_collect_keyword)=='function') { try { __pcrs_collect_keyword(__user_id,'weight_cmt',__poco_pcrs_keyword); } catch (err) { } } } function __cmt_topic_post_cmt(title,content,custom_data,_login_type,_login_user,_login_user_pwd, _anonymous, _anonymous_user_url, regid, reg_code) { return __cmt_topic_post_cmt_2f320303a9b0fa82f3514169e427ca89(title,content,custom_data,_login_type,_login_user,_login_user_pwd, _anonymous, _anonymous_user_url, regid, reg_code); } /////////////////////////////////////////////////////// function __cmt_get_topic_id_2f320303a9b0fa82f3514169e427ca89_onload(data) { if (__cmt_topic_id_2f320303a9b0fa82f3514169e427ca89==0) { var str= data; var p = /^topic_id=(\d+)&err=0$/; if (p.test(str)) { var topic_id=str.replace(p,'$1'); __cmt_topic_id_2f320303a9b0fa82f3514169e427ca89= topic_id; } else { __cmt_tag_2f320303a9b0fa82f3514169e427ca89.innerHTML = '评论数据加载出错,请重新再试'; } } window.clearTimeout(__cmt_init_timeout); __load_cmt_2f320303a9b0fa82f3514169e427ca89('0,8'); } function __cmt_get_topic_id_2f320303a9b0fa82f3514169e427ca89() { x_ajax_get_topic_id('http://food.poco.cn/commendDetail.htx&id=900791','-%D5%F4%B0%D7%F6%D9%D3%E3%BA%CD%C1%F8%CC%F5%D1%F2%C8%E2%B4%AE---%C8%E7%CF%C9%B9%C5%C0%F6%B5%C4%D0%C2%BD%AE%C3%C0%CE%B6',__cmt_get_topic_id_2f320303a9b0fa82f3514169e427ca89_onload); } function __cmt_delete_cmt_on_load(data) { if(confirm('确定删除?')) { __reload_cmt(); alert('删除成功'); } } function __cmt_delete_cmt(topic_id, cmt_id, user_id) { var temp_login_id = readCookie('member_id'); if ( temp_login_id==user_id && temp_login_id>0 ) { var msg_content = '

确定删除?

'; } else { var msg_content = '

'; if ( user_id>0 ) { msg_content += '

'; } msg_content += '
'; } __cmt_show_msg_box({ width:350, title:'留言删除确认', content:msg_content, button:{ '确 认':'__cmt_start_delete_cmt('+topic_id+', '+cmt_id+', '+user_id+');', '关 闭':'__cmt_close_msg_box();' } }); } function __cmt_start_delete_cmt(topic_id, cmt_id, user_id) { if ( document.getElementById('J_del_cmt_reply_report') && document.getElementById('J_del_cmt_reply_report').checked==true ) { document.getElementById('post_frame').src='/cmt/cmt_del.act.php?act=report&topic_id='+topic_id+'&cmt_id='+cmt_id+'&user_id='+user_id; } else if ( document.getElementById('J_del_cmt_reply_blacklist') && document.getElementById('J_del_cmt_reply_blacklist').checked==true ) { document.getElementById('post_frame').src='/cmt/cmt_del.act.php?act=blacklist&topic_id='+topic_id+'&cmt_id='+cmt_id+'&user_id='+user_id; } else { document.getElementById('post_frame').src='/cmt/cmt_del.act.php?act=del&topic_id='+topic_id+'&cmt_id='+cmt_id+'&user_id='+user_id; } } function __old_cmt_delete_cmt(cmt_id) { var topic_id = __cmt_topic_id_2f320303a9b0fa82f3514169e427ca89; x_ajax_delete_cmt(topic_id, cmt_id, __cmt_delete_cmt_on_load); } function __cmt_get_user_img_by_label_id(label_id, user_id, page, total_count, show_count) { show_count = (parseInt(show_count) > 0) ? show_count : 20; document.getElementById('cmt_emoticons_div').style.display = ''; document.getElementById('cmt_emoticons_list_div').innerHTML = '正在加载表情......请稍侯'; x_ajax_get_user_img_by_label_id(label_id, user_id, page, total_count, show_count, __cmt_get_user_img_on_load); } function __cmt_get_user_img_on_load(data) { var __cmt_user_img_arr = new Array(),__cmt_user_img_count = 0,__cmt_user_img_page = 0, __cmt_user_img_show_count = 0, __cmt_user_img_user_id = 0; document.getElementById('cmt_emoticons_div').style.display = ''; oemodiv = document.getElementById('cmt_emoticons_list_div'); opagediv = document.getElementById('cmt_emoticons_page_str_div'); if(data.length==0) { oemodiv.innerHTML = '加载数据超时,请稍候再试'; return; } try{ eval(data); } catch(e){ oemodiv.innerHTML = '加载表情失败,请稍候再试'; return; } oemodiv.innerHTML = ''; opagediv.innerHTML = __cmt_emo_show_page(__cmt_user_img_user_id, __cmt_user_img_count, __cmt_user_img_page, __cmt_user_img_show_count); if(__cmt_user_img_arr.length > 0) { for(i=0; i < __cmt_user_img_arr.length; i++) { oli = document.createElement("li"); oli.style.styleFloat = 'left'; oli.style.margin = '2px'; oli.style.padding = '2px'; oli.style.marginBottom = '10px'; oli.style.height = '80px'; oli.align = 'center'; oimg = document.createElement("img"); oimg.src = __cmt_user_img_arr[i]['img_url']; oimg.user_id = __cmt_user_img_arr[i]['user_id']; oimg.user_name = __cmt_user_img_arr[i]['user_name']; oimg.alt = __cmt_user_img_arr[i]['title']; oimg.style.height = '68px'; oimg.style.width = 'auto'; oimg.style.cursor = 'pointer'; oimg.style.display = 'block'; oimg.onclick = function() {__cmt_add_user_img_emoticon(this.src,this.user_id,this.user_name);}; oimg.onerror = function() {this.parentElement.style.display='none';}; oli.appendChild(oimg); if(__cmt_user_img_arr[i]['user_click_url']) { oa = document.createElement("a"); oa.href = __cmt_user_img_arr[i]['user_click_url']; oa.target = 'blank'; oa.innerHTML = '来自:'+__cmt_user_img_arr[i]['user_name']; oa.style.wordBreak = 'keep-all'; oli.appendChild(oa); } oemodiv.appendChild(oli); } } } function __cmt_emo_show_page(__cmt_user_img_user_id, total_count, page, show_count) { tpage = parseInt(total_count/show_count); var current = page; if(page > tpage) current = tpage; if(current < 1 ) current = 1; output = ''; if(tpage > 1) { if (current>1) { output+= '上一页 '; } var start = parseInt(current/10)*10; var end = start+9; if (start<1) start=1; if (end>tpage) end=tpage; for (var i=start; i<=end; i++) { if (current==i) { output+='['+i+'] '; //输出当前页数 } else { output+=''+i+' ';//输出页数 } } if (current下一页 '; } } return output; } function __cmt_add_user_img_emoticon(img_url,user_id,user_name) { document.getElementById('new_cmt_content').value += '[LIST] [IMG]'+img_url+'[/IMG]\n[URL=http://my.poco.cn/?user_id='+user_id+']此表情由"'+user_name+'"提供![/URL][/LIST] '; } function __cmt_act_vote(url) { x_ajax_cmt_act_vote(url, __cmt_act_vote_on_load); } function __cmt_act_vote_on_load(data) { //not thing to do } //取指定用户的最新作品列表 function __get_cmt_user_last_act(user_id, user_name, div_id) { return x_ajax_get_cmt_user_last_act(user_id, user_name, div_id, __get_cmt_user_last_act_onload); } function __cmt_new_cmt_content_onfocus() { $('cmt_content_tip').style.display = 'none'; } function __get_cmt_user_last_act_onload(data) { var str = data; var p = /^div_id=(.*)&html=([\s\S]*)$/; if (p.test(str)) { var div_id = RegExp.$1; var last_act_html = RegExp.$2; document.getElementById(div_id).innerHTML = last_act_html; } else if (str=='') { alert('网络错误'); } } if (typeof(__ran_ids) == 'undefined') { var __ran_ids = new Array(); } __ran_ids.push('2f320303a9b0fa82f3514169e427ca89'); //留言其他数据变量定义 var custom_data = ''; var cmt_client_in_progress = false; /** * 下面是默认提交留言函数 */ function post_cmt() { if (cmt_last_cmt_id) { close_answer_div(cmt_last_cmt_id); } document.getElementById('__cmt_post_btn').disabled=true; var tmp_content = document.getElementById('new_cmt_content').value; var tmp_login_type = 0; var tmp_login_username =''; var tmp_login_userpwd = ''; var user_url = ''; var anonymous = document.getElementById("anonymous")? document.getElementById("anonymous").checked : false; try { if(anonymous) { var re=/^\s*https?:\/\//; tmp_login_username = document.getElementById('anonymousName').value; //user_url = document.getElementById('UserUrl').value; if(tmp_login_username=='') { return cmt_feedback(document.getElementById('anonymousName'),'请输入昵称'); } if( trim(user_url)!="" && !re.test(user_url)) { return cmt_feedback(document.getElementById('UserUrl'),'请输入正确的网址URL'); } } else if(document.getElementById('loginType')) { var obj_login_type = document.getElementById('loginType'); tmp_login_type = obj_login_type.options[obj_login_type.selectedIndex].value; tmp_login_username = document.getElementById('UserName').value; tmp_login_userpwd = document.getElementById('PassWord').value; if(tmp_login_userpwd=='' || tmp_login_username=='') { return cmt_feedback(document.getElementById('UserName'),'请输入用户名和密码'); } if(tmp_login_type==1 && isNaN(tmp_login_username)) { return cmt_feedback(document.getElementById('UserName'),'POCOID必须为数字,请重新检查'); } } if(document.getElementById('verify_code')) { var reg_code = document.getElementById('verify_code').value; var regid = document.getElementById('verify_id').value; if(isNaN(reg_code) || reg_code=='') { return cmt_feedback(document.getElementById('verify_code'),'请输入数字验证码'); } } if(typeof(cmt_post_button_onclick)=='function') { cmt_post_button_onclick(); } } catch(e) { } if (tmp_content=='') { return cmt_feedback(document.getElementById('new_cmt_content'),'请输入内容'); } if(cmt_custom_data()==false) return false; /*** cmt快速登录框 @ 2010-08-18 ***/ if(cmt_quick_login==1 && login_id<1 && anonymous==false) { loginApp.set({ CustomApi:function(data){ __cmt_topic_post_cmt('',tmp_content,custom_data,tmp_login_type,tmp_login_username,tmp_login_userpwd , anonymous, user_url , regid, reg_code); } }); loginApp.loginBox(); return false; } /*** cmt快速登录框 @ 2010-08-18 ***/ __cmt_topic_post_cmt('',tmp_content,custom_data,tmp_login_type,tmp_login_username,tmp_login_userpwd , anonymous, user_url , regid, reg_code); } /** * 下面是回复留言函数 */ function reply_cmt(topic_id, cmt_id, reply_cmt_id, reply_user_id, reply_user_name, prefix) { //document.getElementById('__cmt_post_btn_'+cmt_id).disabled=true; //document.getElementById('__cmt_post_btn_'+cmt_id).value = '正在提交...'; var tmp_content = document.getElementById(prefix+'reply_content_'+cmt_id).value; var tmp_login_type = 0; var tmp_login_username =''; var tmp_login_userpwd = ''; var user_url = ''; var reg_code = ''; var regid = ''; var anonymous = document.getElementById(prefix+"reply_anonymous_"+cmt_id) ? document.getElementById(prefix+"reply_anonymous_"+cmt_id).checked : false; try { if(anonymous!=false) { var re=/^\s*https?:\/\//; tmp_login_username = document.getElementById(prefix+'reply_anonymousName_'+cmt_id).value; //user_url = document.getElementById('reply_UserUrl').value; if(trim(tmp_login_username)=='') { return cmt_feedback(document.getElementById(prefix+'reply_anonymousName_'+cmt_id),'请输入昵称'); } if( trim(user_url)!="" && !re.test(user_url)) { return cmt_feedback(document.getElementById('reply_UserUrl'),'请输入正确的网址URL'); } } else if(document.getElementById(prefix+'reply_loginType_'+cmt_id)) { var obj_login_type = document.getElementById(prefix+'reply_loginType_'+cmt_id); tmp_login_type = obj_login_type.options[obj_login_type.selectedIndex].value; tmp_login_username = document.getElementById(prefix+'reply_UserName_'+cmt_id).value; tmp_login_userpwd = document.getElementById(prefix+'reply_PassWord_'+cmt_id).value; if(tmp_login_userpwd=='' || tmp_login_username=='') { return cmt_feedback(document.getElementById(prefix+'reply_UserName_'+cmt_id),'请输入用户名和密码'); } if(tmp_login_type==1 && isNaN(tmp_login_username)) { return cmt_feedback(document.getElementById(prefix+'reply_UserName_'+cmt_id),'POCOID必须为数字,请重新检查'); } } if(document.getElementById('reply_verify_code')) { reg_code = document.getElementById('reply_verify_code').value; regid = document.getElementById('reply_verify_id').value; if(isNaN(reg_code) || reg_code=='') { return cmt_feedback(document.getElementById('reply_verify_code'),'请输入数字验证码'); } } } catch(e) { } if (tmp_content=='') { return cmt_feedback(document.getElementById(prefix+'reply_content_'+cmt_id),'请输入内容'); } /*** cmt快速登录框 @ 2010-08-18 ***/ if(cmt_quick_login==1 && login_id<1 && anonymous==false) { loginApp.set({ CustomApi:function(data){ /*if ( readCookie('test_mode_message_box')==1 ) {*/ custom_data = '{"reply_cmt_id":'+reply_cmt_id+',"reply_user_id":'+reply_user_id+',"reply_user_name":"'+reply_user_name+'","answer_cmt_id":'+cmt_id+'}';//默认 /*} else { custom_data = '{"reply_cmt_id":'+reply_cmt_id+',"reply_user_id":'+reply_user_id+',"reply_user_name":"'+reply_user_name+'"}';//默认 }*/ __cmt_topic_post_cmt('',tmp_content,custom_data,tmp_login_type,tmp_login_username,tmp_login_userpwd , anonymous, user_url , regid, reg_code); } }); loginApp.loginBox(); return false; } /*** cmt快速登录框 @ 2010-08-18 ***/ /*if ( readCookie('test_mode_message_box')==1 ) {*/ custom_data = '{"reply_cmt_id":'+reply_cmt_id+',"reply_user_id":'+reply_user_id+',"reply_user_name":"'+reply_user_name+'","answer_cmt_id":'+cmt_id+'}';//默认 /*} else { custom_data = '{"reply_cmt_id":'+reply_cmt_id+',"reply_user_id":'+reply_user_id+',"reply_user_name":"'+reply_user_name+'"}';//默认 }*/ __cmt_topic_post_cmt('',tmp_content,custom_data,tmp_login_type,tmp_login_username,tmp_login_userpwd , anonymous, user_url , regid, reg_code); } var debug_referer=''; var debug_requesturi='/url_proxy.php?_t=0.42410900 15112317725a13911c678b53.41207094&__decoder=base64_decode&__url=aHR0cDovL2JqLmZvb2QucG9jby5jbi9jbXQvP3VybD1odHRwJTI1M0ElMjUyRiUyNTJGZm9vZC5wb2NvLmNuJTI1MkZjb21tZW5kRGV0YWlsLmh0eCUyNTI2aWQlMjUzRDkwMDc5MSZ0aXRsZT0tJUQ1JUY0JUIwJUQ3JUY2JUQ5JUQzJUUzJUJBJUNEJUMxJUY4JUNDJUY1JUQxJUYyJUM4JUUyJUI0JUFFLS0tJUM4JUU3JUNGJUM5JUI5JUM1JUMwJUY2JUI1JUM0JUQwJUMyJUJEJUFFJUMzJUMwJUNFJUI2JmF1dGhvcl9pZD01NTI5MTU5NCZhdXRob3JfbmFtZT1kYWdhaXh1ZXh1ZSZhbm9ueW1vdXM9MSZsaW1pdD0wLDgmdHBsX25hbWU9Y2hhbm5lbF92Mg=='; //留言其他数据组织 function cmt_custom_data() { custom_data = ''; var tmp_content = document.getElementById('new_cmt_content'); //餐厅点评 if (document.getElementById('add_to_res_grade') && document.getElementById('add_to_res_grade').checked) { var pro_score = document.getElementById('pro_score').value; var ser_score = document.getElementById('ser_score').value; if ( (/^( |\s|)+$/i).test(tmp_content.value) ) { return cmt_feedback(tmp_content,"你还没有输入任何评价呢,写点吧!"); } else { if (tmp_content.value.length < 10) { return cmt_feedback(tmp_content,"你还需要输入" + (10-tmp_content.value.length) + "个字!"); } if (tmp_content.value.length > 2000) { return cmt_feedback(tmp_content,"留言内容超过2000个字符了!"); } } if(pro_score == '') { return cmt_feedback(document.getElementById('pro_score'),'请点评该餐厅的出品情况'); } if(ser_score == '') { return cmt_feedback(document.getElementById('ser_score'),'请点评该餐厅的服务情况'); } var food_res_id = document.getElementById('food_res_id').value; custom_data = '"res_id":'+food_res_id+',"pro_score":'+pro_score+',"ser_score":'+ser_score;//默认 //人均 if(document.getElementById('agv_consume').value != '') { var agv_consume = document.getElementById('agv_consume').value; custom_data += ',"average_expense":'+agv_consume; } } //景点点评 if(document.getElementById('add_to_travel_grade') && document.getElementById("add_to_travel_grade").checked) { var cmd_level = document.getElementsByName("cmd_level"); var cmd_level_val = ''; for(var i = 0; i < cmd_level.length; i++) { if(cmd_level[i].checked) { cmd_level_val = cmd_level[i].value; } } var travel_location_id = document.getElementById('travel_location_id').value; custom_data = '"location_id":'+travel_location_id+',"cmd_level":'+cmd_level_val; } //推荐此作品 if(document.getElementById('recommended_opus') && document.getElementById('recommended_opus').checked) { if(cmt_chinese_strlen(tmp_content.value) < 15) { return cmt_feedback(tmp_content,'您的内容少于15个中文,认真写下推荐作品的原因,才能和更多好友分享'); } var recommended_opus = document.getElementById('recommended_opus').value; custom_data = '"recommended_opus":'+recommended_opus; } //同步到心情状态 if(document.getElementById('add_to_status') && document.getElementById('add_to_status').checked) { var reg = /\[\/?(img|url|color|size|quote).*\]/i; if(reg.test(tmp_content.value) || cmt_is_url(tmp_content.value)) { return cmt_feedback(tmp_content,'您的内容包含UBB代码或网址,不能转帖到您的微博。'); } else if(cmt_chinese_strlen(tmp_content.value) < 10) { return cmt_feedback(tmp_content,'您的内容少于10个中文!请认真填写留言才能转帖到您的微博。'); } else if(tmp_content.value.length > 140) { return cmt_feedback(tmp_content,'您的内容超过140个字了!留言转帖到微博字数限定少于140个字。'); } if(custom_data=='') { custom_data += '"add_to_status":1'; } else { custom_data += ',"add_to_status":1'; } } //留言图片 if(document.getElementById('cmt_pic_item_id') && document.getElementById('cmt_pic_item_id').value != '') { var pic_item_id = document.getElementById('cmt_pic_item_id').value, pic_item_url = document.getElementById('cmt_pic_item_url').value, pic_origin = document.getElementById('cmt_pic_origin').value, pic_item_id_arr = pic_item_id.split('#|#'), pic_item_url_arr = pic_item_url.split('#|#'), jsonStr = []; for(var i=0, len = pic_item_id_arr.length; i0) { anonymous_obj = document.getElementById(prefix+"reply_anonymous_"+cmt_id); login_div_obj = document.getElementById(prefix+"login_div_"+cmt_id); anonymous_div_obj = document.getElementById(prefix+"anonymous_div_"+cmt_id); } else { anonymous_obj = document.getElementById("anonymous"); login_div_obj = document.getElementById("login_div"); anonymous_div_obj = document.getElementById("anonymous_div"); var is_vote_obj = document.getElementById("is_vote"); } if(anonymous_obj.checked) { login_div_obj.style.display = "none"; anonymous_div_obj.style.display = "inline"; if(is_vote_obj) is_vote_obj.disabled = true; } else { login_div_obj.style.display = "inline"; anonymous_div_obj.style.display = "none"; if(is_vote_obj) is_vote_obj.disabled = false; } } //回复 function set_answer(username) { var obj = document.getElementById('new_cmt_content'); obj.focus(); obj.value = '回复@'+username + ': ' + obj.value; var txtRange = obj.createTextRange(); txtRange.moveStart("character", obj.value.length); txtRange.moveEnd("character", 0); txtRange.select(); } var cmt_last_cmt_id = ""; var cmt_last_prefix = ""; function open_answer_input(cmt_id, reply_cmt_id, reply_user_id, topic_id, topic_url, reply_username, prefix) { if (prefix==undefined) prefix = 'J_'; //if (cmt_last_prefix=="") cmt_last_prefix = prefix; //现在操作的 var reply_content_obj = document.getElementById(prefix + 'quick_cmt_reply_content_' + cmt_id); var reply_input_obj = document.getElementById(prefix + 'cmt_reply_input_' + cmt_id); var reply_control_obj = document.getElementById(prefix + 'cmt_control_' + cmt_id); //上次操作的 if (cmt_last_prefix!="") { var last_reply_content_obj = document.getElementById(cmt_last_prefix + 'quick_cmt_reply_content_' + cmt_last_cmt_id); var last_reply_input_obj = document.getElementById(cmt_last_prefix + 'cmt_reply_input_' + cmt_last_cmt_id); var last_cmt_control_obj = document.getElementById(cmt_last_prefix + 'cmt_control_' + cmt_last_cmt_id); } if (reply_content_obj) { reply_input_obj.innerHTML = create_input_html(cmt_id, reply_cmt_id, reply_user_id, topic_id, topic_url, reply_username, prefix);//注入html代码 if(window.athow && window.athow.add_container('#J_reply_content_'+cmt_id)) { window.athow.add_container('#J_reply_content_'+cmt_id); } if (cmt_last_cmt_id!="" && last_reply_content_obj!=null && (cmt_last_cmt_id!=cmt_id || cmt_last_prefix!=prefix))//隐藏上次打开的 { last_reply_content_obj.style.display = "none";//隐藏上次打开的输入框 last_reply_input_obj.innerHTML = "";//清空上次打开的输入框的html代码 if (last_cmt_control_obj) { last_cmt_control_obj.style.display = "inline";//显示上次打开所属控制栏 } } else if(last_cmt_control_obj) { last_cmt_control_obj.style.display = "none";//隐藏上次打开所属控制栏 } reply_content_obj.style.display = "inline";//显示点击目标 if (reply_control_obj) reply_control_obj.style.display = "none"; reply_verify_code_reload(); cmt_last_cmt_id = cmt_id; cmt_last_prefix = prefix; } } var cmt_anonymous = '1'; var cmt_quick_login = '0'; function create_input_html(cmt_id, reply_cmt_id, reply_user_id, topic_id, topic_url, reply_username, prefix) { if(cmt_quick_login=='1') { return create_input_html_v2(cmt_id, reply_cmt_id, reply_user_id, topic_id, topic_url, reply_username, prefix); } var temp_reply_username = document.getElementById(prefix + 'user_name_' + cmt_id).getAttribute('title'); var temp_html = '
回复 ' + temp_reply_username + '
'; var reg_str = ''; var verify_code_html = ''; var js_get_login_id = readCookie('member_id'); if (js_get_login_id==0) { temp_html += ''; } temp_html += '
'; if (js_get_login_id==0) { if(1>0) { verify_code_html = '验证码: 看不清楚,换一个试试  '; } reg_str = '注册  '; } temp_html += '
'+verify_code_html+reg_str+' 
'; temp_html += '
'; return temp_html; } /*** cmt快速登录框 @ 2010-08-18 ***/ function create_input_html_v2(cmt_id, reply_cmt_id, reply_user_id, topic_id, topic_url, reply_username, prefix) { var temp_reply_username = document.getElementById(prefix + 'user_name_' + cmt_id).getAttribute('title'); var reg_str = verify_code_html = ''; var js_get_login_id = readCookie('member_id'); var js_get_login_name = readCookie('nickname'); var textarea_html = '
'; var btn_html = ' '; var temp_html = '
'; if (js_get_login_id==0) { if(1>0) { verify_code_html = '验证码: 看不清楚,换一个试试  '; } reg_str = '注册  '; if(cmt_anonymous=='1') { temp_html += '
回复 ' + temp_reply_username + '
'; temp_html += '';//end cmt_user_login div temp_html += textarea_html;//添加输入文本框 } else { btn_html = verify_code_html = reg_str = ''; temp_html += '';//end cmt_user_login div } } else//已经登录情况 { temp_html += '
回复 ' + temp_reply_username + '
'; temp_html += textarea_html; } if (verify_code_html!='' || reg_str !='' || btn_html!='') temp_html += '
'+verify_code_html+reg_str+btn_html+'
'; temp_html += '
';//end cmt_reply_cmt_main div temp_html += '
'; return temp_html; } /*** cmt快速登录框 @ 2010-08-18 ***/ function close_answer_div(cmt_id, prefix) { if (prefix==undefined) prefix = cmt_last_prefix; document.getElementById(prefix+'quick_cmt_reply_content_'+cmt_id).style.display = "none"; document.getElementById(prefix+'cmt_reply_input_'+cmt_id).innerHTML = ""; if (document.getElementById(prefix+'cmt_control_'+cmt_id)!=null) document.getElementById(prefix+'cmt_control_'+cmt_id).style.display = "inline"; } // 表情部分的 function emoticon(s, target_obj) { if (!target_obj) target_obj = 'new_cmt_content'; var obj = document.getElementById(target_obj); obj.value=obj.value+s + ' '; if (target_obj=='new_cmt_content') close_face_icon_div(); } function open_face_icon_div(target_obj) { if (!target_obj) target_obj = 'cmt_face_icon_div'; document.getElementById(target_obj).style.display='block'; } function close_face_icon_div(target_obj) { if (!target_obj) target_obj = 'cmt_face_icon_div'; document.getElementById(target_obj).style.display='none'; } // 验证码刷新 function verify_code_reload() { if(document.getElementById('verify_code_img')) { var verify_code_img = document.getElementById('verify_code_img'); verify_code_img.src = verify_code_img.src+'&rand='+Math.random(); document.getElementById('verify_code').value = ''; //document.getElementById('verify_code').focus(); document.getElementById('__cmt_post_btn').disabled=false; } } function reply_verify_code_reload() { if(document.getElementById('reply_verify_code_img')) { var verify_code_img = document.getElementById('reply_verify_code_img'); verify_code_img.src = verify_code_img.src+'&rand='+Math.random(); document.getElementById('reply_verify_code').value = ''; //document.getElementById('reply_verify_code').focus(); } } //显示作者最新作品 function cmt_show_user_last_act(cmt_show_user_last_act_div_id, user_id, user_name, obj) { var content = document.getElementById(cmt_show_user_last_act_div_id).innerHTML; cmt_drop_down_menu(cmt_show_user_last_act_div_id, obj); if(content=='正在加载作品...') { __get_cmt_user_last_act(user_id, user_name, cmt_show_user_last_act_div_id); } } /** * 下拉菜单 */ var ddm_lastTarget = null; var ddm_target = null; var ddm_timer = 0; function cmt_drop_down_menu(id, obj) { clearTimeout(ddm_timer); if (ddm_lastTarget) ddm_lastTarget.style.display = "none"; ddm_target = document.getElementById(id); ddm_lastTarget = ddm_target; ddm_target.style.display = "block"; ddm_target.style.zIndex = 1000000; //下拉触发 ddm_target.onmouseover = function() { clearTimeout(ddm_timer); } //移除 ddm_target.onmouseout = obj.onmouseout = function(){ ddm_timer = setTimeout(function() { ddm_target.style.display = "none"; ddm_target.style.zIndex = 99; }, 300); }; } var __cmt_Sys = {}; var __cmt_ua = navigator.userAgent.toLowerCase(); var __cmt_s; __cmt_Sys.ie = (__cmt_s = __cmt_ua.match(/msie ([\d.]+)/)) ? __cmt_s[1] : false; __cmt_Sys.ie6 = (__cmt_s = __cmt_ua.match(/msie ([0-6]\.+)/)) ? __cmt_s[1] : false; __cmt_Sys.firefox = (__cmt_s = __cmt_ua.match(/firefox\/([\d.]+)/)) ? __cmt_s[1] : false; __cmt_Sys.chrome = (__cmt_s = __cmt_ua.match(/chrome\/([\d.]+)/)) ? __cmt_s[1] : false; __cmt_Sys.opera = (__cmt_s = __cmt_ua.match(/opera.([\d.]+)/)) ? __cmt_s[1] : false; __cmt_Sys.safari = (__cmt_s = __cmt_ua.match(/version\/([\d.]+).*safari/)) ? __cmt_s[1] : false; // 扩展替代 var __cmt_Extend = function(destination, source) { for (var property in source) { destination[property] = source[property]; } } /** * 弹出窗口 */ var __cmt_cover_screen_id = 'poco_cover_screen'; // 覆屏的层的ID var __cmt_cover_screen_iframe_id = 'poco_cover_screen_iframe'; var __cmt_msg_box_id_logs = new Array(); var __cmt_msg_box_id = 'poco_msg_box'; var __cmt_selectArr = document.getElementsByTagName('select'); var __cmt_msg_box_timer; // 计时器 var __cmt_msg_box_time; // 剩余时间 var __cmt_iconArr = {}; __cmt_iconArr.succ = 'http://my.poco.cn/images/ico_infoSucc.gif'; __cmt_iconArr.failed = 'http://my.poco.cn/images/ico_infoFailed.gif'; __cmt_iconArr.question = 'http://my.poco.cn/images/ico_infoQues.gif'; __cmt_iconArr.alert = 'http://my.poco.cn/images/ico_infoAlert.gif'; __cmt_iconArr.smile = 'http://my.poco.cn/images/icon_smile.gif'; function __cmt_show_msg_box(options) { if (typeof show_msg_box == 'function') { show_msg_box(options); }else{ this.options = { box_id : __cmt_msg_box_id, // 弹窗的ID b_closeother: true, // 是否关闭其他的弹窗 b_cache : false, // 窗口关闭的时候是直接remove还是隐藏 title : "信息", // 标题 b_title_icon: true, // 标题图标 content : "操作成功!", // 主内容 remark : false, // 补充内容,放在按钮后面 cover : true, // 覆屏 zindex : 99999, // 置对话框的z-index,覆屏的z-index为该值减1 alpha : 0.15, // 设置覆屏的透明度 color : '#000', // 设置覆屏的颜色 top : 150 , // 对话框离顶部的距离 top_center : false, height : 300, icon : false, // 图标 succ,failed,question,alert,false为不显示 width : 300, // 提示宽度 time : false, // 计时器,时间单位:秒 timeout : function(){__cmt_close_msg_box();}, // 时间结束后的操作 button : { '关 闭':'__cmt_close_msg_box();' }, // 按钮组 false为没有 b_title : true, // 有没有标题 b_title_line: false, // 标题和内容的分割线 b_close_btn : true, // 有没有右上角的关闭按钮 b_scroll : true, // 跟随屏幕滚动 b_drag : false, // 是否能拖动, 暂未开发,需要MT支持或另外的drag类 b_ajax : false, // 是否AJAX拿数据, 需要MT支持,未开发 ajax_url : false, ajax_pars : false, evalScripts : false, b_blank_div : false, relativer_id : false, // 相对的对象的ID b_shadow : 'auto', left : 0, onShowComplete : function(){}, onGetDataComplete : function(){} }; __cmt_Extend(this.options, options || {}); var msg_box_obj = this; if(this.options.b_closeother || document.getElementById(this.options.box_id) ) { // 关闭旧消息框 __cmt_close_msg_box(); } // 覆屏 if(this.options.cover) __cmt_create_cover_screen(this.options.alpha, this.options.color, this.options.zindex-1); // 如果该弹窗已经存在,就不用在生成,直接显示就可以了 if ( document.getElementById(this.options.box_id) ) { if(this.options.b_cache==true) { document.getElementById(this.options.box_id).style.display = ''; return this; } else { try{ document.body.removeChild(document.getElementById(this.options.box_id)); } catch(e) { var parent_obj = document.getElementById(this.options.box_id).parentNode; parent_obj.removeChild(document.getElementById(this.options.box_id)); } } } var poco_pop_content = 'poco_pop_content'; if(__cmt_msg_box_id != this.options.box_id) { poco_pop_content = this.options.box_id + '_pop_content'; } var html='', bnt_html='',icon_html='',time_html=''; // 生成消息框 var msg_box = document.createElement("div"); msg_box.id = this.options.box_id; var box_id_exist = 0; for (var l=0, arr_len = __cmt_msg_box_id_logs.length;l'; // 生成按钮 if(this.options.button!==false) { for( var bnt in this.options.button ) { var cmd = this.options.button[bnt]; bnt_html += ' '; } } // 定时事件 if(this.options.time) { __cmt_msg_box_time = this.options.time; __cmt_msg_box_timer = setInterval(function() { if(__cmt_msg_box_time <= 0) { window.clearInterval(__cmt_msg_box_timer); this.options.timeout(); // 执行停止后的函数 } if(document.getElementById('msg_box_time_num')) document.getElementById('msg_box_time_num').innerHTML = __cmt_msg_box_time; __cmt_msg_box_time--; },1000); time_html = '' + __cmt_msg_box_time + ''; } // 样式 var is_height_fix = 0; if(this.options.top_center && this.options.height>0 ) { is_height_fix = 1; if(this.options.b_blank_div) { msg_box.style.height = parseInt(this.options.height) + 'px'; this.options.top = ( document.documentElement.scrollHeight - parseInt(this.options.height) )/2; } else { msg_box.style.height = ( parseInt(this.options.height) + 34 ) + 'px'; this.options.top = ( document.documentElement.scrollHeight - parseInt(this.options.height) - 34 )/2; } } if(this.options.b_blank_div) { msg_box.style.width = parseInt(this.options.width) + 'px'; msg_box.style.left = ( document.documentElement.scrollWidth - parseInt(this.options.width) )/2 + 'px'; } else { msg_box.style.width = ( parseInt(this.options.width) + 34 ) + 'px'; msg_box.style.left = ( document.documentElement.scrollWidth - parseInt(this.options.width) - 34 )/2 + 'px'; } msg_box.style.zIndex = this.options.zindex; msg_box.style.position = 'relative'; msg_box.style.overflow = 'hidden'; var t_html = b_html = ''; // html if(this.options.b_blank_div) { msg_box.style.backgroundColor = ''; html = '
'+this.options.content+'
'; if(this.options.b_shadow == 'auto') this.options.b_shadow = false; } else { html = '
'; if (this.options.b_title) { html += '

'+this.options.title+'

'+time_html; if(this.options.b_close_btn) { html += '' } html += '
'; if(this.options.b_title_line) { html += '
'; } } html += '
'; html += this.options.content; html += '
'; if(bnt_html != '') { html += '
'; html += bnt_html; html += '
'; } html += '
'; if(this.options.b_shadow == 'auto') this.options.b_shadow = true; } if(this.options.b_shadow) { // 半透的框 var t_html = ''; } msg_box.innerHTML = t_html + html + b_html; if(this.options.relativer_id == false) { if (this.options.b_scroll==true) { if (__cmt_Sys.ie6)//设置框体顶部距离 { msg_box_css_text = ';position:absolute;top:expression(this.style.pixelHeight+document.documentElement.scrollTop+' + this.options.top + ');'; } else { msg_box_css_text = ';position:fixed;top:'+this.options.top+'px;'; } } else { msg_box_css_text = ';position:absolute;top:'+(this.options.top + document.documentElement.scrollTop + document.body.scrollTop)+'px;'; } msg_box.style.cssText += msg_box_css_text; //document.body.appendChild(msg_box); document.body.insertBefore(msg_box, document.body.firstChild); } else { msg_box_css_text = ';position:absolute;top:'+this.options.top+'px;left:'+this.options.left+'px;'; msg_box.style.cssText += msg_box_css_text; document.getElementById(this.options.relativer_id).style.position = 'relative'; document.getElementById(this.options.relativer_id).appendChild(msg_box); } /*if(this.options.ajax_url) { new Request({ url:msg_box_obj.options.ajax_url, data : msg_box_obj.options.ajax_pars, method : 'post', evalScripts : msg_box_obj.options.evalScripts, onComplete : function(res) { $(poco_pop_content).innerHTML = res; msg_box_obj.options.onGetDataComplete(); } }).send(); }*/ this.options.onShowComplete(); return this; } } /** * 删除消息框 */ function __cmt_close_msg_box() { if (typeof close_msg_box == 'function') { close_msg_box(); }else{ try {window.clearInterval(__cmt_msg_box_timer);} catch(e){} var box_id; for (var l=0, arr_len = __cmt_msg_box_id_logs.length;l