Adding lazy-load version of feed component to load data using AJAX after page content has been rendered.
This commit is contained in:
39
www/plugins/jasonwilliams/feed/Plugin.php
Normal file
39
www/plugins/jasonwilliams/feed/Plugin.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php namespace jasonwilliams\feed;
|
||||
|
||||
use System\Classes\PluginBase;
|
||||
use JasonWilliams\Feed\Classes\SocialApis;
|
||||
|
||||
class Plugin extends PluginBase
|
||||
{
|
||||
public function registerSettings()
|
||||
{
|
||||
return [
|
||||
'settings' => [
|
||||
'label' => 'Feed',
|
||||
'description' => 'Manage API keys and settings related to the feed plugin',
|
||||
'icon' => 'icon-newspaper-o',
|
||||
'class' => 'JasonWilliams\Feed\Models\Settings',
|
||||
'order' => 500,
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
public function registerComponents()
|
||||
{
|
||||
return [
|
||||
'\JasonWilliams\Feed\Components\ShortFeed' => 'ShortFeed',
|
||||
'\JasonWilliams\Feed\Components\LazyLoadShortFeed' => 'LazyLoadShortFeed',
|
||||
'\JasonWilliams\Feed\Components\ChannelList' => 'ChannelList',
|
||||
'\JasonWilliams\Feed\Components\TagList' => 'TagList'
|
||||
];
|
||||
}
|
||||
|
||||
public function registerSchedule($schedule)
|
||||
{
|
||||
$schedule->call(function() {
|
||||
SocialApis::updateTwitter();
|
||||
SocialApis::updateInstagram();
|
||||
SocialApis::updateFoursquare();
|
||||
})->everyThirtyMinutes();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user