1/* 2 jquery.flatheights.js 3 Version: 2007-08-01 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 setsã«å«ã¾ããåè¦ç´ 群ã«å¯¾ãã¦é«ãæããå®è¡ */ 100 $.changeLetterSize.addHandler(function() { 101 $.each(sets, function() { 102 this.height('auto'); 103 flatHeights(this); 104 }); 105 }); 106 107})(jQuery); 108 109 110/* 111Copyright (c) 2007, KITAMURA Akatsuki 112 113Permission is hereby granted, free of charge, to any person obtaining a 114copy of this software and associated documentation files (the "Software"), 115to deal in the Software without restriction, including without limitation 116the rights to use, copy, modify, merge, publish, distribute, sublicense, 117and/or sell copies of the Software, and to permit persons to whom the 118Software is furnished to do so, subject to the following conditions: 119 120The above copyright notice and this permission notice shall be included 121in all copies or substantial portions of the Software. 122 123THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 124IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 125FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 126THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 127OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 128ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 129OTHER DEALINGS IN THE SOFTWARE. 130*/
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.