{"id":17956978,"url":"https://github.com/pateketrueke/json-o-matic","last_synced_at":"2025-04-03T17:26:00.594Z","repository":{"id":6541083,"uuid":"7782487","full_name":"pateketrueke/json-o-matic","owner":"pateketrueke","description":"Give super powers to your plain-JSON!","archived":false,"fork":false,"pushed_at":"2013-10-26T08:18:04.000Z","size":308,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-09T06:14:15.115Z","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/pateketrueke.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}},"created_at":"2013-01-23T19:55:04.000Z","updated_at":"2013-10-26T08:18:10.000Z","dependencies_parsed_at":"2022-09-13T11:51:55.747Z","dependency_job_id":null,"html_url":"https://github.com/pateketrueke/json-o-matic","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/pateketrueke%2Fjson-o-matic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pateketrueke%2Fjson-o-matic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pateketrueke%2Fjson-o-matic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pateketrueke%2Fjson-o-matic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pateketrueke","download_url":"https://codeload.github.com/pateketrueke/json-o-matic/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247044830,"owners_count":20874384,"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-10-29T10:49:35.158Z","updated_at":"2025-04-03T17:26:00.578Z","avatar_url":"https://github.com/pateketrueke.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Yet another JSON-editable solution?\n===================================\n\nProbably not because here is no validation, no schemas and no complex setup.\n\nThus **json-o-matic** it's a lot simpler:\n\n```javascript\nvar data, fields;\n\ndata = { title: 'Hello World!' };\n\nfields = {\n  title: { as: 'scalar', label: 'Title:', size: 20 },\n  status: { as: 'list', label: 'Status:', set: ['draft', 'published'] }\n};\n\n$('#form-metadata').metadata({ set: fields, use: data });\n```\n\nYou'll get just a field set.\n\n![Sample field](http://i.imgur.com/sK3U7b9.png)\n\n\n## Available fields and options\n\nEach field type could have its own options, all extra parameters will be passed as html attributes.\n\nAll fields accept the **as**, **label** and **invert** parameter by default:\n\n### text\n\nUse textarea element for long text.\n\nDefaults:\n\n - **cols**: 40\n - **rows**: 4\n\n_Without options._\n\n### scalar\n\nOur usual input type.\n\nDefaults:\n\n - **type**: text\n\n_Without options._\n\n### toggle\n\nCheckbox for toggling states.\n\nDefaults:\n\n - **invert**: `true`\n - **set**: `[true, 'true', 'yes', 'on', 1]`\n\nOptions:\n\n - **set**: List of values to validate the state\n\n### group\n\nRadios or checkboxes nor more nor less.\n\nDefaults:\n\n - **invert**: `true`\n - **multiple**: `false`\n\nThe radio type will be used by default.\n\nOptions:\n\n - **multiple**: Use checkboxes to display multiple choices\n\n### list\n\nJust a select element.\n\nDefaults:\n\n - **set**: `[]`\n\nOptions:\n\n - **set**: The dropdown options\n\n### hash\n\nDefaults:\n\n - **set**: `{}`\n - **add**: `'\u0026plus;'`\n - **rm**: `'\u0026times;'`\n\nOptions:\n\n - **set**: Dynamic subset of fields\n - **add**: Add fields text\n - **rm**: Remove field text\n\n### map\n\nDefaults:\n\n - **set**: `{}`\n\nOptions:\n\n - **set**: Static subset of fields\n\n\nAfterwards you send the form you'll receive a normal data structure.\n\n```\nArray\n(\n    [title] =\u003e Hello World!\n    [status] =\u003e draft\n)\n```\n\nThat's it!\n\n\n## Known issues\n\n - Unstyled and not tested cross-browser\n - Missing enough documentation\n\n\n## Keep Calm \u0026 Contribute\n\nHave issues? Missing features? Share coins?\n\nSure you rocks!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpateketrueke%2Fjson-o-matic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpateketrueke%2Fjson-o-matic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpateketrueke%2Fjson-o-matic/lists"}