Finished groups
This commit is contained in:
parent
3bc8dd4239
commit
3b8cd8b9f7
|
@ -91,7 +91,7 @@ const auth_info = Dict(
|
||||||
controller = "authentication"
|
controller = "authentication"
|
||||||
const dict_layouts = Dict(
|
const dict_layouts = Dict(
|
||||||
:auth => generate_layout_html("main",controller,"auth",libraries=["GoogleAuth"]),
|
:auth => generate_layout_html("main",controller,"auth",libraries=["GoogleAuth"]),
|
||||||
:profile => generate_layout_html("main",controller,"profile"),
|
:profile => generate_layout_html("main",controller,"profile",libraries=["Leaflet"]),
|
||||||
:email_confirmation => generate_layout_html("main",controller,"email_confirmation"),
|
:email_confirmation => generate_layout_html("main",controller,"email_confirmation"),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
module GroupsController
|
module GroupsController
|
||||||
|
|
||||||
using Genie, Genie.Renderer, Genie.Renderer.Html, Genie.Requests, GenieAuthentication
|
using Genie, Genie.Renderer, Genie.Renderer.Html, Genie.Requests, GenieAuthentication, DataFrames
|
||||||
using JSON3
|
using JSON3
|
||||||
using SearchLight
|
using SearchLight,SearchLightPostgreSQL, LibPQ, JSON3
|
||||||
using Server.DatabaseSupport, Server.TemplateEditor
|
using Server.DatabaseSupport, Server.TemplateEditor, Server.Users
|
||||||
import Server.DatabaseSupport: select_from_table
|
import Server.DatabaseSupport: select_from_table, insert_into_table, delete_from_table, exist_in_table
|
||||||
|
|
||||||
controller = "groups"
|
controller = "groups"
|
||||||
dict_layouts = Dict(
|
dict_layouts = Dict(
|
||||||
|
@ -34,8 +34,61 @@ function get_locale()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
#---Helpers-----------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
function table_to_json(name,df)
|
||||||
|
ar = []
|
||||||
|
for df_row in eachrow(df)
|
||||||
|
dict = Dict()
|
||||||
|
for id in names(df_row)
|
||||||
|
dict[id] = df_row[id]
|
||||||
|
end
|
||||||
|
push!(ar,dict)
|
||||||
|
end
|
||||||
|
open("public/assets/"*name*".json", "w") do io
|
||||||
|
JSON3.write(io, ar)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function compile(name)
|
||||||
|
df = select_from_table([name => ["*"]])
|
||||||
|
table_to_json(name,df)
|
||||||
|
end
|
||||||
|
|
||||||
|
function move_requests(name)
|
||||||
|
df_requests = select_from_table(["$(name)_requests" => ["*"]], where_data=["verified" => true, "added" => false])
|
||||||
|
df = select_from_table([name => ["*"]])
|
||||||
|
latitudes = df.latitude
|
||||||
|
longitudes = df.longitude
|
||||||
|
for df_row in eachrow(df_requests)
|
||||||
|
ind_id_given = ismissing(df_row.id_given) ? nothing : findfirst(df_row.id_given.==df.id)
|
||||||
|
if (!isnothing(ind_id_given))
|
||||||
|
id = df[ind_id_given,:id]
|
||||||
|
row_found = df[ind_id_given,Not(:id)]
|
||||||
|
dict = Dict(zip(names(row_found),values(row_found)))
|
||||||
|
dict["members"] += 1
|
||||||
|
update_table(name,dict, where_data=["id" => id])
|
||||||
|
else
|
||||||
|
id = df_row.id
|
||||||
|
dict_update = Dict("added" => true)
|
||||||
|
update_table("$(name)_requests",dict_update, where_data=["id" => id])
|
||||||
|
|
||||||
|
df_row_to_add = df_row[Not(:id_given)]
|
||||||
|
df_row_to_add = df_row_to_add[Not(:verified)]
|
||||||
|
df_row_to_add = df_row_to_add[Not(:added)]
|
||||||
|
df_row_to_add = df_row_to_add[Not(:id)]
|
||||||
|
dict = Dict(zip(names(df_row_to_add),values(df_row_to_add)))
|
||||||
|
dict["members"] = 1
|
||||||
|
insert_into_table(name,dict)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
#---Functions---------------------------------------------------------
|
#---Functions---------------------------------------------------------
|
||||||
|
|
||||||
|
current_user() = findone(Users.User, id = get_authentication())
|
||||||
|
|
||||||
function groups()
|
function groups()
|
||||||
locale = get_locale()
|
locale = get_locale()
|
||||||
html(:groups,:groups, layout = dict_layouts[:groups], context = @__MODULE__,
|
html(:groups,:groups, layout = dict_layouts[:groups], context = @__MODULE__,
|
||||||
|
@ -53,17 +106,156 @@ function groups_add()
|
||||||
end
|
end
|
||||||
|
|
||||||
function groups_add_post()
|
function groups_add_post()
|
||||||
data = jsonpayload()
|
data = copy(jsonpayload())
|
||||||
insert_into_table("groups_requests",data)
|
mode = data["mode"]
|
||||||
|
delete!(data,"mode")
|
||||||
|
user = current_user()
|
||||||
|
user_id = user.id
|
||||||
|
if mode==0 # Create
|
||||||
|
if user.verified
|
||||||
|
existing_user_group_data = select_from_table(["users_groups" => ["*"]], where_data=["user_id" => user_id])
|
||||||
|
has_group = !isempty(existing_user_group_data)
|
||||||
|
delete!(data,"group_id")
|
||||||
|
group_id = insert_into_table("groups",data, "RETURNING id")[1,1]
|
||||||
|
if has_group
|
||||||
|
user_groups_id = existing_user_group_data[1,"id"]
|
||||||
|
prev_group_id = existing_user_group_data[1,"group_id"]
|
||||||
|
update_table("users_groups",Dict("group_id" => group_id), where_data=["id" => user_groups_id])
|
||||||
|
members = select_from_table(["groups" => ["members"]], where_data=["id" => prev_group_id])[1,1]
|
||||||
|
if (members==1)
|
||||||
|
delete_from_table("groups",["id" => prev_group_id])
|
||||||
|
else
|
||||||
|
update_table("groups",Dict("members" => members - 1), where_data=["id" => id])
|
||||||
|
end
|
||||||
|
else
|
||||||
|
dict_users_groups = Dict("user_id" => user.id, "group_id" => group_id)
|
||||||
|
insert_into_table("users_groups",dict_users_groups)
|
||||||
|
end
|
||||||
|
compile("groups")
|
||||||
|
else
|
||||||
|
data["status"] = 0
|
||||||
|
data["user_id"] = user_id
|
||||||
|
insert_into_table("groups_requests",data)
|
||||||
|
end
|
||||||
|
elseif mode==1 # Join
|
||||||
|
data["user_id"] = user_id
|
||||||
|
if exist_in_table("users_groups",["group_id" => data["group_id"]])
|
||||||
|
if exist_in_table("groups_requests",["user_id" => user_id])
|
||||||
|
delete_from_table("groups_requests",["user_id" => user_id])
|
||||||
|
end
|
||||||
|
data["status"] = 0
|
||||||
|
insert_into_table("groups_requests",data)
|
||||||
|
else
|
||||||
|
group_id = data["group_id"]
|
||||||
|
members = select_from_table("groups" => ["members"], where_data = ["id" => group_id])[1,1]
|
||||||
|
dict = Dict("members" => members + 1)
|
||||||
|
update_table("groups",dict, where_data=["id" => group_id])
|
||||||
|
dict_users_groups = Dict("user_id" => user_id, "group_id" => group_id)
|
||||||
|
insert_into_table("users_groups",dict_users_groups)
|
||||||
|
end
|
||||||
|
|
||||||
|
elseif mode==2 # Move
|
||||||
|
existing_user_group_data = select_from_table(["users_groups" => ["*"]], where_data=["user_id" => user_id])
|
||||||
|
group_id = existing_user_group_data[1,"group_id"]
|
||||||
|
delete!(data,"group_id")
|
||||||
|
delete!(data,"members")
|
||||||
|
delete!(data,"contact")
|
||||||
|
update_table("groups",data, where_data=["id" => group_id])
|
||||||
|
compile("groups")
|
||||||
|
elseif mode==3 # Leave
|
||||||
|
existing_user_group_data = select_from_table(["users_groups" => ["*"]], where_data=["user_id" => user_id])
|
||||||
|
if size(existing_user_group_data,1)==0
|
||||||
|
if exist_in_table("groups_requests",["user_id" => user_id])
|
||||||
|
delete_from_table("groups_requests",["user_id" => user_id])
|
||||||
|
end
|
||||||
|
else
|
||||||
|
delete_from_table("users_groups",["user_id" => user_id])
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return nothing
|
||||||
end
|
end
|
||||||
|
|
||||||
function get_user_groups()
|
function get_user_groups()
|
||||||
|
local data_dicts
|
||||||
user_id = get_authentication()
|
user_id = get_authentication()
|
||||||
data = select_from_table("groups" => ["*"],
|
groups_ids = select_from_table("users_groups" => ["group_id"], where_data = ["user_id" => user_id])[:,1]
|
||||||
where_data = ["user_id" => user_id])
|
group_id = isempty(groups_ids) ? nothing : groups_ids[1]
|
||||||
ns = names(data)
|
data_dicts = []
|
||||||
data_dict = map(x -> Dict(zip(ns,values(x))),eachrow(data))
|
if isnothing(group_id)
|
||||||
return JSON3.write(data_dict)
|
local data
|
||||||
|
data = select_from_table("groups_requests" => ["*"], where_data = ["user_id" => user_id,"status" => 0])
|
||||||
|
if size(data,1)==0
|
||||||
|
data = select_from_table("groups_requests" => ["*"], where_data = ["user_id" => user_id,"status" => 2])
|
||||||
|
if size(data,1)!=0
|
||||||
|
data = data[[end],:]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
for row in eachrow(data)
|
||||||
|
dict = Dict(zip(names(row),values(row)))
|
||||||
|
if (!ismissing(row["group_id"]))
|
||||||
|
extra_data = select_from_table("groups" => ["*"], where_data = ["id" => row["group_id"]])
|
||||||
|
merge!(dict, Dict(zip(names(extra_data[1,:]),values(extra_data[1,:]))))
|
||||||
|
end
|
||||||
|
push!(data_dicts, dict)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
group_data = select_from_table("groups" => ["*"], where_data = ["id" => group_id])
|
||||||
|
ns = names(group_data)
|
||||||
|
data_dicts = map(x -> Dict(zip(ns,values(x))),eachrow(group_data))
|
||||||
|
end
|
||||||
|
return JSON3.write(data_dicts)
|
||||||
|
end
|
||||||
|
|
||||||
|
function get_group_requests()
|
||||||
|
user_id = get_authentication()
|
||||||
|
groups_ids = select_from_table("users_groups" => ["group_id"], where_data = ["user_id" => user_id])[:,1]
|
||||||
|
group_id = isempty(groups_ids) ? nothing : groups_ids[1]
|
||||||
|
data_dicts = []
|
||||||
|
if !isnothing(group_id)
|
||||||
|
user_ids = select_from_table("groups_requests" => ["user_id"], where_data = ["group_id" => group_id, "status" => 0])[:,1]
|
||||||
|
for user2_id in user_ids
|
||||||
|
email = select_from_table("users" => ["email"], where_data = ["id" => user2_id])[1,1]
|
||||||
|
push!(data_dicts,Dict("email" => email, "user_id" => user2_id))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return JSON3.write(data_dicts)
|
||||||
|
end
|
||||||
|
|
||||||
|
function approve_request()
|
||||||
|
data = copy(jsonpayload())
|
||||||
|
user_id = get_authentication()
|
||||||
|
groups_ids = select_from_table("users_groups" => ["group_id"], where_data = ["user_id" => user_id])[:,1]
|
||||||
|
group_id = isempty(groups_ids) ? nothing : groups_ids[1]
|
||||||
|
members = select_from_table("groups" => ["members"], where_data = ["id" => group_id])[1,1]
|
||||||
|
dict = Dict("members" => members + 1)
|
||||||
|
update_table("groups",dict, where_data=["id" => group_id])
|
||||||
|
update_table("groups_requests",Dict("status" => 1), where_data=["group_id" => group_id, "user_id" => data["user_id"]])
|
||||||
|
dict_users_groups = Dict("user_id" => data["user_id"], "group_id" => group_id)
|
||||||
|
insert_into_table("users_groups",dict_users_groups)
|
||||||
|
return nothing
|
||||||
|
end
|
||||||
|
|
||||||
|
function reject_request()
|
||||||
|
data = copy(jsonpayload())
|
||||||
|
user_id = get_authentication()
|
||||||
|
groups_ids = select_from_table("users_groups" => ["group_id"], where_data = ["user_id" => user_id])[:,1]
|
||||||
|
group_id = isempty(groups_ids) ? nothing : groups_ids[1]
|
||||||
|
update_table("groups_requests",Dict("status" => 2), where_data=["group_id" => group_id, "user_id" => data["user_id"]])
|
||||||
|
return nothing
|
||||||
|
end
|
||||||
|
|
||||||
|
function add_verified_groups()
|
||||||
|
groups_create_requests_verified = select_from_table("groups_requests" => ["*"], where_data = ["group_id" => nothing, "status" => 1])
|
||||||
|
data = Dict(zip(names(groups_create_requests_verified),groups_create_requests_verified[end,:]))
|
||||||
|
user_id = data["user_id"]
|
||||||
|
delete!(data,"group_id")
|
||||||
|
delete!(data,"user_id")
|
||||||
|
delete!(data,"id")
|
||||||
|
delete!(data,"status")
|
||||||
|
group_id = insert_into_table("groups",data, "RETURNING id")[1,1]
|
||||||
|
dict_users_groups = Dict("user_id" => user_id, "group_id" => group_id)
|
||||||
|
insert_into_table("users_groups",dict_users_groups)
|
||||||
|
delete_from_table("groups_requests",["user_id" => user_id])
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -169,3 +169,12 @@ label {
|
||||||
margin-top: -0.2rem;
|
margin-top: -0.2rem;
|
||||||
color: #5f5f5f;
|
color: #5f5f5f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#content {
|
||||||
|
position: relative;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
flex-direction: column;
|
||||||
|
height: 100%;
|
||||||
|
min-height: 100vh;
|
||||||
|
}
|
|
@ -0,0 +1,268 @@
|
||||||
|
/* Header */
|
||||||
|
#navbar{
|
||||||
|
position: relative;
|
||||||
|
top: 0;
|
||||||
|
width: min(100%,116rem);
|
||||||
|
z-index: 1000000000;
|
||||||
|
height: 5.26rem;
|
||||||
|
padding-left: 0rem;
|
||||||
|
padding-right: 0rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
#navbar * {
|
||||||
|
font-family: var(--sans-serif, sans-serif);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Logo */
|
||||||
|
#logo-container {
|
||||||
|
display: flex;
|
||||||
|
position: absolute;
|
||||||
|
margin-left: 1rem;
|
||||||
|
height: 100%;
|
||||||
|
max-height: 5.26rem;
|
||||||
|
color: black;
|
||||||
|
z-index: 1;
|
||||||
|
flex-direction: row;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
#navbar-logo {
|
||||||
|
height: 3.5rem;
|
||||||
|
width: 3.5rem;
|
||||||
|
object-fit: contain;
|
||||||
|
border-radius: 10rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
#navbar-logo-text {
|
||||||
|
position: relative;
|
||||||
|
word-wrap: normal;
|
||||||
|
height: 100%;
|
||||||
|
line-height: 400%;
|
||||||
|
font-size: 1.4rem;
|
||||||
|
color: #292222;
|
||||||
|
font-family: var(--sans-serif, sans-serif);
|
||||||
|
font-weight: 400;
|
||||||
|
padding-left: 1.2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Nav menu */
|
||||||
|
#nav {
|
||||||
|
position: fixed;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
background-color: white;
|
||||||
|
overflow: hidden;
|
||||||
|
z-index: 0;
|
||||||
|
}
|
||||||
|
#menu > li > a, .options-button {
|
||||||
|
display: block;
|
||||||
|
padding: 1.2rem;
|
||||||
|
padding-top: 1rem;
|
||||||
|
padding-bottom: 1rem;
|
||||||
|
color: black;
|
||||||
|
font-size: 1.4rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
#menu > li > a:active{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#menu li {
|
||||||
|
list-style-type: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#nav{
|
||||||
|
max-height: 0;
|
||||||
|
/*transition: max-height .5s ease-out;*/
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Menu Icon */
|
||||||
|
#hamb{
|
||||||
|
position: absolute;
|
||||||
|
cursor: pointer;
|
||||||
|
right: 0rem;
|
||||||
|
padding: 2.8rem 2rem;
|
||||||
|
z-index: 9999;
|
||||||
|
}/* Style label tag */
|
||||||
|
|
||||||
|
#hamb-line {
|
||||||
|
background: black;
|
||||||
|
display: block;
|
||||||
|
height: 2px;
|
||||||
|
position: relative;
|
||||||
|
width: 24px;
|
||||||
|
|
||||||
|
} /* Style span tag */
|
||||||
|
|
||||||
|
#hamb-line::before,
|
||||||
|
#hamb-line::after{
|
||||||
|
background: black;
|
||||||
|
content: '';
|
||||||
|
display: block;
|
||||||
|
height: 100%;
|
||||||
|
position: absolute;
|
||||||
|
transition: all .2s ease-out;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
#hamb-line::before{
|
||||||
|
top: 5px;
|
||||||
|
}
|
||||||
|
#hamb-line::after{
|
||||||
|
top: -5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#side-menu {
|
||||||
|
display: none;
|
||||||
|
} /* Hide checkbox */
|
||||||
|
|
||||||
|
/* Toggle menu icon */
|
||||||
|
#side-menu:checked ~ nav {
|
||||||
|
display: block;
|
||||||
|
max-height: 100%;
|
||||||
|
padding-top: 5.625rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
#side-menu:checked ~ #logo-container {
|
||||||
|
position: fixed;
|
||||||
|
}
|
||||||
|
|
||||||
|
#side-menu:checked ~ #hamb {
|
||||||
|
position: fixed;
|
||||||
|
}
|
||||||
|
|
||||||
|
#side-menu:checked ~ #logo-container {
|
||||||
|
position: fixed;
|
||||||
|
}
|
||||||
|
|
||||||
|
#side-menu:checked ~ #hamb #hamb-line {
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
#side-menu:checked ~ #hamb #hamb-line::before {
|
||||||
|
transform: rotate(-45deg);
|
||||||
|
top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#side-menu:checked ~ #hamb #hamb-line::after {
|
||||||
|
transform: rotate(45deg);
|
||||||
|
top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Options */
|
||||||
|
|
||||||
|
.options-dropdown {
|
||||||
|
position: absolute;
|
||||||
|
display: none;
|
||||||
|
top: 5.6rem;
|
||||||
|
right: 1.8rem;
|
||||||
|
border: #404040 solid 0.1rem;
|
||||||
|
background-color: white;
|
||||||
|
z-index: 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
.options-dropdown button, .options-dropdown a {
|
||||||
|
display: block;
|
||||||
|
font-family: var(--sans-serif,sans-serif);
|
||||||
|
font-size: 1.2rem;
|
||||||
|
width: 100%;
|
||||||
|
padding: 1rem;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.options-dropdown button:hover, .options-dropdown a:hover {
|
||||||
|
background-color: var(--red);
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.options-button {
|
||||||
|
width: 100%;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Localization */
|
||||||
|
|
||||||
|
#locales {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
#locales button {
|
||||||
|
width: 100%;
|
||||||
|
text-align: left;
|
||||||
|
height: 4rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
#locales button:hover {
|
||||||
|
opacity: 0.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
#locales-img {
|
||||||
|
position: relative;
|
||||||
|
top: 0rem;
|
||||||
|
height: 2rem;
|
||||||
|
margin-left: 1.2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
#options-dropdown>:first-child {
|
||||||
|
padding-bottom: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
#options-dropdown>:nth-child(2) {
|
||||||
|
padding-top: 0.5rem;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Responsiveness */
|
||||||
|
@media only screen and (min-width: 1200px) {
|
||||||
|
|
||||||
|
#navbar {
|
||||||
|
position: relative;
|
||||||
|
width: min(100%,116rem);
|
||||||
|
left: 50%;
|
||||||
|
transform: translateX(-50%);
|
||||||
|
padding-right: 4rem;
|
||||||
|
padding-left: 4rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
#nav {
|
||||||
|
max-height: none;
|
||||||
|
top: 0;
|
||||||
|
position: relative;
|
||||||
|
float: right;
|
||||||
|
width: fit-content;
|
||||||
|
background-color: transparent;
|
||||||
|
overflow: visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
#side-menu:checked ~ nav {
|
||||||
|
padding-top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#menu li {
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
#menu > li > a:hover, .options-button:hover, #navbar-logo-text:hover {
|
||||||
|
color: rgb(127, 127, 127);
|
||||||
|
}
|
||||||
|
|
||||||
|
#menu > li > a, .options-button {
|
||||||
|
padding: 0.9rem;
|
||||||
|
padding-top: 1.9rem;
|
||||||
|
padding-bottom: 1.9rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
#hamb {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#locales {
|
||||||
|
position: relative;
|
||||||
|
margin-right: 1.8rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
#locales-img {
|
||||||
|
top: 0.9rem;
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,12 +1,15 @@
|
||||||
|
|
||||||
import {getData, sendData} from "/js/libraries/serverTools.js"
|
import {getData, sendData} from "/js/libraries/serverTools.js"
|
||||||
|
|
||||||
export function getUser(user,callbackOuter) {
|
export function getUser(user,loaded,callbackOuter) {
|
||||||
let callback = function(response) {
|
let callback = function(response) {
|
||||||
Object.assign(user,JSON.parse(response))
|
Object.assign(user,JSON.parse(response))
|
||||||
if(callbackOuter!=undefined) {
|
if(callbackOuter!=undefined) {
|
||||||
callbackOuter()
|
callbackOuter()
|
||||||
}
|
}
|
||||||
|
loaded.update((val) => {
|
||||||
|
return val + 1
|
||||||
|
})
|
||||||
}
|
}
|
||||||
getData("/xx/get-user",callback)
|
getData("/xx/get-user",callback)
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@ export function translate(content, x) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function addMarkersToLayer(g,layer,content,locale,addPinContent,markerColor) {
|
function addMarkersToLayer(g,layer,content,locale,addPinContent,markerColor,options) {
|
||||||
let {text,coordinates} = addPinContent(g,content,locale)
|
let {text,coordinates} = addPinContent(g,content,locale)
|
||||||
var markerIcon = new L.Icon({
|
var markerIcon = new L.Icon({
|
||||||
iconUrl: 'https://www.libsoc.org/img/common/markers/marker-' + markerColor + '.png',
|
iconUrl: 'https://www.libsoc.org/img/common/markers/marker-' + markerColor + '.png',
|
||||||
|
@ -21,57 +21,69 @@ function addMarkersToLayer(g,layer,content,locale,addPinContent,markerColor) {
|
||||||
shadowSize: [41, 41]
|
shadowSize: [41, 41]
|
||||||
})
|
})
|
||||||
let marker = L.marker(coordinates, {icon: markerIcon})
|
let marker = L.marker(coordinates, {icon: markerIcon})
|
||||||
|
marker.id = g.id
|
||||||
|
marker.members = g.members
|
||||||
|
marker.contact = g.contact
|
||||||
marker.addTo(layer).bindPopup(text)
|
marker.addTo(layer).bindPopup(text)
|
||||||
|
|
||||||
|
if (options.pinCallback!=undefined) {
|
||||||
|
marker.on('click', (event) => options.pinCallback(marker,event))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function addMarkersEntries(entries,entriesByCountry,map,content,locale,addPinContent,markerColor) {
|
export function addMarkersEntries(entries,entriesByCountry,map,content,locale,addPinContent,markerColor,options) {
|
||||||
let entriesMarkersLayer = L.layerGroup()
|
let entriesMarkersLayer = L.layerGroup()
|
||||||
let entriesMarkersLayerOut = L.layerGroup()
|
let entriesMarkersLayerOut = L.layerGroup()
|
||||||
let entriesMarkersLayerIn = L.layerGroup()
|
let entriesMarkersLayerIn = L.layerGroup()
|
||||||
for (let g of entries) {
|
for (let g of entries) {
|
||||||
if (g.country!="Online" && g.country!="Worldwide") {
|
if (g.country!="Online" && g.country!="Worldwide") {
|
||||||
addMarkersToLayer(g,entriesMarkersLayerIn,content,locale,addPinContent,markerColor)
|
addMarkersToLayer(g,entriesMarkersLayerIn,content,locale,addPinContent,markerColor,options)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (let gs of Object.values(entriesByCountry)) {
|
if (options.enableCountryGrouping) {
|
||||||
if (gs.length==1) {
|
for (let gs of Object.values(entriesByCountry)) {
|
||||||
let g = {...gs[0]}
|
if (gs.length==1) {
|
||||||
g.country = [g.country]
|
let g = {...gs[0]}
|
||||||
if (g.country!="Online" && g.country!="Worldwide") {
|
g.country = [g.country]
|
||||||
addMarkersToLayer(g,entriesMarkersLayerOut,content,locale,addPinContent,markerColor)
|
if (g.country!="Online" && g.country!="Worldwide") {
|
||||||
|
addMarkersToLayer(g,entriesMarkersLayerOut,content,locale,addPinContent,markerColor,options)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
else {
|
||||||
else {
|
if (gs[0].country!="Online" && gs[0].country!="Worldwide") {
|
||||||
if (gs[0].country!="Online" && gs[0].country!="Worldwide") {
|
let locationName = gs[0].country
|
||||||
let locationName = gs[0].country
|
let locationCoordinates = [0,0]
|
||||||
let locationCoordinates = [0,0]
|
let members = 0
|
||||||
let members = 0
|
let contact = gs[0].contact
|
||||||
let contact = gs[0].contact
|
for (let g of gs) {
|
||||||
for (let g of gs) {
|
locationCoordinates[0] += g.latitude
|
||||||
locationCoordinates[0] += g.latitude
|
locationCoordinates[1] += g.longitude
|
||||||
locationCoordinates[1] += g.longitude
|
members += g.members
|
||||||
members += g.members
|
if (g.contact[0]!=gs[0].contact[0]) {
|
||||||
if (g.contact[0]!=gs[0].contact[0]) {
|
contact = contactGeneral
|
||||||
contact = contactGeneral
|
}
|
||||||
}
|
}
|
||||||
|
locationCoordinates[0] = locationCoordinates[0]/gs.length
|
||||||
|
locationCoordinates[1] = locationCoordinates[1]/gs.length
|
||||||
|
let gNew = {
|
||||||
|
country: locationName,
|
||||||
|
latitude: locationCoordinates[0],
|
||||||
|
longitude: locationCoordinates[1],
|
||||||
|
members: members,
|
||||||
|
contact: contact
|
||||||
|
}
|
||||||
|
addMarkersToLayer(gNew,entriesMarkersLayerOut,content,locale,addPinContent,markerColor,options)
|
||||||
}
|
}
|
||||||
locationCoordinates[0] = locationCoordinates[0]/gs.length
|
|
||||||
locationCoordinates[1] = locationCoordinates[1]/gs.length
|
|
||||||
let gNew = {
|
|
||||||
country: locationName,
|
|
||||||
latitude: locationCoordinates[0],
|
|
||||||
longitude: locationCoordinates[1],
|
|
||||||
members: members,
|
|
||||||
contact: contact
|
|
||||||
}
|
|
||||||
addMarkersToLayer(gNew,entriesMarkersLayerOut,content,locale,addPinContent,markerColor)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
entriesMarkersLayerOut.addTo(entriesMarkersLayer)
|
||||||
|
map.on("zoomend", () => onZoomEnd(map,entriesMarkersLayer,entriesMarkersLayerOut,entriesMarkersLayerIn))
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
entriesMarkersLayerIn.addTo(entriesMarkersLayer)
|
||||||
}
|
}
|
||||||
|
|
||||||
entriesMarkersLayerOut.addTo(entriesMarkersLayer)
|
|
||||||
entriesMarkersLayer.addTo(map)
|
entriesMarkersLayer.addTo(map)
|
||||||
map.on("zoomend", () => onZoomEnd(map,entriesMarkersLayer,entriesMarkersLayerOut,entriesMarkersLayerIn))
|
|
||||||
return entriesMarkersLayer
|
return entriesMarkersLayer
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -67,6 +67,7 @@
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
@import '/css/common.css';
|
@import '/css/common.css';
|
||||||
|
@import '/css/auth.css';
|
||||||
|
|
||||||
span {
|
span {
|
||||||
font-size: 1.4rem;
|
font-size: 1.4rem;
|
||||||
|
@ -91,7 +92,7 @@
|
||||||
display: flex;
|
display: flex;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
margin: auto;
|
margin: auto;
|
||||||
top: 40%;
|
top: 40%;/*40%;*/
|
||||||
left: 50%;
|
left: 50%;
|
||||||
transform: translate(-50%, -50%);
|
transform: translate(-50%, -50%);
|
||||||
width: 5.4rem;
|
width: 5.4rem;
|
||||||
|
@ -115,7 +116,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
#auth-or {
|
#auth-or {
|
||||||
top: 46.4rem;
|
top: 40rem;/*46.4rem;*/
|
||||||
}
|
}
|
||||||
|
|
||||||
#auth-group {
|
#auth-group {
|
||||||
|
|
|
@ -81,13 +81,14 @@
|
||||||
</div>
|
</div>
|
||||||
<button class="auth-button" on:click="{() => AuthTools.login(msgs,inputs)}">Log in</button>
|
<button class="auth-button" on:click="{() => AuthTools.login(msgs,inputs)}">Log in</button>
|
||||||
<a id="forgot-password" href="forgot-password">Forgot password?</a>
|
<a id="forgot-password" href="forgot-password">Forgot password?</a>
|
||||||
|
<!--
|
||||||
<hr class="auth-line">
|
<hr class="auth-line">
|
||||||
<div class="auth-methods-group">
|
<div class="auth-methods-group">
|
||||||
<div id="google-btn-wrapper">
|
<div id="google-btn-wrapper">
|
||||||
<div bind:this={googleButton} id="google-btn"></div>
|
<div bind:this={googleButton} id="google-btn"></div>
|
||||||
<img src="/img/auth/google_icon.svg" id="google-logo" alt="google icon">
|
<img src="/img/auth/google_icon.svg" id="google-logo" alt="google icon">
|
||||||
</div>
|
</div>
|
||||||
<!--
|
|
||||||
<button on:click={openGoogleWindow}>
|
<button on:click={openGoogleWindow}>
|
||||||
<img src="img/auth/google_icon.svg" id="navbar-logo" alt="google icon">
|
<img src="img/auth/google_icon.svg" id="navbar-logo" alt="google icon">
|
||||||
</button>
|
</button>
|
||||||
|
@ -96,8 +97,9 @@
|
||||||
</button>
|
</button>
|
||||||
<button onclick="">
|
<button onclick="">
|
||||||
<img src="img/auth/linkedin_icon.svg" id="navbar-logo" alt="linkedin icon">
|
<img src="img/auth/linkedin_icon.svg" id="navbar-logo" alt="linkedin icon">
|
||||||
</button>-->
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
-->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|
|
@ -111,18 +111,20 @@
|
||||||
</div>
|
</div>
|
||||||
<button class="auth-button" on:click="{showDialog}">Sign up</button> <!--() => AuthTools.signup(msgs,inputs,AuthTools.toLandingPage)-->
|
<button class="auth-button" on:click="{showDialog}">Sign up</button> <!--() => AuthTools.signup(msgs,inputs,AuthTools.toLandingPage)-->
|
||||||
<p id="forgot-password"></p>
|
<p id="forgot-password"></p>
|
||||||
|
<!--
|
||||||
<hr class="auth-line">
|
<hr class="auth-line">
|
||||||
<div class="auth-methods-group">
|
<div class="auth-methods-group">
|
||||||
<button on:click="{showDialog}">
|
<button on:click="{showDialog}">
|
||||||
<img src="/img/auth/google_icon.svg" id="navbar-logo" alt="google icon">
|
<img src="/img/auth/google_icon.svg" id="navbar-logo" alt="google icon">
|
||||||
</button>
|
</button>
|
||||||
<!--<button onclick="">
|
<button onclick="">
|
||||||
<img src="img/auth/facebook_icon.svg" id="navbar-logo" alt="facebook icon">
|
<img src="img/auth/facebook_icon.svg" id="navbar-logo" alt="facebook icon">
|
||||||
</button>
|
</button>
|
||||||
<button onclick="">
|
<button onclick="">
|
||||||
<img src="img/auth/linkedin_icon.svg" id="navbar-logo" alt="linkedin icon">
|
<img src="img/auth/linkedin_icon.svg" id="navbar-logo" alt="linkedin icon">
|
||||||
</button>-->
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
-->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div bind:this={dialog} id="dialog">
|
<div bind:this={dialog} id="dialog">
|
||||||
|
|
|
@ -43,7 +43,10 @@
|
||||||
|
|
||||||
function mapCallback(createMap,content,locale) {
|
function mapCallback(createMap,content,locale) {
|
||||||
let map = createMap([22, 0],2)
|
let map = createMap([22, 0],2)
|
||||||
addMarkersEntries(entries,entriesByCountry,map,content,locale,addCommunePinContent,"red")
|
let options = {
|
||||||
|
enableCountryGrouping: true,
|
||||||
|
}
|
||||||
|
addMarkersEntries(entries,entriesByCountry,map,content,locale,addCommunePinContent,"red",options)
|
||||||
}
|
}
|
||||||
|
|
||||||
function getCountry(x) {
|
function getCountry(x) {
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
// Export statements
|
// Export statements
|
||||||
export let callback = null
|
export let callback = null
|
||||||
export let colors = null
|
export let colors = null
|
||||||
|
export let map = null
|
||||||
|
|
||||||
// Main code
|
// Main code
|
||||||
let mapContainer
|
let mapContainer
|
||||||
|
|
|
@ -43,7 +43,10 @@
|
||||||
|
|
||||||
function mapCallback(createMap,content,locale) {
|
function mapCallback(createMap,content,locale) {
|
||||||
let map = createMap([22, 0],2)
|
let map = createMap([22, 0],2)
|
||||||
addMarkersEntries(entries,entriesByCountry,map,content,locale,addCoopPinContent,"blue")
|
let options = {
|
||||||
|
enableCountryGrouping: true,
|
||||||
|
}
|
||||||
|
addMarkersEntries(entries,entriesByCountry,map,content,locale,addCoopPinContent,"blue",options)
|
||||||
}
|
}
|
||||||
|
|
||||||
function getCountry(x) {
|
function getCountry(x) {
|
||||||
|
|
|
@ -2,19 +2,26 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// Import statements
|
// Import statements
|
||||||
import { onMount } from 'svelte'
|
import { onMount, getContext } from 'svelte'
|
||||||
import { writable } from 'svelte/store';
|
import { writable } from 'svelte/store';
|
||||||
import { loadLocaleContent, getData, sendData } from "/js/libraries/serverTools.js"
|
import { loadLocaleContent, getData, sendData } from "/js/libraries/serverTools.js"
|
||||||
import { addMarkersEntries, translate } from "/js/libraries/mapTools.js"
|
import { addMarkersEntries, translate } from "/js/libraries/mapTools.js"
|
||||||
|
|
||||||
// Import components
|
// Import components
|
||||||
import "/js/components/map-component.js"
|
import "/js/components/map-component.js"
|
||||||
|
|
||||||
|
// Export statements
|
||||||
|
export let map = null
|
||||||
|
|
||||||
// Main code
|
// Main code
|
||||||
let loaded = writable(0)
|
let loaded = writable(0)
|
||||||
let content = writable({})
|
let content = writable({})
|
||||||
let entries
|
let entries
|
||||||
let entriesByCountry
|
let entriesByCountry
|
||||||
|
let userData
|
||||||
|
|
||||||
|
let buttonsGroupMember
|
||||||
|
let buttonsNotGroupMember
|
||||||
|
|
||||||
let callback = (response) => {
|
let callback = (response) => {
|
||||||
entries = JSON.parse(response)
|
entries = JSON.parse(response)
|
||||||
|
@ -41,11 +48,32 @@
|
||||||
let confirmationMsg
|
let confirmationMsg
|
||||||
let addressInput
|
let addressInput
|
||||||
let contactInput
|
let contactInput
|
||||||
let addressVec
|
let membersInput
|
||||||
let userPinLat = 0
|
let addressVec = ["","",""]
|
||||||
|
let userPinData = {
|
||||||
|
|
||||||
|
}
|
||||||
let userPinLng = 0
|
let userPinLng = 0
|
||||||
let userPin = createPin(0,0)
|
let userPin = createPin(0,0)
|
||||||
userPin.setOpacity(0)
|
userPin.setOpacity(0)
|
||||||
|
let modeButtons = []
|
||||||
|
|
||||||
|
let context = getContext("profile-component")
|
||||||
|
let closeGroupsAdd = context.closeGroupsAdd
|
||||||
|
let maps = context.maps
|
||||||
|
let onLoadedGroups = context.onLoadedGroups
|
||||||
|
let userGroups = context.userGroups
|
||||||
|
let user = context.user
|
||||||
|
|
||||||
|
let has_group = userGroups.length!=0
|
||||||
|
let mode = has_group ? 2 : 0
|
||||||
|
let pendingGroup
|
||||||
|
if (has_group) {
|
||||||
|
pendingGroup= userGroups[0].status!=undefined
|
||||||
|
if (pendingGroup) {
|
||||||
|
mode = 3
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let locale = loadLocaleContent(content,"groups-component",loaded)
|
let locale = loadLocaleContent(content,"groups-component",loaded)
|
||||||
loadLocaleContent(content,"countries",loaded)
|
loadLocaleContent(content,"countries",loaded)
|
||||||
|
@ -105,23 +133,25 @@
|
||||||
response = JSON.parse(response)
|
response = JSON.parse(response)
|
||||||
// Extract the address information from the response
|
// Extract the address information from the response
|
||||||
let address = response.address
|
let address = response.address
|
||||||
let city = address.city || address.town || address.village || address.hamlet
|
if (address!=undefined) {
|
||||||
let state = address.state
|
let city = address.city || address.town || address.village || address.hamlet
|
||||||
let country = address.country
|
let state = address.state
|
||||||
let fullAddress = country
|
let country = address.country
|
||||||
if (state!=undefined) {
|
let fullAddress = country
|
||||||
fullAddress += ", " + state
|
if (state!=undefined) {
|
||||||
|
fullAddress += ", " + state
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
state = ""
|
||||||
|
}
|
||||||
|
if (city!=undefined) {
|
||||||
|
fullAddress += ", " + city
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
city = ""
|
||||||
|
}
|
||||||
|
addressVec = [country,state,city]
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
state = ""
|
|
||||||
}
|
|
||||||
if (city!=undefined) {
|
|
||||||
fullAddress += ", " + city
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
city = ""
|
|
||||||
}
|
|
||||||
addressVec = [country,state,city]
|
|
||||||
}
|
}
|
||||||
getData(url,callback)
|
getData(url,callback)
|
||||||
}
|
}
|
||||||
|
@ -153,85 +183,180 @@
|
||||||
return {text,coordinates}
|
return {text,coordinates}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function mapCallback(createMap,content,locale) {
|
function mapCallback(createMap,content,locale) {
|
||||||
let map = createMap([22, 0],2)
|
map = createMap([22, 0],2)
|
||||||
addMarkersEntries(entries,entriesByCountry,map,content,locale,addGroupPinContent,"green")
|
maps["groupsAdd"] = map
|
||||||
|
let options = {
|
||||||
|
enableCountryGrouping: false,
|
||||||
|
pinCallback: pinCallback
|
||||||
|
}
|
||||||
|
addMarkersEntries(entries,entriesByCountry,map,content,locale,addGroupPinContent,"green",options)
|
||||||
|
|
||||||
userPin.addTo(map)
|
userPin.addTo(map)
|
||||||
map.on('click', function(event) {
|
map.on('click', function(event) {
|
||||||
let lat = event.latlng.lat;
|
if (mode==0) {
|
||||||
let lng = event.latlng.lng;
|
let lat = event.latlng.lat;
|
||||||
userPinLat = lat
|
let lng = event.latlng.lng;
|
||||||
userPinLng = lng
|
userPinData["latitude"] = lat
|
||||||
updatePin(userPin,lat,lng)
|
userPinData["longitude"] = lng
|
||||||
userPin.setOpacity(1)
|
userPinData["id"] = null
|
||||||
reverseGeocodeLocal(lat, lng)
|
updatePin(userPin,lat,lng)
|
||||||
reverseGeocode(lat, lng)
|
userPin.setOpacity(1)
|
||||||
|
reverseGeocodeLocal(lat, lng)
|
||||||
|
reverseGeocode(lat, lng)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateConfirmationMsg(response) {
|
function updateConfirmationMsg(response) {
|
||||||
if (response!==false) {
|
if (response!==false) {
|
||||||
|
if (mode==0 && !user.verified) {
|
||||||
confirmationMsg.innerHTML = "You have been added to our database! Now go to our Discord to verify yourself."
|
confirmationMsg.innerHTML = "You have been added to our database! Now go to our Discord to verify yourself."
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
confirmationMsg.innerHTML = "Success!"
|
||||||
|
}
|
||||||
confirmationMsg.style.color = "green"
|
confirmationMsg.style.color = "green"
|
||||||
|
if (mode==0 || mode==1) {
|
||||||
|
userGroups[0] = {}
|
||||||
|
}
|
||||||
|
userGroups[0].country = addressVec[0]=="" ? null : addressVec[0]
|
||||||
|
userGroups[0].state = addressVec[1]=="" ? null : addressVec[1]
|
||||||
|
userGroups[0].town = addressVec[2]=="" ? null : addressVec[2]
|
||||||
|
userGroups[0].members = userPinData["members"]
|
||||||
|
onLoadedGroups()
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
confirmationMsg.innerHTML = "Something went wrong."
|
confirmationMsg.innerHTML = "Something went wrong."
|
||||||
confirmationMsg.style.color = "red"
|
confirmationMsg.style.color = "red"
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function submitLocation() {
|
function submitLocation() {
|
||||||
if (addressVec!=undefined) {
|
if (addressVec[0]!="" || mode==3) {
|
||||||
let data = {
|
let membersVal, contactVal
|
||||||
|
if (mode==0) { // Create
|
||||||
|
membersVal = membersInput.value
|
||||||
|
contactVal = contactInput.value
|
||||||
|
}
|
||||||
|
else if (mode==1) { // Join
|
||||||
|
contactVal = contactInput.value
|
||||||
|
}
|
||||||
|
else if (mode==2 || mode==3) { // Move
|
||||||
|
membersVal = ""
|
||||||
|
contactVal = ""
|
||||||
|
}
|
||||||
|
else if (mode==3) { // Leave
|
||||||
|
membersVal = ""
|
||||||
|
contactVal = ""
|
||||||
|
addressVec = [null,null,null]
|
||||||
|
userPinData["latitude"] = null
|
||||||
|
userPinData["longitude"] = null
|
||||||
|
}
|
||||||
|
|
||||||
|
userData = {
|
||||||
country: addressVec[0],
|
country: addressVec[0],
|
||||||
state: addressVec[1],
|
state: addressVec[1],
|
||||||
town: addressVec[2],
|
town: addressVec[2],
|
||||||
latitude: userPinLat,
|
latitude: userPinData["latitude"],
|
||||||
longitude: userPinLng,
|
longitude: userPinData["longitude"],
|
||||||
contact: contactInput.value
|
contact: contactVal=="" ? null : contactVal,
|
||||||
|
members: membersVal=="" ? null : parseInt(membersVal),
|
||||||
|
group_id: userPinData["id"],
|
||||||
|
mode: mode
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data.state=="") {
|
if (userData.state=="") {
|
||||||
data.state = null
|
userData.state = null
|
||||||
}
|
}
|
||||||
if (data.town=="") {
|
if (userData.town=="") {
|
||||||
data.town = null
|
userData.town = null
|
||||||
}
|
|
||||||
if (data.contact=="") {
|
|
||||||
data.contact = null
|
|
||||||
}
|
}
|
||||||
let url = "/" + locale + "/groups-add-post/"
|
let url = "/" + locale + "/groups-add-post/"
|
||||||
sendData(url,data,updateConfirmationMsg)
|
sendData(url,userData,updateConfirmationMsg)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function resizeInput(el) {
|
function resizeInput(el) {
|
||||||
el.nextElementSibling.innerHTML = el.value
|
el.nextElementSibling.innerHTML = el.value
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function pinCallback(marker,event) {
|
||||||
|
if (mode==1) {
|
||||||
|
let lat = event.latlng.lat;
|
||||||
|
let lng = event.latlng.lng;
|
||||||
|
userPinData["latitude"] = lat
|
||||||
|
userPinData["longitude"] = lng
|
||||||
|
userPinData["id"] = marker.id
|
||||||
|
userPinData["members"] = marker.members
|
||||||
|
updatePin(userPin,lat,lng)
|
||||||
|
userPin.setOpacity(1)
|
||||||
|
reverseGeocodeLocal(lat, lng)
|
||||||
|
reverseGeocode(lat, lng)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function chooseButton(index) {
|
||||||
|
for (let b of modeButtons) {
|
||||||
|
if (b!=undefined) {
|
||||||
|
b.style.background = "rgba(197, 43, 40, 0.319)"
|
||||||
|
b.style.color = "black"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
modeButtons[index].style.background = "rgb(197, 43, 40)"
|
||||||
|
modeButtons[index].style.color = "white"
|
||||||
|
mode = index
|
||||||
|
}
|
||||||
|
|
||||||
|
function getAddress(g) {
|
||||||
|
if (g!=undefined) {
|
||||||
|
let location = [g.country,g.state,g.town].filter(x => x!=null)
|
||||||
|
return location.map(x => locale=="en" ? x : translate($content,x)).join(", ")
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return "Create or join group"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function onLoaded() {
|
||||||
|
if ($loaded==3) {
|
||||||
|
chooseButton(mode)
|
||||||
|
if (mode==2 || mode==3) {
|
||||||
|
addressInput.value = getAddress(userGroups[0])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
let f = () => onLoaded()
|
||||||
|
setTimeout(f, 100)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
|
onLoaded()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#key $loaded}
|
{#key $loaded}
|
||||||
{#if $loaded==3}
|
{#if $loaded==3}
|
||||||
<div id="container">
|
<div id="container">
|
||||||
|
<button class="close-button" on:click={closeGroupsAdd}></button>
|
||||||
<!--<img src="img/crowd.png" id="crowd" alt="crowd">-->
|
<!--<img src="img/crowd.png" id="crowd" alt="crowd">-->
|
||||||
<div id="text-container">
|
<div id="text-container">
|
||||||
<h1>Add a Group</h1>
|
{#if !has_group}
|
||||||
<img id="groups-img" src="/img/common/groups.svg" alt="groups">
|
<div bind:this={buttonsNotGroupMember} id="button-line">
|
||||||
<p class="description">If there are no groups in your town with whom you can organize then do the following:</p>
|
<button bind:this={modeButtons[0]} on:click={() => chooseButton(0)}>Create</button>
|
||||||
<ol>
|
<button bind:this={modeButtons[1]} on:click={() => chooseButton(1)}>Join</button>
|
||||||
<li>Click on the map to show us where you are located;</li>
|
</div>
|
||||||
<li>Add a way to contact you (an invite link or an email, not a phone number) or leave blank for a pin to point to our discord;</li>
|
{:else if has_group && !pendingGroup}
|
||||||
<li>Press "Submit" to add yourself to our map;</li>
|
<div bind:this={buttonsGroupMember} id="button-line">
|
||||||
<li>Verify yourself by having a chat with us at our Discord server to show on the map;</li>
|
<button bind:this={modeButtons[2]} on:click={() => chooseButton(2)} style={"display: " + (pendingGroup ? "none" : "initial")}>Move</button>
|
||||||
</ol>
|
<button bind:this={modeButtons[3]} on:click={() => chooseButton(3)}>Leave</button>
|
||||||
|
</div>
|
||||||
|
{:else}
|
||||||
|
<div bind:this={buttonsGroupMember} id="button-line">
|
||||||
|
<button bind:this={modeButtons[3]} on:click={() => chooseButton(3)}>Leave</button>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
<div id="address-input-wrapper" class="input-label-wrapper">
|
<div id="address-input-wrapper" class="input-label-wrapper">
|
||||||
<label for="address-input">Location: </label>
|
<label for="address-input">Location: </label>
|
||||||
<div class="input-wrapper">
|
<div class="input-wrapper">
|
||||||
|
@ -239,16 +364,30 @@
|
||||||
<div class="ghost-input"></div>
|
<div class="ghost-input"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="input-label-wrapper">
|
{#key mode}
|
||||||
<label for="contact-input">Contact: </label>
|
{#if mode==0}
|
||||||
<div class="input-wrapper">
|
<div id="members-input-wrapper" class="input-label-wrapper">
|
||||||
<input bind:this={contactInput} on:input={() => resizeInput(contactInput)} id="contact-input" type="text">
|
<label for="members-input">Members: </label>
|
||||||
<div class="ghost-input"></div>
|
<div class="input-wrapper">
|
||||||
</div>
|
<input bind:this={membersInput} id="members-input" type="text" value={1}>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
{#if mode==0 || mode==1}
|
||||||
|
<div class="input-label-wrapper">
|
||||||
|
<label for="contact-input">Contact: </label>
|
||||||
|
<div class="input-wrapper">
|
||||||
|
<input bind:this={contactInput} on:input={() => resizeInput(contactInput)} id="contact-input" type="text">
|
||||||
|
<div class="ghost-input"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
{/key}
|
||||||
<button id="submit-button" on:click={submitLocation}>Submit</button>
|
<button id="submit-button" on:click={submitLocation}>Submit</button>
|
||||||
<p id="confirmation-msg" bind:this={confirmationMsg}></p>
|
<p id="confirmation-msg" bind:this={confirmationMsg}></p>
|
||||||
<map-component id="map" callback={(createMap) => mapCallback(createMap,$content,locale)}></map-component>
|
{#if !(has_group && pendingGroup)}
|
||||||
|
<map-component id="map" callback={(createMap) => mapCallback(createMap,$content,locale)}></map-component>
|
||||||
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
@ -257,13 +396,75 @@
|
||||||
<style>
|
<style>
|
||||||
@import '/css/common.css';
|
@import '/css/common.css';
|
||||||
|
|
||||||
|
#button-line {
|
||||||
|
position: relative;
|
||||||
|
width: fit-content;
|
||||||
|
margin: auto;
|
||||||
|
margin-top: 1.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
#button-line button{
|
||||||
|
font-family: var(--sans-serif,sans-serif);
|
||||||
|
font-size: 1.15rem;
|
||||||
|
padding: 1rem 0;
|
||||||
|
width: 7rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
#button-line :first-child {
|
||||||
|
border-top-left-radius: 1rem;
|
||||||
|
border-bottom-left-radius: 1rem;
|
||||||
|
margin-right: 0.1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
#button-line :last-child {
|
||||||
|
margin-left: 0.1rem;
|
||||||
|
border-top-right-radius: 1rem;
|
||||||
|
border-bottom-right-radius: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.close-button {
|
||||||
|
position: absolute;
|
||||||
|
top: 2rem;
|
||||||
|
right: 0rem;
|
||||||
|
width: 2rem;
|
||||||
|
height: 2rem;
|
||||||
|
border: none;
|
||||||
|
cursor: pointer;
|
||||||
|
z-index: 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.close-button:hover {
|
||||||
|
opacity: 0.7;
|
||||||
|
}
|
||||||
|
|
||||||
|
.close-button::before,
|
||||||
|
.close-button::after {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
width: 0.2rem;
|
||||||
|
height: 2rem;
|
||||||
|
background-color: #000;
|
||||||
|
border-radius: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.close-button::before {
|
||||||
|
transform: translate(-50%, -50%) rotate(45deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
.close-button::after {
|
||||||
|
transform: translate(-50%, -50%) rotate(-45deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#confirmation-msg {
|
#confirmation-msg {
|
||||||
margin-top: 0.5rem;
|
margin-top: 0.5rem;
|
||||||
margin-bottom: 2rem;
|
margin-bottom: 2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
ol li {
|
ol li {
|
||||||
margin-left: 3rem;
|
margin-left: 1rem;
|
||||||
margin-bottom: 0.5rem;
|
margin-bottom: 0.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -273,7 +474,7 @@
|
||||||
font-size: 1.15rem;
|
font-size: 1.15rem;
|
||||||
line-height: 160%;
|
line-height: 160%;
|
||||||
color: #222222;
|
color: #222222;
|
||||||
width: 5.5rem;
|
width: 6rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
input, .ghost-input {
|
input, .ghost-input {
|
||||||
|
@ -296,6 +497,14 @@
|
||||||
margin-bottom: 1rem;
|
margin-bottom: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#members-input-wrapper {
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
#members-input {
|
||||||
|
width: 5rem;
|
||||||
|
}
|
||||||
|
|
||||||
.ghost-input {
|
.ghost-input {
|
||||||
display: block;
|
display: block;
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
|
@ -339,42 +548,6 @@
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
#add-prompt {
|
|
||||||
margin-bottom: 2rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
#groups-img {
|
|
||||||
position: absolute;
|
|
||||||
width: 14rem;
|
|
||||||
left: 50%;
|
|
||||||
transform: translate(-50%);
|
|
||||||
z-index: 0;
|
|
||||||
opacity: 0.2;
|
|
||||||
}
|
|
||||||
|
|
||||||
#text-container>:nth-child(3) {
|
|
||||||
margin-top: 8rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.country-name {
|
|
||||||
margin-bottom: 0.5rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.country-block {
|
|
||||||
margin-bottom: 2rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.location-info {
|
|
||||||
margin-bottom: 0.75rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.location-info p {
|
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
a {
|
|
||||||
color: #DD1C1A;
|
|
||||||
}
|
|
||||||
|
|
||||||
#map {
|
#map {
|
||||||
--height: 30rem;
|
--height: 30rem;
|
||||||
|
@ -389,16 +562,6 @@
|
||||||
margin: auto;
|
margin: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
h1 {
|
|
||||||
margin-bottom: 1rem;
|
|
||||||
font-size: 2.2rem;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
h3 {
|
|
||||||
margin-bottom: 1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
#container {
|
#container {
|
||||||
margin: auto;
|
margin: auto;
|
||||||
max-width: 800px;
|
max-width: 800px;
|
||||||
|
|
|
@ -62,10 +62,13 @@
|
||||||
|
|
||||||
function mapCallback(createMap,content,locale) {
|
function mapCallback(createMap,content,locale) {
|
||||||
let map = createMap([22, 0],2)
|
let map = createMap([22, 0],2)
|
||||||
let groupsMarkersLayer = addMarkersEntries(entries["groups"],entriesByCountry["groups"],map,content,locale,addGroupPinContent,"green")
|
let options = {
|
||||||
let communesMarkersLayer = addMarkersEntries(entries["communes"],entriesByCountry["communes"],map,content,locale,addCommunePinContent,"red")
|
enableCountryGrouping: true,
|
||||||
let coopsMarkersLayer = addMarkersEntries(entries["cooperatives"],entriesByCountry["cooperatives"],map,content,locale,addCoopPinContent,"blue")
|
}
|
||||||
let partiesMarkersLayer = addMarkersEntries(entries["parties"],entriesByCountry["parties"],map,content,locale,addPartyPinContent,"gold")
|
let groupsMarkersLayer = addMarkersEntries(entries["groups"],entriesByCountry["groups"],map,content,locale,addGroupPinContent,"green",options)
|
||||||
|
let communesMarkersLayer = addMarkersEntries(entries["communes"],entriesByCountry["communes"],map,content,locale,addCommunePinContent,"red",options)
|
||||||
|
let coopsMarkersLayer = addMarkersEntries(entries["cooperatives"],entriesByCountry["cooperatives"],map,content,locale,addCoopPinContent,"blue",options)
|
||||||
|
let partiesMarkersLayer = addMarkersEntries(entries["parties"],entriesByCountry["parties"],map,content,locale,addPartyPinContent,"gold",options)
|
||||||
|
|
||||||
let overlayMaps = {}
|
let overlayMaps = {}
|
||||||
overlayMaps[content.groups] = groupsMarkersLayer
|
overlayMaps[content.groups] = groupsMarkersLayer
|
||||||
|
|
|
@ -146,274 +146,6 @@
|
||||||
<style>
|
<style>
|
||||||
|
|
||||||
@import '/css/common.css';
|
@import '/css/common.css';
|
||||||
|
@import '/css/navbar.css';
|
||||||
/* Header */
|
|
||||||
#navbar{
|
|
||||||
position: relative;
|
|
||||||
top: 0;
|
|
||||||
width: min(100%,116rem);
|
|
||||||
z-index: 1000000000;
|
|
||||||
height: 5.26rem;
|
|
||||||
padding-left: 0rem;
|
|
||||||
padding-right: 0rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
#navbar * {
|
|
||||||
font-family: var(--sans-serif, sans-serif);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Logo */
|
|
||||||
#logo-container {
|
|
||||||
display: flex;
|
|
||||||
position: absolute;
|
|
||||||
margin-left: 1rem;
|
|
||||||
height: 100%;
|
|
||||||
max-height: 5.26rem;
|
|
||||||
color: black;
|
|
||||||
z-index: 1;
|
|
||||||
flex-direction: row;
|
|
||||||
flex-wrap: nowrap;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
#navbar-logo {
|
|
||||||
height: 3.5rem;
|
|
||||||
width: 3.5rem;
|
|
||||||
object-fit: contain;
|
|
||||||
border-radius: 10rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
#navbar-logo-text {
|
|
||||||
position: relative;
|
|
||||||
word-wrap: normal;
|
|
||||||
height: 100%;
|
|
||||||
line-height: 400%;
|
|
||||||
font-size: 1.4rem;
|
|
||||||
color: #292222;
|
|
||||||
font-family: var(--sans-serif, sans-serif);
|
|
||||||
font-weight: 400;
|
|
||||||
padding-left: 1.2rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Nav menu */
|
|
||||||
#nav {
|
|
||||||
position: fixed;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
background-color: white;
|
|
||||||
overflow: hidden;
|
|
||||||
z-index: 0;
|
|
||||||
}
|
|
||||||
#menu > li > a, .options-button {
|
|
||||||
display: block;
|
|
||||||
padding: 1.2rem;
|
|
||||||
padding-top: 1rem;
|
|
||||||
padding-bottom: 1rem;
|
|
||||||
color: black;
|
|
||||||
font-size: 1.4rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
#menu > li > a:active{
|
|
||||||
background-color: #f7aec0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#menu li {
|
|
||||||
list-style-type: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
#nav{
|
|
||||||
max-height: 0;
|
|
||||||
/*transition: max-height .5s ease-out;*/
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Menu Icon */
|
|
||||||
#hamb{
|
|
||||||
position: absolute;
|
|
||||||
cursor: pointer;
|
|
||||||
right: 0rem;
|
|
||||||
padding: 2.8rem 2rem;
|
|
||||||
z-index: 9999;
|
|
||||||
}/* Style label tag */
|
|
||||||
|
|
||||||
#hamb-line {
|
|
||||||
background: black;
|
|
||||||
display: block;
|
|
||||||
height: 2px;
|
|
||||||
position: relative;
|
|
||||||
width: 24px;
|
|
||||||
|
|
||||||
} /* Style span tag */
|
|
||||||
|
|
||||||
#hamb-line::before,
|
|
||||||
#hamb-line::after{
|
|
||||||
background: black;
|
|
||||||
content: '';
|
|
||||||
display: block;
|
|
||||||
height: 100%;
|
|
||||||
position: absolute;
|
|
||||||
transition: all .2s ease-out;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
#hamb-line::before{
|
|
||||||
top: 5px;
|
|
||||||
}
|
|
||||||
#hamb-line::after{
|
|
||||||
top: -5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#side-menu {
|
|
||||||
display: none;
|
|
||||||
} /* Hide checkbox */
|
|
||||||
|
|
||||||
/* Toggle menu icon */
|
|
||||||
#side-menu:checked ~ nav {
|
|
||||||
display: block;
|
|
||||||
max-height: 100%;
|
|
||||||
padding-top: 5.625rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
#side-menu:checked ~ #logo-container {
|
|
||||||
position: fixed;
|
|
||||||
}
|
|
||||||
|
|
||||||
#side-menu:checked ~ #hamb {
|
|
||||||
position: fixed;
|
|
||||||
}
|
|
||||||
|
|
||||||
#side-menu:checked ~ #logo-container {
|
|
||||||
position: fixed;
|
|
||||||
}
|
|
||||||
|
|
||||||
#side-menu:checked ~ #hamb #hamb-line {
|
|
||||||
background: transparent;
|
|
||||||
}
|
|
||||||
|
|
||||||
#side-menu:checked ~ #hamb #hamb-line::before {
|
|
||||||
transform: rotate(-45deg);
|
|
||||||
top: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#side-menu:checked ~ #hamb #hamb-line::after {
|
|
||||||
transform: rotate(45deg);
|
|
||||||
top: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Options */
|
|
||||||
|
|
||||||
.options-dropdown {
|
|
||||||
position: absolute;
|
|
||||||
display: none;
|
|
||||||
top: 5.6rem;
|
|
||||||
right: 1.8rem;
|
|
||||||
border: #404040 solid 0.1rem;
|
|
||||||
background-color: white;
|
|
||||||
z-index: 10;
|
|
||||||
}
|
|
||||||
|
|
||||||
.options-dropdown button, .options-dropdown a {
|
|
||||||
display: block;
|
|
||||||
font-family: var(--sans-serif,sans-serif);
|
|
||||||
font-size: 1.2rem;
|
|
||||||
width: 100%;
|
|
||||||
padding: 1rem;
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
.options-dropdown button:hover, .options-dropdown a:hover {
|
|
||||||
background-color: var(--red);
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
.options-button {
|
|
||||||
width: 100%;
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Localization */
|
|
||||||
|
|
||||||
#locales {
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
#locales button {
|
|
||||||
width: 100%;
|
|
||||||
text-align: left;
|
|
||||||
height: 4rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
#locales button:hover {
|
|
||||||
opacity: 0.5;
|
|
||||||
}
|
|
||||||
|
|
||||||
#locales-img {
|
|
||||||
position: relative;
|
|
||||||
top: 0rem;
|
|
||||||
height: 2rem;
|
|
||||||
margin-left: 1.2rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
#options-dropdown>:first-child {
|
|
||||||
padding-bottom: 0.5rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
#options-dropdown>:nth-child(2) {
|
|
||||||
padding-top: 0.5rem;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* Responsiveness */
|
|
||||||
@media only screen and (min-width: 1200px) {
|
|
||||||
|
|
||||||
#navbar {
|
|
||||||
position: relative;
|
|
||||||
width: min(100%,116rem);
|
|
||||||
left: 50%;
|
|
||||||
transform: translateX(-50%);
|
|
||||||
padding-right: 4rem;
|
|
||||||
padding-left: 4rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
#nav {
|
|
||||||
max-height: none;
|
|
||||||
top: 0;
|
|
||||||
position: relative;
|
|
||||||
float: right;
|
|
||||||
width: fit-content;
|
|
||||||
background-color: transparent;
|
|
||||||
overflow: visible;
|
|
||||||
}
|
|
||||||
|
|
||||||
#side-menu:checked ~ nav {
|
|
||||||
padding-top: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#menu li {
|
|
||||||
float: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
#menu > li > a:hover, .options-button:hover, #navbar-logo-text:hover {
|
|
||||||
color: rgb(127, 127, 127);
|
|
||||||
}
|
|
||||||
|
|
||||||
#menu > li > a, .options-button {
|
|
||||||
padding: 0.9rem;
|
|
||||||
padding-top: 1.9rem;
|
|
||||||
padding-bottom: 1.9rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
#hamb {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
#locales {
|
|
||||||
position: relative;
|
|
||||||
margin-right: 1.8rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
#locales-img {
|
|
||||||
top: 0.9rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
</style>
|
</style>
|
|
@ -147,274 +147,5 @@
|
||||||
<style>
|
<style>
|
||||||
|
|
||||||
@import '/css/common.css';
|
@import '/css/common.css';
|
||||||
|
@import '/css/navbar.css';
|
||||||
/* Header */
|
|
||||||
#navbar{
|
|
||||||
position: relative;
|
|
||||||
top: 0;
|
|
||||||
width: min(100%,116rem);
|
|
||||||
z-index: 1000000000;
|
|
||||||
height: 5.26rem;
|
|
||||||
padding-left: 0rem;
|
|
||||||
padding-right: 0rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
#navbar * {
|
|
||||||
font-family: var(--sans-serif, sans-serif);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Logo */
|
|
||||||
#logo-container {
|
|
||||||
display: flex;
|
|
||||||
position: absolute;
|
|
||||||
margin-left: 1rem;
|
|
||||||
height: 100%;
|
|
||||||
max-height: 5.26rem;
|
|
||||||
color: black;
|
|
||||||
z-index: 1;
|
|
||||||
flex-direction: row;
|
|
||||||
flex-wrap: nowrap;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
#navbar-logo {
|
|
||||||
height: 3.5rem;
|
|
||||||
width: 3.5rem;
|
|
||||||
object-fit: contain;
|
|
||||||
border-radius: 10rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
#navbar-logo-text {
|
|
||||||
position: relative;
|
|
||||||
word-wrap: normal;
|
|
||||||
height: 100%;
|
|
||||||
line-height: 400%;
|
|
||||||
font-size: 1.4rem;
|
|
||||||
color: #292222;
|
|
||||||
font-family: var(--sans-serif, sans-serif);
|
|
||||||
font-weight: 400;
|
|
||||||
padding-left: 1.2rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Nav menu */
|
|
||||||
#nav {
|
|
||||||
position: fixed;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
background-color: white;
|
|
||||||
overflow: hidden;
|
|
||||||
z-index: 0;
|
|
||||||
}
|
|
||||||
#menu > li > a, .options-button {
|
|
||||||
display: block;
|
|
||||||
padding: 1.2rem;
|
|
||||||
padding-top: 1rem;
|
|
||||||
padding-bottom: 1rem;
|
|
||||||
color: black;
|
|
||||||
font-size: 1.4rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
#menu > li > a:active{
|
|
||||||
background-color: #f7aec0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#menu li {
|
|
||||||
list-style-type: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
#nav{
|
|
||||||
max-height: 0;
|
|
||||||
/*transition: max-height .5s ease-out;*/
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Menu Icon */
|
|
||||||
#hamb{
|
|
||||||
position: absolute;
|
|
||||||
cursor: pointer;
|
|
||||||
right: 0rem;
|
|
||||||
padding: 2.8rem 2rem;
|
|
||||||
z-index: 9999;
|
|
||||||
}/* Style label tag */
|
|
||||||
|
|
||||||
#hamb-line {
|
|
||||||
background: black;
|
|
||||||
display: block;
|
|
||||||
height: 2px;
|
|
||||||
position: relative;
|
|
||||||
width: 24px;
|
|
||||||
|
|
||||||
} /* Style span tag */
|
|
||||||
|
|
||||||
#hamb-line::before,
|
|
||||||
#hamb-line::after{
|
|
||||||
background: black;
|
|
||||||
content: '';
|
|
||||||
display: block;
|
|
||||||
height: 100%;
|
|
||||||
position: absolute;
|
|
||||||
transition: all .2s ease-out;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
#hamb-line::before{
|
|
||||||
top: 5px;
|
|
||||||
}
|
|
||||||
#hamb-line::after{
|
|
||||||
top: -5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#side-menu {
|
|
||||||
display: none;
|
|
||||||
} /* Hide checkbox */
|
|
||||||
|
|
||||||
/* Toggle menu icon */
|
|
||||||
#side-menu:checked ~ nav {
|
|
||||||
display: block;
|
|
||||||
max-height: 100%;
|
|
||||||
padding-top: 5.625rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
#side-menu:checked ~ #logo-container {
|
|
||||||
position: fixed;
|
|
||||||
}
|
|
||||||
|
|
||||||
#side-menu:checked ~ #hamb {
|
|
||||||
position: fixed;
|
|
||||||
}
|
|
||||||
|
|
||||||
#side-menu:checked ~ #logo-container {
|
|
||||||
position: fixed;
|
|
||||||
}
|
|
||||||
|
|
||||||
#side-menu:checked ~ #hamb #hamb-line {
|
|
||||||
background: transparent;
|
|
||||||
}
|
|
||||||
|
|
||||||
#side-menu:checked ~ #hamb #hamb-line::before {
|
|
||||||
transform: rotate(-45deg);
|
|
||||||
top: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#side-menu:checked ~ #hamb #hamb-line::after {
|
|
||||||
transform: rotate(45deg);
|
|
||||||
top: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Options */
|
|
||||||
|
|
||||||
.options-dropdown {
|
|
||||||
position: absolute;
|
|
||||||
display: none;
|
|
||||||
top: 5.6rem;
|
|
||||||
right: 1.8rem;
|
|
||||||
border: #404040 solid 0.1rem;
|
|
||||||
background-color: white;
|
|
||||||
z-index: 10;
|
|
||||||
}
|
|
||||||
|
|
||||||
.options-dropdown button, .options-dropdown a {
|
|
||||||
display: block;
|
|
||||||
font-family: var(--sans-serif,sans-serif);
|
|
||||||
font-size: 1.2rem;
|
|
||||||
width: 100%;
|
|
||||||
padding: 1rem;
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
.options-dropdown button:hover, .options-dropdown a:hover {
|
|
||||||
background-color: var(--red);
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
.options-button {
|
|
||||||
width: 100%;
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Localization */
|
|
||||||
|
|
||||||
#locales {
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
#locales button {
|
|
||||||
width: 100%;
|
|
||||||
text-align: left;
|
|
||||||
height: 4rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
#locales button:hover {
|
|
||||||
opacity: 0.5;
|
|
||||||
}
|
|
||||||
|
|
||||||
#locales-img {
|
|
||||||
position: relative;
|
|
||||||
top: 0rem;
|
|
||||||
height: 2rem;
|
|
||||||
margin-left: 1.2rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
#options-dropdown>:first-child {
|
|
||||||
padding-bottom: 0.5rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
#options-dropdown>:nth-child(2) {
|
|
||||||
padding-top: 0.5rem;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* Responsiveness */
|
|
||||||
@media only screen and (min-width: 1200px) {
|
|
||||||
|
|
||||||
#navbar {
|
|
||||||
position: relative;
|
|
||||||
width: min(100%,116rem);
|
|
||||||
left: 50%;
|
|
||||||
transform: translateX(-50%);
|
|
||||||
padding-right: 4rem;
|
|
||||||
padding-left: 4rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
#nav {
|
|
||||||
max-height: none;
|
|
||||||
top: 0;
|
|
||||||
position: relative;
|
|
||||||
float: right;
|
|
||||||
width: fit-content;
|
|
||||||
background-color: transparent;
|
|
||||||
overflow: visible;
|
|
||||||
}
|
|
||||||
|
|
||||||
#side-menu:checked ~ nav {
|
|
||||||
padding-top: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#menu li {
|
|
||||||
float: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
#menu > li > a:hover, .options-button:hover, #navbar-logo-text:hover {
|
|
||||||
color: rgb(127, 127, 127);
|
|
||||||
}
|
|
||||||
|
|
||||||
#menu > li > a, .options-button {
|
|
||||||
padding: 0.9rem;
|
|
||||||
padding-top: 1.9rem;
|
|
||||||
padding-bottom: 1.9rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
#hamb {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
#locales {
|
|
||||||
position: relative;
|
|
||||||
margin-right: 1.8rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
#locales-img {
|
|
||||||
top: 0.9rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
</style>
|
</style>
|
|
@ -14,7 +14,16 @@
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<h3>Under development</h3>
|
||||||
|
|
||||||
|
<p style=" position: relative; margin-top: 2rem;">Visit <a href="https://discord.gg/Qk8KUk787z" style="color: #c52a28;">https://discord.gg/Qk8KUk787z</a> and ask for your commune to be added.</p>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|
||||||
|
@import '/css/common.css';
|
||||||
|
|
||||||
|
h3 {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
// Import libraries
|
// Import libraries
|
||||||
import { onMount, afterUpdate, setContext } from 'svelte'
|
import { onMount, afterUpdate, setContext } from 'svelte'
|
||||||
|
import { writable } from 'svelte/store'
|
||||||
import * as AuthTools from "/js/libraries/authTools.js"
|
import * as AuthTools from "/js/libraries/authTools.js"
|
||||||
import {svgFromObject} from "/js/libraries/miscTools.js"
|
import {svgFromObject} from "/js/libraries/miscTools.js"
|
||||||
|
|
||||||
|
@ -11,6 +12,10 @@
|
||||||
import "/js/components/pane-aligner.js"
|
import "/js/components/pane-aligner.js"
|
||||||
import "/js/components/profile-general.js"
|
import "/js/components/profile-general.js"
|
||||||
import "/js/components/profile-groups.js"
|
import "/js/components/profile-groups.js"
|
||||||
|
import "/js/components/profile-communes.js"
|
||||||
|
import "/js/components/profile-coops.js"
|
||||||
|
import "/js/components/profile-parties.js"
|
||||||
|
import "/js/components/groups-add-component.js"
|
||||||
|
|
||||||
// Main code
|
// Main code
|
||||||
AuthTools.redirectNotLogged()
|
AuthTools.redirectNotLogged()
|
||||||
|
@ -22,6 +27,7 @@
|
||||||
let coops
|
let coops
|
||||||
let parties
|
let parties
|
||||||
let panes
|
let panes
|
||||||
|
let groupsAdd
|
||||||
|
|
||||||
let generalButton
|
let generalButton
|
||||||
let groupsButton
|
let groupsButton
|
||||||
|
@ -29,11 +35,17 @@
|
||||||
let coopsButton
|
let coopsButton
|
||||||
let partiesButton
|
let partiesButton
|
||||||
let buttons
|
let buttons
|
||||||
|
|
||||||
|
let currentPaneIndex = 0
|
||||||
|
|
||||||
let locationPopup
|
let locationPopup
|
||||||
|
|
||||||
|
let maps = {}
|
||||||
|
|
||||||
let user = {}
|
let user = {}
|
||||||
AuthTools.getUser(user)
|
let loaded = writable(0)
|
||||||
|
let reloadTriggerVal = writable(0)
|
||||||
|
AuthTools.getUser(user,loaded)
|
||||||
|
|
||||||
function changePane(pane,button) {
|
function changePane(pane,button) {
|
||||||
for (let p of panes) {
|
for (let p of panes) {
|
||||||
|
@ -48,10 +60,24 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function styleField(div,weight,color) {
|
function styleField(div,weight,color) {
|
||||||
div.style.fontWeight = weight
|
|
||||||
let svgObject = div.querySelector("object")
|
let svgObject = div.querySelector("object")
|
||||||
let svgItem = svgFromObject(svgObject)
|
if (svgObject==null) {
|
||||||
svgItem.setAttribute("fill", color)
|
let f = () => styleField(div,weight,color)
|
||||||
|
setTimeout(f,100)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
let svgItem = svgFromObject(svgObject)
|
||||||
|
if (svgItem==null) {
|
||||||
|
let f = () => styleField(div,weight,color)
|
||||||
|
setTimeout(f,100)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
div.style.fontWeight = weight
|
||||||
|
svgItem.setAttribute("fill", color)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function fillFields() {
|
function fillFields() {
|
||||||
|
@ -59,37 +85,54 @@
|
||||||
for (let b of buttons) {
|
for (let b of buttons) {
|
||||||
styleField(b,400,"#636363")
|
styleField(b,400,"#636363")
|
||||||
}
|
}
|
||||||
styleField(generalButton,500,"#c52a28")
|
styleField(buttons[currentPaneIndex],500,"#c52a28")
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
setTimeout(fillFields, 100)
|
setTimeout(fillFields, 100)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function showLocationOverlay() {
|
function valid(el) {
|
||||||
locationPopup.style.display = "block"
|
return (el!=undefined) && (el!=null)
|
||||||
}
|
}
|
||||||
|
|
||||||
setContext("profile-component",showLocationOverlay)
|
function init() {
|
||||||
|
|
||||||
onMount(() => {
|
|
||||||
general.user = user
|
|
||||||
|
|
||||||
panes = [general,groups,communes,coops,parties]
|
panes = [general,groups,communes,coops,parties]
|
||||||
buttons = [generalButton,groupsButton,communesButton,coopsButton,partiesButton]
|
buttons = [generalButton,groupsButton,communesButton,coopsButton,partiesButton]
|
||||||
|
if ($loaded==1 && panes.every(x => valid(x)) && buttons.every(x => valid(x))) {
|
||||||
|
panes = [general,groups,communes,coops,parties]
|
||||||
|
buttons = [generalButton,groupsButton,communesButton,coopsButton,partiesButton]
|
||||||
|
|
||||||
fillFields()
|
fillFields()
|
||||||
general.style.display = "initial"
|
general.style.display = "initial"
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
let f = () => init()
|
||||||
|
setTimeout(f,100)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function reloadTrigger() {
|
||||||
|
reloadTriggerVal.update((val) => {
|
||||||
|
return val + 1
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
setContext("profile-component",{user,maps,reloadTrigger})
|
||||||
|
|
||||||
|
onMount(() => {
|
||||||
|
init()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<!--
|
||||||
<div bind:this={locationPopup} class="overlay" style="display: none">
|
<div bind:this={locationPopup} class="overlay" style="display: none">
|
||||||
<div id="location-overlay-content">
|
<div id="location-overlay-content">
|
||||||
<p>wegwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww</p>
|
|
||||||
</div>
|
</div>
|
||||||
<button class="overlay-button" on:click={() => locationPopup.style.display = "none"}></button>
|
<button class="overlay-button" on:click={() => locationPopup.style.display = "none"}></button>
|
||||||
</div>
|
</div>
|
||||||
|
-->
|
||||||
<pane-aligner>
|
<pane-aligner>
|
||||||
<div id="left-column" class="pane" slot="sidebar-left" bind:this={root}>
|
<div id="left-column" class="pane" slot="sidebar-left" bind:this={root}>
|
||||||
<button bind:this={generalButton} on:click={() => changePane(general,generalButton)}>
|
<button bind:this={generalButton} on:click={() => changePane(general,generalButton)}>
|
||||||
|
@ -118,11 +161,15 @@
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div id="main-column" slot="main">
|
<div id="main-column" slot="main">
|
||||||
<profile-general bind:this={general} style="display: none;"></profile-general>
|
{#key $loaded}
|
||||||
<profile-groups bind:this={groups} style="display: none;"></profile-groups>
|
{#if $loaded==1}
|
||||||
<profile-communes bind:this={communes} style="display: none;"></profile-communes>
|
<profile-general bind:this={general} style="display: none;"></profile-general>
|
||||||
<profile-coops bind:this={coops} style="display: none;"></profile-coops>
|
<profile-groups bind:this={groups} style="display: none;"></profile-groups>
|
||||||
<profile-parties bind:this={parties} style="display: none;"></profile-parties>
|
<profile-communes bind:this={communes} style="display: none;"></profile-communes>
|
||||||
|
<profile-coops bind:this={coops} style="display: none;"></profile-coops>
|
||||||
|
<profile-parties bind:this={parties} style="display: none;"></profile-parties>
|
||||||
|
{/if}
|
||||||
|
{/key}
|
||||||
</div>
|
</div>
|
||||||
</pane-aligner>
|
</pane-aligner>
|
||||||
|
|
||||||
|
@ -131,34 +178,6 @@
|
||||||
|
|
||||||
@import '/css/common.css';
|
@import '/css/common.css';
|
||||||
|
|
||||||
#location-overlay-content {
|
|
||||||
position: absolute;
|
|
||||||
top: 50%;
|
|
||||||
left: 50%;
|
|
||||||
transform: translate(-50%, -50%);
|
|
||||||
height: 40rem;
|
|
||||||
width: 40rem;
|
|
||||||
background: white;
|
|
||||||
z-index: 10000;
|
|
||||||
}
|
|
||||||
|
|
||||||
.overlay {
|
|
||||||
top: 0;
|
|
||||||
position: absolute;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
z-index: 10000;
|
|
||||||
}
|
|
||||||
|
|
||||||
.overlay-button {
|
|
||||||
position: absolute;
|
|
||||||
background: gray;
|
|
||||||
opacity: 0.5;
|
|
||||||
width: 100vw;
|
|
||||||
height: 100vh;
|
|
||||||
z-index: 1000;
|
|
||||||
}
|
|
||||||
|
|
||||||
#general-img {
|
#general-img {
|
||||||
top: 0rem;
|
top: 0rem;
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,16 @@
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<h3>Under development</h3>
|
||||||
|
|
||||||
|
<p style=" position: relative; margin-top: 2rem;">Visit <a href="https://discord.gg/Qk8KUk787z" style="color: #c52a28;">https://discord.gg/Qk8KUk787z</a> and ask for your cooperative to be added.</p>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|
||||||
|
@import '/css/common.css';
|
||||||
|
|
||||||
|
h3 {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
|
@ -3,7 +3,7 @@
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
// Import statements
|
// Import statements
|
||||||
import { onMount, setContext } from 'svelte'
|
import { onMount, getContext } from 'svelte'
|
||||||
import * as AuthTools from "/js/libraries/authTools.js"
|
import * as AuthTools from "/js/libraries/authTools.js"
|
||||||
|
|
||||||
//Import components
|
//Import components
|
||||||
|
@ -11,7 +11,6 @@
|
||||||
import "/js/components/switch-component.js"
|
import "/js/components/switch-component.js"
|
||||||
|
|
||||||
//Export statements
|
//Export statements
|
||||||
export let user = null
|
|
||||||
|
|
||||||
// Main code
|
// Main code
|
||||||
let emailInput
|
let emailInput
|
||||||
|
@ -30,6 +29,9 @@
|
||||||
let emailInputDiv
|
let emailInputDiv
|
||||||
let prevEmail
|
let prevEmail
|
||||||
|
|
||||||
|
let context = getContext("profile-component")
|
||||||
|
let user = context.user
|
||||||
|
|
||||||
function showSaveButton(button) {
|
function showSaveButton(button) {
|
||||||
prevEmail = emailInput.value
|
prevEmail = emailInput.value
|
||||||
button.style.display = "initial"
|
button.style.display = "initial"
|
||||||
|
@ -166,11 +168,27 @@
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div>
|
||||||
|
<div id="verifiedDiv">
|
||||||
|
<span>Verified:</span>
|
||||||
|
<span style="color: {user.verified ? "green" : "red"}">{user.verified}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
@import '/css/common.css';
|
@import '/css/common.css';
|
||||||
|
|
||||||
|
#verifiedDiv {
|
||||||
|
display: inline;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
height: 2rem;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
/*---General section-----------------------------------------------------------*/
|
/*---General section-----------------------------------------------------------*/
|
||||||
|
|
||||||
.ghost-input {
|
.ghost-input {
|
||||||
|
|
|
@ -5,20 +5,24 @@
|
||||||
// Import statements
|
// Import statements
|
||||||
import { onMount, getContext } from 'svelte'
|
import { onMount, getContext } from 'svelte'
|
||||||
import { writable } from 'svelte/store'
|
import { writable } from 'svelte/store'
|
||||||
import { getData } from "/js/libraries/serverTools.js"
|
import { getData, sendData } from "/js/libraries/serverTools.js"
|
||||||
|
|
||||||
//Import components
|
//Import components
|
||||||
import "/js/components/select-component.js"
|
import "/js/components/select-component.js"
|
||||||
import "/js/components/switch-component.js"
|
import "/js/components/switch-component.js"
|
||||||
|
|
||||||
//Export statements
|
//Export statements
|
||||||
export let groups = null
|
|
||||||
|
|
||||||
// Main code
|
// Main code
|
||||||
let section
|
let section
|
||||||
let user_groups
|
let userGroups = []
|
||||||
|
let groupsRequests = []
|
||||||
let content = writable({})
|
let content = writable({})
|
||||||
let loaded = writable(0)
|
let loaded = writable(0)
|
||||||
|
let keyRequests = 0
|
||||||
|
let numLoaded = 2
|
||||||
|
let mainPane
|
||||||
|
let groupsAdd
|
||||||
|
|
||||||
let membersInput
|
let membersInput
|
||||||
let saveMembersButton
|
let saveMembersButton
|
||||||
|
@ -30,22 +34,46 @@
|
||||||
|
|
||||||
let locale = "en"
|
let locale = "en"
|
||||||
|
|
||||||
|
let inputLocation
|
||||||
let inputContact
|
let inputContact
|
||||||
let inputMembers
|
let inputMembers
|
||||||
|
let pencilMembers
|
||||||
|
let pencilContact
|
||||||
|
let pencilButtonMembers
|
||||||
|
let pencilButtonContact
|
||||||
|
|
||||||
|
let myGroupLocation
|
||||||
|
let myGroupStatus
|
||||||
|
|
||||||
|
let context = getContext("profile-component")
|
||||||
|
let maps = context.maps
|
||||||
|
|
||||||
function groups_callback(response) {
|
function groups_callback(response) {
|
||||||
user_groups = JSON.parse(response)
|
userGroups = JSON.parse(response)
|
||||||
inputContact = getContact(user_groups[0].contact)
|
context["userGroups"] = userGroups
|
||||||
inputMembers = user_groups[0].members
|
|
||||||
loaded.update((val) => {
|
loaded.update((val) => {
|
||||||
return val + 1
|
return val + 1
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
getData("/xx/get_user_groups",groups_callback)
|
getData("/xx/get-user-groups",groups_callback)
|
||||||
|
|
||||||
|
function requests_callback(response) {
|
||||||
|
let parsed = JSON.parse(response)
|
||||||
|
groupsRequests.push(...parsed)
|
||||||
|
loaded.update((val) => {
|
||||||
|
return val + 1
|
||||||
|
})
|
||||||
|
}
|
||||||
|
getData("/xx/get-group-requests",requests_callback)
|
||||||
|
|
||||||
function getAddress(g) {
|
function getAddress(g) {
|
||||||
let location = [g.country,g.state,g.town].filter(x => x!=null)
|
if (g!=undefined) {
|
||||||
return location.map(x => locale=="en" ? x : translate($content,x)).join(", ")
|
let location = [g.country,g.state,g.town].filter(x => x!=null)
|
||||||
|
return location.map(x => locale=="en" ? x : translate($content,x)).join(", ")
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return "Create or join group"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getContact(c) {
|
function getContact(c) {
|
||||||
|
@ -65,8 +93,10 @@
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function showSaveButton(button) {
|
function showSaveButton(button,input) {
|
||||||
button.style.display = "initial"
|
if (!input.readOnly) {
|
||||||
|
button.style.display = "initial"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function resetMembersField() {
|
function resetMembersField() {
|
||||||
|
@ -89,73 +119,178 @@
|
||||||
|
|
||||||
function saveContact() {}
|
function saveContact() {}
|
||||||
|
|
||||||
let showLocationOverlay = getContext("profile-component")
|
function updateUserGroup(newInfo) {
|
||||||
|
if (newInfo!=undefined) {
|
||||||
|
myGroupLocation.innerHTML = getAddress(newInfo)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onMount(() => {
|
function onLoadedGroups() {
|
||||||
|
let els = [saveMembersButton,saveContactButton,membersInputDiv,contactInputDiv]
|
||||||
document.addEventListener("click", function(event) {
|
if ($loaded==numLoaded && els.every(x => x!=undefined && x!=null)) {
|
||||||
if (membersInputDiv.focused) {
|
document.addEventListener("click", function(event) {
|
||||||
resetContactField()
|
let activeEl
|
||||||
}
|
let shadowRoot = this.activeElement.shadowRoot
|
||||||
else if (contactInputDiv.focused) {
|
if (shadowRoot!=null) {
|
||||||
resetMembersField()
|
activeEl = shadowRoot.activeElement
|
||||||
|
shadowRoot = activeEl.shadowRoot
|
||||||
|
if (shadowRoot!=null) {
|
||||||
|
activeEl = shadowRoot.activeElement
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (activeEl == membersInput || activeEl == saveMembersButton) {
|
||||||
|
resetContactField()
|
||||||
|
}
|
||||||
|
else if (activeEl == contactInput || activeEl == saveContactButton) {
|
||||||
|
resetMembersField()
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
resetMembersField()
|
||||||
|
resetContactField()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
context["updateUserGroup"] = updateUserGroup
|
||||||
|
inputLocation = getAddress(userGroups[0])
|
||||||
|
if (userGroups.length==0) {
|
||||||
|
inputContact = ""
|
||||||
|
inputMembers = ""
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
resetMembersField()
|
let group = userGroups[0]
|
||||||
resetContactField()
|
|
||||||
|
inputContact = getContact(group.contact)
|
||||||
|
inputMembers = group.members
|
||||||
|
let status = group.status
|
||||||
|
if (status!=undefined) {
|
||||||
|
if (status==0) {
|
||||||
|
myGroupStatus.innerHTML = "(pending)"
|
||||||
|
myGroupStatus.style.color = "#FFC90E"
|
||||||
|
}
|
||||||
|
else if (status==2) {
|
||||||
|
myGroupStatus.innerHTML = "(rejected)"
|
||||||
|
myGroupStatus.style.color = "#c52a28"
|
||||||
|
}
|
||||||
|
pencilMembers.style.display = "none"
|
||||||
|
pencilContact.style.display = "none"
|
||||||
|
pencilButtonContact.style.cursor = "default"
|
||||||
|
pencilButtonMembers.style.cursor = "default"
|
||||||
|
membersInput.readOnly = true
|
||||||
|
contactInput.readOnly = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
|
else {
|
||||||
|
let f = () => onLoadedGroups()
|
||||||
|
setTimeout(f, 100)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function focus(el) {
|
||||||
|
el.focus()
|
||||||
|
el.click()
|
||||||
|
}
|
||||||
|
|
||||||
|
function approveRequest(ind,user_id) {
|
||||||
|
sendData("/xx/group-approve-request",{user_id: user_id})
|
||||||
|
groupsRequests.splice(ind,1)
|
||||||
|
keyRequests = keyRequests + 1
|
||||||
|
}
|
||||||
|
|
||||||
|
function rejectRequest(ind,user_id) {
|
||||||
|
sendData("/xx/group-reject-request",{user_id: user_id})
|
||||||
|
groupsRequests.splice(ind,1)
|
||||||
|
keyRequests = keyRequests + 1
|
||||||
|
}
|
||||||
|
|
||||||
|
function launchGroupsAdd() {
|
||||||
|
groupsAdd.style.display = "block"
|
||||||
|
mainPane.style.display = "none"
|
||||||
|
if (maps["groupsAdd"]!=undefined) {
|
||||||
|
maps["groupsAdd"].invalidateSize()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function closeGroupsAdd() {
|
||||||
|
groupsAdd.style.display = "none"
|
||||||
|
mainPane.style.display = "block"
|
||||||
|
}
|
||||||
|
|
||||||
|
context["onLoadedGroups"] = onLoadedGroups
|
||||||
|
context["launchGroupsAdd"] = launchGroupsAdd
|
||||||
|
context["closeGroupsAdd"] = closeGroupsAdd
|
||||||
|
|
||||||
|
onMount(() => {
|
||||||
|
onLoadedGroups()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#key $loaded}
|
{#key $loaded}
|
||||||
{#if $loaded==1}
|
{#if $loaded==numLoaded}
|
||||||
|
<div bind:this={mainPane}>
|
||||||
<h2>Groups</h2>
|
<h2>Groups</h2>
|
||||||
<h3>My group</h3>
|
|
||||||
<section bind:this={section} class="entries-section">
|
|
||||||
<div>
|
<div>
|
||||||
<div class="change-field-line">
|
<h3 class="group-heading">My group</h3>
|
||||||
<span>Location:</span>
|
<span bind:this={myGroupStatus} class="status"></span>
|
||||||
<div class="change-field-div">
|
</div>
|
||||||
<button class="change-field-button" on:click={launchChangeLocation}>{getAddress(user_groups[0])}
|
<section bind:this={section} class="entries-section">
|
||||||
<object type="image/svg+xml" data="/img/profile/icons/pencil.svg" title="pencil-icon" class="pencil"></object>
|
<div>
|
||||||
</button>
|
<div class="change-field-line">
|
||||||
|
<span>Location:</span>
|
||||||
|
<div class="change-field-div">
|
||||||
|
<button class="change-field-button" bind:this={myGroupLocation} on:click={launchGroupsAdd}>{inputLocation}
|
||||||
|
<object type="image/svg+xml" data="/img/profile/icons/pencil.svg" title="pencil-icon" class="pencil"></object>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div>
|
||||||
<div>
|
<div class="change-field-line">
|
||||||
<div class="change-field-line">
|
<span>Members:</span>
|
||||||
<span>Members:</span>
|
<div bind:this={membersInputDiv} class="change-field-div input-pencil">
|
||||||
<div bind:this={membersInputDiv} class="change-field-div input-pencil">
|
<div class="save-button-wrapper">
|
||||||
<button bind:this={saveMembersButton} class="save-button" on:click={saveMembers}>save</button>
|
<button bind:this={saveMembersButton} on:click={saveMembers} class="save-button" style="display: none">save</button>
|
||||||
<input bind:this={membersInput} id="membersInput" class="text-input" type="text" bind:value={inputMembers} on:click={() => showSaveButton(saveMembersButton)}>
|
</div>
|
||||||
<button class="text-input-pencil-button" on:click={() => membersInput.focus()}>
|
<input bind:this={membersInput} id="membersInput" class="text-input" type="text" bind:value={inputMembers} on:click={() => showSaveButton(saveMembersButton,membersInput)}>
|
||||||
<object type="image/svg+xml" data="/img/profile/icons/pencil.svg" title="pencil-icon" class="pencil"></object>
|
<button bind:this={pencilButtonMembers} class="text-input-pencil-button" on:click={() => {focus(membersInput)}}>
|
||||||
</button>
|
<object bind:this={pencilMembers} type="image/svg+xml" data="/img/profile/icons/pencil.svg" title="pencil-icon" class="pencil"></object>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div>
|
||||||
<div>
|
<div class="change-field-line">
|
||||||
<div class="change-field-line">
|
<span>Contact:</span>
|
||||||
<span>Contact:</span>
|
<div bind:this={contactInputDiv} class="change-field-div input-pencil">
|
||||||
<div bind:this={contactInputDiv} class="change-field-div input-pencil">
|
<div class="save-button-wrapper">
|
||||||
<button bind:this={saveContactButton} class="save-button" on:click={saveContact}>save</button>
|
<button bind:this={saveContactButton} on:click={saveContact} class="save-button" style="display: none">save</button>
|
||||||
<input bind:this={contactInput} id="contactInput" class="text-input" type="text" bind:value={inputContact} on:click={() => showSaveButton(saveContactButton)}>
|
</div>
|
||||||
<button class="text-input-pencil-button" on:click={() => contactInput.focus()}>
|
<input bind:this={contactInput} id="contactInput" class="text-input" type="text" bind:value={inputContact} on:click={() => showSaveButton(saveContactButton,contactInput)}>
|
||||||
<object type="image/svg+xml" data="/img/profile/icons/pencil.svg" title="pencil-icon" class="pencil"></object>
|
<button bind:this={pencilButtonContact} class="text-input-pencil-button" on:click={focus(contactInput)}>
|
||||||
</button>
|
<object bind:this={pencilContact} type="image/svg+xml" data="/img/profile/icons/pencil.svg" title="pencil-icon" class="pencil"></object>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</section>
|
||||||
</section>
|
<h3>Requests</h3>
|
||||||
<h3>Requests</h3>
|
<section bind:this={section} class="entries-section">
|
||||||
<section bind:this={section} class="entries-section">
|
{#key keyRequests}
|
||||||
|
{#each groupsRequests as req,ind}
|
||||||
</section>
|
<div>
|
||||||
|
<div class="change-field-line">
|
||||||
|
<span>{req.email}</span>
|
||||||
|
<div class="request-button-wrapper">
|
||||||
|
<button on:click={() => approveRequest(ind,req.user_id)} class="approve-button">approve</button>
|
||||||
|
<button on:click={() => rejectRequest(ind,req.user_id)} class="approve-button" style="display:visible">reject</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{/each}
|
||||||
|
{/key}
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
<!--Helper panes-->
|
||||||
|
<groups-add-component bind:this={groupsAdd} style="display: none;"></groups-add-component>
|
||||||
{/if}
|
{/if}
|
||||||
{/key}
|
{/key}
|
||||||
|
|
||||||
|
@ -163,10 +298,42 @@
|
||||||
<style>
|
<style>
|
||||||
@import '/css/common.css';
|
@import '/css/common.css';
|
||||||
|
|
||||||
|
.request-button-wrapper {
|
||||||
|
display: flex;
|
||||||
|
gap: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.approve-button {
|
||||||
|
height: 2.7rem;
|
||||||
|
padding: 0rem 1rem;
|
||||||
|
font-family: var(--sans-serif,sans-serif);
|
||||||
|
font-size: 1.15rem;
|
||||||
|
color: white;
|
||||||
|
background-color: var(--red);
|
||||||
|
border-color: var(--red);
|
||||||
|
border-radius: 0.5rem;
|
||||||
|
margin-top: -0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.group-heading {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status {
|
||||||
|
display: inline-block;
|
||||||
|
font-size: 1.15rem;
|
||||||
|
font-family: var(--sans-serif,sans-serif);
|
||||||
|
margin-left: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
input {
|
||||||
|
font-family: var(--sans-serif,sans-serif)
|
||||||
|
}
|
||||||
|
|
||||||
.text-input-pencil-button {
|
.text-input-pencil-button {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
position: relative;
|
position: relative;
|
||||||
height: 2.3rem;
|
height: 2.7rem;
|
||||||
width: 2rem;
|
width: 2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -187,10 +354,10 @@
|
||||||
direction: rtl;
|
direction: rtl;
|
||||||
border: 0;
|
border: 0;
|
||||||
outline: none;
|
outline: none;
|
||||||
bottom: 0.341rem;
|
height: 2.7rem;
|
||||||
position: relative;
|
font-style: var(--sans-serif,sans-serif);
|
||||||
top: 0.1rem;
|
background: transparent;
|
||||||
font-style: var(--sans-serif,sans-serif)
|
margin-top: -0.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
#membersInput {
|
#membersInput {
|
||||||
|
@ -202,17 +369,24 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.save-button {
|
.save-button {
|
||||||
position: relative;
|
position: absolute;
|
||||||
bottom: 0.34rem;
|
right: 0;
|
||||||
|
top: -0.4rem;
|
||||||
margin-right: 0.6rem;
|
margin-right: 0.6rem;
|
||||||
height: 2.73rem;
|
height: 2.7rem;
|
||||||
width: 4.778rem;
|
width: 5rem;
|
||||||
font-family: var(--sans-serif,sans-serif);
|
font-family: var(--sans-serif,sans-serif);
|
||||||
font-size: 1.15rem;
|
font-size: 1.15rem;
|
||||||
color: white;
|
color: white;
|
||||||
background-color: var(--red);
|
background-color: var(--red);
|
||||||
border-color: var(--red);
|
border-color: var(--red);
|
||||||
border-radius: 0.512rem;
|
border-radius: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.save-button-wrapper {
|
||||||
|
display: inline-block;
|
||||||
|
position: relative;
|
||||||
|
height: 2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
h2 {
|
h2 {
|
||||||
|
@ -248,12 +422,14 @@
|
||||||
|
|
||||||
.change-field-div {
|
.change-field-div {
|
||||||
width: max-content;
|
width: max-content;
|
||||||
|
position: relative;
|
||||||
|
display: flex;
|
||||||
}
|
}
|
||||||
|
|
||||||
.change-field-button {
|
.change-field-button {
|
||||||
position: relative;
|
position: relative;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
height: 2.73rem;
|
height: 2.7rem;
|
||||||
font-size: 1.15rem;
|
font-size: 1.15rem;
|
||||||
font-family: var(--sans-serif,sans-serif);
|
font-family: var(--sans-serif,sans-serif);
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
|
@ -270,31 +446,10 @@
|
||||||
h3 {
|
h3 {
|
||||||
margin-bottom: 0.5rem;
|
margin-bottom: 0.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.entry-container {
|
|
||||||
margin-top: 0.5rem;
|
|
||||||
margin-bottom: 0.5rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.entry {
|
|
||||||
font-family: var(--sans-serif,sans-serif);
|
|
||||||
font-size: 1.15rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
span {
|
span {
|
||||||
font-family: var(--sans-serif,sans-serif);
|
font-family: var(--sans-serif,sans-serif);
|
||||||
font-size: 1.15rem;
|
font-size: 1.15rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
#groups-section {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
|
|
||||||
#groups-section h2 {
|
|
||||||
margin: auto;
|
|
||||||
margin-top: 0;
|
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
</style>
|
</style>
|
|
@ -14,7 +14,16 @@
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<h3>Under development</h3>
|
||||||
|
|
||||||
|
<p style=" position: relative; margin-top: 2rem;">Visit <a href="https://discord.gg/Qk8KUk787z" style="color: #c52a28;">https://discord.gg/Qk8KUk787z</a> and ask for your party to be added.</p>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|
||||||
|
@import '/css/common.css';
|
||||||
|
|
||||||
|
h3 {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
|
@ -2,6 +2,9 @@ module CreateTableGroups
|
||||||
|
|
||||||
import SearchLight.Migrations: create_table, column, primary_key, add_index, drop_table
|
import SearchLight.Migrations: create_table, column, primary_key, add_index, drop_table
|
||||||
|
|
||||||
|
include("../../lib/DatabaseSupport.jl")
|
||||||
|
import .DatabaseSupport: add_foreign_key, add_index
|
||||||
|
|
||||||
function up()
|
function up()
|
||||||
create_table(:groups) do
|
create_table(:groups) do
|
||||||
[
|
[
|
||||||
|
|
|
@ -4,6 +4,7 @@ import SearchLight.Migrations: create_table, column, primary_key, add_index, dro
|
||||||
|
|
||||||
include("../../lib/DatabaseSupport.jl")
|
include("../../lib/DatabaseSupport.jl")
|
||||||
using .DatabaseSupport
|
using .DatabaseSupport
|
||||||
|
import .DatabaseSupport: add_foreign_key, add_index, set_default
|
||||||
|
|
||||||
function up()
|
function up()
|
||||||
create_table(:groups_requests) do
|
create_table(:groups_requests) do
|
||||||
|
@ -17,8 +18,10 @@ function up()
|
||||||
column(:contact, :string)
|
column(:contact, :string)
|
||||||
column(:latitude, :float)
|
column(:latitude, :float)
|
||||||
column(:longitude, :float)
|
column(:longitude, :float)
|
||||||
column(:verified, :bool)
|
column(:longitude, :float)
|
||||||
|
column(:members,:integer)
|
||||||
column(:added, :bool)
|
column(:added, :bool)
|
||||||
|
column(:status,:Integer)
|
||||||
]
|
]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -27,7 +30,6 @@ function up()
|
||||||
|
|
||||||
add_index(:groups_requests, :user_id)
|
add_index(:groups_requests, :user_id)
|
||||||
|
|
||||||
set_default("groups_requests","verified",false)
|
|
||||||
set_default("groups_requests","added",false)
|
set_default("groups_requests","added",false)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
module CreateTableUsersGroups
|
||||||
|
|
||||||
|
import SearchLight.Migrations: create_table, column, primary_key, add_index, drop_table
|
||||||
|
|
||||||
|
include("../../lib/DatabaseSupport.jl")
|
||||||
|
import .DatabaseSupport: add_foreign_key, add_index
|
||||||
|
|
||||||
|
function up()
|
||||||
|
create_table(:users_groups) do
|
||||||
|
[
|
||||||
|
primary_key()
|
||||||
|
column(:user_id, :int)
|
||||||
|
column(:group_id, :int)
|
||||||
|
]
|
||||||
|
end
|
||||||
|
|
||||||
|
add_foreign_key(:users_groups,:user_id,:users,:id)
|
||||||
|
add_foreign_key(:users_groups,:group_id,:groups,:id)
|
||||||
|
add_index(:users_groups, :user_id)
|
||||||
|
add_index(:users_groups, :group_id)
|
||||||
|
end
|
||||||
|
|
||||||
|
function down()
|
||||||
|
drop_table(:users_groups)
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
|
@ -4,7 +4,7 @@ module DatabaseSupport
|
||||||
using SearchLight, SearchLightPostgreSQL, LibPQ
|
using SearchLight, SearchLightPostgreSQL, LibPQ
|
||||||
using DataFrames
|
using DataFrames
|
||||||
|
|
||||||
export exist_in_table, insert_into_table, update_table, select_from_table, add_foreign_key, set_default
|
export exist_in_table, insert_into_table, update_table, select_from_table, delete_from_table, add_foreign_key, set_default
|
||||||
|
|
||||||
options = SearchLight.Configuration.read_db_connection_data("db/connection.yml")
|
options = SearchLight.Configuration.read_db_connection_data("db/connection.yml")
|
||||||
conn = SearchLight.connect(options)
|
conn = SearchLight.connect(options)
|
||||||
|
@ -19,15 +19,22 @@ function format(x)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function insert_into_table(table_name,dict_values)
|
function insert_into_table(table_name,dict_values,other="")
|
||||||
names_string = join(keys(dict_values),", ")
|
names_string = join(keys(dict_values),", ")
|
||||||
vals_raw = values(dict_values)
|
vals_raw = values(dict_values)
|
||||||
|
|
||||||
vals = map(x -> format(x),vals_raw)
|
vals = map(x -> format(x),vals_raw)
|
||||||
vals_string = join(values(vals),", ")
|
vals_string = join(values(vals),", ")
|
||||||
query = "INSERT INTO $table_name ($names_string) VALUES ($vals_string)"
|
query = "INSERT INTO $table_name ($names_string) VALUES ($vals_string) " * other
|
||||||
|
return SearchLight.query(query)
|
||||||
|
end
|
||||||
|
|
||||||
|
function delete_from_table(table_name,where_data)
|
||||||
|
query = "DELETE FROM $table_name"
|
||||||
|
if !isnothing(where_data)
|
||||||
|
query *= where_query(where_data)
|
||||||
|
end
|
||||||
SearchLight.query(query)
|
SearchLight.query(query)
|
||||||
return nothing
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function update_table(table_name,dict_values; where_data=nothing)
|
function update_table(table_name,dict_values; where_data=nothing)
|
||||||
|
@ -46,13 +53,21 @@ function update_table(table_name,dict_values; where_data=nothing)
|
||||||
end
|
end
|
||||||
|
|
||||||
function where_query(pair::Pair)
|
function where_query(pair::Pair)
|
||||||
return " WHERE $(pair[1]) = $(pair[2])"
|
if isnothing(pair[2])
|
||||||
|
return " WHERE $(pair[1]) is null"
|
||||||
|
else
|
||||||
|
return " WHERE $(pair[1]) = $(pair[2])"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function where_query(data::Vector{<:Pair})
|
function where_query(data::Vector{<:Pair})
|
||||||
conds = String[]
|
conds = String[]
|
||||||
for pair in data
|
for pair in data
|
||||||
push!(conds,"$(pair[1]) = $(pair[2])")
|
if isnothing(pair[2])
|
||||||
|
push!(conds, "$(pair[1]) is null")
|
||||||
|
else
|
||||||
|
push!(conds,"$(pair[1]) = $(pair[2])")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
query = " WHERE "*join(conds," AND ")
|
query = " WHERE "*join(conds," AND ")
|
||||||
return query
|
return query
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
[{"town":"Atlanta","contact":null,"latitude":33.7243396617476,"longitude":-84.39697265625,"id":9,"members":1,"country":"United States","state":"Georgia"},{"town":null,"contact":null,"latitude":39.98855476000615,"longitude":-105.2105712890625,"id":10,"members":1,"country":"United States","state":"Colorado"},{"town":null,"contact":null,"latitude":28.27955105276024,"longitude":-81.47460937500001,"id":11,"members":1,"country":"United States","state":"Florida"},{"town":"Dublin","contact":null,"latitude":40.13360099478965,"longitude":-83.10607910156251,"id":12,"members":1,"country":"United States","state":"Ohio"},{"town":"Toronto","contact":null,"latitude":43.68959002213805,"longitude":-79.36523437500001,"id":13,"members":1,"country":"Canada","state":"Ontario"},{"town":"Halifax","contact":null,"latitude":44.64996307546047,"longitude":-63.60809326171876,"id":14,"members":1,"country":"Canada","state":"Nova Scotia"},{"town":null,"contact":null,"latitude":53.353612430518126,"longitude":-8.085937500000002,"id":15,"members":1,"country":"Ireland","state":null},{"town":"Cham","contact":null,"latitude":47.18444711300418,"longitude":8.461189270019533,"id":16,"members":1,"country":"Switzerland","state":"Zug"},{"town":"Wiesbaden","contact":null,"latitude":50.085975903187155,"longitude":8.240432739257814,"id":17,"members":1,"country":"Germany","state":"Hesse"},{"town":"Copenhagen","contact":null,"latitude":55.68832070332783,"longitude":12.568359375000002,"id":18,"members":1,"country":"Denmark","state":"Capital Region of Denmark"},{"town":"Kolding","contact":null,"latitude":55.5095568556412,"longitude":9.486694335937502,"id":19,"members":1,"country":"Denmark","state":null},{"town":"Municipal Unit of Moschato","contact":null,"latitude":37.950275539773436,"longitude":23.673992156982425,"id":20,"members":1,"country":"Greece","state":"Attica"},{"town":"Varna","contact":null,"latitude":43.18381722560103,"longitude":27.905273437500004,"id":21,"members":1,"country":"Bulgaria","state":null},{"town":"Riga","contact":null,"latitude":56.966939887376796,"longitude":24.142456054687504,"id":22,"members":1,"country":"Latvia","state":"Vidzeme"},{"town":"Kohtla-Järve linn","contact":null,"latitude":59.40196127188141,"longitude":27.28042602539063,"id":23,"members":1,"country":"Estonia","state":null},{"town":"Tallinn","contact":null,"latitude":59.39656672058008,"longitude":24.72610473655427,"id":24,"members":1,"country":"Estonia","state":null},{"town":"Chiang Mai","contact":null,"latitude":18.796128352413316,"longitude":98.98753015423392,"id":25,"members":1,"country":"Thailand","state":null}]
|
[{"town":null,"contact":null,"latitude":52.16045455774706,"longitude":36.21093750000001,"id":39,"members":1,"country":"Russia","state":"Kursk Oblast"}]
|
|
@ -169,3 +169,12 @@ label {
|
||||||
margin-top: -0.2rem;
|
margin-top: -0.2rem;
|
||||||
color: #5f5f5f;
|
color: #5f5f5f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#content {
|
||||||
|
position: relative;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
flex-direction: column;
|
||||||
|
height: 100%;
|
||||||
|
min-height: 100vh;
|
||||||
|
}
|
|
@ -1,11 +1,12 @@
|
||||||
|
/* Header */
|
||||||
/* Header */
|
#navbar{
|
||||||
#navbar{
|
|
||||||
position: relative;
|
position: relative;
|
||||||
top: 0;
|
top: 0;
|
||||||
width: min(100%,116rem);
|
width: min(100%,116rem);
|
||||||
z-index: 1000;
|
z-index: 1000000000;
|
||||||
height: 5.26rem;
|
height: 5.26rem;
|
||||||
|
padding-left: 0rem;
|
||||||
|
padding-right: 0rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
#navbar * {
|
#navbar * {
|
||||||
|
@ -35,11 +36,9 @@
|
||||||
|
|
||||||
#navbar-logo-text {
|
#navbar-logo-text {
|
||||||
position: relative;
|
position: relative;
|
||||||
width: auto;
|
word-wrap: normal;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
line-height: 400%;
|
line-height: 400%;
|
||||||
white-space: nowrap;
|
|
||||||
text-align: center;
|
|
||||||
font-size: 1.4rem;
|
font-size: 1.4rem;
|
||||||
color: #292222;
|
color: #292222;
|
||||||
font-family: var(--sans-serif, sans-serif);
|
font-family: var(--sans-serif, sans-serif);
|
||||||
|
@ -56,20 +55,17 @@
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
z-index: 0;
|
z-index: 0;
|
||||||
}
|
}
|
||||||
#menu a {
|
#menu > li > a, .options-button {
|
||||||
display: block;
|
display: block;
|
||||||
padding: 1.9rem;
|
padding: 1.2rem;
|
||||||
padding-top: 1rem;
|
padding-top: 1rem;
|
||||||
padding-bottom: 1rem;
|
padding-bottom: 1rem;
|
||||||
color: black;
|
color: black;
|
||||||
font-size: 1.4rem;
|
font-size: 1.4rem;
|
||||||
}
|
}
|
||||||
#menu a:hover {
|
|
||||||
background-color: rgb(220, 220, 220);
|
|
||||||
}
|
|
||||||
|
|
||||||
#menu a:active{
|
#menu > li > a:active{
|
||||||
background-color: #f7aec0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#menu li {
|
#menu li {
|
||||||
|
@ -145,49 +141,88 @@
|
||||||
|
|
||||||
#side-menu:checked ~ #hamb #hamb-line::before {
|
#side-menu:checked ~ #hamb #hamb-line::before {
|
||||||
transform: rotate(-45deg);
|
transform: rotate(-45deg);
|
||||||
top:0;
|
top: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#side-menu:checked ~ #hamb #hamb-line::after {
|
#side-menu:checked ~ #hamb #hamb-line::after {
|
||||||
transform: rotate(45deg);
|
transform: rotate(45deg);
|
||||||
top:0;
|
top: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#cart-icon {
|
/* Options */
|
||||||
height: 1.8rem;
|
|
||||||
pointer-events: none;
|
.options-dropdown {
|
||||||
|
position: absolute;
|
||||||
|
display: none;
|
||||||
|
top: 5.6rem;
|
||||||
|
right: 1.8rem;
|
||||||
|
border: #404040 solid 0.1rem;
|
||||||
|
background-color: white;
|
||||||
|
z-index: 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
#menu a:hover div {
|
.options-dropdown button, .options-dropdown a {
|
||||||
filter: saturate(50%) brightness(140%);
|
display: block;
|
||||||
|
font-family: var(--sans-serif,sans-serif);
|
||||||
|
font-size: 1.2rem;
|
||||||
|
width: 100%;
|
||||||
|
padding: 1rem;
|
||||||
|
text-align: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
#menu a:hover svg {
|
.options-dropdown button:hover, .options-dropdown a:hover {
|
||||||
stroke: rgb(127, 127, 127);;
|
background-color: var(--red);
|
||||||
}
|
|
||||||
|
|
||||||
#cart-counter {
|
|
||||||
position: relative;
|
|
||||||
top: -2.8rem;
|
|
||||||
left: 1.6rem;
|
|
||||||
width: 1.3rem;
|
|
||||||
height: 1.3rem;
|
|
||||||
border-radius: 3.4rem;
|
|
||||||
font-family: var(--sans-serif, sans-serif);
|
|
||||||
font-size: 1rem;
|
|
||||||
text-align: center;
|
|
||||||
color: white;
|
color: white;
|
||||||
background: var(--pink);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.options-button {
|
||||||
|
width: 100%;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Localization */
|
||||||
|
|
||||||
|
#locales {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
#locales button {
|
||||||
|
width: 100%;
|
||||||
|
text-align: left;
|
||||||
|
height: 4rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
#locales button:hover {
|
||||||
|
opacity: 0.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
#locales-img {
|
||||||
|
position: relative;
|
||||||
|
top: 0rem;
|
||||||
|
height: 2rem;
|
||||||
|
margin-left: 1.2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
#options-dropdown>:first-child {
|
||||||
|
padding-bottom: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
#options-dropdown>:nth-child(2) {
|
||||||
|
padding-top: 0.5rem;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
/* Responsiveness */
|
/* Responsiveness */
|
||||||
@media only screen and (min-width: 1500px) {
|
@media only screen and (min-width: 1200px) {
|
||||||
|
|
||||||
#navbar {
|
#navbar {
|
||||||
|
position: relative;
|
||||||
|
width: min(100%,116rem);
|
||||||
left: 50%;
|
left: 50%;
|
||||||
-ms-transform: translateX(-50%);
|
|
||||||
transform: translateX(-50%);
|
transform: translateX(-50%);
|
||||||
|
padding-right: 4rem;
|
||||||
|
padding-left: 4rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
#nav {
|
#nav {
|
||||||
|
@ -197,23 +232,37 @@
|
||||||
float: right;
|
float: right;
|
||||||
width: fit-content;
|
width: fit-content;
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
|
overflow: visible;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#side-menu:checked ~ nav {
|
||||||
|
padding-top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
#menu li {
|
#menu li {
|
||||||
float: left;
|
float: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
#menu a:hover {
|
#menu > li > a:hover, .options-button:hover, #navbar-logo-text:hover {
|
||||||
background-color: transparent;
|
|
||||||
color: rgb(127, 127, 127);
|
color: rgb(127, 127, 127);
|
||||||
}
|
}
|
||||||
|
|
||||||
#menu a {
|
#menu > li > a, .options-button {
|
||||||
padding: 1.9rem;
|
padding: 0.9rem;
|
||||||
|
padding-top: 1.9rem;
|
||||||
|
padding-bottom: 1.9rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#hamb {
|
#hamb {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#locales {
|
||||||
|
position: relative;
|
||||||
|
margin-right: 1.8rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
#locales-img {
|
||||||
|
top: 0.9rem;
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -1,229 +1 @@
|
||||||
|
import{S as t,i as o,a as e,b as s,s as n,e as i,c as r,n as a,d as u,f as c,l as m,g as l,r as g,h as p,j as d}from"./index-db20528a.js";import{sendText as f}from"../../../../../../../../../js/libraries/serverTools.js";import*as h from"../../../../../../../../../js/libraries/authTools.js";import"../../../../../../../../../js/components/login-component.js";import"../../../../../../../../../js/components/signup-component.js";function j(t){let o,e,n,p,d,f,h,j,w;return{c(){o=i("div"),e=i("div"),n=i("login-component"),p=r(),d=i("signup-component"),f=r(),h=i("div"),h.innerHTML="<span>OR</span>",this.c=a,u(e,"id","auth-grid-group"),u(h,"id","auth-or"),u(h,"class","pane"),u(o,"id","auth-group")},m(i,r){s(i,o,r),c(o,e),c(e,n),t[3](n),c(e,p),c(e,d),t[5](d),c(o,f),c(o,h),j||(w=[m(n,"click",t[4]),m(n,"keydown",y),m(d,"click",t[6]),m(d,"keydown",b)],j=!0)},p:a,i:a,o:a,d(e){e&&l(o),t[3](null),t[5](null),j=!1,g(w)}}}const y=()=>"",b=()=>"";function w(t,o,e){let s,n;h.redirectLogged();let i={googleInit:!1};function r(t){t==s?(e(0,s.focused=!0,s),e(1,n.focused=!1,n)):(e(0,s.focused=!1,s),e(1,n.focused=!0,n))}function a(t){console.log(t),f("/signup-google",t.credential,(t=>h.processLoginResponse(t,i.msgs,i.remember.checked)))}p("auth",i),function t(){"undefined"!=typeof google?(google.accounts.id.initialize({client_id:"93612176787-sr8qjqem4e3kok4msrnj8s1illt85a9g.apps.googleusercontent.com",callback:a,auto_select:!0,context:"signin"}),i.googleInit=!0):setTimeout(t,100)}();return[s,n,r,function(t){d[t?"unshift":"push"]((()=>{s=t,e(0,s)}))},()=>r(s),function(t){d[t?"unshift":"push"]((()=>{n=t,e(1,n)}))},()=>r(n)]}class k extends t{constructor(t){super(),this.shadowRoot.innerHTML="<style>@import '/css/common.css';@import '/css/auth.css';span{font-size:1.4rem;font-family:var(--sans-serif,sans-serif)}#auth-group{margin:auto;width:auto;margin-bottom:3rem}#auth-grid-group{display:grid;grid-template-columns:30rem 30rem;justify-content:center;gap:1.37rem;width:100%}#auth-or{display:flex;position:absolute;margin:auto;top:40%;left:50%;transform:translate(-50%, -50%);width:5.4rem;height:5.4rem;border-radius:6.8rem;background-color:white;align-items:center;justify-content:center;font-family:var(--sans-serif,sans-serif);font-weight:500}@media only screen and (max-width: 1200px){#auth-grid-group{display:grid;grid-template-columns:30rem;grid-template-rows:auto auto;justify-content:center;gap:1.37rem;width:100%}#auth-or{top:40rem}#auth-group{margin-top:2rem;margin-bottom:3rem}}</style>",o(this,{target:this.shadowRoot,props:e(this.attributes),customElement:!0},w,j,n,{},null),t&&t.target&&s(t.target,this,t.anchor)}}customElements.define("auth-component",k);export{k as default};
|
||||||
(function(l, r) { if (!l || l.getElementById('livereloadscript')) return; r = l.createElement('script'); r.async = 1; r.src = '//' + (self.location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1'; r.id = 'livereloadscript'; l.getElementsByTagName('head')[0].appendChild(r) })(self.document);
|
|
||||||
import { S as SvelteElement, i as init, a as attribute_to_object, b as insert_dev, s as safe_not_equal, d as dispatch_dev, v as validate_slots, c as setContext, o as onMount, g as getContext, e as globals, f as element, h as space, n as noop, j as add_location, k as attr_dev, l as append_dev, m as listen_dev, p as detach_dev, r as run_all, q as binding_callbacks } from './index-998178c7.js';
|
|
||||||
import { sendText } from '../../../../../../../../../js/libraries/serverTools.js';
|
|
||||||
import * as AuthTools from '../../../../../../../../../js/libraries/authTools.js';
|
|
||||||
import '../../../../../../../../../js/components/login-component.js';
|
|
||||||
import '../../../../../../../../../js/components/signup-component.js';
|
|
||||||
|
|
||||||
/* src\auth\auth-component.svelte generated by Svelte v3.52.0 */
|
|
||||||
|
|
||||||
const { console: console_1 } = globals;
|
|
||||||
const file = "src\\auth\\auth-component.svelte";
|
|
||||||
|
|
||||||
function create_fragment(ctx) {
|
|
||||||
let div2;
|
|
||||||
let div0;
|
|
||||||
let login_component;
|
|
||||||
let t0;
|
|
||||||
let signup_component;
|
|
||||||
let t1;
|
|
||||||
let div1;
|
|
||||||
let span;
|
|
||||||
let mounted;
|
|
||||||
let dispose;
|
|
||||||
|
|
||||||
const block = {
|
|
||||||
c: function create() {
|
|
||||||
div2 = element("div");
|
|
||||||
div0 = element("div");
|
|
||||||
login_component = element("login-component");
|
|
||||||
t0 = space();
|
|
||||||
signup_component = element("signup-component");
|
|
||||||
t1 = space();
|
|
||||||
div1 = element("div");
|
|
||||||
span = element("span");
|
|
||||||
span.textContent = "OR";
|
|
||||||
this.c = noop;
|
|
||||||
add_location(login_component, file, 59, 8, 1652);
|
|
||||||
add_location(signup_component, file, 60, 8, 1791);
|
|
||||||
attr_dev(div0, "id", "auth-grid-group");
|
|
||||||
add_location(div0, file, 58, 4, 1616);
|
|
||||||
add_location(span, file, 63, 8, 1983);
|
|
||||||
attr_dev(div1, "id", "auth-or");
|
|
||||||
attr_dev(div1, "class", "pane");
|
|
||||||
add_location(div1, file, 62, 4, 1942);
|
|
||||||
attr_dev(div2, "id", "auth-group");
|
|
||||||
add_location(div2, file, 57, 0, 1589);
|
|
||||||
},
|
|
||||||
l: function claim(nodes) {
|
|
||||||
throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
|
|
||||||
},
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insert_dev(target, div2, anchor);
|
|
||||||
append_dev(div2, div0);
|
|
||||||
append_dev(div0, login_component);
|
|
||||||
/*login_component_binding*/ ctx[3](login_component);
|
|
||||||
append_dev(div0, t0);
|
|
||||||
append_dev(div0, signup_component);
|
|
||||||
/*signup_component_binding*/ ctx[5](signup_component);
|
|
||||||
append_dev(div2, t1);
|
|
||||||
append_dev(div2, div1);
|
|
||||||
append_dev(div1, span);
|
|
||||||
|
|
||||||
if (!mounted) {
|
|
||||||
dispose = [
|
|
||||||
listen_dev(login_component, "click", /*click_handler*/ ctx[4], false, false, false),
|
|
||||||
listen_dev(login_component, "keydown", keydown_handler, false, false, false),
|
|
||||||
listen_dev(signup_component, "click", /*click_handler_1*/ ctx[6], false, false, false),
|
|
||||||
listen_dev(signup_component, "keydown", keydown_handler_1, false, false, false)
|
|
||||||
];
|
|
||||||
|
|
||||||
mounted = true;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
p: noop,
|
|
||||||
i: noop,
|
|
||||||
o: noop,
|
|
||||||
d: function destroy(detaching) {
|
|
||||||
if (detaching) detach_dev(div2);
|
|
||||||
/*login_component_binding*/ ctx[3](null);
|
|
||||||
/*signup_component_binding*/ ctx[5](null);
|
|
||||||
mounted = false;
|
|
||||||
run_all(dispose);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
dispatch_dev("SvelteRegisterBlock", {
|
|
||||||
block,
|
|
||||||
id: create_fragment.name,
|
|
||||||
type: "component",
|
|
||||||
source: "",
|
|
||||||
ctx
|
|
||||||
});
|
|
||||||
|
|
||||||
return block;
|
|
||||||
}
|
|
||||||
|
|
||||||
const keydown_handler = () => "";
|
|
||||||
const keydown_handler_1 = () => "";
|
|
||||||
|
|
||||||
function instance($$self, $$props, $$invalidate) {
|
|
||||||
let { $$slots: slots = {}, $$scope } = $$props;
|
|
||||||
validate_slots('auth-component', slots, []);
|
|
||||||
AuthTools.redirectLogged();
|
|
||||||
let loginComponent;
|
|
||||||
let signupComponent;
|
|
||||||
let context = { googleInit: false };
|
|
||||||
setContext("auth", context);
|
|
||||||
|
|
||||||
function switchFocus(component) {
|
|
||||||
if (component == loginComponent) {
|
|
||||||
$$invalidate(0, loginComponent.focused = true, loginComponent);
|
|
||||||
$$invalidate(1, signupComponent.focused = false, signupComponent);
|
|
||||||
} else {
|
|
||||||
$$invalidate(0, loginComponent.focused = false, loginComponent);
|
|
||||||
$$invalidate(1, signupComponent.focused = true, signupComponent);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function callbackGoogle(data) {
|
|
||||||
console.log(data);
|
|
||||||
sendText("/signup-google", data.credential, response => AuthTools.processLoginResponse(response, context.msgs, context.remember.checked));
|
|
||||||
}
|
|
||||||
|
|
||||||
function initGoogle() {
|
|
||||||
if (typeof google != 'undefined') {
|
|
||||||
google.accounts.id.initialize({
|
|
||||||
client_id: '93612176787-sr8qjqem4e3kok4msrnj8s1illt85a9g.apps.googleusercontent.com',
|
|
||||||
callback: callbackGoogle,
|
|
||||||
auto_select: true,
|
|
||||||
context: "signin"
|
|
||||||
});
|
|
||||||
|
|
||||||
context.googleInit = true;
|
|
||||||
} else {
|
|
||||||
setTimeout(initGoogle, 100);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
initGoogle();
|
|
||||||
const writable_props = [];
|
|
||||||
|
|
||||||
Object.keys($$props).forEach(key => {
|
|
||||||
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console_1.warn(`<auth-component> was created with unknown prop '${key}'`);
|
|
||||||
});
|
|
||||||
|
|
||||||
function login_component_binding($$value) {
|
|
||||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
|
||||||
loginComponent = $$value;
|
|
||||||
$$invalidate(0, loginComponent);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
const click_handler = () => switchFocus(loginComponent);
|
|
||||||
|
|
||||||
function signup_component_binding($$value) {
|
|
||||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
|
||||||
signupComponent = $$value;
|
|
||||||
$$invalidate(1, signupComponent);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
const click_handler_1 = () => switchFocus(signupComponent);
|
|
||||||
|
|
||||||
$$self.$capture_state = () => ({
|
|
||||||
onMount,
|
|
||||||
setContext,
|
|
||||||
getContext,
|
|
||||||
sendText,
|
|
||||||
AuthTools,
|
|
||||||
loginComponent,
|
|
||||||
signupComponent,
|
|
||||||
context,
|
|
||||||
switchFocus,
|
|
||||||
callbackGoogle,
|
|
||||||
initGoogle
|
|
||||||
});
|
|
||||||
|
|
||||||
$$self.$inject_state = $$props => {
|
|
||||||
if ('loginComponent' in $$props) $$invalidate(0, loginComponent = $$props.loginComponent);
|
|
||||||
if ('signupComponent' in $$props) $$invalidate(1, signupComponent = $$props.signupComponent);
|
|
||||||
if ('context' in $$props) context = $$props.context;
|
|
||||||
};
|
|
||||||
|
|
||||||
if ($$props && "$$inject" in $$props) {
|
|
||||||
$$self.$inject_state($$props.$$inject);
|
|
||||||
}
|
|
||||||
|
|
||||||
return [
|
|
||||||
loginComponent,
|
|
||||||
signupComponent,
|
|
||||||
switchFocus,
|
|
||||||
login_component_binding,
|
|
||||||
click_handler,
|
|
||||||
signup_component_binding,
|
|
||||||
click_handler_1
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
class Auth_component extends SvelteElement {
|
|
||||||
constructor(options) {
|
|
||||||
super();
|
|
||||||
this.shadowRoot.innerHTML = `<style>@import '/css/common.css';span{font-size:1.4rem;font-family:var(--sans-serif,sans-serif)}#auth-group{margin:auto;width:auto;margin-bottom:3rem}#auth-grid-group{display:grid;grid-template-columns:30rem 30rem;justify-content:center;gap:1.37rem;width:100%}#auth-or{display:flex;position:absolute;margin:auto;top:40%;left:50%;transform:translate(-50%, -50%);width:5.4rem;height:5.4rem;border-radius:6.8rem;background-color:white;align-items:center;justify-content:center;font-family:var(--sans-serif,sans-serif);font-weight:500}@media only screen and (max-width: 1200px){#auth-grid-group{display:grid;grid-template-columns:30rem;grid-template-rows:auto auto;justify-content:center;gap:1.37rem;width:100%}#auth-or{top:46.4rem}#auth-group{margin-top:2rem;margin-bottom:3rem}}</style>`;
|
|
||||||
|
|
||||||
init(
|
|
||||||
this,
|
|
||||||
{
|
|
||||||
target: this.shadowRoot,
|
|
||||||
props: attribute_to_object(this.attributes),
|
|
||||||
customElement: true
|
|
||||||
},
|
|
||||||
instance,
|
|
||||||
create_fragment,
|
|
||||||
safe_not_equal,
|
|
||||||
{},
|
|
||||||
null
|
|
||||||
);
|
|
||||||
|
|
||||||
if (options) {
|
|
||||||
if (options.target) {
|
|
||||||
insert_dev(options.target, this, options.anchor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
customElements.define("auth-component", Auth_component);
|
|
||||||
|
|
||||||
export { Auth_component as default };
|
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,361 +1 @@
|
||||||
|
import{S as t,i as n,a as i,b as a,s,e as o,c as e,n as r,d as u,f as l,l as m,g as p,r as f,o as h,j as c}from"./index-db20528a.js";import*as d from"../../../../../../../../../js/libraries/authTools.js";function g(t){let n,i,s,h,c,d,g,x,b,C,y,v,I,w,j,k,E,T,z,M,O,R,D;return{c(){n=o("div"),i=o("h2"),i.textContent="CONFIRMATION CODE",s=e(),h=o("div"),c=o("input"),d=o("span"),d.textContent="-",g=e(),x=o("input"),b=o("span"),b.textContent="-",C=e(),y=o("input"),v=o("span"),v.textContent="-",I=e(),w=o("input"),j=o("span"),j.textContent="-",k=e(),E=o("input"),T=e(),z=o("span"),M=e(),O=o("button"),O.textContent="Confirm",this.c=r,u(i,"class","auth-title title-highlight"),u(c,"class","authConfirmationInput"),u(c,"type","text"),u(c,"maxlength","1"),u(d,"class","dash"),u(x,"class","authConfirmationInput"),u(x,"type","text"),u(x,"maxlength","1"),u(b,"class","dash"),u(y,"class","authConfirmationInput"),u(y,"type","text"),u(y,"maxlength","1"),u(v,"class","dash"),u(w,"class","authConfirmationInput"),u(w,"type","text"),u(w,"maxlength","1"),u(j,"class","dash"),u(E,"class","authConfirmationInput"),u(E,"type","text"),u(E,"maxlength","1"),u(h,"id","confirmationInputs"),u(z,"id","confirmation-msg"),u(O,"class","auth-button"),u(n,"class","pane auth-pane")},m(o,e){a(o,n,e),l(n,i),l(n,s),l(n,h),l(h,c),t[6](c),l(h,d),l(h,g),l(h,x),t[8](x),l(h,b),l(h,C),l(h,y),t[10](y),l(h,v),l(h,I),l(h,w),t[12](w),l(h,j),l(h,k),l(h,E),t[14](E),l(n,T),l(n,z),t[16](z),l(n,M),l(n,O),t[17](O),R||(D=[m(c,"input",t[7]),m(x,"input",t[9]),m(y,"input",t[11]),m(w,"input",t[13]),m(E,"input",t[15]),m(O,"click",t[18])],R=!0)},p:r,i:r,o:r,d(i){i&&p(n),t[6](null),t[8](null),t[10](null),t[12](null),t[14](null),t[16](null),t[17](null),R=!1,f(D)}}}function x(t,n,i){let a,s,o=[];function e(t,n){n.data in["0","1","2","3","4","5","6","7","8","9"]?t<4?o[t+1].focus():d.confirmEmail(a,r(),u):i(0,o[t].value="",o)}function r(){let t="";for(let n of o)t+=n.value;return parseInt(t)}function u(t){"true"==t?d.toDashboard():i(1,a.innerHTML="Wrong code",a)}h((()=>{}));return[o,a,s,e,r,u,function(t){c[t?"unshift":"push"]((()=>{o[0]=t,i(0,o)}))},t=>e(0,t),function(t){c[t?"unshift":"push"]((()=>{o[1]=t,i(0,o)}))},t=>e(1,t),function(t){c[t?"unshift":"push"]((()=>{o[2]=t,i(0,o)}))},t=>e(2,t),function(t){c[t?"unshift":"push"]((()=>{o[3]=t,i(0,o)}))},t=>e(3,t),function(t){c[t?"unshift":"push"]((()=>{o[4]=t,i(0,o)}))},t=>e(4,t),function(t){c[t?"unshift":"push"]((()=>{a=t,i(1,a)}))},function(t){c[t?"unshift":"push"]((()=>{s=t,i(2,s)}))},()=>d.confirmEmail(a,r(),u)]}class b extends t{constructor(t){super(),this.shadowRoot.innerHTML="<style>@import '/css/common.css';.auth-pane{position:relative;padding:3.4rem;padding-top:5.5rem;padding-bottom:5.5rem;width:33rem;height:auto;margin:auto}.auth-title{position:relative;left:0.7rem;top:0.2rem;margin-bottom:1.4rem}.authConfirmationInput{position:relative;width:3.16rem;font-family:var(--serif,serif);font-size:3rem;border-radius:0.34rem;margin-bottom:0.7rem;text-align:center;padding-left:0;padding-bottom:0.3 rem}.dash{display:block;font-size:3rem;font-family:var(--serif,serif)}#confirmationInputs{margin:auto;display:grid;justify-content:space-between;grid-auto-flow:column}.auth-button{margin-top:1.4rem;height:3.4rem;width:100%;font-family:var(--sans-serif,sans-serif);font-size:1.6rem;color:white;background-color:var(--pink);border-color:var(--pink);border-radius:0.5rem;filter:drop-shadow(0.07rem 0.14rem 0.07rem rgb(0 0 0 / 0.4))}#confirmation-msg{display:inline;color:red}</style>",n(this,{target:this.shadowRoot,props:i(this.attributes),customElement:!0},x,g,s,{},null),t&&t.target&&a(t.target,this,t.anchor)}}customElements.define("confirmation-component",b);export{b as default};
|
||||||
(function(l, r) { if (!l || l.getElementById('livereloadscript')) return; r = l.createElement('script'); r.async = 1; r.src = '//' + (self.location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1'; r.id = 'livereloadscript'; l.getElementsByTagName('head')[0].appendChild(r) })(self.document);
|
|
||||||
import { S as SvelteElement, i as init, a as attribute_to_object, b as insert_dev, s as safe_not_equal, d as dispatch_dev, v as validate_slots, o as onMount, f as element, h as space, n as noop, k as attr_dev, j as add_location, l as append_dev, m as listen_dev, p as detach_dev, r as run_all, q as binding_callbacks } from './index-998178c7.js';
|
|
||||||
import * as AuthTools from '../../../../../../../../../js/libraries/authTools.js';
|
|
||||||
|
|
||||||
/* src\auth\confirmation-component.svelte generated by Svelte v3.52.0 */
|
|
||||||
const file = "src\\auth\\confirmation-component.svelte";
|
|
||||||
|
|
||||||
function create_fragment(ctx) {
|
|
||||||
let div1;
|
|
||||||
let h2;
|
|
||||||
let t1;
|
|
||||||
let div0;
|
|
||||||
let input0;
|
|
||||||
let span0;
|
|
||||||
let t3;
|
|
||||||
let input1;
|
|
||||||
let span1;
|
|
||||||
let t5;
|
|
||||||
let input2;
|
|
||||||
let span2;
|
|
||||||
let t7;
|
|
||||||
let input3;
|
|
||||||
let span3;
|
|
||||||
let t9;
|
|
||||||
let input4;
|
|
||||||
let t10;
|
|
||||||
let span4;
|
|
||||||
let t11;
|
|
||||||
let button;
|
|
||||||
let mounted;
|
|
||||||
let dispose;
|
|
||||||
|
|
||||||
const block = {
|
|
||||||
c: function create() {
|
|
||||||
div1 = element("div");
|
|
||||||
h2 = element("h2");
|
|
||||||
h2.textContent = "CONFIRMATION CODE";
|
|
||||||
t1 = space();
|
|
||||||
div0 = element("div");
|
|
||||||
input0 = element("input");
|
|
||||||
span0 = element("span");
|
|
||||||
span0.textContent = "-";
|
|
||||||
t3 = space();
|
|
||||||
input1 = element("input");
|
|
||||||
span1 = element("span");
|
|
||||||
span1.textContent = "-";
|
|
||||||
t5 = space();
|
|
||||||
input2 = element("input");
|
|
||||||
span2 = element("span");
|
|
||||||
span2.textContent = "-";
|
|
||||||
t7 = space();
|
|
||||||
input3 = element("input");
|
|
||||||
span3 = element("span");
|
|
||||||
span3.textContent = "-";
|
|
||||||
t9 = space();
|
|
||||||
input4 = element("input");
|
|
||||||
t10 = space();
|
|
||||||
span4 = element("span");
|
|
||||||
t11 = space();
|
|
||||||
button = element("button");
|
|
||||||
button.textContent = "Confirm";
|
|
||||||
this.c = noop;
|
|
||||||
attr_dev(h2, "class", "auth-title title-highlight");
|
|
||||||
add_location(h2, file, 55, 4, 1288);
|
|
||||||
attr_dev(input0, "class", "authConfirmationInput");
|
|
||||||
attr_dev(input0, "type", "text");
|
|
||||||
attr_dev(input0, "maxlength", "1");
|
|
||||||
add_location(input0, file, 57, 8, 1394);
|
|
||||||
attr_dev(span0, "class", "dash");
|
|
||||||
add_location(span0, file, 57, 146, 1532);
|
|
||||||
attr_dev(input1, "class", "authConfirmationInput");
|
|
||||||
attr_dev(input1, "type", "text");
|
|
||||||
attr_dev(input1, "maxlength", "1");
|
|
||||||
add_location(input1, file, 58, 8, 1569);
|
|
||||||
attr_dev(span1, "class", "dash");
|
|
||||||
add_location(span1, file, 58, 146, 1707);
|
|
||||||
attr_dev(input2, "class", "authConfirmationInput");
|
|
||||||
attr_dev(input2, "type", "text");
|
|
||||||
attr_dev(input2, "maxlength", "1");
|
|
||||||
add_location(input2, file, 59, 8, 1744);
|
|
||||||
attr_dev(span2, "class", "dash");
|
|
||||||
add_location(span2, file, 59, 146, 1882);
|
|
||||||
attr_dev(input3, "class", "authConfirmationInput");
|
|
||||||
attr_dev(input3, "type", "text");
|
|
||||||
attr_dev(input3, "maxlength", "1");
|
|
||||||
add_location(input3, file, 60, 8, 1919);
|
|
||||||
attr_dev(span3, "class", "dash");
|
|
||||||
add_location(span3, file, 60, 146, 2057);
|
|
||||||
attr_dev(input4, "class", "authConfirmationInput");
|
|
||||||
attr_dev(input4, "type", "text");
|
|
||||||
attr_dev(input4, "maxlength", "1");
|
|
||||||
add_location(input4, file, 61, 8, 2094);
|
|
||||||
attr_dev(div0, "id", "confirmationInputs");
|
|
||||||
add_location(div0, file, 56, 4, 1355);
|
|
||||||
attr_dev(span4, "id", "confirmation-msg");
|
|
||||||
add_location(span4, file, 63, 4, 2250);
|
|
||||||
attr_dev(button, "class", "auth-button");
|
|
||||||
add_location(button, file, 64, 4, 2319);
|
|
||||||
attr_dev(div1, "class", "pane auth-pane");
|
|
||||||
add_location(div1, file, 54, 0, 1254);
|
|
||||||
},
|
|
||||||
l: function claim(nodes) {
|
|
||||||
throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
|
|
||||||
},
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insert_dev(target, div1, anchor);
|
|
||||||
append_dev(div1, h2);
|
|
||||||
append_dev(div1, t1);
|
|
||||||
append_dev(div1, div0);
|
|
||||||
append_dev(div0, input0);
|
|
||||||
/*input0_binding*/ ctx[6](input0);
|
|
||||||
append_dev(div0, span0);
|
|
||||||
append_dev(div0, t3);
|
|
||||||
append_dev(div0, input1);
|
|
||||||
/*input1_binding*/ ctx[8](input1);
|
|
||||||
append_dev(div0, span1);
|
|
||||||
append_dev(div0, t5);
|
|
||||||
append_dev(div0, input2);
|
|
||||||
/*input2_binding*/ ctx[10](input2);
|
|
||||||
append_dev(div0, span2);
|
|
||||||
append_dev(div0, t7);
|
|
||||||
append_dev(div0, input3);
|
|
||||||
/*input3_binding*/ ctx[12](input3);
|
|
||||||
append_dev(div0, span3);
|
|
||||||
append_dev(div0, t9);
|
|
||||||
append_dev(div0, input4);
|
|
||||||
/*input4_binding*/ ctx[14](input4);
|
|
||||||
append_dev(div1, t10);
|
|
||||||
append_dev(div1, span4);
|
|
||||||
/*span4_binding*/ ctx[16](span4);
|
|
||||||
append_dev(div1, t11);
|
|
||||||
append_dev(div1, button);
|
|
||||||
/*button_binding*/ ctx[17](button);
|
|
||||||
|
|
||||||
if (!mounted) {
|
|
||||||
dispose = [
|
|
||||||
listen_dev(input0, "input", /*input_handler*/ ctx[7], false, false, false),
|
|
||||||
listen_dev(input1, "input", /*input_handler_1*/ ctx[9], false, false, false),
|
|
||||||
listen_dev(input2, "input", /*input_handler_2*/ ctx[11], false, false, false),
|
|
||||||
listen_dev(input3, "input", /*input_handler_3*/ ctx[13], false, false, false),
|
|
||||||
listen_dev(input4, "input", /*input_handler_4*/ ctx[15], false, false, false),
|
|
||||||
listen_dev(button, "click", /*click_handler*/ ctx[18], false, false, false)
|
|
||||||
];
|
|
||||||
|
|
||||||
mounted = true;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
p: noop,
|
|
||||||
i: noop,
|
|
||||||
o: noop,
|
|
||||||
d: function destroy(detaching) {
|
|
||||||
if (detaching) detach_dev(div1);
|
|
||||||
/*input0_binding*/ ctx[6](null);
|
|
||||||
/*input1_binding*/ ctx[8](null);
|
|
||||||
/*input2_binding*/ ctx[10](null);
|
|
||||||
/*input3_binding*/ ctx[12](null);
|
|
||||||
/*input4_binding*/ ctx[14](null);
|
|
||||||
/*span4_binding*/ ctx[16](null);
|
|
||||||
/*button_binding*/ ctx[17](null);
|
|
||||||
mounted = false;
|
|
||||||
run_all(dispose);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
dispatch_dev("SvelteRegisterBlock", {
|
|
||||||
block,
|
|
||||||
id: create_fragment.name,
|
|
||||||
type: "component",
|
|
||||||
source: "",
|
|
||||||
ctx
|
|
||||||
});
|
|
||||||
|
|
||||||
return block;
|
|
||||||
}
|
|
||||||
|
|
||||||
function instance($$self, $$props, $$invalidate) {
|
|
||||||
let { $$slots: slots = {}, $$scope } = $$props;
|
|
||||||
validate_slots('confirmation-component', slots, []);
|
|
||||||
let confirmationInputs = [];
|
|
||||||
let confirmationMsg;
|
|
||||||
let confirmationButton;
|
|
||||||
|
|
||||||
function onlyNumberKey(ind, evt) {
|
|
||||||
// Only ASCII character in that range allowed
|
|
||||||
var value = evt.data;
|
|
||||||
|
|
||||||
if (value in ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]) {
|
|
||||||
if (ind < 4) {
|
|
||||||
confirmationInputs[ind + 1].focus();
|
|
||||||
} else {
|
|
||||||
AuthTools.confirmEmail(confirmationMsg, getCode(), callback);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$$invalidate(0, confirmationInputs[ind].value = "", confirmationInputs);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function getCode() {
|
|
||||||
let code = "";
|
|
||||||
|
|
||||||
for (let input of confirmationInputs) {
|
|
||||||
code += input.value;
|
|
||||||
}
|
|
||||||
|
|
||||||
return parseInt(code);
|
|
||||||
}
|
|
||||||
|
|
||||||
function callback(response) {
|
|
||||||
if (response == "true") {
|
|
||||||
AuthTools.toDashboard();
|
|
||||||
} else {
|
|
||||||
$$invalidate(1, confirmationMsg.innerHTML = "Wrong code", confirmationMsg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onMount(() => {
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
const writable_props = [];
|
|
||||||
|
|
||||||
Object.keys($$props).forEach(key => {
|
|
||||||
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(`<confirmation-component> was created with unknown prop '${key}'`);
|
|
||||||
});
|
|
||||||
|
|
||||||
function input0_binding($$value) {
|
|
||||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
|
||||||
confirmationInputs[0] = $$value;
|
|
||||||
$$invalidate(0, confirmationInputs);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
const input_handler = evt => onlyNumberKey(0, evt);
|
|
||||||
|
|
||||||
function input1_binding($$value) {
|
|
||||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
|
||||||
confirmationInputs[1] = $$value;
|
|
||||||
$$invalidate(0, confirmationInputs);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
const input_handler_1 = evt => onlyNumberKey(1, evt);
|
|
||||||
|
|
||||||
function input2_binding($$value) {
|
|
||||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
|
||||||
confirmationInputs[2] = $$value;
|
|
||||||
$$invalidate(0, confirmationInputs);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
const input_handler_2 = evt => onlyNumberKey(2, evt);
|
|
||||||
|
|
||||||
function input3_binding($$value) {
|
|
||||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
|
||||||
confirmationInputs[3] = $$value;
|
|
||||||
$$invalidate(0, confirmationInputs);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
const input_handler_3 = evt => onlyNumberKey(3, evt);
|
|
||||||
|
|
||||||
function input4_binding($$value) {
|
|
||||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
|
||||||
confirmationInputs[4] = $$value;
|
|
||||||
$$invalidate(0, confirmationInputs);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
const input_handler_4 = evt => onlyNumberKey(4, evt);
|
|
||||||
|
|
||||||
function span4_binding($$value) {
|
|
||||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
|
||||||
confirmationMsg = $$value;
|
|
||||||
$$invalidate(1, confirmationMsg);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function button_binding($$value) {
|
|
||||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
|
||||||
confirmationButton = $$value;
|
|
||||||
$$invalidate(2, confirmationButton);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
const click_handler = () => AuthTools.confirmEmail(confirmationMsg, getCode(), callback);
|
|
||||||
|
|
||||||
$$self.$capture_state = () => ({
|
|
||||||
onMount,
|
|
||||||
AuthTools,
|
|
||||||
confirmationInputs,
|
|
||||||
confirmationMsg,
|
|
||||||
confirmationButton,
|
|
||||||
onlyNumberKey,
|
|
||||||
getCode,
|
|
||||||
callback
|
|
||||||
});
|
|
||||||
|
|
||||||
$$self.$inject_state = $$props => {
|
|
||||||
if ('confirmationInputs' in $$props) $$invalidate(0, confirmationInputs = $$props.confirmationInputs);
|
|
||||||
if ('confirmationMsg' in $$props) $$invalidate(1, confirmationMsg = $$props.confirmationMsg);
|
|
||||||
if ('confirmationButton' in $$props) $$invalidate(2, confirmationButton = $$props.confirmationButton);
|
|
||||||
};
|
|
||||||
|
|
||||||
if ($$props && "$$inject" in $$props) {
|
|
||||||
$$self.$inject_state($$props.$$inject);
|
|
||||||
}
|
|
||||||
|
|
||||||
return [
|
|
||||||
confirmationInputs,
|
|
||||||
confirmationMsg,
|
|
||||||
confirmationButton,
|
|
||||||
onlyNumberKey,
|
|
||||||
getCode,
|
|
||||||
callback,
|
|
||||||
input0_binding,
|
|
||||||
input_handler,
|
|
||||||
input1_binding,
|
|
||||||
input_handler_1,
|
|
||||||
input2_binding,
|
|
||||||
input_handler_2,
|
|
||||||
input3_binding,
|
|
||||||
input_handler_3,
|
|
||||||
input4_binding,
|
|
||||||
input_handler_4,
|
|
||||||
span4_binding,
|
|
||||||
button_binding,
|
|
||||||
click_handler
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
class Confirmation_component extends SvelteElement {
|
|
||||||
constructor(options) {
|
|
||||||
super();
|
|
||||||
this.shadowRoot.innerHTML = `<style>@import '/css/common.css';.auth-pane{position:relative;padding:3.4rem;padding-top:5.5rem;padding-bottom:5.5rem;width:33rem;height:auto;margin:auto}.auth-title{position:relative;left:0.7rem;top:0.2rem;margin-bottom:1.4rem}.authConfirmationInput{position:relative;width:3.16rem;font-family:var(--serif,serif);font-size:3rem;border-radius:0.34rem;margin-bottom:0.7rem;text-align:center;padding-left:0;padding-bottom:0.3 rem}.dash{display:block;font-size:3rem;font-family:var(--serif,serif)}#confirmationInputs{margin:auto;display:grid;justify-content:space-between;grid-auto-flow:column}.auth-button{margin-top:1.4rem;height:3.4rem;width:100%;font-family:var(--sans-serif,sans-serif);font-size:1.6rem;color:white;background-color:var(--pink);border-color:var(--pink);border-radius:0.5rem;filter:drop-shadow(0.07rem 0.14rem 0.07rem rgb(0 0 0 / 0.4))}#confirmation-msg{display:inline;color:red}</style>`;
|
|
||||||
|
|
||||||
init(
|
|
||||||
this,
|
|
||||||
{
|
|
||||||
target: this.shadowRoot,
|
|
||||||
props: attribute_to_object(this.attributes),
|
|
||||||
customElement: true
|
|
||||||
},
|
|
||||||
instance,
|
|
||||||
create_fragment,
|
|
||||||
safe_not_equal,
|
|
||||||
{},
|
|
||||||
null
|
|
||||||
);
|
|
||||||
|
|
||||||
if (options) {
|
|
||||||
if (options.target) {
|
|
||||||
insert_dev(options.target, this, options.anchor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
customElements.define("confirmation-component", Confirmation_component);
|
|
||||||
|
|
||||||
export { Confirmation_component as default };
|
|
||||||
|
|
|
@ -1,99 +1 @@
|
||||||
|
import{S as e,i as s,a as t,b as o,s as i,e as a,n as r,d as n,g as c,o as d}from"./index-db20528a.js";function p(e){let s;return{c(){s=a("div"),s.innerHTML="<div><p>We use cookies to improve your experience, personalise your content and analyse site usage. By clicking “OK”, you agree to the use of cookies.</p></div>",this.c=r,n(s,"id","wrapper")},m(e,t){o(e,s,t)},p:r,i:r,o:r,d(e){e&&c(s)}}}function u(e){return d((()=>{})),[]}class h extends e{constructor(e){super(),this.shadowRoot.innerHTML="<style>@import '/css/common.css';#wrapper{display:none;position:relative;height:5rem;width:100%;background:white;box-shadow:0 0 0.314rem rgb(187, 187, 187);;}</style>",s(this,{target:this.shadowRoot,props:t(this.attributes),customElement:!0},u,p,i,{},null),e&&e.target&&o(e.target,this,e.anchor)}}customElements.define("cookies-dialog",h);export{h as default};
|
||||||
(function(l, r) { if (!l || l.getElementById('livereloadscript')) return; r = l.createElement('script'); r.async = 1; r.src = '//' + (self.location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1'; r.id = 'livereloadscript'; l.getElementsByTagName('head')[0].appendChild(r) })(self.document);
|
|
||||||
import { S as SvelteElement, i as init, a as attribute_to_object, b as insert_dev, s as safe_not_equal, d as dispatch_dev, v as validate_slots, o as onMount, f as element, n as noop, j as add_location, k as attr_dev, l as append_dev, p as detach_dev } from './index-998178c7.js';
|
|
||||||
|
|
||||||
/* src\components\cookies-dialog.svelte generated by Svelte v3.52.0 */
|
|
||||||
const file = "src\\components\\cookies-dialog.svelte";
|
|
||||||
|
|
||||||
function create_fragment(ctx) {
|
|
||||||
let div1;
|
|
||||||
let div0;
|
|
||||||
let p;
|
|
||||||
|
|
||||||
const block = {
|
|
||||||
c: function create() {
|
|
||||||
div1 = element("div");
|
|
||||||
div0 = element("div");
|
|
||||||
p = element("p");
|
|
||||||
p.textContent = "We use cookies to improve your experience, personalise your content and analyse site usage. By clicking “OK”, you agree to the use of cookies.";
|
|
||||||
this.c = noop;
|
|
||||||
add_location(p, file, 19, 8, 248);
|
|
||||||
add_location(div0, file, 18, 4, 233);
|
|
||||||
attr_dev(div1, "id", "wrapper");
|
|
||||||
add_location(div1, file, 17, 0, 209);
|
|
||||||
},
|
|
||||||
l: function claim(nodes) {
|
|
||||||
throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
|
|
||||||
},
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insert_dev(target, div1, anchor);
|
|
||||||
append_dev(div1, div0);
|
|
||||||
append_dev(div0, p);
|
|
||||||
},
|
|
||||||
p: noop,
|
|
||||||
i: noop,
|
|
||||||
o: noop,
|
|
||||||
d: function destroy(detaching) {
|
|
||||||
if (detaching) detach_dev(div1);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
dispatch_dev("SvelteRegisterBlock", {
|
|
||||||
block,
|
|
||||||
id: create_fragment.name,
|
|
||||||
type: "component",
|
|
||||||
source: "",
|
|
||||||
ctx
|
|
||||||
});
|
|
||||||
|
|
||||||
return block;
|
|
||||||
}
|
|
||||||
|
|
||||||
function instance($$self, $$props, $$invalidate) {
|
|
||||||
let { $$slots: slots = {}, $$scope } = $$props;
|
|
||||||
validate_slots('cookies-dialog', slots, []);
|
|
||||||
|
|
||||||
onMount(() => {
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
const writable_props = [];
|
|
||||||
|
|
||||||
Object.keys($$props).forEach(key => {
|
|
||||||
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(`<cookies-dialog> was created with unknown prop '${key}'`);
|
|
||||||
});
|
|
||||||
|
|
||||||
$$self.$capture_state = () => ({ onMount });
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
|
|
||||||
class Cookies_dialog extends SvelteElement {
|
|
||||||
constructor(options) {
|
|
||||||
super();
|
|
||||||
this.shadowRoot.innerHTML = `<style>@import '/css/common.css';#wrapper{display:none;position:relative;height:5rem;width:100%;background:white;box-shadow:0 0 0.314rem rgb(187, 187, 187);;}</style>`;
|
|
||||||
|
|
||||||
init(
|
|
||||||
this,
|
|
||||||
{
|
|
||||||
target: this.shadowRoot,
|
|
||||||
props: attribute_to_object(this.attributes),
|
|
||||||
customElement: true
|
|
||||||
},
|
|
||||||
instance,
|
|
||||||
create_fragment,
|
|
||||||
safe_not_equal,
|
|
||||||
{},
|
|
||||||
null
|
|
||||||
);
|
|
||||||
|
|
||||||
if (options) {
|
|
||||||
if (options.target) {
|
|
||||||
insert_dev(options.target, this, options.anchor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
customElements.define("cookies-dialog", Cookies_dialog);
|
|
||||||
|
|
||||||
export { Cookies_dialog as default };
|
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,347 +1 @@
|
||||||
|
import{S as t,i as e,a as r,b as o,s as a,p as i,n,g as s,q as m,e as c,v as d,c as f,d as l,y as g,f as p,l as h,w as u}from"./index-db20528a.js";import{w as v}from"./index-720c0a59.js";import{loadLocaleContent as w}from"../../../../../../../../../js/libraries/serverTools.js";function b(t){let e,r,a,i,n,m,v,w,b,y,k,x,L,j,z,U,_,T,C,H,M,R,B=t[1].contactUs+"",N=t[1].inviteLink+"",A=t[1].inviteLink+"";return{c(){e=c("footer"),r=c("div"),a=c("div"),i=c("div"),n=c("h2"),m=d(B),v=f(),w=c("p"),b=d("Discord: "),y=c("a"),k=d(N),x=f(),L=c("p"),j=d("WhatsApp: "),z=c("a"),U=d(A),_=f(),T=c("button"),T.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="42.545" height="72.601" viewBox="0 0 42.545 72.601"><g id="Group_268" data-name="Group 268" transform="translate(-6.177 -2.399)"><rect id="Rectangle_146" data-name="Rectangle 146" width="11" height="51" rx="5.5" transform="translate(22 24)" fill="var(--red)"></rect><path id="Path_1145" data-name="Path 1145" d="M23.814,4.021a5,5,0,0,1,7.372,0l16.134,17.6c2.94,3.207,1.046,10.4-3.686,8.379S28.02,14.081,28.391,13.524,16.544,27.976,11.366,30,4.741,24.828,7.68,21.621Z" fill="var(--red)"></path></g></svg>',C=f(),H=c("p"),H.innerHTML='Licensed under a Creative Commons <a href="https://creativecommons.org/licenses/by/4.0/legalcode " target="_blank" rel="noreferrer">CC BY 4.0 license</a>',l(y,"href","https://discord.gg/Qk8KUk787z"),l(y,"target","_blank"),l(y,"rel","noreferrer"),g(y,"margin-left","1.8rem"),l(z,"href","https://chat.whatsapp.com/BhnmUNljUxJ2AjeHUwyTKh"),l(z,"target","_blank"),l(z,"rel","noreferrer"),g(z,"margin-left","0.5rem"),l(i,"id","contact-us-container"),l(a,"id","footer-grid-content-container"),l(a,"class","logged"),l(T,"id","footer-up"),l(T,"aria-label","go up"),l(H,"id","footer-copyright"),l(r,"id","footer-content-container")},m(s,c){o(s,e,c),p(e,r),p(r,a),p(a,i),p(i,n),p(n,m),p(i,v),p(i,w),p(w,b),p(w,y),p(y,k),p(i,x),p(i,L),p(L,j),p(L,z),p(z,U),p(r,_),p(r,T),p(r,C),p(r,H),M||(R=h(T,"click",t[4]),M=!0)},p(t,e){2&e&&B!==(B=t[1].contactUs+"")&&u(m,B),2&e&&N!==(N=t[1].inviteLink+"")&&u(k,N),2&e&&A!==(A=t[1].inviteLink+"")&&u(U,A)},d(t){t&&s(e),M=!1,R()}}}function y(t){let e,r=2==t[0]&&b(t);return{c(){r&&r.c(),e=i()},m(t,a){r&&r.m(t,a),o(t,e,a)},p(t,o){2==t[0]?r?r.p(t,o):(r=b(t),r.c(),r.m(e.parentNode,e)):r&&(r.d(1),r=null)},d(t){r&&r.d(t),t&&s(e)}}}function k(t){let e,r=t[0],m=y(t);return{c(){m.c(),e=i(),this.c=n},m(t,r){m.m(t,r),o(t,e,r)},p(t,[o]){1&o&&a(r,r=t[0])?(m.d(1),m=y(t),m.c(),m.m(e.parentNode,e)):m.p(t,o)},i:n,o:n,d(t){t&&s(e),m.d(t)}}}function x(t,e,r){let o,a,i=v(0);m(t,i,(t=>r(0,o=t)));let n=v({});m(t,n,(t=>r(1,a=t))),w(n,"countries",i),w(n,"footer-component",i);return[o,a,i,n,()=>{location.href="#"}]}class L extends t{constructor(t){super(),this.shadowRoot.innerHTML="<style>@import '/css/common.css';footer{position:relative;bottom:0;width:100%;height:auto;background:var(--gray);border-top:var(--red) solid 0.5rem}footer p,footer a{font-family:var(--sans-serif)}#footer-content-container{position:relative;margin:auto;padding-top:2rem;max-width:116rem;width:97vw}#footer-grid-content-container{display:grid;margin-left:2rem;margin-right:2rem;margin-bottom:1rem}.logged{grid-template-columns:auto auto 2rem}footer h2{color:#ffffff;font-size:1.3rem;margin-bottom:0.5rem}#footer-copyright{position:relative;margin:auto;width:100%;bottom:0rem;height:3rem;top:0rem;margin-bottom:0;font-size:1rem;text-align:center}#footer-copyright *{font-size:1rem}footer a{font-size:1.1rem;color:#ffffff}footer p{display:block;font-size:1.1rem;color:#d8d8d8;font-family:var(--sans-serif,sans-serif);margin-bottom:0.5rem}#contact-us-container{width:16rem}#footer-up{position:absolute;width:4.8rem;height:4.8rem;border-radius:3.4rem;top:4rem;right:2rem;background:#ffffff}#footer-up svg{width:40%;height:auto}@media only screen and (max-width: 1170px){.logged{grid-template-rows:auto auto auto;grid-template-columns:auto;row-gap:2rem}#footer-copyright{height:1rem;top:-2rem}}</style>",e(this,{target:this.shadowRoot,props:r(this.attributes),customElement:!0},x,k,a,{},null),t&&t.target&&o(t.target,this,t.anchor)}}customElements.define("footer-component",L);export{L as default};
|
||||||
(function(l, r) { if (!l || l.getElementById('livereloadscript')) return; r = l.createElement('script'); r.async = 1; r.src = '//' + (self.location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1'; r.id = 'livereloadscript'; l.getElementsByTagName('head')[0].appendChild(r) })(self.document);
|
|
||||||
import { S as SvelteElement, i as init, a as attribute_to_object, b as insert_dev, s as safe_not_equal, d as dispatch_dev, v as validate_slots, w as validate_store, x as component_subscribe, y as empty, n as noop, p as detach_dev, f as element, B as text, h as space, G as svg_element, j as add_location, k as attr_dev, F as set_style, l as append_dev, m as listen_dev, C as set_data_dev } from './index-998178c7.js';
|
|
||||||
import { w as writable } from './index-f9998ce7.js';
|
|
||||||
import { loadLocaleContent } from '../../../../../../../../../js/libraries/serverTools.js';
|
|
||||||
|
|
||||||
/* src\footer\footer-component.svelte generated by Svelte v3.52.0 */
|
|
||||||
const file = "src\\footer\\footer-component.svelte";
|
|
||||||
|
|
||||||
// (21:4) {#if $loaded==2}
|
|
||||||
function create_if_block(ctx) {
|
|
||||||
let footer;
|
|
||||||
let div2;
|
|
||||||
let div1;
|
|
||||||
let div0;
|
|
||||||
let h2;
|
|
||||||
let t0_value = /*$content*/ ctx[1].contactUs + "";
|
|
||||||
let t0;
|
|
||||||
let t1;
|
|
||||||
let p0;
|
|
||||||
let t2;
|
|
||||||
let a0;
|
|
||||||
let t3_value = /*$content*/ ctx[1].inviteLink + "";
|
|
||||||
let t3;
|
|
||||||
let t4;
|
|
||||||
let p1;
|
|
||||||
let t5;
|
|
||||||
let a1;
|
|
||||||
let t6_value = /*$content*/ ctx[1].inviteLink + "";
|
|
||||||
let t6;
|
|
||||||
let t7;
|
|
||||||
let button;
|
|
||||||
let svg;
|
|
||||||
let g;
|
|
||||||
let rect;
|
|
||||||
let path;
|
|
||||||
let t8;
|
|
||||||
let p2;
|
|
||||||
let t9;
|
|
||||||
let a2;
|
|
||||||
let mounted;
|
|
||||||
let dispose;
|
|
||||||
|
|
||||||
const block = {
|
|
||||||
c: function create() {
|
|
||||||
footer = element("footer");
|
|
||||||
div2 = element("div");
|
|
||||||
div1 = element("div");
|
|
||||||
div0 = element("div");
|
|
||||||
h2 = element("h2");
|
|
||||||
t0 = text(t0_value);
|
|
||||||
t1 = space();
|
|
||||||
p0 = element("p");
|
|
||||||
t2 = text("Discord: ");
|
|
||||||
a0 = element("a");
|
|
||||||
t3 = text(t3_value);
|
|
||||||
t4 = space();
|
|
||||||
p1 = element("p");
|
|
||||||
t5 = text("WhatsApp: ");
|
|
||||||
a1 = element("a");
|
|
||||||
t6 = text(t6_value);
|
|
||||||
t7 = space();
|
|
||||||
button = element("button");
|
|
||||||
svg = svg_element("svg");
|
|
||||||
g = svg_element("g");
|
|
||||||
rect = svg_element("rect");
|
|
||||||
path = svg_element("path");
|
|
||||||
t8 = space();
|
|
||||||
p2 = element("p");
|
|
||||||
t9 = text("Licensed under a Creative Commons ");
|
|
||||||
a2 = element("a");
|
|
||||||
a2.textContent = "CC BY 4.0 license";
|
|
||||||
add_location(h2, file, 25, 24, 692);
|
|
||||||
attr_dev(a0, "href", "https://discord.gg/Qk8KUk787z");
|
|
||||||
attr_dev(a0, "target", "_blank");
|
|
||||||
attr_dev(a0, "rel", "noreferrer");
|
|
||||||
set_style(a0, "margin-left", "1.8rem");
|
|
||||||
add_location(a0, file, 27, 36, 858);
|
|
||||||
add_location(p0, file, 27, 24, 846);
|
|
||||||
attr_dev(a1, "href", "https://chat.whatsapp.com/BhnmUNljUxJ2AjeHUwyTKh");
|
|
||||||
attr_dev(a1, "target", "_blank");
|
|
||||||
attr_dev(a1, "rel", "noreferrer");
|
|
||||||
set_style(a1, "margin-left", "0.5rem");
|
|
||||||
add_location(a1, file, 28, 37, 1026);
|
|
||||||
add_location(p1, file, 28, 24, 1013);
|
|
||||||
attr_dev(div0, "id", "contact-us-container");
|
|
||||||
add_location(div0, file, 24, 20, 635);
|
|
||||||
attr_dev(div1, "id", "footer-grid-content-container");
|
|
||||||
attr_dev(div1, "class", "logged");
|
|
||||||
add_location(div1, file, 23, 16, 558);
|
|
||||||
attr_dev(rect, "id", "Rectangle_146");
|
|
||||||
attr_dev(rect, "data-name", "Rectangle 146");
|
|
||||||
attr_dev(rect, "width", "11");
|
|
||||||
attr_dev(rect, "height", "51");
|
|
||||||
attr_dev(rect, "rx", "5.5");
|
|
||||||
attr_dev(rect, "transform", "translate(22 24)");
|
|
||||||
attr_dev(rect, "fill", "var(--red)");
|
|
||||||
add_location(rect, file, 34, 24, 1573);
|
|
||||||
attr_dev(path, "id", "Path_1145");
|
|
||||||
attr_dev(path, "data-name", "Path 1145");
|
|
||||||
attr_dev(path, "d", "M23.814,4.021a5,5,0,0,1,7.372,0l16.134,17.6c2.94,3.207,1.046,10.4-3.686,8.379S28.02,14.081,28.391,13.524,16.544,27.976,11.366,30,4.741,24.828,7.68,21.621Z");
|
|
||||||
attr_dev(path, "fill", "var(--red)");
|
|
||||||
add_location(path, file, 35, 24, 1730);
|
|
||||||
attr_dev(g, "id", "Group_268");
|
|
||||||
attr_dev(g, "data-name", "Group 268");
|
|
||||||
attr_dev(g, "transform", "translate(-6.177 -2.399)");
|
|
||||||
add_location(g, file, 33, 24, 1470);
|
|
||||||
attr_dev(svg, "xmlns", "http://www.w3.org/2000/svg");
|
|
||||||
attr_dev(svg, "width", "42.545");
|
|
||||||
attr_dev(svg, "height", "72.601");
|
|
||||||
attr_dev(svg, "viewBox", "0 0 42.545 72.601");
|
|
||||||
add_location(svg, file, 32, 20, 1345);
|
|
||||||
attr_dev(button, "id", "footer-up");
|
|
||||||
attr_dev(button, "aria-label", "go up");
|
|
||||||
add_location(button, file, 31, 16, 1244);
|
|
||||||
attr_dev(a2, "href", "https://creativecommons.org/licenses/by/4.0/legalcode ");
|
|
||||||
attr_dev(a2, "target", "_blank");
|
|
||||||
attr_dev(a2, "rel", "noreferrer");
|
|
||||||
add_location(a2, file, 39, 75, 2143);
|
|
||||||
attr_dev(p2, "id", "footer-copyright");
|
|
||||||
add_location(p2, file, 39, 16, 2084);
|
|
||||||
attr_dev(div2, "id", "footer-content-container");
|
|
||||||
add_location(div2, file, 22, 12, 505);
|
|
||||||
add_location(footer, file, 21, 8, 483);
|
|
||||||
},
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insert_dev(target, footer, anchor);
|
|
||||||
append_dev(footer, div2);
|
|
||||||
append_dev(div2, div1);
|
|
||||||
append_dev(div1, div0);
|
|
||||||
append_dev(div0, h2);
|
|
||||||
append_dev(h2, t0);
|
|
||||||
append_dev(div0, t1);
|
|
||||||
append_dev(div0, p0);
|
|
||||||
append_dev(p0, t2);
|
|
||||||
append_dev(p0, a0);
|
|
||||||
append_dev(a0, t3);
|
|
||||||
append_dev(div0, t4);
|
|
||||||
append_dev(div0, p1);
|
|
||||||
append_dev(p1, t5);
|
|
||||||
append_dev(p1, a1);
|
|
||||||
append_dev(a1, t6);
|
|
||||||
append_dev(div2, t7);
|
|
||||||
append_dev(div2, button);
|
|
||||||
append_dev(button, svg);
|
|
||||||
append_dev(svg, g);
|
|
||||||
append_dev(g, rect);
|
|
||||||
append_dev(g, path);
|
|
||||||
append_dev(div2, t8);
|
|
||||||
append_dev(div2, p2);
|
|
||||||
append_dev(p2, t9);
|
|
||||||
append_dev(p2, a2);
|
|
||||||
|
|
||||||
if (!mounted) {
|
|
||||||
dispose = listen_dev(button, "click", /*click_handler*/ ctx[4], false, false, false);
|
|
||||||
mounted = true;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
p: function update(ctx, dirty) {
|
|
||||||
if (dirty & /*$content*/ 2 && t0_value !== (t0_value = /*$content*/ ctx[1].contactUs + "")) set_data_dev(t0, t0_value);
|
|
||||||
if (dirty & /*$content*/ 2 && t3_value !== (t3_value = /*$content*/ ctx[1].inviteLink + "")) set_data_dev(t3, t3_value);
|
|
||||||
if (dirty & /*$content*/ 2 && t6_value !== (t6_value = /*$content*/ ctx[1].inviteLink + "")) set_data_dev(t6, t6_value);
|
|
||||||
},
|
|
||||||
d: function destroy(detaching) {
|
|
||||||
if (detaching) detach_dev(footer);
|
|
||||||
mounted = false;
|
|
||||||
dispose();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
dispatch_dev("SvelteRegisterBlock", {
|
|
||||||
block,
|
|
||||||
id: create_if_block.name,
|
|
||||||
type: "if",
|
|
||||||
source: "(21:4) {#if $loaded==2}",
|
|
||||||
ctx
|
|
||||||
});
|
|
||||||
|
|
||||||
return block;
|
|
||||||
}
|
|
||||||
|
|
||||||
// (20:0) {#key $loaded}
|
|
||||||
function create_key_block(ctx) {
|
|
||||||
let if_block_anchor;
|
|
||||||
let if_block = /*$loaded*/ ctx[0] == 2 && create_if_block(ctx);
|
|
||||||
|
|
||||||
const block = {
|
|
||||||
c: function create() {
|
|
||||||
if (if_block) if_block.c();
|
|
||||||
if_block_anchor = empty();
|
|
||||||
},
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
if (if_block) if_block.m(target, anchor);
|
|
||||||
insert_dev(target, if_block_anchor, anchor);
|
|
||||||
},
|
|
||||||
p: function update(ctx, dirty) {
|
|
||||||
if (/*$loaded*/ ctx[0] == 2) {
|
|
||||||
if (if_block) {
|
|
||||||
if_block.p(ctx, dirty);
|
|
||||||
} else {
|
|
||||||
if_block = create_if_block(ctx);
|
|
||||||
if_block.c();
|
|
||||||
if_block.m(if_block_anchor.parentNode, if_block_anchor);
|
|
||||||
}
|
|
||||||
} else if (if_block) {
|
|
||||||
if_block.d(1);
|
|
||||||
if_block = null;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
d: function destroy(detaching) {
|
|
||||||
if (if_block) if_block.d(detaching);
|
|
||||||
if (detaching) detach_dev(if_block_anchor);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
dispatch_dev("SvelteRegisterBlock", {
|
|
||||||
block,
|
|
||||||
id: create_key_block.name,
|
|
||||||
type: "key",
|
|
||||||
source: "(20:0) {#key $loaded}",
|
|
||||||
ctx
|
|
||||||
});
|
|
||||||
|
|
||||||
return block;
|
|
||||||
}
|
|
||||||
|
|
||||||
function create_fragment(ctx) {
|
|
||||||
let previous_key = /*$loaded*/ ctx[0];
|
|
||||||
let key_block_anchor;
|
|
||||||
let key_block = create_key_block(ctx);
|
|
||||||
|
|
||||||
const block = {
|
|
||||||
c: function create() {
|
|
||||||
key_block.c();
|
|
||||||
key_block_anchor = empty();
|
|
||||||
this.c = noop;
|
|
||||||
},
|
|
||||||
l: function claim(nodes) {
|
|
||||||
throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
|
|
||||||
},
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
key_block.m(target, anchor);
|
|
||||||
insert_dev(target, key_block_anchor, anchor);
|
|
||||||
},
|
|
||||||
p: function update(ctx, [dirty]) {
|
|
||||||
if (dirty & /*$loaded*/ 1 && safe_not_equal(previous_key, previous_key = /*$loaded*/ ctx[0])) {
|
|
||||||
key_block.d(1);
|
|
||||||
key_block = create_key_block(ctx);
|
|
||||||
key_block.c();
|
|
||||||
key_block.m(key_block_anchor.parentNode, key_block_anchor);
|
|
||||||
} else {
|
|
||||||
key_block.p(ctx, dirty);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
i: noop,
|
|
||||||
o: noop,
|
|
||||||
d: function destroy(detaching) {
|
|
||||||
if (detaching) detach_dev(key_block_anchor);
|
|
||||||
key_block.d(detaching);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
dispatch_dev("SvelteRegisterBlock", {
|
|
||||||
block,
|
|
||||||
id: create_fragment.name,
|
|
||||||
type: "component",
|
|
||||||
source: "",
|
|
||||||
ctx
|
|
||||||
});
|
|
||||||
|
|
||||||
return block;
|
|
||||||
}
|
|
||||||
|
|
||||||
function instance($$self, $$props, $$invalidate) {
|
|
||||||
let $loaded;
|
|
||||||
let $content;
|
|
||||||
let { $$slots: slots = {}, $$scope } = $$props;
|
|
||||||
validate_slots('footer-component', slots, []);
|
|
||||||
let loaded = writable(0);
|
|
||||||
validate_store(loaded, 'loaded');
|
|
||||||
component_subscribe($$self, loaded, value => $$invalidate(0, $loaded = value));
|
|
||||||
let content = writable({});
|
|
||||||
validate_store(content, 'content');
|
|
||||||
component_subscribe($$self, content, value => $$invalidate(1, $content = value));
|
|
||||||
loadLocaleContent(content, "countries", loaded);
|
|
||||||
loadLocaleContent(content, "footer-component", loaded);
|
|
||||||
const writable_props = [];
|
|
||||||
|
|
||||||
Object.keys($$props).forEach(key => {
|
|
||||||
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(`<footer-component> was created with unknown prop '${key}'`);
|
|
||||||
});
|
|
||||||
|
|
||||||
const click_handler = () => {
|
|
||||||
location.href = '#';
|
|
||||||
};
|
|
||||||
|
|
||||||
$$self.$capture_state = () => ({
|
|
||||||
writable,
|
|
||||||
loadLocaleContent,
|
|
||||||
loaded,
|
|
||||||
content,
|
|
||||||
$loaded,
|
|
||||||
$content
|
|
||||||
});
|
|
||||||
|
|
||||||
$$self.$inject_state = $$props => {
|
|
||||||
if ('loaded' in $$props) $$invalidate(2, loaded = $$props.loaded);
|
|
||||||
if ('content' in $$props) $$invalidate(3, content = $$props.content);
|
|
||||||
};
|
|
||||||
|
|
||||||
if ($$props && "$$inject" in $$props) {
|
|
||||||
$$self.$inject_state($$props.$$inject);
|
|
||||||
}
|
|
||||||
|
|
||||||
return [$loaded, $content, loaded, content, click_handler];
|
|
||||||
}
|
|
||||||
|
|
||||||
class Footer_component extends SvelteElement {
|
|
||||||
constructor(options) {
|
|
||||||
super();
|
|
||||||
this.shadowRoot.innerHTML = `<style>@import '/css/common.css';footer{position:relative;bottom:0;width:100%;height:auto;background:var(--gray);border-top:var(--red) solid 0.5rem}footer p,footer a{font-family:var(--sans-serif)}#footer-content-container{position:relative;margin:auto;padding-top:2rem;max-width:116rem;width:97vw}#footer-grid-content-container{display:grid;margin-left:2rem;margin-right:2rem;margin-bottom:1rem}.logged{grid-template-columns:auto auto 2rem}footer h2{color:#ffffff;font-size:1.3rem;margin-bottom:0.5rem}#footer-copyright{position:relative;margin:auto;width:100%;bottom:0rem;height:3rem;top:0rem;margin-bottom:0;font-size:1rem;text-align:center}#footer-copyright *{font-size:1rem}footer a{font-size:1.1rem;color:#ffffff}footer p{display:block;font-size:1.1rem;color:#d8d8d8;font-family:var(--sans-serif,sans-serif);margin-bottom:0.5rem}#contact-us-container{width:16rem}#footer-up{position:absolute;width:4.8rem;height:4.8rem;border-radius:3.4rem;top:4rem;right:2rem;background:#ffffff}#footer-up svg{width:40%;height:auto}@media only screen and (max-width: 1170px){.logged{grid-template-rows:auto auto auto;grid-template-columns:auto;row-gap:2rem}#footer-copyright{height:1rem;top:-2rem}}</style>`;
|
|
||||||
|
|
||||||
init(
|
|
||||||
this,
|
|
||||||
{
|
|
||||||
target: this.shadowRoot,
|
|
||||||
props: attribute_to_object(this.attributes),
|
|
||||||
customElement: true
|
|
||||||
},
|
|
||||||
instance,
|
|
||||||
create_fragment,
|
|
||||||
safe_not_equal,
|
|
||||||
{},
|
|
||||||
null
|
|
||||||
);
|
|
||||||
|
|
||||||
if (options) {
|
|
||||||
if (options.target) {
|
|
||||||
insert_dev(options.target, this, options.anchor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
customElements.define("footer-component", Footer_component);
|
|
||||||
|
|
||||||
export { Footer_component as default };
|
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,53 @@
|
||||||
|
|
||||||
|
(function(l, r) { if (!l || l.getElementById('livereloadscript')) return; r = l.createElement('script'); r.async = 1; r.src = '//' + (self.location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1'; r.id = 'livereloadscript'; l.getElementsByTagName('head')[0].appendChild(r) })(self.document);
|
||||||
|
import { n as noop, s as safe_not_equal } from './index-e7d4b1a1.js';
|
||||||
|
|
||||||
|
const subscriber_queue = [];
|
||||||
|
/**
|
||||||
|
* Create a `Writable` store that allows both updating and reading by subscription.
|
||||||
|
* @param {*=}value initial value
|
||||||
|
* @param {StartStopNotifier=}start start and stop notifications for subscriptions
|
||||||
|
*/
|
||||||
|
function writable(value, start = noop) {
|
||||||
|
let stop;
|
||||||
|
const subscribers = new Set();
|
||||||
|
function set(new_value) {
|
||||||
|
if (safe_not_equal(value, new_value)) {
|
||||||
|
value = new_value;
|
||||||
|
if (stop) { // store is ready
|
||||||
|
const run_queue = !subscriber_queue.length;
|
||||||
|
for (const subscriber of subscribers) {
|
||||||
|
subscriber[1]();
|
||||||
|
subscriber_queue.push(subscriber, value);
|
||||||
|
}
|
||||||
|
if (run_queue) {
|
||||||
|
for (let i = 0; i < subscriber_queue.length; i += 2) {
|
||||||
|
subscriber_queue[i][0](subscriber_queue[i + 1]);
|
||||||
|
}
|
||||||
|
subscriber_queue.length = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function update(fn) {
|
||||||
|
set(fn(value));
|
||||||
|
}
|
||||||
|
function subscribe(run, invalidate = noop) {
|
||||||
|
const subscriber = [run, invalidate];
|
||||||
|
subscribers.add(subscriber);
|
||||||
|
if (subscribers.size === 1) {
|
||||||
|
stop = start(set) || noop;
|
||||||
|
}
|
||||||
|
run(value);
|
||||||
|
return () => {
|
||||||
|
subscribers.delete(subscriber);
|
||||||
|
if (subscribers.size === 0) {
|
||||||
|
stop();
|
||||||
|
stop = null;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return { set, update, subscribe };
|
||||||
|
}
|
||||||
|
|
||||||
|
export { writable as w };
|
|
@ -0,0 +1 @@
|
||||||
|
import{n,s as t}from"./index-db20528a.js";const e=[];function s(s,o=n){let i;const c=new Set;function f(n){if(t(s,n)&&(s=n,i)){const n=!e.length;for(const n of c)n[1](),e.push(n,s);if(n){for(let n=0;n<e.length;n+=2)e[n][0](e[n+1]);e.length=0}}}return{set:f,update:function(n){f(n(s))},subscribe:function(t,e=n){const r=[t,e];return c.add(r),1===c.size&&(i=o(f)||n),t(s),()=>{c.delete(r),0===c.size&&(i(),i=null)}}}}export{s as w};
|
|
@ -0,0 +1 @@
|
||||||
|
function t(){}function n(t){return t()}function e(){return Object.create(null)}function o(t){t.forEach(n)}function s(t){return"function"==typeof t}function r(t,n){return t!=t?n==n:t!==n||t&&"object"==typeof t||"function"==typeof t}let i,c;function u(t,n){return i||(i=document.createElement("a")),i.href=n,t===i.href}function a(n,e,o){n.$$.on_destroy.push(function(n,...e){if(null==n)return t;const o=n.subscribe(...e);return o.unsubscribe?()=>o.unsubscribe():o}(e,o))}function f(t,n){t.appendChild(n)}function l(t,n,e){t.insertBefore(n,e||null)}function h(t){t.parentNode.removeChild(t)}function d(t,n){for(let e=0;e<t.length;e+=1)t[e]&&t[e].d(n)}function $(t){return document.createElement(t)}function p(t){return document.createTextNode(t)}function m(){return p(" ")}function g(){return p("")}function b(t,n,e,o){return t.addEventListener(n,e,o),()=>t.removeEventListener(n,e,o)}function y(t,n,e){null==e?t.removeAttribute(n):t.getAttribute(n)!==e&&t.setAttribute(n,e)}function _(t,n,e){n in t?t[n]="boolean"==typeof t[n]&&""===e||e:y(t,n,e)}function x(t,n){n=""+n,t.wholeText!==n&&(t.data=n)}function v(t,n){t.value=null==n?"":n}function E(t,n,e,o){null===e?t.style.removeProperty(n):t.style.setProperty(n,e,o?"important":"")}class w{constructor(t=!1){this.is_svg=!1,this.is_svg=t,this.e=this.n=null}c(t){this.h(t)}m(t,n,e=null){var o;this.e||(this.is_svg?this.e=(o=n.nodeName,document.createElementNS("http://www.w3.org/2000/svg",o)):this.e=$(n.nodeName),this.t=n,this.c(t)),this.i(e)}h(t){this.e.innerHTML=t,this.n=Array.from(this.e.childNodes)}i(t){for(let n=0;n<this.n.length;n+=1)l(this.t,this.n[n],t)}p(t){this.d(),this.h(t),this.i(this.a)}d(){this.n.forEach(h)}}function k(t){const n={};for(const e of t)n[e.name]=e.value;return n}function C(t){c=t}function N(){if(!c)throw new Error("Function called outside component initialization");return c}function A(t){N().$$.on_mount.push(t)}function L(t,n){return N().$$.context.set(t,n),n}function S(t){return N().$$.context.get(t)}const T=[],j=[],H=[],M=[],O=Promise.resolve();let P=!1;function q(t){H.push(t)}const z=new Set;let B=0;function F(){const t=c;do{for(;B<T.length;){const t=T[B];B++,C(t),D(t.$$)}for(C(null),T.length=0,B=0;j.length;)j.pop()();for(let t=0;t<H.length;t+=1){const n=H[t];z.has(n)||(z.add(n),n())}H.length=0}while(T.length);for(;M.length;)M.pop()();P=!1,z.clear(),C(t)}function D(t){if(null!==t.fragment){t.update(),o(t.before_update);const n=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,n),t.after_update.forEach(q)}}const G=new Set;function I(t,n){-1===t.$$.dirty[0]&&(T.push(t),P||(P=!0,O.then(F)),t.$$.dirty.fill(0)),t.$$.dirty[n/31|0]|=1<<n%31}function J(r,i,u,a,f,l,d,$=[-1]){const p=c;C(r);const m=r.$$={fragment:null,ctx:[],props:l,update:t,not_equal:f,bound:e(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(i.context||(p?p.$$.context:[])),callbacks:e(),dirty:$,skip_bound:!1,root:i.target||p.$$.root};d&&d(m.root);let g=!1;if(m.ctx=u?u(r,i.props||{},((t,n,...e)=>{const o=e.length?e[0]:n;return m.ctx&&f(m.ctx[t],m.ctx[t]=o)&&(!m.skip_bound&&m.bound[t]&&m.bound[t](o),g&&I(r,t)),n})):[],m.update(),g=!0,o(m.before_update),m.fragment=!!a&&a(m.ctx),i.target){if(i.hydrate){const t=function(t){return Array.from(t.childNodes)}(i.target);m.fragment&&m.fragment.l(t),t.forEach(h)}else m.fragment&&m.fragment.c();i.intro&&((b=r.$$.fragment)&&b.i&&(G.delete(b),b.i(y))),function(t,e,r,i){const{fragment:c,after_update:u}=t.$$;c&&c.m(e,r),i||q((()=>{const e=t.$$.on_mount.map(n).filter(s);t.$$.on_destroy?t.$$.on_destroy.push(...e):o(e),t.$$.on_mount=[]})),u.forEach(q)}(r,i.target,i.anchor,i.customElement),F()}var b,y;C(p)}let K;"function"==typeof HTMLElement&&(K=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(n).filter(s);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,n,e){this[t]=e}disconnectedCallback(){o(this.$$.on_disconnect)}$destroy(){!function(t,n){const e=t.$$;null!==e.fragment&&(o(e.on_destroy),e.fragment&&e.fragment.d(n),e.on_destroy=e.fragment=null,e.ctx=[])}(this,1),this.$destroy=t}$on(n,e){if(!s(e))return t;const o=this.$$.callbacks[n]||(this.$$.callbacks[n]=[]);return o.push(e),()=>{const t=o.indexOf(e);-1!==t&&o.splice(t,1)}}$set(t){var n;this.$$set&&(n=t,0!==Object.keys(n).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});export{v as A,w as H,K as S,k as a,l as b,m as c,y as d,$ as e,f,h as g,L as h,J as i,j,F as k,b as l,S as m,t as n,A as o,g as p,a as q,o as r,r as s,u as t,_ as u,p as v,x as w,d as x,E as y,s as z};
|
|
@ -0,0 +1,524 @@
|
||||||
|
|
||||||
|
(function(l, r) { if (!l || l.getElementById('livereloadscript')) return; r = l.createElement('script'); r.async = 1; r.src = '//' + (self.location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1'; r.id = 'livereloadscript'; l.getElementsByTagName('head')[0].appendChild(r) })(self.document);
|
||||||
|
function noop() { }
|
||||||
|
function add_location(element, file, line, column, char) {
|
||||||
|
element.__svelte_meta = {
|
||||||
|
loc: { file, line, column, char }
|
||||||
|
};
|
||||||
|
}
|
||||||
|
function run(fn) {
|
||||||
|
return fn();
|
||||||
|
}
|
||||||
|
function blank_object() {
|
||||||
|
return Object.create(null);
|
||||||
|
}
|
||||||
|
function run_all(fns) {
|
||||||
|
fns.forEach(run);
|
||||||
|
}
|
||||||
|
function is_function(thing) {
|
||||||
|
return typeof thing === 'function';
|
||||||
|
}
|
||||||
|
function safe_not_equal(a, b) {
|
||||||
|
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
|
||||||
|
}
|
||||||
|
let src_url_equal_anchor;
|
||||||
|
function src_url_equal(element_src, url) {
|
||||||
|
if (!src_url_equal_anchor) {
|
||||||
|
src_url_equal_anchor = document.createElement('a');
|
||||||
|
}
|
||||||
|
src_url_equal_anchor.href = url;
|
||||||
|
return element_src === src_url_equal_anchor.href;
|
||||||
|
}
|
||||||
|
function is_empty(obj) {
|
||||||
|
return Object.keys(obj).length === 0;
|
||||||
|
}
|
||||||
|
function validate_store(store, name) {
|
||||||
|
if (store != null && typeof store.subscribe !== 'function') {
|
||||||
|
throw new Error(`'${name}' is not a store with a 'subscribe' method`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function subscribe(store, ...callbacks) {
|
||||||
|
if (store == null) {
|
||||||
|
return noop;
|
||||||
|
}
|
||||||
|
const unsub = store.subscribe(...callbacks);
|
||||||
|
return unsub.unsubscribe ? () => unsub.unsubscribe() : unsub;
|
||||||
|
}
|
||||||
|
function component_subscribe(component, store, callback) {
|
||||||
|
component.$$.on_destroy.push(subscribe(store, callback));
|
||||||
|
}
|
||||||
|
function append(target, node) {
|
||||||
|
target.appendChild(node);
|
||||||
|
}
|
||||||
|
function insert(target, node, anchor) {
|
||||||
|
target.insertBefore(node, anchor || null);
|
||||||
|
}
|
||||||
|
function detach(node) {
|
||||||
|
node.parentNode.removeChild(node);
|
||||||
|
}
|
||||||
|
function destroy_each(iterations, detaching) {
|
||||||
|
for (let i = 0; i < iterations.length; i += 1) {
|
||||||
|
if (iterations[i])
|
||||||
|
iterations[i].d(detaching);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function element(name) {
|
||||||
|
return document.createElement(name);
|
||||||
|
}
|
||||||
|
function svg_element(name) {
|
||||||
|
return document.createElementNS('http://www.w3.org/2000/svg', name);
|
||||||
|
}
|
||||||
|
function text(data) {
|
||||||
|
return document.createTextNode(data);
|
||||||
|
}
|
||||||
|
function space() {
|
||||||
|
return text(' ');
|
||||||
|
}
|
||||||
|
function empty() {
|
||||||
|
return text('');
|
||||||
|
}
|
||||||
|
function listen(node, event, handler, options) {
|
||||||
|
node.addEventListener(event, handler, options);
|
||||||
|
return () => node.removeEventListener(event, handler, options);
|
||||||
|
}
|
||||||
|
function attr(node, attribute, value) {
|
||||||
|
if (value == null)
|
||||||
|
node.removeAttribute(attribute);
|
||||||
|
else if (node.getAttribute(attribute) !== value)
|
||||||
|
node.setAttribute(attribute, value);
|
||||||
|
}
|
||||||
|
function set_custom_element_data(node, prop, value) {
|
||||||
|
if (prop in node) {
|
||||||
|
node[prop] = typeof node[prop] === 'boolean' && value === '' ? true : value;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
attr(node, prop, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function children(element) {
|
||||||
|
return Array.from(element.childNodes);
|
||||||
|
}
|
||||||
|
function set_input_value(input, value) {
|
||||||
|
input.value = value == null ? '' : value;
|
||||||
|
}
|
||||||
|
function set_style(node, key, value, important) {
|
||||||
|
if (value === null) {
|
||||||
|
node.style.removeProperty(key);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
node.style.setProperty(key, value, important ? 'important' : '');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function custom_event(type, detail, { bubbles = false, cancelable = false } = {}) {
|
||||||
|
const e = document.createEvent('CustomEvent');
|
||||||
|
e.initCustomEvent(type, bubbles, cancelable, detail);
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
class HtmlTag {
|
||||||
|
constructor(is_svg = false) {
|
||||||
|
this.is_svg = false;
|
||||||
|
this.is_svg = is_svg;
|
||||||
|
this.e = this.n = null;
|
||||||
|
}
|
||||||
|
c(html) {
|
||||||
|
this.h(html);
|
||||||
|
}
|
||||||
|
m(html, target, anchor = null) {
|
||||||
|
if (!this.e) {
|
||||||
|
if (this.is_svg)
|
||||||
|
this.e = svg_element(target.nodeName);
|
||||||
|
else
|
||||||
|
this.e = element(target.nodeName);
|
||||||
|
this.t = target;
|
||||||
|
this.c(html);
|
||||||
|
}
|
||||||
|
this.i(anchor);
|
||||||
|
}
|
||||||
|
h(html) {
|
||||||
|
this.e.innerHTML = html;
|
||||||
|
this.n = Array.from(this.e.childNodes);
|
||||||
|
}
|
||||||
|
i(anchor) {
|
||||||
|
for (let i = 0; i < this.n.length; i += 1) {
|
||||||
|
insert(this.t, this.n[i], anchor);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
p(html) {
|
||||||
|
this.d();
|
||||||
|
this.h(html);
|
||||||
|
this.i(this.a);
|
||||||
|
}
|
||||||
|
d() {
|
||||||
|
this.n.forEach(detach);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function attribute_to_object(attributes) {
|
||||||
|
const result = {};
|
||||||
|
for (const attribute of attributes) {
|
||||||
|
result[attribute.name] = attribute.value;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
let current_component;
|
||||||
|
function set_current_component(component) {
|
||||||
|
current_component = component;
|
||||||
|
}
|
||||||
|
function get_current_component() {
|
||||||
|
if (!current_component)
|
||||||
|
throw new Error('Function called outside component initialization');
|
||||||
|
return current_component;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* The `onMount` function schedules a callback to run as soon as the component has been mounted to the DOM.
|
||||||
|
* It must be called during the component's initialisation (but doesn't need to live *inside* the component;
|
||||||
|
* it can be called from an external module).
|
||||||
|
*
|
||||||
|
* `onMount` does not run inside a [server-side component](/docs#run-time-server-side-component-api).
|
||||||
|
*
|
||||||
|
* https://svelte.dev/docs#run-time-svelte-onmount
|
||||||
|
*/
|
||||||
|
function onMount(fn) {
|
||||||
|
get_current_component().$$.on_mount.push(fn);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Schedules a callback to run immediately after the component has been updated.
|
||||||
|
*
|
||||||
|
* The first time the callback runs will be after the initial `onMount`
|
||||||
|
*/
|
||||||
|
function afterUpdate(fn) {
|
||||||
|
get_current_component().$$.after_update.push(fn);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Associates an arbitrary `context` object with the current component and the specified `key`
|
||||||
|
* and returns that object. The context is then available to children of the component
|
||||||
|
* (including slotted content) with `getContext`.
|
||||||
|
*
|
||||||
|
* Like lifecycle functions, this must be called during component initialisation.
|
||||||
|
*
|
||||||
|
* https://svelte.dev/docs#run-time-svelte-setcontext
|
||||||
|
*/
|
||||||
|
function setContext(key, context) {
|
||||||
|
get_current_component().$$.context.set(key, context);
|
||||||
|
return context;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Retrieves the context that belongs to the closest parent component with the specified `key`.
|
||||||
|
* Must be called during component initialisation.
|
||||||
|
*
|
||||||
|
* https://svelte.dev/docs#run-time-svelte-getcontext
|
||||||
|
*/
|
||||||
|
function getContext(key) {
|
||||||
|
return get_current_component().$$.context.get(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
const dirty_components = [];
|
||||||
|
const binding_callbacks = [];
|
||||||
|
const render_callbacks = [];
|
||||||
|
const flush_callbacks = [];
|
||||||
|
const resolved_promise = Promise.resolve();
|
||||||
|
let update_scheduled = false;
|
||||||
|
function schedule_update() {
|
||||||
|
if (!update_scheduled) {
|
||||||
|
update_scheduled = true;
|
||||||
|
resolved_promise.then(flush);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function add_render_callback(fn) {
|
||||||
|
render_callbacks.push(fn);
|
||||||
|
}
|
||||||
|
// flush() calls callbacks in this order:
|
||||||
|
// 1. All beforeUpdate callbacks, in order: parents before children
|
||||||
|
// 2. All bind:this callbacks, in reverse order: children before parents.
|
||||||
|
// 3. All afterUpdate callbacks, in order: parents before children. EXCEPT
|
||||||
|
// for afterUpdates called during the initial onMount, which are called in
|
||||||
|
// reverse order: children before parents.
|
||||||
|
// Since callbacks might update component values, which could trigger another
|
||||||
|
// call to flush(), the following steps guard against this:
|
||||||
|
// 1. During beforeUpdate, any updated components will be added to the
|
||||||
|
// dirty_components array and will cause a reentrant call to flush(). Because
|
||||||
|
// the flush index is kept outside the function, the reentrant call will pick
|
||||||
|
// up where the earlier call left off and go through all dirty components. The
|
||||||
|
// current_component value is saved and restored so that the reentrant call will
|
||||||
|
// not interfere with the "parent" flush() call.
|
||||||
|
// 2. bind:this callbacks cannot trigger new flush() calls.
|
||||||
|
// 3. During afterUpdate, any updated components will NOT have their afterUpdate
|
||||||
|
// callback called a second time; the seen_callbacks set, outside the flush()
|
||||||
|
// function, guarantees this behavior.
|
||||||
|
const seen_callbacks = new Set();
|
||||||
|
let flushidx = 0; // Do *not* move this inside the flush() function
|
||||||
|
function flush() {
|
||||||
|
const saved_component = current_component;
|
||||||
|
do {
|
||||||
|
// first, call beforeUpdate functions
|
||||||
|
// and update components
|
||||||
|
while (flushidx < dirty_components.length) {
|
||||||
|
const component = dirty_components[flushidx];
|
||||||
|
flushidx++;
|
||||||
|
set_current_component(component);
|
||||||
|
update(component.$$);
|
||||||
|
}
|
||||||
|
set_current_component(null);
|
||||||
|
dirty_components.length = 0;
|
||||||
|
flushidx = 0;
|
||||||
|
while (binding_callbacks.length)
|
||||||
|
binding_callbacks.pop()();
|
||||||
|
// then, once components are updated, call
|
||||||
|
// afterUpdate functions. This may cause
|
||||||
|
// subsequent updates...
|
||||||
|
for (let i = 0; i < render_callbacks.length; i += 1) {
|
||||||
|
const callback = render_callbacks[i];
|
||||||
|
if (!seen_callbacks.has(callback)) {
|
||||||
|
// ...so guard against infinite loops
|
||||||
|
seen_callbacks.add(callback);
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
render_callbacks.length = 0;
|
||||||
|
} while (dirty_components.length);
|
||||||
|
while (flush_callbacks.length) {
|
||||||
|
flush_callbacks.pop()();
|
||||||
|
}
|
||||||
|
update_scheduled = false;
|
||||||
|
seen_callbacks.clear();
|
||||||
|
set_current_component(saved_component);
|
||||||
|
}
|
||||||
|
function update($$) {
|
||||||
|
if ($$.fragment !== null) {
|
||||||
|
$$.update();
|
||||||
|
run_all($$.before_update);
|
||||||
|
const dirty = $$.dirty;
|
||||||
|
$$.dirty = [-1];
|
||||||
|
$$.fragment && $$.fragment.p($$.ctx, dirty);
|
||||||
|
$$.after_update.forEach(add_render_callback);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const outroing = new Set();
|
||||||
|
function transition_in(block, local) {
|
||||||
|
if (block && block.i) {
|
||||||
|
outroing.delete(block);
|
||||||
|
block.i(local);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const globals = (typeof window !== 'undefined'
|
||||||
|
? window
|
||||||
|
: typeof globalThis !== 'undefined'
|
||||||
|
? globalThis
|
||||||
|
: global);
|
||||||
|
function mount_component(component, target, anchor, customElement) {
|
||||||
|
const { fragment, after_update } = component.$$;
|
||||||
|
fragment && fragment.m(target, anchor);
|
||||||
|
if (!customElement) {
|
||||||
|
// onMount happens before the initial afterUpdate
|
||||||
|
add_render_callback(() => {
|
||||||
|
const new_on_destroy = component.$$.on_mount.map(run).filter(is_function);
|
||||||
|
// if the component was destroyed immediately
|
||||||
|
// it will update the `$$.on_destroy` reference to `null`.
|
||||||
|
// the destructured on_destroy may still reference to the old array
|
||||||
|
if (component.$$.on_destroy) {
|
||||||
|
component.$$.on_destroy.push(...new_on_destroy);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// Edge case - component was destroyed immediately,
|
||||||
|
// most likely as a result of a binding initialising
|
||||||
|
run_all(new_on_destroy);
|
||||||
|
}
|
||||||
|
component.$$.on_mount = [];
|
||||||
|
});
|
||||||
|
}
|
||||||
|
after_update.forEach(add_render_callback);
|
||||||
|
}
|
||||||
|
function destroy_component(component, detaching) {
|
||||||
|
const $$ = component.$$;
|
||||||
|
if ($$.fragment !== null) {
|
||||||
|
run_all($$.on_destroy);
|
||||||
|
$$.fragment && $$.fragment.d(detaching);
|
||||||
|
// TODO null out other refs, including component.$$ (but need to
|
||||||
|
// preserve final state?)
|
||||||
|
$$.on_destroy = $$.fragment = null;
|
||||||
|
$$.ctx = [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function make_dirty(component, i) {
|
||||||
|
if (component.$$.dirty[0] === -1) {
|
||||||
|
dirty_components.push(component);
|
||||||
|
schedule_update();
|
||||||
|
component.$$.dirty.fill(0);
|
||||||
|
}
|
||||||
|
component.$$.dirty[(i / 31) | 0] |= (1 << (i % 31));
|
||||||
|
}
|
||||||
|
function init(component, options, instance, create_fragment, not_equal, props, append_styles, dirty = [-1]) {
|
||||||
|
const parent_component = current_component;
|
||||||
|
set_current_component(component);
|
||||||
|
const $$ = component.$$ = {
|
||||||
|
fragment: null,
|
||||||
|
ctx: [],
|
||||||
|
// state
|
||||||
|
props,
|
||||||
|
update: noop,
|
||||||
|
not_equal,
|
||||||
|
bound: blank_object(),
|
||||||
|
// lifecycle
|
||||||
|
on_mount: [],
|
||||||
|
on_destroy: [],
|
||||||
|
on_disconnect: [],
|
||||||
|
before_update: [],
|
||||||
|
after_update: [],
|
||||||
|
context: new Map(options.context || (parent_component ? parent_component.$$.context : [])),
|
||||||
|
// everything else
|
||||||
|
callbacks: blank_object(),
|
||||||
|
dirty,
|
||||||
|
skip_bound: false,
|
||||||
|
root: options.target || parent_component.$$.root
|
||||||
|
};
|
||||||
|
append_styles && append_styles($$.root);
|
||||||
|
let ready = false;
|
||||||
|
$$.ctx = instance
|
||||||
|
? instance(component, options.props || {}, (i, ret, ...rest) => {
|
||||||
|
const value = rest.length ? rest[0] : ret;
|
||||||
|
if ($$.ctx && not_equal($$.ctx[i], $$.ctx[i] = value)) {
|
||||||
|
if (!$$.skip_bound && $$.bound[i])
|
||||||
|
$$.bound[i](value);
|
||||||
|
if (ready)
|
||||||
|
make_dirty(component, i);
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
})
|
||||||
|
: [];
|
||||||
|
$$.update();
|
||||||
|
ready = true;
|
||||||
|
run_all($$.before_update);
|
||||||
|
// `false` as a special case of no DOM component
|
||||||
|
$$.fragment = create_fragment ? create_fragment($$.ctx) : false;
|
||||||
|
if (options.target) {
|
||||||
|
if (options.hydrate) {
|
||||||
|
const nodes = children(options.target);
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||||
|
$$.fragment && $$.fragment.l(nodes);
|
||||||
|
nodes.forEach(detach);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||||
|
$$.fragment && $$.fragment.c();
|
||||||
|
}
|
||||||
|
if (options.intro)
|
||||||
|
transition_in(component.$$.fragment);
|
||||||
|
mount_component(component, options.target, options.anchor, options.customElement);
|
||||||
|
flush();
|
||||||
|
}
|
||||||
|
set_current_component(parent_component);
|
||||||
|
}
|
||||||
|
let SvelteElement;
|
||||||
|
if (typeof HTMLElement === 'function') {
|
||||||
|
SvelteElement = class extends HTMLElement {
|
||||||
|
constructor() {
|
||||||
|
super();
|
||||||
|
this.attachShadow({ mode: 'open' });
|
||||||
|
}
|
||||||
|
connectedCallback() {
|
||||||
|
const { on_mount } = this.$$;
|
||||||
|
this.$$.on_disconnect = on_mount.map(run).filter(is_function);
|
||||||
|
// @ts-ignore todo: improve typings
|
||||||
|
for (const key in this.$$.slotted) {
|
||||||
|
// @ts-ignore todo: improve typings
|
||||||
|
this.appendChild(this.$$.slotted[key]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
attributeChangedCallback(attr, _oldValue, newValue) {
|
||||||
|
this[attr] = newValue;
|
||||||
|
}
|
||||||
|
disconnectedCallback() {
|
||||||
|
run_all(this.$$.on_disconnect);
|
||||||
|
}
|
||||||
|
$destroy() {
|
||||||
|
destroy_component(this, 1);
|
||||||
|
this.$destroy = noop;
|
||||||
|
}
|
||||||
|
$on(type, callback) {
|
||||||
|
// TODO should this delegate to addEventListener?
|
||||||
|
if (!is_function(callback)) {
|
||||||
|
return noop;
|
||||||
|
}
|
||||||
|
const callbacks = (this.$$.callbacks[type] || (this.$$.callbacks[type] = []));
|
||||||
|
callbacks.push(callback);
|
||||||
|
return () => {
|
||||||
|
const index = callbacks.indexOf(callback);
|
||||||
|
if (index !== -1)
|
||||||
|
callbacks.splice(index, 1);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
$set($$props) {
|
||||||
|
if (this.$$set && !is_empty($$props)) {
|
||||||
|
this.$$.skip_bound = true;
|
||||||
|
this.$$set($$props);
|
||||||
|
this.$$.skip_bound = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
function dispatch_dev(type, detail) {
|
||||||
|
document.dispatchEvent(custom_event(type, Object.assign({ version: '3.52.0' }, detail), { bubbles: true }));
|
||||||
|
}
|
||||||
|
function append_dev(target, node) {
|
||||||
|
dispatch_dev('SvelteDOMInsert', { target, node });
|
||||||
|
append(target, node);
|
||||||
|
}
|
||||||
|
function insert_dev(target, node, anchor) {
|
||||||
|
dispatch_dev('SvelteDOMInsert', { target, node, anchor });
|
||||||
|
insert(target, node, anchor);
|
||||||
|
}
|
||||||
|
function detach_dev(node) {
|
||||||
|
dispatch_dev('SvelteDOMRemove', { node });
|
||||||
|
detach(node);
|
||||||
|
}
|
||||||
|
function listen_dev(node, event, handler, options, has_prevent_default, has_stop_propagation) {
|
||||||
|
const modifiers = options === true ? ['capture'] : options ? Array.from(Object.keys(options)) : [];
|
||||||
|
if (has_prevent_default)
|
||||||
|
modifiers.push('preventDefault');
|
||||||
|
if (has_stop_propagation)
|
||||||
|
modifiers.push('stopPropagation');
|
||||||
|
dispatch_dev('SvelteDOMAddEventListener', { node, event, handler, modifiers });
|
||||||
|
const dispose = listen(node, event, handler, options);
|
||||||
|
return () => {
|
||||||
|
dispatch_dev('SvelteDOMRemoveEventListener', { node, event, handler, modifiers });
|
||||||
|
dispose();
|
||||||
|
};
|
||||||
|
}
|
||||||
|
function attr_dev(node, attribute, value) {
|
||||||
|
attr(node, attribute, value);
|
||||||
|
if (value == null)
|
||||||
|
dispatch_dev('SvelteDOMRemoveAttribute', { node, attribute });
|
||||||
|
else
|
||||||
|
dispatch_dev('SvelteDOMSetAttribute', { node, attribute, value });
|
||||||
|
}
|
||||||
|
function prop_dev(node, property, value) {
|
||||||
|
node[property] = value;
|
||||||
|
dispatch_dev('SvelteDOMSetProperty', { node, property, value });
|
||||||
|
}
|
||||||
|
function set_data_dev(text, data) {
|
||||||
|
data = '' + data;
|
||||||
|
if (text.wholeText === data)
|
||||||
|
return;
|
||||||
|
dispatch_dev('SvelteDOMSetData', { node: text, data });
|
||||||
|
text.data = data;
|
||||||
|
}
|
||||||
|
function validate_each_argument(arg) {
|
||||||
|
if (typeof arg !== 'string' && !(arg && typeof arg === 'object' && 'length' in arg)) {
|
||||||
|
let msg = '{#each} only iterates over array-like objects.';
|
||||||
|
if (typeof Symbol === 'function' && arg && Symbol.iterator in arg) {
|
||||||
|
msg += ' You can use a spread to convert this iterable into an array.';
|
||||||
|
}
|
||||||
|
throw new Error(msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function validate_slots(name, slot, keys) {
|
||||||
|
for (const slot_key of Object.keys(slot)) {
|
||||||
|
if (!~keys.indexOf(slot_key)) {
|
||||||
|
console.warn(`<${name}> received an unexpected slot "${slot_key}".`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export { validate_each_argument as A, text as B, set_data_dev as C, destroy_each as D, prop_dev as E, set_style as F, svg_element as G, is_function as H, HtmlTag as I, afterUpdate as J, set_input_value as K, SvelteElement as S, attribute_to_object as a, insert_dev as b, setContext as c, dispatch_dev as d, globals as e, element as f, getContext as g, space as h, init as i, add_location as j, attr_dev as k, append_dev as l, listen_dev as m, noop as n, onMount as o, detach_dev as p, binding_callbacks as q, run_all as r, safe_not_equal as s, flush as t, validate_store as u, validate_slots as v, component_subscribe as w, empty as x, src_url_equal as y, set_custom_element_data as z };
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,362 +1 @@
|
||||||
|
import{S as t,i as e,a as s,b as o,k as n,s as r,e as i,n as a,d as l,g as c,x as p,o as u,c as h,v as d,y as m,f,l as g,w as y,j as $}from"./index-db20528a.js";import{pullLegendData as b}from"../../../../../../../../../js/predict/charts.js";function w(t,e,s){const o=t.slice();return o[10]=e[s],o[11]=e,o[12]=s,o}function x(t){let e,s,n,r,a,p,u,$,b=t[10].name+"",w=t[12];const x=()=>t[6](e,w),k=()=>t[6](null,w);function j(){return t[7](t[12])}return{c(){e=i("button"),s=i("div"),n=h(),r=i("span"),a=d(b),p=h(),l(s,"class","marker"),m(s,"background-color",t[10].color)},m(t,i){o(t,e,i),f(e,s),f(e,n),f(e,r),f(r,a),f(e,p),x(),u||($=g(e,"click",j),u=!0)},p(e,o){t=e,1&o&&m(s,"background-color",t[10].color),1&o&&b!==(b=t[10].name+"")&&y(a,b),w!==t[12]&&(k(),w=t[12],x())},d(t){t&&c(e),k(),u=!1,$()}}}function k(t){let e,s=t[0],n=[];for(let e=0;e<s.length;e+=1)n[e]=x(w(t,s,e));return{c(){e=i("div");for(let t=0;t<n.length;t+=1)n[t].c();this.c=a,l(e,"class","legend")},m(t,s){o(t,e,s);for(let t=0;t<n.length;t+=1)n[t].m(e,null)},p(t,[o]){if(7&o){let r;for(s=t[0],r=0;r<s.length;r+=1){const i=w(t,s,r);n[r]?n[r].p(i,o):(n[r]=x(i),n[r].c(),n[r].m(e,null))}for(;r<n.length;r+=1)n[r].d(1);n.length=s.length}},i:a,o:a,d(t){t&&c(e),p(n,t)}}}function j(t,e,s){let o,{option:n=null}=e,{chart:r=null}=e,{data:i={}}=e,a=[],l=[];function c(){if(null==n||null==n||null==r||null==r)setTimeout(c,100);else{s(0,a=b(a,n));for(let t of a)s(3,i[t.name]=!0,i);o=Object.keys(i)}}function p(t){s(3,i[o[t]]=!i[o[t]],i);let e=[],a=n.series.map((t=>t._id)),c=a[t];for(let t=0;t<a.length;t++)a[t]==c&&e.push(t);for(let t of e){let o=n.series[t];o.tooltip.show?(o.lineStyle.opacity=0,o.itemStyle.opacity=0,o.tooltip.show=!1,s(1,l[e[0]].style.opacity=.5,l)):(o.lineStyle.opacity=1,o.itemStyle.opacity=1,o.tooltip.show=!0,s(1,l[e[0]].style.opacity=1,l))}r.setOption(n)}u((()=>{c()}));return t.$$set=t=>{"option"in t&&s(4,n=t.option),"chart"in t&&s(5,r=t.chart),"data"in t&&s(3,i=t.data)},[a,l,p,i,n,r,function(t,e){$[t?"unshift":"push"]((()=>{l[e]=t,s(1,l)}))},t=>p(t)]}class v extends t{constructor(t){super(),this.shadowRoot.innerHTML="<style>@import '/css/common.css';@import '/css/test-basic.css';button{cursor:pointer}.legend{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center;gap:1rem}.legend *{font-family:var(--sans-serif)}.marker{position:relative;display:inline-block;margin-right:0.5rem;top:0.1rem;width:1rem;height:1rem;border-radius:1rem}</style>",e(this,{target:this.shadowRoot,props:s(this.attributes),customElement:!0},j,k,r,{option:4,chart:5,data:3},null),t&&(t.target&&o(t.target,this,t.anchor),t.props&&(this.$set(t.props),n()))}static get observedAttributes(){return["option","chart","data"]}get option(){return this.$$.ctx[4]}set option(t){this.$$set({option:t}),n()}get chart(){return this.$$.ctx[5]}set chart(t){this.$$set({chart:t}),n()}get data(){return this.$$.ctx[3]}set data(t){this.$$set({data:t}),n()}}customElements.define("legend-component",v);export{v as default};
|
||||||
(function(l, r) { if (!l || l.getElementById('livereloadscript')) return; r = l.createElement('script'); r.async = 1; r.src = '//' + (self.location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1'; r.id = 'livereloadscript'; l.getElementsByTagName('head')[0].appendChild(r) })(self.document);
|
|
||||||
import { S as SvelteElement, i as init, a as attribute_to_object, b as insert_dev, t as flush, s as safe_not_equal, A as validate_each_argument, d as dispatch_dev, v as validate_slots, o as onMount, e as globals, f as element, n as noop, k as attr_dev, j as add_location, p as detach_dev, D as destroy_each, q as binding_callbacks, h as space, B as text, F as set_style, l as append_dev, m as listen_dev, C as set_data_dev } from './index-998178c7.js';
|
|
||||||
import { pullLegendData } from '../../../../../../../../../js/predict/charts.js';
|
|
||||||
|
|
||||||
/* src\components\legend-component.svelte generated by Svelte v3.52.0 */
|
|
||||||
|
|
||||||
const { Object: Object_1 } = globals;
|
|
||||||
const file = "src\\components\\legend-component.svelte";
|
|
||||||
|
|
||||||
function get_each_context(ctx, list, i) {
|
|
||||||
const child_ctx = ctx.slice();
|
|
||||||
child_ctx[10] = list[i];
|
|
||||||
child_ctx[11] = list;
|
|
||||||
child_ctx[12] = i;
|
|
||||||
return child_ctx;
|
|
||||||
}
|
|
||||||
|
|
||||||
// (69:4) {#each legendData as item, i}
|
|
||||||
function create_each_block(ctx) {
|
|
||||||
let button;
|
|
||||||
let div;
|
|
||||||
let t0;
|
|
||||||
let span;
|
|
||||||
let t1_value = /*item*/ ctx[10].name + "";
|
|
||||||
let t1;
|
|
||||||
let t2;
|
|
||||||
let i = /*i*/ ctx[12];
|
|
||||||
let mounted;
|
|
||||||
let dispose;
|
|
||||||
const assign_button = () => /*button_binding*/ ctx[6](button, i);
|
|
||||||
const unassign_button = () => /*button_binding*/ ctx[6](null, i);
|
|
||||||
|
|
||||||
function click_handler() {
|
|
||||||
return /*click_handler*/ ctx[7](/*i*/ ctx[12]);
|
|
||||||
}
|
|
||||||
|
|
||||||
const block = {
|
|
||||||
c: function create() {
|
|
||||||
button = element("button");
|
|
||||||
div = element("div");
|
|
||||||
t0 = space();
|
|
||||||
span = element("span");
|
|
||||||
t1 = text(t1_value);
|
|
||||||
t2 = space();
|
|
||||||
attr_dev(div, "class", "marker");
|
|
||||||
set_style(div, "background-color", /*item*/ ctx[10].color);
|
|
||||||
add_location(div, file, 70, 12, 1892);
|
|
||||||
add_location(span, file, 71, 12, 1971);
|
|
||||||
add_location(button, file, 69, 8, 1814);
|
|
||||||
},
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insert_dev(target, button, anchor);
|
|
||||||
append_dev(button, div);
|
|
||||||
append_dev(button, t0);
|
|
||||||
append_dev(button, span);
|
|
||||||
append_dev(span, t1);
|
|
||||||
append_dev(button, t2);
|
|
||||||
assign_button();
|
|
||||||
|
|
||||||
if (!mounted) {
|
|
||||||
dispose = listen_dev(button, "click", click_handler, false, false, false);
|
|
||||||
mounted = true;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
p: function update(new_ctx, dirty) {
|
|
||||||
ctx = new_ctx;
|
|
||||||
|
|
||||||
if (dirty & /*legendData*/ 1) {
|
|
||||||
set_style(div, "background-color", /*item*/ ctx[10].color);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (dirty & /*legendData*/ 1 && t1_value !== (t1_value = /*item*/ ctx[10].name + "")) set_data_dev(t1, t1_value);
|
|
||||||
|
|
||||||
if (i !== /*i*/ ctx[12]) {
|
|
||||||
unassign_button();
|
|
||||||
i = /*i*/ ctx[12];
|
|
||||||
assign_button();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
d: function destroy(detaching) {
|
|
||||||
if (detaching) detach_dev(button);
|
|
||||||
unassign_button();
|
|
||||||
mounted = false;
|
|
||||||
dispose();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
dispatch_dev("SvelteRegisterBlock", {
|
|
||||||
block,
|
|
||||||
id: create_each_block.name,
|
|
||||||
type: "each",
|
|
||||||
source: "(69:4) {#each legendData as item, i}",
|
|
||||||
ctx
|
|
||||||
});
|
|
||||||
|
|
||||||
return block;
|
|
||||||
}
|
|
||||||
|
|
||||||
function create_fragment(ctx) {
|
|
||||||
let div;
|
|
||||||
let each_value = /*legendData*/ ctx[0];
|
|
||||||
validate_each_argument(each_value);
|
|
||||||
let each_blocks = [];
|
|
||||||
|
|
||||||
for (let i = 0; i < each_value.length; i += 1) {
|
|
||||||
each_blocks[i] = create_each_block(get_each_context(ctx, each_value, i));
|
|
||||||
}
|
|
||||||
|
|
||||||
const block = {
|
|
||||||
c: function create() {
|
|
||||||
div = element("div");
|
|
||||||
|
|
||||||
for (let i = 0; i < each_blocks.length; i += 1) {
|
|
||||||
each_blocks[i].c();
|
|
||||||
}
|
|
||||||
|
|
||||||
this.c = noop;
|
|
||||||
attr_dev(div, "class", "legend");
|
|
||||||
add_location(div, file, 67, 0, 1749);
|
|
||||||
},
|
|
||||||
l: function claim(nodes) {
|
|
||||||
throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
|
|
||||||
},
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insert_dev(target, div, anchor);
|
|
||||||
|
|
||||||
for (let i = 0; i < each_blocks.length; i += 1) {
|
|
||||||
each_blocks[i].m(div, null);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
p: function update(ctx, [dirty]) {
|
|
||||||
if (dirty & /*buttons, toggleSeries, legendData*/ 7) {
|
|
||||||
each_value = /*legendData*/ ctx[0];
|
|
||||||
validate_each_argument(each_value);
|
|
||||||
let i;
|
|
||||||
|
|
||||||
for (i = 0; i < each_value.length; i += 1) {
|
|
||||||
const child_ctx = get_each_context(ctx, each_value, i);
|
|
||||||
|
|
||||||
if (each_blocks[i]) {
|
|
||||||
each_blocks[i].p(child_ctx, dirty);
|
|
||||||
} else {
|
|
||||||
each_blocks[i] = create_each_block(child_ctx);
|
|
||||||
each_blocks[i].c();
|
|
||||||
each_blocks[i].m(div, null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (; i < each_blocks.length; i += 1) {
|
|
||||||
each_blocks[i].d(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
each_blocks.length = each_value.length;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
i: noop,
|
|
||||||
o: noop,
|
|
||||||
d: function destroy(detaching) {
|
|
||||||
if (detaching) detach_dev(div);
|
|
||||||
destroy_each(each_blocks, detaching);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
dispatch_dev("SvelteRegisterBlock", {
|
|
||||||
block,
|
|
||||||
id: create_fragment.name,
|
|
||||||
type: "component",
|
|
||||||
source: "",
|
|
||||||
ctx
|
|
||||||
});
|
|
||||||
|
|
||||||
return block;
|
|
||||||
}
|
|
||||||
|
|
||||||
function instance($$self, $$props, $$invalidate) {
|
|
||||||
let { $$slots: slots = {}, $$scope } = $$props;
|
|
||||||
validate_slots('legend-component', slots, []);
|
|
||||||
let { option = null } = $$props;
|
|
||||||
let { chart = null } = $$props;
|
|
||||||
let { data = {} } = $$props;
|
|
||||||
|
|
||||||
// Main code
|
|
||||||
let legendData = [];
|
|
||||||
|
|
||||||
let buttons = [];
|
|
||||||
let dataKeys;
|
|
||||||
|
|
||||||
function init() {
|
|
||||||
if (option == null || option == undefined || chart == null || chart == undefined) {
|
|
||||||
setTimeout(init, 100);
|
|
||||||
} else {
|
|
||||||
$$invalidate(0, legendData = pullLegendData(legendData, option));
|
|
||||||
|
|
||||||
for (let obj of legendData) {
|
|
||||||
$$invalidate(3, data[obj.name] = true, data);
|
|
||||||
}
|
|
||||||
|
|
||||||
dataKeys = Object.keys(data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function toggleSeries(i) {
|
|
||||||
$$invalidate(3, data[dataKeys[i]] = !data[dataKeys[i]], data);
|
|
||||||
let inds = [];
|
|
||||||
let ids = option.series.map(x => x._id);
|
|
||||||
let id = ids[i];
|
|
||||||
|
|
||||||
for (let j = 0; j < ids.length; j++) {
|
|
||||||
if (ids[j] == id) {
|
|
||||||
inds.push(j);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (let i of inds) {
|
|
||||||
let series = option.series[i];
|
|
||||||
|
|
||||||
if (!series.tooltip.show) {
|
|
||||||
series.lineStyle.opacity = 1;
|
|
||||||
series.itemStyle.opacity = 1;
|
|
||||||
series.tooltip.show = true;
|
|
||||||
$$invalidate(1, buttons[inds[0]].style.opacity = 1, buttons);
|
|
||||||
} else {
|
|
||||||
series.lineStyle.opacity = 0;
|
|
||||||
series.itemStyle.opacity = 0;
|
|
||||||
series.tooltip.show = false;
|
|
||||||
$$invalidate(1, buttons[inds[0]].style.opacity = 0.5, buttons);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
chart.setOption(option);
|
|
||||||
}
|
|
||||||
|
|
||||||
onMount(() => {
|
|
||||||
init();
|
|
||||||
});
|
|
||||||
|
|
||||||
const writable_props = ['option', 'chart', 'data'];
|
|
||||||
|
|
||||||
Object_1.keys($$props).forEach(key => {
|
|
||||||
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(`<legend-component> was created with unknown prop '${key}'`);
|
|
||||||
});
|
|
||||||
|
|
||||||
function button_binding($$value, i) {
|
|
||||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
|
||||||
buttons[i] = $$value;
|
|
||||||
$$invalidate(1, buttons);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
const click_handler = i => toggleSeries(i);
|
|
||||||
|
|
||||||
$$self.$$set = $$props => {
|
|
||||||
if ('option' in $$props) $$invalidate(4, option = $$props.option);
|
|
||||||
if ('chart' in $$props) $$invalidate(5, chart = $$props.chart);
|
|
||||||
if ('data' in $$props) $$invalidate(3, data = $$props.data);
|
|
||||||
};
|
|
||||||
|
|
||||||
$$self.$capture_state = () => ({
|
|
||||||
onMount,
|
|
||||||
pullLegendData,
|
|
||||||
option,
|
|
||||||
chart,
|
|
||||||
data,
|
|
||||||
legendData,
|
|
||||||
buttons,
|
|
||||||
dataKeys,
|
|
||||||
init,
|
|
||||||
toggleSeries
|
|
||||||
});
|
|
||||||
|
|
||||||
$$self.$inject_state = $$props => {
|
|
||||||
if ('option' in $$props) $$invalidate(4, option = $$props.option);
|
|
||||||
if ('chart' in $$props) $$invalidate(5, chart = $$props.chart);
|
|
||||||
if ('data' in $$props) $$invalidate(3, data = $$props.data);
|
|
||||||
if ('legendData' in $$props) $$invalidate(0, legendData = $$props.legendData);
|
|
||||||
if ('buttons' in $$props) $$invalidate(1, buttons = $$props.buttons);
|
|
||||||
if ('dataKeys' in $$props) dataKeys = $$props.dataKeys;
|
|
||||||
};
|
|
||||||
|
|
||||||
if ($$props && "$$inject" in $$props) {
|
|
||||||
$$self.$inject_state($$props.$$inject);
|
|
||||||
}
|
|
||||||
|
|
||||||
return [
|
|
||||||
legendData,
|
|
||||||
buttons,
|
|
||||||
toggleSeries,
|
|
||||||
data,
|
|
||||||
option,
|
|
||||||
chart,
|
|
||||||
button_binding,
|
|
||||||
click_handler
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
class Legend_component extends SvelteElement {
|
|
||||||
constructor(options) {
|
|
||||||
super();
|
|
||||||
this.shadowRoot.innerHTML = `<style>@import '/css/common.css';@import '/css/test-basic.css';button{cursor:pointer}.legend{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:center;gap:1rem}.legend *{font-family:var(--sans-serif)}.marker{position:relative;display:inline-block;margin-right:0.5rem;top:0.1rem;width:1rem;height:1rem;border-radius:1rem}</style>`;
|
|
||||||
|
|
||||||
init(
|
|
||||||
this,
|
|
||||||
{
|
|
||||||
target: this.shadowRoot,
|
|
||||||
props: attribute_to_object(this.attributes),
|
|
||||||
customElement: true
|
|
||||||
},
|
|
||||||
instance,
|
|
||||||
create_fragment,
|
|
||||||
safe_not_equal,
|
|
||||||
{ option: 4, chart: 5, data: 3 },
|
|
||||||
null
|
|
||||||
);
|
|
||||||
|
|
||||||
if (options) {
|
|
||||||
if (options.target) {
|
|
||||||
insert_dev(options.target, this, options.anchor);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (options.props) {
|
|
||||||
this.$set(options.props);
|
|
||||||
flush();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static get observedAttributes() {
|
|
||||||
return ["option", "chart", "data"];
|
|
||||||
}
|
|
||||||
|
|
||||||
get option() {
|
|
||||||
return this.$$.ctx[4];
|
|
||||||
}
|
|
||||||
|
|
||||||
set option(option) {
|
|
||||||
this.$$set({ option });
|
|
||||||
flush();
|
|
||||||
}
|
|
||||||
|
|
||||||
get chart() {
|
|
||||||
return this.$$.ctx[5];
|
|
||||||
}
|
|
||||||
|
|
||||||
set chart(chart) {
|
|
||||||
this.$$set({ chart });
|
|
||||||
flush();
|
|
||||||
}
|
|
||||||
|
|
||||||
get data() {
|
|
||||||
return this.$$.ctx[3];
|
|
||||||
}
|
|
||||||
|
|
||||||
set data(data) {
|
|
||||||
this.$$set({ data });
|
|
||||||
flush();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
customElements.define("legend-component", Legend_component);
|
|
||||||
|
|
||||||
export { Legend_component as default };
|
|
||||||
|
|
|
@ -1,115 +1 @@
|
||||||
|
import{S as t,i as s,a as e,b as n,s as a,e as o,n as i,d,y as r,g as u,o as c,j as l}from"./index-db20528a.js";function h(t){let s;return{c(){s=o("div"),this.c=i,d(s,"id","loadscreen"),r(s,"width","100%"),r(s,"height","100%"),r(s,"background","white"),r(s,"position","absolute"),r(s,"z-index","100000")},m(e,a){n(e,s,a),t[1](s)},p:i,i:i,o:i,d(e){e&&u(s),t[1](null)}}}function p(t,s,e){let n;return c((()=>{window.addEventListener("load",(function(){e(0,n.parentNode.host.style.display="none",n)}))})),[n,function(t){l[t?"unshift":"push"]((()=>{n=t,e(0,n)}))}]}class f extends t{constructor(t){super(),s(this,{target:this.shadowRoot,props:e(this.attributes),customElement:!0},p,h,a,{},null),t&&t.target&&n(t.target,this,t.anchor)}}customElements.define("loadscreen-component",f);export{f as default};
|
||||||
(function(l, r) { if (!l || l.getElementById('livereloadscript')) return; r = l.createElement('script'); r.async = 1; r.src = '//' + (self.location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1'; r.id = 'livereloadscript'; l.getElementsByTagName('head')[0].appendChild(r) })(self.document);
|
|
||||||
import { S as SvelteElement, i as init, a as attribute_to_object, b as insert_dev, s as safe_not_equal, d as dispatch_dev, v as validate_slots, o as onMount, f as element, n as noop, k as attr_dev, F as set_style, j as add_location, p as detach_dev, q as binding_callbacks } from './index-998178c7.js';
|
|
||||||
|
|
||||||
/* src\components\loadscreen-component.svelte generated by Svelte v3.52.0 */
|
|
||||||
const file = "src\\components\\loadscreen-component.svelte";
|
|
||||||
|
|
||||||
function create_fragment(ctx) {
|
|
||||||
let div;
|
|
||||||
|
|
||||||
const block = {
|
|
||||||
c: function create() {
|
|
||||||
div = element("div");
|
|
||||||
this.c = noop;
|
|
||||||
attr_dev(div, "id", "loadscreen");
|
|
||||||
set_style(div, "width", "100%");
|
|
||||||
set_style(div, "height", "100%");
|
|
||||||
set_style(div, "background", "white");
|
|
||||||
set_style(div, "position", "absolute");
|
|
||||||
set_style(div, "z-index", "100000");
|
|
||||||
add_location(div, file, 20, 0, 366);
|
|
||||||
},
|
|
||||||
l: function claim(nodes) {
|
|
||||||
throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
|
|
||||||
},
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insert_dev(target, div, anchor);
|
|
||||||
/*div_binding*/ ctx[1](div);
|
|
||||||
},
|
|
||||||
p: noop,
|
|
||||||
i: noop,
|
|
||||||
o: noop,
|
|
||||||
d: function destroy(detaching) {
|
|
||||||
if (detaching) detach_dev(div);
|
|
||||||
/*div_binding*/ ctx[1](null);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
dispatch_dev("SvelteRegisterBlock", {
|
|
||||||
block,
|
|
||||||
id: create_fragment.name,
|
|
||||||
type: "component",
|
|
||||||
source: "",
|
|
||||||
ctx
|
|
||||||
});
|
|
||||||
|
|
||||||
return block;
|
|
||||||
}
|
|
||||||
|
|
||||||
function instance($$self, $$props, $$invalidate) {
|
|
||||||
let { $$slots: slots = {}, $$scope } = $$props;
|
|
||||||
validate_slots('loadscreen-component', slots, []);
|
|
||||||
let loadscreen;
|
|
||||||
|
|
||||||
onMount(() => {
|
|
||||||
window.addEventListener('load', function () {
|
|
||||||
$$invalidate(0, loadscreen.parentNode.host.style.display = "none", loadscreen);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
const writable_props = [];
|
|
||||||
|
|
||||||
Object.keys($$props).forEach(key => {
|
|
||||||
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(`<loadscreen-component> was created with unknown prop '${key}'`);
|
|
||||||
});
|
|
||||||
|
|
||||||
function div_binding($$value) {
|
|
||||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
|
||||||
loadscreen = $$value;
|
|
||||||
$$invalidate(0, loadscreen);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
$$self.$capture_state = () => ({ onMount, loadscreen });
|
|
||||||
|
|
||||||
$$self.$inject_state = $$props => {
|
|
||||||
if ('loadscreen' in $$props) $$invalidate(0, loadscreen = $$props.loadscreen);
|
|
||||||
};
|
|
||||||
|
|
||||||
if ($$props && "$$inject" in $$props) {
|
|
||||||
$$self.$inject_state($$props.$$inject);
|
|
||||||
}
|
|
||||||
|
|
||||||
return [loadscreen, div_binding];
|
|
||||||
}
|
|
||||||
|
|
||||||
class Loadscreen_component extends SvelteElement {
|
|
||||||
constructor(options) {
|
|
||||||
super();
|
|
||||||
|
|
||||||
init(
|
|
||||||
this,
|
|
||||||
{
|
|
||||||
target: this.shadowRoot,
|
|
||||||
props: attribute_to_object(this.attributes),
|
|
||||||
customElement: true
|
|
||||||
},
|
|
||||||
instance,
|
|
||||||
create_fragment,
|
|
||||||
safe_not_equal,
|
|
||||||
{},
|
|
||||||
null
|
|
||||||
);
|
|
||||||
|
|
||||||
if (options) {
|
|
||||||
if (options.target) {
|
|
||||||
insert_dev(options.target, this, options.anchor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
customElements.define("loadscreen-component", Loadscreen_component);
|
|
||||||
|
|
||||||
export { Loadscreen_component as default };
|
|
||||||
|
|
|
@ -1,448 +1 @@
|
||||||
|
import{S as t,i as s,a as e,b as o,k as n,s as a,e as i,c as u,n as l,d as r,f as c,l as d,g as m,r as p,m as h,o as f,j as g}from"./index-db20528a.js";import*as b from"../../../../../../../../../js/libraries/authTools.js";function w(t){let s,e,n,a,h,f,g,b,w,y,x,I,k,v,E,$,j,C,L,T,P,B,G,H,M;return{c(){s=i("div"),e=i("h2"),e.textContent="LOG IN",n=u(),a=i("label"),a.textContent="Email ",h=i("span"),f=u(),g=i("input"),b=u(),w=i("div"),y=i("label"),y.textContent="Password ",x=i("span"),I=u(),k=i("input"),v=u(),E=i("button"),E.innerHTML='<object type="image/svg+xml" data="/img/auth/eye_icon.svg" title="eye icon"></object>',$=u(),j=i("div"),C=i("input"),L=i("label"),L.textContent="remember me",T=u(),P=i("button"),P.textContent="Log in",B=u(),G=i("a"),G.textContent="Forgot password?",this.c=l,r(e,"class","auth-title"),r(a,"class","auth-label"),r(a,"for","emailInput"),r(h,"id","email-msg"),r(g,"id","emailInput"),r(g,"class","authEmailInput"),r(g,"type","email"),r(y,"class","auth-label"),r(y,"for","passwordInput"),r(x,"id","password-msg"),r(k,"id","passwordInput"),r(k,"class","authPasswordInput"),r(k,"type","password"),r(E,"class","eye-icon"),r(w,"class","password-field"),r(C,"type","checkbox"),r(C,"id","remember-me-checkbox"),r(L,"id","remember-me-label"),r(L,"for","passwordInput"),r(j,"id","remember-me"),r(P,"class","auth-button"),r(G,"id","forgot-password"),r(G,"href","forgot-password"),r(s,"id","login-group"),r(s,"class","pane auth-pane")},m(i,u){o(i,s,u),c(s,e),c(s,n),c(s,a),c(s,h),t[9](h),c(s,f),c(s,g),t[10](g),c(s,b),c(s,w),c(w,y),c(w,x),t[11](x),c(w,I),c(w,k),t[12](k),c(w,v),c(w,E),t[13](E),c(s,$),c(s,j),c(j,C),t[15](C),c(j,L),c(s,T),c(s,P),c(s,B),c(s,G),H||(M=[d(E,"click",t[14]),d(P,"click",t[16])],H=!0)},p:l,i:l,o:l,d(e){e&&m(s),t[9](null),t[10](null),t[11](null),t[12](null),t[13](null),t[15](null),H=!1,p(M)}}}function y(t,s,e){let o,n,a,i,u,l,r,c,d,{focused:m=!1}=s,p=h("auth");function w(){if(p.googleInit){google.accounts.id.renderButton(d,{theme:"outline",size:"large"});let t=d.getElementsByTagName("iframe")[0];t.style.height="5rem",t.style.width="5rem"}else setTimeout(w,100)}f((()=>{e(7,c.checked=!0,c),e(2,a={email:o,password:n,remember:c}),e(6,r={email:u,password:l}),p.msgs=r,p.remember=c,p.loginGoogle=d,document.addEventListener("keypress",(function(t){"Enter"==t.code&&m&&b.login(r,a)})),w()}));return t.$$set=t=>{"focused"in t&&e(8,m=t.focused)},[o,n,a,i,u,l,r,c,m,function(t){g[t?"unshift":"push"]((()=>{u=t,e(4,u)}))},function(t){g[t?"unshift":"push"]((()=>{o=t,e(0,o)}))},function(t){g[t?"unshift":"push"]((()=>{l=t,e(5,l)}))},function(t){g[t?"unshift":"push"]((()=>{n=t,e(1,n)}))},function(t){g[t?"unshift":"push"]((()=>{i=t,e(3,i)}))},()=>b.changePasswordVisibility(i),function(t){g[t?"unshift":"push"]((()=>{c=t,e(7,c)}))},()=>b.login(r,a)]}class x extends t{constructor(t){super(),this.shadowRoot.innerHTML="<style>@import '/css/common.css';@import '/css/auth.css';</style>",s(this,{target:this.shadowRoot,props:e(this.attributes),customElement:!0},y,w,a,{focused:8},null),t&&(t.target&&o(t.target,this,t.anchor),t.props&&(this.$set(t.props),n()))}static get observedAttributes(){return["focused"]}get focused(){return this.$$.ctx[8]}set focused(t){this.$$set({focused:t}),n()}}customElements.define("login-component",x);export{x as default};
|
||||||
(function(l, r) { if (!l || l.getElementById('livereloadscript')) return; r = l.createElement('script'); r.async = 1; r.src = '//' + (self.location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1'; r.id = 'livereloadscript'; l.getElementsByTagName('head')[0].appendChild(r) })(self.document);
|
|
||||||
import { S as SvelteElement, i as init, a as attribute_to_object, b as insert_dev, t as flush, s as safe_not_equal, d as dispatch_dev, v as validate_slots, g as getContext, o as onMount, f as element, h as space, n as noop, k as attr_dev, j as add_location, u as src_url_equal, l as append_dev, m as listen_dev, p as detach_dev, r as run_all, q as binding_callbacks } from './index-998178c7.js';
|
|
||||||
import * as AuthTools from '../../../../../../../../../js/libraries/authTools.js';
|
|
||||||
|
|
||||||
/* src\auth\login-component.svelte generated by Svelte v3.52.0 */
|
|
||||||
const file = "src\\auth\\login-component.svelte";
|
|
||||||
|
|
||||||
function create_fragment(ctx) {
|
|
||||||
let div5;
|
|
||||||
let h2;
|
|
||||||
let t1;
|
|
||||||
let label0;
|
|
||||||
let span0;
|
|
||||||
let t3;
|
|
||||||
let input0;
|
|
||||||
let t4;
|
|
||||||
let div0;
|
|
||||||
let label1;
|
|
||||||
let span1;
|
|
||||||
let t6;
|
|
||||||
let input1;
|
|
||||||
let t7;
|
|
||||||
let button0;
|
|
||||||
let object;
|
|
||||||
let t8;
|
|
||||||
let div1;
|
|
||||||
let input2;
|
|
||||||
let label2;
|
|
||||||
let t10;
|
|
||||||
let button1;
|
|
||||||
let t12;
|
|
||||||
let a;
|
|
||||||
let t14;
|
|
||||||
let hr;
|
|
||||||
let t15;
|
|
||||||
let div4;
|
|
||||||
let div3;
|
|
||||||
let div2;
|
|
||||||
let t16;
|
|
||||||
let img;
|
|
||||||
let img_src_value;
|
|
||||||
let mounted;
|
|
||||||
let dispose;
|
|
||||||
|
|
||||||
const block = {
|
|
||||||
c: function create() {
|
|
||||||
div5 = element("div");
|
|
||||||
h2 = element("h2");
|
|
||||||
h2.textContent = "LOG IN";
|
|
||||||
t1 = space();
|
|
||||||
label0 = element("label");
|
|
||||||
label0.textContent = "Email ";
|
|
||||||
span0 = element("span");
|
|
||||||
t3 = space();
|
|
||||||
input0 = element("input");
|
|
||||||
t4 = space();
|
|
||||||
div0 = element("div");
|
|
||||||
label1 = element("label");
|
|
||||||
label1.textContent = "Password ";
|
|
||||||
span1 = element("span");
|
|
||||||
t6 = space();
|
|
||||||
input1 = element("input");
|
|
||||||
t7 = space();
|
|
||||||
button0 = element("button");
|
|
||||||
object = element("object");
|
|
||||||
t8 = space();
|
|
||||||
div1 = element("div");
|
|
||||||
input2 = element("input");
|
|
||||||
label2 = element("label");
|
|
||||||
label2.textContent = "remember me";
|
|
||||||
t10 = space();
|
|
||||||
button1 = element("button");
|
|
||||||
button1.textContent = "Log in";
|
|
||||||
t12 = space();
|
|
||||||
a = element("a");
|
|
||||||
a.textContent = "Forgot password?";
|
|
||||||
t14 = space();
|
|
||||||
hr = element("hr");
|
|
||||||
t15 = space();
|
|
||||||
div4 = element("div");
|
|
||||||
div3 = element("div");
|
|
||||||
div2 = element("div");
|
|
||||||
t16 = space();
|
|
||||||
img = element("img");
|
|
||||||
this.c = noop;
|
|
||||||
attr_dev(h2, "class", "auth-title");
|
|
||||||
add_location(h2, file, 68, 4, 1639);
|
|
||||||
attr_dev(label0, "class", "auth-label");
|
|
||||||
attr_dev(label0, "for", "emailInput");
|
|
||||||
add_location(label0, file, 69, 4, 1679);
|
|
||||||
attr_dev(span0, "id", "email-msg");
|
|
||||||
add_location(span0, file, 69, 66, 1741);
|
|
||||||
attr_dev(input0, "id", "emailInput");
|
|
||||||
attr_dev(input0, "class", "authEmailInput");
|
|
||||||
attr_dev(input0, "type", "email");
|
|
||||||
add_location(input0, file, 70, 4, 1796);
|
|
||||||
attr_dev(label1, "class", "auth-label");
|
|
||||||
attr_dev(label1, "for", "passwordInput");
|
|
||||||
add_location(label1, file, 72, 8, 1922);
|
|
||||||
attr_dev(span1, "id", "password-msg");
|
|
||||||
add_location(span1, file, 72, 76, 1990);
|
|
||||||
attr_dev(input1, "id", "passwordInput");
|
|
||||||
attr_dev(input1, "class", "authPasswordInput");
|
|
||||||
attr_dev(input1, "type", "password");
|
|
||||||
add_location(input1, file, 73, 8, 2055);
|
|
||||||
attr_dev(object, "type", "image/svg+xml");
|
|
||||||
attr_dev(object, "data", "/img/auth/eye_icon.svg");
|
|
||||||
attr_dev(object, "title", "eye icon");
|
|
||||||
add_location(object, file, 75, 12, 2316);
|
|
||||||
attr_dev(button0, "class", "eye-icon");
|
|
||||||
add_location(button0, file, 74, 8, 2160);
|
|
||||||
attr_dev(div0, "class", "password-field");
|
|
||||||
add_location(div0, file, 71, 4, 1884);
|
|
||||||
attr_dev(input2, "type", "checkbox");
|
|
||||||
attr_dev(input2, "id", "remember-me-checkbox");
|
|
||||||
add_location(input2, file, 79, 8, 2470);
|
|
||||||
attr_dev(label2, "id", "remember-me-label");
|
|
||||||
attr_dev(label2, "for", "passwordInput");
|
|
||||||
add_location(label2, file, 79, 80, 2542);
|
|
||||||
attr_dev(div1, "id", "remember-me");
|
|
||||||
add_location(div1, file, 78, 4, 2438);
|
|
||||||
attr_dev(button1, "class", "auth-button");
|
|
||||||
add_location(button1, file, 81, 4, 2629);
|
|
||||||
attr_dev(a, "id", "forgot-password");
|
|
||||||
attr_dev(a, "href", "forgot-password");
|
|
||||||
add_location(a, file, 82, 4, 2726);
|
|
||||||
attr_dev(hr, "class", "auth-line");
|
|
||||||
add_location(hr, file, 83, 4, 2799);
|
|
||||||
attr_dev(div2, "id", "google-btn");
|
|
||||||
add_location(div2, file, 86, 12, 2912);
|
|
||||||
if (!src_url_equal(img.src, img_src_value = "/img/auth/google_icon.svg")) attr_dev(img, "src", img_src_value);
|
|
||||||
attr_dev(img, "id", "google-logo");
|
|
||||||
attr_dev(img, "alt", "google icon");
|
|
||||||
add_location(img, file, 87, 12, 2978);
|
|
||||||
attr_dev(div3, "id", "google-btn-wrapper");
|
|
||||||
add_location(div3, file, 85, 8, 2869);
|
|
||||||
attr_dev(div4, "class", "auth-methods-group");
|
|
||||||
add_location(div4, file, 84, 4, 2827);
|
|
||||||
attr_dev(div5, "id", "login-group");
|
|
||||||
attr_dev(div5, "class", "pane auth-pane");
|
|
||||||
add_location(div5, file, 67, 0, 1589);
|
|
||||||
},
|
|
||||||
l: function claim(nodes) {
|
|
||||||
throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
|
|
||||||
},
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insert_dev(target, div5, anchor);
|
|
||||||
append_dev(div5, h2);
|
|
||||||
append_dev(div5, t1);
|
|
||||||
append_dev(div5, label0);
|
|
||||||
append_dev(div5, span0);
|
|
||||||
/*span0_binding*/ ctx[10](span0);
|
|
||||||
append_dev(div5, t3);
|
|
||||||
append_dev(div5, input0);
|
|
||||||
/*input0_binding*/ ctx[11](input0);
|
|
||||||
append_dev(div5, t4);
|
|
||||||
append_dev(div5, div0);
|
|
||||||
append_dev(div0, label1);
|
|
||||||
append_dev(div0, span1);
|
|
||||||
/*span1_binding*/ ctx[12](span1);
|
|
||||||
append_dev(div0, t6);
|
|
||||||
append_dev(div0, input1);
|
|
||||||
/*input1_binding*/ ctx[13](input1);
|
|
||||||
append_dev(div0, t7);
|
|
||||||
append_dev(div0, button0);
|
|
||||||
append_dev(button0, object);
|
|
||||||
/*button0_binding*/ ctx[14](button0);
|
|
||||||
append_dev(div5, t8);
|
|
||||||
append_dev(div5, div1);
|
|
||||||
append_dev(div1, input2);
|
|
||||||
/*input2_binding*/ ctx[16](input2);
|
|
||||||
append_dev(div1, label2);
|
|
||||||
append_dev(div5, t10);
|
|
||||||
append_dev(div5, button1);
|
|
||||||
append_dev(div5, t12);
|
|
||||||
append_dev(div5, a);
|
|
||||||
append_dev(div5, t14);
|
|
||||||
append_dev(div5, hr);
|
|
||||||
append_dev(div5, t15);
|
|
||||||
append_dev(div5, div4);
|
|
||||||
append_dev(div4, div3);
|
|
||||||
append_dev(div3, div2);
|
|
||||||
/*div2_binding*/ ctx[18](div2);
|
|
||||||
append_dev(div3, t16);
|
|
||||||
append_dev(div3, img);
|
|
||||||
|
|
||||||
if (!mounted) {
|
|
||||||
dispose = [
|
|
||||||
listen_dev(button0, "click", /*click_handler*/ ctx[15], false, false, false),
|
|
||||||
listen_dev(button1, "click", /*click_handler_1*/ ctx[17], false, false, false)
|
|
||||||
];
|
|
||||||
|
|
||||||
mounted = true;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
p: noop,
|
|
||||||
i: noop,
|
|
||||||
o: noop,
|
|
||||||
d: function destroy(detaching) {
|
|
||||||
if (detaching) detach_dev(div5);
|
|
||||||
/*span0_binding*/ ctx[10](null);
|
|
||||||
/*input0_binding*/ ctx[11](null);
|
|
||||||
/*span1_binding*/ ctx[12](null);
|
|
||||||
/*input1_binding*/ ctx[13](null);
|
|
||||||
/*button0_binding*/ ctx[14](null);
|
|
||||||
/*input2_binding*/ ctx[16](null);
|
|
||||||
/*div2_binding*/ ctx[18](null);
|
|
||||||
mounted = false;
|
|
||||||
run_all(dispose);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
dispatch_dev("SvelteRegisterBlock", {
|
|
||||||
block,
|
|
||||||
id: create_fragment.name,
|
|
||||||
type: "component",
|
|
||||||
source: "",
|
|
||||||
ctx
|
|
||||||
});
|
|
||||||
|
|
||||||
return block;
|
|
||||||
}
|
|
||||||
|
|
||||||
function instance($$self, $$props, $$invalidate) {
|
|
||||||
let { $$slots: slots = {}, $$scope } = $$props;
|
|
||||||
validate_slots('login-component', slots, []);
|
|
||||||
let { focused = false } = $$props;
|
|
||||||
|
|
||||||
// Main code
|
|
||||||
let emailInput;
|
|
||||||
|
|
||||||
let passwordInput;
|
|
||||||
let inputs;
|
|
||||||
let passwordVisibilityButton;
|
|
||||||
let emailMsg;
|
|
||||||
let passwordMsg;
|
|
||||||
let msgs;
|
|
||||||
let rememberMe;
|
|
||||||
let googleButton;
|
|
||||||
let parentProps = getContext("auth");
|
|
||||||
|
|
||||||
function renderGoogle() {
|
|
||||||
if (parentProps.googleInit) {
|
|
||||||
google.accounts.id.renderButton(googleButton, { theme: 'outline', size: 'large' });
|
|
||||||
let iframe = googleButton.getElementsByTagName('iframe')[0];
|
|
||||||
iframe.style.height = "5rem";
|
|
||||||
iframe.style.width = "5rem";
|
|
||||||
} else {
|
|
||||||
setTimeout(renderGoogle, 100);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onMount(() => {
|
|
||||||
$$invalidate(7, rememberMe.checked = true, rememberMe);
|
|
||||||
|
|
||||||
$$invalidate(2, inputs = {
|
|
||||||
email: emailInput,
|
|
||||||
password: passwordInput,
|
|
||||||
remember: rememberMe
|
|
||||||
});
|
|
||||||
|
|
||||||
$$invalidate(6, msgs = { email: emailMsg, password: passwordMsg });
|
|
||||||
parentProps.msgs = msgs;
|
|
||||||
parentProps.remember = rememberMe;
|
|
||||||
parentProps.loginGoogle = googleButton;
|
|
||||||
|
|
||||||
document.addEventListener("keypress", function (event) {
|
|
||||||
if (event.code == "Enter") {
|
|
||||||
if (focused) {
|
|
||||||
AuthTools.login(msgs, inputs);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
renderGoogle();
|
|
||||||
});
|
|
||||||
|
|
||||||
const writable_props = ['focused'];
|
|
||||||
|
|
||||||
Object.keys($$props).forEach(key => {
|
|
||||||
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(`<login-component> was created with unknown prop '${key}'`);
|
|
||||||
});
|
|
||||||
|
|
||||||
function span0_binding($$value) {
|
|
||||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
|
||||||
emailMsg = $$value;
|
|
||||||
$$invalidate(4, emailMsg);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function input0_binding($$value) {
|
|
||||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
|
||||||
emailInput = $$value;
|
|
||||||
$$invalidate(0, emailInput);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function span1_binding($$value) {
|
|
||||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
|
||||||
passwordMsg = $$value;
|
|
||||||
$$invalidate(5, passwordMsg);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function input1_binding($$value) {
|
|
||||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
|
||||||
passwordInput = $$value;
|
|
||||||
$$invalidate(1, passwordInput);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function button0_binding($$value) {
|
|
||||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
|
||||||
passwordVisibilityButton = $$value;
|
|
||||||
$$invalidate(3, passwordVisibilityButton);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
const click_handler = () => AuthTools.changePasswordVisibility(passwordVisibilityButton);
|
|
||||||
|
|
||||||
function input2_binding($$value) {
|
|
||||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
|
||||||
rememberMe = $$value;
|
|
||||||
$$invalidate(7, rememberMe);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
const click_handler_1 = () => AuthTools.login(msgs, inputs);
|
|
||||||
|
|
||||||
function div2_binding($$value) {
|
|
||||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
|
||||||
googleButton = $$value;
|
|
||||||
$$invalidate(8, googleButton);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
$$self.$$set = $$props => {
|
|
||||||
if ('focused' in $$props) $$invalidate(9, focused = $$props.focused);
|
|
||||||
};
|
|
||||||
|
|
||||||
$$self.$capture_state = () => ({
|
|
||||||
onMount,
|
|
||||||
getContext,
|
|
||||||
AuthTools,
|
|
||||||
focused,
|
|
||||||
emailInput,
|
|
||||||
passwordInput,
|
|
||||||
inputs,
|
|
||||||
passwordVisibilityButton,
|
|
||||||
emailMsg,
|
|
||||||
passwordMsg,
|
|
||||||
msgs,
|
|
||||||
rememberMe,
|
|
||||||
googleButton,
|
|
||||||
parentProps,
|
|
||||||
renderGoogle
|
|
||||||
});
|
|
||||||
|
|
||||||
$$self.$inject_state = $$props => {
|
|
||||||
if ('focused' in $$props) $$invalidate(9, focused = $$props.focused);
|
|
||||||
if ('emailInput' in $$props) $$invalidate(0, emailInput = $$props.emailInput);
|
|
||||||
if ('passwordInput' in $$props) $$invalidate(1, passwordInput = $$props.passwordInput);
|
|
||||||
if ('inputs' in $$props) $$invalidate(2, inputs = $$props.inputs);
|
|
||||||
if ('passwordVisibilityButton' in $$props) $$invalidate(3, passwordVisibilityButton = $$props.passwordVisibilityButton);
|
|
||||||
if ('emailMsg' in $$props) $$invalidate(4, emailMsg = $$props.emailMsg);
|
|
||||||
if ('passwordMsg' in $$props) $$invalidate(5, passwordMsg = $$props.passwordMsg);
|
|
||||||
if ('msgs' in $$props) $$invalidate(6, msgs = $$props.msgs);
|
|
||||||
if ('rememberMe' in $$props) $$invalidate(7, rememberMe = $$props.rememberMe);
|
|
||||||
if ('googleButton' in $$props) $$invalidate(8, googleButton = $$props.googleButton);
|
|
||||||
if ('parentProps' in $$props) parentProps = $$props.parentProps;
|
|
||||||
};
|
|
||||||
|
|
||||||
if ($$props && "$$inject" in $$props) {
|
|
||||||
$$self.$inject_state($$props.$$inject);
|
|
||||||
}
|
|
||||||
|
|
||||||
return [
|
|
||||||
emailInput,
|
|
||||||
passwordInput,
|
|
||||||
inputs,
|
|
||||||
passwordVisibilityButton,
|
|
||||||
emailMsg,
|
|
||||||
passwordMsg,
|
|
||||||
msgs,
|
|
||||||
rememberMe,
|
|
||||||
googleButton,
|
|
||||||
focused,
|
|
||||||
span0_binding,
|
|
||||||
input0_binding,
|
|
||||||
span1_binding,
|
|
||||||
input1_binding,
|
|
||||||
button0_binding,
|
|
||||||
click_handler,
|
|
||||||
input2_binding,
|
|
||||||
click_handler_1,
|
|
||||||
div2_binding
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
class Login_component extends SvelteElement {
|
|
||||||
constructor(options) {
|
|
||||||
super();
|
|
||||||
this.shadowRoot.innerHTML = `<style>@import '/css/common.css';@import '/css/auth.css';</style>`;
|
|
||||||
|
|
||||||
init(
|
|
||||||
this,
|
|
||||||
{
|
|
||||||
target: this.shadowRoot,
|
|
||||||
props: attribute_to_object(this.attributes),
|
|
||||||
customElement: true
|
|
||||||
},
|
|
||||||
instance,
|
|
||||||
create_fragment,
|
|
||||||
safe_not_equal,
|
|
||||||
{ focused: 9 },
|
|
||||||
null
|
|
||||||
);
|
|
||||||
|
|
||||||
if (options) {
|
|
||||||
if (options.target) {
|
|
||||||
insert_dev(options.target, this, options.anchor);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (options.props) {
|
|
||||||
this.$set(options.props);
|
|
||||||
flush();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static get observedAttributes() {
|
|
||||||
return ["focused"];
|
|
||||||
}
|
|
||||||
|
|
||||||
get focused() {
|
|
||||||
return this.$$.ctx[9];
|
|
||||||
}
|
|
||||||
|
|
||||||
set focused(focused) {
|
|
||||||
this.$$set({ focused });
|
|
||||||
flush();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
customElements.define("login-component", Login_component);
|
|
||||||
|
|
||||||
export { Login_component as default };
|
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,175 +1 @@
|
||||||
|
import{S as t,i as e,a,b as s,k as o,s as r,e as l,n as i,d as n,g as c,o as m,j as p}from"./index-db20528a.js";function h(t){let e;return{c(){e=l("div"),this.c=i,n(e,"id","map")},m(a,o){s(a,e,o),t[4](e)},p:i,i:i,o:i,d(a){a&&c(e),t[4](null)}}}function u(t,e,a){let s,{callback:o=null}=e,{colors:r=null}=e,{map:l=null}=e;function i(t,e){let a=L.map(s,{center:t,zoom:e});return L.tileLayer("https://tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',minNativeZoom:2,minZoom:2,maxNativeZoom:14,maxZoom:14}).addTo(a),a}return m((()=>{if(o(i),null!=r){let t=s.getElementsByClassName("leaflet-control-layers-overlays")[0].children;for(let e=0;e<t.length;e++)t[e].children[0].children[0].style.accentColor=r[e]}})),t.$$set=t=>{"callback"in t&&a(1,o=t.callback),"colors"in t&&a(2,r=t.colors),"map"in t&&a(3,l=t.map)},[s,o,r,l,function(t){p[t?"unshift":"push"]((()=>{s=t,a(0,s)}))}]}class d extends t{constructor(t){super(),this.shadowRoot.innerHTML="<style>@import 'https://unpkg.com/leaflet@1.9.4/dist/leaflet.css';#map{height:var(--height);width:var(--width,100%);margin-top:var(--margin-top,0);margin-bottom:var(--margin-bottom,0);position:relative;z-index:0}</style>",e(this,{target:this.shadowRoot,props:a(this.attributes),customElement:!0},u,h,r,{callback:1,colors:2,map:3},null),t&&(t.target&&s(t.target,this,t.anchor),t.props&&(this.$set(t.props),o()))}static get observedAttributes(){return["callback","colors","map"]}get callback(){return this.$$.ctx[1]}set callback(t){this.$$set({callback:t}),o()}get colors(){return this.$$.ctx[2]}set colors(t){this.$$set({colors:t}),o()}get map(){return this.$$.ctx[3]}set map(t){this.$$set({map:t}),o()}}customElements.define("map-component",d);export{d as default};
|
||||||
(function(l, r) { if (!l || l.getElementById('livereloadscript')) return; r = l.createElement('script'); r.async = 1; r.src = '//' + (self.location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1'; r.id = 'livereloadscript'; l.getElementsByTagName('head')[0].appendChild(r) })(self.document);
|
|
||||||
import { S as SvelteElement, i as init, a as attribute_to_object, b as insert_dev, t as flush, s as safe_not_equal, d as dispatch_dev, v as validate_slots, o as onMount, f as element, n as noop, k as attr_dev, j as add_location, p as detach_dev, q as binding_callbacks } from './index-998178c7.js';
|
|
||||||
|
|
||||||
/* src\components\map-component.svelte generated by Svelte v3.52.0 */
|
|
||||||
const file = "src\\components\\map-component.svelte";
|
|
||||||
|
|
||||||
function create_fragment(ctx) {
|
|
||||||
let div;
|
|
||||||
|
|
||||||
const block = {
|
|
||||||
c: function create() {
|
|
||||||
div = element("div");
|
|
||||||
this.c = noop;
|
|
||||||
attr_dev(div, "id", "map");
|
|
||||||
add_location(div, file, 41, 0, 1151);
|
|
||||||
},
|
|
||||||
l: function claim(nodes) {
|
|
||||||
throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
|
|
||||||
},
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insert_dev(target, div, anchor);
|
|
||||||
/*div_binding*/ ctx[3](div);
|
|
||||||
},
|
|
||||||
p: noop,
|
|
||||||
i: noop,
|
|
||||||
o: noop,
|
|
||||||
d: function destroy(detaching) {
|
|
||||||
if (detaching) detach_dev(div);
|
|
||||||
/*div_binding*/ ctx[3](null);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
dispatch_dev("SvelteRegisterBlock", {
|
|
||||||
block,
|
|
||||||
id: create_fragment.name,
|
|
||||||
type: "component",
|
|
||||||
source: "",
|
|
||||||
ctx
|
|
||||||
});
|
|
||||||
|
|
||||||
return block;
|
|
||||||
}
|
|
||||||
|
|
||||||
function instance($$self, $$props, $$invalidate) {
|
|
||||||
let { $$slots: slots = {}, $$scope } = $$props;
|
|
||||||
validate_slots('map-component', slots, []);
|
|
||||||
let { callback = null } = $$props;
|
|
||||||
let { colors = null } = $$props;
|
|
||||||
|
|
||||||
// Main code
|
|
||||||
let mapContainer;
|
|
||||||
|
|
||||||
function createMap(center, zoom) {
|
|
||||||
let map = L.map(mapContainer, { center, zoom });
|
|
||||||
|
|
||||||
L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
|
||||||
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
|
|
||||||
minNativeZoom: 2,
|
|
||||||
minZoom: 2,
|
|
||||||
maxNativeZoom: 14,
|
|
||||||
maxZoom: 14
|
|
||||||
}).addTo(map);
|
|
||||||
|
|
||||||
return map;
|
|
||||||
}
|
|
||||||
|
|
||||||
onMount(() => {
|
|
||||||
callback(createMap);
|
|
||||||
|
|
||||||
if (colors != null) {
|
|
||||||
let els = mapContainer.getElementsByClassName("leaflet-control-layers-overlays")[0].children;
|
|
||||||
|
|
||||||
for (let i = 0; i < els.length; i++) {
|
|
||||||
els[i].children[0].children[0].style.accentColor = colors[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const writable_props = ['callback', 'colors'];
|
|
||||||
|
|
||||||
Object.keys($$props).forEach(key => {
|
|
||||||
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(`<map-component> was created with unknown prop '${key}'`);
|
|
||||||
});
|
|
||||||
|
|
||||||
function div_binding($$value) {
|
|
||||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
|
||||||
mapContainer = $$value;
|
|
||||||
$$invalidate(0, mapContainer);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
$$self.$$set = $$props => {
|
|
||||||
if ('callback' in $$props) $$invalidate(1, callback = $$props.callback);
|
|
||||||
if ('colors' in $$props) $$invalidate(2, colors = $$props.colors);
|
|
||||||
};
|
|
||||||
|
|
||||||
$$self.$capture_state = () => ({
|
|
||||||
onMount,
|
|
||||||
callback,
|
|
||||||
colors,
|
|
||||||
mapContainer,
|
|
||||||
createMap
|
|
||||||
});
|
|
||||||
|
|
||||||
$$self.$inject_state = $$props => {
|
|
||||||
if ('callback' in $$props) $$invalidate(1, callback = $$props.callback);
|
|
||||||
if ('colors' in $$props) $$invalidate(2, colors = $$props.colors);
|
|
||||||
if ('mapContainer' in $$props) $$invalidate(0, mapContainer = $$props.mapContainer);
|
|
||||||
};
|
|
||||||
|
|
||||||
if ($$props && "$$inject" in $$props) {
|
|
||||||
$$self.$inject_state($$props.$$inject);
|
|
||||||
}
|
|
||||||
|
|
||||||
return [mapContainer, callback, colors, div_binding];
|
|
||||||
}
|
|
||||||
|
|
||||||
class Map_component extends SvelteElement {
|
|
||||||
constructor(options) {
|
|
||||||
super();
|
|
||||||
this.shadowRoot.innerHTML = `<style>@import 'https://unpkg.com/leaflet@1.9.4/dist/leaflet.css';#map{height:var(--height);width:var(--width,100%);margin-top:var(--margin-top,0);margin-bottom:var(--margin-bottom,0);position:relative;z-index:0}</style>`;
|
|
||||||
|
|
||||||
init(
|
|
||||||
this,
|
|
||||||
{
|
|
||||||
target: this.shadowRoot,
|
|
||||||
props: attribute_to_object(this.attributes),
|
|
||||||
customElement: true
|
|
||||||
},
|
|
||||||
instance,
|
|
||||||
create_fragment,
|
|
||||||
safe_not_equal,
|
|
||||||
{ callback: 1, colors: 2 },
|
|
||||||
null
|
|
||||||
);
|
|
||||||
|
|
||||||
if (options) {
|
|
||||||
if (options.target) {
|
|
||||||
insert_dev(options.target, this, options.anchor);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (options.props) {
|
|
||||||
this.$set(options.props);
|
|
||||||
flush();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static get observedAttributes() {
|
|
||||||
return ["callback", "colors"];
|
|
||||||
}
|
|
||||||
|
|
||||||
get callback() {
|
|
||||||
return this.$$.ctx[1];
|
|
||||||
}
|
|
||||||
|
|
||||||
set callback(callback) {
|
|
||||||
this.$$set({ callback });
|
|
||||||
flush();
|
|
||||||
}
|
|
||||||
|
|
||||||
get colors() {
|
|
||||||
return this.$$.ctx[2];
|
|
||||||
}
|
|
||||||
|
|
||||||
set colors(colors) {
|
|
||||||
this.$$set({ colors });
|
|
||||||
flush();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
customElements.define("map-component", Map_component);
|
|
||||||
|
|
||||||
export { Map_component as default };
|
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,301 +1 @@
|
||||||
|
import{S as i,i as e,a as t,b as a,s as n,e as r,c as d,n as s,d as o,f as l,g as m,m as p,o as h,j as g}from"./index-db20528a.js";import{debounce as f}from"../../../../../../../../../js/libraries/miscTools.js";function c(i){let e,t,n,p,h,g,f,c,u,b;return{c(){e=r("div"),t=r("div"),n=r("div"),p=r("div"),p.innerHTML='<slot name="sidebar-left"></slot>',h=d(),g=r("div"),g.innerHTML='<slot name="sidebar-left2"></slot>',f=d(),c=r("div"),c.innerHTML='<slot name="sidebar-right"></slot>',u=d(),b=r("div"),b.innerHTML='<slot name="main" id="main-slot"></slot>',this.c=s,o(p,"id","sidebar-left"),o(g,"id","sidebar-left2"),o(n,"id","sidebars-left"),o(n,"class","sidebar"),o(c,"id","sidebar-right"),o(c,"class","pane sidebar"),o(b,"id","main-pane"),o(t,"class","pane-container"),o(e,"id","root"),o(e,"class","pane-centering")},m(r,d){a(r,e,d),l(e,t),l(t,n),l(n,p),i[5](p),l(n,h),l(n,g),i[6](g),l(t,f),l(t,c),i[7](c),l(t,u),l(t,b),i[8](b),i[9](e)},p:s,i:s,o:s,d(t){t&&m(e),i[5](null),i[6](null),i[7](null),i[8](null),i[9](null)}}}function u(i,e,t){let a,n,r,d,s,o=null!=p("alignerParent")?p("alignerParent").switchView:void 0,l=!1,m=!1,c=!1;function u(){if(null!=a.parentNode){let i=a.parentNode.host.childNodes;if(0==i.length)setTimeout(u,50);else{let e=!1,n=a.parentNode.innerHTML;for(let t of i)"sidebar-left"!=t.slot||l?"sidebar-left2"!=t.slot||m?"sidebar-right"!=t.slot||c||(n=n.replace("#sidebar-right{display:none;","#sidebar-right{"),c=!0,e=!0):(n=n.replace("#sidebar-left2{display:none}",""),m=!0,e=!0):(n=n.replace("#sidebar-left{display:none}",""),l=!0,e=!0);null!=o&&(n=n.replace("1880px",o),e=!0),e&&t(0,a.parentNode.innerHTML=n,a)}}}return window.addEventListener("resize",f(u,100)),h((()=>{u()})),[a,n,r,d,s,function(i){g[i?"unshift":"push"]((()=>{r=i,t(2,r)}))},function(i){g[i?"unshift":"push"]((()=>{d=i,t(3,d)}))},function(i){g[i?"unshift":"push"]((()=>{s=i,t(4,s)}))},function(i){g[i?"unshift":"push"]((()=>{n=i,t(1,n)}))},function(i){g[i?"unshift":"push"]((()=>{a=i,t(0,a)}))}]}class b extends i{constructor(i){super(),this.shadowRoot.innerHTML="<style>@import '/css/common.css';.pane-container{display:block;margin-left:var(--total-margin-left,0rem)}#root{position:relative;margin-top:auto;min-height:var(--min-height,auto);height:100%}#main-pane{position:relative;padding-left:var(--padding-left,0rem);padding-right:var(--padding-right,0rem);padding-top:var(--padding-top,0rem);padding-bottom:var(--padding-bottom,0rem);text-align:justify;margin:auto;height:100%;max-width:var(--width-main,66rem);width:var(--width-main,66rem);z-index:1;overflow-x:var(--overflow-x,hidden)}.sidebar{position:absolute}#sidebars-left{display:flex;flex-direction:column;gap:1rem;margin-left:calc(-1*var(--width-left,22.5rem) - 1rem - 4rem);width:max-content;max-width:30rem}#sidebar-left,#sidebar-left2{position:relative;background-color:white;padding:0rem 0rem}#sidebar-left{display:none}#sidebar-left2{display:none}#sidebar-right{display:none;margin-left:calc(var(--width-main,66rem) + 1rem);width:var(--width-right,auto);background-color:white;padding:2rem 2rem}@media only screen and (max-width: 1340px){#main-pane{max-width:initial;width:100%;max-width:var(--width-main,66rem);padding-left:var(--padding-left-mobile,0rem);padding-right:var(--padding-right-mobile,0rem);padding-top:var(--padding-top-mobile,0rem);padding-bottom:var(--padding-bottom-mobile,0rem)}#sidebars-left,#sidebar-right{position:relative;margin:auto;margin-top:1rem;margin-bottom:1rem;max-width:var(--width-main,66rem);width:100%}.pane-container{width:95%;justify-items:center;grid-auto-flow:row;margin-left:0}}</style>",e(this,{target:this.shadowRoot,props:t(this.attributes),customElement:!0},u,c,n,{},null),i&&i.target&&a(i.target,this,i.anchor)}}customElements.define("pane-aligner",b);export{b as default};
|
||||||
(function(l, r) { if (!l || l.getElementById('livereloadscript')) return; r = l.createElement('script'); r.async = 1; r.src = '//' + (self.location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1'; r.id = 'livereloadscript'; l.getElementsByTagName('head')[0].appendChild(r) })(self.document);
|
|
||||||
import { S as SvelteElement, i as init, a as attribute_to_object, b as insert_dev, s as safe_not_equal, d as dispatch_dev, v as validate_slots, g as getContext, o as onMount, c as setContext, f as element, h as space, n as noop, k as attr_dev, j as add_location, l as append_dev, p as detach_dev, q as binding_callbacks } from './index-998178c7.js';
|
|
||||||
import { debounce } from '../../../../../../../../../js/libraries/miscTools.js';
|
|
||||||
|
|
||||||
/* src\components\pane-aligner.svelte generated by Svelte v3.52.0 */
|
|
||||||
const file = "src\\components\\pane-aligner.svelte";
|
|
||||||
|
|
||||||
function create_fragment(ctx) {
|
|
||||||
let div6;
|
|
||||||
let div5;
|
|
||||||
let div2;
|
|
||||||
let div0;
|
|
||||||
let slot0;
|
|
||||||
let t0;
|
|
||||||
let div1;
|
|
||||||
let slot1;
|
|
||||||
let t1;
|
|
||||||
let div3;
|
|
||||||
let slot2;
|
|
||||||
let t2;
|
|
||||||
let div4;
|
|
||||||
let slot3;
|
|
||||||
|
|
||||||
const block = {
|
|
||||||
c: function create() {
|
|
||||||
div6 = element("div");
|
|
||||||
div5 = element("div");
|
|
||||||
div2 = element("div");
|
|
||||||
div0 = element("div");
|
|
||||||
slot0 = element("slot");
|
|
||||||
t0 = space();
|
|
||||||
div1 = element("div");
|
|
||||||
slot1 = element("slot");
|
|
||||||
t1 = space();
|
|
||||||
div3 = element("div");
|
|
||||||
slot2 = element("slot");
|
|
||||||
t2 = space();
|
|
||||||
div4 = element("div");
|
|
||||||
slot3 = element("slot");
|
|
||||||
this.c = noop;
|
|
||||||
attr_dev(slot0, "name", "sidebar-left");
|
|
||||||
add_location(slot0, file, 74, 16, 2554);
|
|
||||||
attr_dev(div0, "id", "sidebar-left");
|
|
||||||
add_location(div0, file, 73, 12, 2489);
|
|
||||||
attr_dev(slot1, "name", "sidebar-left2");
|
|
||||||
add_location(slot1, file, 77, 16, 2688);
|
|
||||||
attr_dev(div1, "id", "sidebar-left2");
|
|
||||||
add_location(div1, file, 76, 12, 2621);
|
|
||||||
attr_dev(div2, "id", "sidebars-left");
|
|
||||||
attr_dev(div2, "class", "sidebar");
|
|
||||||
add_location(div2, file, 72, 8, 2435);
|
|
||||||
attr_dev(slot2, "name", "sidebar-right");
|
|
||||||
add_location(slot2, file, 81, 12, 2853);
|
|
||||||
attr_dev(div3, "id", "sidebar-right");
|
|
||||||
attr_dev(div3, "class", "pane sidebar");
|
|
||||||
add_location(div3, file, 80, 8, 2768);
|
|
||||||
attr_dev(slot3, "name", "main");
|
|
||||||
attr_dev(slot3, "id", "main-slot");
|
|
||||||
add_location(slot3, file, 84, 12, 2968);
|
|
||||||
attr_dev(div4, "id", "main-pane");
|
|
||||||
add_location(div4, file, 83, 8, 2913);
|
|
||||||
attr_dev(div5, "class", "pane-container");
|
|
||||||
add_location(div5, file, 71, 4, 2397);
|
|
||||||
attr_dev(div6, "id", "root");
|
|
||||||
attr_dev(div6, "class", "pane-centering");
|
|
||||||
add_location(div6, file, 70, 0, 2336);
|
|
||||||
},
|
|
||||||
l: function claim(nodes) {
|
|
||||||
throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
|
|
||||||
},
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insert_dev(target, div6, anchor);
|
|
||||||
append_dev(div6, div5);
|
|
||||||
append_dev(div5, div2);
|
|
||||||
append_dev(div2, div0);
|
|
||||||
append_dev(div0, slot0);
|
|
||||||
/*div0_binding*/ ctx[5](div0);
|
|
||||||
append_dev(div2, t0);
|
|
||||||
append_dev(div2, div1);
|
|
||||||
append_dev(div1, slot1);
|
|
||||||
/*div1_binding*/ ctx[6](div1);
|
|
||||||
append_dev(div5, t1);
|
|
||||||
append_dev(div5, div3);
|
|
||||||
append_dev(div3, slot2);
|
|
||||||
/*div3_binding*/ ctx[7](div3);
|
|
||||||
append_dev(div5, t2);
|
|
||||||
append_dev(div5, div4);
|
|
||||||
append_dev(div4, slot3);
|
|
||||||
/*div4_binding*/ ctx[8](div4);
|
|
||||||
/*div6_binding*/ ctx[9](div6);
|
|
||||||
},
|
|
||||||
p: noop,
|
|
||||||
i: noop,
|
|
||||||
o: noop,
|
|
||||||
d: function destroy(detaching) {
|
|
||||||
if (detaching) detach_dev(div6);
|
|
||||||
/*div0_binding*/ ctx[5](null);
|
|
||||||
/*div1_binding*/ ctx[6](null);
|
|
||||||
/*div3_binding*/ ctx[7](null);
|
|
||||||
/*div4_binding*/ ctx[8](null);
|
|
||||||
/*div6_binding*/ ctx[9](null);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
dispatch_dev("SvelteRegisterBlock", {
|
|
||||||
block,
|
|
||||||
id: create_fragment.name,
|
|
||||||
type: "component",
|
|
||||||
source: "",
|
|
||||||
ctx
|
|
||||||
});
|
|
||||||
|
|
||||||
return block;
|
|
||||||
}
|
|
||||||
|
|
||||||
function instance($$self, $$props, $$invalidate) {
|
|
||||||
let { $$slots: slots = {}, $$scope } = $$props;
|
|
||||||
validate_slots('pane-aligner', slots, []);
|
|
||||||
let root;
|
|
||||||
let mainPane;
|
|
||||||
let sidebarLeft;
|
|
||||||
let sidebarLeft2;
|
|
||||||
let sidebarRight;
|
|
||||||
let parentProps = getContext("alignerParent");
|
|
||||||
|
|
||||||
let switchView = parentProps != undefined
|
|
||||||
? getContext("alignerParent").switchView
|
|
||||||
: undefined;
|
|
||||||
|
|
||||||
let leftReplaced = false;
|
|
||||||
let left2Replaced = false;
|
|
||||||
let rightReplaced = false;
|
|
||||||
let switchViewReplaced = false;
|
|
||||||
|
|
||||||
function adjustSlotted() {
|
|
||||||
if (root.parentNode != null) {
|
|
||||||
let slotted = root.parentNode.host.childNodes;
|
|
||||||
|
|
||||||
if (slotted.length == 0) {
|
|
||||||
setTimeout(adjustSlotted, 50);
|
|
||||||
} else {
|
|
||||||
let changed = false;
|
|
||||||
let html = root.parentNode.innerHTML;
|
|
||||||
|
|
||||||
for (let item of slotted) {
|
|
||||||
if (item.slot == "sidebar-left" && !leftReplaced) {
|
|
||||||
html = html.replace("#sidebar-left{display:none}", "");
|
|
||||||
leftReplaced = true;
|
|
||||||
changed = true;
|
|
||||||
} else if (item.slot == "sidebar-left2" && !left2Replaced) {
|
|
||||||
html = html.replace("#sidebar-left2{display:none}", "");
|
|
||||||
left2Replaced = true;
|
|
||||||
changed = true;
|
|
||||||
} else if (item.slot == "sidebar-right" && !rightReplaced) {
|
|
||||||
html = html.replace("#sidebar-right{display:none;", "#sidebar-right{");
|
|
||||||
rightReplaced = true;
|
|
||||||
changed = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (switchView != undefined && !switchViewReplaced) {
|
|
||||||
html = html.replace("1880px", switchView);
|
|
||||||
changed = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (changed) {
|
|
||||||
$$invalidate(0, root.parentNode.innerHTML = html, root);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
window.addEventListener("resize", debounce(adjustSlotted, 100));
|
|
||||||
|
|
||||||
onMount(() => {
|
|
||||||
adjustSlotted();
|
|
||||||
});
|
|
||||||
|
|
||||||
const writable_props = [];
|
|
||||||
|
|
||||||
Object.keys($$props).forEach(key => {
|
|
||||||
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(`<pane-aligner> was created with unknown prop '${key}'`);
|
|
||||||
});
|
|
||||||
|
|
||||||
function div0_binding($$value) {
|
|
||||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
|
||||||
sidebarLeft = $$value;
|
|
||||||
$$invalidate(2, sidebarLeft);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function div1_binding($$value) {
|
|
||||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
|
||||||
sidebarLeft2 = $$value;
|
|
||||||
$$invalidate(3, sidebarLeft2);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function div3_binding($$value) {
|
|
||||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
|
||||||
sidebarRight = $$value;
|
|
||||||
$$invalidate(4, sidebarRight);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function div4_binding($$value) {
|
|
||||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
|
||||||
mainPane = $$value;
|
|
||||||
$$invalidate(1, mainPane);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function div6_binding($$value) {
|
|
||||||
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
|
||||||
root = $$value;
|
|
||||||
$$invalidate(0, root);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
$$self.$capture_state = () => ({
|
|
||||||
getContext,
|
|
||||||
setContext,
|
|
||||||
onMount,
|
|
||||||
debounce,
|
|
||||||
root,
|
|
||||||
mainPane,
|
|
||||||
sidebarLeft,
|
|
||||||
sidebarLeft2,
|
|
||||||
sidebarRight,
|
|
||||||
parentProps,
|
|
||||||
switchView,
|
|
||||||
leftReplaced,
|
|
||||||
left2Replaced,
|
|
||||||
rightReplaced,
|
|
||||||
switchViewReplaced,
|
|
||||||
adjustSlotted
|
|
||||||
});
|
|
||||||
|
|
||||||
$$self.$inject_state = $$props => {
|
|
||||||
if ('root' in $$props) $$invalidate(0, root = $$props.root);
|
|
||||||
if ('mainPane' in $$props) $$invalidate(1, mainPane = $$props.mainPane);
|
|
||||||
if ('sidebarLeft' in $$props) $$invalidate(2, sidebarLeft = $$props.sidebarLeft);
|
|
||||||
if ('sidebarLeft2' in $$props) $$invalidate(3, sidebarLeft2 = $$props.sidebarLeft2);
|
|
||||||
if ('sidebarRight' in $$props) $$invalidate(4, sidebarRight = $$props.sidebarRight);
|
|
||||||
if ('parentProps' in $$props) parentProps = $$props.parentProps;
|
|
||||||
if ('switchView' in $$props) switchView = $$props.switchView;
|
|
||||||
if ('leftReplaced' in $$props) leftReplaced = $$props.leftReplaced;
|
|
||||||
if ('left2Replaced' in $$props) left2Replaced = $$props.left2Replaced;
|
|
||||||
if ('rightReplaced' in $$props) rightReplaced = $$props.rightReplaced;
|
|
||||||
if ('switchViewReplaced' in $$props) switchViewReplaced = $$props.switchViewReplaced;
|
|
||||||
};
|
|
||||||
|
|
||||||
if ($$props && "$$inject" in $$props) {
|
|
||||||
$$self.$inject_state($$props.$$inject);
|
|
||||||
}
|
|
||||||
|
|
||||||
return [
|
|
||||||
root,
|
|
||||||
mainPane,
|
|
||||||
sidebarLeft,
|
|
||||||
sidebarLeft2,
|
|
||||||
sidebarRight,
|
|
||||||
div0_binding,
|
|
||||||
div1_binding,
|
|
||||||
div3_binding,
|
|
||||||
div4_binding,
|
|
||||||
div6_binding
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
class Pane_aligner extends SvelteElement {
|
|
||||||
constructor(options) {
|
|
||||||
super();
|
|
||||||
this.shadowRoot.innerHTML = `<style>@import '/css/common.css';.pane-container{display:block;margin-left:var(--total-margin-left,0rem)}#root{position:relative;margin-top:auto;min-height:var(--min-height,auto);height:100%}#main-pane{position:relative;padding-left:var(--padding-left,0rem);padding-right:var(--padding-right,0rem);padding-top:var(--padding-top,0rem);padding-bottom:var(--padding-bottom,0rem);text-align:justify;margin:auto;height:100%;max-width:var(--width-main,66rem);width:var(--width-main,66rem);z-index:1;overflow-x:var(--overflow-x,hidden)}.sidebar{position:absolute}#sidebars-left{display:flex;flex-direction:column;gap:1rem;margin-left:calc(-1*var(--width-left,22.5rem) - 1rem - 4rem);width:max-content;max-width:30rem}#sidebar-left,#sidebar-left2{position:relative;background-color:white;padding:0rem 0rem}#sidebar-left{display:none}#sidebar-left2{display:none}#sidebar-right{display:none;margin-left:calc(var(--width-main,66rem) + 1rem);width:var(--width-right,auto);background-color:white;padding:2rem 2rem}@media only screen and (max-width: 1340px){#main-pane{max-width:initial;width:100%;max-width:var(--width-main,66rem);padding-left:var(--padding-left-mobile,0rem);padding-right:var(--padding-right-mobile,0rem);padding-top:var(--padding-top-mobile,0rem);padding-bottom:var(--padding-bottom-mobile,0rem)}#sidebars-left,#sidebar-right{position:relative;margin:auto;margin-top:1rem;margin-bottom:1rem;max-width:var(--width-main,66rem);width:100%}.pane-container{width:95%;justify-items:center;grid-auto-flow:row;margin-left:0}}</style>`;
|
|
||||||
|
|
||||||
init(
|
|
||||||
this,
|
|
||||||
{
|
|
||||||
target: this.shadowRoot,
|
|
||||||
props: attribute_to_object(this.attributes),
|
|
||||||
customElement: true
|
|
||||||
},
|
|
||||||
instance,
|
|
||||||
create_fragment,
|
|
||||||
safe_not_equal,
|
|
||||||
{},
|
|
||||||
null
|
|
||||||
);
|
|
||||||
|
|
||||||
if (options) {
|
|
||||||
if (options.target) {
|
|
||||||
insert_dev(options.target, this, options.anchor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
customElements.define("pane-aligner", Pane_aligner);
|
|
||||||
|
|
||||||
export { Pane_aligner as default };
|
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -0,0 +1 @@
|
||||||
|
import{S as t,i as s,a as e,b as o,s as a,e as r,c as n,n as i,y as c,g as d,o as m}from"./index-db20528a.js";import"../../../../../../../../../js/libraries/authTools.js";function l(t){let s,e,a;return{c(){s=r("h3"),s.textContent="Under development",e=n(),a=r("p"),a.innerHTML='Visit <a href="https://discord.gg/Qk8KUk787z" style="color: #c52a28;">https://discord.gg/Qk8KUk787z</a> and ask for your commune to be added.',this.c=i,c(a,"position","relative"),c(a,"margin-top","2rem")},m(t,r){o(t,s,r),o(t,e,r),o(t,a,r)},p:i,i:i,o:i,d(t){t&&d(s),t&&d(e),t&&d(a)}}}function h(t){return m((()=>{})),[]}class p extends t{constructor(t){super(),this.shadowRoot.innerHTML="<style>@import '/css/common.css';h3{text-align:center}</style>",s(this,{target:this.shadowRoot,props:e(this.attributes),customElement:!0},h,l,a,{},null),t&&t.target&&o(t.target,this,t.anchor)}}customElements.define("profile-communes",p);export{p as default};
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1 @@
|
||||||
|
import{S as t,i as s,a as e,b as o,s as a,e as r,c as i,n,y as c,g as d,o as l}from"./index-db20528a.js";import"../../../../../../../../../js/libraries/authTools.js";function p(t){let s,e,a;return{c(){s=r("h3"),s.textContent="Under development",e=i(),a=r("p"),a.innerHTML='Visit <a href="https://discord.gg/Qk8KUk787z" style="color: #c52a28;">https://discord.gg/Qk8KUk787z</a> and ask for your cooperative to be added.',this.c=n,c(a,"position","relative"),c(a,"margin-top","2rem")},m(t,r){o(t,s,r),o(t,e,r),o(t,a,r)},p:n,i:n,o:n,d(t){t&&d(s),t&&d(e),t&&d(a)}}}function h(t){return l((()=>{})),[]}class m extends t{constructor(t){super(),this.shadowRoot.innerHTML="<style>@import '/css/common.css';h3{text-align:center}</style>",s(this,{target:this.shadowRoot,props:e(this.attributes),customElement:!0},h,p,a,{},null),t&&t.target&&o(t.target,this,t.anchor)}}customElements.define("profile-coops",m);export{m as default};
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -0,0 +1 @@
|
||||||
|
import{S as t,i as s,a as e,b as o,s as a,e as r,c as i,n,y as c,g as d,o as l}from"./index-db20528a.js";import"../../../../../../../../../js/libraries/authTools.js";function p(t){let s,e,a;return{c(){s=r("h3"),s.textContent="Under development",e=i(),a=r("p"),a.innerHTML='Visit <a href="https://discord.gg/Qk8KUk787z" style="color: #c52a28;">https://discord.gg/Qk8KUk787z</a> and ask for your party to be added.',this.c=n,c(a,"position","relative"),c(a,"margin-top","2rem")},m(t,r){o(t,s,r),o(t,e,r),o(t,a,r)},p:n,i:n,o:n,d(t){t&&d(s),t&&d(e),t&&d(a)}}}function h(t){return l((()=>{})),[]}class m extends t{constructor(t){super(),this.shadowRoot.innerHTML="<style>@import '/css/common.css';h3{text-align:center}</style>",s(this,{target:this.shadowRoot,props:e(this.attributes),customElement:!0},h,p,a,{},null),t&&t.target&&o(t.target,this,t.anchor)}}customElements.define("profile-parties",m);export{m as default};
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,209 +1 @@
|
||||||
|
import{S as t,i as e,a as s,b as c,k as a,s as i,e as r,c as o,n as h,d as n,f as l,l as d,g as p,r as u,o as b}from"./index-db20528a.js";import"../../../../../../../../../js/libraries/miscTools.js";function k(t){let e,s,a,i,b,k;return{c(){e=r("label"),s=r("input"),a=o(),i=r("span"),this.c=h,n(s,"type","checkbox"),n(i,"class","switch-span"),n(e,"class","switch")},m(r,o){c(r,e,o),l(e,s),s.checked=t[0],l(e,a),l(e,i),b||(k=[d(s,"change",t[4]),d(s,"click",t[1])],b=!0)},p(t,[e]){1&e&&(s.checked=t[0])},i:h,o:h,d(t){t&&p(e),b=!1,u(k)}}}function g(t,e,s){let{callback:c=null}=e,{checked:a=!1}=e;const i=()=>{setTimeout((()=>{null!=c?(s(0,a=!a),c()):i()}),100)};return b((()=>{})),t.$$set=t=>{"callback"in t&&s(2,c=t.callback),"checked"in t&&s(0,a=t.checked)},[a,function(){null!=c&&(s(0,a=!a),c())},c,i,function(){a=this.checked,s(0,a)}]}class m extends t{constructor(t){super(),this.shadowRoot.innerHTML="<style>@import '/css/common.css';.switch span{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#ccc;-webkit-transition:.4s;transition:.4s;border-radius:calc(2* 1.2rem)}.switch span:before{position:absolute;content:\"\";height:calc(var(--height) - 0.5rem);width:calc(var(--height) - 0.5rem);left:calc(0.3rem);bottom:0.25rem;background-color:white;-webkit-transition:.4s;transition:.4s;border-radius:50%}.switch input:checked+.switch-span{background-color:var(--pink)}.switch input:hover+.switch-span{box-shadow:0 0 0 var(--pink)}.switch input:checked+.switch-span:before{-webkit-transform:translateX(calc(var(--width) - var(--height)/2 - 2*0.6rem));-ms-transform:translateX(calc(var(--width) - var(--height)/2 - 2*0.6rem));transform:translateX(calc(var(--width) - var(--height)/2 - 2*0.6rem))}.switch{position:relative;display:inline-block;width:var(--width);height:var(--height)}.switch input{position:absolute;width:var(--width);height:var(--height);opacity:0}</style>",e(this,{target:this.shadowRoot,props:s(this.attributes),customElement:!0},g,k,i,{callback:2,checked:0,toggle:3},null),t&&(t.target&&c(t.target,this,t.anchor),t.props&&(this.$set(t.props),a()))}static get observedAttributes(){return["callback","checked","toggle"]}get callback(){return this.$$.ctx[2]}set callback(t){this.$$set({callback:t}),a()}get checked(){return this.$$.ctx[0]}set checked(t){this.$$set({checked:t}),a()}get toggle(){return this.$$.ctx[3]}}customElements.define("switch-component",m);export{m as default};
|
||||||
(function(l, r) { if (!l || l.getElementById('livereloadscript')) return; r = l.createElement('script'); r.async = 1; r.src = '//' + (self.location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1'; r.id = 'livereloadscript'; l.getElementsByTagName('head')[0].appendChild(r) })(self.document);
|
|
||||||
import { S as SvelteElement, i as init, a as attribute_to_object, b as insert_dev, t as flush, s as safe_not_equal, d as dispatch_dev, v as validate_slots, o as onMount, f as element, h as space, n as noop, k as attr_dev, j as add_location, l as append_dev, m as listen_dev, p as detach_dev, r as run_all } from './index-998178c7.js';
|
|
||||||
import { px2rem, getTextWidth, getCanvasFont } from '../../../../../../../../../js/libraries/miscTools.js';
|
|
||||||
|
|
||||||
/* src\components\switch-component.svelte generated by Svelte v3.52.0 */
|
|
||||||
const file = "src\\components\\switch-component.svelte";
|
|
||||||
|
|
||||||
function create_fragment(ctx) {
|
|
||||||
let label;
|
|
||||||
let input;
|
|
||||||
let t;
|
|
||||||
let span;
|
|
||||||
let mounted;
|
|
||||||
let dispose;
|
|
||||||
|
|
||||||
const block = {
|
|
||||||
c: function create() {
|
|
||||||
label = element("label");
|
|
||||||
input = element("input");
|
|
||||||
t = space();
|
|
||||||
span = element("span");
|
|
||||||
this.c = noop;
|
|
||||||
attr_dev(input, "type", "checkbox");
|
|
||||||
add_location(input, file, 39, 4, 804);
|
|
||||||
attr_dev(span, "class", "switch-span");
|
|
||||||
add_location(span, file, 40, 4, 880);
|
|
||||||
attr_dev(label, "class", "switch");
|
|
||||||
add_location(label, file, 38, 0, 776);
|
|
||||||
},
|
|
||||||
l: function claim(nodes) {
|
|
||||||
throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
|
|
||||||
},
|
|
||||||
m: function mount(target, anchor) {
|
|
||||||
insert_dev(target, label, anchor);
|
|
||||||
append_dev(label, input);
|
|
||||||
input.checked = /*checked*/ ctx[0];
|
|
||||||
append_dev(label, t);
|
|
||||||
append_dev(label, span);
|
|
||||||
|
|
||||||
if (!mounted) {
|
|
||||||
dispose = [
|
|
||||||
listen_dev(input, "change", /*input_change_handler*/ ctx[4]),
|
|
||||||
listen_dev(input, "click", /*toggleClick*/ ctx[1], false, false, false)
|
|
||||||
];
|
|
||||||
|
|
||||||
mounted = true;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
p: function update(ctx, [dirty]) {
|
|
||||||
if (dirty & /*checked*/ 1) {
|
|
||||||
input.checked = /*checked*/ ctx[0];
|
|
||||||
}
|
|
||||||
},
|
|
||||||
i: noop,
|
|
||||||
o: noop,
|
|
||||||
d: function destroy(detaching) {
|
|
||||||
if (detaching) detach_dev(label);
|
|
||||||
mounted = false;
|
|
||||||
run_all(dispose);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
dispatch_dev("SvelteRegisterBlock", {
|
|
||||||
block,
|
|
||||||
id: create_fragment.name,
|
|
||||||
type: "component",
|
|
||||||
source: "",
|
|
||||||
ctx
|
|
||||||
});
|
|
||||||
|
|
||||||
return block;
|
|
||||||
}
|
|
||||||
|
|
||||||
function instance($$self, $$props, $$invalidate) {
|
|
||||||
let { $$slots: slots = {}, $$scope } = $$props;
|
|
||||||
validate_slots('switch-component', slots, []);
|
|
||||||
let { callback = null } = $$props;
|
|
||||||
let { checked = false } = $$props;
|
|
||||||
|
|
||||||
const toggle = () => {
|
|
||||||
let f = () => {
|
|
||||||
if (callback != null) {
|
|
||||||
$$invalidate(0, checked = !checked);
|
|
||||||
callback();
|
|
||||||
} else {
|
|
||||||
toggle();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
setTimeout(f, 100);
|
|
||||||
};
|
|
||||||
|
|
||||||
function toggleClick() {
|
|
||||||
if (callback != null) {
|
|
||||||
$$invalidate(0, checked = !checked);
|
|
||||||
callback();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Main code
|
|
||||||
onMount(() => {
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
const writable_props = ['callback', 'checked'];
|
|
||||||
|
|
||||||
Object.keys($$props).forEach(key => {
|
|
||||||
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(`<switch-component> was created with unknown prop '${key}'`);
|
|
||||||
});
|
|
||||||
|
|
||||||
function input_change_handler() {
|
|
||||||
checked = this.checked;
|
|
||||||
$$invalidate(0, checked);
|
|
||||||
}
|
|
||||||
|
|
||||||
$$self.$$set = $$props => {
|
|
||||||
if ('callback' in $$props) $$invalidate(2, callback = $$props.callback);
|
|
||||||
if ('checked' in $$props) $$invalidate(0, checked = $$props.checked);
|
|
||||||
};
|
|
||||||
|
|
||||||
$$self.$capture_state = () => ({
|
|
||||||
onMount,
|
|
||||||
px2rem,
|
|
||||||
getTextWidth,
|
|
||||||
getCanvasFont,
|
|
||||||
callback,
|
|
||||||
checked,
|
|
||||||
toggle,
|
|
||||||
toggleClick
|
|
||||||
});
|
|
||||||
|
|
||||||
$$self.$inject_state = $$props => {
|
|
||||||
if ('callback' in $$props) $$invalidate(2, callback = $$props.callback);
|
|
||||||
if ('checked' in $$props) $$invalidate(0, checked = $$props.checked);
|
|
||||||
};
|
|
||||||
|
|
||||||
if ($$props && "$$inject" in $$props) {
|
|
||||||
$$self.$inject_state($$props.$$inject);
|
|
||||||
}
|
|
||||||
|
|
||||||
return [checked, toggleClick, callback, toggle, input_change_handler];
|
|
||||||
}
|
|
||||||
|
|
||||||
class Switch_component extends SvelteElement {
|
|
||||||
constructor(options) {
|
|
||||||
super();
|
|
||||||
this.shadowRoot.innerHTML = `<style>@import '/css/common.css';.switch span{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background-color:#ccc;-webkit-transition:.4s;transition:.4s;border-radius:calc(2* 1.2rem)}.switch span:before{position:absolute;content:"";height:calc(var(--height) - 0.5rem);width:calc(var(--height) - 0.5rem);left:calc(0.3rem);bottom:0.25rem;background-color:white;-webkit-transition:.4s;transition:.4s;border-radius:50%}.switch input:checked+.switch-span{background-color:var(--pink)}.switch input:hover+.switch-span{box-shadow:0 0 0 var(--pink)}.switch input:checked+.switch-span:before{-webkit-transform:translateX(calc(var(--width) - var(--height)/2 - 2*0.6rem));-ms-transform:translateX(calc(var(--width) - var(--height)/2 - 2*0.6rem));transform:translateX(calc(var(--width) - var(--height)/2 - 2*0.6rem))}.switch{position:relative;display:inline-block;width:var(--width);height:var(--height)}.switch input{position:absolute;width:var(--width);height:var(--height);opacity:0}</style>`;
|
|
||||||
|
|
||||||
init(
|
|
||||||
this,
|
|
||||||
{
|
|
||||||
target: this.shadowRoot,
|
|
||||||
props: attribute_to_object(this.attributes),
|
|
||||||
customElement: true
|
|
||||||
},
|
|
||||||
instance,
|
|
||||||
create_fragment,
|
|
||||||
safe_not_equal,
|
|
||||||
{ callback: 2, checked: 0, toggle: 3 },
|
|
||||||
null
|
|
||||||
);
|
|
||||||
|
|
||||||
if (options) {
|
|
||||||
if (options.target) {
|
|
||||||
insert_dev(options.target, this, options.anchor);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (options.props) {
|
|
||||||
this.$set(options.props);
|
|
||||||
flush();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static get observedAttributes() {
|
|
||||||
return ["callback", "checked", "toggle"];
|
|
||||||
}
|
|
||||||
|
|
||||||
get callback() {
|
|
||||||
return this.$$.ctx[2];
|
|
||||||
}
|
|
||||||
|
|
||||||
set callback(callback) {
|
|
||||||
this.$$set({ callback });
|
|
||||||
flush();
|
|
||||||
}
|
|
||||||
|
|
||||||
get checked() {
|
|
||||||
return this.$$.ctx[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
set checked(checked) {
|
|
||||||
this.$$set({ checked });
|
|
||||||
flush();
|
|
||||||
}
|
|
||||||
|
|
||||||
get toggle() {
|
|
||||||
return this.$$.ctx[3];
|
|
||||||
}
|
|
||||||
|
|
||||||
set toggle(value) {
|
|
||||||
throw new Error("<switch-component>: Cannot set read-only property 'toggle'");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
customElements.define("switch-component", Switch_component);
|
|
||||||
|
|
||||||
export { Switch_component as default };
|
|
||||||
|
|
|
@ -1,12 +1,15 @@
|
||||||
|
|
||||||
import {getData, sendData} from "/js/libraries/serverTools.js"
|
import {getData, sendData} from "/js/libraries/serverTools.js"
|
||||||
|
|
||||||
export function getUser(user,callbackOuter) {
|
export function getUser(user,loaded,callbackOuter) {
|
||||||
let callback = function(response) {
|
let callback = function(response) {
|
||||||
Object.assign(user,JSON.parse(response))
|
Object.assign(user,JSON.parse(response))
|
||||||
if(callbackOuter!=undefined) {
|
if(callbackOuter!=undefined) {
|
||||||
callbackOuter()
|
callbackOuter()
|
||||||
}
|
}
|
||||||
|
loaded.update((val) => {
|
||||||
|
return val + 1
|
||||||
|
})
|
||||||
}
|
}
|
||||||
getData("/xx/get-user",callback)
|
getData("/xx/get-user",callback)
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@ export function translate(content, x) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function addMarkersToLayer(g,layer,content,locale,addPinContent,markerColor) {
|
function addMarkersToLayer(g,layer,content,locale,addPinContent,markerColor,options) {
|
||||||
let {text,coordinates} = addPinContent(g,content,locale)
|
let {text,coordinates} = addPinContent(g,content,locale)
|
||||||
var markerIcon = new L.Icon({
|
var markerIcon = new L.Icon({
|
||||||
iconUrl: 'https://www.libsoc.org/img/common/markers/marker-' + markerColor + '.png',
|
iconUrl: 'https://www.libsoc.org/img/common/markers/marker-' + markerColor + '.png',
|
||||||
|
@ -21,57 +21,69 @@ function addMarkersToLayer(g,layer,content,locale,addPinContent,markerColor) {
|
||||||
shadowSize: [41, 41]
|
shadowSize: [41, 41]
|
||||||
})
|
})
|
||||||
let marker = L.marker(coordinates, {icon: markerIcon})
|
let marker = L.marker(coordinates, {icon: markerIcon})
|
||||||
|
marker.id = g.id
|
||||||
|
marker.members = g.members
|
||||||
|
marker.contact = g.contact
|
||||||
marker.addTo(layer).bindPopup(text)
|
marker.addTo(layer).bindPopup(text)
|
||||||
|
|
||||||
|
if (options.pinCallback!=undefined) {
|
||||||
|
marker.on('click', (event) => options.pinCallback(marker,event))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function addMarkersEntries(entries,entriesByCountry,map,content,locale,addPinContent,markerColor) {
|
export function addMarkersEntries(entries,entriesByCountry,map,content,locale,addPinContent,markerColor,options) {
|
||||||
let entriesMarkersLayer = L.layerGroup()
|
let entriesMarkersLayer = L.layerGroup()
|
||||||
let entriesMarkersLayerOut = L.layerGroup()
|
let entriesMarkersLayerOut = L.layerGroup()
|
||||||
let entriesMarkersLayerIn = L.layerGroup()
|
let entriesMarkersLayerIn = L.layerGroup()
|
||||||
for (let g of entries) {
|
for (let g of entries) {
|
||||||
if (g.country!="Online" && g.country!="Worldwide") {
|
if (g.country!="Online" && g.country!="Worldwide") {
|
||||||
addMarkersToLayer(g,entriesMarkersLayerIn,content,locale,addPinContent,markerColor)
|
addMarkersToLayer(g,entriesMarkersLayerIn,content,locale,addPinContent,markerColor,options)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (let gs of Object.values(entriesByCountry)) {
|
if (options.enableCountryGrouping) {
|
||||||
if (gs.length==1) {
|
for (let gs of Object.values(entriesByCountry)) {
|
||||||
let g = {...gs[0]}
|
if (gs.length==1) {
|
||||||
g.country = [g.country]
|
let g = {...gs[0]}
|
||||||
if (g.country!="Online" && g.country!="Worldwide") {
|
g.country = [g.country]
|
||||||
addMarkersToLayer(g,entriesMarkersLayerOut,content,locale,addPinContent,markerColor)
|
if (g.country!="Online" && g.country!="Worldwide") {
|
||||||
|
addMarkersToLayer(g,entriesMarkersLayerOut,content,locale,addPinContent,markerColor,options)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
else {
|
||||||
else {
|
if (gs[0].country!="Online" && gs[0].country!="Worldwide") {
|
||||||
if (gs[0].country!="Online" && gs[0].country!="Worldwide") {
|
let locationName = gs[0].country
|
||||||
let locationName = gs[0].country
|
let locationCoordinates = [0,0]
|
||||||
let locationCoordinates = [0,0]
|
let members = 0
|
||||||
let members = 0
|
let contact = gs[0].contact
|
||||||
let contact = gs[0].contact
|
for (let g of gs) {
|
||||||
for (let g of gs) {
|
locationCoordinates[0] += g.latitude
|
||||||
locationCoordinates[0] += g.latitude
|
locationCoordinates[1] += g.longitude
|
||||||
locationCoordinates[1] += g.longitude
|
members += g.members
|
||||||
members += g.members
|
if (g.contact[0]!=gs[0].contact[0]) {
|
||||||
if (g.contact[0]!=gs[0].contact[0]) {
|
contact = contactGeneral
|
||||||
contact = contactGeneral
|
}
|
||||||
}
|
}
|
||||||
|
locationCoordinates[0] = locationCoordinates[0]/gs.length
|
||||||
|
locationCoordinates[1] = locationCoordinates[1]/gs.length
|
||||||
|
let gNew = {
|
||||||
|
country: locationName,
|
||||||
|
latitude: locationCoordinates[0],
|
||||||
|
longitude: locationCoordinates[1],
|
||||||
|
members: members,
|
||||||
|
contact: contact
|
||||||
|
}
|
||||||
|
addMarkersToLayer(gNew,entriesMarkersLayerOut,content,locale,addPinContent,markerColor,options)
|
||||||
}
|
}
|
||||||
locationCoordinates[0] = locationCoordinates[0]/gs.length
|
|
||||||
locationCoordinates[1] = locationCoordinates[1]/gs.length
|
|
||||||
let gNew = {
|
|
||||||
country: locationName,
|
|
||||||
latitude: locationCoordinates[0],
|
|
||||||
longitude: locationCoordinates[1],
|
|
||||||
members: members,
|
|
||||||
contact: contact
|
|
||||||
}
|
|
||||||
addMarkersToLayer(gNew,entriesMarkersLayerOut,content,locale,addPinContent,markerColor)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
entriesMarkersLayerOut.addTo(entriesMarkersLayer)
|
||||||
|
map.on("zoomend", () => onZoomEnd(map,entriesMarkersLayer,entriesMarkersLayerOut,entriesMarkersLayerIn))
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
entriesMarkersLayerIn.addTo(entriesMarkersLayer)
|
||||||
}
|
}
|
||||||
|
|
||||||
entriesMarkersLayerOut.addTo(entriesMarkersLayer)
|
|
||||||
entriesMarkersLayer.addTo(map)
|
entriesMarkersLayer.addTo(map)
|
||||||
map.on("zoomend", () => onZoomEnd(map,entriesMarkersLayer,entriesMarkersLayerOut,entriesMarkersLayerIn))
|
|
||||||
return entriesMarkersLayer
|
return entriesMarkersLayer
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
|
|
||||||
using Genie.Router, Genie.Requests, Genie.Renderer.Json, JSON3, GenieAuthentication
|
using Genie.Router, Genie.Requests, Genie.Renderer.Json, JSON3, GenieAuthentication
|
||||||
|
using Server.GroupsController
|
||||||
|
|
||||||
#---Basic-----------------------------------------------------------
|
#---Basic-----------------------------------------------------------
|
||||||
|
|
||||||
|
@ -43,7 +44,15 @@ route("/:locale/groups-add/*", GroupsController.groups_add, named = :groups_add)
|
||||||
|
|
||||||
route("/:locale/groups-add-post/*", GroupsController.groups_add_post, method = POST, named = :groups_add_post)
|
route("/:locale/groups-add-post/*", GroupsController.groups_add_post, method = POST, named = :groups_add_post)
|
||||||
|
|
||||||
route("/:locale/get_user_groups/*", GroupsController.get_user_groups, named = :get_user_groups)
|
route("/:locale/get-user-groups/*", GroupsController.get_user_groups, named = :get_user_groups)
|
||||||
|
|
||||||
|
route("/:locale/get-group-requests/*", GroupsController.get_group_requests, named = :get_group_requests)
|
||||||
|
|
||||||
|
route("/:locale/group-approve-request/*", GroupsController.approve_request, method = POST, named = :group_approve_request)
|
||||||
|
|
||||||
|
route("/:locale/group-reject-request/*", GroupsController.reject_request, method = POST, named = :group_reject_request)
|
||||||
|
|
||||||
|
route("/:locale/add-verified-groups/*", GroupsController.add_verified_groups, named = :add_verified_groups)
|
||||||
|
|
||||||
#---Coops----------------------------------------------------------
|
#---Coops----------------------------------------------------------
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue