aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Jaros <rjaros@finn.pl>2018-03-31 02:37:23 +0200
committerRobert Jaros <rjaros@finn.pl>2018-03-31 02:37:23 +0200
commit64220ea619eb70eb720d29b456ab9b04bf8b04d3 (patch)
tree4414de8eaf23f9cd2de1ca7bedb47f8e9474fa96
parent23ec0310655f036bb9a602d173c1e2a38f3c7073 (diff)
downloadkvision-64220ea619eb70eb720d29b456ab9b04bf8b04d3.tar.gz
kvision-64220ea619eb70eb720d29b456ab9b04bf8b04d3.tar.bz2
kvision-64220ea619eb70eb720d29b456ab9b04bf8b04d3.zip
Make some dependencies optional.
-rw-r--r--build.gradle3
-rw-r--r--npm.dependencies3
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/KVManager.kt11
3 files changed, 11 insertions, 6 deletions
diff --git a/build.gradle b/build.gradle
index d464ff92..f8a24c24 100644
--- a/build.gradle
+++ b/build.gradle
@@ -76,9 +76,6 @@ kotlinFrontend {
dependency("snabbdom", "0.7.1")
dependency("snabbdom-virtualize", "0.7.0")
dependency("navigo", "7.0.0")
- dependency("jquery-resizable-dom", "0.28.0")
- dependency("handlebars", "4.0.11")
- dependency("handlebars-loader")
npmdeps.eachLine { line ->
def (name, version) = line.tokenize(" ")
dependency(name, version)
diff --git a/npm.dependencies b/npm.dependencies
index 42efc32d..4f4fe417 100644
--- a/npm.dependencies
+++ b/npm.dependencies
@@ -6,7 +6,10 @@ bootstrap-datetime-picker 2.4.4
bootstrap-touchspin 3.1.1
font-awesome 4.7.0
font-awesome-webpack 0.0.5-beta.2
+jquery-resizable-dom 0.28.0
awesome-bootstrap-checkbox 0.3.7
trix 0.11.1
element-resize-event 2.0.9
bootstrap-fileinput 4.4.7
+handlebars 4.0.11
+handlebars-loader 1.7.0
diff --git a/src/main/kotlin/pl/treksoft/kvision/KVManager.kt b/src/main/kotlin/pl/treksoft/kvision/KVManager.kt
index ee7b2d43..1d1a3dc7 100644
--- a/src/main/kotlin/pl/treksoft/kvision/KVManager.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/KVManager.kt
@@ -134,10 +134,15 @@ internal object KVManager {
require("bootstrap-fileinput/themes/explorer-fa/theme.min.js")
} catch (e: Throwable) {
}
-
- private val resizable = require("jquery-resizable-dom")
+ private val resizable = try {
+ require("jquery-resizable-dom")
+ } catch (e: Throwable) {
+ }
+ private val handlebars = try {
+ require("handlebars/dist/handlebars.runtime.min.js")
+ } catch (e: Throwable) {
+ }
internal val fecha = require("fecha")
- private val handlebars = require("handlebars/dist/handlebars.runtime.min.js")
private val sdPatch = Snabbdom.init(
arrayOf(
classModule, attributesModule, propsModule, styleModule,