Language
Login
Language Setting
X
English
日本語 [Japanese]
about this App
検索
useful
0
Loading...
if(typeof Taxonomy==="undefined"||!Taxonomy){var Taxonomy = {};} Taxonomy = function() { "use strict"; this._init.apply(this, arguments); }; Taxonomy.prototype = { _msg : "NONE", _taxData : [], getPanels : function() { var sb = []; for (i = 0; i < this._taxData.length; i++) { var taxData = this._taxData[i]; sb[sb.length] = this._getPanelHtml(taxData); } return sb.join(""); }, getPanelsByName : function(keyword) { var sb = []; for (i = 0; i < this._taxData.length; i++) { var taxData = this._taxData[i]; var ja_name = taxData[1]; var en_name = taxData[2]; var scientific_name = taxData[3]; if (ja_name.indexOf(keyword) != -1 || en_name.indexOf(keyword) != -1 || scientific_name.indexOf(keyword) != -1) { sb[sb.length] = this._getPanelHtml(taxData); } } return sb.join(""); }, _getPanelHtml : function(taxData) { var no = taxData[0]; var ja_name = taxData[1]; var en_name = taxData[2]; var scientific_name = taxData[3]; var image_url = taxData[4]; var taxonomy_url = taxData[5]; var sb = []; sb[sb.length] = '<li id="boxundefined" class="span3 masonry-brick">'; sb[sb.length] = '<div class="thumbnail">'; sb[sb.length] = ' <div class="properties">'; sb[sb.length] = ' <div class="property">'; sb[sb.length] = ' <div class="key">和名</div>'; sb[sb.length] = ' <div class="val"><a href="' + taxonomy_url + '" target="_blank">' + ja_name + '</a></div>'; sb[sb.length] = ' </div>'; if (en_name) { sb[sb.length] = ' <div class="property">'; sb[sb.length] = ' <div class="key">英名</div>'; sb[sb.length] = ' <div class="val">' + en_name + '</div>'; sb[sb.length] = ' </div>'; } sb[sb.length] = ' <div class="property">'; sb[sb.length] = ' <div class="key">学名</div>'; sb[sb.length] = ' <div class="val">' + scientific_name + '</div>'; sb[sb.length] = ' </div>'; sb[sb.length] = ' <div class="property">'; sb[sb.length] = ' <div class="val"><img src="' + image_url + '" width="120px" height="90px"></div>'; sb[sb.length] = ' </div>'; sb[sb.length] = ' </div>'; sb[sb.length] = '</div>'; sb[sb.length] = '</li>'; return sb.join(""); }, _loadTaxdata : function() { var self = this; var no = 0; $.each(Taxonomy.getWorks(), function(workKey, workValue) { $.each(Taxonomy.getFiles(workValue), function(fileKey, fileValue) { $.each(Taxonomy.getSubjects(workValue, fileValue), function(subjKey, subjValue) { var ja_name = ''; var en_name = ''; var scientific_name = ''; var image_url = subjValue; var taxonomy_url = ''; $.each(Taxonomy.getProperties(workValue, fileValue), function(propKey, propValue) { $.each(Taxonomy.getObjects(workValue, fileValue, subjValue, propValue), function(objKey, objValue) { if (propValue === "http://linkdata.org/property/rdf1s142i#%E5%92%8C%E5%90%8D" ) { ja_name = objValue; } else if (propValue === "http://linkdata.org/property/rdf1s142i#%E8%8B%B1%E8%AA%9E%E5%90%8D" ) { en_name = objValue; } else if (propValue === "http://purl.bioontology.org/ontology/NCBITaxon" ) { scientific_name = objValue; } else if (propValue === "http://www.ncbi.nlm.nih.gov/Taxonomy/Browser/" ) { taxonomy_url = objValue; } }); }); self._taxData.push([no, ja_name, en_name, scientific_name, image_url, taxonomy_url]); no++; }); }); }); }, _getNoResult : function () { var sb = []; sb[sb.length] = 'No result'; return sb.join(""); }, _init : function() { "use strict"; this._msg = ""; this._loadTaxdata(); var self = this; $("#keyword_search").click(function() { var keyword = $("#keyword").val() var result = self.getPanelsByName(keyword); if (result) { var sb = []; sb[sb.length] = '<ul id="result" class="thumbnails masonry" style="height: 9366px; position: relative; width: 930px; margin: 0 auto;">'; sb[sb.length] = result; sb[sb.length] = '</ul>'; $("#result").html(sb.join("")); $('#result li').wookmark({ container: $('#result'), offset: 16, itemWidth: 220, autoResize: true }); } else { $("#result").html(self._getNoResult()); } }); } }; Taxonomy.getWorks = function() { return LinkData.getWorks(); }; Taxonomy.getFiles = function(workId) { return LinkData.getFiles(workId); }; Taxonomy.getSubjects = function(workId, fileName) { return LinkData.getSubjects(workId, fileName); }; Taxonomy.getProperties = function(workId, fileName) { return LinkData.getProperties(workId, fileName); }; Taxonomy.getObjects = function(workId, fileName, subject, property) { return LinkData.getObjects(workId, fileName, subject, property); }; init = function() { "use strict"; t = new Taxonomy(); // $("#result").append(t.getPanels()); // $('#result li').wookmark({ // container: $('#result'), // offset: 16, // itemWidth: 220, // autoResize: true // }); }; window.onload = function() { "use strict"; init(); }; $.fn.wookmark=function(a){if(!this.wookmarkOptions){this.wookmarkOptions=$.extend({container:$("body"),offset:2,autoResize:false,itemWidth:$(this[0]).outerWidth(),resizeDelay:50},a)}else if(a){this.wookmarkOptions=$.extend(this.wookmarkOptions,a)}if(!this.wookmarkColumns){this.wookmarkColumns=null;this.wookmarkContainerWidth=null}this.wookmarkLayout=function(){var a=this.wookmarkOptions.itemWidth+this.wookmarkOptions.offset;var b=this.wookmarkOptions.container.width();var c=Math.floor((b+this.wookmarkOptions.offset)/a);var d=Math.round((b-(c*a-this.wookmarkOptions.offset))/2);var e=0;if(this.wookmarkColumns!=null&&this.wookmarkColumns.length==c){e=this.wookmarkLayoutColumns(a,d)}else{e=this.wookmarkLayoutFull(a,c,d)}this.wookmarkOptions.container.css("height",e+"px")};this.wookmarkLayoutFull=function(a,b,c){var d=[];while(d.length<b){d.push(0)}this.wookmarkColumns=[];while(this.wookmarkColumns.length<b){this.wookmarkColumns.push([])}var e,f,g,h=0,i=0,j=this.length,k=null,l=null,m=0;for(;h<j;h++){e=$(this[h]);k=null;l=0;for(i=0;i<b;i++){if(k==null||d[i]<k){k=d[i];l=i}}e.css({position:"absolute",top:k+"px",left:l*a+c+"px"});d[l]=k+e.outerHeight()+this.wookmarkOptions.offset;m=Math.max(m,d[l]);this.wookmarkColumns[l].push(e)}return m};this.wookmarkLayoutColumns=function(a,b){var c=[];while(c.length<this.wookmarkColumns.length){c.push(0)}var d=0,e=this.wookmarkColumns.length,f;var g=0,h,i;var j=0;for(;d<e;d++){f=this.wookmarkColumns[d];h=f.length;for(g=0;g<h;g++){i=f[g];i.css({left:d*a+b+"px",top:c[d]+"px"});c[d]+=i.outerHeight()+this.wookmarkOptions.offset;j=Math.max(j,c[d])}}return j};this.wookmarkResizeTimer=null;if(!this.wookmarkResizeMethod){this.wookmarkResizeMethod=null}if(this.wookmarkOptions.autoResize){this.wookmarkOnResize=function(a){if(this.wookmarkResizeTimer){clearTimeout(this.wookmarkResizeTimer)}this.wookmarkResizeTimer=setTimeout($.proxy(this.wookmarkLayout,this),this.wookmarkOptions.resizeDelay)};if(!this.wookmarkResizeMethod){this.wookmarkResizeMethod=$.proxy(this.wookmarkOnResize,this)}$(window).resize(this.wookmarkResizeMethod)}this.wookmarkClear=function(){if(this.wookmarkResizeTimer){clearTimeout(this.wookmarkResizeTimer);this.wookmarkResizeTimer=null}if(this.wookmarkResizeMethod){$(window).unbind("resize",this.wookmarkResizeMethod)}};this.wookmarkLayout();this.show()}
body { background: none repeat scroll 0 0 #EEEEEE; position: absolute; text-align: left; width: 100%; color: #333333; font-family: "Helvetica Neue",Helvetica,Arial,sans-serif; font-size: 13px; line-height: 18px; } .contents { margin: 70px auto 0; padding-bottom: 15px; width: 80%; } .article:after { clear: both; content: "."; display: block; height: 0; padding-bottom: 15px; visibility: hidden; } .article { color: #333333; font-size: 12px; line-height: 21px; padding-bottom: 15px; } .labelstyle { font-family: "Garamond"; } .article .search { background-color: #E7E7E9; margin: 30px auto; min-width: 400px; text-align: center; width: 60%; } .well { background-color: #F5F5F5; border: 1px solid rgba(0, 0, 0, 0.05); border-radius: 4px 4px 4px 4px; box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05) inset; margin-bottom: 20px; min-height: 20px; padding: 19px; } .article .search input { height: 25px; margin: 0 10px 0 0; min-width: 100px; width: 55%; } input, textarea { -moz-transition: border 0.2s linear 0s, box-shadow 0.2s linear 0s; box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset; } input, textarea, select, .uneditable-input { border: 1px solid #CCCCCC; border-radius: 3px 3px 3px 3px; color: #555555; display: inline-block; font-size: 13px; height: 18px; line-height: 18px; margin-bottom: 9px; padding: 4px; width: 210px; } label, input, button, select, textarea { font-family: "Helvetica Neue",Helvetica,Arial,sans-serif; font-size: 13px; font-weight: normal; line-height: 18px; } button, input { line-height: normal; } button, input, select, textarea { font-size: 100%; margin: 0; vertical-align: middle; } button.btn, input.btn[type="submit"] { } .btn-primary { background-color: #006DCC; background-image: -moz-linear-gradient(center top , #0088CC, #0044CC); background-repeat: repeat-x; border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); } .btn-primary, .btn-primary:hover, .btn-warning, .btn-warning:hover, .btn-danger, .btn-danger:hover, .btn-success, .btn-success:hover, .btn-info, .btn-info:hover { color: #FFFFFF; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); } .btn { -moz-border-bottom-colors: none; -moz-border-left-colors: none; -moz-border-right-colors: none; -moz-border-top-colors: none; background-color: #FAFAFA; background-image: -moz-linear-gradient(center top , #FFFFFF, #FFFFFF 25%, #E6E6E6); background-repeat: no-repeat; border-color: #CCCCCC #CCCCCC #BBBBBB; border-image: none; border-radius: 4px 4px 4px 4px; border-style: solid; border-width: 1px; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 1px 2px rgba(0, 0, 0, 0.05); color: #333333; cursor: pointer; display: inline-block; font-size: 13px; line-height: 18px; padding: 4px 10px; text-align: center; text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75); } label, input, button, select, textarea { font-family: "Helvetica Neue",Helvetica,Arial,sans-serif; font-size: 13px; font-weight: normal; line-height: 18px; } button, input[type="button"], input[type="reset"], input[type="submit"] { cursor: pointer; } .results .thumbnails > li { list-style: none outside none; margin: 5px; text-align: left; } .thumbnails > li { float: left; margin: 0 0 18px 20px; } .span3 { width: 220px; } [class*="span"] { float: left; margin-left: 20px; } li { line-height: 18px; } .results .thumbnails > li { list-style: none outside none; margin: 5px; text-align: left; } .thumbnails { list-style: none outside none; } .results .thumbnails .thumbnail { background: none repeat scroll 0 0 #FFFFFF; padding: 8px; } .thumbnail { border: 1px solid #DDDDDD; border-radius: 4px 4px 4px 4px; box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075); display: block; line-height: 1; padding: 4px; } .results .thumbnails .properties { padding-top: 10px; } .results .thumbnails .property { border-bottom: 1px solid #CCCCCC; margin-bottom: 5px; padding: 0 5px 10px; } .results .thumbnails .property .key { color: #CCCCCC; font-size: small; padding-bottom: 7px; word-wrap: break-word; } .results .thumbnails .property .val { color: #666666; word-wrap: break-word; }
<div class="contents"> <div class="article"> <div class="search well"> <span class="labelstyle"> Search </span> <input id="keyword" type="text" value="アゲハ"/> <button id="keyword_search" class="btn btn-primary">Submit</button> </div> <div class="results"> <ul id="result" class="thumbnails masonry" style="height: 9366px; position: relative; width: 930px; margin: 0 auto;"> </ul> </div> </div> </div>
Preview
Input Data
ReadMe
Snapshots
LinkData Work
Table Data
生物のイラスト・和名・英語名・学名
Contributor:AyumiK
Update:Jun 7, 2012
366 Downloads, 2 Applications
taxonomyicon_list
Add LinkData work(LinkData)
Link http://app.linkdata.org/run/app1s46i?tab=readme
Initial content
jquery-1.7.1.min.js
Work
Add
Clear
insert work id or work name.