[ Index ]

PHP Cross Reference of Drupal 6 (yi-drupal)

title

Body

[close]

/sites/all/modules/ckeditor/includes/ -> ckeditor.admin.js (source)

   1  /*
   2  Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
   3  For licensing, see LICENSE.html or http://ckeditor.com/license
   4  */
   5  $(document).ready(function() {
   6    if ($('#edit-uicolor-textarea').length) {
   7      if (typeof(CKEDITOR) == "undefined")
   8          return;
   9  
  10      CKEDITOR.on( 'dialogDefinition', function( ev )
  11      {
  12          var dialogName = ev.data.name;
  13          var dialogDefinition = ev.data.definition;
  14  
  15          if ( dialogName == 'uicolor' )
  16          {
  17          // Get a reference to the configBox and hide it (cannot be removed).
  18          var configBox = dialogDefinition.getContents( 'tab1' ).get( 'configBox' );
  19          configBox.style = 'display:none';
  20          }
  21      });
  22      $('#edit-uicolor-textarea').show();
  23  
  24      Drupal.ckeditorUiColorOnChange = function() {
  25          var color = CKEDITOR.instances["edit-uicolor-textarea"].getUiColor();
  26          $("#edit-uicolor").val("custom");
  27          if (typeof(color) != "undefined") {
  28          if (color == "default"){
  29              $("#edit-uicolor").val("default");
  30          }
  31          $('#edit-uicolor-user').val(color);
  32          }
  33      };
  34  
  35      CKEDITOR.replace("edit-uicolor-textarea",
  36      {
  37          extraPlugins : 'uicolor',
  38          height: 60,
  39          uiColor: $('#edit-uicolor-user').val() || '#D3D3D3',
  40          width: 400,
  41          toolbar : [[ 'Bold', 'Italic', '-', 'NumberedList', 'BulletedList'],[ 'UIColor' ]],
  42          on:
  43          {
  44          focus : Drupal.ckeditorUiColorOnChange,
  45          blur : Drupal.ckeditorUiColorOnChange
  46          }
  47      });
  48  
  49      $("#edit-uicolor").bind("change", function() {
  50          if (typeof(Drupal.settings.ckeditor_uicolor) != "undefined") {
  51          CKEDITOR.instances["edit-uicolor-textarea"].setUiColor(Drupal.settings.ckeditor_uicolor[$(this).val()]);
  52          }
  53          if ($(this).val() != "custom") {
  54          $('#edit-uicolor-user').val("");
  55          }
  56          else {
  57          var color = CKEDITOR.instances["edit-uicolor-textarea"].getUiColor();
  58          if (typeof(color) != "undefined") {
  59              $('#edit-uicolor-user').val(color);
  60          }
  61          }
  62      });
  63    }
  64    $(".cke_load_toolbar").click(function() {
  65      var buttons = eval('Drupal.settings.'+$(this).attr("id"));
  66      var text = "[\n";
  67      for(i in buttons) {
  68        if (typeof buttons[i] == 'string'){
  69          text = text + "    '/',\n";
  70        }
  71        else {
  72          text = text + "    [";
  73          max = buttons[i].length - 1;
  74          rows = buttons.length - 1;
  75          for (j in buttons[i]) {
  76            if (j < max){
  77              text = text + "'" + buttons[i][j] + "',";
  78            } else {
  79              text = text + "'" + buttons[i][j] + "'";
  80            }
  81          }
  82          if (i < rows){
  83            text = text + "],\n";
  84          } else {
  85            text = text + "]\n";
  86          }
  87        }
  88      }
  89  
  90      text = text + "]";
  91      text = text.replace(/\['\/'\]/g,"'/'");
  92      $("#edit-toolbar").attr('value',text);
  93      if (Drupal.settings.ckeditor_toolbar_wizard == 't'){
  94        Drupal.ckeditorToolbarReload();
  95      }
  96      return false;
  97    });
  98  
  99    if (Drupal.settings.ckeditor_toolbar_wizard == 'f'){
 100      $("form#ckeditor-admin-profile-form textarea#edit-toolbar, form#ckeditor-admin-profile-form #edit-toolbar + .grippie, form#ckeditor-admin-global-profile-form textarea#edit-toolbar, form#ckeditor-admin-global-profile-form #edit-toolbar + .grippie").show();
 101    }
 102  });


Generated: Mon Jul 9 18:01:44 2012 Cross-referenced by PHPXref 0.7