Changeset 1480 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2009-03-10T17:07:46+01:00 (16 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/AboutAction.java
r1326 r1480 17 17 import java.util.regex.Matcher; 18 18 import java.util.regex.Pattern; 19 import java.util.Properties; 19 20 20 21 import javax.swing.BorderFactory; … … 84 85 static public String getTextBlock() { 85 86 return revision.getText(); 87 } 88 89 static public void setUserAgent() { 90 Properties sysProp = System.getProperties(); 91 sysProp.put("http.agent", "JOSM/1.5 ("+version+")"); 92 System.setProperties(sysProp); 86 93 } 87 94 -
trunk/src/org/openstreetmap/josm/data/Preferences.java
r1473 r1480 522 522 523 523 private void setSystemProperties() { 524 Properties sysProp = System.getProperties();525 524 if (getBoolean(ProxyPreferences.PROXY_ENABLE)) { 525 Properties sysProp = System.getProperties(); 526 526 sysProp.put("proxySet", "true"); 527 527 sysProp.put("http.proxyHost", get(ProxyPreferences.PROXY_HOST)); … … 531 531 sysProp.put("proxyPassword", get(ProxyPreferences.PROXY_PASS)); 532 532 } 533 }/* else { 534 sysProp.put("proxySet", "false"); 535 sysProp.remove("http.proxyHost"); 536 sysProp.remove("proxyPort"); 537 sysProp.remove("proxyUser"); 538 sysProp.remove("proxyPassword"); 539 }*/ 540 System.setProperties(sysProp); 533 System.setProperties(sysProp); 534 } 535 AboutAction.setUserAgent(); 541 536 } 542 537 } -
trunk/src/org/openstreetmap/josm/gui/GettingStarted.java
r1450 r1480 274 274 curVersion, latest, myVersion) 275 275 + "</div>"; 276 } catch(Exception e) {e.printStackTrace();} 276 } catch(Exception e) { 277 // e.printStackTrace(); 278 } 277 279 278 280 return ""; -
trunk/src/org/openstreetmap/josm/tools/WikiReader.java
r1475 r1480 14 14 public class WikiReader { 15 15 16 public static final String JOSM_EXTERN = "http://josm-extern.";17 16 private final String baseurl; 18 17 … … 38 37 39 38 private String readNormal(BufferedReader in) throws IOException { 40 String b = " <html>";39 String b = ""; 41 40 for (String line = in.readLine(); line != null; line = in.readLine()) { 42 line = adjustText(line);43 41 if(!line.contains("[[TranslatedPages]]")) 44 b += line+ "\n";42 b += line.replaceAll(" />", ">") + "\n"; 45 43 } 46 return b;44 return "<html>" + b + "</html>"; 47 45 } 48 46 49 47 private String readFromTrac(BufferedReader in, String url) throws IOException { 50 48 boolean inside = false; 51 String Builder b = new StringBuilder("<html>");49 String b = ""; 52 50 for (String line = in.readLine(); line != null; line = in.readLine()) { 53 51 if (line.contains("<div id=\"searchable\">")) … … 58 56 inside = false; 59 57 if (inside) { 60 line = line.replaceAll("<img src=\"/", "<img src=\""+baseurl+"/"); 61 line = line.replaceAll("href=\"/", "href=\""+baseurl+"/"); 62 if (!line.contains("$")) 63 line = line.replaceAll("<p>Describe \"([^\"]+)\" here</p>", "<p>Describe \"$1\" <a href=\""+JOSM_EXTERN+url.substring(7)+"\">here</a></p>"); 64 line = adjustText(line); 65 b.append(line); 66 b.append("\n"); 58 b += line.replaceAll("<img src=\"/", "<img src=\""+baseurl+"/") 59 .replaceAll("href=\"/", "href=\""+baseurl+"/") 60 .replaceAll(" />", ">") + "\n"; 67 61 } 68 62 } 69 b.append("</html>"); 70 return b.toString(); 71 } 72 73 private String adjustText(String text) { 74 text = text.replaceAll(" />", ">"); 75 return text; 63 return "<html>" + b + "</html>"; 76 64 } 77 65 }
Note:
See TracChangeset
for help on using the changeset viewer.