Skip to content

Commit

Permalink
Merge branch 'master' into disable-image-preview-yakyak#620-feature
Browse files Browse the repository at this point in the history
  • Loading branch information
averissimo committed Jan 25, 2020
2 parents dfe37e0 + 3a3c1c5 commit 8faf1e6
Show file tree
Hide file tree
Showing 8 changed files with 1,239 additions and 743 deletions.
1,934 changes: 1,210 additions & 724 deletions package-lock.json

Large diffs are not rendered by default.

28 changes: 14 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,16 @@
"auto-launch": "^5.0.5",
"autosize": "^4.0.2",
"hangupsjs": "^1.3.8",
"i18n": "^0.8.3",
"mime-types": "^2.1.21",
"moment": "^2.22.2",
"node-notifier": "^5.3.0",
"i18n": "^0.8.4",
"mime-types": "^2.1.26",
"moment": "^2.24.0",
"node-notifier": "^5.4.3",
"notr": "^1.1.2",
"q": "^1.5.1",
"request": "^2.88.0",
"tmp": "0.0.31",
"trifl": "0.0.10",
"uber-url-regex": "^5.0.5"
"uber-url-regex": "^5.0.8"
},
"optionalDependencies": {
"electron-installer-flatpak": "^0.6.0"
Expand All @@ -67,26 +67,26 @@
"chai": "^4.2.0",
"coffee-script": "^1.9.2",
"devtron": "^1.4.0",
"electron": "^4.0.1",
"electron-packager": "^11.2.0",
"gulp": "^4.0.0",
"electron": "^7.1.7",
"electron-packager": "^11.2.1",
"gulp": "^4.0.2",
"gulp-changed": "^3.2.0",
"gulp-coffee": "^3.0.0",
"gulp-coffee": "^3.0.3",
"gulp-concat": "^2.6.0",
"gulp-filter": "^5.1.0",
"gulp-gzip": "^1.4.2",
"gulp-install": "^1.1.0",
"gulp-less": "^4.0.1",
"gulp-livereload": "4.0.1",
"gulp-print": "^5.0.0",
"gulp-print": "^5.0.2",
"gulp-rename": "^1.4.0",
"gulp-sourcemaps": "^2.6.4",
"gulp-spawn": "^0.4.0",
"gulp-sourcemaps": "^2.6.5",
"gulp-spawn": "^0.4.5",
"gulp-util": "^3.0.6",
"gulp-zip": "^4.2.0",
"mocha": "^5.2.0",
"rimraf": "^2.4.2",
"rimraf": "^2.7.1",
"sinon": "^6.0.1",
"sinon-chai": "^3.2.0"
"sinon-chai": "^3.4.0"
}
}
3 changes: 2 additions & 1 deletion src/login.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ module.exports = (mainWindow) -> Q.Promise (rs) ->
if url.indexOf('/o/oauth2/programmatic_auth') > 0
console.log 'login: programmatic auth'
# get the cookie from browser session, it has to be there
session.defaultSession.cookies.get {}, (err, values=[]) ->
session.defaultSession.cookies.get({}).then (err, values=[]) ->
oauth_code = false
for value in values
if value.name is 'oauth_code'
oauth_code = value.value
rs(oauth_code) if oauth_code

# redirect to google oauth
options = {"userAgent": AGENT}
mainWindow.loadURL LOGIN_URL
10 changes: 8 additions & 2 deletions src/main.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ fs = require 'fs'
path = require 'path'
tmp = require 'tmp'
session = require('electron').session

log = require('bog');

[drive, path_parts...] = path.normalize(__dirname).split(path.sep)
global.YAKYAK_ROOT_DIR = [drive, path_parts.map(encodeURIComponent)...].join('/')
Expand Down Expand Up @@ -114,7 +114,7 @@ app.on 'ready', ->
]
Q.all todo.map (t) -> Q.Promise (rs) ->
console.log "resolving proxy #{t.url}"
session.defaultSession.resolveProxy t.url, (proxyURL) ->
session.defaultSession.resolveProxy(t.url).then (proxyURL) ->
console.log "resolved proxy #{proxyURL}"
# Format of proxyURL is either "DIRECT" or "PROXY 127.0.0.1:8888"
[_, purl] = proxyURL.split ' '
Expand All @@ -133,6 +133,11 @@ app.on 'ready', ->
"min-height": 420
icon: path.join __dirname, 'icons', icon_name
show: false
autohideMenuBar: true
webPreferences: {
nodeIntegration: true
# preload: path.join(app.getAppPath(), 'ui', 'app.js')
}
titleBarStyle: 'hiddenInset' if process.platform is 'darwin'
frame: false if process.platform is 'win32'
# autoHideMenuBar : true unless process.platform is 'darwin'
Expand All @@ -143,6 +148,7 @@ app.on 'ready', ->
mainWindow.webContents.openDevTools()
mainWindow.maximize()
mainWindow.show()
log.level('debug');
try
require('devtron').install()
catch
Expand Down
3 changes: 2 additions & 1 deletion src/ui/app.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ ipc.on 'ready-to-show', () ->

# hide menu bar in all platforms but darwin
unless process.platform is 'darwin'
mainWindow.setAutoHideMenuBar(true)
# # Deprecated to BrowserWindow attribute
# mainWindow.setAutoHideMenuBar(true)
mainWindow.setMenuBarVisibility(false)
# handle the visibility of the window
if viewstate.startminimizedtotray
Expand Down
1 change: 1 addition & 0 deletions src/ui/dispatcher.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ handle 'mutesoundnotification', ->
viewstate.setMuteSoundNotification(not viewstate.muteSoundNotification)

handle 'togglemenu', ->
# Deprecated in electron >= 7.0.0
remote.Menu.getApplicationMenu().popup({})

handle 'setescapeclearsinput', (value) ->
Expand Down
2 changes: 1 addition & 1 deletion src/ui/emojishortcode.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ module.exports = {
":couple:": "\ud83d\udc6b",
":two_men_holding_hands:": "\ud83d\udc6c",
":two_women_holding_hands:": "\ud83d\udc6d",
":poop:": "\ud83d\udcaa",
":poop:": "\ud83d\udca9",
":point_left:": "\ud83d\udc48",
":point_right:": "\ud83d\udc49",
":point_up:": "\u261d",
Expand Down
1 change: 1 addition & 0 deletions src/ui/views/menu.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -535,4 +535,5 @@ templateMenu = (viewstate) ->
].filter (n) -> n != undefined

module.exports = (viewstate) ->
# Deprecated in electron >= 7.0.0
Menu.setApplicationMenu Menu.buildFromTemplate templateMenu(viewstate)

0 comments on commit 8faf1e6

Please sign in to comment.