Skip to content

Commit 78f7bd2

Browse files
committed
Merge branch 'master' into sandstorm
Conflicts: Makefile static/multi.js
2 parents 62ed9a9 + 177f7bd commit 78f7bd2

File tree

156 files changed

+8062
-1898
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

156 files changed

+8062
-1898
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
/node_modules/
22
/dump.json
3+
*.swp

Dockerfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
#
22
# This image requires a linked redis Docker container:
33
#
4-
# docker run -d redis
4+
# docker run --name redis -d -v /docker/host/dir:/data redis redis-server --appendonly yes
55
# docker run -d -p 8000:8000 --link redis:redis audreyt/ethercalc
66
#
77

8-
FROM node:0.10-slim
8+
FROM node:0.10
99

1010
RUN useradd ethercalc --create-home
1111
RUN npm install -g ethercalc pm2
1212

1313
USER ethercalc
1414
ENV HOME /home/ethercalc
1515
EXPOSE 8000
16-
CMD ["sh", "-c", "REDIS_HOST=$REDIS_PORT_6379_TCP_ADDR REDIS_PORT=$REDIS_PORT_6379_TCP_PORT pm2 start -x /usr/local/bin/ethercalc -- --cors && pm2 logs"]
16+
CMD ["sh", "-c", "REDIS_HOST=$REDIS_PORT_6379_TCP_ADDR REDIS_PORT=$REDIS_PORT_6379_TCP_PORT pm2 start -x `which ethercalc` -- --cors && pm2 logs"]

Makefile

+5-7
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,22 @@ ETHERCALC_FILES=\
1717
static/jquery.js \
1818
static/vex.combined.min.js
1919

20-
CLOSURE_COMPILER=closure-compiler
21-
2220
JS_FILES=\
2321
app.js dotcloud.js player.js main.js sc.js db.js
2422

25-
all :: SocialCalcModule.js
26-
env PATH="$$PATH:./node_modules/LiveScript/bin" lsc -c -o . src
23+
all :: depends
24+
env PATH="$$PATH:./node_modules/livescript/bin" lsc -c -o . src
2725
node app.js $(ETHERCALC_ARGS) --cors
2826

2927
manifest ::
3028
perl -pi -e 's/# [A-Z].*\n/# @{[`date`]}/m' manifest.appcache
3129

3230
vm :: SocialCalcModule.js
33-
env PATH="$$PATH:./node_modules/LiveScript/bin" lsc -c -o . src
31+
env PATH="$$PATH:./node_modules/livescript/bin" lsc -c -o . src
3432
node app.js --vm $(ETHERCALC_ARGS)
3533

3634
expire :: SocialCalcModule.js
37-
env PATH="$$PATH:./node_modules/LiveScript/bin" lsc -c -o . src
35+
env PATH="$$PATH:./node_modules/livescript/bin" lsc -c -o . src
3836
node app.js --expire 10 $(ETHERCALC_ARGS)
3937

4038
./node_modules/streamline/bin/_node :
@@ -47,7 +45,7 @@ depends :: app.js static/ethercalc.js static/start.css static/multi.js
4745

4846
SocialCalcModule.js :: $(SOCIALCALC_FILES) exports.js
4947

50-
static/ethercalc.js: $(ETHERCALC_FILES)
48+
static/ethercalc.js: $(ETHERCALC_FILES) SocialCalcModule.js
5149

5250
.coffee.js:
5351
coffee -c $<

README.mkdn

+9-4

SocialCalcModule.js

+218-117
Large diffs are not rendered by default.

apache/apache-proxy.conf

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<VirtualHost *:80>
2+
# The ServerName directive sets the request scheme, hostname and port that
3+
# the server uses to identify itself. This is used when creating
4+
# redirection URLs. In the context of virtual hosts, the ServerName
5+
# specifies what hostname must appear in the request's Host: header to
6+
# match this virtual host. For the default virtual host (this file) this
7+
# value is not decisive as it is used as a last resort host regardless.
8+
# However, you must set it for any further virtual host explicitly.
9+
ServerName myethercalc.domain.com
10+
11+
ServerAdmin webmaster@localhost
12+
DocumentRoot /var/www/html
13+
14+
ErrorLog ${APACHE_LOG_DIR}/ethercalc-error.log
15+
CustomLog ${APACHE_LOG_DIR}/ethercalc-access.log combined
16+
17+
# Proxy pass to the node.js server (port 8000)
18+
ProxyPass / http://127.0.0.1:8000/
19+
ProxyPassReverse / http://127.0.0.1:8000/
20+
21+
# Set up websockets to work through the proxy
22+
RewriteEngine On
23+
RewriteCond %{REQUEST_URI} ^/socket.io [NC]
24+
RewriteCond %{QUERY_STRING} transport=websocket [NC]
25+
RewriteRule /(.*) ws://localhost:8000/$1 [P,L]
26+
27+
28+
# Simple Auth for both viewing and editing sheets
29+
<LocationMatch "^/">
30+
AuthType Basic
31+
AuthName "Ethercalc Viewer"
32+
AuthUserFile "/etc/apache2/htpasswd"
33+
Require valid-user
34+
Order allow,deny
35+
Allow from all
36+
</LocationMatch>
37+
38+
<LocationMatch ^/(.*)/edit$>
39+
AuthType Basic
40+
AuthName "Ethercalc Viewer"
41+
AuthUserFile "/etc/apache2/htpasswd"
42+
Require user admin
43+
Order allow,deny
44+
Allow from all
45+
</LocationMatch>
46+
47+
# Set up an alias for static files. Saves having to serve them from node.js
48+
Alias /static /path/to/ethercalc/install/static
49+
Alias /l10n /path/to/ethercalc/install/l10n
50+
Alias /images /path/to/ethercalc/install/images
51+
52+
</VirtualHost>
53+

app.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

db.js

+10-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dotcloud.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

images/sc-aligncenter.gif

-70 Bytes
Binary file not shown.

images/sc-alignleft.gif

-70 Bytes
Binary file not shown.

images/sc-alignright.gif

-71 Bytes
Binary file not shown.

images/sc-bordersoff.gif

-70 Bytes
Binary file not shown.

images/sc-borderson.gif

-89 Bytes
Binary file not shown.

images/sc-chooserarrow.gif

-150 Bytes
Binary file not shown.

images/sc-commentbg.gif

-54 Bytes
Binary file not shown.

images/sc-copy.gif

-97 Bytes
Binary file not shown.

images/sc-cut.gif

-87 Bytes
Binary file not shown.

images/sc-delete.gif

-84 Bytes
Binary file not shown.

images/sc-deletecol.gif

-95 Bytes
Binary file not shown.

images/sc-deleterow.gif

-88 Bytes
Binary file not shown.

images/sc-divider1.gif

-45 Bytes
Binary file not shown.

images/sc-filldown.gif

-105 Bytes
Binary file not shown.

images/sc-fillright.gif

-100 Bytes
Binary file not shown.

images/sc-formuladialog.gif

-76 Bytes
Binary file not shown.

images/sc-hidecol.gif

-91 Bytes
Binary file not shown.

images/sc-hiderow.gif

-84 Bytes
Binary file not shown.

images/sc-insertcol.gif

-100 Bytes
Binary file not shown.

images/sc-insertrow.gif

-86 Bytes
Binary file not shown.

images/sc-less-hd.gif

-935 Bytes
Binary file not shown.

images/sc-less-vd.gif

-936 Bytes
Binary file not shown.

images/sc-less-vh.gif

-158 Bytes
Binary file not shown.

images/sc-linkdialog.gif

-71 Bytes
Binary file not shown.

images/sc-linkout.gif

-275 Bytes
Binary file not shown.

images/sc-lock.gif

-101 Bytes
Binary file not shown.

images/sc-lockbg.gif

-54 Bytes
Binary file not shown.

images/sc-merge.gif

-90 Bytes
Binary file not shown.

images/sc-more-hd.gif

-937 Bytes
Binary file not shown.

images/sc-more-vd.gif

-943 Bytes
Binary file not shown.

images/sc-more-vh.gif

-159 Bytes
Binary file not shown.

images/sc-movefrom.gif

-100 Bytes
Binary file not shown.

images/sc-movefromoff.gif

-89 Bytes
Binary file not shown.

images/sc-moveinsert.gif

-97 Bytes
Binary file not shown.

images/sc-moveinsertoff.gif

-92 Bytes
Binary file not shown.

images/sc-movepaste.gif

-95 Bytes
Binary file not shown.

images/sc-movepasteoff.gif

-90 Bytes
Binary file not shown.

images/sc-multilinedialog.gif

-63 Bytes
Binary file not shown.

images/sc-paste.gif

-100 Bytes
Binary file not shown.

images/sc-pasteformats.gif

-99 Bytes
Binary file not shown.

images/sc-peerbg.gif

-54 Bytes
Binary file not shown.

images/sc-recalc.gif

-190 Bytes
Binary file not shown.

images/sc-redo.gif

-89 Bytes
Binary file not shown.

images/sc-sumdialog.gif

-69 Bytes
Binary file not shown.

images/sc-swapcolors.gif

-96 Bytes
Binary file not shown.

images/sc-trackingline-h.gif

-54 Bytes
Binary file not shown.

images/sc-trackingline-v.gif

-54 Bytes
Binary file not shown.

images/sc-undo.gif

-90 Bytes
Binary file not shown.

images/sc-unlock.gif

-102 Bytes
Binary file not shown.

images/sc-unmerge.gif

-93 Bytes
Binary file not shown.

images/sc-wikiflag.gif

-81 Bytes
Binary file not shown.

images/sc-wikilinkflag.gif

-88 Bytes
Binary file not shown.
File renamed without changes.

images/sc_aligncenter.png

109 Bytes

images/sc_alignleft.png

111 Bytes

images/sc_alignright.png

111 Bytes

images/sc_autosum.png

166 Bytes

images/sc_bordersoff.png

88 Bytes

images/sc_borderson.png

113 Bytes

images/sc_copy.png

100 Bytes
File renamed without changes.
File renamed without changes.

images/sc_cut.png

353 Bytes
File renamed without changes.

images/sc_delete.png

1.73 KB

images/sc_deletecolumns.png

119 Bytes

images/sc_deleterows.png

114 Bytes

images/sc_divider1.png

163 Bytes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

images/sc_filldown.png

204 Bytes

images/sc_fillright.png

207 Bytes

images/sc_formatpaintbrush.png

201 Bytes

images/sc_hidecol.png

472 Bytes

images/sc_hiderow.png

273 Bytes

images/sc_insertcolumns.png

132 Bytes

images/sc_insertformula.png

340 Bytes

images/sc_inserthyperlink.png

152 Bytes

images/sc_insertrows.png

131 Bytes
File renamed without changes.
File renamed without changes.
File renamed without changes.

images/sc_listbox.png

228 Bytes

images/sc_lock.png

255 Bytes
File renamed without changes.
File renamed without changes.
File renamed without changes.

images/sc_mergecells.png

171 Bytes
File renamed without changes.
File renamed without changes.
File renamed without changes.

images/sc_movefrom.gif

100 Bytes

images/sc_movefromoff.gif

89 Bytes

images/sc_moveinsert.gif

97 Bytes

images/sc_moveinsertoff.gif

92 Bytes

images/sc_movepaste.gif

95 Bytes

images/sc_movepasteoff.gif

90 Bytes
File renamed without changes.
File renamed without changes.

images/sc_paste.png

217 Bytes
File renamed without changes.

images/sc_recalc.png

147 Bytes

images/sc_redo.png

183 Bytes
File renamed without changes.
File renamed without changes.

images/sc_swapcolors.png

432 Bytes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

images/sc_undo.png

220 Bytes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

images/sc_unlock.png

256 Bytes

index.html

+14-84
Original file line numberDiff line numberDiff line change
@@ -26,92 +26,22 @@
2626
<script src="./player/graph.js"></script>
2727
<script src="./player/main.js"></script>
2828
<script>
29-
var l10n_zh_TW = {
30-
"s_BrowserNotSupported": "瀏覽器不支援",
31-
"s_loc_align_center": "置中",
32-
"s_loc_align_left": "置左",
33-
"s_loc_align_right": "置右",
34-
"s_loc_alignment": "對齊方式",
35-
"s_loc_audit": "紀錄",
36-
"s_loc_auto_sum": "自動加總",
37-
"s_loc_automatic": "自動",
38-
"s_loc_borders": "邊框",
39-
"s_loc_bottom": "底",
40-
"s_loc_csv_format": "逗號分隔值(CSV)格式",
41-
"s_loc_cancel": "取消",
42-
"s_loc_cancel": "取消",
43-
"s_loc_category": "分類",
44-
"s_loc_center": "中央",
45-
"s_loc_clear": "清空",
46-
"s_loc_clipboard": "剪貼簿",
47-
"s_loc_color": "顏色",
48-
"s_loc_column_": "欄 ",
49-
"s_loc_comment": "留言",
50-
"s_loc_copy": "複製",
51-
"s_loc_custom": "自訂",
52-
"s_loc_cut": "剪下",
53-
"s_loc_default": "預設",
54-
"s_loc_delete": "刪除",
55-
"s_loc_delete_column": "刪除欄",
56-
"s_loc_delete_contents": "刪除內文",
57-
"s_loc_delete_row": "刪除列",
58-
"s_loc_down": "下",
59-
"s_loc_edit": "編輯",
60-
"s_loc_font": "字體",
61-
"s_loc_format": "格式",
62-
"s_loc_formula": "公式",
63-
"s_loc_function_list": "函式表",
64-
"s_loc_functions": "函式",
65-
"s_loc_grid": "格",
66-
"s_loc_graph": "圖表",
67-
"s_loc_horizontal": "水平",
68-
"s_loc_insert_column": "置入一欄",
69-
"s_loc_insert_row": "置入一列",
70-
"s_loc_italic": "斜體",
71-
"s_loc_left": "左",
72-
"s_loc_left_border": "左邊框",
73-
"s_loc_link": "連結",
74-
"s_loc_list": "清單",
75-
"s_loc_major_sort": "主要排序",
76-
"s_loc_manual": "手冊",
77-
"s_loc_merge_cells": "合併儲存格",
78-
"s_loc_middle": "置中",
79-
"s_loc_name": "名稱",
80-
"s_loc_names": "名稱",
81-
"s_loc_no_padding": "不留白",
82-
"s_loc_normal": "一般",
83-
"s_loc_number": "數值",
84-
"s_loc_ok": "好",
85-
"s_loc_padding": "留白",
86-
"s_loc_page_name": "頁名",
87-
"s_loc_paste": "貼上",
88-
"s_loc_plain_text": "空白文件",
89-
"s_loc_recalc": "重算",
90-
"s_loc_recalculation": "重新計算",
91-
"s_loc_redo": "重做",
92-
"s_loc_right": "右",
93-
"s_loc_right_border": "右邊框",
94-
"s_loc_sheet_settings": "試算表設定",
95-
"s_loc_save": "存檔",
96-
"s_loc_save_to": "儲存為",
97-
"s_loc_set_value_to": "賦值為",
98-
"s_loc_sort": "排序",
99-
"s_loc_sort_": "排序 ",
100-
"s_loc_sort_cells": "排序儲存格",
101-
"s_loc_url": "網址",
102-
"s_loc_undo": "倒退",
103-
"s_loc_unmerge_cells": "取消合併儲存格",
104-
"s_loc_up": "上",
105-
"s_loc_value": "值",
106-
"s_loc_vertical": "垂直",
107-
"s_loc_wikitext": "協作文字",
108-
"s_loc_workspace": "工作區"
109-
}
110-
if (navigator.language === 'zh-TW') {
111-
for (var k in l10n_zh_TW) {
112-
SocialCalc.Constants[k] = l10n_zh_TW[k]
29+
var readl10nfile = function(data) {
30+
for (var k in data) {
31+
SocialCalc.Constants[k] = data[k];
11332
}
11433
}
34+
$.ajax({url: ("/l10n/" + navigator.language + ".json").replace(/de_\w+/, 'de').replace(/zh-Hant/i, 'zh-TW'),
35+
async: false,
36+
success: function(data){readl10nfile(data)},
37+
error: function() {
38+
$.ajax({url: "/l10n/en.json",
39+
async: false,
40+
success: function(data){readl10nfile(data)},
41+
error: function(){console.error("Language file not found.")}
42+
});
43+
}
44+
});
11545
</script>
11646

11747
<link rel="stylesheet" type="text/css" href="./static/socialcalc.css">

0 commit comments

Comments
 (0)