mirror of
https://github.com/flynx/pWiki.git
synced 2025-12-25 12:21:58 +00:00
Compare commits
5 Commits
436bf6ffae
...
2ddcf93faf
| Author | SHA1 | Date | |
|---|---|---|---|
| 2ddcf93faf | |||
| 09c14f3404 | |||
| bf31acf2b5 | |||
| ab9d2ead09 | |||
| df7b74f1a3 |
@ -538,16 +538,52 @@ var styling = {
|
|||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
//
|
||||||
// XXX use ligatures for these???
|
// XXX use ligatures for these???
|
||||||
var symbols = {
|
var symbols = {
|
||||||
__proto__: plugin,
|
__proto__: plugin,
|
||||||
|
|
||||||
|
// XXX use a single regex with handler func to do these...
|
||||||
|
symbols: {
|
||||||
|
'>>': '»',
|
||||||
|
'<<': '«',
|
||||||
|
'->': '→',
|
||||||
|
'<-': '←',
|
||||||
|
'=>': '⇒',
|
||||||
|
'<=': '⇐',
|
||||||
|
'(i)': '🛈',
|
||||||
|
'(c)': '©',
|
||||||
|
'/!\\': '⚠',
|
||||||
|
},
|
||||||
|
get symbols_pattern(){
|
||||||
|
return (this.symbols != null
|
||||||
|
&& Object.keys(this.symbols).length > 0) ?
|
||||||
|
new RegExp(`(?<!\\\\)(${
|
||||||
|
Object.keys(this.symbols)
|
||||||
|
.join('|')
|
||||||
|
.replace(/([\(\)\\\/])/g, '\\$1') })`, 'g')
|
||||||
|
: undefined },
|
||||||
|
|
||||||
__parse__: function(text, editor, elem){
|
__parse__: function(text, editor, elem){
|
||||||
|
var that = this
|
||||||
|
var p = this.symbols_pattern
|
||||||
|
text = p ?
|
||||||
|
text.replace(p,
|
||||||
|
function(m){
|
||||||
|
return that.symbols[m] })
|
||||||
|
: text
|
||||||
return text
|
return text
|
||||||
// characters...
|
/* XXX
|
||||||
|
.replace(/(?<!\\)>>/gm, '»')
|
||||||
|
.replace(/(?<!\\)<</gm, '«')
|
||||||
|
.replace(/(?<![\\<])->/gm, '→')
|
||||||
|
.replace(/(?<![\\<])=>/gm, '⇒')
|
||||||
|
.replace(/(?<!\\)<-(?!>)/gm, '←')
|
||||||
|
.replace(/(?<!\\)<=(?!>)/gm, '⇐')
|
||||||
.replace(/(?<!\\)\(i\)/gm, '🛈')
|
.replace(/(?<!\\)\(i\)/gm, '🛈')
|
||||||
.replace(/(?<!\\)\(c\)/gm, '©')
|
.replace(/(?<!\\)\(c\)/gm, '©')
|
||||||
.replace(/(?<!\\)\/!\\/gm, '⚠')
|
.replace(/(?<!\\)\/!\\/gm, '⚠')
|
||||||
|
//*/
|
||||||
.replace(/(?<!\\)---(?!-)/gm, '—')
|
.replace(/(?<!\\)---(?!-)/gm, '—')
|
||||||
.replace(/(?<!\\)--(?!-)/gm, '–') },
|
.replace(/(?<!\\)--(?!-)/gm, '–') },
|
||||||
}
|
}
|
||||||
|
|||||||
@ -51,13 +51,14 @@ var setup = function(){
|
|||||||
- ASAP: mobile browsers behave quite chaotically ignoring parts of the styling...
|
- ASAP: mobile browsers behave quite chaotically ignoring parts of the styling...
|
||||||
- ASAP: call `.sync()` on all changes...
|
- ASAP: call `.sync()` on all changes...
|
||||||
- pgup/pgdown/home/end buttons
|
- pgup/pgdown/home/end buttons
|
||||||
- autofocus (option)
|
- identify a block (index, id, ...)
|
||||||
- copy/paste nodes/trees
|
- focus
|
||||||
|
- `<editor>.autofocus`
|
||||||
|
- `focused:: true` attr (`.text(..)`/`.json(..)`/`.load(..)`)
|
||||||
|
- focusing editor -> focus focused block
|
||||||
- undo
|
- undo
|
||||||
collapsed:: true
|
collapsed:: true
|
||||||
- delete node
|
- edit stack (position, action, ...)
|
||||||
- indent/deindent
|
|
||||||
- edit node
|
|
||||||
- auto-shift done blocks to the end of siblings... (option?)
|
- auto-shift done blocks to the end of siblings... (option?)
|
||||||
- ...or should this be `sort:: done` -- i.e. sort children by done status??
|
- ...or should this be `sort:: done` -- i.e. sort children by done status??
|
||||||
- codeblock as a block
|
- codeblock as a block
|
||||||
@ -68,6 +69,7 @@ var setup = function(){
|
|||||||
code
|
code
|
||||||
```
|
```
|
||||||
- _bullet should be either in the middle of the block or at the first line of code (preferred)..._
|
- _bullet should be either in the middle of the block or at the first line of code (preferred)..._
|
||||||
|
- copy/paste nodes/trees
|
||||||
- FEATURE: read-only mode
|
- FEATURE: read-only mode
|
||||||
- export html
|
- export html
|
||||||
- embed css
|
- embed css
|
||||||
@ -87,6 +89,7 @@ var setup = function(){
|
|||||||
- `<editable/>` -- field marker
|
- `<editable/>` -- field marker
|
||||||
- each child node will copy the template and allow editing of only fields
|
- each child node will copy the template and allow editing of only fields
|
||||||
- not clear how to handle template changes...
|
- not clear how to handle template changes...
|
||||||
|
- cli
|
||||||
- Q: do we use \\t for indent? (option???)
|
- Q: do we use \\t for indent? (option???)
|
||||||
- Q: persistent empty first/last node (a button to create a new node)?
|
- Q: persistent empty first/last node (a button to create a new node)?
|
||||||
- Q: should list bullets be on the same level as nodes or offset??
|
- Q: should list bullets be on the same level as nodes or offset??
|
||||||
@ -261,6 +264,7 @@ var setup = function(){
|
|||||||
| 11 | 22 | 33 |
|
| 11 | 22 | 33 |
|
||||||
- Symbols -- _should these be ligatures?_
|
- Symbols -- _should these be ligatures?_
|
||||||
- (i), (c), /!\, ...
|
- (i), (c), /!\, ...
|
||||||
|
- <-, ->, <=, =>, <<, >> _(not sure about these)_
|
||||||
- -- and ---
|
- -- and ---
|
||||||
-
|
-
|
||||||
- ---
|
- ---
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user