{"id":26502877,"url":"https://github.com/grassator/jquery-brute-select","last_synced_at":"2025-08-08T04:19:00.612Z","repository":{"id":7484290,"uuid":"8832897","full_name":"grassator/jquery-brute-select","owner":"grassator","description":"Simple stylizable custom select input implementation.","archived":false,"fork":false,"pushed_at":"2013-06-22T11:41:18.000Z","size":248,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-04-09T14:49:35.761Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://kubyshkin.ru","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/grassator.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE-MIT","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-03-17T10:33:35.000Z","updated_at":"2015-11-14T06:08:28.000Z","dependencies_parsed_at":"2022-09-09T19:11:24.762Z","dependency_job_id":null,"html_url":"https://github.com/grassator/jquery-brute-select","commit_stats":null,"previous_names":[],"tags_count":8,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grassator%2Fjquery-brute-select","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grassator%2Fjquery-brute-select/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grassator%2Fjquery-brute-select/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grassator%2Fjquery-brute-select/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/grassator","download_url":"https://codeload.github.com/grassator/jquery-brute-select/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244672248,"owners_count":20491336,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-20T18:36:06.447Z","updated_at":"2025-03-20T18:36:07.013Z","avatar_url":"https://github.com/grassator.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Brute Select\n\nSimple select implementation with customizable styles. It retains default browser behavior for dropdown list itself while making possible adjusting all aspects of collapsed view of select.\n\nWhat makes **Brute Select** really different is an ability to customize every aspect of it's looks and behavior by providing configuration functions instead of limited scalar options used in most jQuery plugins.\n\n## Getting Started\n\nDownload the latest version from [github][github]. Then in your web page:\n\n[github]:https://github.com/grassator/jquery-brute-select/archive/master.zip\n\n```html\n\u003cscript src=\"jquery.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"dist/brute-select.min.js\"\u003e\u003c/script\u003e\n\u003clink rel=\"stylesheet\" href=\"dist/brute-select.css\"\u003e\n\u003cscript\u003e\n$(function() {\n\t$('select').bruteSelect();\n});\n\u003c/script\u003e\n```\n\n## Configuration\n\nYou can pass configuration object to plugin initialization with parameters described below:\n\n### `baseName` string\n\nBase for all string entities related to brute select including base part of element classes when using default `generateClassName` function.\n\nDefaults to `brute-select`\n\n### `generateClassName` function (elementNameOrModifier, isModifier)\n\nGenerates appropriate class names for select elements in generated markup. It can be used to adjust class names to conform to specific naming guidelines, like the ones used in [BEM](http://bem.info/). \n\nDefault implementation just appends `elementNameOrModifier` to `baseName` with `-` in the middle and can be accessed via `$.fn.bruteSelect.generateClassName`.\n\nHere is an sample implementation of BEM-style class generation:\n\n```js\n$('select').bruteSelect({\n\tgenerateClassName: function (elementNameOrModifier, isModifier) {\n\t\tvar cls = this.baseName;\n\t\tif(elementNameOrModifier) {\n\t\t\tcls += (isModifier ? '_' : '__') + elementNameOrModifier;\n\t\t}\n\t\treturn cls;\n\t}\n});\n```\n\n### `formatter` function (title, value, $option, $select)\n\nAllows you to customize the way you format the title of currently selected option inside the select. If you wish to use some html for formatting be sure to disable `stripTagsInTitle` option.\n\nDefault implementation just returns `title` and can be accessed via `$.fn.bruteSelect.formatter`.\n\nMust return `string` value.\n\n### `allowHtmlInTitle` boolean\n\nDefaults to `false` meaning that Brute Select will use jQuery `text()` method to update formatted option title. Allowing html inside the title could allow for XSS vulnerability if option list is generated by users and is not filtered in formatter or on the server side. \n\n### `markup` function ($select)\n\nYou can use this configuration function to customize generated markup or in the case you want to generate markup by some other means (like server side) and provide ready-to-use references to necessary elements for brute select functionality.\n\nMust return `object` with following properties.\n\n```js\n{\n\t$el: $(...),\n\t$title: $(...)\n}\n```\n\n### Function Context\n\nAll of the configuration functions are merged into special object that contains state of the select and handles user interactions. Apart from ability to access all the other configuration options within configuration function it also provides references to top-most generated markup element via `this.$el`, current item title via `this.$title`, and original select via `this.$select`.\n\n### Global Configuration \n\nAll of the previously listed options are also available in `$.fn.bruteSelect.options` object that contains default options for the plugin allowing you to adjust them globally.\n\n## Further Extending\n\nIf you need even more control or wish to extend functionality of this plugin, you can extend base class that handles state and user interactions. It is accessible via `$.fn.bruteSelect.klass`.\n\n## Licensing\n\nLicensed under permissive [MIT-style license](https://github.com/grassator/jquery-brute-select/blob/master/LICENSE-MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrassator%2Fjquery-brute-select","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrassator%2Fjquery-brute-select","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrassator%2Fjquery-brute-select/lists"}