From 243901ec106b47399f1b88187ff2ed9e0c0b54d8 Mon Sep 17 00:00:00 2001 From: Alexey Andreev <konsoletyper@gmail.com> Date: Tue, 19 Jun 2018 22:38:21 +0300 Subject: [PATCH] Add more JS API wrappers --- .../teavm/jso/dom/html/HTMLAnchorElement.java | 66 +++++++++++++++++++ .../teavm/jso/dom/html/HTMLScriptElement.java | 56 ++++++++++++++++ .../org/teavm/jso/dom/types/DOMTokenList.java | 36 ++++++++++ 3 files changed, 158 insertions(+) create mode 100644 jso/apis/src/main/java/org/teavm/jso/dom/html/HTMLAnchorElement.java create mode 100644 jso/apis/src/main/java/org/teavm/jso/dom/html/HTMLScriptElement.java create mode 100644 jso/apis/src/main/java/org/teavm/jso/dom/types/DOMTokenList.java diff --git a/jso/apis/src/main/java/org/teavm/jso/dom/html/HTMLAnchorElement.java b/jso/apis/src/main/java/org/teavm/jso/dom/html/HTMLAnchorElement.java new file mode 100644 index 000000000..cd7452888 --- /dev/null +++ b/jso/apis/src/main/java/org/teavm/jso/dom/html/HTMLAnchorElement.java @@ -0,0 +1,66 @@ +/* + * Copyright 2018 Alexey Andreev. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.teavm.jso.dom.html; + +import org.teavm.jso.JSProperty; +import org.teavm.jso.dom.types.DOMTokenList; + +public interface HTMLAnchorElement extends HTMLElement { + @JSProperty + String getHref(); + + @JSProperty + void setHref(String value); + + @JSProperty + String getTarget(); + + @JSProperty + void setTarget(String value); + + @JSProperty + String getRel(); + + @JSProperty + void setRel(String value); + + @JSProperty + DOMTokenList getTokenList(); + + @JSProperty + String getMedia(); + + @JSProperty + void setMedia(String value); + + @JSProperty + String getHreflang(); + + @JSProperty + void setHreflang(String value); + + @JSProperty + String getType(); + + @JSProperty + void setType(String value); + + @JSProperty + String getText(); + + @JSProperty + void setText(String value); +} diff --git a/jso/apis/src/main/java/org/teavm/jso/dom/html/HTMLScriptElement.java b/jso/apis/src/main/java/org/teavm/jso/dom/html/HTMLScriptElement.java new file mode 100644 index 000000000..c2c5f2aff --- /dev/null +++ b/jso/apis/src/main/java/org/teavm/jso/dom/html/HTMLScriptElement.java @@ -0,0 +1,56 @@ +/* + * Copyright 2018 Alexey Andreev. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.teavm.jso.dom.html; + +import org.teavm.jso.JSProperty; + +public interface HTMLScriptElement extends HTMLElement { + @JSProperty + String getSrc(); + + @JSProperty + void setSrc(String value); + + @JSProperty + boolean isAsync(); + + @JSProperty + void setAsync(boolean value); + + @JSProperty + boolean isDefer(); + + @JSProperty + void setDefer(boolean value); + + @JSProperty + String getType(); + + @JSProperty + void setType(String value); + + @JSProperty + String getCharset(); + + @JSProperty + void setCharset(String value); + + @JSProperty + String getText(); + + @JSProperty + void setText(String value); +} diff --git a/jso/apis/src/main/java/org/teavm/jso/dom/types/DOMTokenList.java b/jso/apis/src/main/java/org/teavm/jso/dom/types/DOMTokenList.java new file mode 100644 index 000000000..6f69e6d83 --- /dev/null +++ b/jso/apis/src/main/java/org/teavm/jso/dom/types/DOMTokenList.java @@ -0,0 +1,36 @@ +/* + * Copyright 2018 Alexey Andreev. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.teavm.jso.dom.types; + +import org.teavm.jso.JSIndexer; +import org.teavm.jso.JSObject; +import org.teavm.jso.JSProperty; + +public interface DOMTokenList extends JSObject { + @JSProperty + int getLength(); + + @JSIndexer + String item(int index); + + boolean contains(String token); + + void add(String token); + + void remove(String token); + + boolean toggle(String token); +}