CINXE.COM
author:Benjamin C. Pierce | カーリル
<!DOCTYPE html> <html lang="ja"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>author:Benjamin C. Pierce | カーリル</title> <link rel="icon" type="image/png" href="/favicon-32x32.png" sizes="32x32"> <link rel="icon" type="image/png" href="/favicon-16x16.png" sizes="16x16"> <link rel="manifest" href="/manifest.json"> <link rel="mask-icon" href="/safari-pinned-tab.svg" color="#00A1EA"> <meta name="msapplication-TileColor" content="#00A1EA"> <meta name="msapplication-TileImage" content="/mstile-144x144.png"> <meta name="theme-color" content="#00A1EA"> <link rel="search" type="application/opensearchdescription+xml" href="https://calil.jp/public/search.xml" title="カーリル" /> <link rel="alternate" type="application/rss+xml" title="カーリルのブログ" href="https://blog.calil.jp/feed" /> <link rel="apple-touch-icon-precomposed" href="/public/img/parts/apple-touch-icon.png" /> <meta name="mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="application-name" content="カーリル" /> <link rel="stylesheet" href="/public/web-html/css/index.css"> <style type="text/css" media="print"> #menu, #menu_sp, .navigation { display: none; } #next, #next * { -webkit-print-color-adjust: exact; } </style> <meta name="twitter:card" content="summary"> <meta name="twitter:site" content="@caliljp"> <meta property="fb:app_id" content="270660792981320"/> <meta property="og:title" content="カーリルで「author:Benjamin C. Pierce」を検索"/> <meta property="og:type" content="website"/> <meta property="og:url" content="https://calil.jp/search?q=author%3ABenjamin+C.+Pierce"/> <meta property="og:image" content="/cover/4274069117"/> <meta property="og:site_name" content="カーリル"/> <meta property="og:description" content="カーリルは全国7000以上の図書館から書籍とその貸し出し状況を簡単に横断検索できるサービスです。" /> <!-- Google tag (gtag.js) --> <script async src="https://www.googletagmanager.com/gtag/js?id=G-S0SYRD0CEW"></script> <script> var dnt = navigator.doNotTrack || window.doNotTrack || navigator.msDoNotTrack; if (dnt!=='1' && dnt!=='yes') { window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-S0SYRD0CEW'); } else { console.log('Do-Not-Track, not loading analytics.'); window.gtag = function() {}; } </script> </head> <body> <div id="menu"> <div class="container"> <a href="/"> <img src="/public/web-html/assets/home.svg" title="ホーム"> </a> <a href="/popular/">今話題の本</a><a href="/library/">図書館マップ</a><a href="/recipe">本のレシピ</a><a class="large" href="/list">読みたいリスト</a> <div class="dropdown"> <button aria-disabled="true" onclick="event.target.focus();">もっと見る<span class="caret" aria-hidden="true">▼</span></button> <div class="menu" role="menubar"> <a tabindex="0" class="small" href="/list">読みたいリスト</a> <a tabindex="0" href="/review/">書評</a> <a tabindex="0" href="/local/">カーリルローカル</a> <a tabindex="0" href="/touch/">カーリルタッチ</a> <a tabindex="0" href="/stamp">図書館スタンプラリー</a> </div> </div> <div class="right"> <a href="/login?redirect=/search%3Fq%3Dauthor%253ABenjamin%2BC.%2BPierce">ログイン・新規登録</a> <div class="dropdown"> <button aria-disabled="true" onclick="event.target.focus();">設定<span class="caret">▼</span> </button> <div class="menu" role="menubar" aria-label="設定"> <a tabindex="0" href="/settings">お気に入り図書館</a> <a tabindex="0" href="/profile/source">高度な検索設定</a> <a tabindex="0" href="/login?redirect=/search%3Fq%3Dauthor%253ABenjamin%2BC.%2BPierce">ログイン</a> </div> </div> </div> </div> </div> <div id="menu_sp" role="menu"> <div class="container"> <a class="logo" href="/"> <img src="/public/web-html/assets/logo-sp.svg" title="カーリル"> </a> <a class="login" href="/login?redirect=/search%3Fq%3Dauthor%253ABenjamin%2BC.%2BPierce">ログイン</a> <a class="setting" href="/settings">図書館の設定</a> <a href="/popular/">今話題の本</a> <a href="/library/">図書館マップ</a> <a href="/recipe">本のレシピ</a> <a href="/list">読みたいリスト</a> <a href="/review/">書評</a> <a href="/local/">ローカル</a> <a href="/stamp">スタンプラリー</a> </div> </div> <nav class="navigation"> <button class="menu_icon" aria-label="メニュー" aria-haspopup="true" aria-controls="menu_sp"></button> </nav> <div id="next" class="search"> <div class="container"> <a class="logo" href="/" title="カーリルのホームに戻る"> <picture> <source media="(max-width: 1024px)" srcset="/public/web-html/assets/logo-mini.svg"> <img src="/public/web-html/assets/logo.svg" alt="日本最大の図書館蔵書検索・カーリル"> </picture> </a> <form action="/search" method="get"><input name="q" type="search" value="author:Benjamin C. Pierce" placeholder="" autocomplete="off" autofocus="true"><button type="submit">さがす</button></form> </div> </div> <div id="result"> <div class="infobar" id="info_bar"> <span>お気に入り図書館を設定すると、貸出状況が表示されます</span> <a href="/settings" class="selectArea"> エリアを選ぶ </a> <a href="javascript:calil.geo.getGeoLib()" class="getGeoLib"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M444.52 3.52L28.74 195.42c-47.97 22.39-31.98 92.75 19.19 92.75h175.91v175.91c0 51.17 70.36 67.17 92.75 19.19l191.9-415.78c15.99-38.39-25.59-79.97-63.97-63.97z"/></svg> 現在地から探す </a> </div> <div class="books"> <div class="book"> <a class="cover" href="/book/4274069117"><img src="https://calil.jp/cover/4274069117" alt=""></a> <a class="title" href="/book/4274069117">型システム入門 : プログラミング言語と型の理論</a> <div class="authors"> <span class="author">Benjamin C. Pierce著 ; 遠藤侑介 [ほか] 共訳</span> </div> <div class="libinfo"></div> <div id="addwishlist1" class="addwishlist"> <a class="wish" href="javascript:;" onmousedown="calil.list.addToMyLibrary('4274069117','wish',1);" rel="nofollow">読みたい</a> <a class="read" href="javascript:;" onmousedown="calil.list.addToMyLibrary('4274069117','read',1);" rel="nofollow">読んだ</a> </div> </div> <div class="book"> <a class="cover" href="/book/0262332663"><img src="https://calil.jp/cover/0262332663" alt=""></a> <a class="title" href="/book/0262332663">Advanced Topics in Types and Programming Languages</a> <div class="authors"> <span class="author">Pierce, Benjamin C.</span> </div> <div class="libinfo"></div> <div id="addwishlist2" class="addwishlist"> <a class="wish" href="javascript:;" onmousedown="calil.list.addToMyLibrary('0262332663','wish',2);" rel="nofollow">読みたい</a> <a class="read" href="javascript:;" onmousedown="calil.list.addToMyLibrary('0262332663','read',2);" rel="nofollow">読んだ</a> </div> </div> <div class="book"> <a class="cover" href="/book/3540427368"><img src="https://calil.jp/cover/3540427368" alt=""></a> <a class="title" href="/book/3540427368">Theoretical Aspects of Computer Software: 4th International Symposium, TACS 2001, Sendai, Japan, October 29-31, 2001. Proceedings (Lecture Notes in Computer Science, 2215)</a> <div class="authors"> <span class="author">Pierce, Benjamin C./Kobayashi, Naoki</span> </div> <div class="libinfo"></div> <div id="addwishlist3" class="addwishlist"> <a class="wish" href="javascript:;" onmousedown="calil.list.addToMyLibrary('3540427368','wish',3);" rel="nofollow">読みたい</a> <a class="read" href="javascript:;" onmousedown="calil.list.addToMyLibrary('3540427368','read',3);" rel="nofollow">読んだ</a> </div> </div> <div class="book"> <a class="cover" href="/book/1461256356"><img src="https://calil.jp/cover/1461256356" alt=""></a> <a class="title" href="/book/1461256356">Ir Genes: Past, Present, and Future (Experimental Biology and Medicine)</a> <div class="authors"> <span class="author">Pierce, Carl W./Cullen, Susan E./Kapp, Judith A./Schwartz, Benjamin D./Shreffler, Donald C.</span> </div> <div class="libinfo"></div> <div id="addwishlist4" class="addwishlist"> <a class="wish" href="javascript:;" onmousedown="calil.list.addToMyLibrary('1461256356','wish',4);" rel="nofollow">読みたい</a> <a class="read" href="javascript:;" onmousedown="calil.list.addToMyLibrary('1461256356','read',4);" rel="nofollow">読んだ</a> </div> </div> <div class="book"> <a class="cover" href="/book/0262660717"><img src="https://calil.jp/cover/0262660717" alt=""></a> <a class="title" href="/book/0262660717">Basic category theory for computer scientists</a> <div class="authors"> <span class="author">Benjamin C. Pierce</span> </div> <div class="libinfo"></div> <div id="addwishlist5" class="addwishlist"> <a class="wish" href="javascript:;" onmousedown="calil.list.addToMyLibrary('0262660717','wish',5);" rel="nofollow">読みたい</a> <a class="read" href="javascript:;" onmousedown="calil.list.addToMyLibrary('0262660717','read',5);" rel="nofollow">読んだ</a> </div> </div> <div class="book"> <a class="cover" href="/book/0262162091"><img src="https://calil.jp/cover/0262162091" alt=""></a> <a class="title" href="/book/0262162091">Types and programming languages</a> <div class="authors"> <span class="author">Benjamin C. Pierce</span> </div> <div class="libinfo"></div> <div id="addwishlist6" class="addwishlist"> <a class="wish" href="javascript:;" onmousedown="calil.list.addToMyLibrary('0262162091','wish',6);" rel="nofollow">読みたい</a> <a class="read" href="javascript:;" onmousedown="calil.list.addToMyLibrary('0262162091','read',6);" rel="nofollow">読んだ</a> </div> </div> <div class="book"> <a class="cover" href="/book/0262162288"><img src="https://calil.jp/cover/0262162288" alt=""></a> <a class="title" href="/book/0262162288">Advanced topics in types and programming languages</a> <div class="authors"> <span class="author">Benjamin C. Pierce, editor</span> </div> <div class="libinfo"></div> <div id="addwishlist7" class="addwishlist"> <a class="wish" href="javascript:;" onmousedown="calil.list.addToMyLibrary('0262162288','wish',7);" rel="nofollow">読みたい</a> <a class="read" href="javascript:;" onmousedown="calil.list.addToMyLibrary('0262162288','read',7);" rel="nofollow">読んだ</a> </div> </div> </div> </div> <style> .searchopt_dialog { display:none; z-index:100; position:absolute; background-image:url(https://calil.jp/public/img/parts/tri.png); background-repeat:no-repeat; } /* .top{ background-position:50px top; padding-top:6px; } .bottom{ background-position:50px bottom; padding-bottom:6px; } */ .searchopt_dialog #dlg_content { background-color:#FFFFC7; border:1px solid #999; border-color:#D8D8D8 #A2A2A2 #A2A2A2 #D8D8D8; /* border:5px solid #4396E3;*/ /* padding:5px;*/ color:#333; /* width:100px;*/ min-height:10px; box-shadow:3px 5px 15px #AAA; -moz-box-shadow:3px 5px 15px #AAA; -webkit-box-shadow:0 3px 15px #888888; padding:3px 5px; overflow:hidden; } .searchopt_dialog a{ color:black; } .searchopt_dialog p{ margin:2px 1px; font-size:75%; white-space:no-wrap; } </style> <div class="searchopt_dialog" id="searchopt_dialog" > <div id="dlg_content"> </div> </div> <div class="footer"> <p> <a href="/doc/about.html">カーリルについて</a> - <a href="/doc/lib.html">図書館の方へ</a> - <a href="/local/">ローカル</a> - <a href="/doc/api.html">図書館 API</a> - <a href="/doc/download.html">バナー・素材</a> </p> <p> <a href="/">ホーム</a> - <a href="/company/">運営会社</a> - <a href="https://blog.calil.jp/">ブログ</a> - <a href="https://twitter.com/caliljp">Twitter</a> - <a href="/privacy/freedom.html">図書館の自由</a> - <a href="/privacy/">プライバシーポリシー</a> - <a href="/doc/contact.html">お問い合わせ</a> </p> </div> <script type="text/javascript"> var calil = {}; function get_query() { var hash, hashes, i, vars; vars = []; hash = void 0; hashes = window.location.href.slice(window.location.href.indexOf("?") + 1).split("&"); i = 0; while (i < hashes.length) { hash = hashes[i].split("="); vars.push(hash[0]); vars[hash[0]] = hash[1]; i++; } return vars; } function buildQueryString(params) { var parts = []; var add = function(key, value) { parts.push(encodeURIComponent(key) + '=' + encodeURIComponent(value)); } for (var key in params) { var param = params[key]; if (Array.isArray(param)) { param.map(function(value) { add(key, value); }); } else { add(key, param); } } return '?' + parts.join('&').replace(/%20/g, '+'); } // 図書館設定 calil.library = { add_mode: false, setAddMode: function() { this.add_mode = true; }, addLibrary: function(sysid, func) { this.setLibrary({ sysid: sysid, add: true, func: func }); }, setLibrary: function(param) { if (this.add_mode) param['add'] = true; var url = '/set_place_json' + buildQueryString(param); fetch(url).then(function(r) { return r.json()}).then((function(_this) { return function(data) { if (data.stat === "ok") { if (location.search.match('from=settings')) { return location.href = '/settings'; } else if (location.pathname === "/" || location.pathname.indexOf('/library') === 0) { return location.href = '/start'; } else if (location.pathname === '/settings') { if ((get_query().redirect != null) === true) { return location.href = get_query().redirect; } else { return location.href = location.pathname + location.search; } } else { return location.reload(); } } else if (data.stat === 'confirm') { if (!confirm(data.message)) { return; } param['force'] = 'true'; return _this.setLibrary(param); } else { return alert('エラー: ' + data.message); } }; })(this) ) .catch(function() { alert('サーバーからの応答がありません。'); }) } }; // 位置情報から探す calil.geo = { getGeoLib: function() { document.querySelectorAll('body, a').forEach(function(element) { element.style.cursor = 'wait'; }); var callback; callback = (function(_this) { return function(lat, lng) { var params = { lat: lat, lon: lng, limit: 30 }; var url = '//api.calil.jp/mobile/recommend' + buildQueryString(params); fetch(url).then(function(r) {return r.json()}).then(function(data) { var j, len, message, n, nearest_lib, ref; if (data.nearby.length <= 0) { return alert('近くに図書館が見つかりません'); } nearest_lib = null; ref = data.nearby; for (j = 0, len = ref.length; j < len; j++) { n = ref[j]; if (n.icon !== 'school') { nearest_lib = n; break; } } if (!nearest_lib) { nearest_lib = data.nearby[0]; } message = nearest_lib.name + 'が見つかりました。この図書館を設定しますか?'; if (confirm(message)) { calil.library.setLibrary({ sysid: nearest_lib.id, add: true }); } document.querySelectorAll('body, a').forEach(function(element) { element.style.cursor = 'auto'; }); }) .catch(function() { alert('読み込みに失敗しました。'); document.querySelectorAll('body, a').forEach(function(element) { element.style.cursor = 'auto'; }); }) }; })(this); return this._getGeolocation(callback); }, _getGeolocation: function(callback, hideerror) { var error; if (!navigator.geolocation) { return; } error = (hideerror ? function() {} : this._errorFunc); return navigator.geolocation.getCurrentPosition((function(position) { var lat, lng; lat = position.coords.latitude; lng = position.coords.longitude; return callback(lat, lng); }), error, { enableHighAccuracy: true }); }, _errorFunc: function(error) { var message = ''; switch (error.code) { case error.POSITION_UNAVAILABLE: message = '位置情報の取得ができませんでした。'; break; case error.PERMISSION_DENIED: message = '位置情報取得の使用許可がされませんでした。'; break; case error.PERMISSION_DENIED_TIMEOUT: message = '位置情報取得中にタイムアウトしました。'; } alert(message); } }; // 読みたい・読んだ calil.list = { addToMyLibrary: function(normalized_isbn, status, id) { var remove = document.querySelector('#addwishlist' + id + ' > .' + status).className.match('active'); [].slice.call(document.querySelectorAll('#addwishlist' + id + ' > a')).map(function(a) { a.classList.remove('active') }); if (!remove) { document.querySelector('#addwishlist' + id + ' > .' + status).classList.add('active'); } document.querySelector('#addwishlist' + id + ' > .' + status).blur(); var url = '/list/add_book' if (remove) { url = '/list/delete_book'; if (!confirm(status==='wish' ? '読みたいリストから削除しますか?' : '読んだリストから削除しますか?')) { // キャンセルされた場合、スタイルを戻す return document.querySelector('#addwishlist' + id + ' > .' + status).classList.add('active'); } } var params = { asin: normalized_isbn, status: status }; var headers = { 'Accept': 'application/json', 'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8' } var body = Object.keys(params).map(function(key){return key+'='+encodeURIComponent(params[key])}).join('&'); fetch(url, { method: 'POST', headers: headers, body: body }).then(function(r){ return r.json() }).then(function(data) { if (data.stat === 'ok') { // ログインしていない場合 } else if (data.stat === 'needlogin') { return location.href = '/login?redirect=' + escape(location.pathname + location.search); } else { alert('変更に失敗しました。' + data.msg); document.querySelector('#addwishlist' + id + ' > .' + status).classList.remove('active'); } }) .catch(function() { alert('変更に失敗しました。サーバーから応答がありません。'); document.querySelector('#addwishlist' + id + ' > a').classList.remove('active'); }); } } // 図書館の絞り込み calil.filterlib = { change: function(elm) { if (this.value === 'settings') { location.href = '/settings'; return; } calil.filterlib.set(this.value); }, set: function(value) { var t; calil.api.render.filter_system_id = value; calil.api.render.filter_libkey = ""; if (value.indexOf(":") > 0) { t = value.split(":"); calil.api.render.filter_system_id = t[0]; calil.api.render.filter_libkey = t[1]; } calil.api.render.render_books(calil.api.search.data_cache); if (value === 'all') { document.querySelector('#filter_libs_option option:first-child').innerHTML = '▼図書館を絞り込み'; } else { document.querySelector('#filter_libs_option option:first-child').innerHTML = '▲図書館の絞り込みを解除'; } if (value === 'all') { // クッキーを削除 document.cookie = 'filterlib=all; path=/; expires==Thu, 01 Jan 1970 00:00:00 GMT'; } else { document.cookie = 'filterlib='+value+'; path=/;'; } } }; if (document.querySelector('#filter_libs_option')) { document.querySelector('#filter_libs_option').addEventListener('change', calil.filterlib.change); } window.addEventListener('DOMContentLoaded', function() { var filterlib = document.cookie.replace(/(?:(?:^|.*;\s*)filterlib\s*\=\s*([^;]*).*$)|^.*$/, '$1') if (filterlib && document.querySelector('#filter_libs_option')) { [].slice.call(document.querySelectorAll('#filter_libs_option option')).map(function(option, i) { if (option.value === filterlib) { calil.filterlib.set(filterlib); document.querySelector('#filter_libs_option').value = filterlib; } }); } }); var create_uuid = function() { var S4; S4 = function() { return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1); }; return S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4(); }; // 蔵書検索 calil.api = { search: { server: 'https://api.calil.jp', appkey: '1f797b9d960207280336610120edb44a', uuid: null, session: false, order: false, systemid_list: [], isbn_list: [], api_url: false, first_apiurl: false, api_retry_count: 0, api_pause: false, api_call_count: 0, api_complete: false, api_timeout_timer: 0, data_cache: "", initialize: function() { this.uuid = create_uuid(); this.order = false; this.systemid_list = []; this.isbn_list = []; this.api_url = false; this.first_apiurl = false; this.api_retry_count = 0; this.api_pause = false; this.api_call_count = 0; this.api_complete = false; this.data_cache = ""; }, add_systemid: function(sytemid) { return this.systemid_list = this.systemid_list.concat(sytemid.split(",")); }, add_isbn: function(isbn) { return this.isbn_list = this.isbn_list.concat(isbn.split(",")); }, start: function() { this.first_apiurl = this.server + '/check?appkey=' + this.appkey + '&systemid=' + this.systemid_list.join(',') + '&isbn=' + this.isbn_list.join(','); if (this.order) { this.first_apiurl += '&order=' + this.order; } return this.call_api(this.first_apiurl); }, api_timeout: function() { return calil.api.render.timeoutSearchProgress(); }, check_change_uuid: function(uuid) { if (this.uuid !== uuid) { console.log('uuidが変更'); return true; } return false; }, call_api: function(url, uuid) { var data; if (uuid == null) { uuid = this.uuid; } this.api_url = url; url += '&callback=no' + '&' + new Date().getTime() // IE11 でキャッシュされる問題対策 fetch(url, {cache: 'no-cache'}).then(function(r) {return r.json()}).then((function(_this) { return function(data) { if (_this.check_change_uuid(uuid)) { return; } _this.callback(data, uuid); }; })(this)) .catch((function(_this) { return function(data) { if (_this.check_change_uuid(uuid)) { return; } if (_this.api_url && _this.api_retry_count <= 2) { _this.api_call_count = 0; return setTimeout((function() { _this.call_api(_this.api_url, uuid); return _this.api_retry_count++; }), 5000); } else { return _this.api_timeout(); } }; })(this)); }, callback: function(data, uuid) { var session = data['session']; var conti = data['continue']; this.data_cache = data; if (conti === 1) { this.api_call_count++; var seconds; if (this.api_call_count < 3) { seconds = 1000; } else if (this.api_call_count < 7) { seconds = 1200; } else { seconds = 3000; } var newurl = this.server + '/check?appkey=' + this.appkey + '&session=' + session; if (this.order) { newurl += '&order=' + this.order; } setTimeout(((function(_this) { return function() { return _this.call_api(newurl, uuid, data); }; })(this)), seconds); } else { this.api_complete = true; } return calil.api.render.render_books(data); }, }, render: { filter_system_id: "all", filter_libkey: "", initialize: function() { this.filter_system_id = "all"; this.filter_libkey = ""; }, timeoutSearchProgress: function() { var i; i = 0; [].slice.call(document.querySelectorAll('.searching')).map(function(item, i) { item.innerHTML = 'タイムアウト'; item.className = 'timeout'; return i++; }); }, render_books: function(data) { // 検索中最初の3個のみ表示 CSSでは実現できなかった if (document.querySelectorAll('.searching').length > 0) { [].slice.call(document.querySelectorAll('.searching')).map(function(item, i) { if (i < 3) item.style.display = 'inline-block'; }); } for (isbn in data.books) { // フィルターの場合、初期化して対応 if (this.filter_system_id !== 'all') delete this.statusTexts[isbn]; for (systemid in data.books[isbn]) { if (this.filter_system_id === "all" || this.filter_system_id === systemid) { var systemData = data.books[isbn][systemid]; var statusText = this.getStatusText(isbn); for (i in systemData.libkey) { if (this.filter_libkey === "" || this.filter_libkey === i) { libkey = systemData.libkey[i]; // 空なら来たやつを入れる if (statusText === '' || statusText === '蔵書あり') { statusText = libkey; // 貸出可が来たときに入れる } else if (libkey === '貸出可') { statusText = libkey; } } } if (data.continue === 0 && systemData.status === "Error" && statusText==='') { statusText = "検索失敗"; } this.render_book(isbn, statusText); } } } // すべての図書館の蔵書を探してもなかった場合 if (data.continue === 0) { for (isbn in data.books) { for (systemid in data.books[isbn]) { var statusText = this.getStatusText(isbn); if (statusText === '') { statusText = '蔵書なし'; this.render_book(isbn, statusText); } } } } }, render_book: function(isbn, statusText) { if (statusText === '') return; var statusId = this.getStatusId(statusText); var link; [].slice.call(document.getElementById(isbn).parentNode.children).map(function(child, i){ if (child.tagName === 'A' && child.className === 'title') { link = child.getAttribute('href'); } }); var span = '<a href="' + link + '">' + statusText + '</a>'; var libinfo = document.getElementById(isbn); if (isbn !== '' && libinfo) { libinfo.innerHTML = span; libinfo.parentNode.className = 'book ' + statusId; } this.statusTexts[isbn] = statusText; }, getStatusId: function(status) { var statusId = ''; var statusIds = { '': 'nostatus', '貸出可': 'available', '蔵書あり': 'collection', '館内のみ': 'inside', '貸出中': 'lending', '予約中': 'reserved', '準備中': 'ordering', '蔵書なし': 'notfound', }; if (statusIds[status]) { statusId = statusIds[status]; } else { // 知らないstatusがきたら、"蔵書あり"と同等に扱う 例) 長期延滞、行方不明 statusId = 'hold'; } return statusId; }, statusTexts: {}, getStatusText: function(isbn) { if (typeof this.statusTexts[isbn] === 'undefined') { return ''; } else { return this.statusTexts[isbn]; } } } }; document.addEventListener('DOMContentLoaded', function() { document.querySelectorAll('.libinfo').forEach(function(libinfo) { libinfo.addEventListener('mouseover', calil.more.libinfo_hover); libinfo.addEventListener('mouseout', calil.more.libinfo_out); }); var searchopt_dialog = document.getElementById('searchopt_dialog') searchopt_dialog.addEventListener('mouseover', calil.more.dlg_mouseover); searchopt_dialog.addEventListener('mouseout', calil.more.dlg_mouseout); }); calil.more = { ondlg: false, closecancel: false, libinfo_hover: function() { var dlg, height, target, left, st, top, width, win_h; target = this; if (target.tagName === 'A') target = target.parentNode; console.log("libinfo_hover" + target.id); if (target.innerText !== "蔵書なし") { return; } calil.more.closecancel = true; win_h = document.documentElement.clientHeight; st = window.scrollY; top = target.offsetTop; left = target.offsetLeft; height = target.offsetHeight; width = target.offsetWidth; dlg = document.getElementById('searchopt_dialog'); dlg.style.display = 'block'; dlg.style.top = (top - dlg.offsetHeight - 3) + 'px'; dlg.style.left = (left - (dlg.offsetWidth - width) / 2) + 'px'; dlg.querySelectorAll('a').forEach(function(a) { a.href = `/book/${target.id}/search?pref=${a.name}#book_info`; }); }, libinfo_out: function() { console.log("libinfo_out" + this.id); calil.more.closecancel = false; return setTimeout(((function(_this) { return function() { if (!calil.more.closecancel) { calil.more.closecancel = true; return document.getElementById('searchopt_dialog').style.display = 'none'; } }; })(this)), 500); }, dlg_mouseover: function() { console.log("dlg_mouseover" + this.id); calil.more.closecancel = true; return calil.more.ondlg = true; }, dlg_mouseout: function() { console.log("dlg_mouseout"); calil.more.closecancel = false; calil.more.ondlg = false; return calil.more.libinfo_out(); } }; </script> <script> calil.api.search.initialize(); calil.api.render.initialize(); calil.api.search.add_isbn('4274069117,0262332663,3540427368,1461256356,0262660717,0262162091,0262162288'); </script> <script type="text/javascript" charset="utf-8" src="/public/web-html/js/menusp.js"></script> </body> </html>