Index: trunk/phase3/RELEASE-NOTES-1.19 |
— | — | @@ -28,7 +28,9 @@ |
29 | 29 | * $wgUploadNavigationUrl should be used for file redlinks if |
30 | 30 | $wgUploadMissingFileUrl is not set. The first was used for this |
31 | 31 | until the second was introduced in 1.17. |
32 | | -* (bug 25355) Parser generates edit section links for special pages |
| 32 | +* (bug 25355) Parser generates edit section links for special pages. |
| 33 | +* (bug 27894) Move 'editondblclick' event listener down from body to |
| 34 | + div#bodyContent. |
33 | 35 | |
34 | 36 | === API changes in 1.19 === |
35 | 37 | * (bug 19838) siprop=interwikimap can now use the interwiki cache. |
Index: trunk/phase3/includes/OutputPage.php |
— | — | @@ -2250,13 +2250,6 @@ |
2251 | 2251 | |
2252 | 2252 | $bodyAttrs = array(); |
2253 | 2253 | |
2254 | | - # Crazy edit-on-double-click stuff |
2255 | | - if ( $this->isArticle() && $this->getUser()->getOption( 'editondblclick' ) ) { |
2256 | | - $editUrl = $this->getTitle()->getLocalUrl( $sk->editUrlOptions() ); |
2257 | | - $bodyAttrs['ondblclick'] = "document.location = '" . |
2258 | | - Xml::escapeJsString( $editUrl ) . "'"; |
2259 | | - } |
2260 | | - |
2261 | 2254 | # Classes for LTR/RTL directionality support |
2262 | 2255 | $bodyAttrs['class'] = "mediawiki $userdir sitedir-$sitedir"; |
2263 | 2256 | |
— | — | @@ -2312,6 +2305,11 @@ |
2313 | 2306 | $this->addModules( 'mediawiki.action.view.rightClickEdit' ); |
2314 | 2307 | } |
2315 | 2308 | |
| 2309 | + # Crazy edit-on-double-click stuff |
| 2310 | + if ( $this->isArticle() && $this->getUser()->getOption( 'editondblclick' ) ) { |
| 2311 | + $this->addModules( 'mediawiki.action.view.dblClickEdit' ); |
| 2312 | + } |
| 2313 | + |
2316 | 2314 | if ( $wgUseAJAXCategories ) { |
2317 | 2315 | global $wgAJAXCategoriesNamespaces; |
2318 | 2316 | |
Index: trunk/phase3/resources/mediawiki.action/mediawiki.action.view.dblClickEdit.js |
— | — | @@ -0,0 +1,12 @@ |
| 2 | +/** |
| 3 | + * This module enables double-click-to-edit functionality |
| 4 | + */ |
| 5 | +jQuery( document ).ready( function( $ ) { |
| 6 | + var url = $( '#ca-edit a' ).attr( 'href' ); |
| 7 | + if ( url ) { |
| 8 | + mw.util.$content.dblclick( function( e ) { |
| 9 | + e.preventDefault(); |
| 10 | + window.location = url; |
| 11 | + } ); |
| 12 | + } |
| 13 | +} ); |
Index: trunk/phase3/resources/Resources.php |
— | — | @@ -479,6 +479,10 @@ |
480 | 480 | 'styles' => 'resources/mediawiki.action/mediawiki.action.history.diff.css', |
481 | 481 | 'group' => 'mediawiki.action.history', |
482 | 482 | ), |
| 483 | + 'mediawiki.action.view.dblClickEdit' => array( |
| 484 | + 'scripts' => 'resources/mediawiki.action/mediawiki.action.view.dblClickEdit.js', |
| 485 | + 'dependencies' => 'mediawiki.util', |
| 486 | + ), |
483 | 487 | 'mediawiki.action.view.metadata' => array( |
484 | 488 | 'scripts' => 'resources/mediawiki.action/mediawiki.action.view.metadata.js', |
485 | 489 | 'messages' => array( |
Index: trunk/phase3/CREDITS |
— | — | @@ -134,6 +134,7 @@ |
135 | 135 | * Nakon |
136 | 136 | * Nathan Larson |
137 | 137 | * nephele |
| 138 | +* Nik |
138 | 139 | * Nikolaos S. Karastathis |
139 | 140 | * Olaf Lenz |
140 | 141 | * Paul Copperman |