OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008 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 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
560 | 560 |
561 filterSubMenu.setEnabled(hasFilters || (consoleMessage && consoleMessage.url
)); | 561 filterSubMenu.setEnabled(hasFilters || (consoleMessage && consoleMessage.url
)); |
562 unhideAll.setEnabled(hasFilters); | 562 unhideAll.setEnabled(hasFilters); |
563 | 563 |
564 contextMenu.appendSeparator(); | 564 contextMenu.appendSeparator(); |
565 contextMenu.appendAction('console.clear'); | 565 contextMenu.appendAction('console.clear'); |
566 contextMenu.appendAction('console.clear.history'); | 566 contextMenu.appendAction('console.clear.history'); |
567 contextMenu.appendItem(Common.UIString('Save as...'), this._saveConsole.bind
(this)); | 567 contextMenu.appendItem(Common.UIString('Save as...'), this._saveConsole.bind
(this)); |
568 | 568 |
569 var request = consoleMessage ? consoleMessage.request : null; | 569 var request = consoleMessage ? consoleMessage.request : null; |
570 if (request && request.resourceType() === Common.resourceTypes.XHR) { | 570 if (request && SDK.NetworkManager.canReplayRequest(request)) { |
571 contextMenu.appendSeparator(); | 571 contextMenu.appendSeparator(); |
572 contextMenu.appendItem(Common.UIString('Replay XHR'), request.replayXHR.bi
nd(request)); | 572 contextMenu.appendItem(Common.UIString('Replay XHR'), SDK.NetworkManager.r
eplayRequest.bind(null, request)); |
573 } | 573 } |
574 | 574 |
575 contextMenu.show(); | 575 contextMenu.show(); |
576 } | 576 } |
577 | 577 |
578 _saveConsole() { | 578 _saveConsole() { |
579 var url = SDK.targetManager.mainTarget().inspectedURL(); | 579 var url = SDK.targetManager.mainTarget().inspectedURL(); |
580 var parsedURL = url.asParsedURL(); | 580 var parsedURL = url.asParsedURL(); |
581 var filename = String.sprintf('%s-%d.log', parsedURL ? parsedURL.host : 'con
sole', Date.now()); | 581 var filename = String.sprintf('%s-%d.log', parsedURL ? parsedURL.host : 'con
sole', Date.now()); |
582 var stream = new Bindings.FileOutputStream(); | 582 var stream = new Bindings.FileOutputStream(); |
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1276 return true; | 1276 return true; |
1277 } | 1277 } |
1278 return false; | 1278 return false; |
1279 } | 1279 } |
1280 }; | 1280 }; |
1281 | 1281 |
1282 /** | 1282 /** |
1283 * @typedef {{messageIndex: number, matchIndex: number}} | 1283 * @typedef {{messageIndex: number, matchIndex: number}} |
1284 */ | 1284 */ |
1285 Console.ConsoleView.RegexMatchRange; | 1285 Console.ConsoleView.RegexMatchRange; |
OLD | NEW |