{"id":16962028,"url":"https://github.com/wangdahoo/zui","last_synced_at":"2025-03-21T15:46:42.984Z","repository":{"id":89195907,"uuid":"44425865","full_name":"wangdahoo/zui","owner":"wangdahoo","description":"ZUI Framework","archived":false,"fork":false,"pushed_at":"2015-11-13T09:27:44.000Z","size":1256,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-26T11:13:09.254Z","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/wangdahoo.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-10-17T05:57:27.000Z","updated_at":"2015-10-31T13:00:25.000Z","dependencies_parsed_at":"2023-03-13T18:13:48.461Z","dependency_job_id":null,"html_url":"https://github.com/wangdahoo/zui","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/wangdahoo%2Fzui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wangdahoo%2Fzui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wangdahoo%2Fzui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wangdahoo%2Fzui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wangdahoo","download_url":"https://codeload.github.com/wangdahoo/zui/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244825263,"owners_count":20516587,"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-13T23:05:00.857Z","updated_at":"2025-03-21T15:46:42.932Z","avatar_url":"https://github.com/wangdahoo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# zui\n\nA UI Framework for H5 Single Page App\n\n[Demo](http://zui.wangdahoo.com/examples/intro/index.html)\n\n## API v1.0.0\n\n### Engine\n\n##### create an engine\n- Use this method to create global app instance, who is responsible for routes in a Single Page Application.\n\n```\n  var app = zui.Engine();\n  app.init({                          // init engine with a routes map\n      routes: {                       // { [String routeName]:  [zui.Page page], ... }\n          master: masterPage,\n          detail: detailPage,\n      },\n      defaultRoute: 'master'\n  });\n```\n  \n##### route navigation\n\n```\napp.navigate('master');             // navigate to a page by route 'master'.\napp.navigate('master', {            // navigate to a page with routeName \u0026 routeParams\n  id: 123,\n  message: 'Come back!'\n});\napp.navigate('master', {            // navigate to a page with routeName, routeParams \u0026 transition.\n    id: 123,\n    msg: 'May I have a cigarette?'\n}, 'back');\n```\n\n#### start() \u0026 back()\n\n```\napp.start();                        // call navigate() with the defaultRoute.\napp.back();                         // navigate to the last page by history.\n```\n\n#### timer operation\n\n```\nvar count = 0;\nvar tid = setInterval(function() {\n  console.log(count++);\n}, 1000);\napp.addTimer(tid);                  // mark down a timer id, and the timer will be eliminated automatically\n                                    // when you call navigate() to next page.\napp.deleteTimer(tid);               // eliminate a timer you marked down.\napp.clearTimers();                  // eliminate all timers you marked down.\n```\n\n\n### Page\n- Use this method to create a Page View.\n  \n```\nvar myPage = zui.Page({\n    title: 'Hey Jude',              // title on page's navigation bar\n    \n    backButton: function() {        // click callback for a back button, optional. leave the option undefined if you don't need a back button on the navigation bar.\n      // do your magic here.\n    },\n    \n    template: $('#tpl-homepage'),   // a underscore template for page content rendering.\n    \n    model: {                        // data model for template.\n      author: 'The Beatles',\n      year: '1968',\n      style: 'Rock, Pop'\n    },\n    \n    ready: function () {            // a callback who execute immediately after page rendering.\n      // do your magic here.\n    }\n})\n```\n     ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwangdahoo%2Fzui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwangdahoo%2Fzui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwangdahoo%2Fzui/lists"}