Got more dialogs working again

This commit is contained in:
Trevor Parscal 2010-10-04 21:08:41 +00:00
parent 0a71513db4
commit cb6ff96431
6 changed files with 1118 additions and 1126 deletions

View file

@ -28,7 +28,6 @@ class WikiEditorHooks {
'jquery.client',
'jquery.textSelection',
'jquery.delayedBind',
'contentCollector',
),
'messages' => array(
'wikieditor-wikitext-tab',
@ -38,7 +37,10 @@ class WikiEditorHooks {
),
'jquery.wikiEditor.iframe' => array(
'scripts' => 'extensions/WikiEditor/modules/jquery.wikiEditor.iframe.js',
'dependencies' => 'jquery.wikiEditor',
'dependencies' => array(
'jquery.wikiEditor',
'contentCollector',
),
'group' => 'ext.wikiEditor',
),
'jquery.wikiEditor.dialogs' => array(
@ -137,7 +139,8 @@ class WikiEditorHooks {
'dependencies' => array(
'ext.wikiEditor',
'ext.wikiEditor.toolbar',
// jquery.wikiEditor.dialogs and jquery.suggestions will be loaded on the fly
'jquery.wikiEditor.dialogs',
'jquery.suggestions',
),
'group' => 'ext.wikiEditor',
),
@ -197,6 +200,7 @@ class WikiEditorHooks {
'scripts' => 'extensions/WikiEditor/modules/ext.wikiEditor.templateEditor.js',
'dependencies' => array(
'ext.wikiEditor',
'ext.wikiEditor.highlight',
'jquery.wikiEditor.templateEditor',
),
'messages' => array(
@ -210,6 +214,7 @@ class WikiEditorHooks {
'scripts' => 'extensions/WikiEditor/modules/ext.wikiEditor.templates.js',
'dependencies' => array(
'ext.wikiEditor',
'ext.wikiEditor.highlight',
'jquery.wikiEditor.templates',
),
'group' => 'ext.wikiEditor',
@ -218,6 +223,7 @@ class WikiEditorHooks {
'scripts' => 'extensions/WikiEditor/modules/ext.wikiEditor.toc.js',
'dependencies' => array(
'ext.wikiEditor',
'ext.wikiEditor.highlight',
'jquery.wikiEditor.toc',
),
'messages' => array(
@ -478,21 +484,6 @@ class WikiEditorHooks {
/* Labs Features */
'highlight' => array(
'preferences' => array(
'wikieditor-highlight' => array(
'type' => 'toggle',
'label-message' => 'wikieditor-highlight-preference',
'section' => 'editing/labs',
),
),
'requirements' => array(
'wikieditor-highlight' => true,
),
'modules' => array(
'ext.wikiEditor.highlight',
),
),
'templateEditor' => array(
'preferences' => array(
'wikieditor-template-editor' => array(

View file

@ -22,8 +22,6 @@ $messages['en'] = array(
'wikieditor-loading' => 'Loading',
/* AddMediaWizard */
'wikieditor-addMediaWizard-preference' => 'Enable "Add media wizard" gadget',
/* Highlight */
'wikieditor-highlight-preference' => 'Enable syntax highlighting when editing',
/* Preview */
'wikieditor-preview-preference' => 'Enable side-by-side preview',
'wikieditor-preview-tab' => 'Preview',

View file

@ -26,20 +26,18 @@ $wgWikiEditorFeatures = array(
// Adds a tab for previewing in-line
'preview' => array( 'global' => false, 'user' => true ),
// Adds a button for previewing in a dialog
'previewDialog' => array( 'global' => false, 'user' => true ),
'previewDialog' => array( 'global' => false, 'user' => false ),
// Adds a button and dialog for step-by-step publishing
'publish' => array( 'global' => false, 'user' => true ),
/* I-frame dependent (do not deploy!) */
// Experimental wikitext parsing/syntax highlight
'highlight' => array( 'global' => false, 'user' => true ),
// Failry stable table of contents
'toc' => array( 'global' => false, 'user' => true ),
// Pretty broken template collapsing/editing
'templateEditor' => array( 'global' => false, 'user' => true ),
'templateEditor' => array( 'global' => false, 'user' => false ),
// Bare-bones (probably broken) template collapsing
'templates' => array( 'global' => false, 'user' => true ),
'templates' => array( 'global' => false, 'user' => false ),
/* Unknown status */

View file

@ -3,15 +3,17 @@
*/
$( document ).ready( function() {
/*
if ( !$.wikiEditor.isSupported( $.wikiEditor.modules.dialogs ) ) {
return;
}
mediaWiki.loader.using( [ 'jquery.wikiEditor.dialogs', 'jquery.suggestions' ], function() {
*/
// Replace icons
$( '#wpTextbox1' )
.wikiEditor( 'removeFromToolbar', { 'section': 'main', 'group': 'insert', 'tool': 'xlink' } )
.wikiEditor( 'removeFromToolbar', { 'section': 'main', 'group': 'insert', 'tool': 'ilink' } )
.wikiEditor( 'removeFromToolbar', { 'section': 'main', 'group': 'insert', 'tool': 'reference' } )
.wikiEditor( 'removeFromToolbar', { 'section': 'advanced', 'group': 'insert', 'tool': 'table' } )
.wikiEditor( 'addToToolbar', {
'section': 'main',
'group': 'insert',
@ -37,12 +39,46 @@ $( document ).ready( function() {
}
}
}
} )
.wikiEditor( 'addToToolbar', {
'section': 'advanced',
'group': 'insert',
'tools': {
'table': {
'labelMsg': 'wikieditor-toolbar-tool-table',
'type': 'button',
'icon': 'insert-table.png',
'offset': [2, -1942],
'action': {
'type': 'dialog',
'module': 'insert-table'
}
}
}
} )
.wikiEditor( 'addToToolbar', {
'section': 'advanced',
'groups': {
'search': {
'tools': {
'replace': {
'labelMsg': 'wikieditor-toolbar-tool-replace',
'type': 'button',
'icon': 'search-replace.png',
'offset': [-70, -214],
'action': {
'type': 'dialog',
'module': 'search-and-replace'
}
}
}
}
}
} );
// Add dialogs module
$( '#wpTextbox1' ).wikiEditor( 'addModule', { 'dialogs': {
'insert-link': {
filters: [ '#wpTextbox1.toolbar-dialogs' ],
titleMsg: 'wikieditor-toolbar-tool-link-title',
id: 'wikieditor-toolbar-link-dialog',
html: '\
@ -566,7 +602,6 @@ $( document ).ready( function() {
}
},
'insert-reference': {
filters: [ '#wpTextbox1.toolbar-dialogs' ],
titleMsg: 'wikieditor-toolbar-tool-reference-title',
id: 'wikieditor-toolbar-reference-dialog',
html: '\
@ -664,7 +699,6 @@ $( document ).ready( function() {
}
},
'insert-table': {
filters: [ '#wpTextbox1.toolbar-dialogs' ],
titleMsg: 'wikieditor-toolbar-tool-table-title',
id: 'wikieditor-toolbar-table-dialog',
// FIXME: Localize 'x'?
@ -775,7 +809,6 @@ $( document ).ready( function() {
.get( 0 )
);
});
},
dialog: {
resizable: false,
@ -897,7 +930,6 @@ $( document ).ready( function() {
'chrome': [['>=', 3]]
}
},
filters: [ '#wpTextbox1.toolbar-dialogs' ],
titleMsg: 'wikieditor-toolbar-tool-replace-title',
id: 'wikieditor-toolbar-replace-dialog',
html: '\
@ -1113,5 +1145,4 @@ $( document ).ready( function() {
}
}
} } );
} );
} );

View file

@ -415,17 +415,6 @@ $( document ).ready( function() {
}
}
},
'tableCGD': {
'labelMsg': 'wikieditor-toolbar-tool-table',
'type': 'button',
'icon': 'insert-table.png',
'offset': [2, -1942],
'filters': [ '#wpTextbox1.toolbar-dialogs' ],
'action': {
'type': 'dialog',
'module': 'insert-table'
}
},
'table': {
'labelMsg': 'wikieditor-toolbar-tool-table',
'type': 'button',
@ -458,21 +447,6 @@ $( document ).ready( function() {
}
}
}
},
'search': {
'tools': {
'replace': {
'labelMsg': 'wikieditor-toolbar-tool-replace',
'type': 'button',
'icon': 'search-replace.png',
'offset': [-70, -214],
'filters': [ '#wpTextbox1.toolbar-dialogs' ],
'action': {
'type': 'dialog',
'module': 'search-and-replace'
}
}
}
}
}
},

View file

@ -59,7 +59,7 @@ api : {
);
for ( tool in data[type] ) {
// Tool
$group.append( $.wikiEditor.modules.toolbar.fn.buildTool( context, tool,data[type][tool] ) );
$group.append( $.wikiEditor.modules.toolbar.fn.buildTool( context, tool, data[type][tool] ) );
}
if ( $group.children().length ) {
$group.show();