活动页面添加参赛作品瀑布流
[PumpkinHouse.git] / PumpkinHouseWeb / Notice.aspx
blob4333aae39f10b8cb7961bf56a90ba2837eaa55c2
1 <%@ Page Language="C#" Title="我的提醒 - 木头盒子" AutoEventWireup="true" CodeBehind="Notice.aspx.cs" Inherits="PumpkinHouse.Notice" MasterPageFile="~/Site.Master" %>\r
2 \r
3 <asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">\r
4     <script type="text/javascript">\r
5         var globalTabs;\r
6 \r
7         function renderAnnouncement(announceList) {\r
8             renderTemplate('#tab3', '#announcementTemplate', announceList);\r
9             document.title = '通知 - 木头盒子';\r
10         }\r
12         function renderNotice(noticeList) {\r
13             renderTemplate('#tab1', '#noticeTemplate', noticeList.list);\r
14             document.title = '提醒 - 木头盒子';\r
15         }\r
16         function renderReply(noticeList) {\r
17             renderTemplate('#tab2', '#noticeTemplate', noticeList.list);\r
18             document.title = '回复 - 木头盒子';\r
19         }\r
21         function initAnnoucementPagination() {\r
23         }\r
25         function initNoticePagination(result) {\r
26             pagination('#pagination', result.count, 20, noticePageSelectCallback);\r
27             renderNotice(result);\r
28         }\r
30         function noticePageSelectCallback(pageNumber, container) {\r
31             ajaxGetNotice(\r
32                 true,\r
33                 11, //         Collect = 1, Fan = 2, Like = 8\r
34                 pageNumber,\r
35                 renderNotice,\r
36                 handleFault);\r
37         }\r
39         function initReplyPagination(result) {\r
40             pagination('#pagination', result.count, 20, replyPageSelectCallback);\r
41             renderReply(result);\r
42         }\r
44         function initAnnouncementPagination(result) {\r
45             pagination('#pagination', 0, 20, replyPageSelectCallback);\r
46             renderAnnouncement(result);\r
47         }\r
49         function replyPageSelectCallback(pageNumber, container) {\r
50             ajaxGetNotice(\r
51                 true, \r
52                 4, //         Collect = 1, Fan = 2, Like = 8\r
53                 pageNumber,\r
54                 renderReply,\r
55                 handleFault);\r
56         }\r
58         function doAction () {\r
59             $.getTmplSync('/template/noticeTemplate.html');\r
61             globalTabs = $('#noticeHolder').tabs({\r
62                 select: function (event, ui) {\r
63                     var tabName = $(ui.tab).attr('href');\r
64                     location.hash = tabName;\r
65                     return true;\r
66                 },\r
67                 show: function (event, ui) {\r
68                     var index = ($(this).tabs('option', 'selected'));\r
69                     switch (index) {\r
70                         case 0:\r
71                             ajaxGetNotice(\r
72                                 true,\r
73                                 11, //         Collect = 1, Fan = 2, Like = 8\r
74                                 0,\r
75                                 initNoticePagination,\r
76                                 handleFault);\r
77                             break;\r
78                         case 1:\r
79                             ajaxGetNotice(\r
80                                 true,\r
81                                 4, //         Reply = 4\r
82                                 0,\r
83                                 initReplyPagination,\r
84                                 handleFault);\r
85                             break;\r
86                         case 2:\r
87                             ajaxGetNotice(\r
88                                 true,\r
89                                 16,\r
90                                 0, initAnnouncementPagination, handleFault);\r
91                             break;\r
92                     }\r
93                 }\r
94             });\r
96             $('#noticeHolder').show();\r
98             $('.noticeLink').live('click', function () {\r
99                 var index = parseInt($(this).attr('data-tab-index'));\r
100                 if (index == globalTabs.tabs('option', 'selected')) return false;\r
101                 globalTabs.tabs('select', index);\r
102                 setTimeout(function () {\r
103                     window.scrollTo(0, 0);\r
104                     ajaxGetNoticeSummary(true, renderAlert, getSummaryFailed);\r
105                 }, 1);\r
106             });\r
107             \r
108         }\r
109     </script>\r
110 </asp:Content>\r
111 <asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">\r
112 <style type="text/css">\r
113     /*重构UI自带CSS代码*/\r
114         .ui-corner-all{border-radius:0px; border:none; border-top:1px solid #AEAEAE;}\r
115         .ui-widget-header{background:none; background:#EDEDED; border:none;}\r
116         .ui-corner-al{border:none; background:#FFFFFF}\r
117         .ui-tabs-selected,.ui-state-active,.ui-state-hover{border:none; background:#FFFFFF; border-radius:0px; }\r
118         .ui-state-default{border:none; background:none; font-family:'微软雅黑'; color:#28a7ff; font-size:16px;}\r
119         ui-state-default a{background:none;}\r
120         .ui-state-default a:hover{color:#28a7ff; font-size:16px; background:none;}\r
121         .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #28a7ff; text-decoration: none; cursor:pointer;}\r
122         .ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus{ background:#FFFFFF;}    \r
123         .ui-corner-all ul li a{background:none; border:1px solod red}\r
124 </style>\r
125     <div class="siteLink clearfix" style="width:800px; height:55px; margin-top:50px;"><a href="/">木头盒子首页</a> >消息提醒</div>\r
126     <div id="noticeHolder" class="NoticeBox" style="border: 0px solid red; background: none; display:none">\r
127             <ul style="border:none; background: #F6F6F6; height:37px;">\r
128                     <li style="border:none; margin-left:10px;"><a href="#tab1">与我有关</a></li>\r
129                     <li style="border:none;"><a href="#tab2">评论回复</a></li>\r
130                     <li style="border:none;"><a href="#tab3">通知</a></li>\r
131             </ul>\r
132             <div id="tab1" style="border: 0px solid red; float:left">\r
133                         \r
134             </div>\r
135         <div id="tab2" style="border: 0px solid red; float:left">\r
136                         \r
137             </div>\r
138         <div id="tab3" style="border: 0px solid red; float:left">\r
139                         \r
140             </div>\r
141     </div>\r
142     <div id="pagination"></div>\r
143 </asp:Content>