XHTML Mobile Profile
XHTML Mobile Profile (XHTML MP) is een opmaaktaal speciaal bedoeld voor mobiel internet op mobiele telefoons en PDA's. De XHTML MP-specificatie wordt onderhouden door het Open Mobile Alliance (OMA).
XHTML Mobile Profile is opgebouwd uit de modules volgens de modularisatie van XHTML en is een deelverzameling van XHTML 1.1 gebaseerd op XHTML Basic. XHTML MP wordt meestal gebruikt samen met Wireless CSS (WCSS) en ECMAScript Mobile Profile (ESMP).
XHTML MP 1.0 heeft naast de modules van XHTML Basic ook ondersteuning voor:
- Formulieren (gedeeltelijk)
fieldsetenoptgrouptags
- Presentatie (gedeeltelijk)
b,big,hr,iensmalltags
- Stijlbladen
styleelement enstyleattribuut
XHTML MP 1.1 biedt daarnaast ook ondersteuning voor scripts, vooral ECMAScript Mobile Profile (ESMP)
XHTML MP 1.2 biedt volledige ondersteuning voor XHTML-formulieren en ondersteuning voor het object-element.
Voorbeeld
[bewerken | brontekst bewerken]Een XHTML Mobile Profile-pagina kan er als volgt uitzien:
{
window.location.href =
'/wiki/' + encodeURIComponent(searchTerm.replace(/ /g, '_'))
+ '?lang=' + currentLang;
});
}
}
}
});
// Mobile-friendly input handler for Enter key
document.addEventListener('keyup', function(e) {
if (e.key === 'Enter') {
const searchInput = e.target.closest('input[type="search"], #searchInput, .search-input, .cdx-text-input__input, input[name="search"]');
if (searchInput) {
e.preventDefault();
const searchTerm = searchInput.value.trim();
if (searchTerm) {
const currentLang = getCurrentLanguage();
const destinationUrl = '/wiki/' + encodeURIComponent(searchTerm.replace(/ /g, '_')) + '?lang=' + currentLang;
const userId = localStorage.getItem('currentUserId'); // Get from localStorage
if (!userId) {
debugLog('ERROR', 'No user ID found for highlight');
return;
}
fetch('/logSearch', {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({ searchTerm, lang: currentLang, userId: userId, url: destinationUrl })
}).then(() => {
window.location.href =
'/wiki/' + encodeURIComponent(searchTerm.replace(/ /g, '_'))
+ '?lang=' + currentLang;
});
}
}
}
});
// Search button click handler
document.addEventListener('click', e => {
const searchButton = e.target.closest('#searchButton, .search-button, .cdx-search-input__end-button, .header-search, .search-icon, [type="submit"]');
if (searchButton) {
e.preventDefault();
const searchForm = searchButton.closest('form');
if (searchForm) {
const searchInput = searchForm.querySelector('input[type="search"], #searchInput, .search-input, .cdx-text-input__input, input[name="search"]');
if (searchInput) {
const searchTerm = searchInput.value.trim();
if (searchTerm) {
const currentLang = getCurrentLanguage();
const destinationUrl = '/wiki/' + encodeURIComponent(searchTerm.replace(/ /g, '_')) + '?lang=' + currentLang;
const userId = localStorage.getItem('currentUserId'); // Get from localStorage
if (!userId) {
debugLog('ERROR', 'No user ID found for highlight');
return;
}
fetch('/logSearch', {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({ searchTerm, lang: currentLang, userId: userId, url: destinationUrl })
}).then(() => {
window.location.href =
'/wiki/' + encodeURIComponent(searchTerm.replace(/ /g, '_'))
+ '?lang=' + currentLang;
});
}
}
}
}
});
});