You are not logged in.
Hi there,
I'm having real problems trying to get the Stylist plugin to work.
Basically I have an out-of-the-box installation of Xinha and I just can't find any decent documentation on how to use it. Most of the examples I've found on the internet suggest things like:
xinha_config.stylistLoadStylesheet(....
However in the default installation, there is no variable called xinha_config set up, only the random _8f etc instances of the Xinha.Config
Below is the code I've managed to hack up but it complains that _8f.stylistLoadStylesheet is not a function however to get to that point it must have successfully loaded it. So what object should I be calling the stylistLoadStylesheet from?
url=_editor_url+"plugins/Stylist/stylist.js";
if(!Xinha.loadPlugins(["Stylist"],function(){
_8f.generate();
},url)){
return false;
}else{
if(typeof Stylist != 'undefined') {
_8f.stylistLoadStylesheet('/includes/css/site.css');
}
}
Any help with this would be massively appreciated, I've wasted hours on this
Offline
xinha_config refers to a instance of Xinha.Config that is passed to the Xinha constructor as explained in the NewbieGuide, which is the recommended way to setup Xinha. The files and some other examples are also in the folder examples of the Xinha distribution. If you read this, I think you will know how it works.
The _8f does not stand for any object but for "this" in the Xinha (not Xinha.Config) class, as it seems you have taken and adapted this snippet out of the function Xinha.prototype.generate from the compressed source code. This is only internal code you don't have to mess with. In case you are interested in further reading and understandig the source code (now that your already so deep in it ) you should not take the compressed code of the distribution, but check it out via svn
Offline
Thanks for the response, however I'm not sure what object stylistLoadStylesheet() belongs to.
If I use something like the following:
var xinha_config = new Xinha.Config();
xinha_config.stylistLoadStylesheet("/includes/css/site.css");
It still says that stylistLoadStylesheet() is not a function, as per above I've tried using the stylistLoadStylesheet() function with every instance of Xinha.Config() I can find but it doesn't work for any of them.
Offline