{"id":19358858,"url":"https://github.com/kathan/pasteable","last_synced_at":"2025-06-15T10:38:35.737Z","repository":{"id":95303858,"uuid":"56097537","full_name":"kathan/pasteable","owner":"kathan","description":"Paste text into any HTML element.","archived":false,"fork":false,"pushed_at":"2021-02-09T21:04:22.000Z","size":93,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-24T12:15:17.914Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/kathan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2016-04-12T21:02:03.000Z","updated_at":"2021-02-09T21:04:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"d80effe6-478c-40e5-b4c0-92c237913a0d","html_url":"https://github.com/kathan/pasteable","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kathan/pasteable","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kathan%2Fpasteable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kathan%2Fpasteable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kathan%2Fpasteable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kathan%2Fpasteable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kathan","download_url":"https://codeload.github.com/kathan/pasteable/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kathan%2Fpasteable/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259960589,"owners_count":22938092,"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":[],"created_at":"2024-11-10T07:13:22.025Z","updated_at":"2025-06-15T10:38:35.719Z","avatar_url":"https://github.com/kathan.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pasteable\nPasteable is a dependency free library that will allow you to paste text into any HTML element.\n[Try it!](https://codepen.io/kathan-the-typescripter/pen/yLVaeMb)\n## Pasteable Elements Can Receive Focus.\nClick on the text input and it receives the focus...\n\n![Ordinary Text Input](https://raw.githubusercontent.com/kathan/pasteable/master/img/ordinary_text_input.png)\n\n...then click on the element using pasteable and it receives the focus.\n\n![Div using pasteable](https://raw.githubusercontent.com/kathan/pasteable/master/img/div_using_pasteable.png)\n\n## Example\nIn the \"test\" folder there is an Simple Grid Example using Angular.\n\nClick..\n\n![Click and paste](https://raw.githubusercontent.com/kathan/pasteable/master/img/click_and_paste.png)\n\n...and paste!\n\n![Click and paste](https://raw.githubusercontent.com/kathan/pasteable/master/img/pasted_data.png)\n\n### HTML\n```html\n\u003chtml\u003e\n  \u003chead\u003e\n    \u003cscript src=\"../pasteable.js\"\u003e\u003c/script\u003e\n    \u003cscript src=\"https://ajax.googleapis.com/ajax/libs/angularjs/1.4.9/angular.min.js\"\u003e\u003c/script\u003e\n    \u003cscript src=\"PasteCtrl.js\"\u003e\u003c/script\u003e\n    \u003clink rel=\"stylesheet\" href=\"style.css\" /\u003e\n  \u003c/head\u003e\n  \u003cbody ng-app=\"PasteApp\" ng-controller=\"PasteCtrl\"\u003e\n    \u003ch4\u003eSimple Grid Example\u003c/h4\u003e\n    \u003cdiv id=\"my_element\"\u003eClick and Paste Tab-Delimited Text Here\n      \u003c!--\n      The elements below will render a multi-dimensional array into a grid\n      --\u003e\n      \u003ctable id=\"my_grid\"\u003e\n        \u003ctr ng-repeat=\"row in grid_data track by $index\"\u003e\n          \u003ctd ng-repeat=\"col in row track by $index\"\u003e{{col}}\u003c/td\u003e\n        \u003c/tr\u003e\n      \u003ctable\u003e\n    \u003c/div\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n### Javascript\n```javascript\nvar PasteApp = angular.module(\"PasteApp\",[]);\n\nPasteApp.controller('PasteCtrl', function ($scope, $http, $rootScope){\n  $scope.grid_data = [];\n  /************************************\n   * Initialize your pasteable element\n   ************************************/\n  var s = pasteable({selectElement:'#my_element'});\n  s.addEventListener('paste', function(e){\n    /************************************\n     * Parse the pasted data into a multi-\n     * dimensional array and allow Angular\n     * template to render it into a grid.\n     ************************************/\n    var rows = e.detail.split(/\\n/);\n    for(var r in rows){\n      var columns = rows[r].split(/\\t/);\n      $scope.grid_data.push(columns);\n    }\n    $scope.$apply();\n  });\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkathan%2Fpasteable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkathan%2Fpasteable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkathan%2Fpasteable/lists"}