Renamed Fullscreen to Dialog
This commit is contained in:
parent
28e7f1bdc8
commit
583eb05247
15 changed files with 301 additions and 54 deletions
|
@ -2,7 +2,7 @@
|
|||
import { Message } from "./message.js";
|
||||
import {Voice} from "./audio.js";
|
||||
import {Contextmenu} from "./contextmenu.js";
|
||||
import {Fullscreen} from "./fullscreen.js";
|
||||
import {Dialog} from "./dialog.js";
|
||||
import {Guild} from "./guild.js";
|
||||
import { Localuser } from "./localuser.js";
|
||||
import { Permissions } from "./permissions.js";
|
||||
|
@ -454,7 +454,7 @@ class Channel{
|
|||
let nsfw=this.nsfw;
|
||||
const thisid=this.snowflake;
|
||||
const thistype=this.type;
|
||||
const full=new Fullscreen(
|
||||
const full=new Dialog(
|
||||
["hdiv",
|
||||
["vdiv",
|
||||
["textbox","Channel name:",this.name,function(){name=this.value}],
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
export {Fullscreen};
|
||||
class Fullscreen{
|
||||
export {Dialog};
|
||||
class Dialog{
|
||||
layout;
|
||||
onclose: Function;
|
||||
onopen: Function;
|
|
@ -1,4 +1,4 @@
|
|||
import {Fullscreen} from "./fullscreen.js";
|
||||
import {Dialog} from "./dialog.js";
|
||||
import {Message} from "./message.js";
|
||||
import {MarkDown} from "./markdown.js";
|
||||
import { embedjson } from "./jsontypes.js";
|
||||
|
@ -133,7 +133,7 @@ class Embed{
|
|||
const img=document.createElement("img");
|
||||
img.classList.add("messageimg")
|
||||
img.onclick=function(){
|
||||
const full=new Fullscreen(["img",img.src,["fit"]]);
|
||||
const full=new Dialog(["img",img.src,["fit"]]);
|
||||
full.show();
|
||||
}
|
||||
img.src=this.json.thumbnail.proxy_url;
|
||||
|
@ -158,7 +158,7 @@ class Embed{
|
|||
if(this.json.thumbnail){
|
||||
img.classList.add("embedimg");
|
||||
img.onclick=function(){
|
||||
const full=new Fullscreen(["img",img.src,["fit"]]);
|
||||
const full=new Dialog(["img",img.src,["fit"]]);
|
||||
full.show();
|
||||
}
|
||||
img.src=this.json.thumbnail.proxy_url;
|
||||
|
@ -201,7 +201,7 @@ class Embed{
|
|||
const img=document.createElement("img");
|
||||
img.classList.add("bigembedimg");
|
||||
img.onclick=function(){
|
||||
const full=new Fullscreen(["img",img.src,["fit"]]);
|
||||
const full=new Dialog(["img",img.src,["fit"]]);
|
||||
full.show();
|
||||
}
|
||||
img.src=this.json.thumbnail.proxy_url||this.json.thumbnail.url;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { Message } from "./message.js";
|
||||
import { Fullscreen } from "./fullscreen.js";
|
||||
import { Dialog } from "./dialog.js";
|
||||
import { filejson } from "./jsontypes.js";
|
||||
|
||||
class File{
|
||||
|
@ -30,7 +30,7 @@ class File{
|
|||
const img=document.createElement("img");
|
||||
img.classList.add("messageimg");
|
||||
img.onclick=function(){
|
||||
const full=new Fullscreen(["img",img.src,["fit"]]);
|
||||
const full=new Dialog(["img",img.src,["fit"]]);
|
||||
full.show();
|
||||
}
|
||||
img.src=src;
|
||||
|
|
|
@ -2,7 +2,7 @@ import { Channel } from "./channel.js";
|
|||
import { Localuser } from "./localuser.js";
|
||||
import {Contextmenu} from "./contextmenu.js";
|
||||
import {Role} from "./role.js";
|
||||
import {Fullscreen} from "./fullscreen.js";
|
||||
import {Dialog} from "./dialog.js";
|
||||
import {Member} from "./member.js";
|
||||
import {Settings,RoleList} from "./settings.js";
|
||||
import {Permissions} from "./permissions.js";
|
||||
|
@ -118,7 +118,7 @@ class Guild{
|
|||
}
|
||||
setnotifcation(){
|
||||
let noti=this.message_notifications
|
||||
const notiselect=new Fullscreen(
|
||||
const notiselect=new Dialog(
|
||||
["vdiv",
|
||||
["radio","select notifications type",
|
||||
["all","only mentions","none"],
|
||||
|
@ -145,7 +145,7 @@ class Guild{
|
|||
notiselect.show();
|
||||
}
|
||||
confirmleave(){
|
||||
const full= new Fullscreen([
|
||||
const full= new Dialog([
|
||||
"vdiv",
|
||||
["title",
|
||||
"Are you sure you want to leave?"
|
||||
|
@ -280,7 +280,7 @@ class Guild{
|
|||
}
|
||||
confirmDelete(){
|
||||
let confirmname="";
|
||||
const full= new Fullscreen([
|
||||
const full= new Dialog([
|
||||
"vdiv",
|
||||
["title",
|
||||
"Are you sure you want to delete "+this.properties.name+"?"
|
||||
|
@ -429,7 +429,7 @@ class Guild{
|
|||
createchannels(func=this.createChannel){
|
||||
let name="";
|
||||
let category=0;
|
||||
const channelselect=new Fullscreen(
|
||||
const channelselect=new Dialog(
|
||||
["vdiv",
|
||||
["radio","select channel type",
|
||||
["voice","text","announcement"],
|
||||
|
@ -454,7 +454,7 @@ class Guild{
|
|||
createcategory(){
|
||||
let name="";
|
||||
let category=4;
|
||||
const channelselect=new Fullscreen(
|
||||
const channelselect=new Dialog(
|
||||
["vdiv",
|
||||
["textbox","Name of category","",function(){
|
||||
console.log(this);
|
||||
|
|
|
@ -3,7 +3,7 @@ import {Channel} from "./channel.js";
|
|||
import {Direct} from "./direct.js";
|
||||
import {Voice} from "./audio.js";
|
||||
import {User} from "./user.js";
|
||||
import {Fullscreen} from "./fullscreen.js";
|
||||
import {Dialog} from "./dialog.js";
|
||||
import {getBulkInfo, setTheme, Specialuser} from "./login.js";
|
||||
import { SnowFlake } from "./snowflake.js";
|
||||
import { Message } from "./message.js";
|
||||
|
@ -23,8 +23,8 @@ class Localuser{
|
|||
info:Specialuser["serverurls"];
|
||||
headers:{"Content-type":string,Authorization:string};
|
||||
usersettings:Settings;
|
||||
userConnections:Fullscreen;
|
||||
devPortal:Fullscreen;
|
||||
userConnections:Dialog;
|
||||
devPortal:Dialog;
|
||||
ready:readyjson;
|
||||
guilds:Guild[];
|
||||
guildids:Map<string,Guild>;
|
||||
|
@ -479,7 +479,7 @@ class Localuser{
|
|||
let inviteurl="";
|
||||
const error=document.createElement("span");
|
||||
|
||||
const full=new Fullscreen(["tabs",[
|
||||
const full=new Dialog(["tabs",[
|
||||
["Join using invite",[
|
||||
"vdiv",
|
||||
["textbox",
|
||||
|
@ -523,7 +523,7 @@ class Localuser{
|
|||
const content=document.createElement("div");
|
||||
content.classList.add("guildy");
|
||||
content.textContent="Loading...";
|
||||
const full=new Fullscreen(["html", content]);
|
||||
const full=new Dialog(["html", content]);
|
||||
full.show();
|
||||
|
||||
const res=await fetch(this.info.api+"/discoverable-guilds?limit=50", {
|
||||
|
@ -792,7 +792,7 @@ class Localuser{
|
|||
}
|
||||
let password="";
|
||||
let code="";
|
||||
const addmodel=new Fullscreen(
|
||||
const addmodel=new Dialog(
|
||||
["vdiv",
|
||||
["title","2FA set up"],
|
||||
["text","Copy this secret into your totp(time-based one time password) app"],
|
||||
|
@ -834,7 +834,7 @@ class Localuser{
|
|||
genusersettings():void{
|
||||
const connectionContainer=document.createElement("div");
|
||||
connectionContainer.id="connection-container";
|
||||
this.userConnections=new Fullscreen(
|
||||
this.userConnections=new Dialog(
|
||||
["html",
|
||||
connectionContainer
|
||||
], () => {}, async () => {
|
||||
|
@ -872,7 +872,7 @@ class Localuser{
|
|||
let appName="";
|
||||
const appListContainer=document.createElement("div");
|
||||
appListContainer.id="app-list-container";
|
||||
this.devPortal=new Fullscreen(
|
||||
this.devPortal=new Dialog(
|
||||
["vdiv",
|
||||
["hdiv",
|
||||
["textbox", "Name:", appName, event => {
|
||||
|
@ -940,7 +940,7 @@ class Localuser{
|
|||
const json=await res.json();
|
||||
|
||||
const fields: any={};
|
||||
const appDialog=new Fullscreen(
|
||||
const appDialog=new Dialog(
|
||||
["vdiv",
|
||||
["title",
|
||||
"Editing " + json.name
|
||||
|
@ -1031,7 +1031,7 @@ class Localuser{
|
|||
username: json.bot.username,
|
||||
avatar: json.bot.avatar ? (this.info.cdn+"/app-icons/" + appId + "/" + json.bot.avatar + ".png?size=256") : ""
|
||||
};
|
||||
const botDialog=new Fullscreen(
|
||||
const botDialog=new Dialog(
|
||||
["vdiv",
|
||||
["title",
|
||||
"Editing bot: " + json.bot.username
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { Fullscreen } from "./fullscreen.js";
|
||||
import { Dialog } from "./dialog.js";
|
||||
|
||||
const mobile = /iPhone|iPad|iPod|Android/i.test(navigator.userAgent);
|
||||
export {mobile, getBulkUsers,getBulkInfo,setTheme,Specialuser}
|
||||
|
@ -201,7 +201,7 @@ async function login(username:string, password:string, captcha:string){
|
|||
console.log(response);
|
||||
if(response.ticket){
|
||||
let onetimecode="";
|
||||
new Fullscreen(["vdiv",["title","2FA code:"],["textbox","","",function(){onetimecode=this.value}],["button","","Submit",function(){
|
||||
new Dialog(["vdiv",["title","2FA code:"],["textbox","","",function(){onetimecode=this.value}],["button","","Submit",function(){
|
||||
fetch(api+"/auth/mfa/totp",{
|
||||
method:"POST",
|
||||
headers:{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue