1 | <html> |
---|
2 | <head> |
---|
3 | <title>Test of CSS plugin</title> |
---|
4 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
---|
5 | <script type="text/javascript"> |
---|
6 | _editor_url = "../"; |
---|
7 | _editor_lang = "en"; |
---|
8 | </script> |
---|
9 | |
---|
10 | <!-- load the main HTMLArea files --> |
---|
11 | <script type="text/javascript" src="../htmlarea.js"></script> |
---|
12 | |
---|
13 | <script type="text/javascript"> |
---|
14 | HTMLArea.loadPlugin("CSS"); |
---|
15 | |
---|
16 | function initDocument() { |
---|
17 | var editor = new HTMLArea("editor"); |
---|
18 | editor.config.pageStyle = "@import url(custom.css);"; |
---|
19 | editor.registerPlugin(CSS, { |
---|
20 | combos : [ |
---|
21 | { label: "Syntax", |
---|
22 | // menu text // CSS class |
---|
23 | options: { "None" : "", |
---|
24 | "Code" : "code", |
---|
25 | "String" : "string", |
---|
26 | "Comment" : "comment", |
---|
27 | "Variable name" : "variable-name", |
---|
28 | "Type" : "type", |
---|
29 | "Reference" : "reference", |
---|
30 | "Preprocessor" : "preprocessor", |
---|
31 | "Keyword" : "keyword", |
---|
32 | "Function name" : "function-name", |
---|
33 | "Html tag" : "html-tag", |
---|
34 | "Html italic" : "html-helper-italic", |
---|
35 | "Warning" : "warning", |
---|
36 | "Html bold" : "html-helper-bold" |
---|
37 | }, |
---|
38 | context: "pre" |
---|
39 | }, |
---|
40 | { label: "Info", |
---|
41 | options: { "None" : "", |
---|
42 | "Quote" : "quote", |
---|
43 | "Highlight" : "highlight", |
---|
44 | "Deprecated" : "deprecated" |
---|
45 | } |
---|
46 | } |
---|
47 | ] |
---|
48 | }); |
---|
49 | editor.generate(); |
---|
50 | } |
---|
51 | </script> |
---|
52 | |
---|
53 | </head> |
---|
54 | |
---|
55 | <body onload="initDocument()"> |
---|
56 | <h1>Test of FullPage plugin</h1> |
---|
57 | |
---|
58 | <textarea id="editor" style="height: 30em; width: 100%;" |
---|
59 | ><h1><tt>registerDropdown</tt></h1> |
---|
60 | |
---|
61 | <p>Here's some sample code that adds a dropdown to the toolbar. Go on, do |
---|
62 | syntax highlighting on it ;-)</p> |
---|
63 | |
---|
64 | <pre>var the_options = { |
---|
65 | "Keyword" : "keyword", |
---|
66 | "Function name" : "function-name", |
---|
67 | "String" : "string", |
---|
68 | "Numeric" : "integer", |
---|
69 | "Variable name" : "variable" |
---|
70 | }; |
---|
71 | var css_class = { |
---|
72 | id : "CSS-class", |
---|
73 | tooltip : i18n["tooltip"], |
---|
74 | options : the_options, |
---|
75 | action : function(editor) { self.onSelect(editor, this); } |
---|
76 | }; |
---|
77 | cfg.registerDropdown(css_class); |
---|
78 | toolbar[0].unshift(["CSS-class"]);</pre> |
---|
79 | |
---|
80 | <p>Easy, eh? ;-)</p></textarea> |
---|
81 | |
---|
82 | <hr /> |
---|
83 | <address><a href="http://dynarch.com/mishoo/">Mihai Bazon</a></address> |
---|
84 | <!-- Created: Wed Oct 1 19:55:37 EEST 2003 --> |
---|
85 | <!-- hhmts start --> Last modified: Wed Jan 28 11:10:16 EET 2004 <!-- hhmts end --> |
---|
86 | <!-- doc-lang: English --> |
---|
87 | </body> |
---|
88 | </html> |
---|