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

NikitK/ Amending the Github page for Binary Bot #3805

Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ lib/
old/
CNAME
*.env
.DS_Store
.DS_Store
.idea
5 changes: 4 additions & 1 deletion gulpfile.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ gulp.task(
})
);

gulp.task('test-deploy', gulp.series('build-min', 'serve', () => {}));
gulp.task(
'test-deploy',
gulp.series('build-min', 'serve', () => {})
);

gulp.task(
'watch-static',
Expand Down
6 changes: 3 additions & 3 deletions src/botPage/view/View.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import {
getToken,
remove,
} from '../../common/utils/storageManager';
import { isProduction, parseQueryString, serialize } from '../../common/utils/tools';
import { isBinaryDomain, isProduction, parseQueryString, serialize } from '../../common/utils/tools';
import GTM from '../../common/gtm';
import {
getMissingBlocksTypes,
Expand Down Expand Up @@ -196,9 +196,9 @@ const updateLogo = token => {
$('.binary-logo-text > img').attr('src', '');
const currentLandingCompany = getLandingCompanyForToken(token);
if (currentLandingCompany === 'maltainvest') {
$('.binary-logo-text > img').attr('src', './image/binary-type-logo.svg');
$('.binary-logo-text > img').attr('src', `${isBinaryDomain && './image/binary-type-logo.svg'}`);
} else {
$('.binary-logo-text > img').attr('src', './image/binary-style/logo/type.svg');
$('.binary-logo-text > img').attr('src', `${isBinaryDomain && './image/binary-style/logo/type.svg'}`);
}
setTimeout(() => window.dispatchEvent(new Event('resize')));
};
Expand Down
11 changes: 10 additions & 1 deletion src/botPage/view/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import View from './View';
import '../../common/binary-ui/dropdown';
import Elevio from '../../common/elevio';
import GTM from '../../common/gtm';
import { isProduction } from '../../common/utils/tools';
import { isBinaryDomain, isProduction } from '../../common/utils/tools';

$.ajaxSetup({
cache: false,
Expand Down Expand Up @@ -40,3 +40,12 @@ view.initPromise.then(() => {
});
}
});

window.onload = () => {
if (document.readyState === 'complete') {
if (!isBinaryDomain) {
document.getElementsByClassName('dbot-banner eu-hide')[0].remove();
document.getElementById('logo').remove();
}
}
};
5 changes: 5 additions & 0 deletions src/common/utils/tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,8 @@ export const errLogger = (err, msg) => {
const errMsg = `${msg} - Error: ${errStr}`;
console.warn(errMsg);
};

export const isBinaryDomain =
document.location.hostname === 'localhost' ||
document.location.hostname === 'bot.binary.com' ||
document.location.hostname.includes('binary-bot-git-fork');
13 changes: 11 additions & 2 deletions src/indexPage/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import GTM from '../common/gtm';
import { load as loadLang, showBanner } from '../common/lang';
import { moveToDeriv } from '../common/utils/utility';
import { get as getStorage, set as setStorage, remove, getTokenList } from '../common/utils/storageManager';
import { createUrl, parseQueryString, serialize } from '../common/utils/tools';
import { createUrl, isBinaryDomain, parseQueryString, serialize } from '../common/utils/tools';
import '../common/binary-ui/dropdown';
import BotLanding from './react-components/bot-landing';
import BinaryLanding from './react-components/binary-landing';
Expand Down Expand Up @@ -111,7 +111,7 @@ const renderElements = () => {
return false;
}
if (window.location.pathname.indexOf('/bot') === -1) {
render(<Logo />, document.getElementById('binary-logo'));
render(isBinaryDomain && <Logo />, document.getElementById('binary-logo'));
render(<Footer />, document.getElementById('footer'));
isEuCountry().then(isEu => showHideEuElements(isEu));
showBanner();
Expand Down Expand Up @@ -157,3 +157,12 @@ const loginCheck = () => {
};

loginCheck();

window.onload = () => {
if (document.readyState === 'complete') {
if (!isBinaryDomain) {
document.getElementsByClassName('half-width bottom-image puzzle-logo')[0].remove();
document.getElementsByClassName('logo-wrapper')[0].remove();
}
}
};
8 changes: 4 additions & 4 deletions src/indexPage/react-components/logo.jsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import React from 'react';
import { createUrl } from '../../common/utils/tools';
import {createUrl} from '../../common/utils/tools';

const Logo = () => (
<a href={createUrl({ path: '', isNonBotPage: true })} target="blank" id="logo">
<a href={createUrl({path: '', isNonBotPage: true})} target="blank" id="logo">
<div className="logo-parent">
<div className="logo">
<img className="responsive" src={'image/binary-style/logo/symbol.svg'} alt="Binary logo" />
<img className="responsive" src={'image/binary-style/logo/symbol.svg'} alt="Binary logo"/>
</div>
<div className="binary-logo-text">
<img className="responsive" src={'image/binary-style/logo/type.svg'} alt="Binary logo" />
<img className="responsive" src={'image/binary-style/logo/type.svg'} alt="Binary logo"/>
</div>
</div>
</a>
Expand Down
32 changes: 16 additions & 16 deletions templates/bot.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</head>

<body>
<div id="bot-main" class="hidden" style="width: 100%;position: relative;height: 100%;">
<div id="bot-main" class="hidden" style="width: 100%;position: relative;height: 100%;">
<div id="tour"></div>
<div id="center"></div>
<div id="workspace_center"></div>
Expand Down Expand Up @@ -114,11 +114,11 @@
<button id="login" data-i18n-text="Log in" />
</div>
</div>

</div>



<div id="toolbox" class="actions_menu show-on-load hidden">
<button data-i18n-title="Reset the blocks to their initial state" id="resetButton"
class="toolbox-button icon-reset"></button>
Expand All @@ -127,31 +127,31 @@
class="toolbox-button icon-save"></button>
<button data-i18n-title="Connect Binary Bot to your Google Drive to easily save and re-use your blocks"
id="integrations" class="toolbox-button icon-integrations invisible"></button>

<span class="toolbox-separator"></span>
<button data-i18n-title="Undo the changes (Ctrl+Z)" id="undo" class="toolbox-button icon-undo"></button>
<button data-i18n-title="Redo the changes (Ctrl+Shift+Z)" id="redo" class="toolbox-button icon-redo"></button>

<span class="toolbox-separator"></span>
<button data-i18n-title="Zoom In (Ctrl + +)" id="zoomIn" class="toolbox-button icon-zoom-in"></button>
<button data-i18n-title="Zoom Out (Ctrl + -)" id="zoomOut" class="toolbox-button icon-zoom-out"></button>
<button data-i18n-title="Rearrange Vertically" id="rearrange" class="toolbox-button icon-sort"></button>

<span class="toolbox-separator"></span>
<button data-i18n-title="Show/hide the summary pop-up" id="showSummary"
class="toolbox-button icon-summary"></button>
<button data-i18n-title="Run the bot" id="runButton" class="toolbox-button icon-run"></button>
<button data-i18n-title="Stop the bot" id="stopButton" class="toolbox-button icon-stop"></button>
<button data-i18n-title="Show log" id="logButton" class="toolbox-button icon-info"></button>

<span class="toolbox-separator"></span>
<button data-i18n-title="Show chart" id="chartButton" class="toolbox-button icon-chart-line"></button>
<button data-i18n-title="Show Trading View" id="tradingViewButton"
class="toolbox-button icon-trading-view"></button>

<span class="toolbox-separator"></span>
<button data-i18n-title="Toggle header" id="toggleHeaderButton" class="toolbox-button icon-hide-header"></button>

{{! Toolbox main account + list }}
<div id="toolbox-account" class="right-header" style="display: none">
<button id="toolbox-login" data-i18n-text="Log in"></button>
Expand All @@ -166,11 +166,11 @@
</a>
</div>
</div>

</div>
<div id="errorArea"></div>
<div id="notification-banner"></div>

<ul id="toolbox-all-accounts" class="nav-menu main-nav" style="display: none;">
<li>
<ul>
Expand All @@ -181,11 +181,11 @@
</ul>
</li>
</ul>

<div id="blocklyArea"></div>

<div id="blocklyDiv" style="position: absolute;"></div>

<form id="fileUploadForm" style="display: none;">
<input data-i18n-title="Open an already saved XML file and retrieve its blocks" type="file" id="files" accept=".xml"
multiple />
Expand Down
2 changes: 1 addition & 1 deletion templates/index.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
</div>
<div id="movetoderiv"></div>
<div id="bot-landing"></div>

<div id="header">
<div class="wrapper">
<div class="logo-wrapper">
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy