From bba85af0e32402d257152abb14d98eddbae8b2fa Mon Sep 17 00:00:00 2001 From: AlexeyMatveev686 Date: Fri, 14 Apr 2023 17:19:28 +0300 Subject: [PATCH 01/19] test --- store/scripts/code.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/store/scripts/code.js b/store/scripts/code.js index 280c7f91..b27ea21f 100644 --- a/store/scripts/code.js +++ b/store/scripts/code.js @@ -45,6 +45,8 @@ let isFrameLoading = true; // flag win let translate = {'Loading': 'Loading'}; // translations for current language (thouse will necessary if we don't get tranlation file) let timeout = null; // delay for loader let defaultBG = themeType == 'light' ? "#F5F5F5" : '#555555'; // default background color for plugin header +const type = getUrlSearchValue('type'); // if we have type, the we work in appdirectory +console.log('type', type); let isResizeOnStart = true; // flag for firs resize on start const supportedScaleValues = [1, 1.25, 1.5, 1.75, 2]; // supported scale let scale = { // current scale From e00a0fd596fb6f571672139263dbe21c744a7f46 Mon Sep 17 00:00:00 2001 From: AlexeyMatveev686 Date: Fri, 14 Apr 2023 17:26:10 +0300 Subject: [PATCH 02/19] . --- store/scripts/code.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/store/scripts/code.js b/store/scripts/code.js index b27ea21f..9ccf5cff 100644 --- a/store/scripts/code.js +++ b/store/scripts/code.js @@ -46,7 +46,7 @@ let translate = {'Loading': 'Loading'}; // translat let timeout = null; // delay for loader let defaultBG = themeType == 'light' ? "#F5F5F5" : '#555555'; // default background color for plugin header const type = getUrlSearchValue('type'); // if we have type, the we work in appdirectory -console.log('type', type); +if (type.length) getAllPluginsData(true, false); let isResizeOnStart = true; // flag for firs resize on start const supportedScaleValues = [1, 1.25, 1.5, 1.75, 2]; // supported scale let scale = { // current scale From d8a4b784668cee4493f10345ff717f8d466ebdf4 Mon Sep 17 00:00:00 2001 From: AlexeyMatveev686 Date: Fri, 14 Apr 2023 17:29:47 +0300 Subject: [PATCH 03/19] 1 --- store/scripts/code.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/store/scripts/code.js b/store/scripts/code.js index 9ccf5cff..3deada1e 100644 --- a/store/scripts/code.js +++ b/store/scripts/code.js @@ -45,8 +45,6 @@ let isFrameLoading = true; // flag win let translate = {'Loading': 'Loading'}; // translations for current language (thouse will necessary if we don't get tranlation file) let timeout = null; // delay for loader let defaultBG = themeType == 'light' ? "#F5F5F5" : '#555555'; // default background color for plugin header -const type = getUrlSearchValue('type'); // if we have type, the we work in appdirectory -if (type.length) getAllPluginsData(true, false); let isResizeOnStart = true; // flag for firs resize on start const supportedScaleValues = [1, 1.25, 1.5, 1.75, 2]; // supported scale let scale = { // current scale @@ -106,6 +104,8 @@ window.Asc = { const pos = location.href.indexOf('store/index.html'); const ioUrl = location.href.substring(0, pos); +const type = getUrlSearchValue('type'); // if we have type, the we work in appdirectory +if (type.length) getAllPluginsData(true, false); // get translation file getTranslation(); From fb4f35e281ec9c2ed23fdf28a2e4e11d3571621d Mon Sep 17 00:00:00 2001 From: AlexeyMatveev686 Date: Fri, 14 Apr 2023 17:34:26 +0300 Subject: [PATCH 04/19] =?UTF-8?q?=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- store/scripts/code.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/store/scripts/code.js b/store/scripts/code.js index 3deada1e..88dec364 100644 --- a/store/scripts/code.js +++ b/store/scripts/code.js @@ -105,7 +105,7 @@ window.Asc = { const pos = location.href.indexOf('store/index.html'); const ioUrl = location.href.substring(0, pos); const type = getUrlSearchValue('type'); // if we have type, the we work in appdirectory -if (type.length) getAllPluginsData(true, false); +if (type.length) fetchAllPlugins(true, false); // get translation file getTranslation(); From ca8d5c3b9655bf90d30392570ba430f4e79ed83e Mon Sep 17 00:00:00 2001 From: AlexeyMatveev686 Date: Fri, 14 Apr 2023 17:41:19 +0300 Subject: [PATCH 05/19] a --- store/scripts/code.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/store/scripts/code.js b/store/scripts/code.js index 88dec364..54bbc1a5 100644 --- a/store/scripts/code.js +++ b/store/scripts/code.js @@ -104,8 +104,7 @@ window.Asc = { const pos = location.href.indexOf('store/index.html'); const ioUrl = location.href.substring(0, pos); -const type = getUrlSearchValue('type'); // if we have type, the we work in appdirectory -if (type.length) fetchAllPlugins(true, false); +const bAppDirectory = getUrlSearchValue('type').length !== 0; // if we have type, the we work in appdirectory // get translation file getTranslation(); @@ -370,7 +369,7 @@ function fetchAllPlugins(bFirstRender, bConnectionRestored) { makeRequest(configUrl).then( function(response) { allPlugins = JSON.parse(response); - if (installedPlugins) + if (installedPlugins || bAppDirectory) getAllPluginsData(bFirstRender, bConnectionRestored); }, function(err) { @@ -1111,7 +1110,7 @@ function onTranslate() { function showMarketplace() { // show main window to user - if (!isPluginLoading && !isTranslationLoading && !isFrameLoading && installedPlugins) { + if (!isPluginLoading && !isTranslationLoading && !isFrameLoading && (installedPlugins || bAppDirectory)) { createSelect(); if (isOnline) showListofPlugins(isOnline); From c171a0c690f00092ee5d13abd3724eef67a004a0 Mon Sep 17 00:00:00 2001 From: AlexeyMatveev686 Date: Fri, 14 Apr 2023 17:46:03 +0300 Subject: [PATCH 06/19] s --- store/scripts/code.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/store/scripts/code.js b/store/scripts/code.js index 54bbc1a5..3dd1f92c 100644 --- a/store/scripts/code.js +++ b/store/scripts/code.js @@ -1418,7 +1418,7 @@ function removeUnloaded(unloaded) { }; function findPlugin(bAll, guid) { - let res = bAll + let res = bAll || bAppDirectory ? allPlugins.find(function(el){return el.guid === guid}) : installedPlugins.find(function(el){return el.guid === guid}); return res; From 265fb53d94a358cd09bebd4eead197bd6687ddda Mon Sep 17 00:00:00 2001 From: AlexeyMatveev686 Date: Fri, 14 Apr 2023 17:53:31 +0300 Subject: [PATCH 07/19] d --- store/scripts/code.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/store/scripts/code.js b/store/scripts/code.js index 3dd1f92c..f12d4f46 100644 --- a/store/scripts/code.js +++ b/store/scripts/code.js @@ -628,6 +628,7 @@ function showListofPlugins(bAll, sortedArr) { function createPluginDiv(plugin, bInstalled) { // this function creates div (preview) for plugins + if(bAppDirectory) bInstalled = false; let div = document.createElement('div'); div.id = plugin.guid; div.setAttribute('data-guid', plugin.guid); @@ -787,7 +788,7 @@ function onClickItem() { divPreview.id = 'div_preview'; divPreview.className = 'div_preview'; - let installed = findPlugin(false, guid); + let installed = bAppDirectory ? null : findPlugin(false, guid); let plugin = findPlugin(true, guid); if ( !plugin || ( isDesktop && installed ) ) { elements.divGitLink.classList.add('hidden'); @@ -1418,7 +1419,8 @@ function removeUnloaded(unloaded) { }; function findPlugin(bAll, guid) { - let res = bAll || bAppDirectory + // todo поправить везде где есть поиск, чтобы поиск запускался, если только есть такая группа плагинов + let res = bAll ? allPlugins.find(function(el){return el.guid === guid}) : installedPlugins.find(function(el){return el.guid === guid}); return res; From 513571fc7f718a8dcee7b74a58f3d1fe71b68dbb Mon Sep 17 00:00:00 2001 From: AlexeyMatveev686 Date: Fri, 14 Apr 2023 17:59:33 +0300 Subject: [PATCH 08/19] =?UTF-8?q?=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- store/scripts/code.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/store/scripts/code.js b/store/scripts/code.js index f12d4f46..b7adb301 100644 --- a/store/scripts/code.js +++ b/store/scripts/code.js @@ -628,7 +628,6 @@ function showListofPlugins(bAll, sortedArr) { function createPluginDiv(plugin, bInstalled) { // this function creates div (preview) for plugins - if(bAppDirectory) bInstalled = false; let div = document.createElement('div'); div.id = plugin.guid; div.setAttribute('data-guid', plugin.guid); @@ -645,8 +644,9 @@ function createPluginDiv(plugin, bInstalled) { div.onclick = onClickItem; - let installed = bInstalled ? plugin : findPlugin(false, plugin.guid); - if (bInstalled) { + // todo поправить + let installed = bAppDirectory ? null : bInstalled ? plugin : findPlugin(false, plugin.guid); + if (bInstalled || bAppDirectory) { plugin = findPlugin(true, plugin.guid); } From ea97fb335b87cf206d571e030f4b61bb5ccafbb2 Mon Sep 17 00:00:00 2001 From: AlexeyMatveev686 Date: Fri, 14 Apr 2023 18:03:58 +0300 Subject: [PATCH 09/19] =?UTF-8?q?=D1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- store/scripts/code.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/store/scripts/code.js b/store/scripts/code.js index b7adb301..f23c45d7 100644 --- a/store/scripts/code.js +++ b/store/scripts/code.js @@ -143,7 +143,7 @@ window.onload = function() { toogleView(event.target, elements.btnMyPlugins, messages.linkPR, true, false); }; - // elements.arrow.onclick = onClickBack; + elements.arrow.onclick = onClickBack; // elements.imgScreenshot.onclick = onClickScreenshot; elements.arrowPrev.onclick = function(event) { @@ -440,7 +440,7 @@ function initElemnts() { elements.linkNewPlugin = document.getElementById('link_newPlugin'); elements.divBody = document.getElementById('div_body'); elements.divMain = document.getElementById('div_main'); - // elements.arrow = document.getElementById('arrow'); + elements.arrow = document.getElementById('arrow'); // elements.close = document.getElementById('close'); elements.divHeader = document.getElementById('div_header'); elements.divSelected = document.getElementById('div_selected_toolbar'); @@ -885,7 +885,7 @@ function onClickItem() { elements.divSelectedMain.classList.remove('hidden'); elements.divBody.classList.add('hidden'); sendMessage( { type : "showButton" } ); - // elements.arrow.classList.remove('hidden'); + elements.arrow.classList.remove('hidden'); }; function onClickBack() { @@ -900,7 +900,7 @@ function onClickBack() { current.index = 0; current.screenshots = []; current.url = ''; - // elements.arrow.classList.add('hidden'); + elements.arrow.classList.add('hidden'); if(Ps) Ps.update(); }; From 94ee1d5ef9d3d5dc570a94dbfc2d67612c0b8e4b Mon Sep 17 00:00:00 2001 From: AlexeyMatveev686 Date: Fri, 14 Apr 2023 18:05:31 +0300 Subject: [PATCH 10/19] e --- store/scripts/code.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/store/scripts/code.js b/store/scripts/code.js index f23c45d7..4af72cb3 100644 --- a/store/scripts/code.js +++ b/store/scripts/code.js @@ -1112,6 +1112,8 @@ function onTranslate() { function showMarketplace() { // show main window to user if (!isPluginLoading && !isTranslationLoading && !isFrameLoading && (installedPlugins || bAppDirectory)) { + if(bAppDirectory) + installedPlugins = []; createSelect(); if (isOnline) showListofPlugins(isOnline); From e96d24d7529952afe56624e69a72c3ef8cf9a715 Mon Sep 17 00:00:00 2001 From: AlexeyMatveev686 Date: Fri, 14 Apr 2023 18:13:39 +0300 Subject: [PATCH 11/19] t --- store/scripts/code.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/store/scripts/code.js b/store/scripts/code.js index 4af72cb3..28fe4481 100644 --- a/store/scripts/code.js +++ b/store/scripts/code.js @@ -1112,8 +1112,10 @@ function onTranslate() { function showMarketplace() { // show main window to user if (!isPluginLoading && !isTranslationLoading && !isFrameLoading && (installedPlugins || bAppDirectory)) { - if(bAppDirectory) + if(bAppDirectory) { installedPlugins = []; + document.getElementsByClassName('toolbar_top')[0].classList.add('hidden'); + } createSelect(); if (isOnline) showListofPlugins(isOnline); From e7ff1b4a52bc9f04e3baf1a3b35522d15dbbfdb8 Mon Sep 17 00:00:00 2001 From: AlexeyMatveev686 Date: Mon, 17 Apr 2023 14:00:00 +0300 Subject: [PATCH 12/19] Fix bug #62125 --- store/scripts/code.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/store/scripts/code.js b/store/scripts/code.js index 6fcf10d2..dc3d9c25 100644 --- a/store/scripts/code.js +++ b/store/scripts/code.js @@ -361,7 +361,7 @@ window.addEventListener('message', function(message) { }; }, false); -function fetchAllPlugins(bFirstRender, bConnectionRestored) { +function fetchAllPlugins(bFirstRender, bshowMarketplace) { // function for fetching all plugins from config clearInterval(interval); interval = null; @@ -370,7 +370,7 @@ function fetchAllPlugins(bFirstRender, bConnectionRestored) { function(response) { allPlugins = JSON.parse(response); if (installedPlugins) - getAllPluginsData(bFirstRender, bConnectionRestored); + getAllPluginsData(bFirstRender, bshowMarketplace); }, function(err) { createError( new Error( getTranslated( 'Problem with loading markeplace config.' ) ) ); @@ -483,7 +483,7 @@ function toogleLoader(show, text) { } }; -function getAllPluginsData(bFirstRender, bConnectionRestored) { +function getAllPluginsData(bFirstRender, bshowMarketplace) { // get config file for each item in config.json isPluginLoading = true; let count = 0; @@ -507,7 +507,7 @@ function getAllPluginsData(bFirstRender, bConnectionRestored) { isPluginLoading = false; if (bFirstRender) showMarketplace(); - else if (bConnectionRestored) + else if (bshowMarketplace) toogleView(elements.btnMarketplace, elements.btnMyPlugins, messages.linkPR, true, true); } makeRequest(pluginUrl + 'translations/langs.json').then( @@ -540,7 +540,7 @@ function getAllPluginsData(bFirstRender, bConnectionRestored) { isPluginLoading = false; if (bFirstRender) showMarketplace(); - else if (bConnectionRestored) + else if (bshowMarketplace) toogleView(elements.btnMarketplace, elements.btnMyPlugins, messages.linkPR, true, true); } } @@ -1488,7 +1488,8 @@ function checkInternet() { if (this.readyState == 4) { if (this.status >= 200 && this.status < 300) { isOnline = true; - fetchAllPlugins(interval === null, elements.btnMarketplace.classList.contains('btn_toolbar_active')); + let bshowMarketplace = ( elements.btnMarketplace && elements.btnMarketplace.classList.contains('btn_toolbar_active') ) ? true : false; + fetchAllPlugins(interval === null, bshowMarketplace); } } }; From 19b89726cac6a8efe9af16cb3b574a916942348f Mon Sep 17 00:00:00 2001 From: AlexeyMatveev686 Date: Mon, 17 Apr 2023 14:17:09 +0300 Subject: [PATCH 13/19] [marketplace] Fix problem with plugins images. --- store/scripts/code.js | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/store/scripts/code.js b/store/scripts/code.js index dc3d9c25..21ae05f4 100644 --- a/store/scripts/code.js +++ b/store/scripts/code.js @@ -1184,24 +1184,17 @@ function getImageUrl(guid, bNotForStore, bSetSize, id) { // In desktop we have a local installed marketplace. It's why we use local routes only for desktop. let baseUrl; - if (installedPlugins) { + if (installedPlugins && isDesktop) { + // it doesn't work when we use icons from other resource (cors problems) + // it's why we use local icons only for desktop plugin = findPlugin(false, guid); if (plugin) { - let start; - if (isDesktop) { - baseUrl = plugin.obj.baseUrl; - } else { - baseUrl = plugin.baseUrl; - start = baseUrl.indexOf('web-apps'); - baseUrl = baseUrl.substring(0, start); - start = plugin.obj.baseUrl.indexOf('sdkjs-plugins'); - baseUrl += plugin.obj.baseUrl.substring(start); - } plugin = plugin.obj; + baseUrl = plugin.baseUrl; } } - if ( ( !plugin || ( !baseUrl.includes('https://') && !isDesktop ) ) && allPlugins) { + if ( ( !plugin || !isDesktop ) && allPlugins) { plugin = findPlugin(true, guid); if (plugin) baseUrl = plugin.baseUrl; From 55cea0c81336e7f886c9b6fff7e4f990e2e32705 Mon Sep 17 00:00:00 2001 From: AlexeyMatveev686 Date: Mon, 17 Apr 2023 14:59:36 +0300 Subject: [PATCH 14/19] [marketpalce] Fix problem with removing plugins in web. --- store/scripts/code.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/store/scripts/code.js b/store/scripts/code.js index 21ae05f4..d3b233d9 100644 --- a/store/scripts/code.js +++ b/store/scripts/code.js @@ -284,7 +284,7 @@ window.addEventListener('message', function(message) { if (installed) { bHasLocal = !installed.obj.baseUrl.includes(ioUrl); - if (plugin && (!bHasLocal || !needBackup) ) { + if (plugin && ( isDesktop && (!bHasLocal || !needBackup) ) ) { installedPlugins = installedPlugins.filter(function(el){return el.guid !== message.guid}); bUpdate = true; } else { From 26ef5f1f3ef3144ec13b878dd794c49984c8c644 Mon Sep 17 00:00:00 2001 From: AlexeyMatveev686 Date: Mon, 17 Apr 2023 15:09:39 +0300 Subject: [PATCH 15/19] . --- store/scripts/code.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/store/scripts/code.js b/store/scripts/code.js index d3b233d9..ed8ce532 100644 --- a/store/scripts/code.js +++ b/store/scripts/code.js @@ -284,7 +284,7 @@ window.addEventListener('message', function(message) { if (installed) { bHasLocal = !installed.obj.baseUrl.includes(ioUrl); - if (plugin && ( isDesktop && (!bHasLocal || !needBackup) ) ) { + if (plugin && (!bHasLocal || (isDesktop && !needBackup) ) ) { installedPlugins = installedPlugins.filter(function(el){return el.guid !== message.guid}); bUpdate = true; } else { From 8d150ccdbf3e5091273e2ea0cd9100f58a4dc137 Mon Sep 17 00:00:00 2001 From: AlexeyMatveev686 Date: Mon, 17 Apr 2023 15:17:14 +0300 Subject: [PATCH 16/19] [marketpalce] Change render after removing plugins. --- store/scripts/code.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/store/scripts/code.js b/store/scripts/code.js index ed8ce532..dfd226eb 100644 --- a/store/scripts/code.js +++ b/store/scripts/code.js @@ -303,7 +303,8 @@ window.addEventListener('message', function(message) { if (searchVal !== '') makeSearch(searchVal.toLowerCase()); else - showListofPlugins(false); + this.document.getElementById(guid).remove(); + // showListofPlugins(false); } else { changeAfterInstallOrRemove(false, message.guid, bHasLocal); } From b7907776ba963cd2fcc517e14e0bc6b0c8eab42d Mon Sep 17 00:00:00 2001 From: AlexeyMatveev686 Date: Mon, 17 Apr 2023 15:20:49 +0300 Subject: [PATCH 17/19] . --- store/scripts/code.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/store/scripts/code.js b/store/scripts/code.js index dfd226eb..517353b6 100644 --- a/store/scripts/code.js +++ b/store/scripts/code.js @@ -303,7 +303,7 @@ window.addEventListener('message', function(message) { if (searchVal !== '') makeSearch(searchVal.toLowerCase()); else - this.document.getElementById(guid).remove(); + this.document.getElementById(message.guid).remove(); // showListofPlugins(false); } else { changeAfterInstallOrRemove(false, message.guid, bHasLocal); From f913de475d7ad22daf4632253c3e2c59afa667a6 Mon Sep 17 00:00:00 2001 From: AlexeyMatveev686 Date: Mon, 17 Apr 2023 15:34:13 +0300 Subject: [PATCH 18/19] [marketpalce] Remove comment from code. --- store/scripts/code.js | 1 - 1 file changed, 1 deletion(-) diff --git a/store/scripts/code.js b/store/scripts/code.js index 517353b6..3c387eda 100644 --- a/store/scripts/code.js +++ b/store/scripts/code.js @@ -304,7 +304,6 @@ window.addEventListener('message', function(message) { makeSearch(searchVal.toLowerCase()); else this.document.getElementById(message.guid).remove(); - // showListofPlugins(false); } else { changeAfterInstallOrRemove(false, message.guid, bHasLocal); } From 7642b5037ee91bff2fdf50b21c308732f7b23454 Mon Sep 17 00:00:00 2001 From: AlexeyMatveev686 Date: Mon, 17 Apr 2023 17:07:45 +0300 Subject: [PATCH 19/19] Reverse previous commit. --- store/scripts/code.js | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/store/scripts/code.js b/store/scripts/code.js index 97d805bf..3c387eda 100644 --- a/store/scripts/code.js +++ b/store/scripts/code.js @@ -104,7 +104,6 @@ window.Asc = { const pos = location.href.indexOf('store/index.html'); const ioUrl = location.href.substring(0, pos); -const bAppDirectory = getUrlSearchValue('type').length !== 0; // if we have type, the we work in appdirectory // get translation file getTranslation(); @@ -143,7 +142,7 @@ window.onload = function() { toogleView(event.target, elements.btnMyPlugins, messages.linkPR, true, false); }; - elements.arrow.onclick = onClickBack; + // elements.arrow.onclick = onClickBack; // elements.imgScreenshot.onclick = onClickScreenshot; elements.arrowPrev.onclick = function(event) { @@ -370,7 +369,7 @@ function fetchAllPlugins(bFirstRender, bshowMarketplace) { makeRequest(configUrl).then( function(response) { allPlugins = JSON.parse(response); - if (installedPlugins || bAppDirectory) + if (installedPlugins) getAllPluginsData(bFirstRender, bshowMarketplace); }, function(err) { @@ -441,7 +440,7 @@ function initElemnts() { elements.linkNewPlugin = document.getElementById('link_newPlugin'); elements.divBody = document.getElementById('div_body'); elements.divMain = document.getElementById('div_main'); - elements.arrow = document.getElementById('arrow'); + // elements.arrow = document.getElementById('arrow'); // elements.close = document.getElementById('close'); elements.divHeader = document.getElementById('div_header'); elements.divSelected = document.getElementById('div_selected_toolbar'); @@ -664,10 +663,8 @@ function createPluginDiv(plugin, bInstalled) { div.onclick = onClickItem; - // todo поправить - let installed = - ? null : bInstalled ? plugin : findPlugin(false, plugin.guid); - if (bInstalled || bAppDirectory) { + let installed = bInstalled ? plugin : findPlugin(false, plugin.guid); + if (bInstalled) { plugin = findPlugin(true, plugin.guid); } @@ -809,7 +806,7 @@ function onClickItem() { divPreview.id = 'div_preview'; divPreview.className = 'div_preview'; - let installed = bAppDirectory ? null : findPlugin(false, guid); + let installed = findPlugin(false, guid); let plugin = findPlugin(true, guid); if ( !plugin || ( isDesktop && installed ) ) { elements.divGitLink.classList.add('hidden'); @@ -906,7 +903,7 @@ function onClickItem() { elements.divSelectedMain.classList.remove('hidden'); elements.divBody.classList.add('hidden'); sendMessage( { type : "showButton" } ); - elements.arrow.classList.remove('hidden'); + // elements.arrow.classList.remove('hidden'); }; function onClickBack() { @@ -921,7 +918,7 @@ function onClickBack() { current.index = 0; current.screenshots = []; current.url = ''; - elements.arrow.classList.add('hidden'); + // elements.arrow.classList.add('hidden'); if(Ps) Ps.update(); }; @@ -1132,11 +1129,7 @@ function onTranslate() { function showMarketplace() { // show main window to user - if (!isPluginLoading && !isTranslationLoading && !isFrameLoading && (installedPlugins || bAppDirectory)) { - if(bAppDirectory) { - installedPlugins = []; - document.getElementsByClassName('toolbar_top')[0].classList.add('hidden'); - } + if (!isPluginLoading && !isTranslationLoading && !isFrameLoading && installedPlugins) { createSelect(); if (isOnline) showListofPlugins(isOnline); @@ -1437,7 +1430,6 @@ function removeUnloaded(unloaded) { }; function findPlugin(bAll, guid) { - // todo поправить везде где есть поиск, чтобы поиск запускался, если только есть такая группа плагинов let res = bAll ? allPlugins.find(function(el){return el.guid === guid}) : installedPlugins.find(function(el){return el.guid === guid});