Compare commits

..

995 Commits

Author SHA1 Message Date
db8af11433 Removed VRIS excess. 2024-10-26 01:53:24 -04:00
ec78f2279e Add hourglass 2024-10-26 01:39:03 -04:00
c13b12f74c Add atoms 2024-10-26 01:39:01 -04:00
4c53f0f77b Add SmearcarDB 2024-10-24 02:55:33 -04:00
b023b561d8 Added Arduino and Compression 2024-10-24 02:51:33 -04:00
838e6e9d89 Add saku 2024-10-24 02:28:19 -04:00
cff4718a1f Add gyrio 2024-10-24 02:28:11 -04:00
cd5f912afd Add goldtouch 2024-10-24 02:28:04 -04:00
efdc0bd31b Add kung-fu-quoting 2024-10-24 02:27:57 -04:00
1f80de1222 Add scheduleac 2024-10-24 02:27:50 -04:00
Kenneth Jao
32b32a60ef css spacing 2018-06-05 23:06:58 -04:00
Kenneth Jao
5632bec45b Added database and files 2018-06-05 22:42:39 -04:00
Kenneth Jao
bd310137ef Fixed bugs 2018-06-05 20:32:10 -04:00
Kenneth Jao
aa229d93d5 Merge branch 'master' of https://github.com/yamanq/smearcar-db 2018-05-30 00:27:48 -04:00
Kenneth Jao
7abb32fcb6 Added phoneme view 2018-05-30 00:27:36 -04:00
Yaman Qalieh
5b314ddac4 remove unnecessary list conversion 2018-05-29 00:16:19 -04:00
Yaman Qalieh
225627bffd add rank comparison 2018-05-27 01:55:30 -04:00
Yaman Qalieh
43373de921 fix duplicate language names in phoneme_rank calculation 2018-05-27 01:33:07 -04:00
Yaman Qalieh
61d0c3cb09 add data analysis 2018-05-25 19:30:45 -04:00
Kenneth Jao
7f7baa5f88 changed listdir 2018-04-28 23:37:28 -04:00
Kenneth Jao
a91204745e Added file extensions 2018-04-28 23:34:45 -04:00
Kenneth Jao
a2dc10db39 Added about and source download 2018-04-28 23:04:34 -04:00
Kenneth Jao
a4b8237b85 Merge branch 'master' of https://github.com/yamanq/smearcar-db 2018-04-28 22:49:53 -04:00
Kenneth Jao
d8310ce45b added source link 2018-04-28 22:49:41 -04:00
yamanq
a77eddf9f3 Merge branch 'master' of https://github.com/yamanq/smearcar-db 2018-04-28 22:44:09 -04:00
Kenneth Jao
737ef3c6fb fixed editing language source 2018-04-28 22:43:11 -04:00
yamanq
840fd4fb63 bug fixes 2018-04-28 22:39:38 -04:00
yamanq
3bf3988354 fix files adding 2018-04-28 21:48:37 -04:00
Kenneth Jao
2771995a0e Source adding complete 2018-04-28 19:40:30 -04:00
yamanq
cf43afad74 expanded readme 2018-04-20 12:54:11 -04:00
Kenneth Jao
614c03b1ac Header title, and minor css 2018-04-19 21:45:56 -04:00
yamanq
e3497c1b9f fix bug 2018-04-19 21:33:09 -04:00
yamanq
1ec1f43940 get files update 2018-04-19 21:24:00 -04:00
yamanq
252607ff86 typo 2018-04-19 21:14:43 -04:00
yamanq
8d8548b654 Merge branch 'master' of github.com:yamanq/smearcar-db 2018-04-19 21:13:23 -04:00
yamanq
d6ac7e821a source adding 2018-04-19 21:13:03 -04:00
Kenneth Jao
8e3aca8e20 css cleanup 2018-04-19 20:47:37 -04:00
Kenneth Jao
35091bb315 Standardized modal creation 2018-04-19 20:41:05 -04:00
Kenneth Jao
1a1c2cced2 Added updating posts 2018-04-19 16:10:18 -04:00
Kenneth Jao
d1492e05df fixed adding users 2018-04-16 23:16:37 -04:00
yamanq
a6a163844a uncomment 2018-04-16 22:52:28 -04:00
yamanq
bdcd0a5e08 fix editor bug 2018-04-16 22:50:11 -04:00
Kenneth Jao
f676a6f905 Merge branch 'master' of https://github.com/yamanq/smearcar-db 2018-04-16 22:34:44 -04:00
Kenneth Jao
780c308b75 added adding users 2018-04-16 22:34:32 -04:00
yamanq
1ac3bd5204 display updates from server and fix server functions 2018-04-16 22:07:34 -04:00
yamanq
5e1067297c static date 2018-04-16 21:41:01 -04:00
Kenneth Jao
e791019dc8 Merge branch 'master' of https://github.com/yamanq/smearcar-db 2018-04-16 21:04:01 -04:00
Kenneth Jao
dc03c58247 Added login functionality 2018-04-16 21:03:44 -04:00
yamanq
3d4735949e fix post method 2018-04-16 20:54:58 -04:00
yamanq
0d03cd67d4 commit editor changes to db 2018-04-16 20:47:36 -04:00
Kenneth Jao
6a0281b00d Editing language now closes correctly 2018-04-16 20:08:53 -04:00
yamanq
88ed4d9886 add user model 2018-04-16 20:01:05 -04:00
yamanq
78aa2ce3f1 fix edit method to allow adding phonemes 2018-04-16 18:47:13 -04:00
yamanq
1a131f74f1 fix alphabetization 2018-04-16 17:52:57 -04:00
yamanq
2cdd58acae rounding 2018-04-16 00:49:30 -04:00
yamanq
44d8752aa3 remove extra logging 2018-04-16 00:42:12 -04:00
yamanq
efb390fe7a alphabetize phonemes 2018-04-16 00:40:53 -04:00
Kenneth Jao
ba1e7de4c3 dropdowns use language ids, edit/add updates page 2018-04-16 00:26:41 -04:00
yamanq
39bce51c48 alphabetize and other 2018-04-15 23:47:12 -04:00
Kenneth Jao
aa2c61cd0f fixed phoneme_remove functions 2018-04-15 22:03:14 -04:00
Kenneth Jao
bf43372d50 added editing values, moved add language button 2018-04-15 21:05:24 -04:00
Kenneth Jao
dfbfda7267 clear add language boxes after submission 2018-04-15 19:07:38 -04:00
Kenneth Jao
6bd532bf8c merge 2018-04-15 18:51:41 -04:00
Kenneth Jao
937c29665c Added language adding 2018-04-15 18:48:21 -04:00
Kenneth Jao
8cbcc247b4 Merge branch 'master' of https://github.com/yamanq/smearcar-db 2018-02-26 15:15:47 -05:00
Kenneth Jao
bb0061875a css changes 2018-02-26 15:15:42 -05:00
Kenneth Jao
c45588b774 Server fixes, single phoneme edit 2018-02-24 23:00:18 -05:00
Kenneth Jao
6eb93ec13a Merge branch 'sqlite-server' of https://github.com/yamanq/smearcar-db 2018-02-23 19:10:00 -05:00
Kenneth Jao
4599124136 Begin editing 2018-02-23 19:08:53 -05:00
Yaman Qalieh
6b90c70539 start Editor model 2018-02-05 21:22:12 -05:00
Kenneth Jao
10db79b984 chart labelling 2018-02-03 23:37:37 -05:00
Kenneth Jao
883e5d1d6d visual edits for chart 2018-02-03 23:33:19 -05:00
Kenneth Jao
5551469c94 added chart 2018-02-03 23:00:40 -05:00
Yaman Qalieh
6b9df945d3 working post on js 2018-01-31 17:12:54 -05:00
Yaman Qalieh
b6c87fa506 finish PATCH and add Updates with approute 2018-01-29 19:36:10 -05:00
yamanq
fdefd2732d Start patch method 2018-01-29 16:35:37 -05:00
Kenneth Jao
0b812dfd7e added chart 2018-01-29 12:39:29 -05:00
Yaman Qalieh
feac17bc5c models, get, post 2018-01-28 23:27:09 -05:00
Kenneth Jao
1a3a3f9ed6 Home page post function, css/animation changes 2018-01-26 17:50:53 -05:00
Kenneth Jao
d7664e6335 removed trello, gitignore 2018-01-24 18:59:56 -05:00
Kenneth Jao
18cdd67b1c changed navigation tabs 2018-01-21 21:29:32 -05:00
Kenneth Jao
3c8505b143 added trello api, data table display 2018-01-21 21:05:48 -05:00
Yaman Qalieh
a4605b9483 add phoneme() 2018-01-21 17:15:39 -05:00
Yaman Qalieh
8db4ee4d58 Merge branch 'master' of github.com:yamanq/smearcar-db 2018-01-21 16:41:32 -05:00
Yaman Qalieh
cf869e3dd8 change documentation (minor) 2018-01-21 16:41:27 -05:00
Yaman Qalieh
2d27836e29 add PATCH method 2018-01-21 16:39:19 -05:00
Kenneth Jao
84c5454ca3 Merge branch 'master' of https://github.com/yamanq/smearcar-db 2018-01-21 15:46:54 -05:00
Kenneth Jao
b5db597145 display info section 2018-01-21 15:46:38 -05:00
Yaman Qalieh
1661aee023 Merge branch 'master' of github.com:yamanq/smearcar-db 2018-01-21 15:32:45 -05:00
Yaman Qalieh
79d826a154 add gitignore template 2018-01-21 15:32:27 -05:00
Kenneth Jao
5fdc59b9bc Merge 2018-01-21 15:05:20 -05:00
Kenneth Jao
d09f1f0ee2 Added dropdowns 2018-01-21 15:03:26 -05:00
Yaman Qalieh
5818b90a60 fix serverURL 2018-01-20 23:07:54 -05:00
Yaman Qalieh
92b1d6d02f merge conflict 2018-01-20 23:03:17 -05:00
Yaman Qalieh
a04a7d0ba9 minor bugs 2018-01-20 23:01:47 -05:00
Kenneth Jao
7ce57e85a0 minor bug and formatting 2018-01-20 23:01:36 -05:00
Yaman Qalieh
4c8fcc4eb1 added get method and language() 2018-01-20 22:34:39 -05:00
Kenneth Jao
ee25012598 change favicon 2018-01-20 21:55:50 -05:00
Kenneth Jao
ba49f61334 added jquery, animations, favicon 2018-01-20 21:35:29 -05:00
Kenneth Jao
bcd7b5a2b7 .gitignore pycache + basic web layout 2018-01-20 19:37:14 -05:00
Kenneth Jao
01ebbacb01 Edit flask run settings, auto_reload and debug 2018-01-20 19:35:27 -05:00
Yaman Qalieh
e49ca04079 improved server.py 2018-01-16 22:00:32 -05:00
yamanq
487224c93f initialize simple server requests 2018-01-16 14:13:19 -05:00
yamanq
7176d5cda5 Initial commit 2018-01-15 22:57:57 -05:00
Kenneth Jao
bc578c80b9 3D organization, better Round function, arrayOperation function 2017-12-06 13:51:51 -05:00
ksjdragon
4d0f16ba79 Merge pull request #1 from yamanq/master
Create README.md
2017-10-23 22:42:39 -04:00
Kenneth Jao
e4a1b0dee3 Fixed file structure 2017-10-23 22:41:31 -04:00
Kenneth Jao
aa214f3077 Optimized if statements 2017-10-23 22:33:09 -04:00
Kenneth Jao
d37aa3738d Cleaned up code, and optmized function 2017-10-23 22:28:15 -04:00
yamanq
88fb3017fb Create README.md 2017-10-23 22:22:32 -04:00
Kenneth Jao
475919fb2c fixed website errors 2017-10-01 09:07:20 -04:00
Kenneth Jao
a8f10450b9 added text for audio 2017-10-01 07:58:01 -04:00
Kenneth Jao
d080fed039 IV refreshing 2017-10-01 05:25:48 -04:00
Kenneth Jao
0e154e2ae4 front-end handling 2017-10-01 04:39:24 -04:00
yamanq
52b50ceb3b merge previous commits 2017-10-01 02:56:56 -04:00
yamanq
1d8639e578 change sound, add image 2017-10-01 02:50:16 -04:00
Kenneth Jao
102114ea43 front-end 2017-10-01 02:49:09 -04:00
Arav-Agarwal
872330dd6a Added rotation and multiple color options 2017-10-01 00:34:43 -04:00
Kenneth Jao
b5d1d73b0c added sound rendering 2017-09-30 22:41:04 -04:00
Kenneth Jao
25f6826113 Added proxy to xml request 2017-09-30 22:06:56 -04:00
Kenneth Jao
58a74a95d4 optimize rendering 2017-09-30 21:43:39 -04:00
Kenneth Jao
4ea16e8b91 basic rendering function 2017-09-30 20:54:55 -04:00
Kenneth Jao
408e7e0196 begin frame drawing 2017-09-30 18:46:31 -04:00
Arav-Agarwal
a99cb5bf0c Fixed merge conflict 2017-09-30 18:44:37 -04:00
Arav-Agarwal
fe9b75bdad Added string to binary function 2017-09-30 18:43:11 -04:00
Kenneth Jao
ef92415ab1 merge 2017-09-30 18:32:52 -04:00
Kenneth Jao
7a22c1be81 drawing begin 2017-09-30 18:32:26 -04:00
yamanq
47c2c17189 add function to get website 2017-09-30 18:30:11 -04:00
Kenneth Jao
3294d11a12 initial comit 2017-09-30 17:14:15 -04:00
yamanq
8205a253e7 merge 2017-09-17 07:41:09 -04:00
yamanq
bfe17196d6 fix graduation year 2017-09-17 07:39:08 -04:00
Kenneth Jao
d6cb1818d3 removed comments demo 2017-09-16 22:59:59 -04:00
Kenneth Jao
336f7f0382 Added demonstration page 2017-09-16 22:50:25 -04:00
yamanq
332cd2795d Add Demo button 2017-09-16 16:30:07 -04:00
Yaman Qalieh
cb41b40f4f fix link on 404 page to work on entire button 2017-09-14 20:36:39 -04:00
Kenneth Jao
2b3ce55a1d fixed perspective mapping 2017-09-10 02:15:51 -04:00
Kenneth Jao
cb1601f677 fix 404 syntax and css 2017-09-02 03:43:32 -04:00
Enrico
5229e4401f fixed 404 2017-09-02 03:32:18 -04:00
Kenneth Jao
e694f6e8cd fixed camera vector calculations 2017-08-30 01:01:44 -04:00
Kenneth Jao
a371bcceeb Fixed projection axis flipping, 2017-08-29 02:30:25 -04:00
Kenneth Jao
ccd6926b0c Added more constructors, camera size 2017-08-28 20:08:02 -04:00
Kenneth Jao
6150a33694 Added constructors for scene and respective functions 2017-08-28 00:48:29 -04:00
Kenneth Jao
ffcc4cf095 added descriptive comments and logging 2017-08-26 18:53:40 -04:00
Kenneth Jao
aedb683f59 rotational camera perspective mapping 2017-08-26 18:25:11 -04:00
Kenneth Jao
4fddbd44c5 initial commit - basic projection 2017-08-17 12:33:30 -04:00
Kenneth Jao
9b3c4ffbb2 reverted dropdown animation code 2017-05-07 01:45:37 -04:00
Kenneth Jao
6d8724b5d7 added reconnecting message 2017-05-05 02:12:45 -04:00
Kenneth Jao
3823592db1 fixed disable filter 2017-05-05 01:53:39 -04:00
Kenneth Jao
6f7c76a56a syntax 2017-05-02 21:03:30 -04:00
Kenneth Jao
354a5e9852 Merge branch 'master' of https://github.com/ksjdragon/hourglass 2017-05-02 21:03:06 -04:00
Kenneth Jao
bfd6d374b1 added blank loading page 2017-05-02 21:02:54 -04:00
Kenneth Jao
73606f87f5 added blank loading page 2017-05-02 21:02:03 -04:00
Kenneth Jao
134fc05b7e minor bug fixes, visual issues 2017-05-02 20:51:30 -04:00
Kenneth Jao
d5fbaf950d page scrolling slowdown 2017-05-01 23:23:16 -04:00
Kenneth Jao
b45fbe52ac visual fix 2017-05-01 23:10:02 -04:00
Kenneth Jao
dda553c9f0 Fixed many bugs, added disconnect notifying 2017-05-01 23:01:54 -04:00
Kenneth Jao
402ad15fce removed coloring from text 2017-04-27 08:40:25 -04:00
ksjdragon
87aa18424c Update README.md 2017-04-27 03:24:39 -04:00
Kenneth Jao
70717dbeae confirm indication on workcard 2017-04-27 03:13:10 -04:00
Kenneth Jao
bc1381cba3 workCard click bug 2017-04-27 03:04:14 -04:00
Kenneth Jao
69739367dc userdropdown animation 2017-04-27 02:43:14 -04:00
Kenneth Jao
75be6fcfae change icon size for admin 2017-04-27 02:20:42 -04:00
Kenneth Jao
c35b47b595 join class bug 2017-04-27 02:10:46 -04:00
Kenneth Jao
7a614fab63 visual class change 2017-04-27 01:53:27 -04:00
Kenneth Jao
41b44eed76 Merge branch 'master' of https://github.com/ksjdragon/hourglass 2017-04-26 02:35:06 -04:00
Kenneth Jao
9255732906 box-shadow color change 2017-04-26 02:34:56 -04:00
Kenneth Jao
e5963b8a6b log errors on client if error 2017-04-25 22:27:30 -04:00
Kenneth Jao
550d2e71fe updateWork fixes 2017-04-25 22:09:03 -04:00
Kenneth Jao
970eb983ee calendar work highlight shows class 2017-04-25 22:00:56 -04:00
Kenneth Jao
2076a9f562 added unapproved classes viewing 2017-04-25 10:43:42 -04:00
Kenneth Jao
dcdb3f526a font size 2017-04-25 10:11:25 -04:00
Kenneth Jao
af905f899d re-added current-work updating 2017-04-25 03:34:59 -04:00
Kenneth Jao
fc3f4319a0 server start log message 2017-04-25 03:28:00 -04:00
Kenneth Jao
4616d1d206 prevent non-full name teachers, removed sikka 2017-04-25 03:17:41 -04:00
Kenneth Jao
16aad247f8 minor fixes 2017-04-25 03:07:56 -04:00
Kenneth Jao
b5edb2bb25 New adding work on desktop 2017-04-25 02:46:06 -04:00
Kenneth Jao
60595ed11a small correction 2017-04-21 08:02:46 -04:00
Kenneth Jao
e17f69892e faster animations, reactive updating viewing work 2017-04-21 02:59:56 -04:00
Kenneth Jao
83fd8f4521 compressed images 2017-04-21 02:59:24 -04:00
Kenneth Jao
6b54df6865 Merge branch 'master' of https://github.com/ksjdragon/hourglass 2017-04-19 03:52:30 -04:00
Kenneth Jao
9b7e356ce4 session variable logout resetting 2017-04-19 03:52:18 -04:00
ksjdragon
0984530a1a Change version 2017-04-19 03:27:28 -04:00
ksjdragon
148cc2c867 Update README.md 2017-04-19 03:26:51 -04:00
Kenneth Jao
9944d9c20d minor cleanup 2017-04-19 03:25:16 -04:00
Kenneth Jao
ef2c00cc8d Updating for mobile, and pan mobile refinement 2017-04-19 03:19:18 -04:00
Kenneth Jao
9f6ababf93 Merge branch 'master' of https://github.com/ksjdragon/hourglass 2017-04-19 01:45:56 -04:00
Kenneth Jao
a1d821f712 Many small fixes, work fully updating 2017-04-19 01:45:46 -04:00
Kenneth Jao
c7cdd30cf5 Merge branch 'master' of https://github.com/ksjdragon/hourglass 2017-04-18 12:13:02 -04:00
Kenneth Jao
5a4d4f47c9 minor css fix 2017-04-18 12:12:47 -04:00
Kenneth Jao
f10e29767a new updating system, in progress 2017-04-18 04:28:05 -04:00
Kenneth Jao
a029d886d0 Merge branch 'master' of https://github.com/ksjdragon/hourglass 2017-04-18 03:29:31 -04:00
Kenneth Jao
b41dc0969b Small interactive and visual fixes 2017-04-18 03:29:21 -04:00
ksjdragon
42cf97da6c Update README.md 2017-04-17 04:21:51 -04:00
Kenneth Jao
dd9b82749c small fixes 2017-04-17 03:48:17 -04:00
Kenneth Jao
0ca99c7680 fixed creator name not displaying 2017-04-15 23:46:35 -04:00
Kenneth Jao
8501a4a2c7 scrolling bug fix 2017-04-15 23:39:49 -04:00
Kenneth Jao
d0e387df0e scroll fix 2017-04-15 23:28:23 -04:00
ksjdragon
ce1eb5e586 Update README.md 2017-04-15 22:31:46 -04:00
Kenneth Jao
2e9c02779e All small fixes 2017-04-15 22:28:43 -04:00
Kenneth Jao
9af7fb3cf8 visual and scrolling fixes 2017-04-13 10:59:20 -04:00
Kenneth Jao
6ef36e57f1 fixed drag scrolling to not jump 2017-04-13 03:23:52 -04:00
Kenneth Jao
822b701b75 Merge branch 'master' of https://github.com/ksjdragon/hourglass 2017-04-13 02:38:27 -04:00
Kenneth Jao
13b4ee6fcb inverted and fixed drag scrolling 2017-04-13 02:38:20 -04:00
ksjdragon
96eb83b866 Update README.md 2017-04-13 02:12:57 -04:00
Kenneth Jao
3ba2cafef0 Merge branch 'master' of https://github.com/ksjdragon/hourglass 2017-04-13 02:11:41 -04:00
Kenneth Jao
a6fc7f618c Added shortname for display, changed description max length to 300 2017-04-13 02:11:31 -04:00
ksjdragon
e70b24c976 Update README.md 2017-04-13 01:55:49 -04:00
Kenneth Jao
479ed28e14 Added variable for versioning 2017-04-13 01:52:34 -04:00
Kenneth Jao
f7d742422d Added drag scrolling for classes, changed theme 2017-04-13 01:49:29 -04:00
Kenneth Jao
8689a964f5 more small fixes 2017-04-13 01:10:16 -04:00
Kenneth Jao
d0501f76ec More partial fixes, css based 2017-04-13 00:30:07 -04:00
Kenneth Jao
a9c10ee990 Partial small fixes 2017-04-12 23:16:45 -04:00
Kenneth Jao
fce7a7f078 Changed short-desc length 2017-04-10 12:47:12 -04:00
ksjdragon
930fc144bb Update README.md 2017-04-08 19:17:45 -04:00
ksjdragon
31db99c543 Update README.md 2017-04-08 19:17:03 -04:00
Kenneth Jao
9852487320 display and minor bugs 2017-04-08 18:41:17 -04:00
Kenneth Jao
a47e8d119e removed mobile platforms 2017-04-08 17:00:37 -04:00
Kenneth Jao
1ff2044206 Fixed mobile not updating on setting change 2017-04-08 16:48:50 -04:00
Kenneth Jao
3f6fd93eed Finished mobile login page 2017-04-08 16:45:53 -04:00
Kenneth Jao
1347bf5ef5 Minor css fixes 2017-04-08 14:20:08 -04:00
Kenneth Jao
0c18d7f5a5 Fixed mobile bugs, changed version display 2017-04-08 14:15:28 -04:00
Kenneth Jao
b31624e632 Redesigned 404 page 2017-04-08 00:23:52 -04:00
Kenneth Jao
b78f6f6512 Merge branch 'master' of https://github.com/ksjdragon/hourglass 2017-04-08 00:11:05 -04:00
Kenneth Jao
e59229bbea Finished mobile main, and mobile login 2017-04-08 00:09:54 -04:00
Kenneth Jao
89a8c7e1d0 t
Finished mobile main, and mobile login
2017-04-08 00:07:00 -04:00
Kenneth Jao
e3c7425ecf mobile animation fix 2017-04-04 13:57:28 -04:00
Kenneth Jao
77051d70ca Mobile page updates 2017-03-30 10:51:24 -04:00
Kenneth Jao
b651d23e9d CSS fixes, more mobile sidebar functionality 2017-03-09 04:55:05 -05:00
Kenneth Jao
e51814b3fb fixed button handling for mobile 2017-03-09 00:56:02 -05:00
Kenneth Jao
1b589176b4 css, mobile button edits 2017-03-03 03:15:55 -05:00
Kenneth Jao
f20c513b4a Added mobile sidebar 2017-03-02 02:25:20 -05:00
Kenneth Jao
662c858b32 horizontal scroll 2017-03-01 12:14:46 -05:00
Kenneth Jao
b0bcab725c Merge branch 'master' of https://github.com/ksjdragon/hourglass 2017-03-01 11:39:58 -05:00
Kenneth Jao
145417bf96 css changs 2017-03-01 11:39:47 -05:00
Kenneth Jao
75a237ebd9 Fixed create class data 2017-02-28 22:59:01 -05:00
Kenneth Jao
8378f0e1de minor css 2017-02-28 22:52:59 -05:00
Kenneth Jao
60117a1af6 minor css fixes 2017-02-28 22:42:01 -05:00
Kenneth Jao
485be935f3 More mobile development 2017-02-26 19:27:50 -05:00
Kenneth Jao
77f8772be8 mobile page start 2017-02-22 23:09:31 -05:00
Kenneth Jao
cced1ee2a6 more scrollbar fix 2017-02-09 10:34:59 -05:00
Kenneth Jao
582e45e84e scrollbar fix 2017-02-09 10:32:27 -05:00
Kenneth Jao
ae8172e7bc minor polishing, small bug fixes 2017-02-09 10:26:22 -05:00
Kenneth Jao
07e62b42ff Css fixes, server bug fix 2017-02-09 09:01:18 -05:00
Kenneth Jao
9f7894a042 update login page 2017-02-08 01:52:15 -05:00
Kenneth Jao
331a41a991 Update readme 2017-02-08 01:15:55 -05:00
Kenneth Jao
81fff55790 Update readme 2017-02-08 01:13:24 -05:00
Kenneth Jao
f1d52316c5 Finished login page, update logo in bg 2017-02-08 00:58:37 -05:00
Kenneth Jao
cec5516d28 Logo changes, some login 2017-02-07 01:32:42 -05:00
Kenneth Jao
8f5a1d061e Minor css and bug fixes, slimScroll fixes 2017-02-05 18:16:04 -05:00
Kenneth Jao
4757bcd5cf CSS fixes, adding slimScroll 2017-02-03 03:43:21 -05:00
Kenneth Jao
bbea11a0cc deleted login page, added new(?) logo 2017-01-26 01:38:19 -05:00
Kenneth Jao
cf082c40d9 Finished profile page, fixed minor bugs, css fixes 2017-01-25 23:19:23 -05:00
Kenneth Jao
7b8a0c43c6 CSS 2017-01-19 14:34:47 -05:00
Kenneth Jao
49bafc87ed More sign-in page, CSS/text fixes, calendar refectching fix 2017-01-19 01:11:17 -05:00
Kenneth Jao
6b10de2d89 Merge branch 'master' of https://github.com/ksjdragon/hourglass 2017-01-18 01:11:25 -05:00
Kenneth Jao
1a741af421 More of sign-up page 2017-01-18 01:10:50 -05:00
Yaman Qalieh
242336de54 Merge branch 'master' of github.com:ksjdragon/hourglass 2017-01-17 10:33:21 -05:00
Kenneth Jao
c80dc3e325 profile page 2017-01-17 00:18:26 -05:00
Yaman Qalieh
2fc96ef4f9 router problems 2017-01-16 17:56:36 -05:00
Kenneth Jao
5026ead717 Merge + CSS 2017-01-16 00:14:55 -05:00
Kenneth Jao
a137dff49f signup page 2017-01-15 23:59:10 -05:00
Yaman Qalieh
793a7ce03f routing + grade + schoolyear of prof page 2017-01-15 22:00:02 -05:00
Yaman Qalieh
c3d2f8252d fix banned bug 2016-11-18 20:57:40 -05:00
Yaman Qalieh
ca94e92267 teacher and banned 2016-11-18 20:51:04 -05:00
Yaman Qalieh
7e1c11dcec add banning 2016-11-18 19:54:39 -05:00
Kenneth Jao
a551c37d1a Completed main page 2016-11-08 20:19:22 -05:00
Yaman Qalieh
941510c931 teacher collection 2016-11-07 21:34:30 -05:00
Kenneth Jao
f25a63271d More menu items 2016-11-07 21:22:51 -05:00
Kenneth Jao
3fef965cce Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-11-07 18:11:08 -05:00
Kenneth Jao
f418ebf162 CSS changeS 2016-11-07 18:10:31 -05:00
Yaman Qalieh
00abcf7ce6 add basework of new profile page 2016-11-07 17:26:02 -05:00
Kenneth Jao
aefcaaf21e Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-11-07 02:51:16 -05:00
Kenneth Jao
6d2d49f78b Slight theme changes, new backgrounds, more menus 2016-11-07 02:51:06 -05:00
yamanq
21a207ab7b Update README.md 2016-11-06 00:31:34 -04:00
Kenneth Jao
4239fd6289 Downgraded momentjs to fix load error 2016-11-05 17:29:43 -04:00
Yaman Qalieh
20b7b5c456 Merge branch 'master' of github.com:ksjdragon/hourglass 2016-11-05 10:35:06 -04:00
Yaman Qalieh
84b0705d39 update meteor and packages 2016-11-05 10:34:21 -04:00
Yaman Qalieh
2c0ca43068 remove subtle pattern for solid bg 2016-11-05 10:29:39 -04:00
Kenneth Jao
a7f7b7798d Decorations 2016-11-04 01:15:08 -04:00
Kenneth Jao
313f79044b Manage class menu start layout 2016-11-03 23:12:57 -04:00
Kenneth Jao
31e8ded42e Added partial menu items 2016-11-03 17:36:07 -04:00
Kenneth Jao
3a9b505abe Finished admin page - buttons, permissions, create admin, user editing, delete correctly, styling 2016-11-03 02:05:43 -04:00
Yaman Qalieh
4a9c117814 Merge branch 'master' of github.com:ksjdragon/hourglass 2016-11-02 23:03:31 -04:00
Yaman Qalieh
3c3bcbffd6 fix bug in securityCheck 2016-11-02 23:03:24 -04:00
Kenneth Jao
043a453b2d Minor changes, small fixes 2016-11-02 19:18:36 -04:00
Kenneth Jao
88beb191c9 Slight reorganization 2016-11-01 23:07:09 -04:00
Kenneth Jao
3efa1a15e2 Added calendar creating work for new UI 2016-11-01 22:34:11 -04:00
Kenneth Jao
d9d2ffb1ae Fixed login CSS 2016-11-01 00:32:42 -04:00
Kenneth Jao
1d59526052 Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-11-01 00:13:13 -04:00
Kenneth Jao
ebc1339282 Fixed tab functionality and click to retract; moved requests to sidebar 2016-11-01 00:13:00 -04:00
Yaman Qalieh
124789983a increase unapproved class number to 8 2016-10-30 22:34:11 -04:00
Yaman Qalieh
6b33252462 faculty graduation year 2016-10-29 00:00:16 -04:00
Yaman Qalieh
3ced7b37a2 success message 2016-10-28 23:59:02 -04:00
Yaman Qalieh
4a6b765086 implement errors onto client 2016-10-28 23:47:26 -04:00
Yaman Qalieh
fcdbca066c fix various bugs 2016-10-28 23:23:07 -04:00
Yaman Qalieh
106f72f1e9 finish security rehaul 2016-10-28 22:24:09 -04:00
Yaman Qalieh
fcc89a7b60 add sikka firewall 2016-10-27 18:29:07 -04:00
Yaman Qalieh
5569b574bf createWork optimizations 2016-10-26 22:02:29 -04:00
Yaman Qalieh
fc57be9d93 fixed bugs in securityCheck and test implemented into createWork 2016-10-26 21:52:47 -04:00
Yaman Qalieh
2029b49a12 improve error function 2016-10-25 22:06:46 -04:00
Yaman Qalieh
692c13f812 start error system 2016-10-25 21:05:56 -04:00
Kenneth Jao
725c779620 Fixed user collection display, and other admin display issues 2016-10-24 09:54:35 -04:00
Kenneth Jao
3810cf8b2b sidebar text formatting 2016-10-24 08:40:56 -04:00
Kenneth Jao
a08db12369 Made filter parts openable, added slim scroll 2016-10-23 22:38:14 -04:00
Kenneth Jao
c7ffbc947c Merge 2016-10-23 22:12:09 -04:00
Kenneth Jao
81962e24ef New UI, display fixes, and small bugs 2016-10-23 22:11:27 -04:00
Kenneth Jao
650e13881b Added admin buttons for status, and user info 2016-10-23 22:10:02 -04:00
Yaman Qalieh
7f0d29ae16 optimizations 2016-10-23 21:47:14 -04:00
Yaman Qalieh
92b23f6d78 toggle approveClass 2016-10-23 21:45:02 -04:00
Yaman Qalieh
a06ed677fe approveClass 2016-10-23 21:42:18 -04:00
Yaman Qalieh
df7dd3cc64 Merge branch 'master' of github.com:ksjdragon/hourglass 2016-10-23 17:51:08 -04:00
Yaman Qalieh
14b16680af remove Papa 2016-10-23 17:50:59 -04:00
Yaman Qalieh
fab410e8fd change export format to ics 2016-10-23 17:50:05 -04:00
yamanq
a00591cc55 Update README.md 2016-10-23 16:35:57 -04:00
yamanq
b15a7875ac Update README.md 2016-10-23 16:35:23 -04:00
yamanq
0eda7b94b7 Finish Profile and add User 2016-10-23 16:34:47 -04:00
Yaman Qalieh
9bf40c2c0d improve duplicate function 2016-10-23 16:23:16 -04:00
Yaman Qalieh
013b0ee851 Merge branch 'master' of github.com:ksjdragon/hourglass 2016-10-23 16:19:16 -04:00
Yaman Qalieh
2bfe58b3f1 prevent overlapping classes 2016-10-23 16:19:08 -04:00
yamanq
2dc62abe6f Update README.md 2016-10-23 16:02:46 -04:00
Yaman Qalieh
d2dbdb0cd3 run filter on profile.js 2016-10-23 15:49:43 -04:00
Yaman Qalieh
5cf986e7e1 update meteor to 1.4.1.3 2016-10-23 15:46:32 -04:00
ksjdragon
234df9df94 Update README.md 2016-10-22 18:43:08 -04:00
ksjdragon
7047697164 Update README.md 2016-10-22 18:42:49 -04:00
Kenneth Jao
05f5f1275f Fixed last commit 2016-10-22 18:39:23 -04:00
Kenneth Jao
254183bec5 Added ordering by subscribers when searching 2016-10-22 18:08:51 -04:00
Kenneth Jao
54e97eadc9 fixed decimal members 2016-10-22 17:43:03 -04:00
Kenneth Jao
a5d3193f0e full autocomplete search 2016-10-22 17:40:42 -04:00
Yaman Qalieh
d7dcf0be86 Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-10-22 17:23:24 -04:00
Yaman Qalieh
18c172c088 classes autocomplete 2016-10-22 17:23:18 -04:00
Kenneth Jao
5baf08543f Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-10-22 17:17:47 -04:00
Yaman Qalieh
fae6597284 search all fields 2016-10-22 17:10:44 -04:00
Kenneth Jao
b8fb7faea0 Added bootstrap js for modals 2016-10-22 17:09:57 -04:00
Yaman Qalieh
aa4efb54c2 dragula reorder 2016-10-22 16:55:22 -04:00
Yaman Qalieh
100889af4c Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-10-22 16:29:50 -04:00
Yaman Qalieh
c002372967 joining bug 2016-10-22 16:29:21 -04:00
ksjdragon
622f6363f3 Max height of classes 2016-10-22 16:15:07 -04:00
Yaman Qalieh
0090f64d8e Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-10-22 16:11:19 -04:00
Yaman Qalieh
59ffa9a756 fix admin code bug 2016-10-22 16:10:52 -04:00
ksjdragon
ced3331006 Removed non-highlighting on admin page 2016-10-22 16:05:33 -04:00
Kenneth Jao
1d51d384d5 More admin functions 2016-10-21 20:35:56 -04:00
Kenneth Jao
e4705c472d minor fixes, started admin editing 2016-10-21 03:03:11 -04:00
Kenneth Jao
4bc535847c ExportDiv css 2016-10-20 22:21:22 -04:00
Kenneth Jao
c56865b407 better dynamic resizing 2016-10-20 22:09:28 -04:00
Kenneth Jao
d9f001e459 description margin 2016-10-20 21:58:42 -04:00
Kenneth Jao
fb073243d9 Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-10-20 21:54:55 -04:00
Kenneth Jao
17c98f163b Many display fixes 2016-10-20 21:54:38 -04:00
Yaman Qalieh
9c1936ee0a check box fix 2016-10-19 21:20:49 -04:00
Yaman Qalieh
174f70769a Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-10-19 21:12:08 -04:00
Yaman Qalieh
76e0a4d55b change thumbs down to warning 2016-10-19 21:12:04 -04:00
Kenneth Jao
0a368eb17e removed unnecessary code 2016-10-19 01:26:24 -04:00
Kenneth Jao
57cacea42a Minor bug fixes 2016-10-19 01:24:14 -04:00
Kenneth Jao
bf025fd1a7 New work bug fix 2016-10-19 00:26:35 -04:00
Kenneth Jao
d08d38acdd default date for new work 2016-10-19 00:15:30 -04:00
Kenneth Jao
86eecc47ee removed console.log 2016-10-18 23:54:24 -04:00
Kenneth Jao
871ba2777e change default theme name in serveR 2016-10-18 23:53:20 -04:00
Kenneth Jao
1942b15113 css fix 2016-10-18 16:34:45 -04:00
Kenneth Jao
274e6f961e Removed theme transitioning 2016-10-18 16:30:35 -04:00
Kenneth Jao
85f9b4798e minor fixes 2016-10-18 16:27:42 -04:00
Kenneth Jao
81dc4a1b75 Css change 2016-10-18 14:22:44 -04:00
Kenneth Jao
9b4d68d8a6 css changes 2016-10-18 14:18:05 -04:00
Kenneth Jao
4e5e7bb14a Naming changes, css fixes, small bugs 2016-10-18 14:14:59 -04:00
Kenneth Jao
98e5575e3d Finished new inputs for profile page 2016-10-16 19:55:19 -04:00
Kenneth Jao
87a36f8250 Finished main page with new inputs 2016-10-16 02:15:47 -04:00
Kenneth Jao
3f931f617a New inputs for creating work, restriction and comments still needed 2016-10-14 01:49:08 -04:00
Kenneth Jao
fcdfa3e63e CSS fixes, centering for all screen sizes 2016-10-13 14:10:39 -04:00
Kenneth Jao
a7154c17dc Readded packages 2016-10-12 01:50:47 -04:00
Kenneth Jao
0bcec1bfd6 Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-10-12 01:47:32 -04:00
Kenneth Jao
640b59636d Cleaned up new input management 2016-10-12 01:45:36 -04:00
Yaman Qalieh
b428045f9d add graduation year on server 2016-10-11 06:40:01 -04:00
Kenneth Jao
b225da48a3 Added yogiben:admin and adjusted css to not apply to admin page 2016-10-11 00:12:24 -04:00
Kenneth Jao
e225f08a6a Merge 2016-10-10 23:06:57 -04:00
Kenneth Jao
44f5f12266 Package editing 2016-10-10 22:26:24 -04:00
Yaman Qalieh
2aa7fda78b create superadmin on profile creation 2016-10-10 22:22:47 -04:00
Yaman Qalieh
ca5db6c42c remove direct bootstrap dependency 2016-10-10 22:14:26 -04:00
Kenneth Jao
3bc2cd1d3d Revert "replace houston with yogiben"
This reverts commit 39a97d101e853ccc144b0e8ceed2b4cbc4061674.

Conflicts:
	lib/constants.js
2016-10-10 00:52:00 -04:00
Kenneth Jao
dc69f67f85 Merge commit 2016-10-09 23:00:40 -04:00
Kenneth Jao
4c813b6667 Basic new input system 2016-10-09 22:57:04 -04:00
Yaman Qalieh
069a9faa9f replace houston with yogiben 2016-10-09 22:55:57 -04:00
Yaman Qalieh
14719eeb99 Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-10-09 12:37:07 -04:00
Yaman Qalieh
8c025136d8 fix #107 2016-10-09 12:36:40 -04:00
yamanq
5f24473999 Update README.md 2016-10-05 22:47:50 -04:00
Yaman Qalieh
be716d982a web beautify filter 2016-10-03 23:13:05 -04:00
Yaman Qalieh
196976cc9f Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-10-02 23:54:38 -04:00
Yaman Qalieh
cc709406c8 semicolon 2016-10-02 23:54:22 -04:00
Kenneth Jao
b5a4351bc2 Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-10-01 17:27:02 -04:00
Kenneth Jao
d5ef3f4881 Compressed images and change calendar text color 2016-10-01 17:26:39 -04:00
Yaman Qalieh
204a2691b7 implement sAlert 2016-10-01 16:18:48 -04:00
Yaman Qalieh
18c784fab3 run code filter 2016-10-01 16:09:58 -04:00
Kenneth Jao
2797423008 Alert on main page button click 2016-10-01 15:56:51 -04:00
Yaman Qalieh
00221db2c8 prepare version name for update 2016-10-01 00:20:29 -04:00
Yaman Qalieh
6801983777 fix final profile bugs; should be ready for 0.1.2 2016-09-29 23:57:32 -04:00
Yaman Qalieh
9e8219b463 fix bugs in profile architecture 2016-09-29 23:51:49 -04:00
Yaman Qalieh
6acb02aa7d upgrade theme structure 2016-09-29 23:39:34 -04:00
Yaman Qalieh
a6756158a3 prepare for version 0.1.2 2016-09-29 22:25:10 -04:00
Yaman Qalieh
9f16a5cc85 fix small typing error 2016-09-28 23:09:45 -04:00
Yaman Qalieh
36705152e0 Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-09-27 19:12:26 -04:00
Yaman Qalieh
e4eba216e4 successful select2 test 2016-09-27 19:12:06 -04:00
Kenneth Jao
c9ad662b36 renamed theme colors 2016-09-27 12:04:40 -04:00
Kenneth Jao
94f775b0d6 Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-09-27 11:47:51 -04:00
Kenneth Jao
73d14137cd Fix merge 2016-09-27 00:26:29 -04:00
Kenneth Jao
d3676ec3ab Merge branch 'master' of https://github.com/ksjdragon/hourglass
Conflicts:
	client/profile/profile.js
2016-09-27 00:24:43 -04:00
Kenneth Jao
bba1cd1c75 Added themes in constants, and background images, minor fixes 2016-09-27 00:22:26 -04:00
Yaman Qalieh
bacb13ae7c fix profile editing bugs 2016-09-26 19:31:29 -04:00
Yaman Qalieh
2a0aeaa849 fix bug of avatar pic not showing on non-admin 2016-09-26 19:05:06 -04:00
Yaman Qalieh
f6b6fd5389 fix user profiles not loading when logged out 2016-09-26 18:58:15 -04:00
Yaman Qalieh
2f078dc8bf remove semantic, add select2 2016-09-26 18:55:18 -04:00
Kenneth Jao
fcd7e184dd Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-09-26 11:59:18 -04:00
Yaman Qalieh
589ce7b23b groundwork 2016-09-25 12:04:09 -04:00
Yaman Qalieh
b41b485c02 fix version 2016-09-25 12:00:23 -04:00
Yaman Qalieh
daa985097b do not allow main page until school is filled 2016-09-25 11:59:36 -04:00
Yaman Qalieh
75a82e2202 Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-09-25 11:58:37 -04:00
Yaman Qalieh
c7d7391bdb background addition for visibility 2016-09-24 20:41:39 -04:00
Kenneth Jao
ea64ed9c51 Modified login CSS, added version number 2016-09-24 19:48:50 -04:00
Kenneth Jao
88e90f4f33 Fixed new profile not loading new values 2016-09-24 19:10:49 -04:00
Kenneth Jao
2835310f0d Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-09-24 19:04:16 -04:00
Kenneth Jao
38727ecd31 css fix 2016-09-24 19:04:11 -04:00
Yaman Qalieh
44c8c0cbd1 fix css of export button 2016-09-24 16:39:29 -04:00
Yaman Qalieh
354279182a add basic export button 2016-09-23 20:55:15 -04:00
Yaman Qalieh
a4c146a725 cleanup 2016-09-23 19:54:01 -04:00
Yaman Qalieh
d266c58b14 csv to download 2016-09-23 19:53:00 -04:00
Yaman Qalieh
5a9c7ec36d json to csv 2016-09-23 19:37:53 -04:00
Yaman Qalieh
e7078c622a add class name to JSON 2016-09-22 21:21:36 -04:00
Yaman Qalieh
1a31a25b36 site info => JSON 2016-09-22 21:17:34 -04:00
Yaman Qalieh
20c0ca7a9f add click event for eventual export 2016-09-22 00:36:08 -04:00
Yaman Qalieh
e1002b5a0d groundwork 2016-09-20 21:10:22 -04:00
Kenneth Jao
6f1c7203ff Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-09-20 09:47:18 -04:00
Kenneth Jao
e90f0de75e CSS fix 2016-09-20 09:47:14 -04:00
Yaman Qalieh
c5567fe206 web-beautify 2016-09-19 23:13:00 -04:00
Yaman Qalieh
e6f7ea7c39 remove Avatars/ and add 75 class icons 2016-09-18 23:02:36 -04:00
Yaman Qalieh
d8e4fe55ad fix #98 2016-09-18 22:13:33 -04:00
Yaman Qalieh
ae94ebd997 remove avatar field on server 2016-09-17 21:39:59 -04:00
Yaman Qalieh
66286d1b9a syntax error 2016-09-17 21:39:51 -04:00
Yaman Qalieh
185c67d950 change prof pic on profile 2016-09-17 21:35:51 -04:00
Yaman Qalieh
a6426ac146 change prof on main 2016-09-17 21:35:12 -04:00
Yaman Qalieh
8d2af9122d finish dragula 2016-09-16 18:08:56 -04:00
Yaman Qalieh
c4d2d730f1 reorder classes save 2016-09-16 17:25:15 -04:00
Yaman Qalieh
f6cf5fdaf7 Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-09-16 16:48:42 -04:00
Yaman Qalieh
26ddd5a538 move dragula 2016-09-16 16:48:39 -04:00
Kenneth Jao
46a3b7395a added hiding 'bad' (low ratio) work 2016-09-16 09:10:56 -04:00
Kenneth Jao
e627c449f1 Removed extra field 2016-09-16 08:45:20 -04:00
Kenneth Jao
60dfa22485 Sorts work by date 2016-09-16 08:43:07 -04:00
Kenneth Jao
415a621f6c Added coloring for reports/confirmations 2016-09-15 13:37:13 -04:00
Kenneth Jao
a2f796ad60 Added hover for type filters 2016-09-15 10:25:10 -04:00
Kenneth Jao
463a4bd3c4 added rotation when dragging 2016-09-15 10:08:59 -04:00
Kenneth Jao
b11850fb6c Fixed CSS when dragging 2016-09-15 09:40:45 -04:00
Kenneth Jao
8e0256c845 Final touches for filter classes 2016-09-15 09:19:54 -04:00
Kenneth Jao
6b74524b9c Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-09-15 08:30:29 -04:00
Kenneth Jao
e6da917ca0 add filters for work types 2016-09-15 08:30:24 -04:00
Yaman Qalieh
61fc9d6cbe add dragula client side, just need to read event now 2016-09-15 06:35:39 -04:00
Yaman Qalieh
010fac7e2b cleaning up 2016-09-14 06:37:32 -04:00
Yaman Qalieh
1d6321a553 add dragula 2016-09-13 20:42:28 -04:00
Kenneth Jao
d8d20229c6 Optimized and fixed currentWork for reactive updating, editWork CSS scale/zoom fixes 2016-09-13 01:37:47 -04:00
Kenneth Jao
a5d0d17947 CSS size and zoom fixes 2016-09-12 11:12:06 -04:00
Kenneth Jao
7842b995dc workcard formatting 2016-09-12 09:18:58 -04:00
Yaman Qalieh
8127553578 make superadmins superadmins 2016-09-12 06:38:57 -04:00
ksjdragon
d2531fd29a Merge pull request #96 from Arav-Agarwal/master
Fixed work-card formatting
2016-09-12 00:18:56 -04:00
Arav-Agarwal
9ca0b14183 Fixed work-card formatting 2016-09-12 00:17:31 -04:00
Kenneth Jao
a9d787ca83 Profile css modifications 2016-09-11 23:43:20 -04:00
Kenneth Jao
12e07cb08e Fixed card overflow 2016-09-11 23:33:38 -04:00
Kenneth Jao
2eab366a0a Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-09-11 23:23:12 -04:00
Kenneth Jao
b9a4cbc6bd Large CSS update for main 2016-09-11 23:22:50 -04:00
Yaman Qalieh
d942f0647f Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-09-11 18:59:14 -04:00
Yaman Qalieh
2513737e20 fix filter bug for personal 2016-09-11 18:58:57 -04:00
Kenneth Jao
925b1276b2 Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-09-11 18:54:16 -04:00
Kenneth Jao
d09e0d918e Changed max-height for classHolder 2016-09-11 18:54:08 -04:00
Yaman Qalieh
fae5b62a33 fix calendar bug for personal 2016-09-11 18:51:09 -04:00
Yaman Qalieh
3dd703f103 personal work added 2016-09-11 18:47:50 -04:00
Kenneth Jao
8d46da7f28 Fixed profile saving default values to profile 2016-09-11 18:10:00 -04:00
Kenneth Jao
fba2b847b1 Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-09-10 19:15:18 -04:00
Kenneth Jao
e5b27791a9 Scrolling CSS fix, and minor css fix 2016-09-10 19:08:32 -04:00
Yaman Qalieh
aa16f61cea Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-09-10 16:11:41 -04:00
Kenneth Jao
4d4fb0d69c css fix 2016-09-10 14:17:51 -04:00
Kenneth Jao
c82ceb9afa Added creator to work card 2016-09-10 14:13:00 -04:00
Kenneth Jao
cb17d7e2ea Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-09-10 14:06:31 -04:00
Kenneth Jao
b480fa6558 Added NotFound for undefined user, and moved redirection to router 2016-09-10 14:06:22 -04:00
Kenneth Jao
725a72f21a Added creator for work 2016-09-10 13:39:46 -04:00
Yaman Qalieh
006f9db206 reorderClasses 2016-09-10 12:12:15 -04:00
Kenneth Jao
2908c46452 More CSS fixes 2016-09-10 03:07:55 -04:00
Kenneth Jao
473fe2e22d removed console log 2016-09-10 02:30:56 -04:00
Kenneth Jao
9bb703b886 Optimized filter highlighting 2016-09-10 02:26:11 -04:00
Kenneth Jao
392a40bd20 Fixed calendar class filter highlighting 2016-09-10 01:55:41 -04:00
Kenneth Jao
e68fb2552f Request box css fixes 2016-09-10 00:44:06 -04:00
Kenneth Jao
a9ef959369 Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-09-10 00:39:41 -04:00
Kenneth Jao
6b693d4b8d CSS fixes for profile, and main 2016-09-10 00:39:28 -04:00
Yaman Qalieh
df29c7dda3 fix #85 2016-09-09 22:25:02 -04:00
Kenneth Jao
7d90cd6871 Fixed request css and js 2016-09-09 08:20:51 -04:00
Kenneth Jao
1fb3d8f4d1 CSS fixes 2016-09-09 02:27:37 -04:00
Kenneth Jao
93e1eff12f Fixed login button clicking, minor css 2016-09-09 02:17:32 -04:00
Kenneth Jao
8299918ea7 Header css fixes for main 2016-09-09 02:06:00 -04:00
Kenneth Jao
83e0ae74b4 Small bug fixes 2016-09-09 01:41:07 -04:00
Kenneth Jao
ef0d586eff CSS fixes for login 2016-09-09 00:45:58 -04:00
Kenneth Jao
aabd11f017 CSS fixes 2016-09-08 23:55:15 -04:00
Kenneth Jao
4143d2cf05 CSS fixes, and update packages 2016-09-08 21:32:10 -04:00
Kenneth Jao
c37244fce8 Fixed not adding to superadmin list 2016-09-08 21:01:52 -04:00
Yaman Qalieh
775a9aa502 admin page original 2016-09-08 17:18:15 -04:00
Yaman Qalieh
a329b4b08e tabbing 2016-09-08 17:11:35 -04:00
Kenneth Jao
ed8038261f Added request sending 2016-09-08 16:51:22 -04:00
Yaman Qalieh
7dde278cbd remove console logging 2016-09-07 21:33:59 -04:00
Yaman Qalieh
f68bc3ad54 minor fixes 2016-09-07 21:26:26 -04:00
Kenneth Jao
afb3486268 CSS fixes 2016-09-07 20:04:51 -04:00
Kenneth Jao
2a08efacba Fixed header CSS on main 2016-09-07 18:13:13 -04:00
Kenneth Jao
00950f36e6 Fixed editProfile deleting name 2016-09-07 18:11:36 -04:00
Kenneth Jao
bf91825c0a Added user dropdown 2016-09-07 15:33:13 -04:00
Kenneth Jao
230245813c Put click in html 2016-09-07 11:52:28 -04:00
Kenneth Jao
607bae992d login CSS for all resolutions, optimized 2016-09-07 11:51:30 -04:00
Kenneth Jao
2b5744dbd4 Optimized owned classes, and fixed bugs relating to it 2016-09-07 02:05:31 -04:00
Kenneth Jao
9de73d9338 Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-09-07 01:53:27 -04:00
Kenneth Jao
5bcb54dba7 Aligned classes CSS 2016-09-07 01:53:15 -04:00
Kenneth Jao
dac17c2d84 Chrome browser CSS compatiblity 2016-09-07 01:52:54 -04:00
Kenneth Jao
94c86e6a2a Fixed get code in server and client 2016-09-07 01:12:30 -04:00
Kenneth Jao
96f7962acf admin classes css fix 2016-09-07 00:36:33 -04:00
Kenneth Jao
1211259fb4 Fix overlay css and form clearing in profile 2016-09-07 00:08:47 -04:00
Yaman Qalieh
a4b380695f Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-09-06 20:56:40 -04:00
Yaman Qalieh
a5caad8e46 shorten editProfile 2016-09-06 20:56:31 -04:00
Kenneth Jao
1b54686ec3 CSS for private class box 2016-09-06 20:02:56 -04:00
Kenneth Jao
5484edfd8b Fixed join class CSS in profile 2016-09-06 19:52:37 -04:00
Kenneth Jao
160d50af1f CSS fixes for profile 2016-09-06 19:28:36 -04:00
Kenneth Jao
7735b6cfdb Added default avatar and banner to createProfile, and small bug 2016-09-06 18:57:55 -04:00
Kenneth Jao
4d684a7271 CSS fixes for class display 2016-09-06 17:46:32 -04:00
Kenneth Jao
67c203ab7e Added css and some js for admin value editing 2016-09-06 17:29:23 -04:00
Kenneth Jao
22f51f7537 CSS fixes 2016-09-06 08:50:39 -04:00
Kenneth Jao
e4ad100a49 More admin page functionality 2016-09-06 01:36:03 -04:00
Kenneth Jao
f5ee6f7aff Added classesfor admin 2016-09-06 00:27:43 -04:00
Kenneth Jao
1d66a88ef1 Fixed admin page not waiting 2016-09-06 00:27:30 -04:00
Kenneth Jao
09e6afd10b CSS fix 2016-09-05 19:19:01 -04:00
Kenneth Jao
689a4cbb6d CSS layering fix 2016-09-05 19:15:20 -04:00
Kenneth Jao
bee59d458c Added links to user profile for banned/moderators 2016-09-05 17:19:04 -04:00
Kenneth Jao
6a7f69f65c Added user icons and links to profile 2016-09-05 16:41:22 -04:00
Kenneth Jao
ea8e083d7c Minor restrict bug 2016-09-05 15:49:42 -04:00
Kenneth Jao
baace551fe Redid CSS for editWork div 2016-09-05 15:45:21 -04:00
Kenneth Jao
cd73f4533e Css fixes 2016-09-05 15:08:59 -04:00
Kenneth Jao
bfc5f64848 Fixed favicon directory 2016-09-05 15:06:00 -04:00
Yaman Qalieh
8de7baec99 Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-09-05 14:56:47 -04:00
Kenneth Jao
d6a8c94941 Fixed rinput restriction 2016-09-05 14:51:40 -04:00
Yaman Qalieh
604db80371 Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-09-05 13:44:30 -04:00
Yaman Qalieh
374a570a35 profile pages now work 2016-09-05 13:44:18 -04:00
Kenneth Jao
ab4cbb371a Added prep code for admin 2016-09-05 02:35:31 -04:00
Kenneth Jao
c2d06c9036 Fix merge conflict 2016-09-05 00:16:26 -04:00
Kenneth Jao
b47a6e7f65 CSS optimization, changed client profile handling 2016-09-05 00:08:59 -04:00
Yaman Qalieh
3a9fd1ed0d filter on router 2016-09-04 20:20:40 -04:00
Yaman Qalieh
a213cfde23 filter on server/main 2016-09-04 20:16:13 -04:00
Yaman Qalieh
8eaaff37f4 web-beautify filter 2016-09-04 20:13:31 -04:00
Yaman Qalieh
b98f229c0b fix emacs warnings 2016-09-04 20:10:58 -04:00
Yaman Qalieh
8fd8a9412a fix buggy characters left 2016-09-04 19:13:44 -04:00
Kenneth Jao
8cbe8e253a Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-09-04 19:00:43 -04:00
Kenneth Jao
d3c5c6c46e CSS fix 2016-09-04 19:00:30 -04:00
Yaman Qalieh
2932def0d4 do not allow other users to view classes 2016-09-04 15:48:28 -04:00
Yaman Qalieh
abdd95477c publish userfields needed for profile pages 2016-09-04 15:47:45 -04:00
Kenneth Jao
dc1e0c8df8 CSS addition 2016-09-04 01:13:33 -04:00
Kenneth Jao
9ec4fc6bfb Added admin page layout, small null checking changes 2016-09-04 01:09:05 -04:00
Yaman Qalieh
69b441ec25 bug fix 2016-09-03 21:54:39 -04:00
Yaman Qalieh
ae1c9ea1d1 Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-09-03 21:36:46 -04:00
Yaman Qalieh
007ea30d42 publish personal work 2016-09-03 21:36:33 -04:00
Yaman Qalieh
b94003fcaf personal edit and delete work 2016-09-03 21:34:06 -04:00
Yaman Qalieh
09dd53fb6f edit createWork to allow personal work to be created 2016-09-03 21:12:17 -04:00
Kenneth Jao
cbb8f22f50 Minor bugs, fixed #75 2016-09-03 02:02:09 -04:00
Kenneth Jao
9df47a896a Syntax error 2016-09-02 12:23:05 -04:00
Yaman Qalieh
64fa523e3d small optimization 2016-09-02 11:24:54 -04:00
Kenneth Jao
f95b53db08 Renaming and small optmization 2016-09-02 01:00:52 -04:00
Kenneth Jao
bded6702cf disable all filters, and renaming 2016-09-02 00:53:12 -04:00
Kenneth Jao
7eebae2b9f Fixed comments 2016-09-02 00:34:40 -04:00
Kenneth Jao
fabe20ddfe Fixed calendar bugs 2016-09-02 00:15:29 -04:00
Yaman Qalieh
bd4f6017c8 relaxes security on editProfile in order to fix #80 2016-09-01 07:15:17 -04:00
ksjdragon
acb0b23d38 Merge pull request #79 from Arav-Agarwal/master 2016-09-01 00:51:26 -04:00
Kenneth Jao
f79e840ae2 Display fixes 2016-09-01 00:38:06 -04:00
Arav-Agarwal
7a3c536a27 Merge pull request #1 from ksjdragon/master
Testing this new branch setup
2016-09-01 00:32:36 -04:00
Kenneth Jao
ed6a594705 CSS Reversion 2016-09-01 00:30:49 -04:00
Kenneth Jao
7abb353961 Removed school checking, as client is changed to display nothing if undefined 2016-09-01 00:30:05 -04:00
Kenneth Jao
3282d861ff Display fixes 2016-09-01 00:28:10 -04:00
Kenneth Jao
a0d277001e Fixed issue #77 2016-09-01 00:23:22 -04:00
Yaman Qalieh
9ee9d36835 Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-09-01 00:13:28 -04:00
Yaman Qalieh
e23398999a fix #76 2016-09-01 00:13:17 -04:00
ksjdragon
cc9f755334 Merge pull request #78 from Arav-Agarwal/master
Added login button to profile page
2016-09-01 00:09:16 -04:00
Arav-Agarwal
726be1e084 css reversion 2016-09-01 00:07:56 -04:00
Arav-Agarwal
094093e078 Added login button to profile page 2016-09-01 00:05:45 -04:00
Yaman Qalieh
80126c4631 check for profile existence 2016-08-31 23:49:54 -04:00
Yaman Qalieh
6f499ad2f9 Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-08-31 23:39:35 -04:00
Kenneth Jao
5f97910f0f Null checking 2016-08-31 23:38:47 -04:00
Yaman Qalieh
da9c2913fc explicit if statements 2016-08-31 23:38:45 -04:00
Yaman Qalieh
566a477787 syntax error 2016-08-31 23:33:36 -04:00
Yaman Qalieh
e47cfaf7e1 router bug 2016-08-31 23:32:35 -04:00
Yaman Qalieh
2e80cdf2fb Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-08-31 23:22:08 -04:00
Yaman Qalieh
7fc3a0b35c meteor errors to fix #72 2016-08-31 23:21:53 -04:00
Kenneth Jao
a031ee92f4 syntax error 2016-08-31 23:09:21 -04:00
Kenneth Jao
2b96ce9d4f Removed defaults client side 2016-08-31 23:08:12 -04:00
Yaman Qalieh
876272ada9 fix #73: placeholder values for createProfile 2016-08-31 23:05:26 -04:00
Kenneth Jao
c08ddac128 Added deleting work for admins/moderators, fixed #74 2016-08-31 22:54:44 -04:00
Yaman Qalieh
5f23c44857 Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-08-31 20:33:34 -04:00
Yaman Qalieh
761fd43944 add request type and request info 2016-08-31 20:33:25 -04:00
yamanq
3abcb85e84 Update README.md 2016-08-31 18:42:21 -04:00
yamanq
b4ac665bd8 Update README.md 2016-08-31 18:35:20 -04:00
Yaman Qalieh
8542caec04 fix indenting etc 2016-08-31 07:05:23 -04:00
Kenneth Jao
1e830e8439 CSS reversion 2016-08-31 01:57:55 -04:00
Arav-Agarwal
cfef70b87f Merge pull request #69 from ksjdragon/AravTest
Aravtest
2016-08-31 01:55:33 -04:00
Arav-Agarwal
3f4f07c28d teihe
hiehieh
2016-08-31 01:53:18 -04:00
Arav-Agarwal
188d8033ac My changes
Added commit and report number to work cards
2016-08-31 01:28:37 -04:00
Kenneth Jao
21435b5866 Added client side for generating preferences for new user 2016-08-30 23:29:27 -04:00
Yaman Qalieh
30c024a884 Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-08-30 22:51:09 -04:00
Yaman Qalieh
b421e6a256 optimize until (including) trackUserInClass 2016-08-30 22:50:54 -04:00
Kenneth Jao
535ee70bbd comments for profile, and small changes 2016-08-30 22:49:02 -04:00
Kenneth Jao
cd72662cb6 var renaming and commenting, main.js 2016-08-30 18:49:33 -04:00
Yaman Qalieh
2dc29d0f16 fix errors caused by not fixing merge 2016-08-30 06:42:04 -04:00
Kenneth Jao
044e63a889 Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-08-29 23:32:25 -04:00
Kenneth Jao
8a0a18b454 Calendar adding issue, css hover still doesn't work; sidebar closes on mode change, fixed #64 2016-08-29 23:32:14 -04:00
Arav-Agarwal
ecb8ebae64 Merge remote-tracking branch 'origin/master'
# Conflicts:
#	client/main/main.js
2016-08-29 23:18:22 -04:00
Yaman Qalieh
156fa11930 add scope to server variables 2016-08-29 21:13:35 -04:00
Yaman Qalieh
cb8c9025f4 serverData make global variable 2016-08-29 21:02:02 -04:00
Yaman Qalieh
9356b4b04c add constants.js 2016-08-29 20:40:33 -04:00
Yaman Qalieh
ef2afa13e8 make themeColors global 2016-08-29 20:39:36 -04:00
Arav-Agarwal
3d09d2a8e1 Comments
Added some comments to the main js file. Just started, so i should be
done soon
2016-08-29 00:24:01 -04:00
Kenneth Jao
81ebc744d8 Fixed minor bugs 2016-08-28 23:25:43 -04:00
Kenneth Jao
79dd0c2c0e fixed comment box height 2016-08-28 21:34:24 -04:00
Yaman Qalieh
02ea688420 fixed bad preference storage 2016-08-28 20:09:16 -04:00
Yaman Qalieh
d387699f67 fix time display for comments 2016-08-28 19:28:36 -04:00
Yaman Qalieh
1a9435a3de cannot confirm and approve work at same time 2016-08-28 19:22:51 -04:00
Kenneth Jao
202df284a3 Display who's done, fixed #46 2016-08-28 18:55:10 -04:00
Kenneth Jao
5f186e55fc Added toggling work 2016-08-28 18:41:35 -04:00
Kenneth Jao
f6449ffe0c Fixed small display bug, removed unnecessary code 2016-08-28 14:45:35 -04:00
Kenneth Jao
073db86deb Added preferences to profile 2016-08-28 14:36:26 -04:00
Kenneth Jao
a15e588c92 Fixed couldn't add work, and minor profile bug 2016-08-28 13:12:41 -04:00
Kenneth Jao
38eba83101 Adding and displaying comments 2016-08-27 21:38:42 -04:00
Kenneth Jao
6b2e56f067 comments are displayed, comment server bug 2016-08-27 19:29:51 -04:00
Kenneth Jao
5281bf4117 Made theme colors session variable, and changed card color 2016-08-27 19:01:14 -04:00
Kenneth Jao
0c84d9acb6 Made code getting from server function 2016-08-27 18:57:16 -04:00
Kenneth Jao
47119d4161 Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-08-27 18:53:57 -04:00
Kenneth Jao
416eafcd4c Lots of tiny bug fixes, such as display, naming, and functionality 2016-08-27 18:53:47 -04:00
Yaman Qalieh
af98278e64 use js filter on new server files 2016-08-27 09:47:59 -04:00
Yaman Qalieh
aed412af10 fix #58 with function getCode(classId) 2016-08-27 09:34:23 -04:00
Kenneth Jao
96e413f005 Work should be removed when 'done', fixed #47 2016-08-27 01:11:37 -04:00
Kenneth Jao
dddfe53c59 Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-08-27 01:08:45 -04:00
Kenneth Jao
6e815de23f Fixed default mode changing current mode 2016-08-27 01:08:33 -04:00
Kenneth Jao
db2c32956a Added actual button, and bug fixes 2016-08-27 00:54:12 -04:00
Kenneth Jao
c52e477eee Added time until hide homework 2016-08-26 23:50:46 -04:00
Yaman Qalieh
87494ca71f fix indenting server 2016-08-26 21:32:17 -04:00
Kenneth Jao
043d9b93a1 Added click to display classes from sidebar, fixed #53 2016-08-26 01:02:28 -04:00
Kenneth Jao
0f7017ce5b Display and small bug fix 2016-08-25 23:34:14 -04:00
Kenneth Jao
e8799aeb27 Added sidebar clases on-hover 'highlight' work 2016-08-25 23:31:34 -04:00
Kenneth Jao
2c1d8cddd8 Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-08-25 23:09:51 -04:00
Kenneth Jao
cf09cf33bd router syntax error 2016-08-25 23:09:12 -04:00
Arav-Agarwal
aced6645a1 Profile 2016-08-25 23:07:26 -04:00
Arav-Agarwal
f0fa84c47a Comments 2016-08-25 23:07:26 -04:00
yamanq
9c63a46409 update router for admin page 2016-08-25 22:02:23 -04:00
yamanq
e2a38adee2 update school directory 2016-08-25 21:57:22 -04:00
yamanq
3bae4df7c0 create profile 2016-08-24 21:15:16 -04:00
Yaman Qalieh
2b2a61dfe9 should fix #54 2016-08-24 21:09:34 -04:00
Kenneth Jao
1533f24cda Fixed leave class, #51 2016-08-23 22:09:07 -04:00
yamanq
7b1219716e commenting on server 2016-08-23 21:35:10 -04:00
Kenneth Jao
53b69348d1 Implement default mode, css fixes 2016-08-23 00:11:57 -04:00
Kenneth Jao
f09532438e Added preferences, and dark theme 2016-08-22 23:44:48 -04:00
Yaman Qalieh
db85d38145 createcomments 2016-08-22 16:52:04 -04:00
Kenneth Jao
e68ffb9dba add leave class button 2016-08-21 22:50:23 -04:00
yamanq
a797de4c0e Update main.js 2016-08-21 22:48:15 -04:00
Yaman Qalieh
d26ebd2d27 Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-08-21 10:02:20 -04:00
Yaman Qalieh
7aed50f2a3 added error system 2016-08-21 10:02:07 -04:00
Kenneth Jao
e5012e3c04 Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-08-20 23:37:17 -04:00
Kenneth Jao
7680fc1bac Fixed clicking and css issues 2016-08-20 23:37:04 -04:00
Yaman Qalieh
550f96aa86 Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-08-20 22:38:13 -04:00
Yaman Qalieh
860bed577d added requests collection for admin requests 2016-08-20 22:38:01 -04:00
Kenneth Jao
3fd993db98 removed subscribing in profile.js 2016-08-20 22:26:55 -04:00
Kenneth Jao
0de9853dc4 Fixed datepicker appearing 4 months later, fixed #45 2016-08-20 21:29:11 -04:00
Yaman Qalieh
1f1a9fa0a3 fix 2 small bugs 2016-08-20 20:56:05 -04:00
Kenneth Jao
1bdd65c4bf Added adding work from calendar, fixed #38 2016-08-20 15:58:31 -04:00
Kenneth Jao
12e9017959 Fixed last commit 2016-08-19 22:04:32 -04:00
Kenneth Jao
45576e7619 Prevented moving dates for unauthorized users 2016-08-19 21:59:41 -04:00
Kenneth Jao
93bd64c4b4 Update calendar on change 2016-08-18 23:59:38 -04:00
Kenneth Jao
bca216cf65 Fixed calendar display, and added date moving on calendar 2016-08-18 20:27:18 -04:00
Kenneth Jao
a0357f23bb Fixed small bugs 2016-08-18 19:32:39 -04:00
Yaman Qalieh
24e44e1607 check if code exists 2016-08-18 19:08:58 -04:00
Yaman Qalieh
5c3025363f Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-08-18 19:05:50 -04:00
Yaman Qalieh
de01667272 gencode fix 2016-08-18 19:05:39 -04:00
Kenneth Jao
444ecc5029 Fix merge 2016-08-18 18:53:03 -04:00
Kenneth Jao
80459a006b Merge branch with master 2016-08-18 18:48:32 -04:00
Kenneth Jao
6cac521b59 Fixed adding work bug 2016-08-18 18:47:03 -04:00
Yaman Qalieh
9162a34537 update all packages 2016-08-18 18:20:33 -04:00
Yaman Qalieh
1ae7fff308 update packages and fix #22 2016-08-18 18:11:45 -04:00
Yaman Qalieh
3716d8012a fix indenting 2016-08-18 17:35:40 -04:00
Yaman Qalieh
f8b57bcfb9 more datepicker options 2016-08-18 17:33:13 -04:00
Yaman Qalieh
bd08f4e18a fix reference date issue 2016-08-18 17:13:59 -04:00
Yaman Qalieh
9f610ee046 fix #43 2016-08-18 16:44:23 -04:00
Yaman Qalieh
8fe801020c server formatting 2016-08-18 06:54:22 -04:00
Kenneth Jao
15f1ba4085 Added small description text for creating a class, fixed #37 2016-08-18 00:50:44 -04:00
Kenneth Jao
38b4c33563 Added joining private classes, fixed issue #30 2016-08-18 00:44:13 -04:00
Kenneth Jao
6fc1ec14c9 Fixed the helper errors that appeared, fixed #3 2016-08-17 23:39:51 -04:00
Kenneth Jao
09e29aea96 Fixed change owner, and other display issues 2016-08-17 22:33:01 -04:00
Kenneth Jao
379f903507 Server bug fixes 2016-08-17 22:32:33 -04:00
Yaman Qalieh
b9d22b9958 leaveclass bug 2016-08-17 19:24:46 -04:00
Yaman Qalieh
b460a2fec4 changeAdmin fixes 2016-08-17 19:18:02 -04:00
Yaman Qalieh
6231a743ea upped security on joinPrivateClass 2016-08-17 18:52:38 -04:00
Yaman Qalieh
a5fc08ea04 Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-08-17 18:46:03 -04:00
Yaman Qalieh
f42050fe44 joinPrivateClass 2016-08-17 18:45:50 -04:00
Kenneth Jao
0683c73f4c Added created classes tab, and all functionality 2016-08-16 20:46:38 -04:00
Kenneth Jao
1ab2d57b79 fixed untrackUserInClass 2016-08-16 18:22:02 -04:00
Yaman Qalieh
bd52504d25 push to concat 2016-08-16 18:14:07 -04:00
Yaman Qalieh
460ce03c0f object setting bug 2016-08-16 17:53:27 -04:00
Yaman Qalieh
8ce0b46b65 trackuser bug 2016-08-16 17:19:21 -04:00
Yaman Qalieh
fbd0c0a515 fixed #35 2016-08-16 06:43:46 -04:00
Yaman Qalieh
93f8b3489e routing for admin page 2016-08-16 06:15:15 -04:00
Yaman Qalieh
0d7ea51f0e Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-08-15 22:32:08 -04:00
Yaman Qalieh
016c8d3d18 fix #33 and remove banned 2016-08-15 22:32:00 -04:00
Kenneth Jao
b83ae6e6ff remove banned client-side 2016-08-15 22:28:49 -04:00
Kenneth Jao
55ed7ace1e Created classes tab, semi-styled and no functionality 2016-08-15 22:15:07 -04:00
Yaman Qalieh
e871f6b7fc Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-08-15 20:55:29 -04:00
Yaman Qalieh
a31b4f3673 publish and subscribe userinfo 2016-08-15 20:55:21 -04:00
Kenneth Jao
583fbaa05a Made work uneditable for non-authorized users 2016-08-15 16:03:29 -04:00
yamanq
36bdcf145f Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-08-15 14:00:55 -04:00
yamanq
cfb25d8031 Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-08-15 13:59:55 -04:00
Kenneth Jao
ebf4d41ae7 Made createClass teacher optional 2016-08-15 13:59:45 -04:00
yamanq
a35182ae82 additional date checking 2016-08-15 13:58:46 -04:00
yamanq
70d20ea40b fixed leaveClass issue 2016-08-15 13:48:54 -04:00
Kenneth Jao
a122d3b6aa Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-08-15 13:48:13 -04:00
yamanq
0200c0dc78 changed subscribers to list and fixed #13 2016-08-15 13:48:00 -04:00
Kenneth Jao
ce56af885f Reverted myClasses code 2016-08-15 13:47:05 -04:00
Yaman Qalieh
58522390df fixed 0 subscribers bug 2016-08-15 10:42:35 -04:00
Kenneth Jao
6f29a1a02a Made hour optional, fixed avatar display bug 2016-08-14 21:48:42 -04:00
yamanq
4326346af5 fixed login button 2016-08-14 15:42:39 -04:00
yamanq
9c87050333 fix joinclass issue 2016-08-14 15:02:18 -04:00
Yaman Qalieh
153cf62888 temporarily comment out bug 2016-08-14 08:22:39 -04:00
Yaman Qalieh
015a329778 add datepicker options 2016-08-14 08:11:49 -04:00
Yaman Qalieh
dcfce8654f Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-08-14 07:52:41 -04:00
Yaman Qalieh
655d5821e9 remove class if non-existant 2016-08-14 07:52:27 -04:00
Kenneth Jao
353d9357d7 CSS display fix 2016-08-13 23:49:53 -04:00
Kenneth Jao
d79e157fe5 Added date picker, and changed work colors 2016-08-13 23:46:32 -04:00
Yaman Qalieh
ddab8b86c2 Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-08-13 22:47:29 -04:00
Yaman Qalieh
c9fd63065f package additions 2016-08-13 22:47:07 -04:00
Kenneth Jao
68c6e0c32b Fixed profile images not displaying on new user 2016-08-13 20:52:47 -04:00
Kenneth Jao
b1381234e2 Fixed bad function calling 2016-08-13 20:24:56 -04:00
Kenneth Jao
57aeb4d34b Bug fixes 2016-08-13 20:22:54 -04:00
Kenneth Jao
00ded2965d Fixed editWork, and displays work information on click 2016-08-13 19:24:10 -04:00
Kenneth Jao
6833e3a1cd Adding work, display each work in correct class 2016-08-13 18:58:54 -04:00
Yaman Qalieh
9957cba048 description optional 2016-08-13 17:36:35 -04:00
Yaman Qalieh
83214bec01 Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-08-13 17:33:40 -04:00
Yaman Qalieh
41a3c1bc16 description security and bug fixes 2016-08-13 17:33:12 -04:00
Kenneth Jao
5c99efc6e2 Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-08-13 17:26:15 -04:00
Kenneth Jao
8d066a9d64 Server functions and schema fixes 2016-08-13 17:26:07 -04:00
Yaman Qalieh
33c2b5e1c4 add date to comments 2016-08-13 16:18:04 -04:00
Kenneth Jao
72913d728a Added user in each comment 2016-08-13 16:12:25 -04:00
Kenneth Jao
37e0da4322 Added user for each comment 2016-08-13 16:10:01 -04:00
Yaman Qalieh
d5d2f842a3 web-beautify-js 2016-08-13 13:32:40 -04:00
Yaman Qalieh
6c2e98e6d0 add permissions and fix profile/publishing bugs 2016-08-13 09:02:04 -04:00
Kenneth Jao
0afd5c2ba1 Add homework framework 2016-08-12 23:10:27 -04:00
Kenneth Jao
f068fd23a6 Syntax error, and removed old test function 2016-08-12 22:43:56 -04:00
yamanq
eced94799b change markwork to togglework 2016-08-12 22:35:28 -04:00
yamanq
929f31ef97 bug fixes 2016-08-12 22:05:06 -04:00
yamanq
70eab47c44 change markDone to markWork 2016-08-12 22:00:16 -04:00
yamanq
5dc07fb7c3 work functions 2016-08-12 21:52:14 -04:00
yamanq
f2fa1fdc20 deleteWork secure and schema update 2016-08-12 21:00:32 -04:00
Yaman Qalieh
0e571e8942 Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-08-12 20:42:51 -04:00
Yaman Qalieh
cdd2cd99ab publish and subscribe 2016-08-12 20:42:29 -04:00
Yaman Qalieh
2c4b480e9d add publish to server 2016-08-12 20:11:26 -04:00
Kenneth Jao
000e992321 Display classes mode 2016-08-12 19:46:40 -04:00
Yaman Qalieh
3f984fca63 Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-08-12 19:11:07 -04:00
Yaman Qalieh
d3080dbb9a implemented alanning:roles 2016-08-12 19:10:54 -04:00
Kenneth Jao
bc81e5eb3e Moved images, made myClasses a global helper 2016-08-12 18:32:37 -04:00
yamanq
63652db9ac Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-08-12 18:27:41 -04:00
yamanq
6c48c7cd46 directory change 2016-08-12 18:27:30 -04:00
yamanq
568f6e245f profile fixes 2016-08-12 18:27:03 -04:00
Kenneth Jao
efca57c555 Added user classes display in sidebar 2016-08-12 18:18:08 -04:00
Kenneth Jao
090f9e1244 Display fix 2016-08-12 17:58:03 -04:00
Kenneth Jao
f6476182e0 Css display fix for profile 2016-08-12 17:51:16 -04:00
yamanq
e0601fc6f5 fix bug 2016-08-12 17:48:49 -04:00
yamanq
60b1da6284 Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-08-12 17:39:55 -04:00
yamanq
c227386c3d made it easier to change classes viewable on calendar 2016-08-12 17:39:36 -04:00
Kenneth Jao
4a8d06311a moved autocomplete templates 2016-08-12 17:38:22 -04:00
Kenneth Jao
06ee977072 Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-08-12 17:35:38 -04:00
Kenneth Jao
92dc520924 Form clears only when check is clicked, fixed display issues 2016-08-12 17:35:29 -04:00
yamanq
cd8d53c887 only display user's classes 2016-08-12 17:33:29 -04:00
Yaman Qalieh
08b1b1ef6d change routing 2016-08-12 17:18:30 -04:00
Yaman Qalieh
8a34c1ab09 Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-08-12 17:14:32 -04:00
Kenneth Jao
32324957ca Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-08-12 17:07:24 -04:00
Kenneth Jao
bfaade2a3e Made user classes display 2016-08-12 17:07:12 -04:00
Yaman Qalieh
8731695160 removed unnecesary code 2016-08-12 16:34:46 -04:00
yamanq
0984ce7347 display only public classes on search 2016-08-12 16:12:03 -04:00
Kenneth Jao
3b3f0d9e8c Fixed create class form sending 2016-08-12 15:55:35 -04:00
Yaman Qalieh
a02d939875 Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-08-12 15:50:21 -04:00
Yaman Qalieh
92c3229538 joinClass fix 2016-08-12 15:50:07 -04:00
Kenneth Jao
b31451682a Reformatted css, and added 'Main Menu' button from /profile 2016-08-12 12:50:37 -04:00
Yaman Qalieh
09104bbbeb formatting 2016-08-12 12:28:55 -04:00
Yaman Qalieh
513e19046c formatted code 2016-08-12 12:13:26 -04:00
Yaman Qalieh
4f67ff8194 optimization fixes on server 2016-08-12 12:10:21 -04:00
yamanq
7032b30aa1 merge conflict 2016-08-12 00:57:04 -04:00
yamanq
c4492d6ff2 change name of field in editProfile 2016-08-11 23:57:33 -04:00
Kenneth Jao
a15b70adc5 Display fixesfor cross-browsers compatibility 2016-08-11 22:14:13 -04:00
yamanq
69d063452a update editProfile 2016-08-11 21:53:08 -04:00
Kenneth Jao
f8f36f2616 Profile page functions correctly, display mostly complete, minor fixes 2016-08-11 18:28:29 -04:00
Kenneth Jao
e3444a8fc6 Code cleanup, and display formatting/css 2016-08-11 03:10:32 -04:00
Kenneth Jao
670e212543 Added save settings button 2016-08-11 01:53:24 -04:00
Kenneth Jao
73c53370a4 Added character restrictions, Usage: add attribute "restrict=[\'max\']" in the DOM 2016-08-10 22:48:38 -04:00
Kenneth Jao
bc3aa5ce81 Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-08-10 21:57:04 -04:00
Kenneth Jao
308c346124 Added joining classes, and viewing classes 2016-08-10 21:56:12 -04:00
yamanq
15143172ad add name to work 2016-08-10 18:26:23 -04:00
Kenneth Jao
e9fc5b28b0 Fixed calendar not displaying events 2016-08-10 18:13:08 -04:00
yamanq
946f8e3257 bug 2016-08-10 18:02:38 -04:00
yamanq
1ca406c9d7 calendar fixes 2016-08-10 17:51:42 -04:00
yamanq
5c8cca4009 deleteWork no security 2016-08-10 17:43:31 -04:00
yamanq
22704145c6 createWork() and calendar work 2016-08-10 17:42:07 -04:00
Kenneth Jao
1d948d0c39 Added calendar display 2016-08-10 16:31:54 -04:00
yamanq
9062fa0aed typo 2016-08-10 15:58:25 -04:00
yamanq
c281f00905 classes join 2016-08-10 15:57:10 -04:00
Kenneth Jao
6f6fc5bddf Fixed profile display bugs 2016-08-10 15:28:21 -04:00
yamanq
5b575922b3 classes on profile page 2016-08-10 15:19:53 -04:00
Kenneth Jao
f1d7e180f0 Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-08-10 14:43:09 -04:00
Kenneth Jao
1d1fe5319f Added editing class tabs 2016-08-10 14:42:31 -04:00
yamanq
157bcf33e9 add fullcalendar 2016-08-10 14:34:56 -04:00
yamanq
efe80f8b45 createClass optimization 2016-08-10 14:14:55 -04:00
yamanq
2fffc374b6 deleteSchool, deleteClass 2016-08-10 14:05:45 -04:00
yamanq
e2f4afbd1b add fullcalendar:fullcalendar 2016-08-10 13:54:34 -04:00
yamanq
c3cc549785 added full calendar 2016-08-10 13:49:27 -04:00
yamanq
dfdaadf68e createClass bug 2016-08-10 13:48:46 -04:00
yamanq
5e2db196d7 add alanning:roles 2016-08-10 08:05:38 -04:00
yamanq
17581e3f31 add creator to school schema, make server functions more efficient 2016-08-10 08:00:09 -04:00
yamanq
9610867f1c createSchool() function 2016-08-10 07:54:25 -04:00
yamanq
e43ceb74f5 mold editProfile() to fit new profile page 2016-08-10 05:20:57 -04:00
yamanq
7d3e2b60fc leavclass error throw 2016-08-10 05:06:57 -04:00
yamanq
7d2ad898ae Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-08-10 05:05:31 -04:00
Kenneth Jao
7f9c845d92 Added default avatar icons 2016-08-10 01:50:49 -04:00
Kenneth Jao
12b933d8f1 Profile page layout, and working form buttons, no submission 2016-08-10 00:25:19 -04:00
Kenneth Jao
318dc60e3f CSS fix 2016-08-09 18:54:36 -04:00
yamanq
b832b7d8a2 Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-08-09 18:29:06 -04:00
yamanq
470b0cf41e fix leaveClass function 2016-08-09 18:23:02 -04:00
Kenneth Jao
b4bea3499c Aligned school display 2016-08-09 18:17:46 -04:00
yamanq
ccde0fcc11 add school name after Hourglass on main page 2016-08-09 18:13:41 -04:00
yamanq
f67af27300 leaveClass function 2016-08-09 18:03:31 -04:00
yamanq
62287f3f22 fixed duplicate class name bug 2016-08-09 17:54:11 -04:00
yamanq
3c5b6f51a5 Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-08-09 17:46:37 -04:00
yamanq
176aecaa8a added teacher autocomplete 2016-08-09 17:46:22 -04:00
Kenneth Jao
a8ceff4e2d Fixed css 2016-08-09 17:21:14 -04:00
yamanq
26fc6d05ce Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-08-09 17:10:37 -04:00
yamanq
45862fce0e fixed createClass function 2016-08-09 17:10:08 -04:00
Kenneth Jao
bed620cef2 More page display fixes 2016-08-09 17:07:11 -04:00
yamanq
15bdca5b20 typo 2016-08-09 16:57:45 -04:00
yamanq
51ab3c27ed finished createClass function 2016-08-09 16:56:30 -04:00
yamanq
09346b1c6c added to schema 2016-08-09 16:56:09 -04:00
Kenneth Jao
76e0701f71 Minor display fixes, and removed useless code 2016-08-09 14:49:43 -04:00
Kenneth Jao
3e7d6fec7c Folder organization 2016-08-09 01:33:14 -04:00
Kenneth Jao
c2b71d6674 Added 404 page 2016-08-09 00:51:12 -04:00
yamanq
701c964083 createClass backbone 2016-08-08 21:05:25 -04:00
yamanq
cf7a586cf2 fix tabbing 2016-08-08 20:55:02 -04:00
yamanq
e51d35eba9 change schema 2016-08-08 20:49:24 -04:00
yamanq
4c416cdd18 added joinClass function 2016-08-08 20:46:49 -04:00
yamanq
d797edfd03 editProfile function 2016-08-08 20:39:15 -04:00
yamanq
9fe1043c44 optimization and blank functions 2016-08-08 20:09:36 -04:00
Kenneth Jao
961449abce Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-08-08 19:56:00 -04:00
Kenneth Jao
34ecc443eb New logo and respective backgrounds 2016-08-08 19:55:46 -04:00
yamanq
58c808b9ff added description to readme 2016-08-08 19:05:21 -04:00
yamanq
23675285d2 fixed collections bug 2016-08-08 07:08:40 -04:00
yamanq
43a4f52334 add autocomplete package 2016-08-08 06:33:15 -04:00
yamanq
68e9c5361e changed schema 2016-08-08 06:18:01 -04:00
yamanq
f402293f71 removed allow() function 2016-08-08 06:14:37 -04:00
yamanq
54fe1d5695 add ongoworks:security for later use 2016-08-08 05:49:27 -04:00
yamanq
7fed7b56a6 fixed code generator 2016-08-08 05:39:20 -04:00
Kenneth Jao
d6dac78912 Added code generation function 2016-08-08 00:48:30 -04:00
Kenneth Jao
5f705eeae3 Designed login page 2016-08-07 19:01:27 -04:00
Kenneth Jao
f03e93a818 Fixed syntax errors 2016-08-07 15:34:41 -04:00
yamanq
0daf6ce48a added some packages 2016-08-07 15:27:22 -04:00
yamanq
d6e64f00a5 server addition 2016-08-07 15:21:39 -04:00
Kenneth Jao
eed9a55a90 Minor syntax error 2016-08-07 15:07:38 -04:00
Kenneth Jao
17106ad3e7 Added schemas for collections 2016-08-07 15:03:24 -04:00
Kenneth Jao
cb50268b23 Added favicon 2016-08-07 12:42:35 -04:00
Kenneth Jao
c864e11f70 Added sidebar buttons 2016-08-07 00:32:19 -04:00
Kenneth Jao
75a40b47f4 Main layout for website 2016-08-06 13:02:00 -04:00
Kenneth Jao
177bb44a44 Added suggested array structure in comments 2016-08-01 20:52:23 +08:00
Kenneth Jao
526828686c Merge branch 'master' of https://github.com/ksjdragon/hourglass 2016-08-01 19:31:14 +08:00
Kenneth Jao
763883cd13 Initial commit 2016-08-01 19:30:32 +08:00
ksjdragon
512e30d496 Initial commit 2016-08-01 19:28:57 +08:00
Kenneth Jao
1bc2dafcb4 added parenthesis handling for chemical equation balancer 2016-07-16 18:41:41 +08:00
Kenneth Jao
c99fcd3009 added fixes for chemical equation balancer 2016-07-16 13:46:17 +08:00
Kenneth Jao
34c273c2d2 fixed order of tabs 2016-07-16 01:50:05 +08:00
Kenneth Jao
9c1662eb72 fixed offset on eye tracking 2016-07-16 00:03:01 +08:00
unknown
20f99b88ad added equation balancer in tools tab 2016-07-15 20:57:16 +08:00
unknown
6afe5f17a5 fixed helptab disappearing 2016-07-14 05:44:30 +08:00
ksjdragon
991c6f68ca added outer drop shadow on atom 2016-05-09 23:29:48 -04:00
ksjdragon
2c2e3c4931 added corresponding theme values, minor css and code fixes 2016-05-09 23:19:45 -04:00
ksjdragon
f8778a2472 prevented legendholder from rendering on top 2016-05-09 22:18:38 -04:00
Yaman Qalieh
c846da2ab8 Reformatted client.js 2016-05-07 17:20:35 -04:00
ksjdragon
6513972081 css fixes 2016-04-25 22:10:55 -04:00
ksjdragon
84ea10774b added eyes 2016-04-25 21:31:24 -04:00
yamanq
011068af59 Update README.md 2016-04-23 19:24:24 -04:00
yamanq
f35f5e1881 Update README.md 2016-04-23 19:24:15 -04:00
yamanq
6873ce9f2d Create README.md 2016-04-23 19:23:49 -04:00
yamanq
e691db9432 add 3 keys in each row to update 2016-04-21 21:10:15 -04:00
yamanq
063d599a80 3 keys in each row 2016-04-21 21:05:32 -04:00
ksjdragon
156f6cfcfe more css stuffs 2016-04-21 20:45:56 -04:00
ksjdragon
60713a7b0a Css fixes 2016-04-20 23:28:21 -04:00
ksjdragon
13a3cfe3f1 fixed text color not updating 2016-04-20 23:16:21 -04:00
yamanq
b6d2133fcf added update for key 2016-04-20 21:18:08 -04:00
yamanq
38a8ea7393 bug fix 2016-04-20 21:06:21 -04:00
yamanq
fa5445f223 css of key 2016-04-20 20:48:45 -04:00
yamanq
262448ed16 added basic key legend, omitted from load sequence until stable 2016-04-20 14:10:46 -04:00
yamanq
387bec2453 created new lookup table keyColors 2016-04-20 13:37:59 -04:00
yamanq
0b4ef994a9 bug fix with undefined unit 2016-04-19 19:14:36 -04:00
yamanq
36f081b681 reorganization 2016-04-19 19:12:14 -04:00
yamanq
2423113b7e bugs and dark theme 2016-04-17 09:13:44 -04:00
ksjdragon
9eee80673d css fixes 2016-04-17 03:28:00 -04:00
ksjdragon
eb87e0a823 made scrollbar in sidebar, styled it 2016-04-17 03:01:56 -04:00
ksjdragon
9a657d12b7 new dark theme, with font color change 2016-04-17 02:43:25 -04:00
yamanq
1fa1b82a76 Merge branch 'master' of https://github.com/ksjdragon/atoms 2016-04-17 02:30:18 -04:00
yamanq
617d9d41b8 legend label + crude title 2016-04-17 02:30:02 -04:00
ksjdragon
20b0bf2e7c fixed helptext 2016-04-17 02:16:08 -04:00
ksjdragon
ea4e5febf1 css fixes 2016-04-17 01:59:33 -04:00
yamanq
c8b7ebf8ea help 2016-04-17 01:03:50 -04:00
yamanq
5fe57c482a merge 2016-04-17 01:02:22 -04:00
yamanq
6509c9da3a new dark theme 2016-04-17 01:00:07 -04:00
ksjdragon
aa4e7178c8 remove css resets, more css fixes 2016-04-17 00:54:56 -04:00
yamanq
10ee068e14 settings positioning 2016-04-17 00:52:50 -04:00
ksjdragon
6dbf05307c added css resets, and minor css fixes 2016-04-17 00:49:23 -04:00
ksjdragon
07712e23d9 minor css fix, help text was below selection div 2016-04-16 23:12:47 -04:00
ksjdragon
fc46631a32 minor css fixes 2016-04-16 23:10:58 -04:00
ksjdragon
8c3c2bebc7 more comments 2016-04-16 20:42:32 -04:00
ksjdragon
bed99eebb8 settings display and UI renovation 2016-04-16 20:36:00 -04:00
ksjdragon
e823566773 minor fixes 2016-04-16 16:23:02 -04:00
ksjdragon
6300af1436 optimized getColor function by adding global max/min/range 2016-04-15 22:40:49 -04:00
ksjdragon
ed97353224 changed electron gifs and atom design 2016-04-15 22:13:08 -04:00
ksjdragon
74cc0614e1 added yamanq to contributor list 2016-04-15 21:51:14 -04:00
ksjdragon
062bed78c5 continued merge 2016-04-15 21:50:25 -04:00
ksjdragon
f0aebb9a9d merge 2016-04-15 21:47:39 -04:00
ksjdragon
e0e8954fa0 large reformatting of files 2016-04-15 21:42:45 -04:00
yamanq
9df17635d6 some work on non-gradient key 2016-04-15 20:14:42 -04:00
yamanq
4f3095bfaf moved legend 2016-04-15 19:05:12 -04:00
yamanq
d8a7d7809e fixed gradient legend 2016-04-15 10:03:58 -04:00
yamanq
13b9ba8afa creating basic gradient legend, does not use input values. Also fixed gradient function preceding 0s 2016-04-14 20:06:07 -04:00
yamanq
6309c2531a Merge branch 'master' of https://github.com/ksjdragon/atoms 2016-04-14 17:34:43 -04:00
yamanq
daa3e66c61 image optimization 2016-04-14 17:34:10 -04:00
yamanq
ff72f42b25 more work on gradient legend, not yet functional 2016-04-14 10:37:51 -04:00
yamanq
b3e26741c1 started legend and css fix 2016-04-14 10:12:17 -04:00
yamanq
c124469fe9 Merge branch 'master' of https://github.com/ksjdragon/atoms 2016-04-13 23:43:36 -04:00
yamanq
4bfd75cc08 added help text for settings 2016-04-13 23:43:24 -04:00
ksjdragon
aec1f269f4 Merge branch 'master' of https://github.com/ksjdragon/atoms 2016-04-13 23:42:28 -04:00
ksjdragon
57d6025b00 slowed down gifs 2016-04-13 23:42:16 -04:00
ksjdragon
90c0d6e5c8 combined table and atom theme 2016-04-13 23:12:36 -04:00
ksjdragon
dc19d99846 Merge branch 'master' of https://github.com/ksjdragon/atoms 2016-04-13 23:04:25 -04:00
ksjdragon
dbeafdb650 added negative oxidation values 2016-04-13 23:04:13 -04:00
yamanq
c9742ca141 Merge branch 'master' of https://github.com/ksjdragon/atoms 2016-04-13 22:47:30 -04:00
yamanq
6ed0b2bdd5 License 2016-04-13 22:47:18 -04:00
ksjdragon
3e763886f1 Merge branch 'master' of https://github.com/ksjdragon/atoms 2016-04-13 22:38:02 -04:00
ksjdragon
d8e1d8bb33 fixed being able to click options while not in tab 2016-04-13 22:37:18 -04:00
yamanq
ea06b810be expanded readme 2016-04-13 21:51:24 -04:00
ksjdragon
eb7e792782 fixed small plus sign and hard to identify bold 2016-04-13 21:49:11 -04:00
ksjdragon
6130e6fc15 minor display and info fixes 2016-04-12 20:41:53 -04:00
yamanq
5e95290293 patch for A and B day undefined 2016-04-11 22:56:01 -04:00
yamanq
9de18f3b4f added A and B day feature 2016-04-11 22:51:00 -04:00
yamanq
649458be6c server optimization 2016-04-11 22:25:17 -04:00
ksjdragon
440ef29510 updated gifs 2016-04-11 07:19:44 -04:00
ksjdragon
3dff57fa36 minor display fixes 2016-04-11 00:35:31 -04:00
ksjdragon
70ff8267e5 polished up settings 2016-04-11 00:06:05 -04:00
ksjdragon
67f46d9a23 fixed cookies, minor display issues 2016-04-10 20:42:15 -04:00
ksjdragon
8743ea61ff added atom preview, and minor display fixes 2016-04-10 19:58:18 -04:00
ksjdragon
3d1b78ab1f Added and updated all info and displaying mechanism for it 2016-04-10 04:05:46 -04:00
ksjdragon
b1aa6f1887 added tabs 2016-04-07 02:23:42 -04:00
ksjdragon
44136da5f7 added base code for cookies, for settings changer 2016-04-05 23:09:48 -04:00
ksjdragon
aa166cc848 added electron ring gifs 2016-04-05 21:09:16 -04:00
ksjdragon
a18c7ea8bd Merge branch 'master' of https://github.com/ksjdragon/atoms 2016-04-05 21:07:27 -04:00
ksjdragon
dd1ad70a3f initial commit 2016-04-05 21:07:00 -04:00
ksjdragon
a3b56a65f8 Initial commit 2016-04-05 20:17:03 -04:00
yamanq
c59face625 Update client.html 2016-03-11 18:15:43 -05:00
yamanq
3c203f307e moved datepicker and added enter button 2016-03-06 22:23:10 -05:00
yamanq
2537c8d93e added favicon 2016-03-01 20:33:07 -05:00
yamanq
f4279b6d63 added comment feature 2016-03-01 16:46:37 -05:00
yamanq
03476d75c6 small fixes in font and title and favicon 2016-02-27 08:26:56 -05:00
yamanq
15e3a136b9 adjusted deleting for GMT server 2016-02-24 09:38:55 -05:00
yamanq
a007ce59fa small bug fix, displaying European date on phone 2016-02-24 09:34:52 -05:00
yamanq
ac60647afd increased limit 2016-02-23 15:54:06 -05:00
yamanq
435d47d862 favicon 2016-02-21 15:54:15 -05:00
yamanq
eb29d8ffae css and stuff 2016-02-21 15:37:20 -05:00
yamanq
b9767805a8 initial 2016-02-20 11:55:05 -05:00
yamanq
8f297953e6 icon 2016-02-11 20:40:56 -05:00
yamanq
919d0b9896 polish 2016-02-11 19:52:59 -05:00
yamanq
fc7defd1ee css + mobile 2016-02-11 19:11:57 -05:00
ksjdragon
549d31d4d1 more css changes 2016-02-11 18:19:13 -05:00
ksjdragon
d1e2d7053e some mure css 2016-02-11 18:19:13 -05:00
yamanq
3014336d6c mobile support 2016-02-11 18:10:16 -05:00
yamanq
fb377b2625 added update feature 2016-02-10 11:58:21 -05:00
yamanq
7438a6df12 fixed remove button position 2016-02-10 08:10:32 -05:00
yamanq
e50d810cd7 allow all users to see about page 2016-02-10 08:06:43 -05:00
yamanq
9915ca169f Merge branch 'master' of https://github.com/yamanq/scheduleac 2016-02-10 07:53:29 -05:00
yamanq
cd1c33ce05 fixed cards not being deleted, changed timestamp storage mechanism 2016-02-10 07:53:15 -05:00
ksjdragon
5b58cee994 Implemented CSS more on sidebar, started scrolling functionality 2016-02-10 00:25:27 -05:00
yamanq
0d07ce0886 sidebar css 2016-02-09 18:19:24 -05:00
yamanq
70fe025e20 created about section 2016-02-09 17:45:16 -05:00
yamanq
ed5f7331b2 fixed remove button css 2016-02-09 17:13:27 -05:00
ksjdragon
fb16142b0b bg file and font file replacement 2016-02-09 16:56:42 -05:00
ksjdragon
670cc09fae background change 2016-02-09 16:43:04 -05:00
yamanq
3b6527b6fd fixed date style 2016-02-08 21:32:40 -05:00
yamanq
1f7320bcff do not allow blank date 2016-02-08 21:25:30 -05:00
yamanq
2bf49118fd moment and css fixes and remove button and more 2016-02-08 20:53:43 -05:00
ksjdragon
d781e1a73b css 2016-02-08 16:57:50 -05:00
yamanq
8587d11b16 Update serve.js 2016-02-07 17:14:45 -05:00
yamanq
246720872b Update client.js 2016-02-07 15:22:01 -05:00
yamanq
bd0299516d Update serve.js 2016-02-07 15:20:03 -05:00
yamanq
4a48e7a979 small fix 2016-02-07 15:16:07 -05:00
yamanq
18b333d561 removed clearing of collection every server restart 2016-02-07 02:05:52 -05:00
yamanq
820c8ff911 small html fix 2016-02-07 02:04:30 -05:00
yamanq
dbc766a754 displays schedule 2016-02-07 02:03:06 -05:00
yamanq
942b1b1911 server issues, collection management, security issues 2016-02-07 01:46:01 -05:00
yamanq
ce9f9da8b7 initial 2016-02-06 15:21:25 -05:00
288 changed files with 26484 additions and 0 deletions

1
.gitattributes vendored Normal file
View File

@ -0,0 +1 @@
*.zip filter=lfs diff=lfs merge=lfs -text

View File

@ -0,0 +1,46 @@
#include <bcconfig.h>
#include <BigNumber.h>
#include <number.h>
#define numberOfSensors 50
int flexSensorPins[] = {A0, A1, A2, A3};
int mapValue;
String reference[] = {"L","H","R"};
String finalReadable;
String final;
int i = 0;
void setup() {
Serial.begin(9600);
BigNumber::begin();
}
String compression(int values[]) {
String combinedInt = "";
String header = "";
for (i = 0; i < numberOfSensors; i++) {
if(values[i] < 10) {
if(values[i] < 0) {
header += String(i) + ",";
combinedInt += String(values[i] * -1);
} else {
combinedInt += "0" + String(values[i]);
}
} else {
combinedInt += String(values[i]);
}
}
return header.substring(0,header.length()-1) + "." + combinedInt;
}
void loop() {
finalReadable = "";
final = "";
int dataValues[] = {32, 62, 10, 7, -45, 91, -95, 27, 54, 50, 67, 84, 92,
68, 10, 53, 79, 65, 06, 62, 60, -15, 52, 63, 71, 9,
52, -86, 68, 52, 96, 30, 31, 50, 24, 56, -61, 54, 40, 26,
33, 34, 32, 28, 2, 96, 3, 77, 66, 97};
Serial.println(compression(dataValues));
delay(250);
}

View File

@ -0,0 +1,88 @@
#include <bcconfig.h>
#include <BigNumber.h>
#include <number.h>
#define numberOfSensors 50
int flexSensorPins[] = {A0, A1, A2, A3};
int mapValue;
String reference[] = {"L","H"};
String finalReadable;
String final;
int i = 0;
void setup() {
Serial.begin(9600);
BigNumber::begin();
}
String toBinary(String intString, int len) {
String binary = "";
char s[len];
intString.toCharArray(s, len);
BigNumber lrgInt(s);
BigNumber two = 2;
BigNumber zero = 0;
int remainder;
while (lrgInt > zero) {
remainder = lrgInt % two;
lrgInt = lrgInt / two;
lrgInt = lrgInt - lrgInt % lrgInt
lrgInt
binary = String(remainder) + binary;
Serial.println(binary);
}
return binary;
}
String compression(int values[]) {
String finalCompress = "";
String combinedInt = "";
String binString = "";
char* s;
int counter = 0;
int change = 0;
for (i = 0; i < numberOfSensors; i++) {
if(String(values[i]).length() < 2) {
combinedInt += "0" + String(values[i]);
} else {
combinedInt += String(values[i]);
}
}
binString = toBinary(combinedInt, combinedInt.length());
for (i = 0; i <= binString.length(); i++) {
if (binString.charAt(i) == binString.charAt(change)) {
counter += 1;
} else {
if(counter == 1) {
finalCompress = finalCompress + reference[String(binString.charAt(0)).toInt()];
} else {
finalCompress = finalCompress + String(counter) + reference[String(binString.charAt(0)).toInt()];
}
change = i;
counter = 1;
}
}
return finalCompress;
}
void loop() {
finalReadable = "";
final = "";
int dataValues[] = {32, 62, 10, 7, 45, 91, 95, 27, 54, 50, 67, 84, 92, 68, 10,
53, 79, 65, 6, 62, 60, 15, 52, 63, 71, 9, 52, 86,
68, 52, 96, 30, 31, 50, 24, 56, 61, 54, 40, 26,
33, 34, 32, 28, 2, 96, 3, 77, 66, 97};
//for(int i = 0; i < numberOfSensors; i++) {
//mapValue = map(analogRead(flexSensorPins[i]), 512, 853, 0, 180) - 25;
//finalReadable = finalReadable + String(mapValue) + ",";
//dataValues[i] = mapValue;
String hello = compression(dataValues);
//Serial.println(hello);
delay(250);
}

View File

@ -0,0 +1,46 @@
#define numberOfSensors 3
int muxPins[] = {5,6,7};
int dataPin = A0;
int lastDataValues[] = {0,0,0};
int i = 0;
String delLast(String input) {
return input.substring(0,input.length()-1);
}
void setup() {
for(i = 0; i < sizeof(muxPins); i++) {
pinMode(muxPins[i],OUTPUT);
digitalWrite(muxPins[i],LOW);
}
pinMode(dataPin, INPUT);
Serial.begin(115200);
}
void loop() {
digitalWrite(5,LOW);digitalWrite(6,LOW);digitalWrite(7,HIGH);
String finalShort = "";
String finalReal = "";
String raw = "";
int mapValue = 0;
for(int i = 0; i < numberOfSensors; i++) {
String bin = String(i,BIN);
while(bin.length() < 3) {
bin = "0" + bin;
}
for(int j = 0; j < 3; j++) {
digitalWrite(muxPins[j],bin.substring(bin.length()-j-1,bin.length()-j).toInt());
}
mapValue = map(analogRead(dataPin), 530, 810, 0, 180);
finalShort = finalShort + String(mapValue - lastDataValues[i]) + ",";
finalReal = finalReal + String(mapValue) + ",";
raw = raw + String(analogRead(dataPin)) + ",";
lastDataValues[i] = mapValue;
}
Serial.println(delLast(raw) + " :: " + delLast(finalReal) + " :: " + delLast(finalShort));
delay(100);
}

View File

@ -0,0 +1,192 @@
// I2C device class (I2Cdev) demonstration Arduino sketch for MPU6050 class using DMP (MotionApps v2.0)
// Arduino Wire library is required if I2Cdev I2CDEV_ARDUINO_WIRE implementation
// is used in I2Cdev.h
#include "Wire.h"
/* I2Cdev and MPU6050 must be installed as libraries, or else the .cpp/.h files
* for both classes must be in the include path of your project
*/
#include "I2Cdev.h"
#include "MPU6050_6Axis_MotionApps20.h"
#define NUMBER_OF_SENSORS 3 //// YOU MAY NEED TO CHANGE THIS
// Default I2C address is 0x68
// AD0 LOW(0) = 0x68 (Default for SparkFun breakout and InvenSense evaluation board)
// AD0 HIGH(1) = 0x69
// MPU Control Variables
MPU6050 mpu;
bool dmpReady; // Set true if DMP init was successful.
uint8_t devStatus; // Return status after each device operation. (0 = success, !0 = error)
uint8_t mpuIntStatus; // Holds interrupt status byte from MPU.
uint16_t packetSize; // Expected DMP packet size. (Default is 42 bytes)
uint16_t fifoCount; // Count of all bytes currently in FIFO.
uint8_t fifoBuffer[64]; // FIFO storage buffer.
// Orientation and Motion Variables
Quaternion q; // [W, X, Y, Z] Quaternion container.
VectorFloat gravity; // [X, Y, Z] Gravity vector
float ypr[3]; // [Yaw, Pitch, Roll] array container.
//Digital Pins Reference Variables
const int latchPin = 2; //ST_CP or RCLK
const int clockPin = 1; //SH_CP or SRCLK
const int dataPin = 3; //DS or SER
// Other Variables
String finalParts[NUMBER_OF_SENSORS];
String final = "";
//==============================================================
void switchSensor(int sensorNumber) {
/* The shift register shifts out bits to the ADO lines. In binary:
* 0001 = Sensor on Q0(QA) 2^0 = 1 = 0001 in binary
* 0010 = Sensor on Q1(QB) 2^1 = 2 = 0010 in binary
*/
int data = (int) 1 << (sensorNumber - 1); // Shift register serial data input.
digitalWrite(latchPin, LOW); // Hold low for as long as you are transmitting data.
shiftOutBits(dataPin, clockPin, ~data); // Shift out the bits into the shift register; negate data. (0001 = 1000)
digitalWrite(latchPin, HIGH); // Ends transmission of data.
}
void shiftOutBits(int myDataPin, int myClockPin, byte myDataOut) {
// This shifts 8 bits out MSB first.
//Function Setup
int l = 0;
int pinState;
pinMode(myClockPin, OUTPUT);
pinMode(myDataPin, OUTPUT);
// Clear everything out in case to prepare shift register.
digitalWrite(myDataPin, 0);
digitalWrite(myClockPin, 0);
// For each bit in the byte myDataOut.
for (l = 7; l >= 0; l--) {
digitalWrite(myClockPin, 0);
//if the value passed to myDataOut and a bitmask result
// true then... so if we are at i=6 and our value is
// %11010100 it would the code compares it to %01000000
// and proceeds to set pinState to 1.
if ( myDataOut & (1 << l) ) {
pinState = 1;
//////Serial.print(pinState);
}
else {
pinState = 0;
//////Serial.print(pinState);
}
// Sets the pin to HIGH or LOW depending on pinState.
digitalWrite(myDataPin, pinState);
// Register shifts on HIGH of myClockPin.
digitalWrite(myClockPin, 1);
// Stop sending on myDataPin.
digitalWrite(myDataPin, 0);
}
// Stop shifting.
digitalWrite(myClockPin, 0);
}
// ================================================================
// === MAIN PROGRAM SETUP ===
// ================================================================
void setup() {
delay(2000);
Wire.begin(); // Join I2C bus. (I2Cdev library doesn't do this automatically.)
TWBR = 24; // Sets frequency of the clock (SCL) higher.
Serial.begin(115200); // Initialize serial communication with baud rate.
pinMode(latchPin, OUTPUT); // Tell the Arduino to send or recieve signals.
int dmpReadyCounter = 0; // Counts number of sensors ready.
for (int i = 1; i <= NUMBER_OF_SENSORS; i++) {
/* We read data from all sensors by switching addresses one by one, only reading from the first address (0x68).
* Therefore, we shift the addresses to the next sensor, and retrieve its value.
*/
switchSensor(i);
mpu.initialize(); // Intialize device.
devStatus = mpu.dmpInitialize(); // Load and configure the DMP. (Digital Motion Processor)
// Gyroscope offsets. (Change if necessary)
mpu.setXGyroOffset(220);
mpu.setYGyroOffset(76);
mpu.setZGyroOffset(-85);
mpu.setZAccelOffset(1788);
// Check success of DMP.
if (devStatus == 0) {
mpu.setDMPEnabled(true);
dmpReadyCounter += 1; // Add one to count number of ready sensors.
packetSize = mpu.dmpGetFIFOPacketSize(); // Get expected DMP packet size for later comparison
} else {
// Error!
Serial.print("Error on sensor " + String(i) + "\n");
}
/////////Serial.print(String(digitalRead(8)) + String(digitalRead(9)) + String(digitalRead(10)) + String(digitalRead(11)) + "\n");
}
if (dmpReadyCounter == 3) {
dmpReady = true; // Set DMP Ready flag. (Allows main loop to use the DMP.)
}
}
// ================================================================
// === MAIN PROGRAM LOOP ===
// ================================================================
void loop() {
final = ""; // Reset final to nothing.
// If DMP isn't ready...
if (!(dmpReady)) {
return;
}
for (int k = 1; k <= NUMBER_OF_SENSORS; k++) {
switchSensor(k);
// Check for overflow.
if (fifoCount == 1024) {
mpu.resetFIFO(); // Reset so we can continue cleanly.
} else {
fifoCount = mpu.getFIFOCount(); // Get current FIFO count.
// Wait for correct avaliable data length.
while (fifoCount < packetSize) {
fifoCount = mpu.getFIFOCount();
}
mpu.getFIFOBytes(fifoBuffer, packetSize); // Read a packet from FIFO
/* Track FIFO count in case there is more than 1 packet avaliable.
* (Read more without waiting for an interrupt.)
*/
fifoCount -= packetSize;
// Get values to process.
mpu.dmpGetQuaternion(&q, fifoBuffer);
mpu.dmpGetGravity(&gravity, &q);
mpu.dmpGetYawPitchRoll(ypr, &q, &gravity);
// Concatenate for outputting. (Displays in Euler Angles in degrees.)
finalParts[k - 1] = String(ypr[0] * 180 / M_PI) + "," + String(ypr[1] * 180 / M_PI) + "," + String(ypr[2] * 180 / M_PI) + ":";
final += finalParts[k - 1];
}
}
Serial.print(final);
Serial.print("\n");
}

View File

@ -0,0 +1,30 @@
int muxPins[3] = {5,6,7};
int dataPin = 13;
void setup() {
for(int i = 0; i < 3; i++) {
pinMode(muxPins[i],OUTPUT);
digitalWrite(muxPins[i],LOW);
}
pinMode(dataPin, OUTPUT);
digitalWrite(dataPin,HIGH);
Serial.begin(115200);
}
void loop() {
for(int i = 0; i < 8; i++) {
String bin = String(i,BIN);
while(bin.length() < 3) {
bin = "0" + bin;
}
for(int j = 0; j < 3; j++) {
digitalWrite(muxPins[j],bin.substring(bin.length()-j-1,bin.length()-j).toInt());
}
Serial.println(" ");
delay(50);
}
// put your main code here, to run repeatedly:
}

View File

@ -0,0 +1,75 @@
int inA1 = 8; // wire 1 (blue)
int inA2 = 9; // wire 2 (pink)
int inB1 = 10; // wire 3 (yellow)
int inB2 = 11; // wire 4 (orange)
int counter = 0;
//wire 5 (Red) is a VCC and should be put to 5V, with this setup it is not needed, but it is good to know if you make something like an 8 step spinup
int stepDelay = 2;
void setup() {
pinMode(inA1, OUTPUT);
pinMode(inA2, OUTPUT);
pinMode(inB1, OUTPUT);
pinMode(inB2, OUTPUT);
pinMode(A1,INPUT);
}
void loop(){
Serial.println(String(analogRead(A1)));
Serial.println("hi");
/*for(int i =0;i<1600;i++) {
step1();
step2();
step3();
step4();
}
stopMotor();
delay(500);
for(int j=0;j<1600;j++) {
step3();
step2();
step1();
step4();
}
stopMotor();
delay(500);*/
}
void step1() {
digitalWrite(inA1, LOW);
digitalWrite(inA2, HIGH);
digitalWrite(inB1, HIGH);
digitalWrite(inB2, LOW);
delay(stepDelay);
}
void step2() {
digitalWrite(inA1, LOW);
digitalWrite(inA2, HIGH);
digitalWrite(inB1, LOW);
digitalWrite(inB2, HIGH);
delay(stepDelay);
}
void step3() {
digitalWrite(inA1, HIGH);
digitalWrite(inA2, LOW);
digitalWrite(inB1, LOW);
digitalWrite(inB2, HIGH);
delay(stepDelay);
}
void step4() {
digitalWrite(inA1, HIGH);
digitalWrite(inA2, LOW);
digitalWrite(inB1, HIGH);
digitalWrite(inB2, LOW);
delay(stepDelay);
}
void stopMotor() {
digitalWrite(inA1, LOW);
digitalWrite(inA2, LOW);
digitalWrite(inB1, LOW);
digitalWrite(inB2, LOW);
}

View File

@ -0,0 +1,67 @@
const int latchPin = 8; //ST_CP or RCLK
const int clockPin = 12; //SH_CP or SRCLK
const int dataPin = 11; //DS or SER
byte seven_seg_digits[10][7] = {
{ 1,1,1,1,1,1,0 }, // = 0
{ 0,1,1,0,0,0,0 }, // = 1
{ 1,1,0,1,1,0,1 }, // = 2
{ 1,1,1,1,0,0,1 }, // = 3
{ 0,1,1,0,0,1,1 }, // = 4
{ 1,0,1,1,0,1,1 }, // = 5
{ 1,0,1,1,1,1,1 }, // = 6
{ 1,1,1,0,0,0,0 }, // = 7
{ 1,1,1,1,1,1,1 }, // = 8
{ 1,1,1,0,0,1,1 } // = 9
};
int digits[10] = {
126, 48, 109, 121, 51, 91, 95, 112, 127,
}
void writeNumber(int character) {
/* The shift register shifts out bits to the ADO lines. In binary:
* 1110 = Sensor on Q0(QA) ~(2^0) = ~1 = 1110 in binary
* 1101 = Sensor on Q1(QB) ~(2^1) = ~2 = 1101 in binary
* '~' = not
*/
//int data = (int) 1 << (sensorNumber - 1); // Shift register serial data input.
digitalWrite(latchPin, LOW); // Hold low for as long as you are transmitting data.
shiftOutBits(dataPin, clockPin, character); // Shift out the bits into the shift register; negate data. (0001 = 1000)
digitalWrite(latchPin, HIGH); // Ends transmission of data.
}
void shiftOutBits(int myDataPin, int myClockPin, int number) {
// This shifts 8 bits out MSB first.
// Setup Varaibles
int pinState;
pinMode(myClockPin, OUTPUT);
pinMode(myDataPin, OUTPUT);
// Clear everything out in case to prepare shift register.
digitalWrite(myDataPin, 0);
digitalWrite(myClockPin, 0);
// For each bit in the byte myDataOut.
for (int i = 7; i >= 0; i--) {
digitalWrite(myClockPin, 0);
pinState = 1 - seven_seg_digits[number][i];
digitalWrite(myDataPin, pinState); // Sets the pin to HIGH or LOW depending on pinState.
digitalWrite(myClockPin, 1); // Register shifts on HIGH of myClockPin.
digitalWrite(myDataPin, 0); // Stop sending on myDataPin.
}
digitalWrite(myClockPin, 0); // Stop shifting.
}
void setup() {
writeNumber(5);
}
void loop() {
return;
}

54
Arduino/Transfer.py Normal file
View File

@ -0,0 +1,54 @@
import serial
port = serial.Serial('COM6', 9600)
valuesBeforeAveraging = 6
numberOfSensors = 3
splitValues = []
averageSetLength = 0
nan = ['nan','na']
def getNewValue():
newRead = port.readline()[:-2].lower()
if nan[0] in newRead or nan[1] in newRead:
print "FIFO Buffer Overflow"
getNewValue()
else:
return newRead
def getNewAverage(newValue):
global splitValues
global averageSetLength
average = 0.0000
outputLine = ""
splitValues.append([]) # Append new trial
if averageSetLength > valuesBeforeAveraging:
del splitValues[0]
averageSetLength = len(splitValues)
for yprNum, ypr in enumerate(newValue.split(":")): # For each sensor/YPR set
splitValues[averageSetLength - 1].append([]) # Append new array, compensate for array start 0
for valueNum, value in enumerate(ypr.split(",")): # For each value in YPR set
splitValues[averageSetLength - 1][yprNum].append(float(value)) # Append value to array
for entryNum in xrange(0, averageSetLength): #For all trials
average += splitValues[entryNum][yprNum][valueNum] # Add all x,y,z values
average = average / (averageSetLength) # Divide by number of trials
outputLine = outputLine + str(average)[:str(average).find('.') + 4] + ","
average = 0.0000
outputLine = outputLine[:-1] + ":"
outputLine = outputLine[:-1]
return outputLine
while 1:
try:
newRead = getNewValue()
final = getNewAverage(newRead)
print final
file = open('Transfer.txt','w')
file.write(final)
file.close()
except: IOError

View File

@ -0,0 +1,86 @@
//**************************************************************//
// Name : shiftOutCode, Dual Binary Counters //
// Author : Carlyn Maw, Tom Igoe //
// Date : 25 Oct, 2006 //
// Version : 1.0 //
// Notes : Code for using a 74HC595 Shift Register //
// : to count from 0 to 255 //
//**************************************************************//
//Pin connected to ST_CP of 74HC595
int latchPin = 2;
//Pin connected to SH_CP of 74HC595
int clockPin = 1;
////Pin connected to DS of 74HC595
int dataPin = 3;
void setup() {
//Start Serial for debuging purposes
Serial.begin(9600);
//set pins to output because they are addressed in the main loop
pinMode(latchPin, OUTPUT);
digitalWrite(5, LOW);
}
void loop() {
//count up routine
//ground latchPin and hold low for as long as you are transmitting
digitalWrite(latchPin, 0);
//count down on RED LEDs
shiftOut(dataPin, clockPin, 2);
//return the latch pin high to signal chip that it
//no longer needs to listen for information
digitalWrite(latchPin, 1);
delay(1000);
Serial.print(String(digitalRead(8)) + String(digitalRead(9)) + String(digitalRead(10)) + String(digitalRead(11)) + "\n");
//Serial.print(digitalRead(8));
}
void shiftOut(int myDataPin, int myClockPin, byte myDataOut) {
// This shifts 8 bits out MSB first,
//on the rising edge of the clock,
//clock idles low
//internal function setup
int i=0;
int pinState;
pinMode(myClockPin, OUTPUT);
pinMode(myDataPin, OUTPUT);
//clear everything out just in case to
//prepare shift register for bit shifting
digitalWrite(myDataPin, 0);
digitalWrite(myClockPin, 0);
//for each bit in the byte myDataOut<75>
//NOTICE THAT WE ARE COUNTING DOWN in our for loop
//This means that %00000001 or "1" will go through such
//that it will be pin Q0 that lights.
for (i=7; i>=0; i--) {
digitalWrite(myClockPin, 0);
//if the value passed to myDataOut and a bitmask result
// true then... so if we are at i=6 and our value is
// %11010100 it would the code compares it to %01000000
// and proceeds to set pinState to 1.
if ( myDataOut & (1<<i) ) {
pinState= 1;
}
else {
pinState= 0;
}
//Sets the pin to HIGH or LOW depending on pinState
digitalWrite(myDataPin, pinState);
//register shifts bits on upstroke of clock pin
digitalWrite(myClockPin, 1);
//zero the data pin after shift to prevent bleed through
digitalWrite(myDataPin, 0);
}
//stop shifting
digitalWrite(myClockPin, 0);
}

BIN
Compression/3DBlocks.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 MiB

BIN
Compression/4DBlocks.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

View File

@ -0,0 +1,125 @@
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[margin=1in]{geometry}
\usepackage{amsfonts, amsmath, amssymb}
\usepackage[none]{hyphenat}
\usepackage{fancyhdr}
\usepackage{titling}
\usepackage{changepage}
\usepackage{graphicx}
\usepackage{wrapfig}
\renewcommand\maketitlehooka{\null\mbox{}\vfill}
\renewcommand\maketitlehookd{\vfill\null}
\pagestyle{fancy}
\fancyhead[L]{\slshape Algorithm Details}
\fancyhead[R]{Kenneth Jao}
\fancyfoot[C]{\thepage}
\title{Lossy Compression through Multi-dimensional Fourier Transforms }
\author{Kenneth Jao}
\date{February 2019}
\begin{document}
\maketitle
\pagebreak
\section{Introduction}
This document covers the details of the mathematics of the compression algorithm. Each main mathematical application will be explained in detail. Firstly an overview of the algorithm as a whole will be given.
\subsection{Notation}
\begin{adjustwidth}{.5in}{}
Data Matrix: \[ \left[ {\begin{array}{cccc} A & B & C & \dots \end{array}} \right] or \left[\ A,\ B,\ C,\ \dots \ \right]\]
Will mean that the dimensions 0, 1, 2, \dots will correspond to A, B, C, \dots and represents an array of data, not a mathematical matrix.\\
\newline
N-Dimensional Polynomial:\\
\begin{adjustwidth}{.5in}{}
$\vec{e_i}=(e_1,\ e_2,\ e_3, \dots e_n) \in \mathbb{N}^n$ will represent the i-th permutation of $\vec{e}$.\\
$\vec{x}^{\vec{e}} = x_1^{e_1}\cdot x_2^{e_2}\cdot \dots x_n^{e_n}$ where $\vec{x}=(x_1,\ x_2,\ x_3, \dots x_n) \in \mathbb{R}^n$\\
An arbitrary n-dimensional polynomial of degree m $P(\ x_1,\ x_2,\ x_3,\dots,\ x_n)$ will equal: \[ a_1x^{\vec{e_1}} + a_2x^{\vec{e_2}} + a_3x^{\vec{e_3}} + \dots + a_{max}x^{\vec{e_{max}}}\]
Where $max=(m+1)^n$
\end{adjustwidth}
\end{adjustwidth}
\subsection{Algorithm Overview}
\begin{adjustwidth}{.5in}{}
A set of video data in given in the format: \[ \left[ {\begin{array}{cccc} Frame & Y Pixel & X Pixel & RGB \end{array}} \right] \]
After receiving this video data, it will be processed into square blocks of dimension $N$, denoted by $Block_{w_1,w_2,w_3,...}$ where ${w_1, w_2, w_3,...}$ represents the sorting of $N$ dimensional blocks in a format that correspond to the location of the data in the ordered video. For instance, given a data in format $[\ x,\ y,\ z\ ]$, square blocks of dimension $N$ can be extracted such that the new data structure is now in the form $[\frac{x}{N},\frac{y}{N},\frac{z}{N}, N, N, N]$, and thus, in this case, $w_1 = \frac{x}{N},\ w_2 = \frac{y}{N},\ w_3 = \frac{z}{N}$. Afterwards, there are two possible steps.
\begin{enumerate}
\item The first option is to purely fit a polynomial to the data of each block. That is, find a polynomial of degree $N-1$ and of dimension $N$ where each $Block_{w_1,w_2,w_3,...}[\ x_1,\ x_2,\ x_3,\ \dots \ ]$ will correspond to some $P(\ x_1,\ x_2,\ x_3,\ \dots,\ x_n)$. The output will be the coefficients of the new polynomial.
\item The second option is to attempt to create a polynomial of degree $N-1$ and of dimension $N$ where its coefficients match first $N$ terms of the Taylor Polynomial of $cos(x_1+x_2+x_3+\dots +x_n)$. The coefficients of the new polynomial will attempt to as close to the Taylor Polynomial. The output will be the coefficients of the new polynomial along with a separate function, its usage explained later in the methodology.
\end{enumerate}
\noindent An $N$ dimensional Discrete Fourier Transform (DFT) will now be performed on these blocks. The output is the first $k$ coefficients, where $k$ is determined when the sum of a sufficient $k$ coefficients is greater than 90\% of the convergence of the $N$ dimensional Fourier Series. The 'first' components will be determined by a counting method discussed later.\\
\newline
Now, these coefficients corresponding to each $Block_{w_1,w_2,w_3,...}$ will be flattened to 2 dimensions. A Discrete Cosine Transform (DCT) will now be applied onto these coefficients, with the rounding threshold higher, for the sake of precision on coefficients.\\
\newline
The algorithm is now complete. The final products will include: a 2 dimensional DCT of the coefficients of an $N$ dimensional DFT, function for each block. The raveling process will be standard for a given dimensional size, so this needs not be stored.
\end{adjustwidth}
\pagebreak
\section{Changing Dimensions}
Firstly, the video is turned into a basic 3 dimensions. This is done by stacking the Frame and RGB dimensions and swapping the Y Pixel and X Pixel to make it more intuitively oriented. The new form becomes: \[ \left[ {\begin{array}{ccc} X Pixel & Y Pixel & Frame+RGB \end{array}} \right] \]
That is to say, $[\ x,\ y,\ 3f\ ]$, $[\ x,\ y,\ 3f+1\ ]$, $[\ x,\ y,\ 3f+2\ ]$ would lie in frame $f$, and represent the R, G, and B values, respectively. From here, we can start slicing the data in certain ways to obtain our desired block dimension.
\begin{figure}[h]
\centering
\includegraphics[width=2in]{images/RGB.png}
\caption{Visualization of flattened video data.}
\end{figure}
\subsection{3-Dimensional Block}
\begin{adjustwidth}{.5in}{}
To obtain 3-Dimensional blocks, in this case, we simply can just extract cubes from the already flattened video data. (See Figure 2.) This arises in a data format of $[\frac{x}{N},\frac{y}{N},\frac{z}{N}, N, N, N]$. In this algorithm, $N=6$ was chosen.
\begin{figure}[h]
\centering
\includegraphics[width=3in]{images/3DBlocks.png}
\caption{3D Blocked Video Data}
\end{figure}
\end{adjustwidth}
\subsection{4-Dimensional Block}
To obtain 4-Dimensional blocks, in this case, we extract a $NxNxN$ cube and then take $N$ cubes downward. (See Figure 3.) This arises in a data format of $[\frac{x}{N},\frac{y}{N^2},\frac{z}{N}, N, N, N, N]$. In this algorithm, $N=6$ was chosen.
\begin{figure}[h]
\centering
\includegraphics[width=3in]{images/4DBlocks.png}
\caption{4D Blocked Video Data}
\end{figure}
\section{Polynomial Fitting}
There are two potential outputs of polynomial fitting. FINISH
\subsection{Pure Polynomial Fitting}
The given data $D$ is in format: \[ \left[ \begin{array}{ccccc} x_1 & x_2 & x_3 & \dots & x_n \end{array} \right] \]
Where its size is $(m+1,\ m+1,\, m+1,\ \dots,\ m+1)$. To find an n-dimensional polynomial of degree m, all that is necessary is find a solution to this system of linear equations: \
\[ \left[ \begin{array}{ccccc}
\vec{e_1}^{\vec{e_1}} & \vec{e_1}^{\vec{e_2}} & \vec{e_1}^{\vec{e_3}} & \dots & \vec{e_1}^{\vec{e_{max}}}\\
\vec{e_2}^{\vec{e_1}} & \vec{e_2}^{\vec{e_2}} & \vec{e_2}^{\vec{e_3}} & \dots & \vec{e_2}^{\vec{e_{max}}}\\
\vec{e_3}^{\vec{e_1}} & \vec{e_3}^{\vec{e_2}} & \vec{e_3}^{\vec{e_3}} & \dots & \vec{e_3}^{\vec{e_{max}}}\\
\vdots & \vdots & \vdots & \vdots & \vdots \\
\vec{e_{max}}^{\vec{e_1}} & \vec{e_{max}}^{\vec{e_2}} & \vec{e_{max}}^{\vec{e_3}} & \dots & \vec{e_{max}}^{\vec{e_{max}}}
\end{array} \right]
\left[ \begin{array}{c} a_1 \\ a_2 \\ a_3 \\ \vdots \\ a_{max} \end{array} \right] =
\left[ \begin{array}{c} D[\vec{e_1}] \\ D[\vec{e_2}] \\ D[\vec{e_3}] \\ \vdots \\ D[\vec{e_{max}}] \end{array} \right]\]
Thus, to find the coefficients, all that is necessary is to compute:
\[ {\left[ \begin{array}{ccccc}
\vec{e_1}^{\vec{e_1}} & \vec{e_1}^{\vec{e_2}} & \vec{e_1}^{\vec{e_3}} & \dots & \vec{e_1}^{\vec{e_{max}}}\\
\vec{e_2}^{\vec{e_1}} & \vec{e_2}^{\vec{e_2}} & \vec{e_2}^{\vec{e_3}} & \dots & \vec{e_2}^{\vec{e_{max}}}\\
\vec{e_3}^{\vec{e_1}} & \vec{e_3}^{\vec{e_2}} & \vec{e_3}^{\vec{e_3}} & \dots & \vec{e_3}^{\vec{e_{max}}}\\
\vdots & \vdots & \vdots & \vdots & \vdots \\
\vec{e_{max}}^{\vec{e_1}} & \vec{e_{max}}^{\vec{e_2}} & \vec{e_{max}}^{\vec{e_3}} & \dots & \vec{e_{max}}^{\vec{e_{max}}}
\end{array} \right]}^{-1}
\left[ \begin{array}{c} D[\vec{e_1}] \\ D[\vec{e_2}] \\ D[\vec{e_3}] \\ \vdots \\ D[\vec{e_{max}}] \end{array} \right]\]
\noindent Thus, $a_1,\ a_2,\ a_3, \dots,\ a_3$ has now been found.
\subsection{Cosine Taylor Polynomial Fitting}
\end{document}

BIN
Compression/Blocks.blend Normal file

Binary file not shown.

BIN
Compression/RGB.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

263
Compression/compress.py Normal file
View File

@ -0,0 +1,263 @@
import math
import time
import sys
import cv2 as cv
import numpy as np
import scipy.linalg as spla
from functools import reduce
from os import system
from PIL import Image
def read_video(limit = -1):
video = []
cap = cv.VideoCapture('D:/Videos/test.mkv')
frame_num = 0
while cap.isOpened():
if limit == frame_num:
break
ret, frame = cap.read()
video.append(frame)
system('cls')
print("Loading video: {:.2f}%".format(100*frame_num/limit))
frame_num += 1
return video
def change_dimension(data, dim):
'''
Video data is in form [Frame][Y Pixel][X Pixel][RGB]
Maximum size should be 10, but smaller is better.
Eventually, all dimensional changing should be done in C, programmed
specifically for each dimension.
'''
def cubify(data, s):
c = tuple(np.array(data.shape)//s)
cubed = np.zeros(tuple(list(c)+[s]*len(c)), dtype=int)
trim = [slice(0,s)]
def permute(n, dim=[]):
if n == len(c):
slice_ind = [slice(dim[i]*s, (dim[i]+1)*s) for i in range(n)]
cubed[tuple(dim)] = data[tuple(slice_ind)]
else:
for x in range(c[n]):
permute(n+1, dim+[x])
permute(0)
return cubed
if dim not in [3,4]:
raise Exception("Not an available target dimension!")
if dim == 3:
# Outer Form: [X Block][Y Block][Z Block]
# Inner Form: [X Pixel][Y Pixel][Frame+RGB] Size: 6
s = 6
blocks = np.swapaxes(np.concatenate(data, axis=2), 0, 1)
blocks = cubify(blocks, s)
elif dim == 4:
# Outer Form [X Block][Y Block][Z Block]
# Inner Form [Psuedo-Y Block][X Pixel][Y Pizel][Frame+RGB] Size: 6
s = 6
blocks = change_dimension(data, 3)
c = list(blocks.shape)[:3]
c[2] = c[2]//s
cubed = np.zeros(tuple(c+[s]*4), dtype=int)
for x in range(c[0]):
for y in range(c[1]):
for z in range(c[2]):
arr = np.concatenate(blocks[x:x+1][0][y:y+1,s*z:s*(z+1)])
cubed[x,y,z] = arr
blocks = cubed
return blocks
def permutations(arr):
'''
The input array will carry possible permutations.
'''
final = []
def permute(n, items=[]):
if n == len(arr):
final.append(items)
else:
for x in arr[n]:
permute(n+1, items+[x])
permute(0)
return final
def pure_polynomial_fit(blocks, dim): # RESIZE TO 2 PI !!!!!!#
'''
A polynomial of P(n-1) is generated with an n dimensional block,
by calculating the a system of n equations, solved through LU
decomposition.
'''
def permute(c, n, dim=[]):
if n == len(c):
d = tuple(dim)
b = blocks[d].flatten()[::-1]
pb = p_inv.dot(b)
y = spla.solve_triangular(l, pb, lower=True, check_finite=False)
x = spla.solve_triangular(u, y, check_finite=False)
block_polynomials[d] = x
if np.sum(dim[1:]) == 0:
system('cls')
print("Fit Poly Block {:.2f}%".format(100*dim[0]/c[0]))
else:
for x in range(c[n]):
permute(c, n+1, dim+[x])
degree = blocks.shape[-1] - 1
deg_perm = permutations(dim*[list(reversed(range(degree+1)))])
# Scale the coordinate system from 0 to 2pi, for preparation of DFT.
block_coord_perm = (2*math.pi/(degree+1)) * deg_perm[:]
mat_size = int(math.pow(degree + 1, dim))
a = np.zeros((mat_size, mat_size), dtype=np.uint64)
for i,perm in enumerate(block_coord_perm):
a[i] = np.prod(np.power(perm, deg_perm), axis=1, dtype=np.uint64)
p, l, u = spla.lu(a)
p_inv = np.linalg.inv(p)
poly_shape = list(blocks.shape[:-dim]) + [mat_size]
block_polynomials = np.zeros(tuple(poly_shape), dtype=np.float64)
permute(blocks.shape[:-dim], 0)
return block_polynomials
def trig_taylor_fit(block):
'''
Assume the polynomial will be a n-dimensional taylor polynomial,
calculate a polynomial regression that will represent the inputs.
'''
pass
def nd_dft(poly, dim):
'''
This function calculates a N-dimensional Discrete Fourier Transform,
specifically where f(t) is a polynomial.
'''
def get_integral_mat(n, x, zero, imag):
'''
Matrix represents T: P -> K, where P,K have basis' respectively:
P: x^n, x^(n-1), x^(n-2), ..., c, ix^n, ix^(n-1), ix^(n-2), ..., ic
K: c, 1/k, 1/k^2, ..., 1/k^n, ic, i/k, i/k^2, ..., i/k^n
This function returns a matrix to calculate the one-dimensional
integral. If the argument zero is true, the function will return
a matrix assuming the definite integral is from 0.
'''
mat_rr, mat_ri, mat_ir, mat_ii = [], [], [], []
def get_mat_part(zero_row_cond, neg_cond):
mat_part = []
for row in range(n+1):
if row % 2 == zero_row_cond:
mat_part.append([0]*(n+1))
continue
else:
row_vec = []
for col in range(n+1):
x_pow = n-col-row
if x_pow < 0:
row_vec.append(0)
elif x_pow == 0 and zero:
row_vec.append(0)
else:
neg = -1 if (row - neg_cond) % 4 == 0 else 1
const = math.factorial(n-col)/math.factorial(n-col-row)
row_vec.append(neg*const*math.pow(x, n-col-row))
mat_part.append(row_vec)
return np.array(mat_part, dtype=np.float64)
mat_r = np.concatenate([get_mat_part(0, 3), get_mat_part(1, 2)])
if imag:
mat_i = np.concatenate([get_mat_part(1, 0), get_mat_part(0, 3)])
return np.concatenate([mat_r, mat_i], axis=1)
else:
return mat_r
def get_mono_mats(block):
rind, iind = np.nonzero(rblock), np.nonzero(iblock)
rmono_a, imono_a = rblock[rind], iblock[iind]
rmono_deg = np.subtract(deg, np.array(deg_perm)[rind].transpose())
imono_deg = np.subtract(2*deg+1, np.array(deg_perm)[iind].transpose())
mono_count = len(rmono_a) + len(imono_a)
mono_mats = np.zeros((dim, mono_count, 2*deg+2))
for x in range(dim):
mono_deg = np.concatenate([rmono_deg, imono_deg], axis=1)
mono_mat[x][np.arange(mono_count), mono_deg[x]]
return mono_mats
def precompute_integrals(k_max, dim, degree):
'''
This function returns all possible combinations of monomial
integrals precomputed for all 'k' until k_max excluding k = 0.
'''
integral_k = np.zeros((degree, k_max-1), dtype=np.float64)
mat = get_integral_mat(degree, 2*math.pi, True, False)
k_col = np.arange(1, k_max).reshape((k_max-1, 1))
k_pow = np.power(k_col, -np.arange(1, degree+2).astype('float64'))
k_b = np.concatenate([k_pow, 1j*k_pow], axis=1).transpose()
mono_integrals = mat.transpose().dot(k_b)
# Offset by degree for deg_perm to fit basis x^n, x^(n-1) ... 1.
deg_perm = permutations(dim*[list(range(degree+1))])
k_perm = magnitude_spiral(dim*[list(range(1, k_max))])
poly_integrals = []
for deg in deg_perm:
k_perm_prod = []
for k_vec in k_perm:
k_perm_prod.append(np.prod(mono_integrals[deg, k_vec]))
poly_integrals.append(k_perm_prod)
return np.array(poly_integrals)
def magnitude_spiral(dim, k_max):
k_perm = permutations(dim*[list(range(-k_max, k_max+1))])
k_vecs = {}
for k_vec in k_perm:
mag = np.linalg.norm(k_vec)
try:
k_vecs[mag].append(k_vec)
except KeyError:
k_vecs[mag] = [k_vec]
k_vec_sort = {}
for mag in list(sorted(k_vecs.keys())):
k_vec_sort[mag] = sorted(k_vecs[mag], key=lambda x: list(np.abs(x)))
return np.concatenate(list(k_vec_sort.values()))
deg = int(math.sqrt(poly.shape[-1], 1/dim)) - 1
# In form [Degree Permutation, K permutation]
poly_integrals = precompute_integrals(int(math.pow(1000, 1/deg)), dim, deg)
###### FINISH LOOP
def main():
C_DIM = 4
video = np.array(read_video(50))
vid_blocks = change_dimension(video, C_DIM)
block_poly = np.round(pure_polynomial_fit(vid_blocks, C_DIM), 5)
print(video_blocks[0])
c_k = []
#for poly in block_polynomials:
#img = Image.fromarray(video[1000])
#img.save('D:/Videos/test.png')
if __name__ == "__main__":
main()

117
SmearcarDB/.gitignore vendored Normal file
View File

@ -0,0 +1,117 @@
# Created by https://www.gitignore.io/api/python
### Python ###
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
#Pipenv
Pipfile
Pipfile.lock
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
target/
# Jupyter Notebook
.ipynb_checkpoints
# pyenv
.python-version
# celery beat schedule file
celerybeat-schedule.*
# SageMath parsed files
*.sage.py
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
# End of https://www.gitignore.io/api/python
# Other
*.p
*.txt
*.db
files/

674
SmearcarDB/LICENSE Normal file
View File

@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

2
SmearcarDB/README.md Normal file
View File

@ -0,0 +1,2 @@
# smearcar-db
Smearcar-db is an online database which compares languages and the relative frequencies of their component phonemes. This information can be referenced through the provided sources. The database can be downloaded for further analysis using the "Database and Files" tab. This website is licensed under the GNU GPLv3 license and its source can be found at [Github](https://github.com/yamanq/smearcar-db').

2000
SmearcarDB/phoible Normal file

File diff suppressed because it is too large Load Diff

392
SmearcarDB/server.py Normal file
View File

@ -0,0 +1,392 @@
from flask import Flask
from flask import render_template, jsonify, request
from flask_sqlalchemy import SQLAlchemy
from numpy.polynomial.polynomial import polyfit
from numpy import corrcoef
import numpy as np
import tkinter
import matplotlib.pyplot as plt
from flask import send_file
import datetime
import os
from scipy import stats
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///data.db'
app.config.update(
DEBUG=True,
TEMPLATES_AUTO_RELOAD=True
)
db = SQLAlchemy(app)
working_dir = os.path.dirname(__file__)
class Frequency(db.Model):
language_id = db.Column(db.Integer, db.ForeignKey('language.id'), primary_key=True)
phoneme_id = db.Column(db.Integer, db.ForeignKey('phoneme.id'), primary_key=True)
value = db.Column(db.Float(6), nullable=False)
phoneme = db.relationship('Phoneme')
class Language(db.Model):
id = db.Column(db.Integer, primary_key=True, autoincrement=True)
name = db.Column(db.String(100), nullable=False)
# source = db.Column(db.LargeBinary)
phonemes = db.relationship('Frequency')
class Phoneme(db.Model):
id = db.Column(db.Integer, primary_key=True, autoincrement=True)
name = db.Column(db.String(5), nullable=False, unique=True)
class Update(db.Model):
id = db.Column(db.Integer, primary_key=True, autoincrement=True)
author = db.Column(db.String(30), nullable=False)
title = db.Column(db.String(100), nullable=False)
content = db.Column(db.Text, nullable=False)
date = db.Column(db.DateTime, nullable=False,
default=datetime.datetime.now())
class Editor(db.Model):
id = db.Column(db.Integer, primary_key=True, autoincrement=True)
authority = db.Column(db.Integer, nullable=False, default=1)
# 0: Full Access
# 1: Below + create Updates
# 2: Edit values and Add files
# 3: No Access
username = db.Column(db.String(32), nullable=False)
password = db.Column(db.String(32), nullable=False)
def rand_jitter(arr):
stdev = .01*(max(arr)-min(arr))
return arr + np.random.randn(len(arr)) * stdev
def uniqueness(title="Figure 1"):
x = []
y = []
languages = Language.query.all()
for phoneme in Phoneme.query.all():
frequencies = Frequency.query.filter_by(phoneme_id=phoneme.id).all()
values = [x.value for x in frequencies]
x.append(len(frequencies) / len(languages))
y.append(sum(values) / len(frequencies))
print(corrcoef(x, y))
b, m = polyfit(x, y, 1)
plt.scatter(rand_jitter(x), y, s=7)
bestfit = [b + m * number for number in x]
plt.plot(x, bestfit, '-')
plt.xlabel("Phoneme Presence in Studied Languages")
plt.ylabel("Average Frequency / %")
plt.title(title)
plt.show()
def phoneme_rank(scatter=False, detail=1000, textOutput=False, title="Figure 2"):
speakers = {
'Spanish (Castillian)': 46.4,
'English (American)': 308.9,
'Spanish (American)': 435.7,
'Japanese': 128,
'German': 76,
'Arabic': 315,
'Mandarin': 909,
'Portuguese (Brazilian)': 194,
'French': 76.8,
'Hindi': 260,
'Polish': 40.3,
'Samoan': 0.40742,
'Kaiwa': 0.0021,
'Bengali': 243,
'Swedish': 12.8,
'Malay': 60.7,
'Italian': 64.8
}
total = sum(speakers.values())
calculation = sorted([(phoneme.name, sum([frequency.value * speakers[Language.query.filter_by(id=frequency.language_id).first().name] / (total * len(Language.query.filter_by(name=Language.query.filter_by(id=frequency.language_id).first().name).all()) ) for frequency in Frequency.query.filter_by(phoneme_id=phoneme.id).all()])) for phoneme in Phoneme.query.limit(detail).all()], key=lambda x:-x[1])
labels, data = zip(*calculation)
if textOutput:
return labels
if scatter:
plt.yscale("log")
plt.plot(range(len(data)), data)
else:
plt.bar(range(len(data)), data)
plt.xlabel("Phoneme Rank")
plt.ylabel("Frequency weighted by Number of Speakers / %")
plt.title(title)
plt.show()
def phoible_compare():
# lang_id = Language.query.filter_by(name=lang).first().id
with open("phoible", "r") as f:
phoible = f.read().splitlines()
phonemes = [phoneme.name for phoneme in Phoneme.query.all()]
return [x for x in phoible if x in phonemes]
def rank_compare(textOutput=True, title="Rank Comparison"):
phoible = phoible_compare()
original = phoneme_rank(textOutput=True)
phoible_ranks = list(range(len(phoible)+1))[1:]
original_ranks = [original.index(phoneme) + 1 for phoneme in phoible]
if textOutput:
return {"kendall": stats.kendalltau(phoible_ranks, original_ranks),
"spearman": stats.spearmanr(phoible_ranks, original_ranks),
"wilcoxon": stats.wilcoxon(phoible_ranks, original_ranks, zero_method="pratt")}
plt.scatter(phoible_ranks, original_ranks)
plt.xlabel("Phoible Rank")
plt.ylabel("Weighted Rank")
plt.title(title)
plt.show()
def database():
final = {'values': []}
final['languages'] = [f.name for f in Language.query.order_by(Language.name).all()]
final['phonemes'] = [f.name for f in Phoneme.query.all()]
for language in Language.query.order_by(Language.name).all():
languageobject = {'id': language.id,
'name': language.name,
# 'source': language.source,
'phonemes': {}}
for frequency in language.phonemes:
languageobject['phonemes'][frequency.phoneme.name] = frequency.value
final['values'].append(languageobject)
return final
def check_privelege(doer, privelege):
if Editor.query.filter_by(username=doer['username'], password=doer['password']).first().authority <= privelege:
return True
else:
return False
def phoneme_add(info):
"""Add or edit value associated with phoneme."""
# info = {
# language_id: language_id,
# phoneme: phoneme_name,
# value: phoneme_value
# }
phoneme = Phoneme.query.filter_by(name=info['phoneme']).first()
language = Language.query.filter_by(id=info['language_id']).first()
if not phoneme:
phoneme = Phoneme(name=info['phoneme'])
db.session.add(phoneme)
link = Frequency.query.filter_by(
language_id=language.id,
phoneme_id=phoneme.id).first()
if not link:
link = Frequency(value=info['value'])
link.phoneme = phoneme
language.phonemes.append(link)
db.session.add(link)
else:
link.value = info['value']
def phoneme_remove(info):
"""Remove a phoneme from a language."""
# info = {
# language_id: language_id,
# phoneme: phoneme_name
# }
phoneme = Phoneme.query.filter_by(name=info['phoneme']).first()
language = Language.query.filter_by(id=info['language_id']).first()
frequency = Frequency.query.filter_by(
phoneme_id=phoneme.id, language_id=info['language_id']).first()
if Frequency.query.filter_by(phoneme_id=phoneme.id).count() == 1:
# Delete phoneme
db.session.delete(phoneme)
language.phonemes = [frequency for frequency in language.phonemes
if frequency.phoneme_id != phoneme.id]
db.session.delete(frequency)
def language_name_edit(info):
"""Edit the name of a Language."""
# info = {
# language_id: language_id,
# language_name: name
# }
language = Language.query.filter_by(id=info['language_id']).first()
language.name = info['language_name']
# def language_source_add(info):
# """Add or replace a source"""
# # info = {
# # language_id: language_id,
# # language_source = source
# # }
# language = Language.query.filter_by(id=info['language_id']).first()
# language.source = info['language_source']
patch_functions = {
"phoneme_add": phoneme_add, # Add and edit value
"phoneme_remove": phoneme_remove, # Remove association and/or phoneme
"language_name_edit": language_name_edit, # Change language name
# "language_source_add": language_source_add # Add/edit source
}
# Render the client at the default URL
@app.route("/")
def initial():
return render_template('index.html')
# GET method for files
@app.route("/server/<lang_id>", methods=["GET"])
def file_return(lang_id):
extensions = dict(x.split(".") for x in os.listdir("files/"))
try:
return send_file('files/' + lang_id+"."+extensions[str(lang_id)])
except Exception as e:
return str(e)
# POST files
@app.route("/source", methods=["POST"])
def source_add():
"""Add or replace a source"""
if check_privelege({
"username": request.form["username"],
"password": request.form["password"]
}, 2):
f = request.files['file']
write_path = os.path.join(working_dir, "files", request.form['lang_id']+"."+f.filename.split(".")[-1])
# with open(write_path, 'w') as a:
# a.write()
f.save(write_path)
return "nice"
return "Error"
# Add and Edit data
@app.route("/server", methods=["GET", "POST", "PATCH"])
def backend():
# # GET method returns the latest database
# if request.method == "GET":
# return jsonify(database())
# POST method appends input to database['values']
if request.method == "POST":
received = request.get_json()
if check_privelege(received['editor'], 2):
language = Language(name=received['name'])
db.session.add(language)
for phoneme, value in received['phonemes'].items():
with db.session.no_autoflush:
search = Phoneme.query.filter_by(name=phoneme).first()
if not search:
search = Phoneme(name=phoneme)
db.session.add(search)
link = Frequency(value=value, phoneme=search)
language.phonemes.append(link)
db.session.add(link)
db.session.commit()
# return jsonify(database())
# PATCH method inputs edited language and returns updated database
elif request.method == "PATCH":
received = request.get_json()
if check_privelege(received['editor'], 2):
patch_functions[received['action']](received['data'])
db.session.commit()
return jsonify(database())
# Manipulate Updates
@app.route("/updates", methods=["GET", "POST", "PATCH"])
def updates():
if request.method == "POST":
received = request.get_json()
if check_privelege(received['editor'], 1):
update = Update(author=received['author'],
title=received['title'],
content=received['content'])
db.session.add(update)
elif request.method == "PATCH":
received = request.get_json()
if check_privelege(received['editor'], 1):
update = Update.query.filter_by(id=received['id']).first()
update.name = received['author']
update.title = received['title']
update.content = received['content']
db.session.commit()
return jsonify([{"author": update.author,
"id": update.id,
"title": update.title,
"content": update.content,
"date": update.date.strftime("%m/%d/%Y | %A, %B %d, %Y")}
for update in Update.query.all()])
# Manipulate Editor
@app.route("/editors", methods=["POST"])
def editors():
if request.method == "POST":
received = request.get_json()
if Editor.query.filter_by(username=received['username']).count() == 0 and check_privelege(received['editor'], 0):
user = Editor(authority = received['authority'],
username = received['username'],
password = received['password'])
db.session.add(user)
db.session.commit()
return "Success"
else:
return "Bad Request"
else:
return "Bad Request"
@app.route("/directory", methods=["GET","POST"])
def directory():
rootDir = "directory/"
if request.method == "GET":
return jsonify({"dir": rootDir})
if request.method == "POST":
received = request.get_json()
files = []
for filename in os.listdir(received["path"]):
file = {}
filedir = received["path"]+filename
isdir = os.path.isdir(filedir)
file["name"] = filename
file["date"] = datetime.datetime.fromtimestamp(os.path.getmtime(filedir)).strftime("%B %d, %Y")
if(isdir):
file["size"] = "- - - -"
file["folder"] = "true"
else:
file["size"] = sizeof_fmt(os.path.getsize(filedir))
file["folder"] = "false"
files.append(file)
return jsonify(files)
def sizeof_fmt(num, suffix='B'):
for unit in ['','K','M','G','T','P','E','Z']:
if abs(num) < 1024.0:
return "%3.1f%s%s" % (num, unit, suffix)
num /= 1024.0
return "%.1f%s%s" % (num, 'Yi', suffix)
@app.route("/directory/<path:file>", methods=["GET"])
def dir_download(file):
print(file)
return send_file(file)
if __name__ == "__main__":
app.run(host="0.0.0.0")

10
SmearcarDB/static/Chart.min.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

545
SmearcarDB/static/index.css Normal file
View File

@ -0,0 +1,545 @@
html {
height: 100%;
width: 100%;
}
body {
display: grid;
height: 100%;
overflow: hidden;
padding: 0;
margin: 0;
color: white;
font-family: 'Open Sans Condensed', sans-serif;
grid-template-columns: 15% auto;
grid-template-rows: 8% auto;
}
h1, h2, h3, h4, h5, p {
margin: 0;
}
a {
text-decoration: none;
color: #2EA8FF;
}
.transition {
-webkit-transition: all 0.3s cubic-bezier(.25, .8, .25, 1);
transition: all 0.3s cubic-bezier(.25, .8, .25, 1);
-moz-transition: all 0.3s cubic-bezier(.25, .8, .25, 1);
-ms-transition: all 0.3s cubic-bezier(.25, .8, .25, 1);
}
#header1 {
display: grid;
background-color: #F47922;
text-align: center;
grid-column: 1;
grid-row: 1;
cursor: pointer;
}
#header1 h1 {
margin: auto 0 auto 0;
font-size: 4vh;
font-weight: 300;
}
#header1:hover {
background-color: #F88A3C;
}
#header2 {
background-color: #524948;
grid-column: 2;
grid-row: 1;
}
#sidebar {
background-color: #524948;
grid-column: 1;
grid-row: 2;
}
.navi {
display: grid;
height: 6vh;
width: 100%;
cursor: pointer;
grid-template-columns: 1fr 3fr 7fr;
}
.navi:hover {
background-color: rgba(255, 255, 255, 0.1) !important
}
.navi i {
margin: auto 0 auto 0;
font-size: 2.1vh;
text-align: center;
grid-column: 2;
}
.navi p {
margin: auto 0 auto 0;
font-size: 2vh;
grid-column: 3;
}
#mainContainer {
overflow-y: auto;
padding: 2vh;
background-color: #F8F3F0;
font-family: 'Saira Condensed', sans-serif;
grid-column: 2;
grid-row: 2;
}
.dropdown {
position: relative;
display: grid;
border-left: 5px solid #F88A3C;
background-color: rgba(0, 0, 0, 0.05);
grid-template-columns: 100%;
grid-template-rows: auto 0%;
cursor: pointer;
}
.dropdown:hover {
background-color: rgba(0, 0, 0, 0.1)
}
.dropdown .button {
display: grid;
padding-left: 2%;
margin: auto 0 auto 0;
font-size: 2.7vh;
grid-column: 1;
grid-row: 1;
grid-template-columns: 14fr 1fr;
grid-template-rows: 100%;
}
.dropdown .button p {
font-weight: 300;
grid-column: 1;
grid-row: 1;
}
.dropdown .button i {
margin: auto 0 auto 0;
grid-column: 2;
grid-row: 1;
}
.dropdown .opCont {
position: absolute;
opacity: 0;
display: none;
width: 100%;
border-radius: 2px;
background-color: #FEFEFE;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
grid-column: 1;
grid-row: 2;
overflow-y: auto;
max-height: 30vh;
}
.dropdown .opCont p {
padding: 2% 0 2% 4%;
font-size: 2.3vh;
}
.dropdown .opCont p:hover {
background-color: rgba(0, 0, 0, 0.1);
}
#home, #dataValues1, #dataValues2, #files, #about {
display: none;
height: 100%;
width: 100%;
opacity: 0;
transition: opacity 0.3s cubic-bezier(.25, .8, .25, 1);
grid-gap: 2vh;
}
#home {
display: block;
opacity: 1;
}
#home > div {
margin-bottom: 2vh;
}
.card {
display: grid;
border-radius: 2px;
background-color: #FEFEFE;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
color: black;
transition: all 0.3s cubic-bezier(.25,.8,.25,1);
grid-template-columns: 35% auto 50%;
grid-template-rows: 6vh auto;
}
.card:hover {
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
}
.card > h2 {
margin: auto 0 auto 2vh;
font-size: 2.8vh;
font-weight: 300;
border-bottom: 1px solid #D5D5D5;
grid-column: 1;
grid-row: 1;
}
.card > h3 {
margin: auto 10% auto 0;
font-weight: 300;
font-size: 1.8vh;
grid-column: 3 / 5;
grid-row: 1;
margin: auto 2vh auto 0;
text-align: right;
font-weight: 300;
}
.card > div {
grid-column: 1 / 4;
grid-row: 2;
}
.card > p {
margin: 2vh 2vh 2vh 4vh;
font-size: 2.2vh;
font-weight: 300;
grid-column: 1 / 4;
grid-row: 2;
}
.row {
display: grid;
grid-template-columns: 1fr 1fr;
grid-template-rows: 100%;
grid-gap: 2vh;
}
#dataValues1 > div, #dataValues2 > div {
margin-bottom: 2vh;
}
#dataValues1 .row, #dataValues2 .row {
height: 20%;
}
#dataValues1 #dataTable, #dataValues2 #dataTable2 {
height: 42%;
}
#dataTableCont {
height: 40%;
}
#dataTableCont2 {
height: 45%;
}
#dataTable2{
height: 50% !important;
}
#dataTable, #dataTable2 {
grid-template-columns: 90fr 10fr;
}
#langSelect, #phonemeSelect {
grid-column: 1;
grid-row: 1;
grid-template-columns: 35% auto 20%;
}
#langSelect .dropdown, #phonemeSelect .dropdown {
height: 50%;
width: 85%;
margin: auto 0 auto 5%;
}
#flipMode1, #flipMode2 {
grid-column: 3;
grid-row: 1;
cursor: pointer;
text-align: right;
display: grid;
grid-template-columns: auto 40%;
grid-template-rows: 1fr;
background-color: rgba(0, 0, 0, 0);
}
#flipMode1:hover, #flipMode2:hover {
background-color: rgba(0, 0, 0, 0.05);
}
#flipMode1 p, #flipMode2 p {
font-size: 2vh;
margin: auto 0 auto auto;
vertical-align: middle;
display: inline-block;
grid-column: 1;
grid-row: 1;
pointer-events: none;
}
#flipMode1 .fa, #flipMode2 .fa {
margin: auto auto auto 30%;
font-size: 3vh;
grid-column: 2;
grid-row: 1;
pointer-events: none;
}
#dataInfo, #dataInfo2 {
grid-column: 2;
grid-row: 1;
}
#langInfoCont, #phonemeInfoCont {
display: grid;
font-weight: 300;
font-size: 2.5vh;
margin: auto 0 auto 4vh;
}
#dataTableCont, #dataTableCont2 {
display: grid;
font-weight: 300;
grid-template-columns: repeat(4, 1fr);
grid-template-rows: 100%;
grid-gap: 2vh;
padding: 2vh;
}
#dataTableCont div, #dataTableCont2 div {
display: grid;
grid-template-columns: repeat(2, 1fr);
grid-template-rows: repeat(8, 1fr);
}
#dataTableCont div p, #dataTableCont2 div p {
font-size: 2.2vh;
padding: 0 5% 0 5%;
}
#dataTableCont input, #dataTableCont2 input {
border: 1px solid rgba(0, 0, 0, 0.3);
font-size: 2vh;
width: 60%;
padding: 0;
font-family: 'Saira Condensed', sans-serif;
font-weight: 300;
}
#langGraph, #phonemeGraph {
display: block;
}
#langGraph canvas, #phonemeGraph canvas {
grid-column: 1;
grid-row: 1;
}
#editData {
display: grid;
grid-template-columns: 70% 30%;
grid-template-rows: 100%;
grid-column: 2;
grid-row: 1;
cursor: pointer;
font-size: 2vh;
}
#editData p, #editData i {
display: inline-block;
margin: auto;
grid-row: 1;
}
#editData:hover {
background-color: rgba(0, 0, 0, 0.05);
}
#header2 {
display:grid;
grid-template-columns: 60% 20% 10% 10%;
grid-template-rows: 100%;
}
#signIn, #addUserButton, #addUpdateButton {
display: grid;
grid-template-columns: 70% 20%;
grid-template-rows: 100%;
grid-column: 4;
grid-row: 1;
cursor: pointer;
}
#addUpdateButton {
grid-column: 3;
}
#signIn:hover, #addUserButton:hover, #addUpdateButton:hover, #writePostButton:hover {
background-color: rgba(255,255,255,0.1);
}
#signIn p, #signIn i, #addUserButton p, #addUserButton i, #addUpdateButton p, #addUpdateButton i {
margin: auto;
font-size: 180%;
}
#addData, #editData, #addUserButton, #addUpdateButton {
display: none;
}
.modal {
position: absolute;
width: 100%;
height: 100%;
display: none;
opacity: 0;
background-color: rgba(0,0,0,0.4);
}
.modalSubmit {
display: block;
width: 70%;
font-size: 3vh;
margin: auto;
padding: 1%;
text-align: center;
cursor: pointer;
}
.modal input, .modal textarea {
margin: 0 auto 0 auto;
border: 0;
background-color: rgba(0,0,0,0.1);
font-family: 'Saira Condensed', sans-serif;
font-size: 100%;
font-weight: 300;
padding: 1vh;
width: 90%;
outline: none;
resize: none;
}
#headerTitle {
font-size: 200%;
font-weight: 300;
margin: auto 3% auto;
font-family: 'Saira Condensed', sans-serif;
}
#directory p {
font-size: 150%;
padding: 1.5vh 2vh 1.5vh 2vh;
}
#directoryHeader {
height: 10%;
display: grid;
grid-template-columns: 70% 15% 10% 5%;
grid-template-rows: 100%;
color: black;
background-color: white;
}
#directoryHeader p {
display: grid;
cursor: pointer;
grid-template-columns: 19fr 1fr;
grid-template-rows: 100%;
padding: 2.3vh;
}
#directoryHeader p:hover {
background-color: rgba(0,0,0,0.1);
}
#directoryHeader i {
margin: auto;
display: none;
opacity: 0;
}
#directoryCont {
overflow-y: auto;
}
.item {
display: grid;
cursor: pointer;
grid-template-columns: 70% 15% 10% 5%;
grid-template-rows: 100%;
margin: 1vh 0 1vh 0;
}
.item p {
pointer-events: none;
}
.item a {
grid-column: 4;
grid-row: 2;
margin: auto;
font-size: 140%;
}
.item a:hover {
color: #F47922;
}
#directoryLocation {
height: 10%;
margin-bottom: 2vh;
opacity: 0;
display: block;
}
#directoryLocation p {
padding: 0.5vh;
margin: 1vh 1.5vh 1vh 1.5vh;
border-radius: 5px;
display: inline-block;
}
#directoryLocation i {
font-size: 150%;
}
#directoryHeader .name, .item .name {
grid-column: 1;
}
#directoryHeader .date, .item .modified {
grid-column: 2;
}
#directoryHeader .size, .item .size {
grid-column: 3;
}
#directoryHeader p, .item p {
margin: 0;
}
.subdir:hover {
background-color: rgba(0,0,0,0.1);
}

1311
SmearcarDB/static/index.js Normal file

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

View File

@ -0,0 +1,127 @@
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<title>SmearcarDB</title>
<link rel="icon" href="/static/resources/favicon.ico?v=2">
<link rel="stylesheet" href="{{ url_for('static', filename='index.css') }}">
<link href="https://fonts.googleapis.com/css?family=Open+Sans+Condensed:300" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Saira+Condensed:300,400" rel="stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="{{ url_for('static', filename='Chart.min.js') }}"></script>
<script src="https://use.fontawesome.com/c8d5486cd8.js"></script>
<!-- <script src="https://trello.com/1/client.js?key=dd3d6b561fe1a0abcacdc80ad0c4fd9a"></script> -->
</head>
<body>
<div id="header1" class="transition" onclick="updateMain('home');">
<h1>/'smi:ɹ̠ka:ɹ̠/</h1>
</div>
<div id="header2">
<h2 id="headerTitle"></h2>
<div id="addUpdateButton" class="transition">
<p>Update</p>
<i class="fa fa-edit"></i>
</div>
<div id="signIn" class="transition">
<p>Login</p>
<i class="fa fa-sign-in"></i>
</div>
<div id="addUserButton" class="transition">
<p>Add User</p>
<i class="fa fa-plus"></i>
</div>
</div>
<div id="sidebar">
</div>
<div id="mainContainer">
<div id="home" class="optionContainer">
</div>
<div id="dataValues1" class="optionContainer">
<div class="row">
<div id="langSelect" class="card">
<h2>Language</h2>
<div id="flipMode1" class="transition">
<p>Phoneme</p>
<i class="fa fa-angle-double-right"></i>
</div>
<div option="langSelect" class="dropdown transition">
</div>
</div>
<div id="dataInfo" class="card">
<h2>Info</h2>
<div id="langInfoCont" class="transition">
</div>
</div>
</div>
<div id="dataTable" class="card">
<h2>Data</h2>
<div id="editData" class="transition">
<p>Edit Language</p>
<i class="fa fa-edit"></i>
</div>
<div id="dataTableCont" class="transition">
</div>
</div>
<div id="langGraph" class="card">
<canvas class="transition"></canvas>
</div>
</div>
<div id="dataValues2" class="optionContainer">
<div class="row">
<div id="phonemeSelect" class="card">
<h2>Phoneme</h2>
<div id="flipMode2" class="transition">
<p>Language</p>
<i class="fa fa-angle-double-right"></i>
</div>
<div option="phonemeSelect" class="dropdown transition">
</div>
</div>
<div id="dataInfo2" class="card">
<h2>Info</h2>
<div id="phonemeInfoCont" class="transition">
</div>
</div>
</div>
<div id="dataTable2" class="card">
<h2>Data</h2>
<div id="dataTableCont2" class="transition">
</div>
</div>
</div>
<div id="files" class="optionContainer">
<div id="directory">
<div id="directoryLocation" class="card transition">
<p>Database</p>
</div>
<div id="directoryHeader" class="card transition">
<p class="name transition">Name
<i class="fa fa-chevron-down transition"></i>
<i class="fa fa-chevron-up transition"></i>
</p>
<p class="date transition">Date Modified
<i class="fa fa-chevron-down transition"></i>
<i class="fa fa-chevron-up transition"></i>
</p>
<p class="size transition">Size
<i class="fa fa-chevron-down transition"></i>
<i class="fa fa-chevron-up transition"></i>
</p>
</div>
<div id="directoryCont"></div>
</div>
</div>
<div id="about" class="optionContainer">
<div class="card">
<h2>About</h2>
<p>Smearcar-db is an online database which compares languages and the relative frequencies of their component phonemes. This information can be referenced through the provided sources. The database can be downloaded for further analysis using the "Database and Files" tab. This website is licensed under the GNU GPLv3 license and its source can be found at <a href="https://github.com/yamanq/smearcar-db.git" target="_blank">Github</a>.</p>
</div>
</div>
</div>
</body>
<script src="{{ url_for('static', filename='index.js') }}"></script>
</html>

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:36bc1106e3b1c642ebae6da49a6e78b507dab2c627671f5262a9aaaf87cd6b0f
size 12323956

621
atoms/LICENSE Normal file
View File

@ -0,0 +1,621 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS

8
atoms/README.md Normal file
View File

@ -0,0 +1,8 @@
# Atoms
Atoms is a web app that displays atoms and simple bonding in a cute and fun way
A live demo is available at: http://atoms.cf
# License
GNU GPL V3
See LICENSE for more details.

495
atoms/index.css Normal file
View File

@ -0,0 +1,495 @@
@import url(https://fonts.googleapis.com/css?family=Oswald);
/* Let's get this party started */
::-webkit-scrollbar {
width: 12px;
}
/* Track */
::-webkit-scrollbar-track {
-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
-webkit-border-radius: 5px;
border-radius: 5px;
}
/* Handle */
::-webkit-scrollbar-thumb {
-webkit-border-radius: 5px;
border-radius: 5px;
background: rgba(0,0,0,0.7);
-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.5);
}
::-webkit-scrollbar-thumb:window-inactive {
background: rgba(0,0,0,0.4);
}
html {
-webkit-touch-callout: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
body {
background-image: url("./resources/static/light.png");
overflow: hidden;
font-family: Oswald;
font-size: 100%;
margin: 0;
cursor: default;
-webkit-transition: background-image ease-in 0.5s;
-moz-transition: background-image ease-in 0.5s;
-ms-transition: background-image ease-in 0.5s;
transition: background-image ease-in 0.5s;
}
p {
margin-bottom: 1%;
}
input {
font-family: Oswald;
}
.periodictable {
color: #000;
width:50px;
height: 65px;
padding:0;
margin:0;
text-align: center;
-webkit-transition: box-shadow 0.3s ease;
-moz-transition: box-shadow 0.3s ease;
-ms-transition: box-shadow 0.3s ease;
transition: box-shadow 0.3s ease;
}
.atom:hover {
box-shadow:inset 0 0 0 99999px rgba(0,0,0,0.2);
}
.atomvalue {
font-size: 65%;
margin: 0;
padding: 0;
}
.oxid {
margin: 0;
display: inline-block;
}
.oxidStat {
margin-top: 0;
display: inline-block;
}
.oxid:first-letter {
font-size: 175% !important;
}
.common {
-webkit-filter: drop-shadow(4px 4px 3px #010);
filter: drop-shadow(4px 4px 3px #010);
}
img {
-webkit-filter: drop-shadow(4px 4px 3px #444);
filter: drop-shadow(4px 4px 3px #444);
}
.desc {
font-size:110%;
display: inline-block;
margin-right: 3%;
margin-top: 0;
height:10%;
}
.setting {
display: flex;
position: relative;
height:100%;
width:100%;
margin-left: 4%;
margin-bottom: 10%;
}
.option {
position: relative;
display: inline-block;
font-size: 130%;
margin-top : -2%;
}
.selection {
margin-top: -5%;
padding: 4px;
box-shadow:inset 0 0 0 99999px rgba(0,0,0,0.2);
margin-top: 0;
-webkit-transition: box-shadow 0.3s ease, color 0.7s ease;
-moz-transition: box-shadow 0.3s ease, color 0.7s ease;
-ms-transition: box-shadow 0.3s ease, color 0.7s ease;
transition: box-shadow 0.3s ease, color 0.7s ease;
}
.selection:hover {
cursor: pointer;
box-shadow: inset 0 0 0 99999px rgba(0,0,0,0.1);
}
.dropdown {
display: none;
opacity: 0;
position: absolute;
box-shadow: 4px 4px 3px #444;
z-index: 50;
-webkit-transition: opacity 0.3s ease;
-moz-transition: opacity 0.3s ease;
-ms-transition: opacity 0.3s ease;
transition: opacity 0.3s ease;
}
.dropdown p {
color: black;
margin:0;
background-color:#fff;
padding: 12px 16px;
text-decoration: none;
display: block;
-webkit-transition: background-color 0.3s ease, opacity 0.3s ease;
-moz-transition: background-color 0.3s ease, opacity 0.3s ease;
-ms-transition: background-color 0.3s ease, opacity 0.3s ease;
transition: background-color 0.3s ease, opacity 0.3s ease;
}
.dropdown p:hover {
background-color:#CECDCD;
}
.tDesc {
padding: 0;
margin: 0;
text-align: center;
font-size: 150%;
}
.pulltab {
position: fixed;
margin-left: -6%;
padding: 0.5%;
width: 6.2%;
height: 4%;
background-color: #b3daff;
box-shadow: 2px 2px 5px 3px #333;
cursor: pointer;
-webkit-transition: transform 0.2s ease, margin 0.3s ease, color 0.4s ease;
-moz-transition: transform 0.2s ease, margin 0.3s ease, color 0.4s ease;
-ms-transition: transform 0.2s ease, margin 0.3s ease ,color 0.4s ease;
transition: transform 0.2s ease, margin 0.3s ease, color 0.4s ease;
}
.pulltab:hover {
margin-left: 0%;
}
.first {
margin-top:5%;
}
.second {
margin-top: 12%;
}
.third {
margin-top: 19%;
}
.sidebar {
position: absolute;
background-color: #e6f5ff;
min-height: 100%;
padding: 15px 20px 15px 15px;
box-shadow: 2px 2px 5px 3px #333;
z-index:5;
overflow-x: hidden;
overflow-y: auto;
-webkit-transition: margin 0.5s ease, background-color 0.5s ease;
-moz-transition: margin 0.5s ease, background-color 0.5s ease;
-ms-transition: margin 0.5s ease, background-color 0.5s ease;
transition: margin 0.5s ease, background-color 0.5s ease;
}
.elements {
margin-left: -150%;
height:100%;
padding-right: 10px;
}
.settings {
margin-left: -40%;
width: 20%;
}
.tools {
margin-left: -170%;
height: 100%;
width: 90%;
}
.atom {
cursor: pointer;
}
.fa {
float: right;
font-size: 250% !important;
color: #585858;
margin: 0 1% 3% 1%;
cursor: pointer;
-webkit-transition: color 0.5s ease;
-moz-transition: color 0.5s ease;
-ms-transition: color 0.5s ease;
transition: color 0.5s ease;
}
.fa:hover {
color: #FF746B;
}
.tabletitle {
text-align: center;
}
.key {
margin-left: 18%;
margin-bottom: -20%;
margin-top: 15%;
}
.keycolor {
width: 20px;
height: 25px;
}
.keyvalue {
line-height: 1em;
height: 5%;
padding-right: 2.5%;
text-align: left;
}
#keylegend {
position: absolute;
top: 16%;
}
.legendholder {
position:absolute;
top: 16%;
left: 35%;
z-index: -1;
}
.legend {
border-collapse: collapse;
max-width: 55%;
}
.legendcell {
width: 2px;
height: 25px !important;
}
.legendrangeval {
display: flex;
}
.minlegend {
position: relative;
right:3%;
bottom:10;
}
.maxlegend {
position: relative;
left: 43%;
bottom:50;
}
.normal {
border: 1px hidden;
margin: 3%;
}
.extension {
border: 1px hidden;
margin-top:3%;
margin-left: 10%;
}
.infoBox {
margin-bottom: 5%;
display: flex;
cursor: text;
-webkit-touch-callout: text;
-webkit-user-select: text;
-moz-user-select: text;
-ms-user-select: text;
user-select: text;
}
.preview {
margin: 3%;
}
.info1, .info2 {
margin: 3%;
}
.info1 {
width: 25%;
}
.info2 {
width: 33%;
}
.sh {
margin-top: 32%;
text-align:center;
font-size:300%;
color:#fff;
text-shadow: 4px 4px 5px #444;
}
.help {
padding: 1px 1px 5px 2px;
margin-right: 3%;
text-align:center;
width: 20px;
height: 20px;
box-shadow:inset 0 0 0 99999px rgba(0,0,0,0.2);
-webkit-transition: box-shadow 0.3s ease;
-moz-transition: box-shadow 0.3s ease;
-ms-transition: box-shadow 0.3s ease;
transition: box-shadow 0.3s ease;
}
.help:hover {
box-shadow: inset 0 0 0 99999px rgba(0,0,0,0.1);
}
.helptab {
position:absolute;
display: none;
opacity: 0;
top: 80%;
margin-left: -8%;
border-left: 10px solid transparent;
border-right: 10px solid transparent;
border-bottom: 17px solid #fefefe;
-webkit-filter: drop-shadow(4px 0px 3px #444);
filter: drop-shadow(4px 0px 3px #444);
-webkit-transition: opacity 0.3s ease;
-moz-transition: opacity 0.3s ease;
-ms-transition: opacity 0.3s ease;
transition: opacity 0.3s ease;
}
.helptext {
position:absolute;
display: none;
opacity: 0;
border-radius: 7px;
top: 102%;
margin-left: -12%;
padding: 5px;
font-size: 90%;
color: #000;
background-color: #fefefe;
box-shadow: 4px 4px 3px #444;
z-index:60;
-webkit-transition: opacity 0.3s ease;
-moz-transition: opacity 0.3s ease;
-ms-transition: opacity 0.3s ease;
transition: opacity 0.3s ease;
}
.about {
position: absolute;
bottom: 3%;
max-width: 70%;
margin-left: 3.5%;
font-size: 110%;
}
.github {
font-size: 120%;
color: #23527C;
text-decoration: none;
-webkit-transition: color 0.3s ease;
-moz-transition: color 0.3s ease;
-ms-transition: color 0.3s ease;
transition: color 0.3s ease;
}
.github:hover {
text-decoration: none;
color: #69CBE4;
}
.realAtom {
cursor: pointer;
}
.eye {
-webkit-animation: updown 1.3s infinite alternate ease;
animation: updown 1.3s infinite alternate ease;
}
#balancebutton {
width: 10%;
font-size: 175%;
margin-right: 3%;
padding: .5%;
text-align:center;
box-shadow:inset 0 0 0 99999px rgba(0,0,0,0.2);
-webkit-transition: box-shadow 0.3s ease;
-moz-transition: box-shadow 0.3s ease;
-ms-transition: box-shadow 0.3s ease;
transition: box-shadow 0.3s ease;
}
#balancebutton:hover {
box-shadow: inset 0 0 0 99999px rgba(0,0,0,0.1);
}
.balanceout {
text-align: center;
width: 15%;
height: 4%;
font-size: 110%;
}
@-webkit-keyframes updown {
0% { transform: translateY(0px); }
100% { transform: translateY(-4px); }
}
@keyframes updown {
0% { transform: translateY(0px); }
100% { transform: translateY(-4px); }
}

132
atoms/index.html Normal file
View File

@ -0,0 +1,132 @@
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<title>Atoms</title>
<link rel="icon" href="./resources/static/favicon.ico">
<link rel="stylesheet" href="./index.css">
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.4.0/css/font-awesome.min.css">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
</head>
<body>
<div class="pulltab first"><p class="tDesc">Elements</p></div>
<div class="sidebar elements">
<i class="fa fa-close"></i>
<div class="titleholder"></div>
<div class="key">
<div class="legendholder"></div>
</div>
</div>
<div class="pulltab second"><p class="tDesc">Tools</p></div>
<div class="sidebar tools">
<i class="fa fa-close"></i>
<form>
Reactants:
<input type="text" class="reactant">
Products:
<input type="test" class="product">
</form>
<p id="balancebutton">Balance!</p>
<div class="balanceholder"><input type="text" class="balanceout" readonly></div>
</div>
<div class="pulltab third"><p class="tDesc">Settings</p></div>
<div class="sidebar settings">
<i class="fa fa-close"></i>
<div class="setting">
<div class="help">?</div>
<div class="helptab"></div>
<div class="helptext">Change the color scheme</div>
<p class="desc">Background Theme:</p>
<div class=option id="theme"></div>
</div>
<div class="setting">
<div class="help">?</div>
<div class="helptab"></div>
<div class="helptext">Change the colors of the Periodic Table and the Atoms</div>
<p class="desc">Display Theme:</p>
<div class=option id="displayTheme"></div>
</div>
<div class="setting">
<div class="help">?</div>
<div class="helptab"></div>
<div class="helptext">Change the style of electron configuration</div>
<p class="desc">Electron Configuration:</p>
<div class=option id="elecConf"></div>
</div>
<div class="setting">
<div class="help">?</div>
<div class="helptab"></div>
<div class="helptext">Change the units for temperature</div>
<p class="desc">Units:</p>
<div class=option id="unit"></div>
</div>
<div class='about'>
<p>Developed by Kenneth Jao and Yaman Qalieh</p>
<a class="github" target="_blank" href="https://github.com/ksjdragon/atoms">Github</a>
</div>
</div>
<div class="workspace"></div>
</body>
<script type='text/javascript'>
var settings = {}; //settings[theme] will return the current setting
var info; // JSON file
var options = ["theme","displayTheme","elecConf","unit"];
var ranges = {}; //ranges[theme][0] is min [1] is max [2] is range
var elementCount = 118; // Number of elements
var lastElement;
var choices = [ //Keep these in the same order as options
["light","dark"],
["category", "atomRadi", "moleWeig", "ioniEner", "elecAffi", "elecNega", "density", "melting", "boiling"],
["abr","norm"],
["K","C","F"]
];
var choicesDisplay = [ // Keep these in the same order as options
["Light","Dark"],
["Region", "Atomic Radius", "Molecular Mass", "Ionization Energy", "Electron Affinity", "Electronegativity", "Density", "Melting Point", "Boiling Point"],
["Abbreviated","Full"],
["Kelvin","Celsius","Fahrenheit"]
];
var keyColors = [
{"Alkali Metals":'#8EF02B',"Alkali Earth Metals":"#D77A1D","Metalloids":"#387290","Non-metals":"#52BFF6","Halogens":"#4842E9","Noble Gases":"#7B1AE9","Transition Metals":"#E5D439","Post Transition Metals":"#2ADEA8","Lanthanides":"#F02BBC","Actinides":"#D78A8A"},
{"Unknown": "#41464d"},
{},
{"Unknown": "#41464d"},
{"Unknown": "#41464d"},
{"Unknown": "#41464d"},
{"Unknown": "#41464d"},
{"Unknown": "#41464d"},
{"Unknown": "#41464d"}
];
var colorChart = { //colorChart[theme][0] = most [1] = least
"category": {"al":'#8EF02B',"ae":"#D77A1D","md":"#387290","nm":"#52BFF6","ha":"#4842E9","ng":"#7B1AE9","tm":"#E5D439","bm":"#2ADEA8","lh":"#F02BBC","ac":"#D78A8A"},
"atomRadi": ["#151618", "#2C7BF2"],
"moleWeig": ["#151618", "#2C7BF2"],
"ioniEner": ["#E2DC27", "#5535D4"],
"elecAffi": ["#E2DC27", "#5535D4"],
"elecNega": ["#E2DC27","#5535D4"],
"density": ["#151618", "#2C7BF2"],
"melting": ["#D7301E", "#69F2F2"],
"boiling": ["#D7301E", "#69F2F2"]
};
var themeChart = { //themeChart[element][theme]
"pulltab": {'light': '#B3DAFF','dark': '#779550'},
"sidebar": {'light':'#E6F5FF','dark': '#7b925d'},
"font": {'light': 'rgb(0,0,0)', 'dark': 'rgb(254,254,254)'}
};
</script>
<script src="./js/tools.js"></script>
<script src="./js/onload.js"></script>
<script src="./js/update.js"></script>
<script src="./js/atom.js"></script>
<script src="./js/buttons.js"></script>
<script src="./js/main.js"></script>
</html>

265
atoms/js/atom.js Normal file
View File

@ -0,0 +1,265 @@
function tableDesc() {
var p = ["element","atomRadi","moleWeig","ioniEner","elecAffi","elecNega","phase","density","melting","boiling",
"oxidStat","elecConf"];
var unit = [""," pm"," g/mol", " kJ/mol"," kJ/mol", " eV", "", " g/mL", "",""];
var prefix = ["Element Name: ", "Atomic Radius: ", "Molecular Mass: ", "Ionization Energy: ", "Electron Affinity: ",
"Electronegativity: ", "Phase/State: ", "Density: ", "Melting Point: ", "Boiling Point: ",
"Oxidation State(s): ", "Electron Configuration: "];
var states = {"g":"Gas","l":"Liquid","s":"Solid","Unknown":"Unknown"};
// Setting up divs for organization
var infoBox = document.createElement("div");
infoBox.className = "infoBox";
get("elements").appendChild(infoBox);
var div = document.createElement("div");
div.className = "info1";
get("infoBox").appendChild(div);
var div2 = document.createElement("div");
div2.className = "info2";
get("infoBox").appendChild(div2);
for(var i = 0;i < p.length; i++) { // For all possible data types
elem = document.createElement("p");
elem.className = "eDesc " + p[i];
if(i <= 5) {
get("info1").appendChild(elem);
} else {
get("info2").appendChild(elem);
}
}
get("info2").appendChild(document.createElement("br"));
box = document.createElement("div");
box.className = "preview";
get("infoBox").appendChild(box);
var trans1 = get("periodictable")[92];
var trans2 = get("periodictable")[110];
trans1.style.backgroundColor = "#41484D";
trans2.style.backgroundColor = "#41484D";
trans1.appendChild(document.createTextNode("57 - 71"));
trans2.appendChild(document.createTextNode("89 - 103"));
trans1.style.fontSize = "90%";
trans2.style.fontSize = "90%";
// Creates 'reactivity' for each cell
for(var i = 0;i < elementCount;i++) {
var cell = get("td")[info["location"][i]]; // Gets location of each atom in order
cell.onclick = function() {
lastElement = this;
var index = parseInt(this.childNodes[0].childNodes[0].nodeValue-1);
for(var i = 0;i < p.length; i++) { // Loop through all data types to be displayed
if(i == 8 || i == 9) { // If data type is melting or boiling
if(info[p[i]][settings["unit"]][index] !== null) {
// Get prefix ex. Melting: + actual value + unit
if(settings["unit"] != "K") {
changeText(p[i],prefix[i] + info[p[i]][settings["unit"]][index] + "° " + settings["unit"]);
} else {
changeText(p[i],prefix[i] + info[p[i]][settings["unit"]][index] + " " + settings["unit"]);
}
} else { // If null
changeText(p[i],prefix[i] + "Unknown"); // Make unknown
}
} else {
if(info[p[i]][index] != null) { // If data type value isn't null
if(i == 6) { // If data type is phase/state
// Get prefix + value reference ex. 'g' -> 'Gas' + unit
changeText(p[i],prefix[i] + states[info[p[i]][index]] + unit[i]);
} else if(i == 10) { // If data type is oxidation states
var para = get("oxidStat");
// Remove all childs in oxidation state div
while (para.firstChild) {
para.removeChild(para.firstChild);
}
var allStates = info[p[i]][index];
var para1 = document.createElement("span");
para1.appendChild(document.createTextNode(prefix[i]));
para.appendChild(para1);
for(var j = 0;j < allStates.length; j++) { // For all states in array
oxidStat = allStates[j];
if(j == 6) { // Add new line to prevent overflow
para.appendChild(document.createElement("br"))
}
if(allStates[j].includes("b")) { // If value has b, make value different
oxidStat = allStates[j].substring(1);
var par = document.createElement("p");
par.appendChild(document.createTextNode(oxidStat));
par.className = "oxid common";
para.appendChild(par);
var par = document.createElement("span"); // Spans use inline block
par.className = "comma"
par.appendChild(document.createTextNode(", "))
para.appendChild(par);
} else {
var pa = document.createElement("p");
pa.appendChild(document.createTextNode(oxidStat));
pa.className = "oxid";
para.appendChild(pa);
pa = document.createElement("span"); // Spans use inline block
pa.className = "comma"
pa.appendChild(document.createTextNode(", "))
para.appendChild(pa);
}
}
para.removeChild(para.lastChild); // Remove last comma
} else if(i == 11) { // If data type is electron configuration
var para = get("elecConf");
// Remove all childs in electron configuration div
while (para.firstChild) {
para.removeChild(para.firstChild);
}
var elecConf = info[p[i]][index].split("."); // Ex. ["1s", "2", "2s", "2"]
para.appendChild(document.createTextNode(prefix[i]));
if(settings["elecConf"] == "abr") {
// Add 2 to get to next non superscript and subtract one to prevent undefined
for(var j = 0;j < elecConf.length-1; j+=2) {
para.appendChild(document.createTextNode(elecConf[j])); // Append electron level
// Append value for level in superscript
var sup = document.createElement("sup");
sup.appendChild(document.createTextNode(elecConf[j+1]));
para.appendChild(sup);
}
} else if(settings["elecConf"] == "norm") {
while(elecConf[0].includes("[")) { // Ex: [Xe]5s2
// Get ex. [Xe] configuration
otherConf = info[p[i]][info["shorthand"].indexOf(elecConf[0].substring(1,3))].split(".");
elecConf[0] = elecConf[0].substring(4); // [Xe]5s2 = 5s2
for(var j = otherConf.length-1; j >= 0; j--) {
// Put configuration of abbreviation in front of last configuration
elecConf.unshift(otherConf[j]);
}
}
// Add 2 to get to next non superscript and subtract one to prevent undefined
for(var j = 0;j < elecConf.length-1; j+=2) {
if(j == 20) { // Add new line to prevent overflow
para.appendChild(document.createElement("br"))
}
para.appendChild(document.createTextNode(elecConf[j])); // Append electron level
var sup = document.createElement("sup");
// Append value for level in superscript
sup.appendChild(document.createTextNode(elecConf[j+1]));
para.appendChild(sup);
}
}
} else { // If not special data type
changeText(p[i],prefix[i] + info[p[i]][index] + unit[i]);
}
} else { // If null
changeText(p[i],prefix[i] + "Unknown");
}
}
} // Remove all childs in preview, then get new atom div
try {
get("preview").removeChild(get("preview").firstChild);
} catch(err){}
get("preview").appendChild(getAtomDOM(index,window.innerHeight/3.8));
}
}
}
function changeText(dom,text) {
var dom = get(dom);
// Remove all childs in div
while (dom.firstChild) {
dom.removeChild(dom.firstChild);
}
dom.appendChild(document.createTextNode(" "));
dom.childNodes[0].nodeValue = text;
}
function getAtomDOM(atomNum, size) {
var holder = document.createElement("div");
holder.style.position = "relative";
holder.style.height = size;
holder.style.width = size;
holder.className = "realAtom";
var atom = document.createElement("img");
atom.ondragstart = function(){return false;} // Disables image dragging
atom.src = "./resources/reactive/Ring" + info["valeElec"][atomNum] + ".gif";
atom.style.height = size;
atom.style.width = size;
atom.style.position = "absolute";
atom.style.top = "0";
atom.style.left = "0";
var circle = document.createElement("div");
circle.className = "innerAtom";
circle.style.borderRadius = "50%"; // Creates circle
circle.style.height = size*0.85;
circle.style.width = size*0.85;
circle.style.margin = "0 auto";
circle.style.position = "absolute";
circle.style.top = size*0.075;
circle.style.left = size*0.075;
var bgColor = getColor(settings["displayTheme"],atomNum);
circle.style.backgroundColor = bgColor;
circle.style.boxShadow = "inset 0 0 0 15px " + changeColor(bgColor,20) + ", inset 0 0 10px 30px " + changeColor(bgColor,-20) + ", 1px 4px 16px 6px #444";
var eyes = document.createElement("div");
eyes.style.display = "flex";
eyes.style.position = "absolute";
var eyesWidth = size*0.17;
var eyesHeight = size*0.15;
eyes.style.top = size*0.425 - eyesHeight/2;
eyes.style.left = size*0.67 - eyesWidth/2;
var eye = document.createElement("div");
eye.style.backgroundColor = changeColor(bgColor,-20);
eye.style.borderRadius = "100px / 240px";
eye.style.boxShadow = "inset 0 0 0 4px #fff";
eye.style.width = size*0.06;
eye.style.height = size*0.15;
eye.className = "eye";
eyes.appendChild(eye);
var eye2 = eye.cloneNode(true);
eye2.style.marginLeft = "5px";
eyes.appendChild(eye2);
var sh = document.createElement("p");
sh.appendChild(document.createTextNode(info["shorthand"][atomNum]));
sh.className = "sh";
circle.appendChild(sh);
circle.appendChild(eyes);
holder.appendChild(circle)
holder.appendChild(atom);
return holder;
}
get("body").onmousemove = function(event) {
// Makes eyes point at mouse
try {
var a = event.clientX;
var b = event.clientY;
for(var i = 0; i < document.getElementsByClassName("innerAtom").length; i++) {
var atom = document.getElementsByClassName("innerAtom")[i];
var x = (atom.getBoundingClientRect()["left"] + atom.getBoundingClientRect()["right"])/2; // X coord
var y = (atom.getBoundingClientRect()["top"] + atom.getBoundingClientRect()["bottom"])/2; // Y coord
var width = atom.getBoundingClientRect()["width"]; // Width and length are same because circle
var r = width/4;
var vect = [a-x, b-y];
var magn = Math.sqrt(Math.pow(vect[0],2) + Math.pow(vect[1],2))
var eyePos = [vect[0]*r/magn, vect[1]*r/magn];
var eyes = atom.childNodes[1];
eyes.style.left = width/2 + eyePos[0] - eyes.getBoundingClientRect()["width"]/2;
eyes.style.top = width/2 + eyePos[1] - eyes.getBoundingClientRect()["height"]/2;
}
} catch(err) {}
}

57
atoms/js/buttons.js Normal file
View File

@ -0,0 +1,57 @@
get("pulltab")[0].onclick = function(){open(get("elements"));}
get("pulltab")[1].onclick = function(){open(get("tools"));}
get("pulltab")[2].onclick = function(){open(get("settings"));}
get("fa")[0].onclick = function() {
get("elements").style.marginLeft = "-150%";
}
get("fa")[1].onclick = function() {
get("tools").style.marginLeft = "-170%";
}
get("fa")[2].onclick = function() {
get("settings").style.marginLeft = "-40%";
}
function open(dom) {
dom.style.marginLeft = "0%";
}
for(var i = 0; i < options.length; i++) {
get("help")[i].onclick = function() {
var index = options.indexOf(this.parentNode.childNodes[9].id);
get("helptext")[index].style.display = "block";
get("helptab")[index].style.display = "block";
setTimeout(function() {
get("helptab")[index].style.opacity = "1";
get("helptext")[index].style.opacity = "1";
}, 1)
}
get("help")[i].onmouseleave = function() {
var index = options.indexOf(this.parentNode.childNodes[9].id);
get("helptab")[index].style.opacity = "0";
setTimeout(function(){get("helptext")[index].style.opacity = "0";},100);
setTimeout(function() {
get("helptab")[index].style.display = "none";
get("helptext")[index].style.display = "none";
}, 300);
}
}
get("balancebutton").onclick = function() {
//Invalid form handling
var reactants = get("reactant").value;
var products = get("products").value;
var reacNum = reactants.split("+").length-1;
var final = "";
var balanced = balanceEquation(get("reactant").value,get("product").value);
for(var i = 0; i < balanced.length; i++) {
if(i == reacNum) {
final += balanced[i] + " -> ";
} else {
final += balanced[i] + " + ";
}
}
final = final.substring(0,final.length-3);
get("balanceout").value = final;
}

50
atoms/js/main.js Normal file
View File

@ -0,0 +1,50 @@
function getJSON() {
xhr.open("GET","./resources/static/info.json", true);
xhr.onreadystatechange = function() {
if (xhr.readyState == 4) {
info = JSON.parse(xhr.responseText);
}
}
xhr.send(null);
}
function update() {
var cookie = document.cookie;
var cookieArray = cookie.split(";");
// For all settings, append into object format
for(var i = 0; i < cookieArray.length; i++) {
var set = cookieArray[i].split("=");
settings[set[0].replace(" ","")] = set[1];
}
// Below are settings applied based
var dispTheme = settings["displayTheme"];
changeTheme(settings["theme"]);
tableTheme(dispTheme);
legendChange(dispTheme);
keyChange(dispTheme)
}
var reader = new FileReader();
var xhr = new XMLHttpRequest();
if(document.cookie == "") { // Set defaults if no cookie
document.cookie = "theme=light";
document.cookie = "displayTheme=category;";
document.cookie = "elecConf=abr;";
document.cookie = "unit=K;"
}
getJSON();
setTimeout(function mainFunc() {
getRanges();
createTable();
update();
makeSettings();
tableDesc();
keyLegend();
createGradientLegend();
}, 600);

224
atoms/js/onload.js Normal file
View File

@ -0,0 +1,224 @@
function createTable() {
var tbl = document.createElement('table');
tbl.style.border = "1px hidden";
tbl.className = "normal";
// Creates table width j, height i
for(var i = 0; i < 7; i++) {
var tr = tbl.insertRow();
for(var j = 0; j < 18; j++) {
td = tr.insertCell();
td.className = "periodictable";
}
}
get("sidebar")[0].appendChild(tbl);
// Repeat of process above for Lanthanides and Actinides
tbl = document.createElement('table');
tbl.className = "extension";
for(var i = 0; i < 2; i++) {
var tr = tbl.insertRow();
for(var j = 0; j < 15; j++) {
var td = tr.insertCell();
td.className = "periodictable";
}
}
get("sidebar")[0].appendChild(tbl);
// Creates text for the periodic table
cells = get("td");
for(var i = 0;i < elementCount;i++) {
ele = document.createElement("p");
text = document.createTextNode(i+1); // i+1 to offset 0
ele.appendChild(text);
cells[info["location"][i]].appendChild(ele);
text = document.createTextNode(info["shorthand"][i]);
value = document.createElement("p");
value.appendChild(document.createTextNode(""));
value.className = "atomvalue";
cells[info["location"][i]].appendChild(text);
cells[info["location"][i]].appendChild(value);
cells[info["location"][i]].className = cells[info["location"][i]].className +" atom"; // Adds class to prevent hover animation on blank cells
}
}
function keyLegend() {
var rowlength = 3;
// Get theme
var theme = settings["displayTheme"];
var index = choices[1].indexOf(theme);
// Create Table
var tbl = document.createElement('table');
// id for CSS
tbl.id = "keylegend";
if(theme == "category") {
tbl.style.top = "10%";
tbl.style.left = "16.5%";
}
for (var i = 0; i < Object.keys(keyColors[index]).length; i+=rowlength) {
var tr = tbl.insertRow();
for (var x = 0; x < rowlength; x++) {
if ((i + x) < Object.keys(keyColors[index]).length) {
var keycolor = tr.insertCell();
keycolor.className = "keycolor";
keycolor.style.backgroundColor = keyColors[index][Object.keys(keyColors[index])[i + x]];
var keyname = tr.insertCell();
keyvalue = document.createTextNode(Object.keys(keyColors[index])[i + x]);
keyname.appendChild(keyvalue);
keyname.className = "keyvalue";
}
}
};
get("key").appendChild(tbl);
}
function createGradientLegend() {
var units = [""," pm"," g/mol", " kJ/mol"," kJ/mol", " eV", " g/mL", "", ""];
// Create Table element
var tbl = document.createElement('table');
// Adds Class for styling
tbl.className = "legend";
// Gets theme then makes vars for hexes so that repeated table access not necessary
var theme = settings["displayTheme"];
var index = choices[1].indexOf(theme);
var unit = settings["unit"];
// Filter out non-gradient layouts
if (colorChart[theme].length === 2) {
var color1 = colorChart[theme][0];
var color2 = colorChart[theme][1];
}
// Creates a gradient of 101 values wide (j) for good transition
var tr = tbl.insertRow();
for(var j = 0; j <= 1; j += 0.01) {
var td = tr.insertCell();
td.className = "legendcell";
if (colorChart[theme].length === 2) {
td.style.backgroundColor = gradientColor(color1, color2 , j);
}
}
// Adds table to key area
get("legendholder").appendChild(tbl);
// Create Key
var min = document.createElement("p");
min.className = "legendrangeval minlegend";
var max = document.createElement("p");
max.className = "legendrangeval maxlegend"
if (colorChart[theme].length != 2) {
var minval = document.createTextNode("");
var maxval = document.createTextNode("");
} else if (theme === "melting" || theme === "boiling") {
if (unit === "K") {
var extra = " " + unit;
} else {
var extra = " °" + unit;
}
var minval = document.createTextNode(ranges[theme][unit][0] + extra);
var maxval = document.createTextNode(ranges[theme][unit][1] + extra);
} else {
var minval = document.createTextNode(ranges[theme][0] + " " + units[index]);
var maxval = document.createTextNode(ranges[theme][1] + " " + units[index]);
}
min.appendChild(minval);
max.appendChild(maxval);
get("legendholder").appendChild(min);
get("legendholder").appendChild(max);
// Create Title
var title = document.createElement("h1");
title.className = "tabletitle";
if (units[index] != "") {
var end = choicesDisplay[1][index] + " (" + units[index] + " )";
} else {
var end = choicesDisplay[1][index];
}
title.innerHTML = end;
get("titleholder").appendChild(title);
}
function makeSettings() {
for(var i = 0; i < options.length;i++) {
var parent = get("option")[i];
var text = document.createElement("p");
// Create text of current settings choice for this option
text.appendChild(document.createTextNode(choicesDisplay[i][choices[i].indexOf(settings[parent.id])]))
text.className = "selection";
parent.appendChild(text);
var holder = document.createElement("div"); //Dropdown choice holder div
holder.className = "dropdown";
parent.appendChild(holder);
// On mouse functions
parent.onclick = function() {
// Make visible
var k = this;
this.childNodes[1].style.display = "inline";
// Needs delay in between to execute transition properly, do not remove.
setTimeout(function(){k.childNodes[1].style.opacity = "1";},1);
}
parent.onmouseleave = function() {
// Make invisible
var k = this;
this.childNodes[1].style.opacity = "0";
setTimeout(function(){k.childNodes[1].display = "none";},300); //Time for opacity change
}
holder.onmouseleave = function() {
// Make invisible
var k = this;
this.style.opacity = "0";
setTimeout(function(){k.style.display = "none";},300); //Time for opacity change
}
for(var j = 0;j < choices[i].length;j++) { // For all choices, append div for choice selection
var p = document.createElement("p");
p.className = i.toString() + j.toString();
p.appendChild(document.createTextNode(choicesDisplay[i][j]))
holder.appendChild(p);
p.onclick = function(event) {
event.stopPropagation(); // Parent onclick doesn't occur when child gets clicked
var value = this.innerHTML;
var k = this;
var setting = this.parentNode.parentNode.id;
var textDiv = this.parentNode.parentNode.childNodes[0].childNodes[0];
// Only if different value
if(value !== textDiv.nodeValue) {
this.parentNode.style.opacity = "0";
setTimeout(function(){k.parentNode.style.display = "none";},300);
// Text transition: opacity 0
textDiv.parentNode.style.color = themeChart["font"][settings["theme"]].replace(")",",0)").replace("b","ba");
// Update settings through cookie
deleteCookie(setting);
document.cookie = setting+"="+choices[parseInt(this.className[0])][parseInt(this.className[1])];
// Text transition: opacity 1
setTimeout(function() {
textDiv.nodeValue = value;
textDiv.parentNode.style.color = themeChart["font"][settings["theme"]].replace(")",",1)").replace("b","ba");
update();
}, 650)
}
}
}
}
}

393
atoms/js/tools.js Normal file
View File

@ -0,0 +1,393 @@
function getColor(theme, atomNum) {
if(theme == "category") {
var color = colorChart[theme][info[theme][atomNum]];
} else if(theme == "melting" || theme == "boiling") {
if(info[theme]["K"][atomNum] == null) { // if value is null
color = "#41484D";
} else {
// Value - Min(all values) / Max(all values) - Min(all values)
var ratio = (info[theme]["K"][atomNum] - ranges[theme]["K"][0]) / ranges[theme]["K"][2];
var color = gradientColor(colorChart[theme][0],colorChart[theme][1], ratio); // high, low, ratio
}
} else {
if(info[theme][atomNum] == null) { // if value is null
color = "#41484D";
} else {
// Value - Min(all values) / Max(all values) - Min(all values)
var ratio = (info[theme][atomNum] - ranges[theme][0]) / ranges[theme][2];
var color = gradientColor(colorChart[theme][0],colorChart[theme][1], ratio);
}
}
return color;
}
function changeColor(hex, amt) {
hex = hex.slice(1);
var num = parseInt(hex,16);
var r = (num >> 16) + amt;
if (r > 255) r = 255;
else if (r < 0) r = 0;
var b = ((num >> 8) & 0x00FF) + amt;
if (b > 255) b = 255;
else if (b < 0) b = 0;
var g = (num & 0x0000FF) + amt;
if (g > 255) g = 255;
else if (g < 0) g = 0;
var final = (g | (b << 8) | (r << 16)).toString(16);
// Adds preceeding zeros
while (final.length < 6) {final = "0" + final};
return "#" + final;
}
function gradientColor(hex1, hex2, ratio) {
// Splits hex1 into 3 pieces (2 char each)
var hex1 = hex1.replace("#", "").match(/.{1,2}/g);
// Converts each one into int
for (var i = 0; i <= 2; i++) {
hex1[i] = parseInt(hex1[i], 16);
}
// Does above process for hex2
var hex2 = hex2.replace("#", "").match(/.{1,2}/g);
for (var i = 0; i <= 2; i++) {
hex2[i] = parseInt(hex2[i], 16);
}
// Creates end table for finished hex parts
var donetable = [];
// Averages each of the three parts between hex1 and hex2
for (var i = 0; i <= 2; i++) {
// Weighted average to get exact gradient necessary and not average
// Round to prevent weird hex decimal shenanigans
var val = Math.round((ratio) * hex1[i] + (1 - ratio) * hex2[i]);
val = val.toString(16);
// Adds 0 to solve math automatically removing preceeding zeroes
if (val.length === 1) {
val = "0" + val;
}
donetable[i] = val;
}
// Rejoins hex and adds #
done = "#" + donetable.join("");
return done;
}
function get(name) {
// Condensed format for document.getX
var elements = [];
if(document.getElementsByClassName(name).length > 0) {
elements = document.getElementsByClassName(name);
}
else if(document.getElementsByTagName(name).length > 0) {
for(var a = 0; a < document.getElementsByTagName(name).length; a++) {
elements.push(document.getElementsByTagName(name)[a]);
}
}
else if(document.getElementById(name) != null) {
elements.push(document.getElementById(name));
}
if(elements.length == 1) {
return elements[0];
} else { return elements; }
}
function deleteElem (id) {
var element = document.getElementById(id);
elem.parentNode.removeChild(element);
}
function deleteCookie(setting) {
// Sets expiration date to past date, deleting cookie automatically
document.cookie = setting+"=; expires=Thu, 01 Jan 2000 00:00:00 GMT";
}
function getRanges() {
// Format of ranges is [Min, Max, Range]
for(var i = 1; i < choices[1].length; i++) { // Possible data types are options except for category
var option = choices[1][i];
if(i == 7 || i == 8) {
ranges[option] = {};
for(var j = 0; j < 3; j++) { // Units for temperatures
var unit = choices[3][j];
var min = Math.min.apply(null,info[option][unit]);
var max = Math.max.apply(null,info[option][unit]);
var range = max - min;
ranges[option][unit] = [min,max,range];
}
} else {
var min = Math.min.apply(null,info[option]);
var max = Math.max.apply(null,info[option]);
var range = max - min;
ranges[option] = [min,max,range];
}
}
}
function balanceEquation(reactant, product) {
var compounds = [];
var vary = [];
var matrix = [];
var freeMatrix = [];
var finalMatrix = [];
// Create array from inputs.
formulaStr = reactant + "+" + product;
compounds = formulaStr.replace(/\s/g,"").split("+");
// Create element matrix list.
for(var i = 0; i < compounds.length; i++) {
var counter = 0;
var indexes = [];
currString = compounds[i];
compounds[i] = [compounds[i]];
while(counter < currString.length) {
if(currString[counter] == currString[counter].toUpperCase() && isNaN(currString[counter])) {
indexes.push(counter);
}
counter += 1;
}
indexes.push(currString.length);
for(var j = 0; j < indexes.length-1; j++) {
element = currString.substring(indexes[j],indexes[j+1]);
elementNoNum = element.replace(/[0-9]/g,"");
if(vary.indexOf(elementNoNum) == -1 && elementNoNum != '(' && elementNoNum != ')') {
vary.push(elementNoNum);
}
if(element.search(/[0-9]/g) != -1) {
compounds[i].push([elementNoNum,parseInt(element.replace(/\D/g,""))]);
} else {
compounds[i].push([elementNoNum,1]);
}
}
}
//Parenthesis handling.
for(var r = 0; r < compounds.length; r++) {
var s = 1;
while(s < compounds[r].length) {
if(compounds[r][s][0] == "(") {
var count = 1;
var v = s;
while(count > 0) {
v++;
if(compounds[r][v][0] == "(") count++;
if(compounds[r][v][0] == ")") count--;
}
var curr = compounds[r];
var times = curr[v][1];
var before = curr.splice(0,s);
var mid = curr.splice(1,v-1-before.length);
var ae = 0;
var open = 0;
while(ae < curr.length) {
if(curr[ae][0] == "(") {
open++;
if(open == 1) curr.splice(ae,ae+1);
} else if(curr[ae][0] == ")") {
open--;
if(open === 0) curr.splice(ae,ae+1);
break;
} else {
ae++;
}
}
var after = curr;
for(var ab = 0; ab < mid.length; ab++) {
if(times > 1) {
mid[ab][1] *= times;
before.push(mid[ab]);
} else {
before.push(mid[ab]);
}
}
if(after !== 0) {
for(var ac = 0; ac < after.length; ac++) {
before.push(after[ac]);
}
}
compounds[r] = before;
s=0;
}
s++;
}
}
// Create matrix.
for(var x = 0; x < vary.length; x++) {
matrix[x] = [];
for(var y = 0; y < compounds.length; y++) {
var pushed = false;
for(var z = 1; z < compounds[y].length; z++) {
if(compounds[y][z][0] == vary[x]) {
matrix[x].push(compounds[y][z][1]);
pushed = true;
break;
}
}
if(!pushed) {
matrix[x].push(0);
}
}
}
// Get Reduced Row Echelon Form.
var lead = 0;
var rows = matrix.length;
var columns = matrix[0].length;
for(var a = 0; a < rows; a++) {
var breakOut = false;
if(columns <= lead) {
break;
}
var e = a;
while(matrix[e][lead] === 0) {
e++;
if(rows == e) {
e = a;
lead++;
if(columns == lead) {
breakOut = true;
break;
}
}
}
if(breakOut) break;
var tmp = matrix[e];
matrix[e] = matrix[a];
matrix[a] = tmp;
var val = matrix[a][lead];
for(var b = 0; b < columns; b++) {
matrix[a][b] /= val;
}
for(var c = 0; c < rows; c++) {
if (c == a) continue;
val = matrix[c][lead];
for(var d = 0; d < columns; d++) {
matrix[c][d] -= val * matrix[a][d];
}
}
lead++;
}
// Remove redundant lines.
for(var r = 0; r < matrix.length; r++) {
var splice = true;
for(var q = 0; q < matrix[0].length; q++) {
if(matrix[r][q] === 0 && splice === false) {
splice = true;
} else {
splice = false;
}
}
if(splice) {
matrix.splice(r,r+1);
r = 0;
}
}
// Extract free matrix.
var rank = matrix.length;
for(var m = 0; m < rank; m++) {
freeMatrix[m] = [];
for(var n = rank; n < matrix[0].length; n++) {
freeMatrix[m].push(-1*matrix[m][n]);
}
}
// Adding identity matrix.
for(var e = 0; e < compounds.length-freeMatrix.length; e++) {
freeMatrix.push([]);
for(var f = 0; f < compounds.length-rank; f++) {
if((f/2) == parseInt(f/2)) {
freeMatrix[e+rank].push(1);
} else {
freeMatrix[e+rank].push(0);
}
}
}
// Adding and converting into 1 column/row.
for(var o = 0; o < freeMatrix.length; o++) {
var value = 0;
for(var p = 0; p< freeMatrix[0].length; p++) {
value += freeMatrix[o][p];
}
finalMatrix.push(value);
}
// Multiply all to integers.
var mul = 1;
var testMul = 1;
for(var g = 0; g < finalMatrix.length; g++) {
var testInt = finalMatrix[g] * testMul;
while(testInt != parseInt(testInt)) {
testMul += 1;
testInt = finalMatrix[g] * testMul;
}
if(testMul < mul) {
mul = testMul;
}
}
for(var h = 0; h < finalMatrix.length; h++) {
finalMatrix[h] *= testMul;
}
// Get GCD.
var gcd;
for(var u = 0; u < finalMatrix.length-1; u++) {
gcd = getGCD(finalMatrix[u], finalMatrix[u+1]);
}
// Get final answers.
for(var w = 0; w < finalMatrix.length; w++) {
finalMatrix[w] /= gcd;
finalMatrix[w] = Math.abs(finalMatrix[w]);
if(finalMatrix[w] != 1) {
finalMatrix[w] += compounds[w][0];
} else {
finalMatrix[w] = compounds[w][0];
}
}
return finalMatrix;
}
function getGCD(a,b) {
if(!b) return a;
return getGCD(b, a % b);
}

129
atoms/js/update.js Normal file
View File

@ -0,0 +1,129 @@
function changeTheme(type) {
// Changes background image
get("body").style.backgroundImage = "url('./resources/static/" + type +".png')";
get("body").style.color = themeChart["font"][type];
// Changes interface element colors
for(var i = 0; i < get("pulltab").length; i++) {
get("pulltab")[i].style.backgroundColor = themeChart["pulltab"][type];
get("pulltab")[i].style.color = themeChart["font"][type].replace(")",",0)");
get("pulltab")[i].onmouseover = function() {
this.style.color = themeChart["font"][type].replace(")",",1)").replace("b","ba");
}
get("pulltab")[i].onmouseleave = function() {
this.style.color = themeChart["font"][type].replace(")",",0)").replace("b","ba");
}
get("sidebar")[i].style.backgroundColor = themeChart["sidebar"][type];
}
for(var i = 0; i < get("selection").length; i++) {
get("selection")[i].style.color = themeChart["font"][type];
}
}
function tableTheme(theme) {
for(var i = 0;i < elementCount;i++) {
// Changes background color of each cell
if (document.getElementsByClassName("periodictable").length != 0) {
var index = get("periodictable")[info["location"][i]];
index.style.backgroundColor = getColor(theme, i);
if(theme == "category") {
index.childNodes[2].childNodes[0].nodeValue = "";
} else if(theme == "melting" || theme == "boiling") {
temperatureValue = info[theme][settings["unit"]][i];
if(temperatureValue != null) {
index.childNodes[2].childNodes[0].nodeValue = temperatureValue + "°";
}
} else {
index.childNodes[2].childNodes[0].nodeValue = info[theme][i];
}
}
}
try {lastElement.click();} catch(err){} // Last selection still selected when changing themes
}
function keyChange(theme) {
if (document.getElementById("keylegend") != null) {
var rowlength = 3;
document.getElementsByClassName("key")[0].removeChild(document.getElementById("keylegend"));
var index = choices[1].indexOf(theme);
// Create Table
var tbl = document.createElement('table');
// id for CSS
tbl.id = "keylegend";
if(theme == "category") {
tbl.style.top = "10%";
tbl.style.left = "16.5%";
}
for (var i = 0; i < Object.keys(keyColors[index]).length; i+=rowlength) {
var tr = tbl.insertRow();
for (var x = 0; x < rowlength; x++) {
if ((i + x) < Object.keys(keyColors[index]).length) {
var keycolor = tr.insertCell();
keycolor.className = "keycolor";
keycolor.style.backgroundColor = keyColors[index][Object.keys(keyColors[index])[i + x]];
var keyname = tr.insertCell();
keyvalue = document.createTextNode(Object.keys(keyColors[index])[i + x]);
keyname.appendChild(keyvalue);
keyname.className = "keyvalue";
}
}
};
get("key").appendChild(tbl);
}
}
function legendChange(theme) {
var units = [""," pm"," g/mol", " kJ/mol"," kJ/mol", " eV", " g/mL", "", ""];
// Title
if (get("tabletitle").length != 0) {
var index = choices[1].indexOf(theme);
if (units[index] != "") {
var end = choicesDisplay[1][index] + " (" + units[index] + " )";
} else {
var end = choicesDisplay[1][index];
}
get("tabletitle").innerHTML = end;
}
if (colorChart[theme].length != 2) {
get("legendholder").style.display = "none";
} else {
get("legendholder").style.display = "";
var color1 = colorChart[theme][0];
var color2 = colorChart[theme][1];
if (theme === "melting" && "boiling") {
var unit = settings["unit"];
var newmin = ranges[theme][unit][0];
var newmax = ranges[theme][unit][1];
if (unit != "K") {
unit = "°" + unit;
}
newmin = newmin + " " + unit;
newmax = newmax + " " + unit;
} else {
var newmin = ranges[theme][0] + " " + units[index];
var newmax = ranges[theme][1] + " " + units[index];
}
if (get("legend").length != 0) {
for(var j = 0; j <= 99; j ++) {
get("legendcell")[j].style.backgroundColor = gradientColor(color1, color2 , j/100);
}
get("minlegend").innerHTML = newmin;
get("maxlegend").innerHTML = newmax;
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 131 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 147 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 183 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

View File

@ -0,0 +1,168 @@
{
"element": ["Hydrogen","Helium","Lithium","Beryllium","Boron","Carbon","Nitrogen","Oxygen","Fluorine","Neon",
"Sodium","Magnesium","Aluminum","Silicon","Phosphorus","Sulfur","Chlorine","Argon","Potassium",
"Calcium","Scandium","Titanium","Vanadium","Chromium","Manganese","Iron","Cobalt","Nickel","Copper",
"Zinc","Gallium","Germanium","Arsenic","Selenium","Bromine","Krypton","Rubidium","Strontium","Yttrium",
"Zirconium","Niobium","Molybdenum","Technetium","Ruthenium","Rhodium","Palladium","Silver","Cadmium",
"Indium","Tin","Antimony","Tellurium","Iodine","Xenon","Cesium","Barium","Lanthanum","Cerium",
"Praseodymium","Neodymium","Promethium","Samarium","Europium","Gadolinium","Terbium","Dysprosium",
"Holmium","Erbium","Thulium","Ytterbium","Lutetium","Hafnium","Tantalum","Tungsten","Rhenium","Osmium",
"Iridium","Platinum","Gold","Mercury","Thallium","Lead","Bismuth","Polonium","Astatine","Radon",
"Francium","Radium","Actinium","Thorium","Protactinium","Uranium","Neptunium","Plutonium","Americium",
"Curium","Berkelium","Californium","Einsteinium","Fermium","Mendelevium","Nobelium","Lawrencium",
"Rutherfordium","Dubnium","Seaborgium","Bohrium","Hassium","Meitnerium","Darmstadtium","Roentgenium",
"Copernicium","Ununtrium","Flerovium","Ununpentium","Livermorium","Ununseptium","Ununoctium"],
"location":[0,17,18,19,30,31,32,33,34,35,36,37,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,126,127,128,129,130,131,132,133,134,135,136,
137,138,139,140,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,141,142,143,144,145,146,147,
148,149,150,151,152,153,154,155,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125],
"shorthand": ["H","He","Li","Be","B","C","N","O","F","Ne","Na","Mg","Al","Si","P","S","Cl","Ar","K","Ca","Sc","Ti","V",
"Cr","Mn","Fe","Co","Ni","Cu","Zn","Ga","Ge","As","Se","Br","Kr","Rb","Sr","Y","Zr","Nb","Mo","Tc",
"Ru","Rh","Pd","Ag","Cd","In","Sn","Sb","Te","I","Xe","Cs","Ba","La","Ce","Pr","Nd","Pm","Sm","Eu","Gd",
"Tb","Dy","Ho","Er","Tm","Yb","Lu","Hf","Ta","W","Re","Os","Ir","Pt","Au","Hg","Tl","Pb","Bi","Po","At",
"Rn","Fr","Ra","Ac","Th","Pa","U","Np","Pu","Am","Cm","Bk","Cf","Es","Fm","Md","No","Lr","Rf","Db","Sg",
"Bh","Hs","Mt","Ds","Rg","Cn","Uut","Fl","Uup","Lv","Uus","Uuo"],
"atomRadi": [53,31,167,112,87,67,56,48,42,38,190,145,118,111,98,88,79,71,243,194,184,176,171,166,161,156,152,149,
145,142,136,125,114,103,94,88,265,219,212,206,198,190,183,178,173,168,165,161,156,145,133,123,115,108,
298,253,null,null,247,206,205,238,231,233,225,228,226,226,222,222,217,208,200,193,188,185,180,177,174,
171,156,154,143,135,127,120,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,
null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],
"moleWeig": [1.008,4.00026,6.94,9.0122,10.81,12.011,14.007,15.999,18.998,20.180,22.990,24.305,26.982,28.085,30.974,
32.06,35.45,39.948,39.098,40.078,44.956,47.867,50.942,51.996,54.938,55.845,58.993,58.693,63.546,65.38,69.723,
72.630,74.922,78.97,79.904,83.798,85.468,87.62,88.906,91.224,92.906,95.95,98,101.07,102.91,106.42,107.87,
112.41,114.82,118.71,121.76,127.60,126.90,131.29,132.91,137.33,138.91,140.12,140.91,144.24,145,150.36,
151.96,157.25,158.93,162.50,164.93,167.26,168.93,173.05,174.97,178.49,180.95,183.84,186.21,190.23,192.22,
195.08,196.97,200.59,204.38,207.2,208.98,209,210,222,223,226,227,232.04,231.04,238.03,237,244,243,247,247,
251,252,257,258,259,262,265,268,271,270,277,276,281,280,285,286,289,289,293,294,294],
"ioniEner": [1312.0,2372.3,520.2,899.5,800.6,1086.5,1402.3,1313.9,1681.0,2080.7,495.8,737.7,577.5,786.5,1011.8,999.6,
1251.2,1520.6,418.8,589.8,633.1,658.8,650.9,652.9,717.3,762.5,760.4,737.1,745.5,906.4,578.8,762.2,944.5,
941.0,1139.9,1350.8,403.0,549.5,599.9,640.1,652.1,684.3,702,710.2,719.7,804.4,731.0,867.8,558.3,708.6,
830.6,869.3,1008.4,1170.3,375.7,502.9,538.1,534.4,528.1,533.1,538.6,544.5,547.1,593.4,565.8,573.0,581.0,
589.3,596.7,603.4,523.5,658.5,728.4,758.8,755.8,814.2,865.2,864.4,890.1,1007.1,589.4,715.6,703.0,812.1,null,
1037.1,393.0,509.3,498.8,608.5,568,597.6,604.5,581.5,576.4,578.1,598.0,606.1,619,627,635,642,472.8,580,
null,null,null,null,null,null,null,null,null,null,null,null,null,null],
"elecAffi": [72.8,0,59.6,0,27.0,121.8,0,141.0,328.2,0,52.9,0,41.8,134.1,72.0,200.4,348.6,0,48.4,2.4,18,8,51,65.2,0,
15,64,111.7,119.2,0,40,118.9,78,195.0,324.5,0,46.9,5.0,30,41,86,72.1,60,101.0,110.3,54.2,125.9,0,39,
107.3,101.1,190.2,295.2,0,45.5,14.0,45,null,null,null,null,null,null,null,null,null,null,null,null,null
,null,0,31,79,20,104.0,150.9,205.0,222.7,0,37,35,90.9,180,270,0,null,null,null,null,null,null,null,null,
null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,
null,null,null],
"elecNega": [2.20,null,0.98,1.57,2.04,2.55,3.04,3.44,3.98,null,0.93,1.31,1.61,1.90,2.19,2.58,3.16,null,0.82,1.00,1.36,
1.54,1.63,1.66,1.55,1.83,1.88,1.91,1.90,1.65,1.81,2.01,2.18,2.55,2.96,3.00,0.82,0.95,1.22,1.33,1.6,2.16,
1.9,2.2,2.28,2.20,1.93,1.69,1.78,1.96,2.05,2.1,2.66,2.60,0.79,0.89,1.1,1.12,1.13,1.14,1.13,1.17,1.2,1.2,
1.1,1.22,1.23,1.24,1.25,1.1,1.27,1.3,1.5,2.36,1.9,2.2,2.20,2.28,2.54,2.00,1.62,2.33,2.02,2.0,2.2,2.2,0.7,
0.9,1.1,1.3,1.5,1.38,1.36,1.28,1.13,1.28,1.3,1.3,1.3,1.3,1.3,1.3,1.291,null,null,null,null,null,null,null,
null,null,null,null,null,null,null,null],
"phase" : ["g","g","s","s","s","s","g","g","g","g","s","s","s","s","s","s","g","g","s","s","s","s","s","s","s","s","s",
"s","s","s","s","s","s","s","l","g","s","s","s","s","s","s","s","s","s","s","s","s","s","s","s","s","s","g",
"s","s","s","s","s","s","s","s","s","s","s","s","s","s","s","s","s","s","s","s","s","s","s","s","s","l","s","s",
"s","s","s","g","s","s","s","s","s","s","s","s","s","s","s","s","s",null,null,null,null,null,null,null,null,
null,null,null,null,null,null,null,null,null,null,null],
"density" : [0.0000899,0.0001785,0.535,1.848,2.46,2.26,0.001251,0.001429,0.001696,0.9,0.968,1.738,2.7,2.33,1.823,1.96,
0.003214,0.001784,0.856,1.55,2.985,4.507,6.11,7.14,7.47,7.874,8.9,8.908,8.92,7.14,5.904,5.323,5.727,4.819,
3.12,0.00375,1.532,2.63,4.472,6.511,8.57,10.28,11.5,12.37,12.45,12.023,10.49,8.65,7.31,7.31,6.697,6.24,4.94,0.0059,
1.879,3.51,6.146,6.689,6.64,7.01,7.264,7.353,5.244,7.901,8.219,8.551,8.795,9.066,9.321,6.57,9.841,13.31,16.65,
19.25,21.02,22.61,22.65,21.09,19.3,13.534,11.85,11.34,9.78,9.196,null,0.00973,null,5,10.07,11.724,15.37,19.05,
20.45,19.816,null,13.51,14.78,15.1,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,
null,null,null,null,null],
"melting": {
"K": [14.01,0.95,453.65,1560,2348,3823,63.15,54.36,53.53,24.56,370.95,923,933.437,1687,317.3,388.36,171.65,
83.8,336.53,1115,1814,1941,2183,2180,1519,1811,1768,1728,1357.77,692.68,302.9146,1211.4,1090,494,265.95,
115.79,312.46,1050,1799,2128,2750,2896,2430,2607,2237,1828.05,1234.93,594.22,429.75,505.08,903.78,722.66,
386.85,161.4,301.59,1000,1193,1071,1208,1297,1315,1345,1095,1585,1629,1685,1734,1802,1818,1097,1936,2506,
3290,3695,3459,3306,2719,2041.4,1337.33,234.32,577,600.61,544.55,527,575,202,null,973,1323,2115,1841,1405.3,
null,912.5,1449,1613,1323,1173,1133,1800,1100,1100,1900,null,null,null,null,null,null,null,null,null,null,
null,null,null,null,null],
"C": [-259.14,-272.2,180.5,1287,2075,3550,-210,-218.79,-219.62,-248.59,97.8,650,660.323,1414,44.2,115.21,-101.5,
-189.35,63.38,842,1541,1668,1910,1907,1246,1538,1495,1455,1084.62,419.53,29.7646,938.25,817,221,-7.2,-157.36,
39.31,777,1526,1855,2477,2623,2157,2334,1964,1554.9,961.78,321.07,156.6,231.93,630.63,449.51,113.7,-111.7,
28.44,727,920,798,935,1024,1042,1072,822,1312,1356,1412,1461,1529,1545,824,1663,2233,3017,3422,3186,3033,
2446,1768.3,1064.18,-38.83,304,327.46,271.4,254,302,-71.15,null,700,1050,1842,1568,1132.2,null,639.4,1176,
1340,1050,900,860,1527,827,827,1627,null,null,null,null,null,null,null,null,null,null,null,null,null,null,
null],
"F": [-434.45203,-458,356.9,2349,3767,6422,-346,-361.82,-363.32,-415.46,208.04,1202,1220.581,2577,111.6,239.38,-150.7,
-308.83,146.08,1548,2806,3034,3470,3465,2275,2800,2723,2651,1984.32,787.15,85.5763,1720.85,1503,430,19,-251.25,
102.76,1431,2779,3371,4491,4753,3915,4233,3567,2830.82,1763.2,609.93,313.88,449.47,1167.13,841.12,236.66,-169.1,
83.19,1341,1688,1468,1715,1875,1908,1962,1512,2394,2473,2574,2662,2784,2813,1515,3025,4051,5463,6192,5767,5491,
4435,3214.9,1947.52,-37.89,579,621.43,520.52,489,576,-96,null,1292,1922,3348,2854,2070,null,1182.9,2149,2444,
1922,1652,1580,2781,1521,1521,2961,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null]
},
"boiling": {
"K": [20.28,4.22,1615,2744,4273,4098,77.36,90.2,85.03,27.07,1156,1363,2792,3538,550,717.8,239.11,87.3,1032,1757,3109,
3560,3680,2944,2334,3134,3200,3186,2835,1180,2477,3106,887,958,331.95,119.93,961,1655,3609,4682,5017,4912,4538,
4423,3968,3236,2435,1040,2345,2875,1860,1261,457.4,165.03,944,2170,3737,3697,3793,3347,3273,2067,1802,3546,3503,
2840,2993,3141,2223,1469,3675,4876,5731,5828,5869,5285,4701,4098,3129,629.88,1746,2022,1837,1235,null,211.3,null,
2010,3471,5061,null,4404,null,3505,2284,3383,null,null,null,null,null,null,null,null,null,null,null,null,null,
null,null,null,null,null,null,null,null,null],
"C": [-252.87,-268.93,1342,2471,4000,3825,-195.79,-182.95,-188.12,-246.08,883,1090,2519,3265,277,444.6,-34.04,-185.85,
759,1484,2836,3287,3407,2671,2061,2861,2927,2913,2562,907,2204,2833,614,685,58.8,-153.22,688,1382,3336,4409,4744,
4639,4265,4150,3695,2963,2162,767,2072,2602,1587,988,184.3,-108.12,671,1897,3464,3424,3520,3074,3000,1794,1529,
3273,3230,2567,2720,2868,1950,1196,3402,4603,5458,5555,5596,5012,4428,3825,2856,356.73,1473,1749,1564,962,null,
-61.85,null,1737,3198,4788,null,4131,null,3228,2011,3110,null,null,null,null,null,null,null,null,null,null,null,
null,null,null,null,null,null,null,null,null,null,null],
"F":[-423.17,-452.07,2448,4480,7232,6917,-320.42,-297.31,-306.62,-410.94,1621,1994,4566,5909,531,832.3,-29.27,-302.53,
1398,2703,5136,5949,6165,4840,3742,5182,5301,5275,4644,907,3999,5131,1137,1265,137.8,-243.8,1270,2520,6037,7968,
8571,8382,7709,7502,6683,5365,3924,1413,3762,4716,2889,1810,363.7,-162.62,1240,3447,6267,6195,6368,5565,5432,3261,
2784,5923,5846,4653,4928,5194,3542,2185,6156,8317,9856,10031,10105,9054,8002,6917,5173,674.11,2683,3180,2847,1764,
null,-79.1,null,3159,5788,8650,null,7468,null,5842,3652,5630,null,null,null,null,null,null,null,null,null,null,null,
null,null,null,null,null,null,null,null,null,null,null]
},
"color": ["c","c","s","sg","b","b","c","c","c","c","s","s","s","g","c","y","y","c","s","s","s","s","s","s","s","g","g",
"g","Copper","sg","s","g","s","g","Red","c","s","s","s","s","g","g","s","s","s","s","s","s","s","s","s","s","sg",
"c","s","s","s","s","s","s","s","s","s","s","s","s","s","s","s","s","s","g","g","g","g","sg","s","g","Gold","s","s","sg",
"g","s","s","c","s","s","s","s","s","s","s","s","s","s",null,null,null,null,null,null,null,null,null,null,
null,null,null,null,null,null,null,null,null,null,null,null],
"oxidStat": [["-1","b+1"],null,["b+1"],["+1","b+2"],["-5,","-1","+1","+2","b+3"],["b-4","b-3","b-2","b-1","b+1","b+2","b+3","b+4"],["b-3","-2","-1","+1","+2","b+3","+4","b+5"],
["b-2","-1","+1","+2"],["b-1"],null,["-1","b+1"],["+1","b+2"],["-2","-1","+1","+2","b+3"],["b-4","-3","-2","-1","+1","+2","+3","b+4"],["b-3","-2","-1","+1","+2","b+3","+4","b+5"],
["b-2","-1","+1","b+2","+3","b+4","+5","b+6"],["b-1","b+1","+2","b+3","+4","b+5","+6","b+7"],null,["-1","b+1"],["-1","+1","b+2"],
["+1","+2","b+3"],["-2","-1","+1","+2","+3","b+4"],["-3","-1","+1","+2","+3","+4","b+5"],["-4","-2","-1","+1","+2","b+3","+4","+5","b+6"],
["-3","-2","-1","+1","b+2","+3","b+4","+5","+6","b+7"],["-4","-2","-1","+1","b+2","b+3","+4","+5","b+6"],["-3","-1","+1","b+2","b+3","+4","+5"],
["-2","-1","+1","b+2","+3","+4"],["-2","+1","b+2","+3","+4"],["-2","+1","b+2"],["-5","-4","-2","-1","+1","+2","b+3"],["b-4","-3","-2","-1","+1","b+2","+3","b+4"],
["b-3","-2","-1","+1","+2","b+3","+4","b+5"],["b-2","-1","+1","b+2","+3","b+4","+5","b+6"],["b-1","b+1","b+3","+4","b+5","b+7"],["b+2"],
["-1","b+1"],["+1","b+2"],["+1","+2","b+3"],["-2","+1","+2","+3","b+4"],["-3","-1","+1","+2","+3","+4","b+5"],
["-4","-2","-1","+1","+2","+3","b+4","+5","b+6"],["-3","-1","+1","+2","+3","b+4","+5","+6","b+7"],["-4","-2","+1","+2","b+3","b+4","+5","+6","+7","+8"],
["-3","-1","+1","+2","b+3","+4","+5","+6"],["+1","b+2","+3","b+4","+5","+6"],["-2","-1","b+1","+2","+3","+4"],["-2","+1","b+2"],
["-5","-2","-1","+1","+2","b+3"],["b-4","-3","-2","-1","+1","b+2","+3","b+4"],["b-3","-2","-1","+1","+2","b+3","+4","b+5"],["b-2","-1","+1","b+2","+3","b+4","+5","b+6"],
["b-1","b+1","b+3","+4","b+5","+6","b+7"],["b+2","b+4","b+6","+8"],["-1","b+1"],["+1","b+2"],["+1","+2","b+3"],
["+2","b+3","b+4"],["+2","b+3","+4"],["+2","b+3","+4"],["+2","b+3"],["+2","b+3"],["b+2","b+3"],["+1","+2","b+3"],
["+1","+2","b+3","+4"],["+2","b+3","+4"],["+2","b+3"],["+2","b+3"],["+2","b+3"],["+2","b+3"],["+2","b+3"],
["-2","+1","+2","+3","b+4"],["-3","-1","+1","+2","+3","+4","b+5"],["-4","-2","-1","+1","+2","+3","b+4","+5","b+6"],
["-3","-1","+1","+2","+3","b+4","+5","+6","+7"],["-4","-2","-1","+1","+2","+3","b+4","+5","+6","+7","+8"],
["-3","-1","+1","+2","b+3","b+4","+5","+6","+7","+8"],["-3","-2","-1","+1","b+2","+3","b+4","+5","+6"],
["-3","-2","-1","+1","+2","b+3","+5"],["-2","b+1","b+2","+4"],["-5","-2","-1","b+1","+2","b+3"],["-4","-2","-1","+1","b+2","+3","b+4"],
["-3","-2","-1","+1","+2","b+3","+4","+5"],["b-2","b+2","b+4","+5","+6"],["b-1","b+1","+3","+5","+7"],["b+2","+6"],["b+1"],
["b+2"],["+2","b+3"],["+1","+2","+3","b+4"],["+2","+3","+4","b+5"],["+1","+2","+3","+4","+5","b+6"],
["+2","+3","+4","b+5","+6","+7"],["+1","+2","+3","b+4","+5","+6","+7","+8"],["+2","b+3","+4","+5","+6","+7","+8"],
["+2","b+3","+4","+6"],["+2","b+3","+4"],["+2","b+3","+4"],["+2","b+3","+4"],["+2","b+3"],["+2","b+3"],["b+2","+3"],
["b+3"],["b+4"],["b+5"],["b+6"],["b+7"],["b+8"],null,null,null,null,null,null,null,null,null,null],
"category": ["nm","ng","al","ae","md","nm","nm","nm","ha","ng","al","ae","bm","md","nm","nm","ha","ng","al","ae","tm",
"tm","tm","tm","tm","tm","tm","tm","tm","tm","bm","md","md","nm","ha","ng","al","ae","tm","tm","tm","tm",
"tm","tm","tm","tm","tm","tm","bm","bm","md","md","ha","ng","al","ae","tm","lh","lh","lh","lh","lh","lh",
"lh","lh","lh","lh","lh","lh","lh","lh","tm","tm","tm","tm","tm","tm","tm","tm","tm","bm","bm","bm","md",
"ha","ng","al","ae","tm","ac","ac","ac","ac","ac","ac","ac","ac","ac","ac","ac","ac","ac","ac","tm","tm",
"tm","tm","tm","tm","tm","tm","tm","bm","bm","bm","bm","ha","ng"],
"valeElec": [1,2,1,2,3,4,5,6,7,8,1,2,3,4,5,6,7,8,1,2,2,2,2,2,2,2,2,2,2,2,3,4,5,6,7,8,1,2,2,2,2,2,2,2,2,2,2,2,3,4,5,
6,7,8,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,4,5,6,7,8,1,2,2,2,2,2,2,2,2,2,2,2,2,2,
2,2,2,2,2,2,2,2,2,2,2,2,3,4,5,6,7,8],
"elecConf": ["1s.1","1s.2","[He]2s.1","[He]2s.2","[He]2s.2.2p.1","[He]2s.2.2p.2","[He]2s.2.2p.3","[He]2s.2.2p.4",
"[He]2s.2.2p.5","[He]2s.2.2p.6","[Ne]3s.1","[Ne]3s.2","[Ne]3s.2.3p.1","[Ne]3s.2.3p.2","[Ne]3s.2.3p.3",
"[Ne]3s.2.3p.4","[Ne]3s.2.3p.5","[Ne]3s.2.3p.6","[Ar]4s.1","[Ar]4s.2","[Ar]3d.1.4s.2","[Ar]3d.2.4s.2",
"[Ar]3d.3.4s.2","[Ar]3d.5.4s.1","[Ar]3d.5.4s.2","[Ar]3d.6.4s.2","[Ar]3d.7.4s.2","[Ar]3d.8.4s.2","[Ar]3d.10.4s.1",
"[Ar]3d.10.4s.2","[Ar]3d.10.4s.2.4p.1","[Ar]3d.10.4s.2.4p.2","[Ar]3d.10.4s.2.4p.3","[Ar]3d.10.4s.2.4p.4",
"[Ar]3d.10.4s.2.4p.5","[Ar]3d.10.4s.2.4p.6","[Kr]5s.1","[Kr]5s.2","[Kr]4d.1.5s.2","[Kr]4d.2.5s.2","[Kr]4d.4.5s.1",
"[Kr]4d.5.5s.1","[Kr]4d.5.5s.2","[Kr]4d.7.5s.1","[Kr]4d.8.5s.1","[Kr]4d.10","[Kr]4d.10.5s.1","[Kr]4d.10.5s.2",
"[Kr]4d.10.5s.2.5p.1","[Kr]4d.10.5s.2.5p.2","[Kr]4d.10.5s.2.5p.3","[Kr]4d.10.5s.2.5p.4","[Kr]4d.10.5s.2.5p.5",
"[Kr]4d.10.5s.2.5p.6","[Xe]6s.1","[Xe]6s.2","[Xe]5d.1.6s.2","[Xe]4f.1.5d.1.6s.2","[Xe]4f.3.6s.2","[Xe]4f.4.6s.2",
"[Xe]4f.5.6s.2","[Xe]4f.6.6s.2","[Xe]4f.7.6s.2","[Xe]4f.7.5d.1.6s.2","[Xe]4f.9.6s.2","[Xe]4f.10.6s.2",
"[Xe]4f.11.6s.2","[Xe]4f.12.6s.2","[Xe]4f.13.6s.2","[Xe]4f.14.6s.2","[Xe]4f.14.5d.1.6s.2","[Xe]4f.14.5d.2.6s.2",
"[Xe]4f.14.5d.3.6s.2","[Xe]4f.14.5d.4.6s.2","[Xe]4f.14.5d.5.6s.2","[Xe]4f.14.5d.6.6s.2","[Xe]4f.14.5d.7.6s.2","[Xe]4f.14.5d.9.6s.1","[Xe]4f.14.5d.10.6s.1","[Xe]4f.14.5d.10.6s.2","[Xe]4f.14.5d.10.6s.2.6p.1",
"[Xe]4f.14.5d.10.6s.2.6p.2","[Xe]4f.14.5d.10.6s.2.6p.3","[Xe]4f.14.5d.10.6s.2.6p.4","[Xe]4f.14.5d.10.6s.2.6p.5",
"[Xe]4f.14.5d.10.6s.2.6p.6","[Rn]7s.1","[Rn]7s.2","[Rn]6d.1.7s.2","[Rn]6d.2.7s.2","[Rn]5f.2.6d.1.7s.2",
"[Rn]5f.3.6d.1.7s.2","[Rn]5f.4.6d.1.7s.2","[Rn]5f.6.7s.2","[Rn]5f.7.7s.2","[Rn]5f.7.6d.1.7s.2","[Rn]5f.9.7s.2",
"[Rn]5f.10.7s.2","[Rn]5f.11.7s.2","[Rn]5f.12.7s.2","[Rn]5f.13.7s.2","[Rn]5f.14.7s.2","[Rn]5f.14.7s.2.7p.1",
"[Rn]5f.14.6d.2.7s.2","[Rn]5f.14.6d.3.7s.2","[Rn]5f.14.6d.4.7s.2","[Rn]5f.14.6d.5.7s.2","[Rn]5f.14.6d.6.7s.2",
"[Rn]5f.14.6d.7.7s.2","[Rn]5f.14.6d.9.7s.1","[Rn]5f.14.6d.10.7s.1","[Rn]5f.14.6d.10.7s.2","[Rn]5f.14.6d.10.7s.2.7p.1",
"[Rn]5f.14.6d.10.7s.2.7p.2","[Rn]5f.14.6d.10.7s.2.7p.3","[Rn]5f.14.6d.10.7s.2.7p.4","[Rn]5f.14.6d.10.7s.2.7p.5",
"[Rn]5f.14.6d.10.7s.2.7p.6"]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

674
goldtouch/LICENSE Normal file
View File

@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

5
goldtouch/README.md Normal file
View File

@ -0,0 +1,5 @@
Gold Touch Minetest Mod
=======================
This is a mod to turn any block that the user steps on into gold!
To access this you must have the `midas` privilege, then use the command `/goldtouch <name>`.

1
goldtouch/depends.txt Normal file
View File

@ -0,0 +1 @@
default

29
goldtouch/init.lua Normal file
View File

@ -0,0 +1,29 @@
goldtouch = {}
goldtouch.players = {}
minetest.register_privilege("midas", "turns blocks beneath you into gold")
minetest.register_chatcommand("goldtouch", {
params = "<name>",
privs = {midas=true},
func = function (name, param)
if not goldtouch.players[name] then
goldtouch.players[name] = true
else
goldtouch.players[name] = not goldtouch.players[name]
end
minetest.register_globalstep(function(dtime)
local player = minetest.get_player_by_name(param)
local blockPos = player:getpos()
blockPos.x = math.floor(blockPos.x)
blockPos.y = math.floor(blockPos.y)
blockPos.z = math.floor(blockPos.z)
if minetest.get_node(blockPos) ~= "default:air" and minetest.get_node(blockPos) ~= "default:goldblock" then
minetest.set_node(blockPos, {name="default:goldblock"})
end
end)
end
})

8
gyrio/README.md Normal file
View File

@ -0,0 +1,8 @@
# gyrio
Web Oscilloscope viewer
## History
Gyrio was originally created at GrizzHacks, a hackathon which took place September 30, 2017
## Components
There are 3 major parts to gyrio. First, there is the oscilloscope mode, which converts the data to binary digits and then displays these in a similar method to an oscilloscope. The next mode is an attempt to represent the data in a sound format. To achieve this, the data was converted to a base-8 form and then mapped to a set of 8 tones, which were then outputted. Lastly, the final mode is an attempt to display the data as a whole. The data was converted to hexadecimal and then displayed in an image form, resulting in a picture similar to a colorful QR code.

183
gyrio/index.css Normal file
View File

@ -0,0 +1,183 @@
@import url('https://fonts.googleapis.com/css?family=Raleway');
html {
font-family: 'Raleway';
/*background-color: #15171B;*/
}
body {
margin: 0;
}
canvas, img {
image-rendering: optimizeSpeed;
image-rendering: -moz-crisp-edges;
image-rendering: -webkit-optimize-contrast;
image-rendering: optimize-contrast;
image-rendering: pixelated;
-ms-interpolation-mode: nearest-neighbor;
}
#DAText {
font-weight: 100;
color: white;
font-size: 500%;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
#imagecode {
width: 35%;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
header {
height: 7vh;
width: 100%;
position: absolute;
top: 0;
background-color: rgba(255,255,255,0.05);
}
#title {
margin: 0;
padding-left: 2%;
padding-right: 2%;
font-family: "Raleway";
line-height: 5vh;
color: white;
font-weight: 100;
display:inline-block;
position: relative;
top: 50%;
transform: translateY(-50%);
float: left;
}
#urlInput {
padding: 2%;
height: 100%;
width: 30%;
background-color: rgba(255,255,255,0.05);
border: 0;
border-radius: 3px;
display: inline-block;
position: relative;
top: 50%;
font-family: "Raleway";
transform: translateY(-50%);
outline: none;
color: white;
font-size: 110%;
float: left;
}
.fa-search, .fa-cog, .fa-bars {
color: white;
float: left;
font-size: 140%;
display: inline-block;
height: 7vh;
width: 7vh;
line-height: 7vh !important;
text-align: center;
cursor: pointer;
background-color: rgba(255,255,255,0);
transition: background-color 0.2s ease;
}
.fa-search:hover, .fa-cog:hover, .fa-bars:hover {
background-color: rgba(255,255,255,0.1);
}
.fa-bars {
float: right;
}
#settings {
position: absolute;
background-color: rgba(255,255,255,0.5);
}
.dropdown {
position: relative;
display: inline-block;
}
.dropdown h1 {
width: 100%;
font-size: 80%;
text-align: center;
line-height: none;
padding: 0;
font-family: "Raleway";
font-weight: 100;
font-size: 120%;
color: white;
}
#speedContainer div {
width: 80%;
margin: auto;
}
.dropdown input {
width: 100%;
cursor: pointer;
-webkit-appearance: none;
background-color: rgba(255,255,255, 0.1);
transition: background-color 0.2s ease;
outline: none;
}
.dropdown input:hover {
background-color: rgba(255,255,255, 0.12);
}
.dropdown input::-webkit-slider-thumb {
background: rgba(255,255,255,0.2);
-webkit-appearance: none;
height: 30%;
width: 10%;
}
#speedContainer {
display: none;
position: absolute;
top: 100%;
background-color: rgba(255,255,255,0.1);
width: 300%;
height: 150%;
}
#modeContainer {
display: none;
position: absolute;
top: 100%;
background-color: rgba(255,255,255,0.1);
right: 0;
width: 350%;
}
#modeContainer p {
cursor: pointer;
margin: 0;
padding: 10% 0 10% 0;
color: white;
font-weight: 100;
text-align: center;
background-color:rgba(0,0,0,0);
transition: background-color 0.2s ease;
}
#modeContainer p:hover {
background-color: rgba(0,0,0,0.1);
}
.show {
display: block !important;
}

40
gyrio/index.html Normal file
View File

@ -0,0 +1,40 @@
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<title>Gyrio</title>
<link rel="stylesheet" href="./index.css">
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.4.0/css/font-awesome.min.css">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
</head>
<header>
<h1 id="title">Gyrio</h1>
<input id="urlInput" name="URL" placeholder=" Insert a URL...">
<i class="fa fa-search" aria-hidden="true" onclick="this.blur();"></i>
<div class="dropdown">
<i class="fa fa-cog dropButton" aria-hidden="true"></i>
<div id="speedContainer" class="dropdown-content">
<h1>Speed</h1>
<div>
<input id="speedInput" type="range" min="5" max="100" value="5">
</div>
</div>
</div>
<div class="dropdown" style="float:right">
<i class="fa fa-bars dropButton" aria-hidden="true"></i>
<div id="modeContainer" class="dropdown-content">
<div>
<p id="LO">Linear Oscilloscope</p>
<p id="DA">Data Auralization</p>
<p id="IV">Image Visualization</p>
</div>
</div>
</div>
</header>
<h1 id="DAText"></h1>
<body>
<canvas id="canvas"></canvas>
</body>
<script src="./index.js"></script>
</html>

364
gyrio/index.js Normal file
View File

@ -0,0 +1,364 @@
function randInt(min,max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
function hexToRGB(hex) {
var r = parseInt(hex.slice(0, 2), 16),
g = parseInt(hex.slice(2, 4), 16),
b = parseInt(hex.slice(4, 6), 16);
return [r,g,b];
}
function convertData(text, base){
// if(text.length < 150) {
// website = "";
// return;
// }
var output = "";
for (var i = 0; i < text.length; i++)
{
var letter = text[i].charCodeAt(0).toString(base);
output += letter;
}
return output;
}
function generateString() {
var final = "";
var length = randInt(50,100);
for(var i = 0; i < length; i++) {
final += randInt(0,1);
}
return final;
}
var canvas = document.getElementById("canvas");
var visualCtx = canvas.getContext("2d");
var audioCtx = new window.AudioContext();
var doAnimate = true;
var freq = [261.63, 293.66, 329.63, 349.23, 392.00, 440.00, 493.88, 523.25];
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
visualCtx.fillStyle = "#000";
visualCtx.fillRect(0,0, canvas.width, canvas.height);
function generateFrames(frame, string, width, height, rate) {
// Rate is in bits per second
// 30 frames per second
var bitsPerSection = Math.ceil(canvas.width/width)+2;
var shift = canvas.width-rate*width*frame/30;
var bitsToCalc = Math.ceil(rate*width*frame/(width*30));
var output = [];
for(var i = bitsToCalc-bitsPerSection; i < bitsToCalc; i++) {
try {
var x = i*width;
if(parseInt(string[i])) {
output.push([x+shift, -height+canvas.height/2]);
output.push([x+width+shift, -height+canvas.height/2]);
if(string[i-1] === 0) {
output.push([x+width+shift, canvas.height/2]);
}
} else {
output.push([x+shift, canvas.height/2]);
output.push([x+width+shift,canvas.height/2]);
}
} catch(err) {}
}
return output;
}
function drawFrame(frame ,input) {
visualCtx.fillRect(0,0, canvas.width, canvas.height);
visualCtx.beginPath();
var frame1 = generateFrames(frame, input, 100, 100, speed);
visualCtx.moveTo(0,(canvas.height/2)-100);
for(var i = 1; i < frame1.length; i++) {
visualCtx.lineTo(frame1[i][0],frame1[i][1]);
}
visualCtx.strokeStyle="#006064";
visualCtx.stroke();
}
function drawFrame2(frame ,input) {
visualCtx.fillRect(0,0, canvas.width, canvas.height);
var ColorList = ["006064"/*,"00838F","0097A7","00ACC1","00B8D4","00E5FF","18FFFF","84FFFF"*/];
for(var j=0;j<ColorList.length;j++){
visualCtx.beginPath();
var frame1 = generateFrames(frame, input, 100, 100, 5);
console.log(frame1);
//frame1= rotate(frame1,30);
var xStart = canvas.width/2;
var yStart = 10*j + canvas.height/2;
var hMM = [xStart*Math.cos(toRad(30))-yStart*Math.sin(toRad(30)),xStart*Math.sin(toRad(30))+yStart*Math.cos(toRad(30))];
visualCtx.moveTo(0,(canvas.height/2)-100);
for(var i = 1; i < frame1.length; i++) {
visualCtx.lineTo(frame1[i][0], /*0.05*(j+1)*(*/frame1[i][1]-canvas.height/2/*-canvas.height/2)+canvas.height/2*/);
}
visualCtx.strokeStyle="#"+ ColorList[j];
visualCtx.stroke();
}
}
function toRad(theta){
return theta*(Math.PI/180);
}
function rotate(list,theta){
var output = [];
for(var i=0;i < list.length;i++){
output.push([list[i][0]*Math.cos(toRad(theta))-list[i][1]*Math.sin(toRad(theta)),list[i][0]*Math.sin(toRad(theta))+list[i][1]*Math.cos(toRad(theta))]);
}
return output;
}
function getWebsite(url) {
var proxy = "https://cors-anywhere.herokuapp.com/";
var xhr = new XMLHttpRequest();
xhr.open("GET", proxy+url, false);
xhr.onreadystatechange = function() {
if(xhr.readyState === 4) {
if(xhr.status === 200) {
} else {
document.getElementById("urlInput").value = "";
alert("Invalid URL!");
}
}
}
xhr.send();
console.log(xhr.status);
if (xhr.status === 200) {
return xhr.responseText;
} else {
return undefined;
}
}
function animate(n , input) {
if(!doAnimate) return;
drawFrame(n, input);
setTimeout(function() { animate(n+1, input); }, 100/3);
}
var type = "LO";
var speed = 5;
var doAnimate = true;
var doSound = false;
var website = "";
var visualCtx = canvas.getContext("2d");
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
visualCtx.fillStyle = "#1a1a1a";
visualCtx.fillRect(0,0, canvas.width, canvas.height);
var osc;
function sound(n, input) {
if(!doSound) {
document.getElementById("DAText").innerHTML = "";
osc.stop();
return;
}
if(n === 0) {
osc = audioCtx.createOscillator();
osc.connect(audioCtx.destination);
osc.start(0);
osc.type = "sawtooth";
// osc.frequency.value = 261.63;
temp = [];
}
// var max = 523.25;
// var min = 130.81;
document.getElementById("DAText").innerHTML = input[n];
osc.frequency.value = freq[input[n]];
// osc.frequency.value = parseInt(input.substr(n, 10), 2);
// var rand = randInt(130, 523);
// var direction = 1;
// if (rand < osc.frequency.value) {direction = -1;}
// osc.frequency.value += direction * input[n] * 10;
setTimeout(function() { sound(n+1, input); }, 10*speed);
}
function image(input) {
try {
document.getElementById("imagecode").parentNode.removeChild(document.getElementById("imagecode"));
} catch(err) {}
n = 0;
imagecan = document.createElement('canvas');
imagecan.width = Math.floor(Math.sqrt(input.length/6));
imagecan.height = imagecan.width;
imagecan.id = "imagecode";
document.body.appendChild(imagecan);
var ctx = imagecan.getContext("2d");
var imageData = ctx.getImageData(0,0,imagecan.width, imagecan.height);
for(var i = 0; i < imageData.data.length; i++) {
fill = hexToRGB(input.substr(n,6));
imageData.data[4*i] = fill[0];
imageData.data[4*i+1] = fill[1];
imageData.data[4*i+2] = fill[2];
imageData.data[4*i+3] = 255;
n += 6;
}
// fakeimage = document.createElement('canvas');
// fakeimage.width = imagecan.width;
// fakeimage.height = imagecan.height;
// fakeimage.getContext("2d").putImageData(imageData, 0, 0);
// ctx.canvas.width = 480;
// ctx.canvas.height = 480;
// ctx.scale(imagecan.width * (480/imagecan.width), imagecan.height *(480/imagecan.height));
// ctx.drawImage(fakeimage, 0, 0);
// console.log(fakeimage, ctx)
ctx.putImageData(imageData, 0, 0);
}
function search() {
var input = document.getElementById("urlInput");
var value = input.value;
if(value === "" || value === website && type !== "IV") return;
website = value;
visualCtx.fillStyle = "#1a1a1a";
visualCtx.fillRect(0,0, canvas.width, canvas.height);
try {
document.getElementById("imagecode").parentNode.removeChild(document.getElementById("imagecode"));
} catch(err) {}
switch(type) {
case "LO":
var data = convertData(getWebsite(website),2);
doSound = false;
doAnimate = false;
setTimeout(function() {
speed = 5;
doAnimate = true;
document.getElementById("speedInput").value = 5;
animate(0, data);
}, 100/3);
break;
case "DA":
var data = convertData(getWebsite(website),8);
doAnimate = false;
doSound = false;
setTimeout(function() {
speed = 50;
doSound = true;
document.getElementById("speedInput").value = 50;
sound(0, data);
}, 100/3);
break;
case "IV":
var data = convertData(getWebsite(website),16);
doAnimate = false;
doSound = false;
setTimeout(function() {
image(data);
}, 100/3);
break;
}
}
document.getElementsByClassName("fa-search")[0].onclick = function() {
search();
}
document.getElementById("urlInput").onkeypress = function(e) {
if(e.keyCode == 13) {
search();
}
}
document.getElementsByClassName("fa-cog")[0].onclick = function() {
document.getElementById("speedContainer").classList.toggle("show");
}
document.getElementsByClassName("fa-bars")[0].onclick = function() {
document.getElementById("modeContainer").classList.toggle("show");
}
window.onclick = function(event) {
if (!event.target.matches(".dropButton")) {
var dropdowns = document.getElementsByClassName("dropdown-content");
for (var i = 0; i < dropdowns.length; i++) {
var openDropdown = dropdowns[i];
if (openDropdown.classList.contains('show')) {
openDropdown.classList.remove('show');
}
}
}
}
document.getElementById("speedInput").onchange = function() {
speed = parseInt(this.value);
}
document.getElementById("LO").onclick = function() {
if(type === "LO") return;
if(website === "") {
alert("Please enter a website!");
return;
}
type = "LO";
try {
document.getElementById("imagecode").parentNode.removeChild(document.getElementById("imagecode"));
} catch(err) {}
var data = convertData(getWebsite(website),2);
visualCtx.fillStyle = "#1a1a1a";
visualCtx.fillRect(0,0, canvas.width, canvas.height);
doSound = false;
doAnimate = false;
setTimeout(function() {
speed = 5;
doAnimate = true;
document.getElementById("speedInput").value = 5;
animate(0, data);
}, 100/3);
}
document.getElementById("DA").onclick = function() {
if(type === "DA") return;
if(website === "") {
alert("Please enter a website!");
return;
}
type = "DA";
try {
document.getElementById("imagecode").parentNode.removeChild(document.getElementById("imagecode"));
} catch(err) {}
var data = convertData(getWebsite(website),8);
visualCtx.fillStyle = "#1a1a1a";
visualCtx.fillRect(0,0, canvas.width, canvas.height);
doAnimate = false;
doSound = false;
setTimeout(function() {
speed = 50;
doSound = true;
document.getElementById("speedInput").value = 50;
sound(0, data);
}, 100/3);
}
document.getElementById("IV").onclick = function() {
if(type === "IV") return;
if(website === "") {
alert("Please enter a website!");
return;
}
type = "IV";
var data = convertData(getWebsite(website),16);
visualCtx.fillStyle = "#1a1a1a";
visualCtx.fillRect(0,0, canvas.width, canvas.height);
doAnimate = false;
doSound = false;
setTimeout(function() {
image(data);
}, 100/3);
}

1
hourglass/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
node_modules/

View File

@ -0,0 +1,15 @@
# This file contains information which helps Meteor properly upgrade your
# app when you run 'meteor update'. You should check it into version control
# with your project.
notices-for-0.9.0
notices-for-0.9.1
0.9.4-platform-file
notices-for-facebook-graph-api-2
1.2.0-standard-minifiers-package
1.2.0-meteor-platform-split
1.2.0-cordova-changes
1.2.0-breaking-changes
1.3.0-split-minifiers-package
1.4.0-remove-old-dev-bundle-link
1.4.1-add-shell-server-package

1
hourglass/.meteor/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
local

7
hourglass/.meteor/.id Normal file
View File

@ -0,0 +1,7 @@
# This file contains a token that is unique to your project.
# Check it into your repository along with the rest of this directory.
# It can be used for purposes such as:
# - ensuring you don't accidentally deploy one app on top of another
# - providing package authors with aggregated statistics
gqrxcygykwad5nac7m

View File

@ -0,0 +1,49 @@
# Meteor packages used by this project, one per line.
# Check this file (and the other files in this directory) into your repository.
#
# 'meteor add' and 'meteor remove' will edit this file for you,
# but you can also edit it by hand.
meteor-base@1.0.4 # Packages every Meteor app needs to have
mobile-experience@1.0.4 # Packages for a great mobile UX
mongo@1.1.14 # The database Meteor supports right now
blaze-html-templates@1.0.4 # Compile .html files into Meteor Blaze views
reactive-var@1.0.11 # Reactive variable for tracker
jquery@1.11.10 # Helpful client-side library
tracker@1.1.1 # Meteor's client-side reactive programming library
standard-minifier-js@1.2.1 # JS minifier run for production mode
es5-shim@4.6.15 # ECMAScript 5 compatibility for older browsers.
ecmascript@0.5.9 # Enable ECMAScript2015+ syntax in app code
fortawesome:fontawesome
session@1.1.7
proyk:meteor-cookies
aldeed:simple-schema
accounts-google@1.0.11
accounts-ui@1.1.9
iron:router
ongoworks:security
mizzao:autocomplete
alanning:roles
rzymek:fullcalendar
momentjs:moment@=2.15.1
shell-server@0.2.1
http@1.2.10
underscore@1.0.10
ahref:dragula
pfafman:filesaver
natestrauser:select2
juliancwirko:s-alert
juliancwirko:s-alert-stackslide
aldeed:collection2
dburles:collection-helpers
yogiben:admin-edit
mfactory:admin-lte
standard-minifier-css@1.3.2
rochal:slimscroll
mrt:jquery-ui
rajit:bootstrap3-datepicker
hammer:hammer@=2.0.4_1
velocityjs:velocityjs
mystor:device-detection

View File

@ -0,0 +1,2 @@
browser
server

View File

@ -0,0 +1 @@
METEOR@1.4.2

133
hourglass/.meteor/versions Normal file
View File

@ -0,0 +1,133 @@
accounts-base@1.2.14
accounts-google@1.0.11
accounts-oauth@1.1.14
accounts-ui@1.1.9
accounts-ui-unstyled@1.1.13
ahref:dragula@3.5.4
alanning:roles@1.2.15
aldeed:autoform@5.8.1
aldeed:collection2@2.10.0
aldeed:collection2-core@1.2.0
aldeed:schema-deny@1.1.0
aldeed:schema-index@1.1.1
aldeed:simple-schema@1.5.3
aldeed:tabular@1.6.1
aldeed:template-extension@4.0.0
allow-deny@1.0.5
autoupdate@1.3.12
babel-compiler@6.13.0
babel-runtime@0.1.13
base64@1.0.10
binary-heap@1.0.10
blaze@2.2.0
blaze-html-templates@1.0.5
blaze-tools@1.0.10
boilerplate-generator@1.0.11
caching-compiler@1.1.8
caching-html-compiler@1.0.7
callback-hook@1.0.10
check@1.2.4
coffeescript@1.11.1_2
cosmos:browserify@0.10.0
dandv:caret-position@2.1.1
dburles:collection-helpers@1.1.0
ddp@1.2.5
ddp-client@1.3.2
ddp-common@1.2.7
ddp-rate-limiter@1.0.6
ddp-server@1.3.11
deps@1.0.12
diff-sequence@1.0.7
ecmascript@0.5.9
ecmascript-runtime@0.3.15
ejson@1.0.13
email@1.1.18
es5-shim@4.6.15
fastclick@1.0.13
fortawesome:fontawesome@4.7.0
geojson-utils@1.0.10
google@1.1.15
hammer:hammer@2.0.4_1
hot-code-push@1.0.4
html-tools@1.0.11
htmljs@1.0.11
http@1.2.10
id-map@1.0.9
iron:controller@1.0.12
iron:core@1.0.11
iron:dynamic-template@1.0.12
iron:layout@1.0.12
iron:location@1.0.11
iron:middleware-stack@1.1.0
iron:router@1.0.13
iron:url@1.0.11
jquery@1.11.10
juliancwirko:s-alert@3.2.0
juliancwirko:s-alert-stackslide@3.1.3
launch-screen@1.1.0
less@2.7.6
livedata@1.0.18
localstorage@1.0.12
logging@1.1.16
mdg:validation-error@0.5.1
meteor@1.6.0
meteor-base@1.0.4
meteorhacks:meteorx@1.4.1
meteorhacks:unblock@1.1.0
mfactory:admin-lte@0.0.2
minifier-css@1.2.15
minifier-js@1.2.15
minimongo@1.0.18
mizzao:autocomplete@0.5.1
mobile-experience@1.0.4
mobile-status-bar@1.0.13
modules@0.7.7
modules-runtime@0.7.7
momentjs:moment@2.15.1
mongo@1.1.14
mongo-id@1.0.6
mrt:jquery-ui@1.9.2
mystor:device-detection@0.2.0
natestrauser:select2@4.0.3
npm-mongo@2.2.11_2
oauth@1.1.12
oauth2@1.1.11
observe-sequence@1.0.14
ongoworks:security@2.0.1
ordered-dict@1.0.9
pfafman:filesaver@1.3.2
promise@0.8.8
proyk:meteor-cookies@0.0.1
raix:eventemitter@0.1.3
raix:handlebar-helpers@0.2.5
rajit:bootstrap3-datepicker@1.5.1
random@1.0.10
rate-limit@1.0.6
reactive-dict@1.1.8
reactive-var@1.0.11
reload@1.1.11
retry@1.0.9
reywood:publish-composite@1.4.2
rochal:slimscroll@1.3.3
routepolicy@1.0.12
rzymek:fullcalendar@2.7.2
service-configuration@1.0.11
session@1.1.7
shell-server@0.2.1
spacebars@1.0.13
spacebars-compiler@1.0.13
standard-minifier-css@1.3.2
standard-minifier-js@1.2.1
templating@1.2.15
templating-compiler@1.2.15
templating-runtime@1.2.15
templating-tools@1.0.5
tracker@1.1.1
ui@1.0.12
underscore@1.0.10
url@1.0.11
velocityjs:velocityjs@1.2.1
webapp@1.3.12
webapp-hashing@1.0.9
yogiben:admin-edit@1.2.8
zimme:active-route@2.3.2

674
hourglass/LICENSE Normal file
View File

@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
{one line to give the program's name and a brief idea of what it does.}
Copyright (C) {year} {name of author}
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
{project} Copyright (C) {year} {fullname}
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

74
hourglass/README.md Normal file
View File

@ -0,0 +1,74 @@
# Hourglass
Everything in one place. We'll handle the organization, you handle the work.
Hourglass is a planner web app specialized for schools and students. It is an student run planner,
where people in the same class can view all the related work.
## Usage
How to use Hourglass:
If you find any bugs or have an idea to make this better, you can press the question mark on the sidebar.
### Main Page
After logging in with a Google account and setting up your profile, you will redirect to this page. Here, you can view work from subscribed classes. The left sidebar has three modes: Main, Settings, and Feedback.
### Main
This will allow changing modes: class mode, and calendar mode. It also allows filters for all of the subscribed classes. Hovering over classes will highlight their respective works, and clicking on a class will filter them, only displaying those filtered. You can filter more than one class at a time or filter by the type of work.
##### Calendar Mode
Calendar mode organizes work by due date rather than by class. Pressing on a date will open the left sidebar, allowing you to choose a class in which you want to create the work.
##### Class Mode
Class mode allows you to organize work by the class it belongs to. You can drag classes to reorder them.
### Settings
This will allow changing preferences, including: Theme, Default Mode, Hide Homework, Hide Done, and Hide Reported, which are fairly self-explanatory. Additionally, this allows managing classes, where you can manage, join, and create classes.
##### Manage Classes
Here, you can see details of the class. If you are an admin of the class, clicking on it will allow you to manage details about the class. Otherwise, you can leave the class by clicking the X.
##### Join Classes
Join a public class by searching for and then clicking on the class you want to join. Joining a private class requires a code provided by the class administrator, which you enter in the field provided after clicking the "Join Private Class" button.
##### Create Classes
After filling out class details, class creators must wait for the class to be approved by administrators. Public classes can be viewed and joined by all, while private classes are hidden from others and require a code to join.
### Feedback
As mentioned earlier, send us feedback here, to know what we should improve on, or things that you want to add.
##### Work
Every piece of work has a confirmed to reported ratio. This is the ratio of the number of people who confirm the validity of the work to the number of people who believe that this is a false report. The creator of a work can edit fields after creation by clicking on details needed to be changed. Lastly, by marking a work as done, it is hidden from view. To disable this, go to preferences.
##### Filters
In the left sidebar, you find options for filtering. These include filtering by class or type of assignment.
## Changelog
### 0.2.3
- Mobile sidebar closes on tap from the side
- Mobile sign-up bug fixed
- Calendar date bug fixed
- Fixed visual issues
- Class code bug fixes
- Updating system fixed
### 0.2.2
- Fixed visual issues in mobile
- Drag scrolling for classes mode on desktop version
- Small name changes
- Changed maximum characters of description to 300
### 0.2.1
- Mobile support added
- Fixed visual bugs
### 0.2.0
- Large UI redesign
- Scrollbars now functional
- Redesigned logo
- Fixed visual bugs
- New profile creation page
### 0.1.3
- Changed some icons
- Fixed some resolution issues
- Fixed class approval (you can now join other peoples classes)
- Change export format to iCal
- Admin/Server fixes
- Minor bug fixes
### 0.1.2
- First beta version
- Fixed resolution / display issues
- Bug fixes
### 0.1.1
- Added dynamic resizing, zooming and scaling support for CSS.
- Fixed reactive updating on work.
- Added personal work.

View File

@ -0,0 +1,135 @@
.content-wrapper {
background-color: #232427 !important;
}
.content-wrapper h4 {
color: #FEFEFE;
}
.col-lg-3 {
-webkit-filter: drop-shadow(2px 2px 2px #CCC);
filter: drop-shadow(2px 2px 2px #666);
}
.main-header .logo {
background-color: #222d32;
}
.main-sidebar {
box-shadow: -2px 1px 1px 5px #666;
}
.navbar {
background-color: #2F414A !important;
box-shadow: 7px -2px 1px 5px #666;
}
.content-header h1, #adminAddWrapper {
background-color: #FFF;
border: 5px solid #FFF;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
}
.breadcrumb {
margin-right: 1%;
}
.adminUserIcon, .simpleUserIcon {
width: 1.5vw;
margin: 1%;
cursor: pointer;
-moz-border-radius: 50%;
-webkit-border-radius: 50%;
border-radius: 50%;
}
.adminUserInfo {
margin-top: 1vh;
padding: 0.5% 1.5% 0.5% 1.5%;
background-color: #fff;
-webkit-filter: drop-shadow(0px -1px 2px #666);
filter: drop-shadow(0px -1px 2px #666);
position: fixed;
display: none;
z-index: 5;
}
.adminUserInfo p {
margin: 5% 0 5% 0;
}
.infoTitle {
font-weight: 600;
}
.infoTab {
width: 0;
height: 0;
border-bottom: 2vh solid #fff;
border-left: 1.5vh solid transparent;
border-right: 1.5vh solid transparent;
position: absolute;
right: 1vh;
top: -1.9vh;
}
.approveStatus {
cursor: pointer;
}
.approveStatus .fa {
font-size: 5vh
}
.approveStatus .fa-toggle-on {
color: #288CD3;
}
.addAdmin {
width: 35% !important;
}
.simpleUserIcon {
margin: 0.5% 0.3% 0.5% 0.2%;
display: inline-block;
vertical-align: top;
cursor: default;
}
.simpleUserInfo {
margin: 0.5% 0.3% 0.5% 0.2%;
background-color: #FFF;
display: inline-block;
vertical-align: top;
}
.simpleUserInfo p {
margin: 1%;
}
.simpleUserInfo p:first-child {
font-weight: 400;
}
.simpleUserInfo p:last-child {
font-weight: 200;
color: #D8D8D8;
}
.addAdmin {
margin: 0 0 1% 1%;
display: inline-block !important;
}
#addAdmin {
margin-left: 1%;
display: inline-block;
}

View File

@ -0,0 +1,51 @@
<template name="adminUserDisplay">
{{#each info}}
<img class="adminUserIcon" src="{{icon}}">
<div class="adminUserInfo">
<div class="infoTab"></div>
<p><span class="infoTitle">ID: </span><span>{{id}}</span></p>
<p><span class="infoTitle">Email: </span><span>{{email}}</span></p>
<p><span class="infoTitle">Name: </span><span>{{name}}</span></p>
</div>
{{/each}}
</template>
<template name="statusButton">
<div class="approveStatus">
<i class="fa fa-toggle-{{status}}" aria-hidden="true"></i>
</div>
</template>
<template name="userEditor">
{{#if superAdmin}}
{{> quickForm id="editUser" collection="Meteor.users" doc=userInfo schema="userSchema" type="update"}}
{{else}}
<h4>You are not authorized to edit users.</h4>
{{/if}}
</template>
<template name="createAdmin">
{{#if superAdmin}}
<div id="adminAddWrapper">
<h3>Search</h3>
<div>
{{> inputAutocomplete settings=userComplete class="form-control addAdmin" type="text" placeholder="Example: 1234@abc.xyz" }}
<button id="addAdmin" class="btn btn-primary">Add</button>
</div>
</div>
{{else}}
{{> disableUser}}
{{/if}}
</template>
<template name="disableUser">
<h4>You are not authorized to edit this.</h4>
</template>
<template name="simpleUser">
<img class="simpleUserIcon" src="{{services.google.picture}}">
<div class="simpleUserInfo">
<p>{{profile.name}}</p>
<p>{{services.google.email}}</p>
</div>
</template>

View File

@ -0,0 +1,103 @@
var inInfo = false;
var openUserDisplay = null;
Template.adminUserDisplay.helpers({
info() {
var ids = (this.value instanceof Array) ? this.value : [this.value];
var userInfo = [];
for(var i = 0; i < ids.length; i++) {
var user = Meteor.users.findOne({_id: ids[i]});
userInfo.push({
name: user.profile.name,
email: user.services.google.email,
id: user._id,
icon: user.services.google.picture
});
}
return userInfo;
}
});
Template.statusButton.helpers({
status() {
return (this.value) ? "on" : "off";
}
});
Template.adminUserDisplay.events({
'click .adminUserIcon' (event) {
var icoCoords = $(event.target)[0].getBoundingClientRect();
var x = window.innerWidth - icoCoords.right;
var y = icoCoords.bottom;
openUserDisplay = $(event.target).next();
$(".adminUserInfo").fadeOut(200);
openUserDisplay
.css({'right': x, 'top': y})
.fadeIn(200);
},
'mouseenter .adminUserInfo' () {
inInfo = true;
},
'mouseleave .adminUserInfo' (event) {
if(inInfo) openUserDisplay.fadeOut(200);
inInfo = false;
openUserDisplay = null;
}
});
Template.AdminLTE.events({
'click' (event) {
if(!event.target.className.includes("adminUserInfo") &&
!event.target.className.includes("adminUserIcon") &&
openUserDisplay !== null) {
if(!openUserDisplay[0].contains(event.target)) {
openUserDisplay.fadeOut(200, function() {
openUserDisplay = null;
});
}
}
}
});
Template.statusButton.events({
'click .approveStatus' () {
Meteor.call("approveClass", this.doc._id);
}
});
Template.userEditor.helpers({
userInfo : function() {
return Session.get("admin_doc")
},
superAdmin: function() {
return Roles.userIsInRole(Meteor.userId(), ['superadmin']);
}
});
Template.createAdmin.helpers({
userComplete() {
return {
position: "bottom",
limit: 7,
rules: [{
token: '',
collection: Meteor.users,
field: 'services.google.email',
filter: {roles: {$not: {$elemMatch: {$eq: "admin"}}}},
template: Template.simpleUser
}]
};
},
superAdmin: function() {
return Roles.userIsInRole(Meteor.userId(), ['superadmin']);
}
});
Template.createAdmin.events({
'click #addAdmin' () {
var value = document.getElementsByClassName("form-control")[0].value;
var user = Meteor.users.findOne({'services.google.email': value});
if(user === undefined) return;
Meteor.call("addAdmin", user._id);
}
})

View File

@ -0,0 +1,252 @@
#loginHeader {
height: 6vh;
padding: 2.5vh 0 0 2vh;
background-color: #222328;
}
#loginBody {
height: 94vh;
width: 100%;
background-color: #222328;
}
#loginFooter {
width: 100%;
height: 6vh;
position: absolute;
bottom: 0;
}
#loginLogo {
height: 100%;
cursor: pointer;
}
#loginTexts {
color: #FCF0F0;
width: 45%;
margin-left: 48%;
position: absolute;
top: 23vh;
}
#loginTexts h1 {
font-size: 7vh;
font-weight: 300;
margin: 0;
padding: 0;
line-height: 3vh;
}
#loginTexts h2 {
font-size: 15vh;
}
#loginTexts h5 {
font-size: 5vh;
font-weight: 100;
}
#loginDec {
width: 49vw;
height: 200vh;
background-color: rgba(255,255,255,0.1);
position: absolute;
top: -46vh;
right: 5vw;
-webkit-transform: rotate(150deg);
-ms-transform: rotate(150deg);
transform: rotate(150deg);
}
#loginCirc {
width: 55vh;
height: 55vh;
background-color: rgba(255,255,255,0.1);
-moz-border-radius: 50%;
-webkit-border-radius: 50%;
border-radius: 50%;
position: absolute;
top: 20vh;
left: 7vh;
}
#loginMidLogo {
height: 44vh;
position: absolute;
top: 26vh;
left: 12.5vh;
}
.loginButtons {
font-size: 3.5vh;
width: 12vw;
margin-top: 4vh;
margin-left: 5vw;
padding: 1vh;
background-color: #27A127;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;
text-align: center;
cursor: pointer;
-webkit-transition: background-color 0.4s ease;
-moz-transition: background-color 0.4s ease;
-ms-transition: background-color 0.4s ease;
transition: background-color 0.4s ease;
}
.loginButtons:hover {
background-color: #239023;
}
#loginContainer {
display: flex;
}
#demoButton {
border: 1px solid #FCF0F0;
background-color: rgba(0,0,0,0);
margin-left: 4vw;
}
#demoButton:hover {
background-color: rgba(255,255,255,0.1);
}
#version {
font-size: 1.7vh;
color: #FFF !important;
margin-right: 1%;
height: 6vh;
margin: 0;
padding-right: 1vw;
line-height: 6vh;
display: inline-block;
float: right;
}
a {
color: #0099CC;
text-decoration: none;
-webkit-transition: color 0.4s ease;
-moz-transition: color 0.4s ease;
-ms-transition: color 0.4s ease;
transition: color 0.4s ease;
}
a:hover {
color: #00BFFF;
}
.github-corner:hover .octo-arm {
animation:octocat-wave 560ms ease-in-out
}
@keyframes octocat-wave {
0%,100% { transform:rotate(0) }
20%,60% { transform:rotate(-25deg) }
40%,80% { transform:rotate(10deg) }
}
@media (max-width:500px) {
.github-corner:hover .octo-arm {
animation:none
}
.github-corner .octo-arm {
animation:octocat-wave 560ms ease-in-out
}
}
/* Mobile */
#mLoginCirc {
width: 87vw;
height: 87vw;
background-color: rgba(255,255,255,0.1);
-moz-border-radius: 50%;
-webkit-border-radius: 50%;
border-radius: 50%;
position: absolute;
top: 15vw;
left: 6.5vw;
}
#mLoginMidLogo {
height: 70vw;
position: absolute;
top: 23.5vw;
left: 15vw;
}
#mLoginTexts {
color: #FCF0F0;
width: 100%;
position: absolute;
bottom: 9vh;
}
#mLoginTexts h1 {
width: 90%;
font-size: 8vw;
font-weight: 300;
margin: 0 auto 0 auto;
padding: 0;
text-align: center;
}
#mLoginTexts h5 {
width: 90%;
margin: 0 auto 0 auto;
font-size: 5vw;
font-weight: 100;
text-align: Center;
}
#mLoginButton {
font-size: 5vw;
width: 30vw;
margin: auto;
margin-top: 3vh;
padding: 2vw;
border: 1px solid #FCF0F0;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;
text-align: center;
cursor: pointer;
-webkit-tap-highlight-color: rgba(255,255,255,0.3);
}
#mVersion {
font-size: 3vw;
color: #FFF !important;
margin-right: 1%;
height: 6vh;
margin: 0;
padding-right: 3vw;
line-height: 6vh;
display: inline-block;
float: right;
}

View File

@ -0,0 +1,61 @@
<template name="login">
<div class="noScroll">
<a href="https://github.com/ksjdragon/hourglass" target="_blank" class="github-corner" aria-label="View source on Github">
<svg width="80" height="80" viewBox="0 0 250 250" style="fill:#B63737; color:#222328; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true">
<path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path>
<path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path>
<path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path>
</svg>
</a>
<div id="loginHeader">
<img src="./Logos/LogoTextSmall.png" id="loginLogo" onclick="window.location.href='/'">
</div>
<div id="loginBody">
<div id="loginDec"></div>
<div id="loginCirc"></div>
<img src="./Logos/ColoredLogo.png" id="loginMidLogo">
<div id="loginTexts">
<h1>Everything in</h1>
<h2>One Place.</h2>
<h5><b>We</b> handle the organization, <b>you</b> handle the work.</h5>
<div id="loginContainer">
<div class="loginButtons" onclick="document.getElementById('login-buttons-google').click()">Sign in!</div>
<div class="loginButtons" id="demoButton" onclick="Session.set('demo',true);">Demo</div>
</div>
</div>
</div>
<footer id="loginFooter">
<p id="version">Version {{version}}</p>
</footer>
</div>
{{> loginButtons}}
</template>
<template name="mLogin">
<div class="noScroll">
<a href="https://github.com/ksjdragon/hourglass" target="_blank" class="github-corner" aria-label="View source on Github">
<svg width="80" height="80" viewBox="0 0 250 250" style="fill:#B63737; color:#222328; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true">
<path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path>
<path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path>
<path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path>
</svg>
</a>
<div id="loginHeader">
<img src="./Logos/LogoTextSmall.png" id="loginLogo" onclick="window.location.href='/'">
</div>
<div id="loginBody">
<div id="mLoginCirc"></div>
<img src="./Logos/ColoredLogo.png" id="mLoginMidLogo">
<div id="mLoginTexts">
<h1>Everything in <b>One Place</b></h1>
<h5><b>We</b> handle the organization, <b>you</b> handle the work.</h5>
<div id="mLoginButton" onclick="document.getElementById('login-buttons-google').click()">Sign in!</div>
</div>
</div>
<footer id="loginFooter">
<p id="mVersion">Version {{version}}</p>
</footer>
</div>
{{> loginButtons}}
</template>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,348 @@
<head>
<title>Hourglass</title>
<link rel="icon" href="/favicon.ico?v=2">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"/>
</head>
<template name="main">
{{> sAlert}}
<div class="noScroll">
<img id="bg" src={{bgSrc}} style="min-width:{{screen}}">
<div id="divLeftBar">
<div id="menuBar" style="background-color:{{divColor 'sidebarColor'}}">
<i class="barIco fa fa-bars" style="color:{{iconStatus 'menu'}}" aria-hidden="true"></i>
<i class="barIco fa fa-cog" style="color:{{iconStatus 'option'}}" aria-hidden="true"></i>
<i class="barIco fa fa-question" style="color:{{iconStatus 'requests'}}" aria-hidden="true"></i>
</div>
<div id="menuContainer" style="background-color:{{divColor 'sidebarColor'}};">
<div class="menuWrapper">
{{#if sidebarStatus 'menu'}}
{{> sidebarMenuPlate}}
{{/if}}
{{#if sidebarStatus 'option'}}
{{> sidebarOptionPlate}}
{{/if}}
{{#if sidebarStatus 'requests'}}
{{> sidebarRequestPlate}}
{{/if}}
{{#if sidebarStatus 'create'}}
{{> sidebarCreatePlate}}
{{/if}}
</div>
</div>
</div>
<div id="divCenter">
<header id="mainHeader" style="background-color:{{divColor 'mainColor'}}">
<h1>Hourglass</h1><h2>{{schoolName}}</h2>
<div id="dropdown">
<img src="{{avatar}}">
<h4>{{username}}</h4>
</div>
</header>
<div id="mainBody{{highlight}}">
{{#if currMode 'classes'}}
<div id="classesMode">
{{#each myClasses}}
{{> classesMode}}
{{/each}}
</div>
{{/if}}
{{#if currMode 'calendar'}}
<div id="calendar">
{{> fullcalendar calendarOptions}}
</div>
{{/if}}
{{#if currSettingMode 'manageClass'}}
{{> manageClass}}
{{/if}}
{{#if currSettingMode 'addClass'}}
{{> joinClass}}
{{/if}}
{{#if currSettingMode 'createClass'}}
{{> createClass}}
{{/if}}
</div>
</div>
<div class="overlay">
<div id="editWork">
<div id="editWorkCont" style="background-color:{{divColor 'mainColor'}};border-top:10px solid {{work 'typeColor'}};">
<div id="workInfoContainer">
{{#if inRole}}
{{> workDisplayEdit}}
{{else}}
{{> workDisplay}}
{{/if}}
{{#unless newWork}}
<div id="workInfo2">
<div id="workComments">
<h3>Comments</h3>
<div>
<textarea id="workComment" class="restrict" rows="4" cols="50" maxlength="200" style="color:{{divColor 'textColor'}}"></textarea><br>
<div>
<span class="resText">{{restrict 'workComment'}}</span>
<div id="commentSubmit">Submit</div>
</div>
</div>
<div id="comment">
{{#each work 'comments'}}
{{> comment}}
{{/each}}
</div>
</div>
</div>
{{/unless}}
</div>
{{#unless newWork}}
<div id="workToggle">
<div id="doneUsers">
{{#each work 'done'}}
{{> doneUsers}}
{{/each}}
</div>
<div id="toggleButtons">
<div id="markDone" style="background-color:{{work 'doneCol'}}">
<i class="fa {{work 'doneIcon'}}" aria-hidden="true"></i>
<p>{{work 'doneText'}}</p>
</div>
<div id="markConfirm" style="color:{{work 'userConfirm'}}">
<i class="fa fa-thumbs-up" aria-hidden="true"></i>
<p>{{work 'confirmations'}}</p>
</div>
<div id="markReport" style="color:{{work 'userReport'}}">
<i class="fa fa-exclamation-triangle" aria-hidden="true"></i>
<p>{{work 'reports'}}</p>
</div>
<div class="workCreator doneUser">
<div>
<img src="{{work 'avatar'}}">
</div>
<div>
<span>{{work 'creator'}}</span>
</div>
</div>
</div>
</div>
{{/unless}}
{{#if inRole}}
{{#if newWork}}
<div id="workSubmit">Save</div>
{{else}}
<div id="workDelete">Delete</div>
{{/if}}
{{/if}}
</div>
</div>
</div>
<div id="confirmOverlay">
<div class="overlayCont" style="background-color:{{divColor 'mainColor'}}">
<p>{{confirmText}}</p>
<div id="faCont">
<i class="fa fa-check-circle-o" aria-hidden="true"></i>
<i class="fa fa-times-circle-o" aria-hidden="true"></i>
</div>
</div>
</div>
<div id="userDropdown" style="background-color:{{divColor 'userDropdownColor'}}">
<div id="userTab" style="border-bottom: 3vh solid {{divColor 'userDropdownColor'}}"></div>
<div id="userDropdownAvatar" style="background-color:{{divColor 'userDropdownColor'}}">
<img src="{{avatar}}">
<p>{{username}}</p>
</div>
<div id="userFunctions" style="background-color:{{divColor 'userDropdownColor'}}">
{{#if admin}}
<div class="userFunction" onclick="window.location='/admin';">
<i class="fa fa-cogs" aria-hidden="true"></i>
<p>Admin Panel</p>
</div>
{{/if}}
</div>
<div style="background-color:{{divColor 'userDropdownColor'}}">
<div id="signout" class="userFunction">
<i class="fa fa-sign-out" aria-hidden="true"></i>
<p>Sign out</p>
</div>
</div>
</div>
{{> loginButtons}}
</div>
</template>
<template name="sidebarClasses">
<div class="sideClass" classid="{{_id}}">
<div class="status" style="background-color:{{selected}}"></div>
<span class="sideClassName">{{name}}</span>
<span class="sideClassHour">{{hour}}</span>
</div>
</template>
<template name="sideTypeFilter">
<div class="sideFilter" type="{{type}}">
<div class="status" style="background-color:{{selected}}"></div>
<span class="sideTypeName">{{typeName}}</span>
</div>
</template>
<template name="classesMode">
<div class="classWrapper"> <!-- class color -->
<div class="mainClass" style="background-color:{{divColor 'classCardColor'}}">
{{#if status}}
<div class="classInfo">
<h3 class="mainClassName">{{name}}</h3>
<p class="mainClassHour">{{hour}}</p>
<p class="mainClassTeacher">{{teacher}}</p>
</div>
{{else}}
<div class="classInfo" style="border-top:1vh solid #E64F4F;padding-top:2vh">
<h3 class="mainClassName">{{name}}</h3>
<p class="mainClassHour">{{hour}}</p>
<p class="mainClassTeacher">{{teacher}}</p>
<p class="mainClassStatus">Unapproved</p>
</div>
{{/if}}
<div class="creWork" classid="{{_id}}">
<i class="fa fa-plus" aria-hidden="true"></i>
<h4>Add Work</h4>
</div>
<div class="workHolder">
{{#each thisClassWork}}
{{> classModeWork}}
{{/each}}
</div>
</div>
</div>
</template>
<template name="classModeWork">
<div class="workCard" workid="{{_id}}" classid="{{classid}}" type="{{type}}">
<div class="cWorkType" style="background-color:{{typeColor}}"></div>
<div class="cWorkCont">
<div class="cWorkTop">
<h3 class="cWorkName">{{name}}</h3>
<span class="cWorkCreator">{{creatorname}}</span>
</div>
<div class="cWorkBottom">
<span class="cWorkDate" style="font-weight:{{cardDate}}">{{dateWord}}</span>
<div style="color:{{doneRatio}}">
<i class="fa fa-thumbs-up" aria-hidden="true" style="color:{{confirmed}}"></i>
<span>{{confirmationLength}}</span>
<i class="fa fa-exclamation-triangle" aria-hidden="true" style="color:{{reported}}"></i>
<span>{{reportLength}}</span>
</div>
</div>
</div>
</div>
</template>
<template name="comment">
<div class="commentBox">
<div class="commentAvatarCont">
<img class="commentAvatar" src='{{avatar}}' onclick="window.location='/user/{{email}}'">
</div>
<div class="commentInfo">
<span class="commentComment">{{comment}}</span><br>
<span class="commentUser">{{user}}</span>
<span class="commentDate">{{date}}</span>
</div>
</div>
</template>
<template name="doneUsers">
<div class="doneUser">
<div>
<img src='{{avatar}}'>
</div>
<div>
<span>{{user}}</span>
</div>
</div>
</template>
<template name="option">
<p class="optionText" style="background-color:{{divColor 'mainColor'}};" onmouseover="$(this).css('box-shadow','inset 0 0 0 99999px rgba(0,0,0,0.2)');" onmouseleave="$(this).css('box-shadow','');">{{alias}}</p>
</template>
<template name="workDisplay">
<div id="workNameDiv">
<span id="wName" class="info">{{work 'name'}}</span>
</div>
<div id="workInfo1">
<div>
<span class="workTitle">Class:</span><span style="font-size:2.2vh">{{work 'class'}}</span>
</div>
<div>
<span class="workTitle">Due Date:</span><br>
<span id="wDescription" class="info">{{work 'dueDate'}}</span>
</div>
<div>
<span class="workTitle">Description:</span><br>
<span id="wDueDate" class="info form-control">{{work 'description'}}</span>
</div>
<div>
<span class="workTitle">Type:</span>
<span id="wType" class="info">{{work 'type'}}</span>
</div>
<!-- <div id="workAttach">Attach other files</div>
<div id="workAttachmentHolder">
{{#each work 'attachments'}}
<a href={{link}}>{{filename}}</a>
{{/each}}
</div> -->
</div>
</template>
<template name="workDisplayEdit">
<div id="workNameDiv">
<input id="wName" class="clickModify restrict" style="color:{{divColor 'textColor'}}" value="{{work 'name'}}" placeholder="Name | Click here to edit..." tabindex="10" maxLength="50">
<span class="resText">{{restrict 'wName'}}</span>
</div>
<div id="workInfo1">
<div>
<span class="workTitle">Class:</span><span style="font-size:2.2vh">{{work 'class'}}</span>
</div>
<div>
<span class="workTitle">Due Date:</span><br>
<input id="wDueDate" class="clickModify form-control" style="color:{{divColor 'textColor'}}" value="{{work 'dueDate'}}" tabindex="11" readonly="readonly">
</div>
<div>
<span class="workTitle">Description:</span><br>
<textarea id="wDescription" class="clickModify restrict" style="color:{{divColor 'textColor'}}" placeholder="Click here to edit..." value="{{work 'description'}}" rows="5" tabindex="12" maxLength="300"></textarea>
<span style="opacity:0">.</span>
<span class="resText">{{restrict 'wDescription'}}</span>
</div>
<div>
<span class="workTitle">Type:</span>
<div id="typeWrapper">
<div id="wType" class="clickModify dropdown" tabindex="13">
<span>{{work 'type'}}</span>
<i class="fa fa-angle-down" aria-hidden="true"></i>
</div>
<div class="optionHolder type">
{{#each selectOptions 'type'}}
{{> option}}
{{/each}}
</div>
</div>
</div>
<!-- <div id="workAttach">Attach other files</div>
<div id="workAttachmentHolder">
{{#each work 'attachments'}}
<a href={{link}}>{{filename}}</a>
{{/each}}
</div> -->
</div>
</template>
<template name="selectOptionMenu">
<div class="optionHolder">
{{#each selectOptions optionName}}
{{> option}}
{{/each}}
</div>
</template>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,613 @@
.sectionTitle {
font-weight: 200;
font-size: 2vh;
width: 100%;
height: 6vh;
background-color: rgba(255,255,255,0.1);
}
.sectionTitle h3 {
font-weight: 200;
font-size: 2vh;
padding-left: 6%;
line-height: 6vh;
}
.sectionTitle.downOffset {
margin-top: 6vh;
}
.openable {
cursor: pointer;
-webkit-transition: background-color 0.4s ease;
-moz-transition: background-color 0.4s ease;
-ms-transition: background-color 0.4s ease;
transition: background-color 0.4s ease;
}
.openable:hover {
background-color: rgba(255,255,255,0.2);
}
.openable h3:first-child {
font-weight: 200;
display: inline-block;
pointer-events: none;
}
.openable .fa {
padding: 6%;
float: right;
display: inline-block;
pointer-events: none;
}
#disableFilter {
font-weight: 200;
font-size: 90%;
margin-left: 10%;
padding: 4%;
background-color: rgba(255,255,255,0.2);
display: inline-block;
cursor: pointer;
line-height: normal;
pointer-events: all;
z-index: 2;
-webkit-transition: background-color 0.4s ease;
-moz-transition: background-color 0.4s ease;
-ms-transition: background-color 0.4s ease;
transition: background-color 0.4s ease;
}
#disableFilter:hover {
background-color: rgba(0,0,0,0.1);
}
#filterWrapper {
width: 100%;
height: 64vh;
max-height: 64vh;
}
#backgroundOverlay {
width: 100%;
height: 100%;
z-index: 5;
position: absolute;
top: 0;
}
#colLeft, #colRight {
height: 100%;
display: inline-block;
}
#colLeft h2, #colRight h2 {
padding: 3% 3% 0 4%;
font-size: 2.3vw;
font-weight: 300;
}
#colLeft p, #colRight p {
font-size: 1.1vw;
margin: 0;
padding: 0 2% 0 7%;
}
#colLeft {
width: 59%;
}
#colRight {
border-left: 1px solid #9C9C9C;
float: right;
width: 40%;
box-shadow: inset 0 0 0 99999px rgba(0,0,0,0.2);
}
#settingClassWrapper {
width: 90%;
margin: auto;
padding-top: 2%;
}
#label {
background-color: rgba(0,0,0,0.2);
box-shadow: none;
border: none;
display: table;
cursor: default;
}
#classBody {
height: 64vh;
overflow-y: auto;
overflow-x: hidden;
}
#settingClassWrapper h3 {
font-weight: 300;
font-style: italic;
margin-left: 5%;
}
.classBox {
font-size: 1.3vw;
width: 95%;
margin-bottom: 3%;
padding: 2%;
display: table;
table-layout: fixed;
cursor: pointer;
-webkit-transition: background-color 0.4s ease;
-moz-transition: background-color 0.4s ease;
-ms-transition: background-color 0.4s ease;
transition: background-color 0.4s ease;
}
.classBox:hover {
background-color: rgba(0,0,0,0.3);
}
.classBox .fa {
text-align: center;
-webkit-transition: color 0.4s ease;
-moz-transition: color 0.4s ease;
-ms-transition: color 0.4s ease;
transition: color 0.4s ease;
}
.classBox .fa-times:hover {
color: #FF1A1A;
}
.classBox .fa-plus:hover {
color: #85E085;
}
.owned {
border: none !important;
box-shadow: inset 0 0 0 99999px rgba(255,255,255,0.3);
-webkit-transition: background-color 0.4s ease;
-moz-transition: background-color 0.4s ease;
-ms-transition: background-color 0.4s ease;
transition: background-color 0.4s ease;
}
.owned:hover {
background-color: rgba(0,0,0,0.3);
}
.classText {
margin-left: .5%;
margin-right: 10%;
display: table-cell;
text-align: left;
pointer-events: none;
}
.classBox .fa {
font-size: 2.5vh !important;
padding: 0 !important;
display: table-cell !important;
width: 5% !important;
}
.name {
width: 40%;
}
.teacher {
width: 25%;
}
.hour.classText, .subscribers.classText {
width: 15%;
text-align: center;
}
.settingHeader div:first-child {
width: 70%;
display: inline-block;
}
.settingHeader div:last-child {
float: right;
margin: 2% 1% 1% 1%;
vertical-align: bottom;
display: inline-block;
}
#colRight .settingHeader div:last-child {
margin-top: 1%;
}
#colRight .settingHeader {
padding: 2% 2% 2% 3%;
}
.circleIcon {
width: 6vh;
height: 6vh;
background-color: rgba(0,0,0,0.2);
-moz-border-radius: 50%;
-webkit-border-radius: 50%;
border-radius: 50%;
}
.circleIcon .fa {
font-size: 2.5vh;
margin-top: 0.2vh;
width: 6vh;
height: 6vh;
line-height: 6vh;
text-align: center;
}
#classInfoModeWrapper {
width: 100%;
display: table;
}
#classInfoModeWrapper span {
font-size: 2.5vh;
width: 50%;
padding: 1.5%;
background-color: rgba(0,0,0,0.05);
text-align: center;
display: table-cell;
cursor: pointer;
-webkit-transition: background-color 0.5s ease, border-bottom 0.25s ease;
-moz-transition: background-color 0.5s ease, border-bottom 0.25s ease;
-ms-transition: background-color 0.5s ease, border-bottom 0.25s ease;
transition: background-color 0.5s ease, border-bottom 0.25s ease;
}
#classInfoModeWrapper span:hover {
background-color: rgba(0,0,0,0.1);
}
#infoClassCont {
padding: 5%;
}
#infoClassCont .infoCard {
margin: 2.5%;
padding: 2.5%;
width: 38%;
text-align: center;
display: inline-block;
position: relative;
vertical-align: top;
}
#infoClassCont h4 {
font-size: 1.5vw;
text-align: center;
}
#infoClassCont span {
font-size: 1.4vw;
margin-top: 5%;
display: block;
word-wrap: break-word;
}
#infoClassCont img {
height: 4vh;
margin-right: 1%;
display: inline-block;
vertical-align: middle;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
border-radius: 10px;
}
#privacy {
margin-bottom: 1%;
text-align: center;
}
#privacy span, #privacy .circleIcon {
margin: 1%;
display: inline-block;
}
#infoClassCont div .fa-files-o, #infoClassCont div .fa-pencil-square-o {
font-size: 2vh;
position: absolute;
top: 10%;
right: 5%;
cursor: pointer;
-webkit-transition: color 0.4s ease;
-moz-transition: color 0.4s ease;
-ms-transition: color 0.4s ease;
transition: color 0.4s ease;
}
#code {
margin: 0;
padding: 2%;
width: auto;
background-color: rgba(255,255,255,0.3);
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
display: none;
position: absolute;
top: 37.5%;
right: 1%;
}
#copyHolder {
pointer-events: none;
position: absolute;
right: -500px;
}
#changeAdminWrapper {
margin-top: 1%;
display: none;
}
#changeAdminWrapper span {
font-size: 2vh;
display: inline-block !important;
}
#changeAdmin {
width: 40%;
margin: 0 1% 0 1%;
font-size: 2vh;
padding: 1%;
outline: none;
}
#adminSubmit {
padding: 2%;
background-color: rgba(0,0,0,0.1);
display: inline-block;
cursor: pointer;
-webkit-transition: background-color 0.4s ease;
-moz-transition: background-color 0.4s ease;
-ms-transition: background-color 0.4s ease;
transition: background-color 0.4s ease;
}
#adminSubmit:hover {
background-color: rgba(0,0,0,0.2);
}
#deleteClass {
cursor: pointer;
float: right;
}
#deleteClass:hover {
color: #FF1A1A;
}
#deleteClass .fa {
margin-top: 0;
-webkit-transition: color 0.4s ease;
-moz-transition: color 0.4s ease;
-ms-transition: color 0.4s ease;
transition: color 0.4s ease;
}
#infoClassCont .userAdder {
border-bottom: 1px solid #FFF;
}
.userAdder {
width: 100%;
margin-bottom: 3%;
text-align: left;
display: table;
}
.userAdder h4 {
font-size: 2.3vh !important;
width: 30%;
text-align: left !important;
display: table-cell;
}
.userAdder input {
font-size: 2vh;
width: 53%;
padding: 1%;
outline: none;
}
.userAdder .fa {
width: auto;
padding: 0 !important;
margin: 3% !important;
cursor: pointer;
-webkit-transition: color 0.4s ease;
-moz-transition: color 0.4s ease;
-ms-transition: color 0.4s ease;
transition: color 0.4s ease;
}
.userHolder {
margin-bottom: 1%;
}
.userDisp {
width: 31%;
padding: 1%;
background-color: rgba(0,0,0,0.3);
display: inline-block;
text-align: center;
}
.userDisp span {
font-size: 1.5vh !important;
margin: 0 !important;
text-align: left;
}
.userDisp .fa {
font-size: 1.7vh;
cursor: pointer;
margin-left: 4.5%;
-webkit-transition: color 0.4s ease;
-moz-transition: color 0.4s ease;
-ms-transition: color 0.4s ease;
transition: color 0.4s ease;
}
.userDisp .fa:hover {
color: #FF1A1A;
}
#joinTop {
margin: 2% 0 0 5%;
}
#joinTop .-autocomplete-container {
display: none;
}
#joinTop .fa {
font-size: 2.5vh;
}
#classSearch, #privateCode {
font-size: 2vh;
padding: 1% !important;
outline: none;
}
#private {
font-size: 2.4vh;
padding: 1.5%;
margin: 0 2% 0 2%;
background-color: rgba(0,0,0,0.1);
cursor: pointer;
-webkit-transition: background-color 0.4s ease;
-moz-transition: background-color 0.4s ease;
-ms-transition: background-color 0.4s ease;
transition: background-color 0.4s ease;
}
#private:hover {
background-color: rgba(0,0,0,0.2);
}
#privateCode {
width: 25%;
display: none;
-webkit-animation: expand .7s ease 1;
animation: expand .7s ease 1;
}
@-webkit-keyframes expand {
0% { width: 0%; }
100% { width: 25%; }
}
@keyframes expand {
0% { width: 0%; }
100% { width: 25%; }
}
#createWrapper {
margin: auto;
margin-top: 3%;
width: 80%;
padding: 3%;
background-color: rgba(0,0,0,0.1);
}
#creRules p {
font-size: 2vh;
padding: 0;
}
.formDiv {
width: 100%;
margin: 0;
padding: 0;
background-color: transparent;
display: inline;
}
.formDiv:first-child {
padding-top: 2%;
}
.formDiv:last-child {
padding-bottom: 2%;
}
.formDiv input {
font-size: 2vh;
width: 98% !important;
padding: 1%;
}
.profTitle {
font-size: 2vh;
margin: 1% !important;
padding-left: 0 !important;
}
#formContainer {
margin: 2%;
position: relative;
}
#creSubmit {
font-weight: 200;
width: 50%;
padding: 2%;
margin: auto;
margin-top: 2%;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
text-align: center;
cursor: pointer;
-webkit-transition: background-color 0.4s ease;
-moz-transition: background-color 0.4s ease;
-ms-transition: background-color 0.4s ease;
transition: background-color 0.4s ease;
}
#creSubmit:hover {
background-color: rgba(0,0,0,0.1);
}

View File

@ -0,0 +1,514 @@
<template name="sidebarMenuPlate">
<div class="sectionTitle downOffset">
<h3>Main</h3>
</div>
<div class="mode classes">
<div class="status" style="background-color:{{modeStatus 'classes'}}"></div>
<i class="fa fa-university" aria-hidden="true"></i>
<h4>Classes</h4>
</div>
<div class="mode calendar">
<div class="status" style="background-color:{{modeStatus 'calendar'}}"></div>
<i class="fa fa-calendar" aria-hidden="true"></i>
<h4>Calendar</h4>
</div>
<div id="filterHead" class="sectionTitle openable">
<h3>Filters</h3>
{{#if filterOn}}
<h3 id="disableFilter">Disable All</h3>
{{/if}}
<i class="fa fa-angle-down" aria-hidden="true"></i>
</div>
<div id="filterWrapper">
<div id="typeFilterWrapper" class="sectionTitle openable">
<h3>By Type</h3>
<i class="fa fa-angle-down" aria-hidden="true"></i>
</div>
<div id="classFilterHolder">
{{#each types}}
{{> sideTypeFilter}}
{{/each}}
</div>
<div id="classFilterWrapper" class="sectionTitle openable">
<h3>By Class</h3>
<i class="fa fa-angle-down" aria-hidden="true"></i>
</div>
<div id="classListHolder">
{{#each myClasses}}
{{> sidebarClasses}}
{{/each}}
</div>
</div>
<div id="exportDiv" class="mode">
<i class="fa fa-download" aria-hidden="true"></i>
<h4>Export</h4>
</div>
</template>
<template name="sidebarOptionPlate">
<div id="settingMode" class="sectionTitle openable downOffset">
<h3>Classes</h3>
<i class="fa fa-angle-down" aria-hidden="true"></i>
</div>
<div id="settingModeWrapper">
<div class="mode manageClass">
<div class="status" style="background-color:{{modeStatus 'manageClass'}}"></div>
<i class="fa fa-tasks" aria-hidden="true"></i>
<h4>Manage Classes</h4>
</div>
<div class="mode addClass">
<div class="status" style="background-color:{{modeStatus 'addClass'}}"></div>
<i class="fa fa-graduation-cap" aria-hidden="true"></i>
<h4>Join Classes</h4>
</div>
<div class="mode createClass">
<div class="status" style="background-color:{{modeStatus 'createClass'}}"></div>
<i class="fa fa-book" aria-hidden="true"></i>
<h4>Create Classes</h4>
</div>
</div>
<div id="preferencesWrapper" class="sectionTitle openable">
<h3>Preferences</h3>
<i class="fa fa-angle-down" aria-hidden="true"></i>
</div>
<div id="prefCont">
<div class="prefWrapper">
<div class="sectionTitle prefText">
<h3>Theme</h3>
</div>
<div id="theme" class="clickModify dropdown" tabindex="1">
<span>{{pref 'theme'}}</span>
<i class="fa fa-angle-down" aria-hidden="true"></i>
</div>
{{> selectOptionMenu optionName="theme"}}
</div>
<div class="prefWrapper">
<div class="sectionTitle prefText">
<h3>Default Mode</h3>
</div>
<div id="mode" class="clickModify dropdown" tabindex="2">
<span>{{pref 'mode'}}</span>
<i class="fa fa-angle-down" aria-hidden="true"></i>
</div>
{{> selectOptionMenu optionName="mode"}}
</div>
<div class="prefWrapper">
<div class="sectionTitle prefText">
<h3>Hide Homework</h3>
</div>
<div id="timeHide" class="clickModify dropdown" tabindex="3">
<span>{{pref 'timeHide'}}</span>
<i class="fa fa-angle-down" aria-hidden="true"></i>
</div>
{{> selectOptionMenu optionName="timeHide"}}
</div>
<div class="prefWrapper">
<div class="sectionTitle prefText">
<h3>Hide Done</h3>
</div>
<div id="done" class="clickModify dropdown" tabindex="4">
<span>{{pref 'done'}}</span>
<i class="fa fa-angle-down" aria-hidden="true"></i>
</div>
{{> selectOptionMenu optionName="done"}}
</div>
<div class="prefWrapper">
<div class="sectionTitle prefText">
<h3>Hide Reported</h3>
</div>
<div id="hideReport" class="clickModify dropdown" tabindex="5">
<span>{{pref 'hideReport'}}</span>
<i class="fa fa-angle-down" aria-hidden="true"></i>
</div>
{{> selectOptionMenu optionName="hideReport"}}
</div>
</div>
</template>
<template name="sidebarRequestPlate">
<div class="sectionTitle downOffset">
<h3>Requests</h3>
</div>
<p class="sidebarDesc">Ask for help, submit a bug, or request a feature! We won't bite.</p>
<textarea id="requestArea" class="restrict" rows="4" cols="50" maxlength="500" placeholder="Enter request here..." style="color:{{divColor 'textColor'}}"></textarea><br>
<span id="requestRes" class="resText">{{restrict 'requestArea'}}</span>
<span style="opacity:0">.</span>
<div id="requestSubmit">
<span>Send</span>
<span style="display:none">Request sent!</span>
<i class="fa fa-paper-plane" aria-hidden="true"></i>
</div>
</template>
<template name="sidebarCreatePlate">
<div class="sectionTitle downOffset">
<h3>Classes</h3>
</div>
<p class="sidebarDesc">Pick a class to create work for.</p>
{{#each myClasses}}
{{> sidebarClasses}}
{{/each}}
</template>
<template name="manageClass">
<div id="backgroundOverlay" style="background-color:{{divColor 'secondaryColor'}}">
<div id="colLeft">
<div class="settingHeader">
<div>
<h2>My Classes</h2>
<p>Manage Classes</p>
</div>
<div class="circleIcon">
<i class="fa fa-tasks" aria-hidden="true"></i>
</div>
</div>
<div id="settingClassWrapper">
<div id="label" class="classBox">
<span class="name classText">Class Name</span>
<span class="teacher classText">Teacher</span>
<span class="hour classText">Hour</span>
<span class="subscriptions classText">Members</span>
</div>
<div id="classBody">
{{#each myClasses}}
{{> classDisplay}}
{{/each}}
</div>
</div>
</div>
<div id="colRight" style="background-color:{{divColor 'sidebarColor'}}">
<div class="settingHeader">
<div>
<h2>Class Information</h2>
</div>
<div class="circleIcon">
<i class="fa fa-info" aria-hidden="true"></i>
</div>
</div>
<div id="infoClassWrapper">
<div id="classInfoModeWrapper">
<span style="border-bottom: 3px solid {{classInfoMode 'general'}}">General</span>
<span style="border-bottom: 3px solid {{classInfoMode 'users'}}">Users</span>
</div>
<div id="infoClassCont">
{{#if classSelected}}
{{#if classInfoMode 'general' 'a'}}
{{> classInfoGeneral}}
{{else}}
{{> classInfoUsers}}
{{/if}}
{{else}}
<p>Click on a class to see its info.</p>
{{/if}}
</div>
</div>
</div>
</div>
</template>
<template name="joinClass">
<div id="backgroundOverlay" style="background-color:{{divColor 'secondaryColor'}}">
<div id="colLeft">
<div class="settingHeader">
<div>
<h2>Available Classes</h2>
<p>Join Classes</p>
</div>
<div class="circleIcon">
<i class="fa fa-graduation-cap" aria-hidden="true"></i>
</div>
</div>
<div id="joinTop">
<i class="fa fa-search" aria-hidden="true"></i>
{{> inputAutocomplete id="classSearch" settings=classSettings placeholder="Search..."}}
<h4 id="private">Join Private Class</h4>
<input id="privateCode" placeholder="Enter code here...">
</div>
<div id="settingClassWrapper">
<div id="classHeader">
<div id="label" class="classBox">
<span class="name classText">Class Name</span>
<span class="teacher classText">Teacher</span>
<span class="hour classText">Hour</span>
<span class="subscriptions classText">Members</span>
</div>
</div>
<div id="classBody">
{{#if notsearching}}
{{#each classes}}
{{> classDisplay}}
{{/each}}
{{#if noclass}}
<h3>No results found...</h3>
{{/if}}
{{else}}
{{#each autocompleteClasses}}
{{> classDisplay}}
{{/each}}
{{#if notfound}}
<h3>No results found...</h3>
{{/if}}
{{/if}}
</div>
</div>
</div>
<div id="colRight" style="background-color:{{divColor 'sidebarColor'}}">
<div class="settingHeader">
<div>
<h2>Class Information</h2>
</div>
<div class="circleIcon">
<i class="fa fa-info" aria-hidden="true"></i>
</div>
</div>
<div id="infoClassWrapper">
<div id="classInfoModeWrapper">
<span style="border-bottom: 3px solid {{classInfoMode 'general'}}">General</span>
<span style="border-bottom: 3px solid {{classInfoMode 'users'}}">Users</span>
</div>
<div id="infoClassCont">
{{#if classSelected}}
{{#if classInfoMode 'general' 'a'}}
{{> classInfoGeneral}}
{{else}}
{{> classInfoUsers}}
{{/if}}
{{else}}
<p>Click on a class to see its info!</p>
{{/if}}
</div>
</div>
</div>
</div>
</template>
<template name="createClass">
<div id="backgroundOverlay" style="background-color:{{divColor 'secondaryColor'}}">
<div id="colLeft">
<div class="settingHeader">
<div>
<h2>Create Classes</h2>
</div>
<div class="circleIcon">
<i class="fa fa-book" aria-hidden="true"></i>
</div>
</div>
<div id="createWrapper">
<div id="creRules">
<p>Submit a request for a class to be approved by an administrator.<br>
You can have up to 8 unapproved classes at once.</p>
</div>
<div id="formContainer">
<div class="formDiv">
<p class="profTitle">**School:</p>
<input id="school" class="creInput" type="text" form="school" value="{{pref 'school'}}" readonly>
</div>
<div class="formDiv">
<p class="profTitle">Hour:</p>
<input class="creInput" type="text" form="hour" placeholder="Hour">
</div>
<div class="formDiv">
<p class="profTitle">Teacher:</p>
{{> inputAutocomplete settings=teacherComplete class="form-control creInput" type="text" form="teacher" placeholder="Teacher | Ex: Marc DeZwaan" }}
</div>
<div class="formDiv">
<p class="profTitle">**Class Name:</p>
<input class="creInput" type="text" form="name" placeholder="**Class Name">
</div>
<div class="formDiv">
<p class="profTitle">**Privacy:</p>
<input id="creprivacy" style="color:{{divColor 'textColor'}}" class="creInput clickModify dropdown" type="text" form="privacy" placeholder="Click here to edit..." readonly>
<div class="optionHolder">
{{#each selectOptions 'privacy'}}
{{> option}}
{{/each}}
</div>
</div>
<div class="formDiv">
<p class="profTitle">**Category:</p>
<input id="crecategory" style="color:{{divColor 'textColor'}}" class="creInput clickModify dropdown" type="text" form="category" placeholder="Click here to edit..." readonly>
<div class="optionHolder">
{{#each selectOptions 'category'}}
{{> option}}
{{/each}}
</div>
</div>
<h3 id="creSubmit" style="border:1px solid {{divColor 'textColor'}}">Submit Request</h3>
</div>
</div>
</div>
</div>
</template>
<template name="classDisplay">
<div class="classBox{{box}}" classid="{{_id}}" style="border:1px solid {{divColor 'textColor'}}">
<span class="name classText">{{name}}</span>
<span class="teacher classText">{{teachershort}}</span>
<span class="hour classText">{{hour}}</span>
<span class="subscribers classText">{{subscribers}}</span>
{{#if mine}}
<i class="fa fa-times" aria-hidden="true"></i>
{{else}}
{{#if join}}
<i class="fa fa-plus" aria-hidden="true"></i>
{{else}}
<i class="fa fa-times" aria-hidden="true" style="visibility:hidden"></i>
{{/if}}
{{/if}}
</div>
</template>
<template name="classInfoGeneral">
<div id="privacy">
{{#if classInfo 'privacy'}}
<div class="circleIcon">
<i class="fa fa-lock" aria-hidden="true"></i>
</div>
<span>Private</span>
{{#unless classInfo 'personal'}}
{{#if classInfo 'mine'}}
<div id="deleteClass" class="circleIcon">
<i class="fa fa-times" aria-hidden="true"></i>
</div>
{{/if}}
{{/unless}}
{{else}}
<div class="circleIcon">
<i class="fa fa-unlock-alt" aria-hidden="true"></i>
</div>
<span>Public</span>
{{#unless classInfo 'personal'}}
{{#if classInfo 'mine'}}
<div id="deleteClass" class="circleIcon">
<i class="fa fa-times" aria-hidden="true"></i>
</div>
{{/if}}
{{/unless}}
{{/if}}
</div>
<div class="infoCard" style="border:1px solid {{divColor 'textColor'}}">
<h4 style="border-bottom:1px solid {{divColor 'textColor'}}">Class Name</h4>
<span>{{classInfo 'name'}}</span>
</div>
<div class="infoCard" style="border:1px solid {{divColor 'textColor'}}">
<h4 style="border-bottom:1px solid {{divColor 'textColor'}}">Hour</h4>
<span>{{classInfo 'hour'}}</span>
</div>
<div class="infoCard" style="border:1px solid {{divColor 'textColor'}}">
<h4 style="border-bottom:1px solid {{divColor 'textColor'}}">Teacher</h4>
<span>{{classInfo 'teacher'}}</span>
</div>
<div class="infoCard" style="border:1px solid {{divColor 'textColor'}}">
<h4 style="border-bottom:1px solid {{divColor 'textColor'}}">Category</h4>
<span>{{classInfo 'category'}}</span>
</div>
<div class="infoCard" style="border:1px solid {{divColor 'textColor'}}">
<h4 style="border-bottom:1px solid {{divColor 'textColor'}}">Owner</h4>
{{> classInfoUserDisp classInfo 'admin'}}
{{#unless classInfo 'personal'}}
{{#if classInfo 'mine'}}
<i class="fa fa-pencil-square-o" aria-hidden="true" onmouseover="$(this).css('color','{{divColor 'iconHighlight'}}')" onmouseleave="$(this).css('color','{{divColor 'textColor'}}')"></i>
{{/if}}
{{/unless}}
</div>
{{> classInfoCode}}
<div id="changeAdminWrapper">
<span>Change Admin: </span>
<input id="changeAdmin">
<div id="adminSubmit">Change</div>
</div>
</template>
<template name="classInfoUsers">
{{#if classInfo 'personal'}}
<p>It's just you!</p>
{{else}}
<div>
<div class="userAdder">
<h4>Moderators:</h4>
{{#if classInfo 'mine'}}
<input class="userAddInput" type="text" placeholder="1234@abc.xyz">
<i class="fa fa-plus" aria-hidden="true" user="moderators" onmouseover="$(this).css('color','{{divColor 'iconHighlight'}}')" onmouseleave="$(this).css('color','{{divColor 'textColor'}}')"></i>
{{/if}}
</div>
<div class="userHolder">
{{#each classInfo 'moderators'}}
<div class="userDisp" userid="{{_id}}">
{{> classInfoUserDisp}}
</div>
{{/each}}
</div>
</div>
<div>
<div class="userAdder">
<h4>Banned Users:</h4>
{{#if classInfo 'mine'}}
<input class="userAddInput" type="text" placeholder="1234@abc.xyz">
<i class="fa fa-plus" aria-hidden="true" user="banned" onmouseover="$(this).css('color','{{divColor 'iconHighlight'}}')" onmouseleave="$(this).css('color','{{divColor 'textColor'}}')"></i>
{{/if}}
</div>
<div class="userHolder">
{{#each classInfo 'banned'}}
<div class="userDisp" userid="{{_id}}">
{{> classInfoUserDisp}}
</div>
{{/each}}
</div>
</div>
<div>
<div class="userAdder">
<h4>Subscribers:</h4>
</div>
<div class="userHolder">
{{#each classInfo 'subscribers'}}
<div class="userDisp" userid="{{_id}}">
{{> classInfoUserDisp}}
</div>
{{/each}}
</div>
</div>
{{/if}}
</template>
<template name="classInfoUserDisp">
<span>
<img src="{{services.google.picture}}">
{{profile.name}}
{{#if delete}}
{{#if classInfo 'mine'}}
<i class="fa fa-times" aria-hidden="true"></i>
{{/if}}
{{/if}}
</span>
</template>
<template name="classInfoCode">
{{classInfo 'code'}}
{{#if code 'exists'}}
<div class="infoCard" style="border:1px solid {{divColor 'textColor'}}">
<h4 style="border-bottom:1px solid {{divColor 'textColor'}}">Code</h4>
<span>{{code 'code'}}</span>
<input id="copyHolder" value="{{code 'code'}}">
<i class="fa fa-files-o" aria-hidden="true" onmouseover="$(this).css('color','{{divColor 'iconHighlight'}}')" onmouseleave="$(this).css('color','{{divColor 'textColor'}}')"></i>
<div id="code">Copied!</div>
</div>
{{/if}}
</template>
<template name="classAutoList">
<span class="name classText">{{name}}</span>
<span class="teacher classText">{{teacher}}</span>
<span class="hour classText">{{hour}}</span>
<span class="subscribers classText">{{subscribers}}</span>
<span class="subscribers classText">{{_id}}</span>
</template>
<template name="schoolList">
{{name}}
</template>
<template name="teacherList">
{{name}}
</template>

View File

@ -0,0 +1,742 @@
/* jshint esversion: 6 */
Session.set("settingMode", "manageClass");
Session.set("classInfoMode", "general");
Session.set("notsearching", true); // If user isn't searching
Session.set("noclass", null); // If user doesn't have classes.
Session.set("notfound", null); // If no results for autocomplete.
var filterOpen = [true, true, true, true, true];
var sidebarMode = [null, null];
Template.sidebarMenuPlate.rendered = function() {
$(".menuWrapper").velocity("slideDown", 150);
$("#classListHolder").slimScroll({
width: '100%',
height: '',
touchScrollStep: 90
});
$("#filterWrapper.slimScrollBar").css("display", "none");
};
Template.sidebarOptionPlate.rendered = function() {
$(".menuWrapper").velocity("slideDown", 150);
};
Template.sidebarRequestPlate.rendered = function() {
$(".menuWrapper").velocity("slideDown", 150);
};
Template.sidebarCreatePlate.rendered = function() {
$(".menuWrapper").velocity("slideDown", 150);
};
Template.sidebarMenuPlate.helpers({
modeStatus(status) { // Color status of display modes.
return (Session.equals("mode", status)) ? Session.get("user").preferences.theme.modeHighlight : "rgba(0,0,0,0)";
},
types() {
var types = Object.keys(workColors);
var array = [];
for (var i = 0; i < types.length; i++) {
array.push({
"type": types[i],
"typeName": types[i][0].toUpperCase() + types[i].slice(1),
"selected": (_.contains(Session.get("typeFilter"), types[i])) ? Session.get("user").preferences.theme.modeHighlight : "rgba(0,0,0,0)"
});
}
return array;
},
filterOn() {
return Session.get("classDisp").length !== 0 || Session.get("typeFilter").length !== 0;
}
});
Template.sidebarMenuPlate.events({
'click .classes' () { // Click classes mode button.
if (Session.equals("mode", "classes")) return;
toggleToMode("classes");
setTimeout(startDragula, 500);
toggleToSidebar(false);
},
'click .calendar' () { // Click calendar mode button.
if (Session.equals("mode", "calendar")) return;
toggleToMode("calendar");
toggleToSidebar(false);
},
'click #filterHead' (event) {
if (event.target.id === "disableFilter") return;
if (!filterOpen[0]) {
$("#filterWrapper").velocity("slideDown", 150);
} else {
$("#filterWrapper").velocity("slideUp", 150);
}
filterOpen[0] = !filterOpen[0];
},
'click #typeFilterWrapper' () {
if (!filterOpen[1]) {
$("#classFilterHolder").velocity("slideDown", 150);
$("#classListHolder").velocity({'max-height':'27.4507vh'},300);
} else {
$("#classFilterHolder").velocity("slideUp", 150);
$("#classListHolder").velocity({'max-height':'52vh'},300);
}
filterOpen[1] = !filterOpen[1];
},
'click #classFilterWrapper' () {
if (!filterOpen[2]) {
var height = (88-100*$("#classFilterWrapper").offset().top / window.innerHeight) + "vh";
$("#classListHolder").css('max-height',height);
$("#classListHolder").velocity("slideDown", 150);
} else {
$("#classListHolder").velocity("slideUp", 150);
}
filterOpen[2] = !filterOpen[2];
},
// CLASS FILTERS
'click .sideClass' (event) { // Click class list in sidebar.
var classid = event.target.getAttribute("classid");
var array = Session.get("classDisp");
if (array.indexOf(classid) !== -1) {
array.splice(array.indexOf(classid), 1);
} else {
array.push(classid);
}
Session.set("classDisp", array);
filterWork();
},
'click .sideFilter' (event) {
var type = event.target.getAttribute("type");
var array = Session.get("typeFilter");
if (array.indexOf(type) !== -1) {
array.splice(array.indexOf(type), 1);
} else {
array.push(type);
}
Session.set("typeFilter", array);
filterWork();
},
'click #disableFilter' () {
Session.set("classDisp", []);
Session.set("typeFilter", []);
filterWork();
},
'mouseover .sideClass' (event) { // Highlight/scale filter on-hover.
var div;
if (event.target.className !== "sideClass") {
div = event.target.parentNode;
} else {
div = event.target;
}
while (div.getAttribute("classid") === null) div = div.parentNode;
var classid = div.getAttribute("classid");
Session.set("classDispHover", classid);
},
'mouseleave .sideClass' (event) { // Turn off highlight/scale filter on-leave.
if (event.target.className !== "sideClass") {
var div = event.target.parentNode;
if (div.contains(event.target)) return;
}
Session.set("classDispHover", null);
},
'mouseover .sideFilter' (event) {
var div;
if (event.target.className !== "sideFilter") {
div = event.target.parentNode;
} else {
div = event.target;
}
while (div.getAttribute("type") === null) div = div.parentNode;
var type = div.getAttribute("type");
Session.set("typeFilterHover", type);
},
'mouseleave .sideFilter' (event) {
if (event.target.className !== "sideFilter") {
var div = event.target.parentNode;
if (div.contains(event.target)) return;
}
Session.set("typeFilterHover", null);
}
});
Template.sidebarOptionPlate.helpers({
modeStatus(status) { // Color status of display modes.
return (Session.equals("settingMode", status)) ? Session.get("user").preferences.theme.modeHighlight : "rgba(0,0,0,0)";
},
});
Template.sidebarOptionPlate.events({
'click .manageClass' () { // Click classes mode button.
if (Session.equals("settingMode", "manageClass")) return;
toggleToMode("manageClass");
},
'click .addClass' () { // Click classes mode button.
if (Session.equals("settingMode", "addClass")) return;
if (Session.get("demo")) {
sAlert.error("Not available in demo!", {
effect: 'stackslide',
position: 'top',
timeout: 2000
});
return;
}
toggleToMode("addClass");
},
'click .createClass' () { // Click classes mode button.
if (Session.equals("settingMode", "createClass")) return;
if (Session.get("demo")) {
sAlert.error("Not available in demo!", {
effect: 'stackslide',
position: 'top',
timeout: 2000
});
return;
}
toggleToMode("createClass");
},
'click #settingMode' () {
if (!filterOpen[3]) {
$("#settingModeWrapper").velocity("slideDown", 150);
} else {
$("#settingModeWrapper").velocity("slideUp", 150);
}
filterOpen[3] = !filterOpen[3];
},
'click #preferencesWrapper' () {
if (!filterOpen[4]) {
$("#prefCont").velocity("slideDown", 150);
} else {
$("#prefCont").velocity("slideUp", 150);
}
filterOpen[4] = !filterOpen[4];
}
});
Template.sidebarCreatePlate.events({
'click .sideClass' (event) { // Click class list in sidebar.
var classid = event.target.getAttribute("classid");
var newSetting = Session.get("currentWork");
newSetting.class = classid;
Session.set("newWork", true);
Session.set("currentWork", newSetting);
$(".overlay").velocity("fadeIn", 150);
}
});
Template.registerHelper("classInfo", (info) => {
if(Session.get("demo")) {
if(Session.equals("classInfo", "Personal")) var isYou = true;
var thisClass = Session.get("myClasses").filter(function(obj) {
return obj.name === Session.get("classInfo");
})[0];
} else {
var thisClass = classes.findOne({
_id: Session.get("classInfo")
});
if (thisClass === undefined) return;
var isYou = Session.equals("classInfo", Meteor.userId());
}
switch (info) {
case "name":
return (isYou) ? "Personal" : thisClass.name;
case "teacher":
return (isYou) ? "None" : thisClass.teacher;
case "hour":
return (isYou) ? "None" : thisClass.hour;
case "category":
return (isYou) ? "Personal" : thisClass.category[0].toUpperCase() + thisClass.category.slice(1);
case "privacy":
return (isYou) ? true : thisClass.privacy;
case "admin":
if(Session.get("demo")) return "A. Robot";
return Meteor.users.findOne({
_id: (isYou) ? Meteor.userId() : thisClass.admin
});
case "code":
if(isYou || Meteor.userId() !== thisClass.admin) return false;
var exist;
Meteor.call('getCode', thisClass._id, function(err, result) {
Session.set("code", [(result === undefined || result === "") ? false : true, result]);
});
break;
case "mine":
return (isYou) ? true : Meteor.userId() === thisClass.admin;
case "moderators":
if (isYou || thisClass.moderators.length === 0) return [];
var moderators = [];
thisClass.moderators.forEach(function(ele) {
var array = Meteor.users.findOne({
_id: ele
});
array.delete = true;
moderators.push(array);
});
return moderators;
case "banned":
if (isYou || thisClass.banned.length === 0) return [];
var banned = [];
thisClass.banned.forEach(function(ele) {
var array = Meteor.users.findOne({
_id: ele
});
array.delete = true;
banned.push(array);
});
return banned;
case "subscribers":
if (isYou || thisClass.subscribers.length === 0) return [];
var subscribers = [];
thisClass.subscribers.forEach(function(ele) {
subscribers.push(Meteor.users.findOne({
_id: ele
}));
});
return subscribers;
case "personal":
return isYou;
}
});
Template.registerHelper("classInfoMode", (mode, check) => {
if (typeof check === "string") return Session.equals("classInfoMode", mode);
return (Session.equals("classInfoMode", mode)) ? Session.get("user").preferences.theme.modeHighlight + ";background-color:rgba(0,0,0,0.1);" : "rgba(0,0,0,0)";
});
Template.registerHelper("classSelected", () => {
return !Session.equals("classInfo", null);
});
Template.manageClass.rendered = function() {
$("#classBody").slimScroll({
width: '100%',
height: '',
touchScrollStep: 60,
color: '#FFF',
railOpacity: 0.7
});
}
Template.manageClass.events({
'click .classBox' (event) {
var classId = event.target.getAttribute("classid");
if (Session.equals("classInfo", classId)) return;
toggleToClassInfo(classId);
},
'click #classInfoModeWrapper span:first-child' () {
if (Session.equals("classInfoMode", "general")) return;
toggleToClassInfoMode("general");
},
'click #classInfoModeWrapper span:last-child' () {
if (Session.equals("classInfoMode", "users")) return;
if (Session.get("demo")) {
sAlert.error("Not available in demo!", {
effect: 'stackslide',
position: 'top',
timeout: 2000
});
return;
}
toggleToClassInfoMode("users");
},
'click .infoCard .fa-pencil-square-o' () {
$("#changeAdminWrapper").velocity("fadeIn", 150);
},
'click #adminSubmit' () {
var input = document.getElementById("changeAdmin");
var value = input.value;
var classid = Session.get("classInfo");
var user = Meteor.users.findOne({
"services.google.email": value
});
if (!user) {
sAlert.error("Invalid email!", {
effect: 'stackslide',
position: 'top',
timeout: 3000
});
return;
}
serverData = [
user._id,
classid
];
Session.set("confirmText", "Change ownership?");
confirm = "changeAdmin";
$("#confirmOverlay").velocity("fadeIn", 150);
},
'click #deleteClass' () {
serverData = Session.get("classInfo");
confirm = "deleteClass";
Session.set("confirmText", "Delete this class?");
$("#confirmOverlay").velocity("fadeIn", 150);
},
'click .classBox .fa-times' (event) {
serverData = event.target.parentNode.getAttribute("classid");
confirm = "leaveClass";
Session.set("confirmText", "Leave this class?");
$("#confirmOverlay").velocity("fadeIn", 150);
}
});
Template.joinClass.rendered = function() {
$("#classBody").slimScroll({
width: '100%',
height: '',
touchScrollStep: 60,
color: '#FFF',
railOpacity: 0.7
});
}
Template.joinClass.helpers({
classes() { // Loads all of the possible classes ( Limit of twenty shown ) ( Sorts by class size ) ( Only your school)
var array = classes.find({
status: {
$eq: true
},
privacy: {
$eq: false
},
_id: {
$nin: Session.get("user").classes
},
school: {
$eq: Session.get("user").school
}
}, {
sort: {
subscribers: -1
}
}, {
limit: 100
}).fetch();
for (var i = 0; i < array.length; i++) {
array[i].join = true;
array[i].subscribers = array[i].subscribers.length;
array[i].teachershort = (array[i].teacher === undefined) ? "" : array[i].teacher.split(" ").slice(1);
}
if (array.length === 0) {
Session.set("noclass", true);
} else {
Session.set("noclass", false);
}
return array;
},
classSettings() { // Returns autocomplete array for classes.
return {
position: "bottom",
limit: 10,
rules: [{
token: '',
collection: classes,
template: Template.classAutoList,
filter: {
privacy: false,
status: true
},
selector: (match) => {
regex = new RegExp(match, 'i');
return {
$or: [{
'name': regex
}, {
'teacher': regex
}, {
'hour': regex
}]
};
}
}]
};
},
notsearching() { // Tells whether user is using the searchbox
return Session.get("notsearching");
},
autocompleteClasses() { // Returns current auto-completes for classes
return Session.get("autocompleteDivs");
},
notfound() { // Returns if autocomplete has no results.
return Session.get("notfound");
}
});
Template.joinClass.events({
'click .classBox' (event) {
var classId = event.target.getAttribute("classid");
if (Session.equals("classInfo", classId)) return;
toggleToClassInfo(classId);
},
'click #classInfoModeWrapper span:first-child' () {
if (Session.equals("classInfoMode", "general")) return;
toggleToClassInfoMode("general");
},
'click #classInfoModeWrapper span:last-child' () {
if (Session.equals("classInfoMode", "users")) return;
toggleToClassInfoMode("users");
},
'input #classSearch' (event) { // Auto-complete updater
if (event.target.value.length === 0) {
Session.set("notsearching", true);
} else {
Session.set("notsearching", false);
}
Session.set("autocompleteDivs", null);
var divs = [];
try {
var items = document.getElementsByClassName("-autocomplete-container")[0].children;
if(items[0].tagName === "I") {
Session.set("notfound", true);
return;
} else {
items = items[0].children;
for(var i = 0; i < items.length; i++) {
var item = items[i].children;
var id = item[4].textContent;
if(Session.get("user").classes.indexOf(id) !== -1) continue;
divs.push({
name: item[0].textContent,
teachershort: item[1].textContent.split(" ")[1],
hour: item[2].textContent,
subscribers: (item[3].textContent.match(new RegExp(",","g")) || []).length+1,
_id: id,
join: true
})
}
Session.set("autocompleteDivs", divs.sort(function(a, b) {
return b.subscribers - a.subscribers;
}));
Session.set("notfound", false);
return;
}
} catch(err) {}
},
'click .classBox .fa-plus' (event) {
serverData = [event.target.parentNode.getAttribute("classid"), ""];
confirm = "joinClass";
Session.set("confirmText", "Join this class?");
$("#confirmOverlay").velocity("fadeIn", 150);
},
'click #private' () {
$("#privateCode").css('display', 'inline-block');
var input = document.getElementById("privateCode");
input.focus();
if (input.value === "") return;
Meteor.call("joinPrivateClass", input.value, function(error, result) {
if (result) {
sAlert.success("Joined!", {
effect: 'stackslide',
position: 'bottom-right',
timeout: 1500
});
$("#privateCode").velocity("fadeOut",100);
} else {
sAlert.error("Invalid code!", {
effect: 'stackslide',
position: 'top',
timeout: 1500
});
}
Meteor.subscribe("classes");
});
}
});
Template.createClass.helpers({
schoolComplete() { // Returns autocomplete array for schools.
return {
position: "bottom",
limit: 6,
rules: [{
token: '',
collection: schools,
field: 'name',
matchAll: true,
template: Template.schoolList
}]
};
},
teacherComplete() { // Returns autocomplete array for teachers.
return {
position: "bottom",
limit: 1,
rules: [{
token: '',
collection: teachers,
field: 'name',
template: Template.teacherList
}]
};
}
});
Template.createClass.events({
'click #creSubmit' () {
var inputs = document.getElementsByClassName("creInput");
var required = ["school", "name", "privacy", "category"];
var alert = checkComplete(required, inputs);
var values = alert[2];
if (!alert[0]) { // Check missing fields.
sAlert.error("Missing " + alert[1], {
effect: 'stackslide',
position: 'top',
timeout: 3000
});
return;
}
values.privacy = (values.privacy === "Public") ? false : true;
values.status = false;
values.category = values.category.toLowerCase();
values.code = "";
serverData = values;
if(values.teacher !== "" && values.teacher.split(" ").length < 2) {
sAlert.error("Please enter the full name of the teacher! Ex: Darrin Woods", {
effect: 'stackslide',
position: 'bottom-right',
timeout: 3000
});
return;
}
if (!teachers.findOne({
name: values.teacher
}) && values.teacher !== "") {
Meteor.call("createTeacher", values.teacher, values.school, function(error, result) {
if (error !== undefined) {
sAlert.error(error.message, {
effect: 'stackslide',
position: 'top'
});
} else {
sendData("createClass");
}
});
} else {
sendData("createClass");
}
}
});
Template.classInfoCode.events({
'click .fa' (event) {
document.getElementById("copyHolder").select();
document.execCommand("copy");
$(event.target.parentNode.childNodes[9]).fadeIn(100, function() {
setTimeout(function() {
$(event.target.parentNode.childNodes[9]).velocity("fadeOut", 150);
}, 500);
});
}
});
Template.classInfoCode.helpers({
code(info) {
try {
if(info === "exists") {
return Session.get("code")[0];
} else {
return Session.get("code")[1];
}
} catch(err) {}
}
})
Template.classInfoUsers.events({
'click .userAdder .fa' (event) {
var type = event.target.getAttribute("user");
var input = event.target.parentNode.childNodes[4];
var value = input.value;
var classid = Session.get("classInfo");
var user = Meteor.users.findOne({
"services.google.email": value
});
if (!user) {
sAlert.error("Invalid email!", {
effect: 'stackslide',
position: 'top',
timeout: 3000
});
return;
}
serverData = [
user._id,
classid,
type,
true
];
sendData("trackUserInClass");
input.value = "";
},
'click .userDisp .fa' (event) {
var outerInput = event.target.parentNode.parentNode.parentNode.parentNode.childNodes[1];
var type = outerInput.childNodes[6].getAttribute("user");
var userid = event.target.parentNode.parentNode.getAttribute("userid");
if (!Meteor.users.findOne({
_id: userid
})) {
sAlert.error("Stop hacking, reload the page.", {
effect: 'stackslide',
position: 'top',
timeout: 3000
});
return;
}
var classid = Session.get("classInfo");
serverData = [
userid,
classid,
type,
false
];
sendData("trackUserInClass");
}
});
toggleToMode = function(mode) {
$("#mainBody").fadeOut(150, function() {
(Session.equals("sidebarMode", "option")) ? Session.set("settingMode", mode): Session.set("mode", mode);
Session.set("classInfo", null);
$("#mainBody").fadeIn(150);
});
};
toggleToSidebar = function(sidebar) {
try {
$("#backgroundOverlay").velocity("fadeOut", 200);
} catch (err) {}
if (Session.equals("sidebarMode", sidebar) || !sidebar) {
$("#menuContainer").hide("slide", {
direction: "left"
}, 200);
$("#divCenter").stop().velocity({
left: '6vh'
}, 200, function() {
Session.set("sidebarMode", "");
});
} else {
$("#menuContainer").show("slide", {
direction: "left"
}, 200);
$("#divCenter").stop().velocity({
left: '36vh'
}, 200);
$(".menuWrapper").fadeOut(200, function() {
Session.set("sidebarMode", sidebar);
});
}
filterOpen = [true, true, true, true, true];
};
toggleToClassInfo = function(classId) {
$("#changeAdminWrapper").velocity("fadeOut", 150);
$("#infoClassCont").velocity("fadeOut", 150, function() {
Session.set("classInfo", classId);
Session.set("classInfoMode", "general");
$(this).velocity("fadeIn", 150);
});
};
toggleToClassInfoMode = function(mode) {
$("#infoClassCont").velocity("fadeOut", 150, function() {
Session.set("classInfoMode", mode);
$(this).velocity("fadeIn",150);
});
};

View File

@ -0,0 +1,529 @@
#mobileHeader {
border-bottom: 3px solid #999;
position: relative;
-webkit-transition: background-color 0.4s ease;
-moz-transition: background-color 0.4s ease;
-ms-transition: background-color 0.4s ease;
transition: background-color 0.4s ease;
}
#mobileHeader h2 {
font-size: 5vw;
font-weight: 200;
padding: 0;
height: 13vw;
display: inline;
line-height: 13vw;
text-align: right;
}
#mobileHeader .fa {
font-size: 5vw;
width: 10vw;
height: 10vw;
border: 0;
line-height: 10vw;
pointer-events: none;
}
#mSidebarToggle {
margin: 1.5vw 1vw 1.5vw 1vw;
width: 10vw;
height: 10vw;
background-color: rgba(255,255,255,0);
display: inline-block;
text-align: center;
-moz-border-radius: 50%;
-webkit-border-radius: 50%;
border-radius: 50%;
}
.selectText {
margin: 0;
margin-top: 10%;
padding: 5%;
}
#mobileBody {
width: 100%;
height: 91%;
margin-bottom: 10%;
overflow-y: auto;
overflow-x: hidden;
-webkit-transition: background-color 0.4s ease;
-moz-transition: background-color 0.4s ease;
-ms-transition: background-color 0.4s ease;
transition: background-color 0.4s ease;
}
.mClassContainer {
border-bottom: 1px solid #AAA;
position: relative;
}
.mobileClass {
width: 100%;
height: 20vw;
z-index: 30;
}
.mClassContainer:last-child {
margin-bottom: 20vw;
border: 0;
}
.mobileType {
width: 2vw;
height: 100%;
display: inline-block;
pointer-events: none;
}
.mobileClassContent {
width: 88vw;
height: 12vw;
padding: 4vw;
display: inline-block;
vertical-align: top;
pointer-events: none;
}
.mobileClassContent h4 {
font-size: 5vw;
vertical-align: top;
}
.mobileClassContent div {
position: absolute;
right: 6%;
bottom: 11%;
text-align: right;
}
.minorHeader {
font-size: 4vw !important;
width: 96%;
padding: 2%;
background-color: #444;
}
.mContTop {
width: 100%;
}
.mName {
font-size: 4.3vw !important;
width: 70%;
}
.mDate {
font-size: 3.4vw !important;
width: 28%;
text-align: right;
}
.mClass {
font-size: 3.5vw !important;
width: 100%;
}
.mDesc {
width: 69%;
font-size: 3.4vw !important;
color: #BBB;
}
#mainCircleButton {
position: absolute;
bottom: 6vw;
right: 6vw;
background-color: rgb(255, 26, 26);
}
.mCircleButton {
width: 13vw;
height: 13vw;
-moz-border-radius: 50%;
-webkit-border-radius: 50%;
border-radius: 50%;
-webkit-filter: drop-shadow(3px 4px 4px #111);
filter: drop-shadow(3px 4px 4px #111);
}
.mCircleButton .fa {
font-size: 5vw !important;
padding: 0 !important;
width: 100%;
height: 100%;
margin: auto;
text-align: center;
line-height: 13.1vw;
pointer-events: none;
}
.mUndo {
font-size: 4vw;
width: 13vw;
height: 13vw;
background-color: rgba(255,255,255, 0.1);
display: none;
opacity: 0;
position: absolute;
top: 3.75vw;
right: 4vw;
-moz-border-radius: 50%;
-webkit-border-radius: 50%;
border-radius: 50%;
}
.mUndo .fa {
width: 100%;
height: 50%;
text-align: center;
line-height: 9vw;
pointer-events: none;
}
.mUndo p {
font-size: 3vw;
width: 100%;
height: 50%;
margin: 0;
text-align: center;
pointer-events: none;
}
.mUndoText {
font-size: 4vw !important;
height: 13vw;
display: none;
opacity: 0;
position: absolute;
top: 3.75vw;
left: 8vw;
line-height: 13vw;
pointer-events: none;
}
#mOverlay {
height: 100%;
width: 100%;
background-color: rgba(0,0,0,0.3);
display: none;
opacity: 0;
position: absolute;
top: 0;
left: 0;
}
#mSidebar {
height: 100%;
width: 85%;
background-color: #fff;
box-shadow: 2px 0px 1px 1px #222;
position: absolute;
top: 0;
left: -100vw;
overflow-y: auto;
-webkit-transition: background-color 0.4s ease;
-moz-transition: background-color 0.4s ease;
-ms-transition: background-color 0.4s ease;
transition: background-color 0.4s ease;
}
.mSectionTitle {
width: 100%;
height: 13vw;
margin-top: 13vw;
background-color: rgba(255,255,255,0.1);
}
.mSectionTitle h3 {
font-weight: 200;
font-size: 4vw;
padding-left: 6%;
line-height: 13vw;
}
.mOpenable .fa {
font-size: 4vw;
height: 13vw;
padding: 0;
padding-right: 6%;
float: right;
line-height: 13vw;
}
.mOpenable h3:first-child {
font-weight: 200;
display: inline-block;
pointer-events: none;
}
.mSectionMode {
font-size: 4vw !important;
width: 100%;
height: 13vw;
display: table;
background-color: rgba(0,0,0,0.1);
}
.mStatus {
width: 2% !important;
height: 100%;
display: table-cell;
-webkit-transition: background-color 0.3s ease;
-moz-transition: background-color 0.3s ease;
-ms-transition: background-color 0.3s ease;
transition: background-color 0.3s ease;
}
.mSectionMode .fa {
font-size: 4vw;
width: 10%;
padding: 0 6% 0 6%;
line-height: 13vw;
display: table-cell;
vertical-align: middle;
}
.mSectionMode h4 {
font-size: 3.5vw !important;
width: 65%;
padding-left: 5%;
line-height: 13vw;
display: table-cell;
vertical-align: middle;
}
#mFilterWrapper {
display: none;
}
#mDisableFilter {
font-weight: 200;
font-size: 90%;
margin-left: 30%;
padding: 3%;
background-color: rgba(255,255,255,0.2);
display: none;
line-height: normal;
pointer-events: all;
z-index: 2;
}
#mTypeFilterWrapper {
margin-top: 0;
}
#mClassFilterWrapper {
margin-top: 0;
}
.mSideFilter, .mSideClass {
width: 100%;
background-color: rgba(0,0,0,0.1);
display: table;
}
.mSideTypeName {
font-size: 3.5vw;
width: 92%;
margin: 0;
padding: 5%;
padding-left: 5%;
display: table-cell;
}
.mSideClass span {
font-weight: 200;
margin: 0;
font-size: 3.5vw;
padding: 5%;
display: table-cell;
pointer-events: none;
}
.mSideClassName {
width: 50%;
padding-left: 5%;
}
.mSideClassHour {
width: 50%;
color: #CCC;
}
#mSettings, #mSignOut {
background-color: rgba(255,255,255,0.1);
}
#mSettings h3, #mSignOut h3 {
padding: 0;
}
#mSignOut {
margin-top: 0;
}
.mNoneText {
font-weight: 300;
font-style: italic;
padding: 5%;
}
#dueDateCont, #typeCont {
position: relative;
}
#dueDateCont i, #typeCont i {
position: absolute;
top: calc(10% + 2vw);
right: 4%;
}
#name, #class, #dueDate, #type, #description {
font-size: 3.7vw;
width: 95%;
padding: 2.5%;
border-bottom: 1px solid #888;
outline: none;
}
#mRestrictText {
width: 94%;
text-align: right;
padding: 3%;
}
#mReport {
position: absolute;
bottom: 21vw;
right: 6vw;
background-color: rgb(101, 101, 101);
-webkit-transition: background-color 0.4s ease;
-moz-transition: background-color 0.4s ease;
-ms-transition: background-color 0.4s ease;
transition: background-color 0.4s ease;
}
#mConfirm {
position: absolute;
bottom: 36vw;
right: 6vw;
background-color: rgb(101, 101, 101);
-webkit-transition: background-color 0.4s ease;
-moz-transition: background-color 0.4s ease;
-ms-transition: background-color 0.4s ease;
transition: background-color 0.4s ease;
}
.mNum {
font-size: 4vw;
width: 4vw;
margin: 0;
padding: 1.5%;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;
text-align: center;
background-color: rgba(255,255,255,0.3);
}
#mConfirmNum {
position: absolute;
bottom: 38.5vw;
right: 21vw;
}
#mReportNum {
position: absolute;
bottom: 23.5vw;
right: 21vw;
}
#mDelete {
padding: 3%;
background-color: rgba(255,255,255,0.1);
position: absolute;
bottom: 7vw;
left: 7vw;
}
.mOption {
font-size: 3.7vw;
width: 92%;
padding: 4%;
border-bottom: 1px solid #888;
background-color: rgba(255,255,255,0.05);
display: table;
}
.mOpTitle {
margin: 0;
width: 40%;
display: table-cell;
}
.mOpVal {
width: 30%;
display: table-cell;
text-align: right;
}
.mOptionText {
font-size: 3.5vw;
width: 92%;
margin: 0;
padding: 5%;
padding-left: 7%;
display: table-cell;
}

View File

@ -0,0 +1,268 @@
<template name="mobile">
<div class="noScroll" style="background-color: {{divColor 'mainColor'}}">
<header id="mobileHeader" style="background-color:{{divColor 'mainColor'}}">
<div id="mSidebarToggle">
<i class="fa fa-{{buttonTypeHeader}}" style="color:{{iconStatus}}" aria-hidden="true"></i>
</div>
<h2>{{schoolName}}</h2>
</header>
<div id="mobileBody">
{{#if showMode 'main'}}
<h4 class="minorHeader">Main</h4>
{{#each myWork}}
{{> mobileClass}}
{{/each}}
<h3 class="mNoneText" style="display:{{noneText 'main'}}">Nothing left here!</h3>
{{/if}}
{{#if showMode 'done'}}
<h4 class="minorHeader">Done</h4>
{{#each myWork "done"}}
{{> mobileClass}}
{{/each}}
<h3 class="mNoneText" style="display:{{noneText 'done'}}">You... should really get to work.</h3>
{{/if}}
{{#if showMode 'addWork'}}
{{> mAddWork}}
{{/if}}
{{#if showMode 'editWork'}}
{{> mEditWork}}
{{/if}}
{{#if showMode 'viewWork'}}
{{> mViewWork}}
{{/if}}
{{#if showMode 'settings'}}
{{> mSettings}}
{{/if}}
<div id="mainCircleButton" class="mCircleButton">
<i class="fa fa-{{buttonType}}" aria-hidden="true"></i>
</div>
</div>
<div id="mOverlay"></div>
<div id="mSidebar" style="background-color:{{divColor 'sidebarColor'}};border-left:3vw solid {{divColor 'sidebarColor'}}">
{{#if select 'class'}}
<p class="selectText">Pick a class to create work for</p>
<div id="mClassFilterWrapper" class="mSectionTitle">
<h3>Classes</h3>
</div>
<div id="mClassListHolder">
{{#each myClasses}}
{{> mSidebarClasses}}
{{/each}}
</div>
{{/if}}
{{#if select 'type'}}
<p class="selectText">Pick a type for your work</p>
<div id="mTypeFilterWrapper" class="mSectionTitle">
<h3>Types</h3>
</div>
<div id="mClassFilterHolder">
{{#each types}}
{{> mSideTypeFilter}}
{{/each}}
</div>
{{/if}}
{{#if select 'options'}}
<p class="selectText">Pick your new setting</p>
<div id="mTypeFilterWrapper" class="mSectionTitle">
<h3>{{optionInfo 'title'}}</h3>
</div>
<div id="mOptionHolder">
{{#each optionInfo 'list'}}
{{> mOptionCard}}
{{/each}}
</div>
{{/if}}
{{#if select 'none'}}
{{> defaultSidebar}}
{{/if}}
</div>
</div>
{{> sAlert}}
{{> loginButtons}}
</template>
<template name="mobileClass">
<div class="mClassContainer" workid="{{_id}}">
{{#if isDone}}
<h4 class="mUndoText" workid="{{_id}}">Unmarked as done!</h4>
{{else}}
<h4 class="mUndoText" workid="{{_id}}">Marked as done!</h4>
{{/if}}
<div class="mUndo" workid="{{_id}}">
<i class="fa fa-undo" aria-hidden="true"></i>
<p>Undo</p>
</div>
<div class="mobileClass" style="background-color:{{divColor 'secondaryColor'}}" workid="{{_id}}">
<div class="mobileType" style="background-color:{{typeColor}}"></div>
<div class="mobileClassContent">
<h4 class="mName">{{name}}</h4>
<h4 class="mDate">{{dateWord}}</h4>
<h4 class="mClass">{{className}}</h4>
<h4 class="mDesc">{{shortdesc}}</h4>
<div style="color:{{doneRatio}}">
<i class="fa fa-thumbs-up" aria-hidden="true"></i>
<span>{{confirmationLength}}</span>
<i class="fa fa-exclamation-triangle" aria-hidden="true"></i>
<span>{{reportLength}}</span>
</div>
</div>
</div>
</div>
</template>
<template name="defaultSidebar">
<div class="mSectionTitle downOffset">
<h3>Main</h3>
</div>
<div class="mSectionMode">
<div class="mStatus" style="background-color:{{modeStatus 'main'}}"></div>
<i class="fa fa-list-ul" aria-hidden="true"></i>
<h4>Main Work</h4>
</div>
<div class="mSectionMode">
<div class="mStatus" style="background-color:{{modeStatus 'done'}}"></div>
<i class="fa fa-check-square" aria-hidden="true"></i>
<h4>Done Work</h4>
</div>
<div id="mFilterHead" class="mSectionTitle mOpenable downOffset">
<h3>Filters</h3>
<h3 id="mDisableFilter" style="display:{{filterOn}}">Disable All</h3>
<i class="fa fa-angle-down" aria-hidden="true"></i>
</div>
<div id="mFilterWrapper">
<div id="mTypeFilterWrapper" class="mSectionTitle mOpenable">
<h3>By Type</h3>
<i class="fa fa-angle-down" aria-hidden="true"></i>
</div>
<div id="mClassFilterHolder">
{{#each types}}
{{> mSideTypeFilter}}
{{/each}}
</div>
<div id="mClassFilterWrapper" class="mSectionTitle mOpenable">
<h3>By Class</h3>
<i class="fa fa-angle-down" aria-hidden="true"></i>
</div>
<div id="mClassListHolder">
{{#each myClasses}}
{{> mSidebarClasses}}
{{/each}}
</div>
</div>
<div id="mSettings" class="mSectionTitle mSectionMode">
<i class="fa fa-cog" aria-hidden="true"></i>
<h3>Settings</h3>
</div>
<div id="mSignOut" class="mSectionTitle mSectionMode">
<i class="fa fa-sign-out" aria-hidden="true"></i>
<h3>Sign out</h3>
</div>
</template>
<template name="mSideTypeFilter">
<div class="mSideFilter" type="{{type}}">
<div class="mStatus" style="background-color:{{selected}}"></div>
<span class="mSideTypeName">{{typeName}}</span>
</div>
</template>
<template name="mSidebarClasses">
<div class="mSideClass" classid="{{_id}}">
<div class="mStatus" style="background-color:{{selected}}"></div>
<span class="mSideClassName">{{name}}</span>
<span class="mSideClassHour">{{hour}}</span>
</div>
</template>
<template name="mOptionCard">
<div class="mSideFilter">
<span class="mOptionText">{{alias}}</span>
</div>
</template>
<template name="mAddWork">
<h4 class="minorHeader">Add Work</h4>
<input id="name" class="mAddForm restrict" form="name" maxLength="50" placeholder="Name">
<input id="class" class="mAddForm" form="class" value="{{work 'class'}}">
<div id="dueDateCont">
<input id="dueDate" class="mAddForm" form="dueDate" placeholder="Due Date" readonly>
<i class="fa fa-angle-down" aria-hidden="true"></i>
</div>
<div id="typeCont">
<input id="type" class="mAddForm" form="type" placeholder="Type" value="{{work 'type'}}" readonly>
<i class="fa fa-angle-down" aria-hidden="true"></i>
</div>
<textarea id="description" class="mAddForm restrict" form="description" rows="8" maxLength="300" placeholder="Description"></textarea>
<div id="mRestrictText">
<span class="resText">{{restrict 'name'}}</span>
<span class="resText">{{restrict 'description'}}</span>
</div>
</template>
<template name="mEditWork">
<h4 class="minorHeader">Edit Work</h4>
<input id="name" class="mAddForm restrict" form="name" maxLength="50" placeholder="Name" value="{{work 'name'}}">
<input id="class" class="mAddForm" form="class" value="{{work 'class'}}" onfocus="this.blur()" readonly>
<div id="dueDateCont">
<input id="dueDate" class="mAddForm" form="dueDate" placeholder="Due Date" value="{{work 'dueDate'}}" onfocus="this.blur()" readonly>
<i class="fa fa-angle-down" aria-hidden="true"></i>
</div>
<div id="typeCont">
<input id="type" class="mAddForm" form="type" placeholder="Type" value="{{work 'type'}}" onfocus="this.blur()" readonly>
<i class="fa fa-angle-down" aria-hidden="true"></i>
</div>
<textarea id="description" class="mAddForm restrict" form="description" rows="8" maxLength="300" placeholder="Description" value="{{work 'description'}}"></textarea>
<div id="mRestrictText">
<span class="resText">{{restrict 'name'}}</span>
<span class="resText">{{restrict 'description'}}</span>
</div>
<div id="mConfirm" class="mCircleButton" style="background-color:{{work 'userConfirm'}}">
<i class="fa fa-thumbs-up" aria-hidden="true" ></i>
</div>
<p id="mConfirmNum" class="mNum">{{work 'confirmations'}}</p>
<div id="mReport" class="mCircleButton" style="background-color:{{work 'userReport'}}">
<i class="fa fa-exclamation-triangle" aria-hidden="true" ></i>
</div>
<p id="mReportNum" class="mNum">{{work 'reports'}}</p>
<!-- <h4 id="mDelete">Delete Work</h4> -->
</template>
<template name="mViewWork">
<h4 class="minorHeader">View Work</h4>
<input id="name" class="mAddForm restrict" form="name" maxLength="50" placeholder="Name" value="{{work 'name'}}" onfocus="this.blur()" readonly>
<input id="class" class="mAddForm" form="class" value="{{work 'class'}}" onfocus="this.blur()" readonly>
<div id="dueDateCont">
<input id="dueDate" class="mAddForm" form="dueDate" placeholder="Due Date" value="{{work 'dueDate'}}" onfocus="this.blur()" readonly>
</div>
<div id="typeCont">
<input id="type" class="mAddForm" form="type" placeholder="Type" value="{{work 'type'}}" onfocus="this.blur()" readonly>
</div>
<textarea id="description" class="mAddForm restrict" form="description" rows="8" maxLength="300" placeholder="Description" value="{{work 'description'}}" onfocus="this.blur()" readonly></textarea>
<div id="mRestrictText">
<span class="resText">{{restrict 'name'}}</span>
<span class="resText">{{restrict 'description'}}</span>
</div>
<div id="mConfirm" class="mCircleButton" style="background-color:{{work 'userConfirm'}}">
<i class="fa fa-thumbs-up" aria-hidden="true" ></i>
</div>
<p id="mConfirmNum" class="mNum">{{work 'confirmations'}}</p>
<div id="mReport" class="mCircleButton" style="background-color:{{work 'userReport'}}">
<i class="fa fa-exclamation-triangle" aria-hidden="true" ></i>
</div>
<p id="mReportNum" class="mNum">{{work 'reports'}}</p>
</template>
<template name="mSettings">
<div id="theme" class="mOption">
<p class="mOpTitle">Theme:</p>
<p class="mOpVal">{{pref 'theme'}}</p>
</div>
<div id="timeHide" class="mOption">
<p class="mOpTitle">Hide Homework:</p>
<p class="mOpVal">{{pref 'timeHide'}}</p>
</div>
<div id="hideReport" class="mOption">
<p class="mOpTitle">Hide Reported:</p>
<p class="mOpVal">{{pref 'hideReport'}}</p>
</div>
</template>

View File

@ -0,0 +1,740 @@
Session.set("mobileMode", "main");
Session.set("classDisp", []);
Session.set("typeFilter", []);
Session.set("restrictText", {});
Session.set("select", "none");
Session.set("options", null);
var filterOpen = [false, true, true];
var timeout;
Template.registerHelper('optionInfo', (type) => {
var op = Session.get("options")
if(type === "title") return op[1];
if(type === "list") {
return options[op[0]];
}
});
Template.mobile.created = function() {
Session.set("myWork", []);
Session.set("filterWork", []);
getClasses(Session.get("user").classes);
work.find().observeChanges({
added: function (id, fields) {
updateWork(id, fields, "added");
filterWork();
},
changed: function (id, fields) {
updateWork(id, fields, "changed");
filterWork();
},
removed: function (id) {
updateWork(id, null, "remove");
}
});
}
Template.mobile.rendered = function() {
document.getElementsByTagName("body")[0].style.color = Session.get("user").preferences.theme.textColor;
// Buttons
addMobileButton($("#mainCircleButton")[0], 50, "color", function() {
if(Session.equals("mobileMode","main") || Session.equals("mobileMode","done")) {
Session.set("currentWork", null);
Session.set("select", "class");
toggleSidebar(true);
} else if(Session.equals("mobileMode","addWork") || Session.equals("mobileMode", "editWork")) {
var inputs = document.getElementsByClassName("mAddForm");
var required = ["name", "dueDate", "class"];
var alert = checkComplete(required, inputs);
var values = alert[2];
if(!alert[0]) {
sAlert.error("Missing " + alert[1].replace("dueDate", "due date"), {
effect: 'stackslide',
position: 'top',
timeout: 3000
});
return;
}
values["class"] = Session.get("currentWork")["class"];
values.type = Session.get("currentWork").type;
values.dueDate = toDate(values["dueDate"]);
if(Session.equals("mobileMode","addWork")) {
serverData = values;
sendData("createWork");
} else {
values._id = Session.get("currentWork")._id;
serverData = values;
sendData("editWork");
}
$("#mainCircleButton").velocity("fadeOut", 200);
$("#mobileBody").velocity("fadeOut", {
duration: 200,
complete: function() {
Session.set("mobileMode", "main");
$("#mobileBody").velocity("fadeIn", 200);
$("#mainCircleButton").velocity("fadeIn", 200);
timedPushback(true);
}
});
}
});
addMobileButton($("#mSidebarToggle")[0], 0.2, "brightness", function() {
if(Session.equals("mobileMode","main") || Session.equals("mobileMode","done")) {
toggleSidebar(true);
} else {
$("#mainCircleButton").velocity("fadeOut", 200);
$("#mobileBody").velocity("fadeOut", {
duration: 200,
complete: function() {
$("#mainCircleButton").velocity("fadeIn", 200);
$("#mobileBody").velocity("fadeIn", 200);
Session.set("mobileMode", "main");
timedPushback(false);
}
});
}
});
// FOR SIDEBAR SLIDEBACK
var deltaX = 0;
var sidebar = $("#mSidebar");
new Hammer(sidebar[0], {
domEvents: true
});
sidebar.on('panmove', function(e) {
var dX = deltaX + (e.originalEvent.gesture.deltaX);
if(dX > 0) {
$.Velocity.hook(sidebar, 'translateX', dX/70 + 'px');
} else {
$.Velocity.hook(sidebar, 'translateX', dX + 'px');
}
});
sidebar.on('panend', function(e) {
deltaX += (e.originalEvent.gesture.deltaX);
if(deltaX >= -window.innerWidth * 0.4) {
deltaX = 0;
sidebar.velocity({'translateX': "0px"}, 150);
} else {
deltaX = 0;
toggleSidebar(false);
}
});
timedPushback(true);
}
Template.mobile.events({
'click #mOverlay' () {
if(timeout) toggleSidebar(false);
}
});
Template.defaultSidebar.rendered = function() {
addMobileButton($(".mSectionMode")[0], 0.2, "brightness", function() {
if(Session.equals("mobileMode", "main")) {
toggleSidebar(false);
} else {
Session.set("mobileMode","main");
toggleSidebar(false);
timedPushback(true);
}
});
addMobileButton($(".mSectionMode")[1], 0.2, "brightness", function() {
if(Session.equals("mobileMode", "done")) {
toggleSidebar(false);
} else {
Session.set("mobileMode","done");
toggleSidebar(false);
timedPushback(true);
}
});
addMobileButton($("#mSettings"), 0.1, "brightness" , function() {
toggleSidebar(false);
$("#mainCircleButton").velocity("fadeOut", 200);
$("#mobileBody").velocity("fadeOut", {
duration: 200,
complete: function() {
Session.set("mobileMode", "settings");
$("#mobileBody").velocity("fadeIn", 200);
}
});
});
addMobileButton($("#mSignOut"), 0.1, "brightness", function() {
$(".noScroll").velocity("fadeOut", 50);
document.getElementById('login-buttons-logout').click();
})
addMobileButton($("#mFilterHead")[0], 0.1, "brightness", function() {
if(event.target.id === "mDisableFilter") return;
if (!filterOpen[0]) {
$("#mFilterWrapper").slideDown(300);
} else {
$("#mFilterWrapper").slideUp(300);
}
filterOpen[0] = !filterOpen[0];
});
addMobileButton($("#mTypeFilterWrapper")[0], 0.1, "brightness", function() {
if (!filterOpen[1]) {
$("#mClassFilterHolder").slideDown(300);
} else {
$("#mClassFilterHolder").slideUp(300);
}
filterOpen[1] = !filterOpen[1];
});
addMobileButton($("#mClassFilterWrapper")[0], 0.1, "brightness", function() {
if (!filterOpen[2]) {
$("#mClassListHolder").slideDown(300);
} else {
$("#mClassListHolder").slideUp(300);
}
filterOpen[2] = !filterOpen[2];
});
addMobileButton($("#mDisableFilter")[0], -0.1, "brightness", function() {
Session.set("typeFilter", []);
Session.set("classDisp", []);
filterWork();
timedPushback(true);
});
}
Template.defaultSidebar.helpers({
modeStatus(mode) {
return (Session.equals("mobileMode", mode)) ? Session.get("user").preferences.theme.modeHighlight : "rgba(0,0,0,0)";
},
types() {
var types = Object.keys(workColors);
var array = [];
for (var i = 0; i < types.length; i++) {
array.push({
"type": types[i],
"typeName": types[i][0].toUpperCase() + types[i].slice(1),
"selected": (_.contains(Session.get("typeFilter"), types[i])) ? Session.get("user").preferences.theme.modeHighlight : "rgba(0,0,0,0)"
});
}
return array;
},
filterOn() {
return (Session.get("classDisp").length !== 0 || Session.get("typeFilter").length !== 0) ? "inline-block" : "none";
}
})
Template.mobileClass.rendered = function() {
var deltaX = 0;
var clearTile;
let movable = jQuery(this.firstNode.children[2]);
let undo = [jQuery(this.firstNode.children[0]), jQuery(this.firstNode.children[1])]
new Hammer(movable[0], {
domEvents: true
});
movable.on('panmove', function(e) {
if(Math.abs(e.originalEvent.gesture.deltaY) >= 10) return;
var dX = deltaX + (e.originalEvent.gesture.deltaX);
if(dX < 0) {
$.Velocity.hook(jQuery(e.target), 'translateX', dX/25 + 'px');
} else {
$.Velocity.hook(jQuery(e.target), 'translateX', dX + 'px');
}
});
movable.on('panend', function(e) {
if(e.target === document.getElementById("mobileBody")) return;
deltaX += (e.originalEvent.gesture.deltaX);
var id = this.getAttribute("workid");
if(deltaX >= window.innerWidth * 0.5) {
deltaX = 0;
jQuery(e.target).velocity(
{
translateX: window.innerWidth*1.2+"px"
},
{
duration: 150,
complete: function() {
undo[0].velocity("fadeIn", {duration: 300});
undo[1].velocity("fadeIn", {duration: 300});
var container = $(".mClassContainer[workid="+id+"]");
clearTile = setTimeout(function() {
undo[0].velocity("fadeOut", {duration: 100});
undo[1].velocity("fadeOut", {duration: 100});
container.velocity(
{
height: 0
},
{
duration: 200,
complete: function() {
serverData = [container[0].getAttribute("workid"), "done"];
sendData("toggleWork");
container.remove();
}
});
}, 1500);
}
});
} else {
deltaX = 0;
jQuery(e.target).velocity({translateX: "0px"},300);
}
});
addMobileButton(undo[1], -0.05, "brightness", function() {
clearTimeout(clearTile);
movable.velocity({translateX: "0px"},300);
undo[0].velocity("fadeOut", {duration: 300});
undo[1].velocity("fadeOut", {duration: 300});
});
addMobileButton(movable, -10, "color", function() {
Session.set("currentWork", work.findOne({_id: movable[0].getAttribute("workid")}));
var thisWork = work.findOne({
_id: Session.get("currentWork")._id
});
var inRole = false;
if (thisWork === undefined) return;
var currClass = classes.findOne({
_id: thisWork["class"]
});
if (Meteor.userId() === thisWork.creator ||
Roles.userIsInRole(Meteor.userId(), ['superadmin', 'admin']) ||
currClass.moderators.indexOf(Meteor.userId()) !== -1 ||
currClass.banned.indexOf(Meteor.userId()) !== -1 ||
currClass.admin === Meteor.userId()
) {
inRole = true;
}
if(inRole) {
$("#mainCircleButton").velocity("fadeOut", 200);
$("#mobileBody").velocity("fadeOut", {
duration: 200,
complete: function() {
$("#mainCircleButton").velocity("fadeIn", 200);
$("#mobileBody").velocity("fadeIn", 200);
Session.set("mobileMode", "editWork");
}
});
} else {
$("#mainCircleButton").velocity("fadeOut", 200);
$("#mobileBody").velocity("fadeOut", {
duration: 200,
complete: function() {
$("#mobileBody").velocity("fadeIn", 200);
Session.set("mobileMode", "viewWork");
}
});
}
});
}
Template.mobileClass.helpers({
inRole() { // Checks correct permissions.
if(Session.equals("currentWork",null)) return;
try {
var thisWork = work.findOne({
_id: Session.get("currentWork")._id
});
if (thisWork === undefined) return;
var currClass = classes.findOne({
_id: thisWork["class"]
});
if (Meteor.userId() === thisWork.creator ||
Roles.userIsInRole(Meteor.userId(), ['superadmin', 'admin']) ||
currClass.moderators.indexOf(Meteor.userId()) !== -1 ||
currClass.banned.indexOf(Meteor.userId()) !== -1 ||
currClass.admin === Meteor.userId()
) return true;
} catch(err) {}
}
})
Template.mSidebarClasses.rendered = function() {
let div = this.firstNode;
addMobileButton(div, 0.1, "brightness", function() {
var classid = div.getAttribute("classid");
if(Session.equals("select", "class")) {
var curr = Session.get("currentWork") || {};
curr["class"] = classid;
Session.set("currentWork", curr);
toggleSidebar(false);
if(!Session.equals("mobileMode", "addWork")) {
$("#mobileBody").velocity("fadeOut", {
duration: 200,
complete: function() {
Session.set("mobileMode", "addWork");
$("#mobileBody").velocity("fadeIn", 200);
$("#mainCircleButton").velocity("fadeIn", 200);
}
});
}
} else {
var array = Session.get("classDisp");
if (array.indexOf(classid) !== -1) {
array.splice(array.indexOf(classid), 1);
} else {
array.push(classid);
}
Session.set("classDisp", array);
timedPushback(true);
filterWork();
}
});
}
Template.mSideTypeFilter.rendered = function() {
let div = this.firstNode;
addMobileButton(div, 0.1, "brightness", function() {
var type = div.getAttribute("type");
if(Session.equals("select", "type")) {
var curr = Session.get("currentWork") || {};
curr["type"] = type;
Session.set("currentWork", curr);
toggleSidebar(false);
} else {
var array = Session.get("typeFilter");
if (array.indexOf(type) !== -1) {
array.splice(array.indexOf(type), 1);
} else {
array.push(type);
}
Session.set("typeFilter", array);
timedPushback(true);
filterWork();
}
});
}
Template.mobile.helpers({
schoolName() { // Finds the name of the user's school.
if (Session.get("user").school === undefined || Session.get("user").school === null) return;
return Session.get("user").school;
},
iconStatus() {
return (Session.get("sidebarMode") === "mobile") ? Session.get("user").preferences.theme.iconHighlight : "";
},
myWork(done) {
return (done === "done") ?
Session.get("myWork").filter(function(work) {
return _.contains(work.done, Meteor.userId());
}) :
Session.get("myWork").filter(function(work) {
return !_.contains(work.done, Meteor.userId());
});
},
showMode(mode) {
return Session.equals("mobileMode", mode);
},
types() {
var types = Object.keys(workColors);
var array = [];
for (var i = 0; i < types.length; i++) {
array.push({
"type": types[i],
"typeName": types[i][0].toUpperCase() + types[i].slice(1),
"selected": (_.contains(Session.get("typeFilter"), types[i])) ? Session.get("user").preferences.theme.modeHighlight : "rgba(0,0,0,0)"
});
}
return array;
},
noneText(type) {
return (type === "main") ?
(Session.get("myWork").filter(function(work) {
return !_.contains(work.done, Meteor.userId());
}).length === 0) ? "block" : "none"
:
(Session.get("myWork").filter(function(work) {
return _.contains(work.done, Meteor.userId());
}).length === 0) ? "block" : "none";
},
buttonType() {
if(Session.equals("mobileMode","main") || Session.equals("mobileMode","done")) {
return "pencil";
} else if(Session.equals("mobileMode","addWork")) {
return "plus";
} else if(Session.equals("mobileMode", "editWork")) {
return "floppy-o";
}
},
buttonTypeHeader() {
if(Session.equals("mobileMode","main") || Session.equals("mobileMode","done")) {
return "bars";
} else if(Session.equals("mobileMode","addWork") || Session.equals("mobileMode","editWork")) {
return "times";
} else if(Session.equals("mobileMode", "viewWork") || Session.equals("mobileMode", "settings")) {
return "arrow-left";
}
},
select(type) {
return Session.equals("select", type);
}
});
Template.mobileClass.helpers({
isDone() {
return Session.equals("mobileMode", "done");
},
})
Template.mAddWork.rendered = function() {
addMobileButton($('#dueDate'), 0.2, "brightness", function() {
$('#dueDate').datepicker({
format: 'DD, MM d, yyyy',
clickInput: true,
startDate: 'd',
todayHighlight: true,
todayBtn: true,
autoclose: true
});
});
addMobileButton($('#class'), 0.2, "brightness", function() {
Session.set("select", "class");
toggleSidebar(true);
});
addMobileButton($('#type'), 0.2, "brightness", function() {
Session.set("select", "type");
toggleSidebar(true);
});
}
Template.mEditWork.rendered = function() {
addMobileButton($('#dueDate'), 0.2, "brightness", function() {
$('#dueDate').datepicker({
format: 'DD, MM d, yyyy',
clickInput: true,
startDate: 'd',
todayHighlight: true,
todayBtn: true,
autoclose: true
});
});
addMobileButton($('#class'), 0.2, "brightness", function() {});
addMobileButton($('#type'), 0.2, "brightness", function() {
Session.set("select", "type");
toggleSidebar(true);
});
/*addMobileButton($("#mDelete"), 0.2, "brightness", function() {
})*/
}
Template.mAddWork.events({
'input .restrict' (event) {
var restrict = event.target.maxLength;
var chars = restrict - event.target.value.length;
var newSetting = Session.get("restrictText");
newSetting[event.target.id] = (chars === restrict) ? "" : (chars.toString() + ((chars === 1) ? " character " : " characters ") + "left");
newSetting.selected = event.target.id;
Session.set("restrictText", newSetting);
}
});
Template.mEditWork.events({
'input .restrict' (event) {
var restrict = event.target.maxLength;
var chars = restrict - event.target.value.length;
var newSetting = Session.get("restrictText");
newSetting[event.target.id] = (chars === restrict) ? "" : (chars.toString() + ((chars === 1) ? " character " : " characters ") + "left");
newSetting.selected = event.target.id;
Session.set("restrictText", newSetting);
},
'click #mConfirm' () {
serverData = [Session.get("currentWork")._id, "confirmations"];
sendData("toggleWork");
},
'click #mReport' () {
serverData = [Session.get("currentWork")._id, "reports"];
sendData("toggleWork");
}
});
Template.mViewWork.events({
'click #mConfirm' () {
serverData = [Session.get("currentWork")._id, "confirmations"];
sendData("toggleWork");
},
'click #mReport' () {
serverData = [Session.get("currentWork")._id, "reports"];
sendData("toggleWork");
}
});
Template.mSettings.rendered = function() {
var options = ["theme", "timeHide", "done", "hideReport"];
for(let i = 0; i < options.length; i++) {
addMobileButton($("#"+options[i]), 0.05, "brightness", function() {
Session.set("select", "options");
Session.set("options", [options[i], $("#"+options[i])[0].children[0].innerHTML.replace(":","")]);
toggleSidebar(true);
});
}
}
Template.mOptionCard.rendered = function() {
var div = this.firstNode;
addMobileButton(this.firstNode, 0.2, "brightness", function() {
var newSetting = Session.get("user");
var option = div.children[0].innerHTML;
newSetting.preferences[Session.get("options")[0]] = (function() {
var value = options[Session.get("options")[0]].filter(function(entry) {
return option === entry.alias;
})[0].val;
return (Session.get("options")[0] === 'theme') ? themeColors[value] : value;
})();
Session.set("user", newSetting);
serverData = Session.get("user");
sendData("editProfile");
toggleSidebar(false);
});
}
addMobileButton = function(element, lighten, animateType, completeFunction) {
let add = lighten;
let type = animateType;
let ele = jQuery(element);
let execute = completeFunction;
let care = true;
let colors = [
parseFloat($.Velocity.hook(ele, "backgroundColorRed")),
parseFloat($.Velocity.hook(ele, "backgroundColorGreen")),
parseFloat($.Velocity.hook(ele, "backgroundColorBlue")),
parseFloat($.Velocity.hook(ele, "backgroundColorAlpha"))
];
ele.on('touchstart', function(e) {
care = true;
switch(type) {
case "color":
ele.velocity(
{
backgroundColorRed: colors[0] + add,
backgroundColorGreen: colors[1] + add,
backgroundColorBlue: colors[2] + add
},100);
break;
case "brightness":
ele.velocity({backgroundColorAlpha: colors[3] + add},100);
break;
}
});
ele.on('touchend', function(e) {
if(!care) return;
ele.velocity("stop");
timeout = false;
setTimeout(function() {
timeout = true;
}, 100);
switch(type) {
case "color":
ele.velocity(
{
backgroundColorRed: colors[0],
backgroundColorGreen: colors[1],
backgroundColorBlue: colors[2]
},
{
duration: 200,
complete: execute()
});
break;
case "brightness":
ele.velocity(
{
backgroundColorAlpha: colors[3]
},
{
duration: 200,
complete: execute()
});
break;
}
});
ele.on('touchmove', function(e) {
if (element !== document.elementFromPoint(e.originalEvent.touches[0].pageX,e.originalEvent.touches[0].pageY)) {
ele.mouseleave();
}
})
ele.on('mouseleave', function(e) {
if(!care) return;
care = false;
switch(type) {
case "color":
ele.velocity(
{
backgroundColorRed: colors[0],
backgroundColorGreen: colors[1],
backgroundColorBlue: colors[2]
},200);
break;
case "brightness":
ele.velocity({backgroundColorAlpha: colors[3]},200);
break;
}
});
}
function toggleSidebar(open) {
if(open) {
$("#mOverlay").velocity("fadeIn", 300);
$("#mSidebar").velocity({left: '-3vw'}, 300);
} else {
$("#mOverlay").velocity("fadeOut", 300);
$("#mSidebar").velocity(
{
left: '-100vw'
},
{
duration: 300,
complete: function() {
$.Velocity.hook($("#mSidebar"), 'translateX', '0px');
Session.set("select", "none");
}
});
}
}
function timedPushback(type) {
var fadeTime = 10;
$(".mClassContainer").velocity("stop", true);
if(!type) {
setTimeout(function() {
$(".mClassContainer").velocity({opacity: 1}, 0);
}, fadeTime);
} else {
$(".mClassContainer").velocity("fadeOut", fadeTime);
setTimeout(function() {
$(".mClassContainer").velocity({left: "-150vw"}, 0);
$(".mClassContainer").velocity("fadeIn", 0);
$(".mClassContainer").velocity({opacity: 1}, 0);
var i = 0;
var timer = setInterval(function() {
$($(".mClassContainer")[i]).velocity({left: ""});
if(i === $(".mClassContainer").length - 1) clearInterval(timer);
i += 1;
}, 100);
}, fadeTime);
}
}

View File

@ -0,0 +1,179 @@
#mProfWrapper {
width: 100%;
height: 100%;
background-color: #282933;
color: #FCF0F0 !important;
position: absolute;
overflow-y: auto;
overflow-x: hidden;
}
.mSelect {
font-size: 4vw;
width: 100%;
padding: 4.5%;
border-bottom: 1px solid #888 !important;
}
#mOpOverlay {
color: #FCF0F0 !important;
height: 100%;
width: 100%;
background-color: rgba(0,0,0,0.3);
display: none;
opacity: 0;
position: absolute;
top: 0;
left: 0;
}
#mProfMain {
margin-top: 10%;
}
#schoolCont, #gradeCont, #classCont {
position: relative;
}
#schoolCont .fa, #gradeCont .fa {
position: absolute;
top: 40%;
right: 4%;
pointer-events: none;
}
#classCont .fa {
padding: 0;
position: absolute;
top: 35%;
right: 3%;
pointer-events: none;
}
#mOpCont {
width: 70%;
margin: auto;
margin-top: 30%;
background-color: #444;
}
#mOpCont h3 {
font-weight: 200;
padding: 4%;
background-color: rgba(255,255,255,0.1);
}
#mOpProfCont {
max-height: 56vh;
overflow-x: hidden;
overflow-y: auto;
}
.mOpCard2 {
width: 90%;
padding: 4% 4% 4% 6%;
border-bottom: 1px solid #555;
background-color: rgba(255,255,255,0.01);
}
#mProfClass {
margin-top: 10%;
}
#classCont {
padding: 3%;
background-color: rgba(255,255,255,0.2);
}
#classCont h3 {
font-weight: 100;
pointer-events: none;
}
.mDisable {
color: #888;
}
.mClassBox {
width: 90%;
padding: 4% 4% 4% 6%;
border-bottom: 1px solid #555;
background-color: rgba(255,255,255,0.01);
display: table;
table-layout: fixed;
}
.mProfClassDelete {
width: 9vw;
height: 9vw;
background-color: rgba(255,255,255,0.1);
display: table-cell;
}
.mClassBox .fa {
font-size: 4vw !important;
line-height: 9vw !important;
}
#mProfClass .mClassBox {
width: 94%;
padding: 2% 2% 2% 4%;
}
#mProfClass .name {
width: 48%;
}
#mProfClassTitle {
font-weight: 200;
width: 92%;
padding: 4%;
background-color: rgba(255,255,255,0.1);
display: table;
}
#mProfClassTitle h3 {
width: 40%;
background-color: rgba(0,0,0,0);
display: table-cell;
}
#mOpProfCont h3 {
background-color: rgba(255,255,255,0);
}
#mClassSearch {
font-size: 3.5vw;
width: 90%;
padding: 5%;
outline: none;
}
#mProfWrapper .-autocomplete-container {
display: none;
}
#mProfSubmit {
font-size: 4vw;
width: 15vw;
margin: 5vh auto 5vh auto;
padding: 3%;
background-color: rgba(255,255,255,0.2);
text-align: center;
position: absolute;
left: 42.5vw;
}

View File

@ -0,0 +1,91 @@
<template name="mProfile">
<div class="noScroll mProfCont">
<div id="mProfWrapper">
<div id="mProfMain">
<div id="schoolCont">
<input class="mSelect" id="school" form="school" onfocus="this.blur()" placeholder="School" readonly>
<i class="fa fa-angle-down" aria-hidden="true"></i>
</div>
<div id="gradeCont">
<input class="mSelect" id="grade" form="grade" onfocus="this.blur()" placeholder="Graduation Year" readonly>
<i class="fa fa-angle-down" aria-hidden="true"></i>
</div>
</div>
<div id="mProfClass">
<div id="classCont" class="mDisable">
<h3>My Classes</h3>
<i class="fa fa-plus" aria-hidden="true"></i>
</div>
{{#each mProfClasses}}
{{> mClassDisplay2}}
{{/each}}
</div>
<p id="mProfSubmit">Finish!</p>
</div>
<div id="mOpOverlay">
<div id="mOpCont">
{{#if mProfOp 'class'}}
<div id="mProfClassTitle">
<h3>Select</h3>
{{> inputAutocomplete id="mClassSearch" settings=classSettings placeholder="Search..."}}
</div>
<div id="mOpProfCont">
{{#if notsearching}}
{{#each classes}}
{{> mClassDisplay}}
{{/each}}
{{#if noclass}}
<h3>No results found...</h3>
{{/if}}
{{else}}
{{#each autocompleteClasses}}
{{> mClassDisplay}}
{{/each}}
{{#if notfound}}
<h3>No results found...</h3>
{{/if}}
{{/if}}
</div>
{{else}}
<h3>Select</h3>
<div id="mOpProfCont">
{{#if mProfOp 'school'}}
{{#each selectOptions 'school'}}
{{> mOptionCard2}}
{{/each}}
{{/if}}
{{#if mProfOp 'grade'}}
{{#each selectOptions 'grade'}}
{{> mOptionCard2}}
{{/each}}
{{/if}}
</div>
{{/if}}
</div>
</div>
</div>
{{> sAlert}}
</template>
<template name="mOptionCard2">
<h4 class="mOpCard2">{{alias}}</h4>
</template>
<template name="mClassDisplay">
<div class="mClassBox" classid="{{_id}}">
<span class="name classText">{{name}}</span>
<span class="teacher classText">{{teachershort}}</span>
<span class="hour classText">{{hour}}</span>
</div>
</template>
<template name="mClassDisplay2">
<div class="mClassBox" classid="{{_id}}">
<span class="name classText">{{name}}</span>
<span class="teacher classText">{{teachershort}}</span>
<span class="hour classText">{{hour}}</span>
<div class="mProfClassDelete mCircleButton">
<i class="fa fa-times" aria-hidden="true" ></i>
</div>
</div>
</template>

View File

@ -0,0 +1,262 @@
Session.set("profile", {classes: []});
Session.set("notsearching", true); // If user isn't searching
Session.set("noclass", null); // If user doesn't have classes.
Session.set("autocompleteDivs", null);
Template.mProfile.rendered = function() {
addMobileButton($("#school"), 0.2, "brightness", function() {
Session.set("mProfOption", "school");
$("#mOpOverlay").velocity("fadeIn", 200);
});
addMobileButton($("#grade"), 0.2, "brightness", function() {
Session.set("mProfOption", "grade");
$("#mOpOverlay").velocity("fadeIn", 200);
});
addMobileButton($("#classCont"), -0.1, "brightness", function() {
if(Session.get("profile").school === undefined) return;
Session.set("mProfOption", "class");
$("#mOpOverlay").velocity("fadeIn", 200);
});
addMobileButton($("#mProfSubmit"), -0.1, "brightness", function() {
var myClasses = Session.get("profile").classes;
var message = "Sorry, your profile couldn't be created. Please try again!";
var inputs = document.getElementsByClassName("mSelect");
var required = ["school","grade"];
var alert = checkComplete(required, inputs);
var values = alert[2];
if(!alert[0]) {
sAlert.error("Missing " + alert[1], {
effect: 'stackslide',
position: 'top',
timeout: 3000
});
return;
}
if(myClasses.length === 0) {
sAlert.error("Please enroll in a class!", {
effect: 'stackslide',
position: 'top'
});
return;
}
joinClass(0);
var profile = Session.get("profile");
profile.complete = true;
profile.preferences = Meteor.user().profile.preferences;
profile.classes.push(Meteor.userId());
Meteor.call("editProfile", profile, function(err, result) {
if(err !== undefined) {
sAlert.error(message, {
effect: 'stackslide',
position: 'top'
});
}
Meteor.subscribe('classes');
Meteor.subscribe('schools');
Meteor.subscribe('teachers');
Meteor.subscribe('work');
Meteor.subscribe('requests');
Meteor.subscribe("personalUser");
Meteor.subscribe('users');
});
});
}
Template.mProfile.helpers({
mProfOp(type) {
return Session.equals("mProfOption", type);
},
classes() {
var array = classes.find({
status: {
$eq: true
},
privacy: {
$eq: false
},
_id: {
$nin: Session.get("profile").classes
},
school: {
$eq: Session.get("profile").school
}
}, {
sort: {
subscribers: -1
}
}, {
limit: 20
}).fetch();
for (var i = 0; i < array.length; i++) {
array[i].subscribers = array[i].subscribers.length;
array[i].teachershort = array[i].teacher.split(" ").slice(1).reduce(function(a, b) {
return a + " " + b;
});
}
if (array.length === 0) {
Session.set("noclass", true);
} else {
Session.set("noclass", false);
}
return array;
},
classSettings() {
return {
position: "bottom",
limit: 10,
rules: [{
token: '',
collection: classes,
template: Template.classAutoList,
filter: {
privacy: false,
status: true
},
selector: (match) => {
regex = new RegExp(match, 'i');
return {
$or: [{
'name': regex
}, {
'teacher': regex
}, {
'hour': regex
}]
};
}
}]
};
},
notsearching() { // Tells whether user is using the searchbox
return Session.get("notsearching");
},
autocompleteClasses() { // Returns current auto-completes for classes
return Session.get("autocompleteDivs");
},
notfound() { // Returns if autocomplete has no results.
return Session.get("notfound");
},
mProfClasses() {
var array = [];
var myClasses = Session.get("profile").classes;
for(var i = 0; i < myClasses.length; i++) {
var val = classes.findOne({_id: myClasses[i]});
val.subscribers = val.subscribers.length;
val.teachershort = val.teacher.split(" ").slice(1).reduce(function(a, b) {
return a + " " + b;
});
array.push(val);
}
return array;
}
});
Template.mProfile.events({
'click #mOpOverlay' (event) {
if(event.target.id === "mOpOverlay") {
$("#mOpOverlay").velocity("fadeOut", 200);
}
},
'input #mClassSearch' (event) { // Auto-complete updater
if (event.target.value.length === 0) {
Session.set("notsearching", true);
} else {
Session.set("notsearching", false);
}
Session.set("autocompleteDivs", null);
var divs = [];
try {
var items = document.getElementsByClassName("-autocomplete-container")[0].children;
if(items[0].tagName === "I") {
Session.set("notfound", true);
return;
} else {
items = items[0].children;
for(var i = 0; i < items.length; i++) {
var item = items[i].children;
var id = item[4].textContent;
if(Session.get("profile").classes.indexOf(id) !== -1) continue;
divs.push({
name: item[0].textContent,
teachershort: item[1].textContent.split(" ")[1],
hour: item[2].textContent,
subscribers: (item[3].textContent.match(new RegExp(",","g")) || []).length+1,
_id: id,
join: true
})
}
Session.set("autocompleteDivs", divs.sort(function(a, b) {
return b.subscribers - a.subscribers;
}));
Session.set("notfound", false);
return;
}
} catch(err) {}
},
})
Template.mOptionCard2.rendered = function() {
var div = this.firstNode;
addMobileButton(div, 0.1, "brightness", function() {
$("#"+Session.get("mProfOption"))[0].value = div.innerHTML;
var newSetting = Session.get("profile");
if(Session.equals("mProfOption", "school")) {
$("#classCont").removeClass("mDisable");
if(div.innerHTML !== Session.get("profile").school) {
newSetting["classes"] = [];
}
newSetting[Session.get("mProfOption")] = div.innerHTML;
} else {
newSetting[Session.get("mProfOption")] = div.innerHTML;
}
Session.set("profile", newSetting);
$("#mOpOverlay").velocity("fadeOut", 200);
});
}
Template.mClassDisplay.rendered = function() {
var div = this.firstNode;
addMobileButton(div, 0.1, "brightness", function() {
var newSetting = Session.get("profile");
newSetting.classes.push(div.getAttribute("classid"));
Session.set("profile", newSetting);
$("#mOpOverlay").velocity("fadeOut", 200);
});
}
Template.mClassDisplay2.rendered = function() {
let div = this.firstNode.children[3];
addMobileButton(div, 0.1, "brightness", function() {
console.log(div);
var newSetting = Session.get("profile");
newSetting.classes.splice(newSetting.classes.indexOf(div.parentNode.getAttribute("classid")),1)
Session.set("profile", newSetting);
});
}
function joinClass(num) {
var joining = Session.get("profile").classes;
if(joining.length === 0) return;
Meteor.call("joinClass", [joining[num], ""], function(err, result) {
if(err !== undefined) {
sAlert.error(err.message, {
effect: 'stackslide',
position: 'top'
});
}
joined++;
if(joined !== joining.length) {
joinClass(joined);
}
});
}

View File

@ -0,0 +1,294 @@
#profPageWrapper {
width: 100%;
height: 100%;
background-color: #282933;
color: #FCF0F0 !important;
position: absolute;
top: 0;
left: 0;
user-select: none;
}
#profPageWrapper input {
color: #FCF0F0 !important;
}
#profPageWrapper .optionText {
background-color: #282933 !important;
}
#profPageWrapper #classSearch {
background-color: rgba(0,0,0,0.1);
border: 0;
-webkit-transition: background-color 0.5s ease;
-moz-transition: background-color 0.5s ease;
-ms-transition: background-color 0.5s ease;
transition: background-color 0.5s ease;
}
#profPageWrapper #classSearch:hover {
background-color: rgba(0,0,0,0.2);
}
#profPageWrapper .classBox:not(#label) {
border: 1px solid #FCF0F0 !important;
}
#basicInfo {
width: 100%;
position: absolute;
top: 20%;
}
#newUserWrapper {
width: 25%;
padding: 2%;
margin: auto;
background-color: rgba(255,255,255,0.2);
}
#newUserWrapper .formDiv {
position: relative;
}
.opTitle {
font-weight: 200;
margin: 1%;
}
#basicNext {
font-weight: 200;
padding: 2%;
border: 1px solid #FCF0F0;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
cursor: pointer;
text-align: center;
-webkit-transition: background-color 0.5s ease;
-moz-transition: background-color 0.5s ease;
-ms-transition: background-color 0.5s ease;
transition: background-color 0.5s ease;
}
#basicNext:hover {
background-color: rgba(0,0,0,0.1);
}
#backArrow {
margin: auto;
z-index: 10;
cursor: pointer;
opacity: 0;
position: relative;
top: 5%;
-webkit-transition: background-color 0.5s ease;
-moz-transition: background-color 0.5s ease;
-ms-transition: background-color 0.5s ease;
transition: background-color 0.5s ease;
}
#backArrow i {
line-height: 5vh;
}
#backArrow:hover {
background-color: rgba(255,255,255,0.05);
}
#forwardArrow {
margin: auto;
z-index: 10;
cursor: pointer;
opacity: 0;
position: relative;
top: 85%;
-webkit-transition: background-color 0.5s ease;
-moz-transition: background-color 0.5s ease;
-ms-transition: background-color 0.5s ease;
transition: background-color 0.5s ease;
}
#forwardArrow:hover {
background-color: rgba(255,255,255,0.05);
}
#enrollInfo {
width: 100%;
position: absolute;
top: 150%;
}
#enrollUserWrapper {
width: 60%;
height: 60vh;
margin: auto;
padding: 1%;
background-color: rgba(255,255,255,0.2);
}
#enrollUserWrapper #classBody {
height: 40vh;
}
#enrollClassList {
width: 10%;
height: 100%;
background-color: rgba(0,0,0,0.2);
display: none;
position: absolute;
top: 0;
left: 0;
}
#enrollClassList h3 {
font-weight: 300;
margin: 0;
padding: 10%;
background-color: rgba(0,0,0,0.4);
border: 0;
text-align: center;
}
#enrollClassList h4 {
font-weight: 300;
margin: 0;
width: 90%;
padding: 10%;
display: table-cell;
cursor: pointer;
-webkit-transition: background-color 0.5s ease;
-moz-transition: background-color 0.5s ease;
-ms-transition: background-color 0.5s ease;
transition: background-color 0.5s ease;
}
#enrollClassList i {
font-size: 2vh;
width: 20%;
display: table-cell;
cursor: pointer;
text-align: right;
-webkit-transition: color 0.5s ease;
-moz-transition: color 0.5s ease;
-ms-transition: color 0.5s ease;
transition: color 0.5s ease;
}
#enrollClassList i:hover {
color: #FF1A1A;
}
#ESCWrapper {
background-color: rgba(0,0,0,0.2);
}
#ESCWrapper:hover {
background-color: rgba(0,0,0,0.25);
}
#createActivate {
margin-right: 5%;
padding: 1%;
background-color: rgba(0,0,0,0.1);
float: right;
cursor: pointer;
-webkit-transition: background-color 0.5s ease;
-moz-transition: background-color 0.5s ease;
-ms-transition: background-color 0.5s ease;
transition: background-color 0.5s ease;
}
#createActivate:hover {
background-color: rgba(0,0,0,0.2)
}
#createInfo {
width: 100%;
position: absolute;
top: 150%;
}
#profPageWrapper #createWrapper {
margin: auto;
margin-top: -1%;
padding: 3%;
padding-top: 2%;
padding-bottom: 1%;
width: 30%;
background-color: rgba(255,255,255,0.2);
}
#profPageWrapper #creSubmit {
margin-top: 5%;
border: 1px solid #FCF0F0 !important;
}
#profPageWrapper .profTitle {
margin-bottom: 1%;
}
#profPageWrapper input {
margin: 0;
padding: 2%;
background-color: rgba(0,0,0,0.1);
border: 0;
}
#profileSubmit {
font-weight: 300;
font-size: 3vh;
padding: 1.5%;
border-right: 5px solid #FCF0F0;
background-color: rgba(0,0,0,0.2);
display: none;
position:absolute;
top: 40%;
right: 0;
cursor: pointer;
-webkit-transition: background-color 0.5s ease;
-moz-transition: background-color 0.5s ease;
-ms-transition: background-color 0.5s ease;
transition: background-color 0.5s ease;
}
#profileSubmit span, #profileSubmit i {
vertical-align: middle;
}
#profileSubmit i {
position: relative;
}
#profileSubmit:hover {
background-color: rgba(0,0,0,0.3);
}
#profPageWrapper #createInfo .formDiv:nth-child(5), #profPageWrapper #createInfo .formDiv:nth-child(6) {
position: relative;
}

View File

@ -0,0 +1,134 @@
<template name="profile">
{{> sAlert}}
<div id="profPageWrapper">
<div id="backArrow" class="circleIcon moveArrow" style="display:{{showArrow 'back'}}">
<i class="fa fa-chevron-up" aria-hidden="true"></i>
</div>
<div id="basicInfo">
<div id="newUserWrapper">
<div class="formDiv">
<p class="opTitle">**School:</p>
<input id="school" class="basicInfoField clickModify dropdown" type="text" form="school" placeholder=" Click here to edit..." readonly>
<div class="optionHolder">
{{#each selectOptions 'school'}}
{{> option}}
{{/each}}
</div>
</div>
<div class="formDiv">
<p class="opTitle">**Graduation Year:</p>
<input id="grade" class="basicInfoField clickModify dropdown" type="text" form="grade" placeholder="Click here to edit..." readonly>
<div class="optionHolder">
{{#each selectOptions 'grade'}}
{{> option}}
{{/each}}
</div>
</div>
<h3 id="basicNext">Continue</h3>
</div>
</div>
<div id="enrollInfo">
<div id="enrollUserWrapper">
<div id="joinTop">
<i class="fa fa-search" aria-hidden="true"></i>
{{> inputAutocomplete id="classSearch" settings=classSettings placeholder="Search..."}}
<span id="createActivate">Class not here?</span>
</div>
<div id="settingClassWrapper">
<div id="classHeader">
<div id="label" class="classBox">
<span class="name classText">Class Name</span>
<span class="teacher classText">Teacher</span>
<span class="hour classText">Hour</span>
<span class="subscriptions classText">Members</span>
</div>
</div>
<div id="classBody">
{{#if notsearching}}
{{#each classes}}
{{> classDisplay}}
{{/each}}
{{#if noclass}}
<h3>No results found...</h3>
{{/if}}
{{else}}
{{#each autocompleteClasses}}
{{> classDisplay}}
{{/each}}
{{#if notfound}}
<h3>No results found...</h3>
{{/if}}
{{/if}}
</div>
</div>
</div>
</div>
<div id="enrollClassList">
<h3>My Classes</h3>
{{#each enrollClass}}
{{> enrollSideClass}}
{{/each}}
</div>
<div id="createInfo">
<div id="createWrapper">
<div id="creRules">
<p>Submit a request for a class to be approved by an administrator.
You can have up to 8 unapproved classes at once.</p>
</div>
<div id="formContainer">
<div class="formDiv">
<p class="profTitle">**School:</p>
<input id="school" class="creInput" type="text" form="school" value="{{school}}" readonly>
</div>
<div class="formDiv">
<p class="profTitle">Hour:</p>
<input class="creInput" type="text" form="hour" placeholder="Hour">
</div>
<div class="formDiv">
<p class="profTitle">Teacher:</p>
{{> inputAutocomplete settings=teacherComplete class="form-control creInput" type="text" form="teacher" placeholder="Teacher | Ex: Marc DeZwaan" }}
</div>
<div class="formDiv">
<p class="profTitle">**Class Name:</p>
<input class="creInput" type="text" form="name" placeholder="**Class Name">
</div>
<div class="formDiv">
<p class="profTitle">**Privacy:</p>
<input id="creprivacy" style="color:{{divColor 'textColor'}}" class="creInput clickModify dropdown" type="text" form="privacy" placeholder="Click here to edit..." readonly>
<div class="optionHolder">
{{#each selectOptions 'privacy'}}
{{> option}}
{{/each}}
</div>
</div>
<div class="formDiv">
<p class="profTitle">**Category:</p>
<input id="crecategory" style="color:{{divColor 'textColor'}}" class="creInput clickModify dropdown" type="text" form="category" placeholder="Click here to edit..." readonly>
<div class="optionHolder">
{{#each selectOptions 'category'}}
{{> option}}
{{/each}}
</div>
</div>
<h3 id="creSubmit" style="border:1px solid {{divColor 'textColor'}}">Submit Request</h3>
</div>
</div>
</div>
<div id="profileSubmit">
<span>Finish!</span>
<i class="fa fa-chevron-right" aria-hidden="true"></i>
</div>
<div id="forwardArrow" class="circleIcon moveArrow" style="display:{{showArrow 'forward'}}">
<i class="fa fa-chevron-down" aria-hidden="true"></i>
</div>
</div>
</template>
<template name="enrollSideClass">
<div id="ESCWrapper" classid="{{_id}}">
<h4 class="enrollSideClass">{{name}}</h4>
{{#if x}}
<i class="fa fa-times" aria-hidden="true"></i>
{{/if}}
</div>
</template>

View File

@ -0,0 +1,518 @@
/* jshint esversion: 6 */
import {
Template
} from 'meteor/templating';
Session.set("sections", [0,0]); // [Completed, Viewing]
Session.set("profile", {classes: []});
Session.set("newClasses", []);
Session.set("autocompleteDivs", null);
Session.set("notsearching", true); // If user isn't searching
Session.set("noclass", null); // If user doesn't have classes.
Session.set("notfound", null); // If no results for autocomplete.
Template.profile.helpers({
showArrow(type) {
var order = [
{"back":false, "forward":true},
{"back":true, "forward":true},
{"back":true, "forward":false}
];
var section = Session.get("sections");
if(type === "forward") {
return (section[1]+1 <= section[0] && order[section[1]][type]) ? "block":"none";
} else {
return (order[section[1]][type]) ? "block":"none";
}
},
classes() {
var array = classes.find({
status: {
$eq: true
},
privacy: {
$eq: false
},
_id: {
$nin: Session.get("profile").classes
},
school: {
$eq: Session.get("profile").school
}
}, {
sort: {
subscribers: -1
}
}, {
limit: 20
}).fetch();
for (var i = 0; i < array.length; i++) {
array[i].join = true;
array[i].subscribers = array[i].subscribers.length;
array[i].teachershort = (array[i].teacher === undefined) ? "" : array[i].teacher.split(" ").slice(1).reduce(function(a, b) {
return a + " " + b;
});
}
if (array.length === 0) {
Session.set("noclass", true);
} else {
Session.set("noclass", false);
}
return array;
},
classSettings() {
return {
position: "bottom",
limit: 10,
rules: [{
token: '',
collection: classes,
template: Template.classAutoList,
filter: {
privacy: false,
status: true
},
selector: (match) => {
regex = new RegExp(match, 'i');
return {
$or: [{
'name': regex
}, {
'teacher': regex
}, {
'hour': regex
}]
};
}
}]
};
},
schoolComplete() { // Returns autocomplete array for schools.
return {
position: "bottom",
limit: 6,
rules: [{
token: '',
collection: schools,
field: 'name',
matchAll: true,
template: Template.schoolList
}]
};
},
teacherComplete() { // Returns autocomplete array for teachers.
return {
position: "bottom",
limit: 1,
rules: [{
token: '',
collection: teachers,
field: 'name',
template: Template.teacherList
}]
};
},
notsearching() { // Tells whether user is using the searchbox
return Session.get("notsearching");
},
autocompleteClasses() { // Returns current auto-completes for classes
return Session.get("autocompleteDivs");
},
notfound() { // Returns if autocomplete has no results.
return Session.get("notfound");
},
enrollClass() {
var myClasses = Session.get("profile").classes;
var newClasses = Session.get("newClasses");
if((myClasses === undefined || myClasses.length === 0) && newClasses.length === 0) return [{name:"Enroll!",x:false}];
var array = myClasses.map(function(a) {
return {name:classes.findOne({_id:a}).name,x:true,_id:a}
});
array.push.apply(array,newClasses.map(function(a){
return {name:a.name,_id:(Math.floor(Math.random()*1000)).toString(),x:true};
}));
return array;
},
school() {
return Session.get("profile").school;
}
});
Template.profile.events({
'click' (event) { // Closes respective divs when clicking outside of them. Order matters.
var e = event.target.className;
if(modifyingInput !== null && event.target !== document.getElementById(modifyingInput)) {
if (!(e.includes("optionHolder") || e.includes("optionText"))) {
toggleOptionMenu(false, modifyingInput);
modifyingInput = null;
}
}
},
'click #basicNext' () {
var inputs = document.getElementsByClassName("basicInfoField");
var required = ["school", "grade"];
var alert = checkComplete(required, inputs);
var values = alert[2];
if(!alert[0]) {
sAlert.error("Missing " + alert[1], {
effect: 'stackslide',
position: 'top',
timeout: 3000
});
return;
}
var profile = Session.get("profile");
profile.school = values["school"];
profile.grade = values["grade"];
Session.set("profile", profile);
Session.set("sections", [(Session.get("sections")[0] < 1) ? 1 : Session.get("sections")[0], Session.get("sections")[1]]);
slideToField(1);
$("#profileSubmit").fadeIn(200);
},
'click #createActivate' () {
Session.set("sections", [(Session.get("sections")[0] < 2) ? 2 : Session.get("sections")[0], Session.get("sections")[1]]);
slideToField(2);
},
'click #creSubmit' () {
var inputs = document.getElementsByClassName("creInput");
var required = ["school", "name", "privacy", "category"];
var alert = checkComplete(required, inputs);
var values = alert[2];
if(!alert[0]) {
sAlert.error("Missing " + alert[1], {
effect: 'stackslide',
position: 'top',
timeout: 3000
});
return;
}
values.privacy = (values.privacy === "Public") ? false : true;
values.status = false;
values.category = values.category.toLowerCase();
values.code = "";
if(values.teacher !== "" && values.teacher.split(" ").length < 2) {
sAlert.error("Please enter the full name of the teacher! Ex: Darrin Woods", {
effect: 'stackslide',
position: 'bottom-right',
timeout: 3000
});
return;
}
var newClasses = Session.get("newClasses");
var duplicate = false;
for(var i = 0; i < newClasses.length; i++) {
if(JSON.stringify(newClasses[i]) === JSON.stringify(values)) duplicate = true;
if(newClasses[i].school === values.school && newClasses[i].teacher === values.teacher && newClasses[i].hour === values.hour) {
sAlert.error("This teacher is already teaching a class elsewhere!", {
effect: 'stackslide',
position: 'bottom-right',
timeout: 3000
});
return;
}
}
if(!duplicate && newClasses.length < 8) newClasses.push(values);
if(duplicate) {
sAlert.error("You already created this class!", {
effect: 'stackslide',
position: 'bottom-right',
timeout: 3000
});
}
if(newClasses.length === 8) {
sAlert.error("You already created 8 classes!", {
effect: 'stackslide',
position: 'bottom-right',
timeout: 3000
});
return;
}
if(classes.findOne({school: values.school, teacher: values.teacher, status: true, privacy: false, hour: values.hour}) || (values.teacher === "" && values.hour === "")) {
sAlert.error("This teacher is already teaching a class elsewhere!", {
effect: 'stackslide',
position: 'bottom-right',
timeout: 3000
});
return;
}
Session.set("newClasses", newClasses);
$(".creInput").each(function(){$(this).val('');});
$(".creInput")[0].value = Session.get("profile").school;
slideToField(Session.get("sections")[1]-1);
},
'click #backArrow' () {
slideToField(Session.get("sections")[1]-1);
},
'click #forwardArrow' () {
slideToField(Session.get("sections")[1]+1);
},
// HANDLING INPUT CHANGING
'focus .clickModify' (event) {
$(".optionHolder")
.fadeOut(100);
if(modifyingInput !== null) {
if(!$("#"+modifyingInput)[0].className.includes("dropdown")) closeInput(modifyingInput);
}
modifyingInput = event.target.id;
if(!$("#"+modifyingInput)[0].className.includes("dropdown")) {
event.target.select();
event.target.style.cursor = "text";
}
},
'keydown .dropdown' (event) {
var first = $("#"+modifyingInput).next().children("p:first-child");
var last = $("#"+modifyingInput).next().children("p:last-child");
var next = $(".selectedOption").next();
var prev = $(".selectedOption").prev();
var lastSel = $(".selectedOption");
if (event.keyCode === 38) {
event.preventDefault();
if (lastSel === undefined) {
last.addClass("selectedOption");
} else {
if (prev.length === 0) {
last.addClass("selectedOption");
lastSel.removeClass("selectedOption");
} else {
prev.addClass("selectedOption");
lastSel.removeClass("selectedOption");
}
}
} else if (event.keyCode === 40) {
event.preventDefault();
if (lastSel === undefined) {
first.addClass("selectedOption");
last.removeClass("selectedOption");
} else {
if (next.length === 0) {
first.addClass("selectedOption");
lastSel.removeClass("selectedOption");
} else {
next.addClass("selectedOption");
lastSel.removeClass("selectedOption");
}
}
} else if (event.keyCode === 13) {
lastSel[0].click();
$("#"+modifyingInput)[0].focus();
}
},
'click .dropdown, focus .dropdown' (event) {
if(clickDisabled) return;
clickDisabled = true;
if(event.target.id === optionOpen[0] && optionOpen[1]) {
toggleOptionMenu(false, event.target.id);
} else {
toggleOptionMenu(true, event.target.id);
}
setTimeout(function(){clickDisabled = false;},130); // Prevents spamming and handles extra click events.
},
'click .optionText' (event) { // Click each preferences setting.
var option = event.target.childNodes[0].nodeValue;
document.getElementById(modifyingInput).value = option;
toggleOptionMenu(false, modifyingInput);
$(".selectedOption").removeClass("selectedOption");
var newSetting = Session.get("profile");
if(modifyingInput === "school") {
if(option !== Session.get("profile").school) newSetting["classes"] = [];
newSetting.school = option;
} else if(modifyingInput === "grade") {
newSetting = Session.get("profile");
newSetting.grade = option;
}
Session.set("profile", newSetting);
},
'input #classSearch' (event) { // Auto-complete updater
if (event.target.value.length === 0) {
Session.set("notsearching", true);
} else {
Session.set("notsearching", false);
}
Session.set("autocompleteDivs", null);
var divs = [];
try {
var items = document.getElementsByClassName("-autocomplete-container")[0].children;
if(items[0].tagName === "I") {
Session.set("notfound", true);
return;
} else {
items = items[0].children;
for(var i = 0; i < items.length; i++) {
var item = items[i].children;
var id = item[4].textContent;
if(Session.get("profile").classes.indexOf(id) !== -1) continue;
divs.push({
name: item[0].textContent,
teachershort: item[1].textContent.split(" ")[1],
hour: item[2].textContent,
subscribers: (item[3].textContent.match(new RegExp(",","g")) || []).length+1,
_id: id,
join: true
})
}
Session.set("autocompleteDivs", divs.sort(function(a, b) {
return b.subscribers - a.subscribers;
}));
Session.set("notfound", false);
return;
}
} catch(err) {}
},
'click .classBox .fa-plus, click #classBody .classBox' (event) {
var profile = Session.get("profile");
while(event.target.getAttribute("classid") === null) event.target = event.target.parentNode;
var id = event.target.getAttribute("classid");
if(profile.classes.indexOf(id) === -1) {
profile.classes.push(id);
Session.set("profile", profile);
if(Session.get("autocompleteDivs") === null) return;
var divs = Session.get("autocompleteDivs");
divs.splice(divs.map(function(a) {
return a._id;
}).indexOf(id),1);
Session.set("autocompleteDivs", divs);
}
},
'click #ESCWrapper .fa-times' (event) {
var profile = Session.get("profile");
var id = event.target.parentNode.getAttribute("classid");
if(id.length < 17) {
var newClasses = Session.get("newClasses");
newClasses.splice(newClasses.map(function(a) {
return a._id;
}).indexOf(id),1);
Session.set("newClasses", newClasses);
return;
}
if(profile.classes.indexOf(id) !== -1) {
profile.classes.splice(profile.classes.indexOf(id),1);
Session.set("profile", profile);
if(Session.get("autocompleteDivs") === null) return;
var divs = Session.get("autocompleteDivs");
var myClass = classes.findOne({_id: id});
myClass.subscribers = myClass.subscribers.length;
myClass.teachershort = myClass.teacher.split(" ")[1]
myClass.join = true;
divs.push(myClass);
Session.set("autocompleteDivs", divs.sort(function(a, b) {
return b.subscribers - a.subscribers;
}));
}
},
'click #profileSubmit' () {
// clear html and make page uninteractable
var myClasses = Session.get("profile").classes;
var newClasses = Session.get("newClasses");
var message = "Sorry, your profile couldn't be created. Please try again!";
if(myClasses.length === 0 && newClasses.length === 0) {
sAlert.error("Please enroll in a class!", {
effect: 'stackslide',
position: 'top'
});
return;
}
joinClass(0);
_.each(newClasses, function(newClass) {
if(!teachers.findOne({
name: newClass.teacher
})) {
Meteor.call("createTeacher", newClass.teacher, newClass.school, function(error, result) {
if (error !== undefined) {
sAlert.error(message, {
effect: 'stackslide',
position: 'top'
});
}
});
}
});
createClass(0);
var profile = Session.get("profile");
profile.complete = true;
profile.preferences = Meteor.user().profile.preferences;
profile.classes.push(Meteor.userId());
Meteor.call("editProfile", profile, function(err, result) {
if(err !== undefined) {
sAlert.error(message, {
effect: 'stackslide',
position: 'top'
});
}
Meteor.subscribe('classes');
Meteor.subscribe('schools');
Meteor.subscribe('teachers');
Meteor.subscribe('work');
Meteor.subscribe('requests');
Meteor.subscribe("personalUser");
Meteor.subscribe('users');
});
}
});
function slideToField(field) {
var order = ["basicInfo", "enrollInfo", "createInfo"];
$(".moveArrow").animate({"opacity":0})
if(field === 0) $("#enrollClassList").fadeOut(200);
var viewing = Session.get("sections")[1]
var move = (viewing-field < 0) ? "-100%" : "150%";
$("#"+order[viewing]).animate({top: move});
$("#"+order[field]).animate({
top:"17%"
},{
complete: function() {
Session.set("sections", [Session.get("sections")[0],field]);
$(".moveArrow").animate({"opacity":1});
if(field === 1) $("#enrollClassList").fadeIn(200);
}
});
}
var joined = 0;
var created = 0;
function joinClass(num) {
var joining = Session.get("profile").classes;
if(joining.length === 0) return;
Meteor.call("joinClass", [joining[num], ""], function(err, result) {
if(err !== undefined) {
sAlert.error(err.message, {
effect: 'stackslide',
position: 'top'
});
}
joined++;
if(joined !== joining.length) {
joinClass(joined);
}
});
}
function createClass(num) {
var creating = Session.get("newClasses");
if(creating.length === 0) return;
Meteor.call("createClass", creating[num], function(error, result) {
if(error !== undefined) {
sAlert.error(error.message, {
effect: 'stackslide',
position: 'top'
});
}
created++;
if(created !== creating.length) {
createClass(created);
}
});
}

View File

@ -0,0 +1,71 @@
#fourohfour {
color: #FFF;
width: 100%;
height: 100%;
background-color: #222328;
cursor: default;
-webkit-touch-callout: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
#first {
font-size: 20vh;
margin: auto;
text-align: center;
-webkit-filter: drop-shadow(7px 7px 5px #111);
filter: drop-shadow(7px 7px 5px #111);
}
#second {
font-size: 5vh;
font-weight: 200;
margin: auto;
margin-top: 5%;
margin-bottom: 7%;
text-align: center;
-webkit-filter: drop-shadow(7px 7px 5px #111);
filter: drop-shadow(7px 7px 5px #111);
}
#third {
background-color: auto;
border: 1px solid white;
border-radius: 6px;
color: white;
cursor: pointer;
font-size: 2.5vh;
font-weight: 100;
margin: auto;
padding: 1vh 2vh 1vh 2vh;
text-align: center;
width: 12vh;
transition: 0.5s;
}
#third:hover {
background-color: rgba(0, 0, 0, 0.3);
}
#third h4 {
font-weight: 100;
margin-right: 0.5vh;
display: inline;
}
#foot {
color: #888;
font-size: 2vh;
font-weight: 200;
width: 100%;
text-align: center;
position: absolute;
bottom: 0;
}

View File

@ -0,0 +1,13 @@
<template name="NotFound">
<div id="fourohfour">
<h4 id="first">404</h4>
<h4 id="second">Nothin' to see here!</h4>
<div id="third" onclick="window.location.href = 'http://hourglass.ga';">
<h4>Home</h4>
<i class="fa fa-home" aria-hidden="true"></i>
</div>
</div>
<div>
<h4 id="foot">Hackers: If you thought by typing in a sub-directory that you'd be able to hack us, you're sorely mistaken! Just stop.</h4>
</div>
</template>

View File

@ -0,0 +1,8 @@
#loadCont {
color: #FFF;
width: 100%;
height: 100%;
background-color: #222328;
cursor: default;
}

View File

@ -0,0 +1,4 @@
<template name="loading">
<div id="loadCont">
</div>
</template>

Some files were not shown because too many files have changed in this diff Show More