Skip to content

Commit cba4ed8

Browse files
author
Leonix
committed
Webasyst Framework v.2.3.5
* Fixed saving of email settings in Settings app. * Fixed selection of favorite countries in Settings app’s interface mode 2.0. * Fixed publishing of product reviews. * Improved authorization by phone number. * Improved interface of Installer app in the 2.0 mode.
1 parent 655d251 commit cba4ed8

File tree

31 files changed

+271
-144
lines changed

31 files changed

+271
-144
lines changed

wa-apps/installer/css/app.installer.css

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -106,35 +106,12 @@
106106
text-align: center;
107107
}
108108
}
109-
.i-assets-spinner {
110-
animation: iAssetsSpinner 1.8s linear infinite;
111-
}
112109
.js-installer-assets-spinner {
113110
display: none;
114111
}
115112
.js-installer-assets-spinner.-active {
116113
display: inline-block;
117114
}
118-
@-moz-keyframes iAssetsSpinner {
119-
to {
120-
transform: rotate(360deg);
121-
}
122-
}
123-
@-webkit-keyframes iAssetsSpinner {
124-
to {
125-
transform: rotate(360deg);
126-
}
127-
}
128-
@-o-keyframes iAssetsSpinner {
129-
to {
130-
transform: rotate(360deg);
131-
}
132-
}
133-
@keyframes iAssetsSpinner {
134-
to {
135-
transform: rotate(360deg);
136-
}
137-
}
138115
.i-reviews {
139116
position: relative;
140117
}

wa-apps/installer/js/product_review_widget.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ var InstallerProductReviewWidget = ( function($) {
6969
that.processInitialWidgetErrors(that.errors);
7070
return;
7171
}
72-
72+
7373
that.initByCoreJsData().done(function () {
7474
that.loadReviewWidgetIO().done(function (data) {
7575
that.initProductWidgetBlock(data);
@@ -277,10 +277,19 @@ var InstallerProductReviewWidget = ( function($) {
277277
}
278278

279279
function initReviewDialog(rate, widget) {
280-
var dialog = $.waDialog({
280+
let dialog;
281+
282+
if (that.ui === '1.3') {
283+
dialog = $.waDialog({
281284
wrapper: $(that.templates["review_dialog"]),
282285
onOpen: initRateDialogContent
283286
});
287+
} else {
288+
dialog = $.waDialog({
289+
html: that.templates["review_dialog"],
290+
onOpen: initRateDialogContent
291+
});
292+
}
284293

285294
function initRateDialogContent($wrapper, dialog) {
286295
// DOM
@@ -505,7 +514,7 @@ var InstallerProductReviewWidget = ( function($) {
505514
console.info('%c event "%s" thrown, feel free to listen it', 'color: blue;', event_name);
506515
}
507516
};
508-
517+
509518
InstallerProductReviewWidget.prototype.processLoadingProductStoreInfoErrors = function(errors) {
510519
var that = this,
511520
event_name = that.events.load_product_fail;

wa-apps/installer/js/store.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -420,14 +420,13 @@ var InstallerStore = (function ($) {
420420
});
421421

422422
function handleResponse(res) {
423-
424423
if (res.status == 'ok') {
425424
var is_success = true;
426425
$.waDialog({
427-
wrapper: $wrapper
428-
.find('.js-rates-list')
429-
.append('<span class="gray"> &ndash; ' + data.rate_added_locale + '</span>')
430-
.prevObject,
426+
$wrapper: $wrapper
427+
.find('.js-rates-list')
428+
.append('<span class="gray"> &ndash; ' + data.rate_added_locale + '</span>')
429+
.prevObject,
431430
onOpen: initDialogContent,
432431
onClose: function() {
433432
if (is_success) {
@@ -460,9 +459,8 @@ var InstallerStore = (function ($) {
460459
}
461460

462461
}else{
463-
464462
$.waDialog({
465-
wrapper: $(that.options.templates["review_dialog"]),
463+
html: $(that.options.templates["review_dialog"]),
466464
onOpen: initDialogContent,
467465
onClose: function() {
468466
if (is_success) {

wa-apps/installer/js/store_review.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ var InstallerStoreReview = ( function($) {
255255
img_class = 'class="size-limit"';
256256
}
257257

258-
$product_review_icon.empty().append('<img ' + img_class + ' src="' + icon_src + '" alt="">');
258+
$product_review_icon.empty().append(`<img ${img_class} src="${icon_src}" alt="" loading="lazy">`);
259259
}
260260

261261
if (data.id) {
@@ -282,8 +282,11 @@ var InstallerStoreReview = ( function($) {
282282
.html('<a href="#">' + that.locale.button_edit_active + '</a>'),
283283
$product_review_date = $('<span/>').addClass('review_date')
284284
.text(review_date),
285-
$product_reviewer_userpic = $('<i/>').addClass('userpic20 icon16')
286-
.css('background-image', 'url(' + userpic_url + ')'),
285+
$product_reviewer_userpic = $('<i/>').addClass('userpic userpic20 icon16')
286+
.css({
287+
'background-image': 'url(' + userpic_url + ')',
288+
'margin-right': '5px'
289+
}),
287290
$product_review = '',
288291
$product_reviewer_info = '';
289292

@@ -411,7 +414,7 @@ var InstallerStoreReview = ( function($) {
411414

412415
var is_success = false,
413416
dialog = $.waDialog({
414-
wrapper: $(that.templates["review_dialog"]),
417+
html: that.templates["review_dialog"],
415418
onOpen: initRateDialogContent,
416419
onClose: function() {
417420
if (!is_success) {

wa-apps/installer/lib/config/app.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
'description' => 'Install new apps from the Webasyst Store',
55
'icon' => 'img/installer.svg',
66
'mobile' => false,
7-
'version' => '2.3.4',
8-
'critical' => '2.3.4',
7+
'version' => '2.3.5',
8+
'critical' => '2.3.5',
99
'system' => true,
1010
'vendor' => 'webasyst',
1111
'csrf' => true,

wa-apps/installer/templates/actions/assets/Assets.html

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,24 @@ <h2 class="state-{$message.result}">
5555
<script type="text/javascript">
5656
document.title = {$title|json_encode};
5757

58-
$('#i-assets-list a.js-remove-item').click(function () {
59-
var $link = $(this);
60-
if (confirm($link.data('confirm'))) {
61-
$link.parent('li').find('form:first').submit();
62-
}
63-
return false;
58+
$('.js-remove-item').on('click', function(e) {
59+
e.preventDefault();
60+
61+
const $this = $(this);
62+
63+
$.waDialog.confirm({
64+
title: '[`This will delete the product’s source code and data, without a recovery option. Are you sure?`]',
65+
success_button_title: '[`Delete`]',
66+
success_button_class: 'danger',
67+
cancel_button_title: '[`Cancel`]',
68+
cancel_button_class: 'light-gray',
69+
onSuccess() {
70+
$this.css('pointer-events', 'none');
71+
$this.find('.js-remove-item-icon').addClass('hidden');
72+
$this.find('.js-remove-item-spinner').removeClass('hidden');
73+
$this.siblings('.js-remove-item-form').submit();
74+
}
75+
});
6476
});
6577
$('#i-assets-list a.js-switch-item').click(function () {
6678
var $link = $(this);

wa-apps/installer/templates/actions/assets/Assets.row.html

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -128,13 +128,17 @@
128128
!empty($item.enabled)
129129
)
130130
}
131-
<a href="{$wa_app_url}assets/" class="js-remove-item button light-gray circle" data-confirm="[`This will delete the product’s source code and data, without a recovery option. Are you sure?`]" title="[`Delete`]"><i class="fas fa-trash-alt" style="color: var(--red);"></i></a>
132-
{if $item_type=='app'}{$field = 'app_id'}{else}{$field='extras_id'}{/if}
133-
<form action="?module={$item_type}s&action=remove" method="post">
134-
{$wa->csrf()}
135-
<input type="hidden" name="{$field}[{$item.slug}]" value="{$item.installed.vendor|default:'webasyst'|escape}"/>
136-
</form>
137-
{/if}
131+
<a href="{$wa_app_url}assets/" class="js-remove-item button light-gray circle" title="[`Delete`]">
132+
<i class="fas fa-trash-alt text-red js-remove-item-icon"></i>
133+
<i class="fas fa-spinner wa-animation-spin speed-1500 hidden js-remove-item-spinner"></i>
134+
</a>
135+
136+
{if $item_type=='app'}{$field = 'app_id'}{else}{$field='extras_id'}{/if}
137+
<form action="?module={$item_type}s&action=remove" method="post" class="js-remove-item-form">
138+
{$wa->csrf()}
139+
<input type="hidden" name="{$field}[{$item.slug}]" value="{$item.installed.vendor|default:'webasyst'|escape}"/>
140+
</form>
141+
{/if}
138142
{/if}
139143
</ul>
140144
</td>

wa-apps/installer/templates/actions/reviews/Reviews.html

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,17 @@ <h1 class="wide">[`Reviews`]</h1>
7878
{/capture}
7979

8080
{capture assign="_product_review_dialog_template"}
81-
<div class="wa-dialog i-product-review-dialog">
82-
<div class="wa-dialog-background"></div>
83-
<div class="wa-dialog-body">
84-
<div class="wa-dialog-header"><h1 class="js-content-title">[`Your review`]</h1></div>
85-
<div class="wa-dialog-content">
81+
<div class="dialog i-product-review-dialog">
82+
<div class="dialog-background"></div>
83+
<div class="dialog-body">
84+
<div class="dialog-header flexbox">
85+
<h1 class="js-content-title wide">[`Your review`]</h1>
86+
87+
<span class="custom-ml-12 custom-mb-auto cursor-pointer js-close-dialog">
88+
<i class="fas fa-times fa-2x"></i>
89+
</span>
90+
</div>
91+
<div class="dialog-content">
8692

8793
<div class="i-comment-section">
8894
{strip}
@@ -100,7 +106,7 @@ <h1 class="wide">[`Reviews`]</h1>
100106
</div>
101107

102108
<div class="i-comment-user js-comment-user assets" style="display: none;">
103-
<i class="userpic20 icon16"></i>
109+
<i class="userpic userpic20 icon16"></i>
104110
<strong class="user"></strong>
105111
<span class="hint">{wa_date('humandate')}</span>
106112
</div>
@@ -109,7 +115,7 @@ <h1 class="wide">[`Reviews`]</h1>
109115

110116
</div>
111117

112-
<div class="wa-dialog-footer">
118+
<div class="dialog-footer">
113119

114120
<div class="hint js-dialog-signup-user-info" style="display: none;">
115121
<p>
@@ -120,9 +126,6 @@ <h1 class="wide">[`Reviews`]</h1>
120126

121127
<button class="button2 large blue js-send-comment">[`Add a review`]</button>
122128
</div>
123-
<span class="wa-close-icon js-close-dialog">
124-
<i class="far fa-times-circle"></i>
125-
</span>
126129
</div>
127130
</div>
128131
{/capture}

wa-apps/installer/templates/actions/store/Store.html

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,22 @@
4141
]}
4242

4343
{capture assign="_product_review_dialog_template"}
44-
<div class="wa-dialog i-product-review-dialog">
45-
<div class="wa-dialog-background"></div>
46-
<div class="wa-dialog-body">
47-
<div class="wa-dialog-header"><h1 class="js-content-title"></h1></div>
48-
<div class="wa-dialog-content">
44+
{$dialog_prefix = ''}
45+
{if $wa->whichUI() === '1.3'}
46+
{$dialog_prefix = 'wa-'}
47+
{/if}
48+
<div class="{$dialog_prefix}dialog i-product-review-dialog">
49+
<div class="{$dialog_prefix}dialog-background"></div>
50+
<div class="{$dialog_prefix}dialog-body">
51+
<div class="{$dialog_prefix}dialog-header{if $wa->whichUI() !== '1.3'} flexbox{/if}">
52+
<h1 class="js-content-title{if $wa->whichUI() !== '1.3'} wide{/if}"></h1>
53+
{if $wa->whichUI() !== '1.3'}
54+
<span class="custom-ml-12 custom-mb-auto cursor-pointer js-close-dialog">
55+
<i class="fas fa-times fa-2x"></i>
56+
</span>
57+
{/if}
58+
</div>
59+
<div class="{$dialog_prefix}dialog-content">
4960

5061
<div class="i-comment-section">
5162
{strip}
@@ -63,7 +74,7 @@
6374
</div>
6475

6576
<div class="i-comment-user js-comment-user" style="display: none;">
66-
<i class="userpic20 icon16"></i>
77+
<i class="userpic userpic20 icon16"></i>
6778
<strong class="user">{if isset($reviewer_info)}{$reviewer_info.name|escape}{/if}</strong>
6879
<span class="hint">{wa_date('humandate')}</span>
6980
</div>
@@ -72,7 +83,7 @@
7283

7384
</div>
7485

75-
<div class="wa-dialog-footer">
86+
<div class="{$dialog_prefix}dialog-footer">
7687

7788
<div class="hint js-dialog-signup-user-info" style="display: none;">
7889
<p>
@@ -83,9 +94,11 @@
8394

8495
<button class="button2 large blue js-send-comment">[`Add a review`]</button>
8596
</div>
97+
{if $wa->whichUI() === '1.3'}
8698
<span class="wa-close-icon js-close-dialog">
8799
<i class="far fa-times-circle"></i>
88100
</span>
101+
{/if}
89102
</div>
90103
</div>
91104
{/capture}

wa-apps/installer/templates/actions/update/Update.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ <h2 class="state-{$message.result} flexbox middle">
166166
$('.js-changelog-more').on('click', function (e) {
167167
e.preventDefault();
168168

169-
$(this).parents('.js-changelog').find(':hidden').show();
169+
$(this).closest('.js-changelog-container').find('.js-changelog').removeClass('hidden');
170170
$(this).hide();
171171
});
172172

0 commit comments

Comments
 (0)