Yurik has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/327274 )
Change subject: Add Terms of Use link on static and dynamic maps ...................................................................... Add Terms of Use link on static and dynamic maps - Adding shorter attribution text for static maps - Adding link to Terms of Use for dynamic maps Bug: T151906 Bug: T151900 Change-Id: Id2f67dfa2886147be126ce50b104278eba8c037e --- M extension.json M i18n/en.json M i18n/qqq.json M modules/staticframe/staticframe.js M styles/control-attribution.less 5 files changed, 37 insertions(+), 12 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Kartographer refs/changes/74/327274/1 diff --git a/extension.json b/extension.json index 6b2729d..73935eb 100644 --- a/extension.json +++ b/extension.json @@ -300,6 +300,7 @@ "modules/staticframe/staticframe.js" ], "messages": [ + "kartographer-attribution-short", "kartographer-fullscreen-text" ], "targets": [ diff --git a/i18n/en.json b/i18n/en.json index ba868dd..016f501 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -14,9 +14,10 @@ "apihelp-query+mapdata-param-continue": "Use this parameter to continue iterating through results", "apihelp-query+mapdata-param-groups": "Pipe-separated groups to return data for", "apihelp-query+mapdata-param-limit": "Data for how many pages to return", - "kartographer-attribution": "Wikimedia maps | Map data © [https://www.openstreetmap.org/copyright OpenStreetMap contributors]", + "kartographer-attribution": "[https://wikimediafoundation.org/wiki/Maps_Terms_of_Use Wikimedia maps] | Map data © [https://www.openstreetmap.org/copyright OpenStreetMap contributors]", "kartographer-attribution-externaldata": "$1: $2", "kartographer-attribution-externaldata-query": "query", + "kartographer-attribution-short": "[https://wikimediafoundation.org/wiki/Maps_Terms_of_Use Wikimedia] | © [https://www.openstreetmap.org/copyright OpenStreetMap]", "kartographer-broken-category": "Pages with broken maps", "kartographer-broken-category-desc": "The page includes an invalid map usage", "kartographer-desc": "Allows maps to be added to the wiki pages", diff --git a/i18n/qqq.json b/i18n/qqq.json index 54569f2..2f6b323 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -18,9 +18,10 @@ "apihelp-query+mapdata-param-continue": "{{doc-apihelp-param|query+mapdata|continue}}", "apihelp-query+mapdata-param-groups": "{{doc-apihelp-param|query+mapdata|groups}}", "apihelp-query+mapdata-param-limit": "{{doc-apihelp-param|query+mapdata|limit}}", - "kartographer-attribution": "Attribution text shown at the bottom of the map. $1 is external data service (e.g. Wikidata), $2 is link to external data link (e.g. query)", - "kartographer-attribution-externaldata": "Formats external data layer attribution", + "kartographer-attribution": "Attribution text shown at the bottom of the map.", + "kartographer-attribution-externaldata": "Formats external data layer attribution: $1 is external data service (e.g. Wikidata), $2 is link to external data link (e.g. query).", "kartographer-attribution-externaldata-query": "Label for external data 'query'.\n{{Identical|Query}}", + "kartographer-attribution-short": "Shorter version of the attribution text shown at the bottom of the map, for static maps embedded in the article.", "kartographer-broken-category": "Name of the tracking category", "kartographer-broken-category-desc": "Description on [[Special:TrackingCategories]] for the {{msg-mw|kartographer-broken-category}} tracking category.", "kartographer-desc": "{{desc|name=Kartographer|url=https://www.mediawiki.org/wiki/Extension:Kartographer}}", diff --git a/modules/staticframe/staticframe.js b/modules/staticframe/staticframe.js index 09e55dc..ac36428 100644 --- a/modules/staticframe/staticframe.js +++ b/modules/staticframe/staticframe.js @@ -90,6 +90,11 @@ $div = $( '<div class="mw-kartographer-fullScreen"></div>' ).append( button.$element ); $container.append( $div ); + $container.append( + '<div class="mw-kartographer-attribution">' + + mw.message( 'kartographer-attribution-short' ).parse() + + '</div>' + ); } ); $container.attr( 'href', '#/map/' + index ); diff --git a/styles/control-attribution.less b/styles/control-attribution.less index a7f1af1..75e5233 100644 --- a/styles/control-attribution.less +++ b/styles/control-attribution.less @@ -1,23 +1,40 @@ /* == Attribution control == */ +@import '../lib/wmui-base.less'; + +.mw-kartographer-attribution { + background-color: rgba( 255, 255, 255, 0.5 ); + color: @color-base; + + position: absolute; + right: 0; + bottom: 0; + + margin: 0; + padding: 0 5px; + box-shadow: none; +} /** Override initial properties */ .leaflet-right.leaflet-bottom { .leaflet-control.leaflet-control-attribution { float: none; clear: none; - font-size: 10px; - font-family: sans-serif; - line-height: 1.6; - - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; } +} + +.mw-kartographer-attribution, +.leaflet-right.leaflet-bottom .leaflet-control.leaflet-control-attribution { + font-size: 10px; + font-family: sans-serif; + line-height: 1.6; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; /* Removes ellipsis on hover */ - .leaflet-control.leaflet-control-attribution:hover { - white-space: normal; + &:hover { overflow: hidden; text-overflow: clip; + white-space: normal; } } -- To view, visit https://gerrit.wikimedia.org/r/327274 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id2f67dfa2886147be126ce50b104278eba8c037e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Kartographer Gerrit-Branch: wmf/1.29.0-wmf.6 Gerrit-Owner: Yurik <yu...@wikimedia.org> Gerrit-Reviewer: JGirault <jgira...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits