-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
157 lines (132 loc) · 5.3 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
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
<!DOCTYPE html>
<html>
<head>
<title>Calculator</title>
<meta charset="utf-8">
<meta name="description" content="Calculator with multiple lines of calculations that can be referenced and edited in real time.">
<meta name="keywords" content="calculator, online, multiple, referenced, variables, powerful, math, mathematics, arithmetic, fractions, precision, 64, web">
<meta name="viewport" content="user-scalable=no">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<script src="js/libs/math.min.js"></script>
<script src="js/libs/handlebars.min.js"></script>
<script src="js/libs/msg.js"></script>
<script src="js/libs/dom.js"></script>
<script src="js/libs/needcontext.js"></script>
<script src="js/main/init.js"></script>
<script src="js/main/utils.js"></script>
<script src="js/main/buttons.js"></script>
<script src="js/main/lines.js"></script>
<script src="js/main/keyboard.js"></script>
<script src="js/main/windows.js"></script>
<script src="js/main/options.js"></script>
<script src="js/main/state.js"></script>
<script src="js/main/calc.js"></script>
<link rel="stylesheet" href="css/style.css">
<script>
window.onload = function () {
App.version = "24.0.0"
App.init()
}
</script>
</head>
<body>
<div id="main">
<div id="app_top">
<div id="top_buttons">
<div class="linky" id="lnk_new">New</div>
<div>-</div>
<div class="linky" id="lnk_options">Options</div>
<div>-</div>
<div class="linky" id="lnk_about">About</div>
</div>
<div id="controls">
<div id="buttons"></div>
<div id="infobar" title="Click to change mode">Nothing</div>
</div>
</div>
<div id="lines">
</div>
<!-- Templates -->
<script id="template_about" type="text/x-handlebars-template" class="template">
<b>Merkoba Calculator</b><br>
Version {{version}}<br><br>
This is a calculator that aims to empower users through a different workflow than what is found in most common calculator programs.<br><br>
It's based around multiple "line" of calculations which can be reused and edited anytime.<br><br>
Calculations are done by the <a href="http://mathjs.org/docs/index.html" target=_blank>math.js</a> library, with high precision settings enabled.<br><br>
Calculations are done automatically in real time using topological sorting.<br><br>
Since it needs to by acyclical, some variables can't be used in some places. For example you can't make $b depend on $a and $a depend on $b at the same time, since it can't be resolved.<br><br>
Note: Formatting and rounding are only applied to the displayed results, not to internal calculations.
<br><br><br><span class="b2"><b>Shortcuts</b></span><br><br>
Enter will focus the next available empty line or create a new one.<br><br>
Shift + Enter adds the previous line's variable into the new one.<br><br>
Control + Enter does the same but also copies the line's input into the new one.<br><br>
Control + Shift + Enter replaces a line's input's variables with their inputs.<br><br>
Control + Shift + Space formats the input.<br><br>
Up and Down arrows change the focus between lines.<br><br>
Shift + Up and Shift + Down move the lines up or down.<br><br>
Escape clears lines and closes windows.<br><br>
Some buttons have a context menu with more actions.<br><br><br>
</script>
<script id="template_options" type="text/x-handlebars-template" class="template">
<div id="options_container">
<div class="options_item">
Add Commas
<div class="vseparator2"></div>
{{#if commas}}
<input id="chk_commas" type="checkbox" checked>
{{else}}
<input id="chk_commas" type="checkbox">
{{/if}}
</div>
<div class="vseparator"></div>
<div class="options_item">
Mixed Fractions
<div class="vseparator2"></div>
{{#if mixed}}
<input id="chk_mixed" type="checkbox" checked>
{{else}}
<input id="chk_mixed" type="checkbox">
{{/if}}
</div>
<div class="vseparator"></div>
<div class="options_item">
Round Results
<div class="vseparator2"></div>
{{#if round}}
<input id="chk_round" type="checkbox" checked>
{{else}}
<input id="chk_round" type="checkbox">
{{/if}}
</div>
<div class="vseparator"></div>
<div class="options_item">
Round Places
<div class="vseparator2"></div>
<select id="sel_round_places">
{{#each places}}
<option value="{{this}}">{{this}}</option>
{{/each}}
</select>
</div>
</div>
</script>
<script id="template_line" type="text/x-handlebars-template" class="template">
<input type="text" class="comment hidden" id="{{letter}}_title" placeholder="Comment" spellcheck="true">
<div class="line_top">
<button class="button variable">${{letter}}</button>
<input type="text" class="input" id="input_{{letter}}" value="{{value}}" spellcheck="false">
<button class="button menu">...</button>
</div>
<div class="result_container">
<span class="result"></span>
</div>
</script>
<script id="template_confirm" type="text/x-handlebars-template" class="template">
<div id="confirm_message"></div>
<div id="confirm_buttons">
<button id="confirm_cancel">Cancel</button>
<button value="Cancel" id="confirm_ok">Confirm</button>
</div>
</script>
</body>
</html>