OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
680 handleAction: function() | 680 handleAction: function() |
681 { | 681 { |
682 WebInspector.settingsController.showSettingsScreen(WebInspector.Settings
Screen.Tabs.General); | 682 WebInspector.settingsController.showSettingsScreen(WebInspector.Settings
Screen.Tabs.General); |
683 return true; | 683 return true; |
684 } | 684 } |
685 } | 685 } |
686 | 686 |
687 /** | 687 /** |
688 * @constructor | 688 * @constructor |
689 * @extends {WebInspector.Object} | 689 * @extends {WebInspector.Object} |
| 690 * @param {!Array.<string>} columns |
690 * @param {function(!Element, string, ?string)} itemRenderer | 691 * @param {function(!Element, string, ?string)} itemRenderer |
691 */ | 692 */ |
692 WebInspector.SettingsList = function(columns, itemRenderer) | 693 WebInspector.SettingsList = function(columns, itemRenderer) |
693 { | 694 { |
694 this.element = document.createElement("div"); | 695 this.element = document.createElement("div"); |
695 this.element.classList.add("settings-list"); | 696 this.element.classList.add("settings-list"); |
696 this.element.tabIndex = -1; | 697 this.element.tabIndex = -1; |
697 this._itemRenderer = itemRenderer; | 698 this._itemRenderer = itemRenderer; |
698 this._listItems = {}; | 699 this._listItems = {}; |
699 this._ids = []; | 700 this._ids = []; |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
854 removeButton.addEventListener("click", handler, false); | 855 removeButton.addEventListener("click", handler, false); |
855 return removeButton; | 856 return removeButton; |
856 }, | 857 }, |
857 | 858 |
858 __proto__: WebInspector.Object.prototype | 859 __proto__: WebInspector.Object.prototype |
859 } | 860 } |
860 | 861 |
861 /** | 862 /** |
862 * @constructor | 863 * @constructor |
863 * @extends {WebInspector.SettingsList} | 864 * @extends {WebInspector.SettingsList} |
| 865 * @param {!Array.<string>} columns |
| 866 * @param {function(string, string):string} valuesProvider |
864 * @param {function(?string, !Object)} validateHandler | 867 * @param {function(?string, !Object)} validateHandler |
865 * @param {function(?string, !Object)} editHandler | 868 * @param {function(?string, !Object)} editHandler |
866 */ | 869 */ |
867 WebInspector.EditableSettingsList = function(columns, valuesProvider, validateHa
ndler, editHandler) | 870 WebInspector.EditableSettingsList = function(columns, valuesProvider, validateHa
ndler, editHandler) |
868 { | 871 { |
869 WebInspector.SettingsList.call(this, columns, this._renderColumn.bind(this))
; | 872 WebInspector.SettingsList.call(this, columns, this._renderColumn.bind(this))
; |
870 this._validateHandler = validateHandler; | 873 this._validateHandler = validateHandler; |
871 this._editHandler = editHandler; | 874 this._editHandler = editHandler; |
872 this._valuesProvider = valuesProvider; | 875 this._valuesProvider = valuesProvider; |
873 /** @type {!Object.<string, !HTMLInputElement>} */ | 876 /** @type {!Object.<string, !HTMLInputElement>} */ |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1013 if (oldValue !== newValue) { | 1016 if (oldValue !== newValue) { |
1014 hasChanges = true; | 1017 hasChanges = true; |
1015 break; | 1018 break; |
1016 } | 1019 } |
1017 } | 1020 } |
1018 return hasChanges; | 1021 return hasChanges; |
1019 }, | 1022 }, |
1020 | 1023 |
1021 /** | 1024 /** |
1022 * @param {string} itemId | 1025 * @param {string} itemId |
| 1026 * @param {!Event} event |
1023 */ | 1027 */ |
1024 _editMappingBlur: function(itemId, event) | 1028 _editMappingBlur: function(itemId, event) |
1025 { | 1029 { |
1026 var inputElements = Object.values(this._editInputElements[itemId]); | 1030 var inputElements = Object.values(this._editInputElements[itemId]); |
1027 if (inputElements.indexOf(event.relatedTarget) !== -1) | 1031 if (inputElements.indexOf(event.relatedTarget) !== -1) |
1028 return; | 1032 return; |
1029 | 1033 |
1030 var listItem = this.itemForId(itemId); | 1034 var listItem = this.itemForId(itemId); |
1031 listItem.classList.remove("item-editing"); | 1035 listItem.classList.remove("item-editing"); |
1032 delete this._editingId; | 1036 delete this._editingId; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1066 var inputElement = this._addInputElements[columnId]; | 1070 var inputElement = this._addInputElements[columnId]; |
1067 inputElement.value = ""; | 1071 inputElement.value = ""; |
1068 } | 1072 } |
1069 }, | 1073 }, |
1070 | 1074 |
1071 __proto__: WebInspector.SettingsList.prototype | 1075 __proto__: WebInspector.SettingsList.prototype |
1072 } | 1076 } |
1073 | 1077 |
1074 /** @type {!WebInspector.SettingsController} */ | 1078 /** @type {!WebInspector.SettingsController} */ |
1075 WebInspector.settingsController; | 1079 WebInspector.settingsController; |
OLD | NEW |