Browse Source

Merge remote-tracking branch 'origin/master' into fix/electron-alpha-issues

charlie 4 years ago
parent
commit
f77f56b8c4

+ 1 - 2
src/main/frontend/components/block.cljs

@@ -1155,8 +1155,7 @@
                       [:span (t :page/edit-properties-placeholder)]
                       (markup-elements-cp (assoc config :block/format format) ast))]]
       (if slide?
-        [:div [:h1 (:page-name config)]
-         block-cp]
+        [:div [:h1 (:page-name config)]]
         block-cp))))
 
 (rum/defc properties-cp

+ 1 - 3
src/main/frontend/components/page.cljs

@@ -383,9 +383,7 @@
                                                :href  (rfe/href :file {:path file-path})}
                   file-path]
 
-                 (when (and (not config/mobile?)
-                            (not (util/electron?))
-                            (not journal?))
+                 (when (not config/mobile?)
                    (presentation repo page))])]
 
              (when (and repo (not block?))

+ 13 - 7
src/main/frontend/config.cljs

@@ -322,13 +322,19 @@
 
 (defn get-file-path
   [repo-url relative-path]
-  (if (and (util/electron?) (local-db? repo-url))
-    (let [dir (get-repo-dir repo-url)]
-      (if (string/starts-with? relative-path dir)
-        relative-path
-        (str dir "/"
-             (string/replace relative-path #"^/" ""))))
-    relative-path))
+  (when (and repo-url relative-path)
+    (cond
+      (and (util/electron?) (local-db? repo-url))
+      (let [dir (get-repo-dir repo-url)]
+        (if (string/starts-with? relative-path dir)
+          relative-path
+          (str dir "/"
+               (string/replace relative-path #"^/" ""))))
+      (= "/" (first relative-path))
+      (subs relative-path 1)
+
+      :else
+      relative-path)))
 
 (defn get-config-path
   ([]

+ 20 - 15
src/main/frontend/extensions/slide.cljs

@@ -29,28 +29,33 @@
               (bean/->js
                {:embedded true
                 :controls true
-                :history true
+                :history false
                 :center true
                 :transition "slide"}))]
     (.initialize deck)))
 
 (defn slide-content
   [loading? style sections]
-  [:div.reveal {:style style}
-   (when loading?
-     [:div.ls-center (ui/loading "")])
-   [:div.slides
-    (for [[idx sections] (medley/indexed sections)]
-      (if (> (count sections) 1)       ; nested
-        [:section {:key (str "slide-section-" idx)}
-         (for [[idx2 [block block-cp]] (medley/indexed sections)]
-           [:section (-> {:key (str "slide-section-" idx "-" idx2)}
+  [:div
+   [:p.text-sm
+    [:span.opacity-70 "Tip: press "]
+    [:code "F"]
+    [:span.opacity-70 " to go fullscreen"]]
+   [:div.reveal {:style style}
+    (when loading?
+      [:div.ls-center (ui/loading "")])
+    [:div.slides
+     (for [[idx sections] (medley/indexed sections)]
+       (if (> (count sections) 1)       ; nested
+         [:section {:key (str "slide-section-" idx)}
+          (for [[idx2 [block block-cp]] (medley/indexed sections)]
+            [:section (-> {:key (str "slide-section-" idx "-" idx2)}
+                          (with-properties block))
+             block-cp])]
+         (let [[block block-cp] (first sections)]
+           [:section (-> {:key (str "slide-section-" idx)}
                          (with-properties block))
-            block-cp])]
-        (let [[block block-cp] (first sections)]
-          [:section (-> {:key (str "slide-section-" idx)}
-                        (with-properties block))
-           block-cp])))]])
+            block-cp])))]]])
 
 (rum/defc slide < rum/reactive
   {:did-mount (fn [state]