mirror of
https://github.com/Insality/druid
synced 2025-11-26 10:50:54 +01:00
Up
This commit is contained in:
@@ -6,8 +6,8 @@ local b='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
|
|||||||
|
|
||||||
function M.encode(data)
|
function M.encode(data)
|
||||||
return ((data:gsub('.', function(x)
|
return ((data:gsub('.', function(x)
|
||||||
local r,b='',x:byte()
|
local r,byte_val='',x:byte()
|
||||||
for i=8,1,-1 do r=r..(b%2^i-b%2^(i-1)>0 and '1' or '0') end
|
for i=8,1,-1 do r=r..(byte_val%2^i-byte_val%2^(i-1)>0 and '1' or '0') end
|
||||||
return r;
|
return r;
|
||||||
end)..'0000'):gsub('%d%d%d?%d?%d?%d?', function(x)
|
end)..'0000'):gsub('%d%d%d?%d?%d?%d?', function(x)
|
||||||
if (#x < 6) then return '' end
|
if (#x < 6) then return '' end
|
||||||
|
|||||||
@@ -59,7 +59,9 @@ function M.install_widget(item, install_folder)
|
|||||||
local zip_file_path = "." .. install_folder .. "/" .. filename
|
local zip_file_path = "." .. install_folder .. "/" .. filename
|
||||||
local zip_file = io.open(zip_file_path, "wb")
|
local zip_file = io.open(zip_file_path, "wb")
|
||||||
if not zip_file then
|
if not zip_file then
|
||||||
return false, "Failed to open zip file: " .. zip_file_path
|
print("Directory does not exist: " .. install_folder)
|
||||||
|
print("Please create the directory manually and try again.")
|
||||||
|
return false, "Directory does not exist: " .. install_folder
|
||||||
end
|
end
|
||||||
|
|
||||||
zip_file:write(zip_data)
|
zip_file:write(zip_data)
|
||||||
|
|||||||
@@ -205,7 +205,7 @@ function M.create_widget_item(item, is_installed, on_install)
|
|||||||
|
|
||||||
if is_installed then
|
if is_installed then
|
||||||
table.insert(widget_details_children, editor.ui.label({
|
table.insert(widget_details_children, editor.ui.label({
|
||||||
text = "✓ Already installed",
|
text = "✓ Installed",
|
||||||
color = editor.ui.COLOR.WARNING
|
color = editor.ui.COLOR.WARNING
|
||||||
}))
|
}))
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user