Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(514)

Side by Side Diff: Source/devtools/front_end/elements/OverridesView.js

Issue 318653003: [DevTools] Fix integer/double values in emulation input fields. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2014 Google Inc. All rights reserved. 2 * Copyright (C) 2014 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 fieldsetElement.disabled = true; 257 fieldsetElement.disabled = true;
258 fieldsetElement.id = "metrics-override-section"; 258 fieldsetElement.id = "metrics-override-section";
259 259
260 var tableElement = fieldsetElement.createChild("table", "nowrap"); 260 var tableElement = fieldsetElement.createChild("table", "nowrap");
261 261
262 var rowElement = tableElement.createChild("tr"); 262 var rowElement = tableElement.createChild("tr");
263 var cellElement = rowElement.createChild("td"); 263 var cellElement = rowElement.createChild("td");
264 cellElement.appendChild(document.createTextNode(WebInspector.UIString("R esolution:"))); 264 cellElement.appendChild(document.createTextNode(WebInspector.UIString("R esolution:")));
265 cellElement = rowElement.createChild("td"); 265 cellElement = rowElement.createChild("td");
266 266
267 var widthOverrideInput = WebInspector.SettingsUI.createSettingInputField ("", WebInspector.overridesSupport.settings.deviceWidth, true, 4, "80px", WebIns pector.OverridesSupport.inputValidator, true); 267 var widthOverrideInput = WebInspector.SettingsUI.createSettingInputField ("", WebInspector.overridesSupport.settings.deviceWidth, true, 4, "80px", WebIns pector.OverridesSupport.integerInputValidator, true);
268 cellElement.appendChild(widthOverrideInput); 268 cellElement.appendChild(widthOverrideInput);
269 this._swapDimensionsElement = cellElement.createChild("button", "overrid es-swap"); 269 this._swapDimensionsElement = cellElement.createChild("button", "overrid es-swap");
270 this._swapDimensionsElement.appendChild(document.createTextNode(" \u21C4 ")); // RIGHTWARDS ARROW OVER LEFTWARDS ARROW. 270 this._swapDimensionsElement.appendChild(document.createTextNode(" \u21C4 ")); // RIGHTWARDS ARROW OVER LEFTWARDS ARROW.
271 this._swapDimensionsElement.title = WebInspector.UIString("Swap dimensio ns"); 271 this._swapDimensionsElement.title = WebInspector.UIString("Swap dimensio ns");
272 this._swapDimensionsElement.addEventListener("click", WebInspector.overr idesSupport.swapDimensions.bind(WebInspector.overridesSupport), false); 272 this._swapDimensionsElement.addEventListener("click", WebInspector.overr idesSupport.swapDimensions.bind(WebInspector.overridesSupport), false);
273 this._swapDimensionsElement.tabIndex = -1; 273 this._swapDimensionsElement.tabIndex = -1;
274 var heightOverrideInput = WebInspector.SettingsUI.createSettingInputFiel d("", WebInspector.overridesSupport.settings.deviceHeight, true, 4, "80px", WebI nspector.OverridesSupport.inputValidator, true); 274 var heightOverrideInput = WebInspector.SettingsUI.createSettingInputFiel d("", WebInspector.overridesSupport.settings.deviceHeight, true, 4, "80px", WebI nspector.OverridesSupport.integerInputValidator, true);
275 cellElement.appendChild(heightOverrideInput); 275 cellElement.appendChild(heightOverrideInput);
276 276
277 rowElement = tableElement.createChild("tr"); 277 rowElement = tableElement.createChild("tr");
278 cellElement = rowElement.createChild("td"); 278 cellElement = rowElement.createChild("td");
279 cellElement.colSpan = 4; 279 cellElement.colSpan = 4;
280 280
281 var widthRangeInput = WebInspector.SettingsUI.createSettingInputField("" , WebInspector.overridesSupport.settings.deviceWidth, true, 4, "200px", undefine d, true).lastChild; 281 var widthRangeInput = WebInspector.SettingsUI.createSettingInputField("" , WebInspector.overridesSupport.settings.deviceWidth, true, 4, "200px", undefine d, true).lastChild;
282 widthRangeInput.type = "range"; 282 widthRangeInput.type = "range";
283 widthRangeInput.min = 100; 283 widthRangeInput.min = 100;
284 widthRangeInput.max = 2000; 284 widthRangeInput.max = 2000;
285 cellElement.appendChild(widthRangeInput); 285 cellElement.appendChild(widthRangeInput);
286 286
287 rowElement = tableElement.createChild("tr"); 287 rowElement = tableElement.createChild("tr");
288 rowElement.title = WebInspector.UIString("Ratio between a device's physi cal pixels and device-independent pixels."); 288 rowElement.title = WebInspector.UIString("Ratio between a device's physi cal pixels and device-independent pixels.");
289 rowElement.createChild("td").appendChild(document.createTextNode(WebInsp ector.UIString("Device pixel ratio:"))); 289 rowElement.createChild("td").appendChild(document.createTextNode(WebInsp ector.UIString("Device pixel ratio:")));
290 rowElement.createChild("td").appendChild(WebInspector.SettingsUI.createS ettingInputField("", WebInspector.overridesSupport.settings.deviceScaleFactor, t rue, 2, "80px", WebInspector.OverridesSupport.inputValidator, true)); 290 rowElement.createChild("td").appendChild(WebInspector.SettingsUI.createS ettingInputField("", WebInspector.overridesSupport.settings.deviceScaleFactor, t rue, 4, "80px", WebInspector.OverridesSupport.doubleInputValidator, true));
291 291
292 var textAutosizingOverrideElement = this._createSettingCheckbox(WebInspe ctor.UIString("Enable text autosizing "), WebInspector.overridesSupport.settings .deviceTextAutosizing); 292 var textAutosizingOverrideElement = this._createSettingCheckbox(WebInspe ctor.UIString("Enable text autosizing "), WebInspector.overridesSupport.settings .deviceTextAutosizing);
293 textAutosizingOverrideElement.title = WebInspector.UIString("Text autosi zing is the feature that boosts font sizes on mobile devices."); 293 textAutosizingOverrideElement.title = WebInspector.UIString("Text autosi zing is the feature that boosts font sizes on mobile devices.");
294 fieldsetElement.appendChild(textAutosizingOverrideElement); 294 fieldsetElement.appendChild(textAutosizingOverrideElement);
295 295
296 checkbox = this._createSettingCheckbox(WebInspector.UIString("Shrink to fit"), WebInspector.overridesSupport.settings.deviceFitWindow); 296 checkbox = this._createSettingCheckbox(WebInspector.UIString("Shrink to fit"), WebInspector.overridesSupport.settings.deviceFitWindow);
297 fieldsetElement.appendChild(checkbox); 297 fieldsetElement.appendChild(checkbox);
298 this.element.appendChild(fieldsetElement); 298 this.element.appendChild(fieldsetElement);
299 }, 299 },
300 300
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after
763 763
764 __proto__ : WebInspector.OverridesView.Tab.prototype 764 __proto__ : WebInspector.OverridesView.Tab.prototype
765 } 765 }
766 766
767 /** @enum {string} */ 767 /** @enum {string} */
768 WebInspector.OverridesView.SensorsTab.DeviceOrientationModificationSource = { 768 WebInspector.OverridesView.SensorsTab.DeviceOrientationModificationSource = {
769 UserInput: "userInput", 769 UserInput: "userInput",
770 UserDrag: "userDrag", 770 UserDrag: "userDrag",
771 ResetButton: "resetButton" 771 ResetButton: "resetButton"
772 } 772 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698