Bump tp version 0.1.0 and cleanup
Signed-off-by: Justin Georgi <justin.georgi@gmail.com>
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
"author": "Justin Georgi",
|
"author": "Justin Georgi",
|
||||||
"url": "https://gitea.azgeorgis.net/jgeorgi/mwModelViewer",
|
"url": "https://gitea.azgeorgis.net/jgeorgi/mwModelViewer",
|
||||||
"description": "This extension allows .glb and .gltf files to be added, displayed, and annotated in MediaWiki",
|
"description": "This extension allows .glb and .gltf files to be added, displayed, and annotated in MediaWiki",
|
||||||
"version": "0.0.7",
|
"version": "0.1.0",
|
||||||
"license-name": "MIT",
|
"license-name": "MIT",
|
||||||
"type": "media",
|
"type": "media",
|
||||||
"manifest_version": 2,
|
"manifest_version": 2,
|
||||||
|
|||||||
@@ -134,26 +134,6 @@ class GlModelHandler extends ImageHandler {
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This is used to generate an array element for each metadata value. That array is then used to generate the table of metadata values on the image page.
|
|
||||||
*
|
|
||||||
* @param array &$array An array containing elements for each type of visibility and each of those elements being an array of metadata items. This function adds a value to that array.
|
|
||||||
* @param string $visibility ('visible' or 'collapsed') if this value is hidden by default.
|
|
||||||
* @param string $type Type of metadata tag (currently always 'exif')
|
|
||||||
* @param string $id The name of the metadata tag (like 'artist' for example). its name in the table displayed is the message "$type-$id" (Ex exif-artist ).
|
|
||||||
* @param string $value Thingy goes into a wikitext table; it used to be escaped but that was incompatible with previous practise of customized display with wikitext formatting via messages such as 'exif-model-value'. So the escaping is taken back out, but generally this seems a confusing interface.
|
|
||||||
* @param bool | string $param Value to pass to the message for the name of the field as $1. Currently this parameter doesn't seem to ever be used.
|
|
||||||
*/
|
|
||||||
//public static function addMeta (&$array, $visibility, $type, $id, $value, $param = false ) {
|
|
||||||
// $array[$visibility][] = [
|
|
||||||
// 'id' => "$type-$id",
|
|
||||||
// 'name' => $name,
|
|
||||||
// 'value' => $value
|
|
||||||
// ];
|
|
||||||
//}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get image size information and metadata array.
|
* Get image size information and metadata array.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -42,13 +42,6 @@ class GlModelHooks {
|
|||||||
* @param OutputPage $out compiled page html and manipulation methods
|
* @param OutputPage $out compiled page html and manipulation methods
|
||||||
*/
|
*/
|
||||||
public static function onBeforePageDisplay($out) {
|
public static function onBeforePageDisplay($out) {
|
||||||
$file = MediaWikiServices::getInstance()->getRepoGroup()->findFile($out->getTitle());
|
|
||||||
if ($file) {
|
|
||||||
echo '<script>';
|
|
||||||
self::console_log('Metadata:');
|
|
||||||
self::console_log($file->getMetadata());
|
|
||||||
echo '</script>';
|
|
||||||
}
|
|
||||||
preg_match('/(<model-viewer src="\S*?\.(glb|gltf"))/',$out->getHTML(),$findGltf);
|
preg_match('/(<model-viewer src="\S*?\.(glb|gltf"))/',$out->getHTML(),$findGltf);
|
||||||
if ($findGltf[0]) {
|
if ($findGltf[0]) {
|
||||||
|
|
||||||
|
|||||||
@@ -10,10 +10,6 @@ checkForGltf = function (e) {
|
|||||||
const mvPreview = document.createElement('model-viewer')
|
const mvPreview = document.createElement('model-viewer')
|
||||||
mvPreview.style['width'] = '180px'
|
mvPreview.style['width'] = '180px'
|
||||||
mvPreview.style['height'] = '180px'
|
mvPreview.style['height'] = '180px'
|
||||||
mvPreview.addEventListener('load',(e) => {
|
|
||||||
mw.storage.session.set( 'mw_glbMeta', JSON.stringify($(e.target.originalGltfJson.asset)))
|
|
||||||
},
|
|
||||||
{once: true})
|
|
||||||
|
|
||||||
const dThumbCap = document.createElement('div')
|
const dThumbCap = document.createElement('div')
|
||||||
dThumbCap.classList.add('thumbcaption')
|
dThumbCap.classList.add('thumbcaption')
|
||||||
|
|||||||
Reference in New Issue
Block a user