Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
ckeditor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
vanilla ckeditor-3.6.3
[ckeditor.git]
/
_source
/
plugins
/
dialogui
/
plugin.js
diff --git
a/_source/plugins/dialogui/plugin.js
b/_source/plugins/dialogui/plugin.js
index
6446fe4
..
963c80c
100644
(file)
--- a/
_source/plugins/dialogui/plugin.js
+++ b/
_source/plugins/dialogui/plugin.js
@@
-1,5
+1,5
@@
/*
\r
/*
\r
-Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
\r
+Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
\r
For licensing, see LICENSE.html or http://ckeditor.com/license
\r
*/
\r
\r
For licensing, see LICENSE.html or http://ckeditor.com/license
\r
*/
\r
\r
@@
-124,7
+124,7
@@
CKEDITOR.plugins.add( 'dialogui' );
* @extends CKEDITOR.ui.dialog.uiElement
\r
* @param {CKEDITOR.dialog} dialog
\r
* Parent dialog object.
\r
* @extends CKEDITOR.ui.dialog.uiElement
\r
* @param {CKEDITOR.dialog} dialog
\r
* Parent dialog object.
\r
- * @param {CKEDITOR.dialog.uiElementDefinition} elementDefinition
\r
+ * @param {CKEDITOR.dialog.definition.uiElement} elementDefinition
\r
* The element definition. Accepted fields:
\r
* <ul>
\r
* <li><strong>label</strong> (Required) The label string.</li>
\r
* The element definition. Accepted fields:
\r
* <ul>
\r
* <li><strong>label</strong> (Required) The label string.</li>
\r
@@
-158,10
+158,10
@@
CKEDITOR.plugins.add( 'dialogui' );
html.push( '<label class="cke_dialog_ui_labeled_label' + requiredClass + '" ',
\r
' id="'+ _.labelId + '"',
\r
' for="' + _.inputId + '"',
\r
html.push( '<label class="cke_dialog_ui_labeled_label' + requiredClass + '" ',
\r
' id="'+ _.labelId + '"',
\r
' for="' + _.inputId + '"',
\r
- ' style="' + elementDefinition.labelStyle + '">',
\r
+ ( elementDefinition.labelStyle ? ' style="' + elementDefinition.labelStyle + '"' : '' ) +'>',
\r
elementDefinition.label,
\r
'</label>',
\r
elementDefinition.label,
\r
'</label>',
\r
- '<div class="cke_dialog_ui_labeled_content" role="presentation">',
\r
+ '<div class="cke_dialog_ui_labeled_content"' + ( elementDefinition.controlStyle ? ' style="' + elementDefinition.controlStyle + '"' : '' ) + ' role="presentation">',
\r
contentHtml.call( this, dialog, elementDefinition ),
\r
'</div>' );
\r
else
\r
contentHtml.call( this, dialog, elementDefinition ),
\r
'</div>' );
\r
else
\r
@@
-177,13
+177,13
@@
CKEDITOR.plugins.add( 'dialogui' );
html : '<label class="cke_dialog_ui_labeled_label' + requiredClass + '"' +
\r
' id="' + _.labelId + '"' +
\r
' for="' + _.inputId + '"' +
\r
html : '<label class="cke_dialog_ui_labeled_label' + requiredClass + '"' +
\r
' id="' + _.labelId + '"' +
\r
' for="' + _.inputId + '"' +
\r
- ' style="' + elementDefinition.labelStyle + '">' +
\r
+ ( elementDefinition.labelStyle ? ' style="' + elementDefinition.labelStyle + '"' : '' ) +'>' +
\r
CKEDITOR.tools.htmlEncode( elementDefinition.label ) +
\r
'</span>'
\r
},
\r
{
\r
type : 'html',
\r
CKEDITOR.tools.htmlEncode( elementDefinition.label ) +
\r
'</span>'
\r
},
\r
{
\r
type : 'html',
\r
- html : '<span class="cke_dialog_ui_labeled_content">' +
\r
+ html : '<span class="cke_dialog_ui_labeled_content"' + ( elementDefinition.controlStyle ? ' style="' + elementDefinition.controlStyle + '"' : '' ) + '>' +
\r
contentHtml.call( this, dialog, elementDefinition ) +
\r
'</span>'
\r
}
\r
contentHtml.call( this, dialog, elementDefinition ) +
\r
'</span>'
\r
}
\r
@@
-204,7
+204,7
@@
CKEDITOR.plugins.add( 'dialogui' );
* @extends CKEDITOR.ui.dialog.labeledElement
\r
* @param {CKEDITOR.dialog} dialog
\r
* Parent dialog object.
\r
* @extends CKEDITOR.ui.dialog.labeledElement
\r
* @param {CKEDITOR.dialog} dialog
\r
* Parent dialog object.
\r
- * @param {CKEDITOR.dialog.uiElementDefinition} elementDefinition
\r
+ * @param {CKEDITOR.dialog.definition.uiElement} elementDefinition
\r
* The element definition. Accepted fields:
\r
* <ul>
\r
* <li><strong>default</strong> (Optional) The default value.</li>
\r
* The element definition. Accepted fields:
\r
* <ul>
\r
* <li><strong>default</strong> (Optional) The default value.</li>
\r
@@
-224,7
+224,7
@@
CKEDITOR.plugins.add( 'dialogui' );
\r
initPrivateObject.call( this, elementDefinition );
\r
var domId = this._.inputId = CKEDITOR.tools.getNextId() + '_textInput',
\r
\r
initPrivateObject.call( this, elementDefinition );
\r
var domId = this._.inputId = CKEDITOR.tools.getNextId() + '_textInput',
\r
- attributes = { 'class' : 'cke_dialog_ui_input_' + elementDefinition.type, id : domId, type : 'text' },
\r
+ attributes = { 'class' : 'cke_dialog_ui_input_' + elementDefinition.type, id : domId, type : elementDefinition.type },
\r
i;
\r
\r
// Set the validator, if any.
\r
i;
\r
\r
// Set the validator, if any.
\r
@@
-237,8
+237,8
@@
CKEDITOR.plugins.add( 'dialogui' );
if ( elementDefinition.size )
\r
attributes.size = elementDefinition.size;
\r
\r
if ( elementDefinition.size )
\r
attributes.size = elementDefinition.size;
\r
\r
- if ( elementDefinition.controlStyle )
\r
- attributes.style = elementDefinition.controlStyle;
\r
+ if ( elementDefinition.inputStyle )
\r
+ attributes.style = elementDefinition.inputStyle;
\r
\r
// If user presses Enter in a text box, it implies clicking OK for the dialog.
\r
var me = this, keyPressedOnMe = false;
\r
\r
// If user presses Enter in a text box, it implies clicking OK for the dialog.
\r
var me = this, keyPressedOnMe = false;
\r
@@
-293,7
+293,7
@@
CKEDITOR.plugins.add( 'dialogui' );
* @example
\r
* @param {CKEDITOR.dialog} dialog
\r
* Parent dialog object.
\r
* @example
\r
* @param {CKEDITOR.dialog} dialog
\r
* Parent dialog object.
\r
- * @param {CKEDITOR.dialog.uiElementDefinition} elementDefinition
\r
+ * @param {CKEDITOR.dialog.definition.uiElement} elementDefinition
\r
* The element definition. Accepted fields:
\r
* <ul>
\r
* <li><strong>rows</strong> (Optional) The number of rows displayed.
\r
* The element definition. Accepted fields:
\r
* <ul>
\r
* <li><strong>rows</strong> (Optional) The number of rows displayed.
\r
@@
-323,6
+323,10
@@
CKEDITOR.plugins.add( 'dialogui' );
attributes.rows = elementDefinition.rows || 5;
\r
attributes.cols = elementDefinition.cols || 20;
\r
\r
attributes.rows = elementDefinition.rows || 5;
\r
attributes.cols = elementDefinition.cols || 20;
\r
\r
+ if ( typeof elementDefinition.inputStyle != 'undefined' )
\r
+ attributes.style = elementDefinition.inputStyle;
\r
+
\r
+
\r
/** @ignore */
\r
var innerHTML = function()
\r
{
\r
/** @ignore */
\r
var innerHTML = function()
\r
{
\r
@@
-344,7
+348,7
@@
CKEDITOR.plugins.add( 'dialogui' );
* @example
\r
* @param {CKEDITOR.dialog} dialog
\r
* Parent dialog object.
\r
* @example
\r
* @param {CKEDITOR.dialog} dialog
\r
* Parent dialog object.
\r
- * @param {CKEDITOR.dialog.uiElementDefinition} elementDefinition
\r
+ * @param {CKEDITOR.dialog.definition.uiElement} elementDefinition
\r
* The element definition. Accepted fields:
\r
* <ul>
\r
* <li><strong>checked</strong> (Optional) Whether the checkbox is checked
\r
* The element definition. Accepted fields:
\r
* <ul>
\r
* <li><strong>checked</strong> (Optional) Whether the checkbox is checked
\r
@@
-380,11
+384,11
@@
CKEDITOR.plugins.add( 'dialogui' );
if ( elementDefinition[ 'default' ] )
\r
attributes.checked = 'checked';
\r
\r
if ( elementDefinition[ 'default' ] )
\r
attributes.checked = 'checked';
\r
\r
- if ( typeof myDefinition.controlStyle != 'undefined' )
\r
- myDefinition.style = myDefinition.controlStyle;
\r
+ if ( typeof myDefinition.inputStyle != 'undefined' )
\r
+ myDefinition.style = myDefinition.inputStyle;
\r
\r
_.checkbox = new CKEDITOR.ui.dialog.uiElement( dialog, myDefinition, html, 'input', null, attributes );
\r
\r
_.checkbox = new CKEDITOR.ui.dialog.uiElement( dialog, myDefinition, html, 'input', null, attributes );
\r
- html.push( ' <label id="', labelId, '" for="', attributes.id, '">',
\r
+ html.push( ' <label id="', labelId, '" for="', attributes.id, '"' + ( elementDefinition.labelStyle ? ' style="' + elementDefinition.labelStyle + '"' : '' ) + '>',
\r
CKEDITOR.tools.htmlEncode( elementDefinition.label ),
\r
'</label>' );
\r
return html.join( '' );
\r
CKEDITOR.tools.htmlEncode( elementDefinition.label ),
\r
'</label>' );
\r
return html.join( '' );
\r
@@
-400,7
+404,7
@@
CKEDITOR.plugins.add( 'dialogui' );
* @extends CKEDITOR.ui.dialog.labeledElement
\r
* @param {CKEDITOR.dialog} dialog
\r
* Parent dialog object.
\r
* @extends CKEDITOR.ui.dialog.labeledElement
\r
* @param {CKEDITOR.dialog} dialog
\r
* Parent dialog object.
\r
- * @param {CKEDITOR.dialog.uiElementDefinition} elementDefinition
\r
+ * @param {CKEDITOR.dialog.definition.uiElement} elementDefinition
\r
* The element definition. Accepted fields:
\r
* <ul>
\r
* <li><strong>default</strong> (Required) The default value.</li>
\r
* The element definition. Accepted fields:
\r
* <ul>
\r
* <li><strong>default</strong> (Required) The default value.</li>
\r
@@
-462,8
+466,8
@@
CKEDITOR.plugins.add( 'dialogui' );
cleanInnerDefinition( inputDefinition );
\r
cleanInnerDefinition( labelDefinition );
\r
\r
cleanInnerDefinition( inputDefinition );
\r
cleanInnerDefinition( labelDefinition );
\r
\r
- if ( typeof inputDefinition.controlStyle != 'undefined' )
\r
- inputDefinition.style = inputDefinition.controlStyle;
\r
+ if ( typeof inputDefinition.inputStyle != 'undefined' )
\r
+ inputDefinition.style = inputDefinition.inputStyle;
\r
\r
children.push( new CKEDITOR.ui.dialog.uiElement( dialog, inputDefinition, inputHtml, 'input', null, inputAttributes ) );
\r
inputHtml.push( ' ' );
\r
\r
children.push( new CKEDITOR.ui.dialog.uiElement( dialog, inputDefinition, inputHtml, 'input', null, inputAttributes ) );
\r
inputHtml.push( ' ' );
\r
@@
-471,7
+475,7
@@
CKEDITOR.plugins.add( 'dialogui' );
item[0] );
\r
inputHtmlList.push( inputHtml.join( '' ) );
\r
}
\r
item[0] );
\r
inputHtmlList.push( inputHtml.join( '' ) );
\r
}
\r
- new CKEDITOR.ui.dialog.hbox( dialog, [], inputHtmlList, html );
\r
+ new CKEDITOR.ui.dialog.hbox( dialog, children, inputHtmlList, html );
\r
return html.join( '' );
\r
};
\r
\r
return html.join( '' );
\r
};
\r
\r
@@
-486,7
+490,7
@@
CKEDITOR.plugins.add( 'dialogui' );
* @extends CKEDITOR.ui.dialog.uiElement
\r
* @param {CKEDITOR.dialog} dialog
\r
* Parent dialog object.
\r
* @extends CKEDITOR.ui.dialog.uiElement
\r
* @param {CKEDITOR.dialog} dialog
\r
* Parent dialog object.
\r
- * @param {CKEDITOR.dialog.uiElementDefinition} elementDefinition
\r
+ * @param {CKEDITOR.dialog.definition.uiElement} elementDefinition
\r
* The element definition. Accepted fields:
\r
* <ul>
\r
* <li><strong>label</strong> (Required) The button label.</li>
\r
* The element definition. Accepted fields:
\r
* <ul>
\r
* <li><strong>label</strong> (Required) The button label.</li>
\r
@@
-569,7
+573,7
@@
CKEDITOR.plugins.add( 'dialogui' );
* @constructor
\r
* @param {CKEDITOR.dialog} dialog
\r
* Parent dialog object.
\r
* @constructor
\r
* @param {CKEDITOR.dialog} dialog
\r
* Parent dialog object.
\r
- * @param {CKEDITOR.dialog.uiElementDefinition} elementDefinition
\r
+ * @param {CKEDITOR.dialog.definition.uiElement} elementDefinition
\r
* The element definition. Accepted fields:
\r
* <ul>
\r
* <li><strong>default</strong> (Required) The default value.</li>
\r
* The element definition. Accepted fields:
\r
* <ul>
\r
* <li><strong>default</strong> (Required) The default value.</li>
\r
@@
-618,12
+622,12
@@
CKEDITOR.plugins.add( 'dialogui' );
for ( var i = 0, item ; i < elementDefinition.items.length && ( item = elementDefinition.items[i] ) ; i++ )
\r
{
\r
innerHTML.push( '<option value="',
\r
for ( var i = 0, item ; i < elementDefinition.items.length && ( item = elementDefinition.items[i] ) ; i++ )
\r
{
\r
innerHTML.push( '<option value="',
\r
- CKEDITOR.tools.htmlEncode( item[1] !== undefined ? item[1] : item[0] ), '" /> ',
\r
+ CKEDITOR.tools.htmlEncode( item[1] !== undefined ? item[1] : item[0] ).replace( /"/g, '"' ), '" /> ',
\r
CKEDITOR.tools.htmlEncode( item[0] ) );
\r
}
\r
\r
CKEDITOR.tools.htmlEncode( item[0] ) );
\r
}
\r
\r
- if ( typeof myDefinition.controlStyle != 'undefined' )
\r
- myDefinition.style = myDefinition.controlStyle;
\r
+ if ( typeof myDefinition.inputStyle != 'undefined' )
\r
+ myDefinition.style = myDefinition.inputStyle;
\r
\r
_.select = new CKEDITOR.ui.dialog.uiElement( dialog, myDefinition, html, 'select', null, attributes, innerHTML.join( '' ) );
\r
return html.join( '' );
\r
\r
_.select = new CKEDITOR.ui.dialog.uiElement( dialog, myDefinition, html, 'select', null, attributes, innerHTML.join( '' ) );
\r
return html.join( '' );
\r
@@
-639,7
+643,7
@@
CKEDITOR.plugins.add( 'dialogui' );
* @constructor
\r
* @param {CKEDITOR.dialog} dialog
\r
* Parent dialog object.
\r
* @constructor
\r
* @param {CKEDITOR.dialog} dialog
\r
* Parent dialog object.
\r
- * @param {CKEDITOR.dialog.uiElementDefinition} elementDefinition
\r
+ * @param {CKEDITOR.dialog.definition.uiElement} elementDefinition
\r
* The element definition. Accepted fields:
\r
* <ul>
\r
* <li><strong>validate</strong> (Optional) The validation function.</li>
\r
* The element definition. Accepted fields:
\r
* <ul>
\r
* <li><strong>validate</strong> (Optional) The validation function.</li>
\r
@@
-712,7
+716,7
@@
CKEDITOR.plugins.add( 'dialogui' );
* @constructor
\r
* @param {CKEDITOR.dialog} dialog
\r
* Parent dialog object.
\r
* @constructor
\r
* @param {CKEDITOR.dialog} dialog
\r
* Parent dialog object.
\r
- * @param {CKEDITOR.dialog.uiElementDefinition} elementDefinition
\r
+ * @param {CKEDITOR.dialog.definition.uiElement} elementDefinition
\r
* The element definition. Accepted fields:
\r
* <ul>
\r
* <li><strong>for</strong> (Required) The file input's page and element Id
\r
* The element definition. Accepted fields:
\r
* <ul>
\r
* <li><strong>for</strong> (Required) The file input's page and element Id
\r
@@
-765,7
+769,7
@@
CKEDITOR.plugins.add( 'dialogui' );
* @extends CKEDITOR.ui.dialog.uiElement
\r
* @name CKEDITOR.ui.dialog.html
\r
* @param {CKEDITOR.dialog} dialog Parent dialog object.
\r
* @extends CKEDITOR.ui.dialog.uiElement
\r
* @name CKEDITOR.ui.dialog.html
\r
* @param {CKEDITOR.dialog} dialog Parent dialog object.
\r
- * @param {CKEDITOR.dialog.uiElementDefinition} elementDefinition Element definition.
\r
+ * @param {CKEDITOR.dialog.definition.uiElement} elementDefinition Element definition.
\r
* Accepted fields:
\r
* <ul>
\r
* <li><strong>html</strong> (Required) HTML code of this element.</li>
\r
* Accepted fields:
\r
* <ul>
\r
* <li><strong>html</strong> (Required) HTML code of this element.</li>
\r
@@
-837,7
+841,7
@@
CKEDITOR.plugins.add( 'dialogui' );
* objects in childObjList.
\r
* @param {Array} htmlList
\r
* Array of HTML code that this element will output to.
\r
* objects in childObjList.
\r
* @param {Array} htmlList
\r
* Array of HTML code that this element will output to.
\r
- * @param {CKEDITOR.dialog.uiElementDefinition} elementDefinition
\r
+ * @param {CKEDITOR.dialog.definition.uiElement} elementDefinition
\r
* The element definition. Accepted fields:
\r
* <ul>
\r
* <li><strong>label</strong> (Optional) The legend of the this fieldset.</li>
\r
* The element definition. Accepted fields:
\r
* <ul>
\r
* <li><strong>label</strong> (Optional) The legend of the this fieldset.</li>
\r
@@
-851,7
+855,9
@@
CKEDITOR.plugins.add( 'dialogui' );
var innerHTML = function()
\r
{
\r
var html = [];
\r
var innerHTML = function()
\r
{
\r
var html = [];
\r
- legendLabel && html.push( '<legend>' + legendLabel + '</legend>' );
\r
+ legendLabel && html.push( '<legend' +
\r
+ ( elementDefinition.labelStyle ? ' style="' + elementDefinition.labelStyle + '"' : '' ) +
\r
+ '>' + legendLabel + '</legend>' );
\r
for ( var i = 0; i < childHtmlList.length; i++ )
\r
html.push( childHtmlList[ i ] );
\r
return html.join( '' );
\r
for ( var i = 0; i < childHtmlList.length; i++ )
\r
html.push( childHtmlList[ i ] );
\r
return html.join( '' );
\r
@@
-965,7
+971,13
@@
CKEDITOR.plugins.add( 'dialogui' );
/** @ignore */
\r
onClick : function( dialog, func )
\r
{
\r
/** @ignore */
\r
onClick : function( dialog, func )
\r
{
\r
- this.on( 'click', func );
\r
+ this.on( 'click', function()
\r
+ {
\r
+ // Some browsers (Chrome, IE8, IE7 compat mode) don't move
\r
+ // focus to clicked button. Force this.
\r
+ this.getElement().focus();
\r
+ func.apply( this, arguments );
\r
+ });
\r
}
\r
}, true ),
\r
\r
}
\r
}, true ),
\r
\r