OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * | 10 * |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 this.folderPathComponents = path.substring(0, lastSlashIndex); | 83 this.folderPathComponents = path.substring(0, lastSlashIndex); |
84 this.lastPathComponent = path.substring(lastSlashIndex + 1); | 84 this.lastPathComponent = path.substring(lastSlashIndex + 1); |
85 } else | 85 } else |
86 this.lastPathComponent = path; | 86 this.lastPathComponent = path; |
87 } | 87 } |
88 | 88 |
89 /** | 89 /** |
90 * @param {string} url | 90 * @param {string} url |
91 * @return {!Array.<string>} | 91 * @return {!Array.<string>} |
92 */ | 92 */ |
93 WebInspector.ParsedURL.splitURL = function(url) | 93 WebInspector.ParsedURL.splitURLIntoPathComponents = function(url) |
94 { | 94 { |
95 var parsedURL = new WebInspector.ParsedURL(url); | 95 var parsedURL = new WebInspector.ParsedURL(decodeURI(url)); |
96 var origin; | 96 var origin; |
97 var folderPath; | 97 var folderPath; |
98 var name; | 98 var name; |
99 if (parsedURL.isValid) { | 99 if (parsedURL.isValid) { |
100 origin = parsedURL.scheme + "://" + parsedURL.host; | 100 origin = parsedURL.scheme + "://" + parsedURL.host; |
101 if (parsedURL.port) | 101 if (parsedURL.port) |
102 origin += ":" + parsedURL.port; | 102 origin += ":" + parsedURL.port; |
103 folderPath = parsedURL.folderPathComponents; | 103 folderPath = parsedURL.folderPathComponents; |
104 name = parsedURL.lastPathComponent; | 104 name = parsedURL.lastPathComponent; |
105 if (parsedURL.queryParams) | 105 if (parsedURL.queryParams) |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 /** | 238 /** |
239 * @return {?WebInspector.ParsedURL} | 239 * @return {?WebInspector.ParsedURL} |
240 */ | 240 */ |
241 String.prototype.asParsedURL = function() | 241 String.prototype.asParsedURL = function() |
242 { | 242 { |
243 var parsedURL = new WebInspector.ParsedURL(this.toString()); | 243 var parsedURL = new WebInspector.ParsedURL(this.toString()); |
244 if (parsedURL.isValid) | 244 if (parsedURL.isValid) |
245 return parsedURL; | 245 return parsedURL; |
246 return null; | 246 return null; |
247 } | 247 } |
OLD | NEW |