| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 3 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. |
| 4 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com). | 4 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com). |
| 5 * Copyright (C) 2009 Joseph Pecoraro | 5 * Copyright (C) 2009 Joseph Pecoraro |
| 6 * | 6 * |
| 7 * Redistribution and use in source and binary forms, with or without | 7 * Redistribution and use in source and binary forms, with or without |
| 8 * modification, are permitted provided that the following conditions | 8 * modification, are permitted provided that the following conditions |
| 9 * are met: | 9 * are met: |
| 10 * | 10 * |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 dispose: function() | 190 dispose: function() |
| 191 { | 191 { |
| 192 delete WebInspector._glassPane; | 192 delete WebInspector._glassPane; |
| 193 if (WebInspector.GlassPane.DefaultFocusedViewStack.length) | 193 if (WebInspector.GlassPane.DefaultFocusedViewStack.length) |
| 194 WebInspector.GlassPane.DefaultFocusedViewStack.peekLast().focus(); | 194 WebInspector.GlassPane.DefaultFocusedViewStack.peekLast().focus(); |
| 195 this.element.remove(); | 195 this.element.remove(); |
| 196 } | 196 } |
| 197 } | 197 } |
| 198 | 198 |
| 199 /** | 199 /** |
| 200 * @type {!Array.<!WebInspector.View|!WebInspector.Dialog>} | 200 * @type {!Array.<!WebInspector.Widget|!WebInspector.Dialog>} |
| 201 */ | 201 */ |
| 202 WebInspector.GlassPane.DefaultFocusedViewStack = []; | 202 WebInspector.GlassPane.DefaultFocusedViewStack = []; |
| 203 | 203 |
| 204 /** | 204 /** |
| 205 * @param {?Node=} node | 205 * @param {?Node=} node |
| 206 * @return {boolean} | 206 * @return {boolean} |
| 207 */ | 207 */ |
| 208 WebInspector.isBeingEdited = function(node) | 208 WebInspector.isBeingEdited = function(node) |
| 209 { | 209 { |
| 210 if (!node || node.nodeType !== Node.ELEMENT_NODE) | 210 if (!node || node.nodeType !== Node.ELEMENT_NODE) |
| (...skipping 1059 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1270 | 1270 |
| 1271 ;(function() { | 1271 ;(function() { |
| 1272 registerCustomElement("button", "text-button", { | 1272 registerCustomElement("button", "text-button", { |
| 1273 /** | 1273 /** |
| 1274 * @this {Element} | 1274 * @this {Element} |
| 1275 */ | 1275 */ |
| 1276 createdCallback: function() | 1276 createdCallback: function() |
| 1277 { | 1277 { |
| 1278 this.type = "button"; | 1278 this.type = "button"; |
| 1279 var root = this.createShadowRoot(); | 1279 var root = this.createShadowRoot(); |
| 1280 root.appendChild(WebInspector.View.createStyleElement("ui/textButton
.css")); | 1280 root.appendChild(WebInspector.Widget.createStyleElement("ui/textButt
on.css")); |
| 1281 root.createChild("content"); | 1281 root.createChild("content"); |
| 1282 }, | 1282 }, |
| 1283 | 1283 |
| 1284 __proto__: HTMLButtonElement.prototype | 1284 __proto__: HTMLButtonElement.prototype |
| 1285 }); | 1285 }); |
| 1286 | 1286 |
| 1287 registerCustomElement("label", "dt-radio", { | 1287 registerCustomElement("label", "dt-radio", { |
| 1288 /** | 1288 /** |
| 1289 * @this {Element} | 1289 * @this {Element} |
| 1290 */ | 1290 */ |
| 1291 createdCallback: function() | 1291 createdCallback: function() |
| 1292 { | 1292 { |
| 1293 this.radioElement = this.createChild("input", "dt-radio-button"); | 1293 this.radioElement = this.createChild("input", "dt-radio-button"); |
| 1294 this.radioElement.type = "radio"; | 1294 this.radioElement.type = "radio"; |
| 1295 | 1295 |
| 1296 var root = this.createShadowRoot(); | 1296 var root = this.createShadowRoot(); |
| 1297 root.appendChild(WebInspector.View.createStyleElement("ui/radioButto
n.css")); | 1297 root.appendChild(WebInspector.Widget.createStyleElement("ui/radioBut
ton.css")); |
| 1298 root.createChild("content").select = ".dt-radio-button"; | 1298 root.createChild("content").select = ".dt-radio-button"; |
| 1299 root.createChild("content"); | 1299 root.createChild("content"); |
| 1300 this.addEventListener("click", radioClickHandler, false); | 1300 this.addEventListener("click", radioClickHandler, false); |
| 1301 }, | 1301 }, |
| 1302 | 1302 |
| 1303 __proto__: HTMLLabelElement.prototype | 1303 __proto__: HTMLLabelElement.prototype |
| 1304 }); | 1304 }); |
| 1305 | 1305 |
| 1306 /** | 1306 /** |
| 1307 * @param {!Event} event | 1307 * @param {!Event} event |
| 1308 * @suppressReceiverCheck | 1308 * @suppressReceiverCheck |
| 1309 * @this {Element} | 1309 * @this {Element} |
| 1310 */ | 1310 */ |
| 1311 function radioClickHandler(event) | 1311 function radioClickHandler(event) |
| 1312 { | 1312 { |
| 1313 if (this.radioElement.checked || this.radioElement.disabled) | 1313 if (this.radioElement.checked || this.radioElement.disabled) |
| 1314 return; | 1314 return; |
| 1315 this.radioElement.checked = true; | 1315 this.radioElement.checked = true; |
| 1316 this.radioElement.dispatchEvent(new Event("change")); | 1316 this.radioElement.dispatchEvent(new Event("change")); |
| 1317 } | 1317 } |
| 1318 | 1318 |
| 1319 registerCustomElement("label", "dt-checkbox", { | 1319 registerCustomElement("label", "dt-checkbox", { |
| 1320 /** | 1320 /** |
| 1321 * @this {Element} | 1321 * @this {Element} |
| 1322 */ | 1322 */ |
| 1323 createdCallback: function() | 1323 createdCallback: function() |
| 1324 { | 1324 { |
| 1325 var root = this.createShadowRoot(); | 1325 var root = this.createShadowRoot(); |
| 1326 root.appendChild(WebInspector.View.createStyleElement("ui/checkboxTe
xtLabel.css")); | 1326 root.appendChild(WebInspector.Widget.createStyleElement("ui/checkbox
TextLabel.css")); |
| 1327 this.checkboxElement = this.createChild("input", "dt-checkbox-button
"); | 1327 this.checkboxElement = this.createChild("input", "dt-checkbox-button
"); |
| 1328 this.checkboxElement.type = "checkbox"; | 1328 this.checkboxElement.type = "checkbox"; |
| 1329 root.createChild("content").select = ".dt-checkbox-button"; | 1329 root.createChild("content").select = ".dt-checkbox-button"; |
| 1330 root.createChild("content"); | 1330 root.createChild("content"); |
| 1331 }, | 1331 }, |
| 1332 | 1332 |
| 1333 __proto__: HTMLLabelElement.prototype | 1333 __proto__: HTMLLabelElement.prototype |
| 1334 }); | 1334 }); |
| 1335 | 1335 |
| 1336 registerCustomElement("label", "dt-icon-label", { | 1336 registerCustomElement("label", "dt-icon-label", { |
| 1337 /** | 1337 /** |
| 1338 * @this {Element} | 1338 * @this {Element} |
| 1339 */ | 1339 */ |
| 1340 createdCallback: function() | 1340 createdCallback: function() |
| 1341 { | 1341 { |
| 1342 var root = this.createShadowRoot(); | 1342 var root = this.createShadowRoot(); |
| 1343 root.appendChild(WebInspector.View.createStyleElement("ui/smallIcon.
css")); | 1343 root.appendChild(WebInspector.Widget.createStyleElement("ui/smallIco
n.css")); |
| 1344 this._iconElement = root.createChild("div"); | 1344 this._iconElement = root.createChild("div"); |
| 1345 root.createChild("content"); | 1345 root.createChild("content"); |
| 1346 }, | 1346 }, |
| 1347 | 1347 |
| 1348 /** | 1348 /** |
| 1349 * @param {string} type | 1349 * @param {string} type |
| 1350 * @this {Element} | 1350 * @this {Element} |
| 1351 */ | 1351 */ |
| 1352 set type(type) | 1352 set type(type) |
| 1353 { | 1353 { |
| 1354 this._iconElement.className = type; | 1354 this._iconElement.className = type; |
| 1355 }, | 1355 }, |
| 1356 | 1356 |
| 1357 __proto__: HTMLLabelElement.prototype | 1357 __proto__: HTMLLabelElement.prototype |
| 1358 }); | 1358 }); |
| 1359 | 1359 |
| 1360 registerCustomElement("div", "dt-close-button", { | 1360 registerCustomElement("div", "dt-close-button", { |
| 1361 /** | 1361 /** |
| 1362 * @this {Element} | 1362 * @this {Element} |
| 1363 */ | 1363 */ |
| 1364 createdCallback: function() | 1364 createdCallback: function() |
| 1365 { | 1365 { |
| 1366 var root = this.createShadowRoot(); | 1366 var root = this.createShadowRoot(); |
| 1367 root.appendChild(WebInspector.View.createStyleElement("ui/closeButto
n.css")); | 1367 root.appendChild(WebInspector.Widget.createStyleElement("ui/closeBut
ton.css")); |
| 1368 this._buttonElement = root.createChild("div", "close-button"); | 1368 this._buttonElement = root.createChild("div", "close-button"); |
| 1369 }, | 1369 }, |
| 1370 | 1370 |
| 1371 /** | 1371 /** |
| 1372 * @param {boolean} gray | 1372 * @param {boolean} gray |
| 1373 * @this {Element} | 1373 * @this {Element} |
| 1374 */ | 1374 */ |
| 1375 set gray(gray) | 1375 set gray(gray) |
| 1376 { | 1376 { |
| 1377 this._buttonElement.className = gray ? "close-button-gray" : "close-
button"; | 1377 this._buttonElement.className = gray ? "close-button-gray" : "close-
button"; |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1427 // Due to the nature of regex, |items| array has matched elements on its
even indexes. | 1427 // Due to the nature of regex, |items| array has matched elements on its
even indexes. |
| 1428 var items = text.replace(regex, "\0$1\0").split("\0"); | 1428 var items = text.replace(regex, "\0$1\0").split("\0"); |
| 1429 for (var i = 0; i < items.length; ++i) { | 1429 for (var i = 0; i < items.length; ++i) { |
| 1430 var processedNode = i % 2 ? processor(items[i]) : this._runProcessor
(processorIndex + 1, items[i]); | 1430 var processedNode = i % 2 ? processor(items[i]) : this._runProcessor
(processorIndex + 1, items[i]); |
| 1431 container.appendChild(processedNode); | 1431 container.appendChild(processedNode); |
| 1432 } | 1432 } |
| 1433 | 1433 |
| 1434 return container; | 1434 return container; |
| 1435 } | 1435 } |
| 1436 } | 1436 } |
| OLD | NEW |