o: ActiveSupport::Cache::Entry :@created_atf1328559755.53546 Dú:@expires_in0:@compressedF:@value"Ž
{"content_type"application/javascript"
class"ProcessedAsset"dependency_digest"%ebfd26c3257ee8ac0f522fa01f95d23b"
mtime"2012-02-06T21:15:15+01:00"
_version"%aa7d0db7619379e13b08335dee027df2"dependency_paths[{"
mtime"2012-02-06T21:15:15+01:00"digest"%9f55cd4b413f08cfa176abbdf6a56311" path"g/Users/bastiaan/Files/Work/rich/vendor/assets/ckeditor/ckeditor-contrib/plugins/richfile/plugin.js"digest"%9f55cd4b413f08cfa176abbdf6a56311"required_paths["g/Users/bastiaan/Files/Work/rich/vendor/assets/ckeditor/ckeditor-contrib/plugins/richfile/plugin.js"
pathname"g/Users/bastiaan/Files/Work/rich/vendor/assets/ckeditor/ckeditor-contrib/plugins/richfile/plugin.js"logical_path"0ckeditor-contrib/plugins/richfile/plugin.js"lengthi
"source"
// Rich CKEditor integration plugin - Bastiaan Terhorst
(function(){
CKEDITOR.plugins.add('richfile',
{
init: function(editor) {
// register a callback that actually inserts a selected image
editor._.insertImagefn = CKEDITOR.tools.addFunction(function(url, id, name){
this.insertHtml('
');
}, editor);
editor._.insertFilefn = CKEDITOR.tools.addFunction(function(url, id, name){
this.insertHtml('' + name + '');
}, editor);
// double click an image to replace it
editor.on( 'doubleclick', function(evt) {
var element = evt.data.element;
if (element.is('img') && !element.data('cke-realelement') && !element.isReadOnly()) {
editor.execCommand('insertRichImage');
}
});
// clean up the callback
editor.on( 'destroy', function () { CKEDITOR.tools.removeFunction( this._.insertImagefn ); } );
editor.addCommand( 'insertRichImage', {
exec: function(editor) {
var params = {};
params.CKEditor = editor.name;
params.CKEditorFuncNum = editor._.insertImagefn;
params.default_style = editor.config.default_style;
params.allowed_styles = editor.config.allowed_styles;
params.insert_many = editor.config.insert_many;
params.type = "image";
params.scoped = editor.config.scoped || false;
if(params.scoped == true) {
params.scope_type = editor.config.scope_type
params.scope_id = editor.config.scope_id;
}
params.viewMode = editor.config.view_mode || "grid";
var url = addQueryString(editor.config.richBrowserUrl, params );
editor.popup(url, 860, 500);
}
});
editor.addCommand( 'insertRichFile', {
exec: function(editor) {
var params = {};
params.CKEditor = editor.name;
params.CKEditorFuncNum = editor._.insertFilefn;
params.default_style = "original";
params.allowed_styles = "original";
params.insert_many = editor.config.insert_many;
params.type = "file";
if(params.scoped == true) {
params.scope_type = editor.config.scope_type
params.scope_id = editor.config.scope_id;
}
params.viewMode = editor.config.view_mode || "list";
var url = addQueryString(editor.config.richBrowserUrl, params );
editor.popup(url, 860, 500);
}
});
editor.ui.addButton( 'richImage', {
label : "Browse and upload images",
command: 'insertRichImage',
icon: '/assets/rich/images.png'
});
editor.ui.addButton( 'richFile', {
label : "Browse and upload files",
command: 'insertRichFile',
icon: '/assets/rich/files.png'
});
}
});
})();