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

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

Issue 662793002: [DevTools] Replace usages of document with custom functions. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 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) 2011 Brian Grinstead All rights reserved. 2 * Copyright (C) 2011 Brian Grinstead 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 439
440 __proto__: WebInspector.Object.prototype 440 __proto__: WebInspector.Object.prototype
441 } 441 }
442 442
443 /** 443 /**
444 * @constructor 444 * @constructor
445 * @param {boolean=} readOnly 445 * @param {boolean=} readOnly
446 */ 446 */
447 WebInspector.ColorSwatch = function(readOnly) 447 WebInspector.ColorSwatch = function(readOnly)
448 { 448 {
449 this.element = document.createElementWithClass("span", "swatch"); 449 this.element = createElementWithClass("span", "swatch");
450 this._swatchInnerElement = this.element.createChild("span", "swatch-inner"); 450 this._swatchInnerElement = this.element.createChild("span", "swatch-inner");
451 var shiftClickMessage = WebInspector.UIString("Shift-click to change color f ormat."); 451 var shiftClickMessage = WebInspector.UIString("Shift-click to change color f ormat.");
452 this.element.title = readOnly ? shiftClickMessage : String.sprintf("%s\n%s", WebInspector.UIString("Click to open a colorpicker."), shiftClickMessage); 452 this.element.title = readOnly ? shiftClickMessage : String.sprintf("%s\n%s", WebInspector.UIString("Click to open a colorpicker."), shiftClickMessage);
453 this.element.addEventListener("mousedown", consumeEvent, false); 453 this.element.addEventListener("mousedown", consumeEvent, false);
454 this.element.addEventListener("dblclick", consumeEvent, false); 454 this.element.addEventListener("dblclick", consumeEvent, false);
455 } 455 }
456 456
457 WebInspector.ColorSwatch.prototype = { 457 WebInspector.ColorSwatch.prototype = {
458 /** 458 /**
459 * @param {string} colorString 459 * @param {string} colorString
460 */ 460 */
461 setColorString: function(colorString) 461 setColorString: function(colorString)
462 { 462 {
463 this._swatchInnerElement.style.backgroundColor = colorString; 463 this._swatchInnerElement.style.backgroundColor = colorString;
464 } 464 }
465 } 465 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698