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 1 commit
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
Next Next commit
feat: branding removal for other domains
  • Loading branch information
NikitK-deriv committed Jan 23, 2023
commit 1d344f0654a638df12c3a9e0fd029921a39226d1
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
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
3 changes: 3 additions & 0 deletions src/common/utils/tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,6 @@ 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';
15 changes: 8 additions & 7 deletions src/indexPage/react-components/logo.jsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import React from 'react';
import { createUrl } from '../../common/utils/tools';
import {createUrl, isBinaryDomain} from '../../common/utils/tools';

const Logo = () => (
<a href={createUrl({ path: '', isNonBotPage: true })} target="blank" id="logo">
const Logo = () => {
if(isBinaryDomain) { return ( <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>
);
</a>)
} return <></>
};
export default Logo;
46 changes: 30 additions & 16 deletions templates/bot.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,14 @@
{{> bot_css }}
</head>

<script>
const host_name = $(location).attr('hostname');
const isBinaryDomain = host_name !== 'localhos' && host_name !== 'bot.binary.com';
document.getElementById("logo").remove()
</script>

<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 +120,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 +133,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 +172,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 +187,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 Expand Up @@ -217,6 +223,14 @@
<div class="notifyjs-corner" style="bottom: 0px; right: 0px;"></div>
<div class="notifyjs-corner" style="bottom: 0px; left: 0px;"></div>
</div>

<script>
if(location.hostname !== 'localhost' && location.hostname !== 'bot.binary.com') {
const element = document.getElementsByClassName('dbot-banner eu-hide');
element[0].remove();
document.getElementById('logo').remove();
};
</script>
</body>

</html>
10 changes: 9 additions & 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 Expand Up @@ -66,5 +66,13 @@
{{> index}}
{{> gtm_iframe }}
</div>
<script>
if(location.hostname !== 'localhost' && location.hostname !== 'bot.binary.com') {
const puzzle = document.getElementsByClassName('half-width bottom-image puzzle-logo');
const logo = document.getElementsByClassName('logo-wrapper');
puzzle[0].remove();
logo[0].remove();
};
</script>
</body>
</html>
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