mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	Add the checkbox quick button to the comment tool bar also (#12885)
Just copy it from the WIKI tool bar :) Signed-off-by: a1012112796 <1012112796@qq.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: zeripath <art27@cantab.net>
This commit is contained in:
		@@ -1484,7 +1484,26 @@ function setCommentSimpleMDE($editArea) {
 | 
				
			|||||||
    spellChecker: false,
 | 
					    spellChecker: false,
 | 
				
			||||||
    toolbar: ['bold', 'italic', 'strikethrough', '|',
 | 
					    toolbar: ['bold', 'italic', 'strikethrough', '|',
 | 
				
			||||||
      'heading-1', 'heading-2', 'heading-3', 'heading-bigger', 'heading-smaller', '|',
 | 
					      'heading-1', 'heading-2', 'heading-3', 'heading-bigger', 'heading-smaller', '|',
 | 
				
			||||||
      'code', 'quote', '|',
 | 
					      'code', 'quote', '|', {
 | 
				
			||||||
 | 
					        name: 'checkbox-empty',
 | 
				
			||||||
 | 
					        action(e) {
 | 
				
			||||||
 | 
					          const cm = e.codemirror;
 | 
				
			||||||
 | 
					          cm.replaceSelection(`\n- [ ] ${cm.getSelection()}`);
 | 
				
			||||||
 | 
					          cm.focus();
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        className: 'fa fa-square-o',
 | 
				
			||||||
 | 
					        title: 'Add Checkbox (empty)',
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					      {
 | 
				
			||||||
 | 
					        name: 'checkbox-checked',
 | 
				
			||||||
 | 
					        action(e) {
 | 
				
			||||||
 | 
					          const cm = e.codemirror;
 | 
				
			||||||
 | 
					          cm.replaceSelection(`\n- [x] ${cm.getSelection()}`);
 | 
				
			||||||
 | 
					          cm.focus();
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        className: 'fa fa-check-square-o',
 | 
				
			||||||
 | 
					        title: 'Add Checkbox (checked)',
 | 
				
			||||||
 | 
					      }, '|',
 | 
				
			||||||
      'unordered-list', 'ordered-list', '|',
 | 
					      'unordered-list', 'ordered-list', '|',
 | 
				
			||||||
      'link', 'image', 'table', 'horizontal-rule', '|',
 | 
					      'link', 'image', 'table', 'horizontal-rule', '|',
 | 
				
			||||||
      'clean-block', '|',
 | 
					      'clean-block', '|',
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user