Skip to content

Commit

Permalink
fix(updater): add option on/off
Browse files Browse the repository at this point in the history
  • Loading branch information
yoyurec committed Nov 2, 2022
1 parent 830588d commit ebdf732
Show file tree
Hide file tree
Showing 8 changed files with 186 additions and 130 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ Key can contain word (`type` = `page-type`, `item-type`, `task` = `tasks`, etc..
* `publisher`
* `location`, `place`
* `article`
* `file`
* `template`
* `slide`
* `summary`, `note`
* `number`, `isbn`
Expand Down
15 changes: 14 additions & 1 deletion src/modules/awesomeProps/awesomeProps.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
grid-template-columns: 1fr 10fr;
overflow: hidden;
position: relative;
margin: 0;
padding: 0 8px !important;
border: 4px solid var(--ls-page-properties-background-color) !important;
/* grid-gap: 1px 0; */
Expand Down Expand Up @@ -189,6 +188,7 @@
content: "\ea52" !important;
}
/* time */
.block-properties .page-property-key[data-ref="pace"]::before,
.block-properties .page-property-key[data-ref*="time"]::before,
.block-properties .page-property-key[data-ref*="duration"]::before {
content: "\ea04" !important;
Expand Down Expand Up @@ -233,6 +233,11 @@
content: "\eb02" !important;
}

/* template */
.block-properties .page-property-key[data-ref="template"]::before {
content: "\eb39" !important;
}

/* title */
.block-properties .page-property-key[data-ref*="title"]::before {
content: "\f2b1" !important;
Expand Down Expand Up @@ -301,6 +306,14 @@
.block-properties .page-property-key[data-ref="certificate"]::before {
content: "\ed76" !important;
}
/* equipment */
.block-properties .page-property-key[data-ref="equipment"]::before {
content: "\eff0" !important;
}
/* body-part */
.block-properties .page-property-key[data-ref="body-part"]::before {
content: "\f2db" !important;
}


/* edit */
Expand Down
1 change: 1 addition & 0 deletions src/modules/internal.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export * from './globals';
export * from './settings/settings';
export * from './settings/settingsConfig';
export * from './plugin/plugin';
export * from './DOMContainers';
export * from './features/features';
Expand Down
22 changes: 19 additions & 3 deletions src/modules/pages/pages.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@
>>> BEGIN: Page bottom
*/
/* linked */
.page > div:nth-last-child(2) .references .foldable-title h2::before {
.page-linked .foldable-title h2 {
font-weight: 600;
opacity: 0.6;
}
.page-linked .foldable-title h2::before {
content: '\eade';
width: 16px;
height: 16px;
Expand All @@ -40,7 +44,11 @@
font-family: tabler-icons;
}
/* unlinked */
.page > div:nth-last-child(1) .references .foldable-title h2::before {
.page-unlinked .foldable-title h2 {
font-weight: 600;
opacity: 0.6;
}
.page-unlinked .foldable-title h2::before {
content: '\eb46';
width: 16px;
height: 16px;
Expand All @@ -50,6 +58,10 @@
font-family: tabler-icons;
}
/* hierarchy */
.page-hierarchy .foldable-title h2 {
font-weight: 600;
opacity: 0.6;
}
.page-hierarchy .foldable-title h2::before {
content: '\eb9d';
width: 16px;
Expand All @@ -60,7 +72,11 @@
font-family: tabler-icons;
}
/* tagged */
#main-content-container > div > div > div > div.references.mt-6.flex-1.flex-row > div > div > div.content > div > div > h2::before {
.page-tags h2 {
font-weight: 600;
opacity: 0.6;
}
.page-tags h2::before {
content: '\eb34';
width: 16px;
height: 16px;
Expand Down
8 changes: 5 additions & 3 deletions src/modules/plugin/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ export const pluginLoad = () => {
});
}, 2000)

setTimeout(() => {
checkUpdate();
}, 8000)
if (globalContext.pluginConfig.featureUpdaterEnabled) {
setTimeout(() => {
checkUpdate();
}, 8000)
}
}

const pluginUnload = () => {
Expand Down
3 changes: 3 additions & 0 deletions src/modules/settings/settings.css
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@
content: "\ea69";
}

.panel-wrap[data-id="logseq-awesome-ui"] .heading-item[data-key="otherHeading"] h2::before {
content: "\ea03";
}
/*
<<<< END: Settings icons
*/
Expand Down
125 changes: 2 additions & 123 deletions src/modules/settings/settings.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { SettingSchemaDesc, LSPluginBaseInfo } from '@logseq/libs/dist/LSPlugin.user';
import { LSPluginBaseInfo } from '@logseq/libs/dist/LSPlugin.user';

import {
globalContext,
settingsConfig,
toggleCalendarFeature,
toggleColumnsFeature,
toggleQuoteFeature,
Expand All @@ -16,128 +17,6 @@ import { objectDiff } from '../utils';

import './settings.css';

export const settingsConfig: SettingSchemaDesc[] = [
{
key: 'promoAwesomeStyler',
title: '',
description: globalContext.promoAwesomeStylerMsg,
type: 'boolean',
default: false,
},
{
key: 'featureHeading',
title: 'Features',
description: '',
type: 'heading',
default: null,
},
{
key: 'featureCalendarEnabled',
title: '',
description: 'Enable "Calendar" page menu sidebar item?',
type: 'boolean',
default: true,
},
{
key: 'pageHeading',
title: 'Page blocks',
description: '',
type: 'heading',
default: null,
},
{
key: 'featureHideDotProps',
title: '',
description: 'Hide (in view mode) page props started with dot (.propName)?',
type: 'boolean',
default: true,
},
{
key: 'featureHideSetOfProps',
title: '',
description: 'Hide (in view mode) page props (comma separated). Delete to disable',
type: 'string',
default: 'propToHide,propAnother,color,banner',
},
{
key: 'featureAwesomeProps',
title: '',
description: 'Enable awesome styled props?',
type: 'boolean',
default: true,
},
{
key: 'contentHeading',
title: 'Content',
description: '',
type: 'heading',
default: null,
},
{
key: 'featureTasksEnabled',
title: '',
description: 'Enable tasks status and priority restyling?',
type: 'boolean',
default: true,
},
{
key: 'featureColumnsEnabled',
title: '',
description: 'Enable columns: "#.kanban" & "#.grid" tags?',
type: 'boolean',
default: true,
},
{
key: 'featureQuoteEnabled',
title: '',
description: 'Enable blockquote style for "#quote" tag?',
type: 'boolean',
default: true,
},
{
key: 'featureHeadersLabelsEnabled',
title: '',
description: 'Show headers (h1-h5) labels?',
type: 'boolean',
default: true,
},
{
key: 'appUIHeading',
title: 'App UI tuning',
description: '',
type: 'heading',
default: null,
},
{
key: 'featureHomeButtonEnabled',
title: '',
description: 'Show "Home" button on header?',
type: 'boolean',
default: false,
},
{
key: 'featureSidebarNewPageEnabled',
title: '',
description: 'Show "New Page" button on left sidebar?',
type: 'boolean',
default: false,
},
{
key: 'featureSidebarPageIconEnabled',
title: '',
description: 'Show default page icons on left sidebar favs/recent?',
type: 'boolean',
default: false,
},
{
key: 'featureNewBlockBulletEnabled',
title: '',
description: 'Always show add block bullet on page bottom?',
type: 'boolean',
default: false,
},
];

export const settingsLoad = () => {
logseq.useSettingsSchema(settingsConfig);
globalContext.pluginConfig = logseq.settings;
Expand Down
Loading

0 comments on commit ebdf732

Please sign in to comment.