lib/thoth/public/js/thoth.js
/**
   * Attaches keyboard shortcut event listeners.
   *
   * @method attachKeys
   * @private
   */
Attaches keyboard shortcut event listeners.
@method attachKeys
@private
Attaches keyboard shortcut event listeners . @method attachKeys @private
function attachKeys() {
    var inputs    = d.body.getElementsByTagName('input'),
        selects   = d.body.getElementsByTagName('select'),
        textareas = d.body.getElementsByTagName('textarea');
    next = yud.get('next_url');
    prev = yud.get('prev_url');
    hotKeys.ctrl_alt_a = new yut.KeyListener(d,
        { ctrl: true, alt: true, keys: 65 }, Thoth.toggleAdminToolbar);
    hotKeys.n = new yut.KeyListener(d, { keys: 78 }, handleKeyNext);
    hotKeys.p = new yut.KeyListener(d, { keys: 80 }, handleKeyPrev);
    yue.on(inputs, 'blur', enableKeys, Thoth, true);
    yue.on(inputs, 'focus', disableKeys, Thoth, true);
    yue.on(selects, 'blur', enableKeys, Thoth, true);
    yue.on(selects, 'focus', disableKeys, Thoth, true);
    yue.on(textareas, 'blur', enableKeys, Thoth, true);
    yue.on(textareas, 'focus', disableKeys, Thoth, true);
    enableKeys();
  }
function attachKeys ( ) { var inputs = d . body . getElementsByTagName ( 'input' ) , selects = d . body . getElementsByTagName ( 'select' ) , textareas = d . body . getElementsByTagName ( 'textarea' ) ; next = yud . get ( 'next_url' ) ; prev = yud . get ( 'prev_url' ) ; hotKeys . ctrl_alt_a = new yut . KeyListener ( d , { ctrl : true , alt : true , keys : 65 } , Thoth . toggleAdminToolbar ) ; hotKeys . n = new yut . KeyListener ( d , { keys : 78 } , handleKeyNext ) ; hotKeys . p = new yut . KeyListener ( d , { keys : 80 } , handleKeyPrev ) ; yue . on ( inputs , 'blur' , enableKeys , Thoth , true ) ; yue . on ( inputs , 'focus' , disableKeys , Thoth , true ) ; yue . on ( selects , 'blur' , enableKeys , Thoth , true ) ; yue . on ( selects , 'focus' , disableKeys , Thoth , true ) ; yue . on ( textareas , 'blur' , enableKeys , Thoth , true ) ; yue . on ( textareas , 'focus' , disableKeys , Thoth , true ) ; enableKeys ( ) ; }
Attaches keyboard shortcut event listeners.
Attaches keyboard shortcut event listeners .
// Stop listening for hotkeys when a form element gets focus.