Skip to content

Commit

Permalink
html: update javascript
Browse files Browse the repository at this point in the history
  • Loading branch information
yffrankwang committed Jul 5, 2023
1 parent a15aaad commit d7d29e0
Show file tree
Hide file tree
Showing 30 changed files with 50 additions and 98 deletions.
7 changes: 4 additions & 3 deletions panda-html/build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,10 @@ exit /b
:minjs
echo --------------------------------------
echo -- minify js: %1
call uglifyjs.cmd %1.js --warn --compress --mangle --output %1.min.js
echo.>> %1.min.js
echo //# sourceMappingURL=%1.min.js.map>> %1.min.js
call uglifyjs.cmd %1.js --warn --compress --mangle --source-map url=%1.min.js.map -o %1.min.js
rem call uglifyjs.cmd %1.js --warn --compress --mangle --output %1.min.js
rem echo.>> %1.min.js
rem echo //# sourceMappingURL=%1.min.js.map>> %1.min.js
exit /b

:mincss
Expand Down
7 changes: 4 additions & 3 deletions panda-html/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ HTMLDIR=$BASEDIR/src/html/panda/html
minjs() {
echo --------------------------------------
echo -- minify js: $1
uglifyjs $1.js --warn --compress --mangle -o $1.min.js
echo "
//# sourceMappingURL=$1.min.js.map" >> $1.min.js
uglifyjs $1.js --warn --compress --mangle --source-map url=$1.min.js.map -o $1.min.js
# uglifyjs $1.js --warn --compress --mangle -o $1.min.js
# echo "
#//# sourceMappingURL=$1.min.js.map" >> $1.min.js
}

mincss() {
Expand Down
25 changes: 0 additions & 25 deletions panda-html/src/html/panda/html/corejs/core.string.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,31 +230,6 @@
};
}

if (typeof String.prototype.prettifyXML != "function") {
String.prototype.prettifyXML = function(space) {
space ||= ' ';
var pad = 0, ss = this.replace(/(>)(<)(\/*)/g, '$1\n$2$3').split('\n');
for (var i = 0; i < ss.length; i++) {
var s = ss[i], indent = 0;
if (s.match(/.+<\/\w[^>]*>$/)) {
// ...<abc>
} else if (s.match(/(^<\/\w)|(.*\/>$)/)) {
// </... or .../>
if (pad > 0) {
pad -= 1;
}
} else if (s.match(/^<\w[^>\/]*>.*$/)) {
// <abc>...
indent = 1;
}

ss[i] = space.repeat(pad) + s;
pad += indent;
}
return ss.join('\r\n');
};
}

if (typeof String.prototype.encodeUTF8 != "function") {
String.prototype.encodeUTF8 = function() {
var s = this, utf8 = "";
Expand Down
25 changes: 0 additions & 25 deletions panda-html/src/html/panda/html/corejs/corejs.js
Original file line number Diff line number Diff line change
Expand Up @@ -1232,31 +1232,6 @@ function DecimalFormat(pattern) {
};
}

if (typeof String.prototype.prettifyXML != "function") {
String.prototype.prettifyXML = function(space) {
space ||= ' ';
var pad = 0, ss = this.replace(/(>)(<)(\/*)/g, '$1\n$2$3').split('\n');
for (var i = 0; i < ss.length; i++) {
var s = ss[i], indent = 0;
if (s.match(/.+<\/\w[^>]*>$/)) {
// ...<abc>
} else if (s.match(/(^<\/\w)|(.*\/>$)/)) {
// </... or .../>
if (pad > 0) {
pad -= 1;
}
} else if (s.match(/^<\w[^>\/]*>.*$/)) {
// <abc>...
indent = 1;
}

ss[i] = space.repeat(pad) + s;
pad += indent;
}
return ss.join('\r\n');
};
}

if (typeof String.prototype.encodeUTF8 != "function") {
String.prototype.encodeUTF8 = function() {
var s = this, utf8 = "";
Expand Down
4 changes: 2 additions & 2 deletions panda-html/src/html/panda/html/corejs/corejs.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion panda-html/src/html/panda/html/corejs/corejs.min.js.map

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions panda-html/src/html/panda/html/hammer/jquery.ui.hammer.min.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions panda-html/src/html/panda/html/jquery/js/jquery-plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -1802,7 +1802,7 @@
$('[data-spy="niceSelect"]').niceSelect();
});

}(jQuery));
})(jQuery);
(function($) {
var ArrowClasses = {
'top left': 'dn hr1 vb',
Expand Down Expand Up @@ -2040,7 +2040,7 @@
function _show($p, $c, c, trigger) {
$c.trigger('show.popup');

$p.find('.ui-popup-closer')[c.closer ? 'show' : 'hide']();
$p.find('.ui-popup-closer').toggle(c.closer);

c.trigger = trigger || window;

Expand Down Expand Up @@ -2142,7 +2142,7 @@
var $p = _wrapper($c);
if (!$p.is(':hidden')) {
_bind(c);
_masker()[c.mask ? 'show' : 'hide']();
_masker().toggle(c.mask);
}
}
}
Expand Down Expand Up @@ -2473,7 +2473,7 @@
$('[data-spy="simpleColorPicker"]').simpleColorPicker();
});

}(jQuery));
})(jQuery);
(function($) {
"use strict";

Expand Down Expand Up @@ -2871,7 +2871,7 @@
}).css({ cursor: 'pointer' });

$w.scroll(function() {
$t[$w.scrollTop() > $w.height() ? 'show' : 'hide']();
$t.toggle($w.scrollTop() > $w.height());
});
});
};
Expand Down Expand Up @@ -2950,7 +2950,7 @@
$('ul[data-spy="treeview"]').treeview();
});

}(jQuery));
})(jQuery);
(function($) {
"use strict";

Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -209,4 +209,4 @@
$('[data-spy="niceSelect"]').niceSelect();
});

}(jQuery));
})(jQuery);
4 changes: 2 additions & 2 deletions panda-html/src/html/panda/html/jquery/js/jquery.ui.popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@
function _show($p, $c, c, trigger) {
$c.trigger('show.popup');

$p.find('.ui-popup-closer')[c.closer ? 'show' : 'hide']();
$p.find('.ui-popup-closer').toggle(c.closer);

c.trigger = trigger || window;

Expand Down Expand Up @@ -337,7 +337,7 @@
var $p = _wrapper($c);
if (!$p.is(':hidden')) {
_bind(c);
_masker()[c.mask ? 'show' : 'hide']();
_masker().toggle(c.mask);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,4 @@
$('[data-spy="simpleColorPicker"]').simpleColorPicker();
});

}(jQuery));
})(jQuery);
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
}).css({ cursor: 'pointer' });

$w.scroll(function() {
$t[$w.scrollTop() > $w.height() ? 'show' : 'hide']();
$t.toggle($w.scrollTop() > $w.height());
});
});
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,4 @@
$('ul[data-spy="treeview"]').treeview();
});

}(jQuery));
})(jQuery);

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit d7d29e0

Please sign in to comment.