rails_kindeditor_video 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (242) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +5 -0
  3. data/Gemfile +6 -0
  4. data/README.md +473 -0
  5. data/Rakefile +2 -0
  6. data/app/assets/javascripts/kindeditor.js +1 -0
  7. data/app/controllers/kindeditor/assets_controller.rb +127 -0
  8. data/app/uploaders/kindeditor/asset_uploader.rb +89 -0
  9. data/app/uploaders/kindeditor/file_uploader.rb +10 -0
  10. data/app/uploaders/kindeditor/flash_uploader.rb +10 -0
  11. data/app/uploaders/kindeditor/image_uploader.rb +10 -0
  12. data/app/uploaders/kindeditor/media_uploader.rb +10 -0
  13. data/config/routes.rb +6 -0
  14. data/lib/generators/rails_kindeditor/install/USAGE +10 -0
  15. data/lib/generators/rails_kindeditor/install/install_generator.rb +23 -0
  16. data/lib/generators/rails_kindeditor/install/templates/application.js +17 -0
  17. data/lib/generators/rails_kindeditor/install/templates/rails_kindeditor.rb +29 -0
  18. data/lib/generators/rails_kindeditor/migration/USAGE +14 -0
  19. data/lib/generators/rails_kindeditor/migration/migration_generator.rb +36 -0
  20. data/lib/generators/rails_kindeditor/migration/templates/migration/migration.rb +18 -0
  21. data/lib/generators/rails_kindeditor/migration/templates/models/active_record/kindeditor/asset.rb +14 -0
  22. data/lib/generators/rails_kindeditor/migration/templates/models/active_record/kindeditor/file.rb +3 -0
  23. data/lib/generators/rails_kindeditor/migration/templates/models/active_record/kindeditor/flash.rb +3 -0
  24. data/lib/generators/rails_kindeditor/migration/templates/models/active_record/kindeditor/image.rb +3 -0
  25. data/lib/generators/rails_kindeditor/migration/templates/models/active_record/kindeditor/media.rb +3 -0
  26. data/lib/generators/rails_kindeditor/migration/templates/models/mongoid/kindeditor/asset.rb +27 -0
  27. data/lib/generators/rails_kindeditor/migration/templates/models/mongoid/kindeditor/file.rb +3 -0
  28. data/lib/generators/rails_kindeditor/migration/templates/models/mongoid/kindeditor/flash.rb +3 -0
  29. data/lib/generators/rails_kindeditor/migration/templates/models/mongoid/kindeditor/image.rb +3 -0
  30. data/lib/generators/rails_kindeditor/migration/templates/models/mongoid/kindeditor/media.rb +3 -0
  31. data/lib/rails_kindeditor/active_record.rb +14 -0
  32. data/lib/rails_kindeditor/engine.rb +34 -0
  33. data/lib/rails_kindeditor/formtastic.rb +12 -0
  34. data/lib/rails_kindeditor/helper.rb +117 -0
  35. data/lib/rails_kindeditor/simple_form.rb +11 -0
  36. data/lib/rails_kindeditor/version.rb +4 -0
  37. data/lib/rails_kindeditor.rb +61 -0
  38. data/lib/rails_kindeditor_video.rb +1 -0
  39. data/lib/tasks/assets.rake +9 -0
  40. data/rails_kindeditor_video.gemspec +24 -0
  41. data/screenshots/rails_kindeditor.png +0 -0
  42. data/screenshots/simple_mode.png +0 -0
  43. data/vendor/assets/javascripts/kindeditor/kindeditor.js +9909 -0
  44. data/vendor/assets/javascripts/kindeditor/lang/ar.js +242 -0
  45. data/vendor/assets/javascripts/kindeditor/lang/en.js +241 -0
  46. data/vendor/assets/javascripts/kindeditor/lang/ko.js +246 -0
  47. data/vendor/assets/javascripts/kindeditor/lang/ru.js +242 -0
  48. data/vendor/assets/javascripts/kindeditor/lang/zh-CN.js +238 -0
  49. data/vendor/assets/javascripts/kindeditor/lang/zh-TW.js +243 -0
  50. data/vendor/assets/javascripts/kindeditor/plugins/anchor/anchor.js +46 -0
  51. data/vendor/assets/javascripts/kindeditor/plugins/autoheight/autoheight.js +54 -0
  52. data/vendor/assets/javascripts/kindeditor/plugins/baidumap/baidumap.js +93 -0
  53. data/vendor/assets/javascripts/kindeditor/plugins/baidumap/index.html +83 -0
  54. data/vendor/assets/javascripts/kindeditor/plugins/baidumap/map.html +43 -0
  55. data/vendor/assets/javascripts/kindeditor/plugins/clearhtml/clearhtml.js +29 -0
  56. data/vendor/assets/javascripts/kindeditor/plugins/code/code.js +62 -0
  57. data/vendor/assets/javascripts/kindeditor/plugins/code/prettify.css +13 -0
  58. data/vendor/assets/javascripts/kindeditor/plugins/code/prettify.js +28 -0
  59. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/emoticons.js +129 -0
  60. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/0.gif +0 -0
  61. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/1.gif +0 -0
  62. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/10.gif +0 -0
  63. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/100.gif +0 -0
  64. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/101.gif +0 -0
  65. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/102.gif +0 -0
  66. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/103.gif +0 -0
  67. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/104.gif +0 -0
  68. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/105.gif +0 -0
  69. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/106.gif +0 -0
  70. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/107.gif +0 -0
  71. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/108.gif +0 -0
  72. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/109.gif +0 -0
  73. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/11.gif +0 -0
  74. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/110.gif +0 -0
  75. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/111.gif +0 -0
  76. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/112.gif +0 -0
  77. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/113.gif +0 -0
  78. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/114.gif +0 -0
  79. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/115.gif +0 -0
  80. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/116.gif +0 -0
  81. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/117.gif +0 -0
  82. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/118.gif +0 -0
  83. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/119.gif +0 -0
  84. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/12.gif +0 -0
  85. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/120.gif +0 -0
  86. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/121.gif +0 -0
  87. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/122.gif +0 -0
  88. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/123.gif +0 -0
  89. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/124.gif +0 -0
  90. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/125.gif +0 -0
  91. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/126.gif +0 -0
  92. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/127.gif +0 -0
  93. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/128.gif +0 -0
  94. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/129.gif +0 -0
  95. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/13.gif +0 -0
  96. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/130.gif +0 -0
  97. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/131.gif +0 -0
  98. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/132.gif +0 -0
  99. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/133.gif +0 -0
  100. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/134.gif +0 -0
  101. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/14.gif +0 -0
  102. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/15.gif +0 -0
  103. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/16.gif +0 -0
  104. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/17.gif +0 -0
  105. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/18.gif +0 -0
  106. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/19.gif +0 -0
  107. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/2.gif +0 -0
  108. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/20.gif +0 -0
  109. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/21.gif +0 -0
  110. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/22.gif +0 -0
  111. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/23.gif +0 -0
  112. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/24.gif +0 -0
  113. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/25.gif +0 -0
  114. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/26.gif +0 -0
  115. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/27.gif +0 -0
  116. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/28.gif +0 -0
  117. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/29.gif +0 -0
  118. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/3.gif +0 -0
  119. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/30.gif +0 -0
  120. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/31.gif +0 -0
  121. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/32.gif +0 -0
  122. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/33.gif +0 -0
  123. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/34.gif +0 -0
  124. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/35.gif +0 -0
  125. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/36.gif +0 -0
  126. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/37.gif +0 -0
  127. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/38.gif +0 -0
  128. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/39.gif +0 -0
  129. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/4.gif +0 -0
  130. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/40.gif +0 -0
  131. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/41.gif +0 -0
  132. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/42.gif +0 -0
  133. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/43.gif +0 -0
  134. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/44.gif +0 -0
  135. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/45.gif +0 -0
  136. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/46.gif +0 -0
  137. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/47.gif +0 -0
  138. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/48.gif +0 -0
  139. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/49.gif +0 -0
  140. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/5.gif +0 -0
  141. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/50.gif +0 -0
  142. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/51.gif +0 -0
  143. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/52.gif +0 -0
  144. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/53.gif +0 -0
  145. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/54.gif +0 -0
  146. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/55.gif +0 -0
  147. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/56.gif +0 -0
  148. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/57.gif +0 -0
  149. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/58.gif +0 -0
  150. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/59.gif +0 -0
  151. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/6.gif +0 -0
  152. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/60.gif +0 -0
  153. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/61.gif +0 -0
  154. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/62.gif +0 -0
  155. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/63.gif +0 -0
  156. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/64.gif +0 -0
  157. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/65.gif +0 -0
  158. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/66.gif +0 -0
  159. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/67.gif +0 -0
  160. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/68.gif +0 -0
  161. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/69.gif +0 -0
  162. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/7.gif +0 -0
  163. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/70.gif +0 -0
  164. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/71.gif +0 -0
  165. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/72.gif +0 -0
  166. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/73.gif +0 -0
  167. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/74.gif +0 -0
  168. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/75.gif +0 -0
  169. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/76.gif +0 -0
  170. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/77.gif +0 -0
  171. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/78.gif +0 -0
  172. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/79.gif +0 -0
  173. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/8.gif +0 -0
  174. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/80.gif +0 -0
  175. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/81.gif +0 -0
  176. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/82.gif +0 -0
  177. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/83.gif +0 -0
  178. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/84.gif +0 -0
  179. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/85.gif +0 -0
  180. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/86.gif +0 -0
  181. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/87.gif +0 -0
  182. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/88.gif +0 -0
  183. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/89.gif +0 -0
  184. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/9.gif +0 -0
  185. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/90.gif +0 -0
  186. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/91.gif +0 -0
  187. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/92.gif +0 -0
  188. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/93.gif +0 -0
  189. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/94.gif +0 -0
  190. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/95.gif +0 -0
  191. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/96.gif +0 -0
  192. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/97.gif +0 -0
  193. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/98.gif +0 -0
  194. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/99.gif +0 -0
  195. data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/static.gif +0 -0
  196. data/vendor/assets/javascripts/kindeditor/plugins/filemanager/filemanager.js +189 -0
  197. data/vendor/assets/javascripts/kindeditor/plugins/filemanager/images/file-16.gif +0 -0
  198. data/vendor/assets/javascripts/kindeditor/plugins/filemanager/images/file-64.gif +0 -0
  199. data/vendor/assets/javascripts/kindeditor/plugins/filemanager/images/folder-16.gif +0 -0
  200. data/vendor/assets/javascripts/kindeditor/plugins/filemanager/images/folder-64.gif +0 -0
  201. data/vendor/assets/javascripts/kindeditor/plugins/filemanager/images/go-up.gif +0 -0
  202. data/vendor/assets/javascripts/kindeditor/plugins/fixtoolbar/fixtoolbar.js +35 -0
  203. data/vendor/assets/javascripts/kindeditor/plugins/flash/flash.js +161 -0
  204. data/vendor/assets/javascripts/kindeditor/plugins/image/image.js +328 -0
  205. data/vendor/assets/javascripts/kindeditor/plugins/image/images/align_left.gif +0 -0
  206. data/vendor/assets/javascripts/kindeditor/plugins/image/images/align_right.gif +0 -0
  207. data/vendor/assets/javascripts/kindeditor/plugins/image/images/align_top.gif +0 -0
  208. data/vendor/assets/javascripts/kindeditor/plugins/image/images/refresh.png +0 -0
  209. data/vendor/assets/javascripts/kindeditor/plugins/insertfile/insertfile.js +138 -0
  210. data/vendor/assets/javascripts/kindeditor/plugins/lineheight/lineheight.js +38 -0
  211. data/vendor/assets/javascripts/kindeditor/plugins/link/link.js +66 -0
  212. data/vendor/assets/javascripts/kindeditor/plugins/map/map.html +57 -0
  213. data/vendor/assets/javascripts/kindeditor/plugins/map/map.js +137 -0
  214. data/vendor/assets/javascripts/kindeditor/plugins/media/media.js +170 -0
  215. data/vendor/assets/javascripts/kindeditor/plugins/multiimage/images/image.png +0 -0
  216. data/vendor/assets/javascripts/kindeditor/plugins/multiimage/images/select-files-en.png +0 -0
  217. data/vendor/assets/javascripts/kindeditor/plugins/multiimage/images/select-files-zh-CN.png +0 -0
  218. data/vendor/assets/javascripts/kindeditor/plugins/multiimage/images/swfupload.swf +0 -0
  219. data/vendor/assets/javascripts/kindeditor/plugins/multiimage/multiimage.js +1384 -0
  220. data/vendor/assets/javascripts/kindeditor/plugins/pagebreak/pagebreak.js +27 -0
  221. data/vendor/assets/javascripts/kindeditor/plugins/plainpaste/plainpaste.js +41 -0
  222. data/vendor/assets/javascripts/kindeditor/plugins/preview/preview.js +31 -0
  223. data/vendor/assets/javascripts/kindeditor/plugins/quickformat/quickformat.js +81 -0
  224. data/vendor/assets/javascripts/kindeditor/plugins/table/table.js +712 -0
  225. data/vendor/assets/javascripts/kindeditor/plugins/template/html/1.html +14 -0
  226. data/vendor/assets/javascripts/kindeditor/plugins/template/html/2.html +42 -0
  227. data/vendor/assets/javascripts/kindeditor/plugins/template/html/3.html +36 -0
  228. data/vendor/assets/javascripts/kindeditor/plugins/template/template.js +58 -0
  229. data/vendor/assets/javascripts/kindeditor/plugins/wordpaste/wordpaste.js +51 -0
  230. data/vendor/assets/javascripts/kindeditor/themes/common/anchor.gif +0 -0
  231. data/vendor/assets/javascripts/kindeditor/themes/common/blank.gif +0 -0
  232. data/vendor/assets/javascripts/kindeditor/themes/common/flash.gif +0 -0
  233. data/vendor/assets/javascripts/kindeditor/themes/common/loading.gif +0 -0
  234. data/vendor/assets/javascripts/kindeditor/themes/common/media.gif +0 -0
  235. data/vendor/assets/javascripts/kindeditor/themes/common/rm.gif +0 -0
  236. data/vendor/assets/javascripts/kindeditor/themes/default/background.png +0 -0
  237. data/vendor/assets/javascripts/kindeditor/themes/default/default.css +1147 -0
  238. data/vendor/assets/javascripts/kindeditor/themes/default/default.png +0 -0
  239. data/vendor/assets/javascripts/kindeditor/themes/qq/editor.gif +0 -0
  240. data/vendor/assets/javascripts/kindeditor/themes/qq/qq.css +143 -0
  241. data/vendor/assets/javascripts/kindeditor/themes/simple/simple.css +100 -0
  242. metadata +312 -0
@@ -0,0 +1,328 @@
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
+ allowImageRemote = K.undef(self.allowImageRemote, true),
14
+ formatUploadUrl = K.undef(self.formatUploadUrl, true),
15
+ allowFileManager = K.undef(self.allowFileManager, false),
16
+ uploadJson = K.undef(self.uploadJson, self.basePath + 'php/upload_json.php'),
17
+ imageTabIndex = K.undef(self.imageTabIndex, 0),
18
+ imgPath = self.pluginsPath + 'image/images/',
19
+ extraParams = K.undef(self.extraFileUploadParams, {}),
20
+ filePostName = K.undef(self.filePostName, 'imgFile'),
21
+ fillDescAfterUploadImage = K.undef(self.fillDescAfterUploadImage, false),
22
+ lang = self.lang(name + '.');
23
+
24
+ self.plugin.imageDialog = function(options) {
25
+ var imageUrl = options.imageUrl,
26
+ imageWidth = K.undef(options.imageWidth, ''),
27
+ imageHeight = K.undef(options.imageHeight, ''),
28
+ imageTitle = K.undef(options.imageTitle, ''),
29
+ imageAlign = K.undef(options.imageAlign, ''),
30
+ showRemote = K.undef(options.showRemote, true),
31
+ showLocal = K.undef(options.showLocal, true),
32
+ tabIndex = K.undef(options.tabIndex, 0),
33
+ clickFn = options.clickFn;
34
+ var target = 'kindeditor_upload_iframe_' + new Date().getTime();
35
+ var hiddenElements = [];
36
+ for(var k in extraParams){
37
+ hiddenElements.push('<input type="hidden" name="' + k + '" value="' + extraParams[k] + '" />');
38
+ }
39
+ var html = [
40
+ '<div style="padding:20px;">',
41
+ //tabs
42
+ '<div class="tabs"></div>',
43
+ //remote image - start
44
+ '<div class="tab1" style="display:none;">',
45
+ //url
46
+ '<div class="ke-dialog-row">',
47
+ '<label for="remoteUrl" style="width:60px;">' + lang.remoteUrl + '</label>',
48
+ '<input type="text" id="remoteUrl" class="ke-input-text" name="url" value="" style="width:200px;" /> &nbsp;',
49
+ '<span class="ke-button-common ke-button-outer">',
50
+ '<input type="button" class="ke-button-common ke-button" name="viewServer" value="' + lang.viewServer + '" />',
51
+ '</span>',
52
+ '</div>',
53
+ //size
54
+ '<div class="ke-dialog-row">',
55
+ '<label for="remoteWidth" style="width:60px;">' + lang.size + '</label>',
56
+ lang.width + ' <input type="text" id="remoteWidth" class="ke-input-text ke-input-number" name="width" value="" maxlength="4" /> ',
57
+ lang.height + ' <input type="text" class="ke-input-text ke-input-number" name="height" value="" maxlength="4" /> ',
58
+ '<img class="ke-refresh-btn" src="' + imgPath + 'refresh.png" width="16" height="16" alt="" style="cursor:pointer;" title="' + lang.resetSize + '" />',
59
+ '</div>',
60
+ //align
61
+ '<div class="ke-dialog-row">',
62
+ '<label style="width:60px;">' + lang.align + '</label>',
63
+ '<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="" />',
64
+ ' <input type="radio" name="align" class="ke-inline-block" value="left" /> <img name="leftImg" src="' + imgPath + 'align_left.gif" width="23" height="25" alt="" />',
65
+ ' <input type="radio" name="align" class="ke-inline-block" value="right" /> <img name="rightImg" src="' + imgPath + 'align_right.gif" width="23" height="25" alt="" />',
66
+ '</div>',
67
+ //title
68
+ '<div class="ke-dialog-row">',
69
+ '<label for="remoteTitle" style="width:60px;">' + lang.imgTitle + '</label>',
70
+ '<input type="text" id="remoteTitle" class="ke-input-text" name="title" value="" style="width:200px;" />',
71
+ '</div>',
72
+ '</div>',
73
+ //remote image - end
74
+ //local upload - start
75
+ '<div class="tab2" style="display:none;">',
76
+ '<iframe name="' + target + '" style="display:none;"></iframe>',
77
+ '<form class="ke-upload-area ke-form" method="post" enctype="multipart/form-data" target="' + target + '" action="' + K.addParam(uploadJson, 'dir=image') + '">',
78
+ //file
79
+ '<div class="ke-dialog-row">',
80
+ hiddenElements.join(''),
81
+ '<label style="width:60px;">' + lang.localUrl + '</label>',
82
+ '<input type="text" name="localUrl" class="ke-input-text" tabindex="-1" style="width:200px;" readonly="true" /> &nbsp;',
83
+ '<input type="button" class="ke-upload-button" value="' + lang.upload + '" />',
84
+ '</div>',
85
+ '</form>',
86
+ '</div>',
87
+ //local upload - end
88
+ '</div>'
89
+ ].join('');
90
+ var dialogWidth = showLocal || allowFileManager ? 450 : 400,
91
+ dialogHeight = showLocal && showRemote ? 300 : 250;
92
+ var dialog = self.createDialog({
93
+ name : name,
94
+ width : dialogWidth,
95
+ height : dialogHeight,
96
+ title : self.lang(name),
97
+ body : html,
98
+ yesBtn : {
99
+ name : self.lang('yes'),
100
+ click : function(e) {
101
+ // Bugfix: http://code.google.com/p/kindeditor/issues/detail?id=319
102
+ if (dialog.isLoading) {
103
+ return;
104
+ }
105
+ // insert local image
106
+ if (showLocal && showRemote && tabs && tabs.selectedIndex === 1 || !showRemote) {
107
+ if (uploadbutton.fileBox.val() == '') {
108
+ alert(self.lang('pleaseSelectFile'));
109
+ return;
110
+ }
111
+ dialog.showLoading(self.lang('uploadLoading'));
112
+ uploadbutton.submit();
113
+ localUrlBox.val('');
114
+ return;
115
+ }
116
+ // insert remote image
117
+ var url = K.trim(urlBox.val()),
118
+ width = widthBox.val(),
119
+ height = heightBox.val(),
120
+ title = titleBox.val(),
121
+ align = '';
122
+ alignBox.each(function() {
123
+ if (this.checked) {
124
+ align = this.value;
125
+ return false;
126
+ }
127
+ });
128
+ if (url == 'http://' || K.invalidUrl(url)) {
129
+ alert(self.lang('invalidUrl'));
130
+ urlBox[0].focus();
131
+ return;
132
+ }
133
+ if (!/^\d*$/.test(width)) {
134
+ alert(self.lang('invalidWidth'));
135
+ widthBox[0].focus();
136
+ return;
137
+ }
138
+ if (!/^\d*$/.test(height)) {
139
+ alert(self.lang('invalidHeight'));
140
+ heightBox[0].focus();
141
+ return;
142
+ }
143
+ clickFn.call(self, url, title, width, height, 0, align);
144
+ }
145
+ },
146
+ beforeRemove : function() {
147
+ viewServerBtn.unbind();
148
+ widthBox.unbind();
149
+ heightBox.unbind();
150
+ refreshBtn.unbind();
151
+ }
152
+ }),
153
+ div = dialog.div;
154
+
155
+ var urlBox = K('[name="url"]', div),
156
+ localUrlBox = K('[name="localUrl"]', div),
157
+ viewServerBtn = K('[name="viewServer"]', div),
158
+ widthBox = K('.tab1 [name="width"]', div),
159
+ heightBox = K('.tab1 [name="height"]', div),
160
+ refreshBtn = K('.ke-refresh-btn', div),
161
+ titleBox = K('.tab1 [name="title"]', div),
162
+ alignBox = K('.tab1 [name="align"]', div);
163
+
164
+ var tabs;
165
+ if (showRemote && showLocal) {
166
+ tabs = K.tabs({
167
+ src : K('.tabs', div),
168
+ afterSelect : function(i) {}
169
+ });
170
+ tabs.add({
171
+ title : lang.remoteImage,
172
+ panel : K('.tab1', div)
173
+ });
174
+ tabs.add({
175
+ title : lang.localImage,
176
+ panel : K('.tab2', div)
177
+ });
178
+ tabs.select(tabIndex);
179
+ } else if (showRemote) {
180
+ K('.tab1', div).show();
181
+ } else if (showLocal) {
182
+ K('.tab2', div).show();
183
+ }
184
+
185
+ var uploadbutton = K.uploadbutton({
186
+ button : K('.ke-upload-button', div)[0],
187
+ fieldName : filePostName,
188
+ form : K('.ke-form', div),
189
+ target : target,
190
+ width: 60,
191
+ afterUpload : function(data) {
192
+ dialog.hideLoading();
193
+ if (data.error === 0) {
194
+ var url = data.url;
195
+ if (formatUploadUrl) {
196
+ url = K.formatUrl(url, 'absolute');
197
+ }
198
+ if (self.afterUpload) {
199
+ self.afterUpload.call(self, url, data, name);
200
+ }
201
+ if (!fillDescAfterUploadImage) {
202
+ clickFn.call(self, url, data.title, data.width, data.height, data.border, data.align);
203
+ } else {
204
+ K(".ke-dialog-row #remoteUrl", div).val(url);
205
+ K(".ke-tabs-li", div)[0].click();
206
+ K(".ke-refresh-btn", div).click();
207
+ }
208
+ } else {
209
+ alert(data.message);
210
+ }
211
+ },
212
+ afterError : function(html) {
213
+ dialog.hideLoading();
214
+ self.errorDialog(html);
215
+ }
216
+ });
217
+ uploadbutton.fileBox.change(function(e) {
218
+ localUrlBox.val(uploadbutton.fileBox.val());
219
+ });
220
+ if (allowFileManager) {
221
+ viewServerBtn.click(function(e) {
222
+ self.loadPlugin('filemanager', function() {
223
+ self.plugin.filemanagerDialog({
224
+ viewType : 'VIEW',
225
+ dirName : 'image',
226
+ clickFn : function(url, title) {
227
+ if (self.dialogs.length > 1) {
228
+ K('[name="url"]', div).val(url);
229
+ if (self.afterSelectFile) {
230
+ self.afterSelectFile.call(self, url);
231
+ }
232
+ self.hideDialog();
233
+ }
234
+ }
235
+ });
236
+ });
237
+ });
238
+ } else {
239
+ viewServerBtn.hide();
240
+ }
241
+ var originalWidth = 0, originalHeight = 0;
242
+ function setSize(width, height) {
243
+ widthBox.val(width);
244
+ heightBox.val(height);
245
+ originalWidth = width;
246
+ originalHeight = height;
247
+ }
248
+ refreshBtn.click(function(e) {
249
+ var tempImg = K('<img src="' + urlBox.val() + '" />', document).css({
250
+ position : 'absolute',
251
+ visibility : 'hidden',
252
+ top : 0,
253
+ left : '-1000px'
254
+ });
255
+ tempImg.bind('load', function() {
256
+ setSize(tempImg.width(), tempImg.height());
257
+ tempImg.remove();
258
+ });
259
+ K(document.body).append(tempImg);
260
+ });
261
+ widthBox.change(function(e) {
262
+ if (originalWidth > 0) {
263
+ heightBox.val(Math.round(originalHeight / originalWidth * parseInt(this.value, 10)));
264
+ }
265
+ });
266
+ heightBox.change(function(e) {
267
+ if (originalHeight > 0) {
268
+ widthBox.val(Math.round(originalWidth / originalHeight * parseInt(this.value, 10)));
269
+ }
270
+ });
271
+ urlBox.val(options.imageUrl);
272
+ setSize(options.imageWidth, options.imageHeight);
273
+ titleBox.val(options.imageTitle);
274
+ alignBox.each(function() {
275
+ if (this.value === options.imageAlign) {
276
+ this.checked = true;
277
+ return false;
278
+ }
279
+ });
280
+ if (showRemote && tabIndex === 0) {
281
+ urlBox[0].focus();
282
+ urlBox[0].select();
283
+ }
284
+ return dialog;
285
+ };
286
+ self.plugin.image = {
287
+ edit : function() {
288
+ var img = self.plugin.getSelectedImage();
289
+ self.plugin.imageDialog({
290
+ imageUrl : img ? img.attr('data-ke-src') : 'http://',
291
+ imageWidth : img ? img.width() : '',
292
+ imageHeight : img ? img.height() : '',
293
+ imageTitle : img ? img.attr('title') : '',
294
+ imageAlign : img ? img.attr('align') : '',
295
+ showRemote : allowImageRemote,
296
+ showLocal : allowImageUpload,
297
+ tabIndex: img ? 0 : imageTabIndex,
298
+ clickFn : function(url, title, width, height, border, align) {
299
+ if (img) {
300
+ img.attr('src', url);
301
+ img.attr('data-ke-src', url);
302
+ img.attr('width', width);
303
+ img.attr('height', height);
304
+ img.attr('title', title);
305
+ img.attr('align', align);
306
+ img.attr('alt', title);
307
+ } else {
308
+ self.exec('insertimage', url, title, width, height, border, align);
309
+ }
310
+ // Bugfix: [Firefox] 上传图片后,总是出现正在加载的样式,需要延迟执行hideDialog
311
+ setTimeout(function() {
312
+ self.hideDialog().focus();
313
+ }, 0);
314
+ }
315
+ });
316
+ },
317
+ 'delete' : function() {
318
+ var target = self.plugin.getSelectedImage();
319
+ if (target.parent().name == 'a') {
320
+ target = target.parent();
321
+ }
322
+ target.remove();
323
+ // [IE] 删除图片后立即点击图片按钮出错
324
+ self.addBookmark();
325
+ }
326
+ };
327
+ self.clickToolbar(name, self.plugin.image.edit);
328
+ });
@@ -0,0 +1,138 @@
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
+ allowFileUpload = K.undef(self.allowFileUpload, true),
13
+ allowFileManager = K.undef(self.allowFileManager, false),
14
+ formatUploadUrl = K.undef(self.formatUploadUrl, true),
15
+ uploadJson = K.undef(self.uploadJson, self.basePath + 'php/upload_json.php'),
16
+ extraParams = K.undef(self.extraFileUploadParams, {}),
17
+ filePostName = K.undef(self.filePostName, 'imgFile'),
18
+ lang = self.lang(name + '.');
19
+ self.plugin.fileDialog = function(options) {
20
+ var fileUrl = K.undef(options.fileUrl, 'http://'),
21
+ fileTitle = K.undef(options.fileTitle, ''),
22
+ clickFn = options.clickFn;
23
+ var html = [
24
+ '<div style="padding:20px;">',
25
+ '<div class="ke-dialog-row">',
26
+ '<label for="keUrl" style="width:60px;">' + lang.url + '</label>',
27
+ '<input type="text" id="keUrl" name="url" class="ke-input-text" style="width:160px;" /> &nbsp;',
28
+ '<input type="button" class="ke-upload-button" value="' + lang.upload + '" /> &nbsp;',
29
+ '<span class="ke-button-common ke-button-outer">',
30
+ '<input type="button" class="ke-button-common ke-button" name="viewServer" value="' + lang.viewServer + '" />',
31
+ '</span>',
32
+ '</div>',
33
+ //title
34
+ '<div class="ke-dialog-row">',
35
+ '<label for="keTitle" style="width:60px;">' + lang.title + '</label>',
36
+ '<input type="text" id="keTitle" class="ke-input-text" name="title" value="" style="width:160px;" /></div>',
37
+ '</div>',
38
+ //form end
39
+ '</form>',
40
+ '</div>'
41
+ ].join('');
42
+ var dialog = self.createDialog({
43
+ name : name,
44
+ width : 450,
45
+ title : self.lang(name),
46
+ body : html,
47
+ yesBtn : {
48
+ name : self.lang('yes'),
49
+ click : function(e) {
50
+ var url = K.trim(urlBox.val()),
51
+ title = titleBox.val();
52
+ if (url == 'http://' || K.invalidUrl(url)) {
53
+ alert(self.lang('invalidUrl'));
54
+ urlBox[0].focus();
55
+ return;
56
+ }
57
+ if (K.trim(title) === '') {
58
+ title = url;
59
+ }
60
+ clickFn.call(self, url, title);
61
+ }
62
+ }
63
+ }),
64
+ div = dialog.div;
65
+
66
+ var urlBox = K('[name="url"]', div),
67
+ viewServerBtn = K('[name="viewServer"]', div),
68
+ titleBox = K('[name="title"]', div);
69
+
70
+ if (allowFileUpload) {
71
+ var uploadbutton = K.uploadbutton({
72
+ button : K('.ke-upload-button', div)[0],
73
+ fieldName : filePostName,
74
+ url : K.addParam(uploadJson, 'dir=file'),
75
+ extraParams : extraParams,
76
+ afterUpload : function(data) {
77
+ dialog.hideLoading();
78
+ if (data.error === 0) {
79
+ var url = data.url;
80
+ if (formatUploadUrl) {
81
+ url = K.formatUrl(url, 'absolute');
82
+ }
83
+ urlBox.val(url);
84
+ if (self.afterUpload) {
85
+ self.afterUpload.call(self, url, data, name);
86
+ }
87
+ alert(self.lang('uploadSuccess'));
88
+ } else {
89
+ alert(data.message);
90
+ }
91
+ },
92
+ afterError : function(html) {
93
+ dialog.hideLoading();
94
+ self.errorDialog(html);
95
+ }
96
+ });
97
+ uploadbutton.fileBox.change(function(e) {
98
+ dialog.showLoading(self.lang('uploadLoading'));
99
+ uploadbutton.submit();
100
+ });
101
+ } else {
102
+ K('.ke-upload-button', div).hide();
103
+ }
104
+ if (allowFileManager) {
105
+ viewServerBtn.click(function(e) {
106
+ self.loadPlugin('filemanager', function() {
107
+ self.plugin.filemanagerDialog({
108
+ viewType : 'LIST',
109
+ dirName : 'file',
110
+ clickFn : function(url, title) {
111
+ if (self.dialogs.length > 1) {
112
+ K('[name="url"]', div).val(url);
113
+ if (self.afterSelectFile) {
114
+ self.afterSelectFile.call(self, url);
115
+ }
116
+ self.hideDialog();
117
+ }
118
+ }
119
+ });
120
+ });
121
+ });
122
+ } else {
123
+ viewServerBtn.hide();
124
+ }
125
+ urlBox.val(fileUrl);
126
+ titleBox.val(fileTitle);
127
+ urlBox[0].focus();
128
+ urlBox[0].select();
129
+ };
130
+ self.clickToolbar(name, function() {
131
+ self.plugin.fileDialog({
132
+ clickFn : function(url, title) {
133
+ var html = '<a class="ke-insertfile" href="' + url + '" data-ke-src="' + url + '" target="_blank">' + title + '</a>';
134
+ self.insertHtml(html).hideDialog().focus();
135
+ }
136
+ });
137
+ });
138
+ });
@@ -0,0 +1,38 @@
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
+ });
@@ -0,0 +1,66 @@
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:20px;">' +
16
+ //url
17
+ '<div class="ke-dialog-row">' +
18
+ '<label for="keUrl" style="width:60px;">' + lang.url + '</label>' +
19
+ '<input class="ke-input-text" type="text" id="keUrl" name="url" value="" style="width:260px;" /></div>' +
20
+ //type
21
+ '<div class="ke-dialog-row"">' +
22
+ '<label for="keType" style="width:60px;">' + lang.linkType + '</label>' +
23
+ '<select id="keType" name="type"></select>' +
24
+ '</div>' +
25
+ '</div>',
26
+ dialog = self.createDialog({
27
+ name : name,
28
+ width : 450,
29
+ title : self.lang(name),
30
+ body : html,
31
+ yesBtn : {
32
+ name : self.lang('yes'),
33
+ click : function(e) {
34
+ var url = K.trim(urlBox.val());
35
+ if (url == 'http://' || K.invalidUrl(url)) {
36
+ alert(self.lang('invalidUrl'));
37
+ urlBox[0].focus();
38
+ return;
39
+ }
40
+ self.exec('createlink', url, typeBox.val()).hideDialog().focus();
41
+ }
42
+ }
43
+ }),
44
+ div = dialog.div,
45
+ urlBox = K('input[name="url"]', div),
46
+ typeBox = K('select[name="type"]', div);
47
+ urlBox.val('http://');
48
+ typeBox[0].options[0] = new Option(lang.newWindow, '_blank');
49
+ typeBox[0].options[1] = new Option(lang.selfWindow, '');
50
+ self.cmd.selection();
51
+ var a = self.plugin.getSelectedLink();
52
+ if (a) {
53
+ self.cmd.range.selectNode(a[0]);
54
+ self.cmd.select();
55
+ urlBox.val(a.attr('data-ke-src'));
56
+ typeBox.val(a.attr('target'));
57
+ }
58
+ urlBox[0].focus();
59
+ urlBox[0].select();
60
+ },
61
+ 'delete' : function() {
62
+ self.exec('unlink', null);
63
+ }
64
+ };
65
+ self.clickToolbar(name, self.plugin.link.edit);
66
+ });
@@ -0,0 +1,57 @@
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(-34.397, 150.644);
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>