-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
102 lines (102 loc) · 3.1 KB
/
index.html
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
<!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" xml:lang="pl">
<head>
<meta http-equiv="Content-type" content="text/html; charset=UTF-8" />
<title>Kalkulator ONP</title>
<style type="text/css" media="screen">
body {
font-family: Verdana;
}
#container {
width: 450px;
margin: 0 auto;
}
h1 {
text-align: center;
border-bottom: 1px solid #ccc;
}
input[type="submit"], textarea {
font-size: 24px;
line-height: 24px;
border: 1px solid #efefef;
padding: 9px;
margin: 0 auto;
display: block;
width: 430px;
margin-bottom: 10px;
}
input[type="submit"] {
background-color: #fff;
outline: 0;
width: 100%;
}
input[type="submit"]:hover, textarea:hover,
input[type="submit"]:focus, textarea:focus {
border: 1px solid #ccc;
}
input[type="submit"]:active {
background-color: #FFFF99;
}
#info {
width: 100%;
overflow: hidden;
margin-bottom: 40px;
}
table {
border: 1px solid #efefef;
border-collapse: collapse;
}
td, th {
border: 1px solid #efefef;
padding: 5px;
}
#column-5, #column-6, #column-7 {
width: 150px;
float: left;
}
</style>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript">
//<![CDATA[
$(document).ready(function () {
$('#calcForm').submit(function(e) {
e.preventDefault();
$.getJSON($(this).attr('action'), $(this).serialize(), function(data) {
$('textarea[name="result"]').html(data.result);
});
});
});
//]]>
</script>
</head>
<body>
<div id="container">
<h1>Kalkulator <abbr title="Odwrotna notacja polska">ONP</abbr></h1>
<form method="get" action="onp.php" id="calcForm">
<textarea rows="4" name="expression">1+1-4</textarea>
<input type="submit" name="action" value="=" />
</form>
<div id="results">
<textarea rows="1" name="result"></textarea>
</div>
<p>
<b>Przykład</b>: <code>max(sin(PI/2+2*PI)+cos(2*2*PI)+tg(2*PI)+ctg(PI/2+2*PI)+2^2/2-2+2*2-4 + ((2+2)*2-(4/2*2)*2), max(1, 0))</code>
</p>
<div id="info">
<div id="column-5">
<h3>Operatory</h3>
<p>+, -, *, /, ^</p>
</div>
<div id="column-6">
<h3>Funkcje</h3>
<p>sin, cos, tg, ctg, max</p>
</div>
<div id="column-7">
<h3>Stałe</h3>
<p>PI, E</p>
</div>
</div>
</div>
</body>
</html>