rails_kindeditor 0.1.2 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (206) hide show
  1. data/README.rdoc +14 -99
  2. data/lib/generators/rails_kindeditor/install/install_generator.rb +2 -2
  3. data/lib/generators/rails_kindeditor/install/templates/kindeditor/kindeditor-min.js +165 -158
  4. data/lib/generators/rails_kindeditor/install/templates/kindeditor/lang/en.js +210 -208
  5. data/lib/generators/rails_kindeditor/install/templates/kindeditor/lang/zh_CN.js +214 -210
  6. data/lib/generators/rails_kindeditor/install/templates/kindeditor/lang/zh_TW.js +212 -210
  7. data/lib/generators/rails_kindeditor/install/templates/kindeditor/plugins/anchor/anchor.js +46 -0
  8. data/lib/generators/rails_kindeditor/install/templates/kindeditor/plugins/clearhtml/clearhtml.js +29 -28
  9. data/lib/generators/rails_kindeditor/install/templates/kindeditor/plugins/filemanager/filemanager.js +185 -189
  10. data/lib/generators/rails_kindeditor/install/templates/kindeditor/plugins/flash/flash.js +145 -128
  11. data/lib/generators/rails_kindeditor/install/templates/kindeditor/plugins/image/image.js +242 -226
  12. data/lib/generators/rails_kindeditor/install/templates/kindeditor/plugins/insertfile/insertfile.js +109 -104
  13. data/lib/generators/rails_kindeditor/install/templates/kindeditor/plugins/link/link.js +65 -59
  14. data/lib/generators/rails_kindeditor/install/templates/kindeditor/plugins/map/map.js +137 -135
  15. data/lib/generators/rails_kindeditor/install/templates/kindeditor/plugins/media/media.js +153 -136
  16. data/lib/generators/rails_kindeditor/install/templates/kindeditor/plugins/pagebreak/pagebreak.js +26 -26
  17. data/lib/generators/rails_kindeditor/install/templates/kindeditor/plugins/table/table.js +715 -661
  18. data/lib/generators/rails_kindeditor/install/templates/kindeditor/plugins/wordpaste/wordpaste.js +51 -57
  19. data/lib/generators/rails_kindeditor/install/templates/kindeditor/themes/common/anchor.gif +0 -0
  20. data/lib/generators/rails_kindeditor/install/templates/kindeditor/themes/default/default.css +980 -941
  21. data/lib/generators/rails_kindeditor/install/templates/kindeditor/themes/default/default.gif +0 -0
  22. data/lib/rails_kindeditor/helper.rb +9 -10
  23. data/lib/rails_kindeditor/version.rb +1 -1
  24. metadata +29 -231
  25. data/vendor/assets/javascripts/kindeditor.js +0 -158
  26. data/vendor/assets/javascripts/lang/en.js +0 -208
  27. data/vendor/assets/javascripts/lang/zh_CN.js +0 -210
  28. data/vendor/assets/javascripts/lang/zh_TW.js +0 -210
  29. data/vendor/assets/javascripts/plugins/clearhtml/clearhtml.js +0 -28
  30. data/vendor/assets/javascripts/plugins/code/code.js +0 -57
  31. data/vendor/assets/javascripts/plugins/code/prettify.css +0 -13
  32. data/vendor/assets/javascripts/plugins/code/prettify.js +0 -28
  33. data/vendor/assets/javascripts/plugins/emoticons/emoticons.js +0 -129
  34. data/vendor/assets/javascripts/plugins/emoticons/images/0.gif +0 -0
  35. data/vendor/assets/javascripts/plugins/emoticons/images/1.gif +0 -0
  36. data/vendor/assets/javascripts/plugins/emoticons/images/10.gif +0 -0
  37. data/vendor/assets/javascripts/plugins/emoticons/images/100.gif +0 -0
  38. data/vendor/assets/javascripts/plugins/emoticons/images/101.gif +0 -0
  39. data/vendor/assets/javascripts/plugins/emoticons/images/102.gif +0 -0
  40. data/vendor/assets/javascripts/plugins/emoticons/images/103.gif +0 -0
  41. data/vendor/assets/javascripts/plugins/emoticons/images/104.gif +0 -0
  42. data/vendor/assets/javascripts/plugins/emoticons/images/105.gif +0 -0
  43. data/vendor/assets/javascripts/plugins/emoticons/images/106.gif +0 -0
  44. data/vendor/assets/javascripts/plugins/emoticons/images/107.gif +0 -0
  45. data/vendor/assets/javascripts/plugins/emoticons/images/108.gif +0 -0
  46. data/vendor/assets/javascripts/plugins/emoticons/images/109.gif +0 -0
  47. data/vendor/assets/javascripts/plugins/emoticons/images/11.gif +0 -0
  48. data/vendor/assets/javascripts/plugins/emoticons/images/110.gif +0 -0
  49. data/vendor/assets/javascripts/plugins/emoticons/images/111.gif +0 -0
  50. data/vendor/assets/javascripts/plugins/emoticons/images/112.gif +0 -0
  51. data/vendor/assets/javascripts/plugins/emoticons/images/113.gif +0 -0
  52. data/vendor/assets/javascripts/plugins/emoticons/images/114.gif +0 -0
  53. data/vendor/assets/javascripts/plugins/emoticons/images/115.gif +0 -0
  54. data/vendor/assets/javascripts/plugins/emoticons/images/116.gif +0 -0
  55. data/vendor/assets/javascripts/plugins/emoticons/images/117.gif +0 -0
  56. data/vendor/assets/javascripts/plugins/emoticons/images/118.gif +0 -0
  57. data/vendor/assets/javascripts/plugins/emoticons/images/119.gif +0 -0
  58. data/vendor/assets/javascripts/plugins/emoticons/images/12.gif +0 -0
  59. data/vendor/assets/javascripts/plugins/emoticons/images/120.gif +0 -0
  60. data/vendor/assets/javascripts/plugins/emoticons/images/121.gif +0 -0
  61. data/vendor/assets/javascripts/plugins/emoticons/images/122.gif +0 -0
  62. data/vendor/assets/javascripts/plugins/emoticons/images/123.gif +0 -0
  63. data/vendor/assets/javascripts/plugins/emoticons/images/124.gif +0 -0
  64. data/vendor/assets/javascripts/plugins/emoticons/images/125.gif +0 -0
  65. data/vendor/assets/javascripts/plugins/emoticons/images/126.gif +0 -0
  66. data/vendor/assets/javascripts/plugins/emoticons/images/127.gif +0 -0
  67. data/vendor/assets/javascripts/plugins/emoticons/images/128.gif +0 -0
  68. data/vendor/assets/javascripts/plugins/emoticons/images/129.gif +0 -0
  69. data/vendor/assets/javascripts/plugins/emoticons/images/13.gif +0 -0
  70. data/vendor/assets/javascripts/plugins/emoticons/images/130.gif +0 -0
  71. data/vendor/assets/javascripts/plugins/emoticons/images/131.gif +0 -0
  72. data/vendor/assets/javascripts/plugins/emoticons/images/132.gif +0 -0
  73. data/vendor/assets/javascripts/plugins/emoticons/images/133.gif +0 -0
  74. data/vendor/assets/javascripts/plugins/emoticons/images/134.gif +0 -0
  75. data/vendor/assets/javascripts/plugins/emoticons/images/14.gif +0 -0
  76. data/vendor/assets/javascripts/plugins/emoticons/images/15.gif +0 -0
  77. data/vendor/assets/javascripts/plugins/emoticons/images/16.gif +0 -0
  78. data/vendor/assets/javascripts/plugins/emoticons/images/17.gif +0 -0
  79. data/vendor/assets/javascripts/plugins/emoticons/images/18.gif +0 -0
  80. data/vendor/assets/javascripts/plugins/emoticons/images/19.gif +0 -0
  81. data/vendor/assets/javascripts/plugins/emoticons/images/2.gif +0 -0
  82. data/vendor/assets/javascripts/plugins/emoticons/images/20.gif +0 -0
  83. data/vendor/assets/javascripts/plugins/emoticons/images/21.gif +0 -0
  84. data/vendor/assets/javascripts/plugins/emoticons/images/22.gif +0 -0
  85. data/vendor/assets/javascripts/plugins/emoticons/images/23.gif +0 -0
  86. data/vendor/assets/javascripts/plugins/emoticons/images/24.gif +0 -0
  87. data/vendor/assets/javascripts/plugins/emoticons/images/25.gif +0 -0
  88. data/vendor/assets/javascripts/plugins/emoticons/images/26.gif +0 -0
  89. data/vendor/assets/javascripts/plugins/emoticons/images/27.gif +0 -0
  90. data/vendor/assets/javascripts/plugins/emoticons/images/28.gif +0 -0
  91. data/vendor/assets/javascripts/plugins/emoticons/images/29.gif +0 -0
  92. data/vendor/assets/javascripts/plugins/emoticons/images/3.gif +0 -0
  93. data/vendor/assets/javascripts/plugins/emoticons/images/30.gif +0 -0
  94. data/vendor/assets/javascripts/plugins/emoticons/images/31.gif +0 -0
  95. data/vendor/assets/javascripts/plugins/emoticons/images/32.gif +0 -0
  96. data/vendor/assets/javascripts/plugins/emoticons/images/33.gif +0 -0
  97. data/vendor/assets/javascripts/plugins/emoticons/images/34.gif +0 -0
  98. data/vendor/assets/javascripts/plugins/emoticons/images/35.gif +0 -0
  99. data/vendor/assets/javascripts/plugins/emoticons/images/36.gif +0 -0
  100. data/vendor/assets/javascripts/plugins/emoticons/images/37.gif +0 -0
  101. data/vendor/assets/javascripts/plugins/emoticons/images/38.gif +0 -0
  102. data/vendor/assets/javascripts/plugins/emoticons/images/39.gif +0 -0
  103. data/vendor/assets/javascripts/plugins/emoticons/images/4.gif +0 -0
  104. data/vendor/assets/javascripts/plugins/emoticons/images/40.gif +0 -0
  105. data/vendor/assets/javascripts/plugins/emoticons/images/41.gif +0 -0
  106. data/vendor/assets/javascripts/plugins/emoticons/images/42.gif +0 -0
  107. data/vendor/assets/javascripts/plugins/emoticons/images/43.gif +0 -0
  108. data/vendor/assets/javascripts/plugins/emoticons/images/44.gif +0 -0
  109. data/vendor/assets/javascripts/plugins/emoticons/images/45.gif +0 -0
  110. data/vendor/assets/javascripts/plugins/emoticons/images/46.gif +0 -0
  111. data/vendor/assets/javascripts/plugins/emoticons/images/47.gif +0 -0
  112. data/vendor/assets/javascripts/plugins/emoticons/images/48.gif +0 -0
  113. data/vendor/assets/javascripts/plugins/emoticons/images/49.gif +0 -0
  114. data/vendor/assets/javascripts/plugins/emoticons/images/5.gif +0 -0
  115. data/vendor/assets/javascripts/plugins/emoticons/images/50.gif +0 -0
  116. data/vendor/assets/javascripts/plugins/emoticons/images/51.gif +0 -0
  117. data/vendor/assets/javascripts/plugins/emoticons/images/52.gif +0 -0
  118. data/vendor/assets/javascripts/plugins/emoticons/images/53.gif +0 -0
  119. data/vendor/assets/javascripts/plugins/emoticons/images/54.gif +0 -0
  120. data/vendor/assets/javascripts/plugins/emoticons/images/55.gif +0 -0
  121. data/vendor/assets/javascripts/plugins/emoticons/images/56.gif +0 -0
  122. data/vendor/assets/javascripts/plugins/emoticons/images/57.gif +0 -0
  123. data/vendor/assets/javascripts/plugins/emoticons/images/58.gif +0 -0
  124. data/vendor/assets/javascripts/plugins/emoticons/images/59.gif +0 -0
  125. data/vendor/assets/javascripts/plugins/emoticons/images/6.gif +0 -0
  126. data/vendor/assets/javascripts/plugins/emoticons/images/60.gif +0 -0
  127. data/vendor/assets/javascripts/plugins/emoticons/images/61.gif +0 -0
  128. data/vendor/assets/javascripts/plugins/emoticons/images/62.gif +0 -0
  129. data/vendor/assets/javascripts/plugins/emoticons/images/63.gif +0 -0
  130. data/vendor/assets/javascripts/plugins/emoticons/images/64.gif +0 -0
  131. data/vendor/assets/javascripts/plugins/emoticons/images/65.gif +0 -0
  132. data/vendor/assets/javascripts/plugins/emoticons/images/66.gif +0 -0
  133. data/vendor/assets/javascripts/plugins/emoticons/images/67.gif +0 -0
  134. data/vendor/assets/javascripts/plugins/emoticons/images/68.gif +0 -0
  135. data/vendor/assets/javascripts/plugins/emoticons/images/69.gif +0 -0
  136. data/vendor/assets/javascripts/plugins/emoticons/images/7.gif +0 -0
  137. data/vendor/assets/javascripts/plugins/emoticons/images/70.gif +0 -0
  138. data/vendor/assets/javascripts/plugins/emoticons/images/71.gif +0 -0
  139. data/vendor/assets/javascripts/plugins/emoticons/images/72.gif +0 -0
  140. data/vendor/assets/javascripts/plugins/emoticons/images/73.gif +0 -0
  141. data/vendor/assets/javascripts/plugins/emoticons/images/74.gif +0 -0
  142. data/vendor/assets/javascripts/plugins/emoticons/images/75.gif +0 -0
  143. data/vendor/assets/javascripts/plugins/emoticons/images/76.gif +0 -0
  144. data/vendor/assets/javascripts/plugins/emoticons/images/77.gif +0 -0
  145. data/vendor/assets/javascripts/plugins/emoticons/images/78.gif +0 -0
  146. data/vendor/assets/javascripts/plugins/emoticons/images/79.gif +0 -0
  147. data/vendor/assets/javascripts/plugins/emoticons/images/8.gif +0 -0
  148. data/vendor/assets/javascripts/plugins/emoticons/images/80.gif +0 -0
  149. data/vendor/assets/javascripts/plugins/emoticons/images/81.gif +0 -0
  150. data/vendor/assets/javascripts/plugins/emoticons/images/82.gif +0 -0
  151. data/vendor/assets/javascripts/plugins/emoticons/images/83.gif +0 -0
  152. data/vendor/assets/javascripts/plugins/emoticons/images/84.gif +0 -0
  153. data/vendor/assets/javascripts/plugins/emoticons/images/85.gif +0 -0
  154. data/vendor/assets/javascripts/plugins/emoticons/images/86.gif +0 -0
  155. data/vendor/assets/javascripts/plugins/emoticons/images/87.gif +0 -0
  156. data/vendor/assets/javascripts/plugins/emoticons/images/88.gif +0 -0
  157. data/vendor/assets/javascripts/plugins/emoticons/images/89.gif +0 -0
  158. data/vendor/assets/javascripts/plugins/emoticons/images/9.gif +0 -0
  159. data/vendor/assets/javascripts/plugins/emoticons/images/90.gif +0 -0
  160. data/vendor/assets/javascripts/plugins/emoticons/images/91.gif +0 -0
  161. data/vendor/assets/javascripts/plugins/emoticons/images/92.gif +0 -0
  162. data/vendor/assets/javascripts/plugins/emoticons/images/93.gif +0 -0
  163. data/vendor/assets/javascripts/plugins/emoticons/images/94.gif +0 -0
  164. data/vendor/assets/javascripts/plugins/emoticons/images/95.gif +0 -0
  165. data/vendor/assets/javascripts/plugins/emoticons/images/96.gif +0 -0
  166. data/vendor/assets/javascripts/plugins/emoticons/images/97.gif +0 -0
  167. data/vendor/assets/javascripts/plugins/emoticons/images/98.gif +0 -0
  168. data/vendor/assets/javascripts/plugins/emoticons/images/99.gif +0 -0
  169. data/vendor/assets/javascripts/plugins/emoticons/images/static.gif +0 -0
  170. data/vendor/assets/javascripts/plugins/filemanager/filemanager.js +0 -189
  171. data/vendor/assets/javascripts/plugins/filemanager/images/file-16.gif +0 -0
  172. data/vendor/assets/javascripts/plugins/filemanager/images/file-64.gif +0 -0
  173. data/vendor/assets/javascripts/plugins/filemanager/images/folder-16.gif +0 -0
  174. data/vendor/assets/javascripts/plugins/filemanager/images/folder-64.gif +0 -0
  175. data/vendor/assets/javascripts/plugins/filemanager/images/go-up.gif +0 -0
  176. data/vendor/assets/javascripts/plugins/flash/flash.js +0 -128
  177. data/vendor/assets/javascripts/plugins/image/image.js +0 -226
  178. data/vendor/assets/javascripts/plugins/image/images/align_left.gif +0 -0
  179. data/vendor/assets/javascripts/plugins/image/images/align_right.gif +0 -0
  180. data/vendor/assets/javascripts/plugins/image/images/align_top.gif +0 -0
  181. data/vendor/assets/javascripts/plugins/image/images/refresh.gif +0 -0
  182. data/vendor/assets/javascripts/plugins/insertfile/insertfile.js +0 -104
  183. data/vendor/assets/javascripts/plugins/lineheight/lineheight.js +0 -38
  184. data/vendor/assets/javascripts/plugins/link/link.js +0 -59
  185. data/vendor/assets/javascripts/plugins/map/map.html +0 -57
  186. data/vendor/assets/javascripts/plugins/map/map.js +0 -135
  187. data/vendor/assets/javascripts/plugins/media/media.js +0 -136
  188. data/vendor/assets/javascripts/plugins/pagebreak/pagebreak.js +0 -26
  189. data/vendor/assets/javascripts/plugins/plainpaste/plainpaste.js +0 -41
  190. data/vendor/assets/javascripts/plugins/preview/preview.js +0 -31
  191. data/vendor/assets/javascripts/plugins/quickformat/quickformat.js +0 -71
  192. data/vendor/assets/javascripts/plugins/table/table.js +0 -661
  193. data/vendor/assets/javascripts/plugins/template/html/1.html +0 -14
  194. data/vendor/assets/javascripts/plugins/template/html/2.html +0 -42
  195. data/vendor/assets/javascripts/plugins/template/html/3.html +0 -36
  196. data/vendor/assets/javascripts/plugins/template/template.js +0 -58
  197. data/vendor/assets/javascripts/plugins/wordpaste/wordpaste.js +0 -57
  198. data/vendor/assets/stylesheets/bg.gif +0 -0
  199. data/vendor/assets/stylesheets/default.gif +0 -0
  200. data/vendor/assets/stylesheets/kindeditor.css +0 -942
  201. data/vendor/assets/stylesheets/themes/common/blank.gif +0 -0
  202. data/vendor/assets/stylesheets/themes/common/flash.gif +0 -0
  203. data/vendor/assets/stylesheets/themes/common/loading.gif +0 -0
  204. data/vendor/assets/stylesheets/themes/common/media.gif +0 -0
  205. data/vendor/assets/stylesheets/themes/common/rm.gif +0 -0
  206. data/vendor/assets/stylesheets/themes/simple/simple.css +0 -148
@@ -1,226 +0,0 @@
1
- /*******************************************************************************
2
- * KindEditor - WYSIWYG HTML Editor for Internet
3
- * Copyright (C) 2006-2011 kindsoft.net
4
- *
5
- * @author Roddy <luolonghao@gmail.com>
6
- * @site http://www.kindsoft.net/
7
- * @licence http://www.kindsoft.net/license.php
8
- *******************************************************************************/
9
-
10
- KindEditor.plugin('image', function(K) {
11
- var self = this, name = 'image',
12
- allowImageUpload = K.undef(self.allowImageUpload, true),
13
- allowFileManager = K.undef(self.allowFileManager, false),
14
- uploadJson = K.undef(self.uploadJson, self.basePath + 'php/upload_json.php'),
15
- imgPath = self.basePath + 'plugins/image/images/',
16
- lang = self.lang(name + '.');
17
- self.plugin.image = {
18
- edit : function() {
19
- var html = [
20
- '<div style="padding:10px 20px;">',
21
- //tabs
22
- '<div class="tabs"></div>',
23
- //url or file
24
- '<div class="ke-dialog-row">',
25
- '<div class="tab1" style="display:none;">',
26
- '<label for="keUrl" style="width:60px;">' + lang.remoteUrl + '</label>',
27
- '<input type="text" id="keUrl" class="ke-input-text" name="url" value="" style="width:200px;" /> &nbsp;',
28
- '<span class="ke-button-common ke-button-outer">',
29
- '<input type="button" class="ke-button-common ke-button" name="viewServer" value="' + lang.viewServer + '" />',
30
- '</span>',
31
- '</div>',
32
- '<div class="tab2" style="display:none;">',
33
- '<label style="width:60px;">' + lang.localUrl + '</label>',
34
- '<input type="text" name="localUrl" class="ke-input-text" tabindex="-1" style="width:200px;" readonly="true" /> &nbsp;',
35
- '<input type="button" class="ke-upload-button" value="' + lang.viewServer + '" />',
36
- '</div>',
37
- '</div>',
38
- //size
39
- '<div class="ke-dialog-row">',
40
- '<label for="keWidth" style="width:60px;">' + lang.size + '</label>',
41
- lang.width + ' <input type="text" id="keWidth" class="ke-input-text ke-input-number" name="width" value="" maxlength="4" /> ',
42
- lang.height + ' <input type="text" class="ke-input-text ke-input-number" name="height" value="" maxlength="4" /> ',
43
- '<img class="ke-refresh-btn" src="' + imgPath + 'refresh.gif" width="16" height="16" alt="" style="cursor:pointer;" />',
44
- '</div>',
45
- //align
46
- '<div class="ke-dialog-row">',
47
- '<label style="width:60px;">' + lang.align + '</label>',
48
- '<input type="radio" name="align" class="ke-inline-block" value="" checked="checked" /> <img name="defaultImg" src="' + imgPath + 'align_top.gif" width="23" height="25" alt="" />',
49
- ' <input type="radio" name="align" class="ke-inline-block" value="left" /> <img name="leftImg" src="' + imgPath + 'align_left.gif" width="23" height="25" alt="" />',
50
- ' <input type="radio" name="align" class="ke-inline-block" value="right" /> <img name="rightImg" src="' + imgPath + 'align_right.gif" width="23" height="25" alt="" />',
51
- '</div>',
52
- //title
53
- '<div class="ke-dialog-row">',
54
- '<label for="keTitle" style="width:60px;">' + lang.imgTitle + '</label>',
55
- '<input type="text" id="keTitle" class="ke-input-text" name="title" value="" style="width:200px;" /></div>',
56
- '</div>',
57
- '</div>'
58
- ].join('');
59
- var dialogWidth = allowImageUpload ? 450 : 400;
60
- dialogHeight = allowImageUpload ? 300 : 250;
61
- var dialog = self.createDialog({
62
- name : name,
63
- width : dialogWidth,
64
- height : dialogHeight,
65
- title : self.lang(name),
66
- body : html,
67
- yesBtn : {
68
- name : self.lang('yes'),
69
- click : function(e) {
70
- // insert local image
71
- if (tabs.selectedIndex === 1) {
72
- uploadbutton.submit();
73
- return;
74
- }
75
- // insert remote image
76
- var url = urlBox.val(),
77
- width = widthBox.val(),
78
- height = heightBox.val(),
79
- title = titleBox.val(),
80
- align = '';
81
- alignBox.each(function() {
82
- if (this.checked) {
83
- align = this.value;
84
- return false;
85
- }
86
- });
87
- self.exec('insertimage', url, title, width, height, 0, align).hideDialog().focus();
88
- }
89
- },
90
- beforeRemove : function() {
91
- viewServerBtn.remove();
92
- widthBox.remove();
93
- heightBox.remove();
94
- refreshBtn.remove();
95
- uploadbutton.remove();
96
- }
97
- }),
98
- div = dialog.div;
99
-
100
- var tabs;
101
- if (allowImageUpload) {
102
- tabs = K.tabs({
103
- src : K('.tabs', div),
104
- afterSelect : function(i) {
105
-
106
- }
107
- });
108
- tabs.add({
109
- title : lang.remoteImage,
110
- panel : K('.tab1', div)
111
- });
112
- tabs.add({
113
- title : lang.localImage,
114
- panel : K('.tab2', div)
115
- });
116
- tabs.select(0);
117
- } else {
118
- K('.tab1', div).show();
119
- }
120
-
121
- var urlBox = K('[name="url"]', div),
122
- localUrlBox = K('[name="localUrl"]', div),
123
- viewServerBtn = K('[name="viewServer"]', div),
124
- widthBox = K('[name="width"]', div),
125
- heightBox = K('[name="height"]', div),
126
- refreshBtn = K('.ke-refresh-btn', div),
127
- titleBox = K('[name="title"]', div),
128
- alignBox = K('[name="align"]');
129
-
130
- var uploadbutton = K.uploadbutton({
131
- button : K('.ke-upload-button', div)[0],
132
- fieldName : 'imgFile',
133
- url : uploadJson + '?dir=image',
134
- afterUpload : function(data) {
135
- if (data.error === 0) {
136
- var width = widthBox.val(),
137
- height = heightBox.val(),
138
- title = titleBox.val(),
139
- align = '';
140
- alignBox.each(function() {
141
- if (this.checked) {
142
- align = this.value;
143
- return false;
144
- }
145
- });
146
- var url = K.formatUrl(data.url, 'absolute');
147
- self.exec('insertimage', url, title, width, height, 0, align).hideDialog().focus();
148
- if (self.afterUpload) {
149
- self.afterUpload.call(self, url);
150
- }
151
- } else {
152
- alert(data.message);
153
- }
154
- }
155
- });
156
- uploadbutton.fileBox.change(function(e) {
157
- localUrlBox.val(uploadbutton.fileBox.val());
158
- });
159
- if (allowFileManager) {
160
- viewServerBtn.click(function(e) {
161
- self.loadPlugin('filemanager', function() {
162
- self.plugin.filemanagerDialog({
163
- viewType : 'VIEW',
164
- dirName : 'image',
165
- clickFn : function(url, title) {
166
- if (self.dialogs.length > 1) {
167
- K('[name="url"]', div).val(url);
168
- self.hideDialog();
169
- }
170
- }
171
- });
172
- });
173
- });
174
- } else {
175
- viewServerBtn.hide();
176
- }
177
- var originalWidth = 0, originalHeight = 0;
178
- function setSize(width, height) {
179
- widthBox.val(width);
180
- heightBox.val(height);
181
- originalWidth = width;
182
- originalHeight = height;
183
- }
184
- refreshBtn.click(function(e) {
185
- var tempImg = K('<img src="' + urlBox.val() + '" />', self.edit.doc).css({
186
- position : 'absolute',
187
- visibility : 'hidden',
188
- top : 0,
189
- left : '1000px'
190
- });
191
- K(self.edit.doc.body).append(tempImg);
192
- setSize(tempImg.width(), tempImg.height());
193
- tempImg.remove();
194
- });
195
- widthBox.change(function(e) {
196
- if (originalWidth > 0) {
197
- heightBox.val(Math.round(originalHeight / originalWidth * parseInt(this.value, 10)));
198
- }
199
- });
200
- heightBox.change(function(e) {
201
- if (originalHeight > 0) {
202
- widthBox.val(Math.round(originalWidth / originalHeight * parseInt(this.value, 10)));
203
- }
204
- });
205
- urlBox.val('http://');
206
- var img = self.plugin.getSelectedImage();
207
- if (img) {
208
- urlBox.val(img.attr('data-ke-src'));
209
- setSize(img.width(), img.height());
210
- titleBox.val(img.attr('title'));
211
- alignBox.each(function() {
212
- if (this.value === img.attr('align')) {
213
- this.checked = true;
214
- return false;
215
- }
216
- });
217
- }
218
- urlBox[0].focus();
219
- urlBox[0].select();
220
- },
221
- 'delete' : function() {
222
- self.plugin.getSelectedImage().remove();
223
- }
224
- };
225
- self.clickToolbar(name, self.plugin.image.edit);
226
- });
@@ -1,104 +0,0 @@
1
- /*******************************************************************************
2
- * KindEditor - WYSIWYG HTML Editor for Internet
3
- * Copyright (C) 2006-2011 kindsoft.net
4
- *
5
- * @author Roddy <luolonghao@gmail.com>
6
- * @site http://www.kindsoft.net/
7
- * @licence http://www.kindsoft.net/license.php
8
- *******************************************************************************/
9
-
10
- KindEditor.plugin('insertfile', function(K) {
11
- var self = this, name = 'insertfile',
12
- allowFileManager = K.undef(self.allowFileManager, false),
13
- uploadJson = K.undef(self.uploadJson, self.basePath + 'php/upload_json.php'),
14
- lang = self.lang(name + '.');
15
- self.clickToolbar(name, function() {
16
- var html = [
17
- '<div style="padding:10px 20px;">',
18
- '<div class="ke-dialog-row">',
19
- '<label for="keUrl" style="width:60px;">' + lang.url + '</label>',
20
- '<input type="text" id="keUrl" name="url" class="ke-input-text" style="width:160px;" /> &nbsp;',
21
- '<input type="button" class="ke-upload-button" value="' + lang.upload + '" /> &nbsp;',
22
- '<span class="ke-button-common ke-button-outer">',
23
- '<input type="button" class="ke-button-common ke-button" name="viewServer" value="' + lang.viewServer + '" />',
24
- '</span>',
25
- '</div>',
26
- //title
27
- '<div class="ke-dialog-row">',
28
- '<label for="keTitle" style="width:60px;">' + lang.title + '</label>',
29
- '<input type="text" id="keTitle" class="ke-input-text" name="title" value="" style="width:160px;" /></div>',
30
- '</div>',
31
- //form end
32
- '</form>',
33
- '</div>'
34
- ].join('');
35
- var dialog = self.createDialog({
36
- name : name,
37
- width : 450,
38
- height : 180,
39
- title : self.lang(name),
40
- body : html,
41
- yesBtn : {
42
- name : self.lang('yes'),
43
- click : function(e) {
44
- var url = urlBox.val(),
45
- title = titleBox.val();
46
- if (K.trim(title) === '') {
47
- title = url;
48
- }
49
- var html = '<a href="' + url + '" data-ke-src="' + url + '" target="_blank">' + title + '</a>';
50
- self.insertHtml(html);
51
- uploadbutton.remove();
52
- self.hideDialog().focus();
53
- }
54
- }
55
- }),
56
- div = dialog.div;
57
-
58
- var urlBox = K('[name="url"]', div),
59
- viewServerBtn = K('[name="viewServer"]', div),
60
- titleBox = K('[name="title"]', div);
61
-
62
- var uploadbutton = K.uploadbutton({
63
- button : K('.ke-upload-button', div)[0],
64
- fieldName : 'imgFile',
65
- url : uploadJson + '?dir=file',
66
- afterUpload : function(data) {
67
- if (data.error === 0) {
68
- var url = K.formatUrl(data.url, 'absolute');
69
- urlBox.val(url);
70
- if (self.afterUpload) {
71
- self.afterUpload.call(self, url);
72
- }
73
- alert(self.lang('uploadSuccess'));
74
- } else {
75
- alert(data.message);
76
- }
77
- }
78
- });
79
- uploadbutton.fileBox.change(function(e) {
80
- uploadbutton.submit();
81
- });
82
- if (allowFileManager) {
83
- viewServerBtn.click(function(e) {
84
- self.loadPlugin('filemanager', function() {
85
- self.plugin.filemanagerDialog({
86
- viewType : 'LIST',
87
- dirName : 'file',
88
- clickFn : function(url, title) {
89
- if (self.dialogs.length > 1) {
90
- K('[name="url"]', div).val(url);
91
- self.hideDialog();
92
- }
93
- }
94
- });
95
- });
96
- });
97
- } else {
98
- viewServerBtn.hide();
99
- }
100
- urlBox.val('http://');
101
- urlBox[0].focus();
102
- urlBox[0].select();
103
- });
104
- });
@@ -1,38 +0,0 @@
1
- /*******************************************************************************
2
- * KindEditor - WYSIWYG HTML Editor for Internet
3
- * Copyright (C) 2006-2011 kindsoft.net
4
- *
5
- * @author Roddy <luolonghao@gmail.com>
6
- * @site http://www.kindsoft.net/
7
- * @licence http://www.kindsoft.net/license.php
8
- *******************************************************************************/
9
-
10
- KindEditor.plugin('lineheight', function(K) {
11
- var self = this, name = 'lineheight', lang = self.lang(name + '.');
12
- self.clickToolbar(name, function() {
13
- var curVal = '', commonNode = self.cmd.commonNode({'*' : '.line-height'});
14
- if (commonNode) {
15
- curVal = commonNode.css('line-height');
16
- }
17
- var menu = self.createMenu({
18
- name : name,
19
- width : 150
20
- });
21
- K.each(lang.lineHeight, function(i, row) {
22
- K.each(row, function(key, val) {
23
- menu.addItem({
24
- title : val,
25
- checked : curVal === key,
26
- click : function() {
27
- self.cmd.toggle('<span style="line-height:' + key + ';"></span>', {
28
- span : '.line-height=' + key
29
- });
30
- self.updateState();
31
- self.addBookmark();
32
- self.hideMenu();
33
- }
34
- });
35
- });
36
- });
37
- });
38
- });
@@ -1,59 +0,0 @@
1
- /*******************************************************************************
2
- * KindEditor - WYSIWYG HTML Editor for Internet
3
- * Copyright (C) 2006-2011 kindsoft.net
4
- *
5
- * @author Roddy <luolonghao@gmail.com>
6
- * @site http://www.kindsoft.net/
7
- * @licence http://www.kindsoft.net/license.php
8
- *******************************************************************************/
9
-
10
- KindEditor.plugin('link', function(K) {
11
- var self = this, name = 'link';
12
- self.plugin.link = {
13
- edit : function() {
14
- var lang = self.lang(name + '.'),
15
- html = '<div style="padding:10px 20px;">' +
16
- //url
17
- '<div class="ke-dialog-row">' +
18
- '<label for="keUrl">' + lang.url + '</label>' +
19
- '<input class="ke-input-text" type="text" id="keUrl" name="url" value="" style="width:90%;" /></div>' +
20
- //type
21
- '<div class="ke-dialog-row"">' +
22
- '<label for="keType">' + lang.linkType + '</label>' +
23
- '<select id="keType" name="type"></select>' +
24
- '</div>' +
25
- '</div>',
26
- dialog = self.createDialog({
27
- name : name,
28
- width : 400,
29
- title : self.lang(name),
30
- body : html,
31
- yesBtn : {
32
- name : self.lang('yes'),
33
- click : function(e) {
34
- self.exec('createlink', urlBox.val(), typeBox.val()).hideDialog().focus();
35
- }
36
- }
37
- }),
38
- div = dialog.div,
39
- urlBox = K('input[name="url"]', div),
40
- typeBox = K('select[name="type"]', div);
41
- urlBox.val('http://');
42
- typeBox[0].options[0] = new Option(lang.newWindow, '_blank');
43
- typeBox[0].options[1] = new Option(lang.selfWindow, '');
44
- var a = self.plugin.getSelectedLink();
45
- if (a) {
46
- self.cmd.range.selectNode(a[0]);
47
- self.cmd.select();
48
- urlBox.val(a.attr('data-ke-src'));
49
- typeBox.val(a.attr('target'));
50
- }
51
- urlBox[0].focus();
52
- urlBox[0].select();
53
- },
54
- 'delete' : function() {
55
- self.exec('unlink', null);
56
- }
57
- };
58
- self.clickToolbar(name, self.plugin.link.edit);
59
- });
@@ -1,57 +0,0 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
5
- <style>
6
- html { height: 100% }
7
- body { height: 100%; margin: 0; padding: 0; background-color: #FFF }
8
- #map_canvas { height: 100% }
9
- </style>
10
- <script src="http://maps.googleapis.com/maps/api/js?sensor=false&language=zh_CN"></script>
11
- <script>
12
- var map, geocoder;
13
- function initialize() {
14
- var latlng = new google.maps.LatLng(31.230393, 121.473704);
15
- var options = {
16
- zoom: 11,
17
- center: latlng,
18
- disableDefaultUI: true,
19
- panControl: true,
20
- zoomControl: true,
21
- mapTypeControl: true,
22
- scaleControl: true,
23
- streetViewControl: false,
24
- overviewMapControl: true,
25
- mapTypeId: google.maps.MapTypeId.ROADMAP
26
- };
27
- map = new google.maps.Map(document.getElementById("map_canvas"), options);
28
- geocoder = new google.maps.Geocoder();
29
- geocoder.geocode({latLng: latlng}, function(results, status) {
30
- if (status == google.maps.GeocoderStatus.OK) {
31
- if (results[3]) {
32
- parent.document.getElementById("kindeditor_plugin_map_address").value = results[3].formatted_address;
33
- }
34
- }
35
- });
36
- }
37
- function search(address) {
38
- if (!map) return;
39
- geocoder.geocode({address : address}, function(results, status) {
40
- if (status == google.maps.GeocoderStatus.OK) {
41
- map.setZoom(11);
42
- map.setCenter(results[0].geometry.location);
43
- var marker = new google.maps.Marker({
44
- map: map,
45
- position: results[0].geometry.location
46
- });
47
- } else {
48
- alert("Invalid address: " + address);
49
- }
50
- });
51
- }
52
- </script>
53
- </head>
54
- <body onload="initialize();">
55
- <div id="map_canvas" style="width:100%; height:100%"></div>
56
- </body>
57
- </html>