Skip to content
This repository has been archived by the owner on May 22, 2022. It is now read-only.

Commit

Permalink
Fixes #31, #32. Chess.com online bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jfkz committed Dec 11, 2016
1 parent f4b8ded commit d6009ea
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "__MSG_appName__",
"short_name": "__MSG_appShortName__",
"description": "__MSG_appDescription__",
"version": "0.5.11",
"version": "0.5.12",
"homepage_url": "http://re-coders.com/chessbot",
"default_locale": "en",
"icons": {
Expand Down
23 changes: 13 additions & 10 deletions scripts/chess_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ var PageManager = function($, window, cookieManager){
$('div.top-level-nav').after(// '<div class="top-level-nav">' +
'<a id="' + botIconId + '" class="menu-link" href="http://re-coders.com/chessbot/" target="_blank">'
+ '<img id="' + botImgId + '" style="background-color: white;" alt="Chess.bot icon" title="Enabled" src="https://raw.githubusercontent.com/recoders/chessbot/master/images/robot-20.png" />'
+ '<b id="' + (isLive ? botMessageEnabledId : botNoticeId) + '" class="item-label">Enabled</b>'
+ '<b id="' + botMessageEnabledId + '" class="item-label">Enabled</b>'
+ '</a>');
}

Expand Down Expand Up @@ -391,26 +391,29 @@ var PageManager = function($, window, cookieManager){
var ableText = enableSuggestion ? 'Enabled' : 'Disabled';
var ableIcon = enableSuggestion ? 'robot-20.png' : 'norobot-20.png';
if (isBetaDesign) {
$(control).text(ableText);
$('#' + botMessageEnabledId).text(ableText);
$('#' + botImgId)
.attr('title', ableText)
.attr('src', 'https://raw.githubusercontent.com/recoders/chessbot/master/images/' + ableIcon);
if(enableSuggestion) { $('#' + botTextId).show(); }
else { $('#' + botTextId).hide(); }
} else {
$(control).addClass('success')
.children('img').attr('src', 'https://raw.githubusercontent.com/recoders/chessbot/master/images/' + ableIcon);
}
cookie.set(eChessCookie, enableSuggestion ? '1' : '0');
cookieManager.set(eChessCookie, enableSuggestion ? '1' : '0');
}

function standartPagePreparations(engine) {
$('#' + botNoticeId)
.on('click', function(e) {
toggleSuggestionStandart(this);
return false;
});
var buttonId = isBetaDesign ? botIconId : botNoticeId;
$('#' + buttonId)
.on('click', function(e) {
toggleSuggestionStandart(this);
return false;
});

enableSuggestion = cookieManager.get(eChessCookie) == '0';
toggleSuggestionStandart($('#' + botNoticeId)[0]);
enableSuggestion = cookieManager.get(eChessCookie) == '0';
toggleSuggestionStandart($('#' + botNoticeId)[0]);
}

page.createStandartBot = function (botEngine, isBeta) {
Expand Down

0 comments on commit d6009ea

Please sign in to comment.