From a8111836a97e33fc8f5adc9a2a11cc5cd2992aa8 Mon Sep 17 00:00:00 2001 From: Aaron Fischer Date: Tue, 28 Mar 2017 12:42:06 +0200 Subject: [PATCH] Rip out all the JS crap and make the bootstrap js work --- Capstanfile | 28 ------ Dockerfile | 2 +- README.md | 21 ---- env/dev/clj/user.clj | 1 - env/dev/clj/yenu/env.clj | 4 +- env/dev/clj/yenu/figwheel.clj | 12 --- env/dev/cljs/yenu/app.cljs | 14 --- env/prod/clj/yenu/env.clj | 4 +- env/prod/cljs/yenu/app.cljs | 7 -- env/test/resources/config.edn | 4 - env/test/resources/logback.xml | 43 -------- project.clj | 80 ++------------- resources/docs/docs.md | 137 -------------------------- resources/public/js/bootstrap.min.js | 7 -- resources/templates/admin/upload.html | 2 +- resources/templates/layout.html | 10 +- src/cljs/yenu/ajax.cljs | 20 ---- src/cljs/yenu/core.cljs | 86 ---------------- test/clj/yenu/test/db/core.clj | 36 ------- test/clj/yenu/test/handler.clj | 13 --- test/cljs/yenu/core_test.cljs | 9 -- test/cljs/yenu/doo_runner.cljs | 6 -- 22 files changed, 17 insertions(+), 529 deletions(-) delete mode 100644 Capstanfile delete mode 100644 README.md delete mode 100644 env/dev/clj/yenu/figwheel.clj delete mode 100644 env/dev/cljs/yenu/app.cljs delete mode 100644 env/prod/cljs/yenu/app.cljs delete mode 100644 env/test/resources/config.edn delete mode 100644 env/test/resources/logback.xml delete mode 100644 resources/docs/docs.md delete mode 100644 resources/public/js/bootstrap.min.js delete mode 100644 src/cljs/yenu/ajax.cljs delete mode 100644 src/cljs/yenu/core.cljs delete mode 100644 test/clj/yenu/test/db/core.clj delete mode 100644 test/clj/yenu/test/handler.clj delete mode 100644 test/cljs/yenu/core_test.cljs delete mode 100644 test/cljs/yenu/doo_runner.cljs diff --git a/Capstanfile b/Capstanfile deleted file mode 100644 index 29c4d94..0000000 --- a/Capstanfile +++ /dev/null @@ -1,28 +0,0 @@ - -# -# Name of the base image. Capstan will download this automatically from -# Cloudius S3 repository. -# -#base: cloudius/osv -base: cloudius/osv-openjdk8 - -# -# The command line passed to OSv to start up the application. -# -cmdline: /java.so -jar /yenu/app.jar - -# -# The command to use to build the application. -# You can use any build tool/command (make/rake/lein/boot) - this runs locally on your machine -# -# For Leiningen, you can use: -#build: lein uberjar -# For Boot, you can use: -#build: boot build - -# -# List of files that are included in the generated image. -# -files: - /yenu/app.jar: ./target/uberjar/yenu.jar - diff --git a/Dockerfile b/Dockerfile index 75fe433..1aa7899 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ FROM java:8-alpine -MAINTAINER Your Name +MAINTAINER Aaron Fischer ADD target/uberjar/yenu.jar /yenu/app.jar diff --git a/README.md b/README.md deleted file mode 100644 index 04f1d90..0000000 --- a/README.md +++ /dev/null @@ -1,21 +0,0 @@ -# yenu - -generated using Luminus version "2.9.11.32" - -FIXME - -## Prerequisites - -You will need [Leiningen][1] 2.0 or above installed. - -[1]: https://github.com/technomancy/leiningen - -## Running - -To start a web server for the application, run: - - lein run - -## License - -Copyright © 2017 FIXME diff --git a/env/dev/clj/user.clj b/env/dev/clj/user.clj index c9d1888..436b6c9 100644 --- a/env/dev/clj/user.clj +++ b/env/dev/clj/user.clj @@ -1,6 +1,5 @@ (ns user (:require [mount.core :as mount] - [yenu.figwheel :refer [start-fw stop-fw cljs]] yenu.core)) (defn start [] diff --git a/env/dev/clj/yenu/env.clj b/env/dev/clj/yenu/env.clj index 82154df..e7794d9 100644 --- a/env/dev/clj/yenu/env.clj +++ b/env/dev/clj/yenu/env.clj @@ -7,8 +7,8 @@ {:init (fn [] (parser/cache-off!) - (log/info "\n-=[yenu started successfully using the development profile]=-")) + (log/info "\n== yenu started successfully using the development profile.")) :stop (fn [] - (log/info "\n-=[yenu has shut down successfully]=-")) + (log/info "\n== yenu has shut down successfully")) :middleware wrap-dev}) diff --git a/env/dev/clj/yenu/figwheel.clj b/env/dev/clj/yenu/figwheel.clj deleted file mode 100644 index d25cd94..0000000 --- a/env/dev/clj/yenu/figwheel.clj +++ /dev/null @@ -1,12 +0,0 @@ -(ns yenu.figwheel - (:require [figwheel-sidecar.repl-api :as ra])) - -(defn start-fw [] - (ra/start-figwheel!)) - -(defn stop-fw [] - (ra/stop-figwheel!)) - -(defn cljs [] - (ra/cljs-repl)) - diff --git a/env/dev/cljs/yenu/app.cljs b/env/dev/cljs/yenu/app.cljs deleted file mode 100644 index 5a78f30..0000000 --- a/env/dev/cljs/yenu/app.cljs +++ /dev/null @@ -1,14 +0,0 @@ -(ns ^:figwheel-no-load yenu.app - (:require [yenu.core :as core] - [devtools.core :as devtools] - [figwheel.client :as figwheel :include-macros true])) - -(enable-console-print!) - -(figwheel/watch-and-reload - :websocket-url "ws://localhost:3449/figwheel-ws" - :on-jsload core/mount-components) - -(devtools/install!) - -(core/init!) diff --git a/env/prod/clj/yenu/env.clj b/env/prod/clj/yenu/env.clj index c9879e4..e2a8989 100644 --- a/env/prod/clj/yenu/env.clj +++ b/env/prod/clj/yenu/env.clj @@ -4,8 +4,8 @@ (def defaults {:init (fn [] - (log/info "\n-=[yenu started successfully]=-")) + (log/info "\n== yenu started successfully")) :stop (fn [] - (log/info "\n-=[yenu has shut down successfully]=-")) + (log/info "\n== yenu has shut down successfully")) :middleware identity}) diff --git a/env/prod/cljs/yenu/app.cljs b/env/prod/cljs/yenu/app.cljs deleted file mode 100644 index d253205..0000000 --- a/env/prod/cljs/yenu/app.cljs +++ /dev/null @@ -1,7 +0,0 @@ -(ns yenu.app - (:require [yenu.core :as core])) - -;;ignore println statements in prod -(set! *print-fn* (fn [& _])) - -(core/init!) diff --git a/env/test/resources/config.edn b/env/test/resources/config.edn deleted file mode 100644 index 6f14c22..0000000 --- a/env/test/resources/config.edn +++ /dev/null @@ -1,4 +0,0 @@ -{:dev true - :port 3000 - ;; when :nrepl-port is set the application starts the nREPL server on load - :nrepl-port 7000} diff --git a/env/test/resources/logback.xml b/env/test/resources/logback.xml deleted file mode 100644 index 807263d..0000000 --- a/env/test/resources/logback.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - UTF-8 - %date{ISO8601} [%thread] %-5level %logger{36} - %msg %n - - - - log/yenu.log - - log/yenu.%d{yyyy-MM-dd}.%i.log - - 100MB - - - 30 - - - UTF-8 - %date{ISO8601} [%thread] %-5level %logger{36} - %msg %n - - - - - - - - - - - - - - - - - - - diff --git a/project.clj b/project.clj index 6fe8e51..5b4d0aa 100644 --- a/project.clj +++ b/project.clj @@ -2,8 +2,7 @@ :description "yenu -- The image sharing tool for friends" :url "https://aaron-fischer.net/" - :dependencies [[bouncer "1.0.0"] - [cljs-ajax "0.5.8"] + :dependencies [[bouncer "1.0.1"] [compojure "1.5.2"] [conman "0.6.3"] [cprop "0.1.10"] @@ -13,21 +12,18 @@ [metosin/ring-http-response "0.8.1"] [mount "0.1.11"] [org.clojure/clojure "1.8.0"] - [org.clojure/clojurescript "1.9.473" :scope "provided"] [org.clojure/tools.cli "0.3.5"] [org.clojure/tools.logging "0.3.1"] [org.webjars.bower/tether "1.4.0"] + [org.webjars/jquery "3.2.0"] [org.webjars/bootstrap "4.0.0-alpha.6-1"] [org.webjars/font-awesome "4.7.0"] [org.webjars/webjars-locator-jboss-vfs "0.1.0"] [org.xerial/sqlite-jdbc "3.16.1"] - [reagent "0.6.0"] - [reagent-utils "0.2.0"] - [ring-middleware-format "0.7.2"] [ring-webjars "0.1.1"] + [ring-middleware-format "0.7.2"] [ring/ring-core "1.5.1"] [ring/ring-defaults "0.2.3"] - [secretary "1.2.3"] [selmer "1.10.6"] [image-resizer "0.1.9"] [me.raynes/fs "1.4.6"] @@ -48,7 +44,6 @@ :plugins [[lein-cprop "1.0.1"] [migratus-lein "0.4.3"] - [lein-cljsbuild "1.1.4"] [lein-immutant "2.1.0"] [lein-sassc "0.10.4"] [lein-auto "0.1.2"]] @@ -63,82 +58,23 @@ :hooks [leiningen.sassc] :clean-targets ^{:protect false} - [:target-path [:cljsbuild :builds :app :compiler :output-dir] [:cljsbuild :builds :app :compiler :output-to]] - :figwheel - {:http-server-root "public" - :nrepl-port 7002 - :css-dirs ["resources/public/css"] - :nrepl-middleware [cemerick.piggieback/wrap-cljs-repl]} - + [:target-path [:builds :app :compiler :output-dir] [:builds :app :compiler :output-to]] :profiles {:uberjar {:omit-source true - :prep-tasks ["compile" ["cljsbuild" "once" "min"]] - :cljsbuild - {:builds - {:min - {:source-paths ["src/cljc" "src/cljs" "env/prod/cljs"] - :compiler - {:output-to "target/cljsbuild/public/js/app.js" - :optimizations :advanced - :pretty-print false - :closure-warnings - {:externs-validation :off :non-standard-jsdoc :off} - :externs ["react/externs/react.js"]}}}} - - :aot :all :uberjar-name "yenu.jar" :source-paths ["env/prod/clj"] :resource-paths ["env/prod/resources"]} :dev [:project/dev :profiles/dev] - :test [:project/dev :project/test :profiles/test] :project/dev {:dependencies [[prone "1.1.4"] [ring/ring-mock "0.3.0"] [ring/ring-devel "1.5.1"] [pjstadig/humane-test-output "0.8.1"] - [binaryage/devtools "0.9.0"] - [com.cemerick/piggieback "0.2.2-SNAPSHOT"] - [doo "0.1.7"] - [figwheel-sidecar "0.5.9"]] - :plugins [[com.jakemccrary/lein-test-refresh "0.18.1"] - [lein-doo "0.1.7"] - [lein-figwheel "0.5.9"] - [org.clojure/clojurescript "1.9.473"]] - :cljsbuild - {:builds - {:app - {:source-paths ["src/cljs" "src/cljc" "env/dev/cljs"] - :compiler - {:main "yenu.app" - :asset-path "/js/out" - :output-to "target/cljsbuild/public/js/app.js" - :output-dir "target/cljsbuild/public/js/out" - :source-map true - :optimizations :none - :pretty-print true}}}} - - - - :doo {:build "test"} - :source-paths ["env/dev/clj" "test/clj"] + [binaryage/devtools "0.9.0"]] + :source-paths ["env/dev/clj"] :resource-paths ["env/dev/resources"] - :repl-options {:init-ns user} - :injections [(require 'pjstadig.humane-test-output) - (pjstadig.humane-test-output/activate!)]} - :project/test {:resource-paths ["env/test/resources"] - :cljsbuild - {:builds - {:test - {:source-paths ["src/cljc" "src/cljs" "test/cljs"] - :compiler - {:output-to "target/test.js" - :main "yenu.doo-runner" - :optimizations :whitespace - :pretty-print true}}}} - - } - :profiles/dev {} - :profiles/test {}}) + :repl-options {:init-ns user}} + :profiles/dev {}}) diff --git a/resources/docs/docs.md b/resources/docs/docs.md deleted file mode 100644 index b4b4a6d..0000000 --- a/resources/docs/docs.md +++ /dev/null @@ -1,137 +0,0 @@ -

Congratulations, your Luminus site is ready!

- -This page will help guide you through the first steps of building your site. - -#### Why are you seeing this page? - -The `home-routes` handler in the `yenu.routes.home` namespace -defines the route that invokes the `home-page` function whenever an HTTP -request is made to the `/` URI using the `GET` method. - -``` -(defroutes home-routes - (GET "/" [] - (home-page)) - (GET "/docs" [] - (-> (response/ok (-> "docs/docs.md" io/resource slurp)) - (response/header "Content-Type" "text/plain; charset=utf-8")))) -``` - -The `home-page` function will in turn call the `yenu.layout/render` function -to render the HTML content: - -``` -(defn home-page [] - (layout/render "home.html")) -``` - -The page contains a link to the compiled ClojureScript found in the `target/cljsbuild/public` folder: - -``` -{% script "/js/app.js" %} -``` - -The rest of this page is rendered by ClojureScript found in the `src/cljs/yenu/core.cljs` file. - - - -#### Organizing the routes - -The routes are aggregated and wrapped with middleware in the `yenu.handler` namespace: - -``` -(def app-routes - (routes - (-> #'home-routes - (wrap-routes middleware/wrap-csrf) - (wrap-routes middleware/wrap-formats)) - (route/not-found - (:body - (error-page {:status 404 - :title "page not found"}))))) -``` - -The `app-routes` definition groups all the routes in the application into a single handler. -A default route group is added to handle the `404` case. - -learn more about routing » - -The `home-routes` are wrapped with two middleware functions. The first enables CSRF protection. -The second takes care of serializing and deserializing various encoding formats, such as JSON. - -#### Managing your middleware - -Request middleware functions are located under the `yenu.middleware` namespace. - -This namespace is reserved for any custom middleware for the application. Some default middleware is -already defined here. The middleware is assembled in the `wrap-base` function. - -Middleware used for development is placed in the `yenu.dev-middleware` namespace found in -the `env/dev/clj/` source path. - -learn more about middleware » - -
- -#### Database configuration is required - -If you haven't already, then please follow the steps below to configure your database connection and run the necessary migrations. - -* Create the database for your application. -* Update the connection URL in the `profiles.clj` file with your database name and login. -* Run `lein run migrate` in the root of the project to create the tables. -* Let `mount` know to start the database connection by `require`-ing `yenu.db.core` in some other namespace. -* Restart the application. - -learn more about database access » - -
- -
- -#### SassC libsass command-line compiler is required - -You must have the SassC command-line compiler installed to use this feature. - -Please follow the instructions at: http://github.com/sass/sassc -to install the compiler for your platform. - -#### Usage -Compile your files once: -``` -$ lein sassc once -``` - -To delete all the files generated by lein-sassc: -``` -$ lein sassc clean -``` - -To recompile when any changes are made: - -``` -$ lein auto sassc once -``` - -#### Hooks -The following hooks are supported by lein-sassc: -``` -$ lein compile -$ lein clean -``` - -Because lein-sassc requires a binary to compile Sass, it often won't work on platforms like Heroku which compile the application on their servers. To get around this limitation, commit the generated CSS files and remove - -``` -:hooks [leiningen.sassc] -``` - -from project.clj. - -
- - -#### Need some help? - -Visit the [official documentation](http://www.luminusweb.net/docs) for examples -on how to accomplish common tasks with Luminus. The `#luminus` channel on the [Clojurians Slack](http://clojurians.net/) and [Google Group](https://groups.google.com/forum/#!forum/luminusweb) are both great places to seek help and discuss projects with other users. diff --git a/resources/public/js/bootstrap.min.js b/resources/public/js/bootstrap.min.js deleted file mode 100644 index d9c72df..0000000 --- a/resources/public/js/bootstrap.min.js +++ /dev/null @@ -1,7 +0,0 @@ -/*! - * Bootstrap v4.0.0-alpha.6 (https://getbootstrap.com) - * Copyright 2011-2017 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - */ -if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery. jQuery must be included before Bootstrap's JavaScript.");+function(t){var e=t.fn.jquery.split(" ")[0].split(".");if(e[0]<2&&e[1]<9||1==e[0]&&9==e[1]&&e[2]<1||e[0]>=4)throw new Error("Bootstrap's JavaScript requires at least jQuery v1.9.1 but less than v4.0.0")}(jQuery),+function(){function t(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function e(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=function(){function t(t,e){for(var n=0;nthis._items.length-1||e<0)){if(this._isSliding)return void t(this._element).one(m.SLID,function(){return n.to(e)});if(i===e)return this.pause(),void this.cycle();var o=e>i?p.NEXT:p.PREVIOUS;this._slide(o,this._items[e])}},h.prototype.dispose=function(){t(this._element).off(l),t.removeData(this._element,a),this._items=null,this._config=null,this._element=null,this._interval=null,this._isPaused=null,this._isSliding=null,this._activeElement=null,this._indicatorsElement=null},h.prototype._getConfig=function(n){return n=t.extend({},_,n),r.typeCheckConfig(e,n,g),n},h.prototype._addEventListeners=function(){var e=this;this._config.keyboard&&t(this._element).on(m.KEYDOWN,function(t){return e._keydown(t)}),"hover"!==this._config.pause||"ontouchstart"in document.documentElement||t(this._element).on(m.MOUSEENTER,function(t){return e.pause(t)}).on(m.MOUSELEAVE,function(t){return e.cycle(t)})},h.prototype._keydown=function(t){if(!/input|textarea/i.test(t.target.tagName))switch(t.which){case d:t.preventDefault(),this.prev();break;case f:t.preventDefault(),this.next();break;default:return}},h.prototype._getItemIndex=function(e){return this._items=t.makeArray(t(e).parent().find(v.ITEM)),this._items.indexOf(e)},h.prototype._getItemByDirection=function(t,e){var n=t===p.NEXT,i=t===p.PREVIOUS,o=this._getItemIndex(e),r=this._items.length-1,s=i&&0===o||n&&o===r;if(s&&!this._config.wrap)return e;var a=t===p.PREVIOUS?-1:1,l=(o+a)%this._items.length;return l===-1?this._items[this._items.length-1]:this._items[l]},h.prototype._triggerSlideEvent=function(e,n){var i=t.Event(m.SLIDE,{relatedTarget:e,direction:n});return t(this._element).trigger(i),i},h.prototype._setActiveIndicatorElement=function(e){if(this._indicatorsElement){t(this._indicatorsElement).find(v.ACTIVE).removeClass(E.ACTIVE);var n=this._indicatorsElement.children[this._getItemIndex(e)];n&&t(n).addClass(E.ACTIVE)}},h.prototype._slide=function(e,n){var i=this,o=t(this._element).find(v.ACTIVE_ITEM)[0],s=n||o&&this._getItemByDirection(e,o),a=Boolean(this._interval),l=void 0,h=void 0,c=void 0;if(e===p.NEXT?(l=E.LEFT,h=E.NEXT,c=p.LEFT):(l=E.RIGHT,h=E.PREV,c=p.RIGHT),s&&t(s).hasClass(E.ACTIVE))return void(this._isSliding=!1);var d=this._triggerSlideEvent(s,c);if(!d.isDefaultPrevented()&&o&&s){this._isSliding=!0,a&&this.pause(),this._setActiveIndicatorElement(s);var f=t.Event(m.SLID,{relatedTarget:s,direction:c});r.supportsTransitionEnd()&&t(this._element).hasClass(E.SLIDE)?(t(s).addClass(h),r.reflow(s),t(o).addClass(l),t(s).addClass(l),t(o).one(r.TRANSITION_END,function(){t(s).removeClass(l+" "+h).addClass(E.ACTIVE),t(o).removeClass(E.ACTIVE+" "+h+" "+l),i._isSliding=!1,setTimeout(function(){return t(i._element).trigger(f)},0)}).emulateTransitionEnd(u)):(t(o).removeClass(E.ACTIVE),t(s).addClass(E.ACTIVE),this._isSliding=!1,t(this._element).trigger(f)),a&&this.cycle()}},h._jQueryInterface=function(e){return this.each(function(){var n=t(this).data(a),o=t.extend({},_,t(this).data());"object"===("undefined"==typeof e?"undefined":i(e))&&t.extend(o,e);var r="string"==typeof e?e:o.slide;if(n||(n=new h(this,o),t(this).data(a,n)),"number"==typeof e)n.to(e);else if("string"==typeof r){if(void 0===n[r])throw new Error('No method named "'+r+'"');n[r]()}else o.interval&&(n.pause(),n.cycle())})},h._dataApiClickHandler=function(e){var n=r.getSelectorFromElement(this);if(n){var i=t(n)[0];if(i&&t(i).hasClass(E.CAROUSEL)){var o=t.extend({},t(i).data(),t(this).data()),s=this.getAttribute("data-slide-to");s&&(o.interval=!1),h._jQueryInterface.call(t(i),o),s&&t(i).data(a).to(s),e.preventDefault()}}},o(h,null,[{key:"VERSION",get:function(){return s}},{key:"Default",get:function(){return _}}]),h}();return t(document).on(m.CLICK_DATA_API,v.DATA_SLIDE,T._dataApiClickHandler),t(window).on(m.LOAD_DATA_API,function(){t(v.DATA_RIDE).each(function(){var e=t(this);T._jQueryInterface.call(e,e.data())})}),t.fn[e]=T._jQueryInterface,t.fn[e].Constructor=T,t.fn[e].noConflict=function(){return t.fn[e]=c,T._jQueryInterface},T}(jQuery),function(t){var e="collapse",s="4.0.0-alpha.6",a="bs.collapse",l="."+a,h=".data-api",c=t.fn[e],u=600,d={toggle:!0,parent:""},f={toggle:"boolean",parent:"string"},_={SHOW:"show"+l,SHOWN:"shown"+l,HIDE:"hide"+l,HIDDEN:"hidden"+l,CLICK_DATA_API:"click"+l+h},g={SHOW:"show",COLLAPSE:"collapse",COLLAPSING:"collapsing",COLLAPSED:"collapsed"},p={WIDTH:"width",HEIGHT:"height"},m={ACTIVES:".card > .show, .card > .collapsing",DATA_TOGGLE:'[data-toggle="collapse"]'},E=function(){function l(e,i){n(this,l),this._isTransitioning=!1,this._element=e,this._config=this._getConfig(i),this._triggerArray=t.makeArray(t('[data-toggle="collapse"][href="#'+e.id+'"],'+('[data-toggle="collapse"][data-target="#'+e.id+'"]'))),this._parent=this._config.parent?this._getParent():null,this._config.parent||this._addAriaAndCollapsedClass(this._element,this._triggerArray),this._config.toggle&&this.toggle()}return l.prototype.toggle=function(){t(this._element).hasClass(g.SHOW)?this.hide():this.show()},l.prototype.show=function(){var e=this;if(this._isTransitioning)throw new Error("Collapse is transitioning");if(!t(this._element).hasClass(g.SHOW)){var n=void 0,i=void 0;if(this._parent&&(n=t.makeArray(t(this._parent).find(m.ACTIVES)),n.length||(n=null)),!(n&&(i=t(n).data(a),i&&i._isTransitioning))){var o=t.Event(_.SHOW);if(t(this._element).trigger(o),!o.isDefaultPrevented()){n&&(l._jQueryInterface.call(t(n),"hide"),i||t(n).data(a,null));var s=this._getDimension();t(this._element).removeClass(g.COLLAPSE).addClass(g.COLLAPSING),this._element.style[s]=0,this._element.setAttribute("aria-expanded",!0),this._triggerArray.length&&t(this._triggerArray).removeClass(g.COLLAPSED).attr("aria-expanded",!0),this.setTransitioning(!0);var h=function(){t(e._element).removeClass(g.COLLAPSING).addClass(g.COLLAPSE).addClass(g.SHOW),e._element.style[s]="",e.setTransitioning(!1),t(e._element).trigger(_.SHOWN)};if(!r.supportsTransitionEnd())return void h();var c=s[0].toUpperCase()+s.slice(1),d="scroll"+c;t(this._element).one(r.TRANSITION_END,h).emulateTransitionEnd(u),this._element.style[s]=this._element[d]+"px"}}}},l.prototype.hide=function(){var e=this;if(this._isTransitioning)throw new Error("Collapse is transitioning");if(t(this._element).hasClass(g.SHOW)){var n=t.Event(_.HIDE);if(t(this._element).trigger(n),!n.isDefaultPrevented()){var i=this._getDimension(),o=i===p.WIDTH?"offsetWidth":"offsetHeight";this._element.style[i]=this._element[o]+"px",r.reflow(this._element),t(this._element).addClass(g.COLLAPSING).removeClass(g.COLLAPSE).removeClass(g.SHOW),this._element.setAttribute("aria-expanded",!1),this._triggerArray.length&&t(this._triggerArray).addClass(g.COLLAPSED).attr("aria-expanded",!1),this.setTransitioning(!0);var s=function(){e.setTransitioning(!1),t(e._element).removeClass(g.COLLAPSING).addClass(g.COLLAPSE).trigger(_.HIDDEN)};return this._element.style[i]="",r.supportsTransitionEnd()?void t(this._element).one(r.TRANSITION_END,s).emulateTransitionEnd(u):void s()}}},l.prototype.setTransitioning=function(t){this._isTransitioning=t},l.prototype.dispose=function(){t.removeData(this._element,a),this._config=null,this._parent=null,this._element=null,this._triggerArray=null,this._isTransitioning=null},l.prototype._getConfig=function(n){return n=t.extend({},d,n),n.toggle=Boolean(n.toggle),r.typeCheckConfig(e,n,f),n},l.prototype._getDimension=function(){var e=t(this._element).hasClass(p.WIDTH);return e?p.WIDTH:p.HEIGHT},l.prototype._getParent=function(){var e=this,n=t(this._config.parent)[0],i='[data-toggle="collapse"][data-parent="'+this._config.parent+'"]';return t(n).find(i).each(function(t,n){e._addAriaAndCollapsedClass(l._getTargetFromElement(n),[n])}),n},l.prototype._addAriaAndCollapsedClass=function(e,n){if(e){var i=t(e).hasClass(g.SHOW);e.setAttribute("aria-expanded",i),n.length&&t(n).toggleClass(g.COLLAPSED,!i).attr("aria-expanded",i)}},l._getTargetFromElement=function(e){var n=r.getSelectorFromElement(e);return n?t(n)[0]:null},l._jQueryInterface=function(e){return this.each(function(){var n=t(this),o=n.data(a),r=t.extend({},d,n.data(),"object"===("undefined"==typeof e?"undefined":i(e))&&e);if(!o&&r.toggle&&/show|hide/.test(e)&&(r.toggle=!1),o||(o=new l(this,r),n.data(a,o)),"string"==typeof e){if(void 0===o[e])throw new Error('No method named "'+e+'"');o[e]()}})},o(l,null,[{key:"VERSION",get:function(){return s}},{key:"Default",get:function(){return d}}]),l}();return t(document).on(_.CLICK_DATA_API,m.DATA_TOGGLE,function(e){e.preventDefault();var n=E._getTargetFromElement(this),i=t(n).data(a),o=i?"toggle":t(this).data();E._jQueryInterface.call(t(n),o)}),t.fn[e]=E._jQueryInterface,t.fn[e].Constructor=E,t.fn[e].noConflict=function(){return t.fn[e]=c,E._jQueryInterface},E}(jQuery),function(t){var e="dropdown",i="4.0.0-alpha.6",s="bs.dropdown",a="."+s,l=".data-api",h=t.fn[e],c=27,u=38,d=40,f=3,_={HIDE:"hide"+a,HIDDEN:"hidden"+a,SHOW:"show"+a,SHOWN:"shown"+a,CLICK:"click"+a,CLICK_DATA_API:"click"+a+l,FOCUSIN_DATA_API:"focusin"+a+l,KEYDOWN_DATA_API:"keydown"+a+l},g={BACKDROP:"dropdown-backdrop",DISABLED:"disabled",SHOW:"show"},p={BACKDROP:".dropdown-backdrop",DATA_TOGGLE:'[data-toggle="dropdown"]',FORM_CHILD:".dropdown form",ROLE_MENU:'[role="menu"]',ROLE_LISTBOX:'[role="listbox"]',NAVBAR_NAV:".navbar-nav",VISIBLE_ITEMS:'[role="menu"] li:not(.disabled) a, [role="listbox"] li:not(.disabled) a'},m=function(){function e(t){n(this,e),this._element=t,this._addEventListeners()}return e.prototype.toggle=function(){if(this.disabled||t(this).hasClass(g.DISABLED))return!1;var n=e._getParentFromElement(this),i=t(n).hasClass(g.SHOW);if(e._clearMenus(),i)return!1;if("ontouchstart"in document.documentElement&&!t(n).closest(p.NAVBAR_NAV).length){var o=document.createElement("div");o.className=g.BACKDROP,t(o).insertBefore(this),t(o).on("click",e._clearMenus)}var r={relatedTarget:this},s=t.Event(_.SHOW,r);return t(n).trigger(s),!s.isDefaultPrevented()&&(this.focus(),this.setAttribute("aria-expanded",!0),t(n).toggleClass(g.SHOW),t(n).trigger(t.Event(_.SHOWN,r)),!1)},e.prototype.dispose=function(){t.removeData(this._element,s),t(this._element).off(a),this._element=null},e.prototype._addEventListeners=function(){t(this._element).on(_.CLICK,this.toggle)},e._jQueryInterface=function(n){return this.each(function(){var i=t(this).data(s);if(i||(i=new e(this),t(this).data(s,i)),"string"==typeof n){if(void 0===i[n])throw new Error('No method named "'+n+'"');i[n].call(this)}})},e._clearMenus=function(n){if(!n||n.which!==f){var i=t(p.BACKDROP)[0];i&&i.parentNode.removeChild(i);for(var o=t.makeArray(t(p.DATA_TOGGLE)),r=0;r0&&a--,n.which===d&&adocument.documentElement.clientHeight;!this._isBodyOverflowing&&t&&(this._element.style.paddingLeft=this._scrollbarWidth+"px"),this._isBodyOverflowing&&!t&&(this._element.style.paddingRight=this._scrollbarWidth+"px")},h.prototype._resetAdjustments=function(){this._element.style.paddingLeft="",this._element.style.paddingRight=""},h.prototype._checkScrollbar=function(){this._isBodyOverflowing=document.body.clientWidth=n){var i=this._targets[this._targets.length-1];return void(this._activeTarget!==i&&this._activate(i))}if(this._activeTarget&&t0)return this._activeTarget=null,void this._clear();for(var o=this._offsets.length;o--;){var r=this._activeTarget!==this._targets[o]&&t>=this._offsets[o]&&(void 0===this._offsets[o+1]||t "+g.NAV_LINKS).addClass(_.ACTIVE),t(this._scrollElement).trigger(f.ACTIVATE,{relatedTarget:e})},h.prototype._clear=function(){t(this._selector).filter(g.ACTIVE).removeClass(_.ACTIVE)},h._jQueryInterface=function(e){return this.each(function(){var n=t(this).data(a),o="object"===("undefined"==typeof e?"undefined":i(e))&&e; -if(n||(n=new h(this,o),t(this).data(a,n)),"string"==typeof e){if(void 0===n[e])throw new Error('No method named "'+e+'"');n[e]()}})},o(h,null,[{key:"VERSION",get:function(){return s}},{key:"Default",get:function(){return u}}]),h}();return t(window).on(f.LOAD_DATA_API,function(){for(var e=t.makeArray(t(g.DATA_SPY)),n=e.length;n--;){var i=t(e[n]);m._jQueryInterface.call(i,i.data())}}),t.fn[e]=m._jQueryInterface,t.fn[e].Constructor=m,t.fn[e].noConflict=function(){return t.fn[e]=c,m._jQueryInterface},m}(jQuery),function(t){var e="tab",i="4.0.0-alpha.6",s="bs.tab",a="."+s,l=".data-api",h=t.fn[e],c=150,u={HIDE:"hide"+a,HIDDEN:"hidden"+a,SHOW:"show"+a,SHOWN:"shown"+a,CLICK_DATA_API:"click"+a+l},d={DROPDOWN_MENU:"dropdown-menu",ACTIVE:"active",DISABLED:"disabled",FADE:"fade",SHOW:"show"},f={A:"a",LI:"li",DROPDOWN:".dropdown",LIST:"ul:not(.dropdown-menu), ol:not(.dropdown-menu), nav:not(.dropdown-menu)",FADE_CHILD:"> .nav-item .fade, > .fade",ACTIVE:".active",ACTIVE_CHILD:"> .nav-item > .active, > .active",DATA_TOGGLE:'[data-toggle="tab"], [data-toggle="pill"]',DROPDOWN_TOGGLE:".dropdown-toggle",DROPDOWN_ACTIVE_CHILD:"> .dropdown-menu .active"},_=function(){function e(t){n(this,e),this._element=t}return e.prototype.show=function(){var e=this;if(!(this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE&&t(this._element).hasClass(d.ACTIVE)||t(this._element).hasClass(d.DISABLED))){var n=void 0,i=void 0,o=t(this._element).closest(f.LIST)[0],s=r.getSelectorFromElement(this._element);o&&(i=t.makeArray(t(o).find(f.ACTIVE)),i=i[i.length-1]);var a=t.Event(u.HIDE,{relatedTarget:this._element}),l=t.Event(u.SHOW,{relatedTarget:i});if(i&&t(i).trigger(a),t(this._element).trigger(l),!l.isDefaultPrevented()&&!a.isDefaultPrevented()){s&&(n=t(s)[0]),this._activate(this._element,o);var h=function(){var n=t.Event(u.HIDDEN,{relatedTarget:e._element}),o=t.Event(u.SHOWN,{relatedTarget:i});t(i).trigger(n),t(e._element).trigger(o)};n?this._activate(n,n.parentNode,h):h()}}},e.prototype.dispose=function(){t.removeClass(this._element,s),this._element=null},e.prototype._activate=function(e,n,i){var o=this,s=t(n).find(f.ACTIVE_CHILD)[0],a=i&&r.supportsTransitionEnd()&&(s&&t(s).hasClass(d.FADE)||Boolean(t(n).find(f.FADE_CHILD)[0])),l=function(){return o._transitionComplete(e,s,a,i)};s&&a?t(s).one(r.TRANSITION_END,l).emulateTransitionEnd(c):l(),s&&t(s).removeClass(d.SHOW)},e.prototype._transitionComplete=function(e,n,i,o){if(n){t(n).removeClass(d.ACTIVE);var s=t(n.parentNode).find(f.DROPDOWN_ACTIVE_CHILD)[0];s&&t(s).removeClass(d.ACTIVE),n.setAttribute("aria-expanded",!1)}if(t(e).addClass(d.ACTIVE),e.setAttribute("aria-expanded",!0),i?(r.reflow(e),t(e).addClass(d.SHOW)):t(e).removeClass(d.FADE),e.parentNode&&t(e.parentNode).hasClass(d.DROPDOWN_MENU)){var a=t(e).closest(f.DROPDOWN)[0];a&&t(a).find(f.DROPDOWN_TOGGLE).addClass(d.ACTIVE),e.setAttribute("aria-expanded",!0)}o&&o()},e._jQueryInterface=function(n){return this.each(function(){var i=t(this),o=i.data(s);if(o||(o=new e(this),i.data(s,o)),"string"==typeof n){if(void 0===o[n])throw new Error('No method named "'+n+'"');o[n]()}})},o(e,null,[{key:"VERSION",get:function(){return i}}]),e}();return t(document).on(u.CLICK_DATA_API,f.DATA_TOGGLE,function(e){e.preventDefault(),_._jQueryInterface.call(t(this),"show")}),t.fn[e]=_._jQueryInterface,t.fn[e].Constructor=_,t.fn[e].noConflict=function(){return t.fn[e]=h,_._jQueryInterface},_}(jQuery),function(t){if("undefined"==typeof Tether)throw new Error("Bootstrap tooltips require Tether (http://tether.io/)");var e="tooltip",s="4.0.0-alpha.6",a="bs.tooltip",l="."+a,h=t.fn[e],c=150,u="bs-tether",d={animation:!0,template:'',trigger:"hover focus",title:"",delay:0,html:!1,selector:!1,placement:"top",offset:"0 0",constraints:[],container:!1},f={animation:"boolean",template:"string",title:"(string|element|function)",trigger:"string",delay:"(number|object)",html:"boolean",selector:"(string|boolean)",placement:"(string|function)",offset:"string",constraints:"array",container:"(string|element|boolean)"},_={TOP:"bottom center",RIGHT:"middle left",BOTTOM:"top center",LEFT:"middle right"},g={SHOW:"show",OUT:"out"},p={HIDE:"hide"+l,HIDDEN:"hidden"+l,SHOW:"show"+l,SHOWN:"shown"+l,INSERTED:"inserted"+l,CLICK:"click"+l,FOCUSIN:"focusin"+l,FOCUSOUT:"focusout"+l,MOUSEENTER:"mouseenter"+l,MOUSELEAVE:"mouseleave"+l},m={FADE:"fade",SHOW:"show"},E={TOOLTIP:".tooltip",TOOLTIP_INNER:".tooltip-inner"},v={element:!1,enabled:!1},T={HOVER:"hover",FOCUS:"focus",CLICK:"click",MANUAL:"manual"},I=function(){function h(t,e){n(this,h),this._isEnabled=!0,this._timeout=0,this._hoverState="",this._activeTrigger={},this._isTransitioning=!1,this._tether=null,this.element=t,this.config=this._getConfig(e),this.tip=null,this._setListeners()}return h.prototype.enable=function(){this._isEnabled=!0},h.prototype.disable=function(){this._isEnabled=!1},h.prototype.toggleEnabled=function(){this._isEnabled=!this._isEnabled},h.prototype.toggle=function(e){if(e){var n=this.constructor.DATA_KEY,i=t(e.currentTarget).data(n);i||(i=new this.constructor(e.currentTarget,this._getDelegateConfig()),t(e.currentTarget).data(n,i)),i._activeTrigger.click=!i._activeTrigger.click,i._isWithActiveTrigger()?i._enter(null,i):i._leave(null,i)}else{if(t(this.getTipElement()).hasClass(m.SHOW))return void this._leave(null,this);this._enter(null,this)}},h.prototype.dispose=function(){clearTimeout(this._timeout),this.cleanupTether(),t.removeData(this.element,this.constructor.DATA_KEY),t(this.element).off(this.constructor.EVENT_KEY),t(this.element).closest(".modal").off("hide.bs.modal"),this.tip&&t(this.tip).remove(),this._isEnabled=null,this._timeout=null,this._hoverState=null,this._activeTrigger=null,this._tether=null,this.element=null,this.config=null,this.tip=null},h.prototype.show=function(){var e=this;if("none"===t(this.element).css("display"))throw new Error("Please use show on visible elements");var n=t.Event(this.constructor.Event.SHOW);if(this.isWithContent()&&this._isEnabled){if(this._isTransitioning)throw new Error("Tooltip is transitioning");t(this.element).trigger(n);var i=t.contains(this.element.ownerDocument.documentElement,this.element);if(n.isDefaultPrevented()||!i)return;var o=this.getTipElement(),s=r.getUID(this.constructor.NAME);o.setAttribute("id",s),this.element.setAttribute("aria-describedby",s),this.setContent(),this.config.animation&&t(o).addClass(m.FADE);var a="function"==typeof this.config.placement?this.config.placement.call(this,o,this.element):this.config.placement,l=this._getAttachment(a),c=this.config.container===!1?document.body:t(this.config.container);t(o).data(this.constructor.DATA_KEY,this).appendTo(c),t(this.element).trigger(this.constructor.Event.INSERTED),this._tether=new Tether({attachment:l,element:o,target:this.element,classes:v,classPrefix:u,offset:this.config.offset,constraints:this.config.constraints,addTargetClasses:!1}),r.reflow(o),this._tether.position(),t(o).addClass(m.SHOW);var d=function(){var n=e._hoverState;e._hoverState=null,e._isTransitioning=!1,t(e.element).trigger(e.constructor.Event.SHOWN),n===g.OUT&&e._leave(null,e)};if(r.supportsTransitionEnd()&&t(this.tip).hasClass(m.FADE))return this._isTransitioning=!0,void t(this.tip).one(r.TRANSITION_END,d).emulateTransitionEnd(h._TRANSITION_DURATION);d()}},h.prototype.hide=function(e){var n=this,i=this.getTipElement(),o=t.Event(this.constructor.Event.HIDE);if(this._isTransitioning)throw new Error("Tooltip is transitioning");var s=function(){n._hoverState!==g.SHOW&&i.parentNode&&i.parentNode.removeChild(i),n.element.removeAttribute("aria-describedby"),t(n.element).trigger(n.constructor.Event.HIDDEN),n._isTransitioning=!1,n.cleanupTether(),e&&e()};t(this.element).trigger(o),o.isDefaultPrevented()||(t(i).removeClass(m.SHOW),this._activeTrigger[T.CLICK]=!1,this._activeTrigger[T.FOCUS]=!1,this._activeTrigger[T.HOVER]=!1,r.supportsTransitionEnd()&&t(this.tip).hasClass(m.FADE)?(this._isTransitioning=!0,t(i).one(r.TRANSITION_END,s).emulateTransitionEnd(c)):s(),this._hoverState="")},h.prototype.isWithContent=function(){return Boolean(this.getTitle())},h.prototype.getTipElement=function(){return this.tip=this.tip||t(this.config.template)[0]},h.prototype.setContent=function(){var e=t(this.getTipElement());this.setElementContent(e.find(E.TOOLTIP_INNER),this.getTitle()),e.removeClass(m.FADE+" "+m.SHOW),this.cleanupTether()},h.prototype.setElementContent=function(e,n){var o=this.config.html;"object"===("undefined"==typeof n?"undefined":i(n))&&(n.nodeType||n.jquery)?o?t(n).parent().is(e)||e.empty().append(n):e.text(t(n).text()):e[o?"html":"text"](n)},h.prototype.getTitle=function(){var t=this.element.getAttribute("data-original-title");return t||(t="function"==typeof this.config.title?this.config.title.call(this.element):this.config.title),t},h.prototype.cleanupTether=function(){this._tether&&this._tether.destroy()},h.prototype._getAttachment=function(t){return _[t.toUpperCase()]},h.prototype._setListeners=function(){var e=this,n=this.config.trigger.split(" ");n.forEach(function(n){if("click"===n)t(e.element).on(e.constructor.Event.CLICK,e.config.selector,function(t){return e.toggle(t)});else if(n!==T.MANUAL){var i=n===T.HOVER?e.constructor.Event.MOUSEENTER:e.constructor.Event.FOCUSIN,o=n===T.HOVER?e.constructor.Event.MOUSELEAVE:e.constructor.Event.FOCUSOUT;t(e.element).on(i,e.config.selector,function(t){return e._enter(t)}).on(o,e.config.selector,function(t){return e._leave(t)})}t(e.element).closest(".modal").on("hide.bs.modal",function(){return e.hide()})}),this.config.selector?this.config=t.extend({},this.config,{trigger:"manual",selector:""}):this._fixTitle()},h.prototype._fixTitle=function(){var t=i(this.element.getAttribute("data-original-title"));(this.element.getAttribute("title")||"string"!==t)&&(this.element.setAttribute("data-original-title",this.element.getAttribute("title")||""),this.element.setAttribute("title",""))},h.prototype._enter=function(e,n){var i=this.constructor.DATA_KEY;return n=n||t(e.currentTarget).data(i),n||(n=new this.constructor(e.currentTarget,this._getDelegateConfig()),t(e.currentTarget).data(i,n)),e&&(n._activeTrigger["focusin"===e.type?T.FOCUS:T.HOVER]=!0),t(n.getTipElement()).hasClass(m.SHOW)||n._hoverState===g.SHOW?void(n._hoverState=g.SHOW):(clearTimeout(n._timeout),n._hoverState=g.SHOW,n.config.delay&&n.config.delay.show?void(n._timeout=setTimeout(function(){n._hoverState===g.SHOW&&n.show()},n.config.delay.show)):void n.show())},h.prototype._leave=function(e,n){var i=this.constructor.DATA_KEY;if(n=n||t(e.currentTarget).data(i),n||(n=new this.constructor(e.currentTarget,this._getDelegateConfig()),t(e.currentTarget).data(i,n)),e&&(n._activeTrigger["focusout"===e.type?T.FOCUS:T.HOVER]=!1),!n._isWithActiveTrigger())return clearTimeout(n._timeout),n._hoverState=g.OUT,n.config.delay&&n.config.delay.hide?void(n._timeout=setTimeout(function(){n._hoverState===g.OUT&&n.hide()},n.config.delay.hide)):void n.hide()},h.prototype._isWithActiveTrigger=function(){for(var t in this._activeTrigger)if(this._activeTrigger[t])return!0;return!1},h.prototype._getConfig=function(n){return n=t.extend({},this.constructor.Default,t(this.element).data(),n),n.delay&&"number"==typeof n.delay&&(n.delay={show:n.delay,hide:n.delay}),r.typeCheckConfig(e,n,this.constructor.DefaultType),n},h.prototype._getDelegateConfig=function(){var t={};if(this.config)for(var e in this.config)this.constructor.Default[e]!==this.config[e]&&(t[e]=this.config[e]);return t},h._jQueryInterface=function(e){return this.each(function(){var n=t(this).data(a),o="object"===("undefined"==typeof e?"undefined":i(e))&&e;if((n||!/dispose|hide/.test(e))&&(n||(n=new h(this,o),t(this).data(a,n)),"string"==typeof e)){if(void 0===n[e])throw new Error('No method named "'+e+'"');n[e]()}})},o(h,null,[{key:"VERSION",get:function(){return s}},{key:"Default",get:function(){return d}},{key:"NAME",get:function(){return e}},{key:"DATA_KEY",get:function(){return a}},{key:"Event",get:function(){return p}},{key:"EVENT_KEY",get:function(){return l}},{key:"DefaultType",get:function(){return f}}]),h}();return t.fn[e]=I._jQueryInterface,t.fn[e].Constructor=I,t.fn[e].noConflict=function(){return t.fn[e]=h,I._jQueryInterface},I}(jQuery));(function(r){var a="popover",l="4.0.0-alpha.6",h="bs.popover",c="."+h,u=r.fn[a],d=r.extend({},s.Default,{placement:"right",trigger:"click",content:"",template:''}),f=r.extend({},s.DefaultType,{content:"(string|element|function)"}),_={FADE:"fade",SHOW:"show"},g={TITLE:".popover-title",CONTENT:".popover-content"},p={HIDE:"hide"+c,HIDDEN:"hidden"+c,SHOW:"show"+c,SHOWN:"shown"+c,INSERTED:"inserted"+c,CLICK:"click"+c,FOCUSIN:"focusin"+c,FOCUSOUT:"focusout"+c,MOUSEENTER:"mouseenter"+c,MOUSELEAVE:"mouseleave"+c},m=function(s){function u(){return n(this,u),t(this,s.apply(this,arguments))}return e(u,s),u.prototype.isWithContent=function(){return this.getTitle()||this._getContent()},u.prototype.getTipElement=function(){return this.tip=this.tip||r(this.config.template)[0]},u.prototype.setContent=function(){var t=r(this.getTipElement());this.setElementContent(t.find(g.TITLE),this.getTitle()),this.setElementContent(t.find(g.CONTENT),this._getContent()),t.removeClass(_.FADE+" "+_.SHOW),this.cleanupTether()},u.prototype._getContent=function(){return this.element.getAttribute("data-content")||("function"==typeof this.config.content?this.config.content.call(this.element):this.config.content)},u._jQueryInterface=function(t){return this.each(function(){var e=r(this).data(h),n="object"===("undefined"==typeof t?"undefined":i(t))?t:null;if((e||!/destroy|hide/.test(t))&&(e||(e=new u(this,n),r(this).data(h,e)),"string"==typeof t)){if(void 0===e[t])throw new Error('No method named "'+t+'"');e[t]()}})},o(u,null,[{key:"VERSION",get:function(){return l}},{key:"Default",get:function(){return d}},{key:"NAME",get:function(){return a}},{key:"DATA_KEY",get:function(){return h}},{key:"Event",get:function(){return p}},{key:"EVENT_KEY",get:function(){return c}},{key:"DefaultType",get:function(){return f}}]),u}(s);return r.fn[a]=m._jQueryInterface,r.fn[a].Constructor=m,r.fn[a].noConflict=function(){return r.fn[a]=u,m._jQueryInterface},m})(jQuery)}(); \ No newline at end of file diff --git a/resources/templates/admin/upload.html b/resources/templates/admin/upload.html index 75c78fd..da6a554 100644 --- a/resources/templates/admin/upload.html +++ b/resources/templates/admin/upload.html @@ -17,7 +17,7 @@
+ placeholder="Leer lassen für Dateiname">
diff --git a/resources/templates/layout.html b/resources/templates/layout.html index 0864d57..a183257 100644 --- a/resources/templates/layout.html +++ b/resources/templates/layout.html @@ -56,21 +56,17 @@ Fischer, Beatrice Fischer

- - -
- {% style "/assets/bootstrap/css/bootstrap.min.css" %} {% style "/assets/font-awesome/css/font-awesome.min.css" %} {% style "/css/screen.css" %} - - {% script "/js/app.js" %} - {% script "/js/bootstrap.min.js" %} + + {% script "/assets/jquery/jquery.min.js" %} + {% script "/assets/bootstrap/js/bootstrap.min.js" %} diff --git a/src/cljs/yenu/ajax.cljs b/src/cljs/yenu/ajax.cljs deleted file mode 100644 index 06d8c55..0000000 --- a/src/cljs/yenu/ajax.cljs +++ /dev/null @@ -1,20 +0,0 @@ -(ns yenu.ajax - (:require [ajax.core :as ajax])) - -(defn local-uri? [{:keys [uri]}] - (not (re-find #"^\w+?://" uri))) - -(defn default-headers [request] - (if (local-uri? request) - (-> request - (update :uri #(str js/context %)) - (update :headers #(merge {"x-csrf-token" js/csrfToken} %))) - request)) - -(defn load-interceptors! [] - (swap! ajax/default-interceptors - conj - (ajax/to-interceptor {:name "default headers" - :request default-headers}))) - - diff --git a/src/cljs/yenu/core.cljs b/src/cljs/yenu/core.cljs deleted file mode 100644 index 841bfc7..0000000 --- a/src/cljs/yenu/core.cljs +++ /dev/null @@ -1,86 +0,0 @@ -(ns yenu.core - (:require [reagent.core :as r] - [reagent.session :as session] - [secretary.core :as secretary :include-macros true] - [goog.events :as events] - [goog.history.EventType :as HistoryEventType] - [yenu.ajax :refer [load-interceptors!]] - [ajax.core :refer [GET POST]]) - (:import goog.History)) - -(defn nav-link [uri title page collapsed?] - [:li.nav-item - {:class (when (= page (session/get :page)) "active")} - [:a.nav-link - {:href uri - :on-click #(reset! collapsed? true)} title]]) - -(defn navbar [] - (let [collapsed? (r/atom true)] - (fn [] - [:nav.navbar.navbar-dark.bg-primary - [:button.navbar-toggler.hidden-sm-up - {:on-click #(swap! collapsed? not)} "☰"] - [:div.collapse.navbar-toggleable-xs - (when-not @collapsed? {:class "in"}) - [:a.navbar-brand {:href "#/"} "yenu"] - [:ul.nav.navbar-nav - [nav-link "#/" "Home" :home collapsed?] - [nav-link "#/about" "About" :about collapsed?]]]]))) - -(defn about-page [] - [:div.container - [:div.row - [:div.col-md-12 - [:img {:src (str js/context "/img/warning_clojure.png")}]]]]) - -(defn home-page [] - [:div.container - (when-let [docs (session/get :docs)] - [:div.row>div.col-sm-12 - [:div {:dangerouslySetInnerHTML - {:__html "test"}}]])]) - -(def pages - {:home #'home-page - :about #'about-page}) - -(defn page [] - [(pages (session/get :page))]) - -;; ------------------------- -;; Routes -(secretary/set-config! :prefix "#") - -(secretary/defroute "/" [] - (session/put! :page :home)) - -(secretary/defroute "/about" [] - (session/put! :page :about)) - -;; ------------------------- -;; History -;; must be called after routes have been defined -(defn hook-browser-navigation! [] - (doto (History.) - (events/listen - HistoryEventType/NAVIGATE - (fn [event] - (secretary/dispatch! (.-token event)))) - (.setEnabled true))) - -;; ------------------------- -;; Initialize app -(defn fetch-docs! [] - (GET "/docs" {:handler #(session/put! :docs %)})) - -(defn mount-components [] - (r/render [#'navbar] (.getElementById js/document "navbar")) - (r/render [#'page] (.getElementById js/document "app"))) - -(defn init! [] - ;; (load-interceptors!) - ;; (fetch-docs!) - ;; (hook-browser-navigation!) - ;; (mount-components) - ) diff --git a/test/clj/yenu/test/db/core.clj b/test/clj/yenu/test/db/core.clj deleted file mode 100644 index cf91630..0000000 --- a/test/clj/yenu/test/db/core.clj +++ /dev/null @@ -1,36 +0,0 @@ -(ns yenu.test.db.core - (:require [yenu.db.core :refer [*db*] :as db] - [luminus-migrations.core :as migrations] - [clojure.test :refer :all] - [clojure.java.jdbc :as jdbc] - [yenu.config :refer [env]] - [mount.core :as mount])) - -(use-fixtures - :once - (fn [f] - (mount/start - #'yenu.config/env - #'yenu.db.core/*db*) - (migrations/migrate ["migrate"] (select-keys env [:database-url])) - (f))) - -(deftest test-users - (jdbc/with-db-transaction [t-conn *db*] - (jdbc/db-set-rollback-only! t-conn) - (is (= 1 (db/create-user! - t-conn - {:id "1" - :first_name "Sam" - :last_name "Smith" - :email "sam.smith@example.com" - :pass "pass"}))) - (is (= {:id "1" - :first_name "Sam" - :last_name "Smith" - :email "sam.smith@example.com" - :pass "pass" - :admin nil - :last_login nil - :is_active nil} - (db/get-user t-conn {:id "1"}))))) diff --git a/test/clj/yenu/test/handler.clj b/test/clj/yenu/test/handler.clj deleted file mode 100644 index 364cb2d..0000000 --- a/test/clj/yenu/test/handler.clj +++ /dev/null @@ -1,13 +0,0 @@ -(ns yenu.test.handler - (:require [clojure.test :refer :all] - [ring.mock.request :refer :all] - [yenu.handler :refer :all])) - -(deftest test-app - (testing "main route" - (let [response ((app) (request :get "/"))] - (is (= 200 (:status response))))) - - (testing "not-found route" - (let [response ((app) (request :get "/invalid"))] - (is (= 404 (:status response)))))) diff --git a/test/cljs/yenu/core_test.cljs b/test/cljs/yenu/core_test.cljs deleted file mode 100644 index acd66f5..0000000 --- a/test/cljs/yenu/core_test.cljs +++ /dev/null @@ -1,9 +0,0 @@ -(ns yenu.core-test - (:require [cljs.test :refer-macros [is are deftest testing use-fixtures]] - [pjstadig.humane-test-output] - [reagent.core :as reagent :refer [atom]] - [yenu.core :as rc])) - -(deftest test-home - (is (= true true))) - diff --git a/test/cljs/yenu/doo_runner.cljs b/test/cljs/yenu/doo_runner.cljs deleted file mode 100644 index fa9d274..0000000 --- a/test/cljs/yenu/doo_runner.cljs +++ /dev/null @@ -1,6 +0,0 @@ -(ns yenu.doo-runner - (:require [doo.runner :refer-macros [doo-tests]] - [yenu.core-test])) - -(doo-tests 'yenu.core-test) -