Extension:ProcessingJs
From MediaWiki.org
![]() |
WARNING: The code or configuration described here poses a major security risk.
Site administrators: You are advised against using it until this security issue is resolved. Problem: Vulnerable to Cross-site scripting attacks, because it passes user input directly to the browser. This may lead to user accounts being hijacked, among other things. Solution: strictly validate user input and/or apply escaping to all characters that have a special meaning in HTML |
processingjs Release status: experimental |
|
---|---|
Implementation | Tag |
Description | integrate [processingjs] scripts in mediawiki |
Author(s) | Cédric Doutriaux |
Latest version | 0.1 |
License | No license specified |
Download | No link |
Example | http://fablabo.net/mediawiki/index.php?title=Extension:processingjs |
Translate the ProcessingJs extension if it is available at translatewiki.net |
|
Check usage and version matrix; code metrics |
![]() |
This extension stores its source code on a wiki page. Please be aware that this code may be unreviewed or maliciously altered. They may contain security holes, outdated interfaces that are no longer compatible etc. Note: No localisation updates are provided for this extension by translatewiki.net. |
Contents
What can this extension do?[edit | edit source]
This extension give the possibility to integrate processingjs scripts in a mediawiki
Usage[edit | edit source]
<processingjs>
void setup(){ size( 200, 200 ); strokeWeight( 10 ); } void draw(){ background(0); ellipse( mouseX, mouseY, 100, 100 ); }
</processingjs>
Code[edit | edit source]
<?php /** * last change: 2012-03-29 * EXTENSION PROCESSINGJS * Cédric Doutriaux [email protected] * * *******************************************************************************************/ $wgExtensionFunctions[] = 'processingjs'; $wgExtensionCredits['parserhook'][] = array( 'path' => __FILE__, 'name' => 'processingjs', 'description' => 'intégration de scripts processingjs', 'author' => 'Cédric Doutriaux', 'url' => 'http://fablabo.net/mediawiki/index.php?title=Extension:processingjs' ); function processingjs() { global $wgParser; $wgParser->setHook('processingjs', 'renderPJS'); } function renderPJS($input){ $output .="<script src=\"extensions/processingjs/processing-1.3.6.min.js\"></script> <script type=\"text/processing\" target=\"processing-canvas-$id\">".$input."</script> <canvas id=\"processing-canvas-$id\"> </canvas>"; return array( $output, "markerType" => 'nowiki' ); }
Download instructions[edit | edit source]
Please copy and paste the code found below and place it in $IP/extensions/processingjs/processingjs.php
. Download https://github.com/downloads/processing-js/processing-js/processing-1.3.6.min.js and place this file in the folder $IP/extensions/processingjs/
$IP stands for the root directory of your MediaWiki installation, the same directory that holds LocalSettings.php.
Installation[edit | edit source]
To install this extension, add the following to LocalSettings.php:
#add configuration parameters here #setup user rights here require_once("$IP/extensions/processingjs/processingjs.php");