diff --git a/src/main.js b/src/main.js index 905ee45e51d..0998ee92d54 100644 --- a/src/main.js +++ b/src/main.js @@ -36,7 +36,17 @@ require.config({ // The file system implementation. Change this value to use different // implementations (e.g. cloud-based storage). - "fileSystemImpl" : "filesystem/impls/appshell/AppshellFileSystem" + "fileSystemImpl" : "filesystem/impls/appshell/AppshellFileSystem", + + // The application shell implementation. Brackets-shell provides an + // instance of brackets.app, it will be used and the default value + // points to a void implementation. However, when running Brackets in a + // different environment, use this to load your implementation. For the + // definition of the interface, see appshell.app namespace at + // https://github.com/adobe/brackets-shell/blob/master/appshell/appshell_extensions.js + // Change this value to load custom implementation to run brackets in + // something else than Brackets shell (e.g. in a browser). + "appShellImpl" : "shellImpl/InBrowserShell" } }); diff --git a/src/shellImpl/InBrowserShell.js b/src/shellImpl/InBrowserShell.js new file mode 100644 index 00000000000..b1f8054f3f9 --- /dev/null +++ b/src/shellImpl/InBrowserShell.js @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2014 Adobe Systems Incorporated. All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + */ + +/*jslint vars: true, plusplus: true, devel: true, nomen: true, indent: 4, maxerr: 50 */ +/*global define */ +define(function (require, exports, module) { + "use strict"; + + // this implementation is intentionally left empty + // see src/main.js for details + +}); diff --git a/src/utils/Global.js b/src/utils/Global.js index 550c9d4b412..95ee1dbb199 100644 --- a/src/utils/Global.js +++ b/src/utils/Global.js @@ -108,7 +108,7 @@ define(function (require, exports, module) { // Create empty app namespace if running in-browser if (!global.brackets.app) { - global.brackets.app = {}; + global.brackets.app = require("appShellImpl"); } // Loading extensions requires creating new require.js contexts, which