├── .gitignore ├── images ├── Thumbs.db ├── blank.gif ├── select.png ├── slider.png ├── select2.png ├── custom_hex.png ├── custom_hsb_b.png ├── custom_hsb_h.png ├── custom_hsb_s.png ├── custom_indic.gif ├── custom_rgb_b.png ├── custom_rgb_g.png ├── custom_rgb_r.png ├── custom_submit.png ├── colorpicker_hex.png ├── colorpicker_hsb_b.png ├── colorpicker_hsb_h.png ├── colorpicker_hsb_s.png ├── colorpicker_indic.gif ├── colorpicker_overlay.png ├── colorpicker_rgb_b.png ├── colorpicker_rgb_g.png ├── colorpicker_rgb_r.png ├── colorpicker_select.gif ├── colorpicker_submit.png ├── custom_background.png └── colorpicker_background.png ├── img ├── glyphicons-halflings.png └── glyphicons-halflings-white.png ├── css ├── app.css ├── colorpicker.css └── bootstrap-responsive.css ├── README.md ├── index.html └── js ├── colorpicker.js ├── app.js ├── bootstrap.js └── jquery.js /.gitignore: -------------------------------------------------------------------------------- 1 | *~ -------------------------------------------------------------------------------- /images/Thumbs.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/destan/github-label-manager/HEAD/images/Thumbs.db -------------------------------------------------------------------------------- /images/blank.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/destan/github-label-manager/HEAD/images/blank.gif -------------------------------------------------------------------------------- /images/select.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/destan/github-label-manager/HEAD/images/select.png -------------------------------------------------------------------------------- /images/slider.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/destan/github-label-manager/HEAD/images/slider.png -------------------------------------------------------------------------------- /images/select2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/destan/github-label-manager/HEAD/images/select2.png -------------------------------------------------------------------------------- /images/custom_hex.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/destan/github-label-manager/HEAD/images/custom_hex.png -------------------------------------------------------------------------------- /images/custom_hsb_b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/destan/github-label-manager/HEAD/images/custom_hsb_b.png -------------------------------------------------------------------------------- /images/custom_hsb_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/destan/github-label-manager/HEAD/images/custom_hsb_h.png -------------------------------------------------------------------------------- /images/custom_hsb_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/destan/github-label-manager/HEAD/images/custom_hsb_s.png -------------------------------------------------------------------------------- /images/custom_indic.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/destan/github-label-manager/HEAD/images/custom_indic.gif -------------------------------------------------------------------------------- /images/custom_rgb_b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/destan/github-label-manager/HEAD/images/custom_rgb_b.png -------------------------------------------------------------------------------- /images/custom_rgb_g.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/destan/github-label-manager/HEAD/images/custom_rgb_g.png -------------------------------------------------------------------------------- /images/custom_rgb_r.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/destan/github-label-manager/HEAD/images/custom_rgb_r.png -------------------------------------------------------------------------------- /images/custom_submit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/destan/github-label-manager/HEAD/images/custom_submit.png -------------------------------------------------------------------------------- /images/colorpicker_hex.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/destan/github-label-manager/HEAD/images/colorpicker_hex.png -------------------------------------------------------------------------------- /images/colorpicker_hsb_b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/destan/github-label-manager/HEAD/images/colorpicker_hsb_b.png -------------------------------------------------------------------------------- /images/colorpicker_hsb_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/destan/github-label-manager/HEAD/images/colorpicker_hsb_h.png -------------------------------------------------------------------------------- /images/colorpicker_hsb_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/destan/github-label-manager/HEAD/images/colorpicker_hsb_s.png -------------------------------------------------------------------------------- /images/colorpicker_indic.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/destan/github-label-manager/HEAD/images/colorpicker_indic.gif -------------------------------------------------------------------------------- /images/colorpicker_overlay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/destan/github-label-manager/HEAD/images/colorpicker_overlay.png -------------------------------------------------------------------------------- /images/colorpicker_rgb_b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/destan/github-label-manager/HEAD/images/colorpicker_rgb_b.png -------------------------------------------------------------------------------- /images/colorpicker_rgb_g.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/destan/github-label-manager/HEAD/images/colorpicker_rgb_g.png -------------------------------------------------------------------------------- /images/colorpicker_rgb_r.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/destan/github-label-manager/HEAD/images/colorpicker_rgb_r.png -------------------------------------------------------------------------------- /images/colorpicker_select.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/destan/github-label-manager/HEAD/images/colorpicker_select.gif -------------------------------------------------------------------------------- /images/colorpicker_submit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/destan/github-label-manager/HEAD/images/colorpicker_submit.png -------------------------------------------------------------------------------- /images/custom_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/destan/github-label-manager/HEAD/images/custom_background.png -------------------------------------------------------------------------------- /img/glyphicons-halflings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/destan/github-label-manager/HEAD/img/glyphicons-halflings.png -------------------------------------------------------------------------------- /images/colorpicker_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/destan/github-label-manager/HEAD/images/colorpicker_background.png -------------------------------------------------------------------------------- /img/glyphicons-halflings-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/destan/github-label-manager/HEAD/img/glyphicons-halflings-white.png -------------------------------------------------------------------------------- /css/app.css: -------------------------------------------------------------------------------- 1 | body{ 2 | background-color: #fcfcfc; 3 | } 4 | 5 | .color-box input[type="text"]{ 6 | color: whitesmoke; 7 | } 8 | 9 | .label-entry{ 10 | padding-bottom: 10px; 11 | } 12 | 13 | .hidden{ 14 | display: none; 15 | } 16 | 17 | .deleted{ 18 | position: relative; 19 | top: 17px; 20 | border-color: #666; 21 | width: 300px; 22 | margin: 0; 23 | z-index: 1; 24 | } 25 | 26 | .uncommited:before{ 27 | content: "* "; 28 | margin-left: -9px; 29 | float: left; 30 | } 31 | 32 | #content{ 33 | margin-top: 60px; 34 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | github-label-manager 2 | ==================== 3 | 4 | See *help* section on http://destan.github.com/github-label-manager 5 | 6 | License 7 | ======= 8 | GPLv3 9 | 10 | github-label-manager is free software: you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 3 of the License, or 13 | (at your option) any later version. 14 | 15 | github-label-manager is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with github-label-manager. If not, see . -------------------------------------------------------------------------------- /css/colorpicker.css: -------------------------------------------------------------------------------- 1 | .colorpicker input{ 2 | width: auto; 3 | outline-color: none; 4 | } 5 | 6 | .colorpicker input:focus{ 7 | outline: 0; 8 | } 9 | 10 | .colorpicker { 11 | width: 356px; 12 | height: 176px; 13 | overflow: hidden; 14 | position: absolute; 15 | background: url(../images/colorpicker_background.png); 16 | font-family: Arial, Helvetica, sans-serif; 17 | display: none; 18 | z-index: 2; 19 | } 20 | .colorpicker_color { 21 | width: 150px; 22 | height: 150px; 23 | left: 14px; 24 | top: 13px; 25 | position: absolute; 26 | background: #f00; 27 | overflow: hidden; 28 | cursor: crosshair; 29 | } 30 | .colorpicker_color div { 31 | position: absolute; 32 | top: 0; 33 | left: 0; 34 | width: 150px; 35 | height: 150px; 36 | background: url(../images/colorpicker_overlay.png); 37 | } 38 | .colorpicker_color div div { 39 | position: absolute; 40 | top: 0; 41 | left: 0; 42 | width: 11px; 43 | height: 11px; 44 | overflow: hidden; 45 | background: url(../images/colorpicker_select.gif); 46 | margin: -5px 0 0 -5px; 47 | } 48 | .colorpicker_hue { 49 | position: absolute; 50 | top: 13px; 51 | left: 171px; 52 | width: 35px; 53 | height: 150px; 54 | cursor: n-resize; 55 | } 56 | .colorpicker_hue div { 57 | position: absolute; 58 | width: 35px; 59 | height: 9px; 60 | overflow: hidden; 61 | background: url(../images/colorpicker_indic.gif) left top; 62 | margin: -4px 0 0 0; 63 | left: 0px; 64 | } 65 | .colorpicker_new_color { 66 | position: absolute; 67 | width: 60px; 68 | height: 30px; 69 | left: 213px; 70 | top: 13px; 71 | background: #f00; 72 | } 73 | .colorpicker_current_color { 74 | position: absolute; 75 | width: 60px; 76 | height: 30px; 77 | left: 283px; 78 | top: 13px; 79 | background: #f00; 80 | } 81 | .colorpicker input { 82 | background-color: transparent; 83 | border: 1px solid transparent; 84 | position: absolute; 85 | font-size: 10px; 86 | font-family: Arial, Helvetica, sans-serif; 87 | color: #898989; 88 | top: 4px; 89 | right: 11px; 90 | text-align: right; 91 | margin: 0; 92 | padding: 0; 93 | height: 11px; 94 | } 95 | .colorpicker_hex { 96 | position: absolute; 97 | width: 72px; 98 | height: 22px; 99 | background: url(../images/colorpicker_hex.png) top; 100 | left: 212px; 101 | top: 142px; 102 | } 103 | .colorpicker_hex input { 104 | right: 6px; 105 | } 106 | .colorpicker_field { 107 | height: 22px; 108 | width: 62px; 109 | background-position: top; 110 | position: absolute; 111 | } 112 | .colorpicker_field span { 113 | position: absolute; 114 | width: 12px; 115 | height: 22px; 116 | overflow: hidden; 117 | top: 0; 118 | right: 0; 119 | cursor: n-resize; 120 | } 121 | .colorpicker_rgb_r { 122 | background-image: url(../images/colorpicker_rgb_r.png); 123 | top: 52px; 124 | left: 212px; 125 | } 126 | .colorpicker_rgb_g { 127 | background-image: url(../images/colorpicker_rgb_g.png); 128 | top: 82px; 129 | left: 212px; 130 | } 131 | .colorpicker_rgb_b { 132 | background-image: url(../images/colorpicker_rgb_b.png); 133 | top: 112px; 134 | left: 212px; 135 | } 136 | .colorpicker_hsb_h { 137 | background-image: url(../images/colorpicker_hsb_h.png); 138 | top: 52px; 139 | left: 282px; 140 | } 141 | .colorpicker_hsb_s { 142 | background-image: url(../images/colorpicker_hsb_s.png); 143 | top: 82px; 144 | left: 282px; 145 | } 146 | .colorpicker_hsb_b { 147 | background-image: url(../images/colorpicker_hsb_b.png); 148 | top: 112px; 149 | left: 282px; 150 | } 151 | .colorpicker_submit { 152 | position: absolute; 153 | width: 22px; 154 | height: 22px; 155 | background: url(../images/colorpicker_submit.png) top; 156 | left: 322px; 157 | top: 142px; 158 | overflow: hidden; 159 | } 160 | .colorpicker_focus { 161 | background-position: center; 162 | } 163 | .colorpicker_hex.colorpicker_focus { 164 | background-position: bottom; 165 | } 166 | .colorpicker_submit.colorpicker_focus { 167 | background-position: bottom; 168 | } 169 | .colorpicker_slider { 170 | background-position: bottom; 171 | } 172 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 | 20 | 21 | 22 | Github Label Manager 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 37 | 38 | 39 | 40 | 41 | Fork me on GitHub 42 | 51 | 52 |
53 | 54 |
55 |
56 | 57 | Manage your Github labels 58 |
59 | 60 | 65 | 66 | 67 | 68 |
69 | 70 |
71 | 72 | You can apply any repository's labels and then change them to meet your needs then apply to your own repository. 73 |
74 |
75 | 76 | 77 | Can be any repo, no password required for copying. 78 |
79 |
80 |
81 | 82 | 83 | 84 |
85 | 86 |
87 | Which repo is in use 88 |
Not using any yet!
89 |
90 |
91 | 92 |
93 | Labels 94 |
95 | 96 | 97 |
98 | 99 |
100 | Help 101 |

Preface

102 |

First of all, this website works by making cross-site requests to Github's api api.github.com 103 | and there is no other call is made to anywhere else.

104 | You can download this website, it also works offline. 105 |


106 | 107 |
108 |
109 | 114 |
115 |
116 | There is not much validation and error prevention so you should check your changes before commiting.
117 | Unprocessable Entity usually means that you tried to commit a duplicate label name or leave something empty. 118 |
119 |
120 |
121 | 122 |
123 | 128 |
129 |
130 | This website authenticates to Github api via HTTP Basic Authentication but all api calls are done over SSL so your password is safe. More on Wikipedia. 131 |
132 | Note that your password is only sent to Github and and sent encrypted. 133 |
134 |
135 |
136 | 137 |
138 | 139 |
140 |
141 |
142 |
143 |
144 | 145 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 161 | 162 | 186 | 187 | 188 | -------------------------------------------------------------------------------- /css/bootstrap-responsive.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap Responsive v2.2.2 3 | * 4 | * Copyright 2012 Twitter, Inc 5 | * Licensed under the Apache License v2.0 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Designed and built with all the love in the world @twitter by @mdo and @fat. 9 | */@-ms-viewport{width:device-width}.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;line-height:0;content:""}.clearfix:after{clear:both}.hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.input-block-level{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.hidden{display:none;visibility:hidden}.visible-phone{display:none!important}.visible-tablet{display:none!important}.hidden-desktop{display:none!important}.visible-desktop{display:inherit!important}@media(min-width:768px) and (max-width:979px){.hidden-desktop{display:inherit!important}.visible-desktop{display:none!important}.visible-tablet{display:inherit!important}.hidden-tablet{display:none!important}}@media(max-width:767px){.hidden-desktop{display:inherit!important}.visible-desktop{display:none!important}.visible-phone{display:inherit!important}.hidden-phone{display:none!important}}@media(min-width:1200px){.row{margin-left:-30px;*zoom:1}.row:before,.row:after{display:table;line-height:0;content:""}.row:after{clear:both}[class*="span"]{float:left;min-height:1px;margin-left:30px}.container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:1170px}.span12{width:1170px}.span11{width:1070px}.span10{width:970px}.span9{width:870px}.span8{width:770px}.span7{width:670px}.span6{width:570px}.span5{width:470px}.span4{width:370px}.span3{width:270px}.span2{width:170px}.span1{width:70px}.offset12{margin-left:1230px}.offset11{margin-left:1130px}.offset10{margin-left:1030px}.offset9{margin-left:930px}.offset8{margin-left:830px}.offset7{margin-left:730px}.offset6{margin-left:630px}.offset5{margin-left:530px}.offset4{margin-left:430px}.offset3{margin-left:330px}.offset2{margin-left:230px}.offset1{margin-left:130px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;line-height:0;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;float:left;width:100%;min-height:30px;margin-left:2.564102564102564%;*margin-left:2.5109110747408616%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .controls-row [class*="span"]+[class*="span"]{margin-left:2.564102564102564%}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:91.45299145299145%;*width:91.39979996362975%}.row-fluid .span10{width:82.90598290598291%;*width:82.8527914166212%}.row-fluid .span9{width:74.35897435897436%;*width:74.30578286961266%}.row-fluid .span8{width:65.81196581196582%;*width:65.75877432260411%}.row-fluid .span7{width:57.26495726495726%;*width:57.21176577559556%}.row-fluid .span6{width:48.717948717948715%;*width:48.664757228587014%}.row-fluid .span5{width:40.17094017094017%;*width:40.11774868157847%}.row-fluid .span4{width:31.623931623931625%;*width:31.570740134569924%}.row-fluid .span3{width:23.076923076923077%;*width:23.023731587561375%}.row-fluid .span2{width:14.52991452991453%;*width:14.476723040552828%}.row-fluid .span1{width:5.982905982905983%;*width:5.929714493544281%}.row-fluid .offset12{margin-left:105.12820512820512%;*margin-left:105.02182214948171%}.row-fluid .offset12:first-child{margin-left:102.56410256410257%;*margin-left:102.45771958537915%}.row-fluid .offset11{margin-left:96.58119658119658%;*margin-left:96.47481360247316%}.row-fluid .offset11:first-child{margin-left:94.01709401709402%;*margin-left:93.91071103837061%}.row-fluid .offset10{margin-left:88.03418803418803%;*margin-left:87.92780505546462%}.row-fluid .offset10:first-child{margin-left:85.47008547008548%;*margin-left:85.36370249136206%}.row-fluid .offset9{margin-left:79.48717948717949%;*margin-left:79.38079650845607%}.row-fluid .offset9:first-child{margin-left:76.92307692307693%;*margin-left:76.81669394435352%}.row-fluid .offset8{margin-left:70.94017094017094%;*margin-left:70.83378796144753%}.row-fluid .offset8:first-child{margin-left:68.37606837606839%;*margin-left:68.26968539734497%}.row-fluid .offset7{margin-left:62.393162393162385%;*margin-left:62.28677941443899%}.row-fluid .offset7:first-child{margin-left:59.82905982905982%;*margin-left:59.72267685033642%}.row-fluid .offset6{margin-left:53.84615384615384%;*margin-left:53.739770867430444%}.row-fluid .offset6:first-child{margin-left:51.28205128205128%;*margin-left:51.175668303327875%}.row-fluid .offset5{margin-left:45.299145299145295%;*margin-left:45.1927623204219%}.row-fluid .offset5:first-child{margin-left:42.73504273504273%;*margin-left:42.62865975631933%}.row-fluid .offset4{margin-left:36.75213675213675%;*margin-left:36.645753773413354%}.row-fluid .offset4:first-child{margin-left:34.18803418803419%;*margin-left:34.081651209310785%}.row-fluid .offset3{margin-left:28.205128205128204%;*margin-left:28.0987452264048%}.row-fluid .offset3:first-child{margin-left:25.641025641025642%;*margin-left:25.53464266230224%}.row-fluid .offset2{margin-left:19.65811965811966%;*margin-left:19.551736679396257%}.row-fluid .offset2:first-child{margin-left:17.094017094017094%;*margin-left:16.98763411529369%}.row-fluid .offset1{margin-left:11.11111111111111%;*margin-left:11.004728132387708%}.row-fluid .offset1:first-child{margin-left:8.547008547008547%;*margin-left:8.440625568285142%}input,textarea,.uneditable-input{margin-left:0}.controls-row [class*="span"]+[class*="span"]{margin-left:30px}input.span12,textarea.span12,.uneditable-input.span12{width:1156px}input.span11,textarea.span11,.uneditable-input.span11{width:1056px}input.span10,textarea.span10,.uneditable-input.span10{width:956px}input.span9,textarea.span9,.uneditable-input.span9{width:856px}input.span8,textarea.span8,.uneditable-input.span8{width:756px}input.span7,textarea.span7,.uneditable-input.span7{width:656px}input.span6,textarea.span6,.uneditable-input.span6{width:556px}input.span5,textarea.span5,.uneditable-input.span5{width:456px}input.span4,textarea.span4,.uneditable-input.span4{width:356px}input.span3,textarea.span3,.uneditable-input.span3{width:256px}input.span2,textarea.span2,.uneditable-input.span2{width:156px}input.span1,textarea.span1,.uneditable-input.span1{width:56px}.thumbnails{margin-left:-30px}.thumbnails>li{margin-left:30px}.row-fluid .thumbnails{margin-left:0}}@media(min-width:768px) and (max-width:979px){.row{margin-left:-20px;*zoom:1}.row:before,.row:after{display:table;line-height:0;content:""}.row:after{clear:both}[class*="span"]{float:left;min-height:1px;margin-left:20px}.container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:724px}.span12{width:724px}.span11{width:662px}.span10{width:600px}.span9{width:538px}.span8{width:476px}.span7{width:414px}.span6{width:352px}.span5{width:290px}.span4{width:228px}.span3{width:166px}.span2{width:104px}.span1{width:42px}.offset12{margin-left:764px}.offset11{margin-left:702px}.offset10{margin-left:640px}.offset9{margin-left:578px}.offset8{margin-left:516px}.offset7{margin-left:454px}.offset6{margin-left:392px}.offset5{margin-left:330px}.offset4{margin-left:268px}.offset3{margin-left:206px}.offset2{margin-left:144px}.offset1{margin-left:82px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;line-height:0;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;float:left;width:100%;min-height:30px;margin-left:2.7624309392265194%;*margin-left:2.709239449864817%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .controls-row [class*="span"]+[class*="span"]{margin-left:2.7624309392265194%}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:91.43646408839778%;*width:91.38327259903608%}.row-fluid .span10{width:82.87292817679558%;*width:82.81973668743387%}.row-fluid .span9{width:74.30939226519337%;*width:74.25620077583166%}.row-fluid .span8{width:65.74585635359117%;*width:65.69266486422946%}.row-fluid .span7{width:57.18232044198895%;*width:57.12912895262725%}.row-fluid .span6{width:48.61878453038674%;*width:48.56559304102504%}.row-fluid .span5{width:40.05524861878453%;*width:40.00205712942283%}.row-fluid .span4{width:31.491712707182323%;*width:31.43852121782062%}.row-fluid .span3{width:22.92817679558011%;*width:22.87498530621841%}.row-fluid .span2{width:14.3646408839779%;*width:14.311449394616199%}.row-fluid .span1{width:5.801104972375691%;*width:5.747913483013988%}.row-fluid .offset12{margin-left:105.52486187845304%;*margin-left:105.41847889972962%}.row-fluid .offset12:first-child{margin-left:102.76243093922652%;*margin-left:102.6560479605031%}.row-fluid .offset11{margin-left:96.96132596685082%;*margin-left:96.8549429881274%}.row-fluid .offset11:first-child{margin-left:94.1988950276243%;*margin-left:94.09251204890089%}.row-fluid .offset10{margin-left:88.39779005524862%;*margin-left:88.2914070765252%}.row-fluid .offset10:first-child{margin-left:85.6353591160221%;*margin-left:85.52897613729868%}.row-fluid .offset9{margin-left:79.8342541436464%;*margin-left:79.72787116492299%}.row-fluid .offset9:first-child{margin-left:77.07182320441989%;*margin-left:76.96544022569647%}.row-fluid .offset8{margin-left:71.2707182320442%;*margin-left:71.16433525332079%}.row-fluid .offset8:first-child{margin-left:68.50828729281768%;*margin-left:68.40190431409427%}.row-fluid .offset7{margin-left:62.70718232044199%;*margin-left:62.600799341718584%}.row-fluid .offset7:first-child{margin-left:59.94475138121547%;*margin-left:59.838368402492065%}.row-fluid .offset6{margin-left:54.14364640883978%;*margin-left:54.037263430116376%}.row-fluid .offset6:first-child{margin-left:51.38121546961326%;*margin-left:51.27483249088986%}.row-fluid .offset5{margin-left:45.58011049723757%;*margin-left:45.47372751851417%}.row-fluid .offset5:first-child{margin-left:42.81767955801105%;*margin-left:42.71129657928765%}.row-fluid .offset4{margin-left:37.01657458563536%;*margin-left:36.91019160691196%}.row-fluid .offset4:first-child{margin-left:34.25414364640884%;*margin-left:34.14776066768544%}.row-fluid .offset3{margin-left:28.45303867403315%;*margin-left:28.346655695309746%}.row-fluid .offset3:first-child{margin-left:25.69060773480663%;*margin-left:25.584224756083227%}.row-fluid .offset2{margin-left:19.88950276243094%;*margin-left:19.783119783707537%}.row-fluid .offset2:first-child{margin-left:17.12707182320442%;*margin-left:17.02068884448102%}.row-fluid .offset1{margin-left:11.32596685082873%;*margin-left:11.219583872105325%}.row-fluid .offset1:first-child{margin-left:8.56353591160221%;*margin-left:8.457152932878806%}input,textarea,.uneditable-input{margin-left:0}.controls-row [class*="span"]+[class*="span"]{margin-left:20px}input.span12,textarea.span12,.uneditable-input.span12{width:710px}input.span11,textarea.span11,.uneditable-input.span11{width:648px}input.span10,textarea.span10,.uneditable-input.span10{width:586px}input.span9,textarea.span9,.uneditable-input.span9{width:524px}input.span8,textarea.span8,.uneditable-input.span8{width:462px}input.span7,textarea.span7,.uneditable-input.span7{width:400px}input.span6,textarea.span6,.uneditable-input.span6{width:338px}input.span5,textarea.span5,.uneditable-input.span5{width:276px}input.span4,textarea.span4,.uneditable-input.span4{width:214px}input.span3,textarea.span3,.uneditable-input.span3{width:152px}input.span2,textarea.span2,.uneditable-input.span2{width:90px}input.span1,textarea.span1,.uneditable-input.span1{width:28px}}@media(max-width:767px){body{padding-right:20px;padding-left:20px}.navbar-fixed-top,.navbar-fixed-bottom,.navbar-static-top{margin-right:-20px;margin-left:-20px}.container-fluid{padding:0}.dl-horizontal dt{float:none;width:auto;clear:none;text-align:left}.dl-horizontal dd{margin-left:0}.container{width:auto}.row-fluid{width:100%}.row,.thumbnails{margin-left:0}.thumbnails>li{float:none;margin-left:0}[class*="span"],.uneditable-input[class*="span"],.row-fluid [class*="span"]{display:block;float:none;width:100%;margin-left:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.span12,.row-fluid .span12{width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="offset"]:first-child{margin-left:0}.input-large,.input-xlarge,.input-xxlarge,input[class*="span"],select[class*="span"],textarea[class*="span"],.uneditable-input{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.input-prepend input,.input-append input,.input-prepend input[class*="span"],.input-append input[class*="span"]{display:inline-block;width:auto}.controls-row [class*="span"]+[class*="span"]{margin-left:0}.modal{position:fixed;top:20px;right:20px;left:20px;width:auto;margin:0}.modal.fade{top:-100px}.modal.fade.in{top:20px}}@media(max-width:480px){.nav-collapse{-webkit-transform:translate3d(0,0,0)}.page-header h1 small{display:block;line-height:20px}input[type="checkbox"],input[type="radio"]{border:1px solid #ccc}.form-horizontal .control-label{float:none;width:auto;padding-top:0;text-align:left}.form-horizontal .controls{margin-left:0}.form-horizontal .control-list{padding-top:0}.form-horizontal .form-actions{padding-right:10px;padding-left:10px}.media .pull-left,.media .pull-right{display:block;float:none;margin-bottom:10px}.media-object{margin-right:0;margin-left:0}.modal{top:10px;right:10px;left:10px}.modal-header .close{padding:10px;margin:-10px}.carousel-caption{position:static}}@media(max-width:979px){body{padding-top:0}.navbar-fixed-top,.navbar-fixed-bottom{position:static}.navbar-fixed-top{margin-bottom:20px}.navbar-fixed-bottom{margin-top:20px}.navbar-fixed-top .navbar-inner,.navbar-fixed-bottom .navbar-inner{padding:5px}.navbar .container{width:auto;padding:0}.navbar .brand{padding-right:10px;padding-left:10px;margin:0 0 0 -5px}.nav-collapse{clear:both}.nav-collapse .nav{float:none;margin:0 0 10px}.nav-collapse .nav>li{float:none}.nav-collapse .nav>li>a{margin-bottom:2px}.nav-collapse .nav>.divider-vertical{display:none}.nav-collapse .nav .nav-header{color:#777;text-shadow:none}.nav-collapse .nav>li>a,.nav-collapse .dropdown-menu a{padding:9px 15px;font-weight:bold;color:#777;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.nav-collapse .btn{padding:4px 10px 4px;font-weight:normal;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.nav-collapse .dropdown-menu li+li a{margin-bottom:2px}.nav-collapse .nav>li>a:hover,.nav-collapse .dropdown-menu a:hover{background-color:#f2f2f2}.navbar-inverse .nav-collapse .nav>li>a,.navbar-inverse .nav-collapse .dropdown-menu a{color:#999}.navbar-inverse .nav-collapse .nav>li>a:hover,.navbar-inverse .nav-collapse .dropdown-menu a:hover{background-color:#111}.nav-collapse.in .btn-group{padding:0;margin-top:5px}.nav-collapse .dropdown-menu{position:static;top:auto;left:auto;display:none;float:none;max-width:none;padding:0;margin:0 15px;background-color:transparent;border:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.nav-collapse .open>.dropdown-menu{display:block}.nav-collapse .dropdown-menu:before,.nav-collapse .dropdown-menu:after{display:none}.nav-collapse .dropdown-menu .divider{display:none}.nav-collapse .nav>li>.dropdown-menu:before,.nav-collapse .nav>li>.dropdown-menu:after{display:none}.nav-collapse .navbar-form,.nav-collapse .navbar-search{float:none;padding:10px 15px;margin:10px 0;border-top:1px solid #f2f2f2;border-bottom:1px solid #f2f2f2;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1)}.navbar-inverse .nav-collapse .navbar-form,.navbar-inverse .nav-collapse .navbar-search{border-top-color:#111;border-bottom-color:#111}.navbar .nav-collapse .nav.pull-right{float:none;margin-left:0}.nav-collapse,.nav-collapse.collapse{height:0;overflow:hidden}.navbar .btn-navbar{display:block}.navbar-static .navbar-inner{padding-right:10px;padding-left:10px}}@media(min-width:980px){.nav-collapse.collapse{height:auto!important;overflow:visible!important}} 10 | -------------------------------------------------------------------------------- /js/colorpicker.js: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | * Color picker 4 | * Author: Stefan Petre www.eyecon.ro 5 | * 6 | * Dual licensed under the MIT and GPL licenses 7 | * 8 | */ 9 | (function ($) { 10 | var ColorPicker = function () { 11 | var 12 | ids = {}, 13 | inAction, 14 | charMin = 65, 15 | visible, 16 | tpl = '
', 17 | defaults = { 18 | eventName: 'click', 19 | onShow: function () {}, 20 | onBeforeShow: function(){}, 21 | onHide: function () {}, 22 | onChange: function () {}, 23 | onSubmit: function () {}, 24 | color: 'ff0000', 25 | livePreview: true, 26 | flat: false 27 | }, 28 | fillRGBFields = function (hsb, cal) { 29 | var rgb = HSBToRGB(hsb); 30 | $(cal).data('colorpicker').fields 31 | .eq(1).val(rgb.r).end() 32 | .eq(2).val(rgb.g).end() 33 | .eq(3).val(rgb.b).end(); 34 | }, 35 | fillHSBFields = function (hsb, cal) { 36 | $(cal).data('colorpicker').fields 37 | .eq(4).val(hsb.h).end() 38 | .eq(5).val(hsb.s).end() 39 | .eq(6).val(hsb.b).end(); 40 | }, 41 | fillHexFields = function (hsb, cal) { 42 | $(cal).data('colorpicker').fields 43 | .eq(0).val(HSBToHex(hsb)).end(); 44 | }, 45 | setSelector = function (hsb, cal) { 46 | $(cal).data('colorpicker').selector.css('backgroundColor', '#' + HSBToHex({h: hsb.h, s: 100, b: 100})); 47 | $(cal).data('colorpicker').selectorIndic.css({ 48 | left: parseInt(150 * hsb.s/100, 10), 49 | top: parseInt(150 * (100-hsb.b)/100, 10) 50 | }); 51 | }, 52 | setHue = function (hsb, cal) { 53 | $(cal).data('colorpicker').hue.css('top', parseInt(150 - 150 * hsb.h/360, 10)); 54 | }, 55 | setCurrentColor = function (hsb, cal) { 56 | $(cal).data('colorpicker').currentColor.css('backgroundColor', '#' + HSBToHex(hsb)); 57 | }, 58 | setNewColor = function (hsb, cal) { 59 | $(cal).data('colorpicker').newColor.css('backgroundColor', '#' + HSBToHex(hsb)); 60 | }, 61 | keyDown = function (ev) { 62 | var pressedKey = ev.charCode || ev.keyCode || -1; 63 | if ((pressedKey > charMin && pressedKey <= 90) || pressedKey == 32) { 64 | return false; 65 | } 66 | var cal = $(this).parent().parent(); 67 | if (cal.data('colorpicker').livePreview === true) { 68 | change.apply(this); 69 | } 70 | }, 71 | change = function (ev) { 72 | var cal = $(this).parent().parent(), col; 73 | if (this.parentNode.className.indexOf('_hex') > 0) { 74 | cal.data('colorpicker').color = col = HexToHSB(fixHex(this.value)); 75 | } else if (this.parentNode.className.indexOf('_hsb') > 0) { 76 | cal.data('colorpicker').color = col = fixHSB({ 77 | h: parseInt(cal.data('colorpicker').fields.eq(4).val(), 10), 78 | s: parseInt(cal.data('colorpicker').fields.eq(5).val(), 10), 79 | b: parseInt(cal.data('colorpicker').fields.eq(6).val(), 10) 80 | }); 81 | } else { 82 | cal.data('colorpicker').color = col = RGBToHSB(fixRGB({ 83 | r: parseInt(cal.data('colorpicker').fields.eq(1).val(), 10), 84 | g: parseInt(cal.data('colorpicker').fields.eq(2).val(), 10), 85 | b: parseInt(cal.data('colorpicker').fields.eq(3).val(), 10) 86 | })); 87 | } 88 | if (ev) { 89 | fillRGBFields(col, cal.get(0)); 90 | fillHexFields(col, cal.get(0)); 91 | fillHSBFields(col, cal.get(0)); 92 | } 93 | setSelector(col, cal.get(0)); 94 | setHue(col, cal.get(0)); 95 | setNewColor(col, cal.get(0)); 96 | cal.data('colorpicker').onChange.apply(cal, [col, HSBToHex(col), HSBToRGB(col)]); 97 | }, 98 | blur = function (ev) { 99 | var cal = $(this).parent().parent(); 100 | cal.data('colorpicker').fields.parent().removeClass('colorpicker_focus'); 101 | }, 102 | focus = function () { 103 | charMin = this.parentNode.className.indexOf('_hex') > 0 ? 70 : 65; 104 | $(this).parent().parent().data('colorpicker').fields.parent().removeClass('colorpicker_focus'); 105 | $(this).parent().addClass('colorpicker_focus'); 106 | }, 107 | downIncrement = function (ev) { 108 | var field = $(this).parent().find('input').focus(); 109 | var current = { 110 | el: $(this).parent().addClass('colorpicker_slider'), 111 | max: this.parentNode.className.indexOf('_hsb_h') > 0 ? 360 : (this.parentNode.className.indexOf('_hsb') > 0 ? 100 : 255), 112 | y: ev.pageY, 113 | field: field, 114 | val: parseInt(field.val(), 10), 115 | preview: $(this).parent().parent().data('colorpicker').livePreview 116 | }; 117 | $(document).bind('mouseup', current, upIncrement); 118 | $(document).bind('mousemove', current, moveIncrement); 119 | }, 120 | moveIncrement = function (ev) { 121 | ev.data.field.val(Math.max(0, Math.min(ev.data.max, parseInt(ev.data.val + ev.pageY - ev.data.y, 10)))); 122 | if (ev.data.preview) { 123 | change.apply(ev.data.field.get(0), [true]); 124 | } 125 | return false; 126 | }, 127 | upIncrement = function (ev) { 128 | change.apply(ev.data.field.get(0), [true]); 129 | ev.data.el.removeClass('colorpicker_slider').find('input').focus(); 130 | $(document).unbind('mouseup', upIncrement); 131 | $(document).unbind('mousemove', moveIncrement); 132 | return false; 133 | }, 134 | downHue = function (ev) { 135 | var current = { 136 | cal: $(this).parent(), 137 | y: $(this).offset().top 138 | }; 139 | current.preview = current.cal.data('colorpicker').livePreview; 140 | $(document).bind('mouseup', current, upHue); 141 | $(document).bind('mousemove', current, moveHue); 142 | }, 143 | moveHue = function (ev) { 144 | change.apply( 145 | ev.data.cal.data('colorpicker') 146 | .fields 147 | .eq(4) 148 | .val(parseInt(360*(150 - Math.max(0,Math.min(150,(ev.pageY - ev.data.y))))/150, 10)) 149 | .get(0), 150 | [ev.data.preview] 151 | ); 152 | return false; 153 | }, 154 | upHue = function (ev) { 155 | fillRGBFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0)); 156 | fillHexFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0)); 157 | $(document).unbind('mouseup', upHue); 158 | $(document).unbind('mousemove', moveHue); 159 | return false; 160 | }, 161 | downSelector = function (ev) { 162 | var current = { 163 | cal: $(this).parent(), 164 | pos: $(this).offset() 165 | }; 166 | current.preview = current.cal.data('colorpicker').livePreview; 167 | $(document).bind('mouseup', current, upSelector); 168 | $(document).bind('mousemove', current, moveSelector); 169 | }, 170 | moveSelector = function (ev) { 171 | change.apply( 172 | ev.data.cal.data('colorpicker') 173 | .fields 174 | .eq(6) 175 | .val(parseInt(100*(150 - Math.max(0,Math.min(150,(ev.pageY - ev.data.pos.top))))/150, 10)) 176 | .end() 177 | .eq(5) 178 | .val(parseInt(100*(Math.max(0,Math.min(150,(ev.pageX - ev.data.pos.left))))/150, 10)) 179 | .get(0), 180 | [ev.data.preview] 181 | ); 182 | return false; 183 | }, 184 | upSelector = function (ev) { 185 | fillRGBFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0)); 186 | fillHexFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0)); 187 | $(document).unbind('mouseup', upSelector); 188 | $(document).unbind('mousemove', moveSelector); 189 | return false; 190 | }, 191 | enterSubmit = function (ev) { 192 | $(this).addClass('colorpicker_focus'); 193 | }, 194 | leaveSubmit = function (ev) { 195 | $(this).removeClass('colorpicker_focus'); 196 | }, 197 | clickSubmit = function (ev) { 198 | var cal = $(this).parent(); 199 | var col = cal.data('colorpicker').color; 200 | cal.data('colorpicker').origColor = col; 201 | setCurrentColor(col, cal.get(0)); 202 | cal.data('colorpicker').onSubmit(col, HSBToHex(col), HSBToRGB(col), cal.data('colorpicker').el); 203 | }, 204 | show = function (ev) { 205 | var cal = $('#' + $(this).data('colorpickerId')); 206 | cal.data('colorpicker').onBeforeShow.apply(this, [cal.get(0)]); 207 | var pos = $(this).offset(); 208 | var viewPort = getViewport(); 209 | var top = pos.top + this.offsetHeight; 210 | var left = pos.left; 211 | if (top + 176 > viewPort.t + viewPort.h) { 212 | top -= this.offsetHeight + 176; 213 | } 214 | if (left + 356 > viewPort.l + viewPort.w) { 215 | left -= 356; 216 | } 217 | cal.css({left: left + 'px', top: top + 'px'}); 218 | if (cal.data('colorpicker').onShow.apply(this, [cal.get(0)]) != false) { 219 | cal.show(); 220 | } 221 | $(document).bind('mousedown', {cal: cal}, hide); 222 | return false; 223 | }, 224 | hide = function (ev) { 225 | if (!isChildOf(ev.data.cal.get(0), ev.target, ev.data.cal.get(0))) { 226 | if (ev.data.cal.data('colorpicker').onHide.apply(this, [ev.data.cal.get(0)]) != false) { 227 | ev.data.cal.hide(); 228 | } 229 | $(document).unbind('mousedown', hide); 230 | } 231 | }, 232 | isChildOf = function(parentEl, el, container) { 233 | if (parentEl == el) { 234 | return true; 235 | } 236 | if (parentEl.contains) { 237 | return parentEl.contains(el); 238 | } 239 | if ( parentEl.compareDocumentPosition ) { 240 | return !!(parentEl.compareDocumentPosition(el) & 16); 241 | } 242 | var prEl = el.parentNode; 243 | while(prEl && prEl != container) { 244 | if (prEl == parentEl) 245 | return true; 246 | prEl = prEl.parentNode; 247 | } 248 | return false; 249 | }, 250 | getViewport = function () { 251 | var m = document.compatMode == 'CSS1Compat'; 252 | return { 253 | l : window.pageXOffset || (m ? document.documentElement.scrollLeft : document.body.scrollLeft), 254 | t : window.pageYOffset || (m ? document.documentElement.scrollTop : document.body.scrollTop), 255 | w : window.innerWidth || (m ? document.documentElement.clientWidth : document.body.clientWidth), 256 | h : window.innerHeight || (m ? document.documentElement.clientHeight : document.body.clientHeight) 257 | }; 258 | }, 259 | fixHSB = function (hsb) { 260 | return { 261 | h: Math.min(360, Math.max(0, hsb.h)), 262 | s: Math.min(100, Math.max(0, hsb.s)), 263 | b: Math.min(100, Math.max(0, hsb.b)) 264 | }; 265 | }, 266 | fixRGB = function (rgb) { 267 | return { 268 | r: Math.min(255, Math.max(0, rgb.r)), 269 | g: Math.min(255, Math.max(0, rgb.g)), 270 | b: Math.min(255, Math.max(0, rgb.b)) 271 | }; 272 | }, 273 | fixHex = function (hex) { 274 | var len = 6 - hex.length; 275 | if (len > 0) { 276 | var o = []; 277 | for (var i=0; i -1) ? hex.substring(1) : hex), 16); 287 | return {r: hex >> 16, g: (hex & 0x00FF00) >> 8, b: (hex & 0x0000FF)}; 288 | }, 289 | HexToHSB = function (hex) { 290 | return RGBToHSB(HexToRGB(hex)); 291 | }, 292 | RGBToHSB = function (rgb) { 293 | var hsb = { 294 | h: 0, 295 | s: 0, 296 | b: 0 297 | }; 298 | var min = Math.min(rgb.r, rgb.g, rgb.b); 299 | var max = Math.max(rgb.r, rgb.g, rgb.b); 300 | var delta = max - min; 301 | hsb.b = max; 302 | if (max != 0) { 303 | 304 | } 305 | hsb.s = max != 0 ? 255 * delta / max : 0; 306 | if (hsb.s != 0) { 307 | if (rgb.r == max) { 308 | hsb.h = (rgb.g - rgb.b) / delta; 309 | } else if (rgb.g == max) { 310 | hsb.h = 2 + (rgb.b - rgb.r) / delta; 311 | } else { 312 | hsb.h = 4 + (rgb.r - rgb.g) / delta; 313 | } 314 | } else { 315 | hsb.h = -1; 316 | } 317 | hsb.h *= 60; 318 | if (hsb.h < 0) { 319 | hsb.h += 360; 320 | } 321 | hsb.s *= 100/255; 322 | hsb.b *= 100/255; 323 | return hsb; 324 | }, 325 | HSBToRGB = function (hsb) { 326 | var rgb = {}; 327 | var h = Math.round(hsb.h); 328 | var s = Math.round(hsb.s*255/100); 329 | var v = Math.round(hsb.b*255/100); 330 | if(s == 0) { 331 | rgb.r = rgb.g = rgb.b = v; 332 | } else { 333 | var t1 = v; 334 | var t2 = (255-s)*v/255; 335 | var t3 = (t1-t2)*(h%60)/60; 336 | if(h==360) h = 0; 337 | if(h<60) {rgb.r=t1; rgb.b=t2; rgb.g=t2+t3} 338 | else if(h<120) {rgb.g=t1; rgb.b=t2; rgb.r=t1-t3} 339 | else if(h<180) {rgb.g=t1; rgb.r=t2; rgb.b=t2+t3} 340 | else if(h<240) {rgb.b=t1; rgb.r=t2; rgb.g=t1-t3} 341 | else if(h<300) {rgb.b=t1; rgb.g=t2; rgb.r=t2+t3} 342 | else if(h<360) {rgb.r=t1; rgb.g=t2; rgb.b=t1-t3} 343 | else {rgb.r=0; rgb.g=0; rgb.b=0} 344 | } 345 | return {r:Math.round(rgb.r), g:Math.round(rgb.g), b:Math.round(rgb.b)}; 346 | }, 347 | RGBToHex = function (rgb) { 348 | var hex = [ 349 | rgb.r.toString(16), 350 | rgb.g.toString(16), 351 | rgb.b.toString(16) 352 | ]; 353 | $.each(hex, function (nr, val) { 354 | if (val.length == 1) { 355 | hex[nr] = '0' + val; 356 | } 357 | }); 358 | return hex.join(''); 359 | }, 360 | HSBToHex = function (hsb) { 361 | return RGBToHex(HSBToRGB(hsb)); 362 | }, 363 | restoreOriginal = function () { 364 | var cal = $(this).parent(); 365 | var col = cal.data('colorpicker').origColor; 366 | cal.data('colorpicker').color = col; 367 | fillRGBFields(col, cal.get(0)); 368 | fillHexFields(col, cal.get(0)); 369 | fillHSBFields(col, cal.get(0)); 370 | setSelector(col, cal.get(0)); 371 | setHue(col, cal.get(0)); 372 | setNewColor(col, cal.get(0)); 373 | }; 374 | return { 375 | init: function (opt) { 376 | opt = $.extend({}, defaults, opt||{}); 377 | if (typeof opt.color == 'string') { 378 | opt.color = HexToHSB(opt.color); 379 | } else if (opt.color.r != undefined && opt.color.g != undefined && opt.color.b != undefined) { 380 | opt.color = RGBToHSB(opt.color); 381 | } else if (opt.color.h != undefined && opt.color.s != undefined && opt.color.b != undefined) { 382 | opt.color = fixHSB(opt.color); 383 | } else { 384 | return this; 385 | } 386 | return this.each(function () { 387 | if (!$(this).data('colorpickerId')) { 388 | var options = $.extend({}, opt); 389 | options.origColor = opt.color; 390 | var id = 'collorpicker_' + parseInt(Math.random() * 1000); 391 | $(this).data('colorpickerId', id); 392 | var cal = $(tpl).attr('id', id); 393 | if (options.flat) { 394 | cal.appendTo(this).show(); 395 | } else { 396 | cal.appendTo(document.body); 397 | } 398 | options.fields = cal 399 | .find('input') 400 | .bind('keyup', keyDown) 401 | .bind('change', change) 402 | .bind('blur', blur) 403 | .bind('focus', focus); 404 | cal 405 | .find('span').bind('mousedown', downIncrement).end() 406 | .find('>div.colorpicker_current_color').bind('click', restoreOriginal); 407 | options.selector = cal.find('div.colorpicker_color').bind('mousedown', downSelector); 408 | options.selectorIndic = options.selector.find('div div'); 409 | options.el = this; 410 | options.hue = cal.find('div.colorpicker_hue div'); 411 | cal.find('div.colorpicker_hue').bind('mousedown', downHue); 412 | options.newColor = cal.find('div.colorpicker_new_color'); 413 | options.currentColor = cal.find('div.colorpicker_current_color'); 414 | cal.data('colorpicker', options); 415 | cal.find('div.colorpicker_submit') 416 | .bind('mouseenter', enterSubmit) 417 | .bind('mouseleave', leaveSubmit) 418 | .bind('click', clickSubmit); 419 | fillRGBFields(options.color, cal.get(0)); 420 | fillHSBFields(options.color, cal.get(0)); 421 | fillHexFields(options.color, cal.get(0)); 422 | setHue(options.color, cal.get(0)); 423 | setSelector(options.color, cal.get(0)); 424 | setCurrentColor(options.color, cal.get(0)); 425 | setNewColor(options.color, cal.get(0)); 426 | if (options.flat) { 427 | cal.css({ 428 | position: 'relative', 429 | display: 'block' 430 | }); 431 | } else { 432 | $(this).bind(options.eventName, show); 433 | } 434 | } 435 | }); 436 | }, 437 | showPicker: function() { 438 | return this.each( function () { 439 | if ($(this).data('colorpickerId')) { 440 | show.apply(this); 441 | } 442 | }); 443 | }, 444 | hidePicker: function() { 445 | return this.each( function () { 446 | if ($(this).data('colorpickerId')) { 447 | $('#' + $(this).data('colorpickerId')).hide(); 448 | } 449 | }); 450 | }, 451 | setColor: function(col) { 452 | if (typeof col == 'string') { 453 | col = HexToHSB(col); 454 | } else if (col.r != undefined && col.g != undefined && col.b != undefined) { 455 | col = RGBToHSB(col); 456 | } else if (col.h != undefined && col.s != undefined && col.b != undefined) { 457 | col = fixHSB(col); 458 | } else { 459 | return this; 460 | } 461 | return this.each(function(){ 462 | if ($(this).data('colorpickerId')) { 463 | var cal = $('#' + $(this).data('colorpickerId')); 464 | cal.data('colorpicker').color = col; 465 | cal.data('colorpicker').origColor = col; 466 | fillRGBFields(col, cal.get(0)); 467 | fillHSBFields(col, cal.get(0)); 468 | fillHexFields(col, cal.get(0)); 469 | setHue(col, cal.get(0)); 470 | setSelector(col, cal.get(0)); 471 | setCurrentColor(col, cal.get(0)); 472 | setNewColor(col, cal.get(0)); 473 | } 474 | }); 475 | } 476 | }; 477 | }(); 478 | $.fn.extend({ 479 | ColorPicker: ColorPicker.init, 480 | ColorPickerHide: ColorPicker.hidePicker, 481 | ColorPickerShow: ColorPicker.showPicker, 482 | ColorPickerSetColor: ColorPicker.setColor 483 | }); 484 | })(jQuery) -------------------------------------------------------------------------------- /js/app.js: -------------------------------------------------------------------------------- 1 | /* 2 | github-label-manager is free software: you can redistribute it and/or modify 3 | it under the terms of the GNU General Public License as published by 4 | the Free Software Foundation, either version 3 of the License, or 5 | (at your option) any later version. 6 | 7 | github-label-manager is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with github-label-manager. If not, see . 14 | */ 15 | 16 | "use strict"; 17 | 18 | $(document).ready(function () { 19 | var username; 20 | var password; 21 | var targetUsername; 22 | var targetRepo; 23 | var targetOwner; 24 | var isLoadingShown = false; 25 | var loadingSemaphore = (function() { 26 | var count = 0; 27 | 28 | return { 29 | acquire : function() { 30 | console.log("acq " + count); 31 | ++count; 32 | return null; 33 | }, 34 | release : function() { 35 | console.log("rel " + count); 36 | if(count <= 0){ 37 | throw "Semaphore inconsistency"; 38 | } 39 | 40 | --count; 41 | return null; 42 | }, 43 | isLocked : function() { 44 | return count > 0; 45 | } 46 | }; 47 | }()); 48 | 49 | $.ajaxSetup({ 50 | cache: false, 51 | complete: function(jqXHR, textStatus) { 52 | loadingSemaphore.release(); 53 | if(isLoadingShown && loadingSemaphore.isLocked() === false){ 54 | writeLog("All operations are done."); 55 | 56 | //add close button 57 | $('#loadingModal').append('\ 209 | '); 210 | 211 | newElementEntry.children().filter('.color-box').css('background-color', '#' + label.color); 212 | 213 | newElementEntry.children().filter(':input[orig-val]').change(function(e) { 214 | 215 | if($(this).val() == $(this).attr('orig-val')){//unchanged 216 | $(this).parent().attr('action', 'none'); 217 | $(this).parent().removeClass('uncommited'); 218 | } 219 | else{//changed 220 | if($(this).parent().attr('new') == 'true'){ 221 | $(this).parent().attr('action', 'create'); 222 | } 223 | else{ 224 | $(this).parent().attr('action', 'update'); 225 | } 226 | $(this).parent().addClass('uncommited'); 227 | } 228 | 229 | checkIfAnyActionNeeded(); 230 | return; 231 | }); 232 | 233 | //Delete button 234 | newElementEntry.children().filter('.delete-button').click(function(e) { 235 | if(confirm('Really want to delete this?\n\nNote that this action only removes the label from this list not from Github.')){ 236 | if($(this).parent().attr('new') == 'true'){ 237 | $(this).parent().remove(); 238 | } 239 | else{ 240 | $(this).parent().prepend('
'); 241 | $(this).siblings().attr('disabled', 'true'); 242 | // $(this).attr('disabled', 'true'); 243 | $(this).parent().attr('action', 'delete'); 244 | } 245 | 246 | //add recover button 247 | var recoverButton = $(''); 248 | recoverButton.click(function() { 249 | debugger; 250 | //recover label-element's deleted state 251 | $(this).siblings().filter('hr').remove(); 252 | $(this).siblings().removeAttr('disabled'); 253 | if( $(this).siblings().filter('[name="name"]').attr('orig-val') == $(this).siblings().filter('[name="name"]').val() && 254 | $(this).siblings().filter('[name="color"]').attr('orig-val') == $(this).siblings().filter('[name="color"]').val() ){ 255 | 256 | $(this).parent().attr('action', 'none'); 257 | } 258 | else{ 259 | $(this).parent().attr('action', 'update'); 260 | } 261 | $(this).remove(); 262 | checkIfAnyActionNeeded(); 263 | });//end recover button's click 264 | 265 | $(this).parent().append(recoverButton); 266 | 267 | checkIfAnyActionNeeded(); 268 | return; 269 | } 270 | }); 271 | 272 | //activate color picker on color-box field 273 | newElementEntry.children().filter('.color-box').ColorPicker({ 274 | //http://www.eyecon.ro/colorpicker 275 | color: label.color, 276 | onSubmit: function(hsb, hex, rgb, el) { 277 | $(el).val(hex.toUpperCase()); 278 | $(el).ColorPickerHide(); 279 | $(el).css('background-color', '#' + hex); 280 | 281 | //----------------------------- 282 | //well here goes the copy-paste because normal binding to 'change' doesn't work 283 | // on newElementEntry.children().filter(':input[orig-val]').change(function... 284 | // since it is triggered programmatically 285 | if($(el).val() == $(el).attr('orig-val')){ 286 | $(el).parent().attr('action', 'none'); 287 | $(el).parent().removeClass('uncommited'); 288 | } 289 | else{ 290 | if($(el).parent().attr('new') == 'true'){ 291 | $(el).parent().attr('action', 'create'); 292 | } 293 | else{ 294 | $(el).parent().attr('action', 'update'); 295 | } 296 | $(el).parent().addClass('uncommited'); 297 | } 298 | checkIfAnyActionNeeded(); 299 | return; 300 | //----------------------------- 301 | }, 302 | onBeforeShow: function () { 303 | $(this).ColorPickerSetColor(this.value); 304 | } 305 | }) 306 | .bind('keyup', function(){ 307 | $(this).ColorPickerSetColor(this.value); 308 | $(this).css('background-color', '#' + this.value); 309 | }); 310 | 311 | $('#labelsForm').append(newElementEntry); 312 | } 313 | 314 | $('#addNewLabelEntryButton').click(function(e) { 315 | createNewLabelEntry(null, 'new'); 316 | }); 317 | 318 | function clearAllLabels(){ 319 | $('#labelsForm').text(''); 320 | $('#commitButton').text('Commit changes'); 321 | $('#commitButton').attr('disabled', 'disabled'); 322 | } 323 | 324 | $('#listLabelsButton').click(function(e) { 325 | $(this).button('loading'); 326 | var theButton = $(this);// dealing with closure 327 | targetOwner = $('#targetUrl').val().split(':')[0]; 328 | targetRepo = $('#targetUrl').val().split(':')[1]; 329 | targetUsername = $('#targetUsername').val(); 330 | 331 | if(targetOwner && targetRepo){ 332 | clearAllLabels(); 333 | 334 | apiCallListLabels(targetOwner, targetRepo, 'list', function(response) { 335 | theButton.button('reset'); 336 | }); 337 | } 338 | else{ 339 | alert("Please follow the format: \n\nusername:repo"); 340 | theButton.button('reset'); 341 | } 342 | }); 343 | 344 | $('#resetButton').click(function(e) { 345 | $(this).button('loading'); 346 | var theButton = $(this);// dealing with closure 347 | clearAllLabels(); 348 | apiCallListLabels(targetOwner, targetRepo, 'list', function(response) { 349 | theButton.button('reset'); 350 | }); 351 | }); 352 | 353 | $('#copyFromRepoButton').click(function(e) { 354 | $(this).button('loading'); 355 | var theButton = $(this);// dealing with closure 356 | var username = $('#copyUrl').val().split(':')[0]; 357 | var repo = $('#copyUrl').val().split(':')[1]; 358 | 359 | if(username && repo){ 360 | apiCallListLabels(username, repo, 'copy', function(response) { 361 | theButton.button('reset'); 362 | });//set addUncommited to true because those are coming from another repo 363 | } 364 | else{ 365 | alert("Please follow the format: \n\nusername:repo"); 366 | theButton.button('reset'); 367 | } 368 | }); 369 | 370 | $('#commitButton').click(function(e) { 371 | $(this).button('loading'); 372 | var theButton = $(this);// dealing with closure 373 | var password = $('#githubPassword').val(); 374 | 375 | if(password.trim() == ''){ 376 | alert('You need to enter your password for repo: ' + targetRepo + ' in order to commit labels.'); 377 | theButton.button('reset'); 378 | return; 379 | } 380 | 381 | commit(); 382 | }); 383 | 384 | //Enable popovers 385 | $('#targetUrl').popover({ 386 | title: 'Example', 387 | content: 'github.com/destan/cevirgec Then use destan:cevirgec
Note that owner can also be an organization name.', 388 | trigger: 'hover', 389 | html: true 390 | }); 391 | 392 | $('#targetUsername').popover({ 393 | title: "Why 'username' again?", 394 | content: "To let you modify a repo which belongs to another user or an organization. For example the repo maybe my-organization:the-app but username is cylon", 395 | trigger: "hover", 396 | html: true 397 | }); 398 | 399 | $('#githubPassword').popover({ 400 | title: "My password for what?", 401 | content: "Password is only required for committing. It won't be required until you try to commit something.", 402 | trigger: "hover", 403 | html: true 404 | }); 405 | 406 | /** 407 | * Makes a label entry out of a div having the class .label-entry 408 | */ 409 | function serializeLabel(jObjectLabelEntry) { 410 | return { 411 | name: jObjectLabelEntry.children().filter('[name="name"]').val(), 412 | color: jObjectLabelEntry.children().filter('[name="color"]').val(), 413 | originalName: jObjectLabelEntry.children().filter('[name="name"]').attr('orig-val') 414 | }; 415 | } 416 | 417 | /** 418 | * returns true if any change has been made and activates or disactivates commit button accordingly 419 | */ 420 | function checkIfAnyActionNeeded() { 421 | var isNeeded = $('.label-entry:not([action="none"])').length > 0; 422 | 423 | if(isNeeded){ 424 | $('#commitButton').removeAttr('disabled'); 425 | $('#commitButton').removeClass('disabled'); 426 | } 427 | else{ 428 | $('#commitButton').attr('disabled', 'disabled'); 429 | } 430 | 431 | return isNeeded; 432 | } 433 | 434 | function commit() { 435 | //TODO same name check 436 | 437 | //freeze the world 438 | $('#loadingModal').modal({ 439 | keyboard: false, 440 | backdrop:'static' 441 | }); 442 | 443 | //To be deleted 444 | $('.label-entry[action="delete"]').each(function(index) { 445 | var labelObject = serializeLabel($(this)); 446 | apiCallDeleteLabel(labelObject); 447 | }); 448 | 449 | //To be updated 450 | $('.label-entry[action="update"]').each(function(index) { 451 | var labelObject = serializeLabel($(this)); 452 | apiCallUpdateLabel(labelObject); 453 | }); 454 | 455 | //To be created 456 | $('.label-entry[action="create"]').each(function(index) { 457 | var labelObject = serializeLabel($(this)); 458 | apiCallCreateLabel(labelObject); 459 | }); 460 | } 461 | 462 | function writeLog(string) { 463 | $('#loadingModal > .modal-body').append(string + '
'); 464 | } 465 | 466 | $('#loadingModal').on('hide', function () { 467 | isLoadingShown = false; 468 | 469 | //reset modal 470 | $('#loadingModal > .modal-body').text(''); 471 | $('#loadingModal > .modal-body').append('

Commiting...'); 472 | $('#loadingModal > .modal-footer').remove(); 473 | 474 | //reload labels after changes 475 | clearAllLabels(); 476 | apiCallListLabels(targetOwner, targetRepo, 'list'); 477 | }); 478 | 479 | $('#loadingModal').on('show', function () { 480 | isLoadingShown = true; 481 | }); 482 | 483 | /* ========== The rest is BASE64 STUFF ========== */ 484 | var Base64 = { 485 | // http://stackoverflow.com/a/246813 486 | // private property 487 | _keyStr: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", 488 | 489 | // public method for encoding 490 | encode: function (input) { 491 | var output = ""; 492 | var chr1, chr2, chr3, enc1, enc2, enc3, enc4; 493 | var i = 0; 494 | 495 | input = Base64._utf8_encode(input); 496 | 497 | while (i < input.length) { 498 | 499 | chr1 = input.charCodeAt(i++); 500 | chr2 = input.charCodeAt(i++); 501 | chr3 = input.charCodeAt(i++); 502 | 503 | enc1 = chr1 >> 2; 504 | enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); 505 | enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); 506 | enc4 = chr3 & 63; 507 | 508 | if (isNaN(chr2)) { 509 | enc3 = enc4 = 64; 510 | } else if (isNaN(chr3)) { 511 | enc4 = 64; 512 | } 513 | 514 | output = output + this._keyStr.charAt(enc1) + this._keyStr.charAt(enc2) + this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4); 515 | 516 | } 517 | 518 | return output; 519 | }, 520 | 521 | // public method for decoding 522 | decode: function (input) { 523 | var output = ""; 524 | var chr1, chr2, chr3; 525 | var enc1, enc2, enc3, enc4; 526 | var i = 0; 527 | 528 | input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); 529 | 530 | while (i < input.length) { 531 | 532 | enc1 = this._keyStr.indexOf(input.charAt(i++)); 533 | enc2 = this._keyStr.indexOf(input.charAt(i++)); 534 | enc3 = this._keyStr.indexOf(input.charAt(i++)); 535 | enc4 = this._keyStr.indexOf(input.charAt(i++)); 536 | 537 | chr1 = (enc1 << 2) | (enc2 >> 4); 538 | chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); 539 | chr3 = ((enc3 & 3) << 6) | enc4; 540 | 541 | output = output + String.fromCharCode(chr1); 542 | 543 | if (enc3 != 64) { 544 | output = output + String.fromCharCode(chr2); 545 | } 546 | if (enc4 != 64) { 547 | output = output + String.fromCharCode(chr3); 548 | } 549 | 550 | } 551 | 552 | output = Base64._utf8_decode(output); 553 | 554 | return output; 555 | 556 | }, 557 | 558 | // private method for UTF-8 encoding 559 | _utf8_encode: function (string) { 560 | string = string.replace(/\r\n/g, "\n"); 561 | var utftext = ""; 562 | 563 | for (var n = 0; n < string.length; n++) { 564 | 565 | var c = string.charCodeAt(n); 566 | 567 | if (c < 128) { 568 | utftext += String.fromCharCode(c); 569 | } else if ((c > 127) && (c < 2048)) { 570 | utftext += String.fromCharCode((c >> 6) | 192); 571 | utftext += String.fromCharCode((c & 63) | 128); 572 | } else { 573 | utftext += String.fromCharCode((c >> 12) | 224); 574 | utftext += String.fromCharCode(((c >> 6) & 63) | 128); 575 | utftext += String.fromCharCode((c & 63) | 128); 576 | } 577 | 578 | } 579 | 580 | return utftext; 581 | }, 582 | 583 | // private method for UTF-8 decoding 584 | _utf8_decode: function (utftext) { 585 | var string = ""; 586 | var i = 0; 587 | var c = c1 = c2 = 0; 588 | 589 | while (i < utftext.length) { 590 | 591 | c = utftext.charCodeAt(i); 592 | 593 | if (c < 128) { 594 | string += String.fromCharCode(c); 595 | i++; 596 | } else if ((c > 191) && (c < 224)) { 597 | c2 = utftext.charCodeAt(i + 1); 598 | string += String.fromCharCode(((c & 31) << 6) | (c2 & 63)); 599 | i += 2; 600 | } else { 601 | c2 = utftext.charCodeAt(i + 1); 602 | c3 = utftext.charCodeAt(i + 2); 603 | string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); 604 | i += 3; 605 | } 606 | 607 | } 608 | 609 | return string; 610 | } 611 | 612 | };//end of Base64 613 | 614 | }); //end of doc ready 615 | -------------------------------------------------------------------------------- /js/bootstrap.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap.js by @fat & @mdo 3 | * Copyright 2012 Twitter, Inc. 4 | * http://www.apache.org/licenses/LICENSE-2.0.txt 5 | */ 6 | !function($){"use strict";$(function(){$.support.transition=function(){var transitionEnd=function(){var name,el=document.createElement("bootstrap"),transEndEventNames={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(name in transEndEventNames)if(void 0!==el.style[name])return transEndEventNames[name]}();return transitionEnd&&{end:transitionEnd}}()})}(window.jQuery),!function($){"use strict";var dismiss='[data-dismiss="alert"]',Alert=function(el){$(el).on("click",dismiss,this.close)};Alert.prototype.close=function(e){function removeElement(){$parent.trigger("closed").remove()}var $parent,$this=$(this),selector=$this.attr("data-target");selector||(selector=$this.attr("href"),selector=selector&&selector.replace(/.*(?=#[^\s]*$)/,"")),$parent=$(selector),e&&e.preventDefault(),$parent.length||($parent=$this.hasClass("alert")?$this:$this.parent()),$parent.trigger(e=$.Event("close")),e.isDefaultPrevented()||($parent.removeClass("in"),$.support.transition&&$parent.hasClass("fade")?$parent.on($.support.transition.end,removeElement):removeElement())};var old=$.fn.alert;$.fn.alert=function(option){return this.each(function(){var $this=$(this),data=$this.data("alert");data||$this.data("alert",data=new Alert(this)),"string"==typeof option&&data[option].call($this)})},$.fn.alert.Constructor=Alert,$.fn.alert.noConflict=function(){return $.fn.alert=old,this},$(document).on("click.alert.data-api",dismiss,Alert.prototype.close)}(window.jQuery),!function($){"use strict";var Button=function(element,options){this.$element=$(element),this.options=$.extend({},$.fn.button.defaults,options)};Button.prototype.setState=function(state){var d="disabled",$el=this.$element,data=$el.data(),val=$el.is("input")?"val":"html";state+="Text",data.resetText||$el.data("resetText",$el[val]()),$el[val](data[state]||this.options[state]),setTimeout(function(){"loadingText"==state?$el.addClass(d).attr(d,d):$el.removeClass(d).removeAttr(d)},0)},Button.prototype.toggle=function(){var $parent=this.$element.closest('[data-toggle="buttons-radio"]');$parent&&$parent.find(".active").removeClass("active"),this.$element.toggleClass("active")};var old=$.fn.button;$.fn.button=function(option){return this.each(function(){var $this=$(this),data=$this.data("button"),options="object"==typeof option&&option;data||$this.data("button",data=new Button(this,options)),"toggle"==option?data.toggle():option&&data.setState(option)})},$.fn.button.defaults={loadingText:"loading..."},$.fn.button.Constructor=Button,$.fn.button.noConflict=function(){return $.fn.button=old,this},$(document).on("click.button.data-api","[data-toggle^=button]",function(e){var $btn=$(e.target);$btn.hasClass("btn")||($btn=$btn.closest(".btn")),$btn.button("toggle")})}(window.jQuery),!function($){"use strict";var Carousel=function(element,options){this.$element=$(element),this.options=options,"hover"==this.options.pause&&this.$element.on("mouseenter",$.proxy(this.pause,this)).on("mouseleave",$.proxy(this.cycle,this))};Carousel.prototype={cycle:function(e){return e||(this.paused=!1),this.options.interval&&!this.paused&&(this.interval=setInterval($.proxy(this.next,this),this.options.interval)),this},to:function(pos){var $active=this.$element.find(".item.active"),children=$active.parent().children(),activePos=children.index($active),that=this;if(!(pos>children.length-1||0>pos))return this.sliding?this.$element.one("slid",function(){that.to(pos)}):activePos==pos?this.pause().cycle():this.slide(pos>activePos?"next":"prev",$(children[pos]))},pause:function(e){return e||(this.paused=!0),this.$element.find(".next, .prev").length&&$.support.transition.end&&(this.$element.trigger($.support.transition.end),this.cycle()),clearInterval(this.interval),this.interval=null,this},next:function(){return this.sliding?void 0:this.slide("next")},prev:function(){return this.sliding?void 0:this.slide("prev")},slide:function(type,next){var e,$active=this.$element.find(".item.active"),$next=next||$active[type](),isCycling=this.interval,direction="next"==type?"left":"right",fallback="next"==type?"first":"last",that=this;if(this.sliding=!0,isCycling&&this.pause(),$next=$next.length?$next:this.$element.find(".item")[fallback](),e=$.Event("slide",{relatedTarget:$next[0]}),!$next.hasClass("active")){if($.support.transition&&this.$element.hasClass("slide")){if(this.$element.trigger(e),e.isDefaultPrevented())return;$next.addClass(type),$next[0].offsetWidth,$active.addClass(direction),$next.addClass(direction),this.$element.one($.support.transition.end,function(){$next.removeClass([type,direction].join(" ")).addClass("active"),$active.removeClass(["active",direction].join(" ")),that.sliding=!1,setTimeout(function(){that.$element.trigger("slid")},0)})}else{if(this.$element.trigger(e),e.isDefaultPrevented())return;$active.removeClass("active"),$next.addClass("active"),this.sliding=!1,this.$element.trigger("slid")}return isCycling&&this.cycle(),this}}};var old=$.fn.carousel;$.fn.carousel=function(option){return this.each(function(){var $this=$(this),data=$this.data("carousel"),options=$.extend({},$.fn.carousel.defaults,"object"==typeof option&&option),action="string"==typeof option?option:options.slide;data||$this.data("carousel",data=new Carousel(this,options)),"number"==typeof option?data.to(option):action?data[action]():options.interval&&data.cycle()})},$.fn.carousel.defaults={interval:5e3,pause:"hover"},$.fn.carousel.Constructor=Carousel,$.fn.carousel.noConflict=function(){return $.fn.carousel=old,this},$(document).on("click.carousel.data-api","[data-slide]",function(e){var href,$this=$(this),$target=$($this.attr("data-target")||(href=$this.attr("href"))&&href.replace(/.*(?=#[^\s]+$)/,"")),options=$.extend({},$target.data(),$this.data());$target.carousel(options),e.preventDefault()})}(window.jQuery),!function($){"use strict";var Collapse=function(element,options){this.$element=$(element),this.options=$.extend({},$.fn.collapse.defaults,options),this.options.parent&&(this.$parent=$(this.options.parent)),this.options.toggle&&this.toggle()};Collapse.prototype={constructor:Collapse,dimension:function(){var hasWidth=this.$element.hasClass("width");return hasWidth?"width":"height"},show:function(){var dimension,scroll,actives,hasData;if(!this.transitioning){if(dimension=this.dimension(),scroll=$.camelCase(["scroll",dimension].join("-")),actives=this.$parent&&this.$parent.find("> .accordion-group > .in"),actives&&actives.length){if(hasData=actives.data("collapse"),hasData&&hasData.transitioning)return;actives.collapse("hide"),hasData||actives.data("collapse",null)}this.$element[dimension](0),this.transition("addClass",$.Event("show"),"shown"),$.support.transition&&this.$element[dimension](this.$element[0][scroll])}},hide:function(){var dimension;this.transitioning||(dimension=this.dimension(),this.reset(this.$element[dimension]()),this.transition("removeClass",$.Event("hide"),"hidden"),this.$element[dimension](0))},reset:function(size){var dimension=this.dimension();return this.$element.removeClass("collapse")[dimension](size||"auto")[0].offsetWidth,this.$element[null!==size?"addClass":"removeClass"]("collapse"),this},transition:function(method,startEvent,completeEvent){var that=this,complete=function(){"show"==startEvent.type&&that.reset(),that.transitioning=0,that.$element.trigger(completeEvent)};this.$element.trigger(startEvent),startEvent.isDefaultPrevented()||(this.transitioning=1,this.$element[method]("in"),$.support.transition&&this.$element.hasClass("collapse")?this.$element.one($.support.transition.end,complete):complete())},toggle:function(){this[this.$element.hasClass("in")?"hide":"show"]()}};var old=$.fn.collapse;$.fn.collapse=function(option){return this.each(function(){var $this=$(this),data=$this.data("collapse"),options="object"==typeof option&&option;data||$this.data("collapse",data=new Collapse(this,options)),"string"==typeof option&&data[option]()})},$.fn.collapse.defaults={toggle:!0},$.fn.collapse.Constructor=Collapse,$.fn.collapse.noConflict=function(){return $.fn.collapse=old,this},$(document).on("click.collapse.data-api","[data-toggle=collapse]",function(e){var href,$this=$(this),target=$this.attr("data-target")||e.preventDefault()||(href=$this.attr("href"))&&href.replace(/.*(?=#[^\s]+$)/,""),option=$(target).data("collapse")?"toggle":$this.data();$this[$(target).hasClass("in")?"addClass":"removeClass"]("collapsed"),$(target).collapse(option)})}(window.jQuery),!function($){"use strict";function clearMenus(){$(toggle).each(function(){getParent($(this)).removeClass("open")})}function getParent($this){var $parent,selector=$this.attr("data-target");return selector||(selector=$this.attr("href"),selector=selector&&/#/.test(selector)&&selector.replace(/.*(?=#[^\s]*$)/,"")),$parent=$(selector),$parent.length||($parent=$this.parent()),$parent}var toggle="[data-toggle=dropdown]",Dropdown=function(element){var $el=$(element).on("click.dropdown.data-api",this.toggle);$("html").on("click.dropdown.data-api",function(){$el.parent().removeClass("open")})};Dropdown.prototype={constructor:Dropdown,toggle:function(){var $parent,isActive,$this=$(this);if(!$this.is(".disabled, :disabled"))return $parent=getParent($this),isActive=$parent.hasClass("open"),clearMenus(),isActive||$parent.toggleClass("open"),$this.focus(),!1},keydown:function(e){var $this,$items,$parent,isActive,index;if(/(38|40|27)/.test(e.keyCode)&&($this=$(this),e.preventDefault(),e.stopPropagation(),!$this.is(".disabled, :disabled"))){if($parent=getParent($this),isActive=$parent.hasClass("open"),!isActive||isActive&&27==e.keyCode)return $this.click();$items=$("[role=menu] li:not(.divider):visible a",$parent),$items.length&&(index=$items.index($items.filter(":focus")),38==e.keyCode&&index>0&&index--,40==e.keyCode&&$items.length-1>index&&index++,~index||(index=0),$items.eq(index).focus())}}};var old=$.fn.dropdown;$.fn.dropdown=function(option){return this.each(function(){var $this=$(this),data=$this.data("dropdown");data||$this.data("dropdown",data=new Dropdown(this)),"string"==typeof option&&data[option].call($this)})},$.fn.dropdown.Constructor=Dropdown,$.fn.dropdown.noConflict=function(){return $.fn.dropdown=old,this},$(document).on("click.dropdown.data-api touchstart.dropdown.data-api",clearMenus).on("click.dropdown touchstart.dropdown.data-api",".dropdown form",function(e){e.stopPropagation()}).on("touchstart.dropdown.data-api",".dropdown-menu",function(e){e.stopPropagation()}).on("click.dropdown.data-api touchstart.dropdown.data-api",toggle,Dropdown.prototype.toggle).on("keydown.dropdown.data-api touchstart.dropdown.data-api",toggle+", [role=menu]",Dropdown.prototype.keydown)}(window.jQuery),!function($){"use strict";var Modal=function(element,options){this.options=options,this.$element=$(element).delegate('[data-dismiss="modal"]',"click.dismiss.modal",$.proxy(this.hide,this)),this.options.remote&&this.$element.find(".modal-body").load(this.options.remote)};Modal.prototype={constructor:Modal,toggle:function(){return this[this.isShown?"hide":"show"]()},show:function(){var that=this,e=$.Event("show");this.$element.trigger(e),this.isShown||e.isDefaultPrevented()||(this.isShown=!0,this.escape(),this.backdrop(function(){var transition=$.support.transition&&that.$element.hasClass("fade");that.$element.parent().length||that.$element.appendTo(document.body),that.$element.show(),transition&&that.$element[0].offsetWidth,that.$element.addClass("in").attr("aria-hidden",!1),that.enforceFocus(),transition?that.$element.one($.support.transition.end,function(){that.$element.focus().trigger("shown")}):that.$element.focus().trigger("shown")}))},hide:function(e){e&&e.preventDefault(),e=$.Event("hide"),this.$element.trigger(e),this.isShown&&!e.isDefaultPrevented()&&(this.isShown=!1,this.escape(),$(document).off("focusin.modal"),this.$element.removeClass("in").attr("aria-hidden",!0),$.support.transition&&this.$element.hasClass("fade")?this.hideWithTransition():this.hideModal())},enforceFocus:function(){var that=this;$(document).on("focusin.modal",function(e){that.$element[0]===e.target||that.$element.has(e.target).length||that.$element.focus()})},escape:function(){var that=this;this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.modal",function(e){27==e.which&&that.hide()}):this.isShown||this.$element.off("keyup.dismiss.modal")},hideWithTransition:function(){var that=this,timeout=setTimeout(function(){that.$element.off($.support.transition.end),that.hideModal()},500);this.$element.one($.support.transition.end,function(){clearTimeout(timeout),that.hideModal()})},hideModal:function(){this.$element.hide().trigger("hidden"),this.backdrop()},removeBackdrop:function(){this.$backdrop.remove(),this.$backdrop=null},backdrop:function(callback){var animate=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var doAnimate=$.support.transition&&animate;this.$backdrop=$('