Skip to content

Commit

Permalink
Discord Web App
Browse files Browse the repository at this point in the history
This one requires x-frames ignore extension
  • Loading branch information
344Clinton committed Mar 7, 2019
1 parent a590905 commit 2e87ae6
Show file tree
Hide file tree
Showing 8 changed files with 214 additions and 0 deletions.
1 change: 1 addition & 0 deletions Discord/Discord.apf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"ProjectName":"Discord Web App","Author":"Craig Lindholm","Version":"1.0","Category":"Internet","Description":"This web app will only work if the \"Ignore X-Frame headers\" extension is installed in Chrome based browsers. This is a global extension, and you need to research possible security risks to determine if you want to proceed.\n\nDiscord Web App\n A web application to access the external Discord Social Media site in a Friend Window. A Discord account is required. Go to Discord and create a new account.","Permissions":[],"Files":[{"Filename":"icon.png","Type":"File","MetaType":"File","ID":"81221","Permissions":"","DateModified":"2019-02-24 17:12:18","DateCreated":"2019-02-24 17:12:18","Filesize":"5158","Path":"Resources/icon.png","Shared":"Private","SharedLink":""},{"Filename":"preview.png","Type":"File","MetaType":"File","ID":"81222","Permissions":"","DateModified":"2019-02-24 17:12:20","DateCreated":"2019-02-24 17:12:20","Filesize":"80875","Path":"Resources/preview.png","Shared":"Private","SharedLink":""},{"Filename":"index.html","Type":"File","MetaType":"File","ID":"81219","Permissions":"","DateModified":"2019-02-24 17:12:18","DateCreated":"2019-02-24 17:12:18","Filesize":"189","Path":"Templates/index.html","Shared":"Private","SharedLink":""},{"Filename":"about.html","Type":"File","MetaType":"File","ID":"81220","Permissions":"","DateModified":"2019-02-24 17:12:18","DateCreated":"2019-02-24 17:12:18","Filesize":"606","Path":"Templates/about.html","Shared":"Private","SharedLink":""},{"Filename":"help.html","Type":"File","MetaType":"File","ID":"81224","Permissions":"","DateModified":"2019-02-24 19:18:59","DateCreated":"2019-02-24 17:38:21","Filesize":"845","Path":"Templates/help.html","Shared":"Private","SharedLink":""},{"Filename":"Discord.jsx","Type":"File","MetaType":"File","ID":"82242","Permissions":"","DateModified":"2019-03-07 04:03:15","DateCreated":"2019-03-07 04:03:15","Filesize":"2946","Path":"Discord.jsx","Shared":"Private","SharedLink":""}],"Screenshots":[],"Libraries":[]}
Binary file added Discord/Discord.fpkg
Binary file not shown.
137 changes: 137 additions & 0 deletions Discord/Discord.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
/*©agpl*************************************************************************
* *
* Friend Unifying Platform *
* ------------------------ *
* *
* Copyright 2014-2017 Friend Software Labs AS, all rights reserved. *
* Hillevaagsveien 14, 4016 Stavanger, Norway *
* Tel.: (+47) 40 72 96 56 *
* Mail: info@friendos.com *
* *
*****************************************************************************©*/
/** @file
*
* Friend web-application template
*
* @author FL (Francois Lionet)
* @date first pushed on 12/10/2017
*/

Application.run = function( msg )
{
// Make a new window with some flags
this.mainView = new View(
{
title: 'Discord Web',
width: 1280,
height: 720
} );

// Displays the 'About' option in the menu
this.drawMenu();

// Load the html into the view
var self = this;
var f = new File( 'Progdir:Templates/index.html' );
f.onLoad = function( data )
{
// Set it as window content
self.mainView.setContent( data );
}
f.load();

// On closing the window, quit.
this.mainView.onClose = function()
{
Application.quit();
}
};

// Redraws the main application pulldown menu
Application.drawMenu = function()
{
this.mainView.setMenuItems(
[
{
name: 'File',
items:
[
{
name: i18n( 'About' ),
command: 'about'
},
{
name: i18n( 'Help' ),
command: 'help'
}
]
}
] );
};

// Message handling
Application.receiveMessage = function( msg )
{
switch( msg.command )
{
case 'about':
this.about();
break;
case 'help':
this.help();
break; }
};

// About box
Application.about = function()
{
if( this.aboutWindow )
return;
this.aboutWindow = new View(
{
title: 'About Discord Web',
width: 400,
height: 200
} );
var v = this.aboutWindow;
this.aboutWindow.onClose = function()
{
Application.aboutWindow = false;
}
var f = new File( 'Progdir:Templates/about.html' );
f.i18n();

var self = this;
f.onLoad = function( data )
{
self.aboutWindow.setContent( data );
}
f.load();
};

// Help box
Application.help = function()
{
if( this.helpWindow )
return;
this.helpWindow = new View(
{
title: 'Help with Discord Web',
width: 640,
height: 480
} );
var v = this.helpWindow;
this.helpWindow.onClose = function()
{
Application.helpWindow = false;
}
var f = new File( 'Progdir:Templates/help.html' );
f.i18n();

var self = this;
f.onLoad = function( data )
{
self.helpWindow.setContent( data );
}
f.load();
};
Binary file added Discord/Resources/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Discord/Resources/preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions Discord/Templates/about.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<div class="VContentTop Padding ScrollArea" id="vt">
<p> <strong>Discord Web Access</strong> </p>
<p>
<b>Version</b>: 1.0<br>
<b>Build date</b>: 2019.02.24<br>
<b>Author</b></i>: Craig Lindholm
</p>
<p>

</p>
</div>
<div class="VContentBottom BorderTop BackgroundDefault Padding" id="vb">
<p class="Layout">
<button type="button" class="Button IconSmall fa-close" onclick="Application.sendMessage( { type: 'view', method: 'close' } )">&nbsp;Close</button>
</p>
</div>
<style>
#vt
{
bottom: 50px;
}
#vb
{
height: 50px;
}
</style>
42 changes: 42 additions & 0 deletions Discord/Templates/help.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<style>
ul.a {
list-style-position: outside;
}
</style>

<div class="VContentTop Padding ScrollArea" id="vt">
<p><strong>This web app will only work if the "Ignore X-Frame headers" extension is installed in Chrome based browsers. This is a global extension, and you need to research possible security risks to determine if you want to proceed.</strong></p>
<p>
<strong>Discord Web App</strong>
</p>

<p>
A web application to access the <i>external</i> Discord Social Media site in a Friend Window
<ul class="a">
<li> A Discord account is required. Click <a href="https://discordapp.com/channels/" target="_blank" >here</a> to go to Discord and create a new account.</li>
</ul>
</p>

<p>
<strong>Limitations</strong>
<ul class="a">
<li></li>
</p>
</ul>

</div>
<div class="VContentBottom BorderTop BackgroundDefault Padding" id="vb">
<p class="Layout">
<button type="button" class="Button IconSmall fa-close" onclick="Application.sendMessage( { type: 'view', method: 'close' } )">&nbsp;Close</button>
</p>
</div>
<style>
#vt
{
bottom: 50px;
}
#vb
{
height: 50px;
}
</style>
8 changes: 8 additions & 0 deletions Discord/Templates/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<!––
2019.02.24 Craig Lindholm
-->

<object data="https://discordapp.com/channels/@me" width="100%" height="100%">
<embed src="https://discordapp.com/channels/@me" width="100%" height="100%"> </embed>
Error: Embedded data could not be displayed.
</object>

0 comments on commit 2e87ae6

Please sign in to comment.