Fossil SCM

Added www/fileedit-page.md, documenting how to integrate syntax highlighting and replace the editor widget. Added fossil.page.replaceEditorElement() to facility replacing the editor widget.

stephan 2020-05-14 07:14 fileedit-ajaxify
Commit 909a48e3788cbba79c5c786a449e04ec5e784aa72f192fa5f4767a652ea8ebac
--- src/fossil.page.fileedit.js
+++ src/fossil.page.fileedit.js
@@ -240,10 +240,11 @@
240240
btnReload: E("#fileedit-tab-content > .fileedit-options > "
241241
+"button.fileedit-content-reload"),
242242
selectPreviewMode: E('#select-preview-mode select'),
243243
selectHtmlEmsWrap: E('#select-preview-html-ems'),
244244
selectEolWrap: E('#select-preview-html-ems'),
245
+ selectFontSizeWrap: E('#select-font-size'),
245246
cbLineNumbersWrap: E('#cb-line-numbers'),
246247
cbAutoPreview: E('#cb-preview-autoupdate > input[type=checkbox]'),
247248
previewTarget: E('#fileedit-tab-preview-wrapper'),
248249
cbIsExe: E('input[type=checkbox][name=exec_bit]'),
249250
fsFileVersionDetails: E('#file-version-details'),
@@ -514,10 +515,26 @@
514515
D.append(
515516
eTgt,"[",D.a(purl,"Editor permalink"),"]"
516517
);
517518
return this;
518519
};
520
+
521
+ /**
522
+ Removes the default editor widget (and any dependent elements)
523
+ from the DOM, adds the given element in its place, removes this
524
+ method from this object, and returns this object.
525
+ */
526
+ P.replaceEditorElement = function(newEditor){
527
+ P.e.taEditor.parentNode.insertBefore(
528
+ newEditor,
529
+ P.e.taEditor
530
+ );
531
+ P.e.taEditor.remove();
532
+ P.e.selectFontSizeWrap.remove();
533
+ delete this.replaceEditorElement;
534
+ return P;
535
+ };
519536
520537
/**
521538
loadFile() loads (file,checkinVersion) and updates the relevant
522539
UI elements to reflect the loaded state. If passed no arguments
523540
then it re-uses the values from the currently-loaded file, reloading
524541
525542
ADDED www/fileedit-page.md
--- src/fossil.page.fileedit.js
+++ src/fossil.page.fileedit.js
@@ -240,10 +240,11 @@
240 btnReload: E("#fileedit-tab-content > .fileedit-options > "
241 +"button.fileedit-content-reload"),
242 selectPreviewMode: E('#select-preview-mode select'),
243 selectHtmlEmsWrap: E('#select-preview-html-ems'),
244 selectEolWrap: E('#select-preview-html-ems'),
 
245 cbLineNumbersWrap: E('#cb-line-numbers'),
246 cbAutoPreview: E('#cb-preview-autoupdate > input[type=checkbox]'),
247 previewTarget: E('#fileedit-tab-preview-wrapper'),
248 cbIsExe: E('input[type=checkbox][name=exec_bit]'),
249 fsFileVersionDetails: E('#file-version-details'),
@@ -514,10 +515,26 @@
514 D.append(
515 eTgt,"[",D.a(purl,"Editor permalink"),"]"
516 );
517 return this;
518 };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
519
520 /**
521 loadFile() loads (file,checkinVersion) and updates the relevant
522 UI elements to reflect the loaded state. If passed no arguments
523 then it re-uses the values from the currently-loaded file, reloading
524
525 DDED www/fileedit-page.md
--- src/fossil.page.fileedit.js
+++ src/fossil.page.fileedit.js
@@ -240,10 +240,11 @@
240 btnReload: E("#fileedit-tab-content > .fileedit-options > "
241 +"button.fileedit-content-reload"),
242 selectPreviewMode: E('#select-preview-mode select'),
243 selectHtmlEmsWrap: E('#select-preview-html-ems'),
244 selectEolWrap: E('#select-preview-html-ems'),
245 selectFontSizeWrap: E('#select-font-size'),
246 cbLineNumbersWrap: E('#cb-line-numbers'),
247 cbAutoPreview: E('#cb-preview-autoupdate > input[type=checkbox]'),
248 previewTarget: E('#fileedit-tab-preview-wrapper'),
249 cbIsExe: E('input[type=checkbox][name=exec_bit]'),
250 fsFileVersionDetails: E('#file-version-details'),
@@ -514,10 +515,26 @@
515 D.append(
516 eTgt,"[",D.a(purl,"Editor permalink"),"]"
517 );
518 return this;
519 };
520
521 /**
522 Removes the default editor widget (and any dependent elements)
523 from the DOM, adds the given element in its place, removes this
524 method from this object, and returns this object.
525 */
526 P.replaceEditorElement = function(newEditor){
527 P.e.taEditor.parentNode.insertBefore(
528 newEditor,
529 P.e.taEditor
530 );
531 P.e.taEditor.remove();
532 P.e.selectFontSizeWrap.remove();
533 delete this.replaceEditorElement;
534 return P;
535 };
536
537 /**
538 loadFile() loads (file,checkinVersion) and updates the relevant
539 UI elements to reflect the loaded state. If passed no arguments
540 then it re-uses the values from the currently-loaded file, reloading
541
542 DDED www/fileedit-page.md
--- a/www/fileedit-page.md
+++ b/www/fileedit-page.md
@@ -0,0 +1,51 @@
1
+# The fileedit Pagsome tips and tricks for the [](/fileedit)
2
+page, which providep Disclaimers
3
+
4
+ web
5
+interface.
6
+
7
+# First and Foremost...
8
+
9
+Notes, caveats, and disclaimers:
10
+
11
+- **`/fileedit` must se?cmd= the
12
+[fileedit
13
+ a user with [the "setup" ileedit Pagsome# tting to a
14
+comma- or newline-delimited list of globs representing a whitelist of
15
+files which may be edited online. Any user with co
16
+ of access may then
17
+edit files matching one of those globs.
18
+
19
+#an "ed
20
+ then nk added to t- `/fileedit` **works by creating commits** (a.k.a. checkins), thus
21
+ hough this is c**etically*, th repository's
22
+ blockchain.
23
+- `/fileedit` is **intended to facilitate online edits of
24
+ embedded doult editor widget"should file content to
25
+. Those, in turn F ent to
26
+. Those, in turn Fi
27
+ events.
28
+, no makefiles, may break
29
+ s simply do not permit outbound - ply do not permit outbound network co`window.filed
30
+disclaimers fo r the [](/fileedit)# The fileedit Page
31
+
32
+This document describes t
33
+ page offers 3in p basic editing fea
34
+ saving changes. separately for each file. *will be ly
35
+ .
36
+
37
+Exactly h
38
+- `/fileedit` **is not a kout.valuevaluevalcheckout**. A full-featured
39
+ er otherwise leaves the page online editor
40
+
41
+
42
+full-fledged checko intentionally kept
43
+ needed for performing
44
+ basic edits online.
45
+- `/fileedit` **does not store draft versions wg the user to
46
+ a different page, any current edits *will be lost*. See the note
47
+ -fledged che kout.valuevalueva
48
+ - **Use this feature
49
+ f but makes used
50
+ the preview which
51
+
--- a/www/fileedit-page.md
+++ b/www/fileedit-page.md
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
--- a/www/fileedit-page.md
+++ b/www/fileedit-page.md
@@ -0,0 +1,51 @@
1 # The fileedit Pagsome tips and tricks for the [](/fileedit)
2 page, which providep Disclaimers
3
4 web
5 interface.
6
7 # First and Foremost...
8
9 Notes, caveats, and disclaimers:
10
11 - **`/fileedit` must se?cmd= the
12 [fileedit
13 a user with [the "setup" ileedit Pagsome# tting to a
14 comma- or newline-delimited list of globs representing a whitelist of
15 files which may be edited online. Any user with co
16 of access may then
17 edit files matching one of those globs.
18
19 #an "ed
20 then nk added to t- `/fileedit` **works by creating commits** (a.k.a. checkins), thus
21 hough this is c**etically*, th repository's
22 blockchain.
23 - `/fileedit` is **intended to facilitate online edits of
24 embedded doult editor widget"should file content to
25 . Those, in turn F ent to
26 . Those, in turn Fi
27 events.
28 , no makefiles, may break
29 s simply do not permit outbound - ply do not permit outbound network co`window.filed
30 disclaimers fo r the [](/fileedit)# The fileedit Page
31
32 This document describes t
33 page offers 3in p basic editing fea
34 saving changes. separately for each file. *will be ly
35 .
36
37 Exactly h
38 - `/fileedit` **is not a kout.valuevaluevalcheckout**. A full-featured
39 er otherwise leaves the page online editor
40
41
42 full-fledged checko intentionally kept
43 needed for performing
44 basic edits online.
45 - `/fileedit` **does not store draft versions wg the user to
46 a different page, any current edits *will be lost*. See the note
47 -fledged che kout.valuevalueva
48 - **Use this feature
49 f but makes used
50 the preview which
51
--- www/mkindex.tcl
+++ www/mkindex.tcl
@@ -41,10 +41,11 @@
4141
embeddeddoc.wiki {Embedded Project Documentation}
4242
encryptedrepos.wiki {How To Use Encrypted Repositories}
4343
env-opts.md {Environment Variables and Global Options}
4444
event.wiki {Events}
4545
faq.wiki {Frequently Asked Questions}
46
+ fileedit-page.md {The fileedit Page}
4647
fileformat.wiki {Fossil File Format}
4748
fiveminutes.wiki {Up and Running in 5 Minutes as a Single User}
4849
forum.wiki {Fossil Forums}
4950
foss-cklist.wiki {Checklist For Successful Open-Source Projects}
5051
fossil-from-msvc.wiki {Integrating Fossil in the Microsoft Express 2010 IDE}
5152
--- www/mkindex.tcl
+++ www/mkindex.tcl
@@ -41,10 +41,11 @@
41 embeddeddoc.wiki {Embedded Project Documentation}
42 encryptedrepos.wiki {How To Use Encrypted Repositories}
43 env-opts.md {Environment Variables and Global Options}
44 event.wiki {Events}
45 faq.wiki {Frequently Asked Questions}
 
46 fileformat.wiki {Fossil File Format}
47 fiveminutes.wiki {Up and Running in 5 Minutes as a Single User}
48 forum.wiki {Fossil Forums}
49 foss-cklist.wiki {Checklist For Successful Open-Source Projects}
50 fossil-from-msvc.wiki {Integrating Fossil in the Microsoft Express 2010 IDE}
51
--- www/mkindex.tcl
+++ www/mkindex.tcl
@@ -41,10 +41,11 @@
41 embeddeddoc.wiki {Embedded Project Documentation}
42 encryptedrepos.wiki {How To Use Encrypted Repositories}
43 env-opts.md {Environment Variables and Global Options}
44 event.wiki {Events}
45 faq.wiki {Frequently Asked Questions}
46 fileedit-page.md {The fileedit Page}
47 fileformat.wiki {Fossil File Format}
48 fiveminutes.wiki {Up and Running in 5 Minutes as a Single User}
49 forum.wiki {Fossil Forums}
50 foss-cklist.wiki {Checklist For Successful Open-Source Projects}
51 fossil-from-msvc.wiki {Integrating Fossil in the Microsoft Express 2010 IDE}
52
--- www/permutedindex.html
+++ www/permutedindex.html
@@ -11,11 +11,11 @@
1111
<li> <a href='quickstart.wiki'>Quick-start Guide</a>
1212
<li> <a href='history.md'>Purpose and History of Fossil</a>
1313
<li> <a href='build.wiki'>Compiling and installing Fossil</a>
1414
<li> <a href='../COPYRIGHT-BSD2.txt'>License</a>
1515
<li> <a href='$ROOT/help'>List of commands, web-pages, and settings</a>
16
-<li> <a href='userlinks.wiki'>Key Docs for Fossil Users</a>
16
+<li> <a href='userlinks.wiki'>Miscellaneous Docs for Fossil Users</a>
1717
<li> <a href='hacker-howto.wiki'>Fossil Developer's Guide</a>
1818
<li> <a href='http://www.fossil-scm.org/schimpf-book/home'>Jim Schimpf's
1919
book</a>
2020
</ul>
2121
<a name="pindex"></a>
@@ -113,10 +113,11 @@
113113
<li><a href="serverext.wiki">Extensions &mdash; CGI Server</a></li>
114114
<li><a href="serverext.wiki">Extensions To A Fossil Server Using CGI Scripts &mdash; Adding</a></li>
115115
<li><a href="adding_code.wiki">Features To Fossil &mdash; Adding New</a></li>
116116
<li><a href="fileformat.wiki">File Format &mdash; Fossil</a></li>
117117
<li><a href="globs.md"><b>File Name Glob Patterns</b></a></li>
118
+<li><a href="fileedit-page.md">fileedit Page &mdash; The</a></li>
118119
<li><a href="unvers.wiki">Files &mdash; Unversioned</a></li>
119120
<li><a href="branching.wiki">Forking, Merging, and Tagging &mdash; Branching,</a></li>
120121
<li><a href="delta_format.wiki">Format &mdash; Fossil Delta</a></li>
121122
<li><a href="fileformat.wiki">Format &mdash; Fossil File</a></li>
122123
<li><a href="image-format-vs-repo-size.md">Format vs Fossil Repo Size &mdash; Image</a></li>
@@ -206,10 +207,11 @@
206207
<li><a href="pop.wiki">Operation &mdash; Principles Of</a></li>
207208
<li><a href="cgi.wiki">Options &mdash; CGI Script Configuration</a></li>
208209
<li><a href="env-opts.md">Options &mdash; Environment Variables and Global</a></li>
209210
<li><a href="tech_overview.wiki">Overview Of The Design And Implementation Of Fossil &mdash; A Technical</a></li>
210211
<li><a href="index.wiki">Page &mdash; Home</a></li>
212
+<li><a href="fileedit-page.md">Page &mdash; The fileedit</a></li>
211213
<li><a href="aboutdownload.wiki">Page Works &mdash; How The Download</a></li>
212214
<li><a href="customskin.md">Pages &mdash; Theming: Customizing The Appearance of Web</a></li>
213215
<li><a href="password.wiki"><b>Password Management And Authentication</b></a></li>
214216
<li><a href="globs.md">Patterns &mdash; File Name Glob</a></li>
215217
<li><a href="quotes.wiki">People Are Saying About Fossil, Git, and DVCSes in General &mdash; Quotes: What</a></li>
@@ -281,10 +283,11 @@
281283
<li><a href="../test/release-checklist.wiki">Testing Checklist &mdash; Pre-Release</a></li>
282284
<li><a href="th1.md">TH1 Scripting Language &mdash; The</a></li>
283285
<li><a href="backoffice.md"><b>The "Backoffice" mechanism of Fossil</b></a></li>
284286
<li><a href="blame.wiki"><b>The Annotate/Blame Algorithm Of Fossil</b></a></li>
285287
<li><a href="defcsp.md"><b>The Default Content Security Policy</b></a></li>
288
+<li><a href="fileedit-page.md"><b>The fileedit Page</b></a></li>
286289
<li><a href="makefile.wiki"><b>The Fossil Build Process</b></a></li>
287290
<li><a href="sync.wiki"><b>The Fossil Sync Protocol</b></a></li>
288291
<li><a href="tickets.wiki"><b>The Fossil Ticket System</b></a></li>
289292
<li><a href="webui.wiki"><b>The Fossil Web Interface</b></a></li>
290293
<li><a href="history.md"><b>The Purpose And History Of Fossil</b></a></li>
291294
--- www/permutedindex.html
+++ www/permutedindex.html
@@ -11,11 +11,11 @@
11 <li> <a href='quickstart.wiki'>Quick-start Guide</a>
12 <li> <a href='history.md'>Purpose and History of Fossil</a>
13 <li> <a href='build.wiki'>Compiling and installing Fossil</a>
14 <li> <a href='../COPYRIGHT-BSD2.txt'>License</a>
15 <li> <a href='$ROOT/help'>List of commands, web-pages, and settings</a>
16 <li> <a href='userlinks.wiki'>Key Docs for Fossil Users</a>
17 <li> <a href='hacker-howto.wiki'>Fossil Developer's Guide</a>
18 <li> <a href='http://www.fossil-scm.org/schimpf-book/home'>Jim Schimpf's
19 book</a>
20 </ul>
21 <a name="pindex"></a>
@@ -113,10 +113,11 @@
113 <li><a href="serverext.wiki">Extensions &mdash; CGI Server</a></li>
114 <li><a href="serverext.wiki">Extensions To A Fossil Server Using CGI Scripts &mdash; Adding</a></li>
115 <li><a href="adding_code.wiki">Features To Fossil &mdash; Adding New</a></li>
116 <li><a href="fileformat.wiki">File Format &mdash; Fossil</a></li>
117 <li><a href="globs.md"><b>File Name Glob Patterns</b></a></li>
 
118 <li><a href="unvers.wiki">Files &mdash; Unversioned</a></li>
119 <li><a href="branching.wiki">Forking, Merging, and Tagging &mdash; Branching,</a></li>
120 <li><a href="delta_format.wiki">Format &mdash; Fossil Delta</a></li>
121 <li><a href="fileformat.wiki">Format &mdash; Fossil File</a></li>
122 <li><a href="image-format-vs-repo-size.md">Format vs Fossil Repo Size &mdash; Image</a></li>
@@ -206,10 +207,11 @@
206 <li><a href="pop.wiki">Operation &mdash; Principles Of</a></li>
207 <li><a href="cgi.wiki">Options &mdash; CGI Script Configuration</a></li>
208 <li><a href="env-opts.md">Options &mdash; Environment Variables and Global</a></li>
209 <li><a href="tech_overview.wiki">Overview Of The Design And Implementation Of Fossil &mdash; A Technical</a></li>
210 <li><a href="index.wiki">Page &mdash; Home</a></li>
 
211 <li><a href="aboutdownload.wiki">Page Works &mdash; How The Download</a></li>
212 <li><a href="customskin.md">Pages &mdash; Theming: Customizing The Appearance of Web</a></li>
213 <li><a href="password.wiki"><b>Password Management And Authentication</b></a></li>
214 <li><a href="globs.md">Patterns &mdash; File Name Glob</a></li>
215 <li><a href="quotes.wiki">People Are Saying About Fossil, Git, and DVCSes in General &mdash; Quotes: What</a></li>
@@ -281,10 +283,11 @@
281 <li><a href="../test/release-checklist.wiki">Testing Checklist &mdash; Pre-Release</a></li>
282 <li><a href="th1.md">TH1 Scripting Language &mdash; The</a></li>
283 <li><a href="backoffice.md"><b>The "Backoffice" mechanism of Fossil</b></a></li>
284 <li><a href="blame.wiki"><b>The Annotate/Blame Algorithm Of Fossil</b></a></li>
285 <li><a href="defcsp.md"><b>The Default Content Security Policy</b></a></li>
 
286 <li><a href="makefile.wiki"><b>The Fossil Build Process</b></a></li>
287 <li><a href="sync.wiki"><b>The Fossil Sync Protocol</b></a></li>
288 <li><a href="tickets.wiki"><b>The Fossil Ticket System</b></a></li>
289 <li><a href="webui.wiki"><b>The Fossil Web Interface</b></a></li>
290 <li><a href="history.md"><b>The Purpose And History Of Fossil</b></a></li>
291
--- www/permutedindex.html
+++ www/permutedindex.html
@@ -11,11 +11,11 @@
11 <li> <a href='quickstart.wiki'>Quick-start Guide</a>
12 <li> <a href='history.md'>Purpose and History of Fossil</a>
13 <li> <a href='build.wiki'>Compiling and installing Fossil</a>
14 <li> <a href='../COPYRIGHT-BSD2.txt'>License</a>
15 <li> <a href='$ROOT/help'>List of commands, web-pages, and settings</a>
16 <li> <a href='userlinks.wiki'>Miscellaneous Docs for Fossil Users</a>
17 <li> <a href='hacker-howto.wiki'>Fossil Developer's Guide</a>
18 <li> <a href='http://www.fossil-scm.org/schimpf-book/home'>Jim Schimpf's
19 book</a>
20 </ul>
21 <a name="pindex"></a>
@@ -113,10 +113,11 @@
113 <li><a href="serverext.wiki">Extensions &mdash; CGI Server</a></li>
114 <li><a href="serverext.wiki">Extensions To A Fossil Server Using CGI Scripts &mdash; Adding</a></li>
115 <li><a href="adding_code.wiki">Features To Fossil &mdash; Adding New</a></li>
116 <li><a href="fileformat.wiki">File Format &mdash; Fossil</a></li>
117 <li><a href="globs.md"><b>File Name Glob Patterns</b></a></li>
118 <li><a href="fileedit-page.md">fileedit Page &mdash; The</a></li>
119 <li><a href="unvers.wiki">Files &mdash; Unversioned</a></li>
120 <li><a href="branching.wiki">Forking, Merging, and Tagging &mdash; Branching,</a></li>
121 <li><a href="delta_format.wiki">Format &mdash; Fossil Delta</a></li>
122 <li><a href="fileformat.wiki">Format &mdash; Fossil File</a></li>
123 <li><a href="image-format-vs-repo-size.md">Format vs Fossil Repo Size &mdash; Image</a></li>
@@ -206,10 +207,11 @@
207 <li><a href="pop.wiki">Operation &mdash; Principles Of</a></li>
208 <li><a href="cgi.wiki">Options &mdash; CGI Script Configuration</a></li>
209 <li><a href="env-opts.md">Options &mdash; Environment Variables and Global</a></li>
210 <li><a href="tech_overview.wiki">Overview Of The Design And Implementation Of Fossil &mdash; A Technical</a></li>
211 <li><a href="index.wiki">Page &mdash; Home</a></li>
212 <li><a href="fileedit-page.md">Page &mdash; The fileedit</a></li>
213 <li><a href="aboutdownload.wiki">Page Works &mdash; How The Download</a></li>
214 <li><a href="customskin.md">Pages &mdash; Theming: Customizing The Appearance of Web</a></li>
215 <li><a href="password.wiki"><b>Password Management And Authentication</b></a></li>
216 <li><a href="globs.md">Patterns &mdash; File Name Glob</a></li>
217 <li><a href="quotes.wiki">People Are Saying About Fossil, Git, and DVCSes in General &mdash; Quotes: What</a></li>
@@ -281,10 +283,11 @@
283 <li><a href="../test/release-checklist.wiki">Testing Checklist &mdash; Pre-Release</a></li>
284 <li><a href="th1.md">TH1 Scripting Language &mdash; The</a></li>
285 <li><a href="backoffice.md"><b>The "Backoffice" mechanism of Fossil</b></a></li>
286 <li><a href="blame.wiki"><b>The Annotate/Blame Algorithm Of Fossil</b></a></li>
287 <li><a href="defcsp.md"><b>The Default Content Security Policy</b></a></li>
288 <li><a href="fileedit-page.md"><b>The fileedit Page</b></a></li>
289 <li><a href="makefile.wiki"><b>The Fossil Build Process</b></a></li>
290 <li><a href="sync.wiki"><b>The Fossil Sync Protocol</b></a></li>
291 <li><a href="tickets.wiki"><b>The Fossil Ticket System</b></a></li>
292 <li><a href="webui.wiki"><b>The Fossil Web Interface</b></a></li>
293 <li><a href="history.md"><b>The Purpose And History Of Fossil</b></a></li>
294

Keyboard Shortcuts

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