Inchikutty has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/96973


Change subject: Replacing 'show on map' button with a link having same 
functionality
......................................................................

Replacing 'show on map' button with a link having same functionality

This patch replaces 'show on map' button in UploadWizard with a link
having same functionality.The link when clicked will open entered input
coordinates on OpenStreetMap in a new tab.

Bug: 56614
Change-Id: If2ff1b2939c76cc76c602b72e98d78ba9d8b1aea
---
M UploadWizard.i18n.php
M UploadWizardHooks.php
M resources/mw.UploadWizardDetails.js
3 files changed, 6 insertions(+), 27 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard 
refs/changes/73/96973/1

diff --git a/UploadWizard.i18n.php b/UploadWizard.i18n.php
index 721b919..fa5b601 100644
--- a/UploadWizard.i18n.php
+++ b/UploadWizard.i18n.php
@@ -148,7 +148,7 @@
        'mwe-upwiz-media-type' => 'Media type',
        'mwe-upwiz-date-created' => 'Date created',
        'mwe-upwiz-location' => 'Location',
-       'mwe-upwiz-location-button' => 'Show on map',
+       'mwe-upwiz-location-map' => 'Show on map',
        'mwe-upwiz-location-lat' => 'Latitude',
        'mwe-upwiz-location-lon' => 'Longitude',
        'mwe-upwiz-location-alt' => 'Altitude',
@@ -806,7 +806,7 @@
 {{Identical|Date created}}',
        'mwe-upwiz-location' => 'The location the media exists on the planet, 
further described by lat and lon.
 {{Identical|Location}}',
-       'mwe-upwiz-location-button' => 'Label for button which opens location 
on OpenStreetMap using entered input coordinates.',
+       'mwe-upwiz-location-map' => 'Label for link which opens location on 
OpenStreetMap using entered input coordinates.',
        'mwe-upwiz-location-lat' => 'Latitude - the GPS coordinate, expressed 
in signed decimal degrees.
 {{Identical|Latitude}}',
        'mwe-upwiz-location-lon' => 'Longitude - the GPS coordinate, expressed 
in signed decimal degrees.
@@ -2618,7 +2618,6 @@
        'mwe-upwiz-media-type' => 'Triba de mediu',
        'mwe-upwiz-date-created' => 'Data de creación',
        'mwe-upwiz-location' => 'Allugamientu',
-       'mwe-upwiz-location-button' => 'Ver nel mapa',
        'mwe-upwiz-location-lat' => 'Llatitú',
        'mwe-upwiz-location-lon' => 'Llonxitú',
        'mwe-upwiz-location-alt' => 'Altitú',
@@ -6828,7 +6827,6 @@
        'mwe-upwiz-media-type' => 'Medientyp',
        'mwe-upwiz-date-created' => 'Erstellungdatum',
        'mwe-upwiz-location' => 'Standort',
-       'mwe-upwiz-location-button' => 'Auf Karte zeigen',
        'mwe-upwiz-location-lat' => 'Breitengrad',
        'mwe-upwiz-location-lon' => 'Längengrad',
        'mwe-upwiz-location-alt' => 'Höhe',
@@ -7301,7 +7299,6 @@
        'mwe-upwiz-media-type' => 'Babeta medya',
        'mwe-upwiz-date-created' => 'Demê vıraştışi',
        'mwe-upwiz-location' => 'Lokasyon',
-       'mwe-upwiz-location-button' => 'Ğeriter bıvin',
        'mwe-upwiz-location-lat' => 'Heralem',
        'mwe-upwiz-location-lon' => 'Lemen',
        'mwe-upwiz-location-alt' => 'berzî',
@@ -8544,7 +8541,6 @@
        'mwe-upwiz-media-type' => 'Tipo de medios',
        'mwe-upwiz-date-created' => 'Fecha de creación',
        'mwe-upwiz-location' => 'Ubicación',
-       'mwe-upwiz-location-button' => 'Mostrar en el mapa',
        'mwe-upwiz-location-lat' => 'Latitud',
        'mwe-upwiz-location-lon' => 'Longitud',
        'mwe-upwiz-location-alt' => 'Altitud',
@@ -8920,7 +8916,6 @@
        'mwe-upwiz-media-type' => 'Meediatüüp',
        'mwe-upwiz-date-created' => 'Valmistamiskuupäev',
        'mwe-upwiz-location' => 'Asukoht',
-       'mwe-upwiz-location-button' => 'Näita kaardil',
        'mwe-upwiz-location-lat' => 'Laiuskraad',
        'mwe-upwiz-location-lon' => 'Pikkuskraad',
        'mwe-upwiz-location-alt' => 'Kõrgus',
@@ -10359,7 +10354,6 @@
        'mwe-upwiz-media-type' => 'Type de média',
        'mwe-upwiz-date-created' => 'Date de création',
        'mwe-upwiz-location' => 'Emplacement',
-       'mwe-upwiz-location-button' => 'Afficher sur la carte',
        'mwe-upwiz-location-lat' => 'Latitude',
        'mwe-upwiz-location-lon' => 'Longitude',
        'mwe-upwiz-location-alt' => 'Altitude',
@@ -12186,7 +12180,6 @@
        'mwe-upwiz-media-type' => 'סוג המדיה',
        'mwe-upwiz-date-created' => 'תאריך היצירה',
        'mwe-upwiz-location' => 'מיקום',
-       'mwe-upwiz-location-button' => 'להציג על מפה',
        'mwe-upwiz-location-lat' => 'קו־רוחב',
        'mwe-upwiz-location-lon' => 'קו־אורך',
        'mwe-upwiz-location-alt' => 'גובה',
@@ -15025,7 +15018,6 @@
        'mwe-upwiz-media-type' => 'Tipo di supporto',
        'mwe-upwiz-date-created' => 'Data di creazione',
        'mwe-upwiz-location' => 'Luogo',
-       'mwe-upwiz-location-button' => 'Visualizza sulla mappa',
        'mwe-upwiz-location-lat' => 'Latitudine',
        'mwe-upwiz-location-lon' => 'Longitudine',
        'mwe-upwiz-location-alt' => 'Altitudine',
@@ -15423,7 +15415,6 @@
        'mwe-upwiz-media-type' => 'メディアの種類',
        'mwe-upwiz-date-created' => '作成日',
        'mwe-upwiz-location' => '場所',
-       'mwe-upwiz-location-button' => '地図上に表示',
        'mwe-upwiz-location-lat' => '緯度',
        'mwe-upwiz-location-lon' => '経度',
        'mwe-upwiz-location-alt' => '高度',
@@ -16804,7 +16795,6 @@
        'mwe-upwiz-media-type' => '미디어 종류',
        'mwe-upwiz-date-created' => '창작한 날짜',
        'mwe-upwiz-location' => '위치',
-       'mwe-upwiz-location-button' => '지도에 표시',
        'mwe-upwiz-location-lat' => '위도',
        'mwe-upwiz-location-lon' => '경도',
        'mwe-upwiz-location-alt' => '고도',
@@ -17643,7 +17633,6 @@
        'mwe-upwiz-media-type' => 'Medientyp',
        'mwe-upwiz-date-created' => 'Datum vun der Creatioun',
        'mwe-upwiz-location' => 'Plaz',
-       'mwe-upwiz-location-button' => 'Op der Kaart weisen',
        'mwe-upwiz-location-lat' => 'Geografesch Breet',
        'mwe-upwiz-location-lon' => 'Geografesch Längt',
        'mwe-upwiz-location-alt' => 'Héicht',
@@ -18973,7 +18962,6 @@
        'mwe-upwiz-media-type' => 'Тип на мултим. податотека',
        'mwe-upwiz-date-created' => 'Создадена на',
        'mwe-upwiz-location' => 'Место',
-       'mwe-upwiz-location-button' => 'Прикажи на карта',
        'mwe-upwiz-location-lat' => 'Г.Ш.',
        'mwe-upwiz-location-lon' => 'Г.Д.',
        'mwe-upwiz-location-alt' => 'Надм. височина',
@@ -19355,7 +19343,6 @@
        'mwe-upwiz-media-type' => 'മീഡിയ തരം',
        'mwe-upwiz-date-created' => 'സൃഷ്ടിച്ച തീയതി',
        'mwe-upwiz-location' => 'സ്ഥലം',
-       'mwe-upwiz-location-button' => 'ഭൂപടത്തിൽ പ്രദർശിപ്പിക്കുക',
        'mwe-upwiz-location-lat' => 'അക്ഷാംശം',
        'mwe-upwiz-location-lon' => 'രേഖാംശം',
        'mwe-upwiz-location-alt' => 'ഉന്നതി',
@@ -22951,7 +22938,6 @@
        'mwe-upwiz-media-type' => 'Sòrt ëd mojen',
        'mwe-upwiz-date-created' => 'Data ëd creassion',
        'mwe-upwiz-location' => 'Locassion',
-       'mwe-upwiz-location-button' => 'Mostré an sla carta',
        'mwe-upwiz-location-lat' => 'Latitùdin',
        'mwe-upwiz-location-lon' => 'Longitùdin',
        'mwe-upwiz-location-alt' => 'Autëssa',
@@ -25046,7 +25032,6 @@
        'mwe-upwiz-media-type' => 'Тип медиа',
        'mwe-upwiz-date-created' => 'Дата создания',
        'mwe-upwiz-location' => 'Местонахождение',
-       'mwe-upwiz-location-button' => 'Показать на карте',
        'mwe-upwiz-location-lat' => 'Широта',
        'mwe-upwiz-location-lon' => 'Долгота',
        'mwe-upwiz-location-alt' => 'Высота',
@@ -29894,7 +29879,6 @@
        'mwe-upwiz-media-type' => 'Тип медіа',
        'mwe-upwiz-date-created' => 'Дата створення',
        'mwe-upwiz-location' => 'Місцезнаходження',
-       'mwe-upwiz-location-button' => 'Показати на карті',
        'mwe-upwiz-location-lat' => 'Широта',
        'mwe-upwiz-location-lon' => 'Довгота',
        'mwe-upwiz-location-alt' => 'Висота',
@@ -30876,7 +30860,6 @@
        'mwe-upwiz-media-type' => 'Kiểu phương tiện',
        'mwe-upwiz-date-created' => 'Ngày tháng tạo',
        'mwe-upwiz-location' => 'Vị trí',
-       'mwe-upwiz-location-button' => 'Xem trên bản đồ',
        'mwe-upwiz-location-lat' => 'Vĩ độ',
        'mwe-upwiz-location-lon' => 'Kinh độ',
        'mwe-upwiz-location-alt' => 'Cao độ',
@@ -31624,7 +31607,6 @@
        'mwe-upwiz-media-type' => '媒体文件类型',
        'mwe-upwiz-date-created' => '创作日期',
        'mwe-upwiz-location' => '地点',
-       'mwe-upwiz-location-button' => '在地图上显示',
        'mwe-upwiz-location-lat' => '纬度',
        'mwe-upwiz-location-lon' => '经度',
        'mwe-upwiz-location-alt' => '海拔',
@@ -32010,7 +31992,6 @@
        'mwe-upwiz-media-type' => '媒體類型',
        'mwe-upwiz-date-created' => '建立日期',
        'mwe-upwiz-location' => '位置',
-       'mwe-upwiz-location-button' => '於地圖中顯示',
        'mwe-upwiz-location-lat' => '緯度',
        'mwe-upwiz-location-lon' => '經度',
        'mwe-upwiz-location-alt' => '海拔',
diff --git a/UploadWizardHooks.php b/UploadWizardHooks.php
index 9bda599..0d6d2cd 100644
--- a/UploadWizardHooks.php
+++ b/UploadWizardHooks.php
@@ -253,7 +253,7 @@
                                'mwe-upwiz-media-type',
                                'mwe-upwiz-date-created',
                                'mwe-upwiz-location',
-                               'mwe-upwiz-location-button',
+                               'mwe-upwiz-location-map',
                                'mwe-upwiz-location-lat',
                                'mwe-upwiz-location-lon',
                                'mwe-upwiz-location-alt',
diff --git a/resources/mw.UploadWizardDetails.js 
b/resources/mw.UploadWizardDetails.js
index 497b5e3..49fde88 100644
--- a/resources/mw.UploadWizardDetails.js
+++ b/resources/mw.UploadWizardDetails.js
@@ -170,16 +170,14 @@
        //      .append( $( '<div class="mwe-location-alt-label"></div>' 
).append( mw.message( 'mwe-upwiz-location-alt' ).text() ) )
        //      .append( _this.altInput );
 
-       var showMap = $( '<button>' ).prop( 'type', 'button' ).prop( 'size', 20 
)
-               .addClass( 'mwe-upwiz-buttons' )
-               .msg( 'mwe-upwiz-location-button' )
-               .button()
+       var showMap = $( '<a>' )
+               .msg( 'mwe-upwiz-location-map' )
                .click( function( ) {
                        var latd = _this.$latInput.val(),
                                lond = _this.$lonInput.val(),
                                mapLink = new mw.Uri( 
'https://openstreetmap.org/' )
                                        .extend( { zoom: 9, layers: 'M', lat: 
+latd, lon: +lond } );
-                       window.open( mapLink.toString() );
+                               $(this).attr( {'href' : mapLink.toString(), 
'target': '_blank' } );
                } );
 
        var locationDiv = $( '<div class="mwe-location 
mwe-upwiz-details-fieldname-input ui-helper-clearfix"></div>' )

-- 
To view, visit https://gerrit.wikimedia.org/r/96973
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If2ff1b2939c76cc76c602b72e98d78ba9d8b1aea
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: Inchikutty <inchikutt...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to