-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtop.rhtml
207 lines (207 loc) · 7.36 KB
/
top.rhtml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="ja" xml:lang="ja">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rev="made" href="mailto:[email protected]" />
<link rel="stylesheet" href="default.css" type="text/css" />
<link rel="stylesheet" href="seltab.css" type="text/css" />
<script src="default.js" type="text/javascript"></script>
<script src="seltab.js" type="text/javascript"></script>
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript">google.load("jquery", "1.4");</script>
<% if query? %>
<meta name="robots" content="nofollow" />
<% end %>
<% if query? %>
<script src="http://books.google.com/books/previewlib.js" type="text/javascript"></script>
<% else %>
<script type="text/javascript">google.load("feeds", "1");</script>
<script type="text/javascript">
$(document).ready(function(){
var feed = new google.feeds.Feed("http://news.google.com/news?output=rss");
feed.setNumEntries( 5 );
feed.load(display_feed_as_examples);
var feed_mainichi = new google.feeds.Feed("http://mainichi.jp/rss/etc/opinion.rss");
feed_mainichi.setNumEntries( 5 );
feed_mainichi.load(display_feed_mainichi_opinion);
});
</script>
<% end %>
<% if self.class.to_s == "Fuwatto::CiniiAuthorApp" %>
<script src="cinii_nrid.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
$(".cinii_headline").after('<div id="cinii_author"><a href="http://fuwat.to/cinii?url=<%=h url %>">CiNii関連論文検索»</a></div>')
<% if url.nil? %>
.click( function() {
$("form#text1").attr("action","http://fuwat.to/cinii").submit();
})
<% end %>
;
$("#cinii_author").css( "width", "auto" );
});
</script>
<% else %>
<% if self.class.to_s !~ /\AFuwatto::(Worldcat|Springer|DPLA)App\Z/ %>
<% if query? %>
<script type="text/javascript">
$(document).ready(function(){
$(".cinii_headline").after('<div id="cinii_author"><h3>関連著者(CiNii) <img src="./ajax-loader.gif" alt="loading..."/></h3><ul></ul></div>');
$.ajax({
url : './cinii-author.rb',
type : 'POST',
data : {
url : document.forms.url1.url.value,
text : document.forms.text1.text.value,
combination : 1,
format : 'json',
},
dataType : 'jsonp',
error : function(request, status){
$("#cinii_author img").hide();
$("#cinii_author").append('<div>load error.</div>');
},
success : function(data, status){
$("#cinii_author img").hide();
$.each( data.entries, function( index, val ){
if ( index >= 20 ) {
return false;
}
$("#cinii_author ul").append( '<li>'
+'<a href="'+ this.url +'">'
+this.author
+'</a></li>' );
});
<% if url.nil? %>
$("#cinii_author ul").after('<div class="link-cinii-author"><a href="http://fuwat.to/cinii-author"> 詳細 »</a></div>');
$("#cinii_author div.link-cinii-author a").click( function(){
$("form#text1").attr("action","http://fuwat.to/cinii-author").submit();
return false;
});
<% else %>
$("#cinii_author ul").after('<div class="link-cinii-author"><a href="http://fuwat.to/cinii-author?url=<%=h url %>"> 詳細 »</a></div>');
<% end %>
},
});
});
</script>
<% end %>
<% end %>
<% end %>
<title><%= self.class::TITLE %></title>
</head>
<body>
<ul id="navi">
<li><a href="help.html">ふわっと関連検索とは</a></li>
<li><a href="history.html">更新履歴</a></li>
</ul>
<!-- hhmts start -->
<div class="last-update">最終更新日: 2015年01月04日</div>
<!-- hhmts end -->
<h1><%= self.class::TITLE %></h1>
<% if data[ :error ] %>
<p class="error">
<% if data[ :error ] == Fuwatto::NoHitError %>
関連する文献を見つけることができませんでした。
<% elsif data[ :error ] == :UnsupportedURI %>
未対応のURL形式が指定されています。
<% end %>
</p>
<% end %>
<div class="form">
<div class="tabheader"><div id="head1"><a href="javascript:seltab('box', 'head', 10, 1)">文章から検索<%=h " (by Text)" if self.class.to_s =~ /\AFuwatto::(Springer|Worldcat|DPLA)App\Z/ %></a></div><div class="space"> </div><div id="head2"><a href="javascript:seltab('box', 'head', 10, 2)">ウェブページから検索<%=h " (by URL)" if self.class.to_s =~ /\AFuwatto::(Springer|Worldcat|DPLA)App\Z/ %></a></div><div class="space"> </div></div>
<div class="tabbody">
<div id="box1">
<form action="<%=h @cgi.script_name %>" method="post" name="text1" id="text1">
<div class="form">
<textarea rows="4" cols="45" name="text"><%=h content.to_s.toutf8 %></textarea>
<% case self.class.to_s %>
<% when "Fuwatto::CiniiAuthorApp" %>
<input type="submit" value=" 著 者 検 索 "/>
<% when /\AFuwatto::(Springer|Worldcat|DPLA)App\Z/ %>
<input type="submit" value=" 検 索 (Search) "/>
<% else %>
<input type="submit" value=" 論 文 検 索 "/>
<% end %>
<% if /\AFuwatto::(Cinii|JStage|DPLA)App\Z/ =~ self.class.to_s %>
<input type="checkbox" name="combination" title="関連度順ソート"
<% if not @cgi.params["combination"].empty? %>
checked="checked"
<% end %>
/>
<% end %>
</div>
</form>
</div>
<div id="box2">
<form action="<%=h @cgi.script_name %>" method="get" name="url1" id="url1">
<div class="form">
<input type="text" name="url" value="<%=h( url || "http://" ) %>" size="70" />
<% case self.class.to_s %>
<% when "Fuwatto::CiniiAuthorApp" %>
<input type="submit" value=" 著 者 検 索 "/>
<% when /\AFuwatto::(Springer|Worldcat|DPLA)App\Z/ %>
<input type="submit" value=" 検 索 (Search) "/>
<% else %>
<input type="submit" value=" 論 文 検 索 "/>
<% end %>
<% if /\AFuwatto::(Cinii|JStage|DPLA)App\Z/ =~ self.class.to_s %>
<input type="checkbox" name="combination" title="関連度順ソート"
<% if not @cgi.params["combination"].empty? %>
checked="checked"
<% end %>
/>
<% end %>
</div>
</form>
</div>
</div>
</div>
<script type="text/javascript">
seltab( 'box', 'head', 10, <%= query_url? ? 2 : 1 %> )
</script>
<% if result %>
<%= result %>
<p class="pagination">ページ:
<% first_page = data[ :page ] - MAX_PAGE / 2 %>
<% first_page = 0 if first_page < 0 %>
<% last_page = ( data[ :totalResults ] - 1 ) / data[ :count ] %>
<% last_page = data[:page] + MAX_PAGE / 2 if last_page - first_page > MAX_PAGE %>
<% ( first_page .. last_page ).each do |i| %>
<% href = "#{ @cgi.script_name }?#{ @cgi.query_string.to_s.gsub( /[;&]?page=\w*\b/, "" ) }" %>
<% if url.nil? %>
<% onclick = " onclick=\"submit_page_text(#{i});return false;\"" %>
<% href = "#" %>
<% end %>
<% if i == data[ :page ] %>
<span class="idx"><%= i + 1 %></span>
<% elsif i == 0 %>
<a href="<%=h href %>"<%= onclick %> rel="nofollow">1</a>
<% else %>
<a href="<%=h href %>;page=<%=h i %>"<%= onclick %> rel="nofollow"><%=h i+1 %></a>
<% end %>
<% end %>
</p>
<% else %>
<div class="help-text">
<%= self.class::HELP_TEXT %>
<%= self.class::EXAMPLE_TEXT %>
</div>
<% end %>
<hr />
<div id="footer">
<address>高久雅生 (Masao Takaku)<br />
<a href="http://masao.jpn.org/">http://masao.jpn.org/</a>,
<a href="mailto:[email protected]">[email protected]</a></address>
<div class="id">Powered by fuwatto.rb <%=h Fuwatto::VERSION %></div>
</div>
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-389547-4";
urchinTracker();
</script>
</body>
</html>