{"id":13401650,"url":"https://github.com/wbotelhos/raty","last_synced_at":"2025-04-29T18:36:48.271Z","repository":{"id":945648,"uuid":"723523","full_name":"wbotelhos/raty","owner":"wbotelhos","description":":star2: Raty - A Star Rating Plugin","archived":false,"fork":false,"pushed_at":"2024-04-27T18:15:02.000Z","size":2481,"stargazers_count":2358,"open_issues_count":57,"forks_count":651,"subscribers_count":77,"default_branch":"main","last_synced_at":"2025-04-09T13:01:46.389Z","etag":null,"topics":["hacktoberfest","hacktoberfest2022","rating","star","star-rating","vote","voting"],"latest_commit_sha":null,"homepage":"https://wbotelhos.com","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"adetaylor/python-ardrone","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wbotelhos.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"wbotelhos"}},"created_at":"2010-06-16T06:41:28.000Z","updated_at":"2025-03-03T09:45:44.000Z","dependencies_parsed_at":"2023-02-15T21:15:37.793Z","dependency_job_id":"29888050-8ebe-4267-918c-961bc97875a1","html_url":"https://github.com/wbotelhos/raty","commit_stats":{"total_commits":668,"total_committers":36,"mean_commits":"18.555555555555557","dds":"0.10628742514970058","last_synced_commit":"4c94435c6638dced93f64c1138236a8a62909b45"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wbotelhos%2Fraty","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wbotelhos%2Fraty/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wbotelhos%2Fraty/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wbotelhos%2Fraty/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wbotelhos","download_url":"https://codeload.github.com/wbotelhos/raty/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251561076,"owners_count":21609316,"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":["hacktoberfest","hacktoberfest2022","rating","star","star-rating","vote","voting"],"created_at":"2024-07-30T19:01:05.181Z","updated_at":"2025-04-29T18:36:48.239Z","avatar_url":"https://github.com/wbotelhos.png","language":"JavaScript","funding_links":["https://github.com/sponsors/wbotelhos"],"categories":["JavaScript","hacktoberfest2022","UI Components"],"sub_categories":["Rating"],"readme":"# Raty - A Star Rating Plugin.\n\n[![Tests](https://github.com/wbotelhos/raty/workflows/Tests/badge.svg)](https://github.com/wbotelhos/raty/actions/workflows/tests.yml)\n[![NPM Version](https://badge.fury.io/js/raty-js.svg)](https://badge.fury.io/js/raty-js)\n[![Maintainability](https://api.codeclimate.com/v1/badges/e152fa0075358ae855f1/maintainability)](https://codeclimate.com/github/wbotelhos/raty/maintainability)\n[![Sponsor](https://img.shields.io/badge/sponsor-%3C3-green)](https://github.com/sponsors/wbotelhos)\n\n## Rating for Rails?\n\nIt's **Rating**: https://github.com/wbotelhos/rating :star:\n\n## Help\n\n- Check the [Tutorial](https://github.com/wbotelhos/raty/blob/main/tutorial.md) to learn about all available features.\n- If you're migrating from `v3` to `v4` check the [Upgrade](https://github.com/wbotelhos/raty/blob/main/UPGRADE.md) document.\n\n## Usage with Image\n\n- raty.js\n- star-off.png\n- star-on.png\n\n```html\n\u003cscript src=\"raty.js\"\u003e\u003c/script\u003e\n\n\u003cdiv data-raty\u003e\u003c/div\u003e\n```\n\n```js\nconst raty = new Raty(document.querySelector('[data-raty]'));\n\nraty.init();\n```\n\n## Usage with Font\n\n- raty.css\n- raty.[eot|svg|ttf|woff]\n- raty.js\n\n```html\n\u003clink rel=\"stylesheet\" href=\"raty.css\"\u003e\n\n\u003cscript src=\"raty.js\"\u003e\u003c/script\u003e\n\n\u003cdiv data-raty\u003e\u003c/div\u003e\n```\n\n```js\nnew Raty(document.querySelector('[data-raty]'), { starType: 'i' });\n```\n\n## Options\n\n| Property      | Default                                        |Description                                                      |\n|---------------|------------------------------------------------|-----------------------------------------------------------------|\n|`cancelButton` |`false`                                         |Creates a cancel button to cancel the rating.                    |\n|`cancelClass`  |`'raty-cancel'`                                 |Name of cancel's class.                                          |\n|`cancelHint`   |`'Cancel this rating!'`                         |The cancel's button hint.                                        |\n|`cancelOff`    |`'cancel-off.png'`                              |Icon used on active cancel.                                      |\n|`cancelOn`     |`'cancel-on.png'`                               |Icon used inactive cancel.                                       |\n|`cancelPlace`  |`'left'`                                        |Cancel's button position.                                        |\n|`click`        |`undefined`                                     |Callback executed on rating click.                               |\n|`half`         |`false`                                         |Enables half star selection.                                     |\n|`halfShow`     |`true`                                          |Enables half star display.                                       |\n|`hints`        |`['bad', 'poor', 'regular', 'good', 'gorgeous']`|Hints used on each star.                                         |\n|`iconRange`    |`undefined`                                     |Object list with position and icon on and off to do a mixed icons|\n|`iconRangeSame`|`false`                                         |All icons prior to selection will be the same as the selection.  |\n|`mouseout`     |`undefined`                                     |Callback executed on mouseout.                                   |\n|`mouseover`    |`undefined`                                     |Callback executed on mouseover.                                  |\n|`noRatedMsg`   |`'Not rated yet!'`                              |Hint for non rated elements when it's readOnly.                  |\n|`number`       |`5`                                             |The number of stars that will be presented.                      |\n|`numberMax`    |`20`                                            |Max number of stars star the option number will create.          |\n|`path`         |`undefined`                                     |A global path where the icon will be found.                      |\n|`precision`    |`false`                                         |Enables the selection of a precise score.                        |\n|`readOnly`     |`false`                                         |Turns the rating read-only.                                      |\n|`round`        |`{ down: .25, full: .6, up: .76 }`              |Includes value attributes to do the score rounding math.         |\n|`score`        |`undefined`                                     |Initial rating.                                                  |\n|`scoreName`    |`'score'`                                       |Name of the hidden field that holds the score value.             |\n|`single`       |`false`                                         |Enables single star selection.                                   |\n|`space`        |`true`                                          |Puts space between the icons.                                    |\n|`starHalf`     |`'star-half.png'`                               |The name of the half star image.                                 |\n|`starOff`      |`'star-off.png'`                                |Name of the star image off.                                      |\n|`starOn`       |`'star-on.png'`                                 |Name of the star image on.                                       |\n|`target`       |`undefined`                                     |Element selector where the score will be displayed.              |\n|`targetFormat` |`'{score}'`                                     |Template to interpolate the score in.                            |\n|`targetKeep`   |`false`                                         |If the last rating value will be kept on mouseout.               |\n|`targetScore`  |`undefined`                                     |Score field target avoiding hidden field creation                |\n|`targetText`   |`''`                                            |Default text in a target.                                        |\n|`targetType`   |`'hint'`                                        |Choose if target will receive a hint or the score number         |\n|`starType`     |`'img'`                                         |Element used to represent a star.                                |\n\n## Functions\n\nTo call some function, first, save the Raty instance on a variable and then call the functions:\n\n```js\nvar raty = new Raty(document.querySelector('[data-raty]'));\n```\n\n| Function               | Description                                               |\n|------------------------|-----------------------------------------------------------|\n|`raty.score()`          |Get the current score.                                     |\n|`raty.score(number)`    |Set a score.                                               |\n|`raty.click(number)`    |Click on a star.                                           |\n|`raty.readOnly(boolean)`|Change the read-only state.                                |\n|`raty.cancel(boolean)`  |Cancel the rating. The last param force the click callback.|\n|`raty.move(number)`     |Move the mouse to the given score point position.          |\n\n## Build\n\n```sh\ngulp 'amd'\ngulp 'umd'\ngulp 'commonjs'\ngulp 'systemjs'\ngulp 'es6'\ngulp 'es5'\ngulp 'es5-test'\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwbotelhos%2Fraty","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwbotelhos%2Fraty","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwbotelhos%2Fraty/lists"}