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

Side by Side Diff: Source/devtools/front_end/ui/UIUtils.js

Issue 1172733002: Devtools: Fix ctrl-z in ColorPicker (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rework Created 5 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
« no previous file with comments | « Source/devtools/front_end/elements/spectrum.css ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. 3 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
4 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com). 4 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com).
5 * Copyright (C) 2009 Joseph Pecoraro 5 * Copyright (C) 2009 Joseph Pecoraro
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 10 *
(...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after
644 644
645 /** 645 /**
646 * @param {!Element} element 646 * @param {!Element} element
647 * @return {!DocumentFragment} 647 * @return {!DocumentFragment}
648 */ 648 */
649 WebInspector.createShadowRootWithCoreStyles = function(element) 649 WebInspector.createShadowRootWithCoreStyles = function(element)
650 { 650 {
651 var shadowRoot = element.createShadowRoot(); 651 var shadowRoot = element.createShadowRoot();
652 shadowRoot.appendChild(WebInspector.Widget.createStyleElement("ui/inspectorC ommon.css")); 652 shadowRoot.appendChild(WebInspector.Widget.createStyleElement("ui/inspectorC ommon.css"));
653 shadowRoot.appendChild(WebInspector.Widget.createStyleElement("ui/inspectorS yntaxHighlight.css")); 653 shadowRoot.appendChild(WebInspector.Widget.createStyleElement("ui/inspectorS yntaxHighlight.css"));
654 shadowRoot.addEventListener("focus", WebInspector._focusChanged.bind(WebInsp ector), true);
654 return shadowRoot; 655 return shadowRoot;
655 } 656 }
656 657
657 /** 658 /**
658 * @param {!Document} document 659 * @param {!Document} document
659 * @param {!Event} event 660 * @param {!Event} event
660 */ 661 */
661 WebInspector._windowFocused = function(document, event) 662 WebInspector._windowFocused = function(document, event)
662 { 663 {
663 if (event.target.document.nodeType === Node.DOCUMENT_NODE) 664 if (event.target.document.nodeType === Node.DOCUMENT_NODE)
(...skipping 20 matching lines...) Expand all
684 685
685 /** 686 /**
686 * @return {!Element} 687 * @return {!Element}
687 */ 688 */
688 WebInspector.currentFocusElement = function() 689 WebInspector.currentFocusElement = function()
689 { 690 {
690 return WebInspector._currentFocusElement; 691 return WebInspector._currentFocusElement;
691 } 692 }
692 693
693 /** 694 /**
694 * @param {!Document} document
695 * @param {!Event} event 695 * @param {!Event} event
696 */ 696 */
697 WebInspector._focusChanged = function(document, event) 697 WebInspector._focusChanged = function(event)
698 { 698 {
699 var node = event.deepActiveElement(); 699 var node = event.deepActiveElement();
700 WebInspector.setCurrentFocusElement(node); 700 WebInspector.setCurrentFocusElement(node);
701 } 701 }
702 702
703 /** 703 /**
704 * @param {!Document} document 704 * @param {!Document} document
705 * @param {!Event} event 705 * @param {!Event} event
706 */ 706 */
707 WebInspector._documentBlurred = function(document, event) 707 WebInspector._documentBlurred = function(document, event)
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after
1194 __proto__: WebInspector.Object.prototype 1194 __proto__: WebInspector.Object.prototype
1195 } 1195 }
1196 1196
1197 /** 1197 /**
1198 * @param {!Window} window 1198 * @param {!Window} window
1199 */ 1199 */
1200 WebInspector.initializeUIUtils = function(window) 1200 WebInspector.initializeUIUtils = function(window)
1201 { 1201 {
1202 window.addEventListener("focus", WebInspector._windowFocused.bind(WebInspect or, window.document), false); 1202 window.addEventListener("focus", WebInspector._windowFocused.bind(WebInspect or, window.document), false);
1203 window.addEventListener("blur", WebInspector._windowBlurred.bind(WebInspecto r, window.document), false); 1203 window.addEventListener("blur", WebInspector._windowBlurred.bind(WebInspecto r, window.document), false);
1204 window.document.addEventListener("focus", WebInspector._focusChanged.bind(We bInspector, window.document), true); 1204 window.document.addEventListener("focus", WebInspector._focusChanged.bind(We bInspector), true);
1205 window.document.addEventListener("blur", WebInspector._documentBlurred.bind( WebInspector, window.document), true); 1205 window.document.addEventListener("blur", WebInspector._documentBlurred.bind( WebInspector, window.document), true);
1206 } 1206 }
1207 1207
1208 /** 1208 /**
1209 * @param {string} name 1209 * @param {string} name
1210 * @return {string} 1210 * @return {string}
1211 */ 1211 */
1212 WebInspector.beautifyFunctionName = function(name) 1212 WebInspector.beautifyFunctionName = function(name)
1213 { 1213 {
1214 return name || WebInspector.UIString("(anonymous function)"); 1214 return name || WebInspector.UIString("(anonymous function)");
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
1471 // Due to the nature of regex, |items| array has matched elements on its even indexes. 1471 // Due to the nature of regex, |items| array has matched elements on its even indexes.
1472 var items = text.replace(regex, "\0$1\0").split("\0"); 1472 var items = text.replace(regex, "\0$1\0").split("\0");
1473 for (var i = 0; i < items.length; ++i) { 1473 for (var i = 0; i < items.length; ++i) {
1474 var processedNode = i % 2 ? processor(items[i]) : this._runProcessor (processorIndex + 1, items[i]); 1474 var processedNode = i % 2 ? processor(items[i]) : this._runProcessor (processorIndex + 1, items[i]);
1475 container.appendChild(processedNode); 1475 container.appendChild(processedNode);
1476 } 1476 }
1477 1477
1478 return container; 1478 return container;
1479 } 1479 }
1480 } 1480 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/elements/spectrum.css ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698