Sha256: 748441917bed6cf7055de7f49861e9c4d00c581cb989f5cf955f07f2651fa00c

Contents?: true

Size: 728 Bytes

Versions: 54

Compression:

Stored size: 728 Bytes

Contents

<%-
  ext = File.extname(@filename).gsub(/\?\d+/, '')
  ext = (ext.blank? ? 'generic' : ext.gsub(/\./, ''))
-%>
<%= javascript_tag <<-EOF
var curInst = dojo.widget.Editor2Manager.getCurrentInstance();
linkNode = dojo.withGlobal(curInst.window, "getAncestorElement", dojo.html.selection, ['a']);

curInst.restoreSelection();

if (!linkNode) {
    var html = dojo.withGlobal(curInst.window, 'getSelectedHtml', dojo.html.selection);
} else {
    var html = linkNode.innerHTML;
    dojo.withGlobal(curInst.window, 'selectElement', dojo.html.selection, [linkNode]);
}

curInst.execCommand('inserthtml', '<a href=\"#{page_file_path(@pg, @filename)}\" class=\"file-#{ext}\" target=\"_blank\">'+html+'</a>');
cancelInsertFile();
EOF
%>

Version data entries

54 entries across 54 versions & 1 rubygems

Version Path
imagine_cms-5.2.4 app/views/manage/cms_pages/_create_file_link.html.erb
imagine_cms-5.2.3 app/views/manage/cms_pages/_create_file_link.html.erb
imagine_cms-5.2.2 app/views/manage/cms_pages/_create_file_link.html.erb
imagine_cms-5.2.1 app/views/manage/cms_pages/_create_file_link.html.erb
imagine_cms-5.2.0 app/views/manage/cms_pages/_create_file_link.html.erb
imagine_cms-4.2.4 app/views/management/cms/_create_file_link.html.erb
imagine_cms-4.1.4 app/views/management/cms/_create_file_link.html.erb
imagine_cms-4.2.3 app/views/management/cms/_create_file_link.html.erb
imagine_cms-4.2.2 app/views/management/cms/_create_file_link.html.erb
imagine_cms-4.2.1 app/views/management/cms/_create_file_link.html.erb
imagine_cms-4.2.0 app/views/management/cms/_create_file_link.html.erb
imagine_cms-4.1.3 app/views/management/cms/_create_file_link.html.erb
imagine_cms-4.1.2 app/views/management/cms/_create_file_link.html.erb
imagine_cms-4.1.1 app/views/management/cms/_create_file_link.html.erb
imagine_cms-4.1.0 app/views/management/cms/_create_file_link.html.erb
imagine_cms-4.0.1 app/views/management/cms/_create_file_link.html.erb
imagine_cms-4.0.0 app/views/management/cms/_create_file_link.html.erb
imagine_cms-3.0.33 app/views/management/cms/_create_file_link.html.erb
imagine_cms-3.0.32 app/views/management/cms/_create_file_link.html.erb
imagine_cms-3.0.31 app/views/management/cms/_create_file_link.html.erb