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

Side by Side Diff: Source/devtools/front_end/SearchableView.js

Issue 232133008: DevTools: Make replace checkbox id in SearchableView unique. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 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 | « LayoutTests/inspector/editor/text-editor-search-replace.html ('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) 2006, 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com). 3 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com).
4 * Copyright (C) 2009 Joseph Pecoraro 4 * Copyright (C) 2009 Joseph Pecoraro
5 * Copyright (C) 2011 Google Inc. All rights reserved. 5 * Copyright (C) 2011 Google Inc. All rights reserved.
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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 98
99 this._replaceAllButtonElement = this._secondRowElement.createChild("td").cre ateChild("button"); 99 this._replaceAllButtonElement = this._secondRowElement.createChild("td").cre ateChild("button");
100 this._replaceAllButtonElement.textContent = WebInspector.UIString("Replace A ll"); 100 this._replaceAllButtonElement.textContent = WebInspector.UIString("Replace A ll");
101 this._replaceAllButtonElement.addEventListener("click", this._replaceAll.bin d(this), false); 101 this._replaceAllButtonElement.addEventListener("click", this._replaceAll.bin d(this), false);
102 102
103 // Column 4 103 // Column 4
104 this._replaceElement = this._firstRowElement.createChild("td").createChild(" span"); 104 this._replaceElement = this._firstRowElement.createChild("td").createChild(" span");
105 105
106 this._replaceCheckboxElement = this._replaceElement.createChild("input"); 106 this._replaceCheckboxElement = this._replaceElement.createChild("input");
107 this._replaceCheckboxElement.type = "checkbox"; 107 this._replaceCheckboxElement.type = "checkbox";
108 this._replaceCheckboxElement.id = "search-replace-trigger"; 108 this._uniqueId = ++WebInspector.SearchableView._lastUniqueId;
109 var replaceCheckboxId = "search-replace-trigger" + this._uniqueId;
110 this._replaceCheckboxElement.id = replaceCheckboxId;
109 this._replaceCheckboxElement.addEventListener("change", this._updateSecondRo wVisibility.bind(this), false); 111 this._replaceCheckboxElement.addEventListener("change", this._updateSecondRo wVisibility.bind(this), false);
110 112
111 this._replaceLabelElement = this._replaceElement.createChild("label"); 113 this._replaceLabelElement = this._replaceElement.createChild("label");
112 this._replaceLabelElement.textContent = WebInspector.UIString("Replace"); 114 this._replaceLabelElement.textContent = WebInspector.UIString("Replace");
113 this._replaceLabelElement.setAttribute("for", "search-replace-trigger"); 115 this._replaceLabelElement.setAttribute("for", replaceCheckboxId);
114 116
115 // Column 5 117 // Column 5
116 var cancelButtonElement = this._firstRowElement.createChild("td").createChil d("button"); 118 var cancelButtonElement = this._firstRowElement.createChild("td").createChil d("button");
117 cancelButtonElement.textContent = WebInspector.UIString("Cancel"); 119 cancelButtonElement.textContent = WebInspector.UIString("Cancel");
118 cancelButtonElement.tabIndex = -1; 120 cancelButtonElement.tabIndex = -1;
119 cancelButtonElement.addEventListener("click", this.closeSearch.bind(this), f alse); 121 cancelButtonElement.addEventListener("click", this.closeSearch.bind(this), f alse);
120 this._minimalSearchQuerySize = 3; 122 this._minimalSearchQuerySize = 3;
121 123
122 this._registerShortcuts(); 124 this._registerShortcuts();
123 } 125 }
124 126
127 WebInspector.SearchableView._lastUniqueId = 0;
128
125 WebInspector.SearchableView.findShortcuts = function() 129 WebInspector.SearchableView.findShortcuts = function()
126 { 130 {
127 if (WebInspector.SearchableView._findShortcuts) 131 if (WebInspector.SearchableView._findShortcuts)
128 return WebInspector.SearchableView._findShortcuts; 132 return WebInspector.SearchableView._findShortcuts;
129 WebInspector.SearchableView._findShortcuts = [WebInspector.KeyboardShortcut. makeDescriptor("f", WebInspector.KeyboardShortcut.Modifiers.CtrlOrMeta)]; 133 WebInspector.SearchableView._findShortcuts = [WebInspector.KeyboardShortcut. makeDescriptor("f", WebInspector.KeyboardShortcut.Modifiers.CtrlOrMeta)];
130 if (!WebInspector.isMac()) 134 if (!WebInspector.isMac())
131 WebInspector.SearchableView._findShortcuts.push(WebInspector.KeyboardSho rtcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.F3)); 135 WebInspector.SearchableView._findShortcuts.push(WebInspector.KeyboardSho rtcut.makeDescriptor(WebInspector.KeyboardShortcut.Keys.F3));
132 return WebInspector.SearchableView._findShortcuts; 136 return WebInspector.SearchableView._findShortcuts;
133 } 137 }
134 138
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after
565 * @param {string} text 569 * @param {string} text
566 */ 570 */
567 replaceSelectionWith: function(text) { }, 571 replaceSelectionWith: function(text) { },
568 572
569 /** 573 /**
570 * @param {string} query 574 * @param {string} query
571 * @param {string} replacement 575 * @param {string} replacement
572 */ 576 */
573 replaceAllWith: function(query, replacement) { } 577 replaceAllWith: function(query, replacement) { }
574 } 578 }
OLDNEW
« no previous file with comments | « LayoutTests/inspector/editor/text-editor-search-replace.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698