muck-contents 0.1.12 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +122 -15
- data/VERSION +1 -1
- data/app/controllers/muck/tiny_mce_controller.rb +47 -0
- data/app/helpers/tinymce_helper.rb +23 -8
- data/app/views/contents/_form.html.erb +1 -2
- data/app/views/contents/new.html.erb +1 -0
- data/app/views/layouts/tiny_mce.html.erb +25 -0
- data/app/views/tiny_mce/files.html.erb +136 -0
- data/app/views/tiny_mce/images.html.erb +312 -0
- data/{public/javascripts/tiny_mce/plugins/advlinktoo/link.htm → app/views/tiny_mce/links.html.erb} +328 -344
- data/config/muck_contents_routes.rb +6 -0
- data/lib/action_controller/acts/muck_content_handler.rb +1 -1
- data/locales/en.yml +2 -0
- data/muck-contents.gemspec +153 -25
- data/public/{javascripts/tiny_mce/plugins/advimagetoo/img → images/tinymce}/sample.gif +0 -0
- data/public/{javascripts/tiny_mce/plugins/advfiletoo/img → images/tinymce}/upload.gif +0 -0
- data/public/javascripts/tiny_mce/plugins/advfiletoo/editor_plugin.js +9 -22
- data/public/javascripts/tiny_mce/plugins/advfiletoo/editor_plugin_src.js +41 -54
- data/public/javascripts/tiny_mce/plugins/advfiletoo/js/functions.js +0 -139
- data/public/javascripts/tiny_mce/plugins/advimagetoo/editor_plugin.js +9 -17
- data/public/javascripts/tiny_mce/plugins/advimagetoo/editor_plugin_src.js +40 -50
- data/public/javascripts/tiny_mce/plugins/advimagetoo/js/functions.js +0 -152
- data/public/javascripts/tiny_mce/plugins/advlinktoo/editor_plugin.js +3 -14
- data/public/javascripts/tiny_mce/plugins/advlinktoo/editor_plugin_src.js +3 -14
- data/public/{javascripts/tiny_mce/plugins/advfiletoo/css/advfile.css → stylesheets/tinymce.css} +33 -12
- data/test/rails_root/Rakefile +2 -1
- data/test/rails_root/app/controllers/uploads_controller.rb +57 -0
- data/test/rails_root/app/models/upload.rb +94 -0
- data/test/rails_root/app/models/user.rb +5 -0
- data/test/rails_root/config/environment.rb +2 -0
- data/test/rails_root/config/initializers/mce_options.rb +12 -8
- data/test/rails_root/config/initializers/s3_credentials.rb +9 -0
- data/test/rails_root/db/migrate/{20090602041838_create_users.rb → 20090327231918_create_users.rb} +11 -10
- data/test/rails_root/db/migrate/20090402234137_create_languages.rb +18 -0
- data/test/rails_root/db/migrate/20090426041056_create_countries.rb +15 -0
- data/test/rails_root/db/migrate/20090426041103_create_states.rb +18 -0
- data/test/rails_root/db/migrate/{20090704220120_acts_as_taggable_on_migration.rb → 20090506000404_acts_as_taggable_on_migration.rb} +31 -29
- data/test/rails_root/db/migrate/20090517040220_create_uploads.rb +38 -0
- data/test/rails_root/db/migrate/20090730044139_add_comment_cache.rb +9 -0
- data/test/rails_root/db/migrate/20090818204527_add_activity_indexes.rb +9 -0
- data/test/rails_root/db/migrate/20090819030523_add_attachable_to_activities.rb +13 -0
- data/test/rails_root/lib/daemons/amazonaws.rb +36 -0
- data/test/rails_root/lib/tasks/muck.rake +7 -0
- data/test/rails_root/public/images/SWFUploadButton.png +0 -0
- data/test/rails_root/public/images/arrow_down.gif +0 -0
- data/test/rails_root/public/images/arrow_up.gif +0 -0
- data/test/rails_root/public/images/cancelbutton.gif +0 -0
- data/test/rails_root/public/images/fancybox/fancy_closebox.png +0 -0
- data/test/rails_root/public/images/fancybox/fancy_left.png +0 -0
- data/test/rails_root/public/images/fancybox/fancy_progress.png +0 -0
- data/test/rails_root/public/images/fancybox/fancy_right.png +0 -0
- data/test/rails_root/public/images/fancybox/fancy_shadow_e.png +0 -0
- data/test/rails_root/public/images/fancybox/fancy_shadow_n.png +0 -0
- data/test/rails_root/public/images/fancybox/fancy_shadow_ne.png +0 -0
- data/test/rails_root/public/images/fancybox/fancy_shadow_nw.png +0 -0
- data/test/rails_root/public/images/fancybox/fancy_shadow_s.png +0 -0
- data/test/rails_root/public/images/fancybox/fancy_shadow_se.png +0 -0
- data/test/rails_root/public/images/fancybox/fancy_shadow_sw.png +0 -0
- data/test/rails_root/public/images/fancybox/fancy_shadow_w.png +0 -0
- data/test/rails_root/public/images/fancybox/fancy_title_left.png +0 -0
- data/test/rails_root/public/images/fancybox/fancy_title_main.png +0 -0
- data/test/rails_root/public/images/fancybox/fancy_title_right.png +0 -0
- data/test/rails_root/public/images/file_icons/excel.gif +0 -0
- data/test/rails_root/public/images/file_icons/file.gif +0 -0
- data/test/rails_root/public/images/file_icons/file.png +0 -0
- data/test/rails_root/public/images/file_icons/file_aac.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_ai.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_avi.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_bin.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_bmp.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_cue.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_divx.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_doc.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_eps.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_flac.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_flv.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_gif.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_html.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_ical.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_indd.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_inx.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_iso.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_jpg.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_mov.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_mp3.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_mpg.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_pdf.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_php.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_png.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_pps.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_ppt.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_psd.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_qxd.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_qxp.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_raw.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_rtf.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_svg.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_tif.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_txt.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_vcf.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_wav.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_wma.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_xls.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_xml.gif +0 -0
- data/test/rails_root/public/images/file_icons/mp3.gif +0 -0
- data/test/rails_root/public/images/file_icons/pdf.gif +0 -0
- data/test/rails_root/public/images/file_icons/pdf.png +0 -0
- data/test/rails_root/public/images/file_icons/text.gif +0 -0
- data/test/rails_root/public/images/file_icons/text.png +0 -0
- data/test/rails_root/public/images/file_icons/word.gif +0 -0
- data/test/rails_root/public/images/icons/blue_guy.png +0 -0
- data/test/rails_root/public/images/icons/button_background.png +0 -0
- data/test/rails_root/public/images/icons/cancel.png +0 -0
- data/test/rails_root/public/images/icons/close.png +0 -0
- data/test/rails_root/public/images/icons/comment.png +0 -0
- data/test/rails_root/public/images/icons/exclaim.png +0 -0
- data/test/rails_root/public/images/icons/external.png +0 -0
- data/test/rails_root/public/images/icons/feed.png +0 -0
- data/test/rails_root/public/images/icons/grey_guy.png +0 -0
- data/test/rails_root/public/images/icons/hide.png +0 -0
- data/test/rails_root/public/images/icons/information.png +0 -0
- data/test/rails_root/public/images/icons/minus.png +0 -0
- data/test/rails_root/public/images/icons/pending.png +0 -0
- data/test/rails_root/public/images/icons/question.png +0 -0
- data/test/rails_root/public/images/icons/search_box.png +0 -0
- data/test/rails_root/public/images/icons/star.png +0 -0
- data/test/rails_root/public/images/icons/stop.png +0 -0
- data/test/rails_root/public/images/icons/thumb_down.png +0 -0
- data/test/rails_root/public/images/icons/thumb_up.png +0 -0
- data/test/rails_root/public/images/nothing.png +0 -0
- data/test/rails_root/public/{javascripts/tiny_mce/plugins/advimagetoo/img → images/tinymce}/sample.gif +0 -0
- data/test/rails_root/public/{javascripts/tiny_mce/plugins/advfiletoo/img → images/tinymce}/upload.gif +0 -0
- data/test/rails_root/public/javascripts/jquery/colorpicker.js +450 -0
- data/test/rails_root/public/javascripts/jquery/jquery.autocomplete.js.readme +6 -0
- data/test/rails_root/public/javascripts/jquery/jquery.autocomplete.min.js +15 -0
- data/test/rails_root/public/javascripts/jquery/jquery.autocomplete.pack.js +767 -0
- data/test/rails_root/public/javascripts/jquery/jquery.easing.js +1 -0
- data/test/rails_root/public/javascripts/jquery/jquery.fancybox.js +9 -0
- data/test/rails_root/public/javascripts/jquery/jquery.metadata.min.js +13 -0
- data/test/rails_root/public/javascripts/jquery/jquery.queryString.js +33 -0
- data/test/rails_root/public/javascripts/jquery/jquery.swapimage.js +66 -0
- data/test/rails_root/public/javascripts/jquery/jquery.swapimage.min.js +11 -0
- data/test/rails_root/public/javascripts/jquery/jrails.js +1 -0
- data/test/rails_root/public/javascripts/muck.js +11 -6
- data/test/rails_root/public/javascripts/muck_activities.js +5 -6
- data/test/rails_root/public/javascripts/muck_time/en.js +53 -0
- data/test/rails_root/public/javascripts/swfupload/fileprogress.js +151 -0
- data/test/rails_root/public/javascripts/swfupload/handlers.js +201 -0
- data/test/rails_root/public/javascripts/swfupload/swfupload.cookies.js +53 -0
- data/test/rails_root/public/javascripts/swfupload/swfupload.js +980 -0
- data/test/rails_root/public/javascripts/swfupload/swfupload.queue.js +98 -0
- data/test/rails_root/public/javascripts/swfupload/swfupload.speed.js +342 -0
- data/test/rails_root/public/javascripts/swfupload/swfupload.swfobject.js +111 -0
- data/test/rails_root/public/javascripts/tiny_mce/plugins/advfiletoo/editor_plugin.js +9 -22
- data/test/rails_root/public/javascripts/tiny_mce/plugins/advfiletoo/editor_plugin_src.js +41 -54
- data/test/rails_root/public/javascripts/tiny_mce/plugins/advfiletoo/js/functions.js +0 -139
- data/test/rails_root/public/javascripts/tiny_mce/plugins/advimagetoo/editor_plugin.js +9 -17
- data/test/rails_root/public/javascripts/tiny_mce/plugins/advimagetoo/editor_plugin_src.js +40 -50
- data/test/rails_root/public/javascripts/tiny_mce/plugins/advimagetoo/image.htm +10 -9
- data/test/rails_root/public/javascripts/tiny_mce/plugins/advimagetoo/js/functions.js +0 -152
- data/test/rails_root/public/javascripts/tiny_mce/plugins/advlinktoo/editor_plugin.js +3 -14
- data/test/rails_root/public/javascripts/tiny_mce/plugins/advlinktoo/editor_plugin_src.js +3 -14
- data/test/rails_root/public/javascripts/tiny_mce/templates/example.htm +14 -0
- data/test/rails_root/public/javascripts/tree.js +107 -0
- data/test/rails_root/public/stylesheets/jquery/jquery.autocomplete.css +15 -0
- data/test/rails_root/public/stylesheets/jquery/jquery.fancybox.css +44 -0
- data/test/rails_root/public/stylesheets/muck-activities.css +39 -0
- data/test/rails_root/public/stylesheets/styles.css +10 -3
- data/test/rails_root/public/stylesheets/swfupload.css +26 -0
- data/test/rails_root/public/{javascripts/tiny_mce/plugins/advfiletoo/css/advfile.css → stylesheets/tinymce.css} +33 -12
- data/test/rails_root/public/system/locals/000/000/026/original/deploy-1.rb +75 -0
- metadata +153 -25
- data/public/javascripts/tiny_mce/plugins/advfiletoo/file.htm +0 -139
- data/public/javascripts/tiny_mce/plugins/advimagetoo/css/advimage.css +0 -32
- data/public/javascripts/tiny_mce/plugins/advimagetoo/image.htm +0 -303
- data/public/javascripts/tiny_mce/plugins/advlinktoo/css/advlink.css +0 -8
- data/test/rails_root/db/migrate/20090608073052_create_friends.rb +0 -16
- data/test/rails_root/db/migrate/20090808005918_add_scope_index_to_slugs.rb +0 -9
- data/test/rails_root/public/javascripts/tiny_mce/plugins/advfiletoo/file.htm +0 -139
- data/test/rails_root/public/javascripts/tiny_mce/plugins/advimagetoo/css/advimage.css +0 -32
- data/test/rails_root/public/javascripts/tiny_mce/templates/bio.htm +0 -31
- data/test/rails_root/public/javascripts/tiny_mce/templates/country.htm +0 -59
@@ -1,144 +1,6 @@
|
|
1
|
-
var swfu;
|
2
|
-
|
3
|
-
window.onload = function () {
|
4
|
-
|
5
|
-
var parent_id = jQuery.getQueryString({id:"id"});
|
6
|
-
var parent_type = jQuery.getQueryString({id:"type"});
|
7
|
-
var session_id = jQuery.getQueryString({id:"sessionid"});
|
8
|
-
var session_key = jQuery.getQueryString({id:"sessionkey"});
|
9
|
-
var settings = {
|
10
|
-
flash_url : '/swf/swfupload.swf',
|
11
|
-
upload_url: '/uploads/swfupload.json?id=' + parent_id + '&type=' + parent_type + '&' + session_key + '=' + session_id + '&is_public=true',
|
12
|
-
file_size_limit : "100 MB",
|
13
|
-
file_types : "*.*",
|
14
|
-
file_types_description : "All Files",
|
15
|
-
file_upload_limit : 100,
|
16
|
-
file_queue_limit : 0,
|
17
|
-
custom_settings : {
|
18
|
-
progressTarget : "fsUploadProgress",
|
19
|
-
cancelButtonId : "btnCancel"
|
20
|
-
},
|
21
|
-
debug: false,
|
22
|
-
|
23
|
-
// Button Settings
|
24
|
-
button_image_url : "/images/XPButtonUploadText_61x22.png", // Relative to the SWF file
|
25
|
-
button_placeholder_id : "spanButtonPlaceholder",
|
26
|
-
button_width: 61,
|
27
|
-
button_height: 22,
|
28
|
-
|
29
|
-
// The event handler functions are defined in handlers.js
|
30
|
-
swfupload_loaded_handler : swfUploadLoaded,
|
31
|
-
file_queued_handler : fileQueued,
|
32
|
-
file_queue_error_handler : fileQueueError,
|
33
|
-
file_dialog_complete_handler : fileDialogComplete,
|
34
|
-
upload_start_handler : uploadStart,
|
35
|
-
upload_progress_handler : uploadProgress,
|
36
|
-
upload_error_handler : uploadError,
|
37
|
-
upload_success_handler : uploadSuccess,
|
38
|
-
upload_complete_handler : uploadComplete,
|
39
|
-
queue_complete_handler : queueComplete, // Queue plugin event
|
40
|
-
|
41
|
-
// SWFObject settings
|
42
|
-
minimum_flash_version : "9.0.28",
|
43
|
-
swfupload_pre_load_handler : swfUploadPreLoad,
|
44
|
-
swfupload_load_failed_handler : swfUploadLoadFailed
|
45
|
-
};
|
46
|
-
|
47
|
-
swfu = new SWFUpload(settings);
|
48
|
-
};
|
49
|
-
|
50
|
-
jQuery(document).ready(function()
|
51
|
-
{
|
52
|
-
var path = jQuery.getQueryString({id:"path"});
|
53
|
-
|
54
|
-
jQuery.getJSON(path, function(data){
|
55
|
-
jQuery('#upload-list-message').html('');
|
56
|
-
if (data.length <= 0){
|
57
|
-
jQuery("#upload-list-message").html('No Files Available');
|
58
|
-
} else {
|
59
|
-
for(i=0;i<data.length;i++){
|
60
|
-
add_file(data[i].upload, 'append');
|
61
|
-
}
|
62
|
-
}
|
63
|
-
});
|
64
|
-
});
|
65
|
-
function upload_file_callback(data){
|
66
|
-
jQuery('#upload-status').empty();
|
67
|
-
var json = eval('(' + data + ')');
|
68
|
-
add_file(json.upload, 'prepend');
|
69
|
-
}
|
70
|
-
function upload_file_fail_callback(message){
|
71
|
-
jQuery('#upload-status').html(message);
|
72
|
-
}
|
73
|
-
function upload_completed_callback(data){
|
74
|
-
var json = eval('(' + data + ')');
|
75
|
-
add_file(json.upload, 'prepend'); // call add_file from functions.js
|
76
|
-
}
|
77
|
-
function add_file(file, location){
|
78
|
-
var file_html = '<li id="file-' + file.id + '">' +
|
79
|
-
'<img class="icon" src="' + file.icon + '" alt="" />' +
|
80
|
-
'<a onclick="select_file(this);return false;" href="#">' + file.filename + '</a>' +
|
81
|
-
'<a onclick="delete_file(this, ' + file.id + ');return false;" href="#"><img src="/images/delete.png" /></a>' +
|
82
|
-
'<input type="hidden" value="' + file.public_filename + '" /></li>';
|
83
|
-
if ('prepend' == location){
|
84
|
-
jQuery('#upload-list').prepend(file_html);
|
85
|
-
} else {
|
86
|
-
jQuery('#upload-list').append(file_html);
|
87
|
-
}
|
88
|
-
}
|
89
|
-
function delete_file(element, id){
|
90
|
-
jQuery(element).parents('li').removeClass('selected');
|
91
|
-
jQuery(element).parents('li').fadeOut();
|
92
|
-
|
93
|
-
jQuery.post('/uploads/' + id + '.js', {action: 'destroy', _method: 'delete' },
|
94
|
-
function(data){
|
95
|
-
// just chuck the message
|
96
|
-
});
|
97
|
-
}
|
98
|
-
function select_file(element){
|
99
|
-
var anchor = jQuery(element);
|
100
|
-
var url = anchor.parents('li').children('input').val();
|
101
|
-
var name = anchor.html();
|
102
|
-
insert_file_too(url, name);
|
103
|
-
}
|
104
|
-
function insert_file_too(url, name){
|
105
|
-
jQuery('input#href').val(url);
|
106
|
-
if(jQuery('input#title').val().length <= 0){
|
107
|
-
jQuery('input#title').val(name);
|
108
|
-
}
|
109
|
-
mcTabs.displayTab('general_tab','general_panel');
|
110
|
-
}
|
111
1
|
function formElement() {
|
112
2
|
return document.insert_file;
|
113
3
|
}
|
114
|
-
function ts_onload(){
|
115
|
-
jQuery('#upload-status').html("Uploading <img src='/files/spinner.gif'>");
|
116
|
-
mcTabs.displayTab('dynamic_select_tab','dynamic_select_panel');
|
117
|
-
var iframe1=ts_ce('iframe','html_editor_file_upload_frame');
|
118
|
-
iframe1.setAttribute('src','about:blank');
|
119
|
-
iframe1.style.border="0px none";
|
120
|
-
iframe1.style.position="absolute";
|
121
|
-
iframe1.style.width="1px";
|
122
|
-
iframe1.style.height="1px";
|
123
|
-
iframe1.style.visibility="hidden";
|
124
|
-
iframe1.setAttribute('id','html_editor_file_upload_frame');
|
125
|
-
jQuery('#file-upload').append(iframe1);
|
126
|
-
jQuery('#file_upload_form').attr('action', ts_upload_file_path());
|
127
|
-
}
|
128
|
-
function ts_upload_file_path() {
|
129
|
-
var parent_id = jQuery.getQueryString({id:"id"});
|
130
|
-
var parent_type = jQuery.getQueryString({id:"type"});
|
131
|
-
return '/uploads.js?id=' + parent_id + '&type=' + parent_type;
|
132
|
-
}
|
133
|
-
function ts_ce(tag,name){
|
134
|
-
if (name && window.ActiveXObject){
|
135
|
-
element = document.createElement('<'+tag+' name="'+name+'">');
|
136
|
-
}else{
|
137
|
-
element = document.createElement(tag);
|
138
|
-
element.setAttribute('name',name);
|
139
|
-
}
|
140
|
-
return element;
|
141
|
-
}
|
142
4
|
|
143
5
|
tinyMCEPopup.requireLangPack();
|
144
6
|
|
@@ -148,7 +10,6 @@ var templates = {
|
|
148
10
|
|
149
11
|
function preinit() {
|
150
12
|
var url;
|
151
|
-
|
152
13
|
if (url = tinyMCEPopup.getParam("external_link_list_url"))
|
153
14
|
document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>');
|
154
15
|
}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
/**
|
2
|
-
*
|
3
|
-
* @author
|
4
|
-
* @copyright Copyright ©
|
2
|
+
* Modified version of advimage
|
3
|
+
* @author Tatamae
|
4
|
+
* @copyright Copyright © 2009, Tatemae.
|
5
5
|
*/
|
6
6
|
(function() {
|
7
7
|
tinymce.create('tinymce.plugins.AdvancedImageTooPlugin', {
|
@@ -9,41 +9,33 @@
|
|
9
9
|
// Register commands
|
10
10
|
ed.addCommand('mceAdvImageToo', function() {
|
11
11
|
var e = ed.selection.getNode();
|
12
|
-
|
13
12
|
// Internal image object like a flash placeholder
|
14
13
|
if (ed.dom.getAttrib(e, 'class').indexOf('mceItem') != -1)
|
15
14
|
return;
|
16
|
-
|
17
15
|
ed.windowManager.open({
|
18
|
-
file :
|
19
|
-
|
20
|
-
|
21
|
-
width : 675 + parseInt(ed.getLang('advimagetoo.delta_width', 0)),
|
22
|
-
height : 560 + parseInt(ed.getLang('advimagetoo.delta_height', 0)),
|
16
|
+
file : jQuery('#tiny_mce_images_path').val(),
|
17
|
+
width : parseInt(jQuery('#tiny_mce_images_width').val()) + parseInt(ed.getLang('advfiletoo.delta_width', 0)),
|
18
|
+
height : parseInt(jQuery('#tiny_mce_images_height').val()) + parseInt(ed.getLang('advfiletoo.delta_height', 0)),
|
23
19
|
inline : 1
|
24
20
|
}, {
|
25
21
|
plugin_url : url
|
26
22
|
});
|
27
23
|
});
|
28
|
-
|
29
24
|
// Register buttons
|
30
25
|
ed.addButton('image', {
|
31
26
|
title : 'Upload Images',
|
32
27
|
cmd : 'mceAdvImageToo'
|
33
28
|
});
|
34
29
|
},
|
35
|
-
|
36
30
|
getInfo : function() {
|
37
31
|
return {
|
38
|
-
longname : 'Advanced
|
39
|
-
author : '
|
40
|
-
authorurl : 'http://
|
41
|
-
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage',
|
32
|
+
longname : 'Advanced file',
|
33
|
+
author : 'Tatemae',
|
34
|
+
authorurl : 'http://Tatemae.com',
|
42
35
|
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
43
36
|
};
|
44
37
|
}
|
45
38
|
});
|
46
|
-
|
47
39
|
// Register plugin
|
48
40
|
tinymce.PluginManager.add('advimagetoo', tinymce.plugins.AdvancedImageTooPlugin);
|
49
41
|
})();
|
@@ -1,51 +1,41 @@
|
|
1
|
-
/**
|
2
|
-
*
|
3
|
-
*
|
4
|
-
* @
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
author : 'Moxiecode Systems AB',
|
42
|
-
authorurl : 'http://tinymce.moxiecode.com',
|
43
|
-
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage',
|
44
|
-
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
45
|
-
};
|
46
|
-
}
|
47
|
-
});
|
48
|
-
|
49
|
-
// Register plugin
|
50
|
-
tinymce.PluginManager.add('advimagetoo', tinymce.plugins.AdvancedImageTooPlugin);
|
1
|
+
/**
|
2
|
+
* Modified version of advimage
|
3
|
+
* @author Tatamae
|
4
|
+
* @copyright Copyright © 2009, Tatemae.
|
5
|
+
*/
|
6
|
+
(function() {
|
7
|
+
tinymce.create('tinymce.plugins.AdvancedImageTooPlugin', {
|
8
|
+
init : function(ed, url) {
|
9
|
+
// Register commands
|
10
|
+
ed.addCommand('mceAdvImageToo', function() {
|
11
|
+
var e = ed.selection.getNode();
|
12
|
+
// Internal image object like a flash placeholder
|
13
|
+
if (ed.dom.getAttrib(e, 'class').indexOf('mceItem') != -1)
|
14
|
+
return;
|
15
|
+
ed.windowManager.open({
|
16
|
+
file : jQuery('#tiny_mce_images_path').val(),
|
17
|
+
width : parseInt(jQuery('#tiny_mce_images_width').val()) + parseInt(ed.getLang('advfiletoo.delta_width', 0)),
|
18
|
+
height : parseInt(jQuery('#tiny_mce_images_height').val()) + parseInt(ed.getLang('advfiletoo.delta_height', 0)),
|
19
|
+
inline : 1
|
20
|
+
}, {
|
21
|
+
plugin_url : url
|
22
|
+
});
|
23
|
+
});
|
24
|
+
// Register buttons
|
25
|
+
ed.addButton('image', {
|
26
|
+
title : 'Upload Images',
|
27
|
+
cmd : 'mceAdvImageToo'
|
28
|
+
});
|
29
|
+
},
|
30
|
+
getInfo : function() {
|
31
|
+
return {
|
32
|
+
longname : 'Advanced file',
|
33
|
+
author : 'Tatemae',
|
34
|
+
authorurl : 'http://Tatemae.com',
|
35
|
+
version : tinymce.majorVersion + "." + tinymce.minorVersion
|
36
|
+
};
|
37
|
+
}
|
38
|
+
});
|
39
|
+
// Register plugin
|
40
|
+
tinymce.PluginManager.add('advimagetoo', tinymce.plugins.AdvancedImageTooPlugin);
|
51
41
|
})();
|
@@ -1,158 +1,6 @@
|
|
1
|
-
var swfu;
|
2
|
-
|
3
|
-
window.onload = function () {
|
4
|
-
|
5
|
-
var parent_id = jQuery.getQueryString({id:"id"});
|
6
|
-
var parent_type = jQuery.getQueryString({id:"type"});
|
7
|
-
var session_id = jQuery.getQueryString({id:"sessionid"});
|
8
|
-
var session_key = jQuery.getQueryString({id:"sessionkey"});
|
9
|
-
var settings = {
|
10
|
-
flash_url : '/swf/swfupload.swf',
|
11
|
-
upload_url: '/uploads/swfupload.json?id=' + parent_id + '&type=' + parent_type + '&' + session_key + '=' + session_id + '&is_public=true',
|
12
|
-
file_size_limit : "100 MB",
|
13
|
-
file_types : '*.jpg; *.jpeg; *.psd; *.png; *.gif;',
|
14
|
-
file_types_description : "Images",
|
15
|
-
file_upload_limit : 100,
|
16
|
-
file_queue_limit : 0,
|
17
|
-
custom_settings : {
|
18
|
-
progressTarget : "fsUploadProgress",
|
19
|
-
cancelButtonId : "btnCancel"
|
20
|
-
},
|
21
|
-
debug: false,
|
22
|
-
|
23
|
-
// Button Settings
|
24
|
-
button_image_url : "/images/XPButtonUploadText_61x22.png", // Relative to the SWF file
|
25
|
-
button_placeholder_id : "spanButtonPlaceholder",
|
26
|
-
button_width: 61,
|
27
|
-
button_height: 22,
|
28
|
-
|
29
|
-
// The event handler functions are defined in handlers.js
|
30
|
-
swfupload_loaded_handler : swfUploadLoaded,
|
31
|
-
file_queued_handler : fileQueued,
|
32
|
-
file_queue_error_handler : fileQueueError,
|
33
|
-
file_dialog_complete_handler : fileDialogComplete,
|
34
|
-
upload_start_handler : uploadStart,
|
35
|
-
upload_progress_handler : uploadProgress,
|
36
|
-
upload_error_handler : uploadError,
|
37
|
-
upload_success_handler : uploadSuccess,
|
38
|
-
upload_complete_handler : uploadComplete,
|
39
|
-
queue_complete_handler : queueComplete, // Queue plugin event
|
40
|
-
|
41
|
-
// SWFObject settings
|
42
|
-
minimum_flash_version : "9.0.28",
|
43
|
-
swfupload_pre_load_handler : swfUploadPreLoad,
|
44
|
-
swfupload_load_failed_handler : swfUploadLoadFailed
|
45
|
-
};
|
46
|
-
|
47
|
-
swfu = new SWFUpload(settings);
|
48
|
-
};
|
49
|
-
|
50
|
-
jQuery(document).ready(function()
|
51
|
-
{
|
52
|
-
var path = jQuery.getQueryString({id:"path"});
|
53
|
-
|
54
|
-
jQuery.getJSON(path, function(data){
|
55
|
-
jQuery('#upload-list-message').html('');
|
56
|
-
if (data.length <= 0){
|
57
|
-
jQuery("#upload-list-message").html('No Images Available');
|
58
|
-
} else {
|
59
|
-
for(i=0;i<data.length;i++){
|
60
|
-
add_image(data[i].upload, 'append');
|
61
|
-
}
|
62
|
-
}
|
63
|
-
});
|
64
|
-
});
|
65
|
-
function upload_file_callback(data){
|
66
|
-
jQuery('#upload-status').empty();
|
67
|
-
var json = eval('(' + data + ')');
|
68
|
-
add_image(json.upload, 'prepend');
|
69
|
-
}
|
70
|
-
function upload_file_fail_callback(message){
|
71
|
-
jQuery('#upload-status').html(message);
|
72
|
-
}
|
73
|
-
function upload_completed_callback(data){
|
74
|
-
var json = eval('(' + data + ')');
|
75
|
-
add_image(json.upload, 'prepend'); // call add_image from functions.js
|
76
|
-
}
|
77
|
-
function add_image(image, location){
|
78
|
-
var image_html = '<li id="image-' + image.id + '">' +
|
79
|
-
'<div class="thumbs">Insert:<br />' +
|
80
|
-
'<a onclick="select_thumb(this);return false;" href="#_icon"> Icon </a>' +
|
81
|
-
'<a onclick="select_thumb(this);return false;" href="#_thumb"> Thumbnail </a>' +
|
82
|
-
'<a onclick="select_thumb(this);return false;" href="#_small"> Small </a>' +
|
83
|
-
'<a onclick="select_thumb(this);return false;" href="#_medium"> Medium </a>' +
|
84
|
-
'<a onclick="select_thumb(this);return false;" href="#"> Large </a><br/><div class="file-controls">' +
|
85
|
-
'<a class="file-control" onclick="jQuery(this).parents(\'li\').removeClass(\'selected\');return false;" href="#"> cancel </a><br/>' +
|
86
|
-
'<a class="file-control" onclick="delete_image(this, ' + image.id + ');return false;" href="#"> delete </a></div></div>' +
|
87
|
-
'<a onclick="select_image(\'image-' + image.id + '\');return false;" href="#">' +
|
88
|
-
'<img src="' + image.icon + '" alt="" /></a></li>';
|
89
|
-
|
90
|
-
if ('prepend' == location){
|
91
|
-
jQuery('#upload-list').prepend(image_html);
|
92
|
-
} else {
|
93
|
-
jQuery('#upload-list').append(image_html);
|
94
|
-
}
|
95
|
-
}
|
96
|
-
function delete_image(element, id){
|
97
|
-
jQuery(element).parents('li').removeClass('selected');
|
98
|
-
jQuery(element).parents('li').fadeOut();
|
99
|
-
|
100
|
-
jQuery.post('/uploads/' + id + '.js', {action: 'destroy', _method: 'delete' },
|
101
|
-
function(data){
|
102
|
-
//show_message(data); the fade out on delete gets the point across
|
103
|
-
});
|
104
|
-
}
|
105
|
-
function select_image(element){
|
106
|
-
jQuery('#upload-list li').removeClass('selected');
|
107
|
-
jQuery('#' + element).addClass('selected');
|
108
|
-
}
|
109
|
-
function select_thumb(element) {
|
110
|
-
var anchor = jQuery(element);
|
111
|
-
var size = anchor.attr('href').split('#')[1];
|
112
|
-
var img = anchor.parents('li').children('a').children('img');
|
113
|
-
var src = img.attr('src').replace('_icon.', size + '.');
|
114
|
-
anchor.parents('li').removeClass('selected');
|
115
|
-
insert_image_too(src, img.attr('alt') );
|
116
|
-
}
|
117
|
-
function insert_image_too(url, alt_text){
|
118
|
-
var formObj = formElement();
|
119
|
-
formObj.src.value = url;
|
120
|
-
formObj.alt.value = alt_text;
|
121
|
-
mcTabs.displayTab('general_tab','general_panel');
|
122
|
-
ImageDialog.showPreviewImage(url);
|
123
|
-
}
|
124
1
|
function formElement() {
|
125
2
|
return document.insert_image;
|
126
3
|
}
|
127
|
-
function ts_onload(){
|
128
|
-
jQuery('#upload-status').html("Uploading <img src='/images/spinner.gif'>");
|
129
|
-
mcTabs.displayTab('dynamic_select_tab','dynamic_select_panel');
|
130
|
-
var iframe1=ts_ce('iframe','html_editor_image_upload_frame');
|
131
|
-
iframe1.setAttribute('src','about:blank');
|
132
|
-
iframe1.style.border="0px none";
|
133
|
-
iframe1.style.position="absolute";
|
134
|
-
iframe1.style.width="1px";
|
135
|
-
iframe1.style.height="1px";
|
136
|
-
iframe1.style.visibility="hidden";
|
137
|
-
iframe1.setAttribute('id','html_editor_image_upload_frame');
|
138
|
-
jQuery('#image-upload').append(iframe1);
|
139
|
-
jQuery('#image_upload_form').attr('action', ts_upload_image_path());
|
140
|
-
}
|
141
|
-
function ts_upload_image_path() {
|
142
|
-
var parent_id = jQuery.getQueryString({id:"id"});
|
143
|
-
var parent_type = jQuery.getQueryString({id:"type"});
|
144
|
-
return '/uploads.js?id=' + parent_id + '&type=' + parent_type;
|
145
|
-
}
|
146
|
-
function ts_ce(tag,name){
|
147
|
-
if (name && window.ActiveXObject){
|
148
|
-
element = document.createElement('<'+tag+' name="'+name+'">');
|
149
|
-
}else{
|
150
|
-
element = document.createElement(tag);
|
151
|
-
element.setAttribute('name',name);
|
152
|
-
}
|
153
|
-
return element;
|
154
|
-
}
|
155
|
-
|
156
4
|
var ImageDialog = {
|
157
5
|
preInit : function() {
|
158
6
|
var url;
|
@@ -1,25 +1,19 @@
|
|
1
1
|
/**
|
2
|
-
*
|
3
|
-
*
|
4
|
-
* @author Moxiecode
|
5
|
-
* @copyright Copyright © 2004-2008, Moxiecode Systems AB, All rights reserved.
|
2
|
+
* @author Tatemae
|
3
|
+
* @copyright Copyright © 2009, Tatemae, All rights reserved.
|
6
4
|
*/
|
7
|
-
|
8
5
|
(function() {
|
9
6
|
tinymce.create('tinymce.plugins.AdvancedLinkTooPlugin', {
|
10
7
|
init : function(ed, url) {
|
11
8
|
this.editor = ed;
|
12
|
-
|
13
9
|
// Register commands
|
14
10
|
ed.addCommand('mceAdvLinkToo', function() {
|
15
11
|
var se = ed.selection;
|
16
|
-
|
17
12
|
// No selection and not in link
|
18
13
|
if (se.isCollapsed() && !ed.dom.getParent(se.getNode(), 'A'))
|
19
14
|
return;
|
20
|
-
|
21
15
|
ed.windowManager.open({
|
22
|
-
file :
|
16
|
+
file : '/tiny_mce_links',
|
23
17
|
width : 480 + parseInt(ed.getLang('advlinktoo.delta_width', 0)),
|
24
18
|
height : 400 + parseInt(ed.getLang('advlinktoo.delta_height', 0)),
|
25
19
|
inline : 1
|
@@ -27,21 +21,17 @@
|
|
27
21
|
plugin_url : url
|
28
22
|
});
|
29
23
|
});
|
30
|
-
|
31
24
|
// Register buttons
|
32
25
|
ed.addButton('link', {
|
33
26
|
title : 'advlinktoo.link_desc',
|
34
27
|
cmd : 'mceAdvLinkToo'
|
35
28
|
});
|
36
|
-
|
37
29
|
ed.addShortcut('ctrl+k', 'advlinktoo.advlink_desc', 'mceAdvLinkToo');
|
38
|
-
|
39
30
|
ed.onNodeChange.add(function(ed, cm, n, co) {
|
40
31
|
cm.setDisabled('link', co && n.nodeName != 'A');
|
41
32
|
cm.setActive('link', n.nodeName == 'A' && !n.name);
|
42
33
|
});
|
43
34
|
},
|
44
|
-
|
45
35
|
getInfo : function() {
|
46
36
|
return {
|
47
37
|
longname : 'Advanced link',
|
@@ -52,7 +42,6 @@
|
|
52
42
|
};
|
53
43
|
}
|
54
44
|
});
|
55
|
-
|
56
45
|
// Register plugin
|
57
46
|
tinymce.PluginManager.add('advlinktoo', tinymce.plugins.AdvancedLinkTooPlugin);
|
58
47
|
})();
|
@@ -1,25 +1,19 @@
|
|
1
1
|
/**
|
2
|
-
*
|
3
|
-
*
|
4
|
-
* @author Moxiecode
|
5
|
-
* @copyright Copyright � 2004-2008, Moxiecode Systems AB, All rights reserved.
|
2
|
+
* @author Tatemae
|
3
|
+
* @copyright Copyright � 2009, Tatemae, All rights reserved.
|
6
4
|
*/
|
7
|
-
|
8
5
|
(function() {
|
9
6
|
tinymce.create('tinymce.plugins.AdvancedLinkTooPlugin', {
|
10
7
|
init : function(ed, url) {
|
11
8
|
this.editor = ed;
|
12
|
-
|
13
9
|
// Register commands
|
14
10
|
ed.addCommand('mceAdvLinkToo', function() {
|
15
11
|
var se = ed.selection;
|
16
|
-
|
17
12
|
// No selection and not in link
|
18
13
|
if (se.isCollapsed() && !ed.dom.getParent(se.getNode(), 'A'))
|
19
14
|
return;
|
20
|
-
|
21
15
|
ed.windowManager.open({
|
22
|
-
file :
|
16
|
+
file : '/tiny_mce_links',
|
23
17
|
width : 480 + parseInt(ed.getLang('advlinktoo.delta_width', 0)),
|
24
18
|
height : 400 + parseInt(ed.getLang('advlinktoo.delta_height', 0)),
|
25
19
|
inline : 1
|
@@ -27,21 +21,17 @@
|
|
27
21
|
plugin_url : url
|
28
22
|
});
|
29
23
|
});
|
30
|
-
|
31
24
|
// Register buttons
|
32
25
|
ed.addButton('link', {
|
33
26
|
title : 'advlinktoo.link_desc',
|
34
27
|
cmd : 'mceAdvLinkToo'
|
35
28
|
});
|
36
|
-
|
37
29
|
ed.addShortcut('ctrl+k', 'advlinktoo.advlink_desc', 'mceAdvLinkToo');
|
38
|
-
|
39
30
|
ed.onNodeChange.add(function(ed, cm, n, co) {
|
40
31
|
cm.setDisabled('link', co && n.nodeName != 'A');
|
41
32
|
cm.setActive('link', n.nodeName == 'A' && !n.name);
|
42
33
|
});
|
43
34
|
},
|
44
|
-
|
45
35
|
getInfo : function() {
|
46
36
|
return {
|
47
37
|
longname : 'Advanced link',
|
@@ -52,7 +42,6 @@
|
|
52
42
|
};
|
53
43
|
}
|
54
44
|
});
|
55
|
-
|
56
45
|
// Register plugin
|
57
46
|
tinymce.PluginManager.add('advlinktoo', tinymce.plugins.AdvancedLinkTooPlugin);
|
58
47
|
})();
|
data/public/{javascripts/tiny_mce/plugins/advfiletoo/css/advfile.css → stylesheets/tinymce.css}
RENAMED
@@ -12,12 +12,14 @@ input{width:280px;}
|
|
12
12
|
input.submit{width:auto;margin:0;}
|
13
13
|
#constrain,#onmousemovecheck{width:auto;}
|
14
14
|
#id,#dir,#lang,#usemap,#longdesc{width:200px;}
|
15
|
+
.right{float:right;}
|
16
|
+
.left{float:left;}
|
17
|
+
.clear{clear:both;}
|
18
|
+
.pagination a{border:1px solid #7DA807;color:#7DA807;margin-right:.3em;padding:.3em;}
|
19
|
+
.pagination a:hover{background:#7DA807;border:1px solid #7DA807;color:#ffffff;}
|
20
|
+
.pagination a.active{background:#1EA2C1;border:none;color:#ffffff;}
|
21
|
+
/*file dialog*/
|
15
22
|
ul.file-list{list-style:none;margin:0;padding:0;}
|
16
|
-
ul.file-list img{border:0;margin:0px 3px;}
|
17
|
-
ul.file-list li{display:block;float:left;margin-right:4px;margin-bottom:2px;width:300px;height:20px;}
|
18
|
-
ul.file-list li img.icon{width:20px;}
|
19
|
-
ul.file-list li a{outline:none;font-size:14px;text-decoration:none;}
|
20
|
-
ul.file-list li a:hover{text-decoration:underline;}
|
21
23
|
ul.file-list li.selected a img{border:2px solid red;}
|
22
24
|
ul.file-list li .thumbs{display:none;background:#efefef;position:absolute;width:65px;margin:25px 5px 5px 15px;border-right:2px solid #666;border-bottom:2px solid #333;border-top:2px solid #efefef;border-left:2px solid #efefef;}
|
23
25
|
ul.file-list li .thumbs a{margin-bottom:5px;line-height:1.5em;text-decoration:none;}
|
@@ -25,10 +27,29 @@ ul.file-list li .thumbs a{text-decoration:underline;}
|
|
25
27
|
ul.file-list li.selected .thumbs{display:block;}
|
26
28
|
ul.file-list li .thumbs .file-controls{border-top:solid 2px #666666;margin:5px 1px;}
|
27
29
|
ul.file-list li .thumbs .file-control{float:right;font-size:10px;display:block;margin:2px;}
|
28
|
-
.
|
29
|
-
.
|
30
|
-
.
|
31
|
-
.
|
32
|
-
.
|
33
|
-
|
34
|
-
|
30
|
+
ul.file-list img{border:0;margin:0px 3px;}
|
31
|
+
ul.file-list li{display:block;float:left;margin-right:4px;margin-bottom:2px;width:300px;height:20px;}
|
32
|
+
ul.file-list li img.icon{width:20px;}
|
33
|
+
ul.file-list li a{outline:none;font-size:14px;text-decoration:none;}
|
34
|
+
ul.file-list li a:hover{text-decoration:underline;}
|
35
|
+
/*image dialog*/
|
36
|
+
ul.image-list{list-style:none;margin:0;padding:0;}
|
37
|
+
ul.image-list li{display:block;float:left;margin-right:4px;margin-bottom:2px;width:100px;height:100px;overflow:hidden;}
|
38
|
+
ul.image-list li img{border:0;}
|
39
|
+
ul.image-list li a{outline:none;}
|
40
|
+
ul.image-list li.selected a img{border:2px solid red;}
|
41
|
+
ul.image-list li .thumbs{display:none;background:#efefef;position:absolute;width:65px;margin:25px 5px 5px 15px;border-right:2px solid #666;border-bottom:2px solid #333;border-top:2px solid #efefef;border-left:2px solid #efefef;}
|
42
|
+
ul.image-list li .thumbs a{margin-bottom:5px;line-height:1.5em;text-decoration:none;}
|
43
|
+
ul.image-list li .thumbs a{text-decoration:underline;}
|
44
|
+
ul.image-list li.selected .thumbs{display:block;}
|
45
|
+
ul.image-list li .thumbs .file-controls{border-top:solid 2px #666666;margin:5px 1px;}
|
46
|
+
ul.image-list li .thumbs .file-control{float:right;font-size:10px;display:block;margin:2px;}
|
47
|
+
/*link dialog*/
|
48
|
+
.mceLinkList, .mceAnchorList, #targetlist {width:280px;}
|
49
|
+
.mceActionPanel {margin-top:7px;}
|
50
|
+
.panel_wrapper div.current {height:390px;}
|
51
|
+
#classlist, #title, #href {width:280px;}
|
52
|
+
#popupurl, #popupname {width:200px;}
|
53
|
+
#popupwidth, #popupheight, #popupleft, #popuptop {width:30px;vertical-align:middle;text-align:center;}
|
54
|
+
#id, #style, #classes, #target, #dir, #hreflang, #lang, #charset, #type, #rel, #rev, #tabindex, #accesskey {width:200px;}
|
55
|
+
#events_panel input {width:200px;}
|
data/test/rails_root/Rakefile
CHANGED