first commit
BIN
wp-content/plugins/weglot/app/images/circular_flag.png
Normal file
|
After Width: | Height: | Size: 82 KiB |
13
wp-content/plugins/weglot/app/images/logo-wg.svg
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="74px" height="15px" viewBox="0 0 74 15" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 54.1 (76490) - https://sketchapp.com -->
|
||||
<title>Logo</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<g id="Symbols-💎💎💎" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="Menu/Color" transform="translate(0.000000, -13.000000)" fill="#0A1A42" fill-rule="nonzero">
|
||||
<g id="Logo">
|
||||
<path d="M1.36779477e-13,13.1099109 L3.04612497,13.1099109 L5.64574953,19.767728 L8.25529633,13.1099109 L10.8549209,19.767728 L13.4446232,13.1099109 L16.4907482,13.1099109 L10.8549209,27.4872238 L8.2156074,20.4920509 L5.64574953,27.4872238 L1.36779477e-13,13.1099109 Z M17.7111826,13.0801442 L26.1946903,13.0801442 L26.1946903,15.8980578 L20.5390185,15.8980578 L20.5390185,18.7258937 L24.7758112,18.7258937 L24.7758112,21.5438074 L20.5390185,21.5438074 L20.5390185,24.3815655 L26.1946903,24.3815655 L26.1946903,27.1895569 L17.7111826,27.1895569 L17.7111826,13.0801442 Z M34.0134084,13.0007663 L34.0233307,13.0206108 C35.9144598,13.0282468 37.7273913,13.7762146 39.0737463,15.1042793 L37.0595334,17.1184923 C36.1962993,16.2850249 35.1941539,15.8583689 34.0431751,15.8583689 C32.9039452,15.8438363 31.8091366,16.2997074 31.0168946,17.1184923 C30.1834272,17.9618819 29.7666935,18.9739495 29.7666935,20.1447728 C29.7483829,21.2827529 30.2007607,22.3777944 31.0168946,23.1710533 C31.9953198,24.1619883 33.3974068,24.6102573 34.769229,24.3707328 C36.1410512,24.1312083 37.3082712,23.2343301 37.8930008,21.9704633 L33.8844194,21.9704633 L33.8844194,19.2815387 L41.0978815,19.2815387 C41.3648386,21.459504 40.6103912,23.6386118 39.0539019,25.1852662 C37.6548673,26.5743786 35.968088,27.278857 34.0134084,27.278857 C32.1188803,27.3082746 30.2971133,26.5501033 28.9828372,25.1852662 C27.5838026,23.8060761 26.8892464,22.129219 26.8892464,20.1447728 C26.8618436,18.2477292 27.6194772,16.4236635 28.9828372,15.1042793 C30.3620274,13.6953225 32.0388844,13.0007663 34.0134084,13.0007663 Z M42.3480826,13.1099109 L45.1759185,13.1099109 L45.1759185,24.361721 L50.821668,24.361721 L50.821668,27.1697124 L42.3480826,27.1697124 L42.3480826,13.1099109 Z M57.7870743,13.0007663 C59.6862899,12.9723695 61.5119444,13.7342568 62.8275677,15.1042793 C64.2266023,16.5033139 64.9310807,18.180171 64.9310807,20.1447728 C64.9594776,22.0439884 64.1975903,23.8696429 62.8275677,25.1852662 C61.4285331,26.5743786 59.7516761,27.2689347 57.7870743,27.2689347 C55.8930787,27.2907296 54.0723402,26.5380621 52.7465809,25.1852662 C51.3475463,23.7961538 50.6529901,22.1093745 50.6529901,20.1447728 C50.6255872,18.2477292 51.3832208,16.4236635 52.7465809,15.1042793 C54.1456154,13.6953225 55.8224725,13.0007663 57.7870743,13.0007663 Z M57.7870743,15.8484467 C56.6462295,15.8254741 55.5481833,16.2826933 54.7607938,17.10857 C53.9174041,17.9519597 53.5006704,18.9640273 53.5006704,20.1348505 C53.4837607,21.2745385 53.9400092,22.3702534 54.7607938,23.161131 C55.5942612,23.9846762 56.5964065,24.4014099 57.7870743,24.4014099 C58.919269,24.414927 60.0082246,23.9671657 60.8034326,23.161131 C61.6468222,22.3276636 62.0635559,21.315596 62.0635559,20.1348505 C62.0804656,18.9951625 61.6242171,17.8994477 60.8034326,17.10857 C59.9699651,16.2651804 58.9578976,15.8484467 57.7870743,15.8484467 Z M64.2464468,13.1099109 L74,13.1099109 L74,15.9079801 L70.5470636,15.9079801 L70.5470636,27.1697124 L67.7093054,27.1697124 L67.7093054,15.9079801 L64.2464468,15.9079801 L64.2464468,13.1099109 Z"></path>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.6 KiB |
BIN
wp-content/plugins/weglot/app/images/rect_bright.png
Normal file
|
After Width: | Height: | Size: 34 KiB |
BIN
wp-content/plugins/weglot/app/images/rect_mate.png
Normal file
|
After Width: | Height: | Size: 52 KiB |
BIN
wp-content/plugins/weglot/app/images/square_flag.png
Normal file
|
After Width: | Height: | Size: 62 KiB |
BIN
wp-content/plugins/weglot/app/images/wgarrowdown.png
Normal file
|
After Width: | Height: | Size: 164 B |
34
wp-content/plugins/weglot/app/javascripts/filter-polyfill.js
Normal file
@@ -0,0 +1,34 @@
|
||||
if (!Array.prototype.filter) {
|
||||
Array.prototype.filter = function (func, thisArg) {
|
||||
'use strict';
|
||||
if (!((typeof func === 'Function' || typeof func === 'function') && this))
|
||||
throw new TypeError();
|
||||
|
||||
var len = this.length >>> 0,
|
||||
res = new Array(len), // preallocate array
|
||||
t = this, c = 0, i = -1;
|
||||
if (thisArg === undefined) {
|
||||
while (++i !== len) {
|
||||
// checks to see if the key was set
|
||||
if (i in this) {
|
||||
if (func(t[i], i, t)) {
|
||||
res[c++] = t[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
while (++i !== len) {
|
||||
// checks to see if the key was set
|
||||
if (i in this) {
|
||||
if (func.call(thisArg, t[i], i, t)) {
|
||||
res[c++] = t[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
res.length = c; // shrink down array to proper size
|
||||
return res;
|
||||
};
|
||||
}
|
||||
46
wp-content/plugins/weglot/app/javascripts/find-polyfill.js
Normal file
@@ -0,0 +1,46 @@
|
||||
// https://tc39.github.io/ecma262/#sec-array.prototype.find
|
||||
if (!Array.prototype.find) {
|
||||
Object.defineProperty(Array.prototype, 'find', {
|
||||
value: function (predicate) {
|
||||
// 1. Let O be ? ToObject(this value).
|
||||
if (this == null) {
|
||||
throw new TypeError('"this" is null or not defined');
|
||||
}
|
||||
|
||||
var o = Object(this);
|
||||
|
||||
// 2. Let len be ? ToLength(? Get(O, "length")).
|
||||
var len = o.length >>> 0;
|
||||
|
||||
// 3. If IsCallable(predicate) is false, throw a TypeError exception.
|
||||
if (typeof predicate !== 'function') {
|
||||
throw new TypeError('predicate must be a function');
|
||||
}
|
||||
|
||||
// 4. If thisArg was supplied, let T be thisArg; else let T be undefined.
|
||||
var thisArg = arguments[1];
|
||||
|
||||
// 5. Let k be 0.
|
||||
var k = 0;
|
||||
|
||||
// 6. Repeat, while k < len
|
||||
while (k < len) {
|
||||
// a. Let Pk be ! ToString(k).
|
||||
// b. Let kValue be ? Get(O, Pk).
|
||||
// c. Let testResult be ToBoolean(? Call(predicate, T, « kValue, k, O »)).
|
||||
// d. If testResult is true, return kValue.
|
||||
var kValue = o[k];
|
||||
if (predicate.call(thisArg, kValue, k, o)) {
|
||||
return kValue;
|
||||
}
|
||||
// e. Increase k by 1.
|
||||
k++;
|
||||
}
|
||||
|
||||
// 7. Return undefined.
|
||||
return undefined;
|
||||
},
|
||||
configurable: true,
|
||||
writable: true
|
||||
});
|
||||
}
|
||||
271
wp-content/plugins/weglot/app/javascripts/front.js
Normal file
@@ -0,0 +1,271 @@
|
||||
//find and place wg-ajax-button-switcher
|
||||
|
||||
function switcherPlacement() {
|
||||
const button_switcher_ajax = document.querySelectorAll(".weglot-custom-switcher-ajax")
|
||||
Array.prototype.forEach.call(button_switcher_ajax, function (el, i) {
|
||||
let button_sibling = null;
|
||||
let button_target = null;
|
||||
let targetSelector = null;
|
||||
let siblingSelector = null;
|
||||
|
||||
if (el.getAttribute('data-wg-target') !== '') {
|
||||
targetSelector = el.getAttribute('data-wg-target');
|
||||
}
|
||||
|
||||
if (el.getAttribute('data-wg-sibling') !== '') {
|
||||
siblingSelector = el.getAttribute('data-wg-sibling');
|
||||
}
|
||||
|
||||
if (targetSelector) {
|
||||
button_target = document.querySelector(targetSelector)
|
||||
}
|
||||
if (siblingSelector) {
|
||||
button_sibling = document.querySelector(siblingSelector)
|
||||
}
|
||||
|
||||
if (button_target != null && button_sibling != null) {
|
||||
button_target.insertBefore(el, button_sibling)
|
||||
el.classList.remove("weglot-custom-switcher-ajax")
|
||||
} else if (button_target && button_sibling == null) {
|
||||
button_target.insertBefore(el, button_target.firstChild)
|
||||
el.classList.remove("weglot-custom-switcher-ajax")
|
||||
} else if (button_sibling && button_target == null) {
|
||||
button_sibling.parentNode.insertBefore(el, button_sibling)
|
||||
el.classList.remove("weglot-custom-switcher-ajax")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
//detect iframe
|
||||
function inFrame() {
|
||||
try {
|
||||
return window.frameElement || window.self !== window.top;
|
||||
} catch (_) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
setTimeout(() => {
|
||||
if (document.readyState === "loading") {
|
||||
document.addEventListener( "DOMContentLoaded", () => switcherPlacement() );
|
||||
} else {
|
||||
switcherPlacement();
|
||||
}
|
||||
}, 1500);
|
||||
|
||||
document.addEventListener( "DOMContentLoaded", function ( event ) {
|
||||
|
||||
function getOffset(element) {
|
||||
let top = 0, left = 0;
|
||||
do {
|
||||
top += element.offsetTop || 0;
|
||||
left += element.offsetLeft || 0;
|
||||
element = element.offsetParent;
|
||||
} while (element);
|
||||
|
||||
return {
|
||||
top: top, left: left
|
||||
};
|
||||
}
|
||||
|
||||
const button = document.querySelector(".country-selector");
|
||||
if (!button) {
|
||||
return;
|
||||
}
|
||||
const h = getOffset(button).top;
|
||||
const body = document.body, html = document.documentElement;
|
||||
const page_height = Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight);
|
||||
|
||||
const position = window.getComputedStyle(button).getPropertyValue("position");
|
||||
const bottom = window.getComputedStyle(button).getPropertyValue("bottom");
|
||||
const top = window.getComputedStyle(button).getPropertyValue("top");
|
||||
|
||||
if ((position !== "fixed" && h > page_height / 2) || (position === "fixed" && h > 100)) {
|
||||
button.className += " weglot-invert";
|
||||
}
|
||||
|
||||
//check if your page is load by an iframe
|
||||
if (inFrame()) {
|
||||
const switchers = document.querySelectorAll('.weglot-dropdown')
|
||||
if (switchers !== null) {
|
||||
[].forEach.call(switchers, function (switcher) {
|
||||
switcher.style.display = "none";
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
document.addEventListener("click", (evt) => {
|
||||
let targetEl = evt.target;
|
||||
|
||||
if(targetEl.closest('.country-selector.close_outside_click') == null){
|
||||
document.querySelectorAll(".country-selector.close_outside_click.weglot-dropdown input").forEach( (node) => {
|
||||
node.checked = false
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
const asides = document.getElementsByClassName("country-selector");
|
||||
const isOpen = link => !link.className.includes("closed");
|
||||
let focusedLang;
|
||||
if (asides.length > 0) {
|
||||
const selectedLang = document.getElementsByClassName("wgcurrent");
|
||||
for (let aside of asides) {
|
||||
|
||||
// accessiblity button
|
||||
const KEYCODE = {
|
||||
ENTER: 13, ESCAPE: 27, ARROWUP: 38, ARROWDOWN: 40,
|
||||
};
|
||||
|
||||
const isOpenUp = () => {
|
||||
// If switcher is in second half of page, set weg-openup class
|
||||
const {bottom = 0} = aside.getBoundingClientRect();
|
||||
return bottom > window.innerHeight / 2;
|
||||
};
|
||||
|
||||
const openSwitcher = () => {
|
||||
aside.classList.remove("closed");
|
||||
document.querySelectorAll(".country-selector.weglot-dropdown input").checked = true;
|
||||
aside.setAttribute("aria-expanded", "true");
|
||||
};
|
||||
|
||||
const closeSwitcher = () => {
|
||||
aside.classList.add("closed");
|
||||
document.querySelectorAll(".country-selector.weglot-dropdown input").checked = false
|
||||
aside.setAttribute("aria-expanded", "false");
|
||||
if (focusedLang) {
|
||||
focusedLang.classList.remove("focus");
|
||||
focusedLang = null;
|
||||
}
|
||||
};
|
||||
|
||||
const setAriaLabel = code => {
|
||||
const fullNameLang = getLangNameFromCode(code);
|
||||
//aside.setAttribute("aria-activedescendant", "weglot-language-" + code);
|
||||
aside.setAttribute("aria-label", "Language selected: " + code);
|
||||
};
|
||||
|
||||
const toggleSwitcher = () => {
|
||||
if (aside.classList.contains("closed")) {
|
||||
openSwitcher();
|
||||
} else {
|
||||
closeSwitcher();
|
||||
}
|
||||
if (focusedLang) {
|
||||
focusedLang.classList.remove("focus");
|
||||
}
|
||||
focusedLang = null;
|
||||
};
|
||||
|
||||
// Toggle when focused and keydown ENTER.
|
||||
aside.addEventListener("keydown", event => {
|
||||
if (event.keyCode === KEYCODE.ENTER) {
|
||||
//event.preventDefault();
|
||||
//selectedLang.click();
|
||||
for (var i = 0; i < selectedLang.length; i++) {
|
||||
selectedLang[i].click();
|
||||
}
|
||||
if (focusedLang) {
|
||||
const destinationLanguage = focusedLang.getAttribute("data-l");
|
||||
setAriaLabel(destinationLanguage);
|
||||
aside.focus();
|
||||
}
|
||||
toggleSwitcher();
|
||||
return;
|
||||
}
|
||||
if (event.keyCode === KEYCODE.ARROWDOWN || event.keyCode === KEYCODE.ARROWUP) {
|
||||
event.preventDefault();
|
||||
moveFocus(event.keyCode);
|
||||
return;
|
||||
}
|
||||
if (event.keyCode === KEYCODE.ESCAPE && isOpen(aside)) {
|
||||
// Close switcher.
|
||||
event.preventDefault();
|
||||
closeSwitcher();
|
||||
aside.focus();
|
||||
}
|
||||
});
|
||||
|
||||
aside.addEventListener("mousedown", event => {
|
||||
if (focusedLang) {
|
||||
const destinationLanguage = focusedLang.getAttribute("data-l");
|
||||
setAriaLabel(destinationLanguage);
|
||||
aside.focus();
|
||||
}
|
||||
toggleSwitcher();
|
||||
return;
|
||||
});
|
||||
|
||||
if(aside.className.includes("open_hover")){
|
||||
aside.addEventListener("mouseenter", event => {
|
||||
if (focusedLang) {
|
||||
const destinationLanguage = focusedLang.getAttribute("data-l");
|
||||
setAriaLabel(destinationLanguage);
|
||||
aside.focus();
|
||||
}
|
||||
toggleSwitcher();
|
||||
aside.querySelector("input.weglot_choice").checked = true
|
||||
return;
|
||||
});
|
||||
|
||||
aside.addEventListener("mouseleave", event => {
|
||||
if (focusedLang) {
|
||||
const destinationLanguage = focusedLang.getAttribute("data-l");
|
||||
setAriaLabel(destinationLanguage);
|
||||
aside.focus();
|
||||
}
|
||||
toggleSwitcher();
|
||||
aside.querySelector("input.weglot_choice").checked = false
|
||||
return;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
const moveFocus = keyCode => {
|
||||
const direction = keyCode === KEYCODE.ARROWDOWN ? "nextSibling" : "previousSibling";
|
||||
const openUp = isOpenUp();
|
||||
|
||||
if (!focusedLang || !isOpen(aside)) {
|
||||
// Focus the first or last language
|
||||
const selector = openUp ? "ul li.wg-li:last-child" : "ul li.wg-li";
|
||||
|
||||
for (var i = 0; i < selectedLang.length; i++) {
|
||||
//selectedLang[i].click();
|
||||
focusedLang = selectedLang[i].parentNode.querySelector(selector);
|
||||
}
|
||||
|
||||
if (!focusedLang) {
|
||||
return;
|
||||
}
|
||||
focusedLang.classList.add("focus");
|
||||
focusedLang.childNodes[0].focus();
|
||||
focusedLang.scrollIntoView({block: "center"});
|
||||
|
||||
// if right direction, open it
|
||||
const needToOpen = (keyCode === KEYCODE.ARROWUP && openUp) || (keyCode === KEYCODE.ARROWDOWN && !openUp);
|
||||
if (!isOpen(aside) && needToOpen) {
|
||||
openSwitcher();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Focus next or prev language, if exists
|
||||
if (!focusedLang[direction]) {
|
||||
// if last element, close it
|
||||
if ((keyCode === KEYCODE.ARROWUP && !openUp) || (keyCode === KEYCODE.ARROWDOWN && openUp)) {
|
||||
closeSwitcher();
|
||||
aside.focus();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
focusedLang.classList.remove("focus");
|
||||
focusedLang = focusedLang[direction];
|
||||
focusedLang.classList.add("focus");
|
||||
focusedLang.childNodes[0].focus();
|
||||
focusedLang.scrollIntoView({block: "center"});
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
17
wp-content/plugins/weglot/app/javascripts/index.js
Normal file
@@ -0,0 +1,17 @@
|
||||
import InitAdminSelect from './settings/admin-select'
|
||||
import InitAdminWeglotBox from './settings/admin-weglot-box'
|
||||
import InitAdminButtonPreview from './settings/admin-button-preview'
|
||||
import InitAdminCheckApiKey from './settings/admin-check-api-key'
|
||||
import initAdminCodeEditor from './settings/admin-code-editor'
|
||||
import InitAdminChangeCountry from './settings/admin-change-country'
|
||||
import InitAdminPrivateMode from './settings/admin-private-mode'
|
||||
import './find-polyfill'
|
||||
import './filter-polyfill'
|
||||
|
||||
InitAdminSelect()
|
||||
InitAdminWeglotBox();
|
||||
InitAdminButtonPreview();
|
||||
InitAdminCheckApiKey();
|
||||
initAdminCodeEditor();
|
||||
InitAdminChangeCountry();
|
||||
InitAdminPrivateMode();
|
||||
@@ -0,0 +1,105 @@
|
||||
import slugify from 'slugify'
|
||||
|
||||
const init_url_translate = () => {
|
||||
const $ = jQuery;
|
||||
|
||||
const execute = () => {
|
||||
let old_text = {}
|
||||
|
||||
const edit_weglot_post_name = function(e) {
|
||||
const code = $(this).data('lang')
|
||||
const post_name = slugify($(`#lang-${code}`).val(), {
|
||||
lower: true,
|
||||
replacement: '-'
|
||||
});
|
||||
|
||||
$(`#text-edit-${code}`).text( post_name );
|
||||
|
||||
$(`#lang-${code}`).hide();
|
||||
$(this).hide()
|
||||
$(`.button-weglot-lang[data-lang=${code}]`).show()
|
||||
|
||||
$.ajax({
|
||||
url: ajaxurl,
|
||||
method: "POST",
|
||||
data: {
|
||||
action: "weglot_post_name",
|
||||
lang: code,
|
||||
id: $("#weglot_post_id").data('id'),
|
||||
post_name: post_name
|
||||
},
|
||||
success: function(res) {
|
||||
if(res.data && res.data.code && res.data.code === 'same_post_name'){
|
||||
$(`#text-edit-${code}`).text(old_text[code]);
|
||||
$(`#lang-${code}`).val('');
|
||||
return
|
||||
}
|
||||
else if (res.data && res.data.code && res.data.code ==='not_available'){
|
||||
$(`#weglot_permalink_not_available_${code}`).show();
|
||||
$(`#lang-${code}`).val("");
|
||||
setTimeout(() => {
|
||||
$(`#weglot_permalink_not_available_${code}`).hide();
|
||||
}, 5000);
|
||||
}
|
||||
|
||||
$(`#text-edit-${code}`).text(res.data.result.slug);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(".button-weglot-lang").each((key, itm) => {
|
||||
$(itm).on('click', function (e) {
|
||||
e.preventDefault()
|
||||
|
||||
const code = $(this).data('lang')
|
||||
const text = $(`#text-edit-${code}`).text();
|
||||
old_text[code] = text
|
||||
|
||||
$(`#text-edit-${code}`).text(' ');
|
||||
$(`#lang-${code}`).val(text).show();
|
||||
$(`.button-weglot-lang-submit[data-lang=${code}]`).show();
|
||||
$(this).hide()
|
||||
})
|
||||
|
||||
const code = $(itm).data('lang')
|
||||
|
||||
$(`.button-weglot-lang-submit[data-lang=${code}]`)
|
||||
.on("click", edit_weglot_post_name);
|
||||
})
|
||||
|
||||
$(".weglot_reset").each((key, itm) => {
|
||||
$(itm).on("click", function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
const code = $(this).data("lang");
|
||||
const custom_url = $(this).attr('href')
|
||||
const id = $(this).data('id')
|
||||
|
||||
$.ajax({
|
||||
url: ajaxurl,
|
||||
method: "POST",
|
||||
data: {
|
||||
action: "weglot_reset_custom_url",
|
||||
code_lang: code,
|
||||
id: id,
|
||||
custom_url: custom_url
|
||||
},
|
||||
success: function(res) {
|
||||
$(`#text-edit-${code}`).text(
|
||||
res.data.result.slug
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
execute();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
export default init_url_translate
|
||||
63
wp-content/plugins/weglot/app/javascripts/nav.js
Normal file
@@ -0,0 +1,63 @@
|
||||
jQuery(document).ready(function ($) {
|
||||
$('#update-nav-menu').bind('click', function (e) {
|
||||
|
||||
if (e.target && e.target.className && -1 != e.target.className.indexOf('item-edit')) {
|
||||
|
||||
$("input[value='#weglot_switcher'][type=text]").parents('.menu-item-settings').each(function () {
|
||||
const id = $(this).attr('id').substring(19);
|
||||
$(this).children('p:not( .field-move )').remove(); // remove default fields we don't need
|
||||
|
||||
$(this).append($('<input>').attr({ // phpcs:ignore
|
||||
type: 'hidden',
|
||||
id: 'edit-menu-item-title-' + id,
|
||||
name: 'menu-item-title[' + id + ']',
|
||||
value: weglot_data.title
|
||||
}));
|
||||
|
||||
$(this).append($("<input>").attr({ // phpcs:ignore
|
||||
type: "hidden",
|
||||
id: "edit-menu-item-url-" + id,
|
||||
name: "menu-item-url[" + id + "]",
|
||||
value: "#weglot_switcher"
|
||||
}));
|
||||
|
||||
$(this).append($('<input>').attr({ // phpcs:ignore
|
||||
type: 'hidden',
|
||||
id: 'edit-menu-item-weglot-detect-' + id,
|
||||
name: 'menu-item-weglot-detect[' + id + ']',
|
||||
value: 1
|
||||
}));
|
||||
|
||||
|
||||
$.each(weglot_data.list_options, (key, option) => {
|
||||
const paragraph = $("<p>").attr("class", "description");
|
||||
const label = $("<label>")
|
||||
.attr("for", `edit-menu-item-${option.key}-${id}`)
|
||||
.text(` ${option.title}`);
|
||||
|
||||
$(this).prepend(paragraph); // phpcs:ignore
|
||||
paragraph.append(label); // phpcs:ignore
|
||||
|
||||
const checkbox = $("<input>").attr({
|
||||
type: "checkbox",
|
||||
id: `edit-menu-item-${
|
||||
option.key
|
||||
}-${id}`,
|
||||
name: `menu-item-weglot-${
|
||||
option.key
|
||||
}[${id}]`,
|
||||
value: 1
|
||||
});
|
||||
|
||||
|
||||
if (weglot_data.options && weglot_data.options[`menu-item-${id}`] && weglot_data.options[`menu-item-${id}`][ option.key ] === 1 ){
|
||||
checkbox.prop("checked", true);
|
||||
}
|
||||
|
||||
label.prepend(checkbox); // phpcs:ignore
|
||||
})
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
3
wp-content/plugins/weglot/app/javascripts/selectize.js
Normal file
@@ -0,0 +1,114 @@
|
||||
const init_admin_button_preview = function () {
|
||||
const $ = jQuery
|
||||
|
||||
const execute = () => {
|
||||
// Init old type flags
|
||||
let old_type_flags = $("#type_flags option:selected").data('value')
|
||||
|
||||
let destination_languages = []
|
||||
destination_languages.push($(".country-selector label").data("code-language"));
|
||||
$(".country-selector li").each((key, itm) => {
|
||||
destination_languages.push($(itm).data("code-language"));
|
||||
})
|
||||
|
||||
const weglot_desination_languages = weglot_languages.available.filter(itm => {
|
||||
return destination_languages.indexOf(itm.external_code) >= 0;
|
||||
})
|
||||
|
||||
$("#weglot-css-inline").text(weglot_css.inline);
|
||||
|
||||
// Change dropdown
|
||||
$("#is_dropdown").on("change", function(){
|
||||
$(".country-selector").toggleClass("weglot-inline");
|
||||
$(".country-selector").toggleClass("weglot-dropdown");
|
||||
})
|
||||
|
||||
// Change with flags
|
||||
$("#with_flags").on("change", function() {
|
||||
$(".country-selector label, .country-selector li").toggleClass("weglot-flags");
|
||||
});
|
||||
|
||||
// Change type flags
|
||||
$("#type_flags").on("change", function(e) {
|
||||
$(".country-selector label, .country-selector li").removeClass(`flag-${old_type_flags}`);
|
||||
const new_type_flags = $(':selected', this).data('value')
|
||||
$(".country-selector label, .country-selector li").addClass(`flag-${new_type_flags}`);
|
||||
old_type_flags = new_type_flags;
|
||||
});
|
||||
|
||||
const set_languages = () => {
|
||||
const label_language = weglot_desination_languages.find(
|
||||
(itm) => itm.external_code === $(".country-selector label").data("code-language")
|
||||
);
|
||||
const is_fullname = $("#is_fullname").is(":checked");
|
||||
|
||||
const label = is_fullname ? label_language.local : label_language.internal_code.toUpperCase();
|
||||
|
||||
$(".country-selector label a, .country-selector label span").text(label);
|
||||
|
||||
$(".country-selector li").each((key, itm) => {
|
||||
const li_language = weglot_desination_languages.find(
|
||||
(lang) => lang.internal_code === $(itm).data("code-language")
|
||||
);
|
||||
|
||||
const label = is_fullname ? li_language.local : li_language.internal_code.toUpperCase();
|
||||
|
||||
$(itm)
|
||||
.find("a")
|
||||
.text(label);
|
||||
})
|
||||
}
|
||||
|
||||
// Change with name
|
||||
$("#with_name").on("change", function(e) {
|
||||
if (e.target.checked) {
|
||||
set_languages();
|
||||
} else {
|
||||
$(".country-selector label a, .country-selector label span").text("");
|
||||
$(".country-selector li a, .country-selector li span").each(
|
||||
(key, itm) => {
|
||||
$(itm).text("");
|
||||
}
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
$("#is_fullname").on("change", function(e){
|
||||
if ( !$("#with_name").is(":checked") ) {
|
||||
return
|
||||
}
|
||||
|
||||
if (e.target.checked) {
|
||||
set_languages();
|
||||
}
|
||||
else {
|
||||
const label_language = weglot_desination_languages.find(itm => itm.internal_code === $(".country-selector label").data("code-language"));
|
||||
|
||||
$(".country-selector label a, .country-selector label span").text(label_language.internal_code.toUpperCase());
|
||||
$(".country-selector li").each((key, itm) => {
|
||||
const language = weglot_desination_languages.find(lang => lang.internal_code === $(itm).data("code-language"));
|
||||
|
||||
$(itm).find("a").text(language.internal_code.toUpperCase());
|
||||
$(itm).find("span").text(language.internal_code.toUpperCase());
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$("#override_css").on("keyup", function(e) {
|
||||
$("#weglot-css-inline").text(e.target.value);
|
||||
})
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
if ($(".weglot-preview").length === 0){
|
||||
return
|
||||
}
|
||||
|
||||
execute();
|
||||
})
|
||||
}
|
||||
|
||||
export default init_admin_button_preview;
|
||||
|
||||
@@ -0,0 +1,123 @@
|
||||
const init_admin_change_country = function() {
|
||||
const $ = jQuery;
|
||||
|
||||
if(typeof weglot_css !== "undefined"){
|
||||
$("#weglot-css-flag-css").text(weglot_css.flag_css);
|
||||
}
|
||||
|
||||
function refresh_flag_css() {
|
||||
var en_flags = new Array();
|
||||
var es_flags = new Array();
|
||||
var fr_flags = new Array();
|
||||
var ar_flags = new Array();
|
||||
var tw_flags = new Array();
|
||||
var zh_flags = new Array();
|
||||
var pt_flags = new Array();
|
||||
|
||||
en_flags[1] = [3570, 7841, 48, 2712];
|
||||
en_flags[2] = [3720, 449, 3048, 4440];
|
||||
en_flags[3] = [3840, 1281, 2712, 4224];
|
||||
en_flags[4] = [3240, 5217, 1224, 2112];
|
||||
en_flags[5] = [4050, 3585, 1944, 2496];
|
||||
en_flags[6] = [2340, 3457, 2016, 2016];
|
||||
|
||||
es_flags[1] = [4320, 4641, 3144, 3552];
|
||||
es_flags[2] = [3750, 353, 2880, 4656];
|
||||
es_flags[3] = [4200, 1601, 2568, 3192];
|
||||
es_flags[4] = [3990, 5793, 1032, 2232];
|
||||
es_flags[5] = [5460, 897, 4104, 3120];
|
||||
es_flags[6] = [3810, 7905, 216, 3888];
|
||||
es_flags[7] = [3630, 8065, 192, 2376];
|
||||
es_flags[8] = [3780, 1473, 2496, 4104];
|
||||
es_flags[9] = [6120, 2145, 4680, 2568];
|
||||
es_flags[10] = [4440, 3009, 3240, 1176];
|
||||
es_flags[11] = [5280, 1825, 3936, 2976];
|
||||
es_flags[12] = [4770, 2081, 3624, 1008];
|
||||
es_flags[13] = [4080, 3201, 2160, 2544];
|
||||
es_flags[14] = [4590, 5761, 3432, 624];
|
||||
es_flags[15] = [4350, 2209, 3360, 2688];
|
||||
es_flags[16] = [5610, 5249, 3168, 528];
|
||||
es_flags[17] = [5070, 1729, 3792, 2952];
|
||||
es_flags[18] = [6870, 5953, 96, 3408];
|
||||
es_flags[19] = [4020, 5697, 1056, 1224];
|
||||
|
||||
fr_flags[1] = [2760, 736, 2856, 4416];
|
||||
fr_flags[2] = [3840, 1280, 2712, 4224];
|
||||
fr_flags[3] = [5700, 7201, 5016, 2400];
|
||||
fr_flags[4] = [2220, 4160, 1632, 1944];
|
||||
|
||||
ar_flags[1] = [1830, 129, 3096, 5664];
|
||||
ar_flags[2] = [5100, 2177, 3840, 2904];
|
||||
ar_flags[3] = [4890, 3425, 3648, 2136];
|
||||
ar_flags[4] = [1320, 3681, 1896, 4080];
|
||||
ar_flags[5] = [1260, 3841, 1824, 1200];
|
||||
ar_flags[6] = [1020, 3969, 1608, 312];
|
||||
ar_flags[7] = [4800, 4065, 3600, 72];
|
||||
ar_flags[8] = [4710, 4865, 3504, 480];
|
||||
ar_flags[9] = [6720, 5984, 5112, 3792];
|
||||
ar_flags[10] = [4500, 7233, 3288, 1800];
|
||||
ar_flags[11] = [720, 7522, 384, 3936];
|
||||
ar_flags[12] = [690, 7745, 336, 1104];
|
||||
ar_flags[13] = [600, 8225, 120, 1272];
|
||||
ar_flags[14] = [660, 5569, 840, 576];
|
||||
|
||||
tw_flags[1] = [3690, 1505, 2592, 3240]; // China
|
||||
tw_flags[2] = [3600, 3233, 2112, 48]; // Hong Kong
|
||||
|
||||
zh_flags[1] = [2970, 6369, 3408, 4008]; // Taiwan
|
||||
zh_flags[2] = [3600, 3233, 2112, 48]; // Hong Kong
|
||||
|
||||
pt_flags[1] = [6630, 993, 2784, 4344];
|
||||
|
||||
var enval = $("select.flag-en-type").val();
|
||||
var esval = $("select.flag-es-type").val();
|
||||
var frval = $("select.flag-fr-type").val();
|
||||
var arval = $("select.flag-ar-type").val();
|
||||
var twval = $("select.flag-tw-type").val();
|
||||
var zhval = $("select.flag-zh-type").val();
|
||||
var ptval = $("select.flag-pt-type").val();
|
||||
var en_style = enval <= 0 ? "" : ".weglot-flags.en > a:before, .weglot-flags.en > span:before { background-position: -" + en_flags[enval][0] + "px 0 !important; } .weglot-flags.flag-1.en > a:before, .weglot-flags.flag-1.en > span:before { background-position: -" + en_flags[enval][1] + "px 0 !important; } .weglot-flags.flag-2.en > a:before, .weglot-flags.flag-2.en > span:before { background-position: -" + en_flags[enval][2] + "px 0 !important; } .weglot-flags.flag-3.en > a:before, .weglot-flags.flag-3.en > span:before { background-position: -" + en_flags[enval][3] + "px 0 !important; } ";
|
||||
var es_style = esval <= 0 ? "" : ".weglot-flags.es > a:before, .weglot-flags.es > span:before { background-position: -" + es_flags[esval][0] + "px 0 !important; } .weglot-flags.flag-1.es > a:before, .weglot-flags.flag-1.es > span:before { background-position: -" + es_flags[esval][1] + "px 0 !important; } .weglot-flags.flag-2.es > a:before, .weglot-flags.flag-2.es > span:before { background-position: -" + es_flags[esval][2] + "px 0 !important; } .weglot-flags.flag-3.es > a:before, .weglot-flags.flag-3.es > span:before { background-position: -" + es_flags[esval][3] + "px 0 !important; } ";
|
||||
var fr_style = frval <= 0 ? "" : ".weglot-flags.fr > a:before, .weglot-flags.fr > span:before { background-position: -" + fr_flags[frval][0] + "px 0 !important; } .weglot-flags.flag-1.fr > a:before, .weglot-flags.flag-1.fr > span:before { background-position: -" + fr_flags[frval][1] + "px 0 !important; } .weglot-flags.flag-2.fr > a:before, .weglot-flags.flag-2.fr > span:before { background-position: -" + fr_flags[frval][2] + "px 0 !important; } .weglot-flags.flag-3.fr > a:before, .weglot-flags.flag-3.fr > span:before { background-position: -" + fr_flags[frval][3] + "px 0 !important; } ";
|
||||
var ar_style = arval <= 0 ? "" : ".weglot-flags.ar > a:before, .weglot-flags.ar > span:before { background-position: -" + ar_flags[arval][0] + "px 0 !important; } .weglot-flags.flag-1.ar > a:before, .weglot-flags.flag-1.ar > span:before { background-position: -" + ar_flags[arval][1] + "px 0 !important; } .weglot-flags.flag-2.ar > a:before, .weglot-flags.flag-2.ar > span:before { background-position: -" + ar_flags[arval][2] + "px 0 !important; } .weglot-flags.flag-3.ar > a:before, .weglot-flags.flag-3.ar > span:before { background-position: -" + ar_flags[arval][3] + "px 0 !important; } ";
|
||||
var tw_style = twval <= 0 ? "" : ".weglot-flags.tw > a:before, .weglot-flags.tw > span:before { background-position: -" + tw_flags[twval][0] + "px 0 !important; } .weglot-flags.flag-1.tw > a:before, .weglot-flags.flag-1.tw > span:before { background-position: -" + tw_flags[twval][1] + "px 0 !important; } .weglot-flags.flag-2.tw > a:before, .weglot-flags.flag-2.tw > span:before { background-position: -" + tw_flags[twval][2] + "px 0 !important; } .weglot-flags.flag-3.tw > a:before, .weglot-flags.flag-3.tw > span:before { background-position: -" + tw_flags[twval][3] + "px 0 !important; } ";
|
||||
var zh_style = zhval <= 0 ? "" : ".weglot-flags.zh > a:before, .weglot-flags.zh > span:before { background-position: -" + zh_flags[zhval][0] + "px 0 !important; } .weglot-flags.flag-1.zh > a:before, .weglot-flags.flag-1.zh > span:before { background-position: -" + zh_flags[zhval][1] + "px 0 !important; } .weglot-flags.flag-2.zh > a:before, .weglot-flags.flag-2.zh > span:before { background-position: -" + zh_flags[zhval][2] + "px 0 !important; } .weglot-flags.flag-3.zh > a:before, .weglot-flags.flag-3.zh > span:before { background-position: -" + zh_flags[zhval][3] + "px 0 !important; } ";
|
||||
var pt_style = ptval <= 0 ? "" : ".weglot-flags.pt > a:before, .weglot-flags.pt > span:before { background-position: -" + pt_flags[ptval][0] + "px 0 !important; } .weglot-flags.flag-1.pt > a:before, .weglot-flags.flag-1.pt > span:before { background-position: -" + pt_flags[ptval][1] + "px 0 !important; } .weglot-flags.flag-2.pt > a:before, .weglot-flags.flag-2.pt > span:before { background-position: -" + pt_flags[ptval][2] + "px 0 !important; } .weglot-flags.flag-3.pt > a:before, .weglot-flags.flag-3.pt > span:before { background-position: -" + pt_flags[ptval][3] + "px 0 !important; } ";
|
||||
|
||||
$("#flag_css, #weglot-css-flag-css").text(en_style + es_style + fr_style + ar_style + tw_style + zh_style + pt_style);
|
||||
}
|
||||
|
||||
const execute = () => {
|
||||
|
||||
$('.flag-style-openclose').on('click',
|
||||
function () {
|
||||
$('.flag-style-wrapper').toggle();
|
||||
}
|
||||
);
|
||||
|
||||
$('.old-flag-style').on('click',
|
||||
function () {
|
||||
$('.old-flag-wrapper').toggle();
|
||||
}
|
||||
);
|
||||
|
||||
$("select.flag-en-type, select.flag-es-type, select.flag-pt-type, select.flag-fr-type, select.flag-ar-type, select.flag-tw-type, select.flag-zh-type").on('change',
|
||||
function () {
|
||||
refresh_flag_css()
|
||||
}
|
||||
);
|
||||
|
||||
var flag_css = $("#flag_css").text();
|
||||
if (flag_css.trim()) {
|
||||
$("#weglot-css-flag-css").text(flag_css);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
execute();
|
||||
});
|
||||
};
|
||||
|
||||
export default init_admin_change_country;
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
const init_admin_button_preview = function () {
|
||||
const $ = jQuery
|
||||
|
||||
const execute = () => {
|
||||
|
||||
$("#api_key_private").blur(function() {
|
||||
var key = $(this).val();
|
||||
if( key.length === 0){
|
||||
$(".weglot-keyres").remove();
|
||||
$("#api_key_private").after('<span class="weglot-keyres weglot-nokkey"></span>');
|
||||
$("#wrap-weglot #submit").prop("disabled", true);
|
||||
return;
|
||||
}
|
||||
|
||||
function validApiKey(response){
|
||||
|
||||
$(".weglot-keyres").remove();
|
||||
$("#api_key_private").after(
|
||||
'<span class="weglot-keyres weglot-okkey"></span>'
|
||||
);
|
||||
|
||||
$("#wrap-weglot #submit").prop(
|
||||
"disabled",
|
||||
false
|
||||
);
|
||||
|
||||
const evt = new CustomEvent("weglotCheckApi", {
|
||||
detail: response
|
||||
});
|
||||
|
||||
window.dispatchEvent(evt);
|
||||
}
|
||||
|
||||
function unvalidApiKey(){
|
||||
$(".weglot-keyres").remove();
|
||||
$("#api_key_private").after('<span class="weglot-keyres weglot-nokkey"></span><p class="weglot-keyres">Make sure you enter a valid Weglot API key. If the key is still not validating, you can contact your host provider and ask if it\'s possible to whitelist api.weglot.com and weglot.com</p>');
|
||||
$("#wrap-weglot #submit").prop("disabled", true);
|
||||
}
|
||||
|
||||
$(".weglot-keyres").remove();
|
||||
$("#api_key_private").after('<span class="weglot-keyres weglot-ckeckkey"></span>');
|
||||
|
||||
$.ajax(
|
||||
{
|
||||
method: 'POST',
|
||||
url: ajaxurl,
|
||||
data : {
|
||||
action: 'get_user_info',
|
||||
api_key: key,
|
||||
},
|
||||
success: ({data, success}) => {
|
||||
$(".weglot-keyres").remove();
|
||||
if (success ){
|
||||
validApiKey(data)
|
||||
}
|
||||
else{
|
||||
unvalidApiKey()
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
).fail(function() {
|
||||
unvalidApiKey()
|
||||
});
|
||||
});
|
||||
|
||||
$( ".toplevel_page_weglot-settings form" ).submit(function( event ) {
|
||||
$("#wrap-weglot #submit").prop("disabled", true);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
execute();
|
||||
})
|
||||
}
|
||||
|
||||
export default init_admin_button_preview;
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
const init_admin_weglot_code_editor = function () {
|
||||
const $ = jQuery
|
||||
|
||||
const execute = () => {
|
||||
jQuery(document).ready(function($) {
|
||||
wp.codeEditor.initialize($('#override_css'), cm_settings);
|
||||
})
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
execute();
|
||||
})
|
||||
}
|
||||
|
||||
export default init_admin_weglot_code_editor;
|
||||
@@ -0,0 +1,31 @@
|
||||
const init_private_mode = function () {
|
||||
|
||||
const $ = jQuery
|
||||
|
||||
const execute = () => {
|
||||
document.querySelector("#private_mode").addEventListener('change', function(e) {
|
||||
|
||||
document.querySelectorAll(".private-mode-lang--input").forEach((itm) => {
|
||||
itm.checked = e.target.checked;
|
||||
})
|
||||
})
|
||||
|
||||
document.querySelectorAll(".private-mode-lang--input").forEach((itm) => {
|
||||
itm.addEventListener('change', function(e){
|
||||
if (document.querySelectorAll(".private-mode-lang--input:checked").length === 0){
|
||||
document.querySelector("#private_mode").checked = false
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const private_mode = document.querySelector("#private_mode")
|
||||
if (private_mode && private_mode.length != 0){
|
||||
execute();
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export default init_private_mode;
|
||||
|
||||
@@ -0,0 +1,131 @@
|
||||
const init_admin_select = function(){
|
||||
|
||||
const $ = jQuery
|
||||
const generate_destination_language = () => {
|
||||
return weglot_languages.available.filter(itm => {
|
||||
return itm.internal_code !== $("#original_language").val()
|
||||
});
|
||||
}
|
||||
|
||||
let destination_selectize
|
||||
|
||||
const load_destination_selectize = () => {
|
||||
destination_selectize = $(".weglot-select-destination")
|
||||
.selectize({
|
||||
delimiter: "|",
|
||||
persist: false,
|
||||
valueField: "internal_code",
|
||||
labelField: "local",
|
||||
searchField: ["internal_code", "english", "local"],
|
||||
sortField: [{ field: "english", direction: "asc" }],
|
||||
maxItems: weglot_languages.limit,
|
||||
plugins: ["remove_button"],
|
||||
options: generate_destination_language(),
|
||||
render: {
|
||||
option: function(item, escape) {
|
||||
var english = escape(item.english);
|
||||
var local = escape(item.local);
|
||||
var external = escape(item.external_code);
|
||||
return `<div class="weglot__choice__language"><span class="weglot__choice__language--english">${english}</span><span class="weglot__choice__language--local">${local}[${external}]</span></div>`;
|
||||
}
|
||||
}
|
||||
})
|
||||
.on("change", (value) => {
|
||||
const code_languages = destination_selectize[0].selectize.getValue()
|
||||
|
||||
const template = $("#li-button-tpl");
|
||||
|
||||
if (template.length === 0){
|
||||
return;
|
||||
}
|
||||
|
||||
const is_fullname = $("#is_fullname").is(":checked")
|
||||
const with_name = $("#with_name").is(":checked")
|
||||
const with_flags = $("#with_flags").is(":checked")
|
||||
|
||||
let classes = ''
|
||||
if (with_flags) {
|
||||
classes = "weglot-flags";
|
||||
}
|
||||
|
||||
let new_dest_language = ''
|
||||
var currentFlagClasses = $("label.weglot-flags").attr("class")
|
||||
var classArr = currentFlagClasses.split(/\s+/);
|
||||
$.each(classArr, function(index, value){
|
||||
if(value.includes('flag-') == true){
|
||||
classes += ' '+value;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
code_languages.forEach(element => {
|
||||
const language = weglot_languages.available.find(itm => itm.internal_code === element);
|
||||
let label = ''
|
||||
if(with_name){
|
||||
if (is_fullname){
|
||||
label = language.local
|
||||
}
|
||||
else{
|
||||
label = element.toUpperCase()
|
||||
}
|
||||
}
|
||||
|
||||
new_dest_language += template
|
||||
.html()
|
||||
.replace("{LABEL_LANGUAGE}", label)
|
||||
.replace(new RegExp("{CODE_LANGUAGE}", "g"), element)
|
||||
.replace("{CLASSES}", classes)
|
||||
});
|
||||
$(".country-selector ul").html(new_dest_language) //phpcs:ignore
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
const execute = () => {
|
||||
let work_original_language = $("#original_language").val()
|
||||
|
||||
$("#original_language").on("change", function (e) {
|
||||
const old_original_language = work_original_language;
|
||||
const new_destination_option = work_original_language;
|
||||
work_original_language = e.target.value;
|
||||
destination_selectize[0].selectize.removeOption(work_original_language);
|
||||
|
||||
const new_option = weglot_languages.available.find(itm => {
|
||||
return itm.internal_code === new_destination_option
|
||||
});
|
||||
|
||||
const new_original_option = weglot_languages.available.find(itm => {
|
||||
return itm.internal_code === work_original_language;
|
||||
});
|
||||
|
||||
destination_selectize[0].selectize.addOption(new_option);
|
||||
|
||||
|
||||
const is_fullname = $("#is_fullname").is(":checked")
|
||||
const with_name = $("#with_name").is(":checked")
|
||||
let label = ''
|
||||
if(with_name){
|
||||
label = is_fullname ? new_original_option.local : new_original_option.internal_code.toUpperCase();
|
||||
}
|
||||
|
||||
$(".wgcurrent.wg-li")
|
||||
.removeClass(old_original_language)
|
||||
.addClass(work_original_language)
|
||||
.attr("data-code-language", work_original_language)
|
||||
.find('span').text(label)
|
||||
});
|
||||
|
||||
|
||||
load_destination_selectize();
|
||||
|
||||
window.addEventListener("weglotCheckApi", (data) => {
|
||||
destination_selectize[0].selectize.settings.maxItems = weglot_languages.limit;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
execute();
|
||||
})
|
||||
}
|
||||
|
||||
export default init_admin_select;
|
||||
@@ -0,0 +1,49 @@
|
||||
const init_admin_weglot_box = function () {
|
||||
const $ = jQuery
|
||||
|
||||
const execute = () => {
|
||||
$("#weglot-box-first-settings .weglot-btn-close").on("click", function (e) {
|
||||
e.preventDefault();
|
||||
$("#weglot-box-first-settings").hide();
|
||||
})
|
||||
|
||||
$('a[href*="#"]')
|
||||
// Remove links that don't actually link to anything
|
||||
.not('[href="#"]')
|
||||
.not('[href="#0"]')
|
||||
.click(function (event) {
|
||||
// On-page links
|
||||
// Figure out element to scroll to
|
||||
var target = $(this.hash);
|
||||
target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
|
||||
// Does a scroll target exist?
|
||||
if (target.length) {
|
||||
// Only prevent default if animation is actually gonna happen
|
||||
event.preventDefault();
|
||||
$('html, body').animate({
|
||||
scrollTop: target.offset().top
|
||||
}, 1000, function () {
|
||||
// Callback after animation
|
||||
// Must change focus!
|
||||
var $target = $(target);
|
||||
$target.focus();
|
||||
if ($target.is(":focus")) { // Checking if the target was focused
|
||||
return false;
|
||||
} else {
|
||||
$target.attr('tabindex', '-1'); // Adding tabindex for elements not focusable
|
||||
$target.focus(); // Set focus again
|
||||
}
|
||||
;
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
execute();
|
||||
})
|
||||
}
|
||||
|
||||
export default init_admin_weglot_box;
|
||||
|
||||
BIN
wp-content/plugins/weglot/app/static/weglot_fav.png
Normal file
|
After Width: | Height: | Size: 618 B |
BIN
wp-content/plugins/weglot/app/static/weglot_fav_bw.png
Normal file
|
After Width: | Height: | Size: 450 B |
3
wp-content/plugins/weglot/app/styles/_colors.scss
Normal file
@@ -0,0 +1,3 @@
|
||||
$primary: #335ee2;
|
||||
$primaryHover: #446dea;
|
||||
$textColor: #24284c;
|
||||
445
wp-content/plugins/weglot/app/styles/_flags.scss
Normal file
@@ -0,0 +1,445 @@
|
||||
.weglot-flags {
|
||||
&.hw > a:before, &.hw > span:before { background-position: -3570px 0 !important; }
|
||||
&.af > a:before, &.af > span:before { background-position: -6570px 0 !important; }
|
||||
&.fl > a:before, &.fl > span:before { background-position: -3060px 0 !important; }
|
||||
&.sq > a:before, &.sq > span:before { background-position: -2580px 0 !important; }
|
||||
&.am > a:before, &.am > span:before { background-position: -5130px 0 !important; }
|
||||
&.ar > a:before, &.ar > span:before { background-position: -510px 0 !important; }
|
||||
&.hy > a:before, &.hy > span:before { background-position: -1800px 0 !important; }
|
||||
&.az > a:before, &.az > span:before { background-position: -6840px 0 !important; }
|
||||
&.ba > a:before, &.ba > span:before { background-position: -2040px 0 !important; }
|
||||
&.eu > a:before, &.eu > span:before { background-position: -7260px 0 !important; }
|
||||
&.be > a:before, &.be > span:before { background-position: -5310px 0 !important; }
|
||||
&.bn > a:before, &.bn > span:before { background-position: -5400px 0 !important; }
|
||||
&.bs > a:before, &.bs > span:before { background-position: -6390px 0 !important; }
|
||||
&.bg > a:before, &.bg > span:before { background-position: -2730px 0 !important; }
|
||||
&.br > a:before, &.br > span:before { background-position: -6630px 0 !important; }
|
||||
&.my > a:before, &.my > span:before { background-position: -3299px 0 !important; }
|
||||
&.ca > a:before, &.ca > span:before { background-position: -7230px 0 !important; }
|
||||
&.zh > a:before, &.zh > span:before { background-position: -3690px 0 !important; }
|
||||
&.tw > a:before, &.tw > span:before { background-position: -2970px 0 !important; }
|
||||
&.km > a:before, &.km > span:before { background-position: -6930px 0 !important; }
|
||||
&.ny > a:before, &.ny > span:before { background-position: -1140px 0 !important; }
|
||||
&.co > a:before, &.co > span:before { background-position: -2520px 0 !important; } /* TODO */
|
||||
&.hr > a:before, &.hr > span:before { background-position: -5910px 0 !important; }
|
||||
&.cs > a:before, &.cs > span:before { background-position: -2700px 0 !important; }
|
||||
&.da > a:before, &.da > span:before { background-position: -2670px 0 !important; }
|
||||
&.nl > a:before, &.nl > span:before { background-position: -2100px 0 !important; }
|
||||
&.en > a:before, &.en > span:before { background-position: -1920px 0 !important; }
|
||||
&.eo > a:before, &.eo > span:before { background-position: -1920px 0 !important; } /* TODO */
|
||||
&.et > a:before, &.et > span:before { background-position: -2640px 0 !important; }
|
||||
&.fj > a:before, &.fj > span:before { background-position: -1710px 0 !important; }
|
||||
&.fi > a:before, &.fi > span:before { background-position: -2550px 0 !important; }
|
||||
&.fr > a:before, &.fr > span:before { background-position: -2520px 0 !important; }
|
||||
&.gl > a:before, &.gl > span:before { background-position: -7290px 0 !important; }
|
||||
&.ka > a:before, &.ka > span:before { background-position: -5040px 0 !important; }
|
||||
&.de > a:before, &.de > span:before { background-position: -2490px 0 !important; }
|
||||
&.el > a:before, &.el > span:before { background-position: -2460px 0 !important; }
|
||||
&.gu > a:before, &.gu > span:before { background-position: -1170px 0 !important; }
|
||||
&.ht > a:before, &.ht > span:before { background-position: -4650px 0 !important; }
|
||||
&.ha > a:before, &.ha > span:before { background-position: -900px 0 !important; }
|
||||
&.he > a:before, &.he > span:before { background-position: -1050px 0 !important; }
|
||||
&.hi > a:before, &.hi > span:before { background-position: -1170px 0 !important; }
|
||||
&.hu > a:before, &.hu > span:before { background-position: -2430px 0 !important; }
|
||||
&.is > a:before, &.is > span:before { background-position: -2400px 0 !important; }
|
||||
&.ig > a:before, &.ig > span:before { background-position: -870px 0 !important; }
|
||||
&.id > a:before, &.id > span:before { background-position: -3510px 0 !important; }
|
||||
&.ga > a:before, &.ga > span:before { background-position: -2340px 0 !important; }
|
||||
&.it > a:before, &.it > span:before { background-position: -2310px 0 !important; }
|
||||
&.ja > a:before, &.ja > span:before { background-position: -3480px 0 !important; }
|
||||
&.jv > a:before, &.jv > span:before { background-position: -3360px 0 !important; }
|
||||
&.kn > a:before, &.kn > span:before { background-position: -1170px 0 !important; }
|
||||
&.kk > a:before, &.kk > span:before { background-position: -3150px 0 !important; }
|
||||
&.ko > a:before, &.ko > span:before { background-position: -6990px 0 !important; }
|
||||
&.ku > a:before, &.ku > span:before { background-position: -2430px 0 !important; } /* TODO */
|
||||
&.ky > a:before, &.ky > span:before { background-position: -3420px 0 !important; }
|
||||
&.lo > a:before, &.lo > span:before { background-position: -3450px 0 !important; } /* TODO */
|
||||
&.la > a:before, &.la > span:before { background-position: -2310px 0 !important; }
|
||||
&.lv > a:before, &.lv > span:before { background-position: -2280px 0 !important; }
|
||||
&.lt > a:before, &.lt > span:before { background-position: -2250px 0 !important; }
|
||||
&.lb > a:before, &.lb > span:before { background-position: -2220px 0 !important; }
|
||||
&.mk > a:before, &.mk > span:before { background-position: -2190px 0 !important; }
|
||||
&.mg > a:before, &.mg > span:before { background-position: -1200px 0 !important; }
|
||||
&.ms > a:before, &.ms > span:before { background-position: -3360px 0 !important; }
|
||||
&.ml > a:before, &.ml > span:before { background-position: -1170px 0 !important; }
|
||||
&.mt > a:before, &.mt > span:before { background-position: -2130px 0 !important; }
|
||||
&.mi > a:before, &.mi > span:before { background-position: -3240px 0 !important; }
|
||||
&.mr > a:before, &.mr > span:before { background-position: -1170px 0 !important; }
|
||||
&.mn > a:before, &.mn > span:before { background-position: -6000px 0 !important; }
|
||||
&.ne > a:before, &.ne > span:before { background-position: -3270px 0 !important; }
|
||||
&.no > a:before, &.no > span:before { background-position: -5850px 0 !important; }
|
||||
&.ps > a:before, &.ps > span:before { background-position: -5189px 0 !important; }
|
||||
&.fa > a:before, &.fa > span:before { background-position: -6690px 0 !important; }
|
||||
&.pl > a:before, &.pl > span:before { background-position: -2160px 0 !important; }
|
||||
&.pt > a:before, &.pt > span:before { background-position: -1740px 0 !important; }
|
||||
&.pa > a:before, &.pa > span:before { background-position: -3180px 0 !important; }
|
||||
&.ro > a:before, &.ro > span:before { background-position: -2070px 0 !important; }
|
||||
&.ru > a:before, &.ru > span:before { background-position: -2040px 0 !important; }
|
||||
&.sm > a:before, &.sm > span:before { background-position: -4620px 0 !important; }
|
||||
&.gd > a:before, &.gd > span:before { background-position: -30px 0 !important; }
|
||||
&.sr > a:before, &.sr > span:before { background-position: -4290px 0 !important; }
|
||||
&.sn > a:before, &.sn > span:before { background-position: -540px 0 !important; }
|
||||
&.sd > a:before, &.sd > span:before { background-position: -3180px 0 !important; }
|
||||
&.si > a:before, &.si > span:before { background-position: -2820px 0 !important; }
|
||||
&.sk > a:before, &.sk > span:before { background-position: -6810px 0 !important; }
|
||||
&.sl > a:before, &.sl > span:before { background-position: -2010px 0 !important; }
|
||||
&.so > a:before, &.so > span:before { background-position: -4560px 0 !important; }
|
||||
&.st > a:before, &.st > span:before { background-position: -4830px 0 !important; }
|
||||
&.es > a:before, &.es > span:before { background-position: -480px 0 !important; }
|
||||
&.su > a:before, &.su > span:before { background-position: -4530px 0 !important; }
|
||||
&.sw > a:before, &.sw > span:before { background-position: -1290px 0 !important; }
|
||||
&.sv > a:before, &.sv > span:before { background-position: -1980px 0 !important; }
|
||||
&.tl > a:before, &.tl > span:before { background-position: -3060px 0 !important; }
|
||||
&.ty > a:before, &.ty > span:before { background-position: -6270px 0 !important; }
|
||||
&.tg > a:before, &.tg > span:before { background-position: -2940px 0 !important; }
|
||||
&.ta > a:before, &.ta > span:before { background-position: -1170px 0 !important; }
|
||||
&.tt > a:before, &.tt > span:before { background-position: -2040px 0 !important; }
|
||||
&.te > a:before, &.te > span:before { background-position: -1170px 0 !important; }
|
||||
&.th > a:before, &.th > span:before { background-position: -2910px 0 !important; }
|
||||
&.to > a:before, &.to > span:before { background-position: -6540px 0 !important; }
|
||||
&.tr > a:before, &.tr > span:before { background-position: -1950px 0 !important; }
|
||||
&.uk > a:before, &.uk > span:before { background-position: -1890px 0 !important; }
|
||||
&.ur > a:before, &.ur > span:before { background-position: -3180px 0 !important; }
|
||||
&.uz > a:before, &.uz > span:before { background-position: -2880px 0 !important; }
|
||||
&.vi > a:before, &.vi > span:before { background-position: -2850px 0 !important; }
|
||||
&.cy > a:before, &.cy > span:before { background-position: -6420px 0 !important; }
|
||||
&.fy > a:before, &.fy > span:before { background-position: -2100px 0 !important; }
|
||||
&.xh > a:before, &.xh > span:before { background-position: -6570px 0 !important; }
|
||||
&.yi > a:before, &.yi > span:before { background-position: -1050px 0 !important; }
|
||||
&.yo > a:before, &.yo > span:before { background-position: -870px 0 !important; }
|
||||
&.zu > a:before, &.zu > span:before { background-position: -6570px 0 !important; }
|
||||
|
||||
&.flag-1 {
|
||||
&.hw > a:before, &.hw > span:before { background-position: -7840px 0 !important; }
|
||||
&.fl > a:before, &.fl > span:before { background-position: 2560px 0 !important; }
|
||||
&.af > a:before, &.af > span:before { background-position: -6848px 0 !important; }
|
||||
&.sq > a:before, &.sq > span:before { background-position: -97px 0 !important; }
|
||||
&.am > a:before, &.am > span:before { background-position: -2369px 0 !important; }
|
||||
&.ar > a:before, &.ar > span:before { background-position: -6465px 0 !important; }
|
||||
&.hy > a:before, &.hy > span:before { background-position: -385px 0 !important; }
|
||||
&.az > a:before, &.az > span:before { background-position: -513px 0 !important; }
|
||||
&.ba > a:before, &.ba > span:before { background-position: -6113px 0 !important; }
|
||||
&.eu > a:before, &.eu > span:before { background-position: -8353px 0 !important; }
|
||||
&.be > a:before, &.be > span:before { background-position: -705px 0 !important; }
|
||||
&.bn > a:before, &.bn > span:before { background-position: -609px 0 !important; }
|
||||
&.bs > a:before, &.bs > span:before { background-position: -929px 0 !important; }
|
||||
&.bg > a:before, &.bg > span:before { background-position: -1121px 0 !important; }
|
||||
&.br > a:before, &.br > span:before { background-position: -993px 0 !important; }
|
||||
&.my > a:before, &.my > span:before { background-position: -4929px 0 !important; }
|
||||
&.ca > a:before, &.ca > span:before { background-position: -8321px 0 !important; }
|
||||
&.zh > a:before, &.zh > span:before { background-position: -1505px 0 !important; }
|
||||
&.tw > a:before, &.tw > span:before { background-position: -6369px 0 !important; }
|
||||
&.km > a:before, &.km > span:before { background-position: -1217px 0 !important; }
|
||||
&.ny > a:before, &.ny > span:before { background-position: -4289px 0 !important; }
|
||||
&.co > a:before, &.co > span:before { background-position: -2561px 0 !important; }
|
||||
&.hr > a:before, &.hr > span:before { background-position: -1793px 0 !important; }
|
||||
&.cs > a:before, &.cs > span:before { background-position: -1921px 0 !important; }
|
||||
&.da > a:before, &.da > span:before { background-position: -1985px 0 !important; }
|
||||
&.nl > a:before, &.nl > span:before { background-position: -5121px 0 !important; }
|
||||
&.en > a:before, &.en > span:before { background-position: -7777px 0 !important; }
|
||||
&.eo > a:before, &.eo > span:before { background-position: -7777px 0 !important; }
|
||||
&.et > a:before, &.et > span:before { background-position: -2337px 0 !important; }
|
||||
&.fj > a:before, &.fj > span:before { background-position: -2497px 0 !important; }
|
||||
&.fi > a:before, &.fi > span:before { background-position: -2529px 0 !important; }
|
||||
&.fr > a:before, &.fr > span:before { background-position: -2561px 0 !important; }
|
||||
&.gl > a:before, &.gl > span:before { background-position: -8383px 0 !important; }
|
||||
&.ka > a:before, &.ka > span:before { background-position: -2721px 0 !important; }
|
||||
&.de > a:before, &.de > span:before { background-position: -2753px 0 !important; }
|
||||
&.el > a:before, &.el > span:before { background-position: -2881px 0 !important; }
|
||||
&.gu > a:before, &.gu > span:before { background-position: -3329px 0 !important; }
|
||||
&.ht > a:before, &.ht > span:before { background-position: -3169px 0 !important; }
|
||||
&.ha > a:before, &.ha > span:before { background-position: -5281px 0 !important; }
|
||||
&.he > a:before, &.he > span:before { background-position: -3521px 0 !important; }
|
||||
&.hi > a:before, &.hi > span:before { background-position: -3329px 0 !important; }
|
||||
&.hu > a:before, &.hu > span:before { background-position: -3265px 0 !important; }
|
||||
&.is > a:before, &.is > span:before { background-position: -3297px 0 !important; }
|
||||
&.ig > a:before, &.ig > span:before { background-position: -5313px 0 !important; }
|
||||
&.id > a:before, &.id > span:before { background-position: -3361px 0 !important; }
|
||||
&.ga > a:before, &.ga > span:before { background-position: -3457px 0 !important; }
|
||||
&.it > a:before, &.it > span:before { background-position: -3553px 0 !important; }
|
||||
&.ja > a:before, &.ja > span:before { background-position: -3617px 0 !important; }
|
||||
&.jv > a:before, &.jv > span:before { background-position: -4321px 0 !important; }
|
||||
&.kn > a:before, &.kn > span:before { background-position: -3329px 0 !important; }
|
||||
&.kk > a:before, &.kk > span:before { background-position: -3713px 0 !important; }
|
||||
&.ko > a:before, &.ko > span:before { background-position: -6913px 0 !important; }
|
||||
&.ku > a:before, &.ku > span:before { background-position: -3265px 0 !important; }
|
||||
&.ky > a:before, &.ky > span:before { background-position: -3873px 0 !important; }
|
||||
&.lo > a:before, &.lo > span:before { background-position: -3904px 0 !important; }
|
||||
&.la > a:before, &.la > span:before { background-position: -3553px 0 !important; }
|
||||
&.lv > a:before, &.lv > span:before { background-position: -3937px 0 !important; }
|
||||
&.lt > a:before, &.lt > span:before { background-position: -4129px 0 !important; }
|
||||
&.lb > a:before, &.lb > span:before { background-position: -4161px 0 !important; }
|
||||
&.mk > a:before, &.mk > span:before { background-position: -4225px 0 !important; }
|
||||
&.mg > a:before, &.mg > span:before { background-position: -4257px 0 !important; }
|
||||
&.ms > a:before, &.ms > span:before { background-position: -4321px 0 !important; }
|
||||
&.ml > a:before, &.ml > span:before { background-position: -3329px 0 !important; }
|
||||
&.mt > a:before, &.mt > span:before { background-position: -4417px 0 !important; }
|
||||
&.mi > a:before, &.mi > span:before { background-position: -5217px 0 !important; }
|
||||
&.mr > a:before, &.mr > span:before { background-position: -3329px 0 !important; }
|
||||
&.mn > a:before, &.mn > span:before { background-position: -4769px 0 !important; }
|
||||
&.ne > a:before, &.ne > span:before { background-position: -5091px 0 !important; }
|
||||
&.no > a:before, &.no > span:before { background-position: -5505px 0 !important; }
|
||||
&.ps > a:before, &.ps > span:before { background-position: -33px 0 !important; }
|
||||
&.fa > a:before, &.fa > span:before { background-position: -3393px 0 !important; }
|
||||
&.pl > a:before, &.pl > span:before { background-position: -5889px 0 !important; }
|
||||
&.pt > a:before, &.pt > span:before { background-position: -5921px 0 !important; }
|
||||
&.pa > a:before, &.pa > span:before { background-position: -3329px 0 !important; }
|
||||
&.ro > a:before, &.ro > span:before { background-position: -6081px 0 !important; }
|
||||
&.ru > a:before, &.ru > span:before { background-position: -6113px 0 !important; }
|
||||
&.sm > a:before, &.sm > span:before { background-position: -6369px 0 !important; }
|
||||
&.gd > a:before, &.gd > span:before { background-position: -6497px 0 !important; }
|
||||
&.sr > a:before, &.sr > span:before { background-position: -6561px 0 !important; }
|
||||
&.sn > a:before, &.sn > span:before { background-position: -8287px 0 !important; }
|
||||
&.sd > a:before, &.sd > span:before { background-position: -5601px 0 !important; }
|
||||
&.si > a:before, &.si > span:before { background-position: -7039px 0 !important; }
|
||||
&.sk > a:before, &.sk > span:before { background-position: -6689px 0 !important; }
|
||||
&.sl > a:before, &.sl > span:before { background-position: -6721px 0 !important; }
|
||||
&.so > a:before, &.so > span:before { background-position: -6785px 0 !important; }
|
||||
&.st > a:before, &.st > span:before { background-position: -4001px 0 !important; }
|
||||
&.es > a:before, &.es > span:before { background-position: -7009px 0 !important; }
|
||||
&.su > a:before, &.su > span:before { background-position: -7073px 0 !important; }
|
||||
&.sw > a:before, &.sw > span:before { background-position: -3745px 0 !important; }
|
||||
&.sv > a:before, &.sv > span:before { background-position: -7169px 0 !important; }
|
||||
&.tl > a:before, &.tl > span:before { background-position: -5823px 0 !important; }
|
||||
&.ty > a:before, &.ty > span:before { background-position: -2593px 0 !important; }
|
||||
&.tg > a:before, &.tg > span:before { background-position: -7297px 0 !important; }
|
||||
&.ta > a:before, &.ta > span:before { background-position: -3329px 0 !important; }
|
||||
&.tt > a:before, &.tt > span:before { background-position: -6113px 0 !important; }
|
||||
&.te > a:before, &.te > span:before { background-position: -3329px 0 !important; }
|
||||
&.th > a:before, &.th > span:before { background-position: -7361px 0 !important; }
|
||||
&.to > a:before, &.to > span:before { background-position: -7456px 0 !important; }
|
||||
&.tr > a:before, &.tr > span:before { background-position: -7553px 0 !important; }
|
||||
&.uk > a:before, &.uk > span:before { background-position: -7713px 0 !important; }
|
||||
&.ur > a:before, &.ur > span:before { background-position: -5600px 0 !important; }
|
||||
&.uz > a:before, &.uz > span:before { background-position: -7969px 0 !important; }
|
||||
&.vi > a:before, &.vi > span:before { background-position: -8097px 0 !important; }
|
||||
&.cy > a:before, &.cy > span:before { background-position: -8129px 0 !important; }
|
||||
&.fy > a:before, &.fy > span:before { background-position: -5121px 0 !important; }
|
||||
&.xh > a:before, &.xh > span:before { background-position: -6848px 0 !important; }
|
||||
&.yi > a:before, &.yi > span:before { background-position: -3521px 0 !important; }
|
||||
&.yo > a:before, &.yo > span:before { background-position: -5313px 0 !important; }
|
||||
&.zu > a:before, &.zu > span:before { background-position: -6848px 0 !important; }
|
||||
}
|
||||
&.flag-2 {
|
||||
&.hw > a:before, &.hw > span:before { background-position: -5448px 0 !important; }
|
||||
&.fl > a:before, &.fl > span:before { background-position: -1008px 0 !important; }
|
||||
&.af > a:before, &.af > span:before { background-position: -4968px 0 !important; }
|
||||
&.sq > a:before, &.sq > span:before { background-position: -2976px 0 !important; }
|
||||
&.am > a:before, &.am > span:before { background-position: -3816px 0 !important; }
|
||||
&.ar > a:before, &.ar > span:before { background-position: -768px 0 !important; }
|
||||
&.hy > a:before, &.hy > span:before { background-position: 0 0 !important; }
|
||||
&.az > a:before, &.az > span:before { background-position: -5136px 0 !important; }
|
||||
&.ba > a:before, &.ba > span:before { background-position: -936px 0 !important; }
|
||||
&.eu > a:before, &.eu > span:before { background-position: -5376px 0 !important; }
|
||||
&.be > a:before, &.be > span:before { background-position: -4224px 0 !important; }
|
||||
&.bn > a:before, &.bn > span:before { background-position: -4056px 0 !important; }
|
||||
&.bs > a:before, &.bs > span:before { background-position: -3984px 0 !important; }
|
||||
&.bg > a:before, &.bg > span:before { background-position: -5040px 0 !important; }
|
||||
&.br > a:before, &.br > span:before { background-position: -2784px 0 !important; }
|
||||
&.my > a:before, &.my > span:before { background-position: -1248px 0 !important; }
|
||||
&.ca > a:before, &.ca > span:before { background-position: -5352px 0 !important; }
|
||||
&.zh > a:before, &.zh > span:before { background-position: -2592px 0 !important; }
|
||||
&.tw > a:before, &.tw > span:before { background-position: -3408px 0 !important; }
|
||||
&.km > a:before, &.km > span:before { background-position: -5160px 0 !important; }
|
||||
&.ny > a:before, &.ny > span:before { background-position: -1392px 0 !important; }
|
||||
&.co > a:before, &.co > span:before { background-position: -2304px 0 !important; }
|
||||
&.hr > a:before, &.hr > span:before { background-position: -4416px 0 !important; }
|
||||
&.cs > a:before, &.cs > span:before { background-position: -2472px 0 !important; }
|
||||
&.da > a:before, &.da > span:before { background-position: -2448px 0 !important; }
|
||||
&.nl > a:before, &.nl > span:before { background-position: -1296px 0 !important; }
|
||||
&.en > a:before, &.en > span:before { background-position: -312px 0 !important; }
|
||||
&.eo > a:before, &.eo > span:before { background-position: -312px 0 !important; } /* TODO */
|
||||
&.et > a:before, &.et > span:before { background-position: -2424px 0 !important; }
|
||||
&.fj > a:before, &.fj > span:before { background-position: -576px 0 !important; }
|
||||
&.fi > a:before, &.fi > span:before { background-position: -2328px 0 !important; }
|
||||
&.fr > a:before, &.fr > span:before { background-position: -2304px 0 !important; }
|
||||
&.gl > a:before, &.gl > span:before { background-position: -5400px 0 !important; }
|
||||
&.ka > a:before, &.ka > span:before { background-position: -3744px 0 !important; }
|
||||
&.de > a:before, &.de > span:before { background-position: -2256px 0 !important; }
|
||||
&.el > a:before, &.el > span:before { background-position: -2208px 0 !important; }
|
||||
&.gu > a:before, &.gu > span:before { background-position: -1728px 0 !important; }
|
||||
&.ht > a:before, &.ht > span:before { background-position: -3528px 0 !important; }
|
||||
&.ha > a:before, &.ha > span:before { background-position: -1176px 0 !important; }
|
||||
&.he > a:before, &.he > span:before { background-position: -1992px 0 !important; }
|
||||
&.hi > a:before, &.hi > span:before { background-position: -1728px 0 !important; }
|
||||
&.hu > a:before, &.hu > span:before { background-position: -2088px 0 !important; }
|
||||
&.is > a:before, &.is > span:before { background-position: -2064px 0 !important; }
|
||||
&.ig > a:before, &.ig > span:before { background-position: -1103px 0 !important; }
|
||||
&.id > a:before, &.id > span:before { background-position: -2040px 0 !important; }
|
||||
&.ga > a:before, &.ga > span:before { background-position: -2016px 0 !important; }
|
||||
&.it > a:before, &.it > span:before { background-position: -1968px 0 !important; }
|
||||
&.ja > a:before, &.ja > span:before { background-position: -1920px 0 !important; }
|
||||
&.jv > a:before, &.jv > span:before { background-position: -1536px 0 !important; }
|
||||
&.kn > a:before, &.kn > span:before { background-position: -1728px 0 !important; }
|
||||
&.kk > a:before, &.kk > span:before { background-position: -1704px 0 !important; }
|
||||
&.ko > a:before, &.ko > span:before { background-position: -1848px 0 !important; }
|
||||
&.ku > a:before, &.ku > span:before { background-position: -2088px 0 !important; }
|
||||
&.ky > a:before, &.ky > span:before { background-position: -1800px 0 !important; }
|
||||
&.lo > a:before, &.lo > span:before { background-position: -1776px 0 !important; }
|
||||
&.la > a:before, &.la > span:before { background-position: -1968px 0 !important; }
|
||||
&.lv > a:before, &.lv > span:before { background-position: -1752px 0 !important; }
|
||||
&.lt > a:before, &.lt > span:before { background-position: -1656px 0 !important; }
|
||||
&.lb > a:before, &.lb > span:before { background-position: -1632px 0 !important; }
|
||||
&.mk > a:before, &.mk > span:before { background-position: -1440px 0 !important; }
|
||||
&.mg > a:before, &.mg > span:before { background-position: -1560px 0 !important; }
|
||||
&.ms > a:before, &.ms > span:before { background-position: -1536px 0 !important; }
|
||||
&.ml > a:before, &.ml > span:before { background-position: -1728px 0 !important; }
|
||||
&.mt > a:before, &.mt > span:before { background-position: -1200px 0 !important; }
|
||||
&.mi > a:before, &.mi > span:before { background-position: -1224px 0 !important; }
|
||||
&.mr > a:before, &.mr > span:before { background-position: -1728px 0 !important; }
|
||||
&.mn > a:before, &.mn > span:before { background-position: -4800px 0 !important; }
|
||||
&.ne > a:before, &.ne > span:before { background-position: -1320px 0 !important; }
|
||||
&.no > a:before, &.no > span:before { background-position: -4776px 0 !important; }
|
||||
&.ps > a:before, &.ps > span:before { background-position: -4008px 0 !important; }
|
||||
&.fa > a:before, &.fa > span:before { background-position: -5088px 0 !important; }
|
||||
&.pl > a:before, &.pl > span:before { background-position: -984px 0 !important; }
|
||||
&.pt > a:before, &.pt > span:before { background-position: -528px 0 !important; }
|
||||
&.pa > a:before, &.pa > span:before { background-position: -1728px 0 !important; }
|
||||
&.ro > a:before, &.ro > span:before { background-position: -960px 0 !important; }
|
||||
&.ru > a:before, &.ru > span:before { background-position: -936px 0 !important; }
|
||||
&.sm > a:before, &.sm > span:before { background-position: -3408px 0 !important; }
|
||||
&.gd > a:before, &.gd > span:before { background-position: -4872px 0 !important; }
|
||||
&.sr > a:before, &.sr > span:before { background-position: -3120px 0 !important; }
|
||||
&.sn > a:before, &.sn > span:before { background-position: -72px 0 !important; }
|
||||
&.sd > a:before, &.sd > span:before { background-position: -1128px 0 !important; }
|
||||
&.si > a:before, &.si > span:before { background-position: -480px 0 !important; }
|
||||
&.sk > a:before, &.sk > span:before { background-position: -4152px 0 !important; }
|
||||
&.sl > a:before, &.sl > span:before { background-position: -696px 0 !important; }
|
||||
&.so > a:before, &.so > span:before { background-position: -3336px 0 !important; }
|
||||
&.st > a:before, &.st > span:before { background-position: -3552px 0 !important; }
|
||||
&.es > a:before, &.es > span:before { background-position: -96px 0 !important; }
|
||||
&.su > a:before, &.su > span:before { background-position: -3312px 0 !important; }
|
||||
&.sw > a:before, &.sw > span:before { background-position: -1872px 0 !important; }
|
||||
&.sv > a:before, &.sv > span:before { background-position: -552px 0 !important; }
|
||||
&.tl > a:before, &.tl > span:before { background-position: -1008px 0 !important; }
|
||||
&.ty > a:before, &.ty > span:before { background-position: -4512px 0 !important; }
|
||||
&.tg > a:before, &.tg > span:before { background-position: -264px 0 !important; }
|
||||
&.ta > a:before, &.ta > span:before { background-position: -1728px 0 !important; }
|
||||
&.tt > a:before, &.tt > span:before { background-position: -936px 0 !important; }
|
||||
&.te > a:before, &.te > span:before { background-position: -1728px 0 !important; }
|
||||
&.th > a:before, &.th > span:before { background-position: -456px 0 !important; }
|
||||
&.to > a:before, &.to > span:before { background-position: -3264px 0 !important; }
|
||||
&.tr > a:before, &.tr > span:before { background-position: -360px 0 !important; }
|
||||
&.uk > a:before, &.uk > span:before { background-position: -288px 0 !important; }
|
||||
&.ur > a:before, &.ur > span:before { background-position: -1128px 0 !important; }
|
||||
&.uz > a:before, &.uz > span:before { background-position: -240px 0 !important; }
|
||||
&.vi > a:before, &.vi > span:before { background-position: -144px 0 !important; }
|
||||
&.cy > a:before, &.cy > span:before { background-position: -4848px 0 !important; }
|
||||
&.fy > a:before, &.fy > span:before { background-position: -1296px 0 !important; }
|
||||
&.xh > a:before, &.xh > span:before { background-position: -4968px 0 !important; }
|
||||
&.yi > a:before, &.yi > span:before { background-position: -1992px 0 !important; }
|
||||
&.yo > a:before, &.yo > span:before { background-position: -1103px 0 !important; }
|
||||
&.zu > a:before, &.zu > span:before { background-position: -4968px 0 !important; }
|
||||
}
|
||||
&.flag-3 {
|
||||
&.hw > a:before, &.hw > span:before { background-position: -2711px 0 !important; }
|
||||
&.fl > a:before, &.fl > span:before { background-position: -5232px 0 !important; }
|
||||
&.af > a:before, &.af > span:before { background-position: -5496px 0 !important; }
|
||||
&.sq > a:before, &.sq > span:before { background-position: -4776px 0 !important; }
|
||||
&.am > a:before, &.am > span:before { background-position: -192px 0 !important; }
|
||||
&.ar > a:before, &.ar > span:before { background-position: -3336px 0 !important; }
|
||||
&.hy > a:before, &.hy > span:before { background-position: -4632px 0 !important; }
|
||||
&.az > a:before, &.az > span:before { background-position: -4536px 0 !important; }
|
||||
&.ba > a:before, &.ba > span:before { background-position: -2664px 0 !important; }
|
||||
&.eu > a:before, &.eu > span:before { background-position: -5808px 0 !important; }
|
||||
&.be > a:before, &.be > span:before { background-position: -144px 0 !important; }
|
||||
&.bn > a:before, &.bn > span:before { background-position: -4488px 0 !important; }
|
||||
&.bs > a:before, &.bs > span:before { background-position: -4392px 0 !important; }
|
||||
&.bg > a:before, &.bg > span:before { background-position: -4296px 0 !important; }
|
||||
&.br > a:before, &.br > span:before { background-position: -4344px 0 !important; }
|
||||
&.my > a:before, &.my > span:before { background-position: -3769px 0 !important; }
|
||||
&.ca > a:before, &.ca > span:before { background-position: -5784px 0 !important; }
|
||||
&.zh > a:before, &.zh > span:before { background-position: -3240px 0 !important; }
|
||||
&.tw > a:before, &.tw > span:before { background-position: -4008px 0 !important; }
|
||||
&.km > a:before, &.km > span:before { background-position: -4201px 0 !important; }
|
||||
&.ny > a:before, &.ny > span:before { background-position: -384px 0 !important; }
|
||||
&.co > a:before, &.co > span:before { background-position: -2760px 0 !important; } /* TODO */
|
||||
&.hr > a:before, &.hr > span:before { background-position: -3048px 0 !important; }
|
||||
&.cs > a:before, &.cs > span:before { background-position: -5280px 0 !important; }
|
||||
&.da > a:before, &.da > span:before { background-position: -3024px 0 !important; }
|
||||
&.nl > a:before, &.nl > span:before { background-position: -3360px 0 !important; }
|
||||
&.en > a:before, &.en > span:before { background-position: -2520px 0 !important; }
|
||||
&.eo > a:before, &.eo > span:before { background-position: -2520px 0 !important; } /* TODO */
|
||||
&.et > a:before, &.et > span:before { background-position: -2856px 0 !important; }
|
||||
&.fj > a:before, &.fj > span:before { background-position: -0px 0 !important; }
|
||||
&.fi > a:before, &.fi > span:before { background-position: -2784px 0 !important; }
|
||||
&.fr > a:before, &.fr > span:before { background-position: -2760px 0 !important; }
|
||||
&.gl > a:before, &.gl > span:before { background-position: -5832px 0 !important; }
|
||||
&.ka > a:before, &.ka > span:before { background-position: -1536px 0 !important; }
|
||||
&.de > a:before, &.de > span:before { background-position: -1488px 0 !important; }
|
||||
&.el > a:before, &.el > span:before { background-position: -1416px 0 !important; }
|
||||
&.gu > a:before, &.gu > span:before { background-position: -2304px 0 !important; }
|
||||
&.ht > a:before, &.ht > span:before { background-position: -5160px 0 !important; }
|
||||
&.ha > a:before, &.ha > span:before { background-position: -361px 0 !important; }
|
||||
&.he > a:before, &.he > span:before { background-position: -1608px 0 !important; }
|
||||
&.hi > a:before, &.hi > span:before { background-position: -2304px 0 !important; }
|
||||
&.hu > a:before, &.hu > span:before { background-position: -1920px 0 !important; }
|
||||
&.is > a:before, &.is > span:before { background-position: -840px 0 !important; }
|
||||
&.ig > a:before, &.ig > span:before { background-position: -3457px 0 !important; }
|
||||
&.id > a:before, &.id > span:before { background-position: -4992px 0 !important; }
|
||||
&.ga > a:before, &.ga > span:before { background-position: -2016px 0 !important; }
|
||||
&.it > a:before, &.it > span:before { background-position: -336px 0 !important; }
|
||||
&.ja > a:before, &.ja > span:before { background-position: -2448px 0 !important; }
|
||||
&.jv > a:before, &.jv > span:before { background-position: -864px 0 !important; }
|
||||
&.kn > a:before, &.kn > span:before { background-position: -2304px 0 !important; }
|
||||
&.kk > a:before, &.kk > span:before { background-position: -3912px 0 !important; }
|
||||
&.ko > a:before, &.ko > span:before { background-position: -2256px 0 !important; }
|
||||
&.ku > a:before, &.ku > span:before { background-position: -1920px 0 !important; }
|
||||
&.ky > a:before, &.ky > span:before { background-position: -744px 0 !important; }
|
||||
&.lo > a:before, &.lo > span:before { background-position: -3816px 0 !important; }
|
||||
&.la > a:before, &.la > span:before { background-position: -336px 0 !important; }
|
||||
&.lv > a:before, &.lv > span:before { background-position: -216px 0 !important; }
|
||||
&.lt > a:before, &.lt > span:before { background-position: -1776px 0 !important; }
|
||||
&.lb > a:before, &.lb > span:before { background-position: -1945px 0 !important; }
|
||||
&.mk > a:before, &.mk > span:before { background-position: -2208px 0 !important; }
|
||||
&.mg > a:before, &.mg > span:before { background-position: -5064px 0 !important; }
|
||||
&.ms > a:before, &.ms > span:before { background-position: -864px 0 !important; }
|
||||
&.ml > a:before, &.ml > span:before { background-position: -2304px 0 !important; }
|
||||
&.mt > a:before, &.mt > span:before { background-position: -4920px 0 !important; }
|
||||
&.mi > a:before, &.mi > span:before { background-position: -2113px 0 !important; }
|
||||
&.mr > a:before, &.mr > span:before { background-position: -2304px 0 !important; }
|
||||
&.mn > a:before, &.mn > span:before { background-position: -24px 0 !important; }
|
||||
&.ne > a:before, &.ne > span:before { background-position: -5642px 0 !important; }
|
||||
&.no > a:before, &.no > span:before { background-position: -984px 0 !important; }
|
||||
&.ps > a:before, &.ps > span:before { background-position: -4753px 0 !important; }
|
||||
&.fa > a:before, &.fa > span:before { background-position: -816px 0 !important; }
|
||||
&.pl > a:before, &.pl > span:before { background-position: -4944px 0 !important; }
|
||||
&.pt > a:before, &.pt > span:before { background-position: -3504px 0 !important; }
|
||||
&.pa > a:before, &.pa > span:before { background-position: -2304px 0 !important; }
|
||||
&.ro > a:before, &.ro > span:before { background-position: -3744px 0 !important; }
|
||||
&.ru > a:before, &.ru > span:before { background-position: -2664px 0 !important; }
|
||||
&.sm > a:before, &.sm > span:before { background-position: -1248px 0 !important; }
|
||||
&.gd > a:before, &.gd > span:before { background-position: -3841px 0 !important; }
|
||||
&.sr > a:before, &.sr > span:before { background-position: -3312px 0 !important; }
|
||||
&.sn > a:before, &.sn > span:before { background-position: -5521px 0 !important; }
|
||||
&.sd > a:before, &.sd > span:before { background-position: -1993px 0 !important; }
|
||||
&.si > a:before, &.si > span:before { background-position: -2833px 0 !important; } /* TODO */
|
||||
&.sk > a:before, &.sk > span:before { background-position: -552px 0 !important; }
|
||||
&.sl > a:before, &.sl > span:before { background-position: -936px 0 !important; }
|
||||
&.so > a:before, &.so > span:before { background-position: -4032px 0 !important; }
|
||||
&.st > a:before, &.st > span:before { background-position: -3961px 0 !important; }
|
||||
&.es > a:before, &.es > span:before { background-position: -3576px 0 !important; }
|
||||
&.su > a:before, &.su > span:before { background-position: -3985px 0 !important; }
|
||||
&.sw > a:before, &.sw > span:before { background-position: -912px 0 !important; }
|
||||
&.sv > a:before, &.sv > span:before { background-position: -264px 0 !important; }
|
||||
&.tl > a:before, &.tl > span:before { background-position: -5232px 0 !important; }
|
||||
&.ty > a:before, &.ty > span:before { background-position: -1512px 0 !important; }
|
||||
&.tg > a:before, &.tg > span:before { background-position: -3720px 0 !important; }
|
||||
&.ta > a:before, &.ta > span:before { background-position: -2304px 0 !important; }
|
||||
&.tt > a:before, &.tt > span:before { background-position: -2664px 0 !important; }
|
||||
&.te > a:before, &.te > span:before { background-position: -2304px 0 !important; }
|
||||
&.th > a:before, &.th > span:before { background-position: -4848px 0 !important; }
|
||||
&.to > a:before, &.to > span:before { background-position: -1680px 0 !important; }
|
||||
&.tr > a:before, &.tr > span:before { background-position: -432px 0 !important; }
|
||||
&.uk > a:before, &.uk > span:before { background-position: -5736px 0 !important; }
|
||||
&.ur > a:before, &.ur > span:before { background-position: -1992px 0 !important; }
|
||||
&.uz > a:before, &.uz > span:before { background-position: -2160px 0 !important; }
|
||||
&.vi > a:before, &.vi > span:before { background-position: -3384px 0 !important; }
|
||||
&.cy > a:before, &.cy > span:before { background-position: -5040px 0 !important; }
|
||||
&.fy > a:before, &.fy > span:before { background-position: -3360px 0 !important; }
|
||||
&.xh > a:before, &.xh > span:before { background-position: -5496px 0 !important; }
|
||||
&.yi > a:before, &.yi > span:before { background-position: -1608px 0 !important; }
|
||||
&.yo > a:before, &.yo > span:before { background-position: -3457px 0 !important; }
|
||||
&.zu > a:before, &.zu > span:before { background-position: -5496px 0 !important; }
|
||||
}
|
||||
}
|
||||
535
wp-content/plugins/weglot/app/styles/admin.scss
Normal file
@@ -0,0 +1,535 @@
|
||||
@import "_colors.scss";
|
||||
@import "selectize.css";
|
||||
|
||||
$wp-color-red: #dc3232; // RGB(220,50,50)
|
||||
$wp-color-green: #46b450; // RGB(70, 180, 80)
|
||||
|
||||
#custom_flag_tips{
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
#weglot-url-translate,
|
||||
#wrap-weglot {
|
||||
/* Code Editor */
|
||||
.CodeMirror-placeholder {
|
||||
color: #c0c0c0;
|
||||
}
|
||||
|
||||
.CodeMirror-wrap {
|
||||
border-radius: 4px;
|
||||
border: 1px solid #c0c0c0;
|
||||
width: 100%;
|
||||
max-width: 550px;
|
||||
height: 200px;
|
||||
}
|
||||
/* End Code Editor */
|
||||
|
||||
.weglot__choice__language {
|
||||
border-bottom: 1px solid #eee;
|
||||
margin: 5px 0;
|
||||
|
||||
&--local {
|
||||
border-width: 50px;
|
||||
color: #a6a6a6;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
p.weglot-keyres {
|
||||
font-style: italic;
|
||||
color: #ff6464;
|
||||
}
|
||||
|
||||
.weglot_text_error {
|
||||
color: $wp-color-red;
|
||||
}
|
||||
|
||||
.weglot_reset {
|
||||
text-decoration: underline;
|
||||
font-style: italic;
|
||||
|
||||
&:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
.btn {
|
||||
background: $primary;
|
||||
display: inline-block;
|
||||
padding: 8px 10px;
|
||||
border-radius: 4px;
|
||||
transition: 0.2s background linear, 0.2s color linear,
|
||||
0.2s border linear, 0.2s text-shadow linear;
|
||||
outline: 0;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
text-rendering: optimizeLegibility;
|
||||
font-weight: 700;
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
box-shadow: none;
|
||||
white-space: nowrap;
|
||||
color: white;
|
||||
border: 1px solid $primary;
|
||||
|
||||
&.btn-soft {
|
||||
background-color: #fff;
|
||||
color: $textColor;
|
||||
border-radius: 4px;
|
||||
border: 1px solid #7e8993;
|
||||
line-height: 1.4em;
|
||||
|
||||
&.disable-btn{
|
||||
background: #eaeaea;
|
||||
opacity: 0.8;
|
||||
}
|
||||
}
|
||||
|
||||
&.btn-primary {
|
||||
&:active,
|
||||
&:focus,
|
||||
&:hover {
|
||||
border-color: $primaryHover;
|
||||
background-color: $primaryHover;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.js-btn-remove {
|
||||
border: none;
|
||||
background-color: #e35b5b;
|
||||
color: #fff;
|
||||
display: inline-block;
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
border-radius: 50%;
|
||||
cursor: pointer;
|
||||
transform: translateY(-5%);
|
||||
transition: opacity 175ms linear;
|
||||
outline: 0;
|
||||
padding: 0;
|
||||
margin: 4px 0;
|
||||
vertical-align: middle;
|
||||
|
||||
&:hover {
|
||||
background-color: #c62d2d;
|
||||
}
|
||||
}
|
||||
|
||||
.item-exclude {
|
||||
position: relative;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
&::-webkit-input-placeholder,
|
||||
&:-moz-placeholder,
|
||||
&::-moz-placeholder,
|
||||
&:-ms-input-placeholder {
|
||||
color: #c0c0c0;
|
||||
}
|
||||
|
||||
.sub-label {
|
||||
font-size: 13px;
|
||||
font-weight: normal;
|
||||
margin: 2px 0 0;
|
||||
color: #444;
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
.weglot-select-original {
|
||||
height: 36px !important;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.original-select,
|
||||
#type_flags {
|
||||
padding: 8px;
|
||||
height: 36px !important;
|
||||
width: 300px;
|
||||
}
|
||||
|
||||
#type_flags {
|
||||
width: 150px;
|
||||
}
|
||||
|
||||
.selectize-control.multi .selectize-input {
|
||||
border: 1px solid #7e8993;
|
||||
border-radius: 4px;
|
||||
box-shadow: unset;
|
||||
|
||||
& > div {
|
||||
background-color: #eff0ff;
|
||||
border: 1px solid #7e8993;
|
||||
border-radius: 2px;
|
||||
|
||||
.remove {
|
||||
border-left-color: #7e8993;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.wg-input-textarea {
|
||||
padding: 8px;
|
||||
|
||||
&::placeholder {
|
||||
color: #c0c0c0;
|
||||
}
|
||||
}
|
||||
|
||||
.weglot-select.weglot-select-original,
|
||||
input[type="text"],
|
||||
textarea,
|
||||
select,
|
||||
#type_flags {
|
||||
padding: 0 8px;
|
||||
border-radius: 4px;
|
||||
border: 1px solid #7e8993;
|
||||
|
||||
&:focus {
|
||||
border-color: $primaryHover !important;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
.weglot-info {
|
||||
position: relative;
|
||||
color: #3741cc;
|
||||
font-weight: bold;
|
||||
|
||||
&:hover {
|
||||
.wg-tooltip {
|
||||
line-height: 1.4;
|
||||
position: absolute;
|
||||
top: 27px;
|
||||
display: block !important;
|
||||
background-color: #24292d;
|
||||
width: 160px;
|
||||
padding: 10px;
|
||||
color: white;
|
||||
font-weight: normal;
|
||||
border: 1px solid #e0e0e0;
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.weglot-box-overlay {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
display: flex;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: rgba(0, 0, 0, 0.85);
|
||||
z-index: 9999;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
.weglot-box {
|
||||
background-color: #fff;
|
||||
padding: 25px;
|
||||
text-align: center;
|
||||
-webkit-box-shadow: 0px 0px 5px 0px rgba(0, 0, 0, 0.75);
|
||||
-moz-box-shadow: 0px 0px 5px 0px rgba(0, 0, 0, 0.75);
|
||||
box-shadow: 0px 0px 5px 0px rgba(0, 0, 0, 0.75);
|
||||
|
||||
&--title {
|
||||
font-size: 24px;
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
&--text {
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
&--subtext {
|
||||
font-size: 12px;
|
||||
font-style: italic;
|
||||
}
|
||||
}
|
||||
|
||||
.weglot-btn-close {
|
||||
float: right;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
.flag-style-openclose {
|
||||
display: inline-block;
|
||||
font-size: 12px;
|
||||
text-decoration: underline;
|
||||
cursor: default;
|
||||
margin: 12px 15px 0 10px;
|
||||
color: $wp-color-green;
|
||||
|
||||
&:hover {
|
||||
color: #399648;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
.flag-style-wrapper {
|
||||
padding: 15px 0px;
|
||||
|
||||
p {
|
||||
font-size: 12px !important;
|
||||
}
|
||||
|
||||
select {
|
||||
font-size: 12px;
|
||||
margin: 0 2px 6px 0;
|
||||
padding: 0 26px 0 8px;
|
||||
}
|
||||
}
|
||||
|
||||
#private_mode {
|
||||
+ p + div {
|
||||
display: none;
|
||||
}
|
||||
|
||||
&:checked + p + div {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
#private-mode-detail {
|
||||
margin-top: 20px;
|
||||
|
||||
.private-mode-detail-lang {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 10px;
|
||||
margin-left: 25px;
|
||||
|
||||
input[type="checkbox"] {
|
||||
margin-top: -1px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#wrap-weglot {
|
||||
display: flex;
|
||||
margin-left: 15px;
|
||||
|
||||
.wrap {
|
||||
flex: 4;
|
||||
&.wrap-left{
|
||||
flex: 2;
|
||||
}
|
||||
}
|
||||
|
||||
input[type="text"]:not(#destination_language-selectized),
|
||||
input[type="url"] {
|
||||
padding: 0 8px;
|
||||
height: 36px;
|
||||
}
|
||||
|
||||
select {
|
||||
height: 36px;
|
||||
vertical-align: top;
|
||||
border-radius: 4px;
|
||||
padding: 0 26px 0 8px;
|
||||
}
|
||||
|
||||
input[type="checkbox"] {
|
||||
margin-top: -4px;
|
||||
}
|
||||
|
||||
.weglot-ckeckkey:before {
|
||||
content: "↻";
|
||||
display: inline-block;
|
||||
color: #666;
|
||||
padding: 0 6px 0 0;
|
||||
font-size: 16px;
|
||||
padding: 0 10px;
|
||||
line-height: 1em;
|
||||
-webkit-animation: spin 2s infinite linear;
|
||||
}
|
||||
@-webkit-keyframes spin {
|
||||
0% {-webkit-transform: rotate(0deg);}
|
||||
100% {-webkit-transform: rotate(360deg);}
|
||||
}
|
||||
|
||||
.weglot-nokkey:before {
|
||||
content: "\274C";
|
||||
display: inline-block;
|
||||
color: $wp-color-red;
|
||||
padding: 0 6px 0 0;
|
||||
font-size: 15px;
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
.weglot-okkey:before {
|
||||
content: "\2713";
|
||||
display: inline-block;
|
||||
color: $wp-color-green;
|
||||
padding: 0 10px;
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
.weglot-infobox {
|
||||
|
||||
&.weglot-info-translation-box{
|
||||
position: sticky;
|
||||
top: 275px;
|
||||
}
|
||||
&.weglot-wp-menu{
|
||||
position: sticky;
|
||||
top: 40px;
|
||||
a{
|
||||
text-decoration: none;
|
||||
&:focus{
|
||||
font-weight: bold;
|
||||
text-decoration: underline;
|
||||
outline: 0;
|
||||
box-shadow: none;
|
||||
}
|
||||
}
|
||||
|
||||
blockquote{
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
flex: 2;
|
||||
align-self: start;
|
||||
margin: 10px 20px 0 2px;
|
||||
background-color: white;
|
||||
border: 1px solid #e0e0e0;
|
||||
border-radius: 12px;
|
||||
overflow: hidden;
|
||||
|
||||
h3 {
|
||||
color: rgb(24, 22, 76);
|
||||
background-color: white;
|
||||
padding: 30px 30px 0 30px;
|
||||
margin: 0px;
|
||||
font-size: 23px;
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
div {
|
||||
padding: 15px 30px 5px 30px;
|
||||
}
|
||||
|
||||
.weglot-editbtn {
|
||||
box-shadow: 0 2px 4px 0 rgba(1, 1, 2, 0.05);
|
||||
background-color: rgb(61, 70, 251);
|
||||
color: #fff;
|
||||
height: 45px;
|
||||
border-radius: 23px;
|
||||
line-height: 45px;
|
||||
font-size: 14px !important;
|
||||
text-decoration: none;
|
||||
padding: 0 30px;
|
||||
display: inline-block;
|
||||
transition: all 0.2s ease-in;
|
||||
|
||||
&:hover {
|
||||
color: white;
|
||||
background: rgb(37, 46, 215);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
input[type="text"],
|
||||
.selectize-control,
|
||||
.wg-input-textarea,
|
||||
.weglot-select-original {
|
||||
width: 100%;
|
||||
max-width: 320px;
|
||||
}
|
||||
|
||||
#submit {
|
||||
height: 50px;
|
||||
padding: 0 30px !important;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.description {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.wg-tooltip {
|
||||
position: absolute;
|
||||
display: none;
|
||||
}
|
||||
|
||||
#mainform {
|
||||
margin-bottom: 50px;
|
||||
}
|
||||
.arrow-up {
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-left: 10px solid transparent;
|
||||
border-right: 10px solid transparent;
|
||||
border-bottom: 10px solid #24292d;
|
||||
position: absolute;
|
||||
top: -10px;
|
||||
left: 36px;
|
||||
}
|
||||
|
||||
.question-icon {
|
||||
font-size: 17px;
|
||||
}
|
||||
|
||||
.form-table {
|
||||
margin-bottom: 50px;
|
||||
}
|
||||
|
||||
.country-selector {
|
||||
z-index: 1 !important;
|
||||
}
|
||||
}
|
||||
|
||||
#weglot-url-translate {
|
||||
.weglot_custom_url {
|
||||
border-bottom: 1px solid #ccc;
|
||||
margin-bottom: 20px;
|
||||
padding-bottom: 10px;
|
||||
|
||||
a {
|
||||
margin: 5px 0px;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
&--text_link {
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.weglot_custom_url--text_link {
|
||||
input[type="text"] {
|
||||
min-height: 24px !important;
|
||||
height: 24px;
|
||||
}
|
||||
|
||||
button {
|
||||
margin-top: -2px;
|
||||
font-size: 11px;
|
||||
padding: 0 8px;
|
||||
|
||||
&.button-weglot-lang {
|
||||
.dashicons {
|
||||
font-size: 14px;
|
||||
line-height: 21px;
|
||||
margin-right: -3px;
|
||||
margin-left: -4px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
a.weglot_reset {
|
||||
text-decoration: none;
|
||||
|
||||
&:link,
|
||||
&:visited,
|
||||
&:hover,
|
||||
&:active {
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
246
wp-content/plugins/weglot/app/styles/amp.scss
Normal file
@@ -0,0 +1,246 @@
|
||||
@import "_colors.scss";
|
||||
$heightSelector: 37px;
|
||||
$lineHeight: 36px;
|
||||
|
||||
.country-selector {
|
||||
z-index: 9999;
|
||||
text-align: left;
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
width: auto;
|
||||
|
||||
a {
|
||||
padding: 0 10px;
|
||||
outline: none;
|
||||
text-decoration: none;
|
||||
float: none;
|
||||
white-space: nowrap;
|
||||
font-weight: normal;
|
||||
cursor: pointer;
|
||||
color: black;
|
||||
-webkit-touch-callout: none; /* iOS Safari */
|
||||
user-select: none;
|
||||
&:focus {
|
||||
outline: none;
|
||||
}
|
||||
}
|
||||
|
||||
ul {
|
||||
padding: 0px;
|
||||
z-index: 1010;
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
li {
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
&.weglot-dropdown {
|
||||
background-color: white;
|
||||
|
||||
a,
|
||||
span {
|
||||
display: block;
|
||||
height: $heightSelector;
|
||||
line-height: $lineHeight;
|
||||
font-size: 13px;
|
||||
padding: 0 10px;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
font-weight: normal;
|
||||
&:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
.wgcurrent {
|
||||
border: 1px solid #e0e0e0;
|
||||
list-style: none;
|
||||
display: block;
|
||||
margin: 0;
|
||||
a,
|
||||
span {
|
||||
padding-right: 60px;
|
||||
}
|
||||
|
||||
&:after {
|
||||
display: inline-block;
|
||||
position: absolute;
|
||||
top: 17px;
|
||||
right: 8px;
|
||||
width: 13px;
|
||||
height: 7px;
|
||||
image-rendering: pixelated;
|
||||
background: url("../images/wgarrowdown.png") no-repeat;
|
||||
content: "";
|
||||
transition: all 200ms;
|
||||
transform: rotate(-90deg);
|
||||
}
|
||||
}
|
||||
|
||||
ul {
|
||||
position: absolute;
|
||||
min-width: 100%;
|
||||
border: 1px solid #ebeef0;
|
||||
background: white;
|
||||
left: 0;
|
||||
top: initial;
|
||||
box-sizing: border-box;
|
||||
display: none;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
input:checked ~ ul {
|
||||
display: block;
|
||||
}
|
||||
|
||||
input:checked ~ .wgcurrent:after {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
|
||||
li {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
&.weglot-invert {
|
||||
ul {
|
||||
bottom: 38px;
|
||||
}
|
||||
input:checked ~ .wgcurrent:after {
|
||||
transform: rotate(-180deg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.weglot-default {
|
||||
position: fixed;
|
||||
bottom: 0px;
|
||||
right: 40px;
|
||||
}
|
||||
|
||||
&.weglot-inline {
|
||||
a {
|
||||
&:hover {
|
||||
text-decoration: underline;
|
||||
color: #00a0d2;
|
||||
}
|
||||
}
|
||||
|
||||
.wgcurrent {
|
||||
a {
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
|
||||
label {
|
||||
margin-bottom: 0;
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
ul {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
li {
|
||||
line-height: 1;
|
||||
display: inline-block;
|
||||
margin: 2px 0px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
&.weglot-default {
|
||||
bottom: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
input {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.navbar {
|
||||
.navbar-nav {
|
||||
li.weglot-flags {
|
||||
a.weglot-lang {
|
||||
&:before {
|
||||
position: static;
|
||||
transform: none;
|
||||
transition: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
html[dir="rtl"] {
|
||||
.weglot-flags a:before,
|
||||
.weglot-flags span:before {
|
||||
margin-right: 0;
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.weglot-flags {
|
||||
a,
|
||||
span.wglanguage-name {
|
||||
&:before {
|
||||
background-image: url("../images/rect_mate.png");
|
||||
background-size: auto 20px;
|
||||
border-radius: 0px;
|
||||
width: 30px;
|
||||
height: 20px;
|
||||
content: "";
|
||||
vertical-align: middle;
|
||||
margin-right: 10px;
|
||||
display: inline-block;
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
&.flag-1 {
|
||||
a,
|
||||
span {
|
||||
&:before {
|
||||
background-image: url("../images/rect_bright.png");
|
||||
}
|
||||
}
|
||||
}
|
||||
&.flag-2 {
|
||||
a,
|
||||
span {
|
||||
&:before {
|
||||
background-image: url("../images/square_flag.png");
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
background-size: auto 24px;
|
||||
}
|
||||
}
|
||||
}
|
||||
&.flag-3 {
|
||||
a,
|
||||
span {
|
||||
&:before {
|
||||
background-image: url("../images/circular_flag.png");
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
background-size: auto 24px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
a {
|
||||
span:before {
|
||||
background-image: none;
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
span {
|
||||
a:before {
|
||||
background-image: none;
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
271
wp-content/plugins/weglot/app/styles/index.scss
Normal file
@@ -0,0 +1,271 @@
|
||||
@import "_colors.scss";
|
||||
@import "_flags.scss";
|
||||
$heightSelector: 37px;
|
||||
$lineHeight: 36px;
|
||||
|
||||
#wp-admin-bar-weglot {
|
||||
> .ab-item {
|
||||
background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMDAiIGhlaWdodD0iMzAwIj48ZyBmaWxsPSIjYTBhNWFhIj48cGF0aCBkPSJNMjEuNzM5IDkyLjU2NWw1MS44MjggMTI5LjczMiAyMy42Ni02MC4yNzkgMjQuMTQ0IDYwLjI3OUwxNzMuMiA5Mi41NjVoLTI4LjAwN2wtMjMuODIyIDU4Ljc1LTIzLjkwMi01OC43NS0yMy45MDIgNTguNzUtMjMuOTAyLTU4Ljc1SDIxLjczOXoiLz48cGF0aCBkPSJNMjEwLjAwNiA5Mi43MWMtMTcuODY2IDAtMzMuMTU3IDYuMzU4LTQ1Ljg3MyAxOS4wNzQtMTIuNzE1IDEyLjcxNi0xOC45OTMgMjguMDA2LTE4Ljk5MyA0NS43OTIgMCAxNy44NjcgNi4yNzggMzMuMTU4IDE4Ljk5MyA0NS44NzMgMTIuNzE2IDEyLjcxNiAyOC4wMDcgMTguOTkzIDQ1Ljg3MyAxOC45OTMgMTcuNzg2IDAgMzMuMDc3LTYuMjc3IDQ1Ljc5My0xOC45OTMgMTIuNzE1LTEyLjcxNSAxOS4wNzMtMjguMDA2IDE5LjA3My00NS44NzMgMC00LjUwNy0uNDgzLTguODUyLTEuMjg4LTEyLjk1N2gtNjMuNTc4djI1LjkxNGgzNi42OTljLTIuNzM3IDcuNTY1LTcuNDg1IDEzLjg0My0xNC4wODQgMTguNjcxLTYuNjggNC44My0xNC4yNDUgNy4yNDQtMjIuNjE1IDcuMjQ0LTEwLjc4NCAwLTE5Ljk1OC0zLjc4My0yNy41MjMtMTEuMzQ4LTcuNTY2LTcuNTY1LTExLjM0OC0xNi43NC0xMS4zNDgtMjcuNTI0IDAtMTAuNjIzIDMuNzgyLTE5Ljc5OCAxMS4zNDgtMjcuNDQzIDcuNTY1LTcuNjQ1IDE2Ljc0LTExLjUwOCAyNy41MjMtMTEuNTA4IDEwLjYyMyAwIDE5Ljc5OCAzLjg2MyAyNy41MjQgMTEuNDI4bDE4LjM1LTE4LjM1YTY3Ljk2MyA2Ny45NjMgMCAwMC0yMC43NjQtMTMuODQyYy03Ljg4Ny0zLjM4LTE2LjI1Ny01LjE1LTI1LjExLTUuMTV6Ii8+PC9nPjwvc3ZnPg==") !important;
|
||||
background-size: 22px auto !important;
|
||||
background-repeat: no-repeat !important;
|
||||
background-position: 4px 5px !important;
|
||||
padding-left: 30px !important;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
li.weglot-hide,
|
||||
.weglot-hide {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.country-selector {
|
||||
z-index: 9999;
|
||||
text-align: left;
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
width: auto;
|
||||
|
||||
a {
|
||||
padding: 0 10px;
|
||||
outline: none;
|
||||
text-decoration: none;
|
||||
float: none !important;
|
||||
white-space: nowrap;
|
||||
font-weight: normal;
|
||||
cursor: pointer;
|
||||
color: black;
|
||||
-webkit-touch-callout: none; /* iOS Safari */
|
||||
user-select: none;
|
||||
&:focus {
|
||||
outline: none;
|
||||
}
|
||||
}
|
||||
|
||||
ul {
|
||||
padding: 0px;
|
||||
z-index: 1010;
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
li {
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
&.weglot-custom-switcher-ajax{
|
||||
display: none;
|
||||
}
|
||||
|
||||
&.weglot-dropdown {
|
||||
background-color: white;
|
||||
|
||||
a,
|
||||
span {
|
||||
display: block;
|
||||
height: $heightSelector;
|
||||
line-height: $lineHeight;
|
||||
font-size: 13px;
|
||||
padding: 0 10px;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
font-weight: normal;
|
||||
&:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
.wgcurrent {
|
||||
border: 1px solid #e0e0e0;
|
||||
list-style: none;
|
||||
display: block;
|
||||
margin: 0;
|
||||
a,
|
||||
span {
|
||||
padding-right: 60px;
|
||||
}
|
||||
|
||||
&:after {
|
||||
display: inline-block;
|
||||
position: absolute;
|
||||
top: 17px;
|
||||
right: 8px;
|
||||
width: 13px;
|
||||
height: 7px;
|
||||
image-rendering: pixelated;
|
||||
background: url("../images/wgarrowdown.png") no-repeat;
|
||||
content: "";
|
||||
transition: all 200ms;
|
||||
transform: rotate(-90deg);
|
||||
}
|
||||
}
|
||||
|
||||
ul {
|
||||
position: absolute;
|
||||
min-width: 100%;
|
||||
border: 1px solid #ebeef0;
|
||||
background: white;
|
||||
left: 0;
|
||||
top: initial;
|
||||
box-sizing: border-box;
|
||||
display: none;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
input:checked ~ ul {
|
||||
display: block;
|
||||
}
|
||||
|
||||
input:checked ~ .wgcurrent:after {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
|
||||
li {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
&.weglot-invert {
|
||||
ul {
|
||||
bottom: 38px;
|
||||
}
|
||||
input:checked ~ .wgcurrent:after {
|
||||
transform: rotate(-180deg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&.weglot-default {
|
||||
position: fixed;
|
||||
bottom: 0px;
|
||||
right: 40px;
|
||||
}
|
||||
|
||||
&.weglot-inline {
|
||||
a {
|
||||
&:hover {
|
||||
text-decoration: underline;
|
||||
color: #00a0d2;
|
||||
}
|
||||
}
|
||||
|
||||
.wgcurrent {
|
||||
a {
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
|
||||
label {
|
||||
margin-bottom: 0;
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
ul {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
li {
|
||||
line-height: 1 !important;
|
||||
display: inline-block;
|
||||
margin: 2px 0px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
&.weglot-default {
|
||||
bottom: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
input {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
.navbar {
|
||||
.navbar-nav {
|
||||
li.weglot-flags {
|
||||
a.weglot-lang {
|
||||
&:before {
|
||||
position: static;
|
||||
transform: none;
|
||||
transition: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.js .main-navigation .country-selector ul {
|
||||
display: none;
|
||||
}
|
||||
|
||||
html[dir="rtl"] {
|
||||
.weglot-flags a:before,
|
||||
.weglot-flags span:before {
|
||||
margin-right: 0;
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.weglot-flags {
|
||||
> a,
|
||||
> span.wglanguage-name {
|
||||
&:before {
|
||||
background-image: url("../images/rect_mate.png");
|
||||
background-size: auto 20px !important;
|
||||
border-radius: 0px !important;
|
||||
width: 30px !important;
|
||||
height: 20px !important;
|
||||
content: "";
|
||||
vertical-align: middle;
|
||||
margin-right: 10px;
|
||||
display: inline-block;
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
&.flag-1 {
|
||||
> a,
|
||||
> span {
|
||||
&:before {
|
||||
background-image: url("../images/rect_bright.png");
|
||||
}
|
||||
}
|
||||
}
|
||||
&.flag-2 {
|
||||
> a,
|
||||
> span {
|
||||
&:before {
|
||||
background-image: url("../images/square_flag.png");
|
||||
width: 24px !important;
|
||||
height: 24px !important;
|
||||
background-size: auto 24px !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
&.flag-3 {
|
||||
a,
|
||||
span {
|
||||
&:before {
|
||||
background-image: url("../images/circular_flag.png");
|
||||
width: 24px !important;
|
||||
height: 24px !important;
|
||||
background-size: auto 24px !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
> a {
|
||||
span:before {
|
||||
background-image: none !important;
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
> span {
|
||||
a:before {
|
||||
background-image: none !important;
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
1
wp-content/plugins/weglot/app/styles/new-flags.css
Normal file
324
wp-content/plugins/weglot/app/styles/selectize.css
Normal file
@@ -0,0 +1,324 @@
|
||||
/**
|
||||
* selectize.css (v0.12.4)
|
||||
* Copyright (c) 2013–2015 Brian Reavis & contributors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
|
||||
* file except in compliance with the License. You may obtain a copy of the License at:
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under
|
||||
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
|
||||
* ANY KIND, either express or implied. See the License for the specific language
|
||||
* governing permissions and limitations under the License.
|
||||
*
|
||||
* @author Brian Reavis <brian@thirdroute.com>
|
||||
*/
|
||||
|
||||
.selectize-control.plugin-drag_drop.multi > .selectize-input > div.ui-sortable-placeholder {
|
||||
visibility: visible !important;
|
||||
background: #f2f2f2 !important;
|
||||
background: rgba(0, 0, 0, 0.06) !important;
|
||||
border: 0 none !important;
|
||||
-webkit-box-shadow: inset 0 0 12px 4px #ffffff;
|
||||
box-shadow: inset 0 0 12px 4px #ffffff;
|
||||
}
|
||||
.selectize-control.plugin-drag_drop .ui-sortable-placeholder::after {
|
||||
content: '!';
|
||||
visibility: hidden;
|
||||
}
|
||||
.selectize-control.plugin-drag_drop .ui-sortable-helper {
|
||||
-webkit-box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
|
||||
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
.selectize-dropdown-header {
|
||||
position: relative;
|
||||
padding: 5px 8px;
|
||||
border-bottom: 1px solid #d0d0d0;
|
||||
background: #f8f8f8;
|
||||
-webkit-border-radius: 3px 3px 0 0;
|
||||
-moz-border-radius: 3px 3px 0 0;
|
||||
border-radius: 3px 3px 0 0;
|
||||
}
|
||||
.selectize-dropdown-header-close {
|
||||
position: absolute;
|
||||
right: 8px;
|
||||
top: 50%;
|
||||
color: #303030;
|
||||
opacity: 0.4;
|
||||
margin-top: -12px;
|
||||
line-height: 20px;
|
||||
font-size: 20px !important;
|
||||
}
|
||||
.selectize-dropdown-header-close:hover {
|
||||
color: #000000;
|
||||
}
|
||||
.selectize-dropdown.plugin-optgroup_columns .optgroup {
|
||||
border-right: 1px solid #f2f2f2;
|
||||
border-top: 0 none;
|
||||
float: left;
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.selectize-dropdown.plugin-optgroup_columns .optgroup:last-child {
|
||||
border-right: 0 none;
|
||||
}
|
||||
.selectize-dropdown.plugin-optgroup_columns .optgroup:before {
|
||||
display: none;
|
||||
}
|
||||
.selectize-dropdown.plugin-optgroup_columns .optgroup-header {
|
||||
border-top: 0 none;
|
||||
}
|
||||
.selectize-control.plugin-remove_button [data-value] {
|
||||
position: relative;
|
||||
padding-right: 24px !important;
|
||||
}
|
||||
.selectize-control.plugin-remove_button [data-value] .remove {
|
||||
z-index: 1;
|
||||
/* fixes ie bug (see #392) */
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
width: 17px;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
font-size: 12px;
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
vertical-align: middle;
|
||||
display: inline-block;
|
||||
padding: 2px 0 0 0;
|
||||
border-left: 1px solid #d0d0d0;
|
||||
-webkit-border-radius: 0 2px 2px 0;
|
||||
-moz-border-radius: 0 2px 2px 0;
|
||||
border-radius: 0 2px 2px 0;
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.selectize-control.plugin-remove_button [data-value] .remove:hover {
|
||||
background: rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
.selectize-control.plugin-remove_button [data-value].active .remove {
|
||||
border-left-color: #cacaca;
|
||||
}
|
||||
.selectize-control.plugin-remove_button .disabled [data-value] .remove:hover {
|
||||
background: none;
|
||||
}
|
||||
.selectize-control.plugin-remove_button .disabled [data-value] .remove {
|
||||
border-left-color: #ffffff;
|
||||
}
|
||||
.selectize-control.plugin-remove_button .remove-single {
|
||||
position: absolute;
|
||||
right: 28px;
|
||||
top: 6px;
|
||||
font-size: 23px;
|
||||
}
|
||||
.selectize-control {
|
||||
position: relative;
|
||||
}
|
||||
.selectize-dropdown,
|
||||
.selectize-input,
|
||||
.selectize-input input {
|
||||
color: #303030;
|
||||
font-family: inherit;
|
||||
font-size: 13px;
|
||||
line-height: 18px;
|
||||
-webkit-font-smoothing: inherit;
|
||||
}
|
||||
.selectize-input,
|
||||
.selectize-control.single .selectize-input.input-active {
|
||||
background: #ffffff;
|
||||
cursor: text;
|
||||
display: inline-block;
|
||||
}
|
||||
.selectize-input {
|
||||
border: 1px solid #d0d0d0;
|
||||
padding: 8px 8px;
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.1);
|
||||
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.1);
|
||||
-webkit-border-radius: 3px;
|
||||
-moz-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
.selectize-control.multi .selectize-input.has-items {
|
||||
padding: 6px 8px 3px;
|
||||
}
|
||||
.selectize-input.full {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
.selectize-input.disabled,
|
||||
.selectize-input.disabled * {
|
||||
cursor: default !important;
|
||||
}
|
||||
.selectize-input.focus {
|
||||
-webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15);
|
||||
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
.selectize-input.dropdown-active {
|
||||
-webkit-border-radius: 3px 3px 0 0;
|
||||
-moz-border-radius: 3px 3px 0 0;
|
||||
border-radius: 3px 3px 0 0;
|
||||
}
|
||||
.selectize-input > * {
|
||||
vertical-align: baseline;
|
||||
display: -moz-inline-stack;
|
||||
display: inline-block;
|
||||
zoom: 1;
|
||||
*display: inline;
|
||||
}
|
||||
.selectize-control.multi .selectize-input > div {
|
||||
cursor: pointer;
|
||||
margin: 0 3px 3px 0;
|
||||
padding: 2px 6px;
|
||||
background: #f2f2f2;
|
||||
color: #303030;
|
||||
border: 0 solid #d0d0d0;
|
||||
}
|
||||
.selectize-control.multi .selectize-input > div.active {
|
||||
background: #e8e8e8;
|
||||
color: #303030;
|
||||
border: 0 solid #cacaca;
|
||||
}
|
||||
.selectize-control.multi .selectize-input.disabled > div,
|
||||
.selectize-control.multi .selectize-input.disabled > div.active {
|
||||
color: #7d7d7d;
|
||||
background: #ffffff;
|
||||
border: 0 solid #ffffff;
|
||||
}
|
||||
.selectize-input > input {
|
||||
display: inline-block !important;
|
||||
padding: 0 !important;
|
||||
min-height: 0 !important;
|
||||
max-height: none !important;
|
||||
max-width: 100% !important;
|
||||
margin: 0 2px 0 0 !important;
|
||||
text-indent: 0 !important;
|
||||
border: 0 none !important;
|
||||
background: none !important;
|
||||
line-height: inherit !important;
|
||||
-webkit-user-select: auto !important;
|
||||
-webkit-box-shadow: none !important;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
.selectize-input > input::-ms-clear {
|
||||
display: none;
|
||||
}
|
||||
.selectize-input > input:focus {
|
||||
outline: none !important;
|
||||
}
|
||||
.selectize-input::after {
|
||||
content: ' ';
|
||||
display: block;
|
||||
clear: left;
|
||||
}
|
||||
.selectize-input.dropdown-active::before {
|
||||
content: ' ';
|
||||
display: block;
|
||||
position: absolute;
|
||||
background: #f0f0f0;
|
||||
height: 1px;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
}
|
||||
.selectize-dropdown {
|
||||
position: absolute;
|
||||
z-index: 10;
|
||||
border: 1px solid #d0d0d0;
|
||||
background: #ffffff;
|
||||
margin: -1px 0 0 0;
|
||||
border-top: 0 none;
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
||||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
||||
-webkit-border-radius: 0 0 3px 3px;
|
||||
-moz-border-radius: 0 0 3px 3px;
|
||||
border-radius: 0 0 3px 3px;
|
||||
}
|
||||
.selectize-dropdown [data-selectable] {
|
||||
cursor: pointer;
|
||||
overflow: hidden;
|
||||
}
|
||||
.selectize-dropdown [data-selectable] .highlight {
|
||||
background: rgba(125, 168, 208, 0.2);
|
||||
-webkit-border-radius: 1px;
|
||||
-moz-border-radius: 1px;
|
||||
border-radius: 1px;
|
||||
}
|
||||
.selectize-dropdown [data-selectable],
|
||||
.selectize-dropdown .optgroup-header {
|
||||
padding: 5px 8px;
|
||||
}
|
||||
.selectize-dropdown .optgroup:first-child .optgroup-header {
|
||||
border-top: 0 none;
|
||||
}
|
||||
.selectize-dropdown .optgroup-header {
|
||||
color: #303030;
|
||||
background: #ffffff;
|
||||
cursor: default;
|
||||
}
|
||||
.selectize-dropdown .active {
|
||||
background-color: #f5fafd;
|
||||
color: #495c68;
|
||||
}
|
||||
.selectize-dropdown .active.create {
|
||||
color: #495c68;
|
||||
}
|
||||
.selectize-dropdown .create {
|
||||
color: rgba(48, 48, 48, 0.5);
|
||||
}
|
||||
.selectize-dropdown-content {
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
max-height: 200px;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
.selectize-control.single .selectize-input,
|
||||
.selectize-control.single .selectize-input input {
|
||||
cursor: pointer;
|
||||
}
|
||||
.selectize-control.single .selectize-input.input-active,
|
||||
.selectize-control.single .selectize-input.input-active input {
|
||||
cursor: text;
|
||||
}
|
||||
.selectize-control.single .selectize-input:after {
|
||||
content: ' ';
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
right: 15px;
|
||||
margin-top: -3px;
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-style: solid;
|
||||
border-width: 5px 5px 0 5px;
|
||||
border-color: #808080 transparent transparent transparent;
|
||||
}
|
||||
.selectize-control.single .selectize-input.dropdown-active:after {
|
||||
margin-top: -4px;
|
||||
border-width: 0 5px 5px 5px;
|
||||
border-color: transparent transparent #808080 transparent;
|
||||
}
|
||||
.selectize-control.rtl.single .selectize-input:after {
|
||||
left: 15px;
|
||||
right: auto;
|
||||
}
|
||||
.selectize-control.rtl .selectize-input > input {
|
||||
margin: 0 4px 0 -2px !important;
|
||||
}
|
||||
.selectize-control .selectize-input.disabled {
|
||||
opacity: 0.5;
|
||||
background-color: #fafafa;
|
||||
}
|
||||