projects
/
roojs1
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
71b5ca0
)
Roo/htmleditor/FilterWord.js
author
Alan
<alan@roojs.com>
Thu, 17 Mar 2022 09:13:19 +0000
(17:13 +0800)
committer
Alan
<alan@roojs.com>
Thu, 17 Mar 2022 09:13:19 +0000
(17:13 +0800)
Roo/htmleditor/FilterWord.js
patch
|
blob
|
history
diff --git
a/Roo/htmleditor/FilterWord.js
b/Roo/htmleditor/FilterWord.js
index
da1c6f1
..
73cd8df
100644
(file)
--- a/
Roo/htmleditor/FilterWord.js
+++ b/
Roo/htmleditor/FilterWord.js
@@
-134,7
+134,7
@@
Roo.extend(Roo.htmleditor.FilterWord, Roo.htmleditor.Filter,
ret[kv[0]] = kv[1];
});
return ret;
ret[kv[0]] = kv[1];
});
return ret;
- }
+ }
,
replaceDocBullets : function(doc)
replaceDocBullets : function(doc)
@@
-151,6
+151,7
@@
Roo.extend(Roo.htmleditor.FilterWord, Roo.htmleditor.Filter,
// gather all the siblings.
var ns = p,
parent = p.parentNode,
// gather all the siblings.
var ns = p,
parent = p.parentNode,
+ doc = parent.ownerDocument,
items = [];
while (ns) {
if (!ns.className.match(/MsoListParagraph/)) {
items = [];
while (ns) {
if (!ns.className.match(/MsoListParagraph/)) {
@@
-161,13
+162,34
@@
Roo.extend(Roo.htmleditor.FilterWord, Roo.htmleditor.Filter,
}
var ul = parent.ownerDocument.createElement('ul'); // what about number lists...
}
var ul = parent.ownerDocument.createElement('ul'); // what about number lists...
-
+ parent.insertBefore(ul, p);
+ var lvl = 0;
+ var stack = [ ul ];
+ var last_li = false;
items.forEach(function(n) {
parent.removeChild(n);
var spans = n.getElementsByTagName('span');
n.removeChild(spans.item(0)); // remove the fake bullet.
items.forEach(function(n) {
parent.removeChild(n);
var spans = n.getElementsByTagName('span');
n.removeChild(spans.item(0)); // remove the fake bullet.
+ var style = this.styleToObject(n);
+ var nlvl = (style['mso-list'].split(' ')[1].replace(/level/,'') *1) - 1;
+ if (nlvl > lvl) {
+ new indent
+ var nul = doc.createElement('ul'); // what about number lists...
+ last_li.appendChild(nul);
+ stack[nlvl] = nul;
+ }
- });
+ var nli = stack[nlvl].appendChild('li');
+ last_li = nli;
+ // copy children of p into nli
+ while(p.firstChild) {
+ var fc = p.firstChild;
+ p.removeChild(fc);
+ nli.appendChild(fc);
+ }
+
+
+ },this);