|
板凳
楼主 |
发表于 2015-12-28 13:39:41
|
只看该作者
JS
- var editor1;
- $(function () {
- KindEditor.ready(function(K) {
- editor1 = K.create($("*[id$=_NewsContent]"), {
- filterMode: false, //是否开启过滤模式
- cssPath: ['editor/plugins/code/prettify.css'],
- uploadJson: 'editor/asp.net/upload_json.ashx',
- filePostName: 'imgFile',
- fileManagerJson: 'editor/asp.net/file_manager_json.ashx',
- allowFileManager: true,
- items: ['quickformat', '|', 'undo', 'redo', '|', 'preview', 'print', 'template', 'code', 'cut', 'copy', 'paste',
- 'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
- 'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
- 'superscript', 'clearhtml', 'source', 'selectall', '|', 'fullscreen', '/',
- 'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
- 'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'image', 'multiimage',
- 'insertfile', 'table', 'hr', 'emoticons', 'baidumap', 'pagebreak',
- 'anchor', 'link', 'unlink', '|', 'about'],
- afterCreate: function() {
- var self = this;
- K.ctrl(document, 13, function() {
- self.sync();
- K('form[name=example]')[0].submit();
- });
- K.ctrl(self.edit.doc, 13, function() {
- self.sync();
- K('form[name=example]')[0].submit();
- });
- },
- afterBlur: function() {
- this.sync();
- }
- });
- prettyPrint();
- K($("*[id$=btn_img]")).click(function () {
- editor1.loadPlugin('image', function () {
- editor1.plugin.imageDialog({
- imageUrl: K($("*[id$=url1]")).val(),
- clickFn: function (url, title, width, height, border, align) {
- K($("*[id$=url1]")).val(url);
- editor1.hideDialog();
- }
- });
- });
- });
- });
- $("*[id$=_IsPhoto]").click(function () {
- photoCss();
- });
- });
复制代码
前台
- <f:FormRow>
- <Items>
- <f:Panel ID="Panel1" Layout="Column" CssClass="formitem" ShowHeader="false" ShowBorder="false" runat="server">
- <Items>
- <f:Label ID="Label1" Width="105px" runat="server" CssClass="marginr" ShowLabel="false" Text="文章摘要:">
- </f:Label>
- <f:ContentPanel ID="ContentPanel3" ColumnWidth="100%" runat="server" ShowBorder="false" ShowHeader="false">
- <textarea id = "_NewsContent" runat = "server" name = "content1" style=" width: 920px;height: 450px;"></textarea>
- </f:ContentPanel>
- </Items>
- </f:Panel>
- </Items>
- </f:FormRow>
复制代码 |
|