OLD | NEW |
1 #import ("dart:html"); | 1 #import ("dart:html"); |
2 #import ("dart:json"); | 2 #import ("dart:json"); |
3 | 3 |
4 // Workaround for HTML lib missing feature. | 4 // Workaround for HTML lib missing feature. |
5 Range newRange() { | 5 Range newRange() { |
6 return document.createRange(); | 6 return document.createRange(); |
7 } | 7 } |
8 | 8 |
9 // Temporary range object to optimize performance computing client rects | 9 // Temporary range object to optimize performance computing client rects |
10 // from text nodes. | 10 // from text nodes. |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 "NavigatorUserMediaErrorCallback", "PositionCallback", | 222 "NavigatorUserMediaErrorCallback", "PositionCallback", |
223 "PositionErrorCallback", "SQLStatementCallback", | 223 "PositionErrorCallback", "SQLStatementCallback", |
224 "SQLStatementErrorCallback", "SQLTransactionCallback", | 224 "SQLStatementErrorCallback", "SQLTransactionCallback", |
225 "SQLTransactionErrorCallback", "SQLTransactionSyncCallback", | 225 "SQLTransactionErrorCallback", "SQLTransactionSyncCallback", |
226 "StorageInfoErrorCallback", "StorageInfoQuotaCallback", | 226 "StorageInfoErrorCallback", "StorageInfoQuotaCallback", |
227 "StorageInfoUsageCallback", "StringCallback" | 227 "StorageInfoUsageCallback", "StringCallback" |
228 ]; | 228 ]; |
229 | 229 |
230 Map dbEntry; | 230 Map dbEntry; |
231 | 231 |
232 Map get dartIdl() => data['dartIdl']; | 232 Map get dartIdl => data['dartIdl']; |
233 String get currentType() => data['type']; | 233 String get currentType => data['type']; |
234 | 234 |
235 String _currentTypeShort; | 235 String _currentTypeShort; |
236 String get currentTypeShort() { | 236 String get currentTypeShort { |
237 if (_currentTypeShort == null) { | 237 if (_currentTypeShort == null) { |
238 _currentTypeShort = currentType; | 238 _currentTypeShort = currentType; |
239 _currentTypeShort = trimPrefix(_currentTypeShort, "HTML"); | 239 _currentTypeShort = trimPrefix(_currentTypeShort, "HTML"); |
240 _currentTypeShort = trimPrefix(_currentTypeShort, "SVG"); | 240 _currentTypeShort = trimPrefix(_currentTypeShort, "SVG"); |
241 _currentTypeShort = trimPrefix(_currentTypeShort, "DOM"); | 241 _currentTypeShort = trimPrefix(_currentTypeShort, "DOM"); |
242 _currentTypeShort = trimPrefix(_currentTypeShort, "WebKit"); | 242 _currentTypeShort = trimPrefix(_currentTypeShort, "WebKit"); |
243 _currentTypeShort = trimPrefix(_currentTypeShort, "Webkit"); | 243 _currentTypeShort = trimPrefix(_currentTypeShort, "Webkit"); |
244 } | 244 } |
245 return _currentTypeShort; | 245 return _currentTypeShort; |
246 } | 246 } |
247 | 247 |
248 String _currentTypeTiny; | 248 String _currentTypeTiny; |
249 String get currentTypeTiny() { | 249 String get currentTypeTiny { |
250 if (_currentTypeTiny == null) { | 250 if (_currentTypeTiny == null) { |
251 _currentTypeTiny = currentTypeShort; | 251 _currentTypeTiny = currentTypeShort; |
252 _currentTypeTiny = trimEnd(_currentTypeTiny, "Element"); | 252 _currentTypeTiny = trimEnd(_currentTypeTiny, "Element"); |
253 } | 253 } |
254 return _currentTypeTiny; | 254 return _currentTypeTiny; |
255 } | 255 } |
256 | 256 |
257 Map get searchResult() => data['searchResult']; | 257 Map get searchResult => data['searchResult']; |
258 String get pageUrl() => searchResult['link']; | 258 String get pageUrl => searchResult['link']; |
259 | 259 |
260 String _pageDomain; | 260 String _pageDomain; |
261 String get pageDomain() { | 261 String get pageDomain { |
262 if (_pageDomain == null) { | 262 if (_pageDomain == null) { |
263 _pageDomain = pageUrl.substring(0, pageUrl.indexOf("/", "https://".length)); | 263 _pageDomain = pageUrl.substring(0, pageUrl.indexOf("/", "https://".length)); |
264 } | 264 } |
265 return _pageDomain; | 265 return _pageDomain; |
266 } | 266 } |
267 | 267 |
268 String get pageDir() { | 268 String get pageDir { |
269 return pageUrl.substring(0, pageUrl.lastIndexOf('/') + 1); | 269 return pageUrl.substring(0, pageUrl.lastIndexOf('/') + 1); |
270 } | 270 } |
271 | 271 |
272 String getAbsoluteUrl(AnchorElement anchor) { | 272 String getAbsoluteUrl(AnchorElement anchor) { |
273 if (anchor == null || anchor.href.length == 0) return ''; | 273 if (anchor == null || anchor.href.length == 0) return ''; |
274 String path = anchor.href; | 274 String path = anchor.href; |
275 RegExp fullUrlRegExp = new RegExp("^https?://"); | 275 RegExp fullUrlRegExp = new RegExp("^https?://"); |
276 if (fullUrlRegExp.hasMatch(path)) return path; | 276 if (fullUrlRegExp.hasMatch(path)) return path; |
277 if (path.startsWith('/')) { | 277 if (path.startsWith('/')) { |
278 return "$pageDomain$path"; | 278 return "$pageDomain$path"; |
(...skipping 1026 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1305 } | 1305 } |
1306 | 1306 |
1307 void documentLoaded(event) { | 1307 void documentLoaded(event) { |
1308 // Load the database of expected methods and properties with an HttpRequest. | 1308 // Load the database of expected methods and properties with an HttpRequest. |
1309 new HttpRequest.get('${window.location}.json', (req) { | 1309 new HttpRequest.get('${window.location}.json', (req) { |
1310 data = JSON.parse(req.responseText); | 1310 data = JSON.parse(req.responseText); |
1311 dbEntry = {'members': [], 'srcUrl': pageUrl}; | 1311 dbEntry = {'members': [], 'srcUrl': pageUrl}; |
1312 run(); | 1312 run(); |
1313 }); | 1313 }); |
1314 } | 1314 } |
OLD | NEW |