Skip to content

Latest commit

 

History

History
140 lines (116 loc) · 5.97 KB

index.md

File metadata and controls

140 lines (116 loc) · 5.97 KB
author layout
Sidney Lima Filho
default
            <small class="excerpt" data-bind="text: item.excerpt.split(/(\.)/)[0]"></small>                
        </resume>
    </a>
    <a target="_blank" class="socialButton feed" data-bind="attr:{href: $root.user[type].getUrl(), title: $root.user[type].title}"></a>
</div>
Últimas do Twitter
    <a target="_blank" class="socialButton twitter" data-bind="attr:{href: $root.user.twitter.getUrl(), title: $root.user.twitter.title}"></a>
</div>
<script type="text/javascript"> function ViewModel(user) { /* Constructor */ var $this = this; this.user = user; user.items = this.items = ko.observableArray(); /* Methods */ this.getTemplate = function(item) { return item.template; } this.initialize = function(node) { var it = this; google.load("feeds", "1"); google.setOnLoadCallback(function () { it.user.feed.loadItems(it.loaded); it.user.youtube.loadItems(it.loaded); //it.user.twitter.loadItems(it.loaded); it.user.slideshare.loadItems(it.loaded); }); ko.applyBindings(it, node); }; this.sourcesCount = 0; this.loaded = function(){ if (++$this.sourcesCount < 3) return; $this.items.sort(function(a,b){ // 1 = swap b <- a, -1 = keep same return a.date < b.date ? 1 : -1; // DESC }); } } (vm = new ViewModel(User)).initialize($(".post-wall").get(0)); </script>