{"id":20461047,"url":"https://github.com/ericgj/editable-model","last_synced_at":"2025-03-05T11:27:38.065Z","repository":{"id":8877849,"uuid":"10593669","full_name":"ericgj/editable-model","owner":"ericgj","description":"Simple in-place editing integrated with component/model","archived":false,"fork":false,"pushed_at":"2013-06-10T21:19:26.000Z","size":128,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-16T00:35:47.217Z","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/ericgj.png","metadata":{"files":{"readme":"Readme.md","changelog":"History.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":"2013-06-10T04:38:22.000Z","updated_at":"2013-10-25T13:59:25.000Z","dependencies_parsed_at":"2022-09-17T08:50:28.573Z","dependency_job_id":null,"html_url":"https://github.com/ericgj/editable-model","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/ericgj%2Feditable-model","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericgj%2Feditable-model/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericgj%2Feditable-model/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericgj%2Feditable-model/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ericgj","download_url":"https://codeload.github.com/ericgj/editable-model/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242017456,"owners_count":20058432,"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-15T12:23:01.217Z","updated_at":"2025-03-05T11:27:38.047Z","avatar_url":"https://github.com/ericgj.png","language":"JavaScript","readme":"\n# editable-model\n\n  Simple in-place editing integrated with component/model\n\n  \u003cimg src=\"http://i.imgur.com/9r6aXf0.png\" title=\"Example\" /\u003e\n\n## Installation\n\n    $ component install ericgj/editable-model\n\n## Example\n\nSee [test/index.html](/test/index.html).\n\n## API\n\n### EditableRec([el],model) \n   \nConstruct the editable component bound to the given model instance.\n\nIf `el` given, all child elements with class `editable` are automatically bound\nto the model attribute matching their `data-model-attr` element attribute,\nand edited using 'contenteditable'. Also, keyboard event bindings are scoped\nto the given `el`. Note this behavior may change (see TODO below).\n\n### EditableRec#edit()\n\nEnter 'edit' mode. All associated editable components are made editable.\n\n### EditableRec#done()\n\nExit 'edit' mode, saving the model changes, if model is dirty.\n\n### EditableRec#cancel()\n\nExit 'edit' mode, reverting any changes to the model.\n\n### EditableRec#editing()\n\nTrue if in 'edit' mode, false otherwise.\n\n### EditableRec#addEditable(el,attr)\n\nBind the given element to the given attribute of the model.\n\n### EditableRec#doneKeys=\n\nKeydown bindings for triggering done() while in edit mode. By default, \"enter\".\nSee [yields/k](https://github.com/yields/k) for syntax for keys.\n\n### EditableRec#cancelKeys=\n\nKeydown bindings for triggering cancel() while in edit mode. By default, \"esc\".\n\n## Events\n\n- `edit model`\n- `done model`\n- `cancel model`\n\n## Notes\n\nNo assumptions are made about how users enter edit mode. It's up to the \ncalling context to trigger `edit()` from an event callback.\n\nBy default, exiting edit mode is triggered through \"enter\" (`done`) and \"esc\" \n(`cancel`) keydowns within a parent element. These can be disabled by setting \n`doneKeys =  null` and `cancelKeys = null`, or changed to other key \ncombinations. And of course external events can be wired up to trigger `done` \nand `cancel`.\n\n\n## TODO\n\nCustom editable behavior. Right now editing is done via 'contenteditable',\nbut this is too uncontrolled for many situations. Should be possible to\nspecify custom editable classes to use instead.\n\n\n## License\n\n  MIT\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericgj%2Feditable-model","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fericgj%2Feditable-model","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericgj%2Feditable-model/lists"}