docs: function buttonClick(e) {
  
      var editor = this,
          buttonDiv = e.target,
          buttonName = $.data(buttonDiv, BUTTON_NAME),
          button = buttons[buttonName],
          popupName = button.popupName,
          popup = popups[popupName];
  
      // Check if disabled
      if (editor.disabled || $(buttonDiv).attr(DISABLED) == DISABLED)
        return;
  
      // Fire the buttonClick event
      var data = {
        editor: editor,
        button: buttonDiv,
        buttonName: buttonName,
        popup: popup,
        popupName: popupName,
        command: button.command,
        useCSS: editor.options.useCSS
      };
  
      if (button.buttonClick && button.buttonClick(e, data) === false)
        return false;
  
      // Toggle source
      if (buttonName == "source") {
  
        // Show the iframe
        if (sourceMode(editor)) {
          delete editor.range;
          editor.$area.hide();
          editor.$frame.show();
          buttonDiv.title = button.title;
        }
  
        // Show the textarea
        else {
          editor.$frame.hide();
          editor.$area.show();
          buttonDiv.title = "Show Rich Text";
        }
  
        // Enable or disable the toolbar buttons
        // IE requires the timeout
        setTimeout(function() {refreshButtons(editor);}, 100);
  
      }
  
      // Check for rich text mode
      else if (!sourceMode(editor)) {
  
        // Handle popups
        if (popupName) {
          var $popup = $(popup);
  
          // URL
          if (popupName == "url") {
  
            // Check for selection before showing the link url popup
            if (buttonName == "link" && selectedText(editor) === "") {
              showMessage(editor, "A selection is required when inserting a link.", buttonDiv);
              return false;
            }
  
            // Wire up the submit button click event handler
            $popup.children(":button")
              .unbind(CLICK)
              .bind(CLICK, function() {
  
                // Insert the image or link if a url was entered
                var $text = $popup.find(":text"),
                  url = $.trim($text.val());
                if (url !== "")
                  execCommand(editor, data.command, url, null, data.button);
  
                // Reset the text, hide the popup and set focus
                $text.val("http://");
                hidePopups();
                focus(editor);
  
              });
  
          }
  
          // Paste as Text
          else if (popupName == "pastetext") {
  
            // Wire up the submit button click event handler
            $popup.children(":button")
              .unbind(CLICK)
              .bind(CLICK, function() {
  
                // Insert the unformatted text replacing new lines with break tags
                var $textarea = $popup.find("textarea"),
                  text = $textarea.val().replace(/\n/g, "<br />");
                if (text !== "")
                  execCommand(editor, data.command, text, null, data.button);
  
                // Reset the text, hide the popup and set focus
                $textarea.val("");
                hidePopups();
                focus(editor);
  
              });
  
          }
  
          // Show the popup if not already showing for this button
          if (buttonDiv !== $.data(popup, BUTTON)) {
            showPopup(editor, popup, buttonDiv);
            return false; // stop propagination to document click
          }
  
          // propaginate to documnt click
          return;
  
        }
  
        // Print
        else if (buttonName == "print")
          editor.$frame[0].contentWindow.print();
  
        // All other buttons
        else if (!execCommand(editor, data.command, data.value, data.useCSS, buttonDiv))
          return false;
  
      }
  
      // Focus the editor
      focus(editor);
  
    }