Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

A possible solution to improve code readability by allowing larger widths is to use an extension that changes the layout a little bit. The following works in Google Chrome (thanks to this postpost), but I think it can be ported to other browsers.

The extension enlarges the left column and also allows answer text-area to be horizontally resized. Other elements are unaffected (nothing disappears) (stats, events, related questions, footer etc.).

Now, the code:

1. Manifest file (manifest.json)

{
    "name": "",
    "description":"Extends code area from CodeReview site",
    "version":"1",
    "manifest_version":2,
    "content_scripts": [
        {
          "matches": ["http://codereview.stackexchange.com/*"],
          "js": ["jquery-2.2.0.js", "myscript.js"],
          "css": ["styles.css"]
        } 
      ]
}

2. Styles (styles.css)

.moveToLeft { 
    margin-left: -200px !important;
    width: 928px !important;
}
.largerReadonlyCodeBlock { 
    width: 860px !important; 
}

.questionHeader {
    margin-left: -200px !important;
    width: 1270px !important;
}

.footerMenu {
    margin-left: -200px !important;
    width: 1310px !important;
}

3. Javascript file (myscript.js)

$(".wmd-input").css("resize", "both");
$("#mainbar").addClass("moveToLeft");
$(".post-text").addClass("largerReadonlyCodeBlock");
$("#question-header").addClass("questionHeader");
$("#footer-menu").addClass("footerMenu");

Currently, the code enlarges the column by a hardcoded value of 200px, but it should be enough in most cases.

A possible solution to improve code readability by allowing larger widths is to use an extension that changes the layout a little bit. The following works in Google Chrome (thanks to this post), but I think it can be ported to other browsers.

The extension enlarges the left column and also allows answer text-area to be horizontally resized. Other elements are unaffected (nothing disappears) (stats, events, related questions, footer etc.).

Now, the code:

1. Manifest file (manifest.json)

{
    "name": "",
    "description":"Extends code area from CodeReview site",
    "version":"1",
    "manifest_version":2,
    "content_scripts": [
        {
          "matches": ["http://codereview.stackexchange.com/*"],
          "js": ["jquery-2.2.0.js", "myscript.js"],
          "css": ["styles.css"]
        } 
      ]
}

2. Styles (styles.css)

.moveToLeft { 
    margin-left: -200px !important;
    width: 928px !important;
}
.largerReadonlyCodeBlock { 
    width: 860px !important; 
}

.questionHeader {
    margin-left: -200px !important;
    width: 1270px !important;
}

.footerMenu {
    margin-left: -200px !important;
    width: 1310px !important;
}

3. Javascript file (myscript.js)

$(".wmd-input").css("resize", "both");
$("#mainbar").addClass("moveToLeft");
$(".post-text").addClass("largerReadonlyCodeBlock");
$("#question-header").addClass("questionHeader");
$("#footer-menu").addClass("footerMenu");

Currently, the code enlarges the column by a hardcoded value of 200px, but it should be enough in most cases.

A possible solution to improve code readability by allowing larger widths is to use an extension that changes the layout a little bit. The following works in Google Chrome (thanks to this post), but I think it can be ported to other browsers.

The extension enlarges the left column and also allows answer text-area to be horizontally resized. Other elements are unaffected (nothing disappears) (stats, events, related questions, footer etc.).

Now, the code:

1. Manifest file (manifest.json)

{
    "name": "",
    "description":"Extends code area from CodeReview site",
    "version":"1",
    "manifest_version":2,
    "content_scripts": [
        {
          "matches": ["http://codereview.stackexchange.com/*"],
          "js": ["jquery-2.2.0.js", "myscript.js"],
          "css": ["styles.css"]
        } 
      ]
}

2. Styles (styles.css)

.moveToLeft { 
    margin-left: -200px !important;
    width: 928px !important;
}
.largerReadonlyCodeBlock { 
    width: 860px !important; 
}

.questionHeader {
    margin-left: -200px !important;
    width: 1270px !important;
}

.footerMenu {
    margin-left: -200px !important;
    width: 1310px !important;
}

3. Javascript file (myscript.js)

$(".wmd-input").css("resize", "both");
$("#mainbar").addClass("moveToLeft");
$(".post-text").addClass("largerReadonlyCodeBlock");
$("#question-header").addClass("questionHeader");
$("#footer-menu").addClass("footerMenu");

Currently, the code enlarges the column by a hardcoded value of 200px, but it should be enough in most cases.

Source Link
Alexei
  • 1.8k
  • 9
  • 4

A possible solution to improve code readability by allowing larger widths is to use an extension that changes the layout a little bit. The following works in Google Chrome (thanks to this post), but I think it can be ported to other browsers.

The extension enlarges the left column and also allows answer text-area to be horizontally resized. Other elements are unaffected (nothing disappears) (stats, events, related questions, footer etc.).

Now, the code:

1. Manifest file (manifest.json)

{
    "name": "",
    "description":"Extends code area from CodeReview site",
    "version":"1",
    "manifest_version":2,
    "content_scripts": [
        {
          "matches": ["http://codereview.stackexchange.com/*"],
          "js": ["jquery-2.2.0.js", "myscript.js"],
          "css": ["styles.css"]
        } 
      ]
}

2. Styles (styles.css)

.moveToLeft { 
    margin-left: -200px !important;
    width: 928px !important;
}
.largerReadonlyCodeBlock { 
    width: 860px !important; 
}

.questionHeader {
    margin-left: -200px !important;
    width: 1270px !important;
}

.footerMenu {
    margin-left: -200px !important;
    width: 1310px !important;
}

3. Javascript file (myscript.js)

$(".wmd-input").css("resize", "both");
$("#mainbar").addClass("moveToLeft");
$(".post-text").addClass("largerReadonlyCodeBlock");
$("#question-header").addClass("questionHeader");
$("#footer-menu").addClass("footerMenu");

Currently, the code enlarges the column by a hardcoded value of 200px, but it should be enough in most cases.