Changeset 23120
- Timestamp:
- 12/07/2012 11:26:25 AM (12 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/class-wp-editor.php
r23017 r23120 570 570 571 571 if ( $tmce_on ) { 572 if ( $compressed ) 572 if ( $compressed ) { 573 573 echo "<script type='text/javascript' src='{$baseurl}/wp-tinymce.php?c=1&$version'></script>\n"; 574 else574 } else { 575 575 echo "<script type='text/javascript' src='{$baseurl}/tiny_mce.js?$version'></script>\n"; 576 echo "<script type='text/javascript' src='{$baseurl}/wp-tinymce-schema.js?$version'></script>\n"; 577 } 576 578 577 579 if ( 'en' != self::$mce_locale && isset($lang) ) -
trunk/wp-includes/js/tinymce/plugins/wordpress/editor_plugin_src.js
r23112 r23120 136 136 }); 137 137 138 // Add obsolete HTML attributes that are still in use.138 // Extend <object> and <embed> (#WP22790) 139 139 ed.onPreInit.add(function(ed) { 140 // The commonAttr are from TinyMCE 3.5.7 getHTML5()141 // Obsolete attributes are from TinyMCE 3.5.7 getHTML4()142 var commonAttr = 'id|accesskey|class|dir|draggable|item|hidden|itemprop|role|spellcheck|style|subject|title|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup',143 tdAttr = commonAttr + '|abbr|axis|headers|scope|rowspan|colspan|char|charoff|align|valign|halign|nowrap|bgcolor|width|height';144 // Obsolete table attributes145 ed.schema.addValidElements('table['+commonAttr+'|summary|width|border|frame|rules|cellspacing|cellpadding|align|bgcolor]');146 // Obsolete tr attributes147 ed.schema.addValidElements('tr['+commonAttr+'|align|char|charoff|valign|halign|bgcolor]');148 // Obsolete td and th attributes149 ed.schema.addValidElements('td['+tdAttr+'],th['+tdAttr+']');150 // Adds "name" for <a>151 ed.schema.addValidElements('a['+commonAttr+'|href|target|ping|rel|media|type|name]');152 // Extend <object> and <embed>153 140 ed.schema.addValidElements('object[*],param[id|name|value|valuetype|type],embed[*]'); 154 141 ed.schema.addValidChildren('object[*]'); -
trunk/wp-includes/js/tinymce/wp-tinymce-schema.js
r23119 r23120 1 1 /** 2 * Schema.js 2 * TinyMCE Schema.js 3 * 4 * Duck-punched by WordPress core to support a sane schema superset. 3 5 * 4 6 * Copyright, Moxiecode Systems AB … … 321 323 322 324 /** 325 * WordPress Core 326 * 327 * Returns a schema that is the result of a deep merge between the HTML5 328 * and HTML4 schemas. 329 */ 330 function getSaneSchema() { 331 var cachedMapCache = mapCache, 332 html5, html4; 333 334 if ( mapCache.sane ) 335 return mapCache.sane; 336 337 // Bust the mapCache so we're not dealing with the other schema objects. 338 mapCache = {}; 339 html5 = getHTML5(); 340 html4 = getHTML4(); 341 mapCache = cachedMapCache; 342 343 each( html4, function( html4settings, tag ) { 344 var html5settings = html5[ tag ], 345 difference = []; 346 347 // Merge tags missing in HTML5 mode. 348 if ( ! html5settings ) { 349 html5[ tag ] = html4settings; 350 return; 351 } 352 353 // Merge attributes missing from this HTML5 tag. 354 each( html4settings.attributes, function( attribute, key ) { 355 if ( ! html5settings.attributes[ key ] ) 356 html5settings.attributes[ key ] = attribute; 357 }); 358 359 // Merge any missing attributes into the attributes order. 360 each( html4settings.attributesOrder, function( key ) { 361 if ( -1 === tinymce.inArray( html5settings.attributesOrder, key ) ) 362 difference.push( key ); 363 }); 364 365 html5settings.attributesOrder = html5settings.attributesOrder.concat( difference ); 366 367 // Merge children missing from this HTML5 tag. 368 each( html4settings.children, function( child, key ) { 369 if ( ! html5settings.children[ key ] ) 370 html5settings.children[ key ] = child; 371 }); 372 }); 373 374 return mapCache.sane = html5; 375 } 376 377 /** 323 378 * Schema validator class. 324 379 * … … 369 424 370 425 settings = settings || {}; 371 schemaItems = settings.schema == "html5" ? getHTML5() : getHTML4(); 426 427 /** 428 * WordPress core uses a sane schema in place of the default "HTML5" schema. 429 */ 430 schemaItems = settings.schema == "html5" ? getSaneSchema() : getHTML4(); 372 431 373 432 // Allow all elements and attributes if verify_html is set to false -
trunk/wp-includes/js/tinymce/wp-tinymce.php
r22531 r23120 34 34 } else { 35 35 echo get_file($basepath . '/tiny_mce.js'); 36 echo get_file($basepath . '/wp-tinymce-schema.js'); 36 37 } 37 38 exit;
Note: See TracChangeset
for help on using the changeset viewer.