Changeset baa11d8 for apps


Ignore:
Timestamp:
Jun 26, 2018 7:11:53 PM (2 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
ef7b3e0
Parents:
2d24f213
Message:

Console: Move modified flags to new directory,
in prep for symlinking original flags dir to package
for package installs (ticket #2270)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • apps/routerconsole/jsp/flags.jsp

    r2d24f213 rbaa11d8  
    1212 *  flags.jsp?c=de&s=48 => icons/flags48x48/de.png
    1313 *  with headers set so the browser caches.
     14 *
     15 *  As of 0.9.36:
     16 *  All new and changed flags must go in the flags16x11/ dir,
     17 *  which will be checked first by flags.jsp.
     18 *  The flags/ dir is the original set from famfamfam,
     19 *  which may be symlinked in package installs.
     20 *
    1421 */
    1522String c = request.getParameter("c");
     
    1724    (c.length() == 2 || c.length() == 7) &&
    1825    c.replaceAll("[a-z0-9_]", "").length() == 0) {
    19     String flagSet = "flags";
     26    String flagSet = "flags16x11";
    2027    String s = request.getParameter("s");
    2128    if ("48".equals(s)) {
     
    2330    }
    2431    java.io.OutputStream cout = response.getOutputStream();
    25     String base = net.i2p.I2PAppContext.getGlobalContext().getBaseDir().getAbsolutePath();
    26     String file = "docs" + java.io.File.separatorChar + "icons" + java.io.File.separatorChar +
    27                   flagSet + java.io.File.separatorChar + c + ".png";
     32    String base = net.i2p.I2PAppContext.getGlobalContext().getBaseDir().getAbsolutePath() +
     33                  java.io.File.separatorChar +
     34                  "docs" + java.io.File.separatorChar + "icons";
     35    String file = flagSet + java.io.File.separatorChar + c + ".png";
    2836    java.io.File ffile = new java.io.File(base, file);
     37    if (!ffile.exists()) {
     38        // fallback to flags dir, which will be symlinked to /usr/share/flags/countries/16x11 for package builds
     39        file = "flags" + java.io.File.separatorChar + c + ".png";
     40        ffile = new java.io.File(base, file);
     41    }
    2942    long lastmod = ffile.lastModified();
    3043    if (lastmod > 0) {
Note: See TracChangeset for help on using the changeset viewer.