<commit_before>function appStaffNewsManage() {}

/**
 * Init manage page
 */
appStaffNewsManage.prototype.init = function() {

    var self = this;
    self.$form = $('.form-horizontal');

    // On language changed
    $('select', self.$form).on('change', function() {
        self.onchange();
    });

    // On title changed
    $('input', self.$form).on('keydown', function() {
        self.onchange();
    });

    // Init ckeditor
    self.editor = CKEDITOR.replace($('textarea.content', self.$form)[0], {
        extraPlugins: 'onchange',
        height: '400px'
    });
    self.editor.on('change', function(e) {
        self.onchange();
    });

};

/**
 * On change event
 */
appStaffNewsManage.prototype.onchange = function() {
    $('.btn.save-news').prop('disabled', false);
};<commit_msg>#28 added Ctrl+S for saving news<commit_after>function appStaffNewsManage() {}

/**
 * Init manage page
 */
appStaffNewsManage.prototype.init = function() {

    var self = this;
    self.$form = $('.form-horizontal');

    $(document).on('keydown', function(e) {
        if (e.ctrlKey && e.keyCode === 83) {
            self.save();
            e.preventDefault();
        }
    });

    // On language changed
    $('select', self.$form).on('change', function() {
        self.onchange();
    });

    // On title changed
    $('input', self.$form).on('keydown', function() {
        self.onchange();
    });

    // Init ckeditor
    self.editor = CKEDITOR.replace($('textarea.content', self.$form)[0], {
        extraPlugins: 'onchange',
        height: '400px'
    });
    self.editor.on('change', function(e) {
        self.onchange();
    });

    self.editor.addCommand("saveNews", {
        exec: function () {
            self.save();
        },
        modes: {
            wysiwyg: 1,
            source: 1
        },
        readOnly: 1,
        canUndo: !1
    });

    self.editor.setKeystroke(CKEDITOR.CTRL + 83, "saveNews");

};

/**
 * On change event
 */
appStaffNewsManage.prototype.onchange = function() {
    $('.btn.save-news').prop('disabled', false);
};

appStaffNewsManage.prototype.save = function() {
    $('.btn.save-news').click();
}
{'fraction_non_alphanumeric': 0.18983833718244802, 'fraction_numerical': 0.008314087759815243, 'mean_word_length': 2.368584758942457, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6628583', 'n_tokens_mistral': 713, 'n_tokens_neox': 675, 'n_words': 122}