* Fixed the toolbar, where sprited buttons weren't receiving the correct classes.

* Changed the way dialogs toolbar buttons were being added
* Made dialog code load on the fly
This commit is contained in:
Trevor Parscal 2010-10-01 21:58:04 +00:00
parent ddf6b59294
commit 0a0f6f6e8e
4 changed files with 1070 additions and 1081 deletions

View file

@ -43,6 +43,7 @@ class WikiEditorHooks {
'jquery.wikiEditor',
'jquery.wikiEditor.toolbar',
'jquery.ui.dialog',
'jquery.ui.button',
'jquery.ui.draggable',
'jquery.ui.resizable',
'jquery.tabIndex',
@ -122,8 +123,8 @@ class WikiEditorHooks {
'styles' => 'extensions/WikiEditor/modules/ext.wikiEditor.dialogs.css',
'dependencies' => array(
'ext.wikiEditor',
'jquery.wikiEditor.dialogs',
'jquery.suggestions',
'ext.wikiEditor.toolbar',
// jquery.wikiEditor.dialogs and jquery.suggestions will be loaded on the fly
),
'group' => 'ext.wikiEditor',
),

File diff suppressed because it is too large Load diff

View file

@ -120,7 +120,6 @@ $( document ).ready( function() {
'type': 'button',
'icon': 'insert-xlink.png',
'offset': [-70, 2],
'filters': [ '#wpTextbox1:not(.toolbar-dialogs)' ],
'action': {
'type': 'encapsulate',
'options': {
@ -135,7 +134,6 @@ $( document ).ready( function() {
'type': 'button',
'icon': 'insert-ilink.png',
'offset': [2, -1582],
'filters': [ '#wpTextbox1:not(.toolbar-dialogs)' ],
'action': {
'type': 'encapsulate',
'options': {
@ -145,17 +143,6 @@ $( document ).ready( function() {
}
}
},
'linkCGD': {
'labelMsg': 'wikieditor-toolbar-tool-link',
'type': 'button',
'icon': 'insert-link.png',
'offset': [2, -1654],
'filters': [ '#wpTextbox1.toolbar-dialogs' ],
'action': {
'type': 'dialog',
'module': 'insert-link'
}
},
'file': {
'labelMsg': 'wikieditor-toolbar-tool-file',
'type': 'button',
@ -171,20 +158,8 @@ $( document ).ready( function() {
}
}
},
'referenceCGD': {
'labelMsg': 'wikieditor-toolbar-tool-reference',
'type': 'button',
'icon': 'insert-reference.png',
'offset': [2, -1798],
'filters': [ 'body.ns-subject', '#wpTextbox1.toolbar-dialogs' ],
'action': {
'type': 'dialog',
'module': 'insert-reference'
}
},
'reference': {
'labelMsg': 'wikieditor-toolbar-tool-reference',
'filters': [ 'body.ns-subject', '#wpTextbox1:not(.toolbar-dialogs)' ],
'type': 'button',
'offset': [2, -1798],
'icon': 'insert-reference.png',

View file

@ -142,7 +142,7 @@ api : {
// Save for later checking if empty
group = target;
// Tool
target += ' div[rel=' + data.tool + '].tool';
target += ' span[rel=' + data.tool + '].tool';
}
} else if ( typeof data.page == 'string' ) {
// Booklet page
@ -327,7 +327,7 @@ fn: {
'alt' : label,
'title' : label,
'rel' : id,
'class' : 'wikiEditor-toolbar-spritedButton'
'class' : 'tool tool-button wikiEditor-toolbar-spritedButton'
} )
.text( label )
.css( 'backgroundPosition', offsetOrIcon[0] + 'px ' + offsetOrIcon[1] + 'px' );
@ -362,17 +362,6 @@ fn: {
e.preventDefault();
return false;
} );
// If the action is a dialog that hasn't been set up yet, hide the button
// until the dialog is loaded
if ( tool.action.type == 'dialog' &&
!( tool.action.module in $.wikiEditor.modules.dialogs.modules ) ) {
$button.hide();
// JavaScript won't propagate the $button variable itself, it needs help
context.$textarea.bind( 'wikiEditor-dialogs-setup-' + tool.action.module,
{ button: $button }, function( event ) {
event.data.button.show().parent().show();
} );
}
}
return $button;
case 'select':