{"id":16971537,"url":"https://github.com/thomastjdev/vanillaice","last_synced_at":"2025-07-22T07:33:12.660Z","repository":{"id":87657559,"uuid":"242302890","full_name":"ThomasTJdev/vanillaice","owner":"ThomasTJdev","description":"vanillaice - JS library structuring some JS based on vanilla to avoid jQuery.","archived":false,"fork":false,"pushed_at":"2020-02-23T08:58:34.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-21T20:16:09.128Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ThomasTJdev.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-02-22T07:57:59.000Z","updated_at":"2020-02-23T08:58:36.000Z","dependencies_parsed_at":"2023-03-11T03:30:37.493Z","dependency_job_id":null,"html_url":"https://github.com/ThomasTJdev/vanillaice","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ThomasTJdev/vanillaice","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThomasTJdev%2Fvanillaice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThomasTJdev%2Fvanillaice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThomasTJdev%2Fvanillaice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThomasTJdev%2Fvanillaice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ThomasTJdev","download_url":"https://codeload.github.com/ThomasTJdev/vanillaice/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThomasTJdev%2Fvanillaice/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266448066,"owners_count":23930117,"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","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-14T00:52:20.090Z","updated_at":"2025-07-22T07:33:12.638Z","avatar_url":"https://github.com/ThomasTJdev.png","language":"JavaScript","readme":"# vanillaice\nJS library structuring some JS based on vanilla to avoid jQuery.\n\n# Main\n\nImport vanillaice.js and then access the functions with:\n```js\njs.[func-name](params)\n```\n\n# Examples\n\nSome of the functions are shown below. For all the main functions, it is possible to pass an object, array of objects, an #ID, a .class or a query like:\n\n```js\nvar el = js.el(\"#aa\")\njs.setStyle(el, \"color\", \"blue\");\njs.setStyle(\"#aa\", \"color\", \"blue\");\njs.setStyle(\".container .textfield\", \"color\", \"blue\");\n```\n\n## Echo function\n\n### echo()\nAn echo-function is available, use `echo()` for general `console.log()` output. It is possible to override the `echo()` when setting `echomode = \"override\"`.\n\n```js\necho(js.el(\"#aa\"));\n\n// vanillaice.js:31 \u003cinput class=​\"testdata inputSpecialClass\" id=​\"aa\" value=​\"This is aa\"\u003e​\n```\n\n```js\nechomode = \"override\"\necho(js.el(\"#aa\"));\n\n// vanillaice.js:23 DEV: [object HTMLInputElement]\n//   vanillaice.js:24 console.trace\n//   echodebug\t@\tvanillaice.js:24\n//   echo\t@\tvanillaice.js:29\n//   (anonymous)\t@\tVM969:2\n```\n\n### echodev()\nFor debug use `echodev()`. When setting `echomode = \"release\"`, `echodev()` will use `echo()`.\n\n```js\nechodev(js.el(\"#aa\"));\n\n// vanillaice.js:23 DEV: [object HTMLInputElement]\n//   vanillaice.js:24 console.trace\n//   echodebug\t@\tvanillaice.js:24\n//   (anonymous)\t@\tVM988:2\n```\n\n```js\nechomode = \"release\"\nechodev(js.el(\"#aa\"));\n\n// vanillaice.js:31 \u003cinput class=​\"testdata inputSpecialClass\" id=​\"aa\" value=​\"This is aa\"\u003e​\n```\n\n## Main\n\n### Objects\n```js\nvar tEl1 = js.el(\"#aa\")\nvar tEl2 = js.el(\".inputSpecialClass\")\nvar tEl3 = js.el(\".containerp .isp\")\n```\n\n### Parent, child, children, prev, next\n```js\nvar tP1 = js.parent(\"#ID\")\nvar tC1 = js.child(\".container\")\nvar tC2 = js.children(\".container\") // array of objects\nvar tN1 = js.next(\"#ID\");\nvar tN2 = js.prev(\"#ID\");\n```\n\n### Values\n```js\njs.setValue(\"#ID\", \"New text\");\njs.appendValue(\"#ID\", \"appendValue\");\nvar tV1 = js.getValue(\"#ID\");\n```\n\n### Text\n```js\njs.setText(\"#ID\", \"setText\");\njs.appendText(\"#ID\", \"appendText\");\nvar tV1 = js.getValue(\"#ID\");\n```\n\n### Exist\n```js\njs.exist(\"#ID\") // true / false\n```\n\n### Style\n```js\njs.setStyle(\"#container\", \"color\", \"yellow\")\nvar tS1 = js.getStyle(\"#container\", \"color\");\n```\n\n### Attributes\n```js\njs.setAttr(\"#container\", \"data-new\", \"newAttr\");\nvar tA1 = js.getAttr(\"#container\", \"data-new\"); // newAttr\njs.delAttr(\"#container\", \"data-new\");\nvar tA2 = js.getAttr(\"#container\", \"data-new\"); // null\n```\n\n### Loops\n```js\nvar looparr = js.el(\".textfield\");\nvar loopd = \"\";\njs.loopFunc(looparr, function(e) {\n  loopd += js.getText(e) + \" | \";\n  js.setText(e, \"loop OK\");\n})\nechodev(loopd);\n```\n\n### Events\n```js\njs.event(\"#thirdp\", \"click\", function() {\n  alert(\"thirp click\");\n})\njs.onEvent(document, \"#fourp\", \"click\", function () {\n  alert(\"fourp click\");\n})\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthomastjdev%2Fvanillaice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthomastjdev%2Fvanillaice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthomastjdev%2Fvanillaice/lists"}