{"id":32234631,"url":"https://github.com/sunpietro/dragster","last_synced_at":"2025-10-22T12:51:46.825Z","repository":{"id":28269135,"uuid":"31779493","full_name":"sunpietro/dragster","owner":"sunpietro","description":"Tiny vanilla JS plugin that enables drag'n'drop interactions to a user of your website","archived":false,"fork":false,"pushed_at":"2025-03-02T13:20:08.000Z","size":590,"stargazers_count":100,"open_issues_count":6,"forks_count":9,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-10-22T12:51:40.116Z","etag":null,"topics":["drag-and-drop","draggable-elements","dragging","dragging-elements","dragster","dragster-library","drop-elements","hacktoberfest","hacktoberfest2022","javascript","region"],"latest_commit_sha":null,"homepage":"http://sunpietro.github.io/dragster/","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/sunpietro.png","metadata":{"files":{"readme":"README.md","changelog":null,"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},"funding":{"patreon":"sunpietro"}},"created_at":"2015-03-06T17:00:01.000Z","updated_at":"2025-10-21T15:20:58.000Z","dependencies_parsed_at":"2022-07-27T13:02:46.363Z","dependency_job_id":null,"html_url":"https://github.com/sunpietro/dragster","commit_stats":null,"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"purl":"pkg:github/sunpietro/dragster","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunpietro%2Fdragster","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunpietro%2Fdragster/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunpietro%2Fdragster/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunpietro%2Fdragster/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sunpietro","download_url":"https://codeload.github.com/sunpietro/dragster/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunpietro%2Fdragster/sbom","scorecard":{"id":858933,"data":{"date":"2025-08-11","repo":{"name":"github.com/sunpietro/dragster","commit":"acb1d580b267e509de5d9bd933b20dbee0d95586"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.9,"checks":[{"name":"Code-Review","score":1,"reason":"Found 4/30 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 11 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"13 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-jchw-25xp-jwwc","Warn: Project is vulnerable to: GHSA-cxjh-pqwp-8mfp","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-24T00:41:26.198Z","repository_id":28269135,"created_at":"2025-08-24T00:41:26.198Z","updated_at":"2025-08-24T00:41:26.198Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280439995,"owners_count":26331171,"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","status":"online","status_checked_at":"2025-10-22T02:00:06.515Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["drag-and-drop","draggable-elements","dragging","dragging-elements","dragster","dragster-library","drop-elements","hacktoberfest","hacktoberfest2022","javascript","region"],"created_at":"2025-10-22T12:51:43.937Z","updated_at":"2025-10-22T12:51:46.820Z","avatar_url":"https://github.com/sunpietro.png","language":"JavaScript","funding_links":["https://patreon.com/sunpietro"],"categories":[],"sub_categories":[],"readme":"# dragster.js\n\n[![DragsterJS NPM version](https://badge.fury.io/js/dragsterjs.svg)](https://badge.fury.io/js/dragsterjs)\n\n[![DragsterJS gzip size](http://img.badgesize.io/https://unpkg.com/dragsterjs/dragster.min.js?compression=gzip\n)](https://unpkg.com/dragsterjs/dragster.min.js)\n\nTiny vanilla JS library that enables drag'n'drop interactions to a user of your website.\nBy implementing this library a user is able to drag'n'drop elements on user-defined drop regions.\nIt works both on desktop (using mouse interface) and mobile devices (using touch interface).\n\nSee the library in action at the demo page: [Dragster.js demo page](http://sunpietro.github.io/dragster/)\n\n## How to install?\nYou can install this library in two different ways:\n* Clone this repository on Github,\n* Install using npm (Node.js dependencies manager) with following command:\n\n    ```\n    npm install dragsterjs\n    ```\n\n* Install using bower (frontend dependencies manager) with following command:\n\n    ```\n    bower install dragsterjs\n    ```\n* Install using Yarn:\n    \n    ```\n    yarn add dragsterjs\n    ```\n\n## The sample usage\nTo start having fun with dragging elements on the website prepare the following HTML code and add few lines of CSS:\n\n```html\n\u003cdiv class=\"dragster-region\"\u003e\n    \u003cdiv class=\"dragster-block\"\u003e\u003c/div\u003e\n    \u003cdiv class=\"dragster-block\"\u003e\u003c/div\u003e\n    \u003cdiv class=\"dragster-block\"\u003e\u003c/div\u003e\n\u003c/div\u003e\n```\n\nThen add following JS code:\n\n```javascript\nvar dragster = new window.Dragster({\n    elementSelector: '.dragster-block',\n    regionSelector: '.dragster-region'\n});\n```\n\nIf you would like to use DragsterJS as ES6 module in the browser:\n\n```html\n\u003cscript type=\"module\"\u003e\n    import Dragster from './dragster.es6.js';\n    const dragster = Dragster();\n\u003c/script\u003e\n```\n\nThese few lines of CSS are required to prevent issues while dropping the elements.\n\n``` css\n/*\n * Prevents user from selecting text\n * in the draggable elements\n */\n[draggable] {\n  -webkit-user-select: none;\n     -moz-user-select: none;\n      -ms-user-select: none;\n          user-select: none;\n}\n\n/* \n * Prevent the element currently being dragged from\n * receive pointer events, otherwise the dropping\n * zone behind it can't receive the hover mouse events.\n */\n.dragster-temp {\n  pointer-events: none;\n}\n```\n\nIf you need to further customize the look and feel of the elements being dragged or the dropping regions check the `dragster.style.css` file.\n\n## Replace elements instead of moving them\nIf you want to replace elements instead of moving them between regions you can initialize Dragster.js library with an option `replaceElements: true`:\n\n```javascript\nvar dragster = new window.Dragster({\n    elementSelector: '.dragster-block',\n    regionSelector: '.dragster-region',\n    replaceElements: true\n});\n```\n\n## Don't update droppable regions' height\nIf you don't want to update regions height value when dragging and dropping element on a region you can initialize Dragster.js library with an option `updateRegionsHeight: false`:\n\n```javascript\nvar dragster = new window.Dragster({\n    elementSelector: '.dragster-block',\n    regionSelector: '.dragster-region',\n    updateRegionsHeight: false\n});\n```\n\n## Update draggable elements on demand\nIf you have an app where elements are added dynamically, you can update the draggable elements list on demand:\n\n```javascript\nvar dragster = new window.Dragster({\n    elementSelector: '.dragster-block',\n    regionSelector: '.dragster-region'\n});\n\ndragster.update();\n```\n\n## Allow cloning blocks from a selected zones\nImagine you have a shopping cart with a list of products. You want to allow dropping multiple items into the shopping cart without removing an item from the list of available shop items.\n\n```javascript\nvar dragster = new window.Dragster({\n    elementSelector: '.dragster-block',\n    regionSelector: '.dragster-region',\n    dragOnlyRegionCssClass: 'dragster-region--drag-only',\n    cloneElements: true\n});\n```\n\n## Properties\nList of properties:\n### elementSelector (required) - {String}\nIt is a CSS selector to find all the elements on the page that should be draggable. Default value: `'.dragster-block'`\n### regionSelector (required) - {String}\nIt is a CSS selector to find all the regions where elements can be dragged onto and where all the drag'n'drop functionality works as expected.\nDefault value: `'.dragster-region'`\n### replaceOnDrop - {Boolean}\nIndidator stating if dropped element should switch position with drop target.\nIt takes either `true` or `false` value. Default value: `false`.\n### copyOnDrop - {Boolean}\nIndicator stating if dropped element should be copied into a new position.\nIt takes either `true` or `false` value. Default value: `false`.\n### updateRegionsHeight - {Boolean}\nIt is indicator whether regions should update their height according to the number of elements visible in the region.\nIt takes either `true` or `false` value. Default value: `true`.\n### minimumRegionHeight - {Number}\nTell the dragster to not to resize the regions below provided value. Default value: `60`.\n### scrollWindowOnDrag - {Boolean}\nTell the dragster to scroll window while dragging an element. Default value: `false`.\n### dragOnlyRegionCssClass - {String}\nThe drag-only region CSS class name. Used to identify regions. Default value: `'dragster-region--drag-only'`.\n### cloneElements - {Boolean}\nThe flag stating the elements can be cloned from region to region. Requires `dragOnlyRegionCssClass` to be applied in the HTML markup of a page. Default value: `false`.\n### wrapDraggableElements - {Boolean}\nBy default all draggable elements are wrapped in a wrapper `\u003cdiv\u003e`, by settings this variable to `false` this behavior can be disabled. This can sometimes be useful when using the script in frameworks like Angular or such.\n\n**IMPORTANT**\n\nIf you put this value to `false`, you **MUST** do the wrapping of the elements yourself.\nA wrapper container looks like this `\u003cdiv draggable=\"true\" class=\"dragster-draggable\"\u003e ... \u003c/div\u003e`\n### shadowElementUnderMouse - {Boolean}\nBy default the shadow element is placed on half of its width, by setting this variable to `true` the shadow element will stays where user clicks on draggable element.\n\n## Properties - callbacks\nThese properties allow a developer to control the behaviour of dragster.js library using callbacks.\nAll the callbacks takes **one param - the event object**, provided by Dragster.js library.\nWhen callback returns `false` value then the dragging action is cancelled.\nBe careful with these callbacks as it might cause unexpected behaviour of dragged elements.\n### onBeforeDragStart - {Function}\nBefore drag start callback. Can prevent from dragging an element.\n### onAfterDragStart - {Function}\nAfter drag start callback.\n### onBeforeDragMove - {Function}\nBefore drag move callback. Can prevent from dropping an element.\n### onAfterDragMove - {Function}\nAfter drag move callback.\n### onBeforeDragEnd - {Function}\nBefore drag end callback. Can prevent from dropping an element.\n### onAfterDragEnd - {Function}\nAfter drag end callback.\n### onAfterDragDrop - {Function}\nAfter drop callback.\n\n## Methods\nList of methods ready to be used by any webdeveloper:\n### update\nUpdates a reference to draggable elements. For example, when user adds a new element to any of droppable regions then running `update` method makes a new element draggable as well.\n### updateRegions\nUpdates regions references and attaches event listeners to them\n### destroy\nRemoves all event listeners related to DragsterJS\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsunpietro%2Fdragster","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsunpietro%2Fdragster","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsunpietro%2Fdragster/lists"}