Difference between revisions of "Adaptivethumb"

From ThorstensHome
Jump to: navigation, search
(Usage)
 
(44 intermediate revisions by one user not shown)
Line 1: Line 1:
 
AdaptiveThumb is a MediaWiki extension that allows you to create a thumbnail for an image that scales with the browser size.
 
AdaptiveThumb is a MediaWiki extension that allows you to create a thumbnail for an image that scales with the browser size.
  
Download, Code, Bugreporting here: https://github.com/tstaerk/adaptivethumb
+
= What can this extension do? =
 +
This extension allows you to show images that scale with the browser window. Find an example below:
  
adaptivethumb@mediawiki: https://www.mediawiki.org/wiki/Extension:AdaptiveThumb
+
<pic src="http://www.linuxintro.org/images/Bash-scripting-mindmap.jpg" width=40% align=auto caption="resize your browser window and I will change my size ;)" link="http://www.linuxintro.org/wiki/BaBE_-_Bash_By_Examples" title="Yes you can define titles." border=1  />
  
==What can this extension do?==
+
You can also define pictures without a caption:
This extension allows you to show thumbnails of images that scale with the browser window.
+
  
==Download instructions==
+
<pic src="http://www.linuxintro.org/images/Bash-scripting-mindmap.jpg" width=40% align=auto link="http://www.linuxintro.org/wiki/BaBE_-_Bash_By_Examples" title="Yes you can define titles." border=2 align=auto />
Download the package here: https://github.com/tstaerk/adaptivethumb/archive/master.zip.
+
  
==Installation==
+
= Download and Installation =
To install this extension, in this example for Linux, unpack it to the $IP/extensions folder:
+
I tested the installation with mediawiki version 1.21 and 1.34. For 1.34, I had to use the newer method wfLoadExtension which was not the case with 1.21.
 +
 
 +
== mediawiki version 1.34 and newer ==
 +
Follow https://www.mediawiki.org/wiki/Extension:AdaptiveThumb
 +
 
 +
== mediawiki version 1.21 and older ==
 +
* Download the package here: https://github.com/tstaerk/adaptivethumb/archive/master.zip.
 +
* To install this extension, in this example for Linux, unpack it to the $IP/extensions folder:
 
  extensions# unzip master.zip
 
  extensions# unzip master.zip
A new folder $IP/extensions/adaptivethumb will be added. Make sure its owner:group is www-data:www-data or whatever you apache is running as:
+
* A new folder $IP/extensions/adaptivethumb will be added. Make sure its owner:group is www-data:www-data or whatever you apache is running as:
 
  extensions# chown -R www-data:www-data adaptivethumb
 
  extensions# chown -R www-data:www-data adaptivethumb
Add the following to [[Manual:LocalSettings.php|LocalSettings.php]]:
+
* Add the following to LocalSettings.php:
<source lang="php">
+
<pre>
 
require_once("$IP/extensions/adaptivethumb/adaptivethumb.php");
 
require_once("$IP/extensions/adaptivethumb/adaptivethumb.php");
</source>
+
$wgAllowExternalImages=true;
 +
</pre>
  
==Usage==
+
= Usage =
 
To use this extension, simply put a &lt;pic&gt; tag into your mediawiki markup like this:
 
To use this extension, simply put a &lt;pic&gt; tag into your mediawiki markup like this:
  <pic src="/mindmap.jpg" size=30% align=right caption="this is a mindmap" />
+
  &lt;pic src="/mindmap.jpg" width=30% align=text caption="this is a mindmap" /&gt;
 +
 
 +
= Pages =
 +
 
 +
Download, Code, Bugreporting here: https://github.com/tstaerk/adaptivethumb
 +
 
 +
adaptivethumb@mediawiki: https://www.mediawiki.org/wiki/Extension:AdaptiveThumb
  
[[Category:Image extensions]]
+
= See also =
 +
* http://stackoverflow.com/questions/27973362/how-do-i-scale-an-images-width-to-a-percentage-of-the-window-with-mediawiki
 +
* http://stackoverflow.com/questions/9078157/is-there-a-way-automatically-to-resize-mediawiki-images-depending-on-screen-size
 +
* http://www.staerk.de/thorsten/Writing_mediawiki_extensions

Latest revision as of 14:48, 1 January 2021

AdaptiveThumb is a MediaWiki extension that allows you to create a thumbnail for an image that scales with the browser size.

Contents

What can this extension do?

This extension allows you to show images that scale with the browser window. Find an example below:

resize your browser window and I will change my size ;)

You can also define pictures without a caption:

Download and Installation

I tested the installation with mediawiki version 1.21 and 1.34. For 1.34, I had to use the newer method wfLoadExtension which was not the case with 1.21.

mediawiki version 1.34 and newer

Follow https://www.mediawiki.org/wiki/Extension:AdaptiveThumb

mediawiki version 1.21 and older

extensions# unzip master.zip
  • A new folder $IP/extensions/adaptivethumb will be added. Make sure its owner:group is www-data:www-data or whatever you apache is running as:
extensions# chown -R www-data:www-data adaptivethumb
  • Add the following to LocalSettings.php:
require_once("$IP/extensions/adaptivethumb/adaptivethumb.php");
$wgAllowExternalImages=true;

Usage

To use this extension, simply put a <pic> tag into your mediawiki markup like this:

<pic src="/mindmap.jpg" width=30% align=text caption="this is a mindmap" />

Pages

Download, Code, Bugreporting here: https://github.com/tstaerk/adaptivethumb

adaptivethumb@mediawiki: https://www.mediawiki.org/wiki/Extension:AdaptiveThumb

See also