Bookmark groups added to top of list (#263)
* Bookmark groups added to top of list * changelog
This commit is contained in:
1 parent
9df1b70e49
commit
dc148a7c59
2 files changed
+14
-5
No files matched your search
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Changed
|
||||
|
||||
- Bookmarks are now added to the top of the list
|
||||
|
||||
## [0.19.0] - 2024-01-10
|
||||
|
||||
### Added
|
||||
|
||||
@@ -29,12 +29,15 @@ function Load() as void
|
||||
return
|
||||
end if
|
||||
|
||||
for each bookmarkGroup in bookmarks.groups
|
||||
groupCount = bookmarks.groups.Count()
|
||||
' GetOrCreateBookmarkGroup inserts at the beginning of the list, so we need to iterate backwards
|
||||
for i = groupCount - 1 to 0 step -1
|
||||
bookmarkGroup = bookmarks.groups[i]
|
||||
bookmarkGroupNode = GetOrCreateBookmarkGroup(bookmarkGroup.title)
|
||||
bookmarksCount = bookmarkGroup.bookmarks.Count()
|
||||
' AddFeedSourceBookmark inserts at the beginning of the list, so we need to iterate backwards
|
||||
for i = bookmarksCount - 1 to 0 step -1
|
||||
bookmark = bookmarkGroup.bookmarks[i]
|
||||
' AddFeedSourceBookmark also inserts at the beginning of the list, so we need to iterate backwards
|
||||
for j = bookmarksCount - 1 to 0 step -1
|
||||
bookmark = bookmarkGroup.bookmarks[j]
|
||||
AddFeedSourceBookmark(bookmark.feedSource, bookmark.id, bookmarkGroupNode)
|
||||
end for
|
||||
end for
|
||||
@@ -85,7 +88,7 @@ function GetOrCreateBookmarkGroup(groupName as string) as object
|
||||
node = CreateObject("roSGNode", "ContentNode")
|
||||
node.id = id
|
||||
node.title = groupName
|
||||
m.top.content.appendChild(node)
|
||||
m.top.content.insertChild(node, 0)
|
||||
LogInfo("Added bookmark group:", groupName)
|
||||
return node
|
||||
end function
|
||||
|
||||
Reference in new issue
Block a user