Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Init
- Loading branch information
0 parents
commit e62cff9
Showing
18 changed files
with
5,366 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Copyright (C) 2012 Matthias Schuetz | ||
|
||
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: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
HTMLiveCode | ||
=========== | ||
|
||
## A browser-based editor for real-time HTML/CSS/JS prototyping | ||
|
||
HTMLiveCode is a simple editor which is built on top of HTML, CSS and JavaScript. It was made for the editing of these languages and can be used for rapid prototyping. The editor can be customized in its appearance so there are themes and some other editor options. HTMLiveCode is based on CodeMirror and makes use of JSLint and HTML5's localStorage. | ||
|
||
<img src="http://matthias-schuetz.github.com/htmlivecode/htmlivecode.png" /> | ||
|
||
## Demo | ||
<a href="http://htmlivecode.com/">Click here for a live demonstration.</a> | ||
|
||
## Usage | ||
|
||
After loading all necessary files of the folders "js" and "css" in your main file, HTMLiveCode is available in the global namespace and must be instantiated as an object. You don't need any HTML markup as the editor will be attached to the <body> element. You don't need to specify any options since HTMLiveCode can be started with default settings. The editor should be instantiated when the DOM is ready. For example, use the "DOMContentLoaded" event to make sure that everything has been loaded. | ||
|
||
### Defaults | ||
|
||
```javascript | ||
/* | ||
* HTMLiveCode instantiation (all arguments are optional) | ||
* | ||
* @param Object settings object which contains all options | ||
* settings: | ||
* @param Boolean gutter Toggles gutter and line numbers | ||
* @param Boolean wordWrap Toggles word wrapping | ||
* @param String theme Sets color theme (either "bright" or "dark") | ||
* @param String imageProxyPath Only works when HTMLiveCode is used locally! | ||
* Virtual path prefix for CSS and IMG urls | ||
* (e.g. "C:/Images/") so you can set a "background-image" url | ||
* to "button.png" and it will virtually be routed to | ||
* "file:///C:/Images/button.png" | ||
*/ | ||
|
||
var liveEditor = new HTMLiveCode(settings); | ||
``` | ||
|
||
### Examples | ||
|
||
```javascript | ||
// Default settings | ||
window.addEventListener("DOMContentLoaded", function() { | ||
window.liveEditor = new HTMLiveCode(); | ||
window.liveEditor.init(); | ||
}); | ||
|
||
// Custom options | ||
window.addEventListener("DOMContentLoaded", function() { | ||
window.liveEditor = new HTMLiveCode({ | ||
gutter: false, | ||
wordWrap: false, | ||
theme: "dark", | ||
imageProxyPath: "C:/Images/" // only works when HTMLiveCode is used locally | ||
}); | ||
window.liveEditor.init(); | ||
}); | ||
``` | ||
|
||
## Shortcuts | ||
HTMLiveCode comes with some default shortcuts: | ||
|
||
* **ALT-M:** Toggle menu bar | ||
* **ALT-T:** Toggle theme | ||
* **ALT-I:** Increase font size | ||
* **ALT-O:** Dcrease font size | ||
* **ALT-0:** Reset font size | ||
* **ALT-G:** Toggle gutter | ||
* **ALT-W:** Toggle word wrap | ||
|
||
## Notes | ||
* **Compatibility:** HTMLiveCode was developed with HTML5 in mind. So it works in modern browsers and Internet Explorer from version 9 on. | ||
|
||
## License | ||
|
||
HTMLiveCode is released under the MIT license. |
Oops, something went wrong.