LinkPreview: restructure a bit so we can pass config over

This commit is contained in:
Brion Vibber
2010-11-16 14:27:01 -08:00
parent eeb7f02b98
commit b5fc71253c
2 changed files with 43 additions and 28 deletions

View File

@@ -52,6 +52,12 @@ class LinkPreviewPlugin extends Plugin
$user = common_current_user();
if ($user) {
$action->script('plugins/LinkPreview/linkpreview.js');
$data = json_encode(array(
'api' => common_config('oohembed', 'endpoint'),
'width' => common_config('attachments', 'thumbwidth'),
'height' => common_config('attachments', 'thumbheight'),
));
$action->inlineScript('$(function() {SN.Init.LinkPreview && SN.Init.LinkPreview('.$data.');})');
}
return true;
}