GitHub PullRequestReviewCommentEvent at 2014-02-19 16:00:53
Repository: Aloha-Editor
Actor: petro065
Payload: {"comment":{"url":"https://api.github.com/repos/alohaeditor/Aloha-Editor/pulls/comments/9869953","id":9869953,"diff_hunk":"@@ -103,12 +126,113 @@ define([\n \t\t/**\n \t\t * default button configuration\n \t\t */\n-\t\tconfig: [ 'ul', 'ol' ],\n+\t\tconfig: [ 'ul', 'ol', 'dl' ],\n \n \t\t/**\n \t\t * List of transformable elements\n \t\t */\n-\t\ttransformableElements: {'p' : true, 'h1' : true, 'h2' : true, 'h3' : true, 'h4' : true, 'h5' : true, 'h6' : true, 'ul' : true, 'ol' : true},\n+\t\ttransformableElements: {'p' : true, 'h1' : true, 'h2' : true, 'h3' : true, 'h4' : true, 'h5' : true, 'h6' : true, 'ul' : true, 'ol' : true, 'dl': true},\n+\n+\t\t/**\n+\t\t* Default list styles\n+\t\t*/\n+\t\ttemplates: {\n+\t\t\tul: {\n+\t\t\t\tclasses: ['aloha-list-disc', 'aloha-list-circle', 'aloha-list-square'],\n+\t\t\t\ttemplate: '<ul class=\"${cssClass}\"><li>${first}<ul class=\"${cssClass}\"><li>${second}<ul class=\"${cssClass}\"><li>${third}</li></ul></li></ul></li></ul>',\n+\t\t\t\tlocale: {\n+\t\t\t\t\tdefault: {first: 'first layer', second: 'second layer', third: 'third layer'},\n+\t\t\t\t\tde: {first: 'erste Ebene', second: 'zweite Ebene', third: 'dritte Ebene'}\n+\t\t\t\t}\n+\t\t\t},\n+\t\t\tol: {\n+\t\t\t\tclasses: ['aloha-list-decimal', 'aloha-list-decimal-leading-zero',\n+\t\t\t\t\t'aloha-list-lower-roman', 'aloha-list-upper-roman', 'aloha-list-lower-greek',\n+\t\t\t\t\t'aloha-list-lower-latin', 'aloha-list-upper-latin' ],\n+\t\t\t\ttemplate: '<ol class=\"${cssClass}\"><li>${first}<ol class=\"${cssClass}\"><li>${second}<ol class=\"${cssClass}\"><li>${third}</li></ol></li></ol></li></ol>',\n+\t\t\t\tlocale: {\n+\t\t\t\t\tdefault: {first: 'first layer', second: 'second layer', third: 'third layer'},\n+\t\t\t\t\tde: {first: 'erste Ebene', second: 'zweite Ebene', third: 'dritte Ebene'}\n+\t\t\t\t}\n+\t\t\t},\n+\t\t\tdl: {\n+\t\t\t\tclasses: ['aloha-list-blue', 'aloha-list-green', 'aloha-list-red'],\n+\t\t\t\ttemplate: '<dl class=\"${cssClass}\"><dt>${first}<dt><dd>${second}</dd></dl>',\n+\t\t\t\tlocale: {\n+\t\t\t\t\tdefault: {first: 'first item', second: 'second item'},\n+\t\t\t\t\tde: {first: 'erstes Element', second: 'zweites Element'}\n+\t\t\t\t}\n+\t\t\t},\n+\t\t},\n+\n+\t\t/**\n+\t\t * Toggle selected CSS class on current list elemnet\n+\t\t * @param String listtype: ol, ul or dl\n+\t\t * @param String style: selected CSS class\n+\t\t * @return void\n+\t\t */\n+\t\ttoggleListStyle: function(listtype, style) {\n+\t\t\tvar domObject = this.getStartingDomObjectToTransform();\n+\t\t\tvar nodeName = domObject.nodeName.toLowerCase();\n+\t\t\tvar listToStyle =  jQuery(domObject);\n+\t\t\tvar remove = false;\n+\n+\t\t\tif (nodeName !== 'ul' && nodeName !== 'ol' && nodeName !== 'dl') {\n+\t\t\t\t// we don't have a list yet, so transform selection to list\n+\t\t\t\tthis.transformList(listtype);\n+\t\t\t\tdomObject = this.getStartingDomObjectToTransform();","path":"src/plugins/common/list/lib/list-plugin.js","position":128,"original_position":128,"commit_id":"be4f3169bbfd8d22856c6f22bab29646e8d7ad06","original_commit_id":"be4f3169bbfd8d22856c6f22bab29646e8d7ad06","user":{"login":"petro065","id":595384,"avatar_url":"https://gravatar.com/avatar/2087327e79d09b56ce8572e6f363abff?d=https%3A%2F%2Fidenticons.github.com%2F9cc9cc0a2525be2c0cf725b8ba3c3651.png&r=x","gravatar_id":"2087327e79d09b56ce8572e6f363abff","url":"https://api.github.com/users/petro065","html_url":"https://github.com/petro065","followers_url":"https://api.github.com/users/petro065/followers","following_url":"https://api.github.com/users/petro065/following{/other_user}","gists_url":"https://api.github.com/users/petro065/gists{/gist_id}","starred_url":"https://api.github.com/users/petro065/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petro065/subscriptions","organizations_url":"https://api.github.com/users/petro065/orgs","repos_url":"https://api.github.com/users/petro065/repos","events_url":"https://api.github.com/users/petro065/events{/privacy}","received_events_url":"https://api.github.com/users/petro065/received_events","type":"User","site_admin":false},"body":"I see that this.transformList() may have changed state.","created_at":"2014-02-19T16:00:53Z","updated_at":"2014-02-19T16:00:53Z","html_url":"https://github.com/alohaeditor/Aloha-Editor/pull/1089#discussion_r9869953","pull_request_url":"https://api.github.com/repos/alohaeditor/Aloha-Editor/pulls/1089","_links":{"self":{"href":"https://api.github.com/repos/alohaeditor/Aloha-Editor/pulls/comments/9869953"},"html":{"href":"https://github.com/alohaeditor/Aloha-Editor/pull/1089#discussion_r9869953"},"pull_request":{"href":"https://api.github.com/repos/alohaeditor/Aloha-Editor/pulls/1089"}}}}