system.js 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182
  1. // 系统自带插件
  2. ( function ( $ ) {
  3. //全屏
  4. $.TE.plugin( "fullscreen", {
  5. fullscreen:function(e){
  6. var $btn = this.$btn,
  7. opt = this.editor.opt;
  8. if($btn.is("."+opt.cssname.fulled)){
  9. //取消全屏
  10. this.editor.$main.removeAttr("style");
  11. this.editor.$bottom.find("div").show();
  12. this.editor.resize(opt.width,opt.height);
  13. $("html,body").css("overflow","auto");
  14. $btn.removeClass(opt.cssname.fulled);
  15. $(window).scrollTop(this.scrolltop);
  16. }else{
  17. //全屏
  18. this.scrolltop=$(window).scrollTop();
  19. this.editor.$main.attr("style","z-index:900000;position:absolute;left:0;top:0px");
  20. $(window).scrollTop(0);
  21. $("html,body").css("overflow","hidden");//隐藏滚蛋条
  22. this.editor.$bottom.find("div").hide();//隐藏底部的调整大小控制块
  23. this.editor.resize($(window).width(),$(window).height());
  24. $btn.addClass(opt.cssname.fulled);
  25. }
  26. }
  27. } );
  28. //切换源码
  29. $.TE.plugin( "source", {
  30. source:function(e){
  31. var $btn = this.$btn,
  32. $area = this.editor.$area,
  33. $frame = this.editor.$frame,
  34. opt = this.editor.opt,
  35. _self = this;
  36. if($btn.is("."+opt.cssname.sourceMode)){
  37. //切换到可视化
  38. _self.editor.core.updateFrame();
  39. $area.hide();
  40. $frame.show();
  41. $btn.removeClass(opt.cssname.sourceMode);
  42. }else{
  43. //切换到源码
  44. _self.editor.core.updateTextArea();
  45. $area.show();
  46. $frame.hide();
  47. $btn.addClass(opt.cssname.sourceMode);
  48. }
  49. setTimeout(function(){_self.editor.refreshBtn()},100);
  50. }
  51. } );
  52. //剪切
  53. $.TE.plugin( 'cut', {
  54. click: function() {
  55. if( $.browser.mozilla ) {
  56. alert('您的浏览器安全设置不支持该操作,请使用Ctrl/Cmd+X快捷键完成操作。');
  57. } else {
  58. this.exec();
  59. }
  60. }
  61. });
  62. //复制
  63. $.TE.plugin( 'copy', {
  64. click: function() {
  65. if( $.browser.mozilla ) {
  66. alert('您的浏览器安全设置不支持该操作,请使用Ctrl/Cmd+C快捷键完成操作。');
  67. } else {
  68. this.exec();
  69. }
  70. }
  71. });
  72. //粘贴
  73. $.TE.plugin( 'paste', {
  74. click: function() {
  75. if( $.browser.mozilla ) {
  76. alert('您的浏览器安全设置不支持该操作,请使用Ctrl/Cmd+V快捷键完成操作。');
  77. } else {
  78. this.exec();
  79. }
  80. }
  81. });
  82. //创建链接
  83. $.TE.plugin( "link", {
  84. click:function(e){
  85. var _self = this;
  86. var $html = $(
  87. '<div class="te_dialog_link Lovh">'+
  88. ' <div class="seltab">'+
  89. ' <div class="links Lovh">'+
  90. ' <a href="###" class="cstyle">创建链接</a>'+
  91. ' </div>'+
  92. ' <div class="bdb">&nbsp;</div>'+
  93. ' </div>'+
  94. ' <div class="centbox">'+
  95. ' <div class="item Lovh">'+
  96. ' <span class="ltext Lfll">链接地址:</span>'+
  97. ' <div class="Lfll">'+
  98. ' <input id="te_dialog_url" name="" type="text" class="Lfll input1" />'+
  99. ' </div>'+
  100. ' </div>'+
  101. ' </div>'+
  102. ' <div class="btnarea">'+
  103. ' <input type="button" value="确定" class="te_ok" />'+
  104. ' <input type="button" value="取消" class="te_close" />'+
  105. ' </div>'+
  106. '</div>'
  107. );
  108. if( _self.isie6() ) {
  109. window.selectionCache = [
  110. /* 暂存选区对象 */
  111. _self.editor.doc.selection.createRange(),
  112. /* 选区html内容 */
  113. _self.editor.doc.selection.createRange().htmlText,
  114. /* 选区文本用来计算差值 */
  115. _self.editor.doc.selection.createRange().text
  116. ];
  117. }
  118. this.createDialog({
  119. body:$html,
  120. ok:function(){
  121. _self.value=$html.find("#te_dialog_url").val();
  122. if( _self.isie6() ) {
  123. var _sCache = window.selectionCache,
  124. str1 = '<a href="'+_self.value+'">'+_sCache[1]+'</a>',
  125. str2 = '<a href="'+_self.value+'">'+_sCache[2]+'</a>';
  126. _sCache[0].pasteHTML( str1 );
  127. _sCache[0].moveStart( 'character', -_self.strlen( str2 ) + ( str2.length - _sCache[2].length ) );
  128. _sCache[0].moveEnd( 'character', -0 );
  129. _sCache[0].select();
  130. //置空暂存对象
  131. window.selectionCache = _sCache = null;
  132. } else {
  133. _self.exec();
  134. }
  135. _self.hideDialog();
  136. }
  137. });
  138. },
  139. strlen : function ( str ) {
  140. return window.ActiveXObject && str.indexOf("\n") != -1 ? str.replace(/\r?\n/g, "_").length : str.length;
  141. },
  142. isie6 : function () {
  143. return $.browser.msie && $.browser.version == '6.0' ? true : false;
  144. }
  145. } );
  146. $.TE.plugin( 'print', {
  147. click: function(e) {
  148. var _win = this.editor.core.$frame[0].contentWindow;
  149. if($.browser.msie) {
  150. this.exec();
  151. } else if(_win.print) {
  152. _win.print();
  153. } else {
  154. alert('您的系统不支持打印接口');
  155. }
  156. }
  157. } );
  158. $.TE.plugin( 'pagebreak', {
  159. exec: function() {
  160. var _self = this;
  161. _self.editor.pasteHTML('<div style="page-break-after: always;zoom:1; height:0px; clear:both; display:block; overflow:hidden; border-top:2px dotted #CCC;">&nbsp;</div><p>&nbsp;</p>');
  162. }
  163. } );
  164. $.TE.plugin( 'pastetext', {
  165. exec: function() {
  166. var _self = this,
  167. _html = '';
  168. clipData = window.clipboardData ? window.clipboardData.getData('text') : false;
  169. if( clipData ) {
  170. _self.editor.pasteHTML( clipData.replace( /\r\n/g, '<br />' ) );
  171. } else {
  172. _html = $(
  173. '<div class="te_dialog_pasteText">'+
  174. ' <div class="seltab">'+
  175. ' <div class="links Lovh">'+
  176. ' <a href="###" class="cstyle">贴粘文本</a>'+
  177. ' </div>'+
  178. ' <div class="bdb">&nbsp;</div>'+
  179. ' </div>'+
  180. ' <div class="centbox">'+
  181. ' <div class="pasteText">'+
  182. ' <span class="tips Lmt5">请使用键盘快捷键(Ctrl/Cmd+V)把内容粘贴到下面的方框里。</span>'+
  183. ' <textarea id="pasteText" name="" class="tarea1 Lmt5" rows="10" cols="30"></textarea>'+
  184. ' </div>'+
  185. ' </div>'+
  186. ' <div class="btnarea">'+
  187. ' <input type="button" value="确定" class="te_ok" />'+
  188. ' <input type="button" value="取消" class="te_close" />'+
  189. ' </div>'+
  190. '</div>'
  191. );
  192. this.createDialog({
  193. body : _html,
  194. ok : function(){
  195. _self.editor.pasteHTML(_html.find('#pasteText').val().replace(/\n/g, '<br />'));
  196. _self.hideDialog();
  197. }
  198. });
  199. }
  200. }
  201. } );
  202. $.TE.plugin( 'table', {
  203. exec : function (e) {
  204. var _self = this,
  205. _html = '';
  206. _html = $(
  207. '<div class="te_dialog_table">'+
  208. ' <div class="seltab">'+
  209. ' <div class="links Lovh">'+
  210. ' <a href="###" class="cstyle">插入表格</a>'+
  211. ' </div>'+
  212. ' <div class="bdb">&nbsp;</div>'+
  213. ' </div>'+
  214. ' <div class="centbox">'+
  215. ' <div class="insertTable">'+
  216. ' <div class="item Lovh">'+
  217. ' <span class="ltext Lfll">行数:</span>'+
  218. ' <input type="text" id="te_tab_rows" class="input1 Lfll" value="3" />'+
  219. ' <span class="ltext Lfll">列数:</span>'+
  220. ' <input type="text" id="te_tab_cols" class="input1 Lfll" value="2" />'+
  221. ' </div>'+
  222. ' <div class="item Lovh">'+
  223. ' <span class="ltext Lfll">宽度:</span>'+
  224. ' <input type="text" id="te_tab_width" class="input1 Lfll" value="500" />'+
  225. ' <span class="ltext Lfll">高度:</span>'+
  226. ' <input type="text" id="te_tab_height" class="input1 Lfll" />'+
  227. ' </div>'+
  228. ' <div class="item Lovh">'+
  229. ' <span class="ltext Lfll">边框:</span>'+
  230. ' <input type="text" id="te_tab_border" class="input1 Lfll" value="1" />'+
  231. ' </div>'+
  232. ' </div>'+
  233. ' </div>'+
  234. ' <div class="btnarea">'+
  235. ' <input type="button" value="确定" class="te_ok" />'+
  236. ' <input type="button" value="取消" class="te_close" />'+
  237. ' </div>'+
  238. '</div>'
  239. );
  240. this.createDialog({
  241. body : _html,
  242. ok : function () {
  243. //获取参数
  244. var rows = parseInt(_html.find('#te_tab_rows').val()),
  245. cols = parseInt(_html.find('#te_tab_cols').val()),
  246. width = parseInt(_html.find('#te_tab_width').val()),
  247. height = parseInt(_html.find('#te_tab_height').val()),
  248. border = parseInt(_html.find('#te_tab_border').val()),
  249. tab_html = '<table width="'+width+'" border="'+border+'"';
  250. if(height) tab_html += ' height="'+height+'"';
  251. tab_html += '>';
  252. for(var i=0; i<rows; i++) {
  253. tab_html += '<tr>';
  254. for(var j=0; j<cols; j++) {
  255. tab_html += '<td>&nbsp;</td>';
  256. }
  257. tab_html += '</tr>';
  258. }
  259. tab_html += '</table>';
  260. _self.editor.pasteHTML( tab_html );
  261. _self.hideDialog();
  262. }
  263. });
  264. }
  265. } );
  266. $.TE.plugin( 'blockquote', {
  267. exec : function () {
  268. var _self = this,
  269. _doc = _self.editor.doc,
  270. elem = '', //当前对象
  271. isquote = false, //是否已被引用
  272. node = '',
  273. child = false; //找到的引用对象
  274. //取得当前对象
  275. node = elem = this.getElement();
  276. //判断是否已被引用
  277. while( node !== _doc.body ) {
  278. if( node.nodeName.toLowerCase() == 'blockquote' ){
  279. isquote = true;
  280. break;
  281. }
  282. node = node.parentNode;
  283. }
  284. if( isquote ) {
  285. //如果存在引用,则清理
  286. if( node === _doc.body ) {
  287. node.innerHTML = elem.parentNode.innerHTML;
  288. } else {
  289. while (child = node.firstChild) {
  290. node.parentNode.insertBefore(child, node);
  291. }
  292. node.parentNode.removeChild(node);
  293. }
  294. } else {
  295. //不存在引用,创建引用
  296. if( $.browser.msie ) {
  297. if( elem === _doc.body ) {
  298. elem.innerHTML = '<blockquote>' + elem.innerHTML + '</blockquote>';
  299. } else {
  300. elem.outerHTML = '<blockquote>' + elem.outerHTML + '</blockquote>';
  301. }
  302. } else {
  303. _doc.execCommand( 'formatblock', false, '<blockquote>' )
  304. }
  305. }
  306. },
  307. getElement : function () {
  308. var ret = false;
  309. if( $.browser.msie ) {
  310. ret = this.editor.doc.selection.createRange().parentElement();
  311. } else {
  312. ret = this.editor.$frame.get( 0 ).contentWindow.getSelection().getRangeAt( 0 ).startContainer;
  313. }
  314. return ret;
  315. }
  316. } );
  317. $.TE.plugin( 'image', {
  318. upid : 'te_image_upload',
  319. uptype : [ 'jpg', 'jpeg', 'gif', 'png', 'bmp' ],
  320. //文件大小
  321. maxsize : 1024*1024*1024*2, // 2MB
  322. exec : function() {
  323. var _self = this,
  324. //上传地址
  325. updir = _self.editor.opt.uploadURL,
  326. //传给上传页的参数
  327. parame = 'callback='+this.upid+this.editor.guid+'&rands='+(+new Date());
  328. if(updir && updir!='about:blank'){
  329. if( updir.indexOf('?') > -1 ) {
  330. updir += '&' + parame;
  331. } else {
  332. updir += '?' + parame;
  333. }
  334. //弹出窗内容
  335. var $html = $(
  336. '<div class="te_dialog_image">'+
  337. ' <div class="seltab">'+
  338. ' <div class="links Lovh">'+
  339. ' <a href="#" class="cstyle">插入图片</a>'+
  340. ' </div>'+
  341. ' <div class="bdb">&nbsp;</div>'+
  342. ' </div>'+
  343. ' <div class="centbox">'+
  344. ' <div class="insertimage Lmt20 Lpb10">'+
  345. ' <div class="item Lovh">'+
  346. ' <span class="ltext Lfll">图片地址:</span>'+
  347. ' <div class="Lfll Lovh">'+
  348. ' <input type="text" id="te_image_url" class="imageurl input1 Lfll Lmr5" />'+
  349. ' </div>'+
  350. ' </div>'+
  351. ' <div class="item Lovh">'+
  352. ' <span class="ltext Lfll">上传图片:</span>'+
  353. ' <div class="Lfll Lovh">'+
  354. ' <form id="form_img" enctype="multipart/form-data" action="'+updir+'" method="POST" target="upifrem">'+
  355. ' <div class="filebox">'+
  356. ' <input id="teupload" name="teupload" size="1" onchange="checkTypes(\'form_img\');" class="upinput" type="file" hidefocus="true" />'+
  357. ' <input id="tefiletype" name="tefiletype" type="hidden" value="'+this.uptype+'" />'+
  358. ' <input id="temaxsize" name="temaxsize" type="hidden" value="'+this.maxsize+'" />'+
  359. ' <span class="upbtn">上传</span>'+
  360. ' </div>'+
  361. ' </form>'+
  362. ' <iframe name="upifrem" id="upifrem" width="70" height="22" class="Lfll" scrolling="no" frameborder="0"></iframe>'+
  363. ' </div>'+
  364. ' </div>'+
  365. ' <div class="item Lovh">'+
  366. ' <span class="ltext Lfll">图片宽度:</span>'+
  367. ' <div class="Lfll">'+
  368. ' <input id="te_image_width" name="" type="text" class="input2" />'+
  369. ' </div>'+
  370. ' <span class="ltext Lfll">图片高度:</span>'+
  371. ' <div class="Lfll">'+
  372. ' <input id="te_image_height" name="" type="text" class="input2" />'+
  373. ' </div>'+
  374. ' </div>'+
  375. ' </div>'+
  376. ' </div>'+
  377. ' <div class="btnarea">'+
  378. ' <input type="button" value="确定" class="te_ok" />'+
  379. ' <input type="button" value="取消" class="te_close" />'+
  380. ' </div>'+
  381. '</div>'
  382. ),
  383. _upcall = function(path) {
  384. //获取上传的值
  385. $html.find( '#te_image_url' ).val(path);
  386. // 刷新iframe上传页
  387. //var _url = $html.find( 'iframe' ).attr( 'src' );
  388. //_url = _url.replace( /rands=[^&]+/, 'rands=' + (+ new Date()) );
  389. $html.find( 'iframe' ).attr( 'src', 'about:blank' );
  390. }
  391. //注册通信
  392. te_upload_interface( 'reg', {
  393. 'callid' : this.upid+this.editor.guid,
  394. 'filetype': this.uptype,
  395. 'maxsize' : this.maxsize,
  396. 'callback': _upcall
  397. } );
  398. //创建对话框
  399. this.createDialog( {
  400. body : $html,
  401. ok : function() {
  402. var _src = $html.find('#te_image_url').val(),
  403. _width = parseInt($html.find('#te_image_width').val()),
  404. _height = parseInt($html.find('#te_image_height').val());
  405. _src = _APP+_src;
  406. var _insertHTML = '<img src="'+(_src||'http://www.baidu.com/img/baidu_sylogo1.gif')+'" ';
  407. if( _width ) _insertHTML += 'width="'+_width+'" ';
  408. if( _height ) _insertHTML += 'height="'+_height+'" ';
  409. _insertHTML += '/>';
  410. _self.editor.pasteHTML( _insertHTML );
  411. _self.hideDialog();
  412. }
  413. } );
  414. }else{
  415. alert('请配置上传处理路径!');
  416. }
  417. }
  418. } );
  419. $.TE.plugin( 'flash', {
  420. upid : 'te_flash_upload',
  421. uptype : [ 'swf' ],
  422. //文件大小
  423. maxsize : 1024*1024*1024*2, // 2MB
  424. exec : function() {
  425. var _self = this,
  426. //上传地址
  427. updir = _self.editor.opt.uploadURL,
  428. //传给上传页的参数
  429. parame = 'callback='+this.upid+this.editor.guid+'&rands='+(+new Date());
  430. if(updir && updir!='about:blank'){
  431. if( updir.indexOf('?') > -1 ) {
  432. updir += '&' + parame;
  433. } else {
  434. updir += '?' + parame;
  435. }
  436. //弹出窗内容
  437. var $html = $(
  438. '<div class="te_dialog_flash">'+
  439. ' <div class="seltab">'+
  440. ' <div class="links Lovh">'+
  441. ' <a href="###" class="cstyle">插入flash动画</a>'+
  442. ' </div>'+
  443. ' <div class="bdb">&nbsp;</div>'+
  444. ' </div>'+
  445. ' <div class="insertflash Lmt20 Lpb10">'+
  446. ' <div class="item Lovh">'+
  447. ' <span class="ltext Lfll">flash地址:</span>'+
  448. ' <div class="Lfll Lovh">'+
  449. ' <input id="te_flash_url" type="text" class="imageurl input1 Lfll Lmr5" />'+
  450. ' </div>'+
  451. ' </div>'+
  452. ' <div class="item Lovh">'+
  453. ' <span class="ltext Lfll">上传flash:</span>'+
  454. ' <div class="Lfll Lovh">'+
  455. ' <form id="form_swf" enctype="multipart/form-data" action="'+updir+'" method="POST" target="upifrem">'+
  456. ' <div class="filebox">'+
  457. ' <input id="teupload" name="teupload" size="1" onchange="checkTypes(\'form_swf\');" class="upinput" type="file" hidefocus="true" />'+
  458. ' <input id="tefiletype" name="tefiletype" type="hidden" value="'+this.uptype+'" />'+
  459. ' <input id="temaxsize" name="temaxsize" type="hidden" value="'+this.maxsize+'" />'+
  460. ' <span class="upbtn">上传</span>'+
  461. ' </div>'+
  462. ' </form>'+
  463. ' <iframe name="upifrem" id="upifrem" width="70" height="22" class="Lfll" scrolling="no" frameborder="0"></iframe>'+
  464. ' </div>'+
  465. ' </div>'+
  466. ' <div class="item Lovh">'+
  467. ' <span class="ltext Lfll">宽度:</span>'+
  468. ' <div class="Lfll">'+
  469. ' <input id="te_flash_width" name="" type="text" class="input2" value="200" />'+
  470. ' </div>'+
  471. ' <span class="ltext Lfll">高度:</span>'+
  472. ' <div class="Lfll">'+
  473. ' <input id="te_flash_height" name="" type="text" class="input2" value="60" />'+
  474. ' </div>'+
  475. ' </div>'+
  476. ' <div class="item Lovh">'+
  477. ' <span class="ltext Lfll">&nbsp;</span>'+
  478. ' <div class="Lfll">'+
  479. ' <input id="te_flash_wmode" name="" type="checkbox" class="input3" />'+
  480. ' <label for="te_flash_wmode" class="labeltext">开启背景透明</label>'+
  481. ' </div>'+
  482. ' </div>'+
  483. ' </div>'+
  484. ' <div class="btnarea">'+
  485. ' <input type="button" value="确定" class="te_ok" />'+
  486. ' <input type="button" value="取消" class="te_close" />'+
  487. ' </div>'+
  488. '</div>'
  489. ),
  490. _upcall = function(path) {
  491. //获取上传的值
  492. $html.find( '#te_flash_url' ).val(path);
  493. // 刷新iframe上传页
  494. //var _url = $html.find( 'iframe' ).attr( 'src' );
  495. //_url = _url.replace( /rands=[^&]+/, 'rands=' + (+ new Date()) );
  496. $html.find( 'iframe' ).attr( 'src', 'about:blank' );
  497. }
  498. //注册通信
  499. te_upload_interface( 'reg', {
  500. 'callid' : this.upid+this.editor.guid,
  501. 'filetype': this.uptype,
  502. 'maxsize' : this.maxsize,
  503. 'callback': _upcall
  504. } );
  505. //创建对话框
  506. this.createDialog( {
  507. body : $html,
  508. ok : function() {
  509. var _src = $html.find('#te_flash_url').val(),
  510. _width = parseInt($html.find('#te_flash_width').val()),
  511. _height = parseInt($html.find('#te_flash_height').val());
  512. _wmode = !!$html.find('#te_flash_wmode').attr('checked');
  513. if( _src == '' ) {
  514. alert('请输入flash地址,或者从本地选择文件上传');
  515. return true;
  516. }
  517. if( isNaN(_width) || isNaN(_height) ) {
  518. alert('请输入宽高');
  519. return true;
  520. }
  521. _src = _APP+_src;
  522. var _data = "{'src':'"+_src+"','width':'"+_width+"','height':'"+_height+"','wmode':"+(_wmode)+"}";
  523. var _insertHTML = '<img src="'+$.TE.basePath()+'skins/'+_self.editor.opt.skins+'/img/spacer.gif" class="_flash_position" style="';
  524. if( _width ) _insertHTML += 'width:'+_width+'px;';
  525. if( _height ) _insertHTML += 'height:'+_height+'px;';
  526. _insertHTML += 'border:1px solid #DDD; display:inline-block;text-align:center;line-height:'+_height+'px;" ';
  527. _insertHTML += '_data="'+_data+'"';
  528. _insertHTML += ' alt="flash占位符" />';
  529. _self.editor.pasteHTML( _insertHTML );
  530. _self.hideDialog();
  531. }
  532. } )
  533. }else{
  534. alert('请配置上传处理路径!');
  535. }
  536. }
  537. } );
  538. $.TE.plugin( 'face', {
  539. exec: function() {
  540. var _self = this,
  541. //表情路径
  542. _fp = _self.editor.opt.face_path,
  543. //弹出窗同容
  544. $html = $(
  545. '<div class="te_dialog_face Lovh">'+
  546. ' <div class="seltab">'+
  547. ' <div class="links Lovh">'+
  548. ' <a href="###" class="cstyle">插入表情</a>'+
  549. ' </div>'+
  550. ' <div class="bdb">&nbsp;</div>'+
  551. ' </div>'+
  552. ' <div class="centbox">'+
  553. ' <div class="insertFace" style="background-image:url('+$.TE.basePath()+'skins/'+_fp[1]+'/'+_fp[0]+'.gif'+');">'+
  554. '<span face_num="0">&nbsp;</span>'+
  555. '<span face_num="1">&nbsp;</span>'+
  556. '<span face_num="2">&nbsp;</span>'+
  557. '<span face_num="3">&nbsp;</span>'+
  558. '<span face_num="4">&nbsp;</span>'+
  559. '<span face_num="5">&nbsp;</span>'+
  560. '<span face_num="6">&nbsp;</span>'+
  561. '<span face_num="7">&nbsp;</span>'+
  562. '<span face_num="8">&nbsp;</span>'+
  563. '<span face_num="9">&nbsp;</span>'+
  564. '<span face_num="10">&nbsp;</span>'+
  565. '<span face_num="11">&nbsp;</span>'+
  566. '<span face_num="12">&nbsp;</span>'+
  567. '<span face_num="13">&nbsp;</span>'+
  568. '<span face_num="14">&nbsp;</span>'+
  569. '<span face_num="15">&nbsp;</span>'+
  570. '<span face_num="16">&nbsp;</span>'+
  571. '<span face_num="17">&nbsp;</span>'+
  572. '<span face_num="18">&nbsp;</span>'+
  573. '<span face_num="19">&nbsp;</span>'+
  574. '<span face_num="20">&nbsp;</span>'+
  575. '<span face_num="21">&nbsp;</span>'+
  576. '<span face_num="22">&nbsp;</span>'+
  577. '<span face_num="23">&nbsp;</span>'+
  578. '<span face_num="24">&nbsp;</span>'+
  579. '<span face_num="25">&nbsp;</span>'+
  580. '<span face_num="26">&nbsp;</span>'+
  581. '<span face_num="27">&nbsp;</span>'+
  582. '<span face_num="28">&nbsp;</span>'+
  583. '<span face_num="29">&nbsp;</span>'+
  584. '<span face_num="30">&nbsp;</span>'+
  585. '<span face_num="31">&nbsp;</span>'+
  586. '<span face_num="32">&nbsp;</span>'+
  587. '<span face_num="33">&nbsp;</span>'+
  588. '<span face_num="34">&nbsp;</span>'+
  589. '<span face_num="35">&nbsp;</span>'+
  590. '<span face_num="36">&nbsp;</span>'+
  591. '<span face_num="37">&nbsp;</span>'+
  592. '<span face_num="38">&nbsp;</span>'+
  593. '<span face_num="39">&nbsp;</span>'+
  594. '<span face_num="40">&nbsp;</span>'+
  595. '<span face_num="41">&nbsp;</span>'+
  596. '<span face_num="42">&nbsp;</span>'+
  597. '<span face_num="43">&nbsp;</span>'+
  598. '<span face_num="44">&nbsp;</span>'+
  599. '<span face_num="45">&nbsp;</span>'+
  600. '<span face_num="46">&nbsp;</span>'+
  601. '<span face_num="47">&nbsp;</span>'+
  602. '<span face_num="48">&nbsp;</span>'+
  603. '<span face_num="49">&nbsp;</span>'+
  604. '<span face_num="50">&nbsp;</span>'+
  605. '<span face_num="51">&nbsp;</span>'+
  606. '<span face_num="52">&nbsp;</span>'+
  607. '<span face_num="53">&nbsp;</span>'+
  608. '<span face_num="54">&nbsp;</span>'+
  609. '<span face_num="55">&nbsp;</span>'+
  610. '<span face_num="56">&nbsp;</span>'+
  611. '<span face_num="57">&nbsp;</span>'+
  612. '<span face_num="58">&nbsp;</span>'+
  613. '<span face_num="59">&nbsp;</span>'+
  614. '<span face_num="60">&nbsp;</span>'+
  615. '<span face_num="61">&nbsp;</span>'+
  616. '<span face_num="62">&nbsp;</span>'+
  617. '<span face_num="63">&nbsp;</span>'+
  618. '<span face_num="64">&nbsp;</span>'+
  619. '<span face_num="65">&nbsp;</span>'+
  620. '<span face_num="66">&nbsp;</span>'+
  621. '<span face_num="67">&nbsp;</span>'+
  622. '<span face_num="68">&nbsp;</span>'+
  623. '<span face_num="69">&nbsp;</span>'+
  624. '<span face_num="70">&nbsp;</span>'+
  625. '<span face_num="71">&nbsp;</span>'+
  626. '<span face_num="72">&nbsp;</span>'+
  627. '<span face_num="73">&nbsp;</span>'+
  628. '<span face_num="74">&nbsp;</span>'+
  629. '<span face_num="75">&nbsp;</span>'+
  630. '<span face_num="76">&nbsp;</span>'+
  631. '<span face_num="77">&nbsp;</span>'+
  632. '<span face_num="78">&nbsp;</span>'+
  633. '<span face_num="79">&nbsp;</span>'+
  634. '<span face_num="80">&nbsp;</span>'+
  635. '<span face_num="81">&nbsp;</span>'+
  636. '<span face_num="82">&nbsp;</span>'+
  637. '<span face_num="83">&nbsp;</span>'+
  638. '<span face_num="84">&nbsp;</span>'+
  639. '<span face_num="85">&nbsp;</span>'+
  640. '<span face_num="86">&nbsp;</span>'+
  641. '<span face_num="87">&nbsp;</span>'+
  642. '<span face_num="88">&nbsp;</span>'+
  643. '<span face_num="89">&nbsp;</span>'+
  644. '<span face_num="90">&nbsp;</span>'+
  645. '<span face_num="91">&nbsp;</span>'+
  646. '<span face_num="92">&nbsp;</span>'+
  647. '<span face_num="93">&nbsp;</span>'+
  648. '<span face_num="94">&nbsp;</span>'+
  649. '<span face_num="95">&nbsp;</span>'+
  650. '<span face_num="96">&nbsp;</span>'+
  651. '<span face_num="97">&nbsp;</span>'+
  652. '<span face_num="98">&nbsp;</span>'+
  653. '<span face_num="99">&nbsp;</span>'+
  654. '<span face_num="100">&nbsp;</span>'+
  655. '<span face_num="101">&nbsp;</span>'+
  656. '<span face_num="102">&nbsp;</span>'+
  657. '<span face_num="103">&nbsp;</span>'+
  658. '<span face_num="104">&nbsp;</span>'+
  659. '</div>'+
  660. ' </div>'+
  661. ' <div class="btnarea">'+
  662. ' <input type="button" value="取消" class="te_close" />'+
  663. ' </div>'+
  664. '</div>'
  665. );
  666. $html.find('.insertFace span').click(function( e ) {
  667. var _url = $.TE.basePath()+'skins/'+_fp[1]+'/'+_fp[0]+'_'+$( this ).attr( 'face_num' )+'.gif',
  668. _insertHtml = '<img src="'+_url+'" />';
  669. _self.editor.pasteHTML( _insertHtml );
  670. _self.hideDialog();
  671. });
  672. this.createDialog( {
  673. body : $html
  674. } );
  675. }
  676. } );
  677. $.TE.plugin( 'code', {
  678. exec: function() {
  679. var _self = this,
  680. $html = $(
  681. '<div class="te_dialog_code Lovh">'+
  682. ' <div class="seltab">'+
  683. ' <div class="links Lovh">'+
  684. ' <a href="###" class="cstyle">插入代码</a>'+
  685. ' </div>'+
  686. ' <div class="bdb">&nbsp;</div>'+
  687. ' </div>'+
  688. ' <div class="centbox">'+
  689. ' <div class="Lmt10 Lml10">'+
  690. ' <span>选择语言:</span>'+
  691. ' <select id="langType" name="">'+
  692. ' <option value="None">其它类型</option>'+
  693. ' <option value="PHP">PHP</option>'+
  694. ' <option value="HTML">HTML</option>'+
  695. ' <option value="JS">JS</option>'+
  696. ' <option value="CSS">CSS</option>'+
  697. ' <option value="SQL">SQL</option>'+
  698. ' <option value="C#">C#</option>'+
  699. ' <option value="JAVA">JAVA</option>'+
  700. ' <option value="VBS">VBS</option>'+
  701. ' <option value="VB">VB</option>'+
  702. ' <option value="XML">XML</option>'+
  703. ' </select>'+
  704. ' </div>'+
  705. ' <textarea id="insertCode" name="" rows="10" class="tarea1 Lmt10" cols="30"></textarea>'+
  706. ' </div>'+
  707. ' <div class="btnarea">'+
  708. ' <input type="button" value="确定" class="te_ok" />'+
  709. ' <input type="button" value="取消" class="te_close" />'+
  710. ' </div>'+
  711. '</div>'
  712. );
  713. this.createDialog({
  714. body : $html,
  715. ok : function(){
  716. var _code = $html.find('#insertCode').val(),
  717. _type = $html.find('#langType').val(),
  718. _html = '';
  719. _code = _code.replace( /</g, '&lt;' );
  720. _code = _code.replace( />/g, '&gt;' );
  721. _code = _code.split('\n');
  722. _html += '<pre style="overflow-x:auto; padding:10px; color:blue; border:1px dotted #2BC1FF; background-color:#EEFAFF;" _syntax="'+_type+'">'
  723. _html += '语言类型:'+_type;
  724. _html += '<ol style="list-stype-type:decimal;">';
  725. for(var i=0; i<_code.length; i++) {
  726. _html += '<li>'+_code[i].replace( /^(\t+)/g, function( $1 ) {return $1.replace(/\t/g, ' ');} );+'</li>';
  727. }
  728. _html += '</ol></pre><p>&nbsp;</p>';
  729. _self.editor.pasteHTML( _html );
  730. _self.hideDialog();
  731. }
  732. });
  733. }
  734. } );
  735. $.TE.plugin( 'style', {
  736. click: function() {
  737. var _self = this,
  738. $html = $(
  739. '<div class="te_dialog_style Lovh">'+
  740. ' <div class="centbox">'+
  741. ' <h1 title="设置当前内容为一级标题"><a href="###">一级标题</a></h1>'+
  742. ' <h2 title="设置当前内容为二级标题"><a href="###">二级标题</a></h2>'+
  743. ' <h3 title="设置当前内容为三级标题"><a href="###">三级标题</a></h3>'+
  744. ' <h4 title="设置当前内容为四级标题"><a href="###">四级标题</a></h4>'+
  745. ' <h5 title="设置当前内容为五级标题"><a href="###">五级标题</a></h5>'+
  746. ' <h6 title="设置当前内容为六级标题"><a href="###">六级标题</a></h6>'+
  747. ' </div>'+
  748. '</div>'
  749. ),
  750. _call = function(e) {
  751. var _value = this.nodeName;
  752. _self.value= _value;
  753. _self.exec();
  754. //_self.hideDialog();
  755. };
  756. $html.find( '>.centbox>*' ).click( _call );
  757. this.createDialog( {
  758. body: $html
  759. } );
  760. },
  761. exec: function() {
  762. var _self = this,
  763. _html = '<'+_self.value+'>'+_self.editor.selectedHTML()+'</'+_self.value+'>';
  764. _self.editor.pasteHTML( _html );
  765. }
  766. } );
  767. $.TE.plugin( 'font', {
  768. click: function() {
  769. var _self = this;
  770. $html = $(
  771. '<div class="te_dialog_font Lovh">'+
  772. ' <div class="centbox">'+
  773. ' <div><a href="###" style="font-family:\'宋体\',\'SimSun\'">宋体</a></div>'+
  774. ' <div><a href="###" style="font-family:\'楷体\',\'楷体_GB2312\',\'SimKai\'">楷体</a></div>'+
  775. ' <div><a href="###" style="font-family:\'隶书\',\'SimLi\'">隶书</a></div>'+
  776. ' <div><a href="###" style="font-family:\'黑体\',\'SimHei\'">黑体</a></div>'+
  777. ' <div><a href="###" style="font-family:\'微软雅黑\'">微软雅黑</a></div>'+
  778. ' <span>------</span>'+
  779. ' <div><a href="###" style="font-family:arial,helvetica,sans-serif;">Arial</a></div>'+
  780. ' <div><a href="###" style="font-family:comic sans ms,cursive;">Comic Sans Ms</a></div>'+
  781. ' <div><a href="###" style="font-family:courier new,courier,monospace;">Courier New</a></div>'+
  782. ' <div><a href="###" style="font-family:georgia,serif;">Georgia</a></div>'+
  783. ' <div><a href="###" style="font-family:lucida sans unicode,lucida grande,sans-serif;">Lucida Sans Unicode</a></div>'+
  784. ' <div><a href="###" style="font-family:tahoma,geneva,sans-serif;">Tahoma</a></div>'+
  785. ' <div><a href="###" style="font-family:times new roman,times,serif;">Times New Roman</a></div>'+
  786. ' <div><a href="###" style="font-family:trebuchet ms,helvetica,sans-serif;">Trebuchet Ms</a></div>'+
  787. ' <div><a href="###" style="font-family:verdana,geneva,sans-serif;">Verdana</a></div>'+
  788. ' </div>'+
  789. '</div>'
  790. ),
  791. _call = function(e) {
  792. var _value = this.style.fontFamily;
  793. _self.value= _value;
  794. _self.exec();
  795. };
  796. $html.find( '>.centbox a' ).click( _call );
  797. this.createDialog( {
  798. body: $html
  799. } );
  800. }
  801. } );
  802. $.TE.plugin( 'fontsize', {
  803. click: function() {
  804. var _self = this,
  805. $html = $(
  806. '<div class="te_dialog_fontsize Lovh">'+
  807. ' <div class="centbox">'+
  808. ' <div><a href="#" style="font-size:10px">10</a></div>'+
  809. ' <div><a href="#" style="font-size:12px">12</a></div>'+
  810. ' <div><a href="#" style="font-size:14px">14</a></div>'+
  811. ' <div><a href="#" style="font-size:16px">16</a></div>'+
  812. ' <div><a href="#" style="font-size:18px">18</a></div>'+
  813. ' <div><a href="#" style="font-size:20px">20</a></div>'+
  814. ' <div><a href="#" style="font-size:22px">22</a></div>'+
  815. ' <div><a href="#" style="font-size:24px">24</a></div>'+
  816. ' <div><a href="#" style="font-size:36px">36</a></div>'+
  817. ' <div><a href="#" style="font-size:48px">48</a></div>'+
  818. ' <div><a href="#" style="font-size:60px">60</a></div>'+
  819. ' <div><a href="#" style="font-size:72px">72</a></div>'+
  820. ' </div>'+
  821. '</div>'
  822. ),
  823. _call = function(e) {
  824. var _value = this.style.fontSize;
  825. _self.value= _value;
  826. _self.exec();
  827. };
  828. $html.find( '>.centbox a' ).click( _call );
  829. this.createDialog( {
  830. body: $html
  831. } );
  832. },
  833. exec: function() {
  834. var _self = this,
  835. _html = '<span style="font-size:'+_self.value+'">'+_self.editor.selectedText()+'</span>';
  836. _self.editor.pasteHTML( _html );
  837. }
  838. } );
  839. $.TE.plugin( 'fontcolor', {
  840. click: function() {
  841. var _self = this,
  842. $html = $(
  843. '<div class="te_dialog_fontcolor Lovh">'+
  844. ' <div class="colorsel">'+
  845. ' <!--第一列-->'+
  846. ' <a href="###" style="background-color:#FF0000">&nbsp;</a>'+
  847. ' <a href="###" style="background-color:#FFA900">&nbsp;</a>'+
  848. ' <a href="###" style="background-color:#FFFF00">&nbsp;</a>'+
  849. ' <a href="###" style="background-color:#99E600">&nbsp;</a>'+
  850. ' <a href="###" style="background-color:#99E600">&nbsp;</a>'+
  851. ' <a href="###" style="background-color:#00FFFF">&nbsp;</a>'+
  852. ' <a href="###" style="background-color:#00AAFF">&nbsp;</a>'+
  853. ' <a href="###" style="background-color:#0055FF">&nbsp;</a>'+
  854. ' <a href="###" style="background-color:#5500FF">&nbsp;</a>'+
  855. ' <a href="###" style="background-color:#AA00FF">&nbsp;</a>'+
  856. ' <a href="###" style="background-color:#FF007F">&nbsp;</a>'+
  857. ' <a href="###" style="background-color:#FFFFFF">&nbsp;</a>'+
  858. ' <!--第二列-->'+
  859. ' <a href="###" style="background-color:#FFE5E5">&nbsp;</a>'+
  860. ' <a href="###" style="background-color:#FFF2D9">&nbsp;</a>'+
  861. ' <a href="###" style="background-color:#FFFFCC">&nbsp;</a>'+
  862. ' <a href="###" style="background-color:#EEFFCC">&nbsp;</a>'+
  863. ' <a href="###" style="background-color:#D9FFE0">&nbsp;</a>'+
  864. ' <a href="###" style="background-color:#D9FFFF">&nbsp;</a>'+
  865. ' <a href="###" style="background-color:#D9F2FF">&nbsp;</a>'+
  866. ' <a href="###" style="background-color:#D9E6FF">&nbsp;</a>'+
  867. ' <a href="###" style="background-color:#E6D9FF">&nbsp;</a>'+
  868. ' <a href="###" style="background-color:#F2D9FF">&nbsp;</a>'+
  869. ' <a href="###" style="background-color:#FFD9ED">&nbsp;</a>'+
  870. ' <a href="###" style="background-color:#D9D9D9">&nbsp;</a>'+
  871. ' <!--第三列-->'+
  872. ' <a href="###" style="background-color:#E68A8A">&nbsp;</a>'+
  873. ' <a href="###" style="background-color:#E6C78A">&nbsp;</a>'+
  874. ' <a href="###" style="background-color:#FFFF99">&nbsp;</a>'+
  875. ' <a href="###" style="background-color:#BFE673">&nbsp;</a>'+
  876. ' <a href="###" style="background-color:#99EEA0">&nbsp;</a>'+
  877. ' <a href="###" style="background-color:#A1E6E6">&nbsp;</a>'+
  878. ' <a href="###" style="background-color:#99DDFF">&nbsp;</a>'+
  879. ' <a href="###" style="background-color:#8AA8E6">&nbsp;</a>'+
  880. ' <a href="###" style="background-color:#998AE6">&nbsp;</a>'+
  881. ' <a href="###" style="background-color:#C78AE6">&nbsp;</a>'+
  882. ' <a href="###" style="background-color:#E68AB9">&nbsp;</a>'+
  883. ' <a href="###" style="background-color:#B3B3B3">&nbsp;</a>'+
  884. ' <!--第四列-->'+
  885. ' <a href="###" style="background-color:#CC5252">&nbsp;</a>'+
  886. ' <a href="###" style="background-color:#CCA352">&nbsp;</a>'+
  887. ' <a href="###" style="background-color:#D9D957">&nbsp;</a>'+
  888. ' <a href="###" style="background-color:#A7CC39">&nbsp;</a>'+
  889. ' <a href="###" style="background-color:#57CE6D">&nbsp;</a>'+
  890. ' <a href="###" style="background-color:#52CCCC">&nbsp;</a>'+
  891. ' <a href="###" style="background-color:#52A3CC">&nbsp;</a>'+
  892. ' <a href="###" style="background-color:#527ACC">&nbsp;</a>'+
  893. ' <a href="###" style="background-color:#6652CC">&nbsp;</a>'+
  894. ' <a href="###" style="background-color:#A352CC">&nbsp;</a>'+
  895. ' <a href="###" style="background-color:#CC5291">&nbsp;</a>'+
  896. ' <a href="###" style="background-color:#B3B3B3">&nbsp;</a>'+
  897. ' <!--第五列-->'+
  898. ' <a href="###" style="background-color:#991F1F">&nbsp;</a>'+
  899. ' <a href="###" style="background-color:#99701F">&nbsp;</a>'+
  900. ' <a href="###" style="background-color:#99991F">&nbsp;</a>'+
  901. ' <a href="###" style="background-color:#59800D">&nbsp;</a>'+
  902. ' <a href="###" style="background-color:#0F9932">&nbsp;</a>'+
  903. ' <a href="###" style="background-color:#1F9999">&nbsp;</a>'+
  904. ' <a href="###" style="background-color:#1F7099">&nbsp;</a>'+
  905. ' <a href="###" style="background-color:#1F4799">&nbsp;</a>'+
  906. ' <a href="###" style="background-color:#471F99">&nbsp;</a>'+
  907. ' <a href="###" style="background-color:#701F99">&nbsp;</a>'+
  908. ' <a href="###" style="background-color:#991F5E">&nbsp;</a>'+
  909. ' <a href="###" style="background-color:#404040">&nbsp;</a>'+
  910. ' <!--第六列-->'+
  911. ' <a href="###" style="background-color:#660000">&nbsp;</a>'+
  912. ' <a href="###" style="background-color:#664B14">&nbsp;</a>'+
  913. ' <a href="###" style="background-color:#666600">&nbsp;</a>'+
  914. ' <a href="###" style="background-color:#3B5900">&nbsp;</a>'+
  915. ' <a href="###" style="background-color:#005916">&nbsp;</a>'+
  916. ' <a href="###" style="background-color:#146666">&nbsp;</a>'+
  917. ' <a href="###" style="background-color:#144B66">&nbsp;</a>'+
  918. ' <a href="###" style="background-color:#143066">&nbsp;</a>'+
  919. ' <a href="###" style="background-color:#220066">&nbsp;</a>'+
  920. ' <a href="###" style="background-color:#301466">&nbsp;</a>'+
  921. ' <a href="###" style="background-color:#66143F">&nbsp;</a>'+
  922. ' <a href="###" style="background-color:#000000">&nbsp;</a>'+
  923. ' </div>'+
  924. '</div>'
  925. ),
  926. _call = function(e) {
  927. var _value = this.style.backgroundColor;
  928. _self.value= _value;
  929. _self.exec();
  930. };
  931. $html.find( '>.colorsel a' ).click( _call );
  932. this.createDialog( {
  933. body: $html
  934. } );
  935. }
  936. } );
  937. $.TE.plugin( 'backcolor', {
  938. click: function() {
  939. var _self = this,
  940. $html = $(
  941. '<div class="te_dialog_fontcolor Lovh">'+
  942. ' <div class="colorsel">'+
  943. ' <!--第一列-->'+
  944. ' <a href="###" style="background-color:#FF0000">&nbsp;</a>'+
  945. ' <a href="###" style="background-color:#FFA900">&nbsp;</a>'+
  946. ' <a href="###" style="background-color:#FFFF00">&nbsp;</a>'+
  947. ' <a href="###" style="background-color:#99E600">&nbsp;</a>'+
  948. ' <a href="###" style="background-color:#99E600">&nbsp;</a>'+
  949. ' <a href="###" style="background-color:#00FFFF">&nbsp;</a>'+
  950. ' <a href="###" style="background-color:#00AAFF">&nbsp;</a>'+
  951. ' <a href="###" style="background-color:#0055FF">&nbsp;</a>'+
  952. ' <a href="###" style="background-color:#5500FF">&nbsp;</a>'+
  953. ' <a href="###" style="background-color:#AA00FF">&nbsp;</a>'+
  954. ' <a href="###" style="background-color:#FF007F">&nbsp;</a>'+
  955. ' <a href="###" style="background-color:#FFFFFF">&nbsp;</a>'+
  956. ' <!--第二列-->'+
  957. ' <a href="###" style="background-color:#FFE5E5">&nbsp;</a>'+
  958. ' <a href="###" style="background-color:#FFF2D9">&nbsp;</a>'+
  959. ' <a href="###" style="background-color:#FFFFCC">&nbsp;</a>'+
  960. ' <a href="###" style="background-color:#EEFFCC">&nbsp;</a>'+
  961. ' <a href="###" style="background-color:#D9FFE0">&nbsp;</a>'+
  962. ' <a href="###" style="background-color:#D9FFFF">&nbsp;</a>'+
  963. ' <a href="###" style="background-color:#D9F2FF">&nbsp;</a>'+
  964. ' <a href="###" style="background-color:#D9E6FF">&nbsp;</a>'+
  965. ' <a href="###" style="background-color:#E6D9FF">&nbsp;</a>'+
  966. ' <a href="###" style="background-color:#F2D9FF">&nbsp;</a>'+
  967. ' <a href="###" style="background-color:#FFD9ED">&nbsp;</a>'+
  968. ' <a href="###" style="background-color:#D9D9D9">&nbsp;</a>'+
  969. ' <!--第三列-->'+
  970. ' <a href="###" style="background-color:#E68A8A">&nbsp;</a>'+
  971. ' <a href="###" style="background-color:#E6C78A">&nbsp;</a>'+
  972. ' <a href="###" style="background-color:#FFFF99">&nbsp;</a>'+
  973. ' <a href="###" style="background-color:#BFE673">&nbsp;</a>'+
  974. ' <a href="###" style="background-color:#99EEA0">&nbsp;</a>'+
  975. ' <a href="###" style="background-color:#A1E6E6">&nbsp;</a>'+
  976. ' <a href="###" style="background-color:#99DDFF">&nbsp;</a>'+
  977. ' <a href="###" style="background-color:#8AA8E6">&nbsp;</a>'+
  978. ' <a href="###" style="background-color:#998AE6">&nbsp;</a>'+
  979. ' <a href="###" style="background-color:#C78AE6">&nbsp;</a>'+
  980. ' <a href="###" style="background-color:#E68AB9">&nbsp;</a>'+
  981. ' <a href="###" style="background-color:#B3B3B3">&nbsp;</a>'+
  982. ' <!--第四列-->'+
  983. ' <a href="###" style="background-color:#CC5252">&nbsp;</a>'+
  984. ' <a href="###" style="background-color:#CCA352">&nbsp;</a>'+
  985. ' <a href="###" style="background-color:#D9D957">&nbsp;</a>'+
  986. ' <a href="###" style="background-color:#A7CC39">&nbsp;</a>'+
  987. ' <a href="###" style="background-color:#57CE6D">&nbsp;</a>'+
  988. ' <a href="###" style="background-color:#52CCCC">&nbsp;</a>'+
  989. ' <a href="###" style="background-color:#52A3CC">&nbsp;</a>'+
  990. ' <a href="###" style="background-color:#527ACC">&nbsp;</a>'+
  991. ' <a href="###" style="background-color:#6652CC">&nbsp;</a>'+
  992. ' <a href="###" style="background-color:#A352CC">&nbsp;</a>'+
  993. ' <a href="###" style="background-color:#CC5291">&nbsp;</a>'+
  994. ' <a href="###" style="background-color:#B3B3B3">&nbsp;</a>'+
  995. ' <!--第五列-->'+
  996. ' <a href="###" style="background-color:#991F1F">&nbsp;</a>'+
  997. ' <a href="###" style="background-color:#99701F">&nbsp;</a>'+
  998. ' <a href="###" style="background-color:#99991F">&nbsp;</a>'+
  999. ' <a href="###" style="background-color:#59800D">&nbsp;</a>'+
  1000. ' <a href="###" style="background-color:#0F9932">&nbsp;</a>'+
  1001. ' <a href="###" style="background-color:#1F9999">&nbsp;</a>'+
  1002. ' <a href="###" style="background-color:#1F7099">&nbsp;</a>'+
  1003. ' <a href="###" style="background-color:#1F4799">&nbsp;</a>'+
  1004. ' <a href="###" style="background-color:#471F99">&nbsp;</a>'+
  1005. ' <a href="###" style="background-color:#701F99">&nbsp;</a>'+
  1006. ' <a href="###" style="background-color:#991F5E">&nbsp;</a>'+
  1007. ' <a href="###" style="background-color:#404040">&nbsp;</a>'+
  1008. ' <!--第六列-->'+
  1009. ' <a href="###" style="background-color:#660000">&nbsp;</a>'+
  1010. ' <a href="###" style="background-color:#664B14">&nbsp;</a>'+
  1011. ' <a href="###" style="background-color:#666600">&nbsp;</a>'+
  1012. ' <a href="###" style="background-color:#3B5900">&nbsp;</a>'+
  1013. ' <a href="###" style="background-color:#005916">&nbsp;</a>'+
  1014. ' <a href="###" style="background-color:#146666">&nbsp;</a>'+
  1015. ' <a href="###" style="background-color:#144B66">&nbsp;</a>'+
  1016. ' <a href="###" style="background-color:#143066">&nbsp;</a>'+
  1017. ' <a href="###" style="background-color:#220066">&nbsp;</a>'+
  1018. ' <a href="###" style="background-color:#301466">&nbsp;</a>'+
  1019. ' <a href="###" style="background-color:#66143F">&nbsp;</a>'+
  1020. ' <a href="###" style="background-color:#000000">&nbsp;</a>'+
  1021. ' </div>'+
  1022. '</div>'
  1023. ),
  1024. _call = function(e) {
  1025. var _value = this.style.backgroundColor;
  1026. _self.value= _value;
  1027. _self.exec();
  1028. };
  1029. $html.find( '>.colorsel a' ).click( _call );
  1030. this.createDialog( {
  1031. body: $html
  1032. } );
  1033. }
  1034. } );
  1035. $.TE.plugin( 'about', {
  1036. 'click': function() {
  1037. var _self = this,
  1038. $html = $(
  1039. '<div class="te_dialog_about Lovh">'+
  1040. ' <div class="seltab">'+
  1041. ' <div class="links Lovh">'+
  1042. ' <a href="###" class="cstyle">关于ThinkEditor</a>'+
  1043. ' </div>'+
  1044. ' <div class="bdb">&nbsp;</div>'+
  1045. ' </div>'+
  1046. ' <div class="centbox">'+
  1047. ' <div class="aboutcontent">'+
  1048. ' <p>ThinkPHP是一个免费开源的,快速、简单的面向对象的轻量级PHP开发框架,遵循Apache2开源协议发布,是为了敏捷WEB应用开发和简化企业级应用开发而诞生的。拥有众多的优秀功能和特性,经历了三年多发展的同时,在社区团队的积极参与下,在易用性、扩展性和性能方面不断优化和改进,众多的典型案例确保可以稳定用于商业以及门户级的开发。</p>'+
  1049. ' <p>ThinkPHP借鉴了国外很多优秀的框架和模式,使用面向对象的开发结构和MVC模式,采用单一入口模式等,融合了Struts的Action思想和JSP的TagLib(标签库)、RoR的ORM映射和ActiveRecord模式,封装了CURD和一些常用操作,在项目配置、类库导入、模版引擎、查询语言、自动验证、视图模型、项目编译、缓存机制、SEO支持、分布式数据库、多数据库连接和切换、认证机制和扩展性方面均有独特的表现。</p>'+
  1050. ' <p>使用ThinkPHP,你可以更方便和快捷的开发和部署应用。当然不仅仅是企业级应用,任何PHP应用开发都可以从ThinkPHP的简单和快速的特性中受益。ThinkPHP本身具有很多的原创特性,并且倡导大道至简,开发由我的开发理念,用最少的代码完成更多的功能,宗旨就是让WEB应用开发更简单、更快速。为此ThinkPHP会不断吸收和融入更好的技术以保证其新鲜和活力,提供WEB应用开发的最佳实践!</p>'+
  1051. ' <p>ThinkPHP遵循Apache2开源许可协议发布,意味着你可以免费使用ThinkPHP,甚至允许把你基于ThinkPHP开发的应用开源或商业产品发布/销售。 </p>'+
  1052. ' </div>'+
  1053. ' </div>'+
  1054. ' <div class="btnarea">'+
  1055. ' <input type="button" value="关闭" class="te_close" />'+
  1056. ' </div>'+
  1057. '</div>'
  1058. );
  1059. _self.createDialog( {
  1060. body: $html
  1061. } );
  1062. }
  1063. } );
  1064. //$.TE.plugin( 'eq', {
  1065. // 'click': function() {
  1066. // var _self = this,
  1067. // $html = $(
  1068. // '<div class="te_dialog_about Lovh">'+
  1069. // ' <div class="seltab">'+
  1070. // ' <div class="links Lovh">'+
  1071. // ' <a href="###" class="cstyle">关于ThinkEditor</a>'+
  1072. // ' </div>'+
  1073. // ' <div class="bdb">&nbsp;</div>'+
  1074. // ' </div>'+
  1075. // ' <div class="centbox">'+
  1076. // ' <div class="eqcontent">'+
  1077. // ' <label for="eq_name">名称</label>'+
  1078. // ' <input type="text" name="eq_name" id="eq_name"/></br>'+
  1079. // ' <label for="eq_name">值</label>'+
  1080. // ' <input type="text" name="eq_val" id="eq_val"/></br>'+
  1081. // ' <textarea name="eq_content" id="eq_content" cols="30" rows="2"></textarea>'+
  1082. // ' </div>'+
  1083. // ' </div>'+
  1084. // ' <div class="btnarea">'+
  1085. // ' <input type="button" value="确定" class="te_ok" />'+
  1086. // ' <input type="button" value="关闭" class="te_close" />'+
  1087. // ' </div>'+
  1088. // '</div>'
  1089. // );
  1090. //
  1091. // _self.createDialog({
  1092. // body: $html,
  1093. // ok : function(){
  1094. // var _name = $html.find('#eq_name').val(),
  1095. // _val = $html.find('#eq_val').val(),
  1096. // _content = $html.find('#eq_content').val(),
  1097. // _html = '';
  1098. // _html += '<eq name="' + _name +'" value="' + _val +'">'+
  1099. // _content +
  1100. // '</eq>';
  1101. // _self.editor.pasteHTML( _html );
  1102. // _self.hideDialog();
  1103. // }
  1104. // });
  1105. //
  1106. // }
  1107. //});
  1108. } )( jQuery );