{"id":17438551,"url":"https://github.com/blixt/js-application","last_synced_at":"2026-01-22T14:59:53.514Z","repository":{"id":878302,"uuid":"621823","full_name":"blixt/js-application","owner":"blixt","description":"A JavaScript library that handles path maps that direct control to handlers, along with the query string parameters.","archived":false,"fork":false,"pushed_at":"2010-04-21T15:53:30.000Z","size":92,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-11T15:58:39.935Z","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/blixt.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":"2010-04-21T15:53:09.000Z","updated_at":"2013-10-24T05:01:54.000Z","dependencies_parsed_at":"2022-08-16T11:25:05.211Z","dependency_job_id":null,"html_url":"https://github.com/blixt/js-application","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/blixt/js-application","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blixt%2Fjs-application","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blixt%2Fjs-application/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blixt%2Fjs-application/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blixt%2Fjs-application/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blixt","download_url":"https://codeload.github.com/blixt/js-application/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blixt%2Fjs-application/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28664827,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-22T14:01:31.714Z","status":"ssl_error","status_checked_at":"2026-01-22T13:59:23.143Z","response_time":144,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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-17T12:15:35.968Z","updated_at":"2026-01-22T14:59:53.489Z","avatar_url":"https://github.com/blixt.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Application handler\n\n## Information\n\nA JavaScript library that handles path maps that direct control to handlers,\nalong with the query string parameters.\n\nRecommended use is for supporting paths in the hash part of the address bar.\nYou can do this using a hash history library (such as [Hash or the jQuery hash\nplugin][js-hash]) and call the exec() method when the hash changes.\n\n## Example\n\n    var UserHandler = Application.handler(function (username, section) {\n        alert('Hi ' + username + '!');\n        if (section) alert('Showing ' + section + ', page ' +\n                           this.get_param('page', 1));\n    });\n\n    var HomeHandler = Application.handler(function () {\n        alert('Home!');\n    });\n\n    var app = new Application([\n        ['^home$', HomeHandler],\n        ['^user/([^/]+)(?:/([^/]+))?$', UserHandler]\n    ]);\n\n    app.exec('user/bob/articles?page=2');\n    // Handler UserHandler will be found (because the pattern matches), and\n    // then be used like this:\n    // var handler = new UserHandler(app, 'user/bob/articles?page=2',\n    //                               'user/bob/articles',\n    //                               ['bob', 'articles'], {page: '2'});\n    // handler.run('bob', 'articles');\n\nThe above example will open a dialog with the text \"Hi bob!\", followed by\nanother dialog with the text \"Showing articles, page 2\". Experiment with the\n`app.exec(...)` call!\n\n## Example 2 (using Hash and jquery.hash)\n\n    // Create application for handling the site.\n    var app = new Application([\n        ['^$', HomeHandler],\n        ['^project/([^/]+)$', ProjectHandler],\n        ['^.*$', NotFoundHandler]\n    ]);\n\n    // Set up application to use the hash as its path.\n    $(document).hashchange(function (e, hash) {\n        app.exec(hash);\n    });\n\n    // Enable the hash library.\n    $.hash.init();\n\nNote that in the above code, the handlers haven't been included. The example\ncode is only to show how to set up the Application library to use [the Hash\nlibrary with the jQuery hash plugin][js-hash].\n\n## MIT license\n\nThis project is licensed under an MIT license.\n\nCopyright (c) 2009-2010 Andreas Blixt \u003candreas@blixt.org\u003e\n\nhttp://www.opensource.org/licenses/mit-license.php\n\n[js-hash]: http://github.com/blixt/js-hash\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblixt%2Fjs-application","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblixt%2Fjs-application","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblixt%2Fjs-application/lists"}