$().ready(function(){ _({$:[{select:"body",$:[{$:[{select:"#GameTitle",bind:"Name",source:{id:"$.5",path:"/PageView/Page/Views/Index.aspx",params:[{bind:"GameID",mode:"Hash",value:"2"}]}},{id:"LeftList",select:"#leftMenu ul li:eq(1)",source:{id:"LeftList",path:"/PageView/Page/Views/Index.aspx",result:{List:[{Name:"华夏1",Id:1},{Name:"华夏2",Id:2},{Name:"华夏1免费版",Id:3},{Name:"QQ华夏",Id:4},{Name:"华夏前传",Id:7}]}},$:[{find:"a",bind:"Name",attrs:[{name:"href",format:"QuestionType.shtml#GameID={Id}"}],onclick:function(data, parentData){ $("#GameTitle").html(data.Name); this.parent().parent().find("a").removeClass("selectLink"); this.parent().parent().find("li").removeClass("blue"); this.parent().parent().find("li").addClass("blue"); this.parent().removeClass("blue"); this.addClass("selectLink"); if (_.questionTypeList) _.questionTypeList.load({ GameID: data.Id }); }}],onrequestend:function(source){ var ls = source.List; for (var i = 0; i < ls.length; i++) { ls[i].Name += "专区"; } //ls.push({ Name: "其它游戏", Id: "0" }); },oneach:function(data, idx){ this.addClass("blue"); var gameId = RequestHash["GameID"]; if (gameId == undefined) gameId = 1 if (gameId != undefined) { if (data.Id == gameId) { this.find("a").addClass("selectLink"); $("#GameTitle").html(data.Name); $("#QuestionTypeTitle").html(data.Name); this.removeClass("blue"); } } }},{id:"ChildQuestionTypeList",select:"#ChildQuestionType",source:{id:"ChildQuestionTypeList",path:"/PageView/Page/Views/Index.aspx",params:[{bind:"GameID",mode:"HashAndInstance",value:"2"}]},$:[{find:"div.askName",bind:"Name",subStringLength:10,attrs:[{name:"title",bind:"Name"},{name:"QuestionID",bind:"Id"}]},{find:"div.askTitle",onmousedown:function(){ var n = this.next(); if(!n.is(":hidden")) return; $(".askMain, .askFooter").hide(); $(".askTitle").removeClass("askTitleD"); $(".askTitle").addClass("askTitleR"); var f = n.next(); this.removeClass("askTitleR"); this.addClass("askTitleD"); n.fadeIn("fast"); f.show(); }},{id:"questionTypeItem",find:"ul li",each:"VisibleChildren",$:[{find:"a",bind:"Name",attrs:[{name:"href",format:"QuestionType.shtml#QuestionTypeID={Id}&GameID={GameID}&QuestionFormID={QuestionFormID}"}],onclick:function(data, parentData){ $(".askContent a").css({ fontWeight: "normal", color: "#646464" }); this.css({ fontWeight: "bold", color: "#003DA7" }); $("#QuestionTypeTitle").html(data.parent.Name); $("#SubQuestionTypeTitle").html(data.Name); $("#QuestionTypeID").val(data.Id); $("#GameID").val(data.GameID); $("#theForm").each(function() { this.reset(); }); if(_.TheForm) _.TheForm.reset(); $("#formPanel").fadeIn("fast"); $("#messagePanel").fadeOut("fast"); /* 更新表单部分 */ $("#QuestionBigTypeID").val(data.parent.Id); $("#QuestionBigTypeID").trigger("change"); var qid = data.Id; setTimeout(function() { $("#QuestionTypeID").val(qid); $("#QuestionTypeID").trigger("change"); }, 50); setTimeout(function() { $("#QuestionTypeID").val(qid); $("#QuestionTypeID").trigger("change"); }, 500); },onsetvalue:function(data, v, o, parentData){ if (data.Id + "" == RequestHash["QuestionTypeID"]) { this.css({ fontWeight: "bold", color: "#003DA7" }); var m = this.parents(".askMain"); m.fadeIn("slow"); m.next().show(); m.prev().removeClass("askTitleR"); m.prev().addClass("askTitleD"); $("#QuestionTypeTitle").html(data.parent.Name); $("#SubQuestionTypeTitle").html(data.Name); /* 更新表单部分 $("#QuestionBigTypeID").val(data.parent.Id); alert($("#QuestionBigTypeID").val()); */ $("#QuestionTypeID").val(data.Id); $("#GameID").val(data.GameID); } }}]}]},{onready:function(){ $("#leftMenu").fadeIn(); }}]},{id:"questionTypeList",find:"#questionType",source:{id:"questionTypeList",path:"/PageView/Page/Views/Index.aspx",params:[{bind:"GameID",mode:"HashAndInstance",value:"1"},{bind:"ParentID",value:"0"}]},$:[{find:"div.titleContent",bind:"Name"},{id:"questionTypeItem",find:"ul li",source:{id:"questionTypeItem",path:"/PageView/Page/Views/Index.aspx",params:[{name:"GameId",bind:"GameID",value:"0"},{name:"ParentId",bind:"Id",value:"0"}]},$:[{find:"a",bind:"Name",attrs:[{name:"href",format:"QuestionType_{QuestionFormID}.shtml#QuestionTypeID={Id}&GameID={GameID}"}]}]}]}]}]}); });