Browse Source

Merge pull request #673 in VISUAL/fineui from ~IMP/fineui_fui:master to master

* commit 'c789c0abf8b5a9c421789dc97f9dcc1c431c796a':
  打包问题
  移动端报错
  移动端utils方法
master
guy 6 years ago
parent
commit
0c66be08b1
  1. 10
      Gruntfile.js
  2. 26774
      dist/base.js
  3. 165116
      dist/bundle.js
  4. 2
      dist/bundle.min.css
  5. 48
      dist/bundle.min.js
  6. 19582
      dist/case.js
  7. 344
      dist/config.js
  8. 67900
      dist/core.js
  9. 27028
      dist/demo.js
  10. 165228
      dist/fineui.js
  11. 2
      dist/fineui.min.css
  12. 48
      dist/fineui.min.js
  13. 8
      dist/fineui_without_jquery_polyfill.js
  14. 484
      dist/polyfill.js
  15. 1168
      dist/router.js
  16. 31444
      dist/utils.js
  17. 6
      dist/utils.min.js
  18. 46004
      dist/widget.js
  19. 6
      src/core/func/date.js
  20. 2
      src/core/func/function.js

10
Gruntfile.js

@ -176,11 +176,11 @@ module.exports = function (grunt) {
"src/core/foundation.js", "src/core/foundation.js",
"src/core/lodash.js", "src/core/lodash.js",
"src/core/var.js", "src/core/var.js",
"src/core/proto/array.js", "src/core/func/array.js",
"src/core/proto/number.js", "src/core/func/number.js",
"src/core/proto/string.js", "src/core/func/string.js",
"src/core/proto/date.js", "src/core/func/date.js",
"src/core/proto/function.js", "src/core/func/function.js",
"src/core/base.js", "src/core/base.js",
"src/core/ob.js", "src/core/ob.js",
"src/core/alias.js", "src/core/alias.js",

26774
dist/base.js vendored

File diff suppressed because it is too large Load Diff

165116
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

48
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

19582
dist/case.js vendored

File diff suppressed because it is too large Load Diff

344
dist/config.js vendored

@ -1,173 +1,173 @@
BI.resourceURL = "resource/"; BI.resourceURL = "resource/";
BI.i18n = { BI.i18n = {
"BI-Multi_Date_Quarter_End": "季度末", "BI-Multi_Date_Quarter_End": "季度末",
"BI-Multi_Date_Month_Begin": "月初", "BI-Multi_Date_Month_Begin": "月初",
"BI-Multi_Date_YMD": "年/月/日", "BI-Multi_Date_YMD": "年/月/日",
"BI-Custom_Color": "自定义颜色", "BI-Custom_Color": "自定义颜色",
"BI-Numerical_Interval_Input_Data": "请输入数值", "BI-Numerical_Interval_Input_Data": "请输入数值",
"BI-Please_Input_Natural_Number": "请输入非负整数", "BI-Please_Input_Natural_Number": "请输入非负整数",
"BI-No_More_Data": "无更多数据", "BI-No_More_Data": "无更多数据",
"BI-Basic_Altogether": "共", "BI-Basic_Altogether": "共",
"BI-Basic_Sunday": "星期日", "BI-Basic_Sunday": "星期日",
"BI-Widget_Background_Colour": "组件背景", "BI-Widget_Background_Colour": "组件背景",
"BI-Color_Picker_Error_Text": "请输入0~255的正整数", "BI-Color_Picker_Error_Text": "请输入0~255的正整数",
"BI-Multi_Date_Month": "月", "BI-Multi_Date_Month": "月",
"BI-No_Selected_Item": "没有可选项", "BI-No_Selected_Item": "没有可选项",
"BI-Multi_Date_Year_Begin": "年初", "BI-Multi_Date_Year_Begin": "年初",
"BI-Quarter_1": "第1季度", "BI-Quarter_1": "第1季度",
"BI-Quarter_2": "第2季度", "BI-Quarter_2": "第2季度",
"BI-Quarter_3": "第3季度", "BI-Quarter_3": "第3季度",
"BI-Quarter_4": "第4季度", "BI-Quarter_4": "第4季度",
"BI-Multi_Date_Year_Next": "年后", "BI-Multi_Date_Year_Next": "年后",
"BI-Multi_Date_Month_Prev": "个月前", "BI-Multi_Date_Month_Prev": "个月前",
"BI-Month_Trigger_Error_Text": "请输入1~12的正整数", "BI-Month_Trigger_Error_Text": "请输入1~12的正整数",
"BI-Less_And_Equal": "小于等于", "BI-Less_And_Equal": "小于等于",
"BI-Year_Trigger_Invalid_Text": "请输入有效时间", "BI-Year_Trigger_Invalid_Text": "请输入有效时间",
"BI-Multi_Date_Week_Next": "周后", "BI-Multi_Date_Week_Next": "周后",
"BI-Font_Size": "字号", "BI-Font_Size": "字号",
"BI-Basic_Total": "共", "BI-Basic_Total": "共",
"BI-Already_Selected": "已选择", "BI-Already_Selected": "已选择",
"BI-Formula_Insert": "插入", "BI-Formula_Insert": "插入",
"BI-Select_All": "全选", "BI-Select_All": "全选",
"BI-Basic_Tuesday": "星期二", "BI-Basic_Tuesday": "星期二",
"BI-Multi_Date_Month_End": "月末", "BI-Multi_Date_Month_End": "月末",
"BI-Load_More": "点击加载更多数据", "BI-Load_More": "点击加载更多数据",
"BI-Basic_September": "九月", "BI-Basic_September": "九月",
"BI-Current_Is_Last_Page": "当前已是最后一页", "BI-Current_Is_Last_Page": "当前已是最后一页",
"BI-Basic_Auto": "自动", "BI-Basic_Auto": "自动",
"BI-Basic_Count": "个", "BI-Basic_Count": "个",
"BI-Basic_Value": "值", "BI-Basic_Value": "值",
"BI-Basic_Unrestricted": "无限制", "BI-Basic_Unrestricted": "无限制",
"BI-Quarter_Trigger_Error_Text": "请输入1~4的正整数", "BI-Quarter_Trigger_Error_Text": "请输入1~4的正整数",
"BI-Basic_More": "更多", "BI-Basic_More": "更多",
"BI-Basic_Wednesday": "星期三", "BI-Basic_Wednesday": "星期三",
"BI-Basic_Bold": "加粗", "BI-Basic_Bold": "加粗",
"BI-Basic_Simple_Saturday": "六", "BI-Basic_Simple_Saturday": "六",
"BI-Multi_Date_Month_Next": "个月后", "BI-Multi_Date_Month_Next": "个月后",
"BI-Basic_March": "三月", "BI-Basic_March": "三月",
"BI-Current_Is_First_Page": "当前已是第一页", "BI-Current_Is_First_Page": "当前已是第一页",
"BI-Basic_Thursday": "星期四", "BI-Basic_Thursday": "星期四",
"BI-Basic_Prompt": "提示", "BI-Basic_Prompt": "提示",
"BI-Multi_Date_Today": "今天", "BI-Multi_Date_Today": "今天",
"BI-Multi_Date_Quarter_Prev": "个季度前", "BI-Multi_Date_Quarter_Prev": "个季度前",
"BI-Row_Header": "行表头", "BI-Row_Header": "行表头",
"BI-Date_Trigger_Error_Text": "日期格式示例:2015-3-11", "BI-Date_Trigger_Error_Text": "日期格式示例:2015-3-11",
"BI-Basic_Cancel": "取消", "BI-Basic_Cancel": "取消",
"BI-Basic_January": "一月", "BI-Basic_January": "一月",
"BI-Basic_June": "六月", "BI-Basic_June": "六月",
"BI-Basic_July": "七月", "BI-Basic_July": "七月",
"BI-Basic_April": "四月", "BI-Basic_April": "四月",
"BI-Multi_Date_Quarter_Begin": "季度初", "BI-Multi_Date_Quarter_Begin": "季度初",
"BI-Multi_Date_Week": "周", "BI-Multi_Date_Week": "周",
"BI-Click_Blank_To_Select": "点击\"空格键\"选中完全匹配项", "BI-Click_Blank_To_Select": "点击\"空格键\"选中完全匹配项",
"BI-Basic_August": "八月", "BI-Basic_August": "八月",
"BI-Word_Align_Left": "文字居左", "BI-Word_Align_Left": "文字居左",
"BI-Basic_November": "十一月", "BI-Basic_November": "十一月",
"BI-Font_Colour": "字体颜色", "BI-Font_Colour": "字体颜色",
"BI-Multi_Date_Day_Prev": "天前", "BI-Multi_Date_Day_Prev": "天前",
"BI-Select_Part": "部分选择", "BI-Select_Part": "部分选择",
"BI-Multi_Date_Day_Next": "天后", "BI-Multi_Date_Day_Next": "天后",
"BI-Less_Than": "小于", "BI-Less_Than": "小于",
"BI-Basic_February": "二月", "BI-Basic_February": "二月",
"BI-Multi_Date_Year": "年", "BI-Multi_Date_Year": "年",
"BI-Number_Index": "序号", "BI-Number_Index": "序号",
"BI-Multi_Date_Week_Prev": "周前", "BI-Multi_Date_Week_Prev": "周前",
"BI-Next_Page": "下一页", "BI-Next_Page": "下一页",
"BI-Right_Page": "向右翻页", "BI-Right_Page": "向右翻页",
"BI-Numerical_Interval_Signal_Value": "前后值相等,请将操作符改为“≤”", "BI-Numerical_Interval_Signal_Value": "前后值相等,请将操作符改为“≤”",
"BI-Basic_December": "十二月", "BI-Basic_December": "十二月",
"BI-Basic_Saturday": "星期六", "BI-Basic_Saturday": "星期六",
"BI-Basic_Simple_Wednesday": "三", "BI-Basic_Simple_Wednesday": "三",
"BI-Multi_Date_Quarter_Next": "个季度后", "BI-Multi_Date_Quarter_Next": "个季度后",
"BI-Basic_October": "十月", "BI-Basic_October": "十月",
"BI-Basic_Simple_Friday": "五", "BI-Basic_Simple_Friday": "五",
"BI-Basic_Save": "保存", "BI-Basic_Save": "保存",
"BI-Numerical_Interval_Number_Value": "请保证前面的数值小于/等于后面的数值", "BI-Numerical_Interval_Number_Value": "请保证前面的数值小于/等于后面的数值",
"BI-Previous_Page": "上一页", "BI-Previous_Page": "上一页",
"BI-No_Select": "搜索结果为空", "BI-No_Select": "搜索结果为空",
"BI-Basic_Clears": "清空", "BI-Basic_Clears": "清空",
"BI-Created_By_Me": "我创建的", "BI-Created_By_Me": "我创建的",
"BI-Basic_Simple_Tuesday": "二", "BI-Basic_Simple_Tuesday": "二",
"BI-Word_Align_Right": "文字居右", "BI-Word_Align_Right": "文字居右",
"BI-Summary_Values": "合计", "BI-Summary_Values": "合计",
"BI-Basic_Clear": "清除", "BI-Basic_Clear": "清除",
"BI-Upload_File_Size_Error": "文件大小不支持", "BI-Upload_File_Size_Error": "文件大小不支持",
"BI-Up_Page": "向上翻页", "BI-Up_Page": "向上翻页",
"BI-Basic_Simple_Sunday": "日", "BI-Basic_Simple_Sunday": "日",
"BI-Multi_Date_Relative_Current_Time": "相对当前时间", "BI-Multi_Date_Relative_Current_Time": "相对当前时间",
"BI-Selected_Data": "已选数据:", "BI-Selected_Data": "已选数据:",
"BI-Multi_Date_Quarter": "季度", "BI-Multi_Date_Quarter": "季度",
"BI-Check_Selected": "查看已选", "BI-Check_Selected": "查看已选",
"BI-Basic_Search": "搜索", "BI-Basic_Search": "搜索",
"BI-Basic_May": "五月", "BI-Basic_May": "五月",
"BI-Continue_Select": "继续选择", "BI-Continue_Select": "继续选择",
"BI-Please_Input_Positive_Integer": "请输入正整数", "BI-Please_Input_Positive_Integer": "请输入正整数",
"BI-Upload_File_Type_Error": "文件类型不支持", "BI-Upload_File_Type_Error": "文件类型不支持",
"BI-Basic_Friday": "星期五", "BI-Basic_Friday": "星期五",
"BI-Down_Page": "向下翻页", "BI-Down_Page": "向下翻页",
"BI-Basic_Monday": "星期一", "BI-Basic_Monday": "星期一",
"BI-Left_Page": "向左翻页", "BI-Left_Page": "向左翻页",
"BI-Transparent_Color": "透明", "BI-Transparent_Color": "透明",
"BI-Basic_Simple_Monday": "一", "BI-Basic_Simple_Monday": "一",
"BI-Multi_Date_Year_End": "年末", "BI-Multi_Date_Year_End": "年末",
"BI-Time_Interval_Error_Text": "请保证开始时间早于/等于时间", "BI-Time_Interval_Error_Text": "请保证开始时间早于/等于时间",
"BI-Basic_Time": "时间", "BI-Basic_Time": "时间",
"BI-Basic_OK": "确定", "BI-Basic_OK": "确定",
"BI-Basic_Sure": "确定", "BI-Basic_Sure": "确定",
"BI-Basic_Simple_Thursday": "四", "BI-Basic_Simple_Thursday": "四",
"BI-Multi_Date_Year_Prev": "年前", "BI-Multi_Date_Year_Prev": "年前",
"BI-Tiao_Data": "条数据", "BI-Tiao_Data": "条数据",
"BI-Basic_Italic": "斜体", "BI-Basic_Italic": "斜体",
"BI-Basic_Dynamic_Title": "动态时间", "BI-Basic_Dynamic_Title": "动态时间",
"BI-Basic_Year": "年", "BI-Basic_Year": "年",
"BI-Basic_Single_Quarter": "季", "BI-Basic_Single_Quarter": "季",
"BI-Basic_Month": "月", "BI-Basic_Month": "月",
"BI-Basic_Week": "周", "BI-Basic_Week": "周",
"BI-Basic_Day": "天", "BI-Basic_Day": "天",
"BI-Basic_Work_Day": "工作日", "BI-Basic_Work_Day": "工作日",
"BI-Basic_Front": "前", "BI-Basic_Front": "前",
"BI-Basic_Behind": "后", "BI-Basic_Behind": "后",
"BI-Basic_Empty": "空", "BI-Basic_Empty": "空",
"BI-Basic_Month_End": "月末", "BI-Basic_Month_End": "月末",
"BI-Basic_Month_Begin": "月初", "BI-Basic_Month_Begin": "月初",
"BI-Basic_Year_End": "年末", "BI-Basic_Year_End": "年末",
"BI-Basic_Year_Begin": "年初", "BI-Basic_Year_Begin": "年初",
"BI-Basic_Quarter_End": "季末", "BI-Basic_Quarter_End": "季末",
"BI-Basic_Quarter_Begin": "季初", "BI-Basic_Quarter_Begin": "季初",
"BI-Basic_Week_End": "周末", "BI-Basic_Week_End": "周末",
"BI-Basic_Week_Begin": "周初", "BI-Basic_Week_Begin": "周初",
"BI-Basic_Current_Day": "当天", "BI-Basic_Current_Day": "当天",
"BI-Basic_Begin_Start": "初", "BI-Basic_Begin_Start": "初",
"BI-Basic_End_Stop": "末", "BI-Basic_End_Stop": "末",
"BI-Basic_Current_Year": "今年", "BI-Basic_Current_Year": "今年",
"BI-Basic_Year_Fen": "年份", "BI-Basic_Year_Fen": "年份",
"BI-Basic_Current_Month": "本月", "BI-Basic_Current_Month": "本月",
"BI-Basic_Current_Quarter": "本季度", "BI-Basic_Current_Quarter": "本季度",
"BI-Basic_Year_Month": "年月", "BI-Basic_Year_Month": "年月",
"BI-Basic_Year_Quarter": "年季度", "BI-Basic_Year_Quarter": "年季度",
"BI-Basic_Input_Can_Not_Null": "输入框不能为空", "BI-Basic_Input_Can_Not_Null": "输入框不能为空",
"BI-Basic_Input_From_To_Number": "请输入{R1}的数值", "BI-Basic_Input_From_To_Number": "请输入{R1}的数值",
"BI-Basic_Date_Time_Error_Text": "日期格式示例:2015-3-11 00:00:00", "BI-Basic_Date_Time_Error_Text": "日期格式示例:2015-3-11 00:00:00",
"BI-Basic_Or": "或", "BI-Basic_Or": "或",
"BI-Basic_And": "且", "BI-Basic_And": "且",
"BI-Conf_Add_Formula": "添加公式", "BI-Conf_Add_Formula": "添加公式",
"BI-Conf_Add_Condition": "添加条件", "BI-Conf_Add_Condition": "添加条件",
"BI-Conf_Formula_And": "且公式条件", "BI-Conf_Formula_And": "且公式条件",
"BI-Conf_Formula_Or": "或公式条件", "BI-Conf_Formula_Or": "或公式条件",
"BI-Conf_Condition_And": "且条件", "BI-Conf_Condition_And": "且条件",
"BI-Conf_Condition_Or": "或条件", "BI-Conf_Condition_Or": "或条件",
"BI-Microsoft_YaHei": "微软雅黑", "BI-Microsoft_YaHei": "微软雅黑",
"BI-Apple_Light": "苹方-light", "BI-Apple_Light": "苹方-light",
"BI-Font_Family": "字体", "BI-Font_Family": "字体",
"BI-Basic_Please_Input_Content": "请输入内容", "BI-Basic_Please_Input_Content": "请输入内容",
"BI-Basic_Please_Enter_Number_Between": "请输入{R1}-{R2}的值", "BI-Basic_Please_Enter_Number_Between": "请输入{R1}-{R2}的值",
"BI-Word_Align_Center": "文字居中", "BI-Word_Align_Center": "文字居中",
"BI-More_Than": "大于", "BI-More_Than": "大于",
"BI-More_And_Equal": "大于等于", "BI-More_And_Equal": "大于等于",
"BI-Please_Enter_SQL": "请输入SQL", "BI-Please_Enter_SQL": "请输入SQL",
"BI-Basic_Click_To_Add_Text": "+点击新增\"{R1}\"", "BI-Basic_Click_To_Add_Text": "+点击新增\"{R1}\"",
"BI-Basic_Please_Select": "请选择", "BI-Basic_Please_Select": "请选择",
"BI-Basic_Font_Color": "文字颜色", "BI-Basic_Font_Color": "文字颜色",
"BI-Basic_Background_Color": "背景色", "BI-Basic_Background_Color": "背景色",
"BI-Basic_Underline": "下划线" "BI-Basic_Underline": "下划线"
}; };

67900
dist/core.js vendored

File diff suppressed because one or more lines are too long

27028
dist/demo.js vendored

File diff suppressed because one or more lines are too long

165228
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

48
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

8
dist/fineui_without_jquery_polyfill.js vendored

@ -17671,6 +17671,12 @@ _.extend(BI, {
s["%Q"] = qr; s["%Q"] = qr;
var re = /%./g; var re = /%./g;
BI.isKhtml = BI.isKhtml || function () {
if(!_global.navigator) {
return false;
}
return /Konqueror|Safari|KHTML/i.test(navigator.userAgent);
};
if (!BI.isKhtml()) { if (!BI.isKhtml()) {
return str.replace(re, function (par) { return str.replace(re, function (par) {
return s[par] || par; return s[par] || par;
@ -17694,7 +17700,7 @@ _.extend(BI, {
* Created by GUY on 2015/6/24. * Created by GUY on 2015/6/24.
*/ */
BI.Func = {}; BI.Func = {};
BI.extend(BI.Func, { _.extend(BI.Func, {
/** /**
* 创建唯一的名字 * 创建唯一的名字
* @param array * @param array

484
dist/polyfill.js vendored

@ -1,243 +1,243 @@
/** /**
* Created by richie on 15/7/8. * Created by richie on 15/7/8.
*/ */
/** /**
* 初始化BI对象 * 初始化BI对象
*/ */
var _global; var _global;
if (typeof window !== "undefined") { if (typeof window !== "undefined") {
_global = window; _global = window;
} else if (typeof global !== "undefined") { } else if (typeof global !== "undefined") {
_global = global; _global = global;
} else if (typeof self !== "undefined") { } else if (typeof self !== "undefined") {
_global = self; _global = self;
} else { } else {
_global = this; _global = this;
} }
if (_global.BI == null) { if (_global.BI == null) {
_global.BI = {prepares: []}; _global.BI = {prepares: []};
} }
if(_global.BI.prepares == null) { if(_global.BI.prepares == null) {
_global.BI.prepares = []; _global.BI.prepares = [];
}// Production steps of ECMA-262, Edition 5, 15.4.4.14 }// Production steps of ECMA-262, Edition 5, 15.4.4.14
// Reference: http://es5.github.io/#x15.4.4.14 // Reference: http://es5.github.io/#x15.4.4.14
if (!Array.prototype.indexOf) { if (!Array.prototype.indexOf) {
Array.prototype.indexOf = function (searchElement, fromIndex) { Array.prototype.indexOf = function (searchElement, fromIndex) {
var k; var k;
// 1. Let o be the result of calling ToObject passing // 1. Let o be the result of calling ToObject passing
// the this value as the argument. // the this value as the argument.
if (this == null) { if (this == null) {
throw new TypeError("\"this\" is null or not defined"); throw new TypeError("\"this\" is null or not defined");
} }
var o = Object(this); var o = Object(this);
// 2. Let lenValue be the result of calling the Get // 2. Let lenValue be the result of calling the Get
// internal method of o with the argument "length". // internal method of o with the argument "length".
// 3. Let len be ToUint32(lenValue). // 3. Let len be ToUint32(lenValue).
var len = o.length >>> 0; var len = o.length >>> 0;
// 4. If len is 0, return -1. // 4. If len is 0, return -1.
if (len === 0) { if (len === 0) {
return -1; return -1;
} }
// 5. If argument fromIndex was passed let n be // 5. If argument fromIndex was passed let n be
// ToInteger(fromIndex); else let n be 0. // ToInteger(fromIndex); else let n be 0.
var n = fromIndex | 0; var n = fromIndex | 0;
// 6. If n >= len, return -1. // 6. If n >= len, return -1.
if (n >= len) { if (n >= len) {
return -1; return -1;
} }
// 7. If n >= 0, then Let k be n. // 7. If n >= 0, then Let k be n.
// 8. Else, n<0, Let k be len - abs(n). // 8. Else, n<0, Let k be len - abs(n).
// If k is less than 0, then let k be 0. // If k is less than 0, then let k be 0.
k = Math.max(n >= 0 ? n : len - Math.abs(n), 0); k = Math.max(n >= 0 ? n : len - Math.abs(n), 0);
// 9. Repeat, while k < len // 9. Repeat, while k < len
while (k < len) { while (k < len) {
// a. Let Pk be ToString(k). // a. Let Pk be ToString(k).
// This is implicit for LHS operands of the in operator // This is implicit for LHS operands of the in operator
// b. Let kPresent be the result of calling the // b. Let kPresent be the result of calling the
// HasProperty internal method of o with argument Pk. // HasProperty internal method of o with argument Pk.
// This step can be combined with c // This step can be combined with c
// c. If kPresent is true, then // c. If kPresent is true, then
// i. Let elementK be the result of calling the Get // i. Let elementK be the result of calling the Get
// internal method of o with the argument ToString(k). // internal method of o with the argument ToString(k).
// ii. Let same be the result of applying the // ii. Let same be the result of applying the
// Strict Equality Comparison Algorithm to // Strict Equality Comparison Algorithm to
// searchElement and elementK. // searchElement and elementK.
// iii. If same is true, return k. // iii. If same is true, return k.
if (k in o && o[k] === searchElement) { if (k in o && o[k] === searchElement) {
return k; return k;
} }
k++; k++;
} }
return -1; return -1;
}; };
} }
if (!Array.prototype.lastIndexOf) { if (!Array.prototype.lastIndexOf) {
Array.prototype.lastIndexOf = function (searchElement /* , fromIndex*/) { Array.prototype.lastIndexOf = function (searchElement /* , fromIndex*/) {
"use strict"; "use strict";
if (this === void 0 || this === null) { if (this === void 0 || this === null) {
throw new TypeError(); throw new TypeError();
} }
var n, k, var n, k,
t = Object(this), t = Object(this),
len = t.length >>> 0; len = t.length >>> 0;
if (len === 0) { if (len === 0) {
return -1; return -1;
} }
n = len - 1; n = len - 1;
if (arguments.length > 1) { if (arguments.length > 1) {
n = Number(arguments[1]); n = Number(arguments[1]);
if (n != n) { if (n != n) {
n = 0; n = 0;
} else if (n != 0 && n != (1 / 0) && n != -(1 / 0)) { } else if (n != 0 && n != (1 / 0) && n != -(1 / 0)) {
n = (n > 0 || -1) * Math.floor(Math.abs(n)); n = (n > 0 || -1) * Math.floor(Math.abs(n));
} }
} }
for (k = n >= 0 for (k = n >= 0
? Math.min(n, len - 1) ? Math.min(n, len - 1)
: len - Math.abs(n); k >= 0; k--) { : len - Math.abs(n); k >= 0; k--) {
if (k in t && t[k] === searchElement) { if (k in t && t[k] === searchElement) {
return k; return k;
} }
} }
return -1; return -1;
}; };
} }
/** /**
* 特殊情况 * 特殊情况
* Created by wang on 15/6/23. * Created by wang on 15/6/23.
*/ */
// 解决console未定义问题 guy // 解决console未定义问题 guy
_global.console = _global.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 () {
}; };
return c; return c;
})(); })();
/* /*
* 前端缓存 * 前端缓存
*/ */
_global.localStorage || (_global.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);
}, },
getItem: function (k) { getItem: function (k) {
return BI.Cache.getCookie(k); return BI.Cache.getCookie(k);
}, },
removeItem: function (k) { removeItem: function (k) {
BI.Cache.deleteCookie(k); BI.Cache.deleteCookie(k);
}, },
key: function () { key: function () {
}, },
clear: function () { clear: function () {
this.items = {}; this.items = {};
} }
}); });
if (!Object.keys) { if (!Object.keys) {
Object.keys = function(o) { Object.keys = function(o) {
if (o !== Object(o)) { if (o !== Object(o)) {
throw new TypeError('Object.keys called on a non-object'); throw new TypeError('Object.keys called on a non-object');
} }
// fix的问题 // fix的问题
var falsy; var falsy;
var skipArray = { var skipArray = {
__ob__: falsy, __ob__: falsy,
$accessors: falsy, $accessors: falsy,
$vbthis: falsy, $vbthis: falsy,
$vbsetter: falsy $vbsetter: falsy
}; };
var k = [], p; var k = [], p;
for (p in o) { for (p in o) {
if (!(p in skipArray)) { if (!(p in skipArray)) {
if (Object.prototype.hasOwnProperty.call(o, p)) { if (Object.prototype.hasOwnProperty.call(o, p)) {
k.push(p); k.push(p);
} }
} }
} }
return k; return k;
}; };
} }
if (!Array.isArray) { if (!Array.isArray) {
Array.isArray = function(arg) { Array.isArray = function(arg) {
return Object.prototype.toString.call(arg) === '[object Array]'; return Object.prototype.toString.call(arg) === '[object Array]';
}; };
} }
// https://stackoverflow.com/questions/10919915/ie8-getprototypeof-method // https://stackoverflow.com/questions/10919915/ie8-getprototypeof-method
if (typeof Object.getPrototypeOf !== "function") { if (typeof Object.getPrototypeOf !== "function") {
Object.getPrototypeOf = "".__proto__ === String.prototype Object.getPrototypeOf = "".__proto__ === String.prototype
? function (object) { ? function (object) {
return object.__proto__; return object.__proto__;
} }
: function (object) { : function (object) {
// May break if the constructor has been tampered with // May break if the constructor has been tampered with
return object.constructor.prototype; return object.constructor.prototype;
}; };
} }
if(!Date.now) { if(!Date.now) {
Date.now = function () { Date.now = function () {
return new Date().valueOf(); return new Date().valueOf();
}; };
}if (typeof Set !== "undefined" && Set.toString().match(/native code/)) { }if (typeof Set !== "undefined" && Set.toString().match(/native code/)) {
} else { } else {
Set = function () { Set = function () {
this.set = {}; this.set = {};
}; };
Set.prototype.has = function (key) { Set.prototype.has = function (key) {
return this.set[key] !== undefined; return this.set[key] !== undefined;
}; };
Set.prototype.add = function (key) { Set.prototype.add = function (key) {
this.set[key] = 1; this.set[key] = 1;
}; };
Set.prototype.clear = function () { Set.prototype.clear = function () {
this.set = {}; this.set = {};
}; };
}// 修复ie9下sort方法的bug }// 修复ie9下sort方法的bug
!function (window) { !function (window) {
var ua = window.navigator.userAgent.toLowerCase(), var ua = window.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;
Array.prototype.sort = function (fn) { Array.prototype.sort = function (fn) {
if (!!fn && typeof fn === "function") { if (!!fn && typeof fn === "function") {
if (this.length < 2) { if (this.length < 2) {
return this; return this;
} }
var i = 0, j = i + 1, l = this.length, tmp, r = false, t = 0; var i = 0, j = i + 1, l = this.length, tmp, r = false, t = 0;
for (; i < l; i++) { for (; i < l; i++) {
for (j = i + 1; j < l; j++) { for (j = i + 1; j < l; j++) {
t = fn.call(this, this[i], this[j]); t = fn.call(this, this[i], this[j]);
r = (typeof t === "number" ? t : r = (typeof t === "number" ? t :
t ? 1 : 0) > 0; t ? 1 : 0) > 0;
if (r === true) { if (r === true) {
tmp = this[i]; tmp = this[i];
this[i] = this[j]; this[i] = this[j];
this[j] = tmp; this[j] = tmp;
} }
} }
} }
return this; return this;
} }
return _sort.call(this); return _sort.call(this);
}; };
} }
}(window); }(window);

1168
dist/router.js vendored

File diff suppressed because it is too large Load Diff

31444
dist/utils.js vendored

File diff suppressed because one or more lines are too long

6
dist/utils.min.js vendored

File diff suppressed because one or more lines are too long

46004
dist/widget.js vendored

File diff suppressed because it is too large Load Diff

6
src/core/func/date.js

@ -198,6 +198,12 @@ _.extend(BI, {
s["%Q"] = qr; s["%Q"] = qr;
var re = /%./g; var re = /%./g;
BI.isKhtml = BI.isKhtml || function () {
if(!_global.navigator) {
return false;
}
return /Konqueror|Safari|KHTML/i.test(navigator.userAgent);
};
if (!BI.isKhtml()) { if (!BI.isKhtml()) {
return str.replace(re, function (par) { return str.replace(re, function (par) {
return s[par] || par; return s[par] || par;

2
src/core/func/function.js

@ -3,7 +3,7 @@
* Created by GUY on 2015/6/24. * Created by GUY on 2015/6/24.
*/ */
BI.Func = {}; BI.Func = {};
BI.extend(BI.Func, { _.extend(BI.Func, {
/** /**
* 创建唯一的名字 * 创建唯一的名字
* @param array * @param array

Loading…
Cancel
Save