diff --git a/.dockerignore b/.dockerignore
index b696e1603c..37525e02ae 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -79,18 +79,7 @@ cpu.out
/public/assets/fonts
/public/assets/img/avatar
/vendor
-/web_src/fomantic/node_modules
-/web_src/fomantic/build/*
-!/web_src/fomantic/build/semantic.js
-!/web_src/fomantic/build/semantic.css
-!/web_src/fomantic/build/themes
-/web_src/fomantic/build/themes/*
-!/web_src/fomantic/build/themes/default
-/web_src/fomantic/build/themes/default/assets/*
-!/web_src/fomantic/build/themes/default/assets/fonts
-/web_src/fomantic/build/themes/default/assets/fonts/*
-!/web_src/fomantic/build/themes/default/assets/fonts/icons.woff2
-!/web_src/fomantic/build/themes/default/assets/fonts/outline-icons.woff2
+/web_src/fomantic
/VERSION
/.air
/.go-licenses
diff --git a/.gitattributes b/.gitattributes
index 9fb4a4e83d..52695f70c2 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -5,7 +5,5 @@
/public/assets/img/svg/*.svg linguist-generated
/templates/swagger/v1_json.tmpl linguist-generated
/vendor/** -text -eol linguist-vendored
-/web_src/fomantic/build/** linguist-generated
-/web_src/fomantic/_site/globals/site.variables linguist-language=Less
/web_src/js/vendor/** -text -eol linguist-vendored
Dockerfile.* linguist-language=Dockerfile
diff --git a/.gitignore b/.gitignore
index d215468377..703be8f681 100644
--- a/.gitignore
+++ b/.gitignore
@@ -84,18 +84,6 @@ cpu.out
/public/assets/fonts
/public/assets/licenses.txt
/vendor
-/web_src/fomantic/node_modules
-/web_src/fomantic/build/*
-!/web_src/fomantic/build/semantic.js
-!/web_src/fomantic/build/semantic.css
-!/web_src/fomantic/build/themes
-/web_src/fomantic/build/themes/*
-!/web_src/fomantic/build/themes/default
-/web_src/fomantic/build/themes/default/assets/*
-!/web_src/fomantic/build/themes/default/assets/fonts
-/web_src/fomantic/build/themes/default/assets/fonts/*
-!/web_src/fomantic/build/themes/default/assets/fonts/icons.woff2
-!/web_src/fomantic/build/themes/default/assets/fonts/outline-icons.woff2
/VERSION
/.air
/.go-licenses
diff --git a/Makefile b/Makefile
index f7438c28b4..6c8798318c 100644
--- a/Makefile
+++ b/Makefile
@@ -115,8 +115,6 @@ LINUX_ARCHS ?= linux/amd64,linux/386,linux/arm-5,linux/arm-6,linux/arm64
GO_TEST_PACKAGES ?= $(filter-out $(shell $(GO) list code.gitea.io/gitea/models/migrations/...) code.gitea.io/gitea/tests/integration/migration-test code.gitea.io/gitea/tests code.gitea.io/gitea/tests/integration code.gitea.io/gitea/tests/e2e,$(shell $(GO) list ./... | grep -v /vendor/))
MIGRATE_TEST_PACKAGES ?= $(shell $(GO) list code.gitea.io/gitea/models/migrations/...)
-FOMANTIC_WORK_DIR := web_src/fomantic
-
WEBPACK_SOURCES := $(shell find web_src/js web_src/css -type f)
WEBPACK_CONFIGS := webpack.config.js tailwind.config.js
WEBPACK_DEST := public/assets/js/index.js public/assets/css/index.css
@@ -140,7 +138,7 @@ TAGS_EVIDENCE := $(MAKE_EVIDENCE_DIR)/tags
TEST_TAGS ?= $(TAGS_SPLIT) sqlite sqlite_unlock_notify
-TAR_EXCLUDES := .git data indexers queues log node_modules $(EXECUTABLE) $(FOMANTIC_WORK_DIR)/node_modules $(DIST) $(MAKE_EVIDENCE_DIR) $(AIR_TMP_DIR) $(GO_LICENSE_TMP_DIR)
+TAR_EXCLUDES := .git data indexers queues log node_modules $(EXECUTABLE) $(DIST) $(MAKE_EVIDENCE_DIR) $(AIR_TMP_DIR) $(GO_LICENSE_TMP_DIR)
GO_DIRS := build cmd models modules routers services tests
WEB_DIRS := web_src/js web_src/css
@@ -847,19 +845,6 @@ update-py: node-check | node_modules ## update py dependencies
poetry install
@touch .venv
-.PHONY: fomantic
-fomantic: ## build fomantic files
- rm -rf $(FOMANTIC_WORK_DIR)/build
- cd $(FOMANTIC_WORK_DIR) && npm install --no-save
- cp -f $(FOMANTIC_WORK_DIR)/theme.config.less $(FOMANTIC_WORK_DIR)/node_modules/fomantic-ui/src/theme.config
- cp -rf $(FOMANTIC_WORK_DIR)/_site $(FOMANTIC_WORK_DIR)/node_modules/fomantic-ui/src/
- $(SED_INPLACE) -e 's/ overrideBrowserslist\r/ overrideBrowserslist: ["defaults"]\r/g' $(FOMANTIC_WORK_DIR)/node_modules/fomantic-ui/tasks/config/tasks.js
- cd $(FOMANTIC_WORK_DIR) && npx gulp -f node_modules/fomantic-ui/gulpfile.js build
- # fomantic uses "touchstart" as click event for some browsers, it's not ideal, so we force fomantic to always use "click" as click event
- $(SED_INPLACE) -e 's/clickEvent[ \t]*=/clickEvent = "click", unstableClickEvent =/g' $(FOMANTIC_WORK_DIR)/build/semantic.js
- $(SED_INPLACE) -e 's/\r//g' $(FOMANTIC_WORK_DIR)/build/semantic.css $(FOMANTIC_WORK_DIR)/build/semantic.js
- rm -f $(FOMANTIC_WORK_DIR)/build/*.min.*
-
.PHONY: webpack
webpack: $(WEBPACK_DEST) ## build webpack files
diff --git a/models/actions/run.go b/models/actions/run.go
index 60fbbcd323..89f7f3e640 100644
--- a/models/actions/run.go
+++ b/models/actions/run.go
@@ -194,7 +194,7 @@ func updateRepoRunsNumbers(ctx context.Context, repo *repo_model.Repository) err
// CancelPreviousJobs cancels all previous jobs of the same repository, reference, workflow, and event.
// It's useful when a new run is triggered, and all previous runs needn't be continued anymore.
-func CancelPreviousJobs(ctx context.Context, repoID int64, ref, workflowID string, event webhook_module.HookEventType) error {
+func CancelPreviousJobs(ctx context.Context, repoID int64, ref, workflowID string, event webhook_module.HookEventType) ([]*ActionRunJob, error) {
// Find all runs in the specified repository, reference, and workflow with non-final status
runs, total, err := db.FindAndCount[ActionRun](ctx, FindRunOptions{
RepoID: repoID,
@@ -204,14 +204,16 @@ func CancelPreviousJobs(ctx context.Context, repoID int64, ref, workflowID strin
Status: []Status{StatusRunning, StatusWaiting, StatusBlocked},
})
if err != nil {
- return err
+ return nil, err
}
// If there are no runs found, there's no need to proceed with cancellation, so return nil.
if total == 0 {
- return nil
+ return nil, nil
}
+ cancelledJobs := make([]*ActionRunJob, 0, total)
+
// Iterate over each found run and cancel its associated jobs.
for _, run := range runs {
// Find all jobs associated with the current run.
@@ -219,7 +221,7 @@ func CancelPreviousJobs(ctx context.Context, repoID int64, ref, workflowID strin
RunID: run.ID,
})
if err != nil {
- return err
+ return cancelledJobs, err
}
// Iterate over each job and attempt to cancel it.
@@ -238,27 +240,29 @@ func CancelPreviousJobs(ctx context.Context, repoID int64, ref, workflowID strin
// Update the job's status and stopped time in the database.
n, err := UpdateRunJob(ctx, job, builder.Eq{"task_id": 0}, "status", "stopped")
if err != nil {
- return err
+ return cancelledJobs, err
}
// If the update affected 0 rows, it means the job has changed in the meantime, so we need to try again.
if n == 0 {
- return fmt.Errorf("job has changed, try again")
+ return cancelledJobs, fmt.Errorf("job has changed, try again")
}
+ cancelledJobs = append(cancelledJobs, job)
// Continue with the next job.
continue
}
// If the job has an associated task, try to stop the task, effectively cancelling the job.
if err := StopTask(ctx, job.TaskID, StatusCancelled); err != nil {
- return err
+ return cancelledJobs, err
}
+ cancelledJobs = append(cancelledJobs, job)
}
}
// Return nil to indicate successful cancellation of all running and waiting jobs.
- return nil
+ return cancelledJobs, nil
}
// InsertRun inserts a run
diff --git a/models/actions/schedule.go b/models/actions/schedule.go
index fcdc7c2a4c..2edf483fe0 100644
--- a/models/actions/schedule.go
+++ b/models/actions/schedule.go
@@ -117,21 +117,22 @@ func DeleteScheduleTaskByRepo(ctx context.Context, id int64) error {
return committer.Commit()
}
-func CleanRepoScheduleTasks(ctx context.Context, repo *repo_model.Repository) error {
+func CleanRepoScheduleTasks(ctx context.Context, repo *repo_model.Repository) ([]*ActionRunJob, error) {
// If actions disabled when there is schedule task, this will remove the outdated schedule tasks
// There is no other place we can do this because the app.ini will be changed manually
if err := DeleteScheduleTaskByRepo(ctx, repo.ID); err != nil {
- return fmt.Errorf("DeleteCronTaskByRepo: %v", err)
+ return nil, fmt.Errorf("DeleteCronTaskByRepo: %v", err)
}
// cancel running cron jobs of this repository and delete old schedules
- if err := CancelPreviousJobs(
+ jobs, err := CancelPreviousJobs(
ctx,
repo.ID,
repo.DefaultBranch,
"",
webhook_module.HookEventSchedule,
- ); err != nil {
- return fmt.Errorf("CancelPreviousJobs: %v", err)
+ )
+ if err != nil {
+ return jobs, fmt.Errorf("CancelPreviousJobs: %v", err)
}
- return nil
+ return jobs, nil
}
diff --git a/modules/fileicon/material.go b/modules/fileicon/material.go
index 201cf6f455..adea625c06 100644
--- a/modules/fileicon/material.go
+++ b/modules/fileicon/material.go
@@ -21,6 +21,7 @@ type materialIconRulesData struct {
FileNames map[string]string `json:"fileNames"`
FolderNames map[string]string `json:"folderNames"`
FileExtensions map[string]string `json:"fileExtensions"`
+ LanguageIDs map[string]string `json:"languageIds"`
}
type MaterialIconProvider struct {
@@ -107,25 +108,40 @@ func (m *MaterialIconProvider) FileIcon(ctx reqctx.RequestContext, entry *git.Tr
return svg.RenderHTML("octicon-file")
}
+func (m *MaterialIconProvider) findIconNameWithLangID(s string) string {
+ if _, ok := m.svgs[s]; ok {
+ return s
+ }
+ if s, ok := m.rules.LanguageIDs[s]; ok {
+ if _, ok = m.svgs[s]; ok {
+ return s
+ }
+ }
+ return ""
+}
+
func (m *MaterialIconProvider) FindIconName(name string, isDir bool) string {
- iconsData := m.rules
fileNameLower := strings.ToLower(path.Base(name))
if isDir {
- if s, ok := iconsData.FolderNames[fileNameLower]; ok {
+ if s, ok := m.rules.FolderNames[fileNameLower]; ok {
return s
}
return "folder"
}
- if s, ok := iconsData.FileNames[fileNameLower]; ok {
- return s
+ if s, ok := m.rules.FileNames[fileNameLower]; ok {
+ if s = m.findIconNameWithLangID(s); s != "" {
+ return s
+ }
}
for i := len(fileNameLower) - 1; i >= 0; i-- {
if fileNameLower[i] == '.' {
ext := fileNameLower[i+1:]
- if s, ok := iconsData.FileExtensions[ext]; ok {
- return s
+ if s, ok := m.rules.FileExtensions[ext]; ok {
+ if s = m.findIconNameWithLangID(s); s != "" {
+ return s
+ }
}
}
}
diff --git a/modules/fileicon/material_test.go b/modules/fileicon/material_test.go
index bce316c692..f36385aaf3 100644
--- a/modules/fileicon/material_test.go
+++ b/modules/fileicon/material_test.go
@@ -21,4 +21,6 @@ func TestFindIconName(t *testing.T) {
p := fileicon.DefaultMaterialIconProvider()
assert.Equal(t, "php", p.FindIconName("foo.php", false))
assert.Equal(t, "php", p.FindIconName("foo.PHP", false))
+ assert.Equal(t, "javascript", p.FindIconName("foo.js", false))
+ assert.Equal(t, "visualstudio", p.FindIconName("foo.vba", false))
}
diff --git a/options/fileicon/material-icon-rules.json b/options/fileicon/material-icon-rules.json
index 05d56cc546..fd058c82dc 100644
--- a/options/fileicon/material-icon-rules.json
+++ b/options/fileicon/material-icon-rules.json
@@ -7038,107 +7038,201 @@
"gnu": "gnuplot",
"yaml-tmlanguage": "yaml",
"tmlanguage": "xml",
- "git": "git",
- "git-commit": "git",
- "git-rebase": "git",
- "ignore": "git",
- "github-actions-workflow": "github-actions-workflow",
- "yaml": "yaml",
- "spring-boot-properties-yaml": "yaml",
- "ansible": "yaml",
- "ansible-jinja": "yaml",
- "matlab": "matlab",
- "makefile": "settings",
- "spring-boot-properties": "settings",
- "diff": "diff",
- "razor": "razor",
- "aspnetcorerazor": "razor",
- "python": "python",
- "javascript": "javascript",
- "typescript": "typescript",
- "handlebars": "handlebars",
- "perl": "perl",
- "perl6": "perl",
- "haxe": "haxe",
- "hxml": "haxe",
- "puppet": "puppet",
- "elixir": "elixir",
- "livescript": "livescript",
- "erlang": "erlang",
- "julia": "julia",
- "purescript": "purescript",
- "stylus": "stylus",
- "robotframework": "robot",
- "testoutput": "visualstudio",
- "solidity": "solidity",
- "autoit": "autoit",
- "terraform": "terraform",
- "cucumber": "cucumber",
- "postcss": "postcss",
- "lang-cfml": "coldfusion",
- "haskell": "haskell",
- "ruby": "ruby",
- "php": "php",
- "hack": "hack",
- "javascriptreact": "react",
- "processing": "processing",
- "django-html": "django",
- "django-txt": "django",
- "html": "html",
- "gdscript": "godot",
- "gdresource": "godot-assets",
- "viml": "vim",
- "prolog": "prolog",
- "pawn": "pawn",
- "reason": "reason",
- "reason_lisp": "reason",
- "doctex": "tex",
- "latex": "tex",
- "latex-expl3": "tex",
- "apex": "salesforce",
- "dockercompose": "docker",
- "shellscript": "console",
- "objective-c": "objective-c",
- "objective-cpp": "objective-cpp",
- "coffeescript": "coffee",
- "fsharp": "fsharp",
- "editorconfig": "editorconfig",
+ "cljx": "clojure",
"clojure": "clojure",
- "pip-requirements": "python-misc",
- "vue-postcss": "vue",
- "vue-html": "vue",
- "bibtex": "lib",
- "bibtex-style": "lib",
- "jupyter": "jupyter",
- "plaintext": "document",
- "powershell": "powershell",
- "rsweave": "r",
- "rust": "rust",
- "ssh_config": "lock",
- "typescriptreact": "react_ts",
- "search-result": "search",
- "rescript": "rescript",
- "twee3": "twine",
- "twee3-harlowe-3": "twine",
- "twee3-chapbook-1": "twine",
- "twee3-sugarcube-2": "twine",
- "grain": "grain",
- "lolcode": "lolcode",
- "idris": "idris",
- "text-gemini": "gemini",
- "wolfram": "wolframlanguage",
- "shaderlab": "shader",
- "cadence": "cadence",
- "stylable": "stylable",
- "capnb": "cds",
- "cds-markdown-injection": "cds",
- "concourse-pipeline-yaml": "concourse",
- "concourse-task-yaml": "concourse",
- "systemd-conf": "systemd",
- "systemd-unit-file": "systemd",
- "hosts": "hosts",
- "ahk2": "ahk2",
- "gnuplot": "gnuplot"
+ "edn": "clojure",
+ "cppm": "cpp",
+ "ccm": "cpp",
+ "cxxm": "cpp",
+ "c++m": "cpp",
+ "ipp": "cpp",
+ "ixx": "cpp",
+ "tpp": "cpp",
+ "txx": "cpp",
+ "hpp.in": "cpp",
+ "h.in": "cpp",
+ "diff": "diff",
+ "rej": "diff",
+ "fsscript": "fsharp",
+ "gitignore_global": "ignore",
+ "gitignore": "ignore",
+ "git-blame-ignore-revs": "ignore",
+ "gvy": "groovy",
+ "nf": "groovy",
+ "handlebars": "handlebars",
+ "hjs": "handlebars",
+ "hlsli": "hlsl",
+ "fx": "hlsl",
+ "fxh": "hlsl",
+ "vsh": "hlsl",
+ "psh": "hlsl",
+ "cginc": "hlsl",
+ "compute": "hlsl",
+ "html": "html",
+ "shtml": "html",
+ "xht": "html",
+ "aspx": "html",
+ "jshtm": "html",
+ "volt": "html",
+ "rhtml": "html",
+ "directory": "properties",
+ "gitattributes": "properties",
+ "gitconfig": "properties",
+ "gitmodules": "properties",
+ "editorconfig": "properties",
+ "repo": "properties",
+ "jav": "java",
+ "js": "javascript",
+ "es6": "javascript",
+ "cjs": "javascript",
+ "pac": "javascript",
+ "bowerrc": "json",
+ "jscsrc": "json",
+ "webmanifest": "json",
+ "ts.map": "json",
+ "har": "json",
+ "jslintrc": "json",
+ "jsonld": "json",
+ "geojson": "json",
+ "vuerc": "json",
+ "eslintrc": "jsonc",
+ "eslintrc.json": "jsonc",
+ "jsfmtrc": "jsonc",
+ "jshintrc": "jsonc",
+ "hintrc": "jsonc",
+ "babelrc": "jsonc",
+ "jmd": "juliamarkdown",
+ "cls": "tex",
+ "bbx": "tex",
+ "cbx": "tex",
+ "ctx": "latex",
+ "mak": "makefile",
+ "mkd": "markdown",
+ "mdwn": "markdown",
+ "mdown": "markdown",
+ "markdn": "markdown",
+ "mdtxt": "markdown",
+ "mdtext": "markdown",
+ "workbook": "markdown",
+ "npmignore": "ignore",
+ "npmrc": "properties",
+ "m": "objective-c",
+ "mm": "objective-cpp",
+ "pod": "perl",
+ "t": "perl",
+ "psgi": "perl",
+ "rakumod": "raku",
+ "rakutest": "raku",
+ "rakudoc": "raku",
+ "nqp": "raku",
+ "p6": "raku",
+ "pl6": "raku",
+ "pm6": "raku",
+ "php": "php",
+ "php4": "php",
+ "php5": "php",
+ "phtml": "php",
+ "ctp": "php",
+ "psrc": "powershell",
+ "rpy": "python",
+ "pyw": "python",
+ "cpy": "python",
+ "gyp": "python",
+ "gypi": "python",
+ "pyi": "python",
+ "ipy": "python",
+ "pyt": "python",
+ "rhistory": "r",
+ "rprofile": "r",
+ "rt": "r",
+ "razor": "razor",
+ "rbx": "ruby",
+ "rjs": "ruby",
+ "gemspec": "ruby",
+ "rake": "ruby",
+ "ru": "ruby",
+ "podspec": "ruby",
+ "rbi": "ruby",
+ "bashrc": "shellscript",
+ "bash_aliases": "shellscript",
+ "bash_profile": "shellscript",
+ "bash_login": "shellscript",
+ "ebuild": "shellscript",
+ "eclass": "shellscript",
+ "profile": "shellscript",
+ "bash_logout": "shellscript",
+ "xprofile": "shellscript",
+ "xsession": "shellscript",
+ "xsessionrc": "shellscript",
+ "zshrc": "shellscript",
+ "zprofile": "shellscript",
+ "zlogin": "shellscript",
+ "zlogout": "shellscript",
+ "zshenv": "shellscript",
+ "zsh-theme": "shellscript",
+ "cshrc": "shellscript",
+ "tcshrc": "shellscript",
+ "yashrc": "shellscript",
+ "yash_profile": "shellscript",
+ "dsql": "sql",
+ "ts": "typescript",
+ "cts": "typescript",
+ "mts": "typescript",
+ "brs": "vb",
+ "bas": "vb",
+ "vba": "vb",
+ "ascx": "xml",
+ "atom": "xml",
+ "axml": "xml",
+ "axaml": "xml",
+ "bpmn": "xml",
+ "csl": "xml",
+ "csproj.user": "xml",
+ "dita": "xml",
+ "ditamap": "xml",
+ "ent": "xml",
+ "dtml": "xml",
+ "fxml": "xml",
+ "isml": "xml",
+ "jmx": "xml",
+ "launch": "xml",
+ "menu": "xml",
+ "nuspec": "xml",
+ "opml": "xml",
+ "owl": "xml",
+ "proj": "xml",
+ "pt": "xml",
+ "publishsettings": "xml",
+ "pubxml": "xml",
+ "pubxml.user": "xml",
+ "rdf": "xml",
+ "rng": "xml",
+ "rss": "xml",
+ "shproj": "xml",
+ "storyboard": "xml",
+ "targets": "xml",
+ "tld": "xml",
+ "tmx": "xml",
+ "vbproj": "xml",
+ "vbproj.user": "xml",
+ "wsdl": "xml",
+ "wxi": "xml",
+ "wxl": "xml",
+ "wxs": "xml",
+ "xbl": "xml",
+ "xib": "xml",
+ "xliff": "xml",
+ "xpdl": "xml",
+ "xul": "xml",
+ "xoml": "xml",
+ "yaml": "yaml",
+ "yml": "yaml",
+ "eyaml": "yaml",
+ "eyml": "yaml",
+ "cff": "yaml",
+ "yaml-tmpreferences": "yaml",
+ "yaml-tmtheme": "yaml",
+ "winget": "yaml"
},
"fileNames": {
".pug-lintrc": "pug",
@@ -9015,7 +9109,11 @@
"caddyfile": "caddy",
"pklproject": "pkl",
"pklproject.deps.json": "pkl",
- ".github/funding.yml": "github-sponsors"
+ ".github/funding.yml": "github-sponsors",
+ "language-configuration.json": "jsonc",
+ "icon-theme.json": "jsonc",
+ "color-theme.json": "jsonc",
+ "*.log.?": "log"
},
"languageIds": {
"git": "git",
diff --git a/routers/api/v1/repo/repo.go b/routers/api/v1/repo/repo.go
index d418b8e4b5..5ef510fd84 100644
--- a/routers/api/v1/repo/repo.go
+++ b/routers/api/v1/repo/repo.go
@@ -12,7 +12,6 @@ import (
"strings"
"time"
- actions_model "code.gitea.io/gitea/models/actions"
activities_model "code.gitea.io/gitea/models/activities"
"code.gitea.io/gitea/models/db"
"code.gitea.io/gitea/models/organization"
@@ -1049,7 +1048,7 @@ func updateRepoArchivedState(ctx *context.APIContext, opts api.EditRepoOption) e
ctx.APIErrorInternal(err)
return err
}
- if err := actions_model.CleanRepoScheduleTasks(ctx, repo); err != nil {
+ if err := actions_service.CleanRepoScheduleTasks(ctx, repo); err != nil {
log.Error("CleanRepoScheduleTasks for archived repo %s/%s: %v", ctx.Repo.Owner.Name, repo.Name, err)
}
log.Trace("Repository was archived: %s/%s", ctx.Repo.Owner.Name, repo.Name)
diff --git a/routers/web/repo/setting/setting.go b/routers/web/repo/setting/setting.go
index 768484a21c..ac7eb768fa 100644
--- a/routers/web/repo/setting/setting.go
+++ b/routers/web/repo/setting/setting.go
@@ -11,7 +11,6 @@ import (
"strings"
"time"
- actions_model "code.gitea.io/gitea/models/actions"
"code.gitea.io/gitea/models/db"
"code.gitea.io/gitea/models/organization"
"code.gitea.io/gitea/models/perm"
@@ -906,7 +905,7 @@ func SettingsPost(ctx *context.Context) {
return
}
- if err := actions_model.CleanRepoScheduleTasks(ctx, repo); err != nil {
+ if err := actions_service.CleanRepoScheduleTasks(ctx, repo); err != nil {
log.Error("CleanRepoScheduleTasks for archived repo %s/%s: %v", ctx.Repo.Owner.Name, repo.Name, err)
}
diff --git a/services/actions/clear_tasks.go b/services/actions/clear_tasks.go
index 67373782d5..9d613b68a5 100644
--- a/services/actions/clear_tasks.go
+++ b/services/actions/clear_tasks.go
@@ -10,10 +10,12 @@ import (
actions_model "code.gitea.io/gitea/models/actions"
"code.gitea.io/gitea/models/db"
+ repo_model "code.gitea.io/gitea/models/repo"
"code.gitea.io/gitea/modules/actions"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/timeutil"
+ webhook_module "code.gitea.io/gitea/modules/webhook"
)
// StopZombieTasks stops the task which have running status, but haven't been updated for a long time
@@ -32,6 +34,24 @@ func StopEndlessTasks(ctx context.Context) error {
})
}
+func notifyWorkflowJobStatusUpdate(ctx context.Context, jobs []*actions_model.ActionRunJob) {
+ if len(jobs) > 0 {
+ CreateCommitStatus(ctx, jobs...)
+ }
+}
+
+func CancelPreviousJobs(ctx context.Context, repoID int64, ref, workflowID string, event webhook_module.HookEventType) error {
+ jobs, err := actions_model.CancelPreviousJobs(ctx, repoID, ref, workflowID, event)
+ notifyWorkflowJobStatusUpdate(ctx, jobs)
+ return err
+}
+
+func CleanRepoScheduleTasks(ctx context.Context, repo *repo_model.Repository) error {
+ jobs, err := actions_model.CleanRepoScheduleTasks(ctx, repo)
+ notifyWorkflowJobStatusUpdate(ctx, jobs)
+ return err
+}
+
func stopTasks(ctx context.Context, opts actions_model.FindTaskOptions) error {
tasks, err := db.Find[actions_model.ActionTask](ctx, opts)
if err != nil {
@@ -67,7 +87,7 @@ func stopTasks(ctx context.Context, opts actions_model.FindTaskOptions) error {
remove()
}
- CreateCommitStatus(ctx, jobs...)
+ notifyWorkflowJobStatusUpdate(ctx, jobs)
return nil
}
diff --git a/services/actions/notifier_helper.go b/services/actions/notifier_helper.go
index 2d8885dc32..87ea1a37f5 100644
--- a/services/actions/notifier_helper.go
+++ b/services/actions/notifier_helper.go
@@ -136,7 +136,7 @@ func notify(ctx context.Context, input *notifyInput) error {
return nil
}
if unit_model.TypeActions.UnitGlobalDisabled() {
- if err := actions_model.CleanRepoScheduleTasks(ctx, input.Repo); err != nil {
+ if err := CleanRepoScheduleTasks(ctx, input.Repo); err != nil {
log.Error("CleanRepoScheduleTasks: %v", err)
}
return nil
@@ -341,7 +341,7 @@ func handleWorkflows(
// cancel running jobs if the event is push or pull_request_sync
if run.Event == webhook_module.HookEventPush ||
run.Event == webhook_module.HookEventPullRequestSync {
- if err := actions_model.CancelPreviousJobs(
+ if err := CancelPreviousJobs(
ctx,
run.RepoID,
run.Ref,
@@ -472,7 +472,7 @@ func handleSchedules(
log.Error("CountSchedules: %v", err)
return err
} else if count > 0 {
- if err := actions_model.CleanRepoScheduleTasks(ctx, input.Repo); err != nil {
+ if err := CleanRepoScheduleTasks(ctx, input.Repo); err != nil {
log.Error("CleanRepoScheduleTasks: %v", err)
}
}
diff --git a/services/actions/schedule_tasks.go b/services/actions/schedule_tasks.go
index 18f3324fd2..ad1158313b 100644
--- a/services/actions/schedule_tasks.go
+++ b/services/actions/schedule_tasks.go
@@ -55,7 +55,7 @@ func startTasks(ctx context.Context) error {
// cancel running jobs if the event is push
if row.Schedule.Event == webhook_module.HookEventPush {
// cancel running jobs of the same workflow
- if err := actions_model.CancelPreviousJobs(
+ if err := CancelPreviousJobs(
ctx,
row.RepoID,
row.Schedule.Ref,
diff --git a/services/actions/workflow.go b/services/actions/workflow.go
index ccdefa802d..5225f4dcad 100644
--- a/services/actions/workflow.go
+++ b/services/actions/workflow.go
@@ -256,7 +256,7 @@ func DispatchActionWorkflow(ctx reqctx.RequestContext, doer *user_model.User, re
}
// cancel running jobs of the same workflow
- if err := actions_model.CancelPreviousJobs(
+ if err := CancelPreviousJobs(
ctx,
run.RepoID,
run.Ref,
diff --git a/services/repository/branch.go b/services/repository/branch.go
index c80d367bbd..d0d8851423 100644
--- a/services/repository/branch.go
+++ b/services/repository/branch.go
@@ -30,6 +30,7 @@ import (
"code.gitea.io/gitea/modules/timeutil"
"code.gitea.io/gitea/modules/util"
webhook_module "code.gitea.io/gitea/modules/webhook"
+ actions_service "code.gitea.io/gitea/services/actions"
notify_service "code.gitea.io/gitea/services/notify"
release_service "code.gitea.io/gitea/services/release"
files_service "code.gitea.io/gitea/services/repository/files"
@@ -452,7 +453,7 @@ func RenameBranch(ctx context.Context, repo *repo_model.Repository, doer *user_m
log.Error("DeleteCronTaskByRepo: %v", err)
}
// cancel running cron jobs of this repository and delete old schedules
- if err := actions_model.CancelPreviousJobs(
+ if err := actions_service.CancelPreviousJobs(
ctx,
repo.ID,
from,
@@ -639,7 +640,7 @@ func SetRepoDefaultBranch(ctx context.Context, repo *repo_model.Repository, gitR
log.Error("DeleteCronTaskByRepo: %v", err)
}
// cancel running cron jobs of this repository and delete old schedules
- if err := actions_model.CancelPreviousJobs(
+ if err := actions_service.CancelPreviousJobs(
ctx,
repo.ID,
oldDefaultBranchName,
diff --git a/services/repository/setting.go b/services/repository/setting.go
index b82f24271e..e0c787dd2d 100644
--- a/services/repository/setting.go
+++ b/services/repository/setting.go
@@ -7,7 +7,6 @@ import (
"context"
"slices"
- actions_model "code.gitea.io/gitea/models/actions"
"code.gitea.io/gitea/models/db"
repo_model "code.gitea.io/gitea/models/repo"
"code.gitea.io/gitea/models/unit"
@@ -29,7 +28,7 @@ func UpdateRepositoryUnits(ctx context.Context, repo *repo_model.Repository, uni
}
if slices.Contains(deleteUnitTypes, unit.TypeActions) {
- if err := actions_model.CleanRepoScheduleTasks(ctx, repo); err != nil {
+ if err := actions_service.CleanRepoScheduleTasks(ctx, repo); err != nil {
log.Error("CleanRepoScheduleTasks: %v", err)
}
}
diff --git a/tests/integration/api_activitypub_person_test.go b/tests/integration/api_activitypub_person_test.go
index 75578094f5..17d628a483 100644
--- a/tests/integration/api_activitypub_person_test.go
+++ b/tests/integration/api_activitypub_person_test.go
@@ -7,28 +7,28 @@ import (
"fmt"
"net/http"
"net/http/httptest"
- "net/url"
"testing"
"code.gitea.io/gitea/models/db"
user_model "code.gitea.io/gitea/models/user"
"code.gitea.io/gitea/modules/activitypub"
"code.gitea.io/gitea/modules/setting"
+ "code.gitea.io/gitea/modules/test"
"code.gitea.io/gitea/routers"
+ "code.gitea.io/gitea/tests"
ap "github.com/go-ap/activitypub"
"github.com/stretchr/testify/assert"
)
func TestActivityPubPerson(t *testing.T) {
- setting.Federation.Enabled = true
- testWebRoutes = routers.NormalRoutes()
- defer func() {
- setting.Federation.Enabled = false
- testWebRoutes = routers.NormalRoutes()
- }()
+ defer tests.PrepareTestEnv(t)()
+ defer test.MockVariableValue(&setting.Federation.Enabled, true)()
+ defer test.MockVariableValue(&testWebRoutes, routers.NormalRoutes())()
+
+ t.Run("ExistingPerson", func(t *testing.T) {
+ defer tests.PrintCurrentTest(t)()
- onGiteaRun(t, func(*testing.T, *url.URL) {
userID := 2
username := "user2"
req := NewRequest(t, "GET", fmt.Sprintf("/api/v1/activitypub/user-id/%v", userID))
@@ -56,41 +56,18 @@ func TestActivityPubPerson(t *testing.T) {
assert.NotNil(t, pubKeyPem)
assert.Regexp(t, "^-----BEGIN PUBLIC KEY-----", pubKeyPem)
})
-}
-
-func TestActivityPubMissingPerson(t *testing.T) {
- setting.Federation.Enabled = true
- testWebRoutes = routers.NormalRoutes()
- defer func() {
- setting.Federation.Enabled = false
- testWebRoutes = routers.NormalRoutes()
- }()
-
- onGiteaRun(t, func(*testing.T, *url.URL) {
+ t.Run("MissingPerson", func(t *testing.T) {
+ defer tests.PrintCurrentTest(t)()
req := NewRequest(t, "GET", "/api/v1/activitypub/user-id/999999999")
resp := MakeRequest(t, req, http.StatusNotFound)
assert.Contains(t, resp.Body.String(), "user does not exist")
})
-}
+ t.Run("MissingPersonInbox", func(t *testing.T) {
+ defer tests.PrintCurrentTest(t)()
+ srv := httptest.NewServer(testWebRoutes)
+ defer srv.Close()
+ defer test.MockVariableValue(&setting.AppURL, srv.URL+"/")()
-func TestActivityPubPersonInbox(t *testing.T) {
- setting.Federation.Enabled = true
- testWebRoutes = routers.NormalRoutes()
- defer func() {
- setting.Federation.Enabled = false
- testWebRoutes = routers.NormalRoutes()
- }()
-
- srv := httptest.NewServer(testWebRoutes)
- defer srv.Close()
-
- onGiteaRun(t, func(*testing.T, *url.URL) {
- appURL := setting.AppURL
- setting.AppURL = srv.URL + "/"
- defer func() {
- setting.Database.LogSQL = false
- setting.AppURL = appURL
- }()
username1 := "user1"
ctx := t.Context()
user1, err := user_model.GetUserByName(ctx, username1)
diff --git a/tests/integration/api_admin_org_test.go b/tests/integration/api_admin_org_test.go
index b243856127..b2d77456c4 100644
--- a/tests/integration/api_admin_org_test.go
+++ b/tests/integration/api_admin_org_test.go
@@ -5,7 +5,6 @@ package integration
import (
"net/http"
- "net/url"
"strings"
"testing"
@@ -19,10 +18,12 @@ import (
)
func TestAPIAdminOrgCreate(t *testing.T) {
- onGiteaRun(t, func(*testing.T, *url.URL) {
- session := loginUser(t, "user1")
- token := getTokenForLoggedInUser(t, session, auth_model.AccessTokenScopeWriteAdmin)
+ defer tests.PrepareTestEnv(t)()
+ session := loginUser(t, "user1")
+ token := getTokenForLoggedInUser(t, session, auth_model.AccessTokenScopeWriteAdmin)
+ t.Run("CreateOrg", func(t *testing.T) {
+ defer tests.PrintCurrentTest(t)()
org := api.CreateOrgOption{
UserName: "user2_org",
FullName: "User2's organization",
@@ -51,13 +52,8 @@ func TestAPIAdminOrgCreate(t *testing.T) {
FullName: org.FullName,
})
})
-}
-
-func TestAPIAdminOrgCreateBadVisibility(t *testing.T) {
- onGiteaRun(t, func(*testing.T, *url.URL) {
- session := loginUser(t, "user1")
- token := getTokenForLoggedInUser(t, session, auth_model.AccessTokenScopeWriteAdmin)
-
+ t.Run("CreateBadVisibility", func(t *testing.T) {
+ defer tests.PrintCurrentTest(t)()
org := api.CreateOrgOption{
UserName: "user2_org",
FullName: "User2's organization",
@@ -70,22 +66,21 @@ func TestAPIAdminOrgCreateBadVisibility(t *testing.T) {
AddTokenAuth(token)
MakeRequest(t, req, http.StatusUnprocessableEntity)
})
-}
-
-func TestAPIAdminOrgCreateNotAdmin(t *testing.T) {
- defer tests.PrepareTestEnv(t)()
- nonAdminUsername := "user2"
- session := loginUser(t, nonAdminUsername)
- token := getTokenForLoggedInUser(t, session, auth_model.AccessTokenScopeAll)
- org := api.CreateOrgOption{
- UserName: "user2_org",
- FullName: "User2's organization",
- Description: "This organization created by admin for user2",
- Website: "https://try.gitea.io",
- Location: "Shanghai",
- Visibility: "public",
- }
- req := NewRequestWithJSON(t, "POST", "/api/v1/admin/users/user2/orgs", &org).
- AddTokenAuth(token)
- MakeRequest(t, req, http.StatusForbidden)
+ t.Run("CreateNotAdmin", func(t *testing.T) {
+ defer tests.PrintCurrentTest(t)()
+ nonAdminUsername := "user2"
+ session := loginUser(t, nonAdminUsername)
+ token := getTokenForLoggedInUser(t, session, auth_model.AccessTokenScopeAll)
+ org := api.CreateOrgOption{
+ UserName: "user2_org",
+ FullName: "User2's organization",
+ Description: "This organization created by admin for user2",
+ Website: "https://try.gitea.io",
+ Location: "Shanghai",
+ Visibility: "public",
+ }
+ req := NewRequestWithJSON(t, "POST", "/api/v1/admin/users/user2/orgs", &org).
+ AddTokenAuth(token)
+ MakeRequest(t, req, http.StatusForbidden)
+ })
}
diff --git a/tests/integration/api_nodeinfo_test.go b/tests/integration/api_nodeinfo_test.go
index 75f8dbb4ba..916c2f1723 100644
--- a/tests/integration/api_nodeinfo_test.go
+++ b/tests/integration/api_nodeinfo_test.go
@@ -5,35 +5,31 @@ package integration
import (
"net/http"
- "net/url"
"testing"
"code.gitea.io/gitea/modules/setting"
api "code.gitea.io/gitea/modules/structs"
+ "code.gitea.io/gitea/modules/test"
"code.gitea.io/gitea/routers"
+ "code.gitea.io/gitea/tests"
"github.com/stretchr/testify/assert"
)
func TestNodeinfo(t *testing.T) {
- setting.Federation.Enabled = true
- testWebRoutes = routers.NormalRoutes()
- defer func() {
- setting.Federation.Enabled = false
- testWebRoutes = routers.NormalRoutes()
- }()
+ defer tests.PrepareTestEnv(t)()
+ defer test.MockVariableValue(&setting.Federation.Enabled, true)()
+ defer test.MockVariableValue(&testWebRoutes, routers.NormalRoutes())()
- onGiteaRun(t, func(*testing.T, *url.URL) {
- req := NewRequest(t, "GET", "/api/v1/nodeinfo")
- resp := MakeRequest(t, req, http.StatusOK)
- VerifyJSONSchema(t, resp, "nodeinfo_2.1.json")
+ req := NewRequest(t, "GET", "/api/v1/nodeinfo")
+ resp := MakeRequest(t, req, http.StatusOK)
+ VerifyJSONSchema(t, resp, "nodeinfo_2.1.json")
- var nodeinfo api.NodeInfo
- DecodeJSON(t, resp, &nodeinfo)
- assert.True(t, nodeinfo.OpenRegistrations)
- assert.Equal(t, "gitea", nodeinfo.Software.Name)
- assert.Equal(t, 29, nodeinfo.Usage.Users.Total)
- assert.Equal(t, 22, nodeinfo.Usage.LocalPosts)
- assert.Equal(t, 3, nodeinfo.Usage.LocalComments)
- })
+ var nodeinfo api.NodeInfo
+ DecodeJSON(t, resp, &nodeinfo)
+ assert.True(t, nodeinfo.OpenRegistrations)
+ assert.Equal(t, "gitea", nodeinfo.Software.Name)
+ assert.Equal(t, 29, nodeinfo.Usage.Users.Total)
+ assert.Equal(t, 22, nodeinfo.Usage.LocalPosts)
+ assert.Equal(t, 3, nodeinfo.Usage.LocalComments)
}
diff --git a/tests/integration/org_count_test.go b/tests/integration/org_count_test.go
index 8a33c218be..fb71e690c2 100644
--- a/tests/integration/org_count_test.go
+++ b/tests/integration/org_count_test.go
@@ -4,7 +4,6 @@
package integration
import (
- "net/url"
"strings"
"testing"
@@ -14,15 +13,17 @@ import (
"code.gitea.io/gitea/models/unittest"
user_model "code.gitea.io/gitea/models/user"
api "code.gitea.io/gitea/modules/structs"
+ "code.gitea.io/gitea/tests"
"github.com/stretchr/testify/assert"
)
func TestOrgCounts(t *testing.T) {
- onGiteaRun(t, testOrgCounts)
+ defer tests.PrepareTestEnv(t)()
+ testOrgCounts(t)
}
-func testOrgCounts(t *testing.T, u *url.URL) {
+func testOrgCounts(t *testing.T) {
orgOwner := "user2"
orgName := "testOrg"
orgCollaborator := "user4"
diff --git a/tests/integration/pull_commit_test.go b/tests/integration/pull_commit_test.go
index fc111f528f..9f3b1a9ef5 100644
--- a/tests/integration/pull_commit_test.go
+++ b/tests/integration/pull_commit_test.go
@@ -8,12 +8,15 @@ import (
"testing"
pull_service "code.gitea.io/gitea/services/pull"
+ "code.gitea.io/gitea/tests"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestListPullCommits(t *testing.T) {
+ defer tests.PrepareTestEnv(t)()
+
session := loginUser(t, "user5")
req := NewRequest(t, "GET", "/user2/repo1/pulls/3/commits/list")
resp := session.MakeRequest(t, req, http.StatusOK)
@@ -30,6 +33,7 @@ func TestListPullCommits(t *testing.T) {
assert.Equal(t, "4a357436d925b5c974181ff12a994538ddc5a269", pullCommitList.LastReviewCommitSha)
t.Run("CommitBlobExcerpt", func(t *testing.T) {
+ defer tests.PrintCurrentTest(t)()
req = NewRequest(t, "GET", "/user2/repo1/blob_excerpt/985f0301dba5e7b34be866819cd15ad3d8f508ee?last_left=0&last_right=0&left=2&right=2&left_hunk_size=2&right_hunk_size=2&path=README.md&style=split&direction=up")
resp = session.MakeRequest(t, req, http.StatusOK)
assert.Contains(t, resp.Body.String(), `
# repo1 `)
diff --git a/tests/integration/user_avatar_test.go b/tests/integration/user_avatar_test.go
index caca9a3e56..7b157e6e61 100644
--- a/tests/integration/user_avatar_test.go
+++ b/tests/integration/user_avatar_test.go
@@ -10,78 +10,77 @@ import (
"io"
"mime/multipart"
"net/http"
- "net/url"
"testing"
"code.gitea.io/gitea/models/db"
"code.gitea.io/gitea/models/unittest"
user_model "code.gitea.io/gitea/models/user"
"code.gitea.io/gitea/modules/avatar"
+ "code.gitea.io/gitea/tests"
"github.com/stretchr/testify/assert"
)
func TestUserAvatar(t *testing.T) {
- onGiteaRun(t, func(t *testing.T, u *url.URL) {
- user2 := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2}) // owner of the repo3, is an org
+ defer tests.PrepareTestEnv(t)()
+ user2 := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2}) // owner of the repo3, is an org
- seed := user2.Email
- if len(seed) == 0 {
- seed = user2.Name
- }
+ seed := user2.Email
+ if len(seed) == 0 {
+ seed = user2.Name
+ }
- img, err := avatar.RandomImage([]byte(seed))
- if err != nil {
- assert.NoError(t, err)
- return
- }
+ img, err := avatar.RandomImage([]byte(seed))
+ if err != nil {
+ assert.NoError(t, err)
+ return
+ }
- session := loginUser(t, "user2")
- csrf := GetUserCSRFToken(t, session)
+ session := loginUser(t, "user2")
+ csrf := GetUserCSRFToken(t, session)
- imgData := &bytes.Buffer{}
+ imgData := &bytes.Buffer{}
- body := &bytes.Buffer{}
+ body := &bytes.Buffer{}
- // Setup multi-part
- writer := multipart.NewWriter(body)
- writer.WriteField("source", "local")
- part, err := writer.CreateFormFile("avatar", "avatar-for-testuseravatar.png")
- if err != nil {
- assert.NoError(t, err)
- return
- }
+ // Setup multi-part
+ writer := multipart.NewWriter(body)
+ writer.WriteField("source", "local")
+ part, err := writer.CreateFormFile("avatar", "avatar-for-testuseravatar.png")
+ if err != nil {
+ assert.NoError(t, err)
+ return
+ }
- if err := png.Encode(imgData, img); err != nil {
- assert.NoError(t, err)
- return
- }
+ if err := png.Encode(imgData, img); err != nil {
+ assert.NoError(t, err)
+ return
+ }
- if _, err := io.Copy(part, imgData); err != nil {
- assert.NoError(t, err)
- return
- }
+ if _, err := io.Copy(part, imgData); err != nil {
+ assert.NoError(t, err)
+ return
+ }
- if err := writer.Close(); err != nil {
- assert.NoError(t, err)
- return
- }
+ if err := writer.Close(); err != nil {
+ assert.NoError(t, err)
+ return
+ }
- req := NewRequestWithBody(t, "POST", "/user/settings/avatar", body)
- req.Header.Add("X-Csrf-Token", csrf)
- req.Header.Add("Content-Type", writer.FormDataContentType())
+ req := NewRequestWithBody(t, "POST", "/user/settings/avatar", body)
+ req.Header.Add("X-Csrf-Token", csrf)
+ req.Header.Add("Content-Type", writer.FormDataContentType())
- session.MakeRequest(t, req, http.StatusSeeOther)
+ session.MakeRequest(t, req, http.StatusSeeOther)
- user2 = unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2}) // owner of the repo3, is an org
+ user2 = unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2}) // owner of the repo3, is an org
- req = NewRequest(t, "GET", user2.AvatarLinkWithSize(db.DefaultContext, 0))
- _ = session.MakeRequest(t, req, http.StatusOK)
+ req = NewRequest(t, "GET", user2.AvatarLinkWithSize(db.DefaultContext, 0))
+ _ = session.MakeRequest(t, req, http.StatusOK)
- testGetAvatarRedirect(t, user2)
+ testGetAvatarRedirect(t, user2)
- // Can't test if the response matches because the image is re-generated on upload but checking that this at least doesn't give a 404 should be enough.
- })
+ // Can't test if the response matches because the image is re-generated on upload but checking that this at least doesn't give a 404 should be enough.
}
func testGetAvatarRedirect(t *testing.T, user *user_model.User) {
diff --git a/tools/generate-svg-vscode-extensions.json b/tools/generate-svg-vscode-extensions.json
new file mode 100644
index 0000000000..b258d3f1a5
--- /dev/null
+++ b/tools/generate-svg-vscode-extensions.json
@@ -0,0 +1,570 @@
+{
+ "pkg:bat": {
+ "bat": [
+ ".bat",
+ ".cmd"
+ ]
+ },
+ "pkg:clojure": {
+ "clojure": [
+ ".clj",
+ ".cljs",
+ ".cljc",
+ ".cljx",
+ ".clojure",
+ ".edn"
+ ]
+ },
+ "pkg:coffeescript": {
+ "coffeescript": [
+ ".coffee",
+ ".cson",
+ ".iced"
+ ]
+ },
+ "pkg:configuration-editing": {
+ "jsonc": [
+ ".code-workspace",
+ "language-configuration.json",
+ "icon-theme.json",
+ "color-theme.json"
+ ],
+ "json": [
+ ".code-profile"
+ ]
+ },
+ "pkg:cpp": {
+ "c": [
+ ".c",
+ ".i"
+ ],
+ "cpp": [
+ ".cpp",
+ ".cppm",
+ ".cc",
+ ".ccm",
+ ".cxx",
+ ".cxxm",
+ ".c++",
+ ".c++m",
+ ".hpp",
+ ".hh",
+ ".hxx",
+ ".h++",
+ ".h",
+ ".ii",
+ ".ino",
+ ".inl",
+ ".ipp",
+ ".ixx",
+ ".tpp",
+ ".txx",
+ ".hpp.in",
+ ".h.in"
+ ],
+ "cuda-cpp": [
+ ".cu",
+ ".cuh"
+ ]
+ },
+ "pkg:csharp": {
+ "csharp": [
+ ".cs",
+ ".csx",
+ ".cake"
+ ]
+ },
+ "pkg:css": {
+ "css": [
+ ".css"
+ ]
+ },
+ "pkg:dart": {
+ "dart": [
+ ".dart"
+ ]
+ },
+ "pkg:diff": {
+ "diff": [
+ ".diff",
+ ".patch",
+ ".rej"
+ ]
+ },
+ "pkg:docker": {
+ "dockerfile": [
+ ".dockerfile",
+ ".containerfile"
+ ]
+ },
+ "pkg:fsharp": {
+ "fsharp": [
+ ".fs",
+ ".fsi",
+ ".fsx",
+ ".fsscript"
+ ]
+ },
+ "pkg:git-base": {
+ "ignore": [
+ ".gitignore_global",
+ ".gitignore",
+ ".git-blame-ignore-revs"
+ ]
+ },
+ "pkg:go": {
+ "go": [
+ ".go"
+ ]
+ },
+ "pkg:groovy": {
+ "groovy": [
+ ".groovy",
+ ".gvy",
+ ".gradle",
+ ".jenkinsfile",
+ ".nf"
+ ]
+ },
+ "pkg:handlebars": {
+ "handlebars": [
+ ".handlebars",
+ ".hbs",
+ ".hjs"
+ ]
+ },
+ "pkg:hlsl": {
+ "hlsl": [
+ ".hlsl",
+ ".hlsli",
+ ".fx",
+ ".fxh",
+ ".vsh",
+ ".psh",
+ ".cginc",
+ ".compute"
+ ]
+ },
+ "pkg:html": {
+ "html": [
+ ".html",
+ ".htm",
+ ".shtml",
+ ".xhtml",
+ ".xht",
+ ".mdoc",
+ ".jsp",
+ ".asp",
+ ".aspx",
+ ".jshtm",
+ ".volt",
+ ".ejs",
+ ".rhtml"
+ ]
+ },
+ "pkg:ini": {
+ "ini": [
+ ".ini"
+ ],
+ "properties": [
+ ".conf",
+ ".properties",
+ ".cfg",
+ ".directory",
+ ".gitattributes",
+ ".gitconfig",
+ ".gitmodules",
+ ".editorconfig",
+ ".repo"
+ ]
+ },
+ "pkg:java": {
+ "java": [
+ ".java",
+ ".jav"
+ ]
+ },
+ "pkg:javascript": {
+ "javascriptreact": [
+ ".jsx"
+ ],
+ "javascript": [
+ ".js",
+ ".es6",
+ ".mjs",
+ ".cjs",
+ ".pac"
+ ]
+ },
+ "pkg:json": {
+ "json": [
+ ".json",
+ ".bowerrc",
+ ".jscsrc",
+ ".webmanifest",
+ ".js.map",
+ ".css.map",
+ ".ts.map",
+ ".har",
+ ".jslintrc",
+ ".jsonld",
+ ".geojson",
+ ".ipynb",
+ ".vuerc"
+ ],
+ "jsonc": [
+ ".jsonc",
+ ".eslintrc",
+ ".eslintrc.json",
+ ".jsfmtrc",
+ ".jshintrc",
+ ".swcrc",
+ ".hintrc",
+ ".babelrc"
+ ],
+ "jsonl": [
+ ".jsonl",
+ ".ndjson"
+ ],
+ "snippets": [
+ ".code-snippets"
+ ]
+ },
+ "pkg:julia": {
+ "julia": [
+ ".jl"
+ ],
+ "juliamarkdown": [
+ ".jmd"
+ ]
+ },
+ "pkg:latex": {
+ "tex": [
+ ".sty",
+ ".cls",
+ ".bbx",
+ ".cbx"
+ ],
+ "latex": [
+ ".tex",
+ ".ltx",
+ ".ctx"
+ ],
+ "bibtex": [
+ ".bib"
+ ]
+ },
+ "pkg:less": {
+ "less": [
+ ".less"
+ ]
+ },
+ "pkg:log": {
+ "log": [
+ ".log",
+ "*.log.?"
+ ]
+ },
+ "pkg:lua": {
+ "lua": [
+ ".lua"
+ ]
+ },
+ "pkg:make": {
+ "makefile": [
+ ".mak",
+ ".mk"
+ ]
+ },
+ "pkg:markdown-basics": {
+ "markdown": [
+ ".md",
+ ".mkd",
+ ".mdwn",
+ ".mdown",
+ ".markdown",
+ ".markdn",
+ ".mdtxt",
+ ".mdtext",
+ ".workbook"
+ ]
+ },
+ "pkg:ms-vscode.js-debug": {
+ "wat": [
+ ".wat",
+ ".wasm"
+ ]
+ },
+ "pkg:npm": {
+ "ignore": [
+ ".npmignore"
+ ],
+ "properties": [
+ ".npmrc"
+ ]
+ },
+ "pkg:objective-c": {
+ "objective-c": [
+ ".m"
+ ],
+ "objective-cpp": [
+ ".mm"
+ ]
+ },
+ "pkg:perl": {
+ "perl": [
+ ".pl",
+ ".pm",
+ ".pod",
+ ".t",
+ ".PL",
+ ".psgi"
+ ],
+ "raku": [
+ ".raku",
+ ".rakumod",
+ ".rakutest",
+ ".rakudoc",
+ ".nqp",
+ ".p6",
+ ".pl6",
+ ".pm6"
+ ]
+ },
+ "pkg:php": {
+ "php": [
+ ".php",
+ ".php4",
+ ".php5",
+ ".phtml",
+ ".ctp"
+ ]
+ },
+ "pkg:powershell": {
+ "powershell": [
+ ".ps1",
+ ".psm1",
+ ".psd1",
+ ".pssc",
+ ".psrc"
+ ]
+ },
+ "pkg:pug": {
+ "jade": [
+ ".pug",
+ ".jade"
+ ]
+ },
+ "pkg:python": {
+ "python": [
+ ".py",
+ ".rpy",
+ ".pyw",
+ ".cpy",
+ ".gyp",
+ ".gypi",
+ ".pyi",
+ ".ipy",
+ ".pyt"
+ ]
+ },
+ "pkg:r": {
+ "r": [
+ ".r",
+ ".rhistory",
+ ".rprofile",
+ ".rt"
+ ]
+ },
+ "pkg:razor": {
+ "razor": [
+ ".cshtml",
+ ".razor"
+ ]
+ },
+ "pkg:restructuredtext": {
+ "restructuredtext": [
+ ".rst"
+ ]
+ },
+ "pkg:ruby": {
+ "ruby": [
+ ".rb",
+ ".rbx",
+ ".rjs",
+ ".gemspec",
+ ".rake",
+ ".ru",
+ ".erb",
+ ".podspec",
+ ".rbi"
+ ]
+ },
+ "pkg:rust": {
+ "rust": [
+ ".rs"
+ ]
+ },
+ "pkg:scss": {
+ "scss": [
+ ".scss"
+ ]
+ },
+ "pkg:search-result": {
+ "search-result": [
+ ".code-search"
+ ]
+ },
+ "pkg:shaderlab": {
+ "shaderlab": [
+ ".shader"
+ ]
+ },
+ "pkg:shellscript": {
+ "shellscript": [
+ ".sh",
+ ".bash",
+ ".bashrc",
+ ".bash_aliases",
+ ".bash_profile",
+ ".bash_login",
+ ".ebuild",
+ ".eclass",
+ ".profile",
+ ".bash_logout",
+ ".xprofile",
+ ".xsession",
+ ".xsessionrc",
+ ".Xsession",
+ ".zsh",
+ ".zshrc",
+ ".zprofile",
+ ".zlogin",
+ ".zlogout",
+ ".zshenv",
+ ".zsh-theme",
+ ".fish",
+ ".ksh",
+ ".csh",
+ ".cshrc",
+ ".tcshrc",
+ ".yashrc",
+ ".yash_profile"
+ ]
+ },
+ "pkg:sql": {
+ "sql": [
+ ".sql",
+ ".dsql"
+ ]
+ },
+ "pkg:swift": {
+ "swift": [
+ ".swift"
+ ]
+ },
+ "pkg:typescript-basics": {
+ "typescript": [
+ ".ts",
+ ".cts",
+ ".mts"
+ ],
+ "typescriptreact": [
+ ".tsx"
+ ],
+ "json": [
+ ".tsbuildinfo"
+ ]
+ },
+ "pkg:vb": {
+ "vb": [
+ ".vb",
+ ".brs",
+ ".vbs",
+ ".bas",
+ ".vba"
+ ]
+ },
+ "pkg:xml": {
+ "xml": [
+ ".xml",
+ ".xsd",
+ ".ascx",
+ ".atom",
+ ".axml",
+ ".axaml",
+ ".bpmn",
+ ".cpt",
+ ".csl",
+ ".csproj",
+ ".csproj.user",
+ ".dita",
+ ".ditamap",
+ ".dtd",
+ ".ent",
+ ".mod",
+ ".dtml",
+ ".fsproj",
+ ".fxml",
+ ".iml",
+ ".isml",
+ ".jmx",
+ ".launch",
+ ".menu",
+ ".mxml",
+ ".nuspec",
+ ".opml",
+ ".owl",
+ ".proj",
+ ".props",
+ ".pt",
+ ".publishsettings",
+ ".pubxml",
+ ".pubxml.user",
+ ".rbxlx",
+ ".rbxmx",
+ ".rdf",
+ ".rng",
+ ".rss",
+ ".shproj",
+ ".storyboard",
+ ".svg",
+ ".targets",
+ ".tld",
+ ".tmx",
+ ".vbproj",
+ ".vbproj.user",
+ ".vcxproj",
+ ".vcxproj.filters",
+ ".wsdl",
+ ".wxi",
+ ".wxl",
+ ".wxs",
+ ".xaml",
+ ".xbl",
+ ".xib",
+ ".xlf",
+ ".xliff",
+ ".xpdl",
+ ".xul",
+ ".xoml"
+ ],
+ "xsl": [
+ ".xsl",
+ ".xslt"
+ ]
+ },
+ "pkg:yaml": {
+ "yaml": [
+ ".yaml",
+ ".yml",
+ ".eyaml",
+ ".eyml",
+ ".cff",
+ ".yaml-tmlanguage",
+ ".yaml-tmpreferences",
+ ".yaml-tmtheme",
+ ".winget"
+ ]
+ }
+}
diff --git a/tools/generate-svg.js b/tools/generate-svg.js
index 7368392d01..ec04bf655e 100755
--- a/tools/generate-svg.js
+++ b/tools/generate-svg.js
@@ -63,17 +63,32 @@ async function processMaterialFileIcons() {
}
fs.writeFileSync(fileURLToPath(new URL(`../options/fileicon/material-icon-svgs.json`, import.meta.url)), JSON.stringify(svgSymbols, null, 2));
+ const vscodeExtensionsJson = await readFile(fileURLToPath(new URL(`generate-svg-vscode-extensions.json`, import.meta.url)));
+ const vscodeExtensions = JSON.parse(vscodeExtensionsJson);
const iconRulesJson = await readFile(fileURLToPath(new URL(`../node_modules/material-icon-theme/dist/material-icons.json`, import.meta.url)));
const iconRules = JSON.parse(iconRulesJson);
// The rules are from VSCode material-icon-theme, we need to adjust them to our needs
// 1. We only use lowercase filenames to match (it should be good enough for most cases and more efficient)
- // 2. We do not have a "Language ID" system: https://code.visualstudio.com/docs/languages/identifiers#_known-language-identifiers
- // * So we just treat the "Language ID" as file extension, it is not always true, but it is good enough for most cases.
+ // 2. We do not have a "Language ID" system:
+ // * https://code.visualstudio.com/docs/languages/identifiers#_known-language-identifiers
+ // * https://github.com/microsoft/vscode/tree/1.98.0/extensions
delete iconRules.iconDefinitions;
for (const [k, v] of Object.entries(iconRules.fileNames)) iconRules.fileNames[k.toLowerCase()] = v;
for (const [k, v] of Object.entries(iconRules.folderNames)) iconRules.folderNames[k.toLowerCase()] = v;
for (const [k, v] of Object.entries(iconRules.fileExtensions)) iconRules.fileExtensions[k.toLowerCase()] = v;
- for (const [k, v] of Object.entries(iconRules.languageIds)) iconRules.fileExtensions[k.toLowerCase()] = v;
+ // Use VSCode's "Language ID" mapping from its extensions
+ for (const [_, langIdExtMap] of Object.entries(vscodeExtensions)) {
+ for (const [langId, names] of Object.entries(langIdExtMap)) {
+ for (const name of names) {
+ const nameLower = name.toLowerCase();
+ if (nameLower[0] === '.') {
+ iconRules.fileExtensions[nameLower.substring(1)] ??= langId;
+ } else {
+ iconRules.fileNames[nameLower] ??= langId;
+ }
+ }
+ }
+ }
const iconRulesPretty = JSON.stringify(iconRules, null, 2);
fs.writeFileSync(fileURLToPath(new URL(`../options/fileicon/material-icon-rules.json`, import.meta.url)), iconRulesPretty);
}
diff --git a/web_src/css/form.css b/web_src/css/form.css
index 4410dc64a9..cf8fe96bea 100644
--- a/web_src/css/form.css
+++ b/web_src/css/form.css
@@ -273,6 +273,10 @@ textarea:focus,
width: 50%;
}
+.ui.form.left-right-form .inline.field .ui.dropdown input.search {
+ width: 100%;
+}
+
.ui.form.left-right-form .inline.field .inline-right {
display: inline-flex;
flex-direction: column;
diff --git a/web_src/css/index.css b/web_src/css/index.css
index 630aa3c2ef..84795d6d27 100644
--- a/web_src/css/index.css
+++ b/web_src/css/index.css
@@ -18,6 +18,7 @@
@import "./modules/checkbox.css";
@import "./modules/dimmer.css";
@import "./modules/modal.css";
+@import "./modules/tab.css";
@import "./modules/tippy.css";
@import "./modules/breadcrumb.css";
diff --git a/web_src/css/modules/tab.css b/web_src/css/modules/tab.css
new file mode 100644
index 0000000000..63c83179b2
--- /dev/null
+++ b/web_src/css/modules/tab.css
@@ -0,0 +1,7 @@
+.ui.tab {
+ display: none;
+}
+
+.ui.tab.active {
+ display: block;
+}
diff --git a/web_src/fomantic/.npmrc b/web_src/fomantic/.npmrc
deleted file mode 100644
index fbacc988dc..0000000000
--- a/web_src/fomantic/.npmrc
+++ /dev/null
@@ -1,7 +0,0 @@
-audit=false
-fund=false
-update-notifier=false
-package-lock=true
-save-exact=true
-lockfile-version=3
-optional=false
diff --git a/web_src/fomantic/build/components/api.js b/web_src/fomantic/build/components/api.js
new file mode 100644
index 0000000000..845046b0d5
--- /dev/null
+++ b/web_src/fomantic/build/components/api.js
@@ -0,0 +1,1177 @@
+/*!
+ * # Fomantic-UI - API
+ * http://github.com/fomantic/Fomantic-UI/
+ *
+ *
+ * Released under the MIT license
+ * http://opensource.org/licenses/MIT
+ *
+ */
+
+;(function ($, window, document, undefined) {
+
+'use strict';
+
+$.isWindow = $.isWindow || function(obj) {
+ return obj != null && obj === obj.window;
+};
+
+ window = (typeof window != 'undefined' && window.Math == Math)
+ ? window
+ : (typeof self != 'undefined' && self.Math == Math)
+ ? self
+ : Function('return this')()
+;
+
+$.api = $.fn.api = function(parameters) {
+
+ var
+ // use window context if none specified
+ $allModules = $.isFunction(this)
+ ? $(window)
+ : $(this),
+ moduleSelector = $allModules.selector || '',
+ time = new Date().getTime(),
+ performance = [],
+
+ query = arguments[0],
+ methodInvoked = (typeof query == 'string'),
+ queryArguments = [].slice.call(arguments, 1),
+
+ returnedValue
+ ;
+
+ $allModules
+ .each(function() {
+ var
+ settings = ( $.isPlainObject(parameters) )
+ ? $.extend(true, {}, $.fn.api.settings, parameters)
+ : $.extend({}, $.fn.api.settings),
+
+ // internal aliases
+ namespace = settings.namespace,
+ metadata = settings.metadata,
+ selector = settings.selector,
+ error = settings.error,
+ className = settings.className,
+
+ // define namespaces for modules
+ eventNamespace = '.' + namespace,
+ moduleNamespace = 'module-' + namespace,
+
+ // element that creates request
+ $module = $(this),
+ $form = $module.closest(selector.form),
+
+ // context used for state
+ $context = (settings.stateContext)
+ ? $(settings.stateContext)
+ : $module,
+
+ // request details
+ ajaxSettings,
+ requestSettings,
+ url,
+ data,
+ requestStartTime,
+
+ // standard module
+ element = this,
+ context = $context[0],
+ instance = $module.data(moduleNamespace),
+ module
+ ;
+
+ module = {
+
+ initialize: function() {
+ if(!methodInvoked) {
+ module.bind.events();
+ }
+ module.instantiate();
+ },
+
+ instantiate: function() {
+ module.verbose('Storing instance of module', module);
+ instance = module;
+ $module
+ .data(moduleNamespace, instance)
+ ;
+ },
+
+ destroy: function() {
+ module.verbose('Destroying previous module for', element);
+ $module
+ .removeData(moduleNamespace)
+ .off(eventNamespace)
+ ;
+ },
+
+ bind: {
+ events: function() {
+ var
+ triggerEvent = module.get.event()
+ ;
+ if( triggerEvent ) {
+ module.verbose('Attaching API events to element', triggerEvent);
+ $module
+ .on(triggerEvent + eventNamespace, module.event.trigger)
+ ;
+ }
+ else if(settings.on == 'now') {
+ module.debug('Querying API endpoint immediately');
+ module.query();
+ }
+ }
+ },
+
+ decode: {
+ json: function(response) {
+ if(response !== undefined && typeof response == 'string') {
+ try {
+ response = JSON.parse(response);
+ }
+ catch(e) {
+ // isnt json string
+ }
+ }
+ return response;
+ }
+ },
+
+ read: {
+ cachedResponse: function(url) {
+ var
+ response
+ ;
+ if(window.Storage === undefined) {
+ module.error(error.noStorage);
+ return;
+ }
+ response = sessionStorage.getItem(url);
+ module.debug('Using cached response', url, response);
+ response = module.decode.json(response);
+ return response;
+ }
+ },
+ write: {
+ cachedResponse: function(url, response) {
+ if(response && response === '') {
+ module.debug('Response empty, not caching', response);
+ return;
+ }
+ if(window.Storage === undefined) {
+ module.error(error.noStorage);
+ return;
+ }
+ if( $.isPlainObject(response) ) {
+ response = JSON.stringify(response);
+ }
+ sessionStorage.setItem(url, response);
+ module.verbose('Storing cached response for url', url, response);
+ }
+ },
+
+ query: function() {
+
+ if(module.is.disabled()) {
+ module.debug('Element is disabled API request aborted');
+ return;
+ }
+
+ if(module.is.loading()) {
+ if(settings.interruptRequests) {
+ module.debug('Interrupting previous request');
+ module.abort();
+ }
+ else {
+ module.debug('Cancelling request, previous request is still pending');
+ return;
+ }
+ }
+
+ // pass element metadata to url (value, text)
+ if(settings.defaultData) {
+ $.extend(true, settings.urlData, module.get.defaultData());
+ }
+
+ // Add form content
+ if(settings.serializeForm) {
+ settings.data = module.add.formData(settings.data);
+ }
+
+ // call beforesend and get any settings changes
+ requestSettings = module.get.settings();
+
+ // check if before send cancelled request
+ if(requestSettings === false) {
+ module.cancelled = true;
+ module.error(error.beforeSend);
+ return;
+ }
+ else {
+ module.cancelled = false;
+ }
+
+ // get url
+ url = module.get.templatedURL();
+
+ if(!url && !module.is.mocked()) {
+ module.error(error.missingURL);
+ return;
+ }
+
+ // replace variables
+ url = module.add.urlData( url );
+ // missing url parameters
+ if( !url && !module.is.mocked()) {
+ return;
+ }
+
+ requestSettings.url = settings.base + url;
+
+ // look for jQuery ajax parameters in settings
+ ajaxSettings = $.extend(true, {}, settings, {
+ type : settings.method || settings.type,
+ data : data,
+ url : settings.base + url,
+ beforeSend : settings.beforeXHR,
+ success : function() {},
+ failure : function() {},
+ complete : function() {}
+ });
+
+ module.debug('Querying URL', ajaxSettings.url);
+ module.verbose('Using AJAX settings', ajaxSettings);
+ if(settings.cache === 'local' && module.read.cachedResponse(url)) {
+ module.debug('Response returned from local cache');
+ module.request = module.create.request();
+ module.request.resolveWith(context, [ module.read.cachedResponse(url) ]);
+ return;
+ }
+
+ if( !settings.throttle ) {
+ module.debug('Sending request', data, ajaxSettings.method);
+ module.send.request();
+ }
+ else {
+ if(!settings.throttleFirstRequest && !module.timer) {
+ module.debug('Sending request', data, ajaxSettings.method);
+ module.send.request();
+ module.timer = setTimeout(function(){}, settings.throttle);
+ }
+ else {
+ module.debug('Throttling request', settings.throttle);
+ clearTimeout(module.timer);
+ module.timer = setTimeout(function() {
+ if(module.timer) {
+ delete module.timer;
+ }
+ module.debug('Sending throttled request', data, ajaxSettings.method);
+ module.send.request();
+ }, settings.throttle);
+ }
+ }
+
+ },
+
+ should: {
+ removeError: function() {
+ return ( settings.hideError === true || (settings.hideError === 'auto' && !module.is.form()) );
+ }
+ },
+
+ is: {
+ disabled: function() {
+ return ($module.filter(selector.disabled).length > 0);
+ },
+ expectingJSON: function() {
+ return settings.dataType === 'json' || settings.dataType === 'jsonp';
+ },
+ form: function() {
+ return $module.is('form') || $context.is('form');
+ },
+ mocked: function() {
+ return (settings.mockResponse || settings.mockResponseAsync || settings.response || settings.responseAsync);
+ },
+ input: function() {
+ return $module.is('input');
+ },
+ loading: function() {
+ return (module.request)
+ ? (module.request.state() == 'pending')
+ : false
+ ;
+ },
+ abortedRequest: function(xhr) {
+ if(xhr && xhr.readyState !== undefined && xhr.readyState === 0) {
+ module.verbose('XHR request determined to be aborted');
+ return true;
+ }
+ else {
+ module.verbose('XHR request was not aborted');
+ return false;
+ }
+ },
+ validResponse: function(response) {
+ if( (!module.is.expectingJSON()) || !$.isFunction(settings.successTest) ) {
+ module.verbose('Response is not JSON, skipping validation', settings.successTest, response);
+ return true;
+ }
+ module.debug('Checking JSON returned success', settings.successTest, response);
+ if( settings.successTest(response) ) {
+ module.debug('Response passed success test', response);
+ return true;
+ }
+ else {
+ module.debug('Response failed success test', response);
+ return false;
+ }
+ }
+ },
+
+ was: {
+ cancelled: function() {
+ return (module.cancelled || false);
+ },
+ succesful: function() {
+ module.verbose('This behavior will be deleted due to typo. Use "was successful" instead.');
+ return module.was.successful();
+ },
+ successful: function() {
+ return (module.request && module.request.state() == 'resolved');
+ },
+ failure: function() {
+ return (module.request && module.request.state() == 'rejected');
+ },
+ complete: function() {
+ return (module.request && (module.request.state() == 'resolved' || module.request.state() == 'rejected') );
+ }
+ },
+
+ add: {
+ urlData: function(url, urlData) {
+ var
+ requiredVariables,
+ optionalVariables
+ ;
+ if(url) {
+ requiredVariables = url.match(settings.regExp.required);
+ optionalVariables = url.match(settings.regExp.optional);
+ urlData = urlData || settings.urlData;
+ if(requiredVariables) {
+ module.debug('Looking for required URL variables', requiredVariables);
+ $.each(requiredVariables, function(index, templatedString) {
+ var
+ // allow legacy {$var} style
+ variable = (templatedString.indexOf('$') !== -1)
+ ? templatedString.substr(2, templatedString.length - 3)
+ : templatedString.substr(1, templatedString.length - 2),
+ value = ($.isPlainObject(urlData) && urlData[variable] !== undefined)
+ ? urlData[variable]
+ : ($module.data(variable) !== undefined)
+ ? $module.data(variable)
+ : ($context.data(variable) !== undefined)
+ ? $context.data(variable)
+ : urlData[variable]
+ ;
+ // remove value
+ if(value === undefined) {
+ module.error(error.requiredParameter, variable, url);
+ url = false;
+ return false;
+ }
+ else {
+ module.verbose('Found required variable', variable, value);
+ value = (settings.encodeParameters)
+ ? module.get.urlEncodedValue(value)
+ : value
+ ;
+ url = url.replace(templatedString, value);
+ }
+ });
+ }
+ if(optionalVariables) {
+ module.debug('Looking for optional URL variables', requiredVariables);
+ $.each(optionalVariables, function(index, templatedString) {
+ var
+ // allow legacy {/$var} style
+ variable = (templatedString.indexOf('$') !== -1)
+ ? templatedString.substr(3, templatedString.length - 4)
+ : templatedString.substr(2, templatedString.length - 3),
+ value = ($.isPlainObject(urlData) && urlData[variable] !== undefined)
+ ? urlData[variable]
+ : ($module.data(variable) !== undefined)
+ ? $module.data(variable)
+ : ($context.data(variable) !== undefined)
+ ? $context.data(variable)
+ : urlData[variable]
+ ;
+ // optional replacement
+ if(value !== undefined) {
+ module.verbose('Optional variable Found', variable, value);
+ url = url.replace(templatedString, value);
+ }
+ else {
+ module.verbose('Optional variable not found', variable);
+ // remove preceding slash if set
+ if(url.indexOf('/' + templatedString) !== -1) {
+ url = url.replace('/' + templatedString, '');
+ }
+ else {
+ url = url.replace(templatedString, '');
+ }
+ }
+ });
+ }
+ }
+ return url;
+ },
+ formData: function(data) {
+ var
+ canSerialize = ($.fn.serializeObject !== undefined),
+ formData = (canSerialize)
+ ? $form.serializeObject()
+ : $form.serialize(),
+ hasOtherData
+ ;
+ data = data || settings.data;
+ hasOtherData = $.isPlainObject(data);
+
+ if(hasOtherData) {
+ if(canSerialize) {
+ module.debug('Extending existing data with form data', data, formData);
+ data = $.extend(true, {}, data, formData);
+ }
+ else {
+ module.error(error.missingSerialize);
+ module.debug('Cant extend data. Replacing data with form data', data, formData);
+ data = formData;
+ }
+ }
+ else {
+ module.debug('Adding form data', formData);
+ data = formData;
+ }
+ return data;
+ }
+ },
+
+ send: {
+ request: function() {
+ module.set.loading();
+ module.request = module.create.request();
+ if( module.is.mocked() ) {
+ module.mockedXHR = module.create.mockedXHR();
+ }
+ else {
+ module.xhr = module.create.xhr();
+ }
+ settings.onRequest.call(context, module.request, module.xhr);
+ }
+ },
+
+ event: {
+ trigger: function(event) {
+ module.query();
+ if(event.type == 'submit' || event.type == 'click') {
+ event.preventDefault();
+ }
+ },
+ xhr: {
+ always: function() {
+ // nothing special
+ },
+ done: function(response, textStatus, xhr) {
+ var
+ context = this,
+ elapsedTime = (new Date().getTime() - requestStartTime),
+ timeLeft = (settings.loadingDuration - elapsedTime),
+ translatedResponse = ( $.isFunction(settings.onResponse) )
+ ? module.is.expectingJSON() && !settings.rawResponse
+ ? settings.onResponse.call(context, $.extend(true, {}, response))
+ : settings.onResponse.call(context, response)
+ : false
+ ;
+ timeLeft = (timeLeft > 0)
+ ? timeLeft
+ : 0
+ ;
+ if(translatedResponse) {
+ module.debug('Modified API response in onResponse callback', settings.onResponse, translatedResponse, response);
+ response = translatedResponse;
+ }
+ if(timeLeft > 0) {
+ module.debug('Response completed early delaying state change by', timeLeft);
+ }
+ setTimeout(function() {
+ if( module.is.validResponse(response) ) {
+ module.request.resolveWith(context, [response, xhr]);
+ }
+ else {
+ module.request.rejectWith(context, [xhr, 'invalid']);
+ }
+ }, timeLeft);
+ },
+ fail: function(xhr, status, httpMessage) {
+ var
+ context = this,
+ elapsedTime = (new Date().getTime() - requestStartTime),
+ timeLeft = (settings.loadingDuration - elapsedTime)
+ ;
+ timeLeft = (timeLeft > 0)
+ ? timeLeft
+ : 0
+ ;
+ if(timeLeft > 0) {
+ module.debug('Response completed early delaying state change by', timeLeft);
+ }
+ setTimeout(function() {
+ if( module.is.abortedRequest(xhr) ) {
+ module.request.rejectWith(context, [xhr, 'aborted', httpMessage]);
+ }
+ else {
+ module.request.rejectWith(context, [xhr, 'error', status, httpMessage]);
+ }
+ }, timeLeft);
+ }
+ },
+ request: {
+ done: function(response, xhr) {
+ module.debug('Successful API Response', response);
+ if(settings.cache === 'local' && url) {
+ module.write.cachedResponse(url, response);
+ module.debug('Saving server response locally', module.cache);
+ }
+ settings.onSuccess.call(context, response, $module, xhr);
+ },
+ complete: function(firstParameter, secondParameter) {
+ var
+ xhr,
+ response
+ ;
+ // have to guess callback parameters based on request success
+ if( module.was.successful() ) {
+ response = firstParameter;
+ xhr = secondParameter;
+ }
+ else {
+ xhr = firstParameter;
+ response = module.get.responseFromXHR(xhr);
+ }
+ module.remove.loading();
+ settings.onComplete.call(context, response, $module, xhr);
+ },
+ fail: function(xhr, status, httpMessage) {
+ var
+ // pull response from xhr if available
+ response = module.get.responseFromXHR(xhr),
+ errorMessage = module.get.errorFromRequest(response, status, httpMessage)
+ ;
+ if(status == 'aborted') {
+ module.debug('XHR Aborted (Most likely caused by page navigation or CORS Policy)', status, httpMessage);
+ settings.onAbort.call(context, status, $module, xhr);
+ return true;
+ }
+ else if(status == 'invalid') {
+ module.debug('JSON did not pass success test. A server-side error has most likely occurred', response);
+ }
+ else if(status == 'error') {
+ if(xhr !== undefined) {
+ module.debug('XHR produced a server error', status, httpMessage);
+ // make sure we have an error to display to console
+ if( (xhr.status < 200 || xhr.status >= 300) && httpMessage !== undefined && httpMessage !== '') {
+ module.error(error.statusMessage + httpMessage, ajaxSettings.url);
+ }
+ settings.onError.call(context, errorMessage, $module, xhr);
+ }
+ }
+
+ if(settings.errorDuration && status !== 'aborted') {
+ module.debug('Adding error state');
+ module.set.error();
+ if( module.should.removeError() ) {
+ setTimeout(module.remove.error, settings.errorDuration);
+ }
+ }
+ module.debug('API Request failed', errorMessage, xhr);
+ settings.onFailure.call(context, response, $module, xhr);
+ }
+ }
+ },
+
+ create: {
+
+ request: function() {
+ // api request promise
+ return $.Deferred()
+ .always(module.event.request.complete)
+ .done(module.event.request.done)
+ .fail(module.event.request.fail)
+ ;
+ },
+
+ mockedXHR: function () {
+ var
+ // xhr does not simulate these properties of xhr but must return them
+ textStatus = false,
+ status = false,
+ httpMessage = false,
+ responder = settings.mockResponse || settings.response,
+ asyncResponder = settings.mockResponseAsync || settings.responseAsync,
+ asyncCallback,
+ response,
+ mockedXHR
+ ;
+
+ mockedXHR = $.Deferred()
+ .always(module.event.xhr.complete)
+ .done(module.event.xhr.done)
+ .fail(module.event.xhr.fail)
+ ;
+
+ if(responder) {
+ if( $.isFunction(responder) ) {
+ module.debug('Using specified synchronous callback', responder);
+ response = responder.call(context, requestSettings);
+ }
+ else {
+ module.debug('Using settings specified response', responder);
+ response = responder;
+ }
+ // simulating response
+ mockedXHR.resolveWith(context, [ response, textStatus, { responseText: response }]);
+ }
+ else if( $.isFunction(asyncResponder) ) {
+ asyncCallback = function(response) {
+ module.debug('Async callback returned response', response);
+
+ if(response) {
+ mockedXHR.resolveWith(context, [ response, textStatus, { responseText: response }]);
+ }
+ else {
+ mockedXHR.rejectWith(context, [{ responseText: response }, status, httpMessage]);
+ }
+ };
+ module.debug('Using specified async response callback', asyncResponder);
+ asyncResponder.call(context, requestSettings, asyncCallback);
+ }
+ return mockedXHR;
+ },
+
+ xhr: function() {
+ var
+ xhr
+ ;
+ // ajax request promise
+ xhr = $.ajax(ajaxSettings)
+ .always(module.event.xhr.always)
+ .done(module.event.xhr.done)
+ .fail(module.event.xhr.fail)
+ ;
+ module.verbose('Created server request', xhr, ajaxSettings);
+ return xhr;
+ }
+ },
+
+ set: {
+ error: function() {
+ module.verbose('Adding error state to element', $context);
+ $context.addClass(className.error);
+ },
+ loading: function() {
+ module.verbose('Adding loading state to element', $context);
+ $context.addClass(className.loading);
+ requestStartTime = new Date().getTime();
+ }
+ },
+
+ remove: {
+ error: function() {
+ module.verbose('Removing error state from element', $context);
+ $context.removeClass(className.error);
+ },
+ loading: function() {
+ module.verbose('Removing loading state from element', $context);
+ $context.removeClass(className.loading);
+ }
+ },
+
+ get: {
+ responseFromXHR: function(xhr) {
+ return $.isPlainObject(xhr)
+ ? (module.is.expectingJSON())
+ ? module.decode.json(xhr.responseText)
+ : xhr.responseText
+ : false
+ ;
+ },
+ errorFromRequest: function(response, status, httpMessage) {
+ return ($.isPlainObject(response) && response.error !== undefined)
+ ? response.error // use json error message
+ : (settings.error[status] !== undefined) // use server error message
+ ? settings.error[status]
+ : httpMessage
+ ;
+ },
+ request: function() {
+ return module.request || false;
+ },
+ xhr: function() {
+ return module.xhr || false;
+ },
+ settings: function() {
+ var
+ runSettings
+ ;
+ runSettings = settings.beforeSend.call($module, settings);
+ if(runSettings) {
+ if(runSettings.success !== undefined) {
+ module.debug('Legacy success callback detected', runSettings);
+ module.error(error.legacyParameters, runSettings.success);
+ runSettings.onSuccess = runSettings.success;
+ }
+ if(runSettings.failure !== undefined) {
+ module.debug('Legacy failure callback detected', runSettings);
+ module.error(error.legacyParameters, runSettings.failure);
+ runSettings.onFailure = runSettings.failure;
+ }
+ if(runSettings.complete !== undefined) {
+ module.debug('Legacy complete callback detected', runSettings);
+ module.error(error.legacyParameters, runSettings.complete);
+ runSettings.onComplete = runSettings.complete;
+ }
+ }
+ if(runSettings === undefined) {
+ module.error(error.noReturnedValue);
+ }
+ if(runSettings === false) {
+ return runSettings;
+ }
+ return (runSettings !== undefined)
+ ? $.extend(true, {}, runSettings)
+ : $.extend(true, {}, settings)
+ ;
+ },
+ urlEncodedValue: function(value) {
+ var
+ decodedValue = window.decodeURIComponent(value),
+ encodedValue = window.encodeURIComponent(value),
+ alreadyEncoded = (decodedValue !== value)
+ ;
+ if(alreadyEncoded) {
+ module.debug('URL value is already encoded, avoiding double encoding', value);
+ return value;
+ }
+ module.verbose('Encoding value using encodeURIComponent', value, encodedValue);
+ return encodedValue;
+ },
+ defaultData: function() {
+ var
+ data = {}
+ ;
+ if( !$.isWindow(element) ) {
+ if( module.is.input() ) {
+ data.value = $module.val();
+ }
+ else if( module.is.form() ) {
+
+ }
+ else {
+ data.text = $module.text();
+ }
+ }
+ return data;
+ },
+ event: function() {
+ if( $.isWindow(element) || settings.on == 'now' ) {
+ module.debug('API called without element, no events attached');
+ return false;
+ }
+ else if(settings.on == 'auto') {
+ if( $module.is('input') ) {
+ return (element.oninput !== undefined)
+ ? 'input'
+ : (element.onpropertychange !== undefined)
+ ? 'propertychange'
+ : 'keyup'
+ ;
+ }
+ else if( $module.is('form') ) {
+ return 'submit';
+ }
+ else {
+ return 'click';
+ }
+ }
+ else {
+ return settings.on;
+ }
+ },
+ templatedURL: function(action) {
+ action = action || $module.data(metadata.action) || settings.action || false;
+ url = $module.data(metadata.url) || settings.url || false;
+ if(url) {
+ module.debug('Using specified url', url);
+ return url;
+ }
+ if(action) {
+ module.debug('Looking up url for action', action, settings.api);
+ if(settings.api[action] === undefined && !module.is.mocked()) {
+ module.error(error.missingAction, settings.action, settings.api);
+ return;
+ }
+ url = settings.api[action];
+ }
+ else if( module.is.form() ) {
+ url = $module.attr('action') || $context.attr('action') || false;
+ module.debug('No url or action specified, defaulting to form action', url);
+ }
+ return url;
+ }
+ },
+
+ abort: function() {
+ var
+ xhr = module.get.xhr()
+ ;
+ if( xhr && xhr.state() !== 'resolved') {
+ module.debug('Cancelling API request');
+ xhr.abort();
+ }
+ },
+
+ // reset state
+ reset: function() {
+ module.remove.error();
+ module.remove.loading();
+ },
+
+ setting: function(name, value) {
+ module.debug('Changing setting', name, value);
+ if( $.isPlainObject(name) ) {
+ $.extend(true, settings, name);
+ }
+ else if(value !== undefined) {
+ if($.isPlainObject(settings[name])) {
+ $.extend(true, settings[name], value);
+ }
+ else {
+ settings[name] = value;
+ }
+ }
+ else {
+ return settings[name];
+ }
+ },
+ internal: function(name, value) {
+ if( $.isPlainObject(name) ) {
+ $.extend(true, module, name);
+ }
+ else if(value !== undefined) {
+ module[name] = value;
+ }
+ else {
+ return module[name];
+ }
+ },
+ debug: function() {
+ if(!settings.silent && settings.debug) {
+ if(settings.performance) {
+ module.performance.log(arguments);
+ }
+ else {
+ module.debug = Function.prototype.bind.call(console.info, console, settings.name + ':');
+ module.debug.apply(console, arguments);
+ }
+ }
+ },
+ verbose: function() {
+ if(!settings.silent && settings.verbose && settings.debug) {
+ if(settings.performance) {
+ module.performance.log(arguments);
+ }
+ else {
+ module.verbose = Function.prototype.bind.call(console.info, console, settings.name + ':');
+ module.verbose.apply(console, arguments);
+ }
+ }
+ },
+ error: function() {
+ if(!settings.silent) {
+ module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
+ module.error.apply(console, arguments);
+ }
+ },
+ performance: {
+ log: function(message) {
+ var
+ currentTime,
+ executionTime,
+ previousTime
+ ;
+ if(settings.performance) {
+ currentTime = new Date().getTime();
+ previousTime = time || currentTime;
+ executionTime = currentTime - previousTime;
+ time = currentTime;
+ performance.push({
+ 'Name' : message[0],
+ 'Arguments' : [].slice.call(message, 1) || '',
+ //'Element' : element,
+ 'Execution Time' : executionTime
+ });
+ }
+ clearTimeout(module.performance.timer);
+ module.performance.timer = setTimeout(module.performance.display, 500);
+ },
+ display: function() {
+ var
+ title = settings.name + ':',
+ totalTime = 0
+ ;
+ time = false;
+ clearTimeout(module.performance.timer);
+ $.each(performance, function(index, data) {
+ totalTime += data['Execution Time'];
+ });
+ title += ' ' + totalTime + 'ms';
+ if(moduleSelector) {
+ title += ' \'' + moduleSelector + '\'';
+ }
+ if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
+ console.groupCollapsed(title);
+ if(console.table) {
+ console.table(performance);
+ }
+ else {
+ $.each(performance, function(index, data) {
+ console.log(data['Name'] + ': ' + data['Execution Time']+'ms');
+ });
+ }
+ console.groupEnd();
+ }
+ performance = [];
+ }
+ },
+ invoke: function(query, passedArguments, context) {
+ var
+ object = instance,
+ maxDepth,
+ found,
+ response
+ ;
+ passedArguments = passedArguments || queryArguments;
+ context = element || context;
+ if(typeof query == 'string' && object !== undefined) {
+ query = query.split(/[\. ]/);
+ maxDepth = query.length - 1;
+ $.each(query, function(depth, value) {
+ var camelCaseValue = (depth != maxDepth)
+ ? value + query[depth + 1].charAt(0).toUpperCase() + query[depth + 1].slice(1)
+ : query
+ ;
+ if( $.isPlainObject( object[camelCaseValue] ) && (depth != maxDepth) ) {
+ object = object[camelCaseValue];
+ }
+ else if( object[camelCaseValue] !== undefined ) {
+ found = object[camelCaseValue];
+ return false;
+ }
+ else if( $.isPlainObject( object[value] ) && (depth != maxDepth) ) {
+ object = object[value];
+ }
+ else if( object[value] !== undefined ) {
+ found = object[value];
+ return false;
+ }
+ else {
+ module.error(error.method, query);
+ return false;
+ }
+ });
+ }
+ if ( $.isFunction( found ) ) {
+ response = found.apply(context, passedArguments);
+ }
+ else if(found !== undefined) {
+ response = found;
+ }
+ if(Array.isArray(returnedValue)) {
+ returnedValue.push(response);
+ }
+ else if(returnedValue !== undefined) {
+ returnedValue = [returnedValue, response];
+ }
+ else if(response !== undefined) {
+ returnedValue = response;
+ }
+ return found;
+ }
+ };
+
+ if(methodInvoked) {
+ if(instance === undefined) {
+ module.initialize();
+ }
+ module.invoke(query);
+ }
+ else {
+ if(instance !== undefined) {
+ instance.invoke('destroy');
+ }
+ module.initialize();
+ }
+ })
+ ;
+
+ return (returnedValue !== undefined)
+ ? returnedValue
+ : this
+ ;
+};
+
+$.api.settings = {
+
+ name : 'API',
+ namespace : 'api',
+
+ debug : false,
+ verbose : false,
+ performance : true,
+
+ // object containing all templates endpoints
+ api : {},
+
+ // whether to cache responses
+ cache : true,
+
+ // whether new requests should abort previous requests
+ interruptRequests : true,
+
+ // event binding
+ on : 'auto',
+
+ // context for applying state classes
+ stateContext : false,
+
+ // duration for loading state
+ loadingDuration : 0,
+
+ // whether to hide errors after a period of time
+ hideError : 'auto',
+
+ // duration for error state
+ errorDuration : 2000,
+
+ // whether parameters should be encoded with encodeURIComponent
+ encodeParameters : true,
+
+ // API action to use
+ action : false,
+
+ // templated URL to use
+ url : false,
+
+ // base URL to apply to all endpoints
+ base : '',
+
+ // data that will
+ urlData : {},
+
+ // whether to add default data to url data
+ defaultData : true,
+
+ // whether to serialize closest form
+ serializeForm : false,
+
+ // how long to wait before request should occur
+ throttle : 0,
+
+ // whether to throttle first request or only repeated
+ throttleFirstRequest : true,
+
+ // standard ajax settings
+ method : 'get',
+ data : {},
+ dataType : 'json',
+
+ // mock response
+ mockResponse : false,
+ mockResponseAsync : false,
+
+ // aliases for mock
+ response : false,
+ responseAsync : false,
+
+// whether onResponse should work with response value without force converting into an object
+ rawResponse : false,
+
+ // callbacks before request
+ beforeSend : function(settings) { return settings; },
+ beforeXHR : function(xhr) {},
+ onRequest : function(promise, xhr) {},
+
+ // after request
+ onResponse : false, // function(response) { },
+
+ // response was successful, if JSON passed validation
+ onSuccess : function(response, $module) {},
+
+ // request finished without aborting
+ onComplete : function(response, $module) {},
+
+ // failed JSON success test
+ onFailure : function(response, $module) {},
+
+ // server error
+ onError : function(errorMessage, $module) {},
+
+ // request aborted
+ onAbort : function(errorMessage, $module) {},
+
+ successTest : false,
+
+ // errors
+ error : {
+ beforeSend : 'The before send function has aborted the request',
+ error : 'There was an error with your request',
+ exitConditions : 'API Request Aborted. Exit conditions met',
+ JSONParse : 'JSON could not be parsed during error handling',
+ legacyParameters : 'You are using legacy API success callback names',
+ method : 'The method you called is not defined',
+ missingAction : 'API action used but no url was defined',
+ missingSerialize : 'jquery-serialize-object is required to add form data to an existing data object',
+ missingURL : 'No URL specified for api event',
+ noReturnedValue : 'The beforeSend callback must return a settings object, beforeSend ignored.',
+ noStorage : 'Caching responses locally requires session storage',
+ parseError : 'There was an error parsing your request',
+ requiredParameter : 'Missing a required URL parameter: ',
+ statusMessage : 'Server gave an error: ',
+ timeout : 'Your request timed out'
+ },
+
+ regExp : {
+ required : /\{\$*[A-z0-9]+\}/g,
+ optional : /\{\/\$*[A-z0-9]+\}/g,
+ },
+
+ className: {
+ loading : 'loading',
+ error : 'error'
+ },
+
+ selector: {
+ disabled : '.disabled',
+ form : 'form'
+ },
+
+ metadata: {
+ action : 'action',
+ url : 'url'
+ }
+};
+
+
+
+})( jQuery, window, document );
diff --git a/web_src/fomantic/build/components/dropdown.css b/web_src/fomantic/build/components/dropdown.css
new file mode 100644
index 0000000000..58bdd8e16b
--- /dev/null
+++ b/web_src/fomantic/build/components/dropdown.css
@@ -0,0 +1,1755 @@
+/*!
+ * # Fomantic-UI - Dropdown
+ * http://github.com/fomantic/Fomantic-UI/
+ *
+ *
+ * Released under the MIT license
+ * http://opensource.org/licenses/MIT
+ *
+ */
+
+
+/*******************************
+ Dropdown
+*******************************/
+
+.ui.dropdown {
+ cursor: pointer;
+ position: relative;
+ display: inline-block;
+ outline: none;
+ text-align: left;
+ transition: box-shadow 0.1s ease, width 0.1s ease;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ user-select: none;
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
+}
+
+
+/*******************************
+ Content
+*******************************/
+
+
+/*--------------
+ Menu
+---------------*/
+
+.ui.dropdown .menu {
+ cursor: auto;
+ position: absolute;
+ display: none;
+ outline: none;
+ top: 100%;
+ min-width: -moz-max-content;
+ min-width: max-content;
+ margin: 0;
+ padding: 0 0;
+ background: #FFFFFF;
+ font-size: 1em;
+ text-shadow: none;
+ text-align: left;
+ box-shadow: 0 2px 3px 0 rgba(34, 36, 38, 0.15);
+ border: 1px solid rgba(34, 36, 38, 0.15);
+ border-radius: 0.28571429rem;
+ transition: opacity 0.1s ease;
+ z-index: 11;
+ will-change: transform, opacity;
+}
+.ui.dropdown .menu > * {
+ white-space: nowrap;
+}
+
+/*--------------
+ Hidden Input
+---------------*/
+
+.ui.dropdown > input:not(.search):first-child,
+.ui.dropdown > select {
+ display: none !important;
+}
+
+/*--------------
+ Dropdown Icon
+---------------*/
+
+.ui.dropdown:not(.labeled) > .dropdown.icon {
+ position: relative;
+ width: auto;
+ font-size: 0.85714286em;
+ margin: 0 0 0 1em;
+}
+.ui.dropdown .menu > .item .dropdown.icon {
+ width: auto;
+ float: right;
+ margin: 0em 0 0 1em;
+}
+.ui.dropdown .menu > .item .dropdown.icon + .text {
+ margin-right: 1em;
+}
+
+/*--------------
+ Text
+---------------*/
+
+.ui.dropdown > .text {
+ display: inline-block;
+ transition: none;
+}
+
+/*--------------
+ Menu Item
+---------------*/
+
+.ui.dropdown .menu > .item {
+ position: relative;
+ cursor: pointer;
+ display: block;
+ border: none;
+ height: auto;
+ min-height: 2.57142857rem;
+ text-align: left;
+ border-top: none;
+ line-height: 1em;
+ font-size: 1rem;
+ color: rgba(0, 0, 0, 0.87);
+ padding: 0.78571429rem 1.14285714rem !important;
+ text-transform: none;
+ font-weight: normal;
+ box-shadow: none;
+ -webkit-touch-callout: none;
+}
+.ui.dropdown .menu > .item:first-child {
+ border-top-width: 0;
+}
+.ui.dropdown .menu > .item.vertical {
+ display: flex;
+ flex-direction: column-reverse;
+}
+
+/*--------------
+ Floated Content
+---------------*/
+
+.ui.dropdown > .text > [class*="right floated"],
+.ui.dropdown .menu .item > [class*="right floated"] {
+ float: right !important;
+ margin-right: 0 !important;
+ margin-left: 1em !important;
+}
+.ui.dropdown > .text > [class*="left floated"],
+.ui.dropdown .menu .item > [class*="left floated"] {
+ float: left !important;
+ margin-left: 0 !important;
+ margin-right: 1em !important;
+}
+.ui.dropdown .menu .item > i.icon.floated,
+.ui.dropdown .menu .item > .flag.floated,
+.ui.dropdown .menu .item > .image.floated,
+.ui.dropdown .menu .item > img.floated {
+ margin-top: 0em;
+}
+
+/*--------------
+ Menu Divider
+---------------*/
+
+.ui.dropdown .menu > .header {
+ margin: 1rem 0 0.75rem;
+ padding: 0 1.14285714rem;
+ font-weight: 500;
+ text-transform: uppercase;
+}
+.ui.dropdown .menu > .header:not(.ui) {
+ color: rgba(0, 0, 0, 0.85);
+ font-size: 0.78571429em;
+}
+.ui.dropdown .menu > .divider {
+ border-top: 1px solid rgba(34, 36, 38, 0.1);
+ height: 0;
+ margin: 0.5em 0;
+}
+.ui.dropdown .menu > .horizontal.divider {
+ border-top: none;
+}
+.ui.dropdown.dropdown .menu > .input {
+ width: auto;
+ display: flex;
+ margin: 1.14285714rem 0.78571429rem;
+ min-width: 10rem;
+}
+.ui.dropdown .menu > .header + .input {
+ margin-top: 0;
+}
+.ui.dropdown .menu > .input:not(.transparent) input {
+ padding: 0.5em 1em;
+}
+.ui.dropdown .menu > .input:not(.transparent) .button,
+.ui.dropdown .menu > .input:not(.transparent) i.icon,
+.ui.dropdown .menu > .input:not(.transparent) .label {
+ padding-top: 0.5em;
+ padding-bottom: 0.5em;
+}
+
+/*-----------------
+ Item Description
+-------------------*/
+
+.ui.dropdown > .text > .description,
+.ui.dropdown .menu > .item > .description {
+ float: right;
+ margin: 0 0 0 1em;
+ color: rgba(0, 0, 0, 0.4);
+}
+.ui.dropdown .menu > .item.vertical > .description {
+ margin: 0;
+}
+
+/*-----------------
+ Item Text
+-------------------*/
+
+.ui.dropdown .menu > .item.vertical > .text {
+ margin-bottom: 0.25em;
+}
+
+/*-----------------
+ Message
+-------------------*/
+
+.ui.dropdown .menu > .message {
+ padding: 0.78571429rem 1.14285714rem;
+ font-weight: normal;
+}
+.ui.dropdown .menu > .message:not(.ui) {
+ color: rgba(0, 0, 0, 0.4);
+}
+
+/*--------------
+ Sub Menu
+---------------*/
+
+.ui.dropdown .menu .menu {
+ top: 0;
+ left: 100%;
+ right: auto;
+ margin: 0 -0.5em !important;
+ border-radius: 0.28571429rem !important;
+ z-index: 21 !important;
+}
+
+/* Hide Arrow */
+.ui.dropdown .menu .menu:after {
+ display: none;
+}
+
+/*--------------
+ Sub Elements
+---------------*/
+
+
+/* Icons / Flags / Labels / Image */
+.ui.dropdown > .text > i.icon,
+.ui.dropdown > .text > .label,
+.ui.dropdown > .text > .flag,
+.ui.dropdown > .text > img,
+.ui.dropdown > .text > .image {
+ margin-top: 0em;
+}
+.ui.dropdown .menu > .item > i.icon,
+.ui.dropdown .menu > .item > .label,
+.ui.dropdown .menu > .item > .flag,
+.ui.dropdown .menu > .item > .image,
+.ui.dropdown .menu > .item > img {
+ margin-top: 0em;
+}
+.ui.dropdown > .text > i.icon,
+.ui.dropdown > .text > .label,
+.ui.dropdown > .text > .flag,
+.ui.dropdown > .text > img,
+.ui.dropdown > .text > .image,
+.ui.dropdown .menu > .item > i.icon,
+.ui.dropdown .menu > .item > .label,
+.ui.dropdown .menu > .item > .flag,
+.ui.dropdown .menu > .item > .image,
+.ui.dropdown .menu > .item > img {
+ margin-left: 0;
+ float: none;
+ margin-right: 0.78571429rem;
+}
+
+/*--------------
+ Image
+---------------*/
+
+.ui.dropdown > .text > img,
+.ui.dropdown > .text > .image:not(.icon),
+.ui.dropdown .menu > .item > .image:not(.icon),
+.ui.dropdown .menu > .item > img {
+ display: inline-block;
+ vertical-align: top;
+ width: auto;
+ margin-top: -0.5em;
+ margin-bottom: -0.5em;
+ max-height: 2em;
+}
+
+
+/*******************************
+ Coupling
+*******************************/
+
+
+/*--------------
+ Menu
+---------------*/
+
+
+/* Remove Menu Item Divider */
+.ui.dropdown .ui.menu > .item:before,
+.ui.menu .ui.dropdown .menu > .item:before {
+ display: none;
+}
+
+/* Prevent Menu Item Border */
+.ui.menu .ui.dropdown .menu .active.item {
+ border-left: none;
+}
+
+/* Automatically float dropdown menu right on last menu item */
+.ui.menu .right.menu .dropdown:last-child > .menu:not(.left),
+.ui.menu .right.dropdown.item > .menu:not(.left),
+.ui.buttons > .ui.dropdown:last-child > .menu:not(.left) {
+ left: auto;
+ right: 0;
+}
+
+/*--------------
+ Label
+ ---------------*/
+
+
+/* Dropdown Menu */
+.ui.label.dropdown .menu {
+ min-width: 100%;
+}
+
+/*--------------
+ Button
+ ---------------*/
+
+
+/* No Margin On Icon Button */
+.ui.dropdown.icon.button > .dropdown.icon {
+ margin: 0;
+}
+.ui.button.dropdown .menu {
+ min-width: 100%;
+}
+
+
+/*******************************
+ Types
+*******************************/
+
+select.ui.dropdown {
+ height: 38px;
+ padding: 0.5em;
+ border: 1px solid rgba(34, 36, 38, 0.15);
+ visibility: visible;
+}
+
+/*--------------
+ Selection
+ ---------------*/
+
+
+/* Displays like a select box */
+.ui.selection.dropdown {
+ cursor: pointer;
+ word-wrap: break-word;
+ line-height: 1em;
+ white-space: normal;
+ outline: 0;
+ transform: rotateZ(0deg);
+ min-width: 14em;
+ min-height: 2.71428571em;
+ background: #FFFFFF;
+ display: inline-block;
+ padding: 0.78571429em 3.2em 0.78571429em 1em;
+ color: rgba(0, 0, 0, 0.87);
+ box-shadow: none;
+ border: 1px solid rgba(34, 36, 38, 0.15);
+ border-radius: 0.28571429rem;
+ transition: box-shadow 0.1s ease, width 0.1s ease;
+}
+.ui.selection.dropdown.visible,
+.ui.selection.dropdown.active {
+ z-index: 10;
+}
+.ui.selection.dropdown > .search.icon,
+.ui.selection.dropdown > .delete.icon,
+.ui.selection.dropdown > .dropdown.icon {
+ cursor: pointer;
+ position: absolute;
+ width: auto;
+ height: auto;
+ line-height: 1.21428571em;
+ top: 0.78571429em;
+ right: 1em;
+ z-index: 3;
+ margin: -0.78571429em;
+ padding: 0.91666667em;
+ opacity: 0.8;
+ transition: opacity 0.1s ease;
+}
+
+/* Compact */
+.ui.compact.selection.dropdown {
+ min-width: 0;
+}
+
+/* Selection Menu */
+.ui.selection.dropdown .menu {
+ overflow-x: hidden;
+ overflow-y: auto;
+ backface-visibility: hidden;
+ -webkit-overflow-scrolling: touch;
+ border-top-width: 0 !important;
+ width: auto;
+ outline: none;
+ margin: 0 -1px;
+ min-width: calc(100% + 2px);
+ width: calc(100% + 2px);
+ border-radius: 0 0 0.28571429rem 0.28571429rem;
+ box-shadow: 0 2px 3px 0 rgba(34, 36, 38, 0.15);
+ transition: opacity 0.1s ease;
+}
+.ui.selection.dropdown .menu:after,
+.ui.selection.dropdown .menu:before {
+ display: none;
+}
+
+/*--------------
+ Message
+ ---------------*/
+
+.ui.selection.dropdown .menu > .message {
+ padding: 0.78571429rem 1.14285714rem;
+}
+@media only screen and (max-width: 767.98px) {
+ .ui.selection.dropdown.short .menu {
+ max-height: 6.01071429rem;
+ }
+ .ui.selection.dropdown[class*="very short"] .menu {
+ max-height: 4.00714286rem;
+ }
+ .ui.selection.dropdown .menu {
+ max-height: 8.01428571rem;
+ }
+ .ui.selection.dropdown.long .menu {
+ max-height: 16.02857143rem;
+ }
+ .ui.selection.dropdown[class*="very long"] .menu {
+ max-height: 24.04285714rem;
+ }
+}
+@media only screen and (min-width: 768px) {
+ .ui.selection.dropdown.short .menu {
+ max-height: 8.01428571rem;
+ }
+ .ui.selection.dropdown[class*="very short"] .menu {
+ max-height: 5.34285714rem;
+ }
+ .ui.selection.dropdown .menu {
+ max-height: 10.68571429rem;
+ }
+ .ui.selection.dropdown.long .menu {
+ max-height: 21.37142857rem;
+ }
+ .ui.selection.dropdown[class*="very long"] .menu {
+ max-height: 32.05714286rem;
+ }
+}
+@media only screen and (min-width: 992px) {
+ .ui.selection.dropdown.short .menu {
+ max-height: 12.02142857rem;
+ }
+ .ui.selection.dropdown[class*="very short"] .menu {
+ max-height: 8.01428571rem;
+ }
+ .ui.selection.dropdown .menu {
+ max-height: 16.02857143rem;
+ }
+ .ui.selection.dropdown.long .menu {
+ max-height: 32.05714286rem;
+ }
+ .ui.selection.dropdown[class*="very long"] .menu {
+ max-height: 48.08571429rem;
+ }
+}
+@media only screen and (min-width: 1920px) {
+ .ui.selection.dropdown.short .menu {
+ max-height: 16.02857143rem;
+ }
+ .ui.selection.dropdown[class*="very short"] .menu {
+ max-height: 10.68571429rem;
+ }
+ .ui.selection.dropdown .menu {
+ max-height: 21.37142857rem;
+ }
+ .ui.selection.dropdown.long .menu {
+ max-height: 42.74285714rem;
+ }
+ .ui.selection.dropdown[class*="very long"] .menu {
+ max-height: 64.11428571rem;
+ }
+}
+
+/* Menu Item */
+.ui.selection.dropdown .menu > .item {
+ border-top: 1px solid #FAFAFA;
+ padding: 0.78571429rem 1.14285714rem !important;
+ white-space: normal;
+ word-wrap: normal;
+}
+
+/* User Item */
+.ui.selection.dropdown .menu > .hidden.addition.item {
+ display: none;
+}
+
+/* Hover */
+.ui.selection.dropdown:hover {
+ border-color: rgba(34, 36, 38, 0.35);
+ box-shadow: none;
+}
+
+/* Active */
+.ui.selection.active.dropdown {
+ border-color: #96C8DA;
+ box-shadow: 0 2px 3px 0 rgba(34, 36, 38, 0.15);
+}
+.ui.selection.active.dropdown .menu {
+ border-color: #96C8DA;
+ box-shadow: 0 2px 3px 0 rgba(34, 36, 38, 0.15);
+}
+
+/* Focus */
+.ui.selection.dropdown:focus {
+ border-color: #96C8DA;
+ box-shadow: none;
+}
+.ui.selection.dropdown:focus .menu {
+ border-color: #96C8DA;
+ box-shadow: 0 2px 3px 0 rgba(34, 36, 38, 0.15);
+}
+
+/* Visible */
+.ui.selection.visible.dropdown > .text:not(.default) {
+ font-weight: normal;
+ color: rgba(0, 0, 0, 0.8);
+}
+
+/* Visible Hover */
+.ui.selection.active.dropdown:hover {
+ border-color: #96C8DA;
+ box-shadow: 0 2px 3px 0 rgba(34, 36, 38, 0.15);
+}
+.ui.selection.active.dropdown:hover .menu {
+ border-color: #96C8DA;
+ box-shadow: 0 2px 3px 0 rgba(34, 36, 38, 0.15);
+}
+
+/* Dropdown Icon */
+.ui.active.selection.dropdown > .dropdown.icon,
+.ui.visible.selection.dropdown > .dropdown.icon {
+ opacity: '';
+ z-index: 3;
+}
+
+/* Connecting Border */
+.ui.active.selection.dropdown {
+ border-bottom-left-radius: 0 !important;
+ border-bottom-right-radius: 0 !important;
+}
+
+/* Empty Connecting Border */
+.ui.active.empty.selection.dropdown {
+ border-radius: 0.28571429rem !important;
+ box-shadow: none !important;
+}
+.ui.active.empty.selection.dropdown .menu {
+ border: none !important;
+ box-shadow: none !important;
+}
+
+/* CSS specific to iOS devices or firefox mobile only */
+@supports (-webkit-touch-callout: none) or (-webkit-overflow-scrolling: touch) or (-moz-appearance:none) {
+ @media (-moz-touch-enabled), (pointer: coarse) {
+ .ui.dropdown .scrollhint.menu:not(.hidden):before {
+ animation: scrollhint 2s ease 2;
+ content: '';
+ z-index: 15;
+ display: block;
+ position: absolute;
+ opacity: 0;
+ right: 0.25em;
+ top: 0;
+ height: 100%;
+ border-right: 0.25em solid;
+ border-left: 0;
+ -o-border-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0)) 1 100%;
+ border-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0)) 1 100%;
+ }
+ .ui.inverted.dropdown .scrollhint.menu:not(.hidden):before {
+ -o-border-image: linear-gradient(to bottom, rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0)) 1 100%;
+ border-image: linear-gradient(to bottom, rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0)) 1 100%;
+ }
+ @keyframes scrollhint {
+ 0% {
+ opacity: 1;
+ top: 100%;
+ }
+ 100% {
+ opacity: 0;
+ top: 0;
+ }
+ }
+ }
+}
+
+/*--------------
+ Searchable
+ ---------------*/
+
+
+/* Search Selection */
+.ui.search.dropdown {
+ min-width: '';
+}
+
+/* Search Dropdown */
+.ui.search.dropdown > input.search {
+ background: none transparent !important;
+ border: none !important;
+ box-shadow: none !important;
+ cursor: text;
+ top: 0;
+ left: 1px;
+ width: 100%;
+ outline: none;
+ -webkit-tap-highlight-color: rgba(255, 255, 255, 0);
+ padding: inherit;
+}
+
+/* Text Layering */
+.ui.search.dropdown > input.search {
+ position: absolute;
+ z-index: 2;
+}
+.ui.search.dropdown > .text {
+ cursor: text;
+ position: relative;
+ left: 1px;
+ z-index: auto;
+}
+
+/* Search Selection */
+.ui.search.selection.dropdown > input.search {
+ line-height: 1.21428571em;
+ padding: 0.67857143em 3.2em 0.67857143em 1em;
+}
+
+/* Used to size multi select input to character width */
+.ui.search.selection.dropdown > span.sizer {
+ line-height: 1.21428571em;
+ padding: 0.67857143em 3.2em 0.67857143em 1em;
+ display: none;
+ white-space: pre;
+}
+
+/* Active/Visible Search */
+.ui.search.dropdown.active > input.search,
+.ui.search.dropdown.visible > input.search {
+ cursor: auto;
+}
+.ui.search.dropdown.active > .text,
+.ui.search.dropdown.visible > .text {
+ pointer-events: none;
+}
+
+/* Filtered Text */
+.ui.active.search.dropdown input.search:focus + .text i.icon,
+.ui.active.search.dropdown input.search:focus + .text .flag {
+ opacity: var(--opacity-disabled);
+}
+.ui.active.search.dropdown input.search:focus + .text {
+ color: rgba(115, 115, 115, 0.87) !important;
+}
+.ui.search.dropdown.button > span.sizer {
+ display: none;
+}
+
+/* Search Menu */
+.ui.search.dropdown .menu {
+ overflow-x: hidden;
+ overflow-y: auto;
+ backface-visibility: hidden;
+ -webkit-overflow-scrolling: touch;
+}
+@media only screen and (max-width: 767.98px) {
+ .ui.search.dropdown .menu {
+ max-height: 8.01428571rem;
+ }
+}
+@media only screen and (min-width: 768px) {
+ .ui.search.dropdown .menu {
+ max-height: 10.68571429rem;
+ }
+}
+@media only screen and (min-width: 992px) {
+ .ui.search.dropdown .menu {
+ max-height: 16.02857143rem;
+ }
+}
+@media only screen and (min-width: 1920px) {
+ .ui.search.dropdown .menu {
+ max-height: 21.37142857rem;
+ }
+}
+
+/* Clearable Selection */
+.ui.dropdown > .remove.icon {
+ cursor: pointer;
+ font-size: 0.85714286em;
+ margin: -0.78571429em;
+ padding: 0.91666667em;
+ right: 3em;
+ top: 0.78571429em;
+ position: absolute;
+ opacity: 0.6;
+ z-index: 3;
+}
+.ui.clearable.dropdown .text,
+.ui.clearable.dropdown a:last-of-type {
+ margin-right: 1.5em;
+}
+.ui.dropdown select.noselection ~ .remove.icon,
+.ui.dropdown input[value=''] ~ .remove.icon,
+.ui.dropdown input:not([value]) ~ .remove.icon,
+.ui.dropdown.loading > .remove.icon {
+ display: none;
+}
+
+/*--------------
+ Multiple
+ ---------------*/
+
+
+/* Multiple Selection */
+.ui.ui.multiple.dropdown {
+ padding: 0.22619048em 3.2em 0.22619048em 0.35714286em;
+}
+.ui.multiple.dropdown .menu {
+ cursor: auto;
+}
+
+/* Selection Label */
+.ui.multiple.dropdown > .label {
+ display: inline-block;
+ white-space: normal;
+ font-size: 1em;
+ padding: 0.35714286em 0.78571429em;
+ margin: 0.14285714rem 0.28571429rem 0.14285714rem 0;
+ box-shadow: 0 0 0 1px rgba(34, 36, 38, 0.15) inset;
+}
+
+/* Dropdown Icon */
+.ui.multiple.dropdown .dropdown.icon {
+ margin: '';
+ padding: '';
+}
+
+/* Text */
+.ui.multiple.dropdown > .text {
+ position: static;
+ padding: 0;
+ max-width: 100%;
+ margin: 0.45238095em 0 0.45238095em 0.64285714em;
+ line-height: 1.21428571em;
+}
+.ui.multiple.dropdown > .text.default {
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+.ui.multiple.dropdown > .label ~ input.search {
+ margin-left: 0.14285714em !important;
+}
+.ui.multiple.dropdown > .label ~ .text {
+ display: none;
+}
+.ui.multiple.dropdown > .label:not(.image) > img:not(.centered) {
+ margin-right: 0.78571429rem;
+}
+.ui.multiple.dropdown > .label:not(.image) > img.ui:not(.avatar) {
+ margin-bottom: 0.39285714rem;
+}
+.ui.multiple.dropdown > .image.label img {
+ margin: -0.35714286em 0.78571429em -0.35714286em -0.78571429em;
+ height: 1.71428571em;
+}
+
+/*-----------------
+ Multiple Search
+ -----------------*/
+
+
+/* Multiple Search Selection */
+.ui.multiple.search.dropdown,
+.ui.multiple.search.dropdown > input.search {
+ cursor: text;
+}
+
+/* Prompt Text */
+.ui.multiple.search.dropdown > .text {
+ display: inline-block;
+ position: absolute;
+ top: 0;
+ left: 0;
+ padding: inherit;
+ margin: 0.45238095em 0 0.45238095em 0.64285714em;
+ line-height: 1.21428571em;
+}
+.ui.multiple.search.dropdown > .label ~ .text {
+ display: none;
+}
+
+/* Search */
+.ui.multiple.search.dropdown > input.search {
+ position: static;
+ padding: 0;
+ max-width: 100%;
+ margin: 0.45238095em 0 0.45238095em 0.64285714em;
+ width: 2.2em;
+ line-height: 1.21428571em;
+}
+.ui.multiple.search.dropdown.button {
+ min-width: 14em;
+}
+
+/*--------------
+ Inline
+ ---------------*/
+
+.ui.inline.dropdown {
+ cursor: pointer;
+ display: inline-block;
+ color: inherit;
+}
+.ui.inline.dropdown .dropdown.icon {
+ margin: 0 0.21428571em 0 0.21428571em;
+ vertical-align: baseline;
+}
+.ui.inline.dropdown > .text {
+ font-weight: 500;
+}
+.ui.inline.dropdown .menu {
+ cursor: auto;
+ margin-top: 0.21428571em;
+ border-radius: 0.28571429rem;
+}
+
+
+/*******************************
+ States
+*******************************/
+
+
+/*--------------------
+ Active
+----------------------*/
+
+
+/* Menu Item Active */
+.ui.dropdown .menu .active.item {
+ background: transparent;
+ font-weight: 500;
+ color: rgba(0, 0, 0, 0.95);
+ box-shadow: none;
+ z-index: 12;
+}
+
+/*--------------------
+ Hover
+----------------------*/
+
+
+/* Menu Item Hover */
+.ui.dropdown .menu > .item:hover {
+ background: rgba(0, 0, 0, 0.05);
+ color: rgba(0, 0, 0, 0.95);
+ z-index: 13;
+}
+
+/*--------------------
+ Default Text
+----------------------*/
+
+.ui.dropdown:not(.button) > .default.text,
+.ui.default.dropdown:not(.button) > .text {
+ color: rgba(191, 191, 191, 0.87);
+}
+.ui.dropdown:not(.button) > input:focus ~ .default.text,
+.ui.default.dropdown:not(.button) > input:focus ~ .text {
+ color: rgba(115, 115, 115, 0.87);
+}
+
+/*--------------------
+ Loading
+ ---------------------*/
+
+.ui.loading.dropdown > i.icon {
+ height: 1em !important;
+}
+.ui.loading.selection.dropdown > i.icon {
+ padding: 1.5em 1.28571429em !important;
+}
+.ui.loading.dropdown > i.icon:before {
+ position: absolute;
+ content: '';
+ top: 50%;
+ left: 50%;
+ margin: -0.64285714em 0 0 -0.64285714em;
+ width: 1.28571429em;
+ height: 1.28571429em;
+ border-radius: 500rem;
+ border: 0.2em solid rgba(0, 0, 0, 0.1);
+}
+.ui.loading.dropdown > i.icon:after {
+ position: absolute;
+ content: '';
+ top: 50%;
+ left: 50%;
+ box-shadow: 0 0 0 1px transparent;
+ margin: -0.64285714em 0 0 -0.64285714em;
+ width: 1.28571429em;
+ height: 1.28571429em;
+ animation: loader 0.6s infinite linear;
+ border: 0.2em solid #767676;
+ border-radius: 500rem;
+}
+
+/* Coupling */
+.ui.loading.dropdown.button > i.icon:before,
+.ui.loading.dropdown.button > i.icon:after {
+ display: none;
+}
+.ui.loading.dropdown > .text {
+ transition: none;
+}
+
+/* Used To Check Position */
+.ui.dropdown .loading.menu {
+ display: block;
+ visibility: hidden;
+ z-index: -1;
+}
+.ui.dropdown > .loading.menu {
+ left: 0 !important;
+ right: auto !important;
+}
+.ui.dropdown > .menu .loading.menu {
+ left: 100% !important;
+ right: auto !important;
+}
+
+/*--------------------
+ Keyboard Select
+----------------------*/
+
+
+/* Selected Item */
+.ui.dropdown.selected,
+.ui.dropdown .menu .selected.item {
+ background: rgba(0, 0, 0, 0.03);
+ color: rgba(0, 0, 0, 0.95);
+}
+
+/*--------------------
+ Search Filtered
+----------------------*/
+
+
+/* Filtered Item */
+.ui.dropdown > .filtered.text {
+ visibility: hidden;
+}
+.ui.dropdown .filtered.item {
+ display: none !important;
+}
+
+/*--------------------
+ States
+ ----------------------*/
+
+.ui.dropdown.error,
+.ui.dropdown.error > .text,
+.ui.dropdown.error > .default.text {
+ color: #9F3A38;
+}
+.ui.selection.dropdown.error {
+ background: #FFF6F6;
+ border-color: #E0B4B4;
+}
+.ui.selection.dropdown.error:hover {
+ border-color: #E0B4B4;
+}
+.ui.multiple.selection.error.dropdown > .label {
+ border-color: #E0B4B4;
+}
+.ui.dropdown.error > .menu,
+.ui.dropdown.error > .menu .menu {
+ border-color: #E0B4B4;
+}
+.ui.dropdown.error > .menu > .item {
+ color: #9F3A38;
+}
+
+/* Item Hover */
+.ui.dropdown.error > .menu > .item:hover {
+ background-color: #FBE7E7;
+}
+
+/* Item Active */
+.ui.dropdown.error > .menu .active.item {
+ background-color: #FDCFCF;
+}
+.ui.dropdown.info,
+.ui.dropdown.info > .text,
+.ui.dropdown.info > .default.text {
+ color: #276F86;
+}
+.ui.selection.dropdown.info {
+ background: #F8FFFF;
+ border-color: #A9D5DE;
+}
+.ui.selection.dropdown.info:hover {
+ border-color: #A9D5DE;
+}
+.ui.multiple.selection.info.dropdown > .label {
+ border-color: #A9D5DE;
+}
+.ui.dropdown.info > .menu,
+.ui.dropdown.info > .menu .menu {
+ border-color: #A9D5DE;
+}
+.ui.dropdown.info > .menu > .item {
+ color: #276F86;
+}
+
+/* Item Hover */
+.ui.dropdown.info > .menu > .item:hover {
+ background-color: #e9f2fb;
+}
+
+/* Item Active */
+.ui.dropdown.info > .menu .active.item {
+ background-color: #cef1fd;
+}
+.ui.dropdown.success,
+.ui.dropdown.success > .text,
+.ui.dropdown.success > .default.text {
+ color: #2C662D;
+}
+.ui.selection.dropdown.success {
+ background: #FCFFF5;
+ border-color: #A3C293;
+}
+.ui.selection.dropdown.success:hover {
+ border-color: #A3C293;
+}
+.ui.multiple.selection.success.dropdown > .label {
+ border-color: #A3C293;
+}
+.ui.dropdown.success > .menu,
+.ui.dropdown.success > .menu .menu {
+ border-color: #A3C293;
+}
+.ui.dropdown.success > .menu > .item {
+ color: #2C662D;
+}
+
+/* Item Hover */
+.ui.dropdown.success > .menu > .item:hover {
+ background-color: #e9fbe9;
+}
+
+/* Item Active */
+.ui.dropdown.success > .menu .active.item {
+ background-color: #dafdce;
+}
+.ui.dropdown.warning,
+.ui.dropdown.warning > .text,
+.ui.dropdown.warning > .default.text {
+ color: #573A08;
+}
+.ui.selection.dropdown.warning {
+ background: #FFFAF3;
+ border-color: #C9BA9B;
+}
+.ui.selection.dropdown.warning:hover {
+ border-color: #C9BA9B;
+}
+.ui.multiple.selection.warning.dropdown > .label {
+ border-color: #C9BA9B;
+}
+.ui.dropdown.warning > .menu,
+.ui.dropdown.warning > .menu .menu {
+ border-color: #C9BA9B;
+}
+.ui.dropdown.warning > .menu > .item {
+ color: #573A08;
+}
+
+/* Item Hover */
+.ui.dropdown.warning > .menu > .item:hover {
+ background-color: #fbfbe9;
+}
+
+/* Item Active */
+.ui.dropdown.warning > .menu .active.item {
+ background-color: #fdfdce;
+}
+
+/*--------------------
+ Clear
+----------------------*/
+
+.ui.dropdown > .clear.dropdown.icon {
+ opacity: 0.8;
+ transition: opacity 0.1s ease;
+}
+.ui.dropdown > .clear.dropdown.icon:hover {
+ opacity: 1;
+}
+
+/*--------------------
+ Disabled
+ ----------------------*/
+
+
+/* Disabled */
+.ui.disabled.dropdown,
+.ui.dropdown .menu > .disabled.item {
+ cursor: default;
+ pointer-events: none;
+ opacity: var(--opacity-disabled);
+}
+
+
+/*******************************
+ Variations
+*******************************/
+
+
+/*--------------
+ Direction
+---------------*/
+
+
+/* Flyout Direction */
+.ui.dropdown .menu {
+ left: 0;
+}
+
+/* Default Side (Right) */
+.ui.dropdown .right.menu > .menu,
+.ui.dropdown .menu .right.menu {
+ left: 100% !important;
+ right: auto !important;
+ border-radius: 0.28571429rem !important;
+}
+
+/* Leftward Opening Menu */
+.ui.dropdown > .left.menu {
+ left: auto !important;
+ right: 0 !important;
+}
+.ui.dropdown > .left.menu .menu,
+.ui.dropdown .menu .left.menu {
+ left: auto;
+ right: 100%;
+ margin: 0 -0.5em 0 0 !important;
+ border-radius: 0.28571429rem !important;
+}
+.ui.dropdown .item .left.dropdown.icon,
+.ui.dropdown .left.menu .item .dropdown.icon {
+ width: auto;
+ float: left;
+ margin: 0em 0 0 0;
+}
+.ui.dropdown .item .left.dropdown.icon,
+.ui.dropdown .left.menu .item .dropdown.icon {
+ width: auto;
+ float: left;
+ margin: 0em 0 0 0;
+}
+.ui.dropdown .item .left.dropdown.icon + .text,
+.ui.dropdown .left.menu .item .dropdown.icon + .text {
+ margin-left: 1em;
+ margin-right: 0;
+}
+
+/*--------------
+ Upward
+ ---------------*/
+
+
+/* Upward Main Menu */
+.ui.upward.dropdown > .menu {
+ top: auto;
+ bottom: 100%;
+ box-shadow: 0 0 3px 0 rgba(0, 0, 0, 0.08);
+ border-radius: 0.28571429rem 0.28571429rem 0 0;
+}
+
+/* Upward Sub Menu */
+.ui.dropdown .upward.menu {
+ top: auto !important;
+ bottom: 0 !important;
+}
+
+/* Active Upward */
+.ui.simple.upward.active.dropdown,
+.ui.simple.upward.dropdown:hover {
+ border-radius: 0.28571429rem 0.28571429rem 0 0 !important;
+}
+.ui.upward.dropdown.button:not(.pointing):not(.floating).active {
+ border-radius: 0.28571429rem 0.28571429rem 0 0;
+}
+
+/* Selection */
+.ui.upward.selection.dropdown .menu {
+ border-top-width: 1px !important;
+ border-bottom-width: 0 !important;
+ box-shadow: 0 -2px 3px 0 rgba(0, 0, 0, 0.08);
+}
+.ui.upward.selection.dropdown:hover {
+ box-shadow: 0 0 2px 0 rgba(0, 0, 0, 0.05);
+}
+
+/* Active Upward */
+.ui.active.upward.selection.dropdown {
+ border-radius: 0 0 0.28571429rem 0.28571429rem !important;
+}
+
+/* Visible Upward */
+.ui.upward.selection.dropdown.visible {
+ box-shadow: 0 0 3px 0 rgba(0, 0, 0, 0.08);
+ border-radius: 0 0 0.28571429rem 0.28571429rem !important;
+}
+
+/* Visible Hover Upward */
+.ui.upward.active.selection.dropdown:hover {
+ box-shadow: 0 0 3px 0 rgba(0, 0, 0, 0.05);
+}
+.ui.upward.active.selection.dropdown:hover .menu {
+ box-shadow: 0 -2px 3px 0 rgba(0, 0, 0, 0.08);
+}
+
+/*--------------
+ Scrolling
+ ---------------*/
+
+
+/* Selection Menu */
+.ui.scrolling.dropdown .menu,
+.ui.dropdown .scrolling.menu {
+ overflow-x: hidden;
+ overflow-y: auto;
+}
+.ui.scrolling.dropdown .menu {
+ overflow-x: hidden;
+ overflow-y: auto;
+ backface-visibility: hidden;
+ -webkit-overflow-scrolling: touch;
+ min-width: 100% !important;
+ width: auto !important;
+}
+.ui.dropdown .scrolling.menu {
+ position: static;
+ overflow-y: auto;
+ border: none;
+ box-shadow: none !important;
+ border-radius: 0 !important;
+ margin: 0 !important;
+ min-width: 100% !important;
+ width: auto !important;
+ border-top: 1px solid rgba(34, 36, 38, 0.15);
+}
+.ui.scrolling.dropdown .menu .item.item.item,
+.ui.dropdown .scrolling.menu > .item.item.item {
+ border-top: none;
+}
+.ui.scrolling.dropdown .menu .item:first-child,
+.ui.dropdown .scrolling.menu .item:first-child {
+ border-top: none;
+}
+.ui.dropdown > .animating.menu .scrolling.menu,
+.ui.dropdown > .visible.menu .scrolling.menu {
+ display: block;
+}
+
+/* Scrollbar in IE */
+@media all and (-ms-high-contrast: none) {
+ .ui.scrolling.dropdown .menu,
+ .ui.dropdown .scrolling.menu {
+ min-width: calc(100% - 17px);
+ }
+}
+@media only screen and (max-width: 767.98px) {
+ .ui.scrolling.dropdown .menu,
+ .ui.dropdown .scrolling.menu {
+ max-height: 10.28571429rem;
+ }
+}
+@media only screen and (min-width: 768px) {
+ .ui.scrolling.dropdown .menu,
+ .ui.dropdown .scrolling.menu {
+ max-height: 15.42857143rem;
+ }
+}
+@media only screen and (min-width: 992px) {
+ .ui.scrolling.dropdown .menu,
+ .ui.dropdown .scrolling.menu {
+ max-height: 20.57142857rem;
+ }
+}
+@media only screen and (min-width: 1920px) {
+ .ui.scrolling.dropdown .menu,
+ .ui.dropdown .scrolling.menu {
+ max-height: 20.57142857rem;
+ }
+}
+
+/*--------------
+ Columnar
+---------------*/
+
+.ui.column.dropdown > .menu {
+ flex-wrap: wrap;
+}
+.ui.dropdown[class*="two column"] > .menu > .item {
+ width: 50%;
+}
+.ui.dropdown[class*="three column"] > .menu > .item {
+ width: 33%;
+}
+.ui.dropdown[class*="four column"] > .menu > .item {
+ width: 25%;
+}
+.ui.dropdown[class*="five column"] > .menu > .item {
+ width: 20%;
+}
+
+/*--------------
+ Simple
+ ---------------*/
+
+
+/* Displays without javascript */
+.ui.simple.dropdown .menu:before,
+.ui.simple.dropdown .menu:after {
+ display: none;
+}
+.ui.simple.dropdown .menu {
+ position: absolute;
+
+/* IE hack to make dropdown icons appear inline */
+ display: -ms-inline-flexbox !important;
+ display: block;
+ overflow: hidden;
+ top: -9999px;
+ opacity: 0;
+ width: 0;
+ height: 0;
+ transition: opacity 0.1s ease;
+ margin-top: 0 !important;
+}
+.ui.simple.active.dropdown,
+.ui.simple.dropdown:hover {
+ border-bottom-left-radius: 0 !important;
+ border-bottom-right-radius: 0 !important;
+}
+.ui.simple.active.dropdown > .menu,
+.ui.simple.dropdown:hover > .menu {
+ overflow: visible;
+ width: auto;
+ height: auto;
+ top: 100%;
+ opacity: 1;
+}
+.ui.simple.dropdown > .menu > .item:active > .menu,
+.ui.simple.dropdown .menu .item:hover > .menu {
+ overflow: visible;
+ width: auto;
+ height: auto;
+ top: 0 !important;
+ left: 100%;
+ opacity: 1;
+}
+.ui.simple.dropdown > .menu > .item:active > .left.menu,
+.ui.simple.dropdown .menu .item:hover > .left.menu,
+.right.menu .ui.simple.dropdown > .menu > .item:active > .menu:not(.right),
+.right.menu .ui.simple.dropdown > .menu .item:hover > .menu:not(.right) {
+ left: auto;
+ right: 100%;
+}
+.ui.simple.disabled.dropdown:hover .menu {
+ display: none;
+ height: 0;
+ width: 0;
+ overflow: hidden;
+}
+
+/* Visible */
+.ui.simple.visible.dropdown > .menu {
+ display: block;
+}
+
+/* Scrolling */
+.ui.simple.scrolling.active.dropdown > .menu,
+.ui.simple.scrolling.dropdown:hover > .menu {
+ overflow-x: hidden;
+ overflow-y: auto;
+}
+
+/*--------------
+ Fluid
+ ---------------*/
+
+.ui.fluid.dropdown {
+ display: block;
+ width: 100% !important;
+ min-width: 0;
+}
+.ui.fluid.dropdown > .dropdown.icon {
+ float: right;
+}
+
+/*--------------
+ Floating
+ ---------------*/
+
+.ui.floating.dropdown .menu {
+ left: 0;
+ right: auto;
+ box-shadow: 0 2px 4px 0 rgba(34, 36, 38, 0.12), 0 2px 10px 0 rgba(34, 36, 38, 0.15) !important;
+ border-radius: 0.28571429rem !important;
+}
+.ui.floating.dropdown > .menu {
+ border-radius: 0.28571429rem !important;
+}
+.ui:not(.upward).floating.dropdown > .menu {
+ margin-top: 0.5em;
+}
+.ui.upward.floating.dropdown > .menu {
+ margin-bottom: 0.5em;
+}
+
+/*--------------
+ Pointing
+ ---------------*/
+
+.ui.pointing.dropdown > .menu {
+ top: 100%;
+ margin-top: 0.78571429rem;
+ border-radius: 0.28571429rem;
+}
+.ui.pointing.dropdown > .menu:not(.hidden):after {
+ display: block;
+ position: absolute;
+ pointer-events: none;
+ content: '';
+ visibility: visible;
+ transform: rotate(45deg);
+ width: 0.5em;
+ height: 0.5em;
+ box-shadow: -1px -1px 0 0 rgba(34, 36, 38, 0.15);
+ background: #FFFFFF;
+ z-index: 2;
+}
+.ui.pointing.dropdown > .menu:not(.hidden):after {
+ top: -0.25em;
+ left: 50%;
+ margin: 0 0 0 -0.25em;
+}
+
+/* Top Left Pointing */
+.ui.top.left.pointing.dropdown > .menu {
+ top: 100%;
+ bottom: auto;
+ left: 0;
+ right: auto;
+ margin: 1em 0 0;
+}
+.ui.top.left.pointing.dropdown > .menu {
+ top: 100%;
+ bottom: auto;
+ left: 0;
+ right: auto;
+ margin: 1em 0 0;
+}
+.ui.top.left.pointing.dropdown > .menu:after {
+ top: -0.25em;
+ left: 1em;
+ right: auto;
+ margin: 0;
+ transform: rotate(45deg);
+}
+
+/* Top Right Pointing */
+.ui.top.right.pointing.dropdown > .menu {
+ top: 100%;
+ bottom: auto;
+ right: 0;
+ left: auto;
+ margin: 1em 0 0;
+}
+.ui.top.pointing.dropdown > .left.menu:after,
+.ui.top.right.pointing.dropdown > .menu:after {
+ top: -0.25em;
+ left: auto !important;
+ right: 1em !important;
+ margin: 0;
+ transform: rotate(45deg);
+}
+
+/* Left Pointing */
+.ui.left.pointing.dropdown > .menu {
+ top: 0;
+ left: 100%;
+ right: auto;
+ margin: 0 0 0 1em;
+}
+.ui.left.pointing.dropdown > .menu:after {
+ top: 1em;
+ left: -0.25em;
+ margin: 0 0 0 0;
+ transform: rotate(-45deg);
+}
+.ui.left:not(.top):not(.bottom).pointing.dropdown > .left.menu {
+ left: auto !important;
+ right: 100% !important;
+ margin: 0 1em 0 0;
+}
+.ui.left:not(.top):not(.bottom).pointing.dropdown > .left.menu:after {
+ top: 1em;
+ left: auto;
+ right: -0.25em;
+ margin: 0 0 0 0;
+ transform: rotate(135deg);
+}
+
+/* Right Pointing */
+.ui.right.pointing.dropdown > .menu {
+ top: 0;
+ left: auto;
+ right: 100%;
+ margin: 0 1em 0 0;
+}
+.ui.right.pointing.dropdown > .menu:after {
+ top: 1em;
+ left: auto;
+ right: -0.25em;
+ margin: 0 0 0 0;
+ transform: rotate(135deg);
+}
+
+/* Bottom Pointing */
+.ui.bottom.pointing.dropdown > .menu {
+ top: auto;
+ bottom: 100%;
+ left: 0;
+ right: auto;
+ margin: 0 0 1em;
+}
+.ui.bottom.pointing.dropdown > .menu:after {
+ top: auto;
+ bottom: -0.25em;
+ right: auto;
+ margin: 0;
+ transform: rotate(-135deg);
+}
+
+/* Reverse Sub-Menu Direction */
+.ui.bottom.pointing.dropdown > .menu .menu {
+ top: auto !important;
+ bottom: 0 !important;
+}
+
+/* Bottom Left */
+.ui.bottom.left.pointing.dropdown > .menu {
+ left: 0;
+ right: auto;
+}
+.ui.bottom.left.pointing.dropdown > .menu:after {
+ left: 1em;
+ right: auto;
+}
+
+/* Bottom Right */
+.ui.bottom.right.pointing.dropdown > .menu {
+ right: 0;
+ left: auto;
+}
+.ui.bottom.right.pointing.dropdown > .menu:after {
+ left: auto;
+ right: 1em;
+}
+
+/* Upward pointing */
+.ui.pointing.upward.dropdown .menu,
+.ui.top.pointing.upward.dropdown .menu {
+ top: auto !important;
+ bottom: 100% !important;
+ margin: 0 0 0.78571429rem;
+ border-radius: 0.28571429rem;
+}
+.ui.pointing.upward.dropdown .menu:after,
+.ui.top.pointing.upward.dropdown .menu:after {
+ top: 100% !important;
+ bottom: auto !important;
+ box-shadow: 1px 1px 0 0 rgba(34, 36, 38, 0.15);
+ margin: -0.25em 0 0;
+}
+
+/* Right Pointing Upward */
+.ui.right.pointing.upward.dropdown:not(.top):not(.bottom) .menu {
+ top: auto !important;
+ bottom: 0 !important;
+ margin: 0 1em 0 0;
+}
+.ui.right.pointing.upward.dropdown:not(.top):not(.bottom) .menu:after {
+ top: auto !important;
+ bottom: 0 !important;
+ margin: 0 0 1em 0;
+ box-shadow: -1px -1px 0 0 rgba(34, 36, 38, 0.15);
+}
+
+/* Left Pointing Upward */
+.ui.left.pointing.upward.dropdown:not(.top):not(.bottom) .menu {
+ top: auto !important;
+ bottom: 0 !important;
+ margin: 0 0 0 1em;
+}
+.ui.left.pointing.upward.dropdown:not(.top):not(.bottom) .menu:after {
+ top: auto !important;
+ bottom: 0 !important;
+ margin: 0 0 1em 0;
+ box-shadow: -1px -1px 0 0 rgba(34, 36, 38, 0.15);
+}
+
+/*--------------------
+ Sizes
+---------------------*/
+
+.ui.dropdown,
+.ui.dropdown .menu > .item {
+ font-size: 1rem;
+}
+.ui.mini.dropdown,
+.ui.mini.dropdown .menu > .item {
+ font-size: 0.78571429rem;
+}
+.ui.tiny.dropdown,
+.ui.tiny.dropdown .menu > .item {
+ font-size: 0.85714286rem;
+}
+.ui.small.dropdown,
+.ui.small.dropdown .menu > .item {
+ font-size: 0.92857143rem;
+}
+.ui.large.dropdown,
+.ui.large.dropdown .menu > .item {
+ font-size: 1.14285714rem;
+}
+.ui.big.dropdown,
+.ui.big.dropdown .menu > .item {
+ font-size: 1.28571429rem;
+}
+.ui.huge.dropdown,
+.ui.huge.dropdown .menu > .item {
+ font-size: 1.42857143rem;
+}
+.ui.massive.dropdown,
+.ui.massive.dropdown .menu > .item {
+ font-size: 1.71428571rem;
+}
+
+
+/*******************************
+ Theme Overrides
+*******************************/
+
+
+/* Dropdown Carets */
+@font-face {
+ font-family: 'Dropdown';
+ src: url(data:application/x-font-ttf;charset=utf-8;base64,AAEAAAALAIAAAwAwT1MvMggjB5AAAAC8AAAAYGNtYXAPfuIIAAABHAAAAExnYXNwAAAAEAAAAWgAAAAIZ2x5Zjo82LgAAAFwAAABVGhlYWQAQ88bAAACxAAAADZoaGVhAwcB6QAAAvwAAAAkaG10eAS4ABIAAAMgAAAAIGxvY2EBNgDeAAADQAAAABJtYXhwAAoAFgAAA1QAAAAgbmFtZVcZpu4AAAN0AAABRXBvc3QAAwAAAAAEvAAAACAAAwIAAZAABQAAAUwBZgAAAEcBTAFmAAAA9QAZAIQAAAAAAAAAAAAAAAAAAAABEAAAAAAAAAAAAAAAAAAAAABAAADw2gHg/+D/4AHgACAAAAABAAAAAAAAAAAAAAAgAAAAAAACAAAAAwAAABQAAwABAAAAFAAEADgAAAAKAAgAAgACAAEAIPDa//3//wAAAAAAIPDX//3//wAB/+MPLQADAAEAAAAAAAAAAAAAAAEAAf//AA8AAQAAAAAAAAAAAAIAADc5AQAAAAABAAAAAAAAAAAAAgAANzkBAAAAAAEAAAAAAAAAAAACAAA3OQEAAAAAAQAAAIABJQElABMAABM0NzY3BTYXFhUUDwEGJwYvASY1AAUGBwEACAUGBoAFCAcGgAUBEgcGBQEBAQcECQYHfwYBAQZ/BwYAAQAAAG4BJQESABMAADc0PwE2MzIfARYVFAcGIyEiJyY1AAWABgcIBYAGBgUI/wAHBgWABwaABQWABgcHBgUFBgcAAAABABIASQC3AW4AEwAANzQ/ATYXNhcWHQEUBwYnBi8BJjUSBoAFCAcFBgYFBwgFgAbbBwZ/BwEBBwQJ/wgEBwEBB38GBgAAAAABAAAASQClAW4AEwAANxE0NzYzMh8BFhUUDwEGIyInJjUABQYHCAWABgaABQgHBgVbAQAIBQYGgAUIBwWABgYFBwAAAAEAAAABAADZuaKOXw889QALAgAAAAAA0ABHWAAAAADQAEdYAAAAAAElAW4AAAAIAAIAAAAAAAAAAQAAAeD/4AAAAgAAAAAAASUAAQAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAABAAAAASUAAAElAAAAtwASALcAAAAAAAAACgAUAB4AQgBkAIgAqgAAAAEAAAAIABQAAQAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAOAK4AAQAAAAAAAQAOAAAAAQAAAAAAAgAOAEcAAQAAAAAAAwAOACQAAQAAAAAABAAOAFUAAQAAAAAABQAWAA4AAQAAAAAABgAHADIAAQAAAAAACgA0AGMAAwABBAkAAQAOAAAAAwABBAkAAgAOAEcAAwABBAkAAwAOACQAAwABBAkABAAOAFUAAwABBAkABQAWAA4AAwABBAkABgAOADkAAwABBAkACgA0AGMAaQBjAG8AbQBvAG8AbgBWAGUAcgBzAGkAbwBuACAAMQAuADAAaQBjAG8AbQBvAG8Abmljb21vb24AaQBjAG8AbQBvAG8AbgBSAGUAZwB1AGwAYQByAGkAYwBvAG0AbwBvAG4ARgBvAG4AdAAgAGcAZQBuAGUAcgBhAHQAZQBkACAAYgB5ACAASQBjAG8ATQBvAG8AbgAuAAAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=) format('truetype'), url(data:application/font-woff;charset=utf-8;base64,d09GRk9UVE8AAAVwAAoAAAAABSgAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABDRkYgAAAA9AAAAdkAAAHZLDXE/09TLzIAAALQAAAAYAAAAGAIIweQY21hcAAAAzAAAABMAAAATA9+4ghnYXNwAAADfAAAAAgAAAAIAAAAEGhlYWQAAAOEAAAANgAAADYAQ88baGhlYQAAA7wAAAAkAAAAJAMHAelobXR4AAAD4AAAACAAAAAgBLgAEm1heHAAAAQAAAAABgAAAAYACFAAbmFtZQAABAgAAAFFAAABRVcZpu5wb3N0AAAFUAAAACAAAAAgAAMAAAEABAQAAQEBCGljb21vb24AAQIAAQA6+BwC+BsD+BgEHgoAGVP/i4seCgAZU/+LiwwHi2v4lPh0BR0AAACIDx0AAACNER0AAAAJHQAAAdASAAkBAQgPERMWGyAlKmljb21vb25pY29tb29udTB1MXUyMHVGMEQ3dUYwRDh1RjBEOXVGMERBAAACAYkABgAIAgABAAQABwAKAA0AVgCfAOgBL/yUDvyUDvyUDvuUDvtvi/emFYuQjZCOjo+Pj42Qiwj3lIsFkIuQiY6Hj4iNhouGi4aJh4eHCPsU+xQFiIiGiYaLhouHjYeOCPsU9xQFiI+Jj4uQCA77b4v3FBWLkI2Pjo8I9xT3FAWPjo+NkIuQi5CJjogI9xT7FAWPh42Hi4aLhomHh4eIiIaJhosI+5SLBYaLh42HjoiPiY+LkAgO+92d928Vi5CNkI+OCPcU9xQFjo+QjZCLkIuPiY6Hj4iNhouGCIv7lAWLhomHh4iIh4eJhouGi4aNiI8I+xT3FAWHjomPi5AIDvvdi+YVi/eUBYuQjZCOjo+Pj42Qi5CLkImOhwj3FPsUBY+IjYaLhouGiYeHiAj7FPsUBYiHhomGi4aLh42Hj4iOiY+LkAgO+JQU+JQViwwKAAAAAAMCAAGQAAUAAAFMAWYAAABHAUwBZgAAAPUAGQCEAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAQAAA8NoB4P/g/+AB4AAgAAAAAQAAAAAAAAAAAAAAIAAAAAAAAgAAAAMAAAAUAAMAAQAAABQABAA4AAAACgAIAAIAAgABACDw2v/9//8AAAAAACDw1//9//8AAf/jDy0AAwABAAAAAAAAAAAAAAABAAH//wAPAAEAAAABAAA5emozXw889QALAgAAAAAA0ABHWAAAAADQAEdYAAAAAAElAW4AAAAIAAIAAAAAAAAAAQAAAeD/4AAAAgAAAAAAASUAAQAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAABAAAAASUAAAElAAAAtwASALcAAAAAUAAACAAAAAAADgCuAAEAAAAAAAEADgAAAAEAAAAAAAIADgBHAAEAAAAAAAMADgAkAAEAAAAAAAQADgBVAAEAAAAAAAUAFgAOAAEAAAAAAAYABwAyAAEAAAAAAAoANABjAAMAAQQJAAEADgAAAAMAAQQJAAIADgBHAAMAAQQJAAMADgAkAAMAAQQJAAQADgBVAAMAAQQJAAUAFgAOAAMAAQQJAAYADgA5AAMAAQQJAAoANABjAGkAYwBvAG0AbwBvAG4AVgBlAHIAcwBpAG8AbgAgADEALgAwAGkAYwBvAG0AbwBvAG5pY29tb29uAGkAYwBvAG0AbwBvAG4AUgBlAGcAdQBsAGEAcgBpAGMAbwBtAG8AbwBuAEYAbwBuAHQAIABnAGUAbgBlAHIAYQB0AGUAZAAgAGIAeQAgAEkAYwBvAE0AbwBvAG4ALgAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA) format('woff');
+ font-weight: normal;
+ font-style: normal;
+}
+.ui.dropdown > .dropdown.icon {
+ font-family: 'Dropdown';
+ line-height: 1;
+ height: 1em;
+ width: 1.23em;
+ backface-visibility: hidden;
+ font-weight: normal;
+ font-style: normal;
+ text-align: center;
+}
+.ui.dropdown > .dropdown.icon {
+ width: auto;
+}
+.ui.dropdown > .dropdown.icon:before {
+ content: '\f0d7';
+}
+
+/* Sub Menu */
+.ui.dropdown .menu .item .dropdown.icon:before {
+ content: '\f0da' /*rtl:'\f0d9'*/;
+}
+.ui.dropdown .item .left.dropdown.icon:before,
+.ui.dropdown .left.menu .item .dropdown.icon:before {
+ content: "\f0d9" /*rtl:"\f0da"*/;
+}
+
+/* Vertical Menu Dropdown */
+.ui.vertical.menu .dropdown.item > .dropdown.icon:before {
+ content: "\f0da" /*rtl:"\f0d9"*/;
+}
+/* Icons for Reference
+.dropdown.down.icon {
+ content: "\f0d7";
+}
+.dropdown.up.icon {
+ content: "\f0d8";
+}
+.dropdown.left.icon {
+ content: "\f0d9";
+}
+.dropdown.icon.icon {
+ content: "\f0da";
+}
+*/
+
+
+/*******************************
+ User Overrides
+*******************************/
+
diff --git a/web_src/fomantic/build/components/dropdown.js b/web_src/fomantic/build/components/dropdown.js
new file mode 100644
index 0000000000..9edd33d11c
--- /dev/null
+++ b/web_src/fomantic/build/components/dropdown.js
@@ -0,0 +1,4238 @@
+/*!
+ * # Fomantic-UI - Dropdown
+ * http://github.com/fomantic/Fomantic-UI/
+ *
+ *
+ * Released under the MIT license
+ * http://opensource.org/licenses/MIT
+ *
+ */
+
+;(function ($, window, document, undefined) {
+
+'use strict';
+
+$.isFunction = $.isFunction || function(obj) {
+ return typeof obj === "function" && typeof obj.nodeType !== "number";
+};
+
+window = (typeof window != 'undefined' && window.Math == Math)
+ ? window
+ : (typeof self != 'undefined' && self.Math == Math)
+ ? self
+ : Function('return this')()
+;
+
+$.fn.dropdown = function(parameters) {
+ var
+ $allModules = $(this),
+ $document = $(document),
+
+ moduleSelector = $allModules.selector || '',
+
+ hasTouch = ('ontouchstart' in document.documentElement),
+ clickEvent = hasTouch
+ ? 'touchstart'
+ : 'click',
+
+ time = new Date().getTime(),
+ performance = [],
+
+ query = arguments[0],
+ methodInvoked = (typeof query == 'string'),
+ queryArguments = [].slice.call(arguments, 1),
+ returnedValue
+ ;
+
+ $allModules
+ .each(function(elementIndex) {
+ var
+ settings = ( $.isPlainObject(parameters) )
+ ? $.extend(true, {}, $.fn.dropdown.settings, parameters)
+ : $.extend({}, $.fn.dropdown.settings),
+
+ className = settings.className,
+ message = settings.message,
+ fields = settings.fields,
+ keys = settings.keys,
+ metadata = settings.metadata,
+ namespace = settings.namespace,
+ regExp = settings.regExp,
+ selector = settings.selector,
+ error = settings.error,
+ templates = settings.templates,
+
+ eventNamespace = '.' + namespace,
+ moduleNamespace = 'module-' + namespace,
+
+ $module = $(this),
+ $context = $(settings.context),
+ $text = $module.find(selector.text),
+ $search = $module.find(selector.search),
+ $sizer = $module.find(selector.sizer),
+ $input = $module.find(selector.input),
+ $icon = $module.find(selector.icon),
+ $clear = $module.find(selector.clearIcon),
+
+ $combo = ($module.prev().find(selector.text).length > 0)
+ ? $module.prev().find(selector.text)
+ : $module.prev(),
+
+ $menu = $module.children(selector.menu),
+ $item = $menu.find(selector.item),
+ $divider = settings.hideDividers ? $item.parent().children(selector.divider) : $(),
+
+ activated = false,
+ itemActivated = false,
+ internalChange = false,
+ iconClicked = false,
+ element = this,
+ instance = $module.data(moduleNamespace),
+
+ selectActionActive,
+ initialLoad,
+ pageLostFocus,
+ willRefocus,
+ elementNamespace,
+ id,
+ selectObserver,
+ menuObserver,
+ classObserver,
+ module
+ ;
+
+ module = {
+
+ initialize: function() {
+ module.debug('Initializing dropdown', settings);
+
+ if( module.is.alreadySetup() ) {
+ module.setup.reference();
+ }
+ else {
+ if (settings.ignoreDiacritics && !String.prototype.normalize) {
+ settings.ignoreDiacritics = false;
+ module.error(error.noNormalize, element);
+ }
+
+ module.setup.layout();
+
+ if(settings.values) {
+ module.set.initialLoad();
+ module.change.values(settings.values);
+ module.remove.initialLoad();
+ }
+
+ module.refreshData();
+
+ module.save.defaults();
+ module.restore.selected();
+
+ module.create.id();
+ module.bind.events();
+
+ module.observeChanges();
+ module.instantiate();
+ }
+
+ },
+
+ instantiate: function() {
+ module.verbose('Storing instance of dropdown', module);
+ instance = module;
+ $module
+ .data(moduleNamespace, module)
+ ;
+ },
+
+ destroy: function() {
+ module.verbose('Destroying previous dropdown', $module);
+ module.remove.tabbable();
+ module.remove.active();
+ $menu.transition('stop all');
+ $menu.removeClass(className.visible).addClass(className.hidden);
+ $module
+ .off(eventNamespace)
+ .removeData(moduleNamespace)
+ ;
+ $menu
+ .off(eventNamespace)
+ ;
+ $document
+ .off(elementNamespace)
+ ;
+ module.disconnect.menuObserver();
+ module.disconnect.selectObserver();
+ module.disconnect.classObserver();
+ },
+
+ observeChanges: function() {
+ if('MutationObserver' in window) {
+ selectObserver = new MutationObserver(module.event.select.mutation);
+ menuObserver = new MutationObserver(module.event.menu.mutation);
+ classObserver = new MutationObserver(module.event.class.mutation);
+ module.debug('Setting up mutation observer', selectObserver, menuObserver, classObserver);
+ module.observe.select();
+ module.observe.menu();
+ module.observe.class();
+ }
+ },
+
+ disconnect: {
+ menuObserver: function() {
+ if(menuObserver) {
+ menuObserver.disconnect();
+ }
+ },
+ selectObserver: function() {
+ if(selectObserver) {
+ selectObserver.disconnect();
+ }
+ },
+ classObserver: function() {
+ if(classObserver) {
+ classObserver.disconnect();
+ }
+ }
+ },
+ observe: {
+ select: function() {
+ if(module.has.input() && selectObserver) {
+ selectObserver.observe($module[0], {
+ childList : true,
+ subtree : true
+ });
+ }
+ },
+ menu: function() {
+ if(module.has.menu() && menuObserver) {
+ menuObserver.observe($menu[0], {
+ childList : true,
+ subtree : true
+ });
+ }
+ },
+ class: function() {
+ if(module.has.search() && classObserver) {
+ classObserver.observe($module[0], {
+ attributes : true
+ });
+ }
+ }
+ },
+
+ create: {
+ id: function() {
+ id = (Math.random().toString(16) + '000000000').substr(2, 8);
+ elementNamespace = '.' + id;
+ module.verbose('Creating unique id for element', id);
+ },
+ userChoice: function(values) {
+ var
+ $userChoices,
+ $userChoice,
+ isUserValue,
+ html
+ ;
+ values = values || module.get.userValues();
+ if(!values) {
+ return false;
+ }
+ values = Array.isArray(values)
+ ? values
+ : [values]
+ ;
+ $.each(values, function(index, value) {
+ if(module.get.item(value) === false) {
+ html = settings.templates.addition( module.add.variables(message.addResult, value) );
+ $userChoice = $('')
+ .html(html)
+ .attr('data-' + metadata.value, value)
+ .attr('data-' + metadata.text, value)
+ .addClass(className.addition)
+ .addClass(className.item)
+ ;
+ if(settings.hideAdditions) {
+ $userChoice.addClass(className.hidden);
+ }
+ $userChoices = ($userChoices === undefined)
+ ? $userChoice
+ : $userChoices.add($userChoice)
+ ;
+ module.verbose('Creating user choices for value', value, $userChoice);
+ }
+ });
+ return $userChoices;
+ },
+ userLabels: function(value) {
+ var
+ userValues = module.get.userValues()
+ ;
+ if(userValues) {
+ module.debug('Adding user labels', userValues);
+ $.each(userValues, function(index, value) {
+ module.verbose('Adding custom user value');
+ module.add.label(value, value);
+ });
+ }
+ },
+ menu: function() {
+ $menu = $('')
+ .addClass(className.menu)
+ .appendTo($module)
+ ;
+ },
+ sizer: function() {
+ $sizer = $('')
+ .addClass(className.sizer)
+ .insertAfter($search)
+ ;
+ }
+ },
+
+ search: function(query) {
+ query = (query !== undefined)
+ ? query
+ : module.get.query()
+ ;
+ module.verbose('Searching for query', query);
+ if(module.has.minCharacters(query)) {
+ module.filter(query);
+ }
+ else {
+ module.hide(null,true);
+ }
+ },
+
+ select: {
+ firstUnfiltered: function() {
+ module.verbose('Selecting first non-filtered element');
+ module.remove.selectedItem();
+ $item
+ .not(selector.unselectable)
+ .not(selector.addition + selector.hidden)
+ .eq(0)
+ .addClass(className.selected)
+ ;
+ },
+ nextAvailable: function($selected) {
+ $selected = $selected.eq(0);
+ var
+ $nextAvailable = $selected.nextAll(selector.item).not(selector.unselectable).eq(0),
+ $prevAvailable = $selected.prevAll(selector.item).not(selector.unselectable).eq(0),
+ hasNext = ($nextAvailable.length > 0)
+ ;
+ if(hasNext) {
+ module.verbose('Moving selection to', $nextAvailable);
+ $nextAvailable.addClass(className.selected);
+ }
+ else {
+ module.verbose('Moving selection to', $prevAvailable);
+ $prevAvailable.addClass(className.selected);
+ }
+ }
+ },
+
+ setup: {
+ api: function() {
+ var
+ apiSettings = {
+ debug : settings.debug,
+ urlData : {
+ value : module.get.value(),
+ query : module.get.query()
+ },
+ on : false
+ }
+ ;
+ module.verbose('First request, initializing API');
+ $module
+ .api(apiSettings)
+ ;
+ },
+ layout: function() {
+ if( $module.is('select') ) {
+ module.setup.select();
+ module.setup.returnedObject();
+ }
+ if( !module.has.menu() ) {
+ module.create.menu();
+ }
+ if ( module.is.selection() && module.is.clearable() && !module.has.clearItem() ) {
+ module.verbose('Adding clear icon');
+ $clear = $('')
+ .addClass('remove icon')
+ .insertBefore($text)
+ ;
+ }
+ if( module.is.search() && !module.has.search() ) {
+ module.verbose('Adding search input');
+ $search = $('')
+ .addClass(className.search)
+ .prop('autocomplete', 'off')
+ .insertBefore($text)
+ ;
+ }
+ if( module.is.multiple() && module.is.searchSelection() && !module.has.sizer()) {
+ module.create.sizer();
+ }
+ if(settings.allowTab) {
+ module.set.tabbable();
+ }
+ },
+ select: function() {
+ var
+ selectValues = module.get.selectValues()
+ ;
+ module.debug('Dropdown initialized on a select', selectValues);
+ if( $module.is('select') ) {
+ $input = $module;
+ }
+ // see if select is placed correctly already
+ if($input.parent(selector.dropdown).length > 0) {
+ module.debug('UI dropdown already exists. Creating dropdown menu only');
+ $module = $input.closest(selector.dropdown);
+ if( !module.has.menu() ) {
+ module.create.menu();
+ }
+ $menu = $module.children(selector.menu);
+ module.setup.menu(selectValues);
+ }
+ else {
+ module.debug('Creating entire dropdown from select');
+ $module = $('')
+ .attr('class', $input.attr('class') )
+ .addClass(className.selection)
+ .addClass(className.dropdown)
+ .html( templates.dropdown(selectValues, fields, settings.preserveHTML, settings.className) )
+ .insertBefore($input)
+ ;
+ if($input.hasClass(className.multiple) && $input.prop('multiple') === false) {
+ module.error(error.missingMultiple);
+ $input.prop('multiple', true);
+ }
+ if($input.is('[multiple]')) {
+ module.set.multiple();
+ }
+ if ($input.prop('disabled')) {
+ module.debug('Disabling dropdown');
+ $module.addClass(className.disabled);
+ }
+ $input
+ .removeAttr('required')
+ .removeAttr('class')
+ .detach()
+ .prependTo($module)
+ ;
+ }
+ module.refresh();
+ },
+ menu: function(values) {
+ $menu.html( templates.menu(values, fields,settings.preserveHTML,settings.className));
+ $item = $menu.find(selector.item);
+ $divider = settings.hideDividers ? $item.parent().children(selector.divider) : $();
+ },
+ reference: function() {
+ module.debug('Dropdown behavior was called on select, replacing with closest dropdown');
+ // replace module reference
+ $module = $module.parent(selector.dropdown);
+ instance = $module.data(moduleNamespace);
+ element = $module.get(0);
+ module.refresh();
+ module.setup.returnedObject();
+ },
+ returnedObject: function() {
+ var
+ $firstModules = $allModules.slice(0, elementIndex),
+ $lastModules = $allModules.slice(elementIndex + 1)
+ ;
+ // adjust all modules to use correct reference
+ $allModules = $firstModules.add($module).add($lastModules);
+ }
+ },
+
+ refresh: function() {
+ module.refreshSelectors();
+ module.refreshData();
+ },
+
+ refreshItems: function() {
+ $item = $menu.find(selector.item);
+ $divider = settings.hideDividers ? $item.parent().children(selector.divider) : $();
+ },
+
+ refreshSelectors: function() {
+ module.verbose('Refreshing selector cache');
+ $text = $module.find(selector.text);
+ $search = $module.find(selector.search);
+ $input = $module.find(selector.input);
+ $icon = $module.find(selector.icon);
+ $combo = ($module.prev().find(selector.text).length > 0)
+ ? $module.prev().find(selector.text)
+ : $module.prev()
+ ;
+ $menu = $module.children(selector.menu);
+ $item = $menu.find(selector.item);
+ $divider = settings.hideDividers ? $item.parent().children(selector.divider) : $();
+ },
+
+ refreshData: function() {
+ module.verbose('Refreshing cached metadata');
+ $item
+ .removeData(metadata.text)
+ .removeData(metadata.value)
+ ;
+ },
+
+ clearData: function() {
+ module.verbose('Clearing metadata');
+ $item
+ .removeData(metadata.text)
+ .removeData(metadata.value)
+ ;
+ $module
+ .removeData(metadata.defaultText)
+ .removeData(metadata.defaultValue)
+ .removeData(metadata.placeholderText)
+ ;
+ },
+
+ toggle: function() {
+ module.verbose('Toggling menu visibility');
+ if( !module.is.active() ) {
+ module.show();
+ }
+ else {
+ module.hide();
+ }
+ },
+
+ show: function(callback, preventFocus) {
+ callback = $.isFunction(callback)
+ ? callback
+ : function(){}
+ ;
+ if(!module.can.show() && module.is.remote()) {
+ module.debug('No API results retrieved, searching before show');
+ module.queryRemote(module.get.query(), module.show);
+ }
+ if( module.can.show() && !module.is.active() ) {
+ module.debug('Showing dropdown');
+ if(module.has.message() && !(module.has.maxSelections() || module.has.allResultsFiltered()) ) {
+ module.remove.message();
+ }
+ if(module.is.allFiltered()) {
+ return true;
+ }
+ if(settings.onShow.call(element) !== false) {
+ module.animate.show(function() {
+ if( module.can.click() ) {
+ module.bind.intent();
+ }
+ if(module.has.search() && !preventFocus) {
+ module.focusSearch();
+ }
+ module.set.visible();
+ callback.call(element);
+ });
+ }
+ }
+ },
+
+ hide: function(callback, preventBlur) {
+ callback = $.isFunction(callback)
+ ? callback
+ : function(){}
+ ;
+ if( module.is.active() && !module.is.animatingOutward() ) {
+ module.debug('Hiding dropdown');
+ if(settings.onHide.call(element) !== false) {
+ module.animate.hide(function() {
+ module.remove.visible();
+ // hidding search focus
+ if ( module.is.focusedOnSearch() && preventBlur !== true ) {
+ $search.blur();
+ }
+ callback.call(element);
+ });
+ }
+ } else if( module.can.click() ) {
+ module.unbind.intent();
+ }
+ iconClicked = false;
+ },
+
+ hideOthers: function() {
+ module.verbose('Finding other dropdowns to hide');
+ $allModules
+ .not($module)
+ .has(selector.menu + '.' + className.visible)
+ .dropdown('hide')
+ ;
+ },
+
+ hideMenu: function() {
+ module.verbose('Hiding menu instantaneously');
+ module.remove.active();
+ module.remove.visible();
+ $menu.transition('hide');
+ },
+
+ hideSubMenus: function() {
+ var
+ $subMenus = $menu.children(selector.item).find(selector.menu)
+ ;
+ module.verbose('Hiding sub menus', $subMenus);
+ $subMenus.transition('hide');
+ },
+
+ bind: {
+ events: function() {
+ module.bind.keyboardEvents();
+ module.bind.inputEvents();
+ module.bind.mouseEvents();
+ },
+ keyboardEvents: function() {
+ module.verbose('Binding keyboard events');
+ $module
+ .on('keydown' + eventNamespace, module.event.keydown)
+ ;
+ if( module.has.search() ) {
+ $module
+ .on(module.get.inputEvent() + eventNamespace, selector.search, module.event.input)
+ ;
+ }
+ if( module.is.multiple() ) {
+ $document
+ .on('keydown' + elementNamespace, module.event.document.keydown)
+ ;
+ }
+ },
+ inputEvents: function() {
+ module.verbose('Binding input change events');
+ $module
+ .on('change' + eventNamespace, selector.input, module.event.change)
+ ;
+ },
+ mouseEvents: function() {
+ module.verbose('Binding mouse events');
+ if(module.is.multiple()) {
+ $module
+ .on(clickEvent + eventNamespace, selector.label, module.event.label.click)
+ .on(clickEvent + eventNamespace, selector.remove, module.event.remove.click)
+ ;
+ }
+ if( module.is.searchSelection() ) {
+ $module
+ .on('mousedown' + eventNamespace, module.event.mousedown)
+ .on('mouseup' + eventNamespace, module.event.mouseup)
+ .on('mousedown' + eventNamespace, selector.menu, module.event.menu.mousedown)
+ .on('mouseup' + eventNamespace, selector.menu, module.event.menu.mouseup)
+ .on(clickEvent + eventNamespace, selector.icon, module.event.icon.click)
+ .on(clickEvent + eventNamespace, selector.clearIcon, module.event.clearIcon.click)
+ .on('focus' + eventNamespace, selector.search, module.event.search.focus)
+ .on(clickEvent + eventNamespace, selector.search, module.event.search.focus)
+ .on('blur' + eventNamespace, selector.search, module.event.search.blur)
+ .on(clickEvent + eventNamespace, selector.text, module.event.text.focus)
+ ;
+ if(module.is.multiple()) {
+ $module
+ .on(clickEvent + eventNamespace, module.event.click)
+ ;
+ }
+ }
+ else {
+ if(settings.on == 'click') {
+ $module
+ .on(clickEvent + eventNamespace, selector.icon, module.event.icon.click)
+ .on(clickEvent + eventNamespace, module.event.test.toggle)
+ ;
+ }
+ else if(settings.on == 'hover') {
+ $module
+ .on('mouseenter' + eventNamespace, module.delay.show)
+ .on('mouseleave' + eventNamespace, module.delay.hide)
+ ;
+ }
+ else {
+ $module
+ .on(settings.on + eventNamespace, module.toggle)
+ ;
+ }
+ $module
+ .on('mousedown' + eventNamespace, module.event.mousedown)
+ .on('mouseup' + eventNamespace, module.event.mouseup)
+ .on('focus' + eventNamespace, module.event.focus)
+ .on(clickEvent + eventNamespace, selector.clearIcon, module.event.clearIcon.click)
+ ;
+ if(module.has.menuSearch() ) {
+ $module
+ .on('blur' + eventNamespace, selector.search, module.event.search.blur)
+ ;
+ }
+ else {
+ $module
+ .on('blur' + eventNamespace, module.event.blur)
+ ;
+ }
+ }
+ $menu
+ .on((hasTouch ? 'touchstart' : 'mouseenter') + eventNamespace, selector.item, module.event.item.mouseenter)
+ .on('mouseleave' + eventNamespace, selector.item, module.event.item.mouseleave)
+ .on('click' + eventNamespace, selector.item, module.event.item.click)
+ ;
+ },
+ intent: function() {
+ module.verbose('Binding hide intent event to document');
+ if(hasTouch) {
+ $document
+ .on('touchstart' + elementNamespace, module.event.test.touch)
+ .on('touchmove' + elementNamespace, module.event.test.touch)
+ ;
+ }
+ $document
+ .on(clickEvent + elementNamespace, module.event.test.hide)
+ ;
+ }
+ },
+
+ unbind: {
+ intent: function() {
+ module.verbose('Removing hide intent event from document');
+ if(hasTouch) {
+ $document
+ .off('touchstart' + elementNamespace)
+ .off('touchmove' + elementNamespace)
+ ;
+ }
+ $document
+ .off(clickEvent + elementNamespace)
+ ;
+ }
+ },
+
+ filter: function(query) {
+ var
+ searchTerm = (query !== undefined)
+ ? query
+ : module.get.query(),
+ afterFiltered = function() {
+ if(module.is.multiple()) {
+ module.filterActive();
+ }
+ if(query || (!query && module.get.activeItem().length == 0)) {
+ module.select.firstUnfiltered();
+ }
+ if( module.has.allResultsFiltered() ) {
+ if( settings.onNoResults.call(element, searchTerm) ) {
+ if(settings.allowAdditions) {
+ if(settings.hideAdditions) {
+ module.verbose('User addition with no menu, setting empty style');
+ module.set.empty();
+ module.hideMenu();
+ }
+ }
+ else {
+ module.verbose('All items filtered, showing message', searchTerm);
+ module.add.message(message.noResults);
+ }
+ }
+ else {
+ module.verbose('All items filtered, hiding dropdown', searchTerm);
+ module.hideMenu();
+ }
+ }
+ else {
+ module.remove.empty();
+ module.remove.message();
+ }
+ if(settings.allowAdditions) {
+ module.add.userSuggestion(module.escape.htmlEntities(query));
+ }
+ if(module.is.searchSelection() && module.can.show() && module.is.focusedOnSearch() ) {
+ module.show();
+ }
+ }
+ ;
+ if(settings.useLabels && module.has.maxSelections()) {
+ return;
+ }
+ if(settings.apiSettings) {
+ if( module.can.useAPI() ) {
+ module.queryRemote(searchTerm, function() {
+ if(settings.filterRemoteData) {
+ module.filterItems(searchTerm);
+ }
+ var preSelected = $input.val();
+ if(!Array.isArray(preSelected)) {
+ preSelected = preSelected && preSelected!=="" ? preSelected.split(settings.delimiter) : [];
+ }
+ $.each(preSelected,function(index,value){
+ $item.filter('[data-value="'+value+'"]')
+ .addClass(className.filtered)
+ ;
+ });
+ afterFiltered();
+ });
+ }
+ else {
+ module.error(error.noAPI);
+ }
+ }
+ else {
+ module.filterItems(searchTerm);
+ afterFiltered();
+ }
+ },
+
+ queryRemote: function(query, callback) {
+ var
+ apiSettings = {
+ errorDuration : false,
+ cache : 'local',
+ throttle : settings.throttle,
+ urlData : {
+ query: query
+ },
+ onError: function() {
+ module.add.message(message.serverError);
+ callback();
+ },
+ onFailure: function() {
+ module.add.message(message.serverError);
+ callback();
+ },
+ onSuccess : function(response) {
+ var
+ values = response[fields.remoteValues]
+ ;
+ if (!Array.isArray(values)){
+ values = [];
+ }
+ module.remove.message();
+ var menuConfig = {};
+ menuConfig[fields.values] = values;
+ module.setup.menu(menuConfig);
+
+ if(values.length===0 && !settings.allowAdditions) {
+ module.add.message(message.noResults);
+ }
+ callback();
+ }
+ }
+ ;
+ if( !$module.api('get request') ) {
+ module.setup.api();
+ }
+ apiSettings = $.extend(true, {}, apiSettings, settings.apiSettings);
+ $module
+ .api('setting', apiSettings)
+ .api('query')
+ ;
+ },
+
+ filterItems: function(query) {
+ var
+ searchTerm = module.remove.diacritics(query !== undefined
+ ? query
+ : module.get.query()
+ ),
+ results = null,
+ escapedTerm = module.escape.string(searchTerm),
+ regExpFlags = (settings.ignoreSearchCase ? 'i' : '') + 'gm',
+ beginsWithRegExp = new RegExp('^' + escapedTerm, regExpFlags)
+ ;
+ // avoid loop if we're matching nothing
+ if( module.has.query() ) {
+ results = [];
+
+ module.verbose('Searching for matching values', searchTerm);
+ $item
+ .each(function(){
+ var
+ $choice = $(this),
+ text,
+ value
+ ;
+ if($choice.hasClass(className.unfilterable)) {
+ results.push(this);
+ return true;
+ }
+ if(settings.match === 'both' || settings.match === 'text') {
+ text = module.remove.diacritics(String(module.get.choiceText($choice, false)));
+ if(text.search(beginsWithRegExp) !== -1) {
+ results.push(this);
+ return true;
+ }
+ else if (settings.fullTextSearch === 'exact' && module.exactSearch(searchTerm, text)) {
+ results.push(this);
+ return true;
+ }
+ else if (settings.fullTextSearch === true && module.fuzzySearch(searchTerm, text)) {
+ results.push(this);
+ return true;
+ }
+ }
+ if(settings.match === 'both' || settings.match === 'value') {
+ value = module.remove.diacritics(String(module.get.choiceValue($choice, text)));
+ if(value.search(beginsWithRegExp) !== -1) {
+ results.push(this);
+ return true;
+ }
+ else if (settings.fullTextSearch === 'exact' && module.exactSearch(searchTerm, value)) {
+ results.push(this);
+ return true;
+ }
+ else if (settings.fullTextSearch === true && module.fuzzySearch(searchTerm, value)) {
+ results.push(this);
+ return true;
+ }
+ }
+ })
+ ;
+ }
+ module.debug('Showing only matched items', searchTerm);
+ module.remove.filteredItem();
+ if(results) {
+ $item
+ .not(results)
+ .addClass(className.filtered)
+ ;
+ }
+
+ if(!module.has.query()) {
+ $divider
+ .removeClass(className.hidden);
+ } else if(settings.hideDividers === true) {
+ $divider
+ .addClass(className.hidden);
+ } else if(settings.hideDividers === 'empty') {
+ $divider
+ .removeClass(className.hidden)
+ .filter(function() {
+ // First find the last divider in this divider group
+ // Dividers which are direct siblings are considered a group
+ var lastDivider = $(this).nextUntil(selector.item);
+
+ return (lastDivider.length ? lastDivider : $(this))
+ // Count all non-filtered items until the next divider (or end of the dropdown)
+ .nextUntil(selector.divider)
+ .filter(selector.item + ":not(." + className.filtered + ")")
+ // Hide divider if no items are found
+ .length === 0;
+ })
+ .addClass(className.hidden);
+ }
+ },
+
+ fuzzySearch: function(query, term) {
+ var
+ termLength = term.length,
+ queryLength = query.length
+ ;
+ query = (settings.ignoreSearchCase ? query.toLowerCase() : query);
+ term = (settings.ignoreSearchCase ? term.toLowerCase() : term);
+ if(queryLength > termLength) {
+ return false;
+ }
+ if(queryLength === termLength) {
+ return (query === term);
+ }
+ search: for (var characterIndex = 0, nextCharacterIndex = 0; characterIndex < queryLength; characterIndex++) {
+ var
+ queryCharacter = query.charCodeAt(characterIndex)
+ ;
+ while(nextCharacterIndex < termLength) {
+ if(term.charCodeAt(nextCharacterIndex++) === queryCharacter) {
+ continue search;
+ }
+ }
+ return false;
+ }
+ return true;
+ },
+ exactSearch: function (query, term) {
+ query = (settings.ignoreSearchCase ? query.toLowerCase() : query);
+ term = (settings.ignoreSearchCase ? term.toLowerCase() : term);
+ return term.indexOf(query) > -1;
+
+ },
+ filterActive: function() {
+ if(settings.useLabels) {
+ $item.filter('.' + className.active)
+ .addClass(className.filtered)
+ ;
+ }
+ },
+
+ focusSearch: function(skipHandler) {
+ if( module.has.search() && !module.is.focusedOnSearch() ) {
+ if(skipHandler) {
+ $module.off('focus' + eventNamespace, selector.search);
+ $search.focus();
+ $module.on('focus' + eventNamespace, selector.search, module.event.search.focus);
+ }
+ else {
+ $search.focus();
+ }
+ }
+ },
+
+ blurSearch: function() {
+ if( module.has.search() ) {
+ $search.blur();
+ }
+ },
+
+ forceSelection: function() {
+ var
+ $currentlySelected = $item.not(className.filtered).filter('.' + className.selected).eq(0),
+ $activeItem = $item.not(className.filtered).filter('.' + className.active).eq(0),
+ $selectedItem = ($currentlySelected.length > 0)
+ ? $currentlySelected
+ : $activeItem,
+ hasSelected = ($selectedItem.length > 0)
+ ;
+ if(settings.allowAdditions || (hasSelected && !module.is.multiple())) {
+ module.debug('Forcing partial selection to selected item', $selectedItem);
+ module.event.item.click.call($selectedItem, {}, true);
+ }
+ else {
+ module.remove.searchTerm();
+ }
+ },
+
+ change: {
+ values: function(values) {
+ if(!settings.allowAdditions) {
+ module.clear();
+ }
+ module.debug('Creating dropdown with specified values', values);
+ var menuConfig = {};
+ menuConfig[fields.values] = values;
+ module.setup.menu(menuConfig);
+ $.each(values, function(index, item) {
+ if(item.selected == true) {
+ module.debug('Setting initial selection to', item[fields.value]);
+ module.set.selected(item[fields.value]);
+ if(!module.is.multiple()) {
+ return false;
+ }
+ }
+ });
+
+ if(module.has.selectInput()) {
+ module.disconnect.selectObserver();
+ $input.html('');
+ $input.append('');
+ $.each(values, function(index, item) {
+ var
+ value = settings.templates.deQuote(item[fields.value]),
+ name = settings.templates.escape(
+ item[fields.name] || '',
+ settings.preserveHTML
+ )
+ ;
+ $input.append('');
+ });
+ module.observe.select();
+ }
+ }
+ },
+
+ event: {
+ change: function() {
+ if(!internalChange) {
+ module.debug('Input changed, updating selection');
+ module.set.selected();
+ }
+ },
+ focus: function() {
+ if(settings.showOnFocus && !activated && module.is.hidden() && !pageLostFocus) {
+ module.show();
+ }
+ },
+ blur: function(event) {
+ pageLostFocus = (document.activeElement === this);
+ if(!activated && !pageLostFocus) {
+ module.remove.activeLabel();
+ module.hide();
+ }
+ },
+ mousedown: function() {
+ if(module.is.searchSelection()) {
+ // prevent menu hiding on immediate re-focus
+ willRefocus = true;
+ }
+ else {
+ // prevents focus callback from occurring on mousedown
+ activated = true;
+ }
+ },
+ mouseup: function() {
+ if(module.is.searchSelection()) {
+ // prevent menu hiding on immediate re-focus
+ willRefocus = false;
+ }
+ else {
+ activated = false;
+ }
+ },
+ click: function(event) {
+ var
+ $target = $(event.target)
+ ;
+ // focus search
+ if($target.is($module)) {
+ if(!module.is.focusedOnSearch()) {
+ module.focusSearch();
+ }
+ else {
+ module.show();
+ }
+ }
+ },
+ search: {
+ focus: function(event) {
+ activated = true;
+ if(module.is.multiple()) {
+ module.remove.activeLabel();
+ }
+ if(settings.showOnFocus || (event.type !== 'focus' && event.type !== 'focusin')) {
+ module.search();
+ }
+ },
+ blur: function(event) {
+ pageLostFocus = (document.activeElement === this);
+ if(module.is.searchSelection() && !willRefocus) {
+ if(!itemActivated && !pageLostFocus) {
+ if(settings.forceSelection) {
+ module.forceSelection();
+ } else if(!settings.allowAdditions){
+ module.remove.searchTerm();
+ }
+ module.hide();
+ }
+ }
+ willRefocus = false;
+ }
+ },
+ clearIcon: {
+ click: function(event) {
+ module.clear();
+ if(module.is.searchSelection()) {
+ module.remove.searchTerm();
+ }
+ module.hide();
+ event.stopPropagation();
+ }
+ },
+ icon: {
+ click: function(event) {
+ iconClicked=true;
+ if(module.has.search()) {
+ if(!module.is.active()) {
+ if(settings.showOnFocus){
+ module.focusSearch();
+ } else {
+ module.toggle();
+ }
+ } else {
+ module.blurSearch();
+ }
+ } else {
+ module.toggle();
+ }
+ }
+ },
+ text: {
+ focus: function(event) {
+ activated = true;
+ module.focusSearch();
+ }
+ },
+ input: function(event) {
+ if(module.is.multiple() || module.is.searchSelection()) {
+ module.set.filtered();
+ }
+ clearTimeout(module.timer);
+ module.timer = setTimeout(module.search, settings.delay.search);
+ },
+ label: {
+ click: function(event) {
+ var
+ $label = $(this),
+ $labels = $module.find(selector.label),
+ $activeLabels = $labels.filter('.' + className.active),
+ $nextActive = $label.nextAll('.' + className.active),
+ $prevActive = $label.prevAll('.' + className.active),
+ $range = ($nextActive.length > 0)
+ ? $label.nextUntil($nextActive).add($activeLabels).add($label)
+ : $label.prevUntil($prevActive).add($activeLabels).add($label)
+ ;
+ if(event.shiftKey) {
+ $activeLabels.removeClass(className.active);
+ $range.addClass(className.active);
+ }
+ else if(event.ctrlKey) {
+ $label.toggleClass(className.active);
+ }
+ else {
+ $activeLabels.removeClass(className.active);
+ $label.addClass(className.active);
+ }
+ settings.onLabelSelect.apply(this, $labels.filter('.' + className.active));
+ }
+ },
+ remove: {
+ click: function() {
+ var
+ $label = $(this).parent()
+ ;
+ if( $label.hasClass(className.active) ) {
+ // remove all selected labels
+ module.remove.activeLabels();
+ }
+ else {
+ // remove this label only
+ module.remove.activeLabels( $label );
+ }
+ }
+ },
+ test: {
+ toggle: function(event) {
+ var
+ toggleBehavior = (module.is.multiple())
+ ? module.show
+ : module.toggle
+ ;
+ if(module.is.bubbledLabelClick(event) || module.is.bubbledIconClick(event)) {
+ return;
+ }
+ if( module.determine.eventOnElement(event, toggleBehavior) ) {
+ event.preventDefault();
+ }
+ },
+ touch: function(event) {
+ module.determine.eventOnElement(event, function() {
+ if(event.type == 'touchstart') {
+ module.timer = setTimeout(function() {
+ module.hide();
+ }, settings.delay.touch);
+ }
+ else if(event.type == 'touchmove') {
+ clearTimeout(module.timer);
+ }
+ });
+ event.stopPropagation();
+ },
+ hide: function(event) {
+ if(module.determine.eventInModule(event, module.hide)){
+ if(element.id && $(event.target).attr('for') === element.id){
+ event.preventDefault();
+ }
+ }
+ }
+ },
+ class: {
+ mutation: function(mutations) {
+ mutations.forEach(function(mutation) {
+ if(mutation.attributeName === "class") {
+ module.check.disabled();
+ }
+ });
+ }
+ },
+ select: {
+ mutation: function(mutations) {
+ module.debug(' |