diff --git a/.gitmodules b/.gitmodules index 462b76b..be41bc0 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "src/data/gitattributes"] - path = src/data/gitattributes + path = archive/src/data/gitattributes url = https://github.com/alexkaratarakis/gitattributes.git diff --git a/.deployment b/archive/.deployment similarity index 100% rename from .deployment rename to archive/.deployment diff --git a/.editorconfig b/archive/.editorconfig similarity index 100% rename from .editorconfig rename to archive/.editorconfig diff --git a/.gitattributes b/archive/.gitattributes similarity index 100% rename from .gitattributes rename to archive/.gitattributes diff --git a/.gitignore b/archive/.gitignore similarity index 100% rename from .gitignore rename to archive/.gitignore diff --git a/.vscode/launch.json b/archive/.vscode/launch.json similarity index 100% rename from .vscode/launch.json rename to archive/.vscode/launch.json diff --git a/.vscode/tasks.json b/archive/.vscode/tasks.json similarity index 100% rename from .vscode/tasks.json rename to archive/.vscode/tasks.json diff --git a/NuGet.Config b/archive/NuGet.Config similarity index 100% rename from NuGet.Config rename to archive/NuGet.Config diff --git a/deploy.cmd b/archive/deploy.cmd similarity index 100% rename from deploy.cmd rename to archive/deploy.cmd diff --git a/gitattributes.sln b/archive/gitattributes.sln similarity index 100% rename from gitattributes.sln rename to archive/gitattributes.sln diff --git a/gitattributes.sln.DotSettings b/archive/gitattributes.sln.DotSettings similarity index 100% rename from gitattributes.sln.DotSettings rename to archive/gitattributes.sln.DotSettings diff --git a/src/Controllers/ApiController.cs b/archive/src/Controllers/ApiController.cs similarity index 100% rename from src/Controllers/ApiController.cs rename to archive/src/Controllers/ApiController.cs diff --git a/src/Controllers/HomeController.cs b/archive/src/Controllers/HomeController.cs similarity index 100% rename from src/Controllers/HomeController.cs rename to archive/src/Controllers/HomeController.cs diff --git a/src/Program.cs b/archive/src/Program.cs similarity index 100% rename from src/Program.cs rename to archive/src/Program.cs diff --git a/src/Properties/AppSettings.cs b/archive/src/Properties/AppSettings.cs similarity index 100% rename from src/Properties/AppSettings.cs rename to archive/src/Properties/AppSettings.cs diff --git a/src/Properties/launchSettings.json b/archive/src/Properties/launchSettings.json similarity index 100% rename from src/Properties/launchSettings.json rename to archive/src/Properties/launchSettings.json diff --git a/src/Startup.cs b/archive/src/Startup.cs similarity index 100% rename from src/Startup.cs rename to archive/src/Startup.cs diff --git a/src/Utils/AppData.cs b/archive/src/Utils/AppData.cs similarity index 100% rename from src/Utils/AppData.cs rename to archive/src/Utils/AppData.cs diff --git a/src/Utils/FileTemplateInfo.cs b/archive/src/Utils/FileTemplateInfo.cs similarity index 100% rename from src/Utils/FileTemplateInfo.cs rename to archive/src/Utils/FileTemplateInfo.cs diff --git a/src/Utils/PathResolver.cs b/archive/src/Utils/PathResolver.cs similarity index 100% rename from src/Utils/PathResolver.cs rename to archive/src/Utils/PathResolver.cs diff --git a/src/Utils/StringOutputFormatter2.cs b/archive/src/Utils/StringOutputFormatter2.cs similarity index 100% rename from src/Utils/StringOutputFormatter2.cs rename to archive/src/Utils/StringOutputFormatter2.cs diff --git a/src/Views/Home/Index.cshtml b/archive/src/Views/Home/Index.cshtml similarity index 100% rename from src/Views/Home/Index.cshtml rename to archive/src/Views/Home/Index.cshtml diff --git a/src/Views/Shared/Error.cshtml b/archive/src/Views/Shared/Error.cshtml similarity index 100% rename from src/Views/Shared/Error.cshtml rename to archive/src/Views/Shared/Error.cshtml diff --git a/src/Views/Shared/_Layout.cshtml b/archive/src/Views/Shared/_Layout.cshtml similarity index 100% rename from src/Views/Shared/_Layout.cshtml rename to archive/src/Views/Shared/_Layout.cshtml diff --git a/src/Views/_ViewImports.cshtml b/archive/src/Views/_ViewImports.cshtml similarity index 100% rename from src/Views/_ViewImports.cshtml rename to archive/src/Views/_ViewImports.cshtml diff --git a/src/Views/_ViewStart.cshtml b/archive/src/Views/_ViewStart.cshtml similarity index 100% rename from src/Views/_ViewStart.cshtml rename to archive/src/Views/_ViewStart.cshtml diff --git a/src/appsettings.Production.json b/archive/src/appsettings.Production.json similarity index 100% rename from src/appsettings.Production.json rename to archive/src/appsettings.Production.json diff --git a/src/appsettings.json b/archive/src/appsettings.json similarity index 100% rename from src/appsettings.json rename to archive/src/appsettings.json diff --git a/archive/src/data/gitattributes b/archive/src/data/gitattributes new file mode 160000 index 0000000..9164ae2 --- /dev/null +++ b/archive/src/data/gitattributes @@ -0,0 +1 @@ +Subproject commit 9164ae2dd6fd180a6303b5161baf1a3d87e2e3cd diff --git a/src/gitattributes.csproj b/archive/src/gitattributes.csproj similarity index 100% rename from src/gitattributes.csproj rename to archive/src/gitattributes.csproj diff --git a/src/gulpfile.js b/archive/src/gulpfile.js similarity index 100% rename from src/gulpfile.js rename to archive/src/gulpfile.js diff --git a/src/package-lock.json b/archive/src/package-lock.json similarity index 100% rename from src/package-lock.json rename to archive/src/package-lock.json diff --git a/src/package.json b/archive/src/package.json similarity index 100% rename from src/package.json rename to archive/src/package.json diff --git a/src/web.config b/archive/src/web.config similarity index 100% rename from src/web.config rename to archive/src/web.config diff --git a/src/wwwroot/_references.js b/archive/src/wwwroot/_references.js similarity index 100% rename from src/wwwroot/_references.js rename to archive/src/wwwroot/_references.js diff --git a/src/wwwroot/css/site.css b/archive/src/wwwroot/css/site.css similarity index 100% rename from src/wwwroot/css/site.css rename to archive/src/wwwroot/css/site.css diff --git a/src/wwwroot/favicon.ico b/archive/src/wwwroot/favicon.ico similarity index 100% rename from src/wwwroot/favicon.ico rename to archive/src/wwwroot/favicon.ico diff --git a/src/wwwroot/js/site.js b/archive/src/wwwroot/js/site.js similarity index 100% rename from src/wwwroot/js/site.js rename to archive/src/wwwroot/js/site.js diff --git a/src/wwwroot/lib/bootswatch-dist/css/bootstrap.css b/archive/src/wwwroot/lib/bootswatch-dist/css/bootstrap.css similarity index 100% rename from src/wwwroot/lib/bootswatch-dist/css/bootstrap.css rename to archive/src/wwwroot/lib/bootswatch-dist/css/bootstrap.css diff --git a/src/wwwroot/lib/bootswatch-dist/css/bootstrap.min.css b/archive/src/wwwroot/lib/bootswatch-dist/css/bootstrap.min.css similarity index 100% rename from src/wwwroot/lib/bootswatch-dist/css/bootstrap.min.css rename to archive/src/wwwroot/lib/bootswatch-dist/css/bootstrap.min.css diff --git a/src/wwwroot/lib/bootswatch-dist/fonts/glyphicons-halflings-regular.eot b/archive/src/wwwroot/lib/bootswatch-dist/fonts/glyphicons-halflings-regular.eot similarity index 100% rename from src/wwwroot/lib/bootswatch-dist/fonts/glyphicons-halflings-regular.eot rename to archive/src/wwwroot/lib/bootswatch-dist/fonts/glyphicons-halflings-regular.eot diff --git a/src/wwwroot/lib/bootswatch-dist/fonts/glyphicons-halflings-regular.svg b/archive/src/wwwroot/lib/bootswatch-dist/fonts/glyphicons-halflings-regular.svg similarity index 100% rename from src/wwwroot/lib/bootswatch-dist/fonts/glyphicons-halflings-regular.svg rename to archive/src/wwwroot/lib/bootswatch-dist/fonts/glyphicons-halflings-regular.svg diff --git a/src/wwwroot/lib/bootswatch-dist/fonts/glyphicons-halflings-regular.ttf b/archive/src/wwwroot/lib/bootswatch-dist/fonts/glyphicons-halflings-regular.ttf similarity index 100% rename from src/wwwroot/lib/bootswatch-dist/fonts/glyphicons-halflings-regular.ttf rename to archive/src/wwwroot/lib/bootswatch-dist/fonts/glyphicons-halflings-regular.ttf diff --git a/src/wwwroot/lib/bootswatch-dist/fonts/glyphicons-halflings-regular.woff b/archive/src/wwwroot/lib/bootswatch-dist/fonts/glyphicons-halflings-regular.woff similarity index 100% rename from src/wwwroot/lib/bootswatch-dist/fonts/glyphicons-halflings-regular.woff rename to archive/src/wwwroot/lib/bootswatch-dist/fonts/glyphicons-halflings-regular.woff diff --git a/src/wwwroot/lib/bootswatch-dist/fonts/glyphicons-halflings-regular.woff2 b/archive/src/wwwroot/lib/bootswatch-dist/fonts/glyphicons-halflings-regular.woff2 similarity index 100% rename from src/wwwroot/lib/bootswatch-dist/fonts/glyphicons-halflings-regular.woff2 rename to archive/src/wwwroot/lib/bootswatch-dist/fonts/glyphicons-halflings-regular.woff2 diff --git a/src/wwwroot/lib/bootswatch-dist/js/bootstrap.js b/archive/src/wwwroot/lib/bootswatch-dist/js/bootstrap.js similarity index 100% rename from src/wwwroot/lib/bootswatch-dist/js/bootstrap.js rename to archive/src/wwwroot/lib/bootswatch-dist/js/bootstrap.js diff --git a/src/wwwroot/lib/bootswatch-dist/js/bootstrap.min.js b/archive/src/wwwroot/lib/bootswatch-dist/js/bootstrap.min.js similarity index 100% rename from src/wwwroot/lib/bootswatch-dist/js/bootstrap.min.js rename to archive/src/wwwroot/lib/bootswatch-dist/js/bootstrap.min.js diff --git a/src/wwwroot/lib/jquery/js/jquery.js b/archive/src/wwwroot/lib/jquery/js/jquery.js similarity index 100% rename from src/wwwroot/lib/jquery/js/jquery.js rename to archive/src/wwwroot/lib/jquery/js/jquery.js diff --git a/src/wwwroot/lib/microplugin/js/microplugin.js b/archive/src/wwwroot/lib/microplugin/js/microplugin.js similarity index 100% rename from src/wwwroot/lib/microplugin/js/microplugin.js rename to archive/src/wwwroot/lib/microplugin/js/microplugin.js diff --git a/src/wwwroot/lib/selectize/css/selectize.bootstrap2.css b/archive/src/wwwroot/lib/selectize/css/selectize.bootstrap2.css similarity index 100% rename from src/wwwroot/lib/selectize/css/selectize.bootstrap2.css rename to archive/src/wwwroot/lib/selectize/css/selectize.bootstrap2.css diff --git a/src/wwwroot/lib/selectize/css/selectize.bootstrap3.css b/archive/src/wwwroot/lib/selectize/css/selectize.bootstrap3.css similarity index 100% rename from src/wwwroot/lib/selectize/css/selectize.bootstrap3.css rename to archive/src/wwwroot/lib/selectize/css/selectize.bootstrap3.css diff --git a/src/wwwroot/lib/selectize/css/selectize.css b/archive/src/wwwroot/lib/selectize/css/selectize.css similarity index 100% rename from src/wwwroot/lib/selectize/css/selectize.css rename to archive/src/wwwroot/lib/selectize/css/selectize.css diff --git a/src/wwwroot/lib/selectize/css/selectize.default.css b/archive/src/wwwroot/lib/selectize/css/selectize.default.css similarity index 100% rename from src/wwwroot/lib/selectize/css/selectize.default.css rename to archive/src/wwwroot/lib/selectize/css/selectize.default.css diff --git a/src/wwwroot/lib/selectize/css/selectize.legacy.css b/archive/src/wwwroot/lib/selectize/css/selectize.legacy.css similarity index 100% rename from src/wwwroot/lib/selectize/css/selectize.legacy.css rename to archive/src/wwwroot/lib/selectize/css/selectize.legacy.css diff --git a/src/wwwroot/lib/selectize/js/selectize.js b/archive/src/wwwroot/lib/selectize/js/selectize.js similarity index 100% rename from src/wwwroot/lib/selectize/js/selectize.js rename to archive/src/wwwroot/lib/selectize/js/selectize.js diff --git a/src/wwwroot/lib/selectize/js/selectize.min.js b/archive/src/wwwroot/lib/selectize/js/selectize.min.js similarity index 100% rename from src/wwwroot/lib/selectize/js/selectize.min.js rename to archive/src/wwwroot/lib/selectize/js/selectize.min.js diff --git a/src/wwwroot/lib/sifter/js/sifter.js b/archive/src/wwwroot/lib/sifter/js/sifter.js similarity index 100% rename from src/wwwroot/lib/sifter/js/sifter.js rename to archive/src/wwwroot/lib/sifter/js/sifter.js diff --git a/src/wwwroot/robots.txt b/archive/src/wwwroot/robots.txt similarity index 100% rename from src/wwwroot/robots.txt rename to archive/src/wwwroot/robots.txt diff --git a/src/data/gitattributes b/src/data/gitattributes deleted file mode 160000 index 60c331a..0000000 --- a/src/data/gitattributes +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 60c331a09d3fc8dc4e0796ba8421a48843a67dca diff --git a/web/.gitignore b/web/.gitignore new file mode 100644 index 0000000..decc798 --- /dev/null +++ b/web/.gitignore @@ -0,0 +1,39 @@ +# Build output +dist/ + +### VisualStudioCode ### +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +!.vscode/*.code-snippets + + +### Node ### +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* +.pnpm-debug.log* + +# Dependency directories +node_modules/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional stylelint cache +.stylelintcache + +### macOS ### +.DS_Store diff --git a/web/index.html b/web/index.html new file mode 100644 index 0000000..bf53ce5 --- /dev/null +++ b/web/index.html @@ -0,0 +1,39 @@ + +<!DOCTYPE html> +<html> +<head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <title>gitattributes.io - Create .gitattributes file for your project</title> + <!-- <link rel="stylesheet" type="text/css" href="./lib/bootswatch-dist/css/bootstrap.min.css"> --> + <link rel="stylesheet" type="text/css" href="./site.css"> +</head> +<body> +<div class="container body-content"> + <nav class="navbar navbar-inverse"> + <div class="container-fluid"> + <div class="navbar-header"> + <a class="navbar-brand" href="#">.gitattributes</a> + </div> + </div> + </nav> + <blockquote> + <p>Create <span class="text-info">.gitattributes</span> file for your project.</p> + </blockquote> + + <div class="input-group"> + <input type="text" id="types"> + <div class="input-group-btn"> + <button id="btnGenerate" type="button" class="btn btn-info">Generate</button> + <button id="btnDownload" type="button" class="btn btn-info">Download</button> + </div> + </div> + +<script id="ignores-data" type="application/json"> + [{"id":"actionscript","name":"ActionScript"},{"id":"ada","name":"Ada"},{"id":"ballerina","name":"Ballerina"},{"id":"c++","name":"C++"},{"id":"common","name":"Common"},{"id":"csharp","name":"CSharp"},{"id":"delphi","name":"Delphi"},{"id":"devcontainer","name":"DevContainer"},{"id":"drupal","name":"Drupal"},{"id":"elixir","name":"Elixir"},{"id":"flutter","name":"Flutter"},{"id":"fortran","name":"Fortran"},{"id":"fountain","name":"Fountain"},{"id":"fsharp","name":"FSharp"},{"id":"go","name":"Go"},{"id":"java","name":"Java"},{"id":"lua","name":"Lua"},{"id":"markdown","name":"Markdown"},{"id":"mathematica","name":"Mathematica"},{"id":"matlab","name":"Matlab"},{"id":"microsoftshell","name":"MicrosoftShell"},{"id":"objectivec","name":"ObjectiveC"},{"id":"pascal","name":"Pascal"},{"id":"perl","name":"Perl"},{"id":"powershell","name":"PowerShell"},{"id":"python","name":"Python"},{"id":"r","name":"R"},{"id":"rails","name":"Rails"},{"id":"rust","name":"Rust"},{"id":"servoy","name":"Servoy"},{"id":"sql","name":"sql"},{"id":"swift","name":"Swift"},{"id":"tinacms","name":"TinaCMS"},{"id":"unity","name":"Unity"},{"id":"vim","name":"Vim"},{"id":"visualstudio","name":"VisualStudio"},{"id":"visualstudiocode","name":"VisualStudioCode"},{"id":"web","name":"Web"}] +</script> +<script src="./site.js" type="module"></script> + +</div> +</body> +</html> diff --git a/web/package-lock.json b/web/package-lock.json new file mode 100644 index 0000000..69a4847 --- /dev/null +++ b/web/package-lock.json @@ -0,0 +1,240 @@ +{ + "name": "gitattributes-web", + "version": "2.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "gitattributes-web", + "version": "2.0.0", + "dependencies": { + "@selectize/selectize": "^0.15.2", + "bootswatch": "3.3.6", + "jquery": "^3.7.0", + "modern-normalize": "^2.0.0" + }, + "devDependencies": { + "vite": "^4.4.7" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.18.16", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@selectize/selectize": { + "version": "0.15.2", + "license": "Apache-2.0", + "engines": { + "node": "*" + }, + "optionalDependencies": { + "jquery-ui": "^1.13.2" + }, + "peerDependencies": { + "jquery": "^1.7.0 || ^2 || ^3" + } + }, + "node_modules/bootswatch": { + "version": "3.3.6", + "license": "MIT", + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/esbuild": { + "version": "0.18.16", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/android-arm": "0.18.16", + "@esbuild/android-arm64": "0.18.16", + "@esbuild/android-x64": "0.18.16", + "@esbuild/darwin-arm64": "0.18.16", + "@esbuild/darwin-x64": "0.18.16", + "@esbuild/freebsd-arm64": "0.18.16", + "@esbuild/freebsd-x64": "0.18.16", + "@esbuild/linux-arm": "0.18.16", + "@esbuild/linux-arm64": "0.18.16", + "@esbuild/linux-ia32": "0.18.16", + "@esbuild/linux-loong64": "0.18.16", + "@esbuild/linux-mips64el": "0.18.16", + "@esbuild/linux-ppc64": "0.18.16", + "@esbuild/linux-riscv64": "0.18.16", + "@esbuild/linux-s390x": "0.18.16", + "@esbuild/linux-x64": "0.18.16", + "@esbuild/netbsd-x64": "0.18.16", + "@esbuild/openbsd-x64": "0.18.16", + "@esbuild/sunos-x64": "0.18.16", + "@esbuild/win32-arm64": "0.18.16", + "@esbuild/win32-ia32": "0.18.16", + "@esbuild/win32-x64": "0.18.16" + } + }, + "node_modules/jquery": { + "version": "3.7.0", + "license": "MIT" + }, + "node_modules/jquery-ui": { + "version": "1.13.2", + "license": "MIT", + "optional": true, + "dependencies": { + "jquery": ">=1.8.0 <4.0.0" + } + }, + "node_modules/modern-normalize": { + "version": "2.0.0", + "license": "MIT", + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/nanoid": { + "version": "3.3.6", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/picocolors": { + "version": "1.0.0", + "dev": true, + "license": "ISC" + }, + "node_modules/postcss": { + "version": "8.4.27", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.6", + "picocolors": "^1.0.0", + "source-map-js": "^1.0.2" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/rollup": { + "version": "3.26.3", + "dev": true, + "license": "MIT", + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=14.18.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/source-map-js": { + "version": "1.0.2", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/vite": { + "version": "4.4.7", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "^0.18.10", + "postcss": "^8.4.26", + "rollup": "^3.25.2" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + }, + "peerDependencies": { + "@types/node": ">= 14", + "less": "*", + "lightningcss": "^1.21.0", + "sass": "*", + "stylus": "*", + "sugarss": "*", + "terser": "^5.4.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + } + } + } + } +} diff --git a/web/package.json b/web/package.json new file mode 100644 index 0000000..a026595 --- /dev/null +++ b/web/package.json @@ -0,0 +1,20 @@ +{ + "name": "gitattributes-web", + "private": true, + "version": "2.0.0", + "type": "module", + "scripts": { + "dev": "vite", + "build": "vite build", + "preview": "vite preview" + }, + "dependencies": { + "@selectize/selectize": "^0.15.2", + "bootswatch": "3.3.6", + "jquery": "^3.7.0", + "modern-normalize": "^2.0.0" + }, + "devDependencies": { + "vite": "^4.4.7" + } +} diff --git a/web/public/favicon.ico b/web/public/favicon.ico new file mode 100644 index 0000000..1a0e686 Binary files /dev/null and b/web/public/favicon.ico differ diff --git a/web/public/robots.txt b/web/public/robots.txt new file mode 100644 index 0000000..eb05362 --- /dev/null +++ b/web/public/robots.txt @@ -0,0 +1,2 @@ +User-agent: * +Disallow: diff --git a/web/site.css b/web/site.css new file mode 100644 index 0000000..3483d6d --- /dev/null +++ b/web/site.css @@ -0,0 +1,27 @@ +body { + padding-top: 20px; + padding-bottom: 20px; +} + +.body-content { + padding-left: 15px; + padding-right: 15px; +} + +.form-control { + border: 1px solid #dfa0ea; + padding: 3px 6px; + box-shadow: none; /*inset 0 -1px 0 #dfa0ea;*/ +} + +.selectize-input.focus { + box-shadow: none; /* inset 1px 1px 0 #dfa0ea;*/ +} + +.selectize-control.multi .selectize-input.has-items { + padding: 3px 4px; +} + +button.dropdown-toggle { + padding: 6px 12px; +} diff --git a/web/site.js b/web/site.js new file mode 100644 index 0000000..f313b02 --- /dev/null +++ b/web/site.js @@ -0,0 +1,40 @@ +import 'bootswatch/paper/bootstrap.css' +import '@selectize/selectize/dist/css/selectize.css' +import './site.css' + +import $ from 'jquery' +import {} from '@selectize/selectize' + +$(document).ready(function() { + var ignores = JSON.parse($('script#ignores-data').html()); + var types = $('#types'); + types.selectize({ + plugins: ['restore_on_backspace', 'remove_button'], + inputClass: 'form-control selectize-input', + options: ignores, + placeholder: 'Select file types to generate gitattributes file', + valueField: 'id', + labelField: 'name', + searchField: ['name'], + delimiter: ',', + persist: false, + create: false, + selectOnTab: true + }); + + $('#btnGenerate').on('click', function() { + var typesValue = types.val(); + if (typesValue.length) { + var uriEncodedFiles = encodeURIComponent(typesValue); + window.location="/api/"+uriEncodedFiles; + } + }); + + $('#btnDownload').on('click', function() { + var typesValue = types.val(); + if (typesValue.length) { + var uriEncodedFiles = encodeURIComponent(typesValue); + window.location="/api/f/"+uriEncodedFiles; + } + }); +});