{"action":"created","issue":{"url":"https://api.github.com/repos/karai17/DOMinatrix/issues/8","labels_url":"https://api.github.com/repos/karai17/DOMinatrix/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/karai17/DOMinatrix/issues/8/comments","events_url":"https://api.github.com/repos/karai17/DOMinatrix/issues/8/events","html_url":"https://github.com/karai17/DOMinatrix/issues/8","id":54021268,"number":8,"title":"Some thoughts on the Script API","user":{"login":"karai17","id":590332,"avatar_url":"https://avatars.githubusercontent.com/u/590332?v=3","gravatar_id":"","url":"https://api.github.com/users/karai17","html_url":"https://github.com/karai17","followers_url":"https://api.github.com/users/karai17/followers","following_url":"https://api.github.com/users/karai17/following{/other_user}","gists_url":"https://api.github.com/users/karai17/gists{/gist_id}","starred_url":"https://api.github.com/users/karai17/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karai17/subscriptions","organizations_url":"https://api.github.com/users/karai17/orgs","repos_url":"https://api.github.com/users/karai17/repos","events_url":"https://api.github.com/users/karai17/events{/privacy}","received_events_url":"https://api.github.com/users/karai17/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/karai17/DOMinatrix/labels/input+wanted","name":"input wanted","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-01-12T05:12:33Z","updated_at":"2015-01-12T06:13:46Z","closed_at":null,"body":"The Script API should vaguely resemble jQuery (but be less convoluted). Each object should have:\r\n\r\n* an id\r\n* a parent\r\n* a list of siblings\r\n* a list of children\r\n* a list of properties\r\n* a list of classes\r\n* a set of event callbacks\r\n\r\nAnd probably other stuff, too.\r\n\r\nThe lists of siblings and children should be indexed arrays (you can loop through them via ipairs).\r\n\r\nThe parent, siblings, and children should be pointers to other objects.\r\n\r\nThere should be helper functions in place despite Lua's ability to access data directly.\r\n\r\n```lua\r\nlocal child = object.children[3] -- object\r\nlocal other_child = object:get_child(3) -- object\r\n```\r\n\r\nCustomized properties (properties not set by the object default, id, or class associated to an object) should be held in a custom properties table so when an object needs to be rerendered (say, if it is resized), the programatically defined properties will persist.\r\n\r\nIf anyone else has ideas, feel free to throw them in here and we can discuss them."},"comment":{"url":"https://api.github.com/repos/karai17/DOMinatrix/issues/comments/69532831","html_url":"https://github.com/karai17/DOMinatrix/issues/8#issuecomment-69532831","issue_url":"https://api.github.com/repos/karai17/DOMinatrix/issues/8","id":69532831,"user":{"login":"karai17","id":590332,"avatar_url":"https://avatars.githubusercontent.com/u/590332?v=3","gravatar_id":"","url":"https://api.github.com/users/karai17","html_url":"https://github.com/karai17","followers_url":"https://api.github.com/users/karai17/followers","following_url":"https://api.github.com/users/karai17/following{/other_user}","gists_url":"https://api.github.com/users/karai17/gists{/gist_id}","starred_url":"https://api.github.com/users/karai17/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karai17/subscriptions","organizations_url":"https://api.github.com/users/karai17/orgs","repos_url":"https://api.github.com/users/karai17/repos","events_url":"https://api.github.com/users/karai17/events{/privacy}","received_events_url":"https://api.github.com/users/karai17/received_events","type":"User","site_admin":false},"created_at":"2015-01-12T06:13:46Z","updated_at":"2015-01-12T06:13:46Z","body":"You might be misunderstanding what, specifically, a UI element is. If you look at that picture above, we have a window frame. That window frame has a title (textbox), a search box (which contains an image and a textbox), and a tab list. that first tab contains an image and a textbox and two buttons, then it has a list object. that list object has several lists items and each item has several images, and so on and so forth.\r\n\r\nWhat might look like only 11 or 12 elements quickly becomes 60+ when looked at in finer detail."}}