/* * Ext JS Library 2.0 RC 1 * Copyright(c) 2006-2007, Ext JS, LLC. * licensing@extjs.com * * http://extjs.com/license */ if(agregator==null) {var agregator=new Object();} agregator.labels={feeds:'Feed-uri',add:'Adauga',addFeed:'Adauga feed',newTab:'Tab nou',openNewTab:'Deschide tab nou',open:'Deschide',news:'Stiri',cancel:'Anulare',edit:'Editeaza',validatingFeed:'Se valideaza feed-ul...',validatingFeedErrors:'Ne pare rau, sunt probleme cu validarea feed-ului. Incercati mai tarziu, daca problemele persista ne puteti contacta la contact@agregator.ro.',inputFeed:'Introduceti adresa feed-ului',defaultFeeds:[['http://www.groparu.ro/?feed=rss2','Groparu'],['http://metalfan.ro/rss/news.xml','Metalfan'],['http://www.gsp.ro/usr/feed/index20.xml','Gazeta Sporturilor'],['http://www.hotnews.ro/rss','Hotnews']],inputExample:'http://nume-site-exemplu.ro/blog/feed',loading:'Se incarca ...',search:'Cauta ...',eokTitle:'eOK.ro - Top saptamanal',stocksCompany:'Companie',stocksPrice:'Pret',stocksPercent:'% Variatie',stocksData:'Data',stocksDelete:'Sterge',stocksDeleteCompany:'Sterge companie',stocksAddCompany:'Adauga companie',stocksTitle:'Actiuni BVB Regular',weatherTitle:'Vremea in Romania',weatherSelect:'Selectati localitatea:',ratesTitle:'Convertor valutar',ratesText:'Cursul valutar este preluat de la BNR pentru data de: ',tvTitle:'Programe TV',tvNow:'Acum',tvNext:'Urmeaza',tvPrograms:'Programe',tvFilter:'Filtru:',tvChannels:'Canale:',mediaTitle:'Muzica - Imeem.com',mediaMusic:'Muzica',mediaVideo:'Video',mediaSearch:'Cauta',mediaTrackTitle:'Titlu',mediaArtist:'Artist',mediaDuration:'Durata',zelistTitle:'Ze bestest',zelistBlogs:'pe bloguri',zelistPress:'in presa',imagesTitle:'Imagini',imagesInteresting:'interesante',imagesGeo:'din',photoTitle:'Badorgood.com',radioTitle:'Radio Guerrilla',topTwitterTitle:'Top hashtag-uri in Romania',topTwitter24:'In 24 ore',topTwitter6:'In 2 ore',twitterSearchTitle:'Cauta pe Twitter',menuTree:[{text:'Widget-uri',cls:'feeds-node',expanded:true,children:[{type:'widget',name:'Zelist',text:'Zelist.ro',icon:'http://www.zelist.ro/favicon.ico',leaf:true,cls:'feed'},{type:'widget',name:'TopTwitter',text:'Top Twitter',icon:'http://assets1.twitter.com/images/favicon.ico',leaf:true,cls:'feed'},{type:'widget',name:'Photo',text:'Badorgood',icon:'/public/images/photo-icon.png',leaf:true,cls:'feed'},{type:'widget',name:'SearchTwitter',text:'Cauta pe Twitter',icon:'http://assets1.twitter.com/images/favicon.ico',leaf:true,cls:'feed'},{type:'widget',name:'Rates',text:'Convertor valutar',icon:'/public/images/money_dollar.png',leaf:true,cls:'feed'},{type:'widget',name:'Weather',text:'Vremea in Romania',icon:'/public/images/weather_cloudy.png',leaf:true,cls:'feed'},{type:'widget',name:'Stocks',text:'Actiuni BVB Regular',icon:'http://www.bvb.ro/favicon.ico',leaf:true,cls:'feed'},{type:'widget',name:'Radio',text:'Radio Guerrilla',icon:'http://radioguerrilla.ro/favicon.ico',leaf:true,cls:'feed'}]},{text:'Stiri',cls:'feeds-node',expanded:false,children:[{url:'http://www.hotnews.ro/rss',text:'Hotnews.ro',icon:"http://hotnews.ro/favicon.ico",leaf:true,cls:'feed'},{url:'http://www.cotidianul.ro/stiri.xml',text:'Cotidianul',icon:"http://cotidianul.ro/favicon.ico",leaf:true,cls:'feed'},{url:'http://realitatea.net/feed/stiri.xml',text:'Realitatea',icon:"http://realitatea.net/favicon.ico",leaf:true,cls:'feed'},{url:'http://www.jurnalul.ro/rss',text:'Jurnalul National',icon:"http://jurnalul.ro/favicon.ico",leaf:true,cls:'feed'},{url:'http://www.evz.ro/xml/rss',text:'Evenimentul Zilei',icon:"http://www.evz.ro/images/favicon.ico",leaf:true,cls:'feed'},{url:'http://www.gandul.info/rss-stiri-prima-pagina.xml',text:'Gandul',icon:"http://gandul.info/favicon.ico",leaf:true,cls:'feed'},{url:'http://www.gardianul.ro/stiri_rss.html',text:'Gardianul',icon:"http://www.gardianul.ro/favicon.ico",leaf:true,cls:'feed'},{url:'http://www.adevarul.ro/news-alert.rss',text:'Adevarul',icon:"http://www.adevarul.ro/favicon.ico",leaf:true,cls:'feed'},{url:'http://www.cancan.ro/rss.xml',text:'Cancan',icon:"http://cancan.ro/favicon.ico",leaf:true,cls:'feed'},{url:'http://www.libertatea.ro/rss/index.xml',text:'Libertatea',iconCls:'feed-icon',leaf:true,cls:'feed'},{url:'http://www.konkurs.ro/feed',text:'Konkurs.ro',icon:'http://www.konkurs.ro/favicon.ico',leaf:true,cls:'feed'}]},{text:'Sport',cls:'feeds-node',expanded:false,children:[{url:'http://www.gsp.ro/usr/feed/index20.xml',text:'Gazeta Sporturilor',icon:"http://www.gsp.ro/favicon.ico",leaf:true,cls:'feed'},{url:'http://www.prosport.ro/rss.xml',text:'ProSport',icon:"http://www.prosport.ro/favicon.ico",leaf:true,cls:'feed'},{url:'http://www.onlinesport.ro/stiri/rss/?feed=10',text:'Onlinesport.ro',icon:"http://www.onlinesport.ro/favicon.ico",leaf:true,cls:'feed'},{url:'http://www.netsport.ro/rss.xml',text:'Netsport',iconCls:'feed-icon',leaf:true,cls:'feed'}]},{text:'Muzica',cls:'feeds-node',expanded:false,children:[{url:'http://metalfan.ro/rss/news.xml',text:'Metalfan',iconCls:'feed-icon',leaf:true,cls:'feed'},{url:'http://www.showbiz.ro/rss/muzica',text:'Showbiz',icon:"http://www.showbiz.ro/favicon.ico",leaf:true,cls:'feed'},{url:'http://feeds.feedburner.com/Stiri-METALHEAD-ro',text:'Metalhead',icon:"http://www.metalhead.ro/m.gif",leaf:true,cls:'feed'}]},{text:'Blog-uri',cls:'feeds-node',expanded:false,children:[{url:'http://www.dailycotcodac.ro/feed/',text:'DailyCotcodac',iconCls:'feed-icon',leaf:true,cls:'feed'},{url:'http://www.groparu.ro/?feed=rss2',text:'Groparu',icon:"http://www.groparu.ro/favicon.ico",leaf:true,cls:'feed'},{url:'http://pitzipoanca.org/feed',text:'Pitzipoanca',icon:"http://pitzipoanca.org/favicon.ico",leaf:true,cls:'feed'},{url:'http://feeds.feedburner.com/BobbyVoicu_ro',text:'Bobby Voicu',icon:"http://www.bobbyvoicu.ro/favicon.ico",leaf:true,cls:'feed'},{url:'http://feeds.feedburner.com/blogspot/manafu',text:'Manafu',iconCls:'feed-icon',leaf:true,cls:'feed'},{url:'http://feeds.feedburner.com/bookblogro',text:'Bookblog',icon:"http://bookblog.ro/favicon.ico",leaf:true,cls:'feed'},{url:'http://www.zoso.ro/feed',text:'Zoso',icon:"http://www.zoso.ro/favicon.ico",leaf:true,cls:'feed'},{url:'http://deceblog.net/feed',text:'Deceblog',icon:"http://deceblog.net/favicon.ico",leaf:true,cls:'feed'},{url:'http://feeds.feedburner.com/visurat1',text:'Visurat',iconCls:'feed-icon',leaf:true,cls:'feed'},{url:'http://dono.ro/?feed=rss2',text:'Dono',icon:'http://dono.ro/favicon.ico',leaf:true,cls:'feed'},{url:'http://subiectiv.ro/feed',text:'Subiectiv',icon:"http://subiectiv.ro/wp-content/themes/subiectiv2/images/favicon.ico",leaf:true,cls:'feed'},{url:'http://feeds.feedburner.com/alexbrie',text:'Alex Brie',icon:"http://alexbrie.net/favicon.ico",leaf:true,cls:'feed'},{url:'http://www.jeg.ro/feed',text:'JEG',iconCls:'feed-icon',leaf:true,cls:'feed'},{url:'http://www.tolo.ro/feed/',text:'Tolontan',icon:'http://www.tolo.ro/favicon.ico',leaf:true,cls:'feed'}]},{text:'Twitters',cls:'feeds-node',expanded:false,children:[{url:'http://twitter.com/statuses/user_timeline/45863.rss',text:'Alex Brie',icon:"http://assets1.twitter.com/images/favicon.ico",leaf:true,cls:'feed'},{url:'http://twitter.com/statuses/user_timeline/14111168.rss',text:'eCostin',icon:"http://assets1.twitter.com/images/favicon.ico",leaf:true,cls:'feed'},{url:'http://twitter.com/statuses/user_timeline/11953772.rss',text:'Bobby Voicu',icon:"http://assets1.twitter.com/images/favicon.ico",leaf:true,cls:'feed'},{url:'http://twitter.com/statuses/user_timeline/5675232.rss',text:'Manafu',icon:"http://assets1.twitter.com/images/favicon.ico",leaf:true,cls:'feed'},{url:'http://twitter.com/statuses/user_timeline/10521362.rss',text:'Piticu',icon:"http://assets1.twitter.com/images/favicon.ico",leaf:true,cls:'feed'},{url:'http://twitter.com/statuses/user_timeline/14094468.rss',text:'Alex Popescu',icon:"http://assets1.twitter.com/images/favicon.ico",leaf:true,cls:'feed'},{url:'http://twitter.com/statuses/user_timeline/11561322.rss',text:'Sergiu Biris',icon:"http://assets1.twitter.com/images/favicon.ico",leaf:true,cls:'feed'},{url:'http://twitter.com/statuses/user_timeline/14203676.rss',text:'Zoso',icon:"http://assets1.twitter.com/images/favicon.ico",leaf:true,cls:'feed'},{url:'http://twitter.com/statuses/user_timeline/4868721.rss',text:'Subiectiv',icon:"http://assets1.twitter.com/images/favicon.ico",leaf:true,cls:'feed'},{url:'http://twitter.com/statuses/user_timeline/14169216.rss',text:'Manac',icon:"http://assets1.twitter.com/images/favicon.ico",leaf:true,cls:'feed'},{url:'http://twitter.com/statuses/user_timeline/14108877.rss',text:'Lamaie',icon:"http://assets1.twitter.com/images/favicon.ico",leaf:true,cls:'feed'},{url:'http://twitter.com/statuses/user_timeline/10702902.rss',text:'Kleampa',icon:"http://assets1.twitter.com/images/favicon.ico",leaf:true,cls:'feed'},{url:'http://twitter.com/statuses/user_timeline/11746402.rss',text:'Razvan Antonescu',icon:"http://assets1.twitter.com/images/favicon.ico",leaf:true,cls:'feed'}]},{text:'Tehnologie',cls:'feeds-node',expanded:false,children:[{url:'http://www.go4it.ro/rss/?type=articole',text:'Go4it.ro',icon:"http://www.go4it.ro/favicon.ico",leaf:true,cls:'feed'},{url:'http://www.chip.ro/rss/news.xml',text:'CHIP.RO',icon:"http://www.chip.ro/favicon.ico",leaf:true,cls:'feed'},{url:'http://www.hit.ro/rss/',text:'Hit',icon:"http://www.hit.ro/favicon.ico",leaf:true,cls:'feed'},{url:'http://www.agora.ro/rss/agoranews.xml',text:'Agora',icon:"http://www.agora.ro/favicon.ico",leaf:true,cls:'feed'},{url:'http://www.gamesblog.ro/feeds/posts/default',text:'Gamesblog.ro',iconCls:'feed-icon',leaf:true,cls:'feed'},{url:'http://www.xtrempc.ro/rss/rss.php',text:'XTremPC',icon:"http://www.xtrempc.ro/favicon.ico",leaf:true,cls:'feed'}]},{text:'Economie',cls:'feeds-node',expanded:false,children:[{url:'http://www.tmctv.ro/rss_all.xml',text:'The Money Channel',icon:"http://www.tmctv.ro/img/moneychannel-icon.ico",leaf:true,cls:'feed'},{url:'http://www.dailybusiness.ro/rss.xml',text:'DailyBussiness.ro',iconCls:'feed-icon',leaf:true,cls:'feed'},{url:'http://www.businessmagazin.ro/rss-feed.xml',text:'Business Magazin',iconCls:'feed-icon',leaf:true,cls:'feed'},{url:'http://www.zf.ro/rss.xml',text:'Ziarul Financiar',iconCls:'feed-icon',leaf:true,cls:'feed'},{url:'http://www.bvb.ro/Rss/StiriBVB.ashx',text:'Bursa de Valori Bucuresti',icon:"http://www.bvb.ro/favicon.ico",leaf:true,cls:'feed'},{url:'http://bloombiz.ro/assets/rss/rss.xml',text:'Bloombiz',icon:"http://www.bloombiz.ro/favicon.ico",leaf:true,cls:'feed'},{url:'http://img.wall-street.ro/rssfeeds/wall-street.xml',text:'Wall-Street.ro',icon:"http://www.wall-street.ro/favicon.ico",leaf:true,cls:'feed'},{url:'http://www.standard.ro/rss_all.xml',text:'Business Standard',icon:"http://www.standard.ro/img/standard-icon.ico",leaf:true,cls:'feed'},{url:'http://www.bursa.ro/on-line/_rss/?t=tz',text:'Bursa',iconCls:'feed-icon',leaf:true,cls:'feed'},{url:'http://www.capital.ro/usr/rss/index20.xml',text:'Capital',icon:"http://www.capital.ro/favicon.ico",leaf:true,cls:'feed'}]},{text:'Fete',cls:'feeds-node',expanded:false,children:[{url:'http://ele.ro/rss_noutati',text:'Ele.ro',icon:"http://www.ele.ro/favicon.ico",leaf:true,cls:'feed'},{url:'http://www.femei-moderne.ro/feed-femei-moderne',text:'Femei-Moderne.ro',icon:"http://www.femei-moderne.ro/favicon.ico",leaf:true,cls:'feed'},{url:'http://www.eva.ro/rss/articole.xml',text:'Eva.ro',icon:"http://www.eva.ro/favicon.ico",leaf:true,cls:'feed'},{url:'http://www.egirl.ro/data/stiri.rss.xml',text:'EGirl.ro',icon:"http://www.egirl.ro/favicon.ico",leaf:true,cls:'feed'},{url:'http://www.121.ro/rss/rss.php?id_feed=1',text:'121.ro',icon:"http://www.121.ro/favicon.ico",leaf:true,cls:'feed'},{url:'http://www.stilfeminin.ro/index.php?option=com_rd_rss&id=1',text:'Stilfeminin.ro',icon:"http://www.stilfeminin.ro/favicon.ico",leaf:true,cls:'feed'},{url:'http://stiri.faracuvinte.ro/silueta/rss_menu/rss.php?1.1',text:'Faracuvinte.ro',icon:"http://www.faracuvinte.ro/favicon.ico",leaf:true,cls:'feed'}]}]}; if(agregator==null) {var agregator=new Object();} agregator.companies=[{s:"ABR",n:"ABROM S.A."},{s:"ARS",n:"AEROSTAR S.A."},{s:"AER",n:"AEROTEH S.A."},{s:"ASA",n:"AGRAS VIENNA INSURANCE GROUP S.A."},{s:"ALB",n:"ALBAPAM S.A."},{s:"ALR",n:"ALRO S.A."},{s:"ALT",n:"ALTUR S.A."},{s:"AMC",n:"AMCO S.A."},{s:"AMO",n:"AMONIL S.A."},{s:"AMY",n:"AMYLON S.A."},{s:"ATB",n:"ANTIBIOTICE S.A."},{s:"APS",n:"APSA S.A."},{s:"ARM",n:"ARMATURA S.A."},{s:"AUR",n:"AURORA S.A."},{s:"AZO",n:"AZOMURES S.A."},{s:"BCC",n:"BANCA COMERCIALA CARPATICA S.A."},{s:"TLV",n:"BANCA TRANSILVANIA S.A."},{s:"UPS",n:"GHCL UPSOM ROMANIA S.A."},{s:"BRM",n:"BERMAS S.A."},{s:"BIO",n:"BIOFARM S.A."},{s:"BRD",n:"BRD - GROUPE SOCIETE GENERALE S.A."},{s:"TEL",n:"C.N.T.E.E. TRANSELECTRICA"},{s:"CRB",n:"CARBID-FOX S.A."},{s:"CBC",n:"CARBOCHIM S.A."},{s:"CER",n:"CERCON ARIESUL S.A."},{s:"CPR",n:"CHIMOPAR S.A. BUCURESTI"},{s:"CIP",n:"CIPROM S.A."},{s:"CMF",n:"COMELF S.A."},{s:"CMP",n:"COMPA S. A."},{s:"ENP",n:"COMPANIA ENERGOPETROL S.A."},{s:"DOR",n:"DOROBANTUL S.A."},{s:"ELJ",n:"ELECTROAPARATAJ S.A."},{s:"ELC",n:"ELECTROCERAMICA S.A."},{s:"EPT",n:"ELECTROPUTERE S.A."},{s:"EPN",n:"EMA PIATRA NEAMT S.A."},{s:"FAU",n:"FAUR S.A."},{s:"FEL",n:"FELEACUL S.A."},{s:"FLA",n:"FLAMINGO INTERNATIONAL SA"},{s:"FSP",n:"FORAJ SONDE PLOIESTI S.A."},{s:"GDP",n:"GRUPUL EDITORILOR SI DIFUZORILOR DE PRESA S.A."},{s:"ECT",n:"GRUPUL INDUSTRIAL ELECTROCONTACT S.A."},{s:"IMP",n:"IMPACT DEVELOPER & CONTRACTOR S.A."},{s:"EXC",n:"KANDIA - EXCELENT S.A."},{s:"MPN",n:"TITAN S.A."},{s:"MECF",n:"MECANICA CEAHLAU"},{s:"COS",n:"MECHEL TARGOVISTE S.A."},{s:"MEF",n:"MEFIN S.A."},{s:"MJM",n:"MJ MAILLIS ROMANIA S.A."},{s:"ALF",n:"MOBILA ALFA S.A."},{s:"MOL",n:"MOLDOMOBILA S.A."},{s:"MDS",n:"MOLDOSIN S.A."},{s:"NVL",n:"NAVOL S.A."},{s:"NCL",n:"NICOLINA S.A."},{s:"OIL",n:"OIL TERMINAL S.A."},{s:"OLT",n:"OLTCHIM S.A. RM. VALCEA"},{s:"PEI",n:"PETROLEXPORTIMPORT S.A."},{s:"PTS",n:"PETROLSUB S.A."},{s:"SNP",n:"PETROM S.A."},{s:"PCL",n:"POLICOLOR S.A."},{s:"PPL",n:"PRODPLAST S.A."},{s:"VAC",n:"PRODVINALCO S.A."},{s:"ASP",n:"RAFINARIA ASTRA ROMANA S.A."},{s:"RAF",n:"RAFO S.A."},{s:"RLS",n:"ROLAST S.A."},{s:"RRC",n:"ROMPETROL RAFINARE S.A."},{s:"PTR",n:"ROMPETROL WELL SERVICES S.A."},{s:"RBL",n:"RULMENTI S.A."},{s:"RBR",n:"RULMENTUL S.A."},{s:"BRK",n:"S.S.I.F. BROKER S.A."},{s:"SNC",n:"SANTIERUL NAVAL CONSTANTA S.A."},{s:"SNO",n:"SANTIERUL NAVAL ORSOVA S.A."},{s:"IDA",n:"SEPAROM S.A."},{s:"SIF1",n:"SIF BANAT CRISANA S.A."},{s:"SIF2",n:"SIF MOLDOVA S.A."},{s:"SIF4",n:"SIF MUNTENIA S.A."},{s:"SIF5",n:"SIF OLTENIA S.A."},{s:"SIF3",n:"SIF TRANSILVANIA S.A."},{s:"SLC",n:"SILCOTUB S.A."},{s:"STZ",n:"SINTEZA S.A."},{s:"SRT",n:"SIRETUL PASCANI S.A."},{s:"SOCP",n:"SOCEP S.A."},{s:"SOF",n:"SOFERT S.A."},{s:"SMS",n:"SOMES S.A."},{s:"STR",n:"STRATUSMOB S.A."},{s:"ART",n:"T.M.K. - ARTROM S.A."},{s:"TBM",n:"TURBOMECANICA S.A."},{s:"TUFE",n:"TURISM FELIX S.A. BAILE FELIX"},{s:"EFO",n:"TURISM HOTELURI RESTAURANTE MAREA NEAGRA S.A."},{s:"UAM",n:"UAMT S.A."},{s:"UCM",n:"UCM RESITA S.A."},{s:"UTN",n:"UTON S.A."},{s:"UZT",n:"UZTEL S.A."},{s:"UZC",n:"UZUC S.A."},{s:"APC",n:"VAE APCAROM S.A."},{s:"VEL",n:"SAPTE SPICE S.A."},{s:"VNC",n:"VRANCART SA"},{s:"SCD",n:"ZENTIVA S.A."},{s:"ZIM",n:"ZIMTUB S.A."},{s:"ALU",n:"ALUMIL ROM INDUSTRY S.A."},{s:"BCM",n:"CASA DE BUCOVINA-CLUB DE MUNTE"},{s:"COMI",n:"CONDMAG S.A."},{s:"DAFR",n:"DAFORA SA"},{s:"EBS",n:"Erste Bank der oesterreichischen Sparkassen AG"},{s:"ROCE",n:"ROMCARBON SA BUZAU "},{s:"TGN",n:"S.N.T.G.N. TRANSGAZ S.A."},{s:"VESY",n:"VES SA"}]; Ext.ux.Announcer=Ext.extend(Ext.ToolTip,{showDelay:500,hideDelay:200,dismissDelay:25000,mouseOffset:[0,0],trackMouse:false,cls:"announcer",constrainPosition:true,autoHide:false,closable:true,draggable:false,floating:{shadow:false,shim:true,useDisplay:true,constrain:true},initTarget:function(){this.targetXY=[0,0];},hide:function(){this.clearTimer('dismiss');this.clearTimers();this.lastActive=new Date();if(this.hidden!=true) {this.getEl().slideOut('t',{duration:0.5,easing:'easeIn'});this.hidden=true;}},show:function(){this.showAt(0);},showAt:function(xy){this.lastActive=new Date();this.clearTimers();Ext.ux.Announcer.superclass.showAt.call(this,xy);this.getEl().slideIn('l',{duration:2,easing:'easeIn'});if(this.dismissDelay&&this.autoHide!==false){this.dismissTimer=this.hide.defer(this.dismissDelay,this);}},onShow:function(){Ext.ux.Announcer.superclass.onShow.call(this);},onHide:function(){Ext.ux.Announcer.superclass.onHide.call(this);}}); Ext.ux.Rates=function(data){var initData=(data==null)?{fromValue:"1",fromRate:"EUR",toRate:"RON"}:data;this.fromValue=initData.fromValue;this.fromRate=initData.fromRate;this.toRate=initData.toRate;this.addEvents({stateevent:true});this.store=new Ext.data.Store({proxy:new Ext.data.HttpProxy({url:'index/rates'}),reader:new Ext.data.JsonReader({root:"rates"},[{name:'currency',mapping:'currency'},{name:'value',mapping:'value'},{name:'countryFlag',mapping:'cf'}]),listeners:{"load":{fn:this.loadStore,scope:this}}});this.Id=Ext.id();Ext.ux.Rates.superclass.constructor.call(this,{widgetType:"rates",loadMask:{msg:agregator.labels.loading},autoWidth:true,width:350,height:110,border:false,style:'padding:25px 5px 0px 5px',items:[{layout:'column',border:false,defaults:{border:false},items:[{width:'70px',items:[{xtype:'textfield',width:65,id:this.Id+'txFrom',selectOnFocus:true,tabIndex:1}]},{width:'95px',items:[{xtype:'iconcombo',id:this.Id+'cmbFrom',tabIndex:2,fieldLabel:'IconCombo',width:75,valueField:'currency',displayField:'currency',iconClsField:'countryFlag',triggerAction:'all',forceSelection:true,selectOnFocus:true,typeAhead:true,editable:true,mode:'local',listeners:{'select':{fn:this.cmbHandler,scope:this}}}]},{width:'70px',items:[{xtype:'textfield',width:65,id:this.Id+'txTo',cls:'x-item-disabled',readOnly:true}]},{items:[{xtype:'iconcombo',id:this.Id+'cmbTo',tabIndex:3,fieldLabel:'IconCombo',width:75,valueField:'currency',displayField:'currency',iconClsField:'countryFlag',triggerAction:'all',forceSelection:true,selectOnFocus:true,typeAhead:true,editable:true,mode:'local',listeners:{'select':{fn:this.cmbHandler,scope:this}}}]}]},{xtype:'box',id:this.Id+'txSummary',style:'padding:25px 0 0 0 ',autoEl:{tag:'div'}}]});this.on('render',this.loadRates,this);this.on('afterlayout',this.afterLayoutHandler,this);} Ext.extend(Ext.ux.Rates,Ext.Panel,{loadRates:function(){this.store.load();},loadStore:function(store,record,options) {var cmbFrom=Ext.getCmp(this.Id+"cmbFrom");var cmbTo=Ext.getCmp(this.Id+"cmbTo");var txFrom=Ext.getCmp(this.Id+"txFrom");var txTo=Ext.getCmp(this.Id+"txTo");var txSummary=Ext.getCmp(this.Id+"txSummary");cmbFrom.store=store;cmbTo.store=store;if(this.fromRate!=null&&this.fromValue!=null&&this.toRate!=null) {txFrom.setValue(this.fromValue);cmbTo.setValue(this.toRate);cmbFrom.setValue(this.fromRate);} else {txFrom.setValue(1);cmbTo.setValue('RON');cmbFrom.setValue('EUR');} txFrom.focus();txFrom.getEl().on('keyup',this.txHandler,this);txTo.getEl().on('keyup',this.txHandler,this);this.date=Date.parseDate(store.reader.jsonData.date,'Y-m-d');txSummary.getEl().dom.innerHTML=agregator.labels.ratesText+this.date.format("j F Y");var titleIcon=this.ownerCt.header.child("img.x-panel-inline-icon");if(titleIcon!=null&&titleIcon.dom!=null) {titleIcon.removeClass("feed-icon");titleIcon.dom.src="/public/images/money_dollar.png";} this.ownerCt.setTitle(agregator.labels.ratesTitle+' (BNR - '+this.date.format("j M Y")+')');this.computeRates(txFrom,cmbFrom,txTo,cmbTo);},computeRates:function(txFrom,cmbFrom,txTo,cmbTo) {this.store.clearFilter();var fromRecord=this.store.find("currency",cmbFrom.getValue());var fromRate=this.store.getAt(fromRecord).data.value;var toRecord=this.store.find("currency",cmbTo.getValue());var toRate=this.store.getAt(toRecord).data.value;var fromValue=txFrom.getValue()*1;if(isNaN(fromValue)) {return;} var toValue=(fromValue*fromRate)/toRate;if(!isNaN(toValue)) {var m=(toValue<1)?Math.pow(10,6):Math.pow(10,4);m=(toValue>10)?Math.pow(10,2):m;txTo.setValue(parseInt(toValue*m,10)/m);this.frameAnimation(txTo.getEl(),"0000FF",1,{duration:1,block:true,stopFx:true});}},txHandler:function(ev,cmp) {if(ev!=null&&(ev.isNavKeyPress()||ev.isSpecialKey())) {return;} var cmbFrom=Ext.getCmp(this.Id+"cmbFrom");var cmbTo=Ext.getCmp(this.Id+"cmbTo");var txFrom=Ext.getCmp(this.Id+"txFrom");var txTo=Ext.getCmp(this.Id+"txTo");this.fromValue=txFrom.getValue();this.computeRates(txFrom,cmbFrom,txTo,cmbTo);Ext.state.stateObserver.doSave();},cmbHandler:function(cmp,ev) {var cmbFrom=Ext.getCmp(this.Id+"cmbFrom");var cmbTo=Ext.getCmp(this.Id+"cmbTo");var txFrom=Ext.getCmp(this.Id+"txFrom");var txTo=Ext.getCmp(this.Id+"txTo");this.fromRate=cmbFrom.getValue();this.toRate=cmbTo.getValue();this.computeRates(txFrom,cmbFrom,txTo,cmbTo);Ext.state.stateObserver.doSave();},afterLayoutHandler:function(cmp) {this.un('afterlayout',this.afterLayoutHandler,this);this.loadMask=new Ext.LoadMask(this.container.dom.parentNode,{msg:agregator.labels.loading,store:this.store});this.loadMask.show();},addMyListeners:function() {this.on('afterLayout',Ext.state.stateObserver.doSave,Ext.state.stateObserver);},refresh:function() {this.store.load();},frameAnimation:function(myEl,color,count,o){var el=myEl.getFxEl();o=o||{};el.queueFx(o,function(){color=color||"#C3DAF9";if(color.length==6){color="#"+color;} count=count||1;var duration=o.duration||1;myEl.show();var b=myEl.getBox();b.height-=2;b.width-=2;if(Ext.isIE) {b.y+=1;} else {if(Ext.isSafari) {b.x+=1;}} var animFn=function(){var proxy=Ext.getBody().createChild({style:{visbility:"hidden",position:"absolute","z-index":"35000",border:"0px solid "+color}});proxy.animate({top:{from:b.y,to:b.y},left:{from:b.x,to:b.x},borderWidth:{from:0,to:2},opacity:{from:1,to:0},height:{from:b.height,to:b.height},width:{from:b.width,to:b.width}},duration,function(){proxy.remove();if(--count>0){animFn();}else{el.afterFx(o);}});};animFn.call(myEl);});return myEl;},getDefaultTitle:function() {return agregator.labels.ratesTitle;},getCurrentState:function() {return{fromValue:this.fromValue,fromRate:this.fromRate,toRate:this.toRate};},ToString:function() {return"Rates";}}); Ext.ux.FeedTV=function(stores){this.stores=stores;Ext.ux.FeedTV.superclass.constructor.call(this,{draggable:false,collapsible:false,autoScroll:true,stateful:false,plain:true,width:100,height:100,maximizable:true,maximized:true});this.on("show",this.open,this);};Ext.extend(Ext.ux.FeedTV,Ext.Window,{open:function(){this.getEl().setStyle("z-index","9999999");this.tools.restore.hide();this.storeIndex=-1;this.feedIndex=-1;var task={run:this.iterateStores,scope:this,interval:15000} Ext.TaskMgr.start(task);},iterateStores:function(){this.storeIndex++;if(this.storeIndex>=this.stores.length) {this.storeIndex=0;this.feedIndex++;if(this.feedIndex>=20) {this.feedIndex=0;}} var record=this.stores[this.storeIndex].getAt(this.feedIndex);if(record!=null) {this.showOneFeed(record);} else {this.iterateStores();}},showOneFeed:function(record) {var xf=Ext.util.Format;var description=xf.ellipsis(xf.stripTags(record.data.description),200);var date="";if(record.data.pubDate!=null&&record.data.pubDate.getTime!=null&&!isNaN(record.data.pubDate)) {date="["+record.data.pubDate.format("j M H:i")+"] - ";} var name=record.store.reader.jsonData.title;if(name.toLowerCase().indexOf("twitter")>-1) {description="";} var item=String.format("

{4}

{2}{3}

{1}

",record.data.link,description,date,record.data.title,name);this.body.dom.innerHTML=item;}}); Ext.ux.IconCombo=Ext.extend(Ext.form.ComboBox,{initComponent:function(){Ext.apply(this,{tpl:'' +'
' +'{'+this.displayField+'}' +'
'});Ext.ux.IconCombo.superclass.initComponent.call(this);},onRender:function(ct,position){Ext.ux.IconCombo.superclass.onRender.call(this,ct,position);this.wrap.applyStyles({position:'relative'});this.el.addClass('ux-icon-combo-input');this.icon=Ext.DomHelper.append(this.el.up('div.x-form-field-wrap'),{tag:'div',style:'position:absolute'});},setIconCls:function(){var rec=this.store.query(this.valueField,this.getValue()).itemAt(0);if(rec){this.icon.className='ux-icon-combo-icon '+rec.get(this.iconClsField);}},setValue:function(value){Ext.ux.IconCombo.superclass.setValue.call(this,value);if(!Ext.isSafari) {this.setIconCls();}}});Ext.reg('iconcombo',Ext.ux.IconCombo); Ext.ux.Radio=function(data){this.delayedTask=new Ext.util.DelayedTask(this.refresh,this);this.timeInterval=1*15*1000;if(data!=null) {this.radioSrc=data.radioSrc;} else {this.radioSrc="icyx://live.eliberadio.ro:8002";} this.addEvents({stateevent:true});var message=(Ext.isWindows)?"(daca nu se aude, instalati acest plugin.)":"(sanse mari sa nu mearga fara Windows)" this.store=new Ext.data.Store({proxy:new Ext.data.HttpProxy({url:'index/radio'}),reader:new Ext.data.JsonReader({root:"songs"},[{name:'song',mapping:'song'}]),listeners:{"load":{fn:this.loadStore,scope:this}}});Ext.ux.Radio.superclass.constructor.call(this,{loadMask:{msg:agregator.labels.loading},autoWidth:true,width:350,height:267,tbar:[{xtype:"button",text:"Start",cls:"x-btn-text-icon",iconCls:"radio-go-icon",listeners:{"click":{fn:this.handleClickRadio,scope:this}}},{xtype:"box",cls:"dvPlugin",autoEl:{tag:"DIV",id:"dvOrban",html:message}}]});this.on('render',this.loadRadio,this);this.on('beforedestroy',this.cleanup,this);} Ext.extend(Ext.ux.Radio,Ext.Panel,{loadRadio:function(){this.delayedTask.cancel();this.delayedTask.delay(this.timeInterval);var titleIcon=this.ownerCt.header.child("img.x-panel-inline-icon");if(titleIcon!=null) {titleIcon.removeClass("feed-icon");titleIcon.dom.src="http://radioguerrilla.ro/favicon.ico";} this.radioEmbed=' '+' '+' '+' '+' '+' '+' '+' '+' '+ this.store.load();},loadStore:function(store,record,options) {var table='';for(var i=0;i'+'';} else {table+='';}} table+='

'+song+'

AU FOST MAI DEVREME:
'+song+'
';this.body.dom.innerHTML=table;},addMyListeners:function() {this.on('afterLayout',Ext.state.stateObserver.doSave,Ext.state.stateObserver);},cleanup:function() {this.delayedTask.cancel();},refresh:function() {this.delayedTask.cancel();this.delayedTask.delay(this.timeInterval);this.store.load();this.doLayout();},getDefaultTitle:function() {return agregator.labels.radioTitle;},getCurrentState:function() {return;},stopRadio:function() {var dvRadio=document.getElementById("dvRadioGuerrilla");dvRadio.innerHTML="";},startRadio:function() {var dvRadio=document.getElementById("dvRadioGuerrilla");if(dvRadio==null) {dvRadio=document.createElement("DIV");dvRadio.id="dvRadioGuerrilla";document.body.appendChild(dvRadio);} dvRadio.innerHTML=this.radioEmbed;},handleClickRadio:function(obj,e) {if(obj.getText()=="Stop") {obj.setIconClass("radio-go-icon"),obj.setText("Start");this.stopRadio();} else {obj.setIconClass("radio-stop-icon"),obj.setText("Stop");this.startRadio();}},ToString:function() {return"Radio";}}); Ext.ux.TV=function(data){this.delayedTask=new Ext.util.DelayedTask(this.refresh,this);this.timeInterval=15*60*1000;if(data!=null) {this.section=data.section;this.filterText=data.filter;} else {this.section="now";this.filterText="";} this.addEvents({stateevent:true});this.Id=Ext.id();Ext.ux.TV.superclass.constructor.call(this,{id:this.Id+'tv-tabs',activeTab:0,margins:'0 5 5 0',resizeTabs:true,tabWidth:100,minTabWidth:50,autoWidth:true,width:350,height:278,items:[{id:this.Id+"tv-now",xtype:"panel",autoScroll:true,autoWidth:(Ext.isIE)?false:true,title:agregator.labels.tvNow,store:new Ext.data.Store({proxy:new Ext.data.HttpProxy({url:'feeds/feed'}),id:this.Id+"tv-now",baseParams:{feed:"http://www.program-tv.ro/acum-la-tv.rss"},reader:new Ext.data.JsonReader({root:"items"},['title','author',{name:'pubDate',type:'date'},'link','description','content']),listeners:{"load":{fn:this.onLoadStore,scope:this},"loadexception":{fn:this.handleConnectionException,scope:this}}}),tbar:[{xtype:"box",autoEl:{tag:"div",html:agregator.labels.tvFilter+" "}},{xtype:"textfield",width:100,id:this.Id+"txNowFilter",listeners:{"render":{fn:function(cmp){cmp.getEl().on('keyup',this.filterNow,this);},scope:this}}}],listeners:{"activate":{fn:function(cmp) {var filter=Ext.getCmp(this.Id+"txNowFilter");filter.focus();},scope:this}}},{id:this.Id+"tv-next",xtype:"panel",autoScroll:true,autoWidth:(Ext.isIE)?false:true,title:agregator.labels.tvNext,store:new Ext.data.Store({proxy:new Ext.data.HttpProxy({url:'feeds/feed'}),id:this.Id+"tv-next",baseParams:{feed:"http://www.program-tv.ro/urmeaza-la-tv.rss"},reader:new Ext.data.JsonReader({root:"items"},['title','author',{name:'pubDate',type:'date'},'link','description','content']),listeners:{"load":{fn:this.onLoadStore,scope:this},"loadexception":{fn:this.handleConnectionException,scope:this}}}),tbar:[{xtype:"box",autoEl:{tag:"div",html:agregator.labels.tvFilter+" "}},{xtype:"textfield",id:this.Id+"txNextFilter",width:100,listeners:{"render":{fn:function(cmp){cmp.getEl().on('keyup',this.filterNext,this);},scope:this}}}],listeners:{"render":{fn:function(cmp) {this.loadMask.show();cmp.store.load();},scope:this},"activate":{fn:function(cmp) {var filter=Ext.getCmp(this.Id+"txNextFilter");filter.focus();},scope:this}}},{id:this.Id+"tv-programs",xtype:"panel",autoScroll:true,autoWidth:(Ext.isIE)?false:true,title:agregator.labels.tvPrograms,store:new Ext.data.Store({proxy:new Ext.data.HttpProxy({url:'feeds/feed'}),id:this.Id+"tv-programs",baseParams:{feed:"http://www.program-tv.ro/program-discovery-channel.rss"},reader:new Ext.data.JsonReader({root:"items"},['title','author',{name:'pubDate',type:'date'},'link','description','content']),listeners:{"load":{fn:this.onLoadStore,scope:this},"loadexception":{fn:this.handleConnectionException,scope:this}}}),tbar:[{xtype:"box",autoEl:{tag:"div",html:agregator.labels.tvChannels+" "}},{xtype:"combo",id:"cmbPrograms",store:new Ext.data.SimpleStore({fields:['programFeed','programName'],data:[['http://www.program-tv.ro/program-discovery-channel.rss','Discovery Channel'],['http://www.program-tv.ro/program-discovery-science.rss','Discovery Science'],['http://www.program-tv.ro/program-national-geographic.rss','National Geographic'],['http://www.program-tv.ro/program-viasat-explorer.rss','Viasat Explorer'],['http://www.program-tv.ro/program-zone-reality.rss','Zone Reality'],['http://www.program-tv.ro/program-travel-channel.rss','Travel Channel'],['http://www.program-tv.ro/program-hbo.rss','HBO'],['http://www.program-tv.ro/program-hallmark-channel.rss','Hallmark Channel'],['http://www.program-tv.ro/program-axn.rss','AXN'],['http://www.program-tv.ro/program-procinema.rss','ProCinema'],['http://www.program-tv.ro/program-cinemax.rss','Cinemax'],['http://www.program-tv.ro/program-romantica.rss','Romantica'],['http://www.program-tv.ro/program-tcm.rss','TCM'],['http://www.program-tv.ro/program-tv-1000.rss','CANAL TV 1000'],['http://www.program-tv.ro/program-axn-sci-fi.rss','AXN SCI-FI'],['http://www.program-tv.ro/program-axn-crime.rss','AXN CRIME'],['http://www.program-tv.ro/program-private-spice.rss','Private Spice'],['http://www.program-tv.ro/program-cinemax-2.rss','Cinemax 2'],['http://www.program-tv.ro/program-free-x-tv.rss','Free-X TV'],['http://www.program-tv.ro/program-x-dream-tv.rss','X-Dream TV'],['http://www.program-tv.ro/program-mgm.rss','MGM'],['http://www.program-tv.ro/program-eurosport.rss','Eurosport'],['http://www.program-tv.ro/program-sport.ro.rss','Sport.ro'],['http://www.program-tv.ro/program-eurosport-2.rss','Eurosport 2'],['http://www.program-tv.ro/program-sport-klub.rss','Sport Klub'],['http://www.program-tv.ro/program-sport-1.rss','Sport 1'],['http://www.program-tv.ro/program-extreme-tv.rss','Extreme TV'],['http://www.program-tv.ro/program-kiss-tv.rss','Kiss TV'],['http://www.program-tv.ro/program-mtv-romania.rss','MTV Romania'],['http://www.program-tv.ro/program-vh1.rss','VH1'],['http://www.program-tv.ro/program-etno-tv.rss','Etno TV'],['http://www.program-tv.ro/program-mezzo-tv.rss','Mezzo TV'],['http://www.program-tv.ro/program-mtv2.rss','MTV2'],['http://www.program-tv.ro/program-mtv-hits.rss','MTV Hits'],['http://www.program-tv.ro/program-vh1-classic.rss','VH1 Classic'],['http://www.program-tv.ro/program-mtv-dance.rss','MTV Dance'],['http://www.program-tv.ro/program-favorit-tv.rss','Favorit TV'],['http://www.program-tv.ro/program-atomic-tv.rss','Atomic TV'],['http://www.program-tv.ro/program-televiziunea-u.rss','Televiziunea U'],['http://www.program-tv.ro/program-jetix.rss','Jetix'],['http://www.program-tv.ro/program-minimax.rss','Minimax'],['http://www.program-tv.ro/program-boomerang.rss','Boomerang'],['http://www.program-tv.ro/program-animax.rss','Animax'],['http://www.program-tv.ro/program-realitatea-tv.rss','Realitatea TV'],['http://www.program-tv.ro/program-tv5monde.rss','TV5MONDE'],['http://www.program-tv.ro/program-n24.rss','N24'],['http://www.program-tv.ro/program-bbc-prime.rss','BBC Prime'],['http://www.program-tv.ro/program-antena3.rss','Antena3'],['http://www.program-tv.ro/program-the-money-channel.rss','The Money Channel'],['http://www.program-tv.ro/program-tvr-1.rss','TVR 1'],['http://www.program-tv.ro/program-tvr-2.rss','TVR 2'],['http://www.program-tv.ro/program-acasa.rss','Acasa'],['http://www.program-tv.ro/program-prima-tv.rss','Prima TV'],['http://www.program-tv.ro/program-pro-tv.rss','PRO TV'],['http://www.program-tv.ro/program-tvr-international.rss','TVR International'],['http://www.program-tv.ro/program-antena1.rss','Antena1'],['http://www.program-tv.ro/program-b1.rss','B1'],['http://www.program-tv.ro/program-tvr-cultural.rss','TVR Cultural'],['http://www.program-tv.ro/program-tvrm.rss','TVRM'],['http://www.program-tv.ro/program-national-tv.rss','National TV'],['http://www.program-tv.ro/program-otv.rss','OTV'],['http://www.program-tv.ro/program-pro-tv-international.rss','PRO TV International'],['http://www.program-tv.ro/program-euforia-lifestyle-tv.rss','Euforia Lifestyle Tv'],['http://www.program-tv.ro/program-antena-international.rss','Antena International'],['http://www.program-tv.ro/program-kanal-d.rss','Kanal D']]}),mode:"local",loadingText:agregator.labels.search,triggerAction:'all',valueField:"programFeed",displayField:"programName",selectOnFocus:true,editable:true,forceSelection:true,typeAhead:true,maxHeight:200,minChars:0,width:125,listeners:{"select":{fn:this.selectProgram,scope:this}}},{xtype:"box",autoEl:{tag:"div",html:" "+agregator.labels.tvFilter+" "}},{xtype:"textfield",id:this.Id+"txProgramsFilter",width:100,listeners:{"render":{fn:function(cmp){cmp.getEl().on('keyup',this.filterPrograms,this);},scope:this}}}],listeners:{"render":{fn:function(cmp) {var cmb=Ext.getCmp("cmbPrograms");cmb.setValue('http://www.program-tv.ro/program-discovery-channel.rss');this.loadMask.show();cmp.store.load();},scope:this},"activate":{fn:function(cmp) {var filter=Ext.getCmp(this.Id+"txProgramsFilter");filter.focus();},scope:this}}}]});this.on('render',this.loadTV,this);this.on('beforedestroy',this.cleanup,this);};Ext.extend(Ext.ux.TV,Ext.TabPanel,{loadTV:function(section,filter){this.delayedTask.cancel();this.delayedTask.delay(this.timeInterval);var titleIcon=this.ownerCt.header.child("img.x-panel-inline-icon");if(titleIcon!=null) {titleIcon.removeClass("feed-icon");titleIcon.dom.src="http://www.program-tv.ro/favicon.ico";} var panel=Ext.getCmp(this.Id+"tv-now");this.loadMask=new Ext.LoadMask(this.container.dom.parentNode,{msg:agregator.labels.loading,store:panel.store});panel.store.load();this.loadMask.show();},onLoadStore:function(store,records,options) {if(store.data.length>0) {var panel=Ext.getCmp(store.id);this.tempContent="";this.filterText=panel.store.filterText;store.data.each(this.drawFeedItem,this);panel.body.dom.innerHTML=this.tempContent;this.filterText=null;delete this.filterText;this.tempContent=null;delete this.tempContent;this.loadMask.hide();this.tries=0;this.doLayout();} else {this.retry(store.id);}},drawFeedItem:function(record) {var xf=Ext.util.Format;var description=xf.ellipsis(xf.stripTags(record.data.description),200);description=(description!=null)?description:"";var link=record.data.link;var target="target='_blank'";if(link==null) {link="javascript: void(0)";target="";} var title=record.data.title;if(this.filterText!=null) {var specials=new RegExp("[.*+?|()\\[\\]{}\\\\]","g");var filterText=this.filterText.replace(specials,"\\$&");var regex=new RegExp(filterText,"gi");var filterArray=regex.exec(title);if(filterArray!=null&&filterArray.length>0) {for(var i=0;i"+filterArray[i]+"");}}} var item=String.format("{3}",link,target,description,title);this.tempContent+='

'+item+'

';},handleConnectionException:function(proxy,options,response,error) {this.loadMask.show();this.retry();},retry:function(id) {this.tries=(this.tries!=null)?(this.tries+1):0;if(this.tries<3) {this.refresh(id);} else {this.loadMask.hide();var panel=Ext.getCmp(id);panel.body.dom.innerHTML="Se pare ca sunt mici probleme.
Va rugam incercati mai tarziu, daca problema persista ne puteti contacta la adresa de e-mail contact@agregator.ro."}},filter:function(ev,cmp,id) {if(ev!=null&&(ev.isNavKeyPress()||ev.isSpecialKey())) {return;} var newValue=cmp.value;var panel=Ext.getCmp(id);if(newValue==null||newValue.trim()=="") {panel.store.clearFilter();panel.store.filterText=null;} else {panel.store.filterText=newValue;panel.store.filter("title",newValue,true);} if(panel.store.data.length>0) {this.onLoadStore(panel.store);} else {panel.body.dom.innerHTML="Filtrarea nu a returnat nici un rezultat.";}},filterNow:function(ev,cmp) {this.filter(ev,cmp,this.Id+"tv-now");},filterNext:function(ev,cmp) {this.filter(ev,cmp,this.Id+"tv-next");},filterPrograms:function(ev,cmp) {this.filter(ev,cmp,this.Id+"tv-programs");},selectProgram:function(combo,record,index) {var feedURL=combo.getValue();var panel=Ext.getCmp(this.Id+"tv-programs");panel.store.baseParams.feed=feedURL;this.loadMask.show();panel.store.load();},addMyListeners:function() {this.on('afterLayout',Ext.state.stateObserver.doSave,Ext.state.stateObserver);},cleanup:function() {this.delayedTask.cancel();},refresh:function(id) {this.delayedTask.cancel();this.delayedTask.delay(this.timeInterval);if(id!=null) {var panel=Ext.getCmp(id);if(panel.rendered==true) {panel.store.load();}} else {var panel=Ext.getCmp(this.Id+"tv-now");if(panel.rendered==true) {panel.store.load();} var panel=Ext.getCmp(this.Id+"tv-next");if(panel.rendered==true) {panel.store.load();} var panel=Ext.getCmp(this.Id+"tv-programs");if(panel.rendered==true) {panel.store.load();}}},getDefaultTitle:function() {return agregator.labels.tvTitle;},getCurrentState:function() {return{section:this.section,filter:this.filterText};},ToString:function() {return"TV";}}); Ext.ux.Zelist=function(data){this.delayedTask=new Ext.util.DelayedTask(this.refresh,this);this.timeInterval=15*60*1000;if(data!=null) {this.section=data.section;this.filterText=data.filter;} else {this.section=1;this.filterText="";} this.addEvents({stateevent:true});this.Id=Ext.id();Ext.ux.Zelist.superclass.constructor.call(this,{id:this.Id+'zelist-tabs',activeTab:0,margins:'0 5 5 0',resizeTabs:true,tabWidth:100,minTabWidth:50,autoWidth:true,autoScroll:false,height:278,items:[{id:this.Id+"zelist-blogs",xtype:"panel",autoScroll:true,autoWidth:(Ext.isIE)?false:true,title:agregator.labels.zelistBlogs,store:new Ext.data.Store({proxy:new Ext.data.HttpProxy({url:'feeds/feed'}),id:this.Id+"zelist-blogs",baseParams:{feed:"http://www.zelist.ro/top-posturi.rss"},reader:new Ext.data.JsonReader({root:"items"},['title','author',{name:'pubDate',type:'date'},'link','description','content']),listeners:{"load":{fn:this.onLoadStore,scope:this},"loadexception":{fn:this.handleConnectionException,scope:this}}}),tbar:[{xtype:"box",autoEl:{tag:"div",html:agregator.labels.tvFilter+" "}},{xtype:"textfield",width:100,id:this.Id+"txBlogsFilter",listeners:{"render":{fn:function(cmp){cmp.getEl().on('keyup',this.filterBlogs,this);},scope:this}}}],listeners:{"activate":{fn:function(cmp) {var filter=Ext.getCmp(this.Id+"txBlogsFilter");filter.focus();},scope:this}}},{id:this.Id+"zelist-press",xtype:"panel",autoScroll:true,autoWidth:(Ext.isIE)?false:true,title:agregator.labels.zelistPress,store:new Ext.data.Store({proxy:new Ext.data.HttpProxy({url:'feeds/feed'}),id:this.Id+"zelist-press",baseParams:{feed:"http://www.zelist.ro/top-presa.rss"},reader:new Ext.data.JsonReader({root:"items"},['title','author',{name:'pubDate',type:'date'},'link','description','content']),listeners:{"load":{fn:this.onLoadStore,scope:this},"loadexception":{fn:this.handleConnectionException,scope:this}}}),tbar:[{xtype:"box",autoEl:{tag:"div",html:agregator.labels.tvFilter+" "}},{xtype:"textfield",id:this.Id+"txPressFilter",width:100,listeners:{"render":{fn:function(cmp){cmp.getEl().on('keyup',this.filterPress,this);},scope:this}}}],listeners:{"render":{fn:function(cmp) {this.loadMask.show();cmp.store.load();},scope:this},"activate":{fn:function(cmp) {var filter=Ext.getCmp(this.Id+"txPressFilter");filter.focus();},scope:this}}}]});this.on('render',this.loadZelist,this);this.on('beforedestroy',this.cleanup,this);};Ext.extend(Ext.ux.Zelist,Ext.TabPanel,{loadZelist:function(section,filter){this.delayedTask.cancel();this.delayedTask.delay(this.timeInterval);var titleIcon=this.ownerCt.header.child("img.x-panel-inline-icon");if(titleIcon!=null) {titleIcon.removeClass("feed-icon");titleIcon.dom.src="http://www.zelist.ro/favicon.ico";} var panel=Ext.getCmp(this.Id+"zelist-blogs");this.loadMask=new Ext.LoadMask(this.container.dom.parentNode,{msg:agregator.labels.loading,store:panel.store});panel.store.load();this.loadMask.show();},onLoadStore:function(store,records,options) {if(store.data.length>0) {var panel=Ext.getCmp(store.id);this.tempContent="";this.filterText=panel.store.filterText;store.data.each(this.drawFeedItem,this);panel.body.dom.innerHTML=this.tempContent;this.filterText=null;delete this.filterText;this.tempContent=null;delete this.tempContent;this.loadMask.hide();this.tries=0;this.doLayout();} else {this.retry(store.id);}},drawFeedItem:function(record) {var xf=Ext.util.Format;var description=xf.ellipsis(xf.stripTags(record.data.description),200);description=(description!=null)?description:"";var link=record.data.link;var title=record.data.title;if(this.filterText!=null) {var specials=new RegExp("[.*+?|()\\[\\]{}\\\\]","g");var filterText=this.filterText.replace(specials,"\\$&");var regex=new RegExp(filterText,"gi");var filterArray=regex.exec(title);if(filterArray!=null&&filterArray.length>0) {for(var i=0;i"+filterArray[i]+"");}}} var paranthesys=new RegExp("\\([\\s\\w.:\\/-]+\\)$","gi");var siteTitle=paranthesys.exec(title);if(siteTitle!=null&&siteTitle.length>0) {title=title.replace(paranthesys,""+siteTitle[siteTitle.length-1]+"");} var date="";if(record.data.pubDate!=null&&record.data.pubDate.getTime!=null&&!isNaN(record.data.pubDate)) {date=record.data.pubDate.format("j M H:i");} description+="

"+date;description=description.replace(new RegExp("\\'","g"),"`");description=description.replace(new RegExp('\\"',"g"),"`");var position=record.store.indexOf(record)+1;position=(position<10)?" "+position:position;position=""+position+". " var item=String.format("{2}{3}",link,description,position,title);this.tempContent+='

'+item+'

';},handleConnectionException:function(proxy,options,response,error) {this.loadMask.show();this.retry();},retry:function(id) {this.tries=(this.tries!=null)?(this.tries+1):0;if(this.tries<3) {this.refresh(id);} else {this.loadMask.hide();var panel=Ext.getCmp(id);panel.body.dom.innerHTML="Se pare ca sunt mici probleme.
Va rugam incercati mai tarziu, daca problema persista ne puteti contacta la adresa de e-mail contact@agregator.ro."}},filter:function(ev,cmp,id) {if(ev!=null&&(ev.isNavKeyPress()||ev.isSpecialKey())) {return;} var newValue=cmp.value;var panel=Ext.getCmp(id);if(newValue==null||newValue.trim()=="") {panel.store.clearFilter();panel.store.filterText=null;} else {panel.store.filterText=newValue;panel.store.filter("title",newValue,true);} if(panel.store.data.length>0) {this.onLoadStore(panel.store);} else {panel.body.dom.innerHTML="Filtrarea nu a returnat nici un rezultat.";}},filterBlogs:function(ev,cmp) {this.filter(ev,cmp,this.Id+"zelist-blogs");},filterPress:function(ev,cmp) {this.filter(ev,cmp,this.Id+"zelist-press");},addMyListeners:function() {this.on('afterLayout',Ext.state.stateObserver.doSave,Ext.state.stateObserver);},cleanup:function() {this.delayedTask.cancel();},refresh:function(id) {this.delayedTask.cancel();this.delayedTask.delay(this.timeInterval);if(id!=null) {var panel=Ext.getCmp(id);if(panel.rendered==true) {panel.store.load();}} else {var panel=Ext.getCmp(this.Id+"zelist-blogs");if(panel.rendered==true) {panel.store.load();} var panel=Ext.getCmp(this.Id+"zelist-press");if(panel.rendered==true) {panel.store.load();}}},getDefaultTitle:function() {return agregator.labels.zelistTitle;},getCurrentState:function() {return{section:this.section,filter:this.filterText};},ToString:function() {return"Zelist";}}); Ext.ux.TopTwitter=function(data){this.delayedTask=new Ext.util.DelayedTask(this.refresh,this);this.timeInterval=15*60*1000;if(data!=null) {this.section=data.section;this.filterText=data.filter;} else {this.section=1;this.filterText="";} this.addEvents({stateevent:true});this.Id=Ext.id();Ext.ux.TopTwitter.superclass.constructor.call(this,{id:this.Id+'top-twitter-tabs',activeTab:0,margins:'0 5 5 0',resizeTabs:true,tabWidth:100,minTabWidth:50,autoWidth:true,autoScroll:false,height:220,items:[{id:this.Id+"top-twitter-24",xtype:"panel",autoScroll:true,autoWidth:(Ext.isIE)?false:true,title:agregator.labels.topTwitter24,store:new Ext.data.Store({proxy:new Ext.data.HttpProxy({url:'feeds/feed'}),id:this.Id+"top-twitter-24",baseParams:{feed:"http://twitter-screen.appspot.com/feeds?feed=24",panelId:this.Id+"top-twitter-24"},reader:new Ext.data.JsonReader({root:"items"},['title','author',{name:'pubDate',type:'date'},'link','description','content']),listeners:{"load":{fn:this.onLoadStore,scope:this},"loadexception":{fn:this.handleConnectionException,scope:this}}})},{id:this.Id+"top-twitter-6",xtype:"panel",autoScroll:true,autoWidth:(Ext.isIE)?false:true,title:agregator.labels.topTwitter6,store:new Ext.data.Store({proxy:new Ext.data.HttpProxy({url:'feeds/feed'}),id:this.Id+"top-twitter-6",baseParams:{feed:"http://twitter-screen.appspot.com/feeds?feed=2",panelId:this.Id+"top-twitter-6"},reader:new Ext.data.JsonReader({root:"items"},['title','author',{name:'pubDate',type:'date'},'link','description','content']),listeners:{"load":{fn:this.onLoadStore,scope:this},"loadexception":{fn:this.handleConnectionException,scope:this}}}),listeners:{"render":{fn:function(cmp) {this.loadMask.show();cmp.store.load();},scope:this}}}]});this.on('render',this.loadTopTwitter,this);this.on('beforedestroy',this.cleanup,this);};Ext.extend(Ext.ux.TopTwitter,Ext.TabPanel,{loadTopTwitter:function(section,filter){this.delayedTask.cancel();this.delayedTask.delay(this.timeInterval);var titleIcon=this.ownerCt.header.child("img.x-panel-inline-icon");if(titleIcon!=null) {titleIcon.removeClass("feed-icon");titleIcon.dom.src="http://assets1.twitter.com/images/favicon.ico";} var panel=Ext.getCmp(this.Id+"top-twitter-24");this.loadMask=new Ext.LoadMask(this.container.dom.parentNode,{msg:agregator.labels.loading,store:panel.store});panel.store.load();this.loadMask.show();},onLoadStore:function(store,records,options) {if(store.data.length>0) {var panel=Ext.getCmp(store.id);this.tempContent="";this.filterText=panel.store.filterText;store.data.each(this.drawFeedItem,this);panel.body.dom.innerHTML=this.tempContent;this.filterText=null;delete this.filterText;this.tempContent=null;delete this.tempContent;this.loadMask.hide();panel.tries=0;this.doLayout();} else {this.retry(store.id);}},drawFeedItem:function(record) {var xf=Ext.util.Format;var description=xf.ellipsis(xf.stripTags(record.data.description),200);description=(description!=null)?description:"";var link=record.data.link;var title=record.data.title;if(this.filterText!=null) {var specials=new RegExp("[.*+?|()\\[\\]{}\\\\]","g");var filterText=this.filterText.replace(specials,"\\$&");var regex=new RegExp(filterText,"gi");var filterArray=regex.exec(title);if(filterArray!=null&&filterArray.length>0) {for(var i=0;i"+filterArray[i]+"");}}} var paranthesys=new RegExp("\\([\\s\\w.:\\/-]+\\)$","gi");var siteTitle=paranthesys.exec(title);if(siteTitle!=null&&siteTitle.length>0) {title=title.replace(paranthesys,""+siteTitle[siteTitle.length-1]+"");} var date="";if(record.data.pubDate!=null&&record.data.pubDate.getTime!=null&&!isNaN(record.data.pubDate)) {date=record.data.pubDate.format("j M H:i");} description+="

"+date;description=description.replace(new RegExp("\\'","g"),"`");description=description.replace(new RegExp('\\"',"g"),"`");var positionNumber=record.store.indexOf(record)+1;var position=(positionNumber<10)?" "+positionNumber:positionNumber;position=""+position+". " var item=String.format("{2}{3}",link,description,position,title,this.Id);var hours=(record.store.id==this.Id+"top-twitter-24")?"24 de":"doua";var twitterText=String.format('%23{0} pe locul {1} in topul hashtag-urilor din Romania pe ultimele {2} ore.(via @agregator)',title,positionNumber,hours);this.tempContent+='
Twit this!

'+item+'

';},handleConnectionException:function(proxy,options,response,error) {this.loadMask.show();this.retry(options.params.panelId);},retry:function(id) {var panel=Ext.getCmp(id);panel.tries=(panel.tries!=null)?(panel.tries+1):0;if(panel.tries<3) {this.refresh(id);} else {this.loadMask.hide();panel.body.dom.innerHTML="Se pare ca sunt mici probleme.
Va rugam incercati mai tarziu, daca problema persista ne puteti contacta la adresa de e-mail contact@agregator.ro."}},filter:function(ev,cmp,id) {if(ev!=null&&(ev.isNavKeyPress()||ev.isSpecialKey())) {return;} var newValue=cmp.value;var panel=Ext.getCmp(id);if(newValue==null||newValue.trim()=="") {panel.store.clearFilter();panel.store.filterText=null;} else {panel.store.filterText=newValue;panel.store.filter("title",newValue,true);} if(panel.store.data.length>0) {this.onLoadStore(panel.store);} else {panel.body.dom.innerHTML="Filtrarea nu a returnat nici un rezultat.";}},filterBlogs:function(ev,cmp) {this.filter(ev,cmp,this.Id+"top-twitter-24");},filterPress:function(ev,cmp) {this.filter(ev,cmp,this.Id+"top-twitter-6");},addMyListeners:function() {this.on('afterLayout',Ext.state.stateObserver.doSave,Ext.state.stateObserver);},cleanup:function() {this.delayedTask.cancel();},refresh:function(id) {this.delayedTask.cancel();this.delayedTask.delay(this.timeInterval);if(id!=null) {var panel=Ext.getCmp(id);if(panel.rendered==true) {panel.store.load();}} else {var panel=Ext.getCmp(this.Id+"top-twitter-24");if(panel.rendered==true) {panel.store.load();} panel=Ext.getCmp(this.Id+"top-twitter-6");if(panel.rendered==true) {panel.store.load();}}},getDefaultTitle:function() {return agregator.labels.topTwitterTitle;},getCurrentState:function() {return{section:this.section,filter:this.filterText};},ToString:function() {return"TopTwitter";}});Ext.ux.TopTwitter.loadHash=function(text,id) {var mainPanel=Ext.state.stateObserver.stateUser;var leaf={type:'widget',name:'SearchTwitter',text:'Search Twitter',icon:'http://assets1.twitter.com/images/favicon.ico',leaf:true,data:{filter:"#"+text+" near:Romania"},cls:'feed'};var position=mainPanel.getItemPosition(id);if(position!=null) {mainPanel.loadLeaf(leaf,{x:position.x,y:position.y+1});} else {mainPanel.loadLeaf(leaf);}} Ext.ux.SearchTwitter=function(data){this.delayedTask=new Ext.util.DelayedTask(this.refresh,this);this.timeInterval=5*60*1000;if(data!=null) {this.section=data.section;this.searchText=data.filter;} else {this.section=1;} this.searchText=(this.searchText!=null&&this.searchText!="")?this.searchText:"@agregator";this.addEvents({stateevent:true});this.Id=Ext.id();Ext.ux.SearchTwitter.superclass.constructor.call(this,{widgetType:"search-twitter",id:this.Id+"search-twitter",xtype:"panel",autoScroll:true,autoWidth:(Ext.isIE)?false:true,height:300,store:new Ext.data.Store({proxy:new Ext.data.HttpProxy({url:'feeds/twitter'}),baseParams:this.getSearchParams(),reader:new Ext.data.JsonReader({root:"items"},['title','author',{name:'pubDate',type:'date'},'link','description','content']),listeners:{"load":{fn:this.onLoadStore,scope:this},"loadexception":{fn:this.handleConnectionException,scope:this}}}),tbar:[{xtype:"textfield",width:250,value:this.searchText,id:this.Id+"txSearchTwitter",listeners:{"specialkey":{fn:function(cmp,ev) {if(ev.getKey()==ev.ENTER) {this.searchTwitter(ev,cmp);}},scope:this}}},{xtype:"button",text:agregator.labels.mediaSearch,listeners:{"click":{fn:this.searchTwitter,scope:this}}}]});this.on('render',this.loadSearchTwitter,this);this.on('beforedestroy',this.cleanup,this);};Ext.extend(Ext.ux.SearchTwitter,Ext.Panel,{loadSearchTwitter:function(section,filter){this.delayedTask.cancel();this.delayedTask.delay(this.timeInterval);var titleIcon=this.ownerCt.header.child("img.x-panel-inline-icon");if(titleIcon!=null) {titleIcon.removeClass("feed-icon");titleIcon.dom.src="http://assets1.twitter.com/images/favicon.ico";} var panel=Ext.getCmp(this.Id+"search-twitter");this.loadMask=new Ext.LoadMask(this.container.dom.parentNode,{msg:agregator.labels.loading,store:panel.store});panel.store.load();this.loadMask.show();},searchTwitter:function(ev,cmp) {var txSearchTwitter=Ext.getCmp(this.Id+"txSearchTwitter");this.searchText=txSearchTwitter.getValue();var panel=Ext.getCmp(this.Id+"search-twitter");panel.store.baseParams=this.getSearchParams();panel.store.load();Ext.state.stateObserver.doSave.call(Ext.state.stateObserver);},onLoadStore:function(store,records,options) {if(store.data.length>0) {var panel=Ext.getCmp(this.Id+"search-twitter");this.tempContent="";store.data.each(this.drawFeedItem,this);panel.body.dom.innerHTML=this.tempContent;this.tempContent=null;delete this.tempContent;this.loadMask.hide();this.tries=0;this.doLayout();} else {this.retry(this.Id+"search-twitter");}},drawFeedItem:function(record) {var xf=Ext.util.Format;var description=xf.ellipsis(xf.stripTags(record.data.description),200);description=(description!=null)?description:"";var link=record.data.link;var title=record.data.title;var author=record.data.author;var date="";if(record.data.pubDate!=null&&record.data.pubDate.getTime!=null&&!isNaN(record.data.pubDate)) {date=record.data.pubDate.format("j M H:i");} description+="

"+date;description=description.replace(new RegExp("\\'","g"),"`");description=description.replace(new RegExp('\\"',"g"),"`");var item=String.format("{2}: {3}",link,description,author,title);this.tempContent+='

'+item+'

';},handleConnectionException:function(proxy,options,response,error) {this.loadMask.show();this.retry(this.Id+"search-twitter");},retry:function(id) {this.tries=(this.tries!=null)?(this.tries+1):0;if(this.tries<3) {this.refresh(id);} else {this.loadMask.hide();var panel=Ext.getCmp(id);panel.body.dom.innerHTML="Nici un rezultat.";}},addMyListeners:function() {this.on('afterLayout',Ext.state.stateObserver.doSave,Ext.state.stateObserver);},cleanup:function() {this.delayedTask.cancel();},refresh:function(id) {this.delayedTask.cancel();this.delayedTask.delay(this.timeInterval);var panel=Ext.getCmp(this.Id+"search-twitter");if(panel.rendered==true) {panel.store.load();}},getSearchParams:function() {var nearIndex=this.searchText.toLowerCase().indexOf("near:romania");if(nearIndex>-1) {var text=this.searchText.substring(0,nearIndex-1);return{query:text,geocode:true};} else {return{query:this.searchText};}},getDefaultTitle:function() {return agregator.labels.twitterSearchTitle;},getCurrentState:function() {return{section:this.section,filter:this.searchText};},ToString:function() {return"SearchTwitter";}}); FeedPanel=function(){FeedPanel.superclass.constructor.call(this,{id:'feed-tree',region:'west',title:agregator.labels.feeds,split:true,width:225,minSize:175,maxSize:400,collapsible:true,margins:'0 0 5 5',cmargins:'5 5 5 5',rootVisible:false,lines:false,autoScroll:true,root:new Ext.tree.AsyncTreeNode({text:'Autos',draggable:false,id:'source',children:agregator.labels.menuTree}),loader:new Ext.tree.TreeLoader(),collapseFirst:false,tbar:[{iconCls:'add-feed',text:agregator.labels.add,handler:this.showWindow,scope:this},{text:agregator.labels.newTab,iconCls:'add-tab',handler:this.newTab,scope:this}]});this.getSelectionModel().on({'beforeselect':function(sm,node){return node.isLeaf();},'selectionchange':function(sm,node){if(node){if(node.attributes!=null&&node.attributes.type!=null) {this.fireEvent('leafselect',node.attributes);} else {this.fireEvent('feedselect',node.attributes);}} this.getSelectionModel().unselect(node);},scope:this});this.addEvents({feedselect:true,leafselect:true});this.on('contextmenu',this.onContextMenu,this);};Ext.extend(FeedPanel,Ext.tree.TreePanel,{onContextMenu:function(node,e){if(!this.menu){this.menu=new Ext.menu.Menu({id:'feeds-ctx',items:[{id:'load',iconCls:'load-icon',text:agregator.labels.open,scope:this,handler:function(){this.ctxNode.select();}},'-',{iconCls:'add-feed',text:agregator.labels.add,handler:this.showWindow,scope:this}]});this.menu.on('hide',this.onContextHide,this);} if(this.ctxNode){this.ctxNode.ui.removeClass('x-node-ctx');this.ctxNode=null;} if(node.isLeaf()){this.ctxNode=node;this.ctxNode.ui.addClass('x-node-ctx');this.menu.items.get('load').setDisabled(node.isSelected());this.menu.showAt(e.getXY());}},onContextHide:function(){if(this.ctxNode){this.ctxNode.ui.removeClass('x-node-ctx');this.ctxNode=null;}},showWindow:function(btn){if(!this.win){this.win=new Ext.ux.FeedWindow();this.win.on('validfeed',this.addFeed,this);} this.win.show(btn);},newTab:function() {var mainPanel=Ext.getCmp('main-tabs');mainPanel.openTab(agregator.labels.edit);},selectFeed:function(url){this.getNodeById(url).select();},removeFeed:function(url){var node=this.getNodeById(url);if(node){node.unselect();Ext.fly(node.ui.elNode).ghost('l',{callback:node.remove,scope:node,duration:.4});}},addFeed:function(attrs,inactive,preventAnim){var exists=this.getNodeById(attrs.url);if(exists){if(!inactive){exists.select();exists.ui.highlight();} return;} this.fireEvent('feedselect',attrs);return;},afterRender:function(){FeedPanel.superclass.afterRender.call(this);this.el.on('contextmenu',function(e){e.preventDefault();});}}); Ext.ux.FeedView=function(viewer,config,feed){this.viewer=viewer;this.feed=feed;this.delayedTask=new Ext.util.DelayedTask(this.refreshFeed,this);this.timeInterval=15*60*1000;var id=!feed.url?Ext.id():feed.url.replace(/[^A-Z0-9-_]/gi,'');Ext.apply(this,config);this.store=new Ext.data.Store({proxy:new Ext.data.HttpProxy({url:'feeds/feed'}),reader:new Ext.data.JsonReader({root:"items"},['title','author',{name:'pubDate',type:'date'},'link','description','content']),listeners:{"load":{fn:this.onLoadStore,scope:this},"loadexception":{fn:this.handleConnectionException,scope:this}}});this.store.setDefaultSort('pubDate',"DESC");Ext.ux.FeedView.superclass.constructor.call(this,{header:false,layout:'fit',border:false,html:' '});this.on('rowcontextmenu',this.onContextClick,this);this.on('render',this.renderHandler,this);this.on('afterlayout',this.afterLayoutHandler,this);this.on('beforedestroy',this.cleanup,this);};Ext.extend(Ext.ux.FeedView,Ext.Panel,{onContextClick:function(grid,index,e){if(!this.menu){this.menu=new Ext.menu.Menu({id:'grid-ctx',items:[{text:agregator.labels.openNewTab,iconCls:'new-tab',scope:this,handler:function(){this.viewer.openTab(this.ctxRecord);}},'-',{iconCls:'refresh-icon',text:'Refresh',scope:this,handler:function(){this.ctxRow=null;this.store.reload();}}]});this.menu.on('hide',this.onContextHide,this);} e.stopEvent();if(this.ctxRow){Ext.fly(this.ctxRow).removeClass('x-node-ctx');this.ctxRow=null;} this.ctxRow=this.view.getRow(index);this.ctxRecord=this.store.getAt(index);Ext.fly(this.ctxRow).addClass('x-node-ctx');this.menu.showAt(e.getXY());},onContextHide:function(){if(this.ctxRow){Ext.fly(this.ctxRow).removeClass('x-node-ctx');this.ctxRow=null;}},renderHandler:function(cmp) {this.body.on("mousewheel",this.hoverHandler,this);this.loadFeed();},afterLayoutHandler:function(cmp) {this.un('afterlayout',this.afterLayoutHandler,this);this.loadMask=new Ext.LoadMask(this.container.dom.parentNode,{msg:agregator.labels.loading,store:this.store});this.loadMask.show();},loadFeed:function(url){this.delayedTask.cancel();this.delayedTask.delay(this.timeInterval);var url=this.feed.url;this.store.baseParams={feed:url};this.store.load();},refreshFeed:function() {this.delayedTask.cancel();this.delayedTask.delay(this.timeInterval);this.loadMask.show();this.store.reload();},hoverHandler:function() {this.delayedTask.cancel();this.delayedTask.delay(this.timeInterval);},onLoadStore:function() {var feedRecord=this.store.reader.jsonData;if(this.ownerCt!=null&&feedRecord.title!=null&&feedRecord.title!="") {this.ownerCt.setTitle(feedRecord.title);} var titleIcon=this.ownerCt.header.child("img.x-panel-inline-icon");if(titleIcon!=null&&feedRecord.favicon!=null&&feedRecord.favicon!="") {titleIcon.removeClass("feed-icon");titleIcon.dom.src=feedRecord.favicon;} if(this.store.data.length>0) {this.body.dom.innerHTML="";this.tempContent="";var content=this.store.data.each(this.drawFeedItem,this);this.body.dom.innerHTML=this.tempContent;this.tempContent=null;delete this.tempContent;this.tries=0;this.doLayout();} else {this.retry();}},drawFeedItem:function(record) {var content="";var xf=Ext.util.Format;var description=xf.ellipsis(xf.stripTags(record.data.description),200);var date="";if(record.data.pubDate!=null&&record.data.pubDate.getTime!=null&&!isNaN(record.data.pubDate)) {date="["+record.data.pubDate.format("j M H:i")+"] - ";} var item=String.format("{2}{3}",record.data.link,description,date,record.data.title);this.tempContent+='

'+item+'

';},handleConnectionException:function(proxy,options,response,error) {this.loadMask.show();this.retry(response);},delayRandom:function() {var date=new Date();var delay=(date.getTime()%3)*10;var delayedTask=new Ext.util.DelayedTask(this.loadFeed,this);delayedTask.delay(delay);},retry:function(response) {this.tries=(this.tries!=null)?(this.tries+1):0;if(this.tries<3) {this.refreshFeed();} else {this.body.dom.innerHTML="Se pare ca sunt mici probleme.
Va rugam incercati mai tarziu, daca problema persista ne puteti contacta la adresa de e-mail contact@agregator.ro."}},togglePreview:function(show){this.view.showPreview=show;this.view.refresh();},cleanup:function() {this.delayedTask.cancel();},formatDate:function(date){if(!date){return'';} var now=new Date();var d=now.clearTime(true);var notime=date.clearTime(true).getTime();if(notime==d.getTime()){return'Azi '+date.dateFormat('g:i a');} d=d.add('d',-6);if(d.getTime()<=notime){return date.dateFormat('D g:i a');} return date.dateFormat('n/j g:i a');}}); if('function'!==Ext.type(Ext.ux.clone)){Ext.ux.clone=function(o){if('object'!==typeof o){return o;} var c='function'===typeof o.pop?[]:{};var p,v;for(p in o){v=o[p];if('object'===typeof v){c[p]=Ext.ux.clone(v);} else{c[p]=v;}} return c;}} Ext.ux.HttpProvider=function(config){this.addEvents('readsuccess','readfailure','savesuccess','savefailure');Ext.ux.HttpProvider.superclass.constructor.call(this);Ext.apply(this,config,{delay:750,dirty:false,started:false,autoStart:true,autoRead:true,user:'user',id:1,session:'session',logFailure:false,logSuccess:false,queue:[],url:'.',readUrl:undefined,saveUrl:undefined,method:'post',saveBaseParams:{},readBaseParams:{},paramNames:{id:'id',name:'name',value:'value',user:'user',session:'session',data:'data'}});if(this.autoRead){this.readState();} this.dt=new Ext.util.DelayedTask(this.submitState,this);if(this.autoStart){this.start();}};Ext.extend(Ext.ux.HttpProvider,Ext.state.Provider,{saveSuccessText:'Save Success',saveFailureText:'Save Failure',readSuccessText:'Read Success',readFailureText:'Read Failure',dataErrorText:'Data Error',initState:function(state){if(state instanceof Array){Ext.each(state,function(item){this.state[item.name]=this.decodeValue(item.value);},this);} else{this.state=state?state:{};}},set:function(name,value){if(!name){return;} this.queueChange(name,value);this.start();},start:function(){this.dt.delay(this.delay);this.started=true;},stop:function(){this.dt.cancel();this.started=false;},queueChange:function(name,value){var changed=undefined===this.state[name]||this.state[name]!==value;var o={};var i;var found=false;if(changed){o[this.paramNames.name]=name;o[this.paramNames.value]=this.encodeValue(value);for(i=0;i
{city}, {county}
',store:new Ext.data.Store({proxy:new Ext.data.HttpProxy({url:'index/cities'}),reader:new Ext.data.JsonReader({},[{name:'city',mapping:'Localitate'},{name:'county',mapping:'Judet'},{name:'countyId',mapping:'JudetId'}])}),xtype:"combo",loadingText:agregator.labels.search,triggerAction:'all',valueField:"CompanySymbol",displayField:"city",hideTrigger:true,typeAhead:false,maxHeight:250,minChars:1,width:200,itemSelector:'div.search-item',listeners:{"select":{fn:function(combo,record){combo.setValue(record.data.city);this.loadWeather(record.data.city,record.data.countyId);},scope:this}}}]});this.on('render',this.loadWeather,this);this.on('beforedestroy',this.cleanup,this);} Ext.extend(Ext.ux.Weather,Ext.Panel,{loadWeather:function(city,countyId){this.delayedTask.cancel();this.delayedTask.delay(this.timeInterval);var titleIcon=this.ownerCt.header.child("img.x-panel-inline-icon");if(titleIcon!=null) {titleIcon.removeClass("feed-icon");titleIcon.dom.src="/public/images/weather_cloudy.png";} countyId=(countyId*1<9)?"0"+countyId:countyId;if(city!=null&&countyId!=null) {this.city=city;this.countyId=countyId;Ext.state.stateObserver.doSave();} if(this.city!=null&&this.countyId!=null) {this.body.dom.innerHTML='
';}},addMyListeners:function() {this.on('afterLayout',Ext.state.stateObserver.doSave,Ext.state.stateObserver);},cleanup:function() {this.delayedTask.cancel();},refresh:function() {this.body.dom.innerHTML=this.body.dom.innerHTML;this.doLayout();},getDefaultTitle:function() {return agregator.labels.weatherTitle;},getCurrentState:function() {return{city:this.city,countyId:this.countyId};},ToString:function() {return"Weather";}}); Ext.ux.StateObserver=function(stateUser,stateEvent){this.stateUser=stateUser;this.stateEvent=stateEvent;} Ext.extend(Ext.ux.StateObserver,Ext.util.Observable,{doSave:function(){this.stateUser.fireEvent(this.stateEvent);}}); Ext.ux.LeafItem=function(attributes){var widgetName=attributes.name.charAt(0).toUpperCase()+attributes.name.substring(1);if(Ext.ux[widgetName]==null) {return;} if(attributes.data!=null&&attributes.data!="") {this.leafView=new Ext.ux[widgetName](attributes.data);} else {this.leafView=new Ext.ux[widgetName]();} this.addEvents({unloadleaf:true});var tools=[{id:'refresh',handler:this.refresh,scope:this},{id:'close',handler:this.closeHandler,scope:this}];Ext.ux.LeafItem.superclass.constructor.call(this,{style:'padding:0 0 10px 0',title:this.leafView.getDefaultTitle(),tools:tools,iconCls:'feed-icon',draggable:true,collapsible:true,stateful:false,autoScroll:true,items:this.leafView});this.on("render",this.doLayout,this);this.on("beforestatesave",function(){return false;});};Ext.extend(Ext.ux.LeafItem,Ext.Panel,{refresh:function() {this.leafView.refresh();},closeHandler:function(e,target,panel) {this.fireEvent("unloadleaf","unloadleaf");Ext.state.stateObserver.doSave();panel.ownerCt.remove(panel,true);},getState:function() {return null;}}); Ext.ux.FeedItem=function(viewer,config,feed){this.feedView=new Ext.ux.FeedView(viewer,config,feed);this.addEvents({unloaditem:true});var tools=[{id:'refresh',handler:this.refresh,scope:this},{id:'close',handler:this.closeHandler,scope:this}];var id=!feed.url?Ext.id():feed.url.replace(/[^A-Z0-9-_]/gi,'');Ext.ux.FeedItem.superclass.constructor.call(this,{style:'padding:0 0 10px 0',title:feed.text,tools:tools,iconCls:'feed-icon',height:200,draggable:true,collapsible:true,autoScroll:true,stateful:false,items:this.feedView});this.on("render",this.doLayout,this);this.on("beforestatesave",function(){return false;});};Ext.extend(Ext.ux.FeedItem,Ext.Panel,{refresh:function() {this.feedView.refreshFeed();},closeHandler:function(e,target,panel) {this.fireEvent("unloaditem","unloaditem");panel.ownerCt.remove(panel,true);},getState:function() {return null;}}); Ext.ux.FeedWindow=function(){this.feedUrl=new Ext.form.ComboBox({id:'feed-url',fieldLabel:agregator.labels.inputFeed,emptyText:agregator.labels.inputExample,width:450,validationEvent:false,validateOnBlur:false,msgTarget:'under',triggerAction:'all',displayField:'url',mode:'local',listeners:{valid:this.syncShadow,invalid:this.syncShadow,specialkey:function(cmb,ev) {if(ev.getKey()==ev.ENTER) {this.onAdd();}},scope:this},tpl:new Ext.XTemplate('
','{url}{text}','
','
'),store:new Ext.data.SimpleStore({fields:['url','text'],data:this.defaultFeeds})});this.form=new Ext.FormPanel({labelAlign:'top',items:this.feedUrl,border:false,bodyStyle:'background:transparent;padding:10px;'});Ext.ux.FeedWindow.superclass.constructor.call(this,{title:agregator.labels.addFeed,iconCls:'feed-icon',id:'add-feed-win',autoHeight:true,width:500,resizable:false,plain:true,modal:true,y:100,autoScroll:true,closeAction:'hide',buttons:[{text:agregator.labels.add,handler:this.onAdd,scope:this},{text:agregator.labels.cancel,handler:this.hide.createDelegate(this,[])}],items:this.form});this.addEvents({add:true});} Ext.extend(Ext.ux.FeedWindow,Ext.Window,{defaultFeeds:agregator.labels.defaultFeeds,show:function(){if(this.rendered){this.feedUrl.setValue('');} Ext.ux.FeedWindow.superclass.show.apply(this,arguments);},onAdd:function(){this.el.mask(agregator.labels.validatingFeed,'x-mask-loading');var url=this.feedUrl.getValue();Ext.Ajax.request({url:'feed-proxy.php',params:{feed:url},success:this.validateFeed,failure:this.markInvalid,scope:this,feedUrl:url});},markInvalid:function(){this.feedUrl.markInvalid(agregator.labels.validatingFeedErrors);this.el.unmask();},validateFeed:function(response,options){var dq=Ext.DomQuery;var url=options.feedUrl;try {var json=Ext.decode(response.responseText);if(typeof json=="object") {var text=(json.title.length>0)?json.title:url;var description=(json.description.length>0)?json.description:'Nu are descriere.';this.el.unmask();this.hide();return this.fireEvent('validfeed',{url:url,text:text,description:description});}} catch(e){x=0;} this.markInvalid();}}); Ext.ux.Stocks=function(stocks){stocks=(stocks==null)?"BRD,SNP,TLV,TGN,RRC,TEL,IMP,BIO,ATB,BRK":stocks;this.delayedTask=new Ext.util.DelayedTask(this.refresh,this);this.timeInterval=5*60*1000;this.id=Ext.id();this.addEvents({stateevent:true});function italic(value){return''+value+'';} function change(val){if(val>0){return''+val+'';}else if(val<0){return''+val+'';} return val;} function pctChange(val){if(val>0){return''+val+'%';}else if(val<0){return''+val+'%';} return val;} var sm2=new Ext.grid.CheckboxSelectionModel();Ext.ux.Stocks.superclass.constructor.call(this,{widgetType:"stocks",store:new Ext.data.Store({proxy:new Ext.data.HttpProxy({url:'index/stocks'}),reader:new Ext.data.JsonReader({},[{name:'CompanySymbol',mapping:'SimbolID'},{name:'Price',mapping:'Pret',type:'float'},{name:'Change',mapping:'Variatie',type:'float'},{name:'Date',mapping:'Data',type:'date',dateFormat:'Y-m-d H:i:s'}])}),cm:new Ext.grid.ColumnModel([sm2,{header:agregator.labels.stocksCompany,width:90,sortable:true,dataIndex:'CompanySymbol'},{header:agregator.labels.stocksPrice,width:50,sortable:true,dataIndex:'Price'},{header:agregator.labels.stocksPercent,width:50,sortable:true,renderer:pctChange,dataIndex:'Change'},{header:agregator.labels.stocksData,width:85,sortable:true,renderer:Ext.util.Format.dateRenderer('d M H:i'),dataIndex:'Date'}]),loadMask:{msg:agregator.labels.loading},sm:sm2,viewConfig:{forceFit:true},autoWidth:true,width:340,height:250,tbar:[{text:agregator.labels.stocksDelete,tooltip:agregator.labels.stocksDeleteCompany,iconCls:"delete-company",listeners:{"click":{fn:this.removeSelected,scope:this}}},"-",{tpl:'
{CompanySymbol}
',store:new Ext.data.Store({data:agregator.companies,reader:new Ext.data.JsonReader({},[{name:'CompanySymbol',mapping:'s'},{name:'CompanyName',mapping:'n'}])}),id:"cmbAddCompany"+this.id,xtype:"combo",mode:"local",loadingText:agregator.labels.search,triggerAction:'all',valueField:"CompanySymbol",displayField:"CompanySymbol",forceSelection:true,typeAhead:true,maxHeight:200,minChars:0,width:50},{text:agregator.labels.add,tooltip:agregator.labels.stocksAddCompany,iconCls:"add-company",listeners:{"click":{fn:this.addCompany,scope:this},"render":{fn:function(){this.loadStocks(stocks);},scope:this}}}]});this.on('render',this.addMyListeners,this);this.on('beforedestroy',this.cleanup,this);} Ext.extend(Ext.ux.Stocks,Ext.grid.GridPanel,{loadStocks:function(symbol){this.delayedTask.cancel();this.delayedTask.delay(this.timeInterval);var titleIcon=this.ownerCt.header.child("img.x-panel-inline-icon");if(titleIcon!=null) {titleIcon.removeClass("feed-icon");titleIcon.dom.src="http://www.bvb.ro/favicon.ico";} var stocks=this.getCurrentState();if(stocks!="") {stocks+=(symbol!=null&&symbol!="")?","+symbol:"";} else {stocks=symbol;} if(stocks!="") {this.store.baseParams={type:"in",stocks:stocks};this.store.load();}},addMyListeners:function() {var cmb=Ext.get("cmbAddCompany"+this.id);if(cmb!=null) {cmb.focus(false,500);} this.store.on('load',Ext.state.stateObserver.doSave,Ext.state.stateObserver);},cleanup:function() {this.delayedTask.cancel();},refresh:function() {this.loadStocks();},removeSelected:function() {var selectedRows=this.getSelectionModel().getSelections();for(var i=0;i','','{text}','','');tt.disableFormats=true;tt.compile();this.itemTpl=tt;MainPanel.superclass.onRender.call(this,ct,position);this.header.unselectable="off";this.header.removeClass("x-unselectable");this.header.setStyle("-khtml-user-select","");this.header.setStyle("-moz-user-select","");this.header.dom.unselectable="off";},onStripMouseDown:function(e){if(e.button!=0){return;} var t=this.findTargets(e);if(t.close){e.preventDefault();this.remove(t.item);return;} if(t.item&&t.item!=this.activeTab){this.setActiveTab(t.item);} else {var tv=e.getTarget('.x-tab-strip-tv',this.strip);if(tv!=null) {e.preventDefault();this.openTV(this.activeTab);return;} if(!t.close&&t.item&&t.item==this.activeTab){e.preventDefault();this.editTabTitle(t);}}},loadFeed:function(feed){this.getActiveTab().loadFeed(feed);},loadLeaf:function(attributes,position){this.getActiveTab().loadLeaf(attributes,position);},addTab:function(tab) {this.add(tab);tab.on("drop",this.myRelayEvent,this);tab.on("loaditem",this.myRelayEvent,this);tab.on("unloaditem",this.myRelayEvent,this);tab.on("stateevent",this.myRelayEvent,this);},myRelayEvent:function(event) {if(typeof(event)=="string") {this.fireEvent(event);} else {this.fireEvent("drop");}},movePreview:function(m,pressed){if(!m){var readMenu=Ext.menu.MenuMgr.get('reading-menu');readMenu.render();var items=readMenu.items.items;var b=items[0],r=items[1],h=items[2];if(b.checked){r.setChecked(true);}else if(r.checked){h.setChecked(true);}else if(h.checked){b.setChecked(true);} return;} if(pressed){var preview=this.preview;var right=Ext.getCmp('right-preview');var bot=Ext.getCmp('bottom-preview');var btn=this.grid.getTopToolbar().items.get(2);switch(m.text){case'Bottom':right.hide();bot.add(preview);bot.show();bot.ownerCt.doLayout();btn.setIconClass('preview-bottom');break;case'Right':bot.hide();right.add(preview);right.show();right.ownerCt.doLayout();btn.setIconClass('preview-right');break;case'Hide':preview.ownerCt.hide();preview.ownerCt.ownerCt.doLayout();btn.setIconClass('preview-hide');break;}}},getStoresFromTab:function(tab) {var stores=new Array();for(var i=0;i0) {var tabTV=new Ext.ux.FeedTV(stores);tabTV.show();}},openTab:function(title){tab=new Ext.ux.Portal({region:'center',margins:'35 5 5 0',title:title,tabTip:title,closable:true,items:[{columnWidth:.33,style:'padding:10px 0 10px 10px'},{columnWidth:.33,style:'padding:10px 0 10px 10px'},{columnWidth:.33,style:'padding:10px'}]});this.addTab(tab);this.setActiveTab(tab);},openAll:function(){this.beginUpdate();this.grid.store.data.each(this.openTab,this);this.endUpdate();},editTabTitle:function(tab) {var titleSpan=Ext.fly(tab.el).child('span.x-tab-strip-text',true);var titleInput=Ext.fly(tab.el).child('input.x-tab-strip-input',true);titleSpan.style.display="none";titleInput.style.display="inline";titleInput.focus();titleInput.select();if(tab.keyMap==null) {tab.keyMap=new Ext.KeyMap(titleInput,{key:13,fn:inputBlurHandler});} tab.keyMap.enable();var mainPanel=this;function inputBlurHandler() {tab.keyMap.disable();if(titleInput.value.trim()!="") {tab.item.setTitle(titleInput.value);mainPanel.fireEvent("changetitle");} else {titleInput.value=titleSpan.innerHTML;} titleSpan.style.display="";titleInput.style.display="none";} var titleInputObject=Ext.fly(tab.el).child('input.x-tab-strip-input');titleInputObject.on('blur',inputBlurHandler);},getItemPosition:function(id) {var position;var tab=this.getActiveTab();for(var i=0;ixy[1]){match=true;break;}} var overEvent=this.createEvent(dd,e,data,col,c,match&&p?pos:c.items.getCount());if(portal.fireEvent('validatedrop',overEvent)!==false&&portal.fireEvent('beforedragover',overEvent)!==false){px.getProxy().setWidth('auto');if(p){px.moveProxy(p.el.dom.parentNode,match?p.el.dom:null);}else{px.moveProxy(c.el.dom,null);} this.lastPos={c:c,col:col,p:match&&p?pos:false};this.scrollPos=portal.body.getScroll();portal.fireEvent('dragover',overEvent);return overEvent.status;;}else{return overEvent.status;}},notifyOut:function(){delete this.grid;},notifyDrop:function(dd,e,data){delete this.grid;if(!this.lastPos){return;} var c=this.lastPos.c,col=this.lastPos.col,pos=this.lastPos.p;var dropEvent=this.createEvent(dd,e,data,col,c,pos!==false?pos:c.items.getCount());if(this.portal.fireEvent('validatedrop',dropEvent)!==false&&this.portal.fireEvent('beforedrop',dropEvent)!==false){dd.proxy.getProxy().remove();dd.panel.el.dom.parentNode.removeChild(dd.panel.el.dom);if(pos!==false){c.insert(pos,dd.panel);}else{c.add(dd.panel);} c.doLayout();this.portal.fireEvent('drop',dropEvent);var st=this.scrollPos.top;if(st){var d=this.portal.body.dom;setTimeout(function(){d.scrollTop=st;},10);}} delete this.lastPos;},getGrid:function(){var box=this.portal.bwrap.getBox();box.columnX=[];this.portal.items.each(function(c){box.columnX.push({x:c.el.getX(),w:c.el.getWidth()});});return box;}}); Ext.ux.PortalColumn=Ext.extend(Ext.Container,{layout:'anchor',autoEl:'div',defaultType:'portlet',cls:'x-portal-column'});Ext.reg('portalcolumn',Ext.ux.PortalColumn); Ext.ux.Portlet=Ext.extend(Ext.Panel,{anchor:'100%',frame:true,collapsible:true,draggable:true,cls:'x-portlet'});Ext.reg('portlet',Ext.ux.Portlet); Ext.onReady(function(){Ext.QuickTips.init();Ext.BLANK_IMAGE_URL="/public/images/s.gif";Ext.apply(Ext.QuickTips.getQuickTip(),{maxWidth:300,minWidth:100,showDelay:50,trackMouse:true,dismissDelay:0,hideDelay:0});var feeds=new FeedPanel();var mainPanel=new MainPanel();Ext.state.stateObserver=new Ext.ux.StateObserver(mainPanel,"stateevent");var headerPanel=new Ext.Panel({id:"headerPanel",region:"north",header:false,border:false,cls:"header",height:80,html:'agregator de stiri'+''+' '+' '+' '+' '+' '+' '+' '});var footerPanel=new Ext.Panel({region:"south",header:false,border:false,margins:'0 5 5 5',cls:"header",height:20,html:'
BlogPentru bloggeri  | Despre Agregator.ro | Conditii de utilizare | Contact: contact(la)agregator.ro | Powered by ExtJs
'});feeds.on('feedselect',function(feed){mainPanel.loadFeed(feed);});feeds.on('leafselect',function(attributes){mainPanel.loadLeaf(attributes);});var viewport=new Ext.Viewport({layout:'border',items:[headerPanel,feeds,mainPanel,footerPanel]});var startUpdate=function() {var store=new Ext.data.JsonStore({url:'/index/lnkupdate',root:'results',fields:['url']});var updateYahooLink=function(record) {try {var url=record.data.items[0].json.url;} catch(e){} if(url!=null&&url!="") {var domLink=Ext.getDom("lnkYahoo");if(domLink!=null) {domLink.href=url;}}} store.on("load",updateYahooLink);store.load();} var task={run:startUpdate,interval:5*60*1000} Ext.TaskMgr.start(task);}); Ext.ux.TabCloseMenu=function(){var tabs,menu,ctxItem;this.init=function(tp){tabs=tp;tabs.on('contextmenu',onContextMenu);} function onContextMenu(ts,item,e){if(!menu){menu=new Ext.menu.Menu([{id:tabs.id+'-close',text:'Inchide tab',handler:function(){tabs.remove(ctxItem);}},{id:tabs.id+'-close-others',text:'Inchide restul',handler:function(){tabs.items.each(function(item){if(item.closable&&item!=ctxItem){tabs.remove(item);}});}}]);} ctxItem=item;var items=menu.items;items.get(tabs.id+'-close').setDisabled(!item.closable);var disableOthers=true;tabs.items.each(function(){if(this!=item&&this.closable){disableOthers=false;return false;}});items.get(tabs.id+'-close-others').setDisabled(disableOthers);menu.showAt(e.getPoint());}}; Ext.UpdateManager.defaults.indicatorText='
Încărcare...
';if(Ext.View){Ext.View.prototype.emptyText="";} if(Ext.grid.Grid){Ext.grid.Grid.prototype.ddText="{0} rând(uri) selectate";} if(Ext.TabPanelItem){Ext.TabPanelItem.prototype.closeText="Închide acest tab";} if(Ext.form.Field){Ext.form.Field.prototype.invalidText="Valoarea acestui câmp este invalidă";} if(Ext.LoadMask){Ext.LoadMask.prototype.msg="Încărcare...";} Date.monthNames=["Ianuarie","Februarie","Martie","Aprilie","Mai","Iunie","Iulie","August","Septembrie","Octombrie","Noiembrie","Decembrie"];Date.dayNames=["Duminică","Luni","Marţi","Miercuri","Joi","Vineri","Sâmbătă"];if(Ext.MessageBox){Ext.MessageBox.buttonText={ok:"OK",cancel:"Renunţă",yes:"Da",no:"Nu"};} if(Ext.util.Format){Ext.util.Format.date=function(v,format){if(!v)return"";if(!(v instanceof Date))v=new Date(Date.parse(v));return v.dateFormat(format||"d-m-Y");};} if(Ext.DatePicker){Ext.apply(Ext.DatePicker.prototype,{todayText:"Astăzi",minText:"Această zi este înaintea datei de început",maxText:"Această zi este după ultimul termen",disabledDaysText:"",disabledDatesText:"",monthNames:Date.monthNames,dayNames:Date.dayNames,nextText:'Următoarea lună (Control+Right)',prevText:'Luna anterioară (Control+Left)',monthYearText:'Alege o lună (Control+Up/Down pentru a parcurge anii)',todayTip:"{0} (Spacebar)",format:"d-m-y"});} if(Ext.PagingToolbar){Ext.apply(Ext.PagingToolbar.prototype,{beforePageText:"Pagina",afterPageText:"din {0}",firstText:"Prima pagină",prevText:"Pagina precedentă",nextText:"Următoarea pagină",lastText:"Ultima pagină",refreshText:"Reîmprospătare",displayMsg:"Afişează {0} - {1} din {2}",emptyMsg:'Nu sunt date de afişat'});} if(Ext.form.TextField){Ext.apply(Ext.form.TextField.prototype,{minLengthText:"Lungimea minimă pentru acest câmp este de {0}",maxLengthText:"Lungimea maximă pentru acest câmp este {0}",blankText:"Acest câmp este obligatoriu",regexText:"",emptyText:null});} if(Ext.form.NumberField){Ext.apply(Ext.form.NumberField.prototype,{minText:"Valoarea minimă permisă a acestui câmp este {0}",maxText:"Valaorea maximă permisă a acestui câmp este {0}",nanText:"{0} nu este un număr valid"});} if(Ext.form.DateField){Ext.apply(Ext.form.DateField.prototype,{disabledDaysText:"Inactiv",disabledDatesText:"Inactiv",minText:"Data acestui câmp trebuie să fie după {0}",maxText:"Data acestui câmp trebuie sa fie înainte de {0}",invalidText:"{0} nu este o dată validă - trebuie să fie în formatul {1}",format:"d-m-y"});} if(Ext.form.ComboBox){Ext.apply(Ext.form.ComboBox.prototype,{loadingText:"Încărcare...",valueNotFoundText:undefined});} if(Ext.form.VTypes){Ext.apply(Ext.form.VTypes,{emailText:'Acest câmp trebuie să conţină o adresă de e-mail în formatul "user@domain.com"',urlText:'Acest câmp trebuie să conţină o adresă URL în formatul "http:/'+'/www.domain.com"',alphaText:'Acest câmp trebuie să conţină doar litere şi _',alphanumText:'Acest câmp trebuie să conţină doar litere, cifre şi _'});} if(Ext.grid.GridView){Ext.apply(Ext.grid.GridView.prototype,{sortAscText:"Sortare ascendentă",sortDescText:"Sortare descendentă",lockText:"Blochează coloana",unlockText:"Deblochează coloana",columnsText:"Coloane"});} if(Ext.grid.PropertyColumnModel){Ext.apply(Ext.grid.PropertyColumnModel.prototype,{nameText:"Nume",valueText:"Valoare",dateFormat:"m/j/Y"});} if(Ext.layout.BorderLayout.SplitRegion){Ext.apply(Ext.layout.BorderLayout.SplitRegion.prototype,{splitTip:"Trage pentru redimensionare.",collapsibleSplitTip:"Trage pentru redimensionare. Dublu-click pentru ascundere."});} Ext.ux.EOK=function(tracks){this.delayedTask=new Ext.util.DelayedTask(this.refresh,this);this.timeInterval=30*60*1000;this.tracks="8641,10461,10467";this.addEvents({stateevent:true});Ext.ux.EOK.superclass.constructor.call(this,{widgetType:"EOK",loadMask:{msg:agregator.labels.loading},style:"padding: 0px 5px 0px 5px;",border:false,autoWidth:true,width:350,height:278});this.on('render',this.loadEOK,this);this.on('beforedestroy',this.cleanup,this);} Ext.extend(Ext.ux.EOK,Ext.Panel,{loadEOK:function(panel,tracks){this.delayedTask.cancel();this.delayedTask.delay(this.timeInterval);if(this.ownerCt!=null) {this.ownerCt.setTitle(agregator.labels.eokTitle);} var titleIcon=this.ownerCt.header.child("img.x-panel-inline-icon");var favicon="http://www.eok.ro/favicon.ico";if(titleIcon!=null&&favicon!=null&&favicon!="") {titleIcon.removeClass("feed-icon");titleIcon.dom.src=favicon;} this.body.dom.style.overflowY="auto";this.body.dom.innerHTML=agregator.labels.loading;if(tracks!=null) {this.tracks=tracks;Ext.state.stateObserver.doSave();} if(this.tracks!=null) {weok_player='0';weok_color_a='0x0066CC';weok_color_b='0xffffff';weok_color_c='0xEFEFEF';weok_color_d='0x6A6A6A';weok_tracks=this.tracks;weok_theight=250;weok_iframe_height=460;weok_iframe_width=320;this.body.dom.innerHTML='';}},addMyListeners:function() {this.on('afterLayout',Ext.state.stateObserver.doSave,Ext.state.stateObserver);},cleanup:function() {this.delayedTask.cancel();},refresh:function() {this.body.dom.innerHTML=this.body.dom.innerHTML;this.doLayout();},getDefaultTitle:function() {return"EOK.ro";},getCurrentState:function() {return this.tracks;},ToString:function() {return"EOK";}}); Ext.ux.Media=function(data){if(data!=null) {this.section=data.section;} else {this.section="music";} var drawDescription=function(val,cell,record) {var description=record.data.artist;description=(description!=null&&description.trim()!="")?(description+" - "+record.data.title):record.data.title;if(Ext.isGecko) {description=Ext.util.Format.ellipsis(description,70);} return description;};var drawDuration=function(val,cell,record) {var duration=val*1;if(!isNaN(duration)) {var min=Math.floor(duration/60);var sec=(duration%60);return String.leftPad(min,2,"0")+":"+String.leftPad(sec,2,"0");} return"";};this.addEvents({stateevent:true});this.Id=Ext.id();var sm2=new Ext.grid.RowSelectionModel();sm2.on("rowselect",this.playTrack,this);Ext.ux.Media.superclass.constructor.call(this,{id:this.Id+"media-music",autoScroll:true,autoWidth:true,height:300,items:[{xtype:"box",autoEl:{tag:"div","style":"text-align:center",id:this.Id+"music-player",children:[{tag:"img",src:"/public/images/imeem_default.png"}]}},{xtype:"grid",id:this.Id+"music-list",height:190,hidden:true,border:false,enableHdMenu:false,store:new Ext.data.Store({proxy:new Ext.data.HttpProxy({url:'index/imeem'}),id:this.Id+"media-music-store",reader:new Ext.data.JsonReader({root:"items"},[{name:'title',mapping:'title'},{name:'artist',mapping:'artist'},{name:'album',mapping:'album'},{name:'description',mapping:'description'},{name:'content',mapping:'content'},{name:'duration',mapping:'duration'},{name:'musicEmbedUrl',mapping:'musicEmbedUrl'},{name:'id',mapping:'id'}]),listeners:{"loadexception":{fn:this.handleConnectionException,scope:this}}}),cm:new Ext.grid.ColumnModel([{header:agregator.labels.mediaDuration,width:20,sortable:true,renderer:drawDuration,dataIndex:'duration'},{header:agregator.labels.mediaTrackTitle,sortable:true,renderer:drawDescription,dataIndex:'title'}]),loadMask:{msg:agregator.labels.search},sm:sm2,viewConfig:{forceFit:true,emptyText:'Nu exista nici o melodie care sa indeplineasca criteriul de cautare'}}],tbar:[{xtype:"textfield",width:200,value:"cocciante occhi",id:this.Id+"txMusicSearch",listeners:{"specialkey":{fn:function(cmp,ev) {if(ev.getKey()==ev.ENTER) {this.searchMusic(ev,cmp);}},scope:this}}},{xtype:"button",text:agregator.labels.mediaSearch,listeners:{"click":{fn:this.searchMusic,scope:this}}}]});this.on('render',this.loadMedia,this);this.on('beforedestroy',this.cleanup,this);};Ext.extend(Ext.ux.Media,Ext.Panel,{loadMedia:function(){var titleIcon=this.ownerCt.header.child("img.x-panel-inline-icon");if(titleIcon!=null) {titleIcon.removeClass("feed-icon");titleIcon.dom.src="http://www.imeem.com/favicon.ico";}},handleConnectionException:function(proxy,options,response,error) {var panel=Ext.getCmp(id);panel.body.dom.innerHTML="Se pare ca sunt mici probleme.
Va rugam incercati mai tarziu, daca problema persista ne puteti contacta la adresa de e-mail contact@agregator.ro."},searchMusic:function(ev,cmp) {var txMusicSearch=Ext.getCmp(this.Id+"txMusicSearch");var panel=Ext.getCmp(this.Id+"music-list");panel.show();var panel=Ext.getCmp(this.Id+"media-music");panel.items.itemAt(1).store.baseParams={query:txMusicSearch.getValue(),numResults:150,mediaType:'music'};panel.items.itemAt(1).store.load();},playTrack:function(sm,rowIndex,record) {var embedURL=record.data.musicEmbedUrl;var player=Ext.getDom(this.Id+"music-player");if(player.childNodes[0]!=0) {player.removeChild(player.childNodes[0]);} var item=String.format('',embedURL);player.innerHTML=item;},refresh:function() {var player=Ext.getDom(this.Id+"music-player");if(player.childNodes[0]!=0) {player.removeChild(player.childNodes[0]);} player.innerHTML='';var panel=Ext.getCmp(this.Id+"media-music");panel.items.itemAt(1).store.removeAll();var panel=Ext.getCmp(this.Id+"music-list");panel.hide();},addMyListeners:function() {this.on('afterLayout',Ext.state.stateObserver.doSave,Ext.state.stateObserver);},cleanup:function() {},getDefaultTitle:function() {return agregator.labels.mediaTitle;},getCurrentState:function() {return{section:this.section};},ToString:function() {return"Media";}}); if(!Array.prototype.map){Array.prototype.map=function(fun){var len=this.length;if(typeof fun!="function"){throw new TypeError();} var res=new Array(len);var thisp=arguments[1];for(var i=0;i'+'',bbar:this.pb});this.on('render',this.renderHandler,this);this.on('render',this.afterLayoutHandler,this);this.on('beforedestroy',this.cleanup,this);};Ext.extend(Ext.ux.Photo,Ext.Panel,{renderHandler:function(cmp) {var titleIcon=this.ownerCt.header.child("img.x-panel-inline-icon");if(titleIcon!=null) {titleIcon.removeClass("feed-icon");titleIcon.dom.src="/public/images/photo-icon.png";} this.body.on("mousewheel",this.hoverHandler,this);this.loadFeed();},afterLayoutHandler:function(cmp) {this.un('render',this.afterLayoutHandler,this);this.loadMask=new Ext.LoadMask(this.container.dom.parentNode,{msg:agregator.labels.loading,store:this.store});this.loadMask.show();},loadFeed:function(){this.delayedTask.cancel();this.delayedTask.delay(this.timeInterval);this.store.baseParams={feed:this.feedUrl};this.store.load();},refresh:function() {this.delayedTask.cancel();this.delayedTask.delay(this.timeInterval);var content=Ext.getDom(this.Id+'Content');var noReply=Ext.getDom(this.Id+'NoReply');content.style.display='';noReply.style.display='none';this.loadMask.show();this.store.reload();},hoverHandler:function() {this.delayedTask.cancel();this.delayedTask.delay(this.timeInterval);},onLoadStore:function() {var data=new Array();for(var i=0;i0) {this.memoryStore.data.each(this.drawFeedItem,this);this.tries=0;this.doLayout();} else {this.retry();}},drawFeedItem:function(record) {this.populatePrevNext(record);var xf=Ext.util.Format;var descriptionText=xf.ellipsis(xf.stripTags(record.data.description),150);var link=Ext.getDom(this.Id+"link");link.setAttribute("href",record.data.link);var image=Ext.get(this.Id+"MainImage");image.dom.setAttribute("src",record.data.image);image.dom.setAttribute("title",descriptionText.trim());image.on("load",this.onLoadImage,this,{width:record.data.width,height:record.data.height});this.loadMask.show();},onLoadImage:function(e,image,args) {if(this.loaded==null) {var prevCell=Ext.get(this.Id+"PrevCell");prevCell.on("click",this.goPrev,this);var nextCell=Ext.get(this.Id+"NextCell");nextCell.on("click",this.goNext,this);this.loaded=true;} this.loadMask.hide();},goPrev:function(ev,cmp) {if(cmp.noClick!=true) {this.pb.onClick("prev");}},goNext:function(ev,cmp) {if(cmp.noClick!=true) {this.pb.onClick("next");}},populatePrevNext:function(record) {var index=this.store.find("image",record.data.image);var prevRecord=this.store.getAt(index-1);var prevCell=Ext.getDom(this.Id+"PrevCell");if(prevRecord!=null) {prevCell.style.background="url("+prevRecord.data.image+") no-repeat 50% 50%";prevCell.style.cursor="pointer";prevCell.noClick=false;} else {prevCell.style.background="url("+Ext.BLANK_IMAGE_URL+")";prevCell.style.cursor="default";prevCell.noClick=true;} var nextRecord=this.store.getAt(index+1);var nextCell=Ext.getDom(this.Id+"NextCell");if(nextRecord!=null) {nextCell.style.background="url("+nextRecord.data.image+") no-repeat 50% 50%";nextCell.style.cursor="pointer";nextCell.noClick=false;} else {nextCell.style.background="url("+Ext.BLANK_IMAGE_URL+")";nextCell.style.cursor="default";nextCell.noClick=true;}},handleConnectionException:function(proxy,options,response,error) {this.loadMask.show();this.retry(response);},delayRandom:function() {var date=new Date();var delay=(date.getTime()%3)*10;var delayedTask=new Ext.util.DelayedTask(this.loadFeed,this);delayedTask.delay(delay);},retry:function(response) {this.tries=(this.tries!=null)?(this.tries+1):0;if(this.tries<3) {this.refresh();} else {var content=Ext.getDom(this.Id+'Content');var noReply=Ext.getDom(this.Id+'NoReply');content.style.display='none';noReply.style.display='block';}},togglePreview:function(show){this.view.showPreview=show;this.view.refresh();},cleanup:function() {this.delayedTask.cancel();},getDefaultTitle:function() {return agregator.labels.photoTitle;},getCurrentState:function() {return;},ToString:function() {return"Photo";}});