markdown-note/markdown-notes

View on GitHub
src/browser/notes/note-keybindings.js

Summary

Maintainability
A
0 mins
Test Coverage
/***********************************************************
 * Contains the event bindings and details about
 * when they are to fire.
 *
 * Each number represents the event ID.
 * 'typeOfEvent' : [{
 *         // if not specified then applicable for both states.
 *         isEditable : 'does the note have to be in editable state?',
 *         isComplete : 'is it valid only for isCompleteNotes'
 *         shiftModifier : 'is shift modifier necessary? mandatory',
 *         cb : callback method
 *
 * }]
 * @author : Abijeet Patro
 ******************************************************/
'use strict';

var keybindings = {
  'keypress': {
    3: [{
      comment: 'Mark a note as complete on Ctrl + Shift + C',
      isEditable: false,
      isReadOnly: false,
      shiftModifier: true,
      cb: 'markNoteAsComplete'
    }],
    19: [{
      comment: 'Save a note on pressing Ctrl + S',
      isEditable: true,
      isComplete: false,
      isReadOnly: false,
      shiftModifier: false,
      cb: 'saveNote'
    }],
    14: [{
      comment: 'Save and create a note Ctrl + N',
      shiftModifier: false,
      isReadOnly: false,
      cb: 'saveAndCreateNote'
    }],
    4: [{
      comment: 'Delete note Ctrl + D',
      shiftModifier: false,
      cb: 'deleteNote'
    }],
    5: [{
      comment: 'Makes a note editable Ctrl + E',
      isEditable: false,
      isReadOnly: false,
      isComplete: false,
      shiftModifier: false,
      cb: 'makeNoteEditable'
    }],
    15: [{
      comment: 'Move the note to another date',
      cb: 'displayNoteDateDlg'
    }],
    5555: [{

    }]
  },
  'keydown': {

  }
};

module.exports = keybindings;