Skip to content

Commit 8cc1abc

Browse files
committed
More work
1 parent 5d34e37 commit 8cc1abc

File tree

2 files changed

+1
-217
lines changed

2 files changed

+1
-217
lines changed

beta/emuos/assets/js/emuos.js

Lines changed: 0 additions & 214 deletions
Original file line numberDiff line numberDiff line change
@@ -328,9 +328,6 @@
328328
}
329329

330330
var start = '';
331-
var domains = ['emupedia.net', 'emupedia.org', 'emupedia.games', 'emuos.net', 'emuos.org', 'emuos.games'];
332-
var frontend = ~domains.indexOf(window.location.hostname) ? 'https://emuchat.' + domains[domains.indexOf(window.location.hostname)] + '/' : 'https://emuchat.emupedia.net/';
333-
var chat = null;
334331

335332
if (typeof self.options.start !== 'undefined') {
336333
start = '<ul data-menu-lang="*" data-menu-type="start">';
@@ -518,35 +515,6 @@
518515
}).off('dblclick').on('dblclick', function() {
519516
// noinspection JSUnfilteredForInLoop,JSReferencingMutableVariableFromClosure
520517
if (typeof $(this).data('link') !== 'undefined') {
521-
if ($(this).data('name') === 'EmuChat') {
522-
if (typeof $(this).data('singleinstance') !== 'undefined') {
523-
// noinspection DuplicatedCode
524-
if ($(this).data('singleinstance') && self.$body.find('[id="' + $(this).data('name') + '"]').length === 0) {
525-
// noinspection JSUnfilteredForInLoop,JSReferencingMutableVariableFromClosure
526-
self.iframe({
527-
title: $(this).data('name'),
528-
credits: $(this).data('credits'),
529-
icon: $(this).data('icon'),
530-
src: frontend,
531-
newtab: $(this).data('newtab'),
532-
width: $(this).data('width'),
533-
height: $(this).data('height')
534-
});
535-
}
536-
} else {
537-
// noinspection JSUnfilteredForInLoop,JSReferencingMutableVariableFromClosure
538-
self.iframe({
539-
title: $(this).data('name'),
540-
icon: $(this).data('icon'),
541-
src: frontend,
542-
newtab: $(this).data('newtab'),
543-
width: $(this).data('width'),
544-
height: $(this).data('height'),
545-
credits: $(this).data('credits')
546-
});
547-
}
548-
}
549-
550518
if (typeof ga === 'function') {
551519
ga('send', {
552520
hitType: 'pageview',
@@ -709,17 +677,7 @@
709677
toggleFullscreen: true,
710678
networkMonitor: true,
711679
clock: true,
712-
buttons: {
713-
chat: {
714-
label: 'Chat',
715-
text: false,
716-
icons: {
717-
primary: 'ui-icon-comment'
718-
}
719-
}
720-
},
721680
systemButtonsOrder: [
722-
'chat',
723681
'languageSelect',
724682
'networkMonitor',
725683
'toggleFullscreen',
@@ -970,51 +928,6 @@
970928
}
971929
}
972930

973-
self.$window.one('keydown', function (e) {
974-
// noinspection JSRedundantSwitchStatement
975-
switch (e.keyCode) {
976-
case 192:
977-
if (!chat) {
978-
// noinspection HtmlDeprecatedAttribute,HtmlUnknownTarget
979-
chat = self.widget({
980-
title: 'Chat',
981-
hidden: true,
982-
width: 640,
983-
height: 350,
984-
right: '0px',
985-
bottom: '28px',
986-
content: '<iframe id="Chat" width="100%" height="100%" src="' + frontend + '" frameborder="0" allowTransparency="true" allow="autoplay; fullscreen; accelerometer; gyroscope; geolocation; microphone; camera; midi; encrypted-media; clipboard-read; clipboard-write" sandbox="allow-forms allow-downloads allow-modals allow-pointer-lock allow-popups allow-popups-to-escape-sandbox allow-presentation allow-same-origin allow-scripts allow-top-navigation-by-user-activation"></iframe>'
987-
});
988-
989-
chat.find('iframe').one('load', function() {
990-
chat.slideDown(300);
991-
});
992-
993-
e.preventDefault();
994-
return false;
995-
}
996-
}
997-
});
998-
999-
self.$taskbar.taskbar('option', 'buttons.chat').$element.one('click', function() {
1000-
if (!chat) {
1001-
// noinspection HtmlDeprecatedAttribute,HtmlUnknownTarget
1002-
chat = self.widget({
1003-
title: 'Chat',
1004-
hidden: true,
1005-
width: 640,
1006-
height: 350,
1007-
right: '0px',
1008-
bottom: '28px',
1009-
content: '<iframe id="Chat" width="100%" height="100%" src="' + frontend + '" frameborder="0" allowTransparency="true" allow="autoplay; fullscreen; accelerometer; gyroscope; geolocation; microphone; camera; midi; encrypted-media; clipboard-read; clipboard-write" sandbox="allow-forms allow-downloads allow-modals allow-pointer-lock allow-popups allow-popups-to-escape-sandbox allow-presentation allow-same-origin allow-scripts allow-top-navigation-by-user-activation"></iframe>'
1010-
});
1011-
1012-
chat.find('iframe').one('load', function() {
1013-
chat.slideDown(300);
1014-
});
1015-
}
1016-
});
1017-
1018931
self.$html.contextmenu({
1019932
delegate: '.emuos-desktop, .emuos-taskbar',
1020933
menu: [{
@@ -1212,100 +1125,6 @@
12121125
self.$body.append(widget);
12131126
self.$taskbar = $('.taskbar').first();
12141127

1215-
widget.find('iframe').off('load').on('load', function() {
1216-
if (title === 'Chat') {
1217-
var net = {};
1218-
1219-
net.badge = 0;
1220-
1221-
net.show = function() {
1222-
if (typeof window['NETWORK_CONNECTION'] !== 'undefined') {
1223-
if (typeof window['NETWORK_CONNECTION']['socket'] !== 'undefined') {
1224-
// noinspection JSUnresolvedVariable
1225-
if (typeof window['NETWORK_CONNECTION']['socket']['emit_event'] === 'function') {
1226-
// noinspection JSUnresolvedFunction
1227-
window['NETWORK_CONNECTION']['socket']['emit_event']('chat.show', {});
1228-
}
1229-
}
1230-
}
1231-
1232-
widget.slideDown(300);
1233-
net.badge = 0;
1234-
var $icon = self.$body.find('.emuos-desktop-icon span:contains("EmuChat")').siblings('i.icon').first();
1235-
$icon.attr('class', 'icon badge');
1236-
};
1237-
1238-
net.hide = function() {
1239-
if (typeof window['NETWORK_CONNECTION'] !== 'undefined') {
1240-
if (typeof window['NETWORK_CONNECTION']['socket'] !== 'undefined') {
1241-
// noinspection JSUnresolvedVariable
1242-
if (typeof window['NETWORK_CONNECTION']['socket']['emit_event'] === 'function') {
1243-
// noinspection JSUnresolvedFunction
1244-
window['NETWORK_CONNECTION']['socket']['emit_event']('chat.hide', {});
1245-
}
1246-
}
1247-
}
1248-
1249-
widget.slideUp(300);
1250-
};
1251-
1252-
net.toggle = function() {
1253-
if (widget.is(':hidden')) {
1254-
net.badge = 0;
1255-
var $icon = self.$body.find('.emuos-desktop-icon span:contains("EmuChat")').siblings('i.icon').first();
1256-
$icon.attr('class', 'icon badge');
1257-
1258-
if (typeof window['NETWORK_CONNECTION'] !== 'undefined') {
1259-
if (typeof window['NETWORK_CONNECTION']['socket'] !== 'undefined') {
1260-
// noinspection JSUnresolvedVariable
1261-
if (typeof window['NETWORK_CONNECTION']['socket']['emit_event'] === 'function') {
1262-
// noinspection JSUnresolvedFunction
1263-
window['NETWORK_CONNECTION']['socket']['emit_event']('chat.show', {});
1264-
}
1265-
}
1266-
}
1267-
} else {
1268-
if (typeof window['NETWORK_CONNECTION'] !== 'undefined') {
1269-
if (typeof window['NETWORK_CONNECTION']['socket'] !== 'undefined') {
1270-
// noinspection JSUnresolvedVariable
1271-
if (typeof window['NETWORK_CONNECTION']['socket']['emit_event'] === 'function') {
1272-
// noinspection JSUnresolvedFunction
1273-
window['NETWORK_CONNECTION']['socket']['emit_event']('chat.hide', {});
1274-
}
1275-
}
1276-
}
1277-
}
1278-
1279-
widget.slideToggle(300);
1280-
};
1281-
1282-
self.$taskbar.taskbar('option', 'buttons.chat').$element.off('click').on('click', function() {
1283-
net.toggle();
1284-
});
1285-
1286-
self.$window.off('keydown').on('keydown', function (e) {
1287-
// noinspection JSRedundantSwitchStatement
1288-
switch (e.keyCode) {
1289-
case 192:
1290-
net.toggle();
1291-
e.preventDefault();
1292-
return false;
1293-
}
1294-
});
1295-
1296-
var $icon = self.$body.find('.emuos-desktop-icon span:contains("EmuChat")').siblings('i.icon').first();
1297-
$icon.attr('class', 'icon badge');
1298-
1299-
if (typeof window['NETWORK_CONNECTION'] !== 'undefined') {
1300-
// noinspection JSUnresolvedVariable
1301-
if (typeof window['NETWORK_CONNECTION'].register_iframe === 'function') {
1302-
// noinspection JSUnresolvedVariable,JSUnresolvedFunction
1303-
window['NETWORK_CONNECTION'].register_iframe(title);
1304-
}
1305-
}
1306-
}
1307-
});
1308-
13091128
return widget;
13101129
};
13111130

@@ -1402,39 +1221,6 @@
14021221

14031222
self.$body.append(win);
14041223

1405-
win.find('iframe').off('load').on('load', function() {
1406-
var $el = $(this);
1407-
1408-
if (title === 'EmuChat') {
1409-
var net = window['NETWORK_CONNECTION'];
1410-
1411-
if (typeof net !== 'undefined') {
1412-
// noinspection JSUnresolvedVariable
1413-
if (typeof net.register_iframe === 'function') {
1414-
// noinspection JSUnresolvedFunction
1415-
net.register_iframe(title);
1416-
net.badge = 0;
1417-
var $icon = self.$body.find('.emuos-desktop-icon span:contains("EmuChat")').siblings('i.icon').first();
1418-
$icon.attr('class', 'icon badge');
1419-
}
1420-
}
1421-
}
1422-
1423-
$el.focus();
1424-
$el.get(0).focus();
1425-
$el.get(0).contentWindow.focus();
1426-
1427-
if (typeof window['NETWORK_CONNECTION'] !== 'undefined') {
1428-
if (typeof window['NETWORK_CONNECTION']['socket'] !== 'undefined') {
1429-
// noinspection JSUnresolvedVariable
1430-
if (typeof window['NETWORK_CONNECTION']['socket']['emit_event'] === 'function') {
1431-
// noinspection JSUnresolvedFunction
1432-
window['NETWORK_CONNECTION']['socket']['emit_event']('chat.show', {});
1433-
}
1434-
}
1435-
}
1436-
});
1437-
14381224
// noinspection JSValidateTypes
14391225
win.window({
14401226
help: credits,

beta/emuos/assets/js/main.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,9 @@
142142
'jquery',
143143
'json!../data/desktop.json',
144144
'filesystem',
145-
'network',
146145
'emuos',
147146
'optional!ga'
148-
], function($, desktop, FileSystem, Network, EmuOS, ga) {
147+
], function($, desktop, FileSystem, EmuOS, ga) {
149148
$(function() {
150149
if (typeof ga === 'function') {
151150
ga('send', {
@@ -158,7 +157,6 @@
158157
// noinspection JSUnusedLocalSymbols
159158
new EmuOS({
160159
filesystem: FileSystem,
161-
network: Network,
162160
theme: 'theme-windows-me',
163161
icons: desktop.icons
164162
});

0 commit comments

Comments
 (0)