48,609 changes: 48,609 additions & 0 deletions src/dicts/hu.aff

Large diffs are not rendered by default.

88,880 changes: 88,880 additions & 0 deletions src/dicts/hu.dic

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/package.json
@@ -1,8 +1,8 @@
{
"name": "messengerfordesktop",
"productName": "Messenger for Desktop",
"version": "2.0.7",
"versionChannel": "dev",
"version": "2.0.8",
"versionChannel": "beta",
"description": "A simple & beautiful desktop client for Facebook Messenger.",
"wvUrl": "https://www.messenger.com/login",
"wvUrlWork": "https://work.facebook.com/chat",
Expand Down
5 changes: 4 additions & 1 deletion src/scripts/renderer/components/keymap.js
Expand Up @@ -29,7 +29,10 @@ Mousetrap.bind('esc', function () {
const enabled = prefs.get('close-with-esc');
log('close with esc shortcut, enabled:', enabled);
if (enabled) {
remote.getGlobal('application').mainWindowManager.window.close();
const mwm = remote.getGlobal('application').mainWindowManager;
if (mwm) {
mwm.window.close();
}
}
return enabled;
});
33 changes: 15 additions & 18 deletions src/scripts/renderer/preload/events.js
Expand Up @@ -2,23 +2,6 @@ import {webFrame, ipcRenderer, shell} from 'electron';
import {getDictionaryPath} from 'common/utils/spellchecker';
import SpellChecker from 'spellchecker';

// Remove the top banner ad
ipcRenderer.on('remove-top-banner', function (event) {
log('removing top banner ad');

// Strip the HTML
const bannerElems = document.getElementsByClassName('_s15');
for (const bannerElem of bannerElems) {
bannerElem.outerHTML = '';
}

// Fix non-automatic resize
if (bannerElems.length) {
webFrame.setZoomLevel(1);
webFrame.setZoomLevel(0);
}
});

// Show an 'app updated' notification
ipcRenderer.on('notify-app-updated', function (event) {
log('notifying app updated');
Expand All @@ -30,7 +13,7 @@ ipcRenderer.on('notify-app-updated', function (event) {
canReply: false
});

// handle clicks
// Handle clicks
notif.onclick = () => {
setTimeout(() => {
const changelogUrl = global.manifest.changelogUrl
Expand Down Expand Up @@ -78,6 +61,20 @@ ipcRenderer.on('apply-theme', function (event, css) {
styleBlock.innerHTML = css;
});

// Insert the webview css overrides into the DOM
ipcRenderer.on('apply-webview-css', function (event, css) {
let styleBlock = document.getElementById('webviewCss');

if (!styleBlock) {
styleBlock = document.createElement('style');
styleBlock.id = 'webviewCss';
styleBlock.type = 'text/css';
document.head.appendChild(styleBlock);
}

styleBlock.innerHTML = css;
});

// Insert or remove the style required to auto-hide the sidebar
ipcRenderer.on('apply-sidebar-auto-hide', function (event, enabled, css) {
let styleBlock = document.getElementById('sidebarAutoHide');
Expand Down
1 change: 0 additions & 1 deletion src/scripts/renderer/preload/index.js
Expand Up @@ -3,5 +3,4 @@ const initPath = require('path').join(appPath, 'scripts', 'renderer', 'init.js')
require(initPath).inject('webview');

require('renderer/preload/events');
require('renderer/preload/listeners');
require('renderer/preload/notification');
12 changes: 0 additions & 12 deletions src/scripts/renderer/preload/listeners.js

This file was deleted.

54 changes: 42 additions & 12 deletions src/scripts/renderer/webview/listeners.js
Expand Up @@ -32,7 +32,10 @@ webView.addEventListener('page-title-updated', function () {

// clear badge either instantly or after delay
_delayedRemoveBadge = setTimeout(() => {
remote.getGlobal('application').mainWindowManager.notifCountChanged(count, badgeDataUrl);
const mwm = remote.getGlobal('application').mainWindowManager;
if (mwm && typeof mwm.notifCountChanged === 'function') {
mwm.notifCountChanged(count, badgeDataUrl);
}
}, count ? 0 : 1500);
});

Expand Down Expand Up @@ -93,14 +96,20 @@ webView.addEventListener('dom-ready', function () {
}
}

// Restore the sidebar auto-hide setting
const sidebarAutoHide = prefs.get('sidebar-auto-hide');
if (sidebarAutoHide) {
log('restoring sidebar auto-hide', sidebarAutoHide);
files.getStyleCss('auto-hide-sidebar')
.then((css) => webView.send('apply-sidebar-auto-hide', sidebarAutoHide, css))
.catch(logError);
}
// Load webview style overrides
log('restoring webview css override', themeId);
files.getStyleCss('webview')
.then((css) => webView.send('apply-webview-css', css))
.catch(logError);

// TODO: Restore the sidebar auto-hide setting
// const sidebarAutoHide = prefs.get('sidebar-auto-hide');
// if (sidebarAutoHide) {
// log('restoring sidebar auto-hide', sidebarAutoHide);
// files.getStyleCss('auto-hide-sidebar')
// .then((css) => webView.send('apply-sidebar-auto-hide', sidebarAutoHide, css))
// .catch(logError);
// }

// Restore the zoom level
const zoomLevel = prefs.get('zoom-level');
Expand Down Expand Up @@ -129,9 +138,6 @@ webView.addEventListener('dom-ready', function () {
webView.addEventListener('did-finish-load', function () {
log('webview did-finish-load');

// Remove top banner
webView.send('remove-top-banner');

// Hide the loading splash screen
const loadingSplashDiv = document.querySelector('.loader');
loadingSplashDiv.style.opacity = 0;
Expand All @@ -140,11 +146,35 @@ webView.addEventListener('did-finish-load', function () {
}, 250);
});

// Forward context menu opens
webView.addEventListener('context-menu', function (event) {
const paramDefaults = {
isWindows7: platform.isWindows7
};
const params = JSON.stringify(Object.assign(paramDefaults, event.params));
log('sending context menu', params);
const mwm = remote.getGlobal('application').mainWindowManager;
if (mwm) {
mwm.openContextMenu(params);
}
event.preventDefault();
});

// Animate the splash screen into view
document.addEventListener('DOMContentLoaded', function () {
log('document DOMContentLoaded');

// Show the loading splash screen
const loadingSplashDiv = document.querySelector('.loader');
loadingSplashDiv.style.opacity = 1;

// In case did-finish-load isn't called, set a timeout
setTimeout(function () {
loadingSplashDiv.style.opacity = 0;
setTimeout(function () {
loadingSplashDiv.style.display = 'none';
}, 250);
}, 10 * 1000);
});

export default webView;
15 changes: 0 additions & 15 deletions src/styles/app.less
Expand Up @@ -3,18 +3,3 @@ html, body, #wv {
height: 100%;
margin: 0px;
}

/* Remove the 'install mobile app' bar */
._s15 {
display: none;
}

/* Fix the scrollbar bug for some languages */
._kmc {
line-height: 1.29;
}

/* Fix huge website previews */
._3058._15gf {
max-width: 800px;
}
9 changes: 9 additions & 0 deletions src/styles/webview.less
@@ -0,0 +1,9 @@
/* Remove the 'install mobile app' bar */
._s15 {
display: none;
}

/* Fix white border around chat bubbles */
._o46 ._hh7 {
border: 0px !important;
}
2 changes: 1 addition & 1 deletion tasks/pack.coffee
Expand Up @@ -314,7 +314,7 @@ gulp.task 'pack:darwin64:zip', ['build:darwin64'], (done) ->
# Archive the files
(callback) ->
gulp.src './build/linux' + arch + '/opt/' + manifest.name + '/**/*'
.pipe tar(manifest.name + '-' + manifest.version + '-linux' + arch + '.tar.gz')
.pipe tar(manifest.name + '-' + manifest.version + '-linux' + arch + '.tar')
.pipe gzip()
.pipe gulp.dest './dist'
.on 'end', callback
Expand Down