//>>built require({cache:{"url:dojox/atom/widget/templates/FeedViewer.html":"
\n\t\n\t\t\n\t\t\n\t
\n
\n","url:dojox/atom/widget/templates/FeedViewerEntry.html":"\n \n \n \n \n \n \n \n \n
\n \n [delete]\n
\n \n","url:dojox/atom/widget/templates/FeedViewerGrouping.html":"\n\t\n\t\n"}}); define("dojox/atom/widget/FeedViewer",["dojo/_base/kernel","dojo/_base/lang","dojo/_base/array","dojo/_base/connect","dojo/dom-class","dijit/_Widget","dijit/_Templated","dijit/_Container","../io/Connection","dojo/text!./templates/FeedViewer.html","dojo/text!./templates/FeedViewerEntry.html","dojo/text!./templates/FeedViewerGrouping.html","dojo/i18n!./nls/FeedViewerEntry","dojo/_base/declare"],function(_1,_2,_3,_4,_5,_6,_7,_8,_9,_a,_b,_c,_d){ _1.experimental("dojox.atom.widget.FeedViewer"); var _e=_1.getObject("dojox.atom.widget",true); _e.FeedViewer=_1.declare([_6,_7,_8],{feedViewerTableBody:null,feedViewerTable:null,entrySelectionTopic:"",url:"",xmethod:false,localSaveOnly:false,templateString:_a,_feed:null,_currentSelection:null,_includeFilters:null,alertsEnabled:false,postCreate:function(){ this._includeFilters=[]; if(this.entrySelectionTopic!==""){ this._subscriptions=[_1.subscribe(this.entrySelectionTopic,this,"_handleEvent")]; } this.atomIO=new _9(); this.childWidgets=[]; },startup:function(){ this.containerNode=this.feedViewerTableBody; var _f=this.getDescendants(); for(var i in _f){ var _10=_f[i]; if(_10&&_10.isFilter){ this._includeFilters.push(new _e.FeedViewer.CategoryIncludeFilter(_10.scheme,_10.term,_10.label)); _10.destroy(); } } if(this.url!==""){ this.setFeedFromUrl(this.url); } },clear:function(){ this.destroyDescendants(); },setFeedFromUrl:function(url){ if(url!==""){ if(this._isRelativeURL(url)){ var _11=""; if(url.charAt(0)!=="/"){ _11=this._calculateBaseURL(window.location.href,true); }else{ _11=this._calculateBaseURL(window.location.href,false); } this.url=_11+url; } this.atomIO.getFeed(url,_2.hitch(this,this.setFeed)); } },setFeed:function(_12){ this._feed=_12; this.clear(); var _13=function(a,b){ var _14=this._displayDateForEntry(a); var _15=this._displayDateForEntry(b); if(_14>_15){ return -1; } if(_14<_15){ return 1; } return 0; }; var _16=function(_17){ var _18=_17.split(","); _18.pop(); return _18.join(","); }; var _19=_12.entries.sort(_2.hitch(this,_13)); if(_12){ var _1a=null; for(var i=0;i<_19.length;i++){ var _1b=_19[i]; if(this._isFilterAccepted(_1b)){ var _1c=this._displayDateForEntry(_1b); var _1d=""; if(_1c!==null){ _1d=_16(_1c.toLocaleString()); if(_1d===""){ _1d=""+(_1c.getMonth()+1)+"/"+_1c.getDate()+"/"+_1c.getFullYear(); } } if((_1a===null)||(_1a!=_1d)){ this.appendGrouping(_1d); _1a=_1d; } this.appendEntry(_1b); } } } },_displayDateForEntry:function(_1e){ if(_1e.updated){ return _1e.updated; } if(_1e.modified){ return _1e.modified; } if(_1e.issued){ return _1e.issued; } return new Date(); },appendGrouping:function(_1f){ var _20=new _e.FeedViewerGrouping({}); _20.setText(_1f); this.addChild(_20); this.childWidgets.push(_20); },appendEntry:function(_21){ var _22=new _e.FeedViewerEntry({"xmethod":this.xmethod}); _22.setTitle(_21.title.value); _22.setTime(this._displayDateForEntry(_21).toLocaleTimeString()); _22.entrySelectionTopic=this.entrySelectionTopic; _22.feed=this; this.addChild(_22); this.childWidgets.push(_22); this.connect(_22,"onClick","_rowSelected"); _21.domNode=_22.entryNode; _21._entryWidget=_22; _22.entry=_21; },deleteEntry:function(_23){ if(!this.localSaveOnly){ this.atomIO.deleteEntry(_23.entry,_2.hitch(this,this._removeEntry,_23),null,this.xmethod); }else{ this._removeEntry(_23,true); } _1.publish(this.entrySelectionTopic,[{action:"delete",source:this,entry:_23.entry}]); },_removeEntry:function(_24,_25){ if(_25){ var idx=_3.indexOf(this.childWidgets,_24); var _26=this.childWidgets[idx-1]; var _27=this.childWidgets[idx+1]; if(_26.isInstanceOf(_e.FeedViewerGrouping)&&(_27===undefined||_27.isInstanceOf(_e.FeedViewerGrouping))){ _26.destroy(); } _24.destroy(); }else{ } },_rowSelected:function(evt){ var _28=evt.target; while(_28){ if(_5.contains(_28,"feedViewerEntry")){ break; } _28=_28.parentNode; } for(var i=0;i0)&&(_35<_32.length)&&(_35!==(_32.length-1))){ _34=_32.substring(0,(_35+1)); }else{ _34=_32; } }else{ _35=_32.indexOf("://"); if(_35>0){ _35=_35+3; var _36=_32.substring(0,_35); var _37=_32.substring(_35,_32.length); _35=_37.indexOf("/"); if((_35<_37.length)&&(_35>0)){ _34=_36+_37.substring(0,_35); }else{ _34=_36+_37; } } } } return _34; },_isFilterAccepted:function(_38){ var _39=false; if(this._includeFilters&&(this._includeFilters.length>0)){ for(var i=0;i0){ for(var i=0;i0){ for(var i=0;i