Sha256: 7c00869dd265ae4d69bf9f3c85ec03b164c6ca5163dfe0b5f4accfb9eabfda53
Contents?: true
Size: 922 Bytes
Versions: 52
Compression:
Stored size: 922 Bytes
Contents
class Ckeditor::AttachmentFile < Ckeditor::Asset def url(*args) if [:thumb, :content].include?(args.first) send("url_#{args.first}") else data.url(*args) end end def url_content data.url end def url_thumb extname = File.extname(filename) case extname.to_s when '.swf' then '/javascripts/ckeditor/images/swf.gif' when '.pdf' then '/javascripts/ckeditor/images/pdf.gif' when '.doc', '.txt' then '/javascripts/ckeditor/images/doc.gif' when '.mp3' then '/javascripts/ckeditor/images/mp3.gif' when '.rar', '.zip', '.tg' then '/javascripts/ckeditor/images/rar.gif' when '.xls' then '/javascripts/ckeditor/images/xls.gif' else '/javascripts/ckeditor/images/ckfnothumb.gif' end end def to_json(options = {}) options[:methods] ||= [] options[:methods] << :url_content options[:methods] << :url_thumb super options end end
Version data entries
52 entries across 52 versions & 2 rubygems