/
ProjectSoft
/
radioApp-lite
Обзор
Документация
Войти
/
ProjectSoft
/
radioApp-lite
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/js/require.js
44 строки
1 KB
ProjectSoft
update
07 июн 2024, 08:58
07 июн 2024, 08:58
a9f8883
Код
Авторство
О чём код?
const sdk = (nw.process.versions["nw-flavor"] == "sdk"); // sdk && nw.Window.get().showDevTools(); const gui = require('nw.gui'), full = (nw.App.argv.indexOf('--full') >= 0), win = nw.Window.get(), dir = nw.App.dataPath + "\\radio", dirFile = dir + "\\data.json", fs = require('fs'), fse = require('fs-extra'), ph = require('path'), icy = require('icy'), locale = require(".\\modules\\locale.js"), AudioPlayer = require(".\\modules\\audioplayer.js"), dialog = require(".\\modules\\nwdialog.js"), { StringDecoder } = require('string_decoder'), decoder = new StringDecoder('utf8'), ImpExp = require('.\\modules\\impexp.js'), log = function(){ sdk && console.log(...arguments); }, quitError = function(error){ alert(error); nw.App.quit(); }, scrollTo = function(){ let $el = $('#radio-list > li.active'); if($el.length){ let offsetWrap = $('main > .container > .row').offset(), heightWrap = $('main > .container > .row').height(), offsetEl = $el.offset(), topEl = (offsetEl.top - offsetWrap.top) >= 0, bottomEl = (heightWrap - $el.height()) >= (offsetEl.top - offsetWrap.top); if(!topEl){ $el[0].scrollIntoView(true); }else if(!bottomEl){ $el[0].scrollIntoView(false); } } }, player = new AudioPlayer(document); dialog.context = document; var parser = require(".\\modules\\Parser.js"); fs.writeFileSync(ph.normalize(ph.join(nw.App.dataPath, 'Google Profile.ico')), fs.readFileSync(`.\\favicon.ico`));