Fossil SCM
Add support for ticket/... wiki pages to /wikiedit.
Commit
f01d60fd175fbf34d6423d9aed3c0381a6012c122962f1a7cd539b035a35dacc
Parent
74b149f2e25916f…
1 file changed
+9
-8
+9
-8
| --- src/fossil.page.wikiedit.js | ||
| +++ src/fossil.page.wikiedit.js | ||
| @@ -14,11 +14,11 @@ | ||
| 14 | 14 | cache), in the form of an "winfo" object: |
| 15 | 15 | |
| 16 | 16 | { |
| 17 | 17 | name: string, |
| 18 | 18 | mimetype: mimetype string, |
| 19 | - type: "normal" | "tag" | "checkin" | "branch" | "sandbox", | |
| 19 | + type: "normal" | "tag" | "checkin" | "branch" | "ticket" | "sandbox", | |
| 20 | 20 | version: UUID string or null for a sandbox page or new page, |
| 21 | 21 | parent: parent UUID string or null if no parent, |
| 22 | 22 | isEmpty: true if page has no content (is "deleted"). |
| 23 | 23 | content: string, optional in most contexts |
| 24 | 24 | } |
| @@ -192,11 +192,11 @@ | ||
| 192 | 192 | name: winfo.name |
| 193 | 193 | }); |
| 194 | 194 | record.mimetype = winfo.mimetype; |
| 195 | 195 | record.type = winfo.type; |
| 196 | 196 | record.parent = winfo.parent; |
| 197 | - record.version = winfo.version; | |
| 197 | + record.version = winfo.version; | |
| 198 | 198 | record.stashTime = new Date().getTime(); |
| 199 | 199 | record.isEmpty = !!winfo.isEmpty; |
| 200 | 200 | record.attachments = winfo.attachments; |
| 201 | 201 | this.storeIndex(); |
| 202 | 202 | if(arguments.length>1){ |
| @@ -207,11 +207,11 @@ | ||
| 207 | 207 | return this; |
| 208 | 208 | }, |
| 209 | 209 | /** |
| 210 | 210 | Returns the stashed content, if any, for the given winfo |
| 211 | 211 | object. |
| 212 | - */ | |
| 212 | + */ | |
| 213 | 213 | stashedContent: function(winfo){ |
| 214 | 214 | return F.storage.get(this.contentKey(this.indexKey(winfo))); |
| 215 | 215 | }, |
| 216 | 216 | /** Returns true if we have stashed content for the given winfo |
| 217 | 217 | record or page name. */ |
| @@ -270,11 +270,11 @@ | ||
| 270 | 270 | if(n) this._fireStashEvent(); |
| 271 | 271 | } |
| 272 | 272 | }; |
| 273 | 273 | $stash.prune.defaultMaxCount = P.config.defaultMaxStashSize || 10; |
| 274 | 274 | P.$stash = $stash /* we have to expose this for the new-page case :/ */; |
| 275 | - | |
| 275 | + | |
| 276 | 276 | /** |
| 277 | 277 | Internal workaround to select the current preview mode |
| 278 | 278 | and fire a change event if the value actually changes |
| 279 | 279 | or if forceEvent is truthy. |
| 280 | 280 | */ |
| @@ -536,10 +536,11 @@ | ||
| 536 | 536 | name = name.trim(); |
| 537 | 537 | if(!this.validatePageName(name)) return false; |
| 538 | 538 | var wtype = 'normal'; |
| 539 | 539 | if(0===name.indexOf('checkin/')) wtype = 'checkin'; |
| 540 | 540 | else if(0===name.indexOf('branch/')) wtype = 'branch'; |
| 541 | + else if(0===name.indexOf('ticket/')) wtype = 'ticket'; | |
| 541 | 542 | else if(0===name.indexOf('tag/')) wtype = 'tag'; |
| 542 | 543 | /* ^^^ note that we're not validating that, e.g., checkin/XYZ |
| 543 | 544 | has a full artifact ID after "checkin/". */ |
| 544 | 545 | const winfo = { |
| 545 | 546 | name: name, type: wtype, mimetype: 'text/x-markdown', |
| @@ -573,11 +574,11 @@ | ||
| 573 | 574 | |
| 574 | 575 | /** Set up filter checkboxes for the various types |
| 575 | 576 | of wiki pages... */ |
| 576 | 577 | const fsFilter = D.addClass(D.fieldset("Page types"),"page-types-list"), |
| 577 | 578 | fsFilterBody = D.div(), |
| 578 | - filters = ['normal', 'branch/...', 'tag/...', 'checkin/...'] | |
| 579 | + filters = ['normal', 'branch/...', 'tag/...', 'checkin/...', 'ticket/...'] | |
| 579 | 580 | ; |
| 580 | 581 | D.append(fsFilter, fsFilterBody); |
| 581 | 582 | D.addClass(fsFilterBody, 'flex-container', 'flex-column', 'stretch'); |
| 582 | 583 | |
| 583 | 584 | // Add filters by page type... |
| @@ -1045,11 +1046,11 @@ | ||
| 1045 | 1046 | P.e.btnSave.addEventListener('click', ()=>doSave(), false); |
| 1046 | 1047 | P.e.btnSaveClose.addEventListener('click', ()=>doSave(true), false); |
| 1047 | 1048 | } |
| 1048 | 1049 | |
| 1049 | 1050 | P.e.taEditor.addEventListener('change', ()=>P.notifyOfChange(), false); |
| 1050 | - | |
| 1051 | + | |
| 1051 | 1052 | P.selectMimetype(false, true); |
| 1052 | 1053 | P.e.selectMimetype.addEventListener( |
| 1053 | 1054 | 'change', |
| 1054 | 1055 | function(e){ |
| 1055 | 1056 | if(P.winfo && P.winfo.mimetype !== e.target.value){ |
| @@ -1058,11 +1059,11 @@ | ||
| 1058 | 1059 | P.stashContentChange(true); |
| 1059 | 1060 | } |
| 1060 | 1061 | }, |
| 1061 | 1062 | false |
| 1062 | 1063 | ); |
| 1063 | - | |
| 1064 | + | |
| 1064 | 1065 | const selectFontSize = E('select[name=editor_font_size]'); |
| 1065 | 1066 | if(selectFontSize){ |
| 1066 | 1067 | selectFontSize.addEventListener( |
| 1067 | 1068 | "change",function(e){ |
| 1068 | 1069 | const ed = P.e.taEditor; |
| @@ -1590,11 +1591,11 @@ | ||
| 1590 | 1591 | responseType: 'json', |
| 1591 | 1592 | onload: callee.onload |
| 1592 | 1593 | }); |
| 1593 | 1594 | return this; |
| 1594 | 1595 | }; |
| 1595 | - | |
| 1596 | + | |
| 1596 | 1597 | /** |
| 1597 | 1598 | Updates P.winfo for certain state and stashes P.winfo, with the |
| 1598 | 1599 | current content fetched via P.wikiContent(). |
| 1599 | 1600 | |
| 1600 | 1601 | If passed truthy AND the stash already has stashed content for |
| 1601 | 1602 |
| --- src/fossil.page.wikiedit.js | |
| +++ src/fossil.page.wikiedit.js | |
| @@ -14,11 +14,11 @@ | |
| 14 | cache), in the form of an "winfo" object: |
| 15 | |
| 16 | { |
| 17 | name: string, |
| 18 | mimetype: mimetype string, |
| 19 | type: "normal" | "tag" | "checkin" | "branch" | "sandbox", |
| 20 | version: UUID string or null for a sandbox page or new page, |
| 21 | parent: parent UUID string or null if no parent, |
| 22 | isEmpty: true if page has no content (is "deleted"). |
| 23 | content: string, optional in most contexts |
| 24 | } |
| @@ -192,11 +192,11 @@ | |
| 192 | name: winfo.name |
| 193 | }); |
| 194 | record.mimetype = winfo.mimetype; |
| 195 | record.type = winfo.type; |
| 196 | record.parent = winfo.parent; |
| 197 | record.version = winfo.version; |
| 198 | record.stashTime = new Date().getTime(); |
| 199 | record.isEmpty = !!winfo.isEmpty; |
| 200 | record.attachments = winfo.attachments; |
| 201 | this.storeIndex(); |
| 202 | if(arguments.length>1){ |
| @@ -207,11 +207,11 @@ | |
| 207 | return this; |
| 208 | }, |
| 209 | /** |
| 210 | Returns the stashed content, if any, for the given winfo |
| 211 | object. |
| 212 | */ |
| 213 | stashedContent: function(winfo){ |
| 214 | return F.storage.get(this.contentKey(this.indexKey(winfo))); |
| 215 | }, |
| 216 | /** Returns true if we have stashed content for the given winfo |
| 217 | record or page name. */ |
| @@ -270,11 +270,11 @@ | |
| 270 | if(n) this._fireStashEvent(); |
| 271 | } |
| 272 | }; |
| 273 | $stash.prune.defaultMaxCount = P.config.defaultMaxStashSize || 10; |
| 274 | P.$stash = $stash /* we have to expose this for the new-page case :/ */; |
| 275 | |
| 276 | /** |
| 277 | Internal workaround to select the current preview mode |
| 278 | and fire a change event if the value actually changes |
| 279 | or if forceEvent is truthy. |
| 280 | */ |
| @@ -536,10 +536,11 @@ | |
| 536 | name = name.trim(); |
| 537 | if(!this.validatePageName(name)) return false; |
| 538 | var wtype = 'normal'; |
| 539 | if(0===name.indexOf('checkin/')) wtype = 'checkin'; |
| 540 | else if(0===name.indexOf('branch/')) wtype = 'branch'; |
| 541 | else if(0===name.indexOf('tag/')) wtype = 'tag'; |
| 542 | /* ^^^ note that we're not validating that, e.g., checkin/XYZ |
| 543 | has a full artifact ID after "checkin/". */ |
| 544 | const winfo = { |
| 545 | name: name, type: wtype, mimetype: 'text/x-markdown', |
| @@ -573,11 +574,11 @@ | |
| 573 | |
| 574 | /** Set up filter checkboxes for the various types |
| 575 | of wiki pages... */ |
| 576 | const fsFilter = D.addClass(D.fieldset("Page types"),"page-types-list"), |
| 577 | fsFilterBody = D.div(), |
| 578 | filters = ['normal', 'branch/...', 'tag/...', 'checkin/...'] |
| 579 | ; |
| 580 | D.append(fsFilter, fsFilterBody); |
| 581 | D.addClass(fsFilterBody, 'flex-container', 'flex-column', 'stretch'); |
| 582 | |
| 583 | // Add filters by page type... |
| @@ -1045,11 +1046,11 @@ | |
| 1045 | P.e.btnSave.addEventListener('click', ()=>doSave(), false); |
| 1046 | P.e.btnSaveClose.addEventListener('click', ()=>doSave(true), false); |
| 1047 | } |
| 1048 | |
| 1049 | P.e.taEditor.addEventListener('change', ()=>P.notifyOfChange(), false); |
| 1050 | |
| 1051 | P.selectMimetype(false, true); |
| 1052 | P.e.selectMimetype.addEventListener( |
| 1053 | 'change', |
| 1054 | function(e){ |
| 1055 | if(P.winfo && P.winfo.mimetype !== e.target.value){ |
| @@ -1058,11 +1059,11 @@ | |
| 1058 | P.stashContentChange(true); |
| 1059 | } |
| 1060 | }, |
| 1061 | false |
| 1062 | ); |
| 1063 | |
| 1064 | const selectFontSize = E('select[name=editor_font_size]'); |
| 1065 | if(selectFontSize){ |
| 1066 | selectFontSize.addEventListener( |
| 1067 | "change",function(e){ |
| 1068 | const ed = P.e.taEditor; |
| @@ -1590,11 +1591,11 @@ | |
| 1590 | responseType: 'json', |
| 1591 | onload: callee.onload |
| 1592 | }); |
| 1593 | return this; |
| 1594 | }; |
| 1595 | |
| 1596 | /** |
| 1597 | Updates P.winfo for certain state and stashes P.winfo, with the |
| 1598 | current content fetched via P.wikiContent(). |
| 1599 | |
| 1600 | If passed truthy AND the stash already has stashed content for |
| 1601 |
| --- src/fossil.page.wikiedit.js | |
| +++ src/fossil.page.wikiedit.js | |
| @@ -14,11 +14,11 @@ | |
| 14 | cache), in the form of an "winfo" object: |
| 15 | |
| 16 | { |
| 17 | name: string, |
| 18 | mimetype: mimetype string, |
| 19 | type: "normal" | "tag" | "checkin" | "branch" | "ticket" | "sandbox", |
| 20 | version: UUID string or null for a sandbox page or new page, |
| 21 | parent: parent UUID string or null if no parent, |
| 22 | isEmpty: true if page has no content (is "deleted"). |
| 23 | content: string, optional in most contexts |
| 24 | } |
| @@ -192,11 +192,11 @@ | |
| 192 | name: winfo.name |
| 193 | }); |
| 194 | record.mimetype = winfo.mimetype; |
| 195 | record.type = winfo.type; |
| 196 | record.parent = winfo.parent; |
| 197 | record.version = winfo.version; |
| 198 | record.stashTime = new Date().getTime(); |
| 199 | record.isEmpty = !!winfo.isEmpty; |
| 200 | record.attachments = winfo.attachments; |
| 201 | this.storeIndex(); |
| 202 | if(arguments.length>1){ |
| @@ -207,11 +207,11 @@ | |
| 207 | return this; |
| 208 | }, |
| 209 | /** |
| 210 | Returns the stashed content, if any, for the given winfo |
| 211 | object. |
| 212 | */ |
| 213 | stashedContent: function(winfo){ |
| 214 | return F.storage.get(this.contentKey(this.indexKey(winfo))); |
| 215 | }, |
| 216 | /** Returns true if we have stashed content for the given winfo |
| 217 | record or page name. */ |
| @@ -270,11 +270,11 @@ | |
| 270 | if(n) this._fireStashEvent(); |
| 271 | } |
| 272 | }; |
| 273 | $stash.prune.defaultMaxCount = P.config.defaultMaxStashSize || 10; |
| 274 | P.$stash = $stash /* we have to expose this for the new-page case :/ */; |
| 275 | |
| 276 | /** |
| 277 | Internal workaround to select the current preview mode |
| 278 | and fire a change event if the value actually changes |
| 279 | or if forceEvent is truthy. |
| 280 | */ |
| @@ -536,10 +536,11 @@ | |
| 536 | name = name.trim(); |
| 537 | if(!this.validatePageName(name)) return false; |
| 538 | var wtype = 'normal'; |
| 539 | if(0===name.indexOf('checkin/')) wtype = 'checkin'; |
| 540 | else if(0===name.indexOf('branch/')) wtype = 'branch'; |
| 541 | else if(0===name.indexOf('ticket/')) wtype = 'ticket'; |
| 542 | else if(0===name.indexOf('tag/')) wtype = 'tag'; |
| 543 | /* ^^^ note that we're not validating that, e.g., checkin/XYZ |
| 544 | has a full artifact ID after "checkin/". */ |
| 545 | const winfo = { |
| 546 | name: name, type: wtype, mimetype: 'text/x-markdown', |
| @@ -573,11 +574,11 @@ | |
| 574 | |
| 575 | /** Set up filter checkboxes for the various types |
| 576 | of wiki pages... */ |
| 577 | const fsFilter = D.addClass(D.fieldset("Page types"),"page-types-list"), |
| 578 | fsFilterBody = D.div(), |
| 579 | filters = ['normal', 'branch/...', 'tag/...', 'checkin/...', 'ticket/...'] |
| 580 | ; |
| 581 | D.append(fsFilter, fsFilterBody); |
| 582 | D.addClass(fsFilterBody, 'flex-container', 'flex-column', 'stretch'); |
| 583 | |
| 584 | // Add filters by page type... |
| @@ -1045,11 +1046,11 @@ | |
| 1046 | P.e.btnSave.addEventListener('click', ()=>doSave(), false); |
| 1047 | P.e.btnSaveClose.addEventListener('click', ()=>doSave(true), false); |
| 1048 | } |
| 1049 | |
| 1050 | P.e.taEditor.addEventListener('change', ()=>P.notifyOfChange(), false); |
| 1051 | |
| 1052 | P.selectMimetype(false, true); |
| 1053 | P.e.selectMimetype.addEventListener( |
| 1054 | 'change', |
| 1055 | function(e){ |
| 1056 | if(P.winfo && P.winfo.mimetype !== e.target.value){ |
| @@ -1058,11 +1059,11 @@ | |
| 1059 | P.stashContentChange(true); |
| 1060 | } |
| 1061 | }, |
| 1062 | false |
| 1063 | ); |
| 1064 | |
| 1065 | const selectFontSize = E('select[name=editor_font_size]'); |
| 1066 | if(selectFontSize){ |
| 1067 | selectFontSize.addEventListener( |
| 1068 | "change",function(e){ |
| 1069 | const ed = P.e.taEditor; |
| @@ -1590,11 +1591,11 @@ | |
| 1591 | responseType: 'json', |
| 1592 | onload: callee.onload |
| 1593 | }); |
| 1594 | return this; |
| 1595 | }; |
| 1596 | |
| 1597 | /** |
| 1598 | Updates P.winfo for certain state and stashes P.winfo, with the |
| 1599 | current content fetched via P.wikiContent(). |
| 1600 | |
| 1601 | If passed truthy AND the stash already has stashed content for |
| 1602 |