Permalink
Browse files

Compress CSS and JS on make

  • Loading branch information...
1 parent 6fe6b12 commit d18a7154a74d1b633352769c8230d4df6d264d55 @jexhson committed May 18, 2012
Showing with 86 additions and 255 deletions.
  1. +23 −4 Makefile
  2. BIN bin/yuicompressor-2.4.7.jar
  3. +0 −203 css/global.css
  4. +1 −0 css/refresh-all.css
  5. +4 −1 css/style.less
  6. +1 −2 js/jquery.js
  7. +0 −16 js/load.coffee
  8. +0 −13 js/load.js
  9. +5 −0 js/loader
  10. +0 −1 js/modernizr.js
  11. +12 −1 js/pacman.js
  12. +0 −11 js/prefixfree.js
  13. +1 −0 js/refresh-all.js
  14. +39 −3 js/refresh.js
View
27 Makefile
@@ -1,17 +1,36 @@
CSS_DIR=css
-CSS_GLOBAL=$(CSS_DIR)/global.css
+CSS_GLOBAL=$(CSS_DIR)/refresh-all.css
+
JS_DIR=js
+JS_SCRIPTS=`cat $(JS_DIR)/loader`
+JS_GLOBAL=$(JS_DIR)/refresh-all.js
COFFEE_SCRIPTS=$(wildcard $(JS_DIR)/*.coffee)
+BIN_DIR=bin
+
all: style scripts
-style:
+style: agregate-style compress-style
+
+agregate-style:
@cat $(CSS_DIR)/reset.css > $(CSS_GLOBAL)
@lessc $(CSS_DIR)/style.less >> $(CSS_GLOBAL)
@lessc $(CSS_DIR)/edt.less >> $(CSS_GLOBAL)
- @rm -f $(CSS_PROJECT)
-scripts: $(COFFEE_SCRIPTS:$(JS_DIR)/%=%)
+compress-style:
+ @java -jar $(BIN_DIR)/yuicompressor-2.4.7.jar -o $(CSS_GLOBAL) $(CSS_GLOBAL)
+
+scripts: agregate-scripts compress-scripts
+
+agregate-scripts: $(COFFEE_SCRIPTS:$(JS_DIR)/%=%)
+ @echo -n "" > $(JS_GLOBAL)
+ @for JS in $(JS_SCRIPTS); do \
+ cat $(JS_DIR)/$$JS >> $(JS_GLOBAL); \
+ done
+
+compress-scripts:
+ @java -jar $(BIN_DIR)/yuicompressor-2.4.7.jar -o $(JS_GLOBAL) $(JS_GLOBAL)
%.coffee:
@coffee -b -c $(JS_DIR)/$@
+
View
BIN bin/yuicompressor-2.4.7.jar
Binary file not shown.
View
203 css/global.css
@@ -1,203 +0,0 @@
-html, body, div, span, applet, object, iframe,
-h1, h2, h3, h4, h5, h6, p, blockquote, pre,
-a, abbr, acronym, address, big, cite, code,
-del, dfn, em, img, ins, kbd, q, s, samp,
-small, strike, strong, sub, sup, tt, var,
-b, u, i, center,
-dl, dt, dd, ol, ul, li,
-fieldset, form, label, legend,
-table, caption, tbody, tfoot, thead, tr, th, td,
-article, aside, canvas, details, embed,
-figure, figcaption, footer, header, hgroup,
-menu, nav, output, ruby, section, summary,
-time, mark, audio, video {
- margin: 0;
- padding: 0;
- border: 0;
- font-size: 100%;
- font: inherit;
- vertical-align: baseline;
-}
-article, aside, details, figcaption, figure,
-footer, header, hgroup, menu, nav, section {
- display: block;
-}
-body {
- line-height: 1;
-}
-ol, ul {
- list-style: none;
-}
-blockquote, q {
- quotes: none;
-}
-blockquote:before, blockquote:after,
-q:before, q:after {
- content: '';
- content: none;
-}
-
-body{background:url(../img/floor.jpg);font:100%/1.5em 'Dosis',sans-serif;font-weight:200;}
-q:before,q:after{content:'"';}
-header{min-width:22em;max-width:55em;height:150px;margin-right:1.5em;border-bottom:4px solid white;}header h1{float:left;}header h1 a{display:block;width:340px;height:150px;background:url(../img/logo-refresh.png) left bottom no-repeat;padding-top:4px;}header h1 a span{display:none;}
-header p{float:right;font-size:2.6em;margin:2.6em 0.5em 0 0;color:white;text-shadow:#333333 2px 2px 6px;}
-article{min-width:22em;max-width:55em;background:white;border-top:1.3em solid #148f43;border-bottom-right-radius:10px;margin-right:1.5em;box-shadow:0 3px 10px #666666;}
-#lemon{width:40px;height:40px;background:url(../img/lemon.png) top left no-repeat;float:right;position:relative;top:-1.9em;left:1.2em;}
-#accordion{padding:4em;}
-section{clear:both;text-align:justify;border-bottom:2px solid #148f43;padding-bottom:1em;margin-bottom:1em;}section h2{font:3.5em 'Oleo Script',cursive;text-shadow:#cccccc -1px 1px 6px;text-align:left;}section h2 a{color:#222222;text-decoration:none;transition-property:color;transition-duration:.2s;transition-timing-function:linear,ease-out;}section h2 a:hover{color:#148f43;}
-section>div{display:none;}section>div h3{color:#148f43;font-size:1.5em;font-weight:bold;margin-top:0.8em;}
-section>div p{margin:0.8em 0;}
-section>div .no-bottom-margin{margin-bottom:0;}
-section>div .date{color:#333333;font-size:0.8em;margin:0;}
-section ul{margin:0.8em 1.5em;}
-section li{list-style:circle;}
-section strong{font-weight:bold;letter-spacing:0.1em;}
-section .email{cursor:pointer;color:#148f43;border-bottom:1px dotted #cccccc;}
-section .spam{display:none;}
-section .people{margin-top:1em;width:160px;height:210px;float:left;text-align:center;font-weight:bold;line-height:1em;}section .people img{margin:0 10px 0.5em 10px;padding:30px;background:url(../img/frame.png) center no-repeat;}
-section .people span{font-weight:normal;font-size:0.9em;color:#333333;}
-section .loading{background:url(../img/loading.gif) left center no-repeat;display:block;padding:1em 0 1em 3em;}
-section .float-left{float:left;}
-#stuff table{border-collapse:collapse;border-spacing:0;width:100%;margin:1em 0.5em;line-height:1.2em;}
-#stuff td{border-bottom:1px solid #cccccc;font-weight:600;padding:0.2em 0;vertical-align:middle;}#stuff td span{font-weight:200;display:block;color:#333333;}
-.clear{clear:both;font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0;}
-.tabbed{margin:1em 0;}.tabbed li{display:inline;}
-.tabbed a{display:block;float:left;background:#148f43;color:white;border-radius:5px;text-decoration:none;padding:0.2em 0.4em;margin:0.2em;font-size:0.9em;text-shadow:#222222 -1px 1px 1px;}.tabbed a.selected,.tabbed a:hover{background:#777777;}
-.tabContent{clear:both;}.tabContent>div{clear:both;display:none;}
-#schedule{clear:both;}
-#sched-nav-next,#sched-nav-prev{color:#333333;text-decoration:none;border-bottom:1px dotted #222222;display:none;}#sched-nav-next:hover,#sched-nav-prev:hover{color:#148f43;}
-#sched-nav-next{float:right;}
-#goodies .item{border-radius:6px;background-color:#E6E6E6;background-image:linear-gradient(top, #ffffff, #e6e6e6);border:1px solid #ccc;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);}#goodies .item h3,#goodies .item p{margin:0;color:#777777;}
-#goodies .item a{font:1.2em;color:#222222;text-decoration:none;}
-#videos >div,#pacman >div{background:url(../img/goodies-pacman.png) left center no-repeat;padding-left:50px;margin:1em 1.7em;}
-#videos >div{background-image:url(../img/goodies-videos.png);}
-#goodies-content{margin-top:1em;}#goodies-content dt a{margin-left:0.5em;padding:0.2em 1.5em;background:url(../img/lemon-small.png) no-repeat center left;color:#101e11;font:1.5em;text-decoration:none;font-weight:bold;}
-#goodies-content dd{display:none;}
-#partners ul{margin:0;}
-#partners li{display:inline;margin:0.1em;}
-footer{min-width:22em;max-width:55em;margin:1em 0;margin-right:1.5em;}footer ul{padding-left:1em;}footer ul li a{color:#222222;text-decoration:none;font-weight:600;}footer ul li a:hover{border-bottom:1px dotted #333333;}
-#social li{text-align:right;}#social li a{margin-right:0.5em;float:right;width:52px;height:52px;transition-property:background-position;transition-duration:.2s;transition-timing-function:linear,ease-out;}#social li a span{display:none;}
-#social li a:hover{border:none;}
-#facebook,#gplus{background:url(../img/social-icons.png) top left no-repeat;}#facebook:hover,#gplus:hover{background:url(../img/social-icons.png) bottom left no-repeat;}
-#gplus{background-position:top right;}#gplus:hover{background-position:bottom right;}
-#design-by{font:1.4em 'Andada',Georgia,Sans-Serif,Verdana;text-decoration:none;color:#222222;border:none;}#design-by:hover{color:#101e11;}
-.row-fluid{width:100%;*zoom:1;}.row-fluid:before,.row-fluid:after{display:table;content:"";}
-.row-fluid:after{clear:both;}
-.row-fluid [class*="span"]{display:block;width:100%;min-height:28px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;float:left;margin-left:2.127659574%;*margin-left:2.0744680846382977%;}
-.row-fluid [class*="span"]:first-child{margin-left:0;}
-.row-fluid .span12{width:99.99999998999999%;*width:99.94680850063828%;}
-.row-fluid .span11{width:91.489361693%;*width:91.4361702036383%;}
-.row-fluid .span10{width:82.97872339599999%;*width:82.92553190663828%;}
-.row-fluid .span9{width:74.468085099%;*width:74.4148936096383%;}
-.row-fluid .span8{width:65.95744680199999%;*width:65.90425531263828%;}
-.row-fluid .span7{width:57.446808505%;*width:57.3936170156383%;}
-.row-fluid .span6{width:48.93617020799999%;*width:48.88297871863829%;}
-.row-fluid .span5{width:40.425531911%;*width:40.3723404216383%;}
-.row-fluid .span4{width:31.914893614%;*width:31.8617021246383%;}
-.row-fluid .span3{width:23.404255317%;*width:23.3510638276383%;}
-.row-fluid .span2{width:14.89361702%;*width:14.8404255306383%;}
-.row-fluid .span1{width:6.382978723%;*width:6.329787233638298%;}
-@media (max-width:46em){header{height:90px;margin-right:0;border-bottom:3px solid white;}header h1 a{width:215px;height:90px;background:url(../img/logo-mobile-refresh.png) left bottom no-repeat;} header p{position:absolute;top:91px;right:10px;margin:0;padding:0;font-size:1.3em;} article{margin-right:0;} #accordion{padding:2em;} #lemon{display:none;} article{border-bottom-right-radius:0;} footer{margin-right:0;} #social li a{width:34px;height:34px;} #facebook,#facebook:hover,#gplus,#gplus:hover{background-image:url(../img/social-icons-mobile.png);}}@font-face{font-family:'PacmanFont';src:url('../pacman/Pacman_Font.ttf') format('truetype');font-weight:normal;font-style:normal;}
-#edt table *{border:none;}
-#edt table{border-collapse:collapse;empty-cells:show;}
-#edt table td{min-width:20px;}
-#edt .a{font-weight:bold;}
-#edt .b{font-family:"Times New Roman";}
-#edt .x{font-family:"MS Sans Serif";}
-#edt .c{font-size:xx-large;}
-#edt .n{font-size:x-large;}
-#edt .u{font-size:large;}
-#edt .y{font-size:medium;}
-#edt .ad{font-size:small;}
-#edt .d{width:82px;}
-#edt .i{width:39px;}
-#edt .k{width:50px;}
-#edt .l{width:58px;}
-#edt .e{height:52px;}
-#edt .m{height:49px;}
-#edt .p{height:21px;}
-#edt .t{height:38px;}
-#edt .z{height:32px;}
-#edt .ac{height:27px;}
-#edt .f{text-align:CENTER;}
-#edt .j{text-align:LEFT;}
-#edt .ag{text-align:RIGHT;}
-#edt .g{vertical-align:MIDDLE;}
-#edt .h{background-color:#FFFFFF;}
-#edt .ai{background-color:#CCFFFF;}
-#edt .aj{background-color:#FF99CC;}
-#edt .al{background-color:#EFEFEF;}
-#edt .am{background-color:#CC99FF;}
-#edt .an{background-color:#BFBFBF;}
-#edt .ao{background-color:#FFFFCC;}
-#edt .ap{background-color:#BFD8F2;}
-#edt .o{border-bottom:3px solid #000000;}
-#edt .ae{border-bottom:5px solid #000000;}
-#edt .af{border-bottom:1px solid #000000;}
-#edt .q{border-top:3px solid #000000;}
-#edt .ah{border-top:5px solid #000000;}
-#edt .ak{border-top:1px solid #000000;}
-#edt .r{border-left:5px solid #000000;}
-#edt .v{border-left:3px solid #000000;}
-#edt .ab{border-left:1px solid #000000;}
-#edt .s{border-right:5px solid #000000;}
-#edt .w{border-right:3px solid #000000;}
-#edt .aa{border-right:1px solid #000000;}
-#edt .aq{color:#FF0000;}
-#edt table *{border:none;}
-#edt table{border-collapse:collapse;empty-cells:show;}
-#edt table td{min-width:20px;}
-#edt .a{font-weight:bold;}
-#edt .b{font-family:"Times New Roman";}
-#edt .x{font-family:"MS Sans Serif";}
-#edt .c{font-size:xx-large;}
-#edt .n{font-size:x-large;}
-#edt .u{font-size:large;}
-#edt .y{font-size:medium;}
-#edt .ad{font-size:small;}
-#edt .d{width:82px;}
-#edt .i{width:39px;}
-#edt .k{width:50px;}
-#edt .l{width:58px;}
-#edt .as{width:52px;}
-#edt .at{width:1219px;}
-#edt .av{width:43px;}
-#edt .ax{width:1297px;}
-#edt .ba{width:1287px;}
-#edt .e{height:52px;}
-#edt .m{height:49px;}
-#edt .p{height:21px;}
-#edt .t{height:38px;}
-#edt .z{height:32px;}
-#edt .ac{height:27px;}
-#edt .f{text-align:CENTER;}
-#edt .j{text-align:LEFT;}
-#edt .af{text-align:RIGHT;}
-#edt .g{vertical-align:MIDDLE;}
-#edt .h{background-color:#FFFFFF;}
-#edt .ah{background-color:#FFFFCC;}
-#edt .ai{background-color:#CC99FF;}
-#edt .al{background-color:#EFEFEF;}
-#edt .am{background-color:#BFBFBF;}
-#edt .an{background-color:#CCFFCC;}
-#edt .ap{background-color:#FF99CC;}
-#edt .aq{background-color:#CCFFFF;}
-#edt .ar{background-color:#BFD8F2;}
-#edt .au{background-color:#FFFF00;}
-#edt .aw{background-color:#BFDFBF;}
-#edt .ay{background-color:#FFCC99;}
-#edt .az{background-color:#00CCFF;}
-#edt .bb{background-color:#FF0000;}
-#edt .o{border-bottom:3px solid #000000;}
-#edt .ae{border-bottom:1px solid #000000;}
-#edt .aj{border-bottom:5px solid #000000;}
-#edt .q{border-top:3px solid #000000;}
-#edt .ag{border-top:5px solid #000000;}
-#edt .ak{border-top:1px solid #000000;}
-#edt .r{border-left:5px solid #000000;}
-#edt .v{border-left:3px solid #000000;}
-#edt .ab{border-left:1px solid #000000;}
-#edt .s{border-right:5px solid #000000;}
-#edt .w{border-right:3px solid #000000;}
-#edt .aa{border-right:1px solid #000000;}
-#edt .ao{color:#FF0000;}
View
1 css/refresh-all.css
@@ -0,0 +1 @@
+html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:'';content:none}body{background:url(../img/floor.jpg);font:100%/1.5em 'Dosis',sans-serif;font-weight:200}q:before,q:after{content:'"'}header{min-width:22em;max-width:55em;height:150px;margin-right:1.5em;border-bottom:4px solid white}header h1{float:left}header h1 a{display:block;width:340px;height:150px;background:url(../img/logo-refresh.png) left bottom no-repeat;padding-top:4px}header h1 a span{display:none}header p{float:right;font-size:2.6em;margin:2.6em .5em 0 0;color:white;text-shadow:#333 2px 2px 6px}article{min-width:22em;max-width:55em;background:white;border-top:1.3em solid #148f43;border-bottom-right-radius:10px;margin-right:1.5em;box-shadow:0 3px 10px #666}#lemon{width:40px;height:40px;background:url(../img/lemon.png) top left no-repeat;float:right;position:relative;top:-1.9em;left:1.2em}#accordion{padding:4em}section{clear:both;text-align:justify;border-bottom:2px solid #148f43;padding-bottom:1em;margin-bottom:1em}section h2{font:3.5em 'Oleo Script',cursive;text-shadow:#ccc -1px 1px 6px;text-align:left}section h2 a{color:#222;text-decoration:none;transition-property:color;transition-duration:.2s;transition-timing-function:linear,ease-out}section h2 a:hover{color:#148f43}section>div{display:none}section>div h3{color:#148f43;font-size:1.5em;font-weight:bold;margin-top:.8em}section>div p{margin:.8em 0}section>div .no-bottom-margin{margin-bottom:0}section>div .date{color:#333;font-size:.8em;margin:0}section ul{margin:.8em 1.5em}section li{list-style:circle}section strong{font-weight:bold;letter-spacing:.1em}section .email{cursor:pointer;color:#148f43;border-bottom:1px dotted #ccc}section .spam{display:none}section .people{margin-top:1em;width:160px;height:210px;float:left;text-align:center;font-weight:bold;line-height:1em}section .people img{margin:0 10px .5em 10px;padding:30px;background:url(../img/frame.png) center no-repeat}section .people span{font-weight:normal;font-size:.9em;color:#333}section .loading{background:url(../img/loading.gif) left center no-repeat;display:block;padding:1em 0 1em 3em}section .float-left{float:left}#stuff table{border-collapse:collapse;border-spacing:0;width:100%;margin:1em .5em;line-height:1.2em}#stuff td{border-bottom:1px solid #ccc;font-weight:600;padding:.2em 0;vertical-align:middle}#stuff td span{font-weight:200;display:block;color:#333}.clear{clear:both;font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.tabbed{margin:1em 0}.tabbed li{display:inline}.tabbed a{display:block;float:left;background:#148f43;color:white;border-radius:5px;text-decoration:none;padding:.2em .4em;margin:.2em;font-size:.9em;text-shadow:#222 -1px 1px 1px}.tabbed a.selected,.tabbed a:hover{background:#777}.tabContent{clear:both}.tabContent>div{clear:both;display:none}.tabContent>div:first-child{display:block}#schedule{clear:both}#sched-nav-next,#sched-nav-prev{color:#333;text-decoration:none;border-bottom:1px dotted #222;display:none}#sched-nav-next:hover,#sched-nav-prev:hover{color:#148f43}#sched-nav-next{float:right}#goodies .item{border-radius:6px;background-color:#e6e6e6;background-image:linear-gradient(top,#fff,#e6e6e6);border:1px solid #ccc;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25)}#goodies .item h3,#goodies .item p{margin:0;color:#777}#goodies .item a{font:1.2em;color:#222;text-decoration:none}#videos>div,#pacman>div{background:url(../img/goodies-pacman.png) left center no-repeat;padding-left:50px;margin:1em 1.7em}#videos>div{background-image:url(../img/goodies-videos.png)}#goodies-content{margin-top:1em}#goodies-content dt a{margin-left:.5em;padding:.2em 1.5em;background:url(../img/lemon-small.png) no-repeat center left;color:#101e11;font:1.5em;text-decoration:none;font-weight:bold}#goodies-content dd{display:none}#partners ul{margin:0}#partners li{display:inline;margin:.1em}footer{min-width:22em;max-width:55em;margin:1em 0;margin-right:1.5em}footer ul{padding-left:1em}footer ul li a{color:#222;text-decoration:none;font-weight:600}footer ul li a:hover{border-bottom:1px dotted #333}#social li{text-align:right}#social li a{margin-right:.5em;float:right;width:52px;height:52px;transition-property:background-position;transition-duration:.2s;transition-timing-function:linear,ease-out}#social li a span{display:none}#social li a:hover{border:0}#facebook,#gplus{background:url(../img/social-icons.png) top left no-repeat}#facebook:hover,#gplus:hover{background:url(../img/social-icons.png) bottom left no-repeat}#gplus{background-position:top right}#gplus:hover{background-position:bottom right}#design-by{font:1.4em 'Andada',Georgia,Sans-Serif,Verdana;text-decoration:none;color:#222;border:0}#design-by:hover{color:#101e11}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;width:100%;min-height:28px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;float:left;margin-left:2.127659574%;*margin-left:2.0744680846382977%}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .span12{width:99.99999998999999%;*width:99.94680850063828%}.row-fluid .span11{width:91.489361693%;*width:91.4361702036383%}.row-fluid .span10{width:82.97872339599999%;*width:82.92553190663828%}.row-fluid .span9{width:74.468085099%;*width:74.4148936096383%}.row-fluid .span8{width:65.95744680199999%;*width:65.90425531263828%}.row-fluid .span7{width:57.446808505%;*width:57.3936170156383%}.row-fluid .span6{width:48.93617020799999%;*width:48.88297871863829%}.row-fluid .span5{width:40.425531911%;*width:40.3723404216383%}.row-fluid .span4{width:31.914893614%;*width:31.8617021246383%}.row-fluid .span3{width:23.404255317%;*width:23.3510638276383%}.row-fluid .span2{width:14.89361702%;*width:14.8404255306383%}.row-fluid .span1{width:6.382978723%;*width:6.329787233638298%}@media(max-width:46em){header{height:90px;margin-right:0}header h1 a{width:215px;height:90px;background:url(../img/logo-mobile-refresh.png) left bottom no-repeat}header p{position:absolute;top:91px;right:10px;margin:0;padding:0;font-size:1.3em}article{margin-right:0}#accordion{padding:2em}#lemon{display:none}article{border-bottom-right-radius:0}footer{margin-right:0}#social li a{width:34px;height:34px}#facebook,#facebook:hover,#gplus,#gplus:hover{background-image:url(../img/social-icons-mobile.png)}}@font-face{font-family:'PacmanFont';src:url('../pacman/Pacman_Font.ttf') format('truetype');font-weight:normal;font-style:normal}#edt table *{border:0}#edt table{border-collapse:collapse;empty-cells:show}#edt table td{min-width:20px}#edt .a{font-weight:bold}#edt .b{font-family:"Times New Roman"}#edt .x{font-family:"MS Sans Serif"}#edt .c{font-size:xx-large}#edt .n{font-size:x-large}#edt .u{font-size:large}#edt .y{font-size:medium}#edt .ad{font-size:small}#edt .d{width:82px}#edt .i{width:39px}#edt .k{width:50px}#edt .l{width:58px}#edt .e{height:52px}#edt .m{height:49px}#edt .p{height:21px}#edt .t{height:38px}#edt .z{height:32px}#edt .ac{height:27px}#edt .f{text-align:CENTER}#edt .j{text-align:LEFT}#edt .ag{text-align:RIGHT}#edt .g{vertical-align:MIDDLE}#edt .h{background-color:#fff}#edt .ai{background-color:#cff}#edt .aj{background-color:#f9c}#edt .al{background-color:#efefef}#edt .am{background-color:#c9f}#edt .an{background-color:#bfbfbf}#edt .ao{background-color:#ffc}#edt .ap{background-color:#bfd8f2}#edt .o{border-bottom:3px solid #000}#edt .ae{border-bottom:5px solid #000}#edt .af{border-bottom:1px solid #000}#edt .q{border-top:3px solid #000}#edt .ah{border-top:5px solid #000}#edt .ak{border-top:1px solid #000}#edt .r{border-left:5px solid #000}#edt .v{border-left:3px solid #000}#edt .ab{border-left:1px solid #000}#edt .s{border-right:5px solid #000}#edt .w{border-right:3px solid #000}#edt .aa{border-right:1px solid #000}#edt .aq{color:#f00}#edt table *{border:0}#edt table{border-collapse:collapse;empty-cells:show}#edt table td{min-width:20px}#edt .a{font-weight:bold}#edt .b{font-family:"Times New Roman"}#edt .x{font-family:"MS Sans Serif"}#edt .c{font-size:xx-large}#edt .n{font-size:x-large}#edt .u{font-size:large}#edt .y{font-size:medium}#edt .ad{font-size:small}#edt .d{width:82px}#edt .i{width:39px}#edt .k{width:50px}#edt .l{width:58px}#edt .as{width:52px}#edt .at{width:1219px}#edt .av{width:43px}#edt .ax{width:1297px}#edt .ba{width:1287px}#edt .e{height:52px}#edt .m{height:49px}#edt .p{height:21px}#edt .t{height:38px}#edt .z{height:32px}#edt .ac{height:27px}#edt .f{text-align:CENTER}#edt .j{text-align:LEFT}#edt .af{text-align:RIGHT}#edt .g{vertical-align:MIDDLE}#edt .h{background-color:#fff}#edt .ah{background-color:#ffc}#edt .ai{background-color:#c9f}#edt .al{background-color:#efefef}#edt .am{background-color:#bfbfbf}#edt .an{background-color:#cfc}#edt .ap{background-color:#f9c}#edt .aq{background-color:#cff}#edt .ar{background-color:#bfd8f2}#edt .au{background-color:#ff0}#edt .aw{background-color:#bfdfbf}#edt .ay{background-color:#fc9}#edt .az{background-color:#0cf}#edt .bb{background-color:#f00}#edt .o{border-bottom:3px solid #000}#edt .ae{border-bottom:1px solid #000}#edt .aj{border-bottom:5px solid #000}#edt .q{border-top:3px solid #000}#edt .ag{border-top:5px solid #000}#edt .ak{border-top:1px solid #000}#edt .r{border-left:5px solid #000}#edt .v{border-left:3px solid #000}#edt .ab{border-left:1px solid #000}#edt .s{border-right:5px solid #000}#edt .w{border-right:3px solid #000}#edt .aa{border-right:1px solid #000}#edt .ao{color:#f00}
View
5 css/style.less
@@ -252,6 +252,10 @@ section {
&>div {
clear: both;
display: none;
+
+ &:first-child {
+ display: block;
+ }
}
}
@@ -502,7 +506,6 @@ footer {
header {
height: 90px;
margin-right: 0;
- border-bottom: 3px solid white;
h1 {
a {
View
3 js/jquery.js
1 addition, 2 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
16 js/load.coffee
@@ -1,16 +0,0 @@
-JS_DIR = 'js/'
-
-Modernizr.load([{
- load: [ JS_DIR + 'jquery.js',
- JS_DIR + 'jquery.xdomainajax.js',
- JS_DIR + 'jquery.timeago.js',
- JS_DIR + 'jquery.detectmobile.js',
- JS_DIR + 'prefixfree.js',
- JS_DIR + 'pacman.js',
- JS_DIR + 'refresh.js' ]
- complete: ->
- $(document).ready Refresh.init()
- true
-}])
-
-
View
13 js/load.js
@@ -1,13 +0,0 @@
-var JS_DIR;
-
-JS_DIR = 'js/';
-
-Modernizr.load([
- {
- load: [JS_DIR + 'jquery.js', JS_DIR + 'jquery.xdomainajax.js', JS_DIR + 'jquery.timeago.js', JS_DIR + 'jquery.detectmobile.js', JS_DIR + 'prefixfree.js', JS_DIR + 'pacman.js', JS_DIR + 'refresh.js'],
- complete: function() {
- $(document).ready(Refresh.init());
- return true;
- }
- }
-]);
View
5 js/loader
@@ -0,0 +1,5 @@
+jquery.xdomainajax.js
+jquery.timeago.js
+jquery.detectmobile.js
+pacman.js
+refresh.js
View
1 js/modernizr.js
@@ -1 +0,0 @@
-;window.Modernizr=function(a,b,c){function x(a){i.cssText=a}function y(a,b){return x(prefixes.join(a+";")+(b||""))}function z(a,b){return typeof a===b}function A(a,b){return!!~(""+a).indexOf(b)}function B(a,b){for(var d in a)if(i[a[d]]!==c)return b=="pfx"?a[d]:!0;return!1}function C(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:z(f,"function")?f.bind(d||b):f}return!1}function D(a,b,c){var d=a.charAt(0).toUpperCase()+a.substr(1),e=(a+" "+m.join(d+" ")+d).split(" ");return z(b,"string")||z(b,"undefined")?B(e,b):(e=(a+" "+n.join(d+" ")+d).split(" "),C(e,b,c))}var d="2.5.3",e={},f=b.documentElement,g="modernizr",h=b.createElement(g),i=h.style,j,k={}.toString,l="Webkit Moz O ms",m=l.split(" "),n=l.toLowerCase().split(" "),o={},p={},q={},r=[],s=r.slice,t,u=function(a,c,d,e){var h,i,j,k=b.createElement("div"),l=b.body,m=l?l:b.createElement("body");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:g+(d+1),k.appendChild(j);return h=["&#173;","<style>",a,"</style>"].join(""),k.id=g,(l?k:m).innerHTML+=h,m.appendChild(k),l||(m.style.background="",f.appendChild(m)),i=c(k,a),l?k.parentNode.removeChild(k):m.parentNode.removeChild(m),!!i},v={}.hasOwnProperty,w;!z(v,"undefined")&&!z(v.call,"undefined")?w=function(a,b){return v.call(a,b)}:w=function(a,b){return b in a&&z(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=s.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(s.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(s.call(arguments)))};return e});var E=function(a,c){var d=a.join(""),f=c.length;u(d,function(a,c){var d=b.styleSheets[b.styleSheets.length-1],g=d?d.cssRules&&d.cssRules[0]?d.cssRules[0].cssText:d.cssText||"":"",h=a.childNodes,i={};while(f--)i[h[f].id]=h[f];e.fontface=/src/i.test(g)&&g.indexOf(c.split(" ")[0])===0},f,c)}(['@font-face {font-family:"font";src:url("https://")}'],["fontface"]);o.canvas=function(){var a=b.createElement("canvas");return!!a.getContext&&!!a.getContext("2d")},o.canvastext=function(){return!!e.canvas&&!!z(b.createElement("canvas").getContext("2d").fillText,"function")},o.borderradius=function(){return D("borderRadius")},o.textshadow=function(){return b.createElement("div").style.textShadow===""},o.fontface=function(){return e.fontface},o.audio=function(){var a=b.createElement("audio"),c=!1;try{if(c=!!a.canPlayType)c=new Boolean(c),c.ogg=a.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),c.mp3=a.canPlayType("audio/mpeg;").replace(/^no$/,""),c.wav=a.canPlayType('audio/wav; codecs="1"').replace(/^no$/,""),c.m4a=(a.canPlayType("audio/x-m4a;")||a.canPlayType("audio/aac;")).replace(/^no$/,"")}catch(d){}return c};for(var F in o)w(o,F)&&(t=F.toLowerCase(),e[t]=o[F](),r.push((e[t]?"":"no-")+t));return x(""),h=j=null,e._version=d,e._domPrefixes=n,e._cssomPrefixes=m,e.testProp=function(a){return B([a])},e.testAllProps=D,e.testStyles=u,e}(this,this.document),function(a,b,c){function d(a){return o.call(a)=="[object Function]"}function e(a){return typeof a=="string"}function f(){}function g(a){return!a||a=="loaded"||a=="complete"||a=="uninitialized"}function h(){var a=p.shift();q=1,a?a.t?m(function(){(a.t=="c"?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){a!="img"&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l={},o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};y[c]===1&&(r=1,y[c]=[],l=b.createElement(a)),a=="object"?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),a!="img"&&(r||y[c]===2?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i(b=="c"?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),p.length==1&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&o.call(a.opera)=="[object Opera]",l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return o.call(a)=="[object Array]"},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f<d;f++)g=a[f].split("="),(e=z[g.shift()])&&(c=e(c,g));for(f=0;f<b;f++)c=x[f](c);return c}function g(a,e,f,g,i){var j=b(a),l=j.autoCallback;j.url.split(".").pop().split("?").shift(),j.bypass||(e&&(e=d(e)?e:e[a]||e[g]||e[a.split("/").pop().split("?")[0]]||h),j.instead?j.instead(a,e,f,g,i):(y[j.url]?j.noexec=!0:y[j.url]=1,f.load(j.url,j.forceCSS||!j.forceJS&&"css"==j.url.split(".").pop().split("?").shift()?"c":c,j.noexec,j.attrs,j.timeout),(d(e)||d(l))&&f.load(function(){k(),e&&e(j.origUrl,i,g),l&&l(j.origUrl,i,g),y[j.url]=2})))}function i(a,b){function c(a,c){if(a){if(e(a))c||(j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}),g(a,j,b,0,h);else if(Object(a)===a)for(n in m=function(){var b=0,c;for(c in a)a.hasOwnProperty(c)&&b++;return b}(),a)a.hasOwnProperty(n)&&(!c&&!--m&&(d(j)?j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}:j[n]=function(a){return function(){var b=[].slice.call(arguments);a&&a.apply(this,b),l()}}(k[n])),g(a[n],j,b,n,h))}else!c&&l()}var h=!!a.test,i=a.load||a.both,j=a.callback||f,k=j,l=a.complete||f,m,n;c(h?a.yep:a.nope,!!i),i&&c(i)}var j,l,m=this.yepnope.loader;if(e(a))g(a,0,m,0);else if(w(a))for(j=0;j<a.length;j++)l=a[j],e(l)?g(l,0,m,0):w(l)?B(l):Object(l)===l&&i(l,m);else Object(a)===a&&i(a,m)},B.addPrefix=function(a,b){z[a]=b},B.addFilter=function(a){x.push(a)},B.errorTimeout=1e4,b.readyState==null&&b.addEventListener&&(b.readyState="loading",b.addEventListener("DOMContentLoaded",A=function(){b.removeEventListener("DOMContentLoaded",A,0),b.readyState="complete"},0)),a.yepnope=k(),a.yepnope.executeStack=h,a.yepnope.injectJs=function(a,c,d,e,i,j){var k=b.createElement("script"),l,o,e=e||B.errorTimeout;k.src=a;for(o in d)k.setAttribute(o,d[o]);c=j?h:c||f,k.onreadystatechange=k.onload=function(){!l&&g(k.readyState)&&(l=1,c(),k.onload=k.onreadystatechange=null)},m(function(){l||(l=1,c(1))},e),i?k.onload():n.parentNode.insertBefore(k,n)},a.yepnope.injectCss=function(a,c,d,e,g,i){var e=b.createElement("link"),j,c=i?h:c||f;e.href=a,e.rel="stylesheet",e.type="text/css";for(j in d)e.setAttribute(j,d[j]);g||(n.parentNode.insertBefore(e,n),m(c,0))}}(this,document),Modernizr.load=function(){yepnope.apply(window,[].slice.call(arguments,0))};
View
13 js/pacman.js
@@ -1071,7 +1071,18 @@ var PACMAN = (function () {
map.draw(ctx);
dialog("Loading ...");
- var extension = Modernizr.audio.ogg ? 'ogg' : 'mp3';
+ var elem = document.createElement('audio'),
+ findExt = false;
+
+ try {
+ if ( bool = !!elem.canPlayType ) {
+ findExt = new Boolean(bool);
+ findExt.ogg = elem.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,'');
+ findExt.mp3 = elem.canPlayType('audio/mpeg;') .replace(/^no$/,'');
+ }
+ } catch(e) { }
+
+ var extension = findExt.ogg ? 'ogg' : 'mp3';
var audio_files = [
["start", root + "audio/opening_song." + extension],
View
11 js/prefixfree.js
@@ -1,11 +0,0 @@
-// StyleFix 1.0.2 & PrefixFree 1.0.4 / by Lea Verou / MIT license
-(function(){function h(a,b){return[].slice.call((b||document).querySelectorAll(a))}if(window.addEventListener){var b=window.StyleFix={link:function(a){try{if("stylesheet"!==a.rel||a.hasAttribute("data-noprefix"))return}catch(c){return}var d=a.href||a.getAttribute("data-href"),f=d.replace(/[^\/]+$/,""),g=a.parentNode,e=new XMLHttpRequest;e.open("GET",d);e.onreadystatechange=function(){if(4===e.readyState){var c=e.responseText;if(c&&a.parentNode){c=b.fix(c,!0,a);f&&(c=c.replace(/url\(((?:"|')?)(.+?)\1\)/gi,
-function(a,c,b){return!/^([a-z]{3,10}:|\/|#)/i.test(b)?'url("'+f+b+'")':a}),c=c.replace(RegExp("\\b(behavior:\\s*?url\\('?\"?)"+f,"gi"),"$1"));var d=document.createElement("style");d.textContent=c;d.media=a.media;d.disabled=a.disabled;d.setAttribute("data-href",a.getAttribute("href"));g.insertBefore(d,a);g.removeChild(a)}}};e.send(null);a.setAttribute("data-inprogress","")},styleElement:function(a){var c=a.disabled;a.textContent=b.fix(a.textContent,!0,a);a.disabled=c},styleAttribute:function(a){var c=
-a.getAttribute("style"),c=b.fix(c,!1,a);a.setAttribute("style",c)},process:function(){h('link[rel="stylesheet"]:not([data-inprogress])').forEach(StyleFix.link);h("style").forEach(StyleFix.styleElement);h("[style]").forEach(StyleFix.styleAttribute)},register:function(a,c){(b.fixers=b.fixers||[]).splice(void 0===c?b.fixers.length:c,0,a)},fix:function(a,c){for(var d=0;d<b.fixers.length;d++)a=b.fixers[d](a,c)||a;return a},camelCase:function(a){return a.replace(/-([a-z])/g,function(a,b){return b.toUpperCase()}).replace("-",
-"")},deCamelCase:function(a){return a.replace(/[A-Z]/g,function(a){return"-"+a.toLowerCase()})}};(function(){setTimeout(function(){h('link[rel="stylesheet"]').forEach(StyleFix.link)},10);document.addEventListener("DOMContentLoaded",StyleFix.process,!1)})()}})();
-(function(h){if(window.StyleFix&&window.getComputedStyle){var b=window.PrefixFree={prefixCSS:function(a,c){function d(c,d,f,g){c=b[c];c.length&&(c=RegExp(d+"("+c.join("|")+")"+f,"gi"),a=a.replace(c,g))}var f=b.prefix;d("functions","(\\s|:|,)","\\s*\\(","$1"+f+"$2(");d("keywords","(\\s|:)","(\\s|;|\\}|$)","$1"+f+"$2$3");d("properties","(^|\\{|\\s|;)","\\s*:","$1"+f+"$2:");if(b.properties.length){var g=RegExp("\\b("+b.properties.join("|")+")(?!:)","gi");d("valueProperties","\\b",":(.+?);",function(a){return a.replace(g,
-f+"$1")})}c&&(d("selectors","","\\b",b.prefixSelector),d("atrules","@","\\b","@"+f+"$1"));return a=a.replace(RegExp("-"+f,"g"),"-")},prefixSelector:function(a){return a.replace(/^:{1,2}/,function(a){return a+b.prefix})},prefixProperty:function(a,c){var d=b.prefix+a;return c?StyleFix.camelCase(d):d}};(function(){var a={},c=[],d=getComputedStyle(document.documentElement,null),f=document.createElement("div").style,g=function(b){if("-"===b.charAt(0)){c.push(b);var b=b.split("-"),d=b[1];for(a[d]=++a[d]||
-1;3<b.length;)b.pop(),d=b.join("-"),StyleFix.camelCase(d)in f&&-1===c.indexOf(d)&&c.push(d)}};if(0<d.length)for(var e=0;e<d.length;e++)g(d[e]);else for(var i in d)g(StyleFix.deCamelCase(i));var e=0,j,h;for(h in a)d=a[h],e<d&&(j=h,e=d);b.prefix="-"+j+"-";b.Prefix=StyleFix.camelCase(b.prefix);b.properties=[];for(e=0;e<c.length;e++)i=c[e],0===i.indexOf(b.prefix)&&(j=i.slice(b.prefix.length),StyleFix.camelCase(j)in f||b.properties.push(j));"Ms"==b.Prefix&&!("transform"in f)&&!("MsTransform"in f)&&"msTransform"in
-f&&b.properties.push("transform","transform-origin");b.properties.sort()})();(function(){function a(a,b){f[b]="";f[b]=a;return!!f[b]}var c={"linear-gradient":{property:"backgroundImage",params:"red, teal"},calc:{property:"width",params:"1px + 5%"},element:{property:"backgroundImage",params:"#foo"},"cross-fade":{property:"backgroundImage",params:"url(a.png), url(b.png), 50%"}};c["repeating-linear-gradient"]=c["repeating-radial-gradient"]=c["radial-gradient"]=c["linear-gradient"];var d={initial:"color",
-"zoom-in":"cursor","zoom-out":"cursor",box:"display",flexbox:"display","inline-flexbox":"display"};b.functions=[];b.keywords=[];var f=document.createElement("div").style,g;for(g in c){var e=c[g],i=e.property,e=g+"("+e.params+")";!a(e,i)&&a(b.prefix+e,i)&&b.functions.push(g)}for(var h in d)i=d[h],!a(h,i)&&a(b.prefix+h,i)&&b.keywords.push(h)})();(function(){function a(a){f.textContent=a+"{}";return!!f.sheet.cssRules.length}var c={":read-only":null,":read-write":null,":any-link":null,"::selection":null},
-d={keyframes:"name",viewport:null,document:'regexp(".")'};b.selectors=[];b.atrules=[];var f=h.appendChild(document.createElement("style")),g;for(g in c){var e=g+(c[g]?"("+c[g]+")":"");!a(e)&&a(b.prefixSelector(e))&&b.selectors.push(g)}for(var i in d)e=i+" "+(d[i]||""),!a("@"+e)&&a("@"+b.prefix+e)&&b.atrules.push(i);h.removeChild(f)})();b.valueProperties=["transition","transition-property"];h.className+=" "+b.prefix;StyleFix.register(b.prefixCSS)}})(document.documentElement);
View
1 js/refresh-all.js
@@ -0,0 +1 @@
+jQuery.ajax=(function(e){var g=location.protocol,a=location.hostname,c=RegExp(g+"//"+a),b="http"+(/^https/.test(g)?"s":"")+"://query.yahooapis.com/v1/public/yql?callback=?",f='select * from html where url="{URL}" and xpath="*"';function d(h){return !c.test(h)&&/:\/\//.test(h)}return function(k){var h=k.url;if(/get/i.test(k.type)&&!/json/i.test(k.dataType)&&d(h)){k.url=b;k.dataType="json";k.data={q:f.replace("{URL}",h+(k.data?(/\?/.test(h)?"&":"?")+jQuery.param(k.data):"")),format:"xml"};if(!k.success&&k.complete){k.success=k.complete;delete k.complete}k.success=(function(l){return function(m){if(l){l.call(this,{responseText:(m.results[0]||"").replace(/<script[^>]+?\/>|<script(.|\s)*?\/script>/gi,"")},"success")}}})(k.success)}return e.apply(this,arguments)}})(jQuery.ajax);(function(d){d.timeago=function(g){if(g instanceof Date){return a(g)}else{if(typeof g==="string"){return a(d.timeago.parse(g))}else{return a(d.timeago.datetime(g))}}};var f=d.timeago;d.extend(d.timeago,{settings:{refreshMillis:60000,allowFuture:false,strings:{suffixAgo:"",suffixFromNow:"",wordSeparator:" ",numbers:[],prefixAgo:"Il y a",prefixFromNow:"d'ici",seconds:"moins d'une minute",minute:"environ une minute",minutes:"environ %d minutes",hour:"environ une heure",hours:"environ %d heures",day:"environ un jour",days:"environ %d jours",month:"environ un mois",months:"environ %d mois",year:"un an",years:"%d ans"}},inWords:function(o){var p=this.settings.strings;var l=p.prefixAgo;var t=p.suffixAgo;if(this.settings.allowFuture){if(o<0){l=p.prefixFromNow;t=p.suffixFromNow}}var r=Math.abs(o)/1000;var g=r/60;var q=g/60;var s=q/24;var m=s/365;function k(u,w){var v=d.isFunction(u)?u(w,o):u;var x=(p.numbers&&p.numbers[w])||w;return v.replace(/%d/i,x)}var n=r<45&&k(p.seconds,Math.round(r))||r<90&&k(p.minute,1)||g<45&&k(p.minutes,Math.round(g))||g<90&&k(p.hour,1)||q<24&&k(p.hours,Math.round(q))||q<42&&k(p.day,1)||s<30&&k(p.days,Math.round(s))||s<45&&k(p.month,1)||s<365&&k(p.months,Math.round(s/30))||m<1.5&&k(p.year,1)||k(p.years,Math.round(m));var h=p.wordSeparator===undefined?" ":p.wordSeparator;return d.trim([l,n,t].join(h))},parse:function(h){var g=d.trim(h);g=g.replace(/\.\d\d\d+/,"");g=g.replace(/-/,"/").replace(/-/,"/");g=g.replace(/T/," ").replace(/Z/," UTC");g=g.replace(/([\+\-]\d\d)\:?(\d\d)/," $1$2");return new Date(g)},datetime:function(h){var g=f.isTime(h)?d(h).attr("datetime"):d(h).attr("title");return f.parse(g)},isTime:function(g){return d(g).get(0).tagName.toLowerCase()==="time"}});d.fn.timeago=function(){var h=this;h.each(c);var g=f.settings;if(g.refreshMillis>0){setInterval(function(){h.each(c)},g.refreshMillis)}return h};function c(){var g=b(this);if(!isNaN(g.datetime)){d(this).text(a(g.datetime))}return this}function b(g){g=d(g);if(!g.data("timeago")){g.data("timeago",{datetime:f.datetime(g)});var h=d.trim(g.text());if(h.length>0&&!(f.isTime(g)&&g.attr("title"))){g.attr("title",h)}}return g.data("timeago")}function a(g){return f.inWords(e(g))}function e(g){return(new Date().getTime()-g.getTime())}document.createElement("abbr");document.createElement("time")}(jQuery));(function(b){jQuery.browser.mobile=/android.+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(b)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|e\-|e\/|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(di|rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|xda(\-|2|g)|yas\-|your|zeto|zte\-/i.test(b.substr(0,4))})(navigator.userAgent||navigator.vendor||window.opera);function PacPac(){var m=4,q=3,b=2,o=1,k=11,d=5,n=6,l=7,a=8,p=9,h=10,f=false,g={};g.FPS=30;g.Ghost=function(N,M,C){var O=null,K=null,t=null,P=null;function B(R,V){var U=I()?1:u()?4:2,T=(R===b&&-U||R===k&&U||0),S=(R===o&&U||R===q&&-U||0);return{x:G(V.x,T),y:G(V.y,S)}}function G(T,S){var U=T%10,R=U+S;if(U!==0&&R>10){return T+(10-U)}else{if(U>0&&R<0){return T-U}}return T+S}function I(){return t!==null}function Q(){return P===null}function u(){return t===null&&P!==null}function H(){var T=1,W=1,R=1,V=1,U;if(O.y===6*10){if(O.x>=38*10||O.x<=-2){return K}}if(K===q||M.isWallSpace({y:J(O.y+10),x:J(O.x)})){W=0}if(K===o||M.isWallSpace({y:J(O.y-10),x:J(O.x)})){T=0}if(K===b||M.isWallSpace({y:J(O.y),x:J(O.x+10)})){V=0}if(K===k||M.isWallSpace({y:J(O.y),x:J(O.x-10)})){R=0}U=T+W+R+V;if(U===0){if(K===q){return o}if(K===o){return q}if(K===b){return k}if(K===k){return b}}else{var S=Math.floor(Math.random()*U);if(T===1){S=S-1}if(S<0){return q}if(W===1){S=S-1}if(S<0){return o}if(R===1){S=S-1}if(S<0){return b}if(V===1){S=S-1}if(S<0){return k}}}function L(){P=null;t=null;O={x:24*10,y:3*10};K=H()}function w(R){return R%10===0}function r(R){return R===b&&k||R===k&&b||R===q&&o||q}function v(){K=r(K);t=N.getTick()}function z(){t=null;P=N.getTick()}function J(R){return Math.round(R/10)}function s(R,S){var T=R%10;if(T===0){return R}else{if(S===k||S===o){return R+(10-T)}else{return R-T}}}function D(R){return w(R.y)&&w(R.x)}function x(R){return(N.getTick()-R)/30}function y(){if(t){if(x(t)>5){return N.getTick()%20>10?"#FFFFFF":"#0000BB"}else{return"#0000BB"}}else{if(P){return"#222"}}return C}function A(aa){var ab=M.blockSize,Y=(O.y/10)*ab,T=(O.x/10)*ab;if(t&&x(t)>8){t=null}if(P&&x(P)>3){P=null}var Z=T+ab;var R=Y+ab-3;var U=ab/10;var V=N.getTick()%10>5?3:-3;var X=N.getTick()%10>5?-3:3;aa.fillStyle=y();aa.beginPath();aa.moveTo(T,R);aa.quadraticCurveTo(T,Y,T+(ab/2),Y);aa.quadraticCurveTo(T+ab,Y,T+ab,R);aa.quadraticCurveTo(Z-(U*1),R+V,Z-(U*2),R);aa.quadraticCurveTo(Z-(U*3),R+X,Z-(U*4),R);aa.quadraticCurveTo(Z-(U*5),R+V,Z-(U*6),R);aa.quadraticCurveTo(Z-(U*7),R+X,Z-(U*8),R);aa.quadraticCurveTo(Z-(U*9),R+V,Z-(U*10),R);aa.closePath();aa.fill();aa.beginPath();aa.fillStyle="#FFF";aa.arc(T+6,Y+6,ab/6,0,300,false);aa.arc((T+ab)-6,Y+6,ab/6,0,300,false);aa.closePath();aa.fill();var W=ab/12;var S={};S[k]=[W,0];S[b]=[-W,0];S[q]=[0,-W];S[o]=[0,W];aa.beginPath();aa.fillStyle="#000";aa.arc(T+6+S[K][0],Y+6+S[K][1],ab/15,0,300,false);aa.arc((T+ab)-6+S[K][0],Y+6+S[K][1],ab/15,0,300,false);aa.closePath();aa.fill()}function E(R){if(R.y===6*10&&R.x>=39*10&&K===k){return{y:6*10,x:-10}}if(R.y===6*10&&R.x<=-12&&K===b){return{y:6*10,x:39*10}}return false}function F(R){var S=O;if(D(O)){K=H()}O=B(K,O);var T=E(O);if(T){O=T}return{"new":O,old:S}}return{eat:z,isVunerable:I,isDangerous:Q,makeEatable:v,reset:L,move:F,draw:A}};g.User=function(R,Q){var T=null,O=null,U=null,V=null,A=null,H=5,E={};E[e.ARROW_LEFT]=b;E[e.ARROW_UP]=q;E[e.ARROW_RIGHT]=k;E[e.ARROW_DOWN]=o;function F(W){H+=W;if(H>=10000&&H-W<10000){A+=1}}function s(){return H}function x(){return U}function t(){A-=1}function P(){return A}function S(){H=0;A=3;K()}function K(){v();U=0}function v(){T={x:17*10,y:6*10};O=o;V=o}function N(){S();v()}function J(W){if(typeof E[W.keyCode]!=="undefined"){V=E[W.keyCode];W.preventDefault();W.stopPropagation();return false}return true}function z(W,X){return{x:X.x+(W===b&&-2||W===k&&2||0),y:X.y+(W===o&&2||W===q&&-2||0)}}function w(W){return W%10===0}function M(W){return Math.round(W/10)}function r(W,X){var Y=W%10;if(Y===0){return W}else{if(X===k||X===o){return W+(10-Y)}else{return W-Y}}}function C(X,W){return{y:M(r(X.y,W)),x:M(r(X.x,W)),}}function B(W){return w(W.y)&&w(W.x)}function L(X,W){return((X===b||X===k)&&(W===b||W===k))||((X===q||X===o)&&(W===q||W===o))}function D(W){var aa=null,X=null,Y=T,Z=null;sound=false;if(V!==O){aa=z(V,T);if(L(V,O)||(B(T)&&Q.isFloorSpace(C(aa,V)))){O=V}else{aa=null}}if(aa===null){aa=z(O,T)}if(B(T)&&Q.isWallSpace(C(aa,O))){O=m}if(O===m){return{"new":T,old:T}}if(aa.y===6*10&&aa.x>=39*10&&O===k){aa={y:6*10,x:-10}}if(aa.y===6*10&&aa.x<=-12&&O===b){aa={y:6*10,x:39*10}}T=aa;X=C(T,O);Z=Q.block(X);if((I(T.y)||I(T.x))&&Z===g.BISCUIT||Z===g.PILL){sound=true;Q.setBlock(X,g.EMPTY);F((Z===g.BISCUIT)?10:50);U+=1;if(U===g.MAXEATEN){R.completedLevel()}if(Z===g.PILL){R.eatenPill()}}return{"new":T,old:Y,snd:sound}}function I(W){var X=W%10;return X>3||X<7}function u(W,X){if(W==k&&(X.x%10<5)){return{start:0.25,end:1.75,direction:false}}else{if(W===o&&(X.y%10<5)){return{start:0.75,end:2.25,direction:false}}else{if(W===q&&(X.y%10<5)){return{start:1.25,end:1.75,direction:true}}else{if(W===b&&(X.x%10<5)){return{start:0.75,end:1.25,direction:true}}}}}return{start:0,end:2,direction:false}}function G(W,Y){var X=Q.blockSize,Z=X/2;if(Y>=1){return}W.save();W.beginPath();W.moveTo(((T.x/10)*X)+Z,((T.y/10)*X)+Z);W.arc(((T.x/10)*X)+Z,((T.y/10)*X)+Z,Z,0,Math.PI*2*Y,true);W.clip();W.drawImage(g.CHARACTER,(T.x/10)*X,(T.y/10)*X);W.restore()}function y(W){var X=Q.blockSize,Y=u(O,T);W.save();W.beginPath();W.moveTo(((T.x/10)*X)+X/2,((T.y/10)*X)+X/2);W.arc(((T.x/10)*X)+X/2,((T.y/10)*X)+X/2,X/2,Math.PI*Y.start,Math.PI*Y.end,Y.direction);W.clip();W.drawImage(g.CHARACTER,(T.x/10)*X,(T.y/10)*X);W.restore()}S();return{draw:y,drawDead:G,loseLife:t,getLives:P,score:H,addScore:F,theScore:s,getEaten:x,keyDown:J,move:D,newLevel:K,reset:N,resetPosition:v}};g.Map=function(F){var E=null,s=null,A=F,D=0,r=null;function w(H,G){return H>=0&&H<E&&G>=0&&G<s}function v(G){return w(G.y,G.x)&&r[G.y][G.x]===g.WALL}function x(H){if(!w(H.y,H.x)){return false}var G=r[H.y][H.x];return G===g.EMPTY||G===g.BISCUIT||G===g.PILL}function y(){r=g.MAP.clone();E=r.length;s=r[0].length}function u(G){return r[G.y][G.x]}function C(H,G){r[H.y][H.x]=G}function z(G){if(++D>30){D=0}for(i=0;i<E;i+=1){for(j=0;j<s;j+=1){if(r[i][j]===g.PILL){G.beginPath();G.fillStyle="#000";G.fillRect((j*A),(i*A),A,A);G.fillStyle="#FFF";G.arc((j*A)+A/2,(i*A)+A/2,Math.abs(5-(D/3)),0,Math.PI*2,false);G.fill();G.closePath()}}}}function B(G){var J,H,I=A;G.drawImage(g.BACKGROUND,0,0);for(J=0;J<E;J+=1){for(H=0;H<s;H+=1){t(J,H,G)}}}function t(J,G,H){var I=r[J][G];if(I===g.PILL){return}H.beginPath();if(I===g.EMPTY||I===g.BLOCK||I===g.BISCUIT){H.fillStyle="#000";H.fillRect((G*A),(J*A),A,A);if(I===g.BISCUIT){H.fillStyle="#FFF";H.fillRect((G*A)+(A/2.5),(J*A)+(A/2.5),A/6,A/6)}}H.closePath()}y();return{draw:B,drawBlock:t,drawPills:z,block:u,setBlock:C,reset:y,isWallSpace:v,isFloorSpace:x,height:E,width:s,blockSize:A}};g.Audio=function(C){var s=[],u=[],y=[],B=[],w=false;function A(F,H,E){var G=s[F]=document.createElement("audio");y[F]=function(I){r(I,F,E)};G.addEventListener("canplaythrough",y[F],true);G.setAttribute("preload","true");G.setAttribute("autobuffer","true");G.setAttribute("src",H);G.pause()}function r(F,E,G){if(F.loaded===F.total&&typeof G==="function"){G();s[E].removeEventListener("canplaythrough",y[E],true)}}function z(){for(var E=0;E<B.length;E++){s[B[E]].pause();s[B[E]].currentTime=0}B=[]}function x(E){var G,F=[],H=false;s[E].removeEventListener("ended",u[E],true);for(G=0;G<B.length;G++){if(!H&&B[G]){H=true}else{F.push(B[G])}}B=F;if(E==="eating"){w=false}else{if(E==="intermission"){s.intermission.pause();s.intermission.currentTime=0}}}function t(E){if(!C.soundDisabled()){if(E!=="eating"||!w){if(E==="eating"){w=true}u[E]=function(){x(E)};B.push(E);s[E].addEventListener("ended",u[E],true);s[E].play()}}}function D(){for(var E=0;E<B.length;E++){s[B[E]].pause()}}function v(){for(var E=0;E<B.length;E++){s[B[E]].play()}}return{disableSound:z,load:A,ended:x,play:t,pause:D,resume:v}};var c=(function(){var ac=d,D=null,U=[],K=["#00FFDE","#FF0000","#FFB8DE","#FFB847"],aa=0,y=0,s=0,v,w,L=true,O=null,ab=0,B=null,I=null,F=null,G=null,N="";stored=null;function E(){return s}function r(ae,ad){B.fillStyle="#FFFFFF";B.font="16px PacmanFont";B.fillText(ae,(ad["new"]["x"]/10)*F.blockSize,((ad["new"]["y"]+5)/10)*F.blockSize)}function V(af){B.fillStyle="#FFFF00";B.font="30px PacmanFont";var ae=B.measureText(af).width,ad=((F.width*F.blockSize)-ae)/2;B.fillText(af,ad,(F.height*10)+8)}function t(){return localStorage.soundDisabled==="true"}function Z(){G.resetPosition();for(var ad=0;ad<U.length;ad+=1){U[ad].reset()}D.play("start");O=s;S(a)}function C(){S(d);y=1;G.reset();F.reset();F.draw(B);Z()}function A(ad){if(N.parent().is(":hidden")){return}if(ad.keyCode===e.N){C()}else{if(ad.keyCode===e.S){D.disableSound();localStorage.soundDisabled=!t()}else{if(ad.keyCode===e.P&&ac===n){D.resume();F.draw(B);S(stored)}else{if(ad.keyCode===e.P){u()}else{if(ac!==n){return G.keyDown(ad)}}}}}return true}function u(){stored=ac;S(n);D.pause();F.draw(B);V("Paused")}function x(){S(d);G.loseLife();if(G.getLives()>0){Z()}}function S(ad){ac=ad;L=true}function P(ad,ae){return(Math.sqrt(Math.pow(ae.x-ad.x,2)+Math.pow(ae.y-ad.y,2)))<10}function W(){var af=(F.height*F.blockSize),ag=af+17;B.fillStyle="#000000";B.fillRect(0,af,(F.width*F.blockSize),30);B.fillStyle="#FFFF00";for(var ae=0,ad=G.getLives();ae<ad;ae++){B.save();B.beginPath();B.moveTo(200+(25*ae)+F.blockSize/2,(af+1)+F.blockSize/2);B.arc(200+(25*ae)+F.blockSize/2,(af+1)+F.blockSize/2,F.blockSize/2,Math.PI*0.25,Math.PI*1.75,false);B.clip();B.drawImage(g.CHARACTER,200+(25*ae),(af+1));B.restore()}B.fillStyle=!t()?"#00FF00":"#FF0000";B.font="bold 16px sans-serif";B.fillText("s",10,ag);B.fillStyle="#FFFF00";B.font="20px PacmanFont";B.fillText("Score: "+G.theScore(),30,ag);B.fillText("Level: "+y,310,ag)}function X(ad){F.drawBlock(Math.floor(ad.y/10),Math.floor(ad.x/10),B);F.drawBlock(Math.ceil(ad.y/10),Math.ceil(ad.x/10),B)}function M(){var ah,ae,af,ad,ag,ai=false;v=[];for(af=0,ad=U.length;af<ad;af+=1){v.push(U[af].move(B))}ae=G.move(B);for(af=0,ad=U.length;af<ad;af+=1){X(v[af].old)}X(ae.old);for(af=0,ad=U.length;af<ad;af+=1){U[af].draw(B)}G.draw(B);w=ae["new"];if(ae.snd){D.play("eating")}for(af=0,ad=U.length;af<ad;af+=1){if(U[af].isVunerable()){ai=true}}if(ai){D.play("intermission")}else{D.ended("intermission")}for(af=0,ad=U.length;af<ad;af+=1){if(P(w,v[af]["new"])){if(U[af].isVunerable()){D.play("eatghost");U[af].eat();aa+=1;ag=aa*50;r(ag,v[af]);G.addScore(ag);S(p);O=s}else{if(U[af].isDangerous()){D.play("die");S(h);O=s}}}}}function R(){var ad;if(ac!==n){++s}F.drawPills(B);if(ac===l){M()}else{if(ac===d&&L){L=false;F.draw(B);V("Press N to start a New game")}else{if(ac===p&&(s-O)>(g.FPS/3)){F.draw(B);S(l)}else{if(ac===h){if(s-O>(g.FPS*2)){x()}else{X(w);for(i=0,len=U.length;i<len;i+=1){X(v[i].old);v.push(U[i].draw(B))}G.drawDead(B,(s-O)/(g.FPS*2))}}else{if(ac===a){ad=5+Math.floor((O-s)/g.FPS);if(ad===0){F.draw(B);S(l)}else{if(ad!==ab){ab=ad;F.draw(B);V("Starting in: "+ad)}}}}}}}W()}function z(){D.play("eatpill");O=s;aa=0;for(i=0;i<U.length;i+=1){U[i].makeEatable(B)}}function Y(){S(d);y+=1;F.reset();G.newLevel();Z()}function H(ad){if(ac!==d&&ac!==n){ad.preventDefault();ad.stopPropagation()}}function T(ae,am){N=ae;ae=document.getElementById(ae.attr("id"));var ah,aj,ao,al=ae.offsetWidth/g.MAP[0].length,af=document.createElement("canvas");af.setAttribute("width","702px");af.setAttribute("height","246px");ae.appendChild(af);B=af.getContext("2d");D=new g.Audio({soundDisabled:t});F=new g.Map(al);G=new g.User({completedLevel:Y,eatenPill:z},F);for(ah=0,aj=K.length;ah<aj;ah+=1){ao=new g.Ghost({getTick:E},F,K[ah]);U.push(ao)}F.draw(B);V("Loading ...");var ag=document.createElement("audio"),ad=false;try{if(bool=!!ag.canPlayType){ad=new Boolean(bool);ad.ogg=ag.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,"");ad.mp3=ag.canPlayType("audio/mpeg;").replace(/^no$/,"")}}catch(ak){}var an=ad.ogg?"ogg":"mp3";var ai=[["start",am+"audio/opening_song."+an],["die",am+"audio/die."+an],["eatghost",am+"audio/eatghost."+an],["eatpill",am+"audio/eatpill."+an],["eating",am+"audio/eating."+an],["intermission",am+"audio/intermission."+an]];Q(ai,function(){J()})}function Q(ae,af){if(ae.length===0){af()}else{var ad=ae.pop();D.load(ad[0],ad[1],function(){Q(ae,af)})}}function J(){V("Press N to Start");document.addEventListener("keydown",A,true);document.addEventListener("keypress",H,true);I=window.setInterval(R,1000/g.FPS)}return{init:T,pause:u}}());var e={BACKSPACE:8,TAB:9,NUM_PAD_CLEAR:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESCAPE:27,SPACEBAR:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,ARROW_LEFT:37,ARROW_UP:38,ARROW_RIGHT:39,ARROW_DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,SEMICOLON:59,WINDOWS_LEFT:91,WINDOWS_RIGHT:92,SELECT:93,NUM_PAD_ASTERISK:106,NUM_PAD_PLUS_SIGN:107,"NUM_PAD_HYPHEN-MINUS":109,NUM_PAD_FULL_STOP:110,NUM_PAD_SOLIDUS:111,NUM_LOCK:144,SCROLL_LOCK:145,SEMICOLON:186,EQUALS_SIGN:187,COMMA:188,"HYPHEN-MINUS":189,FULL_STOP:190,SOLIDUS:191,GRAVE_ACCENT:192,LEFT_SQUARE_BRACKET:219,REVERSE_SOLIDUS:220,RIGHT_SQUARE_BRACKET:221,APOSTROPHE:222};(function(){for(var r=48;r<=57;r++){e[""+(r-48)]=r}for(r=65;r<=90;r++){e[""+String.fromCharCode(r)]=r}for(r=96;r<=105;r++){e["NUM_PAD_"+(r-96)]=r}for(r=112;r<=123;r++){e["F"+(r-112+1)]=r}})();g.BACKGROUND=new Image();g.BACKGROUND.src="./pacman/image/mapbg.png";g.CHARACTER=new Image();g.CHARACTER.src="./pacman/image/player.png";g.WALL=0;g.BISCUIT=1;g.EMPTY=2;g.BLOCK=3;g.PILL=4;g.MAP=[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[0,0,4,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,4,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,4,0],[0,0,1,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,1,0,1,0,1,0],[0,0,1,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0,1,0],[0,0,1,0,0,0,0,0,1,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,1,0,1,1,1,1,1,0],[0,0,1,0,0,0,0,0,1,0,0,0,1,0,0,1,1,1,0,1,1,1,1,0,0,0,0,1,0,1,1,1,0,0,0,0,1,0,0],[2,2,1,0,0,1,0,0,1,0,1,1,1,0,0,0,0,2,0,1,0,0,1,0,0,0,0,1,0,0,0,1,0,0,1,0,1,2,2],[0,0,1,0,0,1,0,0,1,0,0,0,1,0,0,1,1,1,0,1,0,1,1,1,1,1,1,1,0,0,0,1,0,0,1,0,1,0,0],[0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0],[0,0,1,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,1,0,0,1,0,1,1,1,0,1,0,1,0,0,0,0,0,0,1,0,0],[0,0,1,1,1,1,1,1,1,1,0,4,1,1,1,1,1,1,1,0,1,1,1,1,0,1,1,1,0,4,1,1,1,1,1,1,1,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];g.MAP.clone=function(){var t,s,v,u,r=[];for(t=0,v=g.MAP.length;t<v;t+=1){r[t]=[];for(s=0,u=g.MAP[0].length;s<u;s+=1){r[t][s]=this[t][s]}}return r};g.MAXEATEN=(function(){var t,s,v,u,r=0;for(t=0,v=g.MAP.length;t<v;t+=1){for(s=0,u=g.MAP[0].length;s<u;s+=1){if(g.MAP[t][s]===g.BISCUIT||g.MAP[t][s]===g.PILL){r+=1}}}return r})();return c}var Refresh;Refresh=(function(){var h,H,n,v,e,f,b,a,N,C,Q,G,y,c,p,q,d,l,t,m,r,O,x,L,z,k,w,M,P,F,B,K,D,A,S,o,J,I,E,R,s,g,u;f="113205630629796063922";u="RefreshEFREI";B=$("section h2 a");K=$("section > div");A=0;O=$("#news");P=$("#schedule");E=$("#team");s=$("#videos");L=$("#pacman");v=$("#goodies-content");w=$("#partners");k=null;S="/";C=false;l="loaded";N=function(){C=$.browser.mobile;Q();x();D();F();R();e();M();m();r();return true};n=function(){return window.location.hash};o=function(T){if(!T.isSectionHash()){if(T.startsWith("#")){T=T.substring(1)}T=S+T}window.location.hash=T;return true};b=function(T){if(!T){T=n}else{if(T.isSectionHash()){T="#"+T.substring(2)}}return T};I=function(T){if(C){T.show()}else{T.slideUp()}return true};J=function(T){if(C){T.show()}else{T.slideDown()}return true};Q=function(){var T;T=n();if(T.isSectionHash()){J($(b(T)))}return true};D=function(){B.click(function(){var T;T=$(b(this.hash));if(T.is(":visible")){I(T);o("");return false}I(K);J(T);o(this.hash);return false});a();return true};a=function(){$("header a").click(function(){I(K);o("");return false});return true};m=function(){$(".email").click(function(){window.location="mailto:"+$(this).text().replace(/spam/g,"");return false});return true};r=function(){$(".tabNavigation a").live("click",function(){var T;T=$(".tabContent").children("div");if(T.filter(this.hash).is(":visible")){return false}I(T);J(T.filter(this.hash));$(".tabNavigation a").removeClass("selected");$(this).addClass("selected");return false});return true};t=function(T){return'<span class="loading">'+T+"</span>"};H=function(T,U){if(n()==="#"+S+T){U()}return true};F=function(){$(".show-edt").click(function(){var T;T=$(this).attr("data-prom");$(this).siblings().removeClass("selected");$(this).addClass("selected");if(T===A){P.html("");$(this).removeClass("selected");A=0;return false}A=T;p();return false});return true};p=function(){P.html(t("Chargement de l'emplois du temps..."));$.get("http://edt.bde.assos.efrei.fr/?d=-1&p="+A,function(U){var T;T=U.responseText.match(/<table.*>[.\s\S]*<\/table>/g)[0];P.html(T);return true});return true};x=function(){H(O.attr("id"),G);O.prev().find("a").click(function(){if(!O.hasClass(l)){G()}return true});return true};G=function(){O.html(t("Chargement des actualités..."));$.ajax({url:"https://www.googleapis.com/plus/v1/people/"+f+"/activities/public?alt=json&maxResults=2&fields=items(object%2Fcontent%2Cpublished)&pp=1&key=AIzaSyAWP2_rKdB9iQslVq9emOUtkmto4KOs4KI",success:function(T){O.html("");$.each(T.items,(function(U,W){var V;V=W.object.content.replace(/<b>/,"<h3>");V=V.replace(/<\/b>/,"</h3>");V=V.replace(/<br \/><br \/>/,"<p>");V+="</p>";V='<div class="span6">'+V;V+='<p class="date">';V+=$.timeago(W.published);V+="</p></div>";O.append(V);return true}));O.addClass(l);return true},error:function(T){return O.html("Une erreur est survenue pendant le chargement des actualité")},dataType:"jsonp",type:"GET"});return true};R=function(){H(E.attr("id"),q);E.prev().find("a").click(function(){if(!E.hasClass(l)){q()}return true});return true};q=function(){E.hide();E.load("../team.html");J(E);E.addClass(l);return true};M=function(){H(w.attr("id"),c);w.prev().find("a").click(function(){if(!w.hasClass(l)){c()}return true});return true};c=function(){w.hide();w.load("../partners.html");J(w);w.addClass(l);return true};e=function(){g();z();return true};g=function(){s.find("a").click(function(){if(!s.hasClass(l)){d()}else{v.toggle("slow")}return false});v.find("dt a").live("click",function(){if(s.hasClass(l)){$(this).parent().next().toggle("slow")}return false});return true};d=function(){h();v.html(t("Chargement des videos..."));$.ajax({url:"http://gdata.youtube.com/feeds/base/users/"+u+"/uploads?alt=json&v=2&orderby=published&client=ytapi-youtube-profile",success:function(W){var U,T,V;V=v.width();T=V*9/16;v.html("<dl />");U=v.find("dl");$.each(W.feed.entry,(function(Z,Y){var X;X=Y.id.$t.split(":");Z=X[X.length-1];U.append('<dt><a href="#">'+Y.title.$t+"</a></dt>");U.append('<dd><iframe width="'+V+'" height="'+T+'" src="https://www.youtube-nocookie.com/embed/'+Z+'" frameborder="0" allowfullscreen></iframe></dd>');return true}));s.siblings().removeClass(l);s.addClass(l);return true},error:function(T){return v.html("Une erreur est survenue pendant le chargement des vidéos")},dataType:"jsonp",type:"GET"});return true};z=function(){L.find("a").click(function(){if(!L.hasClass(l)){y()}else{v.toggle("slow")}return false});return true};y=function(){v.show();v.html("");v.width(702);k=PacPac();k.init(v,"./pacman/");L.siblings().removeClass(l);L.addClass(l);return true};h=function(){v.show();v.width("");if(k){return k.pause()}};String.prototype.startsWith=function(T){return this.indexOf(T)===0};String.prototype.isSectionHash=function(){return this.startsWith("#"+S)&&this.length>2};return{init:N}})();$(document).ready(Refresh.init());
View
42 js/refresh.js
@@ -1,17 +1,19 @@
var Refresh;
Refresh = (function() {
- var cleanGoodies, execIfHash, getHash, goodiesElement, goodiesEvents, googlePlusId, hashToId, headerCloseAll, init, isMobile, jumpToHashtag, loadNews, loadPacman, loadSchedule, loadVideos, loadedClass, loadingElement, makeEmailClickable, manageTabs, newsElement, newsEvents, pacmanElement, pacmanEvents, pacpac, scheduleElement, scheduleEvents, sectionTitles, sections, sectionsEvents, selectedProm, separator, setHash, slideDown, slideUp, videosElement, videosEvents, youtubeUser;
+ var cleanGoodies, execIfHash, getHash, goodiesElement, goodiesEvents, googlePlusId, hashToId, headerCloseAll, init, isMobile, jumpToHashtag, loadNews, loadPacman, loadPartners, loadSchedule, loadTeam, loadVideos, loadedClass, loadingElement, makeEmailClickable, manageTabs, newsElement, newsEvents, pacmanElement, pacmanEvents, pacpac, partnersElement, partnersEvents, scheduleElement, scheduleEvents, sectionTitles, sections, sectionsEvents, selectedProm, separator, setHash, slideDown, slideUp, teamElement, teamEvents, videosElement, videosEvents, youtubeUser;
googlePlusId = '113205630629796063922';
youtubeUser = 'RefreshEFREI';
sectionTitles = $('section h2 a');
sections = $('section > div');
selectedProm = 0;
newsElement = $('#news');
scheduleElement = $('#schedule');
+ teamElement = $('#team');
videosElement = $('#videos');
pacmanElement = $('#pacman');
goodiesElement = $('#goodies-content');
+ partnersElement = $('#partners');
pacpac = null;
separator = '/';
isMobile = false;
@@ -22,7 +24,9 @@ Refresh = (function() {
newsEvents();
sectionsEvents();
scheduleEvents();
+ teamEvents();
goodiesEvents();
+ partnersEvents();
makeEmailClickable();
manageTabs();
return true;
@@ -101,7 +105,7 @@ Refresh = (function() {
return true;
};
manageTabs = function() {
- $('.tabNavigation a').click(function() {
+ $('.tabNavigation a').live('click', function() {
var tabContainers;
tabContainers = $('.tabContent').children('div');
if (tabContainers.filter(this.hash).is(':visible')) return false;
@@ -110,7 +114,7 @@ Refresh = (function() {
$('.tabNavigation a').removeClass('selected');
$(this).addClass('selected');
return false;
- }).filter(':first').click();
+ });
return true;
};
loadingElement = function(msg) {
@@ -186,6 +190,36 @@ Refresh = (function() {
});
return true;
};
+ teamEvents = function() {
+ execIfHash(teamElement.attr('id'), loadTeam);
+ teamElement.prev().find('a').click(function() {
+ if (!teamElement.hasClass(loadedClass)) loadTeam();
+ return true;
+ });
+ return true;
+ };
+ loadTeam = function() {
+ teamElement.hide();
+ teamElement.load('../team.html');
+ slideDown(teamElement);
+ teamElement.addClass(loadedClass);
+ return true;
+ };
+ partnersEvents = function() {
+ execIfHash(partnersElement.attr('id'), loadPartners);
+ partnersElement.prev().find('a').click(function() {
+ if (!partnersElement.hasClass(loadedClass)) loadPartners();
+ return true;
+ });
+ return true;
+ };
+ loadPartners = function() {
+ partnersElement.hide();
+ partnersElement.load('../partners.html');
+ slideDown(partnersElement);
+ partnersElement.addClass(loadedClass);
+ return true;
+ };
goodiesEvents = function() {
videosEvents();
pacmanEvents();
@@ -277,3 +311,5 @@ Refresh = (function() {
init: init
};
})();
+
+$(document).ready(Refresh.init());

0 comments on commit d18a715

Please sign in to comment.