{"id":15282618,"url":"https://github.com/moayadnajd/nativescript-comments","last_synced_at":"2025-09-12T22:47:43.635Z","repository":{"id":45150276,"uuid":"100851272","full_name":"moayadnajd/nativescript-comments","owner":"moayadnajd","description":"Comments box ready for integration inside you'r native script app","archived":false,"fork":false,"pushed_at":"2018-05-23T06:09:04.000Z","size":2293,"stargazers_count":10,"open_issues_count":1,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-19T07:42:33.244Z","etag":null,"topics":["nativescript","nativescript-plugin"],"latest_commit_sha":null,"homepage":"http://codeobia.com","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/moayadnajd.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":"2017-08-20T09:29:07.000Z","updated_at":"2024-05-30T16:14:54.000Z","dependencies_parsed_at":"2022-09-13T19:51:26.321Z","dependency_job_id":null,"html_url":"https://github.com/moayadnajd/nativescript-comments","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moayadnajd%2Fnativescript-comments","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moayadnajd%2Fnativescript-comments/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moayadnajd%2Fnativescript-comments/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moayadnajd%2Fnativescript-comments/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moayadnajd","download_url":"https://codeload.github.com/moayadnajd/nativescript-comments/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252811683,"owners_count":21807992,"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":["nativescript","nativescript-plugin"],"created_at":"2024-09-30T14:31:44.045Z","updated_at":"2025-05-07T04:25:08.461Z","avatar_url":"https://github.com/moayadnajd.png","language":"TypeScript","readme":"# Nativescript Comments\n[![npm](https://img.shields.io/npm/v/nativescript-comments.svg?maxAge=2592000?style=plastic)](https://www.npmjs.com/package/nativescript-comments)\n[![npm](https://img.shields.io/npm/dt/nativescript-comments.svg?maxAge=2592000?style=plastic)](https://www.npmjs.com/package/nativescript-comments)\n\nComments box ready for integration inside you'r native script app\n\n\n![Sample1](http://codeobia.com/screenshots/comments.gif)\n\n## Installation\n\n- `tns plugin add nativescript-comments`\n\n### add comments.ios.css and comments.android.css [css](https://github.com/moayadnajd/nativescript-comments/tree/master/demo/app) for styling \n\n*Be sure to run a new build after adding plugins to avoid any issues\n\n## Usage \n\t\n```\n    \u003cPage xmlns=\"http://schemas.nativescript.org/tns.xsd\" xmlns:UI=\"nativescript-comments\"\u003e\n    \u003cUI:Comments  like=\"{{ like }}\" add=\"{{ add }}\" items=\"{{ comments }}\"   /\u003e\n    \u003c/page\u003e\n```\n\n## access events\n\n```\n     public like(args) {\n        // args.object.toggle(args.to) function increase or decrease the like count inside the comment\n        // args.to has the id of the liked item \n        args.object.toggle(args.to);\n        console.log(this.comments.getItem(0).isLike);\n    }\n\n    public add(args) {\n        // args.object.busy(true) show the activity indicator\n        // args.object.busy(false) hide the activity indicator\n        // args.object.push({}) push new comment to the items \n        let self = this;\n        args.object.busy(true)\n\n        // setTimeout is just to emulate server delay time \n        setTimeout(function () {\n        args.object.push({ image: \"~/images/icon-50.png\", id: self.random(1000), comment: args.comment, replyTo: args.to, username: \"Demo User\", likes: 0, isLike: false, datetime: Date.now() });\n        console.log(self.comments.length);\n        args.object.busy(false);\n        }, 2000);\n    }\n\n    public edit(args) {\n        // the edited comment \n        alert(args.comment);\n        //the id of the edited comment\n        alert(args.id)\n    }\n\n        public delete(args) {\n        //the id of the deleted comment\n        alert(args.id);\n    }\n\n```\n### you can edit or delete by longPress on the comment that have {editing:true} in the comment object \n\n\n## API\n\n## see [demo](https://github.com/moayadnajd/nativescript-comments/tree/master/demo) for more details\n\n\n| Property | Default | Description |\n| --- | --- | --- |\n| items | required | Array of comment object { image:\" image src \", id: \"unique identifier of the comment\", comment: \"comment text \", username: \"user name \", likes: \" number of  how many likes \", isLike: \"boolean is the user like this or not \", datetime: \"datetime of the comment\" } |\n| add | function(arg){} | event on comment added you can access the object to push the comment buy args.object.push($comment-object) and you can get the id of the comment that replyed to by args.to |\n| like | function(arg){} | event on like clicked send with obj.to and you can toggle the like with args.object.toggle(args.to) |\n| scroll | true | enable or disable scrollview inside the comments holder |\n| canComment | true | disable or enable submission|\n| imagetag | \u003cImage /\u003e | the xml element of the image  so you can change it if you need to add cache plugin or something |\n| plugin | empty string | plugin include statment like xmlns:IC=\"nativescript-web-image-cache\" |\n| title | Comments | the title of the comments box |\n| replyText | reply | the reply button text |   \n| likeText | like | the like button text |   \n| toText | replying to : | replying to text  |   \n| sendText | comment | the comment send button text |\n| fontClass | fa | the font library class |\n|editingText | editing your comment | the editing help text when you hit edit |\n|xbtn | x | the exit edit or reply text can be font icon  |     \n|textview | false | boolean flag to make comment field  textview  or textfield | \n## License\n\nApache License Version 2.0, January 2004\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoayadnajd%2Fnativescript-comments","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoayadnajd%2Fnativescript-comments","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoayadnajd%2Fnativescript-comments/lists"}