Index: trunk/extensions/Plotters/PlottersParser.php |
— | — | @@ -36,7 +36,7 @@ |
37 | 37 | // Parse arguments, set defaults, and do sanity checks |
38 | 38 | $this->argumentArray = array ( "renderer" => "plotkit", "preprocessors" => array(), "preprocessorarguments" => array(), |
39 | 39 | "script" => "", "scriptarguments" => array(), "datasep" => ",", "width" => "300", "height" => "300", "labels" => array(), |
40 | | - "helpers" => array(), "name" => "plot", "tableclass" => "wikitable" ); |
| 40 | + "name" => "plot", "tableclass" => "wikitable" ); |
41 | 41 | if ( isset( $argv["renderer"] ) ) { |
42 | 42 | //TODO: limit this to supported renderers |
43 | 43 | $this->argumentArray["renderer"] = preg_replace( '/[^A-Z0-9]/i', '', $argv["renderer"] ); |
— | — | @@ -107,13 +107,6 @@ |
108 | 108 | $this->argumentArray["labels"][] = $label; |
109 | 109 | } |
110 | 110 | } |
111 | | - if ( isset( $argv["helpers"] ) ) { |
112 | | - // Sanitize scripts - alphanumerics only |
113 | | - $this->argumentArray["helpers"] = explode( ',', $argv["helpers"] ); |
114 | | - foreach ( $this->argumentArray["helpers"] as &$helper ) { |
115 | | - $helper = preg_replace( '/[^A-Z0-9]/i', '', $helper ); |
116 | | - } |
117 | | - } |
118 | 111 | if ( isset( $argv["name"] ) ) { |
119 | 112 | // Sanitize names - alphanumerics only |
120 | 113 | $this->argumentArray["name"] = preg_replace( '/[^A-Z0-9]/i', '', $argv["name"] ); |
Index: trunk/extensions/Plotters/Plotters.i18n.php |
— | — | @@ -27,7 +27,6 @@ |
28 | 28 | 'plotters-missing-arguments' => 'No arguments specified.', |
29 | 29 | 'plotters-excessively-long-scriptname' => 'The script name is too long. Please define a script that is less than 255 characters.', |
30 | 30 | 'plotters-excessively-long-preprocessorname' => 'The preprocessor name is too long. Please define a preprocessor that is less than 255 characters.', |
31 | | - 'plotters-excessively-long-helpername' => 'The helper name is too long. Please define a helper that is less than 255 characters.', |
32 | 31 | 'plotters-excessively-long-name' => 'The plot name is too long. Please define a plot name that is less than 255 characters.', |
33 | 32 | 'plotters-excessively-long-tableclass' => 'The tableclass is too long. Please define a tableclass that is less than 255 characters.', |
34 | 33 | 'plotters-no-data' => 'No data was provided.', |
— | — | @@ -87,7 +86,6 @@ |
88 | 87 | 'plotters-missing-arguments' => 'Žedne argumenty pódane.', |
89 | 88 | 'plotters-excessively-long-scriptname' => 'Mě skripta jo pśedłujke. Pšosym definěruj skript, kótaryž ma mjenjej ako 255 znamuškow.', |
90 | 89 | 'plotters-excessively-long-preprocessorname' => 'Mě preprocesora jo pśedłujke. Pšosym definěruj preprocesor, kótaryž ma mjenjej ako 255 znamuškow.', |
91 | | - 'plotters-excessively-long-helpername' => 'Mě pomocnika jo pśedłujke. Pšosym definěruj pomocnik, kótaryž ma mjenjej ako 255 znamuškow.', |
92 | 90 | 'plotters-no-data' => 'Žedne daty njejsu se pódali.', |
93 | 91 | 'plotters-invalid-renderer' => 'Njepłaśiwy kreslak jo se wubrał.', |
94 | 92 | 'plotters-errors' => '<b>Ploterowe zmólki:</b>', |
— | — | @@ -108,7 +106,6 @@ |
109 | 107 | 'plotters-missing-arguments' => "Aucun argument n'a été spécifié.", |
110 | 108 | 'plotters-excessively-long-scriptname' => 'Le nom du script est trop long. Veuillez définir un script qui a de moins de 255 caractères.', |
111 | 109 | 'plotters-excessively-long-preprocessorname' => 'Le nom du préprocesseur est trop long. Définissez un préprocesseur qui fait moins de 255 caractères.', |
112 | | - 'plotters-excessively-long-helpername' => "Le nom de l'auxiliaire est trop long. Définissez un auxiliaire qui fait moins de 255 caractères.", |
113 | 110 | 'plotters-no-data' => 'Aucune donnée n’a été fournie.', |
114 | 111 | 'plotters-invalid-renderer' => 'Un moteur de rendu invalide a été sélectionné.', |
115 | 112 | 'plotters-errors' => '<b>Erreur(s) de traceurs:</b>', |
— | — | @@ -128,7 +125,6 @@ |
129 | 126 | 'plotters-missing-arguments' => 'Non foi especificado ningún argumento.', |
130 | 127 | 'plotters-excessively-long-scriptname' => 'O nome da escritura é moi longo. Por favor, defina unha escritura que sexa inferior a 255 caracteres.', |
131 | 128 | 'plotters-excessively-long-preprocessorname' => 'O nome do preprocesador é moi longo. Por favor, defina un preprocesador que sexa inferior a 255 caracteres.', |
132 | | - 'plotters-excessively-long-helpername' => 'O nome do axudante é moi longo. Por favor, defina un axudante que sexa inferior a 255 caracteres.', |
133 | 129 | 'plotters-no-data' => 'Non se proporcionou ningún dato.', |
134 | 130 | 'plotters-invalid-renderer' => 'Seleccionouse un renderizador inválido.', |
135 | 131 | 'plotters-errors' => '<b>Erro(s) de plotters:</b>', |
— | — | @@ -165,7 +161,6 @@ |
166 | 162 | 'plotters-missing-arguments' => 'Žane argumenty podate.', |
167 | 163 | 'plotters-excessively-long-scriptname' => 'Mjeno skripta je předołhe. Prošu definuj skript, kotryž ma mjenje hač 255 znamješkow.', |
168 | 164 | 'plotters-excessively-long-preprocessorname' => 'Mjeno preprocesora je předołhe. Prošu definuj preprocesor, kotryž ma mjenje hač 255 znamješkow.', |
169 | | - 'plotters-excessively-long-helpername' => 'Mjeno pomocnika je předołhe. Prošu definuj pomocnik, kotryž ma mjenje hač 255 znamješkow.', |
170 | 165 | 'plotters-no-data' => 'Žane daty njejsu so podali.', |
171 | 166 | 'plotters-invalid-renderer' => 'Njepłaćiwy rysowak je so wubrał.', |
172 | 167 | 'plotters-errors' => '<b>Ploterowe zmylki:</b>', |
Index: trunk/extensions/Plotters/PlottersClass.php |
— | — | @@ -52,17 +52,12 @@ |
53 | 53 | $errors .= wfMsg( "plotters-excessively-long-scriptname" ) . "<br />"; |
54 | 54 | } |
55 | 55 | |
56 | | - // Check preprocessors and helpers |
| 56 | + // Check preprocessors |
57 | 57 | foreach ( $this->argumentArray["preprocessors"] as $preprocessor ) { |
58 | 58 | if ( strlen( $preprocessor ) > 255 ) { |
59 | 59 | $errors .= wfMsg( "plotters-excessively-long-preprocessorname" ) . "<br />"; |
60 | 60 | } |
61 | 61 | } |
62 | | - foreach ( $this->argumentArray["helpers"] as $helper ) { |
63 | | - if ( strlen( $helper ) > 255 ) { |
64 | | - $errors .= wfMsg( "plotters-excessively-long-helpername" ) . "<br />"; |
65 | | - } |
66 | | - } |
67 | 62 | |
68 | 63 | if ( strlen( $this->argumentArray["name"] ) > 255 ) { |
69 | 64 | $errors .= wfMsg( "plotters-excessively-long-name" ) . "<br />"; |
— | — | @@ -99,15 +94,11 @@ |
100 | 95 | $renderer = "mplotter-" . $this->argumentArray["renderer"]; |
101 | 96 | $this->parser->mOutput->$renderer = true; |
102 | 97 | |
103 | | - // Add preprocessor and helper tags |
| 98 | + // Add preprocessor tags |
104 | 99 | foreach ( $this->argumentArray["preprocessors"] as $preprocessor ) { |
105 | 100 | $preprocessor = "mplotter-" . $preprocessor; |
106 | 101 | $this->parser->mOutput->$preprocessor = true; |
107 | 102 | } |
108 | | - foreach ( $this->argumentArray["helpers"] as $helper ) { |
109 | | - $helper = "mplotter-" . $helper; |
110 | | - $this->parser->mOutput->$helper = true; |
111 | | - } |
112 | 103 | |
113 | 104 | $script = "mplotter-" . $this->argumentArray["script"]; |
114 | 105 | $this->parser->mOutput->$script = true; |
Index: trunk/extensions/Plotters/README |
— | — | @@ -1,6 +1,6 @@ |
2 | 2 | This extension allows users to create client side graphs (like pie, bar, etc) from data using javascript. The javascript is created by sysops in the MediaWiki namespace. Adding new scripts works like the Gadgets extension (as this extension borrows heavily from Gadgets). |
3 | 3 | |
4 | | -Preprocessing scripts, plotting scripts, and helpers are available, and the javascript function for each should be defined as follows: |
| 4 | +Preprocessing scripts, and plotting scripts are available, and the javascript function for each should be defined as follows: |
5 | 5 | |
6 | 6 | /* For preprocessing scripts */ |
7 | 7 | function plotter_<functionname>_process( name, data, labels, arguments ) { |
— | — | @@ -28,12 +28,6 @@ |
29 | 29 | plotter.render(); |
30 | 30 | } |
31 | 31 | |
32 | | -/* For helpers - this is javascript that is loaded, but not called |
33 | | - by the plugin; they are for use in functions called by the plugin */ |
34 | | -function plotter_<functionname>( <anything_you_want> ) { |
35 | | - /* ... */ |
36 | | -} |
37 | | - |
38 | 32 | You can use these in a parser function like so: |
39 | 33 | |
40 | 34 | {{#plot: |
— | — | @@ -41,7 +35,6 @@ |
42 | 36 | |scriptarguments=arg1,arg2,... |
43 | 37 | |preprocessors=<preprocessorname1>,<preprocessorname2>,... |
44 | 38 | |preprocessorarguments=<preprocessor1argument1>,<preprocessor1argument2>,...:preprocessor2argument1>,<preprocessor2argument2>,...:...,... |
45 | | -|helpers=<helpername1>,<helpername2>,... |
46 | 39 | |labels=label1,label2 |
47 | 40 | |data=1,2 |
48 | 41 | 2,4}} |
— | — | @@ -71,6 +64,6 @@ |
72 | 65 | |
73 | 66 | The data separator can be changed using the datasep argument; the default is datasep=, |
74 | 67 | |
75 | | -script, preprocessors, helpers, name, and tableclass arguments are alphanumeric only, and are limited to 255 characters per script/preprocessor/etc. |
| 68 | +script, preprocessors, name, and tableclass arguments are alphanumeric only, and are limited to 255 characters per script/preprocessor/etc. |
76 | 69 | |
77 | 70 | This code is alpha quality right now; many features may not work. |