|
2 | 2 | <html> |
3 | 3 |
|
4 | 4 | <head> |
5 | | - <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| 5 | + <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
6 | 6 |
|
7 | | - <link href="../../../../styles/helper.css" rel="stylesheet"> |
8 | | - <link href="../../../../styles/siteIcons.css" rel="stylesheet"> |
9 | | - <link rel="stylesheet" href="../assets/control.css"> |
| 7 | + <link href="../../../../styles/helper.css" rel="stylesheet"> |
| 8 | + <link href="../../../../styles/siteIcons.css" rel="stylesheet"> |
10 | 9 |
|
11 | | - <!-- JS --> |
12 | | - <script src="../../../../scripts/buildfire.min.js"></script> |
| 10 | + <!-- build:bundleControlAssetsCSSFiles --> |
| 11 | + <link rel="stylesheet" href="../assets/control.css"> |
| 12 | + <!-- endbuild --> |
13 | 13 |
|
14 | | - <!-- build:bundleSharedJSFiles --> |
15 | | - <script src="../../widget/assets/js/Analytics.js"></script> |
16 | | - <script src="../../widget/assets/js/analyticsKeys.js"></script> |
17 | | - <!-- endbuild --> |
| 14 | + <!-- JS --> |
| 15 | + <script src="../../../../scripts/buildfire.min.js"></script> |
18 | 16 |
|
19 | | - <!-- WYSIWYG --> |
20 | | - <script src="../../../../scripts/tinymce/tinymce.min.js"></script> |
| 17 | + <!-- build:bundleSharedJSFiles --> |
| 18 | + <script src="../../widget/global/js/constants/index.js"></script> |
| 19 | + <script src="../../widget/global/js/models/Setting.js"></script> |
| 20 | + <script src="../../widget/global/js/repositories/Settings.js"></script> |
| 21 | + <script src="../../widget/global/js/services/Analyutics.js"></script> |
| 22 | + <!-- endbuild --> |
21 | 23 |
|
| 24 | + <!-- build:bundleJSFiles --> |
| 25 | + <script src="js/content.controller.js"></script> |
| 26 | + <script src="js/state.js"></script> |
| 27 | + <script src="js/index.js"></script> |
| 28 | + <!-- endbuild --> |
22 | 29 |
|
23 | | - <link href="../../../../styles/control/bf-base.css" rel="stylesheet"> |
24 | | - <script> |
25 | | - Analytics.init(); |
26 | 30 |
|
27 | | - const debounce = (func, wait) => { |
28 | | - let timeout; |
29 | | - function executedFunction(...args) { |
30 | | - const later = () => { |
31 | | - clearTimeout(timeout); |
32 | | - func(...args); |
33 | | - }; |
34 | | - |
35 | | - clearTimeout(timeout); |
36 | | - timeout = setTimeout(later, wait); |
37 | | - }; |
38 | | - executedFunction(); |
39 | | - }; |
40 | | - |
41 | | - tinymce.init({ |
42 | | - selector: "#text", |
43 | | - max_chars: 800, |
44 | | - toolbar: "", |
45 | | - plugins: "", |
46 | | - setup: function (editor) { |
47 | | - var data = {}; |
48 | | - editor.on("load", function () { |
49 | | - buildfire.datastore.get(function (err, obj) { |
50 | | - if (!obj || !obj.data) return; |
51 | | - // This way, we will keep old instances to use PSW navigate by default (so we don't break backward compatibility) and new instances to navigate to CW by default. |
52 | | - if (!Object.keys(obj.data).length) obj.data.navigateToCwByDefault = true; |
53 | | - if (!obj.data.text) obj.data.text = ''; |
54 | | - |
55 | | - data = obj.data; |
56 | | - tinymce.activeEditor.setContent(obj.data.text); |
57 | | - }); |
58 | | - }); |
59 | | - editor.on("keyup", function (saveWithDelay) { |
60 | | - debounce(function () { |
61 | | - data.text = tinymce.activeEditor.getContent(); |
62 | | - save(data); |
63 | | - }, 500); |
64 | | - }); |
65 | | - editor.on("keydown", function (e) { |
66 | | - var whitelistedKeys = [8, 37, 38, 39, 40, 46]; |
67 | | - if (whitelistedKeys.indexOf(e.keyCode) > -1) return true; |
68 | | - if (tinymce_getContentLength() + 1 > this.settings.max_chars) { |
69 | | - e.preventDefault(); |
70 | | - e.stopPropagation(); |
71 | | - return false; |
72 | | - } |
73 | | - return true; |
74 | | - }) |
75 | | - editor.on("change", function (saveWithDelay) { |
76 | | - debounce(function () { |
77 | | - data.text = tinymce.activeEditor.getContent(); |
78 | | - save(data); |
79 | | - }, 500); |
80 | | - }); |
81 | | - function tinymce_getContentLength() { |
82 | | - return tinymce.get(tinymce.activeEditor.id).contentDocument.body.innerText.length; |
83 | | - } |
84 | | - } |
85 | | - }); |
86 | | - </script> |
| 31 | + <script src="../../../../scripts/tinymce/tinymce.min.js"></script> |
| 32 | + <link href="../../../../styles/control/bf-base.css" rel="stylesheet"> |
87 | 33 | </head> |
88 | 34 |
|
89 | | -<body> |
90 | | - <div> |
91 | | - <h1>Introduction</h1> |
92 | | - <textarea id="text" ui-tinymce="editorOptions" class="form-control" rows="5" width="100%" height="300px"></textarea> |
93 | | - |
94 | | - </div> |
95 | | - |
96 | | - |
97 | | - <script> |
98 | | - function save(data) { |
99 | | - buildfire.datastore.save(data, function (err) { |
100 | | - if (err) console.error(err); |
101 | | - }); |
102 | | - } |
103 | | - </script> |
104 | | - |
| 35 | +<body class="hidden"> |
| 36 | + <div> |
| 37 | + <h1>Introduction</h1> |
| 38 | + <textarea id="introduction" class="form-control"></textarea> |
| 39 | + </div> |
105 | 40 | </body> |
106 | 41 |
|
| 42 | + |
107 | 43 | </html> |
0 commit comments