title: CKeditor Colorbox Integration
body: <p>I want to use colorbox inline image, which can be done using <a href="http://website-design.operationenterprise.com/articles/website-development/colorbox-ckeditor-drupal-7" rel="nofollow">http://website-design.operationenterprise.com/articles/website-development/colorbox-ckeditor-drupal-7</a>, but I want to automate the the process for it to be user friendly.</p>
  
  <p>The code I used</p>
  
  <pre><code>    CKEDITOR.on( 'dialogDefinition', function( ev )
  {
  
  var dialogName = ev.data.name;
  var dialogDefinition = ev.data.definition;
  
  
  if ( dialogName == 'image' )
  {
  var linkTab = dialogDefinition.getContents( 'info' );
  var link = linkTab.get( 'txtUrl' );
  
  link['onChange'] = function(evt){
  var dialog = CKEDITOR.dialog.getCurrent();
  dialog.getContentElement('Link', 'txtUrl').setValue(dialog.getContentElement('info', 'txtUrl').getValue());
    }
  
  if ( dialogName == 'link' )
      {
  
          var infoTab = dialogDefinition.getContents( 'advanced' );
  
  
          var cssField = infoTab.get( 'advCSSClasses' );
          cssField['default'] = 'colorbox-load';
      }
  }
  });
  </code></pre>
  
  <p>Copying url in image-link tab tab worked fine but setting default css in Link dialog didnot.</p>
  
  <p>I am no Java developer, so What am i doing wrong</p>
  
  <p>PLease HELP</p>