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

Side by Side Diff: Source/devtools/front_end/sources/JavaScriptSourceFrame.js

Issue 362273002: DevTools: Reduce code via using document.createElementWithClass and document.createChild. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after
639 } 639 }
640 640
641 var config = new WebInspector.InplaceEditor.Config(finishEditing.bind(th is, true), finishEditing.bind(this, false)); 641 var config = new WebInspector.InplaceEditor.Config(finishEditing.bind(th is, true), finishEditing.bind(this, false));
642 WebInspector.InplaceEditor.startEditing(this._conditionEditorElement, co nfig); 642 WebInspector.InplaceEditor.startEditing(this._conditionEditorElement, co nfig);
643 this._conditionEditorElement.value = breakpoint ? breakpoint.condition() : ""; 643 this._conditionEditorElement.value = breakpoint ? breakpoint.condition() : "";
644 this._conditionEditorElement.select(); 644 this._conditionEditorElement.select();
645 }, 645 },
646 646
647 _createConditionElement: function(lineNumber) 647 _createConditionElement: function(lineNumber)
648 { 648 {
649 var conditionElement = document.createElement("div"); 649 var conditionElement = document.createElementWithClass("div", "source-fr ame-breakpoint-condition");
650 conditionElement.className = "source-frame-breakpoint-condition";
651 650
652 var labelElement = document.createElement("label"); 651 var labelElement = conditionElement.createChild("label", "source-frame-b reakpoint-message");
653 labelElement.className = "source-frame-breakpoint-message";
654 labelElement.htmlFor = "source-frame-breakpoint-condition"; 652 labelElement.htmlFor = "source-frame-breakpoint-condition";
655 labelElement.appendChild(document.createTextNode(WebInspector.UIString(" The breakpoint on line %d will stop only if this expression is true:", lineNumbe r + 1))); 653 labelElement.createTextChild(WebInspector.UIString("The breakpoint on li ne %d will stop only if this expression is true:", lineNumber + 1));
656 conditionElement.appendChild(labelElement);
657 654
658 var editorElement = document.createElement("input"); 655 var editorElement = conditionElement.createChild("input", "monospace");
659 editorElement.id = "source-frame-breakpoint-condition"; 656 editorElement.id = "source-frame-breakpoint-condition";
660 editorElement.className = "monospace";
661 editorElement.type = "text"; 657 editorElement.type = "text";
662 conditionElement.appendChild(editorElement);
663 this._conditionEditorElement = editorElement; 658 this._conditionEditorElement = editorElement;
664 659
665 return conditionElement; 660 return conditionElement;
666 }, 661 },
667 662
668 /** 663 /**
669 * @param {number} lineNumber 664 * @param {number} lineNumber
670 */ 665 */
671 setExecutionLine: function(lineNumber) 666 setExecutionLine: function(lineNumber)
672 { 667 {
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
896 this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events. ConsoleMessageRemoved, this._consoleMessageRemoved, this); 891 this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events. ConsoleMessageRemoved, this._consoleMessageRemoved, this);
897 this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events. ConsoleMessagesCleared, this._consoleMessagesCleared, this); 892 this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events. ConsoleMessagesCleared, this._consoleMessagesCleared, this);
898 this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events. SourceMappingChanged, this._onSourceMappingChanged, this); 893 this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events. SourceMappingChanged, this._onSourceMappingChanged, this);
899 this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events. WorkingCopyChanged, this._workingCopyChanged, this); 894 this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events. WorkingCopyChanged, this._workingCopyChanged, this);
900 this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events. WorkingCopyCommitted, this._workingCopyCommitted, this); 895 this._uiSourceCode.removeEventListener(WebInspector.UISourceCode.Events. WorkingCopyCommitted, this._workingCopyCommitted, this);
901 WebInspector.UISourceCodeFrame.prototype.dispose.call(this); 896 WebInspector.UISourceCodeFrame.prototype.dispose.call(this);
902 }, 897 },
903 898
904 __proto__: WebInspector.UISourceCodeFrame.prototype 899 __proto__: WebInspector.UISourceCodeFrame.prototype
905 } 900 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/source_frame/SourceFrame.js ('k') | Source/devtools/front_end/sources/NavigatorView.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698