if(document.getElementById("css")!=null&&document.getElementById("css").href=='http://www1.pclady.com.cn/fz/style08/shaike/bj/12/person_index.css'){ $("#_main_div").ready(function() { $("#_main_div").css("position","relative"); $("#_main_div").append('
'); }); } //次方法对于传递模板计数,并显示(点击传递)的按钮 if(document.getElementById("css")!=null){ $.get('/do_click.jsp', { doAction:"viewdelivery", cssUrl:document.getElementById("css").href, r:Math.random() }, function(responseText, statusText) { var sp = trimString(responseText); var sps = sp.split(","); if(sps[0]==1){ $("#_main_div").ready(function() { $("#_main_div").css("position","relative"); $("#_main_div").append('
点击传递
'); $("#_main_div").append('
共有'+sps[1]+'晒友使用此模版
'); }); } }); } //点击传递的加载代码 如同上面 //点击传递的动作接口 function deliveryTemplate(){ //1.判断是否登陆 if (!isLogined()){ alert("您必须先登录才能继续操作"); return; } if (!confirm("你确定要使用传递模板吗?")){ return; } $.get('/do_click.jsp', { doAction:"todelivery", r:Math.random() }, function(responseText, statusText) { }); //弹出传递成功窗口 blockOpen("/popwin_template.jsp",290,160); } function trimString(s){ s=s.replace(/\r\n/g,""); //trim space s=s.replace(/^\s*|\s*$/g, ""); return s; } //正在提交的对象 var __submiting_form =false; var __submiting_returnFunc =false; function initSubmitAjax(formId,returnFunc){ var options = { beforeSubmit: function(formData, jqForm, options) { //$.blockUI('

正在提交...

', { border: '1px solid #0066FF' }); $.blockUI('
正在提交...
', { border: '1px solid #0066FF', height: '30px', padding:'10px 0px 10px 30px'}); return true; }, success:function (responseText, statusText) { __submiting_form=false; __submiting_returnFunc =false; $.unblockUI(); //判断是否验证码 try{ responseText=responseText.replace(/\r\n/g,""); //trim space responseText=responseText.replace(/^\s*|\s*$/g, ""); if (responseText.indexOf("verifyCode")>=0){ __submiting_form = formId; __submiting_returnFunc = returnFunc; $.blockUI('

请输入验证码:

看不清楚,换一张?
', { border: '1px solid #0066FF'}); }else{ if (returnFunc) returnFunc(responseText,statusText); } }catch(e){ alert(e.message); } }, timeout:10000, type:"POST" }; // bind form using 'ajaxForm' $(formId).ajaxError(function(event, request, settings){ alert("处理请求发生错误:\n"+settings.url+"\n请重新刷新页面或稍后再试"); $.unblockUI(); }); return options; } function submitAjaxFormNow(formId,returnFunc){ $(formId).ajaxSubmit(initSubmitAjax(formId,returnFunc)); } function submitAjaxForm(formId,returnFunc){ $(formId).ajaxForm(initSubmitAjax(formId,returnFunc)); } function cancelVerifyCode(){ $.unblockUI(); } function inputVerifyCode(){ if (!__submiting_form) return; var form=$(__submiting_form)[0]; var v=$("#verifyCode_input").val(); if (form["verifyCode"]){ form["verifyCode"].value=v; }else{ $('').appendTo(form); } // if (__submiting_form && __submiting_returnFunc){ submitAjaxFormNow(__submiting_form,__submiting_returnFunc); } } function changeVerifyCode(){ $("#verifyCode_image").attr("src","verifyCode.jsp?"+Math.random()); } function echoErrorMessage(form,msg){ var errors=msg.split(";"); var s=""; var first=""; for(var i=0;i 0){ //如果为text,textarea,select直接focus if(form[first].type == 'text' || form[first].type == 'textarea' || form[first].type == 'select' || form[first].type == 'radio' || form[first].type == 'checkbox'){ form[first].focus(); } if(form[first].length > 0 && (form[first][0].type == 'radio' || form[first][0].type == 'checkbox')){ form[first][0].focus(); } } return false } function blockOpen(u,w,h){ //$.blockUI('333333333333',{width:'700px',height:'400px'}); $.blockUI('', { width: w+'px',height:h+'px',border:'1px solid #888'}); } function blockClose(b){ $.unblockUI(); if (b) window.location.reload(false); } function showhidden(){ document.getElementById('diary_info').style.display = 'block'; } var photoCurrent=0; var photoCounts=9; var photoArray=new Array(); var play = false; function photoPlay(){ //alert(photoCurrent); play = true; autoRun(); } function autoRun(){ if(play){ photoNext(); setTimeout('autoRun()', 3000 ); } } function photoStop(){ play = false; } function photoPrev(){ photoShow(--photoCurrent); } function photoNext(){ photoShow(++photoCurrent); } function photoShow(i){ if (photoArray.length==0) return; if (photoArray.length<=i || i/1<0){ i=0; } $("#idShowPhoto").html($('#'+photoArray[i]).html()).fadeIn('slow'); photoCurrent=i; } function isGbk(s) { for (var j = 0; j < s.length; j++) { if (s.charCodeAt(j) > 255){ return true; } } return false; } function fucCheckLength(strTemp) { var i,sum; sum = 0; for (i = 0; i < strTemp.length; i++) { if ((strTemp.charCodeAt(i) >= 0) && (strTemp.charCodeAt(i) <= 255)) sum = sum + 1; else sum = sum + 2; } return sum; } function lengthStr(str) { var ret = 0; var count = true; for (var i = 0; i < str.length; i++) { var c = (str.charAt(i)) + ""; if (c == "\r" || c == "\n" || c == "\t" || c == " ") continue; if (isGbk(c)) { ret++; //alert(c) count = true; } else { if (c == "&" || c == "<") { count = false; //alert("off") } if (c == ";" || c == ">") { count = true; //alert("on") } if (count) { ret++; } } } return ret; } /* ignore whitespace */ function isEmpty(s) { return !Boolean(s.replace(/^\s*|\s*$/g, "").length); } function toFixedString(str,length,id) { if (isEmpty(str)) return ""; //去掉一开始的html   while (str.indexOf(" ") == 0) { str = str.substring(6); } var sb = ""; var count = true; //是否计数 for (var x = 0, y = 0; x < str.length && y < length * 2; x++) { var c = str.charAt(x); if (c == "'\r" || c == "\n" || c == "\t") continue; if (count && c == " ") continue; if (isGbk(c)) { y += 2; count = true; } else { if (c == "&" || c == "<") { count = false; } if (c == ";" || c == ">") { count = true; } if (count) { y++; } } sb += c; } if (lengthStr(str) > length) { sb += '… >>查看全文 '; } return sb; } function toFriend(id){ if (!isLogined()){ alert("您必须先登录才能继续操作"); return; } if (!confirm("确定加为好友么?\n只有对方同意了您的请求才能成为好友.")){ return; } $.get('/do_click.jsp', { doAction:"tofriend", userId:id, r:Math.random() }, function(responseText, statusText) { alert(trimString(responseText)); }); } function toInsertBlog(){ if (!isLogined()){ alert("您必须先登录才能继续操作"); return; } window.location.href="http://blog.pclady.com.cn//blog/insert.html"; } function newDiaryPK(diaryId){ //判断是否登录 if (!isLogined()){ alert("您需要登录才能发表日志"); return; } if(diaryId==null){return;} var canref = ''; $.get('http://blog.pclady.com.cn/js_diary_load.jsp', { id:diaryId, r:Math.random() }, function(responseText, statusText) { canref = trimString(responseText); if(canref==''){ return; } if(diaryId!=null&&canref!=''){ if(canref=='-1'){ alert("此日志不允许与我晒"); return; } } newDiary(diaryId,canref,'http://blog.pclady.com.cn//blog/insert_refer/'+diaryId+'.html'); }); } function toMessage(userId){ if (!isLogined()){ alert("您必须先登录才能发送小纸条"); return; } blockOpen("/send_message.jsp?userId="+userId,734,300); } function addFoucs(domId){ $.get('/do_click.jsp', { doAction:"diaryAgree", id:domId, r:Math.random() }, function(responseText, statusText) { alert("感谢您的关注!"); //blockOpen("/popwin_foucsword.jsp",290,160); $("#"+domId).text(trimString(responseText)); }); } function addFocusPhoto(domId){ $.get('/do_click.jsp', { doAction:"photoAgree", id:domId, r:Math.random() }, function(responseText, statusText) { $("#"+domId).text(trimString(responseText)); }); } function doComment(formId){ submitAjaxForm("#postCommentForm",function(responseText,statusText){ if (responseText.length>0){ echoErrorMessage($("#postCommentForm")[0],responseText); }else{ alert("填写成功,感谢您的参与"); } }); } function isLogined(){ return false; } function needLogin(){ $('#loginForm')[0].username.focus(); } function newDiary(referId,canrefer,url){ //判断是否登录 if (!isLogined()){ alert("您需要登录才能发表日志"); needLogin(); return; } if(referId!=null&&canrefer!=null){ if(canrefer==-1){ alert("此日志不允许与我晒"); return; } } window.location.href=url; //blockOpen("/user/diary_insert.jsp?referId="+referId,734,566); } function loadGroupMember(d){ $.get('/do_count.jsp', { doAction:"groupMember", id:d, r:Math.random() }, function(responseText, statusText) { $("#groupMember").text(trimString(responseText)); }); } function joinGroup(d){ $.get('/do_click.jsp', { doAction:"joinGroup", id:d, r:Math.random() }, function(responseText, statusText) { alert(trimString(responseText)); }); } function setTop(d){ $.get('/do_click.jsp', { doAction:"setTop", id:d, r:Math.random() }, function(responseText, statusText) { alert(trimString(responseText)); window.location.reload(false); }); } function selectOptionsValue(options,v){ for(var i=0;i(divWidth+75)){ //alert("right"); //$("body").append('
'+'
正在加载数据,请稍等......
'+'
');//right side $('#'+objId).removeClass("show_left").addClass("show_right"); var arrowOffset = getElementWidth(linkId) + 11; var clickElementx = getAbsoluteLeft(linkId) + arrowOffset - 80; //set x position clickElementy = getAbsoluteTop(linkId) + 40 ; }else{ $('#'+objId).removeClass("show_right").addClass("show_left"); //$("body").append('
'+'
正在加载数据,请稍等......
'+'
');//left side var clickElementx = getAbsoluteLeft(linkId) - (divWidth + 15) + 80; //set x position clickElementy = getAbsoluteTop(linkId) + 40 ; } //alert("f"); $('#'+objId).css({left: clickElementx+"px", top: clickElementy+"px"}); $('#'+objId).show(); //读取用户信息 $('#i_'+objId).load("/js_tip_user.jsp?id="+linkId); $(document).click(function (){ hideFloatTip(); }); } function getElementWidth(objectId) { x = document.getElementById(objectId); return x.offsetWidth; } function getAbsoluteLeft(objectId) { // Get an object left position from the upper left viewport corner o = document.getElementById(objectId) oLeft = o.offsetLeft // Get left position from the parent object while(o.offsetParent!=null) { // Parse the parent hierarchy up to the document element oParent = o.offsetParent // Get parent object reference oLeft += oParent.offsetLeft // Add parent left position o = oParent } return oLeft } function getAbsoluteTop(objectId) { // Get an object top position from the upper left viewport corner o = document.getElementById(objectId) oTop = o.offsetTop // Get top position from the parent object while(o.offsetParent!=null) { // Parse the parent hierarchy up to the document element oParent = o.offsetParent // Get parent object reference oTop += oParent.offsetTop // Add parent top position o = oParent } return oTop } function showFind(){ if(document.searchf.career.value != null && document.searchf.career.value.length > 0){ document.searchf.highFind.value = 1; } } function showFrind(){ if(document.findFrind.blogName.value != null && document.findFrind.blogName.value.length > 0){ document.findFrind.highFind.value = 1; } } 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 null; } function getCookieVal(offset) { var endstr = document.cookie.indexOf (";", offset); if (endstr == -1) endstr = document.cookie.length; return unescape(document.cookie.substring(offset, endstr)); } //显示浮动窗口 $(document).ready(function() { $("body").append(''); $("div .floatTip").click(function(){showFloatTip(this.id);return false;}); }); function ubb(vstr){ if(vstr==null)return ''; vstr = vstr.replace("&", "&"); vstr = vstr.replace(">", ">") vstr = vstr.replace("<", "<") vstr = vstr.replace(" ", "  ") vstr = vstr.replace("\r\n", "\n"); vstr = vstr.replace("\n", "
"); vstr = vstr.replace("\t", "    "); var emoteUrl = "\"[em$1]\""; vstr = vstr.replace(/\[em([0-9]*)]/ig, emoteUrl); var re ; //UBB转换 re=/\[IMG\](.+?)\[\/IMG\]/ig; vstr=vstr.replace(re,"按此在新窗口浏览图片screen.width-333)this.width=screen.width-333\" galleryImg=no>"); re=/(\[URL\])(.*?)(\[\/URL\])/ig vstr= vstr.replace(re,"$2") re=/(\[URL=(.[^\[]*)\])(.*?)(\[\/URL\])/ig vstr= vstr.replace(re,"$3") re=/(\[EMAIL\])(.*?)(\[\/EMAIL\])/ig vstr= vstr.replace(re,"$2") re=/(\[EMAIL=(.[^\[]*)\])(.*?)(\[\/EMAIL\])/ig vstr= vstr.replace(re,"$3") re =/^(http:\/\/[A-Za-z0-9\.\/=\?%\-&_~`@':+!]+)/ig vstr = vstr.replace(re,"$1") re =/(http:\/\/[A-Za-z0-9\.\/=\?%\-&_~`@':+!]+)$/ig vstr = vstr.replace(re,"$1") re =/[^>=""](http:\/\/[A-Za-z0-9\.\/=\?%\-&_~`@':+!]+)/ig vstr = vstr.replace(re,"$1") re =/^(ftp:\/\/[A-Za-z0-9\.\/=\?%\-&_~`@':+!]+)/ig vstr = vstr.replace(re,"$1") re =/(ftp:\/\/[A-Za-z0-9\.\/=\?%\-&_~`@':+!]+)$/ig vstr = vstr.replace(re,"$1") re =/[^>=""](ftp:\/\/[A-Za-z0-9\.\/=\?%\-&_~`@':+!]+)/ig vstr = vstr.replace(re,"$1") re =/^(rtsp:\/\/[A-Za-z0-9\.\/=\?%\-&_~`@':+!]+)/ig vstr = vstr.replace(re,"$1") re =/(rtsp:\/\/[A-Za-z0-9\.\/=\?%\-&_~`@':+!]+)$/ig vstr = vstr.replace(re,"$1") re =/[^>=""](rtsp:\/\/[A-Za-z0-9\.\/=\?%\-&_~`@':+!]+)/ig vstr = vstr.replace(re,"$1") re =/^(mms:\/\/[A-Za-z0-9\.\/=\?%\-&_~`@':+!]+)/ig vstr = vstr.replace(re,"$1") re =/(mms:\/\/[A-Za-z0-9\.\/=\?%\-&_~`@':+!]+)$/ig vstr = vstr.replace(re,"$1") re =/[^>=""](mms:\/\/[A-Za-z0-9\.\/=\?%\-&_~`@':+!]+)/ig vstr = vstr.replace(re,"$1") return vstr; }