Sha256: 0a0077daba78e32516c7398ab60f7d2aebab9abb07ff3436dc055bf7c470b406
Contents?: true
Size: 1.16 KB
Versions: 54
Compression:
Stored size: 1.16 KB
Contents
/******************************************************************************* * KindEditor - WYSIWYG HTML Editor for Internet * Copyright (C) 2006-2011 kindsoft.net * * @author Roddy <luolonghao@gmail.com> * @site http://www.kindsoft.net/ * @licence http://www.kindsoft.net/license.php *******************************************************************************/ KindEditor.plugin('clearhtml', function(K) { var self = this, name = 'clearhtml'; self.clickToolbar(name, function() { self.focus(); var html = self.html(); html = html.replace(/(<script[^>]*>)([\s\S]*?)(<\/script>)/ig, ''); html = html.replace(/(<style[^>]*>)([\s\S]*?)(<\/style>)/ig, ''); html = K.formatHtml(html, { a : ['href', 'target'], embed : ['src', 'width', 'height', 'type', 'loop', 'autostart', 'quality', '.width', '.height', 'align', 'allowscriptaccess'], img : ['src', 'width', 'height', 'border', 'alt', 'title', '.width', '.height'], table : ['border'], 'td,th' : ['rowspan', 'colspan'], 'div,hr,br,tbody,tr,p,ol,ul,li,blockquote,h1,h2,h3,h4,h5,h6' : [] }); self.html(html); self.cmd.selection(true); self.addBookmark(); }); });
Version data entries
54 entries across 54 versions & 8 rubygems