korean_zipcode_finder 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +4 -0
- data/Gemfile +4 -0
- data/README.mkd +67 -0
- data/Rakefile +1 -0
- data/app/assets/javascripts/korean_zipcode_finder/core.js +69 -0
- data/app/assets/stylesheets/korean_zipcode_finder/core.css.scss +288 -0
- data/app/controllers/korean_zipcode_finder/zipcodes_controller.rb +16 -0
- data/app/models/korean_zipcode_finder/zipcode.rb +13 -0
- data/app/views/korean_zipcode_finder/zipcodes/new.html.erb +25 -0
- data/app/views/korean_zipcode_finder/zipcodes/search.html.erb +24 -0
- data/config/routes.rb +5 -0
- data/korean_zipcode_finder.gemspec +22 -0
- data/lib/engine.rb +6 -0
- data/lib/korean_zipcode_finder/configuration.rb +13 -0
- data/lib/korean_zipcode_finder/version.rb +3 -0
- data/lib/korean_zipcode_finder.rb +32 -0
- metadata +73 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/README.mkd
ADDED
@@ -0,0 +1,67 @@
|
|
1
|
+
Korean Zipcode Finder
|
2
|
+
=====================
|
3
|
+
|
4
|
+
* 인터넷 우체국 제공 우편번호 찾기 API를 사용한 우편번호 찾기 gem
|
5
|
+
* http://biz.epost.go.kr/eportal/custom/custom_10.jsp?subGubun=sub_4&subGubun_1=cum_20
|
6
|
+
|
7
|
+
|
8
|
+
사용법 (Usage)
|
9
|
+
-----------
|
10
|
+
|
11
|
+
* 아직 gem으로 publish되어 있지 않음.
|
12
|
+
* 인터넷우체국에서 api_key를 발급
|
13
|
+
* api_key config설정에 추가
|
14
|
+
|
15
|
+
``` ruby
|
16
|
+
KoreanZipcodeFinder.configure do |config|
|
17
|
+
config.api_key = "#{YOUR_API_KEY}"
|
18
|
+
end
|
19
|
+
|
20
|
+
KoreanZipcodeFinder.find_zipcode('망원동')
|
21
|
+
```
|
22
|
+
|
23
|
+
|
24
|
+
Rails 3 Engine
|
25
|
+
--------------
|
26
|
+
|
27
|
+
**기본 설정**
|
28
|
+
|
29
|
+
* Gemfile에 추가
|
30
|
+
* Rails config 폴더에 api_key config 추가 (위의 경우와 동일)
|
31
|
+
* application.js / application.css.scss 에서 파일 로드
|
32
|
+
|
33
|
+
``` javascript
|
34
|
+
//= require korean_zipcode_finder/core
|
35
|
+
```
|
36
|
+
|
37
|
+
``` css
|
38
|
+
*= require korean_zipcode_finder/core
|
39
|
+
```
|
40
|
+
|
41
|
+
**twitter bootstrap 호환**
|
42
|
+
* twitter bootstrap를 사용하는 경우에는 css파일을 include할 필요 없음.
|
43
|
+
* core.css 파일은 twitter bootstrap의 기본 설정 중 필요한 것만 가져온 파일임.
|
44
|
+
* (팝업용 스크립트는 bootstrap것을 사용하지 않음)
|
45
|
+
|
46
|
+
**html 마크업**
|
47
|
+
|
48
|
+
* ".address" class를 가진 wrapper 속에 ".zipcode_01", ".zipcode_02", ".address_01" 클라스를 가진 text_area 생성
|
49
|
+
* ".find_zipcode_btn" class를 가진 우편번호 찾기 링크
|
50
|
+
|
51
|
+
``` html
|
52
|
+
<div class="address_area">
|
53
|
+
<%= f.label :address %> <br />
|
54
|
+
<%= f.text_field :zipcode_01, :class => "zipcode_01" %> - <%= f.text_field :zipcode_02, :class => "zipcode_02" %> <%= link_to '우편번호 찾기', '#', :class => "find_zipcode_btn" %><br />
|
55
|
+
<%= f.text_field :address_01, :class => "address_01" %> <br />
|
56
|
+
<%= f.text_field :address_02, :class => "address_02" %>
|
57
|
+
</div>
|
58
|
+
```
|
59
|
+
|
60
|
+
**적용하기**
|
61
|
+
|
62
|
+
``` javascript
|
63
|
+
$(function() {
|
64
|
+
new KoreanZipcodeFinder;
|
65
|
+
});
|
66
|
+
```
|
67
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require 'bundler/gem_tasks'
|
@@ -0,0 +1,69 @@
|
|
1
|
+
var KoreanZipcodeFinder;
|
2
|
+
|
3
|
+
KoreanZipcodeFinder = (function() {
|
4
|
+
// constructor
|
5
|
+
function KoreanZipcodeFinder() {
|
6
|
+
this.init = $.proxy(this.init, this);
|
7
|
+
this.zipcode_selected_handler = $.proxy(this.zipcode_selected_handler, this);
|
8
|
+
this.find_zipcode_handler = $.proxy(this.find_zipcode_handler, this);
|
9
|
+
this.close_modal_handler = $.proxy(this.close_modal_handler, this);
|
10
|
+
this.escape_pressed_handler = $.proxy(this.escape_pressed_handler, this);
|
11
|
+
|
12
|
+
$(document).on("focus", ".address_area .zipcode_01", this.init);
|
13
|
+
$(document).on("focus", ".address_area .zipcode_02", this.init);
|
14
|
+
$(document).on("click", ".address_area .find_zipcode_btn", this.init);
|
15
|
+
|
16
|
+
$(document).on("submit", ".korean_zipcode_finder_modal_wrapper .find_zipcode_form", this.find_zipcode_handler);
|
17
|
+
$(document).on("click", ".korean_zipcode_finder_modal_wrapper .zipcode_select", this.zipcode_selected_handler);
|
18
|
+
$(document).on("click", ".korean_zipcode_finder_modal_wrapper .close_modal_popup", this.close_modal_handler);
|
19
|
+
}
|
20
|
+
|
21
|
+
KoreanZipcodeFinder.prototype.init = function(e) {
|
22
|
+
// address_ares 등록
|
23
|
+
this.current_address_area = $(e.target).closest(".address_area");
|
24
|
+
|
25
|
+
// zipcode modal 띄우기
|
26
|
+
$('body').append( $('<div/>', {'class': 'modal-backdrop'}) );
|
27
|
+
$.get("/korean_zipcode_finder/zipcodes/new", function(html) { $("body").append(html) });
|
28
|
+
$("#dong").focus();
|
29
|
+
|
30
|
+
// escape key handler
|
31
|
+
$(document).on('keydown', this.escape_pressed_handler );
|
32
|
+
e.preventDefault();
|
33
|
+
}
|
34
|
+
|
35
|
+
// modal event handers
|
36
|
+
KoreanZipcodeFinder.prototype.close_modal_handler = function(e) {
|
37
|
+
$(".modal-backdrop").remove();
|
38
|
+
$(".korean_zipcode_finder_modal_wrapper").remove();
|
39
|
+
$(document).off('keydown');
|
40
|
+
e.preventDefault();
|
41
|
+
}
|
42
|
+
|
43
|
+
KoreanZipcodeFinder.prototype.escape_pressed_handler = function(e) {
|
44
|
+
if (e.keyCode == 27 ) { this.close_modal_handler(e) }
|
45
|
+
}
|
46
|
+
|
47
|
+
KoreanZipcodeFinder.prototype.find_zipcode_handler = function(e) {
|
48
|
+
$.get($(e.target).attr('action'), $(e.target).serialize(), function(html) {
|
49
|
+
$(".zipcode_list_box").empty().append(html);
|
50
|
+
});
|
51
|
+
e.preventDefault();
|
52
|
+
}
|
53
|
+
|
54
|
+
KoreanZipcodeFinder.prototype.zipcode_selected_handler = function(e) {
|
55
|
+
// .data() method를 사용할 경우 zipcode값이 integer로 들어온다. 001이 1로 들어옴zipcode
|
56
|
+
var zipcode_01 = $(e.target).attr('data-zipcode01');
|
57
|
+
var zipcode_02 = $(e.target).attr('data-zipcode02');
|
58
|
+
var address_01 = $(e.target).data('address01');
|
59
|
+
|
60
|
+
this.current_address_area.find(".zipcode_01").val(zipcode_01);
|
61
|
+
this.current_address_area.find(".zipcode_02").val(zipcode_02);
|
62
|
+
this.current_address_area.find(".address_01").val(address_01);
|
63
|
+
|
64
|
+
this.close_modal_handler(e);
|
65
|
+
}
|
66
|
+
|
67
|
+
return KoreanZipcodeFinder;
|
68
|
+
})();
|
69
|
+
|
@@ -0,0 +1,288 @@
|
|
1
|
+
/*!
|
2
|
+
* Bootstrap v2.0.4
|
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
|
+
*/
|
10
|
+
|
11
|
+
.korean_zipcode_finder_modal_wrapper {
|
12
|
+
font-size: 13px;
|
13
|
+
|
14
|
+
.clearfix{*zoom:1;}.clearfix:before,.clearfix:after{display:table;content:"";}
|
15
|
+
.clearfix:after{clear:both;}
|
16
|
+
.hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0;}
|
17
|
+
.input-block-level{display:block;width:100%;min-height:28px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;}
|
18
|
+
article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block;}
|
19
|
+
audio,canvas,video{display:inline-block;*display:inline;*zoom:1;}
|
20
|
+
audio:not([controls]){display:none;}
|
21
|
+
html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;}
|
22
|
+
a:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px;}
|
23
|
+
a:hover,a:active{outline:0;}
|
24
|
+
sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline;}
|
25
|
+
sup{top:-0.5em;}
|
26
|
+
sub{bottom:-0.25em;}
|
27
|
+
img{max-width:100%;vertical-align:middle;border:0;-ms-interpolation-mode:bicubic;}
|
28
|
+
#map_canvas img{max-width:none;}
|
29
|
+
button,input,select,textarea{margin:0;font-size:100%;vertical-align:middle;}
|
30
|
+
button,input{*overflow:visible;line-height:normal;}
|
31
|
+
button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0;}
|
32
|
+
button,input[type="button"],input[type="reset"],input[type="submit"]{cursor:pointer;-webkit-appearance:button;}
|
33
|
+
input[type="search"]{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-appearance:textfield;}
|
34
|
+
input[type="search"]::-webkit-search-decoration,input[type="search"]::-webkit-search-cancel-button{-webkit-appearance:none;}
|
35
|
+
textarea{overflow:auto;vertical-align:top;}
|
36
|
+
body{margin:0;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;line-height:18px;color:#333333;background-color:#ffffff;}
|
37
|
+
a{color:#0088cc;text-decoration:none;}
|
38
|
+
a:hover{color:#005580;text-decoration:underline;}
|
39
|
+
.container{margin-right:auto;margin-left:auto;*zoom:1;}.container:before,.container:after{display:table;content:"";}
|
40
|
+
.container:after{clear:both;}
|
41
|
+
.container-fluid{padding-right:20px;padding-left:20px;*zoom:1;}.container-fluid:before,.container-fluid:after{display:table;content:"";}
|
42
|
+
.container-fluid:after{clear:both;}
|
43
|
+
p{margin:0 0 9px;}p small{font-size:11px;color:#999999;}
|
44
|
+
.lead{margin-bottom:18px;font-size:20px;font-weight:200;line-height:27px;}
|
45
|
+
h1,h2,h3,h4,h5,h6{margin:0;font-family:inherit;font-weight:bold;color:inherit;text-rendering:optimizelegibility;}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small{font-weight:normal;color:#999999;}
|
46
|
+
h1{font-size:30px;line-height:36px;}h1 small{font-size:18px;}
|
47
|
+
h2{font-size:24px;line-height:36px;}h2 small{font-size:18px;}
|
48
|
+
h3{font-size:18px;line-height:27px;}h3 small{font-size:14px;}
|
49
|
+
h4,h5,h6{line-height:18px;}
|
50
|
+
h4{font-size:14px;}h4 small{font-size:12px;}
|
51
|
+
h5{font-size:12px;}
|
52
|
+
h6{font-size:11px;color:#999999;text-transform:uppercase;}
|
53
|
+
.page-header{padding-bottom:17px;margin:18px 0;border-bottom:1px solid #eeeeee;}
|
54
|
+
.page-header h1{line-height:1;}
|
55
|
+
ul,ol{padding:0;margin:0 0 9px 25px;}
|
56
|
+
ul ul,ul ol,ol ol,ol ul{margin-bottom:0;}
|
57
|
+
ul{list-style:disc;}
|
58
|
+
ol{list-style:decimal;}
|
59
|
+
li{line-height:18px;}
|
60
|
+
ul.unstyled,ol.unstyled{margin-left:0;list-style:none;}
|
61
|
+
dl{margin-bottom:18px;}
|
62
|
+
dt,dd{line-height:18px;}
|
63
|
+
dt{font-weight:bold;line-height:17px;}
|
64
|
+
dd{margin-left:9px;}
|
65
|
+
.dl-horizontal dt{float:left;width:120px;clear:left;text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
|
66
|
+
.dl-horizontal dd{margin-left:130px;}
|
67
|
+
hr{margin:18px 0;border:0;border-top:1px solid #eeeeee;border-bottom:1px solid #ffffff;}
|
68
|
+
strong{font-weight:bold;}
|
69
|
+
em{font-style:italic;}
|
70
|
+
.muted{color:#999999;}
|
71
|
+
abbr[title]{cursor:help;border-bottom:1px dotted #999999;}
|
72
|
+
abbr.initialism{font-size:90%;text-transform:uppercase;}
|
73
|
+
blockquote{padding:0 0 0 15px;margin:0 0 18px;border-left:5px solid #eeeeee;}blockquote p{margin-bottom:0;font-size:16px;font-weight:300;line-height:22.5px;}
|
74
|
+
blockquote small{display:block;line-height:18px;color:#999999;}blockquote small:before{content:'\2014 \00A0';}
|
75
|
+
blockquote.pull-right{float:right;padding-right:15px;padding-left:0;border-right:5px solid #eeeeee;border-left:0;}blockquote.pull-right p,blockquote.pull-right small{text-align:right;}
|
76
|
+
q:before,q:after,blockquote:before,blockquote:after{content:"";}
|
77
|
+
address{display:block;margin-bottom:18px;font-style:normal;line-height:18px;}
|
78
|
+
small{font-size:100%;}
|
79
|
+
cite{font-style:normal;}
|
80
|
+
.label,.badge{font-size:10.998px;font-weight:bold;line-height:14px;color:#ffffff;vertical-align:baseline;white-space:nowrap;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);background-color:#999999;}
|
81
|
+
.label{padding:1px 4px 2px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;}
|
82
|
+
.badge{padding:1px 9px 2px;-webkit-border-radius:9px;-moz-border-radius:9px;border-radius:9px;}
|
83
|
+
a.label:hover,a.badge:hover{color:#ffffff;text-decoration:none;cursor:pointer;}
|
84
|
+
.label-important,.badge-important{background-color:#b94a48;}
|
85
|
+
.label-important[href],.badge-important[href]{background-color:#953b39;}
|
86
|
+
.label-warning,.badge-warning{background-color:#f89406;}
|
87
|
+
.label-warning[href],.badge-warning[href]{background-color:#c67605;}
|
88
|
+
.label-success,.badge-success{background-color:#468847;}
|
89
|
+
.label-success[href],.badge-success[href]{background-color:#356635;}
|
90
|
+
.label-info,.badge-info{background-color:#3a87ad;}
|
91
|
+
.label-info[href],.badge-info[href]{background-color:#2d6987;}
|
92
|
+
.label-inverse,.badge-inverse{background-color:#333333;}
|
93
|
+
.label-inverse[href],.badge-inverse[href]{background-color:#1a1a1a;}
|
94
|
+
table{max-width:100%;background-color:transparent;border-collapse:collapse;border-spacing:0;}
|
95
|
+
.table{width:100%;margin-bottom:18px;}.table th,.table td{padding:8px;line-height:18px;text-align:left;vertical-align:top;border-top:1px solid #dddddd;}
|
96
|
+
.table th{font-weight:bold;}
|
97
|
+
.table thead th{vertical-align:bottom;}
|
98
|
+
.table caption+thead tr:first-child th,.table caption+thead tr:first-child td,.table colgroup+thead tr:first-child th,.table colgroup+thead tr:first-child td,.table thead:first-child tr:first-child th,.table thead:first-child tr:first-child td{border-top:0;}
|
99
|
+
.table tbody+tbody{border-top:2px solid #dddddd;}
|
100
|
+
.table-condensed th,.table-condensed td{padding:4px 5px;}
|
101
|
+
.table-bordered{border:1px solid #dddddd;border-collapse:separate;*border-collapse:collapsed;border-left:0;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;}.table-bordered th,.table-bordered td{border-left:1px solid #dddddd;}
|
102
|
+
.table-bordered caption+thead tr:first-child th,.table-bordered caption+tbody tr:first-child th,.table-bordered caption+tbody tr:first-child td,.table-bordered colgroup+thead tr:first-child th,.table-bordered colgroup+tbody tr:first-child th,.table-bordered colgroup+tbody tr:first-child td,.table-bordered thead:first-child tr:first-child th,.table-bordered tbody:first-child tr:first-child th,.table-bordered tbody:first-child tr:first-child td{border-top:0;}
|
103
|
+
.table-bordered thead:first-child tr:first-child th:first-child,.table-bordered tbody:first-child tr:first-child td:first-child{-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topleft:4px;}
|
104
|
+
.table-bordered thead:first-child tr:first-child th:last-child,.table-bordered tbody:first-child tr:first-child td:last-child{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-moz-border-radius-topright:4px;}
|
105
|
+
.table-bordered thead:last-child tr:last-child th:first-child,.table-bordered tbody:last-child tr:last-child td:first-child{-webkit-border-radius:0 0 0 4px;-moz-border-radius:0 0 0 4px;border-radius:0 0 0 4px;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-moz-border-radius-bottomleft:4px;}
|
106
|
+
.table-bordered thead:last-child tr:last-child th:last-child,.table-bordered tbody:last-child tr:last-child td:last-child{-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-moz-border-radius-bottomright:4px;}
|
107
|
+
.table-striped tbody tr:nth-child(odd) td,.table-striped tbody tr:nth-child(odd) th{background-color:#f9f9f9;}
|
108
|
+
.table tbody tr:hover td,.table tbody tr:hover th{background-color:#f5f5f5;}
|
109
|
+
table .span1{float:none;width:44px;margin-left:0;}
|
110
|
+
table .span2{float:none;width:124px;margin-left:0;}
|
111
|
+
table .span3{float:none;width:204px;margin-left:0;}
|
112
|
+
table .span4{float:none;width:284px;margin-left:0;}
|
113
|
+
table .span5{float:none;width:364px;margin-left:0;}
|
114
|
+
table .span6{float:none;width:444px;margin-left:0;}
|
115
|
+
table .span7{float:none;width:524px;margin-left:0;}
|
116
|
+
table .span8{float:none;width:604px;margin-left:0;}
|
117
|
+
table .span9{float:none;width:684px;margin-left:0;}
|
118
|
+
table .span10{float:none;width:764px;margin-left:0;}
|
119
|
+
table .span11{float:none;width:844px;margin-left:0;}
|
120
|
+
table .span12{float:none;width:924px;margin-left:0;}
|
121
|
+
table .span13{float:none;width:1004px;margin-left:0;}
|
122
|
+
table .span14{float:none;width:1084px;margin-left:0;}
|
123
|
+
table .span15{float:none;width:1164px;margin-left:0;}
|
124
|
+
table .span16{float:none;width:1244px;margin-left:0;}
|
125
|
+
table .span17{float:none;width:1324px;margin-left:0;}
|
126
|
+
table .span18{float:none;width:1404px;margin-left:0;}
|
127
|
+
table .span19{float:none;width:1484px;margin-left:0;}
|
128
|
+
table .span20{float:none;width:1564px;margin-left:0;}
|
129
|
+
table .span21{float:none;width:1644px;margin-left:0;}
|
130
|
+
table .span22{float:none;width:1724px;margin-left:0;}
|
131
|
+
table .span23{float:none;width:1804px;margin-left:0;}
|
132
|
+
table .span24{float:none;width:1884px;margin-left:0;}
|
133
|
+
form{margin:0 0 18px;}
|
134
|
+
fieldset{padding:0;margin:0;border:0;}
|
135
|
+
legend{display:block;width:100%;padding:0;margin-bottom:27px;font-size:19.5px;line-height:36px;color:#333333;border:0;border-bottom:1px solid #e5e5e5;}legend small{font-size:13.5px;color:#999999;}
|
136
|
+
label,input,button,select,textarea{font-size:13px;font-weight:normal;line-height:18px;}
|
137
|
+
input,button,select,textarea{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;}
|
138
|
+
label{display:block;margin-bottom:5px;}
|
139
|
+
select,textarea,input[type="text"],input[type="password"],input[type="datetime"],input[type="datetime-local"],input[type="date"],input[type="month"],input[type="time"],input[type="week"],input[type="number"],input[type="email"],input[type="url"],input[type="search"],input[type="tel"],input[type="color"],.uneditable-input{display:inline-block;height:18px;padding:4px;margin-bottom:9px;font-size:13px;line-height:18px;color:#555555;}
|
140
|
+
input,textarea{width:210px;}
|
141
|
+
textarea{height:auto;}
|
142
|
+
textarea,input[type="text"],input[type="password"],input[type="datetime"],input[type="datetime-local"],input[type="date"],input[type="month"],input[type="time"],input[type="week"],input[type="number"],input[type="email"],input[type="url"],input[type="search"],input[type="tel"],input[type="color"],.uneditable-input{background-color:#ffffff;border:1px solid #cccccc;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);-webkit-transition:border linear 0.2s,box-shadow linear 0.2s;-moz-transition:border linear 0.2s,box-shadow linear 0.2s;-ms-transition:border linear 0.2s,box-shadow linear 0.2s;-o-transition:border linear 0.2s,box-shadow linear 0.2s;transition:border linear 0.2s,box-shadow linear 0.2s;}textarea:focus,input[type="text"]:focus,input[type="password"]:focus,input[type="datetime"]:focus,input[type="datetime-local"]:focus,input[type="date"]:focus,input[type="month"]:focus,input[type="time"]:focus,input[type="week"]:focus,input[type="number"]:focus,input[type="email"]:focus,input[type="url"]:focus,input[type="search"]:focus,input[type="tel"]:focus,input[type="color"]:focus,.uneditable-input:focus{border-color:rgba(82, 168, 236, 0.8);outline:0;outline:thin dotted \9;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6);}
|
143
|
+
input[type="radio"],input[type="checkbox"]{margin:3px 0;*margin-top:0;line-height:normal;cursor:pointer;}
|
144
|
+
input[type="submit"],input[type="reset"],input[type="button"],input[type="radio"],input[type="checkbox"]{width:auto;}
|
145
|
+
.uneditable-textarea{width:auto;height:auto;}
|
146
|
+
select,input[type="file"]{height:28px;*margin-top:4px;line-height:28px;}
|
147
|
+
select{width:220px;border:1px solid #bbb;}
|
148
|
+
select[multiple],select[size]{height:auto;}
|
149
|
+
select:focus,input[type="file"]:focus,input[type="radio"]:focus,input[type="checkbox"]:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px;}
|
150
|
+
.radio,.checkbox{min-height:18px;padding-left:18px;}
|
151
|
+
.radio input[type="radio"],.checkbox input[type="checkbox"]{float:left;margin-left:-18px;}
|
152
|
+
.controls>.radio:first-child,.controls>.checkbox:first-child{padding-top:5px;}
|
153
|
+
.radio.inline,.checkbox.inline{display:inline-block;padding-top:5px;margin-bottom:0;vertical-align:middle;}
|
154
|
+
.radio.inline+.radio.inline,.checkbox.inline+.checkbox.inline{margin-left:10px;}
|
155
|
+
.input-mini{width:60px;}
|
156
|
+
.input-small{width:90px;}
|
157
|
+
.input-medium{width:150px;}
|
158
|
+
.input-large{width:210px;}
|
159
|
+
.input-xlarge{width:270px;}
|
160
|
+
.input-xxlarge{width:530px;}
|
161
|
+
input[class*="span"],select[class*="span"],textarea[class*="span"],.uneditable-input[class*="span"],.row-fluid input[class*="span"],.row-fluid select[class*="span"],.row-fluid textarea[class*="span"],.row-fluid .uneditable-input[class*="span"]{float:none;margin-left:0;}
|
162
|
+
.input-append input[class*="span"],.input-append .uneditable-input[class*="span"],.input-prepend input[class*="span"],.input-prepend .uneditable-input[class*="span"],.row-fluid .input-prepend [class*="span"],.row-fluid .input-append [class*="span"]{display:inline-block;}
|
163
|
+
input,textarea,.uneditable-input{margin-left:0;}
|
164
|
+
input.span12, textarea.span12, .uneditable-input.span12{width:930px;}
|
165
|
+
input.span11, textarea.span11, .uneditable-input.span11{width:850px;}
|
166
|
+
input.span10, textarea.span10, .uneditable-input.span10{width:770px;}
|
167
|
+
input.span9, textarea.span9, .uneditable-input.span9{width:690px;}
|
168
|
+
input.span8, textarea.span8, .uneditable-input.span8{width:610px;}
|
169
|
+
input.span7, textarea.span7, .uneditable-input.span7{width:530px;}
|
170
|
+
input.span6, textarea.span6, .uneditable-input.span6{width:450px;}
|
171
|
+
input.span5, textarea.span5, .uneditable-input.span5{width:370px;}
|
172
|
+
input.span4, textarea.span4, .uneditable-input.span4{width:290px;}
|
173
|
+
input.span3, textarea.span3, .uneditable-input.span3{width:210px;}
|
174
|
+
input.span2, textarea.span2, .uneditable-input.span2{width:130px;}
|
175
|
+
input.span1, textarea.span1, .uneditable-input.span1{width:50px;}
|
176
|
+
input[disabled],select[disabled],textarea[disabled],input[readonly],select[readonly],textarea[readonly]{cursor:not-allowed;background-color:#eeeeee;border-color:#ddd;}
|
177
|
+
input[type="radio"][disabled],input[type="checkbox"][disabled],input[type="radio"][readonly],input[type="checkbox"][readonly]{background-color:transparent;}
|
178
|
+
.control-group.warning>label,.control-group.warning .help-block,.control-group.warning .help-inline{color:#c09853;}
|
179
|
+
.control-group.warning .checkbox,.control-group.warning .radio,.control-group.warning input,.control-group.warning select,.control-group.warning textarea{color:#c09853;border-color:#c09853;}.control-group.warning .checkbox:focus,.control-group.warning .radio:focus,.control-group.warning input:focus,.control-group.warning select:focus,.control-group.warning textarea:focus{border-color:#a47e3c;-webkit-box-shadow:0 0 6px #dbc59e;-moz-box-shadow:0 0 6px #dbc59e;box-shadow:0 0 6px #dbc59e;}
|
180
|
+
.control-group.warning .input-prepend .add-on,.control-group.warning .input-append .add-on{color:#c09853;background-color:#fcf8e3;border-color:#c09853;}
|
181
|
+
.control-group.error>label,.control-group.error .help-block,.control-group.error .help-inline{color:#b94a48;}
|
182
|
+
.control-group.error .checkbox,.control-group.error .radio,.control-group.error input,.control-group.error select,.control-group.error textarea{color:#b94a48;border-color:#b94a48;}.control-group.error .checkbox:focus,.control-group.error .radio:focus,.control-group.error input:focus,.control-group.error select:focus,.control-group.error textarea:focus{border-color:#953b39;-webkit-box-shadow:0 0 6px #d59392;-moz-box-shadow:0 0 6px #d59392;box-shadow:0 0 6px #d59392;}
|
183
|
+
.control-group.error .input-prepend .add-on,.control-group.error .input-append .add-on{color:#b94a48;background-color:#f2dede;border-color:#b94a48;}
|
184
|
+
.control-group.success>label,.control-group.success .help-block,.control-group.success .help-inline{color:#468847;}
|
185
|
+
.control-group.success .checkbox,.control-group.success .radio,.control-group.success input,.control-group.success select,.control-group.success textarea{color:#468847;border-color:#468847;}.control-group.success .checkbox:focus,.control-group.success .radio:focus,.control-group.success input:focus,.control-group.success select:focus,.control-group.success textarea:focus{border-color:#356635;-webkit-box-shadow:0 0 6px #7aba7b;-moz-box-shadow:0 0 6px #7aba7b;box-shadow:0 0 6px #7aba7b;}
|
186
|
+
.control-group.success .input-prepend .add-on,.control-group.success .input-append .add-on{color:#468847;background-color:#dff0d8;border-color:#468847;}
|
187
|
+
input:focus:required:invalid,textarea:focus:required:invalid,select:focus:required:invalid{color:#b94a48;border-color:#ee5f5b;}input:focus:required:invalid:focus,textarea:focus:required:invalid:focus,select:focus:required:invalid:focus{border-color:#e9322d;-webkit-box-shadow:0 0 6px #f8b9b7;-moz-box-shadow:0 0 6px #f8b9b7;box-shadow:0 0 6px #f8b9b7;}
|
188
|
+
.form-actions{padding:17px 20px 18px;margin-top:18px;margin-bottom:18px;background-color:#f5f5f5;border-top:1px solid #e5e5e5;*zoom:1;}.form-actions:before,.form-actions:after{display:table;content:"";}
|
189
|
+
.form-actions:after{clear:both;}
|
190
|
+
.uneditable-input{overflow:hidden;white-space:nowrap;cursor:not-allowed;background-color:#ffffff;border-color:#eee;-webkit-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.025);-moz-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.025);box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.025);}
|
191
|
+
:-moz-placeholder{color:#999999;}
|
192
|
+
:-ms-input-placeholder{color:#999999;}
|
193
|
+
::-webkit-input-placeholder{color:#999999;}
|
194
|
+
.help-block,.help-inline{color:#555555;}
|
195
|
+
.help-block{display:block;margin-bottom:9px;}
|
196
|
+
.help-inline{display:inline-block;*display:inline;*zoom:1;vertical-align:middle;padding-left:5px;}
|
197
|
+
.input-prepend,.input-append{margin-bottom:5px;}.input-prepend input,.input-append input,.input-prepend select,.input-append select,.input-prepend .uneditable-input,.input-append .uneditable-input{position:relative;margin-bottom:0;*margin-left:0;vertical-align:middle;-webkit-border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0;}.input-prepend input:focus,.input-append input:focus,.input-prepend select:focus,.input-append select:focus,.input-prepend .uneditable-input:focus,.input-append .uneditable-input:focus{z-index:2;}
|
198
|
+
.input-prepend .uneditable-input,.input-append .uneditable-input{border-left-color:#ccc;}
|
199
|
+
.input-prepend .add-on,.input-append .add-on{display:inline-block;width:auto;height:18px;min-width:16px;padding:4px 5px;font-weight:normal;line-height:18px;text-align:center;text-shadow:0 1px 0 #ffffff;vertical-align:middle;background-color:#eeeeee;border:1px solid #ccc;}
|
200
|
+
.input-prepend .add-on,.input-append .add-on,.input-prepend .btn,.input-append .btn{margin-left:-1px;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;}
|
201
|
+
.input-prepend .active,.input-append .active{background-color:#a9dba9;border-color:#46a546;}
|
202
|
+
.input-prepend .add-on,.input-prepend .btn{margin-right:-1px;}
|
203
|
+
.input-prepend .add-on:first-child,.input-prepend .btn:first-child{-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px;}
|
204
|
+
.input-append input,.input-append select,.input-append .uneditable-input{-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px;}
|
205
|
+
.input-append .uneditable-input{border-right-color:#ccc;border-left-color:#eee;}
|
206
|
+
.input-append .add-on:last-child,.input-append .btn:last-child{-webkit-border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0;}
|
207
|
+
.input-prepend.input-append input,.input-prepend.input-append select,.input-prepend.input-append .uneditable-input{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;}
|
208
|
+
.input-prepend.input-append .add-on:first-child,.input-prepend.input-append .btn:first-child{margin-right:-1px;-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px;}
|
209
|
+
.input-prepend.input-append .add-on:last-child,.input-prepend.input-append .btn:last-child{margin-left:-1px;-webkit-border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0;}
|
210
|
+
.search-query{padding-right:14px;padding-right:4px \9;padding-left:14px;padding-left:4px \9;margin-bottom:0;-webkit-border-radius:14px;-moz-border-radius:14px;border-radius:14px;}
|
211
|
+
.form-search input,.form-inline input,.form-horizontal input,.form-search textarea,.form-inline textarea,.form-horizontal textarea,.form-search select,.form-inline select,.form-horizontal select,.form-search .help-inline,.form-inline .help-inline,.form-horizontal .help-inline,.form-search .uneditable-input,.form-inline .uneditable-input,.form-horizontal .uneditable-input,.form-search .input-prepend,.form-inline .input-prepend,.form-horizontal .input-prepend,.form-search .input-append,.form-inline .input-append,.form-horizontal .input-append{display:inline-block;*display:inline;*zoom:1;margin-bottom:0;}
|
212
|
+
.form-search .hide,.form-inline .hide,.form-horizontal .hide{display:none;}
|
213
|
+
.form-search label,.form-inline label{display:inline-block;}
|
214
|
+
.form-search .input-append,.form-inline .input-append,.form-search .input-prepend,.form-inline .input-prepend{margin-bottom:0;}
|
215
|
+
.form-search .radio,.form-search .checkbox,.form-inline .radio,.form-inline .checkbox{padding-left:0;margin-bottom:0;vertical-align:middle;}
|
216
|
+
.form-search .radio input[type="radio"],.form-search .checkbox input[type="checkbox"],.form-inline .radio input[type="radio"],.form-inline .checkbox input[type="checkbox"]{float:left;margin-right:3px;margin-left:0;}
|
217
|
+
.control-group{margin-bottom:9px;}
|
218
|
+
legend+.control-group{margin-top:18px;-webkit-margin-top-collapse:separate;}
|
219
|
+
.form-horizontal .control-group{margin-bottom:18px;*zoom:1;}.form-horizontal .control-group:before,.form-horizontal .control-group:after{display:table;content:"";}
|
220
|
+
.form-horizontal .control-group:after{clear:both;}
|
221
|
+
.form-horizontal .control-label{float:left;width:140px;padding-top:5px;text-align:right;}
|
222
|
+
.form-horizontal .controls{*display:inline-block;*padding-left:20px;margin-left:160px;*margin-left:0;}.form-horizontal .controls:first-child{*padding-left:160px;}
|
223
|
+
.form-horizontal .help-block{margin-top:9px;margin-bottom:0;}
|
224
|
+
.form-horizontal .form-actions{padding-left:160px;}
|
225
|
+
.btn{display:inline-block;*display:inline;*zoom:1;padding:4px 10px 4px;margin-bottom:0;font-size:13px;line-height:18px;*line-height:20px;color:#333333;text-align:center;text-shadow:0 1px 1px rgba(255, 255, 255, 0.75);vertical-align:middle;cursor:pointer;background-color:#f5f5f5;background-image:-moz-linear-gradient(top, #ffffff, #e6e6e6);background-image:-ms-linear-gradient(top, #ffffff, #e6e6e6);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));background-image:-webkit-linear-gradient(top, #ffffff, #e6e6e6);background-image:-o-linear-gradient(top, #ffffff, #e6e6e6);background-image:linear-gradient(top, #ffffff, #e6e6e6);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#e6e6e6', GradientType=0);border-color:#e6e6e6 #e6e6e6 #bfbfbf;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);*background-color:#e6e6e6;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);border:1px solid #cccccc;*border:0;border-bottom-color:#b3b3b3;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;*margin-left:.3em;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05);}.btn:hover,.btn:active,.btn.active,.btn.disabled,.btn[disabled]{background-color:#e6e6e6;*background-color:#d9d9d9;}
|
226
|
+
.btn:active,.btn.active{background-color:#cccccc \9;}
|
227
|
+
.btn:first-child{*margin-left:0;}
|
228
|
+
.btn:hover{color:#333333;text-decoration:none;background-color:#e6e6e6;*background-color:#d9d9d9;background-position:0 -15px;-webkit-transition:background-position 0.1s linear;-moz-transition:background-position 0.1s linear;-ms-transition:background-position 0.1s linear;-o-transition:background-position 0.1s linear;transition:background-position 0.1s linear;}
|
229
|
+
.btn:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px;}
|
230
|
+
.btn.active,.btn:active{background-color:#e6e6e6;background-color:#d9d9d9 \9;background-image:none;outline:0;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05);}
|
231
|
+
.btn.disabled,.btn[disabled]{cursor:default;background-color:#e6e6e6;background-image:none;opacity:0.65;filter:alpha(opacity=65);-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;}
|
232
|
+
.btn-large{padding:9px 14px;font-size:15px;line-height:normal;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;}
|
233
|
+
.btn-large [class^="icon-"]{margin-top:1px;}
|
234
|
+
.btn-small{padding:5px 9px;font-size:11px;line-height:16px;}
|
235
|
+
.btn-small [class^="icon-"]{margin-top:-1px;}
|
236
|
+
.btn-mini{padding:2px 6px;font-size:11px;line-height:14px;}
|
237
|
+
.btn-primary,.btn-primary:hover,.btn-warning,.btn-warning:hover,.btn-danger,.btn-danger:hover,.btn-success,.btn-success:hover,.btn-info,.btn-info:hover,.btn-inverse,.btn-inverse:hover{color:#ffffff;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);}
|
238
|
+
.btn-primary.active,.btn-warning.active,.btn-danger.active,.btn-success.active,.btn-info.active,.btn-inverse.active{color:rgba(255, 255, 255, 0.75);}
|
239
|
+
.btn{border-color:#ccc;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);}
|
240
|
+
.btn-primary{background-color:#0074cc;background-image:-moz-linear-gradient(top, #0088cc, #0055cc);background-image:-ms-linear-gradient(top, #0088cc, #0055cc);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0055cc));background-image:-webkit-linear-gradient(top, #0088cc, #0055cc);background-image:-o-linear-gradient(top, #0088cc, #0055cc);background-image:linear-gradient(top, #0088cc, #0055cc);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0055cc', GradientType=0);border-color:#0055cc #0055cc #003580;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);*background-color:#0055cc;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);}.btn-primary:hover,.btn-primary:active,.btn-primary.active,.btn-primary.disabled,.btn-primary[disabled]{background-color:#0055cc;*background-color:#004ab3;}
|
241
|
+
.btn-primary:active,.btn-primary.active{background-color:#004099 \9;}
|
242
|
+
.btn-warning{background-color:#faa732;background-image:-moz-linear-gradient(top, #fbb450, #f89406);background-image:-ms-linear-gradient(top, #fbb450, #f89406);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406));background-image:-webkit-linear-gradient(top, #fbb450, #f89406);background-image:-o-linear-gradient(top, #fbb450, #f89406);background-image:linear-gradient(top, #fbb450, #f89406);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fbb450', endColorstr='#f89406', GradientType=0);border-color:#f89406 #f89406 #ad6704;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);*background-color:#f89406;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);}.btn-warning:hover,.btn-warning:active,.btn-warning.active,.btn-warning.disabled,.btn-warning[disabled]{background-color:#f89406;*background-color:#df8505;}
|
243
|
+
.btn-warning:active,.btn-warning.active{background-color:#c67605 \9;}
|
244
|
+
.btn-danger{background-color:#da4f49;background-image:-moz-linear-gradient(top, #ee5f5b, #bd362f);background-image:-ms-linear-gradient(top, #ee5f5b, #bd362f);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#bd362f));background-image:-webkit-linear-gradient(top, #ee5f5b, #bd362f);background-image:-o-linear-gradient(top, #ee5f5b, #bd362f);background-image:linear-gradient(top, #ee5f5b, #bd362f);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ee5f5b', endColorstr='#bd362f', GradientType=0);border-color:#bd362f #bd362f #802420;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);*background-color:#bd362f;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);}.btn-danger:hover,.btn-danger:active,.btn-danger.active,.btn-danger.disabled,.btn-danger[disabled]{background-color:#bd362f;*background-color:#a9302a;}
|
245
|
+
.btn-danger:active,.btn-danger.active{background-color:#942a25 \9;}
|
246
|
+
.btn-success{background-color:#5bb75b;background-image:-moz-linear-gradient(top, #62c462, #51a351);background-image:-ms-linear-gradient(top, #62c462, #51a351);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#51a351));background-image:-webkit-linear-gradient(top, #62c462, #51a351);background-image:-o-linear-gradient(top, #62c462, #51a351);background-image:linear-gradient(top, #62c462, #51a351);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#62c462', endColorstr='#51a351', GradientType=0);border-color:#51a351 #51a351 #387038;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);*background-color:#51a351;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);}.btn-success:hover,.btn-success:active,.btn-success.active,.btn-success.disabled,.btn-success[disabled]{background-color:#51a351;*background-color:#499249;}
|
247
|
+
.btn-success:active,.btn-success.active{background-color:#408140 \9;}
|
248
|
+
.btn-info{background-color:#49afcd;background-image:-moz-linear-gradient(top, #5bc0de, #2f96b4);background-image:-ms-linear-gradient(top, #5bc0de, #2f96b4);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#2f96b4));background-image:-webkit-linear-gradient(top, #5bc0de, #2f96b4);background-image:-o-linear-gradient(top, #5bc0de, #2f96b4);background-image:linear-gradient(top, #5bc0de, #2f96b4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#5bc0de', endColorstr='#2f96b4', GradientType=0);border-color:#2f96b4 #2f96b4 #1f6377;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);*background-color:#2f96b4;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);}.btn-info:hover,.btn-info:active,.btn-info.active,.btn-info.disabled,.btn-info[disabled]{background-color:#2f96b4;*background-color:#2a85a0;}
|
249
|
+
.btn-info:active,.btn-info.active{background-color:#24748c \9;}
|
250
|
+
.btn-inverse{background-color:#414141;background-image:-moz-linear-gradient(top, #555555, #222222);background-image:-ms-linear-gradient(top, #555555, #222222);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#555555), to(#222222));background-image:-webkit-linear-gradient(top, #555555, #222222);background-image:-o-linear-gradient(top, #555555, #222222);background-image:linear-gradient(top, #555555, #222222);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#555555', endColorstr='#222222', GradientType=0);border-color:#222222 #222222 #000000;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);*background-color:#222222;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);}.btn-inverse:hover,.btn-inverse:active,.btn-inverse.active,.btn-inverse.disabled,.btn-inverse[disabled]{background-color:#222222;*background-color:#151515;}
|
251
|
+
.btn-inverse:active,.btn-inverse.active{background-color:#080808 \9;}
|
252
|
+
button.btn,input[type="submit"].btn{*padding-top:2px;*padding-bottom:2px;}button.btn::-moz-focus-inner,input[type="submit"].btn::-moz-focus-inner{padding:0;border:0;}
|
253
|
+
button.btn.btn-large,input[type="submit"].btn.btn-large{*padding-top:7px;*padding-bottom:7px;}
|
254
|
+
button.btn.btn-small,input[type="submit"].btn.btn-small{*padding-top:3px;*padding-bottom:3px;}
|
255
|
+
button.btn.btn-mini,input[type="submit"].btn.btn-mini{*padding-top:1px;*padding-bottom:1px;}
|
256
|
+
.modal-open .dropdown-menu{z-index:2050;}
|
257
|
+
.modal-open .dropdown.open{*z-index:2050;}
|
258
|
+
.modal-open .popover{z-index:2060;}
|
259
|
+
.modal-open .tooltip{z-index:2070;}
|
260
|
+
.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000000;}.modal-backdrop.fade{opacity:0;}
|
261
|
+
.modal-backdrop,.modal-backdrop.fade.in{opacity:0.8;filter:alpha(opacity=80);}
|
262
|
+
.modal{position:fixed;top:50%;left:50%;z-index:1050;overflow:auto;width:560px;margin:-250px 0 0 -280px;background-color:#ffffff;border:1px solid #999;border:1px solid rgba(0, 0, 0, 0.3);*border:1px solid #999;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);-moz-box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);-webkit-background-clip:padding-box;-moz-background-clip:padding-box;background-clip:padding-box;}.modal.fade{-webkit-transition:opacity .3s linear, top .3s ease-out;-moz-transition:opacity .3s linear, top .3s ease-out;-ms-transition:opacity .3s linear, top .3s ease-out;-o-transition:opacity .3s linear, top .3s ease-out;transition:opacity .3s linear, top .3s ease-out;top:-25%;}
|
263
|
+
.modal.fade.in{top:50%;}
|
264
|
+
.modal-header{padding:9px 15px;border-bottom:1px solid #eee;}.modal-header .close{margin-top:2px;}
|
265
|
+
.modal-body{overflow-y:auto;max-height:400px;padding:15px;}
|
266
|
+
.modal-form{margin-bottom:0;}
|
267
|
+
.modal-footer{padding:14px 15px 15px;margin-bottom:0;text-align:right;background-color:#f5f5f5;border-top:1px solid #ddd;-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px;-webkit-box-shadow:inset 0 1px 0 #ffffff;-moz-box-shadow:inset 0 1px 0 #ffffff;box-shadow:inset 0 1px 0 #ffffff;*zoom:1;}.modal-footer:before,.modal-footer:after{display:table;content:"";}
|
268
|
+
.modal-footer:after{clear:both;}
|
269
|
+
.modal-footer .btn+.btn{margin-left:5px;margin-bottom:0;}
|
270
|
+
.modal-footer .btn-group .btn+.btn{margin-left:-1px;}
|
271
|
+
.close{float:right;font-size:20px;font-weight:bold;line-height:18px;color:#000000;text-shadow:0 1px 0 #ffffff;opacity:0.2;filter:alpha(opacity=20);}.close:hover{color:#000000;text-decoration:none;cursor:pointer;opacity:0.4;filter:alpha(opacity=40);}
|
272
|
+
button.close{padding:0;cursor:pointer;background:transparent;border:0;-webkit-appearance:none;}
|
273
|
+
.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #eee;border:1px solid rgba(0, 0, 0, 0.05);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.05);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.05);}.well blockquote{border-color:#ddd;border-color:rgba(0, 0, 0, 0.15);}
|
274
|
+
.well-large{padding:24px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;}
|
275
|
+
.well-small{padding:9px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;}
|
276
|
+
}
|
277
|
+
|
278
|
+
.modal-backdrop {
|
279
|
+
background-color: #000000;
|
280
|
+
opacity: 0.7;
|
281
|
+
filter: alpha(opacity=50);
|
282
|
+
bottom: 0;
|
283
|
+
left: 0;
|
284
|
+
position: fixed;
|
285
|
+
right: 0;
|
286
|
+
top: 0;
|
287
|
+
z-index: 1040;
|
288
|
+
}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
module KoreanZipcodeFinder
|
4
|
+
class ZipcodesController < ApplicationController
|
5
|
+
layout false
|
6
|
+
|
7
|
+
def new
|
8
|
+
render 'new'
|
9
|
+
end
|
10
|
+
|
11
|
+
def search
|
12
|
+
@zipcodes = KoreanZipcodeFinder.find_zipcode(params[:dong])
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<div class="korean_zipcode_finder_modal_wrapper">
|
2
|
+
<div class="zipcode_box modal">
|
3
|
+
<div class="modal-header">
|
4
|
+
<button class="close_modal_popup close" data-dismiss="modal" type="button">×</button>
|
5
|
+
<h3>우편번호 찾기</h3>
|
6
|
+
<%= form_tag("/korean_zipcode_finder/zipcodes/search", :method => 'get', :class => "find_zipcode_form well form-inline") do %>
|
7
|
+
<%= label_tag "동/읍/면" %>
|
8
|
+
<%= text_field_tag "dong" %>
|
9
|
+
<%= submit_tag '우편번호 찾기', :class => "btn btn-primary find_zipcode_submit" %>
|
10
|
+
<% end %>
|
11
|
+
</div>
|
12
|
+
|
13
|
+
<div class="modal-body">
|
14
|
+
<table class="table table-striped">
|
15
|
+
<tbody class="zipcode_list_box">
|
16
|
+
<%#= 'place for search list' %>
|
17
|
+
</tbody>
|
18
|
+
</table>
|
19
|
+
</div>
|
20
|
+
|
21
|
+
<div class="modal-footer">
|
22
|
+
<a class="btn close_modal_popup" data-dismiss="modal" href="#">닫기</a>
|
23
|
+
</div>
|
24
|
+
</div>
|
25
|
+
</div>
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<% if @zipcodes.present? %>
|
2
|
+
|
3
|
+
<% @zipcodes.each_with_index do |zipcode, i| %>
|
4
|
+
<tr class="zipcode_node">
|
5
|
+
<td>
|
6
|
+
[<%= zipcode.zipcode_01 %>-<%= zipcode.zipcode_02 %>]
|
7
|
+
</td>
|
8
|
+
<td>
|
9
|
+
<%= link_to zipcode.original_address, '#', :class => 'zipcode_select', "data-zipcode01" => zipcode.zipcode_01, "data-zipcode02" => zipcode.zipcode_02, "data-address01" => zipcode.address %>
|
10
|
+
</td>
|
11
|
+
</tr>
|
12
|
+
<% end %>
|
13
|
+
|
14
|
+
<% else %>
|
15
|
+
|
16
|
+
<tr class="no_zipcode_found">
|
17
|
+
<td>
|
18
|
+
검색된 우편번호가 없습니다.
|
19
|
+
</td>
|
20
|
+
</tr>
|
21
|
+
|
22
|
+
<% end %>
|
23
|
+
|
24
|
+
|
data/config/routes.rb
ADDED
@@ -0,0 +1,5 @@
|
|
1
|
+
Rails.application.routes.draw do
|
2
|
+
match '/korean_zipcode_finder/zipcodes/new' => 'korean_zipcode_finder/zipcodes#new'
|
3
|
+
match '/korean_zipcode_finder/zipcodes/search' => 'korean_zipcode_finder/zipcodes#search'
|
4
|
+
match '/korean_zipcode_finder/add_bootstrap_css' => 'korean_zipcode_finder/zipcodes#add_bootstrap_css'
|
5
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "korean_zipcode_finder/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "korean_zipcode_finder"
|
7
|
+
s.version = KoreanZipcodeFinder::VERSION
|
8
|
+
s.authors = ["KunHa"]
|
9
|
+
s.email = ["potato9@gmail.com"]
|
10
|
+
s.homepage = ""
|
11
|
+
s.summary = %q{Korean zipcode finder}
|
12
|
+
s.description = %q{Korean zipcode finder}
|
13
|
+
|
14
|
+
s.rubyforge_project = "korean_zipcode_finder"
|
15
|
+
|
16
|
+
s.files = `git ls-files`.split("\n")
|
17
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
18
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
|
+
s.require_paths = ["lib"]
|
20
|
+
|
21
|
+
s.add_runtime_dependency 'nokogiri'
|
22
|
+
end
|
data/lib/engine.rb
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
require "korean_zipcode_finder/version"
|
2
|
+
require 'korean_zipcode_finder/configuration'
|
3
|
+
require 'engine' if defined?(Rails)
|
4
|
+
|
5
|
+
require 'net/http'
|
6
|
+
require 'open-uri'
|
7
|
+
require 'iconv'
|
8
|
+
require 'nokogiri'
|
9
|
+
|
10
|
+
|
11
|
+
module KoreanZipcodeFinder
|
12
|
+
extend Configuration
|
13
|
+
Struct.new("KoreanZipcodeFinder", "zipcode", "zipcode_01", "zipcode_02", "address", "original_address")
|
14
|
+
|
15
|
+
def self.find_zipcode(dong_name)
|
16
|
+
iconv = Iconv.new("euc-kr", "utf-8//IGNORE")
|
17
|
+
keyword = iconv.conv(dong_name.strip)
|
18
|
+
|
19
|
+
response = Net::HTTP.post_form URI.parse(Configuration::URL), {'regkey' => api_key, 'target' => 'post', 'query' => keyword}
|
20
|
+
nodes = Nokogiri::XML(response.body).css("item")
|
21
|
+
|
22
|
+
nodes.map do |node|
|
23
|
+
original_address = node.css("address").text
|
24
|
+
address = original_address.strip.sub(/\s(\d+)(~?)(\d+)\z/, "")
|
25
|
+
zipcode = node.css("postcd").text
|
26
|
+
zipcode_01 = zipcode[0..2]
|
27
|
+
zipcode_02 = zipcode[-3..-1]
|
28
|
+
|
29
|
+
Struct::KoreanZipcodeFinder.new(zipcode, zipcode_01, zipcode_02, address, original_address)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
metadata
ADDED
@@ -0,0 +1,73 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: korean_zipcode_finder
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- KunHa
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-06-09 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: nokogiri
|
16
|
+
requirement: &70296376698940 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *70296376698940
|
25
|
+
description: Korean zipcode finder
|
26
|
+
email:
|
27
|
+
- potato9@gmail.com
|
28
|
+
executables: []
|
29
|
+
extensions: []
|
30
|
+
extra_rdoc_files: []
|
31
|
+
files:
|
32
|
+
- .gitignore
|
33
|
+
- Gemfile
|
34
|
+
- README.mkd
|
35
|
+
- Rakefile
|
36
|
+
- app/assets/javascripts/korean_zipcode_finder/core.js
|
37
|
+
- app/assets/stylesheets/korean_zipcode_finder/core.css.scss
|
38
|
+
- app/controllers/korean_zipcode_finder/zipcodes_controller.rb
|
39
|
+
- app/models/korean_zipcode_finder/zipcode.rb
|
40
|
+
- app/views/korean_zipcode_finder/zipcodes/new.html.erb
|
41
|
+
- app/views/korean_zipcode_finder/zipcodes/search.html.erb
|
42
|
+
- config/routes.rb
|
43
|
+
- korean_zipcode_finder.gemspec
|
44
|
+
- lib/engine.rb
|
45
|
+
- lib/korean_zipcode_finder.rb
|
46
|
+
- lib/korean_zipcode_finder/configuration.rb
|
47
|
+
- lib/korean_zipcode_finder/version.rb
|
48
|
+
homepage: ''
|
49
|
+
licenses: []
|
50
|
+
post_install_message:
|
51
|
+
rdoc_options: []
|
52
|
+
require_paths:
|
53
|
+
- lib
|
54
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
55
|
+
none: false
|
56
|
+
requirements:
|
57
|
+
- - ! '>='
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: '0'
|
60
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
61
|
+
none: false
|
62
|
+
requirements:
|
63
|
+
- - ! '>='
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: '0'
|
66
|
+
requirements: []
|
67
|
+
rubyforge_project: korean_zipcode_finder
|
68
|
+
rubygems_version: 1.8.10
|
69
|
+
signing_key:
|
70
|
+
specification_version: 3
|
71
|
+
summary: Korean zipcode finder
|
72
|
+
test_files: []
|
73
|
+
has_rdoc:
|