qqstyle.html 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8" />
  5. <title>Custom Theme Examples</title>
  6. <style>
  7. form {
  8. margin: 0;
  9. }
  10. textarea {
  11. display: block;
  12. }
  13. </style>
  14. <script charset="utf-8" src="../kindeditor-min.js"></script>
  15. <script charset="utf-8" src="../lang/zh_CN.js"></script>
  16. <script>
  17. KindEditor.ready(function(K) {
  18. K.each({
  19. 'plug-align' : {
  20. name : '对齐方式',
  21. method : {
  22. 'justifyleft' : '左对齐',
  23. 'justifycenter' : '居中对齐',
  24. 'justifyright' : '右对齐'
  25. }
  26. },
  27. 'plug-order' : {
  28. name : '编号',
  29. method : {
  30. 'insertorderedlist' : '数字编号',
  31. 'insertunorderedlist' : '项目编号'
  32. }
  33. },
  34. 'plug-indent' : {
  35. name : '缩进',
  36. method : {
  37. 'indent' : '向右缩进',
  38. 'outdent' : '向左缩进'
  39. }
  40. }
  41. },function( pluginName, pluginData ){
  42. var lang = {};
  43. lang[pluginName] = pluginData.name;
  44. KindEditor.lang( lang );
  45. KindEditor.plugin( pluginName, function(K) {
  46. var self = this;
  47. self.clickToolbar( pluginName, function() {
  48. var menu = self.createMenu({
  49. name : pluginName,
  50. width : pluginData.width || 100
  51. });
  52. K.each( pluginData.method, function( i, v ){
  53. menu.addItem({
  54. title : v,
  55. checked : false,
  56. iconClass : pluginName+'-'+i,
  57. click : function() {
  58. self.exec(i).hideMenu();
  59. }
  60. });
  61. })
  62. });
  63. });
  64. });
  65. K.create('#contentqq', {
  66. themeType : 'qq',
  67. items : [
  68. 'bold','italic','underline','fontname','fontsize','forecolor','hilitecolor','plug-align','plug-order','plug-indent','link'
  69. ]
  70. });
  71. });
  72. </script>
  73. </head>
  74. <body>
  75. <h3>QQ风格</h3>
  76. <textarea id="contentqq" name="content" style="width:700px;height:200px;visibility:hidden;"></textarea>
  77. </body>
  78. </html>