<commit_before><% asset = content_blob.asset
   button_style ||= false
   if Seek::Util.inline_viewable_content_types.include?(asset.class) %>
    <%# those libs have been loaded for Model %>
    <% unless asset.is_a?(Model) %>
        <%= javascript_include_tag "zoom/lightbox" %>
        <%= stylesheet_link_tag "lightbox" %>
    <% end %>

    <% is_inline_viewable = content_blob.is_content_viewable? %>

    <%
       li_start = ""
       li_end = ""
       label = ""
       if button_style
         li_start = "<li>"
         li_end = "</li>"
         label = "View content"
       end
    %>
        <%= li_start.html_safe %>
    <% if is_inline_viewable %>
        <% if content_blob.is_image? %>
            <%
               image_width = content_blob.width.to_i
               #zoom to larger image
               zoom_width=image_width < Seek::ActsAsFleximageExtension::STANDARD_SIZE ? Seek::ActsAsFleximageExtension::STANDARD_SIZE : image_width
               zoom_width=zoom_width > Seek::ActsAsFleximageExtension::MAX_SIZE ? Seek::ActsAsFleximageExtension::MAX_SIZE : zoom_width
               zoom_width = (zoom_width == image_width) ? nil : zoom_width
            %>
            <%#param code is used for temporary link %>
            <% download_url = polymorphic_path([asset, content_blob], :action => 'download', :disposition => 'inline', :code => params[:code], :image_size => zoom_width) %>
            <%= image_tag_for_key "show", download_url, 'View content', {:rel => "lightbox"}, label %>
        <% else %>
            <%#param code is used for temporary link %>
            <% view_pdf_content_url = polymorphic_path([asset, content_blob], :action => 'view_pdf_content', :code => params[:code]) %>
            <%= image_tag_for_key "show", view_pdf_content_url, 'View content', {:onclick => "checkSupportedBrowser();", :title => 'View inline content this file'}, label %>
        <% end %>

     <% elsif !asset.is_a?(Model) && asset.is_downloadable_asset? %>
           <% explanation = "Your #{asset.class.name} is unable to be viewed in browser. " +
                "Supported file formats are: " +  (Seek::ContentTypeDetection::PDF_CONVERTABLE_FORMAT + ["pdf"]).join(" , ") +
               "; Supported image formats are: " + Seek::ContentTypeDetection::IMAGE_VIEWABLE_FORMAT.join(" , ") %>
        <span class='disabled_icon disabled' onclick='javascript:alert("<%=explanation%>")' title='<%= tooltip_title_attrib(explanation) %>' > <%=  image('show', {:alt=>"View Content",:class=>"disabled"}) %>  View Content </span>
    <% end %>
    <%= li_end.html_safe %>
<% end %>

<script type="text/javascript">
    function checkSupportedBrowser(){
        if (!isCanvasSupportBrowser() || !isIEVersionSupported(5)){
            alert('View inline content of this item is not supported in this browser version. Please upgrade your browser.');
        }
    }
</script><commit_msg>fix to text for view content button<commit_after><% asset = content_blob.asset
   button_style ||= false
   if Seek::Util.inline_viewable_content_types.include?(asset.class) %>
    <%# those libs have been loaded for Model %>
    <% unless asset.is_a?(Model) %>
        <%= javascript_include_tag "zoom/lightbox" %>
        <%= stylesheet_link_tag "lightbox" %>
    <% end %>

    <% is_inline_viewable = content_blob.is_content_viewable? %>

    <%
       li_start = ""
       li_end = ""
       label = ""
       if button_style
         li_start = "<li>"
         li_end = "</li>"
         label = "View content"
       end
    %>
        <%= li_start.html_safe %>
    <% if is_inline_viewable %>
        <% if content_blob.is_image? %>
            <%
               image_width = content_blob.width.to_i
               #zoom to larger image
               zoom_width=image_width < Seek::ActsAsFleximageExtension::STANDARD_SIZE ? Seek::ActsAsFleximageExtension::STANDARD_SIZE : image_width
               zoom_width=zoom_width > Seek::ActsAsFleximageExtension::MAX_SIZE ? Seek::ActsAsFleximageExtension::MAX_SIZE : zoom_width
               zoom_width = (zoom_width == image_width) ? nil : zoom_width
            %>
            <%#param code is used for temporary link %>
            <% download_url = polymorphic_path([asset, content_blob], :action => 'download', :disposition => 'inline', :code => params[:code], :image_size => zoom_width) %>
            <%= image_tag_for_key "show", download_url, 'View content', {:rel => "lightbox"}, label %>
        <% else %>
            <%#param code is used for temporary link %>
            <% view_pdf_content_url = polymorphic_path([asset, content_blob], :action => 'view_pdf_content', :code => params[:code]) %>
            <%= image_tag_for_key "show", view_pdf_content_url, 'View content', {:onclick => "checkSupportedBrowser();", :title => 'View inline content this file'}, label %>
        <% end %>

     <% elsif !asset.is_a?(Model) && !asset.contains_extractable_spreadsheet? && asset.is_downloadable_asset? %>
           <% explanation = "Your #{text_for_resource(asset)} is unable to be viewed in browser. " +
                "Supported file formats are: " +  (Seek::ContentTypeDetection::PDF_CONVERTABLE_FORMAT + ["pdf"]).join(" , ") +
               "; Supported image formats are: " + Seek::ContentTypeDetection::IMAGE_VIEWABLE_FORMAT.join(" , ") %>
        <span class='disabled_icon disabled' onclick='javascript:alert("<%=explanation%>")' title='<%= tooltip_title_attrib(explanation) %>' > <%=  image('show', {:alt=>"View Content",:class=>"disabled"}) %>  View Content </span>
    <% end %>
    <%= li_end.html_safe %>
<% end %>

<script type="text/javascript">
    function checkSupportedBrowser(){
        if (!isCanvasSupportBrowser() || !isIEVersionSupported(5)){
            alert('View inline content of this item is not supported in this browser version. Please upgrade your browser.');
        }
    }
</script>
{'fraction_non_alphanumeric': 0.14608076009501186, 'fraction_numerical': 0.00033932813030200206, 'mean_word_length': 3.026639344262295, 'pattern_counts': {'":': 0, '<': 73, '<?xml version=': 0, '>': 95, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '236289', 'n_tokens_mistral': 1843, 'n_tokens_neox': 1703, 'n_words': 366}