OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. |
3 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com). | 3 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com). |
4 * Copyright (C) 2009 Joseph Pecoraro | 4 * Copyright (C) 2009 Joseph Pecoraro |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * | 9 * |
10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
630 */ | 630 */ |
631 _updateItem(item, count, first, title) { | 631 _updateItem(item, count, first, title) { |
632 item.item.classList.toggle('hidden', !count); | 632 item.item.classList.toggle('hidden', !count); |
633 item.item.classList.toggle('counter-item-first', first); | 633 item.item.classList.toggle('counter-item-first', first); |
634 item.text.textContent = count; | 634 item.text.textContent = count; |
635 if (count) | 635 if (count) |
636 this._titles.push(title); | 636 this._titles.push(title); |
637 } | 637 } |
638 | 638 |
639 _update() { | 639 _update() { |
640 var errors = 0; | 640 var errors = SDK.multitargetConsoleModel.errors(); |
641 var warnings = 0; | 641 var warnings = SDK.multitargetConsoleModel.warnings(); |
642 var targets = SDK.targetManager.targets(); | |
643 for (var i = 0; i < targets.length; ++i) { | |
644 errors += targets[i].consoleModel.errors(); | |
645 warnings += targets[i].consoleModel.warnings(); | |
646 } | |
647 | 642 |
648 this._titles = []; | 643 this._titles = []; |
649 this._toolbarItem.setVisible(!!(errors || warnings)); | 644 this._toolbarItem.setVisible(!!(errors || warnings)); |
650 this._updateItem(this._errors, errors, false, Common.UIString(errors === 1 ?
'%d error' : '%d errors', errors)); | 645 this._updateItem(this._errors, errors, false, Common.UIString(errors === 1 ?
'%d error' : '%d errors', errors)); |
651 this._updateItem( | 646 this._updateItem( |
652 this._warnings, warnings, !errors, Common.UIString(warnings === 1 ? '%d
warning' : '%d warnings', warnings)); | 647 this._warnings, warnings, !errors, Common.UIString(warnings === 1 ? '%d
warning' : '%d warnings', warnings)); |
653 this._counter.title = this._titles.join(', '); | 648 this._counter.title = this._titles.join(', '); |
654 UI.inspectorView.toolbarItemResized(); | 649 UI.inspectorView.toolbarItemResized(); |
655 } | 650 } |
656 | 651 |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
957 * @override | 952 * @override |
958 * @return {?Element} | 953 * @return {?Element} |
959 */ | 954 */ |
960 settingElement() { | 955 settingElement() { |
961 return UI.SettingsUI.createSettingCheckbox( | 956 return UI.SettingsUI.createSettingCheckbox( |
962 Common.UIString('Show rulers'), Common.moduleSetting('showMetricsRulers'
)); | 957 Common.UIString('Show rulers'), Common.moduleSetting('showMetricsRulers'
)); |
963 } | 958 } |
964 }; | 959 }; |
965 | 960 |
966 new Main.Main(); | 961 new Main.Main(); |
OLD | NEW |