Changeset 4767
- Timestamp:
- 12/20/09 17:23:49 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
CKEditor/branches/features/paste/_source/plugins/pastefromword/filter/default.js
r4766 r4767 238 238 }, 239 239 240 convertToPx : function( cssLength ) 240 // Convert various length units to 'px' in ignorance of DPI. 241 convertToPx : ( function () 241 242 { 242 // Convert to 'px' in ignorance of DPI. 243 if( cssLengthRelativeUnit.test( cssLength ) ) 244 { 245 var val, 246 calculator = CKEDITOR.dom.element.createFromHtml( 247 '<div style="position:absolute;left:-9999px;' + 248 'top:-9999px;margin:0px;padding:0px;border:0px;' + 249 'width:' + cssLength + '" ' + 250 '></div>' ); 251 CKEDITOR.document.getBody().append( calculator ); 252 val = calculator.$.clientWidth; 253 calculator.remove(); 254 return val + 'px'; 255 } 256 return cssLength; 257 }, 243 var calculator = CKEDITOR.dom.element.createFromHtml( 244 '<div style="position:absolute;left:-9999px;' + 245 'top:-9999px;margin:0px;padding:0px;border:0px;"' + 246 '></div>', CKEDITOR.document ); 247 CKEDITOR.document.getBody().append( calculator ); 248 249 return function( cssLength ) 250 { 251 if( cssLength.indexOf( '%' ) == -1 ) 252 { 253 calculator.setStyle( 'width', cssLength ); 254 return calculator.$.clientWidth + 'px'; 255 } 256 257 return cssLength; 258 }; 259 } )(), 258 260 259 261 listDtdParents : CKEDITOR.dtd.parentOf( 'ol' ) … … 1026 1028 editor.fire( 'beforeCleanWord', { filter : dataFilter } ); 1027 1029 1030 console.time( 'word clean' ); 1028 1031 data = dataProcessor.toHtml( data, false ); 1032 console.timeEnd( 'word clean' ); 1029 1033 1030 1034 /* Below post processing those things that are unable to delivered by filter rules. */
Note: See TracChangeset
for help on using the changeset viewer.
