?? core3.js
字號:
<br class="g_p_clear" />');this.jst_card_template=new String('<div><p class="g_h_20 g_t_14 g_t_bold clr00">${cardInfo.name|default:""|escape}</p></div>\ <div><embed width="500px" height="400px" src="${cardInfo.bigSrc|default:"#"}" quality="high" \ pluginspage="http://www.macromedia.com/go/getflashplayer" \ type="application/x-shockwave-flash" wmode="transparent"></embed>\ </div>');}}if(NetEase==undefined){var NetEase={};}NetEase.SimpleDragDrop=Class.create();NetEase.SimpleDragDrop.prototype={initialize:function(){this.drags=[];this.options=Object.extend({top:-1,left:0,width:0,height:0,constraint:'all',useDragOpacity:true,simpleDrag:false},arguments[0]||{});this.options.top=parseInt(this.options.top||'0');this.options.left=parseInt(this.options.left||'0');this.options.width=parseInt(this.options.width||'0');this.options.height=parseInt(this.options.height||'0');},addDraggable:function(element){new NetEase.Draggable(element,this,Object.extend(this.options,arguments[1]||{}));},removeDraggable:function(element){element=$(element);this.drags.select(function(e){return e.getElement()==element;}).each(function(e){e.destroy()});},register:function(draggable){if(this.drags.length==0){this.eventMouseUp=this.endDrag.bindAsEventListener(this);this.eventMouseMove=this.updateDrag.bindAsEventListener(this);this.eventKeypress=this.keyPress.bindAsEventListener(this);Event.observe(document,"mouseup",this.eventMouseUp);Event.observe(document,"mousemove",this.eventMouseMove);Event.observe(document,"keypress",this.eventKeypress);}this.drags.push(draggable);},unregister:function(draggable){this.drags=this.drags.reject(function(d){return d==draggable});if(this.drags.length==0){Event.stopObserving(document,"mouseup",this.eventMouseUp);Event.stopObserving(document,"mousemove",this.eventMouseMove);Event.stopObserving(document,"keypress",this.eventKeypress);}},activate:function(draggable){window.focus();this.activeDraggable=draggable;},deactivate:function(){this.activeDraggable=null;},updateDrag:function(event){if(!this.activeDraggable)return;var pointer=this.activeDraggable.getPointer(event);if(this._lastPointer&&(this._lastPointer.inspect()==pointer.inspect()))return;this._lastPointer=pointer;this.activeDraggable.updateDrag(event,pointer);},endDrag:function(event){if(!this.activeDraggable)return;this._lastPointer=null;this.activeDraggable.endDrag(event);this.activeDraggable=null;},keyPress:function(event){if(this.activeDraggable)this.activeDraggable.keyPress(event);}};NetEase.Draggable=Class.create();NetEase.Draggable.prototype={initialize:function(element,draggables){var options=Object.extend({handle:false,starteffect:function(element){new Effect.Opacity(element,{duration:0.2,from:1.0,to:0.7});},endeffect:function(element){new Effect.Opacity(element,{duration:0.2,from:0.7,to:1.0});},zindex:1000,onDrag:Prototype.emptyFunction,useDragOpacity:true,simpleDrag:false},arguments[2]||{});this.element=$(element);if(options.handle&&(typeof options.handle=='string'))this.handle=this._childrenWithClassName(this.element,options.handle)[0];if(!this.handle)this.handle=$(options.handle);if(!this.handle)this.handle=this.element;Element.makePositioned(this.element);this.delta=this.currentDelta();this.options=options;this.dragging=false;this.eventMouseDown=this.initDrag.bindAsEventListener(this);Event.observe(this.handle,"mousedown",this.eventMouseDown);this.draggables=draggables;this.draggables.register(this);if(this.options.useDragOpacity==false||this.options.simpleDrag){this.options.starteffect=null;this.options.endeffect=null;}},getElement:function(){return this.element;},destroy:function(){Event.stopObserving(this.handle,"mousedown",this.eventMouseDown);this.draggables.unregister(this);},currentDelta:function(){if(this._simpleNode)_e=this._simpleNode;else _e=this.element;return([parseInt(Element.getStyle(_e,'left')||'0'),parseInt(Element.getStyle(_e,'top')||'0')]);},getPointer:function(event){if(this.element.container=='in'){return[Event.cursorX(event),Event.cursorY(event)];}else{return[Event.pointerX(event),Event.pointerY(event)];}},initDrag:function(event){if(Event.isLeftClick(event)){var src=Event.element(event);if(src.tagName&&(src.tagName=='INPUT'||src.tagName=='SELECT'||src.tagName=='OPTION'||src.tagName=='BUTTON'||src.tagName=='TEXTAREA'))return;var pointer=this.getPointer(event);var pos=Position.cumulativeOffset(this.element);this.offset=[0,1].map(function(i){return(pointer[i]-pos[i])});this.draggables.activate(this);Event.stop(event);}},startDrag:function(event){this.dragging=true;if(this.options.zindex){this.originalZ=parseInt(Element.getStyle(this.element,'z-index')||0);this.element.style.zIndex=this.options.zindex;}if(this.options.simpleDrag){this._simpleNode=this.element.cloneNode(false);this._simpleNode.innerHTML='';this._simpleNode.className='';Element.setStyle(this._simpleNode,{zIndex:this.element.style.zIndex,border:'2px dotted red',cursor:'move',width:this.element.offsetWidth+'px',height:this.element.offsetHeight+'px'});Element.setStyle(this.element,{display:'none'});if(this.element.container=='in'){UD.body.appendChild(this._simpleNode);}else{document.body.appendChild(this._simpleNode);}Element.makePositioned(this._simpleNode);var pointer=this.getPointer(event);var pos=Position.cumulativeOffset(this._simpleNode);this.offset=[0,1].map(function(i){return(pointer[i]-pos[i])});}if(this.options.starteffect)this.options.starteffect(this.element);},updateDrag:function(event,pointer){if(!this.dragging)this.startDrag(event);Position.prepare();this.draw(pointer);if(navigator.appVersion.indexOf('AppleWebKit')>0)window.scrollBy(0,0);this.options.onDrag();Event.stop(event);},finishDrag:function(event,success){this.dragging=false;this.delta=this.currentDelta();this.element.style.zIndex=this.originalZ;if(this._simpleNode){if(this.element.container=='in'){Element.removeChild(this._simpleNode);}else{Element.removeChild(this._simpleNode);}Element.setStyle(this.element,{left:this.delta[0]+'px',top:this.delta[1]+'px',display:'block'});}if(this.options.endeffect)this.options.endeffect(this.element);this.draggables.deactivate(this);},keyPress:function(event){if(event.keyCode!=Event.KEY_ESC)return;this.finishDrag(event,false);Event.stop(event);},endDrag:function(event){if(!this.dragging)return;this.finishDrag(event,true);Event.stop(event);},draw:function(point){var _e;if(this._simpleNode)_e=this._simpleNode;else _e=this.element;var pos=Position.cumulativeOffset(_e);var d=this.currentDelta();pos[0]-=d[0];pos[1]-=d[1];var p=[0,1].map(function(i){return(point[i]-pos[i]-this.offset[i])}.bind(this));if(this.options.left!=0){if((this.options.width!=0)&&(p[0]>this.options.left+this.options.width))p[0]=this.options.left+this.options.width;else if(p[0]<this.options.left)p[0]=this.options.left;}if(this.options.top!=0){if((this.options.height!=0)&&(p[1]>this.options.top+this.options.height))p[1]=this.options.top+this.options.height;else if(p[1]<this.options.top)p[1]=this.options.top;}if(this.options.constraint=='horizontal')Element.setStyle(_e,{left:p[0]+'px'});else if(this.options.constraint=='vertical')Element.setStyle(_e,{top:p[1]+'px'});elseElement.setStyle(_e,{left:p[0]+'px',top:p[1]+'px'});if(Element.getStyle(_e,'visibility')=='hidden')Element.setStyle(_e,{visibility:''});},_childrenWithClassName:function(element,className){return $A($(element).getElementsByTagName('*')).select(function(c){return Element.hasClassName(c,className)});}}if(NetEase==undefined){var NetEase={};}NetEase.CommentPublish=Class.create();NetEase.CommentPublish.commentShowTemplate=null;NetEase.CommentPublish.commentPubTemplate=null;NetEase.CommentPublish.prototype={initialize:function(oCommentArray,sParentId,iTotalCommentCount,sComShowElemId,sComPubElemId){this._oOptions=Object.extend({bCanClose:true,bHasCancelBtn:false,bNeedCheckLogin:false,bNeedCheckRight:false,bDefaultPubClose:false,iAllowComment:0,bSupportDeleteComment:false,iPageSize:10,iHostId:null,sHostName:'匿名',iVisitorId:null,sVisitorName:'匿名',sVisitorNickname:'匿名',sVisitorAvatar:'',sVisitorIP:'',iEditorWidth:0,iEditorHeight:286,iEditorMaxLen:65535,sLoginRedirect:'',fnOpenCommentEffect:null,fnAddComment:null,oAddCommentParams:null,fnAfterAddComment:null,oAfterAddCommentParams:null,fnDelComment:null,oDelCommentParams:null,fnAfterDelComment:null,oAfterDelCommentParams:null,fnMoreData:null,fnCloseComments:null,fnReportBad:null,sObjName:null,sUrlPrefix:'',sCircleBaseUrl:'http://q.163.com',fnCloseCommentDiv:null,isHomeModule:false},arguments[5]||{});this._sParentId=sParentId;this._sOrigParentId=sParentId;this._oCommentArray=oCommentArray;this._iTotalCommentCount=iTotalCommentCount;this._sComShowElemId=sComShowElemId;this._sCmPubElemId=sComPubElemId;if(this._oOptions.iPageSize<=0)this._oOptions.iPageSize=10;this._bStatusNotLogin=false;this._bStatusNoRight=false;this._sDefaultVisitorAvatarUrl='http://st.blog.163.com/style/common/stranger.gif';this._iCurrPageIndex=1;this._iTotalPageNumber=0;this.htmleditor;this.sReplayData=null;this._load();return this;},_load:function(){this._computePageNumber();if(this._oOptions.bNeedCheckLogin){if(UD.visitorRank<=-100){this._bStatusNotLogin=true;}else{this._bStatusNotLogin=false;}}if(this._oOptions.bNeedCheckRight){if(UD.visitorRank>=this._oOptions.iAllowComment){this._bStatusNoRight=false;}else{this._bStatusNoRight=true;}}if(NetEase.CommentPublish.commentShowTemplate==null)NetEase.CommentPublish.commentShowTemplate=createJSTAndParse("jst_global_comment_show",jst_global_comment_show);if(NetEase.CommentPublish.commentPubTemplate==null)NetEase.CommentPublish.commentPubTemplate=createJSTAndParse("jst_global_comment_pub",jst_global_comment_pub);this.displayCommentArea();},reload:function(oCommentArray,sParentId,iTotalCommentCount,iAllowComment){this._oCommentArray=oCommentArray;if(!this._bStatusNoRight){this.hideValidCodeImg(this._sOrigParentId);this.htmleditor.emptyContent();}this._sParentId=sParentId;this._oOptions.iAllowComment=iAllowComment;this._iTotalCommentCount=iTotalCommentCount;this._iCurrPageIndex=1;this._computePageNumber();this._setCommentShowArea();},displayCommentArea:function(){this._setCommentShowArea();this._setCommentPubArea();var disable=false;if(this._bStatusNotLogin||this._bStatusNoRight)disable=true;if(!this._bStatusNoRight)this._setHtmlEditor(disable);if(this._oOptions.fnOpenCommentEffect!=null){this._oOptions.fnOpenCommentEffect(this._sParentId,this._initEditor.bind(this));}else{if(this._oOptions.bDefaultPubClose==false){this._blindDownComments(this._sCmPubElemId,this._initEditor.bind(this));}}},_blindDownComments:function(sElemId,fnInit){var _oSucc={success:false};new Effect.BlindDown(sElemId,{stateId:sElemId+"_$$S$$",succObj:_oSucc,duration:0.1,userCallBack:function(){if(fnInit!=null){fnInit();}}});},_blindUpComments:function(sElemId){var _oSucc={success:false};new Effect.BlindUp(sElemId,{stateId:sElemId+"_$$S$$",succObj:_oSucc,duration:0.1});},_setCommentShowArea:function(){var _oData={coms:this._oCommentArray,parentId:this._sParentId,pageNum:this._iCurrPageIndex,totalPageNum:this._iTotalPageNumber,comCount:this._iTotalCommentCount,canClose:this._oOptions.bCanClose,containerObjName:this._oOptions.sObjName,noCommentRight:this._bStatusNoRight,commentRange:this._oOptions.iPageSize,visitorAvatar:this._oOptions.sVisitorAvatar,defaultVisitorAvatarUrl:this._sDefaultVisitorAvatarUrl,hostId:this._oOptions.iHostId,visitorId:this._oOptions.iVisitorId,visitorName:this._oOptions.sVisitorName,hostName:this._oOptions.sHostName,supportDeleteComment:this._oOptions.bSupportDeleteComment,prefix:this._oOptions.sUrlPrefix,circleBaseUrl:this._oOptions.sCircleBaseUrl,isHomeModule:this._oOptions.isHomeModule};var _sShowResult=NetEase.CommentPublish.commentShowTemplate.process(_oData);var _oComShow=$(this._sComShowElemId);if(Trim(_sShowResult)!=""){_oComShow.innerHTML=_sShowResult;_oComShow.style.display="";}else{_oComShow.style.display="none";}},_setCommentPubArea:function(){var _bVisitorAvatarDefault=false;if(this._oOptions.sVisitorAvatar.length<7||this._oOptions.sVisitorAvatar.substr(0,7)=="/style/"||this._oOptions.sVisitorAvatar=="-1000")_bVisitorAvatarDefault=true;var _sUserName;
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -