Skip to content

Commit c80f000

Browse files
author
Leonix
committed
wa-plugins/shipping/worldwide v.1.1.6
* Improved support for the Webasyst 2 interface.
1 parent 2340c1c commit c80f000

File tree

2 files changed

+31
-20
lines changed

2 files changed

+31
-20
lines changed

wa-plugins/shipping/worldwide/lib/config/plugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
'description' => /*_wp*/('Reliable international delivery tailored to local conditions.'),
55
'icon' => 'img/worldwide16.png',
66
'logo' => 'img/worldwide.png',
7-
'version' => '1.1.5',
7+
'version' => '1.1.6',
88
'vendor' => 'webasyst',
99
'services_by_type' => true,
1010
);

wa-plugins/shipping/worldwide/templates/settings.html

Lines changed: 30 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,20 @@
33
#{$plid}-delivery-table tr.{$plid}-disabled td { text-decoration: line-through; color: #aaa; }
44
.{$plid}-disable-region-link i.delete { opacity: 0; }
55
.{$plid}-disable-region-link:hover i.delete { opacity: 1; }
6+
7+
.is-wa2 .s-payment-shipping-logo { margin-top: 0; }
8+
.is-wa2 [name="shipping[settings][service_name]"] { width: 20rem; }
9+
.is-wa2 .{$plid}-add-column-link * { font-style: normal; font-weight: normal; }
10+
.is-wa2 #{$plid}-deliverty-settings .hint { color: var(--text-color-hint); }
11+
.is-wa2 #{$plid}-deliverty-settings { --font-size-small: 87.5%; --font-size-smaller: 75%; }
12+
.is-wa2 #{$plid}-deliverty-settings .field .value:not(:first-child) { display: block; }
13+
.is-wa2 #{$plid}-delivery-table { font-size: var(--font-size-small); }
14+
.is-wa2 #{$plid}-delivery-table input.numerical.short { width: 7rem; }
15+
@media screen and (max-width: 1300px) {
16+
.is-wa2 #{$plid}-delivery-table { font-size: var(--font-size-smaller); }
17+
}
618
</style>
7-
<div class="field-group" id="{$plid}-deliverty-settings">
19+
<div class="--field-group" id="{$plid}-deliverty-settings">
820
{if $services_by_type}
921
<div class="field">
1022
<div class="name">{$p->_w('Shipping service name')}</div>
@@ -61,16 +73,16 @@
6173
</div>
6274
</div>
6375

64-
<div class="field">
76+
<div class="field vertical custom-mt-20">
6577
<div class="name">
6678
{$p->_w('Delivery rates')}
6779
</div>
68-
<div class="value no-shift">
80+
<div class="value no-shift table-scrollable-x">
6981

70-
<table id="{$plid}-delivery-table" class="zebra">
82+
<table id="{$plid}-delivery-table" class="zebra bigdata">
7183
<thead id="{$plid}-delivery-table-head">
7284
<tr class="white">
73-
<th colspan="2" class="nowrap {$plid}-country-column">{$p->_w('Destination')} <i class="icon10 uarr"></i></th>
85+
<th colspan="2" class="nowrap {$plid}-country-column">{$p->_w('Destination')} <i class="icon10 uarr fas fa-sort-up"></i></th>
7486
<th id="{$plid}-calculation-type-th">
7587
<select id="{$plid}-calculation-type">
7688
<option value="all">{$p->_w('Same rate for any package weight')}</option>
@@ -91,11 +103,11 @@
91103
</td>
92104
</tr>
93105

94-
<tr class="white">
106+
<tr class="white transparent">
95107
<td colspan="5"></td>
96108
</tr>
97109

98-
<tr class="white">
110+
<tr class="white transparent">
99111
<td colspan="5">
100112
<select id="{$plid}-add-new-country">
101113
<option selected value="">{$p->_w('Add country')}</option>
@@ -200,15 +212,15 @@
200212
var renderDeliveryTableHead = function(weights) {
201213
var weight_unit = $('#{$plid}-weight-unit-input').val();
202214
var th = '';
203-
th += '<th colspan="2" class="nowrap {$plid}-country-column">{$p->_w('Destination')} <i class="icon10 uarr"></i></th>';
215+
th += '<th colspan="2" class="nowrap {$plid}-country-column">{$p->_w('Destination')} <i class="icon10 uarr fas fa-sort-up"></i></th>';
204216
if (!$.isArray(weights)||weights.length==0) {
205217
th += '<th>' + renderCalculationTypeSelector() + '</th>';
206218
} else {
207219
for (var i = 0; i < weights.length; i += 1) {
208-
th += '<th class="{$plid}-weight-td" data-index="' + i + '"><span style="margin-left: -0.85em;">≥</span>&nbsp;<input type="text" class="short bold numerical {$plid}-weight-input" placeholder="0" value="' + weights[i] + '">&nbsp;<span class="{$plid}-weight-unit">'+weight_unit+'</span>&nbsp;';
209-
th += '<a href="javascript:void(0);" class="inline"><i class="icon10 delete {$plid}-delete-weight-link" style="margin-top: 6px;"></i></a></th>';
220+
th += '<th class="{$plid}-weight-td nowrap" data-index="' + i + '"><span style="margin-left: -0.85em;">≥</span>&nbsp;<input type="text" class="short bold numerical {$plid}-weight-input" placeholder="0" value="' + weights[i] + '">&nbsp;<span class="{$plid}-weight-unit">'+weight_unit+'</span>&nbsp;';
221+
th += '<a href="javascript:void(0);" class="{$plid}-delete-weight-link inline"><i class="icon10 delete fas fa-times-circle text-red small" style="margin-top: 6px;"></i></a></th>';
210222
}
211-
th += '<th><a href="javascript:void(0)" class="inline {$plid}-add-column-link inline-link small"><i class="icon10 add"></i><b><i>{$p->_w('Add weight')}</i></b></a></th>';
223+
th += '<th><a href="javascript:void(0)" class="inline {$plid}-add-column-link inline-link nowrap"><i class="icon10 add fas fa-plus-circle text-green small"></i><b><i> {$p->_w('Add weight')}</i></b></a></th>';
212224
}
213225
th += '<th>{$p->_w("Transit time")}</th>';
214226
th += '<th></th>';
@@ -232,7 +244,7 @@
232244
}
233245
var icon = '';
234246
if (country && country.slice(0, 1) !== '%' && !region) {
235-
icon = '<i class="icon16 country" style="background:url({$wa_url}wa-content/img/country/' + country + '.gif) no-repeat"></i>';
247+
icon = '<i class="icon16 country icon middle" style="background:url({$wa_url}wa-content/img/country/' + country + '.gif) no-repeat"></i>';
236248
}
237249

238250
var name_html = '';
@@ -259,9 +271,9 @@
259271
td.push('<td>' + renderTranslitTimeSelector(item.transit_time) + '</td>');
260272

261273
if (!region) {
262-
td.push('<td><a href="javascript:void(0);" class="{$plid}-delete-country-link"><i class="icon16 delete"></i></a></td>');
274+
td.push('<td><a href="javascript:void(0);" class="{$plid}-delete-country-link"><i class="icon16 delete fas fa-trash-alt text-red"></i></a></td>');
263275
} else {
264-
td.push('<td><a href="javascript:void(0);" class="{$plid}-disable-region-toggle"><i class="icon10 ' + (!item.disabled ? 'no' : 'no-bw') + '"></i></a></td>'); }
276+
td.push('<td><a href="javascript:void(0);" class="{$plid}-disable-region-toggle"><i class="icon10 fas ' + (!item.disabled ? 'no fa-trash-alt text-red' : 'no-bw fa-trash-alt text-gray') + '"></i></a></td>'); }
265277

266278
var cls = '';
267279
var title='';
@@ -368,7 +380,7 @@
368380

369381
var loadRegions = function(after) {
370382
if (regions[val] === undefined) {
371-
var loading = $('<i class="icon16 loading"></i>').insertAfter(select);
383+
var loading = $('<span><i class="icon16 loading fas fa-spinner fa-spin custom-ml-4"></i></span>').insertAfter(select);
372384
$.post('{$xhr_url}', { country: val }, function(r) {
373385
loading.remove();
374386
regions[val] = r.data;
@@ -489,7 +501,7 @@
489501
})
490502
.on('click', '.{$plid}-disable-region-toggle', function() {
491503
var link = $(this);
492-
var icon = link.find('i');
504+
var icon = link.find('i,svg');
493505
var tr = link.closest('tr');
494506
var country = tr.data('country');
495507
var region = tr.data('region');
@@ -498,13 +510,13 @@
498510

499511
var delete_link = icon.hasClass('no');
500512
if (delete_link) {
501-
icon.removeClass('no').addClass('no-bw');
513+
icon.removeClass('no text-red').addClass('no-bw text-gray');
502514
tr.addClass('{$plid}-disabled');
503515
tr.attr('title','{$p->_w("Shipping to this region will not be offered.")|escape:"js"}')
504516
//tr.find(':input').attr('disabled',true);
505517
item.disabled = true;
506518
} else {
507-
icon.removeClass('no-bw').addClass('no');
519+
icon.removeClass('no-bw text-gray').addClass('no text-red');
508520
tr.removeClass('{$plid}-disabled');
509521
//tr.find(':input').attr('disabled',null);
510522
tr.attr('title','');
@@ -528,4 +540,3 @@
528540
});
529541

530542
})();</script>
531-

0 commit comments

Comments
 (0)