{"id":21521085,"url":"https://github.com/weisjohn/jquery-tree-manipulator","last_synced_at":"2025-10-18T07:55:04.743Z","repository":{"id":15341932,"uuid":"18072566","full_name":"weisjohn/jquery-tree-manipulator","owner":"weisjohn","description":"A depth-first walker for manipulating an arbitrary DOM tree.","archived":false,"fork":false,"pushed_at":"2015-02-05T06:54:09.000Z","size":172,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-24T02:06:22.413Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://weisjohn.github.io/jquery-tree-manipulator/","language":null,"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/weisjohn.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":"2014-03-24T17:59:45.000Z","updated_at":"2024-06-22T02:57:47.000Z","dependencies_parsed_at":"2022-08-30T12:11:28.976Z","dependency_job_id":null,"html_url":"https://github.com/weisjohn/jquery-tree-manipulator","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weisjohn%2Fjquery-tree-manipulator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weisjohn%2Fjquery-tree-manipulator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weisjohn%2Fjquery-tree-manipulator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weisjohn%2Fjquery-tree-manipulator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/weisjohn","download_url":"https://codeload.github.com/weisjohn/jquery-tree-manipulator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244075649,"owners_count":20393980,"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-24T01:05:42.941Z","updated_at":"2025-10-18T07:54:59.687Z","avatar_url":"https://github.com/weisjohn.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"jquery-tree-manipulator\n=============\n\na depth-first walker for manipulating an arbitrary DOM tree\n\n`jquery-tree-manipulator` was born out of a need to integrate with http://blog.yesmeck.com/jquery-jsonview/ without rebuilding the whole thing.\n\n[Demo](http://weisjohn.github.io/jquery-tree-manipulator/)\n\n### usage\n\n`sample.html`:\n\n```html\n\u003cdiv class=\"tree\"\u003e\n    \u003cul\u003e\n        \u003cli\u003e\n            \u003cspan\u003efoo\u003c/span\u003e\n        \u003c/li\u003e\n        \u003cli\u003e\n            \u003cspan class=\"collapser\"\u003e-\u003c/span\u003e\n            \u003cspan\u003ebar\u003c/span\u003e\n            \u003cul\u003e\n                \u003cli\u003ebat\u003c/li\u003e\n                \u003cli\u003ebaz\u003c/li\u003e\n                \u003cli\u003ebin\u003c/li\u003e\n                \u003cspan class=\"collapser\"\u003e-\u003c/span\u003e\n                \u003cul\u003e\n                    \u003cli\u003ecat\u003c/li\u003e\n                \u003c/ul\u003e\n            \u003c/ul\u003e\n        \u003c/li\u003e\n    \u003c/ul\u003e\n\u003c/div\u003e\n```\n\n`sample.js`:\n\n```javascript\n$(\".tree\").treeManipulator({\n    structure: \"\u003e ul \u003e li\",\n    opened: \".collapser:contains('-')\",\n    closed: \".collapser:contains('+')\"\n});\n```\n\n`jquery-tree-manipulator` requires you tell it how to traverse your tree. You must provide three selectors for it to know how to traverse, open, and close the DOM nodes.\n\nYou can then invoke the `close` and `open` methods on the plugin, optionally passing a `depth` limit as an argument, such as:\n\n```javascript\n// close all nodes\n$(\".tree\").treeManipulator('close');\n// open the first level\n$(\".tree\").treeManipulator('open', 1);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweisjohn%2Fjquery-tree-manipulator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fweisjohn%2Fjquery-tree-manipulator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweisjohn%2Fjquery-tree-manipulator/lists"}