generators/wysihat/templates/javascripts/wysihat_engine.js in wysihat-engine-0.1.10 vs generators/wysihat/templates/javascripts/wysihat_engine.js in wysihat-engine-0.1.11
- old
+ new
@@ -42,10 +42,21 @@
iframe = this;
facebox.reveal('<textarea id=\"html_editor\" style=\"width:100%; height:400px;\">' + iframe.contentWindow.document.body.innerHTML + '</textarea>', null);
Event.observe('html_editor', 'change', function(event) {
iframe.contentWindow.document.body.innerHTML = $('html_editor').value;
});
+ },
+
+ faceboxPaste: function()
+ {
+ facebox.loading();
+ new Effect.Appear($('facebox'), {duration: 0.3});
+ iframe = this
+ facebox.reveal('<textarea id=\"paste_editor\" style=\"width:100%; height:400px;\"></textarea>', null);
+ Event.observe('paste_editor', 'change', function(event) {
+ iframe.contentWindow.document.body.innerHTML = iframe.contentWindow.document.body.innerHTML + $('paste_editor').value.escapeHTML();
+ });
}
};
function wysiHatify(tag_id, buttons){
WysiHat.Editor.include(WysihatHelper);
@@ -73,9 +84,10 @@
case 'html':
toolbar.addButton({label : button.gsub('_','-').camelize().capitalize(), handler: function(editor) { return editor.faceboxHTML(editor); }});
break;
case 'paste':
toolbar.addButton({label : button.gsub('_','-').camelize().capitalize(), handler: function(editor) { return editor.faceboxPaste(editor); }});
+ break;
case 'h1': case 'h2': case 'h3': case 'h4': case 'h5': case 'h6': case 'p':
toolbar.addButton({label : button.gsub('_','-').camelize().capitalize(), handler: function(editor) { return editor.formatblockSelection(button.toLowerCase()); }});
break;
default:
toolbar.addButton({label : button.gsub('_','-').camelize().capitalize()});