Commit 0d818a02 authored by Luc Didry's avatar Luc Didry

Replace Language menu by icon

parent 1c4e8ab9
Pipeline #34011 failed with stages
in 13 seconds
{
"name": "",
"css_prefix_text": "icon-",
"css_use_suffix": false,
"hinting": true,
"units_per_em": 1000,
"ascent": 850,
"glyphs": [
{
"uid": "f0eac0958921fe45b85d01b79d76e86b",
"css": "switch",
"code": 59392,
"src": "entypo"
},
{
"uid": "ddecf5ad7935e3fb1b70dac6ed00d06a",
"css": "language",
"code": 59393,
"src": "entypo"
}
]
}
\ No newline at end of file
This diff is collapsed.
......@@ -50,7 +50,7 @@
</div>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="i18n-dpdn" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Language</a>
<a class="nav-link dropdown-toggle" href="#" id="i18n-dpdn" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><i class="icon-language" aria-hidden=true" title="Language"></i></a>
<div class="dropdown-menu" aria-labelledby="i18n-dpdn">
<a class="dropdown-item active" href="#" data-i18n="en">English</a>
<a class="dropdown-item" href="#" data-i18n="fr">Français</a>
......
......@@ -165,7 +165,7 @@ function translate(userLang, languages) {
$('option[value="'+e+'"]').text(locale[e]);
}
});
['donate-dpdn', 'i18n-dpdn', 'settings-dpdn', 'toggle-svg', 'download', 'reset', 'switch-colors',
['donate-dpdn', 'settings-dpdn', 'toggle-svg', 'download', 'reset', 'switch-colors',
'make-text-center', 'print', 'save', 'import', 'export'
].forEach(function(e) {
if (locale[e] !== undefined) {
......@@ -175,6 +175,9 @@ function translate(userLang, languages) {
$('#'+e).text(locale[e]);
}
});
if (locale['i18n-dpdn'] !== undefined) {
$('#i18n-dpdn i').attr('title', locale['i18n-dpdn']);
}
if (locale['import-n-export'] !== undefined) {
$('#import-n-export').attr('title', locale['import-n-export']);
}
......
......@@ -7,7 +7,7 @@ void 0!==a&&null!==a&&e.push(a)
for(var t=navigator.languages,r=0;r<t.length;r++)e.push(t[r])
if(0!==e.length)translate(e.shift(),e)
else{console.log("Using old style language detection.")
translate(navigator.language||navigator.userLanguage)}}function translate(e,a){$.get({url:"locales/"+e+".json",dataType:"json",error:function(){void 0!==a&&null!==a&&0!==a.length&&translate(a.shift(),a)},success:function(a){if(toggleI18n(e),"groot"===e&&($("#wemake").val("I am"),$("#porn").val("Groot"),$("#bg-type").val("img"),$("#bg-img").val("bark"),$("#wemake-color").val("#ffffff"),$("#porn-color").val("#ffffff"),$("#rect-color").val("#ffffff"),toggleBgSettings(),refreshFilename(),refreshText()),["get-source","donate-dpdn","license","author","wemake","porn","border-txt","color","transparency","x-position","y-position","font","style","text-size","text-width","outline-color","outline-size"].forEach(function(e){void 0!==a[e]&&$("."+e).text(a[e])}),["hide-settings","set-corner-shape","set-colors","set-fonts","set-bg","set-positions","set-img-size","gallery"].forEach(function(e){void 0!==a[e]&&$('[data-setting="'+e+'"]').text(a[e])}),["wemake","porn","filename","corners","bg-type","bgu-color","bgr-color","egr-color","gr-orientation","bg-img","custom-img","custom-x","custom-y","custom-size","border-thickness","img-width","img-height","custom-img-url","rick-size","rick-x","rick-y","rick-rad"].forEach(function(e){void 0!==a[e]&&$('label[for="'+e+'"]').text(a[e])}),void 0!==a["corners-rounded"]&&$('#corners option[value="20"]').text(a["corners-rounded"]),void 0!==a["corners-square"]&&$('#corners option[value="0"]').text(a["corners-square"]),void 0!==a["add-glitter"]&&$(".glitter span").text(a["add-glitter"]),["plain","gradient","rainbow","img","lr","rl","tb","bt","r","beer","glitter","rainbow-flag","sky","field","bridge","regular","bold","italic","italic bold","bark","snow","whale"].forEach(function(e){void 0!==a[e]&&$('option[value="'+e+'"]').text(a[e])}),["donate-dpdn","i18n-dpdn","settings-dpdn","toggle-svg","download","reset","switch-colors","make-text-center","print","save","import","export"].forEach(function(e){void 0!==a[e]&&("download"===e&&(download=a[e]),$("#"+e).text(a[e]))}),void 0!==a["import-n-export"]&&$("#import-n-export").attr("title",a["import-n-export"]),void 0!==a["toggle-canvas"]&&(workCanvas=a["toggle-canvas"]),void 0!==a["toggle-svg"]&&(workSvg=a["toggle-svg"]),void 0!==a["sorry-no-gallery"]&&(sorryNoGallery=a["sorry-no-gallery"]),void 0!==a.load&&(load=a.load),void 0!==a.delete&&(deleteText=a.delete),void 0!==a["custom-img-text"]){customImgText=a["custom-img-text"]
translate(navigator.language||navigator.userLanguage)}}function translate(e,a){$.get({url:"locales/"+e+".json",dataType:"json",error:function(){void 0!==a&&null!==a&&0!==a.length&&translate(a.shift(),a)},success:function(a){if(toggleI18n(e),"groot"===e&&($("#wemake").val("I am"),$("#porn").val("Groot"),$("#bg-type").val("img"),$("#bg-img").val("bark"),$("#wemake-color").val("#ffffff"),$("#porn-color").val("#ffffff"),$("#rect-color").val("#ffffff"),toggleBgSettings(),refreshFilename(),refreshText()),["get-source","donate-dpdn","license","author","wemake","porn","border-txt","color","transparency","x-position","y-position","font","style","text-size","text-width","outline-color","outline-size"].forEach(function(e){void 0!==a[e]&&$("."+e).text(a[e])}),["hide-settings","set-corner-shape","set-colors","set-fonts","set-bg","set-positions","set-img-size","gallery"].forEach(function(e){void 0!==a[e]&&$('[data-setting="'+e+'"]').text(a[e])}),["wemake","porn","filename","corners","bg-type","bgu-color","bgr-color","egr-color","gr-orientation","bg-img","custom-img","custom-x","custom-y","custom-size","border-thickness","img-width","img-height","custom-img-url","rick-size","rick-x","rick-y","rick-rad"].forEach(function(e){void 0!==a[e]&&$('label[for="'+e+'"]').text(a[e])}),void 0!==a["corners-rounded"]&&$('#corners option[value="20"]').text(a["corners-rounded"]),void 0!==a["corners-square"]&&$('#corners option[value="0"]').text(a["corners-square"]),void 0!==a["add-glitter"]&&$(".glitter span").text(a["add-glitter"]),["plain","gradient","rainbow","img","lr","rl","tb","bt","r","beer","glitter","rainbow-flag","sky","field","bridge","regular","bold","italic","italic bold","bark","snow","whale"].forEach(function(e){void 0!==a[e]&&$('option[value="'+e+'"]').text(a[e])}),["donate-dpdn","settings-dpdn","toggle-svg","download","reset","switch-colors","make-text-center","print","save","import","export"].forEach(function(e){void 0!==a[e]&&("download"===e&&(download=a[e]),$("#"+e).text(a[e]))}),void 0!==a["i18n-dpdn"]&&$("#i18n-dpdn i").attr("title",a["i18n-dpdn"]),void 0!==a["import-n-export"]&&$("#import-n-export").attr("title",a["import-n-export"]),void 0!==a["toggle-canvas"]&&(workCanvas=a["toggle-canvas"]),void 0!==a["toggle-svg"]&&(workSvg=a["toggle-svg"]),void 0!==a["sorry-no-gallery"]&&(sorryNoGallery=a["sorry-no-gallery"]),void 0!==a.load&&(load=a.load),void 0!==a.delete&&(deleteText=a.delete),void 0!==a["custom-img-text"]){customImgText=a["custom-img-text"]
var t=$('option[value="custom"]')
0!==t.length&&t.text(customImgText)}void 0!==a["import-ok"]&&(importOk=a["import-ok"]),void 0!==a["download-clic"]&&(downloadClic=a["download-clic"]),void 0!==a["add-rick"]&&$(".rick span").text(a["add-rick"])}})}function getParameters(){window.location.hash&&$("#porn").val(decodeURIComponent(window.location.hash.substr(1)))
var e=new URL(window.location)
......@@ -104,7 +104,7 @@ var o="; expires="+r.toGMTString()}else var o=""
document.cookie=e+"="+a+o+"; path=/"}function readCookie(e){for(var a=e+"=",t=document.cookie.split(";"),r=0;r<t.length;r++){for(var o=t[r];" "==o.charAt(0);)o=o.substring(1,o.length)
if(0==o.indexOf(a))return o.substring(a.length,o.length)}return null}function centerText(e){e.preventDefault()
var a=$("#wemake-x"),t=$("#wemake-y"),r=$("#porn-x"),o=$("#porn-y"),s=$("#img-width").val(),l=$("#img-height").val()
a.val(s/2),t.val(l/4+3*l/20),r.val(s/2),o.val(3*l/4+l/8),refreshText()}function createUrl(e,a,t,r,o,s,l,n,i,c,g,m,d,h,v,f,u,p,w,$,b,k,P,y,x,S,C,I,T,z,R,F,L,O,U,D,A,G,B,N,E,M,W,J,j){return e.searchParams.set("w",a),e.searchParams.set("wx",t),e.searchParams.set("wy",r),e.searchParams.set("ws",o),e.searchParams.set("wc",s),e.searchParams.set("wa",l),e.searchParams.set("wf",n),e.searchParams.set("wfs",i),e.searchParams.set("p",g),e.searchParams.set("px",m),e.searchParams.set("py",d),e.searchParams.set("ps",h),e.searchParams.set("pc",v),e.searchParams.set("pa",f),e.searchParams.set("pf",u),e.searchParams.set("pfs",p),e.searchParams.set("co",$),e.searchParams.set("ra",b),e.searchParams.set("gli",k),e.searchParams.set("bgt",P),e.searchParams.set("rc",y),e.searchParams.set("bgr",x),e.searchParams.set("egr",S),e.searchParams.set("or",C),e.searchParams.set("bgi",I),e.searchParams.set("cor",T),e.searchParams.set("bth",z),e.searchParams.set("width",R),e.searchParams.set("height",F),e.searchParams.set("x",L),e.searchParams.set("y",O),e.searchParams.set("s",U),e.searchParams.set("bgu",D),e.searchParams.set("r",A),e.searchParams.set("rx",G),e.searchParams.set("ry",B),e.searchParams.set("rs",N),e.searchParams.set("rr",E),e.searchParams.set("woc",M),e.searchParams.set("wos",W),e.searchParams.set("poc",J),e.searchParams.set("pos",j),e}function importData(e){var a=new FileReader
a.val(s/2),t.val(l/4+3*l/20),r.val(s/2),o.val(3*l/4+l/8),refreshText()}function createUrl(e,a,t,r,o,s,l,n,i,c,g,m,d,h,v,f,u,p,$,w,b,k,P,y,x,S,C,I,T,z,R,F,L,O,U,D,A,G,B,N,E,M,W,J,j){return e.searchParams.set("w",a),e.searchParams.set("wx",t),e.searchParams.set("wy",r),e.searchParams.set("ws",o),e.searchParams.set("wc",s),e.searchParams.set("wa",l),e.searchParams.set("wf",n),e.searchParams.set("wfs",i),e.searchParams.set("p",g),e.searchParams.set("px",m),e.searchParams.set("py",d),e.searchParams.set("ps",h),e.searchParams.set("pc",v),e.searchParams.set("pa",f),e.searchParams.set("pf",u),e.searchParams.set("pfs",p),e.searchParams.set("co",w),e.searchParams.set("ra",b),e.searchParams.set("gli",k),e.searchParams.set("bgt",P),e.searchParams.set("rc",y),e.searchParams.set("bgr",x),e.searchParams.set("egr",S),e.searchParams.set("or",C),e.searchParams.set("bgi",I),e.searchParams.set("cor",T),e.searchParams.set("bth",z),e.searchParams.set("width",R),e.searchParams.set("height",F),e.searchParams.set("x",L),e.searchParams.set("y",O),e.searchParams.set("s",U),e.searchParams.set("bgu",D),e.searchParams.set("r",A),e.searchParams.set("rx",G),e.searchParams.set("ry",B),e.searchParams.set("rs",N),e.searchParams.set("rr",E),e.searchParams.set("woc",M),e.searchParams.set("wos",W),e.searchParams.set("poc",J),e.searchParams.set("pos",j),e}function importData(e){var a=new FileReader
a.addEventListener("loadend",function(){try{var e=JSON.parse(String.fromCharCode.apply(null,new Uint8Array(a.result))),t=localStorage.getItem("wemas")
null===t?localStorage.setItem("wemas",JSON.stringify(e)):(t=JSON.parse(t),$.extend(t,e),localStorage.setItem("wemas",JSON.stringify(t))),fillGallery(),alert(importOk)}catch(e){alert(e)}}),a.readAsArrayBuffer(e[0])}function exportData(e){e.preventDefault()
var a=$('<a id="export-data-json">')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment