Bug 871014 - (Part 1) Remove "margins" setting from reader mode menu. r=bnicholson
authorMargaret Leibovic <margaret.leibovic@gmail.com>
Tue, 14 May 2013 14:55:43 -0700
changeset 143430 a3143178dc998daf13e750cca52fbe6d7abc8277
parent 143429 fa1dc340708bb1abec3c553bf77d1da4a64dda18
child 143431 0623dece2b893efe98c7d5a83e9b41c07e6c1e61
push id2697
push userbbajaj@mozilla.com
push dateMon, 05 Aug 2013 18:49:53 +0000
treeherdermozilla-beta@dfec938c7b63 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbnicholson
bugs871014
milestone24.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 871014 - (Part 1) Remove "margins" setting from reader mode menu. r=bnicholson
mobile/android/app/mobile.js
mobile/android/chrome/content/aboutReader.html
mobile/android/chrome/content/aboutReader.js
mobile/android/locales/en-US/chrome/aboutReader.properties
--- a/mobile/android/app/mobile.js
+++ b/mobile/android/app/mobile.js
@@ -657,19 +657,16 @@ pref("reader.parse-on-load.enabled", tru
 
 // Force to enable reader mode to parse on loaded a page.
 // Allow reader mode even on low-memory platforms
 pref("reader.parse-on-load.force-enabled", false);
 
 // The default of font size in reader (1-7)
 pref("reader.font_size", 4);
 
-// The default of margin size in reader (5%-25%)
-pref("reader.margin_size", 5);
-
 // The default color scheme in reader (light, dark, sepia, auto)
 // auto = color automatically adjusts according to ambient light level
 pref("reader.color_scheme", "auto");
 
 // The font type in reader (sans-serif, serif)
 pref("reader.font_type", "sans-serif");
 
 // Used to show a first-launch tip in reader
--- a/mobile/android/chrome/content/aboutReader.html
+++ b/mobile/android/chrome/content/aboutReader.html
@@ -26,18 +26,16 @@
     <ul class="dropdown">
       <li><a class="dropdown-toggle button style-button" href="#"></a></li>
       <li class="dropdown-popup">
         <ul id="color-scheme-buttons" class="segmented-button"></ul>
         <hr></hr>
         <ul id="font-type-buttons" class="segmented-button"></ul>
         <hr></hr>
         <div id="font-size-control" class="step-control"></div>
-        <hr></hr>
-        <div id="margin-size-control" class="step-control"></div>
       </li>
     </ul>
     <li><a id="list-button" class="button list-button" href="#"></a></li>
     <li><a id="toggle-button" class="button toggle-button" href="#"></a></li>
   </ul>
 
 </body>
 
--- a/mobile/android/chrome/content/aboutReader.js
+++ b/mobile/android/chrome/content/aboutReader.js
@@ -86,22 +86,16 @@ let AboutReader = function(doc, win) {
   this._setFontType(fontType);
 
   let fontTitle = gStrings.GetStringFromName("aboutReader.textTitle");
   this._fontSize = 0;
   this._setupStepControl("font-size-control", fontTitle,
     this._FONT_SIZE_MIN, this._FONT_SIZE_MAX, this._FONT_SIZE_STEP, Services.prefs.getIntPref("reader.font_size"),
     this._onFontSizeChange.bind(this));
 
-  let marginTitle = gStrings.GetStringFromName("aboutReader.marginTitle");
-  this._marginSize = 0;
-  this._setupStepControl("margin-size-control", marginTitle,
-    this._MARGIN_SIZE_MIN, this._MARGIN_SIZE_MAX, this._MARGIN_SIZE_STEP, Services.prefs.getIntPref("reader.margin_size"),
-    this._onMarginSizeChange.bind(this));
-
   dump("Decoding query arguments");
   let queryArgs = this._decodeQueryString(win.location.href);
 
   this._isReadingListItem = (queryArgs.readingList == "1");
   this._updateToggleButton();
 
   let url = queryArgs.url;
   let tabId = queryArgs.tabId;
@@ -113,19 +107,16 @@ let AboutReader = function(doc, win) {
     this._loadFromURL(url);
   }
 }
 
 AboutReader.prototype = {
   _FONT_SIZE_MIN: 1,
   _FONT_SIZE_MAX: 7,
   _FONT_SIZE_STEP: 1,
-  _MARGIN_SIZE_MIN: 5,
-  _MARGIN_SIZE_MAX: 25,
-  _MARGIN_SIZE_STEP: 5,
 
   _BLOCK_IMAGES_SELECTOR: ".content p > img:only-child, " +
                           ".content p > a:only-child > img:only-child, " +
                           ".content .wp-caption img, " +
                           ".content figure img",
 
   get _doc() {
     return this._docRef.get();
@@ -293,28 +284,16 @@ AboutReader.prototype = {
 
     gChromeWin.sendMessageToJava({
       type: "Reader:Share",
       url: this._article.url,
       title: this._article.title
     });
   },
 
-  _onMarginSizeChange: function Reader_onMarginSizeChange(newMarginSize) {
-    let doc = this._doc;
-
-    this._marginSize = newMarginSize;
-    doc.body.style.marginLeft = this._marginSize + "%";
-    doc.body.style.marginRight = this._marginSize + "%";
-
-    this._updateImageMargins();
-
-    Services.prefs.setIntPref("reader.margin_size", this._marginSize);
-  },
-
   _onFontSizeChange: function Reader_onFontSizeChange(newFontSize) {
     let bodyClasses = this._doc.body.classList;
 
     if (this._fontSize > 0)
       bodyClasses.remove("font-size" + this._fontSize);
 
     this._fontSize = newFontSize;
     bodyClasses.add("font-size" + this._fontSize);
--- a/mobile/android/locales/en-US/chrome/aboutReader.properties
+++ b/mobile/android/locales/en-US/chrome/aboutReader.properties
@@ -1,17 +1,16 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 aboutReader.loading=Loading...
 aboutReader.loadError=Failed to load article from page
 
 aboutReader.textTitle=Text
-aboutReader.marginTitle=Margins
 
 aboutReader.colorSchemeLight=Light
 aboutReader.colorSchemeDark=Dark
 aboutReader.colorSchemeSepia=Sepia
 aboutReader.colorSchemeAuto=Auto
 
 aboutReader.fontTypeSansSerif=Sans
 aboutReader.fontTypeSerif=Serif