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

Side by Side Diff: Source/devtools/front_end/source_frame/CodeMirrorTextEditor.js

Issue 452083002: DevTools: Implement CSS/JS documentation context menu provider for CodeMirrorTextEditor (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@my-patch
Patch Set: Rebased master branch Created 6 years, 4 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
« no previous file with comments | « Source/devtools/front_end/main/Main.js ('k') | Source/devtools/scripts/frontend_modules.json » ('j') | 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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 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 937 matching lines...) Expand 10 before | Expand all | Expand 10 after
948 }, 948 },
949 949
950 _contextMenu: function(event) 950 _contextMenu: function(event)
951 { 951 {
952 var contextMenu = new WebInspector.ContextMenu(event); 952 var contextMenu = new WebInspector.ContextMenu(event);
953 var target = event.target.enclosingNodeOrSelfWithClass("CodeMirror-gutte r-elt"); 953 var target = event.target.enclosingNodeOrSelfWithClass("CodeMirror-gutte r-elt");
954 if (target) 954 if (target)
955 this._delegate.populateLineGutterContextMenu(contextMenu, parseInt(t arget.textContent, 10) - 1); 955 this._delegate.populateLineGutterContextMenu(contextMenu, parseInt(t arget.textContent, 10) - 1);
956 else 956 else
957 this._delegate.populateTextAreaContextMenu(contextMenu, 0); 957 this._delegate.populateTextAreaContextMenu(contextMenu, 0);
958 contextMenu.appendApplicableItems(this);
958 contextMenu.show(); 959 contextMenu.show();
959 }, 960 },
960 961
961 /** 962 /**
962 * @param {number} lineNumber 963 * @param {number} lineNumber
963 * @param {boolean} disabled 964 * @param {boolean} disabled
964 * @param {boolean} conditional 965 * @param {boolean} conditional
965 */ 966 */
966 addBreakpoint: function(lineNumber, disabled, conditional) 967 addBreakpoint: function(lineNumber, disabled, conditional)
967 { 968 {
(...skipping 1437 matching lines...) Expand 10 before | Expand all | Expand 10 after
2405 var backgroundColorRule = backgroundColor ? ".CodeMirror .CodeMirror-selecte d { background-color: " + backgroundColor + ";}" : ""; 2406 var backgroundColorRule = backgroundColor ? ".CodeMirror .CodeMirror-selecte d { background-color: " + backgroundColor + ";}" : "";
2406 var foregroundColor = InspectorFrontendHost.getSelectionForegroundColor(); 2407 var foregroundColor = InspectorFrontendHost.getSelectionForegroundColor();
2407 var foregroundColorRule = foregroundColor ? ".CodeMirror .CodeMirror-selecte dtext:not(.CodeMirror-persist-highlight) { color: " + foregroundColor + "!import ant;}" : ""; 2408 var foregroundColorRule = foregroundColor ? ".CodeMirror .CodeMirror-selecte dtext:not(.CodeMirror-persist-highlight) { color: " + foregroundColor + "!import ant;}" : "";
2408 if (!foregroundColorRule && !backgroundColorRule) 2409 if (!foregroundColorRule && !backgroundColorRule)
2409 return; 2410 return;
2410 2411
2411 var style = document.createElement("style"); 2412 var style = document.createElement("style");
2412 style.textContent = backgroundColorRule + foregroundColorRule; 2413 style.textContent = backgroundColorRule + foregroundColorRule;
2413 document.head.appendChild(style); 2414 document.head.appendChild(style);
2414 })(); 2415 })();
OLDNEW
« no previous file with comments | « Source/devtools/front_end/main/Main.js ('k') | Source/devtools/scripts/frontend_modules.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698