From 8a777054d1b18b8082901ca7c532bbadc5e0a0cc Mon Sep 17 00:00:00 2001 From: FelisCatus Date: Fri, 3 Oct 2014 14:33:42 +0800 Subject: [PATCH] Hide profiles beginning with underscores. --- omega-web/src/omega/filters.coffee | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/omega-web/src/omega/filters.coffee b/omega-web/src/omega/filters.coffee index 1caa113..4d23bd6 100644 --- a/omega-web/src/omega/filters.coffee +++ b/omega-web/src/omega/filters.coffee @@ -1,5 +1,6 @@ angular.module('omega').filter 'profiles', (builtinProfiles, profileOrder) -> charCodePlus = '+'.charCodeAt(0) + charCodeUnderscore = '_'.charCodeAt(0) builtinProfileList = (profile for _, profile of builtinProfiles) (options, filter) -> result = [] @@ -11,7 +12,15 @@ angular.module('omega').filter 'profiles', (builtinProfiles, profileOrder) -> filter = filter.substr(1) result = OmegaPac.Profiles.validResultProfilesFor(filter, options) if filter == 'all' + result = result.filter (profile) -> + # Hide profiles beginning with underscore. + profile.name.charCodeAt(0) != charCodeUnderscore result = result.concat builtinProfileList + else + result = result.filter (profile) -> + # Hide profiles beginning with double underscore in options. + (profile.name.charCodeAt(0) != charCodeUnderscore or + profile.name.charCodeAt(1) != charCodeUnderscore) if filter == 'sorted' result.sort profileOrder result