You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ca...@apache.org on 2018/06/08 12:42:18 UTC
[royale-asjs] branch develop updated: remove style methods since we
already have ClassSelectorList and are not used anymore
This is an automated email from the ASF dual-hosted git repository.
carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
The following commit(s) were added to refs/heads/develop by this push:
new d6c8ead remove style methods since we already have ClassSelectorList and are not used anymore
d6c8ead is described below
commit d6c8eade0efd17e2ff9c18956f6bb35886e208b4
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Fri Jun 8 14:42:13 2018 +0200
remove style methods since we already have ClassSelectorList and are not used anymore
---
.../main/royale/org/apache/royale/core/UIBase.as | 1 -
.../apache/royale/utils/cssclasslist/addStyles.as | 62 ----------------------
.../royale/utils/cssclasslist/removeAllStyles.as | 50 -----------------
.../royale/utils/cssclasslist/removeStyles.as | 57 --------------------
.../royale/utils/cssclasslist/toggleStyle.as | 53 ------------------
5 files changed, 223 deletions(-)
diff --git a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/UIBase.as b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/UIBase.as
index fc0b96f..3f00f90 100644
--- a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/UIBase.as
+++ b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/UIBase.as
@@ -38,7 +38,6 @@ package org.apache.royale.core
{
import org.apache.royale.html.util.addElementToWrapper;
import org.apache.royale.utils.CSSUtils;
- import org.apache.royale.utils.cssclasslist.addStyles;
}
/**
diff --git a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/cssclasslist/addStyles.as b/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/cssclasslist/addStyles.as
deleted file mode 100644
index 2d8c1a6..0000000
--- a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/cssclasslist/addStyles.as
+++ /dev/null
@@ -1,62 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You 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.apache.royale.utils.cssclasslist
-{
- import org.apache.royale.core.IUIBase;
-
- /**
- * Add one or more class selectors to the component. If the specified class already
- * exist, the class will not be added.
- *
- * Use of these utility functions should not be mixed with modifying the component's
- * className property at runtime. Also the component's className property will not
- * reflect modifications made with this API.
- *
- * @param component The component that will have selectors added or removed.
- *
- * @param value A String with the style (or list of styles separated by an space) to
- * add to the component.
- *
- * @langversion 3.0
- * @productversion Royale 0.9.3
- * @royaleignorecoercion HTMLElement
- */
- public function addStyles(component:IUIBase, value:String):void
- {
- COMPILE::JS
- {
- var element:HTMLElement = component.element as HTMLElement;
-
- if (value.indexOf(" ") >= 0)
- {
- var classes:Array = value.split(" ");
- //element.classList.add.apply(element.classList, classes); // IE11 has a bug with multiple names
- for each(var clazz:Object in classes)
- {
- element.classList.add(clazz);
- }
- }
- else
- {
- element.classList.add(value);
- }
- }
- }
-
-}
diff --git a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/cssclasslist/removeAllStyles.as b/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/cssclasslist/removeAllStyles.as
deleted file mode 100644
index ad04093..0000000
--- a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/cssclasslist/removeAllStyles.as
+++ /dev/null
@@ -1,50 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You 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.apache.royale.utils.cssclasslist
-{
- COMPILE::JS
- {
- import org.apache.royale.core.WrappedHTMLElement;
- }
-
- /**
- * Removes all styles (class selector names) from the component.
- *
- * This is a low-level operation and may interfere with proper
- * operation of the component.
- *
- * @param element The HTMLElement that will have selectors added or removed.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion Royale 0.9.3
- */
- COMPILE::JS
- public function removeAllStyles(element:WrappedHTMLElement):void
- {
- var classList:DOMTokenList = element.classList;
- var i:int;
- for( i = classList.length -1; i > 0; i-- )
- {
- classList.remove(classList[i]);
- }
- }
-
-}
diff --git a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/cssclasslist/removeStyles.as b/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/cssclasslist/removeStyles.as
deleted file mode 100644
index 968a262..0000000
--- a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/cssclasslist/removeStyles.as
+++ /dev/null
@@ -1,57 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You 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.apache.royale.utils.cssclasslist
-{
- import org.apache.royale.core.IUIBase;
-
- /**
- * Removes one or more styles from the component. Removing a class that does not
- * exist, does not throw any error.
- *
- * Use of these utility functions should not be mixed with modifying the component's
- * className property at runtime. Also the component's className property will not
- * reflect modifications made with this API.
- *
- * @param component The component that will have selectors added or removed.
- *
- * @param value A String with the style (or styles separated by an space) to
- * remove from the component. If the string is empty doesn't perform any action.
- *
- * @langversion 3.0
- * @productversion Royale 0.9.3
- * @royaleignorecoercion HTMLElement
- */
- public function removeStyles(component:IUIBase, value:String):void
- {
- if (value == "") return;
-
- COMPILE::JS
- {
- if (value.indexOf(" ") >= 0)
- {
- var classes:Array = value.split(" ");
- var element:HTMLElement = component.element as HTMLElement
- element.classList.remove.apply(element.classList, classes);
- } else
- {
- component.element.classList.remove(value);
- }
- }
- }
-}
diff --git a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/cssclasslist/toggleStyle.as b/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/cssclasslist/toggleStyle.as
deleted file mode 100644
index 32e45b0..0000000
--- a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/cssclasslist/toggleStyle.as
+++ /dev/null
@@ -1,53 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You 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.apache.royale.utils.cssclasslist
-{
- import org.apache.royale.core.IUIBase;
-
- /**
- * Adds or removes a single style (class selector name).
- *
- * Use of these utility functions should not be mixed with modifying the component's
- * className property at runtime. Also the component's className property will not
- * reflect modifications made with this API.
- *
- * @param component The component that will have selectors added or removed.
- *
- * @param value If the selector name exists it is removed and the return value is false.
- * If the style does not exist, it is added to the element, and the return value is true.
- *
- * @param force A Boolean value that forces the class to be added
- * or removed, regardless of whether or not it already existed.
- *
- * @langversion 3.0
- * @productversion Royale 0.9.3
- */
- public function toggleStyle(component:IUIBase, value:String, force:Boolean = false):Boolean
- {
- COMPILE::JS
- {
- return component.element.classList.toggle(value, force);
- }
- COMPILE::SWF
- {
- // TODO (aharui) SWF Implementation
- return true;
- }
- }
-}
--
To stop receiving notification emails like this one, please contact
carlosrovira@apache.org.