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 eaf2dbd B012: remove highlightcode and hljs classes and use new hljs
@externs class located in Jewel library
eaf2dbd is described below
commit eaf2dbde05a3823e0c148ba806c025eb56388a7a
Author: Carlos Rovira <[email protected]>
AuthorDate: Mon Jun 3 17:34:31 2019 +0200
B012: remove highlightcode and hljs classes and use new hljs @externs class
located in Jewel library
---
...rnal_javascript_libraries_in_Apache_Royale.mxml | 8 +--
.../src/main/royale/hljs.as | 28 -----------
.../src/main/royale/utils/HighlightCode.as | 58 ----------------------
3 files changed, 1 insertion(+), 93 deletions(-)
diff --git
a/examples/blog/BE0012_Using_external_javascript_libraries_in_Apache_Royale/src/main/royale/BE0012_Using_external_javascript_libraries_in_Apache_Royale.mxml
b/examples/blog/BE0012_Using_external_javascript_libraries_in_Apache_Royale/src/main/royale/BE0012_Using_external_javascript_libraries_in_Apache_Royale.mxml
index 9cb6b97..c3d4bc5 100644
---
a/examples/blog/BE0012_Using_external_javascript_libraries_in_Apache_Royale/src/main/royale/BE0012_Using_external_javascript_libraries_in_Apache_Royale.mxml
+++
b/examples/blog/BE0012_Using_external_javascript_libraries_in_Apache_Royale/src/main/royale/BE0012_Using_external_javascript_libraries_in_Apache_Royale.mxml
@@ -25,18 +25,12 @@
<fx:Script>
<![CDATA[
- import utils.HighlightCode;
-
[Bindable]
public var code_txt:String;
public function highLightContent():void
{
- COMPILE::JS
- {
- var highlightCode:HighlightCode = new HighlightCode();
- highlightCode.highlightBlock(sourceCodeMXMLText.element);
- }
+ hljs.highlightBlock(sourceCodeMXMLText.element);
}
]]>
</fx:Script>
diff --git
a/examples/blog/BE0012_Using_external_javascript_libraries_in_Apache_Royale/src/main/royale/hljs.as
b/examples/blog/BE0012_Using_external_javascript_libraries_in_Apache_Royale/src/main/royale/hljs.as
deleted file mode 100644
index 60866b2..0000000
---
a/examples/blog/BE0012_Using_external_javascript_libraries_in_Apache_Royale/src/main/royale/hljs.as
+++ /dev/null
@@ -1,28 +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
-{
- /**
- * @externs
- */
- public class hljs
- {
- public static function highlightBlock(block:Element):void {}
- }
-}
\ No newline at end of file
diff --git
a/examples/blog/BE0012_Using_external_javascript_libraries_in_Apache_Royale/src/main/royale/utils/HighlightCode.as
b/examples/blog/BE0012_Using_external_javascript_libraries_in_Apache_Royale/src/main/royale/utils/HighlightCode.as
deleted file mode 100644
index 849438b..0000000
---
a/examples/blog/BE0012_Using_external_javascript_libraries_in_Apache_Royale/src/main/royale/utils/HighlightCode.as
+++ /dev/null
@@ -1,58 +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 utils
-{
- COMPILE::JS
- {
- import org.apache.royale.core.WrappedHTMLElement;
- }
-
- public class HighlightCode
- {
- /**
- * Code created by Piotr Zarzycki in transpiledactionScript.com
- *
https://github.com/piotrzarzycki21/TranspiledActionScript/blob/examples/Examples/TranspiledActionScriptWebsite/src/utils/Highlight.as
- *
- * <inject_html>
- * <script
src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>
- * <link rel="stylesheet" title="Atom One Dark"
href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/atom-one-dark.min.css">
- * </inject_html>
- */
- public function HighlightCode()
- {
- }
-
- COMPILE::JS
- /**
- * block is the element (WrappedHTMLElement) inside the component (the
<code> tag)
- */
- public function highlightBlock(block:WrappedHTMLElement):void
- {
- // dot access notation using a class hljs created with
@externs
-
- hljs.highlightBlock(block);
-
- // bracket access notation for a diynaimc access
without create additional class
-
- //var hljs:Object = window["hljs"];
- //prevent renaming by compiler
- //hljs["highlightBlock"](block);
- }
- }
-}
\ No newline at end of file