mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-04 13:39:01 +01:00 
			
		
		
		
	added new label type URL with open button, fixes #156
This commit is contained in:
		
							parent
							
								
									0aa08b1c1e
								
							
						
					
					
						commit
						44f85224e7
					
				@ -27,7 +27,8 @@ function AttributesModel() {
 | 
			
		||||
        { text: "Text", value: "text" },
 | 
			
		||||
        { text: "Number", value: "number" },
 | 
			
		||||
        { text: "Boolean", value: "boolean" },
 | 
			
		||||
        { text: "Date", value: "date" }
 | 
			
		||||
        { text: "Date", value: "date" },
 | 
			
		||||
        { text: "URL", value: "url"}
 | 
			
		||||
    ];
 | 
			
		||||
 | 
			
		||||
    this.multiplicityTypes = [
 | 
			
		||||
 | 
			
		||||
@ -309,6 +309,15 @@ async function loadAttributes() {
 | 
			
		||||
 | 
			
		||||
                $actionCell.append($todayButton);
 | 
			
		||||
            }
 | 
			
		||||
            else if (definition.labelType === 'url') {
 | 
			
		||||
                $input.prop("placeholder", "http://website...");
 | 
			
		||||
 | 
			
		||||
                const $openButton = $("<button>").addClass("btn btn-small").text("Open").click(() => {
 | 
			
		||||
                    window.open($input.val(), '_blank');
 | 
			
		||||
                });
 | 
			
		||||
 | 
			
		||||
                $actionCell.append($openButton);
 | 
			
		||||
            }
 | 
			
		||||
            else {
 | 
			
		||||
                messagingService.logError("Unknown labelType=" + definitionAttr.labelType);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user