/** * Custom Tag: Cards * Generate author profile cards. */
{ name }
var self = this; jQuery(function($) { $.ajax({ url: resource_url + '/wp-json/wp/v2/users', type:'GET', dataType: 'json', data : { page: opts.count, per_page: opts.per_page, filter : { } }, timeout:10000, }).done(function( users ){ self.users = users self.update() if ( opts.infinite ) { $(window).on("scroll", function() { var scrollHeight = $('#authors-by-latest-post').height() + $('#authors-by-latest-post').offset().top; var scrollPosition = $(window).height() + $(window).scrollTop(); if ( scrollHeight - scrollPosition <= 0 && $('#authors-by-latest-post').children().last().children().length == opts.per_page && $('#authors-by-latest-post').children().last().attr('count') == opts.count ) { opts.count++; $('#authors-by-latest-post').append( $('
') .attr( 'id', "author-list-"+opts.count ) .attr( 'count', opts.count ) .attr( 'per_page', opts.per_page ) .attr( 'infinite', opts.infinite ) .attr( 'max_column', opts.max_column ) ); riot.mount( 'div#author-list-' + opts.count, 'cards' ); } }); } // endif opts.infinite }); });
/** * Custom Tag: Raw * Render unescaped HTML * http://riotjs.com/ja/guide/#html */ this.root.innerHTML = opts.content /** * Custom Tag: Format Date */ /** * Custom Tag: Posts * list specific author's latest posts. */