]> scripts.mit.edu Git - autoinstallsdev/wordpress.git/blobdiff - wp-includes/js/tinymce/plugins/charmap/plugin.js
WordPress 4.7
[autoinstallsdev/wordpress.git] / wp-includes / js / tinymce / plugins / charmap / plugin.js
index 90de9383cac98c522f824bbca95cffc11391ba01..a233ace71069e7ceafcf077b4cb5c4227990381d 100644 (file)
@@ -354,9 +354,13 @@ tinymce.PluginManager.add('charmap', function(editor) {
                                var index = y * width + x;
                                if (index < charmap.length) {
                                        var chr = charmap[index];
+                                       var chrText = chr ? String.fromCharCode(parseInt(chr[0], 10)) : '&nbsp;';
 
-                                       gridHtml += '<td title="' + chr[1] + '"><div tabindex="-1" title="' + chr[1] + '" role="button">' +
-                                               (chr ? String.fromCharCode(parseInt(chr[0], 10)) : '&nbsp;') + '</div></td>';
+                                       gridHtml += (
+                                               '<td title="' + chr[1] + '"><div tabindex="-1" title="' + chr[1] + '" role="button" data-chr="' + chrText + '">' +
+                                                       chrText +
+                                               '</div></td>'
+                                       );
                                } else {
                                        gridHtml += '<td />';
                                }
@@ -375,7 +379,7 @@ tinymce.PluginManager.add('charmap', function(editor) {
 
                                if (/^(TD|DIV)$/.test(target.nodeName)) {
                                        if (getParentTd(target).firstChild) {
-                                               insertChar(tinymce.trim(target.innerText || target.textContent));
+                                               insertChar(target.getAttribute('data-chr'));
 
                                                if (!e.ctrlKey) {
                                                        win.close();
@@ -459,4 +463,4 @@ tinymce.PluginManager.add('charmap', function(editor) {
                getCharMap: getCharMap,
                insertChar: insertChar
        };
-});
+});
\ No newline at end of file