Browse Source

Merge pull request #185 in FUI/fineui from ~GUY/fineui:master to master

* commit '5519beab23287f37f307df2be314e8dfc99a5f3f':
  update
master
guy 7 years ago
parent
commit
e6526db7a0
  1. 6
      bi/base.js
  2. 6
      bi/core.js
  3. 6
      dist/base.js
  4. 12
      dist/bundle.js
  5. 8
      dist/bundle.min.js
  6. 6
      dist/core.js
  7. 2
      src/base/single/text.js
  8. 4
      src/base/tree/treeview.js
  9. 6
      src/core/func/dom.js

6
bi/base.js

@ -581,7 +581,7 @@ BI.Text = BI.inherit(BI.Single, {
setText: function (text) {
BI.Text.superclass.setText.apply(this, arguments);
this.options.text = text;
this.text.element.text((text + "").replaceAll(" ", " "));
this.text.element.html((text + "").replaceAll(" ", " "));
}
});
@ -1725,7 +1725,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
_getNodeValue: function (node) {
//去除标红
return node.value == null ? node.text.replace(/<[^>]+>/g, "").replaceAll(" ", " ") : node.value;
return node.value == null ? node.text.replace(/<[^>]+>/g, "").replaceAll("&nbsp;", " ") : node.value;
},
//获取半选框值
@ -1822,7 +1822,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
if (BI.isKey(o.paras.keyword)) {
n.text = $("<div>").__textKeywordMarked__(n.text, o.paras.keyword, n.py).html();
} else {
n.text = (n.text + "").replaceAll(" ", " ");
n.text = (n.text + "").replaceAll(" ", "&nbsp;");
}
});
return nodes;

6
bi/core.js

@ -19278,7 +19278,7 @@ BI.extend(jQuery.fn, {
*/
__textKeywordMarked__: function (text, keyword, py) {
if (!BI.isKey(keyword) || (text + "").length > 100) {
return this.text((text + "").replaceAll(" ", " "));
return this.html((text + "").replaceAll(" ", "&nbsp;"));
}
keyword = keyword + "";
keyword = BI.toUpperCase(keyword);
@ -19301,7 +19301,7 @@ BI.extend(jQuery.fn, {
if (tidx >= 0) {
this.append(textLeft.substr(0, tidx));
this.append($("<span>").addClass("bi-keyword-red-mark")
.text(textLeft.substr(tidx, keyword.length).replaceAll(" ", " ")));
.html(textLeft.substr(tidx, keyword.length).replaceAll(" ", "&nbsp;")));
textLeft = textLeft.substr(tidx + keyword.length);
if (py != null) {
@ -19310,7 +19310,7 @@ BI.extend(jQuery.fn, {
} else if (pidx != null && pidx >= 0 && Math.floor(pidx / text.length) === Math.floor((pidx + keyword.length - 1) / text.length)) {
this.append(textLeft.substr(0, pidx));
this.append($("<span>").addClass("bi-keyword-red-mark")
.text(textLeft.substr(pidx, keyword.length).replaceAll(" ", " ")));
.html(textLeft.substr(pidx, keyword.length).replaceAll(" ", "&nbsp;")));
if (py != null) {
py = py.substr(pidx + keyword.length);
}

6
dist/base.js vendored

@ -581,7 +581,7 @@ BI.Text = BI.inherit(BI.Single, {
setText: function (text) {
BI.Text.superclass.setText.apply(this, arguments);
this.options.text = text;
this.text.element.text((text + "").replaceAll(" ", " "));
this.text.element.html((text + "").replaceAll(" ", "&nbsp;"));
}
});
@ -1725,7 +1725,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
_getNodeValue: function (node) {
//去除标红
return node.value == null ? node.text.replace(/<[^>]+>/g, "").replaceAll(" ", " ") : node.value;
return node.value == null ? node.text.replace(/<[^>]+>/g, "").replaceAll("&nbsp;", " ") : node.value;
},
//获取半选框值
@ -1822,7 +1822,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
if (BI.isKey(o.paras.keyword)) {
n.text = $("<div>").__textKeywordMarked__(n.text, o.paras.keyword, n.py).html();
} else {
n.text = (n.text + "").replaceAll(" ", " ");
n.text = (n.text + "").replaceAll(" ", "&nbsp;");
}
});
return nodes;

12
dist/bundle.js vendored

@ -19278,7 +19278,7 @@ BI.extend(jQuery.fn, {
*/
__textKeywordMarked__: function (text, keyword, py) {
if (!BI.isKey(keyword) || (text + "").length > 100) {
return this.text((text + "").replaceAll(" ", " "));
return this.html((text + "").replaceAll(" ", "&nbsp;"));
}
keyword = keyword + "";
keyword = BI.toUpperCase(keyword);
@ -19301,7 +19301,7 @@ BI.extend(jQuery.fn, {
if (tidx >= 0) {
this.append(textLeft.substr(0, tidx));
this.append($("<span>").addClass("bi-keyword-red-mark")
.text(textLeft.substr(tidx, keyword.length).replaceAll(" ", " ")));
.html(textLeft.substr(tidx, keyword.length).replaceAll(" ", "&nbsp;")));
textLeft = textLeft.substr(tidx + keyword.length);
if (py != null) {
@ -19310,7 +19310,7 @@ BI.extend(jQuery.fn, {
} else if (pidx != null && pidx >= 0 && Math.floor(pidx / text.length) === Math.floor((pidx + keyword.length - 1) / text.length)) {
this.append(textLeft.substr(0, pidx));
this.append($("<span>").addClass("bi-keyword-red-mark")
.text(textLeft.substr(pidx, keyword.length).replaceAll(" ", " ")));
.html(textLeft.substr(pidx, keyword.length).replaceAll(" ", "&nbsp;")));
if (py != null) {
py = py.substr(pidx + keyword.length);
}
@ -26359,7 +26359,7 @@ BI.Text = BI.inherit(BI.Single, {
setText: function (text) {
BI.Text.superclass.setText.apply(this, arguments);
this.options.text = text;
this.text.element.text((text + "").replaceAll(" ", " "));
this.text.element.html((text + "").replaceAll(" ", "&nbsp;"));
}
});
@ -27503,7 +27503,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
_getNodeValue: function (node) {
//去除标红
return node.value == null ? node.text.replace(/<[^>]+>/g, "").replaceAll(" ", " ") : node.value;
return node.value == null ? node.text.replace(/<[^>]+>/g, "").replaceAll("&nbsp;", " ") : node.value;
},
//获取半选框值
@ -27600,7 +27600,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
if (BI.isKey(o.paras.keyword)) {
n.text = $("<div>").__textKeywordMarked__(n.text, o.paras.keyword, n.py).html();
} else {
n.text = (n.text + "").replaceAll(" ", " ");
n.text = (n.text + "").replaceAll(" ", "&nbsp;");
}
});
return nodes;

8
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

6
dist/core.js vendored

@ -19278,7 +19278,7 @@ BI.extend(jQuery.fn, {
*/
__textKeywordMarked__: function (text, keyword, py) {
if (!BI.isKey(keyword) || (text + "").length > 100) {
return this.text((text + "").replaceAll(" ", " "));
return this.html((text + "").replaceAll(" ", "&nbsp;"));
}
keyword = keyword + "";
keyword = BI.toUpperCase(keyword);
@ -19301,7 +19301,7 @@ BI.extend(jQuery.fn, {
if (tidx >= 0) {
this.append(textLeft.substr(0, tidx));
this.append($("<span>").addClass("bi-keyword-red-mark")
.text(textLeft.substr(tidx, keyword.length).replaceAll(" ", " ")));
.html(textLeft.substr(tidx, keyword.length).replaceAll(" ", "&nbsp;")));
textLeft = textLeft.substr(tidx + keyword.length);
if (py != null) {
@ -19310,7 +19310,7 @@ BI.extend(jQuery.fn, {
} else if (pidx != null && pidx >= 0 && Math.floor(pidx / text.length) === Math.floor((pidx + keyword.length - 1) / text.length)) {
this.append(textLeft.substr(0, pidx));
this.append($("<span>").addClass("bi-keyword-red-mark")
.text(textLeft.substr(pidx, keyword.length).replaceAll(" ", " ")));
.html(textLeft.substr(pidx, keyword.length).replaceAll(" ", "&nbsp;")));
if (py != null) {
py = py.substr(pidx + keyword.length);
}

2
src/base/single/text.js

@ -114,7 +114,7 @@ BI.Text = BI.inherit(BI.Single, {
setText: function (text) {
BI.Text.superclass.setText.apply(this, arguments);
this.options.text = text;
this.text.element.text((text + "").replaceAll(" ", " "));
this.text.element.html((text + "").replaceAll(" ", "&nbsp;"));
}
});

4
src/base/tree/treeview.js

@ -215,7 +215,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
_getNodeValue: function (node) {
//去除标红
return node.value == null ? node.text.replace(/<[^>]+>/g, "").replaceAll(" ", " ") : node.value;
return node.value == null ? node.text.replace(/<[^>]+>/g, "").replaceAll("&nbsp;", " ") : node.value;
},
//获取半选框值
@ -312,7 +312,7 @@ BI.TreeView = BI.inherit(BI.Pane, {
if (BI.isKey(o.paras.keyword)) {
n.text = $("<div>").__textKeywordMarked__(n.text, o.paras.keyword, n.py).html();
} else {
n.text = (n.text + "").replaceAll(" ", " ");
n.text = (n.text + "").replaceAll(" ", "&nbsp;");
}
});
return nodes;

6
src/core/func/dom.js

@ -20,7 +20,7 @@ BI.extend(jQuery.fn, {
*/
__textKeywordMarked__: function (text, keyword, py) {
if (!BI.isKey(keyword) || (text + "").length > 100) {
return this.text((text + "").replaceAll(" ", " "));
return this.html((text + "").replaceAll(" ", "&nbsp;"));
}
keyword = keyword + "";
keyword = BI.toUpperCase(keyword);
@ -43,7 +43,7 @@ BI.extend(jQuery.fn, {
if (tidx >= 0) {
this.append(textLeft.substr(0, tidx));
this.append($("<span>").addClass("bi-keyword-red-mark")
.text(textLeft.substr(tidx, keyword.length).replaceAll(" ", " ")));
.html(textLeft.substr(tidx, keyword.length).replaceAll(" ", "&nbsp;")));
textLeft = textLeft.substr(tidx + keyword.length);
if (py != null) {
@ -52,7 +52,7 @@ BI.extend(jQuery.fn, {
} else if (pidx != null && pidx >= 0 && Math.floor(pidx / text.length) === Math.floor((pidx + keyword.length - 1) / text.length)) {
this.append(textLeft.substr(0, pidx));
this.append($("<span>").addClass("bi-keyword-red-mark")
.text(textLeft.substr(pidx, keyword.length).replaceAll(" ", " ")));
.html(textLeft.substr(pidx, keyword.length).replaceAll(" ", "&nbsp;")));
if (py != null) {
py = py.substr(pidx + keyword.length);
}

Loading…
Cancel
Save