home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 December / PCWorld_2007-12_cd.bin / komunikace / maxthon / mx_2.0.5.7845.exe / template / FeedView / feed.js < prev    next >
Text File  |  2007-09-20  |  921b  |  45 lines

  1. var maxFeedView={};
  2. $langDefaultSection="FeedView";
  3. maxFeedView.rebuildContent=function(_1){
  4. _1++;
  5. for(var i=1;i<_1;i++){
  6. maxFeedView.rewriteTitle(i);
  7. maxFeedView.rewriteContent(i);
  8. }
  9. };
  10. maxFeedView.rewriteTitle=function(_3){
  11. var _4=$id("nav_"+_3);
  12. if(!_4){
  13. return;
  14. }
  15. var _5=$decodeHTMLEntities(_4.innerText);
  16. _4.innerText=_5.$cut(35);
  17. var _4=$id("title_"+_3);
  18. if(_4){
  19. _4.innerText=_5;
  20. }
  21. };
  22. maxFeedView.rewriteContent=function(_6){
  23. var _7=$id("content_data_"+_6);
  24. if(!_7){
  25. return;
  26. }
  27. var _8=_7.innerText.$trim();
  28. _7.innerHTML="";
  29. if(_8==""){
  30. return;
  31. }
  32. if(_8.search(/(\<br|\<\/div>|\<\/span>|\<\/p>|\<\/a>|\<\/font>|\<\/b>|\<\/strong>)/ig)==-1){
  33. _8=_8.replace(/\n/g,"<br/>");
  34. _8=$decodeHTMLEntities(_8);
  35. }
  36. $write(_8,"content_"+_6);
  37. };
  38. maxFeedView.addFeed=function(){
  39. external.max_addRSS(document.location.href);
  40. };
  41. maxFeedView.writeLang=function(_9){
  42. $write($lang(_9).replace(/\\n/g,"<br/>").replace(/\"/g,"""));
  43. };
  44.  
  45.