Add basic thumbnail handling with static image
Signed-off-by: Justin Georgi <justin.georgi@gmail.com>
This commit is contained in:
@@ -52,22 +52,6 @@ class GlModelHooks {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* MWHook: Display model on file page
|
||||
*
|
||||
* @see https://www.mediawiki.org/wiki/Manual:Hooks/ImageOpenShowImageInlineBefore
|
||||
*
|
||||
* @param ImagePage $imagepage information regarding the page for the image file
|
||||
* @param OutputPage $out compiled page html and manipulation methods
|
||||
*/
|
||||
public static function onImageOpenShowImageInlineBefore( $imagepage, $out ){
|
||||
$file = $imagepage->getFile();
|
||||
if ($file->getMimeType() == 'model/gltf-binary') {
|
||||
$out->clearHTML();
|
||||
$out->addWikiTextAsContent('[[' . $file->getTitle()->getFullText() . '|800x600px]]');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* MWHook: Display model when model file page edits are previewed
|
||||
*
|
||||
@@ -88,7 +72,7 @@ class GlModelHooks {
|
||||
$out = $editor->getContext()->getOutput();
|
||||
$out->addModules('ext.glmv');
|
||||
|
||||
$mvTransform = $file->transform([ 'width' => '800', 'hight' => '600']);
|
||||
$mvTransform = $file->transform([ 'width' => '800', 'hight' => '600', 'view' => 'test']);
|
||||
$previewViewer = $mvTransform->toHtml([ 'preview' => true]);
|
||||
|
||||
$addButtonAttr = array(
|
||||
|
||||
Reference in New Issue
Block a user