add edit and delete button
This commit is contained in:
		| @@ -164,7 +164,6 @@ input[type=range]:focus::-ms-fill-upper | ||||
| { | ||||
|     height: 25px; | ||||
|     background-color: #444; | ||||
|     overflow: hidden; | ||||
|     position: relative; | ||||
|     z-index: 1000; | ||||
| } | ||||
| @@ -177,18 +176,45 @@ input[type=range]:focus::-ms-fill-upper | ||||
|     padding: 2px 5px; | ||||
|     cursor: pointer; | ||||
|     white-space: nowrap; | ||||
|     max-height: 14px; | ||||
|     max-width: 50px; | ||||
|  | ||||
|     position: absolute; | ||||
|     bottom: 5px; | ||||
|     transform: translate(-50%, 0); | ||||
| } | ||||
|  | ||||
| #openwebrx-bookmarks-container .bookmark .bookmark-content { | ||||
|     overflow: hidden; | ||||
|     text-overflow: ellipsis; | ||||
| } | ||||
|  | ||||
| #openwebrx-bookmarks-container .bookmark .bookmark-actions { | ||||
|     display: none; | ||||
|     text-align: right; | ||||
| } | ||||
|  | ||||
| .bookmark-actions .action { | ||||
|     line-height: 0; | ||||
| } | ||||
|  | ||||
| .bookmark-actions .action img { | ||||
|     width: 14px; | ||||
| } | ||||
|  | ||||
| #openwebrx-bookmarks-container .bookmark.selected { | ||||
|     z-index: 1010; | ||||
| } | ||||
|  | ||||
| #openwebrx-bookmarks-container .bookmark:hover { | ||||
|     z-index: 1011; | ||||
|     max-height: none; | ||||
|     max-width: none; | ||||
| } | ||||
|  | ||||
| #openwebrx-bookmarks-container .bookmark[editable]:hover .bookmark-actions { | ||||
|     display: block; | ||||
|     margin-bottom: 5px; | ||||
| } | ||||
|  | ||||
| #openwebrx-bookmarks-container .bookmark:after { | ||||
|   | ||||
							
								
								
									
										
											BIN
										
									
								
								htdocs/gfx/openwebrx-edit.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								htdocs/gfx/openwebrx-edit.png
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 1.3 KiB | 
							
								
								
									
										
											BIN
										
									
								
								htdocs/gfx/openwebrx-trashcan.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								htdocs/gfx/openwebrx-trashcan.png
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 797 B | 
| @@ -1337,11 +1337,20 @@ function on_ws_recv(evt) | ||||
|     } | ||||
| } | ||||
|  | ||||
| function update_bookmarks(bookmarks, source) { | ||||
| function update_bookmarks(bookmarks, source, editable) { | ||||
|     editable = !!editable; | ||||
|     var $container = $('#openwebrx-bookmarks-container'); | ||||
|     $container.find('.bookmark[data-source=' + source + ']').remove(); | ||||
|     bookmarks.forEach(function(b){ | ||||
|         $bookmark = $('<div class="bookmark" data-source="' + source + '">' + b.name + '</div>'); | ||||
|         $bookmark = $( | ||||
|             '<div class="bookmark" data-source="' + source + '"' + (editable?' editable="editable"':'') + '>' + | ||||
|                 '<div class="bookmark-actions">' + | ||||
|                     '<div class="openwebrx-button action" data-action="edit"><img src="static/gfx/openwebrx-edit.png"></div>' + | ||||
|                     '<div class="openwebrx-button action" data-action="delete"><img src="static/gfx/openwebrx-trashcan.png"></div>' + | ||||
|                 '</div>' + | ||||
|                 '<div class="bookmark-content">' + b.name + '</div>' + | ||||
|             '</div>' | ||||
|         ); | ||||
|         $bookmark.data(b); | ||||
|         $container.append($bookmark); | ||||
|     }); | ||||
| @@ -1355,7 +1364,7 @@ function loadLocalBookmarks() { | ||||
|     var bookmarks = getLocalBookmarks().filter(function(b){ | ||||
|         return b.frequency >= start && b.frequency <= end; | ||||
|     }); | ||||
|     update_bookmarks(bookmarks, 'local'); | ||||
|     update_bookmarks(bookmarks, 'local', true); | ||||
| } | ||||
|  | ||||
| function position_bookmarks() { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Jakob Ketterl
					Jakob Ketterl