{"id":16428971,"url":"https://github.com/ocombe/ocmodal","last_synced_at":"2025-10-14T18:32:16.869Z","repository":{"id":13564439,"uuid":"16256738","full_name":"ocombe/ocModal","owner":"ocombe","description":"An angularJS modal directive \u0026 service","archived":false,"fork":false,"pushed_at":"2016-06-04T14:54:41.000Z","size":104,"stargazers_count":65,"open_issues_count":6,"forks_count":16,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-10-05T04:31:35.411Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ocombe.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-01-26T16:44:32.000Z","updated_at":"2025-03-27T01:01:27.000Z","dependencies_parsed_at":"2022-07-12T15:11:31.774Z","dependency_job_id":null,"html_url":"https://github.com/ocombe/ocModal","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/ocombe/ocModal","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ocombe%2FocModal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ocombe%2FocModal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ocombe%2FocModal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ocombe%2FocModal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ocombe","download_url":"https://codeload.github.com/ocombe/ocModal/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ocombe%2FocModal/sbom","scorecard":{"id":701502,"data":{"date":"2025-08-11","repo":{"name":"github.com/ocombe/ocModal","commit":"6a22183a0119cf37dec18bebc5f1088113b162f5"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"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":"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":"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":"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":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","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":"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":"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":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"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":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"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":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"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"}}]},"last_synced_at":"2025-08-22T05:19:11.021Z","repository_id":13564439,"created_at":"2025-08-22T05:19:11.021Z","updated_at":"2025-08-22T05:19:11.021Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279020353,"owners_count":26086866,"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-14T02:00:06.444Z","response_time":60,"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":[],"created_at":"2024-10-11T08:19:52.898Z","updated_at":"2025-10-14T18:32:16.852Z","avatar_url":"https://github.com/ocombe.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"ocModal\n=======\n\nAn angularJS modal directive \u0026amp; service\n\n### Key features\n- Easy to use modal\n- Dependencies free (well except angular off course)\n- Load via the service or the directive\n- Style yourself or use the bootstrap's theme\n\n### [Demo on Plunker](http://embed.plnkr.co/8QBKgw779g6jT6lmhXS5/)\n\n### Usage\n- Download the lib (you can use `bower install ocModal`)\n- Put ocModal.js into you project\n- Add the css file to your project: if you don't have bootstrap 3, include dist/css/ocModal.full.min.css. If you already have bootstrap 3, use dist/css/ocModal.light.min.css\n- Add the module ```oc.modal``` to your application\n- Load on demand using the service or the directive :\n\n**Service**:\n```javascript\n$ocModal.open('partials/modal.html');\n```\nor\n```javascript\n$ocModal.open('\u003cdiv\u003eMy content\u003c/div\u003e');\n```\n\n**Directive**:\n```html\n\u003cdiv oc-modal-open=\"'partials/modal.html'\"\u003e\u003c/div\u003e\n```\nor\n```html\n\u003cdiv oc-modal-open=\"'\u003cdiv\u003eMy content\u003c/div\u003e'\"\u003e\u003c/div\u003e\n```\n\nSee the example in the 'example' folder to know how to integrate ocLazyLoad with your router.\n\n### Parameters\nYou can also pass parameters when you open a modal via the service or the directive. The previous examples are equivalent to :\n\n**Service**:\n```javascript\n$ocModal.open({\n\turl: 'partials/modal.html'\n});\n```\nor\n```javascript\n$ocModal.open({\n\ttemplate: '\u003cdiv\u003eMy content\u003c/div\u003e'\n});\n```\n\n**Directive**:\n```html\n\u003cdiv oc-modal-open=\"{url: 'partials/modal.html'}\"\u003e\u003c/div\u003e\n```\nor\n```html\n\u003cdiv oc-modal-open=\"{template: '\u003cdiv\u003eMy content\u003c/div\u003e'}\"\u003e\u003c/div\u003e\n```\n\nThe complete list of parameters is :\n- **id**: you can specify an id for your modal, it is usefull if you want to open more than one modal at the same time\n```javascript\n$ocModal.open({\n\tid: 'modal1',\n\turl: 'partials/modal.html'\n});\n```\nBy default the id is set to ```'_default'```.\n\n- **url**: a template url loaded via [ng-include](http://docs.angularjs.org/api/ng.directive:ngInclude), so you can use an ng-script template or the url of an external html file\n\n- **template**: if you prefer to write the template in line, you can use the ```template``` parameter instead of ```url```.\n\n- **controller**: you can pass a controller for the new content\n```javascript\n$ocModal.open({\n\turl: 'partials/modal.html',\n\tcontroller: 'MyController'\n});\n```\n\n- **cls**: You can specify one or more (space separated) classes to be added to the modal\n```javascript\n$ocModal.open({\n\turl: 'partials/modal.html',\n\tcls: 'my-class1 my-class2'\n});\n```\n\n- **onOpen**: you can add a callback that will be called when the modal is opened\n```javascript\n$ocModal.open({\n\turl: 'partials/modal.html',\n\tonOpen: function() {\n\t\tconsole.log('Just opened !');\n\t}\n});\n```\n\n- **onClose**: you can add a callback that will be called when the modal is closed\n```javascript\n$ocModal.open({\n\turl: 'partials/modal.html',\n\tonClose: function() {\n\t\tconsole.log('Just closed !');\n\t}\n});\n```\n\n- **init**: use this to populate the modal scope. If you use a controller you will also be able to access this via $init\n```javascript\n$ocModal.open({\n\ttemplate: '\u003cdiv\u003e{{param1}}\u003c/div\u003e',\n\tcontroller: 'MyController',\n\tinit: {\n\t\tparam1: 'test'\n\t}\n});\n```\n\nAnd in your controller :\n```javascript\nangular.module('app').controller('MyController', ['$scope', '$init', function($scope, $init) {\n\tconsole.log($scope.param1, $init.param1);\n}]);\n```\n\n- **$ocModalParams**: Access the modal params in your controller\n```javascript\nangular.module('app').controller('MyController', ['$scope', '$ocModalParams', function($scope, $ocModalParams) {\n\tconsole.log($ocModalParams);\n}]);\n```\n\n- **isolate**: by default your modal's scope will inherit the variables from the init parameter. If you don't want that and you prefer to access these variables via the $init in your controller, you can use ```isolate=true```\n```javascript\n$ocModal.open({\n\turl: 'partials/modal.html',\n\tcontroller: 'MyController',\n\tisolate: true,\n\tinit: {\n\t\tparam1: 'test'\n\t}\n});\n```\n\nAnd use $init in your controller :\n```javascript\nangular.module('app').controller('MyController', ['$scope', '$init', function($scope, $init) {\n\tconsole.log($init.param1);\n}]);\n```\n\nBut ```$scope.param1``` will be ```undefined```.\n\n- **closeOnEsc**: by default you will be able to close the modal with the \"ESC\" key. If you want to disable this behaviour, use ```closeOnEsc: false```\n```javascript\n$ocModal.open({\n\turl: 'partials/modal.html',\n\tcloseOnEsc: false\n});\n```\n\n### Functions \u0026 attributes\n- **open(**__url/template/object__**)**: use this to open the modal\n```javascript\n$ocModal.open({\n\turl: 'partials/modal.html'\n});\n```\n\n- **close(**__[id][, param1][, param2][, ...]__**)**: use this to close the modal, it will return a promise that resolves at the end of the closing animation (if any)\n```javascript\n$ocModal.close();\n```\n\nWith no parameter it will close the last opened modal. If you want to close a specific modal, use the id.\n```javascript\n$ocModal.close('modal1');\n```\n\nYou can also pass what you want to the onClose callback (if you have one) :\n```javascript\n$ocModal.open({\n\turl: 'partials/modal.html',\n\tonClose: function(a, b, c) {\n\t\tconsole.log(a); // arg1\n\t\tb(); // whatever\n\t\tconsole.log(c); // {p1: 'test'}\n\t}\n});\n\n$ocModal.close('arg1', function() { console.log('whatever') }, {p1: 'test'});\n```\n\n- **$scope.closeModal(**__[id][, param1][, param2][, ...]__**)**: this is an alias for ```$ocModal.close()``` that you can also use in your template\n```html\n\u003cbutton ng-click=\"closeModal()\"\u003e\u003c/button\u003e\n```\n\n- **getOpenedModals()**: if you need to get the ids of the opened modals\n\n- **waitingForOpen**: check this property if you need to know if another modal will be opened once this one is closed\n```javascript\n$ocModal.open({\n\turl: \"partials/login.html\",\n\tcontroller: 'LoginCtrl',\n\tonClose: function() {\n\t\tif(!$ocModal.waitingForOpen) {\n\t\t\t$state.transitionTo('welcome');\n\t\t}\n\t}\n});\n```\n\n### Directives\n- **oc-modal-open**: this is an alias for ```$ocModal.open()``` that you can also use in your template.\n```html\n\u003cdiv oc-modal-open=\"{url: 'partials/modal.html'}\"\u003e\u003c/div\u003e\n```\n\n- **oc-modal-close**: this is an alias for ```$ocModal.close()``` that you can also use in your template.\n```html\n\u003cbutton oc-modal-close=\"'Some text '+testVar\"\u003e\u003c/button\u003e\n```\n\n### Animations\nYou can use a set of animations by including the file ocModal.animations.css and by adding one of those classes with the cls parameter :\n- fade-in\n- slide-down\n- scale\n- fall\n- flip-horizontal\n- flip-vertical\n- super-scaled\n- slit\n\n```javascript\noc-modal-open=\"{url: 'partials/modal.html', cls: 'fade-in'}\"\n```\n\nYou can add your own animations by adding new styles to `.modal .modal-dialog .modal-content` and `.modal .modal-dialog .modal-content.opened`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Focombe%2Focmodal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Focombe%2Focmodal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Focombe%2Focmodal/lists"}