Merge branch 'feat/outliner-core' into feat/shortcut-docs-page

This commit is contained in:
Weihua Lu
2021-05-14 04:32:47 +08:00
37 changed files with 443 additions and 228 deletions

View File

@@ -865,11 +865,12 @@
;; TODO: support fullscreen mode, maybe we need a fullscreen dialog?
(= name "bilibili")
(when-let [url (first arguments)]
(let [id-regex #"https?://www\.bilibili\.com/video/([\w\W]+)"]
(let [id-regex #"https?://www\.bilibili\.com/video/([^? ]+)"]
(when-let [id (cond
(<= (count url) 15) url
:else
(last (re-find id-regex url)))]
(prn {:id id})
(when-not (string/blank? id)
(let [width (min (- (util/get-width) 96)
560)
@@ -1135,23 +1136,23 @@
[:a.marker-switch
{:title "Change from NOW to LATER"
:on-click (set-marker-fn "LATER")}
"N"]
"NOW"]
"LATER"
[:a.marker-switch
{:title "Change from LATER to NOW"
:on-click (set-marker-fn "NOW")}
"L"]
"LATER"]
"TODO"
[:a.marker-switch
{:title "Change from TODO to DOING"
:on-click (set-marker-fn "DOING")}
"T"]
"TODO"]
"DOING"
[:a.marker-switch
{:title "Change from DOING to TODO"
:on-click (set-marker-fn "TODO")}
"D"]
"DOING"]
nil))))
(defn marker-cp
@@ -1290,7 +1291,8 @@
pre-block? (:block/pre-block? block)
properties (if pre-block?
(dissoc properties :title :filters)
properties)]
properties)
properties (sort properties)]
(cond
(seq properties)
[:div.blocks-properties.text-sm.opacity-80.my-1.p-2
@@ -1777,7 +1779,10 @@
(if (nil? checkbox)
(->elem
:li
{:checked checked?}
(cond->
{:checked checked?}
number
(assoc :value number))
(vec-cat
[(->elem
:p

View File

@@ -165,21 +165,11 @@
}
.marker-switch {
font-size: 85%;
margin-right: 6px;
margin-left: 2px;
border-radius: 3px;
font-weight: 500;
display: inline-block;
text-align: center;
width: 16px;
height: 18px;
padding: 2px 4px;
opacity: 0.5;
padding: 0 2px 0 2px;
border: 1px solid;
line-height: 1.3;
color: var(--ls-link-text-color, #045591);
cursor: pointer;
font-size: 85%;
margin: 0 2px 0 0px;
font-weight: 600;
&:hover {
color: var(--ls-link-text-hover-color);

View File

@@ -1,6 +1,7 @@
(ns frontend.components.page
(:require [rum.core :as rum]
[frontend.util :as util :refer-macros [profile]]
[frontend.util.marker :as marker]
[frontend.tools.html-export :as html-export]
[frontend.handler.file :as file]
[frontend.handler.page :as page-handler]
@@ -238,7 +239,7 @@
(let [current-repo (state/sub :git/current-repo)
repo (or repo current-repo)
page-name (string/lower-case path-page-name)
marker-page? (util/marker? page-name)
marker-page? (marker/marker? page-name)
priority-page? (contains? #{"a" "b" "c"} page-name)
block? (util/uuid-string? page-name)
block-id (and block? (uuid page-name))