module RailsWangeditor
Constants
- VERSION
Public Class Methods
assets()
click to toggle source
# File lib/rails_wangeditor.rb, line 30 def self.assets Dir[root_path.join('vendor/assets/javascripts/wangeditor/**', '*.{js,css}')].inject([]) do |assets, path| assets << Pathname.new(path).relative_path_from(root_path.join('vendor/assets/javascripts')).to_s end end
base_path()
click to toggle source
# File lib/rails_wangeditor.rb, line 22 def self.base_path self.asset_url_prefix ? "#{self.asset_url_prefix}/wangeditor/" : '/assets/wangeditor/' end
resize_to_limit()
click to toggle source
# File lib/rails_wangeditor.rb, line 43 def self.resize_to_limit if !image_resize_to_limit.nil? && image_resize_to_limit.is_a?(Array) [image_resize_to_limit[0], image_resize_to_limit[1]] else [800, 800] end end
root_path()
click to toggle source
# File lib/rails_wangeditor.rb, line 26 def self.root_path @root_path ||= Pathname.new(File.dirname(File.expand_path('../', __FILE__))) end
setup() { |self| ... }
click to toggle source
# File lib/rails_wangeditor.rb, line 51 def self.setup yield self end
upload_store_dir()
click to toggle source
# File lib/rails_wangeditor.rb, line 36 def self.upload_store_dir dirs = upload_dir.gsub(/^\/+/,'').gsub(/\/+$/,'').split('/') dirs.each { |dir| dir.gsub!(/\W/, '') } dirs.delete('') dirs.join('/') end