summaryrefslogtreecommitdiff
path: root/plugins/TinyMCE/js/plugins/pagebreak/editor_plugin.js
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2010-08-13 14:51:51 -0700
committerEvan Prodromou <evan@status.net>2010-08-13 14:51:51 -0700
commit1dadb8efc04cbb807b2cd8b6291f7c2f64a631dc (patch)
treea35027e95a6b0900195dc3bb4ca4fef1c00b2f5a /plugins/TinyMCE/js/plugins/pagebreak/editor_plugin.js
parent718317542940a8976f2c6f2a9ea09a04f2f00ca6 (diff)
parent926c77246bb168097b3f937b5cc22ee9721b83c9 (diff)
Merge branch '0.9.x' into 1.0.x
Diffstat (limited to 'plugins/TinyMCE/js/plugins/pagebreak/editor_plugin.js')
-rw-r--r--plugins/TinyMCE/js/plugins/pagebreak/editor_plugin.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/plugins/TinyMCE/js/plugins/pagebreak/editor_plugin.js b/plugins/TinyMCE/js/plugins/pagebreak/editor_plugin.js
new file mode 100644
index 000000000..a212f6963
--- /dev/null
+++ b/plugins/TinyMCE/js/plugins/pagebreak/editor_plugin.js
@@ -0,0 +1 @@
+(function(){tinymce.create("tinymce.plugins.PageBreakPlugin",{init:function(b,d){var f='<img src="'+d+'/img/trans.gif" class="mcePageBreak mceItemNoResize" />',a="mcePageBreak",c=b.getParam("pagebreak_separator","<!-- pagebreak -->"),e;e=new RegExp(c.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,function(g){return"\\"+g}),"g");b.addCommand("mcePageBreak",function(){b.execCommand("mceInsertContent",0,f)});b.addButton("pagebreak",{title:"pagebreak.desc",cmd:a});b.onInit.add(function(){if(b.settings.content_css!==false){b.dom.loadCSS(d+"/css/content.css")}if(b.theme.onResolveName){b.theme.onResolveName.add(function(g,h){if(h.node.nodeName=="IMG"&&b.dom.hasClass(h.node,a)){h.name="pagebreak"}})}});b.onClick.add(function(g,h){h=h.target;if(h.nodeName==="IMG"&&g.dom.hasClass(h,a)){g.selection.select(h)}});b.onNodeChange.add(function(h,g,i){g.setActive("pagebreak",i.nodeName==="IMG"&&h.dom.hasClass(i,a))});b.onBeforeSetContent.add(function(g,h){h.content=h.content.replace(e,f)});b.onPostProcess.add(function(g,h){if(h.get){h.content=h.content.replace(/<img[^>]+>/g,function(i){if(i.indexOf('class="mcePageBreak')!==-1){i=c}return i})}})},getInfo:function(){return{longname:"PageBreak",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/pagebreak",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("pagebreak",tinymce.plugins.PageBreakPlugin)})(); \ No newline at end of file