Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Site updated at 2013-02-19 15:16:23 UTC
- Loading branch information
1 parent
65f7388
commit bf5d9ec
Showing
35 changed files
with
4,080 additions
and
1,496 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,205 @@ | ||
|
||
<!DOCTYPE HTML> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Grabbing ctrl+input key with jQuery - Biki</title> | ||
<meta name="author" content="Basilico DevTeam"> | ||
|
||
|
||
<meta name="description" content="Snippet usage 1 | ||
2 | ||
3 | ||
$.ctrl('S', function() { //save | ||
}); Snippet source code plugin - jquery.ctrl.js 1 | ||
2 | ||
3 | ||
4 | ||
5 | ||
6 | ||
7 | ||
8 | ||
9 | ||
$.ctrl = function(key, …"> | ||
|
||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> | ||
|
||
<link href="/atom.xml" rel="alternate" title="Biki" type="application/atom+xml"> | ||
<link rel="canonical" href=""> | ||
<link href="/favicon.png" rel="shortcut icon"> | ||
<link href="/stylesheets/screen.css" media="screen, projection" rel="stylesheet" type="text/css"> | ||
<!--[if lt IE 9]><script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]--> | ||
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> | ||
|
||
</head> | ||
|
||
<body> | ||
<header id="header" class="inner"><h1><a href="/">Biki</a></h1> | ||
<nav id="main-nav"><ul class="main"> | ||
<li><a href="/">Blog</a></li> | ||
<li><a href="/blog/archives">Archives</a></li> | ||
</ul> | ||
</nav> | ||
<nav id="mobile-nav"> | ||
<div class="alignleft menu"> | ||
<a class="button">Menu</a> | ||
<div class="container"><ul class="main"> | ||
<li><a href="/">Blog</a></li> | ||
<li><a href="/blog/archives">Archives</a></li> | ||
</ul> | ||
</div> | ||
</div> | ||
<div class="alignright search"> | ||
<a class="button"></a> | ||
<div class="container"> | ||
<form action="http://google.com/search" method="get"> | ||
<input type="text" name="q" results="0"> | ||
<input type="hidden" name="q" value="site:basilico.github.com"> | ||
</form> | ||
</div> | ||
</div> | ||
</nav> | ||
<nav id="sub-nav" class="alignright"> | ||
<div class="social"> | ||
|
||
|
||
|
||
<a class="twitter" href="http://twitter.com/basilico_int" title="Twitter">Twitter</a> | ||
|
||
|
||
<a class="github" href="https://github.com/basilico" title="GitHub">GitHub</a> | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<a class="rss" href="/atom.xml" title="RSS">RSS</a> | ||
|
||
</div> | ||
<form class="search" action="http://google.com/search" method="get"> | ||
<input class="alignright" type="text" name="q" results="0"> | ||
<input type="hidden" name="q" value="site:basilico.github.com"> | ||
</form> | ||
</nav> | ||
|
||
</header> | ||
|
||
|
||
<div id="banner" class="inner"> | ||
<div class="container"> | ||
<ul class="feed"></ul> | ||
</div> | ||
<small><a href="http://twitter.com/basilico_int">basilico_int</a> @ <a href="http://twitter.com">Twitter</a></small> | ||
<div class="loading">Loading...</div> | ||
</div> | ||
<script src="/javascripts/twitter.js"></script> | ||
<script type="text/javascript"> | ||
(function($){ | ||
$('#banner').getTwitterFeed('basilico_int', 4, false); | ||
})(jQuery); | ||
</script> | ||
|
||
|
||
<div id="content" class="inner"><article class="post"> | ||
<h2 class="title">Grabbing ctrl+input key with jQuery</h2> | ||
<div class="entry-content"><p>Snippet usage</p> | ||
|
||
<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span> | ||
<span class='line-number'>2</span> | ||
<span class='line-number'>3</span> | ||
</pre></td><td class='code'><pre><code class='javascript'><span class='line'><span class="nx">$</span><span class="p">.</span><span class="nx">ctrl</span><span class="p">(</span><span class="s1">'S'</span><span class="p">,</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span> | ||
</span><span class='line'> <span class="c1">//save</span> | ||
</span><span class='line'><span class="p">});</span> | ||
</span></code></pre></td></tr></table></div></figure> | ||
|
||
|
||
<p>Snippet source code</p> | ||
|
||
<figure class='code'><figcaption><span>plugin - jquery.ctrl.js </span></figcaption> | ||
<div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span> | ||
<span class='line-number'>2</span> | ||
<span class='line-number'>3</span> | ||
<span class='line-number'>4</span> | ||
<span class='line-number'>5</span> | ||
<span class='line-number'>6</span> | ||
<span class='line-number'>7</span> | ||
<span class='line-number'>8</span> | ||
<span class='line-number'>9</span> | ||
</pre></td><td class='code'><pre><code class='js'><span class='line'><span class="nx">$</span><span class="p">.</span><span class="nx">ctrl</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">key</span><span class="p">,</span> <span class="nx">callback</span><span class="p">,</span> <span class="nx">args</span><span class="p">)</span> <span class="p">{</span> | ||
</span><span class='line'> <span class="nx">$</span><span class="p">(</span><span class="nb">document</span><span class="p">).</span><span class="nx">keydown</span><span class="p">(</span><span class="kd">function</span><span class="p">(</span><span class="nx">e</span><span class="p">)</span> <span class="p">{</span> | ||
</span><span class='line'> <span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="nx">args</span><span class="p">)</span> <span class="nx">args</span><span class="o">=</span><span class="p">[];</span> <span class="c1">// IE barks when args is null</span> | ||
</span><span class='line'> <span class="k">if</span><span class="p">(</span><span class="nx">e</span><span class="p">.</span><span class="nx">keyCode</span> <span class="o">==</span> <span class="nx">key</span><span class="p">.</span><span class="nx">charCodeAt</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span> <span class="o">&&</span> <span class="nx">e</span><span class="p">.</span><span class="nx">ctrlKey</span><span class="p">)</span> <span class="p">{</span> | ||
</span><span class='line'> <span class="nx">callback</span><span class="p">.</span><span class="nx">apply</span><span class="p">(</span><span class="k">this</span><span class="p">,</span> <span class="nx">args</span><span class="p">);</span> | ||
</span><span class='line'> <span class="k">return</span> <span class="kc">false</span><span class="p">;</span> | ||
</span><span class='line'> <span class="p">}</span> | ||
</span><span class='line'> <span class="p">});</span> | ||
</span><span class='line'><span class="p">};</span> | ||
</span></code></pre></td></tr></table></div></figure> | ||
|
||
|
||
|
||
</div> | ||
|
||
|
||
<div class="meta"> | ||
<div class="date"> | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<time datetime="2013-02-19T12:00:00+01:00" pubdate data-updated="true">Feb 19<span>th</span>, 2013</time></div> | ||
<div class="tags"> | ||
|
||
|
||
<a class='category' href='/blog/categories/jquery/'>jquery</a>, <a class='category' href='/blog/categories/keyboard/'>keyboard</a>, <a class='category' href='/blog/categories/user-input/'>user input</a> | ||
|
||
|
||
</div> | ||
|
||
</div></article> | ||
|
||
<div class="share"> | ||
<div class="addthis_toolbox addthis_default_style "> | ||
|
||
<a class="addthis_button_facebook_like" fb:like:layout="button_count"></a> | ||
|
||
|
||
<a class="addthis_button_tweet"></a> | ||
|
||
|
||
<a class="addthis_counter addthis_pill_style"></a> | ||
</div> | ||
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid="></script> | ||
</div> | ||
|
||
|
||
</div> | ||
<footer id="footer" class="inner">Copyright © 2013 | ||
|
||
Basilico DevTeam | ||
|
||
</footer> | ||
<script src="/javascripts/slash.js"></script> | ||
<script src="/javascripts/jquery.fancybox.pack.js"></script> | ||
<script type="text/javascript"> | ||
(function($){ | ||
$('.fancybox').fancybox(); | ||
})(jQuery); | ||
</script> <!-- Delete or comment this line to disable Fancybox --> | ||
|
||
|
||
|
||
|
||
|
||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.