| 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 1679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1690 this._moveEditorFromSelector(moveDirection); | 1690 this._moveEditorFromSelector(moveDirection); |
| 1691 | 1691 |
| 1692 delete this._parentPane._userOperation; | 1692 delete this._parentPane._userOperation; |
| 1693 this._editingSelectorEnded(); | 1693 this._editingSelectorEnded(); |
| 1694 this._markSelectorMatches(); | 1694 this._markSelectorMatches(); |
| 1695 } | 1695 } |
| 1696 | 1696 |
| 1697 if (newContent) | 1697 if (newContent) |
| 1698 newContent = newContent.trim(); | 1698 newContent = newContent.trim(); |
| 1699 this._parentPane._userOperation = true; | 1699 this._parentPane._userOperation = true; |
| 1700 WebInspector.cssModel.addRule(this.pane.node.id, newContent, successCall
back.bind(this), this.editingSelectorCancelled.bind(this)); | 1700 |
| 1701 WebInspector.cssModel.requestViaInspectorStylesheet(this.pane.node, viaI
nspectorCallback.bind(this)); |
| 1702 |
| 1703 /** |
| 1704 * @this {WebInspector.BlankStylePropertiesSection} |
| 1705 * @param {?WebInspector.CSSStyleSheetHeader} styleSheetHeader |
| 1706 */ |
| 1707 function viaInspectorCallback(styleSheetHeader) |
| 1708 { |
| 1709 if (!styleSheetHeader) { |
| 1710 this.editingSelectorCancelled(); |
| 1711 return; |
| 1712 } |
| 1713 WebInspector.cssModel.addRule(styleSheetHeader.id, this.pane.node, n
ewContent, successCallback.bind(this), this.editingSelectorCancelled.bind(this))
; |
| 1714 } |
| 1701 }, | 1715 }, |
| 1702 | 1716 |
| 1703 editingSelectorCancelled: function() | 1717 editingSelectorCancelled: function() |
| 1704 { | 1718 { |
| 1705 delete this._parentPane._userOperation; | 1719 delete this._parentPane._userOperation; |
| 1706 if (!this.isBlank) { | 1720 if (!this.isBlank) { |
| 1707 WebInspector.StylePropertiesSection.prototype.editingSelectorCancell
ed.call(this); | 1721 WebInspector.StylePropertiesSection.prototype.editingSelectorCancell
ed.call(this); |
| 1708 return; | 1722 return; |
| 1709 } | 1723 } |
| 1710 | 1724 |
| (...skipping 1309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3020 return; | 3034 return; |
| 3021 } | 3035 } |
| 3022 | 3036 |
| 3023 var results = this._cssCompletions.startsWith(prefix); | 3037 var results = this._cssCompletions.startsWith(prefix); |
| 3024 var selectedIndex = this._cssCompletions.mostUsedOf(results); | 3038 var selectedIndex = this._cssCompletions.mostUsedOf(results); |
| 3025 completionsReadyCallback(results, selectedIndex); | 3039 completionsReadyCallback(results, selectedIndex); |
| 3026 }, | 3040 }, |
| 3027 | 3041 |
| 3028 __proto__: WebInspector.TextPrompt.prototype | 3042 __proto__: WebInspector.TextPrompt.prototype |
| 3029 } | 3043 } |
| OLD | NEW |