rails_kindeditor_upyun 0.4.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +5 -0
- data/Gemfile +6 -0
- data/README.md +523 -0
- data/Rakefile +2 -0
- data/app/assets/javascripts/kindeditor.js +1 -0
- data/app/controllers/kindeditor/assets_controller.rb +126 -0
- data/app/uploaders/kindeditor/asset_uploader.rb +91 -0
- data/app/uploaders/kindeditor/file_uploader.rb +10 -0
- data/app/uploaders/kindeditor/flash_uploader.rb +10 -0
- data/app/uploaders/kindeditor/image_uploader.rb +10 -0
- data/app/uploaders/kindeditor/media_uploader.rb +10 -0
- data/config/routes.rb +6 -0
- data/lib/generators/rails_kindeditor/install/USAGE +10 -0
- data/lib/generators/rails_kindeditor/install/install_generator.rb +23 -0
- data/lib/generators/rails_kindeditor/install/templates/application.js +17 -0
- data/lib/generators/rails_kindeditor/install/templates/rails_kindeditor.rb +29 -0
- data/lib/generators/rails_kindeditor/migration/USAGE +14 -0
- data/lib/generators/rails_kindeditor/migration/migration_generator.rb +36 -0
- data/lib/generators/rails_kindeditor/migration/templates/migration/migration.rb +17 -0
- data/lib/generators/rails_kindeditor/migration/templates/models/active_record/kindeditor/asset.rb +14 -0
- data/lib/generators/rails_kindeditor/migration/templates/models/active_record/kindeditor/file.rb +3 -0
- data/lib/generators/rails_kindeditor/migration/templates/models/active_record/kindeditor/flash.rb +3 -0
- data/lib/generators/rails_kindeditor/migration/templates/models/active_record/kindeditor/image.rb +3 -0
- data/lib/generators/rails_kindeditor/migration/templates/models/active_record/kindeditor/media.rb +3 -0
- data/lib/generators/rails_kindeditor/migration/templates/models/mongoid/kindeditor/asset.rb +27 -0
- data/lib/generators/rails_kindeditor/migration/templates/models/mongoid/kindeditor/file.rb +3 -0
- data/lib/generators/rails_kindeditor/migration/templates/models/mongoid/kindeditor/flash.rb +3 -0
- data/lib/generators/rails_kindeditor/migration/templates/models/mongoid/kindeditor/image.rb +3 -0
- data/lib/generators/rails_kindeditor/migration/templates/models/mongoid/kindeditor/media.rb +3 -0
- data/lib/rails_kindeditor.rb +61 -0
- data/lib/rails_kindeditor/active_record.rb +14 -0
- data/lib/rails_kindeditor/engine.rb +34 -0
- data/lib/rails_kindeditor/formtastic.rb +12 -0
- data/lib/rails_kindeditor/helper.rb +96 -0
- data/lib/rails_kindeditor/simple_form.rb +11 -0
- data/lib/rails_kindeditor/version.rb +4 -0
- data/lib/tasks/assets.rake +9 -0
- data/rails_kindeditor.gemspec +25 -0
- data/screenshots/rails_kindeditor.png +0 -0
- data/screenshots/simple_mode.png +0 -0
- data/vendor/assets/javascripts/kindeditor/kindeditor.js +5963 -0
- data/vendor/assets/javascripts/kindeditor/lang/ar.js +233 -0
- data/vendor/assets/javascripts/kindeditor/lang/en.js +232 -0
- data/vendor/assets/javascripts/kindeditor/lang/ko.js +237 -0
- data/vendor/assets/javascripts/kindeditor/lang/zh_CN.js +237 -0
- data/vendor/assets/javascripts/kindeditor/lang/zh_TW.js +235 -0
- data/vendor/assets/javascripts/kindeditor/plugins/anchor/anchor.js +46 -0
- data/vendor/assets/javascripts/kindeditor/plugins/autoheight/autoheight.js +54 -0
- data/vendor/assets/javascripts/kindeditor/plugins/baidumap/baidumap.js +93 -0
- data/vendor/assets/javascripts/kindeditor/plugins/baidumap/index.html +83 -0
- data/vendor/assets/javascripts/kindeditor/plugins/baidumap/map.html +43 -0
- data/vendor/assets/javascripts/kindeditor/plugins/clearhtml/clearhtml.js +29 -0
- data/vendor/assets/javascripts/kindeditor/plugins/code/code.js +62 -0
- data/vendor/assets/javascripts/kindeditor/plugins/code/prettify.css +13 -0
- data/vendor/assets/javascripts/kindeditor/plugins/code/prettify.js +28 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/emoticons.js +129 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/0.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/1.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/10.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/100.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/101.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/102.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/103.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/104.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/105.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/106.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/107.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/108.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/109.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/11.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/110.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/111.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/112.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/113.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/114.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/115.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/116.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/117.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/118.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/119.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/12.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/120.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/121.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/122.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/123.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/124.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/125.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/126.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/127.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/128.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/129.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/13.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/130.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/131.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/132.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/133.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/134.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/14.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/15.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/16.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/17.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/18.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/19.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/2.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/20.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/21.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/22.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/23.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/24.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/25.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/26.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/27.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/28.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/29.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/3.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/30.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/31.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/32.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/33.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/34.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/35.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/36.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/37.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/38.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/39.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/4.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/40.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/41.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/42.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/43.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/44.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/45.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/46.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/47.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/48.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/49.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/5.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/50.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/51.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/52.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/53.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/54.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/55.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/56.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/57.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/58.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/59.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/6.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/60.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/61.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/62.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/63.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/64.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/65.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/66.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/67.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/68.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/69.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/7.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/70.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/71.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/72.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/73.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/74.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/75.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/76.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/77.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/78.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/79.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/8.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/80.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/81.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/82.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/83.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/84.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/85.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/86.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/87.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/88.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/89.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/9.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/90.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/91.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/92.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/93.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/94.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/95.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/96.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/97.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/98.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/99.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/emoticons/images/static.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/filemanager/filemanager.js +189 -0
- data/vendor/assets/javascripts/kindeditor/plugins/filemanager/images/file-16.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/filemanager/images/file-64.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/filemanager/images/folder-16.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/filemanager/images/folder-64.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/filemanager/images/go-up.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/flash/flash.js +161 -0
- data/vendor/assets/javascripts/kindeditor/plugins/image/image.js +328 -0
- data/vendor/assets/javascripts/kindeditor/plugins/image/images/align_left.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/image/images/align_right.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/image/images/align_top.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/image/images/refresh.png +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/insertfile/insertfile.js +144 -0
- data/vendor/assets/javascripts/kindeditor/plugins/lineheight/lineheight.js +38 -0
- data/vendor/assets/javascripts/kindeditor/plugins/link/link.js +66 -0
- data/vendor/assets/javascripts/kindeditor/plugins/map/map.html +57 -0
- data/vendor/assets/javascripts/kindeditor/plugins/map/map.js +137 -0
- data/vendor/assets/javascripts/kindeditor/plugins/media/media.js +170 -0
- data/vendor/assets/javascripts/kindeditor/plugins/multiimage/images/image.png +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/multiimage/images/select-files-en.png +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/multiimage/images/select-files-zh_CN.png +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/multiimage/images/swfupload.swf +0 -0
- data/vendor/assets/javascripts/kindeditor/plugins/multiimage/multiimage.js +1384 -0
- data/vendor/assets/javascripts/kindeditor/plugins/pagebreak/pagebreak.js +27 -0
- data/vendor/assets/javascripts/kindeditor/plugins/plainpaste/plainpaste.js +41 -0
- data/vendor/assets/javascripts/kindeditor/plugins/preview/preview.js +31 -0
- data/vendor/assets/javascripts/kindeditor/plugins/quickformat/quickformat.js +81 -0
- data/vendor/assets/javascripts/kindeditor/plugins/table/table.js +712 -0
- data/vendor/assets/javascripts/kindeditor/plugins/template/html/1.html +14 -0
- data/vendor/assets/javascripts/kindeditor/plugins/template/html/2.html +42 -0
- data/vendor/assets/javascripts/kindeditor/plugins/template/html/3.html +36 -0
- data/vendor/assets/javascripts/kindeditor/plugins/template/template.js +58 -0
- data/vendor/assets/javascripts/kindeditor/plugins/wordpaste/wordpaste.js +51 -0
- data/vendor/assets/javascripts/kindeditor/themes/common/anchor.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/themes/common/blank.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/themes/common/flash.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/themes/common/loading.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/themes/common/media.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/themes/common/rm.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/themes/default/background.png +0 -0
- data/vendor/assets/javascripts/kindeditor/themes/default/default.css +1149 -0
- data/vendor/assets/javascripts/kindeditor/themes/default/default.png +0 -0
- data/vendor/assets/javascripts/kindeditor/themes/qq/editor.gif +0 -0
- data/vendor/assets/javascripts/kindeditor/themes/qq/qq.css +143 -0
- data/vendor/assets/javascripts/kindeditor/themes/simple/simple.css +100 -0
- metadata +322 -0
@@ -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(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>
|
@@ -0,0 +1,137 @@
|
|
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
|
+
// Google Maps: http://code.google.com/apis/maps/index.html
|
11
|
+
|
12
|
+
KindEditor.plugin('map', function(K) {
|
13
|
+
var self = this, name = 'map', lang = self.lang(name + '.');
|
14
|
+
self.clickToolbar(name, function() {
|
15
|
+
var html = ['<div style="padding:10px 20px;">',
|
16
|
+
'<div class="ke-dialog-row">',
|
17
|
+
lang.address + ' <input id="kindeditor_plugin_map_address" name="address" class="ke-input-text" value="" style="width:200px;" /> ',
|
18
|
+
'<span class="ke-button-common ke-button-outer">',
|
19
|
+
'<input type="button" name="searchBtn" class="ke-button-common ke-button" value="' + lang.search + '" />',
|
20
|
+
'</span>',
|
21
|
+
'</div>',
|
22
|
+
'<div class="ke-map" style="width:558px;height:360px;"></div>',
|
23
|
+
'</div>'].join('');
|
24
|
+
var dialog = self.createDialog({
|
25
|
+
name : name,
|
26
|
+
width : 600,
|
27
|
+
title : self.lang(name),
|
28
|
+
body : html,
|
29
|
+
yesBtn : {
|
30
|
+
name : self.lang('yes'),
|
31
|
+
click : function(e) {
|
32
|
+
var geocoder = win.geocoder,
|
33
|
+
map = win.map,
|
34
|
+
center = map.getCenter().lat() + ',' + map.getCenter().lng(),
|
35
|
+
zoom = map.getZoom(),
|
36
|
+
maptype = map.getMapTypeId(),
|
37
|
+
url = 'http://maps.googleapis.com/maps/api/staticmap';
|
38
|
+
url += '?center=' + encodeURIComponent(center);
|
39
|
+
url += '&zoom=' + encodeURIComponent(zoom);
|
40
|
+
url += '&size=558x360';
|
41
|
+
url += '&maptype=' + encodeURIComponent(maptype);
|
42
|
+
url += '&markers=' + encodeURIComponent(center);
|
43
|
+
url += '&language=' + self.langType;
|
44
|
+
url += '&sensor=false';
|
45
|
+
self.exec('insertimage', url).hideDialog().focus();
|
46
|
+
}
|
47
|
+
},
|
48
|
+
beforeRemove : function() {
|
49
|
+
searchBtn.remove();
|
50
|
+
if (doc) {
|
51
|
+
doc.write('');
|
52
|
+
}
|
53
|
+
iframe.remove();
|
54
|
+
}
|
55
|
+
});
|
56
|
+
var div = dialog.div,
|
57
|
+
addressBox = K('[name="address"]', div),
|
58
|
+
searchBtn = K('[name="searchBtn"]', div),
|
59
|
+
win, doc;
|
60
|
+
var iframeHtml = ['<!doctype html><html><head>',
|
61
|
+
'<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />',
|
62
|
+
'<style>',
|
63
|
+
' html { height: 100% }',
|
64
|
+
' body { height: 100%; margin: 0; padding: 0; background-color: #FFF }',
|
65
|
+
' #map_canvas { height: 100% }',
|
66
|
+
'</style>',
|
67
|
+
'<script src="http://maps.googleapis.com/maps/api/js?sensor=false&language=' + self.langType + '"></script>',
|
68
|
+
'<script>',
|
69
|
+
'var map, geocoder;',
|
70
|
+
'function initialize() {',
|
71
|
+
' var latlng = new google.maps.LatLng(31.230393, 121.473704);',
|
72
|
+
' var options = {',
|
73
|
+
' zoom: 11,',
|
74
|
+
' center: latlng,',
|
75
|
+
' disableDefaultUI: true,',
|
76
|
+
' panControl: true,',
|
77
|
+
' zoomControl: true,',
|
78
|
+
' mapTypeControl: true,',
|
79
|
+
' scaleControl: true,',
|
80
|
+
' streetViewControl: false,',
|
81
|
+
' overviewMapControl: true,',
|
82
|
+
' mapTypeId: google.maps.MapTypeId.ROADMAP',
|
83
|
+
' };',
|
84
|
+
' map = new google.maps.Map(document.getElementById("map_canvas"), options);',
|
85
|
+
' geocoder = new google.maps.Geocoder();',
|
86
|
+
' geocoder.geocode({latLng: latlng}, function(results, status) {',
|
87
|
+
' if (status == google.maps.GeocoderStatus.OK) {',
|
88
|
+
' if (results[3]) {',
|
89
|
+
' parent.document.getElementById("kindeditor_plugin_map_address").value = results[3].formatted_address;',
|
90
|
+
' }',
|
91
|
+
' }',
|
92
|
+
' });',
|
93
|
+
'}',
|
94
|
+
'function search(address) {',
|
95
|
+
' if (!map) return;',
|
96
|
+
' geocoder.geocode({address : address}, function(results, status) {',
|
97
|
+
' if (status == google.maps.GeocoderStatus.OK) {',
|
98
|
+
' map.setZoom(11);',
|
99
|
+
' map.setCenter(results[0].geometry.location);',
|
100
|
+
' var marker = new google.maps.Marker({',
|
101
|
+
' map: map,',
|
102
|
+
' position: results[0].geometry.location',
|
103
|
+
' });',
|
104
|
+
' } else {',
|
105
|
+
' alert("Invalid address: " + address);',
|
106
|
+
' }',
|
107
|
+
' });',
|
108
|
+
'}',
|
109
|
+
'</script>',
|
110
|
+
'</head>',
|
111
|
+
'<body onload="initialize();">',
|
112
|
+
'<div id="map_canvas" style="width:100%; height:100%"></div>',
|
113
|
+
'</body></html>'].join('\n');
|
114
|
+
// TODO:用doc.write(iframeHtml)方式加载时,在IE6上第一次加载报错,暂时使用src方式
|
115
|
+
var iframe = K('<iframe class="ke-textarea" frameborder="0" src="' + self.pluginsPath + 'map/map.html" style="width:558px;height:360px;"></iframe>');
|
116
|
+
function ready() {
|
117
|
+
win = iframe[0].contentWindow;
|
118
|
+
doc = K.iframeDoc(iframe);
|
119
|
+
//doc.open();
|
120
|
+
//doc.write(iframeHtml);
|
121
|
+
//doc.close();
|
122
|
+
}
|
123
|
+
iframe.bind('load', function() {
|
124
|
+
iframe.unbind('load');
|
125
|
+
if (K.IE) {
|
126
|
+
ready();
|
127
|
+
} else {
|
128
|
+
setTimeout(ready, 0);
|
129
|
+
}
|
130
|
+
});
|
131
|
+
K('.ke-map', div).replaceWith(iframe);
|
132
|
+
// search map
|
133
|
+
searchBtn.click(function() {
|
134
|
+
win.search(addressBox.val());
|
135
|
+
});
|
136
|
+
});
|
137
|
+
});
|
@@ -0,0 +1,170 @@
|
|
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('media', function(K) {
|
11
|
+
var self = this, name = 'media', lang = self.lang(name + '.'),
|
12
|
+
allowMediaUpload = K.undef(self.allowMediaUpload, true),
|
13
|
+
allowFileManager = K.undef(self.allowFileManager, false),
|
14
|
+
formatUploadUrl = K.undef(self.formatUploadUrl, true),
|
15
|
+
extraParams = K.undef(self.extraFileUploadParams, {}),
|
16
|
+
filePostName = K.undef(self.filePostName, 'imgFile'),
|
17
|
+
uploadJson = K.undef(self.uploadJson, self.basePath + 'php/upload_json.php');
|
18
|
+
self.plugin.media = {
|
19
|
+
edit : function() {
|
20
|
+
var html = [
|
21
|
+
'<div style="padding:20px;">',
|
22
|
+
//url
|
23
|
+
'<div class="ke-dialog-row">',
|
24
|
+
'<label for="keUrl" style="width:60px;">' + lang.url + '</label>',
|
25
|
+
'<input class="ke-input-text" type="text" id="keUrl" name="url" value="" style="width:160px;" /> ',
|
26
|
+
'<input type="button" class="ke-upload-button" value="' + lang.upload + '" /> ',
|
27
|
+
'<span class="ke-button-common ke-button-outer">',
|
28
|
+
'<input type="button" class="ke-button-common ke-button" name="viewServer" value="' + lang.viewServer + '" />',
|
29
|
+
'</span>',
|
30
|
+
'</div>',
|
31
|
+
//width
|
32
|
+
'<div class="ke-dialog-row">',
|
33
|
+
'<label for="keWidth" style="width:60px;">' + lang.width + '</label>',
|
34
|
+
'<input type="text" id="keWidth" class="ke-input-text ke-input-number" name="width" value="550" maxlength="4" />',
|
35
|
+
'</div>',
|
36
|
+
//height
|
37
|
+
'<div class="ke-dialog-row">',
|
38
|
+
'<label for="keHeight" style="width:60px;">' + lang.height + '</label>',
|
39
|
+
'<input type="text" id="keHeight" class="ke-input-text ke-input-number" name="height" value="400" maxlength="4" />',
|
40
|
+
'</div>',
|
41
|
+
//autostart
|
42
|
+
'<div class="ke-dialog-row">',
|
43
|
+
'<label for="keAutostart">' + lang.autostart + '</label>',
|
44
|
+
'<input type="checkbox" id="keAutostart" name="autostart" value="" /> ',
|
45
|
+
'</div>',
|
46
|
+
'</div>'
|
47
|
+
].join('');
|
48
|
+
var dialog = self.createDialog({
|
49
|
+
name : name,
|
50
|
+
width : 450,
|
51
|
+
height : 230,
|
52
|
+
title : self.lang(name),
|
53
|
+
body : html,
|
54
|
+
yesBtn : {
|
55
|
+
name : self.lang('yes'),
|
56
|
+
click : function(e) {
|
57
|
+
var url = K.trim(urlBox.val()),
|
58
|
+
width = widthBox.val(),
|
59
|
+
height = heightBox.val();
|
60
|
+
if (url == 'http://' || K.invalidUrl(url)) {
|
61
|
+
alert(self.lang('invalidUrl'));
|
62
|
+
urlBox[0].focus();
|
63
|
+
return;
|
64
|
+
}
|
65
|
+
if (!/^\d*$/.test(width)) {
|
66
|
+
alert(self.lang('invalidWidth'));
|
67
|
+
widthBox[0].focus();
|
68
|
+
return;
|
69
|
+
}
|
70
|
+
if (!/^\d*$/.test(height)) {
|
71
|
+
alert(self.lang('invalidHeight'));
|
72
|
+
heightBox[0].focus();
|
73
|
+
return;
|
74
|
+
}
|
75
|
+
var html = K.mediaImg(self.themesPath + 'common/blank.gif', {
|
76
|
+
src : url,
|
77
|
+
type : K.mediaType(url),
|
78
|
+
width : width,
|
79
|
+
height : height,
|
80
|
+
autostart : autostartBox[0].checked ? 'true' : 'false',
|
81
|
+
loop : 'true'
|
82
|
+
});
|
83
|
+
self.insertHtml(html).hideDialog().focus();
|
84
|
+
}
|
85
|
+
}
|
86
|
+
}),
|
87
|
+
div = dialog.div,
|
88
|
+
urlBox = K('[name="url"]', div),
|
89
|
+
viewServerBtn = K('[name="viewServer"]', div),
|
90
|
+
widthBox = K('[name="width"]', div),
|
91
|
+
heightBox = K('[name="height"]', div),
|
92
|
+
autostartBox = K('[name="autostart"]', div);
|
93
|
+
urlBox.val('http://');
|
94
|
+
|
95
|
+
if (allowMediaUpload) {
|
96
|
+
var uploadbutton = K.uploadbutton({
|
97
|
+
button : K('.ke-upload-button', div)[0],
|
98
|
+
fieldName : filePostName,
|
99
|
+
extraParams : extraParams,
|
100
|
+
url : K.addParam(uploadJson, 'dir=media'),
|
101
|
+
afterUpload : function(data) {
|
102
|
+
dialog.hideLoading();
|
103
|
+
if (data.error === 0) {
|
104
|
+
var url = data.url;
|
105
|
+
if (formatUploadUrl) {
|
106
|
+
url = K.formatUrl(url, 'absolute');
|
107
|
+
}
|
108
|
+
urlBox.val(url);
|
109
|
+
if (self.afterUpload) {
|
110
|
+
self.afterUpload.call(self, url, data, name);
|
111
|
+
}
|
112
|
+
alert(self.lang('uploadSuccess'));
|
113
|
+
} else {
|
114
|
+
alert(data.message);
|
115
|
+
}
|
116
|
+
},
|
117
|
+
afterError : function(html) {
|
118
|
+
dialog.hideLoading();
|
119
|
+
self.errorDialog(html);
|
120
|
+
}
|
121
|
+
});
|
122
|
+
uploadbutton.fileBox.change(function(e) {
|
123
|
+
dialog.showLoading(self.lang('uploadLoading'));
|
124
|
+
uploadbutton.submit();
|
125
|
+
});
|
126
|
+
} else {
|
127
|
+
K('.ke-upload-button', div).hide();
|
128
|
+
}
|
129
|
+
|
130
|
+
if (allowFileManager) {
|
131
|
+
viewServerBtn.click(function(e) {
|
132
|
+
self.loadPlugin('filemanager', function() {
|
133
|
+
self.plugin.filemanagerDialog({
|
134
|
+
viewType : 'LIST',
|
135
|
+
dirName : 'media',
|
136
|
+
clickFn : function(url, title) {
|
137
|
+
if (self.dialogs.length > 1) {
|
138
|
+
K('[name="url"]', div).val(url);
|
139
|
+
if (self.afterSelectFile) {
|
140
|
+
self.afterSelectFile.call(self, url);
|
141
|
+
}
|
142
|
+
self.hideDialog();
|
143
|
+
}
|
144
|
+
}
|
145
|
+
});
|
146
|
+
});
|
147
|
+
});
|
148
|
+
} else {
|
149
|
+
viewServerBtn.hide();
|
150
|
+
}
|
151
|
+
|
152
|
+
var img = self.plugin.getSelectedMedia();
|
153
|
+
if (img) {
|
154
|
+
var attrs = K.mediaAttrs(img.attr('data-ke-tag'));
|
155
|
+
urlBox.val(attrs.src);
|
156
|
+
widthBox.val(K.removeUnit(img.css('width')) || attrs.width || 0);
|
157
|
+
heightBox.val(K.removeUnit(img.css('height')) || attrs.height || 0);
|
158
|
+
autostartBox[0].checked = (attrs.autostart === 'true');
|
159
|
+
}
|
160
|
+
urlBox[0].focus();
|
161
|
+
urlBox[0].select();
|
162
|
+
},
|
163
|
+
'delete' : function() {
|
164
|
+
self.plugin.getSelectedMedia().remove();
|
165
|
+
// [IE] 删除图片后立即点击图片按钮出错
|
166
|
+
self.addBookmark();
|
167
|
+
}
|
168
|
+
};
|
169
|
+
self.clickToolbar(name, self.plugin.media.edit);
|
170
|
+
});
|