Ignore:
Timestamp:
2019-07-02T21:38:13+02:00 (5 years ago)
Author:
klumbumbus
Message:
  • see #josm12379 - add search for names with DuckDuckGo
  • fix #josm17648 - make rules for website, url, email and source more universal, i.e. allow prefixes and suffixes connected with : or _ on the key and allow values starting with www.
  • see #josm14433 - change wording to View Commons file
  • fix #josm15158 - make ref:bag work with 13-16 digit ids
File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/tag2link/resources/tag2link_sources.xml

    r35036 r35043  
    2121    <!-- Global -->
    2222
     23    <src name="Search">
     24        <rule>
     25            <condition k="^(.+(:|_))?name((:|_).+)?$" />
     26            <link name="Search on DuckDuckGo" href="https://duckduckgo.com/?q=%v%" />
     27        </rule>
     28    </src>
     29
    2330    <src name="Common">
    2431        <rule>
    25             <condition k="(contact:)?website" />
     32            <condition k="^(.+(:|_))?website((:|_).+)?$" v="^(http:|https:|www\.).*" />
    2633            <link name="View website" href="%v%" />
    2734        </rule>
    2835        <rule>
    29             <condition k="(.*:url|.*_url|^url$)" />
     36            <condition k="^(.+(:|_))?url((:|_).+)?$" v="^(http:|https:|www\.).*" />
    3037            <link name="View URL" href="%v%" />
    3138        </rule>
    3239        <rule>
    33             <condition k="(contact:)?email" v="[^@]+@[^@]+" />
     40            <condition k="^(.+(:|_))?email((:|_).+)?$" v="[^@]+@[^@]+" />
    3441            <link name="Send Email" href="mailto:%v%" />
    3542        </rule>
    3643        <rule>
    37             <condition k="source" v="(http:|https:).*"/>
     44            <condition k="^(.+(:|_))?source((:|_).+)?$" v="^(http:|https:|www\.).*"/>
    3845            <link name="View website" href="%v%" />
    3946        </rule>
    4047        <rule>
    41             <condition k="image" v="(http:|https:).*"/>
     48            <condition k="image" v="^(http:|https:|www\.).*"/>
    4249            <link name="View image" href="%v%" />
    4350        </rule>
     
    4855    </src>
    4956   
    50     <src name="Wikipedia">
     57    <src name="Wikimedia">
    5158        <rule>
    5259            <condition k="wikipedia(?::(\p{Lower}{2,}))?" v="(?:(\p{Lower}{2,}):)?(.*)" />
     
    6370        <rule>
    6471            <condition k="wikimedia_commons" v="File:.*"/>
    65             <link name="View Commons image" href="https://commons.wikimedia.org/wiki/%v%" />
     72            <link name="View Commons file" href="https://commons.wikimedia.org/wiki/%v%" />
    6673        </rule>
    6774        <rule>
     
    239246    <src name="BAG" country-code="NL">
    240247       <rule>
    241             <condition k="ref:bag" />
     248            <condition k="ref:bag" v="^[0-9]{16}$" />
     249            <link name="Open in BAG Viewer" href="https://bagviewer.kadaster.nl/lvbag/bag-viewer/index.html#?searchQuery=%v%" />
     250        </rule>
     251        <rule>
     252            <condition k="ref:bag" v="^[0-9]{15}$" />
    242253            <link name="Open in BAG Viewer" href="https://bagviewer.kadaster.nl/lvbag/bag-viewer/index.html#?searchQuery=0%v%" />
     254        </rule>
     255        <rule>
     256            <condition k="ref:bag" v="^[0-9]{14}$" />
     257            <link name="Open in BAG Viewer" href="https://bagviewer.kadaster.nl/lvbag/bag-viewer/index.html#?searchQuery=00%v%" />
     258        </rule>
     259        <rule>
     260            <condition k="ref:bag" v="^[0-9]{13}$" />
     261            <link name="Open in BAG Viewer" href="https://bagviewer.kadaster.nl/lvbag/bag-viewer/index.html#?searchQuery=000%v%" />
    243262        </rule>
    244263    </src>
Note: See TracChangeset for help on using the changeset viewer.