Skip to content

Commit

Permalink
v17.3.9
Browse files Browse the repository at this point in the history
- Improved HLS playback.
- Better control of disk space usage.
- An option has also been added to customize the use of disk space for caching, in Options > Advanced > Developer Options > Enable disk cache.
- Better compatibility with recent versions of Electron.
- Minor bugfixes and improvements.
  • Loading branch information
EdenwareApps committed Jan 28, 2024
1 parent db236ca commit 2140f67
Show file tree
Hide file tree
Showing 40 changed files with 860 additions and 896 deletions.
23 changes: 13 additions & 10 deletions www/nodejs-project/assets/custom-frame/custom-frame.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,9 @@ class CustomFrame {
var iconClose = document.createElement('i');
iconClose.setAttribute('class', options.classes.icons.close);
buttonClose.appendChild(iconClose);
var size = options.win.getSize();
var initialPosX = options.win.x, initialPosY = options.win.y;
var size = options.win.getSize()
var position = options.win.getPosition()
var initialPosX = position[0], initialPosY = position[1]
var initialSizeW = size[0], initialSizeH = size[1];
if (options.customFrameState === 'maximized') {
buttonMaximize.setAttribute('style', buttonMaximize.getAttribute('style') === null ? 'display: none;' : buttonMaximize.getAttribute('style') + 'display: none;');
Expand Down Expand Up @@ -182,8 +183,9 @@ class CustomFrame {
});
options.win.on('close', function () {
if (that.window.localStorage.customFrameState !== 'maximized') {
that.window.localStorage.customFramePosX = options.win.x;
that.window.localStorage.customFramePosY = options.win.y;
const position = options.win.getPosition(), size = options.win.getSize()
that.window.localStorage.customFramePosX = position[0];
that.window.localStorage.customFramePosY = position[1];
that.window.localStorage.customFrameSizeW = size[0];
that.window.localStorage.customFrameSizeH = size[1];
}
Expand All @@ -196,20 +198,21 @@ class CustomFrame {
});
buttonMinimize.addEventListener('click', function () {
options.win.minimize();
});
}, {passive: true});
buttonMaximize.addEventListener('click', function () {
initialPosX = options.win.x;
initialPosY = options.win.y;
const position = options.win.getPosition()
initialPosX = position[0];
initialPosY = position[1];
initialSizeW = size[0];
initialSizeH = size[1];
options.win.maximize();
});
}, {passive: true});
buttonRestore.addEventListener('click', function () {
options.win.restore();
});
}, {passive: true});
buttonClose.addEventListener('click', function () {
options.win.close();
});
}, {passive: true});

this.createElement('link', { href: options.style, rel: 'stylesheet', type: 'text/css' }, null, that.document.head);
this.createElement('link', { href: options.uiIconsTheme, rel: 'stylesheet', type: 'text/css' }, null, that.document.head);
Expand Down
36 changes: 21 additions & 15 deletions www/nodejs-project/assets/js/app/app.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var body = $('body'), content = $('#explorer content'), wrap = document.querySelector('#explorer wrap'), wrapper = $(wrap)
var body = jQuery('body'), content = jQuery('#explorer content'), wrap = document.querySelector('#explorer wrap'), wrapper = jQuery(wrap)

function importMomentLocale(locale, cb){
importMomentLocaleCallback = cb
Expand Down Expand Up @@ -218,7 +218,7 @@ function initApp(){
app.on('background-mode-unlock', name => {
if(parent.player && parent.winman) parent.winman && parent.winman.backgroundModeUnlock(name)
});
$(() => {
jQuery(() => {
console.log('load app')
if(typeof(Explorer) == 'undefined') {
parent.updateWebView()
Expand Down Expand Up @@ -421,7 +421,7 @@ function initApp(){
explorer.reset()
}
}, 100)
}, true)
}, {passive: true})

explorer.on('prompt-start', explorer.reset.bind(explorer))
explorer.on('ask-start', explorer.reset.bind(explorer))
Expand All @@ -446,7 +446,7 @@ function initApp(){
break
}
}
})
}, {passive: true})

langUpdated()
app.emit('init')
Expand Down Expand Up @@ -501,7 +501,7 @@ function initApp(){
haUpdate()
})

var elp = $('.explorer-location-pagination'), elpTxt = elp.find('span'), elpTimer = 0, elpDuration = 5000, elpShown = false
var elp = jQuery('.explorer-location-pagination'), elpTxt = elp.find('span'), elpTimer = 0, elpDuration = 5000, elpShown = false
const elpShow = txt => {
clearTimeout(elpTimer)
if(!elpShown){
Expand All @@ -528,7 +528,7 @@ function initApp(){
explorer.on('focus', elpListener)
explorer.on('render', elpListener)

var haTop = $('#home-arrows-top'), haBottom = $('#home-arrows-bottom')
var haTop = jQuery('#home-arrows-top'), haBottom = jQuery('#home-arrows-bottom')
haTop.on('click', () => explorer.arrow('up'))
haBottom.on('click', () => explorer.arrow('down'))

Expand Down Expand Up @@ -679,15 +679,21 @@ function initApp(){
}
})

var parentRoot = jQuery(parent.document.documentElement)
var energySaver = {
const parentRoot = jQuery(parent.document.documentElement)
const energySaver = {
active: false,
start: () => {
if(energySaver.active || typeof(config) == 'undefined' || !config['timeout-secs-energy-saving']) return
energySaver.active = true
parent.animateBackground('none')
parentRoot.addClass('curtains curtains-alpha').removeClass('curtains-close')
parent.player.closeCurtains(true, false)
},
end: () => {
typeof(config) != 'undefined' && parent.animateBackground(config['animate-background'])
parentRoot.addClass('curtains-close curtains-alpha').removeClass('curtains')
if(!energySaver.active || typeof(config) == 'undefined' || !config['timeout-secs-energy-saving']) return
energySaver.active = false
parent.player.openCurtains(true, true, () => {
typeof(config) != 'undefined' && parent.animateBackground(config['animate-background'])
})
}
}
idle.on('idle', () => {
Expand All @@ -701,7 +707,7 @@ function initApp(){
streamer.active || streamer.isTuning() || energySaver.start()
})
idle.on('active', () => energySaver.end())
streamer.on('show', () => energySaver.start())
streamer.on('show', () => parent.animateBackground('none'))
streamer.on('hide', () => {
idle.reset() // will not call idle.on('active') if not idle, so keep lines below to ensure
energySaver.end()
Expand All @@ -714,13 +720,13 @@ function initApp(){
hs.title = hs.alt = lang.EXIT
hs.addEventListener('click', () => {
parent.winman && parent.winman.askExit()
})
}, {passive: true})

let ha = document.getElementById('header-about')
ha.title = ha.alt = lang.ABOUT
ha.addEventListener('click', () => {
app.emit('about-dialog')
})
}, {passive: true})

ha = hs = undefined

Expand Down Expand Up @@ -756,7 +762,7 @@ function initApp(){
} else {
parent.addEventListener('load', () => {
parent.appChannel.localEmit('frontend')
})
}, {once: true, passive: true})
}
})
}
Expand Down
Loading

0 comments on commit 2140f67

Please sign in to comment.