Index: trunk/extensions/Collection/Collection.hooks.php |
— | — | @@ -263,7 +263,7 @@ |
264 | 264 | array( 'known', 'noclasses' ) |
265 | 265 | ) |
266 | 266 | ); |
267 | | - $msg = htmlspecialchars( wfMsg( 'coll-clear_collection_confirm' ) ); |
| 267 | + $msg = Xml::encodeJsVar( wfMsg( 'coll-clear_collection_confirm' ) ); |
268 | 268 | $out .= Xml::tags( |
269 | 269 | 'li', |
270 | 270 | array( 'id' => 'coll-clear_collection' ), |
— | — | @@ -271,7 +271,7 @@ |
272 | 272 | SpecialPage::getTitleFor( 'Book', 'clear_collection/' ), |
273 | 273 | wfMsgHtml( "coll-clear_collection" ), |
274 | 274 | array( |
275 | | - 'onclick' => "if (confirm('$msg')) return true; else return false;", |
| 275 | + 'onclick' => "if (confirm($msg)) return true; else return false;", |
276 | 276 | 'rel' => 'nofollow', |
277 | 277 | 'title' => wfMsg( "coll-clear_collection_tooltip" ) |
278 | 278 | ), |
— | — | @@ -293,10 +293,8 @@ |
294 | 294 | ) |
295 | 295 | ); |
296 | 296 | $out .= '</ul>'; |
297 | | - $out .= Xml::element( |
298 | | - 'script', |
299 | | - array( 'type' => $wgJsMimeType ), |
300 | | - "wgCollectionAddRemoveState = '$addRemoveState';" |
| 297 | + $out .= Skin::makeVariablesScript( |
| 298 | + array( 'wgCollectionAddRemoveSate' => $addRemoveSate ) |
301 | 299 | ); |
302 | 300 | $out .= Xml::element( |
303 | 301 | 'script', |
— | — | @@ -310,24 +308,16 @@ |
311 | 309 | |
312 | 310 | // activate popup check: |
313 | 311 | if ( $wgCollectionNavPopups ) { |
314 | | - $addPageText = htmlspecialchars( wfMsg( 'coll-add_page_popup' ), $quote_style=ENT_QUOTES ); |
315 | | - $addCategoryText = htmlspecialchars( wfMsg( 'coll-add_category_popup', $quote_style=ENT_QUOTES ) ); |
316 | | - $removePageText = htmlspecialchars( wfMsg( 'coll-remove_page_popup', $quote_style=ENT_QUOTES ) ); |
317 | | - $popupHelpText = htmlspecialchars( wfMsg( 'coll-popup_help_text', $quote_style=ENT_QUOTES ) ); |
318 | | - |
319 | | - $out .= Xml::element( 'script', |
| 312 | + $out .= Skin::makeVariablesScript( |
320 | 313 | array( |
321 | | - 'type' => $wgJsMimeType, |
322 | | - ), |
323 | | - "wgCollectionNavPopupJSURL = '$wgScriptPath/extensions/Collection/collection/Gadget-popups.js?$wgCollectionStyleVersion'; |
324 | | - wgCollectionNavPopupCSSURL = '$wgScriptPath/extensions/Collection/collection/Gadget-navpop.css?$wgCollectionStyleVersion'; |
325 | | - wgCollectionAddPageText = '$addPageText'; |
326 | | - wgCollectionAddCategoryText = '$addCategoryText'; |
327 | | - wgCollectionRemovePageText = '$removePageText'; |
328 | | - wgCollectionPopupHelpText = '$popupHelpText'; |
329 | | - wgCollectionArticleNamespaces = [ " |
330 | | - . implode( ', ', $wgCollectionArticleNamespaces ) |
331 | | - . "];" |
| 314 | + 'wgCollectionNavPopupJSURL' => "$wgScriptPath/extensions/Collection/collection/Gadget-popups.js?$wgCollectionStyleVersion", |
| 315 | + 'wgCollectionNavPopupCSSURL' => "$wgScriptPath/extensions/Collection/collection/Gadget-navpop.css?$wgCollectionStyleVersion", |
| 316 | + 'wgCollectionAddPageText' => wfMsg( 'coll-add_page_popup' ), |
| 317 | + 'wgCollectionAddCategoryText' => wfMsg( 'coll-add_category_popup' ), |
| 318 | + 'wgCollectionRemovePageText' => wfMsg( 'coll-remove_page_popup' ), |
| 319 | + 'wgCollectionPopupHelpText' => wfMsg( 'coll-popup_help_text' ), |
| 320 | + 'wgCollectionArticleNamespaces' => $wgCollectionArticleNamespaces, |
| 321 | + ) |
332 | 322 | ); |
333 | 323 | $out .= Xml::element( |
334 | 324 | 'script', |
Index: trunk/extensions/Collection/collection/popup.js |
— | — | @@ -168,8 +168,8 @@ |
169 | 169 | // replace two methods from the Navpopup object |
170 | 170 | Navpopup.prototype.unhide = collectionPopupUnhide; |
171 | 171 | Navpopup.prototype.setInnerHTML = collectionPopupSetInnerHTML; |
172 | | - // disable article fetching: |
173 | | - pg.option.simplePopups = true; |
| 172 | + // disable article fetching: |
| 173 | + pg.option.simplePopups = true; |
174 | 174 | refreshCollectionArticleList(); |
175 | 175 | }); |
176 | 176 | |