四端上传

This commit is contained in:
tianmo committed 2026-09-29 15:25:40 +08:00
1 parent 25bbb5f9c8
commit c6e2cb4d5b
276 files changed
+17812 -3

No files matched your search

+32
View File
@@ -0,0 +1,32 @@
// Parser/trees/cssHandler.wxs
module.exports = {
getStyle: function(style, display) {
var res = "";
var reg = getRegExp("float\s*:\s*[^;]*", "i");
if (reg.test(style)) res += reg.exec(style)[0];
reg = getRegExp("margin[^;]*auto", "i");
if (reg.test(style)) res += (";" + reg.exec(style)[0]);
reg = getRegExp("display\s*:\s*([^;]*)", "i");
if (reg.test(style) && reg.exec(style)[1]!="flex") res += (';' + reg.exec(style)[0]);
else res += (';display:' + display);
reg = getRegExp("[^;\s]*width\s*:\s*[^;]*", "ig");
var width = reg.exec(style);
while (width) {
res += (';' + width[0]);
width = reg.exec(style);
}
return res;
},
setImgStyle: function(item, imgMode) {
if (getRegExp("[^-]width\s*:\s*[^;]*", "i").test(';' + item.attrs.style))
item.attrs.style += ';width:100%';
if (imgMode == "widthFix")
item.attrs.style += ";height:auto !important";
return [item];
},
setStyle: function(item) {
if (getRegExp("[^-]width\s*:\s*[^;]*", "i").test(';' + item.attrs.style))
item.attrs.style += ';width:100%';
return [item];
}
}