Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(176)

Side by Side Diff: third_party/pycoverage/coverage/htmlfiles/jquery.isonscreen.js

Issue 727003004: Add python coverage module to third_party (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 /* Copyright (c) 2010
2 * @author Laurence Wheway
3 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.p hp)
4 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
5 *
6 * @version 1.2.0
7 */
8 (function($) {
9 jQuery.extend({
10 isOnScreen: function(box, container) {
11 //ensure numbers come in as intgers (not strings) and re move 'px' is it's there
12 for(var i in box){box[i] = parseFloat(box[i])};
13 for(var i in container){container[i] = parseFloat(contai ner[i])};
14
15 if(!container){
16 container = {
17 left: $(window).scrollLeft(),
18 top: $(window).scrollTop(),
19 width: $(window).width(),
20 height: $(window).height()
21 }
22 }
23
24 if( box.left+box.width-container.left > 0 &&
25 box.left < container.width+container.left &&
26 box.top+box.height-container.top > 0 &&
27 box.top < container.height+container.top
28 ) return true;
29 return false;
30 }
31 })
32
33
34 jQuery.fn.isOnScreen = function (container) {
35 for(var i in container){container[i] = parseFloat(container[i])} ;
36
37 if(!container){
38 container = {
39 left: $(window).scrollLeft(),
40 top: $(window).scrollTop(),
41 width: $(window).width(),
42 height: $(window).height()
43 }
44 }
45
46 if( $(this).offset().left+$(this).width()-container.left > 0 &&
47 $(this).offset().left < container.width+container.left & &
48 $(this).offset().top+$(this).height()-container.top > 0 &&
49 $(this).offset().top < container.height+container.top
50 ) return true;
51 return false;
52 }
53 })(jQuery);
OLDNEW
« no previous file with comments | « third_party/pycoverage/coverage/htmlfiles/jquery.hotkeys.js ('k') | third_party/pycoverage/coverage/htmlfiles/jquery.min.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698