{"action":"created","issue":{"url":"https://api.github.com/repos/atesh/XKit/issues/173","labels_url":"https://api.github.com/repos/atesh/XKit/issues/173/labels{/name}","comments_url":"https://api.github.com/repos/atesh/XKit/issues/173/comments","events_url":"https://api.github.com/repos/atesh/XKit/issues/173/events","html_url":"https://github.com/atesh/XKit/issues/173","id":45770761,"number":173,"title":"Rewriting the Framework / Extensions? (\"XKit 8\")","user":{"login":"atesh","id":229667,"avatar_url":"https://avatars.githubusercontent.com/u/229667?v=3","gravatar_id":"","url":"https://api.github.com/users/atesh","html_url":"https://github.com/atesh","followers_url":"https://api.github.com/users/atesh/followers","following_url":"https://api.github.com/users/atesh/following{/other_user}","gists_url":"https://api.github.com/users/atesh/gists{/gist_id}","starred_url":"https://api.github.com/users/atesh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atesh/subscriptions","organizations_url":"https://api.github.com/users/atesh/orgs","repos_url":"https://api.github.com/users/atesh/repos","events_url":"https://api.github.com/users/atesh/events{/privacy}","received_events_url":"https://api.github.com/users/atesh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":28,"created_at":"2014-10-14T16:26:57Z","updated_at":"2015-04-27T12:50:31Z","closed_at":null,"body":"This is something I've been meaning to do for a long time, and I think we can start working on this since there is a lot of activity on Github now.\r\n\r\nThe thing is, XKit 7 framework was written over a year ago, and I have to write code very fast to make sure they work as soon as something is changed, and since Tumblr likes to change stuff a lot, it causes me to write messy/uncommented code (as well as code that is in the extension but never used).\r\n\r\nPlus things like [Interface](https://github.com/atesh/XKit/wiki/XKit.interface) was not even available at start, so there are a lot of code not using it.\r\n\r\n**What I have in mind, and I would like everyone's opinion on this, is:**\r\n* A new API, with an enhanced [Interface](https://github.com/atesh/XKit/wiki/XKit.interface).\r\n* A \"compatibility layer\" so old extensions would still work while we re-write them (there are 70+ extensions, so this might take a while..)\r\n* Rewritten XKit.js, xkit_preferences and browser bridges.\r\n* I, and others as far as I know, only use JQuery for DOM manipulations and nothing else (no animations, AJAX calls, etc) - perhaps a little lightweight DOM selector to take it's place?\r\n* Something like the (now-defunct) XKit Packs, so people can contribute faster.\r\n\r\nThere are a lot of things about the API I really don't like. For example, you have to write HTML code to add buttons to a window and there is no \"window\" object returned so you can make changes later. \r\n\r\nThe API in the current state makes it really hard to write code, and the Bridges went through several versions over the year, and needs a cleanup, fast.\r\n\r\nThis is, of course, a huge project, so I would like everyone's opinion first. \r\nPlease let me know what you think. Thank you.\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/atesh/XKit/issues/comments/96638697","html_url":"https://github.com/atesh/XKit/issues/173#issuecomment-96638697","issue_url":"https://api.github.com/repos/atesh/XKit/issues/173","id":96638697,"user":{"login":"WyohKnott","id":6247191,"avatar_url":"https://avatars.githubusercontent.com/u/6247191?v=3","gravatar_id":"","url":"https://api.github.com/users/WyohKnott","html_url":"https://github.com/WyohKnott","followers_url":"https://api.github.com/users/WyohKnott/followers","following_url":"https://api.github.com/users/WyohKnott/following{/other_user}","gists_url":"https://api.github.com/users/WyohKnott/gists{/gist_id}","starred_url":"https://api.github.com/users/WyohKnott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WyohKnott/subscriptions","organizations_url":"https://api.github.com/users/WyohKnott/orgs","repos_url":"https://api.github.com/users/WyohKnott/repos","events_url":"https://api.github.com/users/WyohKnott/events{/privacy}","received_events_url":"https://api.github.com/users/WyohKnott/received_events","type":"User","site_admin":false},"created_at":"2015-04-27T12:50:31Z","updated_at":"2015-04-27T12:50:31Z","body":"@0xazure I was thinking of a callback system under my shower this morning, but I've just seen you already thought about it with EventEmitter.\r\n\r\nCheck out http://mozilla.github.io/localForage/ for data storage. Currently XKit relies on HTML5 storage but this API can use IndexedDB and supports ECMA6 Promise (and is node-compatible).\r\n\r\nI was also thinking of supporting multiple account at the same time:\r\n - Primary account\r\n    - sideblog 1 \r\n    - sideblog 2\r\n - Another Account\r\n   - sideblog 1\r\n   - sideblog 2\r\n\r\nMost extensions would only need to set their settings under the main account, but some others would have some kind of \"settings per sideblog\" flag, to store differents parameters. For example, an extension like Autotagger would be able to append some specific tags if the user reblog to their sideblog or their mainblog.\r\n\r\nOf course, the account name is not stable, some users have the annoying habit to change often so we can't rely on that to store parameters. Instead we would need to use the shorturl version of it, which never changes. There is no \"standard API\" function to do that (despite my vain requests) but we can get it like this:\r\n```javascript\r\njQuery.get(\"https://www.tumblr.com/svc/indash_blog/posts\", {\r\n    tumblelog_name_or_id: \"staff\",\r\n    limit: \"1\",\r\n    offset: \"0\"\r\n},  function(data) {\r\n    console.info(data.response.posts[0].share_popover_data.embed_key);\r\n});\r\n```\r\nIt returns the unique ID of the blog: for example \"staff\" is \"r_BTLFg8QzTPUMVSbe3vbg\".\r\nYou can find the account name from the ID by resolving the short URL: https://tumblr.com/M + ID\r\nFor example: https://tumblr.com/Mr_BTLFg8QzTPUMVSbe3vbg\r\n"}}