diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main/kotlin/pl/treksoft/kvision/core/KVManager.kt | 16 | ||||
-rw-r--r-- | src/main/kotlin/pl/treksoft/kvision/routing/Routing.kt | 2 | ||||
-rw-r--r-- | src/main/resources/js/bootstrap.config.js | 64 | ||||
-rw-r--r-- | src/main/resources/js/bootstrap.config.less | 0 |
4 files changed, 79 insertions, 3 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/core/KVManager.kt b/src/main/kotlin/pl/treksoft/kvision/core/KVManager.kt index 55c91436..7ca0ce26 100644 --- a/src/main/kotlin/pl/treksoft/kvision/core/KVManager.kt +++ b/src/main/kotlin/pl/treksoft/kvision/core/KVManager.kt @@ -9,15 +9,23 @@ import com.github.snabbdom.eventListenersModule import com.github.snabbdom.propsModule import com.github.snabbdom.styleModule import pl.treksoft.kvision.require +import pl.treksoft.kvision.routing.Routing import pl.treksoft.kvision.routing.routing import kotlin.browser.document import kotlin.dom.clear +external val kvBootstrap: Boolean? + object KVManager { internal const val AJAX_REQUEST_DELAY = 300 internal const val KVNULL = "#kvnull" - private val bootstrapWebpack = require("bootstrap-webpack") + @Suppress("UnsafeCastFromDynamic") + private val bootstrapWebpack = if (js("typeof KV_NO_BOOTSTRAP_CSS !== 'undefined'")) { + require("bootstrap-webpack!./js/bootstrap.config.js") + } else { + require("bootstrap-webpack") + } private val fontAwesomeWebpack = require("font-awesome-webpack") private val resizable = require("jquery-resizable-dom") private val awesomeBootstrapCheckbox = require("awesome-bootstrap-checkbox") @@ -26,7 +34,7 @@ object KVManager { private val bootstrapSelectI18n = require("./js/bootstrap-select-i18n.min.js") private val bootstrapSelectAjaxCss = require("ajax-bootstrap-select/dist/css/ajax-bootstrap-select.min.css") private val bootstrapSelectAjax = require("ajax-bootstrap-select/dist/js/ajax-bootstrap-select.min.js") -// private val bootstrapSelectAjaxI18n = + // private val bootstrapSelectAjaxI18n = // require("ajax-bootstrap-select/dist/js/locale/ajax-bootstrap-select.pl-PL.min.js") private val trixCss = require("trix/dist/trix.css") private val trix = require("trix") @@ -63,6 +71,10 @@ object KVManager { fun init() { } + fun start() { + routing = Routing() + } + fun shutdown() { routing.destroy() } diff --git a/src/main/kotlin/pl/treksoft/kvision/routing/Routing.kt b/src/main/kotlin/pl/treksoft/kvision/routing/Routing.kt index 709f966c..fab8643c 100644 --- a/src/main/kotlin/pl/treksoft/kvision/routing/Routing.kt +++ b/src/main/kotlin/pl/treksoft/kvision/routing/Routing.kt @@ -4,4 +4,4 @@ import pl.treksoft.navigo.Navigo open class Routing : Navigo(null, true, "#!") -val routing = Routing() +var routing = Routing() diff --git a/src/main/resources/js/bootstrap.config.js b/src/main/resources/js/bootstrap.config.js new file mode 100644 index 00000000..906942d1 --- /dev/null +++ b/src/main/resources/js/bootstrap.config.js @@ -0,0 +1,64 @@ +module.exports = { + + // Default for the style loading + styleLoader: 'style-loader!css-loader!less-loader', + + scripts: { + 'transition': true, + 'alert': true, + 'button': true, + 'carousel': true, + 'collapse': true, + 'dropdown': true, + 'modal': true, + 'tooltip': true, + 'popover': true, + 'scrollspy': true, + 'tab': true, + 'affix': true + }, + styles: { + "mixins": false, + + "normalize": false, + "print": false, + + "scaffolding": false, + "type": false, + "code": false, + "grid": false, + "tables": false, + "forms": false, + "buttons": false, + + "component-animations": false, + "glyphicons": false, + "dropdowns": false, + "button-groups": false, + "input-groups": false, + "navs": false, + "navbar": false, + "breadcrumbs": false, + "pagination": false, + "pager": false, + "labels": false, + "badges": false, + "jumbotron": false, + "thumbnails": false, + "alerts": false, + "progress-bars": false, + "media": false, + "list-group": false, + "panels": false, + "wells": false, + "close": false, + + "modals": false, + "tooltip": false, + "popovers": false, + "carousel": false, + + "utilities": false, + "responsive-utilities": false + } +}; diff --git a/src/main/resources/js/bootstrap.config.less b/src/main/resources/js/bootstrap.config.less new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/src/main/resources/js/bootstrap.config.less |