You are not logged in.
Pages: 1
Hello,
I've just installed Xinha, and it absolutely brilliant - thanks for all the good work!
However there's one thing I can't seem to get to work - CSS. I'd like to be able to import my CSS files so it looks right, and also so users can format the text using them. It sounds like I need to use the Stylist plug-in, but unfortunately I can't get this to work. It appears at the right when I load the example files, but not in my own scripts.
I've tried adding this various code to my config to some CSS in, as suggested by various posts:
-------------------
<?php
$myCSSString = str_replace("\n", "", @implode(" ", @file("../my.css"))); ?>
xinha_config.pageStyle = "@import <? echo $myCSSString; ?>";
-------------
xinha_config.pageStyleSheets = ['http://www.mysite.com/my.css'];
---------------
xinha_config.stylistLoadStylesheet('http://www.mysite.com/my.css', { '.body' : 'body', '.sub_head2' : 'subhead2'});
--------------
xinha_config.pageStyle = HTMLArea._geturlcontent('my.css');
--------------
xinha_config.stylistLoadStyles('p.red_text { color:red }');
---------------
config.pageStyle = "@import url(my.css);";
--------------
And various variations of this with absolute/relative paths etc.
Does anyone know how I can get Stylist and my CSS working? Thanks! (config follows)
<script type="text/javascript">
_editor_url = "/xinha/";
_editor_lang = "en"; // And the language we need to use in the editor.
</script>
<script type="text/javascript" src="/xinha/htmlarea.js"></script>
<script type="text/javascript">
xinha_editors = null;
xinha_init = null;
xinha_config = null;
xinha_plugins = null;
xinha_init = xinha_init ? xinha_init : function()
{
xinha_plugins = xinha_plugins ? xinha_plugins :
[
'CharacterMap',
'ContextMenu',
'FullScreen',
'ListType',
'SpellChecker',
'Stylist',
'SuperClean',
'TableOperations',
'DynamicCSS'
];
if(!HTMLArea.loadPlugins(xinha_plugins, xinha_init)) return;
xinha_editors = xinha_editors ? xinha_editors :
[
'content'
];
xinha_config = xinha_config ? xinha_config() : new HTMLArea.Config();
xinha_editors = HTMLArea.makeEditors(xinha_editors, xinha_config, xinha_plugins);
HTMLArea.startEditors(xinha_editors);
}
window.onload = xinha_init;
</script>
Offline
where are you putting the command? It should look something like...
xinha_config = xinha_config ? xinha_config() : new HTMLArea.Config();
// vvvvvvvvvvvvvv COMMAND HERE vvvvvvvvvvvvvv
xinha_config.stylistLoadStylesheet('http://www.mysite.com/my.css', { '.body' : 'body', '.sub_head2' : 'subhead2'});
// ^^^^^^^^^^^ COMMAND HERE ^^^^^^^^^^^
xinha_editors = HTMLArea.makeEditors(xinha_editors, xinha_config, xinha_plugins);
James Sleeman
Offline
Well, one thing that stumbled me at first while trying to get the xinha text look like the one outputed in my page was that some id/class markup were (of course) not included, my content was sitting in a <div id="content"> on which I applied the style. I had to "hack" xinha so that the generated html body would be <body id="content"> instead of the empty default one.
Hope this helps solving your issue...
Offline
Pages: 1