mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 02:16:05 +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: "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); | ||||
|             } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user