Browse Source

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	dist/bundle.js
#	dist/bundle.min.js
#	dist/core.js
#	dist/fineui.js
#	dist/fineui.min.js
master
guy 7 years ago
parent
commit
68d8b8f6d0
  1. 1
      demo/js/base/tip/demo.bubble.js
  2. 3
      demo/js/base/tip/demo.toast.js
  3. 61
      demo/js/case/combo/demo.bubble_combo.js
  4. 4
      demo/js/case/demo.calendar.js
  5. 244
      dist/base.css
  6. 18
      dist/base.js
  7. 244
      dist/bundle.css
  8. 29632
      dist/bundle.js
  9. 2
      dist/bundle.min.css
  10. 93
      dist/bundle.min.js
  11. 46
      dist/case.js
  12. 29334
      dist/core.js
  13. 69
      dist/demo.js
  14. 244
      dist/fineui.css
  15. 29630
      dist/fineui.js
  16. 2
      dist/fineui.min.css
  17. 91
      dist/fineui.min.js
  18. 134
      dist/widget.js
  19. 16
      src/base/foundation/message.js
  20. 2
      src/base/layer/layer.floatbox.js
  21. 22
      src/case/calendar/calendar.js
  22. 12
      src/case/calendar/calendar.year.js
  23. 10
      src/case/combo/bubblecombo/combo.bubble.js
  24. 2
      src/case/floatbox/floatboxsection.bar.js
  25. 18
      src/core/alias.js
  26. 355
      src/core/base.js
  27. 28
      src/core/controller/controller.bubbles.js
  28. 328
      src/core/proto/date.js
  29. 57
      src/core/proto/string.js
  30. 4
      src/core/utils/cache.js
  31. 113
      src/css/base/combo/combo.bubble.css
  32. 113
      src/css/base/combo/combo.css
  33. 13
      src/css/base/foundation/bi.css
  34. 5
      src/css/base/single/tip/tip.css
  35. 13
      src/less/base/combo/combo.bubble.less
  36. 14
      src/less/base/foundation/bi.message.less
  37. 2
      src/less/base/single/tip/tip.less
  38. 1
      src/less/base/single/tip/tip.toast.less
  39. 1
      src/less/base/single/tip/tip.tooltip.less
  40. 72
      src/less/visual.less
  41. 8
      src/widget/date/calendar/picker.date.js
  42. 2
      src/widget/date/calendar/popup.calendar.date.js
  43. 42
      src/widget/date/trigger.date.js
  44. 4
      src/widget/datepane/datepane.js
  45. 4
      src/widget/datetime/datetime.combo.js
  46. 4
      src/widget/datetime/datetime.popup.js
  47. 4
      src/widget/datetime/datetime.trigger.js
  48. 34
      src/widget/multidate/abstract.multidate.datepane.js
  49. 6
      src/widget/multidate/multidate.combo.js
  50. 6
      src/widget/multidate/multidate.popup.js
  51. 12
      src/widget/timeinterval/timeinterval.js
  52. 6
      src/widget/year/popup.year.js
  53. 2
      src/widget/year/trigger.year.js
  54. 762
      utils/utils.js

1
demo/js/base/tip/demo.bubble.js

@ -12,6 +12,7 @@ Demo.Bubble = BI.inherit(BI.Widget, {
},
type: "bi.button",
text: "bubble测试(消息)",
title: "123",
height: 30,
handler: function () {
BI.Bubbles.show("singleBubble1", "bubble测试", this, {

3
demo/js/base/tip/demo.toast.js

@ -31,7 +31,8 @@ Demo.Toast = BI.inherit(BI.Widget, {
height: 30,
handler: function () {
BI.Msg.toast("这是一条非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长的数据", {
level: "warning"
level: "warning",
autoClose: false
});
}
}

61
demo/js/case/combo/demo.bubble_combo.js

@ -49,17 +49,70 @@ Demo.Func = BI.inherit(BI.Widget, {
}
}]
});
var combo3 = BI.createWidget({
type: "bi.bubble_combo",
el: {
type: "bi.button",
text: "测试",
height: 25
},
popup: {
type: "bi.text_bubble_bar_popup_view",
text: "我有很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字",
ref: function () {
self.popup = this;
}
},
listeners: [{
eventName: BI.BubbleCombo.EVENT_BEFORE_POPUPVIEW,
action: function () {
self.popup.populate((count++) % 2 === 1 ? "我的文字变少了" : "我有很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字");
}
}]
});
var combo4 = BI.createWidget({
type: "bi.bubble_combo",
el: {
type: "bi.button",
text: "测试",
height: 25
},
popup: {
type: "bi.text_bubble_bar_popup_view",
text: "我有很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字",
ref: function () {
self.popup = this;
}
},
listeners: [{
eventName: BI.BubbleCombo.EVENT_BEFORE_POPUPVIEW,
action: function () {
self.popup.populate((count++) % 2 === 1 ? "我的文字变少了" : "我有很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字");
}
}]
});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: combo1,
left: 100,
top: 100
left: 10,
top: 10
}, {
el: combo2,
left: 100,
bottom: 100
left: 10,
bottom: 10
}, {
el: combo3,
right: 10,
bottom: 10
}, {
el: combo4,
right: 10,
top: 10
}]
});
}

4
demo/js/case/demo.calendar.js

@ -16,7 +16,7 @@ Demo.Func = BI.inherit(BI.Widget, {
},
year: date.getFullYear(),
month: date.getMonth(),
day: date.getDate()
day: BI.getDate()
};
},
@ -25,7 +25,7 @@ Demo.Func = BI.inherit(BI.Widget, {
this.calendar.setValue({
year: date.getFullYear(),
month: date.getMonth(),
day: date.getDate()
day: BI.getDate()
});
}
});

244
dist/base.css vendored

@ -73,73 +73,219 @@
}
.bi-bubble-combo .button-combo-triangle-wrapper {
position: fixed !important;
z-index: 10000000;
}
.bi-bubble-combo .bubble-combo-triangle-left {
z-index: 1;
width: 0;
height: 0;
border-top: 6px solid transparent;
border-left: 6px solid #3f8ce8;
border-bottom: 6px solid transparent;
position: absolute;
width: 16px;
height: 10px;
border-bottom: 1px solid #f5f5f5;
}
.bi-bubble-combo .bubble-combo-triangle-left:before {
position: absolute;
top: 0px;
right: 0px;
bottom: 0px;
border-bottom: 10px solid #ccc;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
content: "";
}
.bi-bubble-combo .bubble-combo-triangle-left:after {
position: absolute;
right: 1px;
top: 1px;
bottom: 0px;
border-bottom: 9px solid #ffffff;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
content: "";
}
.bi-bubble-combo .bubble-combo-triangle-right {
z-index: 1;
width: 0;
height: 0;
border-top: 6px solid transparent;
border-right: 6px solid #3f8ce8;
border-bottom: 6px solid transparent;
position: absolute;
width: 16px;
height: 6px;
border-bottom: 1px solid #f5f5f5;
}
.bi-bubble-combo .bubble-combo-triangle-right:before {
position: absolute;
top: 0px;
right: 0px;
bottom: 0px;
border-bottom: 10px solid #ccc;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
content: "";
}
.bi-bubble-combo .bubble-combo-triangle-right:after {
position: absolute;
right: 1px;
top: 1px;
bottom: 0px;
border-bottom: 9px solid #ffffff;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
content: "";
}
.bi-bubble-combo .bubble-combo-triangle-top {
z-index: 1;
width: 0;
height: 0;
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-top: 6px solid #3f8ce8;
position: absolute;
width: 16px;
height: 10px;
border-top: 1px solid #ffffff;
}
.bi-bubble-combo .bubble-combo-triangle-top:after {
position: absolute;
right: 1px;
top: 0px;
border-top: 6px solid #ffffff;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
content: "";
}
.bi-bubble-combo .bubble-combo-triangle-top:before {
position: absolute;
border-top: 7px solid #cccccc;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
content: "";
}
.bi-bubble-combo .bubble-combo-triangle-bottom {
z-index: 1;
width: 0;
height: 0;
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-bottom: 6px solid #3f8ce8;
position: absolute;
width: 16px;
height: 5px;
border-bottom: 1px solid #ffffff;
}
.bi-bubble-combo .bubble-combo-triangle-bottom:before {
position: absolute;
top: 0px;
right: 0px;
bottom: 0px;
border-bottom: 7px solid #ccc;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
content: "";
}
.bi-bubble-combo .bubble-combo-triangle-bottom:after {
position: absolute;
right: 1px;
top: 1px;
bottom: 0px;
border-bottom: 6px solid #ffffff;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
content: "";
}
.bi-bubble-combo .button-combo-triangle-wrapper {
position: fixed !important;
z-index: 10000000;
}
.bi-bubble-combo .bubble-combo-triangle-left {
z-index: 1;
width: 0;
height: 0;
border-top: 6px solid transparent;
border-left: 6px solid #3f8ce8;
border-bottom: 6px solid transparent;
position: absolute;
width: 16px;
height: 10px;
border-bottom: 1px solid #f5f5f5;
}
.bi-bubble-combo .bubble-combo-triangle-left:before {
position: absolute;
top: 0px;
right: 0px;
bottom: 0px;
border-bottom: 10px solid #ccc;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
content: "";
}
.bi-bubble-combo .bubble-combo-triangle-left:after {
position: absolute;
right: 1px;
top: 1px;
bottom: 0px;
border-bottom: 9px solid #ffffff;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
content: "";
}
.bi-bubble-combo .bubble-combo-triangle-right {
z-index: 1;
width: 0;
height: 0;
border-top: 6px solid transparent;
border-right: 6px solid #3f8ce8;
border-bottom: 6px solid transparent;
position: absolute;
width: 16px;
height: 6px;
border-bottom: 1px solid #f5f5f5;
}
.bi-bubble-combo .bubble-combo-triangle-right:before {
position: absolute;
top: 0px;
right: 0px;
bottom: 0px;
border-bottom: 10px solid #ccc;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
content: "";
}
.bi-bubble-combo .bubble-combo-triangle-right:after {
position: absolute;
right: 1px;
top: 1px;
bottom: 0px;
border-bottom: 9px solid #ffffff;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
content: "";
}
.bi-bubble-combo .bubble-combo-triangle-top {
z-index: 1;
width: 0;
height: 0;
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-top: 6px solid #3f8ce8;
position: absolute;
width: 16px;
height: 10px;
border-top: 1px solid #ffffff;
}
.bi-bubble-combo .bubble-combo-triangle-top:after {
position: absolute;
right: 1px;
top: 0px;
border-top: 6px solid #ffffff;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
content: "";
}
.bi-bubble-combo .bubble-combo-triangle-top:before {
position: absolute;
border-top: 7px solid #cccccc;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
content: "";
}
.bi-bubble-combo .bubble-combo-triangle-bottom {
z-index: 1;
width: 0;
height: 0;
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-bottom: 6px solid #3f8ce8;
position: absolute;
width: 16px;
height: 5px;
border-bottom: 1px solid #ffffff;
}
.bi-bubble-combo .bubble-combo-triangle-bottom:before {
position: absolute;
top: 0px;
right: 0px;
bottom: 0px;
border-bottom: 7px solid #ccc;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
content: "";
}
.bi-bubble-combo .bubble-combo-triangle-bottom:after {
position: absolute;
right: 1px;
top: 1px;
bottom: 0px;
border-bottom: 6px solid #ffffff;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
content: "";
}
.bi-combo.bi-combo-popup {
@ -716,6 +862,19 @@ li.CodeMirror-hint-active {
.bi-message-close {
font-size: 25px;
}
.bi-message-animate {
-webkit-transition: opacity 0.3s, transform 0.4s, -webkit-transform 0.4s;
-moz-transition: opacity 0.3s, transform 0.4s, -webkit-transform 0.4s;
-o-transition: opacity 0.3s, transform 0.4s, -webkit-transform 0.4s;
transition: opacity 0.3s, transform 0.4s, -webkit-transform 0.4s;
}
.bi-message-enter {
opacity: 1;
}
.bi-message-leave {
opacity: 0;
transform: translateY(-100%);
}
.bi-message-title {
font-size: 16px;
cursor: pointer;
@ -1380,11 +1539,9 @@ body .bi-button.button-ignore.disabled.ghost .b-font:before,
color: #faaa39;
}
.bi-tip {
position: fixed !important;
}
.bi-toast {
position: fixed !important;
font-size: 14px;
color: #ffffff;
max-width: 400px;
@ -1410,6 +1567,7 @@ body .bi-button.button-ignore.disabled.ghost .b-font:before,
}
.bi-tooltip {
position: fixed !important;
max-width: 250px;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;

18
dist/base.js vendored

@ -14768,6 +14768,7 @@ $.extend(BI, {
var autoClose = BI.isNull(options.autoClose) ? true : options.autoClose;
var toast = BI.createWidget({
type: "bi.toast",
cls: "bi-message-animate bi-message-leave",
level: level,
autoClose: autoClose,
text: message
@ -14782,13 +14783,14 @@ $.extend(BI, {
}]
});
toast.element.css({"margin-left": -1 * toast.element.outerWidth() / 2});
toast.element.slideDown(500, function () {
autoClose && BI.delay(function () {
toast.element.slideUp(500, function () {
toast.destroy();
});
}, 5000);
});
toast.element.removeClass("bi-message-leave").addClass("bi-message-enter");
autoClose && BI.delay(function () {
toast.element.removeClass("bi-message-enter").addClass("bi-message-leave");
BI.delay(function () {
toast.destroy();
}, 1000);
}, 5000);
},
_show: function (hasCancel, title, message, callback) {
$mask = $("<div class=\"bi-z-index-mask\">").css({
@ -15382,7 +15384,7 @@ BI.FloatBox = BI.inherit(BI.Widget, {
bottom: 0
}]
},
height: 60
height: 44
}
}
});

244
dist/bundle.css vendored

@ -2120,73 +2120,219 @@ textarea {
}
.bi-bubble-combo .button-combo-triangle-wrapper {
position: fixed !important;
z-index: 10000000;
}
.bi-bubble-combo .bubble-combo-triangle-left {
z-index: 1;
width: 0;
height: 0;
border-top: 6px solid transparent;
border-left: 6px solid #3f8ce8;
border-bottom: 6px solid transparent;
position: absolute;
width: 16px;
height: 10px;
border-bottom: 1px solid #f5f5f5;
}
.bi-bubble-combo .bubble-combo-triangle-left:before {
position: absolute;
top: 0px;
right: 0px;
bottom: 0px;
border-bottom: 10px solid #ccc;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
content: "";
}
.bi-bubble-combo .bubble-combo-triangle-left:after {
position: absolute;
right: 1px;
top: 1px;
bottom: 0px;
border-bottom: 9px solid #ffffff;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
content: "";
}
.bi-bubble-combo .bubble-combo-triangle-right {
z-index: 1;
width: 0;
height: 0;
border-top: 6px solid transparent;
border-right: 6px solid #3f8ce8;
border-bottom: 6px solid transparent;
position: absolute;
width: 16px;
height: 6px;
border-bottom: 1px solid #f5f5f5;
}
.bi-bubble-combo .bubble-combo-triangle-right:before {
position: absolute;
top: 0px;
right: 0px;
bottom: 0px;
border-bottom: 10px solid #ccc;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
content: "";
}
.bi-bubble-combo .bubble-combo-triangle-right:after {
position: absolute;
right: 1px;
top: 1px;
bottom: 0px;
border-bottom: 9px solid #ffffff;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
content: "";
}
.bi-bubble-combo .bubble-combo-triangle-top {
z-index: 1;
width: 0;
height: 0;
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-top: 6px solid #3f8ce8;
position: absolute;
width: 16px;
height: 10px;
border-top: 1px solid #ffffff;
}
.bi-bubble-combo .bubble-combo-triangle-top:after {
position: absolute;
right: 1px;
top: 0px;
border-top: 6px solid #ffffff;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
content: "";
}
.bi-bubble-combo .bubble-combo-triangle-top:before {
position: absolute;
border-top: 7px solid #cccccc;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
content: "";
}
.bi-bubble-combo .bubble-combo-triangle-bottom {
z-index: 1;
width: 0;
height: 0;
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-bottom: 6px solid #3f8ce8;
position: absolute;
width: 16px;
height: 5px;
border-bottom: 1px solid #ffffff;
}
.bi-bubble-combo .bubble-combo-triangle-bottom:before {
position: absolute;
top: 0px;
right: 0px;
bottom: 0px;
border-bottom: 7px solid #ccc;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
content: "";
}
.bi-bubble-combo .bubble-combo-triangle-bottom:after {
position: absolute;
right: 1px;
top: 1px;
bottom: 0px;
border-bottom: 6px solid #ffffff;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
content: "";
}
.bi-bubble-combo .button-combo-triangle-wrapper {
position: fixed !important;
z-index: 10000000;
}
.bi-bubble-combo .bubble-combo-triangle-left {
z-index: 1;
width: 0;
height: 0;
border-top: 6px solid transparent;
border-left: 6px solid #3f8ce8;
border-bottom: 6px solid transparent;
position: absolute;
width: 16px;
height: 10px;
border-bottom: 1px solid #f5f5f5;
}
.bi-bubble-combo .bubble-combo-triangle-left:before {
position: absolute;
top: 0px;
right: 0px;
bottom: 0px;
border-bottom: 10px solid #ccc;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
content: "";
}
.bi-bubble-combo .bubble-combo-triangle-left:after {
position: absolute;
right: 1px;
top: 1px;
bottom: 0px;
border-bottom: 9px solid #ffffff;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
content: "";
}
.bi-bubble-combo .bubble-combo-triangle-right {
z-index: 1;
width: 0;
height: 0;
border-top: 6px solid transparent;
border-right: 6px solid #3f8ce8;
border-bottom: 6px solid transparent;
position: absolute;
width: 16px;
height: 6px;
border-bottom: 1px solid #f5f5f5;
}
.bi-bubble-combo .bubble-combo-triangle-right:before {
position: absolute;
top: 0px;
right: 0px;
bottom: 0px;
border-bottom: 10px solid #ccc;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
content: "";
}
.bi-bubble-combo .bubble-combo-triangle-right:after {
position: absolute;
right: 1px;
top: 1px;
bottom: 0px;
border-bottom: 9px solid #ffffff;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
content: "";
}
.bi-bubble-combo .bubble-combo-triangle-top {
z-index: 1;
width: 0;
height: 0;
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-top: 6px solid #3f8ce8;
position: absolute;
width: 16px;
height: 10px;
border-top: 1px solid #ffffff;
}
.bi-bubble-combo .bubble-combo-triangle-top:after {
position: absolute;
right: 1px;
top: 0px;
border-top: 6px solid #ffffff;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
content: "";
}
.bi-bubble-combo .bubble-combo-triangle-top:before {
position: absolute;
border-top: 7px solid #cccccc;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
content: "";
}
.bi-bubble-combo .bubble-combo-triangle-bottom {
z-index: 1;
width: 0;
height: 0;
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-bottom: 6px solid #3f8ce8;
position: absolute;
width: 16px;
height: 5px;
border-bottom: 1px solid #ffffff;
}
.bi-bubble-combo .bubble-combo-triangle-bottom:before {
position: absolute;
top: 0px;
right: 0px;
bottom: 0px;
border-bottom: 7px solid #ccc;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
content: "";
}
.bi-bubble-combo .bubble-combo-triangle-bottom:after {
position: absolute;
right: 1px;
top: 1px;
bottom: 0px;
border-bottom: 6px solid #ffffff;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
content: "";
}
.bi-combo.bi-combo-popup {
@ -2763,6 +2909,19 @@ li.CodeMirror-hint-active {
.bi-message-close {
font-size: 25px;
}
.bi-message-animate {
-webkit-transition: opacity 0.3s, transform 0.4s, -webkit-transform 0.4s;
-moz-transition: opacity 0.3s, transform 0.4s, -webkit-transform 0.4s;
-o-transition: opacity 0.3s, transform 0.4s, -webkit-transform 0.4s;
transition: opacity 0.3s, transform 0.4s, -webkit-transform 0.4s;
}
.bi-message-enter {
opacity: 1;
}
.bi-message-leave {
opacity: 0;
transform: translateY(-100%);
}
.bi-message-title {
font-size: 16px;
cursor: pointer;
@ -3427,11 +3586,9 @@ body .bi-button.button-ignore.disabled.ghost .b-font:before,
color: #faaa39;
}
.bi-tip {
position: fixed !important;
}
.bi-toast {
position: fixed !important;
font-size: 14px;
color: #ffffff;
max-width: 400px;
@ -3457,6 +3614,7 @@ body .bi-button.button-ignore.disabled.ghost .b-font:before,
}
.bi-tooltip {
position: fixed !important;
max-width: 250px;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;

29632
dist/bundle.js vendored

File diff suppressed because one or more lines are too long

2
dist/bundle.min.css vendored

File diff suppressed because one or more lines are too long

93
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

46
dist/case.js vendored

@ -1605,7 +1605,7 @@ BI.Calendar = BI.inherit(BI.Widget, {
},
_dateCreator: function (Y, M, D) {
var self = this, o = this.options, log = {}, De = Date.getDate();
var self = this, o = this.options, log = {}, De = BI.getDate();
var mins = o.min.match(/\d+/g);
var maxs = o.max.match(/\d+/g);
Y < (mins[0] | 0) && (Y = (mins[0] | 0));
@ -1615,7 +1615,7 @@ BI.Calendar = BI.inherit(BI.Widget, {
log.ymd = [De.getFullYear(), De.getMonth(), De.getDate()];
var MD = Date._MD.slice(0);
MD[1] = Date.isLeap(log.ymd[0]) ? 29 : 28;
MD[1] = BI.isLeapYear(log.ymd[0]) ? 29 : 28;
De.setFullYear(log.ymd[0], log.ymd[1], 1);
log.FDay = De.getDay();
@ -1642,7 +1642,7 @@ BI.Calendar = BI.inherit(BI.Widget, {
MM === 12 && (YY += 1);
MM = MM === 12 ? 1 : MM + 1;
}
if (Date.checkVoid(YY, MM, DD, mins, maxs)[0]) {
if (BI.checkDateVoid(YY, MM, DD, mins, maxs)[0]) {
td.disabled = true;
}
td.text = DD;
@ -1715,20 +1715,20 @@ BI.Calendar = BI.inherit(BI.Widget, {
isFrontDate: function () {
var o = this.options, c = this._const;
var Y = o.year, M = o.month, De = Date.getDate(), day = De.getDay();
var Y = o.year, M = o.month, De = BI.getDate(), day = De.getDay();
Y = Y | 0;
De.setFullYear(Y, M, 1);
var newDate = De.getOffsetDate(-1 * (day + 1));
return !!Date.checkVoid(newDate.getFullYear(), newDate.getMonth(), newDate.getDate(), o.min, o.max)[0];
return !!BI.checkDateVoid(newDate.getFullYear(), newDate.getMonth(), newDate.getDate(), o.min, o.max)[0];
},
isFinalDate: function () {
var o = this.options, c = this._const;
var Y = o.year, M = o.month, De = Date.getDate(), day = De.getDay();
var Y = o.year, M = o.month, De = BI.getDate(), day = De.getDay();
Y = Y | 0;
De.setFullYear(Y, M, 1);
var newDate = De.getOffsetDate(42 - day);
return !!Date.checkVoid(newDate.getFullYear(), newDate.getMonth(), newDate.getDate(), o.min, o.max)[0];
return !!BI.checkDateVoid(newDate.getFullYear(), newDate.getMonth(), newDate.getDate(), o.min, o.max)[0];
},
setValue: function (ob) {
@ -1747,14 +1747,14 @@ BI.Calendar = BI.inherit(BI.Widget, {
BI.extend(BI.Calendar, {
getPageByDateJSON: function (json) {
var year = Date.getDate().getFullYear();
var month = Date.getDate().getMonth();
var year = BI.getDate().getFullYear();
var month = BI.getDate().getMonth();
var page = (json.year - year) * 12;
page += json.month - month;
return page;
},
getDateJSONByPage: function (v) {
var months = Date.getDate().getMonth();
var months = BI.getDate().getMonth();
var page = v;
// 对当前page做偏移,使到当前年初
@ -1766,7 +1766,7 @@ BI.extend(BI.Calendar, {
}
var month = page >= 0 ? (page % 12) : ((12 + page % 12) % 12);
return {
year: Date.getDate().getFullYear() + year,
year: BI.getDate().getFullYear() + year,
month: month
};
}
@ -1800,7 +1800,7 @@ BI.YearCalendar = BI.inherit(BI.Widget, {
var items = [];
BI.each(BI.range(BI.YearCalendar.INTERVAL), function (i) {
var td = {};
if (Date.checkVoid(start + i, 1, 1, o.min, o.max)[0]) {
if (BI.checkDateVoid(start + i, 1, 1, o.min, o.max)[0]) {
td.disabled = true;
}
td.text = start + i;
@ -1812,7 +1812,7 @@ BI.YearCalendar = BI.inherit(BI.Widget, {
_init: function () {
BI.YearCalendar.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.currentYear = Date.getDate().getFullYear();
this.currentYear = BI.getDate().getFullYear();
var years = this._yearCreator(o.year || this.currentYear);
// 纵向排列年
@ -1875,14 +1875,14 @@ BI.YearCalendar = BI.inherit(BI.Widget, {
var o = this.options;
var Y = o.year;
Y = Y | 0;
return !!Date.checkVoid(BI.YearCalendar.getStartYear(Y) - 1, 1, 1, o.min, o.max)[0];
return !!BI.checkDateVoid(BI.YearCalendar.getStartYear(Y) - 1, 1, 1, o.min, o.max)[0];
},
isFinalYear: function () {
var o = this.options, c = this._const;
var Y = o.year;
Y = Y | 0;
return !!Date.checkVoid(BI.YearCalendar.getEndYear(Y) + 1, 1, 1, o.min, o.max)[0];
return !!BI.checkDateVoid(BI.YearCalendar.getEndYear(Y) + 1, 1, 1, o.min, o.max)[0];
},
setValue: function (val) {
@ -1899,7 +1899,7 @@ BI.extend(BI.YearCalendar, {
// 获取显示的第一年
getStartYear: function (year) {
var cur = Date.getDate().getFullYear();
var cur = BI.getDate().getFullYear();
return year - ((year - cur + 3) % BI.YearCalendar.INTERVAL + 12) % BI.YearCalendar.INTERVAL;
},
@ -1908,7 +1908,7 @@ BI.extend(BI.YearCalendar, {
},
getPageByYear: function (year) {
var cur = Date.getDate().getFullYear();
var cur = BI.getDate().getFullYear();
year = BI.YearCalendar.getStartYear(year);
return (year - cur + 3) / BI.YearCalendar.INTERVAL;
}
@ -4908,22 +4908,22 @@ BI.BubbleCombo = BI.inherit(BI.Widget, {
case "left,top":
case "left,bottom":
this._createLeftTriangle();
this.combo.getView().showLine("right");
//this.combo.getView().showLine("right");
break;
case "right,top":
case "right,bottom":
this._createRightTriangle();
this.combo.getView().showLine("left");
//this.combo.getView().showLine("left");
break;
case "top,left":
case "top,right":
this._createTopTriangle();
this.combo.getView().showLine("bottom");
//this.combo.getView().showLine("bottom");
break;
case "bottom,left":
case "bottom,right":
this._createBottomTriangle();
this.combo.getView().showLine("top");
//this.combo.getView().showLine("top");
break;
}
},
@ -4931,7 +4931,7 @@ BI.BubbleCombo = BI.inherit(BI.Widget, {
_hideTriangle: function () {
this.triangle && this.triangle.destroy();
this.triangle = null;
this.combo.getView() && this.combo.getView().hideLine();
//this.combo.getView() && this.combo.getView().hideLine();
},
hideView: function () {
@ -8020,7 +8020,6 @@ BI.BarPopoverSection = BI.inherit(BI.PopoverSection, {
type: "bi.button",
text: this.options.btns[0],
warningTitle: o.warningTitle,
height: 30,
value: 0,
handler: function (v) {
self.end();
@ -8030,7 +8029,6 @@ BI.BarPopoverSection = BI.inherit(BI.PopoverSection, {
this.cancel = BI.createWidget({
type: "bi.button",
text: this.options.btns[1],
height: 30,
value: 1,
level: "ignore",
handler: function (v) {

29334
dist/core.js vendored

File diff suppressed because one or more lines are too long

69
dist/demo.js vendored

@ -1495,6 +1495,7 @@ BI.shortcut("demo.table_view", Demo.Func);Demo.Bubble = BI.inherit(BI.Widget, {
},
type: "bi.button",
text: "bubble测试(消息)",
title: "123",
height: 30,
handler: function () {
BI.Bubbles.show("singleBubble1", "bubble测试", this, {
@ -1627,7 +1628,8 @@ BI.shortcut("demo.title", Demo.Title);Demo.Toast = BI.inherit(BI.Widget, {
height: 30,
handler: function () {
BI.Msg.toast("这是一条非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长非常长的数据", {
level: "warning"
level: "warning",
autoClose: false
});
}
}
@ -1823,17 +1825,70 @@ BI.shortcut("demo.tree_view", Demo.Func);Demo.Func = BI.inherit(BI.Widget, {
}
}]
});
var combo3 = BI.createWidget({
type: "bi.bubble_combo",
el: {
type: "bi.button",
text: "测试",
height: 25
},
popup: {
type: "bi.text_bubble_bar_popup_view",
text: "我有很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字",
ref: function () {
self.popup = this;
}
},
listeners: [{
eventName: BI.BubbleCombo.EVENT_BEFORE_POPUPVIEW,
action: function () {
self.popup.populate((count++) % 2 === 1 ? "我的文字变少了" : "我有很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字");
}
}]
});
var combo4 = BI.createWidget({
type: "bi.bubble_combo",
el: {
type: "bi.button",
text: "测试",
height: 25
},
popup: {
type: "bi.text_bubble_bar_popup_view",
text: "我有很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字",
ref: function () {
self.popup = this;
}
},
listeners: [{
eventName: BI.BubbleCombo.EVENT_BEFORE_POPUPVIEW,
action: function () {
self.popup.populate((count++) % 2 === 1 ? "我的文字变少了" : "我有很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字很多文字");
}
}]
});
BI.createWidget({
type: "bi.absolute",
element: this,
items: [{
el: combo1,
left: 100,
top: 100
left: 10,
top: 10
}, {
el: combo2,
left: 100,
bottom: 100
left: 10,
bottom: 10
}, {
el: combo3,
right: 10,
bottom: 10
}, {
el: combo4,
right: 10,
top: 10
}]
});
}
@ -2241,7 +2296,7 @@ BI.shortcut("demo.text_value_check_combo", Demo.TextValueCheckCombo);Demo.Func =
},
year: date.getFullYear(),
month: date.getMonth(),
day: date.getDate()
day: BI.getDate()
};
},
@ -2250,7 +2305,7 @@ BI.shortcut("demo.text_value_check_combo", Demo.TextValueCheckCombo);Demo.Func =
this.calendar.setValue({
year: date.getFullYear(),
month: date.getMonth(),
day: date.getDate()
day: BI.getDate()
});
}
});

244
dist/fineui.css vendored

@ -2120,73 +2120,219 @@ textarea {
}
.bi-bubble-combo .button-combo-triangle-wrapper {
position: fixed !important;
z-index: 10000000;
}
.bi-bubble-combo .bubble-combo-triangle-left {
z-index: 1;
width: 0;
height: 0;
border-top: 6px solid transparent;
border-left: 6px solid #3f8ce8;
border-bottom: 6px solid transparent;
position: absolute;
width: 16px;
height: 10px;
border-bottom: 1px solid #f5f5f5;
}
.bi-bubble-combo .bubble-combo-triangle-left:before {
position: absolute;
top: 0px;
right: 0px;
bottom: 0px;
border-bottom: 10px solid #ccc;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
content: "";
}
.bi-bubble-combo .bubble-combo-triangle-left:after {
position: absolute;
right: 1px;
top: 1px;
bottom: 0px;
border-bottom: 9px solid #ffffff;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
content: "";
}
.bi-bubble-combo .bubble-combo-triangle-right {
z-index: 1;
width: 0;
height: 0;
border-top: 6px solid transparent;
border-right: 6px solid #3f8ce8;
border-bottom: 6px solid transparent;
position: absolute;
width: 16px;
height: 6px;
border-bottom: 1px solid #f5f5f5;
}
.bi-bubble-combo .bubble-combo-triangle-right:before {
position: absolute;
top: 0px;
right: 0px;
bottom: 0px;
border-bottom: 10px solid #ccc;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
content: "";
}
.bi-bubble-combo .bubble-combo-triangle-right:after {
position: absolute;
right: 1px;
top: 1px;
bottom: 0px;
border-bottom: 9px solid #ffffff;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
content: "";
}
.bi-bubble-combo .bubble-combo-triangle-top {
z-index: 1;
width: 0;
height: 0;
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-top: 6px solid #3f8ce8;
position: absolute;
width: 16px;
height: 10px;
border-top: 1px solid #ffffff;
}
.bi-bubble-combo .bubble-combo-triangle-top:after {
position: absolute;
right: 1px;
top: 0px;
border-top: 6px solid #ffffff;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
content: "";
}
.bi-bubble-combo .bubble-combo-triangle-top:before {
position: absolute;
border-top: 7px solid #cccccc;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
content: "";
}
.bi-bubble-combo .bubble-combo-triangle-bottom {
z-index: 1;
width: 0;
height: 0;
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-bottom: 6px solid #3f8ce8;
position: absolute;
width: 16px;
height: 5px;
border-bottom: 1px solid #ffffff;
}
.bi-bubble-combo .bubble-combo-triangle-bottom:before {
position: absolute;
top: 0px;
right: 0px;
bottom: 0px;
border-bottom: 7px solid #ccc;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
content: "";
}
.bi-bubble-combo .bubble-combo-triangle-bottom:after {
position: absolute;
right: 1px;
top: 1px;
bottom: 0px;
border-bottom: 6px solid #ffffff;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
content: "";
}
.bi-bubble-combo .button-combo-triangle-wrapper {
position: fixed !important;
z-index: 10000000;
}
.bi-bubble-combo .bubble-combo-triangle-left {
z-index: 1;
width: 0;
height: 0;
border-top: 6px solid transparent;
border-left: 6px solid #3f8ce8;
border-bottom: 6px solid transparent;
position: absolute;
width: 16px;
height: 10px;
border-bottom: 1px solid #f5f5f5;
}
.bi-bubble-combo .bubble-combo-triangle-left:before {
position: absolute;
top: 0px;
right: 0px;
bottom: 0px;
border-bottom: 10px solid #ccc;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
content: "";
}
.bi-bubble-combo .bubble-combo-triangle-left:after {
position: absolute;
right: 1px;
top: 1px;
bottom: 0px;
border-bottom: 9px solid #ffffff;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
content: "";
}
.bi-bubble-combo .bubble-combo-triangle-right {
z-index: 1;
width: 0;
height: 0;
border-top: 6px solid transparent;
border-right: 6px solid #3f8ce8;
border-bottom: 6px solid transparent;
position: absolute;
width: 16px;
height: 6px;
border-bottom: 1px solid #f5f5f5;
}
.bi-bubble-combo .bubble-combo-triangle-right:before {
position: absolute;
top: 0px;
right: 0px;
bottom: 0px;
border-bottom: 10px solid #ccc;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
content: "";
}
.bi-bubble-combo .bubble-combo-triangle-right:after {
position: absolute;
right: 1px;
top: 1px;
bottom: 0px;
border-bottom: 9px solid #ffffff;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
content: "";
}
.bi-bubble-combo .bubble-combo-triangle-top {
z-index: 1;
width: 0;
height: 0;
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-top: 6px solid #3f8ce8;
position: absolute;
width: 16px;
height: 10px;
border-top: 1px solid #ffffff;
}
.bi-bubble-combo .bubble-combo-triangle-top:after {
position: absolute;
right: 1px;
top: 0px;
border-top: 6px solid #ffffff;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
content: "";
}
.bi-bubble-combo .bubble-combo-triangle-top:before {
position: absolute;
border-top: 7px solid #cccccc;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
content: "";
}
.bi-bubble-combo .bubble-combo-triangle-bottom {
z-index: 1;
width: 0;
height: 0;
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-bottom: 6px solid #3f8ce8;
position: absolute;
width: 16px;
height: 5px;
border-bottom: 1px solid #ffffff;
}
.bi-bubble-combo .bubble-combo-triangle-bottom:before {
position: absolute;
top: 0px;
right: 0px;
bottom: 0px;
border-bottom: 7px solid #ccc;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
content: "";
}
.bi-bubble-combo .bubble-combo-triangle-bottom:after {
position: absolute;
right: 1px;
top: 1px;
bottom: 0px;
border-bottom: 6px solid #ffffff;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
content: "";
}
.bi-combo.bi-combo-popup {
@ -2763,6 +2909,19 @@ li.CodeMirror-hint-active {
.bi-message-close {
font-size: 25px;
}
.bi-message-animate {
-webkit-transition: opacity 0.3s, transform 0.4s, -webkit-transform 0.4s;
-moz-transition: opacity 0.3s, transform 0.4s, -webkit-transform 0.4s;
-o-transition: opacity 0.3s, transform 0.4s, -webkit-transform 0.4s;
transition: opacity 0.3s, transform 0.4s, -webkit-transform 0.4s;
}
.bi-message-enter {
opacity: 1;
}
.bi-message-leave {
opacity: 0;
transform: translateY(-100%);
}
.bi-message-title {
font-size: 16px;
cursor: pointer;
@ -3427,11 +3586,9 @@ body .bi-button.button-ignore.disabled.ghost .b-font:before,
color: #faaa39;
}
.bi-tip {
position: fixed !important;
}
.bi-toast {
position: fixed !important;
font-size: 14px;
color: #ffffff;
max-width: 400px;
@ -3457,6 +3614,7 @@ body .bi-button.button-ignore.disabled.ghost .b-font:before,
}
.bi-tooltip {
position: fixed !important;
max-width: 250px;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;

29630
dist/fineui.js vendored

File diff suppressed because one or more lines are too long

2
dist/fineui.min.css vendored

File diff suppressed because one or more lines are too long

91
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

134
dist/widget.js vendored

@ -561,8 +561,8 @@ BI.DatePicker = BI.inherit(BI.Widget, {
_init: function () {
BI.DatePicker.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this._year = Date.getDate().getFullYear();
this._month = Date.getDate().getMonth();
this._year = BI.getDate().getFullYear();
this._month = BI.getDate().getMonth();
this.left = BI.createWidget({
type: "bi.icon_button",
cls: "pre-page-h-font",
@ -659,14 +659,14 @@ BI.DatePicker = BI.inherit(BI.Widget, {
_checkLeftValid: function () {
var o = this.options;
var valid = !(this._month === 0 && this._year === Date.parseDateTime(o.min, "%Y-%X-%d").getFullYear());
var valid = !(this._month === 0 && this._year === BI.parseDateTime(o.min, "%Y-%X-%d").getFullYear());
this.left.setEnable(valid);
return valid;
},
_checkRightValid: function () {
var o = this.options;
var valid = !(this._month === 11 && this._year === Date.parseDateTime(o.max, "%Y-%X-%d").getFullYear());
var valid = !(this._month === 11 && this._year === BI.parseDateTime(o.max, "%Y-%X-%d").getFullYear());
this.right.setEnable(valid);
return valid;
},
@ -726,7 +726,7 @@ BI.DateCalendarPopup = BI.inherit(BI.Widget, {
BI.DateCalendarPopup.superclass._init.apply(this, arguments);
var self = this,
o = this.options;
this.today = Date.getDate();
this.today = BI.getDate();
this._year = this.today.getFullYear();
this._month = this.today.getMonth();
this._day = this.today.getDate();
@ -939,7 +939,7 @@ BI.shortcut("bi.date_combo", BI.DateCombo);BI.DateTrigger = BI.inherit(BI.Trigge
validationChecker: function (v) {
var date = v.match(/\d+/g);
self._autoAppend(v, date);
return self._dateCheck(v) && Date.checkLegal(v) && self._checkVoid({
return self._dateCheck(v) && BI.checkDateLegal(v) && self._checkVoid({
year: date[0],
month: date[1],
day: date[2]
@ -1017,21 +1017,21 @@ BI.shortcut("bi.date_combo", BI.DateCombo);BI.DateTrigger = BI.inherit(BI.Trigge
this.setValue(o.value);
},
_dateCheck: function (date) {
return Date.parseDateTime(date, "%Y-%x-%d").print("%Y-%x-%d") == date || Date.parseDateTime(date, "%Y-%X-%d").print("%Y-%X-%d") == date || Date.parseDateTime(date, "%Y-%x-%e").print("%Y-%x-%e") == date || Date.parseDateTime(date, "%Y-%X-%e").print("%Y-%X-%e") == date;
return BI.parseDateTime(date, "%Y-%x-%d").print("%Y-%x-%d") == date || BI.parseDateTime(date, "%Y-%X-%d").print("%Y-%X-%d") == date || BI.parseDateTime(date, "%Y-%x-%e").print("%Y-%x-%e") == date || BI.parseDateTime(date, "%Y-%X-%e").print("%Y-%X-%e") == date;
},
_checkVoid: function (obj) {
return !Date.checkVoid(obj.year, obj.month, obj.day, this.options.min, this.options.max)[0];
return !BI.checkDateVoid(obj.year, obj.month, obj.day, this.options.min, this.options.max)[0];
},
_autoAppend: function (v, dateObj) {
var self = this;
var date = Date.parseDateTime(v, "%Y-%X-%d").print("%Y-%X-%d");
var date = BI.parseDateTime(v, "%Y-%X-%d").print("%Y-%X-%d");
var yearCheck = function (v) {
return Date.parseDateTime(v, "%Y").print("%Y") == v && date >= self.options.min && date <= self.options.max;
return BI.parseDateTime(v, "%Y").print("%Y") == v && date >= self.options.min && date <= self.options.max;
};
var monthCheck = function (v) {
return Date.parseDateTime(v, "%Y-%X").print("%Y-%X") == v && date >= self.options.min && date <= self.options.max;
return BI.parseDateTime(v, "%Y-%X").print("%Y-%X") == v && date >= self.options.min && date <= self.options.max;
};
if (BI.isNotNull(dateObj) && Date.checkLegal(v)) {
if (BI.isNotNull(dateObj) && BI.checkDateLegal(v)) {
switch (v.length) {
case this._const.yearLength:
if (yearCheck(v)) {
@ -1049,7 +1049,7 @@ BI.shortcut("bi.date_combo", BI.DateCombo);BI.DateTrigger = BI.inherit(BI.Trigge
setValue: function (v) {
var type, value, self = this;
var date = Date.getDate();
var date = BI.getDate();
this.store_value = v;
if (BI.isNotNull(v)) {
type = v.type || BI.DateTrigger.MULTI_DATE_CALENDAR; value = v.value;
@ -1066,62 +1066,62 @@ BI.shortcut("bi.date_combo", BI.DateCombo);BI.DateTrigger = BI.inherit(BI.Trigge
switch (type) {
case BI.DateTrigger.MULTI_DATE_YEAR_PREV:
var text = value + BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_YEAR_PREV];
date = Date.getDate((date.getFullYear() - 1 * value), date.getMonth(), date.getDate());
date = BI.getDate((date.getFullYear() - 1 * value), date.getMonth(), BI.getDate());
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_YEAR_AFTER:
var text = value + BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_YEAR_AFTER];
date = Date.getDate((date.getFullYear() + 1 * value), date.getMonth(), date.getDate());
date = BI.getDate((date.getFullYear() + 1 * value), date.getMonth(), BI.getDate());
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_YEAR_BEGIN:
var text = BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_YEAR_BEGIN];
date = Date.getDate(date.getFullYear(), 0, 1);
date = BI.getDate(date.getFullYear(), 0, 1);
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_YEAR_END:
var text = BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_YEAR_END];
date = Date.getDate(date.getFullYear(), 11, 31);
date = BI.getDate(date.getFullYear(), 11, 31);
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_QUARTER_PREV:
var text = value + BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_QUARTER_PREV];
date = Date.getDate().getBeforeMulQuarter(value);
date = BI.getDate().getBeforeMulQuarter(value);
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_QUARTER_AFTER:
var text = value + BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_QUARTER_AFTER];
date = Date.getDate().getAfterMulQuarter(value);
date = BI.getDate().getAfterMulQuarter(value);
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_QUARTER_BEGIN:
var text = BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_QUARTER_BEGIN];
date = Date.getDate().getQuarterStartDate();
date = BI.getDate().getQuarterStartDate();
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_QUARTER_END:
var text = BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_QUARTER_END];
date = Date.getDate().getQuarterEndDate();
date = BI.getDate().getQuarterEndDate();
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_MONTH_PREV:
var text = value + BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_MONTH_PREV];
date = Date.getDate().getBeforeMultiMonth(value);
date = BI.getDate().getBeforeMultiMonth(value);
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_MONTH_AFTER:
var text = value + BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_MONTH_AFTER];
date = Date.getDate().getAfterMultiMonth(value);
date = BI.getDate().getAfterMultiMonth(value);
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_MONTH_BEGIN:
var text = BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_MONTH_BEGIN];
date = Date.getDate(date.getFullYear(), date.getMonth(), 1);
date = BI.getDate(date.getFullYear(), date.getMonth(), 1);
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_MONTH_END:
var text = BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_MONTH_END];
date = Date.getDate(date.getFullYear(), date.getMonth(), (date.getLastDateOfMonth()).getDate());
date = BI.getDate(date.getFullYear(), date.getMonth(), (date.getLastDateOfMonth()).getDate());
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_WEEK_PREV:
@ -1146,7 +1146,7 @@ BI.shortcut("bi.date_combo", BI.DateCombo);BI.DateTrigger = BI.inherit(BI.Trigge
break;
case BI.DateTrigger.MULTI_DATE_DAY_TODAY:
var text = BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_DAY_TODAY];
date = Date.getDate();
date = BI.getDate();
_setInnerValue(date, text);
break;
default:
@ -1247,7 +1247,7 @@ BI.DatePaneWidget = BI.inherit(BI.Widget, {
BI.DatePaneWidget.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.today = Date.getDate();
this.today = BI.getDate();
this._year = this.today.getFullYear();
this._month = this.today.getMonth();
@ -1312,7 +1312,7 @@ BI.DatePaneWidget = BI.inherit(BI.Widget, {
},
_getNewCurrentDate: function () {
var today = Date.getDate();
var today = BI.getDate();
return {
year: today.getFullYear(),
month: today.getMonth()
@ -1374,11 +1374,11 @@ BI.DateTimeCombo = BI.inherit(BI.Single, {
_init: function () {
BI.DateTimeCombo.superclass._init.apply(this, arguments);
var self = this, opts = this.options;
var date = Date.getDate();
var date = BI.getDate();
this.storeValue = BI.isNotNull(opts.value) ? opts.value : {
year: date.getFullYear(),
month: date.getMonth(),
day: date.getDate(),
day: BI.getDate(),
hour: date.getHours(),
minute: date.getMinutes(),
second: date.getSeconds()
@ -1617,11 +1617,11 @@ BI.DateTimePopup = BI.inherit(BI.Widget, {
setValue: function (v) {
var value = v, date;
if (BI.isNull(value)) {
date = Date.getDate();
date = BI.getDate();
this.dateCombo.setValue({
year: date.getFullYear(),
month: date.getMonth(),
day: date.getDate()
day: BI.getDate()
});
this.hour.setValue(date.getHours());
this.minute.setValue(date.getMinutes());
@ -1808,10 +1808,10 @@ BI.DateTimeTrigger = BI.inherit(BI.Trigger, {
var self = this;
var value = v, dateStr;
if(BI.isNull(value)) {
value = Date.getDate();
value = BI.getDate();
dateStr = value.print("%Y-%X-%d %H:%M:%S");
} else {
var date = Date.getDate(value.year, value.month, value.day, value.hour, value.minute, value.second);
var date = BI.getDate(value.year, value.month, value.day, value.hour, value.minute, value.second);
dateStr = date.print("%Y-%X-%d %H:%M:%S");
}
@ -4610,39 +4610,39 @@ BI.MultiDateCard = BI.inherit(BI.Widget, {
var type = valueObject.type, value = valueObject.value;
switch (type) {
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_PREV:
return Date.getDate().getOffsetDate(-1 * value);
return BI.getDate().getOffsetDate(-1 * value);
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_AFTER:
return Date.getDate().getOffsetDate(value);
return BI.getDate().getOffsetDate(value);
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_TODAY:
return Date.getDate();
return BI.getDate();
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_PREV:
return Date.getDate().getBeforeMultiMonth(value);
return BI.getDate().getBeforeMultiMonth(value);
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_AFTER:
return Date.getDate().getAfterMultiMonth(value);
return BI.getDate().getAfterMultiMonth(value);
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_BEGIN:
return Date.getDate(Date.getDate().getFullYear(), Date.getDate().getMonth(), 1);
return BI.getDate(BI.getDate().getFullYear(), BI.getDate().getMonth(), 1);
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_END:
return Date.getDate(Date.getDate().getFullYear(), Date.getDate().getMonth(), (Date.getDate().getLastDateOfMonth()).getDate());
return BI.getDate(BI.getDate().getFullYear(), BI.getDate().getMonth(), (BI.getDate().getLastDateOfMonth()).getDate());
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_PREV:
return Date.getDate().getBeforeMulQuarter(value);
return BI.getDate().getBeforeMulQuarter(value);
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_AFTER:
return Date.getDate().getAfterMulQuarter(value);
return BI.getDate().getAfterMulQuarter(value);
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_BEGIN:
return Date.getDate().getQuarterStartDate();
return BI.getDate().getQuarterStartDate();
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_END:
return Date.getDate().getQuarterEndDate();
return BI.getDate().getQuarterEndDate();
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_WEEK_PREV:
return Date.getDate().getOffsetDate(-7 * value);
return BI.getDate().getOffsetDate(-7 * value);
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_WEEK_AFTER:
return Date.getDate().getOffsetDate(7 * value);
return BI.getDate().getOffsetDate(7 * value);
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_PREV:
return Date.getDate((Date.getDate().getFullYear() - 1 * value), Date.getDate().getMonth(), Date.getDate().getDate());
return BI.getDate((BI.getDate().getFullYear() - 1 * value), BI.getDate().getMonth(), BI.getDate().getDate());
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_AFTER:
return Date.getDate((Date.getDate().getFullYear() + 1 * value), Date.getDate().getMonth(), Date.getDate().getDate());
return BI.getDate((BI.getDate().getFullYear() + 1 * value), BI.getDate().getMonth(), BI.getDate().getDate());
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_BEGIN:
return Date.getDate(Date.getDate().getFullYear(), 0, 1);
return BI.getDate(BI.getDate().getFullYear(), 0, 1);
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_END:
return Date.getDate(Date.getDate().getFullYear(), 11, 31);
return BI.getDate(BI.getDate().getFullYear(), 11, 31);
}
}
});
@ -4671,7 +4671,7 @@ BI.MultiDateCombo = BI.inherit(BI.Single, {
BI.MultiDateCombo.superclass._init.apply(this, arguments);
var self = this, opts = this.options;
this.storeTriggerValue = "";
var date = Date.getDate();
var date = BI.getDate();
this.storeValue = opts.value;
this.trigger = BI.createWidget({
type: "bi.date_trigger",
@ -4740,11 +4740,11 @@ BI.MultiDateCombo = BI.inherit(BI.Single, {
self.fireEvent(BI.MultiDateCombo.EVENT_CONFIRM);
});
this.popup.on(BI.MultiDatePopup.BUTTON_lABEL_EVENT_CHANGE, function () {
var date = Date.getDate();
var date = BI.getDate();
self.setValue({
year: date.getFullYear(),
month: date.getMonth(),
day: date.getDate()
day: BI.getDate()
});
self.combo.hideView();
self.fireEvent(BI.MultiDateCombo.EVENT_CONFIRM);
@ -5184,7 +5184,7 @@ BI.MultiDatePopup = BI.inherit(BI.Widget, {
self.ymd.setValue({
year: date.getFullYear(),
month: date.getMonth(),
day: date.getDate()
day: BI.getDate()
});
self._setInnerValue(self.ymd);
break;
@ -5299,12 +5299,12 @@ BI.MultiDatePopup = BI.inherit(BI.Widget, {
break;
default:
if (this._checkValueValid(value)) {
var date = Date.getDate();
var date = BI.getDate();
this.dateTab.setSelect(BI.MultiDateCombo.MULTI_DATE_YMD_CARD);
this.ymd.setValue({
year: date.getFullYear(),
month: date.getMonth(),
day: date.getDate()
day: BI.getDate()
});
this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today"));
} else {
@ -17318,26 +17318,26 @@ BI.TimeInterval = BI.inherit(BI.Single, {
return combo;
},
_dateCheck: function (date) {
return Date.parseDateTime(date, "%Y-%x-%d").print("%Y-%x-%d") == date || Date.parseDateTime(date, "%Y-%X-%d").print("%Y-%X-%d") == date || Date.parseDateTime(date, "%Y-%x-%e").print("%Y-%x-%e") == date || Date.parseDateTime(date, "%Y-%X-%e").print("%Y-%X-%e") == date;
return BI.parseDateTime(date, "%Y-%x-%d").print("%Y-%x-%d") == date || BI.parseDateTime(date, "%Y-%X-%d").print("%Y-%X-%d") == date || BI.parseDateTime(date, "%Y-%x-%e").print("%Y-%x-%e") == date || BI.parseDateTime(date, "%Y-%X-%e").print("%Y-%X-%e") == date;
},
_checkVoid: function (obj) {
return !Date.checkVoid(obj.year, obj.month, obj.day, this.constants.DATE_MIN_VALUE, this.constants.DATE_MAX_VALUE)[0];
return !BI.checkDateVoid(obj.year, obj.month, obj.day, this.constants.DATE_MIN_VALUE, this.constants.DATE_MAX_VALUE)[0];
},
_check: function (smallDate, bigDate) {
var smallObj = smallDate.match(/\d+/g), bigObj = bigDate.match(/\d+/g);
return this._dateCheck(smallDate) && Date.checkLegal(smallDate) && this._checkVoid({
return this._dateCheck(smallDate) && BI.checkDateLegal(smallDate) && this._checkVoid({
year: smallObj[0],
month: smallObj[1],
day: smallObj[2]
}) && this._dateCheck(bigDate) && Date.checkLegal(bigDate) && this._checkVoid({
}) && this._dateCheck(bigDate) && BI.checkDateLegal(bigDate) && this._checkVoid({
year: bigObj[0],
month: bigObj[1],
day: bigObj[2]
});
},
_compare: function (smallDate, bigDate) {
smallDate = Date.parseDateTime(smallDate, "%Y-%X-%d").print("%Y-%X-%d");
bigDate = Date.parseDateTime(bigDate, "%Y-%X-%d").print("%Y-%X-%d");
smallDate = BI.parseDateTime(smallDate, "%Y-%X-%d").print("%Y-%X-%d");
bigDate = BI.parseDateTime(bigDate, "%Y-%X-%d").print("%Y-%X-%d");
return BI.isNotNull(smallDate) && BI.isNotNull(bigDate) && smallDate > bigDate;
},
_setTitle: function (v) {
@ -17505,7 +17505,7 @@ BI.YearPopup = BI.inherit(BI.Widget, {
BI.YearPopup.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.selectedYear = this._year = Date.getDate().getFullYear();
this.selectedYear = this._year = BI.getDate().getFullYear();
var backBtn = BI.createWidget({
type: "bi.icon_button",
@ -17562,8 +17562,8 @@ BI.YearPopup = BI.inherit(BI.Widget, {
setValue: function (v) {
var o = this.options;
if (Date.checkVoid(v, 1, 1, o.min, o.max)[0]) {
v = Date.getDate().getFullYear();
if (BI.checkDateVoid(v, 1, 1, o.min, o.max)[0]) {
v = BI.getDate().getFullYear();
this.selectedYear = "";
this.navigation.setSelect(BI.YearCalendar.getPageByYear(v));
this.navigation.setValue("");
@ -17606,7 +17606,7 @@ BI.YearTrigger = BI.inherit(BI.Trigger, {
height: o.height,
validationChecker: function (v) {
self.editor.setErrorText(!BI.isPositiveInteger(v) ? c.errorText : c.errorTextInvalid);
return v === "" || (BI.isPositiveInteger(v) && !Date.checkVoid(v, 1, 1, o.min, o.max)[0]);
return v === "" || (BI.isPositiveInteger(v) && !BI.checkDateVoid(v, 1, 1, o.min, o.max)[0]);
},
quitChecker: function (v) {
return false;

16
src/base/foundation/message.js

@ -25,6 +25,7 @@ $.extend(BI, {
var autoClose = BI.isNull(options.autoClose) ? true : options.autoClose;
var toast = BI.createWidget({
type: "bi.toast",
cls: "bi-message-animate bi-message-leave",
level: level,
autoClose: autoClose,
text: message
@ -39,13 +40,14 @@ $.extend(BI, {
}]
});
toast.element.css({"margin-left": -1 * toast.element.outerWidth() / 2});
toast.element.slideDown(500, function () {
autoClose && BI.delay(function () {
toast.element.slideUp(500, function () {
toast.destroy();
});
}, 5000);
});
toast.element.removeClass("bi-message-leave").addClass("bi-message-enter");
autoClose && BI.delay(function () {
toast.element.removeClass("bi-message-enter").addClass("bi-message-leave");
BI.delay(function () {
toast.destroy();
}, 1000);
}, 5000);
},
_show: function (hasCancel, title, message, callback) {
$mask = $("<div class=\"bi-z-index-mask\">").css({

2
src/base/layer/layer.floatbox.js

@ -99,7 +99,7 @@ BI.FloatBox = BI.inherit(BI.Widget, {
bottom: 0
}]
},
height: 60
height: 44
}
}
});

22
src/case/calendar/calendar.js

@ -20,7 +20,7 @@ BI.Calendar = BI.inherit(BI.Widget, {
},
_dateCreator: function (Y, M, D) {
var self = this, o = this.options, log = {}, De = Date.getDate();
var self = this, o = this.options, log = {}, De = BI.getDate();
var mins = o.min.match(/\d+/g);
var maxs = o.max.match(/\d+/g);
Y < (mins[0] | 0) && (Y = (mins[0] | 0));
@ -30,7 +30,7 @@ BI.Calendar = BI.inherit(BI.Widget, {
log.ymd = [De.getFullYear(), De.getMonth(), De.getDate()];
var MD = Date._MD.slice(0);
MD[1] = Date.isLeap(log.ymd[0]) ? 29 : 28;
MD[1] = BI.isLeapYear(log.ymd[0]) ? 29 : 28;
De.setFullYear(log.ymd[0], log.ymd[1], 1);
log.FDay = De.getDay();
@ -57,7 +57,7 @@ BI.Calendar = BI.inherit(BI.Widget, {
MM === 12 && (YY += 1);
MM = MM === 12 ? 1 : MM + 1;
}
if (Date.checkVoid(YY, MM, DD, mins, maxs)[0]) {
if (BI.checkDateVoid(YY, MM, DD, mins, maxs)[0]) {
td.disabled = true;
}
td.text = DD;
@ -130,20 +130,20 @@ BI.Calendar = BI.inherit(BI.Widget, {
isFrontDate: function () {
var o = this.options, c = this._const;
var Y = o.year, M = o.month, De = Date.getDate(), day = De.getDay();
var Y = o.year, M = o.month, De = BI.getDate(), day = De.getDay();
Y = Y | 0;
De.setFullYear(Y, M, 1);
var newDate = De.getOffsetDate(-1 * (day + 1));
return !!Date.checkVoid(newDate.getFullYear(), newDate.getMonth(), newDate.getDate(), o.min, o.max)[0];
return !!BI.checkDateVoid(newDate.getFullYear(), newDate.getMonth(), newDate.getDate(), o.min, o.max)[0];
},
isFinalDate: function () {
var o = this.options, c = this._const;
var Y = o.year, M = o.month, De = Date.getDate(), day = De.getDay();
var Y = o.year, M = o.month, De = BI.getDate(), day = De.getDay();
Y = Y | 0;
De.setFullYear(Y, M, 1);
var newDate = De.getOffsetDate(42 - day);
return !!Date.checkVoid(newDate.getFullYear(), newDate.getMonth(), newDate.getDate(), o.min, o.max)[0];
return !!BI.checkDateVoid(newDate.getFullYear(), newDate.getMonth(), newDate.getDate(), o.min, o.max)[0];
},
setValue: function (ob) {
@ -162,14 +162,14 @@ BI.Calendar = BI.inherit(BI.Widget, {
BI.extend(BI.Calendar, {
getPageByDateJSON: function (json) {
var year = Date.getDate().getFullYear();
var month = Date.getDate().getMonth();
var year = BI.getDate().getFullYear();
var month = BI.getDate().getMonth();
var page = (json.year - year) * 12;
page += json.month - month;
return page;
},
getDateJSONByPage: function (v) {
var months = Date.getDate().getMonth();
var months = BI.getDate().getMonth();
var page = v;
// 对当前page做偏移,使到当前年初
@ -181,7 +181,7 @@ BI.extend(BI.Calendar, {
}
var month = page >= 0 ? (page % 12) : ((12 + page % 12) % 12);
return {
year: Date.getDate().getFullYear() + year,
year: BI.getDate().getFullYear() + year,
month: month
};
}

12
src/case/calendar/calendar.year.js

@ -26,7 +26,7 @@ BI.YearCalendar = BI.inherit(BI.Widget, {
var items = [];
BI.each(BI.range(BI.YearCalendar.INTERVAL), function (i) {
var td = {};
if (Date.checkVoid(start + i, 1, 1, o.min, o.max)[0]) {
if (BI.checkDateVoid(start + i, 1, 1, o.min, o.max)[0]) {
td.disabled = true;
}
td.text = start + i;
@ -38,7 +38,7 @@ BI.YearCalendar = BI.inherit(BI.Widget, {
_init: function () {
BI.YearCalendar.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.currentYear = Date.getDate().getFullYear();
this.currentYear = BI.getDate().getFullYear();
var years = this._yearCreator(o.year || this.currentYear);
// 纵向排列年
@ -101,14 +101,14 @@ BI.YearCalendar = BI.inherit(BI.Widget, {
var o = this.options;
var Y = o.year;
Y = Y | 0;
return !!Date.checkVoid(BI.YearCalendar.getStartYear(Y) - 1, 1, 1, o.min, o.max)[0];
return !!BI.checkDateVoid(BI.YearCalendar.getStartYear(Y) - 1, 1, 1, o.min, o.max)[0];
},
isFinalYear: function () {
var o = this.options, c = this._const;
var Y = o.year;
Y = Y | 0;
return !!Date.checkVoid(BI.YearCalendar.getEndYear(Y) + 1, 1, 1, o.min, o.max)[0];
return !!BI.checkDateVoid(BI.YearCalendar.getEndYear(Y) + 1, 1, 1, o.min, o.max)[0];
},
setValue: function (val) {
@ -125,7 +125,7 @@ BI.extend(BI.YearCalendar, {
// 获取显示的第一年
getStartYear: function (year) {
var cur = Date.getDate().getFullYear();
var cur = BI.getDate().getFullYear();
return year - ((year - cur + 3) % BI.YearCalendar.INTERVAL + 12) % BI.YearCalendar.INTERVAL;
},
@ -134,7 +134,7 @@ BI.extend(BI.YearCalendar, {
},
getPageByYear: function (year) {
var cur = Date.getDate().getFullYear();
var cur = BI.getDate().getFullYear();
year = BI.YearCalendar.getStartYear(year);
return (year - cur + 3) / BI.YearCalendar.INTERVAL;
}

10
src/case/combo/bubblecombo/combo.bubble.js

@ -168,22 +168,22 @@ BI.BubbleCombo = BI.inherit(BI.Widget, {
case "left,top":
case "left,bottom":
this._createLeftTriangle();
this.combo.getView().showLine("right");
//this.combo.getView().showLine("right");
break;
case "right,top":
case "right,bottom":
this._createRightTriangle();
this.combo.getView().showLine("left");
//this.combo.getView().showLine("left");
break;
case "top,left":
case "top,right":
this._createTopTriangle();
this.combo.getView().showLine("bottom");
//this.combo.getView().showLine("bottom");
break;
case "bottom,left":
case "bottom,right":
this._createBottomTriangle();
this.combo.getView().showLine("top");
//this.combo.getView().showLine("top");
break;
}
},
@ -191,7 +191,7 @@ BI.BubbleCombo = BI.inherit(BI.Widget, {
_hideTriangle: function () {
this.triangle && this.triangle.destroy();
this.triangle = null;
this.combo.getView() && this.combo.getView().hideLine();
//this.combo.getView() && this.combo.getView().hideLine();
},
hideView: function () {

2
src/case/floatbox/floatboxsection.bar.js

@ -21,7 +21,6 @@ BI.BarPopoverSection = BI.inherit(BI.PopoverSection, {
type: "bi.button",
text: this.options.btns[0],
warningTitle: o.warningTitle,
height: 30,
value: 0,
handler: function (v) {
self.end();
@ -31,7 +30,6 @@ BI.BarPopoverSection = BI.inherit(BI.PopoverSection, {
this.cancel = BI.createWidget({
type: "bi.button",
text: this.options.btns[1],
height: 30,
value: 1,
level: "ignore",
handler: function (v) {

18
src/core/alias.js

@ -154,7 +154,7 @@
if (newnum.length > orilen) {
newnum = newnum.substr(1);
} else {
newnum = String.leftPad(newnum, orilen, "0");
newnum = BI.leftPad(newnum, orilen, "0");
result.leftPlus = false;
}
right = right.replace(/^[0-9]+/, newnum);
@ -497,6 +497,8 @@
text = _eFormat(text, fmt);
} else {
// 数字格式
var s = [];
BI.clamp(s);
text = _numberFormat(text, fmt);
}
// ¤ - 货币格式
@ -566,14 +568,14 @@
} else if (len < 2) {
str = date.getMonth() + 1;
} else {
str = String.leftPad(date.getMonth() + 1 + "", 2, "0");
str = BI.leftPad(date.getMonth() + 1 + "", 2, "0");
}
break;
case "d": // 日
if (len > 1) {
str = String.leftPad(date.getDate() + "", 2, "0");
str = BI.leftPad(BI.getDate() + "", 2, "0");
} else {
str = date.getDate();
str = BI.getDate();
}
break;
case "h": // 时(12)
@ -582,28 +584,28 @@
hour = 12;
}
if (len > 1) {
str = String.leftPad(hour + "", 2, "0");
str = BI.leftPad(hour + "", 2, "0");
} else {
str = hour;
}
break;
case "H": // 时(24)
if (len > 1) {
str = String.leftPad(date.getHours() + "", 2, "0");
str = BI.leftPad(date.getHours() + "", 2, "0");
} else {
str = date.getHours();
}
break;
case "m":
if (len > 1) {
str = String.leftPad(date.getMinutes() + "", 2, "0");
str = BI.leftPad(date.getMinutes() + "", 2, "0");
} else {
str = date.getMinutes();
}
break;
case "s":
if (len > 1) {
str = String.leftPad(date.getSeconds() + "", 2, "0");
str = BI.leftPad(date.getSeconds() + "", 2, "0");
} else {
str = date.getSeconds();
}

355
src/core/base.js

@ -548,7 +548,7 @@ if (!window.BI) {
// Date
if (type === "[object Date]") {
return Date.getDate(obj.getTime());
return BI.getDate(obj.getTime());
}
var i, clone, key;
@ -784,7 +784,7 @@ if (!window.BI) {
if (Date.now) {
return Date.now();
}
return Date.getDate().getTime();
return BI.getDate().getTime();
},
@ -1047,6 +1047,357 @@ if (!window.BI) {
prand = (mult * prand + incr) % modu;
}
return unescape(enc_str);
},
/**
* 对字符串中的'\做编码处理
* @static
* @param {String} string 要做编码处理的字符串
* @return {String} 编码后的字符串
*/
escape: function (string) {
return string.replace(/('|\\)/g, "\\$1");
},
/**
* 让字符串通过指定字符做补齐的函数
*
* var s = BI.leftPad('123', 5, '0');//s的值为:'00123'
*
* @static
* @param {String} val 原始值
* @param {Number} size 总共需要的位数
* @param {String} ch 用于补齐的字符
* @return {String} 补齐后的字符串
*/
leftPad: function (val, size, ch) {
var result = String(val);
if (!ch) {
ch = " ";
}
while (result.length < size) {
result = ch + result;
}
return result.toString();
},
/**
* 对字符串做替换的函数
*
* var cls = 'my-class', text = 'Some text';
* var res = BI.format('<div class="{0}>{1}</div>"', cls, text);
* //res的值为:'<div class="my-class">Some text</div>';
*
* @static
* @param {String} format 要做替换的字符串替换字符串1替换字符串2...
* @return {String} 做了替换后的字符串
*/
format: function (format) {
var args = Array.prototype.slice.call(arguments, 1);
return format.replace(/\{(\d+)\}/g, function (m, i) {
return args[i];
});
}
});
// 日期相关方法
_.extend(BI, {
/**
* 是否是闰年
* @param year
* @returns {boolean}
*/
isLeapYear: function (year) {
return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
},
/**
* 检测是否在有效期
*
* @param YY
* @param MM
* @param DD
* @param minDate '1900-01-01'
* @param maxDate '2099-12-31'
* @returns {Array} 若无效返回无效状态
*/
checkDateVoid: function (YY, MM, DD, minDate, maxDate) {
var back = [];
YY = YY | 0;
MM = MM | 0;
DD = DD | 0;
minDate = BI.isString(minDate) ? minDate.match(/\d+/g) : minDate;
maxDate = BI.isString(maxDate) ? maxDate.match(/\d+/g) : maxDate;
if (YY < minDate[0]) {
back = ["y"];
} else if (YY > maxDate[0]) {
back = ["y", 1];
} else if (YY >= minDate[0] && YY <= maxDate[0]) {
if (YY == minDate[0]) {
if (MM < minDate[1]) {
back = ["m"];
} else if (MM == minDate[1]) {
if (DD < minDate[2]) {
back = ["d"];
}
}
}
if (YY == maxDate[0]) {
if (MM > maxDate[1]) {
back = ["m", 1];
} else if (MM == maxDate[1]) {
if (DD > maxDate[2]) {
back = ["d", 1];
}
}
}
}
return back;
},
checkDateLegal: function (str) {
var ar = str.match(/\d+/g);
var YY = ar[0] | 0, MM = ar[1] | 0, DD = ar[2] | 0;
if (ar.length <= 1) {
return true;
}
if (ar.length <= 2) {
return MM >= 1 && MM <= 12;
}
var MD = Date._MD.slice(0);
MD[1] = BI.isLeapYear(YY) ? 29 : 28;
return MM >= 1 && MM <= 12 && DD <= MD[MM - 1];
},
parseDateTime: function (str, fmt) {
var today = BI.getDate();
var y = 0;
var m = 0;
var d = 1;
// wei : 对于fmt为‘YYYYMM’或者‘YYYYMMdd’的格式,str的值为类似'201111'的形式,因为年月之间没有分隔符,所以正则表达式分割无效,导致bug7376。
var a = str.split(/\W+/);
if (fmt.toLowerCase() == "%y%x" || fmt.toLowerCase() == "%y%x%d") {
var yearlength = 4;
var otherlength = 2;
a[0] = str.substring(0, yearlength);
a[1] = str.substring(yearlength, yearlength + otherlength);
a[2] = str.substring(yearlength + otherlength, yearlength + otherlength * 2);
}
var b = fmt.match(/%./g);
var i = 0, j = 0;
var hr = 0;
var min = 0;
var sec = 0;
for (i = 0; i < a.length; ++i) {
switch (b[i]) {
case "%d":
case "%e":
d = parseInt(a[i], 10);
break;
case "%X":
m = parseInt(a[i], 10) - 1;
break;
case "%x":
m = parseInt(a[i], 10) - 1;
break;
case "%Y":
case "%y":
y = parseInt(a[i], 10);
(y < 100) && (y += (y > 29) ? 1900 : 2000);
break;
case "%b":
case "%B":
for (j = 0; j < 12; ++j) {
if (Date._MN[j].substr(0, a[i].length).toLowerCase() == a[i].toLowerCase()) {
m = j;
break;
}
}
break;
case "%H":
case "%I":
case "%k":
case "%l":
hr = parseInt(a[i], 10);
break;
case "%P":
case "%p":
if (/pm/i.test(a[i]) && hr < 12) {
hr += 12;
} else if (/am/i.test(a[i]) && hr >= 12) {
hr -= 12;
}
break;
case "%M":
min = parseInt(a[i], 10);
case "%S":
sec = parseInt(a[i], 10);
break;
}
}
// if (!a[i]) {
// continue;
// }
if (isNaN(y)) {
y = today.getFullYear();
}
if (isNaN(m)) {
m = today.getMonth();
}
if (isNaN(d)) {
d = today.getDate();
}
if (isNaN(hr)) {
hr = today.getHours();
}
if (isNaN(min)) {
min = today.getMinutes();
}
if (isNaN(sec)) {
sec = today.getSeconds();
}
if (y != 0) {
return BI.getDate(y, m, d, hr, min, sec);
}
y = 0;
m = -1;
d = 0;
for (i = 0; i < a.length; ++i) {
if (a[i].search(/[a-zA-Z]+/) != -1) {
var t = -1;
for (j = 0; j < 12; ++j) {
if (Date._MN[j].substr(0, a[i].length).toLowerCase() == a[i].toLowerCase()) {
t = j;
break;
}
}
if (t != -1) {
if (m != -1) {
d = m + 1;
}
m = t;
}
} else if (parseInt(a[i], 10) <= 12 && m == -1) {
m = a[i] - 1;
} else if (parseInt(a[i], 10) > 31 && y == 0) {
y = parseInt(a[i], 10);
(y < 100) && (y += (y > 29) ? 1900 : 2000);
} else if (d == 0) {
d = a[i];
}
}
if (y == 0) {
y = today.getFullYear();
}
if (m != -1 && d != 0) {
return BI.getDate(y, m, d, hr, min, sec);
}
return today;
},
getDate: function () {
var length = arguments.length;
var args = arguments;
var dt;
switch (length) {
// new Date()
case 0:
dt = new Date();
break;
// new Date(long)
case 1:
dt = new Date(args[0]);
break;
// new Date(year, month)
case 2:
dt = new Date(args[0], args[1]);
break;
// new Date(year, month, day)
case 3:
dt = new Date(args[0], args[1], args[2]);
break;
// new Date(year, month, day, hour)
case 4:
dt = new Date(args[0], args[1], args[2], args[3]);
break;
// new Date(year, month, day, hour, minute)
case 5:
dt = new Date(args[0], args[1], args[2], args[3], args[4]);
break;
// new Date(year, month, day, hour, minute, second)
case 6:
dt = new Date(args[0], args[1], args[2], args[3], args[4], args[5]);
break;
// new Date(year, month, day, hour, minute, second, millisecond)
case 7:
dt = new Date(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
break;
default:
dt = new Date();
break;
}
if (BI.isNotNull(Date.timeZone) && (arguments.length === 0 || (arguments.length === 1 && BI.isNumber(arguments[0])))) {
var localTime = dt.getTime();
var localOffset = dt.getTimezoneOffset() * 60000; // 获得当地时间偏移的毫秒数
var utc = localTime + localOffset; // utc即GMT时间标准时区
return new Date(utc + Date.timeZone);// + Pool.timeZone.offset);
}
return dt;
},
getTime: function () {
var length = arguments.length;
var args = arguments;
var dt;
switch (length) {
// new Date()
case 0:
dt = new Date();
break;
// new Date(long)
case 1:
dt = new Date(args[0]);
break;
// new Date(year, month)
case 2:
dt = new Date(args[0], args[1]);
break;
// new Date(year, month, day)
case 3:
dt = new Date(args[0], args[1], args[2]);
break;
// new Date(year, month, day, hour)
case 4:
dt = new Date(args[0], args[1], args[2], args[3]);
break;
// new Date(year, month, day, hour, minute)
case 5:
dt = new Date(args[0], args[1], args[2], args[3], args[4]);
break;
// new Date(year, month, day, hour, minute, second)
case 6:
dt = new Date(args[0], args[1], args[2], args[3], args[4], args[5]);
break;
// new Date(year, month, day, hour, minute, second, millisecond)
case 7:
dt = new Date(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
break;
default:
dt = new Date();
break;
}
if (BI.isNotNull(Date.timeZone)) {
return dt.getTime() - Date.timeZone - dt.getTimezoneOffset() * 60000;
}
return dt.getTime();
}
});

28
src/core/controller/controller.bubbles.js

@ -16,16 +16,8 @@ BI.BubblesController = BI.inherit(BI.Controller, {
_init: function () {
BI.BubblesController.superclass._init.apply(this, arguments);
var self = this;
this.bubblesManager = {};
this.storeBubbles = {};
BI.Resizers.add("bubbleController" + BI.uniqueId(), function () {
BI.each(self.bubblesManager, function (name) {
self.remove(name);
});
self.bubblesManager = {};
self.storeBubbles = {};
});
},
_createBubble: function (direct, text, level, height) {
@ -41,60 +33,60 @@ BI.BubblesController = BI.inherit(BI.Controller, {
_getOffsetLeft: function (name, context, offsetStyle) {
var left = 0;
if ("center" === offsetStyle) {
left = context.element.offset().left + (context.element.bounds().width - this.get(name).element.bounds().width) / 2;
left = (context.element.bounds().width - this.get(name).element.bounds().width) / 2;
if (left < 0) {
left = 0;
}
return left;
}
if ("right" === offsetStyle) {
left = context.element.offset().left + context.element.bounds().width - this.get(name).element.bounds().width;
left = context.element.bounds().width - this.get(name).element.bounds().width;
if (left < 0) {
left = 0;
}
return left;
}
return context.element.offset().left;
return left;
},
_getOffsetTop: function (name, context, offsetStyle) {
var top = 0;
if ("center" === offsetStyle) {
top = context.element.offset().top + (context.element.bounds().height - this.get(name).element.bounds().height) / 2;
top = (context.element.bounds().height - this.get(name).element.bounds().height) / 2;
if (top < 0) {
top = 0;
}
return top;
} else if ("right" === offsetStyle) {
top = context.element.offset().top + context.element.bounds().height - this.get(name).element.bounds().height;
top = context.element.bounds().height - this.get(name).element.bounds().height;
if (top < 0) {
top = 0;
}
return top;
}
return context.element.offset().top;
return top;
},
_getLeftPosition: function (name, context, offsetStyle) {
var position = $.getLeftPosition(context, this.get(name));
var position = {left: - this.get(name).element.bounds().width};
position.top = this._getOffsetTop(name, context, offsetStyle);
return position;
},
_getBottomPosition: function (name, context, offsetStyle) {
var position = $.getBottomPosition(context, this.get(name));
var position = {top: context.element.bounds().height};
position.left = this._getOffsetLeft(name, context, offsetStyle);
return position;
},
_getTopPosition: function (name, context, offsetStyle) {
var position = $.getTopPosition(context, this.get(name));
var position = {top: -35};
position.left = this._getOffsetLeft(name, context, offsetStyle);
return position;
},
_getRightPosition: function (name, context, offsetStyle) {
var position = $.getRightPosition(context, this.get(name));
var position = {left: context.element.bounds().width};
position.top = this._getOffsetTop(name, context, offsetStyle);
return position;
},

328
src/core/proto/date.js

@ -32,20 +32,20 @@ Date.prototype.getMonthDays = function (month) {
* @returns {Date}
*/
Date.prototype.getLastDateOfMonth = function () {
return Date.getDate(this.getFullYear(), this.getMonth(), this.getMonthDays());
return BI.getDate(this.getFullYear(), this.getMonth(), this.getMonthDays());
};
/** Returns the number of day in the year. */
Date.prototype.getDayOfYear = function () {
var now = Date.getDate(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0);
var then = Date.getDate(this.getFullYear(), 0, 0, 0, 0, 0);
var now = BI.getDate(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0);
var then = BI.getDate(this.getFullYear(), 0, 0, 0, 0, 0);
var time = now - then;
return Math.floor(time / Date.DAY);
};
/** Returns the number of the week in year, as defined in ISO 8601. */
Date.prototype.getWeekNumber = function () {
var d = Date.getDate(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0);
var d = BI.getDate(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0);
// 周一是一周第一天
var week = d.getDay() === 0 ? 7 : d.getDay();
// var week = d.getDay();
@ -69,17 +69,17 @@ Date.prototype.getQuarter = function () {
// 离当前时间多少天的时间
Date.prototype.getOffsetDate = function (offset) {
return Date.getDate(Date.getTime(this.getFullYear(), this.getMonth(), this.getDate(), this.getHours(), this.getMinutes(), this.getSeconds()) + offset * 864e5);
return BI.getDate(BI.getTime(this.getFullYear(), this.getMonth(), this.getDate(), this.getHours(), this.getMinutes(), this.getSeconds()) + offset * 864e5);
};
Date.prototype.getAfterMulQuarter = function (n) {
var dt = Date.getDate(Date.getTime(this.getFullYear(), this.getMonth(), this.getDate(), this.getHours(), this.getMinutes(), this.getSeconds()));
var dt = BI.getDate(BI.getTime(this.getFullYear(), this.getMonth(), this.getDate(), this.getHours(), this.getMinutes(), this.getSeconds()));
dt.setMonth(dt.getMonth() + n * 3);
return dt;
};
// 获得n个季度前的日期
Date.prototype.getBeforeMulQuarter = function (n) {
var dt = Date.getDate(Date.getTime(this.getFullYear(), this.getMonth(), this.getDate(), this.getHours(), this.getMinutes(), this.getSeconds()));
var dt = BI.getDate(BI.getTime(this.getFullYear(), this.getMonth(), this.getDate(), this.getHours(), this.getMinutes(), this.getSeconds()));
dt.setMonth(dt.getMonth() - n * 3);
return dt;
};
@ -103,29 +103,29 @@ Date.prototype.getQuarterStartMonth = function () {
};
// 获得本季度的起始日期
Date.prototype.getQuarterStartDate = function () {
return Date.getDate(this.getFullYear(), this.getQuarterStartMonth(), 1);
return BI.getDate(this.getFullYear(), this.getQuarterStartMonth(), 1);
};
// 得到本季度的结束日期
Date.prototype.getQuarterEndDate = function () {
var quarterEndMonth = this.getQuarterStartMonth() + 2;
return Date.getDate(this.getFullYear(), quarterEndMonth, this.getMonthDays(quarterEndMonth));
return BI.getDate(this.getFullYear(), quarterEndMonth, this.getMonthDays(quarterEndMonth));
};
Date.prototype.getAfterMultiMonth = function (n) {
var dt = Date.getDate(Date.getTime(this.getFullYear(), this.getMonth(), this.getDate(), this.getHours(), this.getMinutes(), this.getSeconds()));
var dt = BI.getDate(BI.getTime(this.getFullYear(), this.getMonth(), this.getDate(), this.getHours(), this.getMinutes(), this.getSeconds()));
dt.setMonth(dt.getMonth() + n | 0);
return dt;
};
Date.prototype.getBeforeMultiMonth = function (n) {
var dt = Date.getDate(Date.getTime(this.getFullYear(), this.getMonth(), this.getDate(), this.getHours(), this.getMinutes(), this.getSeconds()));
var dt = BI.getDate(BI.getTime(this.getFullYear(), this.getMonth(), this.getDate(), this.getHours(), this.getMinutes(), this.getSeconds()));
dt.setMonth(dt.getMonth() - n | 0);
return dt;
};
// 指定日期n个月之前或之后的日期
Date.prototype.getOffsetMonth = function (n) {
var dt = Date.getDate(Date.getTime(this.getFullYear(), this.getMonth(), this.getDate(), this.getHours(), this.getMinutes(), this.getSeconds()));
var dt = BI.getDate(BI.getTime(this.getFullYear(), this.getMonth(), this.getDate(), this.getHours(), this.getMinutes(), this.getSeconds()));
var day = dt.getDate();
var monthDay = Date.getDate(dt.getFullYear(), dt.getMonth() + parseInt(n), 1).getMonthDays();
var monthDay = BI.getDate(dt.getFullYear(), dt.getMonth() + parseInt(n), 1).getMonthDays();
if (day > monthDay) {
day = monthDay;
}
@ -149,7 +149,7 @@ Date.prototype.getWeekEndDate = function () {
Date.prototype.equalsTo = function (date) {
return ((this.getFullYear() == date.getFullYear()) &&
(this.getMonth() == date.getMonth()) &&
(this.getDate() == date.getDate()) &&
(this.getDate() == BI.getDate()) &&
(this.getHours() == date.getHours()) &&
(this.getMinutes() == date.getMinutes()) &&
(this.getSeconds() == date.getSeconds()));
@ -157,7 +157,7 @@ Date.prototype.equalsTo = function (date) {
/** Set only the year, month, date parts (keep existing time) */
Date.prototype.setDateOnly = function (date) {
var tmp = Date.getDate(date);
var tmp = BI.getDate(date);
this.setDate(1);
this.setFullYear(tmp.getFullYear());
this.setMonth(tmp.getMonth());
@ -236,301 +236,3 @@ Date.prototype.print = function (str) {
return str;
};
/**
* 是否是闰年
* @param year
* @returns {boolean}
*/
Date.isLeap = function (year) {
return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
};
/**
* 检测是否在有效期
*
* @param YY
* @param MM
* @param DD
* @param minDate '1900-01-01'
* @param maxDate '2099-12-31'
* @returns {Array} 若无效返回无效状态
*/
Date.checkVoid = function (YY, MM, DD, minDate, maxDate) {
var back = [];
YY = YY | 0;
MM = MM | 0;
DD = DD | 0;
minDate = BI.isString(minDate) ? minDate.match(/\d+/g) : minDate;
maxDate = BI.isString(maxDate) ? maxDate.match(/\d+/g) : maxDate;
if (YY < minDate[0]) {
back = ["y"];
} else if (YY > maxDate[0]) {
back = ["y", 1];
} else if (YY >= minDate[0] && YY <= maxDate[0]) {
if (YY == minDate[0]) {
if (MM < minDate[1]) {
back = ["m"];
} else if (MM == minDate[1]) {
if (DD < minDate[2]) {
back = ["d"];
}
}
}
if (YY == maxDate[0]) {
if (MM > maxDate[1]) {
back = ["m", 1];
} else if (MM == maxDate[1]) {
if (DD > maxDate[2]) {
back = ["d", 1];
}
}
}
}
return back;
};
Date.checkLegal = function (str) {
var ar = str.match(/\d+/g);
var YY = ar[0] | 0, MM = ar[1] | 0, DD = ar[2] | 0;
if (ar.length <= 1) {
return true;
}
if (ar.length <= 2) {
return MM >= 1 && MM <= 12;
}
var MD = Date._MD.slice(0);
MD[1] = Date.isLeap(YY) ? 29 : 28;
return MM >= 1 && MM <= 12 && DD <= MD[MM - 1];
};
Date.parseDateTime = function (str, fmt) {
var today = Date.getDate();
var y = 0;
var m = 0;
var d = 1;
// wei : 对于fmt为‘YYYYMM’或者‘YYYYMMdd’的格式,str的值为类似'201111'的形式,因为年月之间没有分隔符,所以正则表达式分割无效,导致bug7376。
var a = str.split(/\W+/);
if (fmt.toLowerCase() == "%y%x" || fmt.toLowerCase() == "%y%x%d") {
var yearlength = 4;
var otherlength = 2;
a[0] = str.substring(0, yearlength);
a[1] = str.substring(yearlength, yearlength + otherlength);
a[2] = str.substring(yearlength + otherlength, yearlength + otherlength * 2);
}
var b = fmt.match(/%./g);
var i = 0, j = 0;
var hr = 0;
var min = 0;
var sec = 0;
for (i = 0; i < a.length; ++i) {
switch (b[i]) {
case "%d":
case "%e":
d = parseInt(a[i], 10);
break;
case "%X":
m = parseInt(a[i], 10) - 1;
break;
case "%x":
m = parseInt(a[i], 10) - 1;
break;
case "%Y":
case "%y":
y = parseInt(a[i], 10);
(y < 100) && (y += (y > 29) ? 1900 : 2000);
break;
case "%b":
case "%B":
for (j = 0; j < 12; ++j) {
if (Date._MN[j].substr(0, a[i].length).toLowerCase() == a[i].toLowerCase()) {
m = j;
break;
}
}
break;
case "%H":
case "%I":
case "%k":
case "%l":
hr = parseInt(a[i], 10);
break;
case "%P":
case "%p":
if (/pm/i.test(a[i]) && hr < 12) {
hr += 12;
} else if (/am/i.test(a[i]) && hr >= 12) {
hr -= 12;
}
break;
case "%M":
min = parseInt(a[i], 10);
case "%S":
sec = parseInt(a[i], 10);
break;
}
}
// if (!a[i]) {
// continue;
// }
if (isNaN(y)) {
y = today.getFullYear();
}
if (isNaN(m)) {
m = today.getMonth();
}
if (isNaN(d)) {
d = today.getDate();
}
if (isNaN(hr)) {
hr = today.getHours();
}
if (isNaN(min)) {
min = today.getMinutes();
}
if (isNaN(sec)) {
sec = today.getSeconds();
}
if (y != 0) {
return Date.getDate(y, m, d, hr, min, sec);
}
y = 0;
m = -1;
d = 0;
for (i = 0; i < a.length; ++i) {
if (a[i].search(/[a-zA-Z]+/) != -1) {
var t = -1;
for (j = 0; j < 12; ++j) {
if (Date._MN[j].substr(0, a[i].length).toLowerCase() == a[i].toLowerCase()) {
t = j;
break;
}
}
if (t != -1) {
if (m != -1) {
d = m + 1;
}
m = t;
}
} else if (parseInt(a[i], 10) <= 12 && m == -1) {
m = a[i] - 1;
} else if (parseInt(a[i], 10) > 31 && y == 0) {
y = parseInt(a[i], 10);
(y < 100) && (y += (y > 29) ? 1900 : 2000);
} else if (d == 0) {
d = a[i];
}
}
if (y == 0) {
y = today.getFullYear();
}
if (m != -1 && d != 0) {
return Date.getDate(y, m, d, hr, min, sec);
}
return today;
};
Date.getDate = function () {
var length = arguments.length;
var args = arguments;
var dt;
switch (length) {
// new Date()
case 0:
dt = new Date();
break;
// new Date(long)
case 1:
dt = new Date(args[0]);
break;
// new Date(year, month)
case 2:
dt = new Date(args[0], args[1]);
break;
// new Date(year, month, day)
case 3:
dt = new Date(args[0], args[1], args[2]);
break;
// new Date(year, month, day, hour)
case 4:
dt = new Date(args[0], args[1], args[2], args[3]);
break;
// new Date(year, month, day, hour, minute)
case 5:
dt = new Date(args[0], args[1], args[2], args[3], args[4]);
break;
// new Date(year, month, day, hour, minute, second)
case 6:
dt = new Date(args[0], args[1], args[2], args[3], args[4], args[5]);
break;
// new Date(year, month, day, hour, minute, second, millisecond)
case 7:
dt = new Date(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
break;
default:
dt = new Date();
break;
}
if(BI.isNotNull(Date.timeZone) && (arguments.length === 0 || (arguments.length === 1 && BI.isNumber(arguments[0])))) {
var localTime = dt.getTime();
var localOffset = dt.getTimezoneOffset() * 60000; // 获得当地时间偏移的毫秒数
var utc = localTime + localOffset; // utc即GMT时间标准时区
return new Date(utc + Date.timeZone);// + Pool.timeZone.offset);
}
return dt;
};
Date.getTime = function () {
var length = arguments.length;
var args = arguments;
var dt;
switch (length) {
// new Date()
case 0:
dt = new Date();
break;
// new Date(long)
case 1:
dt = new Date(args[0]);
break;
// new Date(year, month)
case 2:
dt = new Date(args[0], args[1]);
break;
// new Date(year, month, day)
case 3:
dt = new Date(args[0], args[1], args[2]);
break;
// new Date(year, month, day, hour)
case 4:
dt = new Date(args[0], args[1], args[2], args[3]);
break;
// new Date(year, month, day, hour, minute)
case 5:
dt = new Date(args[0], args[1], args[2], args[3], args[4]);
break;
// new Date(year, month, day, hour, minute, second)
case 6:
dt = new Date(args[0], args[1], args[2], args[3], args[4], args[5]);
break;
// new Date(year, month, day, hour, minute, second, millisecond)
case 7:
dt = new Date(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
break;
default:
dt = new Date();
break;
}
if(BI.isNotNull(Date.timeZone)) {
return dt.getTime() - Date.timeZone - dt.getTimezoneOffset() * 60000;
}
return dt.getTime();
};

57
src/core/proto/string.js

@ -113,61 +113,4 @@ _.extend(String.prototype, {
}
return location;
}
});
/**
* 对字符串对象的扩展
* @class String
*/
_.extend(String, {
/**
* 对字符串中的'\做编码处理
* @static
* @param {String} string 要做编码处理的字符串
* @return {String} 编码后的字符串
*/
escape: function (string) {
return string.replace(/('|\\)/g, "\\$1");
},
/**
* 让字符串通过指定字符做补齐的函数
*
* var s = String.leftPad('123', 5, '0');//s的值为:'00123'
*
* @static
* @param {String} val 原始值
* @param {Number} size 总共需要的位数
* @param {String} ch 用于补齐的字符
* @return {String} 补齐后的字符串
*/
leftPad: function (val, size, ch) {
var result = String(val);
if (!ch) {
ch = " ";
}
while (result.length < size) {
result = ch + result;
}
return result.toString();
},
/**
* 对字符串做替换的函数
*
* var cls = 'my-class', text = 'Some text';
* var res = String.format('<div class="{0}>{1}</div>"', cls, text);
* //res的值为:'<div class="my-class">Some text</div>';
*
* @static
* @param {String} format 要做替换的字符串替换字符串1替换字符串2...
* @return {String} 做了替换后的字符串
*/
format: function (format) {
var args = Array.prototype.slice.call(arguments, 1);
return format.replace(/\{(\d+)\}/g, function (m, i) {
return args[i];
});
}
});

4
src/core/utils/cache.js

@ -51,7 +51,7 @@ BI.Cache = {
// 判断是否设置过期时间
if (expiresHours && expiresHours > 0) {
var date = new Date();
date.setTime(date.getTime() + expiresHours * 3600 * 1000);
date.setTime(BI.getTime() + expiresHours * 3600 * 1000);
cookieString = cookieString + "; expires=" + date.toGMTString();
}
if (path) {
@ -66,7 +66,7 @@ BI.Cache = {
},
deleteCookie: function (name, path) {
var date = new Date();
date.setTime(date.getTime() - 10000);
date.setTime(BI.getTime() - 10000);
var cookieString = name + "=v; expires=" + date.toGMTString();
if (path) {
cookieString = cookieString + "; path=" + path;

113
src/css/base/combo/combo.bubble.css

@ -1,35 +1,108 @@
.bi-bubble-combo .button-combo-triangle-wrapper {
position: fixed !important;
z-index: 10000000;
}
.bi-bubble-combo .bubble-combo-triangle-left {
z-index: 1;
width: 0;
height: 0;
border-top: 6px solid transparent;
border-left: 6px solid #3f8ce8;
border-bottom: 6px solid transparent;
position: absolute;
width: 16px;
height: 10px;
border-bottom: 1px solid #f5f5f5;
}
.bi-bubble-combo .bubble-combo-triangle-left:before {
position: absolute;
top: 0px;
right: 0px;
bottom: 0px;
border-bottom: 10px solid #ccc;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
content: "";
}
.bi-bubble-combo .bubble-combo-triangle-left:after {
position: absolute;
right: 1px;
top: 1px;
bottom: 0px;
border-bottom: 9px solid #ffffff;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
content: "";
}
.bi-bubble-combo .bubble-combo-triangle-right {
z-index: 1;
width: 0;
height: 0;
border-top: 6px solid transparent;
border-right: 6px solid #3f8ce8;
border-bottom: 6px solid transparent;
position: absolute;
width: 16px;
height: 6px;
border-bottom: 1px solid #f5f5f5;
}
.bi-bubble-combo .bubble-combo-triangle-right:before {
position: absolute;
top: 0px;
right: 0px;
bottom: 0px;
border-bottom: 10px solid #ccc;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
content: "";
}
.bi-bubble-combo .bubble-combo-triangle-right:after {
position: absolute;
right: 1px;
top: 1px;
bottom: 0px;
border-bottom: 9px solid #ffffff;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
content: "";
}
.bi-bubble-combo .bubble-combo-triangle-top {
z-index: 1;
width: 0;
height: 0;
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-top: 6px solid #3f8ce8;
position: absolute;
width: 16px;
height: 10px;
border-top: 1px solid #ffffff;
}
.bi-bubble-combo .bubble-combo-triangle-top:after {
position: absolute;
right: 1px;
top: 0px;
border-top: 6px solid #ffffff;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
content: "";
}
.bi-bubble-combo .bubble-combo-triangle-top:before {
position: absolute;
border-top: 7px solid #cccccc;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
content: "";
}
.bi-bubble-combo .bubble-combo-triangle-bottom {
z-index: 1;
width: 0;
height: 0;
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-bottom: 6px solid #3f8ce8;
position: absolute;
width: 16px;
height: 5px;
border-bottom: 1px solid #ffffff;
}
.bi-bubble-combo .bubble-combo-triangle-bottom:before {
position: absolute;
top: 0px;
right: 0px;
bottom: 0px;
border-bottom: 7px solid #ccc;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
content: "";
}
.bi-bubble-combo .bubble-combo-triangle-bottom:after {
position: absolute;
right: 1px;
top: 1px;
bottom: 0px;
border-bottom: 6px solid #ffffff;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
content: "";
}

113
src/css/base/combo/combo.css

@ -1,37 +1,110 @@
.bi-bubble-combo .button-combo-triangle-wrapper {
position: fixed !important;
z-index: 10000000;
}
.bi-bubble-combo .bubble-combo-triangle-left {
z-index: 1;
width: 0;
height: 0;
border-top: 6px solid transparent;
border-left: 6px solid #3f8ce8;
border-bottom: 6px solid transparent;
position: absolute;
width: 16px;
height: 10px;
border-bottom: 1px solid #f5f5f5;
}
.bi-bubble-combo .bubble-combo-triangle-left:before {
position: absolute;
top: 0px;
right: 0px;
bottom: 0px;
border-bottom: 10px solid #ccc;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
content: "";
}
.bi-bubble-combo .bubble-combo-triangle-left:after {
position: absolute;
right: 1px;
top: 1px;
bottom: 0px;
border-bottom: 9px solid #ffffff;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
content: "";
}
.bi-bubble-combo .bubble-combo-triangle-right {
z-index: 1;
width: 0;
height: 0;
border-top: 6px solid transparent;
border-right: 6px solid #3f8ce8;
border-bottom: 6px solid transparent;
position: absolute;
width: 16px;
height: 6px;
border-bottom: 1px solid #f5f5f5;
}
.bi-bubble-combo .bubble-combo-triangle-right:before {
position: absolute;
top: 0px;
right: 0px;
bottom: 0px;
border-bottom: 10px solid #ccc;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
content: "";
}
.bi-bubble-combo .bubble-combo-triangle-right:after {
position: absolute;
right: 1px;
top: 1px;
bottom: 0px;
border-bottom: 9px solid #ffffff;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
content: "";
}
.bi-bubble-combo .bubble-combo-triangle-top {
z-index: 1;
width: 0;
height: 0;
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-top: 6px solid #3f8ce8;
position: absolute;
width: 16px;
height: 10px;
border-top: 1px solid #ffffff;
}
.bi-bubble-combo .bubble-combo-triangle-top:after {
position: absolute;
right: 1px;
top: 0px;
border-top: 6px solid #ffffff;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
content: "";
}
.bi-bubble-combo .bubble-combo-triangle-top:before {
position: absolute;
border-top: 7px solid #cccccc;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
content: "";
}
.bi-bubble-combo .bubble-combo-triangle-bottom {
z-index: 1;
width: 0;
height: 0;
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-bottom: 6px solid #3f8ce8;
position: absolute;
width: 16px;
height: 5px;
border-bottom: 1px solid #ffffff;
}
.bi-bubble-combo .bubble-combo-triangle-bottom:before {
position: absolute;
top: 0px;
right: 0px;
bottom: 0px;
border-bottom: 7px solid #ccc;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
content: "";
}
.bi-bubble-combo .bubble-combo-triangle-bottom:after {
position: absolute;
right: 1px;
top: 1px;
bottom: 0px;
border-bottom: 6px solid #ffffff;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
content: "";
}
.bi-combo.bi-combo-popup {

13
src/css/base/foundation/bi.css

@ -17,3 +17,16 @@
.bi-message-close {
font-size: 25px;
}
.bi-message-animate {
-webkit-transition: opacity 0.3s, transform 0.4s, -webkit-transform 0.4s;
-moz-transition: opacity 0.3s, transform 0.4s, -webkit-transform 0.4s;
-o-transition: opacity 0.3s, transform 0.4s, -webkit-transform 0.4s;
transition: opacity 0.3s, transform 0.4s, -webkit-transform 0.4s;
}
.bi-message-enter {
opacity: 1;
}
.bi-message-leave {
opacity: 0;
transform: translateY(-100%);
}

5
src/css/base/single/tip/tip.css

@ -23,11 +23,9 @@
color: #faaa39;
}
.bi-tip {
position: fixed !important;
}
.bi-toast {
position: fixed !important;
font-size: 14px;
color: #ffffff;
max-width: 400px;
@ -53,6 +51,7 @@
}
.bi-tooltip {
position: fixed !important;
max-width: 250px;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;

13
src/less/base/combo/combo.bubble.less

@ -3,21 +3,26 @@
.bi-bubble-combo {
& .button-combo-triangle-wrapper {
position: fixed !important;
.z-index-layer(@zIndex-popup);
}
& .bubble-combo-triangle-left {
z-index: 1;
.solid-triangle-right(@color-bi-background-highlight);
.triangle-right();
//.solid-triangle-right(@color-bi-background-highlight);
}
& .bubble-combo-triangle-right {
z-index: 1;
.solid-triangle-left(@color-bi-background-highlight);
.triangle-left();
//.solid-triangle-left(@color-bi-background-highlight);
}
& .bubble-combo-triangle-top {
z-index: 1;
.solid-triangle-down(@color-bi-background-highlight);
.triangle-bottom();
//.solid-triangle-down(@color-bi-background-highlight);
}
& .bubble-combo-triangle-bottom {
z-index: 1;
.solid-triangle-up(@color-bi-background-highlight);
.triangle-top();
//.solid-triangle-up(@color-bi-background-highlight);
}
}

14
src/less/base/foundation/bi.message.less

@ -16,4 +16,18 @@
.bi-message-close {
font-size: 25px;
}
.bi-message-animate {
@val: opacity .3s, transform .4s, -webkit-transform .4s;
.transition(@val);
}
.bi-message-enter {
opacity: 1;
}
.bi-message-leave {
opacity: 0;
transform: translateY(-100%);
}

2
src/less/base/single/tip/tip.less

@ -2,5 +2,5 @@
.bi-tip{
position: fixed !important;
}

1
src/less/base/single/tip/tip.toast.less

@ -1,6 +1,7 @@
@import "../../../index";
.bi-toast{
position: fixed !important;
font-size: @font-size-14;
color: @color-bi-text;
max-width: 400px;

1
src/less/base/single/tip/tip.tooltip.less

@ -1,6 +1,7 @@
@import "../../../index";
.bi-tooltip{
position: fixed !important;
max-width: 250px;
.border-radius(2px);
font-size: 12px;

72
src/less/visual.less

@ -176,15 +176,15 @@
.triangle-top() {
position: absolute;
width: 16px;
height: 10px;
border-bottom: 1px solid #f5f5f5;
height: 5px;
border-bottom: 1px solid #ffffff;
&:before {
position: absolute;
top: 0px;
right: 0px;
bottom: 0px;
border-bottom: 10px solid #ccc;
border-bottom: 7px solid #ccc;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
content: "";
@ -194,7 +194,7 @@
right: 1px;
top: 1px;
bottom: 0px;
border-bottom: 9px solid #f5f5f5;
border-bottom: 6px solid #ffffff;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
content: "";
@ -205,23 +205,79 @@
position: absolute;
width: 16px;
height: 10px;
border-top: 1px solid #f5f5f5;
border-top: 1px solid #ffffff;
&:after {
position: absolute;
right: 1px;
top: -1px;
border-top: 9px solid #f5f5f5;
top: 0px;
border-top: 6px solid #ffffff;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
content: "";
}
&:before {
position: absolute;
border-top: 10px solid #cccccc;
border-top: 7px solid #cccccc;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
content: "";
}
}
.triangle-left() {
position: absolute;
width: 16px;
height: 6px;
border-bottom: 1px solid #f5f5f5;
&:before {
position: absolute;
top: 0px;
right: 0px;
bottom: 0px;
border-bottom: 10px solid #ccc;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
content: "";
}
&:after {
position: absolute;
right: 1px;
top: 1px;
bottom: 0px;
border-bottom: 9px solid #ffffff;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
content: "";
}
}
.triangle-right() {
position: absolute;
width: 16px;
height: 10px;
border-bottom: 1px solid #f5f5f5;
&:before {
position: absolute;
top: 0px;
right: 0px;
bottom: 0px;
border-bottom: 10px solid #ccc;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
content: "";
}
&:after {
position: absolute;
right: 1px;
top: 1px;
bottom: 0px;
border-bottom: 9px solid #ffffff;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
content: "";
}
}

8
src/widget/date/calendar/picker.date.js

@ -17,8 +17,8 @@ BI.DatePicker = BI.inherit(BI.Widget, {
_init: function () {
BI.DatePicker.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this._year = Date.getDate().getFullYear();
this._month = Date.getDate().getMonth();
this._year = BI.getDate().getFullYear();
this._month = BI.getDate().getMonth();
this.left = BI.createWidget({
type: "bi.icon_button",
cls: "pre-page-h-font",
@ -115,14 +115,14 @@ BI.DatePicker = BI.inherit(BI.Widget, {
_checkLeftValid: function () {
var o = this.options;
var valid = !(this._month === 0 && this._year === Date.parseDateTime(o.min, "%Y-%X-%d").getFullYear());
var valid = !(this._month === 0 && this._year === BI.parseDateTime(o.min, "%Y-%X-%d").getFullYear());
this.left.setEnable(valid);
return valid;
},
_checkRightValid: function () {
var o = this.options;
var valid = !(this._month === 11 && this._year === Date.parseDateTime(o.max, "%Y-%X-%d").getFullYear());
var valid = !(this._month === 11 && this._year === BI.parseDateTime(o.max, "%Y-%X-%d").getFullYear());
this.right.setEnable(valid);
return valid;
},

2
src/widget/date/calendar/popup.calendar.date.js

@ -34,7 +34,7 @@ BI.DateCalendarPopup = BI.inherit(BI.Widget, {
BI.DateCalendarPopup.superclass._init.apply(this, arguments);
var self = this,
o = this.options;
this.today = Date.getDate();
this.today = BI.getDate();
this._year = this.today.getFullYear();
this._month = this.today.getMonth();
this._day = this.today.getDate();

42
src/widget/date/trigger.date.js

@ -23,7 +23,7 @@ BI.DateTrigger = BI.inherit(BI.Trigger, {
validationChecker: function (v) {
var date = v.match(/\d+/g);
self._autoAppend(v, date);
return self._dateCheck(v) && Date.checkLegal(v) && self._checkVoid({
return self._dateCheck(v) && BI.checkDateLegal(v) && self._checkVoid({
year: date[0],
month: date[1],
day: date[2]
@ -101,21 +101,21 @@ BI.DateTrigger = BI.inherit(BI.Trigger, {
this.setValue(o.value);
},
_dateCheck: function (date) {
return Date.parseDateTime(date, "%Y-%x-%d").print("%Y-%x-%d") == date || Date.parseDateTime(date, "%Y-%X-%d").print("%Y-%X-%d") == date || Date.parseDateTime(date, "%Y-%x-%e").print("%Y-%x-%e") == date || Date.parseDateTime(date, "%Y-%X-%e").print("%Y-%X-%e") == date;
return BI.parseDateTime(date, "%Y-%x-%d").print("%Y-%x-%d") == date || BI.parseDateTime(date, "%Y-%X-%d").print("%Y-%X-%d") == date || BI.parseDateTime(date, "%Y-%x-%e").print("%Y-%x-%e") == date || BI.parseDateTime(date, "%Y-%X-%e").print("%Y-%X-%e") == date;
},
_checkVoid: function (obj) {
return !Date.checkVoid(obj.year, obj.month, obj.day, this.options.min, this.options.max)[0];
return !BI.checkDateVoid(obj.year, obj.month, obj.day, this.options.min, this.options.max)[0];
},
_autoAppend: function (v, dateObj) {
var self = this;
var date = Date.parseDateTime(v, "%Y-%X-%d").print("%Y-%X-%d");
var date = BI.parseDateTime(v, "%Y-%X-%d").print("%Y-%X-%d");
var yearCheck = function (v) {
return Date.parseDateTime(v, "%Y").print("%Y") == v && date >= self.options.min && date <= self.options.max;
return BI.parseDateTime(v, "%Y").print("%Y") == v && date >= self.options.min && date <= self.options.max;
};
var monthCheck = function (v) {
return Date.parseDateTime(v, "%Y-%X").print("%Y-%X") == v && date >= self.options.min && date <= self.options.max;
return BI.parseDateTime(v, "%Y-%X").print("%Y-%X") == v && date >= self.options.min && date <= self.options.max;
};
if (BI.isNotNull(dateObj) && Date.checkLegal(v)) {
if (BI.isNotNull(dateObj) && BI.checkDateLegal(v)) {
switch (v.length) {
case this._const.yearLength:
if (yearCheck(v)) {
@ -133,7 +133,7 @@ BI.DateTrigger = BI.inherit(BI.Trigger, {
setValue: function (v) {
var type, value, self = this;
var date = Date.getDate();
var date = BI.getDate();
this.store_value = v;
if (BI.isNotNull(v)) {
type = v.type || BI.DateTrigger.MULTI_DATE_CALENDAR; value = v.value;
@ -150,62 +150,62 @@ BI.DateTrigger = BI.inherit(BI.Trigger, {
switch (type) {
case BI.DateTrigger.MULTI_DATE_YEAR_PREV:
var text = value + BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_YEAR_PREV];
date = Date.getDate((date.getFullYear() - 1 * value), date.getMonth(), date.getDate());
date = BI.getDate((date.getFullYear() - 1 * value), date.getMonth(), BI.getDate());
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_YEAR_AFTER:
var text = value + BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_YEAR_AFTER];
date = Date.getDate((date.getFullYear() + 1 * value), date.getMonth(), date.getDate());
date = BI.getDate((date.getFullYear() + 1 * value), date.getMonth(), BI.getDate());
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_YEAR_BEGIN:
var text = BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_YEAR_BEGIN];
date = Date.getDate(date.getFullYear(), 0, 1);
date = BI.getDate(date.getFullYear(), 0, 1);
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_YEAR_END:
var text = BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_YEAR_END];
date = Date.getDate(date.getFullYear(), 11, 31);
date = BI.getDate(date.getFullYear(), 11, 31);
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_QUARTER_PREV:
var text = value + BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_QUARTER_PREV];
date = Date.getDate().getBeforeMulQuarter(value);
date = BI.getDate().getBeforeMulQuarter(value);
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_QUARTER_AFTER:
var text = value + BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_QUARTER_AFTER];
date = Date.getDate().getAfterMulQuarter(value);
date = BI.getDate().getAfterMulQuarter(value);
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_QUARTER_BEGIN:
var text = BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_QUARTER_BEGIN];
date = Date.getDate().getQuarterStartDate();
date = BI.getDate().getQuarterStartDate();
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_QUARTER_END:
var text = BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_QUARTER_END];
date = Date.getDate().getQuarterEndDate();
date = BI.getDate().getQuarterEndDate();
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_MONTH_PREV:
var text = value + BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_MONTH_PREV];
date = Date.getDate().getBeforeMultiMonth(value);
date = BI.getDate().getBeforeMultiMonth(value);
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_MONTH_AFTER:
var text = value + BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_MONTH_AFTER];
date = Date.getDate().getAfterMultiMonth(value);
date = BI.getDate().getAfterMultiMonth(value);
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_MONTH_BEGIN:
var text = BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_MONTH_BEGIN];
date = Date.getDate(date.getFullYear(), date.getMonth(), 1);
date = BI.getDate(date.getFullYear(), date.getMonth(), 1);
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_MONTH_END:
var text = BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_MONTH_END];
date = Date.getDate(date.getFullYear(), date.getMonth(), (date.getLastDateOfMonth()).getDate());
date = BI.getDate(date.getFullYear(), date.getMonth(), (date.getLastDateOfMonth()).getDate());
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_WEEK_PREV:
@ -230,7 +230,7 @@ BI.DateTrigger = BI.inherit(BI.Trigger, {
break;
case BI.DateTrigger.MULTI_DATE_DAY_TODAY:
var text = BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_DAY_TODAY];
date = Date.getDate();
date = BI.getDate();
_setInnerValue(date, text);
break;
default:

4
src/widget/datepane/datepane.js

@ -15,7 +15,7 @@ BI.DatePaneWidget = BI.inherit(BI.Widget, {
BI.DatePaneWidget.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.today = Date.getDate();
this.today = BI.getDate();
this._year = this.today.getFullYear();
this._month = this.today.getMonth();
@ -80,7 +80,7 @@ BI.DatePaneWidget = BI.inherit(BI.Widget, {
},
_getNewCurrentDate: function () {
var today = Date.getDate();
var today = BI.getDate();
return {
year: today.getFullYear(),
month: today.getMonth()

4
src/widget/datetime/datetime.combo.js

@ -20,11 +20,11 @@ BI.DateTimeCombo = BI.inherit(BI.Single, {
_init: function () {
BI.DateTimeCombo.superclass._init.apply(this, arguments);
var self = this, opts = this.options;
var date = Date.getDate();
var date = BI.getDate();
this.storeValue = BI.isNotNull(opts.value) ? opts.value : {
year: date.getFullYear(),
month: date.getMonth(),
day: date.getDate(),
day: BI.getDate(),
hour: date.getHours(),
minute: date.getMinutes(),
second: date.getSeconds()

4
src/widget/datetime/datetime.popup.js

@ -130,11 +130,11 @@ BI.DateTimePopup = BI.inherit(BI.Widget, {
setValue: function (v) {
var value = v, date;
if (BI.isNull(value)) {
date = Date.getDate();
date = BI.getDate();
this.dateCombo.setValue({
year: date.getFullYear(),
month: date.getMonth(),
day: date.getDate()
day: BI.getDate()
});
this.hour.setValue(date.getHours());
this.minute.setValue(date.getMinutes());

4
src/widget/datetime/datetime.trigger.js

@ -47,10 +47,10 @@ BI.DateTimeTrigger = BI.inherit(BI.Trigger, {
var self = this;
var value = v, dateStr;
if(BI.isNull(value)) {
value = Date.getDate();
value = BI.getDate();
dateStr = value.print("%Y-%X-%d %H:%M:%S");
} else {
var date = Date.getDate(value.year, value.month, value.day, value.hour, value.minute, value.second);
var date = BI.getDate(value.year, value.month, value.day, value.hour, value.minute, value.second);
dateStr = date.print("%Y-%X-%d %H:%M:%S");
}

34
src/widget/multidate/abstract.multidate.datepane.js

@ -112,39 +112,39 @@ BI.MultiDateCard = BI.inherit(BI.Widget, {
var type = valueObject.type, value = valueObject.value;
switch (type) {
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_PREV:
return Date.getDate().getOffsetDate(-1 * value);
return BI.getDate().getOffsetDate(-1 * value);
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_AFTER:
return Date.getDate().getOffsetDate(value);
return BI.getDate().getOffsetDate(value);
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_DAY_TODAY:
return Date.getDate();
return BI.getDate();
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_PREV:
return Date.getDate().getBeforeMultiMonth(value);
return BI.getDate().getBeforeMultiMonth(value);
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_AFTER:
return Date.getDate().getAfterMultiMonth(value);
return BI.getDate().getAfterMultiMonth(value);
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_BEGIN:
return Date.getDate(Date.getDate().getFullYear(), Date.getDate().getMonth(), 1);
return BI.getDate(BI.getDate().getFullYear(), BI.getDate().getMonth(), 1);
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_MONTH_END:
return Date.getDate(Date.getDate().getFullYear(), Date.getDate().getMonth(), (Date.getDate().getLastDateOfMonth()).getDate());
return BI.getDate(BI.getDate().getFullYear(), BI.getDate().getMonth(), (BI.getDate().getLastDateOfMonth()).getDate());
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_PREV:
return Date.getDate().getBeforeMulQuarter(value);
return BI.getDate().getBeforeMulQuarter(value);
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_AFTER:
return Date.getDate().getAfterMulQuarter(value);
return BI.getDate().getAfterMulQuarter(value);
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_BEGIN:
return Date.getDate().getQuarterStartDate();
return BI.getDate().getQuarterStartDate();
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_QUARTER_END:
return Date.getDate().getQuarterEndDate();
return BI.getDate().getQuarterEndDate();
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_WEEK_PREV:
return Date.getDate().getOffsetDate(-7 * value);
return BI.getDate().getOffsetDate(-7 * value);
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_WEEK_AFTER:
return Date.getDate().getOffsetDate(7 * value);
return BI.getDate().getOffsetDate(7 * value);
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_PREV:
return Date.getDate((Date.getDate().getFullYear() - 1 * value), Date.getDate().getMonth(), Date.getDate().getDate());
return BI.getDate((BI.getDate().getFullYear() - 1 * value), BI.getDate().getMonth(), BI.getDate().getDate());
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_AFTER:
return Date.getDate((Date.getDate().getFullYear() + 1 * value), Date.getDate().getMonth(), Date.getDate().getDate());
return BI.getDate((BI.getDate().getFullYear() + 1 * value), BI.getDate().getMonth(), BI.getDate().getDate());
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_BEGIN:
return Date.getDate(Date.getDate().getFullYear(), 0, 1);
return BI.getDate(BI.getDate().getFullYear(), 0, 1);
case BI.MultiDateCombo.DATE_TYPE.MULTI_DATE_YEAR_END:
return Date.getDate(Date.getDate().getFullYear(), 11, 31);
return BI.getDate(BI.getDate().getFullYear(), 11, 31);
}
}
});

6
src/widget/multidate/multidate.combo.js

@ -22,7 +22,7 @@ BI.MultiDateCombo = BI.inherit(BI.Single, {
BI.MultiDateCombo.superclass._init.apply(this, arguments);
var self = this, opts = this.options;
this.storeTriggerValue = "";
var date = Date.getDate();
var date = BI.getDate();
this.storeValue = opts.value;
this.trigger = BI.createWidget({
type: "bi.date_trigger",
@ -91,11 +91,11 @@ BI.MultiDateCombo = BI.inherit(BI.Single, {
self.fireEvent(BI.MultiDateCombo.EVENT_CONFIRM);
});
this.popup.on(BI.MultiDatePopup.BUTTON_lABEL_EVENT_CHANGE, function () {
var date = Date.getDate();
var date = BI.getDate();
self.setValue({
year: date.getFullYear(),
month: date.getMonth(),
day: date.getDate()
day: BI.getDate()
});
self.combo.hideView();
self.fireEvent(BI.MultiDateCombo.EVENT_CONFIRM);

6
src/widget/multidate/multidate.popup.js

@ -161,7 +161,7 @@ BI.MultiDatePopup = BI.inherit(BI.Widget, {
self.ymd.setValue({
year: date.getFullYear(),
month: date.getMonth(),
day: date.getDate()
day: BI.getDate()
});
self._setInnerValue(self.ymd);
break;
@ -276,12 +276,12 @@ BI.MultiDatePopup = BI.inherit(BI.Widget, {
break;
default:
if (this._checkValueValid(value)) {
var date = Date.getDate();
var date = BI.getDate();
this.dateTab.setSelect(BI.MultiDateCombo.MULTI_DATE_YMD_CARD);
this.ymd.setValue({
year: date.getFullYear(),
month: date.getMonth(),
day: date.getDate()
day: BI.getDate()
});
this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today"));
} else {

12
src/widget/timeinterval/timeinterval.js

@ -144,26 +144,26 @@ BI.TimeInterval = BI.inherit(BI.Single, {
return combo;
},
_dateCheck: function (date) {
return Date.parseDateTime(date, "%Y-%x-%d").print("%Y-%x-%d") == date || Date.parseDateTime(date, "%Y-%X-%d").print("%Y-%X-%d") == date || Date.parseDateTime(date, "%Y-%x-%e").print("%Y-%x-%e") == date || Date.parseDateTime(date, "%Y-%X-%e").print("%Y-%X-%e") == date;
return BI.parseDateTime(date, "%Y-%x-%d").print("%Y-%x-%d") == date || BI.parseDateTime(date, "%Y-%X-%d").print("%Y-%X-%d") == date || BI.parseDateTime(date, "%Y-%x-%e").print("%Y-%x-%e") == date || BI.parseDateTime(date, "%Y-%X-%e").print("%Y-%X-%e") == date;
},
_checkVoid: function (obj) {
return !Date.checkVoid(obj.year, obj.month, obj.day, this.constants.DATE_MIN_VALUE, this.constants.DATE_MAX_VALUE)[0];
return !BI.checkDateVoid(obj.year, obj.month, obj.day, this.constants.DATE_MIN_VALUE, this.constants.DATE_MAX_VALUE)[0];
},
_check: function (smallDate, bigDate) {
var smallObj = smallDate.match(/\d+/g), bigObj = bigDate.match(/\d+/g);
return this._dateCheck(smallDate) && Date.checkLegal(smallDate) && this._checkVoid({
return this._dateCheck(smallDate) && BI.checkDateLegal(smallDate) && this._checkVoid({
year: smallObj[0],
month: smallObj[1],
day: smallObj[2]
}) && this._dateCheck(bigDate) && Date.checkLegal(bigDate) && this._checkVoid({
}) && this._dateCheck(bigDate) && BI.checkDateLegal(bigDate) && this._checkVoid({
year: bigObj[0],
month: bigObj[1],
day: bigObj[2]
});
},
_compare: function (smallDate, bigDate) {
smallDate = Date.parseDateTime(smallDate, "%Y-%X-%d").print("%Y-%X-%d");
bigDate = Date.parseDateTime(bigDate, "%Y-%X-%d").print("%Y-%X-%d");
smallDate = BI.parseDateTime(smallDate, "%Y-%X-%d").print("%Y-%X-%d");
bigDate = BI.parseDateTime(bigDate, "%Y-%X-%d").print("%Y-%X-%d");
return BI.isNotNull(smallDate) && BI.isNotNull(bigDate) && smallDate > bigDate;
},
_setTitle: function (v) {

6
src/widget/year/popup.year.js

@ -37,7 +37,7 @@ BI.YearPopup = BI.inherit(BI.Widget, {
BI.YearPopup.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.selectedYear = this._year = Date.getDate().getFullYear();
this.selectedYear = this._year = BI.getDate().getFullYear();
var backBtn = BI.createWidget({
type: "bi.icon_button",
@ -94,8 +94,8 @@ BI.YearPopup = BI.inherit(BI.Widget, {
setValue: function (v) {
var o = this.options;
if (Date.checkVoid(v, 1, 1, o.min, o.max)[0]) {
v = Date.getDate().getFullYear();
if (BI.checkDateVoid(v, 1, 1, o.min, o.max)[0]) {
v = BI.getDate().getFullYear();
this.selectedYear = "";
this.navigation.setSelect(BI.YearCalendar.getPageByYear(v));
this.navigation.setValue("");

2
src/widget/year/trigger.year.js

@ -29,7 +29,7 @@ BI.YearTrigger = BI.inherit(BI.Trigger, {
height: o.height,
validationChecker: function (v) {
self.editor.setErrorText(!BI.isPositiveInteger(v) ? c.errorText : c.errorTextInvalid);
return v === "" || (BI.isPositiveInteger(v) && !Date.checkVoid(v, 1, 1, o.min, o.max)[0]);
return v === "" || (BI.isPositiveInteger(v) && !BI.checkDateVoid(v, 1, 1, o.min, o.max)[0]);
},
quitChecker: function (v) {
return false;

762
utils/utils.js

@ -8805,63 +8805,6 @@ _.extend(String.prototype, {
return location;
}
});
/**
* 对字符串对象的扩展
* @class String
*/
_.extend(String, {
/**
* 对字符串中的'\做编码处理
* @static
* @param {String} string 要做编码处理的字符串
* @return {String} 编码后的字符串
*/
escape: function (string) {
return string.replace(/('|\\)/g, "\\$1");
},
/**
* 让字符串通过指定字符做补齐的函数
*
* var s = String.leftPad('123', 5, '0');//s的值为:'00123'
*
* @static
* @param {String} val 原始值
* @param {Number} size 总共需要的位数
* @param {String} ch 用于补齐的字符
* @return {String} 补齐后的字符串
*/
leftPad: function (val, size, ch) {
var result = String(val);
if (!ch) {
ch = " ";
}
while (result.length < size) {
result = ch + result;
}
return result.toString();
},
/**
* 对字符串做替换的函数
*
* var cls = 'my-class', text = 'Some text';
* var res = String.format('<div class="{0}>{1}</div>"', cls, text);
* //res的值为:'<div class="my-class">Some text</div>';
*
* @static
* @param {String} format 要做替换的字符串替换字符串1替换字符串2...
* @return {String} 做了替换后的字符串
*/
format: function (format) {
var args = Array.prototype.slice.call(arguments, 1);
return format.replace(/\{(\d+)\}/g, function (m, i) {
return args[i];
});
}
});
/** Constants used for time computations */
Date.SECOND = 1000;
Date.MINUTE = 60 * Date.SECOND;
@ -8895,20 +8838,20 @@ Date.prototype.getMonthDays = function (month) {
* @returns {Date}
*/
Date.prototype.getLastDateOfMonth = function () {
return Date.getDate(this.getFullYear(), this.getMonth(), this.getMonthDays());
return BI.getDate(this.getFullYear(), this.getMonth(), this.getMonthDays());
};
/** Returns the number of day in the year. */
Date.prototype.getDayOfYear = function () {
var now = Date.getDate(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0);
var then = Date.getDate(this.getFullYear(), 0, 0, 0, 0, 0);
var now = BI.getDate(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0);
var then = BI.getDate(this.getFullYear(), 0, 0, 0, 0, 0);
var time = now - then;
return Math.floor(time / Date.DAY);
};
/** Returns the number of the week in year, as defined in ISO 8601. */
Date.prototype.getWeekNumber = function () {
var d = Date.getDate(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0);
var d = BI.getDate(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0);
// 周一是一周第一天
var week = d.getDay() === 0 ? 7 : d.getDay();
// var week = d.getDay();
@ -8932,17 +8875,17 @@ Date.prototype.getQuarter = function () {
// 离当前时间多少天的时间
Date.prototype.getOffsetDate = function (offset) {
return Date.getDate(Date.getTime(this.getFullYear(), this.getMonth(), this.getDate(), this.getHours(), this.getMinutes(), this.getSeconds()) + offset * 864e5);
return BI.getDate(BI.getTime(this.getFullYear(), this.getMonth(), this.getDate(), this.getHours(), this.getMinutes(), this.getSeconds()) + offset * 864e5);
};
Date.prototype.getAfterMulQuarter = function (n) {
var dt = Date.getDate(Date.getTime(this.getFullYear(), this.getMonth(), this.getDate(), this.getHours(), this.getMinutes(), this.getSeconds()));
var dt = BI.getDate(BI.getTime(this.getFullYear(), this.getMonth(), this.getDate(), this.getHours(), this.getMinutes(), this.getSeconds()));
dt.setMonth(dt.getMonth() + n * 3);
return dt;
};
// 获得n个季度前的日期
Date.prototype.getBeforeMulQuarter = function (n) {
var dt = Date.getDate(Date.getTime(this.getFullYear(), this.getMonth(), this.getDate(), this.getHours(), this.getMinutes(), this.getSeconds()));
var dt = BI.getDate(BI.getTime(this.getFullYear(), this.getMonth(), this.getDate(), this.getHours(), this.getMinutes(), this.getSeconds()));
dt.setMonth(dt.getMonth() - n * 3);
return dt;
};
@ -8966,29 +8909,29 @@ Date.prototype.getQuarterStartMonth = function () {
};
// 获得本季度的起始日期
Date.prototype.getQuarterStartDate = function () {
return Date.getDate(this.getFullYear(), this.getQuarterStartMonth(), 1);
return BI.getDate(this.getFullYear(), this.getQuarterStartMonth(), 1);
};
// 得到本季度的结束日期
Date.prototype.getQuarterEndDate = function () {
var quarterEndMonth = this.getQuarterStartMonth() + 2;
return Date.getDate(this.getFullYear(), quarterEndMonth, this.getMonthDays(quarterEndMonth));
return BI.getDate(this.getFullYear(), quarterEndMonth, this.getMonthDays(quarterEndMonth));
};
Date.prototype.getAfterMultiMonth = function (n) {
var dt = Date.getDate(Date.getTime(this.getFullYear(), this.getMonth(), this.getDate(), this.getHours(), this.getMinutes(), this.getSeconds()));
var dt = BI.getDate(BI.getTime(this.getFullYear(), this.getMonth(), this.getDate(), this.getHours(), this.getMinutes(), this.getSeconds()));
dt.setMonth(dt.getMonth() + n | 0);
return dt;
};
Date.prototype.getBeforeMultiMonth = function (n) {
var dt = Date.getDate(Date.getTime(this.getFullYear(), this.getMonth(), this.getDate(), this.getHours(), this.getMinutes(), this.getSeconds()));
var dt = BI.getDate(BI.getTime(this.getFullYear(), this.getMonth(), this.getDate(), this.getHours(), this.getMinutes(), this.getSeconds()));
dt.setMonth(dt.getMonth() - n | 0);
return dt;
};
// 指定日期n个月之前或之后的日期
Date.prototype.getOffsetMonth = function (n) {
var dt = Date.getDate(Date.getTime(this.getFullYear(), this.getMonth(), this.getDate(), this.getHours(), this.getMinutes(), this.getSeconds()));
var dt = BI.getDate(BI.getTime(this.getFullYear(), this.getMonth(), this.getDate(), this.getHours(), this.getMinutes(), this.getSeconds()));
var day = dt.getDate();
var monthDay = Date.getDate(dt.getFullYear(), dt.getMonth() + parseInt(n), 1).getMonthDays();
var monthDay = BI.getDate(dt.getFullYear(), dt.getMonth() + parseInt(n), 1).getMonthDays();
if (day > monthDay) {
day = monthDay;
}
@ -9012,7 +8955,7 @@ Date.prototype.getWeekEndDate = function () {
Date.prototype.equalsTo = function (date) {
return ((this.getFullYear() == date.getFullYear()) &&
(this.getMonth() == date.getMonth()) &&
(this.getDate() == date.getDate()) &&
(this.getDate() == BI.getDate()) &&
(this.getHours() == date.getHours()) &&
(this.getMinutes() == date.getMinutes()) &&
(this.getSeconds() == date.getSeconds()));
@ -9020,7 +8963,7 @@ Date.prototype.equalsTo = function (date) {
/** Set only the year, month, date parts (keep existing time) */
Date.prototype.setDateOnly = function (date) {
var tmp = Date.getDate(date);
var tmp = BI.getDate(date);
this.setDate(1);
this.setFullYear(tmp.getFullYear());
this.setMonth(tmp.getMonth());
@ -9099,304 +9042,6 @@ Date.prototype.print = function (str) {
return str;
};
/**
* 是否是闰年
* @param year
* @returns {boolean}
*/
Date.isLeap = function (year) {
return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
};
/**
* 检测是否在有效期
*
* @param YY
* @param MM
* @param DD
* @param minDate '1900-01-01'
* @param maxDate '2099-12-31'
* @returns {Array} 若无效返回无效状态
*/
Date.checkVoid = function (YY, MM, DD, minDate, maxDate) {
var back = [];
YY = YY | 0;
MM = MM | 0;
DD = DD | 0;
minDate = BI.isString(minDate) ? minDate.match(/\d+/g) : minDate;
maxDate = BI.isString(maxDate) ? maxDate.match(/\d+/g) : maxDate;
if (YY < minDate[0]) {
back = ["y"];
} else if (YY > maxDate[0]) {
back = ["y", 1];
} else if (YY >= minDate[0] && YY <= maxDate[0]) {
if (YY == minDate[0]) {
if (MM < minDate[1]) {
back = ["m"];
} else if (MM == minDate[1]) {
if (DD < minDate[2]) {
back = ["d"];
}
}
}
if (YY == maxDate[0]) {
if (MM > maxDate[1]) {
back = ["m", 1];
} else if (MM == maxDate[1]) {
if (DD > maxDate[2]) {
back = ["d", 1];
}
}
}
}
return back;
};
Date.checkLegal = function (str) {
var ar = str.match(/\d+/g);
var YY = ar[0] | 0, MM = ar[1] | 0, DD = ar[2] | 0;
if (ar.length <= 1) {
return true;
}
if (ar.length <= 2) {
return MM >= 1 && MM <= 12;
}
var MD = Date._MD.slice(0);
MD[1] = Date.isLeap(YY) ? 29 : 28;
return MM >= 1 && MM <= 12 && DD <= MD[MM - 1];
};
Date.parseDateTime = function (str, fmt) {
var today = Date.getDate();
var y = 0;
var m = 0;
var d = 1;
// wei : 对于fmt为‘YYYYMM’或者‘YYYYMMdd’的格式,str的值为类似'201111'的形式,因为年月之间没有分隔符,所以正则表达式分割无效,导致bug7376。
var a = str.split(/\W+/);
if (fmt.toLowerCase() == "%y%x" || fmt.toLowerCase() == "%y%x%d") {
var yearlength = 4;
var otherlength = 2;
a[0] = str.substring(0, yearlength);
a[1] = str.substring(yearlength, yearlength + otherlength);
a[2] = str.substring(yearlength + otherlength, yearlength + otherlength * 2);
}
var b = fmt.match(/%./g);
var i = 0, j = 0;
var hr = 0;
var min = 0;
var sec = 0;
for (i = 0; i < a.length; ++i) {
switch (b[i]) {
case "%d":
case "%e":
d = parseInt(a[i], 10);
break;
case "%X":
m = parseInt(a[i], 10) - 1;
break;
case "%x":
m = parseInt(a[i], 10) - 1;
break;
case "%Y":
case "%y":
y = parseInt(a[i], 10);
(y < 100) && (y += (y > 29) ? 1900 : 2000);
break;
case "%b":
case "%B":
for (j = 0; j < 12; ++j) {
if (Date._MN[j].substr(0, a[i].length).toLowerCase() == a[i].toLowerCase()) {
m = j;
break;
}
}
break;
case "%H":
case "%I":
case "%k":
case "%l":
hr = parseInt(a[i], 10);
break;
case "%P":
case "%p":
if (/pm/i.test(a[i]) && hr < 12) {
hr += 12;
} else if (/am/i.test(a[i]) && hr >= 12) {
hr -= 12;
}
break;
case "%M":
min = parseInt(a[i], 10);
case "%S":
sec = parseInt(a[i], 10);
break;
}
}
// if (!a[i]) {
// continue;
// }
if (isNaN(y)) {
y = today.getFullYear();
}
if (isNaN(m)) {
m = today.getMonth();
}
if (isNaN(d)) {
d = today.getDate();
}
if (isNaN(hr)) {
hr = today.getHours();
}
if (isNaN(min)) {
min = today.getMinutes();
}
if (isNaN(sec)) {
sec = today.getSeconds();
}
if (y != 0) {
return Date.getDate(y, m, d, hr, min, sec);
}
y = 0;
m = -1;
d = 0;
for (i = 0; i < a.length; ++i) {
if (a[i].search(/[a-zA-Z]+/) != -1) {
var t = -1;
for (j = 0; j < 12; ++j) {
if (Date._MN[j].substr(0, a[i].length).toLowerCase() == a[i].toLowerCase()) {
t = j;
break;
}
}
if (t != -1) {
if (m != -1) {
d = m + 1;
}
m = t;
}
} else if (parseInt(a[i], 10) <= 12 && m == -1) {
m = a[i] - 1;
} else if (parseInt(a[i], 10) > 31 && y == 0) {
y = parseInt(a[i], 10);
(y < 100) && (y += (y > 29) ? 1900 : 2000);
} else if (d == 0) {
d = a[i];
}
}
if (y == 0) {
y = today.getFullYear();
}
if (m != -1 && d != 0) {
return Date.getDate(y, m, d, hr, min, sec);
}
return today;
};
Date.getDate = function () {
var length = arguments.length;
var args = arguments;
var dt;
switch (length) {
// new Date()
case 0:
dt = new Date();
break;
// new Date(long)
case 1:
dt = new Date(args[0]);
break;
// new Date(year, month)
case 2:
dt = new Date(args[0], args[1]);
break;
// new Date(year, month, day)
case 3:
dt = new Date(args[0], args[1], args[2]);
break;
// new Date(year, month, day, hour)
case 4:
dt = new Date(args[0], args[1], args[2], args[3]);
break;
// new Date(year, month, day, hour, minute)
case 5:
dt = new Date(args[0], args[1], args[2], args[3], args[4]);
break;
// new Date(year, month, day, hour, minute, second)
case 6:
dt = new Date(args[0], args[1], args[2], args[3], args[4], args[5]);
break;
// new Date(year, month, day, hour, minute, second, millisecond)
case 7:
dt = new Date(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
break;
default:
dt = new Date();
break;
}
if(BI.isNotNull(Date.timeZone) && (arguments.length === 0 || (arguments.length === 1 && BI.isNumber(arguments[0])))) {
var localTime = dt.getTime();
var localOffset = dt.getTimezoneOffset() * 60000; // 获得当地时间偏移的毫秒数
var utc = localTime + localOffset; // utc即GMT时间标准时区
return new Date(utc + Date.timeZone);// + Pool.timeZone.offset);
}
return dt;
};
Date.getTime = function () {
var length = arguments.length;
var args = arguments;
var dt;
switch (length) {
// new Date()
case 0:
dt = new Date();
break;
// new Date(long)
case 1:
dt = new Date(args[0]);
break;
// new Date(year, month)
case 2:
dt = new Date(args[0], args[1]);
break;
// new Date(year, month, day)
case 3:
dt = new Date(args[0], args[1], args[2]);
break;
// new Date(year, month, day, hour)
case 4:
dt = new Date(args[0], args[1], args[2], args[3]);
break;
// new Date(year, month, day, hour, minute)
case 5:
dt = new Date(args[0], args[1], args[2], args[3], args[4]);
break;
// new Date(year, month, day, hour, minute, second)
case 6:
dt = new Date(args[0], args[1], args[2], args[3], args[4], args[5]);
break;
// new Date(year, month, day, hour, minute, second, millisecond)
case 7:
dt = new Date(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
break;
default:
dt = new Date();
break;
}
if(BI.isNotNull(Date.timeZone)) {
return dt.getTime() - Date.timeZone - dt.getTimezoneOffset() * 60000;
}
return dt.getTime();
};
Function.prototype.before = function (func) {
var __self = this;
return function () {
@ -9967,7 +9612,7 @@ if (!window.BI) {
// Date
if (type === "[object Date]") {
return Date.getDate(obj.getTime());
return BI.getDate(obj.getTime());
}
var i, clone, key;
@ -10203,7 +9848,7 @@ if (!window.BI) {
if (Date.now) {
return Date.now();
}
return Date.getDate().getTime();
return BI.getDate().getTime();
},
@ -10466,6 +10111,357 @@ if (!window.BI) {
prand = (mult * prand + incr) % modu;
}
return unescape(enc_str);
},
/**
* 对字符串中的'\做编码处理
* @static
* @param {String} string 要做编码处理的字符串
* @return {String} 编码后的字符串
*/
escape: function (string) {
return string.replace(/('|\\)/g, "\\$1");
},
/**
* 让字符串通过指定字符做补齐的函数
*
* var s = BI.leftPad('123', 5, '0');//s的值为:'00123'
*
* @static
* @param {String} val 原始值
* @param {Number} size 总共需要的位数
* @param {String} ch 用于补齐的字符
* @return {String} 补齐后的字符串
*/
leftPad: function (val, size, ch) {
var result = String(val);
if (!ch) {
ch = " ";
}
while (result.length < size) {
result = ch + result;
}
return result.toString();
},
/**
* 对字符串做替换的函数
*
* var cls = 'my-class', text = 'Some text';
* var res = BI.format('<div class="{0}>{1}</div>"', cls, text);
* //res的值为:'<div class="my-class">Some text</div>';
*
* @static
* @param {String} format 要做替换的字符串替换字符串1替换字符串2...
* @return {String} 做了替换后的字符串
*/
format: function (format) {
var args = Array.prototype.slice.call(arguments, 1);
return format.replace(/\{(\d+)\}/g, function (m, i) {
return args[i];
});
}
});
// 日期相关方法
_.extend(BI, {
/**
* 是否是闰年
* @param year
* @returns {boolean}
*/
isLeapYear: function (year) {
return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
},
/**
* 检测是否在有效期
*
* @param YY
* @param MM
* @param DD
* @param minDate '1900-01-01'
* @param maxDate '2099-12-31'
* @returns {Array} 若无效返回无效状态
*/
checkDateVoid: function (YY, MM, DD, minDate, maxDate) {
var back = [];
YY = YY | 0;
MM = MM | 0;
DD = DD | 0;
minDate = BI.isString(minDate) ? minDate.match(/\d+/g) : minDate;
maxDate = BI.isString(maxDate) ? maxDate.match(/\d+/g) : maxDate;
if (YY < minDate[0]) {
back = ["y"];
} else if (YY > maxDate[0]) {
back = ["y", 1];
} else if (YY >= minDate[0] && YY <= maxDate[0]) {
if (YY == minDate[0]) {
if (MM < minDate[1]) {
back = ["m"];
} else if (MM == minDate[1]) {
if (DD < minDate[2]) {
back = ["d"];
}
}
}
if (YY == maxDate[0]) {
if (MM > maxDate[1]) {
back = ["m", 1];
} else if (MM == maxDate[1]) {
if (DD > maxDate[2]) {
back = ["d", 1];
}
}
}
}
return back;
},
checkDateLegal: function (str) {
var ar = str.match(/\d+/g);
var YY = ar[0] | 0, MM = ar[1] | 0, DD = ar[2] | 0;
if (ar.length <= 1) {
return true;
}
if (ar.length <= 2) {
return MM >= 1 && MM <= 12;
}
var MD = Date._MD.slice(0);
MD[1] = BI.isLeapYear(YY) ? 29 : 28;
return MM >= 1 && MM <= 12 && DD <= MD[MM - 1];
},
parseDateTime: function (str, fmt) {
var today = BI.getDate();
var y = 0;
var m = 0;
var d = 1;
// wei : 对于fmt为‘YYYYMM’或者‘YYYYMMdd’的格式,str的值为类似'201111'的形式,因为年月之间没有分隔符,所以正则表达式分割无效,导致bug7376。
var a = str.split(/\W+/);
if (fmt.toLowerCase() == "%y%x" || fmt.toLowerCase() == "%y%x%d") {
var yearlength = 4;
var otherlength = 2;
a[0] = str.substring(0, yearlength);
a[1] = str.substring(yearlength, yearlength + otherlength);
a[2] = str.substring(yearlength + otherlength, yearlength + otherlength * 2);
}
var b = fmt.match(/%./g);
var i = 0, j = 0;
var hr = 0;
var min = 0;
var sec = 0;
for (i = 0; i < a.length; ++i) {
switch (b[i]) {
case "%d":
case "%e":
d = parseInt(a[i], 10);
break;
case "%X":
m = parseInt(a[i], 10) - 1;
break;
case "%x":
m = parseInt(a[i], 10) - 1;
break;
case "%Y":
case "%y":
y = parseInt(a[i], 10);
(y < 100) && (y += (y > 29) ? 1900 : 2000);
break;
case "%b":
case "%B":
for (j = 0; j < 12; ++j) {
if (Date._MN[j].substr(0, a[i].length).toLowerCase() == a[i].toLowerCase()) {
m = j;
break;
}
}
break;
case "%H":
case "%I":
case "%k":
case "%l":
hr = parseInt(a[i], 10);
break;
case "%P":
case "%p":
if (/pm/i.test(a[i]) && hr < 12) {
hr += 12;
} else if (/am/i.test(a[i]) && hr >= 12) {
hr -= 12;
}
break;
case "%M":
min = parseInt(a[i], 10);
case "%S":
sec = parseInt(a[i], 10);
break;
}
}
// if (!a[i]) {
// continue;
// }
if (isNaN(y)) {
y = today.getFullYear();
}
if (isNaN(m)) {
m = today.getMonth();
}
if (isNaN(d)) {
d = today.getDate();
}
if (isNaN(hr)) {
hr = today.getHours();
}
if (isNaN(min)) {
min = today.getMinutes();
}
if (isNaN(sec)) {
sec = today.getSeconds();
}
if (y != 0) {
return BI.getDate(y, m, d, hr, min, sec);
}
y = 0;
m = -1;
d = 0;
for (i = 0; i < a.length; ++i) {
if (a[i].search(/[a-zA-Z]+/) != -1) {
var t = -1;
for (j = 0; j < 12; ++j) {
if (Date._MN[j].substr(0, a[i].length).toLowerCase() == a[i].toLowerCase()) {
t = j;
break;
}
}
if (t != -1) {
if (m != -1) {
d = m + 1;
}
m = t;
}
} else if (parseInt(a[i], 10) <= 12 && m == -1) {
m = a[i] - 1;
} else if (parseInt(a[i], 10) > 31 && y == 0) {
y = parseInt(a[i], 10);
(y < 100) && (y += (y > 29) ? 1900 : 2000);
} else if (d == 0) {
d = a[i];
}
}
if (y == 0) {
y = today.getFullYear();
}
if (m != -1 && d != 0) {
return BI.getDate(y, m, d, hr, min, sec);
}
return today;
},
getDate: function () {
var length = arguments.length;
var args = arguments;
var dt;
switch (length) {
// new Date()
case 0:
dt = new Date();
break;
// new Date(long)
case 1:
dt = new Date(args[0]);
break;
// new Date(year, month)
case 2:
dt = new Date(args[0], args[1]);
break;
// new Date(year, month, day)
case 3:
dt = new Date(args[0], args[1], args[2]);
break;
// new Date(year, month, day, hour)
case 4:
dt = new Date(args[0], args[1], args[2], args[3]);
break;
// new Date(year, month, day, hour, minute)
case 5:
dt = new Date(args[0], args[1], args[2], args[3], args[4]);
break;
// new Date(year, month, day, hour, minute, second)
case 6:
dt = new Date(args[0], args[1], args[2], args[3], args[4], args[5]);
break;
// new Date(year, month, day, hour, minute, second, millisecond)
case 7:
dt = new Date(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
break;
default:
dt = new Date();
break;
}
if (BI.isNotNull(Date.timeZone) && (arguments.length === 0 || (arguments.length === 1 && BI.isNumber(arguments[0])))) {
var localTime = dt.getTime();
var localOffset = dt.getTimezoneOffset() * 60000; // 获得当地时间偏移的毫秒数
var utc = localTime + localOffset; // utc即GMT时间标准时区
return new Date(utc + Date.timeZone);// + Pool.timeZone.offset);
}
return dt;
},
getTime: function () {
var length = arguments.length;
var args = arguments;
var dt;
switch (length) {
// new Date()
case 0:
dt = new Date();
break;
// new Date(long)
case 1:
dt = new Date(args[0]);
break;
// new Date(year, month)
case 2:
dt = new Date(args[0], args[1]);
break;
// new Date(year, month, day)
case 3:
dt = new Date(args[0], args[1], args[2]);
break;
// new Date(year, month, day, hour)
case 4:
dt = new Date(args[0], args[1], args[2], args[3]);
break;
// new Date(year, month, day, hour, minute)
case 5:
dt = new Date(args[0], args[1], args[2], args[3], args[4]);
break;
// new Date(year, month, day, hour, minute, second)
case 6:
dt = new Date(args[0], args[1], args[2], args[3], args[4], args[5]);
break;
// new Date(year, month, day, hour, minute, second, millisecond)
case 7:
dt = new Date(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
break;
default:
dt = new Date();
break;
}
if (BI.isNotNull(Date.timeZone)) {
return dt.getTime() - Date.timeZone - dt.getTimezoneOffset() * 60000;
}
return dt.getTime();
}
});
@ -10890,7 +10886,7 @@ _.extend(BI.OB.prototype, {
if (newnum.length > orilen) {
newnum = newnum.substr(1);
} else {
newnum = String.leftPad(newnum, orilen, "0");
newnum = BI.leftPad(newnum, orilen, "0");
result.leftPlus = false;
}
right = right.replace(/^[0-9]+/, newnum);
@ -11233,6 +11229,8 @@ _.extend(BI.OB.prototype, {
text = _eFormat(text, fmt);
} else {
// 数字格式
var s = [];
BI.clamp(s);
text = _numberFormat(text, fmt);
}
// ¤ - 货币格式
@ -11302,14 +11300,14 @@ _.extend(BI.OB.prototype, {
} else if (len < 2) {
str = date.getMonth() + 1;
} else {
str = String.leftPad(date.getMonth() + 1 + "", 2, "0");
str = BI.leftPad(date.getMonth() + 1 + "", 2, "0");
}
break;
case "d": // 日
if (len > 1) {
str = String.leftPad(date.getDate() + "", 2, "0");
str = BI.leftPad(BI.getDate() + "", 2, "0");
} else {
str = date.getDate();
str = BI.getDate();
}
break;
case "h": // 时(12)
@ -11318,28 +11316,28 @@ _.extend(BI.OB.prototype, {
hour = 12;
}
if (len > 1) {
str = String.leftPad(hour + "", 2, "0");
str = BI.leftPad(hour + "", 2, "0");
} else {
str = hour;
}
break;
case "H": // 时(24)
if (len > 1) {
str = String.leftPad(date.getHours() + "", 2, "0");
str = BI.leftPad(date.getHours() + "", 2, "0");
} else {
str = date.getHours();
}
break;
case "m":
if (len > 1) {
str = String.leftPad(date.getMinutes() + "", 2, "0");
str = BI.leftPad(date.getMinutes() + "", 2, "0");
} else {
str = date.getMinutes();
}
break;
case "s":
if (len > 1) {
str = String.leftPad(date.getSeconds() + "", 2, "0");
str = BI.leftPad(date.getSeconds() + "", 2, "0");
} else {
str = date.getSeconds();
}
@ -11842,7 +11840,7 @@ BI.Cache = {
// 判断是否设置过期时间
if (expiresHours && expiresHours > 0) {
var date = new Date();
date.setTime(date.getTime() + expiresHours * 3600 * 1000);
date.setTime(BI.getTime() + expiresHours * 3600 * 1000);
cookieString = cookieString + "; expires=" + date.toGMTString();
}
if (path) {
@ -11857,7 +11855,7 @@ BI.Cache = {
},
deleteCookie: function (name, path) {
var date = new Date();
date.setTime(date.getTime() - 10000);
date.setTime(BI.getTime() - 10000);
var cookieString = name + "=v; expires=" + date.toGMTString();
if (path) {
cookieString = cookieString + "; path=" + path;

Loading…
Cancel
Save