<commit_before>/**
 * Undo Module for the Cloud9 IDE
 *
 * @copyright 2010, Ajax.org B.V.
 * @license GPLv3 <http://www.gnu.org/licenses/gpl.txt>
 */

 /**
 * Refactor Module for the Cloud9 IDE
 *
 * @copyright 2010, Ajax.org B.V.
 * @license GPLv3 <http://www.gnu.org/licenses/gpl.txt>
 */
/*global define document apf*/
"use strict";
define(function(require, exports, module) {
    main.consumes = [
        "plugin", "menus", "tabs", "commands", "apf"
    ];
    main.provides = ["undo"];
    return main;

    function main(options, imports, register) {
        var Plugin      = imports.plugin;
        var menus       = imports.menus;
        var commands    = imports.commands;
        var tabs        = imports.tabs;

        /***** Initialization *****/

        var plugin = new Plugin("Ajax.org", main.consumes);
        var emit   = plugin.getEmitter();

        function canDo (actionName) {
            return function () {
                var page = tabs.focussedPage;
                return  page && page.document.undoManager[actionName]();
            };
        }

        var canUndo = canDo("canUndo");
        var canRedo = canDo("canRedo");

        var loaded = true;
        function load(callback){
            if (loaded) return false;
            loaded = true;

            commands.addCommand({
                name: "undo",
                exec: undo,
                isAvailable : canUndo
            }, plugin);
            commands.addCommand({
                name: "redo",
                exec: redo,
                isAvailable : canRedo
            }, plugin);

            menus.addItemByPath("Edit/Undo", new apf.item({<commit_msg>closeconfirmation plugin + enable the undo plugin<commit_after>/**
 * Undo Module for the Cloud9 IDE
 *
 * @copyright 2010, Ajax.org B.V.
 * @license GPLv3 <http://www.gnu.org/licenses/gpl.txt>
 */

 /**
 * Refactor Module for the Cloud9 IDE
 *
 * @copyright 2010, Ajax.org B.V.
 * @license GPLv3 <http://www.gnu.org/licenses/gpl.txt>
 */
/*global define document apf*/
"use strict";
define(function(require, exports, module) {
    main.consumes = [
        "plugin", "menus", "tabs", "commands", "apf"
    ];
    main.provides = ["undo"];
    return main;

    function main(options, imports, register) {
        var Plugin      = imports.plugin;
        var menus       = imports.menus;
        var commands    = imports.commands;
        var tabs        = imports.tabs;

        /***** Initialization *****/

        var plugin = new Plugin("Ajax.org", main.consumes);
        var emit   = plugin.getEmitter();

        function canDo (actionName) {
            return function () {
                var page = tabs.focussedPage;
                return  page && page.document.undoManager[actionName]();
            };
        }

        var canUndo = canDo("canUndo");
        var canRedo = canDo("canRedo");

        var loaded = false;
        function load(callback){
            if (loaded) return false;
            loaded = true;

            commands.addCommand({
                name: "undo",
                exec: undo,
                isAvailable : canUndo
            }, plugin);
            commands.addCommand({
                name: "redo",
                exec: redo,
                isAvailable : canRedo
            }, plugin);

            menus.addItemByPath("Edit/Undo", new apf.item({
{'fraction_non_alphanumeric': 0.12822031388806632, 'fraction_numerical': 0.0071068996150429374, 'mean_word_length': 1.7352226720647774, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, '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': '428304', 'n_tokens_mistral': 1026, 'n_tokens_neox': 946, 'n_words': 240}