Commit f9ae22c1 authored by akiraohgaki's avatar akiraohgaki

Merge branch 'develop'

parents faa9e2c3 57d7282f
Pipeline #333 passed with stage
in 2 minutes and 6 seconds
......@@ -59,7 +59,10 @@ export default class CollectiondialogComponent extends BaseComponent {
}
}
open() {
open(view = '') {
if (view) {
this._handleCollectionsidebarSelect({detail: {select: view}});
}
this.contentRoot.querySelector('app-dialog').open();
}
......
......@@ -17,18 +17,24 @@ export default class OmniboxComponent extends BaseComponent {
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);
this._viewHandler_ocsManager_metadataSet = this._viewHandler_ocsManager_metadataSet.bind(this);
}
componentConnectedCallback() {
this.getStateManager().viewHandler
.add('webview_loading', this._viewHandler_webview_loading)
.add('webview_page', this._viewHandler_webview_page);
.add('webview_page', this._viewHandler_webview_page)
.add('ocsManager_updateAvailableItems', this._viewHandler_ocsManager_updateAvailableItems)
.add('ocsManager_metadataSet', this._viewHandler_ocsManager_metadataSet);
}
componentDisconnectedCallback() {
this.getStateManager().viewHandler
.remove('webview_loading', this._viewHandler_webview_loading)
.remove('webview_page', this._viewHandler_webview_page);
.remove('webview_page', this._viewHandler_webview_page)
.remove('ocsManager_updateAvailableItems', this._viewHandler_ocsManager_updateAvailableItems)
.remove('ocsManager_metadataSet', this._viewHandler_ocsManager_metadataSet);
}
render() {
......@@ -51,26 +57,61 @@ export default class OmniboxComponent extends BaseComponent {
}
div[data-omnibox] {
position: relative;
width: inherit;
height: inherit;
border-radius: 5px;
background-color: var(--color-active-secondary);
overflow: hidden;
transition: background-color 0.2s ease-out;
}
div[data-omnibox]:hover {
background-color: var(--color-active);
div[data-omnibox]::after {
--border-width: 3px;
display: block;
content: '';
z-index: 9;
position: absolute;
top: calc(-1 * var(--border-width));
left: calc(-1 * var(--border-width));
width: calc(100% + var(--border-width) * 2);
height: calc(100% + var(--border-width) * 2);
border-radius: calc(var(--border-width) * 2);
}
div[data-content] {
div[data-omnibox][data-update-state="active"]::after {
background-color: var(--color-important);
}
div[data-omnibox][data-download-state="active"]::after {
background: linear-gradient(90deg, transparent, var(--color-information) 50%, transparent);
background-size: 300% 300%;
animation: gradient 2s ease-in-out infinite alternate;
}
@keyframes gradient {
0% {
background-position: 0% 0%;
}
100% {
background-position: 100% 0%;
}
}
div[data-omnibox] div[data-wrapper] {
z-index: 10;
position: absolute;
width: 100%;
height: 100%;
border-radius: 3px;
background-color: var(--color-widget);
overflow: hidden;
}
div[data-omnibox] div[data-content] {
display: flex;
flex-flow: row nowrap;
align-items: center;
width: inherit;
height: inherit;
width: 100%;
height: 100%;
background-color: var(--color-active-secondary);
line-height: 1;
transition: background-color 0.2s ease-out;
}
div[data-omnibox] div[data-content]:hover {
background-color: var(--color-active);
}
div[data-content] h3 {
div[data-omnibox] div[data-content] h3 {
flex: 1 1 auto;
border-right: 1px solid var(--color-border);
overflow: hidden;
......@@ -80,15 +121,14 @@ export default class OmniboxComponent extends BaseComponent {
text-align: center;
cursor: pointer;
}
div[data-content] div {
div[data-omnibox] div[data-content] div {
display: flex;
flex: 0 0 auto;
align-items: center;
justify-content: center;
width: 30px;
}
app-indicator {
div[data-omnibox] app-indicator {
position: relative;
top: -2px;
}
......@@ -108,24 +148,46 @@ export default class OmniboxComponent extends BaseComponent {
div[data-palette][data-state="inactive"] {
display: none;
}
div[data-palette] h4 {
div[data-palette] div[data-content] {
padding: 1em;
border-bottom: 1px solid var(--color-border);
}
div[data-palette] div[data-content]:last-child {
border-bottom: 0;
}
div[data-palette] div[data-content][data-update-state] a {
color: var(--color-important);
}
div[data-palette] div[data-content][data-update-state="inactive"] {
display: none;
}
div[data-palette] div[data-content][data-download-state] a {
color: var(--color-information);
}
div[data-palette] div[data-content][data-download-state="inactive"] {
display: none;
}
div[data-palette] div[data-content] h4 {
margin: 1em 0;
text-align: center;
}
div[data-palette] h4 i {
div[data-palette] div[data-content] h4 i {
position: relative;
top: 3px;
}
div[data-palette] nav ul {
div[data-palette] div[data-content] p {
text-align: center;
}
div[data-palette] div[data-content] nav ul {
display: flex;
flex-flow: row wrap;
justify-content: center;
}
div[data-palette] nav ul li {
div[data-palette] div[data-content] nav ul li {
width: 50%;
padding: 5px;
}
div[data-palette] nav ul li app-button {
div[data-palette] div[data-content] nav ul li app-button {
width: 100%;
}
......@@ -142,7 +204,8 @@ export default class OmniboxComponent extends BaseComponent {
}
</style>
<div data-omnibox>
<div data-omnibox data-update-state="inactive" data-download-state="inactive">
<div data-wrapper>
<div data-content>
<div></div>
<h3 data-action="omnibox_open">${this.state.title}</h3>
......@@ -153,8 +216,18 @@ export default class OmniboxComponent extends BaseComponent {
</div>
<app-indicator></app-indicator>
</div>
</div>
<div data-palette data-state="${state}" class="fade-in">
<div data-content data-update-state="inactive">
<h4><i class="material-icons md-small">update</i> Update</h4>
<p data-message></p>
</div>
<div data-content data-download-state="inactive">
<h4><i class="material-icons md-small">cloud_download</i> Download</h4>
<p data-message></p>
</div>
<div data-content>
<h4><i class="material-icons md-small">home</i> Choose Startpage</h4>
<nav>
<ul>
......@@ -167,6 +240,7 @@ export default class OmniboxComponent extends BaseComponent {
</ul>
</nav>
</div>
</div>
<div data-overlay data-state="${state}" data-action="${autoCloseAction}"></div>
`;
......@@ -213,6 +287,10 @@ export default class OmniboxComponent extends BaseComponent {
else if (event.target.closest('app-button[data-action]')) {
target = event.target.closest('app-button[data-action]');
}
else if (event.target.closest('a[data-action]')) {
event.preventDefault();
target = event.target.closest('a[data-action]');
}
else {
return;
}
......@@ -225,11 +303,15 @@ export default class OmniboxComponent extends BaseComponent {
this.dispatch('webview_startPage', {url: target.getAttribute('data-url')});
this.close();
break;
case 'ocsManager_collection':
this.dispatch('ocsManager_collection', {view: target.getAttribute('data-view')});
this.close();
break;
}
}
_viewHandler_webview_loading(state) {
const indicator = this.contentRoot.querySelector('app-indicator');
const indicator = this.contentRoot.querySelector('div[data-omnibox] app-indicator');
state.isLoading ? indicator.start() : indicator.stop();
}
......@@ -237,4 +319,31 @@ export default class OmniboxComponent extends BaseComponent {
this.update({...this.state, ...state});
}
_viewHandler_ocsManager_updateAvailableItems(state) {
this.contentRoot.querySelector('div[data-omnibox]').setAttribute('data-update-state', state.count ? 'active' : 'inactive');
const updateContent = this.contentRoot.querySelector('div[data-palette] div[data-content][data-update-state]');
updateContent.setAttribute('data-update-state', state.count ? 'active' : 'inactive');
let messageHtml = '';
if (state.count) {
let messageText = `${state.count} item(s) update available`;
messageHtml = `<a href="#" data-action="ocsManager_collection" data-view="update">${messageText}</a>`;
}
updateContent.querySelector('p[data-message]').innerHTML = messageHtml;
}
_viewHandler_ocsManager_metadataSet(state) {
this.contentRoot.querySelector('div[data-omnibox]').setAttribute('data-download-state', state.count ? 'active' : 'inactive');
const downloadContent = this.contentRoot.querySelector('div[data-palette] div[data-content][data-download-state]');
downloadContent.setAttribute('data-download-state', state.count ? 'active' : 'inactive');
let messageHtml = '';
if (state.count) {
let messageText = state.metadataSet[Object.keys(state.metadataSet)[0]].filename;
messageText += (state.count > 1) ? ` and ${state.count - 1} file(s)` : '';
messageHtml = `<a href="#" data-action="ocsManager_collection" data-view="download">${messageText}</a>`;
}
downloadContent.querySelector('p[data-message]').innerHTML = messageHtml;
}
}
......@@ -36,7 +36,7 @@ export default class BadgeComponent extends BaseComponent {
color: var(--color-content);
}
span[data-emphasis="high"] {
background-color: var(--color-warning);
background-color: var(--color-important);
color: var(--color-content);
}
</style>
......
......@@ -36,10 +36,7 @@ export default class IndicatorComponent extends BaseComponent {
width: 50%;
height: inherit;
background-color: var(--color-information);
animation-name: slide;
animation-duration: 1s;
animation-iteration-count: infinite;
animation-direction: alternate;
animation: slide 1s ease-in-out infinite alternate;
}
div[data-indicator][data-state="inactive"] {
display: none;
......
......@@ -43,8 +43,8 @@ export default class OcsManagerHandler {
}
return {};
})
.add('ocsManager_collection', () => {
this._collectiondialogComponent.open();
.add('ocsManager_collection', (data) => {
this._collectiondialogComponent.open(data.view || '');
return false;
})
.add('ocsManager_openUrl', (data) => {
......
......@@ -10,8 +10,7 @@ a:hover {
.fade-in,
.fade-out {
animation-name: fade;
animation-duration: 0.2s;
animation: fade 0.2s;
}
.fade-out {
animation-direction: reverse;
......
......@@ -7,8 +7,6 @@ PREFIX="$(cd "$(dirname "${0}")" && pwd)"
if [ ${APPIMAGE} ]; then
export PATH=${PREFIX}/usr/local/bin:${PREFIX}/usr/bin:${PATH}
(HOME=${PREFIX}/home/appimage && imwheel)
trap "echo trapped" EXIT
fi
if [ -f "${PREFIX}/ocs-store-linux-x64/ocs-store" ]; then
......
......@@ -5,9 +5,9 @@
"requires": true,
"dependencies": {
"@types/node": {
"version": "10.12.30",
"resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.30.tgz",
"integrity": "sha512-nsqTN6zUcm9xtdJiM9OvOJ5EF0kOI8f1Zuug27O/rgtxCRJHGqncSWfCMZUP852dCKPsDsYXGvBhxfRjDBkF5Q==",
"version": "10.14.1",
"resolved": "https://registry.npmjs.org/@types/node/-/node-10.14.1.tgz",
"integrity": "sha512-Rymt08vh1GaW4vYB6QP61/5m/CFLGnFZP++bJpWbiNxceNa6RBipDmb413jvtSf/R1gg5a/jQVl2jY4XVRscEA==",
"dev": true
},
"ajv": {
......@@ -342,9 +342,9 @@
}
},
"electron": {
"version": "4.0.8",
"resolved": "https://registry.npmjs.org/electron/-/electron-4.0.8.tgz",
"integrity": "sha512-FOBJIHkuv8wc15N+ZyqwDzPavYVu5CHMBEf14jHDWv7QW2vkEIpJjVK+PIT31kfZfvjsIP0j2wvA/FBsiqB7pw==",
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/electron/-/electron-4.1.0.tgz",
"integrity": "sha512-q/yTi9dT5UEFK/s+vOQaHNkTHWiRK9kEBYVJt34nmWc9piW42hXT+nhKUEHHhccMPr3q18gG0iPZqeR+LG76ow==",
"dev": true,
"requires": {
"@types/node": "^10.12.18",
......@@ -508,9 +508,9 @@
}
},
"esm": {
"version": "3.2.13",
"resolved": "https://registry.npmjs.org/esm/-/esm-3.2.13.tgz",
"integrity": "sha512-0KGE/BOvS4MIjsalY3GfbhAgy+wJ7OO/JXrpTm0KnajE9np5s4fuEkyplaF5xLnN7/3h9jZAvTnnMynK39wG4g=="
"version": "3.2.18",
"resolved": "https://registry.npmjs.org/esm/-/esm-3.2.18.tgz",
"integrity": "sha512-1UENjnnI37UDp7KuOqKYjfqdaMim06eBWnDv37smaxTIzDl0ZWnlgoXwsVwD9+Lidw+q/f1gUf2diVMDCycoVw=="
},
"extend": {
"version": "3.0.2",
......
"^ocs-store$"
None, Up, Button4, 10
None, Down, Button5, 10
......@@ -19,23 +19,6 @@ install -D -m 755 /usr/lib/x86_64-linux-gnu/libXss.so.1 ${APPDIR}/usr/lib/ocs-st
install -D -m 755 /usr/lib/x86_64-linux-gnu/gtk-2.0/modules/libcanberra-gtk-module.so ${APPDIR}/usr/lib/ocs-store-linux-x64/libcanberra-gtk-module.so
install -D -m 755 /usr/lib/x86_64-linux-gnu/libgnome-keyring.so.0 ${APPDIR}/usr/lib/ocs-store-linux-x64/libgnome-keyring.so.0
install -D -m 644 pkg/appimage/.imwheelrc ${APPDIR}/home/appimage/.imwheelrc
install -D -m 644 /etc/X11/Xsession.d/60imwheel_start-imwheel ${APPDIR}/etc/X11/Xsession.d/60imwheel_start-imwheel
install -D -m 644 /etc/X11/imwheel/imwheelrc ${APPDIR}/etc/X11/imwheel/imwheelrc
install -D -m 644 /etc/X11/imwheel/startup.conf ${APPDIR}/etc/X11/imwheel/startup.conf
install -D -m 755 /usr/bin/imwheel ${APPDIR}/usr/bin/imwheel
#install -D -m 755 /usr/lib/imwheel/getmdt ${APPDIR}/usr/lib/imwheel/getmdt
#install -D -m 755 /usr/lib/imwheel/mdetect ${APPDIR}/usr/lib/imwheel/mdetect
#install -D -m 755 /usr/lib/imwheel/mdump ${APPDIR}/usr/lib/imwheel/mdump
#install -D -m 755 /usr/lib/imwheel/mice/a4tech ${APPDIR}/usr/lib/imwheel/mice/a4tech
#install -D -m 755 /usr/lib/imwheel/mice/default ${APPDIR}/usr/lib/imwheel/mice/default
#install -D -m 755 /usr/lib/imwheel/mice/intellimouse ${APPDIR}/usr/lib/imwheel/mice/intellimouse
#install -D -m 755 /usr/lib/imwheel/mice/mouseman+ ${APPDIR}/usr/lib/imwheel/mice/mouseman+
#install -D -m 755 /usr/lib/imwheel/mice/netmouse ${APPDIR}/usr/lib/imwheel/mice/netmouse
#install -D -m 755 /usr/lib/imwheel/see ${APPDIR}/usr/lib/imwheel/see
#install -D -m 755 /usr/lib/imwheel/setimps2 ${APPDIR}/usr/lib/imwheel/setimps2
#install -D -m 755 /usr/lib/imwheel/setmmplus ${APPDIR}/usr/lib/imwheel/setmmplus
curl -fsSL -o ocs-manager https://git.opendesktop.org/akiraohgaki/ocs-manager/uploads/ebf99a67dcd30bc57cfa371cac1f959e/ocs-manager-0.7.2-1-x86_64.AppImage
install -D -m 755 ocs-manager ${APPDIR}/usr/bin/ocs-manager
......
......@@ -23,7 +23,7 @@ install_build_deps_appimage() {
git clone https://github.com/tj/n.git -b master --single-branch --depth=1 "${PROJDIR}/n"
(cd "${PROJDIR}/n" && make install && n lts)
rm -rf "${PROJDIR}/n"
apt -y install libgconf-2-4 libxss1 libcanberra-gtk-module libgnome-keyring0 imwheel
apt -y install libgconf-2-4 libxss1 libcanberra-gtk-module libgnome-keyring0
}
build_appimage() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment