2010-09-15 03:02:35 +00:00
|
|
|
<?php
|
2010-09-15 22:40:50 +00:00
|
|
|
/**
|
2010-10-01 18:15:10 +00:00
|
|
|
* Hooks for WikiEditor extension
|
2010-09-15 22:40:50 +00:00
|
|
|
*
|
|
|
|
* @file
|
|
|
|
* @ingroup Extensions
|
|
|
|
*/
|
|
|
|
|
|
|
|
class WikiEditorHooks {
|
|
|
|
|
2010-09-16 23:41:08 +00:00
|
|
|
/* Protected Static Members */
|
2010-09-15 22:40:50 +00:00
|
|
|
|
2010-09-16 23:41:08 +00:00
|
|
|
protected static $modules = array(
|
2010-09-15 22:40:50 +00:00
|
|
|
|
2010-09-16 23:13:05 +00:00
|
|
|
/* Third-party modules */
|
|
|
|
|
|
|
|
'contentCollector' => array(
|
2010-10-07 23:31:30 +00:00
|
|
|
'scripts' => 'contentCollector.js',
|
2010-09-20 23:31:56 +00:00
|
|
|
'group' => 'ext.wikiEditor',
|
2010-09-16 23:13:05 +00:00
|
|
|
),
|
|
|
|
|
2010-09-15 22:40:50 +00:00
|
|
|
/* WikiEditor jQuery plugin Resources */
|
|
|
|
|
|
|
|
'jquery.wikiEditor' => array(
|
2010-10-07 23:31:30 +00:00
|
|
|
'scripts' => 'jquery.wikiEditor.js',
|
|
|
|
'styles' => 'jquery.wikiEditor.css',
|
2010-09-15 22:40:50 +00:00
|
|
|
'dependencies' => array(
|
2010-09-20 20:06:18 +00:00
|
|
|
'jquery.client',
|
|
|
|
'jquery.textSelection',
|
|
|
|
'jquery.delayedBind',
|
2010-09-16 21:11:46 +00:00
|
|
|
),
|
|
|
|
'messages' => array(
|
|
|
|
'wikieditor-wikitext-tab',
|
|
|
|
'wikieditor-loading',
|
2010-09-15 22:40:50 +00:00
|
|
|
),
|
2010-09-20 23:31:56 +00:00
|
|
|
'group' => 'ext.wikiEditor',
|
2010-09-15 22:40:50 +00:00
|
|
|
),
|
2010-10-04 20:12:30 +00:00
|
|
|
'jquery.wikiEditor.iframe' => array(
|
2010-10-07 23:31:30 +00:00
|
|
|
'scripts' => 'jquery.wikiEditor.iframe.js',
|
2010-10-04 21:08:41 +00:00
|
|
|
'dependencies' => array(
|
|
|
|
'jquery.wikiEditor',
|
|
|
|
'contentCollector',
|
|
|
|
),
|
2010-10-04 20:12:30 +00:00
|
|
|
'group' => 'ext.wikiEditor',
|
|
|
|
),
|
2010-09-15 22:40:50 +00:00
|
|
|
'jquery.wikiEditor.dialogs' => array(
|
2010-10-07 23:31:30 +00:00
|
|
|
'scripts' => 'jquery.wikiEditor.dialogs.js',
|
|
|
|
'styles' => 'jquery.wikiEditor.dialogs.css',
|
2010-09-15 22:40:50 +00:00
|
|
|
'dependencies' => array(
|
|
|
|
'jquery.wikiEditor',
|
|
|
|
'jquery.wikiEditor.toolbar',
|
|
|
|
'jquery.ui.dialog',
|
2010-10-01 21:58:04 +00:00
|
|
|
'jquery.ui.button',
|
2010-09-15 22:40:50 +00:00
|
|
|
'jquery.ui.draggable',
|
|
|
|
'jquery.ui.resizable',
|
|
|
|
'jquery.tabIndex',
|
|
|
|
),
|
2010-09-20 23:31:56 +00:00
|
|
|
'group' => 'ext.wikiEditor',
|
2010-09-15 22:40:50 +00:00
|
|
|
),
|
|
|
|
'jquery.wikiEditor.highlight' => array(
|
2010-10-07 23:31:30 +00:00
|
|
|
'scripts' => 'jquery.wikiEditor.highlight.js',
|
2010-10-04 20:12:30 +00:00
|
|
|
'dependencies' => array(
|
|
|
|
'jquery.wikiEditor',
|
|
|
|
'jquery.wikiEditor.iframe',
|
|
|
|
),
|
2010-09-20 23:31:56 +00:00
|
|
|
'group' => 'ext.wikiEditor',
|
2010-09-15 22:40:50 +00:00
|
|
|
),
|
|
|
|
'jquery.wikiEditor.preview' => array(
|
2010-10-07 23:31:30 +00:00
|
|
|
'scripts' => 'jquery.wikiEditor.preview.js',
|
|
|
|
'styles' => 'jquery.wikiEditor.preview.css',
|
2010-09-20 20:06:18 +00:00
|
|
|
'dependencies' => 'jquery.wikiEditor',
|
2010-09-20 23:31:56 +00:00
|
|
|
'group' => 'ext.wikiEditor',
|
2010-09-15 22:40:50 +00:00
|
|
|
),
|
|
|
|
'jquery.wikiEditor.previewDialog' => array(
|
2010-10-07 23:31:30 +00:00
|
|
|
'scripts' => 'jquery.wikiEditor.previewDialog.js',
|
|
|
|
'styles' => 'jquery.wikiEditor.previewDialog.css',
|
2010-09-15 22:40:50 +00:00
|
|
|
'dependencies' => array(
|
2010-09-20 20:06:18 +00:00
|
|
|
'jquery.wikiEditor',
|
|
|
|
'jquery.wikiEditor.dialogs',
|
2010-09-15 22:40:50 +00:00
|
|
|
),
|
2010-09-20 23:31:56 +00:00
|
|
|
'group' => 'ext.wikiEditor',
|
2010-09-15 22:40:50 +00:00
|
|
|
),
|
|
|
|
'jquery.wikiEditor.publish' => array(
|
2010-10-07 23:31:30 +00:00
|
|
|
'scripts' => 'jquery.wikiEditor.publish.js',
|
2010-09-15 22:40:50 +00:00
|
|
|
'dependencies' => array(
|
2010-09-20 20:06:18 +00:00
|
|
|
'jquery.wikiEditor',
|
|
|
|
'jquery.wikiEditor.dialogs',
|
2010-09-15 22:40:50 +00:00
|
|
|
),
|
2010-09-20 23:31:56 +00:00
|
|
|
'group' => 'ext.wikiEditor',
|
2010-09-15 22:40:50 +00:00
|
|
|
),
|
|
|
|
'jquery.wikiEditor.templateEditor' => array(
|
2010-10-07 23:31:30 +00:00
|
|
|
'scripts' => 'jquery.wikiEditor.templateEditor.js',
|
2010-09-15 22:40:50 +00:00
|
|
|
'dependencies' => array(
|
2010-09-20 20:06:18 +00:00
|
|
|
'jquery.wikiEditor',
|
2010-10-04 20:12:30 +00:00
|
|
|
'jquery.wikiEditor.iframe',
|
|
|
|
'jquery.wikiEditor.dialogs',
|
2010-09-15 22:40:50 +00:00
|
|
|
),
|
2010-09-20 23:31:56 +00:00
|
|
|
'group' => 'ext.wikiEditor',
|
2010-09-15 22:40:50 +00:00
|
|
|
),
|
|
|
|
'jquery.wikiEditor.templates' => array(
|
2010-10-07 23:31:30 +00:00
|
|
|
'scripts' => 'jquery.wikiEditor.templates.js',
|
2010-10-04 20:12:30 +00:00
|
|
|
'dependencies' => array(
|
|
|
|
'jquery.wikiEditor',
|
|
|
|
'jquery.wikiEditor.iframe',
|
|
|
|
),
|
2010-09-20 23:31:56 +00:00
|
|
|
'group' => 'ext.wikiEditor',
|
2010-09-15 22:40:50 +00:00
|
|
|
),
|
|
|
|
'jquery.wikiEditor.toc' => array(
|
2010-10-07 23:31:30 +00:00
|
|
|
'scripts' => 'jquery.wikiEditor.toc.js',
|
|
|
|
'styles' => 'jquery.wikiEditor.toc.css',
|
2010-09-15 22:40:50 +00:00
|
|
|
'dependencies' => array(
|
2010-09-16 22:20:17 +00:00
|
|
|
'jquery.wikiEditor',
|
2010-10-04 20:12:30 +00:00
|
|
|
'jquery.wikiEditor.iframe',
|
2010-09-16 22:20:17 +00:00
|
|
|
'jquery.ui.draggable',
|
|
|
|
'jquery.ui.resizable',
|
|
|
|
'jquery.autoEllipsis',
|
|
|
|
'jquery.color',
|
2010-09-15 22:40:50 +00:00
|
|
|
),
|
2010-09-20 23:31:56 +00:00
|
|
|
'group' => 'ext.wikiEditor',
|
2010-09-15 22:40:50 +00:00
|
|
|
),
|
|
|
|
'jquery.wikiEditor.toolbar' => array(
|
2010-10-07 23:31:30 +00:00
|
|
|
'scripts' => 'jquery.wikiEditor.toolbar.js',
|
|
|
|
'styles' => 'jquery.wikiEditor.toolbar.css',
|
2010-09-20 20:06:18 +00:00
|
|
|
'dependencies' => 'jquery.wikiEditor',
|
2010-09-20 23:31:56 +00:00
|
|
|
'group' => 'ext.wikiEditor',
|
2010-09-15 22:40:50 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
/* WikiEditor Resources */
|
|
|
|
|
2010-09-20 20:06:18 +00:00
|
|
|
'ext.wikiEditor' => array(
|
2010-10-07 23:31:30 +00:00
|
|
|
'scripts' => 'ext.wikiEditor.js',
|
|
|
|
'styles' => 'ext.wikiEditor.css',
|
2010-09-20 20:06:18 +00:00
|
|
|
'dependencies' => 'jquery.wikiEditor',
|
2010-09-20 23:31:56 +00:00
|
|
|
'group' => 'ext.wikiEditor',
|
2010-09-15 22:40:50 +00:00
|
|
|
),
|
2010-09-20 20:06:18 +00:00
|
|
|
'ext.wikiEditor.dialogs' => array(
|
2010-10-07 23:31:30 +00:00
|
|
|
'scripts' => 'ext.wikiEditor.dialogs.js',
|
|
|
|
'styles' => 'ext.wikiEditor.dialogs.css',
|
2010-09-15 22:40:50 +00:00
|
|
|
'dependencies' => array(
|
2010-09-20 20:06:18 +00:00
|
|
|
'ext.wikiEditor',
|
2010-10-01 21:58:04 +00:00
|
|
|
'ext.wikiEditor.toolbar',
|
2010-10-04 21:08:41 +00:00
|
|
|
'jquery.wikiEditor.dialogs',
|
|
|
|
'jquery.suggestions',
|
2010-09-15 22:40:50 +00:00
|
|
|
),
|
2010-09-20 23:31:56 +00:00
|
|
|
'group' => 'ext.wikiEditor',
|
2010-09-15 22:40:50 +00:00
|
|
|
),
|
2010-09-20 20:06:18 +00:00
|
|
|
'ext.wikiEditor.highlight' => array(
|
2010-10-07 23:31:30 +00:00
|
|
|
'scripts' => 'ext.wikiEditor.highlight.js',
|
2010-09-15 22:40:50 +00:00
|
|
|
'dependencies' => array(
|
2010-09-20 20:06:18 +00:00
|
|
|
'ext.wikiEditor',
|
|
|
|
'jquery.wikiEditor.highlight',
|
2010-09-15 22:40:50 +00:00
|
|
|
),
|
2010-09-20 23:31:56 +00:00
|
|
|
'group' => 'ext.wikiEditor',
|
2010-09-15 22:40:50 +00:00
|
|
|
),
|
2010-09-20 20:06:18 +00:00
|
|
|
'ext.wikiEditor.preview' => array(
|
2010-10-07 23:31:30 +00:00
|
|
|
'scripts' => 'ext.wikiEditor.preview.js',
|
2010-09-16 21:11:46 +00:00
|
|
|
'dependencies' => array(
|
2010-09-20 20:06:18 +00:00
|
|
|
'ext.wikiEditor',
|
|
|
|
'jquery.wikiEditor.preview',
|
2010-09-16 21:11:46 +00:00
|
|
|
),
|
2010-09-15 22:40:50 +00:00
|
|
|
'messages' => array(
|
|
|
|
'wikieditor-preview-tab',
|
|
|
|
'wikieditor-preview-changes-tab',
|
|
|
|
'wikieditor-preview-loading',
|
|
|
|
),
|
2010-09-20 23:31:56 +00:00
|
|
|
'group' => 'ext.wikiEditor',
|
2010-09-15 22:40:50 +00:00
|
|
|
),
|
2010-09-20 20:06:18 +00:00
|
|
|
'ext.wikiEditor.previewDialog' => array(
|
2010-10-07 23:31:30 +00:00
|
|
|
'scripts' => 'ext.wikiEditor.previewDialog.js',
|
2010-09-16 21:11:46 +00:00
|
|
|
'dependencies' => array(
|
2010-09-20 20:06:18 +00:00
|
|
|
'ext.wikiEditor',
|
|
|
|
'jquery.wikiEditor.previewDialog',
|
2010-09-16 21:11:46 +00:00
|
|
|
),
|
2010-09-15 22:40:50 +00:00
|
|
|
'messages' => array(
|
|
|
|
'wikieditor-previewDialog-preference',
|
|
|
|
'wikieditor-previewDialog-tab',
|
|
|
|
'wikieditor-previewDialog-loading',
|
|
|
|
),
|
2010-09-20 23:31:56 +00:00
|
|
|
'group' => 'ext.wikiEditor',
|
2010-09-15 22:40:50 +00:00
|
|
|
),
|
2010-09-20 20:06:18 +00:00
|
|
|
'ext.wikiEditor.publish' => array(
|
2010-10-07 23:31:30 +00:00
|
|
|
'scripts' => 'ext.wikiEditor.publish.js',
|
2010-09-16 21:11:46 +00:00
|
|
|
'dependencies' => array(
|
2010-09-20 20:06:18 +00:00
|
|
|
'ext.wikiEditor',
|
|
|
|
'jquery.wikiEditor.publish',
|
2010-09-16 21:11:46 +00:00
|
|
|
),
|
2010-09-15 22:40:50 +00:00
|
|
|
'messages' => array(
|
|
|
|
'wikieditor-publish-button-publish',
|
|
|
|
'wikieditor-publish-button-cancel',
|
|
|
|
'wikieditor-publish-dialog-title',
|
|
|
|
'wikieditor-publish-dialog-summary',
|
|
|
|
'wikieditor-publish-dialog-minor',
|
|
|
|
'wikieditor-publish-dialog-watch',
|
|
|
|
'wikieditor-publish-dialog-publish',
|
|
|
|
'wikieditor-publish-dialog-goback',
|
|
|
|
),
|
2010-09-20 23:31:56 +00:00
|
|
|
'group' => 'ext.wikiEditor',
|
2010-09-15 22:40:50 +00:00
|
|
|
),
|
2010-09-20 20:06:18 +00:00
|
|
|
'ext.wikiEditor.templateEditor' => array(
|
2010-10-07 23:31:30 +00:00
|
|
|
'scripts' => 'ext.wikiEditor.templateEditor.js',
|
2010-09-16 21:11:46 +00:00
|
|
|
'dependencies' => array(
|
2010-09-20 20:06:18 +00:00
|
|
|
'ext.wikiEditor',
|
2010-10-04 21:08:41 +00:00
|
|
|
'ext.wikiEditor.highlight',
|
2010-09-20 20:06:18 +00:00
|
|
|
'jquery.wikiEditor.templateEditor',
|
2010-09-16 21:11:46 +00:00
|
|
|
),
|
2010-09-15 22:40:50 +00:00
|
|
|
'messages' => array(
|
|
|
|
'wikieditor-template-editor-dialog-title',
|
|
|
|
'wikieditor-template-editor-dialog-submit',
|
|
|
|
'wikieditor-template-editor-dialog-cancel',
|
|
|
|
),
|
2010-09-20 23:31:56 +00:00
|
|
|
'group' => 'ext.wikiEditor',
|
2010-09-15 22:40:50 +00:00
|
|
|
),
|
2010-09-20 20:06:18 +00:00
|
|
|
'ext.wikiEditor.templates' => array(
|
2010-10-07 23:31:30 +00:00
|
|
|
'scripts' => 'ext.wikiEditor.templates.js',
|
2010-09-15 22:40:50 +00:00
|
|
|
'dependencies' => array(
|
2010-09-20 20:06:18 +00:00
|
|
|
'ext.wikiEditor',
|
2010-10-04 21:08:41 +00:00
|
|
|
'ext.wikiEditor.highlight',
|
2010-09-20 20:06:18 +00:00
|
|
|
'jquery.wikiEditor.templates',
|
2010-09-15 22:40:50 +00:00
|
|
|
),
|
2010-09-20 23:31:56 +00:00
|
|
|
'group' => 'ext.wikiEditor',
|
2010-09-15 22:40:50 +00:00
|
|
|
),
|
2010-09-20 20:06:18 +00:00
|
|
|
'ext.wikiEditor.toc' => array(
|
2010-10-07 23:31:30 +00:00
|
|
|
'scripts' => 'ext.wikiEditor.toc.js',
|
2010-09-16 21:11:46 +00:00
|
|
|
'dependencies' => array(
|
2010-09-20 20:06:18 +00:00
|
|
|
'ext.wikiEditor',
|
2010-10-04 21:08:41 +00:00
|
|
|
'ext.wikiEditor.highlight',
|
2010-09-20 20:06:18 +00:00
|
|
|
'jquery.wikiEditor.toc',
|
2010-09-16 21:11:46 +00:00
|
|
|
),
|
2010-09-15 22:40:50 +00:00
|
|
|
'messages' => array(
|
|
|
|
'wikieditor-toc-show',
|
|
|
|
'wikieditor-toc-hide',
|
|
|
|
),
|
2010-09-20 23:31:56 +00:00
|
|
|
'group' => 'ext.wikiEditor',
|
2010-09-15 22:40:50 +00:00
|
|
|
),
|
2010-09-20 23:31:56 +00:00
|
|
|
'ext.wikiEditor.tests.toolbar' => array(
|
2010-10-07 23:31:30 +00:00
|
|
|
'scripts' => 'ext.wikiEditor.tests.toolbar.js',
|
2010-09-20 20:06:18 +00:00
|
|
|
'dependencies' => 'ext.wikiEditor.toolbar',
|
2010-09-20 23:31:56 +00:00
|
|
|
'group' => 'ext.wikiEditor.tests',
|
2010-09-20 20:06:18 +00:00
|
|
|
),
|
|
|
|
'ext.wikiEditor.toolbar' => array(
|
2010-10-07 23:31:30 +00:00
|
|
|
'scripts' => 'ext.wikiEditor.toolbar.js',
|
2010-09-16 21:11:46 +00:00
|
|
|
'dependencies' => array(
|
2010-09-20 20:06:18 +00:00
|
|
|
'ext.wikiEditor',
|
|
|
|
'jquery.wikiEditor.toolbar',
|
|
|
|
'jquery.cookie',
|
|
|
|
'jquery.async',
|
2010-09-16 21:11:46 +00:00
|
|
|
),
|
2010-09-15 22:40:50 +00:00
|
|
|
'messages' => array(
|
|
|
|
// This is a mixed bunch that needs to be separated between dialog and toolbar messages, but since the
|
|
|
|
// dialog module depends on the toolbar module, it's not an urgent matter
|
|
|
|
'wikieditor-toolbar-loading',
|
|
|
|
/* Main Section */
|
|
|
|
'wikieditor-toolbar-tool-bold',
|
|
|
|
'wikieditor-toolbar-tool-bold-example',
|
|
|
|
'wikieditor-toolbar-tool-italic',
|
|
|
|
'wikieditor-toolbar-tool-italic-example',
|
|
|
|
'wikieditor-toolbar-tool-ilink',
|
|
|
|
'wikieditor-toolbar-tool-ilink-example',
|
|
|
|
'wikieditor-toolbar-tool-xlink',
|
|
|
|
'wikieditor-toolbar-tool-xlink-example',
|
|
|
|
'wikieditor-toolbar-tool-link',
|
|
|
|
'wikieditor-toolbar-tool-link-title',
|
|
|
|
'wikieditor-toolbar-tool-link-int',
|
|
|
|
'wikieditor-toolbar-tool-link-int-target',
|
|
|
|
'wikieditor-toolbar-tool-link-int-target-tooltip',
|
|
|
|
'wikieditor-toolbar-tool-link-int-text',
|
|
|
|
'wikieditor-toolbar-tool-link-int-text-tooltip',
|
|
|
|
'wikieditor-toolbar-tool-link-ext',
|
|
|
|
'wikieditor-toolbar-tool-link-ext-target',
|
|
|
|
'wikieditor-toolbar-tool-link-ext-text',
|
|
|
|
'wikieditor-toolbar-tool-link-insert',
|
|
|
|
'wikieditor-toolbar-tool-link-cancel',
|
|
|
|
'wikieditor-toolbar-tool-link-int-target-status-exists',
|
|
|
|
'wikieditor-toolbar-tool-link-int-target-status-notexists',
|
|
|
|
'wikieditor-toolbar-tool-link-int-target-status-invalid',
|
|
|
|
'wikieditor-toolbar-tool-link-int-target-status-external',
|
|
|
|
'wikieditor-toolbar-tool-link-int-target-status-loading',
|
|
|
|
'wikieditor-toolbar-tool-link-int-invalid',
|
|
|
|
'wikieditor-toolbar-tool-link-lookslikeinternal',
|
|
|
|
'wikieditor-toolbar-tool-link-lookslikeinternal-int',
|
|
|
|
'wikieditor-toolbar-tool-link-lookslikeinternal-ext',
|
|
|
|
'wikieditor-toolbar-tool-link-empty',
|
|
|
|
'wikieditor-toolbar-tool-file',
|
|
|
|
'wikieditor-toolbar-tool-file-pre',
|
|
|
|
'wikieditor-toolbar-tool-file-example',
|
|
|
|
'wikieditor-toolbar-tool-reference',
|
|
|
|
'wikieditor-toolbar-tool-reference-title',
|
|
|
|
'wikieditor-toolbar-tool-reference-cancel',
|
|
|
|
'wikieditor-toolbar-tool-reference-text',
|
|
|
|
'wikieditor-toolbar-tool-reference-insert',
|
|
|
|
'wikieditor-toolbar-tool-reference-example',
|
|
|
|
'wikieditor-toolbar-tool-signature',
|
|
|
|
/* Formatting Section */
|
|
|
|
'wikieditor-toolbar-section-advanced',
|
|
|
|
'wikieditor-toolbar-tool-heading',
|
|
|
|
'wikieditor-toolbar-tool-heading-1',
|
|
|
|
'wikieditor-toolbar-tool-heading-2',
|
|
|
|
'wikieditor-toolbar-tool-heading-3',
|
|
|
|
'wikieditor-toolbar-tool-heading-4',
|
|
|
|
'wikieditor-toolbar-tool-heading-5',
|
|
|
|
'wikieditor-toolbar-tool-heading-example',
|
|
|
|
'wikieditor-toolbar-group-format',
|
|
|
|
'wikieditor-toolbar-tool-ulist',
|
|
|
|
'wikieditor-toolbar-tool-ulist-example',
|
|
|
|
'wikieditor-toolbar-tool-olist',
|
|
|
|
'wikieditor-toolbar-tool-olist-example',
|
|
|
|
'wikieditor-toolbar-tool-indent',
|
|
|
|
'wikieditor-toolbar-tool-indent-example',
|
|
|
|
'wikieditor-toolbar-tool-nowiki',
|
|
|
|
'wikieditor-toolbar-tool-nowiki-example',
|
|
|
|
'wikieditor-toolbar-tool-redirect',
|
|
|
|
'wikieditor-toolbar-tool-redirect-example',
|
|
|
|
'wikieditor-toolbar-tool-big',
|
|
|
|
'wikieditor-toolbar-tool-big-example',
|
|
|
|
'wikieditor-toolbar-tool-small',
|
|
|
|
'wikieditor-toolbar-tool-small-example',
|
|
|
|
'wikieditor-toolbar-tool-superscript',
|
|
|
|
'wikieditor-toolbar-tool-superscript-example',
|
|
|
|
'wikieditor-toolbar-tool-subscript',
|
|
|
|
'wikieditor-toolbar-tool-subscript-example',
|
|
|
|
'wikieditor-toolbar-group-insert',
|
|
|
|
'wikieditor-toolbar-tool-gallery',
|
|
|
|
'wikieditor-toolbar-tool-gallery-example',
|
|
|
|
'wikieditor-toolbar-tool-newline',
|
|
|
|
'wikieditor-toolbar-tool-table',
|
|
|
|
'wikieditor-toolbar-tool-table-example-old',
|
|
|
|
'wikieditor-toolbar-tool-table-example-cell-text',
|
|
|
|
'wikieditor-toolbar-tool-table-example',
|
|
|
|
'wikieditor-toolbar-tool-table-example-header',
|
|
|
|
'wikieditor-toolbar-tool-table-title',
|
|
|
|
'wikieditor-toolbar-tool-table-dimensions-rows',
|
|
|
|
'wikieditor-toolbar-tool-table-dimensions-columns',
|
|
|
|
'wikieditor-toolbar-tool-table-dimensions-header',
|
|
|
|
'wikieditor-toolbar-tool-table-wikitable',
|
|
|
|
'wikieditor-toolbar-tool-table-sortable',
|
|
|
|
'wikieditor-toolbar-tool-table-insert',
|
|
|
|
'wikieditor-toolbar-tool-table-cancel',
|
|
|
|
'wikieditor-toolbar-tool-table-example-text',
|
|
|
|
'wikieditor-toolbar-tool-table-toomany',
|
|
|
|
'wikieditor-toolbar-tool-table-invalidnumber',
|
|
|
|
'wikieditor-toolbar-tool-table-zero',
|
|
|
|
'wikieditor-toolbar-tool-replace',
|
|
|
|
'wikieditor-toolbar-tool-replace-title',
|
|
|
|
'wikieditor-toolbar-tool-replace-search',
|
|
|
|
'wikieditor-toolbar-tool-replace-replace',
|
|
|
|
'wikieditor-toolbar-tool-replace-case',
|
|
|
|
'wikieditor-toolbar-tool-replace-regex',
|
|
|
|
'wikieditor-toolbar-tool-replace-button-findnext',
|
|
|
|
'wikieditor-toolbar-tool-replace-button-replacenext',
|
|
|
|
'wikieditor-toolbar-tool-replace-button-replaceall',
|
|
|
|
'wikieditor-toolbar-tool-replace-close',
|
|
|
|
'wikieditor-toolbar-tool-replace-nomatch',
|
|
|
|
'wikieditor-toolbar-tool-replace-success',
|
|
|
|
'wikieditor-toolbar-tool-replace-emptysearch',
|
|
|
|
'wikieditor-toolbar-tool-replace-invalidregex',
|
|
|
|
/* Special Characters Section */
|
|
|
|
'wikieditor-toolbar-section-characters',
|
|
|
|
'wikieditor-toolbar-characters-page-latin',
|
|
|
|
'wikieditor-toolbar-characters-page-latinextended',
|
|
|
|
'wikieditor-toolbar-characters-page-ipa',
|
|
|
|
'wikieditor-toolbar-characters-page-symbols',
|
|
|
|
'wikieditor-toolbar-characters-page-greek',
|
|
|
|
'wikieditor-toolbar-characters-page-cyrillic',
|
|
|
|
'wikieditor-toolbar-characters-page-arabic',
|
|
|
|
'wikieditor-toolbar-characters-page-persian',
|
|
|
|
'wikieditor-toolbar-characters-page-hebrew',
|
|
|
|
'wikieditor-toolbar-characters-page-bangla',
|
|
|
|
'wikieditor-toolbar-characters-page-telugu',
|
|
|
|
'wikieditor-toolbar-characters-page-sinhala',
|
|
|
|
'wikieditor-toolbar-characters-page-gujarati',
|
|
|
|
'wikieditor-toolbar-characters-page-thai',
|
|
|
|
'wikieditor-toolbar-characters-page-lao',
|
|
|
|
'wikieditor-toolbar-characters-page-khmer',
|
|
|
|
/* Help Section */
|
|
|
|
'wikieditor-toolbar-section-help',
|
|
|
|
'wikieditor-toolbar-help-heading-description',
|
|
|
|
'wikieditor-toolbar-help-heading-syntax',
|
|
|
|
'wikieditor-toolbar-help-heading-result',
|
|
|
|
'wikieditor-toolbar-help-page-format',
|
|
|
|
'wikieditor-toolbar-help-page-link',
|
|
|
|
'wikieditor-toolbar-help-page-heading',
|
|
|
|
'wikieditor-toolbar-help-page-list',
|
|
|
|
'wikieditor-toolbar-help-page-file',
|
|
|
|
'wikieditor-toolbar-help-page-reference',
|
|
|
|
'wikieditor-toolbar-help-page-discussion',
|
|
|
|
'wikieditor-toolbar-help-content-bold-description',
|
|
|
|
'wikieditor-toolbar-help-content-bold-syntax',
|
|
|
|
'wikieditor-toolbar-help-content-bold-result',
|
|
|
|
'wikieditor-toolbar-help-content-italic-description',
|
|
|
|
'wikieditor-toolbar-help-content-italic-syntax',
|
|
|
|
'wikieditor-toolbar-help-content-italic-result',
|
|
|
|
'wikieditor-toolbar-help-content-bolditalic-description',
|
|
|
|
'wikieditor-toolbar-help-content-bolditalic-syntax',
|
|
|
|
'wikieditor-toolbar-help-content-bolditalic-result',
|
|
|
|
'wikieditor-toolbar-help-content-ilink-description',
|
|
|
|
'wikieditor-toolbar-help-content-ilink-syntax',
|
|
|
|
'wikieditor-toolbar-help-content-ilink-result',
|
|
|
|
'wikieditor-toolbar-help-content-xlink-description',
|
|
|
|
'wikieditor-toolbar-help-content-xlink-syntax',
|
|
|
|
'wikieditor-toolbar-help-content-xlink-result',
|
|
|
|
'wikieditor-toolbar-help-content-heading1-description',
|
|
|
|
'wikieditor-toolbar-help-content-heading1-syntax',
|
|
|
|
'wikieditor-toolbar-help-content-heading1-result',
|
|
|
|
'wikieditor-toolbar-help-content-heading2-description',
|
|
|
|
'wikieditor-toolbar-help-content-heading2-syntax',
|
|
|
|
'wikieditor-toolbar-help-content-heading2-result',
|
|
|
|
'wikieditor-toolbar-help-content-heading3-description',
|
|
|
|
'wikieditor-toolbar-help-content-heading3-syntax',
|
|
|
|
'wikieditor-toolbar-help-content-heading3-result',
|
|
|
|
'wikieditor-toolbar-help-content-heading4-description',
|
|
|
|
'wikieditor-toolbar-help-content-heading4-syntax',
|
|
|
|
'wikieditor-toolbar-help-content-heading4-result',
|
|
|
|
'wikieditor-toolbar-help-content-heading5-description',
|
|
|
|
'wikieditor-toolbar-help-content-heading5-syntax',
|
|
|
|
'wikieditor-toolbar-help-content-heading5-result',
|
|
|
|
'wikieditor-toolbar-help-content-ulist-description',
|
|
|
|
'wikieditor-toolbar-help-content-ulist-syntax',
|
|
|
|
'wikieditor-toolbar-help-content-ulist-result',
|
|
|
|
'wikieditor-toolbar-help-content-olist-description',
|
|
|
|
'wikieditor-toolbar-help-content-olist-syntax',
|
|
|
|
'wikieditor-toolbar-help-content-olist-result',
|
|
|
|
'wikieditor-toolbar-help-content-file-description',
|
|
|
|
'wikieditor-toolbar-help-content-file-syntax',
|
|
|
|
'wikieditor-toolbar-help-content-file-result',
|
|
|
|
'wikieditor-toolbar-help-content-reference-description',
|
|
|
|
'wikieditor-toolbar-help-content-reference-syntax',
|
|
|
|
'wikieditor-toolbar-help-content-reference-result',
|
|
|
|
'wikieditor-toolbar-help-content-rereference-description',
|
|
|
|
'wikieditor-toolbar-help-content-rereference-syntax',
|
|
|
|
'wikieditor-toolbar-help-content-rereference-result',
|
|
|
|
'wikieditor-toolbar-help-content-showreferences-description',
|
|
|
|
'wikieditor-toolbar-help-content-showreferences-syntax',
|
|
|
|
'wikieditor-toolbar-help-content-showreferences-result',
|
|
|
|
'wikieditor-toolbar-help-content-signaturetimestamp-description',
|
|
|
|
'wikieditor-toolbar-help-content-signaturetimestamp-syntax',
|
|
|
|
'wikieditor-toolbar-help-content-signaturetimestamp-result',
|
|
|
|
'wikieditor-toolbar-help-content-signature-description',
|
|
|
|
'wikieditor-toolbar-help-content-signature-syntax',
|
|
|
|
'wikieditor-toolbar-help-content-signature-result',
|
|
|
|
'wikieditor-toolbar-help-content-indent-description',
|
|
|
|
'wikieditor-toolbar-help-content-indent-syntax',
|
|
|
|
'wikieditor-toolbar-help-content-indent-result',
|
|
|
|
),
|
2010-09-20 23:31:56 +00:00
|
|
|
'group' => 'ext.wikiEditor',
|
2010-09-15 22:40:50 +00:00
|
|
|
),
|
|
|
|
);
|
|
|
|
|
2010-09-16 23:41:08 +00:00
|
|
|
protected static $features = array(
|
2010-09-16 21:11:46 +00:00
|
|
|
|
|
|
|
/* Beta Features */
|
|
|
|
|
|
|
|
'toolbar' => array(
|
|
|
|
'preferences' => array(
|
|
|
|
// Ideally this key would be 'wikieditor-toolbar'
|
|
|
|
'usebetatoolbar' => array(
|
|
|
|
'type' => 'toggle',
|
|
|
|
'label-message' => 'wikieditor-toolbar-preference',
|
|
|
|
'section' => 'editing/beta',
|
|
|
|
),
|
|
|
|
),
|
|
|
|
'requirements' => array(
|
|
|
|
'usebetatoolbar' => true,
|
|
|
|
),
|
|
|
|
'modules' => array(
|
2010-09-20 20:06:18 +00:00
|
|
|
'ext.wikiEditor.toolbar',
|
2010-09-16 21:11:46 +00:00
|
|
|
),
|
|
|
|
),
|
|
|
|
'dialogs' => array(
|
|
|
|
'preferences' => array(
|
|
|
|
// Ideally this key would be 'wikieditor-toolbar-dialogs'
|
|
|
|
'usebetatoolbar-cgd' => array(
|
|
|
|
'type' => 'toggle',
|
|
|
|
'label-message' => 'wikieditor-toolbar-dialogs-preference',
|
|
|
|
'section' => 'editing/beta',
|
|
|
|
),
|
|
|
|
),
|
|
|
|
'requirements' => array(
|
|
|
|
'usebetatoolbar-cgd' => true,
|
|
|
|
),
|
|
|
|
'modules' => array(
|
2010-09-20 20:06:18 +00:00
|
|
|
'ext.wikiEditor.dialogs',
|
2010-09-16 21:11:46 +00:00
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
/* Labs Features */
|
|
|
|
|
2010-09-15 22:40:50 +00:00
|
|
|
'templateEditor' => array(
|
2010-09-16 21:11:46 +00:00
|
|
|
'preferences' => array(
|
|
|
|
'wikieditor-template-editor' => array(
|
2010-09-15 22:40:50 +00:00
|
|
|
'type' => 'toggle',
|
|
|
|
'label-message' => 'wikieditor-template-editor-preference',
|
|
|
|
'section' => 'editing/labs',
|
|
|
|
),
|
|
|
|
),
|
2010-09-16 21:11:46 +00:00
|
|
|
'requirements' => array(
|
|
|
|
'wikieditor-template-editor' => true,
|
|
|
|
),
|
|
|
|
'modules' => array(
|
2010-09-20 20:06:18 +00:00
|
|
|
'ext.wikiEditor.templateEditor',
|
2010-09-16 21:11:46 +00:00
|
|
|
),
|
2010-09-15 22:40:50 +00:00
|
|
|
),
|
|
|
|
'templates' => array(
|
2010-09-16 21:11:46 +00:00
|
|
|
'preferences' => array(
|
|
|
|
'wikieditor-templates' => array(
|
2010-09-15 22:40:50 +00:00
|
|
|
'type' => 'toggle',
|
|
|
|
'label-message' => 'wikieditor-templates-preference',
|
|
|
|
'section' => 'editing/labs',
|
|
|
|
),
|
|
|
|
),
|
2010-09-16 21:11:46 +00:00
|
|
|
'requirements' => array(
|
|
|
|
'wikieditor-templates' => true,
|
|
|
|
),
|
|
|
|
'modules' => array(
|
2010-09-20 20:06:18 +00:00
|
|
|
'ext.wikiEditor.templates',
|
2010-09-16 21:11:46 +00:00
|
|
|
),
|
2010-09-15 22:40:50 +00:00
|
|
|
),
|
|
|
|
'addMediaWizard' => array(
|
2010-09-16 21:11:46 +00:00
|
|
|
'preferences' => array(
|
|
|
|
'addmediawizard-gadget' => array(
|
2010-09-15 22:40:50 +00:00
|
|
|
'type' => 'toggle',
|
|
|
|
'label-message' => 'wikieditor-addMediaWizard-preference',
|
|
|
|
'section' => 'editing/labs',
|
|
|
|
),
|
|
|
|
),
|
2010-09-16 21:11:46 +00:00
|
|
|
'requirements' => array(
|
|
|
|
'addmediawizard-gadget' => true,
|
|
|
|
),
|
|
|
|
'modules' => array(
|
2010-09-20 20:06:18 +00:00
|
|
|
'ext.wikiEditor.addMediaWizard',
|
2010-09-16 21:11:46 +00:00
|
|
|
),
|
2010-09-15 22:40:50 +00:00
|
|
|
),
|
|
|
|
'preview' => array(
|
2010-09-16 21:11:46 +00:00
|
|
|
'preferences' => array(
|
|
|
|
'wikieditor-preview' => array(
|
2010-09-15 22:40:50 +00:00
|
|
|
'type' => 'toggle',
|
|
|
|
'label-message' => 'wikieditor-preview-preference',
|
|
|
|
'section' => 'editing/labs',
|
|
|
|
),
|
|
|
|
),
|
2010-09-16 21:11:46 +00:00
|
|
|
'requirements' => array(
|
|
|
|
'wikieditor-preview' => true,
|
|
|
|
),
|
|
|
|
'modules' => array(
|
2010-09-20 20:06:18 +00:00
|
|
|
'ext.wikiEditor.preview',
|
2010-09-15 22:40:50 +00:00
|
|
|
),
|
|
|
|
),
|
|
|
|
'previewDialog' => array(
|
2010-09-16 21:11:46 +00:00
|
|
|
'preferences' => array(
|
|
|
|
'wikieditor-previewDialog' => array(
|
2010-09-15 22:40:50 +00:00
|
|
|
'type' => 'toggle',
|
|
|
|
'label-message' => 'wikieditor-previewDialog-preference',
|
|
|
|
'section' => 'editing/labs',
|
|
|
|
),
|
|
|
|
),
|
2010-09-16 21:11:46 +00:00
|
|
|
'requirements' => array(
|
|
|
|
'wikieditor-previewDialog' => true,
|
|
|
|
),
|
|
|
|
'modules' => array(
|
2010-09-20 20:06:18 +00:00
|
|
|
'ext.wikiEditor.previewDialog',
|
2010-09-16 21:11:46 +00:00
|
|
|
),
|
2010-09-15 22:40:50 +00:00
|
|
|
),
|
|
|
|
'publish' => array(
|
2010-09-16 21:11:46 +00:00
|
|
|
'preferences' => array(
|
|
|
|
'wikieditor-publish' => array(
|
2010-09-15 22:40:50 +00:00
|
|
|
'type' => 'toggle',
|
|
|
|
'label-message' => 'wikieditor-publish-preference',
|
|
|
|
'section' => 'editing/labs',
|
|
|
|
),
|
|
|
|
),
|
2010-09-16 21:11:46 +00:00
|
|
|
'requirements' => array(
|
|
|
|
'wikieditor-publish' => true,
|
|
|
|
),
|
|
|
|
'modules' => array(
|
2010-09-20 20:06:18 +00:00
|
|
|
'ext.wikiEditor.publish',
|
2010-09-16 21:11:46 +00:00
|
|
|
),
|
2010-09-15 22:40:50 +00:00
|
|
|
),
|
|
|
|
'toc' => array(
|
2010-09-16 21:11:46 +00:00
|
|
|
'preferences' => array(
|
2010-09-15 22:40:50 +00:00
|
|
|
// Ideally this key would be 'wikieditor-toc'
|
2010-09-16 21:11:46 +00:00
|
|
|
'usenavigabletoc' => array(
|
2010-09-15 22:40:50 +00:00
|
|
|
'type' => 'toggle',
|
|
|
|
'label-message' => 'wikieditor-toc-preference',
|
|
|
|
'section' => 'editing/labs',
|
|
|
|
),
|
|
|
|
),
|
2010-09-16 21:11:46 +00:00
|
|
|
'requirements' => array(
|
|
|
|
'usenavigabletoc' => true,
|
|
|
|
),
|
|
|
|
'modules' => array(
|
2010-09-20 20:06:18 +00:00
|
|
|
'ext.wikiEditor.toc',
|
2010-09-16 21:11:46 +00:00
|
|
|
),
|
2010-09-15 22:40:50 +00:00
|
|
|
),
|
|
|
|
);
|
|
|
|
|
|
|
|
/* Protected Static Methods */
|
|
|
|
|
2010-09-16 21:11:46 +00:00
|
|
|
protected static function isEnabled( $name ) {
|
|
|
|
global $wgWikiEditorFeatures, $wgUser;
|
2010-09-15 22:40:50 +00:00
|
|
|
|
2010-09-16 22:40:24 +00:00
|
|
|
// Features with global set to true are always enabled
|
2010-09-16 21:11:46 +00:00
|
|
|
if ( !isset( $wgWikiEditorFeatures[$name] ) || $wgWikiEditorFeatures[$name]['global'] ) {
|
|
|
|
return true;
|
2010-09-15 22:40:50 +00:00
|
|
|
}
|
2010-09-16 21:11:46 +00:00
|
|
|
// Features with user preference control can have any number of preferences to be specific values to be enabled
|
|
|
|
if ( $wgWikiEditorFeatures[$name]['user'] ) {
|
|
|
|
if ( isset( self::$features[$name]['requirements'] ) ) {
|
|
|
|
foreach ( self::$features[$name]['requirements'] as $requirement => $value ) {
|
|
|
|
// Important! We really do want fuzzy evaluation here
|
|
|
|
if ( $wgUser->getOption( $requirement ) != $value ) {
|
|
|
|
return false;
|
|
|
|
}
|
2010-09-15 22:40:50 +00:00
|
|
|
}
|
|
|
|
}
|
2010-09-16 21:11:46 +00:00
|
|
|
return true;
|
2010-09-15 22:40:50 +00:00
|
|
|
}
|
2010-09-16 21:11:46 +00:00
|
|
|
// Features controlled by $wgWikiEditorFeatures with both global and user set to false are awlways disabled
|
|
|
|
return false;
|
2010-09-15 22:40:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Static Methods */
|
|
|
|
|
|
|
|
/**
|
2010-09-16 21:11:46 +00:00
|
|
|
* EditPage::showEditForm:initial hook
|
2010-09-15 22:40:50 +00:00
|
|
|
*
|
|
|
|
* Adds the modules to the edit form
|
|
|
|
*
|
2010-09-16 23:41:08 +00:00
|
|
|
* @param $toolbar array list of toolbar items
|
2010-09-15 22:40:50 +00:00
|
|
|
*/
|
2010-09-16 21:11:46 +00:00
|
|
|
public static function editPageShowEditFormInitial( &$toolbar ) {
|
|
|
|
global $wgOut;
|
2010-09-15 22:40:50 +00:00
|
|
|
|
2010-09-16 21:11:46 +00:00
|
|
|
// Add modules for enabled features
|
|
|
|
foreach ( self::$features as $name => $feature ) {
|
|
|
|
if ( isset( $feature['modules'] ) && self::isEnabled( $name ) ) {
|
|
|
|
$wgOut->addModules( $feature['modules'] );
|
2010-09-15 22:40:50 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* GetPreferences hook
|
|
|
|
*
|
2010-10-01 18:15:10 +00:00
|
|
|
* Adds WikiEditor-releated items to the preferences
|
2010-09-15 22:40:50 +00:00
|
|
|
*
|
|
|
|
* @param $out User current user
|
|
|
|
* @param $skin array list of default user preference controls
|
|
|
|
*/
|
|
|
|
public static function getPreferences( $user, &$defaultPreferences ) {
|
2010-09-16 21:11:46 +00:00
|
|
|
global $wgWikiEditorFeatures;
|
2010-09-15 22:40:50 +00:00
|
|
|
|
2010-09-16 21:11:46 +00:00
|
|
|
foreach ( self::$features as $name => $feature ) {
|
|
|
|
if (
|
|
|
|
isset( $feature['preferences'] ) &&
|
|
|
|
( !isset( $wgWikiEditorFeatures[$name] ) || $wgWikiEditorFeatures[$name]['user'] )
|
|
|
|
) {
|
2010-10-01 19:14:33 +00:00
|
|
|
foreach ( $feature['preferences'] as $key => $options ) {
|
|
|
|
$defaultPreferences[$key] = $options;
|
|
|
|
}
|
2010-09-15 22:40:50 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* MakeGlobalVariablesScript hook
|
|
|
|
*
|
2010-10-01 18:15:10 +00:00
|
|
|
* Adds enabled/disabled switches for WikiEditor modules
|
2010-09-15 22:40:50 +00:00
|
|
|
*/
|
|
|
|
public static function makeGlobalVariablesScript( &$vars ) {
|
2010-09-16 21:11:46 +00:00
|
|
|
global $wgWikiEditorFeatures;
|
2010-09-15 22:40:50 +00:00
|
|
|
|
|
|
|
$configurations = array();
|
2010-09-16 21:11:46 +00:00
|
|
|
foreach ( self::$features as $name => $feature ) {
|
2010-09-15 22:40:50 +00:00
|
|
|
if (
|
2010-09-16 21:11:46 +00:00
|
|
|
isset( $feature['configurations'] ) &&
|
|
|
|
( !isset( $wgWikiEditorFeatures[$name] ) || self::isEnabled( $name ) )
|
2010-09-15 22:40:50 +00:00
|
|
|
) {
|
2010-09-16 21:11:46 +00:00
|
|
|
foreach ( $feature['configurations'] as $configuration ) {
|
2010-09-15 22:40:50 +00:00
|
|
|
global $$configuration;
|
|
|
|
$configurations[$configuration] = $$configuration;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ( count( $configurations ) ) {
|
|
|
|
$vars = array_merge( $vars, $configurations );
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* ResourceLoaderRegisterModules hook
|
|
|
|
*
|
|
|
|
* Adds modules to ResourceLoader
|
|
|
|
*/
|
2010-09-29 19:04:04 +00:00
|
|
|
public static function resourceLoaderRegisterModules( &$resourceLoader ) {
|
2010-10-27 22:22:10 +00:00
|
|
|
global $wgExtensionAssetsPath;
|
|
|
|
$localpath = dirname( __FILE__ ) . '/modules';
|
|
|
|
$remotepath = "$wgExtensionAssetsPath/WikiEditor/modules";
|
2010-09-16 21:11:46 +00:00
|
|
|
foreach ( self::$modules as $name => $resources ) {
|
2010-10-07 23:31:30 +00:00
|
|
|
$resourceLoader->register(
|
2010-10-27 22:22:10 +00:00
|
|
|
$name, new ResourceLoaderFileModule( $resources, $localpath, $remotepath )
|
2010-10-07 23:31:30 +00:00
|
|
|
);
|
2010-09-15 22:40:50 +00:00
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|