chaitu236 / TakWeb

Javascript based Tak client
https://www.playtak.com
GNU General Public License v2.0
39 stars 18 forks source link

Modularization index.html #16

Closed TreffnonX closed 8 years ago

TreffnonX commented 8 years ago

Split index.html into multiple files. css styles -> css/tak.css ui functions -> js/tak.js settings loading -> js/settings.js board -> js/board.js server -> js/server.js

Aside from that, no features, no functions, I promise =)

TreffnonX commented 8 years ago

In theory, it would make a lot of sense to split board up further. what do you think?

chaitu236 commented 8 years ago

I wouldn't prefer that. Lot of files means lot more page load time. I'm still not very sure about the current split itself

TreffnonX commented 8 years ago

Files are almost as long as before and are all loaded within the html. thery practically all get loaded instantly after index.html. no cascading.

chaitu236 commented 8 years ago

http://stackoverflow.com/questions/15236767/one-big-javascript-file-or-multiple-smaller-files But I guess the current split is alright for now

chaitu236 commented 8 years ago

startTime, stopTime, getZero belong in board.js

TreffnonX commented 8 years ago

There seems to be a way to compress the files and package them into one, before uploading them. This allows complete modularization, while having everything packed up in one file.

This particular tool seems to do just that: https://github.com/websharks/html-compressor

TreffnonX commented 8 years ago

I quote: I mentioned two files. In some cases, it could be good having one small file, that takes care of the "bootstrap" operations, meanwhile the "big file" – especially if it's really big – is downloaded. This is useful especially for the first access, because users doesn't have your files cached yet.

chaitu236 commented 8 years ago

Squash merged your changes as the commit can be easily reverted if problems arise

chaitu236 commented 8 years ago

Reverted the changes as auto login feature was not working

chaitu236 commented 8 years ago

Oh, and after the auto-login issue is fixed, can you submit another pull request with all the commits squash merged into 1 commit so that I can directly merge your branch - this will show your name in the commit history.

TreffnonX commented 8 years ago

Hmm... this is very weird. Auto login is working for me.

TreffnonX commented 8 years ago

I will probably need longer to find this issue.

chaitu236 commented 8 years ago

When I reload the page, it doesn't autologin, but when I click the "Signup/Login" button, it auto logins.

TreffnonX commented 8 years ago

Yap, correct. It does work on my branch, but not on yours. I need to see why.

Actually correction: I forgot to disable the login clamp you have installed: if (url.indexOf("playtak") > -1) url = 'playtak.com:3000'; That was the reason I didn't conect. I tried it and now it works like a charm for me.. Well.... seems like I will not be able to fix this right away, I will have to come back with a solution.

TreffnonX commented 8 years ago

I will close this, as it is stale at this point. Also the non-auto-login seems to be a problem on some devices.