Fossil SCM

Fix a potential null deref in sample JS code.

stephan 2020-05-15 01:35 fileedit-ajaxify
Commit d361947c8df52dafba6ce87e0e22c4fa98d3ba52f2dd88271485075e880e3eb8
1 file changed +1 -1
--- www/fileedit-page.md
+++ www/fileedit-page.md
@@ -121,11 +121,11 @@
121121
At the very bottom of the [site skin's footer](customskin.md), add a
122122
script tag similar to the following:
123123
124124
```javascript
125125
<script nonce="$<nonce>">
126
-if(fossil && fossil.page && fossil.page.name==='fileedit'){
126
+if(window.fossil && fossil.page && fossil.page.name==='fileedit'){
127127
fossil.page.addEventListener(
128128
'fileedit-preview-updated',
129129
(ev)=>{
130130
if(ev.detail.previewMode==='wiki'){
131131
ev.detail.element.querySelectorAll(
132132
--- www/fileedit-page.md
+++ www/fileedit-page.md
@@ -121,11 +121,11 @@
121 At the very bottom of the [site skin's footer](customskin.md), add a
122 script tag similar to the following:
123
124 ```javascript
125 <script nonce="$<nonce>">
126 if(fossil && fossil.page && fossil.page.name==='fileedit'){
127 fossil.page.addEventListener(
128 'fileedit-preview-updated',
129 (ev)=>{
130 if(ev.detail.previewMode==='wiki'){
131 ev.detail.element.querySelectorAll(
132
--- www/fileedit-page.md
+++ www/fileedit-page.md
@@ -121,11 +121,11 @@
121 At the very bottom of the [site skin's footer](customskin.md), add a
122 script tag similar to the following:
123
124 ```javascript
125 <script nonce="$<nonce>">
126 if(window.fossil && fossil.page && fossil.page.name==='fileedit'){
127 fossil.page.addEventListener(
128 'fileedit-preview-updated',
129 (ev)=>{
130 if(ev.detail.previewMode==='wiki'){
131 ev.detail.element.querySelectorAll(
132

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button