Sha256: b91e6dd471046fd6a260853c0c3fbceefbb1400669494bed6b8988c74ffa2c5f

Contents?: true

Size: 1.73 KB

Versions: 1

Compression:

Stored size: 1.73 KB

Contents

o: ActiveSupport::Cache::Entry	:@compressedF:@expires_in0:@created_atf1416672640.237646:@value"‡{I"
class:ETI"ProcessedAsset;FI"logical_path;TI"locomotive/cmd.js;FI"
pathname;TI"}/Users/didier/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/locomotive_cms-2.5.5/vendor/assets/javascripts/locomotive/cmd.js;FI"content_type;TI"application/javascript;TI"
mtime;TI"2014-11-22T16:47:37+01:00;TI"length;TiÏI"digest;TI"%546aefd7b2a0ac7e25ebccb20b461e6c;FI"source;TI"Ï/**
 * Version 0.0.1
 * Catch the CTRL+S keys combination and trigger a callback
 * Didier Lafforgue
 */


$.cmd = function(key, callback, args, options) {
  var keyCode = key.charCodeAt(0);
  var altKeyCode = keyCode + (32 * (keyCode < 97 ? 1 : -1));

  options = (options || { ignoreCase: false });

  if (!options.ignoreCase) altKeyCode = null;

  doc = options.document || window.document;

  $(doc).keydown(function(e) {
    var isCtrl = false;

    if (!args) args = []; // IE barks when args is null

    if (e.ctrlKey || e.metaKey) isCtrl = true;

    if ((keyCode == e.which || altKeyCode == e.which) && isCtrl) {
      e.preventDefault();
      callback.apply(this, args);
      return false;
    }
  });

};
;TI"dependency_digest;TI"%bd22eb4d58ecf9f6dc4d082ffe96efeb;FI"required_paths;T[I"}/Users/didier/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/locomotive_cms-2.5.5/vendor/assets/javascripts/locomotive/cmd.js;FI"dependency_paths;T[{I"	path;TI"}/Users/didier/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/locomotive_cms-2.5.5/vendor/assets/javascripts/locomotive/cmd.js;FI"
mtime;TI"2014-11-22T16:47:37+01:00;TI"digest;TI"%821185653274928f27b2d64317761424;FI"
_version;TI"%ffd318ca8b794f42f5029101c2cf5d91;F

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
locomotivecms-search-0.3.6 spec/dummy/tmp/cache/assets/E07/900/sprockets%2F0e36cb278564a6b4e8bfede841cdfbf6