// Generated by CoffeeScript 1.8.0

/*
 * MagPleasure Ltd.
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the EULA
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://www.magpleasure.com/LICENSE.txt
 *
 * @category   Magpleasure
 * @package    Magpleasure_Blog
 * @copyright  Copyright (c) 2012-2015 MagPleasure Ltd. (http://www.magpleasure.com)
 * @license    http://www.magpleasure.com/LICENSE.txt
 */
RedactorPlugins.undo = function() {
  return {
    init: function() {
      var redo, undo;
      undo = this.button.addFirst('undo', 'Undo');
      redo = this.button.addAfter('undo', 'redo', 'Redo');
      this.button.addCallback(undo, function() {
        this.buffer.undo();
        this.code.sync();
      });
      this.button.addCallback(redo, function() {
        this.buffer.redo();
        this.code.sync();
      });
    }
  };
};
