diff --git a/src/extensions/default/RemoteFileAdapter/main.js b/src/extensions/default/RemoteFileAdapter/main.js index ae4b394bf..022946bc4 100644 --- a/src/extensions/default/RemoteFileAdapter/main.js +++ b/src/extensions/default/RemoteFileAdapter/main.js @@ -30,13 +30,28 @@ define(function (require, exports, module) { PathUtils = brackets.getModule("thirdparty/path-utils/path-utils"), CommandManager = brackets.getModule("command/CommandManager"), Commands = brackets.getModule("command/Commands"), + ExtensionUtils = brackets.getModule("utils/ExtensionUtils"), + WorkingSetView = brackets.getModule("project/WorkingSetView"), Menus = brackets.getModule("command/Menus"), - WorkingSetView = brackets.getModule("project/WorkingSetView"), RemoteFile = require("RemoteFile"); var HTTP_PROTOCOL = "http:", HTTPS_PROTOCOL = "https:"; + ExtensionUtils.loadStyleSheet(module, "styles.css"); + + function protocolClassProvider(data) { + if (data.fullPath.startsWith("http://")) { + return "http"; + } + + if (data.fullPath.startsWith("https://")) { + return "https"; + } + + return ""; + } + /** * Disable context menus which are not useful for remote file */ @@ -89,6 +104,8 @@ define(function (require, exports, module) { } } ); + + WorkingSetView.addClassProvider(protocolClassProvider); }); }); diff --git a/src/extensions/default/RemoteFileAdapter/styles.css b/src/extensions/default/RemoteFileAdapter/styles.css new file mode 100644 index 000000000..0f62bf391 --- /dev/null +++ b/src/extensions/default/RemoteFileAdapter/styles.css @@ -0,0 +1,21 @@ +.http a:after, +.https a:after { + margin-left: 5px; + border: 1px solid; + border-radius: 2px; + padding: 0px 5px; + font-size: 11px; + color: #adb9bd; +} + +.http a:after { + content: "http"; +} + +.https a:after { + content: "https"; +} + + + + diff --git a/src/project/WorkingSetView.js b/src/project/WorkingSetView.js index 425382547..8babb4648 100644 --- a/src/project/WorkingSetView.js +++ b/src/project/WorkingSetView.js @@ -1120,7 +1120,6 @@ define(function (require, exports, module) { data = {fullPath: file.fullPath, name: file.name, isFile: file.isFile}; - $li.removeAttr("class"); _classProviders.forEach(function (provider) { $li.addClass(provider(data)); });