偷偷摘套内射激情视频,久久精品99国产国产精,中文字幕无线乱码人妻,中文在线中文a,性爽19p

ThinkPHP整合各大主流在線編輯器的方法

開發(fā) 開發(fā)工具
今天一個客戶要求在編輯器里增加可以拖動圖片的方法,研究了很久,發(fā)現這幾種編輯器只有在ie下才可以拖動圖片大小,包括網易用的編輯器,QQ空間的編輯器,先提前聲明一下。下面進入重點

今天一個客戶要求在編輯器里增加可以拖動圖片的方法,研究了很久,發(fā)現這幾種編輯器只有在ie下才可以拖動圖片大小,包括網易用的編輯器,QQ空間的編輯器,先提前聲明一下。下面進入重點

1.百度編輯器ueditor

先新建項目,生成以后在目錄下新建一個plugins文件夾

然后下載ueditor,地址:http://ueditor.baidu.com/website/download.html,注意編碼。下載以后解壓將整合文件夾放到plugins里,并且改名為ueditor

將項目名/Lib/Action/IndexAction.clas.php添加

  1. class IndexAction extends Action { 
  2.     function index(){ 
  3.         $this->display(); 
  4.     } 

然后在對應的模版里添加,在<head></head>中間添加

  1. <script type="text/javascript" src="/edit/plugins/ueditor/ueditor.config.js"></script>  
  2. <script type="text/javascript" src="/edit/plugins/ueditor/ueditor.all.js"></script> 

在需要的地方添加

  1. <textarea id="myEditor" name="content" style="width:700px;height:300px;">  
  2. </textarea>  
  3. <script type="text/javascript">  
  4.     UE.getEditor('myEditor')  
  5. </script> 

 

  1. toolbars:[ 
  2.             ['fullscreen''source''|''undo''redo''|'
  3.                 'bold''italic''underline''fontborder''strikethrough''superscript''subscript''removeformat''formatmatch''autotypeset''blockquote''pasteplain''|''forecolor''backcolor''insertorderedlist''insertunorderedlist''selectall''cleardoc''|'
  4.                 'rowspacingtop''rowspacingbottom''lineheight''|'
  5.                 'customstyle''paragraph''fontfamily''fontsize''|'
  6.                 'directionalityltr''directionalityrtl''indent''|'
  7.                 'justifyleft''justifycenter''justifyright''justifyjustify''|''touppercase''tolowercase''|'
  8.                 'link''unlink''anchor''|''imagenone''imageleft''imageright''imagecenter''|'
  9.                 'insertimage''emotion''scrawl''insertvideo''music''attachment''map''gmap''insertframe','insertcode''webapp''pagebreak''template''background''|'
  10.                 'horizontal''date''time''spechars''snapscreen''wordimage''|'
  11.                 'inserttable''deletetable''insertparagraphbeforetable''insertrow''deleterow''insertcol''deletecol''mergecells''mergeright''mergedown''splittocells''splittorows''splittocols''|'
  12.                 'print''preview''searchreplace''help'
  13.         ] 

看需要刪除即可。

最近百度網盤有個活動,如果有興趣的朋友可以參加一下,還有個人收集的一些書籍

http://pan.baidu.com/share/link?shareid=3950160737&uk=3826886292

2.kindeditor

下載地址:http://www.kindsoft.net/down.php

解壓改名放到plugins下,

在模版里添加

  1. <script charset="utf-8" src="/edit/plugins/kindeditor/kindeditor.js"></script> 
  2. <script charset="utf-8" src="/edit/plugins/kindeditor/lang/ko.js"></script> 
  3. <script> 
  4.         KindEditor.ready(function(K) { 
  5.                 window.editor = K.create('#editor_id'); 
  6.         });
  1. <textarea id="myEditor" name="content" style="width:700px;height:300px;"> 
  2. </textarea> 

顯示的樣式,自然就是51cto博客編輯器的樣子了。

3.xheditor  ,號稱最干凈整潔的在線編輯器

下載地址:http://xheditor.com/download

復制到plugins下改名

在需要的模版中添加

  1. <script type="text/javascript" src="/edit/plugins/xheditor/jquery/jquery-1.4.4.min.js"></script>  
  2. <script type="text/javascript" src="/edit/plugins/xheditor/xheditor-1.1.14-zh-cn.js"></script> 
  1. <textarea name="content" class="xheditor"></textarea> 

即可,剩下的就是和后端的處理了。

一般我就比較喜歡使用這三種編輯器,而且各有特點,現在不喜歡fckeditor了,外觀不美觀,而且上傳之類的,容易出問題,包括有上傳漏洞。就不說了。有興趣的朋友可以加群:252799167一起學習進

原文鏈接:http://a3147972.blog.51cto.com/2366547/1243384

責任編輯:陳四芳 來源: “尛雷” 博客
相關推薦

2020-09-18 06:00:51

開源Markdown編輯器

2022-01-04 08:16:49

編輯器在線編輯開發(fā)

2024-08-14 08:33:46

前端編輯器

2011-04-21 15:39:26

HTML

2011-01-10 16:17:49

2010-02-23 15:44:24

Python編輯器

2009-06-06 16:10:47

Eclipse RCP屏蔽視圖

2010-03-24 09:20:07

CentOS vi編輯

2022-09-08 09:01:41

CodePenJavaScripCSS

2011-03-22 13:54:57

UbuntuPHP編輯器

2013-06-18 01:22:46

CocoStudio工Cocos2d-x

2017-03-09 11:45:16

LinuxVim編輯器

2025-02-05 12:01:35

屬性編輯器Web

2010-05-14 16:23:18

SharePoint 在線編輯

2018-09-25 09:25:11

Vim編輯器命令

2022-12-01 16:59:32

代碼編輯器開發(fā)前端

2011-04-07 10:42:11

編輯器云計算

2009-10-26 10:47:57

linux vi編輯器

2020-10-14 14:00:39

VIM編輯器

2022-05-31 14:46:02

Ruby編碼線上編輯器
點贊
收藏

51CTO技術棧公眾號