<commit_before><?php

class sfWidgetFormInputCkeditor extends sfWidgetFormTextarea
{
  public function render($name, $value = null, $attributes = array(), $errors = array())
  {
    if(isset($attributes['class'])) {
      $attributes['class'].= " ckeditorDone";
    }
    else {
      $attributes['class'] = "ckeditorDone";
    }
    return parent::render($name, $value, $attributes, $errors).sprintf(<<<EOF
<script type="text/javascript">
	CKEDITOR.replace('%s');
</script>
EOF
            , $this->generateId($name, $value));
  }

  public function getJavaScripts()
  {
    return array_merge(parent::getJavaScripts(), array(public_path('/sfEPFactoryFormPlugin/ckeditor/ckeditor.js')));
  }
}<commit_msg>update ckeditor widget<commit_after><?php

class sfWidgetFormInputCkeditor extends sfWidgetFormTextarea
{
  protected function configure($options = array(), $attributes = array()) {
    parent::configure($options, $attributes);
    $this->addOption('width', 635);
    $this->addOption('height', 400);
  }

  public function render($name, $value = null, $attributes = array(), $errors = array())
  {
    if(isset($attributes['class'])) {
      $attributes['class'].= " ckeditorDone";
    }
    else {
      $attributes['class'] = "ckeditorDone";
    }
    return parent::render($name, $value, $attributes, $errors).sprintf(<<<EOF
<script type="text/javascript">
  CKEDITOR.replace('%s', {
    width: %s,
    height: %s
  });
</script>
EOF
            , $this->generateId($name, $value)
            , $this->getOption('width')
            , $this->getOption('height')
            );
  }

  public function getJavaScripts()
  {
    return array_merge(parent::getJavaScripts(), array(public_path('/sfEPFactoryFormPlugin/ckeditor/ckeditor.js')));
  }
}
{'fraction_non_alphanumeric': 0.1751283513976041, 'fraction_numerical': 0.0034227039361095267, 'mean_word_length': 4.011428571428572, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3946088', 'n_tokens_mistral': 549, 'n_tokens_neox': 538, 'n_words': 96}