synology:dokuwiki
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| synology:dokuwiki [2023/02/21 22:58] – [Theme Adjustment] Wuff | synology:dokuwiki [2026/07/26 13:57] (current) – Wuff | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== DokuWiki | + | ====== DokuWiki |
| Admin, extensions: | Admin, extensions: | ||
| Line 255: | Line 255: | ||
| </ | </ | ||
| insert after line 23 relating to favicon: | insert after line 23 relating to favicon: | ||
| - | < | + | < |
| <?php | <?php | ||
| $look = array(': | $look = array(': | ||
| Line 264: | Line 264: | ||
| ===== Allow additional file types ===== | ===== Allow additional file types ===== | ||
| - | Log into synology via ssh or access the dokuwiki folder.\\ | ||
| < | < | ||
| - | cd / | + | cd dokuwiki/ |
| - | sudo cp mime.conf mime.local.conf | + | cp mime.conf mime.local.conf |
| - | sudo vi mime.local.conf | + | vi mime.local.conf |
| #delete all but the text files towards the end of the file and enable them | #delete all but the text files towards the end of the file and enable them | ||
| #add json text/json | #add json text/json | ||
| Line 285: | Line 284: | ||
| Adjustment hack to show parent namespace: | Adjustment hack to show parent namespace: | ||
| - | dokuwiki/ | + | dokuwiki/ |
| - | < | + | < |
| - | / produce output | + | // produce output |
| - | $parentnamespace = getNS($id); | + | $parentnamespace = getNS($id); |
| if(useHeading(' | if(useHeading(' | ||
| // get page title | // get page title | ||
| Line 299: | Line 298: | ||
| $parentnamespace.=' | $parentnamespace.=' | ||
| } | } | ||
| - | $content | + | $section |
| - | | + | $content = '<a href="' |
| + | if ($this-> | ||
| + | $content = '< | ||
| + | } | ||
| + | return $this-> | ||
| + | } | ||
| </ | </ | ||
| Line 310: | Line 313: | ||
| php bin/ | php bin/ | ||
| php bin/ | php bin/ | ||
| + | </ | ||
| + | |||
| + | ===== Fix code copy ===== | ||
| + | |||
| + | The code copying replaces empty new lines with space (nbsp;) which are copied via selection or using the copy button. To replace the spaces with actual newlines, create conf/ | ||
| + | <code javascript conf/ | ||
| + | jQuery(function() { | ||
| + | // Helper function to sanitize text formatting | ||
| + | function cleanDokuWikiCodeSpaces(text) { | ||
| + | return text | ||
| + | .replace(/ | ||
| + | .replace(/ | ||
| + | .replace(/ | ||
| + | .replace(/ | ||
| + | } | ||
| + | |||
| + | // FIX 1: Handle standard user manual mouse selections (Ctrl+C) | ||
| + | document.addEventListener(' | ||
| + | const selection = window.getSelection(); | ||
| + | if (selection.rangeCount > 0 && selection.anchorNode.parentElement.closest(' | ||
| + | let cleanedText = cleanDokuWikiCodeSpaces(selection.toString()); | ||
| + | e.clipboardData.setData(' | ||
| + | e.preventDefault(); | ||
| + | } | ||
| + | }); | ||
| + | |||
| + | // FIX 2: Handle DokuWiki Core's Native Async Copy Button | ||
| + | document.addEventListener(' | ||
| + | // Targets DokuWiki' | ||
| + | const btn = e.target.closest(' | ||
| + | if (!btn) return; | ||
| + | |||
| + | // Force monitor the system clipboard immediately following the click | ||
| + | let attempts = 0; | ||
| + | const maxAttempts = 10; | ||
| + | |||
| + | const checkAndCleanClipboard = setInterval(async () => { | ||
| + | attempts++; | ||
| + | try { | ||
| + | let currentText = await navigator.clipboard.readText(); | ||
| + | |||
| + | // If clipboard contains data and has the raw space error, rewrite it immediately | ||
| + | if (currentText && (currentText.includes(' | ||
| + | let cleanedText = cleanDokuWikiCodeSpaces(currentText); | ||
| + | await navigator.clipboard.writeText(cleanedText); | ||
| + | clearInterval(checkAndCleanClipboard); | ||
| + | } | ||
| + | } catch (err) { | ||
| + | // Clipboard permissions might delay slightly, keep trying | ||
| + | } | ||
| + | |||
| + | if (attempts >= maxAttempts) { | ||
| + | clearInterval(checkAndCleanClipboard); | ||
| + | } | ||
| + | }, 30); // Check every 30ms for immediate execution | ||
| + | }); | ||
| + | }); | ||
| + | |||
| </ | </ | ||
synology/dokuwiki.1677020305.txt.gz · Last modified: (external edit)