Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
chandan
committed
Sep 16, 2010
1 parent
9120976
commit d22062a
Showing
13 changed files
with
843 additions
and
77 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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,49 +1,53 @@ | ||
= '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">' | ||
= '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">' | ||
%head | ||
%meta{:http_equiv => "Content-Type", :content=>"text/html", :charset=> 'utf-8'} | ||
%title | ||
Book Hunt | ||
%script{:src=>'/javascripts/jquery.js', :type=>"text/javascript"} | ||
%script{:src=>'/javascripts/jquery-ui.js', :type=>"text/javascript"} | ||
%meta{:http_equiv => "Content-Type", :content=>"text/html", :charset=> 'utf-8'} | ||
%title | ||
Book Hunt | ||
%script{:src=>'/javascripts/jquery.js', :type=>"text/javascript"} | ||
%script{:src=>'/javascripts/jquery-typewatch.js', :type=>"text/javascript"} | ||
%script{:src=>'/javascripts/jquery.autocomplete.min.js', :type=>"text/javascript"} | ||
%script{:src=>'/javascripts/jquery-ui.js', :type=>"text/javascript"} | ||
|
||
%link{:href=>'/stylesheets/layout.css', :media=>'screen, projection' , :rel=>"stylesheet", :type=>"text/css"} | ||
%link{:href=>'http://fonts.googleapis.com/css?family=Reenie+Beanie', :media=>'screen, projection' , :rel=>"stylesheet", :type=>"text/css"} | ||
%link{:href=>'/stylesheets/layout.css', :media=>'screen, projection' , :rel=>"stylesheet", :type=>"text/css"} | ||
%link{:href=>'/stylesheets/jquery.autocomplete.css', :media=>'screen, projection' , :rel=>"stylesheet", :type=>"text/css"} | ||
%link{:href=>'http://fonts.googleapis.com/css?family=Reenie+Beanie', :media=>'screen, projection' , :rel=>"stylesheet", :type=>"text/css"} | ||
%body | ||
#container | ||
#header | ||
.type_of_user_container | ||
%a{:href=>'books/add'} | ||
.seller.user | ||
%a{:href=>'books/search'} | ||
.buyer.user | ||
%a{:href=>'books/exchange'} | ||
.exchange.user | ||
#container | ||
#header | ||
.type_of_user_container | ||
%a{:href => book_index_url} | ||
.seller.user | ||
%a{:href => '#'} | ||
.buyer.user | ||
%a{:href => '#'} | ||
.exchange.user | ||
|
||
%a{:href=>'/'} | ||
.logo | ||
| ||
%a{:href=>'/'} | ||
.logo | ||
| ||
|
||
#content | ||
= yield | ||
#right_side_bar | ||
#footer | ||
.legalese | ||
Copyright © 2010. All Rights Reserved. Book hunt. | ||
%ul | ||
%li | ||
%a{:href=>"#"} | ||
Privacy Policy | ||
%li | ||
%a{:href=>"#"} | ||
About Us | ||
%li | ||
%a{:href=>"#"} | ||
Contact Us | ||
%li | ||
%a{:href=>"#"} | ||
FAQ | ||
%li | ||
%a{:href=>"#"} | ||
Sitemap | ||
#content | ||
= yield | ||
#right-side-bar | ||
|
||
#footer | ||
.legalese | ||
Copyright © 2010. All Rights Reserved. Book hunt. | ||
%ul | ||
%li | ||
%a{:href=>"#"} | ||
Privacy Policy | ||
%li | ||
%a{:href=>"#"} | ||
About Us | ||
%li | ||
%a{:href=>"#"} | ||
Contact Us | ||
%li | ||
%a{:href=>"#"} | ||
FAQ | ||
%li | ||
%a{:href=>"#"} | ||
Sitemap | ||
|
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,88 @@ | ||
/* | ||
* TypeWatch 2.0 - Original by Denny Ferrassoli / Refactored by Charles Christolini | ||
* | ||
* Examples/Docs: www.dennydotnet.com | ||
* | ||
* Copyright(c) 2007 Denny Ferrassoli - DennyDotNet.com | ||
* Coprright(c) 2008 Charles Christolini - BinaryPie.com | ||
* | ||
* Dual licensed under the MIT and GPL licenses: | ||
* http://www.opensource.org/licenses/mit-license.php | ||
* http://www.gnu.org/licenses/gpl.html | ||
*/ | ||
|
||
(function(jQuery) { | ||
jQuery.fn.typeWatch = function(o){ | ||
// Options | ||
var options = jQuery.extend({ | ||
wait : 750, | ||
callback : function() { }, | ||
highlight : true, | ||
captureLength : 2 | ||
}, o); | ||
|
||
function checkElement(timer, override) { | ||
var elTxt = jQuery(timer.el).val(); | ||
|
||
// Fire if text > options.captureLength AND text != saved txt OR if override AND text > options.captureLength | ||
if ((elTxt.length > options.captureLength && elTxt.toUpperCase() != timer.text) | ||
|| (override && elTxt.length > options.captureLength)) { | ||
timer.text = elTxt.toUpperCase(); | ||
timer.cb(elTxt); | ||
} | ||
}; | ||
|
||
function watchElement(elem) { | ||
// Must be text or textarea | ||
if (elem.type.toUpperCase() == "TEXT" || elem.nodeName.toUpperCase() == "TEXTAREA") { | ||
|
||
// Allocate timer element | ||
var timer = { | ||
timer : null, | ||
text : jQuery(elem).val().toUpperCase(), | ||
cb : options.callback, | ||
el : elem, | ||
wait : options.wait | ||
}; | ||
|
||
// Set focus action (highlight) | ||
if (options.highlight) { | ||
jQuery(elem).focus( | ||
function() { | ||
this.select(); | ||
}); | ||
} | ||
|
||
// Key watcher / clear and reset the timer | ||
var startWatch = function(evt) { | ||
var timerWait = timer.wait; | ||
var overrideBool = false; | ||
|
||
if (evt.keyCode == 13 && this.type.toUpperCase() == "TEXT") { | ||
timerWait = 1; | ||
overrideBool = true; | ||
} | ||
|
||
var timerCallbackFx = function() | ||
{ | ||
checkElement(timer, overrideBool) | ||
} | ||
|
||
// Clear timer | ||
clearTimeout(timer.timer); | ||
timer.timer = setTimeout(timerCallbackFx, timerWait); | ||
|
||
}; | ||
|
||
jQuery(elem).keydown(startWatch); | ||
} | ||
}; | ||
|
||
// Watch Each Element | ||
return this.each(function(index){ | ||
watchElement(this); | ||
}); | ||
|
||
}; | ||
|
||
})(jQuery); |
Oops, something went wrong.