Skip to content

Commit

Permalink
v2.0.0.45
Browse files Browse the repository at this point in the history
  • Loading branch information
stiofan committed Jan 30, 2019
1 parent 1e8c74b commit e66f2a5
Show file tree
Hide file tree
Showing 29 changed files with 616 additions and 476 deletions.
2 changes: 1 addition & 1 deletion assets/css/admin.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/css/admin.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/css/block_editor.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/css/block_editor.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/css/gd_core_frontend.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/css/gd_core_frontend.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/css/partials/_add-listing.scss
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@
border-top:1px solid #ccc; padding-top:10px;
}

input.geodir_button{
.geodir_button{
width: auto;
}
}
Expand Down
33 changes: 31 additions & 2 deletions assets/css/partials/_gd_lity.scss
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,12 @@
transition: opacity var(--lity-transition-duration) var(--lity-transition-timing-function);
}

.lity-loading .lity-loader {
.lity-loading .lity-loader, .lity-spinner {
opacity: 1;
i,svg{
color: #fff;
font-size: 3em ;
}
}

.lity-container {
Expand Down Expand Up @@ -125,13 +129,16 @@
min-height:25vh;
color: #505050;
overflow: auto;
input,select{
input,select,textarea{
width: 100%;
padding: 5px;
border-radius: 4px;
border: 1px #ddd solid;
color: #505050;
}
input[type=radio],input[type=checkbox]{
width: auto;
}
label{
color: #505050;
font-weight: bold;
Expand All @@ -140,6 +147,23 @@
.gd-modal-button{
margin-top: 10px;
}

.lity-button{
background: #0073aa;
padding: 5px 15px;
text-decoration: none;
border-radius: 5px;
color: #fff;
font-size: 14px;
font-weight: bold;
}

.lity-button-primary{
background: #0073aa;
}



}

.lity-caption {
Expand Down Expand Up @@ -318,3 +342,8 @@
.lity-hide {
display: none;
}

// prevent body scroll when lity is active
.lity-active body{
overflow: hidden;
}
16 changes: 16 additions & 0 deletions assets/css/partials/_helpers.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@
display: none;
}

.gd-disabled{
background: #b5b5b5;
color: #f1f1f1;
&:hover{
background: #b5b5b5;
color: #f1f1f1;
}
}

.gd-align-left{
float: left;
}
Expand All @@ -14,6 +23,12 @@
text-align: center;
}

.gd-pointer{
cursor: pointer;
i,span,div{
cursor: pointer;
}
}

// IOS style scroll bars
.gd-ios-scrollbars::-webkit-scrollbar
Expand All @@ -30,6 +45,7 @@
.gd-ios-scrollbars::-webkit-scrollbar-thumb
{
background: rgba(128, 128, 128, 0.5);
border-radius: 2px;
}

// icon hover swap
Expand Down
2 changes: 1 addition & 1 deletion assets/css/style.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/css/style.css.map

Large diffs are not rendered by default.

22 changes: 12 additions & 10 deletions assets/js/add-listing.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ jQuery(function($) {
*/
var geodir_changes_made = false;
window.onbeforeunload = function() {
return geodir_changes_made ? geodir_params.txt_lose_changes : null; // @todo make translatable
return geodir_changes_made ? geodir_params.txt_lose_changes : null;
};
/**
* Poll the form looking for changes every 10 seconds, if we detect a change then auto save
Expand Down Expand Up @@ -158,7 +158,7 @@ function geodir_auto_save_post() {
jQuery.ajax({
type: "POST",
url: geodir_params.ajax_url,
data: form_data, // serializes the form's elements.
data: form_data,
success: function(data) {
if (data.success) {
console.log('auto saved');
Expand All @@ -183,10 +183,14 @@ function geodir_get_form_data() {
function geodir_save_post() {
var form_data = geodir_get_form_data() + '&target=submit';
console.log(form_data);
$button_text = jQuery('#geodir-add-listing-submit button').html();
jQuery.ajax({
type: "POST",
url: geodir_params.ajax_url,
data: form_data, // serializes the form's elements.
beforeSend: function() {
jQuery('#geodir-add-listing-submit button').html('<i class="fas fa-circle-notch fa-spin"></i> ' + $button_text).addClass('gd-disabled').prop('disabled', true);
},
success: function(data) {
if (data.success) {
console.log('saved');
Expand All @@ -197,12 +201,18 @@ function geodir_save_post() {
jQuery(window).scrollTop(jQuery('.gd-notification').offset().top - 100); // scroll to new notification
return true;
} else {
jQuery('#geodir-add-listing-submit button').html($button_text).removeClass('gd-disabled').prop('disabled', false);
console.log('save failed');
if (typeof data == 'object' && data.success === false && data.data) {
alert(data.data);
}
return false;
}
},
error: function(xhr, textStatus, errorThrown) {
jQuery('#geodir-add-listing-submit button').html($button_text).removeClass('gd-disabled').prop('disabled', false);
alert(geodir_params.rating_error_msg);
console.log(textStatus);
}
});
}
Expand Down Expand Up @@ -263,19 +273,11 @@ function geodir_validate_submit(form) {
var is_validate = true;
jQuery(form).find(".required_field:visible").each(function() {
jQuery(this).find("[field_type]:visible, .chosen_select, .geodir_location_add_listing_chosen, .editor, .event_recurring_dates, .geodir-custom-file-upload, .gd_image_required_field, .g-recaptcha-response").each(function() {
// if (jQuery(this).is('.chosen_select, .geodir_location_add_listing_chosen')) {
// var chosen_ele = jQuery(this);
// jQuery('#' + jQuery(this).attr('id') + '_chzn').mouseleave(function () {
// geodir_validate_field(chosen_ele);
// });
// }
if (!geodir_validate_field(this)) {
is_validate = false;
//console.log(false);
} else {
//console.log(true);
}
// console.log(this);
});
});
if (is_validate) {
Expand Down
2 changes: 1 addition & 1 deletion assets/js/add-listing.min.js

Large diffs are not rendered by default.

65 changes: 39 additions & 26 deletions assets/js/libraries/gd_lity.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
facebookvideo: facebookvideoHandler,
iframe: iframeHandler
},
template: '<div class="lity" role="dialog" aria-label="Dialog Window (Press escape to close)" tabindex="-1"><div class="lity-wrap" data-lity-close role="document"><div class="lity-loader" aria-hidden="true">Loading...</div><div class="lity-container"><div class="lity-content"></div><button class="lity-close" type="button" aria-label="Close (Press escape to close)" data-lity-close>&times;</button></div></div></div>'
template: '<div class="lity" role="dialog" aria-label="Dialog Window (Press escape to close)" tabindex="-1"><div class="lity-wrap" data-lity-close role="document"><div class="lity-loader" aria-hidden="true"><i class="fas fa-circle-notch fa-spin"></i></div><div class="lity-container"><div class="lity-content"></div><button class="lity-close" type="button" aria-label="Close (Press escape to close)" data-lity-close>&times;</button></div></div></div>'
};

var _imageRegexp = /(^data:image\/)|(\.(png|jpe?g|gif|svg|webp|bmp|ico|tiff?)(\?\S*)?$)/i;
Expand Down Expand Up @@ -256,6 +256,11 @@
function inlineHandler(target, instance) {
var el, placeholder, hasHideClass;

// check for loader
if(target==='loading'){
return 'loading';
}

try {
el = $(target);
} catch (e) {
Expand Down Expand Up @@ -637,35 +642,43 @@
;

function ready(result) {
content = $(result)
.css('max-height', winHeight() + 'px')
;

element
.find('.lity-loader')
.each(function() {
var loader = $(this);

transitionEnd(loader)
.always(function() {
loader.remove();
})
;
})
;
// check if we are just loading the loader
if(result==='loading'){
result = ".lity-loader";
content = $(result);
isReady = true;
}else{
content = $(result)
.css('max-height', winHeight() + 'px')
;

element
.removeClass('lity-loading')
.find('.lity-content')
.empty()
.append(content)
;
element
.find('.lity-loader')
.each(function() {
var loader = $(this);

transitionEnd(loader)
.always(function() {
loader.remove();
})
;
})
;

isReady = true;
element
.removeClass('lity-loading')
.find('.lity-content')
.empty()
.append(content)
;

content
.trigger('lity:ready', [self])
;
isReady = true;

content
.trigger('lity:ready', [self])
;
}
}
}

Expand Down
Loading

0 comments on commit e66f2a5

Please sign in to comment.