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 1161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1172 return this.property.parsedOk; | 1172 return this.property.parsedOk; |
1173 }, | 1173 }, |
1174 | 1174 |
1175 onattach: function() | 1175 onattach: function() |
1176 { | 1176 { |
1177 this.updateTitle(); | 1177 this.updateTitle(); |
1178 }, | 1178 }, |
1179 | 1179 |
1180 updateTitle: function() | 1180 updateTitle: function() |
1181 { | 1181 { |
1182 var priority = this.priority; | |
1183 var value = this.value; | 1182 var value = this.value; |
1184 | 1183 |
1185 if (priority && !priority.length) | |
1186 delete priority; | |
1187 if (priority) | |
1188 priority = "!" + priority; | |
1189 | |
1190 this.updateState(); | 1184 this.updateState(); |
1191 | 1185 |
1192 var enabledCheckboxElement; | 1186 var enabledCheckboxElement; |
1193 if (this.parsedOk) { | 1187 if (this.parsedOk) { |
1194 enabledCheckboxElement = document.createElement("input"); | 1188 enabledCheckboxElement = document.createElement("input"); |
1195 enabledCheckboxElement.className = "enabled-button"; | 1189 enabledCheckboxElement.className = "enabled-button"; |
1196 enabledCheckboxElement.type = "checkbox"; | 1190 enabledCheckboxElement.type = "checkbox"; |
1197 enabledCheckboxElement.checked = !this.disabled; | 1191 enabledCheckboxElement.checked = !this.disabled; |
1198 enabledCheckboxElement.addEventListener("change", this.toggleEnabled
.bind(this), false); | 1192 enabledCheckboxElement.addEventListener("change", this.toggleEnabled
.bind(this), false); |
1199 } | 1193 } |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1332 container.appendChild(colorValueElement); | 1326 container.appendChild(colorValueElement); |
1333 return container; | 1327 return container; |
1334 } | 1328 } |
1335 | 1329 |
1336 var colorRegex = /((?:rgb|hsl)a?\([^)]+\)|#[0-9a-fA-F]{6}|#[0-9a-fA-
F]{3}|\b\w+\b(?!-))/g; | 1330 var colorRegex = /((?:rgb|hsl)a?\([^)]+\)|#[0-9a-fA-F]{6}|#[0-9a-fA-
F]{3}|\b\w+\b(?!-))/g; |
1337 var colorProcessor = processValue.bind(window, colorRegex, processCo
lor, null); | 1331 var colorProcessor = processValue.bind(window, colorRegex, processCo
lor, null); |
1338 | 1332 |
1339 valueElement.appendChild(processValue(/url\(([^)]+)\)/g, linkifyURL,
colorProcessor, value)); | 1333 valueElement.appendChild(processValue(/url\(([^)]+)\)/g, linkifyURL,
colorProcessor, value)); |
1340 } | 1334 } |
1341 | 1335 |
1342 if (priority) { | |
1343 var priorityElement = document.createElement("span"); | |
1344 priorityElement.className = "priority"; | |
1345 priorityElement.textContent = priority; | |
1346 } | |
1347 | |
1348 this.listItemElement.removeChildren(); | 1336 this.listItemElement.removeChildren(); |
1349 | 1337 |
1350 if (!this.treeOutline) | 1338 if (!this.treeOutline) |
1351 return; | 1339 return; |
1352 | 1340 |
1353 // Append the checkbox for root elements of an editable section. | 1341 // Append the checkbox for root elements of an editable section. |
1354 if (enabledCheckboxElement && this.treeOutline.section && this.treeOutli
ne.section.editable && this.parent.root) | 1342 if (enabledCheckboxElement && this.treeOutline.section && this.treeOutli
ne.section.editable && this.parent.root) |
1355 this.listItemElement.appendChild(enabledCheckboxElement); | 1343 this.listItemElement.appendChild(enabledCheckboxElement); |
1356 this.listItemElement.appendChild(nameElement); | 1344 this.listItemElement.appendChild(nameElement); |
1357 this.listItemElement.appendChild(document.createTextNode(": ")); | 1345 this.listItemElement.appendChild(document.createTextNode(": ")); |
1358 this.listItemElement.appendChild(valueElement); | 1346 this.listItemElement.appendChild(valueElement); |
1359 | |
1360 if (priorityElement) { | |
1361 this.listItemElement.appendChild(document.createTextNode(" ")); | |
1362 this.listItemElement.appendChild(priorityElement); | |
1363 } | |
1364 | |
1365 this.listItemElement.appendChild(document.createTextNode(";")); | 1347 this.listItemElement.appendChild(document.createTextNode(";")); |
1366 | 1348 |
1367 if (!this.parsedOk) | 1349 if (!this.parsedOk) |
1368 this.listItemElement.addStyleClass("not-parsed-ok"); | 1350 this.listItemElement.addStyleClass("not-parsed-ok"); |
1369 if (this.property.inactive) | 1351 if (this.property.inactive) |
1370 this.listItemElement.addStyleClass("inactive"); | 1352 this.listItemElement.addStyleClass("inactive"); |
1371 | 1353 |
1372 this.tooltip = this.property.propertyText; | 1354 this.tooltip = this.property.propertyText; |
1373 }, | 1355 }, |
1374 | 1356 |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1783 | 1765 |
1784 // Append a ";" if the new text does not end in ";". | 1766 // Append a ";" if the new text does not end in ";". |
1785 // FIXME: this does not handle trailing comments. | 1767 // FIXME: this does not handle trailing comments. |
1786 if (styleText.length && !/;\s*$/.test(styleText)) | 1768 if (styleText.length && !/;\s*$/.test(styleText)) |
1787 styleText += ";"; | 1769 styleText += ";"; |
1788 this.property.setText(styleText, updateInterface, callback.bind(this)); | 1770 this.property.setText(styleText, updateInterface, callback.bind(this)); |
1789 } | 1771 } |
1790 } | 1772 } |
1791 | 1773 |
1792 WebInspector.StylePropertyTreeElement.prototype.__proto__ = TreeElement.prototyp
e; | 1774 WebInspector.StylePropertyTreeElement.prototype.__proto__ = TreeElement.prototyp
e; |
OLD | NEW |