Sha256: 36d67335c5ccb55fb3a0345c9925c9e29a859f09099d49f10e01c776987bc6e1

Contents?: true

Size: 924 Bytes

Versions: 2

Compression:

Stored size: 924 Bytes

Contents

window['CKEDITOR_BASEPATH'] = "/assets/ckeditor/";

window.CKEDITOR_ASSETS_MAPPING = {
<% Rails.application.assets.each_logical_path( ->(path) {
  path =~ /ckeditor/ && path != 'ckeditor/override.js' && path != 'ckeditor/init.js' && path != 'ckeditor/ckeditor.js' && path.index('ckeditor/filebrowser').nil? && path.index('.md').nil? && path.index('.html').nil?
}) do |asset| %>
  "<%= asset %>": "<%= asset_path(asset) %>",
<% end %>
}

window.CKEDITOR_GETURL = function( resource ) {
  // If this is not a full or absolute path.
  if ( resource.indexOf( ':/' ) == -1 && resource.indexOf( '/' ) !== 0 )
    resource = this.basePath + resource;

  // Add the timestamp, except for directories.
  if ( resource.charAt( resource.length - 1 ) != '/'  ){
    var url = resource.match( /^(.*?:\/\/[^\/]*)\/assets\/(.+)/ );
    if(url) resource = (CKEDITOR_ASSETS_MAPPING[url[2]] || '/assets/' + url[2]);
  }

  return resource;
}

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
glebtv-ckeditor-4.4.3.0 app/assets/javascripts/ckeditor/override.js.erb
glebtv-ckeditor-4.3.2.6 app/assets/javascripts/ckeditor/override.js.erb