PageSourceSearch

https://membership.crn.com.au/Resource/Javascript/htmleditor.js

js crn.com.au collected 2026-10-02 02:21:47 UTC 6,119 bytes, 137 lines download raw bytes

1
2function HtmlEditorOpen(element) {
3    var htmlData = $("#" + element + "_Html").html();
4    var buttons = new Array();
5    var buttonsB = new Array();
6
7    htmlData = '<div id="HtmlEditorDisplay" class="htmleditor">' + htmlData + '</div>';
8    buttons.push(new ConfigButtonClass("icon-basesmall-info-w", "Help"));
9    buttonsB.push(new ConfigButtonClass("icon-basesmall-yes-ca", "Save", 'HtmlEditorFinalClose(\'' + element + '\');'));
10    var actionDialog = CreatePopup({ Name: "PopupPanelHtmlEditor", Type: "inline", Content: htmlData });
11
12    actionDialog.panelConfig({
13        title: "Text Editor",
14        titleClass: "",
15        closeButtonType: "on",
16        titleWidth: 250,
17        buttonList: buttons,
18        buttonListBottom: buttonsB,
19        height: 600,
20        width: 800,
21        closeButtonIcon: "icon-basesmall-no-w", // closeButtonIcon: 'icon-base-no-b',                      
22        contentSize: 5,
23        contentHeightOffset: 50,
24        isPopupCreated: true,
25        closeButtonClickEvent: PopupGenClose
26    }).sfPopup({ modalColor: c_wyvernItemSettings.ModalColor });
27
28    $('#HtmlEditorDisplay')
29        .trumbowyg({
30            btns: [
31                ['fontfamily','fontsize'],
32                ['foreColor', 'backColor'],
33                ['strong', 'em'],
34                ['formatting'],
35                ['justifyLeft', 'justifyCenter', 'justifyRight', 'justifyFull'],
36                ['unorderedList', 'orderedList'],
37                ['removeformat']
38
39            ],
40            plugins: {
41                fontfamily: {
42                    fontList: [
43                        { name: 'Arial', family: 'Arial, Helvetica, sans-serif' },
44                        { name: 'Arial Black', family: '&apos;Arial Black&apos;, Gadget, sans-serif' },
45                        { name: 'Comic Sans', family: '\'Comic Sans MS\', Textile, cursive, sans-serif' },
46                        { name: 'Open Sans', family: '\'Open Sans\', sans-serif' },
47                        { name: 'Georgia, serif', family: 'Georgia' },
48                        { name: 'Palatino', family: '&apos;Palatino Linotype&apos;, &apos;Book Antiqua&apos;' },
49                        { name: 'Times New Roman', family: '&apos;Times New Roman&apos;, Times, serif' },
50                        { name: 'Impact', family: 'Impact, Charcoal, sans-serif' },
51                        { name: 'Lucida Sans', family: '&apos;Lucida Sans Unicode&apos;, &apos;Lucida Grande&apos;, sans-serif' },
52                        { name: 'Tahoma', family: 'Tahoma, Geneva, sans-serif' },
53                        { name: 'Trebuchet', family: '&apos;Trebuchet MS&apos;, Helvetica, sans-serif' },
54                        { name: 'Verdana', family: 'Verdana, Geneva, sans-seri' },
55                        { name: 'Courier', family: '&apos;Courier New&apos;, Courier, monospace' },
56                        { name: 'Lucida Console', family: '&apos;Lucida Console&apos;, Monaco, monospace' },
57                        { name: 'Lobster', family: 'lobster, serif' },
58                        { name: 'Orbitron', family: 'orbitron, serif' },
59                        { name: 'Calligraffitti', family: 'calligraffitti, serif' },
60                        { name: 'Luckiest Guy', family: 'luckiestguy, serif' },
61                        { name: 'Permanent Marker', family: 'permanentmarker, serif' },
62                        { name: 'Anton', family: 'anton, serif' },
63                        { name: 'Indie Flower', family: 'indieflower, serif' },
64                        { name: 'Syncopate', family: 'syncopate, serif' },
65                        { name: 'Shadows', family: 'shadows, serif' },
66                        { name: 'Righteous', family: 'righteous, serif' },
67                        { name: 'Bad Script', family: 'badscript, serif' },
68                        { name: 'Medula One', family: 'medulaone, serif' },
69                        { name: 'Condiment', family: 'condiment, serif' },
70                        { name: 'Into Light', family: 'intolight, serif' },
71                        { name: 'Londrina', family: 'londrina, serif' },
72                        { name: 'Griffy', family: 'griffy, serif' },
73                        { name: '>Faster One', family: 'fasterone, serif' },
74                        { name: 'Face One', family: 'fontfaceone, serif' },
75                        { name: 'Face Two', family: 'fontfacetwo, serif' }
76
77                    ]
78                }
79            },
80            colors: {
81                colorList: [
82                    '000000',
83                    'ffffff',
84                    '4DB0FB',
85                    '79ae31',
86                    'ff6937',
87                    'd555ff',
88                    '1F60A0',
89                    '28CC9E',
90                    'FFC107',
91                    '800080',
92                    'FFFF00',
93                    'cccccc',
94                    'e8e8e8',
95                    '4a4a4a',
96                    'FFFFFF00'
97                ]
98            },
99            fontsize: {
100                sizeList: [
101                    '10px',
102                    '12px',
103                    '14px',
104                    '16px',
105                    '18px',
106                    '20px',
107                    '22px',
108                    '24px',
109                    '26px',
110                    '28px',
111                    '30px',
112                    '35px',
113                    '40px',
114                    '45px',
115                    '50px',
116                    '60px',
117                    '70px'
118                ],
119                allowCustomSize: true
120            }
121        });
122}
123
124function HtmlEditorFinalClose(element) {
125    $(".editordiv").removeClass("editordivdisplay");
126    $(".editordiv").removeClass("editordiv");
127
128    var data = $("#HtmlEditorDisplay").html();
129    
130    $("#" + element + "_Html").html(data);
131
132    data = data.replace('class=""', '');
133    data = WyvernHtmlEscape(data);
134    $("#" + element).val(data);
135
136    PopupGenClose("PopupPanelHtmlEditor");
137}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.