Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • dfn2/pling-store-development
  • azubieta/pling-store-development
  • skye111/pling-store-development
  • fischy0487/pling-store-development
  • mussah/pling-store-development
  • visdom/pling-store-development
  • violethaze74/pling-store-development
  • wh0eta/pling-store-development
  • walmar163/pling-store-development
  • eefaerber/pling-store-development
  • mutazawad/pling-store-development
  • petrovgeorgi/pling-store-development
  • alleykatt/pling-store-development
  • 1147008/pling-store-development
  • jc01-onwork/pling-store-development
  • arystan/pling-store-development
  • hasithalakshan596/pling-store-development
  • motrmtl/pling-store-development
  • zakirhossain7745/pling-store-development
  • marcuseier/pling-store-development
  • rakansherif23/pling-store-development
  • badr2872/pling-store-development
  • dado105/pling-store-development
  • foolish13/pling-store-development
  • alex0115201/pling-store-development
  • kungfu8edora/pling-store-development
  • cxslucyfer/pling-store-development
  • khmisa4500/pling-store-development
  • androny22-77/pling-store-development
  • asus-bd24/pling-store-development
30 results
Show changes
Commits on Source (111)
Showing
with 121 additions and 102 deletions
build_*/
node_modules/
dist/
ocs-manager
......@@ -8,5 +8,5 @@ appimage:
- ./scripts/package appimage
artifacts:
paths:
- build_*/pling-store*.AppImage
- build_*/pling-store*.AppImage*
expire_in: 2 days
react: npm start
electron: node src/electron-wait-react
\ No newline at end of file
# pling-store
# Pling-Store
Pling store electron
\ No newline at end of file
Pling-Store is a Content Management App for OCS-compatible websites like opendesktop.org, gnome-look.org, etc.
It allows to download and install applications, desktop themes, icon themes, wallpapers, or mouse cursors
under various desktop environments using the "Install"-button.
Currently supported are these desktop environments:
KDE Plasma, Gnome, XFCE, Mate, Cinnamon, Budgie, LXQt, Elementary and Enlightenment.
## Usage
Using the Appimage package format, it should work on any distro like Ubuntu, Debian, Arch, Suse, Redhat and many more.
### Best with AppImageLauncher
If you never used an Appimage before, we recommend this tool to make AppImages run, install/uninstall and update on your Linux OS:
https://www.pling.com/p/1228228/
*Please see if AppImageLauncher offers native packages for your distro, if not, you may request it in the issue section.*
After installing AppImageLauncher, you can simply Double-Click on the Pling-Store Appimage to run or install it.
### Manual Run
To try the Pling-Store without installing, you can simply [make it executable](https://youtu.be/nzZ6Ikc7juw?t=78) and (double-)click on it.
## Development
The Pling-Store is a regular electron app plus the [ocs-manager](https://git.opendesktop.org/akiraohgaki/ocs-manager/). The first acts as a presentation
layer and the second is the one who handles the intallation of the different products.
### Project Setup
```
npm install
curl -fsSL -o node_modules/.bin/ocs-manager https://git.opendesktop.org/akiraohgaki/ocs-manager/uploads/d3dc42436b82d11360ebc96b38d4aaf4/ocs-manager-0.8.1-1-x86_64.AppImage
chmod +x node_modules/.bin/ocs-manager
```
### AppImage Generation
`./scripts/package appimage`
app/images/app-icons/pling-store.png

5.21 KiB

This diff is collapsed.
.icon-pling-store {
.icon-ocs-store {
background-image: url(app-icons/pling-store.svg);
}
......@@ -18,8 +18,8 @@
</head>
<body>
<app-root></app-root>
<script>
require = require('esm')(module);
module.exports = require('./scripts/renderers/browser-window.js');
......
......@@ -5,6 +5,9 @@ const {app, BrowserWindow, ipcMain} = require('electron');
const ElectronStore = require('electron-store');
const request = require('request');
// Set configs dir
app.setPath("userData", app.getPath("appData") + "/OCS-Store")
const appPackage = require('../package.json');
const appConfig = require('./configs/application.json');
const ocsManagerConfig = require('./configs/ocs-manager.json');
......@@ -29,7 +32,8 @@ async function startOcsManager() {
}
};
ocsManager = spawn(ocsManagerConfig.bin, ['-p', ocsManagerConfig.port]);
ocsManager = spawn(ocsManagerConfig.bin, ['-p', ocsManagerConfig.port, '--appFile', process.env.APPIMAGE]);
ocsManager.stdout.on('data', (data) => {
console.log(`[${ocsManagerConfig.bin}] ${data}`);
......@@ -88,7 +92,8 @@ function createWindow() {
}
mainWindow.loadURL(indexFileUrl);
mainWindow.maximize();
mainWindow.on('close', () => {
const appConfigStore = new ElectronStore({name: appConfigStoreStorage});
appConfigStore.set('windowBounds', mainWindow.getBounds());
......@@ -107,8 +112,7 @@ function isFile(path) {
try {
const stats = fs.statSync(path);
return stats.isFile();
}
catch (error) {
} catch (error) {
console.error(error);
return false;
}
......@@ -118,8 +122,7 @@ function isDirectory(path) {
try {
const stats = fs.statSync(path);
return stats.isDirectory();
}
catch (error) {
} catch (error) {
console.error(error);
return false;
}
......@@ -159,8 +162,7 @@ function removePreviewpic(itemKey) {
app.on('ready', async () => {
if (await startOcsManager()) {
createWindow();
}
else {
} else {
app.quit();
}
});
......@@ -217,22 +219,24 @@ ipcMain.on('store', (event, key, value) => {
event.returnValue = key ? appConfigStore.get(key) : appConfigStore.store;
});
ipcMain.on('checkForUpdates', () => {
// TODO -> add check for updates method?
ocsManager = spawn(ocsManagerConfig.bin, ['-p', ocsManagerConfig.port, '--appFile', process.env.APPIMAGE]);
console.log(ocsManager);
});
ipcMain.on('previewpic', (event, kind, itemKey, url) => {
if (kind === 'directory') {
event.returnValue = previewpicDirectory;
}
else if (kind === 'path' && itemKey) {
} else if (kind === 'path' && itemKey) {
event.returnValue = `${previewpicDirectory}/${previewpicFilename(itemKey)}`;
}
else if (kind === 'download' && itemKey && url) {
} else if (kind === 'download' && itemKey && url) {
downloadPreviewpic(itemKey, url);
event.returnValue = undefined;
}
else if (kind === 'remove' && itemKey) {
} else if (kind === 'remove' && itemKey) {
removePreviewpic(itemKey);
event.returnValue = undefined;
}
else {
} else {
event.returnValue = false;
}
});
......@@ -41,7 +41,7 @@ export default class AboutdialogComponent extends BaseComponent {
padding: 1em;
text-align: center;
}
div[slot="content"] figure.icon-pling-store {
div[slot="content"] figure.icon-ocs-store {
display: inline-block;
width: 128px;
height: 128px;
......@@ -58,7 +58,7 @@ export default class AboutdialogComponent extends BaseComponent {
<app-dialog data-width="500px" data-footer-state="inactive">
<h3 slot="header">About This App</h3>
<div slot="content">
<figure class="icon-pling-store"></figure>
<figure class="icon-ocs-store"></figure>
<h4>${this.state.productName}</h4>
<p>Version ${this.state.version}</p>
<p>${this.state.description}</p>
......
......@@ -232,11 +232,13 @@ export default class OmniboxComponent extends BaseComponent {
<nav>
<ul>
<li><app-button data-action="webview_startPage" data-url="https://www.pling.com/">pling.com</app-button></li>
<li><app-button data-action="webview_startPage" data-url="https://www.opendesktop.org/s/Gnome">gnome-look.org</app-button></li>
<li><app-button data-action="webview_startPage" data-url="https://store.kde.org/">store.kde.org</app-button></li>
<li><app-button data-action="webview_startPage" data-url="https://www.opendesktop.org/s/XFCE">xfce-look.org</app-button></li>
<li><app-button data-action="webview_startPage" data-url="https://www.opendesktop.org/s/Window-Managers">box-look.org</app-button></li>
<li><app-button data-action="webview_startPage" data-url="https://www.opendesktop.org/s/Enlightenment">enlightenment-themes.org</app-button></li>
<li><app-button data-action="webview_startPage" data-url="https://www.appimagehub.com/">Appimagehub.com</app-button></li>
<li><app-button data-action="webview_startPage" data-url="https://store.kde.org/">KDE</app-button></li>
<li><app-button data-action="webview_startPage" data-url="https://www.pling.com/s/Artwork">Artwork</app-button></li>
<li><app-button data-action="webview_startPage" data-url="https://www.pling.com/s/Gnome">Gnome</app-button></li>
<li><app-button data-action="webview_startPage" data-url="https://www.pling.com/s/Comics">Comics</app-button></li>
<li><app-button data-action="webview_startPage" data-url="https://www.pling.com/s/XFCE">XFCE</app-button></li>
<li><app-button data-action="webview_startPage" data-url="https://www.pling.com/s/Videos">Videos</app-button></li>
</ul>
</nav>
</div>
......
......@@ -31,7 +31,7 @@ export default class SplashscreenComponent extends BaseComponent {
align-items: center;
justify-content: center;
}
div[slot="content"] figure.icon-pling-store {
div[slot="content"] figure.icon-ocs-store {
display: inline-block;
width: 128px;
height: 128px;
......@@ -47,7 +47,7 @@ export default class SplashscreenComponent extends BaseComponent {
<app-dialog data-width="400px" data-height="300px"
data-state="active" data-header-state="inactive" data-footer-state="inactive" data-auto-close-state="inactive">
<div slot="content">
<figure class="icon-pling-store"></figure>
<figure class="icon-ocs-store"></figure>
<h3>Welcome to ${document.title}</h3>
<p>Loading...</p>
</div>
......
import BaseComponent from './common/BaseComponent.js';
const {ipcRenderer} = require('electron');
export default class ToolbarComponent extends BaseComponent {
init() {
this.contentRoot.addEventListener('click', this._handleClick.bind(this));
this._ipcRenderer = ipcRenderer;
this._viewHandler_webview_loading = this._viewHandler_webview_loading.bind(this);
this._viewHandler_webview_page = this._viewHandler_webview_page.bind(this);
this._viewHandler_ocsManager_updateAvailableItems = this._viewHandler_ocsManager_updateAvailableItems.bind(this);
......@@ -121,16 +122,20 @@ export default class ToolbarComponent extends BaseComponent {
data-title="My Collection" data-icon="folder"></app-iconbutton><br>
<app-badge data-count="0" data-emphasis="high"></app-badge>
<app-badge data-count="0" data-emphasis="medium"></app-badge>
</li>
</li>
<li data-omnibox><app-omnibox></app-omnibox></li>
<li>
<app-iconbutton data-action="menu_open"
data-title="Other Operations..." data-icon="more_vert"></app-iconbutton><br>
<app-menu data-width="250px" data-offset-x="-220px">
<a slot="menuitem" href="#" data-action="webview_appBugsPage">Report a Bug</a>
<a slot="menuitem" href="#" data-action="check_for_updates">Check for Updates</a>
<a slot="menuitem" href="#" data-action="general_about">About This App</a>
</app-menu>
</li>
<li>
<app-iconbutton data-action="login" data-title="Login" data-icon="account_circle" data-state="active"></app-iconbutton>
</li>
</ul>
</nav>
`;
......@@ -183,11 +188,21 @@ export default class ToolbarComponent extends BaseComponent {
this.contentRoot.querySelector('app-menu').close();
break;
}
case 'check_for_updates':{
//this._ipcRenderer.send('checkForUpdates');
this.dispatch('ocsManager_checkForUpdates', {});
this.contentRoot.querySelector('app-menu').close();
break;
}
case 'general_about': {
this.dispatch('general_about', {});
this.contentRoot.querySelector('app-menu').close();
break;
}
case 'login':{
this.dispatch('webview_loginPage', {});
break;
}
}
}
......
......@@ -102,6 +102,11 @@ export default class WebviewComponent extends BaseComponent {
this._webview.addEventListener('did-stop-loading', () => {
this.dispatch('webview_loading', {isLoading: false});
// workaround for Input cursor invisible after navigation in webview
// details at https://github.com/electron/electron/issues/14474
this._webview.blur();
this._webview.focus();
});
this._webview.addEventListener('dom-ready', () => {
......
......@@ -126,4 +126,4 @@ export default class MenuComponent extends BaseComponent {
}
}
}
}
\ No newline at end of file
......@@ -144,6 +144,12 @@ export default class OcsManagerHandler {
return false;
})
.add('ocsManager_checkForUpdates', () => {
console.log('checkForUpdates');
this._ocsManagerApi.send('UpdateHandler::checkAppUpdate', []).then(function(res){
console.log(res)
});
})
.add('ocsManager_update', (data) => {
this._ocsManagerApi.send('UpdateHandler::update', [data.itemKey]);
return false;
......
......@@ -73,6 +73,10 @@ export default class WebviewHandler {
.add('webview_appBugsPage', () => {
this._webviewComponent.loadUrl(this._appPackage.bugs);
return false;
})
.add('webview_loginPage', () => {
this._webviewComponent.loadUrl('https://www.pling.com/login');
return false;
});
}
......
const {ipcRenderer} = require('electron');
function applySmoothScroll() {
let requestId = null;
let frame = 0;
const frameMax = 50;
let amount = 0;
const amountMax = 7;
let deltaX = 0;
let deltaY = 0;
let scrollLeft = 0;
let scrollTop = 0;
const easeOut = (p) => {
return p * (2 - p);
};
const scroll = () => {
frame++;
document.scrollingElement.scrollTo({
left: scrollLeft + (deltaX * easeOut(frame / frameMax)),
top: scrollTop + (deltaY * easeOut(frame / frameMax))
});
if (frame === frameMax) {
frame = 0;
amount = 0;
cancelAnimationFrame(requestId);
}
else {
requestId = requestAnimationFrame(scroll);
}
};
document.scrollingElement.addEventListener('wheel', (event) => {
event.preventDefault();
if (Math.sign(deltaX) !== Math.sign(event.deltaX)
|| Math.sign(deltaY) !== Math.sign(event.deltaY)
) {
amount = 0;
}
if (amount < amountMax) {
amount++;
}
deltaX = event.deltaX * amount;
deltaY = event.deltaY * amount;
scrollLeft = document.scrollingElement.scrollLeft;
scrollTop = document.scrollingElement.scrollTop;
if (frame) {
frame = 0;
cancelAnimationFrame(requestId);
}
scroll();
});
}
/*
function detectUserProfile() {
const profileMenu = document.querySelector('[rel="profile-menu"]');
if (profileMenu) {
const userName = profileMenu.querySelector('span').innerHTML;
const userImage = profileMenu.querySelector('img').src;
ipcRenderer.sendToHost('user-profile', userName, userImage);
}
}
*/
ipcRenderer.on('ipc-message', () => {
applySmoothScroll();
//detectUserProfile();
});
{
"main.css": "static/css/main.8055198b.css",
"main.css.map": "static/css/main.8055198b.css.map",
"main.js": "static/js/main.35a069ca.js",
"main.js.map": "static/js/main.35a069ca.js.map"
}
\ No newline at end of file
build/favicon.ico

24.3 KiB