Index: trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.php |
— | — | @@ -25,6 +25,7 @@ |
26 | 26 | 'publish' => array( 'global' => false, 'user' => true ), |
27 | 27 | 'toc' => array( 'global' => false, 'user' => true ), |
28 | 28 | 'toolbar' => array( 'global' => false, 'user' => true ), |
| 29 | + 'templateEditor' => array( 'global' => false, 'user' => true ), |
29 | 30 | ); |
30 | 31 | |
31 | 32 | /* Setup */ |
— | — | @@ -55,6 +56,7 @@ |
56 | 57 | $wgExtensionMessagesFiles['WikiEditorPublish'] = dirname( __FILE__ ) . '/Modules/Publish/Publish.i18n.php'; |
57 | 58 | $wgExtensionMessagesFiles['WikiEditorToc'] = dirname( __FILE__ ) . '/Modules/Toc/Toc.i18n.php'; |
58 | 59 | $wgExtensionMessagesFiles['WikiEditorToolbar'] = dirname( __FILE__ ) . '/Modules/Toolbar/Toolbar.i18n.php'; |
| 60 | +$wgExtensionMessagesFiles['WikiEditorTemplateEditor'] = dirname( __FILE__ ) . '/Modules/TemplateEditor/TemplateEditor.i18n.php'; |
59 | 61 | |
60 | 62 | // Register Hooks |
61 | 63 | $wgHooks['EditPageBeforeEditToolbar'][] = 'WikiEditorHooks::addModules'; |
Index: trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.hooks.php |
— | — | @@ -17,6 +17,7 @@ |
18 | 18 | array( 'src' => 'Modules/Publish/Publish.js', 'version' => 2 ), |
19 | 19 | array( 'src' => 'Modules/Toc/Toc.js', 'version' => 2 ), |
20 | 20 | array( 'src' => 'Modules/Toolbar/Toolbar.js', 'version' => 13 ), |
| 21 | + array( 'src' => 'Modules/Toolbar/TemplateEditor.js', 'version' => 1 ), |
21 | 22 | ), |
22 | 23 | 'combined' => array( |
23 | 24 | array( 'src' => 'WikiEditor.combined.js', 'version' => 11 ), |
— | — | @@ -47,6 +48,19 @@ |
48 | 49 | ), |
49 | 50 | ), |
50 | 51 | ), |
| 52 | + 'templateEditor' => array( |
| 53 | + 'i18n' => 'WikiEditorTemplateEditor', |
| 54 | + 'preferences' => array( |
| 55 | + 'enable' => array( |
| 56 | + 'key' => 'wikieditor-template-editor', |
| 57 | + 'ui' => array( |
| 58 | + 'type' => 'toggle', |
| 59 | + 'label-message' => 'wikieditor-template-editor-preference', |
| 60 | + 'section' => 'editing/experimental', |
| 61 | + ), |
| 62 | + ), |
| 63 | + ), |
| 64 | + ), |
51 | 65 | 'preview' => array( |
52 | 66 | 'i18n' => 'WikiEditorPreview', |
53 | 67 | 'preferences' => array( |
Index: trunk/extensions/UsabilityInitiative/WikiEditor/Modules/TemplateEditor/TemplateEditor.i18n.php |
— | — | @@ -0,0 +1,16 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + * Internationalisation for the template editor module of the Usability Initiative wikiEditor extension |
| 5 | + * |
| 6 | + * @file |
| 7 | + * @ingroup Extensions |
| 8 | + */ |
| 9 | + |
| 10 | +$messages = array(); |
| 11 | + |
| 12 | +/** English |
| 13 | + * @author Nimish Gautam |
| 14 | + */ |
| 15 | +$messages['en'] = array( |
| 16 | + 'wikieditor-template-editor-preference' => 'Enable form-based editing of wiki templates', |
| 17 | +); |
Property changes on: trunk/extensions/UsabilityInitiative/WikiEditor/Modules/TemplateEditor/TemplateEditor.i18n.php |
___________________________________________________________________ |
Name: svn:eol-style |
1 | 18 | + native |
Index: trunk/extensions/UsabilityInitiative/WikiEditor/Modules/TemplateEditor/TemplateEditor.js |
— | — | @@ -0,0 +1,12 @@ |
| 2 | +/* JavaScript for WikiEditor Template Editor module */ |
| 3 | + |
| 4 | +mw.addOnloadHook( function() { |
| 5 | + // Check preferences for highlight |
| 6 | + if ( !wgWikiEditorPreferences || !( wgWikiEditorPreferences.templateEditor && wgWikiEditorPreferences.templateEditor.enable ) ) { |
| 7 | + return true; |
| 8 | + } |
| 9 | + // Add the highlight module |
| 10 | + if ( $j.wikiEditor ) { |
| 11 | + $j( 'textarea#wpTextbox1' ).wikiEditor( 'addModule', 'templateEditor' ); |
| 12 | + } |
| 13 | +}); |
Property changes on: trunk/extensions/UsabilityInitiative/WikiEditor/Modules/TemplateEditor/TemplateEditor.js |
___________________________________________________________________ |
Name: svn:eol-style |
1 | 14 | + native |