mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-11-03 21:16:26 +01:00 
			
		
		
		
	Allow emoji on popup label (#10166)
* allow emoji on popup label * Make emojify work * Remove unnecessary class Co-Authored-By: silverwind <me@silverwind.io> Co-authored-by: silverwind <me@silverwind.io>
This commit is contained in:
		
							parent
							
								
									632df9b996
								
							
						
					
					
						commit
						7d8a2d05cf
					
				@ -20,6 +20,7 @@ function issuePopup(suburl, owner, repo, index, $element) {
 | 
				
			|||||||
    let labels = '';
 | 
					    let labels = '';
 | 
				
			||||||
    for (let i = 0; i < issue.labels.length; i++) {
 | 
					    for (let i = 0; i < issue.labels.length; i++) {
 | 
				
			||||||
      const label = issue.labels[i];
 | 
					      const label = issue.labels[i];
 | 
				
			||||||
 | 
					      const labelName = emojify.replace(label.name);
 | 
				
			||||||
      const red = parseInt(label.color.substring(0, 2), 16);
 | 
					      const red = parseInt(label.color.substring(0, 2), 16);
 | 
				
			||||||
      const green = parseInt(label.color.substring(2, 4), 16);
 | 
					      const green = parseInt(label.color.substring(2, 4), 16);
 | 
				
			||||||
      const blue = parseInt(label.color.substring(4, 6), 16);
 | 
					      const blue = parseInt(label.color.substring(4, 6), 16);
 | 
				
			||||||
@ -27,7 +28,7 @@ function issuePopup(suburl, owner, repo, index, $element) {
 | 
				
			|||||||
      if ((red * 0.299 + green * 0.587 + blue * 0.114) > 125) {
 | 
					      if ((red * 0.299 + green * 0.587 + blue * 0.114) > 125) {
 | 
				
			||||||
        color = '#000000';
 | 
					        color = '#000000';
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
      labels += `<div class="ui label" style="color: ${color}; background-color:#${label.color};">${label.name}</div>`;
 | 
					      labels += `<div class="ui label" style="color: ${color}; background-color:#${label.color};">${labelName}</div>`;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    if (labels.length > 0) {
 | 
					    if (labels.length > 0) {
 | 
				
			||||||
      labels = `<p>${labels}</p>`;
 | 
					      labels = `<p>${labels}</p>`;
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user