path: root/Makefile
diff options
authorYorhel <>2010-11-25 17:22:58 +0100
committerYorhel <>2010-11-25 17:38:16 +0100
commit625871cba8a2fe71c70b3d2946a5f37993d1f263 (patch)
tree1288db3b6ea43467251a6039a26e861326f0babe /Makefile
parent7004c8352cda3c81e547aabc037fd9ec7f03172c (diff)
JS: Split script.js into a separate file for each language
This greatly reduces the size of the Javascript file. The compressed size has been reduced with about 9kB, and is now a total of 14kB for en.js. A nice property of this is that more translations can be added without increasing the JS size. While I was at it, I made also replace mt() function calls in cases where an exact TL string was requested without any additional arguments and/or formatting codes. This helped reduce the compressed size by about 1kB. My aim is to keep *all* the JS code of VNDB smaller than the jQuery core library, as a general "fuck you" towards users of large and bloated JS libraries. We must keep the VNDB page loading times lower than that of other sites, after all!
Diffstat (limited to 'Makefile')
1 files changed, 6 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 51ceb86f..8496bd9f 100644
--- a/Makefile
+++ b/Makefile
@@ -42,9 +42,9 @@
all: dirs js skins robots data/
-dirs: static/cv static/sf static/st data/log www www/feeds
+dirs: static/f/js static/cv static/sf static/st data/log www www/feeds
-js: static/f/script.js
+js: static/f/js/en.js
skins: static/s/*/style.css
@@ -54,10 +54,10 @@ static/cv static/sf static/st:
mkdir $@;
for i in $$(seq -w 0 1 99); do mkdir "$@/$$i"; done
-data/log www www/feeds:
+static/f/js data/log www www/feeds:
mkdir $@
-static/f/script.js: data/script.js data/lang.txt util/ data/ data/
+static/f/js/en.js: data/script.js data/lang.txt util/ data/ data/
static/s/%/style.css: static/s/%/conf util/ data/style.css
@@ -68,7 +68,7 @@ static/s/%/style.css: static/s/%/conf util/ data/style.css
echo 'Disallow: /' >> $@
chmod: all
- chmod a-x+rw static/f/script.js
+ chmod a+xrw static/f/js
chmod -R a-x+rwX static/{cv,sf,st}
chmod a-x+rw static/s/*/{style.css,boxbg.png}
@@ -149,6 +149,7 @@ update-2.13: all
update-2.14: all
+ rm static/s/script.js
${runpsql} < util/updates/update_2.14.sql