r45162 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r45161‎ | r45162 | r45163 >
Date:19:15, 29 December 2008
Author:danny_b
Status:ok
Tags:
Comment:
* XHTML DTD compliance
* proper marking of script CDATA section
Modified paths:
  • /trunk/extensions/Collection/Collection.body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Collection/Collection.body.php
@@ -1078,21 +1078,6 @@
10791079 $wgOut->setSquidMaxage( 0 );
10801080 $wgOut->enableClientCache( false );
10811081
1082 - $out .= <<<EOS
1083 -<script type="text/javascript">
1084 - function collectionCall(func, args) {
1085 - sajax_request_type = 'POST';
1086 - sajax_do_call('wfAjaxCollection' + func, args, function(xhr) {
1087 - sajax_request_type = 'GET';
1088 - sajax_do_call('wfAjaxCollectionGetPortlet', [func], function(xhr) {
1089 - document.getElementById('collectionPortletList').parentNode.innerHTML = xhr.responseText;
1090 - });
1091 - });
1092 - }
1093 -</script>
1094 -EOS
1095 - ;
1096 -
10971082 $namespace = $wgTitle->getNamespace();
10981083
10991084 if ( $ajaxHint == 'AddCategory' || $namespace == NS_CATEGORY ) {
@@ -1180,6 +1165,24 @@
11811166 }
11821167
11831168 $out .= "</ul>";
 1169+
 1170+ $out .= <<<EOS
 1171+<script type="text/javascript">
 1172+/* <![CDATA[ */
 1173+ function collectionCall(func, args) {
 1174+ sajax_request_type = 'POST';
 1175+ sajax_do_call('wfAjaxCollection' + func, args, function(xhr) {
 1176+ sajax_request_type = 'GET';
 1177+ sajax_do_call('wfAjaxCollectionGetPortlet', [func], function(xhr) {
 1178+ document.getElementById('collectionPortletList').parentNode.innerHTML = xhr.responseText;
 1179+ });
 1180+ });
 1181+ }
 1182+/* ]]> */
 1183+</script>
 1184+EOS
 1185+ ;
 1186+
11841187 return $out;
11851188 }
11861189

Status & tagging log