0
parseNewsRSS: function(feed) {
    var elm = '';
    var ts = '';
    var it = '';
    var className = 'hide';
    ts += '<table class="no-spacing list-items" cellspacing="0" cellpadding="0">';
    var feed_it = {};
    for (i = 0; i < feed.items.length; i++) {
        feed_it = News.parseGoogleNewsRSS(feed.items[i]);
        if (feed_it.image == null) {
            feed_it.image = 'src="s40-theme/images/blank.png"';
        }
        else {
            feed_it.image = feed_it.image[0].replace('src="', 'src="http:');
        }
        if (i == 0) {
            className = 'show';
        }
        else {
            className = 'hide';
        }
        item_date = new Date(feed.items[i].updated);

        // Main screen items
        elm += '<div id="newsFeedMainItem' + (i+1) + '" class="' + className + '">';
        elm += '<table id="newsFeedMain" class="main-screen-items" cellspacing="0" cellpadding="0"><tr>';
        elm += '<td onclick="mwl.setGroupNext(\'#newsFeedMainItems\', \'show\', \'hide\', \'prev\');" class="td-arrow"><</td>';
        elm += '<td onclick="mwl.hide(\'#city_date\');mwl.setGroupTarget(\'#screens\', \'#newsfeed_items\', \'ui-show\', \'ui-hide\');mwl.setGroupTarget(\'#newsfeed_items\', \'#newsFeedItem' + (i+1) + '\', \'ui-show\', \'ui-hide\');mwl.switchClass(\'#backToMainIcon\', \'hide\', \'inline\');"><img alt="News Image" ' + feed_it.image + ' /></td>';
        elm += '<td onclick="mwl.hide(\'#city_date\');mwl.setGroupTarget(\'#screens\', \'#newsfeed_items\', \'ui-show\', \'ui-hide\');mwl.setGroupTarget(\'#newsfeed_items\', \'#newsFeedItem' + (i+1) + '\', \'ui-show\', \'ui-hide\');mwl.switchClass(\'#backToMainIcon\', \'hide\', \'inline\');" class="main-short-text"><b>' + feed_it.title.trunc(News.getTitleSize('short'),true) + '</b><br />' + item_date.getMonthName()+' '+ item_date.getDate() +',' + item_date.getFullYear() + '</td>';
        elm += '<td onclick="mwl.setGroupNext(\'#newsFeedMainItems\', \'show\', \'hide\', \'next\');" class="td-arrow">></td>';
        elm += '</tr></table></div>';

        // Newsfeed screen
        ts += '<tr><td onclick="mwl.hide(\'#city_date\');mwl.setGroupTarget(\'#screens\', \'#newsfeed_items\', \'ui-show\', \'ui-hide\');mwl.setGroupTarget(\'#newsfeed_items\', \'#newsFeedItem' + (i+1) + '\', \'ui-show\', \'ui-hide\');mwl.switchClass(\'#backToMainIcon\', \'inline\', \'hide\');mwl.switchClass(\'#backToNewsIcon\', \'hide\', \'inline\');"><img alt="News Image" ' + feed_it.image + ' /></td>';
        ts += '<td onclick="mwl.hide(\'#city_date\');mwl.setGroupTarget(\'#screens\', \'#newsfeed_items\', \'ui-show\', \'ui-hide\');mwl.setGroupTarget(\'#newsfeed_items\', \'#newsFeedItem' + (i+1) + '\', \'ui-show\', \'ui-hide\');mwl.switchClass(\'#backToMainIcon\', \'inline\', \'hide\');mwl.switchClass(\'#backToNewsIcon\', \'hide\', \'inline\');" class="news-short-text"><b>' + feed_it.title.trunc(News.getTitleSize('long'),true) + '</b><br />' + item_date.getMonthName()+' '+ item_date.getDate() +',' + item_date.getFullYear() + '</td></tr>';

        // Newsfeed items
        it += '<div id="newsFeedItem' + (i+1) + '" class="ui-hide">';
        it += '<div class="navigation" onclick="mwl.setGroupTarget(\'#screens\', \'#newsfeed_items\', \'ui-show\', \'ui-hide\');mwl.setGroupNext(\'#newsfeed_items\', \'ui-show\', \'ui-hide\', \'prev\');">&lt;</div>';
        it += '<div class="navigation" onclick="mwl.setGroupTarget(\'#screens\', \'#newsfeed_items\', \'ui-show\', \'ui-hide\');mwl.setGroupNext(\'#newsfeed_items\', \'ui-show\', \'ui-hide\', \'next\');">&gt;</div>';
        it += '<div class="item_container">';
        it += '<table><tr><td class="img_title"><img ' + feed_it.image + ' /></td>';
        it += '<td class="text_title">' + feed_it.title + '</td></tr></table>';
        it += feed_it.story;
        it += '<div class="more"><a href="' + feed_it.link + '">More</a></div>';
        it += '</div>';
        it += '</div>';

    }
    ts += '</table>';

    jQuery('#newsFeedMainItems').html(elm);
    jQuery('#newsfeed_screen').append(ts);
    jQuery('#newsfeed_items').append(it);
},

在新闻提要项目屏幕中,首先显示故事标题,然后显示如下描述:“又一个激动人心的意甲赛季拉开了帷幕,当然,这为几个月的转会谈话让路。确实,转会谣言是可以同等程度地激发和关闭人们的东西。谣言中的一些谣言......”但我想在描述的末尾显示整个或完整的故事文本,不带“......”。需要帮助请

4

0 回答 0