Changeset 26936 in osm
- Timestamp:
- 2011-10-23T02:31:31+02:00 (13 years ago)
- Location:
- applications/editors/josm/plugins/tag2link
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/tag2link/resources/tag2link_sources.xml
r26934 r26936 30 30 <link name="View URL" href="%v%" /> 31 31 </rule> 32 <rule> 33 <condition k="email" v="[^@]+@[^@]+" /> 34 <link name="Send Email" href="mailto:%v%" /> 35 </rule> 36 <rule> 37 <condition k="contact:email" v="[^@]+@[^@]+" /> 38 <link name="Send Email" href="mailto:%v%" /> 39 </rule> 32 40 </source> 33 41 34 42 <source name="Wikipedia"> 35 43 <rule> 36 <condition k="wikipedia(?::( [\p{Lower}]{2,}))?" v="(?:([\p{Lower}]{2,}):)?(.*)" />44 <condition k="wikipedia(?::(\p{Lower}{2,}))?" v="(?:(\p{Lower}{2,}):)?(.*)" /> 37 45 <link name="View %name% article" href="http://%k.1:v.1:en%.wikipedia.org/wiki/%v.2:v.1%" /> 46 </rule> 47 </source> 48 49 <source name="WHC"> 50 <rule> 51 <condition k="ref:whc" v="\p{Digit}+" /> 52 <link name="View UNESCO sheet" href="http://whc.unesco.org/%lang(en,fr):en%/list/%v%" /> 38 53 </rule> 39 54 </source> -
applications/editors/josm/plugins/tag2link/src/org/openstreetmap/josm/plugins/tag2link/Tag2LinkPlugin.java
r26934 r26936 26 26 27 27 /** 28 * Main class of tag2link splugin.28 * Main class of tag2link plugin. 29 29 * @author Don-vip 30 * @version 0. 1b30 * @version 0.2a 31 31 * History: 32 * 0.2a 23-Oct-2011 add Mail support + initial work on UNESCO WHC 32 33 * 0.1c 23-Oct-2011 add MHS rule (French heritage) 33 34 * 0.1b 22-Oct-2011 add CEF rule (French christian churches) -
applications/editors/josm/plugins/tag2link/src/org/openstreetmap/josm/plugins/tag2link/Tag2LinkRuleChecker.java
r26922 r26936 74 74 } 75 75 } 76 if (val == null) { 77 Matcher lm = Pattern.compile("lang(?:\\(\\p{Lower}{2,}(?:,\\p{Lower}{2,})*\\))?(?::(\\p{Lower}{2,}))?").matcher(arg); 78 if (lm.matches()) { 79 if (lm.groupCount() == 0) { 80 // TODO: get JOSM current language 81 } else { 82 // TODO: parse next groups 83 } 84 } 85 } 76 86 if (val != null) { 77 87 try { -
applications/editors/josm/plugins/tag2link/src/org/openstreetmap/josm/plugins/tag2link/action/OpenLinkAction.java
r26921 r26936 3 3 import static org.openstreetmap.josm.tools.I18n.tr; 4 4 5 import java.awt.Desktop; 5 6 import java.awt.event.ActionEvent; 7 import java.net.URI; 6 8 7 9 import org.openstreetmap.josm.actions.JosmAction; … … 22 24 @Override 23 25 public void actionPerformed(ActionEvent e) { 26 if (url.matches("mailto:.*")) { 27 if (Desktop.isDesktopSupported()) { 28 try { 29 System.out.println("Sending "+url); 30 Desktop.getDesktop().mail(new URI(url)); 31 } catch (Exception ex) { 32 ex.printStackTrace(); 33 } 34 } 35 } 24 36 System.out.println("Opening "+url); 25 37 OpenBrowser.displayUrl(url);
Note:
See TracChangeset
for help on using the changeset viewer.