|
|
|
|
@@ -1228,7 +1228,7 @@ var app = (function () {
|
|
|
|
|
|
|
|
|
|
/* node_modules/svelte-spa-router/Router.svelte generated by Svelte v3.53.1 */
|
|
|
|
|
|
|
|
|
|
const { Error: Error_1, Object: Object_1, console: console_1$d } = globals;
|
|
|
|
|
const { Error: Error_1, Object: Object_1, console: console_1$c } = globals;
|
|
|
|
|
|
|
|
|
|
// (267:0) {:else}
|
|
|
|
|
function create_else_block$6(ctx) {
|
|
|
|
|
@@ -2008,7 +2008,7 @@ var app = (function () {
|
|
|
|
|
const writable_props = ['routes', 'prefix', 'restoreScrollState'];
|
|
|
|
|
|
|
|
|
|
Object_1.keys($$props).forEach(key => {
|
|
|
|
|
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console_1$d.warn(`<Router> was created with unknown prop '${key}'`);
|
|
|
|
|
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console_1$c.warn(`<Router> was created with unknown prop '${key}'`);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
function routeEvent_handler(event) {
|
|
|
|
|
@@ -2292,7 +2292,7 @@ var app = (function () {
|
|
|
|
|
|
|
|
|
|
/* src/pieces/Header.svelte generated by Svelte v3.53.1 */
|
|
|
|
|
|
|
|
|
|
const { console: console_1$c } = globals;
|
|
|
|
|
const { console: console_1$b } = globals;
|
|
|
|
|
const file$v = "src/pieces/Header.svelte";
|
|
|
|
|
|
|
|
|
|
// (27:39)
|
|
|
|
|
@@ -2551,7 +2551,7 @@ var app = (function () {
|
|
|
|
|
const writable_props = [];
|
|
|
|
|
|
|
|
|
|
Object.keys($$props).forEach(key => {
|
|
|
|
|
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console_1$c.warn(`<Header> was created with unknown prop '${key}'`);
|
|
|
|
|
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console_1$b.warn(`<Header> was created with unknown prop '${key}'`);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const click_handler = () => push('/');
|
|
|
|
|
@@ -3336,9 +3336,9 @@ var app = (function () {
|
|
|
|
|
|
|
|
|
|
let msgs = writable([]);
|
|
|
|
|
let layout = writable("close");
|
|
|
|
|
let user$1;
|
|
|
|
|
let user;
|
|
|
|
|
let socket$1;
|
|
|
|
|
function set_user(new_user) { user$1 = new_user; }
|
|
|
|
|
function set_user(new_user) { user = new_user; }
|
|
|
|
|
function set_socket(new_socket) { socket$1 = new_socket; }
|
|
|
|
|
function add_msg(name, message) {
|
|
|
|
|
msgs.update(msgs => [...msgs, { name: "me", message: message }]);
|
|
|
|
|
@@ -3842,8 +3842,8 @@ var app = (function () {
|
|
|
|
|
async function get_room_messages() {
|
|
|
|
|
console.log("in get_room_messages");
|
|
|
|
|
const response = await fetch('/api/v2/chat/messages');
|
|
|
|
|
const messages = await response.json();
|
|
|
|
|
console.log(messages);
|
|
|
|
|
const data = await response.json();
|
|
|
|
|
const messages = data.messages;
|
|
|
|
|
messages.forEach(function (item) {
|
|
|
|
|
if (item.name === user.username) {
|
|
|
|
|
item.name = "me";
|
|
|
|
|
@@ -3851,40 +3851,78 @@ var app = (function () {
|
|
|
|
|
});
|
|
|
|
|
msgs.set(messages);
|
|
|
|
|
}
|
|
|
|
|
async function create_room(room_name, room_type) {
|
|
|
|
|
console.log("in create_room");
|
|
|
|
|
// send the new room
|
|
|
|
|
const response = await fetch('/api/v2/chat/create', {
|
|
|
|
|
method: 'POST',
|
|
|
|
|
headers: { 'Content-Type': 'application/json' },
|
|
|
|
|
body: JSON.stringify(form_data),
|
|
|
|
|
});
|
|
|
|
|
// get response status and message
|
|
|
|
|
let response_status = response.status;
|
|
|
|
|
let data = await response.json();
|
|
|
|
|
let response_message = "";
|
|
|
|
|
if (data.message)
|
|
|
|
|
response_message = data.message;
|
|
|
|
|
return {
|
|
|
|
|
status: response_status,
|
|
|
|
|
message: response_message
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
async function join_room(room_name) {
|
|
|
|
|
console.log("in change_room");
|
|
|
|
|
console.log(room_name);
|
|
|
|
|
console.log("in join_room");
|
|
|
|
|
let name = {
|
|
|
|
|
room_name: room_name,
|
|
|
|
|
};
|
|
|
|
|
const response = await fetch('/api/v2/chat/join', {
|
|
|
|
|
method: 'POST',
|
|
|
|
|
headers: { 'Content-Type': 'application/json' },
|
|
|
|
|
body: JSON.stringify(room_name),
|
|
|
|
|
body: JSON.stringify(name),
|
|
|
|
|
});
|
|
|
|
|
console.log(await response.json().message);
|
|
|
|
|
let data = await response.json();
|
|
|
|
|
console.log(data.message);
|
|
|
|
|
socket$1.emit('join', room_name);
|
|
|
|
|
}
|
|
|
|
|
async function change_room(room_name) {
|
|
|
|
|
console.log("in change_room");
|
|
|
|
|
console.log(room_name);
|
|
|
|
|
let name = {
|
|
|
|
|
room_name: room_name,
|
|
|
|
|
};
|
|
|
|
|
const response = await fetch('/api/v2/chat/change', {
|
|
|
|
|
method: 'POST',
|
|
|
|
|
headers: { 'Content-Type': 'application/json' },
|
|
|
|
|
body: JSON.stringify(room_name),
|
|
|
|
|
body: JSON.stringify(name),
|
|
|
|
|
});
|
|
|
|
|
console.log(await response.json().message);
|
|
|
|
|
let data = await response.json();
|
|
|
|
|
console.log(data.message);
|
|
|
|
|
await get_room_messages();
|
|
|
|
|
layout.set("room");
|
|
|
|
|
}
|
|
|
|
|
async function get_all_rooms() {
|
|
|
|
|
console.log("in get_all_rooms");
|
|
|
|
|
// ask api for the rooms
|
|
|
|
|
const response = await fetch('/api/v2/chat/myrooms');
|
|
|
|
|
const data = await response.json();
|
|
|
|
|
console.log("data.rooms:", data.rooms);
|
|
|
|
|
for (let room of data.rooms)
|
|
|
|
|
console.log(room.name);
|
|
|
|
|
let rooms = data.rooms;
|
|
|
|
|
return rooms;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* src/pieces/chat/Layout_home.svelte generated by Svelte v3.53.1 */
|
|
|
|
|
|
|
|
|
|
const { console: console_1$b } = globals;
|
|
|
|
|
const { console: console_1$a } = globals;
|
|
|
|
|
const file$p = "src/pieces/chat/Layout_home.svelte";
|
|
|
|
|
|
|
|
|
|
function get_each_context$6(ctx, list, i) {
|
|
|
|
|
const child_ctx = ctx.slice();
|
|
|
|
|
child_ctx[3] = list[i];
|
|
|
|
|
child_ctx[2] = list[i];
|
|
|
|
|
return child_ctx;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// (36:1) <Button new_layout="settings" my_class="settings dots icon">
|
|
|
|
|
// (23:1) <Button new_layout="settings" my_class="settings dots icon">
|
|
|
|
|
function create_default_slot_3$5(ctx) {
|
|
|
|
|
let t;
|
|
|
|
|
|
|
|
|
|
@@ -3904,14 +3942,14 @@ var app = (function () {
|
|
|
|
|
block,
|
|
|
|
|
id: create_default_slot_3$5.name,
|
|
|
|
|
type: "slot",
|
|
|
|
|
source: "(36:1) <Button new_layout=\\\"settings\\\" my_class=\\\"settings dots icon\\\">",
|
|
|
|
|
source: "(23:1) <Button new_layout=\\\"settings\\\" my_class=\\\"settings dots icon\\\">",
|
|
|
|
|
ctx
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return block;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// (41:1) <Button new_layout="new" my_class="new transparent">
|
|
|
|
|
// (28:1) <Button new_layout="new" my_class="new transparent">
|
|
|
|
|
function create_default_slot_2$9(ctx) {
|
|
|
|
|
let t;
|
|
|
|
|
|
|
|
|
|
@@ -3931,14 +3969,14 @@ var app = (function () {
|
|
|
|
|
block,
|
|
|
|
|
id: create_default_slot_2$9.name,
|
|
|
|
|
type: "slot",
|
|
|
|
|
source: "(41:1) <Button new_layout=\\\"new\\\" my_class=\\\"new transparent\\\">",
|
|
|
|
|
source: "(28:1) <Button new_layout=\\\"new\\\" my_class=\\\"new transparent\\\">",
|
|
|
|
|
ctx
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return block;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// (46:1) <Button new_layout="close" my_class="close icon">
|
|
|
|
|
// (33:1) <Button new_layout="close" my_class="close icon">
|
|
|
|
|
function create_default_slot_1$9(ctx) {
|
|
|
|
|
let t;
|
|
|
|
|
|
|
|
|
|
@@ -3958,7 +3996,7 @@ var app = (function () {
|
|
|
|
|
block,
|
|
|
|
|
id: create_default_slot_1$9.name,
|
|
|
|
|
type: "slot",
|
|
|
|
|
source: "(46:1) <Button new_layout=\\\"close\\\" my_class=\\\"close icon\\\">",
|
|
|
|
|
source: "(33:1) <Button new_layout=\\\"close\\\" my_class=\\\"close icon\\\">",
|
|
|
|
|
ctx
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
@@ -3987,11 +4025,11 @@ var app = (function () {
|
|
|
|
|
return block;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// (60:3) {:then}
|
|
|
|
|
// (47:3) {:then rooms}
|
|
|
|
|
function create_then_block$2(ctx) {
|
|
|
|
|
let each_1_anchor;
|
|
|
|
|
let current;
|
|
|
|
|
let each_value = /*rooms*/ ctx[0];
|
|
|
|
|
let each_value = /*rooms*/ ctx[1];
|
|
|
|
|
validate_each_argument(each_value);
|
|
|
|
|
let each_blocks = [];
|
|
|
|
|
|
|
|
|
|
@@ -4020,8 +4058,8 @@ var app = (function () {
|
|
|
|
|
current = true;
|
|
|
|
|
},
|
|
|
|
|
p: function update(ctx, dirty) {
|
|
|
|
|
if (dirty & /*go_to_room, rooms*/ 5) {
|
|
|
|
|
each_value = /*rooms*/ ctx[0];
|
|
|
|
|
if (dirty & /*go_to_room, rooms*/ 3) {
|
|
|
|
|
each_value = /*rooms*/ ctx[1];
|
|
|
|
|
validate_each_argument(each_value);
|
|
|
|
|
let i;
|
|
|
|
|
|
|
|
|
|
@@ -4076,16 +4114,16 @@ var app = (function () {
|
|
|
|
|
block,
|
|
|
|
|
id: create_then_block$2.name,
|
|
|
|
|
type: "then",
|
|
|
|
|
source: "(60:3) {:then}",
|
|
|
|
|
source: "(47:3) {:then rooms}",
|
|
|
|
|
ctx
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return block;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// (62:5) <Button my_class="list" on_click={go_to_room}>
|
|
|
|
|
// (49:5) <Button my_class="list" on_click={go_to_room}>
|
|
|
|
|
function create_default_slot$b(ctx) {
|
|
|
|
|
let t0_value = /*room*/ ctx[3].name + "";
|
|
|
|
|
let t0_value = /*room*/ ctx[2].name + "";
|
|
|
|
|
let t0;
|
|
|
|
|
let t1;
|
|
|
|
|
|
|
|
|
|
@@ -4098,9 +4136,7 @@ var app = (function () {
|
|
|
|
|
insert_dev(target, t0, anchor);
|
|
|
|
|
insert_dev(target, t1, anchor);
|
|
|
|
|
},
|
|
|
|
|
p: function update(ctx, dirty) {
|
|
|
|
|
if (dirty & /*rooms*/ 1 && t0_value !== (t0_value = /*room*/ ctx[3].name + "")) set_data_dev(t0, t0_value);
|
|
|
|
|
},
|
|
|
|
|
p: noop,
|
|
|
|
|
d: function destroy(detaching) {
|
|
|
|
|
if (detaching) detach_dev(t0);
|
|
|
|
|
if (detaching) detach_dev(t1);
|
|
|
|
|
@@ -4111,14 +4147,14 @@ var app = (function () {
|
|
|
|
|
block,
|
|
|
|
|
id: create_default_slot$b.name,
|
|
|
|
|
type: "slot",
|
|
|
|
|
source: "(62:5) <Button my_class=\\\"list\\\" on_click={go_to_room}>",
|
|
|
|
|
source: "(49:5) <Button my_class=\\\"list\\\" on_click={go_to_room}>",
|
|
|
|
|
ctx
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return block;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// (61:4) {#each rooms as room}
|
|
|
|
|
// (48:4) {#each rooms as room}
|
|
|
|
|
function create_each_block$6(ctx) {
|
|
|
|
|
let button;
|
|
|
|
|
let current;
|
|
|
|
|
@@ -4126,7 +4162,7 @@ var app = (function () {
|
|
|
|
|
button = new Element_button({
|
|
|
|
|
props: {
|
|
|
|
|
my_class: "list",
|
|
|
|
|
on_click: /*go_to_room*/ ctx[2],
|
|
|
|
|
on_click: /*go_to_room*/ ctx[0],
|
|
|
|
|
$$slots: { default: [create_default_slot$b] },
|
|
|
|
|
$$scope: { ctx }
|
|
|
|
|
},
|
|
|
|
|
@@ -4144,7 +4180,7 @@ var app = (function () {
|
|
|
|
|
p: function update(ctx, dirty) {
|
|
|
|
|
const button_changes = {};
|
|
|
|
|
|
|
|
|
|
if (dirty & /*$$scope, rooms*/ 65) {
|
|
|
|
|
if (dirty & /*$$scope*/ 32) {
|
|
|
|
|
button_changes.$$scope = { dirty, ctx };
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -4168,14 +4204,14 @@ var app = (function () {
|
|
|
|
|
block,
|
|
|
|
|
id: create_each_block$6.name,
|
|
|
|
|
type: "each",
|
|
|
|
|
source: "(61:4) {#each rooms as room}",
|
|
|
|
|
source: "(48:4) {#each rooms as room}",
|
|
|
|
|
ctx
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return block;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// (57:21) <!-- promise is pending --> <p>rooms are loaded...</p> {:then}
|
|
|
|
|
// (44:17) <!-- promise is pending --> <p>rooms are loaded...</p> {:then rooms}
|
|
|
|
|
function create_pending_block$2(ctx) {
|
|
|
|
|
let p;
|
|
|
|
|
|
|
|
|
|
@@ -4183,7 +4219,7 @@ var app = (function () {
|
|
|
|
|
c: function create() {
|
|
|
|
|
p = element("p");
|
|
|
|
|
p.textContent = "rooms are loaded...";
|
|
|
|
|
add_location(p, file$p, 58, 4, 1284);
|
|
|
|
|
add_location(p, file$p, 45, 4, 1036);
|
|
|
|
|
},
|
|
|
|
|
m: function mount(target, anchor) {
|
|
|
|
|
insert_dev(target, p, anchor);
|
|
|
|
|
@@ -4200,7 +4236,7 @@ var app = (function () {
|
|
|
|
|
block,
|
|
|
|
|
id: create_pending_block$2.name,
|
|
|
|
|
type: "pending",
|
|
|
|
|
source: "(57:21) <!-- promise is pending --> <p>rooms are loaded...</p> {:then}",
|
|
|
|
|
source: "(44:17) <!-- promise is pending --> <p>rooms are loaded...</p> {:then rooms}",
|
|
|
|
|
ctx
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
@@ -4262,10 +4298,11 @@ var app = (function () {
|
|
|
|
|
pending: create_pending_block$2,
|
|
|
|
|
then: create_then_block$2,
|
|
|
|
|
catch: create_catch_block$2,
|
|
|
|
|
value: 1,
|
|
|
|
|
blocks: [,,,]
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
handle_promise(/*get_rooms*/ ctx[1], info);
|
|
|
|
|
handle_promise(/*rooms*/ ctx[1], info);
|
|
|
|
|
|
|
|
|
|
const block = {
|
|
|
|
|
c: function create() {
|
|
|
|
|
@@ -4287,17 +4324,17 @@ var app = (function () {
|
|
|
|
|
t6 = space();
|
|
|
|
|
info.block.c();
|
|
|
|
|
attr_dev(p0, "class", "title svelte-1jygwt2");
|
|
|
|
|
add_location(p0, file$p, 51, 2, 1052);
|
|
|
|
|
add_location(p0, file$p, 38, 2, 808);
|
|
|
|
|
attr_dev(p1, "class", "__center");
|
|
|
|
|
add_location(p1, file$p, 54, 4, 1162);
|
|
|
|
|
add_location(p1, file$p, 41, 4, 918);
|
|
|
|
|
attr_dev(div0, "class", "__show_if_only_child");
|
|
|
|
|
add_location(div0, file$p, 53, 3, 1123);
|
|
|
|
|
add_location(div0, file$p, 40, 3, 879);
|
|
|
|
|
attr_dev(div1, "class", "room_list");
|
|
|
|
|
add_location(div1, file$p, 52, 2, 1096);
|
|
|
|
|
add_location(div1, file$p, 39, 2, 852);
|
|
|
|
|
attr_dev(div2, "class", "panel panel_home __border_top svelte-1jygwt2");
|
|
|
|
|
add_location(div2, file$p, 50, 1, 1006);
|
|
|
|
|
add_location(div2, file$p, 37, 1, 762);
|
|
|
|
|
attr_dev(div3, "class", "grid_box svelte-1jygwt2");
|
|
|
|
|
add_location(div3, file$p, 32, 0, 683);
|
|
|
|
|
add_location(div3, file$p, 19, 0, 439);
|
|
|
|
|
},
|
|
|
|
|
l: function claim(nodes) {
|
|
|
|
|
throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
|
|
|
|
|
@@ -4326,21 +4363,21 @@ var app = (function () {
|
|
|
|
|
ctx = new_ctx;
|
|
|
|
|
const button0_changes = {};
|
|
|
|
|
|
|
|
|
|
if (dirty & /*$$scope*/ 64) {
|
|
|
|
|
if (dirty & /*$$scope*/ 32) {
|
|
|
|
|
button0_changes.$$scope = { dirty, ctx };
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
button0.$set(button0_changes);
|
|
|
|
|
const button1_changes = {};
|
|
|
|
|
|
|
|
|
|
if (dirty & /*$$scope*/ 64) {
|
|
|
|
|
if (dirty & /*$$scope*/ 32) {
|
|
|
|
|
button1_changes.$$scope = { dirty, ctx };
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
button1.$set(button1_changes);
|
|
|
|
|
const button2_changes = {};
|
|
|
|
|
|
|
|
|
|
if (dirty & /*$$scope*/ 64) {
|
|
|
|
|
if (dirty & /*$$scope*/ 32) {
|
|
|
|
|
button2_changes.$$scope = { dirty, ctx };
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -4392,51 +4429,43 @@ var app = (function () {
|
|
|
|
|
function instance$s($$self, $$props, $$invalidate) {
|
|
|
|
|
let { $$slots: slots = {}, $$scope } = $$props;
|
|
|
|
|
validate_slots('Layout_home', slots, []);
|
|
|
|
|
let rooms = [];
|
|
|
|
|
|
|
|
|
|
// ask api for the rooms
|
|
|
|
|
const get_rooms = fetch('/api/v2/chat/myrooms').then(resp => resp.json()).then(data => {
|
|
|
|
|
console.log("data.rooms:", data.rooms);
|
|
|
|
|
for (let room of data.rooms) console.log(room.name);
|
|
|
|
|
$$invalidate(0, rooms = data.rooms);
|
|
|
|
|
});
|
|
|
|
|
let rooms = get_all_rooms();
|
|
|
|
|
|
|
|
|
|
// go to clicked room
|
|
|
|
|
async function go_to_room(evt) {
|
|
|
|
|
console.log("inside go_to_room");
|
|
|
|
|
let room_name = { room_name: evt.target.innerText };
|
|
|
|
|
await change_room(room_name);
|
|
|
|
|
await change_room(evt.target.innerText);
|
|
|
|
|
await get_room_messages();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const writable_props = [];
|
|
|
|
|
|
|
|
|
|
Object.keys($$props).forEach(key => {
|
|
|
|
|
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console_1$b.warn(`<Layout_home> was created with unknown prop '${key}'`);
|
|
|
|
|
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console_1$a.warn(`<Layout_home> was created with unknown prop '${key}'`);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$$self.$capture_state = () => ({
|
|
|
|
|
layout,
|
|
|
|
|
msgs,
|
|
|
|
|
user: user$1,
|
|
|
|
|
join_room,
|
|
|
|
|
user,
|
|
|
|
|
change_room,
|
|
|
|
|
get_room_messages,
|
|
|
|
|
get_all_rooms,
|
|
|
|
|
onMount,
|
|
|
|
|
Button: Element_button,
|
|
|
|
|
rooms,
|
|
|
|
|
get_rooms,
|
|
|
|
|
go_to_room
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$$self.$inject_state = $$props => {
|
|
|
|
|
if ('rooms' in $$props) $$invalidate(0, rooms = $$props.rooms);
|
|
|
|
|
if ('rooms' in $$props) $$invalidate(1, rooms = $$props.rooms);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
if ($$props && "$$inject" in $$props) {
|
|
|
|
|
$$self.$inject_state($$props.$$inject);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return [rooms, get_rooms, go_to_room];
|
|
|
|
|
return [go_to_room, rooms];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class Layout_home extends SvelteComponentDev {
|
|
|
|
|
@@ -4606,7 +4635,7 @@ var app = (function () {
|
|
|
|
|
|
|
|
|
|
/* src/pieces/chat/Layout_room.svelte generated by Svelte v3.53.1 */
|
|
|
|
|
|
|
|
|
|
const { console: console_1$a } = globals;
|
|
|
|
|
const { console: console_1$9 } = globals;
|
|
|
|
|
const file$n = "src/pieces/chat/Layout_room.svelte";
|
|
|
|
|
|
|
|
|
|
function get_each_context$5(ctx, list, i) {
|
|
|
|
|
@@ -5110,7 +5139,7 @@ var app = (function () {
|
|
|
|
|
const writable_props = ['back'];
|
|
|
|
|
|
|
|
|
|
Object.keys($$props).forEach(key => {
|
|
|
|
|
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console_1$a.warn(`<Layout_room> was created with unknown prop '${key}'`);
|
|
|
|
|
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console_1$9.warn(`<Layout_room> was created with unknown prop '${key}'`);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
function div2_input_handler() {
|
|
|
|
|
@@ -5190,7 +5219,7 @@ var app = (function () {
|
|
|
|
|
|
|
|
|
|
/* src/pieces/chat/Layout_new.svelte generated by Svelte v3.53.1 */
|
|
|
|
|
|
|
|
|
|
const { console: console_1$9 } = globals;
|
|
|
|
|
const { console: console_1$8 } = globals;
|
|
|
|
|
const file$m = "src/pieces/chat/Layout_new.svelte";
|
|
|
|
|
|
|
|
|
|
function get_each_context$4(ctx, list, i) {
|
|
|
|
|
@@ -5199,7 +5228,7 @@ var app = (function () {
|
|
|
|
|
return child_ctx;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// (40:1) <Button new_layout={back} my_class="back icon" my_title="go back {back}">
|
|
|
|
|
// (37:1) <Button new_layout={back} my_class="back icon" my_title="go back {back}">
|
|
|
|
|
function create_default_slot_4$2(ctx) {
|
|
|
|
|
let t;
|
|
|
|
|
|
|
|
|
|
@@ -5219,14 +5248,14 @@ var app = (function () {
|
|
|
|
|
block,
|
|
|
|
|
id: create_default_slot_4$2.name,
|
|
|
|
|
type: "slot",
|
|
|
|
|
source: "(40:1) <Button new_layout={back} my_class=\\\"back icon\\\" my_title=\\\"go back {back}\\\">",
|
|
|
|
|
source: "(37:1) <Button new_layout={back} my_class=\\\"back icon\\\" my_title=\\\"go back {back}\\\">",
|
|
|
|
|
ctx
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return block;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// (45:1) <Button my_class="new deactivate">
|
|
|
|
|
// (42:1) <Button my_class="new deactivate">
|
|
|
|
|
function create_default_slot_3$3(ctx) {
|
|
|
|
|
let t;
|
|
|
|
|
|
|
|
|
|
@@ -5246,14 +5275,14 @@ var app = (function () {
|
|
|
|
|
block,
|
|
|
|
|
id: create_default_slot_3$3.name,
|
|
|
|
|
type: "slot",
|
|
|
|
|
source: "(45:1) <Button my_class=\\\"new deactivate\\\">",
|
|
|
|
|
source: "(42:1) <Button my_class=\\\"new deactivate\\\">",
|
|
|
|
|
ctx
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return block;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// (50:1) <Button new_layout="close" my_class="close icon">
|
|
|
|
|
// (47:1) <Button new_layout="close" my_class="close icon">
|
|
|
|
|
function create_default_slot_2$7(ctx) {
|
|
|
|
|
let t;
|
|
|
|
|
|
|
|
|
|
@@ -5273,14 +5302,14 @@ var app = (function () {
|
|
|
|
|
block,
|
|
|
|
|
id: create_default_slot_2$7.name,
|
|
|
|
|
type: "slot",
|
|
|
|
|
source: "(50:1) <Button new_layout=\\\"close\\\" my_class=\\\"close icon\\\">",
|
|
|
|
|
source: "(47:1) <Button new_layout=\\\"close\\\" my_class=\\\"close icon\\\">",
|
|
|
|
|
ctx
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return block;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// (56:2) <Button new_layout="create" my_class="create">
|
|
|
|
|
// (53:2) <Button new_layout="create" my_class="create">
|
|
|
|
|
function create_default_slot_1$7(ctx) {
|
|
|
|
|
let t;
|
|
|
|
|
|
|
|
|
|
@@ -5300,7 +5329,7 @@ var app = (function () {
|
|
|
|
|
block,
|
|
|
|
|
id: create_default_slot_1$7.name,
|
|
|
|
|
type: "slot",
|
|
|
|
|
source: "(56:2) <Button new_layout=\\\"create\\\" my_class=\\\"create\\\">",
|
|
|
|
|
source: "(53:2) <Button new_layout=\\\"create\\\" my_class=\\\"create\\\">",
|
|
|
|
|
ctx
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
@@ -5329,7 +5358,7 @@ var app = (function () {
|
|
|
|
|
return block;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// (67:3) {:then}
|
|
|
|
|
// (64:3) {:then}
|
|
|
|
|
function create_then_block$1(ctx) {
|
|
|
|
|
let each_1_anchor;
|
|
|
|
|
let current;
|
|
|
|
|
@@ -5418,14 +5447,14 @@ var app = (function () {
|
|
|
|
|
block,
|
|
|
|
|
id: create_then_block$1.name,
|
|
|
|
|
type: "then",
|
|
|
|
|
source: "(67:3) {:then}",
|
|
|
|
|
source: "(64:3) {:then}",
|
|
|
|
|
ctx
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return block;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// (69:5) <Button my_class="list" on_click={join_rooms}>
|
|
|
|
|
// (66:5) <Button my_class="list" on_click={join_rooms}>
|
|
|
|
|
function create_default_slot$9(ctx) {
|
|
|
|
|
let t0_value = /*room*/ ctx[4].name + "";
|
|
|
|
|
let t0;
|
|
|
|
|
@@ -5453,14 +5482,14 @@ var app = (function () {
|
|
|
|
|
block,
|
|
|
|
|
id: create_default_slot$9.name,
|
|
|
|
|
type: "slot",
|
|
|
|
|
source: "(69:5) <Button my_class=\\\"list\\\" on_click={join_rooms}>",
|
|
|
|
|
source: "(66:5) <Button my_class=\\\"list\\\" on_click={join_rooms}>",
|
|
|
|
|
ctx
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return block;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// (68:4) {#each rooms as room}
|
|
|
|
|
// (65:4) {#each rooms as room}
|
|
|
|
|
function create_each_block$4(ctx) {
|
|
|
|
|
let button;
|
|
|
|
|
let current;
|
|
|
|
|
@@ -5510,14 +5539,14 @@ var app = (function () {
|
|
|
|
|
block,
|
|
|
|
|
id: create_each_block$4.name,
|
|
|
|
|
type: "each",
|
|
|
|
|
source: "(68:4) {#each rooms as room}",
|
|
|
|
|
source: "(65:4) {#each rooms as room}",
|
|
|
|
|
ctx
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return block;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// (64:21) <!-- promise is pending --> <p>rooms are loaded...</p> {:then}
|
|
|
|
|
// (61:21) <!-- promise is pending --> <p>rooms are loaded...</p> {:then}
|
|
|
|
|
function create_pending_block$1(ctx) {
|
|
|
|
|
let p;
|
|
|
|
|
|
|
|
|
|
@@ -5525,7 +5554,7 @@ var app = (function () {
|
|
|
|
|
c: function create() {
|
|
|
|
|
p = element("p");
|
|
|
|
|
p.textContent = "rooms are loaded...";
|
|
|
|
|
add_location(p, file$m, 65, 4, 1376);
|
|
|
|
|
add_location(p, file$m, 62, 4, 1335);
|
|
|
|
|
},
|
|
|
|
|
m: function mount(target, anchor) {
|
|
|
|
|
insert_dev(target, p, anchor);
|
|
|
|
|
@@ -5542,7 +5571,7 @@ var app = (function () {
|
|
|
|
|
block,
|
|
|
|
|
id: create_pending_block$1.name,
|
|
|
|
|
type: "pending",
|
|
|
|
|
source: "(64:21) <!-- promise is pending --> <p>rooms are loaded...</p> {:then}",
|
|
|
|
|
source: "(61:21) <!-- promise is pending --> <p>rooms are loaded...</p> {:then}",
|
|
|
|
|
ctx
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
@@ -5642,17 +5671,17 @@ var app = (function () {
|
|
|
|
|
p1.textContent = "/ there are no public rooms yet /";
|
|
|
|
|
t7 = space();
|
|
|
|
|
info.block.c();
|
|
|
|
|
add_location(p0, file$m, 58, 2, 1160);
|
|
|
|
|
add_location(p0, file$m, 55, 2, 1119);
|
|
|
|
|
attr_dev(p1, "class", "__center");
|
|
|
|
|
add_location(p1, file$m, 61, 4, 1250);
|
|
|
|
|
add_location(p1, file$m, 58, 4, 1209);
|
|
|
|
|
attr_dev(div0, "class", "__show_if_only_child");
|
|
|
|
|
add_location(div0, file$m, 60, 3, 1211);
|
|
|
|
|
add_location(div0, file$m, 57, 3, 1170);
|
|
|
|
|
attr_dev(div1, "class", "public_rooms");
|
|
|
|
|
add_location(div1, file$m, 59, 2, 1181);
|
|
|
|
|
add_location(div1, file$m, 56, 2, 1140);
|
|
|
|
|
attr_dev(div2, "class", "panel panel_new __border_top");
|
|
|
|
|
add_location(div2, file$m, 54, 1, 1044);
|
|
|
|
|
add_location(div2, file$m, 51, 1, 1003);
|
|
|
|
|
attr_dev(div3, "class", "grid_box svelte-1b4c0qx");
|
|
|
|
|
add_location(div3, file$m, 36, 0, 735);
|
|
|
|
|
add_location(div3, file$m, 33, 0, 694);
|
|
|
|
|
},
|
|
|
|
|
l: function claim(nodes) {
|
|
|
|
|
throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
|
|
|
|
|
@@ -5774,16 +5803,15 @@ var app = (function () {
|
|
|
|
|
// join the room
|
|
|
|
|
async function join_rooms(evt) {
|
|
|
|
|
console.log("inside join_room");
|
|
|
|
|
let room_name = { room_name: evt.target.innerText };
|
|
|
|
|
let room_name = evt.target.innerText;
|
|
|
|
|
await join_room(room_name);
|
|
|
|
|
await get_room_messages();
|
|
|
|
|
await change_room(room_name);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const writable_props = ['back'];
|
|
|
|
|
|
|
|
|
|
Object.keys($$props).forEach(key => {
|
|
|
|
|
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console_1$9.warn(`<Layout_new> was created with unknown prop '${key}'`);
|
|
|
|
|
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console_1$8.warn(`<Layout_new> was created with unknown prop '${key}'`);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$$self.$$set = $$props => {
|
|
|
|
|
@@ -5793,7 +5821,7 @@ var app = (function () {
|
|
|
|
|
$$self.$capture_state = () => ({
|
|
|
|
|
layout,
|
|
|
|
|
msgs,
|
|
|
|
|
user: user$1,
|
|
|
|
|
user,
|
|
|
|
|
socket: socket$1,
|
|
|
|
|
join_room,
|
|
|
|
|
change_room,
|
|
|
|
|
@@ -7100,11 +7128,9 @@ var app = (function () {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* src/pieces/chat/Layout_create.svelte generated by Svelte v3.53.1 */
|
|
|
|
|
|
|
|
|
|
const { console: console_1$8 } = globals;
|
|
|
|
|
const file$h = "src/pieces/chat/Layout_create.svelte";
|
|
|
|
|
|
|
|
|
|
// (42:1) <Button new_layout={back} my_class="back icon" my_title="go back {back}">
|
|
|
|
|
// (28:1) <Button new_layout={back} my_class="back icon" my_title="go back {back}">
|
|
|
|
|
function create_default_slot_2$3(ctx) {
|
|
|
|
|
let t;
|
|
|
|
|
|
|
|
|
|
@@ -7124,14 +7150,14 @@ var app = (function () {
|
|
|
|
|
block,
|
|
|
|
|
id: create_default_slot_2$3.name,
|
|
|
|
|
type: "slot",
|
|
|
|
|
source: "(42:1) <Button new_layout={back} my_class=\\\"back icon\\\" my_title=\\\"go back {back}\\\">",
|
|
|
|
|
source: "(28:1) <Button new_layout={back} my_class=\\\"back icon\\\" my_title=\\\"go back {back}\\\">",
|
|
|
|
|
ctx
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return block;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// (47:1) <Button my_class="create deactivate">
|
|
|
|
|
// (33:1) <Button my_class="create deactivate">
|
|
|
|
|
function create_default_slot_1$3(ctx) {
|
|
|
|
|
let t;
|
|
|
|
|
|
|
|
|
|
@@ -7151,14 +7177,14 @@ var app = (function () {
|
|
|
|
|
block,
|
|
|
|
|
id: create_default_slot_1$3.name,
|
|
|
|
|
type: "slot",
|
|
|
|
|
source: "(47:1) <Button my_class=\\\"create deactivate\\\">",
|
|
|
|
|
source: "(33:1) <Button my_class=\\\"create deactivate\\\">",
|
|
|
|
|
ctx
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return block;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// (52:1) <Button new_layout="close" my_class="close icon">
|
|
|
|
|
// (38:1) <Button new_layout="close" my_class="close icon">
|
|
|
|
|
function create_default_slot$5(ctx) {
|
|
|
|
|
let t;
|
|
|
|
|
|
|
|
|
|
@@ -7178,14 +7204,14 @@ var app = (function () {
|
|
|
|
|
block,
|
|
|
|
|
id: create_default_slot$5.name,
|
|
|
|
|
type: "slot",
|
|
|
|
|
source: "(52:1) <Button new_layout=\\\"close\\\" my_class=\\\"close icon\\\">",
|
|
|
|
|
source: "(38:1) <Button new_layout=\\\"close\\\" my_class=\\\"close icon\\\">",
|
|
|
|
|
ctx
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return block;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// (59:3) {#if response_status >= 300}
|
|
|
|
|
// (45:3) {#if response_status >= 300}
|
|
|
|
|
function create_if_block_1$5(ctx) {
|
|
|
|
|
let warning;
|
|
|
|
|
let current;
|
|
|
|
|
@@ -7203,11 +7229,7 @@ var app = (function () {
|
|
|
|
|
mount_component(warning, target, anchor);
|
|
|
|
|
current = true;
|
|
|
|
|
},
|
|
|
|
|
p: function update(ctx, dirty) {
|
|
|
|
|
const warning_changes = {};
|
|
|
|
|
if (dirty & /*response_message*/ 32) warning_changes.content = /*response_message*/ ctx[5];
|
|
|
|
|
warning.$set(warning_changes);
|
|
|
|
|
},
|
|
|
|
|
p: noop,
|
|
|
|
|
i: function intro(local) {
|
|
|
|
|
if (current) return;
|
|
|
|
|
transition_in(warning.$$.fragment, local);
|
|
|
|
|
@@ -7226,14 +7248,14 @@ var app = (function () {
|
|
|
|
|
block,
|
|
|
|
|
id: create_if_block_1$5.name,
|
|
|
|
|
type: "if",
|
|
|
|
|
source: "(59:3) {#if response_status >= 300}",
|
|
|
|
|
source: "(45:3) {#if response_status >= 300}",
|
|
|
|
|
ctx
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return block;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// (81:3) {#if room_type === 'protected'}
|
|
|
|
|
// (67:3) {#if room_type === 'protected'}
|
|
|
|
|
function create_if_block$b(ctx) {
|
|
|
|
|
let div;
|
|
|
|
|
let label;
|
|
|
|
|
@@ -7252,10 +7274,10 @@ var app = (function () {
|
|
|
|
|
t1 = space();
|
|
|
|
|
input = element("input");
|
|
|
|
|
attr_dev(p, "class", "svelte-1ulnmwp");
|
|
|
|
|
add_location(p, file$h, 82, 28, 2528);
|
|
|
|
|
add_location(p, file$h, 68, 28, 2094);
|
|
|
|
|
attr_dev(label, "for", "chat_pswd");
|
|
|
|
|
attr_dev(label, "class", "svelte-1ulnmwp");
|
|
|
|
|
add_location(label, file$h, 82, 5, 2505);
|
|
|
|
|
add_location(label, file$h, 68, 5, 2071);
|
|
|
|
|
attr_dev(input, "id", "chat_pswd");
|
|
|
|
|
attr_dev(input, "type", "password");
|
|
|
|
|
attr_dev(input, "placeholder", "minimum 8 characters");
|
|
|
|
|
@@ -7263,9 +7285,9 @@ var app = (function () {
|
|
|
|
|
attr_dev(input, "name", "password");
|
|
|
|
|
input.required = true;
|
|
|
|
|
attr_dev(input, "class", "svelte-1ulnmwp");
|
|
|
|
|
add_location(input, file$h, 83, 5, 2568);
|
|
|
|
|
add_location(input, file$h, 69, 5, 2134);
|
|
|
|
|
attr_dev(div, "class", "svelte-1ulnmwp");
|
|
|
|
|
add_location(div, file$h, 81, 4, 2494);
|
|
|
|
|
add_location(div, file$h, 67, 4, 2060);
|
|
|
|
|
},
|
|
|
|
|
m: function mount(target, anchor) {
|
|
|
|
|
insert_dev(target, div, anchor);
|
|
|
|
|
@@ -7296,7 +7318,7 @@ var app = (function () {
|
|
|
|
|
block,
|
|
|
|
|
id: create_if_block$b.name,
|
|
|
|
|
type: "if",
|
|
|
|
|
source: "(81:3) {#if room_type === 'protected'}",
|
|
|
|
|
source: "(67:3) {#if room_type === 'protected'}",
|
|
|
|
|
ctx
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
@@ -7414,17 +7436,17 @@ var app = (function () {
|
|
|
|
|
t16 = space();
|
|
|
|
|
input4 = element("input");
|
|
|
|
|
attr_dev(p0, "class", "svelte-1ulnmwp");
|
|
|
|
|
add_location(p0, file$h, 62, 26, 1681);
|
|
|
|
|
add_location(p0, file$h, 48, 26, 1247);
|
|
|
|
|
attr_dev(label0, "for", "chat_name");
|
|
|
|
|
attr_dev(label0, "class", "svelte-1ulnmwp");
|
|
|
|
|
add_location(label0, file$h, 62, 3, 1658);
|
|
|
|
|
add_location(label0, file$h, 48, 3, 1224);
|
|
|
|
|
attr_dev(input0, "id", "chat_name");
|
|
|
|
|
attr_dev(input0, "name", "room_name");
|
|
|
|
|
input0.required = true;
|
|
|
|
|
attr_dev(input0, "class", "svelte-1ulnmwp");
|
|
|
|
|
add_location(input0, file$h, 63, 3, 1715);
|
|
|
|
|
add_location(input0, file$h, 49, 3, 1281);
|
|
|
|
|
attr_dev(p1, "class", "svelte-1ulnmwp");
|
|
|
|
|
add_location(p1, file$h, 66, 4, 1858);
|
|
|
|
|
add_location(p1, file$h, 52, 4, 1424);
|
|
|
|
|
attr_dev(input1, "id", "chat_public");
|
|
|
|
|
attr_dev(input1, "type", "radio");
|
|
|
|
|
attr_dev(input1, "name", "room_type");
|
|
|
|
|
@@ -7433,12 +7455,12 @@ var app = (function () {
|
|
|
|
|
input1.required = true;
|
|
|
|
|
attr_dev(input1, "class", "svelte-1ulnmwp");
|
|
|
|
|
/*$$binding_groups*/ ctx[9][0].push(input1);
|
|
|
|
|
add_location(input1, file$h, 67, 4, 1876);
|
|
|
|
|
add_location(input1, file$h, 53, 4, 1442);
|
|
|
|
|
attr_dev(label1, "for", "chat_public");
|
|
|
|
|
attr_dev(label1, "class", "_radio svelte-1ulnmwp");
|
|
|
|
|
add_location(label1, file$h, 65, 3, 1813);
|
|
|
|
|
add_location(label1, file$h, 51, 3, 1379);
|
|
|
|
|
attr_dev(p2, "class", "svelte-1ulnmwp");
|
|
|
|
|
add_location(p2, file$h, 71, 4, 2069);
|
|
|
|
|
add_location(p2, file$h, 57, 4, 1635);
|
|
|
|
|
attr_dev(input2, "id", "chat_private");
|
|
|
|
|
attr_dev(input2, "type", "radio");
|
|
|
|
|
attr_dev(input2, "name", "room_type");
|
|
|
|
|
@@ -7447,12 +7469,12 @@ var app = (function () {
|
|
|
|
|
input2.required = true;
|
|
|
|
|
attr_dev(input2, "class", "svelte-1ulnmwp");
|
|
|
|
|
/*$$binding_groups*/ ctx[9][0].push(input2);
|
|
|
|
|
add_location(input2, file$h, 72, 4, 2088);
|
|
|
|
|
add_location(input2, file$h, 58, 4, 1654);
|
|
|
|
|
attr_dev(label2, "for", "chat_private");
|
|
|
|
|
attr_dev(label2, "class", "_radio hide svelte-1ulnmwp");
|
|
|
|
|
add_location(label2, file$h, 70, 3, 2018);
|
|
|
|
|
add_location(label2, file$h, 56, 3, 1584);
|
|
|
|
|
attr_dev(p3, "class", "svelte-1ulnmwp");
|
|
|
|
|
add_location(p3, file$h, 76, 4, 2287);
|
|
|
|
|
add_location(p3, file$h, 62, 4, 1853);
|
|
|
|
|
attr_dev(input3, "id", "chat_protected");
|
|
|
|
|
attr_dev(input3, "type", "radio");
|
|
|
|
|
attr_dev(input3, "name", "room_type");
|
|
|
|
|
@@ -7461,20 +7483,20 @@ var app = (function () {
|
|
|
|
|
input3.required = true;
|
|
|
|
|
attr_dev(input3, "class", "svelte-1ulnmwp");
|
|
|
|
|
/*$$binding_groups*/ ctx[9][0].push(input3);
|
|
|
|
|
add_location(input3, file$h, 77, 4, 2308);
|
|
|
|
|
add_location(input3, file$h, 63, 4, 1874);
|
|
|
|
|
attr_dev(label3, "for", "chat_protected");
|
|
|
|
|
attr_dev(label3, "class", "_radio hide svelte-1ulnmwp");
|
|
|
|
|
add_location(label3, file$h, 75, 3, 2234);
|
|
|
|
|
add_location(label3, file$h, 61, 3, 1800);
|
|
|
|
|
attr_dev(input4, "type", "submit");
|
|
|
|
|
input4.value = "⮡";
|
|
|
|
|
attr_dev(input4, "class", "svelte-1ulnmwp");
|
|
|
|
|
add_location(input4, file$h, 86, 3, 2732);
|
|
|
|
|
add_location(input4, file$h, 72, 3, 2298);
|
|
|
|
|
attr_dev(form, "class", "svelte-1ulnmwp");
|
|
|
|
|
add_location(form, file$h, 57, 2, 1507);
|
|
|
|
|
add_location(form, file$h, 43, 2, 1073);
|
|
|
|
|
attr_dev(div0, "class", "panel panel_create __border_top svelte-1ulnmwp");
|
|
|
|
|
add_location(div0, file$h, 56, 1, 1459);
|
|
|
|
|
add_location(div0, file$h, 42, 1, 1025);
|
|
|
|
|
attr_dev(div1, "class", "grid_box svelte-1ulnmwp");
|
|
|
|
|
add_location(div1, file$h, 38, 0, 1138);
|
|
|
|
|
add_location(div1, file$h, 24, 0, 704);
|
|
|
|
|
},
|
|
|
|
|
l: function claim(nodes) {
|
|
|
|
|
throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
|
|
|
|
|
@@ -7556,29 +7578,7 @@ var app = (function () {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
button2.$set(button2_changes);
|
|
|
|
|
|
|
|
|
|
if (/*response_status*/ ctx[4] >= 300) {
|
|
|
|
|
if (if_block0) {
|
|
|
|
|
if_block0.p(ctx, dirty);
|
|
|
|
|
|
|
|
|
|
if (dirty & /*response_status*/ 16) {
|
|
|
|
|
transition_in(if_block0, 1);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if_block0 = create_if_block_1$5(ctx);
|
|
|
|
|
if_block0.c();
|
|
|
|
|
transition_in(if_block0, 1);
|
|
|
|
|
if_block0.m(form, t3);
|
|
|
|
|
}
|
|
|
|
|
} else if (if_block0) {
|
|
|
|
|
group_outros();
|
|
|
|
|
|
|
|
|
|
transition_out(if_block0, 1, 1, () => {
|
|
|
|
|
if_block0 = null;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
check_outros();
|
|
|
|
|
}
|
|
|
|
|
if (/*response_status*/ ctx[4] >= 300) if_block0.p(ctx, dirty);
|
|
|
|
|
|
|
|
|
|
if (dirty & /*room_name*/ 2 && input0.value !== /*room_name*/ ctx[1]) {
|
|
|
|
|
set_input_value(input0, /*room_name*/ ctx[1]);
|
|
|
|
|
@@ -7664,24 +7664,12 @@ var app = (function () {
|
|
|
|
|
async function handleSubmit(evt) {
|
|
|
|
|
let formIsValid = evt.target.checkValidity();
|
|
|
|
|
if (!formIsValid) return;
|
|
|
|
|
let formData = { room_name, room_type };
|
|
|
|
|
console.log("formData:", formData);
|
|
|
|
|
|
|
|
|
|
// send the new room
|
|
|
|
|
const response = await fetch('/api/v2/chat/create', {
|
|
|
|
|
method: 'POST',
|
|
|
|
|
headers: { 'Content-Type': 'application/json' },
|
|
|
|
|
body: JSON.stringify(formData)
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// get response status and message
|
|
|
|
|
$$invalidate(4, response_status = response.status);
|
|
|
|
|
|
|
|
|
|
response_data = await response.json();
|
|
|
|
|
if (response_data.message) $$invalidate(5, response_message = response_data.message);
|
|
|
|
|
const response = await create_room();
|
|
|
|
|
|
|
|
|
|
// go to room
|
|
|
|
|
if (response_status === 200 && response_message === "successfull room creation") {
|
|
|
|
|
if (response.status === 200 && response.message === "successfull room creation") {
|
|
|
|
|
await change_room(room_name);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@@ -7689,7 +7677,7 @@ var app = (function () {
|
|
|
|
|
const writable_props = ['back'];
|
|
|
|
|
|
|
|
|
|
Object.keys($$props).forEach(key => {
|
|
|
|
|
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console_1$8.warn(`<Layout_create> was created with unknown prop '${key}'`);
|
|
|
|
|
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console.warn(`<Layout_create> was created with unknown prop '${key}'`);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const $$binding_groups = [[]];
|
|
|
|
|
@@ -7725,6 +7713,7 @@ var app = (function () {
|
|
|
|
|
|
|
|
|
|
$$self.$capture_state = () => ({
|
|
|
|
|
change_room,
|
|
|
|
|
create_room,
|
|
|
|
|
Button: Element_button,
|
|
|
|
|
Warning: Element_warning,
|
|
|
|
|
back,
|
|
|
|
|
@@ -13995,7 +13984,7 @@ var app = (function () {
|
|
|
|
|
function socket_events(socket) {
|
|
|
|
|
socket.on('message', function (from, message) {
|
|
|
|
|
console.log("received msg:", message, from);
|
|
|
|
|
if (from === user$1.username)
|
|
|
|
|
if (from === user.username)
|
|
|
|
|
from = "me";
|
|
|
|
|
msgs.update(msgs => [...msgs, { name: from, message: message }]);
|
|
|
|
|
});
|
|
|
|
|
|