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

Side by Side Diff: Source/devtools/front_end/resources/DatabaseQueryView.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) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 20 matching lines...) Expand all
31 { 31 {
32 WebInspector.VBox.call(this); 32 WebInspector.VBox.call(this);
33 33
34 this.database = database; 34 this.database = database;
35 35
36 this.element.classList.add("storage-view"); 36 this.element.classList.add("storage-view");
37 this.element.classList.add("query"); 37 this.element.classList.add("query");
38 this.element.classList.add("monospace"); 38 this.element.classList.add("monospace");
39 this.element.addEventListener("selectstart", this._selectStart.bind(this), f alse); 39 this.element.addEventListener("selectstart", this._selectStart.bind(this), f alse);
40 40
41 this._promptElement = document.createElement("div"); 41 this._promptElement = createElement("div");
42 this._promptElement.className = "database-query-prompt"; 42 this._promptElement.className = "database-query-prompt";
43 this._promptElement.appendChild(document.createElement("br")); 43 this._promptElement.appendChild(createElement("br"));
44 this._promptElement.addEventListener("keydown", this._promptKeyDown.bind(thi s), true); 44 this._promptElement.addEventListener("keydown", this._promptKeyDown.bind(thi s), true);
45 this.element.appendChild(this._promptElement); 45 this.element.appendChild(this._promptElement);
46 46
47 this._prompt = new WebInspector.TextPromptWithHistory(this.completions.bind( this), " "); 47 this._prompt = new WebInspector.TextPromptWithHistory(this.completions.bind( this), " ");
48 this._prompt.attach(this._promptElement); 48 this._prompt.attach(this._promptElement);
49 49
50 this.element.addEventListener("click", this._messagesClicked.bind(this), tru e); 50 this.element.addEventListener("click", this._messagesClicked.bind(this), tru e);
51 } 51 }
52 52
53 WebInspector.DatabaseQueryView.Events = { 53 WebInspector.DatabaseQueryView.Events = {
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 { 181 {
182 var resultElement = this._appendQueryResult(query); 182 var resultElement = this._appendQueryResult(query);
183 resultElement.classList.add("error") 183 resultElement.classList.add("error")
184 resultElement.textContent = errorText; 184 resultElement.textContent = errorText;
185 185
186 this._promptElement.scrollIntoView(false); 186 this._promptElement.scrollIntoView(false);
187 }, 187 },
188 188
189 _appendQueryResult: function(query) 189 _appendQueryResult: function(query)
190 { 190 {
191 var element = document.createElement("div"); 191 var element = createElement("div");
192 element.className = "database-user-query"; 192 element.className = "database-user-query";
193 this.element.insertBefore(element, this._prompt.proxyElement); 193 this.element.insertBefore(element, this._prompt.proxyElement);
194 194
195 var commandTextElement = document.createElement("span"); 195 var commandTextElement = createElement("span");
196 commandTextElement.className = "database-query-text"; 196 commandTextElement.className = "database-query-text";
197 commandTextElement.textContent = query; 197 commandTextElement.textContent = query;
198 element.appendChild(commandTextElement); 198 element.appendChild(commandTextElement);
199 199
200 var resultElement = document.createElement("div"); 200 var resultElement = createElement("div");
201 resultElement.className = "database-query-result"; 201 resultElement.className = "database-query-result";
202 element.appendChild(resultElement); 202 element.appendChild(resultElement);
203 return resultElement; 203 return resultElement;
204 }, 204 },
205 205
206 __proto__: WebInspector.VBox.prototype 206 __proto__: WebInspector.VBox.prototype
207 } 207 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698