From 1ae309326d15cd14af0b52d5e388b6dc12509082 Mon Sep 17 00:00:00 2001 From: kovacsv Date: Sun, 18 Nov 2018 07:52:45 +0100 Subject: [PATCH] Remove wiki extension --- README.md | 5 --- tools/build.py | 12 +------- wikiextension/Viewer3D.hooks.php | 53 -------------------------------- wikiextension/Viewer3D.js | 3 -- wikiextension/Viewer3D.php | 25 --------------- 5 files changed, 1 insertion(+), 97 deletions(-) delete mode 100644 wikiextension/Viewer3D.hooks.php delete mode 100644 wikiextension/Viewer3D.js delete mode 100644 wikiextension/Viewer3D.php diff --git a/README.md b/README.md index ad2eb6f9..a7585205 100644 --- a/README.md +++ b/README.md @@ -26,8 +26,3 @@ Embeddable This is the embeddable version of the viewer: - In this case you should host the 3D models. - See examples for more information. - -Wiki Extension --------------- - -This is a WikiMedia extension for viewing 3D models. It is in experimental phase currently. diff --git a/tools/build.py b/tools/build.py index a994b9ea..b002c390 100644 --- a/tools/build.py +++ b/tools/build.py @@ -36,14 +36,6 @@ def BuildEmbeddable (rootFolder, resultFolder): ReplaceInFile (indexFilePath, '../jsmodeler/', 'jsmodeler/') indexFilePath = os.path.join (targetFolder, 'fullscreen.html') ReplaceInFile (indexFilePath, '../jsmodeler/', 'jsmodeler/') - -def BuildWikiExtension (rootFolder, resultFolder): - targetFolder = os.path.join (resultFolder, 'wikiextension') - shutil.copytree (os.path.join (rootFolder, 'wikiextension'), targetFolder) - shutil.copy (os.path.join (rootFolder, 'jsmodeler', 'three.min.js'), os.path.join (targetFolder, 'three.min.js')) - shutil.copy (os.path.join (rootFolder, 'jsmodeler', 'jsmodeler.js'), os.path.join (targetFolder, 'jsmodeler.js')) - shutil.copy (os.path.join (rootFolder, 'jsmodeler', 'jsmodeler.ext.three.js'), os.path.join (targetFolder, 'jsmodeler.ext.three.js')) - shutil.copy (os.path.join (rootFolder, 'embeddable', 'include', 'online3dembedder.js'), os.path.join (targetFolder, 'online3dembedder.js')) def Main (): rootFolder = os.path.abspath ('..') @@ -57,9 +49,7 @@ def Main (): PrintInfo ('Building embeddable example to folder <' + resultFolder + '>.') BuildEmbeddable (rootFolder, resultFolder) - - PrintInfo ('Building wiki extension to folder <' + resultFolder + '>.') - BuildWikiExtension (rootFolder, resultFolder) + return 0 sys.exit (Main ()) diff --git a/wikiextension/Viewer3D.hooks.php b/wikiextension/Viewer3D.hooks.php deleted file mode 100644 index 25b24090..00000000 --- a/wikiextension/Viewer3D.hooks.php +++ /dev/null @@ -1,53 +0,0 @@ -setHook ('viewer3d', 'Viewer3DHooks::OnSampleTag'); - return true; - } - - public static function OnSampleTag ($data, $attribs, $parser, $frame) - { - $parser->getOutput ()->addModules ('ext.Viewer3D'); - - global $viewerCounter; - $viewerCounter++; - - $width = 300; - if (in_array ('width', array_keys ($attribs))) { - $width = $attribs['width']; - } - - $height = 200; - if (in_array ('height', array_keys ($attribs))) { - $height = $attribs['height']; - } - - $originalFiles = ''; - if (in_array ('sourcefiles', array_keys ($attribs))) { - $originalFiles = $attribs['sourcefiles']; - } - - $sourceFiles = ''; - $splitted = explode ('|', $originalFiles); - for ($i = 0; $i < count ($splitted); $i++) { - $fileObject = wfFindFile ($splitted[$i]); - if ($fileObject) { - $filePath = $fileObject->getFullUrl (); - $sourceFiles .= $filePath; - if ($i < count ($splitted) - 1) { - $sourceFiles .= '|'; - } - } - } - - $html = ''; - $html .= ''; - return $html; - } -} - -?> diff --git a/wikiextension/Viewer3D.js b/wikiextension/Viewer3D.js deleted file mode 100644 index 47255c7a..00000000 --- a/wikiextension/Viewer3D.js +++ /dev/null @@ -1,3 +0,0 @@ -mw.loader.using ('ext.Viewer3D', function () { - LoadOnline3DModels (); -}); diff --git a/wikiextension/Viewer3D.php b/wikiextension/Viewer3D.php deleted file mode 100644 index e3810147..00000000 --- a/wikiextension/Viewer3D.php +++ /dev/null @@ -1,25 +0,0 @@ - __FILE__, - 'name' => 'Viewer3D', - 'author' => 'Viktor Kovacs', - 'url' => 'https://www.mediawiki.org/wiki/Extension:Viewer3D', - 'description' => 'With this extension you can view 3D models with WebGL.', - 'version' => 0.1, - 'license-name' => "MIT" -); - -$wgAutoloadClasses['Viewer3DHooks'] = $dir.'/Viewer3D.hooks.php'; -$wgHooks['ParserFirstCallInit'][] = 'Viewer3DHooks::OnParserFirstCallInit'; - -$wgResourceModules['ext.Viewer3D'] = array( - 'scripts' => array ('three.min.js', 'jsmodeler.js', 'online3dembedder.js', 'Viewer3D.js'), - 'localBasePath' => $dir, - 'remoteExtPath' => 'Viewer3D' -); - -?>