Skip to content
This repository was archived by the owner on Feb 22, 2024. It is now read-only.

Commit 973e8d0

Browse files
author
Mohammad Reza Hamedanchi
authored
Merge branch 'master' into mohammad/webpack
2 parents 05dbbfe + be63055 commit 973e8d0

File tree

7 files changed

+43
-4
lines changed

7 files changed

+43
-4
lines changed

build/stylelint.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ module.exports = {
88
'!src/sass/external/**/*.scss',
99
'!src/sass/_constants.scss',
1010
'!src/sass/mixin.scss',
11+
'!src/sass/functions.scss',
1112
'!src/sass/reset.scss'
1213
]
1314
}

scripts/compile.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
}
5656

5757
if ($pattern) {
58-
@m = grep {index($_->[0], $pattern) > -1} @m;
58+
@m = grep {$_->[0] =~ $pattern} @m;
5959
$force = 1;
6060
# use the last hash to maintain consistency between current templates with new one
6161
# since pattern specified, so one or few templates are going to be compiled not all of them

src/javascript/binary/base/page.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -774,7 +774,7 @@ Header.prototype = {
774774
}
775775
},
776776
qualify_for_risk_classification: function() {
777-
if (page.client.is_logged_in && !page.client.is_virtual() && page.client.residence !== 'jp' && !$('body').hasClass('BlueTopBack') &&
777+
if (page.client.is_logged_in && !page.client.is_virtual() && page.client.residence !== 'jp' && !$('body').hasClass('BlueTopBack') && $('#assessment_form').length === 0 &&
778778
(localStorage.getItem('reality_check.ack') === '1' || !localStorage.getItem('reality_check.interval'))) {
779779
return true;
780780
}

src/javascript/binary/websocket_pages/socket.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ function BinarySocketClass() {
252252
}
253253
}
254254
} else if (type === 'get_financial_assessment' && !response.hasOwnProperty('error')) {
255-
if (objectNotEmpty(response.get_financial_assessment)) {
255+
if (!objectNotEmpty(response.get_financial_assessment)) {
256256
if (page.header.qualify_for_risk_classification() && localStorage.getItem('risk_classification.response') === 'high') {
257257
localStorage.setItem('risk_classification', 'high');
258258
page.header.check_risk_classification();

src/sass/all.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
/* common styles */
44
@import 'reset';
55
@import 'mixin';
6+
@import 'functions';
67
@import 'common';
78
@import 'animations';
89

src/sass/common/accordion.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
background-position: left !important;
55
}
66
h3.ui-state-default {
7-
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><defs><style>.cls-1{fill:#{rgba($COLOR_BLUE, 1)};}</style></defs><title>arrow_left</title><path class="cls-1" d="M15.7,16.59,11.125,12,15.7,7.41,14.3,6l-6,6,6,6Z"/></svg>');
7+
background-image: svg-url('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="#{rgba($COLOR_BLUE, 1)}" d="M15.7,16.59,11.125,12,15.7,7.41,14.3,6l-6,6,6,6Z"/></svg>');
88
}
99
}
1010
.ui-accordion-content {

src/sass/functions.scss

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* To replace characters in a string
3+
*/
4+
@function str-replace($string, $search, $replace: '') {
5+
$index: str-index($string, $search);
6+
@if $index {
7+
@return str-slice($string, 1, $index - 1) + $replace +
8+
str-replace(str-slice($string, $index +
9+
str-length($search)), $search, $replace);
10+
}
11+
@return $string;
12+
}
13+
14+
/*
15+
* To create an optimized svg url
16+
*/
17+
@function svg-url($svg) {
18+
/*
19+
* Chunk up string in order to avoid
20+
* "SystemStackError: stack level too deep"
21+
*/
22+
$encoded: '';
23+
$slice: 2000;
24+
$index: 0;
25+
$loops: ceil(str-length($svg)/$slice);
26+
@for $i from 1 through $loops {
27+
$chunk: str-slice($svg, $index, $index + $slice - 1);
28+
$chunk: str-replace($chunk,'"','\'');
29+
$chunk: str-replace($chunk,'<','%3C');
30+
$chunk: str-replace($chunk,'>','%3E');
31+
$chunk: str-replace($chunk,'&','%26');
32+
$chunk: str-replace($chunk,'#','%23');
33+
$encoded: #{$encoded}#{$chunk};
34+
$index: $index + $slice;
35+
}
36+
@return url("data:image/svg+xml;charset=utf8,#{$encoded}");
37+
}

0 commit comments

Comments
 (0)