aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/KVManager.kt2
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/form/Form.kt3
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/i18n/I18n.kt2
3 files changed, 5 insertions, 2 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/KVManager.kt b/src/main/kotlin/pl/treksoft/kvision/KVManager.kt
index 40cc1053..80279020 100644
--- a/src/main/kotlin/pl/treksoft/kvision/KVManager.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/KVManager.kt
@@ -47,7 +47,7 @@ external fun require(name: String): dynamic
/**
* Internal singleton object which initializes and configures KVision framework.
*/
-@Suppress("EmptyCatchBlock", "TooGenericExceptionCaught")
+@Suppress("EmptyCatchBlock", "TooGenericExceptionCaught", "LargeClass")
internal object KVManager {
internal const val AJAX_REQUEST_DELAY = 300
internal const val KVNULL = "#kvnull"
diff --git a/src/main/kotlin/pl/treksoft/kvision/form/Form.kt b/src/main/kotlin/pl/treksoft/kvision/form/Form.kt
index 7d429c2e..62d22de9 100644
--- a/src/main/kotlin/pl/treksoft/kvision/form/Form.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/form/Form.kt
@@ -54,7 +54,8 @@ private class FormMapWrapper<out V>(private val map: Map<String, V>) : Map<Strin
override val size: Int get() = map.size
override fun isEmpty(): Boolean = map.isEmpty()
override fun containsKey(key: String): Boolean =
- if (key.indexOf('.') != -1) map.containsKey(key) else !(map.containsKey("$key.time") || map.containsKey("$key.size"))
+ if (key.indexOf('.') != -1) map.containsKey(key) else
+ !(map.containsKey("$key.time") || map.containsKey("$key.size"))
override fun containsValue(value: @UnsafeVariance V): Boolean = map.containsValue(value)
override fun get(key: String): V? = map[key]
diff --git a/src/main/kotlin/pl/treksoft/kvision/i18n/I18n.kt b/src/main/kotlin/pl/treksoft/kvision/i18n/I18n.kt
index ee7bad86..343c18ef 100644
--- a/src/main/kotlin/pl/treksoft/kvision/i18n/I18n.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/i18n/I18n.kt
@@ -66,6 +66,7 @@ object I18n {
Promise.all(promises).then { initCallback() }
}
+ @Suppress("MagicNumber")
private fun readMessages(language: String): Promise<Jed> {
return Promise { resolve, _ ->
val xmlHttpRequest = XMLHttpRequest()
@@ -137,6 +138,7 @@ object I18n {
gettext(text.substring(I18N_SINGLE_DELIMITER.length))
} else if (text.startsWith(I18N_PLURAL_DELIMITER)) {
val tab = text.substring(I18N_PLURAL_DELIMITER.length).split(I18N_PLURAL_DELIMITER)
+ @Suppress("MagicNumber")
if (tab.size == 3) {
ngettext(tab[0], tab[1], tab[2].toIntOrNull() ?: 1)
} else {