Skip to content
This repository was archived by the owner on Oct 6, 2022. It is now read-only.

Commit 38f5884

Browse files
committed
Verze 1.0.3
1 parent 6325a30 commit 38f5884

18 files changed

+3050
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
2+
.skautbazar_row_hidden{
3+
display: none;
4+
}
5+
6+
.skautbazar_table{
7+
width: 100%;
8+
}
9+
10+
.skautbazar_table td{
11+
padding: 5px;
12+
vertical-align: top;
13+
text-align: left;
14+
}
15+
16+
.skautbazar_table_header{
17+
width: 20%;
18+
}
19+
20+
.required-info{
21+
color: red;
22+
padding-left: 20px;
23+
}
24+
25+
.skautbazar_buttons{
26+
display: block;
27+
}
28+

includes/css/style.skautbazar.css

Lines changed: 216 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,216 @@
1+
.skautbazar_post{
2+
width: 100%;
3+
padding: 30px;
4+
margin-bottom: 32px;
5+
background-color: #eee;
6+
}
7+
8+
.skautbazar_post:last-child{
9+
border-bottom: none;
10+
}
11+
12+
.skautbazar_post p{
13+
14+
margin: 0;
15+
padding: 0;
16+
}
17+
18+
.skautbazar_post_heading{
19+
line-height: 140%;
20+
margin: 0;
21+
padding: 0;
22+
display: inline;
23+
}
24+
25+
.skautbazar_infotext{
26+
line-height: 180%;
27+
padding-bottom: 9px;
28+
}
29+
30+
.skautbazar_clear{
31+
clear: both;
32+
}
33+
34+
.skatubazar_post_img{
35+
width: 44%;
36+
float: left;
37+
}
38+
39+
.skatubazar_post_img img{
40+
width: 100%;
41+
height: auto;
42+
}
43+
44+
.skatubazar_post_img img{
45+
width: 100%;
46+
height: auto;
47+
}
48+
49+
.skatubazar_post_box{
50+
width: 55%;
51+
float: right;
52+
}
53+
54+
.skautbazar_prev_img{
55+
56+
padding: 20px;
57+
}
58+
59+
.skautbazar_prev_img img{
60+
padding-right: 20px;
61+
padding-top: 10px;
62+
}
63+
64+
.skautbazar_post_info{
65+
padding: 20px 0;
66+
}
67+
68+
.skatubazar_post_category{
69+
padding: 20px 0;
70+
}
71+
72+
.skautbazar_rezervace{
73+
text-align: right;
74+
}
75+
76+
.skautbazar_rezervace a{
77+
display: inline-block;
78+
text-align: center;
79+
padding: 6px 14px;
80+
background-color: green;
81+
text-decoration: none !important;
82+
color: #fff;
83+
-webkit-border-radius: 4px;
84+
-moz-border-radius: 4px;
85+
border-radius: 4px;
86+
}
87+
88+
.skautbazar_rezervovano{
89+
background-color: red;
90+
text-align: center;
91+
padding: 6px 14px;
92+
color: #fff;
93+
-webkit-border-radius: 4px;
94+
-moz-border-radius: 4px;
95+
border-radius: 4px;
96+
}
97+
98+
.skautbazar_emailbox_bg{
99+
display: none;
100+
position: fixed;
101+
overflow-y: scroll;
102+
top: 0;
103+
left: 0;
104+
right: 0;
105+
bottom: 0;
106+
z-index: 8888 !important;
107+
108+
width: 100%;
109+
height: 100%;
110+
111+
-webkit-animation: fade-in .25s ease-in;
112+
-moz-animation-name: fade-in .25s ease-in;
113+
-ms-animation-name: fade-in .25s ease-in;
114+
-o-animation-name: fade-in .25s ease-in;
115+
animation-name: fade-in .25s ease-in;
116+
117+
118+
background-color: rgba(0, 0, 0, 0.8);
119+
}
120+
121+
.skautbazar_emailbox{
122+
display: block;
123+
position: relative;
124+
margin: auto;
125+
width: 600px;
126+
top: 50%;
127+
margin-top: -150px;
128+
padding: 30px;
129+
background-color: #fff;
130+
}
131+
132+
.skautbazar_email_close{
133+
float: right;
134+
}
135+
136+
body{
137+
position: relative;
138+
height: 100%;
139+
min-height: 100%;
140+
}
141+
142+
143+
.skatubazar_post_category{
144+
145+
}
146+
147+
.skautbazar_infotext{
148+
width: 70%;
149+
float: left;
150+
}
151+
152+
.skautbazar_rezervace{
153+
width: 29%;
154+
float: right;
155+
}
156+
157+
.skautbazar_pagination{
158+
list-style-type: none;
159+
width: 100%;
160+
}
161+
162+
.skautbazar_pagination li{
163+
float: left;
164+
}
165+
166+
.skautbazar_pagination li a{
167+
display: block;
168+
float: left;
169+
margin: 0 4px;
170+
}
171+
172+
.skautbazar_post_box_full{
173+
width: 100%;
174+
}
175+
176+
@media screen and (max-width: 460px) {
177+
.skatubazar_post_img,
178+
.skatubazar_post_box,
179+
.skautbazar_prev_img,
180+
.skatubazar_post_category,
181+
.skautbazar_infotext,
182+
.skautbazar_infotext,
183+
.skautbazar_rezervace
184+
{
185+
width: 100%;
186+
}
187+
188+
.skautbazar_prev_img{
189+
margin: 0;
190+
padding: 0;
191+
}
192+
193+
.skautbazar_post_heading{
194+
margin-top: 1em;
195+
margin-bottom: 0;
196+
padding-bottom: 0;
197+
}
198+
199+
.skautbazar_post_info{
200+
padding: 0;
201+
}
202+
203+
.skatubazar_post_box{
204+
margin-top: 10px;
205+
}
206+
207+
.skautbazar_rezervace{
208+
margin-top: 10px !important;
209+
float: left;
210+
padding-top: 15px;
211+
}
212+
213+
214+
}
215+
216+
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
jQuery(document).ready(function($) {
2+
3+
// $('#title').hide();
4+
5+
6+
if ($('.skautbazar_intro_image_button').length > 0) {
7+
if ( typeof wp !== 'undefined' && wp.media && wp.media.editor) {
8+
$('.wrap').on('click', '.skautbazar_intro_image_button', function(e) {
9+
e.preventDefault();
10+
var button = $(this);
11+
var $img_id = $('#skautbazar_image_id');
12+
var $img = $('#skautbazar_intro_image');
13+
14+
wp.media.editor.send.attachment = function(props, attachment) {
15+
$img_id.val(attachment.id);
16+
$img.css({'display':'inline'});
17+
$img.attr('src', attachment.url);
18+
};
19+
wp.media.editor.open(button);
20+
21+
return false;
22+
});
23+
}
24+
};
25+
26+
$('.skautbazar_intro_image_delete_button').click(function(e){
27+
e.preventDefault();
28+
var $img_id = $('#skautbazar_image_id');
29+
var $img = $('#skautbazar_intro_image');
30+
$img_id.val('');
31+
$img.css({'display':'none'});
32+
$img.attr('src', '#');
33+
});
34+
35+
36+
37+
38+
switch($('.skautbazar_type').val()){
39+
case 'exchange':
40+
$('.skautbazar_row_hidden').css({'display':'none'});
41+
$('#skautbazar_row_exchange.skautbazar_row_hidden').css({'display':'table-row'});
42+
break;
43+
case 'price':
44+
$('.skautbazar_row_hidden').css({'display':'none'});
45+
$('#skautbazar_row_price.skautbazar_row_hidden').css({'display':'table-row'});
46+
break;
47+
default:
48+
$('.skautbazar_row_hidden').css({'display':'none'});
49+
break;
50+
}
51+
52+
53+
54+
var $check = $('#skautbazar_status').val();
55+
if($check == 2 || $check == 3 ) $('#skautbazar_row_reservation_email.skautbazar_row_hidden').css({'display':'table-row'});
56+
57+
$('#skautbazar_status').change(function(){
58+
if($(this).val() == 1) $('#skautbazar_row_reservation_email.skautbazar_row_hidden').css({'display':'none'});
59+
else $('#skautbazar_row_reservation_email.skautbazar_row_hidden').css({'display':'table-row'});
60+
});
61+
62+
63+
64+
$('.skautbazar_type').change(function(){
65+
$('skautbazar_row').css({'display':'none'});
66+
switch($(this).val()){
67+
case 'exchange':
68+
$('.skautbazar_row_hidden').css({'display':'none'});
69+
$('#skautbazar_row_exchange.skautbazar_row_hidden').css({'display':'table-row'});
70+
break;
71+
case 'price':
72+
$('.skautbazar_row_hidden').css({'display':'none'});
73+
$('#skautbazar_row_price.skautbazar_row_hidden').css({'display':'table-row'});
74+
break;
75+
default:
76+
$('.skautbazar_row_hidden').css({'display':'none'});
77+
break;
78+
}
79+
});
80+
81+
82+
83+
$('#post').submit(function(e){
84+
$('.required-info, .skatubazar_error').remove();
85+
var error = true;
86+
87+
$('.required').each(function(){
88+
error = false;
89+
if( $(this).val() == '-1' || $(this).val() == '' ){
90+
$(this).after('<span class="required-info">'+ translation.fill_required_field +'</span>');
91+
e.preventDefault();
92+
}
93+
});
94+
95+
if( $('#skautbazar_type_author').val() == 'price' && $('#skautbazar_price').val() == '' ) {
96+
$('#skautbazar_price').after('<span class="required-info">'+ translation.fill_required_field +'</span>');
97+
error = false;
98+
}
99+
100+
if( $('#skautbazar_type_author').val() == 'exchange' && $('#skautbazar_exchange').val() == '' ) {
101+
$('#skautbazar_exchange').after('<span class="required-info">'+ translation.fill_required_field +'</span>');
102+
error = false;
103+
}
104+
105+
if(!error) $('.wrap h2').after('<div class="error skatubazar_error"><p>'+ translation.fill_required_field +'</p></div>');
106+
});
107+
108+
109+
110+
$('#skautbazar_cancel_reservation').click(function(e){
111+
e.preventDefault();
112+
113+
$('.status_message').html( translation.active );
114+
115+
$('#skautbazar_buyer_email').val('');
116+
$('#skautbazar_status').val(1);
117+
$(this).css({'display':'none'});
118+
$('#skautbazar_buyer_email').css({'display':'none'});
119+
});
120+
121+
122+
123+
});

0 commit comments

Comments
 (0)