Leidenfrost (talk | contribs) (?) |
Leidenfrost (talk | contribs) (ribbons?) |
||
Line 30: | Line 30: | ||
if(expeditionMatch !== null && (mw.config.get(['wgAction']).wgAction === "edit" || mw.config.get(['wgAction']).wgAction === "submit")){ | if(expeditionMatch !== null && (mw.config.get(['wgAction']).wgAction === "edit" || mw.config.get(['wgAction']).wgAction === "submit")){ | ||
var expeditionData = expeditionMatch[0].split("_") | var expeditionData = expeditionMatch[0].split("_") | ||
+ | var ribbonsTemplate = "{{land geohash|latitude=" + expeditionData[1] + "|longitude=" + expeditionData[2] + "|date=" + expeditionData[0] + "}}\n\{{Public transport geohash|latitude=" + expeditionData[1] + "|longitude=" + expeditionData[2] + "|date=" + expeditionData[0] + "| busline= }}" | ||
var meetupTemplate = "{{meetup graticule|date=" + expeditionData[0] + "|lat=" + expeditionData[1] + "|lon=" + expeditionData[2] + "|graticule_name=}}" | var meetupTemplate = "{{meetup graticule|date=" + expeditionData[0] + "|lat=" + expeditionData[1] + "|lon=" + expeditionData[2] + "|graticule_name=}}" | ||
− | var expeditionTemplate = meetupTemplate + "\n\ | + | var expeditionTemplate = meetupTemplate + ribbonsTemplate + "\n\ |
==Location==\n\ | ==Location==\n\ | ||
\n\ | \n\ |
Revision as of 16:07, 13 August 2022
// <includeonly> function waitForWikiEditor(){ if(typeof $("#wpTextbox1").wikiEditor === "function"){ $("#wpTextbox1").wikiEditor("addToToolbar", { section: "main", group: "insert", tools: { buttonId: { label: "Expedition template", type: "button", icon: "https://geohashing.site/images/thumb/4/4c/Landgeohash.png/22px-Landgeohash.png", action: { type: "encapsulate", options: { post: expeditionTemplate } } } } }); } else{ setTimeout(waitForWikiEditor, 250); } } var expeditionRegex = /\d{4}-\d{2}-\d{2}_-?\d{1,3}_-?\d{1,3}/ var expeditionMatch = location.toString().match(expeditionRegex) if(expeditionMatch !== null && (mw.config.get(['wgAction']).wgAction === "edit" || mw.config.get(['wgAction']).wgAction === "submit")){ var expeditionData = expeditionMatch[0].split("_") var ribbonsTemplate = "{{land geohash|latitude=" + expeditionData[1] + "|longitude=" + expeditionData[2] + "|date=" + expeditionData[0] + "}}\n\{{Public transport geohash|latitude=" + expeditionData[1] + "|longitude=" + expeditionData[2] + "|date=" + expeditionData[0] + "| busline= }}" var meetupTemplate = "{{meetup graticule|date=" + expeditionData[0] + "|lat=" + expeditionData[1] + "|lon=" + expeditionData[2] + "|graticule_name=}}" var expeditionTemplate = meetupTemplate + ribbonsTemplate + "\n\ ==Location==\n\ \n\ ==Participants==\n\ *[[User:Leidenfrost|Leidenfrost]]\n\ \n\ ==Expedition==\n\ \n\ ==Photos==\n\ <gallery>\n\ </gallery>\n\ \n\ ==Ribbons==\n\ {{#vardefine:ribbonwidth|100%}}\n\ {{land geohash|latitude= |longitude= |date=2022-}}\n\ {{Public transport geohash|latitude = |longitude = |date=2022-| busline= }}\n\ \n\ __NOTOC__\n\ <!--\n\ [[Category:Expeditions]]\n\ [[Category:Coordinates reached]]\n\ [[Category:Coordinates not reached]]\n\ [[Category:Not reached - No public access]]\n\ [[Category:Not reached - Mother Nature]]\n\ [[Category:Expeditions with photos]]-->\n\ {{location|DE}}\n\ "; $(document).ready(waitForWikiEditor); } // </includeonly>