From cb003407b28b3bc8c05a443b93025c7856017879 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Wed, 11 May 2016 00:41:00 +0300 Subject: [PATCH] Add download dummy lightbox. --- src/uxbox/ui/workspace.cljs | 1 + src/uxbox/ui/workspace/download.cljs | 47 ++++++++++++++++++++++++++++ src/uxbox/ui/workspace/header.cljs | 11 +++---- 3 files changed, 53 insertions(+), 6 deletions(-) create mode 100644 src/uxbox/ui/workspace/download.cljs diff --git a/src/uxbox/ui/workspace.cljs b/src/uxbox/ui/workspace.cljs index 7538794c3c..a79cbac35f 100644 --- a/src/uxbox/ui/workspace.cljs +++ b/src/uxbox/ui/workspace.cljs @@ -22,6 +22,7 @@ [uxbox.ui.confirm] [uxbox.ui.keyboard :as kbd] [uxbox.ui.workspace.scroll :as scroll] + [uxbox.ui.workspace.download] [uxbox.ui.workspace.base :as wb] [uxbox.ui.workspace.shortcuts :refer (shortcuts-mixin)] [uxbox.ui.workspace.header :refer (header)] diff --git a/src/uxbox/ui/workspace/download.cljs b/src/uxbox/ui/workspace/download.cljs new file mode 100644 index 0000000000..4b4ff612b3 --- /dev/null +++ b/src/uxbox/ui/workspace/download.cljs @@ -0,0 +1,47 @@ +;; This Source Code Form is subject to the terms of the Mozilla Public +;; License, v. 2.0. If a copy of the MPL was not distributed with this +;; file, You can obtain one at http://mozilla.org/MPL/2.0/. +;; +;; Copyright (c) 2016 Andrey Antukh +;; Copyright (c) 2016 Juan de la Cruz + +(ns uxbox.ui.workspace.download + (:require [sablono.core :as html :refer-macros [html]] + [lentes.core :as l] + [rum.core :as rum] + [uxbox.constants :as c] + [uxbox.state :as st] + [uxbox.rstore :as rs] + [uxbox.data.pages :as udp] + [uxbox.data.forms :as udf] + [uxbox.data.workspace :as udw] + [uxbox.data.lightbox :as udl] + [uxbox.ui.icons :as i] + [uxbox.ui.mixins :as mx] + [uxbox.ui.forms :as forms] + [uxbox.ui.lightbox :as lbx] + [uxbox.ui.colorpicker :as uucp] + [uxbox.ui.workspace.base :as wb] + [uxbox.util.dom :as dom] + [uxbox.util.data :refer (parse-int)])) + + +(defn- download-dialog-render + [own] + (html + [:div.lightbox-body.settings + [:h3 "Download Dialog"] + [:p "Content here"] + [:a.close {:href "#" + :on-click #(do (dom/prevent-default %) + (udl/close!))} i/close]])) + +(def download-dialog + (mx/component + {:render download-dialog-render + :name "download-dialog" + :mixins []})) + +(defmethod lbx/render-lightbox :download + [_] + (download-dialog)) diff --git a/src/uxbox/ui/workspace/header.cljs b/src/uxbox/ui/workspace/header.cljs index 2c9b16fa88..1dad5d9961 100644 --- a/src/uxbox/ui/workspace/header.cljs +++ b/src/uxbox/ui/workspace/header.cljs @@ -59,7 +59,8 @@ (defn on-download-clicked [event page] - (let [content (.-innerHTML (.getElementById js/document "page-layout")) + (udl/open! :download) + #_(let [content (.-innerHTML (.getElementById js/document "page-layout")) width (:width page) height (:height page) html (str "" content "") @@ -125,11 +126,9 @@ [:ul.options-btn ;; TODO: refactor [:li.tooltip.tooltip-bottom - {:alt "Export (Ctrl + E)"} - ;; page-title - [:a {:download (str (:name page) ".svg") - :href "#" :on-click on-download-clicked} - i/export]] + {:alt "Export (Ctrl + E)" + :on-click on-download-clicked} + i/export] [:li.tooltip.tooltip-bottom {:alt "Image (Ctrl + I)" :on-click open-confirm-dialog}