mirror of
https://github.com/friendica/friendica
synced 2025-04-24 07:10:11 +00:00
frio: formating, otherwise untouched
This commit is contained in:
parent
cb24e8987c
commit
91d3e72be7
25 changed files with 3300 additions and 2937 deletions
|
@ -1,51 +1,53 @@
|
|||
// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPLv3-or-later
|
||||
$(function() {
|
||||
$(function () {
|
||||
// Jot attachment live preview.
|
||||
let $textarea = $('textarea[name=body]');
|
||||
let $textarea = $("textarea[name=body]");
|
||||
$textarea.linkPreview();
|
||||
$textarea.keyup(function(){
|
||||
$textarea.keyup(function () {
|
||||
var textlen = $(this).val().length;
|
||||
$('#character-counter').text(textlen);
|
||||
$("#character-counter").text(textlen);
|
||||
});
|
||||
$textarea.editor_autocomplete(baseurl + '/search/acl');
|
||||
$textarea.bbco_autocomplete('bbcode');
|
||||
$textarea.editor_autocomplete(baseurl + "/search/acl");
|
||||
$textarea.bbco_autocomplete("bbcode");
|
||||
|
||||
let location_button = document.getElementById('profile-location');
|
||||
let location_input = document.getElementById('jot-location');
|
||||
let location_button = document.getElementById("profile-location");
|
||||
let location_input = document.getElementById("jot-location");
|
||||
|
||||
if (location_button && location_input) {
|
||||
updateLocationButtonDisplay(location_button, location_input);
|
||||
|
||||
location_input.addEventListener('change', function () {
|
||||
location_input.addEventListener("change", function () {
|
||||
updateLocationButtonDisplay(location_button, location_input);
|
||||
});
|
||||
location_input.addEventListener('keyup', function () {
|
||||
location_input.addEventListener("keyup", function () {
|
||||
updateLocationButtonDisplay(location_button, location_input);
|
||||
});
|
||||
|
||||
location_button.addEventListener('click', function() {
|
||||
location_button.addEventListener("click", function () {
|
||||
if (location_input.value) {
|
||||
location_input.value = '';
|
||||
location_input.value = "";
|
||||
updateLocationButtonDisplay(location_button, location_input);
|
||||
} else if ("geolocation" in navigator) {
|
||||
navigator.geolocation.getCurrentPosition(function(position) {
|
||||
location_input.value = position.coords.latitude + ', ' + position.coords.longitude;
|
||||
updateLocationButtonDisplay(location_button, location_input);
|
||||
}, function (error) {
|
||||
location_button.disabled = true;
|
||||
updateLocationButtonDisplay(location_button, location_input);
|
||||
});
|
||||
navigator.geolocation.getCurrentPosition(
|
||||
function (position) {
|
||||
location_input.value = position.coords.latitude + ", " + position.coords.longitude;
|
||||
updateLocationButtonDisplay(location_button, location_input);
|
||||
},
|
||||
function (error) {
|
||||
location_button.disabled = true;
|
||||
updateLocationButtonDisplay(location_button, location_input);
|
||||
},
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
function updateLocationButtonDisplay(location_button, location_input)
|
||||
{
|
||||
location_button.classList.remove('btn-primary');
|
||||
function updateLocationButtonDisplay(location_button, location_input) {
|
||||
location_button.classList.remove("btn-primary");
|
||||
if (location_input.value) {
|
||||
location_button.disabled = false;
|
||||
location_button.classList.add('btn-primary');
|
||||
location_button.classList.add("btn-primary");
|
||||
location_button.title = location_button.dataset.titleClear;
|
||||
} else if (!"geolocation" in navigator) {
|
||||
location_button.disabled = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue