Fossil SCM

Style tweaks and re-did how the OPTION elements are marked is-new/is-modified so that the mobile browsers can show that state.

stephan 2020-08-01 17:56 trunk
Commit d9f4b6dbedbe051de94fad5f91ce6fa0e54571e966d4db68be20078f79d6cb00
--- src/fossil.page.wikiedit.js
+++ src/fossil.page.wikiedit.js
@@ -65,13 +65,11 @@
6565
const E = (s)=>document.querySelector(s),
6666
D = F.dom,
6767
P = F.page;
6868
6969
P.config = {
70
- /* Symbolic markers to denote certain edit state. Note that
71
- the symbols themselves are *actually* defined in CSS, so if
72
- they're changed there they also need to be changed here.*/
70
+ /* Symbolic markers to denote certain edit state. */
7371
editStateMarkers: {
7472
isNew: '[+]',
7573
isModified: '[*]'
7674
}
7775
};
@@ -268,10 +266,37 @@
268266
if(forceEvent){
269267
// Force UI update
270268
s.dispatchEvent(new Event('change',{target:s}));
271269
}
272270
};
271
+
272
+ /** Internal helper to get an edit status indicator for the given winfo object. */
273
+ const getEditMarker = function f(winfo, textOnly){
274
+ const esm = P.config.editStateMarkers;
275
+ if(1===winfo){ /* force is-new */
276
+ return textOnly ? esm.isNew :
277
+ D.addClass(D.append(D.span(),esm.isNew), 'is-new');
278
+ }else if(2===winfo){ /* force is-modified */
279
+ return textOnly ? esm.isModified :
280
+ D.addClass(D.append(D.span(),esm.isModified), 'is-modified');
281
+ }else if(winfo && winfo.version){ /* is existing page modified? */
282
+ if($stash.getWinfo(winfo)){
283
+ return textOnly ? esm.isModified :
284
+ D.addClass(D.append(D.span(),esm.isModified), 'is-modified');
285
+ }
286
+ }
287
+ else if(winfo){ /* is new non-sandbox or is modified sandbox? */
288
+ if('sandbox'!==winfo.type){
289
+ return textOnly ? esm.isNew :
290
+ D.addClass(D.append(D.span(),esm.isNew), 'is-new');
291
+ }else if($stash.getWinfo(winfo)){
292
+ return textOnly ? esm.isModified :
293
+ D.addClass(D.append(D.span(),esm.isModified), 'is-modified');
294
+ }
295
+ }
296
+ return textOnly ? '' : D.span();
297
+ };
273298
274299
/**
275300
Sets up and maintains the widgets for the list of wiki pages.
276301
*/
277302
const WikiList = {
@@ -288,26 +313,43 @@
288313
de/serialization. We need this map to support the add-new-page
289314
feature, to give us a way to check for dupes without asking
290315
the server or walking through the whole selection list.
291316
*/}
292317
},
293
- /** Updates OPTION elements to reflect whether the page has
294
- local changes or is new/unsaved. */
295
- refreshStashMarks: function(){
318
+ /**
319
+ Updates OPTION elements to reflect whether the page has local
320
+ changes or is new/unsaved. This implementation is horribly
321
+ inefficient, in that we have to walk and validate the whole
322
+ list for each stash-level change.
323
+
324
+ Reminder to self: in order to mark is-edited/is-new state we
325
+ have to update the OPTION element's inner text to reflect the
326
+ is-modified/is-new flags, rather than use CSS classes to tag
327
+ them, because mobile Chrome can neither restyle OPTION elements
328
+ no render ::before content on them. We *also* use CSS tags, but
329
+ they aren't sufficient for the mobile browsers.
330
+ */
331
+ _refreshStashMarks: function callee(){
332
+ if(!callee.eachOpt){
333
+ const self = this;
334
+ callee.eachOpt = function(key){
335
+ const opt = self.e.select.options[key];
336
+ const stashed = $stash.getWinfo({name:opt.value});
337
+ var prefix = '';
338
+ if(stashed){
339
+ const isNew = 'sandbox'===stashed.type ? false : !stashed.version;
340
+ prefix = getEditMarker(isNew ? 1 : 2, true);
341
+ D.addClass(opt, isNew ? 'stashed-new' : 'stashed');
342
+ }else{
343
+ D.removeClass(opt, 'stashed', 'stashed-new');
344
+ }
345
+ opt.innerText = prefix + opt.value;
346
+ self.cache.names[opt.value] = true;
347
+ };
348
+ }
296349
this.cache.names = {/*must reset it to acount for local page removals*/};
297
- const select = this.e.select, self = this;
298
- Object.keys(select.options).forEach(function(key){
299
- const opt = select.options[key];
300
- const stashed = $stash.getWinfo({name:opt.value});
301
- if(stashed){
302
- const isNew = 'sandbox'===stashed.type ? false : !stashed.version;
303
- D.addClass(opt, isNew ? 'stashed-new' :'stashed');
304
- }else{
305
- D.removeClass(opt, 'stashed', 'stashed-new');
306
- }
307
- self.cache.names[opt.value] = true;
308
- });
350
+ Object.keys(this.e.select.options).forEach(callee.eachOpt);
309351
},
310352
/** Removes the given wiki page entry from the page selection
311353
list, if it's in the list. */
312354
removeEntry: function(name){
313355
const sel = this.e.select;
@@ -320,11 +362,12 @@
320362
sel.selectedIndex = ndx;
321363
},
322364
323365
/**
324366
Rebuilds the selection list. Necessary when it's loaded from
325
- the server or we locally create a new page. */
367
+ the server or we locally create a new page.
368
+ */
326369
_rebuildList: function callee(){
327370
/* Jump through some hoops to integrate new/unsaved
328371
pages into the list of existing pages... We use a map
329372
as an intermediary in order to filter out any local-stash
330373
dupes from server-side copies. */
@@ -356,11 +399,11 @@
356399
const cb = self.e.filterCheckboxes[wtype];
357400
if(cb && !cb.checked) D.addClass(opt, 'hidden');
358401
});
359402
D.enable(sel);
360403
if(P.winfo) sel.value = P.winfo.name;
361
- this.refreshStashMarks();
404
+ this._refreshStashMarks();
362405
},
363406
364407
/** Loads the page list and populates the selection list. */
365408
loadList: function callee(){
366409
delete this.pageMap;
@@ -453,11 +496,11 @@
453496
D.attr(sel, 'size', 15);
454497
D.option(D.disable(D.clearElement(sel)), "Loading...");
455498
456499
/** Set up filter checkboxes for the various types
457500
of wiki pages... */
458
- const fsFilter = D.fieldset("Wiki page types"),
501
+ const fsFilter = D.fieldset("Page types"),
459502
fsFilterBody = D.div(),
460503
filters = ['normal', 'branch', 'checkin', 'tag']
461504
;
462505
D.append(fsFilter, fsFilterBody);
463506
D.addClass(fsFilterBody, 'flex-container', 'flex-column', 'stretch');
@@ -491,14 +534,12 @@
491534
fsLegendBody = D.div();
492535
D.append(fsLegend, fsLegendBody);
493536
D.addClass(fsLegendBody, 'flex-container', 'flex-column', 'stretch');
494537
D.append(
495538
fsLegendBody,
496
- D.append(D.span(), P.config.editStateMarkers.isModified,
497
- " = page has local edits"),
498
- D.append(D.span(), P.config.editStateMarkers.isNew,
499
- " = page is new/unsaved")
539
+ D.append(D.span(), getEditMarker(1,false)," = page is new/unsaved"),
540
+ D.append(D.span(), getEditMarker(2,false)," = page has local edits")
500541
);
501542
502543
const fsNewPage = D.fieldset("Create new page"),
503544
fsNewPageBody = D.div(),
504545
newPageName = D.input('text'),
@@ -528,11 +569,11 @@
528569
btn.addEventListener('click', ()=>this.loadList(), false);
529570
this.loadList();
530571
const onSelect = (e)=>P.loadPage(e.target.value);
531572
sel.addEventListener('change', onSelect, false);
532573
sel.addEventListener('dblclick', onSelect, false);
533
- F.page.addEventListener('wiki-stash-updated', ()=>this.refreshStashMarks());
574
+ F.page.addEventListener('wiki-stash-updated', ()=>this._refreshStashMarks());
534575
delete this.init;
535576
}
536577
};
537578
538579
/**
@@ -684,15 +725,15 @@
684725
"then use the Discard button.");
685726
return;
686727
}
687728
P.unstashContent()
688729
if(w.version || w.type==='sandbox'){
689
- P.loadPage();
730
+ P.loadPage(w);
690731
}else{
691732
WikiList.removeEntry(w.name);
692
- P.updatePageTitle();
693733
delete P.winfo;
734
+ P.updatePageTitle();
694735
F.message("Discarded new page ["+w.name+"].");
695736
}
696737
},
697738
ticks: 3
698739
});
@@ -792,11 +833,11 @@
792833
if(!P.winfo && !quiet) F.error("No wiki page is loaded.");
793834
return !!P.winfo;
794835
};
795836
796837
/** Updates the in-tab title/edit status information */
797
- P.updateEditStatus = function f(editFlag/*for use by updatePageTitle() only*/){
838
+ P.updateEditStatus = function f(){
798839
if(!f.eLinks){
799840
f.eName = P.e.editStatus.querySelector('span.name');
800841
f.eLinks = P.e.editStatus.querySelector('span.links');
801842
}
802843
const wi = this.winfo;
@@ -803,15 +844,11 @@
803844
D.clearElement(f.eName, f.eLinks);
804845
if(!wi){
805846
D.append(f.eName, '(no page loaded)');
806847
return;
807848
}
808
- var marker = editFlag || '';
809
- if(0===arguments){
810
- if(!wi.version && 'sandbox'!==wi.type) marker = P.config.editStateMarkers.isNew;
811
- else if($stash.getWinfo(wi)) marker = P.config.editStateMarkers.isModified;
812
- }
849
+ var marker = getEditMarker(wi, false);
813850
D.append(f.eName,marker,wi.name,);
814851
if(wi.version){
815852
D.append(
816853
f.eLinks,
817854
D.a(F.repoUrl('whistory',{name:wi.name}),'[history]'),
@@ -827,21 +864,14 @@
827864
*/
828865
P.updatePageTitle = function f(){
829866
if(!f.titleElement){
830867
f.titleElement = document.head.querySelector('title');
831868
}
832
- var title, marker = '';
833
- const wi = P.winfo;
834
- if(wi){
835
- if(!wi.version && 'sandbox'!==wi.type) marker = P.config.editStateMarkers.isNew;
836
- else if($stash.getWinfo(wi)) marker = P.config.editStateMarkers.isModified;
837
- title = wi.name;
838
- }else{
839
- title = 'no page loaded';
840
- }
869
+ const wi = P.winfo, marker = getEditMarker(wi, true),
870
+ title = wi ? wi.name : 'no page loaded';
841871
f.titleElement.innerText = 'Wiki Editor: ' + marker + title;
842
- this.updateEditStatus(marker);
872
+ this.updateEditStatus();
843873
return this;
844874
};
845875
846876
/**
847877
Change the save button depending on whether we have stuff to save
@@ -848,11 +878,11 @@
848878
or not.
849879
*/
850880
P.updateSaveButton = function(){
851881
if(!this.winfo || !this.getStashedWinfo(this.winfo)){
852882
D.disable(this.e.btnSave).innerText =
853
- "There are no changes to save";
883
+ "No changes to save";
854884
}else{
855885
D.enable(this.e.btnSave).innerText = "Save changes";
856886
}
857887
return this;
858888
};
@@ -951,12 +981,11 @@
951981
name = arg.name;
952982
}
953983
const onload = (r)=>this.dispatchEvent('wiki-page-loaded', r);
954984
const stashWinfo = this.getStashedWinfo({name: name});
955985
if(stashWinfo){ // fake a response from the stash...
956
- F.message("Fetched from the local-edit storage:",
957
- stashWinfo.name);
986
+ F.message("Fetched from the local-edit storage:", stashWinfo.name);
958987
onload({
959988
name: stashWinfo.name,
960989
mimetype: stashWinfo.mimetype,
961990
type: stashWinfo.type,
962991
version: stashWinfo.version,
963992
--- src/fossil.page.wikiedit.js
+++ src/fossil.page.wikiedit.js
@@ -65,13 +65,11 @@
65 const E = (s)=>document.querySelector(s),
66 D = F.dom,
67 P = F.page;
68
69 P.config = {
70 /* Symbolic markers to denote certain edit state. Note that
71 the symbols themselves are *actually* defined in CSS, so if
72 they're changed there they also need to be changed here.*/
73 editStateMarkers: {
74 isNew: '[+]',
75 isModified: '[*]'
76 }
77 };
@@ -268,10 +266,37 @@
268 if(forceEvent){
269 // Force UI update
270 s.dispatchEvent(new Event('change',{target:s}));
271 }
272 };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
273
274 /**
275 Sets up and maintains the widgets for the list of wiki pages.
276 */
277 const WikiList = {
@@ -288,26 +313,43 @@
288 de/serialization. We need this map to support the add-new-page
289 feature, to give us a way to check for dupes without asking
290 the server or walking through the whole selection list.
291 */}
292 },
293 /** Updates OPTION elements to reflect whether the page has
294 local changes or is new/unsaved. */
295 refreshStashMarks: function(){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
296 this.cache.names = {/*must reset it to acount for local page removals*/};
297 const select = this.e.select, self = this;
298 Object.keys(select.options).forEach(function(key){
299 const opt = select.options[key];
300 const stashed = $stash.getWinfo({name:opt.value});
301 if(stashed){
302 const isNew = 'sandbox'===stashed.type ? false : !stashed.version;
303 D.addClass(opt, isNew ? 'stashed-new' :'stashed');
304 }else{
305 D.removeClass(opt, 'stashed', 'stashed-new');
306 }
307 self.cache.names[opt.value] = true;
308 });
309 },
310 /** Removes the given wiki page entry from the page selection
311 list, if it's in the list. */
312 removeEntry: function(name){
313 const sel = this.e.select;
@@ -320,11 +362,12 @@
320 sel.selectedIndex = ndx;
321 },
322
323 /**
324 Rebuilds the selection list. Necessary when it's loaded from
325 the server or we locally create a new page. */
 
326 _rebuildList: function callee(){
327 /* Jump through some hoops to integrate new/unsaved
328 pages into the list of existing pages... We use a map
329 as an intermediary in order to filter out any local-stash
330 dupes from server-side copies. */
@@ -356,11 +399,11 @@
356 const cb = self.e.filterCheckboxes[wtype];
357 if(cb && !cb.checked) D.addClass(opt, 'hidden');
358 });
359 D.enable(sel);
360 if(P.winfo) sel.value = P.winfo.name;
361 this.refreshStashMarks();
362 },
363
364 /** Loads the page list and populates the selection list. */
365 loadList: function callee(){
366 delete this.pageMap;
@@ -453,11 +496,11 @@
453 D.attr(sel, 'size', 15);
454 D.option(D.disable(D.clearElement(sel)), "Loading...");
455
456 /** Set up filter checkboxes for the various types
457 of wiki pages... */
458 const fsFilter = D.fieldset("Wiki page types"),
459 fsFilterBody = D.div(),
460 filters = ['normal', 'branch', 'checkin', 'tag']
461 ;
462 D.append(fsFilter, fsFilterBody);
463 D.addClass(fsFilterBody, 'flex-container', 'flex-column', 'stretch');
@@ -491,14 +534,12 @@
491 fsLegendBody = D.div();
492 D.append(fsLegend, fsLegendBody);
493 D.addClass(fsLegendBody, 'flex-container', 'flex-column', 'stretch');
494 D.append(
495 fsLegendBody,
496 D.append(D.span(), P.config.editStateMarkers.isModified,
497 " = page has local edits"),
498 D.append(D.span(), P.config.editStateMarkers.isNew,
499 " = page is new/unsaved")
500 );
501
502 const fsNewPage = D.fieldset("Create new page"),
503 fsNewPageBody = D.div(),
504 newPageName = D.input('text'),
@@ -528,11 +569,11 @@
528 btn.addEventListener('click', ()=>this.loadList(), false);
529 this.loadList();
530 const onSelect = (e)=>P.loadPage(e.target.value);
531 sel.addEventListener('change', onSelect, false);
532 sel.addEventListener('dblclick', onSelect, false);
533 F.page.addEventListener('wiki-stash-updated', ()=>this.refreshStashMarks());
534 delete this.init;
535 }
536 };
537
538 /**
@@ -684,15 +725,15 @@
684 "then use the Discard button.");
685 return;
686 }
687 P.unstashContent()
688 if(w.version || w.type==='sandbox'){
689 P.loadPage();
690 }else{
691 WikiList.removeEntry(w.name);
692 P.updatePageTitle();
693 delete P.winfo;
 
694 F.message("Discarded new page ["+w.name+"].");
695 }
696 },
697 ticks: 3
698 });
@@ -792,11 +833,11 @@
792 if(!P.winfo && !quiet) F.error("No wiki page is loaded.");
793 return !!P.winfo;
794 };
795
796 /** Updates the in-tab title/edit status information */
797 P.updateEditStatus = function f(editFlag/*for use by updatePageTitle() only*/){
798 if(!f.eLinks){
799 f.eName = P.e.editStatus.querySelector('span.name');
800 f.eLinks = P.e.editStatus.querySelector('span.links');
801 }
802 const wi = this.winfo;
@@ -803,15 +844,11 @@
803 D.clearElement(f.eName, f.eLinks);
804 if(!wi){
805 D.append(f.eName, '(no page loaded)');
806 return;
807 }
808 var marker = editFlag || '';
809 if(0===arguments){
810 if(!wi.version && 'sandbox'!==wi.type) marker = P.config.editStateMarkers.isNew;
811 else if($stash.getWinfo(wi)) marker = P.config.editStateMarkers.isModified;
812 }
813 D.append(f.eName,marker,wi.name,);
814 if(wi.version){
815 D.append(
816 f.eLinks,
817 D.a(F.repoUrl('whistory',{name:wi.name}),'[history]'),
@@ -827,21 +864,14 @@
827 */
828 P.updatePageTitle = function f(){
829 if(!f.titleElement){
830 f.titleElement = document.head.querySelector('title');
831 }
832 var title, marker = '';
833 const wi = P.winfo;
834 if(wi){
835 if(!wi.version && 'sandbox'!==wi.type) marker = P.config.editStateMarkers.isNew;
836 else if($stash.getWinfo(wi)) marker = P.config.editStateMarkers.isModified;
837 title = wi.name;
838 }else{
839 title = 'no page loaded';
840 }
841 f.titleElement.innerText = 'Wiki Editor: ' + marker + title;
842 this.updateEditStatus(marker);
843 return this;
844 };
845
846 /**
847 Change the save button depending on whether we have stuff to save
@@ -848,11 +878,11 @@
848 or not.
849 */
850 P.updateSaveButton = function(){
851 if(!this.winfo || !this.getStashedWinfo(this.winfo)){
852 D.disable(this.e.btnSave).innerText =
853 "There are no changes to save";
854 }else{
855 D.enable(this.e.btnSave).innerText = "Save changes";
856 }
857 return this;
858 };
@@ -951,12 +981,11 @@
951 name = arg.name;
952 }
953 const onload = (r)=>this.dispatchEvent('wiki-page-loaded', r);
954 const stashWinfo = this.getStashedWinfo({name: name});
955 if(stashWinfo){ // fake a response from the stash...
956 F.message("Fetched from the local-edit storage:",
957 stashWinfo.name);
958 onload({
959 name: stashWinfo.name,
960 mimetype: stashWinfo.mimetype,
961 type: stashWinfo.type,
962 version: stashWinfo.version,
963
--- src/fossil.page.wikiedit.js
+++ src/fossil.page.wikiedit.js
@@ -65,13 +65,11 @@
65 const E = (s)=>document.querySelector(s),
66 D = F.dom,
67 P = F.page;
68
69 P.config = {
70 /* Symbolic markers to denote certain edit state. */
 
 
71 editStateMarkers: {
72 isNew: '[+]',
73 isModified: '[*]'
74 }
75 };
@@ -268,10 +266,37 @@
266 if(forceEvent){
267 // Force UI update
268 s.dispatchEvent(new Event('change',{target:s}));
269 }
270 };
271
272 /** Internal helper to get an edit status indicator for the given winfo object. */
273 const getEditMarker = function f(winfo, textOnly){
274 const esm = P.config.editStateMarkers;
275 if(1===winfo){ /* force is-new */
276 return textOnly ? esm.isNew :
277 D.addClass(D.append(D.span(),esm.isNew), 'is-new');
278 }else if(2===winfo){ /* force is-modified */
279 return textOnly ? esm.isModified :
280 D.addClass(D.append(D.span(),esm.isModified), 'is-modified');
281 }else if(winfo && winfo.version){ /* is existing page modified? */
282 if($stash.getWinfo(winfo)){
283 return textOnly ? esm.isModified :
284 D.addClass(D.append(D.span(),esm.isModified), 'is-modified');
285 }
286 }
287 else if(winfo){ /* is new non-sandbox or is modified sandbox? */
288 if('sandbox'!==winfo.type){
289 return textOnly ? esm.isNew :
290 D.addClass(D.append(D.span(),esm.isNew), 'is-new');
291 }else if($stash.getWinfo(winfo)){
292 return textOnly ? esm.isModified :
293 D.addClass(D.append(D.span(),esm.isModified), 'is-modified');
294 }
295 }
296 return textOnly ? '' : D.span();
297 };
298
299 /**
300 Sets up and maintains the widgets for the list of wiki pages.
301 */
302 const WikiList = {
@@ -288,26 +313,43 @@
313 de/serialization. We need this map to support the add-new-page
314 feature, to give us a way to check for dupes without asking
315 the server or walking through the whole selection list.
316 */}
317 },
318 /**
319 Updates OPTION elements to reflect whether the page has local
320 changes or is new/unsaved. This implementation is horribly
321 inefficient, in that we have to walk and validate the whole
322 list for each stash-level change.
323
324 Reminder to self: in order to mark is-edited/is-new state we
325 have to update the OPTION element's inner text to reflect the
326 is-modified/is-new flags, rather than use CSS classes to tag
327 them, because mobile Chrome can neither restyle OPTION elements
328 no render ::before content on them. We *also* use CSS tags, but
329 they aren't sufficient for the mobile browsers.
330 */
331 _refreshStashMarks: function callee(){
332 if(!callee.eachOpt){
333 const self = this;
334 callee.eachOpt = function(key){
335 const opt = self.e.select.options[key];
336 const stashed = $stash.getWinfo({name:opt.value});
337 var prefix = '';
338 if(stashed){
339 const isNew = 'sandbox'===stashed.type ? false : !stashed.version;
340 prefix = getEditMarker(isNew ? 1 : 2, true);
341 D.addClass(opt, isNew ? 'stashed-new' : 'stashed');
342 }else{
343 D.removeClass(opt, 'stashed', 'stashed-new');
344 }
345 opt.innerText = prefix + opt.value;
346 self.cache.names[opt.value] = true;
347 };
348 }
349 this.cache.names = {/*must reset it to acount for local page removals*/};
350 Object.keys(this.e.select.options).forEach(callee.eachOpt);
 
 
 
 
 
 
 
 
 
 
 
351 },
352 /** Removes the given wiki page entry from the page selection
353 list, if it's in the list. */
354 removeEntry: function(name){
355 const sel = this.e.select;
@@ -320,11 +362,12 @@
362 sel.selectedIndex = ndx;
363 },
364
365 /**
366 Rebuilds the selection list. Necessary when it's loaded from
367 the server or we locally create a new page.
368 */
369 _rebuildList: function callee(){
370 /* Jump through some hoops to integrate new/unsaved
371 pages into the list of existing pages... We use a map
372 as an intermediary in order to filter out any local-stash
373 dupes from server-side copies. */
@@ -356,11 +399,11 @@
399 const cb = self.e.filterCheckboxes[wtype];
400 if(cb && !cb.checked) D.addClass(opt, 'hidden');
401 });
402 D.enable(sel);
403 if(P.winfo) sel.value = P.winfo.name;
404 this._refreshStashMarks();
405 },
406
407 /** Loads the page list and populates the selection list. */
408 loadList: function callee(){
409 delete this.pageMap;
@@ -453,11 +496,11 @@
496 D.attr(sel, 'size', 15);
497 D.option(D.disable(D.clearElement(sel)), "Loading...");
498
499 /** Set up filter checkboxes for the various types
500 of wiki pages... */
501 const fsFilter = D.fieldset("Page types"),
502 fsFilterBody = D.div(),
503 filters = ['normal', 'branch', 'checkin', 'tag']
504 ;
505 D.append(fsFilter, fsFilterBody);
506 D.addClass(fsFilterBody, 'flex-container', 'flex-column', 'stretch');
@@ -491,14 +534,12 @@
534 fsLegendBody = D.div();
535 D.append(fsLegend, fsLegendBody);
536 D.addClass(fsLegendBody, 'flex-container', 'flex-column', 'stretch');
537 D.append(
538 fsLegendBody,
539 D.append(D.span(), getEditMarker(1,false)," = page is new/unsaved"),
540 D.append(D.span(), getEditMarker(2,false)," = page has local edits")
 
 
541 );
542
543 const fsNewPage = D.fieldset("Create new page"),
544 fsNewPageBody = D.div(),
545 newPageName = D.input('text'),
@@ -528,11 +569,11 @@
569 btn.addEventListener('click', ()=>this.loadList(), false);
570 this.loadList();
571 const onSelect = (e)=>P.loadPage(e.target.value);
572 sel.addEventListener('change', onSelect, false);
573 sel.addEventListener('dblclick', onSelect, false);
574 F.page.addEventListener('wiki-stash-updated', ()=>this._refreshStashMarks());
575 delete this.init;
576 }
577 };
578
579 /**
@@ -684,15 +725,15 @@
725 "then use the Discard button.");
726 return;
727 }
728 P.unstashContent()
729 if(w.version || w.type==='sandbox'){
730 P.loadPage(w);
731 }else{
732 WikiList.removeEntry(w.name);
 
733 delete P.winfo;
734 P.updatePageTitle();
735 F.message("Discarded new page ["+w.name+"].");
736 }
737 },
738 ticks: 3
739 });
@@ -792,11 +833,11 @@
833 if(!P.winfo && !quiet) F.error("No wiki page is loaded.");
834 return !!P.winfo;
835 };
836
837 /** Updates the in-tab title/edit status information */
838 P.updateEditStatus = function f(){
839 if(!f.eLinks){
840 f.eName = P.e.editStatus.querySelector('span.name');
841 f.eLinks = P.e.editStatus.querySelector('span.links');
842 }
843 const wi = this.winfo;
@@ -803,15 +844,11 @@
844 D.clearElement(f.eName, f.eLinks);
845 if(!wi){
846 D.append(f.eName, '(no page loaded)');
847 return;
848 }
849 var marker = getEditMarker(wi, false);
 
 
 
 
850 D.append(f.eName,marker,wi.name,);
851 if(wi.version){
852 D.append(
853 f.eLinks,
854 D.a(F.repoUrl('whistory',{name:wi.name}),'[history]'),
@@ -827,21 +864,14 @@
864 */
865 P.updatePageTitle = function f(){
866 if(!f.titleElement){
867 f.titleElement = document.head.querySelector('title');
868 }
869 const wi = P.winfo, marker = getEditMarker(wi, true),
870 title = wi ? wi.name : 'no page loaded';
 
 
 
 
 
 
 
871 f.titleElement.innerText = 'Wiki Editor: ' + marker + title;
872 this.updateEditStatus();
873 return this;
874 };
875
876 /**
877 Change the save button depending on whether we have stuff to save
@@ -848,11 +878,11 @@
878 or not.
879 */
880 P.updateSaveButton = function(){
881 if(!this.winfo || !this.getStashedWinfo(this.winfo)){
882 D.disable(this.e.btnSave).innerText =
883 "No changes to save";
884 }else{
885 D.enable(this.e.btnSave).innerText = "Save changes";
886 }
887 return this;
888 };
@@ -951,12 +981,11 @@
981 name = arg.name;
982 }
983 const onload = (r)=>this.dispatchEvent('wiki-page-loaded', r);
984 const stashWinfo = this.getStashedWinfo({name: name});
985 if(stashWinfo){ // fake a response from the stash...
986 F.message("Fetched from the local-edit storage:", stashWinfo.name);
 
987 onload({
988 name: stashWinfo.name,
989 mimetype: stashWinfo.mimetype,
990 type: stashWinfo.type,
991 version: stashWinfo.version,
992
--- src/style.wikiedit.css
+++ src/style.wikiedit.css
@@ -9,10 +9,11 @@
99
body.wikiedit select,
1010
body.wikiedit select:focus{
1111
/* The sudden appearance of a border (as in the Ardoise skin)
1212
shifts the layout in unsightly ways */
1313
border: initial;
14
+ border-width: 1px;
1415
}
1516
body.wikiedit div.wikiedit-preview {
1617
margin: 0;
1718
padding: 0;
1819
}
@@ -53,23 +54,19 @@
5354
align-items: start;
5455
}
5556
body.wikiedit .WikiList select {
5657
font-size: 110%;
5758
margin: initial;
58
- height: initial /* some skins set these to a fix height */;
59
+ height: initial /* some skins set these to a fixed height */;
60
+ font-family: monospace;
5961
}
6062
body.wikiedit .WikiList select option {
61
- margin: 0.5em 0;
62
-}
63
-body.wikiedit .WikiList select option.stashed::before {
64
-/* Maintenance reminder: the option.stashed/stashed-new "content" values
65
- are duplicated in fossil.page.wikiedit.js and need to be changed there
66
- if they are changed here: see fossil.page.config.editStateMarkers */
67
- content: "[*] ";
68
-}
69
-body.wikiedit .WikiList select option.stashed-new::before {
70
- content: "[+] ";
63
+ margin: 0 0 0.5em 0.55em;
64
+}
65
+body.wikiedit .WikiList select option.stashed,
66
+body.wikiedit .WikiList select option.stashed-new {
67
+ margin-left: -1em;
7168
}
7269
body.wikiedit textarea {
7370
max-width: initial;
7471
}
7572
body.wikiedit .tabs .tab-panel {
@@ -77,13 +74,16 @@
7774
overflow: auto;
7875
}
7976
body.wikiedit .WikiList fieldset {
8077
padding: 0.25em;
8178
border-width: 1px /* Ardoise skin sets this to 0 */;
79
+ min-width: 6em;
80
+ border-style: inset;
8281
}
8382
body.wikiedit .WikiList legend {
8483
font-size: 90%;
84
+ margin: 0 0 0 0.5em;
8585
}
8686
body.wikiedit .WikiList fieldset > :not(legend) {
8787
/* Stretch page selection list when it's empty or only has short page names */
8888
width: 100%;
8989
}
@@ -133,9 +133,13 @@
133133
font-size: 1.2em;
134134
}
135135
136136
body.wikiedit #wikiedit-edit-status > span {
137137
display: block;
138
+}
139
+body.wikiedit .WikiList span.is-new,
140
+body.wikiedit .WikiList span.is-modified {
141
+ font-family: monospace;
138142
}
139143
body.wikiedit #wikiedit-edit-status > span.links > a {
140144
margin: 0 0.25em;
141145
}
142146
--- src/style.wikiedit.css
+++ src/style.wikiedit.css
@@ -9,10 +9,11 @@
9 body.wikiedit select,
10 body.wikiedit select:focus{
11 /* The sudden appearance of a border (as in the Ardoise skin)
12 shifts the layout in unsightly ways */
13 border: initial;
 
14 }
15 body.wikiedit div.wikiedit-preview {
16 margin: 0;
17 padding: 0;
18 }
@@ -53,23 +54,19 @@
53 align-items: start;
54 }
55 body.wikiedit .WikiList select {
56 font-size: 110%;
57 margin: initial;
58 height: initial /* some skins set these to a fix height */;
 
59 }
60 body.wikiedit .WikiList select option {
61 margin: 0.5em 0;
62 }
63 body.wikiedit .WikiList select option.stashed::before {
64 /* Maintenance reminder: the option.stashed/stashed-new "content" values
65 are duplicated in fossil.page.wikiedit.js and need to be changed there
66 if they are changed here: see fossil.page.config.editStateMarkers */
67 content: "[*] ";
68 }
69 body.wikiedit .WikiList select option.stashed-new::before {
70 content: "[+] ";
71 }
72 body.wikiedit textarea {
73 max-width: initial;
74 }
75 body.wikiedit .tabs .tab-panel {
@@ -77,13 +74,16 @@
77 overflow: auto;
78 }
79 body.wikiedit .WikiList fieldset {
80 padding: 0.25em;
81 border-width: 1px /* Ardoise skin sets this to 0 */;
 
 
82 }
83 body.wikiedit .WikiList legend {
84 font-size: 90%;
 
85 }
86 body.wikiedit .WikiList fieldset > :not(legend) {
87 /* Stretch page selection list when it's empty or only has short page names */
88 width: 100%;
89 }
@@ -133,9 +133,13 @@
133 font-size: 1.2em;
134 }
135
136 body.wikiedit #wikiedit-edit-status > span {
137 display: block;
 
 
 
 
138 }
139 body.wikiedit #wikiedit-edit-status > span.links > a {
140 margin: 0 0.25em;
141 }
142
--- src/style.wikiedit.css
+++ src/style.wikiedit.css
@@ -9,10 +9,11 @@
9 body.wikiedit select,
10 body.wikiedit select:focus{
11 /* The sudden appearance of a border (as in the Ardoise skin)
12 shifts the layout in unsightly ways */
13 border: initial;
14 border-width: 1px;
15 }
16 body.wikiedit div.wikiedit-preview {
17 margin: 0;
18 padding: 0;
19 }
@@ -53,23 +54,19 @@
54 align-items: start;
55 }
56 body.wikiedit .WikiList select {
57 font-size: 110%;
58 margin: initial;
59 height: initial /* some skins set these to a fixed height */;
60 font-family: monospace;
61 }
62 body.wikiedit .WikiList select option {
63 margin: 0 0 0.5em 0.55em;
64 }
65 body.wikiedit .WikiList select option.stashed,
66 body.wikiedit .WikiList select option.stashed-new {
67 margin-left: -1em;
 
 
 
 
 
68 }
69 body.wikiedit textarea {
70 max-width: initial;
71 }
72 body.wikiedit .tabs .tab-panel {
@@ -77,13 +74,16 @@
74 overflow: auto;
75 }
76 body.wikiedit .WikiList fieldset {
77 padding: 0.25em;
78 border-width: 1px /* Ardoise skin sets this to 0 */;
79 min-width: 6em;
80 border-style: inset;
81 }
82 body.wikiedit .WikiList legend {
83 font-size: 90%;
84 margin: 0 0 0 0.5em;
85 }
86 body.wikiedit .WikiList fieldset > :not(legend) {
87 /* Stretch page selection list when it's empty or only has short page names */
88 width: 100%;
89 }
@@ -133,9 +133,13 @@
133 font-size: 1.2em;
134 }
135
136 body.wikiedit #wikiedit-edit-status > span {
137 display: block;
138 }
139 body.wikiedit .WikiList span.is-new,
140 body.wikiedit .WikiList span.is-modified {
141 font-family: monospace;
142 }
143 body.wikiedit #wikiedit-edit-status > span.links > a {
144 margin: 0 0.25em;
145 }
146

Keyboard Shortcuts

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