Commit 55e3b4c41e27cbd61120fa909aa357922dba9612
Exists in
refactory-sass
Merge branch 'master' into refactory-sass
Showing
11 changed files
with
741 additions
and
552 deletions
Show diff stats
css/bootstrap.min.css
1 | -/*! normalize.css v3.0.2 | MIT License | git.io/normalize */img,legend{border:0}legend,td,th{padding:0}.list-inline,.list-unstyled{padding-left:0;list-style:none}.container-fluid:after,.container:after,.dl-horizontal dd:after,.row:after{clear:both}html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;font-size:10px;-webkit-tap-highlight-color:transparent}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}b,optgroup,strong{font-weight:700}dfn{font-style:italic}h1{margin:.67em 0}mark{background:#ff0;color:#000}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{vertical-align:middle}svg:not(:root){overflow:hidden}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre,textarea{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}table{border-collapse:collapse;border-spacing:0}/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */@media print{blockquote,img,pre,tr{page-break-inside:avoid}*,:after,:before{background:0 0!important;color:#000!important;box-shadow:none!important;text-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href)")"}abbr[title]:after{content:" (" attr(title)")"}a[href^="javascript:"]:after,a[href^="#"]:after{content:""}blockquote,pre{border:1px solid #999}thead{display:table-header-group}img{max-width:100%!important}h2,h3,p{orphans:3;widows:3}h2,h3{page-break-after:avoid}select{background:#fff!important}.navbar{display:none}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000!important}.label{border:1px solid #000}.table{border-collapse:collapse!important}.table td,.table th{background-color:#fff!important}.table-bordered td,.table-bordered th{border:1px solid #ddd!important}}.img-thumbnail,body{background-color:#fff}*,:after,:before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}body{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:1.42857;color:#333}button,input,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}figure{margin:0}.img-responsive{display:block;max-width:100%;height:auto}.img-rounded{border-radius:6px}.img-thumbnail{padding:4px;line-height:1.42857;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out;display:inline-block;max-width:100%;height:auto}.img-circle{border-radius:50%}hr{margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);border:0}.container,.container-fluid{padding-left:15px;padding-right:15px}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}.container,.container-fluid{margin-right:auto;margin-left:auto}[role=button]{cursor:pointer}.container:after,.container:before{content:" ";display:table}@media (min-width:768px){.container{width:750px}}@media (min-width:992px){.container{width:970px}}@media (min-width:1200px){.container{width:1170px}}.container-fluid:after,.container-fluid:before{content:" ";display:table}.row{margin-left:-15px;margin-right:-15px}.row:after,.row:before{content:" ";display:table}.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{position:relative;min-height:1px;padding-left:15px;padding-right:15px}.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{float:left}.col-xs-1{width:8.33333%}.col-xs-2{width:16.66667%}.col-xs-3{width:25%}.col-xs-4{width:33.33333%}.col-xs-5{width:41.66667%}.col-xs-6{width:50%}.col-xs-7{width:58.33333%}.col-xs-8{width:66.66667%}.col-xs-9{width:75%}.col-xs-10{width:83.33333%}.col-xs-11{width:91.66667%}.col-xs-12{width:100%}.col-xs-pull-0{right:auto}.col-xs-pull-1{right:8.33333%}.col-xs-pull-2{right:16.66667%}.col-xs-pull-3{right:25%}.col-xs-pull-4{right:33.33333%}.col-xs-pull-5{right:41.66667%}.col-xs-pull-6{right:50%}.col-xs-pull-7{right:58.33333%}.col-xs-pull-8{right:66.66667%}.col-xs-pull-9{right:75%}.col-xs-pull-10{right:83.33333%}.col-xs-pull-11{right:91.66667%}.col-xs-pull-12{right:100%}.col-xs-push-0{left:auto}.col-xs-push-1{left:8.33333%}.col-xs-push-2{left:16.66667%}.col-xs-push-3{left:25%}.col-xs-push-4{left:33.33333%}.col-xs-push-5{left:41.66667%}.col-xs-push-6{left:50%}.col-xs-push-7{left:58.33333%}.col-xs-push-8{left:66.66667%}.col-xs-push-9{left:75%}.col-xs-push-10{left:83.33333%}.col-xs-push-11{left:91.66667%}.col-xs-push-12{left:100%}.col-xs-offset-0{margin-left:0}.col-xs-offset-1{margin-left:8.33333%}.col-xs-offset-2{margin-left:16.66667%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-4{margin-left:33.33333%}.col-xs-offset-5{margin-left:41.66667%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-7{margin-left:58.33333%}.col-xs-offset-8{margin-left:66.66667%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-10{margin-left:83.33333%}.col-xs-offset-11{margin-left:91.66667%}.col-xs-offset-12{margin-left:100%}@media (min-width:768px){.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9{float:left}.col-sm-1{width:8.33333%}.col-sm-2{width:16.66667%}.col-sm-3{width:25%}.col-sm-4{width:33.33333%}.col-sm-5{width:41.66667%}.col-sm-6{width:50%}.col-sm-7{width:58.33333%}.col-sm-8{width:66.66667%}.col-sm-9{width:75%}.col-sm-10{width:83.33333%}.col-sm-11{width:91.66667%}.col-sm-12{width:100%}.col-sm-pull-0{right:auto}.col-sm-pull-1{right:8.33333%}.col-sm-pull-2{right:16.66667%}.col-sm-pull-3{right:25%}.col-sm-pull-4{right:33.33333%}.col-sm-pull-5{right:41.66667%}.col-sm-pull-6{right:50%}.col-sm-pull-7{right:58.33333%}.col-sm-pull-8{right:66.66667%}.col-sm-pull-9{right:75%}.col-sm-pull-10{right:83.33333%}.col-sm-pull-11{right:91.66667%}.col-sm-pull-12{right:100%}.col-sm-push-0{left:auto}.col-sm-push-1{left:8.33333%}.col-sm-push-2{left:16.66667%}.col-sm-push-3{left:25%}.col-sm-push-4{left:33.33333%}.col-sm-push-5{left:41.66667%}.col-sm-push-6{left:50%}.col-sm-push-7{left:58.33333%}.col-sm-push-8{left:66.66667%}.col-sm-push-9{left:75%}.col-sm-push-10{left:83.33333%}.col-sm-push-11{left:91.66667%}.col-sm-push-12{left:100%}.col-sm-offset-0{margin-left:0}.col-sm-offset-1{margin-left:8.33333%}.col-sm-offset-2{margin-left:16.66667%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-4{margin-left:33.33333%}.col-sm-offset-5{margin-left:41.66667%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-7{margin-left:58.33333%}.col-sm-offset-8{margin-left:66.66667%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-10{margin-left:83.33333%}.col-sm-offset-11{margin-left:91.66667%}.col-sm-offset-12{margin-left:100%}}@media (min-width:992px){.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9{float:left}.col-md-1{width:8.33333%}.col-md-2{width:16.66667%}.col-md-3{width:25%}.col-md-4{width:33.33333%}.col-md-5{width:41.66667%}.col-md-6{width:50%}.col-md-7{width:58.33333%}.col-md-8{width:66.66667%}.col-md-9{width:75%}.col-md-10{width:83.33333%}.col-md-11{width:91.66667%}.col-md-12{width:100%}.col-md-pull-0{right:auto}.col-md-pull-1{right:8.33333%}.col-md-pull-2{right:16.66667%}.col-md-pull-3{right:25%}.col-md-pull-4{right:33.33333%}.col-md-pull-5{right:41.66667%}.col-md-pull-6{right:50%}.col-md-pull-7{right:58.33333%}.col-md-pull-8{right:66.66667%}.col-md-pull-9{right:75%}.col-md-pull-10{right:83.33333%}.col-md-pull-11{right:91.66667%}.col-md-pull-12{right:100%}.col-md-push-0{left:auto}.col-md-push-1{left:8.33333%}.col-md-push-2{left:16.66667%}.col-md-push-3{left:25%}.col-md-push-4{left:33.33333%}.col-md-push-5{left:41.66667%}.col-md-push-6{left:50%}.col-md-push-7{left:58.33333%}.col-md-push-8{left:66.66667%}.col-md-push-9{left:75%}.col-md-push-10{left:83.33333%}.col-md-push-11{left:91.66667%}.col-md-push-12{left:100%}.col-md-offset-0{margin-left:0}.col-md-offset-1{margin-left:8.33333%}.col-md-offset-2{margin-left:16.66667%}.col-md-offset-3{margin-left:25%}.col-md-offset-4{margin-left:33.33333%}.col-md-offset-5{margin-left:41.66667%}.col-md-offset-6{margin-left:50%}.col-md-offset-7{margin-left:58.33333%}.col-md-offset-8{margin-left:66.66667%}.col-md-offset-9{margin-left:75%}.col-md-offset-10{margin-left:83.33333%}.col-md-offset-11{margin-left:91.66667%}.col-md-offset-12{margin-left:100%}}@media (min-width:1200px){.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9{float:left}.col-lg-1{width:8.33333%}.col-lg-2{width:16.66667%}.col-lg-3{width:25%}.col-lg-4{width:33.33333%}.col-lg-5{width:41.66667%}.col-lg-6{width:50%}.col-lg-7{width:58.33333%}.col-lg-8{width:66.66667%}.col-lg-9{width:75%}.col-lg-10{width:83.33333%}.col-lg-11{width:91.66667%}.col-lg-12{width:100%}.col-lg-pull-0{right:auto}.col-lg-pull-1{right:8.33333%}.col-lg-pull-2{right:16.66667%}.col-lg-pull-3{right:25%}.col-lg-pull-4{right:33.33333%}.col-lg-pull-5{right:41.66667%}.col-lg-pull-6{right:50%}.col-lg-pull-7{right:58.33333%}.col-lg-pull-8{right:66.66667%}.col-lg-pull-9{right:75%}.col-lg-pull-10{right:83.33333%}.col-lg-pull-11{right:91.66667%}.col-lg-pull-12{right:100%}.col-lg-push-0{left:auto}.col-lg-push-1{left:8.33333%}.col-lg-push-2{left:16.66667%}.col-lg-push-3{left:25%}.col-lg-push-4{left:33.33333%}.col-lg-push-5{left:41.66667%}.col-lg-push-6{left:50%}.col-lg-push-7{left:58.33333%}.col-lg-push-8{left:66.66667%}.col-lg-push-9{left:75%}.col-lg-push-10{left:83.33333%}.col-lg-push-11{left:91.66667%}.col-lg-push-12{left:100%}.col-lg-offset-0{margin-left:0}.col-lg-offset-1{margin-left:8.33333%}.col-lg-offset-2{margin-left:16.66667%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-4{margin-left:33.33333%}.col-lg-offset-5{margin-left:41.66667%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-7{margin-left:58.33333%}.col-lg-offset-8{margin-left:66.66667%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-10{margin-left:83.33333%}.col-lg-offset-11{margin-left:91.66667%}.col-lg-offset-12{margin-left:100%}}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{font-family:inherit;font-weight:500;line-height:1.1;color:inherit}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,.h4 .small,.h4 small,.h5 .small,.h5 small,.h6 .small,.h6 small,h1 .small,h1 small,h2 .small,h2 small,h3 .small,h3 small,h4 .small,h4 small,h5 .small,h5 small,h6 .small,h6 small{font-weight:400;line-height:1;color:#777}.h1,.h2,.h3,h1,h2,h3{margin-top:20px;margin-bottom:10px}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,h1 .small,h1 small,h2 .small,h2 small,h3 .small,h3 small{font-size:65%}.h4,.h5,.h6,h4,h5,h6{margin-top:10px;margin-bottom:10px}.h4 .small,.h4 small,.h5 .small,.h5 small,.h6 .small,.h6 small,h4 .small,h4 small,h5 .small,h5 small,h6 .small,h6 small{font-size:75%}.h1,h1{font-size:36px}.h2,h2{font-size:30px}.h3,h3{font-size:24px}.h4,h4{font-size:18px}.h5,h5{font-size:14px}.h6,h6{font-size:12px}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:16px;font-weight:300;line-height:1.4}address,dd,dt{line-height:1.42857}@media (min-width:768px){.lead{font-size:21px}}.small,small{font-size:85%}.mark,mark{background-color:#fcf8e3;padding:.2em}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}.text-justify{text-align:justify}.text-nowrap{white-space:nowrap}.text-lowercase{text-transform:lowercase}.initialism,.text-uppercase{text-transform:uppercase}.text-capitalize{text-transform:capitalize}.text-muted{color:#777}.text-primary{color:#337ab7}a.text-primary:hover{color:#286090}.text-success{color:#3c763d}a.text-success:hover{color:#2b542c}.text-info{color:#31708f}a.text-info:hover{color:#245269}.text-warning{color:#8a6d3b}a.text-warning:hover{color:#66512c}.text-danger{color:#a94442}a.text-danger:hover{color:#843534}.bg-primary{color:#fff;background-color:#337ab7}a.bg-primary:hover{background-color:#286090}.bg-success{background-color:#dff0d8}a.bg-success:hover{background-color:#c1e2b3}.bg-info{background-color:#d9edf7}a.bg-info:hover{background-color:#afd9ee}.bg-warning{background-color:#fcf8e3}a.bg-warning:hover{background-color:#f7ecb5}.bg-danger{background-color:#f2dede}a.bg-danger:hover{background-color:#e4b9b9}.page-header{padding-bottom:9px;margin:40px 0 20px;border-bottom:1px solid #eee}dl,ol,ul{margin-top:0}ol,ul{margin-bottom:10px}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}.list-inline{margin-left:-5px}.list-inline>li{display:inline-block;padding-left:5px;padding-right:5px}dl{margin-bottom:20px}dt{font-weight:700}dd{margin-left:0}.dl-horizontal dd:after,.dl-horizontal dd:before{content:" ";display:table}@media (min-width:768px){.dl-horizontal dt{float:left;width:160px;clear:left;text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}}abbr[data-original-title],abbr[title]{cursor:help;border-bottom:1px dotted #777}.initialism{font-size:90%}blockquote{padding:10px 20px;margin:0 0 20px;font-size:17.5px;border-left:5px solid #eee}blockquote ol:last-child,blockquote p:last-child,blockquote ul:last-child{margin-bottom:0}blockquote .small,blockquote footer,blockquote small{display:block;font-size:80%;line-height:1.42857;color:#777}blockquote .small:before,blockquote footer:before,blockquote small:before{content:'\2014 \00A0'}.blockquote-reverse,blockquote.pull-right{padding-right:15px;padding-left:0;border-right:5px solid #eee;border-left:0;text-align:right}.blockquote-reverse .small:before,.blockquote-reverse footer:before,.blockquote-reverse small:before,blockquote.pull-right .small:before,blockquote.pull-right footer:before,blockquote.pull-right small:before{content:''}.blockquote-reverse .small:after,.blockquote-reverse footer:after,.blockquote-reverse small:after,blockquote.pull-right .small:after,blockquote.pull-right footer:after,blockquote.pull-right small:after{content:'\00A0 \2014'}address{margin-bottom:20px;font-style:normal}.clearfix:after,.clearfix:before{content:" ";display:table}.clearfix:after{clear:both}.center-block{display:block;margin-left:auto;margin-right:auto}.pull-right{float:right!important}.pull-left{float:left!important}@-ms-viewport{width:device-width}.visible-lg,.visible-lg-block,.visible-lg-inline,.visible-lg-inline-block,.visible-md,.visible-md-block,.visible-md-inline,.visible-md-inline-block,.visible-sm,.visible-sm-block,.visible-sm-inline,.visible-sm-inline-block,.visible-xs,.visible-xs-block,.visible-xs-inline,.visible-xs-inline-block{display:none!important}@media (max-width:767px){.visible-xs{display:block!important}table.visible-xs{display:table}tr.visible-xs{display:table-row!important}td.visible-xs,th.visible-xs{display:table-cell!important}.visible-xs-block{display:block!important}.visible-xs-inline{display:inline!important}.visible-xs-inline-block{display:inline-block!important}}@media (min-width:768px)and (max-width:991px){.visible-sm{display:block!important}table.visible-sm{display:table}tr.visible-sm{display:table-row!important}td.visible-sm,th.visible-sm{display:table-cell!important}.visible-sm-block{display:block!important}.visible-sm-inline{display:inline!important}.visible-sm-inline-block{display:inline-block!important}}@media (min-width:992px)and (max-width:1199px){.visible-md{display:block!important}table.visible-md{display:table}tr.visible-md{display:table-row!important}td.visible-md,th.visible-md{display:table-cell!important}.visible-md-block{display:block!important}.visible-md-inline{display:inline!important}.visible-md-inline-block{display:inline-block!important}}@media (min-width:1200px){.visible-lg{display:block!important}table.visible-lg{display:table}tr.visible-lg{display:table-row!important}td.visible-lg,th.visible-lg{display:table-cell!important}.visible-lg-block{display:block!important}.visible-lg-inline{display:inline!important}.visible-lg-inline-block{display:inline-block!important}}@media (max-width:767px){.hidden-xs{display:none!important}}@media (min-width:768px)and (max-width:991px){.hidden-sm{display:none!important}}@media (min-width:992px)and (max-width:1199px){.hidden-md{display:none!important}}@media (min-width:1200px){.hidden-lg{display:none!important}}.visible-print{display:none!important}@media print{.visible-print{display:block!important}table.visible-print{display:table}tr.visible-print{display:table-row!important}td.visible-print,th.visible-print{display:table-cell!important}}.visible-print-block{display:none!important}@media print{.visible-print-block{display:block!important}}.visible-print-inline{display:none!important}@media print{.visible-print-inline{display:inline!important}}.visible-print-inline-block{display:none!important}@media print{.visible-print-inline-block{display:inline-block!important}.hidden-print{display:none!important}} | |
2 | 1 | \ No newline at end of file |
2 | +/*! normalize.css v3.0.2 | MIT License | git.io/normalize */img,legend{border:0}legend,td,th{padding:0}.list-inline,.list-unstyled{padding-left:0;list-style:none}.container-fluid:after,.container:after,.dl-horizontal dd:after,.row:after{clear:both}html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;font-size:10px;-webkit-tap-highlight-color:transparent}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}b,optgroup,strong{font-weight:700}dfn{font-style:italic}h1{margin:.67em 0}mark{background:#ff0;color:#000}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{vertical-align:middle}svg:not(:root){overflow:hidden}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre,textarea{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}table{border-collapse:collapse;border-spacing:0}/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */@media print{blockquote,img,pre,tr{page-break-inside:avoid}*,:after,:before{background:0 0!important;color:#000!important;box-shadow:none!important;text-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href)")"}abbr[title]:after{content:" (" attr(title)")"}a[href^="javascript:"]:after,a[href^="#"]:after{content:""}blockquote,pre{border:1px solid #999}thead{display:table-header-group}img{max-width:100%!important}h2,h3,p{orphans:3;widows:3}h2,h3{page-break-after:avoid}select{background:#fff!important}.navbar{display:none}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000!important}.label{border:1px solid #000}.table{border-collapse:collapse!important}.table td,.table th{background-color:#fff!important}.table-bordered td,.table-bordered th{border:1px solid #ddd!important}}.img-thumbnail,body{background-color:#fff}*,:after,:before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}body{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:1.42857;color:#333}button,input,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a{color:#337ab7;text-decoration:none}a:focus,a:hover{color:#23527c;text-decoration:underline}a:focus{outline:dotted thin;outline:-webkit-focus-ring-color auto;outline-offset:-2px}figure{margin:0}.img-responsive{display:block;max-width:100%;height:auto}.img-rounded{border-radius:6px}.img-thumbnail{padding:4px;line-height:1.42857;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out;display:inline-block;max-width:100%;height:auto}.img-circle{border-radius:50%}hr{margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);border:0}.container,.container-fluid{padding-left:15px;padding-right:15px}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}.container,.container-fluid{margin-right:auto;margin-left:auto}[role=button]{cursor:pointer}.container:after,.container:before{content:" ";display:table}@media (min-width:768px){.container{width:750px}}@media (min-width:992px){.container{width:970px}}@media (min-width:1200px){.container{width:1170px}}.container-fluid:after,.container-fluid:before{content:" ";display:table}.row{margin-left:-15px;margin-right:-15px}.row:after,.row:before{content:" ";display:table}.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{position:relative;min-height:1px;padding-left:15px;padding-right:15px}.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{float:left}.col-xs-1{width:8.33333%}.col-xs-2{width:16.66667%}.col-xs-3{width:25%}.col-xs-4{width:33.33333%}.col-xs-5{width:41.66667%}.col-xs-6{width:50%}.col-xs-7{width:58.33333%}.col-xs-8{width:66.66667%}.col-xs-9{width:75%}.col-xs-10{width:83.33333%}.col-xs-11{width:91.66667%}.col-xs-12{width:100%}.col-xs-pull-0{right:auto}.col-xs-pull-1{right:8.33333%}.col-xs-pull-2{right:16.66667%}.col-xs-pull-3{right:25%}.col-xs-pull-4{right:33.33333%}.col-xs-pull-5{right:41.66667%}.col-xs-pull-6{right:50%}.col-xs-pull-7{right:58.33333%}.col-xs-pull-8{right:66.66667%}.col-xs-pull-9{right:75%}.col-xs-pull-10{right:83.33333%}.col-xs-pull-11{right:91.66667%}.col-xs-pull-12{right:100%}.col-xs-push-0{left:auto}.col-xs-push-1{left:8.33333%}.col-xs-push-2{left:16.66667%}.col-xs-push-3{left:25%}.col-xs-push-4{left:33.33333%}.col-xs-push-5{left:41.66667%}.col-xs-push-6{left:50%}.col-xs-push-7{left:58.33333%}.col-xs-push-8{left:66.66667%}.col-xs-push-9{left:75%}.col-xs-push-10{left:83.33333%}.col-xs-push-11{left:91.66667%}.col-xs-push-12{left:100%}.col-xs-offset-0{margin-left:0}.col-xs-offset-1{margin-left:8.33333%}.col-xs-offset-2{margin-left:16.66667%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-4{margin-left:33.33333%}.col-xs-offset-5{margin-left:41.66667%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-7{margin-left:58.33333%}.col-xs-offset-8{margin-left:66.66667%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-10{margin-left:83.33333%}.col-xs-offset-11{margin-left:91.66667%}.col-xs-offset-12{margin-left:100%}@media (min-width:768px){.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9{float:left}.col-sm-1{width:8.33333%}.col-sm-2{width:16.66667%}.col-sm-3{width:25%}.col-sm-4{width:33.33333%}.col-sm-5{width:41.66667%}.col-sm-6{width:50%}.col-sm-7{width:58.33333%}.col-sm-8{width:66.66667%}.col-sm-9{width:75%}.col-sm-10{width:83.33333%}.col-sm-11{width:91.66667%}.col-sm-12{width:100%}.col-sm-pull-0{right:auto}.col-sm-pull-1{right:8.33333%}.col-sm-pull-2{right:16.66667%}.col-sm-pull-3{right:25%}.col-sm-pull-4{right:33.33333%}.col-sm-pull-5{right:41.66667%}.col-sm-pull-6{right:50%}.col-sm-pull-7{right:58.33333%}.col-sm-pull-8{right:66.66667%}.col-sm-pull-9{right:75%}.col-sm-pull-10{right:83.33333%}.col-sm-pull-11{right:91.66667%}.col-sm-pull-12{right:100%}.col-sm-push-0{left:auto}.col-sm-push-1{left:8.33333%}.col-sm-push-2{left:16.66667%}.col-sm-push-3{left:25%}.col-sm-push-4{left:33.33333%}.col-sm-push-5{left:41.66667%}.col-sm-push-6{left:50%}.col-sm-push-7{left:58.33333%}.col-sm-push-8{left:66.66667%}.col-sm-push-9{left:75%}.col-sm-push-10{left:83.33333%}.col-sm-push-11{left:91.66667%}.col-sm-push-12{left:100%}.col-sm-offset-0{margin-left:0}.col-sm-offset-1{margin-left:8.33333%}.col-sm-offset-2{margin-left:16.66667%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-4{margin-left:33.33333%}.col-sm-offset-5{margin-left:41.66667%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-7{margin-left:58.33333%}.col-sm-offset-8{margin-left:66.66667%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-10{margin-left:83.33333%}.col-sm-offset-11{margin-left:91.66667%}.col-sm-offset-12{margin-left:100%}}@media (min-width:992px){.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9{float:left}.col-md-1{width:8.33333%}.col-md-2{width:16.66667%}.col-md-3{width:25%}.col-md-4{width:33.33333%}.col-md-5{width:41.66667%}.col-md-6{width:50%}.col-md-7{width:58.33333%}.col-md-8{width:66.66667%}.col-md-9{width:75%}.col-md-10{width:83.33333%}.col-md-11{width:91.66667%}.col-md-12{width:100%}.col-md-pull-0{right:auto}.col-md-pull-1{right:8.33333%}.col-md-pull-2{right:16.66667%}.col-md-pull-3{right:25%}.col-md-pull-4{right:33.33333%}.col-md-pull-5{right:41.66667%}.col-md-pull-6{right:50%}.col-md-pull-7{right:58.33333%}.col-md-pull-8{right:66.66667%}.col-md-pull-9{right:75%}.col-md-pull-10{right:83.33333%}.col-md-pull-11{right:91.66667%}.col-md-pull-12{right:100%}.col-md-push-0{left:auto}.col-md-push-1{left:8.33333%}.col-md-push-2{left:16.66667%}.col-md-push-3{left:25%}.col-md-push-4{left:33.33333%}.col-md-push-5{left:41.66667%}.col-md-push-6{left:50%}.col-md-push-7{left:58.33333%}.col-md-push-8{left:66.66667%}.col-md-push-9{left:75%}.col-md-push-10{left:83.33333%}.col-md-push-11{left:91.66667%}.col-md-push-12{left:100%}.col-md-offset-0{margin-left:0}.col-md-offset-1{margin-left:8.33333%}.col-md-offset-2{margin-left:16.66667%}.col-md-offset-3{margin-left:25%}.col-md-offset-4{margin-left:33.33333%}.col-md-offset-5{margin-left:41.66667%}.col-md-offset-6{margin-left:50%}.col-md-offset-7{margin-left:58.33333%}.col-md-offset-8{margin-left:66.66667%}.col-md-offset-9{margin-left:75%}.col-md-offset-10{margin-left:83.33333%}.col-md-offset-11{margin-left:91.66667%}.col-md-offset-12{margin-left:100%}}@media (min-width:1200px){.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9{float:left}.col-lg-1{width:8.33333%}.col-lg-2{width:16.66667%}.col-lg-3{width:25%}.col-lg-4{width:33.33333%}.col-lg-5{width:41.66667%}.col-lg-6{width:50%}.col-lg-7{width:58.33333%}.col-lg-8{width:66.66667%}.col-lg-9{width:75%}.col-lg-10{width:83.33333%}.col-lg-11{width:91.66667%}.col-lg-12{width:100%}.col-lg-pull-0{right:auto}.col-lg-pull-1{right:8.33333%}.col-lg-pull-2{right:16.66667%}.col-lg-pull-3{right:25%}.col-lg-pull-4{right:33.33333%}.col-lg-pull-5{right:41.66667%}.col-lg-pull-6{right:50%}.col-lg-pull-7{right:58.33333%}.col-lg-pull-8{right:66.66667%}.col-lg-pull-9{right:75%}.col-lg-pull-10{right:83.33333%}.col-lg-pull-11{right:91.66667%}.col-lg-pull-12{right:100%}.col-lg-push-0{left:auto}.col-lg-push-1{left:8.33333%}.col-lg-push-2{left:16.66667%}.col-lg-push-3{left:25%}.col-lg-push-4{left:33.33333%}.col-lg-push-5{left:41.66667%}.col-lg-push-6{left:50%}.col-lg-push-7{left:58.33333%}.col-lg-push-8{left:66.66667%}.col-lg-push-9{left:75%}.col-lg-push-10{left:83.33333%}.col-lg-push-11{left:91.66667%}.col-lg-push-12{left:100%}.col-lg-offset-0{margin-left:0}.col-lg-offset-1{margin-left:8.33333%}.col-lg-offset-2{margin-left:16.66667%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-4{margin-left:33.33333%}.col-lg-offset-5{margin-left:41.66667%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-7{margin-left:58.33333%}.col-lg-offset-8{margin-left:66.66667%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-10{margin-left:83.33333%}.col-lg-offset-11{margin-left:91.66667%}.col-lg-offset-12{margin-left:100%}}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{font-family:inherit;font-weight:500;line-height:1.1;color:inherit}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,.h4 .small,.h4 small,.h5 .small,.h5 small,.h6 .small,.h6 small,h1 .small,h1 small,h2 .small,h2 small,h3 .small,h3 small,h4 .small,h4 small,h5 .small,h5 small,h6 .small,h6 small{font-weight:400;line-height:1;color:#777}.h1,.h2,.h3,h1,h2,h3{margin-top:20px;margin-bottom:10px}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,h1 .small,h1 small,h2 .small,h2 small,h3 .small,h3 small{font-size:65%}.h4,.h5,.h6,h4,h5,h6{margin-top:10px;margin-bottom:10px}.h4 .small,.h4 small,.h5 .small,.h5 small,.h6 .small,.h6 small,h4 .small,h4 small,h5 .small,h5 small,h6 .small,h6 small{font-size:75%}.h1,h1{font-size:36px}.h2,h2{font-size:30px}.h3,h3{font-size:24px}.h4,h4{font-size:18px}.h5,h5{font-size:14px}.h6,h6{font-size:12px}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:16px;font-weight:300;line-height:1.4}address,dd,dt{line-height:1.42857}@media (min-width:768px){.lead{font-size:21px}}.small,small{font-size:85%}.mark,mark{background-color:#fcf8e3;padding:.2em}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}.text-justify{text-align:justify}.text-nowrap{white-space:nowrap}.text-lowercase{text-transform:lowercase}.initialism,.text-uppercase{text-transform:uppercase}.text-capitalize{text-transform:capitalize}.text-muted{color:#777}.text-primary{color:#337ab7}a.text-primary:hover{color:#286090}.text-success{color:#3c763d}a.text-success:hover{color:#2b542c}.text-info{color:#31708f}a.text-info:hover{color:#245269}.text-warning{color:#8a6d3b}a.text-warning:hover{color:#66512c}.text-danger{color:#a94442}a.text-danger:hover{color:#843534}.bg-primary{color:#fff;background-color:#337ab7}a.bg-primary:hover{background-color:#286090}.bg-success{background-color:#dff0d8}a.bg-success:hover{background-color:#c1e2b3}.bg-info{background-color:#d9edf7}a.bg-info:hover{background-color:#afd9ee}.bg-warning{background-color:#fcf8e3}a.bg-warning:hover{background-color:#f7ecb5}.bg-danger{background-color:#f2dede}a.bg-danger:hover{background-color:#e4b9b9}.page-header{padding-bottom:9px;margin:40px 0 20px;border-bottom:1px solid #eee}dl,ol,ul{margin-top:0}ol,ul{margin-bottom:10px}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}.list-inline{margin-left:-5px}.list-inline>li{display:inline-block;padding-left:5px;padding-right:5px}dl{margin-bottom:20px}dt{font-weight:700}dd{margin-left:0}.dl-horizontal dd:after,.dl-horizontal dd:before{content:" ";display:table}@media (min-width:768px){.dl-horizontal dt{float:left;width:160px;clear:left;text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}}abbr[data-original-title],abbr[title]{cursor:help;border-bottom:1px dotted #777}.initialism{font-size:90%}blockquote{padding:10px 20px;margin:0 0 20px;font-size:17.5px;border-left:5px solid #eee}blockquote ol:last-child,blockquote p:last-child,blockquote ul:last-child{margin-bottom:0}blockquote .small,blockquote footer,blockquote small{display:block;font-size:80%;line-height:1.42857;color:#777}blockquote .small:before,blockquote footer:before,blockquote small:before{content:'\2014 \00A0'}.blockquote-reverse,blockquote.pull-right{padding-right:15px;padding-left:0;border-right:5px solid #eee;border-left:0;text-align:right}.blockquote-reverse .small:before,.blockquote-reverse footer:before,.blockquote-reverse small:before,blockquote.pull-right .small:before,blockquote.pull-right footer:before,blockquote.pull-right small:before{content:''}.blockquote-reverse .small:after,.blockquote-reverse footer:after,.blockquote-reverse small:after,blockquote.pull-right .small:after,blockquote.pull-right footer:after,blockquote.pull-right small:after{content:'\00A0 \2014'}address{margin-bottom:20px;font-style:normal}.clearfix:after,.clearfix:before{content:" ";display:table}.clearfix:after{clear:both}.center-block{display:block;margin-left:auto;margin-right:auto}.hidden,.visible-lg,.visible-lg-block,.visible-lg-inline,.visible-lg-inline-block,.visible-md,.visible-md-block,.visible-md-inline,.visible-md-inline-block,.visible-sm,.visible-sm-block,.visible-sm-inline,.visible-sm-inline-block,.visible-xs,.visible-xs-block,.visible-xs-inline,.visible-xs-inline-block{display:none!important}.pull-right{float:right!important}.pull-left{float:left!important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.affix{position:fixed}@-ms-viewport{width:device-width}@media (max-width:767px){.visible-xs{display:block!important}table.visible-xs{display:table}tr.visible-xs{display:table-row!important}td.visible-xs,th.visible-xs{display:table-cell!important}.visible-xs-block{display:block!important}.visible-xs-inline{display:inline!important}.visible-xs-inline-block{display:inline-block!important}}@media (min-width:768px)and (max-width:991px){.visible-sm{display:block!important}table.visible-sm{display:table}tr.visible-sm{display:table-row!important}td.visible-sm,th.visible-sm{display:table-cell!important}.visible-sm-block{display:block!important}.visible-sm-inline{display:inline!important}.visible-sm-inline-block{display:inline-block!important}}@media (min-width:992px)and (max-width:1199px){.visible-md{display:block!important}table.visible-md{display:table}tr.visible-md{display:table-row!important}td.visible-md,th.visible-md{display:table-cell!important}.visible-md-block{display:block!important}.visible-md-inline{display:inline!important}.visible-md-inline-block{display:inline-block!important}}@media (min-width:1200px){.visible-lg{display:block!important}table.visible-lg{display:table}tr.visible-lg{display:table-row!important}td.visible-lg,th.visible-lg{display:table-cell!important}.visible-lg-block{display:block!important}.visible-lg-inline{display:inline!important}.visible-lg-inline-block{display:inline-block!important}}@media (max-width:767px){.hidden-xs{display:none!important}}@media (min-width:768px)and (max-width:991px){.hidden-sm{display:none!important}}@media (min-width:992px)and (max-width:1199px){.hidden-md{display:none!important}}@media (min-width:1200px){.hidden-lg{display:none!important}}.visible-print{display:none!important}@media print{.visible-print{display:block!important}table.visible-print{display:table}tr.visible-print{display:table-row!important}td.visible-print,th.visible-print{display:table-cell!important}}.visible-print-block{display:none!important}@media print{.visible-print-block{display:block!important}}.visible-print-inline{display:none!important}@media print{.visible-print-inline{display:inline!important}}.visible-print-inline-block{display:none!important}@media print{.visible-print-inline-block{display:inline-block!important}.hidden-print{display:none!important}}.embed-responsive{position:relative;display:block;height:0;padding:0;overflow:hidden}.embed-responsive .embed-responsive-item,.embed-responsive embed,.embed-responsive iframe,.embed-responsive object,.embed-responsive video{position:absolute;top:0;left:0;bottom:0;height:100%;width:100%;border:0}.embed-responsive-16by9{padding-bottom:56.25%}.embed-responsive-4by3{padding-bottom:75%} | |
3 | 3 | \ No newline at end of file | ... | ... |
index.html
... | ... | @@ -47,49 +47,17 @@ |
47 | 47 | return url; |
48 | 48 | } |
49 | 49 | |
50 | - function loadJavaScriptSync(file_path){ | |
51 | - var head = document.getElementsByTagName('head')[0]; | |
52 | - var script_element = document.createElement('script'); | |
53 | - script_element.type = 'text/javascript'; | |
54 | - var req = new XMLHttpRequest(); | |
55 | - req.open('GET', file_path, false); // 'false': synchronous. | |
56 | - req.send(null); | |
57 | - script_element.text = req.responseText; | |
58 | - head.appendChild(script_element); | |
59 | - } | |
60 | - | |
61 | 50 | function loadJavaScriptAsync(file_path){ |
62 | - var head = document.getElementsByTagName('head')[0]; | |
63 | - var script_element = document.createElement('script'); | |
64 | - script_element.type = 'text/javascript'; | |
65 | - script_element.src = file_path; | |
66 | - head.appendChild(script_element); | |
67 | 51 | } |
68 | 52 | |
69 | - function loadJSFiles(){ | |
70 | - var js_files = [ | |
71 | - 'js/jquery-2.1.3.min.js', | |
72 | - 'js/jquery-ui-1.11.4.custom/jquery-ui.min.js', | |
73 | - 'js/jquery.cookie.js', | |
74 | - 'js/handlebars-v3.0.1.js', | |
75 | - 'js/handlebars-helpers.js', | |
76 | - 'js/jquery.dotdotdot.min.js', | |
77 | - 'js/jquery.maxlength.min.js', | |
78 | - 'js/layout.js', | |
79 | - 'js/main.js' | |
80 | - ]; | |
81 | - | |
82 | - var file_path = ''; | |
83 | - for(i = 0; i < js_files.length; i++){ | |
84 | - file_path = makeJSURL(js_files[i]); | |
85 | - if(file_path.match('layout.js') || file_path.match('main.js')){ | |
86 | - loadJavaScriptAsync(file_path); | |
87 | - }else{ | |
88 | - loadJavaScriptSync(file_path); | |
89 | - } | |
90 | - } | |
53 | + function loadRequireJS(){ | |
54 | + var head = document.getElementsByTagName('head')[0]; | |
55 | + var script_element = document.createElement('script'); | |
56 | + script_element.type = 'text/javascript'; | |
57 | + script_element.src = makeJSURL('js/require.js'); | |
58 | + script_element.setAttribute('data-main', makeJSURL('js/requirejs-config.js')); | |
59 | + head.appendChild(script_element); | |
91 | 60 | } |
92 | - | |
93 | 61 | loadCSSFiles(); |
94 | 62 | </script> |
95 | 63 | |
... | ... | @@ -97,6 +65,7 @@ |
97 | 65 | <body> |
98 | 66 | |
99 | 67 | <div id="proposal-result"></div> |
68 | + <div class="clearfix"></div> | |
100 | 69 | |
101 | 70 | <script id="proposal-template" type="text/x-handlebars-template"> |
102 | 71 | <header> |
... | ... | @@ -105,7 +74,7 @@ |
105 | 74 | </header> |
106 | 75 | |
107 | 76 | <div id="content"> |
108 | - <p>{{{article.body}}}</p> | |
77 | + {{{article.body}}} | |
109 | 78 | </div> |
110 | 79 | |
111 | 80 | <nav role="tabpanel"> |
... | ... | @@ -183,7 +152,9 @@ |
183 | 152 | </div> |
184 | 153 | |
185 | 154 | <div class="body proposal-detail-base hide"> |
186 | - {{{body}}} | |
155 | + <div class='body-content'> | |
156 | + {{{body}}} | |
157 | + </div> | |
187 | 158 | <div class="go-to-proposal-button"> |
188 | 159 | <a href="#/programas/{{id}}" data-target="proposal-item-{{id}}"> |
189 | 160 | <span class="fa fa-reply"></span> |
... | ... | @@ -331,10 +302,11 @@ |
331 | 302 | </form> |
332 | 303 | </script> |
333 | 304 | |
334 | - <script type="text/javascript"> | |
335 | - loadJSFiles(); | |
305 | + <script type='text/javascript' > | |
306 | +loadRequireJS(); | |
336 | 307 | </script> |
337 | 308 | |
309 | + | |
338 | 310 | </body> |
339 | 311 | |
340 | 312 | </html> | ... | ... |
js/handlebars-helpers.js
1 | -Handlebars.registerHelper('link', function(text, url) { | |
2 | - text = Handlebars.Utils.escapeExpression(text); | |
3 | - url = Handlebars.Utils.escapeExpression(url); | |
1 | +define(['handlebars'], function(Handlebars){ | |
4 | 2 | |
5 | - // Exemplo: <a href="#/programas/{{id}}" class="proposal-link" data-target="">{{name}}</a> | |
6 | - var result = '<a href="#/programas/' + url + '" data-target="proposal-item-' + url + '" class="proposal-link">' + text + '</a>'; | |
7 | - | |
8 | - return new Handlebars.SafeString(result); | |
9 | -}); | |
10 | - | |
11 | -Handlebars.registerHelper('list_proposal', function(proposals, options) { | |
12 | - | |
13 | - var ret = ""; | |
14 | - for(var i=0, j=proposals.length; i<j; i++) { | |
15 | - element = "<li class='proposal-item'><div class='item'>"; | |
16 | - category = "<ul class='category'>"; | |
17 | - | |
18 | - var proposal = proposals[i]; | |
19 | - | |
20 | - for(var x=0, y=proposal.categories.length; x<y; x++) { | |
21 | - if((options.hash['category'] != null) && (options.hash['category'] != proposal.categories[x].slug)){ | |
22 | - element = ''; | |
3 | + Handlebars.registerHelper('link', function(text, url) { | |
4 | + text = Handlebars.Utils.escapeExpression(text); | |
5 | + url = Handlebars.Utils.escapeExpression(url); | |
6 | + | |
7 | + // Exemplo: <a href="#/programas/{{id}}" class="proposal-link" data-target="">{{name}}</a> | |
8 | + var result = '<a href="#/programas/' + url + '" data-target="proposal-item-' + url + '" class="proposal-link">' + text + '</a>'; | |
9 | + | |
10 | + return new Handlebars.SafeString(result); | |
11 | + }); | |
12 | + | |
13 | + Handlebars.registerHelper('list_proposal', function(proposals, options) { | |
14 | + | |
15 | + var ret = ""; | |
16 | + for(var i=0, j=proposals.length; i<j; i++) { | |
17 | + var proposal = proposals[i]; | |
18 | + | |
19 | + element = '<li class="proposal-item">' + | |
20 | + '<a href="#/programas/'+proposal.id+'" data-target="proposal-item-'+proposal.id+'" class="proposal-link">' + | |
21 | + '<div class="item">' + | |
22 | + '' + proposal.title; | |
23 | + category = "<ul class='category'>"; | |
24 | + | |
25 | + | |
26 | + for(var x=0, y=proposal.categories.length; x<y; x++) { | |
27 | + if((options.hash['category'] != null) && (options.hash['category'] != proposal.categories[x].slug)){ | |
28 | + element = ''; | |
29 | + continue; | |
30 | + } | |
31 | + category = category + '<li class="category-'+proposal.categories[x].slug+'">' + proposal.categories[x].name + '</li>'; | |
32 | + } | |
33 | + if(element == ''){ | |
23 | 34 | continue; |
24 | - } | |
25 | - category = category + '<li class="category-'+proposal.categories[x].slug+'">' + proposal.categories[x].name + '</li>'; | |
35 | + } | |
36 | + category = category + '</ul>'; | |
37 | + // element = element + options.fn(proposal); | |
38 | + element = element + (proposal.abstract ? proposal.abstract : ''); | |
39 | + | |
40 | + element = element + category; | |
41 | + ret = ret + element + '</div></a></li>'; | |
26 | 42 | } |
27 | - if(element == ''){ | |
28 | - continue; | |
43 | + return ret; | |
44 | + }); | |
45 | + | |
46 | + Handlebars.registerHelper('proposal_detail', function(proposals, options) { | |
47 | + var ret = ""; | |
48 | + for(var i=0, j=proposals.length; i<j; i++) { | |
49 | + ret = ret + "<div class='proposal-detail hide' id='proposal-item-" + proposals[i].id + "'>"; | |
50 | + ret = ret + "<div class='title'>" + proposals[i].title + "</div>"; | |
51 | + ret = ret + "<span>" + proposals[i].body + "</span>"; | |
52 | + ret = ret + '</div>'; | |
29 | 53 | } |
30 | - category = category + '</ul>'; | |
31 | - element = element + options.fn(proposal); | |
32 | - element = element + (proposal.abstract ? proposal.abstract : ''); | |
33 | - | |
34 | - element = element + category; | |
35 | - ret = ret + element + '</div></li>'; | |
36 | - } | |
37 | - return ret; | |
38 | -}); | |
39 | - | |
40 | -Handlebars.registerHelper('proposal_detail', function(proposals, options) { | |
41 | - var ret = ""; | |
42 | - for(var i=0, j=proposals.length; i<j; i++) { | |
43 | - ret = ret + "<div class='proposal-detail hide' id='proposal-item-" + proposals[i].id + "'>"; | |
44 | - ret = ret + "<div class='title'>" + proposals[i].title + "</div>"; | |
45 | - ret = ret + "<span>" + proposals[i].body + "</span>"; | |
46 | - ret = ret + '</div>'; | |
47 | - } | |
48 | - return ret; | |
49 | -}); | |
50 | - | |
51 | -Handlebars.registerHelper('replace', function(string, to_replace, replacement) { | |
52 | - return (string || '').replace(new RegExp(to_replace, 'g'), replacement); | |
53 | -}); | |
54 | - | |
55 | -Handlebars.registerHelper('score', function(article) { | |
56 | - return article.votes_for - article.votes_against; | |
57 | -}); | |
58 | - | |
59 | -Handlebars.registerHelper('select_proposal', function(proposals, category_slug, selected_id) { | |
60 | - var ret = '<label for="proposal-selection" class="sr-only">Selecione o programa</label>' | |
61 | - ret = ret + '<select id="proposal-selection" name="proposal-selection" title="Selecione o programa" class="proposal-selection">'; | |
62 | - | |
63 | - for(var i=0; i<proposals.length; i++) { | |
64 | - if(!proposal_has_category(proposals[i], category_slug)) continue; | |
65 | - var selected = proposals[i].id===selected_id ? "selected" : ""; | |
66 | - ret += '<option value="'+proposals[i].id+'" '+selected+'>'+proposals[i].title+'</option>'; | |
54 | + return ret; | |
55 | + }); | |
56 | + | |
57 | + Handlebars.registerHelper('replace', function(string, to_replace, replacement) { | |
58 | + return (string || '').replace(new RegExp(to_replace, 'g'), replacement); | |
59 | + }); | |
60 | + | |
61 | + Handlebars.registerHelper('score', function(article) { | |
62 | + return article.votes_for - article.votes_against; | |
63 | + }); | |
64 | + | |
65 | + Handlebars.registerHelper('select_proposal', function(proposals, category_slug, selected_id) { | |
66 | + var ret = '<label for="proposal-selection" class="sr-only">Selecione o programa</label>' | |
67 | + ret = ret + '<select id="proposal-selection" name="proposal-selection" title="Selecione o programa" class="proposal-selection">'; | |
68 | + | |
69 | + for(var i=0; i<proposals.length; i++) { | |
70 | + if(!proposal_has_category(proposals[i], category_slug)) continue; | |
71 | + var selected = proposals[i].id===selected_id ? "selected" : ""; | |
72 | + ret += '<option value="'+proposals[i].id+'" '+selected+'>'+proposals[i].title+'</option>'; | |
73 | + } | |
74 | + ret += '</select>'; | |
75 | + return ret; | |
76 | + }); | |
77 | + | |
78 | + Handlebars.registerHelper('trimString', function(passedString, endstring) { | |
79 | + var theString = passedString.substring(0, endstring); | |
80 | + return new Handlebars.SafeString(theString) | |
81 | + }); | |
82 | + | |
83 | + function proposal_has_category(proposal, category_slug) { | |
84 | + for(var i=0; i<proposal.categories.length; i++) { | |
85 | + if(proposal.categories[i].slug == category_slug) | |
86 | + return true; | |
87 | + } | |
88 | + return false; | |
67 | 89 | } |
68 | - ret += '</select>'; | |
69 | - return ret; | |
70 | -}); | |
71 | 90 | |
72 | -Handlebars.registerHelper('trimString', function(passedString, endstring) { | |
73 | - var theString = passedString.substring(0, endstring); | |
74 | - return new Handlebars.SafeString(theString) | |
75 | 91 | }); |
76 | - | |
77 | -function proposal_has_category(proposal, category_slug) { | |
78 | - for(var i=0; i<proposal.categories.length; i++) { | |
79 | - if(proposal.categories[i].slug == category_slug) | |
80 | - return true; | |
81 | - } | |
82 | - return false; | |
83 | -} | ... | ... |
js/main.js
1 | -/* global Handlebars, $ */ | |
2 | -// The template code | |
3 | -var templateSource = document.getElementById('proposal-template').innerHTML; | |
4 | - | |
5 | -// compile the template | |
6 | -var template = Handlebars.compile(templateSource); | |
7 | -var supportProposalTemplate = Handlebars.compile(document.getElementById('support-proposal-template').innerHTML); | |
8 | -var loginTemplate = Handlebars.compile(document.getElementById('login').innerHTML); | |
9 | -var resultsTemplate = Handlebars.compile(document.getElementById('results').innerHTML); | |
10 | - | |
11 | -// The div/container that we are going to display the results in | |
12 | -var resultsPlaceholder = document.getElementById('proposal-result'); | |
13 | - | |
14 | -var logged_in = false; | |
15 | - | |
16 | -var loginButton; | |
17 | - | |
18 | -var participa = true; | |
19 | -if(participa){ | |
20 | - var host = 'http://www.participa.br'; | |
21 | - var private_token = '375bee7e17d0021af7160ce664874618'; //participa | |
22 | - var proposal_discussion = '92856'; //participa | |
23 | -}else{ | |
24 | - var host = 'http://noosfero.com:3000'; | |
25 | - //var private_token = 'bd8996155f5ea4354e42fee50b4b6891'; //casa | |
26 | - var private_token = '04c9b36cf0afba52915fe86f182e741c'; //local serpro | |
27 | - var proposal_discussion = '632'; //local serpro | |
28 | - //var proposal_discussion = '401'; //casa | |
29 | -} | |
30 | - | |
31 | -// Load data from localhost when it is dev env. | |
32 | -var isLocalhost = (window.location.hostname === 'localhost' || window.location.hostname === '0.0.0.0'); | |
33 | -if( isLocalhost ){ | |
34 | - var noosferoAPI = '/data.json'; | |
35 | -} else { | |
36 | - var noosferoAPI = host + '/api/v1/articles/' + proposal_discussion + '?private_token=' + private_token + '&fields=id,children,categories,abstract,body,title,image,url'; | |
37 | -} | |
38 | - | |
39 | -$.getJSON(noosferoAPI) | |
40 | - .done(function( data ) { | |
41 | - data.host = host; | |
42 | - data.private_token = private_token; | |
43 | - resultsPlaceholder.innerHTML = template(data); | |
44 | - $('.login-container').html(loginTemplate()); | |
45 | - $('.countdown').maxlength({text: '%left caracteres restantes'}); | |
46 | - | |
47 | - navigateTo(window.location.hash); | |
48 | - | |
49 | - //Actions for links | |
50 | - $( '#nav-proposal-categories a' ).on('click touchstart', function(e){ | |
51 | - e.preventDefault(); | |
1 | +define(['handlebars'], function(Handlebars){ | |
52 | 2 | |
53 | - var $link = $(this); | |
3 | + /* global Handlebars, $ */ | |
4 | + // The template code | |
5 | + var templateSource = document.getElementById('proposal-template').innerHTML; | |
54 | 6 | |
55 | - // Update URL and Navigate | |
56 | - updateHash($link.attr('href')); | |
57 | - }); | |
7 | + // compile the template | |
8 | + var template = Handlebars.compile(templateSource); | |
9 | + var supportProposalTemplate = Handlebars.compile(document.getElementById('support-proposal-template').innerHTML); | |
10 | + var loginTemplate = Handlebars.compile(document.getElementById('login').innerHTML); | |
11 | + var resultsTemplate = Handlebars.compile(document.getElementById('results').innerHTML); | |
58 | 12 | |
59 | - $( '#nav-proposal-group a' ).on('click touchstart', function(e){ | |
60 | - e.preventDefault(); | |
13 | + // The div/container that we are going to display the results in | |
14 | + var resultsPlaceholder = document.getElementById('proposal-result'); | |
61 | 15 | |
62 | - var $link = $(this); | |
16 | + var logged_in = false; | |
63 | 17 | |
64 | - // Update URL and Navigate | |
65 | - updateHash($link.attr('href')); | |
66 | - }); | |
18 | + var loginButton; | |
67 | 19 | |
68 | - $( '.proposal-item a' ).on('click touchstart', function(e){ | |
69 | - e.preventDefault(); | |
20 | + var participa = true; | |
21 | + if(participa){ | |
22 | + var host = 'http://www.participa.br'; | |
23 | + var private_token = '375bee7e17d0021af7160ce664874618'; //participa | |
24 | + var proposal_discussion = '92856'; //participa | |
25 | + }else{ | |
26 | + var host = 'http://noosfero.com:3000'; | |
27 | + //var private_token = 'bd8996155f5ea4354e42fee50b4b6891'; //casa | |
28 | + var private_token = '04c9b36cf0afba52915fe86f182e741c'; //local serpro | |
29 | + var proposal_discussion = '632'; //local serpro | |
30 | + //var proposal_discussion = '401'; //casa | |
31 | + } | |
70 | 32 | |
71 | - var $link = $(this); | |
33 | + // Load data from localhost when it is dev env. | |
34 | + var noosferoAPI = host + '/api/v1/articles/' + proposal_discussion + '?private_token=' + private_token + '&fields=id,children,categories,abstract,title,image,url'; | |
72 | 35 | |
73 | - // Update URL and Navigate | |
74 | - updateHash($link.attr('href')); | |
75 | - }); | |
36 | + $.getJSON(noosferoAPI) | |
37 | + .done(function( data ) { | |
38 | + data.host = host; | |
39 | + data.private_token = private_token; | |
40 | + resultsPlaceholder.innerHTML = template(data); | |
41 | + $('.login-container').html(loginTemplate()); | |
42 | + $('.countdown').maxlength({text: '%left caracteres restantes'}); | |
76 | 43 | |
77 | - $( '.proposal-category a' ).on('click touchstart', function(e){ | |
78 | - e.preventDefault(); | |
44 | + navigateTo(window.location.hash); | |
79 | 45 | |
80 | - var $link = $(this); | |
46 | + //Actions for links | |
47 | + $( '#nav-proposal-categories a' ).on('click touchstart', function(e){ | |
48 | + e.preventDefault(); | |
81 | 49 | |
82 | - // Update URL and Navigate | |
83 | - updateHash($link.attr('href')); | |
84 | - }); | |
50 | + var $link = $(this); | |
85 | 51 | |
86 | - $( '.proposal-category .go-back' ).on('click touchstart', function(e){ | |
87 | - e.preventDefault(); | |
52 | + // Update URL and Navigate | |
53 | + updateHash($link.attr('href')); | |
54 | + }); | |
88 | 55 | |
89 | - var oldHash = window.location.hash; | |
90 | - var regexSubpages = /sobre-o-programa$/; | |
91 | - var isSubpage = regexSubpages.exec(oldHash) !== null; | |
92 | - var newHash = '#/temas'; // default page | |
56 | + $( '#nav-proposal-group a' ).on('click touchstart', function(e){ | |
57 | + e.preventDefault(); | |
93 | 58 | |
94 | - if(isSubpage){ | |
95 | - // return to proposal page | |
96 | - newHash = oldHash.split('/sobre-o-programa')[0]; | |
97 | - } | |
59 | + var $link = $(this); | |
98 | 60 | |
99 | - // Update URL and Navigate | |
100 | - updateHash(newHash); | |
101 | - }); | |
61 | + // Update URL and Navigate | |
62 | + updateHash($link.attr('href')); | |
63 | + }); | |
102 | 64 | |
103 | - $( '.send-button a' ).on('click touchstart', function(e){ | |
104 | - e.preventDefault(); | |
105 | - | |
106 | - //display form to send proposal (or login form for non-logged users) | |
107 | - var $this = $(this); | |
108 | - loginButton = $this.parents('.send-button'); | |
109 | - loginButton.hide(); | |
110 | - $this.parents('.success-proposal-sent').hide(); | |
111 | - loginCallback(logged_in); | |
112 | - }); | |
65 | + $( '.proposal-item a' ).on('click touchstart', function(e){ | |
66 | + e.preventDefault(); | |
113 | 67 | |
114 | - $( '#display-contrast' ).on('click touchstart', function(e){ | |
115 | - e.preventDefault(); | |
116 | - $('#proposal-result').toggleClass('contrast'); | |
117 | - }); | |
68 | + var $link = $(this); | |
118 | 69 | |
119 | - $( '.show_body a' ).on('click touchstart', function(e){ | |
120 | - e.preventDefault(); | |
70 | + // Update URL and Navigate | |
71 | + updateHash($link.attr('href')); | |
72 | + }); | |
121 | 73 | |
122 | - var $link = $(this); | |
74 | + $( '.proposal-category a' ).on('click touchstart', function(e){ | |
75 | + e.preventDefault(); | |
123 | 76 | |
124 | - // Update URL and Navigate | |
125 | - updateHash($link.attr('href')); | |
126 | - }); | |
77 | + var $link = $(this); | |
127 | 78 | |
128 | - $( '.go-to-proposal-button a' ).on('click touchstart', function(e){ | |
129 | - e.preventDefault(); | |
79 | + // Update URL and Navigate | |
80 | + updateHash($link.attr('href')); | |
81 | + }); | |
130 | 82 | |
131 | - var $link = $(this); | |
83 | + $( '.proposal-category .go-back' ).on('click touchstart', function(e){ | |
84 | + e.preventDefault(); | |
132 | 85 | |
133 | - // Update URL and Navigate | |
134 | - updateHash($link.attr('href')); | |
135 | - }); | |
86 | + var oldHash = window.location.hash; | |
87 | + var regexSubpages = /sobre-o-programa$/; | |
88 | + var isSubpage = regexSubpages.exec(oldHash) !== null; | |
89 | + var newHash = '#/temas'; // default page | |
136 | 90 | |
137 | - $( '.proposal-selection' ).change(function(e){ | |
138 | - e.preventDefault(); | |
91 | + if(isSubpage){ | |
92 | + // return to proposal page | |
93 | + newHash = oldHash.split('/sobre-o-programa')[0]; | |
94 | + } | |
139 | 95 | |
140 | - display_proposal('proposal-item-' + this.value); | |
141 | - }); | |
96 | + // Update URL and Navigate | |
97 | + updateHash(newHash); | |
98 | + }); | |
142 | 99 | |
143 | - var availableTags = [ ]; | |
144 | - $('#proposal-group li a').each(function(){ | |
145 | - availableTags.push({ label: $(this).text(), value: $(this).attr('href')}); | |
146 | - }); | |
100 | + $( '.send-button a' ).on('click touchstart', function(e){ | |
101 | + e.preventDefault(); | |
147 | 102 | |
148 | - $( '#search-input' ).autocomplete({ | |
149 | - source: availableTags, | |
150 | - minLength: 3, | |
151 | - select: function( event, ui ) { | |
152 | - updateHash(ui.item.value); | |
153 | - return false; | |
154 | - }, | |
155 | - appendTo: '#search-input-container', | |
156 | - messages: { | |
157 | - noResults: '', | |
158 | - results: function() {} | |
159 | - } | |
160 | - }); | |
103 | + //display form to send proposal (or login form for non-logged users) | |
104 | + var $this = $(this); | |
105 | + loginButton = $this.parents('.send-button'); | |
106 | + loginButton.hide(); | |
107 | + $this.parents('.success-proposal-sent').hide(); | |
108 | + loginCallback(logged_in); | |
109 | + }); | |
161 | 110 | |
111 | + $( '#display-contrast' ).on('click touchstart', function(e){ | |
112 | + e.preventDefault(); | |
113 | + $('#proposal-result').toggleClass('contrast'); | |
114 | + }); | |
162 | 115 | |
163 | - $('.save-article-form').submit(function (e) { | |
164 | - e.preventDefault(); | |
165 | - var proposal_id = this.id.split('-').pop(); | |
166 | - var form = this; | |
167 | - var $form = $(this); | |
168 | - var message = $(form).find('.message'); | |
169 | - message.hide(); | |
170 | - message.text(''); | |
171 | - $.ajax({ | |
172 | - type: 'post', | |
173 | - url: host + '/api/v1/articles/' + proposal_id + '/children', | |
174 | - data: $('#'+this.id).serialize() + '&private_token=' + private_token + '&fields=id&article[name]=article_' + guid() | |
175 | - }) | |
176 | - .done(function( /*data*/ ) { | |
177 | - form.reset(); | |
178 | - $form.hide(); | |
179 | - $form.siblings('.success-sent').show(); | |
180 | - }) | |
181 | - .fail(function( jqxhr, textStatus, error ) { | |
182 | - var err = textStatus + ', ' + error; | |
183 | - console.log( 'Request Failed: ' + err ); | |
184 | - message.show(); | |
185 | - message.text('Não foi possível enviar.'); | |
186 | - }); | |
187 | - }); | |
116 | + $( '.show_body a' ).on('click touchstart', function(e){ | |
117 | + e.preventDefault(); | |
188 | 118 | |
189 | - }) | |
190 | - .fail(function( jqxhr, textStatus, error ) { | |
191 | - var err = textStatus + ', ' + error; | |
192 | - console.log( 'Request Failed: ' + err ); | |
193 | - }); | |
119 | + var $link = $(this); | |
194 | 120 | |
195 | -function loadRandomProposal(topic_id, private_token) { | |
196 | - var $noProposals = $('.no-proposals'); | |
197 | - var $loading = $('.loading'); | |
198 | - var $randomProposal = $('.random-proposal'); | |
199 | - var $body = $(document.body); | |
200 | - | |
201 | - // reset view | |
202 | - $noProposals.hide(); | |
203 | - $loading.show(); | |
204 | - $randomProposal.html(''); | |
205 | - | |
206 | - var url = host + '/api/v1/articles/' + topic_id + '/children' + '?private_token=' + private_token + '&limit=1&order=random()&_='+new Date().getTime()+'&fields=id,name,abstract,created_by&content_type=ProposalsDiscussionPlugin::Proposal'; | |
207 | - $.getJSON(url).done(function( data ) { | |
208 | - $loading.hide(); | |
209 | - | |
210 | - if(data.articles.length === 0) { | |
211 | - $noProposals.show(); | |
212 | - return; | |
213 | - } | |
121 | + // Update URL and Navigate | |
122 | + updateHash($link.attr('href')); | |
123 | + }); | |
214 | 124 | |
215 | - var article = data.articles[0]; | |
216 | - $randomProposal.html(supportProposalTemplate(article)); | |
217 | - $body.off('click', '.vote-actions .skip'); | |
218 | - $body.on('click', '.vote-actions .skip', function(e) { | |
219 | - loadRandomProposal(topic_id, private_token); | |
220 | - e.preventDefault(); | |
221 | - }); | |
222 | - $body.off('click', '.vote-actions .like'); | |
223 | - $body.on('click', '.vote-actions .like', function(e) { | |
224 | - $.ajax({ | |
225 | - type: 'post', | |
226 | - url: host + '/api/v1/articles/' + article.id + '/vote', | |
227 | - data: { | |
228 | - value: $(this).data('vote-value'), | |
229 | - private_token: private_token | |
125 | + $( '.go-to-proposal-button a' ).on('click touchstart', function(e){ | |
126 | + e.preventDefault(); | |
127 | + | |
128 | + var $link = $(this); | |
129 | + | |
130 | + // Update URL and Navigate | |
131 | + updateHash($link.attr('href')); | |
132 | + }); | |
133 | + | |
134 | + $( '.proposal-selection' ).change(function(e){ | |
135 | + e.preventDefault(); | |
136 | + | |
137 | + display_proposal('proposal-item-' + this.value); | |
138 | + }); | |
139 | + | |
140 | + var availableTags = [ ]; | |
141 | + $('#proposal-group li a').each(function(){ | |
142 | + availableTags.push({ label: $(this).text(), value: $(this).attr('href')}); | |
143 | + }); | |
144 | + | |
145 | + $( '#search-input' ).autocomplete({ | |
146 | + source: availableTags, | |
147 | + minLength: 3, | |
148 | + select: function( event, ui ) { | |
149 | + updateHash(ui.item.value); | |
150 | + return false; | |
151 | + }, | |
152 | + appendTo: '#search-input-container', | |
153 | + messages: { | |
154 | + noResults: '', | |
155 | + results: function() {} | |
230 | 156 | } |
231 | - }).done(function( /*data*/ ) { | |
232 | - loadRandomProposal(topic_id, private_token); | |
233 | 157 | }); |
234 | - e.preventDefault(); | |
158 | + | |
159 | + | |
160 | + $('.save-article-form').submit(function (e) { | |
161 | + e.preventDefault(); | |
162 | + var proposal_id = this.id.split('-').pop(); | |
163 | + var form = this; | |
164 | + var $form = $(this); | |
165 | + var message = $(form).find('.message'); | |
166 | + message.hide(); | |
167 | + message.text(''); | |
168 | + $.ajax({ | |
169 | + type: 'post', | |
170 | + url: host + '/api/v1/articles/' + proposal_id + '/children', | |
171 | + data: $('#'+this.id).serialize() + '&private_token=' + private_token + '&fields=id&article[name]=article_' + guid() | |
172 | + }) | |
173 | + .done(function( /*data*/ ) { | |
174 | + form.reset(); | |
175 | + $form.hide(); | |
176 | + $form.siblings('.success-sent').show(); | |
177 | + }) | |
178 | + .fail(function( jqxhr, textStatus, error ) { | |
179 | + var err = textStatus + ', ' + error; | |
180 | + console.log( 'Request Failed: ' + err ); | |
181 | + message.show(); | |
182 | + message.text('Não foi possível enviar.'); | |
183 | + }); | |
184 | + }); | |
185 | + | |
186 | + }) | |
187 | + .fail(function( jqxhr, textStatus, error ) { | |
188 | + var err = textStatus + ', ' + error; | |
189 | + console.log( 'Request Failed: ' + err ); | |
235 | 190 | }); |
236 | 191 | |
237 | - $body.off('click', '.vote-result'); | |
238 | - $body.on('click', '.vote-result', function(e) { | |
239 | - | |
240 | - var $this = $(this); | |
241 | - var $proposalDetail = $this.parents('.proposal-detail'); | |
242 | - var $resultsContainer = $proposalDetail.find('.results-container'); | |
243 | - | |
244 | - // $resultsContainer.toggle(); | |
245 | - // $resultsContainer.toggleClass('hide'); | |
246 | - | |
247 | - if($resultsContainer.css('display') === 'none') { | |
248 | - | |
249 | - $resultsContainer.find('.loading').show(); | |
250 | - $resultsContainer.find('.results-content').hide(); | |
251 | - | |
252 | - var url = host + '/api/v1/articles/' + topic_id + '/children' + '?private_token=' + private_token + '&limit=10&order=votes_score&fields=id,name,abstract,votes_for,votes_against&content_type=ProposalsDiscussionPlugin::Proposal'; | |
253 | - $.getJSON(url).done(function( data ) { | |
254 | - | |
255 | - $resultsContainer.html(resultsTemplate(data)); | |
256 | - $resultsContainer.find('.loading').hide(); | |
257 | - $resultsContainer.find('.results-content').show(); | |
258 | - $resultsContainer.show(); | |
259 | - | |
260 | - // scroll to the end | |
261 | - $('html, body').animate({ | |
262 | - scrollTop: $(document).height() | |
263 | - }, 'fast'); | |
264 | - }); | |
265 | - $('.experience-proposal-container').hide(); | |
266 | - $('.talk-proposal-container').hide(); | |
267 | - } else { | |
268 | - $('.experience-proposal-container').show(); | |
269 | - $('.talk-proposal-container').show(); | |
270 | - $resultsContainer.hide(); | |
192 | + function loadRandomProposal(topic_id, private_token) { | |
193 | + var $noProposals = $('.no-proposals'); | |
194 | + var $loading = $('.loading'); | |
195 | + var $randomProposal = $('.random-proposal'); | |
196 | + var $body = $(document.body); | |
197 | + | |
198 | + // reset view | |
199 | + $noProposals.hide(); | |
200 | + $loading.show(); | |
201 | + $randomProposal.html(''); | |
202 | + | |
203 | + var url = host + '/api/v1/articles/' + topic_id + '/children' + '?private_token=' + private_token + '&limit=1&order=random()&_='+new Date().getTime()+'&fields=id,name,abstract,created_by&content_type=ProposalsDiscussionPlugin::Proposal'; | |
204 | + $.getJSON(url).done(function( data ) { | |
205 | + $loading.hide(); | |
206 | + | |
207 | + if(data.articles.length === 0) { | |
208 | + $noProposals.show(); | |
209 | + return; | |
271 | 210 | } |
272 | 211 | |
273 | - e.preventDefault(); | |
274 | - }); | |
275 | - }); | |
276 | -} | |
277 | - | |
278 | -$(document).ready(function($) { | |
279 | - if($.cookie('_dialoga_session')) { | |
280 | - var url = host + '/api/v1/users/me?private_token=' + $.cookie('_dialoga_session'); | |
281 | - $.getJSON(url).done(function( /*data*/ ) { | |
282 | - logged_in = true; | |
283 | - private_token = $.cookie('_dialoga_session'); | |
212 | + var article = data.articles[0]; | |
213 | + $randomProposal.html(supportProposalTemplate(article)); | |
214 | + $body.off('click', '.vote-actions .skip'); | |
215 | + $body.on('click', '.vote-actions .skip', function(e) { | |
216 | + loadRandomProposal(topic_id, private_token); | |
217 | + e.preventDefault(); | |
218 | + }); | |
219 | + $body.off('click', '.vote-actions .like'); | |
220 | + $body.on('click', '.vote-actions .like', function(e) { | |
221 | + //Helps to prevent more than one vote per proposal | |
222 | + if(hasProposalbeenVoted(article.id)){ | |
223 | + console.log("Proposta " + article.id + " já havia sido votada"); | |
224 | + loadRandomProposal(topic_id, private_token); | |
225 | + e.preventDefault(); | |
226 | + return; | |
227 | + } | |
228 | + $.ajax({ | |
229 | + type: 'post', | |
230 | + url: host + '/api/v1/articles/' + article.id + '/vote', | |
231 | + data: { | |
232 | + value: $(this).data('vote-value'), | |
233 | + private_token: private_token | |
234 | + } | |
235 | + }).done(function( /*data*/ ) { | |
236 | + addVotedProposal(article.id); | |
237 | + loadRandomProposal(topic_id, private_token); | |
238 | + }); | |
239 | + e.preventDefault(); | |
240 | + }); | |
241 | + | |
242 | + $body.off('click', '.vote-result'); | |
243 | + $body.on('click', '.vote-result', function(e) { | |
244 | + | |
245 | + var $this = $(this); | |
246 | + var $proposalDetail = $this.parents('.proposal-detail'); | |
247 | + var $resultsContainer = $proposalDetail.find('.results-container'); | |
248 | + | |
249 | + // $resultsContainer.toggle(); | |
250 | + // $resultsContainer.toggleClass('hide'); | |
251 | + | |
252 | + if($resultsContainer.css('display') === 'none') { | |
253 | + | |
254 | + $resultsContainer.find('.loading').show(); | |
255 | + $resultsContainer.find('.results-content').hide(); | |
256 | + | |
257 | + var url = host + '/api/v1/articles/' + topic_id + '/children' + '?private_token=' + private_token + '&limit=10&order=votes_score&fields=id,name,abstract,votes_for,votes_against&content_type=ProposalsDiscussionPlugin::Proposal'; | |
258 | + $.getJSON(url).done(function( data ) { | |
259 | + | |
260 | + $resultsContainer.html(resultsTemplate(data)); | |
261 | + $resultsContainer.find('.loading').hide(); | |
262 | + $resultsContainer.find('.results-content').show(); | |
263 | + $resultsContainer.show(); | |
264 | + | |
265 | + // scroll to the end | |
266 | + $('html, body').animate({ | |
267 | + scrollTop: $(document).height() | |
268 | + }, 'fast'); | |
269 | + }); | |
270 | + $('.experience-proposal-container').hide(); | |
271 | + $('.talk-proposal-container').hide(); | |
272 | + } else { | |
273 | + $('.experience-proposal-container').show(); | |
274 | + $('.talk-proposal-container').show(); | |
275 | + $resultsContainer.hide(); | |
276 | + } | |
277 | + | |
278 | + e.preventDefault(); | |
279 | + }); | |
284 | 280 | }); |
285 | 281 | } |
286 | 282 | |
287 | - $(document).on('click', '.login-action', function(e) { | |
288 | - var message = $('.login .message'); | |
289 | - message.hide(); | |
290 | - message.text(''); | |
291 | - $.ajax({ | |
292 | - type: 'post', | |
293 | - url: host + '/api/v1/login', | |
294 | - data: $(this).parents('.login').serialize(), | |
295 | - xhrFields: { | |
296 | - //withCredentials: true | |
297 | - } | |
298 | - }).done(function(data) { | |
299 | - loginCallback(true, data.private_token); | |
300 | - }).fail(function( /*data*/ ) { | |
301 | - message.show(); | |
302 | - message.text('Não foi possível logar'); | |
283 | + $(document).ready(function($) { | |
284 | + if($.cookie('_dialoga_session')) { | |
285 | + var url = host + '/api/v1/users/me?private_token=' + $.cookie('_dialoga_session'); | |
286 | + $.getJSON(url).done(function( /*data*/ ) { | |
287 | + logged_in = true; | |
288 | + private_token = $.cookie('_dialoga_session'); | |
289 | + }); | |
290 | + } | |
291 | + | |
292 | + $(document).on('click', '.login-action', function(e) { | |
293 | + var message = $('.login .message'); | |
294 | + message.hide(); | |
295 | + message.text(''); | |
296 | + $.ajax({ | |
297 | + type: 'post', | |
298 | + url: host + '/api/v1/login', | |
299 | + data: $(this).parents('.login').serialize(), | |
300 | + xhrFields: { | |
301 | + //withCredentials: true | |
302 | + } | |
303 | + }).done(function(data) { | |
304 | + loginCallback(true, data.private_token); | |
305 | + }).fail(function( /*data*/ ) { | |
306 | + message.show(); | |
307 | + message.text('Não foi possível logar'); | |
308 | + }); | |
309 | + e.preventDefault(); | |
303 | 310 | }); |
304 | - e.preventDefault(); | |
305 | 311 | }); |
306 | -}); | |
307 | 312 | |
308 | -function loginCallback(loggedIn, token) { | |
309 | - logged_in = loggedIn; | |
310 | - $('.login .message').text(''); | |
313 | + function loginCallback(loggedIn, token) { | |
314 | + logged_in = loggedIn; | |
315 | + $('.login .message').text(''); | |
311 | 316 | |
312 | - if(logged_in) { | |
313 | - if(token){ | |
314 | - private_token = token; | |
317 | + if(logged_in) { | |
318 | + if(token){ | |
319 | + private_token = token; | |
320 | + } | |
321 | + loginButton.siblings('.save-article-form').show(); | |
322 | + loginButton.siblings('.save-article-form .message').show(); | |
323 | + loginButton.siblings('.login-container').hide(); | |
324 | + $.cookie('_dialoga_session', private_token); | |
325 | + } else { | |
326 | + loginButton.siblings('.save-article-form').hide(); | |
327 | + loginButton.siblings('.login-container').show(); | |
315 | 328 | } |
316 | - loginButton.siblings('.save-article-form').show(); | |
317 | - loginButton.siblings('.save-article-form .message').show(); | |
318 | - loginButton.siblings('.login-container').hide(); | |
319 | - $.cookie('_dialoga_session', private_token); | |
320 | - } else { | |
321 | - loginButton.siblings('.save-article-form').hide(); | |
322 | - loginButton.siblings('.login-container').show(); | |
323 | 329 | } |
324 | -} | |
325 | 330 | |
326 | -// function oauthPluginHandleLoginResult(loggedIn, token) { | |
327 | -// loginCallback(loggedIn, token); | |
328 | -// } | |
331 | + function oauthPluginHandleLoginResult(loggedIn, token) { | |
332 | + loginCallback(loggedIn, token); | |
333 | + } | |
329 | 334 | |
330 | -function guid() { | |
331 | - function s4() { | |
332 | - return Math.floor((1 + Math.random()) * 0x10000) | |
333 | - .toString(16) | |
334 | - .substring(1); | |
335 | + function guid() { | |
336 | + function s4() { | |
337 | + return Math.floor((1 + Math.random()) * 0x10000) | |
338 | + .toString(16) | |
339 | + .substring(1); | |
340 | + } | |
335 | 341 | } |
336 | - return s4() + s4() + '-' + s4() + '-' + s4() + '-' + | |
337 | - s4() + '-' + s4() + s4() + s4(); | |
338 | -} | |
339 | - | |
340 | -function display_category_tab(){ | |
341 | - $('#proposal-group').hide(); | |
342 | - $('#proposal-categories').show(); | |
343 | - $('#nav-proposal-categories a').addClass('active'); | |
344 | - $('#nav-proposal-group a').removeClass('active'); | |
345 | - $('.proposal-category-items').hide(); | |
346 | - $('.proposal-category .arrow-box').hide(); | |
347 | - $('.proposal-detail').hide(); | |
348 | - | |
349 | - $('#content').show(); | |
350 | - $('nav').show(); | |
351 | -} | |
352 | - | |
353 | -function display_proposals_tab(){ | |
354 | - $('#proposal-categories').hide(); | |
355 | - $('#proposal-group').show(); | |
356 | - $('#nav-proposal-group a').addClass('active'); | |
357 | - $('#nav-proposal-categories a').removeClass('active'); | |
358 | - $('.proposal-item p').dotdotdot(); | |
359 | - | |
360 | - $('#content').show(); | |
361 | - $('nav').show(); | |
362 | -} | |
363 | - | |
364 | -function display_proposal(proposal_id){ | |
365 | - $('#proposal-categories').hide(); | |
366 | - $('#proposal-group').hide(); | |
367 | - $('nav').hide(); | |
368 | - $('#content').hide(); | |
369 | - $('.make-proposal-form').hide(); | |
370 | - $('.login-container').hide(); | |
371 | - $('.proposal-detail').hide(); | |
372 | - | |
373 | - $('.proposal-detail-base').hide(); | |
374 | - $('#' + proposal_id).show(); | |
375 | - $('.proposal-header').show(); | |
376 | - $('.make-proposal-container').show(); | |
377 | - $('.support-proposal-container').show(); | |
378 | - $('.results-container').hide(); | |
379 | - $('.results-container .loading').hide(); | |
380 | - $('.results-container .results-content').hide(); | |
381 | - $('.experience-proposal-container').show(); | |
382 | - $('.talk-proposal-container').show(); | |
383 | - | |
384 | - var topic_id = proposal_id.split('-').pop(); | |
385 | - loadRandomProposal(topic_id, private_token); | |
386 | -} | |
387 | - | |
388 | -function display_proposal_detail(){ | |
389 | - $('#proposal-categories').hide(); | |
390 | - $('#proposal-group').hide(); | |
391 | - $('nav').hide(); | |
392 | - $('#content').hide(); | |
393 | - $('.make-proposal-form').hide(); | |
394 | - $('.proposal-header').hide(); | |
395 | - $('.make-proposal-container').hide(); | |
396 | - $('.support-proposal-container').hide(); | |
397 | - $('.results-container').hide(); | |
398 | - $('.experience-proposal-container').hide(); | |
399 | - $('.talk-proposal-container').hide(); | |
400 | - | |
401 | - $('.body').show(); | |
402 | -} | |
403 | - | |
404 | -function display_proposal_by_category(item){ | |
405 | - var $item = $('#' + item); | |
406 | - | |
407 | - if($item.hasClass('proposal-category-items')){ | |
408 | - //Display Topics or Discussion by category | |
409 | - $('nav').show(); | |
410 | - $('#content').show(); | |
342 | + | |
343 | + function display_category_tab(){ | |
344 | + $('#proposal-group').hide(); | |
411 | 345 | $('#proposal-categories').show(); |
412 | 346 | $('#nav-proposal-categories a').addClass('active'); |
413 | 347 | $('#nav-proposal-group a').removeClass('active'); |
414 | 348 | $('.proposal-category-items').hide(); |
349 | + $('.proposal-category .arrow-box').hide(); | |
415 | 350 | $('.proposal-detail').hide(); |
416 | - $item.toggle( 'blind', 1000 ); | |
351 | + | |
352 | + $('#content').show(); | |
353 | + $('nav').show(); | |
354 | + } | |
355 | + | |
356 | + function display_proposals_tab(){ | |
357 | + $('#proposal-categories').hide(); | |
358 | + $('#proposal-group').show(); | |
359 | + $('#nav-proposal-group a').addClass('active'); | |
360 | + $('#nav-proposal-categories a').removeClass('active'); | |
417 | 361 | $('.proposal-item p').dotdotdot(); |
418 | - $('.proposal-category .arrow-box').hide(); | |
419 | - var categorySlug = $item.data('category'); | |
420 | - $('#proposal-category-' + categorySlug).find('.arrow-box').show(); | |
362 | + | |
363 | + $('#content').show(); | |
364 | + $('nav').show(); | |
421 | 365 | } |
422 | -} | |
423 | 366 | |
424 | -function updateHash(hash){ | |
425 | - var id = hash.replace(/^.*#/, ''); | |
426 | - var elem = document.getElementById(id); | |
367 | + function display_proposal(proposal_id){ | |
368 | + $('#proposal-categories').hide(); | |
369 | + $('#proposal-group').hide(); | |
370 | + $('nav').hide(); | |
371 | + $('#content').hide(); | |
372 | + $('.make-proposal-form').hide(); | |
373 | + $('.login-container').hide(); | |
374 | + $('.proposal-detail').hide(); | |
427 | 375 | |
428 | - if ( !elem ) { | |
429 | - window.location.hash = hash; | |
430 | - return; | |
376 | + $('.proposal-detail-base').hide(); | |
377 | + $('#' + proposal_id).show(); | |
378 | + $('.proposal-header').show(); | |
379 | + $('.make-proposal-container').show(); | |
380 | + $('.support-proposal-container').show(); | |
381 | + $('.results-container').hide(); | |
382 | + $('.results-container .loading').hide(); | |
383 | + $('.results-container .results-content').hide(); | |
384 | + $('.experience-proposal-container').show(); | |
385 | + $('.talk-proposal-container').show(); | |
386 | + | |
387 | + var topic_id = proposal_id.split('-').pop(); | |
388 | + loadRandomProposal(topic_id, private_token); | |
431 | 389 | } |
432 | 390 | |
433 | - elem.id = id+'-tmp'; | |
434 | - window.location.hash = hash; | |
435 | - elem.id = id; | |
436 | -} | |
437 | - | |
438 | -function locationHashChanged(){ | |
439 | - var hash = location.hash; | |
440 | - navigateTo(hash); | |
441 | -} | |
442 | - | |
443 | -function navigateTo(hash){ | |
444 | - var regexProposals = /#\/programas/; | |
445 | - var regexCategory = /#\/temas/; | |
446 | - var parts = hash.split('/'); | |
447 | - | |
448 | - var isProposal = regexProposals.exec(hash) !== null; | |
449 | - var isCategory = regexCategory.exec(hash) !== null; | |
450 | - | |
451 | - if( isProposal ){ | |
452 | - | |
453 | - // go to proposal | |
454 | - var proposalId = parts[2]; | |
455 | - navigateToProposal(proposalId); | |
391 | + function display_proposal_detail(proposal_id){ | |
392 | + $('#proposal-categories').hide(); | |
393 | + $('#proposal-group').hide(); | |
394 | + $('nav').hide(); | |
395 | + $('#content').hide(); | |
396 | + $('.make-proposal-form').hide(); | |
397 | + $('.proposal-header').hide(); | |
398 | + $('.make-proposal-container').hide(); | |
399 | + $('.support-proposal-container').hide(); | |
400 | + $('.results-container').hide(); | |
401 | + $('.experience-proposal-container').hide(); | |
402 | + $('.talk-proposal-container').hide(); | |
403 | + $('.body').show(); | |
404 | + | |
405 | + var url = host + '/api/v1/articles/' + proposal_id + '?private_token=' + private_token + '&fields=id,body&content_type=ProposalsDiscussionPlugin::Topic'; | |
406 | + $.getJSON(url).done(function( data ) { | |
407 | + $('.body-content').replaceWith(data.article.body); | |
408 | + }) | |
409 | + .fail(function( jqxhr, textStatus, error ) { | |
410 | + var err = textStatus + ', ' + error; | |
411 | + console.log( 'Request Failed: ' + err ); | |
412 | + }); | |
413 | + } | |
414 | + function display_proposal_by_category(item){ | |
415 | + var $item = $('#' + item); | |
416 | + | |
417 | + if($item.hasClass('proposal-category-items')){ | |
418 | + //Display Topics or Discussion by category | |
419 | + $('nav').show(); | |
420 | + $('#content').show(); | |
421 | + $('#proposal-categories').show(); | |
422 | + $('#nav-proposal-categories a').addClass('active'); | |
423 | + $('#nav-proposal-group a').removeClass('active'); | |
424 | + $('.proposal-category-items').hide(); | |
425 | + $('.proposal-detail').hide(); | |
426 | + $item.toggle( 'blind', 1000 ); | |
427 | + $('.proposal-item p').dotdotdot(); | |
428 | + $('.proposal-category .arrow-box').hide(); | |
429 | + var categorySlug = $item.data('category'); | |
430 | + $('#proposal-category-' + categorySlug).find('.arrow-box').show(); | |
431 | + } | |
456 | 432 | } |
457 | 433 | |
458 | - if( isCategory ){ | |
434 | + var BARRA_ADDED = false; | |
435 | + function addBarraDoGoverno(){ | |
459 | 436 | |
460 | - // go to category | |
461 | - var categoryId = parts[3]; | |
462 | - navigateToCategory(categoryId); | |
437 | + if( BARRA_ADDED ) { return; } | |
438 | + | |
439 | + var HTML_BODY_PREPEND = '' + | |
440 | + '<div id="barra-brasil" style="background:#7F7F7F; height: 20px; padding:0 0 0 10px;display:block;"> ' + | |
441 | + '<ul id="menu-barra-temp" style="list-style:none;">' + | |
442 | + '<li style="display:inline; float:left;padding-right:10px; margin-right:10px; border-right:1px solid #EDEDED"><a href="http://brasil.gov.br" style="font-family:sans,sans-serif; text-decoration:none; color:white;">Portal do Governo Brasileiro</a></li> ' + | |
443 | + '<li><a style="font-family:sans,sans-serif; text-decoration:none; color:white;" href="http://epwg.governoeletronico.gov.br/barra/atualize.html">Atualize sua Barra de Governo</a></li>' + | |
444 | + '</ul>' + | |
445 | + '</div>'; | |
446 | + | |
447 | + var HTML_BODY_APPEND = ''+ | |
448 | + '<div id="footer-brasil"></div>' + | |
449 | + '<script defer="defer" src="http://barra.brasil.gov.br/barra.js" type="text/javascript"></script>'; | |
450 | + | |
451 | + var STYLE_TEMA_AZUL = '' + | |
452 | + '<style>'+ | |
453 | + '#footer-brasil {'+ | |
454 | + 'background: none repeat scroll 0% 0% #0042b1;'+ | |
455 | + 'padding: 1em 0px;'+ | |
456 | + 'max-width: 100%;'+ | |
457 | + 'margin-top: 40px;'+ | |
458 | + '}'+ | |
459 | + '#barra-brasil ul {'+ | |
460 | + 'width: auto;'+ | |
461 | + '}'+ | |
462 | + '<style>'; | |
463 | + | |
464 | + var $body = $(document.body); | |
465 | + $body.prepend(HTML_BODY_PREPEND); | |
466 | + $body.append(HTML_BODY_APPEND); | |
467 | + $body.append(STYLE_TEMA_AZUL); | |
468 | + | |
469 | + BARRA_ADDED = true; | |
463 | 470 | } |
464 | 471 | |
465 | - // default | |
466 | - if( !isProposal && !isCategory ){ | |
467 | - // show the 'index' -> category tab | |
468 | - display_category_tab(); | |
472 | + function updateHash(hash){ | |
473 | + var id = hash.replace(/^.*#/, ''); | |
474 | + var elem = document.getElementById(id); | |
475 | + | |
476 | + // preserve the query param | |
477 | + // if (HIDE_BARRA_DO_GOVERNO && (hash.indexOf('?barra=false') === -1)){ | |
478 | + // hash += '?barra=false'; | |
479 | + // } | |
480 | + | |
481 | + if ( !elem ) { | |
482 | + window.location.hash = hash; | |
483 | + return; | |
484 | + } | |
485 | + | |
486 | + elem.id = id+'-tmp'; | |
487 | + window.location.hash = hash; | |
488 | + elem.id = id; | |
469 | 489 | } |
470 | 490 | |
471 | - $('html, body').animate({ scrollTop: 0 }, 'fast'); | |
472 | -} | |
491 | + function locationHashChanged(){ | |
492 | + var hash = window.location.hash; | |
493 | + navigateTo(hash); | |
494 | + } | |
473 | 495 | |
474 | -function navigateToProposal(proposalId){ | |
475 | - if(proposalId === undefined){ | |
476 | - display_proposals_tab(); | |
477 | - }else{ | |
478 | - display_proposal('proposal-item-' + proposalId); | |
496 | + var HIDE_BARRA_DO_GOVERNO = false; | |
497 | + function navigateTo(hash){ | |
498 | + var regexProposals = /#\/programas/; | |
499 | + var regexCategory = /#\/temas/; | |
500 | + var regexHideBarra = /barra=false$/; | |
501 | + | |
502 | + if( !(regexHideBarra.exec(hash) !== null) && !HIDE_BARRA_DO_GOVERNO ){ | |
503 | + addBarraDoGoverno(); | |
504 | + }else{ | |
505 | + HIDE_BARRA_DO_GOVERNO = true; | |
506 | + } | |
507 | + | |
508 | + // remove query params | |
509 | + hash = hash.split('?')[0]; | |
510 | + | |
511 | + var parts = hash.split('/'); | |
512 | + | |
513 | + var isProposal = regexProposals.exec(hash) !== null; | |
514 | + var isCategory = regexCategory.exec(hash) !== null; | |
515 | + | |
516 | + if( isProposal ){ | |
517 | + | |
518 | + // go to proposal | |
519 | + var proposalId = parts[2]; | |
520 | + navigateToProposal(proposalId); | |
521 | + } | |
522 | + | |
523 | + if( isCategory ){ | |
524 | + | |
525 | + // go to category | |
526 | + var categoryId = parts[3]; | |
527 | + navigateToCategory(categoryId); | |
528 | + } | |
529 | + | |
530 | + // default | |
531 | + if( !isProposal && !isCategory ){ | |
532 | + // show the 'index' -> category tab | |
533 | + display_category_tab(); | |
534 | + } | |
535 | + | |
536 | + $('html, body').animate({ scrollTop: 0 }, 'fast'); | |
537 | + } | |
538 | + | |
539 | + function navigateToProposal(proposalId){ | |
540 | + if(proposalId === undefined){ | |
541 | + display_proposals_tab(); | |
542 | + }else{ | |
543 | + display_proposal('proposal-item-' + proposalId); | |
544 | + | |
545 | + // show sub-page | |
546 | + var regexSubpages = /sobre-o-programa$/; | |
547 | + var m; | |
548 | + if((m = regexSubpages.exec(window.location.hash)) !== null ){ | |
549 | + display_proposal_detail(proposalId); | |
550 | + } | |
551 | + } | |
552 | + } | |
553 | + | |
554 | + function navigateToCategory(categoryId){ | |
555 | + if(categoryId === undefined){ | |
556 | + display_category_tab(); | |
557 | + }else{ | |
558 | + display_proposal_by_category('proposal-item-' + categoryId); | |
559 | + } | |
560 | + } | |
561 | + | |
562 | + function addVotedProposal(id) { | |
563 | + var votedProposals; | |
564 | + if (typeof($.cookie("votedProposals")) == "undefined"){ | |
565 | + votedProposals = []; | |
566 | + } | |
567 | + else{ | |
568 | + votedProposals = JSON.parse($.cookie("votedProposals")); | |
569 | + } | |
570 | + if (votedProposals.indexOf(id)==-1){ | |
571 | + votedProposals.push(id); | |
572 | + } | |
573 | + $.cookie("votedProposals", JSON.stringify(votedProposals), {expires : 999 }) ; | |
574 | + } | |
479 | 575 | |
480 | - // show sub-page | |
481 | - var regexSubpages = /sobre-o-programa$/; | |
482 | - var m; | |
483 | - if((m = regexSubpages.exec(window.location.hash)) !== null ){ | |
484 | - display_proposal_detail(); | |
576 | + function hasProposalbeenVoted(id) { | |
577 | + if (typeof($.cookie("votedProposals")) == "undefined") { | |
578 | + return false; | |
485 | 579 | } |
580 | + votedProposals = JSON.parse($.cookie("votedProposals")); | |
581 | + return votedProposals.indexOf(id)!=-1; | |
486 | 582 | } |
487 | -} | |
488 | 583 | |
489 | -function navigateToCategory(categoryId){ | |
490 | - if(categoryId === undefined){ | |
491 | - display_category_tab(); | |
584 | + if('onhashchange' in window){ | |
585 | + window.onhashchange = locationHashChanged; | |
492 | 586 | }else{ |
493 | - display_proposal_by_category('proposal-item-' + categoryId); | |
587 | + console.log('The browser not supports the hashchange event!'); | |
494 | 588 | } |
495 | -} | |
496 | 589 | |
497 | -if('onhashchange' in window){ | |
498 | - window.onhashchange = locationHashChanged; | |
499 | -}else{ | |
500 | - console.log('The browser not supports the hashchange event!'); | |
501 | -} | |
590 | +}); | ... | ... |
... | ... | @@ -0,0 +1,36 @@ |
1 | +/* | |
2 | + RequireJS 2.1.17 Copyright (c) 2010-2015, The Dojo Foundation All Rights Reserved. | |
3 | + Available via the MIT or new BSD license. | |
4 | + see: http://github.com/jrburke/requirejs for details | |
5 | +*/ | |
6 | +var requirejs,require,define; | |
7 | +(function(ba){function G(b){return"[object Function]"===K.call(b)}function H(b){return"[object Array]"===K.call(b)}function v(b,c){if(b){var d;for(d=0;d<b.length&&(!b[d]||!c(b[d],d,b));d+=1);}}function T(b,c){if(b){var d;for(d=b.length-1;-1<d&&(!b[d]||!c(b[d],d,b));d-=1);}}function t(b,c){return fa.call(b,c)}function m(b,c){return t(b,c)&&b[c]}function B(b,c){for(var d in b)if(t(b,d)&&c(b[d],d))break}function U(b,c,d,e){c&&B(c,function(c,g){if(d||!t(b,g))e&&"object"===typeof c&&c&&!H(c)&&!G(c)&&!(c instanceof | |
8 | +RegExp)?(b[g]||(b[g]={}),U(b[g],c,d,e)):b[g]=c});return b}function u(b,c){return function(){return c.apply(b,arguments)}}function ca(b){throw b;}function da(b){if(!b)return b;var c=ba;v(b.split("."),function(b){c=c[b]});return c}function C(b,c,d,e){c=Error(c+"\nhttp://requirejs.org/docs/errors.html#"+b);c.requireType=b;c.requireModules=e;d&&(c.originalError=d);return c}function ga(b){function c(a,k,b){var f,l,c,d,e,g,i,p,k=k&&k.split("/"),h=j.map,n=h&&h["*"];if(a){a=a.split("/");l=a.length-1;j.nodeIdCompat&& | |
9 | +Q.test(a[l])&&(a[l]=a[l].replace(Q,""));"."===a[0].charAt(0)&&k&&(l=k.slice(0,k.length-1),a=l.concat(a));l=a;for(c=0;c<l.length;c++)if(d=l[c],"."===d)l.splice(c,1),c-=1;else if(".."===d&&!(0===c||1===c&&".."===l[2]||".."===l[c-1])&&0<c)l.splice(c-1,2),c-=2;a=a.join("/")}if(b&&h&&(k||n)){l=a.split("/");c=l.length;a:for(;0<c;c-=1){e=l.slice(0,c).join("/");if(k)for(d=k.length;0<d;d-=1)if(b=m(h,k.slice(0,d).join("/")))if(b=m(b,e)){f=b;g=c;break a}!i&&(n&&m(n,e))&&(i=m(n,e),p=c)}!f&&i&&(f=i,g=p);f&&(l.splice(0, | |
10 | +g,f),a=l.join("/"))}return(f=m(j.pkgs,a))?f:a}function d(a){z&&v(document.getElementsByTagName("script"),function(k){if(k.getAttribute("data-requiremodule")===a&&k.getAttribute("data-requirecontext")===i.contextName)return k.parentNode.removeChild(k),!0})}function e(a){var k=m(j.paths,a);if(k&&H(k)&&1<k.length)return k.shift(),i.require.undef(a),i.makeRequire(null,{skipMap:!0})([a]),!0}function n(a){var k,c=a?a.indexOf("!"):-1;-1<c&&(k=a.substring(0,c),a=a.substring(c+1,a.length));return[k,a]}function p(a, | |
11 | +k,b,f){var l,d,e=null,g=k?k.name:null,j=a,p=!0,h="";a||(p=!1,a="_@r"+(K+=1));a=n(a);e=a[0];a=a[1];e&&(e=c(e,g,f),d=m(r,e));a&&(e?h=d&&d.normalize?d.normalize(a,function(a){return c(a,g,f)}):-1===a.indexOf("!")?c(a,g,f):a:(h=c(a,g,f),a=n(h),e=a[0],h=a[1],b=!0,l=i.nameToUrl(h)));b=e&&!d&&!b?"_unnormalized"+(O+=1):"";return{prefix:e,name:h,parentMap:k,unnormalized:!!b,url:l,originalName:j,isDefine:p,id:(e?e+"!"+h:h)+b}}function s(a){var k=a.id,b=m(h,k);b||(b=h[k]=new i.Module(a));return b}function q(a, | |
12 | +k,b){var f=a.id,c=m(h,f);if(t(r,f)&&(!c||c.defineEmitComplete))"defined"===k&&b(r[f]);else if(c=s(a),c.error&&"error"===k)b(c.error);else c.on(k,b)}function w(a,b){var c=a.requireModules,f=!1;if(b)b(a);else if(v(c,function(b){if(b=m(h,b))b.error=a,b.events.error&&(f=!0,b.emit("error",a))}),!f)g.onError(a)}function x(){R.length&&(ha.apply(A,[A.length,0].concat(R)),R=[])}function y(a){delete h[a];delete V[a]}function F(a,b,c){var f=a.map.id;a.error?a.emit("error",a.error):(b[f]=!0,v(a.depMaps,function(f, | |
13 | +d){var e=f.id,g=m(h,e);g&&(!a.depMatched[d]&&!c[e])&&(m(b,e)?(a.defineDep(d,r[e]),a.check()):F(g,b,c))}),c[f]=!0)}function D(){var a,b,c=(a=1E3*j.waitSeconds)&&i.startTime+a<(new Date).getTime(),f=[],l=[],g=!1,h=!0;if(!W){W=!0;B(V,function(a){var i=a.map,j=i.id;if(a.enabled&&(i.isDefine||l.push(a),!a.error))if(!a.inited&&c)e(j)?g=b=!0:(f.push(j),d(j));else if(!a.inited&&(a.fetched&&i.isDefine)&&(g=!0,!i.prefix))return h=!1});if(c&&f.length)return a=C("timeout","Load timeout for modules: "+f,null, | |
14 | +f),a.contextName=i.contextName,w(a);h&&v(l,function(a){F(a,{},{})});if((!c||b)&&g)if((z||ea)&&!X)X=setTimeout(function(){X=0;D()},50);W=!1}}function E(a){t(r,a[0])||s(p(a[0],null,!0)).init(a[1],a[2])}function I(a){var a=a.currentTarget||a.srcElement,b=i.onScriptLoad;a.detachEvent&&!Y?a.detachEvent("onreadystatechange",b):a.removeEventListener("load",b,!1);b=i.onScriptError;(!a.detachEvent||Y)&&a.removeEventListener("error",b,!1);return{node:a,id:a&&a.getAttribute("data-requiremodule")}}function J(){var a; | |
15 | +for(x();A.length;){a=A.shift();if(null===a[0])return w(C("mismatch","Mismatched anonymous define() module: "+a[a.length-1]));E(a)}}var W,Z,i,L,X,j={waitSeconds:7,baseUrl:"./",paths:{},bundles:{},pkgs:{},shim:{},config:{}},h={},V={},$={},A=[],r={},S={},aa={},K=1,O=1;L={require:function(a){return a.require?a.require:a.require=i.makeRequire(a.map)},exports:function(a){a.usingExports=!0;if(a.map.isDefine)return a.exports?r[a.map.id]=a.exports:a.exports=r[a.map.id]={}},module:function(a){return a.module? | |
16 | +a.module:a.module={id:a.map.id,uri:a.map.url,config:function(){return m(j.config,a.map.id)||{}},exports:a.exports||(a.exports={})}}};Z=function(a){this.events=m($,a.id)||{};this.map=a;this.shim=m(j.shim,a.id);this.depExports=[];this.depMaps=[];this.depMatched=[];this.pluginMaps={};this.depCount=0};Z.prototype={init:function(a,b,c,f){f=f||{};if(!this.inited){this.factory=b;if(c)this.on("error",c);else this.events.error&&(c=u(this,function(a){this.emit("error",a)}));this.depMaps=a&&a.slice(0);this.errback= | |
17 | +c;this.inited=!0;this.ignore=f.ignore;f.enabled||this.enabled?this.enable():this.check()}},defineDep:function(a,b){this.depMatched[a]||(this.depMatched[a]=!0,this.depCount-=1,this.depExports[a]=b)},fetch:function(){if(!this.fetched){this.fetched=!0;i.startTime=(new Date).getTime();var a=this.map;if(this.shim)i.makeRequire(this.map,{enableBuildCallback:!0})(this.shim.deps||[],u(this,function(){return a.prefix?this.callPlugin():this.load()}));else return a.prefix?this.callPlugin():this.load()}},load:function(){var a= | |
18 | +this.map.url;S[a]||(S[a]=!0,i.load(this.map.id,a))},check:function(){if(this.enabled&&!this.enabling){var a,b,c=this.map.id;b=this.depExports;var f=this.exports,l=this.factory;if(this.inited)if(this.error)this.emit("error",this.error);else{if(!this.defining){this.defining=!0;if(1>this.depCount&&!this.defined){if(G(l)){if(this.events.error&&this.map.isDefine||g.onError!==ca)try{f=i.execCb(c,l,b,f)}catch(d){a=d}else f=i.execCb(c,l,b,f);this.map.isDefine&&void 0===f&&((b=this.module)?f=b.exports:this.usingExports&& | |
19 | +(f=this.exports));if(a)return a.requireMap=this.map,a.requireModules=this.map.isDefine?[this.map.id]:null,a.requireType=this.map.isDefine?"define":"require",w(this.error=a)}else f=l;this.exports=f;if(this.map.isDefine&&!this.ignore&&(r[c]=f,g.onResourceLoad))g.onResourceLoad(i,this.map,this.depMaps);y(c);this.defined=!0}this.defining=!1;this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0)}}else this.fetch()}},callPlugin:function(){var a= | |
20 | +this.map,b=a.id,d=p(a.prefix);this.depMaps.push(d);q(d,"defined",u(this,function(f){var l,d;d=m(aa,this.map.id);var e=this.map.name,P=this.map.parentMap?this.map.parentMap.name:null,n=i.makeRequire(a.parentMap,{enableBuildCallback:!0});if(this.map.unnormalized){if(f.normalize&&(e=f.normalize(e,function(a){return c(a,P,!0)})||""),f=p(a.prefix+"!"+e,this.map.parentMap),q(f,"defined",u(this,function(a){this.init([],function(){return a},null,{enabled:!0,ignore:!0})})),d=m(h,f.id)){this.depMaps.push(f); | |
21 | +if(this.events.error)d.on("error",u(this,function(a){this.emit("error",a)}));d.enable()}}else d?(this.map.url=i.nameToUrl(d),this.load()):(l=u(this,function(a){this.init([],function(){return a},null,{enabled:!0})}),l.error=u(this,function(a){this.inited=!0;this.error=a;a.requireModules=[b];B(h,function(a){0===a.map.id.indexOf(b+"_unnormalized")&&y(a.map.id)});w(a)}),l.fromText=u(this,function(f,c){var d=a.name,e=p(d),P=M;c&&(f=c);P&&(M=!1);s(e);t(j.config,b)&&(j.config[d]=j.config[b]);try{g.exec(f)}catch(h){return w(C("fromtexteval", | |
22 | +"fromText eval for "+b+" failed: "+h,h,[b]))}P&&(M=!0);this.depMaps.push(e);i.completeLoad(d);n([d],l)}),f.load(a.name,n,l,j))}));i.enable(d,this);this.pluginMaps[d.id]=d},enable:function(){V[this.map.id]=this;this.enabling=this.enabled=!0;v(this.depMaps,u(this,function(a,b){var c,f;if("string"===typeof a){a=p(a,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap);this.depMaps[b]=a;if(c=m(L,a.id)){this.depExports[b]=c(this);return}this.depCount+=1;q(a,"defined",u(this,function(a){this.defineDep(b, | |
23 | +a);this.check()}));this.errback?q(a,"error",u(this,this.errback)):this.events.error&&q(a,"error",u(this,function(a){this.emit("error",a)}))}c=a.id;f=h[c];!t(L,c)&&(f&&!f.enabled)&&i.enable(a,this)}));B(this.pluginMaps,u(this,function(a){var b=m(h,a.id);b&&!b.enabled&&i.enable(a,this)}));this.enabling=!1;this.check()},on:function(a,b){var c=this.events[a];c||(c=this.events[a]=[]);c.push(b)},emit:function(a,b){v(this.events[a],function(a){a(b)});"error"===a&&delete this.events[a]}};i={config:j,contextName:b, | |
24 | +registry:h,defined:r,urlFetched:S,defQueue:A,Module:Z,makeModuleMap:p,nextTick:g.nextTick,onError:w,configure:function(a){a.baseUrl&&"/"!==a.baseUrl.charAt(a.baseUrl.length-1)&&(a.baseUrl+="/");var b=j.shim,c={paths:!0,bundles:!0,config:!0,map:!0};B(a,function(a,b){c[b]?(j[b]||(j[b]={}),U(j[b],a,!0,!0)):j[b]=a});a.bundles&&B(a.bundles,function(a,b){v(a,function(a){a!==b&&(aa[a]=b)})});a.shim&&(B(a.shim,function(a,c){H(a)&&(a={deps:a});if((a.exports||a.init)&&!a.exportsFn)a.exportsFn=i.makeShimExports(a); | |
25 | +b[c]=a}),j.shim=b);a.packages&&v(a.packages,function(a){var b,a="string"===typeof a?{name:a}:a;b=a.name;a.location&&(j.paths[b]=a.location);j.pkgs[b]=a.name+"/"+(a.main||"main").replace(ia,"").replace(Q,"")});B(h,function(a,b){!a.inited&&!a.map.unnormalized&&(a.map=p(b))});if(a.deps||a.callback)i.require(a.deps||[],a.callback)},makeShimExports:function(a){return function(){var b;a.init&&(b=a.init.apply(ba,arguments));return b||a.exports&&da(a.exports)}},makeRequire:function(a,e){function j(c,d,m){var n, | |
26 | +q;e.enableBuildCallback&&(d&&G(d))&&(d.__requireJsBuild=!0);if("string"===typeof c){if(G(d))return w(C("requireargs","Invalid require call"),m);if(a&&t(L,c))return L[c](h[a.id]);if(g.get)return g.get(i,c,a,j);n=p(c,a,!1,!0);n=n.id;return!t(r,n)?w(C("notloaded",'Module name "'+n+'" has not been loaded yet for context: '+b+(a?"":". Use require([])"))):r[n]}J();i.nextTick(function(){J();q=s(p(null,a));q.skipMap=e.skipMap;q.init(c,d,m,{enabled:!0});D()});return j}e=e||{};U(j,{isBrowser:z,toUrl:function(b){var d, | |
27 | +e=b.lastIndexOf("."),k=b.split("/")[0];if(-1!==e&&(!("."===k||".."===k)||1<e))d=b.substring(e,b.length),b=b.substring(0,e);return i.nameToUrl(c(b,a&&a.id,!0),d,!0)},defined:function(b){return t(r,p(b,a,!1,!0).id)},specified:function(b){b=p(b,a,!1,!0).id;return t(r,b)||t(h,b)}});a||(j.undef=function(b){x();var c=p(b,a,!0),e=m(h,b);d(b);delete r[b];delete S[c.url];delete $[b];T(A,function(a,c){a[0]===b&&A.splice(c,1)});e&&(e.events.defined&&($[b]=e.events),y(b))});return j},enable:function(a){m(h,a.id)&& | |
28 | +s(a).enable()},completeLoad:function(a){var b,c,d=m(j.shim,a)||{},g=d.exports;for(x();A.length;){c=A.shift();if(null===c[0]){c[0]=a;if(b)break;b=!0}else c[0]===a&&(b=!0);E(c)}c=m(h,a);if(!b&&!t(r,a)&&c&&!c.inited){if(j.enforceDefine&&(!g||!da(g)))return e(a)?void 0:w(C("nodefine","No define call for "+a,null,[a]));E([a,d.deps||[],d.exportsFn])}D()},nameToUrl:function(a,b,c){var d,e,h;(d=m(j.pkgs,a))&&(a=d);if(d=m(aa,a))return i.nameToUrl(d,b,c);if(g.jsExtRegExp.test(a))d=a+(b||"");else{d=j.paths; | |
29 | +a=a.split("/");for(e=a.length;0<e;e-=1)if(h=a.slice(0,e).join("/"),h=m(d,h)){H(h)&&(h=h[0]);a.splice(0,e,h);break}d=a.join("/");d+=b||(/^data\:|\?/.test(d)||c?"":".js");d=("/"===d.charAt(0)||d.match(/^[\w\+\.\-]+:/)?"":j.baseUrl)+d}return j.urlArgs?d+((-1===d.indexOf("?")?"?":"&")+j.urlArgs):d},load:function(a,b){g.load(i,a,b)},execCb:function(a,b,c,d){return b.apply(d,c)},onScriptLoad:function(a){if("load"===a.type||ja.test((a.currentTarget||a.srcElement).readyState))N=null,a=I(a),i.completeLoad(a.id)}, | |
30 | +onScriptError:function(a){var b=I(a);if(!e(b.id))return w(C("scripterror","Script error for: "+b.id,a,[b.id]))}};i.require=i.makeRequire();return i}var g,x,y,D,I,E,N,J,s,O,ka=/(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,la=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,Q=/\.js$/,ia=/^\.\//;x=Object.prototype;var K=x.toString,fa=x.hasOwnProperty,ha=Array.prototype.splice,z=!!("undefined"!==typeof window&&"undefined"!==typeof navigator&&window.document),ea=!z&&"undefined"!==typeof importScripts,ja= | |
31 | +z&&"PLAYSTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/,Y="undefined"!==typeof opera&&"[object Opera]"===opera.toString(),F={},q={},R=[],M=!1;if("undefined"===typeof define){if("undefined"!==typeof requirejs){if(G(requirejs))return;q=requirejs;requirejs=void 0}"undefined"!==typeof require&&!G(require)&&(q=require,require=void 0);g=requirejs=function(b,c,d,e){var n,p="_";!H(b)&&"string"!==typeof b&&(n=b,H(c)?(b=c,c=d,d=e):b=[]);n&&n.context&&(p=n.context);(e=m(F,p))||(e=F[p]=g.s.newContext(p)); | |
32 | +n&&e.configure(n);return e.require(b,c,d)};g.config=function(b){return g(b)};g.nextTick="undefined"!==typeof setTimeout?function(b){setTimeout(b,4)}:function(b){b()};require||(require=g);g.version="2.1.17";g.jsExtRegExp=/^\/|:|\?|\.js$/;g.isBrowser=z;x=g.s={contexts:F,newContext:ga};g({});v(["toUrl","undef","defined","specified"],function(b){g[b]=function(){var c=F._;return c.require[b].apply(c,arguments)}});if(z&&(y=x.head=document.getElementsByTagName("head")[0],D=document.getElementsByTagName("base")[0]))y= | |
33 | +x.head=D.parentNode;g.onError=ca;g.createNode=function(b){var c=b.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:script"):document.createElement("script");c.type=b.scriptType||"text/javascript";c.charset="utf-8";c.async=!0;return c};g.load=function(b,c,d){var e=b&&b.config||{};if(z)return e=g.createNode(e,c,d),e.setAttribute("data-requirecontext",b.contextName),e.setAttribute("data-requiremodule",c),e.attachEvent&&!(e.attachEvent.toString&&0>e.attachEvent.toString().indexOf("[native code"))&& | |
34 | +!Y?(M=!0,e.attachEvent("onreadystatechange",b.onScriptLoad)):(e.addEventListener("load",b.onScriptLoad,!1),e.addEventListener("error",b.onScriptError,!1)),e.src=d,J=e,D?y.insertBefore(e,D):y.appendChild(e),J=null,e;if(ea)try{importScripts(d),b.completeLoad(c)}catch(m){b.onError(C("importscripts","importScripts failed for "+c+" at "+d,m,[c]))}};z&&!q.skipDataMain&&T(document.getElementsByTagName("script"),function(b){y||(y=b.parentNode);if(I=b.getAttribute("data-main"))return s=I,q.baseUrl||(E=s.split("/"), | |
35 | +s=E.pop(),O=E.length?E.join("/")+"/":"./",q.baseUrl=O),s=s.replace(Q,""),g.jsExtRegExp.test(s)&&(s=I),q.deps=q.deps?q.deps.concat(s):[s],!0});define=function(b,c,d){var e,g;"string"!==typeof b&&(d=c,c=b,b=null);H(c)||(d=c,c=null);!c&&G(d)&&(c=[],d.length&&(d.toString().replace(ka,"").replace(la,function(b,d){c.push(d)}),c=(1===d.length?["require"]:["require","exports","module"]).concat(c)));if(M){if(!(e=J))N&&"interactive"===N.readyState||T(document.getElementsByTagName("script"),function(b){if("interactive"=== | |
36 | +b.readyState)return N=b}),e=N;e&&(b||(b=e.getAttribute("data-requiremodule")),g=F[e.getAttribute("data-requirecontext")])}(g?g.defQueue:R).push([b,c,d])};define.amd={jQuery:!0};g.exec=function(b){return eval(b)};g(q)}})(this); | ... | ... |
... | ... | @@ -0,0 +1,49 @@ |
1 | +var base = window.location.href; | |
2 | +var host = window.location.host; | |
3 | +var regex = new RegExp(".*" + host + '/', "g"); | |
4 | + | |
5 | +if(host){ | |
6 | + base = base.replace(regex,''); | |
7 | +}else{ | |
8 | + base = base.replace('index.html',''); | |
9 | +} | |
10 | +base = removeUrlParameters(base); | |
11 | + | |
12 | +requirejs.config({ | |
13 | + baseUrl: ( base + '/js/'), | |
14 | + paths: { | |
15 | + jquery: 'jquery-2.1.3.min', | |
16 | + jquery_ui: 'jquery-ui-1.11.4.custom/jquery-ui.min', | |
17 | + jquery_cookie: 'jquery.cookie', | |
18 | + handlebars: 'handlebars-v3.0.1', | |
19 | + handlebars_helpers: 'handlebars-helpers', | |
20 | + dotdotdot: 'jquery.dotdotdot.min', | |
21 | + jquery_maxlength: 'jquery.maxlength.min', | |
22 | + layout: 'layout', | |
23 | + main: 'main' | |
24 | + }, | |
25 | + shim: { | |
26 | + 'handlebars':{ | |
27 | + deps: ['jquery'], | |
28 | + exports: 'Handlebars' | |
29 | + }, | |
30 | + 'jquery_ui': { | |
31 | + deps: ['jquery'] | |
32 | + }, | |
33 | + 'dotdotdot': { | |
34 | + deps: ['jquery'] | |
35 | + }, | |
36 | + 'layout': { | |
37 | + deps: ['jquery'] | |
38 | + }, | |
39 | + 'jquery_maxlength': { | |
40 | + deps: ['jquery'] | |
41 | + }, | |
42 | + 'handlebars_helpers':{ | |
43 | + deps: ['handlebars'] | |
44 | + } | |
45 | + } | |
46 | +}); | |
47 | + | |
48 | +requirejs(['jquery', 'jquery_ui', 'jquery_cookie', 'handlebars', 'handlebars_helpers']); | |
49 | +requirejs(['dotdotdot', 'jquery_maxlength', 'layout', 'main']); | ... | ... |
sass/_proposal_categories.scss
... | ... | @@ -86,12 +86,18 @@ |
86 | 86 | |
87 | 87 | .proposal-item { |
88 | 88 | width: 48%; |
89 | - min-height: 200px; | |
89 | + // min-height: 200px; | |
90 | 90 | margin: 0.5%; |
91 | 91 | background: #fff; |
92 | 92 | border-radius: 5px; |
93 | 93 | vertical-align: top; |
94 | 94 | border: 1px solid #03316f; |
95 | + .proposal-link { | |
96 | + min-height: 200px; | |
97 | + p { | |
98 | + font-weight: 400; | |
99 | + } | |
100 | + } | |
95 | 101 | } |
96 | 102 | |
97 | 103 | .proposal-item:hover { |
... | ... | @@ -184,6 +190,9 @@ |
184 | 190 | p, .description, label, .info, h2 small{ |
185 | 191 | font-size: 18px !important; |
186 | 192 | } |
193 | + .bloco-destaque { | |
194 | + background-image: url("transparent"); | |
195 | + } | |
187 | 196 | } |
188 | 197 | @media only screen and (max-width: 630px) { |
189 | 198 | .proposal-detail .categories select{ |
... | ... | @@ -195,4 +204,7 @@ |
195 | 204 | .proposal-item { |
196 | 205 | width: 95% !important; |
197 | 206 | } |
207 | + .bloco-destaque { | |
208 | + background-image: none !important; | |
209 | + } | |
198 | 210 | } | ... | ... |
sass/_proposal_detail.scss
sass/proposal_detail/mais-medicos.scss
1 | -.proposal-detail-base | |
1 | +.proposal-detail-base { | |
2 | 2 | .bloco-destaque { |
3 | 3 | background-image: url("http://www.participa.br/articles/public/0009/6039/mais-medicos-foto4.png"); |
4 | 4 | background-repeat: no-repeat; |
... | ... | @@ -19,4 +19,5 @@ |
19 | 19 | font-size: 38px; |
20 | 20 | color: #172938; |
21 | 21 | text-transform: none; |
22 | - } | |
23 | 22 | \ No newline at end of file |
23 | + } | |
24 | +} | |
24 | 25 | \ No newline at end of file | ... | ... |
sass/style.scss
... | ... | @@ -13,6 +13,9 @@ |
13 | 13 | @import 'proposal_detail/urgencia-e-emergencia'; |
14 | 14 | @import 'proposal_detail/mais-medicos'; |
15 | 15 | |
16 | +// Prevent text size change on orientation change. | |
17 | +html { -webkit-text-size-adjust: 100%; } | |
18 | + | |
16 | 19 | html, body { |
17 | 20 | margin: 0; |
18 | 21 | padding: 0; |
... | ... | @@ -45,15 +48,17 @@ h1 { |
45 | 48 | |
46 | 49 | #content { |
47 | 50 | padding-bottom: 50px; |
48 | - /*background: transparent url(./images/header.png) center bottom no-repeat;*/ | |
49 | 51 | p { |
52 | + | |
53 | + text-align: justify; | |
54 | + margin: 20px; | |
55 | + line-height: 1.5em; | |
56 | + font-size: 1.2em; | |
57 | + | |
50 | 58 | font{ |
51 | 59 | weight: lighter; |
52 | 60 | size: 14px; |
53 | 61 | } |
54 | - text-align: justify; | |
55 | - margin: 20px; | |
56 | - line-height: 1.5em; | |
57 | 62 | } |
58 | 63 | } |
59 | 64 | |
... | ... | @@ -131,4 +136,11 @@ form { |
131 | 136 | |
132 | 137 | .ui-helper-hidden-accessible{ |
133 | 138 | display: none; |
139 | +} | |
140 | + | |
141 | +// shame hack for issue #72 | |
142 | +@media (max-width: 992px) { | |
143 | + .col-md-6 > img { | |
144 | + margin-bottom: 20px; | |
145 | + } | |
134 | 146 | } |
135 | 147 | \ No newline at end of file | ... | ... |