Changeset 23153
- Timestamp:
- 12/10/2012 10:10:12 AM (12 years ago)
- Location:
- trunk/wp-includes/js/tinymce
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/js/tinymce/plugins/wordpress/editor_plugin_src.js
r23144 r23153 134 134 } 135 135 } 136 });137 138 // Extend <object> and <embed> (#WP22790)139 ed.onPreInit.add(function(ed) {140 ed.schema.addValidElements('object[*],param[id|name|value|valuetype|type],embed[*]');141 ed.schema.addValidChildren('+object[embed]');142 136 }); 143 137 -
trunk/wp-includes/js/tinymce/wp-tinymce-schema.js
r23151 r23153 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 … … 57 59 if (!html5) { 58 60 html5 = mapCache.html5 = unpack({ 59 A : 'id|accesskey|class|dir|draggable|item|hidden|itemprop|role|spellcheck|style|subject|title|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup', 60 B : '#|a|abbr|area|audio|b|bdo|br|button|canvas|cite|code|command|datalist|del|dfn|em|embed|i|iframe|img|input|ins|kbd|keygen|label|link|map|mark|meta|' + 61 'meter|noscript|object|output|progress|q|ruby|samp|script|select|small|span|strong|sub|sup|svg|textarea|time|var|video|wbr', 62 C : '#|a|abbr|area|address|article|aside|audio|b|bdo|blockquote|br|button|canvas|cite|code|command|datalist|del|details|dfn|dialog|div|dl|em|embed|fieldset|' + 63 'figure|footer|form|h1|h2|h3|h4|h5|h6|header|hgroup|hr|i|iframe|img|input|ins|kbd|keygen|label|link|map|mark|menu|meta|meter|nav|noscript|ol|object|output|' + 64 'p|pre|progress|q|ruby|samp|script|section|select|small|span|strong|style|sub|sup|svg|table|textarea|time|ul|var|video' 61 A : 'accesskey|class|contextmenu|dir|draggable|dropzone|hidden|id|inert|itemid|itemprop|itemref|itemscope|itemtype|lang|spellcheck|style|tabindex|title|translate|item|role|subject|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup', 62 B : '#|a|abbr|area|audio|b|bdi|bdo|br|button|canvas|cite|code|command|data|datalist|del|dfn|em|embed|i|iframe|img|input|ins|kbd|keygen|label|link|map|mark|math|meta|meter|noscript|object|output|progress|q|ruby|s|samp|script|select|small|span|strong|sub|sup|svg|textarea|time|u|var|video|wbr', 63 C : '#|a|abbr|area|address|article|aside|audio|b|bdi|bdo|blockquote|br|button|canvas|cite|code|command|data|datalist|del|details|dfn|dialog|div|dl|em|embed|fieldset|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hgroup|hr|i|iframe|img|input|ins|kbd|keygen|label|link|map|mark|math|menu|meta|meter|nav|noscript|ol|object|output|p|pre|progress|q|ruby|s|samp|script|section|select|small|span|strong|style|sub|sup|svg|table|textarea|time|u|ul|var|video|wbr' 65 64 }, 'html[A|manifest][body|head]' + 66 65 'head[A][base|command|link|meta|noscript|script|style|title]' + 67 66 'title[A][#]' + 68 67 'base[A|href|target][]' + 69 'link[A|href|rel|media|type|sizes ][]' +68 'link[A|href|rel|media|type|sizes|crossorigin|hreflang][]' + 70 69 'meta[A|http-equiv|name|content|charset][]' + 71 70 'style[A|type|media|scoped][#]' + 72 'script[A|charset|type|src|defer|async ][#]' +71 'script[A|charset|type|src|defer|async|crossorigin][#]' + 73 72 'noscript[A][C]' + 74 'body[A ][C]' +73 'body[A|onafterprint|onbeforeprint|onbeforeunload|onblur|onerror|onfocus|onfullscreenchange|onfullscreenerror|onhashchange|onload|onmessage|onoffline|ononline|onpagehide|onpageshow|onpopstate|onresize|onscroll|onstorage|onunload][C]' + 75 74 'section[A][C]' + 76 75 'nav[A][C]' + … … 90 89 'br[A][]' + 91 90 'pre[A][B]' + 92 'dialog[A ][dd|dt]' +91 'dialog[A|open][C|dd|dt]' + 93 92 'blockquote[A|cite][C]' + 94 93 'ol[A|start|reversed][li]' + … … 96 95 'li[A|value][C]' + 97 96 'dl[A][dd|dt]' + 98 'dt[A][ B]' +97 'dt[A][C|B]' + 99 98 'dd[A][C]' + 100 'a[A|href|target| ping|rel|media|type][B]' +99 'a[A|href|target|download|ping|rel|media|type][C|B]' + 101 100 'em[A][B]' + 102 101 'strong[A][B]' + 103 102 'small[A][B]' + 103 's[A][B]' + 104 104 'cite[A][B]' + 105 105 'q[A|cite][B]' + … … 114 114 'i[A][B]' + 115 115 'b[A][B]' + 116 'u[A][B]' + 116 117 'mark[A][B]' + 117 118 'progress[A|value|max][B]' + … … 121 122 'rt[A][B]' + 122 123 'rp[A][B]' + 124 'bdi[A][B]' + 123 125 'bdo[A][B]' + 124 126 'span[A][B]' + 125 'ins[A|cite|datetime][ B]' +126 'del[A|cite|datetime][ B]' +127 'ins[A|cite|datetime][C|B]' + 128 'del[A|cite|datetime][C|B]' + 127 129 'figure[A][C|legend|figcaption]' + 128 130 'figcaption[A][C]' + 129 'img[A|alt|src| height|width|usemap|ismap][]' +130 'iframe[A|name|src| height|width|sandbox|seamless][]' +131 'img[A|alt|src|srcset|crossorigin|usemap|ismap|width|height][]' + 132 'iframe[A|name|src|srcdoc|height|width|sandbox|seamless|allowfullscreen][C|B]' + 131 133 'embed[A|src|height|width|type][]' + 132 'object[A|data|type| height|width|usemap|name|form|classid][param]' +134 'object[A|data|type|typemustmatch|name|usemap|form|width|height][C|B|param]' + 133 135 'param[A|name|value][]' + 134 'details[A|open][C|legend]' + 135 'command[A|type|label|icon|disabled|checked|radiogroup][]' + 136 'summary[A][B]' + 137 'details[A|open][C|legend|summary]' + 138 'command[A|type|label|icon|disabled|checked|radiogroup|command][]' + 136 139 'menu[A|type|label][C|li]' + 137 140 'legend[A][C|B]' + 138 141 'div[A][C]' + 139 142 'source[A|src|type|media][]' + 140 'audio[A|src|autobuffer|autoplay|loop|controls][source]' + 141 'video[A|src|autobuffer|autoplay|loop|controls|width|height|poster][source]' + 143 'track[A|kind|src|srclang|label|default][]' + 144 'audio[A|src|autobuffer|autoplay|loop|controls|crossorigin|preload|mediagroup|muted][C|source|track]' + 145 'video[A|src|autobuffer|autoplay|loop|controls|width|height|poster|crossorigin|preload|mediagroup|muted][C|source|track]' + 142 146 'hr[A][]' + 143 147 'form[A|accept-charset|action|autocomplete|enctype|method|name|novalidate|target][C]' + 144 148 'fieldset[A|disabled|form|name][C|legend]' + 145 149 'label[A|form|for][B]' + 146 'input[A|type|accept|alt|autocomplete|autofocus|checked|di sabled|form|formaction|formenctype|formmethod|formnovalidate|formtarget|height|list|max|maxlength|min|' +147 'multiple|pattern|placeholder|readonly|required|size|src|step|width|files|value|name][]' +148 ' button[A|autofocus|disabled|form|formaction|formenctype|formmethod|formnovalidate|formtarget|name|value|type][B]' +149 ' select[A|autofocus|disabled|form|multiple|name|size][option|optgroup]' +150 'input[A|type|accept|alt|autocomplete|autofocus|checked|dirname|disabled|form|formaction|formenctype|formmethod|formnovalidate|formtarget|height|inputmode|list|max|maxlength|min|multiple|name|pattern|placeholder|readonly|required|size|src|step|value|width|files][]' + 151 'button[A|autofocus|disabled|form|formaction|formenctype|formmethod|formnovalidate|formtarget|name|type|value][B]' + 152 'select[A|autofocus|disabled|form|multiple|name|required|size][option|optgroup]' + 153 'data[A|value][B]' + 150 154 'datalist[A][B|option]' + 151 155 'optgroup[A|disabled|label][option]' + 152 'option[A|disabled|selected|label|value][ ]' +153 'textarea[A|auto focus|disabled|form|maxlength|name|placeholder|readonly|required|rows|cols|wrap][]' +156 'option[A|disabled|selected|label|value][#]' + 157 'textarea[A|autocomplete|autofocus|cols|dirname|disabled|form|inputmode|maxlength|name|placeholder|readonly|required|rows|wrap][#]' + 154 158 'keygen[A|autofocus|challenge|disabled|form|keytype|name][]' + 155 159 'output[A|for|form|name][B]' + 156 'canvas[A|width|height][ ]' +157 'map[A|name][ B|C]' +158 'area[A| shape|coords|href|alt|target|media|rel|ping|type][]' +159 'math ml[A][]' +160 'canvas[A|width|height][a|button|input]' + 161 'map[A|name][C|B]' + 162 'area[A|alt|coords|shape|href|target|download|ping|rel|media|hreflang|type][]' + 163 'math[A][]' + 160 164 'svg[A][]' + 161 'table[A |border][caption|colgroup|thead|tfoot|tbody|tr]' +165 'table[A][caption|colgroup|thead|tfoot|tbody|tr]' + 162 166 'caption[A][C]' + 163 167 'colgroup[A|span][col]' + … … 167 171 'tbody[A][tr]' + 168 172 'tr[A][th|td]' + 169 'th[A|headers|rowspan|colspan|scope][ B]' +173 'th[A|headers|rowspan|colspan|scope][C]' + 170 174 'td[A|headers|rowspan|colspan][C]' + 171 175 'wbr[A][]' … … 308 312 309 313 /** 314 * WordPress Core 315 * 316 * Returns a schema that is the result of a deep merge between the HTML5 317 * and HTML4 schemas. 318 */ 319 function getSaneSchema() { 320 var cachedMapCache = mapCache, 321 html5, html4; 322 323 if ( mapCache.sane ) 324 return mapCache.sane; 325 326 // Bust the mapCache so we're not dealing with the other schema objects. 327 mapCache = {}; 328 html5 = getHTML5(); 329 html4 = getHTML4(); 330 mapCache = cachedMapCache; 331 332 each( html4, function( html4settings, tag ) { 333 var html5settings = html5[ tag ], 334 difference = []; 335 336 // Merge tags missing in HTML5 mode. 337 if ( ! html5settings ) { 338 html5[ tag ] = html4settings; 339 return; 340 } 341 342 // Merge attributes missing from this HTML5 tag. 343 each( html4settings.attributes, function( attribute, key ) { 344 if ( ! html5settings.attributes[ key ] ) 345 html5settings.attributes[ key ] = attribute; 346 }); 347 348 // Merge any missing attributes into the attributes order. 349 each( html4settings.attributesOrder, function( key ) { 350 if ( -1 === tinymce.inArray( html5settings.attributesOrder, key ) ) 351 difference.push( key ); 352 }); 353 354 html5settings.attributesOrder = html5settings.attributesOrder.concat( difference ); 355 356 // Merge children missing from this HTML5 tag. 357 each( html4settings.children, function( child, key ) { 358 if ( ! html5settings.children[ key ] ) 359 html5settings.children[ key ] = child; 360 }); 361 }); 362 363 return mapCache.sane = html5; 364 } 365 366 /** 310 367 * Schema validator class. 311 368 * … … 356 413 357 414 settings = settings || {}; 358 schemaItems = settings.schema == "html5" ? getHTML5() : getHTML4(); 415 416 /** 417 * WordPress core uses a sane schema in place of the default "HTML5" schema. 418 */ 419 schemaItems = settings.schema == "html5" ? getSaneSchema() : getHTML4(); 359 420 360 421 // Allow all elements and attributes if verify_html is set to false
Note: See TracChangeset
for help on using the changeset viewer.