2021-09-11 21:50:36 +00:00
|
|
|
import statusgo_backend/browser as status_browser
|
2021-09-08 18:05:39 +00:00
|
|
|
import ../eventemitter
|
|
|
|
|
|
|
|
import ./types/[bookmark]
|
|
|
|
|
|
|
|
type
|
|
|
|
BrowserModel* = ref object
|
|
|
|
events*: EventEmitter
|
|
|
|
|
|
|
|
proc newBrowserModel*(events: EventEmitter): BrowserModel =
|
|
|
|
result = BrowserModel()
|
|
|
|
result.events = events
|
|
|
|
|
|
|
|
proc storeBookmark*(self: BrowserModel, url: string, name: string): Bookmark =
|
|
|
|
result = status_browser.storeBookmark(url, name)
|
|
|
|
|
|
|
|
proc updateBookmark*(self: BrowserModel, ogUrl: string, url: string, name: string) =
|
|
|
|
status_browser.updateBookmark(ogUrl, url, name)
|
|
|
|
|
|
|
|
proc getBookmarks*(self: BrowserModel): string =
|
|
|
|
result = status_browser.getBookmarks()
|
|
|
|
|
|
|
|
proc deleteBookmark*(self: BrowserModel, url: string) =
|
|
|
|
status_browser.deleteBookmark(url)
|