Changeset 718f73eb


Ignore:
Timestamp:
Jul 23, 2009 5:01:43 PM (11 years ago)
Author:
z3d <z3d@…>
Branches:
master
Children:
ca41537
Parents:
fb47eef
Message:

I2PSnark UI changes: add a splash of color! Fix for light i2ptunnels theme.

Files:
6 added
4 edited

Legend:

Unmodified
Added
Removed
  • apps/i2psnark/java/src/org/klomp/snark/SnarkManager.java

    rfb47eef r718f73eb  
    340340        if (_util.shouldUseOpenTrackers() != useOpenTrackers) {
    341341            _config.setProperty(I2PSnarkUtil.PROP_USE_OPENTRACKERS, useOpenTrackers + "");
    342             addMessage((useOpenTrackers ? "En" : "Dis") + "abled open trackers - torrent restart required to take effect");
     342            addMessage((useOpenTrackers ? "En" : "Dis") + "abled open trackers - torrent restart required to take effect.");
    343343            changed = true;
    344344        }
     
    346346            if (openTrackers.trim().length() > 0 && !openTrackers.trim().equals(_util.getOpenTrackerString())) {
    347347                _config.setProperty(I2PSnarkUtil.PROP_OPENTRACKERS, openTrackers.trim());
    348                 addMessage("Open Tracker list changed - torrent restart required to take effect");
     348                addMessage("Open Tracker list changed - torrent restart required to take effect.");
    349349                changed = true;
    350350            }
     
    353353            saveConfig();
    354354        } else {
    355             addMessage("Configuration unchanged");
     355            addMessage("Configuration unchanged.");
    356356        }
    357357    }
     
    363363            }
    364364        } catch (IOException ioe) {
    365             addMessage("Unable to save the config to '" + _configFile.getAbsolutePath() + "'");
     365            addMessage("Unable to save the config to '" + _configFile.getAbsolutePath() + "'.");
    366366        }
    367367    }
     
    384384            boolean ok = _util.connect();
    385385            if (!ok) {
    386                 addMessage("Error connecting to I2P - check your I2CP settings");
     386                addMessage("Error connecting to I2P - check your I2CP settings!");
    387387                return;
    388388            }
     
    447447        if (!dontAutoStart && shouldAutoStart()) {
    448448            torrent.startTorrent();
    449             addMessage("Torrent added and started: '" + f.getName() + "'");
     449            addMessage("Torrent added and started: '" + f.getName() + "'.");
    450450        } else {
    451             addMessage("Torrent added: '" + f.getName() + "'");
     451            addMessage("Torrent added: '" + f.getName() + "'.");
    452452        }
    453453    }
     
    545545        if ((!announce.startsWith("http://")) ||
    546546            (announce.indexOf(".i2p/") < 0)) // need to do better than this
    547             return "Non-i2p tracker in " + info.getName() + ", deleting it";
     547            return "Non-i2p tracker in " + info.getName() + ", removing it from our list of trackers!";
    548548        List files = info.getFiles();
    549549        if ( (files != null) && (files.size() > MAX_FILES_PER_TORRENT) ) {
    550             return "Too many files in " + info.getName() + " (" + files.size() + "), deleting it";
     550            return "Too many files in " + info.getName() + " (" + files.size() + "), deleting it!";
    551551        } else if (info.getPieces() <= 0) {
    552             return "No pieces in " + info.getName() + "?  deleting it";
     552            return "No pieces in " + info.getName() + "?  deleting it!";
    553553        } else if (info.getPieceLength(0) > Storage.MAX_PIECE_SIZE) {
    554554            return "Pieces are too large in " + info.getName() + " (" + DataHelper.formatSize(info.getPieceLength(0)) +
    555                    "B), deleting it";
     555                   "B), deleting it.";
    556556        } else if (info.getTotalLength() > Storage.MAX_TOTAL_SIZE) {
    557557            System.out.println("torrent info: " + info.toString());
     
    559559            if (lengths != null)
    560560                for (int i = 0; i < lengths.size(); i++)
    561                     System.out.println("File " + i + " is " + lengths.get(i) + " long");
     561                    System.out.println("File " + i + " is " + lengths.get(i) + " long.");
    562562           
    563563            return "Torrents larger than " + DataHelper.formatSize(Storage.MAX_TOTAL_SIZE) +
    564                    "B are not supported yet (because we're paranoid): " + info.getName() + ", deleting it";
     564                   "B are not supported yet (because we're paranoid): " + info.getName() + ", deleting it!";
    565565        } else {
    566566            // ok
     
    599599            }
    600600            if (!wasStopped)
    601                 addMessage("Torrent stopped: '" + sfile.getName() + "'");
     601                addMessage("Torrent stopped: '" + sfile.getName() + "'.");
    602602        }
    603603        return torrent;
     
    614614            if (torrent.storage != null)
    615615                removeTorrentStatus(torrent.storage.getMetaInfo());
    616             addMessage("Torrent removed: '" + torrentFile.getName() + "'");
     616            addMessage("Torrent removed: '" + torrentFile.getName() + "'.");
    617617        }
    618618    }
     
    647647        File f = new File(snark.torrent);
    648648        long len = snark.meta.getTotalLength();
    649         addMessage("Download complete of " + f.getName() + " (size: " + DataHelper.formatSize(len) + "B)");
     649        addMessage("Download finished: " + f.getName() + " (size: " + DataHelper.formatSize(len) + "B)");
    650650        updateStatus(snark);
    651651    }
     
    675675            } else {
    676676                if (shouldAutoStart() && !_util.connect())
    677                     addMessage("Unable to connect to I2P");
     677                    addMessage("Unable to connect to I2P!");
    678678                addTorrent((String)foundNames.get(i), !shouldAutoStart());
    679679            }
  • apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java

    rfb47eef r718f73eb  
    8484        out.write(HEADER);
    8585        out.write("</head><body>");
    86         out.write("<div class=\"page\"><table border=\"0\" width=\"100%\"><tr><td align=\"center\" class=\"snarkTitle\"><a href=\"" + req.getRequestURI() + peerString + "\" title=\"I2PSnark (Manual Page Refresh)\"><img src=\"/themes/console/images/i2psnark.png\" alt=\"I2PSnark Anonymous BitTorrent Client\" border=\"0\"></a><hr>");
    87         out.write("<a href=\"http://forum.i2p/viewforum.php?f=21\" class=\"snarkRefresh\">Forum</a>\n");
     86        out.write("<div class=\"page\"><table border=\"0\" width=\"100%\"><tr><td align=\"center\" class=\"snarkTitle\"><a href=\"" + req.getRequestURI() + peerString + "\" title=\"I2PSnark (Manual Page Refresh)\"><img src=\"/themes/console/images/i2psnark.png\" alt=\"I2PSnark Anonymous BitTorrent Client\" border=\"0\" class=\"snarklogo\"></a><br>");
     87        out.write("<a href=\"http://forum.i2p/viewforum.php?f=21\" class=\"snarkRefresh\" target=\"_blank\">Forum</a>\n");
    8888        Map trackers = _manager.getTrackers();
    8989        for (Iterator iter = trackers.entrySet().iterator(); iter.hasNext(); ) {
     
    9595                continue;
    9696            baseURL = baseURL.substring(e + 1);
    97             out.write("<a href=\"" + baseURL + "\" class=\"snarkRefresh\">" + name + "</a>");
     97            out.write("<a href=\"" + baseURL + "\" class=\"snarkRefresh\" target=\"_blank\">" + name + "</a>");
    9898        }
    9999        out.write("</table>\n");
    100         out.write("<div class=\"section\"><div class=\"snarkMessages\"><table><tr><td valign=\"top\" align=\"left\"><pre>");
     100        out.write("<div class=\"mainsection\"><div class=\"snarkMessages\"><table><tr><td valign=\"top\" align=\"left\"><pre>");
    101101        List msgs = _manager.getMessages();
    102102        for (int i = msgs.size()-1; i >= 0; i--) {
     
    354354            }
    355355        } else if ("StopAll".equals(action)) {
    356             _manager.addMessage("Stopping all torrents and closing the I2P tunnel");
     356            _manager.addMessage("Stopping all torrents and closing the I2P tunnel.");
    357357            List snarks = getSortedSnarks(req);
    358358            for (int i = 0; i < snarks.size(); i++) {
     
    363363            if (_manager.util().connected()) {
    364364                _manager.util().disconnect();
    365                 _manager.addMessage("I2P tunnel closed");
     365                _manager.addMessage("I2P tunnel closed.");
    366366            }
    367367        } else if ("StartAll".equals(action)) {
    368             _manager.addMessage("Opening the I2P tunnel and starting all torrents");
     368            _manager.addMessage("Opening the I2P tunnel and starting all torrents.");
    369369            List snarks = getSortedSnarks(req);
    370370            for (int i = 0; i < snarks.size(); i++) {
     
    511511                    continue;
    512512                baseURL = baseURL.substring(e + 1);
    513                 out.write("&nbsp;&nbsp;&nbsp;(<a href=\"" + baseURL + "details.php?dllist=1&filelist=1&info_hash=");
     513                out.write("&nbsp;&nbsp;&nbsp;[<a href=\"" + baseURL + "details.php?dllist=1&filelist=1&info_hash=");
    514514                out.write(TrackerClient.urlencode(snark.meta.getInfoHash()));
    515                 out.write("\" title=\"" + name + " Tracker\">Details</a>)");
     515                out.write("\" title=\"" + name + " Tracker\">Details</a>]");
    516516                break;
    517517            }
     
    653653        out.write("<form action=\"" + uri + "\" method=\"POST\">\n");
    654654        out.write("<input type=\"hidden\" name=\"nonce\" value=\"" + _nonce + "\" />\n");
    655         out.write("<div class=\"section\"><span class=\"snarkConfigTitle\">Add Torrent:</span><br />\n");
     655        out.write("<div class=\"addtorrentsection\"><span class=\"snarkConfigTitle\">Add Torrent:</span><br />\n");
    656656        out.write("From URL&nbsp;: <input type=\"text\" name=\"newURL\" size=\"80\" value=\"" + newURL + "\" /> \n");
    657657        // not supporting from file at the moment, since the file name passed isn't always absolute (so it may not resolve)
     
    669669            baseFile = "";
    670670       
    671         out.write("<div class=\"section\"><span class=\"snarkNewTorrent\">\n");
     671        out.write("<div class=\"newtorrentsection\"><span class=\"snarkNewTorrent\">\n");
    672672        // *not* enctype="multipart/form-data", so that the input type=file sends the filename, not the file
    673673        out.write("<form action=\"" + uri + "\" method=\"POST\">\n");
     
    705705       
    706706        out.write("<form action=\"" + uri + "\" method=\"POST\">\n");
    707         out.write("<div class=\"section\"><span class=\"snarkConfig\">\n");
     707        out.write("<div class=\"configsection\"><span class=\"snarkConfig\">\n");
    708708        out.write("<input type=\"hidden\" name=\"nonce\" value=\"" + _nonce + "\" />\n");
    709709        out.write("<span class=\"snarkConfigTitle\">Configuration:</span><br />\n");
  • installer/resources/themes/console/light/default.css

    rfb47eef r718f73eb  
    2727     float: left;
    2828     width: 120px;
    29      height: 28px;
     29     height: 24px;
    3030     font-weight: normal;
    3131     text-align: right;
     
    3535     box-sizing: border-box;
    3636     line-height: 120%;
     37     color: #427;
    3738}
    3839
     
    8586div.statusNotRunning {
    8687     float: left;
    87      width: 72px;
     88     width: 68px;
    8889     height: 24px;
    8990     overflow: hidden;
     
    9697div.statusRunning {
    9798   float: left;
    98      width: 72px;
     99     width: 68px;
    99100     height: 24px;
    100101     overflow: hidden;
     
    107108div.statusStarting {
    108109     float: left;
    109      width: 72px;
     110     width: 68px;
    110111     height: 24px;
    111112     overflow: hidden;
  • installer/resources/themes/console/snark.css

    rfb47eef r718f73eb  
    1313
    1414.snarkRefresh {
    15   font-size: 9pt;
    16 }
    17 
    18 .snarkRefresh {
    1915     border: 1px outset #001;
    2016     padding: 1px 10px;
    21      background: #ffb;
     17     background: #eef;
    2218     text-decoration: none;
    2319     border-radius: 4px;
     
    3228}
    3329
     30.snarkRefresh a:hover{
     31     border: 1px inset #001;
     32     padding: 1px 10px;
     33     background: #003;
     34     text-decoration: none;
     35     border-radius: 4px;
     36     -moz-border-radius: 4px;
     37     -khtml-border-radius: 4px;
     38     font-size: 9pt;
     39     font-weight: bold;
     40     margin: -10px 3px 0 3px;
     41     text-align: center;
     42     vertical-align: middle;
     43     text-transform: uppercase;
     44     color: #f60;
     45}
     46
    3447.snarkMessages {
    35   background-color: #fe9;
     48  background-color: #f83;
    3649  font-family: "Lucida Console", "DejaVu Sans Mono", Courier, mono !important;
    3750  font-size: 9pt;
     
    4053  margin: 0 0 15px 0;
    4154  border: 0px;
    42   padding: 5px;
     55  padding: 0px;
    4356  border-spacing: 0px;
    4457  -moz-border-radius: 4px;
     
    4861  text-align: center;
    4962  overflow-x: scroll;           
    50   background: #ddf url('../console/light/images/lightbluetile.png');
     63  background: #ddf url('../console/images/orangetile.png');
     64  color: #531;
     65  height: 64px;
    5166}
    5267
     
    5671  font-size: 8pt;
    5772  padding: 0;
     73  text-align: left !important;
     74  height: 8px;
    5875}
    5976
     
    6582        border-spacing: 0px;
    6683}
     84
    6785th {
    68         background-color: #f91;
    6986        padding: 5px;
    70   font-size: 9pt;
     87  font-size: 8pt;
    7188  border-top: 1px outset #001;
    7289  border-bottom: 1px inset #001; 
     90  background: #f91 url('.../console/images/tabletitleorangealt.png') repeat-x;
     91  text-align: center;
    7392}
    7493
     
    8099td {
    81100        padding: 5px;
     101  text-align: center;
    82102}
    83103.snarkTorrentEven {
    84104        background-color: #fb1;
    85   font-size: 8pt;
     105  font-size: 7pt;
    86106}
    87107.snarkTorrentOdd {
    88108        background-color: #fa1;
    89   font-size: 8pt;
     109  font-size: 7pt;
    90110}
    91111.snarkNewTorrent {
    92         font-size: 10pt;
     112        font-size: 9pt;
    93113}
    94114.snarkAddInfo {
    95         font-size: 10pt;
     115        font-size: 9pt;
    96116  line-height: 130% !important;
    97117}
     
    108128.page {
    109129        background-color: #fff;
    110         color:#001;
     130        color:#310;
    111131  margin: 20px;
    112132  padding: 10px 20px 5px 20px;
     
    119139  -moz-box-shadow: inset 0px 0px 1px 0px #002;
    120140  text-align: center;
    121   background: #ddf url('../console/light/images/sandtile.png');
     141  background: #ddf url('../console/light/images/lightbluetile.png');
    122142}
    123143
     
    139159  height: 1px;
    140160  border: 0px solid #003;
    141   margin: 5px 0;
    142 }
    143 
    144 div.section {
    145   margin: 0 0 20px 0;
    146   padding: 10px;
    147   background: #ffe;
    148   border: 1px solid #001;
    149   text-align: left;
    150   color: #001;
    151   -moz-border-radius: 4px;
    152   -khtml-border-radius: 4px;
    153   border-radius: 4px;
    154   -moz-box-shadow: inset 0px 0px 1px 0px #002;
    155   word-wrap: break-word;
     161  width: 100%;
     162  margin: 10px 0 7px 0;
    156163  text-align: center;
    157164}
    158165
    159166a:link{
    160      color: #830;
    161      text-decoration: none;
    162      font-weight: bold;
    163      word-wrap: break-word;
     167  color: #830;
     168  text-decoration: none;
     169  font-weight: bold;
     170  word-wrap: break-word;
    164171}
    165172
    166173a:visited{
    167      color: #606;
    168      text-decoration: none;
    169      font-weight: bold;
     174  color: #606;
     175  text-decoration: none;
     176  font-weight: bold;
    170177}
    171178
    172179a:hover{
    173      color: #f60;
    174      font-weight: bold;
     180  color: #f60;
     181  font-weight: bold;
    175182}
    176183
     
    189196  font-size: 9pt;
    190197}
    191 }
     198
     199img {
     200  border: none;
     201  margin: 5px 5px 10px 5px;
     202}
     203
     204
     205div.section {
     206  margin: 0 0 20px 0;
     207  padding: 10px;
     208  background: #ffe;
     209  border: 1px solid #001;
     210  text-align: center;
     211  color: #001;
     212  -moz-border-radius: 4px;
     213  -khtml-border-radius: 4px;
     214  border-radius: 4px;
     215  -moz-box-shadow: inset 0px 0px 1px 0px #002;
     216  word-wrap: break-word;
     217  text-align: center;
     218  background: #ffe url('../console/light/images/tabletile.png');
     219}
     220
     221div.mainsection {
     222  margin: 0 0 20px 0;
     223  padding: 10px;
     224  background: #ffe;
     225  border: 1px solid #001;
     226  text-align: center;
     227  color: #001;
     228  -moz-border-radius: 4px;
     229  -khtml-border-radius: 4px;
     230  border-radius: 4px;
     231  -moz-box-shadow: inset 0px 0px 1px 0px #002;
     232  word-wrap: break-word;
     233  text-align: center;
     234  background: #ffe url('../console/light/images/tabletile.png');
     235}
     236
     237div.newtorrentsection {
     238  margin: 0 0 20px 0;
     239  padding: 10px;
     240  background: #ffe;
     241  border: 1px solid #001;
     242  text-align: center;
     243  color: #001;
     244  -moz-border-radius: 4px;
     245  -khtml-border-radius: 4px;
     246  border-radius: 4px;
     247  -moz-box-shadow: inset 0px 0px 1px 0px #002;
     248  word-wrap: break-word;
     249  text-align: center;
     250  background: #ffe url('../console/images/yellowtile.png');
     251}
     252
     253div.addtorrentsection {
     254  margin: 0 0 20px 0;
     255  padding: 10px;
     256  background: #ffe;
     257  border: 1px solid #001;
     258  text-align: center;
     259  color: #001;
     260  -moz-border-radius: 4px;
     261  -khtml-border-radius: 4px;
     262  border-radius: 4px;
     263  -moz-box-shadow: inset 0px 0px 1px 0px #002;
     264  word-wrap: break-word;
     265  text-align: center;
     266  background: #ffe url('../console/images/greentile.png');
     267}
     268
     269div.configsection {
     270  margin: 0 0 20px 0;
     271  padding: 10px;
     272  background: #ffe;
     273  border: 1px solid #001;
     274  text-align: center;
     275  color: #fff;
     276  -moz-border-radius: 4px;
     277  -khtml-border-radius: 4px;
     278  border-radius: 4px;
     279  -moz-box-shadow: inset 0px 0px 1px 0px #002;
     280  word-wrap: break-word;
     281  text-align: center;
     282  background: #ffe url('../console/images/redtile.png');
     283}
Note: See TracChangeset for help on using the changeset viewer.