spohlenz / tinymce-rails

Integration of TinyMCE with the Rails asset pipeline
Other
815 stars 256 forks source link

Recommended way to handle with multiple assets hosts. #82

Closed regedarek closed 11 years ago

regedarek commented 11 years ago

I am using tinymce in my app. I require it in application.js

//= require tinymce-jquery I moved my assets lately outside to few hostnames.

config.serve_static_assets = false
config.assets.compile = true
config.assets.digest = true
config.action_controller.asset_host = "http://assets%d.somehost.com"
config.assets.compress = false
config.assets.debug = false

After that my tinmce broke with error Domains, protocols and ports must match.

I guess I have to override at the top of filetiny_mce_popup.js:

document.domain = 'somehost.com';

I found few topics about that using google. But how will be the best way to do that since this file is in the gem?

regedarek commented 11 years ago

Right now I have to override tinymce-rails gem in https://github.com/spohlenz/tinymce-rails/blob/master/vendor/assets/javascripts/tinymce/tiny_mce_popup.js#L3

but this isnt best solution, and should be improved in the future.

spohlenz commented 11 years ago

I'd be curious to know if you have more success using TinyMCE 4.x, since they've improved the script loading across domains.