自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

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

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

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

1.百度編輯器ueditor

先新建項(xiàng)目,生成以后在目錄下新建一個(gè)plugins文件夾

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

將項(xiàng)目名/Lib/Action/IndexAction.clas.php添加

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

然后在對(duì)應(yīng)的模版里添加,在<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.         ] 

看需要?jiǎng)h除即可。

最近百度網(wǎng)盤有個(gè)活動(dòng),如果有興趣的朋友可以參加一下,還有個(gè)人收集的一些書(shū)籍

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  ,號(hào)稱最干凈整潔的在線編輯器

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

復(fù)制到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> 

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

一般我就比較喜歡使用這三種編輯器,而且各有特點(diǎn),現(xiàn)在不喜歡fckeditor了,外觀不美觀,而且上傳之類的,容易出問(wèn)題,包括有上傳漏洞。就不說(shuō)了。有興趣的朋友可以加群:252799167一起學(xué)習(xí)進(jìn)

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

責(zé)任編輯:陳四芳 來(lái)源: “尛雷” 博客
相關(guān)推薦

2020-09-18 06:00:51

開(kāi)源Markdown編輯器

2022-01-04 08:16:49

編輯器在線編輯開(kāi)發(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

2013-06-18 01:22:46

CocoStudio工Cocos2d-x

2011-03-22 13:54:57

UbuntuPHP編輯器

2010-05-14 16:23:18

SharePoint 在線編輯

2025-02-05 12:01:35

屬性編輯器Web

2017-03-09 11:45:16

LinuxVim編輯器

2022-12-01 16:59:32

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

2011-04-07 10:42:11

編輯器云計(jì)算

2018-09-25 09:25:11

Vim編輯器命令

2009-10-26 10:47:57

linux vi編輯器

2009-12-04 17:07:49

SlickEdit

2022-05-31 14:46:02

Ruby編碼線上編輯器
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)