{"id":22152407,"url":"https://github.com/sinri/sinri.js","last_synced_at":"2025-03-24T13:26:18.065Z","repository":{"id":81825302,"uuid":"75067210","full_name":"sinri/sinri.js","owner":"sinri","description":"Sinri.js Lighter jQuery","archived":false,"fork":false,"pushed_at":"2016-11-30T07:11:17.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-29T18:33:23.421Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sinri.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":"2016-11-29T09:52:23.000Z","updated_at":"2016-11-29T13:51:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"103b1b90-bec0-42d4-a85c-489c714395e8","html_url":"https://github.com/sinri/sinri.js","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/sinri%2Fsinri.js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinri%2Fsinri.js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinri%2Fsinri.js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sinri%2Fsinri.js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sinri","download_url":"https://codeload.github.com/sinri/sinri.js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245277930,"owners_count":20589217,"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-12-02T00:51:09.401Z","updated_at":"2025-03-24T13:26:18.011Z","avatar_url":"https://github.com/sinri.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sinri.js\n\nSinri.js is a lighter javascript toolkit for web developers, with jQuery-like style.\n\n[![Code Climate](https://codeclimate.com/github/sinri/sinri.js/badges/gpa.svg)](https://codeclimate.com/github/sinri/sinri.js) [![Issue Count](https://codeclimate.com/github/sinri/sinri.js/badges/issue_count.svg)](https://codeclimate.com/github/sinri/sinri.js)\n\nIt is not for those hackers, nor senior and professional frontend engineer when dealing with top projects. However, it is designed for those use frontend technology just for a short-time tool and do not want to be bothered by the variousity between versions of jQuery.\n\nSo anyone prefer React or Angular.js or Vue.js or any other top frontend plans could neglect this project.\n\n# API Usage\n\nThe main object is `SINRI_JS`. If `$` was not used by others, it could be used as a shortcus.\n\n## Window Event\n\nThere are two functions on window's being loaded, `ready` and `loaded`.\n\n\t$.ready(callback) // simulate the jQuery ready\n\n\t$.loaded(callback) // capsulize the window.onload\n\n## Selector\n\nFirst, use `SINRI_JS(query_string)` to get the base chain function.\n\nSecond, follow the functions, including\n\n\tval() // Get value of the selected element\n\tval(value_to_set) // Set value of the selected element\n\tattr(name) // Get value of the named attribute of the selected element\n\tattr(name,value_to_set) // Set value of the named attribute of the selected element\n\thtml() // Get innerHTML of the selected element\n\thtml(value_to_set) // Set innerHTML of the selected element\n\ttext() // Get innerText of the selected element\n\ttext(value_to_set) // Set innerText of the selected element\n\n\teprop(name) // Get value [name] of the selected element (such as one_input.checked)\n\teprop(name,value_to_set) // Set the value [name] of the selected element\n\n\ton(event,function,useCapture) // set the event-function mapping of selected element\n\n## AJAX\n\nJust like old style jQuery AJAX.\n\n\t$.ajax({\n\t\turl:'api/subset',\n\t\tmethod:'get',//optional: get(default),post,put,delete\n\t\theader:{H:V},//optional: headers\n\t\tdata:DATA,//optional: string or object\n\t\tbeforeSend:function(method,url,data){\n\t\t\tconsole.log('beforeSend: ',method,url,data);\n\t\t},//optional\n\t\tdone:function(data,code){\n\t\t\tconsole.log('done with code ',code);\n\t\t\tconsole.log(data);\n\t\t},//optional\n\t\tfail:function(data,code){\n\t\t\tconsole.log('fail with code ',code);\n\t\t\tconsole.log(data);\n\t\t},//optional\n\t\talways:function(data,code){\n\t\t\tconsole.log('always with code ',code);\n\t\t\tconsole.log(data);\n\t\t}//optional\n\t});\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsinri%2Fsinri.js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsinri%2Fsinri.js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsinri%2Fsinri.js/lists"}