Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Commit 7f5f064

Browse files
author
Nitesh Kumar
committed
few corrections in naming conventions
1 parent 0420ac1 commit 7f5f064

File tree

8 files changed

+30
-28
lines changed

8 files changed

+30
-28
lines changed

src/extensions/default/OpenWithExternalEditor/main.js renamed to src/extensions/default/OpenWithExternalApplication/main.js

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,34 +37,36 @@ define(function (require, exports, module) {
3737
* @private
3838
* @type {string} fullPath of the OpenWithExternalEditor Domain implementation
3939
*/
40-
var _domainPath = ExtensionUtils.getModulePath(module, "node/OpenWithExternalEditorDomain");
40+
var _domainPath = ExtensionUtils.getModulePath(module, "node/OpenWithExternalApplicationDomain");
4141

4242
/**
4343
* @private
4444
* @type {NodeDomain}
4545
*/
46-
var _nodeDomain = new NodeDomain("OpenWithExternalEditor", _domainPath);
46+
var _nodeDomain = new NodeDomain("OpenWithExternalApplication", _domainPath);
4747

48-
var extensionToExternalEditorMap = {};
48+
var extensionToExtApplicationMap = {};
4949

50-
function _openInExternalEdior(event, path) {
50+
function _openWithExternalApplication(event, path) {
5151
_nodeDomain.exec("open", {
5252
path: path,
53-
app: extensionToExternalEditorMap[FileUtils.getFileExtension(path).toLowerCase()]
53+
app: extensionToExtApplicationMap[FileUtils.getFileExtension(path).toLowerCase()]
5454
});
5555
}
5656

57-
PreferencesManager.definePreference("externalEditor", "object", {}, {
58-
description: Strings.DESCRIPTION_EXTERNAL_EDITOR
57+
PreferencesManager.definePreference("externalApplications", "object", {}, {
58+
description: Strings.DESCRIPTION_EXTERNAL_APPLICATION_ASSOCIATE
5959
});
6060

61-
PreferencesManager.on("change", "externalEditor", function () {
62-
extensionToExternalEditorMap = PreferencesManager.get("externalEditor");
61+
PreferencesManager.on("change", "externalApplications", function () {
62+
extensionToExtApplicationMap = PreferencesManager.get("externalApplications");
63+
FileUtils.addExtensionToExternalAppList(Object.keys(extensionToExtApplicationMap));
6364
});
6465

65-
FileViewController.on("openInExternalEditor", _openInExternalEdior);
66+
FileViewController.on("openWithExternalApplication", _openWithExternalApplication);
6667

6768
AppInit.appReady(function () {
68-
FileUtils.addExtensionToExternalAppList(Object.keys(extensionToExternalEditorMap));
69+
extensionToExtApplicationMap = PreferencesManager.get("externalApplications");
70+
FileUtils.addExtensionToExternalAppList(Object.keys(extensionToExtApplicationMap));
6971
});
7072
});

src/extensions/default/OpenWithExternalEditor/node/OpenWithExternalEditorDomain.js renamed to src/extensions/default/OpenWithExternalApplication/node/OpenWithExternalApplicationDomain.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ var _domainManager;
3434
*
3535
* @param {Object} params Object to use
3636
*/
37-
function _OpenWithExternalEditor(params) {
37+
function _openWithExternalApplication(params) {
3838
var application = "default" === params.app ? "": params.app;
3939
open(params.path, application);
4040
}
@@ -47,15 +47,15 @@ function _OpenWithExternalEditor(params) {
4747
function init(domainManager) {
4848
_domainManager = domainManager;
4949

50-
if (!domainManager.hasDomain("OpenWithExternalEditor")) {
51-
domainManager.registerDomain("OpenWithExternalEditor", {major: 0, minor: 1});
50+
if (!domainManager.hasDomain("OpenWithExternalApplication")) {
51+
domainManager.registerDomain("OpenWithExternalApplication", {major: 0, minor: 1});
5252
}
5353
_domainManager.registerCommand(
54-
"OpenWithExternalEditor",
54+
"OpenWithExternalApplication",
5555
"open",
56-
_OpenWithExternalEditor,
56+
_openWithExternalApplication,
5757
true,
58-
"open document with External Editor.",
58+
"open document with External Application.",
5959
[{
6060
name: "params",
6161
type: "object",

src/extensions/default/OpenWithExternalEditor/node/package.json renamed to src/extensions/default/OpenWithExternalApplication/node/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "brackets-open-external_editor",
2+
"name": "brackets-open-external_application",
33
"dependencies": {
44
"open": "0.0.5"
55
}

src/file/FileUtils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ define(function (require, exports, module) {
537537
*
538538
*/
539539
function shouldOpenInExternalApplication(ext) {
540-
return !extListToBeOpenedInExtApp.includes(ext);
540+
return extListToBeOpenedInExtApp.includes(ext);
541541
}
542542

543543
/**
@@ -547,7 +547,7 @@ define(function (require, exports, module) {
547547
function addExtensionToExternalAppList(ext) {
548548

549549
if(typeof ext !== 'string') {
550-
extListToBeOpenedInExtApp.concat(ext);
550+
extListToBeOpenedInExtApp = ext;
551551
} else {
552552
extListToBeOpenedInExtApp.push(ext);
553553
}

src/nls/root/strings.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -906,5 +906,5 @@ define({
906906
"REMOTE_DEBUGGING_PORT_INVALID" : "Cannot enable remote debugging on port {0}. Port numbers should be between {1} and {2}.",
907907

908908
//Associate File Type to External App
909-
"DESCRIPTION_EXTERNAL_EDITOR" : "Add File type association to external App here"
909+
"DESCRIPTION_EXTERNAL_APPLICATION_ASSOCIATE" : "Add File type association to external App here"
910910
});

src/project/FileTreeView.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ define(function (require, exports, module) {
576576
if (FileUtils.shouldOpenInExternalApplication(
577577
FileUtils.getFileExtension(this.myPath()).toLowerCase()
578578
)) {
579-
this.props.actions.openInExternalEditor(this.myPath());
579+
this.props.actions.openWithExternalApplication(this.myPath());
580580
return;
581581
}
582582
this.props.actions.selectInWorkingSet(this.myPath());

src/project/FileViewController.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,8 @@ define(function (require, exports, module) {
229229
/**
230230
* Opens the specified document with its associated external editor,
231231
*/
232-
function openInExternalEditor(fullPath) {
233-
exports.trigger("openInExternalEditor", fullPath);
232+
function openWithExternalApplication(fullPath) {
233+
exports.trigger("openWithExternalApplication", fullPath);
234234
}
235235

236236
/**
@@ -282,5 +282,5 @@ define(function (require, exports, module) {
282282
exports.setFileViewFocus = setFileViewFocus;
283283
exports.WORKING_SET_VIEW = WORKING_SET_VIEW;
284284
exports.PROJECT_MANAGER = PROJECT_MANAGER;
285-
exports.openInExternalEditor = openInExternalEditor;
285+
exports.openWithExternalApplication = openWithExternalApplication;
286286
});

src/project/ProjectManager.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,10 +281,10 @@ define(function (require, exports, module) {
281281
};
282282

283283
/**
284-
* See `FileViewController.openInExternalEditor`
284+
* See `FileViewController.openWithExternalApplication`
285285
*/
286-
ActionCreator.prototype.openInExternalEditor = function (path) {
287-
FileViewController.openInExternalEditor(path);
286+
ActionCreator.prototype.openWithExternalApplication = function (path) {
287+
FileViewController.openWithExternalApplication(path);
288288
};
289289

290290

0 commit comments

Comments
 (0)