Advertisement
ichsan_anam

quilljs in apache royale

Mar 3rd, 2021
4,083
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ////////////////////////////////////////////////////////////////////////////////
  2. //
  3. //  Licensed to the Apache Software Foundation (ASF) under one or more
  4. //  contributor license agreements.  See the NOTICE file distributed with
  5. //  this work for additional information regarding copyright ownership.
  6. //  The ASF licenses this file to You under the Apache License, Version 2.0
  7. //  (the "License"); you may not use this file except in compliance with
  8. //  the License.  You may obtain a copy of the License at
  9. //
  10. //      http://www.apache.org/licenses/LICENSE-2.0
  11. //
  12. //  Unless required by applicable law or agreed to in writing, software
  13. //  distributed under the License is distributed on an "AS IS" BASIS,
  14. //  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. //  See the License for the specific language governing permissions and
  16. //  limitations under the License.
  17. //
  18. ////////////////////////////////////////////////////////////////////////////////
  19. package
  20. {
  21.     import org.apache.royale.core.UIBase;
  22.  
  23.     COMPILE::JS {
  24.         import Quill.Editor;
  25.         import Quill.Document;
  26.     }
  27.  
  28.     COMPILE::JS
  29.     public class Quill extends org.apache.royale.core.UIBase
  30.     {
  31.         /**
  32.          * <inject_html>
  33.          * <script src="https://cdn.quilljs.com/1.0.0/quill.js"></script>
  34.          * </inject_html>
  35.          */
  36.         public function Quill()
  37.         {
  38.             super();
  39.         }
  40.  
  41.         private var editor:Editor;         
  42.  
  43.         override public function addedToParent():void
  44.         {
  45.             super.addedToParent();
  46.             editor = quill["edit"](id);
  47.         }
  48.  
  49.         private var _theme:String;
  50.         public function get theme():String
  51.         {
  52.             return _theme;
  53.         }
  54.  
  55.         public function set theme(value:String):void
  56.         {
  57.             _theme = value;
  58.             editor.setTheme(value);
  59.         }
  60.     }
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement