Index: trunk/extensions/SemanticForms/specials/SF_FormEdit.php |
— | — | @@ -351,21 +351,13 @@ |
352 | 352 | $text .= $form_text; |
353 | 353 | } |
354 | 354 | } |
355 | | - // Instead of adding the Javascript using addScript(), which is |
356 | | - // the standard approach, we add it using addHTML(), below the |
357 | | - // form text - that's so the Javascript created for fields with |
358 | | - // a 'show on select' parameter, if there are any, get placed |
359 | | - // below the form HTML, so that they can affect (i.e., hide) the |
360 | | - // relevant form fields. if there's a less hacky way to do this, |
361 | | - // the code should switch to that. |
362 | | - // if (! empty($javascript_text)) |
363 | | - // $wgOut->addScript(' <script type="text/javascript">' . "\n" . $javascript_text . '</script>' . "\n"); |
364 | | - $wgOut->addHTML( $text ); |
| 355 | + |
365 | 356 | SFUtils::addJavascriptAndCSS(); |
366 | 357 | if ( ! empty( $javascript_text ) ) { |
367 | | - $wgOut->addHTML( ' <script type="text/javascript">' . "\n$javascript_text\n" . '</script>' . "\n" ); |
| 358 | + $wgOut->addScript( ' <script type="text/javascript">' . "\n$javascript_text\n" . '</script>' . "\n" ); |
368 | 359 | } |
| 360 | + $wgOut->addHTML( $text ); |
| 361 | + |
369 | 362 | return null; |
370 | 363 | } |
371 | | - |
372 | 364 | } |