Update first-boot configuration and scripts for enhanced kiosk functionality</message>
<message>Modify the first-boot configuration to include the gir1.2-gtklayershell-0.1 package for improved GTK layer shell support. Update the first-boot script to enhance the portal status reporting with connection timeouts. Additionally, implement a restart mechanism for the kanshi service in rotation scripts to ensure immediate application of configuration changes. Introduce a Chromium kiosk extension to disable text selection, improving user experience in kiosk mode. These changes streamline the setup process and enhance the overall functionality of the kiosk environment.
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
// Disable text selection: inject CSS and clear any selection (including from scrollbar).
|
||||
(function() {
|
||||
var style = document.createElement('style');
|
||||
style.id = 'kiosk-no-select';
|
||||
style.textContent = [
|
||||
'html, body, body *, body *::before, body *::after {',
|
||||
' user-select: none !important; -webkit-user-select: none !important;',
|
||||
' -moz-user-select: none !important; -ms-user-select: none !important;',
|
||||
'}',
|
||||
'input:focus, textarea:focus, [contenteditable="true"]:focus {',
|
||||
' user-select: text !important; -webkit-user-select: text !important;',
|
||||
'}'
|
||||
].join('');
|
||||
(document.head || document.documentElement).appendChild(style);
|
||||
|
||||
function allowSelect(el) {
|
||||
return el && (el.tagName === 'INPUT' || el.tagName === 'TEXTAREA' || el.isContentEditable);
|
||||
}
|
||||
|
||||
function preventSelect(e) {
|
||||
if (allowSelect(e.target)) return;
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
function clearSelection() {
|
||||
var sel = document.getSelection();
|
||||
if (!sel || sel.rangeCount === 0) return;
|
||||
var node = sel.anchorNode;
|
||||
var el = node && (node.nodeType === 1 ? node : node.parentElement);
|
||||
if (el && !allowSelect(el)) sel.removeAllRanges();
|
||||
}
|
||||
|
||||
document.addEventListener('selectstart', preventSelect, true);
|
||||
document.addEventListener('contextmenu', preventSelect, true);
|
||||
document.addEventListener('selectionchange', clearSelection, true);
|
||||
document.addEventListener('mousedown', function(e) { if (!allowSelect(e.target)) clearSelection(); }, true);
|
||||
})();
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"manifest_version": 2,
|
||||
"name": "Kiosk: No Text Selection",
|
||||
"version": "1.1",
|
||||
"description": "Disables text selection so touch-drag scrolls instead of selecting.",
|
||||
"content_scripts": [
|
||||
{
|
||||
"matches": ["<all_urls>"],
|
||||
"css": ["no-select.css"],
|
||||
"js": ["inject.js"],
|
||||
"run_at": "document_start"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
/* Disable text selection so touch-drag scrolls. Apply to everything. */
|
||||
html, body, body *,
|
||||
body *::before, body *::after,
|
||||
input, textarea, [contenteditable="true"] {
|
||||
user-select: none !important;
|
||||
-webkit-user-select: none !important;
|
||||
-moz-user-select: none !important;
|
||||
-ms-user-select: none !important;
|
||||
}
|
||||
|
||||
/* Allow selection in inputs so users can edit if needed */
|
||||
input:focus, textarea:focus, [contenteditable="true"]:focus {
|
||||
user-select: text !important;
|
||||
-webkit-user-select: text !important;
|
||||
}
|
||||
Reference in New Issue
Block a user