Skip to content

Instantly share code, notes, and snippets.

@SaucyJack
Forked from gist-master/app.html
Created May 30, 2017 19:00
Show Gist options
  • Save SaucyJack/0eb49539f48eca99e3b976d68a42d240 to your computer and use it in GitHub Desktop.
Save SaucyJack/0eb49539f48eca99e3b976d68a42d240 to your computer and use it in GitHub Desktop.
Editor: basic usage
<template>
<require from="aurelia-kendoui-bridge/editor/editor"></require>
<div id="example">
<textarea ak-rich-editor value.bind="bodyContent" style="height:440px">
</textarea>
</div>
</template>
export class BasicUse {
resizable = {
content: true,
toolbar: true
}
bodyContent;
//bodyContent = '<body autocorrect="off" contenteditable="true" class=""> <p><img src="http://demos.telerik.com/kendo-ui/content/web/editor/kendo-ui-web.png" alt="Editor for ASP.NET MVC logo" style="display:block;margin-left:auto;margin-right:auto;"></p> <p> Kendo UI Editor allows your users to edit HTML in a familiar, user-friendly way.<br> In this version, the Editor provides the core HTML editing engine, which includes basic text formatting, hyperlinks, lists, and image handling. The widget <strong>outputs identical HTML</strong> across all major browsers, follows accessibility standards and provides API for content manipulation. </p> <p>Features include:</p> <ul> <li>Text formatting &amp; alignment</li> <li>Bulleted and numbered lists</li> <li>Hyperlink and image dialogs</li> <li>Cross-browser support</li> <li>Identical HTML output across browsers</li> <li>Gracefully degrades to a <code>textarea</code> when JavaScript is turned off</li> </ul> <p> Read <a href="http://docs.telerik.com/kendo-ui">more details</a> or send us your <a href="http://www.telerik.com/forums/">feedback</a>! </p> </body>';
activate(params, routeConfig) {
setTimeout(function() {
this.bodyContent = '<body autocorrect="off" contenteditable="true" class=""> <p><img src="http://demos.telerik.com/kendo-ui/content/web/editor/kendo-ui-web.png" alt="Editor for ASP.NET MVC logo" style="display:block;margin-left:auto;margin-right:auto;"></p> <p> Kendo UI Editor allows your users to edit HTML in a familiar, user-friendly way.<br> In this version, the Editor provides the core HTML editing engine, which includes basic text formatting, hyperlinks, lists, and image handling. The widget <strong>outputs identical HTML</strong> across all major browsers, follows accessibility standards and provides API for content manipulation. </p> <p>Features include:</p> <ul> <li>Text formatting &amp; alignment</li> <li>Bulleted and numbered lists</li> <li>Hyperlink and image dialogs</li> <li>Cross-browser support</li> <li>Identical HTML output across browsers</li> <li>Gracefully degrades to a <code>textarea</code> when JavaScript is turned off</li> </ul> <p> Read <a href="http://docs.telerik.com/kendo-ui">more details</a> or send us your <a href="http://www.telerik.com/forums/">feedback</a>! </p> </body>';
}, 100);
}
}
<!doctype html>
<html>
<head>
<title>Aurelia KendoUI bridge</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2016.2.714/styles/kendo.common.min.css">
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2016.2.714/styles/kendo.rtl.min.css">
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2016.2.714/styles/kendo.default.min.css">
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2016.2.714/styles/kendo.mobile.all.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/bluebird/3.4.0/bluebird.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/chroma-js/1.2.1/chroma.min.js"></script>
<script src="https://kendo.cdn.telerik.com/2016.2.714/js/jquery.min.js"></script>
<script src="https://kendo.cdn.telerik.com/2016.2.714/js/jszip.min.js"></script>
<script src="https://kendo.cdn.telerik.com/2016.2.714/js/kendo.all.min.js"></script>
</head>
<body aurelia-app="main">
<h1>Loading...</h1>
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.6/system.js"></script>
<script src="https://rawgit.com/aurelia-ui-toolkits/aurelia-kendoui-bundles/1.0.0-beta.1.0.6/config2.js"></script>
<script>
System.import('aurelia-bootstrapper');
</script>
</body>
</html>
export function configure(aurelia) {
aurelia.use
.standardConfiguration()
.developmentLogging()
.plugin('aurelia-kendoui-bridge');
aurelia.start().then(a => a.setRoot());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment