OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 Apple Inc. All rights reserved. |
3 * Copyright (C) 2009 Joseph Pecoraro | 3 * Copyright (C) 2009 Joseph Pecoraro |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 1188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1199 if (!this.rule) | 1199 if (!this.rule) |
1200 return document.createTextNode(""); | 1200 return document.createTextNode(""); |
1201 | 1201 |
1202 var origin = ""; | 1202 var origin = ""; |
1203 if (this.rule.isUserAgent) | 1203 if (this.rule.isUserAgent) |
1204 return document.createTextNode(WebInspector.UIString("user agent sty
lesheet")); | 1204 return document.createTextNode(WebInspector.UIString("user agent sty
lesheet")); |
1205 if (this.rule.isUser) | 1205 if (this.rule.isUser) |
1206 return document.createTextNode(WebInspector.UIString("user styleshee
t")); | 1206 return document.createTextNode(WebInspector.UIString("user styleshee
t")); |
1207 if (this.rule.isViaInspector) { | 1207 if (this.rule.isViaInspector) { |
1208 var element = document.createElement("span"); | 1208 var element = document.createElement("span"); |
1209 /** | 1209 var resource = WebInspector.cssModel.viaInspectorResourceForRule(thi
s.rule); |
1210 * @param {?WebInspector.Resource} resource | 1210 if (resource) |
1211 */ | 1211 element.appendChild(linkifyUncopyable(resource.url, this.rule.so
urceLine)); |
1212 function callback(resource) | 1212 else |
1213 { | 1213 element.textContent = WebInspector.UIString("via inspector"); |
1214 if (resource) | |
1215 element.appendChild(linkifyUncopyable(resource.url, this.rul
e.sourceLine)); | |
1216 else | |
1217 element.textContent = WebInspector.UIString("via inspector")
; | |
1218 } | |
1219 WebInspector.cssModel.getViaInspectorResourceForRule(this.rule, call
back.bind(this)); | |
1220 return element; | 1214 return element; |
1221 } | 1215 } |
1222 }, | 1216 }, |
1223 | 1217 |
1224 _handleEmptySpaceMouseDown: function(event) | 1218 _handleEmptySpaceMouseDown: function(event) |
1225 { | 1219 { |
1226 this._willCauseCancelEditing = this._parentPane._isEditingStyle; | 1220 this._willCauseCancelEditing = this._parentPane._isEditingStyle; |
1227 }, | 1221 }, |
1228 | 1222 |
1229 _handleEmptySpaceClick: function(event) | 1223 _handleEmptySpaceClick: function(event) |
(...skipping 1503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2733 if (!prefix && !force) | 2727 if (!prefix && !force) |
2734 return; | 2728 return; |
2735 | 2729 |
2736 var results = this._cssCompletions.startsWith(prefix); | 2730 var results = this._cssCompletions.startsWith(prefix); |
2737 var selectedIndex = this._cssCompletions.mostUsedOf(results); | 2731 var selectedIndex = this._cssCompletions.mostUsedOf(results); |
2738 completionsReadyCallback(results, selectedIndex); | 2732 completionsReadyCallback(results, selectedIndex); |
2739 }, | 2733 }, |
2740 | 2734 |
2741 __proto__: WebInspector.TextPrompt.prototype | 2735 __proto__: WebInspector.TextPrompt.prototype |
2742 } | 2736 } |
OLD | NEW |