Closed GoogleCodeExporter closed 9 years ago
You can attach a css file to the editor:
$('#wysiwyg').wysiwyg({
css : 'editor.css'
});
May be it's that what you need.
Regards,
Original comment by joksnet
on 26 Sep 2008 at 2:03
Not quite. I was looking for a general dropdown, where not only could I attach
a CSS
file to the editor window, but if possible be able to apply classes listed via
dropdown or API method.
Original comment by issac.kelly
on 26 Sep 2008 at 2:17
I'm trying that, and some other fancy stuff... For that I need to "get" the
selected
element (or equivalent).
perhaps:
buttonName : {
visible : true,
exec : function(obj) {
szClassName = prompt("Class Name:");
$(obj).addClass(szClassName);
}
},
Or perhaps get the cursor position on the html source and do the code change
yourself... But I'd still need the cursor position. Bump. Stuck. :(
Original comment by phenome
on 4 Dec 2008 at 4:45
For adding class I write a new function under "createLink" in jquery.wyswyg.js
(in
attach) and call them like by external link.
$('a[href=\"#custom_class\"]').click(function(){
$('#wysiwyg').wysiwyg('createClass', 'custom_class');
});
I don't know if this is a good code - I'm newbie - but work...
Tested whit IE 6/7 and Firefox3.
Original comment by emilRa...@gmail.com
on 9 Feb 2009 at 3:01
Attachments:
You can use hash of css attributes instead of CSS stylesheet link.
Or You can do $('.wysiwyg iframe').addClass('you-wanna');
Original comment by akzhan.a...@gmail.com
on 8 Dec 2009 at 5:43
Original issue reported on code.google.com by
issac.kelly
on 5 Apr 2008 at 7:02