summaryrefslogtreecommitdiff
path: root/html/quotes.jsp
blob: 97e9dafd809a5d992822af5cfdbad0890f11c9fe (plain)
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
<%@ page contentType="text/html; charset=UTF-8" 
         import="java.util.List"
%>
<html>
<head>
<meta name="robots" content="noindex, nofollow" />
<link rel="shortcut icon" href="/favicon.ico" />
<title>Quotes fra #linux.no på freenode</title>
<style type="text/css">
body {font-family: monospace;}
hr {
	border-style: solid;
	border-color: black;
	border-width: 1px; 
}
</style>
</head>
<body bgcolor="#FFFFFF" text="#000000" link="#000000" vlink="#000000">

<pre>
                     _ _  
                    | (_)_ __  _   ___  __  _ __   ___  
              _|_|_ | | | '_ \| | | \ \/ / | '_ \ / _ \ 
              _|_|_ | | | | | | |_| |)  ( _| | | | (_) | 
               | |  |_|_|_| |_|\__,_/_/\_(_)_| |_|\___/ 
             -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=BETA-=-
                   Quotes fra #linux.no på freenode
                  Klikk <a href="add.jsp">her</a> for å legge til en quote

              Sortér etter <a href="quotes.jsp?order=date">quote-dato</a> | <a href="quotes.jsp?order=score">score</a> | <a href="quotes.jsp?order=timestamp">timestamp</a>
</pre>
<hr>

<script>

function vote(id, value) {
    var http = new XMLHttpRequest();
    http.open("GET","/vote?id="+id+"&vote="+value);
    http.onreadystatechange=function() {
        if(http.readyState==4) {
            document.getElementById("v"+id).innerHTML = http.responseText;
        }
    }
    http.send(null);
}
</script>


<%

String order = request.getParameter("order");
 
List<lq.Quote> quotes;

if (order == null) {
    quotes = lq.QuoteUtil.getQuotesOrderedByTimestampDesc();
} else if(order.equals("timestamp")) {
    quotes = lq.QuoteUtil.getQuotesOrderedByTimestampDesc();
} else if(order.equals("score")) {
    quotes = lq.QuoteUtil.getQuotesOrderedByScoreDesc();
} else if(order.equals("date")) {
    quotes = lq.QuoteUtil.getQuotesOrderedByDateDesc();
} else {
    quotes = lq.QuoteUtil.getQuotesOrderedByTimestampDesc();
}

lq.Printer printer = new lq.Printer(out); 
long displayIndex = quotes.size() + 1;
for (lq.Quote quote : quotes) {
    printer.printQuote(quote, displayIndex);
    displayIndex = displayIndex - 1;
}

%>
<center>
<br>
<p>linoquotes v.2 © 2004-2010 Erlend Hamberg, Vidar Holen, Kjetil Ørbekk, John H. Anthony.
<br>See <a href="http://github.com/orbekk/linoquotes">http://github.com/orbekk/linoquotes</a>
  for details.</p>
<p>The quotes on this page are copyright their respective owners and submitters.</p>
<p>Powered by Google AppEngine.</p>
</center>
</body>
</html>