Fossil

Check-in [6e0dd3ba]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Enhance the /artifact method so that the ln=M,N argument shows linenumbers and highlights lines between M and N.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:6e0dd3bab7c3cd6321319b4f1925bfc284c917a0
User & Date: drh 2011-02-18 19:31:31
Context
2011-02-18
21:47
Improved display of selected band in a text artifact. check-in: b9d46314 user: drh tags: trunk
19:31
Enhance the /artifact method so that the ln=M,N argument shows linenumbers and highlights lines between M and N. check-in: 6e0dd3ba user: drh tags: trunk
17:26
Only show the "Original Date" if its display time is different from the "Date". Ignore differences in milliseconds. check-in: 022a74a9 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/info.c.

1160
1161
1162
1163
1164
1165
1166












1167
1168
















1169












1170
1171
1172
1173
1174
1175
1176
    cgi_append_content(blob_buffer(&content), blob_size(&content));
    @ </div>
  }else{
    style_submenu_element("Hex","Hex", "%s/hexdump?name=%s", g.zTop, zUuid);
    zMime = mimetype_from_content(&content);
    @ <blockquote>
    if( zMime==0 ){












      @ <pre>
      @ %h(blob_str(&content))
















      @ </pre>












    }else if( strncmp(zMime, "image/", 6)==0 ){
      @ <img src="%s(g.zTop)/raw?name=%s(zUuid)&amp;m=%s(zMime)"></img>
    }else{
      @ <i>(file is %d(blob_size(&content)) bytes of binary data)</i>
    }
    @ </blockquote>
  }







>
>
>
>
>
>
>
>
>
>
>
>
|
<
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>







1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179

1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
    cgi_append_content(blob_buffer(&content), blob_size(&content));
    @ </div>
  }else{
    style_submenu_element("Hex","Hex", "%s/hexdump?name=%s", g.zTop, zUuid);
    zMime = mimetype_from_content(&content);
    @ <blockquote>
    if( zMime==0 ){
      const char *zLn = P("ln");
      const char *z = blob_str(&content);
      if( zLn ){
        int iStart, iEnd;
        int n = 0;
        int i;
        iStart = iEnd = atoi(zLn);
        if( iStart>0 ){
          for(i=0; zLn[i] && zLn[i]!=','; i++){}
          if( zLn[i] ) iEnd = atoi(&zLn[i+1]);
          if( iEnd<iStart ) iEnd = iStart;
        }
        @ <pre>

        while( z[0] ){
          n++;
          for(i=0; z[i] && z[i]!='\n'; i++){}
          if( n==iStart ) cgi_append_content("<b id=\"dln\">", -1);
          cgi_printf("%06d  ", n);
          if( i>0 ){
            char *zHtml = htmlize(z, i);
            cgi_append_content(zHtml, -1);
            fossil_free(zHtml);
          }
          if( n==iEnd ) cgi_append_content("</b>", -1);
          cgi_append_content("\n", 1);
          z += i;
          if( z[0]=='\n' ) z++;
        }
        if( n<iEnd ) cgi_printf("</b>");
        @ </pre>
        if( iStart ){
          @ <script type="text/JavaScript">
          @ /* <![CDATA[ */
          @ document.getElementById('dln').scrollIntoView(true);
          @ /* ]]> */
          @ </script>
        }
      }else{
        @ <pre>
        @ %h(z);
        @ </pre>
      }
    }else if( strncmp(zMime, "image/", 6)==0 ){
      @ <img src="%s(g.zTop)/raw?name=%s(zUuid)&amp;m=%s(zMime)"></img>
    }else{
      @ <i>(file is %d(blob_size(&content)) bytes of binary data)</i>
    }
    @ </blockquote>
  }