1/* 2 jquery.flatheights.js 3 Version: 2010-09-15 4*/ 5 6/* 7====================================================================== 8 $.changeLetterSize.addHandler(func) 9 æåã®å¤§ãããå¤åããæã«å®è¡ããå¦çã追å 10====================================================================== 11*/ 12 13jQuery.changeLetterSize = { 14 handlers : [], 15 interval : 1000, 16 currentSize: 0 17}; 18 19(function($) { 20 21 var self = $.changeLetterSize; 22 23 /* æåã®å¤§ããã確èªããããã®insè¦ç´ */ 24 var ins = $('<ins>M</ins>').css({ 25 display: 'block', 26 visibility: 'hidden', 27 position: 'absolute', 28 padding: '0', 29 top: '0' 30 }); 31 32 /* æåã®å¤§ãããå¤ãã£ãã */ 33 var isChanged = function() { 34 ins.appendTo('body'); 35 var size = ins[0].offsetHeight; 36 ins.remove(); 37 if (self.currentSize == size) return false; 38 self.currentSize = size; 39 return true; 40 }; 41 42 /* ææ¸ãèªã¿è¾¼ãã æç¹ã§ 43 æåã®å¤§ããã確èªãã¦ãã */ 44 $(isChanged); 45 46 /* æåã®å¤§ãããå¤ãã£ã¦ãããã 47 handlersä¸ã®é¢æ°ãé ã«å®è¡ */ 48 var observer = function() { 49 if (!isChanged()) return; 50 $.each(self.handlers, function(i, handler) { 51 handler(); 52 }); 53 }; 54 55 /* ãã³ãã©ãç»é²ãã 56 æåã®ç»é²ã§ããã°ã宿å¦çãéå§ */ 57 self.addHandler = function(func) { 58 self.handlers.push(func); 59 if (self.handlers.length == 1) { 60 setInterval(observer, self.interval); 61 } 62 }; 63 64})(jQuery); 65 66/* 67====================================================================== 68 $(expr).flatHeights() 69 $(expr)ã§é¸æããè¤æ°ã®è¦ç´ ã«ã¤ãã¦ãããããé«ãã 70 ä¸çªé«ããã®ã«æãã 71====================================================================== 72*/ 73 74(function($) { 75 76 /* 対象ã¨ãªãè¦ç´ 群ã®éå */ 77 var sets = []; 78 79 /* é«ãæãã®å¦çæ¬ä½ */ 80 var flatHeights = function(set) { 81 var maxHeight = 0; 82 set.each(function(){ 83 var height = this.offsetHeight; 84 if (height > maxHeight) maxHeight = height; 85 }); 86 set.css('height', maxHeight + 'px'); 87 }; 88 89 /* è¦ç´ 群ã®é«ããæããsetsã«è¿½å */ 90 jQuery.fn.flatHeights = function() { 91 if (this.length > 1) { 92 flatHeights(this); 93 sets.push(this); 94 } 95 return this; 96 }; 97 98 /* é«ãæããåå®è¡ããå¦ç */ 99 var reflatting = function() { 100 $.each(sets, function() { 101 this.height('auto'); 102 flatHeights(this); 103 }); 104 }; 105 106 /* æåã®å¤§ãããå¤ãã£ãæã«é«ãæããåå®è¡ */ 107 $.changeLetterSize.addHandler(reflatting); 108 109 /* ã¦ã£ã³ãã¦ã®å¤§ãããå¤ãã£ãæã«é«ãæããåå®è¡ */ 110 $(window).resize(reflatting); 111 112})(jQuery); 113 114 115/* 116Copyright (c) 2007, KITAMURA Akatsuki 117 118Permission is hereby granted, free of charge, to any person obtaining a 119copy of this software and associated documentation files (the "Software"), 120to deal in the Software without restriction, including without limitation 121the rights to use, copy, modify, merge, publish, distribute, sublicense, 122and/or sell copies of the Software, and to permit persons to whom the 123Software is furnished to do so, subject to the following conditions: 124 125The above copyright notice and this permission notice shall be included 126in all copies or substantial portions of the Software. 127 128THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 129IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 130FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 131THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 132OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 133ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 134OTHER DEALINGS IN THE SOFTWARE. 135*/
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.