{"id":19755310,"url":"https://github.com/awkward/backbone.genetics","last_synced_at":"2025-04-30T11:32:42.961Z","repository":{"id":21986375,"uuid":"25311319","full_name":"awkward/backbone.genetics","owner":"awkward","description":"A super small and simple plugin for Backbone.js to toggle features in your app for user management, A/B testing purposes and all things you’d like to enable for specific users and hide from others","archived":false,"fork":false,"pushed_at":"2014-10-28T11:42:35.000Z","size":160,"stargazers_count":14,"open_issues_count":1,"forks_count":0,"subscribers_count":13,"default_branch":"master","last_synced_at":"2024-10-06T17:18:09.916Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"CoffeeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/awkward.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-10-16T16:34:12.000Z","updated_at":"2017-07-21T13:55:59.000Z","dependencies_parsed_at":"2022-08-18T03:11:13.331Z","dependency_job_id":null,"html_url":"https://github.com/awkward/backbone.genetics","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awkward%2Fbackbone.genetics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awkward%2Fbackbone.genetics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awkward%2Fbackbone.genetics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awkward%2Fbackbone.genetics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/awkward","download_url":"https://codeload.github.com/awkward/backbone.genetics/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224208083,"owners_count":17273674,"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":"2024-11-12T03:10:14.356Z","updated_at":"2024-11-12T03:10:15.105Z","avatar_url":"https://github.com/awkward.png","language":"CoffeeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Backbone.Genetics\n\n[![Build Status](https://travis-ci.org/awkward/backbone.genetics.svg)](https://travis-ci.org/awkward/backbone.genetics)\n\nA super small and simple plugin for Backbone.js to remove features from your app for user management, A/B testing purposes and all things you’d like to enable for specific users and hide from others.\n\nBackbone.Genetics.js let’s you define ‘genes’, that are parts of your template (defined as `data-gene=\"myGene\"`), which will be removed from your view during the rendering of your view.\n\n#### Download\nBackbone is required, Marionette is optional.\n* Minified: [backbone.genetics-min.js](https://raw.githubusercontent.com/awkward/backbone.genetics/v0.0.2/backbone.genetics-min.js)\n* Unminified: [backbone.genetics.js](https://raw.githubusercontent.com/awkward/backbone.genetics/v0.0.2/backbone.genetics.js)\n\n#### How to use\nIt’s very easy to implement. Once your view is rendering, in Backbone it’s the `render` method and for Marionette it’s the `onRender` method, you want to use `Genetics.bind(this)`.\n\nIn your template of that view, simply add `data-gene` attribute to every element you’d like to remove (it will obviously also remove all nested elements).\n\nIf you only want to make a certain part visible for admins, you can set `Genetics.genes({admin: true})` for specific users. All elements with `data-gene=\"admin\"` will be removed if that gene isn’t true.\n\nYou can also use multiple genes in elements, like: `data-gene=\"admin user\"` which means it has to comply to both genes, otherwise it’ll be removed from the view.\n\nThat’s it.\n\n### How to contribute\n\nTo get started `grunt` to get everything running. If you have any requests, please create an issue. If you're working on something yourself, make a pull request and we'll make sure to check it out to get in into the next release.\n\n### Tests\n\nWhen you run the project by doing `grunt`. This will watch the tests and src files. It will open up a browser with the tests.\n\n### Legal stuff (MIT License)\n\nCopyright (c) 2014 Awkward.\n\nDistributed under MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fawkward%2Fbackbone.genetics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fawkward%2Fbackbone.genetics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fawkward%2Fbackbone.genetics/lists"}