minor changes to library files
This commit is contained in:
@@ -4,6 +4,10 @@ import js.library
|
||||
import js.native
|
||||
import java.util.*;
|
||||
|
||||
|
||||
|
||||
val noImpl : Nothing = throw Exception();
|
||||
|
||||
library("println")
|
||||
fun println() {}
|
||||
library("println")
|
||||
|
||||
@@ -84,7 +84,7 @@ class Context() {
|
||||
}
|
||||
|
||||
native
|
||||
class HTMLImageElement() : DomElement() {
|
||||
open class HTMLImageElement() : DomElement() {
|
||||
}
|
||||
|
||||
native
|
||||
@@ -95,8 +95,12 @@ class CanvasGradient() {
|
||||
|
||||
native
|
||||
class Canvas() : DomElement() {
|
||||
val width = 0.0;
|
||||
val height = 0.0;
|
||||
var width = 0.0;
|
||||
var height = 0.0;
|
||||
|
||||
//DOMString toDataURL(in optional DOMString type, in any... args);
|
||||
fun toDataURL() : String = js.noImpl
|
||||
fun toDataURL(typ : String) : String = js.noImpl
|
||||
}
|
||||
|
||||
native
|
||||
@@ -0,0 +1,25 @@
|
||||
package html5
|
||||
|
||||
import js.Exception
|
||||
import js.native
|
||||
import js.DomElement
|
||||
import html5.files.FileList
|
||||
|
||||
native
|
||||
class HTMLInputElement() : DomElement() {
|
||||
val files : FileList = js.noImpl
|
||||
var onchange : (HTMLInputElementEvent)->Unit = js.noImpl
|
||||
}
|
||||
|
||||
native
|
||||
class HTMLInputElementEvent() {
|
||||
val target : HTMLInputElement = js.noImpl
|
||||
}
|
||||
|
||||
native
|
||||
class Image() : HTMLImageElement() {
|
||||
var height : Int = js.noImpl
|
||||
var width : Int = js.noImpl
|
||||
var src : String = js.noImpl
|
||||
var onload : ()->Unit = js.noImpl
|
||||
}
|
||||
@@ -30,6 +30,9 @@ class JQuery() {
|
||||
fun dblclick(handler : DomElement.(MouseClickEvent)->Unit) = this;
|
||||
fun click(handler : DomElement.(MouseClickEvent)->Unit) = this;
|
||||
|
||||
fun load(handler : DomElement.()->Unit) = this;
|
||||
fun change(handler : DomElement.()->Unit) = this;
|
||||
|
||||
fun append(str : String) = this;
|
||||
fun ready(handler : ()->Unit) = this;
|
||||
fun text(text : String) = this;
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package org.jetbrains.k2js.config;
|
||||
|
||||
import com.google.common.base.Charsets;
|
||||
import com.google.common.io.Files;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import core.Dummy;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -9,7 +7,10 @@ import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jet.lang.psi.JetFile;
|
||||
import org.jetbrains.k2js.utils.JetFileUtils;
|
||||
|
||||
import java.io.*;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.Reader;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
@@ -33,7 +34,10 @@ public abstract class Config {
|
||||
"/core/math.kt",
|
||||
"/core/json.kt",
|
||||
"/raphael/raphael.kt",
|
||||
"/html5/core.kt"
|
||||
"/html5/canvas.kt",
|
||||
"/html5/files.kt",
|
||||
"/html5/image.kt",
|
||||
"/helper/ip.kt"
|
||||
);
|
||||
|
||||
|
||||
|
||||
@@ -86,6 +86,10 @@ public final class BindingUtils {
|
||||
@NotNull NamespaceDescriptor namespace) {
|
||||
List<JetDeclaration> declarations = new ArrayList<JetDeclaration>();
|
||||
for (DeclarationDescriptor descriptor : namespace.getMemberScope().getAllDescriptors()) {
|
||||
//TODO:
|
||||
if (descriptor instanceof NamespaceDescriptor) {
|
||||
continue;
|
||||
}
|
||||
JetDeclaration declaration = BindingUtils.getDeclarationForDescriptor(bindingContext, descriptor);
|
||||
if (declaration != null) {
|
||||
declarations.add(declaration);
|
||||
|
||||
Reference in New Issue
Block a user