comparison src/README.md @ 0:4c4fc447baea

start with sceditor-3.1.1
author Franklin Schmidt <fschmidt@gmail.com>
date Thu, 04 Aug 2022 15:21:29 -0600
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:4c4fc447baea
1 # [SCEditor](http://www.sceditor.com/) v3.1.1
2
3 [![Build Status](https://github.com/samclarke/SCEditor/workflows/Node.js%20CI/badge.svg)](https://travis-ci.org/samclarke/SCEditor)
4 [![SemVer](http://img.shields.io/:semver-✓-brightgreen.svg)](http://semver.org)
5 [![License](http://img.shields.io/npm/l/sceditor.svg)](https://github.com/samclarke/SCEditor/blob/master/LICENSE.md)
6
7 A lightweight WYSIWYG BBCode and XHTML editor.
8
9 [![SCEditor preview](https://cdn.rawgit.com/samclarke/SCEditor/49c696b8/preview.svg)](https://www.sceditor.com/)
10
11 For more information visit [sceditor.com](http://www.sceditor.com/)
12
13
14 ## Usage
15
16 Include the SCEditor JavaScript:
17
18 ```html
19 <link rel="stylesheet" href="minified/themes/default.min.css" />
20 <script src="minified/sceditor.min.js"></script>
21 <script src="minified/formats/bbcode.js"></script>
22 <script src="minified/formats/xhtml.js"></script>
23 ```
24
25 Then to convert a textarea into SCEditor, simply do:
26
27 ```js
28 var textarea = document.getElementById('id-of-textarea');
29
30 sceditor.create(textarea, {
31 format: 'xhtml',
32 style: 'minified/themes/content/default.min.css'
33 });
34 ```
35
36 or for a BBCode WYSIWYG editor do:
37
38 ```js
39 var textarea = document.getElementById('id-of-textarea');
40
41 sceditor.create(textarea, {
42 format: 'bbcode',
43 style: 'minified/themes/content/default.min.css'
44 });
45 ```
46
47 Finally, to get the contents of the editor:
48
49 ```js
50 var textarea = document.getElementById("id-of-textarea");
51
52 sceditor.instance(textarea).val();
53 ```
54
55
56 ## Options
57
58 For a full list of options, see the [options documentation](http://www.sceditor.com/documentation/options/).
59
60
61
62 ## Building and testing
63
64 You will need [Grunt](http://gruntjs.com/) installed to run the build/tests. To install Grunt run:
65
66 ```bash
67 npm install -g grunt-cli
68 ```
69
70 Next, to install the SCEditor dev dependencies run:
71
72 ```bash
73 npm install
74 ```
75
76 That's it! You can now build and test SCEditor with the following commands:
77
78 ```bash
79 # Minify the JS and convert the LESS to CSS
80 grunt build
81
82 # Run the linter, unit tests and coverage
83 grunt test
84
85 # Creates the final distributable ZIP file
86 grunt release
87 ```
88
89 You can also run the dev server to test changes without having to do a full
90 build by running:
91
92 ```bash
93 npm run dev
94 ```
95
96 and then going to http://localhost:9000/tests/
97
98
99 ## Contribute
100
101 Any contributions and/or pull requests would be welcome.
102
103 Themes, translations, bug reports, bug fixes and donations are greatly appreciated.
104
105
106
107 ## Donate
108
109 If you would like to make a donation you can via
110 [PayPal](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=AVJSF5NEETYYG)
111 or via [Flattr](http://flattr.com/thing/400345/SCEditor)
112
113
114
115 ## License
116
117 SCEditor is licensed under the [MIT](/LICENSE.md) license:
118
119
120 Copyright (C) 2011 - 2017 Sam Clarke and contributors – sceditor.com
121
122 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
123
124 The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
125
126 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
127
128
129
130 ## Credits
131
132 **Nomicons: The Full Monty Emoticons by:**
133 Oscar Gruno, aka Nominell v. 2.0 -> oscargruno@mac.com
134 Andy Fedosjeenko, aka Nightwolf -> bobo@animevanguard.com
135
136 **Icons by:**
137 Mark James (http://www.famfamfam.com/lab/icons/silk/)
138 Licensed under the [Creative Commons CC-BY license](http://creativecommons.org/licenses/by/3.0/).