o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1365016711.795597: @value"5 {I" class:EFI"ProcessedAsset;FI"logical_path;FI"6tinymce/plugins/locomotive_media/editor_plugin.js;TI" pathname;FI"v/Users/papipo/Projects/locomotive/engine/app/assets/javascripts/tinymce/plugins/locomotive_media/editor_plugin.js;TI"content_type;FI"application/javascript;FI" mtime;FI"2013-04-03T11:01:13+02:00;FI" length;Fi˜I" digest;F"%23e30101b3c2cc6cc26297b376402122I" source;FI"˜/** * LocomotiveMedia plugin * * Copyright 2011, Didier Lafforgue * Released under MIT License. * */ (function() { var insertImage = function(ed, asset) { var args = {}, el; // Fixes crash in Safari if (tinymce.isWebKit) ed.getWin().focus(); if (asset.get('image')) tinymce.extend(args, { src : asset.get('url') }); else tinymce.extend(args, { href : asset.get('url') }); el = ed.selection.getNode(); if (el && (el.nodeName == 'IMG' || el.nodeName == 'A')) { ed.dom.setAttribs(el, args); } else { if (asset.get('image')) { ed.execCommand('mceInsertContent', false, '', { skip_undo: 1 }); } else { var html = ed.selection.getContent(); if (html == '') html = asset.get('filename'); ed.execCommand('mceInsertContent', false, '' + html + '', { skip_undo: 1 }); } ed.dom.setAttribs('__mce_tmp', args); ed.dom.setAttrib('__mce_tmp', 'id', ''); ed.undoManager.add(); } } tinymce.create('tinymce.plugins.LocomotiveMediaPicker', { init : function(ed, url) { view = new Locomotive.Views.ContentAssets.PickerView({ 'collection': new Locomotive.Models.ContentAssetsCollection() }); view.render(); // Register commands ed.addCommand('locomotiveMedia', function() { view.options.on_select = function(asset) { insertImage(ed, asset); view.close(); } view.fetch_assets(); }); // Register buttons ed.addButton('locomotive_media', { title : 'locomotive_media.image_desc', cmd : 'locomotiveMedia' }); }, getInfo : function() { return { longname : 'Locomotive Media Picker', author : 'Didier Lafforgue', authorurl : 'http://www.locomotivecms.com', infourl : 'http://www.locomotivecms.com', version : tinymce.majorVersion + "." + tinymce.minorVersion }; } }); // Register plugin tinymce.PluginManager.requireLangPack('locomotive_media'); tinymce.PluginManager.add('locomotive_media', tinymce.plugins.LocomotiveMediaPicker); })(); ;FI"dependency_digest;F"%9c9a455c8c1334ff3c658331ba7766bfI"required_paths;F[I"v/Users/papipo/Projects/locomotive/engine/app/assets/javascripts/tinymce/plugins/locomotive_media/editor_plugin.js;TI"dependency_paths;F[{I" path;FI"v/Users/papipo/Projects/locomotive/engine/app/assets/javascripts/tinymce/plugins/locomotive_media/editor_plugin.js;TI" mtime;FI"2013-04-03T11:01:13+02:00;FI" digest;F"%d16f6a002f4f7eb45e41b4f252f62e42I" _version;F"%6776f581a4329e299531e1d52aa59832