{"id":18290932,"url":"https://github.com/hichemtab-tech/copyshareify-js","last_synced_at":"2025-04-05T10:30:53.986Z","repository":{"id":210486463,"uuid":"665297681","full_name":"HichemTab-tech/CopyShareify-js","owner":"HichemTab-tech","description":"CopyShareify-js is a versatile JavaScript library that enhances buttons with customizable actions. With CopyShareify-js, you can effortlessly transform ordinary buttons into powerful tools that enable various actions, including copying content, sharing on social media platforms, and more.","archived":false,"fork":false,"pushed_at":"2023-08-30T07:09:23.000Z","size":544,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-30T20:02:05.620Z","etag":null,"topics":["button-actions","clipboard","copy-content","customizable-actions","dom-manipulation","frontend-development","html","html-elements","image-copying","javascript","javascript-library","jquery-plugin","share-content","social-media-sharing","ui-components","utility-library","web-development","web-share-api"],"latest_commit_sha":null,"homepage":"https://hichemtab-tech.github.io/CopyShareify-js","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/HichemTab-tech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-11T22:34:34.000Z","updated_at":"2025-03-22T22:28:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"cac1bb24-1997-405b-a4f3-6f515f6bd933","html_url":"https://github.com/HichemTab-tech/CopyShareify-js","commit_stats":{"total_commits":34,"total_committers":3,"mean_commits":"11.333333333333334","dds":0.2647058823529411,"last_synced_commit":"eb07874de5f29ef18f4a71db3a5a18fb42f1ffe6"},"previous_names":["hichemtab-tech/copyshareify-js"],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HichemTab-tech%2FCopyShareify-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HichemTab-tech%2FCopyShareify-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HichemTab-tech%2FCopyShareify-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HichemTab-tech%2FCopyShareify-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HichemTab-tech","download_url":"https://codeload.github.com/HichemTab-tech/CopyShareify-js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247324469,"owners_count":20920654,"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":["button-actions","clipboard","copy-content","customizable-actions","dom-manipulation","frontend-development","html","html-elements","image-copying","javascript","javascript-library","jquery-plugin","share-content","social-media-sharing","ui-components","utility-library","web-development","web-share-api"],"created_at":"2024-11-05T14:12:42.353Z","updated_at":"2025-04-05T10:30:53.978Z","avatar_url":"https://github.com/HichemTab-tech.png","language":"JavaScript","readme":"# CopyShareify-js\n\n**CopyShareify-js**  is a versatile JavaScript library that enhances buttons with customizable actions. With CopyShareify-js, you can effortlessly transform ordinary buttons into powerful tools that enable various actions, including copying content, sharing on social media platforms, and more.\n## Features\n\n- Seamlessly integrate copy and share functionality into buttons on your web pages\n- Copy strings, HTML elements, and even images to the clipboard\n- Customize the action behavior based on your specific requirements\n- Easy way to integrate without manually add the events.\n\n\n## Installation\n\n### npm\nYou can install CopyShareify-js via npm:\n```bash\n  npm install copyshareify-js\n```\n\n\n### CDN\nYou can also include CopyShareify-js directly from a CDN by adding the following script tag to your HTML file:\n\n```HTML\n  \u003cscript src=\"https://cdn.jsdelivr.net/gh/HichemTab-tech/CopyShareify-js@1.3.2/dist/copyshareify.min.js\"\u003e\u003c/script\u003e\n```\n\n### Local Download\nIf you prefer to host the library locally, you can download the latest release from the source code and include it in your project:\n\n```HTML\n\u003cscript src=\"path/to/copyshareify.min.js\"\u003e\u003c/script\u003e\n```\n## Usage\n\n### HTML Attribute Method\nTo use CopyShareify-js with HTML attributes, include the necessary dependencies (e.g., jQuery) and the CopyShareify-js script in your HTML file. Use the data-action attribute to specify the action, and other data attributes to configure the options.\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n  \u003chead\u003e\n    \u003ctitle\u003eYour Page Title\u003c/title\u003e\n    \u003c!-- Include the necessary dependencies --\u003e\n    \u003cscript src=\"path/to/jquery.js\"\u003e\u003c/script\u003e\n    \u003cscript src=\"path/to/copyshareify.js\"\u003e\u003c/script\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    \u003c!-- Your HTML content here --\u003e\n    \u003cbutton data-action=\"copy\" data-string=\"Hello, world!\"\u003eCopy Text\u003c/button\u003e\n    \u003cbutton data-action=\"share\" data-title=\"My Page\" data-description=\"Check out this amazing website!\" data-string=\"https://www.example.com\"\u003eShare Link\u003c/button\u003e\n\n    \u003cscript\u003e\n      // Initialize CopyShareify on the buttons\n      $('[data-action]').CopyShareify();\n    \u003c/script\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\n### Individual Element Method\nAlternatively, you can trigger CopyShareify on individual elements by passing an options object:\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n  \u003chead\u003e\n    \u003ctitle\u003eYour Page Title\u003c/title\u003e\n    \u003c!-- Include the necessary dependencies --\u003e\n    \u003cscript src=\"path/to/jquery.js\"\u003e\u003c/script\u003e\n    \u003cscript src=\"path/to/copyshareify.js\"\u003e\u003c/script\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    \u003c!-- Your HTML content here --\u003e\n    \u003cbutton id=\"copyButton\"\u003eCopy Text\u003c/button\u003e\n    \u003cbutton id=\"shareButton\"\u003eShare Link\u003c/button\u003e\n\n    \u003cscript\u003e\n      // Initialize CopyShareify on the buttons individually\n      $('#copyButton').CopyShareify({\n        action: 'copy',\n        string: 'Hello, world!',\n      });\n\n      $('#shareButton').CopyShareify({\n        action: 'share',\n        title: 'My Page',\n        description: 'Check out this amazing website!',\n        string: 'https://www.example.com',\n      });\n    \u003c/script\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n\n```\n\n### Selecting the Text\nCopyShareify-js provides multiple ways to select the text to be copied or shared:\n\n- **String**: You can directly specify a string value to be copied or shared.\n- **HTML Input Selector**: You can select the text from an - HTML input element by providing the input selector.\n- **HTML Element Selector**: You can select the text from an HTML element by providing the element selector.\n- **HTML Image Selector**: You can select an image to be copied or shared by providing the image selector.\n\nHere's an example of how to use CopyShareify-js with different selection options:\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n  \u003chead\u003e\n    \u003ctitle\u003eYour Page Title\u003c/title\u003e\n    \u003c!-- Include the necessary dependencies --\u003e\n    \u003cscript src=\"path/to/jquery.js\"\u003e\u003c/script\u003e\n    \u003cscript src=\"path/to/copyshareify.js\"\u003e\u003c/script\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    \u003c!-- Your HTML content here --\u003e\n    \u003cbutton data-action=\"copy\" data-string=\"Hello, world!\"\u003eCopy Text\u003c/button\u003e\n    \u003cbutton data-action=\"share\" data-title=\"My Page\" data-description=\"Check out this amazing website!\" data-string=\"https://www.example.com\"\u003eShare Link\u003c/button\u003e\n\n    \u003cinput type=\"text\" id=\"inputText\" value=\"This is an input value\"\u003e\n    \u003cp id=\"paragraph\"\u003eThis is a paragraph text\u003c/p\u003e\n    \u003cimg id=\"image\" src=\"path/to/image.jpg\" alt=\"Image\"\u003e\n\n    \u003cbutton data-action=\"copy\" data-html-input-selector=\"#inputText\"\u003eCopy Input Text\u003c/button\u003e\n    \u003cbutton data-action=\"copy\" data-html-element-selector=\"#paragraph\"\u003eCopy Paragraph Text\u003c/button\u003e\n    \u003cbutton data-action=\"copy\" data-html-img-selector=\"#image\"\u003eCopy Image\u003c/button\u003e\n\n    \u003cscript\u003e\n      // Initialize CopyShareify on the buttons\n      $('[data-action]').CopyShareify();\n    \u003c/script\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n\n```\n## Options\n| Key                   | Description                                                                        |\n|-----------------------|------------------------------------------------------------------------------------|\n| `action`              | Specifies the action to be performed (e.g., \"copy\" or \"share\").                    |\n| `string`              | The string value to be copied or shared.                                           |\n| `htmlInputSelector`   | The selector of the HTML input element from which the text will be copied.         |\n| `htmlElementSelector` | The selector of the HTML element from which the text will be copied.               |\n| `htmlImgSelector`     | The selector of the HTML image element to be copied.                               |\n| `title`               | The title or subject of the content to be shared.                                  |\n| `description`         | The description or additional information about the content to be shared.          |\n| `onActionDone`        | The callback function to be executed when the action is successfully performed.    |\n| `onActionFailed`      | The callback function to be executed when the action fails or encounters an error. |\n\n\n## Demo\n\nHere's a Demo example : \n\n[Demo](https://hichemtab-tech.github.io/CopyShareify-js/)\n\n## Contributing\n\nContributions are always welcome!\n\nIf you have any ideas, improvements, or bug fixes, please open an issue or submit a pull request.\n\n\n## Authors\n\n- [@HichemTab-tech](https://www.github.com/HichemTab-tech)\n\n## License\n\n[MIT](https://github.com/HichemTab-tech/CopyShareify-js/blob/master/LICENSE)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhichemtab-tech%2Fcopyshareify-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhichemtab-tech%2Fcopyshareify-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhichemtab-tech%2Fcopyshareify-js/lists"}