added the dom events API to the kotlin standard library and get it compiling as JS too (not unit tested yet mind you ;)

This commit is contained in:
James Strachan
2012-07-24 14:32:27 +01:00
parent 0ccc0de2fe
commit 7d0b03de76
5 changed files with 66 additions and 32 deletions
+1 -5
View File
@@ -38,12 +38,8 @@ native public trait Event {
}
}
native public trait EventListener {
public fun handleEvent(arg1: Event): Unit = js.noImpl
}
native public trait EventTarget {
public fun dispatchEvent(arg1: Event): Boolean = js.noImpl
public fun dispatchEvent(arg1: Event?): Boolean = js.noImpl
public fun addEventListener(arg1: String?, arg2: EventListener, arg3: Boolean): Unit = js.noImpl
public fun removeEventListener(arg1: String?, arg2: EventListener, arg3: Boolean): Unit = js.noImpl
}
+15
View File
@@ -0,0 +1,15 @@
package org.w3c.dom.events
import org.w3c.dom.*
import org.w3c.dom.views.*
/*
TODO we should maybe update GeneratedJavaScriptStubs.kt to auto-create this file
too so that we can have the implementation code generated for JS
See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib
*/
public trait EventListener {
public fun handleEvent(arg1: Event?): Unit = js.noImpl
}