| 1 |
define([ |
| 2 |
"dojo/_base/kernel", |
| 3 |
"dojo/_base/connect", |
| 4 |
"dojo/_base/declare", |
| 5 |
"dojo/_base/fx", |
| 6 |
"dojo/_base/array", |
| 7 |
"dojo/dom-style", |
| 8 |
"dojo/dom-construct", |
| 9 |
"dijit/_Widget", |
| 10 |
"dijit/_Templated", |
| 11 |
"dijit/_Container", |
| 12 |
"dijit/layout/ContentPane", |
| 13 |
"../io/Connection", |
| 14 |
"dojo/text!./templates/FeedEntryViewer.html", |
| 15 |
"dojo/text!./templates/EntryHeader.html", |
| 16 |
"dojo/i18n!./nls/FeedEntryViewer" |
| 17 |
], function (dojo, connect, declare, fx, arrayUtil, domStyle, domConstruct, _Widget, _Templated, _Container, ContentPane, Connection, template, headerTemplate, i18nViewer) { |
| 18 |
|
| 19 |
dojo.experimental("dojox.atom.widget.FeedEntryViewer"); |
| 20 |
|
| 21 |
|
| 22 |
var FeedEntryViewer = declare("dojox.atom.widget.FeedEntryViewer", [_Widget, _Templated, _Container],{ |
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
entrySelectionTopic: "", |
| 27 |
|
| 28 |
_validEntryFields: {}, |
| 29 |
|
| 30 |
displayEntrySections: "", |
| 31 |
_displayEntrySections: null, |
| 32 |
|
| 33 |
|
| 34 |
enableMenu: false, |
| 35 |
enableMenuFade: false, |
| 36 |
_optionButtonDisplayed: true, |
| 37 |
|
| 38 |
|
| 39 |
templateString: template, |
| 40 |
|
| 41 |
_entry: null, |
| 42 |
_feed: null, |
| 43 |
|
| 44 |
_editMode: false, |
| 45 |
|
| 46 |
postCreate: function(){ |
| 47 |
if(this.entrySelectionTopic !== ""){ |
| 48 |
this._subscriptions = [dojo.subscribe(this.entrySelectionTopic, this, "_handleEvent")]; |
| 49 |
} |
| 50 |
var _nlsResources = i18nViewer; |
| 51 |
this.displayOptions.innerHTML = _nlsResources.displayOptions; |
| 52 |
this.feedEntryCheckBoxLabelTitle.innerHTML = _nlsResources.title; |
| 53 |
this.feedEntryCheckBoxLabelAuthors.innerHTML = _nlsResources.authors; |
| 54 |
this.feedEntryCheckBoxLabelContributors.innerHTML = _nlsResources.contributors; |
| 55 |
this.feedEntryCheckBoxLabelId.innerHTML = _nlsResources.id; |
| 56 |
this.close.innerHTML = _nlsResources.close; |
| 57 |
this.feedEntryCheckBoxLabelUpdated.innerHTML = _nlsResources.updated; |
| 58 |
this.feedEntryCheckBoxLabelSummary.innerHTML = _nlsResources.summary; |
| 59 |
this.feedEntryCheckBoxLabelContent.innerHTML = _nlsResources.content; |
| 60 |
}, |
| 61 |
|
| 62 |
startup: function(){ |
| 63 |
if(this.displayEntrySections === ""){ |
| 64 |
this._displayEntrySections = ["title","authors","contributors","summary","content","id","updated"]; |
| 65 |
}else{ |
| 66 |
this._displayEntrySections = this.displayEntrySections.split(","); |
| 67 |
} |
| 68 |
this._setDisplaySectionsCheckboxes(); |
| 69 |
|
| 70 |
if(this.enableMenu){ |
| 71 |
domStyle.set(this.feedEntryViewerMenu, 'display', ''); |
| 72 |
if(this.entryCheckBoxRow && this.entryCheckBoxRow2){ |
| 73 |
if(this.enableMenuFade){ |
| 74 |
fx.fadeOut({node: this.entryCheckBoxRow,duration: 250}).play(); |
| 75 |
fx.fadeOut({node: this.entryCheckBoxRow2,duration: 250}).play(); |
| 76 |
} |
| 77 |
} |
| 78 |
} |
| 79 |
}, |
| 80 |
|
| 81 |
clear: function(){ |
| 82 |
|
| 83 |
|
| 84 |
|
| 85 |
this.destroyDescendants(); |
| 86 |
this._entry=null; |
| 87 |
this._feed=null; |
| 88 |
this.clearNodes(); |
| 89 |
}, |
| 90 |
|
| 91 |
clearNodes: function(){ |
| 92 |
|
| 93 |
|
| 94 |
|
| 95 |
arrayUtil.forEach([ |
| 96 |
"entryTitleRow", "entryAuthorRow", "entryContributorRow", "entrySummaryRow", "entryContentRow", |
| 97 |
"entryIdRow", "entryUpdatedRow" |
| 98 |
], function(node){ |
| 99 |
domStyle.set(this[node], "display", "none"); |
| 100 |
}, this); |
| 101 |
|
| 102 |
arrayUtil.forEach([ |
| 103 |
"entryTitleNode", "entryTitleHeader", "entryAuthorHeader", "entryContributorHeader", |
| 104 |
"entryContributorNode", "entrySummaryHeader", "entrySummaryNode", "entryContentHeader", |
| 105 |
"entryContentNode", "entryIdNode", "entryIdHeader", "entryUpdatedHeader", "entryUpdatedNode" |
| 106 |
], function(part){ |
| 107 |
while(this[part].firstChild){ |
| 108 |
domConstruct.destroy(this[part].firstChild); |
| 109 |
} |
| 110 |
} |
| 111 |
,this); |
| 112 |
|
| 113 |
}, |
| 114 |
|
| 115 |
setEntry: function(entry, feed, leaveMenuState){ |
| 116 |
|
| 117 |
|
| 118 |
|
| 119 |
|
| 120 |
this.clear(); |
| 121 |
this._validEntryFields = {}; |
| 122 |
this._entry = entry; |
| 123 |
this._feed = feed; |
| 124 |
|
| 125 |
if(entry !== null){ |
| 126 |
|
| 127 |
if(this.entryTitleHeader){ |
| 128 |
this.setTitleHeader(this.entryTitleHeader, entry); |
| 129 |
} |
| 130 |
|
| 131 |
if(this.entryTitleNode){ |
| 132 |
this.setTitle(this.entryTitleNode, this._editMode, entry); |
| 133 |
} |
| 134 |
|
| 135 |
if(this.entryAuthorHeader){ |
| 136 |
this.setAuthorsHeader(this.entryAuthorHeader, entry); |
| 137 |
} |
| 138 |
|
| 139 |
if(this.entryAuthorNode){ |
| 140 |
this.setAuthors(this.entryAuthorNode, this._editMode, entry); |
| 141 |
} |
| 142 |
|
| 143 |
if(this.entryContributorHeader){ |
| 144 |
this.setContributorsHeader(this.entryContributorHeader, entry); |
| 145 |
} |
| 146 |
|
| 147 |
if(this.entryContributorNode){ |
| 148 |
this.setContributors(this.entryContributorNode, this._editMode, entry); |
| 149 |
} |
| 150 |
|
| 151 |
if(this.entryIdHeader){ |
| 152 |
this.setIdHeader(this.entryIdHeader, entry); |
| 153 |
} |
| 154 |
|
| 155 |
if(this.entryIdNode){ |
| 156 |
this.setId(this.entryIdNode, this._editMode, entry); |
| 157 |
} |
| 158 |
|
| 159 |
if(this.entryUpdatedHeader){ |
| 160 |
this.setUpdatedHeader(this.entryUpdatedHeader, entry); |
| 161 |
} |
| 162 |
|
| 163 |
if(this.entryUpdatedNode){ |
| 164 |
this.setUpdated(this.entryUpdatedNode, this._editMode, entry); |
| 165 |
} |
| 166 |
|
| 167 |
if(this.entrySummaryHeader){ |
| 168 |
this.setSummaryHeader(this.entrySummaryHeader, entry); |
| 169 |
} |
| 170 |
|
| 171 |
if(this.entrySummaryNode){ |
| 172 |
this.setSummary(this.entrySummaryNode, this._editMode, entry); |
| 173 |
} |
| 174 |
|
| 175 |
if(this.entryContentHeader){ |
| 176 |
this.setContentHeader(this.entryContentHeader, entry); |
| 177 |
} |
| 178 |
|
| 179 |
if(this.entryContentNode){ |
| 180 |
this.setContent(this.entryContentNode, this._editMode, entry); |
| 181 |
} |
| 182 |
} |
| 183 |
this._displaySections(); |
| 184 |
}, |
| 185 |
|
| 186 |
setTitleHeader: function( titleHeaderNode, entry){ |
| 187 |
|
| 188 |
|
| 189 |
|
| 190 |
|
| 191 |
|
| 192 |
|
| 193 |
|
| 194 |
|
| 195 |
|
| 196 |
|
| 197 |
|
| 198 |
|
| 199 |
if(entry.title && entry.title.value && entry.title.value !== null){ |
| 200 |
var _nlsResources = i18nViewer; |
| 201 |
var titleHeader = new EntryHeader({title: _nlsResources.title}); |
| 202 |
titleHeaderNode.appendChild(titleHeader.domNode); |
| 203 |
} |
| 204 |
}, |
| 205 |
|
| 206 |
setTitle: function(titleAnchorNode, editMode, entry){ |
| 207 |
|
| 208 |
|
| 209 |
|
| 210 |
|
| 211 |
|
| 212 |
|
| 213 |
|
| 214 |
|
| 215 |
|
| 216 |
|
| 217 |
|
| 218 |
if(entry.title && entry.title.value && entry.title.value !== null){ |
| 219 |
if(entry.title.type == "text"){ |
| 220 |
var titleNode = document.createTextNode(entry.title.value); |
| 221 |
titleAnchorNode.appendChild(titleNode); |
| 222 |
}else{ |
| 223 |
var titleViewNode = document.createElement("span"); |
| 224 |
var titleView = new ContentPane({refreshOnShow: true, executeScripts: false}, titleViewNode); |
| 225 |
titleView.attr('content', entry.title.value); |
| 226 |
titleAnchorNode.appendChild(titleView.domNode); |
| 227 |
} |
| 228 |
this.setFieldValidity("title", true); |
| 229 |
} |
| 230 |
}, |
| 231 |
|
| 232 |
setAuthorsHeader: function( authorHeaderNode, entry){ |
| 233 |
|
| 234 |
|
| 235 |
|
| 236 |
|
| 237 |
|
| 238 |
|
| 239 |
|
| 240 |
|
| 241 |
|
| 242 |
if(entry.authors && entry.authors.length > 0){ |
| 243 |
var _nlsResources = i18nViewer; |
| 244 |
var authorHeader = new EntryHeader({title: _nlsResources.authors}); |
| 245 |
authorHeaderNode.appendChild(authorHeader.domNode); |
| 246 |
} |
| 247 |
}, |
| 248 |
|
| 249 |
setAuthors: function( authorsAnchorNode, editMode, entry){ |
| 250 |
|
| 251 |
|
| 252 |
|
| 253 |
|
| 254 |
|
| 255 |
|
| 256 |
|
| 257 |
|
| 258 |
|
| 259 |
|
| 260 |
|
| 261 |
authorsAnchorNode.innerHTML = ""; |
| 262 |
if(entry.authors && entry.authors.length > 0){ |
| 263 |
for(var i in entry.authors){ |
| 264 |
if(entry.authors[i].name){ |
| 265 |
var anchor = authorsAnchorNode; |
| 266 |
if(entry.authors[i].uri){ |
| 267 |
var link = document.createElement("a"); |
| 268 |
anchor.appendChild(link); |
| 269 |
link.href = entry.authors[i].uri; |
| 270 |
anchor = link; |
| 271 |
} |
| 272 |
var name = entry.authors[i].name; |
| 273 |
if(entry.authors[i].email){ |
| 274 |
name = name + " (" + entry.authors[i].email + ")"; |
| 275 |
} |
| 276 |
var authorNode = document.createTextNode(name); |
| 277 |
anchor.appendChild(authorNode); |
| 278 |
var breakNode = document.createElement("br"); |
| 279 |
authorsAnchorNode.appendChild(breakNode); |
| 280 |
this.setFieldValidity("authors", true); |
| 281 |
} |
| 282 |
} |
| 283 |
} |
| 284 |
}, |
| 285 |
|
| 286 |
setContributorsHeader: function( contributorsHeaderNode, entry){ |
| 287 |
|
| 288 |
|
| 289 |
|
| 290 |
|
| 291 |
|
| 292 |
|
| 293 |
|
| 294 |
|
| 295 |
|
| 296 |
if(entry.contributors && entry.contributors.length > 0){ |
| 297 |
var _nlsResources = i18nViewer; |
| 298 |
var contributorHeader = new EntryHeader({title: _nlsResources.contributors}); |
| 299 |
contributorsHeaderNode.appendChild(contributorHeader.domNode); |
| 300 |
} |
| 301 |
}, |
| 302 |
|
| 303 |
|
| 304 |
setContributors: function( contributorsAnchorNode, editMode, entry){ |
| 305 |
|
| 306 |
|
| 307 |
|
| 308 |
|
| 309 |
|
| 310 |
|
| 311 |
|
| 312 |
|
| 313 |
|
| 314 |
|
| 315 |
|
| 316 |
if(entry.contributors && entry.contributors.length > 0){ |
| 317 |
for(var i in entry.contributors){ |
| 318 |
var contributorNode = document.createTextNode(entry.contributors[i].name); |
| 319 |
contributorsAnchorNode.appendChild(contributorNode); |
| 320 |
var breakNode = document.createElement("br"); |
| 321 |
contributorsAnchorNode.appendChild(breakNode); |
| 322 |
this.setFieldValidity("contributors", true); |
| 323 |
} |
| 324 |
} |
| 325 |
}, |
| 326 |
|
| 327 |
|
| 328 |
setIdHeader: function( idHeaderNode, entry){ |
| 329 |
|
| 330 |
|
| 331 |
|
| 332 |
|
| 333 |
|
| 334 |
|
| 335 |
|
| 336 |
|
| 337 |
|
| 338 |
if(entry.id && entry.id !== null){ |
| 339 |
var _nlsResources = i18nViewer; |
| 340 |
var idHeader = new EntryHeader({title: _nlsResources.id}); |
| 341 |
idHeaderNode.appendChild(idHeader.domNode); |
| 342 |
} |
| 343 |
}, |
| 344 |
|
| 345 |
|
| 346 |
setId: function( idAnchorNode, editMode, entry){ |
| 347 |
|
| 348 |
|
| 349 |
|
| 350 |
|
| 351 |
|
| 352 |
|
| 353 |
|
| 354 |
|
| 355 |
|
| 356 |
|
| 357 |
|
| 358 |
if(entry.id && entry.id !== null){ |
| 359 |
var idNode = document.createTextNode(entry.id); |
| 360 |
idAnchorNode.appendChild(idNode); |
| 361 |
this.setFieldValidity("id", true); |
| 362 |
} |
| 363 |
}, |
| 364 |
|
| 365 |
setUpdatedHeader: function( updatedHeaderNode, entry){ |
| 366 |
|
| 367 |
|
| 368 |
|
| 369 |
|
| 370 |
|
| 371 |
|
| 372 |
|
| 373 |
|
| 374 |
|
| 375 |
if(entry.updated && entry.updated !== null){ |
| 376 |
var _nlsResources = i18nViewer; |
| 377 |
var updatedHeader = new EntryHeader({title: _nlsResources.updated}); |
| 378 |
updatedHeaderNode.appendChild(updatedHeader.domNode); |
| 379 |
} |
| 380 |
}, |
| 381 |
|
| 382 |
setUpdated: function( updatedAnchorNode, editMode, entry){ |
| 383 |
|
| 384 |
|
| 385 |
|
| 386 |
|
| 387 |
|
| 388 |
|
| 389 |
|
| 390 |
|
| 391 |
|
| 392 |
|
| 393 |
|
| 394 |
if(entry.updated && entry.updated !== null){ |
| 395 |
var updatedNode = document.createTextNode(entry.updated); |
| 396 |
updatedAnchorNode.appendChild(updatedNode); |
| 397 |
this.setFieldValidity("updated", true); |
| 398 |
} |
| 399 |
}, |
| 400 |
|
| 401 |
setSummaryHeader: function( summaryHeaderNode, entry){ |
| 402 |
|
| 403 |
|
| 404 |
|
| 405 |
|
| 406 |
|
| 407 |
|
| 408 |
|
| 409 |
|
| 410 |
|
| 411 |
if(entry.summary && entry.summary.value && entry.summary.value !== null){ |
| 412 |
var _nlsResources = i18nViewer; |
| 413 |
var summaryHeader = new EntryHeader({title: _nlsResources.summary}); |
| 414 |
summaryHeaderNode.appendChild(summaryHeader.domNode); |
| 415 |
} |
| 416 |
}, |
| 417 |
|
| 418 |
|
| 419 |
setSummary: function( summaryAnchorNode, editMode, entry){ |
| 420 |
|
| 421 |
|
| 422 |
|
| 423 |
|
| 424 |
|
| 425 |
|
| 426 |
|
| 427 |
|
| 428 |
|
| 429 |
|
| 430 |
|
| 431 |
if(entry.summary && entry.summary.value && entry.summary.value !== null){ |
| 432 |
var summaryViewNode = document.createElement("span"); |
| 433 |
var summaryView = new ContentPane({refreshOnShow: true, executeScripts: false}, summaryViewNode); |
| 434 |
summaryView.attr('content', entry.summary.value); |
| 435 |
summaryAnchorNode.appendChild(summaryView.domNode); |
| 436 |
this.setFieldValidity("summary", true); |
| 437 |
} |
| 438 |
}, |
| 439 |
|
| 440 |
setContentHeader: function( contentHeaderNode, entry){ |
| 441 |
|
| 442 |
|
| 443 |
|
| 444 |
|
| 445 |
|
| 446 |
|
| 447 |
|
| 448 |
|
| 449 |
|
| 450 |
if(entry.content && entry.content.value && entry.content.value !== null){ |
| 451 |
var _nlsResources = i18nViewer; |
| 452 |
var contentHeader = new EntryHeader({title: _nlsResources.content}); |
| 453 |
contentHeaderNode.appendChild(contentHeader.domNode); |
| 454 |
} |
| 455 |
}, |
| 456 |
|
| 457 |
setContent: function( contentAnchorNode, editMode, entry){ |
| 458 |
|
| 459 |
|
| 460 |
|
| 461 |
|
| 462 |
|
| 463 |
|
| 464 |
|
| 465 |
|
| 466 |
|
| 467 |
|
| 468 |
|
| 469 |
if(entry.content && entry.content.value && entry.content.value !== null){ |
| 470 |
var contentViewNode = document.createElement("span"); |
| 471 |
var contentView = new ContentPane({refreshOnShow: true, executeScripts: false},contentViewNode); |
| 472 |
contentView.attr('content', entry.content.value); |
| 473 |
contentAnchorNode.appendChild(contentView.domNode); |
| 474 |
this.setFieldValidity("content", true); |
| 475 |
} |
| 476 |
}, |
| 477 |
|
| 478 |
|
| 479 |
_displaySections: function(){ |
| 480 |
|
| 481 |
|
| 482 |
|
| 483 |
|
| 484 |
domStyle.set(this.entryTitleRow, 'display', 'none'); |
| 485 |
domStyle.set(this.entryAuthorRow, 'display', 'none'); |
| 486 |
domStyle.set(this.entryContributorRow, 'display', 'none'); |
| 487 |
domStyle.set(this.entrySummaryRow, 'display', 'none'); |
| 488 |
domStyle.set(this.entryContentRow, 'display', 'none'); |
| 489 |
domStyle.set(this.entryIdRow, 'display', 'none'); |
| 490 |
domStyle.set(this.entryUpdatedRow, 'display', 'none'); |
| 491 |
|
| 492 |
for(var i in this._displayEntrySections){ |
| 493 |
var section = this._displayEntrySections[i].toLowerCase(); |
| 494 |
if(section === "title" && this.isFieldValid("title")){ |
| 495 |
domStyle.set(this.entryTitleRow, 'display', ''); |
| 496 |
} |
| 497 |
if(section === "authors" && this.isFieldValid("authors")){ |
| 498 |
domStyle.set(this.entryAuthorRow, 'display', ''); |
| 499 |
} |
| 500 |
if(section === "contributors" && this.isFieldValid("contributors")){ |
| 501 |
domStyle.set(this.entryContributorRow, 'display', ''); |
| 502 |
} |
| 503 |
if(section === "summary" && this.isFieldValid("summary")){ |
| 504 |
domStyle.set(this.entrySummaryRow, 'display', ''); |
| 505 |
} |
| 506 |
if(section === "content" && this.isFieldValid("content")){ |
| 507 |
domStyle.set(this.entryContentRow, 'display', ''); |
| 508 |
} |
| 509 |
if(section === "id" && this.isFieldValid("id")){ |
| 510 |
domStyle.set(this.entryIdRow, 'display', ''); |
| 511 |
} |
| 512 |
if(section === "updated" && this.isFieldValid("updated")){ |
| 513 |
domStyle.set(this.entryUpdatedRow, 'display', ''); |
| 514 |
} |
| 515 |
|
| 516 |
} |
| 517 |
}, |
| 518 |
|
| 519 |
setDisplaySections: function(sectionsArray){ |
| 520 |
|
| 521 |
|
| 522 |
|
| 523 |
|
| 524 |
|
| 525 |
|
| 526 |
if(sectionsArray !== null){ |
| 527 |
this._displayEntrySections = sectionsArray; |
| 528 |
this._displaySections(); |
| 529 |
}else{ |
| 530 |
this._displayEntrySections = ["title","authors","contributors","summary","content","id","updated"]; |
| 531 |
} |
| 532 |
}, |
| 533 |
|
| 534 |
_setDisplaySectionsCheckboxes: function(){ |
| 535 |
|
| 536 |
|
| 537 |
|
| 538 |
|
| 539 |
var items = ["title","authors","contributors","summary","content","id","updated"]; |
| 540 |
for(var i in items){ |
| 541 |
if(arrayUtil.indexOf(this._displayEntrySections, items[i]) == -1){ |
| 542 |
domStyle.set(this["feedEntryCell"+items[i]], 'display', 'none'); |
| 543 |
}else{ |
| 544 |
this["feedEntryCheckBox"+items[i].substring(0,1).toUpperCase()+items[i].substring(1)].checked=true; |
| 545 |
} |
| 546 |
} |
| 547 |
}, |
| 548 |
|
| 549 |
_readDisplaySections: function(){ |
| 550 |
|
| 551 |
|
| 552 |
var checkedList = []; |
| 553 |
|
| 554 |
if(this.feedEntryCheckBoxTitle.checked){ |
| 555 |
checkedList.push("title"); |
| 556 |
} |
| 557 |
if(this.feedEntryCheckBoxAuthors.checked){ |
| 558 |
checkedList.push("authors"); |
| 559 |
} |
| 560 |
if(this.feedEntryCheckBoxContributors.checked){ |
| 561 |
checkedList.push("contributors"); |
| 562 |
} |
| 563 |
if(this.feedEntryCheckBoxSummary.checked){ |
| 564 |
checkedList.push("summary"); |
| 565 |
} |
| 566 |
if(this.feedEntryCheckBoxContent.checked){ |
| 567 |
checkedList.push("content"); |
| 568 |
} |
| 569 |
if(this.feedEntryCheckBoxId.checked){ |
| 570 |
checkedList.push("id"); |
| 571 |
} |
| 572 |
if(this.feedEntryCheckBoxUpdated.checked){ |
| 573 |
checkedList.push("updated"); |
| 574 |
} |
| 575 |
this._displayEntrySections = checkedList; |
| 576 |
}, |
| 577 |
|
| 578 |
_toggleCheckbox: function(checkBox){ |
| 579 |
|
| 580 |
|
| 581 |
|
| 582 |
|
| 583 |
|
| 584 |
|
| 585 |
|
| 586 |
if(checkBox.checked){ |
| 587 |
checkBox.checked=false; |
| 588 |
}else{ |
| 589 |
checkBox.checked=true; |
| 590 |
} |
| 591 |
this._readDisplaySections(); |
| 592 |
this._displaySections(); |
| 593 |
}, |
| 594 |
|
| 595 |
_toggleOptions: function(checkBox){ |
| 596 |
|
| 597 |
|
| 598 |
|
| 599 |
|
| 600 |
|
| 601 |
|
| 602 |
|
| 603 |
if(this.enableMenu){ |
| 604 |
var fade = null; |
| 605 |
var anim; |
| 606 |
var anim2; |
| 607 |
if(this._optionButtonDisplayed){ |
| 608 |
if(this.enableMenuFade){ |
| 609 |
anim = fx.fadeOut({node: this.entryCheckBoxDisplayOptions,duration: 250}); |
| 610 |
connect.connect(anim, "onEnd", this, function(){ |
| 611 |
domStyle.set(this.entryCheckBoxDisplayOptions, 'display', 'none'); |
| 612 |
domStyle.set(this.entryCheckBoxRow, 'display', ''); |
| 613 |
domStyle.set(this.entryCheckBoxRow2, 'display', ''); |
| 614 |
fx.fadeIn({node: this.entryCheckBoxRow, duration: 250}).play(); |
| 615 |
fx.fadeIn({node: this.entryCheckBoxRow2, duration: 250}).play(); |
| 616 |
}); |
| 617 |
anim.play(); |
| 618 |
}else{ |
| 619 |
domStyle.set(this.entryCheckBoxDisplayOptions, 'display', 'none'); |
| 620 |
domStyle.set(this.entryCheckBoxRow, 'display', ''); |
| 621 |
domStyle.set(this.entryCheckBoxRow2, 'display', ''); |
| 622 |
} |
| 623 |
this._optionButtonDisplayed=false; |
| 624 |
}else{ |
| 625 |
if(this.enableMenuFade){ |
| 626 |
anim = fx.fadeOut({node: this.entryCheckBoxRow,duration: 250}); |
| 627 |
anim2 = fx.fadeOut({node: this.entryCheckBoxRow2,duration: 250}); |
| 628 |
connect.connect(anim, "onEnd", this, function(){ |
| 629 |
domStyle.set(this.entryCheckBoxRow, 'display', 'none'); |
| 630 |
domStyle.set(this.entryCheckBoxRow2, 'display', 'none'); |
| 631 |
domStyle.set(this.entryCheckBoxDisplayOptions, 'display', ''); |
| 632 |
fx.fadeIn({node: this.entryCheckBoxDisplayOptions, duration: 250}).play(); |
| 633 |
}); |
| 634 |
anim.play(); |
| 635 |
anim2.play(); |
| 636 |
}else{ |
| 637 |
domStyle.set(this.entryCheckBoxRow, 'display', 'none'); |
| 638 |
domStyle.set(this.entryCheckBoxRow2, 'display', 'none'); |
| 639 |
domStyle.set(this.entryCheckBoxDisplayOptions, 'display', ''); |
| 640 |
} |
| 641 |
this._optionButtonDisplayed=true; |
| 642 |
} |
| 643 |
} |
| 644 |
}, |
| 645 |
|
| 646 |
_handleEvent: function(entrySelectionEvent){ |
| 647 |
|
| 648 |
|
| 649 |
|
| 650 |
|
| 651 |
|
| 652 |
|
| 653 |
if(entrySelectionEvent.source != this){ |
| 654 |
if(entrySelectionEvent.action == "set" && entrySelectionEvent.entry){ |
| 655 |
this.setEntry(entrySelectionEvent.entry, entrySelectionEvent.feed); |
| 656 |
}else if(entrySelectionEvent.action == "delete" && entrySelectionEvent.entry && entrySelectionEvent.entry == this._entry){ |
| 657 |
this.clear(); |
| 658 |
} |
| 659 |
} |
| 660 |
}, |
| 661 |
|
| 662 |
setFieldValidity: function(field, isValid){ |
| 663 |
|
| 664 |
|
| 665 |
|
| 666 |
|
| 667 |
|
| 668 |
|
| 669 |
|
| 670 |
|
| 671 |
|
| 672 |
|
| 673 |
|
| 674 |
|
| 675 |
if(field){ |
| 676 |
var lowerField = field.toLowerCase(); |
| 677 |
this._validEntryFields[field] = isValid; |
| 678 |
} |
| 679 |
}, |
| 680 |
|
| 681 |
isFieldValid: function(field){ |
| 682 |
|
| 683 |
|
| 684 |
|
| 685 |
|
| 686 |
|
| 687 |
|
| 688 |
return this._validEntryFields[field.toLowerCase()]; |
| 689 |
}, |
| 690 |
|
| 691 |
getEntry: function(){ |
| 692 |
return this._entry; |
| 693 |
}, |
| 694 |
|
| 695 |
getFeed: function(){ |
| 696 |
return this._feed; |
| 697 |
}, |
| 698 |
|
| 699 |
destroy: function(){ |
| 700 |
this.clear(); |
| 701 |
arrayUtil.forEach(this._subscriptions, dojo.unsubscribe); |
| 702 |
} |
| 703 |
}); |
| 704 |
|
| 705 |
var EntryHeader = FeedEntryViewer.EntryHeader = declare("dojox.atom.widget.EntryHeader", [_Widget, _Templated, _Container],{ |
| 706 |
|
| 707 |
|
| 708 |
title: "", |
| 709 |
templateString: headerTemplate, |
| 710 |
|
| 711 |
postCreate: function(){ |
| 712 |
this.setListHeader(); |
| 713 |
}, |
| 714 |
|
| 715 |
setListHeader: function(title){ |
| 716 |
this.clear(); |
| 717 |
if(title){ |
| 718 |
this.title = title; |
| 719 |
} |
| 720 |
var textNode = document.createTextNode(this.title); |
| 721 |
this.entryHeaderNode.appendChild(textNode); |
| 722 |
}, |
| 723 |
|
| 724 |
clear: function(){ |
| 725 |
this.destroyDescendants(); |
| 726 |
if(this.entryHeaderNode){ |
| 727 |
for(var i = 0; i < this.entryHeaderNode.childNodes.length; i++){ |
| 728 |
this.entryHeaderNode.removeChild(this.entryHeaderNode.childNodes[i]); |
| 729 |
} |
| 730 |
} |
| 731 |
}, |
| 732 |
|
| 733 |
destroy: function(){ |
| 734 |
this.clear(); |
| 735 |
} |
| 736 |
}); |
| 737 |
|
| 738 |
|
| 739 |
return FeedEntryViewer; |
| 740 |
}); |