root / trunk / web / dojo / dojox / atom / widget / FeedEntryViewer.js @ 12
History | View | Annotate | Download (21.1 KB)
1 | 9 | andrej.cim | /*
|
---|---|---|---|
2 | Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved.
|
||
3 | Available via Academic Free License >= 2.1 OR the modified BSD license.
|
||
4 | see: http://dojotoolkit.org/license for details
|
||
5 | */
|
||
6 | |||
7 | |||
8 | if(!dojo._hasResource["dojox.atom.widget.FeedEntryViewer"]){ |
||
9 | dojo._hasResource["dojox.atom.widget.FeedEntryViewer"]=true; |
||
10 | dojo.provide("dojox.atom.widget.FeedEntryViewer");
|
||
11 | dojo.require("dojo.fx");
|
||
12 | dojo.require("dijit._Widget");
|
||
13 | dojo.require("dijit._Templated");
|
||
14 | dojo.require("dijit._Container");
|
||
15 | dojo.require("dijit.layout.ContentPane");
|
||
16 | dojo.require("dojox.atom.io.Connection");
|
||
17 | dojo.requireLocalization("dojox.atom.widget","FeedEntryViewer",null,"ROOT,ar,ca,cs,da,de,el,es,fi,fr,he,hu,it,ja,ko,nb,nl,pl,pt,pt-pt,ro,ru,sk,sl,sv,th,tr,zh,zh-tw"); |
||
18 | dojo.experimental("dojox.atom.widget.FeedEntryViewer");
|
||
19 | dojo.declare("dojox.atom.widget.FeedEntryViewer",[dijit._Widget,dijit._Templated,dijit._Container],{entrySelectionTopic:"",_validEntryFields:{},displayEntrySections:"",_displayEntrySections:null,enableMenu:false,enableMenuFade:false,_optionButtonDisplayed:true,templateString:dojo.cache("dojox.atom","widget/templates/FeedEntryViewer.html","<div class=\"feedEntryViewer\">\n <table border=\"0\" width=\"100%\" class=\"feedEntryViewerMenuTable\" dojoAttachPoint=\"feedEntryViewerMenu\" style=\"display: none;\">\n <tr width=\"100%\" dojoAttachPoint=\"entryCheckBoxDisplayOptions\">\n <td align=\"right\">\n <span class=\"feedEntryViewerMenu\" dojoAttachPoint=\"displayOptions\" dojoAttachEvent=\"onclick:_toggleOptions\"></span>\n </td>\n </tr>\n <tr class=\"feedEntryViewerDisplayCheckbox\" dojoAttachPoint=\"entryCheckBoxRow\" width=\"100%\" style=\"display: none;\">\n <td dojoAttachPoint=\"feedEntryCelltitle\">\n <input type=\"checkbox\" name=\"title\" value=\"Title\" dojoAttachPoint=\"feedEntryCheckBoxTitle\" dojoAttachEvent=\"onclick:_toggleCheckbox\"/>\n\t\t\t\t<label for=\"title\" dojoAttachPoint=\"feedEntryCheckBoxLabelTitle\"></label>\n </td>\n <td dojoAttachPoint=\"feedEntryCellauthors\">\n <input type=\"checkbox\" name=\"authors\" value=\"Authors\" dojoAttachPoint=\"feedEntryCheckBoxAuthors\" dojoAttachEvent=\"onclick:_toggleCheckbox\"/>\n\t\t\t\t<label for=\"title\" dojoAttachPoint=\"feedEntryCheckBoxLabelAuthors\"></label>\n </td>\n <td dojoAttachPoint=\"feedEntryCellcontributors\">\n <input type=\"checkbox\" name=\"contributors\" value=\"Contributors\" dojoAttachPoint=\"feedEntryCheckBoxContributors\" dojoAttachEvent=\"onclick:_toggleCheckbox\"/>\n\t\t\t\t<label for=\"title\" dojoAttachPoint=\"feedEntryCheckBoxLabelContributors\"></label>\n </td>\n <td dojoAttachPoint=\"feedEntryCellid\">\n <input type=\"checkbox\" name=\"id\" value=\"Id\" dojoAttachPoint=\"feedEntryCheckBoxId\" dojoAttachEvent=\"onclick:_toggleCheckbox\"/>\n\t\t\t\t<label for=\"title\" dojoAttachPoint=\"feedEntryCheckBoxLabelId\"></label>\n </td>\n <td rowspan=\"2\" align=\"right\">\n <span class=\"feedEntryViewerMenu\" dojoAttachPoint=\"close\" dojoAttachEvent=\"onclick:_toggleOptions\"></span>\n </td>\n\t\t</tr>\n\t\t<tr class=\"feedEntryViewerDisplayCheckbox\" dojoAttachPoint=\"entryCheckBoxRow2\" width=\"100%\" style=\"display: none;\">\n <td dojoAttachPoint=\"feedEntryCellupdated\">\n <input type=\"checkbox\" name=\"updated\" value=\"Updated\" dojoAttachPoint=\"feedEntryCheckBoxUpdated\" dojoAttachEvent=\"onclick:_toggleCheckbox\"/>\n\t\t\t\t<label for=\"title\" dojoAttachPoint=\"feedEntryCheckBoxLabelUpdated\"></label>\n </td>\n <td dojoAttachPoint=\"feedEntryCellsummary\">\n <input type=\"checkbox\" name=\"summary\" value=\"Summary\" dojoAttachPoint=\"feedEntryCheckBoxSummary\" dojoAttachEvent=\"onclick:_toggleCheckbox\"/>\n\t\t\t\t<label for=\"title\" dojoAttachPoint=\"feedEntryCheckBoxLabelSummary\"></label>\n </td>\n <td dojoAttachPoint=\"feedEntryCellcontent\">\n <input type=\"checkbox\" name=\"content\" value=\"Content\" dojoAttachPoint=\"feedEntryCheckBoxContent\" dojoAttachEvent=\"onclick:_toggleCheckbox\"/>\n\t\t\t\t<label for=\"title\" dojoAttachPoint=\"feedEntryCheckBoxLabelContent\"></label>\n </td>\n </tr>\n </table>\n \n <table class=\"feedEntryViewerContainer\" border=\"0\" width=\"100%\">\n <tr class=\"feedEntryViewerTitle\" dojoAttachPoint=\"entryTitleRow\" style=\"display: none;\">\n <td>\n <table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n <tr class=\"graphic-tab-lgray\">\n\t\t\t\t\t\t<td class=\"lp2\">\n\t\t\t\t\t\t\t<span class=\"lp\" dojoAttachPoint=\"entryTitleHeader\"></span>\n\t\t\t\t\t\t</td>\n </tr>\n <tr>\n <td dojoAttachPoint=\"entryTitleNode\">\n </td>\n </tr>\n </table>\n </td>\n </tr>\n\n <tr class=\"feedEntryViewerAuthor\" dojoAttachPoint=\"entryAuthorRow\" style=\"display: none;\">\n <td>\n <table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n <tr class=\"graphic-tab-lgray\">\n\t\t\t\t\t\t<td class=\"lp2\">\n\t\t\t\t\t\t\t<span class=\"lp\" dojoAttachPoint=\"entryAuthorHeader\"></span>\n\t\t\t\t\t\t</td>\n </tr>\n <tr>\n <td dojoAttachPoint=\"entryAuthorNode\">\n </td>\n </tr>\n </table>\n </td>\n </tr>\n\n <tr class=\"feedEntryViewerContributor\" dojoAttachPoint=\"entryContributorRow\" style=\"display: none;\">\n <td>\n <table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n <tr class=\"graphic-tab-lgray\">\n\t\t\t\t\t\t<td class=\"lp2\">\n\t\t\t\t\t\t\t<span class=\"lp\" dojoAttachPoint=\"entryContributorHeader\"></span>\n\t\t\t\t\t\t</td>\n </tr>\n <tr>\n <td dojoAttachPoint=\"entryContributorNode\" class=\"feedEntryViewerContributorNames\">\n </td>\n </tr>\n </table>\n </td>\n </tr>\n \n <tr class=\"feedEntryViewerId\" dojoAttachPoint=\"entryIdRow\" style=\"display: none;\">\n <td>\n <table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n <tr class=\"graphic-tab-lgray\">\n\t\t\t\t\t\t<td class=\"lp2\">\n\t\t\t\t\t\t\t<span class=\"lp\" dojoAttachPoint=\"entryIdHeader\"></span>\n\t\t\t\t\t\t</td>\n </tr>\n <tr>\n <td dojoAttachPoint=\"entryIdNode\" class=\"feedEntryViewerIdText\">\n </td>\n </tr>\n </table>\n </td>\n </tr>\n \n <tr class=\"feedEntryViewerUpdated\" dojoAttachPoint=\"entryUpdatedRow\" style=\"display: none;\">\n <td>\n <table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n <tr class=\"graphic-tab-lgray\">\n\t\t\t\t\t\t<td class=\"lp2\">\n\t\t\t\t\t\t\t<span class=\"lp\" dojoAttachPoint=\"entryUpdatedHeader\"></span>\n\t\t\t\t\t\t</td>\n </tr>\n <tr>\n <td dojoAttachPoint=\"entryUpdatedNode\" class=\"feedEntryViewerUpdatedText\">\n </td>\n </tr>\n </table>\n </td>\n </tr>\n \n <tr class=\"feedEntryViewerSummary\" dojoAttachPoint=\"entrySummaryRow\" style=\"display: none;\">\n <td>\n <table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n <tr class=\"graphic-tab-lgray\">\n\t\t\t\t\t\t<td class=\"lp2\">\n\t\t\t\t\t\t\t<span class=\"lp\" dojoAttachPoint=\"entrySummaryHeader\"></span>\n\t\t\t\t\t\t</td>\n </tr>\n <tr>\n <td dojoAttachPoint=\"entrySummaryNode\">\n </td>\n </tr>\n </table>\n </td>\n </tr>\n \n <tr class=\"feedEntryViewerContent\" dojoAttachPoint=\"entryContentRow\" style=\"display: none;\">\n <td>\n <table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n <tr class=\"graphic-tab-lgray\">\n\t\t\t\t\t\t<td class=\"lp2\">\n\t\t\t\t\t\t\t<span class=\"lp\" dojoAttachPoint=\"entryContentHeader\"></span>\n\t\t\t\t\t\t</td>\n </tr>\n <tr>\n <td dojoAttachPoint=\"entryContentNode\">\n </td>\n </tr>\n </table>\n </td>\n </tr>\n </table>\n</div>\n"),_entry:null,_feed:null,_editMode:false,postCreate:function(){ |
||
20 | if(this.entrySelectionTopic!==""){ |
||
21 | this._subscriptions=[dojo.subscribe(this.entrySelectionTopic,this,"_handleEvent")]; |
||
22 | } |
||
23 | var _1=dojo.i18n.getLocalization("dojox.atom.widget","FeedEntryViewer"); |
||
24 | this.displayOptions.innerHTML=_1.displayOptions;
|
||
25 | this.feedEntryCheckBoxLabelTitle.innerHTML=_1.title;
|
||
26 | this.feedEntryCheckBoxLabelAuthors.innerHTML=_1.authors;
|
||
27 | this.feedEntryCheckBoxLabelContributors.innerHTML=_1.contributors;
|
||
28 | this.feedEntryCheckBoxLabelId.innerHTML=_1.id;
|
||
29 | this.close.innerHTML=_1.close;
|
||
30 | this.feedEntryCheckBoxLabelUpdated.innerHTML=_1.updated;
|
||
31 | this.feedEntryCheckBoxLabelSummary.innerHTML=_1.summary;
|
||
32 | this.feedEntryCheckBoxLabelContent.innerHTML=_1.content;
|
||
33 | },startup:function(){ |
||
34 | if(this.displayEntrySections===""){ |
||
35 | this._displayEntrySections=["title","authors","contributors","summary","content","id","updated"]; |
||
36 | }else{
|
||
37 | this._displayEntrySections=this.displayEntrySections.split(","); |
||
38 | } |
||
39 | this._setDisplaySectionsCheckboxes();
|
||
40 | if(this.enableMenu){ |
||
41 | dojo.style(this.feedEntryViewerMenu,"display",""); |
||
42 | if(this.entryCheckBoxRow&&this.entryCheckBoxRow2){ |
||
43 | if(this.enableMenuFade){ |
||
44 | dojo.fadeOut({node:this.entryCheckBoxRow,duration:250}).play(); |
||
45 | dojo.fadeOut({node:this.entryCheckBoxRow2,duration:250}).play(); |
||
46 | } |
||
47 | } |
||
48 | } |
||
49 | },clear:function(){ |
||
50 | this.destroyDescendants();
|
||
51 | this._entry=null; |
||
52 | this._feed=null; |
||
53 | this.clearNodes();
|
||
54 | },clearNodes:function(){ |
||
55 | dojo.forEach(["entryTitleRow","entryAuthorRow","entryContributorRow","entrySummaryRow","entryContentRow","entryIdRow","entryUpdatedRow"],function(_2){ |
||
56 | dojo.style(this[_2],"display","none"); |
||
57 | },this);
|
||
58 | dojo.forEach(["entryTitleNode","entryTitleHeader","entryAuthorHeader","entryContributorHeader","entryContributorNode","entrySummaryHeader","entrySummaryNode","entryContentHeader","entryContentNode","entryIdNode","entryIdHeader","entryUpdatedHeader","entryUpdatedNode"],function(_3){ |
||
59 | while(this[_3].firstChild){ |
||
60 | dojo.destroy(this[_3].firstChild);
|
||
61 | } |
||
62 | },this);
|
||
63 | },setEntry:function(_4,_5,_6){ |
||
64 | this.clear();
|
||
65 | this._validEntryFields={};
|
||
66 | this._entry=_4;
|
||
67 | this._feed=_5;
|
||
68 | if(_4!==null){ |
||
69 | if(this.entryTitleHeader){ |
||
70 | this.setTitleHeader(this.entryTitleHeader,_4); |
||
71 | } |
||
72 | if(this.entryTitleNode){ |
||
73 | this.setTitle(this.entryTitleNode,this._editMode,_4); |
||
74 | } |
||
75 | if(this.entryAuthorHeader){ |
||
76 | this.setAuthorsHeader(this.entryAuthorHeader,_4); |
||
77 | } |
||
78 | if(this.entryAuthorNode){ |
||
79 | this.setAuthors(this.entryAuthorNode,this._editMode,_4); |
||
80 | } |
||
81 | if(this.entryContributorHeader){ |
||
82 | this.setContributorsHeader(this.entryContributorHeader,_4); |
||
83 | } |
||
84 | if(this.entryContributorNode){ |
||
85 | this.setContributors(this.entryContributorNode,this._editMode,_4); |
||
86 | } |
||
87 | if(this.entryIdHeader){ |
||
88 | this.setIdHeader(this.entryIdHeader,_4); |
||
89 | } |
||
90 | if(this.entryIdNode){ |
||
91 | this.setId(this.entryIdNode,this._editMode,_4); |
||
92 | } |
||
93 | if(this.entryUpdatedHeader){ |
||
94 | this.setUpdatedHeader(this.entryUpdatedHeader,_4); |
||
95 | } |
||
96 | if(this.entryUpdatedNode){ |
||
97 | this.setUpdated(this.entryUpdatedNode,this._editMode,_4); |
||
98 | } |
||
99 | if(this.entrySummaryHeader){ |
||
100 | this.setSummaryHeader(this.entrySummaryHeader,_4); |
||
101 | } |
||
102 | if(this.entrySummaryNode){ |
||
103 | this.setSummary(this.entrySummaryNode,this._editMode,_4); |
||
104 | } |
||
105 | if(this.entryContentHeader){ |
||
106 | this.setContentHeader(this.entryContentHeader,_4); |
||
107 | } |
||
108 | if(this.entryContentNode){ |
||
109 | this.setContent(this.entryContentNode,this._editMode,_4); |
||
110 | } |
||
111 | } |
||
112 | this._displaySections();
|
||
113 | },setTitleHeader:function(_7,_8){ |
||
114 | if(_8.title&&_8.title.value&&_8.title.value!==null){ |
||
115 | var _9=dojo.i18n.getLocalization("dojox.atom.widget","FeedEntryViewer"); |
||
116 | var _a=new dojox.atom.widget.EntryHeader({title:_9.title}); |
||
117 | _7.appendChild(_a.domNode); |
||
118 | } |
||
119 | },setTitle:function(_b,_c,_d){ |
||
120 | if(_d.title&&_d.title.value&&_d.title.value!==null){ |
||
121 | if(_d.title.type=="text"){ |
||
122 | var _e=document.createTextNode(_d.title.value);
|
||
123 | _b.appendChild(_e); |
||
124 | }else{
|
||
125 | var _f=document.createElement("span"); |
||
126 | var _10=new dijit.layout.ContentPane({refreshOnShow:true,executeScripts:false},_f); |
||
127 | _10.attr("content",_d.title.value);
|
||
128 | _b.appendChild(_10.domNode); |
||
129 | } |
||
130 | this.setFieldValidity("title",true); |
||
131 | } |
||
132 | },setAuthorsHeader:function(_11,_12){ |
||
133 | if(_12.authors&&_12.authors.length>0){ |
||
134 | var _13=dojo.i18n.getLocalization("dojox.atom.widget","FeedEntryViewer"); |
||
135 | var _14=new dojox.atom.widget.EntryHeader({title:_13.authors}); |
||
136 | _11.appendChild(_14.domNode); |
||
137 | } |
||
138 | },setAuthors:function(_15,_16,_17){ |
||
139 | _15.innerHTML="";
|
||
140 | if(_17.authors&&_17.authors.length>0){ |
||
141 | for(var i in _17.authors){ |
||
142 | if(_17.authors[i].name){
|
||
143 | var _18=_15;
|
||
144 | if(_17.authors[i].uri){
|
||
145 | var _19=document.createElement("a"); |
||
146 | _18.appendChild(_19); |
||
147 | _19.href=_17.authors[i].uri; |
||
148 | _18=_19; |
||
149 | } |
||
150 | var _1a=_17.authors[i].name;
|
||
151 | if(_17.authors[i].email){
|
||
152 | _1a=_1a+" ("+_17.authors[i].email+")"; |
||
153 | } |
||
154 | var _1b=document.createTextNode(_1a);
|
||
155 | _18.appendChild(_1b); |
||
156 | var _1c=document.createElement("br"); |
||
157 | _15.appendChild(_1c); |
||
158 | this.setFieldValidity("authors",true); |
||
159 | } |
||
160 | } |
||
161 | } |
||
162 | },setContributorsHeader:function(_1d,_1e){ |
||
163 | if(_1e.contributors&&_1e.contributors.length>0){ |
||
164 | var _1f=dojo.i18n.getLocalization("dojox.atom.widget","FeedEntryViewer"); |
||
165 | var _20=new dojox.atom.widget.EntryHeader({title:_1f.contributors}); |
||
166 | _1d.appendChild(_20.domNode); |
||
167 | } |
||
168 | },setContributors:function(_21,_22,_23){ |
||
169 | if(_23.contributors&&_23.contributors.length>0){ |
||
170 | for(var i in _23.contributors){ |
||
171 | var _24=document.createTextNode(_23.contributors[i].name);
|
||
172 | _21.appendChild(_24); |
||
173 | var _25=document.createElement("br"); |
||
174 | _21.appendChild(_25); |
||
175 | this.setFieldValidity("contributors",true); |
||
176 | } |
||
177 | } |
||
178 | },setIdHeader:function(_26,_27){ |
||
179 | if(_27.id&&_27.id!==null){ |
||
180 | var _28=dojo.i18n.getLocalization("dojox.atom.widget","FeedEntryViewer"); |
||
181 | var _29=new dojox.atom.widget.EntryHeader({title:_28.id}); |
||
182 | _26.appendChild(_29.domNode); |
||
183 | } |
||
184 | },setId:function(_2a,_2b,_2c){ |
||
185 | if(_2c.id&&_2c.id!==null){ |
||
186 | var _2d=document.createTextNode(_2c.id);
|
||
187 | _2a.appendChild(_2d); |
||
188 | this.setFieldValidity("id",true); |
||
189 | } |
||
190 | },setUpdatedHeader:function(_2e,_2f){ |
||
191 | if(_2f.updated&&_2f.updated!==null){ |
||
192 | var _30=dojo.i18n.getLocalization("dojox.atom.widget","FeedEntryViewer"); |
||
193 | var _31=new dojox.atom.widget.EntryHeader({title:_30.updated}); |
||
194 | _2e.appendChild(_31.domNode); |
||
195 | } |
||
196 | },setUpdated:function(_32,_33,_34){ |
||
197 | if(_34.updated&&_34.updated!==null){ |
||
198 | var _35=document.createTextNode(_34.updated);
|
||
199 | _32.appendChild(_35); |
||
200 | this.setFieldValidity("updated",true); |
||
201 | } |
||
202 | },setSummaryHeader:function(_36,_37){ |
||
203 | if(_37.summary&&_37.summary.value&&_37.summary.value!==null){ |
||
204 | var _38=dojo.i18n.getLocalization("dojox.atom.widget","FeedEntryViewer"); |
||
205 | var _39=new dojox.atom.widget.EntryHeader({title:_38.summary}); |
||
206 | _36.appendChild(_39.domNode); |
||
207 | } |
||
208 | },setSummary:function(_3a,_3b,_3c){ |
||
209 | if(_3c.summary&&_3c.summary.value&&_3c.summary.value!==null){ |
||
210 | var _3d=document.createElement("span"); |
||
211 | var _3e=new dijit.layout.ContentPane({refreshOnShow:true,executeScripts:false},_3d); |
||
212 | _3e.attr("content",_3c.summary.value);
|
||
213 | _3a.appendChild(_3e.domNode); |
||
214 | this.setFieldValidity("summary",true); |
||
215 | } |
||
216 | },setContentHeader:function(_3f,_40){ |
||
217 | if(_40.content&&_40.content.value&&_40.content.value!==null){ |
||
218 | var _41=dojo.i18n.getLocalization("dojox.atom.widget","FeedEntryViewer"); |
||
219 | var _42=new dojox.atom.widget.EntryHeader({title:_41.content}); |
||
220 | _3f.appendChild(_42.domNode); |
||
221 | } |
||
222 | },setContent:function(_43,_44,_45){ |
||
223 | if(_45.content&&_45.content.value&&_45.content.value!==null){ |
||
224 | var _46=document.createElement("span"); |
||
225 | var _47=new dijit.layout.ContentPane({refreshOnShow:true,executeScripts:false},_46); |
||
226 | _47.attr("content",_45.content.value);
|
||
227 | _43.appendChild(_47.domNode); |
||
228 | this.setFieldValidity("content",true); |
||
229 | } |
||
230 | },_displaySections:function(){ |
||
231 | dojo.style(this.entryTitleRow,"display","none"); |
||
232 | dojo.style(this.entryAuthorRow,"display","none"); |
||
233 | dojo.style(this.entryContributorRow,"display","none"); |
||
234 | dojo.style(this.entrySummaryRow,"display","none"); |
||
235 | dojo.style(this.entryContentRow,"display","none"); |
||
236 | dojo.style(this.entryIdRow,"display","none"); |
||
237 | dojo.style(this.entryUpdatedRow,"display","none"); |
||
238 | for(var i in this._displayEntrySections){ |
||
239 | var _48=this._displayEntrySections[i].toLowerCase(); |
||
240 | if(_48==="title"&&this.isFieldValid("title")){ |
||
241 | dojo.style(this.entryTitleRow,"display",""); |
||
242 | } |
||
243 | if(_48==="authors"&&this.isFieldValid("authors")){ |
||
244 | dojo.style(this.entryAuthorRow,"display",""); |
||
245 | } |
||
246 | if(_48==="contributors"&&this.isFieldValid("contributors")){ |
||
247 | dojo.style(this.entryContributorRow,"display",""); |
||
248 | } |
||
249 | if(_48==="summary"&&this.isFieldValid("summary")){ |
||
250 | dojo.style(this.entrySummaryRow,"display",""); |
||
251 | } |
||
252 | if(_48==="content"&&this.isFieldValid("content")){ |
||
253 | dojo.style(this.entryContentRow,"display",""); |
||
254 | } |
||
255 | if(_48==="id"&&this.isFieldValid("id")){ |
||
256 | dojo.style(this.entryIdRow,"display",""); |
||
257 | } |
||
258 | if(_48==="updated"&&this.isFieldValid("updated")){ |
||
259 | dojo.style(this.entryUpdatedRow,"display",""); |
||
260 | } |
||
261 | } |
||
262 | },setDisplaySections:function(_49){ |
||
263 | if(_49!==null){ |
||
264 | this._displayEntrySections=_49;
|
||
265 | this._displaySections();
|
||
266 | }else{
|
||
267 | this._displayEntrySections=["title","authors","contributors","summary","content","id","updated"]; |
||
268 | } |
||
269 | },_setDisplaySectionsCheckboxes:function(){ |
||
270 | var _4a=["title","authors","contributors","summary","content","id","updated"]; |
||
271 | for(var i in _4a){ |
||
272 | if(dojo.indexOf(this._displayEntrySections,_4a[i])==-1){ |
||
273 | dojo.style(this["feedEntryCell"+_4a[i]],"display","none"); |
||
274 | }else{
|
||
275 | this["feedEntryCheckBox"+_4a[i].substring(0,1).toUpperCase()+_4a[i].substring(1)].checked=true; |
||
276 | } |
||
277 | } |
||
278 | },_readDisplaySections:function(){ |
||
279 | var _4b=[];
|
||
280 | if(this.feedEntryCheckBoxTitle.checked){ |
||
281 | _4b.push("title");
|
||
282 | } |
||
283 | if(this.feedEntryCheckBoxAuthors.checked){ |
||
284 | _4b.push("authors");
|
||
285 | } |
||
286 | if(this.feedEntryCheckBoxContributors.checked){ |
||
287 | _4b.push("contributors");
|
||
288 | } |
||
289 | if(this.feedEntryCheckBoxSummary.checked){ |
||
290 | _4b.push("summary");
|
||
291 | } |
||
292 | if(this.feedEntryCheckBoxContent.checked){ |
||
293 | _4b.push("content");
|
||
294 | } |
||
295 | if(this.feedEntryCheckBoxId.checked){ |
||
296 | _4b.push("id");
|
||
297 | } |
||
298 | if(this.feedEntryCheckBoxUpdated.checked){ |
||
299 | _4b.push("updated");
|
||
300 | } |
||
301 | this._displayEntrySections=_4b;
|
||
302 | },_toggleCheckbox:function(_4c){ |
||
303 | if(_4c.checked){
|
||
304 | _4c.checked=false;
|
||
305 | }else{
|
||
306 | _4c.checked=true;
|
||
307 | } |
||
308 | this._readDisplaySections();
|
||
309 | this._displaySections();
|
||
310 | },_toggleOptions:function(_4d){ |
||
311 | if(this.enableMenu){ |
||
312 | var _4e=null; |
||
313 | var _4f;
|
||
314 | var _50;
|
||
315 | if(this._optionButtonDisplayed){ |
||
316 | if(this.enableMenuFade){ |
||
317 | _4f=dojo.fadeOut({node:this.entryCheckBoxDisplayOptions,duration:250}); |
||
318 | dojo.connect(_4f,"onEnd",this,function(){ |
||
319 | dojo.style(this.entryCheckBoxDisplayOptions,"display","none"); |
||
320 | dojo.style(this.entryCheckBoxRow,"display",""); |
||
321 | dojo.style(this.entryCheckBoxRow2,"display",""); |
||
322 | dojo.fadeIn({node:this.entryCheckBoxRow,duration:250}).play(); |
||
323 | dojo.fadeIn({node:this.entryCheckBoxRow2,duration:250}).play(); |
||
324 | }); |
||
325 | _4f.play(); |
||
326 | }else{
|
||
327 | dojo.style(this.entryCheckBoxDisplayOptions,"display","none"); |
||
328 | dojo.style(this.entryCheckBoxRow,"display",""); |
||
329 | dojo.style(this.entryCheckBoxRow2,"display",""); |
||
330 | } |
||
331 | this._optionButtonDisplayed=false; |
||
332 | }else{
|
||
333 | if(this.enableMenuFade){ |
||
334 | _4f=dojo.fadeOut({node:this.entryCheckBoxRow,duration:250}); |
||
335 | _50=dojo.fadeOut({node:this.entryCheckBoxRow2,duration:250}); |
||
336 | dojo.connect(_4f,"onEnd",this,function(){ |
||
337 | dojo.style(this.entryCheckBoxRow,"display","none"); |
||
338 | dojo.style(this.entryCheckBoxRow2,"display","none"); |
||
339 | dojo.style(this.entryCheckBoxDisplayOptions,"display",""); |
||
340 | dojo.fadeIn({node:this.entryCheckBoxDisplayOptions,duration:250}).play(); |
||
341 | }); |
||
342 | _4f.play(); |
||
343 | _50.play(); |
||
344 | }else{
|
||
345 | dojo.style(this.entryCheckBoxRow,"display","none"); |
||
346 | dojo.style(this.entryCheckBoxRow2,"display","none"); |
||
347 | dojo.style(this.entryCheckBoxDisplayOptions,"display",""); |
||
348 | } |
||
349 | this._optionButtonDisplayed=true; |
||
350 | } |
||
351 | } |
||
352 | },_handleEvent:function(_51){ |
||
353 | if(_51.source!=this){ |
||
354 | if(_51.action=="set"&&_51.entry){ |
||
355 | this.setEntry(_51.entry,_51.feed);
|
||
356 | }else{
|
||
357 | if(_51.action=="delete"&&_51.entry&&_51.entry==this._entry){ |
||
358 | this.clear();
|
||
359 | } |
||
360 | } |
||
361 | } |
||
362 | },setFieldValidity:function(_52,_53){ |
||
363 | if(_52){
|
||
364 | var _54=_52.toLowerCase();
|
||
365 | this._validEntryFields[_52]=_53;
|
||
366 | } |
||
367 | },isFieldValid:function(_55){ |
||
368 | return this._validEntryFields[_55.toLowerCase()]; |
||
369 | },getEntry:function(){ |
||
370 | return this._entry; |
||
371 | },getFeed:function(){ |
||
372 | return this._feed; |
||
373 | },destroy:function(){ |
||
374 | this.clear();
|
||
375 | dojo.forEach(this._subscriptions,dojo.unsubscribe);
|
||
376 | }}); |
||
377 | dojo.declare("dojox.atom.widget.EntryHeader",[dijit._Widget,dijit._Templated,dijit._Container],{title:"",templateString:dojo.cache("dojox.atom","widget/templates/EntryHeader.html","<span dojoAttachPoint=\"entryHeaderNode\" class=\"entryHeaderNode\"></span>\n"),postCreate:function(){ |
||
378 | this.setListHeader();
|
||
379 | },setListHeader:function(_56){ |
||
380 | this.clear();
|
||
381 | if(_56){
|
||
382 | this.title=_56;
|
||
383 | } |
||
384 | var _57=document.createTextNode(this.title); |
||
385 | this.entryHeaderNode.appendChild(_57);
|
||
386 | },clear:function(){ |
||
387 | this.destroyDescendants();
|
||
388 | if(this.entryHeaderNode){ |
||
389 | for(var i=0;i<this.entryHeaderNode.childNodes.length;i++){ |
||
390 | this.entryHeaderNode.removeChild(this.entryHeaderNode.childNodes[i]); |
||
391 | } |
||
392 | } |
||
393 | },destroy:function(){ |
||
394 | this.clear();
|
||
395 | }}); |
||
396 | } |