Browse Source

node环境

es6
guy 6 years ago
parent
commit
33e0fa9592
  1. 1
      Gruntfile.js
  2. 14
      dist/base.js
  3. 111
      dist/bundle.js
  4. 68
      dist/bundle.min.js
  5. 89
      dist/core.js
  6. 121
      dist/fineui.js
  7. 70
      dist/fineui.min.js
  8. 10
      dist/polyfill.js
  9. 8
      dist/router.js
  10. 69
      dist/utils.js
  11. 6
      dist/utils.min.js
  12. 8
      src/base/single/input/file.js
  13. 4
      src/base/tree/treeview.js
  14. 20
      src/core/alias.js
  15. 23
      src/core/base.js
  16. 14
      src/core/foundation.js
  17. 4
      src/core/func/dom.js
  18. 2
      src/core/ob.js
  19. 8
      src/core/utils/detectElementResize.js
  20. 14
      src/core/utils/events/mousemovetracker.js
  21. 2
      src/core/utils/events/wheelhandler.js
  22. 2
      src/core/utils/prefixIntervalTree.js
  23. 2
      src/polyfill/console.js
  24. 2
      src/polyfill/localStorage.js
  25. 6
      src/polyfill/sort.js
  26. 8
      src/router/router.js
  27. 2
      src/third/jquery.mousewheel.js

1
Gruntfile.js

@ -297,6 +297,5 @@ module.exports = function (grunt) {
grunt.config.set("connect.options.open", false); grunt.config.set("connect.options.open", false);
grunt.task.run(defaultTask); grunt.task.run(defaultTask);
}); });
grunt.registerTask("min", ["clean", "less", "concat", "uglify", "cssmin"]);
grunt.registerTask("build", ["clean", "less", "cssmin", "concat", "uglify"]); grunt.registerTask("build", ["clean", "less", "cssmin", "concat", "uglify"]);
}; };

14
dist/base.js vendored

@ -72,7 +72,7 @@
function handler (event) { function handler (event) {
var orgEvent = event || window.event, var orgEvent = event || _global.event,
args = slice.call(arguments, 1), args = slice.call(arguments, 1),
delta = 0, delta = 0,
deltaX = 0, deltaX = 0,
@ -1720,8 +1720,8 @@ BI.TreeView = BI.inherit(BI.Pane, {
treeNode.times = treeNode.times || 1; treeNode.times = treeNode.times || 1;
var param = "id=" + treeNode.id var param = "id=" + treeNode.id
+ "&times=" + (treeNode.times++) + "&times=" + (treeNode.times++)
+ "&parentValues= " + window.encodeURIComponent(BI.jsonEncode(parentNode)) + "&parentValues= " + _global.encodeURIComponent(BI.jsonEncode(parentNode))
+ "&checkState=" + window.encodeURIComponent(BI.jsonEncode(treeNode.getCheckStatus())); + "&checkState=" + _global.encodeURIComponent(BI.jsonEncode(treeNode.getCheckStatus()));
return "&" + param; return "&" + param;
} }
@ -9211,7 +9211,7 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
}, },
false false
); );
xhr.open("post", handler.url + "&filename=" + window.encodeURIComponent(handler.file.fileName), true); xhr.open("post", handler.url + "&filename=" + _global.encodeURIComponent(handler.file.fileName), true);
if (!xhr.upload) { if (!xhr.upload) {
var rpe = {loaded: 0, total: handler.file.fileSize || handler.file.size, simulation: true}; var rpe = {loaded: 0, total: handler.file.fileSize || handler.file.size, simulation: true};
rpe.interval = setInterval(function () { rpe.interval = setInterval(function () {
@ -9322,7 +9322,7 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
handler.attach_array.push(attachO); handler.attach_array.push(attachO);
} }
} catch (e) { } catch (e) {
if (isFunction(handler.onerror)) {handler.onerror(rpe, event || window.event);} if (isFunction(handler.onerror)) {handler.onerror(rpe, event || _global.event);}
} }
if (isFunction(handler.onload)) {handler.onload(rpe, {responseText: responseText});} if (isFunction(handler.onload)) {handler.onload(rpe, {responseText: responseText});}
}, },
@ -9342,7 +9342,7 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
iframe.onload = onload; iframe.onload = onload;
iframe.onerror = function (event) { iframe.onerror = function (event) {
if (isFunction(handler.onerror)) { if (isFunction(handler.onerror)) {
handler.onerror(rpe, event || window.event); handler.onerror(rpe, event || _global.event);
} }
}; };
iframe.onreadystatechange = function () { iframe.onreadystatechange = function () {
@ -9364,7 +9364,7 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
}); });
} }
}; };
form.setAttribute("action", handler.url + "&filename=" + window.encodeURIComponent(handler.file.fileName)); form.setAttribute("action", handler.url + "&filename=" + _global.encodeURIComponent(handler.file.fileName));
form.setAttribute("target", iframe.id); form.setAttribute("target", iframe.id);
form.setAttribute("method", "post"); form.setAttribute("method", "post");
form.appendChild(handler.file); form.appendChild(handler.file);

111
dist/bundle.js vendored

@ -19709,16 +19709,35 @@ if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
/** /**
* 初始化BI对象 * 初始化BI对象
*/ */
if (window.BI == null) { var _global;
window.BI = {}; if (typeof window !== "undefined") {
_global = window;
} else if (typeof global !== "undefined") {
_global = global;
} else if (typeof self !== "undefined") {
_global = self;
} else {
_global = this;
}
if (_global.BI == null) {
_global.BI = {};
}/** }/**
* 基本函数 * 基本函数
* Create By GUY 2014\11\17 * Create By GUY 2014\11\17
* *
*/ */
var _global;
if (!window.BI) { if (typeof window !== "undefined") {
window.BI = {}; _global = window;
} else if (typeof global !== "undefined") {
_global = global;
} else if (typeof self !== "undefined") {
_global = self;
} else {
_global = this;
}
if (!_global.BI) {
_global.BI = {};
} }
!(function (undefined) { !(function (undefined) {
@ -20446,11 +20465,11 @@ if (!window.BI) {
}); });
_.extend(BI, { _.extend(BI, {
getTime: function () { getTime: function () {
if (window.performance && window.performance.now) { if (_global.performance && _global.performance.now) {
return window.performance.now(); return _global.performance.now();
} }
if (window.performance && window.performance.webkitNow) { if (_global.performance && _global.performance.webkitNow) {
return window.performance.webkitNow(); return _global.performance.webkitNow();
} }
if (Date.now) { if (Date.now) {
return Date.now(); return Date.now();
@ -21196,7 +21215,7 @@ BI.OB = function (config) {
if (BI.isFunction(this.props)) { if (BI.isFunction(this.props)) {
props = this.props(config); props = this.props(config);
} }
this.options = (window.$ || window._).extend(this._defaultConfig(config), props, config); this.options = (_global.$ || _global._).extend(this._defaultConfig(config), props, config);
this._init(); this._init();
this._initRef(); this._initRef();
}; };
@ -22850,14 +22869,14 @@ BI.ScalingCellSizeAndPositionManager.prototype = {
if (!attachEvent) { if (!attachEvent) {
var requestFrame = (function () { var requestFrame = (function () {
var raf = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || var raf = _global.requestAnimationFrame || _global.mozRequestAnimationFrame || _global.webkitRequestAnimationFrame ||
function (fn) { return window.setTimeout(fn, 20); }; function (fn) { return _global.setTimeout(fn, 20); };
return function (fn) { return raf(fn); }; return function (fn) { return raf(fn); };
})(); })();
var cancelFrame = (function () { var cancelFrame = (function () {
var cancel = window.cancelAnimationFrame || window.mozCancelAnimationFrame || window.webkitCancelAnimationFrame || var cancel = _global.cancelAnimationFrame || _global.mozCancelAnimationFrame || _global.webkitCancelAnimationFrame ||
window.clearTimeout; _global.clearTimeout;
return function (id) { return cancel(id); }; return function (id) { return cancel(id); };
})(); })();
@ -23325,7 +23344,7 @@ BI.ScalingCellSizeAndPositionManager.prototype = {
return Math.floor(node / 2); return Math.floor(node / 2);
}; };
var Int32Array = window.Int32Array || function (size) { var Int32Array = _global.Int32Array || function (size) {
var xs = []; var xs = [];
for (var i = size - 1; i >= 0; --i) { for (var i = size - 1; i >= 0; --i) {
xs[i] = 0; xs[i] = 0;
@ -25007,8 +25026,18 @@ BI.ShowAction = BI.inherit(BI.Action, {
callback && callback(); callback && callback();
} }
});(function () { });(function () {
if (!window.BI) { var _global;
window.BI = {}; if (typeof window !== "undefined") {
_global = window;
} else if (typeof global !== "undefined") {
_global = global;
} else if (typeof self !== "undefined") {
_global = self;
} else {
_global = this;
}
if (!_global.BI) {
_global.BI = {};
} }
function isEmpty (value) { function isEmpty (value) {
@ -25536,7 +25565,7 @@ BI.ShowAction = BI.inherit(BI.Action, {
try { try {
// 注意0啊 // 注意0啊
// var jo = $.parseJSON(text) || {}; // var jo = $.parseJSON(text) || {};
var jo = $ ? $.parseJSON(text) : window.JSON.parse(text); var jo = $ ? $.parseJSON(text) : _global.JSON.parse(text);
if (jo == null) { if (jo == null) {
jo = {}; jo = {};
} }
@ -25589,7 +25618,7 @@ BI.ShowAction = BI.inherit(BI.Action, {
url = url.replaceAll(BI.keys(BI.specialCharsMap || []).join("|"), function (str) { url = url.replaceAll(BI.keys(BI.specialCharsMap || []).join("|"), function (str) {
return BI.specialCharsMap[str] || str; return BI.specialCharsMap[str] || str;
}); });
return window.encodeURIComponent(url); return _global.encodeURIComponent(url);
}; };
BI.decodeURIComponent = function (url) { BI.decodeURIComponent = function (url) {
@ -25601,7 +25630,7 @@ BI.ShowAction = BI.inherit(BI.Action, {
url = url.replaceAll(BI.keys(reserveSpecialCharsMap || []).join("|"), function (str) { url = url.replaceAll(BI.keys(reserveSpecialCharsMap || []).join("|"), function (str) {
return reserveSpecialCharsMap[str] || str; return reserveSpecialCharsMap[str] || str;
}); });
return window.decodeURIComponent(url); return _global.decodeURIComponent(url);
}; };
BI.contentFormat = function (cv, fmt) { BI.contentFormat = function (cv, fmt) {
@ -27382,9 +27411,9 @@ BI.extend(jQuery.fn, {
var computedStyle = void 0; var computedStyle = void 0;
// W3C Standard // W3C Standard
if (window.getComputedStyle) { if (_global.getComputedStyle) {
// In certain cases such as within an iframe in FF3, this returns null. // In certain cases such as within an iframe in FF3, this returns null.
computedStyle = window.getComputedStyle(node, null); computedStyle = _global.getComputedStyle(node, null);
if (computedStyle) { if (computedStyle) {
return computedStyle.getPropertyValue(BI.hyphenate(name)); return computedStyle.getPropertyValue(BI.hyphenate(name));
} }
@ -29666,14 +29695,14 @@ _.extend(String.prototype, {
} }
};!(function () { };!(function () {
var cancelAnimationFrame = var cancelAnimationFrame =
window.cancelAnimationFrame || _global.cancelAnimationFrame ||
window.webkitCancelAnimationFrame || _global.webkitCancelAnimationFrame ||
window.mozCancelAnimationFrame || _global.mozCancelAnimationFrame ||
window.oCancelAnimationFrame || _global.oCancelAnimationFrame ||
window.msCancelAnimationFrame || _global.msCancelAnimationFrame ||
window.clearTimeout; _global.clearTimeout;
var requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || window.setTimeout; var requestAnimationFrame = _global.requestAnimationFrame || _global.webkitRequestAnimationFrame || _global.mozRequestAnimationFrame || _global.oRequestAnimationFrame || _global.msRequestAnimationFrame || _global.setTimeout;
BI.MouseMoveTracker = function (onMove, onMoveEnd, domNode) { BI.MouseMoveTracker = function (onMove, onMoveEnd, domNode) {
@ -29774,7 +29803,7 @@ _.extend(String.prototype, {
var PIXEL_STEP = 10; var PIXEL_STEP = 10;
var LINE_HEIGHT = 40; var LINE_HEIGHT = 40;
var PAGE_HEIGHT = 800; var PAGE_HEIGHT = 800;
var requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || window.setTimeout; var requestAnimationFrame = _global.requestAnimationFrame || _global.webkitRequestAnimationFrame || _global.mozRequestAnimationFrame || _global.oRequestAnimationFrame || _global.msRequestAnimationFrame || _global.setTimeout;
function normalizeWheel (/* object*/event) /* object*/ { function normalizeWheel (/* object*/event) /* object*/ {
var sX = 0, var sX = 0,
@ -35273,7 +35302,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
function handler (event) { function handler (event) {
var orgEvent = event || window.event, var orgEvent = event || _global.event,
args = slice.call(arguments, 1), args = slice.call(arguments, 1),
delta = 0, delta = 0,
deltaX = 0, deltaX = 0,
@ -36921,8 +36950,8 @@ BI.TreeView = BI.inherit(BI.Pane, {
treeNode.times = treeNode.times || 1; treeNode.times = treeNode.times || 1;
var param = "id=" + treeNode.id var param = "id=" + treeNode.id
+ "&times=" + (treeNode.times++) + "&times=" + (treeNode.times++)
+ "&parentValues= " + window.encodeURIComponent(BI.jsonEncode(parentNode)) + "&parentValues= " + _global.encodeURIComponent(BI.jsonEncode(parentNode))
+ "&checkState=" + window.encodeURIComponent(BI.jsonEncode(treeNode.getCheckStatus())); + "&checkState=" + _global.encodeURIComponent(BI.jsonEncode(treeNode.getCheckStatus()));
return "&" + param; return "&" + param;
} }
@ -44412,7 +44441,7 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
}, },
false false
); );
xhr.open("post", handler.url + "&filename=" + window.encodeURIComponent(handler.file.fileName), true); xhr.open("post", handler.url + "&filename=" + _global.encodeURIComponent(handler.file.fileName), true);
if (!xhr.upload) { if (!xhr.upload) {
var rpe = {loaded: 0, total: handler.file.fileSize || handler.file.size, simulation: true}; var rpe = {loaded: 0, total: handler.file.fileSize || handler.file.size, simulation: true};
rpe.interval = setInterval(function () { rpe.interval = setInterval(function () {
@ -44523,7 +44552,7 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
handler.attach_array.push(attachO); handler.attach_array.push(attachO);
} }
} catch (e) { } catch (e) {
if (isFunction(handler.onerror)) {handler.onerror(rpe, event || window.event);} if (isFunction(handler.onerror)) {handler.onerror(rpe, event || _global.event);}
} }
if (isFunction(handler.onload)) {handler.onload(rpe, {responseText: responseText});} if (isFunction(handler.onload)) {handler.onload(rpe, {responseText: responseText});}
}, },
@ -44543,7 +44572,7 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
iframe.onload = onload; iframe.onload = onload;
iframe.onerror = function (event) { iframe.onerror = function (event) {
if (isFunction(handler.onerror)) { if (isFunction(handler.onerror)) {
handler.onerror(rpe, event || window.event); handler.onerror(rpe, event || _global.event);
} }
}; };
iframe.onreadystatechange = function () { iframe.onreadystatechange = function () {
@ -44565,7 +44594,7 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
}); });
} }
}; };
form.setAttribute("action", handler.url + "&filename=" + window.encodeURIComponent(handler.file.fileName)); form.setAttribute("action", handler.url + "&filename=" + _global.encodeURIComponent(handler.file.fileName));
form.setAttribute("target", iframe.id); form.setAttribute("target", iframe.id);
form.setAttribute("method", "post"); form.setAttribute("method", "post");
form.appendChild(handler.file); form.appendChild(handler.file);
@ -81805,8 +81834,8 @@ BI.shortcut("bi.value_chooser_pane", BI.ValueChooserPane);;(function () {
// Ensure that `History` can be used outside of the browser. // Ensure that `History` can be used outside of the browser.
if (typeof window !== "undefined") { if (typeof window !== "undefined") {
this.location = window.location; this.location = _global.location;
this.history = window.history; this.history = _global.history;
} }
}; };
@ -81924,7 +81953,7 @@ BI.shortcut("bi.value_chooser_pane", BI.ValueChooserPane);;(function () {
} }
// Add a cross-platform `addEventListener` shim for older browsers. // Add a cross-platform `addEventListener` shim for older browsers.
var addEventListener = window.addEventListener || function (eventName, listener) { var addEventListener = _global.addEventListener || function (eventName, listener) {
return attachEvent("on" + eventName, listener); return attachEvent("on" + eventName, listener);
}; };
@ -81945,7 +81974,7 @@ BI.shortcut("bi.value_chooser_pane", BI.ValueChooserPane);;(function () {
// but possibly useful for unit testing Routers. // but possibly useful for unit testing Routers.
stop: function () { stop: function () {
// Add a cross-platform `removeEventListener` shim for older browsers. // Add a cross-platform `removeEventListener` shim for older browsers.
var removeEventListener = window.removeEventListener || function (eventName, listener) { var removeEventListener = _global.removeEventListener || function (eventName, listener) {
return detachEvent("on" + eventName, listener); return detachEvent("on" + eventName, listener);
}; };

68
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

89
dist/core.js vendored

@ -19709,16 +19709,35 @@ if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
/** /**
* 初始化BI对象 * 初始化BI对象
*/ */
if (window.BI == null) { var _global;
window.BI = {}; if (typeof window !== "undefined") {
_global = window;
} else if (typeof global !== "undefined") {
_global = global;
} else if (typeof self !== "undefined") {
_global = self;
} else {
_global = this;
}
if (_global.BI == null) {
_global.BI = {};
}/** }/**
* 基本函数 * 基本函数
* Create By GUY 2014\11\17 * Create By GUY 2014\11\17
* *
*/ */
var _global;
if (!window.BI) { if (typeof window !== "undefined") {
window.BI = {}; _global = window;
} else if (typeof global !== "undefined") {
_global = global;
} else if (typeof self !== "undefined") {
_global = self;
} else {
_global = this;
}
if (!_global.BI) {
_global.BI = {};
} }
!(function (undefined) { !(function (undefined) {
@ -20446,11 +20465,11 @@ if (!window.BI) {
}); });
_.extend(BI, { _.extend(BI, {
getTime: function () { getTime: function () {
if (window.performance && window.performance.now) { if (_global.performance && _global.performance.now) {
return window.performance.now(); return _global.performance.now();
} }
if (window.performance && window.performance.webkitNow) { if (_global.performance && _global.performance.webkitNow) {
return window.performance.webkitNow(); return _global.performance.webkitNow();
} }
if (Date.now) { if (Date.now) {
return Date.now(); return Date.now();
@ -21196,7 +21215,7 @@ BI.OB = function (config) {
if (BI.isFunction(this.props)) { if (BI.isFunction(this.props)) {
props = this.props(config); props = this.props(config);
} }
this.options = (window.$ || window._).extend(this._defaultConfig(config), props, config); this.options = (_global.$ || _global._).extend(this._defaultConfig(config), props, config);
this._init(); this._init();
this._initRef(); this._initRef();
}; };
@ -22850,14 +22869,14 @@ BI.ScalingCellSizeAndPositionManager.prototype = {
if (!attachEvent) { if (!attachEvent) {
var requestFrame = (function () { var requestFrame = (function () {
var raf = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || var raf = _global.requestAnimationFrame || _global.mozRequestAnimationFrame || _global.webkitRequestAnimationFrame ||
function (fn) { return window.setTimeout(fn, 20); }; function (fn) { return _global.setTimeout(fn, 20); };
return function (fn) { return raf(fn); }; return function (fn) { return raf(fn); };
})(); })();
var cancelFrame = (function () { var cancelFrame = (function () {
var cancel = window.cancelAnimationFrame || window.mozCancelAnimationFrame || window.webkitCancelAnimationFrame || var cancel = _global.cancelAnimationFrame || _global.mozCancelAnimationFrame || _global.webkitCancelAnimationFrame ||
window.clearTimeout; _global.clearTimeout;
return function (id) { return cancel(id); }; return function (id) { return cancel(id); };
})(); })();
@ -23325,7 +23344,7 @@ BI.ScalingCellSizeAndPositionManager.prototype = {
return Math.floor(node / 2); return Math.floor(node / 2);
}; };
var Int32Array = window.Int32Array || function (size) { var Int32Array = _global.Int32Array || function (size) {
var xs = []; var xs = [];
for (var i = size - 1; i >= 0; --i) { for (var i = size - 1; i >= 0; --i) {
xs[i] = 0; xs[i] = 0;
@ -25007,8 +25026,18 @@ BI.ShowAction = BI.inherit(BI.Action, {
callback && callback(); callback && callback();
} }
});(function () { });(function () {
if (!window.BI) { var _global;
window.BI = {}; if (typeof window !== "undefined") {
_global = window;
} else if (typeof global !== "undefined") {
_global = global;
} else if (typeof self !== "undefined") {
_global = self;
} else {
_global = this;
}
if (!_global.BI) {
_global.BI = {};
} }
function isEmpty (value) { function isEmpty (value) {
@ -25536,7 +25565,7 @@ BI.ShowAction = BI.inherit(BI.Action, {
try { try {
// 注意0啊 // 注意0啊
// var jo = $.parseJSON(text) || {}; // var jo = $.parseJSON(text) || {};
var jo = $ ? $.parseJSON(text) : window.JSON.parse(text); var jo = $ ? $.parseJSON(text) : _global.JSON.parse(text);
if (jo == null) { if (jo == null) {
jo = {}; jo = {};
} }
@ -25589,7 +25618,7 @@ BI.ShowAction = BI.inherit(BI.Action, {
url = url.replaceAll(BI.keys(BI.specialCharsMap || []).join("|"), function (str) { url = url.replaceAll(BI.keys(BI.specialCharsMap || []).join("|"), function (str) {
return BI.specialCharsMap[str] || str; return BI.specialCharsMap[str] || str;
}); });
return window.encodeURIComponent(url); return _global.encodeURIComponent(url);
}; };
BI.decodeURIComponent = function (url) { BI.decodeURIComponent = function (url) {
@ -25601,7 +25630,7 @@ BI.ShowAction = BI.inherit(BI.Action, {
url = url.replaceAll(BI.keys(reserveSpecialCharsMap || []).join("|"), function (str) { url = url.replaceAll(BI.keys(reserveSpecialCharsMap || []).join("|"), function (str) {
return reserveSpecialCharsMap[str] || str; return reserveSpecialCharsMap[str] || str;
}); });
return window.decodeURIComponent(url); return _global.decodeURIComponent(url);
}; };
BI.contentFormat = function (cv, fmt) { BI.contentFormat = function (cv, fmt) {
@ -27382,9 +27411,9 @@ BI.extend(jQuery.fn, {
var computedStyle = void 0; var computedStyle = void 0;
// W3C Standard // W3C Standard
if (window.getComputedStyle) { if (_global.getComputedStyle) {
// In certain cases such as within an iframe in FF3, this returns null. // In certain cases such as within an iframe in FF3, this returns null.
computedStyle = window.getComputedStyle(node, null); computedStyle = _global.getComputedStyle(node, null);
if (computedStyle) { if (computedStyle) {
return computedStyle.getPropertyValue(BI.hyphenate(name)); return computedStyle.getPropertyValue(BI.hyphenate(name));
} }
@ -29666,14 +29695,14 @@ _.extend(String.prototype, {
} }
};!(function () { };!(function () {
var cancelAnimationFrame = var cancelAnimationFrame =
window.cancelAnimationFrame || _global.cancelAnimationFrame ||
window.webkitCancelAnimationFrame || _global.webkitCancelAnimationFrame ||
window.mozCancelAnimationFrame || _global.mozCancelAnimationFrame ||
window.oCancelAnimationFrame || _global.oCancelAnimationFrame ||
window.msCancelAnimationFrame || _global.msCancelAnimationFrame ||
window.clearTimeout; _global.clearTimeout;
var requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || window.setTimeout; var requestAnimationFrame = _global.requestAnimationFrame || _global.webkitRequestAnimationFrame || _global.mozRequestAnimationFrame || _global.oRequestAnimationFrame || _global.msRequestAnimationFrame || _global.setTimeout;
BI.MouseMoveTracker = function (onMove, onMoveEnd, domNode) { BI.MouseMoveTracker = function (onMove, onMoveEnd, domNode) {
@ -29774,7 +29803,7 @@ _.extend(String.prototype, {
var PIXEL_STEP = 10; var PIXEL_STEP = 10;
var LINE_HEIGHT = 40; var LINE_HEIGHT = 40;
var PAGE_HEIGHT = 800; var PAGE_HEIGHT = 800;
var requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || window.setTimeout; var requestAnimationFrame = _global.requestAnimationFrame || _global.webkitRequestAnimationFrame || _global.mozRequestAnimationFrame || _global.oRequestAnimationFrame || _global.msRequestAnimationFrame || _global.setTimeout;
function normalizeWheel (/* object*/event) /* object*/ { function normalizeWheel (/* object*/event) /* object*/ {
var sX = 0, var sX = 0,

121
dist/fineui.js vendored

@ -99,7 +99,7 @@ if (!Array.prototype.lastIndexOf) {
* Created by wang on 15/6/23. * Created by wang on 15/6/23.
*/ */
// 解决console未定义问题 guy // 解决console未定义问题 guy
window.console = window.console || (function () { _global.console = _global.console || (function () {
var c = {}; var c = {};
c.log = c.warn = c.debug = c.info = c.error = c.time = c.dir = c.profile c.log = c.warn = c.debug = c.info = c.error = c.time = c.dir = c.profile
= c.clear = c.exception = c.trace = c.assert = function () { = c.clear = c.exception = c.trace = c.assert = function () {
@ -109,7 +109,7 @@ window.console = window.console || (function () {
/* /*
* 前端缓存 * 前端缓存
*/ */
window.localStorage || (window.localStorage = { _global.localStorage || (_global.localStorage = {
items: {}, items: {},
setItem: function (k, v) { setItem: function (k, v) {
BI.Cache.addCookie(k, v); BI.Cache.addCookie(k, v);
@ -190,8 +190,8 @@ if(!Date.now) {
this.set = {}; this.set = {};
}; };
}// 修复ie9下sort方法的bug }// 修复ie9下sort方法的bug
!function (window) { !function (_global) {
var ua = window.navigator.userAgent.toLowerCase(), var ua = _global.navigator.userAgent.toLowerCase(),
reg = /msie|applewebkit.+safari/; reg = /msie|applewebkit.+safari/;
if (reg.test(ua)) { if (reg.test(ua)) {
var _sort = Array.prototype.sort; var _sort = Array.prototype.sort;
@ -219,7 +219,7 @@ if(!Date.now) {
}; };
} }
}(window);/*! }(_global);/*!
* jQuery JavaScript Library v1.9.1 * jQuery JavaScript Library v1.9.1
* http://jquery.com/ * http://jquery.com/
* *
@ -19930,16 +19930,35 @@ if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
/** /**
* 初始化BI对象 * 初始化BI对象
*/ */
if (window.BI == null) { var _global;
window.BI = {}; if (typeof window !== "undefined") {
_global = window;
} else if (typeof global !== "undefined") {
_global = global;
} else if (typeof self !== "undefined") {
_global = self;
} else {
_global = this;
}
if (_global.BI == null) {
_global.BI = {};
}/** }/**
* 基本函数 * 基本函数
* Create By GUY 2014\11\17 * Create By GUY 2014\11\17
* *
*/ */
var _global;
if (!window.BI) { if (typeof window !== "undefined") {
window.BI = {}; _global = window;
} else if (typeof global !== "undefined") {
_global = global;
} else if (typeof self !== "undefined") {
_global = self;
} else {
_global = this;
}
if (!_global.BI) {
_global.BI = {};
} }
!(function (undefined) { !(function (undefined) {
@ -20667,11 +20686,11 @@ if (!window.BI) {
}); });
_.extend(BI, { _.extend(BI, {
getTime: function () { getTime: function () {
if (window.performance && window.performance.now) { if (_global.performance && _global.performance.now) {
return window.performance.now(); return _global.performance.now();
} }
if (window.performance && window.performance.webkitNow) { if (_global.performance && _global.performance.webkitNow) {
return window.performance.webkitNow(); return _global.performance.webkitNow();
} }
if (Date.now) { if (Date.now) {
return Date.now(); return Date.now();
@ -21417,7 +21436,7 @@ BI.OB = function (config) {
if (BI.isFunction(this.props)) { if (BI.isFunction(this.props)) {
props = this.props(config); props = this.props(config);
} }
this.options = (window.$ || window._).extend(this._defaultConfig(config), props, config); this.options = (_global.$ || _global._).extend(this._defaultConfig(config), props, config);
this._init(); this._init();
this._initRef(); this._initRef();
}; };
@ -23071,14 +23090,14 @@ BI.ScalingCellSizeAndPositionManager.prototype = {
if (!attachEvent) { if (!attachEvent) {
var requestFrame = (function () { var requestFrame = (function () {
var raf = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || var raf = _global.requestAnimationFrame || _global.mozRequestAnimationFrame || _global.webkitRequestAnimationFrame ||
function (fn) { return window.setTimeout(fn, 20); }; function (fn) { return _global.setTimeout(fn, 20); };
return function (fn) { return raf(fn); }; return function (fn) { return raf(fn); };
})(); })();
var cancelFrame = (function () { var cancelFrame = (function () {
var cancel = window.cancelAnimationFrame || window.mozCancelAnimationFrame || window.webkitCancelAnimationFrame || var cancel = _global.cancelAnimationFrame || _global.mozCancelAnimationFrame || _global.webkitCancelAnimationFrame ||
window.clearTimeout; _global.clearTimeout;
return function (id) { return cancel(id); }; return function (id) { return cancel(id); };
})(); })();
@ -23546,7 +23565,7 @@ BI.ScalingCellSizeAndPositionManager.prototype = {
return Math.floor(node / 2); return Math.floor(node / 2);
}; };
var Int32Array = window.Int32Array || function (size) { var Int32Array = _global.Int32Array || function (size) {
var xs = []; var xs = [];
for (var i = size - 1; i >= 0; --i) { for (var i = size - 1; i >= 0; --i) {
xs[i] = 0; xs[i] = 0;
@ -25228,8 +25247,18 @@ BI.ShowAction = BI.inherit(BI.Action, {
callback && callback(); callback && callback();
} }
});(function () { });(function () {
if (!window.BI) { var _global;
window.BI = {}; if (typeof window !== "undefined") {
_global = window;
} else if (typeof global !== "undefined") {
_global = global;
} else if (typeof self !== "undefined") {
_global = self;
} else {
_global = this;
}
if (!_global.BI) {
_global.BI = {};
} }
function isEmpty (value) { function isEmpty (value) {
@ -25757,7 +25786,7 @@ BI.ShowAction = BI.inherit(BI.Action, {
try { try {
// 注意0啊 // 注意0啊
// var jo = $.parseJSON(text) || {}; // var jo = $.parseJSON(text) || {};
var jo = $ ? $.parseJSON(text) : window.JSON.parse(text); var jo = $ ? $.parseJSON(text) : _global.JSON.parse(text);
if (jo == null) { if (jo == null) {
jo = {}; jo = {};
} }
@ -25810,7 +25839,7 @@ BI.ShowAction = BI.inherit(BI.Action, {
url = url.replaceAll(BI.keys(BI.specialCharsMap || []).join("|"), function (str) { url = url.replaceAll(BI.keys(BI.specialCharsMap || []).join("|"), function (str) {
return BI.specialCharsMap[str] || str; return BI.specialCharsMap[str] || str;
}); });
return window.encodeURIComponent(url); return _global.encodeURIComponent(url);
}; };
BI.decodeURIComponent = function (url) { BI.decodeURIComponent = function (url) {
@ -25822,7 +25851,7 @@ BI.ShowAction = BI.inherit(BI.Action, {
url = url.replaceAll(BI.keys(reserveSpecialCharsMap || []).join("|"), function (str) { url = url.replaceAll(BI.keys(reserveSpecialCharsMap || []).join("|"), function (str) {
return reserveSpecialCharsMap[str] || str; return reserveSpecialCharsMap[str] || str;
}); });
return window.decodeURIComponent(url); return _global.decodeURIComponent(url);
}; };
BI.contentFormat = function (cv, fmt) { BI.contentFormat = function (cv, fmt) {
@ -27603,9 +27632,9 @@ BI.extend(jQuery.fn, {
var computedStyle = void 0; var computedStyle = void 0;
// W3C Standard // W3C Standard
if (window.getComputedStyle) { if (_global.getComputedStyle) {
// In certain cases such as within an iframe in FF3, this returns null. // In certain cases such as within an iframe in FF3, this returns null.
computedStyle = window.getComputedStyle(node, null); computedStyle = _global.getComputedStyle(node, null);
if (computedStyle) { if (computedStyle) {
return computedStyle.getPropertyValue(BI.hyphenate(name)); return computedStyle.getPropertyValue(BI.hyphenate(name));
} }
@ -29887,14 +29916,14 @@ _.extend(String.prototype, {
} }
};!(function () { };!(function () {
var cancelAnimationFrame = var cancelAnimationFrame =
window.cancelAnimationFrame || _global.cancelAnimationFrame ||
window.webkitCancelAnimationFrame || _global.webkitCancelAnimationFrame ||
window.mozCancelAnimationFrame || _global.mozCancelAnimationFrame ||
window.oCancelAnimationFrame || _global.oCancelAnimationFrame ||
window.msCancelAnimationFrame || _global.msCancelAnimationFrame ||
window.clearTimeout; _global.clearTimeout;
var requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || window.setTimeout; var requestAnimationFrame = _global.requestAnimationFrame || _global.webkitRequestAnimationFrame || _global.mozRequestAnimationFrame || _global.oRequestAnimationFrame || _global.msRequestAnimationFrame || _global.setTimeout;
BI.MouseMoveTracker = function (onMove, onMoveEnd, domNode) { BI.MouseMoveTracker = function (onMove, onMoveEnd, domNode) {
@ -29995,7 +30024,7 @@ _.extend(String.prototype, {
var PIXEL_STEP = 10; var PIXEL_STEP = 10;
var LINE_HEIGHT = 40; var LINE_HEIGHT = 40;
var PAGE_HEIGHT = 800; var PAGE_HEIGHT = 800;
var requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || window.setTimeout; var requestAnimationFrame = _global.requestAnimationFrame || _global.webkitRequestAnimationFrame || _global.mozRequestAnimationFrame || _global.oRequestAnimationFrame || _global.msRequestAnimationFrame || _global.setTimeout;
function normalizeWheel (/* object*/event) /* object*/ { function normalizeWheel (/* object*/event) /* object*/ {
var sX = 0, var sX = 0,
@ -35494,7 +35523,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
function handler (event) { function handler (event) {
var orgEvent = event || window.event, var orgEvent = event || _global.event,
args = slice.call(arguments, 1), args = slice.call(arguments, 1),
delta = 0, delta = 0,
deltaX = 0, deltaX = 0,
@ -37142,8 +37171,8 @@ BI.TreeView = BI.inherit(BI.Pane, {
treeNode.times = treeNode.times || 1; treeNode.times = treeNode.times || 1;
var param = "id=" + treeNode.id var param = "id=" + treeNode.id
+ "&times=" + (treeNode.times++) + "&times=" + (treeNode.times++)
+ "&parentValues= " + window.encodeURIComponent(BI.jsonEncode(parentNode)) + "&parentValues= " + _global.encodeURIComponent(BI.jsonEncode(parentNode))
+ "&checkState=" + window.encodeURIComponent(BI.jsonEncode(treeNode.getCheckStatus())); + "&checkState=" + _global.encodeURIComponent(BI.jsonEncode(treeNode.getCheckStatus()));
return "&" + param; return "&" + param;
} }
@ -44633,7 +44662,7 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
}, },
false false
); );
xhr.open("post", handler.url + "&filename=" + window.encodeURIComponent(handler.file.fileName), true); xhr.open("post", handler.url + "&filename=" + _global.encodeURIComponent(handler.file.fileName), true);
if (!xhr.upload) { if (!xhr.upload) {
var rpe = {loaded: 0, total: handler.file.fileSize || handler.file.size, simulation: true}; var rpe = {loaded: 0, total: handler.file.fileSize || handler.file.size, simulation: true};
rpe.interval = setInterval(function () { rpe.interval = setInterval(function () {
@ -44744,7 +44773,7 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
handler.attach_array.push(attachO); handler.attach_array.push(attachO);
} }
} catch (e) { } catch (e) {
if (isFunction(handler.onerror)) {handler.onerror(rpe, event || window.event);} if (isFunction(handler.onerror)) {handler.onerror(rpe, event || _global.event);}
} }
if (isFunction(handler.onload)) {handler.onload(rpe, {responseText: responseText});} if (isFunction(handler.onload)) {handler.onload(rpe, {responseText: responseText});}
}, },
@ -44764,7 +44793,7 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
iframe.onload = onload; iframe.onload = onload;
iframe.onerror = function (event) { iframe.onerror = function (event) {
if (isFunction(handler.onerror)) { if (isFunction(handler.onerror)) {
handler.onerror(rpe, event || window.event); handler.onerror(rpe, event || _global.event);
} }
}; };
iframe.onreadystatechange = function () { iframe.onreadystatechange = function () {
@ -44786,7 +44815,7 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
}); });
} }
}; };
form.setAttribute("action", handler.url + "&filename=" + window.encodeURIComponent(handler.file.fileName)); form.setAttribute("action", handler.url + "&filename=" + _global.encodeURIComponent(handler.file.fileName));
form.setAttribute("target", iframe.id); form.setAttribute("target", iframe.id);
form.setAttribute("method", "post"); form.setAttribute("method", "post");
form.appendChild(handler.file); form.appendChild(handler.file);
@ -82026,8 +82055,8 @@ BI.shortcut("bi.value_chooser_pane", BI.ValueChooserPane);;(function () {
// Ensure that `History` can be used outside of the browser. // Ensure that `History` can be used outside of the browser.
if (typeof window !== "undefined") { if (typeof window !== "undefined") {
this.location = window.location; this.location = _global.location;
this.history = window.history; this.history = _global.history;
} }
}; };
@ -82145,7 +82174,7 @@ BI.shortcut("bi.value_chooser_pane", BI.ValueChooserPane);;(function () {
} }
// Add a cross-platform `addEventListener` shim for older browsers. // Add a cross-platform `addEventListener` shim for older browsers.
var addEventListener = window.addEventListener || function (eventName, listener) { var addEventListener = _global.addEventListener || function (eventName, listener) {
return attachEvent("on" + eventName, listener); return attachEvent("on" + eventName, listener);
}; };
@ -82166,7 +82195,7 @@ BI.shortcut("bi.value_chooser_pane", BI.ValueChooserPane);;(function () {
// but possibly useful for unit testing Routers. // but possibly useful for unit testing Routers.
stop: function () { stop: function () {
// Add a cross-platform `removeEventListener` shim for older browsers. // Add a cross-platform `removeEventListener` shim for older browsers.
var removeEventListener = window.removeEventListener || function (eventName, listener) { var removeEventListener = _global.removeEventListener || function (eventName, listener) {
return detachEvent("on" + eventName, listener); return detachEvent("on" + eventName, listener);
}; };

70
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

10
dist/polyfill.js vendored

@ -99,7 +99,7 @@ if (!Array.prototype.lastIndexOf) {
* Created by wang on 15/6/23. * Created by wang on 15/6/23.
*/ */
// 解决console未定义问题 guy // 解决console未定义问题 guy
window.console = window.console || (function () { _global.console = _global.console || (function () {
var c = {}; var c = {};
c.log = c.warn = c.debug = c.info = c.error = c.time = c.dir = c.profile c.log = c.warn = c.debug = c.info = c.error = c.time = c.dir = c.profile
= c.clear = c.exception = c.trace = c.assert = function () { = c.clear = c.exception = c.trace = c.assert = function () {
@ -109,7 +109,7 @@ window.console = window.console || (function () {
/* /*
* 前端缓存 * 前端缓存
*/ */
window.localStorage || (window.localStorage = { _global.localStorage || (_global.localStorage = {
items: {}, items: {},
setItem: function (k, v) { setItem: function (k, v) {
BI.Cache.addCookie(k, v); BI.Cache.addCookie(k, v);
@ -190,8 +190,8 @@ if(!Date.now) {
this.set = {}; this.set = {};
}; };
}// 修复ie9下sort方法的bug }// 修复ie9下sort方法的bug
!function (window) { !function (_global) {
var ua = window.navigator.userAgent.toLowerCase(), var ua = _global.navigator.userAgent.toLowerCase(),
reg = /msie|applewebkit.+safari/; reg = /msie|applewebkit.+safari/;
if (reg.test(ua)) { if (reg.test(ua)) {
var _sort = Array.prototype.sort; var _sort = Array.prototype.sort;
@ -219,4 +219,4 @@ if(!Date.now) {
}; };
} }
}(window); }(_global);

8
dist/router.js vendored

@ -318,8 +318,8 @@
// Ensure that `History` can be used outside of the browser. // Ensure that `History` can be used outside of the browser.
if (typeof window !== "undefined") { if (typeof window !== "undefined") {
this.location = window.location; this.location = _global.location;
this.history = window.history; this.history = _global.history;
} }
}; };
@ -437,7 +437,7 @@
} }
// Add a cross-platform `addEventListener` shim for older browsers. // Add a cross-platform `addEventListener` shim for older browsers.
var addEventListener = window.addEventListener || function (eventName, listener) { var addEventListener = _global.addEventListener || function (eventName, listener) {
return attachEvent("on" + eventName, listener); return attachEvent("on" + eventName, listener);
}; };
@ -458,7 +458,7 @@
// but possibly useful for unit testing Routers. // but possibly useful for unit testing Routers.
stop: function () { stop: function () {
// Add a cross-platform `removeEventListener` shim for older browsers. // Add a cross-platform `removeEventListener` shim for older browsers.
var removeEventListener = window.removeEventListener || function (eventName, listener) { var removeEventListener = _global.removeEventListener || function (eventName, listener) {
return detachEvent("on" + eventName, listener); return detachEvent("on" + eventName, listener);
}; };

69
dist/utils.js vendored

@ -10094,8 +10094,18 @@
/** /**
* 初始化BI对象 * 初始化BI对象
*/ */
if (window.BI == null) { var _global;
window.BI = {}; if (typeof window !== "undefined") {
_global = window;
} else if (typeof global !== "undefined") {
_global = global;
} else if (typeof self !== "undefined") {
_global = self;
} else {
_global = this;
}
if (_global.BI == null) {
_global.BI = {};
}/** }/**
* 常量 * 常量
*/ */
@ -10938,9 +10948,18 @@ Function.prototype.after = function (func) {
* Create By GUY 2014\11\17 * Create By GUY 2014\11\17
* *
*/ */
var _global;
if (!window.BI) { if (typeof window !== "undefined") {
window.BI = {}; _global = window;
} else if (typeof global !== "undefined") {
_global = global;
} else if (typeof self !== "undefined") {
_global = self;
} else {
_global = this;
}
if (!_global.BI) {
_global.BI = {};
} }
!(function (undefined) { !(function (undefined) {
@ -11668,11 +11687,11 @@ if (!window.BI) {
}); });
_.extend(BI, { _.extend(BI, {
getTime: function () { getTime: function () {
if (window.performance && window.performance.now) { if (_global.performance && _global.performance.now) {
return window.performance.now(); return _global.performance.now();
} }
if (window.performance && window.performance.webkitNow) { if (_global.performance && _global.performance.webkitNow) {
return window.performance.webkitNow(); return _global.performance.webkitNow();
} }
if (Date.now) { if (Date.now) {
return Date.now(); return Date.now();
@ -12418,7 +12437,7 @@ BI.OB = function (config) {
if (BI.isFunction(this.props)) { if (BI.isFunction(this.props)) {
props = this.props(config); props = this.props(config);
} }
this.options = (window.$ || window._).extend(this._defaultConfig(config), props, config); this.options = (_global.$ || _global._).extend(this._defaultConfig(config), props, config);
this._init(); this._init();
this._initRef(); this._initRef();
}; };
@ -12560,8 +12579,18 @@ _.extend(BI.OB.prototype, {
this.purgeListeners(); this.purgeListeners();
} }
});(function () { });(function () {
if (!window.BI) { var _global;
window.BI = {}; if (typeof window !== "undefined") {
_global = window;
} else if (typeof global !== "undefined") {
_global = global;
} else if (typeof self !== "undefined") {
_global = self;
} else {
_global = this;
}
if (!_global.BI) {
_global.BI = {};
} }
function isEmpty (value) { function isEmpty (value) {
@ -13089,7 +13118,7 @@ _.extend(BI.OB.prototype, {
try { try {
// 注意0啊 // 注意0啊
// var jo = $.parseJSON(text) || {}; // var jo = $.parseJSON(text) || {};
var jo = $ ? $.parseJSON(text) : window.JSON.parse(text); var jo = $ ? $.parseJSON(text) : _global.JSON.parse(text);
if (jo == null) { if (jo == null) {
jo = {}; jo = {};
} }
@ -13142,7 +13171,7 @@ _.extend(BI.OB.prototype, {
url = url.replaceAll(BI.keys(BI.specialCharsMap || []).join("|"), function (str) { url = url.replaceAll(BI.keys(BI.specialCharsMap || []).join("|"), function (str) {
return BI.specialCharsMap[str] || str; return BI.specialCharsMap[str] || str;
}); });
return window.encodeURIComponent(url); return _global.encodeURIComponent(url);
}; };
BI.decodeURIComponent = function (url) { BI.decodeURIComponent = function (url) {
@ -13154,7 +13183,7 @@ _.extend(BI.OB.prototype, {
url = url.replaceAll(BI.keys(reserveSpecialCharsMap || []).join("|"), function (str) { url = url.replaceAll(BI.keys(reserveSpecialCharsMap || []).join("|"), function (str) {
return reserveSpecialCharsMap[str] || str; return reserveSpecialCharsMap[str] || str;
}); });
return window.decodeURIComponent(url); return _global.decodeURIComponent(url);
}; };
BI.contentFormat = function (cv, fmt) { BI.contentFormat = function (cv, fmt) {
@ -14621,14 +14650,14 @@ BI.ScalingCellSizeAndPositionManager.prototype = {
if (!attachEvent) { if (!attachEvent) {
var requestFrame = (function () { var requestFrame = (function () {
var raf = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || var raf = _global.requestAnimationFrame || _global.mozRequestAnimationFrame || _global.webkitRequestAnimationFrame ||
function (fn) { return window.setTimeout(fn, 20); }; function (fn) { return _global.setTimeout(fn, 20); };
return function (fn) { return raf(fn); }; return function (fn) { return raf(fn); };
})(); })();
var cancelFrame = (function () { var cancelFrame = (function () {
var cancel = window.cancelAnimationFrame || window.mozCancelAnimationFrame || window.webkitCancelAnimationFrame || var cancel = _global.cancelAnimationFrame || _global.mozCancelAnimationFrame || _global.webkitCancelAnimationFrame ||
window.clearTimeout; _global.clearTimeout;
return function (id) { return cancel(id); }; return function (id) { return cancel(id); };
})(); })();
@ -15096,7 +15125,7 @@ BI.ScalingCellSizeAndPositionManager.prototype = {
return Math.floor(node / 2); return Math.floor(node / 2);
}; };
var Int32Array = window.Int32Array || function (size) { var Int32Array = _global.Int32Array || function (size) {
var xs = []; var xs = [];
for (var i = size - 1; i >= 0; --i) { for (var i = size - 1; i >= 0; --i) {
xs[i] = 0; xs[i] = 0;

6
dist/utils.min.js vendored

File diff suppressed because one or more lines are too long

8
src/base/single/input/file.js

@ -153,7 +153,7 @@
}, },
false false
); );
xhr.open("post", handler.url + "&filename=" + window.encodeURIComponent(handler.file.fileName), true); xhr.open("post", handler.url + "&filename=" + _global.encodeURIComponent(handler.file.fileName), true);
if (!xhr.upload) { if (!xhr.upload) {
var rpe = {loaded: 0, total: handler.file.fileSize || handler.file.size, simulation: true}; var rpe = {loaded: 0, total: handler.file.fileSize || handler.file.size, simulation: true};
rpe.interval = setInterval(function () { rpe.interval = setInterval(function () {
@ -264,7 +264,7 @@
handler.attach_array.push(attachO); handler.attach_array.push(attachO);
} }
} catch (e) { } catch (e) {
if (isFunction(handler.onerror)) {handler.onerror(rpe, event || window.event);} if (isFunction(handler.onerror)) {handler.onerror(rpe, event || _global.event);}
} }
if (isFunction(handler.onload)) {handler.onload(rpe, {responseText: responseText});} if (isFunction(handler.onload)) {handler.onload(rpe, {responseText: responseText});}
}, },
@ -284,7 +284,7 @@
iframe.onload = onload; iframe.onload = onload;
iframe.onerror = function (event) { iframe.onerror = function (event) {
if (isFunction(handler.onerror)) { if (isFunction(handler.onerror)) {
handler.onerror(rpe, event || window.event); handler.onerror(rpe, event || _global.event);
} }
}; };
iframe.onreadystatechange = function () { iframe.onreadystatechange = function () {
@ -306,7 +306,7 @@
}); });
} }
}; };
form.setAttribute("action", handler.url + "&filename=" + window.encodeURIComponent(handler.file.fileName)); form.setAttribute("action", handler.url + "&filename=" + _global.encodeURIComponent(handler.file.fileName));
form.setAttribute("target", iframe.id); form.setAttribute("target", iframe.id);
form.setAttribute("method", "post"); form.setAttribute("method", "post");
form.appendChild(handler.file); form.appendChild(handler.file);

4
src/base/tree/treeview.js

@ -114,8 +114,8 @@ BI.TreeView = BI.inherit(BI.Pane, {
treeNode.times = treeNode.times || 1; treeNode.times = treeNode.times || 1;
var param = "id=" + treeNode.id var param = "id=" + treeNode.id
+ "&times=" + (treeNode.times++) + "&times=" + (treeNode.times++)
+ "&parentValues= " + window.encodeURIComponent(BI.jsonEncode(parentNode)) + "&parentValues= " + _global.encodeURIComponent(BI.jsonEncode(parentNode))
+ "&checkState=" + window.encodeURIComponent(BI.jsonEncode(treeNode.getCheckStatus())); + "&checkState=" + _global.encodeURIComponent(BI.jsonEncode(treeNode.getCheckStatus()));
return "&" + param; return "&" + param;
} }

20
src/core/alias.js

@ -1,6 +1,16 @@
(function () { (function () {
if (!window.BI) { var _global;
window.BI = {}; if (typeof window !== "undefined") {
_global = window;
} else if (typeof global !== "undefined") {
_global = global;
} else if (typeof self !== "undefined") {
_global = self;
} else {
_global = this;
}
if (!_global.BI) {
_global.BI = {};
} }
function isEmpty (value) { function isEmpty (value) {
@ -528,7 +538,7 @@
try { try {
// 注意0啊 // 注意0啊
// var jo = $.parseJSON(text) || {}; // var jo = $.parseJSON(text) || {};
var jo = $ ? $.parseJSON(text) : window.JSON.parse(text); var jo = $ ? $.parseJSON(text) : _global.JSON.parse(text);
if (jo == null) { if (jo == null) {
jo = {}; jo = {};
} }
@ -581,7 +591,7 @@
url = url.replaceAll(BI.keys(BI.specialCharsMap || []).join("|"), function (str) { url = url.replaceAll(BI.keys(BI.specialCharsMap || []).join("|"), function (str) {
return BI.specialCharsMap[str] || str; return BI.specialCharsMap[str] || str;
}); });
return window.encodeURIComponent(url); return _global.encodeURIComponent(url);
}; };
BI.decodeURIComponent = function (url) { BI.decodeURIComponent = function (url) {
@ -593,7 +603,7 @@
url = url.replaceAll(BI.keys(reserveSpecialCharsMap || []).join("|"), function (str) { url = url.replaceAll(BI.keys(reserveSpecialCharsMap || []).join("|"), function (str) {
return reserveSpecialCharsMap[str] || str; return reserveSpecialCharsMap[str] || str;
}); });
return window.decodeURIComponent(url); return _global.decodeURIComponent(url);
}; };
BI.contentFormat = function (cv, fmt) { BI.contentFormat = function (cv, fmt) {

23
src/core/base.js

@ -3,9 +3,18 @@
* Create By GUY 2014\11\17 * Create By GUY 2014\11\17
* *
*/ */
var _global;
if (!window.BI) { if (typeof window !== "undefined") {
window.BI = {}; _global = window;
} else if (typeof global !== "undefined") {
_global = global;
} else if (typeof self !== "undefined") {
_global = self;
} else {
_global = this;
}
if (!_global.BI) {
_global.BI = {};
} }
!(function (undefined) { !(function (undefined) {
@ -733,11 +742,11 @@ if (!window.BI) {
}); });
_.extend(BI, { _.extend(BI, {
getTime: function () { getTime: function () {
if (window.performance && window.performance.now) { if (_global.performance && _global.performance.now) {
return window.performance.now(); return _global.performance.now();
} }
if (window.performance && window.performance.webkitNow) { if (_global.performance && _global.performance.webkitNow) {
return window.performance.webkitNow(); return _global.performance.webkitNow();
} }
if (Date.now) { if (Date.now) {
return Date.now(); return Date.now();

14
src/core/foundation.js vendored

@ -4,6 +4,16 @@
/** /**
* 初始化BI对象 * 初始化BI对象
*/ */
if (window.BI == null) { var _global;
window.BI = {}; if (typeof window !== "undefined") {
_global = window;
} else if (typeof global !== "undefined") {
_global = global;
} else if (typeof self !== "undefined") {
_global = self;
} else {
_global = this;
}
if (_global.BI == null) {
_global.BI = {};
} }

4
src/core/func/dom.js

@ -90,9 +90,9 @@ BI.extend(jQuery.fn, {
var computedStyle = void 0; var computedStyle = void 0;
// W3C Standard // W3C Standard
if (window.getComputedStyle) { if (_global.getComputedStyle) {
// In certain cases such as within an iframe in FF3, this returns null. // In certain cases such as within an iframe in FF3, this returns null.
computedStyle = window.getComputedStyle(node, null); computedStyle = _global.getComputedStyle(node, null);
if (computedStyle) { if (computedStyle) {
return computedStyle.getPropertyValue(BI.hyphenate(name)); return computedStyle.getPropertyValue(BI.hyphenate(name));
} }

2
src/core/ob.js

@ -8,7 +8,7 @@ BI.OB = function (config) {
if (BI.isFunction(this.props)) { if (BI.isFunction(this.props)) {
props = this.props(config); props = this.props(config);
} }
this.options = (window.$ || window._).extend(this._defaultConfig(config), props, config); this.options = (_global.$ || _global._).extend(this._defaultConfig(config), props, config);
this._init(); this._init();
this._initRef(); this._initRef();
}; };

8
src/core/utils/detectElementResize.js

@ -13,14 +13,14 @@
if (!attachEvent) { if (!attachEvent) {
var requestFrame = (function () { var requestFrame = (function () {
var raf = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || var raf = _global.requestAnimationFrame || _global.mozRequestAnimationFrame || _global.webkitRequestAnimationFrame ||
function (fn) { return window.setTimeout(fn, 20); }; function (fn) { return _global.setTimeout(fn, 20); };
return function (fn) { return raf(fn); }; return function (fn) { return raf(fn); };
})(); })();
var cancelFrame = (function () { var cancelFrame = (function () {
var cancel = window.cancelAnimationFrame || window.mozCancelAnimationFrame || window.webkitCancelAnimationFrame || var cancel = _global.cancelAnimationFrame || _global.mozCancelAnimationFrame || _global.webkitCancelAnimationFrame ||
window.clearTimeout; _global.clearTimeout;
return function (id) { return cancel(id); }; return function (id) { return cancel(id); };
})(); })();

14
src/core/utils/events/mousemovetracker.js

@ -1,13 +1,13 @@
!(function () { !(function () {
var cancelAnimationFrame = var cancelAnimationFrame =
window.cancelAnimationFrame || _global.cancelAnimationFrame ||
window.webkitCancelAnimationFrame || _global.webkitCancelAnimationFrame ||
window.mozCancelAnimationFrame || _global.mozCancelAnimationFrame ||
window.oCancelAnimationFrame || _global.oCancelAnimationFrame ||
window.msCancelAnimationFrame || _global.msCancelAnimationFrame ||
window.clearTimeout; _global.clearTimeout;
var requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || window.setTimeout; var requestAnimationFrame = _global.requestAnimationFrame || _global.webkitRequestAnimationFrame || _global.mozRequestAnimationFrame || _global.oRequestAnimationFrame || _global.msRequestAnimationFrame || _global.setTimeout;
BI.MouseMoveTracker = function (onMove, onMoveEnd, domNode) { BI.MouseMoveTracker = function (onMove, onMoveEnd, domNode) {

2
src/core/utils/events/wheelhandler.js

@ -2,7 +2,7 @@
var PIXEL_STEP = 10; var PIXEL_STEP = 10;
var LINE_HEIGHT = 40; var LINE_HEIGHT = 40;
var PAGE_HEIGHT = 800; var PAGE_HEIGHT = 800;
var requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || window.setTimeout; var requestAnimationFrame = _global.requestAnimationFrame || _global.webkitRequestAnimationFrame || _global.mozRequestAnimationFrame || _global.oRequestAnimationFrame || _global.msRequestAnimationFrame || _global.setTimeout;
function normalizeWheel (/* object*/event) /* object*/ { function normalizeWheel (/* object*/event) /* object*/ {
var sX = 0, var sX = 0,

2
src/core/utils/prefixIntervalTree.js

@ -4,7 +4,7 @@
return Math.floor(node / 2); return Math.floor(node / 2);
}; };
var Int32Array = window.Int32Array || function (size) { var Int32Array = _global.Int32Array || function (size) {
var xs = []; var xs = [];
for (var i = size - 1; i >= 0; --i) { for (var i = size - 1; i >= 0; --i) {
xs[i] = 0; xs[i] = 0;

2
src/polyfill/console.js

@ -3,7 +3,7 @@
* Created by wang on 15/6/23. * Created by wang on 15/6/23.
*/ */
// 解决console未定义问题 guy // 解决console未定义问题 guy
window.console = window.console || (function () { _global.console = _global.console || (function () {
var c = {}; var c = {};
c.log = c.warn = c.debug = c.info = c.error = c.time = c.dir = c.profile c.log = c.warn = c.debug = c.info = c.error = c.time = c.dir = c.profile
= c.clear = c.exception = c.trace = c.assert = function () { = c.clear = c.exception = c.trace = c.assert = function () {

2
src/polyfill/localStorage.js

@ -1,7 +1,7 @@
/* /*
* 前端缓存 * 前端缓存
*/ */
window.localStorage || (window.localStorage = { _global.localStorage || (_global.localStorage = {
items: {}, items: {},
setItem: function (k, v) { setItem: function (k, v) {
BI.Cache.addCookie(k, v); BI.Cache.addCookie(k, v);

6
src/polyfill/sort.js

@ -1,6 +1,6 @@
// 修复ie9下sort方法的bug // 修复ie9下sort方法的bug
!function (window) { !function (_global) {
var ua = window.navigator.userAgent.toLowerCase(), var ua = _global.navigator.userAgent.toLowerCase(),
reg = /msie|applewebkit.+safari/; reg = /msie|applewebkit.+safari/;
if (reg.test(ua)) { if (reg.test(ua)) {
var _sort = Array.prototype.sort; var _sort = Array.prototype.sort;
@ -28,4 +28,4 @@
}; };
} }
}(window); }(_global);

8
src/router/router.js

@ -318,8 +318,8 @@
// Ensure that `History` can be used outside of the browser. // Ensure that `History` can be used outside of the browser.
if (typeof window !== "undefined") { if (typeof window !== "undefined") {
this.location = window.location; this.location = _global.location;
this.history = window.history; this.history = _global.history;
} }
}; };
@ -437,7 +437,7 @@
} }
// Add a cross-platform `addEventListener` shim for older browsers. // Add a cross-platform `addEventListener` shim for older browsers.
var addEventListener = window.addEventListener || function (eventName, listener) { var addEventListener = _global.addEventListener || function (eventName, listener) {
return attachEvent("on" + eventName, listener); return attachEvent("on" + eventName, listener);
}; };
@ -458,7 +458,7 @@
// but possibly useful for unit testing Routers. // but possibly useful for unit testing Routers.
stop: function () { stop: function () {
// Add a cross-platform `removeEventListener` shim for older browsers. // Add a cross-platform `removeEventListener` shim for older browsers.
var removeEventListener = window.removeEventListener || function (eventName, listener) { var removeEventListener = _global.removeEventListener || function (eventName, listener) {
return detachEvent("on" + eventName, listener); return detachEvent("on" + eventName, listener);
}; };

2
src/third/jquery.mousewheel.js

@ -72,7 +72,7 @@
function handler (event) { function handler (event) {
var orgEvent = event || window.event, var orgEvent = event || _global.event,
args = slice.call(arguments, 1), args = slice.call(arguments, 1),
delta = 0, delta = 0,
deltaX = 0, deltaX = 0,

Loading…
Cancel
Save