Make WordPress Core


Ignore:
Timestamp:
12/06/2008 09:54:24 AM (17 years ago)
Author:
westi
Message:

Move convertEntities js function into the BackPress scriptloader. Fixes #8505 props sambauers.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-header.php

    r10081 r10086  
    3030//<![CDATA[
    3131addLoadEvent = function(func) {if (typeof jQuery != "undefined") jQuery(document).ready(func); else if (typeof wpOnload!='function'){wpOnload=func;} else {var oldonload=wpOnload; wpOnload=function(){oldonload();func();}}};
    32 
    33 function convertEntities(o) {
    34     var c = function(s) {
    35         if (/&[^;]+;/.test(s)) {
    36             var e = document.createElement("div");
    37             e.innerHTML = s;
    38             return !e.firstChild ? s : e.firstChild.nodeValue;
    39         }
    40         return s;
    41     }
    42 
    43     if ( typeof o === 'string' )
    44         return c(o);
    45     else if ( typeof o === 'object' )
    46         for (var v in o) {
    47             if ( typeof o[v] === 'string' )
    48                 o[v] = c(o[v]);
    49         }
    50     return o;
    51 };
    5232//]]>
    5333</script>
Note: See TracChangeset for help on using the changeset viewer.