{"id":16387597,"url":"https://github.com/bitnbytesio/slightjs","last_synced_at":"2025-07-21T07:31:58.630Z","repository":{"id":25263546,"uuid":"28688806","full_name":"bitnbytesio/slightjs","owner":"bitnbytesio","description":"Slightjs used for speed optimization or for single page applications.","archived":false,"fork":false,"pushed_at":"2015-11-24T08:10:02.000Z","size":52,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-22T12:16:27.780Z","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":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bitnbytesio.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":"2015-01-01T15:11:48.000Z","updated_at":"2016-08-27T09:45:40.000Z","dependencies_parsed_at":"2022-08-23T22:10:32.023Z","dependency_job_id":null,"html_url":"https://github.com/bitnbytesio/slightjs","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/bitnbytesio/slightjs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitnbytesio%2Fslightjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitnbytesio%2Fslightjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitnbytesio%2Fslightjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitnbytesio%2Fslightjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bitnbytesio","download_url":"https://codeload.github.com/bitnbytesio/slightjs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitnbytesio%2Fslightjs/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266261119,"owners_count":23901284,"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-11T04:26:57.812Z","updated_at":"2025-07-21T07:31:58.607Z","avatar_url":"https://github.com/bitnbytesio.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"slightjs (Beta Version)\n========\n\nSlightjs used for speed optimization.\n\n## How to use?\n\nFirst attach slight.js to your web page. Make sure jquery is already attached before using slight.js (Slight depends on jquery).\n\n**Use the below javascript codes**\n\nNote: make sure you have all the page avilable on your host (Used in the below script example or change according to your application)\n\n```javascript\n\n\nSlight = new SlightPlugin({\n    url:\"http://example.com/\",\n    before: function() {\n        // show page loader\n        $(\".page-loader\").css(\"visibility\", \"visible\");\n        \n    },\n    after: function() {\n        // hide page loader\n        $(\".page-loader\").css(\"visibility\", \"hidden\");\n    }\n});\n\nSlight.router('index.php', function(){\n\n  // do some action here\n\n});\n\nSlight.router('create.php', function(){\n\n  // do some action here\n\n}).after(function() { \n\n  // execute some javascript codes\n\t$(\"#createUserForm\").actionAjax();\n\n }).before(function(){\n \n  // before callback\n \n });\n \n Slight.router('edit.php', function() {}).after(function() { \n \n // execute some javascript codes\n\t$(\"#editUserForm\").actionAjax();\n\n }).scripts(['http://cdn.host.com/some_lib/ver/script.js', 'some_local_script.js']).css(['edit_stylesheet.css']);\n \n \n Slight.notFound(function(){\n \n  // take some action on missing route\n \n });\n\n Slight.router('login.php', function() {}).after(function() {\n \n  // execute some javascript after request completed\n\t$(\"#userLoginForm\").actionAjax();\n\n });\n\nSlight.router('list.php', function() {\n\n// do some action here\n\n});\n\n// lets start the app\nSlight.listen();\n\n```\n\n**HTML Example**\n\nNote: Slight make ajax request to requested page or url. Make sure you have coded you page acc. to it. Avoid loading full layout page.\n\n```html\n\n\u003c!DOCTYPE html\u003e\n\u003chtml lang=\"en\"\u003e\n  \u003chead\u003e\n    \u003cmeta charset=\"utf-8\"\u003e\n    \u003cmeta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"\u003e\n    \u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1\"\u003e\n   \n    \u003ctitle\u003eSlight JS Beta Version\u003c/title\u003e\n\n    \u003c!-- Bootstrap core CSS --\u003e\n    \u003clink href=\"css/bootstrap.min.css\" rel=\"stylesheet\"\u003e\n\n    \u003c!-- action ajax --\u003e\n    \u003clink href=\"css/action-ajax.css\" rel=\"stylesheet\"\u003e\n  \u003c/head\u003e\n\n  \u003cbody\u003e\n\u003c!-- Bootstrap Nav Bar --\u003e\n   \u003cnav class=\"navbar navbar-inverse\"\u003e\n  \u003cdiv class=\"container\"\u003e\n    \u003cdiv class=\"navbar-header\"\u003e\n      \u003cbutton type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#navbar\" aria-expanded=\"false\" aria-controls=\"navbar\"\u003e\n        \u003cspan class=\"sr-only\"\u003eToggle navigation\u003c/span\u003e\n        \u003cspan class=\"icon-bar\"\u003e\u003c/span\u003e\n        \u003cspan class=\"icon-bar\"\u003e\u003c/span\u003e\n        \u003cspan class=\"icon-bar\"\u003e\u003c/span\u003e\n      \u003c/button\u003e\n      \u003ca class=\"navbar-brand\" href=\"index.php\"\u003eSlight.js\u003c/a\u003e\n    \u003c/div\u003e\n    \u003cdiv id=\"navbar\" class=\"collapse navbar-collapse\"\u003e\n      \u003cul class=\"nav navbar-nav\"\u003e\n        \u003cli class=\"active\"\u003e\u003ca href=\"index.php\" data-role=\"slight\"\u003eHome\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"create.php\" data-role=\"slight\"\u003eCreate\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"list.php\" data-role=\"slight\"\u003eList All\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"login.php\" data-role=\"slight\"\u003eLogin\u003c/a\u003e\u003c/li\u003e\n      \u003c/ul\u003e\n      \u003cul class=\"nav navbar-nav navbar-right\"\u003e\n      \u003c!-- attach some ajax loader .gif image as background of .page-loader class --\u003e\n        \u003cli\u003e\u003cspan class=\"page-loader\"\u003e\u003c/span\u003e\u003c/li\u003e\n      \u003c/ul\u003e\n    \u003c/div\u003e\u003c!--/.nav-collapse --\u003e\n  \u003c/div\u003e\n\u003c/nav\u003e\n    \u003cdiv class=\"container\"\u003e\n      \u003cdiv class=\"slight-body\" id=\"page-body\"\u003e\n\n\t\u003c!-- slight will load your content here --\u003e\n\n      \n        \n      \u003c/div\u003e\n\n    \u003c/div\u003e\u003c!-- /.container --\u003e\n\n\n    \u003c!-- Placed at the end of the document so the pages load faster --\u003e\n    \u003cscript src=\"js/jquery.min.js\"\u003e\u003c/script\u003e\n    \u003cscript src=\"js/slight.js\"\u003e\u003c/script\u003e\n    \u003cscript src=\"js/action-ajax.js\"\u003e\u003c/script\u003e\n    \u003c!-- place your slight scrpit codes here --\u003e\n    \u003cscript src=\"js/script.js\"\u003e\u003c/script\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitnbytesio%2Fslightjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbitnbytesio%2Fslightjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitnbytesio%2Fslightjs/lists"}