mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 10:26:08 +01:00 
			
		
		
		
	added new label type URL with open button, fixes #156
This commit is contained in:
		| @@ -27,7 +27,8 @@ function AttributesModel() { | |||||||
|         { text: "Text", value: "text" }, |         { text: "Text", value: "text" }, | ||||||
|         { text: "Number", value: "number" }, |         { text: "Number", value: "number" }, | ||||||
|         { text: "Boolean", value: "boolean" }, |         { text: "Boolean", value: "boolean" }, | ||||||
|         { text: "Date", value: "date" } |         { text: "Date", value: "date" }, | ||||||
|  |         { text: "URL", value: "url"} | ||||||
|     ]; |     ]; | ||||||
|  |  | ||||||
|     this.multiplicityTypes = [ |     this.multiplicityTypes = [ | ||||||
|   | |||||||
| @@ -309,6 +309,15 @@ async function loadAttributes() { | |||||||
|  |  | ||||||
|                 $actionCell.append($todayButton); |                 $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 { |             else { | ||||||
|                 messagingService.logError("Unknown labelType=" + definitionAttr.labelType); |                 messagingService.logError("Unknown labelType=" + definitionAttr.labelType); | ||||||
|             } |             } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user