mirror of
				https://github.com/mickael-kerjean/filestash.git
				synced 2025-10-31 10:07:15 +08:00 
			
		
		
		
	fix (orgmode): Firefox flexbox issue and other problems in #63
This commit is contained in:
		| @ -11,7 +11,7 @@ | |||||||
|     } |     } | ||||||
|     .dropdown_container{ |     .dropdown_container{ | ||||||
|         padding-top: 3px; |         padding-top: 3px; | ||||||
|         z-index: 2; |         z-index: 3; | ||||||
|         ul{ |         ul{ | ||||||
|             margin: 0; |             margin: 0; | ||||||
|             list-style-type: none; |             list-style-type: none; | ||||||
|  | |||||||
| @ -11,8 +11,10 @@ export function extractTodos(text){ | |||||||
|     } |     } | ||||||
|     return todos |     return todos | ||||||
|         .sort((a,b) => { |         .sort((a,b) => { | ||||||
|             if(a.status === "TODO" && b.status !== "TODO" && b.todo_status === "todo") return -1; |             if(a.status === "NEXT" && b.status !== "NEXT") return -1; | ||||||
|             else if(b.status === "TODO" && a.status !== "TODO" && a.todo_status === "todo") return +1; |             else if(b.status === "NEXT" && a.status !== "NEXT") return +1; | ||||||
|  |             else if(a.status === "TODO" && b.status !== "TODO") return -1; | ||||||
|  |             else if(b.status === "TODO" && a.status !== "TODO") return +1; | ||||||
|             else if(a.status === "DONE" && b.status !== "DONE" && b.todo_status === "done") return -1; |             else if(a.status === "DONE" && b.status !== "DONE" && b.todo_status === "done") return -1; | ||||||
|             else if(b.status === "DONE" && a.status !== "DONE" && a.todo_status === "done") return +1; |             else if(b.status === "DONE" && a.status !== "DONE" && a.todo_status === "done") return +1; | ||||||
|             else if(a.todo_status === "todo" && b.todo_status !== "todo") return -1; |             else if(a.todo_status === "todo" && b.todo_status !== "todo") return -1; | ||||||
| @ -26,7 +28,7 @@ export function extractTodos(text){ | |||||||
|         }); |         }); | ||||||
|  |  | ||||||
|     function formatTodo(thing){ |     function formatTodo(thing){ | ||||||
|         const todo_status = ["TODO", "NEXT", "DOING", "WAITING"].indexOf(thing.header.todo_keyword) !== -1 ? 'todo' : 'done'; |         const todo_status = ["TODO", "NEXT", "DOING", "WAITING", "PENDING"].indexOf(thing.header.todo_keyword) !== -1 ? 'todo' : 'done'; | ||||||
|         return { |         return { | ||||||
|             key: thing.header.todo_keyword, |             key: thing.header.todo_keyword, | ||||||
|             id: thing.id, |             id: thing.id, | ||||||
| @ -61,7 +63,7 @@ export function extractEvents(text){ | |||||||
|             if(timestamp.active === false) continue; |             if(timestamp.active === false) continue; | ||||||
|             const todo_status = function(keyword){ |             const todo_status = function(keyword){ | ||||||
|                 if(!keyword) return null; |                 if(!keyword) return null; | ||||||
|                 return ["TODO", "NEXT", "DOING", "WAITING"].indexOf(keyword) !== -1 ? 'todo' : 'done'; |                 return ["TODO", "NEXT", "DOING", "WAITING", "PENDING"].indexOf(keyword) !== -1 ? 'todo' : 'done'; | ||||||
|             }(thing.header.todo_keyword); |             }(thing.header.todo_keyword); | ||||||
|             let event = { |             let event = { | ||||||
|                 id: thing.id, |                 id: thing.id, | ||||||
| @ -187,7 +189,7 @@ function parse_subtask(text, line){ | |||||||
|  |  | ||||||
|  |  | ||||||
| function parse_timestamp(text, line, _memory){ | function parse_timestamp(text, line, _memory){ | ||||||
|     const reg = /(?:([A-Z]+)\:\s){0,1}([<\[])(\d{4}-\d{2}-\d{2})[^>](?:[A-Z][a-z]{2})(?:\s([0-9]{2}\:[0-9]{2})){0,1}(?:\-([0-9]{2}\:[0-9]{2})){0,1}(?:\s(\+{1,2}[0-9]+[dwmy])){0,1}[\>\]](?:--[<\[](\d{4}-\d{2}-\d{2})\s[A-Z][a-z]{2}\s(\d{2}:\d{2}){0,1}[>\]]){0,1}/; |     const reg = /(?:([A-Z]+)\:\s){0,1}([<\[])(\d{4}-\d{2}-\d{2})[^>](?:[A-Z][a-z]{1,2})(?:\s([0-9]{2}\:[0-9]{2})){0,1}(?:\-([0-9]{2}\:[0-9]{2})){0,1}(?:\s(\+{1,2}[0-9]+[dwmy])){0,1}[\>\]](?:--[<\[](\d{4}-\d{2}-\d{2})\s[A-Z][a-z]{1,2}\s(\d{2}:\d{2}){0,1}[>\]]){0,1}/; | ||||||
|     const match = text.match(reg); |     const match = text.match(reg); | ||||||
|     if(!match) return _memory || null; |     if(!match) return _memory || null; | ||||||
|  |  | ||||||
|  | |||||||
| @ -11,8 +11,8 @@ CodeMirror.__mode = 'orgmode'; | |||||||
|  |  | ||||||
| CodeMirror.defineSimpleMode("orgmode", { | CodeMirror.defineSimpleMode("orgmode", { | ||||||
|     start: [ |     start: [ | ||||||
|         {regex: /^(\*\s)(TODO|DOING|WAITING|NEXT|)(CANCELLED|CANCEL|DEFERRED|DONE|REJECTED|STOP|STOPPED|)(\s+\[\#[A-C]\]\s+|)(.*?)(?:(\s{10,}|))(\:[\S]+\:|)$/, token: ["header level1 org-level-star","header level1 org-todo","header level1 org-done", "header level1 org-priority", "header level1", "header level1 void", "header level1 comment"]}, |         {regex: /^(\*\s)(TODO|DOING|WAITING|NEXT|PENDING|)(CANCELLED|CANCELED|CANCEL|DONE|REJECTED|STOP|STOPPED|)(\s+\[\#[A-C]\]\s+|)(.*?)(?:(\s{10,}|))(\:[\S]+\:|)$/, token: ["header level1 org-level-star","header level1 org-todo","header level1 org-done", "header level1 org-priority", "header level1", "header level1 void", "header level1 comment"]}, | ||||||
|         {regex: /^(\*{1,}\s)(TODO|DOING|WAITING|NEXT|)(CANCELLED|CANCEL|DEFERRED|DONE|REJECTED|STOP|STOPPED|)(\s+\[\#[A-C]\]\s+|)(.*?)(?:(\s{10,}|))(\:[\S]+\:|)$/, token: ["header org-level-star","header org-todo","header org-done", "header org-priority", "header", "header void", "header comment"]}, |         {regex: /^(\*{1,}\s)(TODO|DOING|WAITING|NEXT|PENDING|)(CANCELLED|CANCELED|CANCEL|DEFERRED|DONE|REJECTED|STOP|STOPPED|)(\s+\[\#[A-C]\]\s+|)(.*?)(?:(\s{10,}|))(\:[\S]+\:|)$/, token: ["header org-level-star","header org-todo","header org-done", "header org-priority", "header", "header void", "header comment"]}, | ||||||
|         {regex: /(\+[^\+]+\+)/, token: ["strikethrough"]}, |         {regex: /(\+[^\+]+\+)/, token: ["strikethrough"]}, | ||||||
|         {regex: /(\*[^\*]+\*)/, token: ["strong"]}, |         {regex: /(\*[^\*]+\*)/, token: ["strong"]}, | ||||||
|         {regex: /(\/[^\/]+\/)/, token: ["em"]}, |         {regex: /(\/[^\/]+\/)/, token: ["em"]}, | ||||||
| @ -24,7 +24,7 @@ CodeMirror.defineSimpleMode("orgmode", { | |||||||
|         {regex: /\[[xX\s\-\_]\]/, token: 'qualifier org-toggle'}, // checkbox |         {regex: /\[[xX\s\-\_]\]/, token: 'qualifier org-toggle'}, // checkbox | ||||||
|         {regex: /\#\+BEGIN_[A-Z]*/, token: "comment", next: "env"}, // comments |         {regex: /\#\+BEGIN_[A-Z]*/, token: "comment", next: "env"}, // comments | ||||||
|         {regex: /:?[A-Z_]+\:.*/, token: "comment"}, // property drawers |         {regex: /:?[A-Z_]+\:.*/, token: "comment"}, // property drawers | ||||||
|         {regex: /(\#\+[A-Z_]*)(\:.*)/, token: ["keyword", 'qualifier']}, // environments |         {regex: /(\#\+[a-zA-Z_]*)(\:.*)/, token: ["keyword", 'qualifier']}, // environments | ||||||
|         {regex: /(CLOCK\:|SHEDULED\:|DEADLINE\:)(\s.+)/, token: ["comment", "keyword"]} |         {regex: /(CLOCK\:|SHEDULED\:|DEADLINE\:)(\s.+)/, token: ["comment", "keyword"]} | ||||||
|     ], |     ], | ||||||
|     env: [ |     env: [ | ||||||
|  | |||||||
| @ -5,6 +5,8 @@ | |||||||
|     .editor_container{ |     .editor_container{ | ||||||
|         height: 100%; |         height: 100%; | ||||||
|         display: flex; |         display: flex; | ||||||
|  |         // https://stackoverflow.com/questions/44948158/flexbox-overflow-issue-in-firefox | ||||||
|  |         min-height: 0; | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	 Mickael KERJEAN
					Mickael KERJEAN