| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 */ | 86 */ |
| 87 static _contentTypeForExtension(extension) { | 87 static _contentTypeForExtension(extension) { |
| 88 if (Persistence.FileSystemWorkspaceBinding._styleSheetExtensions.has(extensi
on)) | 88 if (Persistence.FileSystemWorkspaceBinding._styleSheetExtensions.has(extensi
on)) |
| 89 return Common.resourceTypes.Stylesheet; | 89 return Common.resourceTypes.Stylesheet; |
| 90 if (Persistence.FileSystemWorkspaceBinding._documentExtensions.has(extension
)) | 90 if (Persistence.FileSystemWorkspaceBinding._documentExtensions.has(extension
)) |
| 91 return Common.resourceTypes.Document; | 91 return Common.resourceTypes.Document; |
| 92 if (Persistence.FileSystemWorkspaceBinding._imageExtensions.has(extension)) | 92 if (Persistence.FileSystemWorkspaceBinding._imageExtensions.has(extension)) |
| 93 return Common.resourceTypes.Image; | 93 return Common.resourceTypes.Image; |
| 94 if (Persistence.FileSystemWorkspaceBinding._scriptExtensions.has(extension)) | 94 if (Persistence.FileSystemWorkspaceBinding._scriptExtensions.has(extension)) |
| 95 return Common.resourceTypes.Script; | 95 return Common.resourceTypes.Script; |
| 96 return Common.resourceTypes.Other; | 96 return Persistence.FileSystemWorkspaceBinding._binaryExtensions.has(extensio
n) ? Common.resourceTypes.Other : |
| 97
Common.resourceTypes.Document; |
| 97 } | 98 } |
| 98 | 99 |
| 99 /** | 100 /** |
| 100 * @param {string} projectId | 101 * @param {string} projectId |
| 101 * @return {string} | 102 * @return {string} |
| 102 */ | 103 */ |
| 103 static fileSystemPath(projectId) { | 104 static fileSystemPath(projectId) { |
| 104 return projectId; | 105 return projectId; |
| 105 } | 106 } |
| 106 | 107 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 | 171 |
| 171 Persistence.FileSystemWorkspaceBinding._styleSheetExtensions = new Set(['css', '
scss', 'sass', 'less']); | 172 Persistence.FileSystemWorkspaceBinding._styleSheetExtensions = new Set(['css', '
scss', 'sass', 'less']); |
| 172 Persistence.FileSystemWorkspaceBinding._documentExtensions = new Set(['htm', 'ht
ml', 'asp', 'aspx', 'phtml', 'jsp']); | 173 Persistence.FileSystemWorkspaceBinding._documentExtensions = new Set(['htm', 'ht
ml', 'asp', 'aspx', 'phtml', 'jsp']); |
| 173 Persistence.FileSystemWorkspaceBinding._scriptExtensions = new Set([ | 174 Persistence.FileSystemWorkspaceBinding._scriptExtensions = new Set([ |
| 174 'asp', 'aspx', 'c', 'cc', 'cljs', 'coffee', 'cpp', 'cs', 'dart', 'java', 'js', | 175 'asp', 'aspx', 'c', 'cc', 'cljs', 'coffee', 'cpp', 'cs', 'dart', 'java', 'js', |
| 175 'jsp', 'jsx', 'h', 'm', 'mm', 'py', 'sh', 'ts', 'tsx', 'ls' | 176 'jsp', 'jsx', 'h', 'm', 'mm', 'py', 'sh', 'ts', 'tsx', 'ls' |
| 176 ]); | 177 ]); |
| 177 | 178 |
| 178 Persistence.FileSystemWorkspaceBinding._imageExtensions = Workspace.IsolatedFile
System.ImageExtensions; | 179 Persistence.FileSystemWorkspaceBinding._imageExtensions = Workspace.IsolatedFile
System.ImageExtensions; |
| 179 | 180 |
| 181 Persistence.FileSystemWorkspaceBinding._binaryExtensions = new Set([ |
| 182 // Executable extensions, roughly taken from https://en.wikipedia.org/wiki/Com
parison_of_executable_file_formats |
| 183 'cmd', 'com', 'exe', |
| 184 // Archive extensions, roughly taken from https://en.wikipedia.org/wiki/List_o
f_archive_formats |
| 185 'a', 'ar', 'iso', 'tar', 'bz2', 'gz', 'lz', 'lzma', 'z', '7z', 'apk', 'arc', '
cab', 'dmg', 'jar', 'pak', 'rar', 'zip', |
| 186 // Audio file extensions, roughly taken from https://en.wikipedia.org/wiki/Aud
io_file_format#List_of_formats |
| 187 '3gp', 'aac', 'aiff', 'flac', 'm4a', 'mmf', 'mp3', 'ogg', 'oga', 'raw', 'sln',
'wav', 'wma', 'webm', |
| 188 // Video file extensions, roughly taken from https://en.wikipedia.org/wiki/Vid
eo_file_format |
| 189 'mkv', 'flv', 'vob', 'ogv', 'gif', 'gifv', 'avi', 'mov', 'qt', 'mp4', 'm4p', '
m4v', 'mpg', 'mpeg' |
| 190 ]); |
| 191 |
| 180 | 192 |
| 181 /** | 193 /** |
| 182 * @implements {Workspace.Project} | 194 * @implements {Workspace.Project} |
| 183 * @unrestricted | 195 * @unrestricted |
| 184 */ | 196 */ |
| 185 Persistence.FileSystemWorkspaceBinding.FileSystem = class extends Workspace.Proj
ectStore { | 197 Persistence.FileSystemWorkspaceBinding.FileSystem = class extends Workspace.Proj
ectStore { |
| 186 /** | 198 /** |
| 187 * @param {!Persistence.FileSystemWorkspaceBinding} fileSystemWorkspaceBinding | 199 * @param {!Persistence.FileSystemWorkspaceBinding} fileSystemWorkspaceBinding |
| 188 * @param {!Workspace.IsolatedFileSystem} isolatedFileSystem | 200 * @param {!Workspace.IsolatedFileSystem} isolatedFileSystem |
| 189 * @param {!Workspace.Workspace} workspace | 201 * @param {!Workspace.Workspace} workspace |
| (...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 559 uiSourceCode[Persistence.FileSystemWorkspaceBinding._metadata] = null; | 571 uiSourceCode[Persistence.FileSystemWorkspaceBinding._metadata] = null; |
| 560 uiSourceCode.checkContentUpdated(); | 572 uiSourceCode.checkContentUpdated(); |
| 561 } | 573 } |
| 562 | 574 |
| 563 dispose() { | 575 dispose() { |
| 564 this.removeProject(); | 576 this.removeProject(); |
| 565 } | 577 } |
| 566 }; | 578 }; |
| 567 | 579 |
| 568 Persistence.FileSystemWorkspaceBinding._metadata = Symbol('FileSystemWorkspaceBi
nding.Metadata'); | 580 Persistence.FileSystemWorkspaceBinding._metadata = Symbol('FileSystemWorkspaceBi
nding.Metadata'); |
| OLD | NEW |