{"action":"created","issue":{"url":"https://api.github.com/repos/basiljs/basil.js/issues/110","repository_url":"https://api.github.com/repos/basiljs/basil.js","labels_url":"https://api.github.com/repos/basiljs/basil.js/issues/110/labels{/name}","comments_url":"https://api.github.com/repos/basiljs/basil.js/issues/110/comments","events_url":"https://api.github.com/repos/basiljs/basil.js/issues/110/events","html_url":"https://github.com/basiljs/basil.js/issues/110","id":184725158,"number":110,"title":"Expanding functionality of styles in basil.js","user":{"login":"trych","id":9803905,"avatar_url":"https://avatars.githubusercontent.com/u/9803905?v=3","gravatar_id":"","url":"https://api.github.com/users/trych","html_url":"https://github.com/trych","followers_url":"https://api.github.com/users/trych/followers","following_url":"https://api.github.com/users/trych/following{/other_user}","gists_url":"https://api.github.com/users/trych/gists{/gist_id}","starred_url":"https://api.github.com/users/trych/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trych/subscriptions","organizations_url":"https://api.github.com/users/trych/orgs","repos_url":"https://api.github.com/users/trych/repos","events_url":"https://api.github.com/users/trych/events{/privacy}","received_events_url":"https://api.github.com/users/trych/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/basiljs/basil.js/labels/decision%20needed","name":"decision needed","color":"e99695"},{"url":"https://api.github.com/repos/basiljs/basil.js/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/basiljs/basil.js/labels/feature%20request","name":"feature request","color":"c2e0c6"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-23T23:54:17Z","updated_at":"2016-10-25T10:44:23Z","closed_at":null,"body":"At the moment working with (character-, paragraph- etc.) styles in basil.js is supported rather rudimentarily. As it is such an essential part of working in InDesign, I think the current implementation could be improved.\r\n\r\nI think basil.js should offer the following functionality:\r\n\r\n* get the applied style of a given text object\r\n* apply a given style to a given text object or text frame\r\n* create a new style from a given text object\r\n\r\nI was giving this some thought and I think to keep it clean the tasks should be split up in three different methods (scope in this case stands for `character|paragraph|object`):\r\n\r\n* `b.[scope]Style(name|object)`: remains the getter, gets a style by name or the applied style of a given object.\r\n* `b.apply[Scope]Style(style, textObject|textFrame|object)`: applies a given style to a textObject or textFrame\r\n* `b.create[Scope]Style(textObject|object, name): creates a new style from the given object\r\n\r\nAny thoughts?"},"comment":{"url":"https://api.github.com/repos/basiljs/basil.js/issues/comments/256001062","html_url":"https://github.com/basiljs/basil.js/issues/110#issuecomment-256001062","issue_url":"https://api.github.com/repos/basiljs/basil.js/issues/110","id":256001062,"user":{"login":"b-g","id":480224,"avatar_url":"https://avatars.githubusercontent.com/u/480224?v=3","gravatar_id":"","url":"https://api.github.com/users/b-g","html_url":"https://github.com/b-g","followers_url":"https://api.github.com/users/b-g/followers","following_url":"https://api.github.com/users/b-g/following{/other_user}","gists_url":"https://api.github.com/users/b-g/gists{/gist_id}","starred_url":"https://api.github.com/users/b-g/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/b-g/subscriptions","organizations_url":"https://api.github.com/users/b-g/orgs","repos_url":"https://api.github.com/users/b-g/repos","events_url":"https://api.github.com/users/b-g/events{/privacy}","received_events_url":"https://api.github.com/users/b-g/received_events","type":"User","site_admin":false},"created_at":"2016-10-25T10:44:23Z","updated_at":"2016-10-25T10:44:23Z","body":"So far the \"basil paradigm\" is to create alwasy the thing if it isn't there e.g. color(), layer() etc. hence I don't think introducing `b.createXXX` is a good a idea. Hence what about:\r\n\r\n* `b.[scope]Style(name|object)`: remains the getter, gets a style by name or the applied style of a given object. **If the style isn't there, basil automatically creates one.**\r\n* `b.apply[Scope]Style(style, textObject|textFrame|object)`: applies a given style to a textObject or textFrame"}}
{"actor":{"display_login":"b-g"}}