Index: trunk/extensions/VisualEditor/SpecialVisualEditorSandbox.php |
— | — | @@ -17,7 +17,7 @@ |
18 | 18 | public function execute( $par ) { |
19 | 19 | global $wgOut; |
20 | 20 | |
21 | | - $wgOut->addModules( 'ext.visualEditor.sandbox' ); |
| 21 | + $wgOut->addModules( 'ext.visualEditor.special.sandbox' ); |
22 | 22 | $this->setHeaders(); |
23 | 23 | $wgOut->setPageTitle( wfMsg( 'visualeditor-sandbox-title' ) ); |
24 | 24 | $modeWikitext = wfMsgHtml( 'visualeditor-tooltip-wikitext' ); |
— | — | @@ -26,6 +26,10 @@ |
27 | 27 | $modeRender = wfMsgHtml( 'visualeditor-tooltip-render' ); |
28 | 28 | $modeHistory = wfMsgHtml( 'visualeditor-tooltip-history' ); |
29 | 29 | $modeHelp = wfMsgHtml( 'visualeditor-tooltip-help' ); |
| 30 | + |
| 31 | + $feedbackPrompt = wfMsgHtml( 'visualeditor-feedback-prompt' ); |
| 32 | + $feedbackDialogTitle = wfMsgHtml( 'visualeditor-feedback-dialog-title' ); |
| 33 | + |
30 | 34 | $out = <<<HTML |
31 | 35 | <!-- VisualEditor Sandbox --> |
32 | 36 | <div id="es-docs"> |
Index: trunk/extensions/VisualEditor/VisualEditor.php |
— | — | @@ -46,6 +46,19 @@ |
47 | 47 | ); |
48 | 48 | |
49 | 49 | $wgResourceModules += array( |
| 50 | + 'ext.visualEditor.special.sandbox' => $wgVisualEditorResourceTemplate + array( |
| 51 | + 'scripts' => array( |
| 52 | + 'sandbox/special.js', |
| 53 | + ), |
| 54 | + 'messages' => array( |
| 55 | + 'visualeditor-feedback-prompt', |
| 56 | + 'visualeditor-feedback-dialog-title', |
| 57 | + ), |
| 58 | + 'dependencies' => array( |
| 59 | + 'ext.visualEditor.sandbox', |
| 60 | + 'mediawiki.feedback', |
| 61 | + ) |
| 62 | + ), |
50 | 63 | 'ext.visualEditor.sandbox' => $wgVisualEditorResourceTemplate + array( |
51 | 64 | 'scripts' => array( |
52 | 65 | 'sandbox/sandbox.js', |
Index: trunk/extensions/VisualEditor/modules/sandbox/special.js |
— | — | @@ -0,0 +1,31 @@ |
| 2 | +( function( $, mw, undefined ) { |
| 3 | + |
| 4 | + $(document).ready( setupSpecial ); |
| 5 | + |
| 6 | + function setupSpecial() { |
| 7 | + |
| 8 | + var api = new mw.Api( { |
| 9 | + url: mw.config.get( 'wgServer' ) + mw.config.get( 'wgScriptPath' ) + '/api.php' |
| 10 | + } ); |
| 11 | + |
| 12 | + var title = new mw.Title( 'VisualEditorFeedback' ); |
| 13 | + |
| 14 | + var feedback = new mw.Feedback( |
| 15 | + api, |
| 16 | + title, |
| 17 | + 'visualeditor-feedback-dialog-title' |
| 18 | + ); |
| 19 | + |
| 20 | + $feedbackLink = $( '<a></a>' ) |
| 21 | + .attr( { 'href': '#' } ) |
| 22 | + .text( mw.msg( 'visualeditor-feedback-prompt' ) ) |
| 23 | + .click( function() { feedback.launch(); } ); |
| 24 | + |
| 25 | + // Right before the line with the test "documents" we prepend a float-right |
| 26 | + // div, which puts it on the same line as the documents at right. |
| 27 | + $( '#es-docs' ).before( |
| 28 | + $( '<div></div>' ).css( { 'float': 'right' } ).append( $feedbackLink ) |
| 29 | + ); |
| 30 | + } |
| 31 | + |
| 32 | +} )( jQuery, window.mediaWiki ); |
Property changes on: trunk/extensions/VisualEditor/modules/sandbox/special.js |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 33 | + native |
Index: trunk/extensions/VisualEditor/VisualEditor.i18n.php |
— | — | @@ -15,6 +15,8 @@ |
16 | 16 | 'visualeditor-tooltip-render' => 'Toggle preview', |
17 | 17 | 'visualeditor-tooltip-history' => 'Toggle transaction history view', |
18 | 18 | 'visualeditor-tooltip-help' => 'Toggle help view', |
| 19 | + 'visualeditor-feedback-prompt' => 'Leave feedback', |
| 20 | + 'visualeditor-feedback-dialog-title' => 'Leave feedback about VisualEditor Sandbox', |
19 | 21 | ); |
20 | 22 | |
21 | 23 | /** Message documentation |