{"action":"created","issue":{"url":"https://api.github.com/repos/ExchangeCore/Concrete5-CKEditor/issues/30","labels_url":"https://api.github.com/repos/ExchangeCore/Concrete5-CKEditor/issues/30/labels{/name}","comments_url":"https://api.github.com/repos/ExchangeCore/Concrete5-CKEditor/issues/30/comments","events_url":"https://api.github.com/repos/ExchangeCore/Concrete5-CKEditor/issues/30/events","html_url":"https://github.com/ExchangeCore/Concrete5-CKEditor/issues/30","id":118068548,"number":30,"title":"Create a way to add Styles","user":{"login":"joe-meyer","id":1292766,"avatar_url":"https://avatars.githubusercontent.com/u/1292766?v=3","gravatar_id":"","url":"https://api.github.com/users/joe-meyer","html_url":"https://github.com/joe-meyer","followers_url":"https://api.github.com/users/joe-meyer/followers","following_url":"https://api.github.com/users/joe-meyer/following{/other_user}","gists_url":"https://api.github.com/users/joe-meyer/gists{/gist_id}","starred_url":"https://api.github.com/users/joe-meyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joe-meyer/subscriptions","organizations_url":"https://api.github.com/users/joe-meyer/orgs","repos_url":"https://api.github.com/users/joe-meyer/repos","events_url":"https://api.github.com/users/joe-meyer/events{/privacy}","received_events_url":"https://api.github.com/users/joe-meyer/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ExchangeCore/Concrete5-CKEditor/labels/priority-medium","name":"priority-medium","color":"fbca04"},{"url":"https://api.github.com/repos/ExchangeCore/Concrete5-CKEditor/labels/type-discussion","name":"type-discussion","color":"d4c5f9"},{"url":"https://api.github.com/repos/ExchangeCore/Concrete5-CKEditor/labels/type-enhancement","name":"type-enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-11-20T15:51:55Z","updated_at":"2015-12-16T07:18:05Z","closed_at":null,"body":"We should create a way (Either via dashboard page, or via plugin) to easily add additional [styles](http://docs.ckeditor.com/#!/guide/dev_howtos_styles) to the editor. \r\n\r\nSome possible Options:\r\n\r\n## A dashboard page\r\n\r\nWe would probably want this to be user friendly, maybe we could leverage the same kinds of tools that are available for the theme customizer to build out JSON strings to inject into the list of styles.\r\n\r\nThis has the benefits of being modifyable via a user interface so semi-technical people can create their own styles, it also has the advantage of allowing us to load up all the styles when the editor is loaded.\r\n\r\n## A PHP API that developers could create concrete5 packages and add to\r\n\r\nThis one is going to be kind of a pain to do but one could possibly do something like this:\r\n```\r\n$editor = Core::make('editor);\r\nif ($editor instanceof CKEditor) {\r\n    $editor->addStyle(array(\r\n        'name' => t('Responsive Image');\r\n        'element' => 'span',\r\n        'attributes' => array('class' => 'img-responsive'),\r\n    ));\r\n}\r\n```\r\n\r\nThis has the benefit of us still being able to load all the styles at the start of ckeditor, and it provides a super easy way for someone to create a concrete5 package that adds styles to the editor without additional ckeditor plugin registrations / file loading / editor plugin implementation. \r\n\r\n## Force developers to implement their own plugins\r\n\r\nThis is the current option, we do nothing and developers need to register their own ckeditor plugins that add styles (similar to how we're doing it in our concrete5magic plugin that's in the works). This has the benefit of us never having to touch it, but the major drawback is that every plugin that gets added is going to be 2 more network requests (maybe not a big deal with caching and such?). Regardless if we implement something for the other 2, this will always be an option for developers (so long as ckeditor allows us to inject styles after load)."},"comment":{"url":"https://api.github.com/repos/ExchangeCore/Concrete5-CKEditor/issues/comments/165020693","html_url":"https://github.com/ExchangeCore/Concrete5-CKEditor/issues/30#issuecomment-165020693","issue_url":"https://api.github.com/repos/ExchangeCore/Concrete5-CKEditor/issues/30","id":165020693,"user":{"login":"MrKarlDilkington","id":10898145,"avatar_url":"https://avatars.githubusercontent.com/u/10898145?v=3","gravatar_id":"","url":"https://api.github.com/users/MrKarlDilkington","html_url":"https://github.com/MrKarlDilkington","followers_url":"https://api.github.com/users/MrKarlDilkington/followers","following_url":"https://api.github.com/users/MrKarlDilkington/following{/other_user}","gists_url":"https://api.github.com/users/MrKarlDilkington/gists{/gist_id}","starred_url":"https://api.github.com/users/MrKarlDilkington/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MrKarlDilkington/subscriptions","organizations_url":"https://api.github.com/users/MrKarlDilkington/orgs","repos_url":"https://api.github.com/users/MrKarlDilkington/repos","events_url":"https://api.github.com/users/MrKarlDilkington/events{/privacy}","received_events_url":"https://api.github.com/users/MrKarlDilkington/received_events","type":"User","site_admin":false},"created_at":"2015-12-16T07:18:05Z","updated_at":"2015-12-16T07:18:05Z","body":"I tested the latest magicstyles branch with the dedicated CKEditor Styles page. Adding styles this way worked as expected and gets the job done.\r\n\r\nFor an initial release, I think a basic textarea for input is sufficient."}}