OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 Apple Inc. All rights reserved. |
3 * Copyright (C) 2009 Joseph Pecoraro | 3 * Copyright (C) 2009 Joseph Pecoraro |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 2278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2289 | 2289 |
2290 scrollerElement = colorSwatch.element.enclosingNodeOrSelfWithCla
ss("style-panes-wrapper"); | 2290 scrollerElement = colorSwatch.element.enclosingNodeOrSelfWithCla
ss("style-panes-wrapper"); |
2291 if (scrollerElement) | 2291 if (scrollerElement) |
2292 scrollerElement.addEventListener("scroll", repositionSpectru
m, false); | 2292 scrollerElement.addEventListener("scroll", repositionSpectru
m, false); |
2293 else | 2293 else |
2294 console.error("Unable to handle color picker scrolling"); | 2294 console.error("Unable to handle color picker scrolling"); |
2295 } | 2295 } |
2296 } | 2296 } |
2297 | 2297 |
2298 var colorValueElement = document.createElement("span"); | 2298 var colorValueElement = document.createElement("span"); |
2299 colorValueElement.textContent = color.toString(format); | 2299 if (format === WebInspector.Color.Format.Original) |
| 2300 colorValueElement.textContent = text; |
| 2301 else |
| 2302 colorValueElement.textContent = color.toString(format); |
2300 | 2303 |
2301 /** | 2304 /** |
2302 * @param {string} curFormat | 2305 * @param {string} curFormat |
2303 */ | 2306 */ |
2304 function nextFormat(curFormat) | 2307 function nextFormat(curFormat) |
2305 { | 2308 { |
2306 // The format loop is as follows: | 2309 // The format loop is as follows: |
2307 // * original | 2310 // * original |
2308 // * rgb(a) | 2311 // * rgb(a) |
2309 // * hsl(a) | 2312 // * hsl(a) |
(...skipping 1005 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3315 */ | 3318 */ |
3316 _buildPropertyCompletions: function(proxyElement, wordRange, force, completi
onsReadyCallback) | 3319 _buildPropertyCompletions: function(proxyElement, wordRange, force, completi
onsReadyCallback) |
3317 { | 3320 { |
3318 var prefix = wordRange.toString().toLowerCase(); | 3321 var prefix = wordRange.toString().toLowerCase(); |
3319 if (!prefix && !force && (this._isEditingName || proxyElement.textConten
t.length)) { | 3322 if (!prefix && !force && (this._isEditingName || proxyElement.textConten
t.length)) { |
3320 completionsReadyCallback([]); | 3323 completionsReadyCallback([]); |
3321 return; | 3324 return; |
3322 } | 3325 } |
3323 | 3326 |
3324 var results = this._cssCompletions.startsWith(prefix); | 3327 var results = this._cssCompletions.startsWith(prefix); |
| 3328 var userEnteredText = wordRange.toString().replace("-", ""); |
| 3329 if (userEnteredText && (userEnteredText === userEnteredText.toUpperCase(
))) { |
| 3330 for (var i = 0; i < results.length; ++i) |
| 3331 results[i] = results[i].toUpperCase(); |
| 3332 } |
3325 var selectedIndex = this._cssCompletions.mostUsedOf(results); | 3333 var selectedIndex = this._cssCompletions.mostUsedOf(results); |
3326 completionsReadyCallback(results, selectedIndex); | 3334 completionsReadyCallback(results, selectedIndex); |
3327 }, | 3335 }, |
3328 | 3336 |
3329 __proto__: WebInspector.TextPrompt.prototype | 3337 __proto__: WebInspector.TextPrompt.prototype |
3330 } | 3338 } |
OLD | NEW |