PHP Classes

File: public/js/tinymce/src/plugins/charmap/src/main/js/ui/GridHtml.js

Recommend this page to a friend!
  Classes of Abed Nego Ragil Putra   GoLavaCMS   public/js/tinymce/src/plugins/charmap/src/main/js/ui/GridHtml.js   Download  
File: public/js/tinymce/src/plugins/charmap/src/main/js/ui/GridHtml.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: GoLavaCMS
Publish content on Web pages with SEO support
Author: By
Last change:
Date: 6 years ago
Size: 1,388 bytes
 

Contents

Class file image Download
/** * GridHtml.js * * Released under LGPL License. * Copyright (c) 1999-2017 Ephox Corp. All rights reserved * * License: http://www.tinymce.com/license * Contributing: http://www.tinymce.com/contributing */ define( 'tinymce.plugins.charmap.ui.GridHtml', [ ], function () { var getHtml = function (charmap) { var gridHtml, x, y; var width = Math.min(charmap.length, 25); var height = Math.ceil(charmap.length / width); gridHtml = '<table role="presentation" cellspacing="0" class="mce-charmap"><tbody>'; for (y = 0; y < height; y++) { gridHtml += '<tr>'; for (x = 0; x < width; x++) { var index = y * width + x; if (index < charmap.length) { var chr = charmap[index]; var charCode = parseInt(chr[0], 10); var chrText = chr ? String.fromCharCode(charCode) : '&nbsp;'; gridHtml += ( '<td title="' + chr[1] + '">' + '<div tabindex="-1" title="' + chr[1] + '" role="button" data-chr="' + charCode + '">' + chrText + '</div>' + '</td>' ); } else { gridHtml += '<td />'; } } gridHtml += '</tr>'; } gridHtml += '</tbody></table>'; return gridHtml; }; return { getHtml: getHtml }; } );