• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

matthias-schuetz/HTMLiveCode: A browser-based editor for real-time HTML/CSS/JS p ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

matthias-schuetz/HTMLiveCode

开源软件地址:

https://github.com/matthias-schuetz/HTMLiveCode

开源编程语言:

JavaScript 85.1%

开源软件介绍:

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.

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

/*
 * 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

// 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: Decrease 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.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap