Multiple profiles (#312)
* Navbar user profile * profiles stuff * fix profile * Lint fix * Some ui experiments * More ui work * progress * Lint fix * migration, web api, wip * profile view and web app * web app and apis * Invidious and profiles * Lint fix * bug fix * Remove ActionContentNode * Profile icon button, profile color * Lint fix * reset server url * href that doesn't work * remove activate button on active profile * TODO * Fin. * Final touches --------- Co-authored-by: github-action linter <githubaction@githubaction.com>
This commit is contained in:
1 parent
8e03ca0ea6
commit
394dd23999
60 files changed
+1725
-311
No files matched your search
@@ -14,6 +14,18 @@ namespace ArrayUtils
|
||||
return -1
|
||||
end function
|
||||
|
||||
function IndexOfNode(array as object, value as dynamic) as integer
|
||||
if not IsNode(value)
|
||||
return -1
|
||||
end if
|
||||
for i = 0 to array.Count() - 1
|
||||
if value.isSameNode(array[i])
|
||||
return i
|
||||
end if
|
||||
end for
|
||||
return -1
|
||||
end function
|
||||
|
||||
function Insert(array as object, value as dynamic, index as integer) as void
|
||||
if index = 0
|
||||
array.Unshift(value)
|
||||
|
||||
@@ -7,25 +7,16 @@ namespace ColorUtils
|
||||
color = color.mid(1)
|
||||
end if
|
||||
|
||||
value = Val(color.mid(0, 2), 16) * 16777216 + Val(color.mid(2, 2), 16) * 65536 + Val(color.mid(4, 2), 16) * 256
|
||||
if color.Len() = 6
|
||||
value += 255
|
||||
else if color.Len() = 8
|
||||
value += Val(color.mid(6, 2), 16)
|
||||
end if
|
||||
|
||||
return value
|
||||
return Val(color, 16)
|
||||
end function
|
||||
|
||||
function IntToHex(color as integer) as string
|
||||
hexDigits = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"]
|
||||
hexString = "#"
|
||||
|
||||
for i = 7 to 0 step -1
|
||||
hexString = hexString + hexDigits[(color >> (i * 4)) and &hF]
|
||||
hex = UCase(StrI(color, 16))
|
||||
length = Len(hex)
|
||||
for i = 0 to 7 - length
|
||||
hex = "0" + hex
|
||||
end for
|
||||
|
||||
return hexString
|
||||
return "#" + hex
|
||||
end function
|
||||
|
||||
function RgbaToInt(r as integer, g as integer, b as integer, a = 255 as integer) as integer
|
||||
@@ -40,4 +31,8 @@ namespace ColorUtils
|
||||
return RgbaToInt(Rnd(100) + 100, Rnd(100) + 100, Rnd(100) + 100)
|
||||
end function
|
||||
|
||||
function RandomSoftColorHex() as string
|
||||
return IntToHex(RandomSoftColorInt())
|
||||
end function
|
||||
|
||||
end namespace
|
||||
@@ -6,10 +6,10 @@ namespace Tests
|
||||
@describe("ColorUtils")
|
||||
|
||||
@it("Converts from hex to int")
|
||||
@params("#00d400B3", 13893811)
|
||||
@params("#ffff00B3", -65357)
|
||||
@params("#008a5cB3", 9067699)
|
||||
@params("#cc00ffB3", -872349773)
|
||||
@params("#00D400B3", 13893811)
|
||||
@params("#FFFF00B3", -65357)
|
||||
@params("#008A5CB3", 9067699)
|
||||
@params("#CC00FFB3", -872349773)
|
||||
function _(hexColor as string, expectedInt as integer)
|
||||
m.assertEqual(ColorUtils.HexToInt(hexColor), expectedInt)
|
||||
end function
|
||||
|
||||
@@ -3,17 +3,18 @@ namespace RegistryUtils
|
||||
const DEFAULT_SECTION = "Playlet"
|
||||
|
||||
const USER_PREFERENCES = "user_prefs"
|
||||
const USER_PROFILES = "user_profiles"
|
||||
|
||||
const SEARCH_HISTORY = "search_history"
|
||||
const PLAYLET_LIB_URLS = "playlet_lib_urls"
|
||||
const BOOKMARKS = "bookmarks"
|
||||
|
||||
const INVIDIOUS_TOKEN = "invidious_token"
|
||||
|
||||
const LAST_LOUNGE_DATA = "last_lounge_data"
|
||||
|
||||
' "invidious_instances" is deprecated, but we keep for migration purposes
|
||||
const INVIDIOUS_INSTANCES = "invidious_instances"
|
||||
' "invidious_token" is deprecated, but we keep for migration purposes
|
||||
const INVIDIOUS_TOKEN = "invidious_token"
|
||||
|
||||
function Read(key as string, sectionName = DEFAULT_SECTION as string) as dynamic
|
||||
section = CreateObject("roRegistrySection", sectionName)
|
||||
|
||||
Reference in new issue
Block a user