Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 253 } | 253 } |
| 254 | 254 |
| 255 WebInspector.OverridesSupport.DeviceOrientation.clearDeviceOrientationOverride = function() | 255 WebInspector.OverridesSupport.DeviceOrientation.clearDeviceOrientationOverride = function() |
| 256 { | 256 { |
| 257 PageAgent.clearDeviceOrientationOverride(); | 257 PageAgent.clearDeviceOrientationOverride(); |
| 258 } | 258 } |
| 259 | 259 |
| 260 /** | 260 /** |
| 261 * @param {string} value | 261 * @param {string} value |
| 262 */ | 262 */ |
| 263 WebInspector.OverridesSupport.inputValidator = function(value) | 263 WebInspector.OverridesSupport.integerInputValidator = function(value) |
| 264 { | 264 { |
| 265 if (value >= 0 && value <= 10000) | 265 if (/^[\d]+$/.test(value) && value >= 0 && value <= 10000) |
| 266 return ""; | 266 return ""; |
| 267 return WebInspector.UIString("Value must be non-negative integer"); | 267 return WebInspector.UIString("Value must be non-negative integer"); |
| 268 } | 268 } |
| 269 | |
| 270 /** | |
| 271 * @param {string} value | |
| 272 */ | |
| 273 WebInspector.OverridesSupport.doubleInputValidator = function(value) | |
| 274 { | |
| 275 if (/^[\d]+(\.\d+)?|\.\d+$/.test(value) && value >= 0 && value <= 10000) | |
|
apavlov
2014/06/04 11:42:06
This forbids the ".5" format common in the US
dgozman
2014/06/04 12:43:20
There is a special \.\d+ branch for this format.
apavlov
2014/06/04 12:53:56
Right, missed it.
| |
| 276 return ""; | |
| 277 return WebInspector.UIString("Value must be non-negative integer"); | |
|
apavlov
2014/06/04 11:42:06
integer -> float
dgozman
2014/06/04 12:43:20
Done.
| |
| 278 } | |
| 269 | 279 |
| 270 // Third element lists device metrics separated by 'x': | 280 // Third element lists device metrics separated by 'x': |
| 271 // - screen width, | 281 // - screen width, |
| 272 // - screen height, | 282 // - screen height, |
| 273 // - device scale factor, | 283 // - device scale factor, |
| 274 WebInspector.OverridesSupport._phones = [ | 284 WebInspector.OverridesSupport._phones = [ |
| 275 ["Apple iPhone 3GS", | 285 ["Apple iPhone 3GS", |
| 276 "Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_2_1 like Mac OS X; en-us) AppleWeb Kit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8C148 Safari/6533.18.5", | 286 "Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_2_1 like Mac OS X; en-us) AppleWeb Kit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8C148 Safari/6533.18.5", |
| 277 "320x480x1"], | 287 "320x480x1"], |
| 278 ["Apple iPhone 4", | 288 ["Apple iPhone 4", |
| (...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 932 }, | 942 }, |
| 933 | 943 |
| 934 __proto__: WebInspector.Object.prototype | 944 __proto__: WebInspector.Object.prototype |
| 935 } | 945 } |
| 936 | 946 |
| 937 | 947 |
| 938 /** | 948 /** |
| 939 * @type {!WebInspector.OverridesSupport} | 949 * @type {!WebInspector.OverridesSupport} |
| 940 */ | 950 */ |
| 941 WebInspector.overridesSupport; | 951 WebInspector.overridesSupport; |
| OLD | NEW |