Conquer Club

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.

Dashboard width FIXED - making it resize with browser window

Postby judge_reinhold on 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.
Last edited by judge_reinhold on Mon Mar 20, 2017 6:47 pm, edited 1 time in total.
Colonel judge_reinhold
 
Posts: 110
Joined: Sun Sep 02, 2012 10:59 pm
Location: meat

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

Postby Dukasaur on Mon Mar 20, 2017 6:06 pm

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
Sergeant 1st Class Dukasaur
Community Coordinator
Community Coordinator
 
Posts: 27715
Joined: Sat Nov 20, 2010 4:49 pm
Location: Beautiful Niagara
32

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

Postby riskllama on Mon Mar 20, 2017 6:26 pm

love that Judge!!!
Image
User avatar
Lieutenant riskllama
 
Posts: 8907
Joined: Thu Jan 30, 2014 9:50 pm
Location: deep inside Queen Charlotte.

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

Postby Dukasaur on Wed Mar 22, 2017 8:24 am

riskllama wrote:love that Judge!!!

“‎Life is a shipwreck, but we must not forget to sing in the lifeboats.”
― Voltaire
User avatar
Sergeant 1st Class Dukasaur
Community Coordinator
Community Coordinator
 
Posts: 27715
Joined: Sat Nov 20, 2010 4:49 pm
Location: Beautiful Niagara
32

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

Postby EBConquer on Tue Mar 28, 2017 12:30 am

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
Colonel EBConquer
 
Posts: 973
Joined: Sun Dec 05, 2010 1:11 am
Location: San Diego

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

Postby dgz345 on Sat Apr 01, 2017 6:12 am

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
Lieutenant dgz345
 
Posts: 1362
Joined: Thu Oct 07, 2010 10:53 am

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

Postby EBConquer on Sun Apr 02, 2017 11:30 pm

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
Colonel EBConquer
 
Posts: 973
Joined: Sun Dec 05, 2010 1:11 am
Location: San Diego

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

Postby riskllama on Thu Apr 13, 2017 3:36 pm

how many "chat ban waiver" slips did Judge get for this?
Image
User avatar
Lieutenant riskllama
 
Posts: 8907
Joined: Thu Jan 30, 2014 9:50 pm
Location: deep inside Queen Charlotte.

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

Postby EBConquer on Sat Apr 22, 2017 12:51 am

For whatever reason, this script screws up the panel snapshots. :?
Image
User avatar
Colonel EBConquer
 
Posts: 973
Joined: Sun Dec 05, 2010 1:11 am
Location: San Diego

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

Postby iAmCaffeine on Mon Jun 26, 2017 9:54 am

Does this work or not because the bug is fucking annoying?
Image
User avatar
Cook iAmCaffeine
 
Posts: 11699
Joined: Mon Apr 01, 2013 5:38 pm


Return to Tools Development

Who is online

Users browsing this forum: No registered users