Dashboard width FIXED - making it resize with browser window
Posted: Sun Mar 19, 2017 10:30 pm
One of the most annoying and easily fixed problems with CC.
Load a game page when your browser window is not maximized.
Then maximize your window, and what happens? The right side "dashboard" (with game log, snapshots, etc), stays super small.
It is absurdly, stupidly easy to fix, and yet has not been fixed in years.
So I fixed it.
Here you go, you're welcome.
// ==UserScript==
// @name FixDashboardWidth
// @namespace ccscripts
// @description Fix the idiotic dashboard width
// @include https://www.conquerclub.com/game.php?game=*
// @include http://www.conquerclub.com/game.php?game=*
// @version 1
// @grant none
// @copyright 2017+, J.R.
// @require http://code.jquery.com/jquery-latest.js
// ==/UserScript==
$(document).ready( function() {
console.log('Dashboard fix running');
$("#right_hand_side").css('width','');
$("#right_hand_side").css('max-width','800px'); // replace contents of last parentheses with the following to allow complete screen-filling: 'width','auto'
});
FYI, Dukasaur, it's caused by the fact that the DIV element "#right_hand_side" has an explicit width set when the page first loads. Probably one of your coders thought that would be clever. I can't imagine why.
So then if you resize your window, that element's width stays the same. I changed it to give it a maximium width. Giving it an automatic width would also have worked, but for me, 800px is wide enough.
Load a game page when your browser window is not maximized.
Then maximize your window, and what happens? The right side "dashboard" (with game log, snapshots, etc), stays super small.
It is absurdly, stupidly easy to fix, and yet has not been fixed in years.
So I fixed it.
Here you go, you're welcome.
// ==UserScript==
// @name FixDashboardWidth
// @namespace ccscripts
// @description Fix the idiotic dashboard width
// @include https://www.conquerclub.com/game.php?game=*
// @include http://www.conquerclub.com/game.php?game=*
// @version 1
// @grant none
// @copyright 2017+, J.R.
// @require http://code.jquery.com/jquery-latest.js
// ==/UserScript==
$(document).ready( function() {
console.log('Dashboard fix running');
$("#right_hand_side").css('width','');
$("#right_hand_side").css('max-width','800px'); // replace contents of last parentheses with the following to allow complete screen-filling: 'width','auto'
});
FYI, Dukasaur, it's caused by the fact that the DIV element "#right_hand_side" has an explicit width set when the page first loads. Probably one of your coders thought that would be clever. I can't imagine why.
So then if you resize your window, that element's width stays the same. I changed it to give it a maximium width. Giving it an automatic width would also have worked, but for me, 800px is wide enough.