Ticket #3465: 3465.patch
File 3465.patch, 3.0 KB (added by , 16 years ago) |
---|
-
_source/plugins/dialogui/plugin.js
1177 1177 */ 1178 1178 getInputElement : function() 1179 1179 { 1180 return new CKEDITOR.dom.element( 1181 CKEDITOR.document.getById( this._.frameId ).getFrameDocument().$.forms[0].elements[0] ); 1180 var frameDocument = CKEDITOR.document.getById( this._.frameId ).getFrameDocument(); 1181 return frameDocument.$.forms.length > 0 ? 1182 new CKEDITOR.dom.element( frameDocument.$.forms[0].elements[0] ) : 1183 this.getElement(); 1182 1184 }, 1183 1185 1184 1186 /** … … 1205 1207 elementDefinition = this._.definition, 1206 1208 buttons = this._.buttons; 1207 1209 1208 frameDocument.$.open(); 1210 function generateFormField() 1211 { 1212 frameDocument.$.open(); 1209 1213 1210 // Support for custom document.domain in IE.1211 if ( CKEDITOR.env.isCustomDomain() )1212 frameDocument.$.domain = document.domain;1214 // Support for custom document.domain in IE. 1215 if ( CKEDITOR.env.isCustomDomain() ) 1216 frameDocument.$.domain = document.domain; 1213 1217 1214 frameDocument.$.write( [ '<html><head><title></title></head><body style="margin: 0; overflow: hidden; background: transparent;">',1215 '<form enctype="multipart/form-data" method="POST" action="',1216 CKEDITOR.tools.htmlEncode( elementDefinition.action ),1217 '">',1218 '<input type="file" name="',1219 CKEDITOR.tools.htmlEncode( elementDefinition.id || 'cke_upload' ),1220 '" size="',1221 CKEDITOR.tools.htmlEncode( elementDefinition.size || '' ),1222 '" />',1223 '</form>',1224 '</body></html>' ].join( '' ) );1218 frameDocument.$.write( [ '<html><head><title></title></head><body style="margin: 0; overflow: hidden; background: transparent;">', 1219 '<form enctype="multipart/form-data" method="POST" action="', 1220 CKEDITOR.tools.htmlEncode( elementDefinition.action ), 1221 '">', 1222 '<input type="file" name="', 1223 CKEDITOR.tools.htmlEncode( elementDefinition.id || 'cke_upload' ), 1224 '" size="', 1225 CKEDITOR.tools.htmlEncode( elementDefinition.size || '' ), 1226 '" />', 1227 '</form>', 1228 '</body></html>' ].join( '' ) ); 1225 1229 1226 frameDocument.$.close(); 1230 frameDocument.$.close(); 1231 1232 for ( var i = 0 ; i < buttons.length ; i++ ) 1233 buttons[i].enable(); 1234 } 1227 1235 1228 for ( var i = 0 ; i < buttons.length ; i++ )1229 buttons[i].enable();1236 // #3465: Wait for the browser to finish rendering the dialog first. 1237 setTimeout( generateFormField, 500 ); 1230 1238 }, 1231 1239 1240 getValue : function() 1241 { 1242 // The file path returned from the input tag is incomplete anyway, so it's 1243 // safe to ignore it and prevent the confirmation dialog from appearing. 1244 // (Part of #3465) 1245 return ''; 1246 }, 1247 1232 1248 /** 1233 1249 * Defines the onChange event for UI element definitions. 1234 1250 * @field