-
Notifications
You must be signed in to change notification settings - Fork 921
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
9,078 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
//= require src/jquery.uls.data | ||
//= require src/jquery.uls.data.utils | ||
//= require src/jquery.uls.lcd | ||
//= require src/jquery.uls.languagefilter | ||
//= require src/jquery.uls.core | ||
|
||
$(document).ready(function () { | ||
function updateLanguage(language) { | ||
Cookies.set("_osm_locale", language, { secure: true, path: "/", samesite: "lax" }); | ||
|
||
document.location.reload(); | ||
} | ||
|
||
var languages = $.uls.data.getAutonyms(); | ||
|
||
for (var code in languages) { | ||
if (!OSM.AVAILABLE_LOCALES.includes(code)) { | ||
delete languages[code]; | ||
} | ||
} | ||
|
||
$(".uls-trigger").uls({ | ||
onSelect: updateLanguage, | ||
languages: languages | ||
}); | ||
|
||
var application_data = $("head").data(); | ||
|
||
$(".uls-trigger").text(Cookies.get("_osm_locale") || application_data.locale); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
/* | ||
*= require ltr/common | ||
*= require uls | ||
*= require ltr/small | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
/* | ||
*= require rtl/common | ||
*= require uls | ||
*= require rtl/small | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
*= require css/jquery.uls | ||
*= require css/jquery.uls.grid | ||
*= require css/jquery.uls.lcd | ||
*/ | ||
|
||
.uls-menu { | ||
z-index: 100000; | ||
|
||
h1 { | ||
margin: 16px 0px; | ||
} | ||
|
||
.row { | ||
display: block; | ||
|
||
* { | ||
width: auto; | ||
max-width: none; | ||
} | ||
|
||
li { | ||
width: max-content; | ||
} | ||
} | ||
} | ||
|
||
.uls-trigger { | ||
cursor: pointer; | ||
background-image: image-url('images/language.png'); | ||
background-image: linear-gradient(transparent, transparent), image-url('images/language.svg'); | ||
} | ||
|
||
.uls-icon-close { | ||
background-image: image-url('images/close.png'); | ||
background-image: linear-gradient(transparent, transparent), image-url('images/close.svg'); | ||
} | ||
|
||
.uls-menu .uls-search-label { | ||
background-image: image-rl('images/search.png'); | ||
background-image: linear-gradient(transparent, transparent), image-url('images/search.svg'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
.uls-trigger { | ||
background: url( ../images/language.svg ) no-repeat left center; | ||
padding-left: 24px; | ||
} | ||
|
||
.uls-menu { | ||
position: absolute; | ||
z-index: 1000; | ||
display: none; | ||
margin-top: 1px; | ||
background-color: #fff; | ||
border: 1px solid #ccc; | ||
border-color: rgba( 0, 0, 0, 0.2 ); | ||
-webkit-box-shadow: 0 5px 10px rgba( 0, 0, 0, 0.2 ); | ||
-moz-box-shadow: 0 5px 10px rgba( 0, 0, 0, 0.2 ); | ||
box-shadow: 0 5px 10px rgba( 0, 0, 0, 0.2 ); | ||
-webkit-background-clip: padding-box; | ||
-moz-background-clip: padding; | ||
background-clip: padding-box; | ||
} | ||
|
||
.uls-wide { | ||
min-width: 715px; | ||
} | ||
|
||
.uls-medium { | ||
min-width: 360px; | ||
} | ||
|
||
/* Override the grid */ | ||
.uls-medium.grid .row { | ||
min-width: 300px; | ||
} | ||
|
||
.uls-narrow { | ||
min-width: 180px; | ||
} | ||
|
||
/* Override the grid */ | ||
.uls-narrow.grid .row { | ||
min-width: 150px; | ||
} | ||
|
||
.uls-search { | ||
background-color: #fff; | ||
padding: 5px 16px; | ||
border-bottom: 1px solid #ddd; | ||
} | ||
|
||
.grid .uls-search { | ||
padding-left: 0; | ||
} | ||
|
||
/* Make space for magnifying class on the front */ | ||
.uls-search-wrapper { | ||
position: relative; | ||
padding-left: 44px; | ||
margin-right: 5px; | ||
height: 32px; | ||
} | ||
|
||
.uls-search-label { | ||
background: url( ../images/search.svg ) no-repeat center center; | ||
background-size: 20px; | ||
height: 32px; | ||
width: 44px; | ||
display: block; | ||
position: absolute; | ||
left: 0; | ||
opacity: 0.5; | ||
} | ||
|
||
.uls-search-input-wrapper { | ||
position: relative; | ||
} | ||
|
||
/* There are two input boxes. This class applies to both of them */ | ||
.uls-filterinput { | ||
font-size: 1.143em; | ||
height: 32px; | ||
width: 100%; | ||
/* For the custom clear (X) icon */ | ||
padding: 6px 25px 6px 0; | ||
outline: 0; | ||
border: 0; | ||
display: block; | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
} | ||
|
||
/* This is the actual input */ | ||
.uls-languagefilter { | ||
background-color: transparent; | ||
border: 0; | ||
color: #222; | ||
} | ||
|
||
/* This is the shadow input box showing completion suggestions */ | ||
.uls-filtersuggestion { | ||
background-color: #fff; | ||
color: #777; | ||
} | ||
|
||
.uls-languagefilter-clear { | ||
background: url( ../images/close.svg ) no-repeat left center; | ||
background-size: 15px; | ||
cursor: pointer; | ||
height: 15px; | ||
width: 15px; | ||
opacity: 0.7; | ||
|
||
/* Vertical margins: (32 - 15) / 2 */ | ||
margin: 8.5px 5px; | ||
position: absolute; | ||
right: 0; | ||
/* Make it appear above the input boxes */ | ||
z-index: 1; | ||
} |
Oops, something went wrong.