Playing nicely with jQuery – Introducing jCUI

Currently, it is possible to get our components to play nicely with jQuery, but that required that jQuery.noConflict() be used. While that is a good plan regardless, we realize the pain it is to go through all the Javascript and remove the $ and replace with with some other variable such as $ntb. So, we decided to do it for you.

Currently on the nitobi github, there is an experimental branch that is called jcui. This is a branch that we are testing against the jQuery Javascript Framework to make sure that it doesn’t matter where you put your jQuery, the components should still work.

If people want to play with the jCUI branch and test it out, they can do so by going to the same URL as they would for the other github projects:

git clone git://github.com/nitobi/completeui.git

Here’s a VERY rough Wiki page I threw up for getting started with using the Complete UI source code for development. This is a very good way to help fix bugs, since it can turn things like:

nitobi.callout.Callout.getStyleSheetUrl=function(){
  if(nitobi.callout.Callout.globalStylesheet==null){
    var _33=nitobi.html.Css.getRule("ntb"+nitobi.callout.lastStyle);
    nitobi.callout.Callout.globalStylesheet=nitobi.html.Css.getPath(_33.parentStyleSheet);
    return nitobi.callout.Callout.globalStylesheet;
  }else{
    return nitobi.callout.Callout.globalStylesheet;
  }

to look more like:

nitobi.callout.Callout.getStyleSheetUrl = function()
{
	if (nitobi.callout.Callout.globalStylesheet	== null)
	{
		var rule = nitobi.html.Css.getRule('ntb' + nitobi.callout.lastStyle);
		nitobi.callout.Callout.globalStylesheet = nitobi.html.Css.getPath(rule.parentStyleSheet);
		return nitobi.callout.Callout.globalStylesheet;
	}
	else
	{
		return nitobi.callout.Callout.globalStylesheet;
	}
}

Also, if anyone thinks this is interesting, please let us know on the Google Group.