Dashboard width FIXED - making it resize with browser window

Discuss developing tools and get details on Conquer Club's API.

Moderator: Tech Team

Forum rules
Please read the Community Guidelines before posting.
Post Reply
judge_reinhold
Posts: 110
Joined: Sun Sep 02, 2012 10:59 pm
Location: meat
Contact:

Dashboard width FIXED - making it resize with browser window

Post by judge_reinhold »

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.
Last edited by judge_reinhold on Mon Mar 20, 2017 6:47 pm, edited 1 time in total.
User avatar
Dukasaur
Community Team
Community Team
Posts: 28213
Joined: Sat Nov 20, 2010 4:49 pm
Location: Beautiful Niagara

Re: Dashboard width FIXED - making it resize with browser wi

Post by Dukasaur »

I've never had this problem, but I thank you for your efforts all the same! It's good to have people who care about fixing stuff.
“‎Life is a shipwreck, but we must not forget to sing in the lifeboats.”
― Voltaire
User avatar
riskllama
Posts: 9024
Joined: Thu Jan 30, 2014 9:50 pm
Location: deep inside Queen Charlotte.

Re: Dashboard width FIXED - making it resize with browser wi

Post by riskllama »

love that Judge!!!
Image
User avatar
Dukasaur
Community Team
Community Team
Posts: 28213
Joined: Sat Nov 20, 2010 4:49 pm
Location: Beautiful Niagara

Re: Dashboard width FIXED - making it resize with browser wi

Post by Dukasaur »

riskllama wrote:love that Judge!!!

“‎Life is a shipwreck, but we must not forget to sing in the lifeboats.”
― Voltaire
User avatar
EBConquer
Posts: 973
Joined: Sun Dec 05, 2010 1:11 am
Gender: Male
Location: San Diego
Contact:

Re: Dashboard width FIXED - making it resize with browser wi

Post by EBConquer »

This is great! i've noticed that happens but usually just hit refresh to fix the problem but something automatic would be useful. How does one take the script and implement it? I'm a little thick when it comes to code.
Image
User avatar
dgz345
Posts: 1363
Joined: Thu Oct 07, 2010 10:53 am

Re: Dashboard width FIXED - making it resize with browser wi

Post by dgz345 »

EBConquer wrote:This is great! i've noticed that happens but usually just hit refresh to fix the problem but something automatic would be useful. How does one take the script and implement it? I'm a little thick when it comes to code.


greasemonkey or tampermonkey depending on your browser. its the same as the other userscripts
User avatar
EBConquer
Posts: 973
Joined: Sun Dec 05, 2010 1:11 am
Gender: Male
Location: San Diego
Contact:

Re: Dashboard width FIXED - making it resize with browser wi

Post by EBConquer »

dgz345 wrote:
EBConquer wrote:This is great! i've noticed that happens but usually just hit refresh to fix the problem but something automatic would be useful. How does one take the script and implement it? I'm a little thick when it comes to code.


greasemonkey or tampermonkey depending on your browser. its the same as the other userscripts


Yay! thanks. It works like a charm.

For those not in the know. All's you need to do is the same thing you've done will all the other scripts you have. Just click 'Install'. :|
Image
User avatar
riskllama
Posts: 9024
Joined: Thu Jan 30, 2014 9:50 pm
Location: deep inside Queen Charlotte.

Re: Dashboard width FIXED - making it resize with browser wi

Post by riskllama »

how many "chat ban waiver" slips did Judge get for this?
Image
User avatar
EBConquer
Posts: 973
Joined: Sun Dec 05, 2010 1:11 am
Gender: Male
Location: San Diego
Contact:

Re: Dashboard width FIXED - making it resize with browser wi

Post by EBConquer »

For whatever reason, this script screws up the panel snapshots. :?
Image
User avatar
iAmCaffeine
Posts: 11699
Joined: Mon Apr 01, 2013 5:38 pm

Re: Dashboard width FIXED - making it resize with browser wi

Post by iAmCaffeine »

Does this work or not because the bug is fucking annoying?
Image
Post Reply

Return to “Tools Development”