ckeditor 3.5.4 → 3.6.0.pre
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +23 -0
- data/MIT-LICENSE +20 -0
- data/README.rdoc +96 -97
- data/Rakefile +16 -33
- data/app/controllers/ckeditor/attachment_files_controller.rb +4 -4
- data/app/controllers/ckeditor/base_controller.rb +15 -42
- data/app/controllers/ckeditor/pictures_controller.rb +3 -3
- data/app/views/ckeditor/attachment_files/index.html.erb +13 -51
- data/app/views/ckeditor/pictures/index.html.erb +14 -52
- data/app/views/ckeditor/shared/_asset.html.erb +19 -0
- data/app/views/ckeditor/shared/_asset_tmpl.html.erb +21 -0
- data/app/views/layouts/ckeditor.html.erb +16 -23
- data/config/locales/en.ckeditor.yml +3 -7
- data/config/locales/ru.ckeditor.yml +4 -8
- data/config/locales/uk.ckeditor.yml +4 -8
- data/config/routes.rb +3 -3
- data/lib/ckeditor.rb +30 -79
- data/lib/ckeditor/engine.rb +14 -13
- data/lib/ckeditor/helpers/controllers.rb +30 -0
- data/lib/ckeditor/helpers/form_builder.rb +11 -0
- data/lib/ckeditor/helpers/form_helper.rb +25 -0
- data/lib/ckeditor/helpers/view_helper.rb +19 -0
- data/lib/ckeditor/http.rb +81 -0
- data/lib/ckeditor/orm/active_record.rb +91 -0
- data/lib/ckeditor/utils.rb +51 -70
- data/lib/ckeditor/version.rb +2 -7
- data/lib/generators/ckeditor/install_generator.rb +62 -0
- data/lib/generators/ckeditor/models_generator.rb +51 -0
- data/lib/generators/ckeditor/templates/ckeditor.rb +18 -0
- data/lib/generators/ckeditor/templates/ckeditor/config.js +52 -0
- data/lib/generators/ckeditor/templates/ckeditor/filebrowser/images/gal_add.jpg +0 -0
- data/lib/generators/ckeditor/templates/ckeditor/filebrowser/images/gal_add.png +0 -0
- data/lib/generators/ckeditor/templates/ckeditor/filebrowser/images/gal_del.png +0 -0
- data/lib/generators/ckeditor/templates/ckeditor/filebrowser/images/gal_more.gif +0 -0
- data/lib/generators/ckeditor/templates/ckeditor/filebrowser/images/preloader.gif +0 -0
- data/lib/generators/ckeditor/{base/templates/ckeditor/images → templates/ckeditor/filebrowser/images/thumbs}/ckfnothumb.gif +0 -0
- data/lib/generators/ckeditor/{base/templates/ckeditor/images → templates/ckeditor/filebrowser/images/thumbs}/mp3.gif +0 -0
- data/lib/generators/ckeditor/{base/templates/ckeditor/images → templates/ckeditor/filebrowser/images/thumbs}/pdf.gif +0 -0
- data/lib/generators/ckeditor/{base/templates/ckeditor/images → templates/ckeditor/filebrowser/images/thumbs}/rar.gif +0 -0
- data/lib/generators/ckeditor/{base/templates/ckeditor/images → templates/ckeditor/filebrowser/images/thumbs}/swf.gif +0 -0
- data/lib/generators/ckeditor/{base/templates/ckeditor/images → templates/ckeditor/filebrowser/images/thumbs}/xls.gif +0 -0
- data/lib/generators/ckeditor/templates/ckeditor/filebrowser/javascripts/application.js +222 -0
- data/lib/generators/ckeditor/templates/ckeditor/filebrowser/stylesheets/uploader.css +112 -0
- data/lib/generators/ckeditor/{base/templates → templates}/ckeditor/plugins/attachment/dialogs/attachment.js +0 -0
- data/lib/generators/ckeditor/{base/templates/ckeditor/_source → templates/ckeditor}/plugins/attachment/images/attachment.png +0 -0
- data/lib/generators/ckeditor/{base/templates/ckeditor/_source → templates/ckeditor}/plugins/attachment/lang/en.js +0 -0
- data/lib/generators/ckeditor/{base/templates/ckeditor/_source → templates/ckeditor}/plugins/attachment/lang/ru.js +0 -0
- data/lib/generators/ckeditor/{base/templates/ckeditor/_source → templates/ckeditor}/plugins/attachment/lang/uk.js +0 -0
- data/lib/generators/ckeditor/{base/templates → templates}/ckeditor/plugins/attachment/plugin.js +0 -0
- data/lib/generators/ckeditor/{base/templates → templates}/ckeditor/plugins/embed/dialogs/embed.js +0 -0
- data/lib/generators/ckeditor/{base/templates/ckeditor/_source → templates/ckeditor}/plugins/embed/images/embed.png +0 -0
- data/lib/generators/ckeditor/{base/templates/ckeditor/_source → templates/ckeditor}/plugins/embed/lang/en.js +0 -0
- data/lib/generators/ckeditor/{base/templates/ckeditor/_source → templates/ckeditor}/plugins/embed/lang/ru.js +0 -0
- data/lib/generators/ckeditor/{base/templates/ckeditor/_source → templates/ckeditor}/plugins/embed/lang/uk.js +0 -0
- data/lib/generators/ckeditor/{base/templates → templates}/ckeditor/plugins/embed/plugin.js +0 -0
- data/lib/generators/ckeditor/templates/models/active_record/asset.rb +7 -0
- data/lib/generators/ckeditor/templates/models/active_record/attachment_file.rb +15 -0
- data/lib/generators/ckeditor/{migration/templates/models/paperclip → templates/models/active_record}/migration.rb +3 -8
- data/lib/generators/ckeditor/templates/models/active_record/picture.rb +13 -0
- data/test/ckeditor_test.rb +13 -0
- data/test/controllers/attachment_files_controller_test.rb +52 -0
- data/test/controllers/pictures_controller_test.rb +52 -0
- data/test/dummy/Rakefile +7 -0
- data/test/dummy/app/controllers/application_controller.rb +4 -0
- data/test/dummy/app/controllers/posts_controller.rb +83 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/helpers/posts_helper.rb +2 -0
- data/test/dummy/app/models/ckeditor/asset.rb +7 -0
- data/test/dummy/app/models/ckeditor/attachment_file.rb +15 -0
- data/test/dummy/app/models/ckeditor/picture.rb +13 -0
- data/test/dummy/app/models/post.rb +3 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/app/views/posts/_form.html.erb +30 -0
- data/test/dummy/app/views/posts/edit.html.erb +6 -0
- data/test/dummy/app/views/posts/index.html.erb +27 -0
- data/test/dummy/app/views/posts/new.html.erb +5 -0
- data/test/dummy/app/views/posts/show.html.erb +5 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/config/application.rb +46 -0
- data/test/dummy/config/boot.rb +10 -0
- data/test/dummy/config/database.yml +34 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +26 -0
- data/test/dummy/config/environments/production.rb +49 -0
- data/test/dummy/config/environments/test.rb +35 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/ckeditor.rb +18 -0
- data/test/dummy/config/initializers/inflections.rb +10 -0
- data/test/dummy/config/initializers/mime_types.rb +5 -0
- data/test/dummy/config/initializers/secret_token.rb +7 -0
- data/test/dummy/config/initializers/session_store.rb +8 -0
- data/test/dummy/config/locales/en.yml +5 -0
- data/test/dummy/config/routes.rb +4 -0
- data/test/dummy/db/migrate/20110623120047_create_posts.rb +14 -0
- data/test/dummy/db/migrate/20110705195648_create_ckeditor_assets.rb +26 -0
- data/test/dummy/db/schema.rb +36 -0
- data/test/dummy/log/development.log +818 -0
- data/test/dummy/log/production.log +0 -0
- data/test/dummy/log/server.log +0 -0
- data/test/dummy/log/test.log +5398 -0
- data/test/dummy/public/404.html +26 -0
- data/test/dummy/public/422.html +26 -0
- data/test/dummy/public/500.html +26 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/public/javascripts/application.js +2 -0
- data/test/dummy/public/javascripts/controls.js +965 -0
- data/test/dummy/public/javascripts/dragdrop.js +974 -0
- data/test/dummy/public/javascripts/effects.js +1123 -0
- data/test/dummy/public/javascripts/prototype.js +6001 -0
- data/test/dummy/public/javascripts/rails.js +191 -0
- data/test/dummy/public/stylesheets/scaffold.css +56 -0
- data/test/dummy/script/rails +6 -0
- data/test/dummy/test/fixtures/files/rails.png +0 -0
- data/test/dummy/test/fixtures/files/rails.tar.gz +0 -0
- data/test/generators/install_generator_test.rb +18 -0
- data/test/generators/models_generator_test.rb +21 -0
- data/test/integration/navigation_test.rb +7 -0
- data/test/integration/posts_test.rb +41 -0
- data/test/routes_test.rb +47 -0
- data/test/support/integration_case.rb +5 -0
- data/test/test_helper.rb +28 -0
- data/test/tmp/app/models/ckeditor/asset.rb +7 -0
- data/test/tmp/app/models/ckeditor/attachment_file.rb +15 -0
- data/test/tmp/app/models/ckeditor/picture.rb +13 -0
- data/test/tmp/db/migrate/20110711170413_create_ckeditor_assets.rb +26 -0
- metadata +220 -99
- data/CHANGELOG +0 -15
- data/app/helpers/ckeditor/base_helper.rb +0 -21
- data/app/views/ckeditor/_asset.html.erb +0 -20
- data/app/views/ckeditor/_swfupload.html.erb +0 -73
- data/lib/ckeditor/form_builder.rb +0 -22
- data/lib/ckeditor/middleware.rb +0 -18
- data/lib/ckeditor/view_helper.rb +0 -92
- data/lib/generators/ckeditor/base/USAGE +0 -9
- data/lib/generators/ckeditor/base/base_generator.rb +0 -41
- data/lib/generators/ckeditor/base/templates/ckeditor.rb +0 -54
- data/lib/generators/ckeditor/base/templates/ckeditor/_source/plugins/attachment/dialogs/attachment.js +0 -384
- data/lib/generators/ckeditor/base/templates/ckeditor/_source/plugins/attachment/plugin.js +0 -44
- data/lib/generators/ckeditor/base/templates/ckeditor/_source/plugins/embed/dialogs/embed.js +0 -65
- data/lib/generators/ckeditor/base/templates/ckeditor/_source/plugins/embed/plugin.js +0 -43
- data/lib/generators/ckeditor/base/templates/ckeditor/config.js +0 -43
- data/lib/generators/ckeditor/base/templates/ckeditor/css/ckfinder.css +0 -316
- data/lib/generators/ckeditor/base/templates/ckeditor/css/fck_dialog.css +0 -119
- data/lib/generators/ckeditor/base/templates/ckeditor/css/fck_editor.css +0 -448
- data/lib/generators/ckeditor/base/templates/ckeditor/css/swfupload.css +0 -94
- data/lib/generators/ckeditor/base/templates/ckeditor/images/add.gif +0 -0
- data/lib/generators/ckeditor/base/templates/ckeditor/images/cancelbutton.gif +0 -0
- data/lib/generators/ckeditor/base/templates/ckeditor/images/doc.gif +0 -0
- data/lib/generators/ckeditor/base/templates/ckeditor/images/refresh.gif +0 -0
- data/lib/generators/ckeditor/base/templates/ckeditor/images/select_files.png +0 -0
- data/lib/generators/ckeditor/base/templates/ckeditor/images/spacer.gif +0 -0
- data/lib/generators/ckeditor/base/templates/ckeditor/images/toolbar.start.gif +0 -0
- data/lib/generators/ckeditor/base/templates/ckeditor/plugins/attachment/images/attachment.png +0 -0
- data/lib/generators/ckeditor/base/templates/ckeditor/plugins/attachment/lang/en.js +0 -10
- data/lib/generators/ckeditor/base/templates/ckeditor/plugins/attachment/lang/ru.js +0 -10
- data/lib/generators/ckeditor/base/templates/ckeditor/plugins/attachment/lang/uk.js +0 -10
- data/lib/generators/ckeditor/base/templates/ckeditor/plugins/embed/images/embed.png +0 -0
- data/lib/generators/ckeditor/base/templates/ckeditor/plugins/embed/lang/en.js +0 -9
- data/lib/generators/ckeditor/base/templates/ckeditor/plugins/embed/lang/ru.js +0 -9
- data/lib/generators/ckeditor/base/templates/ckeditor/plugins/embed/lang/uk.js +0 -9
- data/lib/generators/ckeditor/base/templates/ckeditor/swfupload/fileprogress.js +0 -266
- data/lib/generators/ckeditor/base/templates/ckeditor/swfupload/handlers.js +0 -181
- data/lib/generators/ckeditor/base/templates/ckeditor/swfupload/jquery-1.5.1.min.js +0 -16
- data/lib/generators/ckeditor/base/templates/ckeditor/swfupload/querystring.js +0 -40
- data/lib/generators/ckeditor/base/templates/ckeditor/swfupload/rails.js +0 -158
- data/lib/generators/ckeditor/base/templates/ckeditor/swfupload/swfupload.js +0 -1
- data/lib/generators/ckeditor/base/templates/ckeditor/swfupload/swfupload.queue.js +0 -1
- data/lib/generators/ckeditor/base/templates/ckeditor/swfupload/swfupload.swf +0 -0
- data/lib/generators/ckeditor/base/templates/ckeditor/swfupload/swfupload.swfobject.js +0 -111
- data/lib/generators/ckeditor/migration/USAGE +0 -12
- data/lib/generators/ckeditor/migration/migration_generator.rb +0 -46
- data/lib/generators/ckeditor/migration/templates/models/attachment_fu/asset.rb +0 -32
- data/lib/generators/ckeditor/migration/templates/models/attachment_fu/attachment_file.rb +0 -24
- data/lib/generators/ckeditor/migration/templates/models/attachment_fu/migration.rb +0 -30
- data/lib/generators/ckeditor/migration/templates/models/attachment_fu/picture.rb +0 -25
- data/lib/generators/ckeditor/migration/templates/models/paperclip/asset.rb +0 -97
- data/lib/generators/ckeditor/migration/templates/models/paperclip/attachment_file.rb +0 -40
- data/lib/generators/ckeditor/migration/templates/models/paperclip/picture.rb +0 -23
- data/lib/tasks/ckeditor_tasks.rake +0 -3
@@ -1,94 +0,0 @@
|
|
1
|
-
.progressWrapper {
|
2
|
-
width: 357px;
|
3
|
-
overflow: hidden;
|
4
|
-
}
|
5
|
-
|
6
|
-
.progressContainer {
|
7
|
-
margin: 5px;
|
8
|
-
padding: 4px;
|
9
|
-
border: solid 1px #E8E8E8;
|
10
|
-
background-color: #F7F7F7;
|
11
|
-
overflow: hidden;
|
12
|
-
}
|
13
|
-
/* Message */
|
14
|
-
.message {
|
15
|
-
margin: 1em 0;
|
16
|
-
padding: 10px 20px;
|
17
|
-
border: solid 1px #FFDD99;
|
18
|
-
background-color: #FFFFCC;
|
19
|
-
overflow: hidden;
|
20
|
-
}
|
21
|
-
/* Error */
|
22
|
-
.red {
|
23
|
-
border: solid 1px #B50000;
|
24
|
-
background-color: #FFEBEB;
|
25
|
-
}
|
26
|
-
|
27
|
-
/* Current */
|
28
|
-
.green {
|
29
|
-
border: solid 1px #DDF0DD;
|
30
|
-
background-color: #EBFFEB;
|
31
|
-
}
|
32
|
-
|
33
|
-
/* Complete */
|
34
|
-
.blue {
|
35
|
-
border: solid 1px #CEE2F2;
|
36
|
-
background-color: #F0F5FF;
|
37
|
-
}
|
38
|
-
.progressName {
|
39
|
-
font-size: 8pt;
|
40
|
-
font-weight: 700;
|
41
|
-
color: #555;
|
42
|
-
width: 323px;
|
43
|
-
height: 14px;
|
44
|
-
text-align: left;
|
45
|
-
white-space: nowrap;
|
46
|
-
overflow: hidden;
|
47
|
-
}
|
48
|
-
|
49
|
-
.progressBarInProgress,
|
50
|
-
.progressBarComplete,
|
51
|
-
.progressBarError {
|
52
|
-
font-size: 0;
|
53
|
-
width: 0%;
|
54
|
-
height: 2px;
|
55
|
-
background-color: blue;
|
56
|
-
margin-top: 2px;
|
57
|
-
}
|
58
|
-
|
59
|
-
.progressBarComplete {
|
60
|
-
width: 100%;
|
61
|
-
background-color: green;
|
62
|
-
visibility: hidden;
|
63
|
-
}
|
64
|
-
|
65
|
-
.progressBarError {
|
66
|
-
width: 100%;
|
67
|
-
background-color: red;
|
68
|
-
visibility: hidden;
|
69
|
-
}
|
70
|
-
|
71
|
-
.progressBarStatus {
|
72
|
-
margin-top: 2px;
|
73
|
-
width: 337px;
|
74
|
-
font-size: 7pt;
|
75
|
-
font-family: Arial;
|
76
|
-
text-align: left;
|
77
|
-
white-space: nowrap;
|
78
|
-
}
|
79
|
-
|
80
|
-
a.progressCancel {
|
81
|
-
font-size: 0;
|
82
|
-
display: block;
|
83
|
-
height: 14px;
|
84
|
-
width: 14px;
|
85
|
-
background-image: url(/javascripts/ckeditor/images/cancelbutton.gif);
|
86
|
-
background-repeat: no-repeat;
|
87
|
-
background-position: -14px 0px;
|
88
|
-
float: right;
|
89
|
-
}
|
90
|
-
|
91
|
-
a.progressCancel:hover {
|
92
|
-
background-position: 0px 0px;
|
93
|
-
}
|
94
|
-
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/lib/generators/ckeditor/base/templates/ckeditor/plugins/attachment/images/attachment.png
DELETED
Binary file
|
Binary file
|
@@ -1,9 +0,0 @@
|
|
1
|
-
CKEDITOR.plugins.setLang('embed', 'en',
|
2
|
-
{
|
3
|
-
embed :
|
4
|
-
{
|
5
|
-
title : "Paste embed",
|
6
|
-
button : "Paste embed",
|
7
|
-
pasteMsg : "Please, paste embed-code from Youtube, Myspace, Flickr and others sources into rectangle, using the keyboard (Ctrl + V), and click OK."
|
8
|
-
}
|
9
|
-
});
|
@@ -1,9 +0,0 @@
|
|
1
|
-
CKEDITOR.plugins.setLang('embed', 'ru',
|
2
|
-
{
|
3
|
-
embed :
|
4
|
-
{
|
5
|
-
title : "Вставить embed",
|
6
|
-
button : "Вставить embed",
|
7
|
-
pasteMsg : "Пожалуйста, вставьте embed-код с Youtube, Myspace, Flickr и других ресурсов в прямоугольник, используя сочетание клавиш (Ctrl+V), и нажмите OK."
|
8
|
-
}
|
9
|
-
});
|
@@ -1,9 +0,0 @@
|
|
1
|
-
CKEDITOR.plugins.setLang('embed', 'uk',
|
2
|
-
{
|
3
|
-
embed :
|
4
|
-
{
|
5
|
-
title : "Вставити embed",
|
6
|
-
button : "Вставити embed",
|
7
|
-
pasteMsg : "Будь ласка, вставте embed-код з Youtube, Myspace, Flickr та інших ресурсів в прямокутник, використовуючи (Ctrl+V), та нажміть OK."
|
8
|
-
}
|
9
|
-
});
|
@@ -1,266 +0,0 @@
|
|
1
|
-
/* ******************************************
|
2
|
-
* FileProgress Object
|
3
|
-
* Control object for displaying file info
|
4
|
-
* ****************************************** */
|
5
|
-
|
6
|
-
function FileThumb(element_id) {
|
7
|
-
this.element = $('#' + element_id);
|
8
|
-
this.init();
|
9
|
-
}
|
10
|
-
|
11
|
-
FileThumb.prototype.init = function(){
|
12
|
-
this.element.find('div.FCKThumb').each(function(){
|
13
|
-
FileThumb.observe(this);
|
14
|
-
});
|
15
|
-
}
|
16
|
-
|
17
|
-
FileThumb.observe = function(element){
|
18
|
-
var element = $(element);
|
19
|
-
|
20
|
-
element.unbind('mouseover');
|
21
|
-
element.unbind('mouseout');
|
22
|
-
element.unbind('click');
|
23
|
-
|
24
|
-
element.bind('mouseover', function(){ $(this).addClass('FCKSelectedBox') } );
|
25
|
-
element.bind('mouseout', function(){ $(this).removeClass('FCKSelectedBox') } );
|
26
|
-
element.find('div.FCKAsset').bind('click', function(){ setUrl( $(this).find('img.image').attr('alt') ); return false; } );
|
27
|
-
}
|
28
|
-
|
29
|
-
function ToolBar(element_id){
|
30
|
-
this.container = document.getElementById(element_id);
|
31
|
-
this.buttons = new Array();
|
32
|
-
|
33
|
-
this.table = null;
|
34
|
-
}
|
35
|
-
|
36
|
-
ToolBar.prototype.clear = function(){
|
37
|
-
this.buttons = new Array();
|
38
|
-
}
|
39
|
-
|
40
|
-
ToolBar.prototype.init = function(){
|
41
|
-
this.table = document.createElement('table');
|
42
|
-
this.table.appendChild(document.createElement("TBODY"));
|
43
|
-
this.table.border = 0;
|
44
|
-
this.table.setAttribute('cellspacing', 0);
|
45
|
-
this.table.setAttribute('cellpadding', 0);
|
46
|
-
this.table.className = "TB_Toolbar";
|
47
|
-
|
48
|
-
var row = this.table.tBodies[0].insertRow(0);
|
49
|
-
var cell = row.insertCell(row.cells.length);
|
50
|
-
|
51
|
-
div = document.createElement('div');
|
52
|
-
div.className = 'TB_Start';
|
53
|
-
div.innerHTML = " "
|
54
|
-
cell.appendChild(div);
|
55
|
-
|
56
|
-
this.init_buttons(row);
|
57
|
-
|
58
|
-
this.container.appendChild(this.table);
|
59
|
-
}
|
60
|
-
|
61
|
-
ToolBar.prototype.init_buttons = function(row){
|
62
|
-
|
63
|
-
for(var i = 0; i < this.buttons.length; i++)
|
64
|
-
{
|
65
|
-
var cell = row.insertCell(row.cells.length);
|
66
|
-
this.buttons[i].init();
|
67
|
-
cell.appendChild(this.buttons[i].element);
|
68
|
-
}
|
69
|
-
}
|
70
|
-
|
71
|
-
function Button(title, text, image){
|
72
|
-
this.title = title;
|
73
|
-
this.text = text;
|
74
|
-
this.image = image;
|
75
|
-
|
76
|
-
this.callback = function(){};
|
77
|
-
this.element = null;
|
78
|
-
}
|
79
|
-
|
80
|
-
Button.prototype.init = function(){
|
81
|
-
this.element = document.createElement('div');
|
82
|
-
this.element.title = this.title;
|
83
|
-
this.element.className = "TB_Button";
|
84
|
-
|
85
|
-
table = document.createElement('table');
|
86
|
-
table.appendChild(document.createElement("TBODY"));
|
87
|
-
table.border = 0;
|
88
|
-
table.setAttribute('cellspacing', 0);
|
89
|
-
table.setAttribute('cellpadding', 0);
|
90
|
-
|
91
|
-
var row = table.tBodies[0].insertRow(0);
|
92
|
-
var cell = row.insertCell(row.cells.length);
|
93
|
-
|
94
|
-
image = document.createElement('img');
|
95
|
-
image.src = '/javascripts/ckeditor/images/' + this.image;
|
96
|
-
image.className = 'TB_Button_Image';
|
97
|
-
|
98
|
-
cell.appendChild(image);
|
99
|
-
|
100
|
-
var cell = row.insertCell(row.cells.length);
|
101
|
-
cell.className = 'TB_Button_Text';
|
102
|
-
cell.innerHTML = this.text;
|
103
|
-
row.appendChild(cell);
|
104
|
-
|
105
|
-
var cell = row.insertCell(row.cells.length);
|
106
|
-
image = document.createElement('img');
|
107
|
-
image.src = '/javascripts/ckeditor/images/spacer.gif';
|
108
|
-
image.className = 'TB_Button_Padding';
|
109
|
-
cell.appendChild(image);
|
110
|
-
|
111
|
-
this.element.appendChild(table);
|
112
|
-
|
113
|
-
this.element.onclick = this.callback;
|
114
|
-
this.element.onmouseover = function addButtonHover() { this.className = "TB_Button_Off_Over"; }
|
115
|
-
this.element.onmouseout = function removeButtonHover() { this.className = "TB_Button"; }
|
116
|
-
}
|
117
|
-
|
118
|
-
function FileProgress(file, targetID) {
|
119
|
-
this.fileProgressID = "divFileProgress";
|
120
|
-
|
121
|
-
this.fileProgressWrapper = document.getElementById(this.fileProgressID);
|
122
|
-
if (!this.fileProgressWrapper) {
|
123
|
-
this.fileProgressWrapper = document.createElement("div");
|
124
|
-
this.fileProgressWrapper.className = "progressWrapper";
|
125
|
-
this.fileProgressWrapper.id = this.fileProgressID;
|
126
|
-
|
127
|
-
this.fileProgressElement = document.createElement("div");
|
128
|
-
this.fileProgressElement.className = "progressContainer";
|
129
|
-
|
130
|
-
var progressCancel = document.createElement("a");
|
131
|
-
progressCancel.className = "progressCancel";
|
132
|
-
progressCancel.href = "#";
|
133
|
-
progressCancel.style.visibility = "hidden";
|
134
|
-
progressCancel.appendChild(document.createTextNode(" "));
|
135
|
-
|
136
|
-
var progressText = document.createElement("div");
|
137
|
-
progressText.className = "progressName";
|
138
|
-
progressText.appendChild(document.createTextNode(file.name));
|
139
|
-
|
140
|
-
var progressBar = document.createElement("div");
|
141
|
-
progressBar.className = "progressBarInProgress";
|
142
|
-
|
143
|
-
var progressStatus = document.createElement("div");
|
144
|
-
progressStatus.className = "progressBarStatus";
|
145
|
-
progressStatus.innerHTML = " ";
|
146
|
-
|
147
|
-
this.fileProgressElement.appendChild(progressCancel);
|
148
|
-
this.fileProgressElement.appendChild(progressText);
|
149
|
-
this.fileProgressElement.appendChild(progressStatus);
|
150
|
-
this.fileProgressElement.appendChild(progressBar);
|
151
|
-
|
152
|
-
this.fileProgressWrapper.appendChild(this.fileProgressElement);
|
153
|
-
|
154
|
-
document.getElementById(targetID).appendChild(this.fileProgressWrapper);
|
155
|
-
//fadeIn(this.fileProgressWrapper, 0);
|
156
|
-
|
157
|
-
} else {
|
158
|
-
this.fileProgressElement = this.fileProgressWrapper.firstChild;
|
159
|
-
this.fileProgressElement.childNodes[1].firstChild.nodeValue = file.name;
|
160
|
-
}
|
161
|
-
|
162
|
-
this.height = this.fileProgressWrapper.offsetHeight;
|
163
|
-
|
164
|
-
}
|
165
|
-
FileProgress.prototype.setProgress = function (percentage) {
|
166
|
-
this.fileProgressElement.className = "progressContainer green";
|
167
|
-
this.fileProgressElement.childNodes[3].className = "progressBarInProgress";
|
168
|
-
this.fileProgressElement.childNodes[3].style.width = percentage + "%";
|
169
|
-
};
|
170
|
-
FileProgress.prototype.setComplete = function () {
|
171
|
-
this.fileProgressElement.className = "progressContainer blue";
|
172
|
-
this.fileProgressElement.childNodes[3].className = "progressBarComplete";
|
173
|
-
this.fileProgressElement.childNodes[3].style.width = "";
|
174
|
-
|
175
|
-
};
|
176
|
-
FileProgress.prototype.setError = function () {
|
177
|
-
this.fileProgressElement.className = "progressContainer red";
|
178
|
-
this.fileProgressElement.childNodes[3].className = "progressBarError";
|
179
|
-
this.fileProgressElement.childNodes[3].style.width = "";
|
180
|
-
|
181
|
-
};
|
182
|
-
FileProgress.prototype.setCancelled = function () {
|
183
|
-
this.fileProgressElement.className = "progressContainer";
|
184
|
-
this.fileProgressElement.childNodes[3].className = "progressBarError";
|
185
|
-
this.fileProgressElement.childNodes[3].style.width = "";
|
186
|
-
|
187
|
-
};
|
188
|
-
FileProgress.prototype.setStatus = function (status) {
|
189
|
-
this.fileProgressElement.childNodes[2].innerHTML = status;
|
190
|
-
};
|
191
|
-
|
192
|
-
FileProgress.prototype.toggleCancel = function (show, swfuploadInstance) {
|
193
|
-
this.fileProgressElement.childNodes[0].style.visibility = show ? "visible" : "hidden";
|
194
|
-
if (swfuploadInstance) {
|
195
|
-
var fileID = this.fileProgressID;
|
196
|
-
this.fileProgressElement.childNodes[0].onclick = function () {
|
197
|
-
swfuploadInstance.cancelUpload(fileID);
|
198
|
-
return false;
|
199
|
-
};
|
200
|
-
}
|
201
|
-
};
|
202
|
-
|
203
|
-
FileProgress.prototype.createThumbnail = function(serverData) {
|
204
|
-
var object = jQuery.parseJSON(serverData);
|
205
|
-
var container = document.getElementById('container');
|
206
|
-
var asset = (typeof(object.asset) == 'undefined') ? object : object.asset;
|
207
|
-
|
208
|
-
var image_src = null;
|
209
|
-
var image_alt = null;
|
210
|
-
var file_size = null;
|
211
|
-
var file_name = null;
|
212
|
-
var file_date = null;
|
213
|
-
|
214
|
-
if (typeof asset == 'undefined')
|
215
|
-
return;
|
216
|
-
|
217
|
-
image_alt = asset.url;
|
218
|
-
file_size = asset.size;
|
219
|
-
file_name = asset.filename;
|
220
|
-
file_date = asset.format_created_at;
|
221
|
-
|
222
|
-
image_src = asset.url_thumb;
|
223
|
-
image_alt = asset.url_content;
|
224
|
-
|
225
|
-
var thumb = document.createElement('DIV');
|
226
|
-
thumb.className = 'FCKThumb';
|
227
|
-
|
228
|
-
var div = document.createElement('DIV');
|
229
|
-
div.className = 'FCKAsset';
|
230
|
-
|
231
|
-
var table = document.createElement('TABLE');
|
232
|
-
table.appendChild(document.createElement("TBODY"));
|
233
|
-
table.border = 0;
|
234
|
-
table.setAttribute('cellspacing', 0);
|
235
|
-
table.setAttribute('cellpadding', 0);
|
236
|
-
table.setAttribute('width', 100);
|
237
|
-
table.setAttribute('height', 100);
|
238
|
-
|
239
|
-
var row = table.tBodies[0].insertRow(0);
|
240
|
-
var cell = row.insertCell(row.cells.length);
|
241
|
-
cell.setAttribute('align', 'center');
|
242
|
-
cell.setAttribute('valign', 'middle');
|
243
|
-
|
244
|
-
cell.innerHTML = "<img src='" + image_src + "' alt='" + image_alt + "' title='" + file_name + "' class='image' onerror=\"this.src='/javascripts/ckeditor/images/ckfnothumb.gif'\" />"
|
245
|
-
|
246
|
-
var div_name = document.createElement('DIV');
|
247
|
-
div_name.className = "FCKFileName";
|
248
|
-
div_name.innerHTML = file_name;
|
249
|
-
|
250
|
-
var div_date = document.createElement('DIV');
|
251
|
-
div_date.className = "FCKFileDate";
|
252
|
-
div_date.innerHTML = file_date;
|
253
|
-
|
254
|
-
var div_size = document.createElement('DIV');
|
255
|
-
div_size.className = "FCKFileSize";
|
256
|
-
div_size.innerHTML = file_size;
|
257
|
-
|
258
|
-
div.appendChild(table);
|
259
|
-
div.appendChild(div_name);
|
260
|
-
div.appendChild(div_date);
|
261
|
-
div.appendChild(div_size);
|
262
|
-
thumb.appendChild(div);
|
263
|
-
|
264
|
-
container.appendChild(thumb);
|
265
|
-
FileThumb.observe(thumb);
|
266
|
-
};
|
@@ -1,181 +0,0 @@
|
|
1
|
-
function setUrl(url)
|
2
|
-
{
|
3
|
-
CKEDITOR.tools.callFunction(CKEditorFuncNum, url);
|
4
|
-
window.close();
|
5
|
-
}
|
6
|
-
|
7
|
-
function uploadButton(button)
|
8
|
-
{
|
9
|
-
$('#fj').toggle();
|
10
|
-
}
|
11
|
-
|
12
|
-
function uploadStart(file) {
|
13
|
-
try {
|
14
|
-
/* I don't want to do any file validation or anything, I'll just update the UI and
|
15
|
-
return true to indicate that the upload should start.
|
16
|
-
It's important to update the UI here because in Linux no uploadProgress events are called. The best
|
17
|
-
we can do is say we are uploading.
|
18
|
-
*/
|
19
|
-
var progress = new FileProgress(file, this.customSettings.progressTarget);
|
20
|
-
progress.setStatus("Loading...");
|
21
|
-
progress.setProgress(0);
|
22
|
-
//progress.toggleCancel(true, this);
|
23
|
-
}
|
24
|
-
catch (ex) {}
|
25
|
-
|
26
|
-
return true;
|
27
|
-
}
|
28
|
-
|
29
|
-
function fileQueued(file) {
|
30
|
-
try {
|
31
|
-
var progress = new FileProgress(file, this.customSettings.progressTarget);
|
32
|
-
progress.setStatus("Preparing...");
|
33
|
-
progress.setProgress(0);
|
34
|
-
progress.toggleCancel(true, this);
|
35
|
-
|
36
|
-
var e = document.getElementById('divFileProgressContainer');
|
37
|
-
e.style.display = '';
|
38
|
-
} catch (ex) {
|
39
|
-
this.debug(ex);
|
40
|
-
}
|
41
|
-
|
42
|
-
}
|
43
|
-
|
44
|
-
function fileQueueError(file, errorCode, message) {
|
45
|
-
try {
|
46
|
-
if (errorCode === SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED) {
|
47
|
-
alert("You have attempted to queue too many files.\n" + (message === 0 ? "You have reached the upload limit." : "You may select " + (message > 1 ? "up to " + message + " files." : "one file.")));
|
48
|
-
return;
|
49
|
-
}
|
50
|
-
|
51
|
-
var progress = new FileProgress(file, this.customSettings.progressTarget);
|
52
|
-
progress.setError();
|
53
|
-
progress.toggleCancel(false);
|
54
|
-
|
55
|
-
switch (errorCode) {
|
56
|
-
case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT:
|
57
|
-
progress.setStatus("File is too big.");
|
58
|
-
this.debug("Error Code: File too big, File name: " + file.name + ", File size: " + file.size + ", Message: " + message);
|
59
|
-
break;
|
60
|
-
case SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE:
|
61
|
-
progress.setStatus("Cannot upload Zero Byte files.");
|
62
|
-
this.debug("Error Code: Zero byte file, File name: " + file.name + ", File size: " + file.size + ", Message: " + message);
|
63
|
-
break;
|
64
|
-
case SWFUpload.QUEUE_ERROR.INVALID_FILETYPE:
|
65
|
-
progress.setStatus("Invalid File Type.");
|
66
|
-
this.debug("Error Code: Invalid File Type, File name: " + file.name + ", File size: " + file.size + ", Message: " + message);
|
67
|
-
break;
|
68
|
-
default:
|
69
|
-
if (file !== null) {
|
70
|
-
progress.setStatus("Unhandled Error");
|
71
|
-
}
|
72
|
-
this.debug("Error Code: " + errorCode + ", File name: " + file.name + ", File size: " + file.size + ", Message: " + message);
|
73
|
-
break;
|
74
|
-
}
|
75
|
-
} catch (ex) {
|
76
|
-
this.debug(ex);
|
77
|
-
}
|
78
|
-
}
|
79
|
-
|
80
|
-
function fileDialogComplete(numFilesSelected, numFilesQueued) {
|
81
|
-
try {
|
82
|
-
if (numFilesSelected > 0) {
|
83
|
-
//document.getElementById(this.customSettings.cancelButtonId).disabled = false;
|
84
|
-
}
|
85
|
-
|
86
|
-
this.startUpload();
|
87
|
-
} catch (ex) {
|
88
|
-
this.debug(ex);
|
89
|
-
}
|
90
|
-
}
|
91
|
-
|
92
|
-
function uploadProgress(file, bytesLoaded) {
|
93
|
-
|
94
|
-
try {
|
95
|
-
var percent = Math.ceil((bytesLoaded / file.size) * 100);
|
96
|
-
|
97
|
-
var progress = new FileProgress(file, this.customSettings.upload_target);
|
98
|
-
progress.setProgress(percent);
|
99
|
-
if (percent === 100) {
|
100
|
-
progress.setStatus("Create thumbnail...");
|
101
|
-
progress.toggleCancel(false, this);
|
102
|
-
} else {
|
103
|
-
progress.setStatus("Loading...");
|
104
|
-
progress.toggleCancel(true, this);
|
105
|
-
}
|
106
|
-
} catch (ex) {
|
107
|
-
this.debug(ex);
|
108
|
-
}
|
109
|
-
}
|
110
|
-
|
111
|
-
function uploadSuccess(file, serverData) {
|
112
|
-
try {
|
113
|
-
var progress = new FileProgress(file, this.customSettings.progressTarget);
|
114
|
-
progress.setComplete();
|
115
|
-
progress.setStatus("Completed.");
|
116
|
-
progress.toggleCancel(false);
|
117
|
-
|
118
|
-
progress.createThumbnail(serverData);
|
119
|
-
|
120
|
-
} catch (ex) {
|
121
|
-
this.debug(ex);
|
122
|
-
}
|
123
|
-
}
|
124
|
-
|
125
|
-
function uploadComplete(file) {
|
126
|
-
try {
|
127
|
-
/* I want the next upload to continue automatically so I'll call startUpload here */
|
128
|
-
if (this.getStats().files_queued > 0) {
|
129
|
-
//this.startUpload();
|
130
|
-
} else {
|
131
|
-
var progress = new FileProgress(file, this.customSettings.upload_target);
|
132
|
-
progress.setComplete();
|
133
|
-
progress.setStatus("All pictures are successfully processed.");
|
134
|
-
progress.toggleCancel(false);
|
135
|
-
}
|
136
|
-
} catch (ex) {
|
137
|
-
this.debug(ex);
|
138
|
-
}
|
139
|
-
}
|
140
|
-
|
141
|
-
function uploadError(file, errorCode, message) {
|
142
|
-
var progress;
|
143
|
-
try {
|
144
|
-
switch (errorCode) {
|
145
|
-
case SWFUpload.UPLOAD_ERROR.FILE_CANCELLED:
|
146
|
-
try {
|
147
|
-
progress = new FileProgress(file, this.customSettings.upload_target);
|
148
|
-
progress.setCancelled();
|
149
|
-
progress.setStatus("Canceled");
|
150
|
-
progress.toggleCancel(false);
|
151
|
-
}
|
152
|
-
catch (ex1) {
|
153
|
-
this.debug(ex1);
|
154
|
-
}
|
155
|
-
break;
|
156
|
-
case SWFUpload.UPLOAD_ERROR.UPLOAD_STOPPED:
|
157
|
-
try {
|
158
|
-
progress = new FileProgress(file, this.customSettings.upload_target);
|
159
|
-
progress.setCancelled();
|
160
|
-
progress.setStatus("Stoped");
|
161
|
-
progress.toggleCancel(true);
|
162
|
-
}
|
163
|
-
catch (ex2) {
|
164
|
-
this.debug(ex2);
|
165
|
-
}
|
166
|
-
case SWFUpload.UPLOAD_ERROR.UPLOAD_LIMIT_EXCEEDED:
|
167
|
-
break;
|
168
|
-
default:
|
169
|
-
alert(message);
|
170
|
-
break;
|
171
|
-
}
|
172
|
-
} catch (ex3) {
|
173
|
-
this.debug(ex3);
|
174
|
-
}
|
175
|
-
}
|
176
|
-
|
177
|
-
// This event comes from the Queue Plugin
|
178
|
-
function queueComplete(numFilesUploaded) {
|
179
|
-
var e = document.getElementById('divFileProgressContainer');
|
180
|
-
e.style.display = 'none';
|
181
|
-
}
|