comparison static/js/tiny_mce/plugins/pagebreak/editor_plugin_src.js @ 442:6c182ceb7147

Fixing #217; upgrade TinyMCE to 3.4.2 and enable the paste plugin.
author Brian Neal <bgneal@gmail.com>
date Thu, 26 May 2011 00:43:49 +0000
parents 88b2b9cb8c1f
children
comparison
equal deleted inserted replaced
441:33d0c55e57a9 442:6c182ceb7147
9 */ 9 */
10 10
11 (function() { 11 (function() {
12 tinymce.create('tinymce.plugins.PageBreakPlugin', { 12 tinymce.create('tinymce.plugins.PageBreakPlugin', {
13 init : function(ed, url) { 13 init : function(ed, url) {
14 var pb = '<img src="' + url + '/img/trans.gif" class="mcePageBreak mceItemNoResize" />', cls = 'mcePageBreak', sep = ed.getParam('pagebreak_separator', '<!-- pagebreak -->'), pbRE; 14 var pb = '<img src="' + ed.theme.url + '/img/trans.gif" class="mcePageBreak mceItemNoResize" />', cls = 'mcePageBreak', sep = ed.getParam('pagebreak_separator', '<!-- pagebreak -->'), pbRE;
15 15
16 pbRE = new RegExp(sep.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g, function(a) {return '\\' + a;}), 'g'); 16 pbRE = new RegExp(sep.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g, function(a) {return '\\' + a;}), 'g');
17 17
18 // Register commands 18 // Register commands
19 ed.addCommand('mcePageBreak', function() { 19 ed.addCommand('mcePageBreak', function() {
22 22
23 // Register buttons 23 // Register buttons
24 ed.addButton('pagebreak', {title : 'pagebreak.desc', cmd : cls}); 24 ed.addButton('pagebreak', {title : 'pagebreak.desc', cmd : cls});
25 25
26 ed.onInit.add(function() { 26 ed.onInit.add(function() {
27 if (ed.settings.content_css !== false)
28 ed.dom.loadCSS(url + "/css/content.css");
29
30 if (ed.theme.onResolveName) { 27 if (ed.theme.onResolveName) {
31 ed.theme.onResolveName.add(function(th, o) { 28 ed.theme.onResolveName.add(function(th, o) {
32 if (o.node.nodeName == 'IMG' && ed.dom.hasClass(o.node, cls)) 29 if (o.node.nodeName == 'IMG' && ed.dom.hasClass(o.node, cls))
33 o.name = 'pagebreak'; 30 o.name = 'pagebreak';
34 }); 31 });