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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 if (url.startsWith(baseURL)) | 79 if (url.startsWith(baseURL)) |
80 return url.substring(index); | 80 return url.substring(index); |
81 } | 81 } |
82 | 82 |
83 if (!parsedURL) | 83 if (!parsedURL) |
84 return url; | 84 return url; |
85 | 85 |
86 var displayName = url.trimURL(parsedURL.host); | 86 var displayName = url.trimURL(parsedURL.host); |
87 return displayName === '/' ? parsedURL.host + '/' : displayName; | 87 return displayName === '/' ? parsedURL.host + '/' : displayName; |
88 }; | 88 }; |
| 89 |
| 90 /** |
| 91 * @param {?SDK.Resource} resource |
| 92 * @return {?Workspace.UISourceCodeMetadata} |
| 93 */ |
| 94 Bindings.resourceMetadata = function(resource) { |
| 95 if (!resource || (typeof resource.contentSize() !== 'number' && !resource.last
Modified())) |
| 96 return null; |
| 97 return new Workspace.UISourceCodeMetadata(resource.lastModified(), resource.co
ntentSize()); |
| 98 }; |
OLD | NEW |